@opengis/bi 1.2.12 → 1.2.13
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.
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +13 -13
- package/dist/{import-file-D9Y8ZzdW.js → import-file-ChR4pfHv.js} +438 -440
- package/dist/{vs-funnel-bar-BeE_843D.js → vs-funnel-bar-BT8dU3vP.js} +1 -1
- package/dist/{vs-list-ACf76Vig.js → vs-list-DOODrXT8.js} +1 -1
- package/dist/{vs-map-pxetb-Zt.js → vs-map-4a3Rl_vt.js} +2 -2
- package/dist/{vs-map-cluster-DA41ogp4.js → vs-map-cluster-B09g7_0L.js} +2 -2
- package/dist/{vs-number-Bbd7FUbo.js → vs-number-Cp65GC9n.js} +1 -1
- package/dist/{vs-table-C2DhpIdV.js → vs-table-RlP9LKj4.js} +1 -1
- package/dist/{vs-text-_61SDvtN.js → vs-text-Q1VMLsfH.js} +1 -1
- package/package.json +1 -1
package/dist/bi.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Dt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(Dt=typeof globalThis<"u"?globalThis:Dt||self,d(Dt.bi={},Dt.Vue))})(this,function(Dt,d){"use strict";var
|
|
1
|
+
(function(Dt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(Dt=typeof globalThis<"u"?globalThis:Dt||self,d(Dt.bi={},Dt.Vue))})(this,function(Dt,d){"use strict";var b0e=Object.defineProperty;var _0e=(Dt,d,Ni)=>d in Dt?b0e(Dt,d,{enumerable:!0,configurable:!0,writable:!0,value:Ni}):Dt[d]=Ni;var Et=(Dt,d,Ni)=>_0e(Dt,typeof d!="symbol"?d+"":d,Ni);/**
|
|
2
2
|
* @license lucide-vue-next v0.546.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const gx=er("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zp={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},YP=["onClick"],qP={class:"flex items-center justify-between w-full"},ZP={key:0},XP=d.defineComponent({__name:"vs-bi-dropdown",props:{title:{},options:{},value:{default:null}},emits:["selected"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!1),i=d.ref(t.value??null),o=d.ref(null),s=d.computed(()=>{const p=t.options;return typeof p=="string"?p.split(",").map((g,v)=>({id:v,text:g.trim()})):Array.isArray(p)?p:[]}),l=d.computed(()=>{const p=s.value.find(g=>(g.id??g)===i.value);return p?p.text??String(p):t.title??""}),u=p=>{const g=(p==null?void 0:p.id)??p;i.value=g,a.value=!1,n("selected",g),document.removeEventListener("click",c)},c=p=>{o.value&&!o.value.contains(p.target)&&(a.value=!1,document.removeEventListener("click",c))},f=()=>{a.value=!a.value,a.value?setTimeout(()=>{document.addEventListener("click",c)},200):document.removeEventListener("click",c)},h=p=>(Zp==null?void 0:Zp[p])??p;return d.onUnmounted(()=>{document.removeEventListener("click",c)}),(p,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:f},[d.createTextVNode(d.toDisplayString(h(l.value))+" ",1),g[0]||(g[0]=d.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",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"},[d.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),a.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:o,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,v=>(d.openBlock(),d.createElementBlock("div",{key:v.id||v,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:m=>u(v)},[d.createElementVNode("div",qP,[d.createElementVNode("span",null,d.toDisplayString(h(v.text||v)),1),i.value===(v.id||v)?(d.openBlock(),d.createElementBlock("span",ZP,g[1]||(g[1]=[d.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.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"},[d.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)]))):d.createCommentVNode("",!0)])],8,YP))),128))],512)):d.createCommentVNode("",!0)],64))}}),jP={class:"flex items-center space-x-2"},KP=d.defineComponent({__name:"vs-bi-switch",props:d.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:d.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(r,{emit:e}){const t=e,n=d.useModel(r,"modelValue"),a=()=>{t("update:is-enabled",n)};return(i,o)=>(d.openBlock(),d.createElementBlock("div",jP,[i.leftLabel?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["transition-colors",{"text-blue-500":!n.value}])},d.toDisplayString(i.leftLabel),3)):d.createCommentVNode("",!0),d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:a},null,544),[[d.vModelCheckbox,n.value]]),i.rightLabel?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["transition-colors",{"text-blue-500":n.value}])},d.toDisplayString(i.rightLabel),3)):d.createCommentVNode("",!0)]))}}),wt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t},QP={},JP={class:"flex items-center justify-center h-full"};function eO(r,e){return d.openBlock(),d.createElementBlock("div",JP,e[0]||(e[0]=[d.createElementVNode("div",{class:"text-center text-gray-500"},[d.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)]))}const tO=wt(QP,[["render",eO]]),vx={"bi-bar":d.defineAsyncComponent(()=>Promise.resolve().then(()=>gae)),"bi-number":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Die)),"bi-text":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Iie)),"bi-listbar":d.defineAsyncComponent(()=>Promise.resolve().then(()=>lie)),"bi-pie":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Sae)),"bi-donut":d.defineAsyncComponent(()=>Promise.resolve().then(()=>bae)),"bi-line":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Tae)),"bi-stat":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Gae)),"bi-pivot":d.defineAsyncComponent(()=>Promise.resolve().then(()=>kie)),"bi-progress":d.defineAsyncComponent(()=>Promise.resolve().then(()=>eie)),"bi-funnel":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Pie)),"bi-map":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Voe)),"bi-cluster":d.defineAsyncComponent(()=>Promise.resolve().then(()=>tse)),"bi-table":d.defineAsyncComponent(()=>Promise.resolve().then(()=>pse))};let mx="/api";function jc(r){mx=r||"/api"}function rO(r,e){const t=mx.replace(/\/$/,""),a=r.startsWith("http")||r.startsWith("//")||t&&r.startsWith(t)?r:`${t}${r.startsWith("/")?r:`/${r}`}`;if(!e||!Object.keys(e).length)return a;const i=new URLSearchParams;Object.entries(e).forEach(([s,l])=>{l!==void 0&&l!==""&&i.set(s,String(l))});const o=i.toString();return o?`${a}${a.includes("?")?"&":"?"}${o}`:a}async function Kc(r,e={}){const{params:t,...n}=e,a=rO(r,t),i=await fetch(a,{...n,headers:{"Content-Type":"application/json",...n.headers}});if(!i.ok){const s=new Error(i.statusText);throw s.status=i.status,s}const o=await i.text();if(o)try{return JSON.parse(o)}catch{return o}}const tr={get(r,e){return Kc(r,{...e,method:"GET"})},post(r,e){return Kc(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0})},put(r,e){return Kc(r,{method:"PUT",body:e!=null?JSON.stringify(e):void 0})},delete(r){return Kc(r,{method:"DELETE"})}},nO={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 justify-between max-h-[50px] h-fit shrink-0"},aO={class:"flex items-center justify-between w-full"},iO={class:"grid"},oO={class:"text-gray-800 max-h-[30px] inline-block line-clamp-1 font-semibold"},sO={class:"flex flex-col justify-end"},lO={key:0,class:"flex items-center justify-end w-full gap-2"},uO={class:"w-full h-full"},Tl=d.defineComponent({__name:"vs-widget",props:{dashboard:{},prefix:{default:""},widget:{},filterURl:{},dashboardWidgets:{},selectedWidget:{}},emits:["update:current-widget-data"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(null),i=d.ref(null),o=d.ref(null),s=d.ref({}),l=d.ref([]),u=d.computed(()=>{var b,_;const y=(b=t.dashboardWidgets)==null?void 0:b.find(x=>x.name===t.widget);return((_=y==null?void 0:y.data)==null?void 0:_.title)??(y==null?void 0:y.title)??""}),c=d.computed(()=>{var b;const y=(b=t.dashboardWidgets)==null?void 0:b.find(_=>_.name===t.widget);return(y==null?void 0:y.type)??"text"}),f=d.computed(()=>{var b;const y=(b=s.value)==null?void 0:b.controls;return!y||typeof y=="boolean"?[]:Object.keys(y).map(_=>({name:_,options:y[_]}))}),h=d.computed(()=>{const y=c.value?`bi-${c.value}`:"";return y&&y in vx?vx[y]:null});function p(y,b){var _,x;(x=(_=i.value)==null?void 0:_.changeStyle)==null||x.call(_,y,b)}function g(y,b){const _=l.value.find(x=>x.name===b);_?_.option=y:l.value.push({name:b,option:y}),v()}function v(){var b,_;let y=`/bi-data?dashboard=${t.dashboard}&widget=${t.widget}`;l.value.forEach(x=>{y+=`&${x.name}=${x.option}`}),(_=(b=i.value)==null?void 0:b.getDataFromURL)==null||_.call(b,y)}function m(){const y=o.value;if(y!=null&&y.getDataURL){const b=y.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),_=document.createElement("a");_.href=b,_.download="chart.png",document.body.appendChild(_),_.click(),document.body.removeChild(_)}}return d.onMounted(()=>{t.prefix&&jc(t.prefix)}),d.watch(()=>t.filterURl,y=>{var b,_;y&&((_=(b=i.value)==null?void 0:b.setFilter)==null||_.call(b,y))}),d.watch(()=>t.selectedWidget,(y,b)=>{var _;y!==b&&y===((_=s.value)==null?void 0:_.id)&&n("update:current-widget-data",s.value)}),d.watch(s,(y,b)=>{if((y==null?void 0:y.id)===(b==null?void 0:b.id))return;const _=typeof window<"u"?new URLSearchParams(window.top.location.search).get("widget"):null;_&&_===(y==null?void 0:y.id)&&n("update:current-widget-data",y)},{deep:!0}),(y,b)=>{var _,x,w,S,k,E,C,T,D;return d.openBlock(),d.createElementBlock("div",{ref_key:"widgetRef",ref:a,class:d.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(x=(_=s.value)==null?void 0:_.style)!=null&&x.height?`max-h-[${(S=(w=s.value)==null?void 0:w.style)==null?void 0:S.height}px] h-[${(E=(k=s.value)==null?void 0:k.style)==null?void 0:E.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(c.value)?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",nO,[d.createElementVNode("div",aO,[d.createElementVNode("div",iO,[d.createElementVNode("span",oO,d.toDisplayString(u.value),1)]),d.createElementVNode("div",sO,[(C=f.value)!=null&&C.length?(d.openBlock(),d.createElementBlock("span",lO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList((T=f.value)==null?void 0:T.filter(A=>(A==null?void 0:A.options)&&(A==null?void 0:A.name)!=="export"),A=>{var I,L;return d.openBlock(),d.createElementBlock("div",{key:A==null?void 0:A.name},[Array.isArray(A==null?void 0:A.options)?(d.openBlock(),d.createBlock(XP,{key:0,title:A==null?void 0:A.name,options:A==null?void 0:A.options,value:((L=(I=s.value)==null?void 0:I.data)==null?void 0:L[A==null?void 0:A.name])??null,onSelected:B=>g(B,A==null?void 0:A.name)},null,8,["title","options","value","onSelected"])):typeof A.options=="boolean"?(d.openBlock(),d.createBlock(KP,{key:1,"left-label":A==null?void 0:A.name,"model-value":!!(A!=null&&A.options),"onUpdate:isEnabled":B=>p(A==null?void 0:A.name,B)},null,8,["left-label","model-value","onUpdate:isEnabled"])):d.createCommentVNode("",!0)])}),128)),(D=f.value)!=null&&D.some(A=>(A==null?void 0:A.name)==="export")?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",onClick:m},[d.createVNode(d.unref(PP),{size:16,class:"text-gray-800"})])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])])])),d.createElementVNode("div",uO,[h.value?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h.value),{key:0,ref_key:"chartRef",ref:i,"current-widget":o.value,"onUpdate:currentWidget":b[0]||(b[0]=A=>o.value=A),"widget-data":s.value,"onUpdate:widgetData":b[1]||(b[1]=A=>s.value=A),dashboard:y.dashboard,title:u.value,widget:y.widget},null,40,["current-widget","widget-data","dashboard","title","widget"])):(d.openBlock(),d.createBlock(tO,{key:1,class:"w-full h-full"}))])],2)}}}),cO={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},dO={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fO={class:"max-w-sm mx-auto mt-6"},hO={class:"font-medium text-gray-800 dark:text-neutral-200"},pO={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},Qc=d.defineComponent({__name:"vs-new-nodata",props:{title:{default:"Дані для відображення відсутні"},text:{default:"Змініть параметри пошуку або спробуйте пізніше"}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",cO,[d.createElementVNode("div",null,[d.createElementVNode("div",dO,[t[0]||(t[0]=d.createStaticVNode('<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>',1)),d.createElementVNode("div",fO,[d.createElementVNode("p",hO,d.toDisplayString(e.title),1),d.createElementVNode("p",pO,d.toDisplayString(e.text),1)])])])]))}}),gO={components:{filterIcon:{__name:"filter",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(dx),d.mergeProps(e.$attrs,{size:24}),null,16))}},refreshIcon:{__name:"refresh",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(GP),d.mergeProps(e.$attrs,{size:24}),null,16))}}},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var r,e;return(r=this.filters)!=null&&r.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(r){var e,t;this.filters=r,this.activeFilters=(t=(e=this.$refs)==null?void 0:e.filter)==null?void 0:t.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:r}){this.isFilterVisible&&r.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},vO={class:"flex items-center"},mO={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function yO(r,e,t,n,a,i){const o=d.resolveComponent("filterIcon"),s=d.resolveComponent("VsFilterList");return d.openBlock(),d.createElementBlock("div",vO,[t.filterScheme?(d.openBlock(),d.createBlock(s,{key:0,ref:"filter",scheme:t.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=l=>a.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:r.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:d.withCtx(()=>[d.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...l)=>i.toggleFilterShown&&i.toggleFilterShown(...l))},[d.createVNode(o),e[2]||(e[2]=d.createTextVNode(" Фільтри ")),i.activeFiltersCount>=1?(d.openBlock(),d.createElementBlock("span",mO,d.toDisplayString(i.activeFiltersCount),1)):d.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):d.createCommentVNode("",!0)])}const bO={components:{VsFilterHeader:wt(gO,[["render",yO]])},props:{dashboardData:{type:Object,default:null},filters:{type:Array,default:null}}},_O={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 rounded-xl mb-2 pt-[3px] justify-between items-center"},xO={class:"grow"},wO={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},SO={key:0,class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400"},kO={key:0,class:"flex items-center gap-3"};function EO(r,e,t,n,a,i){var s,l,u;const o=d.resolveComponent("VsFilterHeader");return d.openBlock(),d.createElementBlock("div",_O,[d.createElementVNode("div",xO,[d.createElementVNode("h1",wO,d.toDisplayString((s=t.dashboardData)==null?void 0:s.title),1),(l=t.dashboardData)!=null&&l.description?(d.openBlock(),d.createElementBlock("button",SO,d.toDisplayString((u=t.dashboardData)==null?void 0:u.description),1)):d.createCommentVNode("",!0)]),t.filters?(d.openBlock(),d.createElementBlock("div",kO,[d.createVNode(o,{filterScheme:t.filters,"onFilters:changed":e[0]||(e[0]=c=>r.$emit("filters:changed",c))},null,8,["filterScheme"])])):d.createCommentVNode("",!0)])}const CO=wt(bO,[["render",EO]]),TO={class:"flex items-center gap-2 py-6 text-sm text-gray-600","aria-label":"Breadcrumb"},DO={key:0,class:"text-gray-400 shrink-0"},AO={key:2,class:"text-gray-900 font-medium truncate"},yx={__name:"vs-breadcrumbs",props:{items:{type:Array,default:()=>[]}},setup(r){return(e,t)=>{const n=d.resolveComponent("router-link");return d.openBlock(),d.createElementBlock("nav",TO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:i},[i>0?(d.openBlock(),d.createElementBlock("span",DO,[d.createVNode(d.unref(RP),{class:"w-4 h-4"})])):d.createCommentVNode("",!0),a.to?(d.openBlock(),d.createBlock(n,{key:1,to:a.to,class:"hover:text-gray-900 transition-colors"},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.label),1)]),_:2},1032,["to"])):(d.openBlock(),d.createElementBlock("span",AO,d.toDisplayString(a.label),1))],64))),128))])}}},MO={components:{VsWidget:Tl,VsNewNodata:Qc,VsHeader:CO,VsBreadcrumbs:yx},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){jc(this.prefix||"/api"),await this.fetchData()},methods:{async fetchData(){if(this.id)try{const r=await tr.get(`/bi-dashboard/${this.id}`);this.dashboardData=r}catch(r){console.error(r)}},columnClass(r){const e=r!=null&&r.col?r==null?void 0:r.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(r){var t;this.filterURl="";let e="&filter=";(t=r==null?void 0:r.url)!=null&&t.length&&(r.url.split("|").forEach(a=>{const i=a.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},NO={class:"w-full pb-8 overflow-y-auto mx-auto"},LO={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function IO(r,e,t,n,a,i){var l;const o=d.resolveComponent("VsNewNodata"),s=d.resolveComponent("VsWidget");return d.openBlock(),d.createElementBlock("div",NO,[d.createElementVNode("div",LO,[a.error||!a.dashboardData?(d.openBlock(),d.createBlock(o,{key:0,class:"col-span-12"})):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(((l=a.dashboardData)==null?void 0:l.panels)||[],(u,c)=>{var f;return d.openBlock(),d.createElementBlock("div",{key:c,class:d.normalizeClass([`col-span-${u.col||12}`,"flex flex-col gap-[10px]"])},[(f=u.widgets)!=null&&f.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(u.widgets,h=>(d.openBlock(),d.createBlock(s,{key:h,dashboard:t.id,widget:h,"dashboard-widgets":a.dashboardData.widgets,"filter-u-rl":a.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(d.openBlock(),d.createBlock(s,{key:1,class:"flex flex-col",dashboard:t.id,widget:u.widget,"dashboard-widgets":a.dashboardData.widgets,"filter-u-rl":a.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const BO=wt(MO,[["render",IO]]);var bx={},_x;(function(r){r.pop="pop",r.push="push"})(_x||(_x={}));var xx;(function(r){r.back="back",r.forward="forward",r.unknown=""})(xx||(xx={}));var Sx;(function(r){r[r.aborted=4]="aborted",r[r.cancelled=8]="cancelled",r[r.duplicated=16]="duplicated"})(Sx||(Sx={}));const VO=Symbol(bx.NODE_ENV!=="production"?"router":""),RO=Symbol(bx.NODE_ENV!=="production"?"route location":"");function kx(){return d.inject(VO)}function PO(r){return d.inject(RO)}const OO={key:0,class:"vs-modal-wrapper fixed inset-0 flex items-center justify-center p-4",style:{"z-index":"9999"}},zO={class:"flex items-center justify-between shrink-0 py-2.5 px-4 border-b border-gray-200 dark:border-[#454545]"},FO={class:"font-medium text-gray-800 dark:text-white"},$O={class:"vs-modal-content flex-1 min-h-0 overflow-auto p-4"},GO={key:0,class:"shrink-0 border-t border-gray-200 dark:border-neutral-700"},ns=wt({__name:"vs-modal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},size:{type:String,default:"medium"},closeClickBack:{type:Boolean,default:!1},teleport:{type:String,default:"#modal"}},emits:["close","update:visible"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.size==="small"?"md:max-w-[40%] w-full max-w-md":t.size==="lg"?"md:max-w-[70%] w-full max-w-4xl":"md:max-w-[50%] w-full max-w-lg");function i(){n("update:visible",!1),n("close")}function o(s){s.key==="Escape"&&i()}return d.onMounted(()=>{window.addEventListener("keydown",o)}),d.onUnmounted(()=>{window.removeEventListener("keydown",o)}),(s,l)=>(d.openBlock(),d.createBlock(d.Teleport,{to:r.teleport},[r.visible?(d.openBlock(),d.createElementBlock("div",OO,[d.createElementVNode("div",{class:"absolute inset-0 bg-black/50","aria-hidden":"true",onMousedown:l[0]||(l[0]=u=>r.closeClickBack&&u.target===u.currentTarget&&i())},null,32),d.createVNode(d.Transition,{name:"vs-modal",appear:""},{default:d.withCtx(()=>[r.visible?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["vs-modal-panel relative flex flex-col bg-white dark:bg-[#1A1A1A] rounded-xl shadow-xl max-h-[85vh] min-w-0 border border-gray-200 dark:border-[#454545]",a.value]),role:"dialog","aria-modal":"true",onMousedown:l[1]||(l[1]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",zO,[d.createElementVNode("h3",FO,d.toDisplayString(r.title),1),d.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center rounded-full bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-300","aria-label":"Закрити",onClick:i},l[2]||(l[2]=[d.createElementVNode("svg",{class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),d.createElementVNode("div",$O,[d.renderSlot(s.$slots,"default",{},void 0,!0)]),s.$slots.footer?(d.openBlock(),d.createElementBlock("div",GO,[d.renderSlot(s.$slots,"footer",{},void 0,!0)])):d.createCommentVNode("",!0)],34)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)],8,["to"]))}},[["__scopeId","data-v-335a5d48"]]),UO={__name:"icon-plus",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(px),d.mergeProps(e.$attrs,{size:24}),null,16))}},HO={class:"mb-4 overflow-auto scrollbar max-h-96"},WO={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},YO={__name:"vs-editor-create-widget",props:{columns:{type:Array,default:()=>[]},selectedDashboard:String},emits:"update-data",setup(r,{emit:e}){var f;const t=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),n=(f=d.getCurrentInstance().proxy)==null?void 0:f.$notify,a=e,i=r,o=d.ref(!1),s=d.ref({}),l=d.ref(),u=async()=>{try{await l.value.doValidation(),await tr.post(`/bi-dashboard/${i.selectedDashboard}`,s.value),await n({type:"success",title:"Успішно!",message:"Віджет успішно створено"}),await a("update-data"),s.value={},o.value=!1}catch{n({type:"error",title:"Помилка!",message:"При спробі створити віджет сталася помилка"})}},c=d.computed(()=>{var h,p,g,v;return{title:{type:"text",label:"Widget title",placeholder:"Widget title",validators:["required"]},x:{type:"radio",label:"X Axis",view:"buttons",style:{size:"xs"},validators:["required"],options:(p=(h=i.columns)==null?void 0:h.filter(m=>(m==null?void 0:m.type)=="text"||(m==null?void 0:m.type)==="date"||(m==null?void 0:m.type)==="timestamp without time zone"||(m==null?void 0:m.type)==="boolean"||(m==null?void 0:m.type)==="integer"))==null?void 0:p.map(({name:m,type:y})=>({id:m,label:m,type:y}))},metric:{type:"radio",label:"Y Axis",view:"buttons",validators:["required"],style:{size:"xs"},options:[{id:"count",label:"count"},...(v=(g=i.columns)==null?void 0:g.filter(m=>(m==null?void 0:m.type)==="numeric"||(m==null?void 0:m.type)==="double precision"))==null?void 0:v.map(({name:m,type:y})=>({id:m,label:m,type:y}))]},col:{type:"radio",label:"Columns count",validators:["required"],options:[{id:1,label:1},{id:2,label:2},{id:3,label:3},{id:4,label:4},{id:6,label:6},{id:9,label:9},{id:12,label:12}]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'<div style="width: 120px; height:160px" class="flex gap-[12px] flex-col"><img class="block" style="height: calc(100% - 40px)" :src="`https://cdn.softpro.ua/data/icons/bi/${id}.png`"/><span class="font-[500]">{{ label }}</span></div>'},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"Text",ua:"Table",placeholder:"Table"},query:{type:"Text",ua:"Query",placeholder:"Query"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}}});return(h,p)=>{const g=d.resolveComponent("VsPopover");return d.openBlock(),d.createElementBlock("div",null,[d.createVNode(g,{placement:"right",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("div",null,[d.createElementVNode("button",{class:"z-50 flex items-center justify-center h-[50px] !w-[50px] text-2xl text-white transition-colors bg-blue-500 rounded-full cursor-pointer hover:bg-blue-700",onClick:p[0]||(p[0]=v=>o.value=!0)},[d.createVNode(UO,{height:"20",width:"20"})])])]),default:d.withCtx(()=>[p[4]||(p[4]=d.createTextVNode(" Створити віджет "))]),_:1}),d.createVNode(ns,{teleport:"#modal",visible:o.value,title:"Створити віджет",onClose:p[3]||(p[3]=v=>o.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",WO,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:p[2]||(p[2]=v=>o.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:u,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:d.withCtx(()=>[d.createElementVNode("div",HO,[d.createVNode(d.unref(t),{ref_key:"form",ref:l,schema:c.value,values:s.value,"onUpdate:values":p[1]||(p[1]=v=>s.value=v)},null,8,["schema","values"])])]),_:1},8,["visible"])])}}},Ex={__name:"delete",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(WP),d.mergeProps(e.$attrs,{size:24}),null,16))}},Xp={__name:"close",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(gx),d.mergeProps(e.$attrs,{size:24}),null,16))}},Cx={__name:"edit",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(hx),d.mergeProps(e.$attrs,{size:24}),null,16))}},qO={class:"pt-[10px]"},ZO={__name:"vs-editor-form-style",props:{widgetName:{type:String},data:{type:Object,default:()=>{}}},setup(r){var p,g,v,m,y,b;const e=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),{$notify:t}=d.getCurrentInstance().proxy,n=r,a=d.ref(null),i={show:{label:"Label",type:"switcher",title:"Show label"},rotate:{type:"number",label:"Rotate angel",conditions:["show","==",!0]},align:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"center",text:"Center"},{id:"left",text:"Left"},{id:"right",text:"Right"}]},position:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"top",text:"Top"},{id:"right",text:"Right"},{id:"left",text:"Left"},{id:"bottom",text:"Bottom"}]}},o={show:{label:"Legend",type:"switcher",title:"Show legend"}},s={show:{label:"Tooltip ",type:"switcher",title:"Show tooltip"}},l=d.ref({...((g=(p=n.data)==null?void 0:p.style)==null?void 0:g.label)||{}}),u=d.ref({...((m=(v=n.data)==null?void 0:v.style)==null?void 0:m.legend)||{}}),c=d.ref({...((b=(y=n.data)==null?void 0:y.style)==null?void 0:b.tooltip)||{}}),f=()=>{const _=new CustomEvent(`update-style-${n.widgetName}`);_.chartId=n.widgetName,_.options={options:{legend:u.value,tooltip:c.value,label:l.value},seriesOptions:l.value},window.dispatchEvent(_)};d.watch(l,f,{deep:!0}),d.watch(u,f,{deep:!0}),d.watch(c,f,{deep:!0});const h=async()=>{try{await tr.put(`/bi-dashboard/${a.value}/${n.widgetName}`,{style:{legend:u.value,tooltip:c.value,label:l.value}});const _=new CustomEvent(`update-style-${n.widgetName}`);_.chartId=n.widgetName,_.options={options:{legend:u.value,tooltip:c.value,label:l.value},seriesOptions:l.value},window.dispatchEvent(_),await t({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return d.onMounted(()=>{const _=new URLSearchParams(window.top.location.search);a.value=_.get("dashboard")}),(_,x)=>{const w=d.resolveComponent("VsButton");return d.openBlock(),d.createElementBlock("div",qO,[d.createVNode(w,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:h},{default:d.withCtx(()=>x[3]||(x[3]=[d.createTextVNode(" Зберегти ")])),_:1}),d.createVNode(d.unref(e),{schema:i,values:l.value,"onUpdate:values":x[0]||(x[0]=S=>l.value=S),class:"p-0"},null,8,["values"]),d.createVNode(d.unref(e),{schema:o,values:u.value,"onUpdate:values":x[1]||(x[1]=S=>u.value=S),class:"p-0"},null,8,["values"]),d.createVNode(d.unref(e),{schema:s,values:c.value,"onUpdate:values":x[2]||(x[2]=S=>c.value=S),class:"p-0"},null,8,["values"])])}}};function jp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Li=jp();function Tx(r){Li=r}const Dx=/[&<>"']/,XO=new RegExp(Dx.source,"g"),Ax=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,jO=new RegExp(Ax.source,"g"),KO={"&":"&","<":"<",">":">",'"':""","'":"'"},Mx=r=>KO[r];function Ur(r,e){if(e){if(Dx.test(r))return r.replace(XO,Mx)}else if(Ax.test(r))return r.replace(jO,Mx);return r}const QO=/(^|[^\[])\^/g;function bt(r,e){let t=typeof r=="string"?r:r.source;e=e||"";const n={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(QO,"$1"),t=t.replace(a,o),n},getRegex:()=>new RegExp(t,e)};return n}function Nx(r){try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Dl={exec:()=>null};function Lx(r,e){const t=r.replace(/\|/g,(i,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/);let a=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(/\\\|/g,"|");return n}function Al(r,e,t){const n=r.length;if(n===0)return"";let a=0;for(;a<n&&r.charAt(n-a-1)===e;)a++;return r.slice(0,n-a)}function JO(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])t++;else if(r[n]===e[1]&&(t--,t<0))return n;return-1}function Ix(r,e,t,n){const a=e.href,i=e.title?Ur(e.title):null,o=r[1].replace(/\\([\[\]])/g,"$1");if(r[0].charAt(0)!=="!"){n.state.inLink=!0;const s={type:"link",raw:t,href:a,title:i,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,s}return{type:"image",raw:t,href:a,title:i,text:Ur(o)}}function e5(r,e){const t=r.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
|
|
111
|
+
*/const gx=er("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zp={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},YP=["onClick"],qP={class:"flex items-center justify-between w-full"},ZP={key:0},XP=d.defineComponent({__name:"vs-bi-dropdown",props:{title:{},options:{},value:{default:null}},emits:["selected"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!1),i=d.ref(t.value??null),o=d.ref(null),s=d.computed(()=>{const p=t.options;return typeof p=="string"?p.split(",").map((g,v)=>({id:v,text:g.trim()})):Array.isArray(p)?p:[]}),l=d.computed(()=>{const p=s.value.find(g=>(g.id??g)===i.value);return p?p.text??String(p):t.title??""}),u=p=>{const g=(p==null?void 0:p.id)??p;i.value=g,a.value=!1,n("selected",g),document.removeEventListener("click",c)},c=p=>{o.value&&!o.value.contains(p.target)&&(a.value=!1,document.removeEventListener("click",c))},f=()=>{a.value=!a.value,a.value?setTimeout(()=>{document.addEventListener("click",c)},200):document.removeEventListener("click",c)},h=p=>(Zp==null?void 0:Zp[p])??p;return d.onUnmounted(()=>{document.removeEventListener("click",c)}),(p,g)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:f},[d.createTextVNode(d.toDisplayString(h(l.value))+" ",1),g[0]||(g[0]=d.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",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"},[d.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),a.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:o,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,v=>(d.openBlock(),d.createElementBlock("div",{key:v.id||v,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:m=>u(v)},[d.createElementVNode("div",qP,[d.createElementVNode("span",null,d.toDisplayString(h(v.text||v)),1),i.value===(v.id||v)?(d.openBlock(),d.createElementBlock("span",ZP,g[1]||(g[1]=[d.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.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"},[d.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)]))):d.createCommentVNode("",!0)])],8,YP))),128))],512)):d.createCommentVNode("",!0)],64))}}),jP={class:"flex items-center space-x-2"},KP=d.defineComponent({__name:"vs-bi-switch",props:d.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:d.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(r,{emit:e}){const t=e,n=d.useModel(r,"modelValue"),a=()=>{t("update:is-enabled",n)};return(i,o)=>(d.openBlock(),d.createElementBlock("div",jP,[i.leftLabel?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["transition-colors",{"text-blue-500":!n.value}])},d.toDisplayString(i.leftLabel),3)):d.createCommentVNode("",!0),d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:a},null,544),[[d.vModelCheckbox,n.value]]),i.rightLabel?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["transition-colors",{"text-blue-500":n.value}])},d.toDisplayString(i.rightLabel),3)):d.createCommentVNode("",!0)]))}}),wt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t},QP={},JP={class:"flex items-center justify-center h-full"};function eO(r,e){return d.openBlock(),d.createElementBlock("div",JP,e[0]||(e[0]=[d.createElementVNode("div",{class:"text-center text-gray-500"},[d.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)]))}const tO=wt(QP,[["render",eO]]),vx={"bi-bar":d.defineAsyncComponent(()=>Promise.resolve().then(()=>pae)),"bi-number":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Tie)),"bi-text":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Lie)),"bi-listbar":d.defineAsyncComponent(()=>Promise.resolve().then(()=>sie)),"bi-pie":d.defineAsyncComponent(()=>Promise.resolve().then(()=>wae)),"bi-donut":d.defineAsyncComponent(()=>Promise.resolve().then(()=>yae)),"bi-line":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Cae)),"bi-stat":d.defineAsyncComponent(()=>Promise.resolve().then(()=>$ae)),"bi-pivot":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Sie)),"bi-progress":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Jae)),"bi-funnel":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Rie)),"bi-map":d.defineAsyncComponent(()=>Promise.resolve().then(()=>Boe)),"bi-cluster":d.defineAsyncComponent(()=>Promise.resolve().then(()=>ese)),"bi-table":d.defineAsyncComponent(()=>Promise.resolve().then(()=>hse))};let mx="/api";function jc(r){mx=r||"/api"}function rO(r,e){const t=mx.replace(/\/$/,""),a=r.startsWith("http")||r.startsWith("//")||t&&r.startsWith(t)?r:`${t}${r.startsWith("/")?r:`/${r}`}`;if(!e||!Object.keys(e).length)return a;const i=new URLSearchParams;Object.entries(e).forEach(([s,l])=>{l!==void 0&&l!==""&&i.set(s,String(l))});const o=i.toString();return o?`${a}${a.includes("?")?"&":"?"}${o}`:a}async function Kc(r,e={}){const{params:t,...n}=e,a=rO(r,t),i=await fetch(a,{...n,headers:{"Content-Type":"application/json",...n.headers}});if(!i.ok){const s=new Error(i.statusText);throw s.status=i.status,s}const o=await i.text();if(o)try{return JSON.parse(o)}catch{return o}}const tr={get(r,e){return Kc(r,{...e,method:"GET"})},post(r,e){return Kc(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0})},put(r,e){return Kc(r,{method:"PUT",body:e!=null?JSON.stringify(e):void 0})},delete(r){return Kc(r,{method:"DELETE"})}},nO={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 justify-between max-h-[50px] h-fit shrink-0"},aO={class:"flex items-center justify-between w-full"},iO={class:"grid"},oO={class:"text-gray-800 max-h-[30px] inline-block line-clamp-1 font-semibold"},sO={class:"flex flex-col justify-end"},lO={key:0,class:"flex items-center justify-end w-full gap-2"},uO={class:"w-full h-full"},Tl=d.defineComponent({__name:"vs-widget",props:{dashboard:{},prefix:{default:""},widget:{},filterURl:{},dashboardWidgets:{},selectedWidget:{}},emits:["update:current-widget-data"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(null),i=d.ref(null),o=d.ref(null),s=d.ref({}),l=d.ref([]),u=d.computed(()=>{var b,_;const y=(b=t.dashboardWidgets)==null?void 0:b.find(x=>x.name===t.widget);return((_=y==null?void 0:y.data)==null?void 0:_.title)??(y==null?void 0:y.title)??""}),c=d.computed(()=>{var b;const y=(b=t.dashboardWidgets)==null?void 0:b.find(_=>_.name===t.widget);return(y==null?void 0:y.type)??"text"}),f=d.computed(()=>{var b;const y=(b=s.value)==null?void 0:b.controls;return!y||typeof y=="boolean"?[]:Object.keys(y).map(_=>({name:_,options:y[_]}))}),h=d.computed(()=>{const y=c.value?`bi-${c.value}`:"";return y&&y in vx?vx[y]:null});function p(y,b){var _,x;(x=(_=i.value)==null?void 0:_.changeStyle)==null||x.call(_,y,b)}function g(y,b){const _=l.value.find(x=>x.name===b);_?_.option=y:l.value.push({name:b,option:y}),v()}function v(){var b,_;let y=`/bi-data?dashboard=${t.dashboard}&widget=${t.widget}`;l.value.forEach(x=>{y+=`&${x.name}=${x.option}`}),(_=(b=i.value)==null?void 0:b.getDataFromURL)==null||_.call(b,y)}function m(){const y=o.value;if(y!=null&&y.getDataURL){const b=y.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),_=document.createElement("a");_.href=b,_.download="chart.png",document.body.appendChild(_),_.click(),document.body.removeChild(_)}}return d.onMounted(()=>{t.prefix&&jc(t.prefix)}),d.watch(()=>t.filterURl,y=>{var b,_;y&&((_=(b=i.value)==null?void 0:b.setFilter)==null||_.call(b,y))}),d.watch(()=>t.selectedWidget,(y,b)=>{var _;y!==b&&y===((_=s.value)==null?void 0:_.id)&&n("update:current-widget-data",s.value)}),d.watch(s,(y,b)=>{if((y==null?void 0:y.id)===(b==null?void 0:b.id))return;const _=typeof window<"u"?new URLSearchParams(window.top.location.search).get("widget"):null;_&&_===(y==null?void 0:y.id)&&n("update:current-widget-data",y)},{deep:!0}),(y,b)=>{var _,x,w,S,k,E,C,T,D;return d.openBlock(),d.createElementBlock("div",{ref_key:"widgetRef",ref:a,class:d.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(x=(_=s.value)==null?void 0:_.style)!=null&&x.height?`max-h-[${(S=(w=s.value)==null?void 0:w.style)==null?void 0:S.height}px] h-[${(E=(k=s.value)==null?void 0:k.style)==null?void 0:E.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(c.value)?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",nO,[d.createElementVNode("div",aO,[d.createElementVNode("div",iO,[d.createElementVNode("span",oO,d.toDisplayString(u.value),1)]),d.createElementVNode("div",sO,[(C=f.value)!=null&&C.length?(d.openBlock(),d.createElementBlock("span",lO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList((T=f.value)==null?void 0:T.filter(A=>(A==null?void 0:A.options)&&(A==null?void 0:A.name)!=="export"),A=>{var I,L;return d.openBlock(),d.createElementBlock("div",{key:A==null?void 0:A.name},[Array.isArray(A==null?void 0:A.options)?(d.openBlock(),d.createBlock(XP,{key:0,title:A==null?void 0:A.name,options:A==null?void 0:A.options,value:((L=(I=s.value)==null?void 0:I.data)==null?void 0:L[A==null?void 0:A.name])??null,onSelected:B=>g(B,A==null?void 0:A.name)},null,8,["title","options","value","onSelected"])):typeof A.options=="boolean"?(d.openBlock(),d.createBlock(KP,{key:1,"left-label":A==null?void 0:A.name,"model-value":!!(A!=null&&A.options),"onUpdate:isEnabled":B=>p(A==null?void 0:A.name,B)},null,8,["left-label","model-value","onUpdate:isEnabled"])):d.createCommentVNode("",!0)])}),128)),(D=f.value)!=null&&D.some(A=>(A==null?void 0:A.name)==="export")?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",onClick:m},[d.createVNode(d.unref(PP),{size:16,class:"text-gray-800"})])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])])])),d.createElementVNode("div",uO,[h.value?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h.value),{key:0,ref_key:"chartRef",ref:i,"current-widget":o.value,"onUpdate:currentWidget":b[0]||(b[0]=A=>o.value=A),"widget-data":s.value,"onUpdate:widgetData":b[1]||(b[1]=A=>s.value=A),dashboard:y.dashboard,title:u.value,widget:y.widget},null,40,["current-widget","widget-data","dashboard","title","widget"])):(d.openBlock(),d.createBlock(tO,{key:1,class:"w-full h-full"}))])],2)}}}),cO={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},dO={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fO={class:"max-w-sm mx-auto mt-6"},hO={class:"font-medium text-gray-800 dark:text-neutral-200"},pO={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},Qc=d.defineComponent({__name:"vs-new-nodata",props:{title:{default:"Дані для відображення відсутні"},text:{default:"Змініть параметри пошуку або спробуйте пізніше"}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",cO,[d.createElementVNode("div",null,[d.createElementVNode("div",dO,[t[0]||(t[0]=d.createStaticVNode('<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>',1)),d.createElementVNode("div",fO,[d.createElementVNode("p",hO,d.toDisplayString(e.title),1),d.createElementVNode("p",pO,d.toDisplayString(e.text),1)])])])]))}}),gO={components:{filterIcon:{__name:"filter",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(dx),d.mergeProps(e.$attrs,{size:24}),null,16))}},refreshIcon:{__name:"refresh",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(GP),d.mergeProps(e.$attrs,{size:24}),null,16))}}},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var r,e;return(r=this.filters)!=null&&r.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(r){var e,t;this.filters=r,this.activeFilters=(t=(e=this.$refs)==null?void 0:e.filter)==null?void 0:t.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:r}){this.isFilterVisible&&r.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},vO={class:"flex items-center"},mO={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function yO(r,e,t,n,a,i){const o=d.resolveComponent("filterIcon"),s=d.resolveComponent("VsFilterList");return d.openBlock(),d.createElementBlock("div",vO,[t.filterScheme?(d.openBlock(),d.createBlock(s,{key:0,ref:"filter",scheme:t.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=l=>a.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:r.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:d.withCtx(()=>[d.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...l)=>i.toggleFilterShown&&i.toggleFilterShown(...l))},[d.createVNode(o),e[2]||(e[2]=d.createTextVNode(" Фільтри ")),i.activeFiltersCount>=1?(d.openBlock(),d.createElementBlock("span",mO,d.toDisplayString(i.activeFiltersCount),1)):d.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):d.createCommentVNode("",!0)])}const bO={components:{VsFilterHeader:wt(gO,[["render",yO]])},props:{dashboardData:{type:Object,default:null},filters:{type:Array,default:null}}},_O={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 rounded-xl mb-2 pt-[3px] justify-between items-center"},xO={class:"grow"},wO={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},SO={key:0,class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400"},kO={key:0,class:"flex items-center gap-3"};function EO(r,e,t,n,a,i){var s,l,u;const o=d.resolveComponent("VsFilterHeader");return d.openBlock(),d.createElementBlock("div",_O,[d.createElementVNode("div",xO,[d.createElementVNode("h1",wO,d.toDisplayString((s=t.dashboardData)==null?void 0:s.title),1),(l=t.dashboardData)!=null&&l.description?(d.openBlock(),d.createElementBlock("button",SO,d.toDisplayString((u=t.dashboardData)==null?void 0:u.description),1)):d.createCommentVNode("",!0)]),t.filters?(d.openBlock(),d.createElementBlock("div",kO,[d.createVNode(o,{filterScheme:t.filters,"onFilters:changed":e[0]||(e[0]=c=>r.$emit("filters:changed",c))},null,8,["filterScheme"])])):d.createCommentVNode("",!0)])}const CO=wt(bO,[["render",EO]]),TO={class:"flex items-center gap-2 py-6 text-sm text-gray-600","aria-label":"Breadcrumb"},DO={key:0,class:"text-gray-400 shrink-0"},AO={key:2,class:"text-gray-900 font-medium truncate"},yx={__name:"vs-breadcrumbs",props:{items:{type:Array,default:()=>[]}},setup(r){return(e,t)=>{const n=d.resolveComponent("router-link");return d.openBlock(),d.createElementBlock("nav",TO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:i},[i>0?(d.openBlock(),d.createElementBlock("span",DO,[d.createVNode(d.unref(RP),{class:"w-4 h-4"})])):d.createCommentVNode("",!0),a.to?(d.openBlock(),d.createBlock(n,{key:1,to:a.to,class:"hover:text-gray-900 transition-colors"},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.label),1)]),_:2},1032,["to"])):(d.openBlock(),d.createElementBlock("span",AO,d.toDisplayString(a.label),1))],64))),128))])}}},MO={components:{VsWidget:Tl,VsNewNodata:Qc,VsHeader:CO,VsBreadcrumbs:yx},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){jc(this.prefix||"/api"),await this.fetchData()},methods:{async fetchData(){if(this.id)try{const r=await tr.get(`/bi-dashboard/${this.id}`);this.dashboardData=r}catch(r){console.error(r)}},columnClass(r){const e=r!=null&&r.col?r==null?void 0:r.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(r){var t;this.filterURl="";let e="&filter=";(t=r==null?void 0:r.url)!=null&&t.length&&(r.url.split("|").forEach(a=>{const i=a.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},NO={class:"w-full pb-8 overflow-y-auto mx-auto"},LO={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function IO(r,e,t,n,a,i){var l;const o=d.resolveComponent("VsNewNodata"),s=d.resolveComponent("VsWidget");return d.openBlock(),d.createElementBlock("div",NO,[d.createElementVNode("div",LO,[a.error||!a.dashboardData?(d.openBlock(),d.createBlock(o,{key:0,class:"col-span-12"})):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(((l=a.dashboardData)==null?void 0:l.panels)||[],(u,c)=>{var f;return d.openBlock(),d.createElementBlock("div",{key:c,class:d.normalizeClass([`col-span-${u.col||12}`,"flex flex-col gap-[10px]"])},[(f=u.widgets)!=null&&f.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(u.widgets,h=>(d.openBlock(),d.createBlock(s,{key:h,dashboard:t.id,widget:h,"dashboard-widgets":a.dashboardData.widgets,"filter-u-rl":a.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(d.openBlock(),d.createBlock(s,{key:1,class:"flex flex-col",dashboard:t.id,widget:u.widget,"dashboard-widgets":a.dashboardData.widgets,"filter-u-rl":a.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const BO=wt(MO,[["render",IO]]);var bx={},_x;(function(r){r.pop="pop",r.push="push"})(_x||(_x={}));var xx;(function(r){r.back="back",r.forward="forward",r.unknown=""})(xx||(xx={}));var Sx;(function(r){r[r.aborted=4]="aborted",r[r.cancelled=8]="cancelled",r[r.duplicated=16]="duplicated"})(Sx||(Sx={}));const VO=Symbol(bx.NODE_ENV!=="production"?"router":""),RO=Symbol(bx.NODE_ENV!=="production"?"route location":"");function kx(){return d.inject(VO)}function PO(r){return d.inject(RO)}const OO={key:0,class:"vs-modal-wrapper fixed inset-0 flex items-center justify-center p-4",style:{"z-index":"9999"}},zO={class:"flex items-center justify-between shrink-0 py-2.5 px-4 border-b border-gray-200 dark:border-[#454545]"},FO={class:"font-medium text-gray-800 dark:text-white"},$O={class:"vs-modal-content flex-1 min-h-0 overflow-auto p-4"},GO={key:0,class:"shrink-0 border-t border-gray-200 dark:border-neutral-700"},ns=wt({__name:"vs-modal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},size:{type:String,default:"medium"},closeClickBack:{type:Boolean,default:!1},teleport:{type:String,default:"#modal"}},emits:["close","update:visible"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.size==="small"?"md:max-w-[40%] w-full max-w-md":t.size==="lg"?"md:max-w-[70%] w-full max-w-4xl":"md:max-w-[50%] w-full max-w-lg");function i(){n("update:visible",!1),n("close")}function o(s){s.key==="Escape"&&i()}return d.onMounted(()=>{window.addEventListener("keydown",o)}),d.onUnmounted(()=>{window.removeEventListener("keydown",o)}),(s,l)=>(d.openBlock(),d.createBlock(d.Teleport,{to:r.teleport},[r.visible?(d.openBlock(),d.createElementBlock("div",OO,[d.createElementVNode("div",{class:"absolute inset-0 bg-black/50","aria-hidden":"true",onMousedown:l[0]||(l[0]=u=>r.closeClickBack&&u.target===u.currentTarget&&i())},null,32),d.createVNode(d.Transition,{name:"vs-modal",appear:""},{default:d.withCtx(()=>[r.visible?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["vs-modal-panel relative flex flex-col bg-white dark:bg-[#1A1A1A] rounded-xl shadow-xl max-h-[85vh] min-w-0 border border-gray-200 dark:border-[#454545]",a.value]),role:"dialog","aria-modal":"true",onMousedown:l[1]||(l[1]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",zO,[d.createElementVNode("h3",FO,d.toDisplayString(r.title),1),d.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center rounded-full bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-300","aria-label":"Закрити",onClick:i},l[2]||(l[2]=[d.createElementVNode("svg",{class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),d.createElementVNode("div",$O,[d.renderSlot(s.$slots,"default",{},void 0,!0)]),s.$slots.footer?(d.openBlock(),d.createElementBlock("div",GO,[d.renderSlot(s.$slots,"footer",{},void 0,!0)])):d.createCommentVNode("",!0)],34)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)],8,["to"]))}},[["__scopeId","data-v-335a5d48"]]),UO={__name:"icon-plus",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(px),d.mergeProps(e.$attrs,{size:24}),null,16))}},HO={class:"mb-4 overflow-auto scrollbar max-h-96"},WO={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},YO={__name:"vs-editor-create-widget",props:{columns:{type:Array,default:()=>[]},selectedDashboard:String},emits:"update-data",setup(r,{emit:e}){var f;const t=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),n=(f=d.getCurrentInstance().proxy)==null?void 0:f.$notify,a=e,i=r,o=d.ref(!1),s=d.ref({}),l=d.ref(),u=async()=>{try{await l.value.doValidation(),await tr.post(`/bi-dashboard/${i.selectedDashboard}`,s.value),await n({type:"success",title:"Успішно!",message:"Віджет успішно створено"}),await a("update-data"),s.value={},o.value=!1}catch{n({type:"error",title:"Помилка!",message:"При спробі створити віджет сталася помилка"})}},c=d.computed(()=>{var h,p,g,v;return{title:{type:"text",label:"Widget title",placeholder:"Widget title",validators:["required"]},x:{type:"radio",label:"X Axis",view:"buttons",style:{size:"xs"},validators:["required"],options:(p=(h=i.columns)==null?void 0:h.filter(m=>(m==null?void 0:m.type)=="text"||(m==null?void 0:m.type)==="date"||(m==null?void 0:m.type)==="timestamp without time zone"||(m==null?void 0:m.type)==="boolean"||(m==null?void 0:m.type)==="integer"))==null?void 0:p.map(({name:m,type:y})=>({id:m,label:m,type:y}))},metric:{type:"radio",label:"Y Axis",view:"buttons",validators:["required"],style:{size:"xs"},options:[{id:"count",label:"count"},...(v=(g=i.columns)==null?void 0:g.filter(m=>(m==null?void 0:m.type)==="numeric"||(m==null?void 0:m.type)==="double precision"))==null?void 0:v.map(({name:m,type:y})=>({id:m,label:m,type:y}))]},col:{type:"radio",label:"Columns count",validators:["required"],options:[{id:1,label:1},{id:2,label:2},{id:3,label:3},{id:4,label:4},{id:6,label:6},{id:9,label:9},{id:12,label:12}]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'<div style="width: 120px; height:160px" class="flex gap-[12px] flex-col"><img class="block" style="height: calc(100% - 40px)" :src="`https://cdn.softpro.ua/data/icons/bi/${id}.png`"/><span class="font-[500]">{{ label }}</span></div>'},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"Text",ua:"Table",placeholder:"Table"},query:{type:"Text",ua:"Query",placeholder:"Query"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}}});return(h,p)=>{const g=d.resolveComponent("VsPopover");return d.openBlock(),d.createElementBlock("div",null,[d.createVNode(g,{placement:"right",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("div",null,[d.createElementVNode("button",{class:"z-50 flex items-center justify-center h-[50px] !w-[50px] text-2xl text-white transition-colors bg-blue-500 rounded-full cursor-pointer hover:bg-blue-700",onClick:p[0]||(p[0]=v=>o.value=!0)},[d.createVNode(UO,{height:"20",width:"20"})])])]),default:d.withCtx(()=>[p[4]||(p[4]=d.createTextVNode(" Створити віджет "))]),_:1}),d.createVNode(ns,{teleport:"#modal",visible:o.value,title:"Створити віджет",onClose:p[3]||(p[3]=v=>o.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",WO,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:p[2]||(p[2]=v=>o.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:u,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:d.withCtx(()=>[d.createElementVNode("div",HO,[d.createVNode(d.unref(t),{ref_key:"form",ref:l,schema:c.value,values:s.value,"onUpdate:values":p[1]||(p[1]=v=>s.value=v)},null,8,["schema","values"])])]),_:1},8,["visible"])])}}},Ex={__name:"delete",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(WP),d.mergeProps(e.$attrs,{size:24}),null,16))}},Xp={__name:"close",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(gx),d.mergeProps(e.$attrs,{size:24}),null,16))}},Cx={__name:"edit",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(hx),d.mergeProps(e.$attrs,{size:24}),null,16))}},qO={class:"pt-[10px]"},ZO={__name:"vs-editor-form-style",props:{widgetName:{type:String},data:{type:Object,default:()=>{}}},setup(r){var p,g,v,m,y,b;const e=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),{$notify:t}=d.getCurrentInstance().proxy,n=r,a=d.ref(null),i={show:{label:"Label",type:"switcher",title:"Show label"},rotate:{type:"number",label:"Rotate angel",conditions:["show","==",!0]},align:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"center",text:"Center"},{id:"left",text:"Left"},{id:"right",text:"Right"}]},position:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"top",text:"Top"},{id:"right",text:"Right"},{id:"left",text:"Left"},{id:"bottom",text:"Bottom"}]}},o={show:{label:"Legend",type:"switcher",title:"Show legend"}},s={show:{label:"Tooltip ",type:"switcher",title:"Show tooltip"}},l=d.ref({...((g=(p=n.data)==null?void 0:p.style)==null?void 0:g.label)||{}}),u=d.ref({...((m=(v=n.data)==null?void 0:v.style)==null?void 0:m.legend)||{}}),c=d.ref({...((b=(y=n.data)==null?void 0:y.style)==null?void 0:b.tooltip)||{}}),f=()=>{const _=new CustomEvent(`update-style-${n.widgetName}`);_.chartId=n.widgetName,_.options={options:{legend:u.value,tooltip:c.value,label:l.value},seriesOptions:l.value},window.dispatchEvent(_)};d.watch(l,f,{deep:!0}),d.watch(u,f,{deep:!0}),d.watch(c,f,{deep:!0});const h=async()=>{try{await tr.put(`/bi-dashboard/${a.value}/${n.widgetName}`,{style:{legend:u.value,tooltip:c.value,label:l.value}});const _=new CustomEvent(`update-style-${n.widgetName}`);_.chartId=n.widgetName,_.options={options:{legend:u.value,tooltip:c.value,label:l.value},seriesOptions:l.value},window.dispatchEvent(_),await t({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return d.onMounted(()=>{const _=new URLSearchParams(window.top.location.search);a.value=_.get("dashboard")}),(_,x)=>{const w=d.resolveComponent("VsButton");return d.openBlock(),d.createElementBlock("div",qO,[d.createVNode(w,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:h},{default:d.withCtx(()=>x[3]||(x[3]=[d.createTextVNode(" Зберегти ")])),_:1}),d.createVNode(d.unref(e),{schema:i,values:l.value,"onUpdate:values":x[0]||(x[0]=S=>l.value=S),class:"p-0"},null,8,["values"]),d.createVNode(d.unref(e),{schema:o,values:u.value,"onUpdate:values":x[1]||(x[1]=S=>u.value=S),class:"p-0"},null,8,["values"]),d.createVNode(d.unref(e),{schema:s,values:c.value,"onUpdate:values":x[2]||(x[2]=S=>c.value=S),class:"p-0"},null,8,["values"])])}}};function jp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Li=jp();function Tx(r){Li=r}const Dx=/[&<>"']/,XO=new RegExp(Dx.source,"g"),Ax=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,jO=new RegExp(Ax.source,"g"),KO={"&":"&","<":"<",">":">",'"':""","'":"'"},Mx=r=>KO[r];function Ur(r,e){if(e){if(Dx.test(r))return r.replace(XO,Mx)}else if(Ax.test(r))return r.replace(jO,Mx);return r}const QO=/(^|[^\[])\^/g;function bt(r,e){let t=typeof r=="string"?r:r.source;e=e||"";const n={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(QO,"$1"),t=t.replace(a,o),n},getRegex:()=>new RegExp(t,e)};return n}function Nx(r){try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Dl={exec:()=>null};function Lx(r,e){const t=r.replace(/\|/g,(i,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/);let a=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(/\\\|/g,"|");return n}function Al(r,e,t){const n=r.length;if(n===0)return"";let a=0;for(;a<n&&r.charAt(n-a-1)===e;)a++;return r.slice(0,n-a)}function JO(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])t++;else if(r[n]===e[1]&&(t--,t<0))return n;return-1}function Ix(r,e,t,n){const a=e.href,i=e.title?Ur(e.title):null,o=r[1].replace(/\\([\[\]])/g,"$1");if(r[0].charAt(0)!=="!"){n.state.inLink=!0;const s={type:"link",raw:t,href:a,title:i,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,s}return{type:"image",raw:t,href:a,title:i,text:Ur(o)}}function e5(r,e){const t=r.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
|
|
112
112
|
`).map(a=>{const i=a.match(/^\s+/);if(i===null)return a;const[o]=i;return o.length>=n.length?a.slice(n.length):a}).join(`
|
|
113
113
|
`)}class Jc{constructor(e){Et(this,"options");Et(this,"rules");Et(this,"lexer");this.options=e||Li}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Al(n,`
|
|
114
114
|
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],a=e5(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const a=Al(n,"#");(this.options.pedantic||!a||/ $/.test(a))&&(n=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Al(t[0],`
|
|
@@ -246,7 +246,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),G=N,F=V),R===void 0&&(
|
|
|
246
246
|
`,1;if(Wt>1e5&&Wt>Ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fe+=Ge,Ge.length}const we=E(N);if(!we)throw Qo(i.replace("{}",N)),new Error('Unknown language: "'+N+'"');const $=lre(we);let ne="",Z=F||$;const Ie={},Qe=new s.__emitter(s);j();let Fe="",$t=0,Ht=0,Wt=0,Gr=!1;try{if(we.__emitTokens)we.__emitTokens(V,Qe);else{for(Z.matcher.considerAll();;){Wt++,Gr?Gr=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Ht;const ge=Z.matcher.exec(V);if(!ge)break;const Ce=V.substring(Ht,ge.index),Ge=le(Ce,ge);Ht=ge.index+Ge}le(V.substring(Ht))}return Qe.finalize(),ne=Qe.toHTML(),{language:N,value:ne,relevance:$t,illegal:!1,_emitter:Qe,_top:Z}}catch(ge){if(ge.message&&ge.message.includes("Illegal"))return{language:N,value:W_(V),illegal:!0,relevance:0,_illegalBy:{message:ge.message,index:Ht,context:V.slice(Ht-100,Ht+100),mode:ge.mode,resultSoFar:ne},_emitter:Qe};if(a)return{language:N,value:W_(V),illegal:!1,relevance:0,errorRaised:ge,_emitter:Qe,_top:Z};throw ge}}function h(N){const V={value:W_(N),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return V._emitter.addText(N),V}function p(N,V){V=V||s.languages||Object.keys(e);const R=h(N),F=V.filter(E).filter(T).map(q=>f(q,N,!1));F.unshift(R);const G=F.sort((q,ae)=>{if(q.relevance!==ae.relevance)return ae.relevance-q.relevance;if(q.language&&ae.language){if(E(q.language).supersetOf===ae.language)return 1;if(E(ae.language).supersetOf===q.language)return-1}return 0}),[z,K]=G,U=z;return U.secondBest=K,U}function g(N,V,R){const F=V&&t[V]||R;N.classList.add("hljs"),N.classList.add(`language-${F}`)}function v(N){let V=null;const R=u(N);if(l(R))return;if(L("before:highlightElement",{el:N,language:R}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),s.throwUnescapedHTML))throw new dre("One of your code blocks includes unescaped HTML.",N.innerHTML);V=N;const F=V.textContent,G=R?c(F,{language:R,ignoreIllegals:!0}):p(F);N.innerHTML=G.value,N.dataset.highlighted="yes",g(N,R,G.language),N.result={language:G.language,re:G.relevance,relevance:G.relevance},G.secondBest&&(N.secondBest={language:G.secondBest.language,relevance:G.secondBest.relevance}),L("after:highlightElement",{el:N,result:G,text:F})}function m(N){s=uV(s,N)}const y=()=>{x(),bl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){x(),bl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _=!1;function x(){function N(){x()}if(document.readyState==="loading"){_||window.addEventListener("DOMContentLoaded",N,!1),_=!0;return}document.querySelectorAll(s.cssSelector).forEach(v)}function w(N,V){let R=null;try{R=V(r)}catch(F){if(Qo("Language definition for '{}' could not be registered.".replace("{}",N)),a)Qo(F);else throw F;R=o}R.name||(R.name=N),e[N]=R,R.rawDefinition=V.bind(null,r),R.aliases&&C(R.aliases,{languageName:N})}function S(N){delete e[N];for(const V of Object.keys(t))t[V]===N&&delete t[V]}function k(){return Object.keys(e)}function E(N){return N=(N||"").toLowerCase(),e[N]||e[t[N]]}function C(N,{languageName:V}){typeof N=="string"&&(N=[N]),N.forEach(R=>{t[R.toLowerCase()]=V})}function T(N){const V=E(N);return V&&!V.disableAutodetect}function D(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=V=>{N["before:highlightBlock"](Object.assign({block:V.el},V))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=V=>{N["after:highlightBlock"](Object.assign({block:V.el},V))})}function A(N){D(N),n.push(N)}function I(N){const V=n.indexOf(N);V!==-1&&n.splice(V,1)}function L(N,V){const R=N;n.forEach(function(F){F[R]&&F[R](V)})}function B(N){return bl("10.7.0","highlightBlock will be removed entirely in v12.0"),bl("10.7.0","Please use highlightElement now."),v(N)}Object.assign(r,{highlight:c,highlightAuto:p,highlightAll:x,highlightElement:v,highlightBlock:B,configure:m,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:w,unregisterLanguage:S,listLanguages:k,getLanguage:E,registerAliases:C,autoDetection:T,inherit:uV,addPlugin:A,removePlugin:I}),r.debugMode=function(){a=!1},r.safeMode=function(){a=!0},r.versionString=cre,r.regex={concat:Ko,lookahead:QB,either:G_,optional:Tte,anyNumberOfTimes:Cte};for(const N in wp)typeof wp[N]=="object"&&qB(wp[N]);return Object.assign(r,wp),r},_l=dV({});_l.newInstance=()=>dV({});var fV=_l;_l.HighlightJS=_l,_l.default=_l;const Y_=xte(fV);var q_,hV;function hre(){if(hV)return q_;hV=1;function r(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,u,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return q_=r,q_}var Z_,pV;function pre(){if(pV)return Z_;pV=1;function r(e){const t=e.regex,n={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},c={className:"string",begin:/'/,end:/'/},f={match:/\\'/},h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],b={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:y,built_in:[..._,...x,"set","shopt",...w,...S]},contains:[g,e.SHEBANG(),v,h,o,s,b,l,u,c,f,n]}}return Z_=r,Z_}var X_,gV;function gre(){if(gV)return X_;gV=1;function r(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+a+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},g=t.optional(i)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[h,l,n,e.C_BLOCK_COMMENT_MODE,f,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:b.concat([{begin:/\(/,end:/\)/,keywords:y,contains:b.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:y,relevance:0},{begin:g,returnBegin:!0,contains:[e.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,f,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,f,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(_,x,b,[h,{begin:e.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:h,strings:c,keywords:y}}}return X_=r,X_}var j_,vV;function vre(){if(vV)return j_;vV=1;function r(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+a+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},g=t.optional(i)+e.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:m,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,h,l,n,e.C_BLOCK_COMMENT_MODE,f,c],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:k.concat([{begin:/\(/,end:/\)/,keywords:w,contains:k.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:w,relevance:0},{begin:g,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,f,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,f,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(E,C,S,k,[h,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return j_=r,j_}var K_,mV;function mre(){if(mV)return K_;mV=1;function r(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:a},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},h=e.inherit(f,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:s},g=e.inherit(p,{illegal:/\n/}),v={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,g]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},y=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});p.contains=[m,v,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.C_BLOCK_COMMENT_MODE],g.contains=[y,v,h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const b={variants:[c,m,v,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,_,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,_,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[b,u,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}return K_=r,K_}var Q_,yV;function yre(){if(yV)return Q_;yV=1;const r=u=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:u.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:u.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function l(u){const c=u.regex,f=r(u),h={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},p="and or not only",g=/@-?\w[\w]*(-\w+)*/,v="[a-zA-Z-][a-zA-Z0-9_-]*",m=[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[f.BLOCK_COMMENT,h,f.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+v,relevance:0},f.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+i.join("|")+")"},{begin:":(:)?("+o.join("|")+")"}]},f.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[f.BLOCK_COMMENT,f.HEXCOLOR,f.IMPORTANT,f.CSS_NUMBER_MODE,...m,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...m,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},f.FUNCTION_DISPATCH]},{begin:c.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:g},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:p,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...m,f.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b"}]}}return Q_=l,Q_}var J_,bV;function bre(){if(bV)return J_;bV=1;function r(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=e.inherit(c,{contains:[]}),p=e.inherit(f,{contains:[]});c.contains.push(p),f.contains.push(h);let g=[n,u];return[c,f,h,p].forEach(b=>{b.contains=b.contains.concat(g)}),g=g.concat(c,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},n,o,c,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},i,a,u,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return J_=r,J_}var e1,_V;function _re(){if(_V)return e1;_V=1;function r(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return e1=r,e1}var t1,xV;function xre(){if(xV)return t1;xV=1;function r(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(a,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},p="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",v={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},k=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},v,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,c),relevance:0}].concat(u,c);f.contains=k,m.contains=k;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:k}}];return c.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(D).concat(c).concat(k)}}return t1=r,t1}var r1,wV;function wre(){if(wV)return r1;wV=1;function r(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}return r1=r,r1}var n1,SV;function Sre(){if(SV)return n1;SV=1;function r(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return n1=r,n1}var a1,kV;function kre(){if(kV)return a1;kV=1;function r(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[a,o,i,s,n,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,f=/'[^']*'/,h=t.either(u,c,f),p=t.concat(h,"(\\s*\\.\\s*",h,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[a,l,o,i,s,n]}}]}}return a1=r,a1}var i1,EV;function Ere(){if(EV)return i1;EV=1;var r="[0-9](_*[0-9])*",e=`\\.(${r})`,t="[0-9a-fA-F](_*[0-9a-fA-F])*",n={className:"number",variants:[{begin:`(\\b(${r})((${e})|\\.)?|(${e}))[eE][+-]?(${r})[fFdD]?\\b`},{begin:`\\b(${r})((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${e})[fFdD]?\\b`},{begin:`\\b(${r})[fFdD]\\b`},{begin:`\\b0[xX]((${t})\\.?|(${t})?\\.(${t}))[pP][+-]?(${r})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(o,s,l){return l===-1?"":o.replace(s,u=>a(o,s,l-1))}function i(o){const s=o.regex,l="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",u=l+a("(?:<"+l+"~~~(?:\\s*,\\s*"+l+"~~~)*>)?",/~~~/g,2),g={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},v={className:"meta",begin:"@"+l,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},m={className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[o.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:g,illegal:/<\/|#/,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[o.BACKSLASH_ESCAPE]},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[s.concat(/(?!else)/,l),/\s+/,l,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,l],className:{1:"keyword",3:"title.class"},contains:[m,o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+u+"\\s+)",o.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:g,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[v,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,n,o.C_BLOCK_COMMENT_MODE]},o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE]},n,v]}}return i1=i,i1}var o1,CV;function Cre(){if(CV)return o1;CV=1;const r="[A-Za-z$_][0-9A-Za-z$_]*",e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],t=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],o=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],s=[].concat(i,n,a);function l(u){const c=u.regex,f=(be,{after:fe})=>{const ce="</"+be[0].slice(1);return be.input.indexOf(ce,fe)!==-1},h=r,p={begin:"<>",end:"</>"},g=/<[A-Za-z0-9\\._:-]+\s*\/>/,v={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(be,fe)=>{const ce=be[0].length+be.index,W=be.input[ce];if(W==="<"||W===","){fe.ignoreMatch();return}W===">"&&(f(be,{after:ce})||fe.ignoreMatch());let H;const j=be.input.substring(ce);if(H=j.match(/^\s*=/)){fe.ignoreMatch();return}if((H=j.match(/^\s+extends\s+/))&&H.index===0){fe.ignoreMatch();return}}},m={$pattern:r,keyword:e,literal:t,built_in:s,"variable.language":o},y="[0-9](_?[0-9])*",b=`\\.(${y})`,_="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${_})((${b})|\\.)?|(${b}))[eE][+-]?(${y})\\b`},{begin:`\\b(${_})\\b((${b})\\b|\\.)?|(${b})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:m,contains:[]},S={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[u.BACKSLASH_ESCAPE,w]},D={className:"comment",variants:[u.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:h+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),u.C_BLOCK_COMMENT_MODE,u.C_LINE_COMMENT_MODE]},A=[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,S,k,E,C,{match:/\$\d+/},x];w.contains=A.concat({begin:/\{/,end:/\}/,keywords:m,contains:["self"].concat(A)});const I=[].concat(D,w.contains),L=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:m,contains:["self"].concat(I)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:L},N={variants:[{match:[/class/,/\s+/,h,/\s+/,/extends/,/\s+/,c.concat(h,"(",c.concat(/\./,h),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,h],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:c.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...a]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},F={variants:[{match:[/function/,/\s+/,h,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function z(be){return c.concat("(?!",be.join("|"),")")}const K={match:c.concat(/\b/,z([...i,"super","import"].map(be=>`${be}\\s*\\(`)),h,c.lookahead(/\s*\(/)),className:"title.function",relevance:0},U={begin:c.concat(/\./,c.lookahead(c.concat(h,/(?![0-9A-Za-z$_(])/))),end:h,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,h,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+u.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,h,/\s*/,/=\s*/,/(async\s*)?/,c.lookahead(ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:m,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[u.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,S,k,E,C,D,{match:/\$\d+/},x,V,{scope:"attr",match:h+c.lookahead(":"),relevance:0},me,{begin:"("+u.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,u.REGEXP_MODE,{className:"function",begin:ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:u.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:p.begin,end:p.end},{match:g},{begin:v.begin,"on:begin":v.isTrulyOpeningTag,end:v.end}],subLanguage:"xml",contains:[{begin:v.begin,end:v.end,skip:!0,contains:["self"]}]}]},F,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+u.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,u.inherit(u.TITLE_MODE,{begin:h,className:"title.function"})]},{match:/\.\.\./,relevance:0},U,{match:"\\$"+h,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},K,G,N,q,{match:/\$[(.]/}]}}return o1=l,o1}var s1,TV;function Tre(){if(TV)return s1;TV=1;function r(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],i={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return s1=r,s1}var l1,DV;function Dre(){if(DV)return l1;DV=1;var r="[0-9](_*[0-9])*",e=`\\.(${r})`,t="[0-9a-fA-F](_*[0-9a-fA-F])*",n={className:"number",variants:[{begin:`(\\b(${r})((${e})|\\.)?|(${e}))[eE][+-]?(${r})[fFdD]?\\b`},{begin:`\\b(${r})((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${e})[fFdD]?\\b`},{begin:`\\b(${r})[fFdD]\\b`},{begin:`\\b0[xX]((${t})\\.?|(${t})?\\.(${t}))[pP][+-]?(${r})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(i){const o={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},s={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},l={className:"symbol",begin:i.UNDERSCORE_IDENT_RE+"@"},u={className:"subst",begin:/\$\{/,end:/\}/,contains:[i.C_NUMBER_MODE]},c={className:"variable",begin:"\\$"+i.UNDERSCORE_IDENT_RE},f={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[c,u]},{begin:"'",end:"'",illegal:/\n/,contains:[i.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[i.BACKSLASH_ESCAPE,c,u]}]};u.contains.push(f);const h={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+i.UNDERSCORE_IDENT_RE+")?"},p={className:"meta",begin:"@"+i.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[i.inherit(f,{className:"string"}),"self"]}]},g=n,v=i.COMMENT("/\\*","\\*/",{contains:[i.C_BLOCK_COMMENT_MODE]}),m={variants:[{className:"type",begin:i.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=m;return y.variants[1].contains=[m],m.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:o,contains:[i.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),i.C_LINE_COMMENT_MODE,v,s,l,h,p,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:o,relevance:5,contains:[{begin:i.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[i.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[m,i.C_LINE_COMMENT_MODE,v],relevance:0},i.C_LINE_COMMENT_MODE,v,h,p,f,i.C_NUMBER_MODE]},v]},{begin:[/class|interface|trait/,/\s+/,i.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},i.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},h,p]},f,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
247
247
|
`},g]}}return l1=a,l1}var u1,AV;function Are(){if(AV)return u1;AV=1;const r=c=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:c.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:c.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),l=i.concat(o).sort().reverse();function u(c){const f=r(c),h=l,p="and or not only",g="[\\w-]+",v="("+g+"|@\\{"+g+"\\})",m=[],y=[],b=function(I){return{className:"string",begin:"~?"+I+".*?"+I}},_=function(I,L,B){return{className:I,begin:L,relevance:B}},x={$pattern:/[a-z-]+/,keyword:p,attribute:a.join(" ")},w={begin:"\\(",end:"\\)",contains:y,keywords:x,relevance:0};y.push(c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,b("'"),b('"'),f.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},f.HEXCOLOR,w,_("variable","@@?"+g,10),_("variable","@\\{"+g+"\\}"),_("built_in","~?`[^`]*?`"),{className:"attribute",begin:g+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},f.IMPORTANT,{beginKeywords:"and not"},f.FUNCTION_DISPATCH);const S=y.concat({begin:/\{/,end:/\}/,contains:m}),k={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(y)},E={begin:v+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},f.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:y}}]},C={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:x,returnEnd:!0,contains:y,relevance:0}},T={className:"variable",variants:[{begin:"@"+g+"\\s*:",relevance:15},{begin:"@"+g}],starts:{end:"[;}]",returnEnd:!0,contains:S}},D={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:v,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,k,_("keyword","all\\b"),_("variable","@\\{"+g+"\\}"),{begin:"\\b("+n.join("|")+")\\b",className:"selector-tag"},f.CSS_NUMBER_MODE,_("selector-tag",v,0),_("selector-id","#"+v),_("selector-class","\\."+v,0),_("selector-tag","&",0),f.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+o.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:S},{begin:"!important"},f.FUNCTION_DISPATCH]},A={begin:g+`:(:)?(${h.join("|")})`,returnBegin:!0,contains:[D]};return m.push(c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,C,T,A,E,D,k,f.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:m}}return u1=u,u1}var c1,MV;function Mre(){if(MV)return c1;MV=1;function r(e){const t="\\[=*\\[",n="\\]=*\\]",a={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[a],relevance:5}])}}return c1=r,c1}var d1,NV;function Nre(){if(NV)return d1;NV=1;function r(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,a,i,o,s]}}return d1=r,d1}var f1,LV;function Lre(){if(LV)return f1;LV=1;function r(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],a=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},f=[e.BACKSLASH_ESCAPE,o,u],h=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(m,y,b="\\1")=>{const _=b==="\\1"?b:t.concat(b,y);return t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,b,a)},g=(m,y,b)=>t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,b,a),v=[u,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:f,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",t.either(...h,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:g("(?:m|qr)?",/\//,/\//)},{begin:g("m|qr",t.either(...h,{capture:!0}),/\1/)},{begin:g("m|qr",/\(/,/\)/)},{begin:g("m|qr",/\[/,/\]/)},{begin:g("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=v,s.contains=v,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:v}}return f1=r,f1}var h1,IV;function Ire(){if(IV)return h1;IV=1;function r(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}return h1=r,h1}var p1,BV;function Bre(){if(BV)return p1;BV=1;function r(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+a},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),f=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(u)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(B,N)=>{N.data._beginMatch=B[1]||B[2]},"on:end":(B,N)=>{N.data._beginMatch!==B[1]&&N.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),g=`[
|
|
248
248
|
]`,v={scope:"string",variants:[f,c,h,p]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:b,literal:(B=>{const N=[];return B.forEach(V=>{N.push(V),V.toLowerCase()===V?N.push(V.toUpperCase()):N.push(V.toLowerCase())}),N})(y),built_in:_},S=B=>B.map(N=>N.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,t.concat(g,"+"),t.concat("(?!",S(_).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(a,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},T={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[T,s,C,e.C_BLOCK_COMMENT_MODE,v,m,k]},A={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(b).join("\\b|"),"|",S(_).join("\\b|"),"\\b)"),a,t.concat(g,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(A);const I=[T,C,e.C_BLOCK_COMMENT_MODE,v,m,k],L={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:w,contains:[L,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},s,A,C,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",L,s,C,e.C_BLOCK_COMMENT_MODE,v,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},v,m]}}return p1=r,p1}var g1,VV;function Vre(){if(VV)return g1;VV=1;function r(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return g1=r,g1}var v1,RV;function Rre(){if(RV)return v1;RV=1;function r(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return v1=r,v1}var m1,PV;function Pre(){if(PV)return m1;PV=1;function r(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,f,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,f,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",g=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,v=`\\b|${a.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${g}))[eE][+-]?(${p})[jJ]?(?=${v})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${v})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${v})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${v})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${v})`},{begin:`\\b(${p})[jJ](?=${v})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,m,h,e.HASH_COMMENT_MODE]}]};return c.contains=[h,m,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,b,h]}]}}return m1=r,m1}var y1,OV;function Ore(){if(OV)return y1;OV=1;function r(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return y1=r,y1}var b1,zV;function zre(){if(zV)return b1;zV=1;function r(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[o,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return b1=r,b1}var _1,FV;function Fre(){if(FV)return _1;FV=1;function r(e){const t=e.regex,n=/(r#)?/,a=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:l,literal:u,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:f}},{className:"punctuation",begin:"->"},o]}}return _1=r,_1}var x1,$V;function $re(){if($V)return x1;$V=1;const r=u=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:u.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:u.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],a=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function l(u){const c=r(u),f=o,h=i,p="@[a-z-]+",g="and or not only",m={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE,c.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},c.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+h.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+f.join("|")+")"},m,{begin:/\(/,end:/\)/,contains:[c.CSS_NUMBER_MODE]},c.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[c.BLOCK_COMMENT,m,c.HEXCOLOR,c.CSS_NUMBER_MODE,u.QUOTE_STRING_MODE,u.APOS_STRING_MODE,c.IMPORTANT,c.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:p,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:g,attribute:a.join(" ")},contains:[{begin:p,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},m,u.QUOTE_STRING_MODE,u.APOS_STRING_MODE,c.HEXCOLOR,c.CSS_NUMBER_MODE]},c.FUNCTION_DISPATCH]}}return x1=l,x1}var w1,GV;function Gre(){if(GV)return w1;GV=1;function r(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return w1=r,w1}var S1,UV;function Ure(){if(UV)return S1;UV=1;function r(e){const t=e.regex,n=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,v=[...c,...u].filter(S=>!f.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:t.concat(/\b/,t.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function _(S){return t.concat(/\b/,t.either(...S.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:_(p),relevance:0};function w(S,{exceptions:k,when:E}={}){const C=E;return k=k||[],S.map(T=>T.match(/\|\d+$/)||k.includes(T)?T:C(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(v,{when:S=>S.length<3}),literal:o,type:l,built_in:h},contains:[{scope:"type",match:_(s)},x,b,m,a,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}return S1=r,S1}var k1,HV;function Hre(){if(HV)return k1;HV=1;function r(E){return E?typeof E=="string"?E:E.source:null}function e(E){return t("(?=",E,")")}function t(...E){return E.map(T=>r(T)).join("")}function n(E){const C=E[E.length-1];return typeof C=="object"&&C.constructor===Object?(E.splice(E.length-1,1),C):{}}function a(...E){return"("+(n(E).capture?"":"?:")+E.map(D=>r(D)).join("|")+")"}const i=E=>t(/\b/,E,/\w$/.test(E)?/\b/:/\B/),o=["Protocol","Type"].map(i),s=["init","self"].map(i),l=["Any","Self"],u=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],c=["false","nil","true"],f=["assignment","associativity","higherThan","left","lowerThan","none","right"],h=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],p=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],g=a(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),v=a(g,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),m=t(g,v,"*"),y=a(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),b=a(y,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_=t(y,b,"*"),x=t(/[A-Z]/,b,"*"),w=["attached","autoclosure",t(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc\(/,_,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],S=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function k(E){const C={match:/\s+/,relevance:0},T=E.COMMENT("/\\*","\\*/",{contains:["self"]}),D=[E.C_LINE_COMMENT_MODE,T],A={match:[/\./,a(...o,...s)],className:{2:"keyword"}},I={match:t(/\./,a(...u)),relevance:0},L=u.filter(de=>typeof de=="string").concat(["_|0"]),B=u.filter(de=>typeof de!="string").concat(l).map(i),N={variants:[{className:"keyword",match:a(...B,...s)}]},V={$pattern:a(/\b\w+/,/#\w+/),keyword:L.concat(h),literal:c},R=[A,I,N],F={match:t(/\./,a(...p)),relevance:0},G={className:"built_in",match:t(/\b/,a(...p),/(?=\()/)},z=[F,G],K={match:/->/,relevance:0},U={className:"operator",relevance:0,variants:[{match:m},{match:`\\.(\\.|${v})+`}]},q=[K,U],ae="([0-9]_*)+",me="([0-9a-fA-F]_*)+",be={className:"number",relevance:0,variants:[{match:`\\b(${ae})(\\.(${ae}))?([eE][+-]?(${ae}))?\\b`},{match:`\\b0x(${me})(\\.(${me}))?([pP][+-]?(${ae}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},fe=(de="")=>({className:"subst",variants:[{match:t(/\\/,de,/[0\\tnr"']/)},{match:t(/\\/,de,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ce=(de="")=>({className:"subst",match:t(/\\/,de,/[\t ]*(?:[\r\n]|\r\n)/)}),W=(de="")=>({className:"subst",label:"interpol",begin:t(/\\/,de,/\(/),end:/\)/}),H=(de="")=>({begin:t(de,/"""/),end:t(/"""/,de),contains:[fe(de),ce(de),W(de)]}),j=(de="")=>({begin:t(de,/"/),end:t(/"/,de),contains:[fe(de),W(de)]}),oe={className:"string",variants:[H(),H("#"),H("##"),H("###"),j(),j("#"),j("##"),j("###")]},le=[E.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[E.BACKSLASH_ESCAPE]}],we={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:le},$=de=>{const Me=t(de,/\//),P=t(/\//,de);return{begin:Me,end:P,contains:[...le,{scope:"comment",begin:`#(?!.*${P})`,end:/$/}]}},ne={scope:"regexp",variants:[$("###"),$("##"),$("#"),we]},Z={match:t(/`/,_,/`/)},Ie={className:"variable",match:/\$\d+/},Qe={className:"variable",match:`\\$${b}+`},Fe=[Z,Ie,Qe],$t={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:S,contains:[...q,be,oe]}]}},Ht={scope:"keyword",match:t(/@/,a(...w),e(a(/\(/,/\s+/)))},Wt={scope:"meta",match:t(/@/,_)},Gr=[$t,Ht,Wt],ge={match:e(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:t(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,b,"+")},{className:"type",match:x,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:t(/\s+&\s+/,e(x)),relevance:0}]},Ce={begin:/</,end:/>/,keywords:V,contains:[...D,...R,...Gr,K,ge]};ge.contains.push(Ce);const Ge={match:t(_,/\s*:/),keywords:"_|0",relevance:0},at={begin:/\(/,end:/\)/,relevance:0,keywords:V,contains:["self",Ge,...D,ne,...R,...z,...q,be,oe,...Fe,...Gr,ge]},Tt={begin:/</,end:/>/,keywords:"repeat each",contains:[...D,ge]},fr={begin:a(e(t(_,/\s*:/)),e(t(_,/\s+/,_,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_}]},Fn={begin:/\(/,end:/\)/,keywords:V,contains:[fr,...D,...R,...q,be,oe,...Gr,ge,at],endsParent:!0,illegal:/["']/},rs={match:[/(func|macro)/,/\s+/,a(Z.match,_,m)],className:{1:"keyword",3:"title.function"},contains:[Tt,Fn,C],illegal:[/\[/,/%/]},Yc={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Tt,Fn,C],illegal:/\[|%/},qc={match:[/operator/,/\s+/,m],className:{1:"keyword",3:"title"}},Zc={begin:[/precedencegroup/,/\s+/,x],className:{1:"keyword",3:"title"},contains:[ge],keywords:[...f,...c],end:/}/},Ga={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ie={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:V,contains:[Tt,...R,{begin:/:/,end:/\{/,keywords:V,contains:[{scope:"title.class.inherited",match:x},...R],relevance:0}]};for(const de of oe.variants){const Me=de.contains.find(O=>O.label==="interpol");Me.keywords=V;const P=[...R,...z,...q,be,oe,...Fe];Me.contains=[...P,{begin:/\(/,end:/\)/,contains:["self",...P]}]}return{name:"Swift",keywords:V,contains:[...D,rs,Yc,Ga,ee,ie,qc,Zc,{beginKeywords:"import",end:/$/,contains:[...D],relevance:0},ne,...R,...z,...q,be,oe,...Fe,...Gr,ge,at]}}return k1=k,k1}var E1,WV;function Wre(){if(WV)return E1;WV=1;function r(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},v={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},y=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},v,m,o,s],b=[...y];return b.pop(),b.push(l),g.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}return E1=r,E1}var C1,YV;function Yre(){if(YV)return C1;YV=1;const r="[A-Za-z$_][0-9A-Za-z$_]*",e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],t=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],o=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],s=[].concat(i,n,a);function l(c){const f=c.regex,h=(fe,{after:ce})=>{const W="</"+fe[0].slice(1);return fe.input.indexOf(W,ce)!==-1},p=r,g={begin:"<>",end:"</>"},v=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(fe,ce)=>{const W=fe[0].length+fe.index,H=fe.input[W];if(H==="<"||H===","){ce.ignoreMatch();return}H===">"&&(h(fe,{after:W})||ce.ignoreMatch());let j;const oe=fe.input.substring(W);if(j=oe.match(/^\s*=/)){ce.ignoreMatch();return}if((j=oe.match(/^\s+extends\s+/))&&j.index===0){ce.ignoreMatch();return}}},y={$pattern:r,keyword:e,literal:t,built_in:s,"variable.language":o},b="[0-9](_?[0-9])*",_=`\\.(${b})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${x})((${_})|\\.)?|(${_}))[eE][+-]?(${b})\\b`},{begin:`\\b(${x})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},S={className:"subst",begin:"\\$\\{",end:"\\}",keywords:y,contains:[]},k={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,S],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,S],subLanguage:"css"}},C={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[c.BACKSLASH_ESCAPE,S],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[c.BACKSLASH_ESCAPE,S]},A={className:"comment",variants:[c.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:p+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),c.C_BLOCK_COMMENT_MODE,c.C_LINE_COMMENT_MODE]},I=[c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,k,E,C,T,{match:/\$\d+/},w];S.contains=I.concat({begin:/\{/,end:/\}/,keywords:y,contains:["self"].concat(I)});const L=[].concat(A,S.contains),B=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:y,contains:["self"].concat(L)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:B},V={variants:[{match:[/class/,/\s+/,p,/\s+/,/extends/,/\s+/,f.concat(p,"(",f.concat(/\./,p),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,p],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:f.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...a]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,p,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function K(fe){return f.concat("(?!",fe.join("|"),")")}const U={match:f.concat(/\b/,K([...i,"super","import"].map(fe=>`${fe}\\s*\\(`)),p,f.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:f.concat(/\./,f.lookahead(f.concat(p,/(?![0-9A-Za-z$_(])/))),end:p,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,p,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+c.UNDERSCORE_IDENT_RE+")\\s*=>",be={match:[/const|var|let/,/\s+/,p,/\s*/,/=\s*/,/(async\s*)?/,f.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:y,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[c.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,k,E,C,T,A,{match:/\$\d+/},w,R,{scope:"attr",match:p+f.lookahead(":"),relevance:0},be,{begin:"("+c.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,c.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:c.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:g.begin,end:g.end},{match:v},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+c.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,c.inherit(c.TITLE_MODE,{begin:p,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+p,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},U,z,V,ae,{match:/\$[(.]/}]}}function u(c){const f=c.regex,h=l(c),p=r,g=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],v={begin:[/namespace/,/\s+/,c.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:g},contains:[h.exports.CLASS_REFERENCE]},y={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},b=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],_={$pattern:r,keyword:e.concat(b),literal:t,built_in:s.concat(g),"variable.language":o},x={className:"meta",begin:"@"+p},w=(C,T,D)=>{const A=C.contains.findIndex(I=>I.label===T);if(A===-1)throw new Error("can not find mode to replace");C.contains.splice(A,1,D)};Object.assign(h.keywords,_),h.exports.PARAMS_CONTAINS.push(x);const S=h.contains.find(C=>C.scope==="attr"),k=Object.assign({},S,{match:f.concat(p,f.lookahead(/\s*\?:/))});h.exports.PARAMS_CONTAINS.push([h.exports.CLASS_REFERENCE,S,k]),h.contains=h.contains.concat([x,v,m,k]),w(h,"shebang",c.SHEBANG()),w(h,"use_strict",y);const E=h.contains.find(C=>C.label==="func.def");return E.relevance=0,Object.assign(h,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),h}return C1=u,C1}var T1,qV;function qre(){if(qV)return T1;qV=1;function r(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,l),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,a,u,c,f,h,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}return T1=r,T1}var D1,ZV;function Zre(){if(ZV)return D1;ZV=1;function r(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,u,c,l]}}return D1=r,D1}var rt=fV;rt.registerLanguage("xml",hre()),rt.registerLanguage("bash",pre()),rt.registerLanguage("c",gre()),rt.registerLanguage("cpp",vre()),rt.registerLanguage("csharp",mre()),rt.registerLanguage("css",yre()),rt.registerLanguage("markdown",bre()),rt.registerLanguage("diff",_re()),rt.registerLanguage("ruby",xre()),rt.registerLanguage("go",wre()),rt.registerLanguage("graphql",Sre()),rt.registerLanguage("ini",kre()),rt.registerLanguage("java",Ere()),rt.registerLanguage("javascript",Cre()),rt.registerLanguage("json",Tre()),rt.registerLanguage("kotlin",Dre()),rt.registerLanguage("less",Are()),rt.registerLanguage("lua",Mre()),rt.registerLanguage("makefile",Nre()),rt.registerLanguage("perl",Lre()),rt.registerLanguage("objectivec",Ire()),rt.registerLanguage("php",Bre()),rt.registerLanguage("php-template",Vre()),rt.registerLanguage("plaintext",Rre()),rt.registerLanguage("python",Pre()),rt.registerLanguage("python-repl",Ore()),rt.registerLanguage("r",zre()),rt.registerLanguage("rust",Fre()),rt.registerLanguage("scss",$re()),rt.registerLanguage("shell",Gre()),rt.registerLanguage("sql",Ure()),rt.registerLanguage("swift",Hre()),rt.registerLanguage("yaml",Wre()),rt.registerLanguage("typescript",Yre()),rt.registerLanguage("vbnet",qre()),rt.registerLanguage("wasm",Zre()),rt.HighlightJS=rt,rt.default=rt;var Xre=d.defineComponent({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(r){var e=d.ref(r.language);d.watch(function(){return r.language},function(a){e.value=a});var t=d.computed(function(){return r.autodetect||!e.value}),n=d.computed(function(){return!t.value&&!Y_.getLanguage(e.value)});return{className:d.computed(function(){return n.value?"":"hljs "+e.value}),highlightedCode:d.computed(function(){var a;if(n.value)return console.warn('The language "'+e.value+'" you specified could not be found.'),r.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");if(t.value){var i=Y_.highlightAuto(r.code);return e.value=(a=i.language)!==null&&a!==void 0?a:"",i.value}return(i=Y_.highlight(r.code,{language:e.value,ignoreIllegals:r.ignoreIllegals})).value})}},render:function(){return d.h("pre",{},[d.h("code",{class:this.className,innerHTML:this.highlightedCode})])}}),jre={component:Xre};const Kre={class:"h-full flex flex-col bg-white shrink-0 !w-[400px] border-l"},Qre={key:0},Jre={class:"border-b flex items-center px-[10px] h-[49px] border-transparent border-solid border-b-gray-200"},ene={class:"flex gap-1 rounded-lg border border-gray-200 bg-gray-50 p-0.5"},tne=["onClick"],rne={class:"flex gap-2 ml-auto"},nne={key:1,class:"flex-1 min-h-0 overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-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"},ane={key:0},ine={key:1},one={class:"p-4"},sne={class:"flex justify-end mt-4 gap-x-3"},lne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},une={__name:"vs-editor-forms",props:d.mergeModels({selectedWidgetData:{type:Object,required:!1,default:null},selectedDashboard:{type:String,default:()=>""},currentWidgetData:{type:String,default:()=>""}},{selectedWidget:{},selectedWidgetModifiers:{}}),emits:d.mergeModels(["update-data"],["update:selectedWidget"]),setup(r,{emit:e}){var S,k;const t=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),n=(k=(S=d.getCurrentInstance())==null?void 0:S.proxy)==null?void 0:k.$notify,a=e;d.getCurrentInstance().appContext.app.component("highlightjs",jre.component);const o=r,s=d.ref(!1),l=d.ref(!0),u=d.ref(!1),c=d.ref(!1),f=d.ref(""),h=d.ref({}),p=d.useModel(r,"selectedWidget"),g=["table","text","number","stat","progress","listbar","map","pivot"],v=d.ref("data"),m=async()=>{try{await tr.delete(`/bi-dashboard/${o.selectedDashboard}/${o.selectedWidgetData.name}`);const E=new URL(window.top.location.href);E.searchParams.set("dashboard",o.selectedDashboard),E.searchParams.delete("widget"),window.top.history.pushState({},"",E),a("update-data"),s.value=!1,n({type:"success",title:"Успішно!",message:"Віджет успішно видалено"})}catch(E){console.error(E),n({type:"error",title:"Помилка!",message:"При спробі видалити віджет виникла помилка"})}},y=()=>{var E;f.value="",(E=o.currentWidgetData)==null||E.columns.forEach(C=>{f.value+=`${C.name} ${C.type.split(" ")[0]}; -- ${C.title||""}
|
|
249
|
-
`})},b=d.computed(()=>{const E=[{id:"data",label:"Дані"},{id:"style",label:"Стилі"},{id:"yaml",label:"{ }"}];return E==null?void 0:E.filter(C=>{var T,D,A;return C.id==="style"?!(g!=null&&g.includes(((T=o.selectedWidgetData)==null?void 0:T.type)||((A=(D=o.selectedWidgetData)==null?void 0:D.data)==null?void 0:A.type))):!0})}),_=()=>{var E,C,T,D,A,I,L,B,N;h.value={title:(E=o.selectedWidgetData)==null?void 0:E.title,type:(C=o.selectedWidgetData)==null?void 0:C.type,table:(T=o.selectedWidgetData)==null?void 0:T.table_name,query:(A=(D=o.selectedWidgetData)==null?void 0:D.data)==null?void 0:A.query,x:(L=(I=o.selectedWidgetData)==null?void 0:I.data)==null?void 0:L.x,cls:(N=(B=o.selectedWidgetData)==null?void 0:B.data)==null?void 0:N.cls},c.value=!0},x=async()=>{try{await tr.put(`/bi-dashboard/${o.selectedDashboard}/${o.selectedWidgetData.name}`,h.value),n({type:"success",title:"Успішно!",message:"Дані успішно змінено"}),await a("update-data"),c.value=!1}catch{n({type:"error",title:"Помилка!",message:"При спробі внести зміни виникла помилка"})}};d.watch(p,E=>{l.value=!1;const C=new URL(window.top.location.href);E?(C.searchParams.set("widget",E),window.top.history.pushState({},"",C)):(C.searchParams.delete("widget"),window.top.history.pushState({},"",C)),setTimeout(()=>l.value=!0)}),d.watch(()=>o.currentWidgetData,()=>{y()},{deep:!0}),d.onMounted(y);const w={title:{type:"text",ua:"Заголовок",placeholder:"Заголовок",validators:["required"]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'<div style="width: 120px; height:160px" class="flex gap-[12px] flex-col"><img class="block" style="height: calc(100% - 40px)" :src="`https://cdn.softpro.ua/data/icons/bi/${id}.png`"/><span class="font-[500]">{{ label }}</span></div>'},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"text",ua:"Таблиця",placeholder:"Таблиця"},query:{type:"Text",ua:"Query",placeholder:"Query"},x:{type:"Text",ua:"X Axis",placeholder:"X Axis"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}};return(E,C)=>{var A,I,L,B,N,V,R,F,G,z,K;const T=d.resolveComponent("VsPopover"),D=d.resolveComponent("highlightjs");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Kre,[r.selectedWidgetData?(d.openBlock(),d.createElementBlock("div",Qre,[d.createElementVNode("div",Jre,[d.createElementVNode("div",ene,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(b.value,U=>(d.openBlock(),d.createElementBlock("button",{key:U.id,type:"button",class:d.normalizeClass(["rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v.value===U.id?"bg-white text-blue-600 shadow-sm border border-gray-200":"text-gray-600 hover:text-gray-900"]),onClick:q=>v.value=U.id},d.toDisplayString(U.label),11,tne))),128))]),d.createElementVNode("div",rne,[d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:C[0]||(C[0]=U=>u.value=!0)},[d.createVNode(F_,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[C[10]||(C[10]=d.createTextVNode(" Переглянути колонки таблиці "))]),_:1}),d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{onClick:_,class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},[d.createVNode(Cx,{class:"h-[16px]"})])]),default:d.withCtx(()=>[C[11]||(C[11]=d.createTextVNode(" Редагувати віджет "))]),_:1}),d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:C[1]||(C[1]=U=>s.value=!0)},[d.createVNode(d.unref(Ex),{class:"h-[16px]"})])]),default:d.withCtx(()=>[C[12]||(C[12]=d.createTextVNode(" Видалити віджет "))]),_:1})])]),(A=r.currentWidgetData)!=null&&A.status?(d.openBlock(),d.createBlock(Qc,{key:0,title:(I=r.currentWidgetData)==null?void 0:I.title,text:(L=r.currentWidgetData)==null?void 0:L.message},null,8,["title","text"])):(d.openBlock(),d.createElementBlock("div",nne,[l.value&&r.currentWidgetData?(d.openBlock(),d.createElementBlock("div",ane,[d.createVNode(YB,{"tab-component":d.unref(WB)["vs-editor-form-"+v.value],widgetName:(B=r.selectedWidgetData)==null?void 0:B.name,yamlValue:((N=r.selectedWidgetData)==null?void 0:N.yml)||"",data:r.selectedWidgetData,controls:(V=r.selectedWidgetData)==null?void 0:V.controls,columns:(R=r.currentWidgetData)==null?void 0:R.columns,onUpdateDashboard:C[2]||(C[2]=U=>E.$emit("update-data"))},null,8,["tab-component","widgetName","yamlValue","data","controls","columns"])])):(d.openBlock(),d.createElementBlock("div",ine,[d.createVNode(YB,{"tab-component":d.unref(WB)["vs-editor-form-"+v.value],widgetName:(F=r.selectedWidgetData)==null?void 0:F.name,yamlValue:((G=r.selectedWidgetData)==null?void 0:G.yml)||"",data:r.selectedWidgetData,controls:(z=r.selectedWidgetData)==null?void 0:z.controls,columns:(K=r.currentWidgetData)==null?void 0:K.columns,onUpdateDashboard:C[3]||(C[3]=U=>E.$emit("update-data"))},null,8,["tab-component","widgetName","yamlValue","data","controls","columns"])])),d.createVNode(ns,{teleport:"#modal",visible:s.value,title:"Ви впевнені?",onClose:C[5]||(C[5]=U=>s.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",one,[C[13]||(C[13]=d.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей віджет? ",-1)),d.createElementVNode("div",sne,[d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:C[4]||(C[4]=U=>s.value=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:m}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"])]))])):(d.openBlock(),d.createBlock(Qc,{key:1,title:"Оберіть один з віджетів",text:""}))]),d.createVNode(ns,{teleport:"#modal",visible:c.value,title:"Редагувати віджет",onClose:C[8]||(C[8]=U=>c.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",lne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:C[7]||(C[7]=U=>c.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:x,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[w?(d.openBlock(),d.createBlock(d.unref(t),{key:0,schema:w,values:h.value,"onUpdate:values":C[6]||(C[6]=U=>h.value=U)},null,8,["values"])):d.createCommentVNode("",!0)]),_:1},8,["visible"]),d.createVNode(ns,{teleport:"#modal",visible:u.value,title:"Переглянути структуру таблиці",onClose:C[9]||(C[9]=U=>u.value=!1)},{default:d.withCtx(()=>[d.createVNode(D,{language:"sql",code:f.value,disabled:!0,theme:"dark-theme",id:"sqlData",class:"w-full overflow-hidden text-white !bg-black rounded",contenteditable:"true"},null,8,["code"])]),_:1},8,["visible"])],64)}}},cne={class:"bg-white rounded-xl mx-2 mt-4 border border-gray-200 shadow-sm overflow-hidden flex flex-col min-h-[480px]"},dne={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 shrink-0"},fne={class:"text-sm font-semibold text-gray-800 truncate"},hne={class:"flex-1 flex min-h-0"},pne={class:"flex-1 min-w-0 p-4 border-r border-gray-200 overflow-auto bg-gray-50/50"},gne={class:"w-[400px] shrink-0 flex flex-col bg-white"},vne={__name:"vs-widget-editor-panel",props:{selectedWidget:{type:String,default:""},selectedWidgetData:{type:Object,default:null},currentWidgetData:{type:Object,default:null},selectedDashboard:{type:String,default:""},dashboardWidgets:{type:Array,default:()=>[]}},emits:["update:selectedWidget","update-data"],setup(r,{emit:e}){const t=r,n=e,a=d.computed({get:()=>t.selectedWidget,set:o=>n("update:selectedWidget",o)});function i(){n("update:selectedWidget","")}return(o,s)=>{var l,u,c;return d.openBlock(),d.createElementBlock("div",cne,[d.createElementVNode("div",dne,[d.createElementVNode("h3",fne,d.toDisplayString(((l=r.selectedWidgetData)==null?void 0:l.title)||((c=(u=r.selectedWidgetData)==null?void 0:u.data)==null?void 0:c.title)||r.selectedWidget),1),d.createElementVNode("button",{type:"button",class:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",onClick:i},[d.createVNode(d.unref(gx),{class:"w-4 h-4"}),s[2]||(s[2]=d.createTextVNode(" Закрити "))])]),d.createElementVNode("div",hne,[d.createElementVNode("div",pne,[d.createVNode(Tl,{dashboard:r.selectedDashboard,widget:r.selectedWidget,"selected-widget":r.selectedWidget,"dashboard-widgets":r.dashboardWidgets,"filter-u-rl":void 0,class:"max-h-full"},null,8,["dashboard","widget","selected-widget","dashboard-widgets"])]),d.createElementVNode("div",gne,[d.createVNode(une,{selectedWidget:a.value,"onUpdate:selectedWidget":s[0]||(s[0]=f=>a.value=f),selectedWidgetData:r.selectedWidgetData,currentWidgetData:r.currentWidgetData,selectedDashboard:r.selectedDashboard,onUpdateData:s[1]||(s[1]=f=>o.$emit("update-data"))},null,8,["selectedWidget","selectedWidgetData","currentWidgetData","selectedDashboard"])])])])}}},XV={__name:"icon-grid",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(fx),d.mergeProps(e.$attrs,{size:24}),null,16))}},mne={__name:"icon-filter",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(dx),d.mergeProps(e.$attrs,{size:24}),null,16))}},yne={__name:"icon-more",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(cx),d.mergeProps(e.$attrs,{size:24}),null,16))}},bne=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),_ne={components:{VsModal:ns,VForm:bne,deleteIcon:Ex,editIcon:Cx,IconGrid:XV,IconMore:yne,IconFilter:mne,IconTable:F_},watch:{dashboardData(r){var t,n;if(this.formEditValue={title:r==null?void 0:r.title,description:r==null?void 0:r.description,table_name:r==null?void 0:r.table_name,db:r==null?void 0:r.db,public:r==null?void 0:r.public,words:r==null?void 0:r.words},!((t=r==null?void 0:r.panels)!=null&&t.length))return[];const e=(n=r==null?void 0:r.panels)==null?void 0:n.map(a=>{var s,l;const{title:i="",type:o=""}=((l=(s=r==null?void 0:r.widgets)==null?void 0:s.find(u=>(u==null?void 0:u.name)===(a==null?void 0:a.widget)))==null?void 0:l.data)||{};return{title:i,type:o,...a}});this.formGridValue={panels:e},this.formFilterValue={filters:(r==null?void 0:r.filters)||null}}},data(){return{isDeleteConfirm:!1,isFormEdit:!1,isFormGrid:!1,isFormFilter:!1,isVisibleTableColumns:!1,formEditValue:{},formGridValue:{},formFilterValue:{},editDashboardScheme:[{type:"Text",key:"title",label:"Заголовок",validators:["required"]},{type:"Text",key:"description",label:"Опис"},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці"},{type:"Text",key:"words",label:"Ключові слова"},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}],editGridScheme:[{type:"DataTable",ua:"Панелі",key:"panels",editable:!1,addition:!1,colModel:[{name:"title",ua:"Назва",type:"Text",key:"col"},{name:"type",ua:"Тип",type:"Text",key:"col",disabled:!0},{name:"widget",type:"Text",ua:"Назва",key:"widget",hiddenCol:!0},{name:"col",ua:"Кількість стовпчиків",type:"Text",key:"col"}]}],editFilterScheme:[{name:"filters",type:"DataTable",colModel:[{ua:"Підпис",type:"Text",key:"label"},{ua:"Тип",type:"Text",key:"type"}]}]}},props:{selected:{type:String,default:()=>""},dashboardData:{type:Object,default:()=>{}},selectedWidgetData:{type:Object,default:()=>{}},columns:{type:Array}},methods:{async editDashboard(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formEdit)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,this.formEditValue),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormEdit=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"при спробі оновити дані виникла помилка"})}},async editDashboardGrid(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formGrid)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormGrid=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async editDashboardFilters(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formFilter)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue,...this.formFilterValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormFilter=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async deleteDashboard(){try{await tr.delete(`/bi-dashboard/${this.selected}`);const r=new URL(window.top.location.href);r.searchParams.delete("dashboard"),r.searchParams.delete("widget"),window.history.pushState({},"",r),await this.$notify({title:"Успішно!",type:"success",message:"Дашборд видалено успішно"}),this.isDeleteConfirm=!1,await this.$emit("update:selected",null),await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі видалити дашборд виникла помилка"})}},closePopover(){document.body.click()}}},xne={key:0,class:"flex items-center gap-2"},wne={class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},Sne={class:"flex flex-col items-start -ml-2 -mr-2"},kne={class:"p-4"},Ene={class:"flex justify-end mt-4 gap-x-3"},Cne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Tne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Dne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function Ane(r,e,t,n,a,i){const o=d.resolveComponent("IconFilter"),s=d.resolveComponent("VsPopover"),l=d.resolveComponent("IconGrid"),u=d.resolveComponent("IconMore"),c=d.resolveComponent("VsModal"),f=d.resolveComponent("VForm");return d.openBlock(),d.createElementBlock("div",null,[t.selected?(d.openBlock(),d.createElementBlock("div",xne,[d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[0]||(e[0]=h=>a.isFormFilter=!0)},[d.createVNode(o,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[e[19]||(e[19]=d.createTextVNode(" Редагувати фільтри "))]),_:1}),d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[1]||(e[1]=h=>a.isFormGrid=!0)},[d.createVNode(l,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[e[20]||(e[20]=d.createTextVNode(" Редагувати структуру дашборду "))]),_:1}),d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createVNode(s,{placement:"bottom-left"},{reference:d.withCtx(()=>[d.createElementVNode("button",wne,[d.createVNode(u,{class:"h-[16px]"})])]),default:d.withCtx(()=>[d.createElementVNode("div",Sne,[d.createElementVNode("button",{onClick:e[2]||(e[2]=h=>{i.closePopover(),a.isFormEdit=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Редагувати дашборд "),d.createElementVNode("button",{onClick:e[3]||(e[3]=h=>{i.closePopover(),a.isDeleteConfirm=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Видалити дашборд ")])]),_:1})]),default:d.withCtx(()=>[e[21]||(e[21]=d.createTextVNode(" Керування дашбордом "))]),_:1})])):d.createCommentVNode("",!0),d.createVNode(c,{teleport:"#modal",visible:a.isDeleteConfirm,size:"small",title:"Ви впевнені?",onClose:e[6]||(e[6]=h=>a.isDeleteConfirm=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",kne,[e[22]||(e[22]=d.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей дашборд? ",-1)),d.createElementVNode("div",Ene,[d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=h=>a.isDeleteConfirm=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[5]||(e[5]=(...h)=>i.deleteDashboard&&i.deleteDashboard(...h))}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormEdit,title:"Редагувати дашборд",onClose:e[10]||(e[10]=h=>a.isFormEdit=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Cne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[8]||(e[8]=h=>a.isFormEdit=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[9]||(e[9]=(...h)=>i.editDashboard&&i.editDashboard(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formEdit",schema:a.editDashboardScheme,values:a.formEditValue,"onUpdate:values":e[7]||(e[7]=h=>a.formEditValue=h)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormGrid,title:"Редагувати структуру дашборду",onClose:e[14]||(e[14]=h=>a.isFormGrid=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Tne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[12]||(e[12]=h=>a.isFormGrid=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[13]||(e[13]=(...h)=>i.editDashboardGrid&&i.editDashboardGrid(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formgrid",schema:a.editGridScheme,values:a.formGridValue,"onUpdate:values":e[11]||(e[11]=h=>a.formGridValue=h)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormFilter,title:"Редагувати фільтри",onClose:e[18]||(e[18]=h=>a.isFormFilter=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Dne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[16]||(e[16]=h=>a.isFormFilter=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[17]||(e[17]=(...h)=>i.editDashboardFilters&&i.editDashboardFilters(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formFilter",schema:a.editFilterScheme,values:a.formFilterValue,"onUpdate:values":e[15]||(e[15]=h=>a.formFilterValue=h)},null,8,["schema","values"])]),_:1},8,["visible"])])}const Mne=wt(_ne,[["render",Ane]]),Nne={class:"flex-1 min-w-0 flex flex-col overflow-auto"},Lne={class:"max-w-7xl mx-auto px-6 w-full flex flex-col min-h-0 flex-1"},Ine={class:"flex items-center justify-between gap-4 px-4 mx-2 mt-4 shrink-0 nowrap bg-white rounded-xl border border-gray-200"},Bne={class:"grid flex-grow w-full grid-cols-12 gap-4 p-[10px] min-h-0 overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-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"},Vne=wt({__name:"vs-editor",props:{prefix:String,customClass:{type:String,default:()=>"w-screen h-screen"}},setup(r){jc(r.prefix||"/api");const t=d.ref(""),n=d.ref(""),a=d.ref(null),i=d.ref(null),o=async()=>{if(!t.value){a.value=null;return}try{const u=await tr.get(`/bi-dashboard/${t.value}`);a.value=u}catch(u){console.error(u)}},s=d.computed(()=>{var u,c,f;return(f=Array.isArray((u=a.value)==null?void 0:u.widgets)?(c=a.value)==null?void 0:c.widgets:[])==null?void 0:f.find(h=>(h==null?void 0:h.name)===n.value)}),l=d.computed(()=>{var c,f,h,p,g;const u=[{label:"Дашборди",to:"/editor"}];if((c=a.value)!=null&&c.title||t.value?u.push({label:((f=a.value)==null?void 0:f.title)||t.value||"Редактор"}):u.push({label:"Редактор"}),n.value&&s.value){const v=((p=(h=s.value)==null?void 0:h.data)==null?void 0:p.title)||((g=s.value)==null?void 0:g.title)||n.value;u.push({label:v})}return u});return d.watch(t,(u,c)=>{var h,p,g;c&&(n.value="");const f=new URL(window.top.location.href);u?((h=f==null?void 0:f.searchParams)==null||h.set("dashboard",u),(g=(p=window.top)==null?void 0:p.history)==null||g.pushState({},"",f),o()):(f==null||f.searchParams.delete("dashboard"),f==null||f.searchParams.delete("widget"))}),d.onMounted(()=>{const u=new URLSearchParams(window.top.location.search);t.value=u.get("dashboard"),n.value=u.get("widget"),o()}),(u,c)=>{var f,h;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["flex w-full h-full",[r.customClass]])},[d.createElementVNode("div",Nne,[d.createElementVNode("div",Lne,[d.createElementVNode("div",Ine,[d.createVNode(yx,{items:l.value},null,8,["items"]),d.createVNode(Mne,{selected:t.value,"onUpdate:selected":c[0]||(c[0]=p=>t.value=p),dashboardData:a.value,columns:(f=a.value)==null?void 0:f.columns,selectedWidgetData:s.value,prefix:r.prefix,onUpdateEditor:o},null,8,["selected","dashboardData","columns","selectedWidgetData","prefix"])]),n.value&&a.value?(d.openBlock(),d.createBlock(vne,{key:0,"selected-widget":n.value,"onUpdate:selectedWidget":c[1]||(c[1]=p=>n.value=p),"selected-widget-data":s.value,"current-widget-data":i.value,"selected-dashboard":t.value,"dashboard-widgets":a.value.widgets||[],onUpdateData:o},null,8,["selected-widget","selected-widget-data","current-widget-data","selected-dashboard","dashboard-widgets"])):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createElementVNode("div",Bne,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(a.value.panels,(p,g)=>{var v;return d.openBlock(),d.createElementBlock("div",{key:g,class:d.normalizeClass([`col-span-${p.col||12}`,"flex flex-col gap-[10px]"])},[(v=p.widgets)!=null&&v.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(p.widgets,m=>(d.openBlock(),d.createBlock(Tl,{onClick:y=>n.value=m,"onUpdate:currentWidgetData":c[2]||(c[2]=y=>i.value=y),key:m,dashboard:t.value,widget:m,selectedWidget:n.value,"dashboard-widgets":a.value.widgets,class:d.normalizeClass({"border border-blue-500":n.value===m})},null,8,["onClick","dashboard","widget","selectedWidget","dashboard-widgets","class"]))),128)):(d.openBlock(),d.createBlock(Tl,{key:1,onClick:m=>n.value=p.widget,"onUpdate:currentWidgetData":c[3]||(c[3]=m=>i.value=m),class:d.normalizeClass(["flex flex-col",{"border border-blue-500":n.value===p.widget}]),dashboard:t.value,widget:p.widget,selectedWidget:n.value,"dashboard-widgets":a.value.widgets},null,8,["onClick","class","dashboard","widget","selectedWidget","dashboard-widgets"]))],2)}),128)):(d.openBlock(),d.createBlock(Qc,{key:0,class:"col-span-12"}))]),t.value?(d.openBlock(),d.createBlock(YO,{key:0,class:"bottom-[10px] left-[10px] absolute",columns:(h=a.value)==null?void 0:h.columns,selectedDashboard:t.value,onUpdateData:o},null,8,["columns","selectedDashboard"])):d.createCommentVNode("",!0)],64))])])],2)}}},[["__scopeId","data-v-4ada74b0"]]),Rne={class:"pt-16 w-full h-screen"},Pne=d.defineComponent({__name:"vs-editor-page",props:{prefix:{default:"/api"}},setup(r){const t=r.prefix;return(n,a)=>(d.openBlock(),d.createElementBlock("div",Rne,[d.createVNode(Vne,{customClass:"h-full w-full",prefix:d.unref(t)},null,8,["prefix"])]))}}),One={class:"p-4 h-full flex flex-col"},zne={class:"flex items-start justify-between mb-3"},Fne={class:"flex items-center space-x-2"},$ne={class:"w-8 h-8 bg-blue-50 rounded-lg flex items-center justify-center"},Gne={class:"flex-1"},Une={class:"font-semibold text-gray-900 group-hover:text-blue-600 transition-colors"},Hne={key:0,class:"absolute right-0 top-full mt-1 py-1 w-40 bg-white border border-gray-200 rounded-lg shadow-lg z-10"},Wne={class:"bg-gray-50 rounded-md h-32 mb-4 flex items-center justify-center"},Yne={class:"flex items-center justify-between text-xs text-gray-500 mt-auto"},qne={class:"flex items-center space-x-1"},Zne={__name:"dashboard-card",props:{title:String,description:String,modified:String,name:String,reserveLines:Number,dashboardRouteName:String},setup(r){const e=r,t=kx(),n=d.ref(!1);function a(){e.dashboardRouteName&&t.push(`/dashboards/${encodeURIComponent(e.dashboardRouteName)}`)}function i(){e.dashboardRouteName&&t.push({path:"/editor",query:{dashboard:e.dashboardRouteName}})}function o(s){s.target.closest(".relative")||(n.value=!1)}return d.onMounted(()=>document.addEventListener("click",o)),d.onUnmounted(()=>document.removeEventListener("click",o)),(s,l)=>(d.openBlock(),d.createElementBlock("div",{class:"bg-white rounded-lg border border-gray-200 shadow-sm hover:shadow-md transition-all duration-200 cursor-pointer group relative h-full",onClick:i},[d.createElementVNode("div",One,[d.createElementVNode("div",zne,[d.createElementVNode("div",Fne,[d.createElementVNode("div",$ne,[d.createVNode(d.unref(ux),{size:24,class:"w-4 h-4 text-blue-600"})]),d.createElementVNode("div",Gne,[d.createElementVNode("h3",Une,d.toDisplayString(r.title),1)])]),d.createElementVNode("div",{class:"relative",onClick:l[3]||(l[3]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("button",{type:"button",class:d.normalizeClass(["p-1 hover:bg-gray-100 rounded opacity-0 group-hover:opacity-100 transition-opacity",{"opacity-100":n.value}]),onClick:l[0]||(l[0]=u=>n.value=!n.value)},[d.createVNode(d.unref(cx),{size:24,class:"w-4 h-4 text-gray-500"})],2),n.value?(d.openBlock(),d.createElementBlock("div",Hne,[d.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-2",onClick:l[1]||(l[1]=u=>{a(),n.value=!1})},[d.createVNode(d.unref(fx),{class:"w-4 h-4"}),l[4]||(l[4]=d.createTextVNode(" Переглянути "))]),d.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-2",onClick:l[2]||(l[2]=u=>{i(),n.value=!1})},[d.createVNode(d.unref(hx),{class:"w-4 h-4"}),l[5]||(l[5]=d.createTextVNode(" Редагувати "))])])):d.createCommentVNode("",!0)])]),r.description?(d.openBlock(),d.createElementBlock("p",{key:0,class:d.normalizeClass(["text-sm text-gray-600 mb-4 line-clamp-2",r.reserveLines===2?"h-10":r.reserveLines===1?"h-5":"h-0"])},d.toDisplayString(r.description),3)):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["mb-4",r.reserveLines===2?"h-10":r.reserveLines===1?"h-5":"h-0"])},null,2)),d.createElementVNode("div",Wne,[d.createVNode(d.unref(ux),{size:24,class:"w-12 h-12 text-gray-300"})]),d.createElementVNode("div",Yne,[d.createElementVNode("div",qne,[d.createVNode(d.unref(VP),{size:24,class:"w-3 h-3"}),d.createElementVNode("span",null,d.toDisplayString(r.modified),1)]),d.createElementVNode("span",null,d.toDisplayString(r.name),1)])])]))}},Xne=[{type:"Text",key:"name",label:"Назва",validators:["required"],original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"title",label:"Заголовок",validators:["required"],original:{type:"Text",ua:"Титул",col:8}},{type:"Text",key:"description",label:"Опис",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"words",label:"Ключові слова",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}];function jne(r){return!Array.isArray(r)||r.length===0?{}:r.reduce((e,t)=>{if(!t||t.key==null)return e;const{key:n,...a}=t;return e[n]=a,e},{})}const Kne={class:"pt-16"},Qne={class:"flex-1 bg-gray-50"},Jne={class:"max-w-7xl mx-auto px-6 py-8"},eae={class:"mb-6"},tae={class:"flex items-center justify-between mb-6"},rae={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},nae={class:"flex items-center space-x-4"},aae={class:"flex-1 relative"},iae={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},oae=d.defineComponent({__name:"all-dashboards-page",props:{prefix:{}},setup(r){const e=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),t=jne(Xne),n=d.ref([]),a=d.ref([]);kx();const i=r,o=d.ref(null),s=d.ref(!1),l=d.ref({});jc(i.prefix||"/api");async function u(){try{const v=await tr.get("/bi-dashboard?type=db"),m=Array.isArray(v==null?void 0:v.rows)?v.rows:[];a.value=m,n.value=m.map(y=>({routeName:String(y.name??""),title:y.title??y.name??"Untitled",description:y.description??null,modified:"-",name:"-"}))}catch(v){console.error("Failed to load dashboards",v),a.value=[],n.value=[]}}async function c(){var m,y,b;const v=(y=(m=d.getCurrentInstance())==null?void 0:m.proxy)==null?void 0:y.$notify;try{await((b=o.value)==null?void 0:b.doValidation()),await tr.post("/bi-dashboard",l.value),s.value=!1,l.value={},v==null||v({type:"success",title:"Успішно!",message:"Дашборд створено успішно"}),await u()}catch{v==null||v({type:"error",title:"Помилка!",message:"При спробі створити дашборд виникла помилка"})}}d.onMounted(u);const f=d.ref(1),h=()=>{const v=window.innerWidth;f.value=v>=1024?3:v>=768?2:1};d.onMounted(()=>{h(),window.addEventListener("resize",h)}),d.onUnmounted(()=>{window.removeEventListener("resize",h)});const p=v=>v?v.trim().length>70?2:1:0,g=v=>{const m=f.value||1,b=Math.floor(v/m)*m,_=b+m,x=n.value.slice(b,_);let w=0;for(const S of x){const k=p(S.description??null);if(k>w&&(w=k),w===2)break}return w};return d.ref("grid"),(v,m)=>(d.openBlock(),d.createElementBlock("div",Kne,[d.createElementVNode("div",Qne,[d.createElementVNode("div",Jne,[d.createElementVNode("div",eae,[d.createElementVNode("div",tae,[m[5]||(m[5]=d.createElementVNode("div",null,[d.createElementVNode("h1",{class:"text-2xl font-bold text-gray-900"},"Dashboards"),d.createElementVNode("p",{class:"text-sm text-gray-600 mt-1"}," Manage and view your analytics dashboards ")],-1)),d.createElementVNode("button",{type:"button",class:"flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",onClick:m[0]||(m[0]=y=>s.value=!0)},[d.createVNode(d.unref(px),{size:24,class:"w-4 h-4"}),m[4]||(m[4]=d.createElementVNode("span",null,"New Dashboard",-1))])]),d.createVNode(ns,{teleport:"#modal",visible:s.value,title:"Створити дашборд",onClose:m[3]||(m[3]=y=>s.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",rae,[d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border border-gray-200 rounded-lg hover:bg-gray-100 duration-300",onClick:m[2]||(m[2]=y=>s.value=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg hover:bg-blue-700 duration-300",onClick:c}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(d.unref(e),{ref_key:"createFormRef",ref:o,schema:d.unref(t),values:l.value,"onUpdate:values":m[1]||(m[1]=y=>l.value=y)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createElementVNode("div",nae,[d.createElementVNode("div",aae,[d.createVNode(d.unref(UP),{size:24,class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),m[6]||(m[6]=d.createElementVNode("input",{type:"text",placeholder:"Search dashboards...",class:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500",value:""},null,-1))])])]),d.createElementVNode("div",iae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:b,class:"cursor-pointer"},[d.createVNode(Zne,{title:y.title,description:y.description,modified:y.modified,name:y.name,reserveLines:g(b),"dashboard-route-name":y.routeName},null,8,["title","description","modified","name","reserveLines","dashboard-route-name"])]))),128))])])])]))}}),sae=d.defineComponent({__name:"editor-root-page",props:{prefix:{default:"/api"}},setup(r){const e=r,t=d.computed(()=>e.prefix),n=PO(),a=d.computed(()=>{var s;const o=(s=n==null?void 0:n.query)==null?void 0:s.dashboard;return o==null?"":typeof o=="string"?o.trim():""}),i=d.computed(()=>a.value.length>0);return(o,s)=>i.value?(d.openBlock(),d.createBlock(Pne,{key:`editor-${a.value}`,prefix:t.value},null,8,["prefix"])):(d.openBlock(),d.createBlock(oae,{key:0,prefix:t.value},null,8,["prefix"]))}});function xn(r,e){const t=r&&typeof r=="object"&&"value"in r?r.value:r;if(t==null)return"";const n=Number(t);return Number.isNaN(n)?String(t):new Intl.NumberFormat("en",e??{notation:"compact"}).format(n)}function Bc(r){if(!(r!=null&&r.includes("T")))return r??"";const[e,t,n]=r.split("T")[0].split("-");return`${n}.${t}.${e}`}function lae(r){return Intl.NumberFormat("en").format(r??0)}class uae{static getTooltipOptions(e=!0){return{show:e,axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}}}}const cae={show_label:!1,show_legend:!1,label:null,legend:{position:null},colors:null,color:null,title:null};function dae(){const r="0123456789ABCDEF";let e="#";for(let t=0;t<6;t+=1)e+=r[Math.floor(Math.random()*16)];return e}function Jo(r=cae){var t;const e={label:{show:r==null?void 0:r.show_label,formatter:(r==null?void 0:r.formatter)??(n=>xn(n)),...(r==null?void 0:r.label)||{}},legend:{...(r==null?void 0:r.legend)||{},[((t=r==null?void 0:r.legend)==null?void 0:t.position)||"bottom"]:"0",show:(r==null?void 0:r.show_legend)||!1},barWidth:"70%",grid:{borderColor:"#e5e7eb"},title:{...(r==null?void 0:r.title)||{}}};return(r!=null&&r.colors||r!=null&&r.color)&&(e.color=(r==null?void 0:r.colors)||(r==null?void 0:r.color)||null),e}function jV(r){return{color:"#9ca3af",fontSize:10,fontFamily:"Inter, ui-sans-serif, system-ui",fontWeight:400,label:r==null?void 0:r.label,show:!0,formatter:(r==null?void 0:r.formatter)??(e=>xn(e)),margin:(r==null?void 0:r.margin)??7,interval:(r==null?void 0:r.interval)??"auto",rotate:(r==null?void 0:r.rotate)??0}}const KV=["#d3c7e6","#bedae3","#f8e9cb","#ff8c8c","#c5d8be","#ffc6c6","#ffc39a","#fff7c5","#d8ffc0","#d4f7ff"];class kp{static getLabelOptions(e={}){return{show:(e==null?void 0:e.show_label)||(e==null?void 0:e.show)||!1,fontSize:"10",position:(e==null?void 0:e.position)||"inside",formatter:(e==null?void 0:e.formatter)||"{d}%",...e}}static getLegendOpions(e={}){return{...e,position:(e==null?void 0:e.position)||"bottom"}}}const Fr={props:["source","style","widget","dashboard","title","currentWidget","widgetData","prefix"],data(){return{sourceData:null,styleData:null,widgetName:"",dimensions:[],dashboardName:"",titleCharts:"",widgetInstance:null}},mounted(){window.addEventListener("resize",this.handleResize),window.addEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.addEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},unmounted(){window.removeEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.removeEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},watch:{sourceData:{async handler(){setTimeout(()=>{this==null||this.onChangedData()},0)}}},methods:{checkCustomStyleEvent(r){this.changeOptionsByName(r.chartId,r.options)},checkCustomEvent({filterUrl:r}){this.getDataFromURL(r)},handleResize(){this.widgetInstance&&this.widgetInstance.resize()},async getDataFromURL(r){var e;try{const t=await tr.get(r);this.sourceData=(t==null?void 0:t.source)||[],this.$emit("update:widgetData",t),this.dimensions=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{}),this.titleCharts=this.style?this.style:(t==null?void 0:t.title)||"",this.styleData=(t==null?void 0:t.style)||{}}catch(t){const n={message:"Дані не знайдено",title:"Помилка!",type:"error",status:400,id:this.widgetName};(t==null?void 0:t.status)=="404"&&(n.status=404,n.message="Дані не знайдено"),(t==null?void 0:t.status)=="400"&&(n.message="Перевірте налаштування або зверніться до адміністратора"),(t==null?void 0:t.status)=="500"&&(n.message="Сталася помилка сервера"),this.$emit("update:widgetData",n)}},getValues(){return this.sourceData.map(r=>{var e;return parseFloat(r[(e=this.columns)==null?void 0:e[1]])})},formatDate(r){const e=new Date(r);if(isNaN(e))return r;const t=String(e.getDate()).padStart(2,"0"),a=["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"][e.getMonth()],i=e.getFullYear();return`${t} ${a} ${i}`},async getData(){var r;try{if(this.source)this.sourceData=[...this.source],this.styleData=this.style,this.titleCharts=this.title,this.dimensions=Object.keys(((r=this.sourceData)==null?void 0:r[0])||{});else{this.widgetName=this.widget,this.dashboardName=this.dashboard;const e=this.dashboardName?`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}`:`${this.prefix||""}/bi-data?&widget=${this.widgetName}`;await this.getDataFromURL(e)}}catch(e){console.error(e)}},async initChart(r,e,t){var n,a,i,o,s,l,u;this.widgetInstance&&this.widgetInstance.clear();try{const c=this.$refs.chart,f=jf(c),h={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"transparent",shadowColor:"transparent",padding:[0,0,0,0],borderWidth:0,formatter:p=>{var y;const g=(y=p[0])==null?void 0:y.axisValue;let m=`
|
|
249
|
+
`})},b=d.computed(()=>{const E=[{id:"data",label:"Дані"},{id:"style",label:"Стилі"},{id:"yaml",label:"{ }"}];return E==null?void 0:E.filter(C=>{var T,D,A;return C.id==="style"?!(g!=null&&g.includes(((T=o.selectedWidgetData)==null?void 0:T.type)||((A=(D=o.selectedWidgetData)==null?void 0:D.data)==null?void 0:A.type))):!0})}),_=()=>{var E,C,T,D,A,I,L,B,N;h.value={title:(E=o.selectedWidgetData)==null?void 0:E.title,type:(C=o.selectedWidgetData)==null?void 0:C.type,table:(T=o.selectedWidgetData)==null?void 0:T.table_name,query:(A=(D=o.selectedWidgetData)==null?void 0:D.data)==null?void 0:A.query,x:(L=(I=o.selectedWidgetData)==null?void 0:I.data)==null?void 0:L.x,cls:(N=(B=o.selectedWidgetData)==null?void 0:B.data)==null?void 0:N.cls},c.value=!0},x=async()=>{try{await tr.put(`/bi-dashboard/${o.selectedDashboard}/${o.selectedWidgetData.name}`,h.value),n({type:"success",title:"Успішно!",message:"Дані успішно змінено"}),await a("update-data"),c.value=!1}catch{n({type:"error",title:"Помилка!",message:"При спробі внести зміни виникла помилка"})}};d.watch(p,E=>{l.value=!1;const C=new URL(window.top.location.href);E?(C.searchParams.set("widget",E),window.top.history.pushState({},"",C)):(C.searchParams.delete("widget"),window.top.history.pushState({},"",C)),setTimeout(()=>l.value=!0)}),d.watch(()=>o.currentWidgetData,()=>{y()},{deep:!0}),d.onMounted(y);const w={title:{type:"text",ua:"Заголовок",placeholder:"Заголовок",validators:["required"]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'<div style="width: 120px; height:160px" class="flex gap-[12px] flex-col"><img class="block" style="height: calc(100% - 40px)" :src="`https://cdn.softpro.ua/data/icons/bi/${id}.png`"/><span class="font-[500]">{{ label }}</span></div>'},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"text",ua:"Таблиця",placeholder:"Таблиця"},query:{type:"Text",ua:"Query",placeholder:"Query"},x:{type:"Text",ua:"X Axis",placeholder:"X Axis"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}};return(E,C)=>{var A,I,L,B,N,V,R,F,G,z,K;const T=d.resolveComponent("VsPopover"),D=d.resolveComponent("highlightjs");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",Kre,[r.selectedWidgetData?(d.openBlock(),d.createElementBlock("div",Qre,[d.createElementVNode("div",Jre,[d.createElementVNode("div",ene,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(b.value,U=>(d.openBlock(),d.createElementBlock("button",{key:U.id,type:"button",class:d.normalizeClass(["rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v.value===U.id?"bg-white text-blue-600 shadow-sm border border-gray-200":"text-gray-600 hover:text-gray-900"]),onClick:q=>v.value=U.id},d.toDisplayString(U.label),11,tne))),128))]),d.createElementVNode("div",rne,[d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:C[0]||(C[0]=U=>u.value=!0)},[d.createVNode(F_,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[C[10]||(C[10]=d.createTextVNode(" Переглянути колонки таблиці "))]),_:1}),d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{onClick:_,class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},[d.createVNode(Cx,{class:"h-[16px]"})])]),default:d.withCtx(()=>[C[11]||(C[11]=d.createTextVNode(" Редагувати віджет "))]),_:1}),d.createVNode(T,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:C[1]||(C[1]=U=>s.value=!0)},[d.createVNode(d.unref(Ex),{class:"h-[16px]"})])]),default:d.withCtx(()=>[C[12]||(C[12]=d.createTextVNode(" Видалити віджет "))]),_:1})])]),(A=r.currentWidgetData)!=null&&A.status?(d.openBlock(),d.createBlock(Qc,{key:0,title:(I=r.currentWidgetData)==null?void 0:I.title,text:(L=r.currentWidgetData)==null?void 0:L.message},null,8,["title","text"])):(d.openBlock(),d.createElementBlock("div",nne,[l.value&&r.currentWidgetData?(d.openBlock(),d.createElementBlock("div",ane,[d.createVNode(YB,{"tab-component":d.unref(WB)["vs-editor-form-"+v.value],widgetName:(B=r.selectedWidgetData)==null?void 0:B.name,yamlValue:((N=r.selectedWidgetData)==null?void 0:N.yml)||"",data:r.selectedWidgetData,controls:(V=r.selectedWidgetData)==null?void 0:V.controls,columns:(R=r.currentWidgetData)==null?void 0:R.columns,onUpdateDashboard:C[2]||(C[2]=U=>E.$emit("update-data"))},null,8,["tab-component","widgetName","yamlValue","data","controls","columns"])])):(d.openBlock(),d.createElementBlock("div",ine,[d.createVNode(YB,{"tab-component":d.unref(WB)["vs-editor-form-"+v.value],widgetName:(F=r.selectedWidgetData)==null?void 0:F.name,yamlValue:((G=r.selectedWidgetData)==null?void 0:G.yml)||"",data:r.selectedWidgetData,controls:(z=r.selectedWidgetData)==null?void 0:z.controls,columns:(K=r.currentWidgetData)==null?void 0:K.columns,onUpdateDashboard:C[3]||(C[3]=U=>E.$emit("update-data"))},null,8,["tab-component","widgetName","yamlValue","data","controls","columns"])])),d.createVNode(ns,{teleport:"#modal",visible:s.value,title:"Ви впевнені?",onClose:C[5]||(C[5]=U=>s.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",one,[C[13]||(C[13]=d.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей віджет? ",-1)),d.createElementVNode("div",sne,[d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:C[4]||(C[4]=U=>s.value=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:m}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"])]))])):(d.openBlock(),d.createBlock(Qc,{key:1,title:"Оберіть один з віджетів",text:""}))]),d.createVNode(ns,{teleport:"#modal",visible:c.value,title:"Редагувати віджет",onClose:C[8]||(C[8]=U=>c.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",lne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:C[7]||(C[7]=U=>c.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:x,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[w?(d.openBlock(),d.createBlock(d.unref(t),{key:0,schema:w,values:h.value,"onUpdate:values":C[6]||(C[6]=U=>h.value=U)},null,8,["values"])):d.createCommentVNode("",!0)]),_:1},8,["visible"]),d.createVNode(ns,{teleport:"#modal",visible:u.value,title:"Переглянути структуру таблиці",onClose:C[9]||(C[9]=U=>u.value=!1)},{default:d.withCtx(()=>[d.createVNode(D,{language:"sql",code:f.value,disabled:!0,theme:"dark-theme",id:"sqlData",class:"w-full overflow-hidden text-white !bg-black rounded",contenteditable:"true"},null,8,["code"])]),_:1},8,["visible"])],64)}}},cne={class:"bg-white rounded-xl mx-2 mt-4 border border-gray-200 shadow-sm overflow-hidden flex flex-col min-h-[480px]"},dne={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 shrink-0"},fne={class:"text-sm font-semibold text-gray-800 truncate"},hne={class:"flex-1 flex min-h-0"},pne={class:"flex-1 min-w-0 p-4 border-r border-gray-200 overflow-auto bg-gray-50/50"},gne={class:"w-[400px] shrink-0 flex flex-col bg-white"},vne={__name:"vs-widget-editor-panel",props:{selectedWidget:{type:String,default:""},selectedWidgetData:{type:Object,default:null},currentWidgetData:{type:Object,default:null},selectedDashboard:{type:String,default:""},dashboardWidgets:{type:Array,default:()=>[]}},emits:["update:selectedWidget","update-data"],setup(r,{emit:e}){const t=r,n=e,a=d.computed({get:()=>t.selectedWidget,set:o=>n("update:selectedWidget",o)});function i(){n("update:selectedWidget","")}return(o,s)=>{var l,u,c;return d.openBlock(),d.createElementBlock("div",cne,[d.createElementVNode("div",dne,[d.createElementVNode("h3",fne,d.toDisplayString(((l=r.selectedWidgetData)==null?void 0:l.title)||((c=(u=r.selectedWidgetData)==null?void 0:u.data)==null?void 0:c.title)||r.selectedWidget),1),d.createElementVNode("button",{type:"button",class:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",onClick:i},[d.createVNode(d.unref(gx),{class:"w-4 h-4"}),s[2]||(s[2]=d.createTextVNode(" Закрити "))])]),d.createElementVNode("div",hne,[d.createElementVNode("div",pne,[d.createVNode(Tl,{dashboard:r.selectedDashboard,widget:r.selectedWidget,"selected-widget":r.selectedWidget,"dashboard-widgets":r.dashboardWidgets,"filter-u-rl":void 0,class:"max-h-full"},null,8,["dashboard","widget","selected-widget","dashboard-widgets"])]),d.createElementVNode("div",gne,[d.createVNode(une,{selectedWidget:a.value,"onUpdate:selectedWidget":s[0]||(s[0]=f=>a.value=f),selectedWidgetData:r.selectedWidgetData,currentWidgetData:r.currentWidgetData,selectedDashboard:r.selectedDashboard,onUpdateData:s[1]||(s[1]=f=>o.$emit("update-data"))},null,8,["selectedWidget","selectedWidgetData","currentWidgetData","selectedDashboard"])])])])}}},XV={__name:"icon-grid",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(fx),d.mergeProps(e.$attrs,{size:24}),null,16))}},mne={__name:"icon-filter",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(dx),d.mergeProps(e.$attrs,{size:24}),null,16))}},yne={__name:"icon-more",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(cx),d.mergeProps(e.$attrs,{size:24}),null,16))}},bne=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),_ne={components:{VsModal:ns,VForm:bne,deleteIcon:Ex,editIcon:Cx,IconGrid:XV,IconMore:yne,IconFilter:mne,IconTable:F_},watch:{dashboardData(r){var t,n;if(this.formEditValue={title:r==null?void 0:r.title,description:r==null?void 0:r.description,table_name:r==null?void 0:r.table_name,db:r==null?void 0:r.db,public:r==null?void 0:r.public,words:r==null?void 0:r.words},!((t=r==null?void 0:r.panels)!=null&&t.length))return[];const e=(n=r==null?void 0:r.panels)==null?void 0:n.map(a=>{var s,l;const{title:i="",type:o=""}=((l=(s=r==null?void 0:r.widgets)==null?void 0:s.find(u=>(u==null?void 0:u.name)===(a==null?void 0:a.widget)))==null?void 0:l.data)||{};return{title:i,type:o,...a}});this.formGridValue={panels:e},this.formFilterValue={filters:(r==null?void 0:r.filters)||null}}},data(){return{isDeleteConfirm:!1,isFormEdit:!1,isFormGrid:!1,isFormFilter:!1,isVisibleTableColumns:!1,formEditValue:{},formGridValue:{},formFilterValue:{},editDashboardScheme:[{type:"Text",key:"title",label:"Заголовок",validators:["required"]},{type:"Text",key:"description",label:"Опис"},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці"},{type:"Text",key:"words",label:"Ключові слова"},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}],editGridScheme:[{type:"DataTable",ua:"Панелі",key:"panels",editable:!1,addition:!1,colModel:[{name:"title",ua:"Назва",type:"Text",key:"col"},{name:"type",ua:"Тип",type:"Text",key:"col",disabled:!0},{name:"widget",type:"Text",ua:"Назва",key:"widget",hiddenCol:!0},{name:"col",ua:"Кількість стовпчиків",type:"Text",key:"col"}]}],editFilterScheme:[{name:"filters",type:"DataTable",colModel:[{ua:"Підпис",type:"Text",key:"label"},{ua:"Тип",type:"Text",key:"type"}]}]}},props:{selected:{type:String,default:()=>""},dashboardData:{type:Object,default:()=>{}},selectedWidgetData:{type:Object,default:()=>{}},columns:{type:Array}},methods:{async editDashboard(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formEdit)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,this.formEditValue),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormEdit=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"при спробі оновити дані виникла помилка"})}},async editDashboardGrid(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formGrid)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormGrid=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async editDashboardFilters(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formFilter)==null||e.doValidation(),await tr.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue,...this.formFilterValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormFilter=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async deleteDashboard(){try{await tr.delete(`/bi-dashboard/${this.selected}`);const r=new URL(window.top.location.href);r.searchParams.delete("dashboard"),r.searchParams.delete("widget"),window.history.pushState({},"",r),await this.$notify({title:"Успішно!",type:"success",message:"Дашборд видалено успішно"}),this.isDeleteConfirm=!1,await this.$emit("update:selected",null),await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі видалити дашборд виникла помилка"})}},closePopover(){document.body.click()}}},xne={key:0,class:"flex items-center gap-2"},wne={class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},Sne={class:"flex flex-col items-start -ml-2 -mr-2"},kne={class:"p-4"},Ene={class:"flex justify-end mt-4 gap-x-3"},Cne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Tne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Dne={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function Ane(r,e,t,n,a,i){const o=d.resolveComponent("IconFilter"),s=d.resolveComponent("VsPopover"),l=d.resolveComponent("IconGrid"),u=d.resolveComponent("IconMore"),c=d.resolveComponent("VsModal"),f=d.resolveComponent("VForm");return d.openBlock(),d.createElementBlock("div",null,[t.selected?(d.openBlock(),d.createElementBlock("div",xne,[d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[0]||(e[0]=h=>a.isFormFilter=!0)},[d.createVNode(o,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[e[19]||(e[19]=d.createTextVNode(" Редагувати фільтри "))]),_:1}),d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[1]||(e[1]=h=>a.isFormGrid=!0)},[d.createVNode(l,{class:"h-[16px] text-gray-500"})])]),default:d.withCtx(()=>[e[20]||(e[20]=d.createTextVNode(" Редагувати структуру дашборду "))]),_:1}),d.createVNode(s,{placement:"left",trigger:"hover"},{reference:d.withCtx(()=>[d.createVNode(s,{placement:"bottom-left"},{reference:d.withCtx(()=>[d.createElementVNode("button",wne,[d.createVNode(u,{class:"h-[16px]"})])]),default:d.withCtx(()=>[d.createElementVNode("div",Sne,[d.createElementVNode("button",{onClick:e[2]||(e[2]=h=>{i.closePopover(),a.isFormEdit=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Редагувати дашборд "),d.createElementVNode("button",{onClick:e[3]||(e[3]=h=>{i.closePopover(),a.isDeleteConfirm=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Видалити дашборд ")])]),_:1})]),default:d.withCtx(()=>[e[21]||(e[21]=d.createTextVNode(" Керування дашбордом "))]),_:1})])):d.createCommentVNode("",!0),d.createVNode(c,{teleport:"#modal",visible:a.isDeleteConfirm,size:"small",title:"Ви впевнені?",onClose:e[6]||(e[6]=h=>a.isDeleteConfirm=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",kne,[e[22]||(e[22]=d.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей дашборд? ",-1)),d.createElementVNode("div",Ene,[d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=h=>a.isDeleteConfirm=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[5]||(e[5]=(...h)=>i.deleteDashboard&&i.deleteDashboard(...h))}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormEdit,title:"Редагувати дашборд",onClose:e[10]||(e[10]=h=>a.isFormEdit=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Cne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[8]||(e[8]=h=>a.isFormEdit=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[9]||(e[9]=(...h)=>i.editDashboard&&i.editDashboard(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formEdit",schema:a.editDashboardScheme,values:a.formEditValue,"onUpdate:values":e[7]||(e[7]=h=>a.formEditValue=h)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormGrid,title:"Редагувати структуру дашборду",onClose:e[14]||(e[14]=h=>a.isFormGrid=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Tne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[12]||(e[12]=h=>a.isFormGrid=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[13]||(e[13]=(...h)=>i.editDashboardGrid&&i.editDashboardGrid(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formgrid",schema:a.editGridScheme,values:a.formGridValue,"onUpdate:values":e[11]||(e[11]=h=>a.formGridValue=h)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createVNode(c,{teleport:"#modal",visible:a.isFormFilter,title:"Редагувати фільтри",onClose:e[18]||(e[18]=h=>a.isFormFilter=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",Dne,[d.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[16]||(e[16]=h=>a.isFormFilter=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),d.createElementVNode("button",{onClick:e[17]||(e[17]=(...h)=>i.editDashboardFilters&&i.editDashboardFilters(...h)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(f,{ref:"formFilter",schema:a.editFilterScheme,values:a.formFilterValue,"onUpdate:values":e[15]||(e[15]=h=>a.formFilterValue=h)},null,8,["schema","values"])]),_:1},8,["visible"])])}const Mne=wt(_ne,[["render",Ane]]),Nne={class:"flex-1 min-w-0 flex flex-col overflow-auto"},Lne={class:"max-w-7xl mx-auto px-6 w-full flex flex-col min-h-0 flex-1"},Ine={class:"flex items-center justify-between gap-4 px-4 mx-2 mt-4 shrink-0 nowrap bg-white rounded-xl border border-gray-200"},Bne={class:"grid flex-grow w-full grid-cols-12 gap-4 p-[10px] min-h-0 overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-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"},Vne=wt({__name:"vs-editor",props:{prefix:String,customClass:{type:String,default:()=>"w-screen h-screen"}},setup(r){jc(r.prefix||"/api");const t=d.ref(""),n=d.ref(""),a=d.ref(null),i=d.ref(null),o=async()=>{if(!t.value){a.value=null;return}try{const u=await tr.get(`/bi-dashboard/${t.value}`);a.value=u}catch(u){console.error(u)}},s=d.computed(()=>{var u,c,f;return(f=Array.isArray((u=a.value)==null?void 0:u.widgets)?(c=a.value)==null?void 0:c.widgets:[])==null?void 0:f.find(h=>(h==null?void 0:h.name)===n.value)}),l=d.computed(()=>{var c,f,h,p,g;const u=[{label:"Дашборди",to:"/editor"}];if((c=a.value)!=null&&c.title||t.value?u.push({label:((f=a.value)==null?void 0:f.title)||t.value||"Редактор"}):u.push({label:"Редактор"}),n.value&&s.value){const v=((p=(h=s.value)==null?void 0:h.data)==null?void 0:p.title)||((g=s.value)==null?void 0:g.title)||n.value;u.push({label:v})}return u});return d.watch(t,(u,c)=>{var h,p,g;c&&(n.value="");const f=new URL(window.top.location.href);u?((h=f==null?void 0:f.searchParams)==null||h.set("dashboard",u),(g=(p=window.top)==null?void 0:p.history)==null||g.pushState({},"",f),o()):(f==null||f.searchParams.delete("dashboard"),f==null||f.searchParams.delete("widget"))}),d.onMounted(()=>{const u=new URLSearchParams(window.top.location.search);t.value=u.get("dashboard"),n.value=u.get("widget"),o()}),(u,c)=>{var f,h;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["flex w-full h-full",[r.customClass]])},[d.createElementVNode("div",Nne,[d.createElementVNode("div",Lne,[d.createElementVNode("div",Ine,[d.createVNode(yx,{items:l.value},null,8,["items"]),d.createVNode(Mne,{selected:t.value,"onUpdate:selected":c[0]||(c[0]=p=>t.value=p),dashboardData:a.value,columns:(f=a.value)==null?void 0:f.columns,selectedWidgetData:s.value,prefix:r.prefix,onUpdateEditor:o},null,8,["selected","dashboardData","columns","selectedWidgetData","prefix"])]),n.value&&a.value?(d.openBlock(),d.createBlock(vne,{key:0,"selected-widget":n.value,"onUpdate:selectedWidget":c[1]||(c[1]=p=>n.value=p),"selected-widget-data":s.value,"current-widget-data":i.value,"selected-dashboard":t.value,"dashboard-widgets":a.value.widgets||[],onUpdateData:o},null,8,["selected-widget","selected-widget-data","current-widget-data","selected-dashboard","dashboard-widgets"])):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createElementVNode("div",Bne,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(a.value.panels,(p,g)=>{var v;return d.openBlock(),d.createElementBlock("div",{key:g,class:d.normalizeClass([`col-span-${p.col||12}`,"flex flex-col gap-[10px]"])},[(v=p.widgets)!=null&&v.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(p.widgets,m=>(d.openBlock(),d.createBlock(Tl,{onClick:y=>n.value=m,"onUpdate:currentWidgetData":c[2]||(c[2]=y=>i.value=y),key:m,dashboard:t.value,widget:m,selectedWidget:n.value,"dashboard-widgets":a.value.widgets,class:d.normalizeClass({"border border-blue-500":n.value===m})},null,8,["onClick","dashboard","widget","selectedWidget","dashboard-widgets","class"]))),128)):(d.openBlock(),d.createBlock(Tl,{key:1,onClick:m=>n.value=p.widget,"onUpdate:currentWidgetData":c[3]||(c[3]=m=>i.value=m),class:d.normalizeClass(["flex flex-col",{"border border-blue-500":n.value===p.widget}]),dashboard:t.value,widget:p.widget,selectedWidget:n.value,"dashboard-widgets":a.value.widgets},null,8,["onClick","class","dashboard","widget","selectedWidget","dashboard-widgets"]))],2)}),128)):(d.openBlock(),d.createBlock(Qc,{key:0,class:"col-span-12"}))]),t.value?(d.openBlock(),d.createBlock(YO,{key:0,class:"bottom-[10px] left-[10px] absolute",columns:(h=a.value)==null?void 0:h.columns,selectedDashboard:t.value,onUpdateData:o},null,8,["columns","selectedDashboard"])):d.createCommentVNode("",!0)],64))])])],2)}}},[["__scopeId","data-v-4ada74b0"]]),Rne={class:"w-full h-screen"},Pne=d.defineComponent({__name:"vs-editor-page",props:{prefix:{default:"/api"}},setup(r){const t=r.prefix;return(n,a)=>(d.openBlock(),d.createElementBlock("div",Rne,[d.createVNode(Vne,{customClass:"h-full w-full",prefix:d.unref(t)},null,8,["prefix"])]))}}),One={class:"p-4 h-full flex flex-col"},zne={class:"flex items-start justify-between mb-3"},Fne={class:"flex items-center space-x-2"},$ne={class:"w-8 h-8 bg-blue-50 rounded-lg flex items-center justify-center"},Gne={class:"flex-1"},Une={class:"font-semibold text-gray-900 group-hover:text-blue-600 transition-colors"},Hne={key:0,class:"absolute right-0 top-full mt-1 py-1 w-40 bg-white border border-gray-200 rounded-lg shadow-lg z-10"},Wne={class:"bg-gray-50 rounded-md h-32 mb-4 flex items-center justify-center"},Yne={class:"flex items-center justify-between text-xs text-gray-500 mt-auto"},qne={class:"flex items-center space-x-1"},Zne={__name:"dashboard-card",props:{title:String,description:String,modified:String,name:String,reserveLines:Number,dashboardRouteName:String},setup(r){const e=r,t=kx(),n=d.ref(!1);function a(){e.dashboardRouteName&&t.push(`/dashboards/${encodeURIComponent(e.dashboardRouteName)}`)}function i(){e.dashboardRouteName&&t.push({path:"/editor",query:{dashboard:e.dashboardRouteName}})}function o(s){s.target.closest(".relative")||(n.value=!1)}return d.onMounted(()=>document.addEventListener("click",o)),d.onUnmounted(()=>document.removeEventListener("click",o)),(s,l)=>(d.openBlock(),d.createElementBlock("div",{class:"bg-white rounded-lg border border-gray-200 shadow-sm hover:shadow-md transition-all duration-200 cursor-pointer group relative h-full",onClick:i},[d.createElementVNode("div",One,[d.createElementVNode("div",zne,[d.createElementVNode("div",Fne,[d.createElementVNode("div",$ne,[d.createVNode(d.unref(ux),{size:24,class:"w-4 h-4 text-blue-600"})]),d.createElementVNode("div",Gne,[d.createElementVNode("h3",Une,d.toDisplayString(r.title),1)])]),d.createElementVNode("div",{class:"relative",onClick:l[3]||(l[3]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("button",{type:"button",class:d.normalizeClass(["p-1 hover:bg-gray-100 rounded opacity-0 group-hover:opacity-100 transition-opacity",{"opacity-100":n.value}]),onClick:l[0]||(l[0]=u=>n.value=!n.value)},[d.createVNode(d.unref(cx),{size:24,class:"w-4 h-4 text-gray-500"})],2),n.value?(d.openBlock(),d.createElementBlock("div",Hne,[d.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-2",onClick:l[1]||(l[1]=u=>{a(),n.value=!1})},[d.createVNode(d.unref(fx),{class:"w-4 h-4"}),l[4]||(l[4]=d.createTextVNode(" Переглянути "))]),d.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-2",onClick:l[2]||(l[2]=u=>{i(),n.value=!1})},[d.createVNode(d.unref(hx),{class:"w-4 h-4"}),l[5]||(l[5]=d.createTextVNode(" Редагувати "))])])):d.createCommentVNode("",!0)])]),r.description?(d.openBlock(),d.createElementBlock("p",{key:0,class:d.normalizeClass(["text-sm text-gray-600 mb-4 line-clamp-2",r.reserveLines===2?"h-10":r.reserveLines===1?"h-5":"h-0"])},d.toDisplayString(r.description),3)):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["mb-4",r.reserveLines===2?"h-10":r.reserveLines===1?"h-5":"h-0"])},null,2)),d.createElementVNode("div",Wne,[d.createVNode(d.unref(ux),{size:24,class:"w-12 h-12 text-gray-300"})]),d.createElementVNode("div",Yne,[d.createElementVNode("div",qne,[d.createVNode(d.unref(VP),{size:24,class:"w-3 h-3"}),d.createElementVNode("span",null,d.toDisplayString(r.modified),1)]),d.createElementVNode("span",null,d.toDisplayString(r.name),1)])])]))}},Xne=[{type:"Text",key:"name",label:"Назва",validators:["required"],original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"title",label:"Заголовок",validators:["required"],original:{type:"Text",ua:"Титул",col:8}},{type:"Text",key:"description",label:"Опис",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"words",label:"Ключові слова",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}];function jne(r){return!Array.isArray(r)||r.length===0?{}:r.reduce((e,t)=>{if(!t||t.key==null)return e;const{key:n,...a}=t;return e[n]=a,e},{})}const Kne={class:"flex-1 bg-gray-50"},Qne={class:"max-w-7xl mx-auto px-6 py-8"},Jne={class:"mb-6"},eae={class:"flex items-center justify-between mb-6"},tae={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},rae={class:"flex items-center space-x-4"},nae={class:"flex-1 relative"},aae={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},iae=d.defineComponent({__name:"all-dashboards-page",props:{prefix:{}},setup(r){const e=d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),t=jne(Xne),n=d.ref([]),a=d.ref([]);kx();const i=r,o=d.ref(null),s=d.ref(!1),l=d.ref({});jc(i.prefix||"/api");async function u(){try{const v=await tr.get("/bi-dashboard?type=db"),m=Array.isArray(v==null?void 0:v.rows)?v.rows:[];a.value=m,n.value=m.map(y=>({routeName:String(y.name??""),title:y.title??y.name??"Untitled",description:y.description??null,modified:"-",name:"-"}))}catch(v){console.error("Failed to load dashboards",v),a.value=[],n.value=[]}}async function c(){var m,y,b;const v=(y=(m=d.getCurrentInstance())==null?void 0:m.proxy)==null?void 0:y.$notify;try{await((b=o.value)==null?void 0:b.doValidation()),await tr.post("/bi-dashboard",l.value),s.value=!1,l.value={},v==null||v({type:"success",title:"Успішно!",message:"Дашборд створено успішно"}),await u()}catch{v==null||v({type:"error",title:"Помилка!",message:"При спробі створити дашборд виникла помилка"})}}d.onMounted(u);const f=d.ref(1),h=()=>{const v=window.innerWidth;f.value=v>=1024?3:v>=768?2:1};d.onMounted(()=>{h(),window.addEventListener("resize",h)}),d.onUnmounted(()=>{window.removeEventListener("resize",h)});const p=v=>v?v.trim().length>70?2:1:0,g=v=>{const m=f.value||1,b=Math.floor(v/m)*m,_=b+m,x=n.value.slice(b,_);let w=0;for(const S of x){const k=p(S.description??null);if(k>w&&(w=k),w===2)break}return w};return d.ref("grid"),(v,m)=>(d.openBlock(),d.createElementBlock("div",Kne,[d.createElementVNode("div",Qne,[d.createElementVNode("div",Jne,[d.createElementVNode("div",eae,[m[5]||(m[5]=d.createElementVNode("div",null,[d.createElementVNode("h1",{class:"text-2xl font-bold text-gray-900"},"Dashboards"),d.createElementVNode("p",{class:"text-sm text-gray-600 mt-1"}," Manage and view your analytics dashboards ")],-1)),d.createElementVNode("button",{type:"button",class:"flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",onClick:m[0]||(m[0]=y=>s.value=!0)},[d.createVNode(d.unref(px),{size:24,class:"w-4 h-4"}),m[4]||(m[4]=d.createElementVNode("span",null,"New Dashboard",-1))])]),d.createVNode(ns,{teleport:"#modal",visible:s.value,title:"Створити дашборд",onClose:m[3]||(m[3]=y=>s.value=!1)},{footer:d.withCtx(()=>[d.createElementVNode("div",tae,[d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border border-gray-200 rounded-lg hover:bg-gray-100 duration-300",onClick:m[2]||(m[2]=y=>s.value=!1)}," Скасувати "),d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg hover:bg-blue-700 duration-300",onClick:c}," Зберегти ")])]),default:d.withCtx(()=>[d.createVNode(d.unref(e),{ref_key:"createFormRef",ref:o,schema:d.unref(t),values:l.value,"onUpdate:values":m[1]||(m[1]=y=>l.value=y)},null,8,["schema","values"])]),_:1},8,["visible"]),d.createElementVNode("div",rae,[d.createElementVNode("div",nae,[d.createVNode(d.unref(UP),{size:24,class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),m[6]||(m[6]=d.createElementVNode("input",{type:"text",placeholder:"Search dashboards...",class:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500",value:""},null,-1))])])]),d.createElementVNode("div",aae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:b,class:"cursor-pointer"},[d.createVNode(Zne,{title:y.title,description:y.description,modified:y.modified,name:y.name,reserveLines:g(b),"dashboard-route-name":y.routeName},null,8,["title","description","modified","name","reserveLines","dashboard-route-name"])]))),128))])])]))}}),oae=d.defineComponent({__name:"editor-root-page",props:{prefix:{default:"/api"}},setup(r){const e=r,t=d.computed(()=>e.prefix),n=PO(),a=d.computed(()=>{var s;const o=(s=n==null?void 0:n.query)==null?void 0:s.dashboard;return o==null?"":typeof o=="string"?o.trim():""}),i=d.computed(()=>a.value.length>0);return(o,s)=>i.value?(d.openBlock(),d.createBlock(Pne,{key:`editor-${a.value}`,prefix:t.value},null,8,["prefix"])):(d.openBlock(),d.createBlock(iae,{key:0,prefix:t.value},null,8,["prefix"]))}});function xn(r,e){const t=r&&typeof r=="object"&&"value"in r?r.value:r;if(t==null)return"";const n=Number(t);return Number.isNaN(n)?String(t):new Intl.NumberFormat("en",e??{notation:"compact"}).format(n)}function Bc(r){if(!(r!=null&&r.includes("T")))return r??"";const[e,t,n]=r.split("T")[0].split("-");return`${n}.${t}.${e}`}function sae(r){return Intl.NumberFormat("en").format(r??0)}class lae{static getTooltipOptions(e=!0){return{show:e,axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}}}}const uae={show_label:!1,show_legend:!1,label:null,legend:{position:null},colors:null,color:null,title:null};function cae(){const r="0123456789ABCDEF";let e="#";for(let t=0;t<6;t+=1)e+=r[Math.floor(Math.random()*16)];return e}function Jo(r=uae){var t;const e={label:{show:r==null?void 0:r.show_label,formatter:(r==null?void 0:r.formatter)??(n=>xn(n)),...(r==null?void 0:r.label)||{}},legend:{...(r==null?void 0:r.legend)||{},[((t=r==null?void 0:r.legend)==null?void 0:t.position)||"bottom"]:"0",show:(r==null?void 0:r.show_legend)||!1},barWidth:"70%",grid:{borderColor:"#e5e7eb"},title:{...(r==null?void 0:r.title)||{}}};return(r!=null&&r.colors||r!=null&&r.color)&&(e.color=(r==null?void 0:r.colors)||(r==null?void 0:r.color)||null),e}function jV(r){return{color:"#9ca3af",fontSize:10,fontFamily:"Inter, ui-sans-serif, system-ui",fontWeight:400,label:r==null?void 0:r.label,show:!0,formatter:(r==null?void 0:r.formatter)??(e=>xn(e)),margin:(r==null?void 0:r.margin)??7,interval:(r==null?void 0:r.interval)??"auto",rotate:(r==null?void 0:r.rotate)??0}}const KV=["#d3c7e6","#bedae3","#f8e9cb","#ff8c8c","#c5d8be","#ffc6c6","#ffc39a","#fff7c5","#d8ffc0","#d4f7ff"];class kp{static getLabelOptions(e={}){return{show:(e==null?void 0:e.show_label)||(e==null?void 0:e.show)||!1,fontSize:"10",position:(e==null?void 0:e.position)||"inside",formatter:(e==null?void 0:e.formatter)||"{d}%",...e}}static getLegendOpions(e={}){return{...e,position:(e==null?void 0:e.position)||"bottom"}}}const Fr={props:["source","style","widget","dashboard","title","currentWidget","widgetData","prefix"],data(){return{sourceData:null,styleData:null,widgetName:"",dimensions:[],dashboardName:"",titleCharts:"",widgetInstance:null}},mounted(){window.addEventListener("resize",this.handleResize),window.addEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.addEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},unmounted(){window.removeEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.removeEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},watch:{sourceData:{async handler(){setTimeout(()=>{this==null||this.onChangedData()},0)}}},methods:{checkCustomStyleEvent(r){this.changeOptionsByName(r.chartId,r.options)},checkCustomEvent({filterUrl:r}){this.getDataFromURL(r)},handleResize(){this.widgetInstance&&this.widgetInstance.resize()},async getDataFromURL(r){var e;try{const t=await tr.get(r);this.sourceData=(t==null?void 0:t.source)||[],this.$emit("update:widgetData",t),this.dimensions=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{}),this.titleCharts=this.style?this.style:(t==null?void 0:t.title)||"",this.styleData=(t==null?void 0:t.style)||{}}catch(t){const n={message:"Дані не знайдено",title:"Помилка!",type:"error",status:400,id:this.widgetName};(t==null?void 0:t.status)=="404"&&(n.status=404,n.message="Дані не знайдено"),(t==null?void 0:t.status)=="400"&&(n.message="Перевірте налаштування або зверніться до адміністратора"),(t==null?void 0:t.status)=="500"&&(n.message="Сталася помилка сервера"),this.$emit("update:widgetData",n)}},getValues(){return this.sourceData.map(r=>{var e;return parseFloat(r[(e=this.columns)==null?void 0:e[1]])})},formatDate(r){const e=new Date(r);if(isNaN(e))return r;const t=String(e.getDate()).padStart(2,"0"),a=["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"][e.getMonth()],i=e.getFullYear();return`${t} ${a} ${i}`},async getData(){var r;try{if(this.source)this.sourceData=[...this.source],this.styleData=this.style,this.titleCharts=this.title,this.dimensions=Object.keys(((r=this.sourceData)==null?void 0:r[0])||{});else{this.widgetName=this.widget,this.dashboardName=this.dashboard;const e=this.dashboardName?`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}`:`${this.prefix||""}/bi-data?&widget=${this.widgetName}`;await this.getDataFromURL(e)}}catch(e){console.error(e)}},async initChart(r,e,t){var n,a,i,o,s,l,u;this.widgetInstance&&this.widgetInstance.clear();try{const c=this.$refs.chart,f=jf(c),h={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"transparent",shadowColor:"transparent",padding:[0,0,0,0],borderWidth:0,formatter:p=>{var y;const g=(y=p[0])==null?void 0:y.axisValue;let m=`
|
|
250
250
|
<div style="background-color: rgba(255, 255, 255, 0.7)" class="border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700 min-w-28">
|
|
251
251
|
<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 px-2 py-1">
|
|
252
252
|
${g?this.formatDate(g):"N/A"}
|
|
@@ -259,16 +259,16 @@ https://github.com/highlightjs/highlight.js/issues/2277`),G=N,F=V),R===void 0&&(
|
|
|
259
259
|
</span>
|
|
260
260
|
<span>${this.getMetricValue(b==null?void 0:b.data)}</span>
|
|
261
261
|
</div>
|
|
262
|
-
`}),m+="</div>",m}},xAxis:{data:e!=null&&e.length?e:null,type:e?"category":"value",name:((a=(n=this.styleData)==null?void 0:n.x_axis)==null?void 0:a.name)||"",axisLabel:{...jV((i=this.styleData)==null?void 0:i.x_axis),formatter:p=>{var v,m;const g=this.formatDate(p);return((m=(v=this.styleData)==null?void 0:v.x_axis)==null?void 0:m.overflow)==="ellipsis"&&g.length>10?`${g.slice(0,10)}...`:g}}},yAxis:{data:t!=null&&t.length?t:null,type:t?"category":"value",name:((s=(o=this.styleData)==null?void 0:o.y_axis)==null?void 0:s.name)||"",axisLabel:jV((l=this.styleData)==null?void 0:l.y_axis)},series:r!=null&&r.length?r:null,...Jo(this.styleData),grid:{bottom:"0%",right:"0%",left:"0%",top:"20px",containLabel:!0,...((u=this.styleData)==null?void 0:u.grid)||{}}};await f.setOption(h),f.resize(),this.widgetInstance=f,this.$emit("update:currentWidget",f)}catch(c){console.error(c)}},async setSeriesOption(r,e){const t=r.getOption(),{series:n=[]}=t,a=n.map(i=>({...i,...e}));r.setOption({...t,series:a})},async changeOptionsByName(r,e){const t=document.getElementById(r);if(!t)return null;const n=oy(t);if(!n)return null;const a=n.getOption();e.seriesOptions&&this.setSeriesOption(n,e.seriesOptions),n.setOption({...a,...e.options,tooltip:{...
|
|
262
|
+
`}),m+="</div>",m}},xAxis:{data:e!=null&&e.length?e:null,type:e?"category":"value",name:((a=(n=this.styleData)==null?void 0:n.x_axis)==null?void 0:a.name)||"",axisLabel:{...jV((i=this.styleData)==null?void 0:i.x_axis),formatter:p=>{var v,m;const g=this.formatDate(p);return((m=(v=this.styleData)==null?void 0:v.x_axis)==null?void 0:m.overflow)==="ellipsis"&&g.length>10?`${g.slice(0,10)}...`:g}}},yAxis:{data:t!=null&&t.length?t:null,type:t?"category":"value",name:((s=(o=this.styleData)==null?void 0:o.y_axis)==null?void 0:s.name)||"",axisLabel:jV((l=this.styleData)==null?void 0:l.y_axis)},series:r!=null&&r.length?r:null,...Jo(this.styleData),grid:{bottom:"0%",right:"0%",left:"0%",top:"20px",containLabel:!0,...((u=this.styleData)==null?void 0:u.grid)||{}}};await f.setOption(h),f.resize(),this.widgetInstance=f,this.$emit("update:currentWidget",f)}catch(c){console.error(c)}},async setSeriesOption(r,e){const t=r.getOption(),{series:n=[]}=t,a=n.map(i=>({...i,...e}));r.setOption({...t,series:a})},async changeOptionsByName(r,e){const t=document.getElementById(r);if(!t)return null;const n=oy(t);if(!n)return null;const a=n.getOption();e.seriesOptions&&this.setSeriesOption(n,e.seriesOptions),n.setOption({...a,...e.options,tooltip:{...lae.getTooltipOptions(e.options.tooltip.show)}})},async changeData(r){var e;try{let t=this.dashboard?`${this.prefix||""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`:`${this.prefix||""}/bi-data?&widget=${this.widget}`;(e=r==null?void 0:r.granularity)!=null&&e.length&&(t+=`&granularity=${r.granularity}`),r!=null&&r.metrics&&(t+=`&metrics=${r.metrics}`),this.getDataFromURL(t)}catch(t){console.error(t)}},async setFilter(r){const e=`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${r||""}`;await this.getDataFromURL(e)},async changeStyle(r,e){this.styleData[r]=e,this.onChangedData()},getMetricValue(r){var n;const e=(r==null?void 0:r.metric)||r;return parseFloat(e)?(n=xn(e,{notation:"standard"}))==null?void 0:n.replaceAll(","," "):e}}},dae={name:"VsBar",mixins:[Fr],data(){return{resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var e;this.getData(),this.onChangedData();const r=(e=this.$refs)==null?void 0:e.chart;r&&(this.resizeObserver=new ResizeObserver(()=>{var t;this.widgetInstance&&((t=this.widgetInstance)==null||t.resize())}),this.resizeObserver.observe(r))},unmounted(){this.resizeObserver.disconnect()},methods:{async onChangedData(){try{if(this.sourceData){await this.$nextTick();const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch(r){console.error(r)}},prepareData(){var r,e,t,n,a,i;try{if(!((r=this.sourceData)!=null&&r.length))return{series:[],xs:[],ys:void 0};const o=Array.from(new Set(this.sourceData.filter(h=>h[this.dimensions[0]]).map(h=>h[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=o.map(h=>Bc(h)):s=[...o];let l,u;((e=this.styleData)==null?void 0:e.horizontal)===!0?u=[...s]:l=[...s];const c=this.sourceData.filter(h=>parseFloat(h[this.dimensions[1]])&&h[this.dimensions[0]]).map(h=>parseFloat(h[this.dimensions[1]]));let f;return((t=this.styleData)==null?void 0:t.stack)!==!1?f=this.prepareStackData():((n=this.styleData)==null?void 0:n.negative_waterfall)===!0?f=this.prepareNegativeWaterfall():((a=this.styleData)==null?void 0:a.waterfall)===!0?f=this.prepareWaterfallData(c):((i=this.styleData)==null?void 0:i.accumulative)===!0?f=this.prepareAccumulative(c):f=this.dimensions.slice(1).map((p,g)=>({name:p,type:"bar",stack:`a${g}`,data:this.sourceData.filter(v=>parseFloat(v[p])&&p).map(v=>parseFloat(v[p]))})),{series:f,xs:l,ys:u}}catch(o){return console.error(o),{series:[],xs:[],ys:[]}}},prepareWaterfallData(r){let e=r.reduce((i,o)=>i+o,0);const t=[e,...r],n=t.map((i,o)=>{if(o===0)return 0;const s=e-i;return e-=i,s>=0?s:0});return[{type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},data:n,tooltip:{show:!1}},{name:this.title?this.title:this.dimensions[0],type:"bar",stack:"Total",data:t}]},prepareStackData(){return this.dimensions.slice(1).map(t=>({name:t,type:"bar",stack:"a",data:this.sourceData.filter(n=>parseFloat(n[t])&&t).map(n=>parseFloat(n[t]))}))},prepareNegativeWaterfall(){const r=this.sourceData.map(i=>Number.isNaN(i[this.dimensions[1]])?0:Number(i[this.dimensions[1]])),e=this.sourceData.map(i=>Number.isNaN(i[this.dimensions[2]])?0:Number(i[this.dimensions[2]]));let t=0;const n=r.map((i,o)=>{const s=t;return t+=Number.isNaN(i)?0:i,o===0&&(t-=Number.isNaN(e[o])?0:e[o]),t-=Number.isNaN(e[o+1])?0:e[o+1],s>=0?s:0});return[{type:"bar",stack:"a",itemStyle:{borderColor:"transparent",color:"transparent"},data:n,tooltip:{show:!1}},{name:this.dimensions[1],type:"bar",stack:"a",data:r},{name:this.dimensions[2],type:"bar",stack:"a",data:e}]},prepareAccumulative(r){let e=0;const t=r.map(a=>(e+=a,e));return[{name:this.titleCharts,type:"bar",stack:"Total",data:t}]}}},fae=["id"];function hae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full w-full min-h-[200px]"},null,8,fae)}const A1=wt(dae,[["render",hae]]),pae=Object.freeze(Object.defineProperty({__proto__:null,default:A1},Symbol.toStringTag,{value:"Module"}));d.defineAsyncComponent(()=>Promise.resolve().then(()=>$a)),d.defineAsyncComponent(()=>Promise.all([Promise.resolve().then(()=>tce),Promise.resolve().then(()=>$a)]).then(([r,e])=>r.VsFormRadio??e.VsFormRadio));var QV=(r=>(r.Dashboard="/dashboard",r.BiPlatform="/bi-platform",r.EditorBase="/editor",r.AllDashboards="/dashboards",r.DashboardByName="/dashboards/:name",r))(QV||{}),JV;(r=>{(e=>{e.Bar="bar",e.ListBar="listbar",e.Number="number",e.Text="text",e.Pie="pie",e.Heatmap="heatmap",e.Calendar="calendar",e.Line="line",e.Stat="stat",e.Pivot="pivot",e.Funnel="funnel",e.Progress="progress"})(r.Types||(r.Types={}))})(JV||(JV={}));var eR=(r=>(r.AllDashboards="all-dashboards",r.BiPlatform="bi-platform",r.Dashboard="dashboard",r.Erobota="erobota",r.Datatest="datatest",r.Sourcedate="sourcedate",r.Widgetwidget="widgetwidget",r.Test="test",r.Demo="demo",r.Crm="crm",r.Editor="editor",r.Editordetails="editordetails",r.Dbtables="dbtables",r.Biviewer="biviewer",r.Biviewerinner="biviewerinner",r.Bieditor="bieditor",r.Bieditorinner="bieditorinner",r.Datasets="datasets",r))(eR||{});const gae={name:"VsPie",props:["currentWidget"],mixins:[Fr],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var t;await this.$nextTick(),await this.getData();const{series:r}=this.prepareData()||{};r&&this.initChart(r);const e=(t=this.$refs)==null?void 0:t.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},beforeUnmount(){var r;(r=this.resizeObserver)==null||r.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&this.initChart(r,e,t)}}catch(r){console.error(r)}},buildTooltipForDonut(r,e){const{name:t,value:n,percent:a}=r;return`
|
|
263
263
|
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
264
264
|
${t==null?void 0:t.replace("null","Не визначено")}: ${xn(n)} (${a}%)
|
|
265
|
-
</div>`},prepareData(){var r,e,t,n,a,i;try{if(this.styleData=this.styleData||{},!((r=this.sourceData)!=null&&r.length))return console.warn("No source data available"),null;const o=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[0]]))),s=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((g,v)=>g+parseFloat((v==null?void 0:v.metric)||0),0),10),u=o.map((g,v)=>{const m=(s[v]/l*100).toFixed(2);return{name:`${g} (${m}%)`,value:s[v]}}),c=((e=this.styleData)==null?void 0:e.innerRadius)||"80%",f=((t=this.styleData)==null?void 0:t.outerRadius)||"100%",h=[c,f];return this.styleData.legend=kp.getLegendOpions({borderRadius:10,height:"100%",padding:10,bottom:"0",type:"scroll",itemWidth:14,itemHeight:14,formatter:g=>{var v;return(v=g==null?void 0:g.replace("null","Не визначено"))==null?void 0:v.replace("NaN","0.00")},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=kp.getLabelOptions((a=this.styleData)==null?void 0:a.label),this.styleData.show_legend=((i=this.styleData)==null?void 0:i.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:h,center:["50%","60%"],height:"75%",...Jo(this.styleData),data:u}]}}catch(o){return console.error("Error in prepareData:",o),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=jf(e);const t=parseInt((this.sourceData||[]).reduce((a,i)=>a+parseFloat((i==null?void 0:i.metric)||0),0),10),n={tooltip:{trigger:"item",formatter:a=>this.buildTooltipForDonut(a,[a.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...Jo(this.styleData||{}),title:{text:xn(t),left:"center",top:"41%",textStyle:{color:"black",fontWeight:400,fontSize:"22px"}}};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var a;(a=this.chartInstance)==null||a.resize()})}catch(e){console.error("Error in initChart:",e)}}}},
|
|
265
|
+
</div>`},prepareData(){var r,e,t,n,a,i;try{if(this.styleData=this.styleData||{},!((r=this.sourceData)!=null&&r.length))return console.warn("No source data available"),null;const o=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[0]]))),s=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((g,v)=>g+parseFloat((v==null?void 0:v.metric)||0),0),10),u=o.map((g,v)=>{const m=(s[v]/l*100).toFixed(2);return{name:`${g} (${m}%)`,value:s[v]}}),c=((e=this.styleData)==null?void 0:e.innerRadius)||"80%",f=((t=this.styleData)==null?void 0:t.outerRadius)||"100%",h=[c,f];return this.styleData.legend=kp.getLegendOpions({borderRadius:10,height:"100%",padding:10,bottom:"0",type:"scroll",itemWidth:14,itemHeight:14,formatter:g=>{var v;return(v=g==null?void 0:g.replace("null","Не визначено"))==null?void 0:v.replace("NaN","0.00")},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=kp.getLabelOptions((a=this.styleData)==null?void 0:a.label),this.styleData.show_legend=((i=this.styleData)==null?void 0:i.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:h,center:["50%","60%"],height:"75%",...Jo(this.styleData),data:u}]}}catch(o){return console.error("Error in prepareData:",o),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=jf(e);const t=parseInt((this.sourceData||[]).reduce((a,i)=>a+parseFloat((i==null?void 0:i.metric)||0),0),10),n={tooltip:{trigger:"item",formatter:a=>this.buildTooltipForDonut(a,[a.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...Jo(this.styleData||{}),title:{text:xn(t),left:"center",top:"41%",textStyle:{color:"black",fontWeight:400,fontSize:"22px"}}};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var a;(a=this.chartInstance)==null||a.resize()})}catch(e){console.error("Error in initChart:",e)}}}},vae=["id"];function mae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,vae)}const tR=wt(gae,[["render",mae]]),yae=Object.freeze(Object.defineProperty({__proto__:null,default:tR},Symbol.toStringTag,{value:"Module"})),bae={name:"VsPie",props:["currentWidget"],mixins:[Fr],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var t;await this.$nextTick(),await this.getData();const{series:r}=this.prepareData()||{};r&&this.initChart(r);const e=(t=this.$refs)==null?void 0:t.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},unmounted(){var r;(r=this.resizeObserver)==null||r.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&this.initChart(r,e,t)}}catch(r){console.error(r)}},buildTooltipForDonut(r,e){const{name:t,value:n,percent:a}=r;return`
|
|
266
266
|
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
267
267
|
${t==null?void 0:t.replace("null","Не визначено")}: ${xn(n)} (${a}%)
|
|
268
|
-
</div>`},prepareData(){var r,e,t,n,a;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(p=>p[this.dimensions[0]]))),o=Array.from(new Set((this.sourceData||[]).map(p=>p[this.dimensions[1]]))),s=parseInt((this.sourceData||[]).reduce((p,g)=>p+parseFloat(g==null?void 0:g.metric),0),10),l=i.map((p,g)=>{const v=(o[g]/s*100).toFixed(2);return{name:`${p} (${v}%)`,value:o[g]}}),u=((r=this.styleData)==null?void 0:r.innerRadius)||"0%",c=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",f=[u,c];return this.styleData.legend=kp.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:p=>p==null?void 0:p.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((t=this.styleData)==null?void 0:t.legend)||{}}),this.styleData.label=kp.getLabelOptions((n=this.styleData)==null?void 0:n.label),this.styleData.show_legend=((a=this.styleData)==null?void 0:a.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:f,center:["50%","60%"],height:"75%",...Jo(this.styleData),data:l}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=jf(e);const t={tooltip:{trigger:"item",formatter:n=>this.buildTooltipForDonut(n,[n.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...Jo(this.styleData||{})};this.chartInstance.setOption(t),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var n;(n=this.chartInstance)==null||n.resize()})}catch(e){console.error("Error in initChart:",e)}}}},xae=["id"];function wae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,xae)}const rR=wt(_ae,[["render",wae]]),Sae=Object.freeze(Object.defineProperty({__proto__:null,default:rR},Symbol.toStringTag,{value:"Module"})),kae={name:"VsLine",mixins:[Fr],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r,xs:e}=this.prepareData();r&&this.initChart(r,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch(r){console.error(r)}},prepareData(){var r,e;try{const t=Array.from(new Set(this.sourceData.map(o=>o[this.dimensions[0]])));let n;this.dimensions[0].includes("date")?n=t.map(o=>Bc(o)):n=[...t];const a=this.sourceData.map(o=>parseFloat(o[this.dimensions[1]]));let i;return(r=this.styleData)!=null&&r.stack?i=this.dimensions.slice(1).map(s=>({name:s,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(l=>parseFloat(l[s])).map(l=>parseFloat(l[s]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:a,stack:"a"}],{series:i,xs:n}}catch(t){return console.error(t),null}}}},Eae=["id"];function Cae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:a.uniqueID,ref:"chart",style:{height:"400px"}},null,8,Eae)}const nR=wt(kae,[["render",Cae]]),Tae=Object.freeze(Object.defineProperty({__proto__:null,default:nR},Symbol.toStringTag,{value:"Module"})),Dae={name:"VsStat",mixins:[Fr],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const r=this.getValues();this.sumValue=r.reduce((e,t)=>e+t,0),this.sourceData.forEach((e,t)=>{e.color=t<KV.length-1?KV[t]:dae()})},formattedValue(r){const e=parseFloat(r);return xn(e)}}},Aae={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},Mae={class:"flex flex-col justify-between w-full h-full"},Nae={class:"w-full h-full pb-6 space-y-4"},Lae={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},Iae=["onMouseover"],Bae={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},Vae={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},Rae={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},Pae={class:"flex items-center"},Oae={class:"text-sm text-gray-800"},zae={class:"text-end"},Fae={class:"text-sm text-gray-500"};function $ae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",Aae,[d.createElementVNode("div",Mae,[d.createElementVNode("div",Nae,[d.createElementVNode("div",Lae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>{var l,u,c,f;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${o.color}]`]),style:d.normalizeStyle({width:`${parseFloat(o==null?void 0:o[(l=a.columns)==null?void 0:l[1]])/a.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:h=>a.showTooltip=s,onMouseleave:e[0]||(e[0]=h=>a.showTooltip=-1)},[a.showTooltip>-1?(d.openBlock(),d.createElementBlock("div",Bae,d.toDisplayString(r.sourceData[a.showTooltip][a.columns[0]])+" "+d.toDisplayString((parseFloat((f=(u=r.sourceData)==null?void 0:u[a.showTooltip])==null?void 0:f[(c=a.columns)==null?void 0:c[1]])/a.sumValue*100).toFixed(2))+"% ",1)):d.createCommentVNode("",!0)],46,Iae)}),256))]),d.createElementVNode("ul",Vae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,o=>{var s,l;return d.openBlock(),d.createElementBlock("li",Rae,[d.createElementVNode("div",Pae,[d.createElementVNode("span",{class:d.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${o.color}]`])},null,2),d.createElementVNode("span",Oae,d.toDisplayString((o==null?void 0:o[(s=a.columns)==null?void 0:s[0]])||"Не визначено"),1)]),d.createElementVNode("div",zae,[d.createElementVNode("span",Fae,d.toDisplayString(i.formattedValue(o==null?void 0:o[(l=a.columns)==null?void 0:l[1]])||"-"),1)])])}),256))])])])])}const aR=wt(Dae,[["render",$ae]]),Gae=Object.freeze(Object.defineProperty({__proto__:null,default:aR},Symbol.toStringTag,{value:"Module"})),Uae={name:"VsProgressBar",mixins:[Fr],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const r=this.getValues();this.maxValue=Math.max(...r)},formattedValue(r){return xn(r)}}},Hae={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Wae={class:"h-full pt-0 pb-6 space-y-4"},Yae={class:"h-full space-y-4 custom-scrollbar"},qae={class:"flex items-center justify-between mr-2 gap-x-2"},Zae={class:"grid items-center w-full grid-cols-2 gap-x-2"},Xae={class:"text-sm text-gray-800"},jae={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},Kae={class:"min-w-[60px] text-end"},Qae={class:"text-sm text-gray-500"};function Jae(r,e,t,n,a,i){return a.columns?(d.openBlock(),d.createElementBlock("div",Hae,[d.createElementVNode("div",Wae,[d.createElementVNode("ul",Yae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>(d.openBlock(),d.createElementBlock("li",qae,[d.createElementVNode("div",Zae,[d.createElementVNode("span",Xae,d.toDisplayString(o[a.columns[0]]),1),d.createElementVNode("div",jae,[d.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:d.normalizeStyle({width:`${parseFloat(o[a.columns[1]])/a.maxValue*100}%`})},null,4)])]),d.createElementVNode("div",Kae,[d.createElementVNode("span",Qae,d.toDisplayString(i.formattedValue(o[a.columns[1]])),1)])]))),256))])])])):d.createCommentVNode("",!0)}const iR=wt(Uae,[["render",Jae]]),eie=Object.freeze(Object.defineProperty({__proto__:null,default:iR},Symbol.toStringTag,{value:"Module"})),tie={name:"VsListbar",mixins:[Fr],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(r){console.error(r)}},prepareData(){var e,t,n;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const r=(t=this.sourceData)==null?void 0:t.map(a=>{var i;return a==null?void 0:a[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...r||[]),this.restDimensions=(n=this.columns)==null?void 0:n.filter((a,i)=>i!==0)},formattedValue(r){return xn(r)},getWidth(r){return`${r/this.maxValue*100}%`}}},rie={class:"h-full pt-[20px] list-bar"},nie={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},aie={class:"relative w-full truncate"},iie={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},oie={class:"text-[14px] text-gray-500"};function sie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",rie,[d.createElementVNode("ul",nie,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>{var l,u,c;return d.openBlock(),d.createElementBlock("li",{key:s,class:"flex items-center justify-between w-full gap-x-2"},[d.createElementVNode("div",aie,[d.createElementVNode("span",iie,d.toDisplayString((o==null?void 0:o[(l=a.columns)==null?void 0:l[0]])||"Без категорії"),1),d.createElementVNode("div",{class:d.normalizeClass(["absolute inset-y-0 h-full rounded start-0",o!=null&&o[(u=a.columns)==null?void 0:u[0]]?"bg-indigo-100":"bg-gray-100"]),style:d.normalizeStyle({width:i.getWidth(o==null?void 0:o[(c=a.columns)==null?void 0:c[1]])})},null,6)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.restDimensions,(f,h)=>(d.openBlock(),d.createElementBlock("div",{key:h,class:"w-20 mr-2 text-end"},[d.createElementVNode("span",oie,d.toDisplayString(i.formattedValue(o==null?void 0:o[f])),1)]))),128))])}),128))])])}const oR=wt(tie,[["render",sie]]),lie=Object.freeze(Object.defineProperty({__proto__:null,default:oR},Symbol.toStringTag,{value:"Module"})),uie={name:"VsPivotTable",mixins:[Fr],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>Bc(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>xn(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},cie={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},die={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},fie={class:"inline-block min-w-full align-middle"},hie={class:"min-w-full divide-y divide-gray-200"},pie={class:"space-x-2"},gie={scope:"col",class:"xl:min-w-[120px] min-w-48"},vie={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},mie={class:"divide-y divide-gray-200 text-[12px]"},yie={class:"py-3 size-px whitespace-nowrap"},bie={class:"flex items-center gap-x-3"},_ie={class:"font-medium text-gray-800"},xie={class:"py-3 size-px whitespace-nowrap"},wie={class:"text-gray-600"};function Sie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",cie,[d.createElementVNode("div",die,[d.createElementVNode("div",fie,[d.createElementVNode("table",hie,[d.createElementVNode("thead",null,[d.createElementVNode("tr",pie,[e[0]||(e[0]=d.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[d.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.xs,o=>(d.openBlock(),d.createElementBlock("th",gie,[d.createElementVNode("div",vie,d.toDisplayString(o),1)]))),256))])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.values,o=>(d.openBlock(),d.createElementBlock("tbody",mie,[d.createElementVNode("tr",null,[d.createElementVNode("td",yie,[d.createElementVNode("div",bie,[d.createElementVNode("span",_ie,d.toDisplayString(o.name),1)])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.xs,(s,l)=>(d.openBlock(),d.createElementBlock("td",xie,[d.createElementVNode("span",wie,d.toDisplayString(o.data[l]),1)]))),256))])]))),256))])])])])}const sR=wt(uie,[["render",Sie]]),kie=Object.freeze(Object.defineProperty({__proto__:null,default:sR},Symbol.toStringTag,{value:"Module"})),Eie={name:"VsNumber",mixins:[Fr],data(){return{number:""}},computed:{formattedNumber(){return lae(this.number)},prefix(){var r,e;return(r=this.styleData)!=null&&r.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(r){console.error(r)}},async getNumber(){var r,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((r=this.sourceData)==null?void 0:r[0])])||0}catch(t){console.error(t)}}}},Cie={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function Tie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",Cie,d.toDisplayString(i.prefix)+d.toDisplayString(i.formattedNumber),1)}const Die=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Eie,[["render",Tie]])},Symbol.toStringTag,{value:"Module"})),Aie={name:"VsText",mixins:[Fr],data(){return{markedText:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget;try{await this.getData(),this.markedText=gt(this.sourceData)}catch(r){console.error(r)}},methods:{onChangedData(){return null}}},Mie=["id"],Nie=["innerHTML"];function Lie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:a.uniqueID,class:"relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"},[a.markedText?(d.openBlock(),d.createElementBlock("div",{key:0,innerHTML:a.markedText},null,8,Nie)):d.createCommentVNode("",!0)],8,Mie)}const Iie=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Aie,[["render",Lie]])},Symbol.toStringTag,{value:"Module"})),Bie={name:"VsFunnelBar",mixins:[Fr],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r}=this.prepareData();r&&this.initChart(r)},methods:{buildTooltipForDonut(r,e){const{name:t,value:n,percent:a}=r;return`
|
|
268
|
+
</div>`},prepareData(){var r,e,t,n,a;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(p=>p[this.dimensions[0]]))),o=Array.from(new Set((this.sourceData||[]).map(p=>p[this.dimensions[1]]))),s=parseInt((this.sourceData||[]).reduce((p,g)=>p+parseFloat(g==null?void 0:g.metric),0),10),l=i.map((p,g)=>{const v=(o[g]/s*100).toFixed(2);return{name:`${p} (${v}%)`,value:o[g]}}),u=((r=this.styleData)==null?void 0:r.innerRadius)||"0%",c=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",f=[u,c];return this.styleData.legend=kp.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:p=>p==null?void 0:p.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((t=this.styleData)==null?void 0:t.legend)||{}}),this.styleData.label=kp.getLabelOptions((n=this.styleData)==null?void 0:n.label),this.styleData.show_legend=((a=this.styleData)==null?void 0:a.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:f,center:["50%","60%"],height:"75%",...Jo(this.styleData),data:l}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=jf(e);const t={tooltip:{trigger:"item",formatter:n=>this.buildTooltipForDonut(n,[n.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...Jo(this.styleData||{})};this.chartInstance.setOption(t),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var n;(n=this.chartInstance)==null||n.resize()})}catch(e){console.error("Error in initChart:",e)}}}},_ae=["id"];function xae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,_ae)}const rR=wt(bae,[["render",xae]]),wae=Object.freeze(Object.defineProperty({__proto__:null,default:rR},Symbol.toStringTag,{value:"Module"})),Sae={name:"VsLine",mixins:[Fr],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r,xs:e}=this.prepareData();r&&this.initChart(r,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch(r){console.error(r)}},prepareData(){var r,e;try{const t=Array.from(new Set(this.sourceData.map(o=>o[this.dimensions[0]])));let n;this.dimensions[0].includes("date")?n=t.map(o=>Bc(o)):n=[...t];const a=this.sourceData.map(o=>parseFloat(o[this.dimensions[1]]));let i;return(r=this.styleData)!=null&&r.stack?i=this.dimensions.slice(1).map(s=>({name:s,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(l=>parseFloat(l[s])).map(l=>parseFloat(l[s]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:a,stack:"a"}],{series:i,xs:n}}catch(t){return console.error(t),null}}}},kae=["id"];function Eae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:a.uniqueID,ref:"chart",style:{height:"400px"}},null,8,kae)}const nR=wt(Sae,[["render",Eae]]),Cae=Object.freeze(Object.defineProperty({__proto__:null,default:nR},Symbol.toStringTag,{value:"Module"})),Tae={name:"VsStat",mixins:[Fr],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const r=this.getValues();this.sumValue=r.reduce((e,t)=>e+t,0),this.sourceData.forEach((e,t)=>{e.color=t<KV.length-1?KV[t]:cae()})},formattedValue(r){const e=parseFloat(r);return xn(e)}}},Dae={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},Aae={class:"flex flex-col justify-between w-full h-full"},Mae={class:"w-full h-full pb-6 space-y-4"},Nae={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},Lae=["onMouseover"],Iae={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},Bae={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},Vae={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},Rae={class:"flex items-center"},Pae={class:"text-sm text-gray-800"},Oae={class:"text-end"},zae={class:"text-sm text-gray-500"};function Fae(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",Dae,[d.createElementVNode("div",Aae,[d.createElementVNode("div",Mae,[d.createElementVNode("div",Nae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>{var l,u,c,f;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${o.color}]`]),style:d.normalizeStyle({width:`${parseFloat(o==null?void 0:o[(l=a.columns)==null?void 0:l[1]])/a.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:h=>a.showTooltip=s,onMouseleave:e[0]||(e[0]=h=>a.showTooltip=-1)},[a.showTooltip>-1?(d.openBlock(),d.createElementBlock("div",Iae,d.toDisplayString(r.sourceData[a.showTooltip][a.columns[0]])+" "+d.toDisplayString((parseFloat((f=(u=r.sourceData)==null?void 0:u[a.showTooltip])==null?void 0:f[(c=a.columns)==null?void 0:c[1]])/a.sumValue*100).toFixed(2))+"% ",1)):d.createCommentVNode("",!0)],46,Lae)}),256))]),d.createElementVNode("ul",Bae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,o=>{var s,l;return d.openBlock(),d.createElementBlock("li",Vae,[d.createElementVNode("div",Rae,[d.createElementVNode("span",{class:d.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${o.color}]`])},null,2),d.createElementVNode("span",Pae,d.toDisplayString((o==null?void 0:o[(s=a.columns)==null?void 0:s[0]])||"Не визначено"),1)]),d.createElementVNode("div",Oae,[d.createElementVNode("span",zae,d.toDisplayString(i.formattedValue(o==null?void 0:o[(l=a.columns)==null?void 0:l[1]])||"-"),1)])])}),256))])])])])}const aR=wt(Tae,[["render",Fae]]),$ae=Object.freeze(Object.defineProperty({__proto__:null,default:aR},Symbol.toStringTag,{value:"Module"})),Gae={name:"VsProgressBar",mixins:[Fr],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const r=this.getValues();this.maxValue=Math.max(...r)},formattedValue(r){return xn(r)}}},Uae={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Hae={class:"h-full pt-0 pb-6 space-y-4"},Wae={class:"h-full space-y-4 custom-scrollbar"},Yae={class:"flex items-center justify-between mr-2 gap-x-2"},qae={class:"grid items-center w-full grid-cols-2 gap-x-2"},Zae={class:"text-sm text-gray-800"},Xae={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},jae={class:"min-w-[60px] text-end"},Kae={class:"text-sm text-gray-500"};function Qae(r,e,t,n,a,i){return a.columns?(d.openBlock(),d.createElementBlock("div",Uae,[d.createElementVNode("div",Hae,[d.createElementVNode("ul",Wae,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>(d.openBlock(),d.createElementBlock("li",Yae,[d.createElementVNode("div",qae,[d.createElementVNode("span",Zae,d.toDisplayString(o[a.columns[0]]),1),d.createElementVNode("div",Xae,[d.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:d.normalizeStyle({width:`${parseFloat(o[a.columns[1]])/a.maxValue*100}%`})},null,4)])]),d.createElementVNode("div",jae,[d.createElementVNode("span",Kae,d.toDisplayString(i.formattedValue(o[a.columns[1]])),1)])]))),256))])])])):d.createCommentVNode("",!0)}const iR=wt(Gae,[["render",Qae]]),Jae=Object.freeze(Object.defineProperty({__proto__:null,default:iR},Symbol.toStringTag,{value:"Module"})),eie={name:"VsListbar",mixins:[Fr],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(r){console.error(r)}},prepareData(){var e,t,n;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const r=(t=this.sourceData)==null?void 0:t.map(a=>{var i;return a==null?void 0:a[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...r||[]),this.restDimensions=(n=this.columns)==null?void 0:n.filter((a,i)=>i!==0)},formattedValue(r){return xn(r)},getWidth(r){return`${r/this.maxValue*100}%`}}},tie={class:"h-full pt-[20px] list-bar"},rie={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},nie={class:"relative w-full truncate"},aie={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},iie={class:"text-[14px] text-gray-500"};function oie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",tie,[d.createElementVNode("ul",rie,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>{var l,u,c;return d.openBlock(),d.createElementBlock("li",{key:s,class:"flex items-center justify-between w-full gap-x-2"},[d.createElementVNode("div",nie,[d.createElementVNode("span",aie,d.toDisplayString((o==null?void 0:o[(l=a.columns)==null?void 0:l[0]])||"Без категорії"),1),d.createElementVNode("div",{class:d.normalizeClass(["absolute inset-y-0 h-full rounded start-0",o!=null&&o[(u=a.columns)==null?void 0:u[0]]?"bg-indigo-100":"bg-gray-100"]),style:d.normalizeStyle({width:i.getWidth(o==null?void 0:o[(c=a.columns)==null?void 0:c[1]])})},null,6)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.restDimensions,(f,h)=>(d.openBlock(),d.createElementBlock("div",{key:h,class:"w-20 mr-2 text-end"},[d.createElementVNode("span",iie,d.toDisplayString(i.formattedValue(o==null?void 0:o[f])),1)]))),128))])}),128))])])}const oR=wt(eie,[["render",oie]]),sie=Object.freeze(Object.defineProperty({__proto__:null,default:oR},Symbol.toStringTag,{value:"Module"})),lie={name:"VsPivotTable",mixins:[Fr],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>Bc(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>xn(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},uie={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},cie={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},die={class:"inline-block min-w-full align-middle"},fie={class:"min-w-full divide-y divide-gray-200"},hie={class:"space-x-2"},pie={scope:"col",class:"xl:min-w-[120px] min-w-48"},gie={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},vie={class:"divide-y divide-gray-200 text-[12px]"},mie={class:"py-3 size-px whitespace-nowrap"},yie={class:"flex items-center gap-x-3"},bie={class:"font-medium text-gray-800"},_ie={class:"py-3 size-px whitespace-nowrap"},xie={class:"text-gray-600"};function wie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",uie,[d.createElementVNode("div",cie,[d.createElementVNode("div",die,[d.createElementVNode("table",fie,[d.createElementVNode("thead",null,[d.createElementVNode("tr",hie,[e[0]||(e[0]=d.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[d.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.xs,o=>(d.openBlock(),d.createElementBlock("th",pie,[d.createElementVNode("div",gie,d.toDisplayString(o),1)]))),256))])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.values,o=>(d.openBlock(),d.createElementBlock("tbody",vie,[d.createElementVNode("tr",null,[d.createElementVNode("td",mie,[d.createElementVNode("div",yie,[d.createElementVNode("span",bie,d.toDisplayString(o.name),1)])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.xs,(s,l)=>(d.openBlock(),d.createElementBlock("td",_ie,[d.createElementVNode("span",xie,d.toDisplayString(o.data[l]),1)]))),256))])]))),256))])])])])}const sR=wt(lie,[["render",wie]]),Sie=Object.freeze(Object.defineProperty({__proto__:null,default:sR},Symbol.toStringTag,{value:"Module"})),kie={name:"VsNumber",mixins:[Fr],data(){return{number:""}},computed:{formattedNumber(){return sae(this.number)},prefix(){var r,e;return(r=this.styleData)!=null&&r.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(r){console.error(r)}},async getNumber(){var r,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((r=this.sourceData)==null?void 0:r[0])])||0}catch(t){console.error(t)}}}},Eie={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function Cie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",Eie,d.toDisplayString(i.prefix)+d.toDisplayString(i.formattedNumber),1)}const Tie=Object.freeze(Object.defineProperty({__proto__:null,default:wt(kie,[["render",Cie]])},Symbol.toStringTag,{value:"Module"})),Die={name:"VsText",mixins:[Fr],data(){return{markedText:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget;try{await this.getData(),this.markedText=gt(this.sourceData)}catch(r){console.error(r)}},methods:{onChangedData(){return null}}},Aie=["id"],Mie=["innerHTML"];function Nie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{id:a.uniqueID,class:"relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"},[a.markedText?(d.openBlock(),d.createElementBlock("div",{key:0,innerHTML:a.markedText},null,8,Mie)):d.createCommentVNode("",!0)],8,Aie)}const Lie=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Die,[["render",Nie]])},Symbol.toStringTag,{value:"Module"})),Iie={name:"VsFunnelBar",mixins:[Fr],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r}=this.prepareData();r&&this.initChart(r)},methods:{buildTooltipForDonut(r,e){const{name:t,value:n,percent:a}=r;return`
|
|
269
269
|
<div style="background-color:${e[0]};font-size: 12px; font-family: Helvetica, Arial, sans-serif;color:#ffff; padding:5px; border-radius:5px; ![box-shadow:none]">
|
|
270
270
|
${Bc(t)}: ${xn(n)} (${a}%)
|
|
271
|
-
</div>`},onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]]))),e=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[1]]))),t=r.map((a,i)=>({name:a,value:e[i]}));return{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"funnel",...Jo(this.styleData),data:t,height:"80%",emphasis:{label:{show:!1}}}]}}catch(r){console.error(r)}},async initChart(r){try{const e=this.$refs.chart,t=jf(e),n={series:r,...Jo(this.styleData),tooltip:{trigger:"item",formatter:a=>this.buildTooltipForDonut(a,[a.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[10,15],shadowColor:"transparent",backgroundColor:"transparent"},itemStyle:{height:"15px"},legend:{borderRadius:10,type:"scroll",itemWidth:14,itemHeight:14,...this.styleData.legend},labelLine:{show:!1},grid:{bottom:"0"}};t.setOption(n),t.resize(),window.addEventListener("resize",()=>{t.resize()})}catch(e){console.error(e)}}}},Vie=["id"];function Rie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{ref:"chart",id:a.uniqueID,class:"h-[90%] custom-scrollbar min-h-[200px]"},null,8,Vie)}const Pie=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Bie,[["render",Rie]])},Symbol.toStringTag,{value:"Module"}));function Oie(r){return[{type:"fill",paint:{"fill-color":r.color||"#ccc","fill-outline-color":r.color||"blue","fill-opacity":r.opacity||1}}]}function zie(r){return[{type:"line",paint:{"line-color":r.color||"#ccc","line-opacity":r.opacity||1}}]}function Fie(r){return[{type:"circle",paint:{"circle-radius":r.radius||6,"circle-stroke-color":r.stroke||"#ccc","circle-stroke-width":r.width||1,"circle-color":r.color||"blue"}}]}function lR(r){if(!r)return null;const e=r.type||"point";return e==="polygon"?Oie(r):e==="line"?zie(r):Fie(r)}const M1={data(){return{layerList:[],activeLayer:""}},computed:{interactiveSources(){return this.layerList.filter(r=>r==null?void 0:r.interactive).map(r=>r.id)}},methods:{moveLayer(r,e=this.map){e.getStyle().layers.forEach(t=>{t.id.match(r)&&e.moveLayer(t.id)})},async setVisible(r,e=!0,t=this.map){if(!r)return;const n=(r==null?void 0:r.id)||r,a=this.layerList.find(o=>o.id===r)||r;if(!(a!=null&&a.id))throw new Error("MixinError: Layer has no id");const i=t.getStyle().layers.filter(o=>o.id.match(n));i.forEach(o=>{t.setLayoutProperty(o.id,"visibility",e?"visible":"none")}),!i.length&&e&&await this.addLayer(a)},async addLayer(r,e=this==null?void 0:this.map){var a,i;const t=this.layerList.find(o=>o.id===r)||r;!this.map.getStyle()||this.map.getStyle().layers.find(o=>o.id===t.id)||(this.layerList.find(o=>o.id===t.id)||this.layerList.push(t),(t.service==="vtile"||t.service==="vector"||(a=t.url)!=null&&a.includes(".vmt"))&&this.addVtileLayer(t,e),t.service==="geojson"&&this.addGeoJsonLayer(t,e),((i=t.url)!=null&&i.includes(".png")||["tms","raster"].includes(t.service))&&await this.addRasterLayer(t,e))},async addRasterLayer(r,e=this==null?void 0:this.map){var t,n;e.getSource(r.id)||(await e.addSource(r.id,{type:"raster",tiles:[r==null?void 0:r.url],tileSize:256,...r!=null&&r.scheme?{scheme:r==null?void 0:r.scheme}:{}}),await e.addLayer({id:r.id,type:"raster",source:r.id,minzoom:0,maxzoom:(r==null?void 0:r.maxzoom)||22},r.basemap?(n=(t=this.map.getStyle().layers)==null?void 0:t[0])==null?void 0:n.id:null))},async addVtileLayer(r,e=this==null?void 0:this.map){var i;const t=["props","pointZoom"].filter(o=>r[o]).map(o=>`&${o}=${r[o]}`),n={type:"vector",tiles:[`${(i=r==null?void 0:r.url)!=null&&i.startsWith("http")?"":window.location.origin}${r==null?void 0:r.url}${t}`],minzoom:r.minzoom||3,maxzoom:r.maxzoom||24};e.addSource(r.id,n),(lR(r.style)||r.layers||[]).forEach((o,s)=>{const l={...o,id:`${r.id}-${s}`,source:r.id,"source-layer":o["source-layer"]||r.source||r.id,maxzoom:+o.maxzoom||24,minzoom:+o.minzoom||0};e.addLayer(l)})},async addGeoJsonLayer(r,e=this.map){var a;const t=r.data||((a=r==null?void 0:r.url)!=null&&a.startsWith("http")?"":window.location.origin)+r.url;e.addSource(r.id,{type:"geojson",data:t}),(lR(r.style)||r.layers||[]).forEach(i=>{const o={...i,source:r.id,id:i.id||r.id,maxzoom:+i.maxzoom||24,minzoom:+i.minzoom||0,type:i.type||"circle"};e.addLayer(o)})},setLayerData(r,e){this.layerList=this.layerList.map(t=>t.id===r?{...t,...e}:t)},async removeLayer(r,e=this.map){e.getSource(r)&&(await e.getStyle().layers.forEach(async t=>{t.source===r&&await e.removeLayer(t.id)}),await e.removeSource(r))},async setFilter(r,e){var a;const t=this.layerList.find(i=>i.id===r),n=await((a=this.map)==null?void 0:a.getSource(r));if(n&&t.service==="vtile"){await n.setTiles([`${window.location.origin}${t.url}${t.url.includes("?")?"&":"?"}filter=${e}${t.props?`&props=${t.props}`:""}`]);return}n&&t.service},async changeBaseLayer(r){const e=r!=null&&r.id?r:this.layerList.find(n=>n.id===r),{id:t}=e;if(t&&t!==this.activeLayer){if(this.activeLayer&&this.map.setLayoutProperty(this.activeLayer,"visibility","none"),this.activeLayer=t,this.map.getLayer(t)){this.map.setLayoutProperty(t,"visibility","visible");return}await this.addRasterLayer(e)}},async refreshLayer(r,e=this.map){await e.getStyle().layers.forEach(t=>{t.source===r&&e.removeLayer(t.id)}),await e.removeSource(r),this.setVisible(r)}}},$ie="https://unpkg.com/maplibre-gl@5.6.2/dist/maplibre-gl.js",Gie="https://unpkg.com/maplibre-gl@5.6.2/dist/maplibre-gl.css";let Ep=null;function Uie(r){return new Promise((e,t)=>{if(document.querySelector(`script[src="${r}"]`)){e();return}const n=document.createElement("script");n.src=r,n.onload=()=>e(),n.onerror=()=>t(new Error(`Failed to load ${r}`)),document.head.appendChild(n)})}function Hie(r){return new Promise((e,t)=>{if(document.querySelector(`link[href="${r}"]`)){e();return}const n=document.createElement("link");n.rel="stylesheet",n.href=r,n.onload=()=>e(),n.onerror=()=>t(new Error(`Failed to load ${r}`)),document.head.appendChild(n)})}function uR(){return typeof window>"u"?Promise.resolve(null):window.maplibregl?Promise.resolve(window.maplibregl):Ep||(Ep=Hie(Gie).then(()=>Uie($ie)).then(()=>window.maplibregl),Ep)}const N1={__name:"legend",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(FP),d.mergeProps(e.$attrs,{size:24}),null,16))}},L1={pink:["#fde7e2","#feafbe","#fd58a4","#d7038e","#86007b"],blue:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],green:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],pink2:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],red:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],teal:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"]},Wie={components:{legendIcon:N1,closeIcon:Xp},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:L1}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((r,e)=>r-e)},maxWidht(){var t;const r=((t=this.sizes)==null?void 0:t.length)-1;return this.calcSize(r)}},methods:{sizeClass(r){return this.resizeItem?`h-[${this.calcSize(r)}] w-[${this.calcSize(r)}] ${this.borderRadius}`:`h-[18px] w-[18px] ${this.borderRadius}`},calcSize(r){return`${10+r*2}px`},getOpacity(r){return(r+1)/this.sortedSizes.length}}},Yie={class:"w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]"},qie={class:"flex items-center justify-between border-b border-[#0000001A] px-2"},Zie={class:"w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Xie={key:0,class:"flex flex-col w-full"},jie={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},Kie={class:"flex flex-col gap-[6px]"},Qie={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"},Jie={key:1,class:"flex flex-col w-full"},eoe={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},toe={class:"flex flex-col gap-[6px]"},roe={class:"flex flex-row items-center justify-start"},noe={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"};function aoe(r,e,t,n,a,i){var l,u;const o=d.resolveComponent("legendIcon"),s=d.resolveComponent("closeIcon");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",onClick:e[0]||(e[0]=c=>a.isOpenLegend=!a.isOpenLegend)},[d.createVNode(o)]),a.isOpenLegend?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:`#wrapper-${t.mapId}`},[d.createElementVNode("div",Yie,[d.createElementVNode("div",qie,[e[2]||(e[2]=d.createElementVNode("h3",{class:"text-[16px] font-normal text-black"},"Легенда",-1)),d.createElementVNode("button",{type:"button",class:"inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",onClick:e[1]||(e[1]=c=>a.isOpenLegend=!1)},[d.createVNode(s,{class:"w-[20px]"})])]),d.createElementVNode("div",Zie,[(l=t.colors)!=null&&l.length?(d.openBlock(),d.createElementBlock("div",Xie,[t.colorTitle?(d.openBlock(),d.createElementBlock("h4",jie,d.toDisplayString(t.colorTitle),1)):d.createCommentVNode("",!0),d.createElementVNode("div",Kie,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.colors,(c,f)=>(d.openBlock(),d.createElementBlock("div",{key:f,class:"flex items-center gap-[10px]"},[c.color?(d.openBlock(),d.createElementBlock("div",{key:0,class:"w-[12px] h-[12px] rounded-full",style:d.normalizeStyle({backgroundColor:c.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("p",Qie,d.toDisplayString(c.text||c.val),1)]))),128))])])):d.createCommentVNode("",!0),(u=t.sizes)!=null&&u.length?(d.openBlock(),d.createElementBlock("div",Jie,[r.sizeTitle?(d.openBlock(),d.createElementBlock("h4",eoe,d.toDisplayString(r.sizeTitle),1)):d.createCommentVNode("",!0),d.createElementVNode("div",toe,[i.sortedSizes.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(i.sortedSizes,(c,f)=>{var h,p,g,v,m;return d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",roe,[d.createElementVNode("div",{class:d.normalizeClass([i.maxWidht?`w-[${i.maxWidht}]`:"","mr-[10px]"])},[d.createElementVNode("div",{class:d.normalizeClass(i.sizeClass(f)),style:d.normalizeStyle({backgroundColor:((p=(h=a.palette)==null?void 0:h[t.color])==null?void 0:p[f])||t.color})},null,6)],2),d.createElementVNode("p",noe,d.toDisplayString(f===((g=i.sortedSizes)==null?void 0:g.length)-1?">"+c:f==((v=i.sortedSizes)==null?void 0:v.length)-1?">"+i.sortedSizes[((m=i.sortedSizes)==null?void 0:m.length)-1]:c+"-"+i.sortedSizes[f+1]),1)])])}),256)):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0)])])],8,["to"])):d.createCommentVNode("",!0)],64)}const ioe=wt(Wie,[["render",aoe]]),ooe={props:["map","coordinates"],data(){return{isMenuVisible:!1}},computed:{getCoordinates(){var e;return!(this!=null&&this.coordinates)||((e=this.coordinates)==null?void 0:e.length)!==2?"":(this==null?void 0:this.coordinates).slice().reverse().map(t=>Number(t).toFixed(5)).join(", ")}}},soe={class:"map__settings"},loe={ref:"attribution",class:"map__settings-attribution map__settings-item mt-[3px]"};function uoe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",soe,[d.createElementVNode("div",loe,[d.withDirectives(d.createElementVNode("div",{ref:"mouse",class:"map__settings-item",style:{"min-width":"115px"}},d.toDisplayString(i.getCoordinates),513),[[d.vShow,i.getCoordinates]])],512)])}const cR=wt(ooe,[["render",uoe]]),coe={mixins:[M1],props:{map:{type:Object,default:()=>null}},data(){return{baseLayers:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png"},{id:"graymap",name:"Сіра карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/positron/ua/10/601/348.png"}]}},watch:{map(r){r&&r.on("load",this.handleMapLoad)}},created(){this.baseLayers.forEach(r=>{const e={...r,basemap:!0};this.layerList.push(e)})},methods:{handleMapLoad(){this.changeBaseLayer("graymap")},isLayerInFocus(r){return r.id===this.activeLayer}}},doe={class:"vs-map-slot-layers"},foe=["onClick"],hoe=["src"];function poe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",doe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.baseLayers,o=>(d.openBlock(),d.createElementBlock("div",{key:o.id,class:d.normalizeClass(["vs-map-slot-layers__layer",{focused:i.isLayerInFocus(o)}]),onClick:s=>r.changeBaseLayer(o.id)},[d.createElementVNode("img",{src:o.image,class:"vs-map-slot-layers__image"},null,8,hoe)],10,foe))),128))])}const dR=wt(coe,[["render",poe]]);function fR(r,e,t){if(r!==null)for(var n,a,i,o,s,l,u,c=0,f=0,h,p=r.type,g=p==="FeatureCollection",v=p==="Feature",m=g?r.features.length:1,y=0;y<m;y++){u=g?r.features[y].geometry:v?r.geometry:r,h=u?u.type==="GeometryCollection":!1,s=h?u.geometries.length:1;for(var b=0;b<s;b++){var _=0,x=0;if(o=h?u.geometries[b]:u,o!==null){l=o.coordinates;var w=o.type;switch(c=0,w){case null:break;case"Point":if(e(l,f,y,_,x)===!1)return!1;f++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(e(l[n],f,y,_,x)===!1)return!1;f++,w==="MultiPoint"&&_++}w==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(a=0;a<l[n].length-c;a++){if(e(l[n][a],f,y,_,x)===!1)return!1;f++}w==="MultiLineString"&&_++,w==="Polygon"&&x++}w==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,a=0;a<l[n].length;a++){for(i=0;i<l[n][a].length-c;i++){if(e(l[n][a][i],f,y,_,x)===!1)return!1;f++}x++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(fR(o.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function goe(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;const t=[1/0,1/0,-1/0,-1/0];return fR(r,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}const voe={props:["bbox","map"],components:{homeIcon:{__name:"home",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(zP),d.mergeProps(e.$attrs,{size:24}),null,16))}}},methods:{setBounds(){const r={type:"Feature",geometry:this==null?void 0:this.bbox},e=goe(r);this.map.fitBounds(e)}}},moe={class:"z-100 flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]"};function yoe(r,e,t,n,a,i){const o=d.resolveComponent("homeIcon");return d.openBlock(),d.createElementBlock("div",moe,[d.createVNode(o,{onClick:i.setBounds},null,8,["onClick"])])}const hR=wt(voe,[["render",yoe]]),boe={components:{legendIcon:N1,menuIcon:{__name:"menu",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(OP),d.mergeProps(e.$attrs,{size:24}),null,16))}},closeIcon:Xp},props:["source","count","total","mapId"],data(){return{isOpenLegend:!1,palette:["#69D2E7","yellow","#FE4365"]}},methods:{calcSize(r){return r/this.maxValue*100*50/100}},computed:{maxValue(){var r,e,t,n,a,i;return((r=this.sizes)==null?void 0:r[0])>((t=this.sizes)==null?void 0:t[((e=this.sizes)==null?void 0:e.length)-1])?(n=this.sizes)==null?void 0:n[0]:(i=this.sizes)==null?void 0:i[((a=this.sizes)==null?void 0:a.length)-1]}}},_oe={class:"w-full h-[calc(100%-40px)] bg-white"},xoe={class:"w-full flex flex-col gap-[8px] h-[250px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent text-xs"},woe={class:"relative min-w-full bg-white text-[12px]"},Soe={class:"divide-gray-200 dark:divide-neutral-700"},koe={class:"px-2 py-1"},Eoe={class:"px-2 py-1"};function Coe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",_oe,[d.createElementVNode("div",xoe,[d.createElementVNode("table",woe,[e[0]||(e[0]=d.createElementVNode("thead",{class:"sticky top-[-1px] z-[1] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},[d.createElementVNode("tr",null,[d.createElementVNode("th",{class:"px-2 py-1 text-start"},"Назва"),d.createElementVNode("th",{class:"px-2 py-1 text-start"},"Метрика")])],-1)),d.createElementVNode("tbody",Soe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.source,o=>(d.openBlock(),d.createElementBlock("tr",{key:o.id,class:"border-b cursor-pointer hover:bg-gray-100 odd:bg-gray-50"},[d.createElementVNode("td",koe,d.toDisplayString(o.title||"—"),1),d.createElementVNode("td",Eoe,d.toDisplayString(o.metric),1)]))),128))])])])])}const pR=wt(boe,[["render",Coe]]),Toe={mixins:[Fr,M1,{components:{VsMapSetting:cR,VsMapSlotLayers:dR,VsMapLegend:ioe,VsMapGoHome:hR,VsList:pR},data(){return{mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7"}},methods:{async createMap(){var t,n;const r=await uR();if(!r)return;const e={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new r.Map({container:this.mapId,style:e,center:[31,48.5],zoom:((n=(t=this.data)==null?void 0:t.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new r.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",a=>{this.moveMouseHadler(a)}),this.map.on("mouseout",()=>{var a;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(a=this.popup)==null||a.remove()})},getPopoverTitle(r){var e,t,n,a,i;return(t=(e=this.data)==null?void 0:e.colors)!=null&&t.find(o=>o.val===r)?(i=(a=(n=this.data)==null?void 0:n.colors)==null?void 0:a.find(o=>o.val===r))==null?void 0:i.text:r},moveMouseHadler(r){var e;try{const t=this.map.queryRenderedFeatures(r.point),n=((e=t[0])==null?void 0:e.properties)||{};if(!t.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
|
|
271
|
+
</div>`},onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]]))),e=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[1]]))),t=r.map((a,i)=>({name:a,value:e[i]}));return{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"funnel",...Jo(this.styleData),data:t,height:"80%",emphasis:{label:{show:!1}}}]}}catch(r){console.error(r)}},async initChart(r){try{const e=this.$refs.chart,t=jf(e),n={series:r,...Jo(this.styleData),tooltip:{trigger:"item",formatter:a=>this.buildTooltipForDonut(a,[a.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[10,15],shadowColor:"transparent",backgroundColor:"transparent"},itemStyle:{height:"15px"},legend:{borderRadius:10,type:"scroll",itemWidth:14,itemHeight:14,...this.styleData.legend},labelLine:{show:!1},grid:{bottom:"0"}};t.setOption(n),t.resize(),window.addEventListener("resize",()=>{t.resize()})}catch(e){console.error(e)}}}},Bie=["id"];function Vie(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{ref:"chart",id:a.uniqueID,class:"h-[90%] custom-scrollbar min-h-[200px]"},null,8,Bie)}const Rie=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Iie,[["render",Vie]])},Symbol.toStringTag,{value:"Module"}));function Pie(r){return[{type:"fill",paint:{"fill-color":r.color||"#ccc","fill-outline-color":r.color||"blue","fill-opacity":r.opacity||1}}]}function Oie(r){return[{type:"line",paint:{"line-color":r.color||"#ccc","line-opacity":r.opacity||1}}]}function zie(r){return[{type:"circle",paint:{"circle-radius":r.radius||6,"circle-stroke-color":r.stroke||"#ccc","circle-stroke-width":r.width||1,"circle-color":r.color||"blue"}}]}function lR(r){if(!r)return null;const e=r.type||"point";return e==="polygon"?Pie(r):e==="line"?Oie(r):zie(r)}const M1={data(){return{layerList:[],activeLayer:""}},computed:{interactiveSources(){return this.layerList.filter(r=>r==null?void 0:r.interactive).map(r=>r.id)}},methods:{moveLayer(r,e=this.map){e.getStyle().layers.forEach(t=>{t.id.match(r)&&e.moveLayer(t.id)})},async setVisible(r,e=!0,t=this.map){if(!r)return;const n=(r==null?void 0:r.id)||r,a=this.layerList.find(o=>o.id===r)||r;if(!(a!=null&&a.id))throw new Error("MixinError: Layer has no id");const i=t.getStyle().layers.filter(o=>o.id.match(n));i.forEach(o=>{t.setLayoutProperty(o.id,"visibility",e?"visible":"none")}),!i.length&&e&&await this.addLayer(a)},async addLayer(r,e=this==null?void 0:this.map){var a,i;const t=this.layerList.find(o=>o.id===r)||r;!this.map.getStyle()||this.map.getStyle().layers.find(o=>o.id===t.id)||(this.layerList.find(o=>o.id===t.id)||this.layerList.push(t),(t.service==="vtile"||t.service==="vector"||(a=t.url)!=null&&a.includes(".vmt"))&&this.addVtileLayer(t,e),t.service==="geojson"&&this.addGeoJsonLayer(t,e),((i=t.url)!=null&&i.includes(".png")||["tms","raster"].includes(t.service))&&await this.addRasterLayer(t,e))},async addRasterLayer(r,e=this==null?void 0:this.map){var t,n;e.getSource(r.id)||(await e.addSource(r.id,{type:"raster",tiles:[r==null?void 0:r.url],tileSize:256,...r!=null&&r.scheme?{scheme:r==null?void 0:r.scheme}:{}}),await e.addLayer({id:r.id,type:"raster",source:r.id,minzoom:0,maxzoom:(r==null?void 0:r.maxzoom)||22},r.basemap?(n=(t=this.map.getStyle().layers)==null?void 0:t[0])==null?void 0:n.id:null))},async addVtileLayer(r,e=this==null?void 0:this.map){var i;const t=["props","pointZoom"].filter(o=>r[o]).map(o=>`&${o}=${r[o]}`),n={type:"vector",tiles:[`${(i=r==null?void 0:r.url)!=null&&i.startsWith("http")?"":window.location.origin}${r==null?void 0:r.url}${t}`],minzoom:r.minzoom||3,maxzoom:r.maxzoom||24};e.addSource(r.id,n),(lR(r.style)||r.layers||[]).forEach((o,s)=>{const l={...o,id:`${r.id}-${s}`,source:r.id,"source-layer":o["source-layer"]||r.source||r.id,maxzoom:+o.maxzoom||24,minzoom:+o.minzoom||0};e.addLayer(l)})},async addGeoJsonLayer(r,e=this.map){var a;const t=r.data||((a=r==null?void 0:r.url)!=null&&a.startsWith("http")?"":window.location.origin)+r.url;e.addSource(r.id,{type:"geojson",data:t}),(lR(r.style)||r.layers||[]).forEach(i=>{const o={...i,source:r.id,id:i.id||r.id,maxzoom:+i.maxzoom||24,minzoom:+i.minzoom||0,type:i.type||"circle"};e.addLayer(o)})},setLayerData(r,e){this.layerList=this.layerList.map(t=>t.id===r?{...t,...e}:t)},async removeLayer(r,e=this.map){e.getSource(r)&&(await e.getStyle().layers.forEach(async t=>{t.source===r&&await e.removeLayer(t.id)}),await e.removeSource(r))},async setFilter(r,e){var a;const t=this.layerList.find(i=>i.id===r),n=await((a=this.map)==null?void 0:a.getSource(r));if(n&&t.service==="vtile"){await n.setTiles([`${window.location.origin}${t.url}${t.url.includes("?")?"&":"?"}filter=${e}${t.props?`&props=${t.props}`:""}`]);return}n&&t.service},async changeBaseLayer(r){const e=r!=null&&r.id?r:this.layerList.find(n=>n.id===r),{id:t}=e;if(t&&t!==this.activeLayer){if(this.activeLayer&&this.map.setLayoutProperty(this.activeLayer,"visibility","none"),this.activeLayer=t,this.map.getLayer(t)){this.map.setLayoutProperty(t,"visibility","visible");return}await this.addRasterLayer(e)}},async refreshLayer(r,e=this.map){await e.getStyle().layers.forEach(t=>{t.source===r&&e.removeLayer(t.id)}),await e.removeSource(r),this.setVisible(r)}}},Fie="https://unpkg.com/maplibre-gl@5.6.2/dist/maplibre-gl.js",$ie="https://unpkg.com/maplibre-gl@5.6.2/dist/maplibre-gl.css";let Ep=null;function Gie(r){return new Promise((e,t)=>{if(document.querySelector(`script[src="${r}"]`)){e();return}const n=document.createElement("script");n.src=r,n.onload=()=>e(),n.onerror=()=>t(new Error(`Failed to load ${r}`)),document.head.appendChild(n)})}function Uie(r){return new Promise((e,t)=>{if(document.querySelector(`link[href="${r}"]`)){e();return}const n=document.createElement("link");n.rel="stylesheet",n.href=r,n.onload=()=>e(),n.onerror=()=>t(new Error(`Failed to load ${r}`)),document.head.appendChild(n)})}function uR(){return typeof window>"u"?Promise.resolve(null):window.maplibregl?Promise.resolve(window.maplibregl):Ep||(Ep=Uie($ie).then(()=>Gie(Fie)).then(()=>window.maplibregl),Ep)}const N1={__name:"legend",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(FP),d.mergeProps(e.$attrs,{size:24}),null,16))}},L1={pink:["#fde7e2","#feafbe","#fd58a4","#d7038e","#86007b"],blue:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],green:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],pink2:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],red:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],teal:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"]},Hie={components:{legendIcon:N1,closeIcon:Xp},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:L1}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((r,e)=>r-e)},maxWidht(){var t;const r=((t=this.sizes)==null?void 0:t.length)-1;return this.calcSize(r)}},methods:{sizeClass(r){return this.resizeItem?`h-[${this.calcSize(r)}] w-[${this.calcSize(r)}] ${this.borderRadius}`:`h-[18px] w-[18px] ${this.borderRadius}`},calcSize(r){return`${10+r*2}px`},getOpacity(r){return(r+1)/this.sortedSizes.length}}},Wie={class:"w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]"},Yie={class:"flex items-center justify-between border-b border-[#0000001A] px-2"},qie={class:"w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Zie={key:0,class:"flex flex-col w-full"},Xie={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},jie={class:"flex flex-col gap-[6px]"},Kie={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"},Qie={key:1,class:"flex flex-col w-full"},Jie={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},eoe={class:"flex flex-col gap-[6px]"},toe={class:"flex flex-row items-center justify-start"},roe={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"};function noe(r,e,t,n,a,i){var l,u;const o=d.resolveComponent("legendIcon"),s=d.resolveComponent("closeIcon");return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",onClick:e[0]||(e[0]=c=>a.isOpenLegend=!a.isOpenLegend)},[d.createVNode(o)]),a.isOpenLegend?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:`#wrapper-${t.mapId}`},[d.createElementVNode("div",Wie,[d.createElementVNode("div",Yie,[e[2]||(e[2]=d.createElementVNode("h3",{class:"text-[16px] font-normal text-black"},"Легенда",-1)),d.createElementVNode("button",{type:"button",class:"inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",onClick:e[1]||(e[1]=c=>a.isOpenLegend=!1)},[d.createVNode(s,{class:"w-[20px]"})])]),d.createElementVNode("div",qie,[(l=t.colors)!=null&&l.length?(d.openBlock(),d.createElementBlock("div",Zie,[t.colorTitle?(d.openBlock(),d.createElementBlock("h4",Xie,d.toDisplayString(t.colorTitle),1)):d.createCommentVNode("",!0),d.createElementVNode("div",jie,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.colors,(c,f)=>(d.openBlock(),d.createElementBlock("div",{key:f,class:"flex items-center gap-[10px]"},[c.color?(d.openBlock(),d.createElementBlock("div",{key:0,class:"w-[12px] h-[12px] rounded-full",style:d.normalizeStyle({backgroundColor:c.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("p",Kie,d.toDisplayString(c.text||c.val),1)]))),128))])])):d.createCommentVNode("",!0),(u=t.sizes)!=null&&u.length?(d.openBlock(),d.createElementBlock("div",Qie,[r.sizeTitle?(d.openBlock(),d.createElementBlock("h4",Jie,d.toDisplayString(r.sizeTitle),1)):d.createCommentVNode("",!0),d.createElementVNode("div",eoe,[i.sortedSizes.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(i.sortedSizes,(c,f)=>{var h,p,g,v,m;return d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",toe,[d.createElementVNode("div",{class:d.normalizeClass([i.maxWidht?`w-[${i.maxWidht}]`:"","mr-[10px]"])},[d.createElementVNode("div",{class:d.normalizeClass(i.sizeClass(f)),style:d.normalizeStyle({backgroundColor:((p=(h=a.palette)==null?void 0:h[t.color])==null?void 0:p[f])||t.color})},null,6)],2),d.createElementVNode("p",roe,d.toDisplayString(f===((g=i.sortedSizes)==null?void 0:g.length)-1?">"+c:f==((v=i.sortedSizes)==null?void 0:v.length)-1?">"+i.sortedSizes[((m=i.sortedSizes)==null?void 0:m.length)-1]:c+"-"+i.sortedSizes[f+1]),1)])])}),256)):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0)])])],8,["to"])):d.createCommentVNode("",!0)],64)}const aoe=wt(Hie,[["render",noe]]),ioe={props:["map","coordinates"],data(){return{isMenuVisible:!1}},computed:{getCoordinates(){var e;return!(this!=null&&this.coordinates)||((e=this.coordinates)==null?void 0:e.length)!==2?"":(this==null?void 0:this.coordinates).slice().reverse().map(t=>Number(t).toFixed(5)).join(", ")}}},ooe={class:"map__settings"},soe={ref:"attribution",class:"map__settings-attribution map__settings-item mt-[3px]"};function loe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",ooe,[d.createElementVNode("div",soe,[d.withDirectives(d.createElementVNode("div",{ref:"mouse",class:"map__settings-item",style:{"min-width":"115px"}},d.toDisplayString(i.getCoordinates),513),[[d.vShow,i.getCoordinates]])],512)])}const cR=wt(ioe,[["render",loe]]),uoe={mixins:[M1],props:{map:{type:Object,default:()=>null}},data(){return{baseLayers:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png"},{id:"graymap",name:"Сіра карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/positron/ua/10/601/348.png"}]}},watch:{map(r){r&&r.on("load",this.handleMapLoad)}},created(){this.baseLayers.forEach(r=>{const e={...r,basemap:!0};this.layerList.push(e)})},methods:{handleMapLoad(){this.changeBaseLayer("graymap")},isLayerInFocus(r){return r.id===this.activeLayer}}},coe={class:"vs-map-slot-layers"},doe=["onClick"],foe=["src"];function hoe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",coe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.baseLayers,o=>(d.openBlock(),d.createElementBlock("div",{key:o.id,class:d.normalizeClass(["vs-map-slot-layers__layer",{focused:i.isLayerInFocus(o)}]),onClick:s=>r.changeBaseLayer(o.id)},[d.createElementVNode("img",{src:o.image,class:"vs-map-slot-layers__image"},null,8,foe)],10,doe))),128))])}const dR=wt(uoe,[["render",hoe]]);function fR(r,e,t){if(r!==null)for(var n,a,i,o,s,l,u,c=0,f=0,h,p=r.type,g=p==="FeatureCollection",v=p==="Feature",m=g?r.features.length:1,y=0;y<m;y++){u=g?r.features[y].geometry:v?r.geometry:r,h=u?u.type==="GeometryCollection":!1,s=h?u.geometries.length:1;for(var b=0;b<s;b++){var _=0,x=0;if(o=h?u.geometries[b]:u,o!==null){l=o.coordinates;var w=o.type;switch(c=0,w){case null:break;case"Point":if(e(l,f,y,_,x)===!1)return!1;f++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(e(l[n],f,y,_,x)===!1)return!1;f++,w==="MultiPoint"&&_++}w==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(a=0;a<l[n].length-c;a++){if(e(l[n][a],f,y,_,x)===!1)return!1;f++}w==="MultiLineString"&&_++,w==="Polygon"&&x++}w==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,a=0;a<l[n].length;a++){for(i=0;i<l[n][a].length-c;i++){if(e(l[n][a][i],f,y,_,x)===!1)return!1;f++}x++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(fR(o.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function poe(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;const t=[1/0,1/0,-1/0,-1/0];return fR(r,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}const goe={props:["bbox","map"],components:{homeIcon:{__name:"home",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(zP),d.mergeProps(e.$attrs,{size:24}),null,16))}}},methods:{setBounds(){const r={type:"Feature",geometry:this==null?void 0:this.bbox},e=poe(r);this.map.fitBounds(e)}}},voe={class:"z-100 flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]"};function moe(r,e,t,n,a,i){const o=d.resolveComponent("homeIcon");return d.openBlock(),d.createElementBlock("div",voe,[d.createVNode(o,{onClick:i.setBounds},null,8,["onClick"])])}const hR=wt(goe,[["render",moe]]),yoe={components:{legendIcon:N1,menuIcon:{__name:"menu",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref(OP),d.mergeProps(e.$attrs,{size:24}),null,16))}},closeIcon:Xp},props:["source","count","total","mapId"],data(){return{isOpenLegend:!1,palette:["#69D2E7","yellow","#FE4365"]}},methods:{calcSize(r){return r/this.maxValue*100*50/100}},computed:{maxValue(){var r,e,t,n,a,i;return((r=this.sizes)==null?void 0:r[0])>((t=this.sizes)==null?void 0:t[((e=this.sizes)==null?void 0:e.length)-1])?(n=this.sizes)==null?void 0:n[0]:(i=this.sizes)==null?void 0:i[((a=this.sizes)==null?void 0:a.length)-1]}}},boe={class:"w-full h-[calc(100%-40px)] bg-white"},_oe={class:"w-full flex flex-col gap-[8px] h-[250px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent text-xs"},xoe={class:"relative min-w-full bg-white text-[12px]"},woe={class:"divide-gray-200 dark:divide-neutral-700"},Soe={class:"px-2 py-1"},koe={class:"px-2 py-1"};function Eoe(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",boe,[d.createElementVNode("div",_oe,[d.createElementVNode("table",xoe,[e[0]||(e[0]=d.createElementVNode("thead",{class:"sticky top-[-1px] z-[1] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},[d.createElementVNode("tr",null,[d.createElementVNode("th",{class:"px-2 py-1 text-start"},"Назва"),d.createElementVNode("th",{class:"px-2 py-1 text-start"},"Метрика")])],-1)),d.createElementVNode("tbody",woe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.source,o=>(d.openBlock(),d.createElementBlock("tr",{key:o.id,class:"border-b cursor-pointer hover:bg-gray-100 odd:bg-gray-50"},[d.createElementVNode("td",Soe,d.toDisplayString(o.title||"—"),1),d.createElementVNode("td",koe,d.toDisplayString(o.metric),1)]))),128))])])])])}const pR=wt(yoe,[["render",Eoe]]),Coe={mixins:[Fr,M1,{components:{VsMapSetting:cR,VsMapSlotLayers:dR,VsMapLegend:aoe,VsMapGoHome:hR,VsList:pR},data(){return{mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7"}},methods:{async createMap(){var t,n;const r=await uR();if(!r)return;const e={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new r.Map({container:this.mapId,style:e,center:[31,48.5],zoom:((n=(t=this.data)==null?void 0:t.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new r.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",a=>{this.moveMouseHadler(a)}),this.map.on("mouseout",()=>{var a;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(a=this.popup)==null||a.remove()})},getPopoverTitle(r){var e,t,n,a,i;return(t=(e=this.data)==null?void 0:e.colors)!=null&&t.find(o=>o.val===r)?(i=(a=(n=this.data)==null?void 0:n.colors)==null?void 0:a.find(o=>o.val===r))==null?void 0:i.text:r},moveMouseHadler(r){var e;try{const t=this.map.queryRenderedFeatures(r.point),n=((e=t[0])==null?void 0:e.properties)||{};if(!t.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
|
|
272
272
|
${this.getPopoverTitle((n==null?void 0:n.x)||(n==null?void 0:n.title)||(n==null?void 0:n.name))||""}
|
|
273
273
|
</div>
|
|
274
274
|
|
|
@@ -277,7 +277,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),G=N,F=V),R===void 0&&(
|
|
|
277
277
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
278
278
|
</span>
|
|
279
279
|
<span>${(n==null?void 0:n.metric)||0}</span>
|
|
280
|
-
</div>`;const a=this.map.project(r.lngLat);this.popupElement.style.left=`${a.x}px`,this.popupElement.style.top=`${a.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}}],name:"VsMap",async mounted(){await this.getMapData(),await this.createMap()},methods:{async getMapData(){const e=await(await fetch(`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`)).json();this.data=e,this.$emit("update:widgetData",e),setTimeout(()=>{var t;return(t=this.map)==null?void 0:t.resize()})},async loadHandler(){const r=["#69D2E7","yellow","#FE4365"],e=this.data.colors?["match",["get","x"]].concat(this.data.colors.reduce((i,o,s)=>i.concat(o.val,(o==null?void 0:o.color)||r[s]),[])).concat(["gray"]):"blue",t=[5,7,9,11,13],n=this.data.sizes?["case"]:5;this.data.sizes&&(this.data.sizes.reverse().forEach((i,o)=>{n.push([">",["get","metric"],i]),n.push(t[o])}),n.push(5));const a={type:"circle",color:e,width:2,radius:n,stroke:"#eee"};Object.assign(a,this.data.style||{}),this.addVtileLayer({id:"bi",url:`${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:a})}}},
|
|
280
|
+
</div>`;const a=this.map.project(r.lngLat);this.popupElement.style.left=`${a.x}px`,this.popupElement.style.top=`${a.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}}],name:"VsMap",async mounted(){await this.getMapData(),await this.createMap()},methods:{async getMapData(){const e=await(await fetch(`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`)).json();this.data=e,this.$emit("update:widgetData",e),setTimeout(()=>{var t;return(t=this.map)==null?void 0:t.resize()})},async loadHandler(){const r=["#69D2E7","yellow","#FE4365"],e=this.data.colors?["match",["get","x"]].concat(this.data.colors.reduce((i,o,s)=>i.concat(o.val,(o==null?void 0:o.color)||r[s]),[])).concat(["gray"]):"blue",t=[5,7,9,11,13],n=this.data.sizes?["case"]:5;this.data.sizes&&(this.data.sizes.reverse().forEach((i,o)=>{n.push([">",["get","metric"],i]),n.push(t[o])}),n.push(5));const a={type:"circle",color:e,width:2,radius:n,stroke:"#eee"};Object.assign(a,this.data.style||{}),this.addVtileLayer({id:"bi",url:`${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:a})}}},Toe={class:"w-full h-full"},Doe={class:"flex items-start justify-between mb-[6px] w-full"},Aoe={class:"text-gray-800 font-[600]"},Moe=["id"],Noe=["id"],Loe={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"};function Ioe(r,e,t,n,a,i){var c,f,h;const o=d.resolveComponent("VsMapSetting"),s=d.resolveComponent("VsMapSlotLayers"),l=d.resolveComponent("VsMapLegend"),u=d.resolveComponent("VsMapGoHome");return d.openBlock(),d.createElementBlock("div",Toe,[d.createElementVNode("div",Doe,[d.createElementVNode("h5",Aoe,d.toDisplayString(r.title),1)]),d.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${r.mapId}`},[d.createElementVNode("div",{id:r.mapId,class:"w-full flex items-end relative h-full min-h-[250px]"},null,8,Noe),r.showSetting?(d.openBlock(),d.createBlock(o,{key:0,map:r.map,coordinates:r.coordinatesByMouse},null,8,["map","coordinates"])):d.createCommentVNode("",!0),d.createVNode(s,{map:r.map},null,8,["map"]),d.createElementVNode("div",Loe,[d.createVNode(l,{mapId:r.mapId,colors:(c=r.data)==null?void 0:c.colors,sizes:(f=r.data)==null?void 0:f.sizes,color:r.color,resizeItem:"true"},null,8,["mapId","colors","sizes","color"]),d.createVNode(u,{map:r.map,bbox:(h=r.data)==null?void 0:h.bounds},null,8,["map","bbox"])])],8,Moe)])}const Boe=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Coe,[["render",Ioe]])},Symbol.toStringTag,{value:"Module"})),Voe={components:{legendIcon:N1,closeIcon:Xp},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:L1}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((r,e)=>r-e)},maxWidht(){var t;const r=((t=this.sizes)==null?void 0:t.length)-1;return this.calcSize(r)}},methods:{sizeClass(r){return this.resizeItem?`h-[${this.calcSize(r)}] w-[${this.calcSize(r)}] ${this.borderRadius}`:`h-[10px] ${this.borderRadius}`},calcSize(r){return`${10+r*2}px`},getOpacity(r){return(r+1)/this.sortedSizes.length}}},Roe={key:0,class:"absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"},Poe={class:"w-[80px] mr-[10px]"},Ooe=["title"],zoe={class:"text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]"};function Foe(r,e,t,n,a,i){var o;return(o=t.sizes)!=null&&o.length?(d.openBlock(),d.createElementBlock("div",Roe,[d.createElementVNode("div",Poe,[e[0]||(e[0]=d.createElementVNode("p",{class:"text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]"}," Дані відсутні ",-1)),d.createElementVNode("div",{class:d.normalizeClass([i.sizeClass(r.index),"w-full border border-gray-500"])},null,2)]),i.sortedSizes.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(i.sortedSizes,(s,l)=>{var u,c,f,h,p,g,v,m;return d.openBlock(),d.createElementBlock("div",{class:"w-[80px]",title:l===((u=i.sortedSizes)==null?void 0:u.length)-1?">"+s:l==((c=i.sortedSizes)==null?void 0:c.length)-1?">"+i.sortedSizes[((f=i.sortedSizes)==null?void 0:f.length)-1]:s+"-"+i.sortedSizes[l+1]},[d.createElementVNode("p",zoe,d.toDisplayString(l===((h=i.sortedSizes)==null?void 0:h.length)-1?">"+parseInt(s):l==((p=i.sortedSizes)==null?void 0:p.length)-1?">"+parseInt(i.sortedSizes[((g=i.sortedSizes)==null?void 0:g.length)-1]):parseInt(s)+"-"+parseInt(i.sortedSizes[l+1])),1),d.createElementVNode("div",{class:d.normalizeClass([i.sizeClass(l),"w-full border border-r-0 border-gray-500"]),style:d.normalizeStyle({backgroundColor:((m=(v=a.palette)==null?void 0:v[t.color])==null?void 0:m[l])||t.color})},null,6)],8,Ooe)}),256)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)}const $oe=wt(Voe,[["render",Foe]]),Goe={__name:"icon-map",setup(r){return(e,t)=>(d.openBlock(),d.createBlock(d.unref($P),d.mergeProps(e.$attrs,{size:24}),null,16))}},Uoe={mixins:[Fr,M1],components:{VsMapSetting:cR,VsClusterLegend:$oe,VsMapGoHome:hR,VsList:pR,VsMapSlotLayers:dR,VsBar:A1},data(){return{baseColor:"pink",kattotg:"",options:[{id:"map",text:"Карта",component:Goe},{id:"table",text:"Таблиця",component:F_},{id:"chart",text:"Віджет",component:XV}],activeTab:"map",mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7",label:"<div><icon-map/></div>"}},async mounted(){await this.getMapData(),await this.createMap()},watch:{kattotg(){this.loadHandler()}},methods:{async getMapData(){const r=await tr.get(`/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`);this.data=r,this.$emit("update:widgetData",this.data),setTimeout(()=>{var e;return(e=this.map)==null?void 0:e.resize()})},async loadHandler(){var n,a,i,o;this.baseColor=((n=this.data.style)==null?void 0:n.color)||"blue";const r=["case"];(o=(i=(a=this.data)==null?void 0:a.sizes)==null?void 0:i.toReversed())==null||o.forEach((s,l)=>{var u,c;r.push([">",["get","metric"],s]),r.push((c=(u=L1[this.baseColor])==null?void 0:u.toReversed())==null?void 0:c[l]),l++}),r.push("gray");const e={type:"polygon",color:r,opacity:.4};Object.assign(e,this.data.style||{}),this.map.getSource("bi")||this.addVtileLayer({id:"bi",url:`${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:e}),this.map.getLayer("highlighted")&&this.map.removeLayer("highlighted"),this.map.getSource("highlighted")&&this.map.removeSource("highlighted");const t=["case"];this.kattotg&&t.push(["==",["to-string",["get","name"]],String(this.kattotg)],"red"),t.push("transparent"),this.map.addLayer({id:"highlighted",type:"fill",source:"bi","source-layer":"bi",paint:{"fill-color":t,"fill-opacity":.6}})},async createMap(){var t,n;const r=await uR();if(!r)return;const e={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new r.Map({container:this.mapId,style:e,center:[31,48.5],zoom:((n=(t=this.data)==null?void 0:t.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new r.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",a=>{this.moveMouseHadler(a)}),this.map.on("mouseout",()=>{var a;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(a=this.popup)==null||a.remove()})},moveMouseHadler(r){var e;try{const t=this.map.queryRenderedFeatures(r.point),n=((e=t[0])==null?void 0:e.properties)||{};if(!t.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="px-2 py-1 text-sm font-semibold text-gray-800 border-b border-gray-200 border-solid rounded-t-lg">
|
|
281
281
|
${(n==null?void 0:n.x)||(n==null?void 0:n.title)||(n==null?void 0:n.name)||""}
|
|
282
282
|
</div>
|
|
283
283
|
|
|
@@ -286,7 +286,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),G=N,F=V),R===void 0&&(
|
|
|
286
286
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
287
287
|
</span>
|
|
288
288
|
<span>${(n==null?void 0:n.metric)||0}</span>
|
|
289
|
-
</div>`;const a=this.map.project(r.lngLat);this.popupElement.style.left=`${a.x}px`,this.popupElement.style.top=`${a.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}},Woe={class:"h-full"},Yoe={class:"flex items-start justify-between mb-[6px] w-full"},qoe={class:"text-gray-800 font-[600]"},Zoe={class:"flex gap-2"},Xoe=["onClick"],joe=["id"],Koe=["id"],Qoe={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"},Joe={class:"h-[calc(250px)]"};function ese(r,e,t,n,a,i){var h,p,g,v,m,y,b,_,x,w;const o=d.resolveComponent("VsMapSetting"),s=d.resolveComponent("VsMapSlotLayers"),l=d.resolveComponent("VsMapGoHome"),u=d.resolveComponent("VsClusterLegend"),c=d.resolveComponent("VsList"),f=d.resolveComponent("VsBar");return d.openBlock(),d.createElementBlock("div",Woe,[d.createElementVNode("div",Yoe,[d.createElementVNode("h3",qoe,d.toDisplayString(r.title),1),d.createElementVNode("div",Zoe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,S=>(d.openBlock(),d.createElementBlock("button",{class:d.normalizeClass(["p-1 text-gray-700 border rounded",[a.activeTab===(S==null?void 0:S.id)?"ring-2 ring-blue-500":""]]),onClick:k=>a.activeTab=S==null?void 0:S.id},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(S==null?void 0:S.component),{height:"16",width:"16"}))],10,Xoe))),256))])]),d.withDirectives(d.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${a.mapId}`},[d.createElementVNode("div",{id:a.mapId,class:"h-full w-full flex items-end min-h-[250px]"},null,8,Koe),a.showSetting?(d.openBlock(),d.createBlock(o,{key:0,map:a.map,coordinates:a.coordinatesByMouse},null,8,["map","coordinates"])):d.createCommentVNode("",!0),d.createVNode(s,{map:a.map},null,8,["map"]),d.createElementVNode("div",Qoe,[d.createVNode(l,{map:a.map,bbox:(h=a.data)==null?void 0:h.bounds},null,8,["map","bbox"])]),d.createVNode(u,{mapId:a.mapId,colors:(p=a.data)==null?void 0:p.colors,sizes:(g=a.data)==null?void 0:g.sizes,color:a.baseColor,changeOpacityItem:"true",cluster:"true"},null,8,["mapId","colors","sizes","color"])],8,joe),[[d.vShow,a.activeTab=="map"]]),d.withDirectives(d.createVNode(c,{mapId:a.mapId,source:(v=a.data)==null?void 0:v.rows,total:((m=a.data)==null?void 0:m.total)||0,count:((y=a.data)==null?void 0:y.count)||0,onKattotg:e[0]||(e[0]=S=>a.kattotg=S)},null,8,["mapId","source","total","count"]),[[d.vShow,a.activeTab=="table"]]),d.withDirectives(d.createElementVNode("div",Joe,[(_=(b=a.data)==null?void 0:b.rows)!=null&&_.length?(d.openBlock(),d.createBlock(f,{key:0,source:(w=(x=a.data)==null?void 0:x.rows)==null?void 0:w.map(S=>({title:S==null?void 0:S.title,metric:S==null?void 0:S.metric}))},null,8,["source"])):d.createCommentVNode("",!0)],512),[[d.vShow,a.activeTab=="chart"]])])}const tse=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Hoe,[["render",ese]])},Symbol.toStringTag,{value:"Module"})),rse={name:"VsTable",mixins:[Fr],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>Bc(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>xn(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},nse={class:"flex flex-col h-full pt-[16px] pb-[16px] space-y-4 rounded-xl"},ase={class:"overflow-auto h-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},ise={class:"inline-block min-w-full align-middle"},ose={class:"relative min-w-full divide-y divide-gray-200 text-[12px]"},sse={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},lse={class:"space-x-2"},use={scope:"col",class:"xl:min-w-[120px] min-w-48"},cse={class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1"},dse={class:"divide-y divide-gray-200"},fse={class:"text-gray-600"};function hse(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",nse,[d.createElementVNode("div",ase,[d.createElementVNode("div",ise,[d.createElementVNode("table",ose,[d.createElementVNode("thead",sse,[d.createElementVNode("tr",lse,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.dimensions,o=>(d.openBlock(),d.createElementBlock("th",use,[d.createElementVNode("div",cse,d.toDisplayString(o),1)]))),256))])]),d.createElementVNode("tbody",dse,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>(d.openBlock(),d.createElementBlock("tr",{key:s},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.dimensions,(l,u)=>(d.openBlock(),d.createElementBlock("td",{key:u,class:"py-3 whitespace-nowrap"},[d.createElementVNode("span",fse,d.toDisplayString(o==null?void 0:o[l]),1)]))),128))]))),128))])])])])])}const pse=Object.freeze(Object.defineProperty({__proto__:null,default:wt(rse,[["render",hse]])},Symbol.toStringTag,{value:"Module"})),gse=["type","disabled"],gR=d.defineComponent({__name:"button",props:{type:{},variant:{},disabled:{type:Boolean}},emits:["click"],setup(r,{emit:e}){const t=r,n=e,a=o=>{t.disabled||n("click",o)},i=d.computed(()=>{switch(t.variant){case"secondary":return"bg-gray-200 text-black hover:bg-gray-300";case"danger":return"bg-red-500 text-white hover:bg-red-600";default:return"bg-blue-600 text-white hover:bg-blue-700"}});return(o,s)=>(d.openBlock(),d.createElementBlock("button",{type:o.type,class:d.normalizeClass(["px-4 py-2 rounded font-semibold",i.value,o.disabled?"opacity-50 cursor-not-allowed":""]),disabled:o.disabled,onClick:a},[d.renderSlot(o.$slots,"default")],10,gse))}}),vse=(r,e=.1)=>{function t(i){return{black:"0, 0, 0",white:"255, 255, 255",red:"255, 0, 0",green:"0, 128, 0",blue:"0, 0, 255",gray:"128, 128, 128",yellow:"255, 255, 0",cyan:"0, 255, 255",magenta:"255, 0, 255",orange:"255, 165, 0",purple:"128, 0, 128",brown:"165, 42, 42",pink:"255, 192, 203",lime:"0, 255, 0",navy:"0, 0, 128",teal:"0, 128, 128",olive:"128, 128, 0",maroon:"128, 0, 0",silver:"192, 192, 192",gold:"255, 215, 0"}[i]||null}function n(i){let o=i.replace(/^#/,"");o.length===3&&(o=o.split("").map(f=>f+f).join(""));const s=parseInt(o,16),l=s>>16&255,u=s>>8&255,c=s&255;return`${l}, ${u}, ${c}`}let a;if(typeof r=="string"&&r.startsWith("#"))a=n(r);else if(typeof r=="string")a=t(r);else throw new Error("Invalid color format");if(a)return`rgba(${a}, ${e})`;throw new Error("Color not found")},mse={props:{text:{type:String,default:()=>"",required:!0},color:{type:String,default:()=>"",required:!1}},computed:{createStyle(){return this.color?{backgroundColor:vse(this.color,.2)}:{backgroundColor:"rgb(245 245 244)"}}}},Lt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t};function yse(r,e,t,n,a,i){return t.text?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["py-1.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-full",t.color?`text-[${t.color}]`:"text-gray-700"]),style:d.normalizeStyle(i.createStyle)},d.toDisplayString(t.text),7)):d.createCommentVNode("",!0)}const bse=Lt(mse,[["render",yse]]),_se={props:{value:{type:String,default:()=>""}},computed:{dateValue(){try{return new Date(this.value).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return this.value}}}},xse={class:"whitespace-nowrap"};function wse(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",xse,d.toDisplayString(i.dateValue),1)}const vR=Lt(_se,[["render",wse]]),Sse={},kse={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 Ese(r,e){return d.openBlock(),d.createElementBlock("svg",kse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Cse=Lt(Sse,[["render",Ese]]),Tse={},Dse={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 Ase(r,e){return d.openBlock(),d.createElementBlock("svg",Dse,e[0]||(e[0]=[d.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 Mse=Lt(Tse,[["render",Ase]]),Nse={},Lse={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 Ise(r,e){return d.openBlock(),d.createElementBlock("svg",Lse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const mR=Lt(Nse,[["render",Ise]]),Bse={},Vse={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-x"};function Rse(r,e){return d.openBlock(),d.createElementBlock("svg",Vse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),d.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Pse=Lt(Bse,[["render",Rse]]),Ose={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},zse={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Fse={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},$se={class:"mt-3 text-center sm:mt-5"},Gse={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Use={class:"mt-2"},Hse={class:"text-sm text-gray-500"},Wse={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},Yse={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},qse={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Zse={class:"sm:flex sm:items-start"},Xse={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},jse={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Kse={class:"mt-2"},Qse={class:"text-sm text-gray-500"},Jse={key:0,class:"mt-2"},ele=["placeholder"],tle=d.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(r,{emit:e}){const t=d.ref(null);d.onMounted(()=>{var g;(g=t.value)==null||g.focus()});const n={success:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[d.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[d.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[d.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[d.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},a=r,i=e,o=d.ref(a.modelValue),s=d.ref("");d.watch(()=>a.modelValue,g=>{o.value=g,g===!0&&a.mode==="prompt"&&(s.value="")});function l(g){o.value=!1,i("update:modelValue",!1),g==="confirm"&&a.mode==="prompt"?i("confirm",s.value):i(g)}function u(){l("confirm")}const c=d.computed(()=>{switch(a.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),f=d.computed(()=>a.type==="warning"?"bg-orange-600 hover:bg-orange-500":a.type==="success"?"bg-green-600 hover:bg-green-500":a.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),h=d.computed(()=>n[a.type||"error"]||n.error),p=d.computed(()=>a.title&&a.title.trim()!==""?a.title:a.type?a.type.charAt(0).toUpperCase()+a.type.slice(1):"Notification");return(g,v)=>{const m=d.resolveDirective("focus");return d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[o.value?(d.openBlock(),d.createElementBlock("div",Ose,[g.mode==="alert"?(d.openBlock(),d.createElementBlock("div",zse,[d.createElementVNode("div",Fse,[d.createElementVNode("div",null,[v[4]||(v[4]=d.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[d.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[d.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),d.createElementVNode("div",$se,[d.createElementVNode("h3",Gse,d.toDisplayString(p.value),1),d.createElementVNode("div",Use,[d.createElementVNode("p",Hse,d.toDisplayString(g.message),1)])])])]),d.createElementVNode("div",Wse,[d.createElementVNode("button",{type:"button",onClick:v[0]||(v[0]=y=>l("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},d.toDisplayString(g.confirmButtonText),1)])])):(d.openBlock(),d.createElementBlock("div",Yse,[d.createElementVNode("div",qse,[d.createElementVNode("div",Zse,[d.createElementVNode("div",{class:d.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",c.value])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h.value)))],2),d.createElementVNode("div",Xse,[d.createElementVNode("h3",jse,d.toDisplayString(p.value),1),d.createElementVNode("div",Kse,[d.createElementVNode("p",Qse,d.toDisplayString(g.message),1)]),g.mode==="prompt"?(d.openBlock(),d.createElementBlock("div",Jse,[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":v[1]||(v[1]=y=>s.value=y),placeholder:g.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:d.withKeys(u,["enter"]),type:"text"},null,40,ele),[[d.vModelText,s.value],[m]])])):d.createCommentVNode("",!0)])])]),d.createElementVNode("div",{class:d.normalizeClass(["bg-gray-50 px-4 py-3",g.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[d.createElementVNode("button",{type:"button",onClick:v[2]||(v[2]=y=>l("confirm")),class:d.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",f.value])},d.toDisplayString(g.confirmButtonText),3),d.createElementVNode("button",{type:"button",onClick:v[3]||(v[3]=y=>l("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},d.toDisplayString(g.cancelButtonText),1)],2)]))])):d.createCommentVNode("",!0)])}}}),Cp=Lt(tle,[["__scopeId","data-v-46ded130"]]),rle=["aria-label"],nle={class:"absolute top-[15px] right-[15px] z-20 flex flex-row gap-2 items-center"},ale=["href"],ile={class:"text-center text-white text-sm absolute bottom-[10px] left-[50%] -translate-x-1/2"},ole={class:"relative w-full max-w-[80vw] h-[90vh]"},sle={class:"flex items-center justify-center w-full h-full"},lle=["src","alt"],ule=["src"],cle=["src"],dle={key:3,class:"flex flex-col items-center justify-center w-full h-full text-white text-center"},fle={class:"text-sm text-gray-300 mb-4"},hle=["href"],ple=d.defineComponent({__name:"vs-lightbox",props:{modelValue:{type:Boolean},ignoreFormat:{type:Boolean},images:{},startIndex:{},download:{type:Boolean},delete:{type:Boolean}},emits:["update:modelValue","update:index","delete"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!!t.modelValue),i=d.ref(t.startIndex??0),o=d.ref(!1),s=d.ref("");d.watch(()=>t.modelValue,w=>{a.value=!!w}),d.watch(a,w=>{n("update:modelValue",w)}),d.watch(()=>t.startIndex,w=>{typeof w=="number"&&(i.value=w)});const l=d.computed(()=>t.images||[]),u=d.computed(()=>l.value[i.value]??"");function c(){a.value=!1}function f(){l.value.length<=1||(i.value=(i.value-1+l.value.length)%l.value.length,n("update:index",i.value))}function h(){l.value.length<=1||(i.value=(i.value+1)%l.value.length,n("update:index",i.value))}function p(w){a.value&&(w.key==="Escape"&&c(),w.key==="ArrowLeft"&&f(),w.key==="ArrowRight"&&h())}function g(w){return[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico"].some(S=>w.toLowerCase().includes(S))}function v(w){return[".mp4",".webm",".ogg",".mov",".avi",".mkv",".flv",".wmv"].some(S=>w.toLowerCase().includes(S))}function m(w){return w.toLowerCase().includes(".pdf")}function y(w){return[".txt",".md",".html",".htm",".css",".js",".ts",".json",".xml",".csv",".log"].some(S=>w.toLowerCase().includes(S))}function b(w){const S=w.lastIndexOf(".");return S===-1?"Unknown file type":w.substring(S+1).toUpperCase()}function _(w){s.value=w,o.value=!0}function x(){n("delete",s.value),i.value=0,o.value=!1,a.value=!1}return d.onMounted(()=>{window.addEventListener("keydown",p)}),d.onBeforeUnmount(()=>{window.removeEventListener("keydown",p)}),(w,S)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.Transition,{name:"lightbox-fade"},{default:d.withCtx(()=>[a.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"fixed inset-0 z-[2000] bg-black/70 flex items-center justify-center",onClick:d.withModifiers(c,["self"]),role:"dialog","aria-modal":"true","aria-label":`Image ${i.value+1} of ${l.value.length}`},[d.createElementVNode("div",nle,[t.delete?(d.openBlock(),d.createElementBlock("button",{key:0,onClick:S[0]||(S[0]=k=>_(u.value)),class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300"},[d.createVNode(Mse,{class:"w-4 h-4"})])):d.createCommentVNode("",!0),t.download?(d.openBlock(),d.createElementBlock("a",{key:1,href:u.value,download:"",class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300"},[d.createVNode(Cse,{class:"w-4 h-4"})],8,ale)):d.createCommentVNode("",!0),d.createElementVNode("button",{class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:c,"aria-label":"Close"},[d.createVNode(Pse,{class:"w-4 h-4"})])]),l.value.length>1?(d.openBlock(),d.createElementBlock("button",{key:0,class:"absolute left-[15px] top-1/2 -translate-y-1/2 z-20 bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:d.withModifiers(f,["stop"]),"aria-label":"Previous"},[d.createVNode(mR,{class:"w-4 h-4 rotate-90"})])):d.createCommentVNode("",!0),l.value.length>1?(d.openBlock(),d.createElementBlock("button",{key:1,class:"absolute right-[15px] top-1/2 -translate-y-1/2 z-20 bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:d.withModifiers(h,["stop"]),"aria-label":"Next"},[d.createVNode(mR,{class:"w-4 h-4 -rotate-90"})])):d.createCommentVNode("",!0),d.createElementVNode("div",ile,d.toDisplayString(i.value+1)+" / "+d.toDisplayString(l.value.length),1),d.createElementVNode("div",ole,[d.createElementVNode("div",sle,[g(u.value)||t.ignoreFormat?(d.openBlock(),d.createElementBlock("img",{key:0,src:u.value,alt:`Image ${i.value+1}`,class:"max-w-full max-h-full object-contain"},null,8,lle)):v(u.value)?(d.openBlock(),d.createElementBlock("video",{key:1,src:u.value,class:"max-w-full max-h-full object-contain",controls:"",autoplay:"",muted:""}," Your browser does not support the video tag. ",8,ule)):m(u.value)||y(u.value)?(d.openBlock(),d.createElementBlock("iframe",{key:2,src:u.value,class:"w-full h-full bg-white"},null,8,cle)):(d.openBlock(),d.createElementBlock("div",dle,[S[2]||(S[2]=d.createElementVNode("div",{class:"mb-4"},[d.createElementVNode("svg",{class:"w-16 h-16 mx-auto text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1)),S[3]||(S[3]=d.createElementVNode("p",{class:"text-lg mb-2"},"Файл не підтримується для перегляду",-1)),d.createElementVNode("p",fle,d.toDisplayString(b(u.value)),1),d.createElementVNode("a",{href:u.value,target:"_blank",download:"",class:"bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg transition-colors"}," Завантажити файл ",8,hle)]))])])],8,rle)):d.createCommentVNode("",!0)]),_:1}),d.createVNode(Cp,{modelValue:o.value,"onUpdate:modelValue":S[1]||(S[1]=k=>o.value=k),onConfirm:x,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"])],64))}}),I1=Lt(ple,[["__scopeId","data-v-815d1d2d"]]),gle={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},vle=["onClick"],mle=["src"],yle={key:0,class:"thumb-cover"},yR=d.defineComponent({__name:"vs-grid-gallery",props:{images:{},width:{},height:{}},setup(r){const e=d.ref(!1),t=d.ref(0);function n(i){return i.map(o=>o.src||o)}const a=d.ref(n(r.images||[]));return(i,o)=>{var s;return((s=a.value)==null?void 0:s.length)>=1?(d.openBlock(),d.createElementBlock("div",gle,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,(l,u)=>{var c,f;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass("h-full w-full image"+u),key:u},[u<5?(d.openBlock(),d.createElementBlock("a",{key:0,onClick:h=>{t.value=u,e.value=!0},rel:"noreferrer",class:"relative block h-full w-full"},[d.createElementVNode("img",{src:l,alt:"alt",height:"auto",width:"100%",class:d.normalizeClass(["object-cover h-full w-full",u===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,mle),u===4&&((c=a.value)==null?void 0:c.length)>5?(d.openBlock(),d.createElementBlock("div",yle," +"+d.toDisplayString(((f=a.value)==null?void 0:f.length)-5),1)):d.createCommentVNode("",!0)],8,vle)):d.createCommentVNode("",!0)],2)}),128)),d.createVNode(I1,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),images:a.value.map(l=>l),ignoreFormat:!0,startIndex:t.value,"onUpdate:index":o[1]||(o[1]=l=>t.value=l)},null,8,["modelValue","images","startIndex"])])):d.createCommentVNode("",!0)}}}),ble={},_le={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 xle(r,e){return d.openBlock(),d.createElementBlock("svg",_le,e[0]||(e[0]=[d.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 wle=Lt(ble,[["render",xle]]),Sle={},kle={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 Ele(r,e){return d.openBlock(),d.createElementBlock("svg",kle,e[0]||(e[0]=[d.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 Cle=Lt(Sle,[["render",Ele]]),Tle={},Dle={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 Ale(r,e){return d.openBlock(),d.createElementBlock("svg",Dle,e[0]||(e[0]=[d.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 Mle=Lt(Tle,[["render",Ale]]),Nle={},Lle={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 Ile(r,e){return d.openBlock(),d.createElementBlock("svg",Lle,e[0]||(e[0]=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Ble=Lt(Nle,[["render",Ile]]),Vle={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Rle={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Ple={class:"flex-1"},Ole={class:"font-medium text-gray-900"},zle={class:"mt-0.5 text-sm text-gray-700"},B1=d.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(r){const e={success:wle,warning:Cle,error:Ble,info:Mle};return(t,n)=>(d.openBlock(),d.createElementBlock("div",Vle,[d.createElementVNode("div",Rle,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e[t.type]))),d.createElementVNode("div",Ple,[d.createElementVNode("strong",Ole,d.toDisplayString(t.title),1),d.createElementVNode("p",zle,d.toDisplayString(t.message),1)]),n[0]||(n[0]=d.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"},[d.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),d.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"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),Tp={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"},pt=r=>{var l;const{type:e="info",title:t,message:n,position:a="right-bottom"}=r||{};let i=document.querySelector("#notify-root");i||(i=document.createElement("div"),i.id="notify-root",i.className=`fixed z-[2000] flex flex-col gap-3 ${Tp[a]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(i)),i.className.includes(Tp[a])||(Object.values(Tp).forEach(u=>{i.classList.remove(...u.split(" "))}),i.classList.add(...Tp[a].split(" ")));const o=document.createElement("div");i.appendChild(o);const s=d.createApp({render(){return d.h(B1,{type:e,title:t,message:n,onClose:()=>{s.unmount(),o.remove()}})}});s.mount(o),(l=o.querySelector("button"))==null||l.addEventListener("click",()=>{o.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),o.remove()},350)}),setTimeout(()=>{o.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),o.remove()},350)},3500)},Fle=d.defineComponent({name:"Copy",props:{text:{type:String,default:""},width:{type:[String,Number],default:null},notify:{type:Boolean,default:!0},notifyOptions:{type:Object,default:()=>({})}},emits:["copied","copy-error"],data(){return{slotText:""}},computed:{rootClasses(){return["vs-copy inline-flex items-center gap-2 cursor-pointer select-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500"]},containerStyle(){return!this.width&&this.width!==0?{}:{width:typeof this.width=="number"?`${this.width}px`:this.width.trim()}},displayText(){return this.text||this.slotText}},mounted(){this.updateSlotText()},updated(){this.updateSlotText()},methods:{updateSlotText(){var e,t;const r=((t=(e=this.$refs.text)==null?void 0:e.textContent)==null?void 0:t.trim())||"";r!==this.slotText&&(this.slotText=r)},async handleCopy(){const r=this.displayText;if(r)try{await this.copyToClipboard(r),this.$emit("copied",r),this.showNotify(r)}catch(e){this.$emit("copy-error",e)}},async copyToClipboard(r){var t;if((t=navigator.clipboard)!=null&&t.writeText){await navigator.clipboard.writeText(r);return}const e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select();try{if(!document.execCommand("copy"))throw new Error("Copy command was unsuccessful")}finally{document.body.removeChild(e)}},showNotify(r){var t,n,a,i;if(!this.notify)return;const e={type:((t=this.notifyOptions)==null?void 0:t.type)??"success",title:((n=this.notifyOptions)==null?void 0:n.title)??"Copied",message:((a=this.notifyOptions)==null?void 0:a.message)??r,position:(i=this.notifyOptions)==null?void 0:i.position};pt(e)}}}),$le=["title"];function Gle(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("span",{ref:"root",class:d.normalizeClass(r.rootClasses),role:"button",tabindex:"0",style:d.normalizeStyle(r.containerStyle),onClick:e[0]||(e[0]=(...o)=>r.handleCopy&&r.handleCopy(...o)),onKeydown:[e[1]||(e[1]=d.withKeys(d.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"]),["enter"])),e[2]||(e[2]=d.withKeys(d.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"]),["space"]))]},[d.createElementVNode("span",{ref:"text",class:"vs-copy__text truncate min-w-0 flex-1",title:r.displayText},[d.renderSlot(r.$slots,"default")],8,$le),e[3]||(e[3]=d.createElementVNode("span",{class:"vs-copy__icon flex-none inline-flex text-current","aria-hidden":"true"},[d.createElementVNode("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"},[d.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.createElementVNode("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})])],-1))],38)}const V1=Lt(Fle,[["render",Gle]]),Ule=d.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(r){this.$emit("update:modelValue",r)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(r){const{keyCode:e}=r;e===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}}),Hle=["disabled"],Wle={class:"ml-2 text-sm"};function Yle(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["relative inline-flex items-center cursor-pointer min-h-[40px] relative",r.labelCursorClasses])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>r.modelState=o),type:"checkbox",value:"",class:"sr-only peer",disabled:r.disabled,tabindex:"-1"},null,8,Hle),[[d.vModelCheckbox,r.modelState]]),d.createElementVNode("div",{class:"w-11 h-6 t-[12px] bg-gray-200 transition-all rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[10px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 outline-none focus:border dark:bg-transparent dark:border-gray-600 focus:border-blue-500",tabindex:"0",onFocus:e[1]||(e[1]=(...o)=>r.addKeyHandler&&r.addKeyHandler(...o)),onBlur:e[2]||(e[2]=(...o)=>r.removeKeyHandler&&r.removeKeyHandler(...o))},null,32),d.createElementVNode("span",Wle,[d.renderSlot(r.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(r.title),1)])])],2)}const bR=Lt(Ule,[["render",Yle]]),Vc=async(r,e,t,n=10)=>{var v,m,y,b;if(!e||!t)return;await d.nextTick();const a=await(t==null?void 0:t.getBoundingClientRect()),i=await(e==null?void 0:e.getBoundingClientRect());if(!i||!a)return;const o=await parseInt((v=e==null?void 0:e.getBoundingClientRect())==null?void 0:v.height),s=await parseInt((m=e==null?void 0:e.getBoundingClientRect())==null?void 0:m.width),l=await parseInt((y=t==null?void 0:t.getBoundingClientRect())==null?void 0:y.height),u=await parseInt((b=t==null?void 0:t.getBoundingClientRect())==null?void 0:b.width),c=await window.innerHeight,f=await window.innerWidth;let h=0,p=0;const g=i.bottom+n+l;switch(r){case"top":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,f>u+i.right+30?p=i.left-a.width/2+i.width/2:p=f-30-u;break;case"bottom":c>g?h=i.bottom+n:h=i.bottom-n-l-o,p=i.left-a.width/2+i.width/2;break;case"left":h=i.top-a.height/2+i.height/2,i.left-a.width-n>0?p=i.left-a.width-n:p=10;break;case"right":h=i.top-a.height/2+i.height/2,f-s>u?p=i.right+n:p=f-30-u;break;case"top-right":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,f-s>u?p=i.right+n:p=f-30-u;break;case"top-left":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,i.left-a.width-n>0?p=i.left-a.width-n:p=10;break;case"top-start":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,i.left>0?p=i.left:p=10;break;case"bottom-right":c>g?h=i.bottom+n:h=i.bottom-n-l-o,f-s>u?p=i.left:p=f-30-u;break;case"bottom-left":c>g?h=i.bottom+n:h=i.bottom-n-l-o,i.left>0?p=i.right-u:p=10;break;case"bottom-start":c>g?h=i.bottom+n:h=i.bottom-n-l-o,i.left>0?p=i.left:p=10;break}h+l>c?h=c-l-n:h<0&&(h=n),p+u>f?p=f-u-n:p<0&&(p=n),t instanceof HTMLElement&&(t.style.top=`${h}px`,t.style.left=`${p}px`,t.style.position="fixed")},qle={class:"text-center"},Zle={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"},_R=d.defineComponent({__name:"vs-popover",props:{isOpen:{type:Boolean,default:!1},placement:{default:"top"},gap:{default:8},width:{default:""},disabled:{type:Boolean,default:!1},trigger:{default:"click"},teleport:{default:"body"}},emits:["isvisible"],setup(r,{expose:e,emit:t}){const n=r,a=t,i=d.ref(!1),o=d.ref([]),s=d.ref(null),l=d.ref(null),u=d.ref(null),c=_=>{var x,w;if(!_){i.value=!1;return}(x=l.value)!=null&&x.contains(_.target)||(w=u.value)!=null&&w.contains(_.target)||(i.value=!1)},f=_=>{i.value&&u.value&&!u.value.contains(_.target)&&(i.value=!1)},h=()=>{i.value=!1},p=()=>{i.value&&(i.value=!1)},g=()=>{let _=s.value;for(;_&&_!==document.body;)(_.scrollHeight>_.clientHeight||_.scrollWidth>_.clientWidth)&&(_.addEventListener("scroll",h),o.value.push(_)),_=_.parentElement;document.body&&(document.body.addEventListener("scroll",h),o.value.push(document.body))},v=()=>{o.value.forEach(_=>{_.removeEventListener("scroll",h)}),o.value=[]};d.watch(i,_=>{_?(g(),window.addEventListener("resize",()=>Vc(n.placement,l.value,u.value)),Vc(n.placement,l.value,u.value)):window.removeEventListener("resize",()=>Vc(n.placement,l.value,u.value)),a("isvisible",_)}),d.onMounted(()=>{window.addEventListener("click",c),window.addEventListener("popstate",p),window.addEventListener("scroll",f,!0),g()}),d.onBeforeUnmount(()=>{window.removeEventListener("click",c),window.removeEventListener("popstate",p),v()});const m=()=>{i.value=!0,Vc(n.placement,l.value,u.value)},y=()=>{i.value=!1},b=async()=>{await Vc(n.placement,l.value,u.value),i.value=!i.value};return e({togglePopover:b}),(_,x)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"popover",ref:s,class:"vs-popover inline-block"},[d.createElementVNode("div",qle,[_.trigger==="click"?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:b,class:d.normalizeClass({"pointer-events-none":_.disabled})},[d.renderSlot(_.$slots,"reference",{},()=>[x[0]||(x[0]=d.createElementVNode("button",null,"Click me!",-1))])],2)):d.createCommentVNode("",!0),_.trigger==="hover"?(d.openBlock(),d.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:m,onMouseleave:y,class:d.normalizeClass({"pointer-events-none":_.disabled})},[d.renderSlot(_.$slots,"reference",{},()=>[x[1]||(x[1]=d.createElementVNode("button",null,"Click me!",-1))])],34)):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:_.teleport},[d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:d.normalizeClass(["vsTailwind vs-popover__content",_.placement]),ref_key:"contentPop",ref:u,style:d.normalizeStyle({width:_.width?_.width+"px":"fit-content",zIndex:10002})},[d.createElementVNode("div",Zle,[d.renderSlot(_.$slots,"default",{},()=>[x[2]||(x[2]=d.createElementVNode("span",null,"Popover content",-1))])])],6),[[d.vShow,i.value]])]),_:3})],8,["to"]))])],512))}}),Xle={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},jle={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Kle={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Qle={class:"ui-dialog__content p-4"},Jle={key:0,class:"flex justify-end gap-x-2"},eue={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},tue=d.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.size==="small"?"md:w-5/12 w-9/12":t.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),i=d.useAttrs();function o(){n("done")}function s(){n("update:visible",!1),n("close")}function l(c){c.key==="Escape"&&s()}function u(c,f){f&&c.target.classList.contains("vs-dialog-overlay")&&s()}return d.onMounted(()=>{window.addEventListener("keydown",l)}),d.onUnmounted(()=>{window.removeEventListener("keydown",l)}),(c,f)=>(d.openBlock(),d.createBlock(d.Teleport,{to:c.teleport},[c.visible?(d.openBlock(),d.createElementBlock("div",Xle,[d.createElementVNode("div",{onMousedown:f[0]||(f[0]=h=>u(h,c.closeClickBack)),class:d.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[d.unref(i).class]])},[d.createVNode(d.Transition,{name:"content",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["ui-dialog__modal 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",a.value])},[d.createElementVNode("div",jle,[d.createElementVNode("h3",Kle,d.toDisplayString(c.title),1),d.createElementVNode("button",{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",onClick:s},f[1]||(f[1]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",Qle,[d.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer?(d.openBlock(),d.createElementBlock("div",Jle,[d.renderSlot(c.$slots,"footer",{handleClose:s},void 0,!0)])):d.createCommentVNode("",!0),c.buttonText?(d.openBlock(),d.createElementBlock("div",eue,[d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white 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",onClick:s}," Close "),d.createElementVNode("button",{type:"button",onClick:o,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},d.toDisplayString(c.buttonText),1)])):d.createCommentVNode("",!0)],2)]),_:3})],34)])):d.createCommentVNode("",!0)],8,["to"]))}}),xl=Lt(tue,[["__scopeId","data-v-670eae4f"]]),rue={key:0,class:"vsTailwind ui-drawer__wrapper"},nue={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},aue={class:"font-medium text-gray-800 dark:text-[#ffffff]"},iue={class:"flex gap-2"},oue={class:"sr-only"},sue={key:0,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"},lue={key:1,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"},uue={class:"ui-drawer__content p-4 flex-1 overflow-auto"},cue={key:0,class:"flex justify-end gap-x-2 p-4 border-0 border-t border-solid border-gray-200 dark:border-t-[#454545]"},due=d.defineComponent({__name:"vs-drawer",props:{title:{default:""},visible:{type:Boolean,default:!1},position:{default:"right"},size:{default:"500px"},closeClickBack:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!1),i=d.computed(()=>a.value?"fixed top-0 left-0 w-full h-full":t.position==="left"?"fixed top-0 left-0 h-full":t.position==="right"?"fixed top-0 right-0 h-full":t.position==="top"?"fixed top-0 left-0 w-full":"fixed bottom-0 left-0 w-full");function o(){n("update:visible",!1),n("close")}function s(){a.value=!a.value}function l(c){c.key==="Escape"&&o()}function u(c,f){f&&c.target.classList.contains("vs-drawer-overlay")&&o()}return d.onMounted(()=>{window.addEventListener("keydown",l)}),d.onUnmounted(()=>{window.removeEventListener("keydown",l)}),(c,f)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#modal"},[c.visible?(d.openBlock(),d.createElementBlock("div",rue,[d.createElementVNode("div",{onMousedown:f[0]||(f[0]=h=>u(h,c.closeClickBack)),class:"vs-drawer-overlay vs-drawer w-full h-full fixed top-0 start-0 bg-black bg-opacity-50"},[d.createVNode(d.Transition,{name:"drawer",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["ui-drawer__drawer 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)]",[i.value,a.value?"w-full":`w-[${t.size}]`,`drawer-${t.position}`]])},[d.createElementVNode("div",nue,[d.createElementVNode("h3",aue,d.toDisplayString(c.title),1),d.createElementVNode("div",iue,[d.createElementVNode("button",{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",onClick:s},[d.createElementVNode("span",oue,d.toDisplayString(a.value?"Exit fullscreen":"Enter fullscreen"),1),a.value?(d.openBlock(),d.createElementBlock("svg",lue,f[2]||(f[2]=[d.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(d.openBlock(),d.createElementBlock("svg",sue,f[1]||(f[1]=[d.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))]),d.createElementVNode("button",{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",onClick:o},f[3]||(f[3]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))])]),d.createElementVNode("div",uue,[d.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer?(d.openBlock(),d.createElementBlock("div",cue,[d.renderSlot(c.$slots,"footer",{handleClose:o},void 0,!0)])):d.createCommentVNode("",!0)],2)]),_:3})],32)])):d.createCommentVNode("",!0)]))}}),xR=Lt(due,[["__scopeId","data-v-7a0e7f2b"]]),fue={key:0,class:"vsTailwind ui-dialog__wrapper"},hue={class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[2000] bg-black bg-opacity-50"},pue={class:"ui-dialog__modal opacity-1 w-[448px] transition-all 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"},gue={class:"py-2.5 px-4 flex justify-between items-center border-gray-200 dark:border-b-[#454545]"},vue={class:"text-lg font-medium text-gray-800 dark:text-neutral-200"},mue={class:"ui-dialog__content p-4 py-0"},yue={class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"},bue={key:0,class:"p-[16px] flex justify-end gap-x-3"},_ue={key:1,class:"flex p-[16px] justify-end gap-x-3"},xue=d.defineComponent({__name:"vs-confirm-modal",props:{title:{default:"Ви впевнені?"},message:{default:"Ви дійсно хочете?"},confirmButtonText:{default:"Так"},cancelButtonText:{default:"НІ"},confirmButtonStyle:{default:" bg-red-500 hover:bg-red-700"},cancelButtonStyle:{default:" border border-gray-200 bg-white hover:bg-gray-100"},cascade:{type:Boolean,default:!1},modelValue:{type:Boolean}},emits:["confirm","cancel","update:modelValue"],setup(r){const e=r,t=d.ref(e.modelValue);return d.watch(()=>e.modelValue,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[t.value?(d.openBlock(),d.createElementBlock("div",fue,[d.createElementVNode("div",hue,[d.createElementVNode("div",pue,[d.createElementVNode("div",gue,[d.createElementVNode("h3",vue,d.toDisplayString(n.title),1),d.createElementVNode("button",{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",onClick:a[0]||(a[0]=i=>n.$emit("cancel"))},a[5]||(a[5]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",mue,[d.createElementVNode("p",yue,d.toDisplayString(n.message),1)]),n.cascade?(d.openBlock(),d.createElementBlock("div",bue,[d.createElementVNode("button",{type:"button",class:d.normalizeClass([[n.cancelButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 disabled:opacity-50 disabled:pointer-events-none"]),onClick:a[1]||(a[1]=i=>n.$emit("cancel"))},d.toDisplayString(n.cancelButtonText),3),d.createElementVNode("button",{type:"button",onClick:a[2]||(a[2]=i=>n.$emit("confirm")),class:d.normalizeClass([[n.confirmButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 text-white shadow-sm disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50"])},d.toDisplayString(n.confirmButtonText),3)])):(d.openBlock(),d.createElementBlock("div",_ue,[d.createElementVNode("button",{type:"button",onClick:a[3]||(a[3]=i=>{t.value=!1,n.$emit("update:modelValue",!1),n.$emit("confirm")}),class:d.normalizeClass([[n.confirmButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 text-white shadow-sm disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50"])},d.toDisplayString(n.confirmButtonText),3),d.createElementVNode("button",{type:"button",class:d.normalizeClass([[n.cancelButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 disabled:opacity-50 disabled:pointer-events-none"]),onClick:a[4]||(a[4]=i=>{t.value=!1,n.$emit("update:modelValue",!1),n.$emit("cancel")})},d.toDisplayString(n.cancelButtonText),3)]))])])])):d.createCommentVNode("",!0)]))}}),wR=Lt(xue,[["__scopeId","data-v-fa9b5c2d"]]),wue={key:0,class:"loading-overlay"},Sue=d.defineComponent({__name:"vs-loading",props:{visible:{type:Boolean}},setup(r){const e=r,t=d.ref(e.visible);return d.watch(()=>e.visible,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[t.value?(d.openBlock(),d.createElementBlock("div",wue,a[0]||(a[0]=[d.createElementVNode("div",{class:"loading-spinner"},null,-1)]))):d.createCommentVNode("",!0)]),_:1})]))}}),R1=Lt(Sue,[["__scopeId","data-v-2afca876"]]),kue={},Eue={xmlns:"http://www.w3.org/2000/svg",class:"size-4",viewBox:"0 0 20 20",fill:"currentColor"};function Cue(r,e){return d.openBlock(),d.createElementBlock("svg",Eue,e[0]||(e[0]=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))}const SR=Lt(kue,[["render",Cue]]),Tue={},Due={xmlns:"http://www.w3.org/2000/svg",class:"size-4",viewBox:"0 0 20 20",fill:"currentColor"};function Aue(r,e){return d.openBlock(),d.createElementBlock("svg",Due,e[0]||(e[0]=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)]))}const kR=Lt(Tue,[["render",Aue]]),Mue={},Nue={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",height:"16",width:"16"};function Lue(r,e){return d.openBlock(),d.createElementBlock("svg",Nue,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Iue=Lt(Mue,[["render",Lue]]),Bue={},Vue={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 text-blue-600",width:"14",height:"14"};function Rue(r,e){return d.openBlock(),d.createElementBlock("svg",Vue,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Pue=Lt(Bue,[["render",Rue]]),Oue={class:"flex items-center justify-between w-full"},zue={class:"m-0 flex list-none justify-center gap-1 p-0 text-gray-900"},Fue=["onClick"],$ue={key:1},Gue={for:"Page"},Uue=["value","max"],Hue={key:2,class:"text-sm/8 font-medium tracking-widest"},Wue={key:0,class:"flex justify-center items-center gap-x-5 ml-3"},Yue={class:"hs-dropdown-menu z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 right-0 dark:divide-neutral-700 absolute bottom-[100%]",role:"menu","aria-orientation":"vertical","aria-labelledby":"dropdown-button"},que=["onClick"],Zue=d.defineComponent({__name:"vs-pagination",props:{pageSize:{},page:{},total:{},view:{default:"button"},pageSizes:{default:()=>[10,20,30]},showPageSizes:{type:Boolean,default:!0},pageRange:{default:7},size:{default:7},color:{default:"teal"}},emits:["update:page","pageChange","pageSizeChange"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(t.page),i=d.computed(()=>Math.ceil(t.total/t.pageSize)),o=d.computed(()=>{const v=Math.floor(t.pageRange/2);let m=a.value-v,y=a.value+v;m<1&&(y+=1-m,m=1),y>i.value&&(m-=y-i.value,y=i.value),m=Math.max(1,m);const b=[];for(let _=m;_<=y;_+=1)b.push(_);return b}),s=v=>{a.value=v,n("update:page",v),n("pageChange",v)},l=()=>{a.value>1&&s(a.value-1)},u=()=>{a.value<i.value&&s(a.value+1)};d.watch(()=>t.page,v=>{a.value=v});const c=d.ref(t.pageSize),f=d.ref(!1),h=d.ref(null);d.watch(()=>t.pageSize,v=>{c.value=v});const p=(v=c.value)=>{c.value=v,f.value=!1,a.value=1,n("update:page",a.value),n("pageSizeChange",c.value)},g=v=>{if(!f.value)return;const m=v.target;h.value&&m&&!h.value.contains(m)&&(f.value=!1)};return d.onMounted(()=>{document.addEventListener("click",g)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",g)}),(v,m)=>(d.openBlock(),d.createElementBlock("div",Oue,[d.createElementVNode("ul",zue,[d.createElementVNode("li",null,[d.createElementVNode("button",{class:d.normalizeClass(["grid size-7 cursor-pointer place-content-center rounded border border-gray-200 transition-colors hover:bg-gray-50 rtl:rotate-180",{"opacity-50 pointer-events-none":a.value===1}]),"aria-label":"Previous page",onClick:l},[d.createVNode(SR)],2)]),v.view==="button"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(o.value,y=>(d.openBlock(),d.createElementBlock("li",{key:y,class:d.normalizeClass([[`size-${t.size} text-sm/${t.size} px-1.5`,y===a.value&&v.color?`bg-[${v.color}]`:"",y===a.value?`block rounded border border-${v.color}-600 text-center font-medium text-white`:"block rounded border border-gray-200 text-center font-medium transition-colors hover:bg-gray-50"],"cursor-pointer"]),onClick:b=>s(y)},d.toDisplayString(y),11,Fue))),128)):v.view==="input"?(d.openBlock(),d.createElementBlock("li",$ue,[d.createElementVNode("label",Gue,[m[2]||(m[2]=d.createElementVNode("span",{class:"sr-only"}," Page ",-1)),d.createElementVNode("input",{type:"number",id:"Page",value:a.value,min:"1",max:i.value,onInput:m[0]||(m[0]=y=>s(Number(y))),class:"pagination-input block h-8 w-16 rounded border border-gray-300 px-3 py-2 text-base leading-6 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"},null,40,Uue)])])):v.view==="xy"?(d.openBlock(),d.createElementBlock("li",Hue,d.toDisplayString(a.value)+"/"+d.toDisplayString(i.value),1)):d.createCommentVNode("",!0),d.createElementVNode("li",null,[d.createElementVNode("button",{onClick:u,class:d.normalizeClass(["grid size-7 cursor-pointer place-content-center rounded border border-gray-200 transition-colors hover:bg-gray-50 rtl:rotate-180",{"opacity-50 pointer-events-none":a.value===i.value}]),"aria-label":"Next page"},[d.createVNode(kR)],2)])]),v.showPageSizes?(d.openBlock(),d.createElementBlock("div",Wue,[d.createElementVNode("div",{class:"relative",ref_key:"dropdownRef",ref:h},[d.withDirectives(d.createElementVNode("div",Yue,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.pageSizes,y=>(d.openBlock(),d.createElementBlock("button",{type:"button",key:y,onClick:b=>p(y),class:"flex w-full items-center gap-x-3.5 rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 dark:focus:bg-neutral-700"},[d.createTextVNode(d.toDisplayString(y)+" ",1),c.value===y?(d.openBlock(),d.createBlock(Pue,{key:0})):d.createCommentVNode("",!0)],8,que))),128))],512),[[d.vShow,f.value]]),d.createElementVNode("button",{type:"button",class:"inline-flex min-w-[32px] text-sm/7 items-center gap-x-1 rounded-md border border-gray-200 px-1.5 h-[1.75rem] text-base text-gray-800 shadow-sm hover:bg-gray-50 focus:bg-gray-100 focus:outline-none disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700","aria-haspopup":"menu","aria-expanded":"false","aria-label":"Dropdown",onClick:m[1]||(m[1]=y=>f.value=!f.value)},[d.createTextVNode(d.toDisplayString(c.value)+" ",1),d.createVNode(Iue)])],512)])):d.createCommentVNode("",!0)]))}}),ER=Lt(Zue,[["__scopeId","data-v-fd550e03"]]),Xue={class:"relative w-full overflow-hidden"},jue={class:"absolute bottom-3 left-1/2 -translate-x-1/2 flex space-x-2"},Kue=["onClick"],CR=d.defineComponent({__name:"vs-slider",props:{interval:{default:3e3},autoplay:{type:Boolean,default:!1}},setup(r){const e=r,t=d.useSlots(),n=d.ref(0);let a=null;const i=d.computed(()=>(t.default?t.default():[]).map(c=>d.h("div",{class:"w-full flex-shrink-0"},[c]))),o=d.computed(()=>i.value.length),s=()=>{o.value>0&&(n.value=(n.value+1)%o.value)},l=()=>{o.value>0&&(n.value=(n.value-1+o.value)%o.value)},u=c=>{n.value=c};return d.onMounted(()=>{e.autoplay&&e.interval&&e.interval>0&&(a=window.setInterval(s,e.interval))}),d.onBeforeUnmount(()=>{a&&clearInterval(a)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",Xue,[d.createElementVNode("div",{class:"flex transition-transform duration-500 ease-in-out",style:d.normalizeStyle({transform:`translateX(-${n.value*100}%)`})},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(h,p)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h),{key:p}))),128))],4),d.createElementVNode("button",{onClick:l,class:"absolute top-1/2 left-3 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70"},[d.createVNode(SR)]),d.createElementVNode("button",{onClick:s,class:"absolute top-1/2 right-3 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70"},[d.createVNode(kR)]),d.createElementVNode("div",jue,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.value,(h,p)=>(d.openBlock(),d.createElementBlock("button",{key:p,onClick:g=>u(p),class:d.normalizeClass(["w-3 h-3 rounded-full transition",n.value===p?"bg-white":"bg-white/50"])},null,10,Kue))),128))])]))}}),TR={mounted(r,e){if(typeof document>"u")return;let t=null;const n=()=>{t=document.createElement("div"),t.textContent=e.value,Object.assign(t.style,{position:"absolute",background:"#333",color:"#fff",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:"9999"}),document.body.appendChild(t);const i=r.getBoundingClientRect();t.style.left=`${i.left+window.scrollX}px`,t.style.top=`${i.top+window.scrollY-t.offsetHeight-5}px`},a=()=>{t&&t.parentNode&&(t.parentNode.removeChild(t),t=null)};r.addEventListener("mouseenter",n),r.addEventListener("mouseleave",a),Object.assign(r,{tooltipHandlers:{showTooltip:n,hideTooltip:a}})},unmounted(r){if(typeof document>"u")return;const e=r.tooltipHandlers;e&&(r.removeEventListener("mouseenter",e.showTooltip),r.removeEventListener("mouseleave",e.hideTooltip),typeof e.hideTooltip=="function"&&e.hideTooltip(),delete r.tooltipHandlers)}},DR={mounted(r,e){const t=document.createElement("div");t.className=`
|
|
289
|
+
</div>`;const a=this.map.project(r.lngLat);this.popupElement.style.left=`${a.x}px`,this.popupElement.style.top=`${a.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}},Hoe={class:"h-full"},Woe={class:"flex items-start justify-between mb-[6px] w-full"},Yoe={class:"text-gray-800 font-[600]"},qoe={class:"flex gap-2"},Zoe=["onClick"],Xoe=["id"],joe=["id"],Koe={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"},Qoe={class:"h-[calc(250px)]"};function Joe(r,e,t,n,a,i){var h,p,g,v,m,y,b,_,x,w;const o=d.resolveComponent("VsMapSetting"),s=d.resolveComponent("VsMapSlotLayers"),l=d.resolveComponent("VsMapGoHome"),u=d.resolveComponent("VsClusterLegend"),c=d.resolveComponent("VsList"),f=d.resolveComponent("VsBar");return d.openBlock(),d.createElementBlock("div",Hoe,[d.createElementVNode("div",Woe,[d.createElementVNode("h3",Yoe,d.toDisplayString(r.title),1),d.createElementVNode("div",qoe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,S=>(d.openBlock(),d.createElementBlock("button",{class:d.normalizeClass(["p-1 text-gray-700 border rounded",[a.activeTab===(S==null?void 0:S.id)?"ring-2 ring-blue-500":""]]),onClick:k=>a.activeTab=S==null?void 0:S.id},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(S==null?void 0:S.component),{height:"16",width:"16"}))],10,Zoe))),256))])]),d.withDirectives(d.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${a.mapId}`},[d.createElementVNode("div",{id:a.mapId,class:"h-full w-full flex items-end min-h-[250px]"},null,8,joe),a.showSetting?(d.openBlock(),d.createBlock(o,{key:0,map:a.map,coordinates:a.coordinatesByMouse},null,8,["map","coordinates"])):d.createCommentVNode("",!0),d.createVNode(s,{map:a.map},null,8,["map"]),d.createElementVNode("div",Koe,[d.createVNode(l,{map:a.map,bbox:(h=a.data)==null?void 0:h.bounds},null,8,["map","bbox"])]),d.createVNode(u,{mapId:a.mapId,colors:(p=a.data)==null?void 0:p.colors,sizes:(g=a.data)==null?void 0:g.sizes,color:a.baseColor,changeOpacityItem:"true",cluster:"true"},null,8,["mapId","colors","sizes","color"])],8,Xoe),[[d.vShow,a.activeTab=="map"]]),d.withDirectives(d.createVNode(c,{mapId:a.mapId,source:(v=a.data)==null?void 0:v.rows,total:((m=a.data)==null?void 0:m.total)||0,count:((y=a.data)==null?void 0:y.count)||0,onKattotg:e[0]||(e[0]=S=>a.kattotg=S)},null,8,["mapId","source","total","count"]),[[d.vShow,a.activeTab=="table"]]),d.withDirectives(d.createElementVNode("div",Qoe,[(_=(b=a.data)==null?void 0:b.rows)!=null&&_.length?(d.openBlock(),d.createBlock(f,{key:0,source:(w=(x=a.data)==null?void 0:x.rows)==null?void 0:w.map(S=>({title:S==null?void 0:S.title,metric:S==null?void 0:S.metric}))},null,8,["source"])):d.createCommentVNode("",!0)],512),[[d.vShow,a.activeTab=="chart"]])])}const ese=Object.freeze(Object.defineProperty({__proto__:null,default:wt(Uoe,[["render",Joe]])},Symbol.toStringTag,{value:"Module"})),tse={name:"VsTable",mixins:[Fr],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>Bc(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>xn(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},rse={class:"flex flex-col h-full pt-[16px] pb-[16px] space-y-4 rounded-xl"},nse={class:"overflow-auto h-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},ase={class:"inline-block min-w-full align-middle"},ise={class:"relative min-w-full divide-y divide-gray-200 text-[12px]"},ose={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},sse={class:"space-x-2"},lse={scope:"col",class:"xl:min-w-[120px] min-w-48"},use={class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1"},cse={class:"divide-y divide-gray-200"},dse={class:"text-gray-600"};function fse(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",rse,[d.createElementVNode("div",nse,[d.createElementVNode("div",ase,[d.createElementVNode("table",ise,[d.createElementVNode("thead",ose,[d.createElementVNode("tr",sse,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.dimensions,o=>(d.openBlock(),d.createElementBlock("th",lse,[d.createElementVNode("div",use,d.toDisplayString(o),1)]))),256))])]),d.createElementVNode("tbody",cse,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.sourceData,(o,s)=>(d.openBlock(),d.createElementBlock("tr",{key:s},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.dimensions,(l,u)=>(d.openBlock(),d.createElementBlock("td",{key:u,class:"py-3 whitespace-nowrap"},[d.createElementVNode("span",dse,d.toDisplayString(o==null?void 0:o[l]),1)]))),128))]))),128))])])])])])}const hse=Object.freeze(Object.defineProperty({__proto__:null,default:wt(tse,[["render",fse]])},Symbol.toStringTag,{value:"Module"})),pse=["type","disabled"],gR=d.defineComponent({__name:"button",props:{type:{},variant:{},disabled:{type:Boolean}},emits:["click"],setup(r,{emit:e}){const t=r,n=e,a=o=>{t.disabled||n("click",o)},i=d.computed(()=>{switch(t.variant){case"secondary":return"bg-gray-200 text-black hover:bg-gray-300";case"danger":return"bg-red-500 text-white hover:bg-red-600";default:return"bg-blue-600 text-white hover:bg-blue-700"}});return(o,s)=>(d.openBlock(),d.createElementBlock("button",{type:o.type,class:d.normalizeClass(["px-4 py-2 rounded font-semibold",i.value,o.disabled?"opacity-50 cursor-not-allowed":""]),disabled:o.disabled,onClick:a},[d.renderSlot(o.$slots,"default")],10,pse))}}),gse=(r,e=.1)=>{function t(i){return{black:"0, 0, 0",white:"255, 255, 255",red:"255, 0, 0",green:"0, 128, 0",blue:"0, 0, 255",gray:"128, 128, 128",yellow:"255, 255, 0",cyan:"0, 255, 255",magenta:"255, 0, 255",orange:"255, 165, 0",purple:"128, 0, 128",brown:"165, 42, 42",pink:"255, 192, 203",lime:"0, 255, 0",navy:"0, 0, 128",teal:"0, 128, 128",olive:"128, 128, 0",maroon:"128, 0, 0",silver:"192, 192, 192",gold:"255, 215, 0"}[i]||null}function n(i){let o=i.replace(/^#/,"");o.length===3&&(o=o.split("").map(f=>f+f).join(""));const s=parseInt(o,16),l=s>>16&255,u=s>>8&255,c=s&255;return`${l}, ${u}, ${c}`}let a;if(typeof r=="string"&&r.startsWith("#"))a=n(r);else if(typeof r=="string")a=t(r);else throw new Error("Invalid color format");if(a)return`rgba(${a}, ${e})`;throw new Error("Color not found")},vse={props:{text:{type:String,default:()=>"",required:!0},color:{type:String,default:()=>"",required:!1}},computed:{createStyle(){return this.color?{backgroundColor:gse(this.color,.2)}:{backgroundColor:"rgb(245 245 244)"}}}},Lt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t};function mse(r,e,t,n,a,i){return t.text?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["py-1.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-full",t.color?`text-[${t.color}]`:"text-gray-700"]),style:d.normalizeStyle(i.createStyle)},d.toDisplayString(t.text),7)):d.createCommentVNode("",!0)}const yse=Lt(vse,[["render",mse]]),bse={props:{value:{type:String,default:()=>""}},computed:{dateValue(){try{return new Date(this.value).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return this.value}}}},_se={class:"whitespace-nowrap"};function xse(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",_se,d.toDisplayString(i.dateValue),1)}const vR=Lt(bse,[["render",xse]]),wse={},Sse={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 kse(r,e){return d.openBlock(),d.createElementBlock("svg",Sse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Ese=Lt(wse,[["render",kse]]),Cse={},Tse={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 Dse(r,e){return d.openBlock(),d.createElementBlock("svg",Tse,e[0]||(e[0]=[d.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 Ase=Lt(Cse,[["render",Dse]]),Mse={},Nse={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 Lse(r,e){return d.openBlock(),d.createElementBlock("svg",Nse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const mR=Lt(Mse,[["render",Lse]]),Ise={},Bse={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-x"};function Vse(r,e){return d.openBlock(),d.createElementBlock("svg",Bse,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),d.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Rse=Lt(Ise,[["render",Vse]]),Pse={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},Ose={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},zse={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Fse={class:"mt-3 text-center sm:mt-5"},$se={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Gse={class:"mt-2"},Use={class:"text-sm text-gray-500"},Hse={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},Wse={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Yse={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},qse={class:"sm:flex sm:items-start"},Zse={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Xse={id:"dialog-title",class:"text-base font-semibold text-gray-900"},jse={class:"mt-2"},Kse={class:"text-sm text-gray-500"},Qse={key:0,class:"mt-2"},Jse=["placeholder"],ele=d.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(r,{emit:e}){const t=d.ref(null);d.onMounted(()=>{var g;(g=t.value)==null||g.focus()});const n={success:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[d.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[d.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[d.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>d.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[d.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},a=r,i=e,o=d.ref(a.modelValue),s=d.ref("");d.watch(()=>a.modelValue,g=>{o.value=g,g===!0&&a.mode==="prompt"&&(s.value="")});function l(g){o.value=!1,i("update:modelValue",!1),g==="confirm"&&a.mode==="prompt"?i("confirm",s.value):i(g)}function u(){l("confirm")}const c=d.computed(()=>{switch(a.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),f=d.computed(()=>a.type==="warning"?"bg-orange-600 hover:bg-orange-500":a.type==="success"?"bg-green-600 hover:bg-green-500":a.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),h=d.computed(()=>n[a.type||"error"]||n.error),p=d.computed(()=>a.title&&a.title.trim()!==""?a.title:a.type?a.type.charAt(0).toUpperCase()+a.type.slice(1):"Notification");return(g,v)=>{const m=d.resolveDirective("focus");return d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[o.value?(d.openBlock(),d.createElementBlock("div",Pse,[g.mode==="alert"?(d.openBlock(),d.createElementBlock("div",Ose,[d.createElementVNode("div",zse,[d.createElementVNode("div",null,[v[4]||(v[4]=d.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[d.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[d.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),d.createElementVNode("div",Fse,[d.createElementVNode("h3",$se,d.toDisplayString(p.value),1),d.createElementVNode("div",Gse,[d.createElementVNode("p",Use,d.toDisplayString(g.message),1)])])])]),d.createElementVNode("div",Hse,[d.createElementVNode("button",{type:"button",onClick:v[0]||(v[0]=y=>l("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},d.toDisplayString(g.confirmButtonText),1)])])):(d.openBlock(),d.createElementBlock("div",Wse,[d.createElementVNode("div",Yse,[d.createElementVNode("div",qse,[d.createElementVNode("div",{class:d.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",c.value])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h.value)))],2),d.createElementVNode("div",Zse,[d.createElementVNode("h3",Xse,d.toDisplayString(p.value),1),d.createElementVNode("div",jse,[d.createElementVNode("p",Kse,d.toDisplayString(g.message),1)]),g.mode==="prompt"?(d.openBlock(),d.createElementBlock("div",Qse,[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":v[1]||(v[1]=y=>s.value=y),placeholder:g.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:d.withKeys(u,["enter"]),type:"text"},null,40,Jse),[[d.vModelText,s.value],[m]])])):d.createCommentVNode("",!0)])])]),d.createElementVNode("div",{class:d.normalizeClass(["bg-gray-50 px-4 py-3",g.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[d.createElementVNode("button",{type:"button",onClick:v[2]||(v[2]=y=>l("confirm")),class:d.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",f.value])},d.toDisplayString(g.confirmButtonText),3),d.createElementVNode("button",{type:"button",onClick:v[3]||(v[3]=y=>l("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},d.toDisplayString(g.cancelButtonText),1)],2)]))])):d.createCommentVNode("",!0)])}}}),Cp=Lt(ele,[["__scopeId","data-v-46ded130"]]),tle=["aria-label"],rle={class:"absolute top-[15px] right-[15px] z-20 flex flex-row gap-2 items-center"},nle=["href"],ale={class:"text-center text-white text-sm absolute bottom-[10px] left-[50%] -translate-x-1/2"},ile={class:"relative w-full max-w-[80vw] h-[90vh]"},ole={class:"flex items-center justify-center w-full h-full"},sle=["src","alt"],lle=["src"],ule=["src"],cle={key:3,class:"flex flex-col items-center justify-center w-full h-full text-white text-center"},dle={class:"text-sm text-gray-300 mb-4"},fle=["href"],hle=d.defineComponent({__name:"vs-lightbox",props:{modelValue:{type:Boolean},ignoreFormat:{type:Boolean},images:{},startIndex:{},download:{type:Boolean},delete:{type:Boolean}},emits:["update:modelValue","update:index","delete"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!!t.modelValue),i=d.ref(t.startIndex??0),o=d.ref(!1),s=d.ref("");d.watch(()=>t.modelValue,w=>{a.value=!!w}),d.watch(a,w=>{n("update:modelValue",w)}),d.watch(()=>t.startIndex,w=>{typeof w=="number"&&(i.value=w)});const l=d.computed(()=>t.images||[]),u=d.computed(()=>l.value[i.value]??"");function c(){a.value=!1}function f(){l.value.length<=1||(i.value=(i.value-1+l.value.length)%l.value.length,n("update:index",i.value))}function h(){l.value.length<=1||(i.value=(i.value+1)%l.value.length,n("update:index",i.value))}function p(w){a.value&&(w.key==="Escape"&&c(),w.key==="ArrowLeft"&&f(),w.key==="ArrowRight"&&h())}function g(w){return[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico"].some(S=>w.toLowerCase().includes(S))}function v(w){return[".mp4",".webm",".ogg",".mov",".avi",".mkv",".flv",".wmv"].some(S=>w.toLowerCase().includes(S))}function m(w){return w.toLowerCase().includes(".pdf")}function y(w){return[".txt",".md",".html",".htm",".css",".js",".ts",".json",".xml",".csv",".log"].some(S=>w.toLowerCase().includes(S))}function b(w){const S=w.lastIndexOf(".");return S===-1?"Unknown file type":w.substring(S+1).toUpperCase()}function _(w){s.value=w,o.value=!0}function x(){n("delete",s.value),i.value=0,o.value=!1,a.value=!1}return d.onMounted(()=>{window.addEventListener("keydown",p)}),d.onBeforeUnmount(()=>{window.removeEventListener("keydown",p)}),(w,S)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.Transition,{name:"lightbox-fade"},{default:d.withCtx(()=>[a.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"fixed inset-0 z-[2000] bg-black/70 flex items-center justify-center",onClick:d.withModifiers(c,["self"]),role:"dialog","aria-modal":"true","aria-label":`Image ${i.value+1} of ${l.value.length}`},[d.createElementVNode("div",rle,[t.delete?(d.openBlock(),d.createElementBlock("button",{key:0,onClick:S[0]||(S[0]=k=>_(u.value)),class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300"},[d.createVNode(Ase,{class:"w-4 h-4"})])):d.createCommentVNode("",!0),t.download?(d.openBlock(),d.createElementBlock("a",{key:1,href:u.value,download:"",class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300"},[d.createVNode(Ese,{class:"w-4 h-4"})],8,nle)):d.createCommentVNode("",!0),d.createElementVNode("button",{class:"bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:c,"aria-label":"Close"},[d.createVNode(Rse,{class:"w-4 h-4"})])]),l.value.length>1?(d.openBlock(),d.createElementBlock("button",{key:0,class:"absolute left-[15px] top-1/2 -translate-y-1/2 z-20 bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:d.withModifiers(f,["stop"]),"aria-label":"Previous"},[d.createVNode(mR,{class:"w-4 h-4 rotate-90"})])):d.createCommentVNode("",!0),l.value.length>1?(d.openBlock(),d.createElementBlock("button",{key:1,class:"absolute right-[15px] top-1/2 -translate-y-1/2 z-20 bg-black/50 text-white rounded px-4 py-3 hover:scale-110 transition-all duration-300",onClick:d.withModifiers(h,["stop"]),"aria-label":"Next"},[d.createVNode(mR,{class:"w-4 h-4 -rotate-90"})])):d.createCommentVNode("",!0),d.createElementVNode("div",ale,d.toDisplayString(i.value+1)+" / "+d.toDisplayString(l.value.length),1),d.createElementVNode("div",ile,[d.createElementVNode("div",ole,[g(u.value)||t.ignoreFormat?(d.openBlock(),d.createElementBlock("img",{key:0,src:u.value,alt:`Image ${i.value+1}`,class:"max-w-full max-h-full object-contain"},null,8,sle)):v(u.value)?(d.openBlock(),d.createElementBlock("video",{key:1,src:u.value,class:"max-w-full max-h-full object-contain",controls:"",autoplay:"",muted:""}," Your browser does not support the video tag. ",8,lle)):m(u.value)||y(u.value)?(d.openBlock(),d.createElementBlock("iframe",{key:2,src:u.value,class:"w-full h-full bg-white"},null,8,ule)):(d.openBlock(),d.createElementBlock("div",cle,[S[2]||(S[2]=d.createElementVNode("div",{class:"mb-4"},[d.createElementVNode("svg",{class:"w-16 h-16 mx-auto text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1)),S[3]||(S[3]=d.createElementVNode("p",{class:"text-lg mb-2"},"Файл не підтримується для перегляду",-1)),d.createElementVNode("p",dle,d.toDisplayString(b(u.value)),1),d.createElementVNode("a",{href:u.value,target:"_blank",download:"",class:"bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg transition-colors"}," Завантажити файл ",8,fle)]))])])],8,tle)):d.createCommentVNode("",!0)]),_:1}),d.createVNode(Cp,{modelValue:o.value,"onUpdate:modelValue":S[1]||(S[1]=k=>o.value=k),onConfirm:x,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"])],64))}}),I1=Lt(hle,[["__scopeId","data-v-815d1d2d"]]),ple={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},gle=["onClick"],vle=["src"],mle={key:0,class:"thumb-cover"},yR=d.defineComponent({__name:"vs-grid-gallery",props:{images:{},width:{},height:{}},setup(r){const e=d.ref(!1),t=d.ref(0);function n(i){return i.map(o=>o.src||o)}const a=d.ref(n(r.images||[]));return(i,o)=>{var s;return((s=a.value)==null?void 0:s.length)>=1?(d.openBlock(),d.createElementBlock("div",ple,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,(l,u)=>{var c,f;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass("h-full w-full image"+u),key:u},[u<5?(d.openBlock(),d.createElementBlock("a",{key:0,onClick:h=>{t.value=u,e.value=!0},rel:"noreferrer",class:"relative block h-full w-full"},[d.createElementVNode("img",{src:l,alt:"alt",height:"auto",width:"100%",class:d.normalizeClass(["object-cover h-full w-full",u===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,vle),u===4&&((c=a.value)==null?void 0:c.length)>5?(d.openBlock(),d.createElementBlock("div",mle," +"+d.toDisplayString(((f=a.value)==null?void 0:f.length)-5),1)):d.createCommentVNode("",!0)],8,gle)):d.createCommentVNode("",!0)],2)}),128)),d.createVNode(I1,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),images:a.value.map(l=>l),ignoreFormat:!0,startIndex:t.value,"onUpdate:index":o[1]||(o[1]=l=>t.value=l)},null,8,["modelValue","images","startIndex"])])):d.createCommentVNode("",!0)}}}),yle={},ble={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 _le(r,e){return d.openBlock(),d.createElementBlock("svg",ble,e[0]||(e[0]=[d.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 xle=Lt(yle,[["render",_le]]),wle={},Sle={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 kle(r,e){return d.openBlock(),d.createElementBlock("svg",Sle,e[0]||(e[0]=[d.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 Ele=Lt(wle,[["render",kle]]),Cle={},Tle={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 Dle(r,e){return d.openBlock(),d.createElementBlock("svg",Tle,e[0]||(e[0]=[d.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 Ale=Lt(Cle,[["render",Dle]]),Mle={},Nle={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 Lle(r,e){return d.openBlock(),d.createElementBlock("svg",Nle,e[0]||(e[0]=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Ile=Lt(Mle,[["render",Lle]]),Ble={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Vle={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Rle={class:"flex-1"},Ple={class:"font-medium text-gray-900"},Ole={class:"mt-0.5 text-sm text-gray-700"},B1=d.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(r){const e={success:xle,warning:Ele,error:Ile,info:Ale};return(t,n)=>(d.openBlock(),d.createElementBlock("div",Ble,[d.createElementVNode("div",Vle,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e[t.type]))),d.createElementVNode("div",Rle,[d.createElementVNode("strong",Ple,d.toDisplayString(t.title),1),d.createElementVNode("p",Ole,d.toDisplayString(t.message),1)]),n[0]||(n[0]=d.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"},[d.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),d.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"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),Tp={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"},pt=r=>{var l;const{type:e="info",title:t,message:n,position:a="right-bottom"}=r||{};let i=document.querySelector("#notify-root");i||(i=document.createElement("div"),i.id="notify-root",i.className=`fixed z-[2000] flex flex-col gap-3 ${Tp[a]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(i)),i.className.includes(Tp[a])||(Object.values(Tp).forEach(u=>{i.classList.remove(...u.split(" "))}),i.classList.add(...Tp[a].split(" ")));const o=document.createElement("div");i.appendChild(o);const s=d.createApp({render(){return d.h(B1,{type:e,title:t,message:n,onClose:()=>{s.unmount(),o.remove()}})}});s.mount(o),(l=o.querySelector("button"))==null||l.addEventListener("click",()=>{o.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),o.remove()},350)}),setTimeout(()=>{o.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),o.remove()},350)},3500)},zle=d.defineComponent({name:"Copy",props:{text:{type:String,default:""},width:{type:[String,Number],default:null},notify:{type:Boolean,default:!0},notifyOptions:{type:Object,default:()=>({})}},emits:["copied","copy-error"],data(){return{slotText:""}},computed:{rootClasses(){return["vs-copy inline-flex items-center gap-2 cursor-pointer select-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500"]},containerStyle(){return!this.width&&this.width!==0?{}:{width:typeof this.width=="number"?`${this.width}px`:this.width.trim()}},displayText(){return this.text||this.slotText}},mounted(){this.updateSlotText()},updated(){this.updateSlotText()},methods:{updateSlotText(){var e,t;const r=((t=(e=this.$refs.text)==null?void 0:e.textContent)==null?void 0:t.trim())||"";r!==this.slotText&&(this.slotText=r)},async handleCopy(){const r=this.displayText;if(r)try{await this.copyToClipboard(r),this.$emit("copied",r),this.showNotify(r)}catch(e){this.$emit("copy-error",e)}},async copyToClipboard(r){var t;if((t=navigator.clipboard)!=null&&t.writeText){await navigator.clipboard.writeText(r);return}const e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select();try{if(!document.execCommand("copy"))throw new Error("Copy command was unsuccessful")}finally{document.body.removeChild(e)}},showNotify(r){var t,n,a,i;if(!this.notify)return;const e={type:((t=this.notifyOptions)==null?void 0:t.type)??"success",title:((n=this.notifyOptions)==null?void 0:n.title)??"Copied",message:((a=this.notifyOptions)==null?void 0:a.message)??r,position:(i=this.notifyOptions)==null?void 0:i.position};pt(e)}}}),Fle=["title"];function $le(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("span",{ref:"root",class:d.normalizeClass(r.rootClasses),role:"button",tabindex:"0",style:d.normalizeStyle(r.containerStyle),onClick:e[0]||(e[0]=(...o)=>r.handleCopy&&r.handleCopy(...o)),onKeydown:[e[1]||(e[1]=d.withKeys(d.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"]),["enter"])),e[2]||(e[2]=d.withKeys(d.withModifiers((...o)=>r.handleCopy&&r.handleCopy(...o),["prevent"]),["space"]))]},[d.createElementVNode("span",{ref:"text",class:"vs-copy__text truncate min-w-0 flex-1",title:r.displayText},[d.renderSlot(r.$slots,"default")],8,Fle),e[3]||(e[3]=d.createElementVNode("span",{class:"vs-copy__icon flex-none inline-flex text-current","aria-hidden":"true"},[d.createElementVNode("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"},[d.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.createElementVNode("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})])],-1))],38)}const V1=Lt(zle,[["render",$le]]),Gle=d.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(r){this.$emit("update:modelValue",r)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(r){const{keyCode:e}=r;e===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}}),Ule=["disabled"],Hle={class:"ml-2 text-sm"};function Wle(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["relative inline-flex items-center cursor-pointer min-h-[40px] relative",r.labelCursorClasses])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>r.modelState=o),type:"checkbox",value:"",class:"sr-only peer",disabled:r.disabled,tabindex:"-1"},null,8,Ule),[[d.vModelCheckbox,r.modelState]]),d.createElementVNode("div",{class:"w-11 h-6 t-[12px] bg-gray-200 transition-all rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[10px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600 outline-none focus:border dark:bg-transparent dark:border-gray-600 focus:border-blue-500",tabindex:"0",onFocus:e[1]||(e[1]=(...o)=>r.addKeyHandler&&r.addKeyHandler(...o)),onBlur:e[2]||(e[2]=(...o)=>r.removeKeyHandler&&r.removeKeyHandler(...o))},null,32),d.createElementVNode("span",Hle,[d.renderSlot(r.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(r.title),1)])])],2)}const bR=Lt(Gle,[["render",Wle]]),Vc=async(r,e,t,n=10)=>{var v,m,y,b;if(!e||!t)return;await d.nextTick();const a=await(t==null?void 0:t.getBoundingClientRect()),i=await(e==null?void 0:e.getBoundingClientRect());if(!i||!a)return;const o=await parseInt((v=e==null?void 0:e.getBoundingClientRect())==null?void 0:v.height),s=await parseInt((m=e==null?void 0:e.getBoundingClientRect())==null?void 0:m.width),l=await parseInt((y=t==null?void 0:t.getBoundingClientRect())==null?void 0:y.height),u=await parseInt((b=t==null?void 0:t.getBoundingClientRect())==null?void 0:b.width),c=await window.innerHeight,f=await window.innerWidth;let h=0,p=0;const g=i.bottom+n+l;switch(r){case"top":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,f>u+i.right+30?p=i.left-a.width/2+i.width/2:p=f-30-u;break;case"bottom":c>g?h=i.bottom+n:h=i.bottom-n-l-o,p=i.left-a.width/2+i.width/2;break;case"left":h=i.top-a.height/2+i.height/2,i.left-a.width-n>0?p=i.left-a.width-n:p=10;break;case"right":h=i.top-a.height/2+i.height/2,f-s>u?p=i.right+n:p=f-30-u;break;case"top-right":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,f-s>u?p=i.right+n:p=f-30-u;break;case"top-left":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,i.left-a.width-n>0?p=i.left-a.width-n:p=10;break;case"top-start":i.top-a.height-n<0?h=i.top-a.height+n+l+o:h=i.top-a.height-n,i.left>0?p=i.left:p=10;break;case"bottom-right":c>g?h=i.bottom+n:h=i.bottom-n-l-o,f-s>u?p=i.left:p=f-30-u;break;case"bottom-left":c>g?h=i.bottom+n:h=i.bottom-n-l-o,i.left>0?p=i.right-u:p=10;break;case"bottom-start":c>g?h=i.bottom+n:h=i.bottom-n-l-o,i.left>0?p=i.left:p=10;break}h+l>c?h=c-l-n:h<0&&(h=n),p+u>f?p=f-u-n:p<0&&(p=n),t instanceof HTMLElement&&(t.style.top=`${h}px`,t.style.left=`${p}px`,t.style.position="fixed")},Yle={class:"text-center"},qle={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"},_R=d.defineComponent({__name:"vs-popover",props:{isOpen:{type:Boolean,default:!1},placement:{default:"top"},gap:{default:8},width:{default:""},disabled:{type:Boolean,default:!1},trigger:{default:"click"},teleport:{default:"body"}},emits:["isvisible"],setup(r,{expose:e,emit:t}){const n=r,a=t,i=d.ref(!1),o=d.ref([]),s=d.ref(null),l=d.ref(null),u=d.ref(null),c=_=>{var x,w;if(!_){i.value=!1;return}(x=l.value)!=null&&x.contains(_.target)||(w=u.value)!=null&&w.contains(_.target)||(i.value=!1)},f=_=>{i.value&&u.value&&!u.value.contains(_.target)&&(i.value=!1)},h=()=>{i.value=!1},p=()=>{i.value&&(i.value=!1)},g=()=>{let _=s.value;for(;_&&_!==document.body;)(_.scrollHeight>_.clientHeight||_.scrollWidth>_.clientWidth)&&(_.addEventListener("scroll",h),o.value.push(_)),_=_.parentElement;document.body&&(document.body.addEventListener("scroll",h),o.value.push(document.body))},v=()=>{o.value.forEach(_=>{_.removeEventListener("scroll",h)}),o.value=[]};d.watch(i,_=>{_?(g(),window.addEventListener("resize",()=>Vc(n.placement,l.value,u.value)),Vc(n.placement,l.value,u.value)):window.removeEventListener("resize",()=>Vc(n.placement,l.value,u.value)),a("isvisible",_)}),d.onMounted(()=>{window.addEventListener("click",c),window.addEventListener("popstate",p),window.addEventListener("scroll",f,!0),g()}),d.onBeforeUnmount(()=>{window.removeEventListener("click",c),window.removeEventListener("popstate",p),v()});const m=()=>{i.value=!0,Vc(n.placement,l.value,u.value)},y=()=>{i.value=!1},b=async()=>{await Vc(n.placement,l.value,u.value),i.value=!i.value};return e({togglePopover:b}),(_,x)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"popover",ref:s,class:"vs-popover inline-block"},[d.createElementVNode("div",Yle,[_.trigger==="click"?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:b,class:d.normalizeClass({"pointer-events-none":_.disabled})},[d.renderSlot(_.$slots,"reference",{},()=>[x[0]||(x[0]=d.createElementVNode("button",null,"Click me!",-1))])],2)):d.createCommentVNode("",!0),_.trigger==="hover"?(d.openBlock(),d.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:m,onMouseleave:y,class:d.normalizeClass({"pointer-events-none":_.disabled})},[d.renderSlot(_.$slots,"reference",{},()=>[x[1]||(x[1]=d.createElementVNode("button",null,"Click me!",-1))])],34)):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:_.teleport},[d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:d.normalizeClass(["vsTailwind vs-popover__content",_.placement]),ref_key:"contentPop",ref:u,style:d.normalizeStyle({width:_.width?_.width+"px":"fit-content",zIndex:10002})},[d.createElementVNode("div",qle,[d.renderSlot(_.$slots,"default",{},()=>[x[2]||(x[2]=d.createElementVNode("span",null,"Popover content",-1))])])],6),[[d.vShow,i.value]])]),_:3})],8,["to"]))])],512))}}),Zle={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},Xle={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},jle={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Kle={class:"ui-dialog__content p-4"},Qle={key:0,class:"flex justify-end gap-x-2"},Jle={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},eue=d.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.size==="small"?"md:w-5/12 w-9/12":t.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),i=d.useAttrs();function o(){n("done")}function s(){n("update:visible",!1),n("close")}function l(c){c.key==="Escape"&&s()}function u(c,f){f&&c.target.classList.contains("vs-dialog-overlay")&&s()}return d.onMounted(()=>{window.addEventListener("keydown",l)}),d.onUnmounted(()=>{window.removeEventListener("keydown",l)}),(c,f)=>(d.openBlock(),d.createBlock(d.Teleport,{to:c.teleport},[c.visible?(d.openBlock(),d.createElementBlock("div",Zle,[d.createElementVNode("div",{onMousedown:f[0]||(f[0]=h=>u(h,c.closeClickBack)),class:d.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[d.unref(i).class]])},[d.createVNode(d.Transition,{name:"content",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["ui-dialog__modal 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",a.value])},[d.createElementVNode("div",Xle,[d.createElementVNode("h3",jle,d.toDisplayString(c.title),1),d.createElementVNode("button",{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",onClick:s},f[1]||(f[1]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",Kle,[d.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer?(d.openBlock(),d.createElementBlock("div",Qle,[d.renderSlot(c.$slots,"footer",{handleClose:s},void 0,!0)])):d.createCommentVNode("",!0),c.buttonText?(d.openBlock(),d.createElementBlock("div",Jle,[d.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white 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",onClick:s}," Close "),d.createElementVNode("button",{type:"button",onClick:o,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},d.toDisplayString(c.buttonText),1)])):d.createCommentVNode("",!0)],2)]),_:3})],34)])):d.createCommentVNode("",!0)],8,["to"]))}}),xl=Lt(eue,[["__scopeId","data-v-670eae4f"]]),tue={key:0,class:"vsTailwind ui-drawer__wrapper"},rue={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},nue={class:"font-medium text-gray-800 dark:text-[#ffffff]"},aue={class:"flex gap-2"},iue={class:"sr-only"},oue={key:0,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"},sue={key:1,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"},lue={class:"ui-drawer__content p-4 flex-1 overflow-auto"},uue={key:0,class:"flex justify-end gap-x-2 p-4 border-0 border-t border-solid border-gray-200 dark:border-t-[#454545]"},cue=d.defineComponent({__name:"vs-drawer",props:{title:{default:""},visible:{type:Boolean,default:!1},position:{default:"right"},size:{default:"500px"},closeClickBack:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(!1),i=d.computed(()=>a.value?"fixed top-0 left-0 w-full h-full":t.position==="left"?"fixed top-0 left-0 h-full":t.position==="right"?"fixed top-0 right-0 h-full":t.position==="top"?"fixed top-0 left-0 w-full":"fixed bottom-0 left-0 w-full");function o(){n("update:visible",!1),n("close")}function s(){a.value=!a.value}function l(c){c.key==="Escape"&&o()}function u(c,f){f&&c.target.classList.contains("vs-drawer-overlay")&&o()}return d.onMounted(()=>{window.addEventListener("keydown",l)}),d.onUnmounted(()=>{window.removeEventListener("keydown",l)}),(c,f)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#modal"},[c.visible?(d.openBlock(),d.createElementBlock("div",tue,[d.createElementVNode("div",{onMousedown:f[0]||(f[0]=h=>u(h,c.closeClickBack)),class:"vs-drawer-overlay vs-drawer w-full h-full fixed top-0 start-0 bg-black bg-opacity-50"},[d.createVNode(d.Transition,{name:"drawer",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["ui-drawer__drawer 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)]",[i.value,a.value?"w-full":`w-[${t.size}]`,`drawer-${t.position}`]])},[d.createElementVNode("div",rue,[d.createElementVNode("h3",nue,d.toDisplayString(c.title),1),d.createElementVNode("div",aue,[d.createElementVNode("button",{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",onClick:s},[d.createElementVNode("span",iue,d.toDisplayString(a.value?"Exit fullscreen":"Enter fullscreen"),1),a.value?(d.openBlock(),d.createElementBlock("svg",sue,f[2]||(f[2]=[d.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(d.openBlock(),d.createElementBlock("svg",oue,f[1]||(f[1]=[d.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))]),d.createElementVNode("button",{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",onClick:o},f[3]||(f[3]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))])]),d.createElementVNode("div",lue,[d.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer?(d.openBlock(),d.createElementBlock("div",uue,[d.renderSlot(c.$slots,"footer",{handleClose:o},void 0,!0)])):d.createCommentVNode("",!0)],2)]),_:3})],32)])):d.createCommentVNode("",!0)]))}}),xR=Lt(cue,[["__scopeId","data-v-7a0e7f2b"]]),due={key:0,class:"vsTailwind ui-dialog__wrapper"},fue={class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[2000] bg-black bg-opacity-50"},hue={class:"ui-dialog__modal opacity-1 w-[448px] transition-all 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"},pue={class:"py-2.5 px-4 flex justify-between items-center border-gray-200 dark:border-b-[#454545]"},gue={class:"text-lg font-medium text-gray-800 dark:text-neutral-200"},vue={class:"ui-dialog__content p-4 py-0"},mue={class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"},yue={key:0,class:"p-[16px] flex justify-end gap-x-3"},bue={key:1,class:"flex p-[16px] justify-end gap-x-3"},_ue=d.defineComponent({__name:"vs-confirm-modal",props:{title:{default:"Ви впевнені?"},message:{default:"Ви дійсно хочете?"},confirmButtonText:{default:"Так"},cancelButtonText:{default:"НІ"},confirmButtonStyle:{default:" bg-red-500 hover:bg-red-700"},cancelButtonStyle:{default:" border border-gray-200 bg-white hover:bg-gray-100"},cascade:{type:Boolean,default:!1},modelValue:{type:Boolean}},emits:["confirm","cancel","update:modelValue"],setup(r){const e=r,t=d.ref(e.modelValue);return d.watch(()=>e.modelValue,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[t.value?(d.openBlock(),d.createElementBlock("div",due,[d.createElementVNode("div",fue,[d.createElementVNode("div",hue,[d.createElementVNode("div",pue,[d.createElementVNode("h3",gue,d.toDisplayString(n.title),1),d.createElementVNode("button",{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",onClick:a[0]||(a[0]=i=>n.$emit("cancel"))},a[5]||(a[5]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",vue,[d.createElementVNode("p",mue,d.toDisplayString(n.message),1)]),n.cascade?(d.openBlock(),d.createElementBlock("div",yue,[d.createElementVNode("button",{type:"button",class:d.normalizeClass([[n.cancelButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 disabled:opacity-50 disabled:pointer-events-none"]),onClick:a[1]||(a[1]=i=>n.$emit("cancel"))},d.toDisplayString(n.cancelButtonText),3),d.createElementVNode("button",{type:"button",onClick:a[2]||(a[2]=i=>n.$emit("confirm")),class:d.normalizeClass([[n.confirmButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 text-white shadow-sm disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50"])},d.toDisplayString(n.confirmButtonText),3)])):(d.openBlock(),d.createElementBlock("div",bue,[d.createElementVNode("button",{type:"button",onClick:a[3]||(a[3]=i=>{t.value=!1,n.$emit("update:modelValue",!1),n.$emit("confirm")}),class:d.normalizeClass([[n.confirmButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 text-white shadow-sm disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50"])},d.toDisplayString(n.confirmButtonText),3),d.createElementVNode("button",{type:"button",class:d.normalizeClass([[n.cancelButtonStyle],"py-2 px-3 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg duration-300 disabled:opacity-50 disabled:pointer-events-none"]),onClick:a[4]||(a[4]=i=>{t.value=!1,n.$emit("update:modelValue",!1),n.$emit("cancel")})},d.toDisplayString(n.cancelButtonText),3)]))])])])):d.createCommentVNode("",!0)]))}}),wR=Lt(_ue,[["__scopeId","data-v-fa9b5c2d"]]),xue={key:0,class:"loading-overlay"},wue=d.defineComponent({__name:"vs-loading",props:{visible:{type:Boolean}},setup(r){const e=r,t=d.ref(e.visible);return d.watch(()=>e.visible,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[t.value?(d.openBlock(),d.createElementBlock("div",xue,a[0]||(a[0]=[d.createElementVNode("div",{class:"loading-spinner"},null,-1)]))):d.createCommentVNode("",!0)]),_:1})]))}}),R1=Lt(wue,[["__scopeId","data-v-2afca876"]]),Sue={},kue={xmlns:"http://www.w3.org/2000/svg",class:"size-4",viewBox:"0 0 20 20",fill:"currentColor"};function Eue(r,e){return d.openBlock(),d.createElementBlock("svg",kue,e[0]||(e[0]=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)]))}const SR=Lt(Sue,[["render",Eue]]),Cue={},Tue={xmlns:"http://www.w3.org/2000/svg",class:"size-4",viewBox:"0 0 20 20",fill:"currentColor"};function Due(r,e){return d.openBlock(),d.createElementBlock("svg",Tue,e[0]||(e[0]=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)]))}const kR=Lt(Cue,[["render",Due]]),Aue={},Mue={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",height:"16",width:"16"};function Nue(r,e){return d.openBlock(),d.createElementBlock("svg",Mue,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Lue=Lt(Aue,[["render",Nue]]),Iue={},Bue={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 text-blue-600",width:"14",height:"14"};function Vue(r,e){return d.openBlock(),d.createElementBlock("svg",Bue,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Rue=Lt(Iue,[["render",Vue]]),Pue={class:"flex items-center justify-between w-full"},Oue={class:"m-0 flex list-none justify-center gap-1 p-0 text-gray-900"},zue=["onClick"],Fue={key:1},$ue={for:"Page"},Gue=["value","max"],Uue={key:2,class:"text-sm/8 font-medium tracking-widest"},Hue={key:0,class:"flex justify-center items-center gap-x-5 ml-3"},Wue={class:"hs-dropdown-menu z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 right-0 dark:divide-neutral-700 absolute bottom-[100%]",role:"menu","aria-orientation":"vertical","aria-labelledby":"dropdown-button"},Yue=["onClick"],que=d.defineComponent({__name:"vs-pagination",props:{pageSize:{},page:{},total:{},view:{default:"button"},pageSizes:{default:()=>[10,20,30]},showPageSizes:{type:Boolean,default:!0},pageRange:{default:7},size:{default:7},color:{default:"teal"}},emits:["update:page","pageChange","pageSizeChange"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(t.page),i=d.computed(()=>Math.ceil(t.total/t.pageSize)),o=d.computed(()=>{const v=Math.floor(t.pageRange/2);let m=a.value-v,y=a.value+v;m<1&&(y+=1-m,m=1),y>i.value&&(m-=y-i.value,y=i.value),m=Math.max(1,m);const b=[];for(let _=m;_<=y;_+=1)b.push(_);return b}),s=v=>{a.value=v,n("update:page",v),n("pageChange",v)},l=()=>{a.value>1&&s(a.value-1)},u=()=>{a.value<i.value&&s(a.value+1)};d.watch(()=>t.page,v=>{a.value=v});const c=d.ref(t.pageSize),f=d.ref(!1),h=d.ref(null);d.watch(()=>t.pageSize,v=>{c.value=v});const p=(v=c.value)=>{c.value=v,f.value=!1,a.value=1,n("update:page",a.value),n("pageSizeChange",c.value)},g=v=>{if(!f.value)return;const m=v.target;h.value&&m&&!h.value.contains(m)&&(f.value=!1)};return d.onMounted(()=>{document.addEventListener("click",g)}),d.onBeforeUnmount(()=>{document.removeEventListener("click",g)}),(v,m)=>(d.openBlock(),d.createElementBlock("div",Pue,[d.createElementVNode("ul",Oue,[d.createElementVNode("li",null,[d.createElementVNode("button",{class:d.normalizeClass(["grid size-7 cursor-pointer place-content-center rounded border border-gray-200 transition-colors hover:bg-gray-50 rtl:rotate-180",{"opacity-50 pointer-events-none":a.value===1}]),"aria-label":"Previous page",onClick:l},[d.createVNode(SR)],2)]),v.view==="button"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(o.value,y=>(d.openBlock(),d.createElementBlock("li",{key:y,class:d.normalizeClass([[`size-${t.size} text-sm/${t.size} px-1.5`,y===a.value&&v.color?`bg-[${v.color}]`:"",y===a.value?`block rounded border border-${v.color}-600 text-center font-medium text-white`:"block rounded border border-gray-200 text-center font-medium transition-colors hover:bg-gray-50"],"cursor-pointer"]),onClick:b=>s(y)},d.toDisplayString(y),11,zue))),128)):v.view==="input"?(d.openBlock(),d.createElementBlock("li",Fue,[d.createElementVNode("label",$ue,[m[2]||(m[2]=d.createElementVNode("span",{class:"sr-only"}," Page ",-1)),d.createElementVNode("input",{type:"number",id:"Page",value:a.value,min:"1",max:i.value,onInput:m[0]||(m[0]=y=>s(Number(y))),class:"pagination-input block h-8 w-16 rounded border border-gray-300 px-3 py-2 text-base leading-6 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"},null,40,Gue)])])):v.view==="xy"?(d.openBlock(),d.createElementBlock("li",Uue,d.toDisplayString(a.value)+"/"+d.toDisplayString(i.value),1)):d.createCommentVNode("",!0),d.createElementVNode("li",null,[d.createElementVNode("button",{onClick:u,class:d.normalizeClass(["grid size-7 cursor-pointer place-content-center rounded border border-gray-200 transition-colors hover:bg-gray-50 rtl:rotate-180",{"opacity-50 pointer-events-none":a.value===i.value}]),"aria-label":"Next page"},[d.createVNode(kR)],2)])]),v.showPageSizes?(d.openBlock(),d.createElementBlock("div",Hue,[d.createElementVNode("div",{class:"relative",ref_key:"dropdownRef",ref:h},[d.withDirectives(d.createElementVNode("div",Wue,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.pageSizes,y=>(d.openBlock(),d.createElementBlock("button",{type:"button",key:y,onClick:b=>p(y),class:"flex w-full items-center gap-x-3.5 rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 dark:focus:bg-neutral-700"},[d.createTextVNode(d.toDisplayString(y)+" ",1),c.value===y?(d.openBlock(),d.createBlock(Rue,{key:0})):d.createCommentVNode("",!0)],8,Yue))),128))],512),[[d.vShow,f.value]]),d.createElementVNode("button",{type:"button",class:"inline-flex min-w-[32px] text-sm/7 items-center gap-x-1 rounded-md border border-gray-200 px-1.5 h-[1.75rem] text-base text-gray-800 shadow-sm hover:bg-gray-50 focus:bg-gray-100 focus:outline-none disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700","aria-haspopup":"menu","aria-expanded":"false","aria-label":"Dropdown",onClick:m[1]||(m[1]=y=>f.value=!f.value)},[d.createTextVNode(d.toDisplayString(c.value)+" ",1),d.createVNode(Lue)])],512)])):d.createCommentVNode("",!0)]))}}),ER=Lt(que,[["__scopeId","data-v-fd550e03"]]),Zue={class:"relative w-full overflow-hidden"},Xue={class:"absolute bottom-3 left-1/2 -translate-x-1/2 flex space-x-2"},jue=["onClick"],CR=d.defineComponent({__name:"vs-slider",props:{interval:{default:3e3},autoplay:{type:Boolean,default:!1}},setup(r){const e=r,t=d.useSlots(),n=d.ref(0);let a=null;const i=d.computed(()=>(t.default?t.default():[]).map(c=>d.h("div",{class:"w-full flex-shrink-0"},[c]))),o=d.computed(()=>i.value.length),s=()=>{o.value>0&&(n.value=(n.value+1)%o.value)},l=()=>{o.value>0&&(n.value=(n.value-1+o.value)%o.value)},u=c=>{n.value=c};return d.onMounted(()=>{e.autoplay&&e.interval&&e.interval>0&&(a=window.setInterval(s,e.interval))}),d.onBeforeUnmount(()=>{a&&clearInterval(a)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",Zue,[d.createElementVNode("div",{class:"flex transition-transform duration-500 ease-in-out",style:d.normalizeStyle({transform:`translateX(-${n.value*100}%)`})},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(h,p)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(h),{key:p}))),128))],4),d.createElementVNode("button",{onClick:l,class:"absolute top-1/2 left-3 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70"},[d.createVNode(SR)]),d.createElementVNode("button",{onClick:s,class:"absolute top-1/2 right-3 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70"},[d.createVNode(kR)]),d.createElementVNode("div",Xue,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.value,(h,p)=>(d.openBlock(),d.createElementBlock("button",{key:p,onClick:g=>u(p),class:d.normalizeClass(["w-3 h-3 rounded-full transition",n.value===p?"bg-white":"bg-white/50"])},null,10,jue))),128))])]))}}),TR={mounted(r,e){if(typeof document>"u")return;let t=null;const n=()=>{t=document.createElement("div"),t.textContent=e.value,Object.assign(t.style,{position:"absolute",background:"#333",color:"#fff",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:"9999"}),document.body.appendChild(t);const i=r.getBoundingClientRect();t.style.left=`${i.left+window.scrollX}px`,t.style.top=`${i.top+window.scrollY-t.offsetHeight-5}px`},a=()=>{t&&t.parentNode&&(t.parentNode.removeChild(t),t=null)};r.addEventListener("mouseenter",n),r.addEventListener("mouseleave",a),Object.assign(r,{tooltipHandlers:{showTooltip:n,hideTooltip:a}})},unmounted(r){if(typeof document>"u")return;const e=r.tooltipHandlers;e&&(r.removeEventListener("mouseenter",e.showTooltip),r.removeEventListener("mouseleave",e.hideTooltip),typeof e.hideTooltip=="function"&&e.hideTooltip(),delete r.tooltipHandlers)}},DR={mounted(r,e){const t=document.createElement("div");t.className=`
|
|
290
290
|
absolute inset-0
|
|
291
291
|
bg-white bg-opacity-70
|
|
292
292
|
flex justify-center items-center
|
|
@@ -296,7 +296,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),G=N,F=V),R===void 0&&(
|
|
|
296
296
|
w-10 h-10
|
|
297
297
|
border-4 border-gray-400 border-t-transparent rounded-full
|
|
298
298
|
animate-spin
|
|
299
|
-
`,t.appendChild(n),r._loadingOverlay=t;const a=getComputedStyle(r).position;(a==="static"||!a)&&(r.style.position="relative"),e.value&&r.appendChild(t)},updated(r,e){e.value&&r._loadingOverlay&&!r.contains(r._loadingOverlay)?r.appendChild(r._loadingOverlay):!e.value&&r._loadingOverlay&&r.contains(r._loadingOverlay)&&r.removeChild(r._loadingOverlay)},unmounted(r){r._loadingOverlay&&r.contains(r._loadingOverlay)&&r.removeChild(r._loadingOverlay),delete r._loadingOverlay}},Que={mounted(r){var e,t;typeof window>"u"||(t=(e=r.querySelector("input, textarea, [tabindex]")??r).focus)==null||t.call(e)},updated(r,e){var t,n;e.value===!0&&((n=(t=r.querySelector("input, textarea, [tabindex]")??r).focus)==null||n.call(t))}},Rc=r=>{const{message:e,title:t,mode:n="confirm",type:a="info",confirmButtonText:i,cancelButtonText:o,onConfirm:s,onCancel:l,cascade:u,confirmButtonStyle:c,cancelButtonStyle:f}=r||{},h=document.querySelector("body");if(!h){console.error('Modal root element with id "#modal" not found!');return}const p=document.createElement("div");h.appendChild(p);const g=()=>{p.remove()};d.createApp({render(){return d.h(Cp,{title:t,message:e,mode:n,type:a,cascade:u,confirmButtonText:i,cancelButtonText:o,cancelButtonStyle:f,confirmButtonStyle:c,modelValue:!0,onConfirm:()=>{s==null||s(),g()},onCancel:()=>{l==null||l(),g()}})}}).mount(p)};function AR(r={}){return Object.assign(r,{mode:"alert"}),Rc(r)}function Jue(r={}){return Object.assign(r,{mode:"prompt"}),Rc(r)}let MR=!1;const NR=d.reactive({visible:!0}),P1=(r,e)=>{if(e&&setTimeout(()=>P1(!1),e),!MR){const t=document.querySelector("body");if(!t){console.error('Modal root element with id "#modal" not found!');return}const n=document.createElement("div");t.appendChild(n),d.createApp({render(){return d.h(R1,NR)}}).mount(n),MR=!0}NR.visible=r},O1=r=>{const{template:e="",title:t="",content:n,contentProps:a={},size:i="medium"}=r||{},o=document.querySelector("body");if(!o)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const s=document.createElement("div");o.appendChild(s);const l={title:t,template:e,visible:!0,size:i,closeClickBack:!0,onClose:c},u=d.createApp({render(){return d.h(xl,l,{default:()=>[n?d.h(n,a):d.h("p",e)]})}});function c(){u.unmount(),s.remove()}return u.mount(s),{close:c}};function ece(r){return{all:r=r||new Map,on:function(e,t){var n=r.get(e);n?n.push(t):r.set(e,[t])},off:function(e,t){var n=r.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):r.set(e,[]))},emit:function(e,t){var n=r.get(e);n&&n.slice().map(function(a){a(t)}),(n=r.get("*"))&&n.slice().map(function(a){a(e,t)})}}}const LR=ece(),tce=async r=>{const{api:e,method:t,confirm:{title:n,text:a,cancel:i,confirm:o}}=r;Rc({cascade:!1,confirmButtonStyle:"",cancelButtonStyle:"",message:a,title:n,mode:"confirm",type:"error",confirmButtonText:o,cancelButtonText:i,onConfirm:async()=>{await fetch(e,{method:t,headers:{"Content-Type":"application/json"}}),LR.emit("methodApi",t)}})},rce=Object.freeze(Object.defineProperty({__proto__:null,Copy:V1,Lightbox:I1,LoadingDirective:DR,MessageBox:Cp,TooltipDirective:TR,VsBadgeValue:bse,VsButton:gR,VsConfirm:wR,VsDataValue:vR,VsDrawer:xR,VsGridGallery:yR,VsLoading:R1,VsModal:xl,VsNotify:B1,VsPagination:ER,VsPopover:_R,VsSlider:CR,VsSwitch:bR,alert:AR,confirm:Rc,default:{install:r=>{r.component("VsButton",gR),r.component("VsGridGallery",yR),r.component("Lightbox",I1),r.component("VsDataValue",vR),r.component("VsSwitch",bR),r.component("VsCopy",V1),r.component("Copy",V1),r.component("VsPopover",_R),r.component("VsConfirm",wR),r.component("MessageBox",Cp),r.component("VsModal",xl),r.component("VsDialog",xl),r.component("VsDrawer",xR),r.component("VsNotify",B1),r.component("VsLoading",R1),r.component("VsPagination",ER),r.component("VsSlider",CR),r._context.directives.tooltip||r.directive("tooltip",TR),r._context.directives.loading||r.directive("loading",DR),r.directive("focus",Que),Object.assign(r.config.globalProperties,{$loading:P1,$modal:O1,$notify:pt,$confirm:Rc,$alert:AR,$api:tce})}},emitter:LR,loading:P1,modal:O1,notify:pt,prompt:Jue},Symbol.toStringTag,{value:"Module"})),IR=d.defineComponent({__name:"vs-info-tooltip",props:{text:{}},setup(r){const e=r,t=d.ref(!1),n=d.ref({top:"0px",left:"0px"});function a(o){if(!e.text)return;const s=o.currentTarget.getBoundingClientRect();n.value={top:`${s.bottom+4}px`,left:`${Math.min(s.left,window.innerWidth-230)}px`},t.value=!0}function i(){t.value=!1}return(o,s)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("span",{class:"inline-flex items-center",onMouseenter:a,onMouseleave:i},[d.renderSlot(o.$slots,"default",{},()=>[s[0]||(s[0]=d.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:"text-gray-400 cursor-help"},[d.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),d.createElementVNode("path",{d:"M12 16v-4"}),d.createElementVNode("path",{d:"M12 8h.01"})],-1))])],32),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[t.value&&o.text?(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(n.value),class:"fixed z-[9999] max-w-xs p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"},d.toDisplayString(o.text),5)):d.createCommentVNode("",!0)]))],64))}}),nce={class:"w-full relative"},ace={key:0,class:"text-[14px] font-medium text-gray-900 mb-2 flex items-center gap-1"},ice={class:"opacity-100"},oce={key:0,class:"text-red-500 text-[14px]"},sce={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},lce=d.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){const e=r,t=d.computed(()=>{var o,s;return typeof((o=e.item)==null?void 0:o.label)=="string"&&e.item.label?e.item.label:((s=e.item)==null?void 0:s.ua)||e.label||e.ua}),n=d.computed(()=>!!t.value),a=d.computed(()=>{var o,s;return!!((s=(o=e.item)==null?void 0:o.rules)!=null&&s.includes("required"))}),i=d.computed(()=>{var o;return((o=e.item)==null?void 0:o.info)||""});return(o,s)=>(d.openBlock(),d.createElementBlock("div",nce,[n.value?(d.openBlock(),d.createElementBlock("div",ace,[d.createElementVNode("span",ice,d.toDisplayString(t.value),1),a.value?(d.openBlock(),d.createElementBlock("span",oce,"*")):d.createCommentVNode("",!0),i.value?(d.openBlock(),d.createBlock(IR,{key:1,text:i.value},null,8,["text"])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.renderSlot(o.$slots,"default",d.mergeProps(o.$attrs,{class:{"opacity-60":o.item.disabled}})),o.error?(d.openBlock(),d.createElementBlock("span",sce,d.toDisplayString(o.error),1)):d.createCommentVNode("",!0)]))}}),uce={class:"w-full relative flex flex-row items-center gap-2"},cce={key:0,class:"text-red-500 text-[14px]"},dce={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},fce=d.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(r){const e=r,t=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.label)||e.label||e.ua}),n=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.info)||""}),a=d.computed(()=>e.columns??{container:12,label:3}),i=d.computed(()=>{const{container:u,label:c}=a.value;return!u||u<=0?0:Math.min(Math.max(c??0,0),u)/u}),o=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.type)==="html"||i.value<=0?!1:!!t.value}),s=d.computed(()=>{if(!o.value)return{};const u=`${i.value*100}%`;return{flexBasis:u,maxWidth:u}}),l=d.computed(()=>{var p;const{container:u,label:c}=a.value;if(!u||u<=0)return{};if(((p=e.item)==null?void 0:p.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!o.value)return{flexBasis:"100%",maxWidth:"100%"};const f=Math.max(u-Math.max(c??0,0),0)/u;if(!f)return{};const h=`${f*100}%`;return{flexBasis:h,maxWidth:h}});return(u,c)=>{var f,h;return d.openBlock(),d.createElementBlock("div",uce,[o.value?(d.openBlock(),d.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 items-center gap-1",style:d.normalizeStyle(s.value)},[d.createTextVNode(d.toDisplayString(t.value)+" ",1),(h=(f=u.item)==null?void 0:f.rules)!=null&&h.includes("required")&&t.value?(d.openBlock(),d.createElementBlock("span",cce,"*")):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createBlock(IR,{key:1,text:n.value},null,8,["text"])):d.createCommentVNode("",!0)],4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex-1 min-w-0",style:d.normalizeStyle(l.value)},[d.renderSlot(u.$slots,"default",d.normalizeProps(d.guardReactiveProps(u.$attrs)))],4),u.error?(d.openBlock(),d.createElementBlock("span",dce,d.toDisplayString(u.error),1)):d.createCommentVNode("",!0)])}}}),hce={class:"w-full relative"},pce={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},gce=d.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",hce,[d.renderSlot(e.$slots,"default",d.normalizeProps(d.guardReactiveProps(e.$attrs))),e.error?(d.openBlock(),d.createElementBlock("span",pce,d.toDisplayString(e.error),1)):d.createCommentVNode("",!0)]))}}),vce={class:"flex-1 min-w-0"},mce={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},yce={class:"truncate"},bce={key:0,class:"text-red-500 text-[14px]"},_ce=["innerHTML"],xce={key:0,class:"mt-1 text-xs text-red-500"},wce=d.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){const e=r,t=d.ref("uk");d.computed(()=>{var s;return((s=e.item??{})==null?void 0:s[t.value])??e.ua??e.label??""});const n=d.computed(()=>{var s;return((s=e.item)==null?void 0:s.description)??""}),a=d.computed(()=>{var s;return Array.isArray((s=e.item)==null?void 0:s.rules)&&e.item.rules.includes("required")}),i=d.computed(()=>(typeof e.error=="string"?e.error:"")??""),o=()=>{const s=typeof localStorage<"u"?localStorage.getItem("locale"):null;t.value=s||"uk"};return d.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(t.value=localStorage.locale)}catch{}window.addEventListener("storage",o)}),d.onUnmounted(()=>{window.removeEventListener("storage",o)}),(s,l)=>{var u;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["w-full relative",{"opacity-60":(u=s.item)==null?void 0:u.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(s.item.type)?"flex flex-col":""]])},[d.createElementVNode("div",vce,[s.ua||s.label?(d.openBlock(),d.createElementBlock("p",mce,[d.createElementVNode("span",yce,d.toDisplayString(s.item[t.value]||s.ua||s.label),1),a.value?(d.openBlock(),d.createElementBlock("span",bce,"*")):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createElementBlock("p",{key:1,class:"text-xs text-slate-500 dark:text-slate-400",innerHTML:n.value},null,8,_ce)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:d.normalizeClass(["w-full",["select","native-select"].includes(s.item.type)?"md:w-[30%]":"md:w-auto"])},[d.renderSlot(s.$slots,"default",d.normalizeProps(d.guardReactiveProps(s.$attrs)))],2)],2),i.value?(d.openBlock(),d.createElementBlock("p",xce,d.toDisplayString(i.value),1)):d.createCommentVNode("",!0)],2)}}}),Sce={default:lce,horizontal:fce,inline:gce,settings:wce};function br(r){return{inputClass:d.computed(()=>{const e=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(r==null?void 0:r.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(r==null?void 0:r.size)==="sm"?`${e}h-[32px]`:`${e}h-[38px]`})}}const kce=["placeholder","disabled"],Ece=d.defineComponent({__name:"vs-input-password",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??"");return(o,s)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"password","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:i.value,disabled:a.value,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,kce)),[[d.vModelText,n.value]])}}),Cce=["placeholder","disabled","maxlength","minlength"],wl=d.defineComponent({__name:"vs-input-text",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??""),o=d.computed(()=>e.maxlength??void 0),s=d.computed(()=>e.minlength??void 0);function l(){typeof n.value=="string"&&(n.value=n.value.trim())}return(u,c)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"text","onUpdate:modelValue":c[0]||(c[0]=f=>n.value=f),placeholder:i.value,disabled:a.value,maxlength:o.value,minlength:s.value,onBlur:l,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.customClass,d.unref(t),{"!border-red-600":u.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Cce)),[[d.vModelText,n.value]])}}),Tce=["placeholder","disabled","min","max"],BR=d.defineComponent({__name:"vs-input-number",props:d.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled);return(i,o)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),placeholder:i.placeholder,disabled:a.value,class:d.normalizeClass(["py-1.5 px-3 block w-full bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"},min:i.min,max:i.max},null,10,Tce)),[[d.vModelText,n.value]])}}),Ye=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t},Dce={},Ace={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 Mce(r,e){return d.openBlock(),d.createElementBlock("svg",Ace,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Nce=Ye(Dce,[["render",Mce]]),Lce={class:"flex items-center gap-[4px]"},Ice=["value","id","disabled"],Bce=["for"],Vce={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},Rce=d.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=e,n=r,a=d.computed({get:()=>n.modelValue,set:o=>t("update:modelValue",o)}),i=d.computed(()=>!!n.disabled);return(o,s)=>(d.openBlock(),d.createElementBlock("div",Lce,[d.withDirectives(d.createElementVNode("input",{type:"checkbox",value:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>a.value=l),class:d.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":i.value}]),id:o.id,disabled:i.value},null,10,Ice),[[d.vModelCheckbox,a.value]]),d.createElementVNode("label",{for:o.id,class:d.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":i.value}])},[d.createElementVNode("div",{class:d.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[a.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",o.error?"border-red-600":""]])},[d.createVNode(Nce,{height:"12",width:"12"})],2),d.createElementVNode("span",Vce,[d.renderSlot(o.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(o.label),1)])])],10,Bce)]))}}),Pce=["name","value","disabled"],Oce={class:"flex items-center gap-[6px] text-[14px]"},zce={key:0,class:"text-[16px]"},Fce=["src"],$ce=d.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=d.computed({get:()=>t.modelValue,set:s=>{n("update:modelValue",s)}}),i=d.computed(()=>Array.isArray(a.value)?a.value.includes(t.value):a.value===!0||a.value===t.value),o=d.computed(()=>{var s,l;return((s=t.style)==null?void 0:s.size)==="xs"?"p-1.5 text-xs":((l=t.style)==null?void 0:l.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(s,l)=>(d.openBlock(),d.createElementBlock("label",{class:d.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",[o.value,i.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[d.withDirectives(d.createElementVNode("input",{type:"checkbox",class:"hidden",name:s.id,value:s.value,"onUpdate:modelValue":l[0]||(l[0]=u=>a.value=u),disabled:s.disabled},null,8,Pce),[[d.vModelCheckbox,a.value]]),d.createElementVNode("span",Oce,[s.icon||s.imgUrl?(d.openBlock(),d.createElementBlock("span",zce,[s.icon?(d.openBlock(),d.createElementBlock("i",{key:0,class:d.normalizeClass(s.icon)},null,2)):d.createCommentVNode("",!0),s.imgUrl?(d.openBlock(),d.createElementBlock("img",{key:1,src:s.imgUrl,width:"16",height:"16",alt:"icon"},null,8,Fce)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.renderSlot(s.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(s.label),1)])])],2))}}),Gce={class:"flex items-center"},z1=d.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=`radio-${Math.floor(Math.random()*1e4)}`,i=d.computed({get:()=>Array.isArray(t.modelValue)?Array.isArray(t.modelValue)&&t.modelValue.includes(t.value):t.modelValue,set:s=>{if(Array.isArray(t.modelValue)){let l=[...t.modelValue];s?l.includes(t.value)||l.push(t.value):l=l.filter(u=>u!==t.value),n("update:modelValue",l)}else n("update:modelValue",s)}}),o=d.ref(`vs-checkbox-${t.view||"default"}`);return(s,l)=>{var u;return d.openBlock(),d.createElementBlock("div",Gce,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.value==="vs-checkbox-buttons"?d.unref($ce):d.unref(Rce)),{value:s.value,label:s.label,info:(u=s.option)==null?void 0:u.info,disabled:s.disabled,modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),id:a,icon:s.icon,imgUrl:s.imgUrl,style:d.normalizeStyle(s.style),error:s.error},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(s.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),Uce={},Hce={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 Wce(r,e){return d.openBlock(),d.createElementBlock("svg",Hce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const F1=Ye(Uce,[["render",Wce]]),Yce={},qce={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 Zce(r,e){return d.openBlock(),d.createElementBlock("svg",qce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),d.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Dp=Ye(Yce,[["render",Zce]]),Xce={},jce={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 Kce(r,e){return d.openBlock(),d.createElementBlock("svg",jce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M12 9h.01"},null,-1),d.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),d.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 Qce=Ye(Xce,[["render",Kce]]),Jce={key:0,class:"flex items-start gap-x-1"},ede={key:0,class:"text-red-500 text-[14px]"},tde=["title"],rde=["disabled"],$1=d.defineComponent({__name:"vs-input-switcher",props:d.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue");return(n,a)=>{var i,o;return e.view==="checkbox"?(d.openBlock(),d.createElementBlock("div",Jce,[d.createVNode(z1,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=s=>t.value=s),label:n.text,error:n.error||""},null,8,["modelValue","label","error"]),(i=n.rules)!=null&&i.includes("required")?(d.openBlock(),d.createElementBlock("span",ede,"*")):d.createCommentVNode("",!0),n.i?(d.openBlock(),d.createElementBlock("button",{key:1,class:"cursor-pointer",title:n.i,onClick:a[1]||(a[1]=d.withModifiers(()=>{},["prevent"]))},[d.createVNode(d.unref(Qce),{class:"text-gray-500 w-[14px] h-[14px]"})],8,tde)):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:d.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-${((o=n.style)==null?void 0:o.primaryColor)||"blue"}-500`:"bg-stone-200",n.customClass]]),disabled:n.disabled,onClick:a[2]||(a[2]=s=>t.value=!t.value)},[d.createElementVNode("span",{"data-state":"checked",class:d.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,rde))}}}),nde=["id","innerHTML"],G1=d.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",{id:e.name,class:d.normalizeClass(["text-gray-900",e.customClass]),innerHTML:e.html?e.html:e.text},null,10,nde))}}),ade=["placeholder","disabled","name"],U1=d.defineComponent({__name:"vs-input-mask",props:d.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.ref(null);let i=null;function o(s){const l={9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},u=new Set;let c=!1;for(let h=0;h<s.length;h+=1){const p=s[h];p==="{"?c=!0:p==="}"?c=!1:c&&u.add(p)}const f={};return Object.keys(l).forEach(h=>{u.has(h)||(f[h]=l[h])}),{mask:s,definitions:f,lazy:!1}}return d.onMounted(async()=>{if(a.value){const{default:s}=await Promise.resolve().then(()=>sx),l=o(e.mask||"");i=s(a.value,l),i.on("accept",()=>{n.value=e.unmask?i.unmaskedValue:i.value}),i.on("complete",()=>{n.value=e.unmask?i.unmaskedValue:i.value}),i.value=n.value!=null?String(n.value):""}}),d.onBeforeUnmount(()=>{i==null||i.destroy()}),d.watch(()=>e.mask,s=>{if(i){const l=o(s||"");i.updateOptions(l)}}),d.watch(n,s=>{i&&i.unmaskedValue!==s&&(i.value=s!=null?String(s):"")}),(s,l)=>(d.openBlock(),d.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:a,placeholder:s.placeholder,disabled:s.disabled,name:s.name,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,ade))}}),ide={class:"relative w-full bg-white rounded-lg"},ode=["placeholder","disabled"],H1=d.defineComponent({__name:"vs-input-email",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue");return(a,i)=>(d.openBlock(),d.createElementBlock("div",ide,[i[1]||(i[1]=d.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)),d.withDirectives(d.createElementVNode("input",{type:"email","onUpdate:modelValue":i[0]||(i[0]=o=>n.value=o),placeholder:a.placeholder,disabled:a.disabled,class:d.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ode),[[d.vModelText,n.value]])]))}}),sde={class:"relative w-full bg-white rounded-lg"},lde=["value","placeholder","disabled"],W1=d.defineComponent({__name:"vs-input-tel",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>n.value?n.value.startsWith("+")?n.value.slice(1):n.value:""),i=s=>{let{value:l}=s.target;l=l.replace(/^\+/,""),n.value=l?`+${l}`:""},o=s=>{const l=s,{data:u,inputType:c}=l;c&&c.startsWith("delete")||u&&/\D/.test(u)&&l.preventDefault()};return d.watch(()=>n.value,s=>{s&&!s.startsWith("+")?n.value=`+${s.replace(/^\+/,"")}`:s||(n.value="")},{immediate:!0}),(s,l)=>(d.openBlock(),d.createElementBlock("div",sde,[l[0]||(l[0]=d.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},[d.createElementVNode("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"},[d.createElementVNode("path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"})])],-1)),l[1]||(l[1]=d.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[30px] text-gray-500 select-none pointer-events-none"}," + ",-1)),d.createElementVNode("input",{type:"tel",value:a.value,onInput:i,onBeforeinput:o,pattern:"^\\+[1-9]\\d{1,14}$",maxlength:"15",placeholder:s.placeholder,disabled:s.disabled,class:d.normalizeClass(["!pl-10 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,lde)]))}}),ude=["value","disabled"],cde={class:"text-[13px] text-gray-700"},dde=d.defineComponent({__name:"vs-input-radio-default",props:d.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>!!e.disabled);return(a,i)=>{var o,s;return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["flex items-center gap-0",[e.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>t.value=l),type:"radio",value:e.value,disabled:n.value,class:"hidden"},null,8,ude),[[d.vModelRadio,t.value]]),d.createElementVNode("span",{class:d.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((o=e.style)==null?void 0:o.primaryColor)||"blue"}-500`,n.value?"opacity-50 cursor-not-allowed":""]])},[t.value==e.value?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((s=e.style)==null?void 0:s.primaryColor)||"blue"}-500`]])},null,2)):d.createCommentVNode("",!0)],2),d.createElementVNode("span",cde,d.toDisplayString(e.text),1)],2)}}}),fde=["value","disabled"],hde={class:"text-[13px] text-gray-700"},pde=d.defineComponent({__name:"vs-input-radio-buttons",props:d.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>!!e.disabled);return(a,i)=>{var o;return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==e.value?`ring-2 ring-ring ring-${((o=e.style)==null?void 0:o.primaryColor)||"blue"}-500`:"",e.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>t.value=s),type:"radio",value:e.value,disabled:n.value,class:"hidden"},null,8,fde),[[d.vModelRadio,t.value]]),d.createElementVNode("span",hde,d.toDisplayString(e.text),1)],2)}}}),gde={"vs-input-radio-default":dde,"vs-input-radio-buttons":pde},Y1=d.defineComponent({__name:"vs-input-radio",props:d.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>gde[`vs-input-radio-${e.view}`]);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([a.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,o=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n.value),d.mergeProps({key:o==null?void 0:o.id,text:o.text,value:o.id.toString(),checked:t.value===o.id,modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=s=>t.value=s)},{ref_for:!0},a.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),vde={key:1,class:"w-full flex flex-col gap-4"},mde={key:0,class:"text-sm font-medium text-muted-foreground my-2"},yde="Без категорії",bde=d.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=d.ref([]),i=d.reactive({}),o=p=>(p==null?void 0:p.value)||(p==null?void 0:p.id)||(p==null?void 0:p.text)||p,s=p=>p.text||String(p),l=p=>`lg:col-span-${p||12}`,u=d.computed(()=>[t.position==="vertical"?"flex flex-col":"",t.colSpan?"grid":"flex justify-start"]),c=p=>p==null||p===""?null:typeof p=="string"||typeof p=="number"?p:String(p),f=d.computed(()=>{var b;if(!t.group)return[];const p=new Map;a.value.forEach(_=>{var S;const x=_[t.group],w=c(x);p.has(w)||p.set(w,[]),(S=p.get(w))==null||S.push(_)});const g=[];(b=t.values)!=null&&b.length&&t.values.forEach(_=>{const x=c(_);g.push(x)});const v=new Set,m=_=>{const x=p.get(_)||[];if(!x.length)return null;const w=_===null?"group-null":`group-${String(_)}`,S=_===null?yde:String(_);return v.add(_),{key:w,label:S,options:x}},y=[];return g.forEach(_=>{const x=m(_);x&&y.push(x)}),p.forEach((_,x)=>{if(v.has(x))return;const w=m(x);w&&y.push(w)}),y}),h=async()=>{try{const p=await fetch(`/api/suggest/${t.data}`).then(g=>g.json());a.value=(p==null?void 0:p.data)||p}catch(p){console.error(p)}};return d.watch(()=>t.modelValue,p=>{if(typeof p=="boolean"&&a.value.length===1){const g=o(a.value[0]);i[g]=p}else if(Array.isArray(p)){const g=new Set(p);a.value.forEach(v=>{if(!v.disabled){const m=o(v);i[m]=g.has(m)}})}},{immediate:!0}),d.watch(i,()=>{if(!a.value.length){n("update:modelValue",null);return}const p=Object.entries(i).filter(([,g])=>g).map(([g])=>g);n("update:modelValue",p.length===0?[]:p)},{deep:!0}),d.onMounted(()=>{if(t.data)h().then(()=>{if(typeof t.modelValue=="boolean"&&a.value.length===1){const p=o(a.value[0]);i[p]=t.modelValue}else if(Array.isArray(t.modelValue)){const p=new Set(t.modelValue);a.value.forEach(g=>{if(!g.disabled){const v=o(g);i[v]=p.has(v)}})}});else if(a.value=t.options,typeof t.modelValue=="boolean"&&a.value.length===1){const p=o(a.value[0]);i[p]=t.modelValue}else if(Array.isArray(t.modelValue)){const p=new Set(t.modelValue);a.value.forEach(g=>{if(!g.disabled){const v=o(g);i[v]=p.has(v)}})}}),(p,g)=>t.group?(d.openBlock(),d.createElementBlock("div",vde,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,v=>(d.openBlock(),d.createElementBlock("div",{key:v.key,class:"flex flex-col gap-2"},[v.label?(d.openBlock(),d.createElementBlock("span",mde,d.toDisplayString(v.label),1)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["p-0 w-full gap-[12px]",u.value])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.options,m=>(d.openBlock(),d.createBlock(z1,{modelValue:i[o(m)],"onUpdate:modelValue":y=>i[o(m)]=y,value:o(m),class:d.normalizeClass(l(p.colSpan)),disabled:t.disabled||m.disabled,label:s(m),key:`${v.key}-${o(m)}`,icon:m==null?void 0:m.icon,imgUrl:m==null?void 0:m.imgUrl,option:m,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["p-0 w-full gap-[10px]",u.value])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,v=>(d.openBlock(),d.createBlock(z1,{modelValue:i[o(v)],"onUpdate:modelValue":m=>i[o(v)]=m,value:o(v),class:d.normalizeClass(l(p.colSpan)),disabled:t.disabled||v.disabled,label:s(v),key:o(v),icon:v==null?void 0:v.icon,imgUrl:v==null?void 0:v.imgUrl,option:v,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),VR=Ye(bde,[["__scopeId","data-v-8e66207e"]]),_de=["type","placeholder","disabled"],xde=d.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},mode:{default:"date"}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r;function n(c){return c?t.mode==="datetime"?(c.includes("T")?c:null)||c+(c.includes(" ")?"":"T00:00"):c==null?void 0:c.split(" ")[0]:null}const{inputClass:a}=br(t.style),i=e,o=d.computed({get:()=>n(t.modelValue),set:c=>i("update:modelValue",c)}),s=d.computed(()=>t.mode==="datetime"?"datetime-local":t.mode),l=d.computed(()=>!!t.disabled),u=d.computed(()=>t.placeholder??"");return(c,f)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:s.value,"onUpdate:modelValue":f[0]||(f[0]=h=>o.value=h),placeholder:u.value,disabled:l.value,ref:"date",class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[c.modelValue?"":"text-opacity-50",d.unref(a)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,_de)),[[d.vModelDynamic,o.value]])}}),wde=(r,e)=>{if(!e||!Object.keys(e).length)return r;const[t,n=""]=r.split("?"),a=new URLSearchParams(n);Object.entries(e).forEach(([o,s])=>{s==null||s===""||a.set(o,String(s))});const i=a.toString();return i?`${t}?${i}`:t},RR=async(r,e={})=>{var t;try{const n=new FormData;n.append("unique","true"),n.append("file",r);const{api:a,id:i="1",form:o="form",table:s="table",customParams:l}=e,u=a||`/file/upload/uploads?id=${i||""}&form=${o||""}&table=${s||""}`,c=wde(u,l);return(t=await fetch(c,{method:"POST",body:n}).then(f=>f.json()))==null?void 0:t.result}catch(n){return pt({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",n),null}},Sde=async r=>{try{return await fetch(`file/delete${r}`),!0}catch(e){return console.error(e),!1}},PR=async r=>{try{const e=await fetch(`file/download/files/uploads${r}`),t=await e.arrayBuffer(),n=e.headers["content-type"],a=new TextDecoder("utf-8").decode(t),i=new Blob([a],{type:n}),o=document.createElement("a");o.setAttribute("download",r),o.href=window.URL.createObjectURL(i),o.click()}catch(e){console.error(e.message)}},kde={},Ede={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 Cde(r,e){return d.openBlock(),d.createElementBlock("svg",Ede,e[0]||(e[0]=[d.createElementVNode("path",{d:"M5 12h14"},null,-1),d.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const da=Ye(kde,[["render",Cde]]),Tde={},Dde={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 Ade(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Dde,e[0]||(e[0]=[d.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 Mde=Ye(Tde,[["render",Ade]]),Nde={},Lde={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 Ide(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Lde,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),d.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),d.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const Bde=Ye(Nde,[["render",Ide]]),Vde={},Rde={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 Pde(r,e){return d.openBlock(),d.createElementBlock("svg",Rde,e[0]||(e[0]=[d.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="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const OR=Ye(Vde,[["render",Pde]]),Ode={},zde={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 Fde(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",zde,e[0]||(e[0]=[d.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 $de=Ye(Ode,[["render",Fde]]),Gde={},Ude={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 Hde(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Ude,e[0]||(e[0]=[d.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 Wde=Ye(Gde,[["render",Hde]]),Yde=r=>{if(!r)return"";const e=r==null?void 0:r.split(".");return e[e.length-1]},qde=r=>{const e=Yde(r),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)?Bde:t.textsFormat.includes(e)?Wde:t.documentsFormat.includes(e)?Mde:t.archivesFormat.includes(e)?$de:OR},Zde={},Xde={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 jde(r,e){return d.openBlock(),d.createElementBlock("svg",Xde,e[0]||(e[0]=[d.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 Sl=Ye(Zde,[["render",jde]]),Kde={},Qde={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 Jde(r,e){return d.openBlock(),d.createElementBlock("svg",Qde,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const zR=Ye(Kde,[["render",Jde]]),efe=["title"],tfe={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},rfe=d.defineComponent({__name:"vs-input-file-list-item",props:d.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(r){const e=d.useModel(r,"value"),t=d.useModel(r,"item"),n=r;return(a,i)=>(d.openBlock(),d.createElementBlock("div",{title:t.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(qde)(t.value)),{src:t.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:i[0]||(i[0]=o=>d.unref(PR)(t.value))},null,8,["src"])),d.createElementVNode("div",tfe,[d.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=o=>{var s;d.unref(Sde)(t.value),e.value=n.multiple?(s=e.value)==null?void 0:s.filter(l=>l!==t.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[d.createVNode(Sl,{class:"w-4 h-4"})]),d.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=o=>d.unref(PR)(t.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[d.createVNode(zR,{class:"w-4 h-4"})])])],8,efe))}}),q1=Ye(rfe,[["__scopeId","data-v-286cdbc0"]]),nfe={class:"flex items-center gap-x-2"},afe=["accept","multiple","disabled"],ife={key:1,class:"flex items-center flex-wrap gap-2"},ofe={key:1,class:"loader"},sfe={key:1,class:"loader"},lfe=d.defineComponent({__name:"vs-input-file",props:d.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{},modelModifiers:{}}),emits:d.mergeModels(["change"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=d.useModel(r,"modelValue"),a=e,i=d.ref(null),o=d.ref(!1),s=d.inject("values"),l=d.computed(()=>t.format?t.format.split(",").map(b=>b.trim().toLowerCase()).filter(Boolean):[]),u=b=>Array.isArray(n.value)&&n.value[b]||"",c=b=>{if(t.max_size&&b.size>t.max_size*1024*1024){const _=(b.size/1048576).toFixed(2);return pt({type:"error",title:"Помилка!",message:`Файл "${b.name}" занадто великий. Максимальний розмір: ${t.max_size} МБ, розмір файлу: ${_} МБ`,position:"right-bottom"}),!1}return!0},f=b=>{var w;if(!l.value.length)return!0;const _=`.${((w=b.name.split(".").pop())==null?void 0:w.toLowerCase())||""}`,x=l.value.includes(_);return x||pt({type:"error",title:"Помилка!",message:`Неприпустимий формат файлу "${b.name}". Дозволені формати: ${l.value.join(", ")}`,position:"right-bottom"}),x},h=d.computed(()=>{var w;const b={},_=[];if(!((w=t.customParams)!=null&&w.length))return{params:b,missingSources:_};const x=(s==null?void 0:s.value)??{};return t.customParams.forEach(S=>{if(!S)return;const[k,E]=S.split("="),C=k==null?void 0:k.trim(),T=E==null?void 0:E.trim();if(!C||!T)return;const D=x[T];if(D==null||D===""){_.push(T);return}b[C]=D}),{params:b,missingSources:_}}),p=()=>{const{params:b}=h.value;return{api:t.api,customParams:Object.keys(b).length?b:void 0}},g=()=>{const b=h.value.missingSources;if(!b.length)return!0;const _=b.join(", ");return pt({type:"warning",title:"Заповніть поля",message:`Поля (${_}) необхідні для завантаження файлу`,position:"right-bottom"}),!1},v=b=>{pt({type:"error",title:"Помилка завантаження",message:b||"Не вдалося завантажити файл. Спробуйте ще раз.",position:"right-bottom"})},m=()=>{var b;t.disabled||o.value||g()&&((b=i.value)==null||b.click())},y=async b=>{const{files:_}=b.target;if(!_||_.length===0)return;if(!g()){i.value&&(i.value.value="");return}const x=Array.from(_);if(t.max_size&&x.filter(w=>!c(w)).length>0){i.value&&(i.value.value="");return}if(x.filter(w=>!f(w)).length>0){i.value&&(i.value.value="");return}o.value=!0;try{if(t.multiple){const w=Array.from(_).map(async E=>await RR(E,p())),S=await Promise.all(w),k=S.filter(E=>E!==null).map(E=>E==null?void 0:E.file_path).filter(Boolean);if(k.length===0){v();return}k.length<S.length&&v("Деякі файли не вдалося завантажити. Перевірте їх та спробуйте знову."),n.value=[...n.value||[],...k],a("change",n.value)}else{const w=_[0],S=await RR(w,p());if(!(S!=null&&S.file_path)){v();return}n.value=S==null?void 0:S.file_path,a("change",n.value||"")}}catch(w){const S=(w==null?void 0:w.message)||void 0;v(S)}finally{o.value=!1,i.value&&(i.value.value="")}};return(b,_)=>(d.openBlock(),d.createElementBlock("div",nfe,[d.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:i,type:"file",accept:t.format,multiple:b.multiple,onChange:y,disabled:o.value||b.disabled},null,40,afe),!b.multiple&&n.value?(d.openBlock(),d.createBlock(q1,{key:0,item:n.value,"onUpdate:item":_[0]||(_[0]=x=>n.value=x),value:n.value,"onUpdate:value":_[1]||(_[1]=x=>n.value=x)},null,8,["item","value"])):b.multiple?(d.openBlock(),d.createElementBlock("div",ife,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(x,w)=>(d.openBlock(),d.createBlock(q1,{multiple:b.multiple,key:w,value:n.value,"onUpdate:value":_[2]||(_[2]=S=>n.value=S),item:u(w)},null,8,["multiple","value","item"]))),128)),d.createElementVNode("div",{onClick:m,class:d.normalizeClass(["relative 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",b.disabled||o.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[o.value?(d.openBlock(),d.createElementBlock("div",ofe)):(d.openBlock(),d.createBlock(da,{key:0,class:"w-6 h-6"}))],2)])):d.createCommentVNode("",!0),b.multiple?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:2,onClick:m,class:d.normalizeClass([b.disabled||o.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative 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"])},[o.value?(d.openBlock(),d.createElementBlock("div",sfe)):(d.openBlock(),d.createBlock(da,{key:0,class:"w-6 h-6"}))],2))]))}}),FR=Ye(lfe,[["__scopeId","data-v-cf6efbaa"]]),ufe={class:"vs-input-file2 flex flex-col gap-4"},cfe={class:"flex items-center gap-x-2"},dfe=["accept","disabled"],ffe={key:0,class:"absolute inset-0 flex flex-col items-center justify-center gap-1 rounded-lg bg-white/90 text-xs font-medium text-slate-600"},hfe={key:0,class:"rounded-lg border border-[#CFD9E0] bg-white p-4 shadow-sm"},pfe={class:"flex items-center justify-between text-sm"},gfe={class:"truncate pr-4"},vfe={class:"font-medium text-slate-800 truncate"},mfe={class:"text-slate-500"},yfe={class:"text-slate-500 whitespace-nowrap"},bfe={class:"mt-3 h-2 rounded-full bg-slate-100 overflow-hidden"},_fe={class:"mt-3 flex flex-wrap gap-2 text-sm"},xfe={key:0,class:"mt-2 text-sm text-rose-600"},wfe=d.defineComponent({__name:"vs-input-file2",props:d.mergeModels({format:{},max_size:{},api:{},chunkSize:{default:5*1024*1024},subdir:{default:""},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(null),a=d.ref(null),i=d.ref(""),o=d.ref(0),s=d.ref(!1),l=d.ref(""),u=d.ref(null),c=d.inject("values"),f=d.computed(()=>e.format?e.format.split(",").map(A=>A.trim().toLowerCase()).filter(Boolean):[]),h=d.computed(()=>!a.value||!a.value.size?0:Math.min(100,Math.round(o.value/a.value.size*100))),p=d.computed(()=>a.value?`${m(o.value)} / ${m(a.value.size)}`:""),g=d.computed(()=>e.disabled?"opacity-50 cursor-not-allowed":s.value?"cursor-default text-blue-500":"cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"),v=()=>{var A;e.disabled||s.value||x()&&((A=n.value)==null||A.click())},m=A=>{if(!Number.isFinite(A))return"0 B";const I=["B","KB","MB","GB"];let L=0,B=A;for(;B>=1024&&L<I.length-1;)B/=1024,L+=1;return`${B.toFixed(L===0?0:1)} ${I[L]}`},y=A=>{if(!e.max_size)return!0;const I=e.max_size*1024*1024;return A.size>I?(pt({type:"error",title:"Файл занадто великий",message:`Максимальний розмір ${e.max_size} МБ`,position:"right-bottom"}),!1):!0},b=A=>{var L;if(!f.value.length)return!0;const I=`.${((L=A.name.split(".").pop())==null?void 0:L.toLowerCase())||""}`;return f.value.includes(I)?!0:(pt({type:"error",title:"Непідтримуваний формат",message:`Дозволені формати: ${f.value.join(", ")}`,position:"right-bottom"}),!1)},_=d.computed(()=>{var B;const A={},I=[];if(!((B=e.customParams)!=null&&B.length))return{params:A,missing:I};const L=(c==null?void 0:c.value)??{};return e.customParams.forEach(N=>{if(!N)return;const[V,R]=N.split("="),F=V==null?void 0:V.trim(),G=R==null?void 0:R.trim();if(!F||!G)return;const z=L[G];z==null||z===""?I.push(G):A[F]=z}),{params:A,missing:I}}),x=()=>_.value.missing.length?(pt({type:"warning",title:"Заповніть поля",message:`Потрібні значення: ${_.value.missing.join(", ")}`,position:"right-bottom"}),!1):!0,w=A=>{var B;const I=A.target,L=(B=I.files)==null?void 0:B[0];if(L){if(!x()){I.value="";return}if(!y(L)||!b(L)){I.value="";return}a.value=L,o.value=0,i.value="",l.value=""}},S=async()=>{if(!a.value){v();return}try{l.value="";const A={id:i.value||"",fileName:a.value.name,subdir:e.subdir,size:a.value.size,..._.value.params},I=await fetch("/api/file/upload2/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(!I.ok)throw new Error("Не вдалося ініціалізувати завантаження");const L=await I.json();i.value=L.id||i.value,o.value=L.uploaded||0,await k()}catch(A){l.value=(A==null?void 0:A.message)||"Помилка при старті завантаження"}},k=async()=>{if(!(!a.value||!i.value)){s.value=!0;try{for(;o.value<a.value.size;){const A=o.value,I=Math.min(A+e.chunkSize,a.value.size),L=a.value.slice(A,I);u.value=new AbortController;const B=await fetch(`/api/file/upload2/${i.value}`,{method:"PATCH",headers:{"Content-Range":`bytes ${A}-${I-1}/${a.value.size}`},body:L,signal:u.value.signal});if(!B.ok)throw new Error("Помилка завантаження частини");const N=await B.json().catch(()=>({}));if(N.uploaded!=null?o.value=Number(N.uploaded):o.value=I,N.finished||o.value>=a.value.size){s.value=!1,t.value=N.file_path||N.url||i.value,pt({type:"success",title:"Файл завантажено",message:a.value.name,position:"right-bottom"}),D();return}}}catch(A){if((A==null?void 0:A.name)==="AbortError")return;l.value=(A==null?void 0:A.message)||"Помилка при завантаженні",s.value=!1}finally{u.value=null,s.value=!1}}},E=()=>{var A;s.value&&((A=u.value)==null||A.abort(),u.value=null,s.value=!1)},C=async()=>{if(a.value){if(!i.value){await S();return}await k()}},T=()=>{var A;(A=u.value)==null||A.abort(),u.value=null,D()},D=()=>{const A=n.value;A&&(A.value=""),a.value=null,i.value="",o.value=0,l.value=""};return(A,I)=>{var L;return d.openBlock(),d.createElementBlock("div",ufe,[d.createElementVNode("div",cfe,[d.createElementVNode("input",{ref_key:"fileInput",ref:n,type:"file",class:"hidden",accept:e.format,disabled:s.value||e.disabled,onChange:w},null,40,dfe),t.value?(d.openBlock(),d.createBlock(q1,{key:0,item:t.value,"onUpdate:item":I[0]||(I[0]=B=>t.value=B),value:t.value,"onUpdate:value":I[1]||(I[1]=B=>t.value=B)},null,8,["item","value"])):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:v,class:d.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",g.value])},[s.value?(d.openBlock(),d.createElementBlock("div",ffe,[I[2]||(I[2]=d.createElementVNode("div",{class:"loader"},null,-1)),d.createElementVNode("span",null,d.toDisplayString(h.value)+"%",1)])):(d.openBlock(),d.createBlock(da,{key:1,class:"w-6 h-6"}))],2))]),a.value&&!t.value?(d.openBlock(),d.createElementBlock("div",hfe,[d.createElementVNode("div",pfe,[d.createElementVNode("div",gfe,[d.createElementVNode("div",vfe,d.toDisplayString(a.value.name),1),d.createElementVNode("div",mfe,d.toDisplayString(m(a.value.size)),1)]),d.createElementVNode("div",yfe,d.toDisplayString(p.value),1)]),d.createElementVNode("div",bfe,[d.createElementVNode("div",{class:"h-full rounded-full bg-blue-500 transition-all duration-300",style:d.normalizeStyle({width:`${h.value}%`})},null,4)]),d.createElementVNode("div",_fe,[!s.value&&o.value>0&&o.value<(((L=a.value)==null?void 0:L.size)||0)?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:C}," Resume ")):d.createCommentVNode("",!0),s.value?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:E}," Pause ")):d.createCommentVNode("",!0),!s.value&&o.value===0?(d.openBlock(),d.createElementBlock("button",{key:2,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:S}," Upload ")):d.createCommentVNode("",!0),d.createElementVNode("button",{type:"button",class:"rounded border border-rose-200 px-3 py-1 text-rose-600",onClick:T}," Cancel ")]),l.value?(d.openBlock(),d.createElementBlock("p",xfe,d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])}}}),Z1=Ye(wfe,[["__scopeId","data-v-ea9f874f"]]),Sfe={class:"max-w-[55vw]"},kfe={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Efe={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Cfe={class:"px-[5px]"},Tfe={class:""},Ap=d.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(r){const e=r,t=d.computed(()=>{try{return new Date(e.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function n(a){if(a<1024)return`${a} B`;const i=a/1024;return i<1024?`${i.toFixed(2)} KB`:`${(i/1024).toFixed(2)} MB`}return(a,i)=>{var o,s,l,u;return d.openBlock(),d.createElementBlock(d.Fragment,null,[i[1]||(i[1]=d.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)),d.createElementVNode("div",Sfe,[d.createElementVNode("p",kfe,d.toDisplayString((o=a.item)==null?void 0:o.uploaded_name),1),d.createElementVNode("p",Efe,[d.createElementVNode("span",null,d.toDisplayString((s=a.item)==null?void 0:s.username),1),d.withDirectives(d.createElementVNode("span",Cfe,"|",512),[[d.vShow,(l=a.item)==null?void 0:l.username]]),d.createElementVNode("span",null,d.toDisplayString(t.value),1),i[0]||(i[0]=d.createElementVNode("span",{class:"px-[5px]"},"|",-1)),d.createElementVNode("span",Tfe,d.toDisplayString(n((u=a.item)==null?void 0:u.size)),1)])])],64)}}}),Dfe={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Afe={key:0,class:"flex w-full gap-x-3 items-center"},Mfe={key:1,class:"flex gap-x-3 w-full items-center"},Nfe={key:2,class:"flex gap-x-3 w-full items-center"},Lfe=["href"],Ife={key:3,class:"flex gap-x-3 w-full items-center"},Bfe={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},Vfe={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"},Rfe={class:"inline-block"},Pfe={class:"inline-block"},Ofe=d.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(r,{emit:e}){const t=r,n=e;function a(c){return["pdf","json"].includes(c.ext)}function i(c){return["ppt","pptx","doc","docx","xls","xlsx"].includes(c.ext)}function o(c){const f=document.createElement("a");f.setAttribute("download",c==null?void 0:c.uploaded_name),f.href=c==null?void 0:c.file_path,f.click()}async function s(){try{await fetch(`${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`),n("update")}catch(c){console.error(c)}}function l(){n("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:s,updateListOnConfirm:!0})}function u(c){(t.item.ext==="jpg"||t.item.ext==="png")&&n("openLightbox",{item:t.item,index:c})}return(c,f)=>(d.openBlock(),d.createElementBlock("div",Dfe,[c.item.ext==="jpg"||c.item.ext==="png"?(d.openBlock(),d.createElementBlock("div",Afe,[d.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:f[0]||(f[0]=h=>u(c.index))},[d.createVNode(Ap,{item:c.item},null,8,["item"])])])):a(c.item)?(d.openBlock(),d.createElementBlock("div",Mfe,[d.createVNode(Ap,{item:c.item},null,8,["item"])])):i(c.item)?(d.openBlock(),d.createElementBlock("div",Nfe,[d.createElementVNode("a",{href:`/api/file-preview?id=${c.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[d.createVNode(Ap,{item:c.item},null,8,["item"])],8,Lfe)])):(d.openBlock(),d.createElementBlock("div",Ife,[d.createVNode(Ap,{item:c.item},null,8,["item"])])),d.createElementVNode("div",Bfe,[d.createElementVNode("div",Vfe,[d.createElementVNode("div",Rfe,[d.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:f[1]||(f[1]=h=>o(c.item))},[d.createVNode(zR,{height:"14",width:"14"})])]),f[3]||(f[3]=d.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),d.createElementVNode("div",Pfe,[d.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:f[2]||(f[2]=h=>l())},[d.createVNode(Sl,{height:"14",width:"14"})])])])])]))}}),zfe={},Ffe={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 $fe(r,e){return d.openBlock(),d.createElementBlock("svg",Ffe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Gfe=Ye(zfe,[["render",$fe]]),Ufe={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},Hfe={class:"flex w-full mb-[12px] items-center gap-x-2"},Wfe={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},Yfe={class1:"ml-auto"},qfe={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"},Zfe={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},Xfe={class:"relative"},jfe={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"},Kfe={key:0},$R=d.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update"],setup(r,{emit:e}){const t=r,n=d.inject("form"),a=d.computed(()=>n.value.formId),i=d.ref(!1),o=d.ref(0),s=e,l=d.ref(!1),u=d.ref({}),c=d.ref([]),f=d.ref(""),h=d.computed(()=>Array.isArray(c.value)?c.value.filter(_=>_.ext==="jpg"||_.ext==="png").map(_=>_==null?void 0:_.file_path):[]),p=d.computed(()=>f.value===""?c.value:c.value.filter(_=>{var x;return(x=_==null?void 0:_.uploaded_name)==null?void 0:x.includes(f.value)})),g=_=>{const x=h.value.findIndex(w=>w===_.item.file_path);x!==-1&&(i.value=!0,o.value=x)},v=async()=>{try{const _=await fetch(`${t.prefix}/widget/file/${a.value}`).then(x=>x.json());c.value=_==null?void 0:_.rows}catch(_){console.error(_)}},m=async _=>{await Promise.all(Array.from(_.target.files).map(async x=>{const w=new FormData;w.append("file",x);try{const S=`${t.prefix}/widget/file/${a.value}`,k=await fetch(S,{method:"POST",body:w});return k.ok?(s("update","file-list"),x):(pt({type:k.status>=400&&k.status<500?"warning":"error",title:"Error",message:`Error code: ${k.status}`}),null)}catch(S){return pt({type:"error",title:"Error",message:S.message||"Unknown error"}),console.error(S),null}})),await v()},y=_=>{const x={..._};return _.cancel||(x.cancel=()=>{l.value=!1}),_.updateListOnConfirm&&(x.confirm=async()=>{await _.confirm(),l.value=!1,v()}),x},b=_=>{u.value=y(_),l.value=!0};return d.watch(a,_=>{_&&v()}),d.onMounted(()=>{a.value&&v()}),(_,x)=>{var k,E,C;const w=d.resolveComponent("Lightbox"),S=d.resolveComponent("MessageBox");return d.openBlock(),d.createElementBlock("div",Ufe,[d.createElementVNode("div",Hfe,[d.createElementVNode("h2",Wfe," Файлів: "+d.toDisplayString((k=c.value)==null?void 0:k.length),1),d.createElementVNode("div",Yfe,[d.createElementVNode("label",null,[d.createElementVNode("input",{type:"file",class:"hidden",onChange:x[0]||(x[0]=T=>m(T))},null,32),d.createElementVNode("div",qfe,[d.createVNode(Gfe,{height:"16",width:"16"})])])])]),((E=c.value)==null?void 0:E.length)>4?(d.openBlock(),d.createElementBlock("div",Zfe,[d.createElementVNode("div",null,[d.createElementVNode("div",Xfe,[x[8]||(x[8]=d.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[d.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"},[d.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),d.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":x[1]||(x[1]=T=>f.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),[[d.vModelText,f.value,void 0,{trim:!0}]])])])])):d.createCommentVNode("",!0),(C=c.value)!=null&&C.length?(d.openBlock(),d.createElementBlock("div",jfe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,(T,D)=>(d.openBlock(),d.createBlock(Ofe,{key:D,prefix:_.prefix,item:T,index:D,onUpdate:x[2]||(x[2]=A=>_.$emit("update","file-list")),onOpenModal:x[3]||(x[3]=A=>b(A)),onOpenLightbox:x[4]||(x[4]=A=>g(A))},null,8,["prefix","item","index"]))),128)),p.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Kfe,x[9]||(x[9]=[d.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):d.createCommentVNode("",!0),d.createVNode(w,{modelValue:i.value,"onUpdate:modelValue":x[5]||(x[5]=T=>i.value=T),startIndex:o.value,"onUpdate:index":x[6]||(x[6]=T=>o.value=T),images:h.value},null,8,["modelValue","startIndex","images"]),d.createVNode(S,d.mergeProps({modelValue:l.value,"onUpdate:modelValue":x[7]||(x[7]=T=>l.value=T),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),Qfe={class:"flex items-center justify-between"},Jfe={class:"text-[16px] text-gray-900 font-medium"},ehe={class:"grid gap-3"},the=d.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(r){const e=r,t=d.ref(e.isOpen);return d.watch(()=>e.isOpen,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",Qfe,[d.createElementVNode("p",Jfe,d.toDisplayString(r.title),1),d.createVNode($1,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=i=>t.value=i),style:d.normalizeStyle(r.style)},null,8,["modelValue","style"])]),d.createVNode(d.Transition,{name:"slide-fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",ehe,[d.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[d.vShow,t.value]])]),_:3})]))}}),rhe=Ye(the,[["__scopeId","data-v-90320b87"]]),nhe={class:"text-[16px] text-gray-900 font-medium"},ahe={class:"grid gap-3"},ihe=d.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(r){const e=r,t=d.ref(e.isOpen);return d.watch(()=>e.isOpen,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("button",{type:"button",onClick:a[0]||(a[0]=i=>t.value=!t.value),class:"flex items-center gap-2"},[d.createVNode(d.unref(F1),{class:d.normalizeClass(["h-4 w-4 duration-300",[t.value?"-rotate-180":""]])},null,8,["class"]),d.createElementVNode("span",nhe,d.toDisplayString(r.title),1)]),d.createVNode(d.Transition,{name:"slide-fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",ahe,[d.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[d.vShow,t.value]])]),_:3})]))}}),ohe=Ye(ihe,[["__scopeId","data-v-590eff11"]]),she={class:"flex items-center justify-between"},lhe=d.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",she,[d.createElementVNode("p",null,d.toDisplayString(r.title),1)]),d.renderSlot(e.$slots,"default")]))}}),uhe={switcher:rhe,accordion:ohe,default:lhe},wn={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},che=(r,e)=>String(r)===String(e),dhe=(r,e)=>String(r)!==String(e),fhe=(r,e)=>r>e,hhe=(r,e)=>r>=e,phe=(r,e)=>r<e,ghe=(r,e)=>r<=e,vhe=(r,e)=>Array.isArray(e)&&e.length===2?r>=e[0]&&r<=e[1]:!1,mhe=(r,e)=>String(r).startsWith(String(e)),yhe=(r,e)=>String(r).endsWith(String(e)),bhe=(r,e)=>String(r).includes(String(e)),_he=(r,e)=>Array.isArray(e)?e.includes(r):!1,xhe=(r,e)=>Array.isArray(e)?!e.includes(r):!0,GR=(r,e)=>{if(!e)return!0;switch(e==null?void 0:e[1]){case wn.Equal:return che(r,e==null?void 0:e[2]);case wn.Inequal:return dhe(r,e==null?void 0:e[2]);case wn.Higer:return fhe(r,e==null?void 0:e[2]);case wn.HigerOrEqual:return hhe(r,e==null?void 0:e[2]);case wn.Lower:return phe(r,e==null?void 0:e[2]);case wn.LowerOrEqual:return ghe(r,e==null?void 0:e[2]);case wn.Between:return vhe(r,e==null?void 0:e[2]);case wn.StartWith:return mhe(r,e==null?void 0:e[2]);case wn.EndWith:return yhe(r,e==null?void 0:e[2]);case wn.Contain:return bhe(r,e==null?void 0:e[2]);case wn.In:return _he(r,e==null?void 0:e[2]);case wn.NotIn:return xhe(r,e==null?void 0:e[2]);default:return!0}},UR=d.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(r){const e=r,t=d.inject("values",d.ref({})),n=d.inject("form"),a=d.computed(()=>{var s;return(s=e.schema)==null?void 0:s.filter(l=>{var h,p,g,v;const u=l==null?void 0:l.conditions;if(!u)return!0;const c=Array.isArray(u)?u[0]:u,f=e.name?((p=(h=t.value)==null?void 0:h[e.name])==null?void 0:p[c])??((g=t.value)==null?void 0:g[c]):(v=t.value)==null?void 0:v[c];return GR(f,u)})}),i=d.computed(()=>uhe[e.view]),o=d.computed(()=>{if(t.value||(t.value={}),!e.name)return t.value;const s=t.value[e.name];if(s)return s;const l={};return t.value={...t.value,[e.name]:l},l});return(s,l)=>{var u;return(u=r.schema)!=null&&u.length?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i.value),{key:0,title:r.title,style:d.normalizeStyle(r.style)},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>{var f,h;return d.openBlock(),d.createBlock(aP,d.mergeProps({key:c.name},{ref_for:!0},c,{item:c,modelValue:o.value[c.name],"onUpdate:modelValue":p=>o.value[c.name]=p,style:r.style,error:(h=(f=d.unref(n))==null?void 0:f.errors)==null?void 0:h[c.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):d.createCommentVNode("",!0)}}}),whe=["aria-expanded","data-focus"],She={class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full"},khe={key:0,class:"flex flex-nowrap items-center gap-1 overflow-x-auto overflow-y-hidden min-w-0 flex-1 py-0.5"},Ehe={class:"flex items-center min-w-0"},Che=["title"],The=["innerHTML"],Dhe=["onClick"],Ahe={class:"flex-1 min-w-[2px]"},Mhe=["placeholder"],Nhe=["title"],Lhe=["innerHTML"],Ihe={key:2,class:"flex-1 min-w-[2px]"},Bhe=["placeholder"],Vhe={class:"flex items-center shrink-0"},Rhe=["disabled"],Phe=["disabled","title"],Ohe=["aria-disabled","onClick"],zhe=["innerHTML"],Fhe={key:1,class:"px-3 py-2 text-center text-gray-500"},$he=["disabled"],X1=d.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},start:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{},maxlength:{},minlength:{}},emits:["change","update:modelValue","value-selected"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.multiple),i=d.computed(()=>t.disabled);br(t.style);const o=d.computed({get:()=>t.modelValue,set:ee=>n("update:modelValue",ee)});!o.value&&t.defaultValue&&(o.value=t.defaultValue);const s=d.ref(null),l=d.ref(null),u=d.ref(null),c=d.ref(null),f=d.ref(!1),h=d.ref(!1),p=d.ref(null),g=d.ref([]),v=d.ref(-1),m=d.ref([]),y=d.ref(""),b=d.ref(null),_=d.ref("bottom"),x=d.ref({}),w=d.ref([]),S=d.computed(()=>{if(!w.value.length)return[];const ee=g.value,ie=new Map(ee.map(de=>{var Me;return[(Me=de.id)==null?void 0:Me.toString(),de]}));return w.value.map(de=>ie.get(de==null?void 0:de.toString())).filter(de=>!!de)}),k=d.computed(()=>t.placeholder||"Select..."),E=d.computed(()=>R(p.value));d.computed(()=>a.value?!w.value.length&&y.value==="":!E.value&&y.value==="");const C=d.computed(()=>i.value?!1:a.value?w.value.length>0:!!o.value),T=ee=>{var ie;return a.value?w.value.some(de=>(de==null?void 0:de.toString())===(ee==null?void 0:ee.toString())):((ie=o.value)==null?void 0:ie.toString())===(ee==null?void 0:ee.toString())},D=d.computed(()=>{let ee=g.value??[];if(!t.data&&y.value.trim()!==""){const ie=y.value.toLowerCase();ee=ee.filter(de=>{var O,J;const Me=R(de).toLowerCase(),P=((J=(O=de.text)==null?void 0:O.toLowerCase)==null?void 0:J.call(O))||"";return Me.includes(ie)||P.includes(ie)})}if(a.value&&w.value.length){const ie=new Set(w.value.map(de=>de==null?void 0:de.toString()));ee=ee.filter(de=>{var Me;return!ie.has((Me=de.id)==null?void 0:Me.toString())})}return ee}),A=d.inject("values"),I=d.inject("field-props"),L=/\{\{\s*([^}]+?)\s*\}\}/g,B=ee=>(ee?String(ee):"").replace(/<[^>]*>/g,"").trim(),N=d.computed(()=>t.slot??(t==null?void 0:t.optionTemplate)??""),V=ee=>{if(!ee)return"";const ie=N.value;return ie?ie.replace(L,(de,Me)=>{const P=Me.trim(),O=ee[P];return O!=null?String(O):""}):ee.text??""},R=ee=>{if(!ee)return"";if(!N.value)return ee.text??"";const ie=V(ee);return B(ie)||ee.text||""},F=(ee,ie,de)=>{var J;if(!I)return!1;const Me=((J=I.value)==null?void 0:J[ee])??{},P=(X,se,_e)=>{if(!se.length)return X;const[De,...ze]=se,kt={...X};if(!ze.length)return kt[De]=_e,kt;const xt=typeof X[De]=="object"&&X[De]!==null?X[De]:{};return kt[De]=P(xt,ze,_e),kt},O=P(Me,ie,de);return I.value={...I.value||{},[ee]:O},!0},G=ee=>{if(!t.set)return;const ie=A==null?void 0:A.value;!ie&&!I||Object.entries(t.set).forEach(([de,Me])=>{if(!de)return;const P=ee?ee[Me]:null,O=de.split(".").map(se=>se.trim()).filter(Boolean);if(!O.length)return;const[J,...X]=O;X.length&&F(J,X,P??null)||ie&&(ie[J]=P??null)})},z=d.computed(()=>{var ee,ie;return t.parent?((ie=(ee=A==null?void 0:A.value)==null?void 0:ee[t.parent])==null?void 0:ie.toString())??null:null}),K=async ee=>{var ie;if(!t.data){let de=t.options??[];if(ee!=null&&ee.trim()){const Me=ee.toLowerCase();de=de.filter(P=>{var X,se;const O=R(P).toLowerCase(),J=((se=(X=P.text)==null?void 0:X.toLowerCase)==null?void 0:se.call(X))||"";return O.includes(Me)||J.includes(Me)})}return de}try{const de=t.host??"",Me=t.prefix??"api",P=t.api??`/${Me}/suggest/${t.data}`,O=`${de}${P}`,J=new URLSearchParams;return J.set("json","1"),ee&&J.set("key",ee),z.value!==void 0&&z.value!==null&&z.value!==""&&J.set("parent",z.value),t.start===1&&J.set("start","1"),((ie=await fetch(`${O}?${J.toString()}`).then(X=>X.json()))==null?void 0:ie.data)??[]}catch{return[]}},U=async()=>{t.data?g.value=await K(y.value):g.value=t.options?[...t.options]:[]},q=async ee=>{var de,Me,P;if(ee==null)return null;const ie=(de=g.value)==null?void 0:de.find(O=>{var J;return((J=O==null?void 0:O.id)==null?void 0:J.toString())===String(ee)});if(ie)return ie;if(t.data)try{const O=t.host??"",J=t.prefix??"api",X=t.api??`/${J}/suggest/${t.data}`,se=`${O}${X}`,_e=new URLSearchParams;return _e.set("json","1"),_e.set("val",String(ee)),z.value!==void 0&&z.value!==null&&z.value!==""&&_e.set("parent",z.value),t.start===1&&_e.set("start","1"),((P=((Me=await fetch(`${se}?${_e.toString()}`).then(De=>De.json()))==null?void 0:Me.data)??[])==null?void 0:P[0])??null}catch{return null}return null},ae=async ee=>{const ie=new Set(g.value.map(Me=>{var P;return(P=Me.id)==null?void 0:P.toString()})),de=ee.filter(Me=>!ie.has(Me==null?void 0:Me.toString()));de.length&&await de.reduce(async(Me,P)=>{await Me;const O=await q(P);O&&g.value.push(O)},Promise.resolve())},me=()=>{if(!D.value.length){v.value=-1;return}v.value=0,d.nextTick(()=>{$(m.value[0],u.value)})},be=async()=>{i.value||(f.value=!0,await U(),await d.nextTick(()=>{var ee;Z(),(ee=b.value)==null||ee.focus()}),me())},fe=()=>{f.value=!1,v.value=-1,d.nextTick(()=>{var ee;(ee=b.value)==null||ee.blur()})},ce=async ee=>{i.value||(f.value?fe():await be())},W=async()=>{if(!i.value){if(f.value){fe();return}await be()}},H=()=>{a.value?(w.value=[],o.value=[],n("change",[]),oe(null,[])):(p.value=null,o.value=null,n("change",null),oe(null,null)),G(null),y.value="",d.nextTick(()=>{var ee;return(ee=b.value)==null?void 0:ee.focus()})},j=ee=>{a.value&&(w.value=w.value.filter(ie=>(ie==null?void 0:ie.toString())!==(ee==null?void 0:ee.toString())),o.value=[...w.value],n("change",o.value),oe(null),d.nextTick(()=>{var ie;return(ie=b.value)==null?void 0:ie.focus()}))},oe=(ee,ie)=>{const de=ie??(a.value?[...w.value]:(ee==null?void 0:ee.id)??null);n("value-selected",{name:t.name,value:de,option:ee})},le=ee=>{a.value?(T(ee.id)||(w.value=[...w.value,ee.id],o.value=[...w.value],n("change",o.value),oe(ee)),y.value="",d.nextTick(()=>{var ie;(ie=b.value)==null||ie.focus(),v.value=Math.min(v.value,D.value.length-1)}),G(null)):(p.value=ee,o.value=ee.id,n("change",o.value),oe(ee),y.value="",fe(),G(ee))},we=ee=>{if(T(ee.id)){a.value||fe();return}le(ee)},$=(ee,ie)=>{if(!ee||!ie)return;const de=ee.offsetTop,Me=de+ee.offsetHeight,P=ie.scrollTop,O=P+ie.clientHeight;let J=ie.scrollTop;de<P?J=de-80:Me>O&&(J=Me-ie.clientHeight+4);const X=ie;X.scrollTop=J},ne=ee=>{let ie=ee.parentElement;for(;ie;){if(ie.classList.contains("ui-dialog__content"))return ie;const de=window.getComputedStyle(ie),Me=de.overflow+de.overflowY+de.overflowX;if(Me.includes("auto")||Me.includes("scroll")||ie===document.body||ie===document.documentElement)return ie;ie=ie.parentElement}return document.body},Z=()=>{if(!l.value)return;const ee=l.value.getBoundingClientRect(),ie=window.innerHeight||document.documentElement.clientHeight,de=window.innerWidth||document.documentElement.clientWidth,Me=8,P=8,O=t.maxHeight||300,J=ie-ee.bottom-P-Me,X=ee.top-P-Me,se=J>=X,_e=Math.max(de-Me*2,0);let{width:De}=ee;_e>0&&De>_e&&(De=_e);let{left:ze}=ee;ze+De+Me>de&&(ze=de-De-Me),ze=Math.max(ze,Me);const kt=Math.min(O,Math.max(se?J:X,50));_.value=se?"bottom":"top",x.value={position:"fixed",left:`${ze}px`,width:`${De}px`,maxHeight:`${kt}px`,transform:se?"none":"translateY(-100%)",top:se?`${ee.bottom+P}px`:`${ee.top-P}px`}},Ie=async ee=>{i.value||!f.value&&(ee.key==="ArrowDown"||ee.key==="ArrowUp")&&(ee.preventDefault(),await be())},Qe=ee=>{var de;if(!f.value)return;const{key:ie}=ee;if(ie==="ArrowDown")ee.preventDefault(),v.value+1<D.value.length&&(v.value+=1,$(m.value[v.value],u.value));else if(ie==="ArrowUp")ee.preventDefault(),v.value>0&&(v.value-=1,$(m.value[v.value],u.value));else if(ie==="Enter"){ee.preventDefault();const Me=D.value[v.value];Me&&le(Me),(de=b.value)==null||de.blur()}else ie==="Escape"?(ee.preventDefault(),fe()):ie==="Backspace"?a.value&&y.value===""&&w.value.length&&(w.value=w.value.slice(0,-1),o.value=[...w.value],n("change",o.value)):ie==="Home"?(v.value=0,$(m.value[0],u.value)):ie==="End"?(v.value=D.value.length-1,$(m.value[v.value],u.value)):ie==="Tab"&&fe()},Fe=()=>{i.value||(h.value=!0)},$t=()=>{h.value=!1,y.value=""},Ht=ee=>{ee.key==="Escape"&&f.value&&fe()},Wt=ee=>{var de,Me;const ie=ee.target;(de=s.value)!=null&&de.contains(ie)||(Me=c.value)!=null&&Me.contains(ie)||fe()},Gr=ee=>{f.value&&u.value&&!u.value.contains(ee.target)&&Z()},ge=()=>{f.value&&Z()},Ce=()=>{f.value&&Z()};d.watch(()=>t.options,ee=>{ee!=null&&ee.length&&(g.value=[...ee],Ge())},{immediate:!0});async function Ge(){if(a.value)Array.isArray(o.value)?w.value=[...o.value]:(w.value=o.value==null?[]:[o.value],o.value=[...w.value]),t.data&&w.value.length&&(await ae(w.value),await d.nextTick());else{if(Array.isArray(o.value)){const ee=o.value[0]??null;o.value=ee??null}o.value!=null&&(p.value=await q(o.value)),G(p.value??null)}}d.watch(o,()=>{Ge()}),d.onMounted(async()=>{var ee;addEventListener("keydown",Ht),addEventListener("scroll",Gr,!0),addEventListener("resize",ge),document.addEventListener("click",Wt,!0),l.value&&ne(l.value).addEventListener("scroll",Ce,!0),(ee=t.options)!=null&&ee.length&&!t.data?g.value=[...t.options]:t.data&&(g.value=await K("")),await Ge(),Ga.value=!1}),d.onUnmounted(()=>{removeEventListener("keydown",Ht),removeEventListener("scroll",Gr,!0),removeEventListener("resize",ge),document.removeEventListener("click",Wt,!0),l.value&&ne(l.value).removeEventListener("scroll",Ce,!0)});const at=d.ref(!1),Tt=d.ref({}),fr=d.ref([]),Fn=d.ref(null);async function rs(){var de,Me;if(!((de=t.add)!=null&&de.token)||Fn!=null&&Fn.value.validate())return;const ee=t.add.api??`/api/table/${t.add.token}`,{id:ie}=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tt.value)}).then(P=>P.json());if(!((Me=t.options)!=null&&Me.length)&&t.data){const P=await fetch(`${t.api??`/api/suggest/${t.data}`}?val=${ie}`).then(O=>O.json());p.value=P[0],g.value.push(P[0]),o.value=ie}at.value=!1,pt({title:"Success!",message:"Object created."})}async function Yc(){if(!t.add)return null;const ee=await fetch(`/api/template/form/${t.add.form}`).then(ie=>ie.json());return fr.value=ee.schema,at.value=!0,null}function qc(ee,ie=200){let de;return(...Me)=>{de&&clearTimeout(de),de=window.setTimeout(()=>ee(...Me),ie)}}const Zc=qc(async ee=>{g.value=await K(ee)},200);d.watch(y,ee=>{t.data&&Zc(ee.trim())}),d.watch(()=>t.options,ee=>{!t.data&&(ee!=null&&ee.length)&&(g.value=[...ee],Ge())},{immediate:!0}),d.watch(()=>t.parent??t.parentValue,()=>{t.data&&U()});const Ga=d.ref(!0);return d.watch(z,async()=>{if(t.data&&(Ga.value||(a.value?(w.value=[],o.value=[],n("change",[])):(p.value=null,o.value=null,n("change",null))),await U(),t.auto===1&&z.value&&g.value.length>0)){const ee=g.value[0];ee&&le(ee)}}),(ee,ie)=>{var de,Me,P,O,J;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(xl),{visible:at.value,"onUpdate:visible":ie[1]||(ie[1]=X=>at.value=X),class:"z-[1000]",title:"Додати",buttonText:"Додати",onDone:rs,teleport:ee.teleport},{default:d.withCtx(()=>[d.createVNode(Fa,{schema:fr.value,modelValue:Tt.value,"onUpdate:modelValue":ie[0]||(ie[0]=X=>Tt.value=X),ref_key:"addForm",ref:Fn},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),d.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:s,onClick:ie[5]||(ie[5]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["relative w-full font-sans",t.customClass])},[ie[10]||(ie[10]=d.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),ie[11]||(ie[11]=d.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-[#b3d4ff]",f.value||h.value?"border-[#2684ff] ring-1 ring-[#2684ff]":"",i.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":f.value,"aria-haspopup":"listbox",onKeydown:Ie,onClick:W,"data-focus":f.value||h.value?"true":"false",ref_key:"triggerRef",ref:l},[d.createElementVNode("div",She,[a.value?(d.openBlock(),d.createElementBlock("div",khe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(S.value,X=>(d.openBlock(),d.createElementBlock("div",{class:"flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full",key:X.id},[d.createElementVNode("div",Ehe,[X!=null&&X.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:d.normalizeStyle({backgroundColor:X==null?void 0:X.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",title:R(X)},[N.value?(d.openBlock(),d.createElementBlock("span",{key:0,innerHTML:V(X)},null,8,The)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(X.text),1)],64))],8,Che)]),d.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border text-[#172b4d] hover:bg-[rgb(255,189,173)] hover:text-[rgb(222,53,11)] flex-shrink-0",onClick:d.withModifiers(se=>j(X.id),["stop"])},ie[6]||(ie[6]=[d.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Dhe)]))),128)),d.createElementVNode("div",Ahe,[!i.value&&ee.search?d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:b,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:w.value.length?" ":k.value,"onUpdate:modelValue":ie[2]||(ie[2]=X=>y.value=X),onFocus:Fe,onBlur:$t,onKeydown:Qe},null,40,Mhe)),[[d.vModelText,y.value]]):d.createCommentVNode("",!0)])])):!a.value&&E.value&&y.value===""?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["truncate text-gray-900 absolute"]),title:E.value},[(de=p.value)!=null&&de.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:d.normalizeStyle({backgroundColor:(Me=p.value)==null?void 0:Me.color})},null,4)):d.createCommentVNode("",!0),N.value?(d.openBlock(),d.createElementBlock("span",{key:1,class:d.normalizeClass({"pl-5":(P=p.value)==null?void 0:P.color}),innerHTML:V(p.value)},null,10,Lhe)):(d.openBlock(),d.createElementBlock("span",{key:2,class:d.normalizeClass({"pl-5":(O=p.value)==null?void 0:O.color})},d.toDisplayString((J=p.value)==null?void 0:J.text),3))],8,Nhe)):d.createCommentVNode("",!0),a.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Ihe,[!i.value&&ee.search?d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:b,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:E.value?" ":k.value,"onUpdate:modelValue":ie[3]||(ie[3]=X=>y.value=X),onFocus:Fe,onBlur:$t,onKeydown:Qe},null,40,Bhe)),[[d.vModelText,y.value]]):d.createCommentVNode("",!0)]))]),d.createElementVNode("div",Vhe,[C.value?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:i.value,onClick:d.withModifiers(H,["stop"])},ie[7]||(ie[7]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Rhe)):d.createCommentVNode("",!0),ie[9]||(ie[9]=d.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),d.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:i.value,onClick:ie[4]||(ie[4]=d.withModifiers(X=>ce(),["stop"])),title:f.value?"Закрити список":"Відкрити список"},ie[8]||(ie[8]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,Phe)])],42,whe),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[f.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:d.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:d.normalizeStyle(x.value),role:"listbox"},[d.createElementVNode("div",{class:"overflow-y-auto py-1",style:d.normalizeStyle({maxHeight:x.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[D.value.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(D.value,(X,se)=>(d.openBlock(),d.createElementBlock("div",{key:X.id,ref_for:!0,ref:_e=>m.value[se]=_e,class:d.normalizeClass(["flex px-3 py-2 cursor-pointer select-none text-gray-900",T(X.id)?"bg-[#2684ff] text-white":"bg-white hover:bg-[#deebff] hover:text-[#172b4d]",v.value===se&&!T(X.id)?"bg-[#deebff] text-[#172b4d]":""]),"aria-disabled":T(X.id)?"true":"false",role:"option",tabindex:"-1",onClick:_e=>we(X)},[X!=null&&X.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:d.normalizeStyle({backgroundColor:X==null?void 0:X.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["leading-[19px]",v.value===X.id?"text-white":"",(v.value,"")])},[N.value?(d.openBlock(),d.createElementBlock("span",{key:0,innerHTML:V(X)},null,8,zhe)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(X.text),1)],64))],2)],10,Ohe))),128)):(d.openBlock(),d.createElementBlock("div",Fhe," No options "))],4)],4)):d.createCommentVNode("",!0)]))],2),t.add?(d.openBlock(),d.createElementBlock("button",{key:0,onClick:Yc,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:i.value,type:"button"},[d.createVNode(da,{width:"16",height:"16"}),ie[12]||(ie[12]=d.createElementVNode("span",null,"Додати",-1))],8,$he)):d.createCommentVNode("",!0)],512)],64)}}}),Ghe=["placeholder","disabled"],HR=d.defineComponent({__name:"vs-input-textarea",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??"");function o(){typeof n.value=="string"&&(n.value=n.value.trim())}return(s,l)=>d.withDirectives((d.openBlock(),d.createElementBlock("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),placeholder:i.value,disabled:a.value,row:"2",onBlur:o,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,42,Ghe)),[[d.vModelText,n.value]])}}),Uhe={key:1,class:"richtext-error"},WR=d.defineComponent({__name:"vs-input-richtext",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},richtextProps:{default:()=>({})}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=d.ref(null);d.onMounted(async()=>{try{const l=await new Function("specifier","return import(specifier)")("@opengis/richtext");e.value=l.VsRichtext}catch{console.warn("@opengis/richtext is not installed. Please install it to use richtext input.")}});const t=r,{inputClass:n}=br(t.style),a=d.useModel(r,"modelValue"),i=d.computed(()=>!!t.disabled),o=d.computed(()=>t.placeholder??""),s=d.computed(()=>({height:"300px",...t.richtextProps}));return(l,u)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["richtext-wrapper !h-full !border-transparent",[l.customClass,d.unref(n),{"richtext-disabled":i.value}]]),style:d.normalizeStyle(i.value?{pointerEvents:"none",opacity:.6}:{})},[e.value?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.value),d.mergeProps({key:0,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),placeholder:o.value},s.value),null,16,["modelValue","placeholder"])):(d.openBlock(),d.createElementBlock("div",Uhe,u[1]||(u[1]=[d.createElementVNode("p",null,"@opengis/richtext package is not installed.",-1),d.createElementVNode("p",null,"Please install it: npm install @opengis/richtext",-1)])))],6))}}),Hhe={},Whe={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 Yhe(r,e){return d.openBlock(),d.createElementBlock("svg",Whe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),d.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const qhe=Ye(Hhe,[["render",Yhe]]),Zhe={},Xhe={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 jhe(r,e){return d.openBlock(),d.createElementBlock("svg",Xhe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Khe=Ye(Zhe,[["render",jhe]]),Qhe={},Jhe={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 epe(r,e){return d.openBlock(),d.createElementBlock("svg",Jhe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const tpe=Ye(Qhe,[["render",epe]]),rpe={},npe={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 ape(r,e){return d.openBlock(),d.createElementBlock("svg",npe,e[0]||(e[0]=[d.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 Mp=Ye(rpe,[["render",ape]]),ipe={},ope={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function spe(r,e){return d.openBlock(),d.createElementBlock("svg",ope,e[0]||(e[0]=[d.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 lpe=Ye(ipe,[["render",spe]]),upe={},cpe={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 dpe(r,e){return d.openBlock(),d.createElementBlock("svg",cpe,e[0]||(e[0]=[d.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 fpe=Ye(upe,[["render",dpe]]),hpe={class:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden flex flex-col"},ppe={class:"flex flex-col gap-2 !p-4 border-b border-gray-200 sm:flex-row sm:items-center sm:justify-between bg-gray-50"},gpe={class:"relative w-full"},vpe={class:"flex flex-nowrap items-center justify-end gap-2 w-full overflow-x-auto"},mpe={class:"w-full overflow-x-auto"},ype={class:"w-full min-w-[640px] divide-y divide-gray-200"},bpe={class:"bg-gray-50"},_pe={class:"border-b border-gray-200"},xpe={class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center"},wpe=["onClick"],Spe={key:0,class:"text-gray-400"},kpe={key:0,colspan:"100%",class:"text-center"},Epe={class:"w-full"},Cpe={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Tpe=["onDragstart","onDragover","onDrop"],Dpe={class:"px-4 py-3 text-center align-middle"},Ape={class:"flex items-center justify-center"},Mpe=["innerHTML"],Npe={key:0,class:"flex items-center gap-3 text-sm text-gray-700"},Lpe={key:0},Ipe=["src"],Bpe={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},Vpe={key:1,class:"flex items-center justify-center"},Rpe={key:2,class:"text-sm font-medium text-gray-900"},Ppe={class:"px-4 py-3 text-right"},Ope={class:"flex items-center justify-end gap-2"},zpe=["onClick"],Fpe=["onClick"],$pe={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},YR=d.defineComponent({__name:"vs-input-datatable",props:d.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useSlots(),n=d.useModel(r,"modelValue"),a=d.ref({}),i=d.ref(""),o=d.ref(null),s=d.ref("asc"),l=d.computed(()=>{const W=n.value??[],H=i.value?W.filter(le=>{var we;return(we=e.colModel)==null?void 0:we.some($=>{const ne=$.key||$.name;if(!ne)return!1;const Z=le[ne];return Z?Array.isArray(Z)?Z.join(", ").toLowerCase().includes(i.value.toLowerCase()):String(Z).toLowerCase().includes(i.value.toLowerCase()):!1})}):W;if(!o.value)return H;const j=o.value,oe=[...H].sort((le,we)=>{const $=G(le==null?void 0:le[j]),ne=G(we==null?void 0:we[j]);return typeof $=="number"&&typeof ne=="number"?$-ne:String($).localeCompare(String(ne))});return s.value==="asc"?oe:oe.reverse()}),u=d.ref(null),c=d.ref(null),f=d.ref(null),h=W=>{u.value=W},p=W=>{c.value=W},g=W=>{if(u.value===null||u.value===W){u.value=null,c.value=null;return}const H=[...n.value],[j]=H.splice(u.value,1);H.splice(W,0,j),n.value=H,u.value=null,c.value=null},v=()=>{f.value&&f.value.click()},m=W=>{const H=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],j=W.toLowerCase();return H.some(oe=>j.endsWith(oe))},y=W=>{var oe;const H=(oe=W.target.files)==null?void 0:oe[0];if(!H)return;const j=new FileReader;j.onload=le=>{var we;try{const $=(we=le.target)==null?void 0:we.result;if(typeof $=="string"){const ne=JSON.parse($);Array.isArray(ne)&&n.value.push(...ne)}}catch($){console.error("Error parsing file:",$)}},j.readAsText(H)},b=()=>{const W=JSON.stringify(n.value,null,2),H=new Blob([W],{type:"application/json"}),j=URL.createObjectURL(H),oe=document.createElement("a");oe.href=j,oe.download="data.json",oe.click(),URL.revokeObjectURL(j)},_=new Set(["autocomplete","select","radio","checkbox","combobox"]),x=new Map,w=(W,H)=>{const j=`/api/suggest/${W}`,oe=j.includes("?")?"&":"?",le=H?`&val=${H}`:"";return`${j}${oe}json=1${le}`},S=W=>W==null||W===""?null:typeof W=="object"?(W==null?void 0:W.id)!==void 0&&W.id!==null&&W.id!==""?W.id:null:W,k=W=>{const H=new Set;return Array.isArray(n.value)&&n.value.forEach(j=>{const oe=j==null?void 0:j[W];if(oe==null||oe==="")return;if(Array.isArray(oe)){oe.forEach(we=>{const $=S(we);$!==null&&H.add($)});return}const le=S(oe);le!==null&&H.add(le)}),H},E=async()=>{var H;if(!((H=e.colModel)!=null&&H.length))return;const W=e.colModel.filter(j=>{var oe;return j.data&&_.has(((oe=j.type)==null?void 0:oe.toLowerCase())||"")});W.length&&await Promise.all(W.map(async j=>{const oe=j.key||j.name;if(!oe)return;const le=k(oe),we=Array.from(le).map(Z=>String(Z)).sort(),$=we.join(",");if(!we.length||x.get(oe)===$)return;x.set(oe,$);const ne=we.map(encodeURIComponent).join(",");try{const Z=await(await fetch(w(j.data,ne))).json();a.value[oe]=(Z==null?void 0:Z.data)??Z}catch(Z){console.error("Failed to fetch column values",Z)}}))};d.watch([()=>e.colModel,()=>n.value],()=>{E()},{immediate:!0,deep:!0});const C=d.ref(""),T=d.ref(!1);let D="edit",A=0;const I=W=>((W==null?void 0:W.format)||(W==null?void 0:W.type)||"").toString().toLowerCase(),L=d.computed(()=>{var W;return((W=e.colModel)==null?void 0:W.filter(H=>I(H)!=="slot").map(H=>{const{slot:j,...oe}=H;return oe}))??[]}),B=d.ref({}),N=d.ref({}),V=W=>typeof W!="string"?!1:!!t[W],R=(W,H)=>H?H.split(".").reduce((j,oe)=>j==null?j:j[oe.trim()],W):W,F=(W,H)=>typeof W!="string"?"":W.replace(/{{\s*([^}]+)\s*}}/g,(j,oe)=>R(H,oe.trim())??""),G=W=>{if(W==null||W==="")return"";if(typeof W=="number")return W;if(typeof W=="boolean")return W?1:0;if(typeof W=="string")return W.toLowerCase();if(Array.isArray(W))return W.map(H=>G(H)).join(", ");if(typeof W=="object"){if(W.text!==void 0)return String(W.text).toLowerCase();if(W.label!==void 0)return String(W.label).toLowerCase();if(W.id!==void 0)return String(W.id).toLowerCase()}return String(W).toLowerCase()},z=W=>{const H=W.key||W.name;if(H){if(o.value===H){s.value=s.value==="asc"?"desc":"asc";return}o.value=H,s.value="asc"}};async function K(){C.value="Додати",T.value=!0,D="add",B.value={}}function U(W,H){var oe;if(!(W!=null&&W.length))return null;const j=typeof H=="object"?H==null?void 0:H.id:H;return j==null||j===""?null:((oe=W.find(le=>{var we;return((we=le==null?void 0:le.id)==null?void 0:we.toString())===j.toString()}))==null?void 0:oe.text)??null}function q(W){return W==null||W===""?"-":Array.isArray(W)?W.map(H=>typeof H=="object"?(H==null?void 0:H.text)??(H==null?void 0:H.id)??"-":H).join(", "):typeof W=="object"?(W==null?void 0:W.text)??(W==null?void 0:W.id)??"-":W}function ae(W,H){const j=H.key||H.name,oe=W==null?void 0:W[j],le=a.value[j];if(!oe)return"-";if(Array.isArray(oe)){const $=oe.map(ne=>U(le,ne)).filter(Boolean);return $.length?$.join(", "):q(oe)}return U(le,oe)||q(oe)}async function me(W,H){C.value="Редагувати",T.value=!0,D="edit",A=H,B.value={...W}}function be(){const W=N.value.validate();if(W){pt({type:"warning",title:"Помилка валідації",message:Object.entries(W).map(([H,j])=>`${H}: ${j}`).join(`
|
|
300
|
-
`)});return}D==="add"?Array.isArray(n.value)?n.value=[...n.value,B.value]:n.value=[B.value]:n.value=n.value.map((H,j)=>j===A?B.value:H),T.value=!1}function fe(W){n.value=n.value.filter((H,j)=>j!==W)}function ce(){T.value=!1}return(W,H)=>(d.openBlock(),d.createElementBlock("div",hpe,[d.createElementVNode("div",ppe,[d.createElementVNode("div",gpe,[d.createVNode(qhe,{width:"16",height:"16",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":H[0]||(H[0]=j=>i.value=j),placeholder:"Пошук",class:"w-full rounded-md border border-gray-200 bg-white pl-10 pr-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"},null,512),[[d.vModelText,i.value]])]),d.createElementVNode("div",vpe,[d.createElementVNode("input",{ref_key:"fileInput",ref:f,onChange:y,class:"hidden",accept:".json",type:"file"},null,544),d.createElementVNode("button",{type:"button",onClick:v,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[d.createVNode(Khe,{class:"text-gray-700",width:"16",height:"16"}),H[4]||(H[4]=d.createTextVNode(" Імпорт ",-1))]),d.createElementVNode("button",{type:"button",onClick:b,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[d.createVNode(tpe,{class:"text-gray-700",width:"16",height:"16"}),H[5]||(H[5]=d.createTextVNode(" Експорт ",-1))]),d.createElementVNode("button",{onClick:K,type:"button",class:"inline-flex items-center gap-2 rounded-md bg-blue-500 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-600 transition-colors"},[d.createVNode(da,{class:"text-white"}),H[6]||(H[6]=d.createTextVNode(" Додати ",-1))])])]),d.createElementVNode("div",mpe,[d.createElementVNode("table",ype,[d.createElementVNode("thead",bpe,[d.createElementVNode("tr",_pe,[d.createElementVNode("th",xpe,[d.createVNode(Mp,{width:"20",height:"20",class:"mx-auto text-gray-400"})]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.colModel,j=>(d.openBlock(),d.createElementBlock("th",{key:j.key,class:"px-4 py-3 text-left text-xs font-semibold text-gray-900"},[d.createElementVNode("button",{type:"button",onClick:oe=>z(j),class:"flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"},[d.createElementVNode("span",null,d.toDisplayString(j.ua||j.label),1),o.value===(j.key||j.name)?(d.openBlock(),d.createElementBlock("span",Spe,d.toDisplayString(s.value==="asc"?"▲":"▼"),1)):d.createCommentVNode("",!0)],8,wpe)]))),128)),H[7]||(H[7]=d.createElementVNode("th",{class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 text-center"}," Дії ",-1))])]),d.createElementVNode("tbody",{class:d.normalizeClass(["divide-y divide-gray-200",{"[&_tr:last-child]:border-0":!c.value}])},[l.value.length===0?(d.openBlock(),d.createElementBlock("td",kpe,[d.createElementVNode("div",Epe,[d.createElementVNode("div",Cpe,[d.createVNode(lpe,{class:"w-48 mx-auto"}),H[8]||(H[8]=d.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[d.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),d.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(l.value,(j,oe)=>(d.openBlock(),d.createElementBlock("tr",{key:j.id,class:d.normalizeClass(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700",{"opacity-50":u.value===oe,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":c.value===oe}]),draggable:"true",onDragstart:le=>h(oe),onDragover:d.withModifiers(le=>p(oe),["prevent"]),onDrop:le=>g(oe)},[d.createElementVNode("td",Dpe,[d.createElementVNode("div",Ape,[d.createVNode(Mp,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.colModel,le=>(d.openBlock(),d.createElementBlock("td",{key:le.key,class:"px-4 py-3 align-middle"},[I(le)==="slot"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[V(le.slot)?d.renderSlot(W.$slots,le.slot,{key:0,row:j,value:j[le.key],column:le}):(d.openBlock(),d.createElementBlock("div",{key:1,class:"text-sm text-gray-900",innerHTML:F(le.slot,j)},null,8,Mpe))],64)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[I(le)==="file"?(d.openBlock(),d.createElementBlock("div",Npe,[m(ae(j,le))?(d.openBlock(),d.createElementBlock("div",Lpe,[d.createElementVNode("img",{src:ae(j,le),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,Ipe)])):(d.openBlock(),d.createElementBlock("div",Bpe,[d.createVNode(OR,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):I(le)==="color"?(d.openBlock(),d.createElementBlock("div",Vpe,[d.createElementVNode("span",{class:"inline-flex h-6 w-6 rounded border border-gray-200",style:d.normalizeStyle({backgroundColor:ae(j,le)||"#ffffff"})},null,4)])):(d.openBlock(),d.createElementBlock("div",Rpe,d.toDisplayString(ae(j,le)),1))],64))]))),128)),d.createElementVNode("td",Ppe,[d.createElementVNode("div",Ope,[d.createElementVNode("button",{onClick:le=>me(j,oe),class:"p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors"},[d.createVNode(fpe,{width:"16",height:"16"})],8,zpe),d.createElementVNode("button",{onClick:le=>fe(oe),class:"p-1.5 text-gray-600 hover:text-red-600 hover:bg-red-50 rounded transition-colors"},[d.createVNode(Sl,{width:"16",height:"16"})],8,Fpe)])])],42,Tpe))),128))],2)])]),d.createVNode(d.unref(xl),{visible:T.value,title:C.value,size:"lg",onClose:ce,teleport:"#modal"},{default:d.withCtx(()=>[d.createVNode(Fa,{schema:L.value,values:B.value,"onUpdate:values":H[1]||(H[1]=j=>B.value=j),form:N.value,"onUpdate:form":H[2]||(H[2]=j=>N.value=j)},null,8,["schema","values","form"]),d.createElementVNode("div",$pe,[d.createElementVNode("button",{type:"button",onClick:H[3]||(H[3]=j=>T.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"}," Скасувати "),d.createElementVNode("button",{onClick:be,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"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),Gpe={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:"Клацніть на шари, щоб видалити їх"}}}}},Upe={},Hpe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function Wpe(r,e){return d.openBlock(),d.createElementBlock("svg",Hpe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),d.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const Ype=Ye(Upe,[["render",Wpe]]),qpe={},Zpe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function Xpe(r,e){return d.openBlock(),d.createElementBlock("svg",Zpe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),d.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),d.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const jpe=Ye(qpe,[["render",Xpe]]),Kpe={},Qpe={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-polygon"};function Jpe(r,e){return d.openBlock(),d.createElementBlock("svg",Qpe,e[0]||(e[0]=[d.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const ege=Ye(Kpe,[["render",Jpe]]),tge={},rge={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-topology-ring-3"};function nge(r,e){return d.openBlock(),d.createElementBlock("svg",rge,e[0]||(e[0]=[d.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const age=Ye(tge,[["render",nge]]),ige={},oge={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function sge(r,e){return d.openBlock(),d.createElementBlock("svg",oge,e[0]||(e[0]=[d.createElementVNode("title",null,null,-1),d.createElementVNode("desc",null,null,-1),d.createElementVNode("defs",null,null,-1),d.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[d.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[d.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[d.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const lge=Ye(ige,[["render",sge]]),uge={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},cge={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},dge=["onClick"],fge={class:"relative flex-1 min-w-[140px]"},hge=["placeholder"],pge="https://data.softpro.ua/api-user/gis-url-proxy",gge="https://geo.rv.ua/api-user/dzk.api",vge=d.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(r,{emit:e}){const t=r,n=e,a=["here","xy","parcel"],i=d.computed(()=>{var w,S;const x=(S=(w=t.config)==null?void 0:w.tools)==null?void 0:S.filter(k=>a.includes(k));return x&&x.length?x:a}),o=d.computed(()=>{var x,w;return((w=(x=t.config)==null?void 0:x.placeholder)==null?void 0:w.trim())||"Пошук…"}),s=d.ref(i.value[0]??a[0]);d.watch(i,x=>{x.includes(s.value)||(s.value=x[0])});const l=d.ref(""),u=d.ref(!1),c=d.ref(null);d.watch(s,()=>{l.value="",u.value=!1});function f(x){s.value=x}function h(x){if(!u.value)return;const w=c.value;w&&!w.contains(x.target)&&(u.value=!1)}d.onMounted(()=>{window.addEventListener("click",h,!0)}),d.onBeforeUnmount(()=>{window.removeEventListener("click",h,!0)});function p(x){return x==="xy"?"Координати":x==="parcel"?"Кадастр":"Адреси"}function g(x){const w=x.replace(/[,]+/g," ").trim();if(!w)return null;const S=w.split(/\s+/).filter(Boolean);if(S.length<2)return null;const k=S.slice(0,2).map(Number);if(!k.every(L=>Number.isFinite(L)))return null;const[E,C]=k;let T=E,D=C;const A=L=>Math.abs(L)<=90,I=L=>Math.abs(L)<=180;if(!A(T)||!I(D))if(A(D)&&I(T))T=C,D=E;else return null;return{lat:T,lng:D}}function v(x){return((x==null?void 0:x.items)||[]).map((w,S)=>{var k,E,C;return{id:String((w==null?void 0:w.id)??S),title:(w==null?void 0:w.title)||((k=w==null?void 0:w.address)==null?void 0:k.label)||"Знайдений обʼєкт",lat:Number((E=w==null?void 0:w.position)==null?void 0:E.lat),lng:Number((C=w==null?void 0:w.position)==null?void 0:C.lng)}}).filter(w=>Number.isFinite(w.lat)&&Number.isFinite(w.lng))}function m(x){const w=(x==null?void 0:x.result)||(x==null?void 0:x.data)||x;if(!w)return[];const S=w.geom_centroid;if(!S||!Array.isArray(S.coordinates))return[];const[k,E]=S.coordinates;return!Number.isFinite(E)||!Number.isFinite(k)?[]:[{id:"parcel",title:w.cadnum||w.cad_num||"Земельна ділянка",lat:E,lng:k}]}function y(x){const w=x.replace(/\s+/g,"").split(":");if(w.length!==4)return!1;const S=[10,2,3,4];return w.every((k,E)=>k.length===S[E]&&/^\d+$/.test(k))}function b(x){n("goToCoordinates",[x.lat,x.lng])}async function _(){const x=l.value.trim();if(x){if(s.value==="xy"){const w=g(x);if(!w){pt({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}b(w),l.value="";return}try{const w=new URL(s.value==="here"?pge:gge);if(s.value==="here")w.searchParams.set("searchtext",x);else{if(!y(x)){pt({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}w.searchParams.set("cad_num",x)}const S=await fetch(w.toString());if(!S.ok)throw new Error(`HTTP ${S.status}`);const k=await S.json(),E=s.value==="here"?v(k):m(k);if(!E.length)pt({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const C=E[0];b(C),l.value=""}}catch(w){const S=(w==null?void 0:w.message)||"Помилка пошуку";pt({type:"error",title:"Пошук",message:S})}}}return(x,w)=>(d.openBlock(),d.createElementBlock("div",uge,[d.createElementVNode("form",{class:"flex gap-2",onSubmit:d.withModifiers(_,["prevent"])},[i.value.length>1?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:"relative search-type w-[140px]"},[d.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:w[0]||(w[0]=S=>u.value=!u.value)},[d.createElementVNode("span",null,d.toDisplayString(p(s.value)),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":u.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w[2]||(w[2]=[d.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),u.value?(d.openBlock(),d.createElementBlock("div",cge,[d.createElementVNode("ul",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,S=>(d.openBlock(),d.createElementBlock("li",{key:S,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:k=>f(S)},d.toDisplayString(p(S)),9,dge))),128))])])):d.createCommentVNode("",!0)],512)):d.createCommentVNode("",!0),d.createElementVNode("div",fge,[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=S=>l.value=S),placeholder:o.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,hge),[[d.vModelText,l.value,void 0,{trim:!0}]]),w[3]||(w[3]=d.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),mge=Ye(vge,[["__scopeId","data-v-b5059a01"]]),yge={class:"bg-white/30 p-1 rounded-md shadow w-fit"},bge={class:"flex gap-2"},_ge=["onClick","title"],xge=["src"],wge=d.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(r,{emit:e}){const t=d.ref(Object.keys(r.basemaps)[0]),n=e;function a(s){n("onLayerChange",s),t.value=s}const i={z:13,x:4790,y:2762};function o(s){if(s!=null&&s.preview)return s.preview;if(!(s!=null&&s.url))return;const l={"{z}":i.z,"{x}":i.x,"{y}":i.y};let u=s.url;return Object.entries(l).forEach(([c,f])=>{u=u.replace(new RegExp(c,"gi"),String(f))}),u}return(s,l)=>(d.openBlock(),d.createElementBlock("div",yge,[d.createElementVNode("div",bge,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.basemaps,(u,c)=>(d.openBlock(),d.createElementBlock("div",{key:c,class:d.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":t.value===c}]),onClick:f=>a(c),title:u.name||c,role:"button",tabindex:"0"},[d.createElementVNode("img",{src:o(u),alt:"",class:"w-10 h-10 object-cover"},null,8,xge)],10,_ge))),128))])]))}});function Pc(r){return r?r.type==="Polygon"?{type:"MultiPolygon",coordinates:[r.coordinates]}:r.type==="Feature"?{...r,geometry:Pc(r.geometry)}:r.type==="FeatureCollection"?{...r,features:(r.features||[]).map(e=>Pc(e)).filter(Boolean)}:r:null}function Sge(r){return r?r.type==="FeatureCollection"||r.type==="Feature"?Pc(r):r.geom?{type:"Feature",geometry:Pc({type:r.geom.type,coordinates:r.geom.coordinates}),properties:{}}:r.type&&r.coordinates?{type:"Feature",geometry:Pc(r),properties:{}}:null:null}const kge={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},Ege={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},Cge={class:"text-sm font-medium"},Tge={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Dge={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},Age={class:"flex items-center gap-1"},Mge=["disabled"],Nge=["disabled"],Lge=["disabled"],Ige={class:"bg-white/95 border border-gray-200 rounded-md shadow-xl px-3 py-2 max-w-[240px] text-[11px] sm:text-xs text-gray-900"},Bge={class:"space-y-0.5"},Vge={class:"text-gray-500"},Rge={class:"text-gray-900 text-right break-all"},Pge={class:"absolute top-4 right-4 z-[1000]"},Oge={class:"flex flex-col gap-[2px]"},zge=["disabled"],Fge=["disabled"],$ge=["disabled"],Gge=["disabled"],Uge={class:"flex flex-col gap-2"},Hge={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},Wge={class:"flex flex-col gap-1"},Yge=["checked","disabled","onChange"],qge={class:"text-gray-700 text-xs font-medium"},Zge={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},Xge={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},jge={class:"shrink-0"},Kge={class:"font-bold"},Qge={class:"flex items-center"},Jge={class:"text-xs mr-2"},eve={key:0,class:"text-xs"},tve={key:1,class:"text-xs"},rve=["disabled"],nve=["disabled"],Np="vs-base-tile-pane",Lp="vs-overlay-tile-pane",Ip="__vs_form_leaflet_loader__",j1="__vs_form_leaflet_scripts__",ave=d.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},ctrlZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},katottg:{default:""},layers:{default:()=>[]},bounds:{},api:{},center:{default:void 0},zoom:{default:void 0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){var ee,ie,de,Me;const t=((Me=(de=(ie=(ee=d.getCurrentInstance())==null?void 0:ee.appContext)==null?void 0:ie.config)==null?void 0:de.globalProperties)==null?void 0:Me.$settings)??{},n=Array.isArray(t.center)&&t.center.length===2?t.center:[50,30],a=typeof t.zoom=="number"?t.zoom:typeof t.defaultZoom=="number"?t.defaultZoom:10,i=r,o=e,s=d.computed(()=>!!i.disabled),l=d.ref(!1),u=d.ref(null),c=d.ref(!1),f=d.ref(""),h=d.ref(null),p=d.ref(null),g=d.ref(!1),v=d.ref(null),m=d.ref(null),y=d.ref(0),b=d.ref(Array.isArray(i.center)&&i.center.length===2?[...i.center]:n),_=d.ref(typeof i.zoom=="number"?i.zoom:a),x=d.ref([]),w=d.ref(i.modelValue);let S=!1;const k=d.ref(null),E=d.computed(()=>{var J;const P={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!((J=i.tools)!=null&&J.length))return{...P,point:!0,line:!0,polygon:!0,rectangle:!0};const O=new Set(i.tools.map(X=>X.toLowerCase()));return{search:O.has("search"),import:O.has("import"),export:O.has("export"),point:O.has("point"),line:O.has("line"),polygon:O.has("polygon"),rectangle:O.has("rectangle")}}),C=d.reactive({}),T=d.ref([]),D=d.computed(()=>T.value.map(P=>C[P]).filter(Boolean)),A=d.ref(null),I=d.computed(()=>{var P;return((P=A.value)==null?void 0:P.entries)??[]}),L=d.computed(()=>{if(!A.value)return;const P=12,O=A.value.point.x+P,J=A.value.point.y+P;return{left:`${O}px`,top:`${J}px`}});function B(P){var X;if(typeof P!="string"||!P.trim())return"";if(/^https?:\/\//i.test(P))return P;const O=((X=window==null?void 0:window.location)==null?void 0:X.origin)??"",J=P.replace(/^\/+/,"");return J?O?`${O}/${J}`:`/${J}`:O}function N(){if(Array.isArray(t.basemaps)&&t.basemaps.length){const P=t.basemaps.map((O,J)=>{const X=String((O==null?void 0:O.key)??(O==null?void 0:O.id)??(O==null?void 0:O.name)??`b${J}`),se=B(String((O==null?void 0:O.url)??""));if(!se)return null;const _e=typeof(O==null?void 0:O.preview)=="string"&&O.preview?B(O.preview):"";return[X,{...O,url:se,preview:_e}]}).filter(O=>Array.isArray(O)&&O.length===2).reduce((O,[J,X])=>(O[J]=X,O),{});if(Object.keys(P).length)return P}return{voyager:{name:"Оглядова карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{name:"Ортофото 1:10K",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{name:"Open Street Maps",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const V=N(),R=Object.keys(V),F=d.ref(R.length?R[0]:"");let G,z,K,U,q=null;async function ae(){if(typeof window>"u")return null;const P=window;if(P[Ip])return P[Ip];const O=_e=>{if(!Array.from(document.styleSheets).some(De=>{var ze;return(ze=De==null?void 0:De.href)==null?void 0:ze.includes(_e)})){const De=document.createElement("link");De.rel="stylesheet",De.href=_e,document.head.appendChild(De)}};P[j1]=P[j1]||{};const J=P[j1],X=_e=>(J[_e]||(J[_e]=fetch(_e).then(De=>{if(!De.ok)throw new Error(`Failed to load ${_e}: ${De.status}`);return De.text()}).then(De=>{const ze=document.createElement("script");ze.textContent=`/* vs-form loader ${_e} */
|
|
301
|
-
${De}`,document.head.appendChild(ze)})),J[_e]),se=(async()=>{O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),window.L||await X("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),await X("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"),await X("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js");const _e=window.L;if(!_e)throw new Error("Leaflet global not available after loading scripts");return _e})().catch(_e=>{throw delete P[Ip],_e});return P[Ip]=se,se}function me(){const P=navigator.platform.toUpperCase().includes("MAC");return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":P?"Використовуйте Ctrl або ⌘ + прокрутка для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}function be(){if(!i.handleZoom||!u.value||!z)return null;let P;const O=X=>{const se=X.ctrlKey||X.metaKey||X.shiftKey;if(!i.ctrlZoom){c.value=!1,z.scrollWheelZoom.enable();return}if(!se){c.value=!0,f.value=me(),clearTimeout(P),P=window.setTimeout(()=>c.value=!1,1200);return}X.preventDefault(),X.stopPropagation(),c.value=!1,z.scrollWheelZoom.enable(),setTimeout(()=>z.scrollWheelZoom.disable(),120)},J=X=>{if(X.touches.length===1){if(!i.ctrlZoom)return;c.value=!0,f.value=me(),clearTimeout(P),P=window.setTimeout(()=>c.value=!1,3e3)}else c.value=!1};return u.value.addEventListener("wheel",O,{passive:!1}),u.value.addEventListener("touchstart",J,{passive:!0}),z.on("wheel",X=>{var se,_e,De,ze,kt,xt,Yt;i.ctrlZoom&&((se=X.originalEvent)!=null&&se.ctrlKey||(_e=X.originalEvent)!=null&&_e.metaKey||(De=X.originalEvent)!=null&&De.shiftKey||((kt=(ze=X.originalEvent)==null?void 0:ze.preventDefault)==null||kt.call(ze),(Yt=(xt=X.originalEvent)==null?void 0:xt.stopPropagation)==null||Yt.call(xt)))}),()=>{var X,se;(X=u.value)==null||X.removeEventListener("wheel",O),(se=u.value)==null||se.removeEventListener("touchstart",J),clearTimeout(P)}}function fe(P,O){return P!=null&&P.id?String(P.id):P!=null&&P.url?`${P.url}-${O}`:`layer-${O}`}function ce(P){var se;const O=((P==null?void 0:P.url)??"").trim();if(!O)return"";if(/^https?:\/\//i.test(O))return O;const J=((se=window.location)==null?void 0:se.origin)??"",X=O.replace(/^\/+/,"");return`${J}/${X}`}function W(P){const O=(P==null?void 0:P.style)??{};return J=>{const{colorAttr:X}=O,se=O.colorSet??{},_e=typeof X=="string"?(se==null?void 0:se[J==null?void 0:J[X]])??O.color??"#3388ff":O.color??"#3388ff",De=O.stroke??_e;return{weight:O.width??1,color:De,opacity:O.opacity??1,fill:O.type?O.type!=="polyline":!0,fillColor:_e,fillOpacity:O.opacity??.5}}}function H(P){var O,J,X;return((O=P==null?void 0:P.layer)==null?void 0:O.properties)||((X=(J=P==null?void 0:P.layer)==null?void 0:J.feature)==null?void 0:X.properties)||(P==null?void 0:P.properties)||{}}function j(P,O={}){return P.popup===!1?[]:Array.isArray(P.popup)&&P.popup.length?P.popup.map(J=>{if(!(J!=null&&J.field))return null;const X=O[J.field];return X==null||X===""?null:{key:J.label||J.field,value:String(X)}}).filter(J=>!!J):Object.entries(O).filter(([J])=>typeof J=="string"&&J).slice(0,5).map(([J,X])=>({key:J,value:X==null?"—":String(X)}))}function oe(P,O){if(!z||!(O!=null&&O.latlng))return;const J=z.latLngToContainerPoint(O.latlng),X=H(O),se=j(P,X);if(!se.length){le(P.id);return}A.value={layerId:P.id,title:(X==null?void 0:X.name)||P.title||P.name,properties:X,entries:se,point:{x:J.x,y:J.y}}}function le(P){var O;P&&((O=A.value)==null?void 0:O.layerId)!==P||(A.value=null)}function we(P){var se,_e,De,ze,kt,xt,Yt;const O=((P==null?void 0:P.service)??"").toLowerCase(),J=ce(P),X=P.sourceLayer||P.layer||P.service_layer||P.service_key||P.map_key||((se=P.dataset)==null?void 0:se.layer)||P.id||P.table_name;if(O==="vtile"){const dt=k.value;if((_e=dt==null?void 0:dt.vectorGrid)!=null&&_e.protobuf&&!(dt!=null&&dt.maplibreGL)){const ut=dt.vectorGrid.protobuf(J,{interactive:!0,maxNativeZoom:P.maxzoom??19,vectorTileLayerStyles:{[X??"default"]:W(P),default:W(P)}});return(De=ut==null?void 0:ut.on)==null||De.call(ut,"mouseover",_r=>oe(P,_r)),(ze=ut==null?void 0:ut.on)==null||ze.call(ut,"mousemove",_r=>oe(P,_r)),(kt=ut==null?void 0:ut.on)==null||kt.call(ut,"mouseout",()=>le(P.id)),ut}if(dt!=null&&dt.maplibreGL&&(window!=null&&window.maplibregl)){const ut=J;return ut?dt.maplibreGL({style:ut,interactive:!1,pane:"overlayPane"}):null}return null}return O==="tile"||/^https?:\/\//i.test(J)||J.includes("{z}")?k.value.tileLayer(J,{opacity:((xt=P==null?void 0:P.style)==null?void 0:xt.opacity)??1,pane:Lp}):k.value.tileLayer(J,{opacity:((Yt=P==null?void 0:P.style)==null?void 0:Yt.opacity)??1,pane:Lp})}function $(P){var ze,kt,xt,Yt;const O=k.value;if(!O)return null;const J=("bounds"in P?P.bounds:void 0)??i.bounds??x.value;if(!Array.isArray(J)||!J.length)return null;const X={color:((ze=P.style)==null?void 0:ze.stroke)??((kt=P.style)==null?void 0:kt.color)??"#2563eb",weight:((xt=P.style)==null?void 0:xt.width)??2,interactive:!1,opacity:((Yt=P.style)==null?void 0:Yt.opacity)??.8,dashArray:"4 4"},se=Array.isArray(P.bounds)&&P.bounds.length?P.bounds:J,_e=ne(se);if(!_e.length||!(O!=null&&O.polyline))return null;const De=_e.map(dt=>{if(!dt.length)return dt;const ut=dt[0],_r=dt[dt.length-1];return ut&&_r&&typeof _r.equals=="function"&&!_r.equals(ut)?[...dt,ut]:dt});return O.polyline(De,X)}function ne(P){const O=k.value;if(!O||!Array.isArray(P))return[];const J=se=>{if(!Array.isArray(se)||se.length<2)return null;const[_e,De]=se;return!Number.isFinite(Number(De))||!Number.isFinite(Number(_e))?null:O.latLng(Number(De),Number(_e))},X=se=>Array.isArray(se)&&se.length>=2&&se.every(_e=>Number.isFinite(Number(_e)));if(P.length&&X(P[0])){const se=P.map(J).filter(Boolean);return se.length?[se]:[]}return P.length&&Array.isArray(P[0])&&Array.isArray(P[0][0])&&X(P[0][0][0])?P.flatMap(se=>Array.isArray(se)?se:[]).map(se=>Array.isArray(se)?se.map(J).filter(Boolean):[]).filter(se=>se.length):P.length&&Array.isArray(P[0])&&X(P[0][0])?P.map(se=>Array.isArray(se)?se.map(J).filter(Boolean):[]).filter(se=>se.length):[]}function Z(){if(!z||!k.value)return;q&&z.hasLayer(q)&&(z.removeLayer(q),q=null);const P=$({id:"global-bounds",bounds:i.bounds??x.value,style:{}});P&&(q=P,q.addTo(z))}function Ie(){!z||!k.value||T.value.forEach(P=>{const O=C[P];O&&(O.visible?(O.layer||(O.layer=we(O.config)),O.boundsLayer||(O.boundsLayer=$(O.config)),O.layer&&!z.hasLayer(O.layer)&&O.layer.addTo(z),O.boundsLayer&&!z.hasLayer(O.boundsLayer)&&O.boundsLayer.addTo(z)):(O.layer&&z.hasLayer(O.layer)&&z.removeLayer(O.layer),O.boundsLayer&&z.hasLayer(O.boundsLayer)&&z.removeLayer(O.boundsLayer),le(O.id)))})}function Qe(P){if(s.value)return;const O=C[P];O&&(O.visible=!O.visible,O.visible?(O.layer||(O.layer=we(O.config)),O.boundsLayer||(O.boundsLayer=$(O.config)),O.layer&&!z.hasLayer(O.layer)&&O.layer.addTo(z),O.boundsLayer&&!z.hasLayer(O.boundsLayer)&&O.boundsLayer.addTo(z)):(O.layer&&z.hasLayer(O.layer)&&z.removeLayer(O.layer),O.boundsLayer&&z.hasLayer(O.boundsLayer)&&z.removeLayer(O.boundsLayer),le(O.id)))}d.watch(()=>i.layers,P=>{const O=Array.isArray(P)?P:[],J=[],X=new Set;O.forEach((se,_e)=>{if(!se)return;const De=fe(se,_e);J.push(De),X.add(De);const ze=C[De],kt={...se,id:De},xt=(ze==null?void 0:ze.visible)??!!(kt!=null&&kt.visible);ze&&(ze.layer&&(z!=null&&z.hasLayer(ze.layer))&&z.removeLayer(ze.layer),ze.boundsLayer&&(z!=null&&z.hasLayer(ze.boundsLayer))&&z.removeLayer(ze.boundsLayer),le(De)),C[De]={id:De,config:kt,visible:xt,layer:null,boundsLayer:null}}),Object.keys(C).forEach(se=>{if(!X.has(se)){const _e=C[se];_e!=null&&_e.layer&&(z!=null&&z.hasLayer(_e.layer))&&z.removeLayer(_e.layer),_e!=null&&_e.boundsLayer&&(z!=null&&z.hasLayer(_e.boundsLayer))&&z.removeLayer(_e.boundsLayer),le(se),delete C[se]}}),T.value=J,Ie()},{immediate:!0,deep:!0}),d.watch(()=>i.bounds,()=>{z&&(Object.values(C).forEach(P=>{P.boundsLayer&&z.hasLayer(P.boundsLayer)&&z.removeLayer(P.boundsLayer),P.boundsLayer=null}),Z(),Ie())},{deep:!0}),d.watch(()=>i.katottg,async P=>{var O,J;if(x.value=[],!P){Z();return}try{const X=await fetch(`https://data.gki.com.ua/api-user/atu/${P}`);if(!(X!=null&&X.ok))return;const se=(J=(O=await X.json())==null?void 0:O.geometry)==null?void 0:J.coordinates;Array.isArray(se)&&se.length&&(x.value=se)}catch(X){console.error("Failed to fetch KATOTTG bounds",X)}finally{Z(),Ie()}},{immediate:!0}),d.watch(()=>i.modelValue,P=>{if(!z||!K){w.value=P;return}Gr(P)},{deep:!0});function Fe(P){const O=k.value;return P instanceof O.Circle?"Circle":P instanceof O.Rectangle?"Rectangle":P instanceof O.Polygon&&!(P instanceof O.Rectangle)?"Polygon":P instanceof O.Polyline&&!(P instanceof O.Polygon)?"Polyline":P instanceof O.Marker?"Point":"Feature"}function $t(P){var J,X,se,_e;const O=k.value;if(P instanceof O.Circle){const De=P.getRadius();return Math.PI*(De*De)/1e6}if(P instanceof O.Polygon||P instanceof O.Rectangle)try{const De=P.getLatLngs();if(!Array.isArray(De)||!De.length)return null;if(!Array.isArray(De[0])){const xt=(J=O.GeometryUtil)!=null&&J.geodesicArea?O.GeometryUtil.geodesicArea(De):0;return xt?Math.abs(xt)/1e6:0}const ze=De[0];if(ze.length>0&&(ze[0]instanceof O.LatLng||typeof((X=ze[0])==null?void 0:X.lat)=="number")){const{feature:xt}=P;if(((se=xt==null?void 0:xt.geometry)==null?void 0:se.type)==="MultiPolygon"){const dt=De.reduce((ut,_r)=>{var Xc;if(!Array.isArray(_r)||!_r.length)return ut;if((Xc=O.GeometryUtil)!=null&&Xc.geodesicArea){const MP=O.GeometryUtil.geodesicArea(_r);if(MP)return ut+Math.abs(MP)}return ut},0);return dt?dt/1e6:0}const Yt=(_e=O.GeometryUtil)!=null&&_e.geodesicArea?O.GeometryUtil.geodesicArea(De):0;return Yt?Math.abs(Yt)/1e6:0}const kt=De.reduce((xt,Yt)=>{var ut;if(!Array.isArray(Yt)||!Yt.length)return xt;const dt=Array.isArray(Yt[0])?Yt[0]:Yt;if((ut=O.GeometryUtil)!=null&&ut.geodesicArea){const _r=O.GeometryUtil.geodesicArea(dt);if(_r)return xt+Math.abs(_r)}return xt},0);return kt?kt/1e6:0}catch{return null}return null}function Ht(P){return P instanceof k.value.Circle?P.getLatLng():P.getBounds?P.getBounds().getCenter():P.getLatLng?P.getLatLng():z.getCenter()}function Wt(P){const O=K.toGeoJSON(),J=[],X=[];let se=null;const _e=ze=>{if(ze)switch(ze.type){case"Point":se=ze;break;case"Polygon":J.push(ze.coordinates);break;case"MultiPolygon":J.push(...ze.coordinates);break;case"LineString":X.push(ze.coordinates);break;case"MultiLineString":X.push(...ze.coordinates);break;case"GeometryCollection":(ze.geometries||[]).forEach(_e);break}};((O==null?void 0:O.features)||[]).forEach(ze=>_e(ze.geometry));const De=se||(J.length?{type:J.length===1?"Polygon":"MultiPolygon",coordinates:J.length===1?J[0]:J}:X.length?{type:X.length===1?"LineString":"MultiLineString",coordinates:X.length===1?X[0]:X}:null);!(P!=null&&P.silent)&&!S&&o("update:modelValue",De),y.value=K.getLayers().length}function Gr(P){var X,se;if(!K||!k.value)return;K.clearLayers();const O=Sge(P);if(!O){p.value=null,y.value=0;return}k.value.geoJSON(O).eachLayer(_e=>K.addLayer(_e)),S=!0,Wt({silent:!0}),S=!1,ge();const J=(X=K.getBounds)==null?void 0:X.call(K);(se=J==null?void 0:J.isValid)!=null&&se.call(J)&&(z==null||z.fitBounds(J,{padding:[24,24]}))}function ge(){var xt,Yt;const P=K.getLayers();if(!P.length){p.value=null,y.value=0;return}const O=P[P.length-1],J=Fe(O),X=Ht(O),se=K.toGeoJSON(),_e=((xt=se==null?void 0:se.features)==null?void 0:xt.some(dt=>{var ut;return((ut=dt.geometry)==null?void 0:ut.type)==="MultiPolygon"}))||((Yt=se==null?void 0:se.geometry)==null?void 0:Yt.type)==="MultiPolygon",De=P.length>1&&P.every(dt=>dt instanceof k.value.Polygon||dt instanceof k.value.Rectangle),ze=_e||De;let kt=null;if(ze){const dt=P.reduce((ut,_r)=>{const Xc=$t(_r);return ut+(Xc?Xc*1e6:0)},0);kt=dt?dt/1e6:0}else kt=$t(O);p.value={type:J,center:X,areaKm2:kt,layer:O},y.value=P.length}const Ce=d.ref("");function Ge(P){if(s.value||!z||!k.value)return;U!=null&&U.disable&&U.disable();const O=k.value;switch(P){case"marker":U=new O.Draw.Marker(z);break;case"polyline":U=new O.Draw.Polyline(z);break;case"polygon":U=new O.Draw.Polygon(z);break;case"rectangle":U=new O.Draw.Rectangle(z);break}U.enable(),Ce.value=P}function at(){var O;if(s.value)return;const P=(O=p.value)==null?void 0:O.layer;P&&(P.getBounds?z.fitBounds(P.getBounds(),{padding:[30,30]}):P.getLatLng&&z.setView(P.getLatLng(),Math.max(_.value,14)))}function Tt(){s.value||K&&(K.clearLayers(),o("update:modelValue",null),p.value=null,y.value=0)}const fr=d.ref(null);function Fn(){var P;s.value||((P=fr.value)==null||P.click())}function rs(P){var se;if(s.value)return;const O=P.target,J=(se=O.files)==null?void 0:se[0];if(!J)return;const X=new FileReader;X.onload=()=>{try{const _e=JSON.parse(String(X.result));K.clearLayers(),_e&&k.value.geoJSON(_e).eachLayer(De=>K.addLayer(De)),Wt(),ge()}finally{O.value=""}},X.readAsText(J)}function Yc(){if(s.value)return;const P=K.toGeoJSON(),O=new Blob([JSON.stringify(P,null,2)],{type:"application/json"}),J=URL.createObjectURL(O),X=document.createElement("a");X.href=J,X.download="data.geojson",X.click(),URL.revokeObjectURL(J)}function qc(P){!z||!k.value||!V[P]||(G&&z.removeLayer(G),G=k.value.tileLayer(V[P].url,{maxZoom:19,minZoom:6,pane:Np}).addTo(z),F.value=P)}function Zc(P){if(!z||!k.value)return;const O=k.value.latLng(P[0],P[1]);z.setView(O,13)}let Ga=null;return d.onMounted(async()=>{k.value=await ae();const P=k.value;P.drawLocal=Gpe,z=P.map(u.value,{zoomControl:!1,scrollWheelZoom:!1}).setView(b.value,_.value),P.control.zoom({position:"bottomright"}).addTo(z);const O=F.value||Object.keys(V)[0];z.createPane(Np),z.getPane(Np).style.zIndex="180",z.createPane(Lp),z.getPane(Lp).style.zIndex="220",O&&V[O]&&(F.value=O,G=P.tileLayer(V[O].url,{maxZoom:19,minZoom:6,pane:Np}).addTo(z)),K=new P.FeatureGroup().addTo(z),z.on(P.Draw.Event.CREATED,X=>{if(s.value)return;const{layer:se}=X;K.clearLayers(),K.addLayer(se),Wt(),ge(),Ce.value=""}),z.on(P.Draw.Event.EDITED,()=>{s.value||(Wt(),ge())}),z.on(P.Draw.Event.DELETED,()=>{s.value||(Wt(),ge())});let J=!1;z.on("mousemove",X=>{J||(z.invalidateSize(),J=!0)}),z.on("zoomend",()=>{_.value=z.getZoom()}),Ga=be(),Ie(),Z(),w.value!==void 0&&(Gr(w.value),w.value=void 0)}),d.watch(()=>i.center,P=>{!Array.isArray(P)||P.length!==2||(b.value=[...P],z&&z.setView(b.value,z.getZoom()))},{deep:!0}),d.watch(()=>i.zoom,P=>{typeof P=="number"&&(_.value=P,z&&z.setZoom(P))}),d.onUnmounted(()=>{Ga==null||Ga(),le(),q&&(z!=null&&z.hasLayer(q))&&(z.removeLayer(q),q=null),z!=null&&z.remove&&z.remove()}),d.watch(l,()=>{setTimeout(()=>{z!=null&&z.invalidateSize&&z.invalidateSize()},50)}),d.watch(g,async P=>{if(!P||!m.value){v.value=null;return}await d.nextTick();const O=m.value.getBoundingClientRect();v.value={top:O.bottom+6,left:O.left}}),(P,O)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body",disabled:!l.value},[d.createElementVNode("div",{class:d.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:l.value}])},[d.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:"w-full h-full"},null,512),d.createVNode(d.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:d.withCtx(()=>[c.value&&i.handleZoom?(d.openBlock(),d.createElementBlock("div",kge,[d.createElementVNode("div",Ege,[d.createElementVNode("p",Cge,d.toDisplayString(f.value),1)])])):d.createCommentVNode("",!0)]),_:1}),E.value.search||E.value.import||E.value.export?(d.openBlock(),d.createElementBlock("div",Tge,[E.value.search?(d.openBlock(),d.createBlock(mge,{key:0,onGoToCoordinates:Zc})):d.createCommentVNode("",!0),E.value.import||E.value.export?(d.openBlock(),d.createElementBlock("div",Dge,[d.createElementVNode("div",Age,[E.value.import?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Fn,disabled:s.value}," Import ",8,Mge)):d.createCommentVNode("",!0),E.value.export?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Yc,disabled:s.value||y.value===0}," Export ",8,Nge)):d.createCommentVNode("",!0)]),d.createElementVNode("input",{ref_key:"importRef",ref:fr,type:"file",onChange:rs,accept:".json,.geojson",class:"hidden",disabled:s.value},null,40,Lge)])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),I.value.length?(d.openBlock(),d.createElementBlock("div",{key:1,class:"absolute z-[1500] pointer-events-none",style:d.normalizeStyle(L.value)},[d.createElementVNode("div",Ige,[d.createElementVNode("dl",Bge,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(I.value,J=>(d.openBlock(),d.createElementBlock("div",{key:`${J.key}-${J.value}`,class:"flex justify-between gap-2"},[d.createElementVNode("dt",Vge,d.toDisplayString(J.key),1),d.createElementVNode("dd",Rge,d.toDisplayString(J.value),1)]))),128))])])],4)):d.createCommentVNode("",!0),d.createElementVNode("div",Pge,[d.createElementVNode("div",Oge,[E.value.point?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="marker"}]),title:"Point",onClick:O[0]||(O[0]=J=>Ge("marker")),disabled:s.value},[d.createVNode(Ype)],10,zge)):d.createCommentVNode("",!0),E.value.line?(d.openBlock(),d.createElementBlock("button",{key:1,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="polyline"}]),title:"Line",onClick:O[1]||(O[1]=J=>Ge("polyline")),disabled:s.value},[d.createVNode(jpe)],10,Fge)):d.createCommentVNode("",!0),E.value.polygon?(d.openBlock(),d.createElementBlock("button",{key:2,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="polygon"}]),title:"Polygon",onClick:O[2]||(O[2]=J=>Ge("polygon")),disabled:s.value},[d.createVNode(ege)],10,$ge)):d.createCommentVNode("",!0),E.value.rectangle?(d.openBlock(),d.createElementBlock("button",{key:3,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="rectangle"}]),title:"Rectangle",onClick:O[3]||(O[3]=J=>Ge("rectangle")),disabled:s.value},[d.createVNode(age)],10,Gge)):d.createCommentVNode("",!0),d.createElementVNode("button",{class:"vs-btn mt-5",onClick:O[4]||(O[4]=J=>l.value=!l.value),title:"Full Screen"},[d.createVNode(lge,{style:{width:"12px",height:"12px"}})])])]),d.createElementVNode("div",{class:d.normalizeClass(["absolute left-4 z-[1000]",p.value?"bottom-8":"bottom-4"])},[d.createElementVNode("div",Uge,[d.createVNode(wge,{basemaps:d.unref(V),onOnLayerChange:qc},null,8,["basemaps"]),D.value.length?(d.openBlock(),d.createElementBlock("div",Hge,[O[9]||(O[9]=d.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Шари",-1)),d.createElementVNode("div",Wge,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(D.value,J=>(d.openBlock(),d.createElementBlock("label",{key:J.id,class:"flex items-center gap-2 cursor-pointer select-none"},[d.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:J.visible,disabled:s.value,onChange:X=>Qe(J.id)},null,40,Yge),d.createElementVNode("span",qge,d.toDisplayString(J.config.title||J.config.name||J.id),1)]))),128))])])):d.createCommentVNode("",!0)])],2),d.createElementVNode("div",Zge,[p.value?(d.openBlock(),d.createElementBlock("div",Xge,[d.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:O[5]||(O[5]=J=>g.value=!0),onMouseleave:O[6]||(O[6]=J=>g.value=!1)},[d.createElementVNode("div",jge,[O[10]||(O[10]=d.createTextVNode(" Type: ",-1)),d.createElementVNode("span",Kge,d.toDisplayString(p.value.type),1)]),h.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"addressEl",ref:m,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+d.toDisplayString(h.value),513)):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[g.value&&h.value&&v.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:d.normalizeStyle({top:v.value.top+"px",left:v.value.left+"px"})},d.toDisplayString(h.value),5)):d.createCommentVNode("",!0)]))],32),d.createElementVNode("div",Qge,[d.createElementVNode("div",Jge,[O[11]||(O[11]=d.createTextVNode(" Center: ",-1)),d.createElementVNode("b",null,d.toDisplayString(p.value.center.lat.toFixed(5))+", "+d.toDisplayString(p.value.center.lng.toFixed(5)),1)]),p.value.areaKm2!==null?(d.openBlock(),d.createElementBlock("div",eve,[O[12]||(O[12]=d.createTextVNode(" Area: ",-1)),d.createElementVNode("b",null,d.toDisplayString(p.value.areaKm2.toFixed(1))+" km²",1)])):(d.openBlock(),d.createElementBlock("div",tve,O[13]||(O[13]=[d.createTextVNode("Area: ",-1),d.createElementVNode("b",null,"—",-1)]))),d.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:O[7]||(O[7]=J=>at()),disabled:s.value},O[14]||(O[14]=[d.createElementVNode("svg",{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:"w-3 h-3"},[d.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),d.createElementVNode("path",{d:"M7 10l6 0"}),d.createElementVNode("path",{d:"M10 7l0 6"}),d.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)]),8,rve),d.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:O[8]||(O[8]=J=>Tt()),disabled:s.value},[d.createVNode(Sl,{class:"w-3 h-3"})],8,nve)])])):d.createCommentVNode("",!0)])],2)],8,["disabled"]))}}),qR=Ye(ave,[["__scopeId","data-v-85843f06"]]),ive=["data-focus"],ove={class:"flex items-center"},sve={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},lve=["onClick","aria-label"],uve={key:0,class:"absolute text-gray-500 truncate pl-2"},cve={class:"flex-1 min-w-[2px]"},dve=["placeholder"],fve={class:"flex items-center shrink-0"},hve=["disabled"],ZR=d.defineComponent({__name:"vs-input-tag",props:d.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:d.mergeModels(["update:modelValue"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=e;br(t.style);const a=d.ref(null),i=d.ref(null),o=d.ref(null),s=d.ref(!1),l=d.ref(""),u=d.useModel(r,"modelValue"),c=d.computed(()=>t.placeholder||"Add tag…"),f=d.computed(()=>{var S;return((S=u.value)==null?void 0:S.length)===0&&l.value===""}),h=d.computed(()=>{var S;return!t.disabled&&((S=u.value)==null?void 0:S.length)>0}),p=d.computed(()=>t.disabled),g=async()=>{p.value||await d.nextTick(()=>{var S;return(S=o.value)==null?void 0:S.focus()})},v=S=>{const k=S.trim();k!==""&&(!u.value||!Array.isArray(u.value)?u.value=[k]:t.unique?u.value.includes(k)||(u.value=[...u.value,k]):u.value=[...u.value,k],l.value="")},m=()=>{const S=l.value;S.trim()!==""&&v(S),l.value=""},y=S=>{const k=u.value.slice();k.splice(S,1),n("update:modelValue",k)},b=()=>{n("update:modelValue",[])},_=()=>{p.value||(s.value=!0)},x=()=>{s.value=!1,!p.value&&m()},w=S=>{const{key:k}=S;k==="Enter"?(S.preventDefault(),m()):k==="Backspace"&&l.value===""&&u.value.length>0&&y(u.value.length-1)};return(S,k)=>(d.openBlock(),d.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:a,onClick:k[1]||(k[1]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["relative w-full font-sans",t.customClass]),role:"group","aria-label":"Tag input"},[d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",s.value?"border-blue-500 ring-1 ring-blue-500":"",p.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":s.value?"true":"false",onClick:g},[d.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:i},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(E,C)=>(d.openBlock(),d.createElementBlock("div",{key:C,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[d.createElementVNode("div",ove,[d.createElementVNode("div",sve,d.toDisplayString(E),1)]),d.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:d.withModifiers(T=>y(C),["stop"]),"aria-label":`Remove ${E}`},k[2]||(k[2]=[d.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,lve)]))),128)),f.value?(d.openBlock(),d.createElementBlock("div",uve,d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),d.createElementVNode("div",cve,[p.value?d.createCommentVNode("",!0):d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:o,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":k[0]||(k[0]=E=>l.value=E),onFocus:_,onBlur:x,onKeydown:w,placeholder:u.value&&u.value.length?"":void 0},null,40,dve)),[[d.vModelText,l.value]])])],512),d.createElementVNode("div",fve,[h.value?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:p.value,onClick:d.withModifiers(b,["stop"])},k[3]||(k[3]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,hve)):d.createCommentVNode("",!0)])],10,ive)],2)],512))}}),pve={class:"relative flex gap-1 bg-white w-full"},gve=["disabled","placeholder"],vve=d.defineComponent({__name:"vs-input-slug",props:d.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=d.inject("values"),t=r,n=d.useModel(r,"modelValue");function a(o){const s={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return o.toLowerCase().split("").map(l=>s[l]||l).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const i=()=>{var l,u;const o=(u=(l=e==null?void 0:e.value)==null?void 0:l[t.parent||""])==null?void 0:u.toString(),s=a(o);n.value=s.toString()};return(o,s)=>(d.openBlock(),d.createElementBlock("div",pve,[d.withDirectives(d.createElementVNode("input",{ref:"vsText",disabled:o.disabled,placeholder:o.placeholder,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,gve),[[d.vModelText,n.value]]),d.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:i}," Gen ")]))}}),XR=Ye(vve,[["__scopeId","data-v-b0eba370"]]),mve={class:"relative flex gap-1 bg-white w-full"},yve=["disabled","placeholder"],bve=["disabled"],_ve={key:0},xve={key:1},wve=d.defineComponent({__name:"vs-input-codegen",props:d.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(!1),a=d.computed(()=>e.init!==!1),i=d.computed(()=>!!e.table&&!!e.code),o=()=>{if(!i.value)return"";const u=encodeURIComponent(String(e.table)),c=encodeURIComponent(String(e.code));return`/api/code-gen/${u}/${c}`},s=async()=>{if(!i.value||n.value)return;const u=o();if(u){n.value=!0;try{const c=await(await fetch(u)).text();t.value=c}finally{n.value=!1}}},l=()=>{a.value&&(t.value||s())};return d.onMounted(()=>{l()}),d.watch(()=>[e.table,e.code,e.init],()=>{l()}),(u,c)=>(d.openBlock(),d.createElementBlock("div",mve,[d.withDirectives(d.createElementVNode("input",{disabled:u.disabled,placeholder:u.placeholder,"onUpdate:modelValue":c[0]||(c[0]=f=>t.value=f),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,yve),[[d.vModelText,t.value]]),d.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:n.value||u.disabled||!i.value,onClick:s},[n.value?(d.openBlock(),d.createElementBlock("span",xve,"...")):(d.openBlock(),d.createElementBlock("span",_ve,"Gen"))],8,bve)]))}}),jR=Ye(wve,[["__scopeId","data-v-6ee5237d"]]),Sve={class:"w-full"},kve={ref:"sortableContainer",class:"flex flex-col gap-1"},Eve=["onDragstart","onDrop"],Cve={class:"w-1/3"},Tve={class:"w-2/3"},Dve=["onClick"],Ave={key:0,class:"text-[14px] text-gray-700"},Mve={class:"mt-2 w-full flex items-center"},Nve=["disabled"],Lve=d.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=v=>`${v}-${Math.random().toString(36).substring(2,15)}`,n=d.inject("values"),a=r,i=e,o=a.addButtonText??"Додати",s=a.ignore??[],l=d.ref([]),u=d.ref(null);(()=>{var m;const v=a.parent&&((m=n==null?void 0:n.value)==null?void 0:m[a.parent])||a.modelValue||{};l.value=Object.entries(v).filter(([y])=>!s.includes(y)).map(([y,b])=>({id:t("key-value-"),key:y,value:b}))})();function c(v){u.value=v}function f(v){if(u.value===null||u.value===v)return;const m=l.value.splice(u.value,1)[0];l.value.splice(v,0,m),u.value=null}const h=d.computed(()=>l.value.some(v=>v.key&&!v.value||!v.key&&v.value)),p=()=>{l.value.push({id:t("key-value-"),key:"",value:""})},g=v=>{l.value=l.value.filter(m=>m.id!==v)};return d.watch(l,v=>{const m={};v.forEach(b=>{b.key&&b.value!==void 0&&(m[b.key]=b.value)});const y={};s.length&&s.forEach(b=>{var _,x;y[b]=a.parent?(x=(_=n==null?void 0:n.value)==null?void 0:_[a.parent])==null?void 0:x[b]:void 0}),n!=null&&n.value&&a.parent&&(n.value[a.parent]={...y,...m}),i("update:modelValue",m)},{deep:!0}),(v,m)=>(d.openBlock(),d.createElementBlock("div",Sve,[d.createElementVNode("div",kve,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(l.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:y.id,class:d.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":u.value===b}]),draggable:"true",onDragstart:_=>c(b),onDragover:m[0]||(m[0]=d.withModifiers(()=>{},["prevent"])),onDrop:_=>f(b)},[m[1]||(m[1]=d.createStaticVNode('<button class="cursor-move" data-v-81b9444f><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-81b9444f><circle cx="15" cy="12" r="1.5" data-v-81b9444f></circle><circle cx="15" cy="24" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="12" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="24" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="18" r="1.5" data-v-81b9444f></circle><circle cx="15" cy="18" r="1.5" data-v-81b9444f></circle></svg></button>',1)),d.createElementVNode("div",Cve,[d.createVNode(wl,{modelValue:y.key,"onUpdate:modelValue":_=>y.key=_,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),d.createElementVNode("div",Tve,[d.createVNode(wl,{modelValue:y.value,"onUpdate:modelValue":_=>y.value=_,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),d.createElementVNode("button",{onClick:_=>g(y.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[d.createVNode(d.unref(Dp),{height:"16",width:"16"})],8,Dve)],42,Eve))),128))],512),l.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",Ave," Дані для відображення відсутні ")),d.createElementVNode("div",Mve,[d.createElementVNode("button",{type:"button",onClick:p,disabled:h.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[d.createVNode(da,{height:"14",width:"14"}),d.createTextVNode(" "+d.toDisplayString(d.unref(o)),1)],8,Nve)])]))}}),KR=Ye(Lve,[["__scopeId","data-v-81b9444f"]]),Ive={class:"w-full"},Bve={ref:"sortableContainer",class:"flex flex-col gap-1"},Vve=["onDragstart","onDrop"],Rve=["disabled"],Pve={class:"flex-1"},Ove=["onClick","disabled"],zve={key:0,class:"text-[14px] text-gray-700"},Fve={class:"mt-2 w-full flex items-center"},$ve=["disabled"],Gve=d.defineComponent({__name:"vs-input-text-array",props:d.mergeModels({addButtonText:{default:"Додати"},inputType:{default:"text"},placeholder:{default:"Значення"},mask:{default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref([]),a=d.ref(null),i=d.computed(()=>!!e.disabled),o=d.computed(()=>e.placeholder??""),s=d.computed(()=>e.addButtonText??"Додати");let l=!1;const u=m=>`${m}-${Math.random().toString(36).substring(2,15)}`,c=m=>{const y=m??t.value??[];n.value=y.map((b,_)=>{var x;return{id:((x=n.value[_])==null?void 0:x.id)??u("text-array"),value:b??""}})};c(),d.watch(()=>t.value,m=>{if(l){l=!1;return}c(m||[])},{deep:!0}),d.watch(n,m=>{l=!0,t.value=m.map(y=>y.value).filter(y=>y!=null&&y!=="")},{deep:!0});const f=d.computed(()=>i.value||n.value.some(m=>!m.value));function h(){f.value||(n.value=[...n.value,{id:u("text-array"),value:""}])}function p(m){i.value||(n.value=n.value.filter(y=>y.id!==m))}function g(m){i.value||(a.value=m)}function v(m){if(i.value||a.value===null||a.value===m)return;const y=[...n.value],[b]=y.splice(a.value,1);y.splice(m,0,b),n.value=y,a.value=null}return(m,y)=>(d.openBlock(),d.createElementBlock("div",Ive,[d.createElementVNode("div",Bve,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(b,_)=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:d.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":a.value===_}]),draggable:"true",onDragstart:x=>g(_),onDragover:y[0]||(y[0]=d.withModifiers(()=>{},["prevent"])),onDrop:x=>v(_)},[d.createElementVNode("button",{class:"cursor-move",type:"button",disabled:i.value},y[1]||(y[1]=[d.createStaticVNode('<svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-66316a33><circle cx="15" cy="12" r="1.5" data-v-66316a33></circle><circle cx="15" cy="24" r="1.5" data-v-66316a33></circle><circle cx="21" cy="12" r="1.5" data-v-66316a33></circle><circle cx="21" cy="24" r="1.5" data-v-66316a33></circle><circle cx="21" cy="18" r="1.5" data-v-66316a33></circle><circle cx="15" cy="18" r="1.5" data-v-66316a33></circle></svg>',1)]),8,Rve),d.createElementVNode("div",Pve,[m.inputType==="text"?(d.openBlock(),d.createBlock(wl,{key:0,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="tel"?(d.openBlock(),d.createBlock(W1,{key:1,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="email"?(d.openBlock(),d.createBlock(H1,{key:2,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="mask"?(d.openBlock(),d.createBlock(U1,{key:3,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,mask:m.mask,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","mask","disabled","placeholder"])):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",onClick:x=>p(b.id),disabled:i.value,class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"},[d.createVNode(d.unref(Dp),{height:"16",width:"16"})],8,Ove)],42,Vve))),128))],512),n.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",zve," Дані для відображення відсутні ")),d.createElementVNode("div",Fve,[d.createElementVNode("button",{type:"button",onClick:h,disabled:f.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[d.createVNode(da,{height:"14",width:"14"}),d.createTextVNode(" "+d.toDisplayString(s.value),1)],8,$ve)])]))}}),QR=Ye(Gve,[["__scopeId","data-v-66316a33"]]),Uve={class:"flex items-center gap-2 w-full"},Hve=["disabled"],Wve=["disabled"],JR=d.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{inputClass:n}=br(t.style),a=e,i=d.computed({get:()=>t.modelValue||"#000000",set:s=>a("update:modelValue",s)}),o=d.computed(()=>!!t.disabled);return(s,l)=>(d.openBlock(),d.createElementBlock("div",Uve,[d.withDirectives(d.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),disabled:o.value,ref:"color",class:d.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[s.modelValue?"":"text-opacity-50",d.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Hve),[[d.vModelText,i.value]]),d.withDirectives(d.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":l[1]||(l[1]=u=>i.value=u),disabled:o.value},null,8,Wve),[[d.vModelText,i.value]])]))}}),Yve={class:"flex items-center gap-2 w-full"},qve=["min","max","step","disabled"],Zve=["disabled"],eP=d.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{inputClass:n}=br(t.style),a=e,i=d.computed({get:()=>Number(t.modelValue??t.min),set:s=>a("update:modelValue",Number(s))}),o=d.computed(()=>!!t.disabled);return(s,l)=>(d.openBlock(),d.createElementBlock("div",Yve,[d.withDirectives(d.createElementVNode("input",{type:"range","onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),min:s.min,max:s.max,step:s.step,disabled:o.value,ref:"range",class:d.normalizeClass(["w-full cursor-pointer accent-blue-500",[s.modelValue?"":"text-opacity-50",d.unref(n)].join(" ")])},null,10,qve),[[d.vModelText,i.value]]),d.withDirectives(d.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":l[1]||(l[1]=u=>i.value=u),disabled:o.value},null,8,Zve),[[d.vModelText,i.value]])]))}}),Xve=["placeholder","disabled","name"],jve=["type","value","onInput","placeholder","disabled"],Kve=["onClick"],tP=d.defineComponent({__name:"vs-input-array",props:d.mergeModels({count:{default:1},limit:{default:1},mask:{default:""},unmask:{type:Boolean,default:!1},inputType:{default:"text"},isAdded:{type:Boolean,default:!1},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.ref(e.count),n=d.computed(()=>e.limit),{inputClass:a}=br(e.style),i=d.useModel(r,"modelValue"),o=d.computed(()=>!!e.disabled),s=d.computed(()=>e.placeholder??"");d.watchEffect(()=>{var m;const v=((m=i.value)==null?void 0:m.length)??0;v<t.value&&(i.value=[...i.value??[],...Array(t.value-v)])});const l=d.ref({}),u=d.ref({});function c(v,m){v&&(l.value[m]=v)}async function f(v,m){var b;if(!v||e.inputType!=="mask")return;const{default:y}=await Promise.resolve().then(()=>sx);u.value[m]&&u.value[m].destroy(),u.value[m]=y(v,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),u.value[m].on("accept",()=>{const _=[...i.value||[]];_[m]=e.unmask?u.value[m].unmaskedValue:u.value[m].value,i.value=_}),u.value[m].on("complete",()=>{const _=[...i.value||[]];_[m]=e.unmask?u.value[m].unmaskedValue:u.value[m].value,i.value=_}),(b=i.value)!=null&&b[m]&&(u.value[m].value=i.value[m])}function h(v,m){if(o.value)return;const y=v.target.value??null,b=[...i.value];b[m]=e.inputType==="text"?y:Number(y),i.value=b}function p(){t.value+=1;const v=e.inputType==="text"||e.inputType==="mask"?null:0;i.value=[...i.value,v],e.inputType==="mask"&&setTimeout(()=>{const m=t.value-1;l.value[m]&&f(l.value[m],m)},0)}function g(v){if(t.value>1){u.value[v]&&(u.value[v].destroy(),delete u.value[v]),t.value-=1,i.value=i.value.filter((y,b)=>b!==v);const m={};Object.keys(u.value).forEach(y=>{const b=parseInt(y,10);b>v?m[b-1]=u.value[b]:b<v&&(m[b]=u.value[b])}),u.value=m}}return d.onMounted(()=>{if(e.inputType==="mask")for(let v=0;v<t.value;v+=1)l.value[v]&&f(l.value[v],v)}),d.onBeforeUnmount(()=>{Object.values(u.value).forEach(v=>{v&&v.destroy()})}),d.watch(()=>e.mask,v=>{e.inputType==="mask"&&Object.values(u.value).forEach(m=>{m&&m.updateOptions({mask:v,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})})}),d.watch(i,v=>{e.inputType==="mask"&&v&&v.forEach((m,y)=>{u.value[y]&&u.value[y].value!==m&&(u.value[y].value=m||"")})},{deep:!0}),(v,m)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["grid gap-2",`grid-cols-${n.value}`])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.value,y=>{var b;return d.openBlock(),d.createElementBlock("div",{key:y,class:"flex items-center gap-2 w-full"},[v.inputType==="mask"?(d.openBlock(),d.createElementBlock("input",{key:0,type:"text",ref_for:!0,ref:_=>c(_,y-1),placeholder:v.placeholder,disabled:v.disabled,name:`${v.name}[${y-1}]`,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(a),{"!border-red-600":v.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Xve)):(d.openBlock(),d.createElementBlock("input",{key:1,type:v.inputType,value:(b=i.value)==null?void 0:b[y-1],onInput:_=>h(_,y-1),placeholder:s.value,disabled:o.value,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(a),{"!border-red-600":v.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,jve)),!v.disabled&&y===t.value&&v.isAdded?(d.openBlock(),d.createElementBlock("button",{key:2,type:"button",onClick:d.withModifiers(p,["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-green-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[d.createVNode(da,{height:"18",width:"18"})])):d.createCommentVNode("",!0),!v.disabled&&t.value>1&&v.isAdded?(d.openBlock(),d.createElementBlock("button",{key:3,type:"button",onClick:d.withModifiers(_=>g(y-1),["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[d.createVNode(Dp,{height:"18",width:"18"})],8,Kve)):d.createCommentVNode("",!0)])}),128))],2))}}),Qve=["aria-expanded","data-focus"],Jve=["placeholder","disabled","readonly"],eme={class:"max-h-full"},tme=["onClick","disabled"],rme={key:0,class:"px-3 py-2 text-sm text-stone-500"},nme={class:"flex flex-col gap-1"},ame=["onDragstart","onDrop"],ime=["disabled"],ome=["title"],sme=["disabled","onClick","aria-label"],lme={key:0,class:"text-xs text-stone-500"},ume=d.defineComponent({__name:"vs-input-array-select",props:d.mergeModels({options:{default:()=>[]},data:{default:""},api:{default:""},prefix:{default:"api"},host:{default:""},parent:{},search:{type:Boolean,default:!0},maxHeight:{default:280},start:{default:0},slot:{},disabled:{type:Boolean,default:!1},style:{},customClass:{},modelValue:{},error:{},name:{},placeholder:{default:"Оберіть значення"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:d.mergeModels(["change","update:modelValue","value-selected"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=e,a=d.useModel(r,"modelValue"),i=d.ref([]),o=d.ref(t.options??[]),s=d.ref({}),l=d.ref({}),u=d.ref({keyword:"",parent:null}),c=d.ref(""),f=d.ref(!1),h=d.ref(null),p=d.ref(null),g=d.ref(null);let v=!1,m=!1;const y=d.inject("values"),b=d.computed(()=>!!t.disabled),_=d.computed(()=>t.placeholder??"Оберіть значення"),x=d.computed(()=>t.search!==!1),w=d.computed(()=>`${t.maxHeight??280}px`),S=d.computed(()=>{const $=t.parent??t.parentValue;return $?String($):""}),k=d.computed(()=>{var $;return S.value?(($=y==null?void 0:y.value)==null?void 0:$[S.value])??null:null}),E=$=>$==null?"__null__":String($),C=$=>{if(!$)return"";const ne=$.label??$.text??$.name??$.ua??$.en;return ne?String(ne):$.id!==void 0&&$.id!==null?String($.id):""},T=$=>{const ne=E($);return l.value[ne]||(l.value[ne]=`array-select-${ne}-${Math.random().toString(36).slice(2,8)}`),l.value[ne]},D=d.computed(()=>new Set(i.value.map($=>E($.id)))),A=d.computed(()=>{const $=D.value;let ne=[...o.value];if(!t.data&&c.value.trim()){const Z=c.value.toLowerCase();ne=ne.filter(Ie=>C(Ie).toLowerCase().includes(Z))}return ne.filter(Z=>!$.has(E(Z.id)))}),I=()=>{if(!t.data)return"";const $=t.prefix??"api",ne=t.api??`/${$}/suggest/${t.data}`;return`${t.host??""}${ne}`},L=()=>{i.value.length&&(v=!0,i.value=i.value.map($=>({...$,text:s.value[E($.id)]??$.text})))},B=$=>{const ne=E($.id),Z=C($);Z&&(s.value[ne]=Z)},N=$=>{o.value=$?[...$]:[],$==null||$.forEach(B),L()},V=$=>{if(!$.length)return;const ne=new Map(o.value.map(Z=>[E(Z.id),Z]));$.forEach(Z=>{const Ie=E(Z.id);ne.set(Ie,Z),B(Z)}),o.value=Array.from(ne.values()),L()},R=async($="")=>{var Ie;if(!t.data)return[];const ne=I();if(!ne)return[];const Z=new URLSearchParams;Z.set("json","1"),$&&Z.set("key",$),t.start===1&&Z.set("start","1"),k.value!==null&&k.value!==void 0&&k.value!==""&&Z.set("parent",String(k.value));try{return((Ie=await(await fetch(`${ne}?${Z.toString()}`)).json())==null?void 0:Ie.data)??[]}catch{return[]}},F=async $=>{var Qe;if(!t.data||!$.length)return[];const ne=I();if(!ne)return[];const Z=Array.from(new Set($.map(Fe=>E(Fe)))),Ie=new URLSearchParams;Ie.set("json","1"),Ie.set("val",Z.join(",")),t.start===1&&Ie.set("start","1"),k.value!==null&&k.value!==void 0&&k.value!==""&&Ie.set("parent",String(k.value));try{const Fe=((Qe=await(await fetch(`${ne}?${Ie.toString()}`)).json())==null?void 0:Qe.data)??[];return V(Fe),Fe}catch{return[]}},G=async($="",{force:ne=!1}={})=>{if(!t.data)return;const Z=k.value??null;if(!ne&&u.value.keyword===$&&u.value.parent===Z&&o.value.length>0)return;u.value={keyword:$,parent:Z};const Ie=await R($);N(Ie)},z=(($,ne=200)=>{let Z;return(...Ie)=>{Z&&clearTimeout(Z),Z=setTimeout(()=>$(...Ie),ne)}})(async $=>{t.data&&await G($,{force:!0})},250),K=d.ref(null),U=async($="click")=>{var ne;b.value||f.value||(K.value=$,await G(c.value.trim()),f.value=!0,await d.nextTick(),(ne=g.value)==null||ne.focus())},q=()=>{f.value=!1,K.value=null,d.nextTick(()=>{var $;($=g.value)==null||$.blur()})},ae=async $=>{if($.stopPropagation(),!b.value){if(f.value){if(K.value==="focus"){K.value=null;return}q();return}await U("click")}},me=$=>{$.key==="Escape"&&q()},be=$=>{var Z;const ne=$.target;(Z=p.value)!=null&&Z.contains(ne)||q()},fe=$=>{if($.key==="Escape"){$.preventDefault(),q();return}if($.key==="Enter"){$.preventDefault();const ne=A.value[0];ne&&ce(ne)}},ce=$=>{if(!$)return;const ne=E($.id);if(D.value.has(ne))return;B($);const Z={id:$.id,text:C($)||String($.id??""),key:T($.id)};i.value=[...i.value,Z],W($),c.value="",d.nextTick(()=>{var Ie;(Ie=g.value)==null||Ie.focus()})},W=$=>{const ne=i.value.map(Z=>Z.id);n("value-selected",{name:t.name,value:ne,option:$})},H=$=>{if(b.value)return;const ne=i.value.filter(Z=>E(Z.id)!==E($));i.value=ne},j=$=>{b.value||(h.value=$)},oe=$=>{if(b.value||h.value===null||h.value===$)return;const ne=[...i.value],[Z]=ne.splice(h.value,1);ne.splice($,0,Z),h.value=null,i.value=ne},le=async()=>{const $=(Array.isArray(a.value)?[...a.value]:[]).filter(Z=>Z!=null);if(t.data&&$.length){const Z=$.filter(Ie=>!s.value[E(Ie)]);Z.length&&await F(Z)}const ne=$.map(Z=>({id:Z,text:s.value[E(Z)]??String(Z),key:T(Z)}));v=!0,i.value=ne};d.watch(i,$=>{if(v){v=!1;return}const ne=$.map(Z=>Z.id);m=!0,a.value=ne,n("change",ne)},{deep:!0}),d.watch(a,()=>{if(m){m=!1;return}le()},{deep:!0}),d.watch(c,$=>{!t.data||!f.value||z($.trim())}),d.watch(b,$=>{$&&q()}),d.watch(()=>t.options,async $=>{t.data||(N($??[]),await le())},{immediate:!0,deep:!0}),d.watch(()=>t.data,async $=>{$&&(await G(c.value.trim()),await le())},{immediate:!0});const we=d.ref(!1);return d.watch(k,async()=>{if(t.data){if(!we.value){we.value=!0;return}i.value=[],await G(c.value.trim()),await le()}}),d.onMounted(async()=>{document.addEventListener("click",be,!0),window.addEventListener("keydown",me),await le()}),d.onUnmounted(()=>{document.removeEventListener("click",be,!0),window.removeEventListener("keydown",me)}),($,ne)=>(d.openBlock(),d.createElementBlock("div",{class:"flex flex-col gap-2 w-full",ref_key:"rootRef",ref:p},[d.createElementVNode("div",{class:"relative",onClick:ne[2]||(ne[2]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white px-3","border-gray-300 hover:border-[#b3d4ff]",f.value?"border-[#2684ff] ring-1 ring-[#2684ff] shadow-[0_0_0_1px_rgba(38,132,255,0.5)]":"",b.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":f.value,"aria-haspopup":"listbox","data-focus":f.value?"true":"false",onClick:ae},[d.withDirectives(d.createElementVNode("input",{ref_key:"inputRef",ref:g,"onUpdate:modelValue":ne[0]||(ne[0]=Z=>c.value=Z),placeholder:_.value,disabled:b.value,readonly:!x.value,onFocus:ne[1]||(ne[1]=()=>U("focus")),onKeydown:fe,class:"flex-1 bg-transparent border-0 outline-none px-0 py-1 text-sm text-stone-900 placeholder:text-stone-400"},null,40,Jve),[[d.vModelText,c.value]]),d.createElementVNode("span",{class:d.normalizeClass(["text-stone-400 transition-transform duration-150",f.value?"rotate-180":""]),"aria-hidden":"true"},[d.createVNode(F1,{width:"16",height:"16"})],2)],10,Qve),d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[f.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"absolute left-0 right-0 z-10 mt-1 rounded-md border border-stone-200 bg-white shadow-lg overflow-auto",style:d.normalizeStyle({maxHeight:w.value})},[d.createElementVNode("div",eme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,Z=>(d.openBlock(),d.createElementBlock("button",{key:E(Z.id),type:"button",class:"w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",onClick:d.withModifiers(Ie=>ce(Z),["stop"]),disabled:b.value},d.toDisplayString(C(Z)),9,tme))),128)),A.value.length===0?(d.openBlock(),d.createElementBlock("p",rme," Немає варіантів ")):d.createCommentVNode("",!0)])],4)):d.createCommentVNode("",!0)]),_:1})]),d.createElementVNode("div",nme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(Z,Ie)=>(d.openBlock(),d.createElementBlock("div",{key:Z.key,class:d.normalizeClass(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2",{"opacity-60":h.value===Ie}]),draggable:"true",onDragstart:Qe=>j(Ie),onDragover:ne[3]||(ne[3]=d.withModifiers(()=>{},["prevent"])),onDrop:Qe=>oe(Ie),onDragend:ne[4]||(ne[4]=Qe=>h.value=null)},[d.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-500 hover:text-stone-900",disabled:b.value,"aria-label":"Перетягнути"},[d.createVNode(Mp,{width:"14",height:"14"})],8,ime),d.createElementVNode("div",{class:"flex-1 text-sm text-stone-900",title:Z.text},d.toDisplayString(Z.text),9,ome),d.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-400 hover:text-stone-900",disabled:b.value,onClick:d.withModifiers(Qe=>H(Z.id),["stop"]),"aria-label":`Видалити ${Z.text}`},[d.createVNode(Dp,{width:"14",height:"14"})],8,sme)],42,ame))),128)),i.value.length===0?(d.openBlock(),d.createElementBlock("p",lme,"Немає вибраних значень")):d.createCommentVNode("",!0)])],512))}}),Bp=Ye(ume,[["__scopeId","data-v-8dc8c204"]]),cme={class:"flex items-center gap-2 w-full"},dme={class:"relative flex-1"},fme=["placeholder","disabled","onKeydown"],hme=["disabled"],pme={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},gme={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},vme={key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/50"},mme={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},yme={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},bme=["onClick"],_me={key:0,class:"p-4 text-sm text-gray-500"},rP=d.defineComponent({__name:"vs-input-address",props:d.mergeModels({api:{default:""},geom:{default:""},includes:{default:()=>[]},bbox:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(r,{emit:e}){const t=/{{\s*([^}]+?)\s*}}/g,n=r,a=e,{inputClass:i}=br(n.style),o=d.useModel(r,"modelValue"),s=d.computed({get:()=>o.value,set:k=>{o.value=k}}),l=d.ref(!1),u=d.ref([]),c=d.ref(!1),f=d.ref(null);d.watch(c,k=>{typeof document>"u"||(k?(f.value=document.body.style.overflow,document.body.style.overflow="hidden"):f.value!=null?(document.body.style.overflow=f.value,f.value=null):document.body.style.removeProperty("overflow"))}),d.onBeforeUnmount(()=>{typeof document>"u"||(f.value!=null?document.body.style.overflow=f.value:document.body.style.removeProperty("overflow"))});const h=d.computed(()=>n.placeholder??""),p=d.computed(()=>!!n.disabled),g=k=>{if(!k)return null;if(Array.isArray(k))return k;if(typeof k=="string"){const E=k.split(",").map(C=>C.trim()).filter(Boolean);return E.length!==4?null:E.map(Number)}return null},v=d.computed(()=>{const k=g(n.bbox);if(!k||k.length!==4)return null;const E=k.map(Number);return E.some(C=>Number.isNaN(C))?null:E}),m=d.computed(()=>{const k=v.value;if(!k)return"";const[E,C,T,D]=k;return`${E},${Math.max(C,D)},${T},${Math.min(C,D)}`});d.computed(()=>m.value?"1":"0");const y=d.inject("values");function b(){!p.value&&s.value.trim()&&_()}async function _(){var T;const k=(s.value||"").trim();if(!k)return;let E=k;if((T=n.includes)!=null&&T.length&&(y!=null&&y.value)){const D=n.includes.map(A=>{var I;return(I=y.value)==null?void 0:I[A]}).filter(Boolean);D.length&&(E=`${D.join(", ")}, ${k}`)}const C=S(E);if(C){l.value=!0;try{const D=await(await fetch(C)).json();u.value=Array.isArray(D)?D:[],c.value=!0}catch(D){console.error("Address search error:",D)}finally{l.value=!1}}}function x(){c.value=!c.value}function w(k){if(!k)return;c.value=!1;const E=parseFloat(k.lat),C={type:"Point",coordinates:[parseFloat(k.lon),E]};n.geom&&(y!=null&&y.value)&&(y.value[n.geom]=C),a("update:geom",C)}function S(k){if(!n.api)return"";const E={value:encodeURIComponent(k),bbox:v.value?v.value.join(","):""};return n.api.replace(t,(C,T)=>E[T.trim()]??"")}return(k,E)=>{var C;return d.openBlock(),d.createElementBlock("div",cme,[d.createElementVNode("div",dme,[d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":E[0]||(E[0]=T=>s.value=T),placeholder:h.value,disabled:p.value,class:d.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[d.unref(i),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:d.withKeys(d.withModifiers(b,["prevent"]),["enter"])},null,42,fme),[[d.vModelText,s.value]]),u.value.length?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:x,title:"Show search results"},E[2]||(E[2]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),d.createElementVNode("path",{d:"M12 16v-4"}),d.createElementVNode("path",{d:"M12 8h.01"})],-1)]))):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",onClick:_,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:l.value||!((C=s.value)!=null&&C.trim())},[l.value?(d.openBlock(),d.createElementBlock("svg",gme,E[4]||(E[4]=[d.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),d.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(d.openBlock(),d.createElementBlock("svg",pme,E[3]||(E[3]=[d.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),d.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,hme),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[c.value?(d.openBlock(),d.createElementBlock("div",vme,[d.createElementVNode("div",mme,[d.createElementVNode("div",yme,[E[6]||(E[6]=d.createElementVNode("span",null,"Search results",-1)),d.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:E[1]||(E[1]=T=>c.value=!1),title:"Close"},E[5]||(E[5]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),d.createElementVNode("ul",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(T,D)=>(d.openBlock(),d.createElementBlock("li",{key:D,onClick:A=>w(T),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},d.toDisplayString(T.display_name),9,bme))),128))]),u.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",_me," No results found "))])])):d.createCommentVNode("",!0)]))])}}}),nP=(r="")=>`${r}${Math.floor(Math.random()*1e4)}`,xme={class:"vs-datalist space-y-3"},wme={class:"space-y-3"},Sme=["onClick","disabled"],kme={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},Eme=["disabled"],Cme=d.defineComponent({__name:"vs-input-datalist",props:d.mergeModels({schema:{default:()=>[]},minItems:{default:0},maxItems:{default:void 0},addButtonText:{default:"Додати позицію"},emptyLabel:{default:"Немає рядків"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>Array.isArray(t.value)?t.value:[]),a=d.ref([]),i=d.computed(()=>{var v;return((v=e.schema)==null?void 0:v.map(m=>({...m,disabled:e.disabled||m.disabled})))??[]}),o=d.computed(()=>i.value.map(v=>g(v))),s=d.computed(()=>e.disabled?!1:e.maxItems?n.value.length<e.maxItems:!0),l=d.computed(()=>e.disabled||n.value.length<=(e.minItems||0));d.watch(()=>n.value.length,()=>{u(),c()},{immediate:!0}),d.watch(()=>e.schema,c,{immediate:!0,deep:!0});function u(){const v=n.value.length;a.value.length<v?a.value=[...a.value,...Array.from({length:v-a.value.length},()=>nP())]:a.value.length>v&&a.value.splice(v)}function c(){if(!e.minItems||n.value.length>=e.minItems)return;const v=e.minItems-n.value.length,m=Array.from({length:v},f);t.value=[...n.value,...m]}function f(){const v={};return i.value.forEach(m=>{v[m.name]=(m==null?void 0:m.default)??null}),v}function h(){s.value&&(t.value=[...n.value,f()],u())}function p(v){l.value||(t.value=n.value.filter((m,y)=>y!==v),u(),c())}function g(v){return{...v}}return(v,m)=>(d.openBlock(),d.createElementBlock("div",xme,[d.createElementVNode("div",wme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:a.value[b],class:"flex items-center gap-3"},[d.createVNode(Fa,{schema:o.value,layout:"inline",navigation:!1,values:n.value[b],"onUpdate:values":_=>n.value[b]=_,"form-id":a.value[b]},null,8,["schema","values","onUpdate:values","form-id"]),d.createElementVNode("button",{type:"button",class:"h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",onClick:_=>p(b),disabled:l.value},[d.createVNode(Sl,{class:"w-5 h-5"})],8,Sme)]))),128)),n.value.length===0?(d.openBlock(),d.createElementBlock("div",kme,d.toDisplayString(e.emptyLabel),1)):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:h,disabled:!s.value},[d.createVNode(da,{class:"w-5 h-5"}),d.createTextVNode(" "+d.toDisplayString(e.addButtonText),1)],8,Eme)]))}}),Tme=Ye(Cme,[["__scopeId","data-v-8bcb5436"]]),Dme={};function Ame(r,e){return d.openBlock(),d.createElementBlock("svg",d.mergeProps({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"},r.$attrs),e[0]||(e[0]=[d.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},null,-1),d.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},null,-1)]),16)}const Mme=Ye(Dme,[["render",Ame]]),Nme={class:"vs-dataform space-y-4"},Lme=["draggable","onDragstart","onDragover","onDragenter","onDrop"],Ime={class:"flex items-center gap-2"},Bme=["onClick"],Vme={class:"text-sm font-medium text-gray-700"},Rme={class:"flex items-center gap-2"},Pme=["title","onClick","disabled"],Ome=["title","onClick","disabled"],zme={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},Fme=["disabled"],$me=d.defineComponent({__name:"vs-input-dataform",props:d.mergeModels({schema:{default:()=>[]},minGroups:{default:0},maxGroups:{default:void 0},addButtonText:{default:"Додати групу фільтрів"},groupLabel:{default:void 0},duplicateTitle:{default:"Дублювати групу"},removeTitle:{default:"Видалити групу"},emptyLabel:{},view:{default:"default"},collapsible:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref([]),a=d.ref([]),i=d.ref(0),o=d.ref(null),s=d.ref(null),l=d.ref(null),u=d.computed(()=>e.groupLabel??"Group"),c=d.computed(()=>e.emptyLabel??"Ще немає груп"),f=d.computed(()=>{var U;return((U=e.schema)==null?void 0:U.map(q=>({...q,disabled:e.disabled||q.disabled})))??[]}),h=d.computed(()=>f.value.map(U=>C(U))),p=d.computed(()=>e.view==="accordion"),g=d.computed(()=>!!(e.collapsible||p.value)),v=d.computed(()=>e.draggable!==!1),m=d.computed(()=>e.disabled?!1:e.maxGroups?t.value.length<e.maxGroups:!0),y=d.computed(()=>e.disabled||t.value.length<=(e.minGroups||0));d.watch(()=>t.value.length,()=>{b(),_(),x()},{immediate:!0}),d.watch(()=>e.schema,x,{immediate:!0,deep:!0}),d.watch(()=>e.view,()=>{_()},{immediate:!0});function b(){const U=t.value.length;n.value.length<U?n.value=[...n.value,...Array.from({length:U-n.value.length},()=>nP())]:n.value.length>U&&n.value.splice(U)}function _(){const U=t.value.length;p.value?U===0?i.value=-1:i.value>=U?i.value=U-1:i.value<0&&(i.value=0):a.value.length<U?a.value=[...a.value,...Array.from({length:U-a.value.length},()=>!1)]:a.value.length>U&&a.value.splice(U)}function x(){if(!e.minGroups||t.value.length>=e.minGroups)return;const U=e.minGroups-t.value.length,q=Array.from({length:U},w);t.value=[...t.value,...q],_()}function w(){const U={};return f.value.forEach(q=>{U[q.name]=(q==null?void 0:q.default)??null}),U}function S(){m.value&&(t.value=[...t.value,w()],b(),_())}function k(U){y.value||(t.value=t.value.filter((q,ae)=>ae!==U),b(),p.value?i.value>=t.value.length&&(i.value=t.value.length-1):a.value.splice(U,1),x())}function E(U){if(e.disabled)return;const q=JSON.parse(JSON.stringify(t.value[U]??{}));t.value=[...t.value.slice(0,U+1),q,...t.value.slice(U+1)],b(),p.value?i.value>U&&(i.value+=1):a.value.splice(U+1,0,a.value[U]??!1)}function C(U){return{...U}}function T(U){return p.value?i.value===-1&&U===0?!1:i.value!==U:!!a.value[U]}function D(U){if(g.value){if(p.value){i.value=U;return}a.value[U]=!a.value[U]}}function A(U,q){var ae,me,be;if(!v.value||e.disabled){q.preventDefault();return}o.value=U,s.value=U,l.value={groups:JSON.parse(JSON.stringify(t.value)),keys:[...n.value],states:[...a.value]},(ae=q.dataTransfer)==null||ae.setData("text/plain",String(U)),(be=(me=q.dataTransfer)==null?void 0:me.setDragImage)==null||be.call(me,q.currentTarget,0,0)}function I(U,q){!v.value||e.disabled||o.value!==null&&F(U,q)}function L(U,q){F(U,q)}function B(U){!v.value||e.disabled||K()}function N(){l.value&&R(),o.value=null,s.value=null,l.value=null}function V(U,q){const ae=[...t.value],[me]=ae.splice(U,1);ae.splice(q,0,me),t.value=ae;const be=[...n.value],[fe]=be.splice(U,1);if(be.splice(q,0,fe),n.value=be,p.value)i.value===U&&(i.value=q);else{const ce=[...a.value],[W]=ce.splice(U,1);ce.splice(q,0,W),a.value=ce}}function R(){l.value&&(t.value=l.value.groups,n.value=l.value.keys,a.value=l.value.states,l.value=null,s.value=null)}function F(U,q){if(o.value===null)return;const ae=G(U,q);s.value=ae,z(ae)}function G(U,q){if(!(q!=null&&q.currentTarget))return U;const ae=q.currentTarget.getBoundingClientRect(),me=q.clientY-ae.top>ae.height/2?U+1:U;return Math.max(0,Math.min(me,t.value.length))}function z(U){const q=o.value;if(q===null)return;let ae=U;if(ae>t.value.length&&(ae=t.value.length),ae===q||ae===q+1)return;const me=ae>q?ae-1:ae;V(q,me),o.value=me,s.value=ae>q?me+1:me}function K(){l.value=null,o.value=null,s.value=null}return(U,q)=>(d.openBlock(),d.createElementBlock("div",Nme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.value,(ae,me)=>(d.openBlock(),d.createElementBlock("div",{key:n.value[me],class:d.normalizeClass(["relative border border-gray-200 rounded-lg bg-white transition vs-dataform__group",[e.view==="accordion"?"overflow-hidden":T(me)?"pt-6 px-6":"p-6"]]),draggable:v.value&&!e.disabled,onDragstart:be=>A(me,be),onDragend:N,onDragover:d.withModifiers(be=>I(me,be),["prevent"]),onDragenter:d.withModifiers(be=>L(me,be),["prevent"]),onDrop:d.withModifiers(be=>B(),["prevent"])},[d.createElementVNode("div",{class:d.normalizeClass(["flex items-center justify-between gap-2 border-b border-gray-100 px-4 py-3",[e.view!=="accordion"?"-mx-6 -mt-6 px-6":"",e.view!=="accordion"&&!T(me)?"rounded-t-lg":"rounded-lg"]])},[d.createElementVNode("div",Ime,[v.value?(d.openBlock(),d.createBlock(Mp,{key:0,class:"w-4 h-4 text-gray-400","aria-hidden":"true"})):d.createCommentVNode("",!0),g.value?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"rounded-full p-1 text-gray-500 transition hover:bg-gray-100",onClick:be=>D(me)},[d.createVNode(F1,{class:d.normalizeClass(["h-4 w-4 transition",T(me)?"-rotate-90":"rotate-0"])},null,8,["class"])],8,Bme)):d.createCommentVNode("",!0),d.createElementVNode("div",Vme,d.toDisplayString(`${u.value} (${me+1})`),1)]),d.createElementVNode("div",Rme,[d.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:e.duplicateTitle,onClick:be=>E(me),disabled:e.disabled,draggable:"false"},[d.createVNode(Mme,{class:"w-5 h-5"})],8,Pme),d.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:e.removeTitle,onClick:be=>k(me),disabled:y.value,draggable:"false"},[d.createVNode(Sl,{class:"w-5 h-5"})],8,Ome)])],2),d.withDirectives(d.createElementVNode("div",{class:d.normalizeClass(e.view==="accordion"?"p-6":"pt-6")},[d.createVNode(Fa,{class:"vs-dataform__form",schema:h.value,layout:"inline",navigation:!1,values:t.value[me],"onUpdate:values":be=>t.value[me]=be,"form-id":n.value[me],disabled:e.disabled},null,8,["schema","values","onUpdate:values","form-id","disabled"])],2),[[d.vShow,!T(me)]])],42,Lme))),128)),t.value.length===0?(d.openBlock(),d.createElementBlock("div",zme,d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),d.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:S,disabled:!m.value},[d.createVNode(da,{class:"w-5 h-5"}),d.createTextVNode(" "+d.toDisplayString(e.addButtonText),1)],8,Fme)]))}}),Gme=Ye($me,[["__scopeId","data-v-3b71fe50"]]),Vp="__vs_form_monaco_loader__",Ume=d.defineComponent({__name:"vs-input-monaco",props:d.mergeModels({syntax:{default:"xml"},theme:{default:"vs-light"},height:{default:280},minimap:{type:Boolean,default:!1},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(null),a=d.computed(()=>typeof e.height=="number"?`${e.height}px`:e.height||"280px");let i=null,o=null,s=!1;const l=()=>{var h,p;if(o)return Promise.resolve(o);if(typeof window>"u")return Promise.resolve(null);const c=window;if((p=(h=c.monaco)==null?void 0:h.editor)!=null&&p.create)return o=c.monaco,Promise.resolve(o);if(c[Vp])return c[Vp];const f=(async()=>{const g=y=>{if(Array.from(document.styleSheets||[]).some(_=>{var x;return(x=_==null?void 0:_.href)==null?void 0:x.includes(y)}))return;const b=document.createElement("link");b.rel="stylesheet",b.href=y,document.head.appendChild(b)},v=y=>new Promise((b,_)=>{if(Array.from(document.scripts).some(w=>w.src===y))return b();const x=document.createElement("script");x.src=y,x.async=!0,x.onload=()=>b(),x.onerror=w=>_(w),document.body.appendChild(x)}),m="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";return g(`${m}/editor/editor.main.min.css`),await v(`${m}/loader.min.js`),new Promise((y,b)=>{window.require.config({paths:{vs:m}}),window.require(["vs/editor/editor.main"],()=>{o=window.monaco,c.monaco=o,y(o)},_=>b(_))})})().catch(g=>{throw delete c[Vp],g});return c[Vp]=f,f},u=()=>{!n.value||!o||(i&&(i.dispose(),i=null),i=o.editor.create(n.value,{value:t.value||"",language:e.syntax,theme:e.theme,automaticLayout:!0,minimap:{enabled:!!e.minimap},readOnly:!!e.disabled}),i.onDidChangeModelContent(()=>{s||(t.value=i.getValue())}))};return d.watch(()=>t.value,c=>{if(!i)return;const f=i.getValue();c!==f&&(s=!0,i.setValue(c||""),s=!1)}),d.watch(()=>e.syntax,c=>{!i||!o||o.editor.setModelLanguage(i.getModel(),c||"xml")}),d.watch(()=>e.theme,c=>{o&&o.editor.setTheme(c||"vs-light")}),d.watch(()=>e.disabled,c=>{i&&i.updateOptions({readOnly:!!c})}),d.watch(()=>e.minimap,c=>{i&&i.updateOptions({minimap:{enabled:!!c}})}),d.onMounted(async()=>{try{const c=await l();if(!c||!c.editor)return;o=c,u()}catch(c){console.error("Failed to load Monaco editor",c)}}),d.onBeforeUnmount(()=>{i&&(i.dispose(),i=null)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"w-full",style:d.normalizeStyle({height:a.value})},[d.createElementVNode("div",{ref_key:"editorContainer",ref:n,class:"w-full h-full overflow-hidden border border-[#CFD9E0] rounded"},null,512)],4))}}),Rp={VsInputText:wl,VsInputRadio:Y1,"vs-input-text":wl,"vs-input-password":Ece,"vs-input-textarea":HR,"vs-input-richtext":WR,"vs-input-mask":U1,"vs-input-number":BR,"vs-input-radio":Y1,"vs-input-select":X1,"vs-input-switcher":$1,"vs-input-static":G1,"vs-input-container":UR,"vs-input-date":xde,"vs-input-checkbox":VR,"vs-input-file":FR,"vs-input-file2":Z1,file2:Z1,File2:Z1,"vs-input-html":G1,"vs-input-email":H1,"vs-input-tel":W1,"vs-input-datatable":YR,"vs-input-map":qR,"vs-input-file-list":$R,"vs-input-tags":ZR,"vs-input-slug":XR,"vs-input-codegen":jR,"vs-input-key-value":KR,"vs-input-text[]":QR,"vs-input-range":eP,"vs-input-color":JR,"vs-input-native-select":X1,VsInputArraySelect:Bp,"vs-input-array":tP,"vs-input-array-select":Bp,"array-select":Bp,"vs-input-address":rP,"vs-input-datalist":Tme,"vs-input-dataform":Gme,"vs-input-monaco":Ume},Hme=d.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(r){const e=r,t=d.inject("values");async function n(){try{if(!e.api)return;const a=e.api.replace("{{value}}",e.value),i=await fetch(a);if(!i.ok){pt({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const o=await i.json();if(!e.set||!t)return;for(const[s,l]of Object.entries(e.set))t.value[s]=o.result[l]}catch(a){console.error(e.error,a)}}return(a,i)=>(d.openBlock(),d.createElementBlock("button",{onClick:n,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"},d.toDisplayString(a.button),1))}}),Wme={class:"flex flex-col gap-1 w-full"},Yme=["innerHTML"],aP=d.defineComponent({__name:"vs-compact-form-layout",props:d.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:d.mergeModels(["value-selected"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=d.useModel(r,"modelValue"),a=e,i=d.computed(()=>Sce[`${t.layout}`]),o=["label","placeholder","info","description","text","html"],s=d.ref(y()),l=d.computed(()=>g(t.item,s.value)),u=d.computed(()=>Rp==null?void 0:Rp[`vs-input-${t.item.type}`]),c=d.inject("field-props"),f=d.computed(()=>{var S;const _=d.unref(u);if(!_)return new Set;const x=_.props??((S=_.__vccOpts)==null?void 0:S.props);if(!x)return new Set;const w=Array.isArray(x)?x:Object.keys(x);return new Set(w)}),h=d.computed(()=>{var S,k;const _={...l.value??{}},x=(S=t.item)==null?void 0:S.name;x&&((k=c==null?void 0:c.value)!=null&&k[x])&&Object.assign(_,c.value[x]);const w=f.value;return w.size?Object.fromEntries(Object.entries(_).filter(([E])=>w.has(E))):{}}),p=_=>{var w;const x=typeof _=="object"&&_!==null?_:{value:_};a("value-selected",{...x,name:x.name??((w=t.item)==null?void 0:w.name)})};d.onMounted(()=>{s.value=y(),window.addEventListener("storage",b)}),d.onUnmounted(()=>{window.removeEventListener("storage",b)});function g(_,x){if(!_)return{};const w={..._};return o.forEach(S=>{const k=m(_,S,x);k!=null&&(w[S]=k)}),Array.isArray(_.options)&&(w.options=_.options.map(S=>v(S,x))),w}function v(_,x){if(!_)return _;const w={..._},S=m(_,"label",x),k=m(_,"text",x);return S!=null&&(w.label=S),k!=null?w.text=k:S!=null&&(w.text=S),w}function m(_,x,w){const S=`${x}:${w}`;if((_==null?void 0:_[S])!=null)return _[S];if(x==="label"&&(_==null?void 0:_[w])!=null)return _[w];if((_==null?void 0:_[x])!=null)return _[x];if(x==="label"){if((_==null?void 0:_.ua)!=null)return _.ua;if((_==null?void 0:_.en)!=null)return _.en}if(x==="text"||x==="html"){if((_==null?void 0:_.ua)!=null)return _.ua;if((_==null?void 0:_.en)!=null)return _.en}return null}function y(){return typeof window>"u"?"uk":localStorage.getItem("locale")||"uk"}function b(){s.value=y()}return(_,x)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i.value),{ua:l.value.ua,error:t.error||"",item:l.value,columns:t.columns,label:l.value.label},{default:d.withCtx(()=>{var w,S;return[d.createElementVNode("div",{class:d.normalizeClass(["flex w-full",`${t.item.type}-component`])},[d.createElementVNode("div",Wme,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(u.value),d.mergeProps(h.value,{modelValue:n.value,"onUpdate:modelValue":x[0]||(x[0]=k=>n.value=k),onValueSelected:p}),null,16,["modelValue"])),l.value.description&&t.layout!=="settings"?(d.openBlock(),d.createElementBlock("p",{key:0,class:"text-sm text-gray-500",innerHTML:l.value.description},null,8,Yme)):d.createCommentVNode("",!0)]),(w=l.value.behavior)!=null&&w.api&&((S=l.value.behavior)!=null&&S.button)?(d.openBlock(),d.createBlock(Hme,d.mergeProps({key:0},l.value.behavior,{value:n.value}),null,16,["value"])):d.createCommentVNode("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),qme={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},Zme={class:"vs-compact-form-navigation__rail mt-[6px]"},Xme=["onClick"],jme=d.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(r,{expose:e}){const t=r,n=d.ref([]),a=d.ref(""),i=d.ref(""),o=d.computed(()=>!!t.enabled),s=d.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),l=d.computed(()=>{const D=t.width;if(D==null)return{};const A=typeof D=="number"?`${D}px`:`${D}`;return{width:A,minWidth:A}});let u=null,c=0,f=0,h=null,p=null,g=null;const v=()=>C(),m=()=>b();d.watch(()=>t.target,async D=>{if(S(),!D){h=null,n.value=[],a.value="";return}h=D,o.value&&(await d.nextTick(),w(D),b())},{immediate:!0}),d.watch(()=>t.scrollContainer,D=>{if(!o.value){p=D??null;return}y(D??null),d.nextTick(()=>b())},{immediate:!0}),d.onMounted(()=>{t.scrollContainer||y(null),b()}),d.onBeforeUnmount(()=>{S(),y(null,!0),h=null,typeof window<"u"&&(c&&window.cancelAnimationFrame(c),f&&window.cancelAnimationFrame(f))});function y(D,A=!1){if(g&&(g(),g=null),A){p=null;return}if(p=D??null,typeof window>"u")return;const I=D??window,L=window;I.addEventListener("scroll",v,{passive:!0}),L.addEventListener("resize",m),g=()=>{I.removeEventListener("scroll",v),L.removeEventListener("resize",m)}}function b(){if(!o.value||!h)return;c&&typeof window<"u"&&window.cancelAnimationFrame(c);const D=()=>{_(),c=0};typeof window>"u"?D():c=window.requestAnimationFrame(D)}function _(){if(!o.value||!h)return;const D=Array.from(h.querySelectorAll("h1, h2")),A=new Set,I=[];D.forEach((L,B)=>{var G;const N=((G=L.textContent)==null?void 0:G.trim())??"";if(!N)return;let V=(L.getAttribute("id")??"").trim();V||(V=x(N)||`heading-${B+1}`);let R=V,F=1;for(;A.has(R);)R=`${V}-${F+=1}`;L.id!==R&&Object.assign(L,{id:R}),A.add(R),I.push({id:R,text:N,level:L.tagName.toLowerCase()==="h1"?1:2})}),n.value=I,I.length||(a.value=""),E()}function x(D){return D.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function w(D){!D||!o.value||typeof MutationObserver>"u"||(S(),u=new MutationObserver(()=>b()),u.observe(D,{childList:!0,subtree:!0}))}function S(){u&&(u.disconnect(),u=null)}function k(D){const A=p;if(!A)return typeof window>"u"?D.offsetTop:D.getBoundingClientRect().top+window.scrollY;const I=D.getBoundingClientRect(),L=A.getBoundingClientRect();return I.top-L.top+A.scrollTop}function E(){if(!o.value||!n.value.length)return;const D=p,A=(D?D.scrollTop:null)||(typeof window<"u"?window.scrollY:0),I=(D?D.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),L=A+I;let B=null;for(let V=0;V<n.value.length;V+=1){const R=n.value[V],F=document.getElementById(R.id);if(F){const G=k(F);G+F.offsetHeight>A&&G<L&&(B=R.id)}}!B&&i.value&&(B=i.value),B&&(i.value=B);const N=D?D.scrollHeight-D.clientHeight:document.documentElement.scrollHeight-window.innerHeight;A+5>=N&&(B=n.value[n.value.length-1].id),B&&(a.value=B)}function C(){o.value&&(f&&window.cancelAnimationFrame(f),f=window.requestAnimationFrame(()=>{E(),f=0}))}function T(D){if(!o.value)return;const A=document.getElementById(D);if(!A)return;const I=p,L=Math.max(0,k(A));I?I.scrollTo({top:L,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:L,behavior:"smooth"})}return e({refresh:b}),(D,A)=>o.value&&n.value.length?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(s.value),style:d.normalizeStyle(l.value)},[d.createElementVNode("h2",qme,d.toDisplayString(D.title),1),d.createElementVNode("div",Zme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,I=>(d.openBlock(),d.createElementBlock("div",{key:I.id,class:d.normalizeClass(["vs-compact-form-navigation__item relative",I.level===2?"vs-compact-form-navigation__item--nested":"",I.id===a.value?"vs-compact-form-navigation__item--active":""])},[d.createElementVNode("button",{type:"button",onClick:L=>T(I.id),class:d.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",I.level===2?"pl-[15px]":"pl-[18px]",I.id===a.value?"text-gray-800":"text-gray-500"])},[d.createElementVNode("span",null,d.toDisplayString(I.text),1)],10,Xme)],2))),128))])],6)):d.createCommentVNode("",!0)}}),Kme=Ye(jme,[["__scopeId","data-v-1584a562"]]),es={required:"Це поле є обов’язковим",email:"Неправильний email",tel:"Неправильний телефон",minlength:r=>`Мінімальна довжина — ${r} символів`,maxlength:r=>`Максимальна довжина — ${r} символів`},Qme=r=>typeof r=="string"?r.trim()?!1:es.required:Array.isArray(r)?r.map(e=>typeof e=="string"?e.trim():e).filter(e=>e!=null&&e!=="").length?!1:es.required:r?!1:es.required,Jme=r=>r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)?!1:es.email:!1,eye=r=>r?/^\+[1-9]\d{1,14}$/.test(r)?!1:es.tel:!1,iP=r=>r==null?0:typeof r=="string"?r.trim().length:Array.isArray(r)?r.length:typeof r=="number"?r.toString().length:String(r).length,tye=(r,e)=>{if(r==null)return!1;const t=Number((e==null?void 0:e.value)??(e==null?void 0:e.length));return Number.isFinite(t)&&iP(r)<t?(e==null?void 0:e.message)||es.minlength(t):!1},rye=(r,e)=>{if(r==null||r==="")return!1;const t=Number((e==null?void 0:e.value)??(e==null?void 0:e.length));return Number.isFinite(t)&&iP(r)>t?(e==null?void 0:e.message)||es.maxlength(t):!1},nye=(r,e)=>{const t=e.pattern??e.regexp,n=typeof t=="string"?new RegExp(t):t;if(Array.isArray(r)){const a=r.filter(Boolean);return a.length===0||a.every(i=>n.test(i))?!1:e.message}return!n.test(r)&&r?e.message:!1},aye=(r,e)=>!1,iye=(r,e)=>{switch(typeof e=="string"?e:e.type){case"required":return Qme(r);case"email":return Jme(r);case"tel":return eye(r);case"regexp":return nye(r,e);case"minlength":return tye(r,e);case"maxlength":return rye(r,e);case"custom":return aye();default:return!1}},oye={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file",dropzone:"file"};function oP(r){const e=r==null?void 0:r.toLowerCase();return oye[e]||e}function K1(r,e=!1){if(Array.isArray(r)){const n=[];return r.forEach(a=>{const i={...a};i.name=(a.name||a.id||a.key||"").toString(),i.type=oP(a.type),i.label=a.label||a.ua,i.rules=a.rules||a.validators,i.type==="email"&&!i.rules&&(i.rules=["email"]),a.data&&(i.api=`/api/suggest/${a.data}`),i.disabled=i.disabled||e,Array.isArray(i.schema)&&(i.schema=K1(i.schema,i.disabled)),n.push(i)}),n}const t=[];return Object.entries(r).forEach(n=>{var i;const a={name:n[0],...n[1],type:oP(n[1].type),label:n[1].label||n[1].ua,rules:n[1].rules||n[1].validators,disabled:n[1].disabled||e};a.type==="email"&&!a.rules&&(a.rules=["email"]),(i=n[1].type)!=null&&i.includes("list")&&(a.multiple=!0),!a.api&&n[1].data&&(a.api=`/api/suggest/${n[1].data}`),Array.isArray(a.schema)&&(a.schema=K1(a.schema,a.disabled)),t.push(a)}),t}function sye(r,e,t=!1){const n=d.computed(()=>K1(e,typeof t=="boolean"?t:t.value)),a=d.ref({});function i(l){var h;const u=l==null?void 0:l.conditions;if(!u)return!0;const c=Array.isArray(u)?u[0]:u,f=(h=r==null?void 0:r.value)==null?void 0:h[c];return GR(f,u)}const o=(l=n.value,u=!0)=>(l.forEach(c=>{const f=[],h=Number(c==null?void 0:c.minlength),p=Number(c==null?void 0:c.maxlength);!Number.isNaN(h)&&Number.isFinite(h)&&f.push({type:"minlength",value:h}),!Number.isNaN(p)&&Number.isFinite(p)&&f.push({type:"maxlength",value:p});const g=[...f,...c.rules||[]];if(g.length){if(!i(c)){delete a.value[c.name];return}let v=!1,m=null;g.forEach(y=>{const b=iye(r.value[c.name],y);b&&(v=!0,!m&&typeof b=="string"&&(m=b))}),v&&m?a.value[c.name]=m:delete a.value[c.name]}c.schema&&o(c.schema,!1)}),u&&Object.values(a.value).some(Boolean)?a.value:null),s=d.computed(()=>{var l;return(l=n.value)==null?void 0:l.filter(u=>u.hidden!==!0&&i(u))});return{errors:a,validate:o,reset:()=>{r.value={},a.value={}},visibleSchema:s}}const lye={class:"flex w-full h-full min-h-0 gap-6"},uye={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},Fa=d.defineComponent({__name:"vs-compact-form",props:d.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},modelValue:{default:()=>({})},modelModifiers:{},values:{default:void 0},valuesModifiers:{}}),emits:d.mergeModels(["handle-submit","update:modelValue","value-selected"],["update:form","update:modelValue","update:values"]),setup(r,{expose:e,emit:t}){const n=t,a=r,i=d.useModel(r,"form"),o=d.useModel(r,"modelValue"),s=d.useModel(r,"values"),l=d.computed({get:()=>s.value??o.value,set:A=>{o.value=A,s.value=A}}),{errors:u,validate:c,reset:f,visibleSchema:h}=sye(l,a.schema,d.toRef(a,"disabled")),p=d.ref(null),g=d.ref(null),v=d.ref({}),m=d.computed(()=>a.navigation),y=d.computed(()=>a.navWidth),b=d.computed(()=>{var A;return(A=a.style)==null?void 0:A.columns}),_=Object.freeze({container:12,label:3}),x=d.computed(()=>a.columns??b.value??_),w=d.computed(()=>a.columns!=null||b.value!=null),S=d.computed(()=>w.value?"horizontal":a.layout),k=A=>A!=null&&A.columns?"horizontal":S.value,E=A=>(A==null?void 0:A.columns)??x.value,C=()=>{n("update:modelValue",l.value),c(),n("handle-submit",l.value)},T=A=>{n("value-selected",A)};e({validate:c,reset:f,errors:u}),d.onMounted(()=>{i.value={value:l.value,errors:u.value,reset:f,validate:c,formId:a.formId}});function D(A,I){if(A===I)return!0;if(typeof A!="object"||typeof I!="object"||!A||!I)return!1;const L=Object.keys(A),B=Object.keys(I);return L.length!==B.length?!1:L.every(N=>A[N]===I[N])}return d.provide("form",i),d.provide("values",l),d.provide("field-props",v),(A,I)=>(d.openBlock(),d.createElementBlock("div",lye,[d.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:g},[d.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:d.withModifiers(C,["prevent"]),class:d.normalizeClass(["grid grid-cols-12 p-1",S.value==="default"?"gap-6":"gap-4"])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(h),(L,B)=>(d.openBlock(),d.createElementBlock("div",{key:L.name,class:d.normalizeClass(k(L)==="horizontal"?"col-span-12":`col-span-${L.col||12}`)},[d.createVNode(aP,{style:d.normalizeStyle(A.style),item:L,layout:k(L),columns:E(L),"model-value":l.value[L.name],"onUpdate:modelValue":N=>{const V=l.value[L.name];D(V,N)||(l.value[L.name]=N)},error:d.unref(u)[L.name],onValueSelected:T},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),k(L)==="settings"&&B+1!==d.unref(h).length?(d.openBlock(),d.createElementBlock("div",uye)):d.createCommentVNode("",!0)],2))),128))],34)],512),d.createVNode(Kme,{target:p.value,"scroll-container":g.value,enabled:m.value,width:y.value},null,8,["target","scroll-container","enabled","width"])]))}}),cye={class:"relative"},dye={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},fye={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"},hye={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},pye={class:"font-medium text-gray-800 dark:text-[#ffffff]"},gye={class:"p-4 mim-h-0 h-full overflow-auto"},sP=d.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(t.schema),i=d.ref(t.defaultValue?JSON.parse(JSON.stringify(t.defaultValue)):{}),o=d.ref({}),s=d.ref(t.token||""),l=d.ref(t.mode);async function u(){const f=o.value.validate();if(f){pt({type:"warning",title:"Помилка валідації",message:Object.entries(f).map(([h,p])=>`${h}: ${p}`).join(`
|
|
302
|
-
`)});return}if(s.value)try{const h=await fetch(`/api/table/${s.value}`,{method:l.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i.value)});if(h.ok)await h.json(),pt({type:"success",title:"Успішно",message:`Дані успішно ${l.value==="add"?"збережено":"оновлено"}`}),n("save",i.value);else if(h.status===400){const p=await h.json().catch(()=>({}));pt({type:"warning",title:"Помилка валідації",message:p.message||"Некоректні дані (400)"})}else h.status===500?pt({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):pt({type:"error",title:"Помилка",message:`Статус: ${h.status}`})}catch(h){pt({type:"error",title:"Помилка з’єднання",message:h.message||"Не вдалося виконати запит"})}else n("edit",i.value),c()}function c(){n("close")}return d.onMounted(async()=>{try{if(t.form&&!t.schema){const f=await fetch(`/api/template/form/${t.form}`);if(!f.ok){pt({type:f.status>=400&&f.status<500?"warning":"error",title:"Error",message:`Error code: ${f.status}`});return}const h=await f.json();a.value=h.schema,s.value=h.token}else if(t.token&&!t.defaultValue){s.value=t.token;const f=await fetch(`/api/form/${s.value}`);if(!f.ok){pt({type:f.status>=400&&f.status<500?"warning":"error",title:"Error",message:`Error code: ${f.status}`});return}const h=await f.json();a.value=h.schema,h.data?i.value=h.data:l.value="add",h.obj&&(i.value={...i.value,...h.obj})}}catch(f){pt({type:"error",title:"Error",message:f.message||"Unexpected error"}),console.error(f)}}),(f,h)=>(d.openBlock(),d.createElementBlock("div",cye,[d.createElementVNode("div",dye,[d.createElementVNode("div",fye,[d.createElementVNode("div",hye,[d.createElementVNode("h3",pye,d.toDisplayString(l.value==="add"?"Додати":"Змінити"),1),d.createElementVNode("button",{onClick:c,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]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",gye,[a.value?(d.openBlock(),d.createBlock(Fa,{key:0,schema:a.value,values:i.value,"onUpdate:values":h[0]||(h[0]=p=>i.value=p),form:o.value,"onUpdate:form":h[1]||(h[1]=p=>o.value=p)},null,8,["schema","values","form"])):d.createCommentVNode("",!0)]),d.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"},[d.createElementVNode("button",{type:"button",onClick:c,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"}," Скасувати "),d.createElementVNode("button",{onClick:u,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"}," Зберегти ")])])])]))}}),vye=1440*60*1e3,mye=["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],yye=["січ","лют","бер","квіт","трав","черв","лип","серп","вер","жовт","лист","груд"],bye=["нд","пн","вт","ср","чт","пт","сб"];function ur(r){return r instanceof Date&&!Number.isNaN(r.getTime())}const kl=r=>new Date(r.getTime());function ts(r){const e=kl(r);return e.setHours(0,0,0,0),e}function Oc(r){const e=kl(r);return e.setHours(23,59,59,999),e}function Q1(r){return ts(new Date(r.getFullYear(),r.getMonth(),1))}function J1(r){return Oc(new Date(r.getFullYear(),r.getMonth()+1,0))}function ex(r,e){const t=new Date(r),n=t.getDate();t.setDate(1),t.setMonth(t.getMonth()+e);const a=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();return t.setDate(Math.min(n,a)),t}function _ye(r,e){return ex(r,-1)}function Pp(r,e){const t=new Date(r);return t.setFullYear(t.getFullYear()+e),t}function lP(r,e){return Pp(r,-e)}function uP(r){return ts(new Date(r.getFullYear(),0,1))}function cP(r){return Oc(new Date(r.getFullYear(),11,31))}function xye(r){const e=Math.floor(r.getFullYear()/10)*10;return ts(new Date(e,0,1))}function wye(r){const e=Math.floor(r.getFullYear()/10)*10+9;return Oc(new Date(e,11,31))}const zn=r=>r.getFullYear(),Op=r=>Math.floor(r.getFullYear()/10)*10;function Sye(r){const e=[];let t=ts(r.start);const n=ts(r.end);for(;t<=n;)e.push(kl(t)),t=new Date(t.getTime()+vye);return e}function kye(r){const e=[];let t=Q1(r.start);const n=J1(r.end);for(;t<=n;)e.push(kl(t)),t=ex(t,1);return e}function Eye(r){const e=[];let t=uP(r.start);const n=cP(r.end);for(;t<=n;)e.push(kl(t)),t=Pp(t,1);return e}function tx(r,e=1){const t=ts(r),n=(t.getDay()-e+7)%7;return t.setDate(t.getDate()-n),t}function Cye(r,e=1){const t=tx(r,e);return t.setDate(t.getDate()+6),Oc(t)}function Tye(r,e,t=0){const n=tx(r,t),a=(e-t+7)%7;return n.setDate(n.getDate()+a),n}const zp=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()&&r.getDate()===e.getDate(),rx=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth(),dP=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear(),fP=(r,e)=>!!r&&!!e&&zp(r,e)&&r.getHours()===e.getHours(),Dye=(r,e)=>!!r&&!!e&&fP(r,e)&&r.getMinutes()===e.getMinutes();function Aye(r,e){const t=r.getTime();return t>=e.start.getTime()&&t<=e.end.getTime()}const zc=(r,e)=>!!r&&!!e&&r.getTime()<e.getTime(),Fc=(r,e)=>!!r&&!!e&&r.getTime()>e.getTime();function Mye(r){const e=r.filter(t=>ur(t));if(e.length)return e.reduce((t,n)=>t.getTime()>=n.getTime()?t:n)}function Nye(r){const e=r.filter(t=>ur(t));if(e.length)return e.reduce((t,n)=>t.getTime()<=n.getTime()?t:n)}function hP(r,e){const t=kl(r);return typeof e.year=="number"&&t.setFullYear(e.year),typeof e.month=="number"&&t.setMonth(e.month),typeof e.date=="number"&&t.setDate(e.date),typeof e.hours=="number"&&t.setHours(e.hours),typeof e.minutes=="number"&&t.setMinutes(e.minutes),typeof e.seconds=="number"&&t.setSeconds(e.seconds),typeof e.milliseconds=="number"&&t.setMilliseconds(e.milliseconds),t}const Fp=(r,e=2)=>String(r).padStart(e,"0");function pP(r,e){return e==="wide"?mye[r]:yye[r]}function Lye(r){return bye[r]}const Iye=[{token:"LLLL",format:r=>pP(r.getMonth(),"wide")},{token:"LLL",format:r=>pP(r.getMonth(),"abbreviated")},{token:"EE",format:r=>Lye(r.getDay())},{token:"yyyy",format:r=>String(r.getFullYear())},{token:"MM",format:r=>Fp(r.getMonth()+1)},{token:"dd",format:r=>Fp(r.getDate())},{token:"HH",format:r=>Fp(r.getHours())},{token:"mm",format:r=>Fp(r.getMinutes())}];function $p(r,e){if(!ur(r))return"";let t="",n=0;for(;n<e.length;){const a=Iye.find(i=>e.startsWith(i.token,n));a?(t+=a.format(r),n+=a.token.length):(t+=e[n],n+=1)}return t}const Bye={"yyyy-MM-dd":/^(\d{4})-(\d{2})-(\d{2})$/,"dd.MM.yyyy":/^(\d{2})\.(\d{2})\.(\d{4})$/,"dd.MM.yyyy HH:mm":/^(\d{2})\.(\d{2})\.(\d{4}) (\d{2}):(\d{2})$/,"HH:mm":/^(\d{2}):(\d{2})$/,"MM.yyyy":/^(\d{2})\.(\d{4})$/,yyyy:/^(\d{4})$/};function gP(r,e){const t=Bye[e];if(!t){const a=new Date(r);return ur(a)?a:null}const n=r.match(t);if(!n)return null;switch(e){case"yyyy-MM-dd":{const[,a,i,o]=n,s=new Date(Number(a),Number(i)-1,Number(o));return ur(s)?s:null}case"dd.MM.yyyy":{const[,a,i,o]=n,s=new Date(Number(o),Number(i)-1,Number(a));return ur(s)?s:null}case"dd.MM.yyyy HH:mm":{const[,a,i,o,s,l]=n,u=new Date(Number(o),Number(i)-1,Number(a),Number(s),Number(l));return ur(u)?u:null}case"HH:mm":{const[,a,i]=n,o=new Date;return o.setHours(Number(a),Number(i),0,0),o}case"MM.yyyy":{const[,a,i]=n;return new Date(Number(i),Number(a)-1,1)}case"yyyy":{const[,a]=n;return new Date(Number(a),0,1)}default:return null}}const Vye=["year","month","day","time","custom"],Rye=d.defineComponent({emits:{elementClick:r=>ur(r),left:()=>!0,right:()=>!0,heading:()=>!0},props:{headingClickable:{type:Boolean,default:!1},leftDisabled:{type:Boolean,default:!1},rightDisabled:{type:Boolean,default:!1},columnCount:{type:Number,default:7},items:{type:Array,default:()=>[]},viewMode:{type:String,required:!0,validate:r=>typeof r=="string"&&Vye.includes(r)}}}),Pye={class:"v3dp__heading"},Oye=["disabled"],zye=["disabled"],Fye={class:"v3dp__body"},$ye={class:"v3dp__subheading"},Gye={class:"v3dp__elements"},Uye=["disabled","onClick"];function Hye(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["v3dp__popout",`v3dp__popout-${r.viewMode}`]),style:d.normalizeStyle({"--popout-column-definition":`repeat(${r.columnCount}, 1fr)`}),onMousedown:e[3]||(e[3]=d.withModifiers(()=>{},["prevent"]))},[d.createElementVNode("div",Pye,[d.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__left",disabled:r.leftDisabled,onClick:e[0]||(e[0]=d.withModifiers(o=>r.$emit("left"),["stop","prevent"]))},[d.renderSlot(r.$slots,"arrow-left",{},()=>[e[4]||(e[4]=d.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[d.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[d.createElementVNode("path",{stroke:"none",d:"M-9 16V-8h24v24z"}),d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 0L1 4l4 4"})])],-1))],!0)],8,Oye),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r.headingClickable?"button":"span"),{class:"v3dp__heading__center",onClick:e[1]||(e[1]=d.withModifiers(o=>r.$emit("heading"),["stop","prevent"]))},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"heading",{},void 0,!0)]),_:3})),d.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__right",disabled:r.rightDisabled,onClick:e[2]||(e[2]=d.withModifiers(o=>r.$emit("right"),["stop","prevent"]))},[d.renderSlot(r.$slots,"arrow-right",{},()=>[e[5]||(e[5]=d.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[d.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[d.createElementVNode("path",{stroke:"none",d:"M15-8v24H-9V-8z"}),d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M1 8l4-4-4-4"})])],-1))],!0)],8,zye)]),d.createElementVNode("div",Fye,["subheading"in r.$slots?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createElementVNode("div",$ye,[d.renderSlot(r.$slots,"subheading",{},void 0,!0)]),e[6]||(e[6]=d.createElementVNode("hr",{class:"v3dp__divider"},null,-1))],64)):d.createCommentVNode("",!0),d.createElementVNode("div",Gye,[d.renderSlot(r.$slots,"body",{},()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,o=>(d.openBlock(),d.createElementBlock("button",{key:o.key,disabled:o.disabled,class:d.normalizeClass([{selected:o.selected,current:o.current},`v3dp__element__button__${r.viewMode}`]),onClick:d.withModifiers(s=>r.$emit("elementClick",o.value),["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(o.display),1)],10,Uye))),128))],!0)])])],38)}const Gp=Ye(Rye,[["render",Hye],["__scopeId","data-v-bc92af04"]]),Wye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r)},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(r,{emit:e}){const t=d.computed(()=>xye(r.pageDate)),n=d.computed(()=>wye(r.pageDate)),a=(u,c,f)=>!c&&!f?!0:!(c&&zn(u)<zn(c)||f&&zn(u)>zn(f)),i=d.computed(()=>Eye({start:t.value,end:n.value}).map(u=>({value:u,key:String(zn(u)),display:zn(u),selected:!!r.selected&&zn(u)===zn(r.selected),disabled:!a(u,r.lowerLimit,r.upperLimit)}))),o=d.computed(()=>{const u=zn(t.value),c=zn(n.value);return`${u} - ${c}`}),s=d.computed(()=>r.lowerLimit&&(Op(r.lowerLimit)===Op(r.pageDate)||zc(r.pageDate,r.lowerLimit))),l=d.computed(()=>r.upperLimit&&(Op(r.upperLimit)===Op(r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{years:i,heading:o,leftDisabled:s,rightDisabled:l,previousPage:()=>e("update:pageDate",lP(r.pageDate,10)),nextPage:()=>e("update:pageDate",Pp(r.pageDate,10))}}});function Yye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{columnCount:3,leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,items:r.years,viewMode:"year",onLeft:r.previousPage,onRight:r.nextPage,onElementClick:e[0]||(e[0]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const qye=Ye(Wye,[["render",Yye]]),Zye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"LLL"},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(r,{emit:e}){const t=d.computed(()=>uP(r.pageDate)),n=d.computed(()=>cP(r.pageDate)),a=d.computed(()=>c=>$p(c,r.format)),i=(c,f,h)=>!f&&!h?!0:!(f&&zc(c,Q1(f))||h&&Fc(c,J1(h))),o=d.computed(()=>kye({start:t.value,end:n.value}).map(c=>({value:c,display:a.value(c),key:a.value(c),selected:!!r.selected&&rx(r.selected,c),disabled:!i(c,r.lowerLimit,r.upperLimit)}))),s=d.computed(()=>zn(t.value)),l=d.computed(()=>r.lowerLimit&&(dP(r.lowerLimit,r.pageDate)||zc(r.pageDate,r.lowerLimit))),u=d.computed(()=>r.upperLimit&&(dP(r.upperLimit,r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{months:o,heading:s,leftDisabled:l,rightDisabled:u,previousPage:()=>e("update:pageDate",lP(r.pageDate,1)),nextPage:()=>e("update:pageDate",Pp(r.pageDate,1))}}});function Xye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",columnCount:3,items:r.months,leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,viewMode:"month",onLeft:r.previousPage,onRight:r.nextPage,onHeading:e[0]||(e[0]=s=>r.$emit("back")),onElementClick:e[1]||(e[1]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),_:1},8,["items","leftDisabled","rightDisabled","onLeft","onRight"])}const jye=Ye(Zye,[["render",Xye]]),Kye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"dd"},headingFormat:{type:String,required:!1,default:"LLLL yyyy"},weekdayFormat:{type:String,required:!1,default:"EE"},weekStartsOn:{type:Number,required:!1,default:1,validator:r=>typeof r=="number"&&Number.isInteger(r)&&r>=0&&r<=6},customWeekdays:{type:Array,required:!1},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1}},setup(r,{emit:e}){const t=d.computed(()=>g=>v=>$p(v,g)),n=d.computed(()=>Q1(r.pageDate)),a=d.computed(()=>J1(r.pageDate)),i=d.computed(()=>({start:n.value,end:a.value})),o=d.computed(()=>({start:tx(n.value,r.weekStartsOn),end:Cye(a.value,r.weekStartsOn)})),s=d.computed(()=>{var g;return((g=r.customWeekdays)==null?void 0:g.length)===7?r.customWeekdays:null}),l=d.computed(()=>{const g=r.weekStartsOn,v=s.value;if(v)return Array.from({length:7}).map((y,b)=>v[(g+b)%7]);const m=t.value(r.weekdayFormat);return Array.from(Array(7)).map((y,b)=>(g+b)%7).map(y=>Tye(new Date,y,r.weekStartsOn)).map(m)}),u=(g,v,m,y)=>{var b,_;return(b=y==null?void 0:y.dates)!=null&&b.some(x=>zp(g,x))||(_=y==null?void 0:y.predicate)!=null&&_.call(y,g)?!1:!v&&!m?!0:!(v&&zc(g,ts(v))||m&&Fc(g,Oc(m)))},c=d.computed(()=>{const g=new Date,v=t.value(r.format);return Sye(o.value).map(m=>({value:m,display:v(m),selected:!!r.selected&&zp(r.selected,m),current:zp(g,m),disabled:!r.allowOutsideInterval&&!Aye(m,i.value)||!u(m,r.lowerLimit,r.upperLimit,r.disabledDates),key:t.value("yyyy-MM-dd")(m)}))}),f=d.computed(()=>t.value(r.headingFormat)(r.pageDate)),h=d.computed(()=>r.lowerLimit&&(rx(r.lowerLimit,r.pageDate)||zc(r.pageDate,r.lowerLimit))),p=d.computed(()=>r.upperLimit&&(rx(r.upperLimit,r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{weekDays:l,days:c,heading:f,leftDisabled:h,rightDisabled:p,previousPage:()=>e("update:pageDate",_ye(r.pageDate)),nextPage:()=>e("update:pageDate",ex(r.pageDate,1))}}});function Qye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,items:r.days,viewMode:"day",onLeft:r.previousPage,onRight:r.nextPage,onHeading:e[0]||(e[0]=s=>r.$emit("back")),onElementClick:e[1]||(e[1]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),subheading:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.weekDays,(s,l)=>(d.openBlock(),d.createElementBlock("span",{key:s,class:d.normalizeClass(`v3dp__subheading__weekday__${l}`)},d.toDisplayString(s),3))),128))]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Jye=Ye(Kye,[["render",Qye]]);function vP(r,e){const t=r.getBoundingClientRect(),n={height:r.clientHeight,width:r.clientWidth},a=e.getBoundingClientRect();if(!(a.top>=t.top&&a.bottom<=t.top+n.height)){const i=a.top-t.top,o=a.bottom-t.bottom;Math.abs(i)<Math.abs(o)?r.scrollTop+=i:r.scrollTop+=o}}const e0e=d.defineComponent({components:{PickerPopup:Gp},emits:{select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},visible:{type:Boolean,required:!0},disabledTime:{type:Object,required:!1}},setup(r,{emit:e}){const t=d.ref(null),n=d.ref(null),a=d.computed(()=>r.pageDate??r.selected),i=d.ref(a.value.getHours()),o=d.ref(a.value.getMinutes());d.watch(()=>r.selected,f=>{let h=0,p=0;f&&(h=f.getHours(),p=f.getMinutes()),i.value=h,o.value=p});const s=d.computed(()=>[...Array(24).keys()].map(f=>({value:f,date:hP(new Date(a.value.getTime()),{hours:f,minutes:o.value,seconds:0}),selected:i.value===f,ref:d.ref(null)}))),l=d.computed(()=>[...Array(60).keys()].map(f=>({value:f,date:hP(new Date(a.value.getTime()),{hours:i.value,minutes:f,seconds:0}),selected:o.value===f,ref:d.ref(null)}))),u=f=>{o.value=f.value,e("select",f.date)},c=()=>{const f=s.value.find(p=>{var g,v;return((v=(g=p.ref.value)==null?void 0:g.classList)==null?void 0:v.contains("selected"))??!1}),h=l.value.find(p=>{var g,v;return((v=(g=p.ref.value)==null?void 0:g.classList)==null?void 0:v.contains("selected"))??!1});f&&h&&(vP(t.value,f.ref.value),vP(n.value,h.ref.value))};return d.watch(()=>r.visible,f=>{f&&d.nextTick(c)}),{hoursListRef:t,minutesListRef:n,hours:i,minutes:o,hoursList:s,minutesList:l,padStartZero:f=>`0${f}`.substr(-2),selectMinutes:u,isEnabled:f=>{var h,p,g,v;return!((p=(h=r.disabledTime)==null?void 0:h.dates)!=null&&p.some(m=>fP(f,m)&&Dye(f,m))||(v=(g=r.disabledTime)==null?void 0:g.predicate)!=null&&v.call(g,f))},scroll:c}}}),t0e={ref:"hoursListRef",class:"v3dp__column"},r0e=["disabled","onClick"],n0e={ref:"minutesListRef",class:"v3dp__column"},a0e=["disabled","onClick"];function i0e(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",columnCount:2,leftDisabled:!0,rightDisabled:!0,viewMode:"time",onHeading:e[0]||(e[0]=s=>r.$emit("back"))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.padStartZero(r.hours))+":"+d.toDisplayString(r.padStartZero(r.minutes)),1)]),body:d.withCtx(()=>[d.createElementVNode("div",t0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.hoursList,s=>(d.openBlock(),d.createElementBlock("button",{key:s.value,ref_for:!0,ref:s.ref,class:d.normalizeClass([{selected:s.selected},"v3dp__element_button__hour"]),disabled:!r.isEnabled(s.date),onClick:d.withModifiers(l=>r.hours=s.value,["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(r.padStartZero(s.value)),1)],10,r0e))),128))],512),d.createElementVNode("div",n0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.minutesList,s=>(d.openBlock(),d.createElementBlock("button",{key:s.value,ref_for:!0,ref:s.ref,class:d.normalizeClass([{selected:s.selected},"v3dp__element_button__minute"]),disabled:!r.isEnabled(s.date),onClick:d.withModifiers(l=>r.selectMinutes(s),["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(r.padStartZero(s.value)),1)],10,a0e))),128))],512)]),_:1})}const o0e=Ye(e0e,[["render",i0e],["__scopeId","data-v-610b89e1"]]),Up=["time","day","month","year"],s0e=(r,e,t=void 0)=>{let n=t||new Date;const a=Mye([r,n]);a&&(n=a);const i=Nye([e,n]);return i&&(n=i),n},l0e=d.defineComponent({components:{YearPicker:qye,MonthPicker:jye,DayPicker:Jye,TimePicker:o0e},inheritAttrs:!1,props:{placeholder:{type:String,default:""},modelValue:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1},disabledTime:{type:Object,required:!1},upperLimit:{type:Date,required:!1},lowerLimit:{type:Date,required:!1},startingView:{type:String,required:!1,default:"day",validate:r=>typeof r=="string"&&Up.includes(r)},startingViewDate:{type:Date,required:!1,default:()=>new Date},dayPickerHeadingFormat:{type:String,required:!1,default:"LLLL yyyy"},monthListFormat:{type:String,required:!1,default:"LLL"},weekdayFormat:{type:String,required:!1,default:"EE"},dayFormat:{type:String,required:!1,default:"dd"},inputFormat:{type:String,required:!1,default:"yyyy-MM-dd"},weekDayNames:{type:Array,required:!1},weekStartsOn:{type:Number,required:!1,default:1,validator:r=>[0,1,2,3,4,5,6].includes(r)},disabled:{type:Boolean,required:!1,default:!1},clearable:{type:Boolean,required:!1,default:!1},typeable:{type:Boolean,required:!1,default:!1},minimumView:{type:String,required:!1,default:"day",validate:r=>typeof r=="string"&&Up.includes(r)}},emits:{"update:modelValue":r=>r==null||ur(r),decadePageChanged:r=>!0,yearPageChanged:r=>!0,monthPageChanged:r=>!0,opened:()=>!0,closed:()=>!0},setup(r,{emit:e,attrs:t}){const n=d.ref("none"),a=d.ref(r.startingViewDate),i=d.ref(null),o=d.ref(!1),s=d.ref(""),l=L=>{const B=L.replace(/[a-zA-Z]/g,"0");return/0/.test(B)?B:""},u=d.computed(()=>l(r.inputFormat));let c=null,f=null;const h=()=>{c==null||c.destroy(),c=null},p=async()=>{if(!f){const{default:L}=await Promise.resolve().then(()=>sx);f=L}return f},g=()=>{c&&c.value!==s.value&&(c.value=s.value??"")},v=async()=>{h(),!(!i.value||!u.value)&&(c=(await p())(i.value,{mask:u.value,lazy:!0,overwrite:!0}),g())};d.watchEffect(()=>{if(!s.value)return;const L=gP(s.value,r.inputFormat);L&&(a.value=L)}),d.watchEffect(()=>{s.value=r.modelValue&&ur(r.modelValue)?$p(r.modelValue,r.inputFormat):""}),d.onMounted(()=>{u.value&&d.nextTick(()=>{v()})}),d.onBeforeUnmount(()=>{h()}),d.watch(u,L=>{L?d.nextTick(()=>{v()}):h()}),d.watch(s,()=>{g()});const m=(L="none")=>{r.disabled||(L!=="none"&&n.value==="none"&&(a.value=r.modelValue||s0e(r.lowerLimit,r.upperLimit,a.value)),n.value=L,e(L!=="none"?"opened":"closed"))};d.watchEffect(()=>{r.disabled&&(n.value="none")});const y=(L,B)=>{a.value=B,L==="year"?e("decadePageChanged",B):L==="month"?e("yearPageChanged",B):L==="day"&&e("monthPageChanged",B)},b=L=>{a.value=L,r.minimumView==="year"?(m("none"),e("update:modelValue",L)):n.value="month"},_=L=>{a.value=L,r.minimumView==="month"?(m("none"),e("update:modelValue",L)):n.value="day"},x=L=>{a.value=L,r.minimumView==="day"?(m("none"),e("update:modelValue",L)):n.value="time"},w=L=>{m("none"),e("update:modelValue",L)},S=()=>{r.clearable&&(m("none"),e("update:modelValue",null),a.value=r.startingViewDate)},k=()=>o.value=!0,E=()=>m(D.value),C=()=>{o.value=!1,m()},T=L=>{const B=L.keyCode?L.keyCode:L.which;if([27,13].includes(B)&&i.value.blur(),r.typeable){const N=gP(i.value.value,r.inputFormat);N&&s.value===$p(N,r.inputFormat)&&(s.value=i.value.value,e("update:modelValue",N))}},D=d.computed(()=>{const L=Up.indexOf(r.startingView),B=Up.indexOf(r.minimumView);return L<B?r.minimumView:r.startingView}),A=L=>Object.fromEntries(Object.entries(L??{}).filter(([B,N])=>B.startsWith("--"))),I=d.computed(()=>{var L;return((L=r.weekDayNames)==null?void 0:L.length)===7?r.weekDayNames:void 0});return{blur:C,focus:E,click:k,input:s,inputRef:i,pageDate:a,renderView:m,updatePageDate:y,selectYear:b,selectMonth:_,selectDay:x,selectTime:w,keyUp:T,normalizedWeekdayNames:I,viewShown:n,goBackFromTimepicker:()=>r.startingView==="time"&&r.minimumView==="time"?null:n.value="day",clearModelValue:S,initialView:D,log:L=>console.log(L),variables:A}}}),u0e={class:"v3dp__input_wrapper"},c0e=["readonly","placeholder","disabled","tabindex"],d0e={class:"v3dp__clearable"};function f0e(r,e,t,n,a,i){const o=d.resolveComponent("year-picker"),s=d.resolveComponent("month-picker"),l=d.resolveComponent("day-picker"),u=d.resolveComponent("time-picker");return d.openBlock(),d.createElementBlock("div",{class:"v3dp__datepicker",style:d.normalizeStyle(r.variables(r.$attrs.style))},[d.createElementVNode("div",u0e,[d.withDirectives(d.createElementVNode("input",d.mergeProps({type:"text",ref:"inputRef",readonly:!r.typeable,"onUpdate:modelValue":e[0]||(e[0]=c=>r.input=c)},r.$attrs,{placeholder:r.placeholder,disabled:r.disabled,tabindex:r.disabled?-1:0,onKeyup:e[1]||(e[1]=(...c)=>r.keyUp&&r.keyUp(...c)),onBlur:e[2]||(e[2]=(...c)=>r.blur&&r.blur(...c)),onFocus:e[3]||(e[3]=(...c)=>r.focus&&r.focus(...c)),onClick:e[4]||(e[4]=(...c)=>r.click&&r.click(...c))}),null,16,c0e),[[d.vModelText,r.input]]),d.withDirectives(d.createElementVNode("div",d0e,[d.renderSlot(r.$slots,"clear",{onClear:r.clearModelValue},()=>[d.createElementVNode("i",{onClick:e[5]||(e[5]=c=>r.clearModelValue())},"x")])],512),[[d.vShow,r.clearable&&r.modelValue]])]),d.withDirectives(d.createVNode(o,{pageDate:r.pageDate,"onUpdate:pageDate":e[6]||(e[6]=c=>r.updatePageDate("year",c)),selected:r.modelValue,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,onSelect:r.selectYear},null,8,["pageDate","selected","lowerLimit","upperLimit","onSelect"]),[[d.vShow,r.viewShown==="year"]]),d.withDirectives(d.createVNode(s,{pageDate:r.pageDate,"onUpdate:pageDate":e[7]||(e[7]=c=>r.updatePageDate("month",c)),selected:r.modelValue,onSelect:r.selectMonth,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,format:r.monthListFormat,onBack:e[8]||(e[8]=c=>r.viewShown="year")},null,8,["pageDate","selected","onSelect","lowerLimit","upperLimit","format"]),[[d.vShow,r.viewShown==="month"]]),d.withDirectives(d.createVNode(l,{pageDate:r.pageDate,"onUpdate:pageDate":e[9]||(e[9]=c=>r.updatePageDate("day",c)),selected:r.modelValue,weekStartsOn:r.weekStartsOn,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,headingFormat:r.dayPickerHeadingFormat,disabledDates:r.disabledDates,weekdayFormat:r.weekdayFormat,"allow-outside-interval":r.allowOutsideInterval,format:r.dayFormat,"custom-weekdays":r.normalizedWeekdayNames,onSelect:r.selectDay,onBack:e[10]||(e[10]=c=>r.viewShown="month")},null,8,["pageDate","selected","weekStartsOn","lowerLimit","upperLimit","headingFormat","disabledDates","weekdayFormat","allow-outside-interval","format","custom-weekdays","onSelect"]),[[d.vShow,r.viewShown==="day"]]),d.withDirectives(d.createVNode(u,{pageDate:r.pageDate,visible:r.viewShown==="time",selected:r.modelValue,disabledTime:r.disabledTime,onSelect:r.selectTime,onBack:r.goBackFromTimepicker},null,8,["pageDate","visible","selected","disabledTime","onSelect","onBack"]),[[d.vShow,r.viewShown==="time"]])],4)}const h0e=Ye(l0e,[["render",f0e]]),p0e=d.defineComponent({__name:"vs-input-date2",props:{clearable:{type:Boolean,default:!0},now:{type:Boolean},editable:{type:Boolean,default:!0},time:{type:Boolean},isInfinity:{type:Boolean},mode:{default:"date"},weekStart:{},dayNames:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,{inputClass:a}=br(t.style),i=d.computed(()=>t.mode?t.mode:t.time?"datetime":"date"),o={date:"дд.мм.рррр",datetime:"дд.мм.рррр гг:хх",month:"мм.рррр",week:"рррр-тиждень",time:"гг:хх",year:"рррр"},s=d.computed(()=>t.placeholder||o[i.value]||""),l=d.computed(()=>["py-1.5 px-3 block w-full placeholder:text-[#767f8f] bg-white",a.value,t.customClass,{"!border-red-600":t.error}]),u=d.computed(()=>!t.modelValue&&t.now?new Date:null),c=d.computed({get:()=>_(t.modelValue??u.value,i.value)||void 0,set:N=>n("update:modelValue",x(N,i.value))}),f=["Пн","Вт","Ср","Чт","Пт","Сб","Нд"],h=d.computed(()=>{var N;if((N=t.dayNames)!=null&&N.length)return t.dayNames.length===7?t.dayNames:f}),p=d.computed(()=>{const N=t.weekStart,V=typeof N=="string"?Number(N):N;return V===void 0||Number.isNaN(V)?1:Math.min(6,Math.max(0,V))}),g=d.computed(()=>{switch(i.value){case"time":return{startingView:"time",minimumView:"time"};case"month":return{startingView:"month",minimumView:"month"};case"year":return{startingView:"year",minimumView:"year"};case"datetime":return{startingView:"day",minimumView:"time"};default:return{startingView:"day",minimumView:"day"}}}),v={date:"dd.MM.yyyy",datetime:"dd.MM.yyyy HH:mm",month:"MM.yyyy",time:"HH:mm",week:"dd.MM.yyyy",year:"yyyy"},m=d.computed(()=>v[i.value]||"dd.MM.yyyy"),y=d.computed(()=>{var N,V,R,F;return{"--vdp-selected-bg-color":((N=t.style)==null?void 0:N.primaryColor)||"#2563eb","--vdp-hover-bg-color":((V=t.style)==null?void 0:V.primaryColor)||"#2563eb","--vdp-selected-color":"#ffffff","--vdp-hover-color":"#ffffff","--vdp-border-radius":((R=t.style)==null?void 0:R.size)==="sm"?"6px":"8px","--vdp-elem-font-size":((F=t.style)==null?void 0:F.size)==="sm"?"0.75em":"0.85em"}}),b=d.ref(!1);d.watch(()=>t.modelValue,N=>{N?b.value=!0:t.now||(b.value=!1)},{immediate:!0}),d.watchEffect(()=>{t.now&&!t.modelValue&&!b.value&&(n("update:modelValue",x(new Date,i.value)),b.value=!0)});function _(N,V){if(!N)return null;if(N instanceof Date&&!Number.isNaN(N.getTime()))return N;if(typeof N!="string")return null;switch(V){case"datetime":return E(N);case"time":return D(N);case"month":return C(N);case"year":return T(N);case"week":return A(N);case"date":default:return k(N)}}function x(N,V){if(!N)return null;const R=N instanceof Date?N:_(N,V);if(!R)return null;switch(V){case"datetime":return`${w(R)}T${S(R)}`;case"time":return S(R);case"month":return`${R.getFullYear()}-${B(R.getMonth()+1)}`;case"year":return`${R.getFullYear()}`;case"week":{const{year:F,week:G}=I(R);return`${F}-W${B(G)}`}case"date":default:return w(R)}}function w(N){return`${N.getFullYear()}-${B(N.getMonth()+1)}-${B(N.getDate())}`}function S(N){return`${B(N.getHours())}:${B(N.getMinutes())}`}function k(N){const V=N.split("-");if(V.length<3)return null;const[R,F,G]=V.map(Number);return!R||!F||!G?null:new Date(R,F-1,G)}function E(N){const V=N.includes("T")?N:N.replace(" ","T"),R=new Date(V);return Number.isNaN(R.getTime())?null:R}function C(N){const[V,R]=N.split("-").map(Number);return!V||Number.isNaN(R)?null:new Date(V,(R||1)-1,1)}function T(N){const V=Number(N);return V?new Date(V,0,1):null}function D(N){const V=N.match(/^(\d{1,2}):(\d{2})$/);if(!V)return null;const[,R,F]=V,G=new Date;return G.setHours(Number(R),Number(F),0,0),G}function A(N){const V=N.match(/^(\d{4})-W(\d{2})$/);if(!V)return null;const[,R,F]=V,G=Number(F);return L(Number(R),G)}function I(N){const V=new Date(Date.UTC(N.getFullYear(),N.getMonth(),N.getDate())),R=V.getUTCDay()||7;V.setUTCDate(V.getUTCDate()+4-R);const F=new Date(Date.UTC(V.getUTCFullYear(),0,1)),G=Math.ceil(((V.getTime()-F.getTime())/864e5+1)/7);return{year:V.getUTCFullYear(),week:G}}function L(N,V){if(!N||!V)return null;const R=new Date(N,0,1+(V-1)*7),F=R.getDay(),G=R;return F<=4?G.setDate(R.getDate()-R.getDay()+1):G.setDate(R.getDate()+8-R.getDay()),G}function B(N){return String(N).padStart(2,"0")}return(N,V)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["vs-date-picker",t.customClass]),style:d.normalizeStyle(y.value)},[d.createVNode(h0e,{modelValue:c.value,"onUpdate:modelValue":V[0]||(V[0]=R=>c.value=R),placeholder:s.value,disabled:t.disabled,clearable:t.clearable,typeable:t.editable,"week-day-names":h.value,"week-starts-on":p.value,"starting-view":g.value.startingView,"minimum-view":g.value.minimumView,"input-format":m.value,name:t.name,class:d.normalizeClass(l.value)},null,8,["modelValue","placeholder","disabled","clearable","typeable","week-day-names","week-starts-on","starting-view","minimum-view","input-format","name","class"])],6))}}),g0e=Ye(p0e,[["__scopeId","data-v-a65a2ac3"]]),mP=(r={mode:"edit",schema:null})=>new Promise(e=>{const{close:t}=O1({title:r.mode==="add"?"Додати":"Редагувати",template:"",size:"medium",content:sP,contentProps:{...r,onClose:()=>{e(null),t()},onSave:n=>{e(n),t()}}})});Fa.install=function(r){r.component("VForm",Fa),Object.assign(r.config.globalProperties,{$form:mP}),r.provide("form",mP),window.v3plugin||(window.v3plugin={})};const $a=Object.freeze(Object.defineProperty({__proto__:null,ModalEdit:sP,VForm:Fa,VsInputAddress:rP,VsInputArray:tP,VsInputArraySelect:Bp,VsInputCheckbox:VR,VsInputCodegen:jR,VsInputColor:JR,VsInputContainer:UR,VsInputDate:g0e,VsInputEmail:H1,VsInputFile:FR,VsInputFileList:$R,VsInputKeyValue:KR,VsInputMask:U1,VsInputNumber:BR,VsInputRadio:Y1,VsInputRange:eP,VsInputRichtext:WR,VsInputSelect:X1,VsInputSlug:XR,VsInputStatic:G1,VsInputSwitcher:$1,VsInputTag:ZR,VsInputTel:W1,VsInputText:wl,VsInputTextArray:QR,VsInputTextarea:HR,default:Fa,inputs:Rp,vsInputDatatable:YR,vsInputMap:qR},Symbol.toStringTag,{value:"Module"}));function Ai(r){return typeof r=="string"||r instanceof String}function yP(r){var e;return typeof r=="object"&&r!=null&&(r==null||(e=r.constructor)==null?void 0:e.name)==="Object"}function bP(r,e){return Array.isArray(e)?bP(r,(t,n)=>e.includes(n)):Object.entries(r).reduce((t,n)=>{let[a,i]=n;return e(i,a)&&(t[a]=i),t},{})}const Ve={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function _P(r){switch(r){case Ve.LEFT:return Ve.FORCE_LEFT;case Ve.RIGHT:return Ve.FORCE_RIGHT;default:return r}}function nx(r){return r.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Hp(r,e){if(e===r)return!0;const t=Array.isArray(e),n=Array.isArray(r);let a;if(t&&n){if(e.length!=r.length)return!1;for(a=0;a<e.length;a++)if(!Hp(e[a],r[a]))return!1;return!0}if(t!=n)return!1;if(e&&r&&typeof e=="object"&&typeof r=="object"){const i=e instanceof Date,o=r instanceof Date;if(i&&o)return e.getTime()==r.getTime();if(i!=o)return!1;const s=e instanceof RegExp,l=r instanceof RegExp;if(s&&l)return e.toString()==r.toString();if(s!=l)return!1;const u=Object.keys(e);for(a=0;a<u.length;a++)if(!Object.prototype.hasOwnProperty.call(r,u[a]))return!1;for(a=0;a<u.length;a++)if(!Hp(r[u[a]],e[u[a]]))return!1;return!0}else if(e&&r&&typeof e=="function"&&typeof r=="function")return e.toString()===r.toString();return!1}class v0e{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?Ve.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Ve.RIGHT:Ve.LEFT}}function Xe(r,e){return new Xe.InputMask(r,e)}function xP(r){if(r==null)throw new Error("mask property should be defined");return r instanceof RegExp?Xe.MaskedRegExp:Ai(r)?Xe.MaskedPattern:r===Date?Xe.MaskedDate:r===Number?Xe.MaskedNumber:Array.isArray(r)||r===Array?Xe.MaskedDynamic:Xe.Masked&&r.prototype instanceof Xe.Masked?r:Xe.Masked&&r instanceof Xe.Masked?r.constructor:r instanceof Function?Xe.MaskedFunction:(console.warn("Mask not found for mask",r),Xe.Masked)}function El(r){if(!r)throw new Error("Options in not defined");if(Xe.Masked){if(r.prototype instanceof Xe.Masked)return{mask:r};const{mask:e=void 0,...t}=r instanceof Xe.Masked?{mask:r}:yP(r)&&r.mask instanceof Xe.Masked?r:{};if(e){const n=e.mask;return{...bP(e,(a,i)=>!i.startsWith("_")),mask:e.constructor,_mask:n,...t}}}return yP(r)?{...r}:{mask:r}}function fa(r){if(Xe.Masked&&r instanceof Xe.Masked)return r;const e=El(r),t=xP(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)}Xe.createMask=fa;class Wp{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}}Xe.MaskElement=Wp;const wP=90,m0e=89;class $c extends Wp{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,n;return(e=(t=(n=this.input).getRootNode)==null?void 0:t.call(n))!=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===wP&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===m0e&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===wP&&(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={}}}Xe.HTMLMaskElement=$c;class SP extends $c{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}}Xe.HTMLMaskElement=$c;class ax extends $c{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||n==null||n<a?n:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||n==null||n>a?n:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,i=a.getSelection&&a.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Xe.HTMLContenteditableMaskElement=ax;class Yp{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>Yp.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}}Yp.MAX_LENGTH=100;class kP{constructor(e,t){this.el=e instanceof Wp?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new ax(e):new SP(e),this.masked=fa(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Yp,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 Xe.Masked)&&this.masked.constructor===xP(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof Xe.Masked?e:fa({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 n=this._listeners[e];n&&n.forEach(a=>a(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,n=this.masked.value,a=this.masked.rawInputValue,i=this.displayValue,o=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==a;this._unmaskedValue=t,this._value=n,this._rawInputValue=a,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...n}=e,a=!this.maskEquals(t),i=this.masked.optionsIsChanged(n);a&&(this.mask=t),i&&this.masked.updateOptions(n),(a||i)&&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,Ve.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 n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new v0e({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:Ve.NONE;let o=this.masked.nearestInputPos(t.startChangePos+a,i);i!==Ve.NONE&&(o=this.masked.nearestInputPos(o,Ve.NONE)),this.updateControl(o),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}}Xe.InputMask=kP;class et{static normalize(e){return Array.isArray(e)?e:[e,new et]}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}}Xe.ChangeDetails=et;class ha{constructor(e,t,n){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=n}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 cr{constructor(e){this._value="",this._update({...cr.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,n){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 ha(this.extractInput(e,t),e)}appendTail(e){return Ai(e)&&(e=new ha(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new et({inserted:e,rawInserted:e})):new et}_appendChar(e,t,n){t===void 0&&(t={});const a=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=a;let s=this.pad(t);const l=this._appendCharRaw(e,t);s=s.aggregate(l),l.rawInserted||s.equals(i)?i=s:this.state=o}if(i.inserted){let o,s=this.doValidate(t)!==!1;if(s&&n!=null){const l=this.state;if(this.overwrite===!0){o=n.state;for(let c=0;c<i.rawInserted.length;++c)n.unshift(this.displayValue.length-i.tailShift)}let u=this.appendTail(n);if(s=u.rawInserted.length===n.toString().length,!(s&&u.inserted)&&this.overwrite==="shift"){this.state=l,o=n.state;for(let c=0;c<i.rawInserted.length;++c)n.shift();u=this.appendTail(n),s=u.rawInserted.length===n.toString().length}s&&u.inserted&&(this.state=l)}s||(i=new et,this.state=a,n&&o&&(n.state=o))}return i}_appendPlaceholder(){return new et}_appendEager(){return new et}append(e,t,n){if(!Ai(e))throw new Error("value should be string");const a=Ai(n)?new ha(String(n)):n;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],t,a);if(!s.rawInserted&&!this.doSkipInvalid(e[o],t,a))break;i.aggregate(s)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),a!=null&&(i.tailShift+=this.appendTail(a).tailShift),i}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 et}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e,t,n){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),et.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),et.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,n,a,i){n===void 0&&(n=""),a===void 0&&(a=Ve.NONE),i===void 0&&(i={input:!0});const o=e+t,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let u;l&&(a=_P(a),u=this.extractInput(0,o,{raw:!0}));let c=e;const f=new et;if(a!==Ve.NONE&&(c=this.nearestInputPos(e,t>1&&e!==0&&!l?Ve.NONE:a),f.tailShift=c-e),f.aggregate(this.remove(c)),l&&a!==Ve.NONE&&u===this.rawInputValue)if(a===Ve.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)f.aggregate(new et({tailShift:-1})).aggregate(this.remove(h-1))}else a===Ve.FORCE_RIGHT&&s.unshift();return f.aggregate(this.append(n,i,s))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Hp(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||cr.EMPTY_VALUES.includes(e)&&cr.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new et}}cr.DEFAULTS={skipInvalid:!0},cr.EMPTY_VALUES=[void 0,null,""],Xe.Masked=cr;class Mi{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=Ai(e)?new ha(String(e)):e;const t=this.chunks[this.chunks.length-1],n=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof ha)n?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof Mi){if(e.stop==null){let a;for(;e.chunks.length&&e.chunks[0].stop==null;)a=e.chunks.shift(),a.from+=e.from,this.extend(a)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Xe.MaskedPattern))return new ha(this.toString()).appendTo(e);const t=new et;for(let n=0;n<this.chunks.length;++n){const a=this.chunks[n],i=e._mapPosToBlock(e.displayValue.length),o=a.stop;let s;if(o!=null&&(!i||i.index<=o)&&((a instanceof Mi||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),s=a instanceof Mi&&e._blocks[o]),s){const l=s.appendTail(a);t.aggregate(l);const u=a.toString().slice(l.rawInserted.length);u&&t.aggregate(e.append(u,{tail:!0}))}else t.aggregate(e.append(a.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,...n}=e;Object.assign(this,n),this.chunks=t.map(a=>{const i="chunks"in a?new Mi:new ha;return i.state=a,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let n=0;for(;n<this.chunks.length;){const a=this.chunks[n],i=a.unshift(t);if(a.toString()){if(!i)break;++n}else this.chunks.splice(n,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class y0e{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=a,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,Ve.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Ve.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ve.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Ve.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,Ve.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ve.NONE),!0})}}class ix{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 et}nearestInputPos(e,t){t===void 0&&(t=Ve.NONE);const n=0,a=this._value.length;switch(t){case Ve.LEFT:case Ve.FORCE_LEFT:return n;case Ve.NONE:case Ve.RIGHT:case Ve.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),n===void 0&&(n={}),n.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 et;const n=this.eager===!0||this.eager==="append",a=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&!t.tail,i=new et({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 et;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new ha("")}appendTail(e){return Ai(e)&&(e=new ha(String(e))),e.appendTo(this)}append(e,t,n){const a=this._appendChar(e[0],t);return n!=null&&(a.tailShift+=this.appendTail(n).tailShift),a}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 Gc{constructor(e){const{parent:t,isOptional:n,placeholderChar:a,displayChar:i,lazy:o,eager:s,...l}=e;this.masked=fa(l),Object.assign(this,{parent:t,isOptional:n,placeholderChar:a,displayChar:i,lazy:o,eager:s})}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 et}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 et;const n=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&this.doValidate(t)===!1&&(a=new et,this.masked.state=n),!a.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new et:(this.isFilled=!0,new et({inserted:this.placeholderChar}))}_appendEager(){return new et}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,n)}nearestInputPos(e,t){t===void 0&&(t=Ve.NONE);const n=0,a=this.value.length,i=Math.min(Math.max(e,n),a);switch(t){case Ve.LEFT:case Ve.FORCE_LEFT:return this.isComplete?i:n;case Ve.RIGHT:case Ve.FORCE_RIGHT:return this.isComplete?i:a;case Ve.NONE:default:return i}}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==null?void 0:e._beforeTailState)}}pad(e){return new et}}Gc.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 EP extends cr{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=n=>n.search(t)>=0),super._update(e)}}Xe.MaskedRegExp=EP;class dr extends cr{constructor(e){super({...dr.DEFAULTS,...e,definitions:Object.assign({},Gc.DEFAULT_DEFINITIONS,e==null?void 0: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 n=!1,a=!1;for(let i=0;i<t.length;++i){if(this.blocks){const u=t.slice(i),c=Object.keys(this.blocks).filter(h=>u.indexOf(h)===0);c.sort((h,p)=>p.length-h.length);const f=c[0];if(f){const{expose:h,repeat:p,...g}=El(this.blocks[f]),v={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...g,repeat:p,parent:this},m=p!=null?new Xe.RepeatBlock(v):fa(v);m&&(this._blocks.push(m),h&&(this.exposeBlock=m),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),i+=f.length-1;continue}}let o=t[i],s=o in e;if(o===dr.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){n=!n;continue}if(o==="["||o==="]"){a=!a;continue}if(o===dr.ESCAPE_CHAR){if(++i,o=t[i],!o)break;s=!1}const l=s?new Gc({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...El(e[o]),parent:this}):new ix({char:o,eager:this.eager,isUnmasking:n});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,...n}=e;this._blocks.forEach((a,i)=>a.state=t[i]),super.state=n}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 et;let n=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(n==null)return t;this._blocks[n].isFilled&&++n;for(let a=n;a<this._blocks.length;++a){const i=this._blocks[a]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._mapPosToBlock(this.displayValue.length),a=new et;if(!n)return a;for(let o=n.index,s;s=this._blocks[o];++o){var i;const l=s._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[o]});if(a.aggregate(l),l.consumed)break}return a}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=new Mi;return e===t||this._forEachBlocksInRange(e,t,(a,i,o,s)=>{const l=a.extractTail(o,s);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof Mi&&(l.blockIndex=i),n.extend(l)}),n}extractInput(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),n===void 0&&(n={}),e===t)return"";let a="";return this._forEachBlocksInRange(e,t,(i,o,s,l)=>{a+=i.extractInput(s,l,n)}),a}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const a=this._stops[n];if(a<=e)t=a;else break}return t}_appendPlaceholder(e){const t=new et;if(this.lazy&&e==null)return t;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return t;const a=n.index,i=e??this._blocks.length;return this._blocks.slice(a,i).forEach(o=>{if(!o.lazy||e!=null){var s;t.aggregate(o._appendPlaceholder((s=o._blocks)==null?void 0:s.length))}}),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const a=this._blocks[n],i=t.length;if(t+=a.displayValue,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,n)=>t+=n.displayValue.length,0)}_forEachBlocksInRange(e,t,n){t===void 0&&(t=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const i=this._mapPosToBlock(t),o=i&&a.index===i.index,s=a.offset,l=i&&o?i.offset:this._blocks[a.index].displayValue.length;if(n(this._blocks[a.index],a.index,s,l),i&&!o){for(let u=a.index+1;u<i.index;++u)n(this._blocks[u],u,0,this._blocks[u].displayValue.length);n(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,(a,i,o,s)=>{n.aggregate(a.remove(o,s))}),n}nearestInputPos(e,t){if(t===void 0&&(t=Ve.NONE),!this._blocks.length)return 0;const n=new y0e(this,e);if(t===Ve.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(t===Ve.LEFT||t===Ve.FORCE_LEFT){if(t===Ve.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===Ve.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:t===Ve.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return t===Ve.RIGHT||t===Ve.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===Ve.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,Ve.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,t,(a,i,o,s)=>{n+=a.totalInputPositions(o,s)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(n=>this._blocks[n]):[]}pad(e){const t=new et;return this._forEachBlocksInRange(0,this.displayValue.length,n=>t.aggregate(n.pad(e))),t}}dr.DEFAULTS={...cr.DEFAULTS,lazy:!0,placeholderChar:"_"},dr.STOP_CHAR="`",dr.ESCAPE_CHAR="\\",dr.InputDefinition=Gc,dr.FixedDefinition=ix,Xe.MaskedPattern=dr;class Uc extends dr{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:n=this.from||0,maxLength:a=this.maxLength||0,autofix:i=this.autofix,...o}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,a),this.autofix=i;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<l.length&&l[u]===s[u];)++u;o.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",n="";const[,a,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(a.length)+i,n="9".repeat(a.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepareChar(e,t){t===void 0&&(t={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const n=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[i,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(n[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(a[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[n,a]=this.boundaries(t);return this.from<=Number(a)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){const t=new et;if(this.value.length===this.maxLength)return t;const n=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let i=0;i<a;++i)t.aggregate(super._appendCharRaw("0",e));n.split("").forEach(i=>this._appendCharRaw(i))}return t}}Xe.MaskedRange=Uc;const b0e="d{.}`m{.}`Y";class pa extends dr{static extractPatternOptions(e){const{mask:t,pattern:n,...a}=e;return{...a,mask:Ai(t)?t:n}}constructor(e){super(pa.extractPatternOptions({...pa.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:n,blocks:a,...i}={...pa.DEFAULTS,...e},o=Object.assign({},pa.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,a),super._update({...i,mask:Ai(t)?t:n,blocks:o})}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(pa.extractPatternOptions(e))}}pa.GET_DEFAULT_BLOCKS=()=>({d:{mask:Uc,from:1,to:31,maxLength:2},m:{mask:Uc,from:1,to:12,maxLength:2},Y:{mask:Uc,from:1900,to:9999}}),pa.DEFAULTS={...dr.DEFAULTS,mask:Date,pattern:b0e,format:(r,e)=>{if(!r)return"";const t=String(r.getDate()).padStart(2,"0"),n=String(r.getMonth()+1).padStart(2,"0"),a=r.getFullYear();return[t,n,a].join(".")},parse:(r,e)=>{const[t,n,a]=r.split(".").map(Number);return new Date(a,n-1,t)}},Xe.MaskedDate=pa;class Hc extends cr{constructor(e){super({...Hc.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:n,...a}=El(t),i=fa({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a});return n&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){e===void 0&&(e=""),t===void 0&&(t={}),n===void 0&&(n="");const a=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,o=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,s=i.slice(o.length),l=this.currentMask,u=new et,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),u.tailShift=this.currentMask.value.length-a.length),s&&(u.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),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 et;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((n=e._beforeTailState)==null?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,t,n){return t===void 0&&(t={}),n===void 0&&(n=""),this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[n,a]=super.doPrepare(e,t);if(this.currentMask){let i;[n,i]=super.doPrepare(n,this.currentMaskFlags(t)),a=a.aggregate(i)}return[n,a]}doPrepareChar(e,t){t===void 0&&(t={});let[n,a]=super.doPrepareChar(e,t);if(this.currentMask){let i;[n,i]=super.doPrepareChar(n,this.currentMaskFlags(t)),a=a.aggregate(i)}return[n,a]}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 n=new et;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}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:n,currentMask:a,...i}=e;t&&this.compiledMasks.forEach((o,s)=>o.state=t[s]),n!=null&&(this.currentMask=n,this.currentMask.state=a),super.state=i}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):""}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,n)=>{if(!e[n])return;const{mask:a,...i}=e[n];return Hp(t,i)&&t.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Hc.DEFAULTS={...cr.DEFAULTS,dispatch:(r,e,t,n)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,i=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,u=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Ve.FORCE_LEFT);return o.rawInputValue!==a?(o.reset(),o.append(a,{raw:!0})):l||o.remove(u),o.append(r,e.currentMaskFlags(t)),o.appendTail(n),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(u,o.nearestInputPos(o.displayValue.length,Ve.FORCE_LEFT)))}});return i.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[i[0].index]}},Xe.MaskedDynamic=Hc;class Wc extends dr{constructor(e){super({...Wc.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...n}=e;if(t){const a=t.map(s=>s.length),i=Math.min(...a),o=Math.max(...a)-i;n.mask="*".repeat(i),o&&(n.mask+="["+"*".repeat(o)+"]"),this.enum=t}super._update(n)}_appendCharRaw(e,t){t===void 0&&(t={});const n=Math.min(this.nearestInputPos(0,Ve.FORCE_RIGHT),this.value.length),a=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,n));if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,s)=>{const l=a[0][s];s>=this.value.length||l===o.value||(o.reset(),o._appendChar(l,t))});const i=super._appendCharRaw(a[0][this.value.length],t);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(o=>i.aggregate(super._appendCharRaw(o))),i}return new et({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new ha("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new et;const n=Math.min(super.nearestInputPos(0,Ve.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0&&!(this.enum.filter(o=>this.matchValue(o,this.value.slice(n,a),n)).length>1);--a);const i=super.remove(a,t);return i.tailShift+=a-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}Wc.DEFAULTS={...dr.DEFAULTS,matchValue:(r,e,t)=>r.indexOf(e,t)===t},Xe.MaskedEnum=Wc;class CP extends cr{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Xe.MaskedFunction=CP;var TP;class $r extends cr{constructor(e){super({...$r.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",n=(this.scale?"("+nx(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(nx).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(nx(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[n,a]=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&&!n&&(a.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&a.aggregate(this._appendChar("-")),[n,a]}_separatorsCount(e,t){t===void 0&&(t=!1);let n=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){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,n))}_appendCharRaw(e,t){t===void 0&&(t={});const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const o=this.number;let s=!isNaN(o),l=!1;if(s){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace($r.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let u;s?u=new et({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,u=new et),this._value=this._insertThousandsSeparators(this._value);const c=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,f=this._separatorsCountFromSlice(c);return u.tailShift+=(f-a)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const a=this._findSeparatorAround(t);return a>=0&&(t=a+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 n=this.value.slice(0,e),a=this.value.slice(t),i=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+a));const o=this._separatorsCountFromSlice(n);return new et({tailShift:(o-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case Ve.NONE:case Ve.LEFT:case Ve.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const a=n+this.thousandsSeparator.length;if(e<a||this.value.length<=a||t===Ve.FORCE_LEFT)return n}break}case Ve.RIGHT:case Ve.FORCE_RIGHT:{const n=this._findSeparatorAround(e);if(n>=0)return n+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 n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(n,a,i,o)=>a+o),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,n){t===void 0&&(t={});const a=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===$r.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,$r.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($r.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)||$r.EMPTY_VALUES.includes(e)&&$r.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}TP=$r,$r.UNMASKED_RADIX=".",$r.EMPTY_VALUES=[...cr.EMPTY_VALUES,0],$r.DEFAULTS={...cr.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[TP.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:r=>r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Xe.MaskedNumber=$r;const qp={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function ox(r,e,t){e===void 0&&(e=qp.MASKED),t===void 0&&(t=qp.MASKED);const n=fa(r);return a=>n.runIsolated(i=>(i[e]=a,i[t]))}function DP(r,e,t,n){return ox(e,t,n)(r)}Xe.PIPE_TYPE=qp,Xe.createPipe=ox,Xe.pipe=DP;class AP extends dr{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,n,a;const{repeat:i,...o}=El(e);this._blockOpts=Object.assign({},this._blockOpts,o);const s=fa(this._blockOpts);this.repeat=(t=(n=i??s.repeat)!=null?n:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.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(fa(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const n=new et;for(let l=(a=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?a:Math.max(this._blocks.length-1,0),u,c;u=(o=this._blocks[l])!=null?o:c=!c&&this._allocateBlock(l);++l){var a,i,o,s;const f=u._appendChar(e,{...t,_beforeTailState:(s=t._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]});if(f.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(f),f.consumed)break}return n}_trimEmptyTail(e,t){var n,a;e===void 0&&(e=0);const i=Math.max(((n=this._mapPosToBlock(e))==null?void 0:n.index)||0,this.repeatFrom,0);let o;t!=null&&(o=(a=this._mapPosToBlock(t))==null?void 0:a.index),o==null&&(o=this._blocks.length-1);let s=0;for(let l=o;i<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(o-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._trimEmptyTail(e,t),n}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}}Xe.RepeatBlock=AP;try{globalThis.IMask=Xe}catch{}const sx=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:et,ChunksTailDetails:Mi,DIRECTION:Ve,HTMLContenteditableMaskElement:ax,HTMLInputMaskElement:SP,HTMLMaskElement:$c,InputMask:kP,MaskElement:Wp,Masked:cr,MaskedDate:pa,MaskedDynamic:Hc,MaskedEnum:Wc,MaskedFunction:CP,MaskedNumber:$r,MaskedPattern:dr,MaskedRange:Uc,MaskedRegExp:EP,PIPE_TYPE:qp,PatternFixedDefinition:ix,PatternInputDefinition:Gc,RepeatBlock:AP,createMask:fa,createPipe:ox,default:Xe,forceDirection:_P,normalizeOpts:El,pipe:DP},Symbol.toStringTag,{value:"Module"}));Dt.EditorRootPage=sae,Dt.ROUTES_NAMES=eR,Dt.Urls=QV,Dt.VsBar=A1,Dt.VsDashboard=BO,Dt.VsDonut=tR,Dt.VsLine=nR,Dt.VsListBar=oR,Dt.VsPie=rR,Dt.VsPivotTable=sR,Dt.VsProgressBar=iR,Dt.VsStat=aR,Dt.VsWidget=Tl,Object.defineProperty(Dt,Symbol.toStringTag,{value:"Module"})});
|
|
299
|
+
`,t.appendChild(n),r._loadingOverlay=t;const a=getComputedStyle(r).position;(a==="static"||!a)&&(r.style.position="relative"),e.value&&r.appendChild(t)},updated(r,e){e.value&&r._loadingOverlay&&!r.contains(r._loadingOverlay)?r.appendChild(r._loadingOverlay):!e.value&&r._loadingOverlay&&r.contains(r._loadingOverlay)&&r.removeChild(r._loadingOverlay)},unmounted(r){r._loadingOverlay&&r.contains(r._loadingOverlay)&&r.removeChild(r._loadingOverlay),delete r._loadingOverlay}},Kue={mounted(r){var e,t;typeof window>"u"||(t=(e=r.querySelector("input, textarea, [tabindex]")??r).focus)==null||t.call(e)},updated(r,e){var t,n;e.value===!0&&((n=(t=r.querySelector("input, textarea, [tabindex]")??r).focus)==null||n.call(t))}},Rc=r=>{const{message:e,title:t,mode:n="confirm",type:a="info",confirmButtonText:i,cancelButtonText:o,onConfirm:s,onCancel:l,cascade:u,confirmButtonStyle:c,cancelButtonStyle:f}=r||{},h=document.querySelector("body");if(!h){console.error('Modal root element with id "#modal" not found!');return}const p=document.createElement("div");h.appendChild(p);const g=()=>{p.remove()};d.createApp({render(){return d.h(Cp,{title:t,message:e,mode:n,type:a,cascade:u,confirmButtonText:i,cancelButtonText:o,cancelButtonStyle:f,confirmButtonStyle:c,modelValue:!0,onConfirm:()=>{s==null||s(),g()},onCancel:()=>{l==null||l(),g()}})}}).mount(p)};function AR(r={}){return Object.assign(r,{mode:"alert"}),Rc(r)}function Que(r={}){return Object.assign(r,{mode:"prompt"}),Rc(r)}let MR=!1;const NR=d.reactive({visible:!0}),P1=(r,e)=>{if(e&&setTimeout(()=>P1(!1),e),!MR){const t=document.querySelector("body");if(!t){console.error('Modal root element with id "#modal" not found!');return}const n=document.createElement("div");t.appendChild(n),d.createApp({render(){return d.h(R1,NR)}}).mount(n),MR=!0}NR.visible=r},O1=r=>{const{template:e="",title:t="",content:n,contentProps:a={},size:i="medium"}=r||{},o=document.querySelector("body");if(!o)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const s=document.createElement("div");o.appendChild(s);const l={title:t,template:e,visible:!0,size:i,closeClickBack:!0,onClose:c},u=d.createApp({render(){return d.h(xl,l,{default:()=>[n?d.h(n,a):d.h("p",e)]})}});function c(){u.unmount(),s.remove()}return u.mount(s),{close:c}};function Jue(r){return{all:r=r||new Map,on:function(e,t){var n=r.get(e);n?n.push(t):r.set(e,[t])},off:function(e,t){var n=r.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):r.set(e,[]))},emit:function(e,t){var n=r.get(e);n&&n.slice().map(function(a){a(t)}),(n=r.get("*"))&&n.slice().map(function(a){a(e,t)})}}}const LR=Jue(),ece=async r=>{const{api:e,method:t,confirm:{title:n,text:a,cancel:i,confirm:o}}=r;Rc({cascade:!1,confirmButtonStyle:"",cancelButtonStyle:"",message:a,title:n,mode:"confirm",type:"error",confirmButtonText:o,cancelButtonText:i,onConfirm:async()=>{await fetch(e,{method:t,headers:{"Content-Type":"application/json"}}),LR.emit("methodApi",t)}})},tce=Object.freeze(Object.defineProperty({__proto__:null,Copy:V1,Lightbox:I1,LoadingDirective:DR,MessageBox:Cp,TooltipDirective:TR,VsBadgeValue:yse,VsButton:gR,VsConfirm:wR,VsDataValue:vR,VsDrawer:xR,VsGridGallery:yR,VsLoading:R1,VsModal:xl,VsNotify:B1,VsPagination:ER,VsPopover:_R,VsSlider:CR,VsSwitch:bR,alert:AR,confirm:Rc,default:{install:r=>{r.component("VsButton",gR),r.component("VsGridGallery",yR),r.component("Lightbox",I1),r.component("VsDataValue",vR),r.component("VsSwitch",bR),r.component("VsCopy",V1),r.component("Copy",V1),r.component("VsPopover",_R),r.component("VsConfirm",wR),r.component("MessageBox",Cp),r.component("VsModal",xl),r.component("VsDialog",xl),r.component("VsDrawer",xR),r.component("VsNotify",B1),r.component("VsLoading",R1),r.component("VsPagination",ER),r.component("VsSlider",CR),r._context.directives.tooltip||r.directive("tooltip",TR),r._context.directives.loading||r.directive("loading",DR),r.directive("focus",Kue),Object.assign(r.config.globalProperties,{$loading:P1,$modal:O1,$notify:pt,$confirm:Rc,$alert:AR,$api:ece})}},emitter:LR,loading:P1,modal:O1,notify:pt,prompt:Que},Symbol.toStringTag,{value:"Module"})),IR=d.defineComponent({__name:"vs-info-tooltip",props:{text:{}},setup(r){const e=r,t=d.ref(!1),n=d.ref({top:"0px",left:"0px"});function a(o){if(!e.text)return;const s=o.currentTarget.getBoundingClientRect();n.value={top:`${s.bottom+4}px`,left:`${Math.min(s.left,window.innerWidth-230)}px`},t.value=!0}function i(){t.value=!1}return(o,s)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("span",{class:"inline-flex items-center",onMouseenter:a,onMouseleave:i},[d.renderSlot(o.$slots,"default",{},()=>[s[0]||(s[0]=d.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:"text-gray-400 cursor-help"},[d.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),d.createElementVNode("path",{d:"M12 16v-4"}),d.createElementVNode("path",{d:"M12 8h.01"})],-1))])],32),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[t.value&&o.text?(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(n.value),class:"fixed z-[9999] max-w-xs p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"},d.toDisplayString(o.text),5)):d.createCommentVNode("",!0)]))],64))}}),rce={class:"w-full relative"},nce={key:0,class:"text-[14px] font-medium text-gray-900 mb-2 flex items-center gap-1"},ace={class:"opacity-100"},ice={key:0,class:"text-red-500 text-[14px]"},oce={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},sce=d.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){const e=r,t=d.computed(()=>{var o,s;return typeof((o=e.item)==null?void 0:o.label)=="string"&&e.item.label?e.item.label:((s=e.item)==null?void 0:s.ua)||e.label||e.ua}),n=d.computed(()=>!!t.value),a=d.computed(()=>{var o,s;return!!((s=(o=e.item)==null?void 0:o.rules)!=null&&s.includes("required"))}),i=d.computed(()=>{var o;return((o=e.item)==null?void 0:o.info)||""});return(o,s)=>(d.openBlock(),d.createElementBlock("div",rce,[n.value?(d.openBlock(),d.createElementBlock("div",nce,[d.createElementVNode("span",ace,d.toDisplayString(t.value),1),a.value?(d.openBlock(),d.createElementBlock("span",ice,"*")):d.createCommentVNode("",!0),i.value?(d.openBlock(),d.createBlock(IR,{key:1,text:i.value},null,8,["text"])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.renderSlot(o.$slots,"default",d.mergeProps(o.$attrs,{class:{"opacity-60":o.item.disabled}})),o.error?(d.openBlock(),d.createElementBlock("span",oce,d.toDisplayString(o.error),1)):d.createCommentVNode("",!0)]))}}),lce={class:"w-full relative flex flex-row items-center gap-2"},uce={key:0,class:"text-red-500 text-[14px]"},cce={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},dce=d.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(r){const e=r,t=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.label)||e.label||e.ua}),n=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.info)||""}),a=d.computed(()=>e.columns??{container:12,label:3}),i=d.computed(()=>{const{container:u,label:c}=a.value;return!u||u<=0?0:Math.min(Math.max(c??0,0),u)/u}),o=d.computed(()=>{var u;return((u=e.item)==null?void 0:u.type)==="html"||i.value<=0?!1:!!t.value}),s=d.computed(()=>{if(!o.value)return{};const u=`${i.value*100}%`;return{flexBasis:u,maxWidth:u}}),l=d.computed(()=>{var p;const{container:u,label:c}=a.value;if(!u||u<=0)return{};if(((p=e.item)==null?void 0:p.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!o.value)return{flexBasis:"100%",maxWidth:"100%"};const f=Math.max(u-Math.max(c??0,0),0)/u;if(!f)return{};const h=`${f*100}%`;return{flexBasis:h,maxWidth:h}});return(u,c)=>{var f,h;return d.openBlock(),d.createElementBlock("div",lce,[o.value?(d.openBlock(),d.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 items-center gap-1",style:d.normalizeStyle(s.value)},[d.createTextVNode(d.toDisplayString(t.value)+" ",1),(h=(f=u.item)==null?void 0:f.rules)!=null&&h.includes("required")&&t.value?(d.openBlock(),d.createElementBlock("span",uce,"*")):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createBlock(IR,{key:1,text:n.value},null,8,["text"])):d.createCommentVNode("",!0)],4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex-1 min-w-0",style:d.normalizeStyle(l.value)},[d.renderSlot(u.$slots,"default",d.normalizeProps(d.guardReactiveProps(u.$attrs)))],4),u.error?(d.openBlock(),d.createElementBlock("span",cce,d.toDisplayString(u.error),1)):d.createCommentVNode("",!0)])}}}),fce={class:"w-full relative"},hce={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},pce=d.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",fce,[d.renderSlot(e.$slots,"default",d.normalizeProps(d.guardReactiveProps(e.$attrs))),e.error?(d.openBlock(),d.createElementBlock("span",hce,d.toDisplayString(e.error),1)):d.createCommentVNode("",!0)]))}}),gce={class:"flex-1 min-w-0"},vce={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},mce={class:"truncate"},yce={key:0,class:"text-red-500 text-[14px]"},bce=["innerHTML"],_ce={key:0,class:"mt-1 text-xs text-red-500"},xce=d.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(r){const e=r,t=d.ref("uk");d.computed(()=>{var s;return((s=e.item??{})==null?void 0:s[t.value])??e.ua??e.label??""});const n=d.computed(()=>{var s;return((s=e.item)==null?void 0:s.description)??""}),a=d.computed(()=>{var s;return Array.isArray((s=e.item)==null?void 0:s.rules)&&e.item.rules.includes("required")}),i=d.computed(()=>(typeof e.error=="string"?e.error:"")??""),o=()=>{const s=typeof localStorage<"u"?localStorage.getItem("locale"):null;t.value=s||"uk"};return d.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(t.value=localStorage.locale)}catch{}window.addEventListener("storage",o)}),d.onUnmounted(()=>{window.removeEventListener("storage",o)}),(s,l)=>{var u;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["w-full relative",{"opacity-60":(u=s.item)==null?void 0:u.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(s.item.type)?"flex flex-col":""]])},[d.createElementVNode("div",gce,[s.ua||s.label?(d.openBlock(),d.createElementBlock("p",vce,[d.createElementVNode("span",mce,d.toDisplayString(s.item[t.value]||s.ua||s.label),1),a.value?(d.openBlock(),d.createElementBlock("span",yce,"*")):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createElementBlock("p",{key:1,class:"text-xs text-slate-500 dark:text-slate-400",innerHTML:n.value},null,8,bce)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:d.normalizeClass(["w-full",["select","native-select"].includes(s.item.type)?"md:w-[30%]":"md:w-auto"])},[d.renderSlot(s.$slots,"default",d.normalizeProps(d.guardReactiveProps(s.$attrs)))],2)],2),i.value?(d.openBlock(),d.createElementBlock("p",_ce,d.toDisplayString(i.value),1)):d.createCommentVNode("",!0)],2)}}}),wce={default:sce,horizontal:dce,inline:pce,settings:xce};function br(r){return{inputClass:d.computed(()=>{const e=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(r==null?void 0:r.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(r==null?void 0:r.size)==="sm"?`${e}h-[32px]`:`${e}h-[38px]`})}}const Sce=["placeholder","disabled"],kce=d.defineComponent({__name:"vs-input-password",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??"");return(o,s)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"password","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:i.value,disabled:a.value,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Sce)),[[d.vModelText,n.value]])}}),Ece=["placeholder","disabled","maxlength","minlength"],wl=d.defineComponent({__name:"vs-input-text",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??""),o=d.computed(()=>e.maxlength??void 0),s=d.computed(()=>e.minlength??void 0);function l(){typeof n.value=="string"&&(n.value=n.value.trim())}return(u,c)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"text","onUpdate:modelValue":c[0]||(c[0]=f=>n.value=f),placeholder:i.value,disabled:a.value,maxlength:o.value,minlength:s.value,onBlur:l,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.customClass,d.unref(t),{"!border-red-600":u.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Ece)),[[d.vModelText,n.value]])}}),Cce=["placeholder","disabled","min","max"],BR=d.defineComponent({__name:"vs-input-number",props:d.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled);return(i,o)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),placeholder:i.placeholder,disabled:a.value,class:d.normalizeClass(["py-1.5 px-3 block w-full bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"},min:i.min,max:i.max},null,10,Cce)),[[d.vModelText,n.value]])}}),Ye=(r,e)=>{const t=r.__vccOpts||r;for(const[n,a]of e)t[n]=a;return t},Tce={},Dce={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 Ace(r,e){return d.openBlock(),d.createElementBlock("svg",Dce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Mce=Ye(Tce,[["render",Ace]]),Nce={class:"flex items-center gap-[4px]"},Lce=["value","id","disabled"],Ice=["for"],Bce={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},Vce=d.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=e,n=r,a=d.computed({get:()=>n.modelValue,set:o=>t("update:modelValue",o)}),i=d.computed(()=>!!n.disabled);return(o,s)=>(d.openBlock(),d.createElementBlock("div",Nce,[d.withDirectives(d.createElementVNode("input",{type:"checkbox",value:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>a.value=l),class:d.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":i.value}]),id:o.id,disabled:i.value},null,10,Lce),[[d.vModelCheckbox,a.value]]),d.createElementVNode("label",{for:o.id,class:d.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":i.value}])},[d.createElementVNode("div",{class:d.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[a.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",o.error?"border-red-600":""]])},[d.createVNode(Mce,{height:"12",width:"12"})],2),d.createElementVNode("span",Bce,[d.renderSlot(o.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(o.label),1)])])],10,Ice)]))}}),Rce=["name","value","disabled"],Pce={class:"flex items-center gap-[6px] text-[14px]"},Oce={key:0,class:"text-[16px]"},zce=["src"],Fce=d.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=d.computed({get:()=>t.modelValue,set:s=>{n("update:modelValue",s)}}),i=d.computed(()=>Array.isArray(a.value)?a.value.includes(t.value):a.value===!0||a.value===t.value),o=d.computed(()=>{var s,l;return((s=t.style)==null?void 0:s.size)==="xs"?"p-1.5 text-xs":((l=t.style)==null?void 0:l.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(s,l)=>(d.openBlock(),d.createElementBlock("label",{class:d.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",[o.value,i.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[d.withDirectives(d.createElementVNode("input",{type:"checkbox",class:"hidden",name:s.id,value:s.value,"onUpdate:modelValue":l[0]||(l[0]=u=>a.value=u),disabled:s.disabled},null,8,Rce),[[d.vModelCheckbox,a.value]]),d.createElementVNode("span",Pce,[s.icon||s.imgUrl?(d.openBlock(),d.createElementBlock("span",Oce,[s.icon?(d.openBlock(),d.createElementBlock("i",{key:0,class:d.normalizeClass(s.icon)},null,2)):d.createCommentVNode("",!0),s.imgUrl?(d.openBlock(),d.createElementBlock("img",{key:1,src:s.imgUrl,width:"16",height:"16",alt:"icon"},null,8,zce)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.renderSlot(s.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(s.label),1)])])],2))}}),$ce={class:"flex items-center"},z1=d.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=`radio-${Math.floor(Math.random()*1e4)}`,i=d.computed({get:()=>Array.isArray(t.modelValue)?Array.isArray(t.modelValue)&&t.modelValue.includes(t.value):t.modelValue,set:s=>{if(Array.isArray(t.modelValue)){let l=[...t.modelValue];s?l.includes(t.value)||l.push(t.value):l=l.filter(u=>u!==t.value),n("update:modelValue",l)}else n("update:modelValue",s)}}),o=d.ref(`vs-checkbox-${t.view||"default"}`);return(s,l)=>{var u;return d.openBlock(),d.createElementBlock("div",$ce,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.value==="vs-checkbox-buttons"?d.unref(Fce):d.unref(Vce)),{value:s.value,label:s.label,info:(u=s.option)==null?void 0:u.info,disabled:s.disabled,modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),id:a,icon:s.icon,imgUrl:s.imgUrl,style:d.normalizeStyle(s.style),error:s.error},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(s.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),Gce={},Uce={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 Hce(r,e){return d.openBlock(),d.createElementBlock("svg",Uce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const F1=Ye(Gce,[["render",Hce]]),Wce={},Yce={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 qce(r,e){return d.openBlock(),d.createElementBlock("svg",Yce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),d.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Dp=Ye(Wce,[["render",qce]]),Zce={},Xce={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 jce(r,e){return d.openBlock(),d.createElementBlock("svg",Xce,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M12 9h.01"},null,-1),d.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),d.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 Kce=Ye(Zce,[["render",jce]]),Qce={key:0,class:"flex items-start gap-x-1"},Jce={key:0,class:"text-red-500 text-[14px]"},ede=["title"],tde=["disabled"],$1=d.defineComponent({__name:"vs-input-switcher",props:d.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue");return(n,a)=>{var i,o;return e.view==="checkbox"?(d.openBlock(),d.createElementBlock("div",Qce,[d.createVNode(z1,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=s=>t.value=s),label:n.text,error:n.error||""},null,8,["modelValue","label","error"]),(i=n.rules)!=null&&i.includes("required")?(d.openBlock(),d.createElementBlock("span",Jce,"*")):d.createCommentVNode("",!0),n.i?(d.openBlock(),d.createElementBlock("button",{key:1,class:"cursor-pointer",title:n.i,onClick:a[1]||(a[1]=d.withModifiers(()=>{},["prevent"]))},[d.createVNode(d.unref(Kce),{class:"text-gray-500 w-[14px] h-[14px]"})],8,ede)):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:d.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-${((o=n.style)==null?void 0:o.primaryColor)||"blue"}-500`:"bg-stone-200",n.customClass]]),disabled:n.disabled,onClick:a[2]||(a[2]=s=>t.value=!t.value)},[d.createElementVNode("span",{"data-state":"checked",class:d.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,tde))}}}),rde=["id","innerHTML"],G1=d.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",{id:e.name,class:d.normalizeClass(["text-gray-900",e.customClass]),innerHTML:e.html?e.html:e.text},null,10,rde))}}),nde=["placeholder","disabled","name"],U1=d.defineComponent({__name:"vs-input-mask",props:d.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.ref(null);let i=null;function o(s){const l={9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},u=new Set;let c=!1;for(let h=0;h<s.length;h+=1){const p=s[h];p==="{"?c=!0:p==="}"?c=!1:c&&u.add(p)}const f={};return Object.keys(l).forEach(h=>{u.has(h)||(f[h]=l[h])}),{mask:s,definitions:f,lazy:!1}}return d.onMounted(async()=>{if(a.value){const{default:s}=await Promise.resolve().then(()=>sx),l=o(e.mask||"");i=s(a.value,l),i.on("accept",()=>{n.value=e.unmask?i.unmaskedValue:i.value}),i.on("complete",()=>{n.value=e.unmask?i.unmaskedValue:i.value}),i.value=n.value!=null?String(n.value):""}}),d.onBeforeUnmount(()=>{i==null||i.destroy()}),d.watch(()=>e.mask,s=>{if(i){const l=o(s||"");i.updateOptions(l)}}),d.watch(n,s=>{i&&i.unmaskedValue!==s&&(i.value=s!=null?String(s):"")}),(s,l)=>(d.openBlock(),d.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:a,placeholder:s.placeholder,disabled:s.disabled,name:s.name,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,10,nde))}}),ade={class:"relative w-full bg-white rounded-lg"},ide=["placeholder","disabled"],H1=d.defineComponent({__name:"vs-input-email",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue");return(a,i)=>(d.openBlock(),d.createElementBlock("div",ade,[i[1]||(i[1]=d.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)),d.withDirectives(d.createElementVNode("input",{type:"email","onUpdate:modelValue":i[0]||(i[0]=o=>n.value=o),placeholder:a.placeholder,disabled:a.disabled,class:d.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ide),[[d.vModelText,n.value]])]))}}),ode={class:"relative w-full bg-white rounded-lg"},sde=["value","placeholder","disabled"],W1=d.defineComponent({__name:"vs-input-tel",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>n.value?n.value.startsWith("+")?n.value.slice(1):n.value:""),i=s=>{let{value:l}=s.target;l=l.replace(/^\+/,""),n.value=l?`+${l}`:""},o=s=>{const l=s,{data:u,inputType:c}=l;c&&c.startsWith("delete")||u&&/\D/.test(u)&&l.preventDefault()};return d.watch(()=>n.value,s=>{s&&!s.startsWith("+")?n.value=`+${s.replace(/^\+/,"")}`:s||(n.value="")},{immediate:!0}),(s,l)=>(d.openBlock(),d.createElementBlock("div",ode,[l[0]||(l[0]=d.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},[d.createElementVNode("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"},[d.createElementVNode("path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"})])],-1)),l[1]||(l[1]=d.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[30px] text-gray-500 select-none pointer-events-none"}," + ",-1)),d.createElementVNode("input",{type:"tel",value:a.value,onInput:i,onBeforeinput:o,pattern:"^\\+[1-9]\\d{1,14}$",maxlength:"15",placeholder:s.placeholder,disabled:s.disabled,class:d.normalizeClass(["!pl-10 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(t),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,sde)]))}}),lde=["value","disabled"],ude={class:"text-[13px] text-gray-700"},cde=d.defineComponent({__name:"vs-input-radio-default",props:d.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>!!e.disabled);return(a,i)=>{var o,s;return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["flex items-center gap-0",[e.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>t.value=l),type:"radio",value:e.value,disabled:n.value,class:"hidden"},null,8,lde),[[d.vModelRadio,t.value]]),d.createElementVNode("span",{class:d.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((o=e.style)==null?void 0:o.primaryColor)||"blue"}-500`,n.value?"opacity-50 cursor-not-allowed":""]])},[t.value==e.value?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((s=e.style)==null?void 0:s.primaryColor)||"blue"}-500`]])},null,2)):d.createCommentVNode("",!0)],2),d.createElementVNode("span",ude,d.toDisplayString(e.text),1)],2)}}}),dde=["value","disabled"],fde={class:"text-[13px] text-gray-700"},hde=d.defineComponent({__name:"vs-input-radio-buttons",props:d.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>!!e.disabled);return(a,i)=>{var o;return d.openBlock(),d.createElementBlock("label",{class:d.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==e.value?`ring-2 ring-ring ring-${((o=e.style)==null?void 0:o.primaryColor)||"blue"}-500`:"",e.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>t.value=s),type:"radio",value:e.value,disabled:n.value,class:"hidden"},null,8,dde),[[d.vModelRadio,t.value]]),d.createElementVNode("span",fde,d.toDisplayString(e.text),1)],2)}}}),pde={"vs-input-radio-default":cde,"vs-input-radio-buttons":hde},Y1=d.defineComponent({__name:"vs-input-radio",props:d.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>pde[`vs-input-radio-${e.view}`]);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([a.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,o=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n.value),d.mergeProps({key:o==null?void 0:o.id,text:o.text,value:o.id.toString(),checked:t.value===o.id,modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=s=>t.value=s)},{ref_for:!0},a.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),gde={key:1,class:"w-full flex flex-col gap-4"},vde={key:0,class:"text-sm font-medium text-muted-foreground my-2"},mde="Без категорії",yde=d.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,a=d.ref([]),i=d.reactive({}),o=p=>(p==null?void 0:p.value)||(p==null?void 0:p.id)||(p==null?void 0:p.text)||p,s=p=>p.text||String(p),l=p=>`lg:col-span-${p||12}`,u=d.computed(()=>[t.position==="vertical"?"flex flex-col":"",t.colSpan?"grid":"flex justify-start"]),c=p=>p==null||p===""?null:typeof p=="string"||typeof p=="number"?p:String(p),f=d.computed(()=>{var b;if(!t.group)return[];const p=new Map;a.value.forEach(_=>{var S;const x=_[t.group],w=c(x);p.has(w)||p.set(w,[]),(S=p.get(w))==null||S.push(_)});const g=[];(b=t.values)!=null&&b.length&&t.values.forEach(_=>{const x=c(_);g.push(x)});const v=new Set,m=_=>{const x=p.get(_)||[];if(!x.length)return null;const w=_===null?"group-null":`group-${String(_)}`,S=_===null?mde:String(_);return v.add(_),{key:w,label:S,options:x}},y=[];return g.forEach(_=>{const x=m(_);x&&y.push(x)}),p.forEach((_,x)=>{if(v.has(x))return;const w=m(x);w&&y.push(w)}),y}),h=async()=>{try{const p=await fetch(`/api/suggest/${t.data}`).then(g=>g.json());a.value=(p==null?void 0:p.data)||p}catch(p){console.error(p)}};return d.watch(()=>t.modelValue,p=>{if(typeof p=="boolean"&&a.value.length===1){const g=o(a.value[0]);i[g]=p}else if(Array.isArray(p)){const g=new Set(p);a.value.forEach(v=>{if(!v.disabled){const m=o(v);i[m]=g.has(m)}})}},{immediate:!0}),d.watch(i,()=>{if(!a.value.length){n("update:modelValue",null);return}const p=Object.entries(i).filter(([,g])=>g).map(([g])=>g);n("update:modelValue",p.length===0?[]:p)},{deep:!0}),d.onMounted(()=>{if(t.data)h().then(()=>{if(typeof t.modelValue=="boolean"&&a.value.length===1){const p=o(a.value[0]);i[p]=t.modelValue}else if(Array.isArray(t.modelValue)){const p=new Set(t.modelValue);a.value.forEach(g=>{if(!g.disabled){const v=o(g);i[v]=p.has(v)}})}});else if(a.value=t.options,typeof t.modelValue=="boolean"&&a.value.length===1){const p=o(a.value[0]);i[p]=t.modelValue}else if(Array.isArray(t.modelValue)){const p=new Set(t.modelValue);a.value.forEach(g=>{if(!g.disabled){const v=o(g);i[v]=p.has(v)}})}}),(p,g)=>t.group?(d.openBlock(),d.createElementBlock("div",gde,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,v=>(d.openBlock(),d.createElementBlock("div",{key:v.key,class:"flex flex-col gap-2"},[v.label?(d.openBlock(),d.createElementBlock("span",vde,d.toDisplayString(v.label),1)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["p-0 w-full gap-[12px]",u.value])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.options,m=>(d.openBlock(),d.createBlock(z1,{modelValue:i[o(m)],"onUpdate:modelValue":y=>i[o(m)]=y,value:o(m),class:d.normalizeClass(l(p.colSpan)),disabled:t.disabled||m.disabled,label:s(m),key:`${v.key}-${o(m)}`,icon:m==null?void 0:m.icon,imgUrl:m==null?void 0:m.imgUrl,option:m,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["p-0 w-full gap-[10px]",u.value])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,v=>(d.openBlock(),d.createBlock(z1,{modelValue:i[o(v)],"onUpdate:modelValue":m=>i[o(v)]=m,value:o(v),class:d.normalizeClass(l(p.colSpan)),disabled:t.disabled||v.disabled,label:s(v),key:o(v),icon:v==null?void 0:v.icon,imgUrl:v==null?void 0:v.imgUrl,option:v,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),VR=Ye(yde,[["__scopeId","data-v-8e66207e"]]),bde=["type","placeholder","disabled"],_de=d.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},mode:{default:"date"}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r;function n(c){return c?t.mode==="datetime"?(c.includes("T")?c:null)||c+(c.includes(" ")?"":"T00:00"):c==null?void 0:c.split(" ")[0]:null}const{inputClass:a}=br(t.style),i=e,o=d.computed({get:()=>n(t.modelValue),set:c=>i("update:modelValue",c)}),s=d.computed(()=>t.mode==="datetime"?"datetime-local":t.mode),l=d.computed(()=>!!t.disabled),u=d.computed(()=>t.placeholder??"");return(c,f)=>d.withDirectives((d.openBlock(),d.createElementBlock("input",{type:s.value,"onUpdate:modelValue":f[0]||(f[0]=h=>o.value=h),placeholder:u.value,disabled:l.value,ref:"date",class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[c.modelValue?"":"text-opacity-50",d.unref(a)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,bde)),[[d.vModelDynamic,o.value]])}}),xde=(r,e)=>{if(!e||!Object.keys(e).length)return r;const[t,n=""]=r.split("?"),a=new URLSearchParams(n);Object.entries(e).forEach(([o,s])=>{s==null||s===""||a.set(o,String(s))});const i=a.toString();return i?`${t}?${i}`:t},RR=async(r,e={})=>{var t;try{const n=new FormData;n.append("unique","true"),n.append("file",r);const{api:a,id:i="1",form:o="form",table:s="table",customParams:l}=e,u=a||`/file/upload/uploads?id=${i||""}&form=${o||""}&table=${s||""}`,c=xde(u,l);return(t=await fetch(c,{method:"POST",body:n}).then(f=>f.json()))==null?void 0:t.result}catch(n){return pt({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",n),null}},wde=async r=>{try{return await fetch(`file/delete${r}`),!0}catch(e){return console.error(e),!1}},PR=async r=>{try{const e=await fetch(`file/download/files/uploads${r}`),t=await e.arrayBuffer(),n=e.headers["content-type"],a=new TextDecoder("utf-8").decode(t),i=new Blob([a],{type:n}),o=document.createElement("a");o.setAttribute("download",r),o.href=window.URL.createObjectURL(i),o.click()}catch(e){console.error(e.message)}},Sde={},kde={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 Ede(r,e){return d.openBlock(),d.createElementBlock("svg",kde,e[0]||(e[0]=[d.createElementVNode("path",{d:"M5 12h14"},null,-1),d.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const da=Ye(Sde,[["render",Ede]]),Cde={},Tde={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 Dde(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Tde,e[0]||(e[0]=[d.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 Ade=Ye(Cde,[["render",Dde]]),Mde={},Nde={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 Lde(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Nde,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),d.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),d.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const Ide=Ye(Mde,[["render",Lde]]),Bde={},Vde={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 Rde(r,e){return d.openBlock(),d.createElementBlock("svg",Vde,e[0]||(e[0]=[d.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="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const OR=Ye(Bde,[["render",Rde]]),Pde={},Ode={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 zde(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Ode,e[0]||(e[0]=[d.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 Fde=Ye(Pde,[["render",zde]]),$de={},Gde={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 Ude(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("svg",Gde,e[0]||(e[0]=[d.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 Hde=Ye($de,[["render",Ude]]),Wde=r=>{if(!r)return"";const e=r==null?void 0:r.split(".");return e[e.length-1]},Yde=r=>{const e=Wde(r),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)?Ide:t.textsFormat.includes(e)?Hde:t.documentsFormat.includes(e)?Ade:t.archivesFormat.includes(e)?Fde:OR},qde={},Zde={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 Xde(r,e){return d.openBlock(),d.createElementBlock("svg",Zde,e[0]||(e[0]=[d.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 Sl=Ye(qde,[["render",Xde]]),jde={},Kde={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 Qde(r,e){return d.openBlock(),d.createElementBlock("svg",Kde,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const zR=Ye(jde,[["render",Qde]]),Jde=["title"],efe={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},tfe=d.defineComponent({__name:"vs-input-file-list-item",props:d.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(r){const e=d.useModel(r,"value"),t=d.useModel(r,"item"),n=r;return(a,i)=>(d.openBlock(),d.createElementBlock("div",{title:t.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(Yde)(t.value)),{src:t.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:i[0]||(i[0]=o=>d.unref(PR)(t.value))},null,8,["src"])),d.createElementVNode("div",efe,[d.createElementVNode("button",{type:"button",onClick:i[1]||(i[1]=o=>{var s;d.unref(wde)(t.value),e.value=n.multiple?(s=e.value)==null?void 0:s.filter(l=>l!==t.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[d.createVNode(Sl,{class:"w-4 h-4"})]),d.createElementVNode("button",{type:"button",onClick:i[2]||(i[2]=o=>d.unref(PR)(t.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[d.createVNode(zR,{class:"w-4 h-4"})])])],8,Jde))}}),q1=Ye(tfe,[["__scopeId","data-v-286cdbc0"]]),rfe={class:"flex items-center gap-x-2"},nfe=["accept","multiple","disabled"],afe={key:1,class:"flex items-center flex-wrap gap-2"},ife={key:1,class:"loader"},ofe={key:1,class:"loader"},sfe=d.defineComponent({__name:"vs-input-file",props:d.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{},modelModifiers:{}}),emits:d.mergeModels(["change"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=d.useModel(r,"modelValue"),a=e,i=d.ref(null),o=d.ref(!1),s=d.inject("values"),l=d.computed(()=>t.format?t.format.split(",").map(b=>b.trim().toLowerCase()).filter(Boolean):[]),u=b=>Array.isArray(n.value)&&n.value[b]||"",c=b=>{if(t.max_size&&b.size>t.max_size*1024*1024){const _=(b.size/1048576).toFixed(2);return pt({type:"error",title:"Помилка!",message:`Файл "${b.name}" занадто великий. Максимальний розмір: ${t.max_size} МБ, розмір файлу: ${_} МБ`,position:"right-bottom"}),!1}return!0},f=b=>{var w;if(!l.value.length)return!0;const _=`.${((w=b.name.split(".").pop())==null?void 0:w.toLowerCase())||""}`,x=l.value.includes(_);return x||pt({type:"error",title:"Помилка!",message:`Неприпустимий формат файлу "${b.name}". Дозволені формати: ${l.value.join(", ")}`,position:"right-bottom"}),x},h=d.computed(()=>{var w;const b={},_=[];if(!((w=t.customParams)!=null&&w.length))return{params:b,missingSources:_};const x=(s==null?void 0:s.value)??{};return t.customParams.forEach(S=>{if(!S)return;const[k,E]=S.split("="),C=k==null?void 0:k.trim(),T=E==null?void 0:E.trim();if(!C||!T)return;const D=x[T];if(D==null||D===""){_.push(T);return}b[C]=D}),{params:b,missingSources:_}}),p=()=>{const{params:b}=h.value;return{api:t.api,customParams:Object.keys(b).length?b:void 0}},g=()=>{const b=h.value.missingSources;if(!b.length)return!0;const _=b.join(", ");return pt({type:"warning",title:"Заповніть поля",message:`Поля (${_}) необхідні для завантаження файлу`,position:"right-bottom"}),!1},v=b=>{pt({type:"error",title:"Помилка завантаження",message:b||"Не вдалося завантажити файл. Спробуйте ще раз.",position:"right-bottom"})},m=()=>{var b;t.disabled||o.value||g()&&((b=i.value)==null||b.click())},y=async b=>{const{files:_}=b.target;if(!_||_.length===0)return;if(!g()){i.value&&(i.value.value="");return}const x=Array.from(_);if(t.max_size&&x.filter(w=>!c(w)).length>0){i.value&&(i.value.value="");return}if(x.filter(w=>!f(w)).length>0){i.value&&(i.value.value="");return}o.value=!0;try{if(t.multiple){const w=Array.from(_).map(async E=>await RR(E,p())),S=await Promise.all(w),k=S.filter(E=>E!==null).map(E=>E==null?void 0:E.file_path).filter(Boolean);if(k.length===0){v();return}k.length<S.length&&v("Деякі файли не вдалося завантажити. Перевірте їх та спробуйте знову."),n.value=[...n.value||[],...k],a("change",n.value)}else{const w=_[0],S=await RR(w,p());if(!(S!=null&&S.file_path)){v();return}n.value=S==null?void 0:S.file_path,a("change",n.value||"")}}catch(w){const S=(w==null?void 0:w.message)||void 0;v(S)}finally{o.value=!1,i.value&&(i.value.value="")}};return(b,_)=>(d.openBlock(),d.createElementBlock("div",rfe,[d.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:i,type:"file",accept:t.format,multiple:b.multiple,onChange:y,disabled:o.value||b.disabled},null,40,nfe),!b.multiple&&n.value?(d.openBlock(),d.createBlock(q1,{key:0,item:n.value,"onUpdate:item":_[0]||(_[0]=x=>n.value=x),value:n.value,"onUpdate:value":_[1]||(_[1]=x=>n.value=x)},null,8,["item","value"])):b.multiple?(d.openBlock(),d.createElementBlock("div",afe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(x,w)=>(d.openBlock(),d.createBlock(q1,{multiple:b.multiple,key:w,value:n.value,"onUpdate:value":_[2]||(_[2]=S=>n.value=S),item:u(w)},null,8,["multiple","value","item"]))),128)),d.createElementVNode("div",{onClick:m,class:d.normalizeClass(["relative 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",b.disabled||o.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[o.value?(d.openBlock(),d.createElementBlock("div",ife)):(d.openBlock(),d.createBlock(da,{key:0,class:"w-6 h-6"}))],2)])):d.createCommentVNode("",!0),b.multiple?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:2,onClick:m,class:d.normalizeClass([b.disabled||o.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative 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"])},[o.value?(d.openBlock(),d.createElementBlock("div",ofe)):(d.openBlock(),d.createBlock(da,{key:0,class:"w-6 h-6"}))],2))]))}}),FR=Ye(sfe,[["__scopeId","data-v-cf6efbaa"]]),lfe={class:"vs-input-file2 flex flex-col gap-4"},ufe={class:"flex items-center gap-x-2"},cfe=["accept","disabled"],dfe={key:0,class:"absolute inset-0 flex flex-col items-center justify-center gap-1 rounded-lg bg-white/90 text-xs font-medium text-slate-600"},ffe={key:0,class:"rounded-lg border border-[#CFD9E0] bg-white p-4 shadow-sm"},hfe={class:"flex items-center justify-between text-sm"},pfe={class:"truncate pr-4"},gfe={class:"font-medium text-slate-800 truncate"},vfe={class:"text-slate-500"},mfe={class:"text-slate-500 whitespace-nowrap"},yfe={class:"mt-3 h-2 rounded-full bg-slate-100 overflow-hidden"},bfe={class:"mt-3 flex flex-wrap gap-2 text-sm"},_fe={key:0,class:"mt-2 text-sm text-rose-600"},xfe=d.defineComponent({__name:"vs-input-file2",props:d.mergeModels({format:{},max_size:{},api:{},chunkSize:{default:5*1024*1024},subdir:{default:""},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(null),a=d.ref(null),i=d.ref(""),o=d.ref(0),s=d.ref(!1),l=d.ref(""),u=d.ref(null),c=d.inject("values"),f=d.computed(()=>e.format?e.format.split(",").map(A=>A.trim().toLowerCase()).filter(Boolean):[]),h=d.computed(()=>!a.value||!a.value.size?0:Math.min(100,Math.round(o.value/a.value.size*100))),p=d.computed(()=>a.value?`${m(o.value)} / ${m(a.value.size)}`:""),g=d.computed(()=>e.disabled?"opacity-50 cursor-not-allowed":s.value?"cursor-default text-blue-500":"cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"),v=()=>{var A;e.disabled||s.value||x()&&((A=n.value)==null||A.click())},m=A=>{if(!Number.isFinite(A))return"0 B";const I=["B","KB","MB","GB"];let L=0,B=A;for(;B>=1024&&L<I.length-1;)B/=1024,L+=1;return`${B.toFixed(L===0?0:1)} ${I[L]}`},y=A=>{if(!e.max_size)return!0;const I=e.max_size*1024*1024;return A.size>I?(pt({type:"error",title:"Файл занадто великий",message:`Максимальний розмір ${e.max_size} МБ`,position:"right-bottom"}),!1):!0},b=A=>{var L;if(!f.value.length)return!0;const I=`.${((L=A.name.split(".").pop())==null?void 0:L.toLowerCase())||""}`;return f.value.includes(I)?!0:(pt({type:"error",title:"Непідтримуваний формат",message:`Дозволені формати: ${f.value.join(", ")}`,position:"right-bottom"}),!1)},_=d.computed(()=>{var B;const A={},I=[];if(!((B=e.customParams)!=null&&B.length))return{params:A,missing:I};const L=(c==null?void 0:c.value)??{};return e.customParams.forEach(N=>{if(!N)return;const[V,R]=N.split("="),F=V==null?void 0:V.trim(),G=R==null?void 0:R.trim();if(!F||!G)return;const z=L[G];z==null||z===""?I.push(G):A[F]=z}),{params:A,missing:I}}),x=()=>_.value.missing.length?(pt({type:"warning",title:"Заповніть поля",message:`Потрібні значення: ${_.value.missing.join(", ")}`,position:"right-bottom"}),!1):!0,w=A=>{var B;const I=A.target,L=(B=I.files)==null?void 0:B[0];if(L){if(!x()){I.value="";return}if(!y(L)||!b(L)){I.value="";return}a.value=L,o.value=0,i.value="",l.value=""}},S=async()=>{if(!a.value){v();return}try{l.value="";const A={id:i.value||"",fileName:a.value.name,subdir:e.subdir,size:a.value.size,..._.value.params},I=await fetch("/api/file/upload2/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(!I.ok)throw new Error("Не вдалося ініціалізувати завантаження");const L=await I.json();i.value=L.id||i.value,o.value=L.uploaded||0,await k()}catch(A){l.value=(A==null?void 0:A.message)||"Помилка при старті завантаження"}},k=async()=>{if(!(!a.value||!i.value)){s.value=!0;try{for(;o.value<a.value.size;){const A=o.value,I=Math.min(A+e.chunkSize,a.value.size),L=a.value.slice(A,I);u.value=new AbortController;const B=await fetch(`/api/file/upload2/${i.value}`,{method:"PATCH",headers:{"Content-Range":`bytes ${A}-${I-1}/${a.value.size}`},body:L,signal:u.value.signal});if(!B.ok)throw new Error("Помилка завантаження частини");const N=await B.json().catch(()=>({}));if(N.uploaded!=null?o.value=Number(N.uploaded):o.value=I,N.finished||o.value>=a.value.size){s.value=!1,t.value=N.file_path||N.url||i.value,pt({type:"success",title:"Файл завантажено",message:a.value.name,position:"right-bottom"}),D();return}}}catch(A){if((A==null?void 0:A.name)==="AbortError")return;l.value=(A==null?void 0:A.message)||"Помилка при завантаженні",s.value=!1}finally{u.value=null,s.value=!1}}},E=()=>{var A;s.value&&((A=u.value)==null||A.abort(),u.value=null,s.value=!1)},C=async()=>{if(a.value){if(!i.value){await S();return}await k()}},T=()=>{var A;(A=u.value)==null||A.abort(),u.value=null,D()},D=()=>{const A=n.value;A&&(A.value=""),a.value=null,i.value="",o.value=0,l.value=""};return(A,I)=>{var L;return d.openBlock(),d.createElementBlock("div",lfe,[d.createElementVNode("div",ufe,[d.createElementVNode("input",{ref_key:"fileInput",ref:n,type:"file",class:"hidden",accept:e.format,disabled:s.value||e.disabled,onChange:w},null,40,cfe),t.value?(d.openBlock(),d.createBlock(q1,{key:0,item:t.value,"onUpdate:item":I[0]||(I[0]=B=>t.value=B),value:t.value,"onUpdate:value":I[1]||(I[1]=B=>t.value=B)},null,8,["item","value"])):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:v,class:d.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",g.value])},[s.value?(d.openBlock(),d.createElementBlock("div",dfe,[I[2]||(I[2]=d.createElementVNode("div",{class:"loader"},null,-1)),d.createElementVNode("span",null,d.toDisplayString(h.value)+"%",1)])):(d.openBlock(),d.createBlock(da,{key:1,class:"w-6 h-6"}))],2))]),a.value&&!t.value?(d.openBlock(),d.createElementBlock("div",ffe,[d.createElementVNode("div",hfe,[d.createElementVNode("div",pfe,[d.createElementVNode("div",gfe,d.toDisplayString(a.value.name),1),d.createElementVNode("div",vfe,d.toDisplayString(m(a.value.size)),1)]),d.createElementVNode("div",mfe,d.toDisplayString(p.value),1)]),d.createElementVNode("div",yfe,[d.createElementVNode("div",{class:"h-full rounded-full bg-blue-500 transition-all duration-300",style:d.normalizeStyle({width:`${h.value}%`})},null,4)]),d.createElementVNode("div",bfe,[!s.value&&o.value>0&&o.value<(((L=a.value)==null?void 0:L.size)||0)?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:C}," Resume ")):d.createCommentVNode("",!0),s.value?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:E}," Pause ")):d.createCommentVNode("",!0),!s.value&&o.value===0?(d.openBlock(),d.createElementBlock("button",{key:2,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:S}," Upload ")):d.createCommentVNode("",!0),d.createElementVNode("button",{type:"button",class:"rounded border border-rose-200 px-3 py-1 text-rose-600",onClick:T}," Cancel ")]),l.value?(d.openBlock(),d.createElementBlock("p",_fe,d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])}}}),Z1=Ye(xfe,[["__scopeId","data-v-ea9f874f"]]),wfe={class:"max-w-[55vw]"},Sfe={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},kfe={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Efe={class:"px-[5px]"},Cfe={class:""},Ap=d.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(r){const e=r,t=d.computed(()=>{try{return new Date(e.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function n(a){if(a<1024)return`${a} B`;const i=a/1024;return i<1024?`${i.toFixed(2)} KB`:`${(i/1024).toFixed(2)} MB`}return(a,i)=>{var o,s,l,u;return d.openBlock(),d.createElementBlock(d.Fragment,null,[i[1]||(i[1]=d.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)),d.createElementVNode("div",wfe,[d.createElementVNode("p",Sfe,d.toDisplayString((o=a.item)==null?void 0:o.uploaded_name),1),d.createElementVNode("p",kfe,[d.createElementVNode("span",null,d.toDisplayString((s=a.item)==null?void 0:s.username),1),d.withDirectives(d.createElementVNode("span",Efe,"|",512),[[d.vShow,(l=a.item)==null?void 0:l.username]]),d.createElementVNode("span",null,d.toDisplayString(t.value),1),i[0]||(i[0]=d.createElementVNode("span",{class:"px-[5px]"},"|",-1)),d.createElementVNode("span",Cfe,d.toDisplayString(n((u=a.item)==null?void 0:u.size)),1)])])],64)}}}),Tfe={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Dfe={key:0,class:"flex w-full gap-x-3 items-center"},Afe={key:1,class:"flex gap-x-3 w-full items-center"},Mfe={key:2,class:"flex gap-x-3 w-full items-center"},Nfe=["href"],Lfe={key:3,class:"flex gap-x-3 w-full items-center"},Ife={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},Bfe={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"},Vfe={class:"inline-block"},Rfe={class:"inline-block"},Pfe=d.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(r,{emit:e}){const t=r,n=e;function a(c){return["pdf","json"].includes(c.ext)}function i(c){return["ppt","pptx","doc","docx","xls","xlsx"].includes(c.ext)}function o(c){const f=document.createElement("a");f.setAttribute("download",c==null?void 0:c.uploaded_name),f.href=c==null?void 0:c.file_path,f.click()}async function s(){try{await fetch(`${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`),n("update")}catch(c){console.error(c)}}function l(){n("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:s,updateListOnConfirm:!0})}function u(c){(t.item.ext==="jpg"||t.item.ext==="png")&&n("openLightbox",{item:t.item,index:c})}return(c,f)=>(d.openBlock(),d.createElementBlock("div",Tfe,[c.item.ext==="jpg"||c.item.ext==="png"?(d.openBlock(),d.createElementBlock("div",Dfe,[d.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:f[0]||(f[0]=h=>u(c.index))},[d.createVNode(Ap,{item:c.item},null,8,["item"])])])):a(c.item)?(d.openBlock(),d.createElementBlock("div",Afe,[d.createVNode(Ap,{item:c.item},null,8,["item"])])):i(c.item)?(d.openBlock(),d.createElementBlock("div",Mfe,[d.createElementVNode("a",{href:`/api/file-preview?id=${c.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[d.createVNode(Ap,{item:c.item},null,8,["item"])],8,Nfe)])):(d.openBlock(),d.createElementBlock("div",Lfe,[d.createVNode(Ap,{item:c.item},null,8,["item"])])),d.createElementVNode("div",Ife,[d.createElementVNode("div",Bfe,[d.createElementVNode("div",Vfe,[d.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:f[1]||(f[1]=h=>o(c.item))},[d.createVNode(zR,{height:"14",width:"14"})])]),f[3]||(f[3]=d.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),d.createElementVNode("div",Rfe,[d.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:f[2]||(f[2]=h=>l())},[d.createVNode(Sl,{height:"14",width:"14"})])])])])]))}}),Ofe={},zfe={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 Ffe(r,e){return d.openBlock(),d.createElementBlock("svg",zfe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const $fe=Ye(Ofe,[["render",Ffe]]),Gfe={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},Ufe={class:"flex w-full mb-[12px] items-center gap-x-2"},Hfe={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},Wfe={class1:"ml-auto"},Yfe={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"},qfe={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},Zfe={class:"relative"},Xfe={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"},jfe={key:0},$R=d.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update"],setup(r,{emit:e}){const t=r,n=d.inject("form"),a=d.computed(()=>n.value.formId),i=d.ref(!1),o=d.ref(0),s=e,l=d.ref(!1),u=d.ref({}),c=d.ref([]),f=d.ref(""),h=d.computed(()=>Array.isArray(c.value)?c.value.filter(_=>_.ext==="jpg"||_.ext==="png").map(_=>_==null?void 0:_.file_path):[]),p=d.computed(()=>f.value===""?c.value:c.value.filter(_=>{var x;return(x=_==null?void 0:_.uploaded_name)==null?void 0:x.includes(f.value)})),g=_=>{const x=h.value.findIndex(w=>w===_.item.file_path);x!==-1&&(i.value=!0,o.value=x)},v=async()=>{try{const _=await fetch(`${t.prefix}/widget/file/${a.value}`).then(x=>x.json());c.value=_==null?void 0:_.rows}catch(_){console.error(_)}},m=async _=>{await Promise.all(Array.from(_.target.files).map(async x=>{const w=new FormData;w.append("file",x);try{const S=`${t.prefix}/widget/file/${a.value}`,k=await fetch(S,{method:"POST",body:w});return k.ok?(s("update","file-list"),x):(pt({type:k.status>=400&&k.status<500?"warning":"error",title:"Error",message:`Error code: ${k.status}`}),null)}catch(S){return pt({type:"error",title:"Error",message:S.message||"Unknown error"}),console.error(S),null}})),await v()},y=_=>{const x={..._};return _.cancel||(x.cancel=()=>{l.value=!1}),_.updateListOnConfirm&&(x.confirm=async()=>{await _.confirm(),l.value=!1,v()}),x},b=_=>{u.value=y(_),l.value=!0};return d.watch(a,_=>{_&&v()}),d.onMounted(()=>{a.value&&v()}),(_,x)=>{var k,E,C;const w=d.resolveComponent("Lightbox"),S=d.resolveComponent("MessageBox");return d.openBlock(),d.createElementBlock("div",Gfe,[d.createElementVNode("div",Ufe,[d.createElementVNode("h2",Hfe," Файлів: "+d.toDisplayString((k=c.value)==null?void 0:k.length),1),d.createElementVNode("div",Wfe,[d.createElementVNode("label",null,[d.createElementVNode("input",{type:"file",class:"hidden",onChange:x[0]||(x[0]=T=>m(T))},null,32),d.createElementVNode("div",Yfe,[d.createVNode($fe,{height:"16",width:"16"})])])])]),((E=c.value)==null?void 0:E.length)>4?(d.openBlock(),d.createElementBlock("div",qfe,[d.createElementVNode("div",null,[d.createElementVNode("div",Zfe,[x[8]||(x[8]=d.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[d.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"},[d.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),d.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":x[1]||(x[1]=T=>f.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),[[d.vModelText,f.value,void 0,{trim:!0}]])])])])):d.createCommentVNode("",!0),(C=c.value)!=null&&C.length?(d.openBlock(),d.createElementBlock("div",Xfe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,(T,D)=>(d.openBlock(),d.createBlock(Pfe,{key:D,prefix:_.prefix,item:T,index:D,onUpdate:x[2]||(x[2]=A=>_.$emit("update","file-list")),onOpenModal:x[3]||(x[3]=A=>b(A)),onOpenLightbox:x[4]||(x[4]=A=>g(A))},null,8,["prefix","item","index"]))),128)),p.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",jfe,x[9]||(x[9]=[d.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):d.createCommentVNode("",!0),d.createVNode(w,{modelValue:i.value,"onUpdate:modelValue":x[5]||(x[5]=T=>i.value=T),startIndex:o.value,"onUpdate:index":x[6]||(x[6]=T=>o.value=T),images:h.value},null,8,["modelValue","startIndex","images"]),d.createVNode(S,d.mergeProps({modelValue:l.value,"onUpdate:modelValue":x[7]||(x[7]=T=>l.value=T),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),Kfe={class:"flex items-center justify-between"},Qfe={class:"text-[16px] text-gray-900 font-medium"},Jfe={class:"grid gap-3"},ehe=d.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(r){const e=r,t=d.ref(e.isOpen);return d.watch(()=>e.isOpen,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",Kfe,[d.createElementVNode("p",Qfe,d.toDisplayString(r.title),1),d.createVNode($1,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=i=>t.value=i),style:d.normalizeStyle(r.style)},null,8,["modelValue","style"])]),d.createVNode(d.Transition,{name:"slide-fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",Jfe,[d.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[d.vShow,t.value]])]),_:3})]))}}),the=Ye(ehe,[["__scopeId","data-v-90320b87"]]),rhe={class:"text-[16px] text-gray-900 font-medium"},nhe={class:"grid gap-3"},ahe=d.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(r){const e=r,t=d.ref(e.isOpen);return d.watch(()=>e.isOpen,n=>{t.value=n}),(n,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("button",{type:"button",onClick:a[0]||(a[0]=i=>t.value=!t.value),class:"flex items-center gap-2"},[d.createVNode(d.unref(F1),{class:d.normalizeClass(["h-4 w-4 duration-300",[t.value?"-rotate-180":""]])},null,8,["class"]),d.createElementVNode("span",rhe,d.toDisplayString(r.title),1)]),d.createVNode(d.Transition,{name:"slide-fade"},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",nhe,[d.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[d.vShow,t.value]])]),_:3})]))}}),ihe=Ye(ahe,[["__scopeId","data-v-590eff11"]]),ohe={class:"flex items-center justify-between"},she=d.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(r){return(e,t)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",ohe,[d.createElementVNode("p",null,d.toDisplayString(r.title),1)]),d.renderSlot(e.$slots,"default")]))}}),lhe={switcher:the,accordion:ihe,default:she},wn={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},uhe=(r,e)=>String(r)===String(e),che=(r,e)=>String(r)!==String(e),dhe=(r,e)=>r>e,fhe=(r,e)=>r>=e,hhe=(r,e)=>r<e,phe=(r,e)=>r<=e,ghe=(r,e)=>Array.isArray(e)&&e.length===2?r>=e[0]&&r<=e[1]:!1,vhe=(r,e)=>String(r).startsWith(String(e)),mhe=(r,e)=>String(r).endsWith(String(e)),yhe=(r,e)=>String(r).includes(String(e)),bhe=(r,e)=>Array.isArray(e)?e.includes(r):!1,_he=(r,e)=>Array.isArray(e)?!e.includes(r):!0,GR=(r,e)=>{if(!e)return!0;switch(e==null?void 0:e[1]){case wn.Equal:return uhe(r,e==null?void 0:e[2]);case wn.Inequal:return che(r,e==null?void 0:e[2]);case wn.Higer:return dhe(r,e==null?void 0:e[2]);case wn.HigerOrEqual:return fhe(r,e==null?void 0:e[2]);case wn.Lower:return hhe(r,e==null?void 0:e[2]);case wn.LowerOrEqual:return phe(r,e==null?void 0:e[2]);case wn.Between:return ghe(r,e==null?void 0:e[2]);case wn.StartWith:return vhe(r,e==null?void 0:e[2]);case wn.EndWith:return mhe(r,e==null?void 0:e[2]);case wn.Contain:return yhe(r,e==null?void 0:e[2]);case wn.In:return bhe(r,e==null?void 0:e[2]);case wn.NotIn:return _he(r,e==null?void 0:e[2]);default:return!0}},UR=d.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(r){const e=r,t=d.inject("values",d.ref({})),n=d.inject("form"),a=d.computed(()=>{var s;return(s=e.schema)==null?void 0:s.filter(l=>{var h,p,g,v;const u=l==null?void 0:l.conditions;if(!u)return!0;const c=Array.isArray(u)?u[0]:u,f=e.name?((p=(h=t.value)==null?void 0:h[e.name])==null?void 0:p[c])??((g=t.value)==null?void 0:g[c]):(v=t.value)==null?void 0:v[c];return GR(f,u)})}),i=d.computed(()=>lhe[e.view]),o=d.computed(()=>{if(t.value||(t.value={}),!e.name)return t.value;const s=t.value[e.name];if(s)return s;const l={};return t.value={...t.value,[e.name]:l},l});return(s,l)=>{var u;return(u=r.schema)!=null&&u.length?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i.value),{key:0,title:r.title,style:d.normalizeStyle(r.style)},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>{var f,h;return d.openBlock(),d.createBlock(aP,d.mergeProps({key:c.name},{ref_for:!0},c,{item:c,modelValue:o.value[c.name],"onUpdate:modelValue":p=>o.value[c.name]=p,style:r.style,error:(h=(f=d.unref(n))==null?void 0:f.errors)==null?void 0:h[c.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):d.createCommentVNode("",!0)}}}),xhe=["aria-expanded","data-focus"],whe={class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full"},She={key:0,class:"flex flex-nowrap items-center gap-1 overflow-x-auto overflow-y-hidden min-w-0 flex-1 py-0.5"},khe={class:"flex items-center min-w-0"},Ehe=["title"],Che=["innerHTML"],The=["onClick"],Dhe={class:"flex-1 min-w-[2px]"},Ahe=["placeholder"],Mhe=["title"],Nhe=["innerHTML"],Lhe={key:2,class:"flex-1 min-w-[2px]"},Ihe=["placeholder"],Bhe={class:"flex items-center shrink-0"},Vhe=["disabled"],Rhe=["disabled","title"],Phe=["aria-disabled","onClick"],Ohe=["innerHTML"],zhe={key:1,class:"px-3 py-2 text-center text-gray-500"},Fhe=["disabled"],X1=d.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},start:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{},maxlength:{},minlength:{}},emits:["change","update:modelValue","value-selected"],setup(r,{emit:e}){const t=r,n=e,a=d.computed(()=>t.multiple),i=d.computed(()=>t.disabled);br(t.style);const o=d.computed({get:()=>t.modelValue,set:ee=>n("update:modelValue",ee)});!o.value&&t.defaultValue&&(o.value=t.defaultValue);const s=d.ref(null),l=d.ref(null),u=d.ref(null),c=d.ref(null),f=d.ref(!1),h=d.ref(!1),p=d.ref(null),g=d.ref([]),v=d.ref(-1),m=d.ref([]),y=d.ref(""),b=d.ref(null),_=d.ref("bottom"),x=d.ref({}),w=d.ref([]),S=d.computed(()=>{if(!w.value.length)return[];const ee=g.value,ie=new Map(ee.map(de=>{var Me;return[(Me=de.id)==null?void 0:Me.toString(),de]}));return w.value.map(de=>ie.get(de==null?void 0:de.toString())).filter(de=>!!de)}),k=d.computed(()=>t.placeholder||"Select..."),E=d.computed(()=>R(p.value));d.computed(()=>a.value?!w.value.length&&y.value==="":!E.value&&y.value==="");const C=d.computed(()=>i.value?!1:a.value?w.value.length>0:!!o.value),T=ee=>{var ie;return a.value?w.value.some(de=>(de==null?void 0:de.toString())===(ee==null?void 0:ee.toString())):((ie=o.value)==null?void 0:ie.toString())===(ee==null?void 0:ee.toString())},D=d.computed(()=>{let ee=g.value??[];if(!t.data&&y.value.trim()!==""){const ie=y.value.toLowerCase();ee=ee.filter(de=>{var O,J;const Me=R(de).toLowerCase(),P=((J=(O=de.text)==null?void 0:O.toLowerCase)==null?void 0:J.call(O))||"";return Me.includes(ie)||P.includes(ie)})}if(a.value&&w.value.length){const ie=new Set(w.value.map(de=>de==null?void 0:de.toString()));ee=ee.filter(de=>{var Me;return!ie.has((Me=de.id)==null?void 0:Me.toString())})}return ee}),A=d.inject("values"),I=d.inject("field-props"),L=/\{\{\s*([^}]+?)\s*\}\}/g,B=ee=>(ee?String(ee):"").replace(/<[^>]*>/g,"").trim(),N=d.computed(()=>t.slot??(t==null?void 0:t.optionTemplate)??""),V=ee=>{if(!ee)return"";const ie=N.value;return ie?ie.replace(L,(de,Me)=>{const P=Me.trim(),O=ee[P];return O!=null?String(O):""}):ee.text??""},R=ee=>{if(!ee)return"";if(!N.value)return ee.text??"";const ie=V(ee);return B(ie)||ee.text||""},F=(ee,ie,de)=>{var J;if(!I)return!1;const Me=((J=I.value)==null?void 0:J[ee])??{},P=(X,se,_e)=>{if(!se.length)return X;const[De,...ze]=se,kt={...X};if(!ze.length)return kt[De]=_e,kt;const xt=typeof X[De]=="object"&&X[De]!==null?X[De]:{};return kt[De]=P(xt,ze,_e),kt},O=P(Me,ie,de);return I.value={...I.value||{},[ee]:O},!0},G=ee=>{if(!t.set)return;const ie=A==null?void 0:A.value;!ie&&!I||Object.entries(t.set).forEach(([de,Me])=>{if(!de)return;const P=ee?ee[Me]:null,O=de.split(".").map(se=>se.trim()).filter(Boolean);if(!O.length)return;const[J,...X]=O;X.length&&F(J,X,P??null)||ie&&(ie[J]=P??null)})},z=d.computed(()=>{var ee,ie;return t.parent?((ie=(ee=A==null?void 0:A.value)==null?void 0:ee[t.parent])==null?void 0:ie.toString())??null:null}),K=async ee=>{var ie;if(!t.data){let de=t.options??[];if(ee!=null&&ee.trim()){const Me=ee.toLowerCase();de=de.filter(P=>{var X,se;const O=R(P).toLowerCase(),J=((se=(X=P.text)==null?void 0:X.toLowerCase)==null?void 0:se.call(X))||"";return O.includes(Me)||J.includes(Me)})}return de}try{const de=t.host??"",Me=t.prefix??"api",P=t.api??`/${Me}/suggest/${t.data}`,O=`${de}${P}`,J=new URLSearchParams;return J.set("json","1"),ee&&J.set("key",ee),z.value!==void 0&&z.value!==null&&z.value!==""&&J.set("parent",z.value),t.start===1&&J.set("start","1"),((ie=await fetch(`${O}?${J.toString()}`).then(X=>X.json()))==null?void 0:ie.data)??[]}catch{return[]}},U=async()=>{t.data?g.value=await K(y.value):g.value=t.options?[...t.options]:[]},q=async ee=>{var de,Me,P;if(ee==null)return null;const ie=(de=g.value)==null?void 0:de.find(O=>{var J;return((J=O==null?void 0:O.id)==null?void 0:J.toString())===String(ee)});if(ie)return ie;if(t.data)try{const O=t.host??"",J=t.prefix??"api",X=t.api??`/${J}/suggest/${t.data}`,se=`${O}${X}`,_e=new URLSearchParams;return _e.set("json","1"),_e.set("val",String(ee)),z.value!==void 0&&z.value!==null&&z.value!==""&&_e.set("parent",z.value),t.start===1&&_e.set("start","1"),((P=((Me=await fetch(`${se}?${_e.toString()}`).then(De=>De.json()))==null?void 0:Me.data)??[])==null?void 0:P[0])??null}catch{return null}return null},ae=async ee=>{const ie=new Set(g.value.map(Me=>{var P;return(P=Me.id)==null?void 0:P.toString()})),de=ee.filter(Me=>!ie.has(Me==null?void 0:Me.toString()));de.length&&await de.reduce(async(Me,P)=>{await Me;const O=await q(P);O&&g.value.push(O)},Promise.resolve())},me=()=>{if(!D.value.length){v.value=-1;return}v.value=0,d.nextTick(()=>{$(m.value[0],u.value)})},be=async()=>{i.value||(f.value=!0,await U(),await d.nextTick(()=>{var ee;Z(),(ee=b.value)==null||ee.focus()}),me())},fe=()=>{f.value=!1,v.value=-1,d.nextTick(()=>{var ee;(ee=b.value)==null||ee.blur()})},ce=async ee=>{i.value||(f.value?fe():await be())},W=async()=>{if(!i.value){if(f.value){fe();return}await be()}},H=()=>{a.value?(w.value=[],o.value=[],n("change",[]),oe(null,[])):(p.value=null,o.value=null,n("change",null),oe(null,null)),G(null),y.value="",d.nextTick(()=>{var ee;return(ee=b.value)==null?void 0:ee.focus()})},j=ee=>{a.value&&(w.value=w.value.filter(ie=>(ie==null?void 0:ie.toString())!==(ee==null?void 0:ee.toString())),o.value=[...w.value],n("change",o.value),oe(null),d.nextTick(()=>{var ie;return(ie=b.value)==null?void 0:ie.focus()}))},oe=(ee,ie)=>{const de=ie??(a.value?[...w.value]:(ee==null?void 0:ee.id)??null);n("value-selected",{name:t.name,value:de,option:ee})},le=ee=>{a.value?(T(ee.id)||(w.value=[...w.value,ee.id],o.value=[...w.value],n("change",o.value),oe(ee)),y.value="",d.nextTick(()=>{var ie;(ie=b.value)==null||ie.focus(),v.value=Math.min(v.value,D.value.length-1)}),G(null)):(p.value=ee,o.value=ee.id,n("change",o.value),oe(ee),y.value="",fe(),G(ee))},we=ee=>{if(T(ee.id)){a.value||fe();return}le(ee)},$=(ee,ie)=>{if(!ee||!ie)return;const de=ee.offsetTop,Me=de+ee.offsetHeight,P=ie.scrollTop,O=P+ie.clientHeight;let J=ie.scrollTop;de<P?J=de-80:Me>O&&(J=Me-ie.clientHeight+4);const X=ie;X.scrollTop=J},ne=ee=>{let ie=ee.parentElement;for(;ie;){if(ie.classList.contains("ui-dialog__content"))return ie;const de=window.getComputedStyle(ie),Me=de.overflow+de.overflowY+de.overflowX;if(Me.includes("auto")||Me.includes("scroll")||ie===document.body||ie===document.documentElement)return ie;ie=ie.parentElement}return document.body},Z=()=>{if(!l.value)return;const ee=l.value.getBoundingClientRect(),ie=window.innerHeight||document.documentElement.clientHeight,de=window.innerWidth||document.documentElement.clientWidth,Me=8,P=8,O=t.maxHeight||300,J=ie-ee.bottom-P-Me,X=ee.top-P-Me,se=J>=X,_e=Math.max(de-Me*2,0);let{width:De}=ee;_e>0&&De>_e&&(De=_e);let{left:ze}=ee;ze+De+Me>de&&(ze=de-De-Me),ze=Math.max(ze,Me);const kt=Math.min(O,Math.max(se?J:X,50));_.value=se?"bottom":"top",x.value={position:"fixed",left:`${ze}px`,width:`${De}px`,maxHeight:`${kt}px`,transform:se?"none":"translateY(-100%)",top:se?`${ee.bottom+P}px`:`${ee.top-P}px`}},Ie=async ee=>{i.value||!f.value&&(ee.key==="ArrowDown"||ee.key==="ArrowUp")&&(ee.preventDefault(),await be())},Qe=ee=>{var de;if(!f.value)return;const{key:ie}=ee;if(ie==="ArrowDown")ee.preventDefault(),v.value+1<D.value.length&&(v.value+=1,$(m.value[v.value],u.value));else if(ie==="ArrowUp")ee.preventDefault(),v.value>0&&(v.value-=1,$(m.value[v.value],u.value));else if(ie==="Enter"){ee.preventDefault();const Me=D.value[v.value];Me&&le(Me),(de=b.value)==null||de.blur()}else ie==="Escape"?(ee.preventDefault(),fe()):ie==="Backspace"?a.value&&y.value===""&&w.value.length&&(w.value=w.value.slice(0,-1),o.value=[...w.value],n("change",o.value)):ie==="Home"?(v.value=0,$(m.value[0],u.value)):ie==="End"?(v.value=D.value.length-1,$(m.value[v.value],u.value)):ie==="Tab"&&fe()},Fe=()=>{i.value||(h.value=!0)},$t=()=>{h.value=!1,y.value=""},Ht=ee=>{ee.key==="Escape"&&f.value&&fe()},Wt=ee=>{var de,Me;const ie=ee.target;(de=s.value)!=null&&de.contains(ie)||(Me=c.value)!=null&&Me.contains(ie)||fe()},Gr=ee=>{f.value&&u.value&&!u.value.contains(ee.target)&&Z()},ge=()=>{f.value&&Z()},Ce=()=>{f.value&&Z()};d.watch(()=>t.options,ee=>{ee!=null&&ee.length&&(g.value=[...ee],Ge())},{immediate:!0});async function Ge(){if(a.value)Array.isArray(o.value)?w.value=[...o.value]:(w.value=o.value==null?[]:[o.value],o.value=[...w.value]),t.data&&w.value.length&&(await ae(w.value),await d.nextTick());else{if(Array.isArray(o.value)){const ee=o.value[0]??null;o.value=ee??null}o.value!=null&&(p.value=await q(o.value)),G(p.value??null)}}d.watch(o,()=>{Ge()}),d.onMounted(async()=>{var ee;addEventListener("keydown",Ht),addEventListener("scroll",Gr,!0),addEventListener("resize",ge),document.addEventListener("click",Wt,!0),l.value&&ne(l.value).addEventListener("scroll",Ce,!0),(ee=t.options)!=null&&ee.length&&!t.data?g.value=[...t.options]:t.data&&(g.value=await K("")),await Ge(),Ga.value=!1}),d.onUnmounted(()=>{removeEventListener("keydown",Ht),removeEventListener("scroll",Gr,!0),removeEventListener("resize",ge),document.removeEventListener("click",Wt,!0),l.value&&ne(l.value).removeEventListener("scroll",Ce,!0)});const at=d.ref(!1),Tt=d.ref({}),fr=d.ref([]),Fn=d.ref(null);async function rs(){var de,Me;if(!((de=t.add)!=null&&de.token)||Fn!=null&&Fn.value.validate())return;const ee=t.add.api??`/api/table/${t.add.token}`,{id:ie}=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tt.value)}).then(P=>P.json());if(!((Me=t.options)!=null&&Me.length)&&t.data){const P=await fetch(`${t.api??`/api/suggest/${t.data}`}?val=${ie}`).then(O=>O.json());p.value=P[0],g.value.push(P[0]),o.value=ie}at.value=!1,pt({title:"Success!",message:"Object created."})}async function Yc(){if(!t.add)return null;const ee=await fetch(`/api/template/form/${t.add.form}`).then(ie=>ie.json());return fr.value=ee.schema,at.value=!0,null}function qc(ee,ie=200){let de;return(...Me)=>{de&&clearTimeout(de),de=window.setTimeout(()=>ee(...Me),ie)}}const Zc=qc(async ee=>{g.value=await K(ee)},200);d.watch(y,ee=>{t.data&&Zc(ee.trim())}),d.watch(()=>t.options,ee=>{!t.data&&(ee!=null&&ee.length)&&(g.value=[...ee],Ge())},{immediate:!0}),d.watch(()=>t.parent??t.parentValue,()=>{t.data&&U()});const Ga=d.ref(!0);return d.watch(z,async()=>{if(t.data&&(Ga.value||(a.value?(w.value=[],o.value=[],n("change",[])):(p.value=null,o.value=null,n("change",null))),await U(),t.auto===1&&z.value&&g.value.length>0)){const ee=g.value[0];ee&&le(ee)}}),(ee,ie)=>{var de,Me,P,O,J;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(xl),{visible:at.value,"onUpdate:visible":ie[1]||(ie[1]=X=>at.value=X),class:"z-[1000]",title:"Додати",buttonText:"Додати",onDone:rs,teleport:ee.teleport},{default:d.withCtx(()=>[d.createVNode(Fa,{schema:fr.value,modelValue:Tt.value,"onUpdate:modelValue":ie[0]||(ie[0]=X=>Tt.value=X),ref_key:"addForm",ref:Fn},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),d.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:s,onClick:ie[5]||(ie[5]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["relative w-full font-sans",t.customClass])},[ie[10]||(ie[10]=d.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),ie[11]||(ie[11]=d.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-[#b3d4ff]",f.value||h.value?"border-[#2684ff] ring-1 ring-[#2684ff]":"",i.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":f.value,"aria-haspopup":"listbox",onKeydown:Ie,onClick:W,"data-focus":f.value||h.value?"true":"false",ref_key:"triggerRef",ref:l},[d.createElementVNode("div",whe,[a.value?(d.openBlock(),d.createElementBlock("div",She,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(S.value,X=>(d.openBlock(),d.createElementBlock("div",{class:"flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full",key:X.id},[d.createElementVNode("div",khe,[X!=null&&X.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:d.normalizeStyle({backgroundColor:X==null?void 0:X.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",title:R(X)},[N.value?(d.openBlock(),d.createElementBlock("span",{key:0,innerHTML:V(X)},null,8,Che)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(X.text),1)],64))],8,Ehe)]),d.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border text-[#172b4d] hover:bg-[rgb(255,189,173)] hover:text-[rgb(222,53,11)] flex-shrink-0",onClick:d.withModifiers(se=>j(X.id),["stop"])},ie[6]||(ie[6]=[d.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,The)]))),128)),d.createElementVNode("div",Dhe,[!i.value&&ee.search?d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:b,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:w.value.length?" ":k.value,"onUpdate:modelValue":ie[2]||(ie[2]=X=>y.value=X),onFocus:Fe,onBlur:$t,onKeydown:Qe},null,40,Ahe)),[[d.vModelText,y.value]]):d.createCommentVNode("",!0)])])):!a.value&&E.value&&y.value===""?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["truncate text-gray-900 absolute"]),title:E.value},[(de=p.value)!=null&&de.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:d.normalizeStyle({backgroundColor:(Me=p.value)==null?void 0:Me.color})},null,4)):d.createCommentVNode("",!0),N.value?(d.openBlock(),d.createElementBlock("span",{key:1,class:d.normalizeClass({"pl-5":(P=p.value)==null?void 0:P.color}),innerHTML:V(p.value)},null,10,Nhe)):(d.openBlock(),d.createElementBlock("span",{key:2,class:d.normalizeClass({"pl-5":(O=p.value)==null?void 0:O.color})},d.toDisplayString((J=p.value)==null?void 0:J.text),3))],8,Mhe)):d.createCommentVNode("",!0),a.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Lhe,[!i.value&&ee.search?d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:b,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:E.value?" ":k.value,"onUpdate:modelValue":ie[3]||(ie[3]=X=>y.value=X),onFocus:Fe,onBlur:$t,onKeydown:Qe},null,40,Ihe)),[[d.vModelText,y.value]]):d.createCommentVNode("",!0)]))]),d.createElementVNode("div",Bhe,[C.value?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:i.value,onClick:d.withModifiers(H,["stop"])},ie[7]||(ie[7]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Vhe)):d.createCommentVNode("",!0),ie[9]||(ie[9]=d.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),d.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:i.value,onClick:ie[4]||(ie[4]=d.withModifiers(X=>ce(),["stop"])),title:f.value?"Закрити список":"Відкрити список"},ie[8]||(ie[8]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,Rhe)])],42,xhe),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[f.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:d.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:d.normalizeStyle(x.value),role:"listbox"},[d.createElementVNode("div",{class:"overflow-y-auto py-1",style:d.normalizeStyle({maxHeight:x.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[D.value.length?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(D.value,(X,se)=>(d.openBlock(),d.createElementBlock("div",{key:X.id,ref_for:!0,ref:_e=>m.value[se]=_e,class:d.normalizeClass(["flex px-3 py-2 cursor-pointer select-none text-gray-900",T(X.id)?"bg-[#2684ff] text-white":"bg-white hover:bg-[#deebff] hover:text-[#172b4d]",v.value===se&&!T(X.id)?"bg-[#deebff] text-[#172b4d]":""]),"aria-disabled":T(X.id)?"true":"false",role:"option",tabindex:"-1",onClick:_e=>we(X)},[X!=null&&X.color?(d.openBlock(),d.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:d.normalizeStyle({backgroundColor:X==null?void 0:X.color})},null,4)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["leading-[19px]",v.value===X.id?"text-white":"",(v.value,"")])},[N.value?(d.openBlock(),d.createElementBlock("span",{key:0,innerHTML:V(X)},null,8,Ohe)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(X.text),1)],64))],2)],10,Phe))),128)):(d.openBlock(),d.createElementBlock("div",zhe," No options "))],4)],4)):d.createCommentVNode("",!0)]))],2),t.add?(d.openBlock(),d.createElementBlock("button",{key:0,onClick:Yc,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:i.value,type:"button"},[d.createVNode(da,{width:"16",height:"16"}),ie[12]||(ie[12]=d.createElementVNode("span",null,"Додати",-1))],8,Fhe)):d.createCommentVNode("",!0)],512)],64)}}}),$he=["placeholder","disabled"],HR=d.defineComponent({__name:"vs-input-textarea",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,{inputClass:t}=br(e.style),n=d.useModel(r,"modelValue"),a=d.computed(()=>!!e.disabled),i=d.computed(()=>e.placeholder??"");function o(){typeof n.value=="string"&&(n.value=n.value.trim())}return(s,l)=>d.withDirectives((d.openBlock(),d.createElementBlock("textarea",{"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),placeholder:i.value,disabled:a.value,row:"2",onBlur:o,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[d.unref(t)]]),style:{border:"1px solid #CFD9E0"}},null,42,$he)),[[d.vModelText,n.value]])}}),Ghe={key:1,class:"richtext-error"},WR=d.defineComponent({__name:"vs-input-richtext",props:d.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},richtextProps:{default:()=>({})}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=d.ref(null);d.onMounted(async()=>{try{const l=await new Function("specifier","return import(specifier)")("@opengis/richtext");e.value=l.VsRichtext}catch{console.warn("@opengis/richtext is not installed. Please install it to use richtext input.")}});const t=r,{inputClass:n}=br(t.style),a=d.useModel(r,"modelValue"),i=d.computed(()=>!!t.disabled),o=d.computed(()=>t.placeholder??""),s=d.computed(()=>({height:"300px",...t.richtextProps}));return(l,u)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["richtext-wrapper !h-full !border-transparent",[l.customClass,d.unref(n),{"richtext-disabled":i.value}]]),style:d.normalizeStyle(i.value?{pointerEvents:"none",opacity:.6}:{})},[e.value?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.value),d.mergeProps({key:0,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),placeholder:o.value},s.value),null,16,["modelValue","placeholder"])):(d.openBlock(),d.createElementBlock("div",Ghe,u[1]||(u[1]=[d.createElementVNode("p",null,"@opengis/richtext package is not installed.",-1),d.createElementVNode("p",null,"Please install it: npm install @opengis/richtext",-1)])))],6))}}),Uhe={},Hhe={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 Whe(r,e){return d.openBlock(),d.createElementBlock("svg",Hhe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),d.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const Yhe=Ye(Uhe,[["render",Whe]]),qhe={},Zhe={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 Xhe(r,e){return d.openBlock(),d.createElementBlock("svg",Zhe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const jhe=Ye(qhe,[["render",Xhe]]),Khe={},Qhe={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 Jhe(r,e){return d.openBlock(),d.createElementBlock("svg",Qhe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),d.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),d.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const epe=Ye(Khe,[["render",Jhe]]),tpe={},rpe={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 npe(r,e){return d.openBlock(),d.createElementBlock("svg",rpe,e[0]||(e[0]=[d.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 Mp=Ye(tpe,[["render",npe]]),ape={},ipe={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ope(r,e){return d.openBlock(),d.createElementBlock("svg",ipe,e[0]||(e[0]=[d.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 spe=Ye(ape,[["render",ope]]),lpe={},upe={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 cpe(r,e){return d.openBlock(),d.createElementBlock("svg",upe,e[0]||(e[0]=[d.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 dpe=Ye(lpe,[["render",cpe]]),fpe={class:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden flex flex-col"},hpe={class:"flex flex-col gap-2 !p-4 border-b border-gray-200 sm:flex-row sm:items-center sm:justify-between bg-gray-50"},ppe={class:"relative w-full"},gpe={class:"flex flex-nowrap items-center justify-end gap-2 w-full overflow-x-auto"},vpe={class:"w-full overflow-x-auto"},mpe={class:"w-full min-w-[640px] divide-y divide-gray-200"},ype={class:"bg-gray-50"},bpe={class:"border-b border-gray-200"},_pe={class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center"},xpe=["onClick"],wpe={key:0,class:"text-gray-400"},Spe={key:0,colspan:"100%",class:"text-center"},kpe={class:"w-full"},Epe={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Cpe=["onDragstart","onDragover","onDrop"],Tpe={class:"px-4 py-3 text-center align-middle"},Dpe={class:"flex items-center justify-center"},Ape=["innerHTML"],Mpe={key:0,class:"flex items-center gap-3 text-sm text-gray-700"},Npe={key:0},Lpe=["src"],Ipe={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},Bpe={key:1,class:"flex items-center justify-center"},Vpe={key:2,class:"text-sm font-medium text-gray-900"},Rpe={class:"px-4 py-3 text-right"},Ppe={class:"flex items-center justify-end gap-2"},Ope=["onClick"],zpe=["onClick"],Fpe={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},YR=d.defineComponent({__name:"vs-input-datatable",props:d.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useSlots(),n=d.useModel(r,"modelValue"),a=d.ref({}),i=d.ref(""),o=d.ref(null),s=d.ref("asc"),l=d.computed(()=>{const W=n.value??[],H=i.value?W.filter(le=>{var we;return(we=e.colModel)==null?void 0:we.some($=>{const ne=$.key||$.name;if(!ne)return!1;const Z=le[ne];return Z?Array.isArray(Z)?Z.join(", ").toLowerCase().includes(i.value.toLowerCase()):String(Z).toLowerCase().includes(i.value.toLowerCase()):!1})}):W;if(!o.value)return H;const j=o.value,oe=[...H].sort((le,we)=>{const $=G(le==null?void 0:le[j]),ne=G(we==null?void 0:we[j]);return typeof $=="number"&&typeof ne=="number"?$-ne:String($).localeCompare(String(ne))});return s.value==="asc"?oe:oe.reverse()}),u=d.ref(null),c=d.ref(null),f=d.ref(null),h=W=>{u.value=W},p=W=>{c.value=W},g=W=>{if(u.value===null||u.value===W){u.value=null,c.value=null;return}const H=[...n.value],[j]=H.splice(u.value,1);H.splice(W,0,j),n.value=H,u.value=null,c.value=null},v=()=>{f.value&&f.value.click()},m=W=>{const H=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],j=W.toLowerCase();return H.some(oe=>j.endsWith(oe))},y=W=>{var oe;const H=(oe=W.target.files)==null?void 0:oe[0];if(!H)return;const j=new FileReader;j.onload=le=>{var we;try{const $=(we=le.target)==null?void 0:we.result;if(typeof $=="string"){const ne=JSON.parse($);Array.isArray(ne)&&n.value.push(...ne)}}catch($){console.error("Error parsing file:",$)}},j.readAsText(H)},b=()=>{const W=JSON.stringify(n.value,null,2),H=new Blob([W],{type:"application/json"}),j=URL.createObjectURL(H),oe=document.createElement("a");oe.href=j,oe.download="data.json",oe.click(),URL.revokeObjectURL(j)},_=new Set(["autocomplete","select","radio","checkbox","combobox"]),x=new Map,w=(W,H)=>{const j=`/api/suggest/${W}`,oe=j.includes("?")?"&":"?",le=H?`&val=${H}`:"";return`${j}${oe}json=1${le}`},S=W=>W==null||W===""?null:typeof W=="object"?(W==null?void 0:W.id)!==void 0&&W.id!==null&&W.id!==""?W.id:null:W,k=W=>{const H=new Set;return Array.isArray(n.value)&&n.value.forEach(j=>{const oe=j==null?void 0:j[W];if(oe==null||oe==="")return;if(Array.isArray(oe)){oe.forEach(we=>{const $=S(we);$!==null&&H.add($)});return}const le=S(oe);le!==null&&H.add(le)}),H},E=async()=>{var H;if(!((H=e.colModel)!=null&&H.length))return;const W=e.colModel.filter(j=>{var oe;return j.data&&_.has(((oe=j.type)==null?void 0:oe.toLowerCase())||"")});W.length&&await Promise.all(W.map(async j=>{const oe=j.key||j.name;if(!oe)return;const le=k(oe),we=Array.from(le).map(Z=>String(Z)).sort(),$=we.join(",");if(!we.length||x.get(oe)===$)return;x.set(oe,$);const ne=we.map(encodeURIComponent).join(",");try{const Z=await(await fetch(w(j.data,ne))).json();a.value[oe]=(Z==null?void 0:Z.data)??Z}catch(Z){console.error("Failed to fetch column values",Z)}}))};d.watch([()=>e.colModel,()=>n.value],()=>{E()},{immediate:!0,deep:!0});const C=d.ref(""),T=d.ref(!1);let D="edit",A=0;const I=W=>((W==null?void 0:W.format)||(W==null?void 0:W.type)||"").toString().toLowerCase(),L=d.computed(()=>{var W;return((W=e.colModel)==null?void 0:W.filter(H=>I(H)!=="slot").map(H=>{const{slot:j,...oe}=H;return oe}))??[]}),B=d.ref({}),N=d.ref({}),V=W=>typeof W!="string"?!1:!!t[W],R=(W,H)=>H?H.split(".").reduce((j,oe)=>j==null?j:j[oe.trim()],W):W,F=(W,H)=>typeof W!="string"?"":W.replace(/{{\s*([^}]+)\s*}}/g,(j,oe)=>R(H,oe.trim())??""),G=W=>{if(W==null||W==="")return"";if(typeof W=="number")return W;if(typeof W=="boolean")return W?1:0;if(typeof W=="string")return W.toLowerCase();if(Array.isArray(W))return W.map(H=>G(H)).join(", ");if(typeof W=="object"){if(W.text!==void 0)return String(W.text).toLowerCase();if(W.label!==void 0)return String(W.label).toLowerCase();if(W.id!==void 0)return String(W.id).toLowerCase()}return String(W).toLowerCase()},z=W=>{const H=W.key||W.name;if(H){if(o.value===H){s.value=s.value==="asc"?"desc":"asc";return}o.value=H,s.value="asc"}};async function K(){C.value="Додати",T.value=!0,D="add",B.value={}}function U(W,H){var oe;if(!(W!=null&&W.length))return null;const j=typeof H=="object"?H==null?void 0:H.id:H;return j==null||j===""?null:((oe=W.find(le=>{var we;return((we=le==null?void 0:le.id)==null?void 0:we.toString())===j.toString()}))==null?void 0:oe.text)??null}function q(W){return W==null||W===""?"-":Array.isArray(W)?W.map(H=>typeof H=="object"?(H==null?void 0:H.text)??(H==null?void 0:H.id)??"-":H).join(", "):typeof W=="object"?(W==null?void 0:W.text)??(W==null?void 0:W.id)??"-":W}function ae(W,H){const j=H.key||H.name,oe=W==null?void 0:W[j],le=a.value[j];if(!oe)return"-";if(Array.isArray(oe)){const $=oe.map(ne=>U(le,ne)).filter(Boolean);return $.length?$.join(", "):q(oe)}return U(le,oe)||q(oe)}async function me(W,H){C.value="Редагувати",T.value=!0,D="edit",A=H,B.value={...W}}function be(){const W=N.value.validate();if(W){pt({type:"warning",title:"Помилка валідації",message:Object.entries(W).map(([H,j])=>`${H}: ${j}`).join(`
|
|
300
|
+
`)});return}D==="add"?Array.isArray(n.value)?n.value=[...n.value,B.value]:n.value=[B.value]:n.value=n.value.map((H,j)=>j===A?B.value:H),T.value=!1}function fe(W){n.value=n.value.filter((H,j)=>j!==W)}function ce(){T.value=!1}return(W,H)=>(d.openBlock(),d.createElementBlock("div",fpe,[d.createElementVNode("div",hpe,[d.createElementVNode("div",ppe,[d.createVNode(Yhe,{width:"16",height:"16",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":H[0]||(H[0]=j=>i.value=j),placeholder:"Пошук",class:"w-full rounded-md border border-gray-200 bg-white pl-10 pr-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"},null,512),[[d.vModelText,i.value]])]),d.createElementVNode("div",gpe,[d.createElementVNode("input",{ref_key:"fileInput",ref:f,onChange:y,class:"hidden",accept:".json",type:"file"},null,544),d.createElementVNode("button",{type:"button",onClick:v,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[d.createVNode(jhe,{class:"text-gray-700",width:"16",height:"16"}),H[4]||(H[4]=d.createTextVNode(" Імпорт ",-1))]),d.createElementVNode("button",{type:"button",onClick:b,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[d.createVNode(epe,{class:"text-gray-700",width:"16",height:"16"}),H[5]||(H[5]=d.createTextVNode(" Експорт ",-1))]),d.createElementVNode("button",{onClick:K,type:"button",class:"inline-flex items-center gap-2 rounded-md bg-blue-500 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-600 transition-colors"},[d.createVNode(da,{class:"text-white"}),H[6]||(H[6]=d.createTextVNode(" Додати ",-1))])])]),d.createElementVNode("div",vpe,[d.createElementVNode("table",mpe,[d.createElementVNode("thead",ype,[d.createElementVNode("tr",bpe,[d.createElementVNode("th",_pe,[d.createVNode(Mp,{width:"20",height:"20",class:"mx-auto text-gray-400"})]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.colModel,j=>(d.openBlock(),d.createElementBlock("th",{key:j.key,class:"px-4 py-3 text-left text-xs font-semibold text-gray-900"},[d.createElementVNode("button",{type:"button",onClick:oe=>z(j),class:"flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"},[d.createElementVNode("span",null,d.toDisplayString(j.ua||j.label),1),o.value===(j.key||j.name)?(d.openBlock(),d.createElementBlock("span",wpe,d.toDisplayString(s.value==="asc"?"▲":"▼"),1)):d.createCommentVNode("",!0)],8,xpe)]))),128)),H[7]||(H[7]=d.createElementVNode("th",{class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 text-center"}," Дії ",-1))])]),d.createElementVNode("tbody",{class:d.normalizeClass(["divide-y divide-gray-200",{"[&_tr:last-child]:border-0":!c.value}])},[l.value.length===0?(d.openBlock(),d.createElementBlock("td",Spe,[d.createElementVNode("div",kpe,[d.createElementVNode("div",Epe,[d.createVNode(spe,{class:"w-48 mx-auto"}),H[8]||(H[8]=d.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[d.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),d.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(l.value,(j,oe)=>(d.openBlock(),d.createElementBlock("tr",{key:j.id,class:d.normalizeClass(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700",{"opacity-50":u.value===oe,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":c.value===oe}]),draggable:"true",onDragstart:le=>h(oe),onDragover:d.withModifiers(le=>p(oe),["prevent"]),onDrop:le=>g(oe)},[d.createElementVNode("td",Tpe,[d.createElementVNode("div",Dpe,[d.createVNode(Mp,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(W.colModel,le=>(d.openBlock(),d.createElementBlock("td",{key:le.key,class:"px-4 py-3 align-middle"},[I(le)==="slot"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[V(le.slot)?d.renderSlot(W.$slots,le.slot,{key:0,row:j,value:j[le.key],column:le}):(d.openBlock(),d.createElementBlock("div",{key:1,class:"text-sm text-gray-900",innerHTML:F(le.slot,j)},null,8,Ape))],64)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[I(le)==="file"?(d.openBlock(),d.createElementBlock("div",Mpe,[m(ae(j,le))?(d.openBlock(),d.createElementBlock("div",Npe,[d.createElementVNode("img",{src:ae(j,le),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,Lpe)])):(d.openBlock(),d.createElementBlock("div",Ipe,[d.createVNode(OR,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):I(le)==="color"?(d.openBlock(),d.createElementBlock("div",Bpe,[d.createElementVNode("span",{class:"inline-flex h-6 w-6 rounded border border-gray-200",style:d.normalizeStyle({backgroundColor:ae(j,le)||"#ffffff"})},null,4)])):(d.openBlock(),d.createElementBlock("div",Vpe,d.toDisplayString(ae(j,le)),1))],64))]))),128)),d.createElementVNode("td",Rpe,[d.createElementVNode("div",Ppe,[d.createElementVNode("button",{onClick:le=>me(j,oe),class:"p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors"},[d.createVNode(dpe,{width:"16",height:"16"})],8,Ope),d.createElementVNode("button",{onClick:le=>fe(oe),class:"p-1.5 text-gray-600 hover:text-red-600 hover:bg-red-50 rounded transition-colors"},[d.createVNode(Sl,{width:"16",height:"16"})],8,zpe)])])],42,Cpe))),128))],2)])]),d.createVNode(d.unref(xl),{visible:T.value,title:C.value,size:"lg",onClose:ce,teleport:"#modal"},{default:d.withCtx(()=>[d.createVNode(Fa,{schema:L.value,values:B.value,"onUpdate:values":H[1]||(H[1]=j=>B.value=j),form:N.value,"onUpdate:form":H[2]||(H[2]=j=>N.value=j)},null,8,["schema","values","form"]),d.createElementVNode("div",Fpe,[d.createElementVNode("button",{type:"button",onClick:H[3]||(H[3]=j=>T.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"}," Скасувати "),d.createElementVNode("button",{onClick:be,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"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),$pe={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:"Клацніть на шари, щоб видалити їх"}}}}},Gpe={},Upe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function Hpe(r,e){return d.openBlock(),d.createElementBlock("svg",Upe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),d.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const Wpe=Ye(Gpe,[["render",Hpe]]),Ype={},qpe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function Zpe(r,e){return d.openBlock(),d.createElementBlock("svg",qpe,e[0]||(e[0]=[d.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),d.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),d.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),d.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const Xpe=Ye(Ype,[["render",Zpe]]),jpe={},Kpe={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-polygon"};function Qpe(r,e){return d.openBlock(),d.createElementBlock("svg",Kpe,e[0]||(e[0]=[d.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const Jpe=Ye(jpe,[["render",Qpe]]),ege={},tge={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-topology-ring-3"};function rge(r,e){return d.openBlock(),d.createElementBlock("svg",tge,e[0]||(e[0]=[d.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const nge=Ye(ege,[["render",rge]]),age={},ige={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function oge(r,e){return d.openBlock(),d.createElementBlock("svg",ige,e[0]||(e[0]=[d.createElementVNode("title",null,null,-1),d.createElementVNode("desc",null,null,-1),d.createElementVNode("defs",null,null,-1),d.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[d.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[d.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[d.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const sge=Ye(age,[["render",oge]]),lge={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},uge={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},cge=["onClick"],dge={class:"relative flex-1 min-w-[140px]"},fge=["placeholder"],hge="https://data.softpro.ua/api-user/gis-url-proxy",pge="https://geo.rv.ua/api-user/dzk.api",gge=d.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(r,{emit:e}){const t=r,n=e,a=["here","xy","parcel"],i=d.computed(()=>{var w,S;const x=(S=(w=t.config)==null?void 0:w.tools)==null?void 0:S.filter(k=>a.includes(k));return x&&x.length?x:a}),o=d.computed(()=>{var x,w;return((w=(x=t.config)==null?void 0:x.placeholder)==null?void 0:w.trim())||"Пошук…"}),s=d.ref(i.value[0]??a[0]);d.watch(i,x=>{x.includes(s.value)||(s.value=x[0])});const l=d.ref(""),u=d.ref(!1),c=d.ref(null);d.watch(s,()=>{l.value="",u.value=!1});function f(x){s.value=x}function h(x){if(!u.value)return;const w=c.value;w&&!w.contains(x.target)&&(u.value=!1)}d.onMounted(()=>{window.addEventListener("click",h,!0)}),d.onBeforeUnmount(()=>{window.removeEventListener("click",h,!0)});function p(x){return x==="xy"?"Координати":x==="parcel"?"Кадастр":"Адреси"}function g(x){const w=x.replace(/[,]+/g," ").trim();if(!w)return null;const S=w.split(/\s+/).filter(Boolean);if(S.length<2)return null;const k=S.slice(0,2).map(Number);if(!k.every(L=>Number.isFinite(L)))return null;const[E,C]=k;let T=E,D=C;const A=L=>Math.abs(L)<=90,I=L=>Math.abs(L)<=180;if(!A(T)||!I(D))if(A(D)&&I(T))T=C,D=E;else return null;return{lat:T,lng:D}}function v(x){return((x==null?void 0:x.items)||[]).map((w,S)=>{var k,E,C;return{id:String((w==null?void 0:w.id)??S),title:(w==null?void 0:w.title)||((k=w==null?void 0:w.address)==null?void 0:k.label)||"Знайдений обʼєкт",lat:Number((E=w==null?void 0:w.position)==null?void 0:E.lat),lng:Number((C=w==null?void 0:w.position)==null?void 0:C.lng)}}).filter(w=>Number.isFinite(w.lat)&&Number.isFinite(w.lng))}function m(x){const w=(x==null?void 0:x.result)||(x==null?void 0:x.data)||x;if(!w)return[];const S=w.geom_centroid;if(!S||!Array.isArray(S.coordinates))return[];const[k,E]=S.coordinates;return!Number.isFinite(E)||!Number.isFinite(k)?[]:[{id:"parcel",title:w.cadnum||w.cad_num||"Земельна ділянка",lat:E,lng:k}]}function y(x){const w=x.replace(/\s+/g,"").split(":");if(w.length!==4)return!1;const S=[10,2,3,4];return w.every((k,E)=>k.length===S[E]&&/^\d+$/.test(k))}function b(x){n("goToCoordinates",[x.lat,x.lng])}async function _(){const x=l.value.trim();if(x){if(s.value==="xy"){const w=g(x);if(!w){pt({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}b(w),l.value="";return}try{const w=new URL(s.value==="here"?hge:pge);if(s.value==="here")w.searchParams.set("searchtext",x);else{if(!y(x)){pt({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}w.searchParams.set("cad_num",x)}const S=await fetch(w.toString());if(!S.ok)throw new Error(`HTTP ${S.status}`);const k=await S.json(),E=s.value==="here"?v(k):m(k);if(!E.length)pt({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const C=E[0];b(C),l.value=""}}catch(w){const S=(w==null?void 0:w.message)||"Помилка пошуку";pt({type:"error",title:"Пошук",message:S})}}}return(x,w)=>(d.openBlock(),d.createElementBlock("div",lge,[d.createElementVNode("form",{class:"flex gap-2",onSubmit:d.withModifiers(_,["prevent"])},[i.value.length>1?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:"relative search-type w-[140px]"},[d.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:w[0]||(w[0]=S=>u.value=!u.value)},[d.createElementVNode("span",null,d.toDisplayString(p(s.value)),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":u.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w[2]||(w[2]=[d.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),u.value?(d.openBlock(),d.createElementBlock("div",uge,[d.createElementVNode("ul",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,S=>(d.openBlock(),d.createElementBlock("li",{key:S,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:k=>f(S)},d.toDisplayString(p(S)),9,cge))),128))])])):d.createCommentVNode("",!0)],512)):d.createCommentVNode("",!0),d.createElementVNode("div",dge,[d.withDirectives(d.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=S=>l.value=S),placeholder:o.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,fge),[[d.vModelText,l.value,void 0,{trim:!0}]]),w[3]||(w[3]=d.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),vge=Ye(gge,[["__scopeId","data-v-b5059a01"]]),mge={class:"bg-white/30 p-1 rounded-md shadow w-fit"},yge={class:"flex gap-2"},bge=["onClick","title"],_ge=["src"],xge=d.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(r,{emit:e}){const t=d.ref(Object.keys(r.basemaps)[0]),n=e;function a(s){n("onLayerChange",s),t.value=s}const i={z:13,x:4790,y:2762};function o(s){if(s!=null&&s.preview)return s.preview;if(!(s!=null&&s.url))return;const l={"{z}":i.z,"{x}":i.x,"{y}":i.y};let u=s.url;return Object.entries(l).forEach(([c,f])=>{u=u.replace(new RegExp(c,"gi"),String(f))}),u}return(s,l)=>(d.openBlock(),d.createElementBlock("div",mge,[d.createElementVNode("div",yge,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.basemaps,(u,c)=>(d.openBlock(),d.createElementBlock("div",{key:c,class:d.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":t.value===c}]),onClick:f=>a(c),title:u.name||c,role:"button",tabindex:"0"},[d.createElementVNode("img",{src:o(u),alt:"",class:"w-10 h-10 object-cover"},null,8,_ge)],10,bge))),128))])]))}});function Pc(r){return r?r.type==="Polygon"?{type:"MultiPolygon",coordinates:[r.coordinates]}:r.type==="Feature"?{...r,geometry:Pc(r.geometry)}:r.type==="FeatureCollection"?{...r,features:(r.features||[]).map(e=>Pc(e)).filter(Boolean)}:r:null}function wge(r){return r?r.type==="FeatureCollection"||r.type==="Feature"?Pc(r):r.geom?{type:"Feature",geometry:Pc({type:r.geom.type,coordinates:r.geom.coordinates}),properties:{}}:r.type&&r.coordinates?{type:"Feature",geometry:Pc(r),properties:{}}:null:null}const Sge={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},kge={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},Ege={class:"text-sm font-medium"},Cge={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Tge={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},Dge={class:"flex items-center gap-1"},Age=["disabled"],Mge=["disabled"],Nge=["disabled"],Lge={class:"bg-white/95 border border-gray-200 rounded-md shadow-xl px-3 py-2 max-w-[240px] text-[11px] sm:text-xs text-gray-900"},Ige={class:"space-y-0.5"},Bge={class:"text-gray-500"},Vge={class:"text-gray-900 text-right break-all"},Rge={class:"absolute top-4 right-4 z-[1000]"},Pge={class:"flex flex-col gap-[2px]"},Oge=["disabled"],zge=["disabled"],Fge=["disabled"],$ge=["disabled"],Gge={class:"flex flex-col gap-2"},Uge={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},Hge={class:"flex flex-col gap-1"},Wge=["checked","disabled","onChange"],Yge={class:"text-gray-700 text-xs font-medium"},qge={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},Zge={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},Xge={class:"shrink-0"},jge={class:"font-bold"},Kge={class:"flex items-center"},Qge={class:"text-xs mr-2"},Jge={key:0,class:"text-xs"},eve={key:1,class:"text-xs"},tve=["disabled"],rve=["disabled"],Np="vs-base-tile-pane",Lp="vs-overlay-tile-pane",Ip="__vs_form_leaflet_loader__",j1="__vs_form_leaflet_scripts__",nve=d.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},ctrlZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},katottg:{default:""},layers:{default:()=>[]},bounds:{},api:{},center:{default:void 0},zoom:{default:void 0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){var ee,ie,de,Me;const t=((Me=(de=(ie=(ee=d.getCurrentInstance())==null?void 0:ee.appContext)==null?void 0:ie.config)==null?void 0:de.globalProperties)==null?void 0:Me.$settings)??{},n=Array.isArray(t.center)&&t.center.length===2?t.center:[50,30],a=typeof t.zoom=="number"?t.zoom:typeof t.defaultZoom=="number"?t.defaultZoom:10,i=r,o=e,s=d.computed(()=>!!i.disabled),l=d.ref(!1),u=d.ref(null),c=d.ref(!1),f=d.ref(""),h=d.ref(null),p=d.ref(null),g=d.ref(!1),v=d.ref(null),m=d.ref(null),y=d.ref(0),b=d.ref(Array.isArray(i.center)&&i.center.length===2?[...i.center]:n),_=d.ref(typeof i.zoom=="number"?i.zoom:a),x=d.ref([]),w=d.ref(i.modelValue);let S=!1;const k=d.ref(null),E=d.computed(()=>{var J;const P={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!((J=i.tools)!=null&&J.length))return{...P,point:!0,line:!0,polygon:!0,rectangle:!0};const O=new Set(i.tools.map(X=>X.toLowerCase()));return{search:O.has("search"),import:O.has("import"),export:O.has("export"),point:O.has("point"),line:O.has("line"),polygon:O.has("polygon"),rectangle:O.has("rectangle")}}),C=d.reactive({}),T=d.ref([]),D=d.computed(()=>T.value.map(P=>C[P]).filter(Boolean)),A=d.ref(null),I=d.computed(()=>{var P;return((P=A.value)==null?void 0:P.entries)??[]}),L=d.computed(()=>{if(!A.value)return;const P=12,O=A.value.point.x+P,J=A.value.point.y+P;return{left:`${O}px`,top:`${J}px`}});function B(P){var X;if(typeof P!="string"||!P.trim())return"";if(/^https?:\/\//i.test(P))return P;const O=((X=window==null?void 0:window.location)==null?void 0:X.origin)??"",J=P.replace(/^\/+/,"");return J?O?`${O}/${J}`:`/${J}`:O}function N(){if(Array.isArray(t.basemaps)&&t.basemaps.length){const P=t.basemaps.map((O,J)=>{const X=String((O==null?void 0:O.key)??(O==null?void 0:O.id)??(O==null?void 0:O.name)??`b${J}`),se=B(String((O==null?void 0:O.url)??""));if(!se)return null;const _e=typeof(O==null?void 0:O.preview)=="string"&&O.preview?B(O.preview):"";return[X,{...O,url:se,preview:_e}]}).filter(O=>Array.isArray(O)&&O.length===2).reduce((O,[J,X])=>(O[J]=X,O),{});if(Object.keys(P).length)return P}return{voyager:{name:"Оглядова карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{name:"Ортофото 1:10K",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{name:"Open Street Maps",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const V=N(),R=Object.keys(V),F=d.ref(R.length?R[0]:"");let G,z,K,U,q=null;async function ae(){if(typeof window>"u")return null;const P=window;if(P[Ip])return P[Ip];const O=_e=>{if(!Array.from(document.styleSheets).some(De=>{var ze;return(ze=De==null?void 0:De.href)==null?void 0:ze.includes(_e)})){const De=document.createElement("link");De.rel="stylesheet",De.href=_e,document.head.appendChild(De)}};P[j1]=P[j1]||{};const J=P[j1],X=_e=>(J[_e]||(J[_e]=fetch(_e).then(De=>{if(!De.ok)throw new Error(`Failed to load ${_e}: ${De.status}`);return De.text()}).then(De=>{const ze=document.createElement("script");ze.textContent=`/* vs-form loader ${_e} */
|
|
301
|
+
${De}`,document.head.appendChild(ze)})),J[_e]),se=(async()=>{O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),window.L||await X("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),await X("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"),await X("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js");const _e=window.L;if(!_e)throw new Error("Leaflet global not available after loading scripts");return _e})().catch(_e=>{throw delete P[Ip],_e});return P[Ip]=se,se}function me(){const P=navigator.platform.toUpperCase().includes("MAC");return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":P?"Використовуйте Ctrl або ⌘ + прокрутка для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}function be(){if(!i.handleZoom||!u.value||!z)return null;let P;const O=X=>{const se=X.ctrlKey||X.metaKey||X.shiftKey;if(!i.ctrlZoom){c.value=!1,z.scrollWheelZoom.enable();return}if(!se){c.value=!0,f.value=me(),clearTimeout(P),P=window.setTimeout(()=>c.value=!1,1200);return}X.preventDefault(),X.stopPropagation(),c.value=!1,z.scrollWheelZoom.enable(),setTimeout(()=>z.scrollWheelZoom.disable(),120)},J=X=>{if(X.touches.length===1){if(!i.ctrlZoom)return;c.value=!0,f.value=me(),clearTimeout(P),P=window.setTimeout(()=>c.value=!1,3e3)}else c.value=!1};return u.value.addEventListener("wheel",O,{passive:!1}),u.value.addEventListener("touchstart",J,{passive:!0}),z.on("wheel",X=>{var se,_e,De,ze,kt,xt,Yt;i.ctrlZoom&&((se=X.originalEvent)!=null&&se.ctrlKey||(_e=X.originalEvent)!=null&&_e.metaKey||(De=X.originalEvent)!=null&&De.shiftKey||((kt=(ze=X.originalEvent)==null?void 0:ze.preventDefault)==null||kt.call(ze),(Yt=(xt=X.originalEvent)==null?void 0:xt.stopPropagation)==null||Yt.call(xt)))}),()=>{var X,se;(X=u.value)==null||X.removeEventListener("wheel",O),(se=u.value)==null||se.removeEventListener("touchstart",J),clearTimeout(P)}}function fe(P,O){return P!=null&&P.id?String(P.id):P!=null&&P.url?`${P.url}-${O}`:`layer-${O}`}function ce(P){var se;const O=((P==null?void 0:P.url)??"").trim();if(!O)return"";if(/^https?:\/\//i.test(O))return O;const J=((se=window.location)==null?void 0:se.origin)??"",X=O.replace(/^\/+/,"");return`${J}/${X}`}function W(P){const O=(P==null?void 0:P.style)??{};return J=>{const{colorAttr:X}=O,se=O.colorSet??{},_e=typeof X=="string"?(se==null?void 0:se[J==null?void 0:J[X]])??O.color??"#3388ff":O.color??"#3388ff",De=O.stroke??_e;return{weight:O.width??1,color:De,opacity:O.opacity??1,fill:O.type?O.type!=="polyline":!0,fillColor:_e,fillOpacity:O.opacity??.5}}}function H(P){var O,J,X;return((O=P==null?void 0:P.layer)==null?void 0:O.properties)||((X=(J=P==null?void 0:P.layer)==null?void 0:J.feature)==null?void 0:X.properties)||(P==null?void 0:P.properties)||{}}function j(P,O={}){return P.popup===!1?[]:Array.isArray(P.popup)&&P.popup.length?P.popup.map(J=>{if(!(J!=null&&J.field))return null;const X=O[J.field];return X==null||X===""?null:{key:J.label||J.field,value:String(X)}}).filter(J=>!!J):Object.entries(O).filter(([J])=>typeof J=="string"&&J).slice(0,5).map(([J,X])=>({key:J,value:X==null?"—":String(X)}))}function oe(P,O){if(!z||!(O!=null&&O.latlng))return;const J=z.latLngToContainerPoint(O.latlng),X=H(O),se=j(P,X);if(!se.length){le(P.id);return}A.value={layerId:P.id,title:(X==null?void 0:X.name)||P.title||P.name,properties:X,entries:se,point:{x:J.x,y:J.y}}}function le(P){var O;P&&((O=A.value)==null?void 0:O.layerId)!==P||(A.value=null)}function we(P){var se,_e,De,ze,kt,xt,Yt;const O=((P==null?void 0:P.service)??"").toLowerCase(),J=ce(P),X=P.sourceLayer||P.layer||P.service_layer||P.service_key||P.map_key||((se=P.dataset)==null?void 0:se.layer)||P.id||P.table_name;if(O==="vtile"){const dt=k.value;if((_e=dt==null?void 0:dt.vectorGrid)!=null&&_e.protobuf&&!(dt!=null&&dt.maplibreGL)){const ut=dt.vectorGrid.protobuf(J,{interactive:!0,maxNativeZoom:P.maxzoom??19,vectorTileLayerStyles:{[X??"default"]:W(P),default:W(P)}});return(De=ut==null?void 0:ut.on)==null||De.call(ut,"mouseover",_r=>oe(P,_r)),(ze=ut==null?void 0:ut.on)==null||ze.call(ut,"mousemove",_r=>oe(P,_r)),(kt=ut==null?void 0:ut.on)==null||kt.call(ut,"mouseout",()=>le(P.id)),ut}if(dt!=null&&dt.maplibreGL&&(window!=null&&window.maplibregl)){const ut=J;return ut?dt.maplibreGL({style:ut,interactive:!1,pane:"overlayPane"}):null}return null}return O==="tile"||/^https?:\/\//i.test(J)||J.includes("{z}")?k.value.tileLayer(J,{opacity:((xt=P==null?void 0:P.style)==null?void 0:xt.opacity)??1,pane:Lp}):k.value.tileLayer(J,{opacity:((Yt=P==null?void 0:P.style)==null?void 0:Yt.opacity)??1,pane:Lp})}function $(P){var ze,kt,xt,Yt;const O=k.value;if(!O)return null;const J=("bounds"in P?P.bounds:void 0)??i.bounds??x.value;if(!Array.isArray(J)||!J.length)return null;const X={color:((ze=P.style)==null?void 0:ze.stroke)??((kt=P.style)==null?void 0:kt.color)??"#2563eb",weight:((xt=P.style)==null?void 0:xt.width)??2,interactive:!1,opacity:((Yt=P.style)==null?void 0:Yt.opacity)??.8,dashArray:"4 4"},se=Array.isArray(P.bounds)&&P.bounds.length?P.bounds:J,_e=ne(se);if(!_e.length||!(O!=null&&O.polyline))return null;const De=_e.map(dt=>{if(!dt.length)return dt;const ut=dt[0],_r=dt[dt.length-1];return ut&&_r&&typeof _r.equals=="function"&&!_r.equals(ut)?[...dt,ut]:dt});return O.polyline(De,X)}function ne(P){const O=k.value;if(!O||!Array.isArray(P))return[];const J=se=>{if(!Array.isArray(se)||se.length<2)return null;const[_e,De]=se;return!Number.isFinite(Number(De))||!Number.isFinite(Number(_e))?null:O.latLng(Number(De),Number(_e))},X=se=>Array.isArray(se)&&se.length>=2&&se.every(_e=>Number.isFinite(Number(_e)));if(P.length&&X(P[0])){const se=P.map(J).filter(Boolean);return se.length?[se]:[]}return P.length&&Array.isArray(P[0])&&Array.isArray(P[0][0])&&X(P[0][0][0])?P.flatMap(se=>Array.isArray(se)?se:[]).map(se=>Array.isArray(se)?se.map(J).filter(Boolean):[]).filter(se=>se.length):P.length&&Array.isArray(P[0])&&X(P[0][0])?P.map(se=>Array.isArray(se)?se.map(J).filter(Boolean):[]).filter(se=>se.length):[]}function Z(){if(!z||!k.value)return;q&&z.hasLayer(q)&&(z.removeLayer(q),q=null);const P=$({id:"global-bounds",bounds:i.bounds??x.value,style:{}});P&&(q=P,q.addTo(z))}function Ie(){!z||!k.value||T.value.forEach(P=>{const O=C[P];O&&(O.visible?(O.layer||(O.layer=we(O.config)),O.boundsLayer||(O.boundsLayer=$(O.config)),O.layer&&!z.hasLayer(O.layer)&&O.layer.addTo(z),O.boundsLayer&&!z.hasLayer(O.boundsLayer)&&O.boundsLayer.addTo(z)):(O.layer&&z.hasLayer(O.layer)&&z.removeLayer(O.layer),O.boundsLayer&&z.hasLayer(O.boundsLayer)&&z.removeLayer(O.boundsLayer),le(O.id)))})}function Qe(P){if(s.value)return;const O=C[P];O&&(O.visible=!O.visible,O.visible?(O.layer||(O.layer=we(O.config)),O.boundsLayer||(O.boundsLayer=$(O.config)),O.layer&&!z.hasLayer(O.layer)&&O.layer.addTo(z),O.boundsLayer&&!z.hasLayer(O.boundsLayer)&&O.boundsLayer.addTo(z)):(O.layer&&z.hasLayer(O.layer)&&z.removeLayer(O.layer),O.boundsLayer&&z.hasLayer(O.boundsLayer)&&z.removeLayer(O.boundsLayer),le(O.id)))}d.watch(()=>i.layers,P=>{const O=Array.isArray(P)?P:[],J=[],X=new Set;O.forEach((se,_e)=>{if(!se)return;const De=fe(se,_e);J.push(De),X.add(De);const ze=C[De],kt={...se,id:De},xt=(ze==null?void 0:ze.visible)??!!(kt!=null&&kt.visible);ze&&(ze.layer&&(z!=null&&z.hasLayer(ze.layer))&&z.removeLayer(ze.layer),ze.boundsLayer&&(z!=null&&z.hasLayer(ze.boundsLayer))&&z.removeLayer(ze.boundsLayer),le(De)),C[De]={id:De,config:kt,visible:xt,layer:null,boundsLayer:null}}),Object.keys(C).forEach(se=>{if(!X.has(se)){const _e=C[se];_e!=null&&_e.layer&&(z!=null&&z.hasLayer(_e.layer))&&z.removeLayer(_e.layer),_e!=null&&_e.boundsLayer&&(z!=null&&z.hasLayer(_e.boundsLayer))&&z.removeLayer(_e.boundsLayer),le(se),delete C[se]}}),T.value=J,Ie()},{immediate:!0,deep:!0}),d.watch(()=>i.bounds,()=>{z&&(Object.values(C).forEach(P=>{P.boundsLayer&&z.hasLayer(P.boundsLayer)&&z.removeLayer(P.boundsLayer),P.boundsLayer=null}),Z(),Ie())},{deep:!0}),d.watch(()=>i.katottg,async P=>{var O,J;if(x.value=[],!P){Z();return}try{const X=await fetch(`https://data.gki.com.ua/api-user/atu/${P}`);if(!(X!=null&&X.ok))return;const se=(J=(O=await X.json())==null?void 0:O.geometry)==null?void 0:J.coordinates;Array.isArray(se)&&se.length&&(x.value=se)}catch(X){console.error("Failed to fetch KATOTTG bounds",X)}finally{Z(),Ie()}},{immediate:!0}),d.watch(()=>i.modelValue,P=>{if(!z||!K){w.value=P;return}Gr(P)},{deep:!0});function Fe(P){const O=k.value;return P instanceof O.Circle?"Circle":P instanceof O.Rectangle?"Rectangle":P instanceof O.Polygon&&!(P instanceof O.Rectangle)?"Polygon":P instanceof O.Polyline&&!(P instanceof O.Polygon)?"Polyline":P instanceof O.Marker?"Point":"Feature"}function $t(P){var J,X,se,_e;const O=k.value;if(P instanceof O.Circle){const De=P.getRadius();return Math.PI*(De*De)/1e6}if(P instanceof O.Polygon||P instanceof O.Rectangle)try{const De=P.getLatLngs();if(!Array.isArray(De)||!De.length)return null;if(!Array.isArray(De[0])){const xt=(J=O.GeometryUtil)!=null&&J.geodesicArea?O.GeometryUtil.geodesicArea(De):0;return xt?Math.abs(xt)/1e6:0}const ze=De[0];if(ze.length>0&&(ze[0]instanceof O.LatLng||typeof((X=ze[0])==null?void 0:X.lat)=="number")){const{feature:xt}=P;if(((se=xt==null?void 0:xt.geometry)==null?void 0:se.type)==="MultiPolygon"){const dt=De.reduce((ut,_r)=>{var Xc;if(!Array.isArray(_r)||!_r.length)return ut;if((Xc=O.GeometryUtil)!=null&&Xc.geodesicArea){const MP=O.GeometryUtil.geodesicArea(_r);if(MP)return ut+Math.abs(MP)}return ut},0);return dt?dt/1e6:0}const Yt=(_e=O.GeometryUtil)!=null&&_e.geodesicArea?O.GeometryUtil.geodesicArea(De):0;return Yt?Math.abs(Yt)/1e6:0}const kt=De.reduce((xt,Yt)=>{var ut;if(!Array.isArray(Yt)||!Yt.length)return xt;const dt=Array.isArray(Yt[0])?Yt[0]:Yt;if((ut=O.GeometryUtil)!=null&&ut.geodesicArea){const _r=O.GeometryUtil.geodesicArea(dt);if(_r)return xt+Math.abs(_r)}return xt},0);return kt?kt/1e6:0}catch{return null}return null}function Ht(P){return P instanceof k.value.Circle?P.getLatLng():P.getBounds?P.getBounds().getCenter():P.getLatLng?P.getLatLng():z.getCenter()}function Wt(P){const O=K.toGeoJSON(),J=[],X=[];let se=null;const _e=ze=>{if(ze)switch(ze.type){case"Point":se=ze;break;case"Polygon":J.push(ze.coordinates);break;case"MultiPolygon":J.push(...ze.coordinates);break;case"LineString":X.push(ze.coordinates);break;case"MultiLineString":X.push(...ze.coordinates);break;case"GeometryCollection":(ze.geometries||[]).forEach(_e);break}};((O==null?void 0:O.features)||[]).forEach(ze=>_e(ze.geometry));const De=se||(J.length?{type:J.length===1?"Polygon":"MultiPolygon",coordinates:J.length===1?J[0]:J}:X.length?{type:X.length===1?"LineString":"MultiLineString",coordinates:X.length===1?X[0]:X}:null);!(P!=null&&P.silent)&&!S&&o("update:modelValue",De),y.value=K.getLayers().length}function Gr(P){var X,se;if(!K||!k.value)return;K.clearLayers();const O=wge(P);if(!O){p.value=null,y.value=0;return}k.value.geoJSON(O).eachLayer(_e=>K.addLayer(_e)),S=!0,Wt({silent:!0}),S=!1,ge();const J=(X=K.getBounds)==null?void 0:X.call(K);(se=J==null?void 0:J.isValid)!=null&&se.call(J)&&(z==null||z.fitBounds(J,{padding:[24,24]}))}function ge(){var xt,Yt;const P=K.getLayers();if(!P.length){p.value=null,y.value=0;return}const O=P[P.length-1],J=Fe(O),X=Ht(O),se=K.toGeoJSON(),_e=((xt=se==null?void 0:se.features)==null?void 0:xt.some(dt=>{var ut;return((ut=dt.geometry)==null?void 0:ut.type)==="MultiPolygon"}))||((Yt=se==null?void 0:se.geometry)==null?void 0:Yt.type)==="MultiPolygon",De=P.length>1&&P.every(dt=>dt instanceof k.value.Polygon||dt instanceof k.value.Rectangle),ze=_e||De;let kt=null;if(ze){const dt=P.reduce((ut,_r)=>{const Xc=$t(_r);return ut+(Xc?Xc*1e6:0)},0);kt=dt?dt/1e6:0}else kt=$t(O);p.value={type:J,center:X,areaKm2:kt,layer:O},y.value=P.length}const Ce=d.ref("");function Ge(P){if(s.value||!z||!k.value)return;U!=null&&U.disable&&U.disable();const O=k.value;switch(P){case"marker":U=new O.Draw.Marker(z);break;case"polyline":U=new O.Draw.Polyline(z);break;case"polygon":U=new O.Draw.Polygon(z);break;case"rectangle":U=new O.Draw.Rectangle(z);break}U.enable(),Ce.value=P}function at(){var O;if(s.value)return;const P=(O=p.value)==null?void 0:O.layer;P&&(P.getBounds?z.fitBounds(P.getBounds(),{padding:[30,30]}):P.getLatLng&&z.setView(P.getLatLng(),Math.max(_.value,14)))}function Tt(){s.value||K&&(K.clearLayers(),o("update:modelValue",null),p.value=null,y.value=0)}const fr=d.ref(null);function Fn(){var P;s.value||((P=fr.value)==null||P.click())}function rs(P){var se;if(s.value)return;const O=P.target,J=(se=O.files)==null?void 0:se[0];if(!J)return;const X=new FileReader;X.onload=()=>{try{const _e=JSON.parse(String(X.result));K.clearLayers(),_e&&k.value.geoJSON(_e).eachLayer(De=>K.addLayer(De)),Wt(),ge()}finally{O.value=""}},X.readAsText(J)}function Yc(){if(s.value)return;const P=K.toGeoJSON(),O=new Blob([JSON.stringify(P,null,2)],{type:"application/json"}),J=URL.createObjectURL(O),X=document.createElement("a");X.href=J,X.download="data.geojson",X.click(),URL.revokeObjectURL(J)}function qc(P){!z||!k.value||!V[P]||(G&&z.removeLayer(G),G=k.value.tileLayer(V[P].url,{maxZoom:19,minZoom:6,pane:Np}).addTo(z),F.value=P)}function Zc(P){if(!z||!k.value)return;const O=k.value.latLng(P[0],P[1]);z.setView(O,13)}let Ga=null;return d.onMounted(async()=>{k.value=await ae();const P=k.value;P.drawLocal=$pe,z=P.map(u.value,{zoomControl:!1,scrollWheelZoom:!1}).setView(b.value,_.value),P.control.zoom({position:"bottomright"}).addTo(z);const O=F.value||Object.keys(V)[0];z.createPane(Np),z.getPane(Np).style.zIndex="180",z.createPane(Lp),z.getPane(Lp).style.zIndex="220",O&&V[O]&&(F.value=O,G=P.tileLayer(V[O].url,{maxZoom:19,minZoom:6,pane:Np}).addTo(z)),K=new P.FeatureGroup().addTo(z),z.on(P.Draw.Event.CREATED,X=>{if(s.value)return;const{layer:se}=X;K.clearLayers(),K.addLayer(se),Wt(),ge(),Ce.value=""}),z.on(P.Draw.Event.EDITED,()=>{s.value||(Wt(),ge())}),z.on(P.Draw.Event.DELETED,()=>{s.value||(Wt(),ge())});let J=!1;z.on("mousemove",X=>{J||(z.invalidateSize(),J=!0)}),z.on("zoomend",()=>{_.value=z.getZoom()}),Ga=be(),Ie(),Z(),w.value!==void 0&&(Gr(w.value),w.value=void 0)}),d.watch(()=>i.center,P=>{!Array.isArray(P)||P.length!==2||(b.value=[...P],z&&z.setView(b.value,z.getZoom()))},{deep:!0}),d.watch(()=>i.zoom,P=>{typeof P=="number"&&(_.value=P,z&&z.setZoom(P))}),d.onUnmounted(()=>{Ga==null||Ga(),le(),q&&(z!=null&&z.hasLayer(q))&&(z.removeLayer(q),q=null),z!=null&&z.remove&&z.remove()}),d.watch(l,()=>{setTimeout(()=>{z!=null&&z.invalidateSize&&z.invalidateSize()},50)}),d.watch(g,async P=>{if(!P||!m.value){v.value=null;return}await d.nextTick();const O=m.value.getBoundingClientRect();v.value={top:O.bottom+6,left:O.left}}),(P,O)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body",disabled:!l.value},[d.createElementVNode("div",{class:d.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:l.value}])},[d.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:"w-full h-full"},null,512),d.createVNode(d.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:d.withCtx(()=>[c.value&&i.handleZoom?(d.openBlock(),d.createElementBlock("div",Sge,[d.createElementVNode("div",kge,[d.createElementVNode("p",Ege,d.toDisplayString(f.value),1)])])):d.createCommentVNode("",!0)]),_:1}),E.value.search||E.value.import||E.value.export?(d.openBlock(),d.createElementBlock("div",Cge,[E.value.search?(d.openBlock(),d.createBlock(vge,{key:0,onGoToCoordinates:Zc})):d.createCommentVNode("",!0),E.value.import||E.value.export?(d.openBlock(),d.createElementBlock("div",Tge,[d.createElementVNode("div",Dge,[E.value.import?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Fn,disabled:s.value}," Import ",8,Age)):d.createCommentVNode("",!0),E.value.export?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Yc,disabled:s.value||y.value===0}," Export ",8,Mge)):d.createCommentVNode("",!0)]),d.createElementVNode("input",{ref_key:"importRef",ref:fr,type:"file",onChange:rs,accept:".json,.geojson",class:"hidden",disabled:s.value},null,40,Nge)])):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),I.value.length?(d.openBlock(),d.createElementBlock("div",{key:1,class:"absolute z-[1500] pointer-events-none",style:d.normalizeStyle(L.value)},[d.createElementVNode("div",Lge,[d.createElementVNode("dl",Ige,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(I.value,J=>(d.openBlock(),d.createElementBlock("div",{key:`${J.key}-${J.value}`,class:"flex justify-between gap-2"},[d.createElementVNode("dt",Bge,d.toDisplayString(J.key),1),d.createElementVNode("dd",Vge,d.toDisplayString(J.value),1)]))),128))])])],4)):d.createCommentVNode("",!0),d.createElementVNode("div",Rge,[d.createElementVNode("div",Pge,[E.value.point?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="marker"}]),title:"Point",onClick:O[0]||(O[0]=J=>Ge("marker")),disabled:s.value},[d.createVNode(Wpe)],10,Oge)):d.createCommentVNode("",!0),E.value.line?(d.openBlock(),d.createElementBlock("button",{key:1,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="polyline"}]),title:"Line",onClick:O[1]||(O[1]=J=>Ge("polyline")),disabled:s.value},[d.createVNode(Xpe)],10,zge)):d.createCommentVNode("",!0),E.value.polygon?(d.openBlock(),d.createElementBlock("button",{key:2,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="polygon"}]),title:"Polygon",onClick:O[2]||(O[2]=J=>Ge("polygon")),disabled:s.value},[d.createVNode(Jpe)],10,Fge)):d.createCommentVNode("",!0),E.value.rectangle?(d.openBlock(),d.createElementBlock("button",{key:3,class:d.normalizeClass(["vs-btn",{"vs-active":Ce.value==="rectangle"}]),title:"Rectangle",onClick:O[3]||(O[3]=J=>Ge("rectangle")),disabled:s.value},[d.createVNode(nge)],10,$ge)):d.createCommentVNode("",!0),d.createElementVNode("button",{class:"vs-btn mt-5",onClick:O[4]||(O[4]=J=>l.value=!l.value),title:"Full Screen"},[d.createVNode(sge,{style:{width:"12px",height:"12px"}})])])]),d.createElementVNode("div",{class:d.normalizeClass(["absolute left-4 z-[1000]",p.value?"bottom-8":"bottom-4"])},[d.createElementVNode("div",Gge,[d.createVNode(xge,{basemaps:d.unref(V),onOnLayerChange:qc},null,8,["basemaps"]),D.value.length?(d.openBlock(),d.createElementBlock("div",Uge,[O[9]||(O[9]=d.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Шари",-1)),d.createElementVNode("div",Hge,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(D.value,J=>(d.openBlock(),d.createElementBlock("label",{key:J.id,class:"flex items-center gap-2 cursor-pointer select-none"},[d.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:J.visible,disabled:s.value,onChange:X=>Qe(J.id)},null,40,Wge),d.createElementVNode("span",Yge,d.toDisplayString(J.config.title||J.config.name||J.id),1)]))),128))])])):d.createCommentVNode("",!0)])],2),d.createElementVNode("div",qge,[p.value?(d.openBlock(),d.createElementBlock("div",Zge,[d.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:O[5]||(O[5]=J=>g.value=!0),onMouseleave:O[6]||(O[6]=J=>g.value=!1)},[d.createElementVNode("div",Xge,[O[10]||(O[10]=d.createTextVNode(" Type: ",-1)),d.createElementVNode("span",jge,d.toDisplayString(p.value.type),1)]),h.value?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"addressEl",ref:m,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+d.toDisplayString(h.value),513)):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[g.value&&h.value&&v.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:d.normalizeStyle({top:v.value.top+"px",left:v.value.left+"px"})},d.toDisplayString(h.value),5)):d.createCommentVNode("",!0)]))],32),d.createElementVNode("div",Kge,[d.createElementVNode("div",Qge,[O[11]||(O[11]=d.createTextVNode(" Center: ",-1)),d.createElementVNode("b",null,d.toDisplayString(p.value.center.lat.toFixed(5))+", "+d.toDisplayString(p.value.center.lng.toFixed(5)),1)]),p.value.areaKm2!==null?(d.openBlock(),d.createElementBlock("div",Jge,[O[12]||(O[12]=d.createTextVNode(" Area: ",-1)),d.createElementVNode("b",null,d.toDisplayString(p.value.areaKm2.toFixed(1))+" km²",1)])):(d.openBlock(),d.createElementBlock("div",eve,O[13]||(O[13]=[d.createTextVNode("Area: ",-1),d.createElementVNode("b",null,"—",-1)]))),d.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:O[7]||(O[7]=J=>at()),disabled:s.value},O[14]||(O[14]=[d.createElementVNode("svg",{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:"w-3 h-3"},[d.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),d.createElementVNode("path",{d:"M7 10l6 0"}),d.createElementVNode("path",{d:"M10 7l0 6"}),d.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)]),8,tve),d.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:O[8]||(O[8]=J=>Tt()),disabled:s.value},[d.createVNode(Sl,{class:"w-3 h-3"})],8,rve)])])):d.createCommentVNode("",!0)])],2)],8,["disabled"]))}}),qR=Ye(nve,[["__scopeId","data-v-85843f06"]]),ave=["data-focus"],ive={class:"flex items-center"},ove={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},sve=["onClick","aria-label"],lve={key:0,class:"absolute text-gray-500 truncate pl-2"},uve={class:"flex-1 min-w-[2px]"},cve=["placeholder"],dve={class:"flex items-center shrink-0"},fve=["disabled"],ZR=d.defineComponent({__name:"vs-input-tag",props:d.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:d.mergeModels(["update:modelValue"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=e;br(t.style);const a=d.ref(null),i=d.ref(null),o=d.ref(null),s=d.ref(!1),l=d.ref(""),u=d.useModel(r,"modelValue"),c=d.computed(()=>t.placeholder||"Add tag…"),f=d.computed(()=>{var S;return((S=u.value)==null?void 0:S.length)===0&&l.value===""}),h=d.computed(()=>{var S;return!t.disabled&&((S=u.value)==null?void 0:S.length)>0}),p=d.computed(()=>t.disabled),g=async()=>{p.value||await d.nextTick(()=>{var S;return(S=o.value)==null?void 0:S.focus()})},v=S=>{const k=S.trim();k!==""&&(!u.value||!Array.isArray(u.value)?u.value=[k]:t.unique?u.value.includes(k)||(u.value=[...u.value,k]):u.value=[...u.value,k],l.value="")},m=()=>{const S=l.value;S.trim()!==""&&v(S),l.value=""},y=S=>{const k=u.value.slice();k.splice(S,1),n("update:modelValue",k)},b=()=>{n("update:modelValue",[])},_=()=>{p.value||(s.value=!0)},x=()=>{s.value=!1,!p.value&&m()},w=S=>{const{key:k}=S;k==="Enter"?(S.preventDefault(),m()):k==="Backspace"&&l.value===""&&u.value.length>0&&y(u.value.length-1)};return(S,k)=>(d.openBlock(),d.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:a,onClick:k[1]||(k[1]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["relative w-full font-sans",t.customClass]),role:"group","aria-label":"Tag input"},[d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",s.value?"border-blue-500 ring-1 ring-blue-500":"",p.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":s.value?"true":"false",onClick:g},[d.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:i},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(E,C)=>(d.openBlock(),d.createElementBlock("div",{key:C,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[d.createElementVNode("div",ive,[d.createElementVNode("div",ove,d.toDisplayString(E),1)]),d.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:d.withModifiers(T=>y(C),["stop"]),"aria-label":`Remove ${E}`},k[2]||(k[2]=[d.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,sve)]))),128)),f.value?(d.openBlock(),d.createElementBlock("div",lve,d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),d.createElementVNode("div",uve,[p.value?d.createCommentVNode("",!0):d.withDirectives((d.openBlock(),d.createElementBlock("input",{key:0,ref_key:"inputRef",ref:o,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":k[0]||(k[0]=E=>l.value=E),onFocus:_,onBlur:x,onKeydown:w,placeholder:u.value&&u.value.length?"":void 0},null,40,cve)),[[d.vModelText,l.value]])])],512),d.createElementVNode("div",dve,[h.value?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:p.value,onClick:d.withModifiers(b,["stop"])},k[3]||(k[3]=[d.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[d.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,fve)):d.createCommentVNode("",!0)])],10,ave)],2)],512))}}),hve={class:"relative flex gap-1 bg-white w-full"},pve=["disabled","placeholder"],gve=d.defineComponent({__name:"vs-input-slug",props:d.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=d.inject("values"),t=r,n=d.useModel(r,"modelValue");function a(o){const s={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return o.toLowerCase().split("").map(l=>s[l]||l).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const i=()=>{var l,u;const o=(u=(l=e==null?void 0:e.value)==null?void 0:l[t.parent||""])==null?void 0:u.toString(),s=a(o);n.value=s.toString()};return(o,s)=>(d.openBlock(),d.createElementBlock("div",hve,[d.withDirectives(d.createElementVNode("input",{ref:"vsText",disabled:o.disabled,placeholder:o.placeholder,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,pve),[[d.vModelText,n.value]]),d.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:i}," Gen ")]))}}),XR=Ye(gve,[["__scopeId","data-v-b0eba370"]]),vve={class:"relative flex gap-1 bg-white w-full"},mve=["disabled","placeholder"],yve=["disabled"],bve={key:0},_ve={key:1},xve=d.defineComponent({__name:"vs-input-codegen",props:d.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(!1),a=d.computed(()=>e.init!==!1),i=d.computed(()=>!!e.table&&!!e.code),o=()=>{if(!i.value)return"";const u=encodeURIComponent(String(e.table)),c=encodeURIComponent(String(e.code));return`/api/code-gen/${u}/${c}`},s=async()=>{if(!i.value||n.value)return;const u=o();if(u){n.value=!0;try{const c=await(await fetch(u)).text();t.value=c}finally{n.value=!1}}},l=()=>{a.value&&(t.value||s())};return d.onMounted(()=>{l()}),d.watch(()=>[e.table,e.code,e.init],()=>{l()}),(u,c)=>(d.openBlock(),d.createElementBlock("div",vve,[d.withDirectives(d.createElementVNode("input",{disabled:u.disabled,placeholder:u.placeholder,"onUpdate:modelValue":c[0]||(c[0]=f=>t.value=f),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,mve),[[d.vModelText,t.value]]),d.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:n.value||u.disabled||!i.value,onClick:s},[n.value?(d.openBlock(),d.createElementBlock("span",_ve,"...")):(d.openBlock(),d.createElementBlock("span",bve,"Gen"))],8,yve)]))}}),jR=Ye(xve,[["__scopeId","data-v-6ee5237d"]]),wve={class:"w-full"},Sve={ref:"sortableContainer",class:"flex flex-col gap-1"},kve=["onDragstart","onDrop"],Eve={class:"w-1/3"},Cve={class:"w-2/3"},Tve=["onClick"],Dve={key:0,class:"text-[14px] text-gray-700"},Ave={class:"mt-2 w-full flex items-center"},Mve=["disabled"],Nve=d.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=v=>`${v}-${Math.random().toString(36).substring(2,15)}`,n=d.inject("values"),a=r,i=e,o=a.addButtonText??"Додати",s=a.ignore??[],l=d.ref([]),u=d.ref(null);(()=>{var m;const v=a.parent&&((m=n==null?void 0:n.value)==null?void 0:m[a.parent])||a.modelValue||{};l.value=Object.entries(v).filter(([y])=>!s.includes(y)).map(([y,b])=>({id:t("key-value-"),key:y,value:b}))})();function c(v){u.value=v}function f(v){if(u.value===null||u.value===v)return;const m=l.value.splice(u.value,1)[0];l.value.splice(v,0,m),u.value=null}const h=d.computed(()=>l.value.some(v=>v.key&&!v.value||!v.key&&v.value)),p=()=>{l.value.push({id:t("key-value-"),key:"",value:""})},g=v=>{l.value=l.value.filter(m=>m.id!==v)};return d.watch(l,v=>{const m={};v.forEach(b=>{b.key&&b.value!==void 0&&(m[b.key]=b.value)});const y={};s.length&&s.forEach(b=>{var _,x;y[b]=a.parent?(x=(_=n==null?void 0:n.value)==null?void 0:_[a.parent])==null?void 0:x[b]:void 0}),n!=null&&n.value&&a.parent&&(n.value[a.parent]={...y,...m}),i("update:modelValue",m)},{deep:!0}),(v,m)=>(d.openBlock(),d.createElementBlock("div",wve,[d.createElementVNode("div",Sve,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(l.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:y.id,class:d.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":u.value===b}]),draggable:"true",onDragstart:_=>c(b),onDragover:m[0]||(m[0]=d.withModifiers(()=>{},["prevent"])),onDrop:_=>f(b)},[m[1]||(m[1]=d.createStaticVNode('<button class="cursor-move" data-v-81b9444f><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-81b9444f><circle cx="15" cy="12" r="1.5" data-v-81b9444f></circle><circle cx="15" cy="24" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="12" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="24" r="1.5" data-v-81b9444f></circle><circle cx="21" cy="18" r="1.5" data-v-81b9444f></circle><circle cx="15" cy="18" r="1.5" data-v-81b9444f></circle></svg></button>',1)),d.createElementVNode("div",Eve,[d.createVNode(wl,{modelValue:y.key,"onUpdate:modelValue":_=>y.key=_,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),d.createElementVNode("div",Cve,[d.createVNode(wl,{modelValue:y.value,"onUpdate:modelValue":_=>y.value=_,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),d.createElementVNode("button",{onClick:_=>g(y.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[d.createVNode(d.unref(Dp),{height:"16",width:"16"})],8,Tve)],42,kve))),128))],512),l.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",Dve," Дані для відображення відсутні ")),d.createElementVNode("div",Ave,[d.createElementVNode("button",{type:"button",onClick:p,disabled:h.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[d.createVNode(da,{height:"14",width:"14"}),d.createTextVNode(" "+d.toDisplayString(d.unref(o)),1)],8,Mve)])]))}}),KR=Ye(Nve,[["__scopeId","data-v-81b9444f"]]),Lve={class:"w-full"},Ive={ref:"sortableContainer",class:"flex flex-col gap-1"},Bve=["onDragstart","onDrop"],Vve=["disabled"],Rve={class:"flex-1"},Pve=["onClick","disabled"],Ove={key:0,class:"text-[14px] text-gray-700"},zve={class:"mt-2 w-full flex items-center"},Fve=["disabled"],$ve=d.defineComponent({__name:"vs-input-text-array",props:d.mergeModels({addButtonText:{default:"Додати"},inputType:{default:"text"},placeholder:{default:"Значення"},mask:{default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref([]),a=d.ref(null),i=d.computed(()=>!!e.disabled),o=d.computed(()=>e.placeholder??""),s=d.computed(()=>e.addButtonText??"Додати");let l=!1;const u=m=>`${m}-${Math.random().toString(36).substring(2,15)}`,c=m=>{const y=m??t.value??[];n.value=y.map((b,_)=>{var x;return{id:((x=n.value[_])==null?void 0:x.id)??u("text-array"),value:b??""}})};c(),d.watch(()=>t.value,m=>{if(l){l=!1;return}c(m||[])},{deep:!0}),d.watch(n,m=>{l=!0,t.value=m.map(y=>y.value).filter(y=>y!=null&&y!=="")},{deep:!0});const f=d.computed(()=>i.value||n.value.some(m=>!m.value));function h(){f.value||(n.value=[...n.value,{id:u("text-array"),value:""}])}function p(m){i.value||(n.value=n.value.filter(y=>y.id!==m))}function g(m){i.value||(a.value=m)}function v(m){if(i.value||a.value===null||a.value===m)return;const y=[...n.value],[b]=y.splice(a.value,1);y.splice(m,0,b),n.value=y,a.value=null}return(m,y)=>(d.openBlock(),d.createElementBlock("div",Lve,[d.createElementVNode("div",Ive,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(b,_)=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:d.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":a.value===_}]),draggable:"true",onDragstart:x=>g(_),onDragover:y[0]||(y[0]=d.withModifiers(()=>{},["prevent"])),onDrop:x=>v(_)},[d.createElementVNode("button",{class:"cursor-move",type:"button",disabled:i.value},y[1]||(y[1]=[d.createStaticVNode('<svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-66316a33><circle cx="15" cy="12" r="1.5" data-v-66316a33></circle><circle cx="15" cy="24" r="1.5" data-v-66316a33></circle><circle cx="21" cy="12" r="1.5" data-v-66316a33></circle><circle cx="21" cy="24" r="1.5" data-v-66316a33></circle><circle cx="21" cy="18" r="1.5" data-v-66316a33></circle><circle cx="15" cy="18" r="1.5" data-v-66316a33></circle></svg>',1)]),8,Vve),d.createElementVNode("div",Rve,[m.inputType==="text"?(d.openBlock(),d.createBlock(wl,{key:0,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="tel"?(d.openBlock(),d.createBlock(W1,{key:1,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="email"?(d.openBlock(),d.createBlock(H1,{key:2,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):d.createCommentVNode("",!0),m.inputType==="mask"?(d.openBlock(),d.createBlock(U1,{key:3,modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,mask:m.mask,disabled:i.value,placeholder:o.value},null,8,["modelValue","onUpdate:modelValue","mask","disabled","placeholder"])):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",onClick:x=>p(b.id),disabled:i.value,class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"},[d.createVNode(d.unref(Dp),{height:"16",width:"16"})],8,Pve)],42,Bve))),128))],512),n.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",Ove," Дані для відображення відсутні ")),d.createElementVNode("div",zve,[d.createElementVNode("button",{type:"button",onClick:h,disabled:f.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[d.createVNode(da,{height:"14",width:"14"}),d.createTextVNode(" "+d.toDisplayString(s.value),1)],8,Fve)])]))}}),QR=Ye($ve,[["__scopeId","data-v-66316a33"]]),Gve={class:"flex items-center gap-2 w-full"},Uve=["disabled"],Hve=["disabled"],JR=d.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{inputClass:n}=br(t.style),a=e,i=d.computed({get:()=>t.modelValue||"#000000",set:s=>a("update:modelValue",s)}),o=d.computed(()=>!!t.disabled);return(s,l)=>(d.openBlock(),d.createElementBlock("div",Gve,[d.withDirectives(d.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),disabled:o.value,ref:"color",class:d.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[s.modelValue?"":"text-opacity-50",d.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Uve),[[d.vModelText,i.value]]),d.withDirectives(d.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":l[1]||(l[1]=u=>i.value=u),disabled:o.value},null,8,Hve),[[d.vModelText,i.value]])]))}}),Wve={class:"flex items-center gap-2 w-full"},Yve=["min","max","step","disabled"],qve=["disabled"],eP=d.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{inputClass:n}=br(t.style),a=e,i=d.computed({get:()=>Number(t.modelValue??t.min),set:s=>a("update:modelValue",Number(s))}),o=d.computed(()=>!!t.disabled);return(s,l)=>(d.openBlock(),d.createElementBlock("div",Wve,[d.withDirectives(d.createElementVNode("input",{type:"range","onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),min:s.min,max:s.max,step:s.step,disabled:o.value,ref:"range",class:d.normalizeClass(["w-full cursor-pointer accent-blue-500",[s.modelValue?"":"text-opacity-50",d.unref(n)].join(" ")])},null,10,Yve),[[d.vModelText,i.value]]),d.withDirectives(d.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":l[1]||(l[1]=u=>i.value=u),disabled:o.value},null,8,qve),[[d.vModelText,i.value]])]))}}),Zve=["placeholder","disabled","name"],Xve=["type","value","onInput","placeholder","disabled"],jve=["onClick"],tP=d.defineComponent({__name:"vs-input-array",props:d.mergeModels({count:{default:1},limit:{default:1},mask:{default:""},unmask:{type:Boolean,default:!1},inputType:{default:"text"},isAdded:{type:Boolean,default:!1},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.ref(e.count),n=d.computed(()=>e.limit),{inputClass:a}=br(e.style),i=d.useModel(r,"modelValue"),o=d.computed(()=>!!e.disabled),s=d.computed(()=>e.placeholder??"");d.watchEffect(()=>{var m;const v=((m=i.value)==null?void 0:m.length)??0;v<t.value&&(i.value=[...i.value??[],...Array(t.value-v)])});const l=d.ref({}),u=d.ref({});function c(v,m){v&&(l.value[m]=v)}async function f(v,m){var b;if(!v||e.inputType!=="mask")return;const{default:y}=await Promise.resolve().then(()=>sx);u.value[m]&&u.value[m].destroy(),u.value[m]=y(v,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),u.value[m].on("accept",()=>{const _=[...i.value||[]];_[m]=e.unmask?u.value[m].unmaskedValue:u.value[m].value,i.value=_}),u.value[m].on("complete",()=>{const _=[...i.value||[]];_[m]=e.unmask?u.value[m].unmaskedValue:u.value[m].value,i.value=_}),(b=i.value)!=null&&b[m]&&(u.value[m].value=i.value[m])}function h(v,m){if(o.value)return;const y=v.target.value??null,b=[...i.value];b[m]=e.inputType==="text"?y:Number(y),i.value=b}function p(){t.value+=1;const v=e.inputType==="text"||e.inputType==="mask"?null:0;i.value=[...i.value,v],e.inputType==="mask"&&setTimeout(()=>{const m=t.value-1;l.value[m]&&f(l.value[m],m)},0)}function g(v){if(t.value>1){u.value[v]&&(u.value[v].destroy(),delete u.value[v]),t.value-=1,i.value=i.value.filter((y,b)=>b!==v);const m={};Object.keys(u.value).forEach(y=>{const b=parseInt(y,10);b>v?m[b-1]=u.value[b]:b<v&&(m[b]=u.value[b])}),u.value=m}}return d.onMounted(()=>{if(e.inputType==="mask")for(let v=0;v<t.value;v+=1)l.value[v]&&f(l.value[v],v)}),d.onBeforeUnmount(()=>{Object.values(u.value).forEach(v=>{v&&v.destroy()})}),d.watch(()=>e.mask,v=>{e.inputType==="mask"&&Object.values(u.value).forEach(m=>{m&&m.updateOptions({mask:v,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})})}),d.watch(i,v=>{e.inputType==="mask"&&v&&v.forEach((m,y)=>{u.value[y]&&u.value[y].value!==m&&(u.value[y].value=m||"")})},{deep:!0}),(v,m)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["grid gap-2",`grid-cols-${n.value}`])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.value,y=>{var b;return d.openBlock(),d.createElementBlock("div",{key:y,class:"flex items-center gap-2 w-full"},[v.inputType==="mask"?(d.openBlock(),d.createElementBlock("input",{key:0,type:"text",ref_for:!0,ref:_=>c(_,y-1),placeholder:v.placeholder,disabled:v.disabled,name:`${v.name}[${y-1}]`,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(a),{"!border-red-600":v.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Zve)):(d.openBlock(),d.createElementBlock("input",{key:1,type:v.inputType,value:(b=i.value)==null?void 0:b[y-1],onInput:_=>h(_,y-1),placeholder:s.value,disabled:o.value,class:d.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.unref(a),{"!border-red-600":v.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Xve)),!v.disabled&&y===t.value&&v.isAdded?(d.openBlock(),d.createElementBlock("button",{key:2,type:"button",onClick:d.withModifiers(p,["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-green-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[d.createVNode(da,{height:"18",width:"18"})])):d.createCommentVNode("",!0),!v.disabled&&t.value>1&&v.isAdded?(d.openBlock(),d.createElementBlock("button",{key:3,type:"button",onClick:d.withModifiers(_=>g(y-1),["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[d.createVNode(Dp,{height:"18",width:"18"})],8,jve)):d.createCommentVNode("",!0)])}),128))],2))}}),Kve=["aria-expanded","data-focus"],Qve=["placeholder","disabled","readonly"],Jve={class:"max-h-full"},eme=["onClick","disabled"],tme={key:0,class:"px-3 py-2 text-sm text-stone-500"},rme={class:"flex flex-col gap-1"},nme=["onDragstart","onDrop"],ame=["disabled"],ime=["title"],ome=["disabled","onClick","aria-label"],sme={key:0,class:"text-xs text-stone-500"},lme=d.defineComponent({__name:"vs-input-array-select",props:d.mergeModels({options:{default:()=>[]},data:{default:""},api:{default:""},prefix:{default:"api"},host:{default:""},parent:{},search:{type:Boolean,default:!0},maxHeight:{default:280},start:{default:0},slot:{},disabled:{type:Boolean,default:!1},style:{},customClass:{},modelValue:{},error:{},name:{},placeholder:{default:"Оберіть значення"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:d.mergeModels(["change","update:modelValue","value-selected"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=e,a=d.useModel(r,"modelValue"),i=d.ref([]),o=d.ref(t.options??[]),s=d.ref({}),l=d.ref({}),u=d.ref({keyword:"",parent:null}),c=d.ref(""),f=d.ref(!1),h=d.ref(null),p=d.ref(null),g=d.ref(null);let v=!1,m=!1;const y=d.inject("values"),b=d.computed(()=>!!t.disabled),_=d.computed(()=>t.placeholder??"Оберіть значення"),x=d.computed(()=>t.search!==!1),w=d.computed(()=>`${t.maxHeight??280}px`),S=d.computed(()=>{const $=t.parent??t.parentValue;return $?String($):""}),k=d.computed(()=>{var $;return S.value?(($=y==null?void 0:y.value)==null?void 0:$[S.value])??null:null}),E=$=>$==null?"__null__":String($),C=$=>{if(!$)return"";const ne=$.label??$.text??$.name??$.ua??$.en;return ne?String(ne):$.id!==void 0&&$.id!==null?String($.id):""},T=$=>{const ne=E($);return l.value[ne]||(l.value[ne]=`array-select-${ne}-${Math.random().toString(36).slice(2,8)}`),l.value[ne]},D=d.computed(()=>new Set(i.value.map($=>E($.id)))),A=d.computed(()=>{const $=D.value;let ne=[...o.value];if(!t.data&&c.value.trim()){const Z=c.value.toLowerCase();ne=ne.filter(Ie=>C(Ie).toLowerCase().includes(Z))}return ne.filter(Z=>!$.has(E(Z.id)))}),I=()=>{if(!t.data)return"";const $=t.prefix??"api",ne=t.api??`/${$}/suggest/${t.data}`;return`${t.host??""}${ne}`},L=()=>{i.value.length&&(v=!0,i.value=i.value.map($=>({...$,text:s.value[E($.id)]??$.text})))},B=$=>{const ne=E($.id),Z=C($);Z&&(s.value[ne]=Z)},N=$=>{o.value=$?[...$]:[],$==null||$.forEach(B),L()},V=$=>{if(!$.length)return;const ne=new Map(o.value.map(Z=>[E(Z.id),Z]));$.forEach(Z=>{const Ie=E(Z.id);ne.set(Ie,Z),B(Z)}),o.value=Array.from(ne.values()),L()},R=async($="")=>{var Ie;if(!t.data)return[];const ne=I();if(!ne)return[];const Z=new URLSearchParams;Z.set("json","1"),$&&Z.set("key",$),t.start===1&&Z.set("start","1"),k.value!==null&&k.value!==void 0&&k.value!==""&&Z.set("parent",String(k.value));try{return((Ie=await(await fetch(`${ne}?${Z.toString()}`)).json())==null?void 0:Ie.data)??[]}catch{return[]}},F=async $=>{var Qe;if(!t.data||!$.length)return[];const ne=I();if(!ne)return[];const Z=Array.from(new Set($.map(Fe=>E(Fe)))),Ie=new URLSearchParams;Ie.set("json","1"),Ie.set("val",Z.join(",")),t.start===1&&Ie.set("start","1"),k.value!==null&&k.value!==void 0&&k.value!==""&&Ie.set("parent",String(k.value));try{const Fe=((Qe=await(await fetch(`${ne}?${Ie.toString()}`)).json())==null?void 0:Qe.data)??[];return V(Fe),Fe}catch{return[]}},G=async($="",{force:ne=!1}={})=>{if(!t.data)return;const Z=k.value??null;if(!ne&&u.value.keyword===$&&u.value.parent===Z&&o.value.length>0)return;u.value={keyword:$,parent:Z};const Ie=await R($);N(Ie)},z=(($,ne=200)=>{let Z;return(...Ie)=>{Z&&clearTimeout(Z),Z=setTimeout(()=>$(...Ie),ne)}})(async $=>{t.data&&await G($,{force:!0})},250),K=d.ref(null),U=async($="click")=>{var ne;b.value||f.value||(K.value=$,await G(c.value.trim()),f.value=!0,await d.nextTick(),(ne=g.value)==null||ne.focus())},q=()=>{f.value=!1,K.value=null,d.nextTick(()=>{var $;($=g.value)==null||$.blur()})},ae=async $=>{if($.stopPropagation(),!b.value){if(f.value){if(K.value==="focus"){K.value=null;return}q();return}await U("click")}},me=$=>{$.key==="Escape"&&q()},be=$=>{var Z;const ne=$.target;(Z=p.value)!=null&&Z.contains(ne)||q()},fe=$=>{if($.key==="Escape"){$.preventDefault(),q();return}if($.key==="Enter"){$.preventDefault();const ne=A.value[0];ne&&ce(ne)}},ce=$=>{if(!$)return;const ne=E($.id);if(D.value.has(ne))return;B($);const Z={id:$.id,text:C($)||String($.id??""),key:T($.id)};i.value=[...i.value,Z],W($),c.value="",d.nextTick(()=>{var Ie;(Ie=g.value)==null||Ie.focus()})},W=$=>{const ne=i.value.map(Z=>Z.id);n("value-selected",{name:t.name,value:ne,option:$})},H=$=>{if(b.value)return;const ne=i.value.filter(Z=>E(Z.id)!==E($));i.value=ne},j=$=>{b.value||(h.value=$)},oe=$=>{if(b.value||h.value===null||h.value===$)return;const ne=[...i.value],[Z]=ne.splice(h.value,1);ne.splice($,0,Z),h.value=null,i.value=ne},le=async()=>{const $=(Array.isArray(a.value)?[...a.value]:[]).filter(Z=>Z!=null);if(t.data&&$.length){const Z=$.filter(Ie=>!s.value[E(Ie)]);Z.length&&await F(Z)}const ne=$.map(Z=>({id:Z,text:s.value[E(Z)]??String(Z),key:T(Z)}));v=!0,i.value=ne};d.watch(i,$=>{if(v){v=!1;return}const ne=$.map(Z=>Z.id);m=!0,a.value=ne,n("change",ne)},{deep:!0}),d.watch(a,()=>{if(m){m=!1;return}le()},{deep:!0}),d.watch(c,$=>{!t.data||!f.value||z($.trim())}),d.watch(b,$=>{$&&q()}),d.watch(()=>t.options,async $=>{t.data||(N($??[]),await le())},{immediate:!0,deep:!0}),d.watch(()=>t.data,async $=>{$&&(await G(c.value.trim()),await le())},{immediate:!0});const we=d.ref(!1);return d.watch(k,async()=>{if(t.data){if(!we.value){we.value=!0;return}i.value=[],await G(c.value.trim()),await le()}}),d.onMounted(async()=>{document.addEventListener("click",be,!0),window.addEventListener("keydown",me),await le()}),d.onUnmounted(()=>{document.removeEventListener("click",be,!0),window.removeEventListener("keydown",me)}),($,ne)=>(d.openBlock(),d.createElementBlock("div",{class:"flex flex-col gap-2 w-full",ref_key:"rootRef",ref:p},[d.createElementVNode("div",{class:"relative",onClick:ne[2]||(ne[2]=d.withModifiers(()=>{},["stop"]))},[d.createElementVNode("div",{class:d.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white px-3","border-gray-300 hover:border-[#b3d4ff]",f.value?"border-[#2684ff] ring-1 ring-[#2684ff] shadow-[0_0_0_1px_rgba(38,132,255,0.5)]":"",b.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":f.value,"aria-haspopup":"listbox","data-focus":f.value?"true":"false",onClick:ae},[d.withDirectives(d.createElementVNode("input",{ref_key:"inputRef",ref:g,"onUpdate:modelValue":ne[0]||(ne[0]=Z=>c.value=Z),placeholder:_.value,disabled:b.value,readonly:!x.value,onFocus:ne[1]||(ne[1]=()=>U("focus")),onKeydown:fe,class:"flex-1 bg-transparent border-0 outline-none px-0 py-1 text-sm text-stone-900 placeholder:text-stone-400"},null,40,Qve),[[d.vModelText,c.value]]),d.createElementVNode("span",{class:d.normalizeClass(["text-stone-400 transition-transform duration-150",f.value?"rotate-180":""]),"aria-hidden":"true"},[d.createVNode(F1,{width:"16",height:"16"})],2)],10,Kve),d.createVNode(d.Transition,{name:"fade"},{default:d.withCtx(()=>[f.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"absolute left-0 right-0 z-10 mt-1 rounded-md border border-stone-200 bg-white shadow-lg overflow-auto",style:d.normalizeStyle({maxHeight:w.value})},[d.createElementVNode("div",Jve,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,Z=>(d.openBlock(),d.createElementBlock("button",{key:E(Z.id),type:"button",class:"w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",onClick:d.withModifiers(Ie=>ce(Z),["stop"]),disabled:b.value},d.toDisplayString(C(Z)),9,eme))),128)),A.value.length===0?(d.openBlock(),d.createElementBlock("p",tme," Немає варіантів ")):d.createCommentVNode("",!0)])],4)):d.createCommentVNode("",!0)]),_:1})]),d.createElementVNode("div",rme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(Z,Ie)=>(d.openBlock(),d.createElementBlock("div",{key:Z.key,class:d.normalizeClass(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2",{"opacity-60":h.value===Ie}]),draggable:"true",onDragstart:Qe=>j(Ie),onDragover:ne[3]||(ne[3]=d.withModifiers(()=>{},["prevent"])),onDrop:Qe=>oe(Ie),onDragend:ne[4]||(ne[4]=Qe=>h.value=null)},[d.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-500 hover:text-stone-900",disabled:b.value,"aria-label":"Перетягнути"},[d.createVNode(Mp,{width:"14",height:"14"})],8,ame),d.createElementVNode("div",{class:"flex-1 text-sm text-stone-900",title:Z.text},d.toDisplayString(Z.text),9,ime),d.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-400 hover:text-stone-900",disabled:b.value,onClick:d.withModifiers(Qe=>H(Z.id),["stop"]),"aria-label":`Видалити ${Z.text}`},[d.createVNode(Dp,{width:"14",height:"14"})],8,ome)],42,nme))),128)),i.value.length===0?(d.openBlock(),d.createElementBlock("p",sme,"Немає вибраних значень")):d.createCommentVNode("",!0)])],512))}}),Bp=Ye(lme,[["__scopeId","data-v-8dc8c204"]]),ume={class:"flex items-center gap-2 w-full"},cme={class:"relative flex-1"},dme=["placeholder","disabled","onKeydown"],fme=["disabled"],hme={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},pme={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},gme={key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/50"},vme={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},mme={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},yme=["onClick"],bme={key:0,class:"p-4 text-sm text-gray-500"},rP=d.defineComponent({__name:"vs-input-address",props:d.mergeModels({api:{default:""},geom:{default:""},includes:{default:()=>[]},bbox:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(r,{emit:e}){const t=/{{\s*([^}]+?)\s*}}/g,n=r,a=e,{inputClass:i}=br(n.style),o=d.useModel(r,"modelValue"),s=d.computed({get:()=>o.value,set:k=>{o.value=k}}),l=d.ref(!1),u=d.ref([]),c=d.ref(!1),f=d.ref(null);d.watch(c,k=>{typeof document>"u"||(k?(f.value=document.body.style.overflow,document.body.style.overflow="hidden"):f.value!=null?(document.body.style.overflow=f.value,f.value=null):document.body.style.removeProperty("overflow"))}),d.onBeforeUnmount(()=>{typeof document>"u"||(f.value!=null?document.body.style.overflow=f.value:document.body.style.removeProperty("overflow"))});const h=d.computed(()=>n.placeholder??""),p=d.computed(()=>!!n.disabled),g=k=>{if(!k)return null;if(Array.isArray(k))return k;if(typeof k=="string"){const E=k.split(",").map(C=>C.trim()).filter(Boolean);return E.length!==4?null:E.map(Number)}return null},v=d.computed(()=>{const k=g(n.bbox);if(!k||k.length!==4)return null;const E=k.map(Number);return E.some(C=>Number.isNaN(C))?null:E}),m=d.computed(()=>{const k=v.value;if(!k)return"";const[E,C,T,D]=k;return`${E},${Math.max(C,D)},${T},${Math.min(C,D)}`});d.computed(()=>m.value?"1":"0");const y=d.inject("values");function b(){!p.value&&s.value.trim()&&_()}async function _(){var T;const k=(s.value||"").trim();if(!k)return;let E=k;if((T=n.includes)!=null&&T.length&&(y!=null&&y.value)){const D=n.includes.map(A=>{var I;return(I=y.value)==null?void 0:I[A]}).filter(Boolean);D.length&&(E=`${D.join(", ")}, ${k}`)}const C=S(E);if(C){l.value=!0;try{const D=await(await fetch(C)).json();u.value=Array.isArray(D)?D:[],c.value=!0}catch(D){console.error("Address search error:",D)}finally{l.value=!1}}}function x(){c.value=!c.value}function w(k){if(!k)return;c.value=!1;const E=parseFloat(k.lat),C={type:"Point",coordinates:[parseFloat(k.lon),E]};n.geom&&(y!=null&&y.value)&&(y.value[n.geom]=C),a("update:geom",C)}function S(k){if(!n.api)return"";const E={value:encodeURIComponent(k),bbox:v.value?v.value.join(","):""};return n.api.replace(t,(C,T)=>E[T.trim()]??"")}return(k,E)=>{var C;return d.openBlock(),d.createElementBlock("div",ume,[d.createElementVNode("div",cme,[d.withDirectives(d.createElementVNode("input",{type:"text","onUpdate:modelValue":E[0]||(E[0]=T=>s.value=T),placeholder:h.value,disabled:p.value,class:d.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[d.unref(i),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:d.withKeys(d.withModifiers(b,["prevent"]),["enter"])},null,42,dme),[[d.vModelText,s.value]]),u.value.length?(d.openBlock(),d.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:x,title:"Show search results"},E[2]||(E[2]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),d.createElementVNode("path",{d:"M12 16v-4"}),d.createElementVNode("path",{d:"M12 8h.01"})],-1)]))):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",onClick:_,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:l.value||!((C=s.value)!=null&&C.trim())},[l.value?(d.openBlock(),d.createElementBlock("svg",pme,E[4]||(E[4]=[d.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),d.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(d.openBlock(),d.createElementBlock("svg",hme,E[3]||(E[3]=[d.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),d.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,fme),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[c.value?(d.openBlock(),d.createElementBlock("div",gme,[d.createElementVNode("div",vme,[d.createElementVNode("div",mme,[E[6]||(E[6]=d.createElementVNode("span",null,"Search results",-1)),d.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:E[1]||(E[1]=T=>c.value=!1),title:"Close"},E[5]||(E[5]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),d.createElementVNode("ul",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(T,D)=>(d.openBlock(),d.createElementBlock("li",{key:D,onClick:A=>w(T),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},d.toDisplayString(T.display_name),9,yme))),128))]),u.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",bme," No results found "))])])):d.createCommentVNode("",!0)]))])}}}),nP=(r="")=>`${r}${Math.floor(Math.random()*1e4)}`,_me={class:"vs-datalist space-y-3"},xme={class:"space-y-3"},wme=["onClick","disabled"],Sme={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},kme=["disabled"],Eme=d.defineComponent({__name:"vs-input-datalist",props:d.mergeModels({schema:{default:()=>[]},minItems:{default:0},maxItems:{default:void 0},addButtonText:{default:"Додати позицію"},emptyLabel:{default:"Немає рядків"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.computed(()=>Array.isArray(t.value)?t.value:[]),a=d.ref([]),i=d.computed(()=>{var v;return((v=e.schema)==null?void 0:v.map(m=>({...m,disabled:e.disabled||m.disabled})))??[]}),o=d.computed(()=>i.value.map(v=>g(v))),s=d.computed(()=>e.disabled?!1:e.maxItems?n.value.length<e.maxItems:!0),l=d.computed(()=>e.disabled||n.value.length<=(e.minItems||0));d.watch(()=>n.value.length,()=>{u(),c()},{immediate:!0}),d.watch(()=>e.schema,c,{immediate:!0,deep:!0});function u(){const v=n.value.length;a.value.length<v?a.value=[...a.value,...Array.from({length:v-a.value.length},()=>nP())]:a.value.length>v&&a.value.splice(v)}function c(){if(!e.minItems||n.value.length>=e.minItems)return;const v=e.minItems-n.value.length,m=Array.from({length:v},f);t.value=[...n.value,...m]}function f(){const v={};return i.value.forEach(m=>{v[m.name]=(m==null?void 0:m.default)??null}),v}function h(){s.value&&(t.value=[...n.value,f()],u())}function p(v){l.value||(t.value=n.value.filter((m,y)=>y!==v),u(),c())}function g(v){return{...v}}return(v,m)=>(d.openBlock(),d.createElementBlock("div",_me,[d.createElementVNode("div",xme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,(y,b)=>(d.openBlock(),d.createElementBlock("div",{key:a.value[b],class:"flex items-center gap-3"},[d.createVNode(Fa,{schema:o.value,layout:"inline",navigation:!1,values:n.value[b],"onUpdate:values":_=>n.value[b]=_,"form-id":a.value[b]},null,8,["schema","values","onUpdate:values","form-id"]),d.createElementVNode("button",{type:"button",class:"h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",onClick:_=>p(b),disabled:l.value},[d.createVNode(Sl,{class:"w-5 h-5"})],8,wme)]))),128)),n.value.length===0?(d.openBlock(),d.createElementBlock("div",Sme,d.toDisplayString(e.emptyLabel),1)):d.createCommentVNode("",!0)]),d.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:h,disabled:!s.value},[d.createVNode(da,{class:"w-5 h-5"}),d.createTextVNode(" "+d.toDisplayString(e.addButtonText),1)],8,kme)]))}}),Cme=Ye(Eme,[["__scopeId","data-v-8bcb5436"]]),Tme={};function Dme(r,e){return d.openBlock(),d.createElementBlock("svg",d.mergeProps({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"},r.$attrs),e[0]||(e[0]=[d.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},null,-1),d.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},null,-1)]),16)}const Ame=Ye(Tme,[["render",Dme]]),Mme={class:"vs-dataform space-y-4"},Nme=["draggable","onDragstart","onDragover","onDragenter","onDrop"],Lme={class:"flex items-center gap-2"},Ime=["onClick"],Bme={class:"text-sm font-medium text-gray-700"},Vme={class:"flex items-center gap-2"},Rme=["title","onClick","disabled"],Pme=["title","onClick","disabled"],Ome={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},zme=["disabled"],Fme=d.defineComponent({__name:"vs-input-dataform",props:d.mergeModels({schema:{default:()=>[]},minGroups:{default:0},maxGroups:{default:void 0},addButtonText:{default:"Додати групу фільтрів"},groupLabel:{default:void 0},duplicateTitle:{default:"Дублювати групу"},removeTitle:{default:"Видалити групу"},emptyLabel:{},view:{default:"default"},collapsible:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref([]),a=d.ref([]),i=d.ref(0),o=d.ref(null),s=d.ref(null),l=d.ref(null),u=d.computed(()=>e.groupLabel??"Group"),c=d.computed(()=>e.emptyLabel??"Ще немає груп"),f=d.computed(()=>{var U;return((U=e.schema)==null?void 0:U.map(q=>({...q,disabled:e.disabled||q.disabled})))??[]}),h=d.computed(()=>f.value.map(U=>C(U))),p=d.computed(()=>e.view==="accordion"),g=d.computed(()=>!!(e.collapsible||p.value)),v=d.computed(()=>e.draggable!==!1),m=d.computed(()=>e.disabled?!1:e.maxGroups?t.value.length<e.maxGroups:!0),y=d.computed(()=>e.disabled||t.value.length<=(e.minGroups||0));d.watch(()=>t.value.length,()=>{b(),_(),x()},{immediate:!0}),d.watch(()=>e.schema,x,{immediate:!0,deep:!0}),d.watch(()=>e.view,()=>{_()},{immediate:!0});function b(){const U=t.value.length;n.value.length<U?n.value=[...n.value,...Array.from({length:U-n.value.length},()=>nP())]:n.value.length>U&&n.value.splice(U)}function _(){const U=t.value.length;p.value?U===0?i.value=-1:i.value>=U?i.value=U-1:i.value<0&&(i.value=0):a.value.length<U?a.value=[...a.value,...Array.from({length:U-a.value.length},()=>!1)]:a.value.length>U&&a.value.splice(U)}function x(){if(!e.minGroups||t.value.length>=e.minGroups)return;const U=e.minGroups-t.value.length,q=Array.from({length:U},w);t.value=[...t.value,...q],_()}function w(){const U={};return f.value.forEach(q=>{U[q.name]=(q==null?void 0:q.default)??null}),U}function S(){m.value&&(t.value=[...t.value,w()],b(),_())}function k(U){y.value||(t.value=t.value.filter((q,ae)=>ae!==U),b(),p.value?i.value>=t.value.length&&(i.value=t.value.length-1):a.value.splice(U,1),x())}function E(U){if(e.disabled)return;const q=JSON.parse(JSON.stringify(t.value[U]??{}));t.value=[...t.value.slice(0,U+1),q,...t.value.slice(U+1)],b(),p.value?i.value>U&&(i.value+=1):a.value.splice(U+1,0,a.value[U]??!1)}function C(U){return{...U}}function T(U){return p.value?i.value===-1&&U===0?!1:i.value!==U:!!a.value[U]}function D(U){if(g.value){if(p.value){i.value=U;return}a.value[U]=!a.value[U]}}function A(U,q){var ae,me,be;if(!v.value||e.disabled){q.preventDefault();return}o.value=U,s.value=U,l.value={groups:JSON.parse(JSON.stringify(t.value)),keys:[...n.value],states:[...a.value]},(ae=q.dataTransfer)==null||ae.setData("text/plain",String(U)),(be=(me=q.dataTransfer)==null?void 0:me.setDragImage)==null||be.call(me,q.currentTarget,0,0)}function I(U,q){!v.value||e.disabled||o.value!==null&&F(U,q)}function L(U,q){F(U,q)}function B(U){!v.value||e.disabled||K()}function N(){l.value&&R(),o.value=null,s.value=null,l.value=null}function V(U,q){const ae=[...t.value],[me]=ae.splice(U,1);ae.splice(q,0,me),t.value=ae;const be=[...n.value],[fe]=be.splice(U,1);if(be.splice(q,0,fe),n.value=be,p.value)i.value===U&&(i.value=q);else{const ce=[...a.value],[W]=ce.splice(U,1);ce.splice(q,0,W),a.value=ce}}function R(){l.value&&(t.value=l.value.groups,n.value=l.value.keys,a.value=l.value.states,l.value=null,s.value=null)}function F(U,q){if(o.value===null)return;const ae=G(U,q);s.value=ae,z(ae)}function G(U,q){if(!(q!=null&&q.currentTarget))return U;const ae=q.currentTarget.getBoundingClientRect(),me=q.clientY-ae.top>ae.height/2?U+1:U;return Math.max(0,Math.min(me,t.value.length))}function z(U){const q=o.value;if(q===null)return;let ae=U;if(ae>t.value.length&&(ae=t.value.length),ae===q||ae===q+1)return;const me=ae>q?ae-1:ae;V(q,me),o.value=me,s.value=ae>q?me+1:me}function K(){l.value=null,o.value=null,s.value=null}return(U,q)=>(d.openBlock(),d.createElementBlock("div",Mme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.value,(ae,me)=>(d.openBlock(),d.createElementBlock("div",{key:n.value[me],class:d.normalizeClass(["relative border border-gray-200 rounded-lg bg-white transition vs-dataform__group",[e.view==="accordion"?"overflow-hidden":T(me)?"pt-6 px-6":"p-6"]]),draggable:v.value&&!e.disabled,onDragstart:be=>A(me,be),onDragend:N,onDragover:d.withModifiers(be=>I(me,be),["prevent"]),onDragenter:d.withModifiers(be=>L(me,be),["prevent"]),onDrop:d.withModifiers(be=>B(),["prevent"])},[d.createElementVNode("div",{class:d.normalizeClass(["flex items-center justify-between gap-2 border-b border-gray-100 px-4 py-3",[e.view!=="accordion"?"-mx-6 -mt-6 px-6":"",e.view!=="accordion"&&!T(me)?"rounded-t-lg":"rounded-lg"]])},[d.createElementVNode("div",Lme,[v.value?(d.openBlock(),d.createBlock(Mp,{key:0,class:"w-4 h-4 text-gray-400","aria-hidden":"true"})):d.createCommentVNode("",!0),g.value?(d.openBlock(),d.createElementBlock("button",{key:1,type:"button",class:"rounded-full p-1 text-gray-500 transition hover:bg-gray-100",onClick:be=>D(me)},[d.createVNode(F1,{class:d.normalizeClass(["h-4 w-4 transition",T(me)?"-rotate-90":"rotate-0"])},null,8,["class"])],8,Ime)):d.createCommentVNode("",!0),d.createElementVNode("div",Bme,d.toDisplayString(`${u.value} (${me+1})`),1)]),d.createElementVNode("div",Vme,[d.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:e.duplicateTitle,onClick:be=>E(me),disabled:e.disabled,draggable:"false"},[d.createVNode(Ame,{class:"w-5 h-5"})],8,Rme),d.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:e.removeTitle,onClick:be=>k(me),disabled:y.value,draggable:"false"},[d.createVNode(Sl,{class:"w-5 h-5"})],8,Pme)])],2),d.withDirectives(d.createElementVNode("div",{class:d.normalizeClass(e.view==="accordion"?"p-6":"pt-6")},[d.createVNode(Fa,{class:"vs-dataform__form",schema:h.value,layout:"inline",navigation:!1,values:t.value[me],"onUpdate:values":be=>t.value[me]=be,"form-id":n.value[me],disabled:e.disabled},null,8,["schema","values","onUpdate:values","form-id","disabled"])],2),[[d.vShow,!T(me)]])],42,Nme))),128)),t.value.length===0?(d.openBlock(),d.createElementBlock("div",Ome,d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),d.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:S,disabled:!m.value},[d.createVNode(da,{class:"w-5 h-5"}),d.createTextVNode(" "+d.toDisplayString(e.addButtonText),1)],8,zme)]))}}),$me=Ye(Fme,[["__scopeId","data-v-3b71fe50"]]),Vp="__vs_form_monaco_loader__",Gme=d.defineComponent({__name:"vs-input-monaco",props:d.mergeModels({syntax:{default:"xml"},theme:{default:"vs-light"},height:{default:280},minimap:{type:Boolean,default:!1},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=d.useModel(r,"modelValue"),n=d.ref(null),a=d.computed(()=>typeof e.height=="number"?`${e.height}px`:e.height||"280px");let i=null,o=null,s=!1;const l=()=>{var h,p;if(o)return Promise.resolve(o);if(typeof window>"u")return Promise.resolve(null);const c=window;if((p=(h=c.monaco)==null?void 0:h.editor)!=null&&p.create)return o=c.monaco,Promise.resolve(o);if(c[Vp])return c[Vp];const f=(async()=>{const g=y=>{if(Array.from(document.styleSheets||[]).some(_=>{var x;return(x=_==null?void 0:_.href)==null?void 0:x.includes(y)}))return;const b=document.createElement("link");b.rel="stylesheet",b.href=y,document.head.appendChild(b)},v=y=>new Promise((b,_)=>{if(Array.from(document.scripts).some(w=>w.src===y))return b();const x=document.createElement("script");x.src=y,x.async=!0,x.onload=()=>b(),x.onerror=w=>_(w),document.body.appendChild(x)}),m="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";return g(`${m}/editor/editor.main.min.css`),await v(`${m}/loader.min.js`),new Promise((y,b)=>{window.require.config({paths:{vs:m}}),window.require(["vs/editor/editor.main"],()=>{o=window.monaco,c.monaco=o,y(o)},_=>b(_))})})().catch(g=>{throw delete c[Vp],g});return c[Vp]=f,f},u=()=>{!n.value||!o||(i&&(i.dispose(),i=null),i=o.editor.create(n.value,{value:t.value||"",language:e.syntax,theme:e.theme,automaticLayout:!0,minimap:{enabled:!!e.minimap},readOnly:!!e.disabled}),i.onDidChangeModelContent(()=>{s||(t.value=i.getValue())}))};return d.watch(()=>t.value,c=>{if(!i)return;const f=i.getValue();c!==f&&(s=!0,i.setValue(c||""),s=!1)}),d.watch(()=>e.syntax,c=>{!i||!o||o.editor.setModelLanguage(i.getModel(),c||"xml")}),d.watch(()=>e.theme,c=>{o&&o.editor.setTheme(c||"vs-light")}),d.watch(()=>e.disabled,c=>{i&&i.updateOptions({readOnly:!!c})}),d.watch(()=>e.minimap,c=>{i&&i.updateOptions({minimap:{enabled:!!c}})}),d.onMounted(async()=>{try{const c=await l();if(!c||!c.editor)return;o=c,u()}catch(c){console.error("Failed to load Monaco editor",c)}}),d.onBeforeUnmount(()=>{i&&(i.dispose(),i=null)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"w-full",style:d.normalizeStyle({height:a.value})},[d.createElementVNode("div",{ref_key:"editorContainer",ref:n,class:"w-full h-full overflow-hidden border border-[#CFD9E0] rounded"},null,512)],4))}}),Rp={VsInputText:wl,VsInputRadio:Y1,"vs-input-text":wl,"vs-input-password":kce,"vs-input-textarea":HR,"vs-input-richtext":WR,"vs-input-mask":U1,"vs-input-number":BR,"vs-input-radio":Y1,"vs-input-select":X1,"vs-input-switcher":$1,"vs-input-static":G1,"vs-input-container":UR,"vs-input-date":_de,"vs-input-checkbox":VR,"vs-input-file":FR,"vs-input-file2":Z1,file2:Z1,File2:Z1,"vs-input-html":G1,"vs-input-email":H1,"vs-input-tel":W1,"vs-input-datatable":YR,"vs-input-map":qR,"vs-input-file-list":$R,"vs-input-tags":ZR,"vs-input-slug":XR,"vs-input-codegen":jR,"vs-input-key-value":KR,"vs-input-text[]":QR,"vs-input-range":eP,"vs-input-color":JR,"vs-input-native-select":X1,VsInputArraySelect:Bp,"vs-input-array":tP,"vs-input-array-select":Bp,"array-select":Bp,"vs-input-address":rP,"vs-input-datalist":Cme,"vs-input-dataform":$me,"vs-input-monaco":Gme},Ume=d.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(r){const e=r,t=d.inject("values");async function n(){try{if(!e.api)return;const a=e.api.replace("{{value}}",e.value),i=await fetch(a);if(!i.ok){pt({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const o=await i.json();if(!e.set||!t)return;for(const[s,l]of Object.entries(e.set))t.value[s]=o.result[l]}catch(a){console.error(e.error,a)}}return(a,i)=>(d.openBlock(),d.createElementBlock("button",{onClick:n,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"},d.toDisplayString(a.button),1))}}),Hme={class:"flex flex-col gap-1 w-full"},Wme=["innerHTML"],aP=d.defineComponent({__name:"vs-compact-form-layout",props:d.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:d.mergeModels(["value-selected"],["update:modelValue"]),setup(r,{emit:e}){const t=r,n=d.useModel(r,"modelValue"),a=e,i=d.computed(()=>wce[`${t.layout}`]),o=["label","placeholder","info","description","text","html"],s=d.ref(y()),l=d.computed(()=>g(t.item,s.value)),u=d.computed(()=>Rp==null?void 0:Rp[`vs-input-${t.item.type}`]),c=d.inject("field-props"),f=d.computed(()=>{var S;const _=d.unref(u);if(!_)return new Set;const x=_.props??((S=_.__vccOpts)==null?void 0:S.props);if(!x)return new Set;const w=Array.isArray(x)?x:Object.keys(x);return new Set(w)}),h=d.computed(()=>{var S,k;const _={...l.value??{}},x=(S=t.item)==null?void 0:S.name;x&&((k=c==null?void 0:c.value)!=null&&k[x])&&Object.assign(_,c.value[x]);const w=f.value;return w.size?Object.fromEntries(Object.entries(_).filter(([E])=>w.has(E))):{}}),p=_=>{var w;const x=typeof _=="object"&&_!==null?_:{value:_};a("value-selected",{...x,name:x.name??((w=t.item)==null?void 0:w.name)})};d.onMounted(()=>{s.value=y(),window.addEventListener("storage",b)}),d.onUnmounted(()=>{window.removeEventListener("storage",b)});function g(_,x){if(!_)return{};const w={..._};return o.forEach(S=>{const k=m(_,S,x);k!=null&&(w[S]=k)}),Array.isArray(_.options)&&(w.options=_.options.map(S=>v(S,x))),w}function v(_,x){if(!_)return _;const w={..._},S=m(_,"label",x),k=m(_,"text",x);return S!=null&&(w.label=S),k!=null?w.text=k:S!=null&&(w.text=S),w}function m(_,x,w){const S=`${x}:${w}`;if((_==null?void 0:_[S])!=null)return _[S];if(x==="label"&&(_==null?void 0:_[w])!=null)return _[w];if((_==null?void 0:_[x])!=null)return _[x];if(x==="label"){if((_==null?void 0:_.ua)!=null)return _.ua;if((_==null?void 0:_.en)!=null)return _.en}if(x==="text"||x==="html"){if((_==null?void 0:_.ua)!=null)return _.ua;if((_==null?void 0:_.en)!=null)return _.en}return null}function y(){return typeof window>"u"?"uk":localStorage.getItem("locale")||"uk"}function b(){s.value=y()}return(_,x)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i.value),{ua:l.value.ua,error:t.error||"",item:l.value,columns:t.columns,label:l.value.label},{default:d.withCtx(()=>{var w,S;return[d.createElementVNode("div",{class:d.normalizeClass(["flex w-full",`${t.item.type}-component`])},[d.createElementVNode("div",Hme,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(u.value),d.mergeProps(h.value,{modelValue:n.value,"onUpdate:modelValue":x[0]||(x[0]=k=>n.value=k),onValueSelected:p}),null,16,["modelValue"])),l.value.description&&t.layout!=="settings"?(d.openBlock(),d.createElementBlock("p",{key:0,class:"text-sm text-gray-500",innerHTML:l.value.description},null,8,Wme)):d.createCommentVNode("",!0)]),(w=l.value.behavior)!=null&&w.api&&((S=l.value.behavior)!=null&&S.button)?(d.openBlock(),d.createBlock(Ume,d.mergeProps({key:0},l.value.behavior,{value:n.value}),null,16,["value"])):d.createCommentVNode("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),Yme={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},qme={class:"vs-compact-form-navigation__rail mt-[6px]"},Zme=["onClick"],Xme=d.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(r,{expose:e}){const t=r,n=d.ref([]),a=d.ref(""),i=d.ref(""),o=d.computed(()=>!!t.enabled),s=d.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),l=d.computed(()=>{const D=t.width;if(D==null)return{};const A=typeof D=="number"?`${D}px`:`${D}`;return{width:A,minWidth:A}});let u=null,c=0,f=0,h=null,p=null,g=null;const v=()=>C(),m=()=>b();d.watch(()=>t.target,async D=>{if(S(),!D){h=null,n.value=[],a.value="";return}h=D,o.value&&(await d.nextTick(),w(D),b())},{immediate:!0}),d.watch(()=>t.scrollContainer,D=>{if(!o.value){p=D??null;return}y(D??null),d.nextTick(()=>b())},{immediate:!0}),d.onMounted(()=>{t.scrollContainer||y(null),b()}),d.onBeforeUnmount(()=>{S(),y(null,!0),h=null,typeof window<"u"&&(c&&window.cancelAnimationFrame(c),f&&window.cancelAnimationFrame(f))});function y(D,A=!1){if(g&&(g(),g=null),A){p=null;return}if(p=D??null,typeof window>"u")return;const I=D??window,L=window;I.addEventListener("scroll",v,{passive:!0}),L.addEventListener("resize",m),g=()=>{I.removeEventListener("scroll",v),L.removeEventListener("resize",m)}}function b(){if(!o.value||!h)return;c&&typeof window<"u"&&window.cancelAnimationFrame(c);const D=()=>{_(),c=0};typeof window>"u"?D():c=window.requestAnimationFrame(D)}function _(){if(!o.value||!h)return;const D=Array.from(h.querySelectorAll("h1, h2")),A=new Set,I=[];D.forEach((L,B)=>{var G;const N=((G=L.textContent)==null?void 0:G.trim())??"";if(!N)return;let V=(L.getAttribute("id")??"").trim();V||(V=x(N)||`heading-${B+1}`);let R=V,F=1;for(;A.has(R);)R=`${V}-${F+=1}`;L.id!==R&&Object.assign(L,{id:R}),A.add(R),I.push({id:R,text:N,level:L.tagName.toLowerCase()==="h1"?1:2})}),n.value=I,I.length||(a.value=""),E()}function x(D){return D.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function w(D){!D||!o.value||typeof MutationObserver>"u"||(S(),u=new MutationObserver(()=>b()),u.observe(D,{childList:!0,subtree:!0}))}function S(){u&&(u.disconnect(),u=null)}function k(D){const A=p;if(!A)return typeof window>"u"?D.offsetTop:D.getBoundingClientRect().top+window.scrollY;const I=D.getBoundingClientRect(),L=A.getBoundingClientRect();return I.top-L.top+A.scrollTop}function E(){if(!o.value||!n.value.length)return;const D=p,A=(D?D.scrollTop:null)||(typeof window<"u"?window.scrollY:0),I=(D?D.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),L=A+I;let B=null;for(let V=0;V<n.value.length;V+=1){const R=n.value[V],F=document.getElementById(R.id);if(F){const G=k(F);G+F.offsetHeight>A&&G<L&&(B=R.id)}}!B&&i.value&&(B=i.value),B&&(i.value=B);const N=D?D.scrollHeight-D.clientHeight:document.documentElement.scrollHeight-window.innerHeight;A+5>=N&&(B=n.value[n.value.length-1].id),B&&(a.value=B)}function C(){o.value&&(f&&window.cancelAnimationFrame(f),f=window.requestAnimationFrame(()=>{E(),f=0}))}function T(D){if(!o.value)return;const A=document.getElementById(D);if(!A)return;const I=p,L=Math.max(0,k(A));I?I.scrollTo({top:L,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:L,behavior:"smooth"})}return e({refresh:b}),(D,A)=>o.value&&n.value.length?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(s.value),style:d.normalizeStyle(l.value)},[d.createElementVNode("h2",Yme,d.toDisplayString(D.title),1),d.createElementVNode("div",qme,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.value,I=>(d.openBlock(),d.createElementBlock("div",{key:I.id,class:d.normalizeClass(["vs-compact-form-navigation__item relative",I.level===2?"vs-compact-form-navigation__item--nested":"",I.id===a.value?"vs-compact-form-navigation__item--active":""])},[d.createElementVNode("button",{type:"button",onClick:L=>T(I.id),class:d.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",I.level===2?"pl-[15px]":"pl-[18px]",I.id===a.value?"text-gray-800":"text-gray-500"])},[d.createElementVNode("span",null,d.toDisplayString(I.text),1)],10,Zme)],2))),128))])],6)):d.createCommentVNode("",!0)}}),jme=Ye(Xme,[["__scopeId","data-v-1584a562"]]),es={required:"Це поле є обов’язковим",email:"Неправильний email",tel:"Неправильний телефон",minlength:r=>`Мінімальна довжина — ${r} символів`,maxlength:r=>`Максимальна довжина — ${r} символів`},Kme=r=>typeof r=="string"?r.trim()?!1:es.required:Array.isArray(r)?r.map(e=>typeof e=="string"?e.trim():e).filter(e=>e!=null&&e!=="").length?!1:es.required:r?!1:es.required,Qme=r=>r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)?!1:es.email:!1,Jme=r=>r?/^\+[1-9]\d{1,14}$/.test(r)?!1:es.tel:!1,iP=r=>r==null?0:typeof r=="string"?r.trim().length:Array.isArray(r)?r.length:typeof r=="number"?r.toString().length:String(r).length,eye=(r,e)=>{if(r==null)return!1;const t=Number((e==null?void 0:e.value)??(e==null?void 0:e.length));return Number.isFinite(t)&&iP(r)<t?(e==null?void 0:e.message)||es.minlength(t):!1},tye=(r,e)=>{if(r==null||r==="")return!1;const t=Number((e==null?void 0:e.value)??(e==null?void 0:e.length));return Number.isFinite(t)&&iP(r)>t?(e==null?void 0:e.message)||es.maxlength(t):!1},rye=(r,e)=>{const t=e.pattern??e.regexp,n=typeof t=="string"?new RegExp(t):t;if(Array.isArray(r)){const a=r.filter(Boolean);return a.length===0||a.every(i=>n.test(i))?!1:e.message}return!n.test(r)&&r?e.message:!1},nye=(r,e)=>!1,aye=(r,e)=>{switch(typeof e=="string"?e:e.type){case"required":return Kme(r);case"email":return Qme(r);case"tel":return Jme(r);case"regexp":return rye(r,e);case"minlength":return eye(r,e);case"maxlength":return tye(r,e);case"custom":return nye();default:return!1}},iye={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file",dropzone:"file"};function oP(r){const e=r==null?void 0:r.toLowerCase();return iye[e]||e}function K1(r,e=!1){if(Array.isArray(r)){const n=[];return r.forEach(a=>{const i={...a};i.name=(a.name||a.id||a.key||"").toString(),i.type=oP(a.type),i.label=a.label||a.ua,i.rules=a.rules||a.validators,i.type==="email"&&!i.rules&&(i.rules=["email"]),a.data&&(i.api=`/api/suggest/${a.data}`),i.disabled=i.disabled||e,Array.isArray(i.schema)&&(i.schema=K1(i.schema,i.disabled)),n.push(i)}),n}const t=[];return Object.entries(r).forEach(n=>{var i;const a={name:n[0],...n[1],type:oP(n[1].type),label:n[1].label||n[1].ua,rules:n[1].rules||n[1].validators,disabled:n[1].disabled||e};a.type==="email"&&!a.rules&&(a.rules=["email"]),(i=n[1].type)!=null&&i.includes("list")&&(a.multiple=!0),!a.api&&n[1].data&&(a.api=`/api/suggest/${n[1].data}`),Array.isArray(a.schema)&&(a.schema=K1(a.schema,a.disabled)),t.push(a)}),t}function oye(r,e,t=!1){const n=d.computed(()=>K1(e,typeof t=="boolean"?t:t.value)),a=d.ref({});function i(l){var h;const u=l==null?void 0:l.conditions;if(!u)return!0;const c=Array.isArray(u)?u[0]:u,f=(h=r==null?void 0:r.value)==null?void 0:h[c];return GR(f,u)}const o=(l=n.value,u=!0)=>(l.forEach(c=>{const f=[],h=Number(c==null?void 0:c.minlength),p=Number(c==null?void 0:c.maxlength);!Number.isNaN(h)&&Number.isFinite(h)&&f.push({type:"minlength",value:h}),!Number.isNaN(p)&&Number.isFinite(p)&&f.push({type:"maxlength",value:p});const g=[...f,...c.rules||[]];if(g.length){if(!i(c)){delete a.value[c.name];return}let v=!1,m=null;g.forEach(y=>{const b=aye(r.value[c.name],y);b&&(v=!0,!m&&typeof b=="string"&&(m=b))}),v&&m?a.value[c.name]=m:delete a.value[c.name]}c.schema&&o(c.schema,!1)}),u&&Object.values(a.value).some(Boolean)?a.value:null),s=d.computed(()=>{var l;return(l=n.value)==null?void 0:l.filter(u=>u.hidden!==!0&&i(u))});return{errors:a,validate:o,reset:()=>{r.value={},a.value={}},visibleSchema:s}}const sye={class:"flex w-full h-full min-h-0 gap-6"},lye={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},Fa=d.defineComponent({__name:"vs-compact-form",props:d.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},modelValue:{default:()=>({})},modelModifiers:{},values:{default:void 0},valuesModifiers:{}}),emits:d.mergeModels(["handle-submit","update:modelValue","value-selected"],["update:form","update:modelValue","update:values"]),setup(r,{expose:e,emit:t}){const n=t,a=r,i=d.useModel(r,"form"),o=d.useModel(r,"modelValue"),s=d.useModel(r,"values"),l=d.computed({get:()=>s.value??o.value,set:A=>{o.value=A,s.value=A}}),{errors:u,validate:c,reset:f,visibleSchema:h}=oye(l,a.schema,d.toRef(a,"disabled")),p=d.ref(null),g=d.ref(null),v=d.ref({}),m=d.computed(()=>a.navigation),y=d.computed(()=>a.navWidth),b=d.computed(()=>{var A;return(A=a.style)==null?void 0:A.columns}),_=Object.freeze({container:12,label:3}),x=d.computed(()=>a.columns??b.value??_),w=d.computed(()=>a.columns!=null||b.value!=null),S=d.computed(()=>w.value?"horizontal":a.layout),k=A=>A!=null&&A.columns?"horizontal":S.value,E=A=>(A==null?void 0:A.columns)??x.value,C=()=>{n("update:modelValue",l.value),c(),n("handle-submit",l.value)},T=A=>{n("value-selected",A)};e({validate:c,reset:f,errors:u}),d.onMounted(()=>{i.value={value:l.value,errors:u.value,reset:f,validate:c,formId:a.formId}});function D(A,I){if(A===I)return!0;if(typeof A!="object"||typeof I!="object"||!A||!I)return!1;const L=Object.keys(A),B=Object.keys(I);return L.length!==B.length?!1:L.every(N=>A[N]===I[N])}return d.provide("form",i),d.provide("values",l),d.provide("field-props",v),(A,I)=>(d.openBlock(),d.createElementBlock("div",sye,[d.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:g},[d.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:d.withModifiers(C,["prevent"]),class:d.normalizeClass(["grid grid-cols-12 p-1",S.value==="default"?"gap-6":"gap-4"])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(h),(L,B)=>(d.openBlock(),d.createElementBlock("div",{key:L.name,class:d.normalizeClass(k(L)==="horizontal"?"col-span-12":`col-span-${L.col||12}`)},[d.createVNode(aP,{style:d.normalizeStyle(A.style),item:L,layout:k(L),columns:E(L),"model-value":l.value[L.name],"onUpdate:modelValue":N=>{const V=l.value[L.name];D(V,N)||(l.value[L.name]=N)},error:d.unref(u)[L.name],onValueSelected:T},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),k(L)==="settings"&&B+1!==d.unref(h).length?(d.openBlock(),d.createElementBlock("div",lye)):d.createCommentVNode("",!0)],2))),128))],34)],512),d.createVNode(jme,{target:p.value,"scroll-container":g.value,enabled:m.value,width:y.value},null,8,["target","scroll-container","enabled","width"])]))}}),uye={class:"relative"},cye={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},dye={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"},fye={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},hye={class:"font-medium text-gray-800 dark:text-[#ffffff]"},pye={class:"p-4 mim-h-0 h-full overflow-auto"},sP=d.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(r,{emit:e}){const t=r,n=e,a=d.ref(t.schema),i=d.ref(t.defaultValue?JSON.parse(JSON.stringify(t.defaultValue)):{}),o=d.ref({}),s=d.ref(t.token||""),l=d.ref(t.mode);async function u(){const f=o.value.validate();if(f){pt({type:"warning",title:"Помилка валідації",message:Object.entries(f).map(([h,p])=>`${h}: ${p}`).join(`
|
|
302
|
+
`)});return}if(s.value)try{const h=await fetch(`/api/table/${s.value}`,{method:l.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i.value)});if(h.ok)await h.json(),pt({type:"success",title:"Успішно",message:`Дані успішно ${l.value==="add"?"збережено":"оновлено"}`}),n("save",i.value);else if(h.status===400){const p=await h.json().catch(()=>({}));pt({type:"warning",title:"Помилка валідації",message:p.message||"Некоректні дані (400)"})}else h.status===500?pt({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):pt({type:"error",title:"Помилка",message:`Статус: ${h.status}`})}catch(h){pt({type:"error",title:"Помилка з’єднання",message:h.message||"Не вдалося виконати запит"})}else n("edit",i.value),c()}function c(){n("close")}return d.onMounted(async()=>{try{if(t.form&&!t.schema){const f=await fetch(`/api/template/form/${t.form}`);if(!f.ok){pt({type:f.status>=400&&f.status<500?"warning":"error",title:"Error",message:`Error code: ${f.status}`});return}const h=await f.json();a.value=h.schema,s.value=h.token}else if(t.token&&!t.defaultValue){s.value=t.token;const f=await fetch(`/api/form/${s.value}`);if(!f.ok){pt({type:f.status>=400&&f.status<500?"warning":"error",title:"Error",message:`Error code: ${f.status}`});return}const h=await f.json();a.value=h.schema,h.data?i.value=h.data:l.value="add",h.obj&&(i.value={...i.value,...h.obj})}}catch(f){pt({type:"error",title:"Error",message:f.message||"Unexpected error"}),console.error(f)}}),(f,h)=>(d.openBlock(),d.createElementBlock("div",uye,[d.createElementVNode("div",cye,[d.createElementVNode("div",dye,[d.createElementVNode("div",fye,[d.createElementVNode("h3",hye,d.toDisplayString(l.value==="add"?"Додати":"Змінити"),1),d.createElementVNode("button",{onClick:c,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]=[d.createElementVNode("span",{class:"sr-only"},"Close",-1),d.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"},[d.createElementVNode("path",{d:"M18 6 6 18"}),d.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),d.createElementVNode("div",pye,[a.value?(d.openBlock(),d.createBlock(Fa,{key:0,schema:a.value,values:i.value,"onUpdate:values":h[0]||(h[0]=p=>i.value=p),form:o.value,"onUpdate:form":h[1]||(h[1]=p=>o.value=p)},null,8,["schema","values","form"])):d.createCommentVNode("",!0)]),d.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"},[d.createElementVNode("button",{type:"button",onClick:c,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"}," Скасувати "),d.createElementVNode("button",{onClick:u,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"}," Зберегти ")])])])]))}}),gye=1440*60*1e3,vye=["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],mye=["січ","лют","бер","квіт","трав","черв","лип","серп","вер","жовт","лист","груд"],yye=["нд","пн","вт","ср","чт","пт","сб"];function ur(r){return r instanceof Date&&!Number.isNaN(r.getTime())}const kl=r=>new Date(r.getTime());function ts(r){const e=kl(r);return e.setHours(0,0,0,0),e}function Oc(r){const e=kl(r);return e.setHours(23,59,59,999),e}function Q1(r){return ts(new Date(r.getFullYear(),r.getMonth(),1))}function J1(r){return Oc(new Date(r.getFullYear(),r.getMonth()+1,0))}function ex(r,e){const t=new Date(r),n=t.getDate();t.setDate(1),t.setMonth(t.getMonth()+e);const a=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();return t.setDate(Math.min(n,a)),t}function bye(r,e){return ex(r,-1)}function Pp(r,e){const t=new Date(r);return t.setFullYear(t.getFullYear()+e),t}function lP(r,e){return Pp(r,-e)}function uP(r){return ts(new Date(r.getFullYear(),0,1))}function cP(r){return Oc(new Date(r.getFullYear(),11,31))}function _ye(r){const e=Math.floor(r.getFullYear()/10)*10;return ts(new Date(e,0,1))}function xye(r){const e=Math.floor(r.getFullYear()/10)*10+9;return Oc(new Date(e,11,31))}const zn=r=>r.getFullYear(),Op=r=>Math.floor(r.getFullYear()/10)*10;function wye(r){const e=[];let t=ts(r.start);const n=ts(r.end);for(;t<=n;)e.push(kl(t)),t=new Date(t.getTime()+gye);return e}function Sye(r){const e=[];let t=Q1(r.start);const n=J1(r.end);for(;t<=n;)e.push(kl(t)),t=ex(t,1);return e}function kye(r){const e=[];let t=uP(r.start);const n=cP(r.end);for(;t<=n;)e.push(kl(t)),t=Pp(t,1);return e}function tx(r,e=1){const t=ts(r),n=(t.getDay()-e+7)%7;return t.setDate(t.getDate()-n),t}function Eye(r,e=1){const t=tx(r,e);return t.setDate(t.getDate()+6),Oc(t)}function Cye(r,e,t=0){const n=tx(r,t),a=(e-t+7)%7;return n.setDate(n.getDate()+a),n}const zp=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()&&r.getDate()===e.getDate(),rx=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth(),dP=(r,e)=>!!r&&!!e&&r.getFullYear()===e.getFullYear(),fP=(r,e)=>!!r&&!!e&&zp(r,e)&&r.getHours()===e.getHours(),Tye=(r,e)=>!!r&&!!e&&fP(r,e)&&r.getMinutes()===e.getMinutes();function Dye(r,e){const t=r.getTime();return t>=e.start.getTime()&&t<=e.end.getTime()}const zc=(r,e)=>!!r&&!!e&&r.getTime()<e.getTime(),Fc=(r,e)=>!!r&&!!e&&r.getTime()>e.getTime();function Aye(r){const e=r.filter(t=>ur(t));if(e.length)return e.reduce((t,n)=>t.getTime()>=n.getTime()?t:n)}function Mye(r){const e=r.filter(t=>ur(t));if(e.length)return e.reduce((t,n)=>t.getTime()<=n.getTime()?t:n)}function hP(r,e){const t=kl(r);return typeof e.year=="number"&&t.setFullYear(e.year),typeof e.month=="number"&&t.setMonth(e.month),typeof e.date=="number"&&t.setDate(e.date),typeof e.hours=="number"&&t.setHours(e.hours),typeof e.minutes=="number"&&t.setMinutes(e.minutes),typeof e.seconds=="number"&&t.setSeconds(e.seconds),typeof e.milliseconds=="number"&&t.setMilliseconds(e.milliseconds),t}const Fp=(r,e=2)=>String(r).padStart(e,"0");function pP(r,e){return e==="wide"?vye[r]:mye[r]}function Nye(r){return yye[r]}const Lye=[{token:"LLLL",format:r=>pP(r.getMonth(),"wide")},{token:"LLL",format:r=>pP(r.getMonth(),"abbreviated")},{token:"EE",format:r=>Nye(r.getDay())},{token:"yyyy",format:r=>String(r.getFullYear())},{token:"MM",format:r=>Fp(r.getMonth()+1)},{token:"dd",format:r=>Fp(r.getDate())},{token:"HH",format:r=>Fp(r.getHours())},{token:"mm",format:r=>Fp(r.getMinutes())}];function $p(r,e){if(!ur(r))return"";let t="",n=0;for(;n<e.length;){const a=Lye.find(i=>e.startsWith(i.token,n));a?(t+=a.format(r),n+=a.token.length):(t+=e[n],n+=1)}return t}const Iye={"yyyy-MM-dd":/^(\d{4})-(\d{2})-(\d{2})$/,"dd.MM.yyyy":/^(\d{2})\.(\d{2})\.(\d{4})$/,"dd.MM.yyyy HH:mm":/^(\d{2})\.(\d{2})\.(\d{4}) (\d{2}):(\d{2})$/,"HH:mm":/^(\d{2}):(\d{2})$/,"MM.yyyy":/^(\d{2})\.(\d{4})$/,yyyy:/^(\d{4})$/};function gP(r,e){const t=Iye[e];if(!t){const a=new Date(r);return ur(a)?a:null}const n=r.match(t);if(!n)return null;switch(e){case"yyyy-MM-dd":{const[,a,i,o]=n,s=new Date(Number(a),Number(i)-1,Number(o));return ur(s)?s:null}case"dd.MM.yyyy":{const[,a,i,o]=n,s=new Date(Number(o),Number(i)-1,Number(a));return ur(s)?s:null}case"dd.MM.yyyy HH:mm":{const[,a,i,o,s,l]=n,u=new Date(Number(o),Number(i)-1,Number(a),Number(s),Number(l));return ur(u)?u:null}case"HH:mm":{const[,a,i]=n,o=new Date;return o.setHours(Number(a),Number(i),0,0),o}case"MM.yyyy":{const[,a,i]=n;return new Date(Number(i),Number(a)-1,1)}case"yyyy":{const[,a]=n;return new Date(Number(a),0,1)}default:return null}}const Bye=["year","month","day","time","custom"],Vye=d.defineComponent({emits:{elementClick:r=>ur(r),left:()=>!0,right:()=>!0,heading:()=>!0},props:{headingClickable:{type:Boolean,default:!1},leftDisabled:{type:Boolean,default:!1},rightDisabled:{type:Boolean,default:!1},columnCount:{type:Number,default:7},items:{type:Array,default:()=>[]},viewMode:{type:String,required:!0,validate:r=>typeof r=="string"&&Bye.includes(r)}}}),Rye={class:"v3dp__heading"},Pye=["disabled"],Oye=["disabled"],zye={class:"v3dp__body"},Fye={class:"v3dp__subheading"},$ye={class:"v3dp__elements"},Gye=["disabled","onClick"];function Uye(r,e,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["v3dp__popout",`v3dp__popout-${r.viewMode}`]),style:d.normalizeStyle({"--popout-column-definition":`repeat(${r.columnCount}, 1fr)`}),onMousedown:e[3]||(e[3]=d.withModifiers(()=>{},["prevent"]))},[d.createElementVNode("div",Rye,[d.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__left",disabled:r.leftDisabled,onClick:e[0]||(e[0]=d.withModifiers(o=>r.$emit("left"),["stop","prevent"]))},[d.renderSlot(r.$slots,"arrow-left",{},()=>[e[4]||(e[4]=d.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[d.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[d.createElementVNode("path",{stroke:"none",d:"M-9 16V-8h24v24z"}),d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 0L1 4l4 4"})])],-1))],!0)],8,Pye),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r.headingClickable?"button":"span"),{class:"v3dp__heading__center",onClick:e[1]||(e[1]=d.withModifiers(o=>r.$emit("heading"),["stop","prevent"]))},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"heading",{},void 0,!0)]),_:3})),d.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__right",disabled:r.rightDisabled,onClick:e[2]||(e[2]=d.withModifiers(o=>r.$emit("right"),["stop","prevent"]))},[d.renderSlot(r.$slots,"arrow-right",{},()=>[e[5]||(e[5]=d.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[d.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[d.createElementVNode("path",{stroke:"none",d:"M15-8v24H-9V-8z"}),d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M1 8l4-4-4-4"})])],-1))],!0)],8,Oye)]),d.createElementVNode("div",zye,["subheading"in r.$slots?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createElementVNode("div",Fye,[d.renderSlot(r.$slots,"subheading",{},void 0,!0)]),e[6]||(e[6]=d.createElementVNode("hr",{class:"v3dp__divider"},null,-1))],64)):d.createCommentVNode("",!0),d.createElementVNode("div",$ye,[d.renderSlot(r.$slots,"body",{},()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,o=>(d.openBlock(),d.createElementBlock("button",{key:o.key,disabled:o.disabled,class:d.normalizeClass([{selected:o.selected,current:o.current},`v3dp__element__button__${r.viewMode}`]),onClick:d.withModifiers(s=>r.$emit("elementClick",o.value),["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(o.display),1)],10,Gye))),128))],!0)])])],38)}const Gp=Ye(Vye,[["render",Uye],["__scopeId","data-v-bc92af04"]]),Hye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r)},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(r,{emit:e}){const t=d.computed(()=>_ye(r.pageDate)),n=d.computed(()=>xye(r.pageDate)),a=(u,c,f)=>!c&&!f?!0:!(c&&zn(u)<zn(c)||f&&zn(u)>zn(f)),i=d.computed(()=>kye({start:t.value,end:n.value}).map(u=>({value:u,key:String(zn(u)),display:zn(u),selected:!!r.selected&&zn(u)===zn(r.selected),disabled:!a(u,r.lowerLimit,r.upperLimit)}))),o=d.computed(()=>{const u=zn(t.value),c=zn(n.value);return`${u} - ${c}`}),s=d.computed(()=>r.lowerLimit&&(Op(r.lowerLimit)===Op(r.pageDate)||zc(r.pageDate,r.lowerLimit))),l=d.computed(()=>r.upperLimit&&(Op(r.upperLimit)===Op(r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{years:i,heading:o,leftDisabled:s,rightDisabled:l,previousPage:()=>e("update:pageDate",lP(r.pageDate,10)),nextPage:()=>e("update:pageDate",Pp(r.pageDate,10))}}});function Wye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{columnCount:3,leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,items:r.years,viewMode:"year",onLeft:r.previousPage,onRight:r.nextPage,onElementClick:e[0]||(e[0]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Yye=Ye(Hye,[["render",Wye]]),qye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"LLL"},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(r,{emit:e}){const t=d.computed(()=>uP(r.pageDate)),n=d.computed(()=>cP(r.pageDate)),a=d.computed(()=>c=>$p(c,r.format)),i=(c,f,h)=>!f&&!h?!0:!(f&&zc(c,Q1(f))||h&&Fc(c,J1(h))),o=d.computed(()=>Sye({start:t.value,end:n.value}).map(c=>({value:c,display:a.value(c),key:a.value(c),selected:!!r.selected&&rx(r.selected,c),disabled:!i(c,r.lowerLimit,r.upperLimit)}))),s=d.computed(()=>zn(t.value)),l=d.computed(()=>r.lowerLimit&&(dP(r.lowerLimit,r.pageDate)||zc(r.pageDate,r.lowerLimit))),u=d.computed(()=>r.upperLimit&&(dP(r.upperLimit,r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{months:o,heading:s,leftDisabled:l,rightDisabled:u,previousPage:()=>e("update:pageDate",lP(r.pageDate,1)),nextPage:()=>e("update:pageDate",Pp(r.pageDate,1))}}});function Zye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",columnCount:3,items:r.months,leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,viewMode:"month",onLeft:r.previousPage,onRight:r.nextPage,onHeading:e[0]||(e[0]=s=>r.$emit("back")),onElementClick:e[1]||(e[1]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),_:1},8,["items","leftDisabled","rightDisabled","onLeft","onRight"])}const Xye=Ye(qye,[["render",Zye]]),jye=d.defineComponent({components:{PickerPopup:Gp},emits:{"update:pageDate":r=>ur(r),select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"dd"},headingFormat:{type:String,required:!1,default:"LLLL yyyy"},weekdayFormat:{type:String,required:!1,default:"EE"},weekStartsOn:{type:Number,required:!1,default:1,validator:r=>typeof r=="number"&&Number.isInteger(r)&&r>=0&&r<=6},customWeekdays:{type:Array,required:!1},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1}},setup(r,{emit:e}){const t=d.computed(()=>g=>v=>$p(v,g)),n=d.computed(()=>Q1(r.pageDate)),a=d.computed(()=>J1(r.pageDate)),i=d.computed(()=>({start:n.value,end:a.value})),o=d.computed(()=>({start:tx(n.value,r.weekStartsOn),end:Eye(a.value,r.weekStartsOn)})),s=d.computed(()=>{var g;return((g=r.customWeekdays)==null?void 0:g.length)===7?r.customWeekdays:null}),l=d.computed(()=>{const g=r.weekStartsOn,v=s.value;if(v)return Array.from({length:7}).map((y,b)=>v[(g+b)%7]);const m=t.value(r.weekdayFormat);return Array.from(Array(7)).map((y,b)=>(g+b)%7).map(y=>Cye(new Date,y,r.weekStartsOn)).map(m)}),u=(g,v,m,y)=>{var b,_;return(b=y==null?void 0:y.dates)!=null&&b.some(x=>zp(g,x))||(_=y==null?void 0:y.predicate)!=null&&_.call(y,g)?!1:!v&&!m?!0:!(v&&zc(g,ts(v))||m&&Fc(g,Oc(m)))},c=d.computed(()=>{const g=new Date,v=t.value(r.format);return wye(o.value).map(m=>({value:m,display:v(m),selected:!!r.selected&&zp(r.selected,m),current:zp(g,m),disabled:!r.allowOutsideInterval&&!Dye(m,i.value)||!u(m,r.lowerLimit,r.upperLimit,r.disabledDates),key:t.value("yyyy-MM-dd")(m)}))}),f=d.computed(()=>t.value(r.headingFormat)(r.pageDate)),h=d.computed(()=>r.lowerLimit&&(rx(r.lowerLimit,r.pageDate)||zc(r.pageDate,r.lowerLimit))),p=d.computed(()=>r.upperLimit&&(rx(r.upperLimit,r.pageDate)||Fc(r.pageDate,r.upperLimit)));return{weekDays:l,days:c,heading:f,leftDisabled:h,rightDisabled:p,previousPage:()=>e("update:pageDate",bye(r.pageDate)),nextPage:()=>e("update:pageDate",ex(r.pageDate,1))}}});function Kye(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",leftDisabled:r.leftDisabled,rightDisabled:r.rightDisabled,items:r.days,viewMode:"day",onLeft:r.previousPage,onRight:r.nextPage,onHeading:e[0]||(e[0]=s=>r.$emit("back")),onElementClick:e[1]||(e[1]=s=>r.$emit("select",s))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.heading),1)]),subheading:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.weekDays,(s,l)=>(d.openBlock(),d.createElementBlock("span",{key:s,class:d.normalizeClass(`v3dp__subheading__weekday__${l}`)},d.toDisplayString(s),3))),128))]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Qye=Ye(jye,[["render",Kye]]);function vP(r,e){const t=r.getBoundingClientRect(),n={height:r.clientHeight,width:r.clientWidth},a=e.getBoundingClientRect();if(!(a.top>=t.top&&a.bottom<=t.top+n.height)){const i=a.top-t.top,o=a.bottom-t.bottom;Math.abs(i)<Math.abs(o)?r.scrollTop+=i:r.scrollTop+=o}}const Jye=d.defineComponent({components:{PickerPopup:Gp},emits:{select:r=>ur(r),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},visible:{type:Boolean,required:!0},disabledTime:{type:Object,required:!1}},setup(r,{emit:e}){const t=d.ref(null),n=d.ref(null),a=d.computed(()=>r.pageDate??r.selected),i=d.ref(a.value.getHours()),o=d.ref(a.value.getMinutes());d.watch(()=>r.selected,f=>{let h=0,p=0;f&&(h=f.getHours(),p=f.getMinutes()),i.value=h,o.value=p});const s=d.computed(()=>[...Array(24).keys()].map(f=>({value:f,date:hP(new Date(a.value.getTime()),{hours:f,minutes:o.value,seconds:0}),selected:i.value===f,ref:d.ref(null)}))),l=d.computed(()=>[...Array(60).keys()].map(f=>({value:f,date:hP(new Date(a.value.getTime()),{hours:i.value,minutes:f,seconds:0}),selected:o.value===f,ref:d.ref(null)}))),u=f=>{o.value=f.value,e("select",f.date)},c=()=>{const f=s.value.find(p=>{var g,v;return((v=(g=p.ref.value)==null?void 0:g.classList)==null?void 0:v.contains("selected"))??!1}),h=l.value.find(p=>{var g,v;return((v=(g=p.ref.value)==null?void 0:g.classList)==null?void 0:v.contains("selected"))??!1});f&&h&&(vP(t.value,f.ref.value),vP(n.value,h.ref.value))};return d.watch(()=>r.visible,f=>{f&&d.nextTick(c)}),{hoursListRef:t,minutesListRef:n,hours:i,minutes:o,hoursList:s,minutesList:l,padStartZero:f=>`0${f}`.substr(-2),selectMinutes:u,isEnabled:f=>{var h,p,g,v;return!((p=(h=r.disabledTime)==null?void 0:h.dates)!=null&&p.some(m=>fP(f,m)&&Tye(f,m))||(v=(g=r.disabledTime)==null?void 0:g.predicate)!=null&&v.call(g,f))},scroll:c}}}),e0e={ref:"hoursListRef",class:"v3dp__column"},t0e=["disabled","onClick"],r0e={ref:"minutesListRef",class:"v3dp__column"},n0e=["disabled","onClick"];function a0e(r,e,t,n,a,i){const o=d.resolveComponent("picker-popup");return d.openBlock(),d.createBlock(o,{headingClickable:"",columnCount:2,leftDisabled:!0,rightDisabled:!0,viewMode:"time",onHeading:e[0]||(e[0]=s=>r.$emit("back"))},{heading:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(r.padStartZero(r.hours))+":"+d.toDisplayString(r.padStartZero(r.minutes)),1)]),body:d.withCtx(()=>[d.createElementVNode("div",e0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.hoursList,s=>(d.openBlock(),d.createElementBlock("button",{key:s.value,ref_for:!0,ref:s.ref,class:d.normalizeClass([{selected:s.selected},"v3dp__element_button__hour"]),disabled:!r.isEnabled(s.date),onClick:d.withModifiers(l=>r.hours=s.value,["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(r.padStartZero(s.value)),1)],10,t0e))),128))],512),d.createElementVNode("div",r0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.minutesList,s=>(d.openBlock(),d.createElementBlock("button",{key:s.value,ref_for:!0,ref:s.ref,class:d.normalizeClass([{selected:s.selected},"v3dp__element_button__minute"]),disabled:!r.isEnabled(s.date),onClick:d.withModifiers(l=>r.selectMinutes(s),["stop","prevent"])},[d.createElementVNode("span",null,d.toDisplayString(r.padStartZero(s.value)),1)],10,n0e))),128))],512)]),_:1})}const i0e=Ye(Jye,[["render",a0e],["__scopeId","data-v-610b89e1"]]),Up=["time","day","month","year"],o0e=(r,e,t=void 0)=>{let n=t||new Date;const a=Aye([r,n]);a&&(n=a);const i=Mye([e,n]);return i&&(n=i),n},s0e=d.defineComponent({components:{YearPicker:Yye,MonthPicker:Xye,DayPicker:Qye,TimePicker:i0e},inheritAttrs:!1,props:{placeholder:{type:String,default:""},modelValue:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1},disabledTime:{type:Object,required:!1},upperLimit:{type:Date,required:!1},lowerLimit:{type:Date,required:!1},startingView:{type:String,required:!1,default:"day",validate:r=>typeof r=="string"&&Up.includes(r)},startingViewDate:{type:Date,required:!1,default:()=>new Date},dayPickerHeadingFormat:{type:String,required:!1,default:"LLLL yyyy"},monthListFormat:{type:String,required:!1,default:"LLL"},weekdayFormat:{type:String,required:!1,default:"EE"},dayFormat:{type:String,required:!1,default:"dd"},inputFormat:{type:String,required:!1,default:"yyyy-MM-dd"},weekDayNames:{type:Array,required:!1},weekStartsOn:{type:Number,required:!1,default:1,validator:r=>[0,1,2,3,4,5,6].includes(r)},disabled:{type:Boolean,required:!1,default:!1},clearable:{type:Boolean,required:!1,default:!1},typeable:{type:Boolean,required:!1,default:!1},minimumView:{type:String,required:!1,default:"day",validate:r=>typeof r=="string"&&Up.includes(r)}},emits:{"update:modelValue":r=>r==null||ur(r),decadePageChanged:r=>!0,yearPageChanged:r=>!0,monthPageChanged:r=>!0,opened:()=>!0,closed:()=>!0},setup(r,{emit:e,attrs:t}){const n=d.ref("none"),a=d.ref(r.startingViewDate),i=d.ref(null),o=d.ref(!1),s=d.ref(""),l=L=>{const B=L.replace(/[a-zA-Z]/g,"0");return/0/.test(B)?B:""},u=d.computed(()=>l(r.inputFormat));let c=null,f=null;const h=()=>{c==null||c.destroy(),c=null},p=async()=>{if(!f){const{default:L}=await Promise.resolve().then(()=>sx);f=L}return f},g=()=>{c&&c.value!==s.value&&(c.value=s.value??"")},v=async()=>{h(),!(!i.value||!u.value)&&(c=(await p())(i.value,{mask:u.value,lazy:!0,overwrite:!0}),g())};d.watchEffect(()=>{if(!s.value)return;const L=gP(s.value,r.inputFormat);L&&(a.value=L)}),d.watchEffect(()=>{s.value=r.modelValue&&ur(r.modelValue)?$p(r.modelValue,r.inputFormat):""}),d.onMounted(()=>{u.value&&d.nextTick(()=>{v()})}),d.onBeforeUnmount(()=>{h()}),d.watch(u,L=>{L?d.nextTick(()=>{v()}):h()}),d.watch(s,()=>{g()});const m=(L="none")=>{r.disabled||(L!=="none"&&n.value==="none"&&(a.value=r.modelValue||o0e(r.lowerLimit,r.upperLimit,a.value)),n.value=L,e(L!=="none"?"opened":"closed"))};d.watchEffect(()=>{r.disabled&&(n.value="none")});const y=(L,B)=>{a.value=B,L==="year"?e("decadePageChanged",B):L==="month"?e("yearPageChanged",B):L==="day"&&e("monthPageChanged",B)},b=L=>{a.value=L,r.minimumView==="year"?(m("none"),e("update:modelValue",L)):n.value="month"},_=L=>{a.value=L,r.minimumView==="month"?(m("none"),e("update:modelValue",L)):n.value="day"},x=L=>{a.value=L,r.minimumView==="day"?(m("none"),e("update:modelValue",L)):n.value="time"},w=L=>{m("none"),e("update:modelValue",L)},S=()=>{r.clearable&&(m("none"),e("update:modelValue",null),a.value=r.startingViewDate)},k=()=>o.value=!0,E=()=>m(D.value),C=()=>{o.value=!1,m()},T=L=>{const B=L.keyCode?L.keyCode:L.which;if([27,13].includes(B)&&i.value.blur(),r.typeable){const N=gP(i.value.value,r.inputFormat);N&&s.value===$p(N,r.inputFormat)&&(s.value=i.value.value,e("update:modelValue",N))}},D=d.computed(()=>{const L=Up.indexOf(r.startingView),B=Up.indexOf(r.minimumView);return L<B?r.minimumView:r.startingView}),A=L=>Object.fromEntries(Object.entries(L??{}).filter(([B,N])=>B.startsWith("--"))),I=d.computed(()=>{var L;return((L=r.weekDayNames)==null?void 0:L.length)===7?r.weekDayNames:void 0});return{blur:C,focus:E,click:k,input:s,inputRef:i,pageDate:a,renderView:m,updatePageDate:y,selectYear:b,selectMonth:_,selectDay:x,selectTime:w,keyUp:T,normalizedWeekdayNames:I,viewShown:n,goBackFromTimepicker:()=>r.startingView==="time"&&r.minimumView==="time"?null:n.value="day",clearModelValue:S,initialView:D,log:L=>console.log(L),variables:A}}}),l0e={class:"v3dp__input_wrapper"},u0e=["readonly","placeholder","disabled","tabindex"],c0e={class:"v3dp__clearable"};function d0e(r,e,t,n,a,i){const o=d.resolveComponent("year-picker"),s=d.resolveComponent("month-picker"),l=d.resolveComponent("day-picker"),u=d.resolveComponent("time-picker");return d.openBlock(),d.createElementBlock("div",{class:"v3dp__datepicker",style:d.normalizeStyle(r.variables(r.$attrs.style))},[d.createElementVNode("div",l0e,[d.withDirectives(d.createElementVNode("input",d.mergeProps({type:"text",ref:"inputRef",readonly:!r.typeable,"onUpdate:modelValue":e[0]||(e[0]=c=>r.input=c)},r.$attrs,{placeholder:r.placeholder,disabled:r.disabled,tabindex:r.disabled?-1:0,onKeyup:e[1]||(e[1]=(...c)=>r.keyUp&&r.keyUp(...c)),onBlur:e[2]||(e[2]=(...c)=>r.blur&&r.blur(...c)),onFocus:e[3]||(e[3]=(...c)=>r.focus&&r.focus(...c)),onClick:e[4]||(e[4]=(...c)=>r.click&&r.click(...c))}),null,16,u0e),[[d.vModelText,r.input]]),d.withDirectives(d.createElementVNode("div",c0e,[d.renderSlot(r.$slots,"clear",{onClear:r.clearModelValue},()=>[d.createElementVNode("i",{onClick:e[5]||(e[5]=c=>r.clearModelValue())},"x")])],512),[[d.vShow,r.clearable&&r.modelValue]])]),d.withDirectives(d.createVNode(o,{pageDate:r.pageDate,"onUpdate:pageDate":e[6]||(e[6]=c=>r.updatePageDate("year",c)),selected:r.modelValue,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,onSelect:r.selectYear},null,8,["pageDate","selected","lowerLimit","upperLimit","onSelect"]),[[d.vShow,r.viewShown==="year"]]),d.withDirectives(d.createVNode(s,{pageDate:r.pageDate,"onUpdate:pageDate":e[7]||(e[7]=c=>r.updatePageDate("month",c)),selected:r.modelValue,onSelect:r.selectMonth,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,format:r.monthListFormat,onBack:e[8]||(e[8]=c=>r.viewShown="year")},null,8,["pageDate","selected","onSelect","lowerLimit","upperLimit","format"]),[[d.vShow,r.viewShown==="month"]]),d.withDirectives(d.createVNode(l,{pageDate:r.pageDate,"onUpdate:pageDate":e[9]||(e[9]=c=>r.updatePageDate("day",c)),selected:r.modelValue,weekStartsOn:r.weekStartsOn,lowerLimit:r.lowerLimit,upperLimit:r.upperLimit,headingFormat:r.dayPickerHeadingFormat,disabledDates:r.disabledDates,weekdayFormat:r.weekdayFormat,"allow-outside-interval":r.allowOutsideInterval,format:r.dayFormat,"custom-weekdays":r.normalizedWeekdayNames,onSelect:r.selectDay,onBack:e[10]||(e[10]=c=>r.viewShown="month")},null,8,["pageDate","selected","weekStartsOn","lowerLimit","upperLimit","headingFormat","disabledDates","weekdayFormat","allow-outside-interval","format","custom-weekdays","onSelect"]),[[d.vShow,r.viewShown==="day"]]),d.withDirectives(d.createVNode(u,{pageDate:r.pageDate,visible:r.viewShown==="time",selected:r.modelValue,disabledTime:r.disabledTime,onSelect:r.selectTime,onBack:r.goBackFromTimepicker},null,8,["pageDate","visible","selected","disabledTime","onSelect","onBack"]),[[d.vShow,r.viewShown==="time"]])],4)}const f0e=Ye(s0e,[["render",d0e]]),h0e=d.defineComponent({__name:"vs-input-date2",props:{clearable:{type:Boolean,default:!0},now:{type:Boolean},editable:{type:Boolean,default:!0},time:{type:Boolean},isInfinity:{type:Boolean},mode:{default:"date"},weekStart:{},dayNames:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,{inputClass:a}=br(t.style),i=d.computed(()=>t.mode?t.mode:t.time?"datetime":"date"),o={date:"дд.мм.рррр",datetime:"дд.мм.рррр гг:хх",month:"мм.рррр",week:"рррр-тиждень",time:"гг:хх",year:"рррр"},s=d.computed(()=>t.placeholder||o[i.value]||""),l=d.computed(()=>["py-1.5 px-3 block w-full placeholder:text-[#767f8f] bg-white",a.value,t.customClass,{"!border-red-600":t.error}]),u=d.computed(()=>!t.modelValue&&t.now?new Date:null),c=d.computed({get:()=>_(t.modelValue??u.value,i.value)||void 0,set:N=>n("update:modelValue",x(N,i.value))}),f=["Пн","Вт","Ср","Чт","Пт","Сб","Нд"],h=d.computed(()=>{var N;if((N=t.dayNames)!=null&&N.length)return t.dayNames.length===7?t.dayNames:f}),p=d.computed(()=>{const N=t.weekStart,V=typeof N=="string"?Number(N):N;return V===void 0||Number.isNaN(V)?1:Math.min(6,Math.max(0,V))}),g=d.computed(()=>{switch(i.value){case"time":return{startingView:"time",minimumView:"time"};case"month":return{startingView:"month",minimumView:"month"};case"year":return{startingView:"year",minimumView:"year"};case"datetime":return{startingView:"day",minimumView:"time"};default:return{startingView:"day",minimumView:"day"}}}),v={date:"dd.MM.yyyy",datetime:"dd.MM.yyyy HH:mm",month:"MM.yyyy",time:"HH:mm",week:"dd.MM.yyyy",year:"yyyy"},m=d.computed(()=>v[i.value]||"dd.MM.yyyy"),y=d.computed(()=>{var N,V,R,F;return{"--vdp-selected-bg-color":((N=t.style)==null?void 0:N.primaryColor)||"#2563eb","--vdp-hover-bg-color":((V=t.style)==null?void 0:V.primaryColor)||"#2563eb","--vdp-selected-color":"#ffffff","--vdp-hover-color":"#ffffff","--vdp-border-radius":((R=t.style)==null?void 0:R.size)==="sm"?"6px":"8px","--vdp-elem-font-size":((F=t.style)==null?void 0:F.size)==="sm"?"0.75em":"0.85em"}}),b=d.ref(!1);d.watch(()=>t.modelValue,N=>{N?b.value=!0:t.now||(b.value=!1)},{immediate:!0}),d.watchEffect(()=>{t.now&&!t.modelValue&&!b.value&&(n("update:modelValue",x(new Date,i.value)),b.value=!0)});function _(N,V){if(!N)return null;if(N instanceof Date&&!Number.isNaN(N.getTime()))return N;if(typeof N!="string")return null;switch(V){case"datetime":return E(N);case"time":return D(N);case"month":return C(N);case"year":return T(N);case"week":return A(N);case"date":default:return k(N)}}function x(N,V){if(!N)return null;const R=N instanceof Date?N:_(N,V);if(!R)return null;switch(V){case"datetime":return`${w(R)}T${S(R)}`;case"time":return S(R);case"month":return`${R.getFullYear()}-${B(R.getMonth()+1)}`;case"year":return`${R.getFullYear()}`;case"week":{const{year:F,week:G}=I(R);return`${F}-W${B(G)}`}case"date":default:return w(R)}}function w(N){return`${N.getFullYear()}-${B(N.getMonth()+1)}-${B(N.getDate())}`}function S(N){return`${B(N.getHours())}:${B(N.getMinutes())}`}function k(N){const V=N.split("-");if(V.length<3)return null;const[R,F,G]=V.map(Number);return!R||!F||!G?null:new Date(R,F-1,G)}function E(N){const V=N.includes("T")?N:N.replace(" ","T"),R=new Date(V);return Number.isNaN(R.getTime())?null:R}function C(N){const[V,R]=N.split("-").map(Number);return!V||Number.isNaN(R)?null:new Date(V,(R||1)-1,1)}function T(N){const V=Number(N);return V?new Date(V,0,1):null}function D(N){const V=N.match(/^(\d{1,2}):(\d{2})$/);if(!V)return null;const[,R,F]=V,G=new Date;return G.setHours(Number(R),Number(F),0,0),G}function A(N){const V=N.match(/^(\d{4})-W(\d{2})$/);if(!V)return null;const[,R,F]=V,G=Number(F);return L(Number(R),G)}function I(N){const V=new Date(Date.UTC(N.getFullYear(),N.getMonth(),N.getDate())),R=V.getUTCDay()||7;V.setUTCDate(V.getUTCDate()+4-R);const F=new Date(Date.UTC(V.getUTCFullYear(),0,1)),G=Math.ceil(((V.getTime()-F.getTime())/864e5+1)/7);return{year:V.getUTCFullYear(),week:G}}function L(N,V){if(!N||!V)return null;const R=new Date(N,0,1+(V-1)*7),F=R.getDay(),G=R;return F<=4?G.setDate(R.getDate()-R.getDay()+1):G.setDate(R.getDate()+8-R.getDay()),G}function B(N){return String(N).padStart(2,"0")}return(N,V)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["vs-date-picker",t.customClass]),style:d.normalizeStyle(y.value)},[d.createVNode(f0e,{modelValue:c.value,"onUpdate:modelValue":V[0]||(V[0]=R=>c.value=R),placeholder:s.value,disabled:t.disabled,clearable:t.clearable,typeable:t.editable,"week-day-names":h.value,"week-starts-on":p.value,"starting-view":g.value.startingView,"minimum-view":g.value.minimumView,"input-format":m.value,name:t.name,class:d.normalizeClass(l.value)},null,8,["modelValue","placeholder","disabled","clearable","typeable","week-day-names","week-starts-on","starting-view","minimum-view","input-format","name","class"])],6))}}),p0e=Ye(h0e,[["__scopeId","data-v-a65a2ac3"]]),mP=(r={mode:"edit",schema:null})=>new Promise(e=>{const{close:t}=O1({title:r.mode==="add"?"Додати":"Редагувати",template:"",size:"medium",content:sP,contentProps:{...r,onClose:()=>{e(null),t()},onSave:n=>{e(n),t()}}})});Fa.install=function(r){r.component("VForm",Fa),Object.assign(r.config.globalProperties,{$form:mP}),r.provide("form",mP),window.v3plugin||(window.v3plugin={})};const $a=Object.freeze(Object.defineProperty({__proto__:null,ModalEdit:sP,VForm:Fa,VsInputAddress:rP,VsInputArray:tP,VsInputArraySelect:Bp,VsInputCheckbox:VR,VsInputCodegen:jR,VsInputColor:JR,VsInputContainer:UR,VsInputDate:p0e,VsInputEmail:H1,VsInputFile:FR,VsInputFileList:$R,VsInputKeyValue:KR,VsInputMask:U1,VsInputNumber:BR,VsInputRadio:Y1,VsInputRange:eP,VsInputRichtext:WR,VsInputSelect:X1,VsInputSlug:XR,VsInputStatic:G1,VsInputSwitcher:$1,VsInputTag:ZR,VsInputTel:W1,VsInputText:wl,VsInputTextArray:QR,VsInputTextarea:HR,default:Fa,inputs:Rp,vsInputDatatable:YR,vsInputMap:qR},Symbol.toStringTag,{value:"Module"}));function Ai(r){return typeof r=="string"||r instanceof String}function yP(r){var e;return typeof r=="object"&&r!=null&&(r==null||(e=r.constructor)==null?void 0:e.name)==="Object"}function bP(r,e){return Array.isArray(e)?bP(r,(t,n)=>e.includes(n)):Object.entries(r).reduce((t,n)=>{let[a,i]=n;return e(i,a)&&(t[a]=i),t},{})}const Ve={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function _P(r){switch(r){case Ve.LEFT:return Ve.FORCE_LEFT;case Ve.RIGHT:return Ve.FORCE_RIGHT;default:return r}}function nx(r){return r.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Hp(r,e){if(e===r)return!0;const t=Array.isArray(e),n=Array.isArray(r);let a;if(t&&n){if(e.length!=r.length)return!1;for(a=0;a<e.length;a++)if(!Hp(e[a],r[a]))return!1;return!0}if(t!=n)return!1;if(e&&r&&typeof e=="object"&&typeof r=="object"){const i=e instanceof Date,o=r instanceof Date;if(i&&o)return e.getTime()==r.getTime();if(i!=o)return!1;const s=e instanceof RegExp,l=r instanceof RegExp;if(s&&l)return e.toString()==r.toString();if(s!=l)return!1;const u=Object.keys(e);for(a=0;a<u.length;a++)if(!Object.prototype.hasOwnProperty.call(r,u[a]))return!1;for(a=0;a<u.length;a++)if(!Hp(r[u[a]],e[u[a]]))return!1;return!0}else if(e&&r&&typeof e=="function"&&typeof r=="function")return e.toString()===r.toString();return!1}class g0e{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?Ve.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Ve.RIGHT:Ve.LEFT}}function Xe(r,e){return new Xe.InputMask(r,e)}function xP(r){if(r==null)throw new Error("mask property should be defined");return r instanceof RegExp?Xe.MaskedRegExp:Ai(r)?Xe.MaskedPattern:r===Date?Xe.MaskedDate:r===Number?Xe.MaskedNumber:Array.isArray(r)||r===Array?Xe.MaskedDynamic:Xe.Masked&&r.prototype instanceof Xe.Masked?r:Xe.Masked&&r instanceof Xe.Masked?r.constructor:r instanceof Function?Xe.MaskedFunction:(console.warn("Mask not found for mask",r),Xe.Masked)}function El(r){if(!r)throw new Error("Options in not defined");if(Xe.Masked){if(r.prototype instanceof Xe.Masked)return{mask:r};const{mask:e=void 0,...t}=r instanceof Xe.Masked?{mask:r}:yP(r)&&r.mask instanceof Xe.Masked?r:{};if(e){const n=e.mask;return{...bP(e,(a,i)=>!i.startsWith("_")),mask:e.constructor,_mask:n,...t}}}return yP(r)?{...r}:{mask:r}}function fa(r){if(Xe.Masked&&r instanceof Xe.Masked)return r;const e=El(r),t=xP(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)}Xe.createMask=fa;class Wp{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}}Xe.MaskElement=Wp;const wP=90,v0e=89;class $c extends Wp{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,n;return(e=(t=(n=this.input).getRootNode)==null?void 0:t.call(n))!=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===wP&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===v0e&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===wP&&(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={}}}Xe.HTMLMaskElement=$c;class SP extends $c{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}}Xe.HTMLMaskElement=$c;class ax extends $c{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||n==null||n<a?n:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||n==null||n>a?n:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,i=a.getSelection&&a.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Xe.HTMLContenteditableMaskElement=ax;class Yp{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>Yp.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}}Yp.MAX_LENGTH=100;class kP{constructor(e,t){this.el=e instanceof Wp?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new ax(e):new SP(e),this.masked=fa(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Yp,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 Xe.Masked)&&this.masked.constructor===xP(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof Xe.Masked?e:fa({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 n=this._listeners[e];n&&n.forEach(a=>a(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,n=this.masked.value,a=this.masked.rawInputValue,i=this.displayValue,o=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==a;this._unmaskedValue=t,this._value=n,this._rawInputValue=a,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...n}=e,a=!this.maskEquals(t),i=this.masked.optionsIsChanged(n);a&&(this.mask=t),i&&this.masked.updateOptions(n),(a||i)&&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,Ve.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 n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new g0e({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:Ve.NONE;let o=this.masked.nearestInputPos(t.startChangePos+a,i);i!==Ve.NONE&&(o=this.masked.nearestInputPos(o,Ve.NONE)),this.updateControl(o),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}}Xe.InputMask=kP;class et{static normalize(e){return Array.isArray(e)?e:[e,new et]}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}}Xe.ChangeDetails=et;class ha{constructor(e,t,n){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=n}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 cr{constructor(e){this._value="",this._update({...cr.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,n){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 ha(this.extractInput(e,t),e)}appendTail(e){return Ai(e)&&(e=new ha(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new et({inserted:e,rawInserted:e})):new et}_appendChar(e,t,n){t===void 0&&(t={});const a=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=a;let s=this.pad(t);const l=this._appendCharRaw(e,t);s=s.aggregate(l),l.rawInserted||s.equals(i)?i=s:this.state=o}if(i.inserted){let o,s=this.doValidate(t)!==!1;if(s&&n!=null){const l=this.state;if(this.overwrite===!0){o=n.state;for(let c=0;c<i.rawInserted.length;++c)n.unshift(this.displayValue.length-i.tailShift)}let u=this.appendTail(n);if(s=u.rawInserted.length===n.toString().length,!(s&&u.inserted)&&this.overwrite==="shift"){this.state=l,o=n.state;for(let c=0;c<i.rawInserted.length;++c)n.shift();u=this.appendTail(n),s=u.rawInserted.length===n.toString().length}s&&u.inserted&&(this.state=l)}s||(i=new et,this.state=a,n&&o&&(n.state=o))}return i}_appendPlaceholder(){return new et}_appendEager(){return new et}append(e,t,n){if(!Ai(e))throw new Error("value should be string");const a=Ai(n)?new ha(String(n)):n;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],t,a);if(!s.rawInserted&&!this.doSkipInvalid(e[o],t,a))break;i.aggregate(s)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),a!=null&&(i.tailShift+=this.appendTail(a).tailShift),i}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 et}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e,t,n){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),et.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),et.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,n,a,i){n===void 0&&(n=""),a===void 0&&(a=Ve.NONE),i===void 0&&(i={input:!0});const o=e+t,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let u;l&&(a=_P(a),u=this.extractInput(0,o,{raw:!0}));let c=e;const f=new et;if(a!==Ve.NONE&&(c=this.nearestInputPos(e,t>1&&e!==0&&!l?Ve.NONE:a),f.tailShift=c-e),f.aggregate(this.remove(c)),l&&a!==Ve.NONE&&u===this.rawInputValue)if(a===Ve.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)f.aggregate(new et({tailShift:-1})).aggregate(this.remove(h-1))}else a===Ve.FORCE_RIGHT&&s.unshift();return f.aggregate(this.append(n,i,s))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Hp(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||cr.EMPTY_VALUES.includes(e)&&cr.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new et}}cr.DEFAULTS={skipInvalid:!0},cr.EMPTY_VALUES=[void 0,null,""],Xe.Masked=cr;class Mi{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=Ai(e)?new ha(String(e)):e;const t=this.chunks[this.chunks.length-1],n=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof ha)n?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof Mi){if(e.stop==null){let a;for(;e.chunks.length&&e.chunks[0].stop==null;)a=e.chunks.shift(),a.from+=e.from,this.extend(a)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Xe.MaskedPattern))return new ha(this.toString()).appendTo(e);const t=new et;for(let n=0;n<this.chunks.length;++n){const a=this.chunks[n],i=e._mapPosToBlock(e.displayValue.length),o=a.stop;let s;if(o!=null&&(!i||i.index<=o)&&((a instanceof Mi||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),s=a instanceof Mi&&e._blocks[o]),s){const l=s.appendTail(a);t.aggregate(l);const u=a.toString().slice(l.rawInserted.length);u&&t.aggregate(e.append(u,{tail:!0}))}else t.aggregate(e.append(a.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,...n}=e;Object.assign(this,n),this.chunks=t.map(a=>{const i="chunks"in a?new Mi:new ha;return i.state=a,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let n=0;for(;n<this.chunks.length;){const a=this.chunks[n],i=a.unshift(t);if(a.toString()){if(!i)break;++n}else this.chunks.splice(n,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class m0e{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=a,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,Ve.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Ve.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ve.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Ve.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,Ve.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ve.NONE),!0})}}class ix{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 et}nearestInputPos(e,t){t===void 0&&(t=Ve.NONE);const n=0,a=this._value.length;switch(t){case Ve.LEFT:case Ve.FORCE_LEFT:return n;case Ve.NONE:case Ve.RIGHT:case Ve.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),n===void 0&&(n={}),n.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 et;const n=this.eager===!0||this.eager==="append",a=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&!t.tail,i=new et({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 et;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new ha("")}appendTail(e){return Ai(e)&&(e=new ha(String(e))),e.appendTo(this)}append(e,t,n){const a=this._appendChar(e[0],t);return n!=null&&(a.tailShift+=this.appendTail(n).tailShift),a}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 Gc{constructor(e){const{parent:t,isOptional:n,placeholderChar:a,displayChar:i,lazy:o,eager:s,...l}=e;this.masked=fa(l),Object.assign(this,{parent:t,isOptional:n,placeholderChar:a,displayChar:i,lazy:o,eager:s})}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 et}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 et;const n=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&this.doValidate(t)===!1&&(a=new et,this.masked.state=n),!a.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new et:(this.isFilled=!0,new et({inserted:this.placeholderChar}))}_appendEager(){return new et}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,n)}nearestInputPos(e,t){t===void 0&&(t=Ve.NONE);const n=0,a=this.value.length,i=Math.min(Math.max(e,n),a);switch(t){case Ve.LEFT:case Ve.FORCE_LEFT:return this.isComplete?i:n;case Ve.RIGHT:case Ve.FORCE_RIGHT:return this.isComplete?i:a;case Ve.NONE:default:return i}}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==null?void 0:e._beforeTailState)}}pad(e){return new et}}Gc.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 EP extends cr{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=n=>n.search(t)>=0),super._update(e)}}Xe.MaskedRegExp=EP;class dr extends cr{constructor(e){super({...dr.DEFAULTS,...e,definitions:Object.assign({},Gc.DEFAULT_DEFINITIONS,e==null?void 0: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 n=!1,a=!1;for(let i=0;i<t.length;++i){if(this.blocks){const u=t.slice(i),c=Object.keys(this.blocks).filter(h=>u.indexOf(h)===0);c.sort((h,p)=>p.length-h.length);const f=c[0];if(f){const{expose:h,repeat:p,...g}=El(this.blocks[f]),v={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...g,repeat:p,parent:this},m=p!=null?new Xe.RepeatBlock(v):fa(v);m&&(this._blocks.push(m),h&&(this.exposeBlock=m),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),i+=f.length-1;continue}}let o=t[i],s=o in e;if(o===dr.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){n=!n;continue}if(o==="["||o==="]"){a=!a;continue}if(o===dr.ESCAPE_CHAR){if(++i,o=t[i],!o)break;s=!1}const l=s?new Gc({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...El(e[o]),parent:this}):new ix({char:o,eager:this.eager,isUnmasking:n});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,...n}=e;this._blocks.forEach((a,i)=>a.state=t[i]),super.state=n}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 et;let n=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(n==null)return t;this._blocks[n].isFilled&&++n;for(let a=n;a<this._blocks.length;++a){const i=this._blocks[a]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._mapPosToBlock(this.displayValue.length),a=new et;if(!n)return a;for(let o=n.index,s;s=this._blocks[o];++o){var i;const l=s._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[o]});if(a.aggregate(l),l.consumed)break}return a}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=new Mi;return e===t||this._forEachBlocksInRange(e,t,(a,i,o,s)=>{const l=a.extractTail(o,s);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof Mi&&(l.blockIndex=i),n.extend(l)}),n}extractInput(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),n===void 0&&(n={}),e===t)return"";let a="";return this._forEachBlocksInRange(e,t,(i,o,s,l)=>{a+=i.extractInput(s,l,n)}),a}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const a=this._stops[n];if(a<=e)t=a;else break}return t}_appendPlaceholder(e){const t=new et;if(this.lazy&&e==null)return t;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return t;const a=n.index,i=e??this._blocks.length;return this._blocks.slice(a,i).forEach(o=>{if(!o.lazy||e!=null){var s;t.aggregate(o._appendPlaceholder((s=o._blocks)==null?void 0:s.length))}}),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const a=this._blocks[n],i=t.length;if(t+=a.displayValue,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,n)=>t+=n.displayValue.length,0)}_forEachBlocksInRange(e,t,n){t===void 0&&(t=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const i=this._mapPosToBlock(t),o=i&&a.index===i.index,s=a.offset,l=i&&o?i.offset:this._blocks[a.index].displayValue.length;if(n(this._blocks[a.index],a.index,s,l),i&&!o){for(let u=a.index+1;u<i.index;++u)n(this._blocks[u],u,0,this._blocks[u].displayValue.length);n(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,(a,i,o,s)=>{n.aggregate(a.remove(o,s))}),n}nearestInputPos(e,t){if(t===void 0&&(t=Ve.NONE),!this._blocks.length)return 0;const n=new m0e(this,e);if(t===Ve.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(t===Ve.LEFT||t===Ve.FORCE_LEFT){if(t===Ve.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===Ve.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:t===Ve.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return t===Ve.RIGHT||t===Ve.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===Ve.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,Ve.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,t,(a,i,o,s)=>{n+=a.totalInputPositions(o,s)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(n=>this._blocks[n]):[]}pad(e){const t=new et;return this._forEachBlocksInRange(0,this.displayValue.length,n=>t.aggregate(n.pad(e))),t}}dr.DEFAULTS={...cr.DEFAULTS,lazy:!0,placeholderChar:"_"},dr.STOP_CHAR="`",dr.ESCAPE_CHAR="\\",dr.InputDefinition=Gc,dr.FixedDefinition=ix,Xe.MaskedPattern=dr;class Uc extends dr{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:n=this.from||0,maxLength:a=this.maxLength||0,autofix:i=this.autofix,...o}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,a),this.autofix=i;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<l.length&&l[u]===s[u];)++u;o.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",n="";const[,a,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(a.length)+i,n="9".repeat(a.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepareChar(e,t){t===void 0&&(t={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const n=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[i,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(n[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(a[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[n,a]=this.boundaries(t);return this.from<=Number(a)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){const t=new et;if(this.value.length===this.maxLength)return t;const n=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let i=0;i<a;++i)t.aggregate(super._appendCharRaw("0",e));n.split("").forEach(i=>this._appendCharRaw(i))}return t}}Xe.MaskedRange=Uc;const y0e="d{.}`m{.}`Y";class pa extends dr{static extractPatternOptions(e){const{mask:t,pattern:n,...a}=e;return{...a,mask:Ai(t)?t:n}}constructor(e){super(pa.extractPatternOptions({...pa.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:n,blocks:a,...i}={...pa.DEFAULTS,...e},o=Object.assign({},pa.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,a),super._update({...i,mask:Ai(t)?t:n,blocks:o})}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(pa.extractPatternOptions(e))}}pa.GET_DEFAULT_BLOCKS=()=>({d:{mask:Uc,from:1,to:31,maxLength:2},m:{mask:Uc,from:1,to:12,maxLength:2},Y:{mask:Uc,from:1900,to:9999}}),pa.DEFAULTS={...dr.DEFAULTS,mask:Date,pattern:y0e,format:(r,e)=>{if(!r)return"";const t=String(r.getDate()).padStart(2,"0"),n=String(r.getMonth()+1).padStart(2,"0"),a=r.getFullYear();return[t,n,a].join(".")},parse:(r,e)=>{const[t,n,a]=r.split(".").map(Number);return new Date(a,n-1,t)}},Xe.MaskedDate=pa;class Hc extends cr{constructor(e){super({...Hc.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:n,...a}=El(t),i=fa({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a});return n&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){e===void 0&&(e=""),t===void 0&&(t={}),n===void 0&&(n="");const a=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,o=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,s=i.slice(o.length),l=this.currentMask,u=new et,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),u.tailShift=this.currentMask.value.length-a.length),s&&(u.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),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 et;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((n=e._beforeTailState)==null?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,t,n){return t===void 0&&(t={}),n===void 0&&(n=""),this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[n,a]=super.doPrepare(e,t);if(this.currentMask){let i;[n,i]=super.doPrepare(n,this.currentMaskFlags(t)),a=a.aggregate(i)}return[n,a]}doPrepareChar(e,t){t===void 0&&(t={});let[n,a]=super.doPrepareChar(e,t);if(this.currentMask){let i;[n,i]=super.doPrepareChar(n,this.currentMaskFlags(t)),a=a.aggregate(i)}return[n,a]}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 n=new et;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}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:n,currentMask:a,...i}=e;t&&this.compiledMasks.forEach((o,s)=>o.state=t[s]),n!=null&&(this.currentMask=n,this.currentMask.state=a),super.state=i}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):""}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,n)=>{if(!e[n])return;const{mask:a,...i}=e[n];return Hp(t,i)&&t.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Hc.DEFAULTS={...cr.DEFAULTS,dispatch:(r,e,t,n)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,i=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,u=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Ve.FORCE_LEFT);return o.rawInputValue!==a?(o.reset(),o.append(a,{raw:!0})):l||o.remove(u),o.append(r,e.currentMaskFlags(t)),o.appendTail(n),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(u,o.nearestInputPos(o.displayValue.length,Ve.FORCE_LEFT)))}});return i.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[i[0].index]}},Xe.MaskedDynamic=Hc;class Wc extends dr{constructor(e){super({...Wc.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...n}=e;if(t){const a=t.map(s=>s.length),i=Math.min(...a),o=Math.max(...a)-i;n.mask="*".repeat(i),o&&(n.mask+="["+"*".repeat(o)+"]"),this.enum=t}super._update(n)}_appendCharRaw(e,t){t===void 0&&(t={});const n=Math.min(this.nearestInputPos(0,Ve.FORCE_RIGHT),this.value.length),a=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,n));if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,s)=>{const l=a[0][s];s>=this.value.length||l===o.value||(o.reset(),o._appendChar(l,t))});const i=super._appendCharRaw(a[0][this.value.length],t);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(o=>i.aggregate(super._appendCharRaw(o))),i}return new et({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new ha("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new et;const n=Math.min(super.nearestInputPos(0,Ve.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0&&!(this.enum.filter(o=>this.matchValue(o,this.value.slice(n,a),n)).length>1);--a);const i=super.remove(a,t);return i.tailShift+=a-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}Wc.DEFAULTS={...dr.DEFAULTS,matchValue:(r,e,t)=>r.indexOf(e,t)===t},Xe.MaskedEnum=Wc;class CP extends cr{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Xe.MaskedFunction=CP;var TP;class $r extends cr{constructor(e){super({...$r.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",n=(this.scale?"("+nx(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(nx).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(nx(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[n,a]=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&&!n&&(a.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&a.aggregate(this._appendChar("-")),[n,a]}_separatorsCount(e,t){t===void 0&&(t=!1);let n=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){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,n))}_appendCharRaw(e,t){t===void 0&&(t={});const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const o=this.number;let s=!isNaN(o),l=!1;if(s){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace($r.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let u;s?u=new et({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,u=new et),this._value=this._insertThousandsSeparators(this._value);const c=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,f=this._separatorsCountFromSlice(c);return u.tailShift+=(f-a)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const a=this._findSeparatorAround(t);return a>=0&&(t=a+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 n=this.value.slice(0,e),a=this.value.slice(t),i=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+a));const o=this._separatorsCountFromSlice(n);return new et({tailShift:(o-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case Ve.NONE:case Ve.LEFT:case Ve.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const a=n+this.thousandsSeparator.length;if(e<a||this.value.length<=a||t===Ve.FORCE_LEFT)return n}break}case Ve.RIGHT:case Ve.FORCE_RIGHT:{const n=this._findSeparatorAround(e);if(n>=0)return n+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 n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(n,a,i,o)=>a+o),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,n){t===void 0&&(t={});const a=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===$r.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,$r.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($r.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)||$r.EMPTY_VALUES.includes(e)&&$r.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}TP=$r,$r.UNMASKED_RADIX=".",$r.EMPTY_VALUES=[...cr.EMPTY_VALUES,0],$r.DEFAULTS={...cr.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[TP.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:r=>r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Xe.MaskedNumber=$r;const qp={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function ox(r,e,t){e===void 0&&(e=qp.MASKED),t===void 0&&(t=qp.MASKED);const n=fa(r);return a=>n.runIsolated(i=>(i[e]=a,i[t]))}function DP(r,e,t,n){return ox(e,t,n)(r)}Xe.PIPE_TYPE=qp,Xe.createPipe=ox,Xe.pipe=DP;class AP extends dr{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,n,a;const{repeat:i,...o}=El(e);this._blockOpts=Object.assign({},this._blockOpts,o);const s=fa(this._blockOpts);this.repeat=(t=(n=i??s.repeat)!=null?n:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.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(fa(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const n=new et;for(let l=(a=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?a:Math.max(this._blocks.length-1,0),u,c;u=(o=this._blocks[l])!=null?o:c=!c&&this._allocateBlock(l);++l){var a,i,o,s;const f=u._appendChar(e,{...t,_beforeTailState:(s=t._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]});if(f.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(f),f.consumed)break}return n}_trimEmptyTail(e,t){var n,a;e===void 0&&(e=0);const i=Math.max(((n=this._mapPosToBlock(e))==null?void 0:n.index)||0,this.repeatFrom,0);let o;t!=null&&(o=(a=this._mapPosToBlock(t))==null?void 0:a.index),o==null&&(o=this._blocks.length-1);let s=0;for(let l=o;i<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(o-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const n=super.remove(e,t);return this._trimEmptyTail(e,t),n}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}}Xe.RepeatBlock=AP;try{globalThis.IMask=Xe}catch{}const sx=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:et,ChunksTailDetails:Mi,DIRECTION:Ve,HTMLContenteditableMaskElement:ax,HTMLInputMaskElement:SP,HTMLMaskElement:$c,InputMask:kP,MaskElement:Wp,Masked:cr,MaskedDate:pa,MaskedDynamic:Hc,MaskedEnum:Wc,MaskedFunction:CP,MaskedNumber:$r,MaskedPattern:dr,MaskedRange:Uc,MaskedRegExp:EP,PIPE_TYPE:qp,PatternFixedDefinition:ix,PatternInputDefinition:Gc,RepeatBlock:AP,createMask:fa,createPipe:ox,default:Xe,forceDirection:_P,normalizeOpts:El,pipe:DP},Symbol.toStringTag,{value:"Module"}));Dt.EditorRootPage=oae,Dt.ROUTES_NAMES=eR,Dt.Urls=QV,Dt.VsBar=A1,Dt.VsDashboard=BO,Dt.VsDonut=tR,Dt.VsLine=nR,Dt.VsListBar=oR,Dt.VsPie=rR,Dt.VsPivotTable=sR,Dt.VsProgressBar=iR,Dt.VsStat=aR,Dt.VsWidget=Tl,Object.defineProperty(Dt,Symbol.toStringTag,{value:"Module"})});
|