(function(e,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue")):typeof define=="function"&&define.amd?define(["vue"],s):(e=typeof globalThis<"u"?globalThis:e||self,e.vue3Dropdown=s(e.Vue))})(this,function(e){"use strict";const s=["onClick"],p={class:"vue3-dropdown-items"},_=e.defineComponent({__name:"dropdown",props:{items:{type:Array,default:[]},activeDropDown:{type:Boolean,default:!1}},emits:["hasItem","inActiveDropDown"],setup(n,{emit:t}){const c=n,o=e.computed(()=>c==null?void 0:c.activeDropDown),i=e.ref(""),r=l=>{i.value=l,t("hasItem",l),t("inActiveDropDown")},d=()=>{t("inActiveDropDown")};return e.onMounted(()=>{window.addEventListener("click",d)}),(l,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vue3-dropdown-container",{"active-dropdown":e.unref(o)}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vue3-dropdown-item-wrap",{"clicked-items":a===i.value}]),key:f,onClick:E=>r(a)},[e.createElementVNode("span",p,e.toDisplayString(a),1)],10,s))),128))],2))}}),h="",D=["src"],w=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.7071 8.29289C17.0976 8.68342 17.0976 9.31658 16.7071 9.70711L11.7071 14.7071C11.3166 15.0976 10.6834 15.0976 10.2929 14.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L11 12.5858L15.2929 8.29289C15.6834 7.90237 16.3166 7.90237 16.7071 8.29289Z",fill:"#000"},null,-1)],u=e.defineComponent({__name:"image",props:{activeDropDown:{type:Boolean},img:{type:String},effect:{type:Number}},setup(n){const t=n,c=e.computed(()=>t==null?void 0:t.activeDropDown),o=e.ref(!1);return e.onBeforeMount(()=>{o.value=Boolean(t==null?void 0:t.img)}),(i,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:e.normalizeClass(["vue3-img",[e.unref(c)?`effectRotate${t==null?void 0:t.effect}`:""]]),src:t==null?void 0:t.img},null,10,D)):e.createCommentVNode("",!0),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",{key:1,width:"24",height:"24",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(["vue3-img",[e.unref(c)?`effectRotate${t==null?void 0:t.effect}`:""]])},w,2))],64))}}),C="",g={class:"container"},k={class:"text"},y=e.defineComponent({__name:"vue3-dropdown",props:{items:{type:Array,default:[]},img:{type:String},effect:{type:Number}},emits:["returnItemData"],setup(n,{emit:t}){const c=n,o=e.ref(!1),i=e.ref("1"),r=()=>{event==null||event.stopPropagation(),o.value=!o.value},d=m=>{i.value=m,t("returnItemData",m)},l=()=>{o.value=!1};return e.onBeforeMount(()=>{i.value=c==null?void 0:c.items[0]}),(m,a)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("button",{class:"button",onClick:a[0]||(a[0]=f=>r())},[e.createElementVNode("span",k,e.toDisplayString(i.value),1),e.createVNode(u,{activeDropDown:o.value,img:n.img,effect:n.effect},null,8,["activeDropDown","img","effect"])]),e.createVNode(_,{items:n.items,activeDropDown:o.value,onHasItem:d,onInActiveDropDown:l,onSendInActiveDropDown:l},null,8,["items","activeDropDown"])]))}}),v="";return{install:(n,t)=>{n.component("vue3-dropdown-utils",y)}}});