import{r as e,c as i,h as o,H as t}from"./p-CjTHbolG.js";import{randomString as s}from"@verdocs/js-sdk";const l=()=>`verdocs-multiselect{width:100%;display:block;margin:0 0 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif;position:relative}verdocs-multiselect .input-wrapper{width:100%;position:relative}verdocs-multiselect .input-wrapper .icon{top:6px;right:6px;width:18px;height:18px;z-index:10;position:absolute}verdocs-multiselect .trigger{gap:3px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;border-radius:4px;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 32px 5px 7px;background:#ffffff;border:1px solid #707ae5}verdocs-multiselect .trigger::-webkit-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-moz-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger:-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .selected-option{color:white;font-size:12px;padding:2px 6px;border-radius:3px;display:inline-block;background:#46497d}verdocs-multiselect .input-label{display:block;font-weight:700;font-size:14px;margin:0 0 4px 0;color:#555570}verdocs-multiselect .verdocs-multiselect-dropdown{left:0;top:30px;width:210px;z-index:10000;position:absolute;border-radius:5px;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border:1px solid #654dcb}verdocs-multiselect .verdocs-multiselect-dropdown .option{gap:4px;display:-ms-flexbox;display:flex;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;text-wrap:nowrap}verdocs-multiselect .verdocs-multiselect-dropdown label{font-size:13px}#verdocs-multiselect-menu-items{width:200px;z-index:10000;position:absolute;border-radius:5px;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border:1px solid #654dcb}#verdocs-multiselect-menu-items .option{display:-ms-flexbox;display:flex;gap:4px;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-multiselect-menu-items label{font-size:13px}`;const r=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /></svg>`;const a=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5" /></svg>`;const c=class{constructor(o){e(this,o);this.selectionChanged=i(this,"selectionChanged");this.label="";this.placeholder="Select...";this.selectedOptions=[];this.showPicker=false}handleToggleOption(e,i){var o;if(e.target.checked){this.selectedOptions=[...this.selectedOptions,i.value]}else{this.selectedOptions=this.selectedOptions.filter((e=>e!==i.value))}(o=this.selectionChanged)===null||o===void 0?void 0:o.emit({selectedOptions:this.selectedOptions})}render(){const e=`verdocs-dropdown-${s(8)}`;return o(t,{key:"0802ab57bae5e2a5b5748f0141772ac70a0dbb5c",class:this.showPicker?"open":"closed"},o("label",{key:"6d35c91270ceebe996c6d786f96493ae8a76ceb9"},this.label?o("div",{class:"input-label"},this.label+":"):o("div",null),o("div",{key:"6ffa4b9c3f8ccc5fc1e8c334706ebc1eab8a3c8e",class:"input-wrapper"},o("button",{key:"91a5b58d7e32e94a0664ae81761f6d8dd432e920",id:e,class:"trigger",value:"",onClick:()=>this.showPicker=!this.showPicker},this.selectedOptions.length===0?o("span",{class:"placeholder"},this.placeholder):this.selectedOptions.map((e=>{var i;return o("span",{class:"selected-option"},((i=this.options.find((i=>i.value===e)))===null||i===void 0?void 0:i.label)||"Unknown")}))),o("div",{key:"403f5dd6c7107826688698bee75518997519d7a4",class:"icon",innerHTML:this.showPicker?a:r}),this.showPicker&&o("div",{key:"2769288b90e8d3fce287275c7d52b7e96a3c7185",class:"verdocs-multiselect-dropdown"},this.options.map(((e,i)=>o("div",{class:"option",onClick:()=>this.showPicker=false},o("verdocs-checkbox",{size:"small",id:`verdocs-multi-select-opt-${i}`,value:e.value,checked:this.selectedOptions.includes(e.value),onInput:i=>this.handleToggleOption(i,e)}),o("label",{htmlFor:`verdocs-multi-select-option-${i}`},e.label))))))))}};c.style=l();export{c as verdocs_multiselect};
//# sourceMappingURL=p-0638a269.entry.js.map