@opengis/form 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,2 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.FormBuilder={},e.Vue))})(this,(function(exports,vue){"use strict";const _hoisted_1$H={class:"w-full relative"},_hoisted_2$j={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},_hoisted_3$c={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$b={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$M=vue.defineComponent({__name:"vs-layout-default",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$H,[e.ua||e.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$j,[vue.createElementVNode("span",null,vue.toDisplayString(e.ua||e.label),1),e.item?.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$c,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$b,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$G={class:"w-full relative flex flex-row items-center gap-2"},_hoisted_2$i={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},_hoisted_3$b={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$a={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$L=vue.defineComponent({__name:"vs-layout-horizontal",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$G,[e.item?.type!=="html"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$i,[vue.createTextVNode(vue.toDisplayString(e.ua||e.label)+" ",1),e.item?.rules?.includes("required")&&(e.ua||e.label)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$b,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$a,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$F={class:"w-full relative"},_hoisted_2$h={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$K=vue.defineComponent({__name:"vs-layout-inline",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$F,[vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$h,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),layouts$1={default:_sfc_main$M,horizontal:_sfc_main$L,inline:_sfc_main$K};function useStyle(e){return{inputClass:vue.computed(()=>{const r=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return e?.size==="sm"?r+"h-[32px]":r+"h-[38px]"})}}const _hoisted_1$E=["placeholder","disabled"],_sfc_main$J=vue.defineComponent({__name:"vs-input-text",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue");return(n,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(r),{"!border-red-600":e.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$E)),[[vue.vModelText,o.value]])}}),_hoisted_1$D=["placeholder"],_sfc_main$I=vue.defineComponent({__name:"vs-input-number",props:vue.mergeModels({style:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue");return(n,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number","onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),placeholder:e.placeholder,class:vue.normalizeClass(["py-1.5 px-3 block w-full",[vue.unref(r)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$D)),[[vue.vModelText,o.value]])}}),_export_sfc=(e,t)=>{const r=e.__vccOpts||e;for(const[o,n]of t)r[o]=n;return r},_sfc_main$H={},_hoisted_1$C={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function _sfc_render$g(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$C,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const IconCheck=_export_sfc(_sfc_main$H,[["render",_sfc_render$g]]),_hoisted_1$B={class:"flex items-center gap-[4px]"},_hoisted_2$g=["value","id","disabled"],_hoisted_3$a=["for"],_hoisted_4$9={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},_sfc_main$G=vue.defineComponent({__name:"vs-checkbox-default",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},modelValue:Boolean,info:{type:String,default:()=>""},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const r=t,o=e,n=vue.computed({get:()=>o.modelValue,set:s=>r("update:modelValue",s)});return(s,a)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$B,[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",value:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value=i),class:vue.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":e.disabled}]),id:e.id,disabled:e.disabled},null,10,_hoisted_2$g),[[vue.vModelCheckbox,n.value]]),vue.createElementVNode("label",{for:e.id,class:vue.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":e.disabled}])},[vue.createElementVNode("div",{class:vue.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[n.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",e.error?"border-red-600":""]])},[vue.createVNode(IconCheck,{height:"12",width:"12"})],2),vue.createElementVNode("span",_hoisted_4$9,[vue.renderSlot(s.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],10,_hoisted_3$a)]))}}),_hoisted_1$A=["name","value","disabled"],_hoisted_2$f={class:"flex items-center gap-[6px] text-[14px]"},_hoisted_3$9={key:0,class:"text-[16px]"},_hoisted_4$8=["src"],_sfc_main$F=vue.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{type:[String,Number],default:""},modelValue:{type:[Array,String,Boolean],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},icon:{type:String},imgUrl:{type:String},style:{type:Object,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,o=t,n=vue.computed({get:()=>r.modelValue,set:i=>{o("update:modelValue",i)}}),s=vue.computed(()=>Array.isArray(n.value)?n.value.includes(r.value):n.value===!0||n.value===r.value),a=vue.computed(()=>r.style?.size==="xs"?"p-1.5 text-xs":r.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,l)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[a.value,s.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",class:"hidden",name:e.id,value:e.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),disabled:e.disabled},null,8,_hoisted_1$A),[[vue.vModelCheckbox,n.value]]),vue.createElementVNode("span",_hoisted_2$f,[e.icon||e.imgUrl?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$9,[e.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(e.icon)},null,2)):vue.createCommentVNode("",!0),e.imgUrl?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:e.imgUrl,width:"16",height:"16",alt:"icon"},null,8,_hoisted_4$8)):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(i.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],2))}}),VsCheckboxViews={"vs-checkbox-default":_sfc_main$G,"vs-checkbox-buttons":_sfc_main$F},_hoisted_1$z={class:"flex items-center"},_sfc_main$E=vue.defineComponent({__name:"vs-input-checkbox-item",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},view:{type:String,default:()=>"default"},modelValue:{type:[Array,Boolean],default:!1},icon:{type:String},imgUrl:{type:String},slots:{type:Object,default:()=>null},option:{type:[Object,String]},style:{type:String,default:()=>null},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,o=t,n=`radio-${Math.floor(Math.random()*1e4)}`,s=vue.computed({get:()=>Array.isArray(r.modelValue)?Array.isArray(r.modelValue)&&r.modelValue.includes(r.value):r.modelValue,set:i=>{if(Array.isArray(r.modelValue)){let l=[...r.modelValue];i?l.includes(r.value)||l.push(r.value):l=l.filter(u=>u!==r.value),o("update:modelValue",l)}else o("update:modelValue",i)}}),a=vue.ref(`vs-checkbox-${r.view||"default"}`);return(i,l)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$z,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(VsCheckboxViews)?.[a.value]),{value:e.value,label:e.label,info:e.option?.info,disabled:e.disabled,modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=u=>s.value=u),id:n,icon:e.icon,imgUrl:e.imgUrl,style:vue.normalizeStyle(e.style),error:e.error},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),_sfc_main$D={},_hoisted_1$y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function _sfc_render$f(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$y,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const IconChevronDown=_export_sfc(_sfc_main$D,[["render",_sfc_render$f]]),_sfc_main$C={},_hoisted_1$x={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$e(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$x,t[0]||(t[0]=[vue.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),vue.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const IconChevronTopBottom=_export_sfc(_sfc_main$C,[["render",_sfc_render$e]]),_sfc_main$B={},_hoisted_1$w={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function _sfc_render$d(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$w,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),vue.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const IconClose=_export_sfc(_sfc_main$B,[["render",_sfc_render$d]]),_sfc_main$A={},_hoisted_1$v={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$c(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$v,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M12 9h.01"},null,-1),vue.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),vue.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const IconInfo=_export_sfc(_sfc_main$A,[["render",_sfc_render$c]]),_hoisted_1$u={key:0,class:"flex items-start gap-x-1"},_hoisted_2$e={key:0,class:"text-red-500 text-[14px]"},_hoisted_3$8=["title"],_hoisted_4$7=["disabled"],_sfc_main$z=vue.defineComponent({__name:"vs-input-switcher",props:vue.mergeModels({view:{type:String,default:"switch"},label:{type:String,default:""},rules:{type:Array,default:()=>[]},i:{type:String,default:""},text:{type:String,default:""},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""},error:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(r,o)=>e.view==="checkbox"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$u,[vue.createVNode(_sfc_main$E,{modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=n=>t.value=n),label:e.text,error:e.error},null,8,["modelValue","label","error"]),e.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$e,"*")):vue.createCommentVNode("",!0),e.i?(vue.openBlock(),vue.createElementBlock("button",{key:1,class:"cursor-pointer",title:e.i,onClick:o[1]||(o[1]=vue.withModifiers(()=>{},["prevent"]))},[vue.createVNode(vue.unref(IconInfo),{class:"text-gray-500 w-[14px] h-[14px]"})],8,_hoisted_3$8)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("button",{key:1,type:"button",class:vue.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[t.value?`bg-${e.style?.primaryColor||"blue"}-500`:"bg-stone-200",e.customClass]]),disabled:e.disabled,onClick:o[2]||(o[2]=n=>t.value=!t.value)},[vue.createElementVNode("span",{"data-state":"checked",class:vue.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[t.value?"translate-x-4":"translate-x-0"]])},null,2)],10,_hoisted_4$7))}}),_hoisted_1$t=["innerHTML"],_sfc_main$y=vue.defineComponent({__name:"vs-input-static",props:{html:{type:String,default:""},text:{type:String,default:""},customClass:{type:String,default:""}},setup(e){return(t,r)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(e.customClass),innerHTML:(e.html==="",e.text)},null,10,_hoisted_1$t))}}),_hoisted_1$s=["placeholder","disabled"],_sfc_main$x=vue.defineComponent({__name:"vs-input-mask",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},mask:{type:String,default:""},placeholderChar:{type:String,default:"_"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue"),n=vue.ref(""),s={9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},a=vue.computed(()=>t.mask.split("")),i=vue.computed(()=>a.value.filter(c=>s[c]).length),l=vue.computed({get(){let c="",f=0;const v=i.value,h=n.value.slice(0,v);for(const x of a.value)s[x]?f<h.length?(c+=h[f],f++):c+=t.placeholderChar:c+=x;return c},set(c){const f=[],v=a.value,h=i.value;let x=0;for(let y=0;y<v.length;y++){const _=v[y];if(s[_]){for(;x<c.length;){const k=c[x];if(x++,s[_].test(k)){f.push(k);break}}if(f.length>=h)break}}n.value=f.join(""),o.value=c}});function u(c){const f=c.target,v=[],h=a.value,x=i.value;let y=0;for(let _=0;_<h.length;_++){const k=h[_];if(s[k]){for(;y<f.value.length;){const g=f.value[y];if(y++,s[k].test(g)){v.push(g);break}}if(v.length>=x)break}}n.value=v.join(""),o.value=l.value}function d(c){c.key==="Backspace"&&(c.preventDefault(),n.value=n.value.slice(0,-1),o.value=l.value)}return(c,f)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":f[0]||(f[0]=v=>l.value=v),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(r)]]),style:{border:"1px solid #CFD9E0"},onInput:u,onKeydown:d},null,42,_hoisted_1$s)),[[vue.vModelText,l.value]])}}),_hoisted_1$r=["innerHTML"],_sfc_main$w=vue.defineComponent({__name:"vs-input-html",props:{text:{type:String,default:""}},setup(e){const t=e;return(r,o)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{innerHTML:t?.text},null,8,_hoisted_1$r)]))}}),_hoisted_1$q={class:"relative w-full bg-white rounded-lg"},_hoisted_2$d=["placeholder","disabled"],_sfc_main$v=vue.defineComponent({__name:"vs-input-email",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue");return(n,s)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$q,[s[1]||(s[1]=vue.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),vue.withDirectives(vue.createElementVNode("input",{type:"email","onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(r),{"!border-red-600":e.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_2$d),[[vue.vModelText,o.value]])]))}}),_hoisted_1$p=["value","disabled"],_hoisted_2$c={class:"text-[13px] text-gray-700"},_sfc_main$u=vue.defineComponent({__name:"vs-input-radio-default",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(r,o)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center gap-0",[e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=n=>t.value=n),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$p),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",{class:vue.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${e.style?.primaryColor||"blue"}-500`,e.disabled?"opacity-50 cursor-not-allowed":""]])},[t.value==e.value?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${e.style?.primaryColor||"blue"}-500`]])},null,2)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("span",_hoisted_2$c,vue.toDisplayString(e.text),1)],2))}}),_hoisted_1$o=["value","disabled"],_hoisted_2$b={class:"text-[13px] text-gray-700"},_sfc_main$t=vue.defineComponent({__name:"vs-input-radio-buttons",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(r,o)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==e.value?`ring-2 ring-ring ring-${e.style?.primaryColor||"blue"}-500`:"",e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=n=>t.value=n),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$o),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",_hoisted_2$b,vue.toDisplayString(e.text),1)],2))}}),layouts={"vs-input-radio-default":_sfc_main$u,"vs-input-radio-buttons":_sfc_main$t},_sfc_main$s=vue.defineComponent({__name:"vs-input-radio",props:vue.mergeModels({options:{type:Array,required:!0},position:{type:String,default:"vertical"},view:{type:String,default:"default"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=vue.useModel(e,"modelValue"),o=vue.computed(()=>layouts[`vs-input-radio-${t.view}`]);return(n,s)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([e.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.options,a=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(o.value),vue.mergeProps({key:a?.id,text:a.text,value:a.id.toString(),checked:r.value===a.id,modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i)},{ref_for:!0},n.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}});function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{const r=toString$1.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:isArray$1}=Array,isUndefined$1=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined$1(e)&&e.constructor!==null&&!isUndefined$1(e.constructor)&&isFunction$1(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isEmptyObject=e=>{if(!isObject$1(e)||isBuffer(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject$1(e)&&isFunction$1(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction$1(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction$1(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,n;if(typeof e!="object"&&(e=[e]),isArray$1(e))for(o=0,n=e.length;o<n;o++)t.call(null,e[o],o,e);else{if(isBuffer(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(o=0;o<a;o++)i=s[o],t.call(null,e[i],i,e)}}function findKey(e,t){if(isBuffer(e))return null;t=t.toLowerCase();const r=Object.keys(e);let o=r.length,n;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=e=>!isUndefined$1(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},r=(o,n)=>{const s=e&&findKey(t,n)||n;isPlainObject(t[s])&&isPlainObject(o)?t[s]=merge(t[s],o):isPlainObject(o)?t[s]=merge({},o):isArray$1(o)?t[s]=o.slice():t[s]=o};for(let o=0,n=arguments.length;o<n;o++)arguments[o]&&forEach(arguments[o],r);return t}const extend$1=(e,t,r,{allOwnKeys:o}={})=>(forEach(t,(n,s)=>{r&&isFunction$1(n)?e[s]=bind(n,r):e[s]=n},{allOwnKeys:o}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject=(e,t,r,o)=>{let n,s,a;const i={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)a=n[s],(!o||o(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return o!==-1&&o===r},toArray$1=e=>{if(!e)return null;if(isArray$1(e))return e;let t=e.length;if(!isNumber$1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const o=(e&&e[iterator]).call(e);let n;for(;(n=o.next())&&!n.done;){const s=n.value;t.call(e,s[0],s[1])}},matchAll=(e,t)=>{let r;const o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,n){return o.toUpperCase()+n}),hasOwnProperty=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};forEach(r,(n,s)=>{let a;(a=t(n,s,e))!==!1&&(o[s]=a||n)}),Object.defineProperties(e,o)},freezeMethods=e=>{reduceDescriptors(e,(t,r)=>{if(isFunction$1(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const o=e[r];if(isFunction$1(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet=(e,t)=>{const r={},o=n=>{n.forEach(s=>{r[s]=!0})};return isArray$1(e)?o(e):o(String(e).split(t)),r},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction$1(e.append)&&e[toStringTag]==="FormData"&&e[iterator])}const toJSONObject=e=>{const t=new Array(10),r=(o,n)=>{if(isObject$1(o)){if(t.indexOf(o)>=0)return;if(isBuffer(o))return o;if(!("toJSON"in o)){t[n]=o;const s=isArray$1(o)?[]:{};return forEach(o,(a,i)=>{const l=r(a,n+1);!isUndefined$1(l)&&(s[i]=l)}),t[n]=void 0,s}}return o};return r(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject$1(e)||isFunction$1(e))&&isFunction$1(e.then)&&isFunction$1(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((r,o)=>(_global.addEventListener("message",({source:n,data:s})=>{n===_global&&s===r&&o.length&&o.shift()()},!1),n=>{o.push(n),_global.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction$1(e[iterator]),utils$1={isArray:isArray$1,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean,isObject:isObject$1,isPlainObject,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined:isUndefined$1,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend:extend$1,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray:toArray$1,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(e,t,r,o,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),n&&(this.response=n,this.status=n.status?n.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,r,o,n,s)=>{const a=Object.create(prototype$1);return utils$1.toFlatObject(e,a,function(l){return l!==Error.prototype},i=>i!=="isAxiosError"),AxiosError$1.call(a,e.message,t,r,o,n),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){return e?e.concat(t).map(function(n,s){return n=removeBrackets(n),!r&&s?"["+n+"]":n}).join(r?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(t){return/^is[A-Z]/.test(t)});function toFormData$1(e,t,r){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=utils$1.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,y){return!utils$1.isUndefined(y[x])});const o=r.metaTokens,n=r.visitor||d,s=r.dots,a=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(n))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(utils$1.isDate(h))return h.toISOString();if(utils$1.isBoolean(h))return h.toString();if(!l&&utils$1.isBlob(h))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(h)||utils$1.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,x,y){let _=h;if(h&&!y&&typeof h=="object"){if(utils$1.endsWith(x,"{}"))x=o?x:x.slice(0,-2),h=JSON.stringify(h);else if(utils$1.isArray(h)&&isFlatArray(h)||(utils$1.isFileList(h)||utils$1.endsWith(x,"[]"))&&(_=utils$1.toArray(h)))return x=removeBrackets(x),_.forEach(function(g,b){!(utils$1.isUndefined(g)||g===null)&&t.append(a===!0?renderKey([x],b,s):a===null?x:x+"[]",u(g))}),!1}return isVisitable(h)?!0:(t.append(renderKey(y,x,s),u(h)),!1)}const c=[],f=Object.assign(predicates,{defaultVisitor:d,convertValue:u,isVisitable});function v(h,x){if(!utils$1.isUndefined(h)){if(c.indexOf(h)!==-1)throw Error("Circular reference detected in "+x.join("."));c.push(h),utils$1.forEach(h,function(_,k){(!(utils$1.isUndefined(_)||_===null)&&n.call(t,_,utils$1.isString(k)?k.trim():k,x,f))===!0&&v(_,x?x.concat(k):[k])}),c.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return v(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,r){this._pairs.push([t,r])},prototype.toString=function(t){const r=t?function(o){return t.call(this,o,encode$1)}:encode$1;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t)return e;const o=r&&r.encode||encode;utils$1.isFunction(r)&&(r={serialize:r});const n=r&&r.serialize;let s;if(n?s=n(t,r):s=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(o),s){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(o){o!==null&&t(o)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,{visitor:function(r,o,n,s){return platform.isNode&&utils$1.isBuffer(r)?(this.append(o,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},r=Object.keys(e);let o;const n=r.length;let s;for(o=0;o<n;o++)s=r[o],t[s]=e[s];return t}function formDataToJSON(e){function t(r,o,n,s){let a=r[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),l=s>=r.length;return a=!a&&utils$1.isArray(n)?n.length:a,l?(utils$1.hasOwnProp(n,a)?n[a]=[n[a],o]:n[a]=o,!i):((!n[a]||!utils$1.isObject(n[a]))&&(n[a]=[]),t(r,o,n[a],s)&&utils$1.isArray(n[a])&&(n[a]=arrayToObject(n[a])),!i)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const r={};return utils$1.forEachEntry(e,(o,n)=>{t(parsePropPath(o),n,r,0)}),r}return null}function stringifySafely(e,t,r){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}const defaults$1={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const o=r.getContentType()||"",n=o.indexOf("application/json")>-1,s=utils$1.isObject(t);if(s&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return n?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)||utils$1.isReadableStream(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((i=utils$1.isFileList(t))||o.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return toFormData$1(i?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||n?(r.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function(t){const r=this.transitional||defaults$1.transitional,o=r&&r.forcedJSONParsing,n=this.responseType==="json";if(utils$1.isResponse(t)||utils$1.isReadableStream(t))return t;if(t&&utils$1.isString(t)&&(o&&!this.responseType||n)){const a=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?AxiosError$1.from(i,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults$1.headers[e]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let r,o,n;return e&&e.split(`
2
- `).forEach(function(a){n=a.indexOf(":"),r=a.substring(0,n).trim().toLowerCase(),o=a.substring(n+1).trim(),!(!r||t[r]&&ignoreDuplicateOf[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,r,o,n){if(utils$1.isFunction(o))return o.call(this,t,r);if(n&&(t=r),!!utils$1.isString(t)){if(utils$1.isString(o))return t.indexOf(o)!==-1;if(utils$1.isRegExp(o))return o.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function buildAccessors(e,t){const r=utils$1.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(n,s,a){return this[o].call(this,t,n,s,a)},configurable:!0})})}let AxiosHeaders$1=class{constructor(t){t&&this.set(t)}set(t,r,o){const n=this;function s(i,l,u){const d=normalizeHeader(l);if(!d)throw new Error("header name must be a non-empty string");const c=utils$1.findKey(n,d);(!c||n[c]===void 0||u===!0||u===void 0&&n[c]!==!1)&&(n[c||l]=normalizeValue(i))}const a=(i,l)=>utils$1.forEach(i,(u,d)=>s(u,d,l));if(utils$1.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(utils$1.isString(t)&&(t=t.trim())&&!isValidHeaderName(t))a(parseHeaders(t),r);else if(utils$1.isObject(t)&&utils$1.isIterable(t)){let i={},l,u;for(const d of t){if(!utils$1.isArray(d))throw TypeError("Object iterator must return a key-value pair");i[u=d[0]]=(l=i[u])?utils$1.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}a(i,r)}else t!=null&&s(r,t,o);return this}get(t,r){if(t=normalizeHeader(t),t){const o=utils$1.findKey(this,t);if(o){const n=this[o];if(!r)return n;if(r===!0)return parseTokens(n);if(utils$1.isFunction(r))return r.call(this,n,o);if(utils$1.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=normalizeHeader(t),t){const o=utils$1.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||matchHeaderValue(this,this[o],o,r)))}return!1}delete(t,r){const o=this;let n=!1;function s(a){if(a=normalizeHeader(a),a){const i=utils$1.findKey(o,a);i&&(!r||matchHeaderValue(o,o[i],i,r))&&(delete o[i],n=!0)}}return utils$1.isArray(t)?t.forEach(s):s(t),n}clear(t){const r=Object.keys(this);let o=r.length,n=!1;for(;o--;){const s=r[o];(!t||matchHeaderValue(this,this[s],s,t,!0))&&(delete this[s],n=!0)}return n}normalize(t){const r=this,o={};return utils$1.forEach(this,(n,s)=>{const a=utils$1.findKey(o,s);if(a){r[a]=normalizeValue(n),delete r[s];return}const i=t?formatHeader(s):String(s).trim();i!==s&&delete r[s],r[i]=normalizeValue(n),o[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return utils$1.forEach(this,(o,n)=>{o!=null&&o!==!1&&(r[n]=t&&utils$1.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const o=new this(t);return r.forEach(n=>o.set(n)),o}static accessor(t){const o=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function s(a){const i=normalizeHeader(a);o[i]||(buildAccessors(n,a),o[i]=!0)}return utils$1.isArray(t)?t.forEach(s):s(t),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(e,t){const r=this||defaults$1,o=t||r,n=AxiosHeaders$1.from(o.headers);let s=o.data;return utils$1.forEach(e,function(i){s=i.call(r,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function isCancel$1(e){return!!(e&&e.__CANCEL__)}function CanceledError$1(e,t,r){AxiosError$1.call(this,e??"canceled",AxiosError$1.ERR_CANCELED,t,r),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(e,t,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new AxiosError$1("Request failed with status code "+r.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const r=new Array(e),o=new Array(e);let n=0,s=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=o[s];a||(a=u),r[n]=l,o[n]=u;let c=s,f=0;for(;c!==n;)f+=r[c++],c=c%e;if(n=(n+1)%e,n===s&&(s=(s+1)%e),u-a<t)return;const v=d&&u-d;return v?Math.round(f*1e3/v):void 0}}function throttle(e,t){let r=0,o=1e3/t,n,s;const a=(u,d=Date.now())=>{r=d,n=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const d=Date.now(),c=d-r;c>=o?a(u,d):(n=u,s||(s=setTimeout(()=>{s=null,a(n)},o-c)))},()=>n&&a(n)]}const progressEventReducer=(e,t,r=3)=>{let o=0;const n=speedometer(50,250);return throttle(s=>{const a=s.loaded,i=s.lengthComputable?s.total:void 0,l=a-o,u=n(l),d=a<=i;o=a;const c={loaded:a,total:i,progress:i?a/i:void 0,bytes:l,rate:u||void 0,estimated:u&&i&&d?(i-a)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(c)},r)},progressEventDecorator=(e,t)=>{const r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap(()=>e(...t)),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,platform.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,r,o,n,s){const a=[e+"="+encodeURIComponent(t)];utils$1.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),utils$1.isString(o)&&a.push("path="+o),utils$1.isString(n)&&a.push("domain="+n),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,r){let o=!isAbsoluteURL(t);return e&&(o||r==!1)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const r={};function o(u,d,c,f){return utils$1.isPlainObject(u)&&utils$1.isPlainObject(d)?utils$1.merge.call({caseless:f},u,d):utils$1.isPlainObject(d)?utils$1.merge({},d):utils$1.isArray(d)?d.slice():d}function n(u,d,c,f){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(u))return o(void 0,u,c,f)}else return o(u,d,c,f)}function s(u,d){if(!utils$1.isUndefined(d))return o(void 0,d)}function a(u,d){if(utils$1.isUndefined(d)){if(!utils$1.isUndefined(u))return o(void 0,u)}else return o(void 0,d)}function i(u,d,c){if(c in t)return o(u,d);if(c in e)return o(void 0,u)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(u,d,c)=>n(headersToObject(u),headersToObject(d),c,!0)};return utils$1.forEach(Object.keys({...e,...t}),function(d){const c=l[d]||n,f=c(e[d],t[d],d);utils$1.isUndefined(f)&&c!==i||(r[d]=f)}),r}const resolveConfig=e=>{const t=mergeConfig$1({},e);let{data:r,withXSRFToken:o,xsrfHeaderName:n,xsrfCookieName:s,headers:a,auth:i}=t;t.headers=a=AxiosHeaders$1.from(a),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let l;if(utils$1.isFormData(r)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[u,...d]=l?l.split(";").map(c=>c.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(platform.hasStandardBrowserEnv&&(o&&utils$1.isFunction(o)&&(o=o(t)),o||o!==!1&&isURLSameOrigin(t.url))){const u=n&&s&&cookies.read(s);u&&a.set(n,u)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(r,o){const n=resolveConfig(e);let s=n.data;const a=AxiosHeaders$1.from(n.headers).normalize();let{responseType:i,onUploadProgress:l,onDownloadProgress:u}=n,d,c,f,v,h;function x(){v&&v(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(d),n.signal&&n.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout;function _(){if(!y)return;const g=AxiosHeaders$1.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),E={data:!i||i==="text"||i==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:g,config:e,request:y};settle(function(T){r(T),x()},function(T){o(T),x()},E),y=null}"onloadend"in y?y.onloadend=_:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(_)},y.onabort=function(){y&&(o(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,y)),y=null)},y.onerror=function(){o(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let b=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const E=n.transitional||transitionalDefaults;n.timeoutErrorMessage&&(b=n.timeoutErrorMessage),o(new AxiosError$1(b,E.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,y)),y=null},s===void 0&&a.setContentType(null),"setRequestHeader"in y&&utils$1.forEach(a.toJSON(),function(b,E){y.setRequestHeader(E,b)}),utils$1.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),i&&i!=="json"&&(y.responseType=n.responseType),u&&([f,h]=progressEventReducer(u,!0),y.addEventListener("progress",f)),l&&y.upload&&([c,v]=progressEventReducer(l),y.upload.addEventListener("progress",c),y.upload.addEventListener("loadend",v)),(n.cancelToken||n.signal)&&(d=g=>{y&&(o(!g||g.type?new CanceledError$1(null,e,y):g),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(d),n.signal&&(n.signal.aborted?d():n.signal.addEventListener("abort",d)));const k=parseProtocol(n.url);if(k&&platform.protocols.indexOf(k)===-1){o(new AxiosError$1("Unsupported protocol "+k+":",AxiosError$1.ERR_BAD_REQUEST,e));return}y.send(s||null)})},composeSignals=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,n;const s=function(u){if(!n){n=!0,i();const d=u instanceof Error?u:this.reason;o.abort(d instanceof AxiosError$1?d:new CanceledError$1(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,s(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=o;return l.unsubscribe=()=>utils$1.asap(i),l}},streamChunk=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let o=0,n;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},readBytes=async function*(e,t){for await(const r of readStream(e))yield*streamChunk(r,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:o}=await t.read();if(r)break;yield o}}finally{await t.cancel()}},trackStream=(e,t,r,o)=>{const n=readBytes(e,t);let s=0,a,i=l=>{a||(a=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await n.next();if(u){i(),l.close();return}let c=d.byteLength;if(r){let f=s+=c;r(f)}l.enqueue(new Uint8Array(d))}catch(u){throw i(u),u}},cancel(l){return i(l),n.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?r=>r[t]():(r,o)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,o)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,t)=>{const r=utils$1.toFiniteNumber(e.getContentLength());return r??getBodyLength(t)},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:r,data:o,signal:n,cancelToken:s,timeout:a,onDownloadProgress:i,onUploadProgress:l,responseType:u,headers:d,withCredentials:c="same-origin",fetchOptions:f}=resolveConfig(e);u=u?(u+"").toLowerCase():"text";let v=composeSignals([n,s&&s.toAbortSignal()],a),h;const x=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let y;try{if(l&&supportsRequestStream&&r!=="get"&&r!=="head"&&(y=await resolveBodyLength(d,o))!==0){let E=new Request(t,{method:"POST",body:o,duplex:"half"}),O;if(utils$1.isFormData(o)&&(O=E.headers.get("content-type"))&&d.setContentType(O),E.body){const[T,C]=progressEventDecorator(y,progressEventReducer(asyncDecorator(l)));o=trackStream(E.body,DEFAULT_CHUNK_SIZE,T,C)}}utils$1.isString(c)||(c=c?"include":"omit");const _="credentials"in Request.prototype;h=new Request(t,{...f,signal:v,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",credentials:_?c:void 0});let k=await fetch(h,f);const g=supportsResponseStream&&(u==="stream"||u==="response");if(supportsResponseStream&&(i||g&&x)){const E={};["status","statusText","headers"].forEach(N=>{E[N]=k[N]});const O=utils$1.toFiniteNumber(k.headers.get("content-length")),[T,C]=i&&progressEventDecorator(O,progressEventReducer(asyncDecorator(i),!0))||[];k=new Response(trackStream(k.body,DEFAULT_CHUNK_SIZE,T,()=>{C&&C(),x&&x()}),E)}u=u||"text";let b=await resolvers[utils$1.findKey(resolvers,u)||"text"](k,e);return!g&&x&&x(),await new Promise((E,O)=>{settle(E,O,{data:b,headers:AxiosHeaders$1.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:h})})}catch(_){throw x&&x(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,h),{cause:_.cause||_}):AxiosError$1.from(_,_&&_.code,e,h)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let r,o;const n={};for(let s=0;s<t;s++){r=e[s];let a;if(o=r,!isResolvedHandle(r)&&(o=knownAdapters[(a=String(r)).toLowerCase()],o===void 0))throw new AxiosError$1(`Unknown adapter '${a}'`);if(o)break;n[a||"#"+s]=o}if(!o){const s=Object.entries(n).map(([i,l])=>`adapter ${i} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=t?s.length>1?`since :
4
- `+s.map(renderReason).join(`
5
- `):" "+renderReason(s[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(e.adapter||defaults$1.adapter)(e).then(function(o){return throwIfCancellationRequested(e),o.data=transformData.call(e,e.transformResponse,o),o.headers=AxiosHeaders$1.from(o.headers),o},function(o){return isCancel$1(o)||(throwIfCancellationRequested(e),o&&o.response&&(o.response.data=transformData.call(e,e.transformResponse,o.response),o.response.headers=AxiosHeaders$1.from(o.response.headers))),Promise.reject(o)})}const VERSION$1="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(t,r,o){function n(s,a){return"[Axios v"+VERSION$1+"] Transitional option '"+s+"'"+a+(o?". "+o:"")}return(s,a,i)=>{if(t===!1)throw new AxiosError$1(n(a," has been removed"+(r?" in "+r:"")),AxiosError$1.ERR_DEPRECATED);return r&&!deprecatedWarnings[a]&&(deprecatedWarnings[a]=!0,console.warn(n(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,i):!0}},validators$1.spelling=function(t){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function assertOptions(e,t,r){if(typeof e!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let n=o.length;for(;n-- >0;){const s=o[n],a=t[s];if(a){const i=e[s],l=i===void 0||a(i,s,e);if(l!==!0)throw new AxiosError$1("option "+s+" must be "+l,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new AxiosError$1("Unknown option "+s,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const s=n.stack?n.stack.replace(/^.+\n/,""):"";try{o.stack?s&&!String(o.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
- `+s):o.stack=s}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=mergeConfig$1(this.defaults,r);const{transitional:o,paramsSerializer:n,headers:s}=r;o!==void 0&&validator.assertOptions(o,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils$1.isFunction(n)?r.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),validator.assertOptions(r,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=s&&utils$1.merge(s.common,s[r.method]);s&&utils$1.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),r.headers=AxiosHeaders$1.concat(a,s);const i=[];let l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(l=l&&x.synchronous,i.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let d,c=0,f;if(!l){const h=[dispatchRequest.bind(this),void 0];for(h.unshift(...i),h.push(...u),f=h.length,d=Promise.resolve(r);c<f;)d=d.then(h[c++],h[c++]);return d}f=i.length;let v=r;for(c=0;c<f;){const h=i[c++],x=i[c++];try{v=h(v)}catch(y){x.call(this,y);break}}try{d=dispatchRequest.call(this,v)}catch(h){return Promise.reject(h)}for(c=0,f=u.length;c<f;)d=d.then(u[c++],u[c++]);return d}getUri(t){t=mergeConfig$1(this.defaults,t);const r=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(r,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function(t){Axios$1.prototype[t]=function(r,o){return this.request(mergeConfig$1(o||{},{method:t,url:r,data:(o||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(t){function r(o){return function(s,a,i){return this.request(mergeConfig$1(i||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Axios$1.prototype[t]=r(),Axios$1.prototype[t+"Form"]=r(!0)});let CancelToken$1=class L{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const o=this;this.promise.then(n=>{if(!o._listeners)return;let s=o._listeners.length;for(;s-- >0;)o._listeners[s](n);o._listeners=null}),this.promise.then=n=>{let s;const a=new Promise(i=>{o.subscribe(i),s=i}).then(n);return a.cancel=function(){o.unsubscribe(s)},a},t(function(s,a,i){o.reason||(o.reason=new CanceledError$1(s,a,i),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new L(function(n){t=n}),cancel:t}}};function spread$1(e){return function(r){return e.apply(null,r)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),r=bind(Axios$1.prototype.request,t);return utils$1.extend(r,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return createInstance(mergeConfig$1(e,n))},r}const axios=createInstance(defaults$1);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,_sfc_main$r=vue.defineComponent({__name:"vs-input-checkbox",props:{options:{type:Array,default:()=>[]},modelValue:{type:[Boolean,Array],default:!1},position:{default:()=>"vertical"},slots:{type:Object,default:()=>null},view:{type:String,default:()=>null},colSpan:{type:Number,default:()=>0},data:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,o=t,n=vue.ref([]),s=vue.reactive({}),a=d=>d?.value||d?.id||d?.text||d,i=d=>d.text||String(d),l=d=>`lg:col-span-${d||12}`,u=async()=>{try{const{data:d}=await axios.get(`/api/suggest/${r.data}`);n.value=d?.data||d}catch(d){console.error(d)}};return vue.watch(()=>r.modelValue,d=>{if(typeof d=="boolean"&&n.value.length===1){const c=a(n.value[0]);s[c]=d}else if(Array.isArray(d)){const c=new Set(d);n.value.forEach(f=>{if(!f.disabled){const v=a(f);s[v]=c.has(v)}})}},{immediate:!0}),vue.watch(s,()=>{if(!n.value.length){o("update:modelValue",null);return}const d=Object.entries(s).filter(([,c])=>c).map(([c])=>c);o("update:modelValue",d.length===0?null:d)},{deep:!0}),vue.onMounted(()=>{if(r.data)u().then(()=>{if(typeof r.modelValue=="boolean"&&n.value.length===1){const d=a(n.value[0]);s[d]=r.modelValue}else if(Array.isArray(r.modelValue)){const d=new Set(r.modelValue);n.value.forEach(c=>{if(!c.disabled){const f=a(c);s[f]=d.has(f)}})}});else if(n.value=r.options,typeof r.modelValue=="boolean"&&n.value.length===1){const d=a(n.value[0]);s[d]=r.modelValue}else if(Array.isArray(r.modelValue)){const d=new Set(r.modelValue);n.value.forEach(c=>{if(!c.disabled){const f=a(c);s[f]=d.has(f)}})}}),(d,c)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["p-0 w-full gap-[6px]",[e.position==="vertical"?"flex-col":"",e.colSpan?"grid":"flex justify-start"]])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.value,f=>(vue.openBlock(),vue.createBlock(_sfc_main$E,{modelValue:s[a(f)],"onUpdate:modelValue":v=>s[a(f)]=v,value:a(f),class:vue.normalizeClass(l(e.colSpan)),disabled:f.disabled,label:i(f),key:a(f),icon:f?.icon,imgUrl:f?.imgUrl,option:f,slots:e.slots,view:e.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","slots","view"]))),128))],2))}}),VsInputCheckbox=_export_sfc(_sfc_main$r,[["__scopeId","data-v-9685f778"]]),_hoisted_1$n=["placeholder","disabled"],_sfc_main$q=vue.defineComponent({__name:"vs-input-date1",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue");return(n,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"date","onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(r)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$n)),[[vue.vModelText,o.value]])}}),$=(e,t)=>{const r=e.__vccOpts||e;for(const[o,n]of t)r[o]=n;return r};vue.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(e){const{keyCode:t}=e;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const Vt={},zt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function Et(e,t){return vue.openBlock(),vue.createElementBlock("svg",zt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Lt=$(Vt,[["render",Et]]),jt={},Mt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function Pt(e,t){return vue.openBlock(),vue.createElementBlock("svg",Mt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Tt=$(jt,[["render",Pt]]),It={},Rt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function Ot(e,t){return vue.openBlock(),vue.createElementBlock("svg",Rt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)]))}const Dt=$(It,[["render",Ot]]),Ht={},Nt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function At(e,t){return vue.openBlock(),vue.createElementBlock("svg",Nt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Kt=$(Ht,[["render",At]]),qt={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Ut={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Wt={class:"flex-1"},Gt={class:"font-medium text-gray-900"},Zt={class:"mt-0.5 text-sm text-gray-700"},le=vue.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(e){const t={success:Lt,warning:Tt,error:Kt,info:Dt};return(r,o)=>(vue.openBlock(),vue.createElementBlock("div",qt,[vue.createElementVNode("div",Ut,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(t[r.type]))),vue.createElementVNode("div",Wt,[vue.createElementVNode("strong",Gt,vue.toDisplayString(r.title),1),vue.createElementVNode("p",Zt,vue.toDisplayString(r.message),1)]),o[0]||(o[0]=vue.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[vue.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}});vue.reactive({visible:!0});const H={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},jo=e=>{const{type:t="info",title:r,message:o,position:n="right-bottom"}=e||{};let s=document.querySelector("#notify-root");s||(s=document.createElement("div"),s.id="notify-root",s.className=`fixed z-[100] flex flex-col gap-3 ${H[n]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(s)),s.className.includes(H[n])||(Object.values(H).forEach(l=>{s.classList.remove(...l.split(" "))}),s.classList.add(...H[n].split(" ")));const a=document.createElement("div");s.appendChild(a);const i=vue.createApp({render(){return vue.h(le,{type:t,title:r,message:o,onClose:()=>{i.unmount(),a.remove()}})}});i.mount(a),a.querySelector("button")?.addEventListener("click",()=>{a.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),a.remove()},350)}),setTimeout(()=>{a.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),a.remove()},350)},3500)},fileUpload=async(e,t,r,o)=>{try{const n=new FormData;n.append("unique","true"),n.append("file",e);const{data:s}=await axios.post(`/file/upload/uploads?id=${t||""}&form=${r||""}&table=${o||""}`,n);return s}catch(n){jo({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",n)}},fileDelete=async e=>{try{return await axios.get(`file/delete${e}`),!0}catch(t){return console.error(t),!1}},fileDownload=async e=>{try{const t=await axios.get(`file/download/files/uploads${e}`,{responseType:"arraybuffer",headers:{"Content-Type":"application/json"}}),r=t.headers["content-type"],o=new TextDecoder("utf-8").decode(t.data),n=new Blob([o],{type:r}),s=document.createElement("a");s.setAttribute("download",e),s.href=window.URL.createObjectURL(n),s.click()}catch(t){console.error(t.message)}},_sfc_main$p={},_hoisted_1$m={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$b(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$m,t[0]||(t[0]=[vue.createElementVNode("path",{d:"M5 12h14"},null,-1),vue.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const IconPlus=_export_sfc(_sfc_main$p,[["render",_sfc_render$b]]),_sfc_main$o={},_hoisted_1$l={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$a(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$l,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const iconPdf=_export_sfc(_sfc_main$o,[["render",_sfc_render$a]]),_sfc_main$n={},_hoisted_1$k={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$9(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$k,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),vue.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),vue.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const IconCsv=_export_sfc(_sfc_main$n,[["render",_sfc_render$9]]),_sfc_main$m={},_hoisted_1$j={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"};function _sfc_render$8(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$j,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const IconFile=_export_sfc(_sfc_main$m,[["render",_sfc_render$8]]),_sfc_main$l={},_hoisted_1$i={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$7(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$i,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const IconZip=_export_sfc(_sfc_main$l,[["render",_sfc_render$7]]),_sfc_main$k={},_hoisted_1$h={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$6(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$h,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const IconGeojson=_export_sfc(_sfc_main$k,[["render",_sfc_render$6]]),getFileType=e=>{if(!e)return"";const t=e?.split(".");return t[t.length-1]},fileFormatPreview=e=>{const t=getFileType(e),r={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return r.imageFormat.includes(t)?"img":r.sheetsFormat.includes(t)?IconCsv:r.textsFormat.includes(t)?IconGeojson:r.documentsFormat.includes(t)?iconPdf:r.archivesFormat.includes(t)?IconZip:IconFile},_sfc_main$j={},_hoisted_1$g={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function _sfc_render$5(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$g,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const IconDelete=_export_sfc(_sfc_main$j,[["render",_sfc_render$5]]),_sfc_main$i={},_hoisted_1$f={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$4(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$f,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconDownload=_export_sfc(_sfc_main$i,[["render",_sfc_render$4]]),_hoisted_1$e={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},_hoisted_2$a={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},_sfc_main$h=vue.defineComponent({__name:"vs-input-file-list-item",props:vue.mergeModels({multiple:{type:Boolean}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(e){const t=vue.useModel(e,"value"),r=vue.useModel(e,"item"),o=e;return(n,s)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(fileFormatPreview)(r.value)),{src:r.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:s[0]||(s[0]=a=>vue.unref(fileDownload)(r.value))},null,8,["src"])),vue.createElementVNode("div",_hoisted_2$a,[vue.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=a=>{vue.unref(fileDelete)(r.value),t.value=o.multiple?t.value?.filter(i=>i!==r.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[vue.createVNode(IconDelete,{class:"w-4 h-4"})]),vue.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=a=>vue.unref(fileDownload)(r.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[vue.createVNode(IconDownload,{class:"w-4 h-4"})])])]))}}),VsInputFileListItem=_export_sfc(_sfc_main$h,[["__scopeId","data-v-bc0f6d32"]]),_hoisted_1$d={class:"flex items-center gap-x-2"},_hoisted_2$9={key:1,class:"flex items-center flex-wrap gap-2"},_sfc_main$g=vue.defineComponent({__name:"vs-input-file",props:vue.mergeModels({multiple:{type:Boolean},format:{},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=vue.useModel(e,"modelValue"),o=vue.ref(null),n=a=>Array.isArray(r.value)&&r.value[a]||"",s=async a=>{if(t.format){const u=a.target.files?.[0];if(!u||!u.name.endsWith(t.format))return}const i=a.target.files?.[0];if(!i)return;const l=await fileUpload(i,"1","form","table");r.value=t.multiple?[...r.value||[],l.result?.file_path]:l.result?.file_path};return(a,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:o,type:"file",onChange:s},null,544),!a.multiple&&r.value?(vue.openBlock(),vue.createBlock(VsInputFileListItem,{key:0,item:r.value,"onUpdate:item":i[0]||(i[0]=l=>r.value=l),value:r.value,"onUpdate:value":i[1]||(i[1]=l=>r.value=l)},null,8,["item","value"])):a.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$9,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,(l,u)=>(vue.openBlock(),vue.createBlock(VsInputFileListItem,{multiple:a.multiple,key:u,value:r.value,"onUpdate:value":i[2]||(i[2]=d=>r.value=d),item:n(u)},null,8,["multiple","value","item"]))),128)),vue.createElementVNode("div",{onClick:i[3]||(i[3]=l=>!a.disabled&&o.value?.click()),class:vue.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2)])):vue.createCommentVNode("",!0),a.multiple?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=l=>o.value?.click()),class:vue.normalizeClass([a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2))]))}});//! moment.js
7
- //! version : 2.30.1
8
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
9
- //! license : MIT
10
- //! momentjs.com
11
- var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(e){hookCallback=e}function isArray(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function isObject(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function hasOwnProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function isObjectEmpty(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(hasOwnProp(e,t))return!1;return!0}function isUndefined(e){return e===void 0}function isNumber(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function isDate(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function map(e,t){var r=[],o,n=e.length;for(o=0;o<n;++o)r.push(t(e[o],o));return r}function extend(e,t){for(var r in t)hasOwnProp(t,r)&&(e[r]=t[r]);return hasOwnProp(t,"toString")&&(e.toString=t.toString),hasOwnProp(t,"valueOf")&&(e.valueOf=t.valueOf),e}function createUTC(e,t,r,o){return createLocalOrUTC(e,t,r,o,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(e){return e._pf==null&&(e._pf=defaultParsingFlags()),e._pf}var some;Array.prototype.some?some=Array.prototype.some:some=function(e){var t=Object(this),r=t.length>>>0,o;for(o=0;o<r;o++)if(o in t&&e.call(this,t[o],o,t))return!0;return!1};function isValid(e){var t=null,r=!1,o=e._d&&!isNaN(e._d.getTime());if(o&&(t=getParsingFlags(e),r=some.call(t.parsedDateParts,function(n){return n!=null}),o=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(o=o&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=o;else return o;return e._isValid}function createInvalid(e){var t=createUTC(NaN);return e!=null?extend(getParsingFlags(t),e):getParsingFlags(t).userInvalidated=!0,t}var momentProperties=hooks.momentProperties=[],updateInProgress=!1;function copyConfig(e,t){var r,o,n,s=momentProperties.length;if(isUndefined(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),isUndefined(t._i)||(e._i=t._i),isUndefined(t._f)||(e._f=t._f),isUndefined(t._l)||(e._l=t._l),isUndefined(t._strict)||(e._strict=t._strict),isUndefined(t._tzm)||(e._tzm=t._tzm),isUndefined(t._isUTC)||(e._isUTC=t._isUTC),isUndefined(t._offset)||(e._offset=t._offset),isUndefined(t._pf)||(e._pf=getParsingFlags(t)),isUndefined(t._locale)||(e._locale=t._locale),s>0)for(r=0;r<s;r++)o=momentProperties[r],n=t[o],isUndefined(n)||(e[o]=n);return e}function Moment(e){copyConfig(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),updateInProgress===!1&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(e){return e instanceof Moment||e!=null&&e._isAMomentObject!=null}function warn(e){hooks.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function deprecate(e,t){var r=!0;return extend(function(){if(hooks.deprecationHandler!=null&&hooks.deprecationHandler(null,e),r){var o=[],n,s,a,i=arguments.length;for(s=0;s<i;s++){if(n="",typeof arguments[s]=="object"){n+=`
12
- [`+s+"] ";for(a in arguments[0])hasOwnProp(arguments[0],a)&&(n+=a+": "+arguments[0][a]+", ");n=n.slice(0,-2)}else n=arguments[s];o.push(n)}warn(e+`
13
- Arguments: `+Array.prototype.slice.call(o).join("")+`
14
- `+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var deprecations={};function deprecateSimple(e,t){hooks.deprecationHandler!=null&&hooks.deprecationHandler(e,t),deprecations[e]||(warn(t),deprecations[e]=!0)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null;function isFunction(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function set(e){var t,r;for(r in e)hasOwnProp(e,r)&&(t=e[r],isFunction(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(e,t){var r=extend({},e),o;for(o in t)hasOwnProp(t,o)&&(isObject(e[o])&&isObject(t[o])?(r[o]={},extend(r[o],e[o]),extend(r[o],t[o])):t[o]!=null?r[o]=t[o]:delete r[o]);for(o in e)hasOwnProp(e,o)&&!hasOwnProp(t,o)&&isObject(e[o])&&(r[o]=extend({},r[o]));return r}function Locale(e){e!=null&&this.set(e)}var keys;Object.keys?keys=Object.keys:keys=function(e){var t,r=[];for(t in e)hasOwnProp(e,t)&&r.push(t);return r};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(e,t,r){var o=this._calendar[e]||this._calendar.sameElse;return isFunction(o)?o.call(t,r):o}function zeroFill(e,t,r){var o=""+Math.abs(e),n=t-o.length,s=e>=0;return(s?r?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(e,t,r,o){var n=o;typeof o=="string"&&(n=function(){return this[o]()}),e&&(formatTokenFunctions[e]=n),t&&(formatTokenFunctions[t[0]]=function(){return zeroFill(n.apply(this,arguments),t[1],t[2])}),r&&(formatTokenFunctions[r]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function removeFormattingTokens(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function makeFormatFunction(e){var t=e.match(formattingTokens),r,o;for(r=0,o=t.length;r<o;r++)formatTokenFunctions[t[r]]?t[r]=formatTokenFunctions[t[r]]:t[r]=removeFormattingTokens(t[r]);return function(n){var s="",a;for(a=0;a<o;a++)s+=isFunction(t[a])?t[a].call(n,e):t[a];return s}}function formatMoment(e,t){return e.isValid()?(t=expandFormat(t,e.localeData()),formatFunctions[t]=formatFunctions[t]||makeFormatFunction(t),formatFunctions[t](e)):e.localeData().invalidDate()}function expandFormat(e,t){var r=5;function o(n){return t.longDateFormat(n)||n}for(localFormattingTokens.lastIndex=0;r>=0&&localFormattingTokens.test(e);)e=e.replace(localFormattingTokens,o),localFormattingTokens.lastIndex=0,r-=1;return e}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(formattingTokens).map(function(o){return o==="MMMM"||o==="MM"||o==="DD"||o==="dddd"?o.slice(1):o}).join(""),this._longDateFormat[e])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(e){return this._ordinal.replace("%d",e)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(e,t,r,o){var n=this._relativeTime[r];return isFunction(n)?n(e,t,r,o):n.replace(/%d/i,e)}function pastFuture(e,t){var r=this._relativeTime[e>0?"future":"past"];return isFunction(r)?r(t):r.replace(/%s/i,t)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(e){return typeof e=="string"?aliases[e]||aliases[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var t={},r,o;for(o in e)hasOwnProp(e,o)&&(r=normalizeUnits(o),r&&(t[r]=e[o]));return t}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(e){var t=[],r;for(r in e)hasOwnProp(e,r)&&t.push({unit:r,priority:priorities[r]});return t.sort(function(o,n){return o.priority-n.priority}),t}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(e,t,r){regexes[e]=isFunction(t)?t:function(o,n){return o&&r?r:t}}function getParseRegexForToken(e,t){return hasOwnProp(regexes,e)?regexes[e](t._strict,t._locale):new RegExp(unescapeFormat(e))}function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,o,n,s){return r||o||n||s}))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=absFloor(t)),r}var tokens={};function addParseToken(e,t){var r,o=t,n;for(typeof e=="string"&&(e=[e]),isNumber(t)&&(o=function(s,a){a[t]=toInt(s)}),n=e.length,r=0;r<n;r++)tokens[e[r]]=o}function addWeekParseToken(e,t){addParseToken(e,function(r,o,n,s){n._w=n._w||{},t(r,n._w,n,s)})}function addTimeToArrayFromToken(e,t,r){t!=null&&hasOwnProp(tokens,e)&&tokens[e](t,r._a,r,e)}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var e=this.year();return e<=9999?zeroFill(e,4):"+"+e}),addFormatToken(0,["YY",2],0,function(){return this.year()%100}),addFormatToken(0,["YYYY",4],0,"year"),addFormatToken(0,["YYYYY",5],0,"year"),addFormatToken(0,["YYYYYY",6,!0],0,"year"),addRegexToken("Y",matchSigned),addRegexToken("YY",match1to2,match2),addRegexToken("YYYY",match1to4,match4),addRegexToken("YYYYY",match1to6,match6),addRegexToken("YYYYYY",match1to6,match6),addParseToken(["YYYYY","YYYYYY"],YEAR),addParseToken("YYYY",function(e,t){t[YEAR]=e.length===2?hooks.parseTwoDigitYear(e):toInt(e)}),addParseToken("YY",function(e,t){t[YEAR]=hooks.parseTwoDigitYear(e)}),addParseToken("Y",function(e,t){t[YEAR]=parseInt(e,10)});function daysInYear(e){return isLeapYear(e)?366:365}hooks.parseTwoDigitYear=function(e){return toInt(e)+(toInt(e)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(e,t){return function(r){return r!=null?(set$1(this,e,r),hooks.updateOffset(this,t),this):get(this,e)}}function get(e,t){if(!e.isValid())return NaN;var r=e._d,o=e._isUTC;switch(t){case"Milliseconds":return o?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return o?r.getUTCSeconds():r.getSeconds();case"Minutes":return o?r.getUTCMinutes():r.getMinutes();case"Hours":return o?r.getUTCHours():r.getHours();case"Date":return o?r.getUTCDate():r.getDate();case"Day":return o?r.getUTCDay():r.getDay();case"Month":return o?r.getUTCMonth():r.getMonth();case"FullYear":return o?r.getUTCFullYear():r.getFullYear();default:return NaN}}function set$1(e,t,r){var o,n,s,a,i;if(!(!e.isValid()||isNaN(r))){switch(o=e._d,n=e._isUTC,t){case"Milliseconds":return void(n?o.setUTCMilliseconds(r):o.setMilliseconds(r));case"Seconds":return void(n?o.setUTCSeconds(r):o.setSeconds(r));case"Minutes":return void(n?o.setUTCMinutes(r):o.setMinutes(r));case"Hours":return void(n?o.setUTCHours(r):o.setHours(r));case"Date":return void(n?o.setUTCDate(r):o.setDate(r));case"FullYear":break;default:return}s=r,a=e.month(),i=e.date(),i=i===29&&a===1&&!isLeapYear(s)?28:i,n?o.setUTCFullYear(s,a,i):o.setFullYear(s,a,i)}}function stringGet(e){return e=normalizeUnits(e),isFunction(this[e])?this[e]():this}function stringSet(e,t){if(typeof e=="object"){e=normalizeObjectUnits(e);var r=getPrioritizedUnits(e),o,n=r.length;for(o=0;o<n;o++)this[r[o].unit](e[r[o].unit])}else if(e=normalizeUnits(e),isFunction(this[e]))return this[e](t);return this}function mod(e,t){return(e%t+t)%t}var indexOf;Array.prototype.indexOf?indexOf=Array.prototype.indexOf:indexOf=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function daysInMonth(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=mod(t,12);return e+=(t-r)/12,r===1?isLeapYear(e)?29:28:31-r%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1}),addFormatToken("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),addFormatToken("MMMM",0,0,function(e){return this.localeData().months(this,e)}),addRegexToken("M",match1to2,match1to2NoLeadingZero),addRegexToken("MM",match1to2,match2),addRegexToken("MMM",function(e,t){return t.monthsShortRegex(e)}),addRegexToken("MMMM",function(e,t){return t.monthsRegex(e)}),addParseToken(["M","MM"],function(e,t){t[MONTH]=toInt(e)-1}),addParseToken(["MMM","MMMM"],function(e,t,r,o){var n=r._locale.monthsParse(e,o,r._strict);n!=null?t[MONTH]=n:getParsingFlags(r).invalidMonth=e});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(e,t){return e?isArray(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(t)?"format":"standalone"][e.month()]:isArray(this._months)?this._months:this._months.standalone}function localeMonthsShort(e,t){return e?isArray(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(t)?"format":"standalone"][e.month()]:isArray(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(e,t,r){var o,n,s,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;o<12;++o)s=createUTC([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return r?t==="MMM"?(n=indexOf.call(this._shortMonthsParse,a),n!==-1?n:null):(n=indexOf.call(this._longMonthsParse,a),n!==-1?n:null):t==="MMM"?(n=indexOf.call(this._shortMonthsParse,a),n!==-1?n:(n=indexOf.call(this._longMonthsParse,a),n!==-1?n:null)):(n=indexOf.call(this._longMonthsParse,a),n!==-1?n:(n=indexOf.call(this._shortMonthsParse,a),n!==-1?n:null))}function localeMonthsParse(e,t,r){var o,n,s;if(this._monthsParseExact)return handleStrictParse.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;o<12;o++){if(n=createUTC([2e3,o]),r&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),!r&&!this._monthsParse[o]&&(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),r&&t==="MMMM"&&this._longMonthsParse[o].test(e))return o;if(r&&t==="MMM"&&this._shortMonthsParse[o].test(e))return o;if(!r&&this._monthsParse[o].test(e))return o}}function setMonth(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=toInt(t);else if(t=e.localeData().monthsParse(t),!isNumber(t))return e}var r=t,o=e.date();return o=o<29?o:Math.min(o,daysInMonth(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,o):e._d.setMonth(r,o),e}function getSetMonth(e){return e!=null?(setMonth(this,e),hooks.updateOffset(this,!0),this):get(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function e(l,u){return u.length-l.length}var t=[],r=[],o=[],n,s,a,i;for(n=0;n<12;n++)s=createUTC([2e3,n]),a=regexEscape(this.monthsShort(s,"")),i=regexEscape(this.months(s,"")),t.push(a),r.push(i),o.push(i),o.push(a);t.sort(e),r.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function createDate(e,t,r,o,n,s,a){var i;return e<100&&e>=0?(i=new Date(e+400,t,r,o,n,s,a),isFinite(i.getFullYear())&&i.setFullYear(e)):i=new Date(e,t,r,o,n,s,a),i}function createUTCDate(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function firstWeekOffset(e,t,r){var o=7+t-r,n=(7+createUTCDate(e,0,o).getUTCDay()-t)%7;return-n+o-1}function dayOfYearFromWeeks(e,t,r,o,n){var s=(7+r-o)%7,a=firstWeekOffset(e,o,n),i=1+7*(t-1)+s+a,l,u;return i<=0?(l=e-1,u=daysInYear(l)+i):i>daysInYear(e)?(l=e+1,u=i-daysInYear(e)):(l=e,u=i),{year:l,dayOfYear:u}}function weekOfYear(e,t,r){var o=firstWeekOffset(e.year(),t,r),n=Math.floor((e.dayOfYear()-o-1)/7)+1,s,a;return n<1?(a=e.year()-1,s=n+weeksInYear(a,t,r)):n>weeksInYear(e.year(),t,r)?(s=n-weeksInYear(e.year(),t,r),a=e.year()+1):(a=e.year(),s=n),{week:s,year:a}}function weeksInYear(e,t,r){var o=firstWeekOffset(e,t,r),n=firstWeekOffset(e+1,t,r);return(daysInYear(e)-o+n)/7}addFormatToken("w",["ww",2],"wo","week"),addFormatToken("W",["WW",2],"Wo","isoWeek"),addRegexToken("w",match1to2,match1to2NoLeadingZero),addRegexToken("ww",match1to2,match2),addRegexToken("W",match1to2,match1to2NoLeadingZero),addRegexToken("WW",match1to2,match2),addWeekParseToken(["w","ww","W","WW"],function(e,t,r,o){t[o.substr(0,1)]=toInt(e)});function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function getSetISOWeek(e){var t=weekOfYear(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}addFormatToken("d",0,"do","day"),addFormatToken("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),addFormatToken("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),addFormatToken("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),addFormatToken("e",0,0,"weekday"),addFormatToken("E",0,0,"isoWeekday"),addRegexToken("d",match1to2),addRegexToken("e",match1to2),addRegexToken("E",match1to2),addRegexToken("dd",function(e,t){return t.weekdaysMinRegex(e)}),addRegexToken("ddd",function(e,t){return t.weekdaysShortRegex(e)}),addRegexToken("dddd",function(e,t){return t.weekdaysRegex(e)}),addWeekParseToken(["dd","ddd","dddd"],function(e,t,r,o){var n=r._locale.weekdaysParse(e,o,r._strict);n!=null?t.d=n:getParsingFlags(r).invalidWeekday=e}),addWeekParseToken(["d","e","E"],function(e,t,r,o){t[o]=toInt(e)});function parseWeekday(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function parseIsoWeekday(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function shiftWeekdays(e,t){return e.slice(t,7).concat(e.slice(0,t))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(e,t){var r=isArray(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?shiftWeekdays(r,this._week.dow):e?r[e.day()]:r}function localeWeekdaysShort(e){return e===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function localeWeekdaysMin(e){return e===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function handleStrictParse$1(e,t,r){var o,n,s,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=createUTC([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return r?t==="dddd"?(n=indexOf.call(this._weekdaysParse,a),n!==-1?n:null):t==="ddd"?(n=indexOf.call(this._shortWeekdaysParse,a),n!==-1?n:null):(n=indexOf.call(this._minWeekdaysParse,a),n!==-1?n:null):t==="dddd"?(n=indexOf.call(this._weekdaysParse,a),n!==-1||(n=indexOf.call(this._shortWeekdaysParse,a),n!==-1)?n:(n=indexOf.call(this._minWeekdaysParse,a),n!==-1?n:null)):t==="ddd"?(n=indexOf.call(this._shortWeekdaysParse,a),n!==-1||(n=indexOf.call(this._weekdaysParse,a),n!==-1)?n:(n=indexOf.call(this._minWeekdaysParse,a),n!==-1?n:null)):(n=indexOf.call(this._minWeekdaysParse,a),n!==-1||(n=indexOf.call(this._weekdaysParse,a),n!==-1)?n:(n=indexOf.call(this._shortWeekdaysParse,a),n!==-1?n:null))}function localeWeekdaysParse(e,t,r){var o,n,s;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=createUTC([2e3,1]).day(o),r&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[o].test(e))return o;if(r&&t==="ddd"&&this._shortWeekdaysParse[o].test(e))return o;if(r&&t==="dd"&&this._minWeekdaysParse[o].test(e))return o;if(!r&&this._weekdaysParse[o].test(e))return o}}function getSetDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=get(this,"Day");return e!=null?(e=parseWeekday(e,this.localeData()),this.add(e-t,"d")):t}function getSetLocaleDayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function getSetISODayOfWeek(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=parseIsoWeekday(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function e(d,c){return c.length-d.length}var t=[],r=[],o=[],n=[],s,a,i,l,u;for(s=0;s<7;s++)a=createUTC([2e3,1]).day(s),i=regexEscape(this.weekdaysMin(a,"")),l=regexEscape(this.weekdaysShort(a,"")),u=regexEscape(this.weekdays(a,"")),t.push(i),r.push(l),o.push(u),n.push(i),n.push(l),n.push(u);t.sort(e),r.sort(e),o.sort(e),n.sort(e),this._weekdaysRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour"),addFormatToken("h",["hh",2],0,hFormat),addFormatToken("k",["kk",2],0,kFormat),addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)}),addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)}),addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)}),addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(e,t){addFormatToken(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}meridiem("a",!0),meridiem("A",!1);function matchMeridiem(e,t){return t._meridiemParse}addRegexToken("a",matchMeridiem),addRegexToken("A",matchMeridiem),addRegexToken("H",match1to2,match1to2HasZero),addRegexToken("h",match1to2,match1to2NoLeadingZero),addRegexToken("k",match1to2,match1to2NoLeadingZero),addRegexToken("HH",match1to2,match2),addRegexToken("hh",match1to2,match2),addRegexToken("kk",match1to2,match2),addRegexToken("hmm",match3to4),addRegexToken("hmmss",match5to6),addRegexToken("Hmm",match3to4),addRegexToken("Hmmss",match5to6),addParseToken(["H","HH"],HOUR),addParseToken(["k","kk"],function(e,t,r){var o=toInt(e);t[HOUR]=o===24?0:o}),addParseToken(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),addParseToken(["h","hh"],function(e,t,r){t[HOUR]=toInt(e),getParsingFlags(r).bigHour=!0}),addParseToken("hmm",function(e,t,r){var o=e.length-2;t[HOUR]=toInt(e.substr(0,o)),t[MINUTE]=toInt(e.substr(o)),getParsingFlags(r).bigHour=!0}),addParseToken("hmmss",function(e,t,r){var o=e.length-4,n=e.length-2;t[HOUR]=toInt(e.substr(0,o)),t[MINUTE]=toInt(e.substr(o,2)),t[SECOND]=toInt(e.substr(n)),getParsingFlags(r).bigHour=!0}),addParseToken("Hmm",function(e,t,r){var o=e.length-2;t[HOUR]=toInt(e.substr(0,o)),t[MINUTE]=toInt(e.substr(o))}),addParseToken("Hmmss",function(e,t,r){var o=e.length-4,n=e.length-2;t[HOUR]=toInt(e.substr(0,o)),t[MINUTE]=toInt(e.substr(o,2)),t[SECOND]=toInt(e.substr(n))});function localeIsPM(e){return(e+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(e,t){var r,o=Math.min(e.length,t.length);for(r=0;r<o;r+=1)if(e[r]!==t[r])return r;return o}function normalizeLocale(e){return e&&e.toLowerCase().replace("_","-")}function chooseLocale(e){for(var t=0,r,o,n,s;t<e.length;){for(s=normalizeLocale(e[t]).split("-"),r=s.length,o=normalizeLocale(e[t+1]),o=o?o.split("-"):null;r>0;){if(n=loadLocale(s.slice(0,r).join("-")),n)return n;if(o&&o.length>=r&&commonPrefix(s,o)>=r-1)break;r--}t++}return globalLocale}function isLocaleNameSane(e){return!!(e&&e.match("^[^/\\\\]*$"))}function loadLocale(e){var t=null,r;if(locales[e]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(e))try{t=globalLocale._abbr,r=require,r("./locale/"+e),getSetGlobalLocale(t)}catch{locales[e]=null}return locales[e]}function getSetGlobalLocale(e,t){var r;return e&&(isUndefined(t)?r=getLocale(e):r=defineLocale(e,t),r?globalLocale=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(e,t){if(t!==null){var r,o=baseConfig;if(t.abbr=e,locales[e]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=locales[e]._config;else if(t.parentLocale!=null)if(locales[t.parentLocale]!=null)o=locales[t.parentLocale]._config;else if(r=loadLocale(t.parentLocale),r!=null)o=r._config;else return localeFamilies[t.parentLocale]||(localeFamilies[t.parentLocale]=[]),localeFamilies[t.parentLocale].push({name:e,config:t}),null;return locales[e]=new Locale(mergeConfigs(o,t)),localeFamilies[e]&&localeFamilies[e].forEach(function(n){defineLocale(n.name,n.config)}),getSetGlobalLocale(e),locales[e]}else return delete locales[e],null}function updateLocale(e,t){if(t!=null){var r,o,n=baseConfig;locales[e]!=null&&locales[e].parentLocale!=null?locales[e].set(mergeConfigs(locales[e]._config,t)):(o=loadLocale(e),o!=null&&(n=o._config),t=mergeConfigs(n,t),o==null&&(t.abbr=e),r=new Locale(t),r.parentLocale=locales[e],locales[e]=r),getSetGlobalLocale(e)}else locales[e]!=null&&(locales[e].parentLocale!=null?(locales[e]=locales[e].parentLocale,e===getSetGlobalLocale()&&getSetGlobalLocale(e)):locales[e]!=null&&delete locales[e]);return locales[e]}function getLocale(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return globalLocale;if(!isArray(e)){if(t=loadLocale(e),t)return t;e=[e]}return chooseLocale(e)}function listLocales(){return keys(locales)}function checkOverflow(e){var t,r=e._a;return r&&getParsingFlags(e).overflow===-2&&(t=r[MONTH]<0||r[MONTH]>11?MONTH:r[DATE]<1||r[DATE]>daysInMonth(r[YEAR],r[MONTH])?DATE:r[HOUR]<0||r[HOUR]>24||r[HOUR]===24&&(r[MINUTE]!==0||r[SECOND]!==0||r[MILLISECOND]!==0)?HOUR:r[MINUTE]<0||r[MINUTE]>59?MINUTE:r[SECOND]<0||r[SECOND]>59?SECOND:r[MILLISECOND]<0||r[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(e)._overflowDayOfYear&&(t<YEAR||t>DATE)&&(t=DATE),getParsingFlags(e)._overflowWeeks&&t===-1&&(t=WEEK),getParsingFlags(e)._overflowWeekday&&t===-1&&(t=WEEKDAY),getParsingFlags(e).overflow=t),e}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function configFromISO(e){var t,r,o=e._i,n=extendedIsoRegex.exec(o)||basicIsoRegex.exec(o),s,a,i,l,u=isoDates.length,d=isoTimes.length;if(n){for(getParsingFlags(e).iso=!0,t=0,r=u;t<r;t++)if(isoDates[t][1].exec(n[1])){a=isoDates[t][0],s=isoDates[t][2]!==!1;break}if(a==null){e._isValid=!1;return}if(n[3]){for(t=0,r=d;t<r;t++)if(isoTimes[t][1].exec(n[3])){i=(n[2]||" ")+isoTimes[t][0];break}if(i==null){e._isValid=!1;return}}if(!s&&i!=null){e._isValid=!1;return}if(n[4])if(tzRegex.exec(n[4]))l="Z";else{e._isValid=!1;return}e._f=a+(i||"")+(l||""),configFromStringAndFormat(e)}else e._isValid=!1}function extractFromRFC2822Strings(e,t,r,o,n,s){var a=[untruncateYear(e),defaultLocaleMonthsShort.indexOf(t),parseInt(r,10),parseInt(o,10),parseInt(n,10)];return s&&a.push(parseInt(s,10)),a}function untruncateYear(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(e,t,r){if(e){var o=defaultLocaleWeekdaysShort.indexOf(e),n=new Date(t[0],t[1],t[2]).getDay();if(o!==n)return getParsingFlags(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function calculateOffset(e,t,r){if(e)return obsOffsets[e];if(t)return 0;var o=parseInt(r,10),n=o%100,s=(o-n)/100;return s*60+n}function configFromRFC2822(e){var t=rfc2822.exec(preprocessRFC2822(e._i)),r;if(t){if(r=extractFromRFC2822Strings(t[4],t[3],t[2],t[5],t[6],t[7]),!checkWeekday(t[1],r,e))return;e._a=r,e._tzm=calculateOffset(t[8],t[9],t[10]),e._d=createUTCDate.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),getParsingFlags(e).rfc2822=!0}else e._isValid=!1}function configFromString(e){var t=aspNetJsonRegex.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(configFromISO(e),e._isValid===!1)delete e._isValid;else return;if(configFromRFC2822(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:hooks.createFromInputFallback(e)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function defaults(e,t,r){return e??t??r}function currentDateArray(e){var t=new Date(hooks.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function configFromArray(e){var t,r,o=[],n,s,a;if(!e._d){for(n=currentDateArray(e),e._w&&e._a[DATE]==null&&e._a[MONTH]==null&&dayOfYearFromWeekInfo(e),e._dayOfYear!=null&&(a=defaults(e._a[YEAR],n[YEAR]),(e._dayOfYear>daysInYear(a)||e._dayOfYear===0)&&(getParsingFlags(e)._overflowDayOfYear=!0),r=createUTCDate(a,0,e._dayOfYear),e._a[MONTH]=r.getUTCMonth(),e._a[DATE]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=o[t]=n[t];for(;t<7;t++)e._a[t]=o[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[HOUR]===24&&e._a[MINUTE]===0&&e._a[SECOND]===0&&e._a[MILLISECOND]===0&&(e._nextDay=!0,e._a[HOUR]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,o),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[HOUR]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==s&&(getParsingFlags(e).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(e){var t,r,o,n,s,a,i,l,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(s=1,a=4,r=defaults(t.GG,e._a[YEAR],weekOfYear(createLocal(),1,4).year),o=defaults(t.W,1),n=defaults(t.E,1),(n<1||n>7)&&(l=!0)):(s=e._locale._week.dow,a=e._locale._week.doy,u=weekOfYear(createLocal(),s,a),r=defaults(t.gg,e._a[YEAR],u.year),o=defaults(t.w,u.week),t.d!=null?(n=t.d,(n<0||n>6)&&(l=!0)):t.e!=null?(n=t.e+s,(t.e<0||t.e>6)&&(l=!0)):n=s),o<1||o>weeksInYear(r,s,a)?getParsingFlags(e)._overflowWeeks=!0:l!=null?getParsingFlags(e)._overflowWeekday=!0:(i=dayOfYearFromWeeks(r,o,n,s,a),e._a[YEAR]=i.year,e._dayOfYear=i.dayOfYear)}hooks.ISO_8601=function(){},hooks.RFC_2822=function(){};function configFromStringAndFormat(e){if(e._f===hooks.ISO_8601){configFromISO(e);return}if(e._f===hooks.RFC_2822){configFromRFC2822(e);return}e._a=[],getParsingFlags(e).empty=!0;var t=""+e._i,r,o,n,s,a,i=t.length,l=0,u,d;for(n=expandFormat(e._f,e._locale).match(formattingTokens)||[],d=n.length,r=0;r<d;r++)s=n[r],o=(t.match(getParseRegexForToken(s,e))||[])[0],o&&(a=t.substr(0,t.indexOf(o)),a.length>0&&getParsingFlags(e).unusedInput.push(a),t=t.slice(t.indexOf(o)+o.length),l+=o.length),formatTokenFunctions[s]?(o?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(s),addTimeToArrayFromToken(s,o,e)):e._strict&&!o&&getParsingFlags(e).unusedTokens.push(s);getParsingFlags(e).charsLeftOver=i-l,t.length>0&&getParsingFlags(e).unusedInput.push(t),e._a[HOUR]<=12&&getParsingFlags(e).bigHour===!0&&e._a[HOUR]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[HOUR]=meridiemFixWrap(e._locale,e._a[HOUR],e._meridiem),u=getParsingFlags(e).era,u!==null&&(e._a[YEAR]=e._locale.erasConvertYear(u,e._a[YEAR])),configFromArray(e),checkOverflow(e)}function meridiemFixWrap(e,t,r){var o;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(o=e.isPM(r),o&&t<12&&(t+=12),!o&&t===12&&(t=0)),t)}function configFromStringAndArray(e){var t,r,o,n,s,a,i=!1,l=e._f.length;if(l===0){getParsingFlags(e).invalidFormat=!0,e._d=new Date(NaN);return}for(n=0;n<l;n++)s=0,a=!1,t=copyConfig({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[n],configFromStringAndFormat(t),isValid(t)&&(a=!0),s+=getParsingFlags(t).charsLeftOver,s+=getParsingFlags(t).unusedTokens.length*10,getParsingFlags(t).score=s,i?s<o&&(o=s,r=t):(o==null||s<o||a)&&(o=s,r=t,a&&(i=!0));extend(e,r||t)}function configFromObject(e){if(!e._d){var t=normalizeObjectUnits(e._i),r=t.day===void 0?t.date:t.day;e._a=map([t.year,t.month,r,t.hour,t.minute,t.second,t.millisecond],function(o){return o&&parseInt(o,10)}),configFromArray(e)}}function createFromConfig(e){var t=new Moment(checkOverflow(prepareConfig(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function prepareConfig(e){var t=e._i,r=e._f;return e._locale=e._locale||getLocale(e._l),t===null||r===void 0&&t===""?createInvalid({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),isMoment(t)?new Moment(checkOverflow(t)):(isDate(t)?e._d=t:isArray(r)?configFromStringAndArray(e):r?configFromStringAndFormat(e):configFromInput(e),isValid(e)||(e._d=null),e))}function configFromInput(e){var t=e._i;isUndefined(t)?e._d=new Date(hooks.now()):isDate(t)?e._d=new Date(t.valueOf()):typeof t=="string"?configFromString(e):isArray(t)?(e._a=map(t.slice(0),function(r){return parseInt(r,10)}),configFromArray(e)):isObject(t)?configFromObject(e):isNumber(t)?e._d=new Date(t):hooks.createFromInputFallback(e)}function createLocalOrUTC(e,t,r,o,n){var s={};return(t===!0||t===!1)&&(o=t,t=void 0),(r===!0||r===!1)&&(o=r,r=void 0),(isObject(e)&&isObjectEmpty(e)||isArray(e)&&e.length===0)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=r,s._i=e,s._f=t,s._strict=o,createFromConfig(s)}function createLocal(e,t,r,o){return createLocalOrUTC(e,t,r,o,!1)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:createInvalid()}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:createInvalid()});function pickBy(e,t){var r,o;if(t.length===1&&isArray(t[0])&&(t=t[0]),!t.length)return createLocal();for(r=t[0],o=1;o<t.length;++o)(!t[o].isValid()||t[o][e](r))&&(r=t[o]);return r}function min(){var e=[].slice.call(arguments,0);return pickBy("isBefore",e)}function max(){var e=[].slice.call(arguments,0);return pickBy("isAfter",e)}var now=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(e){var t,r=!1,o,n=ordering.length;for(t in e)if(hasOwnProp(e,t)&&!(indexOf.call(ordering,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(o=0;o<n;++o)if(e[ordering[o]]){if(r)return!1;parseFloat(e[ordering[o]])!==toInt(e[ordering[o]])&&(r=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(e){var t=normalizeObjectUnits(e),r=t.year||0,o=t.quarter||0,n=t.month||0,s=t.week||t.isoWeek||0,a=t.day||0,i=t.hour||0,l=t.minute||0,u=t.second||0,d=t.millisecond||0;this._isValid=isDurationValid(t),this._milliseconds=+d+u*1e3+l*6e4+i*1e3*60*60,this._days=+a+s*7,this._months=+n+o*3+r*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(e){return e instanceof Duration}function absRound(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function compareArrays(e,t,r){var o=Math.min(e.length,t.length),n=Math.abs(e.length-t.length),s=0,a;for(a=0;a<o;a++)toInt(e[a])!==toInt(t[a])&&s++;return s+n}function offset(e,t){addFormatToken(e,0,0,function(){var r=this.utcOffset(),o="+";return r<0&&(r=-r,o="-"),o+zeroFill(~~(r/60),2)+t+zeroFill(~~r%60,2)})}offset("Z",":"),offset("ZZ",""),addRegexToken("Z",matchShortOffset),addRegexToken("ZZ",matchShortOffset),addParseToken(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=offsetFromString(matchShortOffset,e)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(e,t){var r=(t||"").match(e),o,n,s;return r===null?null:(o=r[r.length-1]||[],n=(o+"").match(chunkOffset)||["-",0,0],s=+(n[1]*60)+toInt(n[2]),s===0?0:n[0]==="+"?s:-s)}function cloneWithOffset(e,t){var r,o;return t._isUTC?(r=t.clone(),o=(isMoment(e)||isDate(e)?e.valueOf():createLocal(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+o),hooks.updateOffset(r,!1),r):createLocal(e).local()}function getDateOffset(e){return-Math.round(e._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(e,t,r){var o=this._offset||0,n;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=offsetFromString(matchShortOffset,e),e===null)return this}else Math.abs(e)<16&&!r&&(e=e*60);return!this._isUTC&&t&&(n=getDateOffset(this)),this._offset=e,this._isUTC=!0,n!=null&&this.add(n,"m"),o!==e&&(!t||this._changeInProgress?addSubtract(this,createDuration(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?o:getDateOffset(this)}function getSetZone(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function setOffsetToUTC(e){return this.utcOffset(0,e)}function setOffsetToLocal(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(getDateOffset(this),"m")),this}function setOffsetToParsedOffset(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=offsetFromString(matchOffset,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(e){return this.isValid()?(e=e?createLocal(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var e={},t;return copyConfig(e,this),e=prepareConfig(e),e._a?(t=e._isUTC?createUTC(e._a):createLocal(e._a),this._isDSTShifted=this.isValid()&&compareArrays(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,t){var r=e,o=null,n,s,a;return isDuration(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:isNumber(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(o=aspNetRegex.exec(e))?(n=o[1]==="-"?-1:1,r={y:0,d:toInt(o[DATE])*n,h:toInt(o[HOUR])*n,m:toInt(o[MINUTE])*n,s:toInt(o[SECOND])*n,ms:toInt(absRound(o[MILLISECOND]*1e3))*n}):(o=isoRegex.exec(e))?(n=o[1]==="-"?-1:1,r={y:parseIso(o[2],n),M:parseIso(o[3],n),w:parseIso(o[4],n),d:parseIso(o[5],n),h:parseIso(o[6],n),m:parseIso(o[7],n),s:parseIso(o[8],n)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(a=momentsDifference(createLocal(r.from),createLocal(r.to)),r={},r.ms=a.milliseconds,r.M=a.months),s=new Duration(r),isDuration(e)&&hasOwnProp(e,"_locale")&&(s._locale=e._locale),isDuration(e)&&hasOwnProp(e,"_isValid")&&(s._isValid=e._isValid),s}createDuration.fn=Duration.prototype,createDuration.invalid=createInvalid$1;function parseIso(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function positiveMomentsDifference(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function momentsDifference(e,t){var r;return e.isValid()&&t.isValid()?(t=cloneWithOffset(t,e),e.isBefore(t)?r=positiveMomentsDifference(e,t):(r=positiveMomentsDifference(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function createAdder(e,t){return function(r,o){var n,s;return o!==null&&!isNaN(+o)&&(deprecateSimple(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=r,r=o,o=s),n=createDuration(r,o),addSubtract(this,n,e),this}}function addSubtract(e,t,r,o){var n=t._milliseconds,s=absRound(t._days),a=absRound(t._months);e.isValid()&&(o=o??!0,a&&setMonth(e,get(e,"Month")+a*r),s&&set$1(e,"Date",get(e,"Date")+s*r),n&&e._d.setTime(e._d.valueOf()+n*r),o&&hooks.updateOffset(e,s||a))}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString(e){return typeof e=="string"||e instanceof String}function isMomentInput(e){return isMoment(e)||isDate(e)||isString(e)||isNumber(e)||isNumberOrStringArray(e)||isMomentInputObject(e)||e===null||e===void 0}function isMomentInputObject(e){var t=isObject(e)&&!isObjectEmpty(e),r=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],n,s,a=o.length;for(n=0;n<a;n+=1)s=o[n],r=r||hasOwnProp(e,s);return t&&r}function isNumberOrStringArray(e){var t=isArray(e),r=!1;return t&&(r=e.filter(function(o){return!isNumber(o)&&isString(e)}).length===0),t&&r}function isCalendarSpec(e){var t=isObject(e)&&!isObjectEmpty(e),r=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],n,s;for(n=0;n<o.length;n+=1)s=o[n],r=r||hasOwnProp(e,s);return t&&r}function getCalendarFormat(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function calendar$1(e,t){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(e=arguments[0],t=void 0):isCalendarSpec(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||createLocal(),o=cloneWithOffset(r,this).startOf("day"),n=hooks.calendarFormat(this,o)||"sameElse",s=t&&(isFunction(t[n])?t[n].call(this,r):t[n]);return this.format(s||this.localeData().calendar(n,this,createLocal(r)))}function clone(){return new Moment(this)}function isAfter(e,t){var r=isMoment(e)?e:createLocal(e);return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf()):!1}function isBefore(e,t){var r=isMoment(e)?e:createLocal(e);return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf()):!1}function isBetween(e,t,r,o){var n=isMoment(e)?e:createLocal(e),s=isMoment(t)?t:createLocal(t);return this.isValid()&&n.isValid()&&s.isValid()?(o=o||"()",(o[0]==="("?this.isAfter(n,r):!this.isBefore(n,r))&&(o[1]===")"?this.isBefore(s,r):!this.isAfter(s,r))):!1}function isSame(e,t){var r=isMoment(e)?e:createLocal(e),o;return this.isValid()&&r.isValid()?(t=normalizeUnits(t)||"millisecond",t==="millisecond"?this.valueOf()===r.valueOf():(o=r.valueOf(),this.clone().startOf(t).valueOf()<=o&&o<=this.clone().endOf(t).valueOf())):!1}function isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function diff(e,t,r){var o,n,s;if(!this.isValid())return NaN;if(o=cloneWithOffset(e,this),!o.isValid())return NaN;switch(n=(o.utcOffset()-this.utcOffset())*6e4,t=normalizeUnits(t),t){case"year":s=monthDiff(this,o)/12;break;case"month":s=monthDiff(this,o);break;case"quarter":s=monthDiff(this,o)/3;break;case"second":s=(this-o)/1e3;break;case"minute":s=(this-o)/6e4;break;case"hour":s=(this-o)/36e5;break;case"day":s=(this-o-n)/864e5;break;case"week":s=(this-o-n)/6048e5;break;default:s=this-o}return r?s:absFloor(s)}function monthDiff(e,t){if(e.date()<t.date())return-monthDiff(t,e);var r=(t.year()-e.year())*12+(t.month()-e.month()),o=e.clone().add(r,"months"),n,s;return t-o<0?(n=e.clone().add(r-1,"months"),s=(t-o)/(o-n)):(n=e.clone().add(r+1,"months"),s=(t-o)/(n-o)),-(r+s)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(e){if(!this.isValid())return null;var t=e!==!0,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?formatMoment(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(r,"Z")):formatMoment(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,o,n,s;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",s=t+'[")]',this.format(r+o+n+s)}function format(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var t=formatMoment(this,e);return this.localeData().postformat(t)}function from(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fromNow(e){return this.from(createLocal(),e)}function to(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function toNow(e){return this.to(createLocal(),e)}function locale(e){var t;return e===void 0?this._locale._abbr:(t=getLocale(e),t!=null&&(this._locale=t),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(e,t){return(e%t+t)%t}function localStartOfDate(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-MS_PER_400_YEARS:new Date(e,t,r).valueOf()}function utcStartOfDate(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-MS_PER_400_YEARS:Date.UTC(e,t,r)}function startOf(e){var t,r;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":t=this._d.valueOf(),t-=mod$1(t,MS_PER_MINUTE);break;case"second":t=this._d.valueOf(),t-=mod$1(t,MS_PER_SECOND);break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function endOf(e){var t,r;if(e=normalizeUnits(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=MS_PER_HOUR-mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":t=this._d.valueOf(),t+=MS_PER_MINUTE-mod$1(t,MS_PER_MINUTE)-1;break;case"second":t=this._d.valueOf(),t+=MS_PER_SECOND-mod$1(t,MS_PER_SECOND)-1;break}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr"),addFormatToken("NN",0,0,"eraAbbr"),addFormatToken("NNN",0,0,"eraAbbr"),addFormatToken("NNNN",0,0,"eraName"),addFormatToken("NNNNN",0,0,"eraNarrow"),addFormatToken("y",["y",1],"yo","eraYear"),addFormatToken("y",["yy",2],0,"eraYear"),addFormatToken("y",["yyy",3],0,"eraYear"),addFormatToken("y",["yyyy",4],0,"eraYear"),addRegexToken("N",matchEraAbbr),addRegexToken("NN",matchEraAbbr),addRegexToken("NNN",matchEraAbbr),addRegexToken("NNNN",matchEraName),addRegexToken("NNNNN",matchEraNarrow),addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,o){var n=r._locale.erasParse(e,o,r._strict);n?getParsingFlags(r).era=n:getParsingFlags(r).invalidEra=e}),addRegexToken("y",matchUnsigned),addRegexToken("yy",matchUnsigned),addRegexToken("yyy",matchUnsigned),addRegexToken("yyyy",matchUnsigned),addRegexToken("yo",matchEraYearOrdinal),addParseToken(["y","yy","yyy","yyyy"],YEAR),addParseToken(["yo"],function(e,t,r,o){var n;r._locale._eraYearOrdinalRegex&&(n=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[YEAR]=r._locale.eraYearOrdinalParse(e,n):t[YEAR]=parseInt(e,10)});function localeEras(e,t){var r,o,n,s=this._eras||getLocale("en")._eras;for(r=0,o=s.length;r<o;++r){switch(typeof s[r].since){case"string":n=hooks(s[r].since).startOf("day"),s[r].since=n.valueOf();break}switch(typeof s[r].until){case"undefined":s[r].until=1/0;break;case"string":n=hooks(s[r].until).startOf("day").valueOf(),s[r].until=n.valueOf();break}}return s}function localeErasParse(e,t,r){var o,n,s=this.eras(),a,i,l;for(e=e.toUpperCase(),o=0,n=s.length;o<n;++o)if(a=s[o].name.toUpperCase(),i=s[o].abbr.toUpperCase(),l=s[o].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(i===e)return s[o];break;case"NNNN":if(a===e)return s[o];break;case"NNNNN":if(l===e)return s[o];break}else if([a,i,l].indexOf(e)>=0)return s[o]}function localeErasConvertYear(e,t){var r=e.since<=e.until?1:-1;return t===void 0?hooks(e.since).year():hooks(e.since).year()+(t-e.offset)*r}function getEraName(){var e,t,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return o[e].name;return""}function getEraNarrow(){var e,t,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return o[e].narrow;return""}function getEraAbbr(){var e,t,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return o[e].abbr;return""}function getEraYear(){var e,t,r,o,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=n[e].since<=n[e].until?1:-1,o=this.clone().startOf("day").valueOf(),n[e].since<=o&&o<=n[e].until||n[e].until<=o&&o<=n[e].since)return(this.year()-hooks(n[e].since).year())*r+n[e].offset;return this.year()}function erasNameRegex(e){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),e?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(e){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),e?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(e){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),e?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(e,t){return t.erasAbbrRegex(e)}function matchEraName(e,t){return t.erasNameRegex(e)}function matchEraNarrow(e,t){return t.erasNarrowRegex(e)}function matchEraYearOrdinal(e,t){return t._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var e=[],t=[],r=[],o=[],n,s,a,i,l,u=this.eras();for(n=0,s=u.length;n<s;++n)a=regexEscape(u[n].name),i=regexEscape(u[n].abbr),l=regexEscape(u[n].narrow),t.push(a),e.push(i),r.push(l),o.push(a),o.push(i),o.push(l);this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100}),addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(e,t){addFormatToken(0,[e,e.length],0,t)}addWeekYearFormatToken("gggg","weekYear"),addWeekYearFormatToken("ggggg","weekYear"),addWeekYearFormatToken("GGGG","isoWeekYear"),addWeekYearFormatToken("GGGGG","isoWeekYear"),addRegexToken("G",matchSigned),addRegexToken("g",matchSigned),addRegexToken("GG",match1to2,match2),addRegexToken("gg",match1to2,match2),addRegexToken("GGGG",match1to4,match4),addRegexToken("gggg",match1to4,match4),addRegexToken("GGGGG",match1to6,match6),addRegexToken("ggggg",match1to6,match6),addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,o){t[o.substr(0,2)]=toInt(e)}),addWeekParseToken(["gg","GG"],function(e,t,r,o){t[o]=hooks.parseTwoDigitYear(e)});function getSetWeekYear(e){return getSetWeekYearHelper.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(e){return getSetWeekYearHelper.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var e=this.localeData()._week;return weeksInYear(this.year(),e.dow,e.doy)}function getWeeksInWeekYear(){var e=this.localeData()._week;return weeksInYear(this.weekYear(),e.dow,e.doy)}function getSetWeekYearHelper(e,t,r,o,n){var s;return e==null?weekOfYear(this,o,n).year:(s=weeksInYear(e,o,n),t>s&&(t=s),setWeekAll.call(this,e,t,r,o,n))}function setWeekAll(e,t,r,o,n){var s=dayOfYearFromWeeks(e,t,r,o,n),a=createUTCDate(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter"),addRegexToken("Q",match1),addParseToken("Q",function(e,t){t[MONTH]=(toInt(e)-1)*3});function getSetQuarter(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date"),addRegexToken("D",match1to2,match1to2NoLeadingZero),addRegexToken("DD",match1to2,match2),addRegexToken("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),addParseToken(["D","DD"],DATE),addParseToken("Do",function(e,t){t[DATE]=toInt(e.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear"),addRegexToken("DDD",match1to3),addRegexToken("DDDD",match3),addParseToken(["DDD","DDDD"],function(e,t,r){r._dayOfYear=toInt(e)});function getSetDayOfYear(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}addFormatToken("m",["mm",2],0,"minute"),addRegexToken("m",match1to2,match1to2HasZero),addRegexToken("mm",match1to2,match2),addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second"),addRegexToken("s",match1to2,match1to2HasZero),addRegexToken("ss",match1to2,match2),addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)}),addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),addFormatToken(0,["SSS",3],0,"millisecond"),addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10}),addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100}),addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),addRegexToken("S",match1to3,match1),addRegexToken("SS",match1to3,match2),addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(e,t){t[MILLISECOND]=toInt(("0."+e)*1e3)}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1),addFormatToken("z",0,0,"zoneAbbr"),addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add,proto.calendar=calendar$1,proto.clone=clone,proto.diff=diff,proto.endOf=endOf,proto.format=format,proto.from=from,proto.fromNow=fromNow,proto.to=to,proto.toNow=toNow,proto.get=stringGet,proto.invalidAt=invalidAt,proto.isAfter=isAfter,proto.isBefore=isBefore,proto.isBetween=isBetween,proto.isSame=isSame,proto.isSameOrAfter=isSameOrAfter,proto.isSameOrBefore=isSameOrBefore,proto.isValid=isValid$2,proto.lang=lang,proto.locale=locale,proto.localeData=localeData,proto.max=prototypeMax,proto.min=prototypeMin,proto.parsingFlags=parsingFlags,proto.set=stringSet,proto.startOf=startOf,proto.subtract=subtract,proto.toArray=toArray,proto.toObject=toObject,proto.toDate=toDate,proto.toISOString=toISOString,proto.inspect=inspect,typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),proto.toJSON=toJSON,proto.toString=toString,proto.unix=unix,proto.valueOf=valueOf,proto.creationData=creationData,proto.eraName=getEraName,proto.eraNarrow=getEraNarrow,proto.eraAbbr=getEraAbbr,proto.eraYear=getEraYear,proto.year=getSetYear,proto.isLeapYear=getIsLeapYear,proto.weekYear=getSetWeekYear,proto.isoWeekYear=getSetISOWeekYear,proto.quarter=proto.quarters=getSetQuarter,proto.month=getSetMonth,proto.daysInMonth=getDaysInMonth,proto.week=proto.weeks=getSetWeek,proto.isoWeek=proto.isoWeeks=getSetISOWeek,proto.weeksInYear=getWeeksInYear,proto.weeksInWeekYear=getWeeksInWeekYear,proto.isoWeeksInYear=getISOWeeksInYear,proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear,proto.date=getSetDayOfMonth,proto.day=proto.days=getSetDayOfWeek,proto.weekday=getSetLocaleDayOfWeek,proto.isoWeekday=getSetISODayOfWeek,proto.dayOfYear=getSetDayOfYear,proto.hour=proto.hours=getSetHour,proto.minute=proto.minutes=getSetMinute,proto.second=proto.seconds=getSetSecond,proto.millisecond=proto.milliseconds=getSetMillisecond,proto.utcOffset=getSetOffset,proto.utc=setOffsetToUTC,proto.local=setOffsetToLocal,proto.parseZone=setOffsetToParsedOffset,proto.hasAlignedHourOffset=hasAlignedHourOffset,proto.isDST=isDaylightSavingTime,proto.isLocal=isLocal,proto.isUtcOffset=isUtcOffset,proto.isUtc=isUtc,proto.isUTC=isUtc,proto.zoneAbbr=getZoneAbbr,proto.zoneName=getZoneName,proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth),proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth),proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear),proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone),proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(e){return createLocal(e*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(e){return e}var proto$1=Locale.prototype;proto$1.calendar=calendar,proto$1.longDateFormat=longDateFormat,proto$1.invalidDate=invalidDate,proto$1.ordinal=ordinal,proto$1.preparse=preParsePostFormat,proto$1.postformat=preParsePostFormat,proto$1.relativeTime=relativeTime,proto$1.pastFuture=pastFuture,proto$1.set=set,proto$1.eras=localeEras,proto$1.erasParse=localeErasParse,proto$1.erasConvertYear=localeErasConvertYear,proto$1.erasAbbrRegex=erasAbbrRegex,proto$1.erasNameRegex=erasNameRegex,proto$1.erasNarrowRegex=erasNarrowRegex,proto$1.months=localeMonths,proto$1.monthsShort=localeMonthsShort,proto$1.monthsParse=localeMonthsParse,proto$1.monthsRegex=monthsRegex,proto$1.monthsShortRegex=monthsShortRegex,proto$1.week=localeWeek,proto$1.firstDayOfYear=localeFirstDayOfYear,proto$1.firstDayOfWeek=localeFirstDayOfWeek,proto$1.weekdays=localeWeekdays,proto$1.weekdaysMin=localeWeekdaysMin,proto$1.weekdaysShort=localeWeekdaysShort,proto$1.weekdaysParse=localeWeekdaysParse,proto$1.weekdaysRegex=weekdaysRegex,proto$1.weekdaysShortRegex=weekdaysShortRegex,proto$1.weekdaysMinRegex=weekdaysMinRegex,proto$1.isPM=localeIsPM,proto$1.meridiem=localeMeridiem;function get$1(e,t,r,o){var n=getLocale(),s=createUTC().set(o,t);return n[r](s,e)}function listMonthsImpl(e,t,r){if(isNumber(e)&&(t=e,e=void 0),e=e||"",t!=null)return get$1(e,t,r,"month");var o,n=[];for(o=0;o<12;o++)n[o]=get$1(e,o,r,"month");return n}function listWeekdaysImpl(e,t,r,o){typeof e=="boolean"?(isNumber(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,isNumber(t)&&(r=t,t=void 0),t=t||"");var n=getLocale(),s=e?n._week.dow:0,a,i=[];if(r!=null)return get$1(t,(r+s)%7,o,"day");for(a=0;a<7;a++)i[a]=get$1(t,(a+s)%7,o,"day");return i}function listMonths(e,t){return listMonthsImpl(e,t,"months")}function listMonthsShort(e,t){return listMonthsImpl(e,t,"monthsShort")}function listWeekdays(e,t,r){return listWeekdaysImpl(e,t,r,"weekdays")}function listWeekdaysShort(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysShort")}function listWeekdaysMin(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=toInt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}}),hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale),hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var e=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),e.milliseconds=mathAbs(e.milliseconds),e.seconds=mathAbs(e.seconds),e.minutes=mathAbs(e.minutes),e.hours=mathAbs(e.hours),e.months=mathAbs(e.months),e.years=mathAbs(e.years),this}function addSubtract$1(e,t,r,o){var n=createDuration(t,r);return e._milliseconds+=o*n._milliseconds,e._days+=o*n._days,e._months+=o*n._months,e._bubble()}function add$1(e,t){return addSubtract$1(this,e,t,1)}function subtract$1(e,t){return addSubtract$1(this,e,t,-1)}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function bubble(){var e=this._milliseconds,t=this._days,r=this._months,o=this._data,n,s,a,i,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=absCeil(monthsToDays(r)+t)*864e5,t=0,r=0),o.milliseconds=e%1e3,n=absFloor(e/1e3),o.seconds=n%60,s=absFloor(n/60),o.minutes=s%60,a=absFloor(s/60),o.hours=a%24,t+=absFloor(a/24),l=absFloor(daysToMonths(t)),r+=l,t-=absCeil(monthsToDays(l)),i=absFloor(r/12),r%=12,o.days=t,o.months=r,o.years=i,this}function daysToMonths(e){return e*4800/146097}function monthsToDays(e){return e*146097/4800}function as(e){if(!this.isValid())return NaN;var t,r,o=this._milliseconds;if(e=normalizeUnits(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+o/864e5,r=this._months+daysToMonths(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(monthsToDays(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return t*24+o/36e5;case"minute":return t*1440+o/6e4;case"second":return t*86400+o/1e3;case"millisecond":return Math.floor(t*864e5)+o;default:throw new Error("Unknown unit "+e)}}function makeAs(e){return function(){return this.as(e)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1(){return createDuration(this)}function get$2(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN}function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(e,t,r,o,n){return n.relativeTime(t||1,!!r,e,o)}function relativeTime$1(e,t,r,o){var n=createDuration(e).abs(),s=round(n.as("s")),a=round(n.as("m")),i=round(n.as("h")),l=round(n.as("d")),u=round(n.as("M")),d=round(n.as("w")),c=round(n.as("y")),f=s<=r.ss&&["s",s]||s<r.s&&["ss",s]||a<=1&&["m"]||a<r.m&&["mm",a]||i<=1&&["h"]||i<r.h&&["hh",i]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(f=f||d<=1&&["w"]||d<r.w&&["ww",d]),f=f||u<=1&&["M"]||u<r.M&&["MM",u]||c<=1&&["y"]||["yy",c],f[2]=t,f[3]=+e>0,f[4]=o,substituteTimeAgo.apply(null,f)}function getSetRelativeTimeRounding(e){return e===void 0?round:typeof e=="function"?(round=e,!0):!1}function getSetRelativeTimeThreshold(e,t){return thresholds[e]===void 0?!1:t===void 0?thresholds[e]:(thresholds[e]=t,e==="s"&&(thresholds.ss=t-1),!0)}function humanize(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,o=thresholds,n,s;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(o=Object.assign({},thresholds,t),t.s!=null&&t.ss==null&&(o.ss=t.s-1)),n=this.localeData(),s=relativeTime$1(this,!r,o,n),r&&(s=n.pastFuture(+this,s)),n.postformat(s)}var abs$1=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e=abs$1(this._milliseconds)/1e3,t=abs$1(this._days),r=abs$1(this._months),o,n,s,a,i=this.asSeconds(),l,u,d,c;return i?(o=absFloor(e/60),n=absFloor(o/60),e%=60,o%=60,s=absFloor(r/12),r%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=i<0?"-":"",u=sign(this._months)!==sign(i)?"-":"",d=sign(this._days)!==sign(i)?"-":"",c=sign(this._milliseconds)!==sign(i)?"-":"",l+"P"+(s?u+s+"Y":"")+(r?u+r+"M":"")+(t?d+t+"D":"")+(n||o||e?"T":"")+(n?c+n+"H":"")+(o?c+o+"M":"")+(e?c+a+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1,proto$2.abs=abs,proto$2.add=add$1,proto$2.subtract=subtract$1,proto$2.as=as,proto$2.asMilliseconds=asMilliseconds,proto$2.asSeconds=asSeconds,proto$2.asMinutes=asMinutes,proto$2.asHours=asHours,proto$2.asDays=asDays,proto$2.asWeeks=asWeeks,proto$2.asMonths=asMonths,proto$2.asQuarters=asQuarters,proto$2.asYears=asYears,proto$2.valueOf=valueOf$1,proto$2._bubble=bubble,proto$2.clone=clone$1,proto$2.get=get$2,proto$2.milliseconds=milliseconds,proto$2.seconds=seconds,proto$2.minutes=minutes,proto$2.hours=hours,proto$2.days=days,proto$2.weeks=weeks,proto$2.months=months,proto$2.years=years,proto$2.humanize=humanize,proto$2.toISOString=toISOString$1,proto$2.toString=toISOString$1,proto$2.toJSON=toISOString$1,proto$2.locale=locale,proto$2.localeData=localeData,proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1),proto$2.lang=lang,addFormatToken("X",0,0,"unix"),addFormatToken("x",0,0,"valueOf"),addRegexToken("x",matchSigned),addRegexToken("X",matchTimestamp),addParseToken("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)}),addParseToken("x",function(e,t,r){r._d=new Date(toInt(e))});//! moment.js
15
- hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min,hooks.max=max,hooks.now=now,hooks.utc=createUTC,hooks.unix=createUnix,hooks.months=listMonths,hooks.isDate=isDate,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=listWeekdays,hooks.parseZone=createInZone,hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=listMonthsShort,hooks.weekdaysMin=listWeekdaysMin,hooks.defineLocale=defineLocale,hooks.updateLocale=updateLocale,hooks.locales=listLocales,hooks.weekdaysShort=listWeekdaysShort,hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=getSetRelativeTimeRounding,hooks.relativeTimeThreshold=getSetRelativeTimeThreshold,hooks.calendarFormat=getCalendarFormat,hooks.prototype=proto,hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const _sfc_main$f={componens:{IconFile},props:{item:null},computed:{createDate(){try{const e=hooks(this.item.cdate,"YYYY-MM-DD");return new Date(e).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{formatBytes(e){if(e<1024)return`${e} B`;const t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`}}},_hoisted_1$c={class:"max-w-[55vw]"},_hoisted_2$8={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},_hoisted_3$7={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},_hoisted_4$6={class:"px-[5px]"},_hoisted_5$6={class:""};function _sfc_render$3(e,t,r,o,n,s){return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[t[1]||(t[1]=vue.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),vue.createElementVNode("div",_hoisted_1$c,[vue.createElementVNode("p",_hoisted_2$8,vue.toDisplayString(r.item?.uploaded_name),1),vue.createElementVNode("p",_hoisted_3$7,[vue.createElementVNode("span",null,vue.toDisplayString(r.item?.username),1),vue.withDirectives(vue.createElementVNode("span",_hoisted_4$6,"|",512),[[vue.vShow,r.item?.username]]),vue.createElementVNode("span",null,vue.toDisplayString(s.createDate),1),t[0]||(t[0]=vue.createElementVNode("span",{class:"px-[5px]"},"|",-1)),vue.createElementVNode("span",_hoisted_5$6,vue.toDisplayString(s.formatBytes(r.item?.size)),1)])])],64)}const VsWidgetFileInfo=_export_sfc(_sfc_main$f,[["render",_sfc_render$3]]),_sfc_main$e={components:{VsWidgetFileInfo,IconDownload,IconTrash:IconDelete},props:{item:null,index:{type:Number,default:0},prefix:{type:String,default:"/api"}},data(){return{optionsFile:{defaultType:"iframe"}}},computed:{createDate(){try{const e=hooks(this.item.cdate,"YYYY-MM-DD");return new Date(e).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{isSupportedFile(e){return["pdf","json"].includes(e.ext)},isSupportedAllFile(e){return["ppt","pptx","doc","docx","xls","xlsx"].includes(e.ext)},async downloadFile(e){const t=document.createElement("a");t.setAttribute("download",e?.uploaded_name),t.href=e?.file_path,t.click()},confirnDeleteFile(){this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteFile,updateListOnConfirm:!0})},async deleteFile(){try{await axios.delete(`${this.prefix}/widget/file/${this.item.entity_id}/${this.item.file_id}`),this.$emit("update")}catch(e){console.error(e)}},changeLightbox(e){(this.item.ext==="jpg"||this.item.ext==="png")&&this.$emit("openLightbox",{item:this.item,index:e})}}},_hoisted_1$b={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},_hoisted_2$7={key:0,class:"flex w-full gap-x-3 items-center"},_hoisted_3$6={key:1,class:"flex gap-x-3 w-full items-center"},_hoisted_4$5={key:2,class:"flex gap-x-3 w-full items-center"},_hoisted_5$5=["href"],_hoisted_6$5={key:3,class:"flex gap-x-3 w-full items-center"},_hoisted_7$5={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},_hoisted_8$3={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},_hoisted_9$3={class:"inline-block"},_hoisted_10$2={class:"inline-block"};function _sfc_render$2(e,t,r,o,n,s){const a=vue.resolveComponent("VsWidgetFileInfo"),i=vue.resolveComponent("IconDownload"),l=vue.resolveComponent("IconTrash");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[r.item.ext==="jpg"||r.item.ext==="png"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$7,[vue.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:t[0]||(t[0]=u=>s.changeLightbox(r.index))},[vue.createVNode(a,{item:r.item},null,8,["item"])])])):s.isSupportedFile(r.item)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[vue.createVNode(a,{item:r.item},null,8,["item"])])):s.isSupportedAllFile(r.item)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$5,[vue.createElementVNode("a",{href:`/api/file-preview?id=${r.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[vue.createVNode(a,{item:r.item},null,8,["item"])],8,_hoisted_5$5)])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$5,[vue.createVNode(a,{item:r.item},null,8,["item"])])),vue.createElementVNode("div",_hoisted_7$5,[vue.createElementVNode("div",_hoisted_8$3,[vue.createElementVNode("div",_hoisted_9$3,[vue.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:t[1]||(t[1]=u=>s.downloadFile(r.item))},[vue.createVNode(i,{height:"14",width:"14"})])]),t[3]||(t[3]=vue.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),vue.createElementVNode("div",_hoisted_10$2,[vue.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:t[2]||(t[2]=u=>s.confirnDeleteFile())},[vue.createVNode(l,{height:"14",width:"14"})])])])])])}const VsWidgetFileItem=_export_sfc(_sfc_main$e,[["render",_sfc_render$2]]),_sfc_main$d={},_hoisted_1$a={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$1(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$a,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconUpload=_export_sfc(_sfc_main$d,[["render",_sfc_render$1]]),_hoisted_1$9={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},_hoisted_2$6={class:"flex w-full mb-[12px] items-center gap-x-2"},_hoisted_3$5={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},_hoisted_4$4={class1:"ml-auto"},_hoisted_5$4={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},_hoisted_6$4={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},_hoisted_7$4={class:"relative"},_hoisted_8$2={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},_hoisted_9$2={key:0},_sfc_main$c={__name:"vs-input-file-list",props:{id:{type:String,default:""},prefix:{type:String,default:"/api"}},emits:["update"],setup(e,{emit:t}){const r=e,o=vue.inject("form"),n=vue.computed(()=>o.value.formId),s=vue.ref(!1),a=vue.ref(0),i=t,l=vue.ref(!1),u=vue.ref({}),d=vue.ref([]),c=vue.ref(""),f=vue.computed(()=>Array.isArray(d.value)?d.value.filter(g=>g.ext==="jpg"||g.ext==="png").map(g=>g?.file_path):[]);console.log("images",f.value);const v=vue.computed(()=>c.value===""?d.value:d.value.filter(g=>g?.uploaded_name.includes(c.value))),h=g=>{const b=f.value.findIndex(E=>E===g.item.file_path);b!==-1&&(s.value=!0,a.value=b)},x=async()=>{try{const{data:g}=await axios.get(`${r.prefix}/widget/file/${n.value}`);d.value=g?.rows}catch(g){console.error(g)}},y=async g=>{await Promise.all(Array.from(g.target.files).map(async b=>{const E=new FormData;E.append("file",b);try{const O=`${r.prefix}/widget/file/${n.value}`;return await axios.post(O,E),i("update","file-list"),b}catch(O){return console.error(O),null}})),await x()},_=g=>{const b={...g};return g.cancel||(b.cancel=()=>{l.value=!1}),g.updateListOnConfirm&&(b.confirm=async()=>{await g.confirm(),l.value=!1,x()}),b},k=g=>{u.value=_(g),l.value=!0};return vue.watch(n,g=>{g&&x()}),vue.onMounted(()=>{n.value&&x()}),(g,b)=>{const E=vue.resolveComponent("Lightbox"),O=vue.resolveComponent("MessageBox");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$6,[vue.createElementVNode("h2",_hoisted_3$5," Файлів: "+vue.toDisplayString(d.value?.length),1),vue.createElementVNode("div",_hoisted_4$4,[vue.createElementVNode("label",null,[vue.createElementVNode("input",{type:"file",class:"hidden",onChange:b[0]||(b[0]=T=>y(T))},null,32),vue.createElementVNode("div",_hoisted_5$4,[vue.createVNode(IconUpload,{height:"16",width:"16"})])])])]),d.value?.length>4?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$4,[vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_7$4,[b[8]||(b[8]=vue.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[vue.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),vue.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=T=>c.value=T),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[vue.vModelText,c.value,void 0,{trim:!0}]])])])])):vue.createCommentVNode("",!0),d.value?.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.value,(T,C)=>(vue.openBlock(),vue.createBlock(VsWidgetFileItem,{key:C,id:e.id,prefix:e.prefix,item:T,index:C,onUpdate:b[2]||(b[2]=N=>g.$emit("update","file-list")),onOpenModal:b[3]||(b[3]=N=>k(N)),onOpenLightbox:b[4]||(b[4]=N=>h(N))},null,8,["id","prefix","item","index"]))),128)),v.value.length?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$2,b[9]||(b[9]=[vue.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):vue.createCommentVNode("",!0),vue.createVNode(E,{modelValue:s.value,"onUpdate:modelValue":b[5]||(b[5]=T=>s.value=T),startIndex:a.value,"onUpdate:index":b[6]||(b[6]=T=>a.value=T),images:f.value},null,8,["modelValue","startIndex","images"]),vue.createVNode(O,{modelValue:l.value,"onUpdate:modelValue":b[7]||(b[7]=T=>l.value=T),onConfirm:u.value.confirm,title:u.value.title,message:u.value.message,confirmButtonText:u.value.confirmButtonText,cancelButtonText:u.value.cancelButtonText},null,8,["modelValue","onConfirm","title","message","confirmButtonText","cancelButtonText"])])}}},_hoisted_1$8={class:"flex items-center justify-between"},_hoisted_2$5={class:"text-[16px] text-gray-900 font-medium"},_hoisted_3$4={class:"grid gap-3"},_sfc_main$b=vue.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,r=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,o=>{r.value=o}),(o,n)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$8,[vue.createElementVNode("p",_hoisted_2$5,vue.toDisplayString(e.title),1),vue.createVNode(_sfc_main$z,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=s=>r.value=s),style:vue.normalizeStyle(e.style)},null,8,["modelValue","style"])]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_3$4,[vue.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[vue.vShow,r.value]])]),_:3})]))}}),VsContainerSwitcher=_export_sfc(_sfc_main$b,[["__scopeId","data-v-479564a3"]]),_hoisted_1$7={class:"text-[16px] text-gray-900 font-medium"},_hoisted_2$4={class:"grid gap-3"},_sfc_main$a=vue.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,r=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,o=>{r.value=o}),(o,n)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("button",{type:"button",onClick:n[0]||(n[0]=s=>r.value=!r.value),class:"flex items-center gap-2"},[vue.createVNode(vue.unref(IconChevronDown),{class:vue.normalizeClass(["h-4 w-4 duration-300",[r.value?"-rotate-180":""]])},null,8,["class"]),vue.createElementVNode("span",_hoisted_1$7,vue.toDisplayString(e.title),1)]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$4,[vue.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[vue.vShow,r.value]])]),_:3})]))}}),VsContainerAccordion=_export_sfc(_sfc_main$a,[["__scopeId","data-v-a37284e6"]]),_hoisted_1$6={class:"flex items-center justify-between"},_sfc_main$9=vue.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(e){return(t,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$6,[vue.createElementVNode("p",null,vue.toDisplayString(e.title),1)]),vue.renderSlot(t.$slots,"default")]))}}),views={switcher:VsContainerSwitcher,accordion:VsContainerAccordion,default:_sfc_main$9},FormConditionsTypes={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},checkEqual=(e,t)=>e===t,checkInequal=(e,t)=>e!==t,checkHigher=(e,t)=>e>t,checkHigherOrEqual=(e,t)=>e>=t,checkLower=(e,t)=>e<t,checkLowerOrEqual=(e,t)=>e<=t,checkBetween=(e,t)=>Array.isArray(t)&&t.length===2?e>=t[0]&&e<=t[1]:!1,checkStartWith=(e,t)=>String(e).startsWith(String(t)),checkEndWith=(e,t)=>String(e).endsWith(String(t)),checkContain=(e,t)=>String(e).includes(String(t)),checkIn=(e,t)=>Array.isArray(t)?t.includes(e):!1,checkNotIn=(e,t)=>Array.isArray(t)?!t.includes(e):!0,isVisible=(e,t)=>{if(!t)return!0;switch(t?.[1]){case FormConditionsTypes.Equal:return checkEqual(e,t?.[2]);case FormConditionsTypes.Inequal:return checkInequal(e,t?.[2]);case FormConditionsTypes.Higer:return checkHigher(e,t?.[2]);case FormConditionsTypes.HigerOrEqual:return checkHigherOrEqual(e,t?.[2]);case FormConditionsTypes.Lower:return checkLower(e,t?.[2]);case FormConditionsTypes.LowerOrEqual:return checkLowerOrEqual(e,t?.[2]);case FormConditionsTypes.Between:return checkBetween(e,t?.[2]);case FormConditionsTypes.StartWith:return checkStartWith(e,t?.[2]);case FormConditionsTypes.EndWith:return checkEndWith(e,t?.[2]);case FormConditionsTypes.Contain:return checkContain(e,t?.[2]);case FormConditionsTypes.In:return checkIn(e,t?.[2]);case FormConditionsTypes.NotIn:return checkNotIn(e,t?.[2]);default:return!0}},_sfc_main$8=vue.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(e){const t=e,r=vue.inject("formValues",{default:{}}),o=vue.inject("form"),n=vue.computed(()=>t.schema?.filter(a=>{const i=a?.conditions;if(!i)return!0;const l=Array.isArray(i)?i[0]:i,u=r?.value?.[l];return isVisible(u,i)})),s=vue.computed(()=>views[t.view]);return(a,i)=>e.schema?.length?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(s.value),{key:0,title:e.title,style:vue.normalizeStyle(e.style)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.value,l=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:l.name},{ref_for:!0},l,{item:l,modelValue:vue.unref(r)[l.name],"onUpdate:modelValue":u=>vue.unref(r)[l.name]=u,style:e.style,error:vue.unref(o)?.errors?.[l.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):vue.createCommentVNode("",!0)}}),dynamicPosition=async(e,t,r,o=10)=>{if(!t||!r)return;await vue.nextTick();const n=await r?.getBoundingClientRect(),s=await t?.getBoundingClientRect();if(!s||!n)return;const a=await parseInt(t?.getBoundingClientRect()?.height.toString()),i=await parseInt(t?.getBoundingClientRect()?.width.toString()),l=await parseInt(r?.getBoundingClientRect()?.height.toString()),u=await parseInt(r?.getBoundingClientRect()?.width.toString()),d=await window.innerHeight,c=await window.innerWidth;let f=0,v=0;const h=s.bottom+o+l;switch(e){case"top":s.top-n.height-o<0?f=s.top-n.height+o+l+a:f=s.top-n.height-o,c>u+s.right+30?v=s.left-n.width/2+s.width/2:v=c-30-u;break;case"bottom":d>h?f=s.bottom+o:f=s.bottom-o-l-a,v=s.left-n.width/2+s.width/2;break;case"left":f=s.top-n.height/2+s.height/2,s.left-n.width-o>0?v=s.left-n.width-o:v=10;break;case"right":f=s.top-n.height/2+s.height/2,c-i>u?v=s.right+o:v=c-30-u;break;case"top-right":s.top-n.height-o<0?f=s.top-n.height+o+l+a:f=s.top-n.height-o,c-i>u?v=s.right+o:v=c-30-u;break;case"top-left":s.top-n.height-o<0?f=s.top-n.height+o+l+a:f=s.top-n.height-o,s.left-n.width-o>0?v=s.left-n.width-o:v=10;break;case"top-start":s.top-n.height-o<0?f=s.top-n.height+o+l+a:f=s.top-n.height-o,s.left>0?v=s.left:v=10;break;case"bottom-right":d>h?f=s.bottom+o:f=s.bottom-o-l-a,c-i>u?v=s.left:v=c-30-u;break;case"bottom-left":d>h?f=s.bottom+o:f=s.bottom-o-l-a,s.left>0?v=s.right-u:v=10;break;case"bottom-start":d>h?f=s.bottom+o:f=s.bottom-o-l-a,s.left>0?v=s.left:v=10;break}f+l>d?f=d-l-o:f<0&&(f=o),v+u>c?v=c-u-o:v<0&&(v=o),r instanceof HTMLElement&&(r.style.top=`${f}px`,r.style.left=`${v}px`,r.style.position="fixed")},_sfc_main$7={},_hoisted_1$5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function _sfc_render(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$5,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),vue.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const IconMagnifyingGlass=_export_sfc(_sfc_main$7,[["render",_sfc_render]]),_hoisted_1$4=["disabled"],_hoisted_2$3={key:1},_hoisted_3$3={key:2,class:"text-gray-400"},_hoisted_4$3={class:"absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none"},_hoisted_5$3={key:0,class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"},_hoisted_6$3={class:"h-[30px] shrink-0 flex items-center relative justify-center"},_hoisted_7$3=["onClick"],_hoisted_8$1={class:"flex items-center gap-[8px] w-full"},_hoisted_9$1={key:2},_hoisted_10$1={class:"relative"},_hoisted_11$1={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},_hoisted_12$1={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},_hoisted_13$1={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},_hoisted_14$1={class:"p-4 mim-h-0 h-full overflow-auto"},_hoisted_15$1={class:"vs-form__head mb-5 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},_sfc_main$6=vue.defineComponent({__name:"vs-input-select",props:vue.mergeModels({placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:null},options:{default:()=>[]},maxHeight:{default:400},slots:{default:null},customClass:{default:""},style:{default:()=>({})},disabled:{type:Boolean},mode:{},add:{},api:{},search:{type:Boolean},error:{default:null}},{modelValue:{type:[Number,String],default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=vue.computed(()=>t.mode||(t.api||t.search?"search":null)),{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue"),s=vue.ref({}),a=vue.ref(null),i=vue.ref(null),l=vue.ref(!1),u=vue.ref(null),d=vue.ref([]),c=vue.ref(-1),f=vue.ref([]),v=vue.ref(""),h=vue.ref(null);let x=null;const y=vue.ref(!1),_=vue.ref(null),k=vue.ref({}),g=vue.ref({}),b=vue.computed(()=>{if(d.value?.length){const m=d.value?.filter(p=>p?.id!==u.value?.id);return[u.value].concat(m)?.filter(p=>p!==null)}return[]}),E=async()=>{try{const{data:m}=await axios.get(`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${v.value}`);return m.data}catch{return[]}},O=async m=>{document.body.click(),l.value=m!==void 0?m:!l.value,l.value&&!d.value?.length&&(!t.options?.length&&t.data?d.value=await E():t.options?.length&&(d.value=[...t.options])),l.value&&a.value?(s.value.width=`${a.value.getBoundingClientRect()?.width}px`,t.mode==="search"&&h.value?.focus(),i.value&&dynamicPosition("bottom-start",a.value,i.value)):c.value=-1},T=()=>l.value?O(!1):null,C=m=>{u.value=m,n.value=m.id,O(!1)},N=(m,p)=>{if(!m||!p)return;const w=m.offsetTop,M=w+m.offsetHeight,D=p.scrollTop,B=D+p.clientHeight;w<D?Object.assign(p,{scrollTop:w-80}):M>B&&Object.assign(p,{scrollTop:M-p.clientHeight+4})},V=m=>{if(!l.value)return;const{keyCode:p}=m;if([38,40,13].includes(p)&&m.preventDefault(),p===38){if(c.value===0)return;c.value-=1,N(f.value[c.value],i.value)}else if(p===40){if(c.value+1>=b.value?.length)return;c.value+=1,N(f.value[c.value],i.value)}else if(p===13){const w=b.value[c.value];w&&C(w)}},R=async m=>{if(l.value)return;const{keyCode:p}=m;[38,40].includes(p)&&(await m.preventDefault(),c.value=0,setTimeout(()=>O()))},F=m=>{l.value&&a.value&&i.value&&!i.value.contains(m.target)&&(l.value=!1)},A=m=>{m?.key==="Escape"&&l.value&&O(!1)};vue.onMounted(async()=>{addEventListener("click",T),addEventListener("keydown",V),addEventListener("scroll",F,!0),addEventListener("keydown",A),t.options&&(d.value=t.options),n.value&&!t.options?.length&&t.data&&(d.value=await E()),u.value=d.value?.find(m=>m?.id.toString()===n.value?.toString())||null}),vue.onUnmounted(()=>{removeEventListener("click",T),removeEventListener("keydown",V),removeEventListener("scroll",F,!0),removeEventListener("keydown",A)}),vue.watch(v,m=>{let p=!1;(m===""||m.trimStart().length!==0)&&(p=!0),p&&(x&&clearTimeout(x),x=setTimeout(async()=>{!t.options?.length&&t.data?d.value=await E():d.value=t.options.filter(w=>w.text.toLowerCase().includes(m.toLowerCase()))},200))});async function P(){y.value=!0;const m=await fetch(`/api/template/form/${t.add.form}`).then(p=>p.json());_.value=m.schema}async function S(){g.value.validate()||(await fetch("/api/table/"+t.add.token,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k.value)}).then(p=>p.json()),y.value=!1)}return(m,p)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"relative w-full",ref_key:"select",ref:a,onClick:p[5]||(p[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis",[l.value?`ring-rind ring-2 ring-${m.style?.primaryColor||"blue"}-500`:"",u.value?.text?"pr-[50px]":"pr-[25px]",vue.unref(o),m.customClass,{"!border-red-600":m.error}]]),onKeydown:R,onClick:p[0]||(p[0]=w=>O(!l.value)),disabled:m.disabled,style:{border:"1px solid #CFD9E0"}},[u.value?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:u.value?.color})},null,4)):vue.createCommentVNode("",!0),u.value?.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$3,vue.toDisplayString(u.value?.text),1)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$3,vue.toDisplayString(m.placeholder),1))],42,_hoisted_1$4),vue.createElementVNode("span",_hoisted_4$3,[vue.createVNode(vue.unref(IconChevronTopBottom),{height:"14",width:"14"})]),u.value?.text?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",onClick:p[1]||(p[1]=w=>{n.value=null,u.value=null}),class:"absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"},[vue.createVNode(vue.unref(IconClose),{height:"14",width:"14"})])):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("ul",{class:"z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",ref_key:"list",ref:i,style:vue.normalizeStyle({width:s.value.width,maxHeight:m.maxHeight+"px",backgroundColor:"white"}),onClick:p[4]||(p[4]=vue.withModifiers(()=>{},["stop"]))},[r.value==="search"?(vue.openBlock(),vue.createElementBlock("li",_hoisted_5$3,[vue.createElementVNode("div",_hoisted_6$3,[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":p[2]||(p[2]=w=>v.value=w),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref_key:"inputRef",ref:h},null,512),[[vue.vModelText,v.value]]),vue.createVNode(IconMagnifyingGlass,{width:"15px",height:"15px",class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),v.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(IconClose),{key:0,width:"15px",height:"15px",onClick:p[3]||(p[3]=w=>v.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0),b.value?.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[p[10]||(p[10]=vue.createElementVNode("li",{class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"}," Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ",-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(b.value,(w,M)=>(vue.openBlock(),vue.createElementBlock("li",{onClick:D=>C(w),key:w?.id,ref_for:!0,ref:D=>f.value[M]=D,class:vue.normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg",[c.value==M?"bg-gray-100":""]])},[vue.createElementVNode("span",_hoisted_8$1,[w?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:w?.color})},null,4)):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(w?.text),1)]),n.value==w?.id?(vue.openBlock(),vue.createBlock(vue.unref(IconCheck),{key:0,height:"14",width:"14","stroke-width":"2",class:"absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"})):vue.createCommentVNode("",!0)],10,_hoisted_7$3))),128))],64)):(vue.openBlock(),vue.createElementBlock("li",_hoisted_9$1,"Дані відсутні"))],4),[[vue.vShow,l.value]])]))],512),t.add?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:P,class:"ml-auto bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10px] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40px] gap-[8px] flex items-center"},p[11]||(p[11]=[vue.createElementVNode("svg",{class:"vpbnr cp61q",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[vue.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"})],-1),vue.createElementVNode("span",null,"Додати",-1)]))):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("div",_hoisted_10$1,[vue.createElementVNode("div",_hoisted_11$1,[vue.createElementVNode("div",_hoisted_12$1,[vue.createElementVNode("div",_hoisted_13$1,[p[13]||(p[13]=vue.createElementVNode("h3",{class:"font-medium text-gray-800 dark:text-[#ffffff]"},"Додати",-1)),vue.createElementVNode("button",{onClick:p[6]||(p[6]=w=>y.value=!1),type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},p[12]||(p[12]=[vue.createElementVNode("span",{class:"sr-only"},"Close",-1),vue.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("path",{d:"M18 6 6 18"}),vue.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),vue.createElementVNode("div",_hoisted_14$1,[_.value?(vue.openBlock(),vue.createBlock(_sfc_main,{key:0,schema:_.value,values:k.value,"onUpdate:values":p[7]||(p[7]=w=>k.value=w),form:g.value,"onUpdate:form":p[8]||(p[8]=w=>g.value=w)},null,8,["schema","values","form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_15$1,[vue.createElementVNode("button",{type:"button",onClick:p[9]||(p[9]=w=>y.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),vue.createElementVNode("button",{onClick:S,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])])],512),[[vue.vShow,y.value]])]))],64))}}),_hoisted_1$3=["placeholder","disabled"],_sfc_main$5=vue.defineComponent({__name:"vs-input-textarea",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue");return(n,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),placeholder:e.placeholder,disabled:e.disabled,row:"2",class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[vue.unref(r)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$3)),[[vue.vModelText,o.value]])}}),_hoisted_1$2={class:"relative"},_hoisted_2$2={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},_hoisted_3$2={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},_hoisted_4$2={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},_hoisted_5$2={class:"font-medium text-gray-800 dark:text-[#ffffff]"},_hoisted_6$2={class:"p-4 mim-h-0 h-full overflow-auto"},_hoisted_7$2={class:"vs-form__head mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},_sfc_main$4=vue.defineComponent({__name:"add-modal-field",props:{schema:{},defaultValue:{},mode:{}},emits:["close","save","edit"],setup(e,{emit:t}){const r=e,o=t,n=vue.ref(r.schema),s=vue.ref(r.defaultValue||{}),a=vue.ref({});async function i(){a.value.validate()||(r.mode==="add"?o("save",s.value):o("edit",s.value))}return(l,u)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("div",_hoisted_3$2,[vue.createElementVNode("div",_hoisted_4$2,[vue.createElementVNode("h3",_hoisted_5$2,vue.toDisplayString(l.mode==="add"?"Додати":"Змінити"),1),vue.createElementVNode("button",{onClick:u[0]||(u[0]=d=>o("close")),type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},u[4]||(u[4]=[vue.createElementVNode("span",{class:"sr-only"},"Close",-1),vue.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("path",{d:"M18 6 6 18"}),vue.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),vue.createElementVNode("div",_hoisted_6$2,[n.value?(vue.openBlock(),vue.createBlock(_sfc_main,{key:0,schema:n.value,values:s.value,"onUpdate:values":u[1]||(u[1]=d=>s.value=d),form:a.value,"onUpdate:form":u[2]||(u[2]=d=>a.value=d)},null,8,["schema","values","form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_7$2,[vue.createElementVNode("button",{type:"button",onClick:u[3]||(u[3]=d=>o("close")),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),vue.createElementVNode("button",{onClick:i,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])])]))}}),_hoisted_1$1={class:"vs-datatable border rounded-xl w-full flex-grow"},_hoisted_2$1={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},_hoisted_3$1={class:"relative w-full"},_hoisted_4$1={class:"table-wrapper flex gap-2"},_hoisted_5$1={class:"w-full overflow-x-auto"},_hoisted_6$1={class:"w-full table-auto caption-bottom text-sm"},_hoisted_7$1={class:"[&_tr]:border-b"},_hoisted_8={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},_hoisted_9={key:0,colspan:"100%",class:"text-center"},_hoisted_10=["onDragstart","onDragover","onDrop"],_hoisted_11={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},_hoisted_12={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},_hoisted_13={class:"flex items-center justify-center gap-2"},_hoisted_14=["onClick"],_hoisted_15=["onClick"],_sfc_main$3=vue.defineComponent({__name:"vs-input-datatable",props:vue.mergeModels({colModel:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,r=vue.ref(t.colModel),o=vue.useModel(e,"modelValue"),n=vue.ref({}),s=vue.ref(""),a=vue.computed(()=>{if(!s.value)return o.value;const S=s.value.toLowerCase();return o.value.filter(m=>r.value.some(p=>{const w=m[p.key];return w?Array.isArray(w)?w.join(", ").toLowerCase().includes(S):String(w).toLowerCase().includes(S):!1}))}),i=vue.ref(null),l=vue.ref(null),u=vue.ref(!1),d=vue.ref(null),c=vue.ref({top:0,left:0}),f=vue.ref(!1),v=vue.ref({}),h=vue.ref({}),x=vue.ref(),y=S=>{i.value=S},_=S=>{l.value=S},k=S=>{if(i.value===null||i.value===S){i.value=null,l.value=null;return}const m=[...o.value],[p]=m.splice(i.value,1);m.splice(S,0,p),o.value=m,i.value=null,l.value=null},g=S=>{const p=S.currentTarget.getBoundingClientRect();c.value={top:p.bottom+window.scrollY,left:p.left+window.scrollX},u.value=!u.value},b=()=>{d.value&&d.value.click()},E=S=>{const p=S.target.files?.[0];if(!p)return;const w=new FileReader;w.onload=M=>{try{const D=M.target?.result;if(typeof D=="string"){const B=JSON.parse(D);Array.isArray(B)&&o.value.push(...B)}}catch(D){console.error("Error parsing file:",D)}},w.readAsText(p)},O=()=>{const S=JSON.stringify(o.value,null,2),m=new Blob([S],{type:"application/json"}),p=URL.createObjectURL(m),w=document.createElement("a");w.href=p,w.download="data.json",w.click(),URL.revokeObjectURL(p)};function T(){v.value=t.colModel,x.value="add",h.value={},f.value=!0}function C(){f.value=!1}function N(S){o.value=[...o.value,S],f.value=!1}vue.onMounted(async()=>{for(const S of r.value)S.data&&(n.value[S.key]=await fetch(`/api/suggest/${S.data}`).then(m=>m.json()))});function V(S,m){return n.value[m.key]&&S[m.key]?n.value[m.key].find(p=>p.id.toString()===S[m.key].toString())?.text??S[m.key]:S[m.key]||"-"}let R=null;function F(S,m){R=m,x.value="edit",v.value=t.colModel,h.value=S,f.value=!0}function A(S){o.value=o.value.map((m,p)=>p===R?S:m),f.value=!1}function P(S){o.value=o.value.filter((m,p)=>p!==S)}return(S,m)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3$1,[vue.createVNode(IconMagnifyingGlass,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":m[0]||(m[0]=p=>s.value=p),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[vue.vModelText,s.value]])]),vue.createElementVNode("div",_hoisted_4$1,[vue.createElementVNode("input",{ref_key:"fileInput",ref:d,onChange:E,class:"hidden",accept:".json",type:"file"},null,544),vue.createElementVNode("div",{class:"vs-popover inline-block"},[vue.createElementVNode("div",{class:"text-center"},[vue.createElementVNode("div",{class:""},[vue.createElementVNode("button",{onClick:g,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},m[1]||(m[1]=[vue.createStaticVNode('<svg class="flex-shrink-0 mt-0.5 size-3.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="16" width="16"><path d="m3 16 4 4 4-4"></path><path d="M7 20V4"></path><path d="m21 8-4-4-4 4"></path><path d="M17 4v16"></path></svg>',1)]))])])])]),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[u.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"vsTailwind vs-popover__content bottom",style:vue.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:c.value.top+"px",left:c.value.left+"px"}])},[vue.createElementVNode("div",{class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},[vue.createElementVNode("div",{class:"flex flex-col p-[2px] gap-[2px] w-[140px]"},[vue.createElementVNode("button",{onClick:b,class:"flex items-center gap-1 px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},m[2]||(m[2]=[vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-upload text-black"},[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),vue.createElementVNode("path",{d:"M7 9l5 -5l5 5"}),vue.createElementVNode("path",{d:"M12 4l0 12"})],-1),vue.createTextVNode(" Імпортувати ",-1)])),vue.createElementVNode("button",{onClick:O,class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},m[3]||(m[3]=[vue.createElementVNode("span",{class:"text-sm items-center text-gray-800 flex gap-1"},[vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download text-black"},[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"}),vue.createElementVNode("path",{d:"M12 4l0 12"})]),vue.createTextVNode("Експортувати")],-1)]))])])],4)):vue.createCommentVNode("",!0)])),vue.createElementVNode("button",{onClick:T,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[vue.createVNode(IconPlus),m[4]||(m[4]=vue.createTextVNode(" Додати ",-1))])]),vue.createElementVNode("div",_hoisted_5$1,[vue.createElementVNode("table",_hoisted_6$1,[vue.createElementVNode("thead",_hoisted_7$1,[vue.createElementVNode("tr",_hoisted_8,[m[5]||(m[5]=vue.createElementVNode("th",{class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},[vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-grip-vertical w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"},[vue.createElementVNode("circle",{cx:"9",cy:"12",r:"1"}),vue.createElementVNode("circle",{cx:"9",cy:"5",r:"1"}),vue.createElementVNode("circle",{cx:"9",cy:"19",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"12",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"5",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"19",r:"1"})])],-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,p=>(vue.openBlock(),vue.createElementBlock("th",{key:p.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},vue.toDisplayString(p.ua),1))),128)),m[6]||(m[6]=vue.createElementVNode("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),vue.createElementVNode("tbody",{class:vue.normalizeClass({"[&_tr:last-child]:border-0":!l.value})},[a.value.length===0?(vue.openBlock(),vue.createElementBlock("td",_hoisted_9,m[7]||(m[7]=[vue.createStaticVNode('<div class="w-full"><div class="p-5 min-h-[200px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200">Нічого не знайдено</p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"></p></div></div></div>',1)]))):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,(p,w)=>(vue.openBlock(),vue.createElementBlock("tr",{key:p.id,class:vue.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":i.value===w,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":l.value===w}]),draggable:"true",onDragstart:M=>y(w),onDragover:vue.withModifiers(M=>_(w),["prevent"]),onDrop:M=>k(w)},[m[9]||(m[9]=vue.createElementVNode("td",{class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},[vue.createElementVNode("div",{class:"flex items-center justify-center"},[vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-grip-vertical w-4 h-4 text-slate-400 dark:text-slate-500 hover:text-slate-600 dark:hover:text-slate-300 transition-colors"},[vue.createElementVNode("circle",{cx:"9",cy:"12",r:"1"}),vue.createElementVNode("circle",{cx:"9",cy:"5",r:"1"}),vue.createElementVNode("circle",{cx:"9",cy:"19",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"12",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"5",r:"1"}),vue.createElementVNode("circle",{cx:"15",cy:"19",r:"1"})])])],-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,M=>(vue.openBlock(),vue.createElementBlock("td",{key:M.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[vue.createElementVNode("div",_hoisted_11,vue.toDisplayString(V(p,M)),1)]))),128)),vue.createElementVNode("td",_hoisted_12,[vue.createElementVNode("div",_hoisted_13,[vue.createElementVNode("button",{onClick:M=>F(p,w),class:"inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-8 w-8 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},m[8]||(m[8]=[vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-pen w-4 h-4"},[vue.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"})],-1)]),8,_hoisted_14),vue.createElementVNode("button",{onClick:M=>P(w),class:"inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-8 w-8 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[vue.createVNode(IconDelete,{width:"24",height:"24",class:"w-4 h-4"})],8,_hoisted_15)])])],42,_hoisted_10))),128))],2)])])]),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[f.value?(vue.openBlock(),vue.createBlock(_sfc_main$4,{key:0,schema:v.value,defaultValue:h.value,mode:x.value,onClose:C,onSave:N,onEdit:A},null,8,["schema","defaultValue","mode"])):vue.createCommentVNode("",!0)]))],64))}}),MAP_LOCALE={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}},_hoisted_1={class:"leaflet-map-wrapper relative w-full h-[600px]"},_hoisted_2={class:"absolute top-4 right-4 z-[1000] space-y-2 bg-white/90 p-2 rounded shadow flex flex-col"},_hoisted_3={class:"absolute bottom-4 left-4 z-[1000] bg-white/90 p-2 rounded shadow"},_hoisted_4={class:"flex gap-2"},_hoisted_5=["onClick"],_hoisted_6=["src"],_hoisted_7={class:"text-xs text-center"},_sfc_main$2={__name:"vs-input-map",props:{modelValue:{type:Object,default:()=>({type:"FeatureCollection",features:[]})}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,o=t,n=vue.ref(null);let s,a,i;const l=vue.ref<HTMLInputElement|null>null,u={OSM:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",preview:"https://a.tile.openstreetmap.org/0/0/0.png"},CartoLight:{url:"https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",preview:"https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/3/4/2.png"},Satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",preview:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/3/2/4"}};let d;function c(){return new Promise(_=>{if(window.L)return _(window.L);const k=document.createElement("link");k.rel="stylesheet",k.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(k);const g=document.createElement("link");g.rel="stylesheet",g.href="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css",document.head.appendChild(g);const b=document.createElement("script");b.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",b.onload=()=>{const E=document.createElement("script");E.src="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js",E.onload=()=>_(window.L),document.body.appendChild(E)},document.body.appendChild(b)})}vue.onMounted(async()=>{const _=await c();_.drawLocal=MAP_LOCALE,s=_.map(n.value).setView([50.45,30.52],6),d=_.tileLayer(u.OSM.url,{maxZoom:19}).addTo(s),a=new _.FeatureGroup().addTo(s),s.on(_.Draw.Event.CREATED,k=>{const g=k.layer;a.addLayer(g),v()}),s.on(_.Draw.Event.EDITED,v),s.on(_.Draw.Event.DELETED,v),r.modelValue&&r.modelValue.features.length&&_.geoJSON(r.modelValue).eachLayer(k=>a.addLayer(k))});function f(_){if(!s)return;i&&i.disable();const k=window.L;switch(_){case"marker":i=new k.Draw.Marker(s);break;case"polyline":i=new k.Draw.Polyline(s);break;case"polygon":i=new k.Draw.Polygon(s);break;case"rectangle":i=new k.Draw.Rectangle(s);break;case"circle":i=new k.Draw.Circle(s);break}i&&i.enable()}function v(){const _=a.toGeoJSON();o("update:modelValue",_)}function h(){const _=a.toGeoJSON(),k=new Blob([JSON.stringify(_,null,2)],{type:"application/json"}),g=URL.createObjectURL(k),b=document.createElement("a");b.href=g,b.download="data.geojson",b.click(),URL.revokeObjectURL(g)}function x(_){const k=_.target.files[0];if(!k)return;const g=new FileReader;g.onload=()=>{const b=JSON.parse(g.result);a.clearLayers(),window.L.geoJSON(b).eachLayer(E=>a.addLayer(E)),v()},g.readAsText(k)}function y(_){s&&(s.removeLayer(d),d=window.L.tileLayer(u[_].url,{maxZoom:19}).addTo(s))}return(_,k)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",{ref_key:"mapContainer",ref:n,class:"w-full h-full"},null,512),vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("button",{onClick:k[0]||(k[0]=g=>f("marker")),class:"btn"},"Точка"),vue.createElementVNode("button",{onClick:k[1]||(k[1]=g=>f("polyline")),class:"btn"},"Лінія"),vue.createElementVNode("button",{onClick:k[2]||(k[2]=g=>f("polygon")),class:"btn"},"Полігон"),vue.createElementVNode("button",{onClick:k[3]||(k[3]=g=>f("rectangle")),class:"btn"},"Прямокутник"),vue.createElementVNode("button",{onClick:k[4]||(k[4]=g=>f("circle")),class:"btn"},"Коло"),k[6]||(k[6]=vue.createElementVNode("hr",{class:"my-2"},null,-1)),vue.createElementVNode("button",{onClick:h,class:"btn"},"Експорт"),vue.createElementVNode("button",{onClick:k[5]||(k[5]=g=>l.click()),class:"btn"},"Імпорт"),vue.createElementVNode("input",{ref:"importRef",type:"file",onChange:x,class:"hidden"},null,544)]),vue.createElementVNode("div",_hoisted_3,[vue.createElementVNode("div",_hoisted_4,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(u,(g,b)=>vue.createElementVNode("div",{key:b,class:"cursor-pointer border rounded overflow-hidden",onClick:E=>y(b)},[vue.createElementVNode("img",{src:g.preview,alt:"",class:"w-20 h-20 object-cover"},null,8,_hoisted_6),vue.createElementVNode("div",_hoisted_7,vue.toDisplayString(b),1)],8,_hoisted_5)),64))])])]))}},inputs={VsInputText:_sfc_main$J,VsInputRadio:_sfc_main$s,"vs-input-text":_sfc_main$J,"vs-input-textarea":_sfc_main$5,"vs-input-mask":_sfc_main$x,"vs-input-number":_sfc_main$I,"vs-input-radio":_sfc_main$s,"vs-input-select":_sfc_main$6,"vs-input-switcher":_sfc_main$z,"vs-input-static":_sfc_main$y,"vs-input-container":_sfc_main$8,"vs-input-date":_sfc_main$q,"vs-input-checkbox":VsInputCheckbox,"vs-input-file":_sfc_main$g,"vs-input-html":_sfc_main$w,"vs-input-email":_sfc_main$v,"vs-input-datatable":_sfc_main$3,"vs-input-map":_sfc_main$2,"vs-input-file-list":_sfc_main$c},_sfc_main$1=vue.defineComponent({__name:"vs-compact-form-layout",props:{type:{type:String,default:""},style:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},layout:{type:String,default:"default"}},setup(e){const t=e,r=vue.computed(()=>layouts$1[`${t.layout}`]),o=vue.computed(()=>inputs?.[`vs-input-${t.type}`]);return(n,s)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.value),vue.mergeProps(n.$attrs,{style:e.style,item:e.item}),{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(o.value),vue.mergeProps(n.$attrs,{style:e.style}),null,16,["style"]))]),_:1},16,["style","item"]))}}),formErrorsUa={required:"Це поле є обов’язковим",email:"Неправильний email"},required=e=>e?!1:formErrorsUa.required,email=e=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&e?formErrorsUa.email:!1,regexp=(e,t)=>{const r=t.pattern??t.regexp;return!(typeof r=="string"?new RegExp(r):r).test(e)&&e?t.message:!1},custom=(value,customRule)=>{const func=eval(customRule.function);return func(value)?!1:customRule.message},checkFormRules=(e,t)=>{switch(typeof t=="string"?t:t.type){case"required":return required(e);case"email":return email(e);case"regexp":return regexp(e,t);case"custom":return custom(e,t);default:return!1}},mathTable={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file"};function convertType(e){const t=e.toLowerCase();return mathTable[t]||t}function convertSchema(e){if(Array.isArray(e)){const r=[];return e.forEach(o=>{const n={...o};n.name=o.name||o.id||o.key,n.type=convertType(o.type),n.label=o.label||o.ua,n.rules=o.rules||o.validators,o.data&&(n.api=`/api/suggest/${o.data}`),r.push(n)}),r}const t=[];return Object.entries(e).forEach(r=>{const o={name:r[0],...r[1],type:convertType(r[1].type),label:r[1].label||r[1].ua,rules:r[1].rules||r[1].validators};r[1].type.includes("list")&&(o.multiple=!0),r[1].data&&(o.api=`/api/suggest/${r[1].data}`),t.push(o)}),t}function useForm(e,t){const r=convertSchema(t),o=vue.ref({});function n(l){const u=l?.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,c=e?.value?.[d];return isVisible(c,u)}const s=(l=r,u=!0)=>(l.forEach(d=>{if(d.rules){if(!n(d)){console.log(d.name,"skip hidden"),delete o.value[d.name];return}d.rules.forEach(c=>{const f=checkFormRules(e.value[d.name],c);f?o.value[d.name]=f:delete o.value[d.name]})}d.schema&&s(d.schema,!1)}),u&&Object.values(o.value).some(Boolean)?o.value:null),a=vue.computed(()=>r?.filter(l=>n(l)));return{errors:o,validate:s,reset:()=>{e.value={},o.value={}},visibleSchema:a}}const _sfc_main=vue.defineComponent({__name:"vs-compact-form",props:vue.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},layout:{default:()=>"default"},formId:{default:()=>""}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:vue.mergeModels(["handle-submit"],["update:form","update:values"]),setup(e,{emit:t}){const r=t,o=e,n=vue.useAttrs(),s=vue.useModel(e,"form"),a=vue.useModel(e,"values"),{errors:i,validate:l,reset:u,visibleSchema:d}=useForm(a,o.schema),c=()=>{l(),r("handle-submit",a.value)};return vue.onMounted(()=>{s.value.value=a.value,s.value.errors=i.value,s.value.reset=u,s.value.validate=l,s.value.formId=o.formId}),vue.provide("form",s),vue.provide("values",a),(f,v)=>(vue.openBlock(),vue.createElementBlock("form",{onSubmit:vue.withModifiers(c,["prevent"]),class:vue.normalizeClass(["grid grid-cols-12",f.layout==="default"?"gap-6":"gap-4"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(d),h=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:h.name,class:f.layout==="horizontal"?"col-span-12":`col-span-${h.col||12} `},{ref_for:!0},{...vue.unref(n),...f.style,...h},{item:h,layout:f.layout,modelValue:a.value[h.name],"onUpdate:modelValue":x=>a.value[h.name]=x,style:f.style,error:vue.unref(i)[h.name]}),null,16,["class","item","layout","modelValue","onUpdate:modelValue","style","error"]))),128))],34))}});_sfc_main.install=function e(t){t.component("VForm",_sfc_main)},exports.VForm=_sfc_main,exports.VsInputText=_sfc_main$J,exports.default=_sfc_main,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.FormBuilder={},n.Vue))})(this,function(exports,vue){"use strict";const _hoisted_1$N={class:"w-full relative"},_hoisted_2$j={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},_hoisted_3$c={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$b={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$T=vue.defineComponent({__name:"vs-layout-default",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(n){return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$N,[n.ua||n.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$j,[vue.createElementVNode("span",null,vue.toDisplayString(n.ua||n.label),1),n.item?.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$c,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(e.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(e.$attrs))),n.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$b,vue.toDisplayString(n.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$M={class:"w-full relative flex flex-row items-center gap-2"},_hoisted_2$i={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},_hoisted_3$b={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$a={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$S=vue.defineComponent({__name:"vs-layout-horizontal",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(n){return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$M,[n.item?.type!=="html"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$i,[vue.createTextVNode(vue.toDisplayString(n.ua||n.label)+" ",1),n.item?.rules?.includes("required")&&(n.ua||n.label)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$b,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(e.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(e.$attrs))),n.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$a,vue.toDisplayString(n.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$L={class:"w-full relative"},_hoisted_2$h={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$R=vue.defineComponent({__name:"vs-layout-inline",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(n){return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$L,[vue.renderSlot(e.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(e.$attrs))),n.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$h,vue.toDisplayString(n.error),1)):vue.createCommentVNode("",!0)]))}}),layouts$1={default:_sfc_main$T,horizontal:_sfc_main$S,inline:_sfc_main$R};function useStyle(n){return{inputClass:vue.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${n?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return n?.size==="sm"?t+"h-[32px]":t+"h-[38px]"})}}const _hoisted_1$K=["placeholder","disabled"],_sfc_main$Q=vue.defineComponent({__name:"vs-input-text",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue");return(r,a)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":a[0]||(a[0]=i=>s.value=i),placeholder:n.placeholder,disabled:n.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(t),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$K)),[[vue.vModelText,s.value]])}}),_hoisted_1$J=["placeholder"],_sfc_main$P=vue.defineComponent({__name:"vs-input-number",props:vue.mergeModels({style:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue");return(r,a)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":a[0]||(a[0]=i=>s.value=i),placeholder:n.placeholder,class:vue.normalizeClass(["py-1.5 px-3 block w-full",[vue.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$J)),[[vue.vModelText,s.value]])}}),_export_sfc=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},_sfc_main$O={},_hoisted_1$I={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function _sfc_render$m(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$I,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const IconCheck=_export_sfc(_sfc_main$O,[["render",_sfc_render$m]]),_hoisted_1$H={class:"flex items-center gap-[4px]"},_hoisted_2$g=["value","id","disabled"],_hoisted_3$a=["for"],_hoisted_4$9={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},_sfc_main$N=vue.defineComponent({__name:"vs-checkbox-default",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},modelValue:Boolean,info:{type:String,default:()=>""},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=e,s=n,r=vue.computed({get:()=>s.modelValue,set:a=>t("update:modelValue",a)});return(a,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$H,[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",value:n.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o),class:vue.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":n.disabled}]),id:n.id,disabled:n.disabled},null,10,_hoisted_2$g),[[vue.vModelCheckbox,r.value]]),vue.createElementVNode("label",{for:n.id,class:vue.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":n.disabled}])},[vue.createElementVNode("div",{class:vue.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[r.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",n.error?"border-red-600":""]])},[vue.createVNode(IconCheck,{height:"12",width:"12"})],2),vue.createElementVNode("span",_hoisted_4$9,[vue.renderSlot(a.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(n.label),1)])])],10,_hoisted_3$a)]))}}),_hoisted_1$G=["name","value","disabled"],_hoisted_2$f={class:"flex items-center gap-[6px] text-[14px]"},_hoisted_3$9={key:0,class:"text-[16px]"},_hoisted_4$8=["src"],_sfc_main$M=vue.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{type:[String,Number],default:""},modelValue:{type:[Array,String,Boolean],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},icon:{type:String},imgUrl:{type:String},style:{type:Object,default:()=>null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=e,r=vue.computed({get:()=>t.modelValue,set:o=>{s("update:modelValue",o)}}),a=vue.computed(()=>Array.isArray(r.value)?r.value.includes(t.value):r.value===!0||r.value===t.value),i=vue.computed(()=>t.style?.size==="xs"?"p-1.5 text-xs":t.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(o,l)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[i.value,a.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",class:"hidden",name:n.id,value:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),disabled:n.disabled},null,8,_hoisted_1$G),[[vue.vModelCheckbox,r.value]]),vue.createElementVNode("span",_hoisted_2$f,[n.icon||n.imgUrl?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$9,[n.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(n.icon)},null,2)):vue.createCommentVNode("",!0),n.imgUrl?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:n.imgUrl,width:"16",height:"16",alt:"icon"},null,8,_hoisted_4$8)):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(o.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(n.label),1)])])],2))}}),VsCheckboxViews={"vs-checkbox-default":_sfc_main$N,"vs-checkbox-buttons":_sfc_main$M},_hoisted_1$F={class:"flex items-center"},_sfc_main$L=vue.defineComponent({__name:"vs-input-checkbox-item",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},view:{type:String,default:()=>"default"},modelValue:{type:[Array,Boolean],default:!1},icon:{type:String},imgUrl:{type:String},slots:{type:Object,default:()=>null},option:{type:[Object,String]},style:{type:String,default:()=>null},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=e,r=`radio-${Math.floor(Math.random()*1e4)}`,a=vue.computed({get:()=>Array.isArray(t.modelValue)?Array.isArray(t.modelValue)&&t.modelValue.includes(t.value):t.modelValue,set:o=>{if(Array.isArray(t.modelValue)){let l=[...t.modelValue];o?l.includes(t.value)||l.push(t.value):l=l.filter(u=>u!==t.value),s("update:modelValue",l)}else s("update:modelValue",o)}}),i=vue.ref(`vs-checkbox-${t.view||"default"}`);return(o,l)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$F,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(VsCheckboxViews)?.[i.value]),{value:n.value,label:n.label,info:n.option?.info,disabled:n.disabled,modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=u=>a.value=u),id:r,icon:n.icon,imgUrl:n.imgUrl,style:vue.normalizeStyle(n.style),error:n.error},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(n.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),_sfc_main$K={},_hoisted_1$E={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function _sfc_render$l(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$E,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const IconChevronDown=_export_sfc(_sfc_main$K,[["render",_sfc_render$l]]),_sfc_main$J={},_hoisted_1$D={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$k(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$D,e[0]||(e[0]=[vue.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),vue.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const IconChevronTopBottom=_export_sfc(_sfc_main$J,[["render",_sfc_render$k]]),_sfc_main$I={},_hoisted_1$C={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function _sfc_render$j(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$C,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),vue.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const IconClose=_export_sfc(_sfc_main$I,[["render",_sfc_render$j]]),_sfc_main$H={},_hoisted_1$B={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$i(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$B,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M12 9h.01"},null,-1),vue.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),vue.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const IconInfo=_export_sfc(_sfc_main$H,[["render",_sfc_render$i]]),_hoisted_1$A={key:0,class:"flex items-start gap-x-1"},_hoisted_2$e={key:0,class:"text-red-500 text-[14px]"},_hoisted_3$8=["title"],_hoisted_4$7=["disabled"],_sfc_main$G=vue.defineComponent({__name:"vs-input-switcher",props:vue.mergeModels({view:{type:String,default:"switch"},label:{type:String,default:""},rules:{type:Array,default:()=>[]},i:{type:String,default:""},text:{type:String,default:""},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""},error:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=vue.useModel(n,"modelValue");return(t,s)=>n.view==="checkbox"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$A,[vue.createVNode(_sfc_main$L,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=r=>e.value=r),label:n.text,error:n.error},null,8,["modelValue","label","error"]),n.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$e,"*")):vue.createCommentVNode("",!0),n.i?(vue.openBlock(),vue.createElementBlock("button",{key:1,class:"cursor-pointer",title:n.i,onClick:s[1]||(s[1]=vue.withModifiers(()=>{},["prevent"]))},[vue.createVNode(vue.unref(IconInfo),{class:"text-gray-500 w-[14px] h-[14px]"})],8,_hoisted_3$8)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("button",{key:1,type:"button",class:vue.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[e.value?`bg-${n.style?.primaryColor||"blue"}-500`:"bg-stone-200",n.customClass]]),disabled:n.disabled,onClick:s[2]||(s[2]=r=>e.value=!e.value)},[vue.createElementVNode("span",{"data-state":"checked",class:vue.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[e.value?"translate-x-4":"translate-x-0"]])},null,2)],10,_hoisted_4$7))}}),_hoisted_1$z=["innerHTML"],_sfc_main$F=vue.defineComponent({__name:"vs-input-static",props:{html:{type:String,default:""},text:{type:String,default:""},customClass:{type:String,default:""}},setup(n){return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(n.customClass),innerHTML:(n.html==="",n.text)},null,10,_hoisted_1$z))}});function isString(n){return typeof n=="string"||n instanceof String}function isObject(n){var e;return typeof n=="object"&&n!=null&&(n==null||(e=n.constructor)==null?void 0:e.name)==="Object"}function pick(n,e){return Array.isArray(e)?pick(n,(t,s)=>e.includes(s)):Object.entries(n).reduce((t,s)=>{let[r,a]=s;return e(a,r)&&(t[r]=a),t},{})}const DIRECTION={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function forceDirection(n){switch(n){case DIRECTION.LEFT:return DIRECTION.FORCE_LEFT;case DIRECTION.RIGHT:return DIRECTION.FORCE_RIGHT;default:return n}}function escapeRegExp(n){return n.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function objectIncludes(n,e){if(e===n)return!0;const t=Array.isArray(e),s=Array.isArray(n);let r;if(t&&s){if(e.length!=n.length)return!1;for(r=0;r<e.length;r++)if(!objectIncludes(e[r],n[r]))return!1;return!0}if(t!=s)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){const a=e instanceof Date,i=n instanceof Date;if(a&&i)return e.getTime()==n.getTime();if(a!=i)return!1;const o=e instanceof RegExp,l=n instanceof RegExp;if(o&&l)return e.toString()==n.toString();if(o!=l)return!1;const u=Object.keys(e);for(r=0;r<u.length;r++)if(!Object.prototype.hasOwnProperty.call(n,u[r]))return!1;for(r=0;r<u.length;r++)if(!objectIncludes(n[u[r]],e[u[r]]))return!1;return!0}else if(e&&n&&typeof e=="function"&&typeof n=="function")return e.toString()===n.toString();return!1}class ActionDetails{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?DIRECTION.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?DIRECTION.RIGHT:DIRECTION.LEFT}}function IMask(n,e){return new IMask.InputMask(n,e)}function maskedClass(n){if(n==null)throw new Error("mask property should be defined");return n instanceof RegExp?IMask.MaskedRegExp:isString(n)?IMask.MaskedPattern:n===Date?IMask.MaskedDate:n===Number?IMask.MaskedNumber:Array.isArray(n)||n===Array?IMask.MaskedDynamic:IMask.Masked&&n.prototype instanceof IMask.Masked?n:IMask.Masked&&n instanceof IMask.Masked?n.constructor:n instanceof Function?IMask.MaskedFunction:(console.warn("Mask not found for mask",n),IMask.Masked)}function normalizeOpts(n){if(!n)throw new Error("Options in not defined");if(IMask.Masked){if(n.prototype instanceof IMask.Masked)return{mask:n};const{mask:e=void 0,...t}=n instanceof IMask.Masked?{mask:n}:isObject(n)&&n.mask instanceof IMask.Masked?n:{};if(e){const s=e.mask;return{...pick(e,(r,a)=>!a.startsWith("_")),mask:e.constructor,_mask:s,...t}}}return isObject(n)?{...n}:{mask:n}}function createMask(n){if(IMask.Masked&&n instanceof IMask.Masked)return n;const e=normalizeOpts(n),t=maskedClass(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}IMask.createMask=createMask;class MaskElement{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}IMask.MaskElement=MaskElement;const KEY_Z=90,KEY_Y=89;class HTMLMaskElement extends MaskElement{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return(e=(t=(s=this.input).getRootNode)==null?void 0:t.call(s))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===KEY_Z&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===KEY_Y&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===KEY_Z&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLInputMaskElement extends HTMLMaskElement{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLContenteditableMaskElement extends HTMLMaskElement{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||s==null||s<r?s:r}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||s==null||s>r?s:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const r=this.rootElement,a=r.getSelection&&r.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;class InputHistory{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>InputHistory.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}InputHistory.MAX_LENGTH=100;class InputMask{constructor(e,t){this.el=e instanceof MaskElement?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new HTMLContenteditableMaskElement(e):new HTMLInputMaskElement(e),this.masked=createMask(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new InputHistory,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof IMask.Masked)&&this.masked.constructor===maskedClass(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof IMask.Masked?e:createMask({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(r=>r(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,r=this.masked.rawInputValue,a=this.displayValue,i=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==r;this._unmaskedValue=t,this._value=s,this._rawInputValue=r,this.el.value!==a&&(this.el.value=a),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),i&&this._fireChangeEvents(),!this._historyChanging&&(i||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,r=!this.maskEquals(t),a=this.masked.optionsIsChanged(s);r&&(this.mask=t),a&&this.masked.updateOptions(s),(r||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,DIRECTION.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?t.removeDirection:DIRECTION.NONE;let i=this.masked.nearestInputPos(t.startChangePos+r,a);a!==DIRECTION.NONE&&(i=this.masked.nearestInputPos(i,DIRECTION.NONE)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}IMask.InputMask=InputMask;class ChangeDetails{static normalize(e){return Array.isArray(e)?e:[e,new ChangeDetails]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}IMask.ChangeDetails=ChangeDetails;class ContinuousTailDetails{constructor(e,t,s){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Masked{constructor(e){this._value="",this._update({...Masked.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new ContinuousTailDetails(this.extractInput(e,t),e)}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new ChangeDetails({inserted:e,rawInserted:e})):new ChangeDetails}_appendChar(e,t,s){t===void 0&&(t={});const r=this.state;let a;if([e,a]=this.doPrepareChar(e,t),e&&(a=a.aggregate(this._appendCharRaw(e,t)),!a.rawInserted&&this.autofix==="pad")){const i=this.state;this.state=r;let o=this.pad(t);const l=this._appendCharRaw(e,t);o=o.aggregate(l),l.rawInserted||o.equals(a)?a=o:this.state=i}if(a.inserted){let i,o=this.doValidate(t)!==!1;if(o&&s!=null){const l=this.state;if(this.overwrite===!0){i=s.state;for(let d=0;d<a.rawInserted.length;++d)s.unshift(this.displayValue.length-a.tailShift)}let u=this.appendTail(s);if(o=u.rawInserted.length===s.toString().length,!(o&&u.inserted)&&this.overwrite==="shift"){this.state=l,i=s.state;for(let d=0;d<a.rawInserted.length;++d)s.shift();u=this.appendTail(s),o=u.rawInserted.length===s.toString().length}o&&u.inserted&&(this.state=l)}o||(a=new ChangeDetails,this.state=r,s&&i&&(s.state=i))}return a}_appendPlaceholder(){return new ChangeDetails}_appendEager(){return new ChangeDetails}append(e,t,s){if(!isString(e))throw new Error("value should be string");const r=isString(s)?new ContinuousTailDetails(String(s)):s;t!=null&&t.tail&&(t._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,t);for(let i=0;i<e.length;++i){const o=this._appendChar(e[i],t,r);if(!o.rawInserted&&!this.doSkipInvalid(e[i],t,r))break;a.aggregate(o)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&a.aggregate(this._appendEager()),r!=null&&(a.tailShift+=this.appendTail(r).tailShift),a}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new ChangeDetails}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),ChangeDetails.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),ChangeDetails.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,r,a){s===void 0&&(s=""),r===void 0&&(r=DIRECTION.NONE),a===void 0&&(a={input:!0});const i=e+t,o=this.extractTail(i),l=this.eager===!0||this.eager==="remove";let u;l&&(r=forceDirection(r),u=this.extractInput(0,i,{raw:!0}));let d=e;const h=new ChangeDetails;if(r!==DIRECTION.NONE&&(d=this.nearestInputPos(e,t>1&&e!==0&&!l?DIRECTION.NONE:r),h.tailShift=d-e),h.aggregate(this.remove(d)),l&&r!==DIRECTION.NONE&&u===this.rawInputValue)if(r===DIRECTION.FORCE_LEFT){let c;for(;u===this.rawInputValue&&(c=this.displayValue.length);)h.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(c-1))}else r===DIRECTION.FORCE_RIGHT&&o.unshift();return h.aggregate(this.append(s,a,o))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!objectIncludes(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||Masked.EMPTY_VALUES.includes(e)&&Masked.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new ChangeDetails}}Masked.DEFAULTS={skipInvalid:!0},Masked.EMPTY_VALUES=[void 0,null,""],IMask.Masked=Masked;class ChunksTailDetails{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=isString(e)?new ContinuousTailDetails(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof ContinuousTailDetails)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ChunksTailDetails){if(e.stop==null){let r;for(;e.chunks.length&&e.chunks[0].stop==null;)r=e.chunks.shift(),r.from+=e.from,this.extend(r)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof IMask.MaskedPattern))return new ContinuousTailDetails(this.toString()).appendTo(e);const t=new ChangeDetails;for(let s=0;s<this.chunks.length;++s){const r=this.chunks[s],a=e._mapPosToBlock(e.displayValue.length),i=r.stop;let o;if(i!=null&&(!a||a.index<=i)&&((r instanceof ChunksTailDetails||e._stops.indexOf(i)>=0)&&t.aggregate(e._appendPlaceholder(i)),o=r instanceof ChunksTailDetails&&e._blocks[i]),o){const l=o.appendTail(r);t.aggregate(l);const u=r.toString().slice(l.rawInserted.length);u&&t.aggregate(e.append(u,{tail:!0}))}else t.aggregate(e.append(r.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(r=>{const a="chunks"in r?new ChunksTailDetails:new ContinuousTailDetails;return a.state=r,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let s=0;for(;s<this.chunks.length;){const r=this.chunks[s],a=r.unshift(t);if(r.toString()){if(!a)break;++s}else this.chunks.splice(s,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class PatternCursor{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,DIRECTION.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,DIRECTION.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,DIRECTION.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,DIRECTION.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,DIRECTION.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,DIRECTION.NONE),!0})}}class PatternFixedDefinition{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new ChangeDetails}nearestInputPos(e,t){t===void 0&&(t=DIRECTION.NONE);const s=0,r=this._value.length;switch(t){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return s;case DIRECTION.NONE:case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:default:return r}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new ChangeDetails;const s=this.eager===!0||this.eager==="append",a=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,i=new ChangeDetails({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(t.raw||t.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new ChangeDetails;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new ContinuousTailDetails("")}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}append(e,t,s){const r=this._appendChar(e[0],t);return s!=null&&(r.tailShift+=this.appendTail(s).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class PatternInputDefinition{constructor(e){const{parent:t,isOptional:s,placeholderChar:r,displayChar:a,lazy:i,eager:o,...l}=e;this.masked=createMask(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:r,displayChar:a,lazy:i,eager:o})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new ChangeDetails}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new ChangeDetails;const s=this.masked.state;let r=this.masked._appendChar(e,this.currentMaskFlags(t));return r.inserted&&this.doValidate(t)===!1&&(r=new ChangeDetails,this.masked.state=s),!r.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ChangeDetails:(this.isFilled=!0,new ChangeDetails({inserted:this.placeholderChar}))}_appendEager(){return new ChangeDetails}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){t===void 0&&(t=DIRECTION.NONE);const s=0,r=this.value.length,a=Math.min(Math.max(e,s),r);switch(t){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return this.isComplete?a:s;case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:return this.isComplete?a:r;case DIRECTION.NONE:default:return a}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||e?._beforeTailState}}pad(e){return new ChangeDetails}}PatternInputDefinition.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class MaskedRegExp extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=s=>s.search(t)>=0),super._update(e)}}IMask.MaskedRegExp=MaskedRegExp;class MaskedPattern extends Masked{constructor(e){super({...MaskedPattern.DEFAULTS,...e,definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,r=!1;for(let a=0;a<t.length;++a){if(this.blocks){const u=t.slice(a),d=Object.keys(this.blocks).filter(c=>u.indexOf(c)===0);d.sort((c,v)=>v.length-c.length);const h=d[0];if(h){const{expose:c,repeat:v,...C}=normalizeOpts(this.blocks[h]),B={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...C,repeat:v,parent:this},I=v!=null?new IMask.RepeatBlock(B):createMask(B);I&&(this._blocks.push(I),c&&(this.exposeBlock=I),this._maskedBlocks[h]||(this._maskedBlocks[h]=[]),this._maskedBlocks[h].push(this._blocks.length-1)),a+=h.length-1;continue}}let i=t[a],o=i in e;if(i===MaskedPattern.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(i==="{"||i==="}"){s=!s;continue}if(i==="["||i==="]"){r=!r;continue}if(i===MaskedPattern.ESCAPE_CHAR){if(++a,i=t[a],!i)break;o=!1}const l=o?new PatternInputDefinition({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...normalizeOpts(e[i]),parent:this}):new PatternFixedDefinition({char:i,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...s}=e;this._blocks.forEach((r,a)=>r.state=t[a]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new ChangeDetails;let s=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(s==null)return t;this._blocks[s].isFilled&&++s;for(let r=s;r<this._blocks.length;++r){const a=this._blocks[r]._appendEager();if(!a.inserted)break;t.aggregate(a)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._mapPosToBlock(this.displayValue.length),r=new ChangeDetails;if(!s)return r;for(let i=s.index,o;o=this._blocks[i];++i){var a;const l=o._appendChar(e,{...t,_beforeTailState:(a=t._beforeTailState)==null||(a=a._blocks)==null?void 0:a[i]});if(r.aggregate(l),l.consumed)break}return r}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=new ChunksTailDetails;return e===t||this._forEachBlocksInRange(e,t,(r,a,i,o)=>{const l=r.extractTail(i,o);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof ChunksTailDetails&&(l.blockIndex=a),s.extend(l)}),s}extractInput(e,t,s){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),s===void 0&&(s={}),e===t)return"";let r="";return this._forEachBlocksInRange(e,t,(a,i,o,l)=>{r+=a.extractInput(o,l,s)}),r}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const r=this._stops[s];if(r<=e)t=r;else break}return t}_appendPlaceholder(e){const t=new ChangeDetails;if(this.lazy&&e==null)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const r=s.index,a=e??this._blocks.length;return this._blocks.slice(r,a).forEach(i=>{if(!i.lazy||e!=null){var o;t.aggregate(i._appendPlaceholder((o=i._blocks)==null?void 0:o.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const r=this._blocks[s],a=t.length;if(t+=r.displayValue,e<=t.length)return{index:s,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,s)=>t+=s.displayValue.length,0)}_forEachBlocksInRange(e,t,s){t===void 0&&(t=this.displayValue.length);const r=this._mapPosToBlock(e);if(r){const a=this._mapPosToBlock(t),i=a&&r.index===a.index,o=r.offset,l=a&&i?a.offset:this._blocks[r.index].displayValue.length;if(s(this._blocks[r.index],r.index,o,l),a&&!i){for(let u=r.index+1;u<a.index;++u)s(this._blocks[u],u,0,this._blocks[u].displayValue.length);s(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(r,a,i,o)=>{s.aggregate(r.remove(i,o))}),s}nearestInputPos(e,t){if(t===void 0&&(t=DIRECTION.NONE),!this._blocks.length)return 0;const s=new PatternCursor(this,e);if(t===DIRECTION.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===DIRECTION.LEFT||t===DIRECTION.FORCE_LEFT){if(t===DIRECTION.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===DIRECTION.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===DIRECTION.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return t===DIRECTION.RIGHT||t===DIRECTION.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===DIRECTION.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(e,DIRECTION.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(r,a,i,o)=>{s+=r.totalInputPositions(i,o)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(s=>this._blocks[s]):[]}pad(e){const t=new ChangeDetails;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}MaskedPattern.DEFAULTS={...Masked.DEFAULTS,lazy:!0,placeholderChar:"_"},MaskedPattern.STOP_CHAR="`",MaskedPattern.ESCAPE_CHAR="\\",MaskedPattern.InputDefinition=PatternInputDefinition,MaskedPattern.FixedDefinition=PatternFixedDefinition,IMask.MaskedPattern=MaskedPattern;class MaskedRange extends MaskedPattern{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:r=this.maxLength||0,autofix:a=this.autofix,...i}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,r),this.autofix=a;const o=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<l.length&&l[u]===o[u];)++u;i.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(i)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="";const[,r,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(t="0".repeat(r.length)+a,s="9".repeat(r.length)+a),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){t===void 0&&(t={});let s;return[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[a,i]=this.boundaries(this.value+e);return Number(i)<this.from?super._appendCharRaw(s[this.value.length],t):Number(a)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(r[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[r,a]=this.boundaries(t);return this.from<=Number(a)&&Number(r)<=this.to&&super.doValidate(e)}pad(e){const t=new ChangeDetails;if(this.value.length===this.maxLength)return t;const s=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let a=0;a<r;++a)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(a=>this._appendCharRaw(a))}return t}}IMask.MaskedRange=MaskedRange;const DefaultPattern="d{.}`m{.}`Y";class MaskedDate extends MaskedPattern{static extractPatternOptions(e){const{mask:t,pattern:s,...r}=e;return{...r,mask:isString(t)?t:s}}constructor(e){super(MaskedDate.extractPatternOptions({...MaskedDate.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:r,...a}={...MaskedDate.DEFAULTS,...e},i=Object.assign({},MaskedDate.GET_DEFAULT_BLOCKS());e.min&&(i.Y.from=e.min.getFullYear()),e.max&&(i.Y.to=e.max.getFullYear()),e.min&&e.max&&i.Y.from===i.Y.to&&(i.m.from=e.min.getMonth()+1,i.m.to=e.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=e.min.getDate(),i.d.to=e.max.getDate())),Object.assign(i,this.blocks,r),super._update({...a,mask:isString(t)?t:s,blocks:i})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(MaskedDate.extractPatternOptions(e))}}MaskedDate.GET_DEFAULT_BLOCKS=()=>({d:{mask:MaskedRange,from:1,to:31,maxLength:2},m:{mask:MaskedRange,from:1,to:12,maxLength:2},Y:{mask:MaskedRange,from:1900,to:9999}}),MaskedDate.DEFAULTS={...MaskedPattern.DEFAULTS,mask:Date,pattern:DefaultPattern,format:(n,e)=>{if(!n)return"";const t=String(n.getDate()).padStart(2,"0"),s=String(n.getMonth()+1).padStart(2,"0"),r=n.getFullYear();return[t,s,r].join(".")},parse:(n,e)=>{const[t,s,r]=n.split(".").map(Number);return new Date(r,s-1,t)}},IMask.MaskedDate=MaskedDate;class MaskedDynamic extends Masked{constructor(e){super({...MaskedDynamic.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:s,...r}=normalizeOpts(t),a=createMask({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return s&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){e===void 0&&(e=""),t===void 0&&(t={}),s===void 0&&(s="");const r=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,a=this.rawInputValue,i=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:a,o=a.slice(i.length),l=this.currentMask,u=new ChangeDetails,d=l?.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),u.tailShift=this.currentMask.value.length-r.length),o&&(u.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),u}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new ChangeDetails;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((s=e._beforeTailState)==null?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return t===void 0&&(t={}),s===void 0&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[s,r]=super.doPrepare(e,t);if(this.currentMask){let a;[s,a]=super.doPrepare(s,this.currentMaskFlags(t)),r=r.aggregate(a)}return[s,r]}doPrepareChar(e,t){t===void 0&&(t={});let[s,r]=super.doPrepareChar(e,t);if(this.currentMask){let a;[s,a]=super.doPrepareChar(s,this.currentMaskFlags(t)),r=r.aggregate(a)}return[s,r]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const s=new ChangeDetails;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:r,...a}=e;t&&this.compiledMasks.forEach((i,o)=>i.state=t[o]),s!=null&&(this.currentMask=s,this.currentMask.state=r),super.state=a}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:r,...a}=e[s];return objectIncludes(t,a)&&t.maskEquals(r)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}MaskedDynamic.DEFAULTS={...Masked.DEFAULTS,dispatch:(n,e,t,s)=>{if(!e.compiledMasks.length)return;const r=e.rawInputValue,a=e.compiledMasks.map((i,o)=>{const l=e.currentMask===i,u=l?i.displayValue.length:i.nearestInputPos(i.displayValue.length,DIRECTION.FORCE_LEFT);return i.rawInputValue!==r?(i.reset(),i.append(r,{raw:!0})):l||i.remove(u),i.append(n,e.currentMaskFlags(t)),i.appendTail(s),{index:o,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(u,i.nearestInputPos(i.displayValue.length,DIRECTION.FORCE_LEFT)))}});return a.sort((i,o)=>o.weight-i.weight||o.totalInputPositions-i.totalInputPositions),e.compiledMasks[a[0].index]}},IMask.MaskedDynamic=MaskedDynamic;class MaskedEnum extends MaskedPattern{constructor(e){super({...MaskedEnum.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const r=t.map(o=>o.length),a=Math.min(...r),i=Math.max(...r)-a;s.mask="*".repeat(a),i&&(s.mask+="["+"*".repeat(i)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){t===void 0&&(t={});const s=Math.min(this.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length),r=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+e,s));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(i,o)=>{const l=r[0][o];o>=this.value.length||l===i.value||(i.reset(),i._appendChar(l,t))});const a=super._appendCharRaw(r[0][this.value.length],t);return r.length===1&&r[0].slice(this.unmaskedValue.length).split("").forEach(i=>a.aggregate(super._appendCharRaw(i))),a}return new ChangeDetails({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new ContinuousTailDetails("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new ChangeDetails;const s=Math.min(super.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length);let r;for(r=e;r>=0&&!(this.enum.filter(o=>this.matchValue(o,this.value.slice(s,r),s)).length>1);--r);const a=super.remove(r,t);return a.tailShift+=r-e,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}MaskedEnum.DEFAULTS={...MaskedPattern.DEFAULTS,matchValue:(n,e,t)=>n.indexOf(e,t)===t},IMask.MaskedEnum=MaskedEnum;class MaskedFunction extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}IMask.MaskedFunction=MaskedFunction;var _MaskedNumber;class MaskedNumber extends Masked{constructor(e){super({...MaskedNumber.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[s,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(r.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&r.aggregate(this._appendChar("-")),[s,r]}_separatorsCount(e,t){t===void 0&&(t=!1);let s=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){t===void 0&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=e;const i=this.number;let o=!isNaN(i),l=!1;if(o){let c;this.min!=null&&this.min<0&&this.number<this.min&&(c=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(c=this.max),c!=null&&(this.autofix?(this._value=this.format(c,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!t.tail)):o=!1),o&&(o=!!this._value.match(this._numberRegExp))}let u;o?u=new ChangeDetails({inserted:this._value.slice(a.length),rawInserted:l?"":e,skip:l}):(this._value=a,u=new ChangeDetails),this._value=this._insertThousandsSeparators(this._value);const d=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,h=this._separatorsCountFromSlice(d);return u.tailShift+=(h-r)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),r=this.value.slice(t),a=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+r));const i=this._separatorsCountFromSlice(s);return new ChangeDetails({tailShift:(i-a)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case DIRECTION.NONE:case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const r=s+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===DIRECTION.FORCE_LEFT)return s}break}case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:{const s=this._findSeparatorAround(e);if(s>=0)return s+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(s,r,a,i)=>r+i),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){t===void 0&&(t={});const r=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===MaskedNumber.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,MaskedNumber.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||MaskedNumber.EMPTY_VALUES.includes(e)&&MaskedNumber.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}_MaskedNumber=MaskedNumber,MaskedNumber.UNMASKED_RADIX=".",MaskedNumber.EMPTY_VALUES=[...Masked.EMPTY_VALUES,0],MaskedNumber.DEFAULTS={...Masked.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[_MaskedNumber.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:n=>n.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},IMask.MaskedNumber=MaskedNumber;const PIPE_TYPE={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function createPipe(n,e,t){e===void 0&&(e=PIPE_TYPE.MASKED),t===void 0&&(t=PIPE_TYPE.MASKED);const s=createMask(n);return r=>s.runIsolated(a=>(a[e]=r,a[t]))}function pipe(n,e,t,s){return createPipe(e,t,s)(n)}IMask.PIPE_TYPE=PIPE_TYPE,IMask.createPipe=createPipe,IMask.pipe=pipe;class RepeatBlock extends MaskedPattern{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,r;const{repeat:a,...i}=normalizeOpts(e);this._blockOpts=Object.assign({},this._blockOpts,i);const o=createMask(this._blockOpts);this.repeat=(t=(s=a??o.repeat)!=null?s:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((r=this._blocks)==null?void 0:r.length)||0,this.repeatFrom)),blocks:{m:o},eager:o.eager,overwrite:o.overwrite,skipInvalid:o.skipInvalid,lazy:o.lazy,placeholderChar:o.placeholderChar,displayChar:o.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(createMask(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const s=new ChangeDetails;for(let l=(r=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?r:Math.max(this._blocks.length-1,0),u,d;u=(i=this._blocks[l])!=null?i:d=!d&&this._allocateBlock(l);++l){var r,a,i,o;const h=u._appendChar(e,{...t,_beforeTailState:(o=t._beforeTailState)==null||(o=o._blocks)==null?void 0:o[l]});if(h.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,r;e===void 0&&(e=0);const a=Math.max(((s=this._mapPosToBlock(e))==null?void 0:s.index)||0,this.repeatFrom,0);let i;t!=null&&(i=(r=this._mapPosToBlock(t))==null?void 0:r.index),i==null&&(i=this._blocks.length-1);let o=0;for(let l=i;a<=l&&!this._blocks[l].unmaskedValue;--l,++o);o&&(this._blocks.splice(i-o+1,o),this.mask=this.mask.slice(o))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask}catch{}const _hoisted_1$y=["placeholder","disabled"],_sfc_main$E=vue.defineComponent({__name:"vs-input-mask",props:vue.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},mask:{default:""},unmask:{type:Boolean,default:!1},placeholderChar:{default:"_"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue"),r=vue.ref(null);let a=null;return vue.onMounted(()=>{r.value&&(a=IMask(r.value,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1,placeholderChar:"_"}),a.on("accept",()=>{s.value=e.unmask?a.unmaskedValue:a.value}),a.on("complete",()=>{s.value=e.unmask?a.unmaskedValue:a.value}),a.value=s.value??"")}),vue.onBeforeUnmount(()=>{a?.destroy()}),vue.watch(()=>e.mask,i=>{a&&a.updateOptions({mask:i,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),vue.watch(s,i=>{a&&a.unmaskedValue!==i&&(a.value=i||"")}),(i,o)=>(vue.openBlock(),vue.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:r,placeholder:i.placeholder,disabled:i.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$y))}}),_hoisted_1$x=["innerHTML"],_sfc_main$D=vue.defineComponent({__name:"vs-input-html",props:{text:{type:String,default:""}},setup(n){const e=n;return(t,s)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{innerHTML:e?.text},null,8,_hoisted_1$x)]))}}),_hoisted_1$w={class:"relative w-full bg-white rounded-lg"},_hoisted_2$d=["placeholder","disabled"],_sfc_main$C=vue.defineComponent({__name:"vs-input-email",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue");return(r,a)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$w,[a[1]||(a[1]=vue.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),vue.withDirectives(vue.createElementVNode("input",{type:"email","onUpdate:modelValue":a[0]||(a[0]=i=>s.value=i),placeholder:n.placeholder,disabled:n.disabled,class:vue.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(t),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_2$d),[[vue.vModelText,s.value]])]))}}),_hoisted_1$v=["value","disabled"],_hoisted_2$c={class:"text-[13px] text-gray-700"},_sfc_main$B=vue.defineComponent({__name:"vs-input-radio-default",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=vue.useModel(n,"modelValue");return(t,s)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center gap-0",[n.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=r=>e.value=r),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,_hoisted_1$v),[[vue.vModelRadio,e.value]]),vue.createElementVNode("span",{class:vue.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${n.style?.primaryColor||"blue"}-500`,n.disabled?"opacity-50 cursor-not-allowed":""]])},[e.value==n.value?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${n.style?.primaryColor||"blue"}-500`]])},null,2)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("span",_hoisted_2$c,vue.toDisplayString(n.text),1)],2))}}),_hoisted_1$u=["value","disabled"],_hoisted_2$b={class:"text-[13px] text-gray-700"},_sfc_main$A=vue.defineComponent({__name:"vs-input-radio-buttons",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=vue.useModel(n,"modelValue");return(t,s)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[e.value==n.value?`ring-2 ring-ring ring-${n.style?.primaryColor||"blue"}-500`:"",n.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=r=>e.value=r),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,_hoisted_1$u),[[vue.vModelRadio,e.value]]),vue.createElementVNode("span",_hoisted_2$b,vue.toDisplayString(n.text),1)],2))}}),layouts={"vs-input-radio-default":_sfc_main$B,"vs-input-radio-buttons":_sfc_main$A},_sfc_main$z=vue.defineComponent({__name:"vs-input-radio",props:vue.mergeModels({options:{type:Array,required:!0},position:{type:String,default:"vertical"},view:{type:String,default:"default"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,t=vue.useModel(n,"modelValue"),s=vue.computed(()=>layouts[`vs-input-radio-${e.view}`]);return(r,a)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([n.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.options,i=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(s.value),vue.mergeProps({key:i?.id,text:i.text,value:i.id.toString(),checked:t.value===i.id,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o)},{ref_for:!0},r.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),_sfc_main$y=vue.defineComponent({__name:"vs-input-checkbox",props:{options:{type:Array,default:()=>[]},modelValue:{type:[Boolean,Array],default:!1},position:{default:()=>"vertical"},slots:{type:Object,default:()=>null},view:{type:String,default:()=>null},colSpan:{type:Number,default:()=>0},data:{type:String,default:()=>null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=e,r=vue.ref([]),a=vue.reactive({}),i=d=>d?.value||d?.id||d?.text||d,o=d=>d.text||String(d),l=d=>`lg:col-span-${d||12}`,u=async()=>{try{const d=await fetch(`/api/suggest/${t.data}`).then(h=>h.json());r.value=d?.data||d}catch(d){console.error(d)}};return vue.watch(()=>t.modelValue,d=>{if(typeof d=="boolean"&&r.value.length===1){const h=i(r.value[0]);a[h]=d}else if(Array.isArray(d)){const h=new Set(d);r.value.forEach(c=>{if(!c.disabled){const v=i(c);a[v]=h.has(v)}})}},{immediate:!0}),vue.watch(a,()=>{if(!r.value.length){s("update:modelValue",null);return}const d=Object.entries(a).filter(([,h])=>h).map(([h])=>h);s("update:modelValue",d.length===0?null:d)},{deep:!0}),vue.onMounted(()=>{if(t.data)u().then(()=>{if(typeof t.modelValue=="boolean"&&r.value.length===1){const d=i(r.value[0]);a[d]=t.modelValue}else if(Array.isArray(t.modelValue)){const d=new Set(t.modelValue);r.value.forEach(h=>{if(!h.disabled){const c=i(h);a[c]=d.has(c)}})}});else if(r.value=t.options,typeof t.modelValue=="boolean"&&r.value.length===1){const d=i(r.value[0]);a[d]=t.modelValue}else if(Array.isArray(t.modelValue)){const d=new Set(t.modelValue);r.value.forEach(h=>{if(!h.disabled){const c=i(h);a[c]=d.has(c)}})}}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["p-0 w-full gap-[6px]",[n.position==="vertical"?"flex-col":"",n.colSpan?"grid":"flex justify-start"]])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,c=>(vue.openBlock(),vue.createBlock(_sfc_main$L,{modelValue:a[i(c)],"onUpdate:modelValue":v=>a[i(c)]=v,value:i(c),class:vue.normalizeClass(l(n.colSpan)),disabled:c.disabled,label:o(c),key:i(c),icon:c?.icon,imgUrl:c?.imgUrl,option:c,slots:n.slots,view:n.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","slots","view"]))),128))],2))}}),VsInputCheckbox=_export_sfc(_sfc_main$y,[["__scopeId","data-v-b687dec2"]]),_hoisted_1$t=["placeholder","disabled"],_sfc_main$x=vue.defineComponent({__name:"vs-input-date1",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue");return(r,a)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"date","onUpdate:modelValue":a[0]||(a[0]=i=>s.value=i),placeholder:n.placeholder,disabled:n.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$t)),[[vue.vModelText,s.value]])}}),$=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};vue.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(n){this.$emit("update:modelValue",n)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(n){const{keyCode:e}=n;e===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const Vt={},zt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function Et(n,e){return vue.openBlock(),vue.createElementBlock("svg",zt,e[0]||(e[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Lt=$(Vt,[["render",Et]]),jt={},Mt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function Pt(n,e){return vue.openBlock(),vue.createElementBlock("svg",Mt,e[0]||(e[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Tt=$(jt,[["render",Pt]]),It={},Rt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function Ot(n,e){return vue.openBlock(),vue.createElementBlock("svg",Rt,e[0]||(e[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)]))}const Dt=$(It,[["render",Ot]]),Ht={},Nt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function At(n,e){return vue.openBlock(),vue.createElementBlock("svg",Nt,e[0]||(e[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Kt=$(Ht,[["render",At]]),qt={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Ut={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Wt={class:"flex-1"},Gt={class:"font-medium text-gray-900"},Zt={class:"mt-0.5 text-sm text-gray-700"},le=vue.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(n){const e={success:Lt,warning:Tt,error:Kt,info:Dt};return(t,s)=>(vue.openBlock(),vue.createElementBlock("div",qt,[vue.createElementVNode("div",Ut,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(e[t.type]))),vue.createElementVNode("div",Wt,[vue.createElementVNode("strong",Gt,vue.toDisplayString(t.title),1),vue.createElementVNode("p",Zt,vue.toDisplayString(t.message),1)]),s[0]||(s[0]=vue.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[vue.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}});vue.reactive({visible:!0});const H={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},jo=n=>{const{type:e="info",title:t,message:s,position:r="right-bottom"}=n||{};let a=document.querySelector("#notify-root");a||(a=document.createElement("div"),a.id="notify-root",a.className=`fixed z-[100] flex flex-col gap-3 ${H[r]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(a)),a.className.includes(H[r])||(Object.values(H).forEach(l=>{a.classList.remove(...l.split(" "))}),a.classList.add(...H[r].split(" ")));const i=document.createElement("div");a.appendChild(i);const o=vue.createApp({render(){return vue.h(le,{type:e,title:t,message:s,onClose:()=>{o.unmount(),i.remove()}})}});o.mount(i),i.querySelector("button")?.addEventListener("click",()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{o.unmount(),i.remove()},350)}),setTimeout(()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{o.unmount(),i.remove()},350)},3500)},fileUpload=async(n,e,t,s)=>{try{const r=new FormData;return r.append("unique","true"),r.append("file",n),(await fetch(`/file/upload/uploads?id=${e||""}&form=${t||""}&table=${s||""}`,{method:"POST",body:r}).then(i=>i.json()))?.result}catch(r){jo({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",r)}},fileDelete=async n=>{try{return await fetch(`file/delete${n}`),!0}catch(e){return console.error(e),!1}},fileDownload=async n=>{try{const e=await fetch(`file/download/files/uploads${n}`),t=await e.arrayBuffer(),s=e.headers["content-type"],r=new TextDecoder("utf-8").decode(t),a=new Blob([r],{type:s}),i=document.createElement("a");i.setAttribute("download",n),i.href=window.URL.createObjectURL(a),i.click()}catch(e){console.error(e.message)}},_sfc_main$w={},_hoisted_1$s={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$h(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$s,e[0]||(e[0]=[vue.createElementVNode("path",{d:"M5 12h14"},null,-1),vue.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const IconPlus=_export_sfc(_sfc_main$w,[["render",_sfc_render$h]]),_sfc_main$v={},_hoisted_1$r={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$g(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$r,e[0]||(e[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const iconPdf=_export_sfc(_sfc_main$v,[["render",_sfc_render$g]]),_sfc_main$u={},_hoisted_1$q={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$f(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$q,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),vue.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),vue.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const IconCsv=_export_sfc(_sfc_main$u,[["render",_sfc_render$f]]),_sfc_main$t={},_hoisted_1$p={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"};function _sfc_render$e(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$p,e[0]||(e[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const IconFile=_export_sfc(_sfc_main$t,[["render",_sfc_render$e]]),_sfc_main$s={},_hoisted_1$o={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$d(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$o,e[0]||(e[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const IconZip=_export_sfc(_sfc_main$s,[["render",_sfc_render$d]]),_sfc_main$r={},_hoisted_1$n={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$c(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$n,e[0]||(e[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const IconGeojson=_export_sfc(_sfc_main$r,[["render",_sfc_render$c]]),getFileType=n=>{if(!n)return"";const e=n?.split(".");return e[e.length-1]},fileFormatPreview=n=>{const e=getFileType(n),t={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return t.imageFormat.includes(e)?"img":t.sheetsFormat.includes(e)?IconCsv:t.textsFormat.includes(e)?IconGeojson:t.documentsFormat.includes(e)?iconPdf:t.archivesFormat.includes(e)?IconZip:IconFile},_sfc_main$q={},_hoisted_1$m={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function _sfc_render$b(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$m,e[0]||(e[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const IconDelete=_export_sfc(_sfc_main$q,[["render",_sfc_render$b]]),_sfc_main$p={},_hoisted_1$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$a(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$l,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconDownload=_export_sfc(_sfc_main$p,[["render",_sfc_render$a]]),_hoisted_1$k={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},_hoisted_2$a={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},_sfc_main$o=vue.defineComponent({__name:"vs-input-file-list-item",props:vue.mergeModels({multiple:{type:Boolean}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(n){const e=vue.useModel(n,"value"),t=vue.useModel(n,"item"),s=n;return(r,a)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(fileFormatPreview)(t.value)),{src:t.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:a[0]||(a[0]=i=>vue.unref(fileDownload)(t.value))},null,8,["src"])),vue.createElementVNode("div",_hoisted_2$a,[vue.createElementVNode("button",{type:"button",onClick:a[1]||(a[1]=i=>{vue.unref(fileDelete)(t.value),e.value=s.multiple?e.value?.filter(o=>o!==t.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[vue.createVNode(IconDelete,{class:"w-4 h-4"})]),vue.createElementVNode("button",{type:"button",onClick:a[2]||(a[2]=i=>vue.unref(fileDownload)(t.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[vue.createVNode(IconDownload,{class:"w-4 h-4"})])])]))}}),VsInputFileListItem=_export_sfc(_sfc_main$o,[["__scopeId","data-v-bc0f6d32"]]),_hoisted_1$j={class:"flex items-center gap-x-2"},_hoisted_2$9={key:1,class:"flex items-center flex-wrap gap-2"},_sfc_main$n=vue.defineComponent({__name:"vs-input-file",props:vue.mergeModels({multiple:{type:Boolean},format:{},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,t=vue.useModel(n,"modelValue"),s=vue.ref(null),r=i=>Array.isArray(t.value)&&t.value[i]||"",a=async i=>{if(e.format){const u=i.target.files?.[0];if(!u||!u.name.endsWith(e.format))return}const o=i.target.files?.[0];if(!o)return;const l=await fileUpload(o,"1","form","table");t.value=e.multiple?[...t.value||[],l?.file_path]:l?.file_path};return(i,o)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[vue.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:s,type:"file",onChange:a},null,544),!i.multiple&&t.value?(vue.openBlock(),vue.createBlock(VsInputFileListItem,{key:0,item:t.value,"onUpdate:item":o[0]||(o[0]=l=>t.value=l),value:t.value,"onUpdate:value":o[1]||(o[1]=l=>t.value=l)},null,8,["item","value"])):i.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$9,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(t.value,(l,u)=>(vue.openBlock(),vue.createBlock(VsInputFileListItem,{multiple:i.multiple,key:u,value:t.value,"onUpdate:value":o[2]||(o[2]=d=>t.value=d),item:r(u)},null,8,["multiple","value","item"]))),128)),vue.createElementVNode("div",{onClick:o[3]||(o[3]=l=>!i.disabled&&s.value?.click()),class:vue.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2)])):vue.createCommentVNode("",!0),i.multiple?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:o[4]||(o[4]=l=>s.value?.click()),class:vue.normalizeClass([i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2))]))}}),_sfc_main$m={componens:{IconFile},props:{item:null},computed:{createDate(){try{return new Date(this.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{formatBytes(n){if(n<1024)return`${n} B`;const e=n/1024;return e<1024?`${e.toFixed(2)} KB`:`${(e/1024).toFixed(2)} MB`}}},_hoisted_1$i={class:"max-w-[55vw]"},_hoisted_2$8={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},_hoisted_3$7={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},_hoisted_4$6={class:"px-[5px]"},_hoisted_5$6={class:""};function _sfc_render$9(n,e,t,s,r,a){return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[e[1]||(e[1]=vue.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),vue.createElementVNode("div",_hoisted_1$i,[vue.createElementVNode("p",_hoisted_2$8,vue.toDisplayString(t.item?.uploaded_name),1),vue.createElementVNode("p",_hoisted_3$7,[vue.createElementVNode("span",null,vue.toDisplayString(t.item?.username),1),vue.withDirectives(vue.createElementVNode("span",_hoisted_4$6,"|",512),[[vue.vShow,t.item?.username]]),vue.createElementVNode("span",null,vue.toDisplayString(a.createDate),1),e[0]||(e[0]=vue.createElementVNode("span",{class:"px-[5px]"},"|",-1)),vue.createElementVNode("span",_hoisted_5$6,vue.toDisplayString(a.formatBytes(t.item?.size)),1)])])],64)}const VsWidgetFileInfo=_export_sfc(_sfc_main$m,[["render",_sfc_render$9]]),_sfc_main$l={components:{VsWidgetFileInfo,IconDownload,IconTrash:IconDelete},props:{item:null,index:{type:Number,default:0},prefix:{type:String,default:"/api"}},data(){return{optionsFile:{defaultType:"iframe"}}},computed:{createDate(){try{return new Date(this.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{isSupportedFile(n){return["pdf","json"].includes(n.ext)},isSupportedAllFile(n){return["ppt","pptx","doc","docx","xls","xlsx"].includes(n.ext)},async downloadFile(n){const e=document.createElement("a");e.setAttribute("download",n?.uploaded_name),e.href=n?.file_path,e.click()},confirnDeleteFile(){this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteFile,updateListOnConfirm:!0})},async deleteFile(){try{await fetch(`${this.prefix}/widget/file/${this.item.entity_id}/${this.item.file_id}`),this.$emit("update")}catch(n){console.error(n)}},changeLightbox(n){(this.item.ext==="jpg"||this.item.ext==="png")&&this.$emit("openLightbox",{item:this.item,index:n})}}},_hoisted_1$h={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},_hoisted_2$7={key:0,class:"flex w-full gap-x-3 items-center"},_hoisted_3$6={key:1,class:"flex gap-x-3 w-full items-center"},_hoisted_4$5={key:2,class:"flex gap-x-3 w-full items-center"},_hoisted_5$5=["href"],_hoisted_6$5={key:3,class:"flex gap-x-3 w-full items-center"},_hoisted_7$4={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},_hoisted_8$3={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},_hoisted_9$3={class:"inline-block"},_hoisted_10$1={class:"inline-block"};function _sfc_render$8(n,e,t,s,r,a){const i=vue.resolveComponent("VsWidgetFileInfo"),o=vue.resolveComponent("IconDownload"),l=vue.resolveComponent("IconTrash");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[t.item.ext==="jpg"||t.item.ext==="png"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$7,[vue.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:e[0]||(e[0]=u=>a.changeLightbox(t.index))},[vue.createVNode(i,{item:t.item},null,8,["item"])])])):a.isSupportedFile(t.item)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[vue.createVNode(i,{item:t.item},null,8,["item"])])):a.isSupportedAllFile(t.item)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$5,[vue.createElementVNode("a",{href:`/api/file-preview?id=${t.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[vue.createVNode(i,{item:t.item},null,8,["item"])],8,_hoisted_5$5)])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$5,[vue.createVNode(i,{item:t.item},null,8,["item"])])),vue.createElementVNode("div",_hoisted_7$4,[vue.createElementVNode("div",_hoisted_8$3,[vue.createElementVNode("div",_hoisted_9$3,[vue.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=u=>a.downloadFile(t.item))},[vue.createVNode(o,{height:"14",width:"14"})])]),e[3]||(e[3]=vue.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),vue.createElementVNode("div",_hoisted_10$1,[vue.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:e[2]||(e[2]=u=>a.confirnDeleteFile())},[vue.createVNode(l,{height:"14",width:"14"})])])])])])}const VsWidgetFileItem=_export_sfc(_sfc_main$l,[["render",_sfc_render$8]]),_sfc_main$k={},_hoisted_1$g={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$7(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$g,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconUpload=_export_sfc(_sfc_main$k,[["render",_sfc_render$7]]),_hoisted_1$f={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},_hoisted_2$6={class:"flex w-full mb-[12px] items-center gap-x-2"},_hoisted_3$5={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},_hoisted_4$4={class1:"ml-auto"},_hoisted_5$4={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},_hoisted_6$4={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},_hoisted_7$3={class:"relative"},_hoisted_8$2={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},_hoisted_9$2={key:0},_sfc_main$j={__name:"vs-input-file-list",props:{id:{type:String,default:""},prefix:{type:String,default:"/api"}},emits:["update"],setup(n,{emit:e}){const t=n,s=vue.inject("form"),r=vue.computed(()=>s.value.formId),a=vue.ref(!1),i=vue.ref(0),o=e,l=vue.ref(!1),u=vue.ref({}),d=vue.ref([]),h=vue.ref(""),c=vue.computed(()=>Array.isArray(d.value)?d.value.filter(p=>p.ext==="jpg"||p.ext==="png").map(p=>p?.file_path):[]);console.log("images",c.value);const v=vue.computed(()=>h.value===""?d.value:d.value.filter(p=>p?.uploaded_name.includes(h.value))),C=p=>{const f=c.value.findIndex(V=>V===p.item.file_path);f!==-1&&(a.value=!0,i.value=f)},B=async()=>{try{const p=await fetch(`${t.prefix}/widget/file/${r.value}`).then(f=>f.json());d.value=p?.rows}catch(p){console.error(p)}},I=async p=>{await Promise.all(Array.from(p.target.files).map(async f=>{const V=new FormData;V.append("file",f);try{const S=`${t.prefix}/widget/file/${r.value}`;return await fetch(S,{method:"POST",body:V}),o("update","file-list"),f}catch(S){return console.error(S),null}})),await B()},b=p=>{const f={...p};return p.cancel||(f.cancel=()=>{l.value=!1}),p.updateListOnConfirm&&(f.confirm=async()=>{await p.confirm(),l.value=!1,B()}),f},_=p=>{u.value=b(p),l.value=!0};return vue.watch(r,p=>{p&&B()}),vue.onMounted(()=>{r.value&&B()}),(p,f)=>{const V=vue.resolveComponent("Lightbox"),S=vue.resolveComponent("MessageBox");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$f,[vue.createElementVNode("div",_hoisted_2$6,[vue.createElementVNode("h2",_hoisted_3$5," Файлів: "+vue.toDisplayString(d.value?.length),1),vue.createElementVNode("div",_hoisted_4$4,[vue.createElementVNode("label",null,[vue.createElementVNode("input",{type:"file",class:"hidden",onChange:f[0]||(f[0]=k=>I(k))},null,32),vue.createElementVNode("div",_hoisted_5$4,[vue.createVNode(IconUpload,{height:"16",width:"16"})])])])]),d.value?.length>4?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$4,[vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_7$3,[f[8]||(f[8]=vue.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[vue.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),vue.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=k=>h.value=k),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[vue.vModelText,h.value,void 0,{trim:!0}]])])])])):vue.createCommentVNode("",!0),d.value?.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.value,(k,x)=>(vue.openBlock(),vue.createBlock(VsWidgetFileItem,{key:x,id:n.id,prefix:n.prefix,item:k,index:x,onUpdate:f[2]||(f[2]=y=>p.$emit("update","file-list")),onOpenModal:f[3]||(f[3]=y=>_(y)),onOpenLightbox:f[4]||(f[4]=y=>C(y))},null,8,["id","prefix","item","index"]))),128)),v.value.length?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_9$2,f[9]||(f[9]=[vue.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):vue.createCommentVNode("",!0),vue.createVNode(V,{modelValue:a.value,"onUpdate:modelValue":f[5]||(f[5]=k=>a.value=k),startIndex:i.value,"onUpdate:index":f[6]||(f[6]=k=>i.value=k),images:c.value},null,8,["modelValue","startIndex","images"]),vue.createVNode(S,{modelValue:l.value,"onUpdate:modelValue":f[7]||(f[7]=k=>l.value=k),onConfirm:u.value.confirm,title:u.value.title,message:u.value.message,confirmButtonText:u.value.confirmButtonText,cancelButtonText:u.value.cancelButtonText},null,8,["modelValue","onConfirm","title","message","confirmButtonText","cancelButtonText"])])}}},_hoisted_1$e={class:"flex items-center justify-between"},_hoisted_2$5={class:"text-[16px] text-gray-900 font-medium"},_hoisted_3$4={class:"grid gap-3"},_sfc_main$i=vue.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(n){const e=n,t=vue.ref(e.isOpen);return vue.watch(()=>e.isOpen,s=>{t.value=s}),(s,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$e,[vue.createElementVNode("p",_hoisted_2$5,vue.toDisplayString(n.title),1),vue.createVNode(_sfc_main$G,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=a=>t.value=a),style:vue.normalizeStyle(n.style)},null,8,["modelValue","style"])]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_3$4,[vue.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[vue.vShow,t.value]])]),_:3})]))}}),VsContainerSwitcher=_export_sfc(_sfc_main$i,[["__scopeId","data-v-479564a3"]]),_hoisted_1$d={class:"text-[16px] text-gray-900 font-medium"},_hoisted_2$4={class:"grid gap-3"},_sfc_main$h=vue.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(n){const e=n,t=vue.ref(e.isOpen);return vue.watch(()=>e.isOpen,s=>{t.value=s}),(s,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=a=>t.value=!t.value),class:"flex items-center gap-2"},[vue.createVNode(vue.unref(IconChevronDown),{class:vue.normalizeClass(["h-4 w-4 duration-300",[t.value?"-rotate-180":""]])},null,8,["class"]),vue.createElementVNode("span",_hoisted_1$d,vue.toDisplayString(n.title),1)]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$4,[vue.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[vue.vShow,t.value]])]),_:3})]))}}),VsContainerAccordion=_export_sfc(_sfc_main$h,[["__scopeId","data-v-a37284e6"]]),_hoisted_1$c={class:"flex items-center justify-between"},_sfc_main$g=vue.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(n){return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$c,[vue.createElementVNode("p",null,vue.toDisplayString(n.title),1)]),vue.renderSlot(e.$slots,"default")]))}}),views={switcher:VsContainerSwitcher,accordion:VsContainerAccordion,default:_sfc_main$g},FormConditionsTypes={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},checkEqual=(n,e)=>String(n)===String(e),checkInequal=(n,e)=>String(n)!==String(e),checkHigher=(n,e)=>n>e,checkHigherOrEqual=(n,e)=>n>=e,checkLower=(n,e)=>n<e,checkLowerOrEqual=(n,e)=>n<=e,checkBetween=(n,e)=>Array.isArray(e)&&e.length===2?n>=e[0]&&n<=e[1]:!1,checkStartWith=(n,e)=>String(n).startsWith(String(e)),checkEndWith=(n,e)=>String(n).endsWith(String(e)),checkContain=(n,e)=>String(n).includes(String(e)),checkIn=(n,e)=>Array.isArray(e)?e.includes(n):!1,checkNotIn=(n,e)=>Array.isArray(e)?!e.includes(n):!0,isVisible=(n,e)=>{if(!e)return!0;switch(e?.[1]){case FormConditionsTypes.Equal:return checkEqual(n,e?.[2]);case FormConditionsTypes.Inequal:return checkInequal(n,e?.[2]);case FormConditionsTypes.Higer:return checkHigher(n,e?.[2]);case FormConditionsTypes.HigerOrEqual:return checkHigherOrEqual(n,e?.[2]);case FormConditionsTypes.Lower:return checkLower(n,e?.[2]);case FormConditionsTypes.LowerOrEqual:return checkLowerOrEqual(n,e?.[2]);case FormConditionsTypes.Between:return checkBetween(n,e?.[2]);case FormConditionsTypes.StartWith:return checkStartWith(n,e?.[2]);case FormConditionsTypes.EndWith:return checkEndWith(n,e?.[2]);case FormConditionsTypes.Contain:return checkContain(n,e?.[2]);case FormConditionsTypes.In:return checkIn(n,e?.[2]);case FormConditionsTypes.NotIn:return checkNotIn(n,e?.[2]);default:return!0}},_sfc_main$f=vue.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(n){const e=n,t=vue.inject("formValues",{default:{}}),s=vue.inject("form"),r=vue.computed(()=>e.schema?.filter(i=>{const o=i?.conditions;if(!o)return!0;const l=Array.isArray(o)?o[0]:o,u=t?.value?.[l];return isVisible(u,o)})),a=vue.computed(()=>views[e.view]);return(i,o)=>n.schema?.length?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(a.value),{key:0,title:n.title,style:vue.normalizeStyle(n.style)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,l=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:l.name},{ref_for:!0},l,{item:l,modelValue:vue.unref(t)[l.name],"onUpdate:modelValue":u=>vue.unref(t)[l.name]=u,style:n.style,error:vue.unref(s)?.errors?.[l.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):vue.createCommentVNode("",!0)}}),_hoisted_1$b={class:"relative"},_hoisted_2$3={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},_hoisted_3$3={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},_hoisted_4$3={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},_hoisted_5$3={class:"font-medium text-gray-800 dark:text-[#ffffff]"},_hoisted_6$3={class:"p-4 mim-h-0 h-full overflow-auto"},_sfc_main$e=vue.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(n,{emit:e}){const t=n,s=e,r=vue.ref(t.schema),a=vue.ref(t.defaultValue?JSON.parse(JSON.stringify(t.defaultValue)):{}),i=vue.ref({}),o=vue.ref();async function l(){const d=i.value.validate();if(d){jo({type:"warning",title:"Validation",message:Object.entries(d).map(([h,c])=>`${h}: ${c}`).join(`
2
+ `)});return}s("save",a.value)}function u(){s("close")}return vue.onMounted(async()=>{if(t.form){const d=await fetch(`/api/template/form/${t.form}`).then(h=>h.json());r.value=d.schema}else if(t.token){o.value=t.token;const d=await fetch(`/api/template/form/${o.value}`).then(c=>c.json()),h=await fetch(`/api/table/${o.value}`).then(c=>c.json());a.value=h,r.value=d.schema}}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,[vue.createElementVNode("div",_hoisted_2$3,[vue.createElementVNode("div",_hoisted_3$3,[vue.createElementVNode("div",_hoisted_4$3,[vue.createElementVNode("h3",_hoisted_5$3,vue.toDisplayString(d.mode==="add"?"Додати":"Змінити"),1),vue.createElementVNode("button",{onClick:u,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},h[2]||(h[2]=[vue.createElementVNode("span",{class:"sr-only"},"Close",-1),vue.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("path",{d:"M18 6 6 18"}),vue.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),vue.createElementVNode("div",_hoisted_6$3,[r.value?(vue.openBlock(),vue.createBlock(_sfc_main,{key:0,schema:r.value,values:a.value,"onUpdate:values":h[0]||(h[0]=c=>a.value=c),form:i.value,"onUpdate:form":h[1]||(h[1]=c=>i.value=c)},null,8,["schema","values","form"])):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[vue.createElementVNode("button",{type:"button",onClick:u,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),vue.createElementVNode("button",{onClick:l,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),form=(n={mode:"edit",schema:null})=>new Promise((e,t)=>{const s=document.querySelector("body");if(!s){console.error('Modal root element with id "#modal" not found!');return}const r=document.createElement("div");s.appendChild(r);const a=vue.createApp({render(){return vue.h(_sfc_main$e,{...n,onClose:()=>{e(null),i()},onSave:o=>{e(o),console.log(o),i()}})}});function i(){a.unmount(),r.remove()}a.mount(r)}),dynamicPosition=async(n,e,t,s=10)=>{if(!e||!t)return;await vue.nextTick();const r=await t?.getBoundingClientRect(),a=await e?.getBoundingClientRect();if(!a||!r)return;const i=await parseInt(e?.getBoundingClientRect()?.height.toString()),o=await parseInt(e?.getBoundingClientRect()?.width.toString()),l=await parseInt(t?.getBoundingClientRect()?.height.toString()),u=await parseInt(t?.getBoundingClientRect()?.width.toString()),d=await window.innerHeight,h=await window.innerWidth;let c=0,v=0;const C=a.bottom+s+l;switch(n){case"top":a.top-r.height-s<0?c=a.top-r.height+s+l+i:c=a.top-r.height-s,h>u+a.right+30?v=a.left-r.width/2+a.width/2:v=h-30-u;break;case"bottom":d>C?c=a.bottom+s:c=a.bottom-s-l-i,v=a.left-r.width/2+a.width/2;break;case"left":c=a.top-r.height/2+a.height/2,a.left-r.width-s>0?v=a.left-r.width-s:v=10;break;case"right":c=a.top-r.height/2+a.height/2,h-o>u?v=a.right+s:v=h-30-u;break;case"top-right":a.top-r.height-s<0?c=a.top-r.height+s+l+i:c=a.top-r.height-s,h-o>u?v=a.right+s:v=h-30-u;break;case"top-left":a.top-r.height-s<0?c=a.top-r.height+s+l+i:c=a.top-r.height-s,a.left-r.width-s>0?v=a.left-r.width-s:v=10;break;case"top-start":a.top-r.height-s<0?c=a.top-r.height+s+l+i:c=a.top-r.height-s,a.left>0?v=a.left:v=10;break;case"bottom-right":d>C?c=a.bottom+s:c=a.bottom-s-l-i,h-o>u?v=a.left:v=h-30-u;break;case"bottom-left":d>C?c=a.bottom+s:c=a.bottom-s-l-i,a.left>0?v=a.right-u:v=10;break;case"bottom-start":d>C?c=a.bottom+s:c=a.bottom-s-l-i,a.left>0?v=a.left:v=10;break}c+l>d?c=d-l-s:c<0&&(c=s),v+u>h?v=h-u-s:v<0&&(v=s),t instanceof HTMLElement&&(t.style.top=`${c}px`,t.style.left=`${v}px`,t.style.position="fixed")},_sfc_main$d={},_hoisted_1$a={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function _sfc_render$6(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$a,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),vue.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const IconMagnifyingGlass=_export_sfc(_sfc_main$d,[["render",_sfc_render$6]]),_hoisted_1$9=["disabled"],_hoisted_2$2={key:1},_hoisted_3$2={key:2,class:"text-gray-400"},_hoisted_4$2={class:"absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none"},_hoisted_5$2={key:0,class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"},_hoisted_6$2={class:"h-[30px] shrink-0 flex items-center relative justify-center"},_hoisted_7$2=["onClick"],_hoisted_8$1={class:"flex items-center gap-[8px] w-full"},_hoisted_9$1={key:2},_sfc_main$c=vue.defineComponent({__name:"vs-input-select",props:vue.mergeModels({placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:null},options:{default:()=>[]},maxHeight:{default:400},slots:{default:null},customClass:{default:""},style:{default:()=>({})},disabled:{type:Boolean},mode:{default:"search"},add:{},api:{},search:{type:Boolean},error:{default:null}},{modelValue:{type:[Number,String],default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,t=vue.computed(()=>e.mode||(e.api||e.search?"search":null)),{inputClass:s}=useStyle(e.style),r=vue.useModel(n,"modelValue"),a=vue.ref({}),i=vue.ref(null),o=vue.ref(null),l=vue.ref(!1),u=vue.ref(null),d=vue.ref([]),h=vue.ref(-1),c=vue.ref([]),v=vue.ref(""),C=vue.ref(null);let B=null;const I=vue.computed(()=>{if(d.value?.length){const g=d.value?.filter(m=>m?.id!==u.value?.id);return[u.value].concat(g)?.filter(m=>m!==null)}return[]}),b=async()=>{try{const{data:g}=await fetch(`${e.host}/${e.prefix}/suggest/${e.data}?json=1&key=${v.value}`).then(m=>m.json());return g}catch{return[]}},_=async g=>{document.body.click(),l.value=g!==void 0?g:!l.value,l.value&&!d.value?.length&&(!e.options?.length&&e.data?d.value=await b():e.options?.length&&(d.value=[...e.options])),l.value&&i.value?(a.value.width=`${i.value.getBoundingClientRect()?.width}px`,t.value==="search"&&C.value?.focus(),o.value&&dynamicPosition("bottom-start",i.value,o.value)):h.value=-1},p=()=>l.value?_(!1):null,f=g=>{u.value=g,r.value=g.id,_(!1)},V=(g,m)=>{if(!g||!m)return;const E=g.offsetTop,D=E+g.offsetHeight,F=m.scrollTop,N=F+m.clientHeight;E<F?Object.assign(m,{scrollTop:E-80}):D>N&&Object.assign(m,{scrollTop:D-m.clientHeight+4})},S=g=>{if(!l.value)return;const{keyCode:m}=g;if([38,40,13].includes(m)&&g.preventDefault(),m===38){if(h.value===0)return;h.value-=1,V(c.value[h.value],o.value)}else if(m===40){if(h.value+1>=I.value?.length)return;h.value+=1,V(c.value[h.value],o.value)}else if(m===13){const E=I.value[h.value];E&&f(E)}},k=async g=>{if(l.value)return;const{keyCode:m}=g;[38,40].includes(m)&&(await g.preventDefault(),h.value=0,setTimeout(()=>_()))},x=g=>{l.value&&i.value&&o.value&&!o.value.contains(g.target)&&(l.value=!1)},y=g=>{g?.key==="Escape"&&l.value&&_(!1)};async function w(g){if(!g)return null;const m=d.value?.find(D=>D?.id.toString()===g?.toString());if(m)return m;const{data:E}=await fetch(`${e.host}/${e.prefix}/suggest/${e.data}?json=1&val=${g}`).then(D=>D.json());return E[0]}vue.onMounted(async()=>{addEventListener("click",p),addEventListener("keydown",S),addEventListener("scroll",x,!0),addEventListener("keydown",y),e.options&&(d.value=e.options),r.value&&!e.options?.length&&e.data&&(d.value=await b()),u.value=await w(r.value?.toString())}),vue.onUnmounted(()=>{removeEventListener("click",p),removeEventListener("keydown",S),removeEventListener("scroll",x,!0),removeEventListener("keydown",y)}),vue.watch(v,g=>{let m=!1;(g===""||g.trimStart().length!==0)&&(m=!0),m&&(B&&clearTimeout(B),B=setTimeout(async()=>{!e.options?.length&&e.data?d.value=await b():d.value=e.options.filter(E=>E.text.toLowerCase().includes(g.toLowerCase()))},200))});async function M(){if(!e.add)return;const g=await form({form:e.add.form,mode:"add"});if(!g)return;const m=await fetch(`/api/table/${e.add.token}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}).then(E=>E.json());r.value=m.id,u.value=await w(m.id)}return(g,m)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"relative w-full",ref_key:"select",ref:i,onClick:m[5]||(m[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis",[l.value?`ring-rind ring-2 ring-${g.style?.primaryColor||"blue"}-500`:"",u.value?.text?"pr-[50px]":"pr-[25px]",vue.unref(s),g.customClass,{"!border-red-600":g.error}]]),onKeydown:k,onClick:m[0]||(m[0]=E=>_(!l.value)),disabled:g.disabled,style:{border:"1px solid #CFD9E0"}},[u.value?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:u.value?.color})},null,4)):vue.createCommentVNode("",!0),u.value?.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$2,vue.toDisplayString(u.value?.text),1)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$2,vue.toDisplayString(g.placeholder),1))],42,_hoisted_1$9),vue.createElementVNode("span",_hoisted_4$2,[vue.createVNode(vue.unref(IconChevronTopBottom),{height:"14",width:"14"})]),u.value?.text?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",onClick:m[1]||(m[1]=E=>{r.value=null,u.value=null}),class:"absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"},[vue.createVNode(vue.unref(IconClose),{height:"14",width:"14"})])):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("ul",{class:"z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",ref_key:"list",ref:o,style:vue.normalizeStyle({width:a.value.width,maxHeight:g.maxHeight+"px",backgroundColor:"white"}),onClick:m[4]||(m[4]=vue.withModifiers(()=>{},["stop"]))},[t.value==="search"?(vue.openBlock(),vue.createElementBlock("li",_hoisted_5$2,[vue.createElementVNode("div",_hoisted_6$2,[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":m[2]||(m[2]=E=>v.value=E),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref_key:"inputRef",ref:C},null,512),[[vue.vModelText,v.value]]),vue.createVNode(IconMagnifyingGlass,{width:"15px",height:"15px",class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),v.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(IconClose),{key:0,width:"15px",height:"15px",onClick:m[3]||(m[3]=E=>v.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0),I.value?.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[m[6]||(m[6]=vue.createElementVNode("li",{class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"}," Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ",-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(I.value,(E,D)=>(vue.openBlock(),vue.createElementBlock("li",{onClick:F=>f(E),key:E?.id,ref_for:!0,ref:F=>c.value[D]=F,class:vue.normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg",[h.value==D?"bg-gray-100":""]])},[vue.createElementVNode("span",_hoisted_8$1,[E?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:E?.color})},null,4)):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(E?.text),1)]),r.value==E?.id?(vue.openBlock(),vue.createBlock(vue.unref(IconCheck),{key:0,height:"14",width:"14","stroke-width":"2",class:"absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"})):vue.createCommentVNode("",!0)],10,_hoisted_7$2))),128))],64)):(vue.openBlock(),vue.createElementBlock("li",_hoisted_9$1,"Дані відсутні"))],4),[[vue.vShow,l.value]])]))],512),e.add?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:M,class:"ml-auto bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10px] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40px] gap-[8px] flex items-center"},[vue.createVNode(IconPlus,{width:"16",height:"16"}),m[7]||(m[7]=vue.createElementVNode("span",null,"Додати",-1))])):vue.createCommentVNode("",!0)],64))}}),_hoisted_1$8=["placeholder","disabled"],_sfc_main$b=vue.defineComponent({__name:"vs-input-textarea",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,{inputClass:t}=useStyle(e.style),s=vue.useModel(n,"modelValue");return(r,a)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("textarea",{"onUpdate:modelValue":a[0]||(a[0]=i=>s.value=i),placeholder:n.placeholder,disabled:n.disabled,row:"2",class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[vue.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$8)),[[vue.vModelText,s.value]])}}),_sfc_main$a={},_hoisted_1$7={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$5(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$7,e[0]||(e[0]=[vue.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),vue.createElementVNode("path",{d:"M7 20V4"},null,-1),vue.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),vue.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const IconArrowTopBottom=_export_sfc(_sfc_main$a,[["render",_sfc_render$5]]),_sfc_main$9={},_hoisted_1$6={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$4(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$6,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconImport=_export_sfc(_sfc_main$9,[["render",_sfc_render$4]]),_sfc_main$8={},_hoisted_1$5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$3(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$5,e[0]||(e[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconExport=_export_sfc(_sfc_main$8,[["render",_sfc_render$3]]),_sfc_main$7={},_hoisted_1$4={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$2(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$4,e[0]||(e[0]=[vue.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const IconGripVertical=_export_sfc(_sfc_main$7,[["render",_sfc_render$2]]),_sfc_main$6={},_hoisted_1$3={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _sfc_render$1(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$3,e[0]||(e[0]=[vue.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const IconNoData=_export_sfc(_sfc_main$6,[["render",_sfc_render$1]]),_sfc_main$5={},_hoisted_1$2={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render(n,e){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$2,e[0]||(e[0]=[vue.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const IconPen=_export_sfc(_sfc_main$5,[["render",_sfc_render]]),_hoisted_1$1={class:"vs-datatable border rounded-xl w-full flex-grow"},_hoisted_2$1={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},_hoisted_3$1={class:"relative w-full"},_hoisted_4$1={class:"table-wrapper flex gap-2"},_hoisted_5$1={class:"vs-popover inline-block"},_hoisted_6$1={class:"text-center"},_hoisted_7$1={class:""},_hoisted_8={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},_hoisted_9={class:"flex flex-col p-[2px] gap-[2px] w-[140px]"},_hoisted_10={class:"text-sm items-center text-gray-800 flex gap-1"},_hoisted_11={class:"w-full overflow-x-auto"},_hoisted_12={class:"w-full table-auto caption-bottom text-sm"},_hoisted_13={class:"[&_tr]:border-b"},_hoisted_14={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},_hoisted_15={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},_hoisted_16={key:0,colspan:"100%",class:"text-center"},_hoisted_17={class:"w-full"},_hoisted_18={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},_hoisted_19=["onDragstart","onDragover","onDrop"],_hoisted_20={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},_hoisted_21={class:"flex items-center justify-center"},_hoisted_22={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},_hoisted_23={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},_hoisted_24={class:"flex items-center justify-center gap-2"},_hoisted_25=["onClick"],_hoisted_26=["onClick"],_sfc_main$4=vue.defineComponent({__name:"vs-input-datatable",props:vue.mergeModels({colModel:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=n,t=vue.ref(e.colModel),s=vue.useModel(n,"modelValue"),r=vue.ref({}),a=vue.ref(""),i=vue.computed(()=>{if(!a.value)return s.value;const k=a.value.toLowerCase();return s.value.filter(x=>t.value.some(y=>{const w=x[y.key];return w?Array.isArray(w)?w.join(", ").toLowerCase().includes(k):String(w).toLowerCase().includes(k):!1}))}),o=vue.ref(null),l=vue.ref(null),u=vue.ref(!1),d=vue.ref(null),h=vue.ref({top:0,left:0}),c=k=>{o.value=k},v=k=>{l.value=k},C=k=>{if(o.value===null||o.value===k){o.value=null,l.value=null;return}const x=[...s.value],[y]=x.splice(o.value,1);x.splice(k,0,y),s.value=x,o.value=null,l.value=null},B=k=>{const y=k.currentTarget.getBoundingClientRect();h.value={top:y.bottom+window.scrollY,left:y.left+window.scrollX},u.value=!u.value},I=()=>{d.value&&d.value.click()},b=k=>{const y=k.target.files?.[0];if(!y)return;const w=new FileReader;w.onload=M=>{try{const g=M.target?.result;if(typeof g=="string"){const m=JSON.parse(g);Array.isArray(m)&&s.value.push(...m)}}catch(g){console.error("Error parsing file:",g)}},w.readAsText(y)},_=()=>{const k=JSON.stringify(s.value,null,2),x=new Blob([k],{type:"application/json"}),y=URL.createObjectURL(x),w=document.createElement("a");w.href=y,w.download="data.json",w.click(),URL.revokeObjectURL(y)};vue.onMounted(async()=>{});async function p(){const k=await form({schema:e.colModel,mode:"add"});k&&(s.value=[...s.value,k])}function f(k,x){return r.value[x.key]&&k[x.key]?r.value[x.key].find(y=>y.id.toString()===k[x.key].toString())?.text??k[x.key]:k[x.key]||"-"}async function V(k,x){const y=await form({schema:e.colModel,mode:"add",defaultValue:k});y&&(s.value=s.value.map((w,M)=>M===x?y:w))}function S(k){s.value=s.value.filter((x,y)=>y!==k)}return(k,x)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[vue.createElementVNode("div",_hoisted_3$1,[vue.createVNode(IconMagnifyingGlass,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),vue.withDirectives(vue.createElementVNode("input",{type:"text","onUpdate:modelValue":x[0]||(x[0]=y=>a.value=y),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[vue.vModelText,a.value]])]),vue.createElementVNode("div",_hoisted_4$1,[vue.createElementVNode("input",{ref_key:"fileInput",ref:d,onChange:b,class:"hidden",accept:".json",type:"file"},null,544),vue.createElementVNode("div",_hoisted_5$1,[vue.createElementVNode("div",_hoisted_6$1,[vue.createElementVNode("div",_hoisted_7$1,[vue.createElementVNode("button",{onClick:B,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[vue.createVNode(IconArrowTopBottom,{height:"16",width:"16"})])])])])]),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[u.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"vsTailwind vs-popover__content bottom",style:vue.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:h.value.top+"px",left:h.value.left+"px"}])},[vue.createElementVNode("div",_hoisted_8,[vue.createElementVNode("div",_hoisted_9,[vue.createElementVNode("button",{onClick:I,class:"flex items-center gap-1 px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},[vue.createVNode(IconImport,{class:"text-black",width:"14",height:"14"}),x[1]||(x[1]=vue.createTextVNode(" Імпортувати "))]),vue.createElementVNode("button",{onClick:_,class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},[vue.createElementVNode("span",_hoisted_10,[vue.createVNode(IconExport,{class:"text-black",width:"14",height:"14"}),x[2]||(x[2]=vue.createTextVNode(" Експортувати "))])])])])],4)):vue.createCommentVNode("",!0)])),vue.createElementVNode("button",{onClick:p,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[vue.createVNode(IconPlus),x[3]||(x[3]=vue.createTextVNode(" Додати "))])]),vue.createElementVNode("div",_hoisted_11,[vue.createElementVNode("table",_hoisted_12,[vue.createElementVNode("thead",_hoisted_13,[vue.createElementVNode("tr",_hoisted_14,[vue.createElementVNode("th",_hoisted_15,[vue.createVNode(IconGripVertical,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(t.value,y=>(vue.openBlock(),vue.createElementBlock("th",{key:y.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},vue.toDisplayString(y.ua),1))),128)),x[4]||(x[4]=vue.createElementVNode("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),vue.createElementVNode("tbody",{class:vue.normalizeClass({"[&_tr:last-child]:border-0":!l.value})},[i.value.length===0?(vue.openBlock(),vue.createElementBlock("td",_hoisted_16,[vue.createElementVNode("div",_hoisted_17,[vue.createElementVNode("div",_hoisted_18,[vue.createVNode(IconNoData,{class:"w-48 mx-auto"}),x[5]||(x[5]=vue.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[vue.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),vue.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,(y,w)=>(vue.openBlock(),vue.createElementBlock("tr",{key:y.id,class:vue.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":o.value===w,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":l.value===w}]),draggable:"true",onDragstart:M=>c(w),onDragover:vue.withModifiers(M=>v(w),["prevent"]),onDrop:M=>C(w)},[vue.createElementVNode("td",_hoisted_20,[vue.createElementVNode("div",_hoisted_21,[vue.createVNode(IconGripVertical,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(t.value,M=>(vue.openBlock(),vue.createElementBlock("td",{key:M.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[vue.createElementVNode("div",_hoisted_22,vue.toDisplayString(f(y,M)),1)]))),128)),vue.createElementVNode("td",_hoisted_23,[vue.createElementVNode("div",_hoisted_24,[vue.createElementVNode("button",{onClick:M=>V(y,w),class:"inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[vue.createVNode(IconPen,{width:"24",height:"24",class:"w-3 h-3"})],8,_hoisted_25),vue.createElementVNode("button",{onClick:M=>S(w),class:"inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[vue.createVNode(IconDelete,{width:"24",height:"24",class:"w-3 h-3"})],8,_hoisted_26)])])],42,_hoisted_19))),128))],2)])])]))}}),MAP_LOCALE={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function normalizeToGeoJSON(n){return n?n.type==="FeatureCollection"||n.type==="Feature"?n:n.geom?{type:"Feature",geometry:{type:n.geom.type,coordinates:n.geom.coordinates},properties:{}}:n.type&&n.coordinates?{type:"Feature",geometry:n,properties:{}}:null:null}const _hoisted_1={class:"leaflet-map-wrapper relative w-full h-[600px]"},_hoisted_2={class:"absolute top-4 right-4 z-[1000] space-y-2 bg-white/90 p-2 rounded shadow flex flex-col"},_hoisted_3={class:"absolute bottom-4 left-4 z-[1000] bg-white/90 p-2 rounded shadow"},_hoisted_4={class:"flex gap-2"},_hoisted_5=["onClick"],_hoisted_6=["src"],_hoisted_7={class:"text-xs text-center"},_sfc_main$3=vue.defineComponent({__name:"vs-input-map",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,s=e,r=vue.ref(null);let a,i,o;const l=vue.ref(null),u={OSM:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",preview:"https://a.tile.openstreetmap.org/0/0/0.png"},CartoLight:{url:"https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",preview:"https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/3/4/2.png"},Satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",preview:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/3/2/4"}};let d;function h(){return new Promise(b=>{window.L&&b(0);const _=document.createElement("link");_.rel="stylesheet",_.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(_);const p=document.createElement("link");p.rel="stylesheet",p.href="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css",document.head.appendChild(p);const f=document.createElement("script");f.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",f.onload=()=>{const V=document.createElement("script");V.src="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js",V.onload=()=>b(0),document.body.appendChild(V)},document.body.appendChild(f)})}function c(){const b=i.toGeoJSON();s("update:modelValue",b)}vue.onMounted(async()=>{await h(),L.drawLocal=MAP_LOCALE,a=L.map(r.value).setView([50.45,30.52],6),d=L.tileLayer(u.OSM.url,{maxZoom:19}).addTo(a),i=new L.FeatureGroup().addTo(a),a.on(L.Draw.Event.CREATED,_=>{const{layer:p}=_;i.addLayer(p),c()}),a.on(L.Draw.Event.EDITED,c),a.on(L.Draw.Event.DELETED,c);const b=normalizeToGeoJSON(t.modelValue);b&&L.geoJSON(b).eachLayer(_=>i.addLayer(_))});function v(b){if(a){switch(o&&o.disable(),b){case"marker":o=new L.Draw.Marker(a);break;case"polyline":o=new L.Draw.Polyline(a);break;case"polygon":o=new L.Draw.Polygon(a);break;case"rectangle":o=new L.Draw.Rectangle(a);break;case"circle":o=new L.Draw.Circle(a);break;default:o=new L.Draw.Circle(a);break}o&&o.enable()}}function C(){const b=i.toGeoJSON(),_=new Blob([JSON.stringify(b,null,2)],{type:"application/json"}),p=URL.createObjectURL(_),f=document.createElement("a");f.href=p,f.download="data.geojson",f.click(),URL.revokeObjectURL(p)}function B(b){const _=b.target.files[0];if(!_)return;const p=new FileReader;p.onload=()=>{if(typeof p.result!="string")return;const f=JSON.parse(p.result);i.clearLayers(),L.geoJSON(f).eachLayer(V=>i.addLayer(V)),c()},p.readAsText(_)}function I(b){a&&(a.removeLayer(d),d=L.tileLayer(u[b].url,{maxZoom:19}).addTo(a))}return vue.watch(()=>t.modelValue,b=>{const _=normalizeToGeoJSON(b);_&&(i.clearLayers(),L.geoJSON(_).eachLayer(p=>i.addLayer(p)))}),(b,_)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",{ref_key:"mapContainer",ref:r,class:"w-full h-full"},null,512),vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("button",{onClick:_[0]||(_[0]=p=>v("marker")),class:"btn"},"Точка"),vue.createElementVNode("button",{onClick:_[1]||(_[1]=p=>v("polyline")),class:"btn"},"Лінія"),vue.createElementVNode("button",{onClick:_[2]||(_[2]=p=>v("polygon")),class:"btn"},"Полігон"),vue.createElementVNode("button",{onClick:_[3]||(_[3]=p=>v("rectangle")),class:"btn"},"Прямокутник"),vue.createElementVNode("button",{onClick:_[4]||(_[4]=p=>v("circle")),class:"btn"},"Коло"),_[6]||(_[6]=vue.createElementVNode("hr",{class:"my-2"},null,-1)),vue.createElementVNode("button",{onClick:C,class:"btn"},"Експорт"),vue.createElementVNode("button",{onClick:_[5]||(_[5]=p=>l.value?.click()),class:"btn"},"Імпорт"),vue.createElementVNode("input",{ref_key:"importRef",ref:l,type:"file",onChange:B,class:"hidden"},null,544)]),vue.createElementVNode("div",_hoisted_3,[vue.createElementVNode("div",_hoisted_4,[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(u,(p,f)=>vue.createElementVNode("div",{key:f,class:"cursor-pointer border rounded overflow-hidden",onClick:V=>I(f)},[vue.createElementVNode("img",{src:p.preview,alt:"",class:"w-20 h-20 object-cover"},null,8,_hoisted_6),vue.createElementVNode("div",_hoisted_7,vue.toDisplayString(f),1)],8,_hoisted_5)),64))])])]))}}),inputs={VsInputText:_sfc_main$Q,VsInputRadio:_sfc_main$z,"vs-input-text":_sfc_main$Q,"vs-input-textarea":_sfc_main$b,"vs-input-mask":_sfc_main$E,"vs-input-number":_sfc_main$P,"vs-input-radio":_sfc_main$z,"vs-input-select":_sfc_main$c,"vs-input-switcher":_sfc_main$G,"vs-input-static":_sfc_main$F,"vs-input-container":_sfc_main$f,"vs-input-date":_sfc_main$x,"vs-input-checkbox":VsInputCheckbox,"vs-input-file":_sfc_main$n,"vs-input-html":_sfc_main$D,"vs-input-email":_sfc_main$C,"vs-input-datatable":_sfc_main$4,"vs-input-map":_sfc_main$3,"vs-input-file-list":_sfc_main$j},_sfc_main$2=vue.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(n){const e=n,t=vue.inject("values");async function s(){try{if(!e.api)return;const r=e.api.replace("{{value}}",e.value),a=await fetch(r);if(!a.ok){jo({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const i=await a.json();if(!e.set||!t)return;for(const[o,l]of Object.entries(e.set))t.value[o]=i.result[l]}catch(r){console.error(e.error,r)}}return(r,a)=>(vue.openBlock(),vue.createElementBlock("button",{onClick:s,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},vue.toDisplayString(r.button),1))}}),_sfc_main$1=vue.defineComponent({__name:"vs-compact-form-layout",props:{type:{type:String,default:""},style:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},layout:{type:String,default:"default"}},setup(n){const e=n,t=vue.computed(()=>layouts$1[`${e.layout}`]),s=vue.computed(()=>inputs?.[`vs-input-${e.type}`]);return(r,a)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(t.value),vue.mergeProps(r.$attrs,{style:n.style,item:n.item}),{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(s.value),vue.mergeProps(r.$attrs,{style:n.style}),null,16,["style"])),n.item.behavior?(vue.openBlock(),vue.createBlock(_sfc_main$2,vue.mergeProps({key:0},n.item.behavior,{value:r.$attrs.modelValue}),null,16,["value"])):vue.createCommentVNode("",!0)]),_:1},16,["style","item"]))}}),formErrorsUa={required:"Це поле є обов’язковим",email:"Неправильний email"},required=n=>n?!1:formErrorsUa.required,email=n=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)&&n?formErrorsUa.email:!1,regexp=(n,e)=>{const t=e.pattern??e.regexp;return!(typeof t=="string"?new RegExp(t):t).test(n)&&n?e.message:!1},custom=(value,customRule)=>{const func=eval(customRule.function);return func(value)?!1:customRule.message},checkFormRules=(n,e)=>{switch(typeof e=="string"?e:e.type){case"required":return required(n);case"email":return email(n);case"regexp":return regexp(n,e);case"custom":return custom(n,e);default:return!1}},mathTable={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file"};function convertType(n){const e=n.toLowerCase();return mathTable[e]||e}function convertSchema(n){if(Array.isArray(n)){const t=[];return n.forEach(s=>{const r={...s};r.name=(s.name||s.id||s.key).toString(),r.type=convertType(s.type),r.label=s.label||s.ua,r.rules=s.rules||s.validators,s.data&&(r.api=`/api/suggest/${s.data}`),t.push(r)}),t}const e=[];return Object.entries(n).forEach(t=>{const s={name:t[0],...t[1],type:convertType(t[1].type),label:t[1].label||t[1].ua,rules:t[1].rules||t[1].validators};t[1].type.includes("list")&&(s.multiple=!0),t[1].data&&(s.api=`/api/suggest/${t[1].data}`),e.push(s)}),e}function useForm(n,e){const t=convertSchema(e),s=vue.ref({});function r(l){const u=l?.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,h=n?.value?.[d];return isVisible(h,u)}const a=(l=t,u=!0)=>(l.forEach(d=>{if(d.rules){if(!r(d)){console.log(d.name,"skip hidden"),delete s.value[d.name];return}d.rules.forEach(h=>{const c=checkFormRules(n.value[d.name],h);c?s.value[d.name]=c:delete s.value[d.name]})}d.schema&&a(d.schema,!1)}),u&&Object.values(s.value).some(Boolean)?s.value:null),i=vue.computed(()=>t?.filter(l=>r(l)));return{errors:s,validate:a,reset:()=>{n.value={},s.value={}},visibleSchema:i}}const _sfc_main=vue.defineComponent({__name:"vs-compact-form",props:vue.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},layout:{default:()=>"default"},formId:{default:()=>""}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:vue.mergeModels(["handle-submit"],["update:form","update:values"]),setup(n,{emit:e}){const t=e,s=n,r=vue.useAttrs(),a=vue.useModel(n,"form"),i=vue.useModel(n,"values"),{errors:o,validate:l,reset:u,visibleSchema:d}=useForm(i,s.schema),h=()=>{l(),t("handle-submit",i.value)};return vue.onMounted(()=>{a.value.value=i.value,a.value.errors=o.value,a.value.reset=u,a.value.validate=l,a.value.formId=s.formId}),vue.provide("form",a),vue.provide("values",i),(c,v)=>(vue.openBlock(),vue.createElementBlock("form",{onSubmit:vue.withModifiers(h,["prevent"]),class:vue.normalizeClass(["grid grid-cols-12",c.layout==="default"?"gap-6":"gap-4"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(d),C=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:C.name,class:c.layout==="horizontal"?"col-span-12":`col-span-${C.col||12} `},{ref_for:!0},{...vue.unref(r),...c.style,...C},{item:C,layout:c.layout,modelValue:i.value[C.name],"onUpdate:modelValue":B=>i.value[C.name]=B,style:c.style,error:vue.unref(o)[C.name]}),null,16,["class","item","layout","modelValue","onUpdate:modelValue","style","error"]))),128))],34))}});_sfc_main.install=function n(e){e.component("VForm",_sfc_main),e.config.globalProperties.$form=form,e.provide("form",form),window.v3plugin||(window.v3plugin={}),window.v3plugin.$form=e.config.globalProperties.$form},exports.VForm=_sfc_main,exports.VsInputText=_sfc_main$Q,exports.default=_sfc_main,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});