function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["./WdsDropdownMenu-DlJ9nTHh.js","./index-ChhimAZ-.js","./index-_4WEo7c5.css","./WdsDropdownMenu-DJ-F3F9N.css"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
import{d as A,c as r,o,e as n,f as u,t as m,a9 as C,U as b,A as z,_ as M,ay as F,az as L,r as O,k as B,as as P,au as D,w as E,H as R,y as w,b as g,aM as N,z as U,G as j,M as _,ab as G,L as H}from"./index-ChhimAZ-.js";import{u as J}from"./floating-ui.vue-BNompikD.js";const K={class:"WdsTag__text"},Q=A({__name:"WdsTag",props:{text:{type:String,required:!0},closable:{type:Boolean,required:!1},size:{type:String,default:"normal"},variant:{type:String,default:"normal"}},emits:{close:()=>!0},setup(t){const c=t,s=r(()=>[`WdsTag--size-${c.size}`,`WdsTag--variant-${c.variant}`]);return(a,l)=>(o(),n("div",{class:z(["WdsTag",s.value])},[u("span",K,m(t.text),1),t.closable?(o(),n("button",{key:0,role:"button",class:"WdsTag__close",onClick:l[0]||(l[0]=C(d=>a.$emit("close"),["stop"]))},l[1]||(l[1]=[u("i",{class:"material-symbols-outlined"},"close",-1)]))):b("",!0)],2))}}),X=M(Q,[["__scopeId","data-v-74f62b16"]]),Y={key:1,class:"material-symbols-outlined"},Z={key:1,class:"BuilderSelect__trigger__multiSelectLabel"},ee=["data-writer-tooltip"],te={class:"BuilderSelect__trigger__arrow"},ae={class:"material-symbols-outlined"},le=A({__name:"BuilderSelect",props:F({options:{type:Array,default:()=>[]},defaultIcon:{type:String,required:!1,default:void 0},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},loading:{type:Boolean,required:!1}},{modelValue:{type:[String,Array],required:!0,default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const c=G(()=>H(()=>import("./WdsDropdownMenu-DlJ9nTHh.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),s=t,a=L(t,"modelValue"),l=O(!1),d=B("trigger"),S=B("dropdown"),x=r(()=>s.enableSearch?[]:[P({allowedPlacements:["bottom","top"]})]),{floatingStyles:I,update:T}=J(d,S,{placement:"bottom",middleware:x}),V=r(()=>l.value?"keyboard_arrow_up":"expand_more"),W=r(()=>a.value?(Array.isArray(a.value)?a.value:[a.value]).filter(Boolean):[]),f=r(()=>W.value.map(e=>s.options.find(i=>i.value===e)??{value:e,label:e})),y=r(()=>a.value&&!s.options.some(e=>e.value===a.value)),h=r(()=>y.value?String(a.value):f.value.map(e=>e.label).sort().join(" / ")),p=r(()=>{var e;return y.value?"help_center":s.hideIcons?"":((e=f.value.at(0))==null?void 0:e.icon)??s.defaultIcon??"help_center"}),k=D(d);E(k,()=>{k.value||R().then(()=>l.value=!1)},{immediate:!0});function $(e){s.enableMultiSelection||(l.value=!1),a.value=e}function q(e){Array.isArray(a.value)&&(a.value=a.value.filter(i=>i!==e))}return(e,i)=>(o(),n("div",{ref_key:"trigger",ref:d,class:"BuilderSelect"},[u("button",{class:"BuilderSelect__trigger",role:"button",onClick:i[0]||(i[0]=v=>l.value=!l.value)},[(y.value||!t.hideIcons)&&!t.enableMultiSelection?(o(),n(w,{key:0},[Array.isArray(p.value)?(o(),g(N,{key:0,urls:p.value},null,8,["urls"])):(o(),n("i",Y,m(p.value),1))],64)):b("",!0),t.enableMultiSelection?(o(),n("div",Z,[(o(!0),n(w,null,U(f.value,v=>(o(),g(X,{key:v.value,text:v.label,closable:"",onClose:oe=>q(v.value)},null,8,["text","onClose"]))),128))])):(o(),n("div",{key:2,class:"BuilderSelect__trigger__label","data-writer-tooltip-strategy":"overflow","data-writer-tooltip":h.value},m(h.value),9,ee)),u("div",te,[u("i",ae,m(V.value),1)])]),l.value?(o(),g(_(c),{key:0,ref_key:"dropdown",ref:S,"enable-search":t.enableSearch,"enable-multi-selection":t.enableMultiSelection,"hide-icons":t.hideIcons,loading:t.loading,options:t.options,selected:a.value,style:j(_(I)),onSelect:$,onSearch:_(T)},null,8,["enable-search","enable-multi-selection","hide-icons","loading","options","selected","style","onSearch"])):b("",!0)],512))}}),ne=M(le,[["__scopeId","data-v-fb054c99"]]);export{ne as default};
