import{_ as p,o as s,e as o,d as C,au as B,aM as I,av as A,c as y,f as n,t as _,N as i,M as W,aa as v,z as g,r as V,w as q,m as L,aN as N,x as f,y as w,b as S,n as T}from"./index-CUGDV1IA.js";const U={},z={class:"WdsSkeletonLoader","aria-busy":"true"};function F(e,b){return s(),o("div",z)}const x=p(U,[["render",F],["__scopeId","data-v-16706a43"]]),E=["for"],O={key:0,class:"WdsCheckbox__label"},j={key:1,class:"WdsCheckbox__detail"},G=["id","checked","disabled"],H=C({__name:"WdsCheckbox",props:B({label:{type:String,required:!1,default:void 0},detail:{type:String,required:!1,default:void 0},disabled:{type:Boolean,required:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const b=e,a=I(),r=A(e,"modelValue"),u=y(()=>[b.disabled?"WdsCheckbox--disabled":void 0,r.value?"WdsCheckbox--checked":void 0].filter(Boolean));function k(h){r.value=h.target.checked}return(h,c)=>(s(),o("label",{for:W(a),class:g(["WdsCheckbox",u.value]),onMousedown:c[0]||(c[0]=v(()=>{},["prevent"])),onClick:c[1]||(c[1]=v(m=>r.value=!r.value,["prevent"]))},[c[2]||(c[2]=n("div",{class:"WdsCheckbox__checkbox"},[n("i",{class:"WdsCheckbox__checkbox__check material-symbols-outlined"},"check")],-1)),e.label?(s(),o("span",O,_(e.label),1)):i("",!0),e.detail?(s(),o("span",j,_(e.detail),1)):i("",!0),n("input",{id:W(a),type:"checkbox",checked:r.value,disabled:e.disabled,onChange:v(k,["stop"])},null,40,G)],42,E))}}),J=p(H,[["__scopeId","data-v-555ea1ac"]]),K={class:"WdsDropdownMenu"},P={key:0,class:"WdsDropdownMenu__header"},Q={key:0,class:"WdsDropdownMenu__header__multiSelect"},R={class:"WdsDropdownMenu__header__multiSelect__count"},X={key:1,class:"WdsDropdownMenu__header__search"},Y=["disabled"],Z={class:"WdsDropdownMenu__item__label"},ee=["data-automation-key","onClick"],te={key:0,class:"material-symbols-outlined"},ae=["data-writer-tooltip"],se=["data-writer-tooltip"],le={key:2,class:"material-symbols-outlined"},oe=C({__name:"WdsDropdownMenu",props:{options:{type:Array,default:()=>[]},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},enableMultiSelection:{type:Boolean,required:!1},selected:{type:[Array,String],required:!1,default:()=>{}},loading:{type:Boolean,required:!1}},emits:{select:e=>typeof e=="string"||Array.isArray(e),search:e=>typeof e=="string"},setup(e,{emit:b}){const a=e,r=b,u=V(""),k=y(()=>`${(Array.isArray(a.selected)?a.selected:[a.selected]).filter(Boolean).length}/${a.options.length} selected`),h=y(()=>{if(!a.enableSearch)return a.options;const l=u.value.toLowerCase();return a.options.filter(d=>d.label.toLowerCase().includes(l))});function c(l){return a.hideIcons?"":l.icon??"help_center"}function m(l){return Array.isArray(a.selected)?a.selected.includes(l):a.selected===l}const D=y(()=>new Set(a.options.map(l=>l.value)));function M(l){if(!a.enableMultiSelection)return r("select",l);const d=new Set(a.selected);d.has(l)?d.delete(l):d.add(l),r("select",[...d].filter(t=>D.value.has(t)))}return q(u,()=>r("search",u.value)),(l,d)=>(s(),o("div",K,[(e.enableSearch||e.enableMultiSelection)&&!e.loading?(s(),o("div",P,[e.enableMultiSelection?(s(),o("div",Q,[n("div",R,_(k.value),1),n("button",{class:"WdsDropdownMenu__header__multiSelect__clear",role:"button",onClick:d[0]||(d[0]=t=>l.$emit("select",[]))}," Clear all ")])):i("",!0),e.enableSearch?(s(),o("div",X,[d[2]||(d[2]=n("i",{class:"material-symbols-outlined"},"search",-1)),L(n("input",{ref:"searchInput","onUpdate:modelValue":d[1]||(d[1]=t=>u.value=t),class:"WdsDropdownMenu__header__search__input",type:"text",placeholder:"Search",autocomplete:"off",disabled:e.loading},null,8,Y),[[N,u.value]])])):i("",!0)])):i("",!0),e.loading?(s(),o(f,{key:1},w(6,t=>n("button",{key:t,class:"WdsDropdownMenu__item"},[e.enableMultiSelection||!e.hideIcons?(s(),S(x,{key:0,style:{width:"20px"}})):i("",!0),n("div",Z,[T(x)])])),64)):e.enableMultiSelection?(s(!0),o(f,{key:2},w(h.value,t=>(s(),S(J,{key:t.value,class:"WdsDropdownMenu__checkbox",checked:m(t.value),label:t.label,detail:t.detail,"data-automation-key":t.value,"model-value":m(t.value),"onUpdate:modelValue":$=>M(t.value)},null,8,["checked","label","detail","data-automation-key","model-value","onUpdate:modelValue"]))),128)):(s(!0),o(f,{key:3},w(h.value,t=>(s(),o("button",{key:t.value,class:g(["WdsDropdownMenu__item",{"WdsDropdownMenu__item--selected":m(t.value),"WdsDropdownMenu__item--hideIcon":e.hideIcons}]),"data-automation-key":t.value,onClick:$=>M(t.value)},[e.hideIcons?i("",!0):(s(),o("i",te,_(c(t)),1)),n("div",{class:"WdsDropdownMenu__item__label","data-writer-tooltip":t.label,"data-writer-tooltip-strategy":"overflow"},_(t.label),9,ae),t.detail?(s(),o("div",{key:1,class:"WdsDropdownMenu__item__detail","data-writer-tooltip":t.detail,"data-writer-tooltip-strategy":"overflow"},_(t.detail),9,se)):i("",!0),m(t.value)?(s(),o("i",le," check ")):i("",!0)],10,ee))),128))]))}}),ne=p(oe,[["__scopeId","data-v-a17e8350"]]);export{ne as default};
