@opengis/widgets 0.0.48 → 0.0.49
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/index.js +1744 -1732
- package/dist/index.umd.cjs +15 -15
- package/dist/widgets/map/MapWidget.vue.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(ge,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(ge=typeof globalThis<"u"?globalThis:ge||self,e(ge.WidgetLib={},ge.Vue,ge.OpenGISCore))})(this,(function(ge,e,_e){"use strict";function mr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const hr=mr(e);/**
|
|
2
2
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const Nt=ce("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
52
52
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const An=ce("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
|
|
122
122
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const On=ce("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
132
132
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
@@ -138,24 +138,24 @@
|
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const On=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Mr={class:"border-t pt-3 mt-4"},Rr={class:"flex gap-2"},Pr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Fr={class:"flex-1 space-y-2"},zr={class:"flex justify-between items-center"},jr={class:"flex gap-2"},Hr=["disabled"],Po=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Mr,[e.createElementVNode("div",Rr,[e.createElementVNode("span",Pr,[e.createVNode(e.unref(An),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Fr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,s.value]]),e.createElementVNode("div",zr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",jr,[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(On),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[e.createVNode(e.unref(Ro),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Hr)])])])])]))}}),Ur={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},qr=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",Ur,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(Dr),{class:"h-3 w-3 mr-2"}),m[0]||(m[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(Dn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Wr={class:"space-y-2"},Kr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Gr={class:"flex-1 min-w-0 space-y-1 relative"},Zr={class:"flex items-center gap-2"},Jr={class:"font-medium text-xs"},Yr={class:"text-xs text-gray-500"},Xr={key:0,class:"text-xs text-gray-700 leading-relaxed"},Qr={class:"flex justify-between text-xs"},Vr={class:"flex items-center gap-2"},ei={key:0,class:"flex gap-2"},ti=["disabled"],ni={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},oi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),p=k=>{const w=new Date,F=Math.floor((w.getTime()-k.getTime())/(1e3*60*60));return F<1?`${Math.floor((w.getTime()-k.getTime())/6e4)}m`:F<24?`${F}h`:`${Math.floor(F/24)}d`},f=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},N=(k,w)=>{o("like",k,w)},g=(k,w)=>{o("edit",k,w)};return(k,w)=>{const F=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Wr,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",Kr,[e.createVNode(e.unref(An),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,e.toDisplayString(k.comment?.author),1),e.createElementVNode("span",Yr,e.toDisplayString(p(k.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":w[0]||(w[0]=T=>r.value=T),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",Xr,e.toDisplayString(k.comment?.text),1)),e.createElementVNode("div",Qr,[e.createElementVNode("div",Vr,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:w[1]||(w[1]=T=>f())},[e.createVNode(e.unref(Cr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(k.comment?.likes),1)],2),k.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:w[2]||(w[2]=T=>c.value=!0)},[e.createVNode(e.unref(Lr),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:w[3]||(w[3]=T=>a.value=!0)},[e.createVNode(e.unref(Nr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",ei,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:w[4]||(w[4]=T=>d.value=!1)},[e.createVNode(e.unref(On),{class:"h-3 w-3"}),w[11]||(w[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!r.value.trim(),onClick:w[5]||(w[5]=T=>b())},[e.createVNode(e.unref(Ro),{class:"h-3 w-3 mr-1"}),w[12]||(w[12]=e.createTextVNode(" Send ",-1))],8,ti)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(qr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":w[6]||(w[6]=T=>a.value=T),onEdit:w[7]||(w[7]=T=>d.value=!0),onDelete:w[8]||(w[8]=T=>k.$emit("delete",k.comment?.id)),comment:k.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),k.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.comment?.replies,T=>(e.openBlock(),e.createBlock(F,{key:T.id,comment:T,isInside:!0,onDelete:E=>k.$emit("delete",T.id),onLike:N,onEdit:g},null,8,["comment","onDelete"]))),128)),c.value&&!k.isInside?(e.openBlock(),e.createBlock(Po,{key:0,onSendComment:w[9]||(w[9]=T=>k.$emit("reply",k.comment?.id,T)),isReply:c.value,"onUpdate:isReply":w[10]||(w[10]=T=>c.value=T)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),si=["id"],ri={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},en=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const p=await fetch(`/api/widget/comment/${o.id}`).then(f=>f.json());r.value=p.rows.map(f=>({id:f.communication_id,author:f.username,text:f.body,createdAt:new Date(f.cdate)}))}r.value.length===0&&l();const i=async p=>{o.onAddComment?o.onAddComment(p):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:p})}),await l()),s("add",p)},a=(p,f)=>{o?.onLike?.(p,f),s("like",p,f)},c=(p,f)=>{o.onReply?.(p,f),s("reply",p,f)},d=async(p,f)=>{o.onEdit?o.onEdit(p,f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("edit",p,f)},m=async p=>{o.onDelete?o.onDelete(p):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"DELETE"}),await l()),s("delete",p)};return(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",p.className]),id:p.id,style:e.normalizeStyle(p.style)},[p.title?(e.openBlock(),e.createElementBlock("h3",ri,e.toDisplayString(p.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([p.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:p.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(oi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:f[0]||(f[0]=N=>m(N)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Po,{onSendComment:f[1]||(f[1]=b=>i(b))})],14,si))}}),Fo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:kt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ir}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Ar}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Sr}]]),ii={class:"mx-auto font-sans"},li={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},ai={class:"relative"},ci={class:"space-y-3"},di={class:"flex-1 min-w-0 pb-2"},pi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},fi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ui={class:"font-medium text-xs"},mi={class:"text-xs text-gray-500"},hi={class:"space-y-1"},gi={class:"text-xs text-gray-700"},yi={class:"capitalize mr-1"},vi={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},bi={key:0,class:"flex items-center gap-1 text-xs"},ki={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ei={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},tn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",ii,[r.title?(e.openBlock(),e.createElementBlock("h3",li,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:r.maxHeight+"px"})},[e.createElementVNode("div",ai,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ci,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Fo).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Fo).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",di,[e.createElementVNode("div",pi,[e.createElementVNode("span",fi,[e.createVNode(e.unref(An),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",ui,e.toDisplayString(i?.userName),1),e.createElementVNode("span",mi,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",hi,[e.createElementVNode("div",gi,[e.createElementVNode("span",yi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",vi,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",bi,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Er),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),wi={key:0,class:"text-xl font-semibold"},Ni={class:"flex gap-1"},xi={key:0},_i={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},Ci=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",s.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[s.title?(e.openBlock(),e.createElementBlock("h3",wi,e.toDisplayString(s.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ni,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(Tr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(_r),{class:"h-4 w-4"})],2),s.editable?(e.openBlock(),e.createElementBlock("label",xi,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,32),e.createElementVNode("div",_i,[e.createVNode(e.unref(Mo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Mn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:kt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:xr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Or,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:kt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:kr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Oo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Oo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:kt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:kt,label:"PPT"}};function zo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function jo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Si={class:"space-y-0.5"},Bi=["onClick"],Ti=["onClick"],$i={class:"flex items-center gap-2"},Li={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Ii={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Di={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ai={class:"flex items-center gap-1"},Oi=["onClick"],Mi=["onClick"],Ri=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,s=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(Mn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Mn)[s?.ext]?.icon||e.unref(Mn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",$i,[e.createElementVNode("span",Li,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Ti),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(jo)(s.size)),1),e.createElementVNode("div",Di,e.toDisplayString(e.unref(zo)(s.createdAt)),1),e.createElementVNode("div",Ai,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(Ao),{class:"h-3 w-3"})],8,Oi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Dn),{class:"h-3 w-3"})],8,Mi)])],8,Bi))),128))]))}}),Pi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Fi=["onClick"],zi={class:"space-y-2"},ji={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Hi=["src"],Ui={class:"space-y-1"},qi=["title"],Wi={class:"text-xs text-gray-500 text-left"},Ki={class:"absolute top-2 right-1 flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",zi,[e.createElementVNode("div",ji,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,Hi)):(e.openBlock(),e.createBlock(e.unref(kt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ui,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,qi),e.createElementVNode("p",Wi,e.toDisplayString(e.unref(zo)(s.createdAt))+", "+e.toDisplayString(e.unref(jo)(s.size)),1)])]),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(Ao),{class:"h-3 w-3"})],8,Gi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Dn),{class:"h-3 w-3"})],8,Zi)])],8,Fi))),128))]))}}),Yi={class:"mx-auto font-sans"},Xi={key:1},nn=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=n;a.value.length===0&&w();const d=(E,y)=>{r.value=y,s.value=!0},m=()=>{r.value&&(N(r.value),r.value=null,s.value=!1)},p=e.computed(()=>Array.isArray(a.value)?a.value.map(E=>E?.file_path):[]),f=E=>{const y=p.value.findIndex(O=>O===E.file_path);y!==-1&&(l.value=!0,i.value=y)},b=E=>{o.onAddFile?o.onAddFile(E):F(E),c("add",E)},N=E=>{o.onDelete?o.onDelete(E):T(E),c("delete",E)},g=E=>{const y=document.createElement("a");y.setAttribute("download",E?.uploaded_name||E?.name),y.href=E?.file_path||E?.path,y.click()},k=e.ref("list");async function w(){if(!o.id)return;const E=await fetch(`/api/widget/file/${o.id}`).then(y=>y.json());E.rows.forEach(y=>{y.timestamp=new Date(y.cdate),y.id=y.entity_id,y.entityType=y.entity_type,y.entityId=y.entity_id,y.entityType=y.entity_type,y.action=y.change_type,y.userId=y.change_user_id,y.userName=y.username,y.timestamp=new Date(y.cdate),y.description=y.username,y.status=y.username}),a.value=E.rows}const F=async E=>{if(!(!E.target||!E.target.files||E.target.files.length===0))try{await Promise.all(Array.from(E.target.files).map(async y=>{const O=new FormData;O.append("file",y);const q=`/api/widget/file/${o.id}`,L=await fetch(q,{method:"POST",body:O});if(!L.ok)throw new Error(`HTTP error! status: ${L.status}`);return y})),await w()}catch(y){console.error("Помилка при завантаженні файлів:",y)}},T=async E=>{try{await fetch(`/api/widget/file/${o.id}/${E}`,{method:"DELETE"}),await w()}catch(y){console.error(y)}};return(E,y)=>{const O=e.resolveComponent("MessageBox"),q=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Yi,[e.createVNode(Ci,{modelValue:k.value,"onUpdate:modelValue":y[0]||(y[0]=L=>k.value=L),title:o.title,onOnAddFile:y[1]||(y[1]=L=>b(L)),editable:o.editable},null,8,["modelValue","title","editable"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(E.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:E.maxHeight+"px"})},[k.value==="list"?(e.openBlock(),e.createBlock(Ri,{key:0,onDelete:d,onDownload:g,onOpenLightbox:y[2]||(y[2]=L=>f(L)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),k.value==="grid"?(e.openBlock(),e.createBlock(Ji,{key:1,onDelete:d,onDownload:g,onOpenLightbox:y[3]||(y[3]=L=>f(L)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",Xi,y[6]||(y[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(O,{modelValue:s.value,"onUpdate:modelValue":y[4]||(y[4]=L=>s.value=L),onConfirm:m,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(q,{modelValue:l.value,"onUpdate:modelValue":y[5]||(y[5]=L=>l.value=L),images:p.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),Qi={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Vi=["onClick"],el={key:0,rel:"noreferrer",class:"relative block h-full w-full"},tl=["src"],nl={key:0,class:"thumb-cover"},ol=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return c.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.items,(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+f,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:f,onClick:e.withModifiers(b=>a(p),["stop"])},[f<5?(e.openBlock(),e.createElementBlock("div",el,[e.createElementVNode("img",{src:`/file/resize?filepath=${p?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",f===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,tl),f===4&&c.items?.length>5?(e.openBlock(),e.createElementBlock("div",nl," +"+e.toDisplayString(c.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Vi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-c.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(c.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=p=>o("delete",p))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),sl={key:0,class:"text-xl font-semibold"},rl={class:"flex gap-1"},il={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},ll=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",n.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[n.title?(e.openBlock(),e.createElementBlock("h3",sl,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",rl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s))},null,32),e.createElementVNode("div",il,[e.createVNode(e.unref(Mo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),al={class:"w-full mx-auto font-sans",ref:"containerRef"},cl={key:1},on=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(o.items??[]),r=n;s.value.length===0&&c();const l=m=>{o.onAddImage?o.onAddImage(m):a(m),r("add",m)},i=m=>{const p=s.value.find(f=>f.file_path===m)?.file_id;p&&(o.onDelete?o.onDelete(p):d(p))},a=async m=>{if(!(!m.target||!m.target.files||m.target.files.length===0))try{await Promise.all(Array.from(m.target.files).map(async p=>{const f=new FormData;f.append("file",p);const b=`/api/widget/file/${o.id}`,N=await fetch(b,{method:"POST",body:f});if(!N.ok)throw new Error(`HTTP error! status: ${N.status}`);return p})),await c()}catch(p){console.error("Помилка при завантаженні файлів:",p)}};async function c(){if(!o.id)return;const m=await fetch(`/api/widget/file/${o.id}`).then(p=>p.json());s.value=m.rows}const d=async m=>{try{await fetch(`/api/widget/file/${o.id}/${m}`,{method:"DELETE"}),await c()}catch(p){console.error(p)}};return(m,p)=>(e.openBlock(),e.createElementBlock("div",al,[e.createVNode(ll,{title:m.title,onOnAddImage:p[0]||(p[0]=f=>l(f))},null,8,["title"]),s.value.length>0?(e.openBlock(),e.createBlock(ol,{key:0,items:s.value,onDelete:p[1]||(p[1]=f=>i(f))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",cl,p[2]||(p[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),dl={class:"text-value"},pl={class:"text-sm text-gray-900"},fl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",dl,[e.createElementVNode("span",pl,e.toDisplayString(o.value),1)]))}}),tt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},ul=tt(fl,[["__scopeId","data-v-34a76c89"]]),ml={class:"link-value"},hl=["href"],gl=tt(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",ml,[e.createElementVNode("a",{href:String(s.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,hl)]))}}),[["__scopeId","data-v-932f028c"]]),yl={class:"date-value"},vl={class:"text-sm text-gray-900"},bl=tt(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",yl,[e.createElementVNode("span",vl,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),kl={class:"status-value"},El={key:0,class:"mr-1"},wl=tt(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",kl,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",El,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(r.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Nl={class:"custom-value"},xl={class:"text-sm text-gray-900"},_l=tt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Nl,[e.renderSlot(n.$slots,"default",{item:n.item,value:n.item.value},()=>[e.createElementVNode("span",xl,e.toDisplayString(String(n.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Cl=["id"],Sl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Bl={key:1,class:"overflow-x-auto"},Tl={class:"min-w-full divide-y divide-gray-200"},$l={class:"bg-white divide-y divide-gray-200"},Ll={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Il={class:"flex items-center gap-2"},Dl=["title"],Al={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Ol={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Ml={class:"flex items-start gap-3"},Rl={key:0,class:"flex-shrink-0"},Pl={class:"flex-1 min-w-0"},Fl={class:"flex items-center gap-2 mb-2"},zl={class:"text-sm font-medium text-gray-900"},jl=["title"],Hl={key:3,class:"overflow-x-auto"},Ul={class:"min-w-full divide-y divide-gray-200"},ql={class:"bg-white divide-y divide-gray-200"},Wl={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Kl={class:"flex items-center gap-2"},Gl=["title"],Zl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Rn=tt(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return gl;case"date":return bl;case"status":return wl;case"custom":return _l;default:return ul}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",o.className]),id:o.id,style:e.normalizeStyle(o.style)},[o.title?(e.openBlock(),e.createElementBlock("h3",Sl,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),o.view==="table"?(e.openBlock(),e.createElementBlock("div",Bl,[e.createElementVNode("table",Tl,[e.createElementVNode("tbody",$l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Ll,[e.createElementVNode("div",Il,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Dl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Al,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):o.view==="grid"?(e.openBlock(),e.createElementBlock("div",Ol,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Ml,[r.icon?(e.openBlock(),e.createElementBlock("div",Rl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Pl,[e.createElementVNode("div",Fl,[e.createElementVNode("h4",zl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,jl)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Hl,[e.createElementVNode("table",Ul,[e.createElementVNode("tbody",ql,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Wl,[e.createElementVNode("div",Kl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Gl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Zl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Cl))}}),[["__scopeId","data-v-106790ef"]]);function Ho(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function Jl(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const Yl="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Pn=null;function Xl(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function Ql(){return Pn||(Pn=Ho(Yl).then(()=>{const t=Xl();if(!t)throw new Error("IMask is not available after loading the script");return t})),Pn}function Vl(){return typeof window>"u"?"":window.location?.origin??""}function Uo(){if(!(typeof window>"u"))return window.maplibregl}const qo=Symbol("vs-widget-map");function Fn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ea(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ta(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function zn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=Vl(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function na(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function oa(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function sn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Wo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function sa(t){const n=t?.color??Wo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Wo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const Mt="map-highlight-source",ra="map-highlight-fill",ia="map-highlight-line";function la(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Ko(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function aa(){return Jl("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Ho("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Uo()}function rn(t){const n=e.inject(qo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,p=null;const f=h=>{h&&(o.value?o.value.setStyle(h):m=h)},b=()=>{r.value.overlays=i.value.map(h=>({id:h.id,name:h.config.name,visible:h.visible}))},N=h=>{const $=Array.isArray(h)?h:[];l.value=$,$.some(j=>j.key===r.value.selectedBasemap)||(r.value.selectedBasemap=$[0]?.key??"")},g=h=>{h&&i.value.forEach($=>{$.layerIds.forEach(A=>{h.getLayer(A)&&h.removeLayer(A)}),h.getSource($.sourceId)&&h.removeSource($.sourceId),$.layerIds=[]})},k=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||(i.value.forEach($=>{w(h,$)}),G())},w=(h,$)=>{const A=na($.config);A==="vtile"?T(h,$):A==="raster"&&F(h,$)},F=(h,$)=>{const A=$.config,j=$.sourceId,Y=zn(A.url);if(!Y)return;h.getSource(j)||h.addSource(j,{type:"raster",tiles:[Y],minzoom:A.minzoom??0,maxzoom:A.maxzoom??24});const Z=`${$.id}-raster`;h.getLayer(Z)||h.addLayer({id:Z,type:"raster",source:j,layout:{visibility:$.visible?"visible":"none"}}),$.layerIds=[Z],E(h,$)},T=(h,$)=>{const A=$.config,j=$.sourceId,Y=zn(A.url);if(!Y)return;h.getSource(j)||h.addSource(j,{type:"vector",tiles:[Y],minzoom:A.minzoom??0,maxzoom:A.maxzoom??24});const Z=A.style??{},ge=sa(Z),Be=[],ke={visibility:$.visible?"visible":"none"},Ye=oa(A),qe={source:j,layout:ke};if(Ye&&(qe["source-layer"]=Ye),(Z.type??"polygon").toLowerCase()==="point"){const We=`${$.id}-circle`;h.getLayer(We)||h.addLayer({id:We,type:"circle",...qe,paint:{"circle-color":ge,"circle-opacity":Z.opacity??1,"circle-radius":Z.radius??Z.width??3,"circle-stroke-color":Z.stroke??Z.color??"#ffffff","circle-stroke-width":Z.width??1}}),Be.push(We);const Oe=Z.text??Z.label;if(Oe){const Xe=`${$.id}-symbol`,yt=sn(Z.textSize)??10,It=Z.textHaloColor??Z.stroke??"#ffffff",Dt=sn(Z.textHaloWidth)??1,Qe=sn(Z.textZoom??Z.pointZoom),Ke={"text-color":Z.textColor??"#000000","text-halo-color":It,"text-halo-width":Dt},ct={id:Xe,type:"symbol",...qe,layout:{"text-field":["coalesce",["get",Oe],""],"text-size":yt,"text-anchor":"top"},paint:Ke};Qe!=null&&(ct.minzoom=Qe),h.getLayer(Xe)||h.addLayer(ct),Be.push(Xe)}}else{const We=`${$.id}-fill`;h.getLayer(We)||h.addLayer({id:We,type:"fill",...qe,paint:{"fill-color":ge,"fill-opacity":Z.opacity??.5,"fill-outline-color":Z.stroke??Z.color??"#0ea5e9"}}),Be.push(We);const Oe=`${$.id}-line`;h.getLayer(Oe)||h.addLayer({id:Oe,type:"line",...qe,paint:{"line-color":Z.stroke??Z.color??"#0b74c4","line-width":sn(Z.width??Z.border)??1,"line-opacity":Z.opacity??1}}),Be.push(Oe)}$.layerIds=Be,E(h,$)},E=(h,$)=>{const A=$.visible?"visible":"none";$.layerIds.forEach(j=>{h.getLayer(j)&&h.setLayoutProperty(j,"visibility",A)})},y=h=>{const $=Array.isArray(h)?h:[];g(o.value??void 0),d.value=null,x();const A=$.map((j,Y)=>{if(!j)return null;const Z=zn(j.url);if(!Z)return null;const ge=j.id!=null?String(j.id):`overlay-${Y}`;return{id:ge,config:{...j,id:ge,url:Z},visible:!1,sourceId:`${ge}-source`,layerIds:[]}}).filter(j=>!!j);i.value=A,b(),k()},O=(h,$)=>{const A=i.value.find(Y=>Y.id===h);if(!A)return;A.visible=$,b();const j=o.value;if(!(!j||typeof j.isStyleLoaded!="function"||!j.isStyleLoaded())){if(!A.layerIds.length){w(j,A);return}E(j,A)}},q=()=>{a.value&&(a.value.remove(),a.value=null)},L=(h,$={})=>!Array.isArray(h.popup)||!h.popup.length?[]:h.popup.map(A=>({label:A.label??A.field,value:Fn($?.[A.field])})).filter(A=>A.label&&A.value!==void 0),M=h=>{const $=o.value;if(!$||!h?.point)return;const A=$.queryRenderedFeatures(h.point);for(const j of A){const Y=j.layer?.id??j.sourceLayer;if(!Y)continue;const Z=oe(Y);if(!Z)continue;const ge=L(Z,j.properties??j.layer?.properties??{});if(!ge.length)continue;const Be=ea(ge),ke=Uo();if(!ke)return;const Ye=h.lngLat;if(c.value===Y&&a.value){a.value.setLngLat(Ye),a.value.setHTML(Be);return}c.value=Y,q(),a.value=new ke.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(Ye).setHTML(Be).addTo($);return}c.value=null,q()},W=()=>{c.value=null,q()},G=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||h.getSource(Mt)||(h.addSource(Mt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),h.addLayer({id:ra,type:"fill",source:Mt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),h.addLayer({id:ia,type:"line",source:Mt,paint:{"line-color":"#1d4ed8","line-width":2}}))},J=h=>{const $=o.value;if(!$||typeof $.isStyleLoaded!="function"||!$.isStyleLoaded())return;G();const A=$.getSource(Mt);if(!(!A||typeof A.setData!="function")){if(!h){A.setData({type:"FeatureCollection",features:[]});return}A.setData({type:"FeatureCollection",features:[h]})}},K=h=>{const $=la(h);$&&J($)},x=()=>{J(null)},I=()=>{d.value=null,x()},_=h=>{if(h)return typeof h=="string"?h:h.field??h.name??h.key??h.label},P=h=>{if(h)return typeof h=="string"?h:h.label??h.title??h.field??h.name},le=(h,$)=>!h||!h.length?[]:h.map(A=>{const j=_(A);if(!j)return null;const Y=P(A),Z=Fn($?.[j]);return!Y||Z===""?null:{label:Y,value:Z}}).filter(A=>!!A),Ae=(h,$)=>!Array.isArray(h)||!h.length?[]:h.map(A=>{if(!A?.name)return null;const j=A.title??A.name,Y=Fn($?.[A.name]);return!j||Y===""?null:{label:j,value:Y}}).filter(A=>!!A),Te=(h,$)=>!Array.isArray(h)||!h.length?[]:h.map(j=>{const Y=Ko(j.url,$),Z=j.label??j.url;return Y?{label:Z,url:Y,target:j.target}:null}).filter(j=>!!j),ue=async(h,$)=>{const A=Ko(h,$);if(!A)return null;try{const j=await fetch(A);return j.ok?await j.json():null}catch{return null}},be=async(h,$)=>{const A=$.properties??$.layer?.properties??{},j=le(h.card?.rows,A);let Y,Z;if(h.card?.api){const ke=await ue(h.card.api,A);ke&&(typeof ke.html=="string"&&ke.html.trim()&&(Y=ke.html),Array.isArray(ke.columns)&&ke.columns.length&&(Z=ke.columns))}let ge=j;if(!Y&&Z){const ke=Ae(Z,A);ke.length&&(ge=ke)}if(!ge.length&&!Y)return null;const Be=Te(h.card?.actions,A);return{title:A?.name??h.name,rows:ge,html:Y,actions:Be.length?Be:void 0}},z=async h=>{const $=o.value;if(!$||!h?.point)return;const A=$.queryRenderedFeatures(h.point);for(const j of A){const Y=j.layer?.id??j.sourceLayer;if(!Y)continue;const Z=oe(Y);if(!Z||!Z.card)continue;const ge=await be(Z,j);if(ge){d.value=ge,K(j);return}}d.value=null,x()},U=()=>{const h=o.value;h&&(h.on("mousemove",M),h.on("mouseleave",W),h.on("click",z))},H=()=>{const h=o.value;h&&(h.off("mousemove",M),h.off("mouseleave",W),h.off("click",z),q(),x())},oe=h=>{if(h)return i.value.find($=>$.layerIds.includes(h))?.config},ae=async()=>{const h=await aa(),$=ta(t.container);if(!h||!$)return;const A={container:$,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new h.Map(A);const j=()=>{k()};p=j,o.value.on("style.load",j),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),k(),U()})};e.onMounted(ae),e.onBeforeUnmount(()=>{H(),o.value&&p&&o.value.off("style.load",p),g(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const me={map:o,ready:s,setStyle:f,flyTo:h=>o.value?.flyTo(h),fitBounds:(h,$)=>o.value?.fitBounds(h,$),setCenter:h=>o.value?.setCenter(h),setZoom:h=>o.value?.setZoom(h),addControl:(h,$)=>o.value?.addControl(h,$),removeControl:h=>o.value?.removeControl(h),on:(h,...$)=>o.value?.on(h,...$),off:(h,...$)=>o.value?.off(h,...$),project:h=>o.value?.project(h),unproject:h=>o.value?.unproject(h),state:r,basemapOptions:l,setOverlays:y,toggleOverlay:O,getOverlayConfig:oe,selectedCard:d,setBasemapOptions:N,clearCard:I};return e.provide(qo,me),me}const ca={class:"map-base-layer-menu"},da={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},pa={class:"flex items-center justify-between p-2 border-b"},fa={class:"p-2 border-b"},ua={class:"flex items-center"},ma=["value","checked","onChange"],ha={class:"ml-2"},ga={class:"p-2"},ya={class:"flex items-center"},va=["checked"],ba=["checked","onChange"],ka={class:"ml-2"},Ea=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=rn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),p=e.computed(()=>n.value.overlays??[]),f=g=>{s?.(g)},b=()=>{r?.(!m.value)},N=g=>{l?.(g.id,!g.visible)};return(g,k)=>(e.openBlock(),e.createElementBlock("div",ca,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:k[0]||(k[0]=w=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("div",pa,[k[3]||(k[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:k[1]||(k[1]=w=>i.value=!1)},k[2]||(k[2]=[e.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-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)]))]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.key},[e.createElementVNode("label",ua,[e.createElementVNode("input",{type:"radio",name:a,value:w.key,checked:d.value===w.key,onChange:F=>f(w.key)},null,40,ma),e.createElementVNode("span",ha,e.toDisplayString(w.name||w.key),1)])]))),128))]),e.createElementVNode("div",ga,[e.createElementVNode("label",ya,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,va),k[4]||(k[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,w=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:w.id},[e.createElementVNode("input",{type:"checkbox",checked:w.visible,onChange:F=>N(w)},null,40,ba),e.createElementVNode("span",ka,e.toDisplayString(w.name||w.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),wa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Na={class:"leading-tight"},xa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>n.items.length?(e.openBlock(),e.createElementBlock("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Na,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),_a={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Ca={class:"font-mono"},Sa=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",_a,[e.createElementVNode("span",Ca,e.toDisplayString(n.coordinates),1)]))}}),Ba={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ta=["title"],$a={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},La=["onClick"],Ia=["placeholder"],Da={class:"divide-y divide-gray-100"},Aa=["onClick"],Oa=600,Ma="0000000000:00:000:0000",Ra=30,Pa=8,Fa="https://data.softpro.ua/api-user/gis-url-proxy",za="https://geo.rv.ua/api-user/dzk.api",ja="https://nominatim.openstreetmap.org/search",Ha=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=rn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const z=n.config?.tools?.filter(U=>i.includes(U));return z&&z.length?z:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,z=>{z.includes(d.value)||(d.value=z[0])});const m=e.ref(""),p=e.ref(!1),f=e.ref(null),b=e.ref(null),N=e.ref(null),g=e.ref([]),k=e.ref(null),w=e.computed(()=>d.value==="address"&&g.value.length>0);let F=null,T=null;const E=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function y(){if(!b.value)return;const z=b.value.getBoundingClientRect(),U=z.width+Ra,H=z.left+window.scrollX,oe=z.bottom+window.scrollY+Pa;E.left=`${H}px`,E.top=`${oe}px`,E.width=`${U}px`,E.display="block"}const O=()=>{w.value&&y()};function q(){F&&(clearTimeout(F),F=null)}function L(){T?.destroy(),T=null}async function M(){if(d.value!=="parcel")return;const z=N.value;if(!z)return;const U=await Ql();d.value==="parcel"&&(L(),T=U(z,{mask:Ma,lazy:!1,placeholderChar:"_"}),T.on("accept",()=>{m.value=T?.value??""}))}function W(){return(T?.value??m.value).trim()}e.watch(d,z=>{m.value="",p.value=!1,g.value=[],q(),z==="parcel"?e.nextTick(()=>{M().catch(U=>{_e.notify({type:"error",title:"Маска кадастру",message:U?.message||"Не вдалося ініціалізувати маску"})})}):L()}),e.watch(w,z=>{z?e.nextTick(()=>{y()}):E.display="none"}),e.watch(m,z=>{if(d.value!=="address"){g.value=[],q();return}if(!z.trim()){g.value=[],q();return}q(),F=window.setTimeout(()=>{le(z).catch(U=>{const H=U?.message||"Помилка пошуку адреси";_e.notify({type:"error",title:"Пошук адреси",message:H})})},Oa)});function G(z){d.value=z}function J(z){const U=z.target;if(p.value){const H=f.value;H&&!H.contains(U)&&(p.value=!1)}if(w.value){const H=k.value;H&&!H.contains(U)&&(g.value=[])}}e.onMounted(()=>{window.addEventListener("click",J,!0),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),d.value==="parcel"&&e.nextTick(()=>{M().catch(z=>{_e.notify({type:"error",title:"Маска кадастру",message:z?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",J,!0),window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),q(),L()});function K(z){return z==="xy"?"Координати":z==="parcel"?"Кадастр":"Адреси"}function x(z){const U=z.replace(/[,]+/g," ").trim();if(!U)return null;const H=U.split(/\s+/).filter(Boolean);if(H.length<2)return null;const oe=H.slice(0,2).map(Number);if(!oe.every(Y=>Number.isFinite(Y)))return null;let[ae,me]=oe,h=ae,$=me;const A=Y=>Math.abs(Y)<=90,j=Y=>Math.abs(Y)<=180;if(!A(h)||!j($))if(A($)&&j(h))h=me,$=ae;else return null;return{lat:h,lng:$}}function I(z){return(z?.items||[]).map((H,oe)=>{const ae=Number(H?.position?.lat),me=Number(H?.position?.lng);return!Number.isFinite(ae)||!Number.isFinite(me)?null:{id:String(H?.id??oe),title:H?.title||H?.address?.label||"Знайдений обʼєкт",lat:ae,lng:me}}).filter(H=>!!H)}function _(z){const U=z?.result||z?.data||z;if(!U)return[];const H=U.geom_centroid;if(!H||!Array.isArray(H.coordinates))return[];const[oe,ae]=H.coordinates;return!Number.isFinite(ae)||!Number.isFinite(oe)?[]:[{id:"parcel",title:U.cadnum||U.cad_num||"Земельна ділянка",lat:ae,lng:oe}]}function P(z){return(Array.isArray(z?.features)?z.features:[]).map((H,oe)=>{const ae=H?.geometry?.coordinates,me=Number(ae?.[0]),h=Number(ae?.[1]);if(!Number.isFinite(h)||!Number.isFinite(me))return null;const $=H?.properties||{},A=$?.geocoding?.label||$?.display_name||$?.label||"Адреса";return{id:String($?.geocoding?.place_id||$?.place_id||oe),title:A,lat:h,lng:me}}).filter(H=>!!H)}async function le(z){g.value=[],q();const U=new URL(ja);U.searchParams.set("format","geojson"),U.searchParams.set("q",z),U.searchParams.set("addressdetails","1"),U.searchParams.set("bounded","1");const H=r();H&&U.searchParams.set("viewbox",H);const oe=await fetch(U.toString());if(!oe.ok)throw new Error(`HTTP ${oe.status}`);const ae=await oe.json(),me=P(ae);if(!me.length){_e.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}g.value=me}function Ae(z){ue(z),g.value=[],m.value=""}function Te(z){const H=z.replace(/\s+/g,"").split(":");if(H.length!==4)return!1;const oe=[10,2,3,4];return H.every((ae,me)=>ae.length===oe[me]&&/^\d+$/.test(ae))}function ue(z){const U=n.config?.zoom??17;o.flyTo?.({center:[z.lng,z.lat],zoom:U})}async function be(){const z=d.value==="parcel"?W():m.value.trim();if(z){if(d.value==="xy"){const U=x(z);if(!U){_e.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}ue(U),m.value="";return}if(d.value==="address"){try{await le(z)}catch(U){const H=U?.message||"Помилка пошуку адреси";_e.notify({type:"error",title:"Пошук адреси",message:H})}return}try{const U=new URL(d.value==="here"?Fa:za);if(d.value==="here")U.searchParams.set("searchtext",z);else{if(!Te(z)){_e.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}U.searchParams.set("cad_num",z)}const H=await fetch(U.toString());if(!H.ok)throw new Error(`HTTP ${H.status}`);const oe=await H.json(),ae=d.value==="here"?I(oe):_(oe);if(!ae.length)_e.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const me=ae[0];ue(me),d.value==="parcel"&&T&&(T.value=""),m.value=""}}catch(U){const H=U?.message||"Помилка пошуку";_e.notify({type:"error",title:"Пошук",message:H})}}}return(z,U)=>(e.openBlock(),e.createElementBlock("div",Ba,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(be,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:f,class:"relative search-type w-[100px]"},[e.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:U[0]||(U[0]=H=>p.value=!p.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:K(d.value)},e.toDisplayString(K(d.value)),9,Ta),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":p.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U[3]||(U[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),p.value?(e.openBlock(),e.createElementBlock("div",$a,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:oe=>G(H)},e.toDisplayString(K(H)),9,La))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:N,"onUpdate:modelValue":U[1]||(U[1]=H=>m.value=H),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] 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,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":U[2]||(U[2]=H=>m.value=H),placeholder:c.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,Ia)),[[e.vModelText,m.value,void 0,{trim:!0}]]),U[4]||(U[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.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"},[e.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)),w.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:k,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(E)},[e.createElementVNode("ul",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:oe=>Ae(H)},e.toDisplayString(H.title),9,Aa))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),Ua={class:"map-center-control"},qa=["aria-label"],Wa=e.defineComponent({directives:{tooltip:_e.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=rn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(N){if(Array.isArray(N)&&N.length>=2){const[g,k]=N.slice(0,2).map(w=>Number(w));return Number.isNaN(g)||Number.isNaN(k)?null:[g,k]}if(N&&typeof N=="object"){const g=N,k=g.lng??g.lon??g.long??g.x,w=g.lat??g.y;if(k!=null&&w!=null){const F=Number(k),T=Number(w);if(!Number.isNaN(F)&&!Number.isNaN(T))return[F,T]}}if(typeof N=="string"){const g=N.split(",").map(k=>Number(k.trim()));if(g.length>=2&&g.every(k=>!Number.isNaN(k)))return[g[0],g[1]]}return null}e.watch(()=>n.center,N=>{const g=c(N);g&&(r.value=g)},{immediate:!0}),e.watch(()=>n.zoom,N=>{const g=Number(N);Number.isNaN(g)||(l.value=g)},{immediate:!0}),e.watch(()=>n.targetCenter,N=>{i.value=c(N)},{immediate:!0}),e.watch(()=>n.targetZoom,N=>{const g=Number(N);a.value=Number.isNaN(g)?null:g},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!i.value);e.onMounted(async()=>{const N=o.value;if(N){if(!r.value){const g=N.getCenter();r.value=[g.lng,g.lat]}l.value==null&&(l.value=N.getZoom())}});function f(){const N=o.value;if(!N)return;const g=r.value||(()=>{const w=N.getCenter();return[w.lng,w.lat]})(),k=l.value??N.getZoom();N.flyTo({center:g,zoom:k})}function b(){const N=o.value;if(!N||!i.value)return;const g=a.value??l.value??N.getZoom();N.flyTo({center:i.value,zoom:g})}return(N,g)=>{const k=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",Ua,[p.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(f,["stop"])},[e.createVNode(e.unref(Br),{class:"w-4 h-4"})])),[[k,"Центр мапи"]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref($r),{class:"w-4 h-4"})],8,qa)),[[k,d.value]]):e.createCommentVNode("",!0)])}}}),Go=tt(Wa,[["__scopeId","data-v-bc627616"]]),Ka={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},Ga={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Za=["aria-label"],Ja={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},Ya={class:"text-slate-900 font-semibold mb-1"},Xa=["innerHTML"],Qa={key:1,class:"space-y-2"},Va={class:"text-gray-500"},ec={class:"font-medium text-slate-900"},tc={key:2,class:"mt-2 flex flex-col gap-2"},nc=["href","target"],ln="map-basemap-source",jn="map-basemap-layer",oc=20,Et="map-katottg-geometry-source",an="map-katottg-geometry-line",nt="map-geometry-source",wt="map-geometry-fill",Nt="map-geometry-line",xt="map-geometry-circle",cn=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{},i=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),a=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((R,ee)=>{const Fe=typeof R.url=="string"?R.url.trim():"";return Fe?{key:(R.key??R.name??`base-${ee}`).trim()||`base-${ee}`,url:Fe,name:R.name??R.key??`Layer ${ee+1}`}:null}).filter(R=>!!R)),c=Array.isArray(l.center)&&l.center.length>=2?[Number(l.center[0]),Number(l.center[1])]:void 0,d=typeof l.zoom=="number"?l.zoom:void 0,m=e.ref(null),p=rn({container:m,center:n.center??c,zoom:n.zoom??d}),{map:f,setCenter:b,setZoom:N,state:g,getOverlayConfig:k,selectedCard:w,setBasemapOptions:F,clearCard:T,addControl:E,removeControl:y,ready:O}=p,q=e.computed({get:()=>g.value.selectedBasemap??"",set:u=>{g.value.selectedBasemap=u}}),L=e.computed({get:()=>g.value.geometryVisible??!0,set:u=>{g.value.geometryVisible=u}}),M=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),W=e.ref(!1),G=e.computed(()=>W.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),J=e.computed(()=>{const u=["w-full","h-full"];return W.value||u.push(`min-h-[${M.value.height}]`),u.join(" ")}),K=e.computed(()=>w.value),x=()=>T?.(),I=e.ref(n.center??c??null),_=e.ref(n.zoom??d??null),P=e.computed(()=>n.center??I.value??null),le=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof _.value=="number"?_.value:oc),Ae=["home","fullscreen","scale","position","search"],Te=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?Ae:n.tools.filter(u=>Ae.includes(u))),ue=u=>Te.value.includes(u);e.watch([f,O],([u,D])=>{if(!(!u||!D)){if(!I.value){const R=u.getCenter();I.value=[R.lng,R.lat]}_.value==null&&(_.value=u.getZoom())}},{immediate:!0});const be=e.ref(null),z=e.ref(""),U=e.ref(null),H=u=>{if(!u)return"";const D=Number(u.lat??u[1]),R=Number(u.lng??u[0]);return!Number.isFinite(D)||!Number.isFinite(R)?"":`${R.toFixed(5)}, ${D.toFixed(5)}`},oe=u=>{u?.lngLat&&(z.value=H(u.lngLat))},ae=()=>{z.value=""},me=u=>{u&&(u.on("mousemove",oe),u.on("mouseleave",ae),U.value=u)},h=u=>{u&&(u.off("mousemove",oe),u.off("mouseleave",ae),U.value=null)},$=e.computed(()=>ue("scale"));e.watch([f,O],([u,D],[R])=>{R&&h(R),!(!u||!D)&&me(u)},{immediate:!0}),e.watch([f,O,$],([u,D,R])=>{if(be.value&&y&&(y(be.value),be.value=null),!u||!D||!R)return;const ee=window?.maplibregl;ee&&(be.value=new ee.ScaleControl({unit:"metric"}),E?.(be.value,"bottom-left"))},{immediate:!0});const A=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,D)=>{const R=typeof u?.color=="string"?u.color.trim():"",ee=typeof u?.label=="string"?u.label.trim():"";return!R||!ee?null:{color:R,label:ee,key:`${ee}-${D}`}}).filter(u=>!!u):[]),j=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(a,u=>{if(F?.(u),!u.length){q.value="";return}u.some(D=>D.key===q.value)||(q.value=u[0].key)},{immediate:!0});const Y=()=>typeof window>"u"?"":window.location?.origin??"",Z=u=>{if(!u)return"";const D=u.trim();if(!D)return"";const ee=D.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!ee)return"";if(/^https?:\/\//i.test(ee))return ee;const Fe=Y(),vt=ee.replace(/^\/+/,"");return Fe?`${Fe}/${vt}`:vt?`/${vt}`:""},ge=u=>{if(!u?.getStyle)return;const D=u.getStyle()??{},R=Array.isArray(D.layers)?D.layers:[];return R.length?R.find(Fe=>Fe.type!=="background")?.id??R[0]?.id:void 0},Be=u=>{u&&(u.getLayer(jn)&&u.removeLayer(jn),u.getSource(ln)&&u.removeSource(ln))},ke=(u,D)=>{if(!u)return;const R=ge(u);u.addSource(ln,{type:"raster",tiles:[D],tileSize:256}),u.addLayer({id:jn,type:"raster",source:ln,layout:{visibility:"visible"}},R)},Ye=u=>{if(!u)return;const D=Z(u.url);if(!D){qe.value=null;return}qe.value=D,Be(f.value),Yt()},qe=e.ref(null),Yt=()=>{const u=f.value,D=qe.value;!D||!u||typeof u.isStyleLoaded=="function"&&!u.isStyleLoaded()||(Be(u),ke(u,D))},We=()=>{const u=q.value;if(!u)return;const D=a.value.find(R=>R.key===u);D&&Ye(D)};e.watch(q,()=>{We()},{immediate:!0}),e.watch(j,u=>{p.setOverlays?.(u)},{immediate:!0,deep:!0});const Oe=e.ref(null);let Xe=0;const yt=e.computed(()=>Io(Oe.value)),It={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},Dt={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Qe=e.ref(Io(n.geom)),Ke=e.ref(fr(Qe.value)),ct=e.ref(!1),Xt=e.computed(()=>{if(!Ke.value)return null;const[u,D,R,ee]=Ke.value;return[(u+R)/2,(D+ee)/2]});e.ref(!1);const v=()=>{W.value=!W.value},B=e.ref(!1),C=()=>{const u=f.value;if(!u||!u.isStyleLoaded())return;const D=Qe.value;if(!D){V(u);return}let R=u.getSource(nt);R?R.setData(D):(u.addSource(nt,{type:"geojson",data:D}),S(u),R=u.getSource(nt)),X(u,L.value?"visible":"none"),se(),Ge(),Ke.value&&(ct.value||!B.value)&&(u.fitBounds(Ke.value,{padding:40,maxZoom:16,duration:0}),B.value=!0,ct.value=!1)},S=u=>{const D=It;u.getLayer(wt)||u.addLayer({id:wt,type:"fill",source:nt,paint:D.fill}),u.getLayer(Nt)||u.addLayer({id:Nt,type:"line",source:nt,paint:D.line}),u.getLayer(xt)||u.addLayer({id:xt,type:"circle",source:nt,paint:D.circle,filter:["==","$type","Point"]})},V=u=>{[xt,Nt,wt].forEach(D=>{u.getLayer(D)&&u.removeLayer(D)}),u.getSource(nt)&&u.removeSource(nt)},X=(u,D)=>{[xt,Nt,wt].forEach(R=>{u.getLayer(R)&&u.setLayoutProperty(R,"visibility",D)})},se=()=>{const u=f.value;if(!u||!u.isStyleLoaded())return;const D=It;u.getLayer(wt)&&Object.entries(D.fill).forEach(([R,ee])=>{u.setPaintProperty(wt,R,ee)}),u.getLayer(Nt)&&Object.entries(D.line).forEach(([R,ee])=>{u.setPaintProperty(Nt,R,ee)}),u.getLayer(xt)&&Object.entries(D.circle).forEach(([R,ee])=>{u.setPaintProperty(xt,R,ee)})},we=u=>{u.getLayer(an)||u.addLayer({id:an,type:"line",source:Et,layout:{visibility:"visible"},paint:Dt})},Ge=()=>{const u=f.value;if(!u)return;const D=yt.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Et)){u.addSource(Et,{type:"geojson",data:D}),we(u);return}const R=u.getSource(Et);R&&typeof R.setData=="function"&&R.setData(D),we(u)},je=u=>{u.getLayer(an)&&u.removeLayer(an),u.getSource(Et)&&u.removeSource(Et)},At=async u=>{const D=typeof u=="string"?u.trim():"",R=++Xe;if(!D){Oe.value=null;return}try{const ee=await fetch(`https://data.gki.com.ua/api-user/atu/${D}`);if(Xe!==R)return;if(!ee.ok){Oe.value=null;return}const Fe=await ee.json();if(Xe!==R)return;Oe.value=Fe}catch{if(Xe!==R)return;Oe.value=null}};e.watch(i,u=>{At(u)},{immediate:!0}),e.watch(yt,()=>{Ge()},{immediate:!0}),e.watch(()=>n.geom,u=>{Qe.value=Io(u),Ke.value=fr(Qe.value),B.value=!1,ct.value=!0,C()},{deep:!0,immediate:!0}),e.watch(L,()=>{const u=f.value;u&&u.isStyleLoaded()&&X(u,L.value?"visible":"none")});const pe=()=>{C(),Yt()},Ot=()=>{C()};e.watch(f,(u,D)=>{D&&(D.off("style.load",pe),D.off("load",pe),D.off("idle",Ot)),u&&(u.on("load",pe),u.on("style.load",pe),u.on("idle",Ot),pe())}),e.watch(()=>n.center,u=>{!f.value||!Array.isArray(u)||u.length<2||b([u[0],u[1]])},{deep:!0}),e.watch(()=>n.zoom,u=>{!f.value||typeof u!="number"||N(u)}),e.onBeforeUnmount(()=>{be.value&&y&&y(be.value),U.value?h(U.value):f.value&&h(f.value);const u=f.value;u&&(je(u),u.off("style.load",pe),u.off("load",pe),u.off("idle",Ot))});function Lo(u){u&&(q.value=u)}function ou(u){L.value=u}p.setBasemap=Lo,p.toggleGeometry=ou,p.setOverlays?.(j.value);function Io(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const D=u.geometry??u;if(!D?.type)return null;if(D.type==="GeometryCollection"&&Array.isArray(D.geometries)){const R=D.geometries.filter(ee=>ee&&typeof ee.type=="string").map(ee=>({type:"Feature",geometry:ee}));return R.length?{type:"FeatureCollection",features:R}:null}if(D.type==="MultiPoint"&&Array.isArray(D.coordinates)){const R=D.coordinates.filter(ee=>Array.isArray(ee)&&ee.length>=2).map(ee=>({type:"Feature",geometry:{type:"Point",coordinates:ee}}));return R.length?{type:"FeatureCollection",features:R}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:D}]}}function fr(u){if(!u?.features?.length)return null;let D=1/0,R=1/0,ee=-1/0,Fe=-1/0;const vt=Qt=>{if(typeof Qt[0]=="number"){const[bt,ur]=Qt;D=Math.min(D,bt),R=Math.min(R,ur),ee=Math.max(ee,bt),Fe=Math.max(Fe,ur);return}Qt.forEach(bt=>vt(bt))};return u.features.forEach(Qt=>{const bt=Qt?.geometry?.coordinates;bt&&vt(bt)}),D===1/0||R===1/0?null:[D,R,ee,Fe]}return(u,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(G.value),style:e.normalizeStyle(W.value?void 0:M.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:m,class:e.normalizeClass(J.value)},null,2),e.createVNode(xa,{items:A.value},null,8,["items"]),ue("search")?(e.openBlock(),e.createBlock(Ha,{key:0})):e.createCommentVNode("",!0),ue("home")||ue("fullscreen")?(e.openBlock(),e.createElementBlock("div",Ka,[ue("home")?(e.openBlock(),e.createElementBlock("div",Ga,[e.createVNode(Go,{center:P.value,zoom:le.value},null,8,["center","zoom"]),u.geom?(e.openBlock(),e.createBlock(Go,{key:0,"target-center":Xt.value,"target-zoom":n.zoom,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ue("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:v,"aria-label":W.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},D[0]||(D[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),8,Za)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",Ja,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:x},D[1]||(D[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])),e.createElementVNode("div",Ya,e.toDisplayString(K.value.title||"Об'єкт"),1),K.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${M.value.height}-120px)]`]),innerHTML:K.value.html},null,10,Xa)):(e.openBlock(),e.createElementBlock("div",Qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value.rows,R=>(e.openBlock(),e.createElementBlock("div",{key:R.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",Va,e.toDisplayString(R.label)+":",1),e.createElementVNode("span",ec,e.toDisplayString(R.value),1)]))),128))])),K.value.actions?.length?(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value.actions,R=>(e.openBlock(),e.createElementBlock("a",{key:R.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:R.url,target:R.target??void 0,rel:"noreferrer"},e.toDisplayString(R.label),9,nc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Ea),ue("position")&&z.value?(e.openBlock(),e.createBlock(Sa,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:z.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});/**
|
|
141
|
+
*/const Mn=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Mr={class:"border-t pt-3 mt-4"},Rr={class:"flex gap-2"},Pr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Fr={class:"flex-1 space-y-2"},zr={class:"flex justify-between items-center"},jr={class:"flex gap-2"},Hr=["disabled"],Po=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Mr,[e.createElementVNode("div",Rr,[e.createElementVNode("span",Pr,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Fr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,s.value]]),e.createElementVNode("div",zr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",jr,[o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(Mn),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[e.createVNode(e.unref(Ro),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Hr)])])])])]))}}),Ur={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},qr=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",Ur,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(Dr),{class:"h-3 w-3 mr-2"}),m[0]||(m[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(An),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Wr={class:"space-y-2"},Kr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Gr={class:"flex-1 min-w-0 space-y-1 relative"},Zr={class:"flex items-center gap-2"},Jr={class:"font-medium text-xs"},Yr={class:"text-xs text-gray-500"},Xr={key:0,class:"text-xs text-gray-700 leading-relaxed"},Qr={class:"flex justify-between text-xs"},Vr={class:"flex items-center gap-2"},ei={key:0,class:"flex gap-2"},ti=["disabled"],ni={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},oi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),p=k=>{const w=new Date,F=Math.floor((w.getTime()-k.getTime())/(1e3*60*60));return F<1?`${Math.floor((w.getTime()-k.getTime())/6e4)}m`:F<24?`${F}h`:`${Math.floor(F/24)}d`},u=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},N=(k,w)=>{o("like",k,w)},g=(k,w)=>{o("edit",k,w)};return(k,w)=>{const F=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Wr,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",Kr,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,e.toDisplayString(k.comment?.author),1),e.createElementVNode("span",Yr,e.toDisplayString(p(k.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":w[0]||(w[0]=T=>r.value=T),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",Xr,e.toDisplayString(k.comment?.text),1)),e.createElementVNode("div",Qr,[e.createElementVNode("div",Vr,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:w[1]||(w[1]=T=>u())},[e.createVNode(e.unref(Cr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(k.comment?.likes),1)],2),k.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:w[2]||(w[2]=T=>c.value=!0)},[e.createVNode(e.unref(Lr),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:w[3]||(w[3]=T=>a.value=!0)},[e.createVNode(e.unref(Nr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",ei,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:w[4]||(w[4]=T=>d.value=!1)},[e.createVNode(e.unref(Mn),{class:"h-3 w-3"}),w[11]||(w[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!r.value.trim(),onClick:w[5]||(w[5]=T=>b())},[e.createVNode(e.unref(Ro),{class:"h-3 w-3 mr-1"}),w[12]||(w[12]=e.createTextVNode(" Send ",-1))],8,ti)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(qr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":w[6]||(w[6]=T=>a.value=T),onEdit:w[7]||(w[7]=T=>d.value=!0),onDelete:w[8]||(w[8]=T=>k.$emit("delete",k.comment?.id)),comment:k.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),k.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.comment?.replies,T=>(e.openBlock(),e.createBlock(F,{key:T.id,comment:T,isInside:!0,onDelete:E=>k.$emit("delete",T.id),onLike:N,onEdit:g},null,8,["comment","onDelete"]))),128)),c.value&&!k.isInside?(e.openBlock(),e.createBlock(Po,{key:0,onSendComment:w[9]||(w[9]=T=>k.$emit("reply",k.comment?.id,T)),isReply:c.value,"onUpdate:isReply":w[10]||(w[10]=T=>c.value=T)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),si=["id"],ri={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},en=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const p=await fetch(`/api/widget/comment/${o.id}`).then(u=>u.json());r.value=p.rows.map(u=>({id:u.communication_id,author:u.username,text:u.body,createdAt:new Date(u.cdate)}))}r.value.length===0&&l();const i=async p=>{o.onAddComment?o.onAddComment(p):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:p})}),await l()),s("add",p)},a=(p,u)=>{o?.onLike?.(p,u),s("like",p,u)},c=(p,u)=>{o.onReply?.(p,u),s("reply",p,u)},d=async(p,u)=>{o.onEdit?o.onEdit(p,u):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:u})}),await l()),s("edit",p,u)},m=async p=>{o.onDelete?o.onDelete(p):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"DELETE"}),await l()),s("delete",p)};return(p,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",p.className]),id:p.id,style:e.normalizeStyle(p.style)},[p.title?(e.openBlock(),e.createElementBlock("h3",ri,e.toDisplayString(p.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([p.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:p.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(oi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:u[0]||(u[0]=N=>m(N)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Po,{onSendComment:u[1]||(u[1]=b=>i(b))})],14,si))}}),Fo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Nt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ir}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Ar}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Sr}]]),ii={class:"mx-auto font-sans"},li={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},ai={class:"relative"},ci={class:"space-y-3"},di={class:"flex-1 min-w-0 pb-2"},pi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},fi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ui={class:"font-medium text-xs"},mi={class:"text-xs text-gray-500"},hi={class:"space-y-1"},gi={class:"text-xs text-gray-700"},yi={class:"capitalize mr-1"},vi={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},bi={key:0,class:"flex items-center gap-1 text-xs"},ki={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ei={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},tn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",ii,[r.title?(e.openBlock(),e.createElementBlock("h3",li,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:r.maxHeight+"px"})},[e.createElementVNode("div",ai,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ci,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Fo).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Fo).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",di,[e.createElementVNode("div",pi,[e.createElementVNode("span",fi,[e.createVNode(e.unref(On),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",ui,e.toDisplayString(i?.userName),1),e.createElementVNode("span",mi,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",hi,[e.createElementVNode("div",gi,[e.createElementVNode("span",yi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",vi,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",bi,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Er),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),wi={key:0,class:"text-xl font-semibold"},Ni={class:"flex gap-1"},xi={key:0},_i={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},Ci=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",s.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[s.title?(e.openBlock(),e.createElementBlock("h3",wi,e.toDisplayString(s.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ni,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(Tr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(_r),{class:"h-4 w-4"})],2),s.editable?(e.openBlock(),e.createElementBlock("label",xi,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,32),e.createElementVNode("div",_i,[e.createVNode(e.unref(Mo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Rn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Nt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:xr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Or,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Nt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:kr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Oo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Oo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Nt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Nt,label:"PPT"}};function zo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function jo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Si={class:"space-y-0.5"},Bi=["onClick"],Ti=["onClick"],$i={class:"flex items-center gap-2"},Li={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Ii={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Di={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ai={class:"flex items-center gap-1"},Oi=["onClick"],Mi=["onClick"],Ri=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,s=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(Rn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Rn)[s?.ext]?.icon||e.unref(Rn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",$i,[e.createElementVNode("span",Li,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Ti),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(jo)(s.size)),1),e.createElementVNode("div",Di,e.toDisplayString(e.unref(zo)(s.createdAt)),1),e.createElementVNode("div",Ai,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(Ao),{class:"h-3 w-3"})],8,Oi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(An),{class:"h-3 w-3"})],8,Mi)])],8,Bi))),128))]))}}),Pi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Fi=["onClick"],zi={class:"space-y-2"},ji={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Hi=["src"],Ui={class:"space-y-1"},qi=["title"],Wi={class:"text-xs text-gray-500 text-left"},Ki={class:"absolute top-2 right-1 flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",zi,[e.createElementVNode("div",ji,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,Hi)):(e.openBlock(),e.createBlock(e.unref(Nt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ui,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,qi),e.createElementVNode("p",Wi,e.toDisplayString(e.unref(zo)(s.createdAt))+", "+e.toDisplayString(e.unref(jo)(s.size)),1)])]),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(Ao),{class:"h-3 w-3"})],8,Gi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(An),{class:"h-3 w-3"})],8,Zi)])],8,Fi))),128))]))}}),Yi={class:"mx-auto font-sans"},Xi={key:1},nn=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=n;a.value.length===0&&w();const d=(E,y)=>{r.value=y,s.value=!0},m=()=>{r.value&&(N(r.value),r.value=null,s.value=!1)},p=e.computed(()=>Array.isArray(a.value)?a.value.map(E=>E?.file_path):[]),u=E=>{const y=p.value.findIndex(M=>M===E.file_path);y!==-1&&(l.value=!0,i.value=y)},b=E=>{o.onAddFile?o.onAddFile(E):F(E),c("add",E)},N=E=>{o.onDelete?o.onDelete(E):T(E),c("delete",E)},g=E=>{const y=document.createElement("a");y.setAttribute("download",E?.uploaded_name||E?.name),y.href=E?.file_path||E?.path,y.click()},k=e.ref("list");async function w(){if(!o.id)return;const E=await fetch(`/api/widget/file/${o.id}`).then(y=>y.json());E.rows.forEach(y=>{y.timestamp=new Date(y.cdate),y.id=y.entity_id,y.entityType=y.entity_type,y.entityId=y.entity_id,y.entityType=y.entity_type,y.action=y.change_type,y.userId=y.change_user_id,y.userName=y.username,y.timestamp=new Date(y.cdate),y.description=y.username,y.status=y.username}),a.value=E.rows}const F=async E=>{if(!(!E.target||!E.target.files||E.target.files.length===0))try{await Promise.all(Array.from(E.target.files).map(async y=>{const M=new FormData;M.append("file",y);const q=`/api/widget/file/${o.id}`,L=await fetch(q,{method:"POST",body:M});if(!L.ok)throw new Error(`HTTP error! status: ${L.status}`);return y})),await w()}catch(y){console.error("Помилка при завантаженні файлів:",y)}},T=async E=>{try{await fetch(`/api/widget/file/${o.id}/${E}`,{method:"DELETE"}),await w()}catch(y){console.error(y)}};return(E,y)=>{const M=e.resolveComponent("MessageBox"),q=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Yi,[e.createVNode(Ci,{modelValue:k.value,"onUpdate:modelValue":y[0]||(y[0]=L=>k.value=L),title:o.title,onOnAddFile:y[1]||(y[1]=L=>b(L)),editable:o.editable},null,8,["modelValue","title","editable"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(E.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:E.maxHeight+"px"})},[k.value==="list"?(e.openBlock(),e.createBlock(Ri,{key:0,onDelete:d,onDownload:g,onOpenLightbox:y[2]||(y[2]=L=>u(L)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),k.value==="grid"?(e.openBlock(),e.createBlock(Ji,{key:1,onDelete:d,onDownload:g,onOpenLightbox:y[3]||(y[3]=L=>u(L)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",Xi,y[6]||(y[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(M,{modelValue:s.value,"onUpdate:modelValue":y[4]||(y[4]=L=>s.value=L),onConfirm:m,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(q,{modelValue:l.value,"onUpdate:modelValue":y[5]||(y[5]=L=>l.value=L),images:p.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),Qi={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Vi=["onClick"],el={key:0,rel:"noreferrer",class:"relative block h-full w-full"},tl=["src"],nl={key:0,class:"thumb-cover"},ol=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return c.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.items,(p,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+u,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:u,onClick:e.withModifiers(b=>a(p),["stop"])},[u<5?(e.openBlock(),e.createElementBlock("div",el,[e.createElementVNode("img",{src:`/file/resize?filepath=${p?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",u===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,tl),u===4&&c.items?.length>5?(e.openBlock(),e.createElementBlock("div",nl," +"+e.toDisplayString(c.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Vi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-c.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(c.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=p=>o("delete",p))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),sl={key:0,class:"text-xl font-semibold"},rl={class:"flex gap-1"},il={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer"},ll=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",n.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[n.title?(e.openBlock(),e.createElementBlock("h3",sl,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",rl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s))},null,32),e.createElementVNode("div",il,[e.createVNode(e.unref(Mo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),al={class:"w-full mx-auto font-sans",ref:"containerRef"},cl={key:1},on=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(o.items??[]),r=n;s.value.length===0&&c();const l=m=>{o.onAddImage?o.onAddImage(m):a(m),r("add",m)},i=m=>{const p=s.value.find(u=>u.file_path===m)?.file_id;p&&(o.onDelete?o.onDelete(p):d(p))},a=async m=>{if(!(!m.target||!m.target.files||m.target.files.length===0))try{await Promise.all(Array.from(m.target.files).map(async p=>{const u=new FormData;u.append("file",p);const b=`/api/widget/file/${o.id}`,N=await fetch(b,{method:"POST",body:u});if(!N.ok)throw new Error(`HTTP error! status: ${N.status}`);return p})),await c()}catch(p){console.error("Помилка при завантаженні файлів:",p)}};async function c(){if(!o.id)return;const m=await fetch(`/api/widget/file/${o.id}`).then(p=>p.json());s.value=m.rows}const d=async m=>{try{await fetch(`/api/widget/file/${o.id}/${m}`,{method:"DELETE"}),await c()}catch(p){console.error(p)}};return(m,p)=>(e.openBlock(),e.createElementBlock("div",al,[e.createVNode(ll,{title:m.title,onOnAddImage:p[0]||(p[0]=u=>l(u))},null,8,["title"]),s.value.length>0?(e.openBlock(),e.createBlock(ol,{key:0,items:s.value,onDelete:p[1]||(p[1]=u=>i(u))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",cl,p[2]||(p[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),dl={class:"text-value"},pl={class:"text-sm text-gray-900"},fl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",dl,[e.createElementVNode("span",pl,e.toDisplayString(o.value),1)]))}}),ot=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},ul=ot(fl,[["__scopeId","data-v-34a76c89"]]),ml={class:"link-value"},hl=["href"],gl=ot(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",ml,[e.createElementVNode("a",{href:String(s.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,hl)]))}}),[["__scopeId","data-v-932f028c"]]),yl={class:"date-value"},vl={class:"text-sm text-gray-900"},bl=ot(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",yl,[e.createElementVNode("span",vl,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),kl={class:"status-value"},El={key:0,class:"mr-1"},wl=ot(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",kl,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",El,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(r.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Nl={class:"custom-value"},xl={class:"text-sm text-gray-900"},_l=ot(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Nl,[e.renderSlot(n.$slots,"default",{item:n.item,value:n.item.value},()=>[e.createElementVNode("span",xl,e.toDisplayString(String(n.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Cl=["id"],Sl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Bl={key:1,class:"overflow-x-auto"},Tl={class:"min-w-full divide-y divide-gray-200"},$l={class:"bg-white divide-y divide-gray-200"},Ll={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Il={class:"flex items-center gap-2"},Dl=["title"],Al={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Ol={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Ml={class:"flex items-start gap-3"},Rl={key:0,class:"flex-shrink-0"},Pl={class:"flex-1 min-w-0"},Fl={class:"flex items-center gap-2 mb-2"},zl={class:"text-sm font-medium text-gray-900"},jl=["title"],Hl={key:3,class:"overflow-x-auto"},Ul={class:"min-w-full divide-y divide-gray-200"},ql={class:"bg-white divide-y divide-gray-200"},Wl={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Kl={class:"flex items-center gap-2"},Gl=["title"],Zl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Pn=ot(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return gl;case"date":return bl;case"status":return wl;case"custom":return _l;default:return ul}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",o.className]),id:o.id,style:e.normalizeStyle(o.style)},[o.title?(e.openBlock(),e.createElementBlock("h3",Sl,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),o.view==="table"?(e.openBlock(),e.createElementBlock("div",Bl,[e.createElementVNode("table",Tl,[e.createElementVNode("tbody",$l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Ll,[e.createElementVNode("div",Il,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Dl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Al,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):o.view==="grid"?(e.openBlock(),e.createElementBlock("div",Ol,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Ml,[r.icon?(e.openBlock(),e.createElementBlock("div",Rl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Pl,[e.createElementVNode("div",Fl,[e.createElementVNode("h4",zl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,jl)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Hl,[e.createElementVNode("table",Ul,[e.createElementVNode("tbody",ql,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Wl,[e.createElementVNode("div",Kl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Gl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Zl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Cl))}}),[["__scopeId","data-v-106790ef"]]);function Ho(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function Jl(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const Yl="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Fn=null;function Xl(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function Ql(){return Fn||(Fn=Ho(Yl).then(()=>{const t=Xl();if(!t)throw new Error("IMask is not available after loading the script");return t})),Fn}function Vl(){return typeof window>"u"?"":window.location?.origin??""}function Uo(){if(!(typeof window>"u"))return window.maplibregl}const qo=Symbol("vs-widget-map");function zn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ea(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ta(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function jn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=Vl(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function na(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function oa(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function sn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Wo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function sa(t){const n=t?.color??Wo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Wo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const Rt="map-highlight-source",ra="map-highlight-fill",ia="map-highlight-line";function la(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Ko(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function aa(){return Jl("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Ho("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Uo()}function rn(t){const n=e.inject(qo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,p=null;const u=h=>{h&&(o.value?o.value.setStyle(h):m=h)},b=()=>{r.value.overlays=i.value.map(h=>({id:h.id,name:h.config.name,visible:h.visible}))},N=h=>{const $=Array.isArray(h)?h:[];l.value=$,$.some(j=>j.key===r.value.selectedBasemap)||(r.value.selectedBasemap=$[0]?.key??"")},g=h=>{h&&i.value.forEach($=>{$.layerIds.forEach(A=>{h.getLayer(A)&&h.removeLayer(A)}),h.getSource($.sourceId)&&h.removeSource($.sourceId),$.layerIds=[]})},k=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||(i.value.forEach($=>{w(h,$)}),G())},w=(h,$)=>{const A=na($.config);A==="vtile"?T(h,$):A==="raster"&&F(h,$)},F=(h,$)=>{const A=$.config,j=$.sourceId,Y=jn(A.url);if(!Y)return;h.getSource(j)||h.addSource(j,{type:"raster",tiles:[Y],minzoom:A.minzoom??0,maxzoom:A.maxzoom??24});const Z=`${$.id}-raster`;h.getLayer(Z)||h.addLayer({id:Z,type:"raster",source:j,layout:{visibility:$.visible?"visible":"none"}}),$.layerIds=[Z],E(h,$)},T=(h,$)=>{const A=$.config,j=$.sourceId,Y=jn(A.url);if(!Y)return;h.getSource(j)||h.addSource(j,{type:"vector",tiles:[Y],minzoom:A.minzoom??0,maxzoom:A.maxzoom??24});const Z=A.style??{},he=sa(Z),Be=[],be={visibility:$.visible?"visible":"none"},Je=oa(A),qe={source:j,layout:be};if(Je&&(qe["source-layer"]=Je),(Z.type??"polygon").toLowerCase()==="point"){const Pe=`${$.id}-circle`;h.getLayer(Pe)||h.addLayer({id:Pe,type:"circle",...qe,paint:{"circle-color":he,"circle-opacity":Z.opacity??1,"circle-radius":Z.radius??Z.width??3,"circle-stroke-color":Z.stroke??Z.color??"#ffffff","circle-stroke-width":Z.width??1}}),Be.push(Pe);const Ye=Z.text??Z.label;if(Ye){const We=`${$.id}-symbol`,nt=sn(Z.textSize)??10,Ot=Z.textHaloColor??Z.stroke??"#ffffff",vt=sn(Z.textHaloWidth)??1,bt=sn(Z.textZoom??Z.pointZoom),Xe={"text-color":Z.textColor??"#000000","text-halo-color":Ot,"text-halo-width":vt},Qe={id:We,type:"symbol",...qe,layout:{"text-field":["coalesce",["get",Ye],""],"text-size":nt,"text-anchor":"top"},paint:Xe};bt!=null&&(Qe.minzoom=bt),h.getLayer(We)||h.addLayer(Qe),Be.push(We)}}else{const Pe=`${$.id}-fill`;h.getLayer(Pe)||h.addLayer({id:Pe,type:"fill",...qe,paint:{"fill-color":he,"fill-opacity":Z.opacity??.5,"fill-outline-color":Z.stroke??Z.color??"#0ea5e9"}}),Be.push(Pe);const Ye=`${$.id}-line`;h.getLayer(Ye)||h.addLayer({id:Ye,type:"line",...qe,paint:{"line-color":Z.stroke??Z.color??"#0b74c4","line-width":sn(Z.width??Z.border)??1,"line-opacity":Z.opacity??1}}),Be.push(Ye)}$.layerIds=Be,E(h,$)},E=(h,$)=>{const A=$.visible?"visible":"none";$.layerIds.forEach(j=>{h.getLayer(j)&&h.setLayoutProperty(j,"visibility",A)})},y=h=>{const $=Array.isArray(h)?h:[];g(o.value??void 0),d.value=null,x();const A=$.map((j,Y)=>{if(!j)return null;const Z=jn(j.url);if(!Z)return null;const he=j.id!=null?String(j.id):`overlay-${Y}`;return{id:he,config:{...j,id:he,url:Z},visible:!1,sourceId:`${he}-source`,layerIds:[]}}).filter(j=>!!j);i.value=A,b(),k()},M=(h,$)=>{const A=i.value.find(Y=>Y.id===h);if(!A)return;A.visible=$,b();const j=o.value;if(!(!j||typeof j.isStyleLoaded!="function"||!j.isStyleLoaded())){if(!A.layerIds.length){w(j,A);return}E(j,A)}},q=()=>{a.value&&(a.value.remove(),a.value=null)},L=(h,$={})=>!Array.isArray(h.popup)||!h.popup.length?[]:h.popup.map(A=>({label:A.label??A.field,value:zn($?.[A.field])})).filter(A=>A.label&&A.value!==void 0),R=h=>{const $=o.value;if(!$||!h?.point)return;const A=$.queryRenderedFeatures(h.point);for(const j of A){const Y=j.layer?.id??j.sourceLayer;if(!Y)continue;const Z=oe(Y);if(!Z)continue;const he=L(Z,j.properties??j.layer?.properties??{});if(!he.length)continue;const Be=ea(he),be=Uo();if(!be)return;const Je=h.lngLat;if(c.value===Y&&a.value){a.value.setLngLat(Je),a.value.setHTML(Be);return}c.value=Y,q(),a.value=new be.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(Je).setHTML(Be).addTo($);return}c.value=null,q()},W=()=>{c.value=null,q()},G=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||h.getSource(Rt)||(h.addSource(Rt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),h.addLayer({id:ra,type:"fill",source:Rt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),h.addLayer({id:ia,type:"line",source:Rt,paint:{"line-color":"#1d4ed8","line-width":2}}))},J=h=>{const $=o.value;if(!$||typeof $.isStyleLoaded!="function"||!$.isStyleLoaded())return;G();const A=$.getSource(Rt);if(!(!A||typeof A.setData!="function")){if(!h){A.setData({type:"FeatureCollection",features:[]});return}A.setData({type:"FeatureCollection",features:[h]})}},K=h=>{const $=la(h);$&&J($)},x=()=>{J(null)},I=()=>{d.value=null,x()},_=h=>{if(h)return typeof h=="string"?h:h.field??h.name??h.key??h.label},P=h=>{if(h)return typeof h=="string"?h:h.label??h.title??h.field??h.name},le=(h,$)=>!h||!h.length?[]:h.map(A=>{const j=_(A);if(!j)return null;const Y=P(A),Z=zn($?.[j]);return!Y||Z===""?null:{label:Y,value:Z}}).filter(A=>!!A),Ae=(h,$)=>!Array.isArray(h)||!h.length?[]:h.map(A=>{if(!A?.name)return null;const j=A.title??A.name,Y=zn($?.[A.name]);return!j||Y===""?null:{label:j,value:Y}}).filter(A=>!!A),Te=(h,$)=>!Array.isArray(h)||!h.length?[]:h.map(j=>{const Y=Ko(j.url,$),Z=j.label??j.url;return Y?{label:Z,url:Y,target:j.target}:null}).filter(j=>!!j),fe=async(h,$)=>{const A=Ko(h,$);if(!A)return null;try{const j=await fetch(A);return j.ok?await j.json():null}catch{return null}},ve=async(h,$)=>{const A=$.properties??$.layer?.properties??{},j=le(h.card?.rows,A);let Y,Z;if(h.card?.api){const be=await fe(h.card.api,A);be&&(typeof be.html=="string"&&be.html.trim()&&(Y=be.html),Array.isArray(be.columns)&&be.columns.length&&(Z=be.columns))}let he=j;if(!Y&&Z){const be=Ae(Z,A);be.length&&(he=be)}if(!he.length&&!Y)return null;const Be=Te(h.card?.actions,A);return{title:A?.name??h.name,rows:he,html:Y,actions:Be.length?Be:void 0}},z=async h=>{const $=o.value;if(!$||!h?.point)return;const A=$.queryRenderedFeatures(h.point);for(const j of A){const Y=j.layer?.id??j.sourceLayer;if(!Y)continue;const Z=oe(Y);if(!Z||!Z.card)continue;const he=await ve(Z,j);if(he){d.value=he,K(j);return}}d.value=null,x()},U=()=>{const h=o.value;h&&(h.on("mousemove",R),h.on("mouseleave",W),h.on("click",z))},H=()=>{const h=o.value;h&&(h.off("mousemove",R),h.off("mouseleave",W),h.off("click",z),q(),x())},oe=h=>{if(h)return i.value.find($=>$.layerIds.includes(h))?.config},ae=async()=>{const h=await aa(),$=ta(t.container);if(!h||!$)return;const A={container:$,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new h.Map(A);const j=()=>{k()};p=j,o.value.on("style.load",j),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),k(),U()})};e.onMounted(ae),e.onBeforeUnmount(()=>{H(),o.value&&p&&o.value.off("style.load",p),g(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const ue={map:o,ready:s,setStyle:u,flyTo:h=>o.value?.flyTo(h),fitBounds:(h,$)=>o.value?.fitBounds(h,$),setCenter:h=>o.value?.setCenter(h),setZoom:h=>o.value?.setZoom(h),addControl:(h,$)=>o.value?.addControl(h,$),removeControl:h=>o.value?.removeControl(h),on:(h,...$)=>o.value?.on(h,...$),off:(h,...$)=>o.value?.off(h,...$),project:h=>o.value?.project(h),unproject:h=>o.value?.unproject(h),state:r,basemapOptions:l,setOverlays:y,toggleOverlay:M,getOverlayConfig:oe,selectedCard:d,setBasemapOptions:N,clearCard:I};return e.provide(qo,ue),ue}const ca={class:"map-base-layer-menu"},da={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},pa={class:"flex items-center justify-between p-2 border-b"},fa={class:"p-2 border-b"},ua={class:"flex items-center"},ma=["value","checked","onChange"],ha={class:"ml-2"},ga={class:"p-2"},ya={class:"flex items-center"},va=["checked"],ba=["checked","onChange"],ka={class:"ml-2"},Ea=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=rn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),p=e.computed(()=>n.value.overlays??[]),u=g=>{s?.(g)},b=()=>{r?.(!m.value)},N=g=>{l?.(g.id,!g.visible)};return(g,k)=>(e.openBlock(),e.createElementBlock("div",ca,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:k[0]||(k[0]=w=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("div",pa,[k[3]||(k[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:k[1]||(k[1]=w=>i.value=!1)},k[2]||(k[2]=[e.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-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)]))]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.key},[e.createElementVNode("label",ua,[e.createElementVNode("input",{type:"radio",name:a,value:w.key,checked:d.value===w.key,onChange:F=>u(w.key)},null,40,ma),e.createElementVNode("span",ha,e.toDisplayString(w.name||w.key),1)])]))),128))]),e.createElementVNode("div",ga,[e.createElementVNode("label",ya,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,va),k[4]||(k[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,w=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:w.id},[e.createElementVNode("input",{type:"checkbox",checked:w.visible,onChange:F=>N(w)},null,40,ba),e.createElementVNode("span",ka,e.toDisplayString(w.name||w.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),wa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Na={class:"leading-tight"},xa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>n.items.length?(e.openBlock(),e.createElementBlock("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Na,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),_a={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Ca={class:"font-mono"},Sa=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",_a,[e.createElementVNode("span",Ca,e.toDisplayString(n.coordinates),1)]))}}),Ba={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ta=["title"],$a={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},La=["onClick"],Ia=["placeholder"],Da={class:"divide-y divide-gray-100"},Aa=["onClick"],Oa=600,Ma="0000000000:00:000:0000",Ra=30,Pa=8,Fa="https://data.softpro.ua/api-user/gis-url-proxy",za="https://geo.rv.ua/api-user/dzk.api",ja="https://nominatim.openstreetmap.org/search",Ha=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=rn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const z=n.config?.tools?.filter(U=>i.includes(U));return z&&z.length?z:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,z=>{z.includes(d.value)||(d.value=z[0])});const m=e.ref(""),p=e.ref(!1),u=e.ref(null),b=e.ref(null),N=e.ref(null),g=e.ref([]),k=e.ref(null),w=e.computed(()=>d.value==="address"&&g.value.length>0);let F=null,T=null;const E=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function y(){if(!b.value)return;const z=b.value.getBoundingClientRect(),U=z.width+Ra,H=z.left+window.scrollX,oe=z.bottom+window.scrollY+Pa;E.left=`${H}px`,E.top=`${oe}px`,E.width=`${U}px`,E.display="block"}const M=()=>{w.value&&y()};function q(){F&&(clearTimeout(F),F=null)}function L(){T?.destroy(),T=null}async function R(){if(d.value!=="parcel")return;const z=N.value;if(!z)return;const U=await Ql();d.value==="parcel"&&(L(),T=U(z,{mask:Ma,lazy:!1,placeholderChar:"_"}),T.on("accept",()=>{m.value=T?.value??""}))}function W(){return(T?.value??m.value).trim()}e.watch(d,z=>{m.value="",p.value=!1,g.value=[],q(),z==="parcel"?e.nextTick(()=>{R().catch(U=>{_e.notify({type:"error",title:"Маска кадастру",message:U?.message||"Не вдалося ініціалізувати маску"})})}):L()}),e.watch(w,z=>{z?e.nextTick(()=>{y()}):E.display="none"}),e.watch(m,z=>{if(d.value!=="address"){g.value=[],q();return}if(!z.trim()){g.value=[],q();return}q(),F=window.setTimeout(()=>{le(z).catch(U=>{const H=U?.message||"Помилка пошуку адреси";_e.notify({type:"error",title:"Пошук адреси",message:H})})},Oa)});function G(z){d.value=z}function J(z){const U=z.target;if(p.value){const H=u.value;H&&!H.contains(U)&&(p.value=!1)}if(w.value){const H=k.value;H&&!H.contains(U)&&(g.value=[])}}e.onMounted(()=>{window.addEventListener("click",J,!0),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),d.value==="parcel"&&e.nextTick(()=>{R().catch(z=>{_e.notify({type:"error",title:"Маска кадастру",message:z?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",J,!0),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M),q(),L()});function K(z){return z==="xy"?"Координати":z==="parcel"?"Кадастр":"Адреси"}function x(z){const U=z.replace(/[,]+/g," ").trim();if(!U)return null;const H=U.split(/\s+/).filter(Boolean);if(H.length<2)return null;const oe=H.slice(0,2).map(Number);if(!oe.every(Y=>Number.isFinite(Y)))return null;let[ae,ue]=oe,h=ae,$=ue;const A=Y=>Math.abs(Y)<=90,j=Y=>Math.abs(Y)<=180;if(!A(h)||!j($))if(A($)&&j(h))h=ue,$=ae;else return null;return{lat:h,lng:$}}function I(z){return(z?.items||[]).map((H,oe)=>{const ae=Number(H?.position?.lat),ue=Number(H?.position?.lng);return!Number.isFinite(ae)||!Number.isFinite(ue)?null:{id:String(H?.id??oe),title:H?.title||H?.address?.label||"Знайдений обʼєкт",lat:ae,lng:ue}}).filter(H=>!!H)}function _(z){const U=z?.result||z?.data||z;if(!U)return[];const H=U.geom_centroid;if(!H||!Array.isArray(H.coordinates))return[];const[oe,ae]=H.coordinates;return!Number.isFinite(ae)||!Number.isFinite(oe)?[]:[{id:"parcel",title:U.cadnum||U.cad_num||"Земельна ділянка",lat:ae,lng:oe}]}function P(z){return(Array.isArray(z?.features)?z.features:[]).map((H,oe)=>{const ae=H?.geometry?.coordinates,ue=Number(ae?.[0]),h=Number(ae?.[1]);if(!Number.isFinite(h)||!Number.isFinite(ue))return null;const $=H?.properties||{},A=$?.geocoding?.label||$?.display_name||$?.label||"Адреса";return{id:String($?.geocoding?.place_id||$?.place_id||oe),title:A,lat:h,lng:ue}}).filter(H=>!!H)}async function le(z){g.value=[],q();const U=new URL(ja);U.searchParams.set("format","geojson"),U.searchParams.set("q",z),U.searchParams.set("addressdetails","1"),U.searchParams.set("bounded","1");const H=r();H&&U.searchParams.set("viewbox",H);const oe=await fetch(U.toString());if(!oe.ok)throw new Error(`HTTP ${oe.status}`);const ae=await oe.json(),ue=P(ae);if(!ue.length){_e.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}g.value=ue}function Ae(z){fe(z),g.value=[],m.value=""}function Te(z){const H=z.replace(/\s+/g,"").split(":");if(H.length!==4)return!1;const oe=[10,2,3,4];return H.every((ae,ue)=>ae.length===oe[ue]&&/^\d+$/.test(ae))}function fe(z){const U=n.config?.zoom??17;o.flyTo?.({center:[z.lng,z.lat],zoom:U})}async function ve(){const z=d.value==="parcel"?W():m.value.trim();if(z){if(d.value==="xy"){const U=x(z);if(!U){_e.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}fe(U),m.value="";return}if(d.value==="address"){try{await le(z)}catch(U){const H=U?.message||"Помилка пошуку адреси";_e.notify({type:"error",title:"Пошук адреси",message:H})}return}try{const U=new URL(d.value==="here"?Fa:za);if(d.value==="here")U.searchParams.set("searchtext",z);else{if(!Te(z)){_e.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}U.searchParams.set("cad_num",z)}const H=await fetch(U.toString());if(!H.ok)throw new Error(`HTTP ${H.status}`);const oe=await H.json(),ae=d.value==="here"?I(oe):_(oe);if(!ae.length)_e.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const ue=ae[0];fe(ue),d.value==="parcel"&&T&&(T.value=""),m.value=""}}catch(U){const H=U?.message||"Помилка пошуку";_e.notify({type:"error",title:"Пошук",message:H})}}}return(z,U)=>(e.openBlock(),e.createElementBlock("div",Ba,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(ve,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[100px]"},[e.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:U[0]||(U[0]=H=>p.value=!p.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:K(d.value)},e.toDisplayString(K(d.value)),9,Ta),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":p.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U[3]||(U[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),p.value?(e.openBlock(),e.createElementBlock("div",$a,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:oe=>G(H)},e.toDisplayString(K(H)),9,La))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:N,"onUpdate:modelValue":U[1]||(U[1]=H=>m.value=H),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] 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,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":U[2]||(U[2]=H=>m.value=H),placeholder:c.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,Ia)),[[e.vModelText,m.value,void 0,{trim:!0}]]),U[4]||(U[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.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"},[e.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)),w.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:k,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(E)},[e.createElementVNode("ul",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:oe=>Ae(H)},e.toDisplayString(H.title),9,Aa))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),Ua={class:"map-center-control"},qa=["aria-label"],Wa=e.defineComponent({directives:{tooltip:_e.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=rn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(N){if(Array.isArray(N)&&N.length>=2){const[g,k]=N.slice(0,2).map(w=>Number(w));return Number.isNaN(g)||Number.isNaN(k)?null:[g,k]}if(N&&typeof N=="object"){const g=N,k=g.lng??g.lon??g.long??g.x,w=g.lat??g.y;if(k!=null&&w!=null){const F=Number(k),T=Number(w);if(!Number.isNaN(F)&&!Number.isNaN(T))return[F,T]}}if(typeof N=="string"){const g=N.split(",").map(k=>Number(k.trim()));if(g.length>=2&&g.every(k=>!Number.isNaN(k)))return[g[0],g[1]]}return null}e.watch(()=>n.center,N=>{const g=c(N);g&&(r.value=g)},{immediate:!0}),e.watch(()=>n.zoom,N=>{const g=Number(N);Number.isNaN(g)||(l.value=g)},{immediate:!0}),e.watch(()=>n.targetCenter,N=>{i.value=c(N)},{immediate:!0}),e.watch(()=>n.targetZoom,N=>{const g=Number(N);a.value=Number.isNaN(g)?null:g},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!i.value);e.onMounted(async()=>{const N=o.value;if(N){if(!r.value){const g=N.getCenter();r.value=[g.lng,g.lat]}l.value==null&&(l.value=N.getZoom())}});function u(){const N=o.value;if(!N)return;const g=r.value||(()=>{const w=N.getCenter();return[w.lng,w.lat]})(),k=l.value??N.getZoom();N.flyTo({center:g,zoom:k})}function b(){const N=o.value;if(!N||!i.value)return;const g=a.value??l.value??N.getZoom();N.flyTo({center:i.value,zoom:g})}return(N,g)=>{const k=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",Ua,[p.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(u,["stop"])},[e.createVNode(e.unref(Br),{class:"w-4 h-4"})])),[[k,"Центр мапи"]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref($r),{class:"w-4 h-4"})],8,qa)),[[k,d.value]]):e.createCommentVNode("",!0)])}}}),Go=ot(Wa,[["__scopeId","data-v-bc627616"]]),Ka={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},Ga={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Za=["aria-label"],Ja={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},Ya={class:"text-slate-900 font-semibold mb-1"},Xa=["innerHTML"],Qa={key:1,class:"space-y-2"},Va={class:"text-gray-500"},ec={class:"font-medium text-slate-900"},tc={key:2,class:"mt-2 flex flex-col gap-2"},nc=["href","target"],ln="map-basemap-source",Hn="map-basemap-layer",oc=20,xt="map-katottg-geometry-source",an="map-katottg-geometry-line",st="map-geometry-source",_t="map-geometry-fill",Ct="map-geometry-line",St="map-geometry-circle",cn=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{},i=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),a=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((O,ee)=>{const ze=typeof O.url=="string"?O.url.trim():"";return ze?{key:(O.key??O.name??`base-${ee}`).trim()||`base-${ee}`,url:ze,name:O.name??O.key??`Layer ${ee+1}`}:null}).filter(O=>!!O)),c=Array.isArray(l.center)&&l.center.length>=2?[Number(l.center[0]),Number(l.center[1])]:void 0,d=typeof l.zoom=="number"?l.zoom:void 0,m=e.ref(null),p=rn({container:m,center:n.center??c,zoom:n.zoom??d}),{map:u,setCenter:b,setZoom:N,state:g,getOverlayConfig:k,selectedCard:w,setBasemapOptions:F,clearCard:T,addControl:E,removeControl:y,ready:M}=p,q=e.computed({get:()=>g.value.selectedBasemap??"",set:f=>{g.value.selectedBasemap=f}}),L=e.computed({get:()=>g.value.geometryVisible??!0,set:f=>{g.value.geometryVisible=f}}),R=e.computed(()=>{const f=n.height;return{height:typeof f=="number"?`${f}px`:String(f)}}),W=e.ref(!1),G=e.computed(()=>W.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),J=e.computed(()=>{const f=["w-full","h-full"];return W.value||f.push(`min-h-[${R.value.height}]`),f.join(" ")}),K=e.computed(()=>w.value),x=()=>T?.(),I=e.ref(n.center??c??null),_=e.ref(n.zoom??d??null),P=e.computed(()=>n.center??I.value??null),le=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof _.value=="number"?_.value:oc),Ae=["home","fullscreen","scale","position","search"],Te=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?Ae:n.tools.filter(f=>Ae.includes(f))),fe=f=>Te.value.includes(f);e.watch([u,M],([f,D])=>{if(!(!f||!D)){if(!I.value){const O=f.getCenter();I.value=[O.lng,O.lat]}_.value==null&&(_.value=f.getZoom())}},{immediate:!0});const ve=e.ref(null),z=e.ref(""),U=e.ref(null),H=f=>{if(!f)return"";const D=Number(f.lat??f[1]),O=Number(f.lng??f[0]);return!Number.isFinite(D)||!Number.isFinite(O)?"":`${O.toFixed(5)}, ${D.toFixed(5)}`},oe=f=>{f?.lngLat&&(z.value=H(f.lngLat))},ae=()=>{z.value=""},ue=f=>{f&&(f.on("mousemove",oe),f.on("mouseleave",ae),U.value=f)},h=f=>{f&&(f.off("mousemove",oe),f.off("mouseleave",ae),U.value=null)},$=e.computed(()=>fe("scale"));e.watch([u,M],([f,D],[O])=>{O&&h(O),!(!f||!D)&&ue(f)},{immediate:!0}),e.watch([u,M,$],([f,D,O])=>{if(ve.value&&y&&(y(ve.value),ve.value=null),!f||!D||!O)return;const ee=window?.maplibregl;ee&&(ve.value=new ee.ScaleControl({unit:"metric"}),E?.(ve.value,"bottom-left"))},{immediate:!0});const A=e.computed(()=>Array.isArray(n.legend)?n.legend.map((f,D)=>{const O=typeof f?.color=="string"?f.color.trim():"",ee=typeof f?.label=="string"?f.label.trim():"";return!O||!ee?null:{color:O,label:ee,key:`${ee}-${D}`}}).filter(f=>!!f):[]),j=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(a,f=>{if(F?.(f),!f.length){q.value="";return}f.some(D=>D.key===q.value)||(q.value=f[0].key)},{immediate:!0});const Y=()=>typeof window>"u"?"":window.location?.origin??"",Z=f=>{if(!f)return"";const D=f.trim();if(!D)return"";const ee=D.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!ee)return"";if(/^https?:\/\//i.test(ee))return ee;const ze=Y(),Et=ee.replace(/^\/+/,"");return ze?`${ze}/${Et}`:Et?`/${Et}`:""},he=f=>{if(!f?.getStyle)return;const D=f.getStyle()??{},O=Array.isArray(D.layers)?D.layers:[];return O.length?O.find(ze=>ze.type!=="background")?.id??O[0]?.id:void 0},Be=f=>{f&&(f.getLayer(Hn)&&f.removeLayer(Hn),f.getSource(ln)&&f.removeSource(ln))},be=(f,D)=>{if(!f)return;const O=he(f);f.addSource(ln,{type:"raster",tiles:[D],tileSize:256}),f.addLayer({id:Hn,type:"raster",source:ln,layout:{visibility:"visible"}},O)},Je=f=>{if(!f)return;const D=Z(f.url);if(!D){qe.value=null;return}qe.value=D,Be(u.value),Pe()},qe=e.ref(null),Dn=f=>{if(!f||f.__pendingBasemapHooked)return;f.__pendingBasemapHooked=!0;const D=()=>{f.__pendingBasemapHooked=!1,Pe()};f.once("style.load",D),f.once("styledata",D)},Pe=()=>{const f=u.value,D=qe.value;if(!D||!f)return;if(!(typeof f.isStyleLoaded=="function"?f.isStyleLoaded():!0)){Dn(f);return}Be(f),be(f,D)},Ye=()=>{const f=q.value;if(!f)return;const D=a.value.find(O=>O.key===f);D&&Je(D)};e.watch(q,()=>{Ye()},{immediate:!0}),e.watch(j,f=>{p.setOverlays?.(f)},{immediate:!0,deep:!0});const We=e.ref(null);let nt=0;const Ot=e.computed(()=>Io(We.value)),vt={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},bt={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Xe=e.ref(Io(n.geom)),Qe=e.ref(fr(Xe.value)),kt=e.ref(!1),v=e.computed(()=>{if(!Qe.value)return null;const[f,D,O,ee]=Qe.value;return[(f+O)/2,(D+ee)/2]});e.ref(!1);const B=()=>{W.value=!W.value},C=e.ref(!1),S=()=>{const f=u.value;if(!f||!f.isStyleLoaded())return;const D=Xe.value;if(!D){Q(f);return}let O=f.getSource(st);O?O.setData(D):(f.addSource(st,{type:"geojson",data:D}),V(f),O=f.getSource(st)),se(f,L.value?"visible":"none"),xe(),Fe(),Qe.value&&(kt.value||!C.value)&&(f.fitBounds(Qe.value,{padding:40,maxZoom:16,duration:0}),C.value=!0,kt.value=!1)},V=f=>{const D=vt;f.getLayer(_t)||f.addLayer({id:_t,type:"fill",source:st,paint:D.fill}),f.getLayer(Ct)||f.addLayer({id:Ct,type:"line",source:st,paint:D.line}),f.getLayer(St)||f.addLayer({id:St,type:"circle",source:st,paint:D.circle,filter:["==","$type","Point"]})},Q=f=>{[St,Ct,_t].forEach(D=>{f.getLayer(D)&&f.removeLayer(D)}),f.getSource(st)&&f.removeSource(st)},se=(f,D)=>{[St,Ct,_t].forEach(O=>{f.getLayer(O)&&f.setLayoutProperty(O,"visibility",D)})},xe=()=>{const f=u.value;if(!f||!f.isStyleLoaded())return;const D=vt;f.getLayer(_t)&&Object.entries(D.fill).forEach(([O,ee])=>{f.setPaintProperty(_t,O,ee)}),f.getLayer(Ct)&&Object.entries(D.line).forEach(([O,ee])=>{f.setPaintProperty(Ct,O,ee)}),f.getLayer(St)&&Object.entries(D.circle).forEach(([O,ee])=>{f.setPaintProperty(St,O,ee)})},Ke=f=>{f.getLayer(an)||f.addLayer({id:an,type:"line",source:xt,layout:{visibility:"visible"},paint:bt})},Fe=()=>{const f=u.value;if(!f)return;const D=Ot.value??{type:"FeatureCollection",features:[]};if(!f.getSource(xt)){f.addSource(xt,{type:"geojson",data:D}),Ke(f);return}const O=f.getSource(xt);O&&typeof O.setData=="function"&&O.setData(D),Ke(f)},Mt=f=>{f.getLayer(an)&&f.removeLayer(an),f.getSource(xt)&&f.removeSource(xt)},Ee=async f=>{const D=typeof f=="string"?f.trim():"",O=++nt;if(!D){We.value=null;return}try{const ee=await fetch(`https://data.gki.com.ua/api-user/atu/${D}`);if(nt!==O)return;if(!ee.ok){We.value=null;return}const ze=await ee.json();if(nt!==O)return;We.value=ze}catch{if(nt!==O)return;We.value=null}};e.watch(i,f=>{Ee(f)},{immediate:!0}),e.watch(Ot,()=>{Fe()},{immediate:!0}),e.watch(()=>n.geom,f=>{Xe.value=Io(f),Qe.value=fr(Xe.value),C.value=!1,kt.value=!0,S()},{deep:!0,immediate:!0}),e.watch(L,()=>{const f=u.value;f&&f.isStyleLoaded()&&se(f,L.value?"visible":"none")});const Ve=()=>{S(),Pe()},Xt=()=>{S()};e.watch(u,(f,D)=>{D&&(D.off("style.load",Ve),D.off("load",Ve),D.off("idle",Xt)),f&&(f.on("load",Ve),f.on("style.load",Ve),f.on("idle",Xt),Ve())}),e.watch(()=>n.center,f=>{!u.value||!Array.isArray(f)||f.length<2||b([f[0],f[1]])},{deep:!0}),e.watch(()=>n.zoom,f=>{!u.value||typeof f!="number"||N(f)}),e.onBeforeUnmount(()=>{ve.value&&y&&y(ve.value),U.value?h(U.value):u.value&&h(u.value);const f=u.value;f&&(Mt(f),f.off("style.load",Ve),f.off("load",Ve),f.off("idle",Xt))});function ou(f){f&&(q.value=f)}function su(f){L.value=f}p.setBasemap=ou,p.toggleGeometry=su,p.setOverlays?.(j.value);function Io(f){if(!f)return null;if(f.type==="FeatureCollection")return f;if(f.type==="Feature")return{type:"FeatureCollection",features:[f]};const D=f.geometry??f;if(!D?.type)return null;if(D.type==="GeometryCollection"&&Array.isArray(D.geometries)){const O=D.geometries.filter(ee=>ee&&typeof ee.type=="string").map(ee=>({type:"Feature",geometry:ee}));return O.length?{type:"FeatureCollection",features:O}:null}if(D.type==="MultiPoint"&&Array.isArray(D.coordinates)){const O=D.coordinates.filter(ee=>Array.isArray(ee)&&ee.length>=2).map(ee=>({type:"Feature",geometry:{type:"Point",coordinates:ee}}));return O.length?{type:"FeatureCollection",features:O}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:D}]}}function fr(f){if(!f?.features?.length)return null;let D=1/0,O=1/0,ee=-1/0,ze=-1/0;const Et=Qt=>{if(typeof Qt[0]=="number"){const[wt,ur]=Qt;D=Math.min(D,wt),O=Math.min(O,ur),ee=Math.max(ee,wt),ze=Math.max(ze,ur);return}Qt.forEach(wt=>Et(wt))};return f.features.forEach(Qt=>{const wt=Qt?.geometry?.coordinates;wt&&Et(wt)}),D===1/0||O===1/0?null:[D,O,ee,ze]}return(f,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(G.value),style:e.normalizeStyle(W.value?void 0:R.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:m,class:e.normalizeClass(J.value)},null,2),e.createVNode(xa,{items:A.value},null,8,["items"]),fe("search")?(e.openBlock(),e.createBlock(Ha,{key:0})):e.createCommentVNode("",!0),fe("home")||fe("fullscreen")?(e.openBlock(),e.createElementBlock("div",Ka,[fe("home")?(e.openBlock(),e.createElementBlock("div",Ga,[e.createVNode(Go,{center:P.value,zoom:le.value},null,8,["center","zoom"]),f.geom?(e.openBlock(),e.createBlock(Go,{key:0,"target-center":v.value,"target-zoom":n.zoom,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),fe("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:B,"aria-label":W.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},D[0]||(D[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),8,Za)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",Ja,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:x},D[1]||(D[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])),e.createElementVNode("div",Ya,e.toDisplayString(K.value.title||"Об'єкт"),1),K.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${R.value.height}-120px)]`]),innerHTML:K.value.html},null,10,Xa)):(e.openBlock(),e.createElementBlock("div",Qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value.rows,O=>(e.openBlock(),e.createElementBlock("div",{key:O.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",Va,e.toDisplayString(O.label)+":",1),e.createElementVNode("span",ec,e.toDisplayString(O.value),1)]))),128))])),K.value.actions?.length?(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value.actions,O=>(e.openBlock(),e.createElementBlock("a",{key:O.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:O.url,target:O.target??void 0,rel:"noreferrer"},e.toDisplayString(O.label),9,nc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Ea),fe("position")&&z.value?(e.openBlock(),e.createBlock(Sa,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:z.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});/**
|
|
142
142
|
* @vue/shared v3.5.18
|
|
143
143
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
144
144
|
* @license MIT
|
|
145
|
-
**//*! #__NO_SIDE_EFFECTS__ */function
|
|
145
|
+
**//*! #__NO_SIDE_EFFECTS__ */function Ge(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const sc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Un=()=>{},dn=()=>!1,qn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),rt=Object.assign,Ze=Array.isArray,ke=t=>typeof t=="string",Wn=t=>typeof t=="symbol",rc=t=>t!==null&&typeof t=="object",Zo=Ge(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ic=Ge("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Kn=t=>{const n=Object.create(null);return o=>n[o]||(n[o]=t(o))},lc=/-(\w)/g,it=Kn(t=>t.replace(lc,(n,o)=>o?o.toUpperCase():"")),Gn=Kn(t=>t.charAt(0).toUpperCase()+t.slice(1)),ac=Kn(t=>t?`on${Gn(t)}`:""),Pt={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},cc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},dc=/;(?![^(]*\))/g,pc=/:([^]+)/,fc=/\/\*[^]*?\*\//g;function uc(t){const n={};return t.replace(fc,"").split(dc).forEach(o=>{if(o){const s=o.split(pc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const mc="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",hc="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",gc="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",yc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",vc=Ge(mc),bc=Ge(hc),kc=Ge(gc),Ec=Ge(yc);/**
|
|
146
146
|
* @vue/compiler-core v3.5.18
|
|
147
147
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
148
148
|
* @license MIT
|
|
149
|
-
**/const Pt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Ft=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Gn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),pn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Jo=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),dt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Yo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),Xo=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Zn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Jn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),zt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),Yn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),Qo=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),eo=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),to=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),no=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),Vo=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),es=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),fn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),un=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),oo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),so=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),jt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Ht=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),ro=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),io=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),wc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),lo=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),mn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Nc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),xc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),ao=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),_c=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Cc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),co=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ts=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),_t={[Pt]:"Fragment",[Ft]:"Teleport",[Gn]:"Suspense",[pn]:"KeepAlive",[Jo]:"BaseTransition",[dt]:"openBlock",[Yo]:"createBlock",[Xo]:"createElementBlock",[Zn]:"createVNode",[Jn]:"createElementVNode",[zt]:"createCommentVNode",[Yn]:"createTextVNode",[Qo]:"createStaticVNode",[Xn]:"resolveComponent",[Qn]:"resolveDynamicComponent",[Vn]:"resolveDirective",[eo]:"resolveFilter",[to]:"withDirectives",[no]:"renderList",[Vo]:"renderSlot",[es]:"createSlots",[fn]:"toDisplayString",[un]:"mergeProps",[oo]:"normalizeClass",[so]:"normalizeStyle",[jt]:"normalizeProps",[Ht]:"guardReactiveProps",[ro]:"toHandlers",[io]:"camelize",[wc]:"capitalize",[lo]:"toHandlerKey",[mn]:"setBlockTracking",[Nc]:"pushScopeId",[xc]:"popScopeId",[ao]:"withCtx",[_c]:"unref",[Cc]:"isRef",[co]:"withMemo",[ts]:"isMemoSame"};function Sc(t){Object.getOwnPropertySymbols(t).forEach(n=>{_t[n]=t[n]})}const Me={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Bc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Me}}function Ut(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Me){return t&&(a?(t.helper(dt),t.helper(Bt(t.inSSR,d))):t.helper(St(t.inSSR,d)),i&&t.helper(to)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function pt(t,n=Me){return{type:17,loc:n,elements:t}}function ze(t,n=Me){return{type:15,loc:n,properties:t}}function fe(t,n){return{type:16,loc:Me,key:Ee(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Me,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function He(t,n=Me){return{type:8,loc:n,children:t}}function ve(t,n=[],o=Me){return{type:14,loc:o,callee:t,arguments:n}}function Ct(t,n=void 0,o=!1,s=!1,r=Me){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function po(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Me}}function Tc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Me}}function $c(t){return{type:21,body:t,loc:Me}}function St(t,n){return t||n?Zn:Jn}function Bt(t,n){return t||n?Yo:Xo}function fo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(St(s,t.isComponent)),n(dt),n(Bt(s,t.isComponent)))}const ns=new Uint8Array([123,123]),os=new Uint8Array([125,125]);function ss(t){return t>=97&&t<=122||t>=65&&t<=90}function Re(t){return t===32||t===10||t===9||t===12||t===13}function rt(t){return t===47||t===62||Re(t)}function hn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const Ne={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Lc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=ns,this.delimiterClose=os,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=ns,this.delimiterClose=os}getPos(n){let o=1,s=n+1;for(let r=this.newlines.length-1;r>=0;r--){const l=this.newlines[r];if(n>l){o=r+2,s=n-l;break}}return{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?rt(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Re(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===Ne.TitleEnd||this.currentSequence===Ne.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===Ne.Cdata[this.sequenceIndex]?++this.sequenceIndex===Ne.Cdata.length&&(this.state=28,this.currentSequence=Ne.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===Ne.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):ss(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){rt(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(rt(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(hn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Re(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=ss(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Re(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Re(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Re(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||rt(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||rt(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||rt(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||rt(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||rt(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Re(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Re(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Re(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=Ne.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===Ne.ScriptEnd[3]?this.startSpecial(Ne.ScriptEnd,4):n===Ne.StyleEnd[3]?this.startSpecial(Ne.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===Ne.TitleEnd[3]?this.startSpecial(Ne.TitleEnd,4):n===Ne.TextareaEnd[3]?this.startSpecial(Ne.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===Ne.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Ic={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function uo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function it(t,n){const o=uo("MODE",n),s=uo(t,n);return o===3?s===!0:s!==!1}function Tt(t,n,o,...s){const r=it(t,n);return process.env.NODE_ENV!=="production"&&r&&gn(t,n,o,...s),r}function gn(t,n,o,...s){if(uo(t,n)==="suppress-warning")return;const{message:l,link:i}=Ic[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
|
|
150
|
-
Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function
|
|
151
|
-
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""},$e=t=>t.type===4&&t.isStatic;function is(t){switch(t){case"Teleport":case"teleport":return Ft;case"Suspense":case"suspense":return Gn;case"KeepAlive":case"keep-alive":return pn;case"BaseTransition":case"base-transition":return Jo}}const Ac=/^$|^\d|[^\$\w\xA0-\uFFFF]/,ho=t=>!Ac.test(t),Oc=/[A-Za-z_$\xA0-\uFFFF]/,Mc=/[\.\?\w$\xA0-\uFFFF]/,Rc=/\s+[.[]\s*|\s*[.[]\s+/g,ls=t=>t.type===4?t.content:t.loc.source,as=t=>{const n=ls(t).trim().replace(Rc,a=>a.trim());let o=0,s=[],r=0,l=0,i=null;for(let a=0;a<n.length;a++){const c=n.charAt(a);switch(o){case 0:if(c==="[")s.push(o),o=1,r++;else if(c==="(")s.push(o),o=2,l++;else if(!(a===0?Oc:Mc).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,i=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,i=c;else if(c==="(")l++;else if(c===")"){if(a===n.length-1)return!1;--l||(o=s.pop())}break;case 3:c===i&&(o=s.pop(),i=null);break}}return!r&&!l},Pc=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Fc=t=>Pc.test(ls(t));function cs(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Le(t,n,o=!1){for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&(o||r.exp)&&(Ee(n)?r.name===n:n.test(r.name)))return r}}function qt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const l=t.props[r];if(l.type===6){if(o)continue;if(l.name===n&&(l.value||s))return l}else if(l.name==="bind"&&(l.exp||s)&<(l.arg,n))return l}}function lt(t,n){return!!(t&&$e(t)&&t.content===n)}function zc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function go(t){return t.type===5||t.type===2}function ds(t){return t.type===7&&t.name==="pre"}function jc(t){return t.type===7&&t.name==="slot"}function yn(t){return t.type===1&&t.tagType===3}function vn(t){return t.type===1&&t.tagType===2}const Hc=new Set([jt,Ht]);function ps(t,n=[]){if(t&&!Ee(t)&&t.type===14){const o=t.callee;if(!Ee(o)&&Hc.has(o))return ps(t.arguments[0],n.concat(t))}return[t,n]}function bn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!Ee(r)&&r.type===14){const a=ps(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||Ee(r))s=ze([n]);else if(r.type===14){const a=r.arguments[0];!Ee(a)&&a.type===15?fs(n,a)||a.properties.unshift(n):r.callee===ro?s=ve(o.helper(un),[ze([n]),r]):r.arguments.unshift(ze([n])),!s&&(s=r)}else r.type===15?(fs(n,r)||r.properties.unshift(n),s=r):(s=ve(o.helper(un),[ze([n]),r]),i&&i.callee===Ht&&(i=l[l.length-2]));t.type===13?i?i.arguments[0]=s:t.props=s:i?i.arguments[0]=s:t.arguments[2]=s}function fs(t,n){let o=!1;if(t.key.type===4){const s=t.key.content;o=n.properties.some(r=>r.key.type===4&&r.key.content===s)}return o}function Wt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function Uc(t){return t.type===14&&t.callee===co?t.arguments[1].returns:t}const qc=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,us={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:dn,isPreTag:dn,isIgnoreNewlineTag:dn,isCustomElement:dn,onError:mo,onWarn:rs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ne=us,Kt=null,Ve="",Ce=null,te=null,Ie="",et=-1,ft=-1,yo=0,at=!1,vo=null;const de=[],ie=new Lc(de,{onerr:De,ontext(t,n){kn(xe(t,n),t,n)},ontextentity(t,n,o){kn(t,n,o)},oninterpolation(t,n){if(at)return kn(xe(t,n),t,n);let o=t+ie.delimiterOpen.length,s=n-ie.delimiterClose.length;for(;Re(Ve.charCodeAt(o));)o++;for(;Re(Ve.charCodeAt(s-1));)s--;let r=xe(o,s);r.includes("&")&&(r=ne.decodeEntities(r,!1)),bo({type:5,content:wn(r,!1,he(o,s)),loc:he(t,n)})},onopentagname(t,n){const o=xe(t,n);Ce={type:1,tag:o,ns:ne.getNamespace(o,de[0],ne.ns),tagType:0,props:[],children:[],loc:he(t-1,n),codegenNode:void 0}},onopentagend(t){hs(t)},onclosetag(t,n){const o=xe(t,n);if(!ne.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&De(24,de[0].loc.start.offset);for(let i=0;i<=r;i++){const a=de.shift();En(a,n,i<r)}break}s||De(23,gs(t,60))}},onselfclosingtag(t){const n=Ce.tag;Ce.isSelfClosing=!0,hs(t),de[0]&&de[0].tag===n&&En(de.shift(),t)},onattribname(t,n){te={type:6,name:xe(t,n),nameLoc:he(t,n),value:void 0,loc:he(t)}},ondirname(t,n){const o=xe(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!at&&s===""&&De(26,t),at||s==="")te={type:6,name:o,nameLoc:he(t,n),value:void 0,loc:he(t)};else if(te={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:he(t)},s==="pre"){at=ie.inVPre=!0,vo=Ce;const r=Ce.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=td(r[l]))}},ondirarg(t,n){if(t===n)return;const o=xe(t,n);if(at&&!ds(te))te.name+=o,ut(te.nameLoc,n);else{const s=o[0]!=="[";te.arg=wn(s?o:o.slice(1,-1),s,he(t,n),s?3:0)}},ondirmodifier(t,n){const o=xe(t,n);if(at&&!ds(te))te.name+="."+o,ut(te.nameLoc,n);else if(te.name==="slot"){const s=te.arg;s&&(s.content+="."+o,ut(s.loc,n))}else{const s=Q(o,!0,he(t,n));te.modifiers.push(s)}},onattribdata(t,n){Ie+=xe(t,n),et<0&&(et=t),ft=n},onattribentity(t,n,o){Ie+=t,et<0&&(et=n),ft=o},onattribnameend(t){const n=te.loc.start.offset,o=xe(n,t);te.type===7&&(te.rawName=o),Ce.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&De(2,n)},onattribend(t,n){if(Ce&&te){if(ut(te.loc,n),t!==0)if(Ie.includes("&")&&(Ie=ne.decodeEntities(Ie,!0)),te.type===6)te.name==="class"&&(Ie=bs(Ie).trim()),t===1&&!Ie&&De(13,n),te.value={type:2,content:Ie,loc:t===1?he(et,ft):he(et-1,ft+1)},ie.inSFCRoot&&Ce.tag==="template"&&te.name==="lang"&&Ie&&Ie!=="html"&&ie.enterRCDATA(hn("</template"),0);else{let o=0;te.exp=wn(Ie,!1,he(et,ft),0,o),te.name==="for"&&(te.forParseResult=Kc(te.exp));let s=-1;te.name==="bind"&&(s=te.modifiers.findIndex(r=>r.content==="sync"))>-1&&Tt("COMPILER_V_BIND_SYNC",ne,te.loc,te.arg.loc.source)&&(te.name="model",te.modifiers.splice(s,1))}(te.type!==7||te.name!=="pre")&&Ce.props.push(te)}Ie="",et=ft=-1},oncomment(t,n){ne.comments&&bo({type:3,content:xe(t,n),loc:he(t-4,n+3)})},onend(){const t=Ve.length;if(process.env.NODE_ENV!=="production"&&ie.state!==1)switch(ie.state){case 5:case 8:De(5,t);break;case 3:case 4:De(25,ie.sectionStart);break;case 28:ie.currentSequence===Ne.CdataEnd?De(6,t):De(7,t);break;case 6:case 7:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:De(9,t);break}for(let n=0;n<de.length;n++)En(de[n],t-1),De(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?kn(xe(t,n),t,n):De(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:ne.ns)===0&&De(21,t-1)}}),ms=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Wc=/^\(|\)$/g;function Kc(t){const n=t.loc,o=t.content,s=o.match(qc);if(!s)return;const[,r,l]=s,i=(p,f,b=!1)=>{const N=n.start.offset+f,g=N+p.length;return wn(p,!1,he(N,g),0,b?1:0)},a={source:i(l.trim(),o.indexOf(l,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(Wc,"").trim();const d=r.indexOf(c),m=c.match(ms);if(m){c=c.replace(ms,"").trim();const p=m[1].trim();let f;if(p&&(f=o.indexOf(p,d+c.length),a.key=i(p,f,!0)),m[2]){const b=m[2].trim();b&&(a.index=i(b,o.indexOf(b,a.key?f+p.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function xe(t,n){return Ve.slice(t,n)}function hs(t){ie.inSFCRoot&&(Ce.innerLoc=he(t+1,t+1)),bo(Ce);const{tag:n,ns:o}=Ce;o===0&&ne.isPreTag(n)&&yo++,ne.isVoidTag(n)?En(Ce,t):(de.unshift(Ce),(o===1||o===2)&&(ie.inXML=!0)),Ce=null}function kn(t,n,o){{const l=de[0]&&de[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=ne.decodeEntities(t,!1))}const s=de[0]||Kt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,ut(r.loc,o)):s.children.push({type:2,content:t,loc:he(n,o)})}function En(t,n,o=!1){o?ut(t.loc,gs(n,60)):ut(t.loc,Gc(n,62)+1),ie.inSFCRoot&&(t.children.length?t.innerLoc.end=ot({},t.children[t.children.length-1].loc.end):t.innerLoc.end=ot({},t.innerLoc.start),t.innerLoc.source=xe(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(at||(s==="slot"?t.tagType=2:ys(t)?t.tagType=3:Jc(t)&&(t.tagType=1)),ie.inRCDATA||(t.children=vs(l)),r===0&&ne.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&ne.isPreTag(s)&&yo--,vo===t&&(at=ie.inVPre=!1,vo=null),ie.inXML&&(de[0]?de[0].ns:ne.ns)===0&&(ie.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&it("COMPILER_V_IF_V_FOR_PRECEDENCE",ne)){let c=!1,d=!1;for(let m=0;m<i.length;m++){const p=i[m];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){gn("COMPILER_V_IF_V_FOR_PRECEDENCE",ne,t.loc);break}}}if(!ie.inSFCRoot&&it("COMPILER_NATIVE_TEMPLATE",ne)&&t.tag==="template"&&!ys(t)){process.env.NODE_ENV!=="production"&&gn("COMPILER_NATIVE_TEMPLATE",ne,t.loc);const c=de[0]||Kt,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=i.find(c=>c.type===6&&c.name==="inline-template");a&&Tt("COMPILER_INLINE_TEMPLATE",ne,a.loc)&&t.children.length&&(a.value={type:2,content:xe(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function Gc(t,n){let o=t;for(;Ve.charCodeAt(o)!==n&&o<Ve.length-1;)o++;return o}function gs(t,n){let o=t;for(;Ve.charCodeAt(o)!==n&&o>=0;)o--;return o}const Zc=new Set(["if","else","else-if","for","slot"]);function ys({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&Zc.has(n[o].name))return!0}return!1}function Jc({tag:t,props:n}){if(ne.isCustomElement(t))return!1;if(t==="component"||Yc(t.charCodeAt(0))||is(t)||ne.isBuiltInComponent&&ne.isBuiltInComponent(t)||ne.isNativeTag&&!ne.isNativeTag(t))return!0;for(let o=0;o<n.length;o++){const s=n[o];if(s.type===6){if(s.name==="is"&&s.value){if(s.value.content.startsWith("vue:"))return!0;if(Tt("COMPILER_IS_ON_ELEMENT",ne,s.loc))return!0}}else if(s.name==="bind"&<(s.arg,"is")&&Tt("COMPILER_IS_ON_ELEMENT",ne,s.loc))return!0}return!1}function Yc(t){return t>64&&t<91}const Xc=/\r\n/g;function vs(t){const n=ne.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(yo)r.content=r.content.replace(Xc,`
|
|
152
|
-
`);else if(Qc(r.content)){const l=t[s-1]&&t[s-1].type,i=t[s+1]&&t[s+1].type;!l||!i||n&&(l===3&&(i===3||i===1)||l===1&&(i===3||i===1&&Vc(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=bs(r.content))}return o?t.filter(Boolean):t}function Qc(t){for(let n=0;n<t.length;n++)if(!Re(t.charCodeAt(n)))return!1;return!0}function Vc(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function bs(t){let n="",o=!1;for(let s=0;s<t.length;s++)Re(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function bo(t){(de[0]||Kt).children.push(t)}function he(t,n){return{start:ie.getPos(t),end:n==null?n:ie.getPos(n),source:n==null?n:xe(t,n)}}function ed(t){return he(t.start.offset,t.end.offset)}function ut(t,n){t.end=ie.getPos(n),t.source=xe(t.start.offset,n)}function td(t){const n={type:6,name:t.rawName,nameLoc:he(t.loc.start.offset,t.loc.start.offset+t.rawName.length),value:void 0,loc:t.loc};if(t.exp){const o=t.exp.loc;o.end.offset<t.loc.end.offset&&(o.start.offset--,o.start.column--,o.end.offset++,o.end.column++),n.value={type:2,content:t.exp.content,loc:o}}return n}function wn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function De(t,n,o){ne.onError(re(t,he(n,n),void 0,o))}function nd(){ie.reset(),Ce=null,te=null,Ie="",et=-1,ft=-1,de.length=0}function od(t,n){if(nd(),Ve=t,ne=ot({},us),n){let r;for(r in n)n[r]!=null&&(ne[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!ne.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");ie.mode=ne.parseMode==="html"?1:ne.parseMode==="sfc"?2:0,ie.inXML=ne.ns===1||ne.ns===2;const o=n&&n.delimiters;o&&(ie.delimiterOpen=hn(o[0]),ie.delimiterClose=hn(o[1]));const s=Kt=Bc([],t);return ie.parse(Ve),s.loc=he(0,t.length),s.children=vs(s.children),Kt=null,s}function sd(t,n){Nn(t,void 0,n,!!ks(t))}function ks(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!vn(n[0])?n[0]:null}function Nn(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let p=0;p<l.length;p++){const f=l[p];if(f.type===1&&f.tagType===0){const b=s?0:Pe(f,o);if(b>0){if(b>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const N=f.codegenNode;if(N.type===13){const g=N.patchFlag;if((g===void 0||g===512||g===1)&&ws(f,o)>=2){const k=Ns(f);k&&(N.props=o.hoist(k))}N.dynamicProps&&(N.dynamicProps=o.hoist(N.dynamicProps))}}}else if(f.type===12&&(s?0:Pe(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Rt[-1]} */`:"")),i.push(f);continue}if(f.type===1){const b=f.tagType===1;b&&o.scopes.vSlot++,Nn(f,t,o,!1,r),b&&o.scopes.vSlot--}else if(f.type===11)Nn(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let b=0;b<f.branches.length;b++)Nn(f.branches[b],t,o,f.branches[b].children.length===1,r)}let a=!1;const c=[];if(i.length===l.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Je(t.codegenNode.children))t.codegenNode.children=d(pt(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Je(t.codegenNode.children)&&t.codegenNode.children.type===15){const p=m(t.codegenNode,"default");p&&(c.push(o.cached.length),p.returns=d(pt(p.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Je(n.codegenNode.children)&&n.codegenNode.children.type===15){const p=Le(t,"slot",!0),f=p&&p.arg&&m(n.codegenNode,p.arg);f&&(c.push(o.cached.length),f.returns=d(pt(f.returns)),a=!0)}}if(!a)for(const p of i)c.push(o.cached.length),p.codegenNode=o.cache(p.codegenNode);c.length&&t.type===1&&t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Je(t.codegenNode.children)&&t.codegenNode.children.type===15&&t.codegenNode.children.properties.push(fe("__",Q(JSON.stringify(c),!1)));function d(p){const f=o.cache(p);return r&&o.hmr&&(f.needArraySpread=!0),f}function m(p,f){if(p.children&&!Je(p.children)&&p.children.type===15){const b=p.children.properties.find(N=>N.key===f||N.key.content===f);return b&&b.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function Pe(t,n){const{constantCache:o}=n;switch(t.type){case 1:if(t.tagType!==0)return 0;const s=o.get(t);if(s!==void 0)return s;const r=t.codegenNode;if(r.type!==13||r.isBlock&&t.tag!=="svg"&&t.tag!=="foreignObject"&&t.tag!=="math")return 0;if(r.patchFlag===void 0){let i=3;const a=ws(t,n);if(a===0)return o.set(t,0),0;a<i&&(i=a);for(let c=0;c<t.children.length;c++){const d=Pe(t.children[c],n);if(d===0)return o.set(t,0),0;d<i&&(i=d)}if(i>1)for(let c=0;c<t.props.length;c++){const d=t.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const m=Pe(d.exp,n);if(m===0)return o.set(t,0),0;m<i&&(i=m)}}if(r.isBlock){for(let c=0;c<t.props.length;c++)if(t.props[c].type===7)return o.set(t,0),0;n.removeHelper(dt),n.removeHelper(Bt(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(St(n.inSSR,r.isComponent))}return o.set(t,i),i}else return o.set(t,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return Pe(t.content,n);case 4:return t.constType;case 8:let l=3;for(let i=0;i<t.children.length;i++){const a=t.children[i];if(Ee(a)||qn(a))continue;const c=Pe(a,n);if(c===0)return 0;c<l&&(l=c)}return l;case 20:return 2;default:return process.env.NODE_ENV,0}}const rd=new Set([oo,so,jt,Ht]);function Es(t,n){if(t.type===14&&!Ee(t.callee)&&rd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Pe(o,n);if(o.type===14)return Es(o,n)}return 0}function ws(t,n){let o=3;const s=Ns(t);if(s&&s.type===15){const{properties:r}=s;for(let l=0;l<r.length;l++){const{key:i,value:a}=r[l],c=Pe(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Pe(a,n):a.type===14?d=Es(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Ns(t){const n=t.codegenNode;if(n.type===13)return n.props}function id(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Hn,isCustomElement:m=Hn,expressionPlugins:p=[],scopeId:f=null,slotted:b=!0,ssr:N=!1,inSSR:g=!1,ssrCssVars:k="",bindingMetadata:w=sc,inline:F=!1,isTS:T=!1,onError:E=mo,onWarn:y=rs,compatConfig:O}){const q=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),L={filename:n,selfName:q&&Kn(st(q[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:p,scopeId:f,slotted:b,ssr:N,inSSR:g,ssrCssVars:k,bindingMetadata:w,inline:F,isTS:T,onError:E,onWarn:y,compatConfig:O,root:t,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:t,childIndex:0,inVOnce:!1,helper(M){const W=L.helpers.get(M)||0;return L.helpers.set(M,W+1),M},removeHelper(M){const W=L.helpers.get(M);if(W){const G=W-1;G?L.helpers.set(M,G):L.helpers.delete(M)}},helperString(M){return`_${_t[L.helper(M)]}`},replaceNode(M){if(process.env.NODE_ENV!=="production"){if(!L.currentNode)throw new Error("Node being replaced is already removed.");if(!L.parent)throw new Error("Cannot replace root node.")}L.parent.children[L.childIndex]=L.currentNode=M},removeNode(M){if(process.env.NODE_ENV!=="production"&&!L.parent)throw new Error("Cannot remove root node.");const W=L.parent.children,G=M?W.indexOf(M):L.currentNode?L.childIndex:-1;if(process.env.NODE_ENV!=="production"&&G<0)throw new Error("node being removed is not a child of current parent");!M||M===L.currentNode?(L.currentNode=null,L.onNodeRemoved()):L.childIndex>G&&(L.childIndex--,L.onNodeRemoved()),L.parent.children.splice(G,1)},onNodeRemoved:Hn,addIdentifiers(M){},removeIdentifiers(M){},hoist(M){Ee(M)&&(M=Q(M)),L.hoists.push(M);const W=Q(`_hoisted_${L.hoists.length}`,!1,M.loc,2);return W.hoisted=M,W},cache(M,W=!1,G=!1){const J=Tc(L.cached.length,M,W,G);return L.cached.push(J),J}};return L.filters=new Set,L}function ld(t,n){const o=id(t,n);xn(t,o),n.hoistStatic&&sd(t,o),n.ssr||ad(t,o),t.helpers=new Set([...o.helpers.keys()]),t.components=[...o.components],t.directives=[...o.directives],t.imports=o.imports,t.hoists=o.hoists,t.temps=o.temps,t.cached=o.cached,t.transformed=!0,t.filters=[...o.filters]}function ad(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=ks(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&fo(l,n),t.codegenNode=l}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(l=>l.type!==3).length===1&&(r|=2048),t.codegenNode=Ut(n,o(Pt),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function cd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];Ee(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,xn(r,n))}}function xn(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let l=0;l<o.length;l++){const i=o[l](t,n);if(i&&(Je(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(zt);break;case 5:n.ssr||n.helper(fn);break;case 9:for(let l=0;l<t.branches.length;l++)xn(t.branches[l],n);break;case 10:case 11:case 1:case 0:cd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function xs(t,n){const o=Ee(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:l}=s;if(s.tagType===3&&l.some(jc))return;const i=[];for(let a=0;a<l.length;a++){const c=l[a];if(c.type===7&&o(c.name)){l.splice(a,1),a--;const d=n(s,c,r);d&&i.push(d)}}return i}}}const _n="/*@__PURE__*/",_s=t=>`${_t[t]}: _${_t[t]}`;function dd(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:l=null,optimizeImports:i=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:m=!1,isTS:p=!1,inSSR:f=!1}){const b={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:p,inSSR:f,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(g){return`_${_t[g]}`},push(g,k=-2,w){b.code+=g},indent(){N(++b.indentLevel)},deindent(g=!1){g?--b.indentLevel:N(--b.indentLevel)},newline(){N(b.indentLevel)}};function N(g){b.push(`
|
|
153
|
-
`+" ".repeat(g),0)}return b}function pd(t,n={}){const o=dd(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:l,indent:i,deindent:a,newline:c,scopeId:d,ssr:m}=o,p=Array.from(t.helpers),
|
|
154
|
-
`,-1),c())),t.components.length&&(
|
|
149
|
+
**/const Ft=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),zt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Zn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),pn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Jo=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),pt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Yo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),Xo=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Jn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Yn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),jt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),Qo=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),eo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),no=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),oo=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),Vo=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),es=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),fn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),un=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),so=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ro=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Ht=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),io=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),lo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),wc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),ao=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),mn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Nc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),xc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),co=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),_c=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Cc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),po=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ts=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Bt={[Ft]:"Fragment",[zt]:"Teleport",[Zn]:"Suspense",[pn]:"KeepAlive",[Jo]:"BaseTransition",[pt]:"openBlock",[Yo]:"createBlock",[Xo]:"createElementBlock",[Jn]:"createVNode",[Yn]:"createElementVNode",[jt]:"createCommentVNode",[Xn]:"createTextVNode",[Qo]:"createStaticVNode",[Qn]:"resolveComponent",[Vn]:"resolveDynamicComponent",[eo]:"resolveDirective",[to]:"resolveFilter",[no]:"withDirectives",[oo]:"renderList",[Vo]:"renderSlot",[es]:"createSlots",[fn]:"toDisplayString",[un]:"mergeProps",[so]:"normalizeClass",[ro]:"normalizeStyle",[Ht]:"normalizeProps",[Ut]:"guardReactiveProps",[io]:"toHandlers",[lo]:"camelize",[wc]:"capitalize",[ao]:"toHandlerKey",[mn]:"setBlockTracking",[Nc]:"pushScopeId",[xc]:"popScopeId",[co]:"withCtx",[_c]:"unref",[Cc]:"isRef",[po]:"withMemo",[ts]:"isMemoSame"};function Sc(t){Object.getOwnPropertySymbols(t).forEach(n=>{Bt[n]=t[n]})}const Oe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Bc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Oe}}function qt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Oe){return t&&(a?(t.helper(pt),t.helper(Lt(t.inSSR,d))):t.helper($t(t.inSSR,d)),i&&t.helper(no)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function ft(t,n=Oe){return{type:17,loc:n,elements:t}}function je(t,n=Oe){return{type:15,loc:n,properties:t}}function pe(t,n){return{type:16,loc:Oe,key:ke(t)?X(t,!0):t,value:n}}function X(t,n=!1,o=Oe,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function He(t,n=Oe){return{type:8,loc:n,children:t}}function ye(t,n=[],o=Oe){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Oe){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function fo(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Oe}}function Tc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Oe}}function $c(t){return{type:21,body:t,loc:Oe}}function $t(t,n){return t||n?Jn:Yn}function Lt(t,n){return t||n?Yo:Xo}function uo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o($t(s,t.isComponent)),n(pt),n(Lt(s,t.isComponent)))}const ns=new Uint8Array([123,123]),os=new Uint8Array([125,125]);function ss(t){return t>=97&&t<=122||t>=65&&t<=90}function Me(t){return t===32||t===10||t===9||t===12||t===13}function lt(t){return t===47||t===62||Me(t)}function hn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const we={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Lc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=ns,this.delimiterClose=os,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=ns,this.delimiterClose=os}getPos(n){let o=1,s=n+1;for(let r=this.newlines.length-1;r>=0;r--){const l=this.newlines[r];if(n>l){o=r+2,s=n-l;break}}return{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?lt(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Me(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===we.TitleEnd||this.currentSequence===we.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===we.Cdata[this.sequenceIndex]?++this.sequenceIndex===we.Cdata.length&&(this.state=28,this.currentSequence=we.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===we.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):ss(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){lt(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(lt(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(hn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Me(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=ss(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Me(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Me(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Me(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||lt(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||lt(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||lt(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||lt(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||lt(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Me(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Me(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Me(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=we.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===we.ScriptEnd[3]?this.startSpecial(we.ScriptEnd,4):n===we.StyleEnd[3]?this.startSpecial(we.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===we.TitleEnd[3]?this.startSpecial(we.TitleEnd,4):n===we.TextareaEnd[3]?this.startSpecial(we.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===we.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Ic={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function mo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function at(t,n){const o=mo("MODE",n),s=mo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=at(t,n);return process.env.NODE_ENV!=="production"&&r&&gn(t,n,o,...s),r}function gn(t,n,o,...s){if(mo(t,n)==="suppress-warning")return;const{message:l,link:i}=Ic[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
|
|
150
|
+
Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function ho(t){throw t}function rs(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function re(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||Dc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Dc={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '<' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:`Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",52:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
151
|
+
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""},$e=t=>t.type===4&&t.isStatic;function is(t){switch(t){case"Teleport":case"teleport":return zt;case"Suspense":case"suspense":return Zn;case"KeepAlive":case"keep-alive":return pn;case"BaseTransition":case"base-transition":return Jo}}const Ac=/^$|^\d|[^\$\w\xA0-\uFFFF]/,go=t=>!Ac.test(t),Oc=/[A-Za-z_$\xA0-\uFFFF]/,Mc=/[\.\?\w$\xA0-\uFFFF]/,Rc=/\s+[.[]\s*|\s*[.[]\s+/g,ls=t=>t.type===4?t.content:t.loc.source,as=t=>{const n=ls(t).trim().replace(Rc,a=>a.trim());let o=0,s=[],r=0,l=0,i=null;for(let a=0;a<n.length;a++){const c=n.charAt(a);switch(o){case 0:if(c==="[")s.push(o),o=1,r++;else if(c==="(")s.push(o),o=2,l++;else if(!(a===0?Oc:Mc).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,i=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,i=c;else if(c==="(")l++;else if(c===")"){if(a===n.length-1)return!1;--l||(o=s.pop())}break;case 3:c===i&&(o=s.pop(),i=null);break}}return!r&&!l},Pc=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Fc=t=>Pc.test(ls(t));function cs(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Le(t,n,o=!1){for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&(o||r.exp)&&(ke(n)?r.name===n:n.test(r.name)))return r}}function Wt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const l=t.props[r];if(l.type===6){if(o)continue;if(l.name===n&&(l.value||s))return l}else if(l.name==="bind"&&(l.exp||s)&&ct(l.arg,n))return l}}function ct(t,n){return!!(t&&$e(t)&&t.content===n)}function zc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function yo(t){return t.type===5||t.type===2}function ds(t){return t.type===7&&t.name==="pre"}function jc(t){return t.type===7&&t.name==="slot"}function yn(t){return t.type===1&&t.tagType===3}function vn(t){return t.type===1&&t.tagType===2}const Hc=new Set([Ht,Ut]);function ps(t,n=[]){if(t&&!ke(t)&&t.type===14){const o=t.callee;if(!ke(o)&&Hc.has(o))return ps(t.arguments[0],n.concat(t))}return[t,n]}function bn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!ke(r)&&r.type===14){const a=ps(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ke(r))s=je([n]);else if(r.type===14){const a=r.arguments[0];!ke(a)&&a.type===15?fs(n,a)||a.properties.unshift(n):r.callee===io?s=ye(o.helper(un),[je([n]),r]):r.arguments.unshift(je([n])),!s&&(s=r)}else r.type===15?(fs(n,r)||r.properties.unshift(n),s=r):(s=ye(o.helper(un),[je([n]),r]),i&&i.callee===Ut&&(i=l[l.length-2]));t.type===13?i?i.arguments[0]=s:t.props=s:i?i.arguments[0]=s:t.arguments[2]=s}function fs(t,n){let o=!1;if(t.key.type===4){const s=t.key.content;o=n.properties.some(r=>r.key.type===4&&r.key.content===s)}return o}function Kt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function Uc(t){return t.type===14&&t.callee===po?t.arguments[1].returns:t}const qc=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,us={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:dn,isPreTag:dn,isIgnoreNewlineTag:dn,isCustomElement:dn,onError:ho,onWarn:rs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ne=us,Gt=null,et="",Ce=null,te=null,Ie="",tt=-1,ut=-1,vo=0,dt=!1,bo=null;const de=[],ie=new Lc(de,{onerr:De,ontext(t,n){kn(Ne(t,n),t,n)},ontextentity(t,n,o){kn(t,n,o)},oninterpolation(t,n){if(dt)return kn(Ne(t,n),t,n);let o=t+ie.delimiterOpen.length,s=n-ie.delimiterClose.length;for(;Me(et.charCodeAt(o));)o++;for(;Me(et.charCodeAt(s-1));)s--;let r=Ne(o,s);r.includes("&")&&(r=ne.decodeEntities(r,!1)),ko({type:5,content:wn(r,!1,me(o,s)),loc:me(t,n)})},onopentagname(t,n){const o=Ne(t,n);Ce={type:1,tag:o,ns:ne.getNamespace(o,de[0],ne.ns),tagType:0,props:[],children:[],loc:me(t-1,n),codegenNode:void 0}},onopentagend(t){hs(t)},onclosetag(t,n){const o=Ne(t,n);if(!ne.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&De(24,de[0].loc.start.offset);for(let i=0;i<=r;i++){const a=de.shift();En(a,n,i<r)}break}s||De(23,gs(t,60))}},onselfclosingtag(t){const n=Ce.tag;Ce.isSelfClosing=!0,hs(t),de[0]&&de[0].tag===n&&En(de.shift(),t)},onattribname(t,n){te={type:6,name:Ne(t,n),nameLoc:me(t,n),value:void 0,loc:me(t)}},ondirname(t,n){const o=Ne(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!dt&&s===""&&De(26,t),dt||s==="")te={type:6,name:o,nameLoc:me(t,n),value:void 0,loc:me(t)};else if(te={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[X("prop")]:[],loc:me(t)},s==="pre"){dt=ie.inVPre=!0,bo=Ce;const r=Ce.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=td(r[l]))}},ondirarg(t,n){if(t===n)return;const o=Ne(t,n);if(dt&&!ds(te))te.name+=o,mt(te.nameLoc,n);else{const s=o[0]!=="[";te.arg=wn(s?o:o.slice(1,-1),s,me(t,n),s?3:0)}},ondirmodifier(t,n){const o=Ne(t,n);if(dt&&!ds(te))te.name+="."+o,mt(te.nameLoc,n);else if(te.name==="slot"){const s=te.arg;s&&(s.content+="."+o,mt(s.loc,n))}else{const s=X(o,!0,me(t,n));te.modifiers.push(s)}},onattribdata(t,n){Ie+=Ne(t,n),tt<0&&(tt=t),ut=n},onattribentity(t,n,o){Ie+=t,tt<0&&(tt=n),ut=o},onattribnameend(t){const n=te.loc.start.offset,o=Ne(n,t);te.type===7&&(te.rawName=o),Ce.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&De(2,n)},onattribend(t,n){if(Ce&&te){if(mt(te.loc,n),t!==0)if(Ie.includes("&")&&(Ie=ne.decodeEntities(Ie,!0)),te.type===6)te.name==="class"&&(Ie=bs(Ie).trim()),t===1&&!Ie&&De(13,n),te.value={type:2,content:Ie,loc:t===1?me(tt,ut):me(tt-1,ut+1)},ie.inSFCRoot&&Ce.tag==="template"&&te.name==="lang"&&Ie&&Ie!=="html"&&ie.enterRCDATA(hn("</template"),0);else{let o=0;te.exp=wn(Ie,!1,me(tt,ut),0,o),te.name==="for"&&(te.forParseResult=Kc(te.exp));let s=-1;te.name==="bind"&&(s=te.modifiers.findIndex(r=>r.content==="sync"))>-1&&It("COMPILER_V_BIND_SYNC",ne,te.loc,te.arg.loc.source)&&(te.name="model",te.modifiers.splice(s,1))}(te.type!==7||te.name!=="pre")&&Ce.props.push(te)}Ie="",tt=ut=-1},oncomment(t,n){ne.comments&&ko({type:3,content:Ne(t,n),loc:me(t-4,n+3)})},onend(){const t=et.length;if(process.env.NODE_ENV!=="production"&&ie.state!==1)switch(ie.state){case 5:case 8:De(5,t);break;case 3:case 4:De(25,ie.sectionStart);break;case 28:ie.currentSequence===we.CdataEnd?De(6,t):De(7,t);break;case 6:case 7:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:De(9,t);break}for(let n=0;n<de.length;n++)En(de[n],t-1),De(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?kn(Ne(t,n),t,n):De(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:ne.ns)===0&&De(21,t-1)}}),ms=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Wc=/^\(|\)$/g;function Kc(t){const n=t.loc,o=t.content,s=o.match(qc);if(!s)return;const[,r,l]=s,i=(p,u,b=!1)=>{const N=n.start.offset+u,g=N+p.length;return wn(p,!1,me(N,g),0,b?1:0)},a={source:i(l.trim(),o.indexOf(l,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(Wc,"").trim();const d=r.indexOf(c),m=c.match(ms);if(m){c=c.replace(ms,"").trim();const p=m[1].trim();let u;if(p&&(u=o.indexOf(p,d+c.length),a.key=i(p,u,!0)),m[2]){const b=m[2].trim();b&&(a.index=i(b,o.indexOf(b,a.key?u+p.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function Ne(t,n){return et.slice(t,n)}function hs(t){ie.inSFCRoot&&(Ce.innerLoc=me(t+1,t+1)),ko(Ce);const{tag:n,ns:o}=Ce;o===0&&ne.isPreTag(n)&&vo++,ne.isVoidTag(n)?En(Ce,t):(de.unshift(Ce),(o===1||o===2)&&(ie.inXML=!0)),Ce=null}function kn(t,n,o){{const l=de[0]&&de[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=ne.decodeEntities(t,!1))}const s=de[0]||Gt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,mt(r.loc,o)):s.children.push({type:2,content:t,loc:me(n,o)})}function En(t,n,o=!1){o?mt(t.loc,gs(n,60)):mt(t.loc,Gc(n,62)+1),ie.inSFCRoot&&(t.children.length?t.innerLoc.end=rt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=rt({},t.innerLoc.start),t.innerLoc.source=Ne(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(dt||(s==="slot"?t.tagType=2:ys(t)?t.tagType=3:Jc(t)&&(t.tagType=1)),ie.inRCDATA||(t.children=vs(l)),r===0&&ne.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&ne.isPreTag(s)&&vo--,bo===t&&(dt=ie.inVPre=!1,bo=null),ie.inXML&&(de[0]?de[0].ns:ne.ns)===0&&(ie.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&at("COMPILER_V_IF_V_FOR_PRECEDENCE",ne)){let c=!1,d=!1;for(let m=0;m<i.length;m++){const p=i[m];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){gn("COMPILER_V_IF_V_FOR_PRECEDENCE",ne,t.loc);break}}}if(!ie.inSFCRoot&&at("COMPILER_NATIVE_TEMPLATE",ne)&&t.tag==="template"&&!ys(t)){process.env.NODE_ENV!=="production"&&gn("COMPILER_NATIVE_TEMPLATE",ne,t.loc);const c=de[0]||Gt,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=i.find(c=>c.type===6&&c.name==="inline-template");a&&It("COMPILER_INLINE_TEMPLATE",ne,a.loc)&&t.children.length&&(a.value={type:2,content:Ne(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function Gc(t,n){let o=t;for(;et.charCodeAt(o)!==n&&o<et.length-1;)o++;return o}function gs(t,n){let o=t;for(;et.charCodeAt(o)!==n&&o>=0;)o--;return o}const Zc=new Set(["if","else","else-if","for","slot"]);function ys({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&Zc.has(n[o].name))return!0}return!1}function Jc({tag:t,props:n}){if(ne.isCustomElement(t))return!1;if(t==="component"||Yc(t.charCodeAt(0))||is(t)||ne.isBuiltInComponent&&ne.isBuiltInComponent(t)||ne.isNativeTag&&!ne.isNativeTag(t))return!0;for(let o=0;o<n.length;o++){const s=n[o];if(s.type===6){if(s.name==="is"&&s.value){if(s.value.content.startsWith("vue:"))return!0;if(It("COMPILER_IS_ON_ELEMENT",ne,s.loc))return!0}}else if(s.name==="bind"&&ct(s.arg,"is")&&It("COMPILER_IS_ON_ELEMENT",ne,s.loc))return!0}return!1}function Yc(t){return t>64&&t<91}const Xc=/\r\n/g;function vs(t){const n=ne.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(vo)r.content=r.content.replace(Xc,`
|
|
152
|
+
`);else if(Qc(r.content)){const l=t[s-1]&&t[s-1].type,i=t[s+1]&&t[s+1].type;!l||!i||n&&(l===3&&(i===3||i===1)||l===1&&(i===3||i===1&&Vc(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=bs(r.content))}return o?t.filter(Boolean):t}function Qc(t){for(let n=0;n<t.length;n++)if(!Me(t.charCodeAt(n)))return!1;return!0}function Vc(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function bs(t){let n="",o=!1;for(let s=0;s<t.length;s++)Me(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function ko(t){(de[0]||Gt).children.push(t)}function me(t,n){return{start:ie.getPos(t),end:n==null?n:ie.getPos(n),source:n==null?n:Ne(t,n)}}function ed(t){return me(t.start.offset,t.end.offset)}function mt(t,n){t.end=ie.getPos(n),t.source=Ne(t.start.offset,n)}function td(t){const n={type:6,name:t.rawName,nameLoc:me(t.loc.start.offset,t.loc.start.offset+t.rawName.length),value:void 0,loc:t.loc};if(t.exp){const o=t.exp.loc;o.end.offset<t.loc.end.offset&&(o.start.offset--,o.start.column--,o.end.offset++,o.end.column++),n.value={type:2,content:t.exp.content,loc:o}}return n}function wn(t,n=!1,o,s=0,r=0){return X(t,n,o,s)}function De(t,n,o){ne.onError(re(t,me(n,n),void 0,o))}function nd(){ie.reset(),Ce=null,te=null,Ie="",tt=-1,ut=-1,de.length=0}function od(t,n){if(nd(),et=t,ne=rt({},us),n){let r;for(r in n)n[r]!=null&&(ne[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!ne.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");ie.mode=ne.parseMode==="html"?1:ne.parseMode==="sfc"?2:0,ie.inXML=ne.ns===1||ne.ns===2;const o=n&&n.delimiters;o&&(ie.delimiterOpen=hn(o[0]),ie.delimiterClose=hn(o[1]));const s=Gt=Bc([],t);return ie.parse(et),s.loc=me(0,t.length),s.children=vs(s.children),Gt=null,s}function sd(t,n){Nn(t,void 0,n,!!ks(t))}function ks(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!vn(n[0])?n[0]:null}function Nn(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let p=0;p<l.length;p++){const u=l[p];if(u.type===1&&u.tagType===0){const b=s?0:Re(u,o);if(b>0){if(b>=2){u.codegenNode.patchFlag=-1,i.push(u);continue}}else{const N=u.codegenNode;if(N.type===13){const g=N.patchFlag;if((g===void 0||g===512||g===1)&&ws(u,o)>=2){const k=Ns(u);k&&(N.props=o.hoist(k))}N.dynamicProps&&(N.dynamicProps=o.hoist(N.dynamicProps))}}}else if(u.type===12&&(s?0:Re(u,o))>=2){u.codegenNode.type===14&&u.codegenNode.arguments.length>0&&u.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Pt[-1]} */`:"")),i.push(u);continue}if(u.type===1){const b=u.tagType===1;b&&o.scopes.vSlot++,Nn(u,t,o,!1,r),b&&o.scopes.vSlot--}else if(u.type===11)Nn(u,t,o,u.children.length===1,!0);else if(u.type===9)for(let b=0;b<u.branches.length;b++)Nn(u.branches[b],t,o,u.branches[b].children.length===1,r)}let a=!1;const c=[];if(i.length===l.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Ze(t.codegenNode.children))t.codegenNode.children=d(ft(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Ze(t.codegenNode.children)&&t.codegenNode.children.type===15){const p=m(t.codegenNode,"default");p&&(c.push(o.cached.length),p.returns=d(ft(p.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Ze(n.codegenNode.children)&&n.codegenNode.children.type===15){const p=Le(t,"slot",!0),u=p&&p.arg&&m(n.codegenNode,p.arg);u&&(c.push(o.cached.length),u.returns=d(ft(u.returns)),a=!0)}}if(!a)for(const p of i)c.push(o.cached.length),p.codegenNode=o.cache(p.codegenNode);c.length&&t.type===1&&t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Ze(t.codegenNode.children)&&t.codegenNode.children.type===15&&t.codegenNode.children.properties.push(pe("__",X(JSON.stringify(c),!1)));function d(p){const u=o.cache(p);return r&&o.hmr&&(u.needArraySpread=!0),u}function m(p,u){if(p.children&&!Ze(p.children)&&p.children.type===15){const b=p.children.properties.find(N=>N.key===u||N.key.content===u);return b&&b.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function Re(t,n){const{constantCache:o}=n;switch(t.type){case 1:if(t.tagType!==0)return 0;const s=o.get(t);if(s!==void 0)return s;const r=t.codegenNode;if(r.type!==13||r.isBlock&&t.tag!=="svg"&&t.tag!=="foreignObject"&&t.tag!=="math")return 0;if(r.patchFlag===void 0){let i=3;const a=ws(t,n);if(a===0)return o.set(t,0),0;a<i&&(i=a);for(let c=0;c<t.children.length;c++){const d=Re(t.children[c],n);if(d===0)return o.set(t,0),0;d<i&&(i=d)}if(i>1)for(let c=0;c<t.props.length;c++){const d=t.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const m=Re(d.exp,n);if(m===0)return o.set(t,0),0;m<i&&(i=m)}}if(r.isBlock){for(let c=0;c<t.props.length;c++)if(t.props[c].type===7)return o.set(t,0),0;n.removeHelper(pt),n.removeHelper(Lt(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper($t(n.inSSR,r.isComponent))}return o.set(t,i),i}else return o.set(t,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return Re(t.content,n);case 4:return t.constType;case 8:let l=3;for(let i=0;i<t.children.length;i++){const a=t.children[i];if(ke(a)||Wn(a))continue;const c=Re(a,n);if(c===0)return 0;c<l&&(l=c)}return l;case 20:return 2;default:return process.env.NODE_ENV,0}}const rd=new Set([so,ro,Ht,Ut]);function Es(t,n){if(t.type===14&&!ke(t.callee)&&rd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Re(o,n);if(o.type===14)return Es(o,n)}return 0}function ws(t,n){let o=3;const s=Ns(t);if(s&&s.type===15){const{properties:r}=s;for(let l=0;l<r.length;l++){const{key:i,value:a}=r[l],c=Re(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Re(a,n):a.type===14?d=Es(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Ns(t){const n=t.codegenNode;if(n.type===13)return n.props}function id(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Un,isCustomElement:m=Un,expressionPlugins:p=[],scopeId:u=null,slotted:b=!0,ssr:N=!1,inSSR:g=!1,ssrCssVars:k="",bindingMetadata:w=sc,inline:F=!1,isTS:T=!1,onError:E=ho,onWarn:y=rs,compatConfig:M}){const q=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),L={filename:n,selfName:q&&Gn(it(q[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:p,scopeId:u,slotted:b,ssr:N,inSSR:g,ssrCssVars:k,bindingMetadata:w,inline:F,isTS:T,onError:E,onWarn:y,compatConfig:M,root:t,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:t,childIndex:0,inVOnce:!1,helper(R){const W=L.helpers.get(R)||0;return L.helpers.set(R,W+1),R},removeHelper(R){const W=L.helpers.get(R);if(W){const G=W-1;G?L.helpers.set(R,G):L.helpers.delete(R)}},helperString(R){return`_${Bt[L.helper(R)]}`},replaceNode(R){if(process.env.NODE_ENV!=="production"){if(!L.currentNode)throw new Error("Node being replaced is already removed.");if(!L.parent)throw new Error("Cannot replace root node.")}L.parent.children[L.childIndex]=L.currentNode=R},removeNode(R){if(process.env.NODE_ENV!=="production"&&!L.parent)throw new Error("Cannot remove root node.");const W=L.parent.children,G=R?W.indexOf(R):L.currentNode?L.childIndex:-1;if(process.env.NODE_ENV!=="production"&&G<0)throw new Error("node being removed is not a child of current parent");!R||R===L.currentNode?(L.currentNode=null,L.onNodeRemoved()):L.childIndex>G&&(L.childIndex--,L.onNodeRemoved()),L.parent.children.splice(G,1)},onNodeRemoved:Un,addIdentifiers(R){},removeIdentifiers(R){},hoist(R){ke(R)&&(R=X(R)),L.hoists.push(R);const W=X(`_hoisted_${L.hoists.length}`,!1,R.loc,2);return W.hoisted=R,W},cache(R,W=!1,G=!1){const J=Tc(L.cached.length,R,W,G);return L.cached.push(J),J}};return L.filters=new Set,L}function ld(t,n){const o=id(t,n);xn(t,o),n.hoistStatic&&sd(t,o),n.ssr||ad(t,o),t.helpers=new Set([...o.helpers.keys()]),t.components=[...o.components],t.directives=[...o.directives],t.imports=o.imports,t.hoists=o.hoists,t.temps=o.temps,t.cached=o.cached,t.transformed=!0,t.filters=[...o.filters]}function ad(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=ks(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&uo(l,n),t.codegenNode=l}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(l=>l.type!==3).length===1&&(r|=2048),t.codegenNode=qt(n,o(Ft),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function cd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];ke(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,xn(r,n))}}function xn(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let l=0;l<o.length;l++){const i=o[l](t,n);if(i&&(Ze(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(jt);break;case 5:n.ssr||n.helper(fn);break;case 9:for(let l=0;l<t.branches.length;l++)xn(t.branches[l],n);break;case 10:case 11:case 1:case 0:cd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function xs(t,n){const o=ke(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:l}=s;if(s.tagType===3&&l.some(jc))return;const i=[];for(let a=0;a<l.length;a++){const c=l[a];if(c.type===7&&o(c.name)){l.splice(a,1),a--;const d=n(s,c,r);d&&i.push(d)}}return i}}}const _n="/*@__PURE__*/",_s=t=>`${Bt[t]}: _${Bt[t]}`;function dd(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:l=null,optimizeImports:i=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:m=!1,isTS:p=!1,inSSR:u=!1}){const b={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:p,inSSR:u,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(g){return`_${Bt[g]}`},push(g,k=-2,w){b.code+=g},indent(){N(++b.indentLevel)},deindent(g=!1){g?--b.indentLevel:N(--b.indentLevel)},newline(){N(b.indentLevel)}};function N(g){b.push(`
|
|
153
|
+
`+" ".repeat(g),0)}return b}function pd(t,n={}){const o=dd(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:l,indent:i,deindent:a,newline:c,scopeId:d,ssr:m}=o,p=Array.from(t.helpers),u=p.length>0,b=!l&&s!=="module";fd(t,o);const g=m?"ssrRender":"render",w=(m?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${g}(${w}) {`),i(),b&&(r("with (_ctx) {"),i(),u&&(r(`const { ${p.map(_s).join(", ")} } = _Vue
|
|
154
|
+
`,-1),c())),t.components.length&&(Eo(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(Eo(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),Eo(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let F=0;F<t.temps;F++)r(`${F>0?", ":""}_temp${F}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
|
|
155
155
|
`,0),c()),m||r("return "),t.codegenNode?Se(t.codegenNode,o):r("null"),b&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function fd(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:l,runtimeModuleName:i,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,m=Array.from(t.helpers);if(m.length>0&&(r(`const _Vue = ${d}
|
|
156
|
-
`,-1),t.hoists.length)){const p=[
|
|
157
|
-
`,-1)}ud(t.hoists,n),l(),r("return ")}function ko(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?eo:n==="component"?Xn:Vn);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Wt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function ud(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const l=t[r];l&&(o(`const _hoisted_${r+1} = `),Se(l,n),s())}n.pure=!1}function md(t){return Ee(t)||t.type===4||t.type===2||t.type===5||t.type===8}function Eo(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Je(s)||!md(s));n.push("["),o&&n.indent(),Gt(t,n,o),o&&n.deindent(),n.push("]")}function Gt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];Ee(a)?r(a,-3):Je(a)?Eo(a,n):Se(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Se(t,n){if(Ee(t)){n.push(t,-3);return}if(qn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&cs(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Se(t.codegenNode,n);break;case 2:hd(t,n);break;case 4:Cs(t,n);break;case 5:gd(t,n);break;case 12:Se(t.codegenNode,n);break;case 8:Ss(t,n);break;case 3:vd(t,n);break;case 13:bd(t,n);break;case 14:Ed(t,n);break;case 15:wd(t,n);break;case 17:Nd(t,n);break;case 18:xd(t,n);break;case 19:_d(t,n);break;case 20:Cd(t,n);break;case 21:Gt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return cs(!1,`unhandled codegen node type: ${t.type}`),t}}function hd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Cs(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function gd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(_n),o(`${s(fn)}(`),Se(t.content,n),o(")")}function Ss(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];Ee(s)?n.push(s,-3):Se(s,n)}}function yd(t,n){const{push:o}=n;if(t.type===8)o("["),Ss(t,n),o("]");else if(t.isStatic){const s=ho(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function vd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(_n),o(`${s(zt)}(${JSON.stringify(t.content)})`,-3,t)}function bd(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:p,disableTracking:f,isComponent:b}=t;let N;if(c)if(process.env.NODE_ENV!=="production")if(c<0)N=c+` /* ${Rt[c]} */`;else{const k=Object.keys(Rt).map(Number).filter(w=>w>0&&c&w).map(w=>Rt[w]).join(", ");N=c+` /* ${k} */`}else N=String(c);m&&o(s(to)+"("),p&&o(`(${s(dt)}(${f?"true":""}), `),r&&o(_n);const g=p?Bt(n.inSSR,b):St(n.inSSR,b);o(s(g)+"(",-2,t),Gt(kd([l,i,a,N,d]),n),o(")"),p&&o(")"),m&&(o(", "),Se(m,n),o(")"))}function kd(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Ed(t,n){const{push:o,helper:s,pure:r}=n,l=Ee(t.callee)?t.callee:s(t.callee);r&&o(_n),o(l+"(",-2,t),Gt(t.arguments,n),o(")")}function wd(t,n){const{push:o,indent:s,deindent:r,newline:l}=n,{properties:i}=t;if(!i.length){o("{}",-2,t);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:d,value:m}=i[c];yd(d,n),o(": "),Se(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Nd(t,n){Eo(t.elements,n)}function xd(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${_t[ao]}(`),o("(",-2,t),Je(l)?Gt(l,n):l&&Se(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Je(i)?Eo(i,n):Se(i,n)):a&&Se(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function _d(t,n){const{test:o,consequent:s,alternate:r,newline:l}=t,{push:i,indent:a,deindent:c,newline:d}=n;if(o.type===4){const p=!ho(o.content);p&&i("("),Cs(o,n),p&&i(")")}else i("("),Se(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Se(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,Se(r,n),m||n.indentLevel--,l&&c(!0)}function Cd(t,n){const{push:o,helper:s,indent:r,deindent:l,newline:i}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(mn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Se(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(mn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Sd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Bd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function mt(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(l){let i=l.message;const a=r.replace(Bd,"").match(Sd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(re(45,t.loc,void 0,i))}}const Td=(t,n)=>{if(t.type===5)t.content=wo(t.content,n);else if(t.type===1){const o=Le(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const l=r.exp,i=r.arg;l&&l.type===4&&!(r.name==="on"&&i)&&!(o&&i&&i.type===4&&i.content==="key")&&(r.exp=wo(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=wo(i,n))}}}};function wo(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&mt(t,n,o,s),t}const $d=xs(/^(if|else|else-if)$/,(t,n,o)=>Ld(t,n,o,(s,r,l)=>{const i=o.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const d=i[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(l)s.codegenNode=Ts(r,c,o);else{const d=Dd(s.codegenNode);d.alternate=Ts(r,c+s.branches.length-1,o)}}}));function Ld(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(re(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&mt(n.exp,o),n.name==="if"){const r=Bs(t,n),l={type:9,loc:ed(t.loc),branches:[r]};if(o.replaceNode(l),s)return s(l,r,!0)}else{const r=o.parent.children,l=[];let i=r.indexOf(t);for(;i-->=-1;){const a=r[i];if(a&&a.type===3){o.removeNode(a),process.env.NODE_ENV!=="production"&&l.unshift(a);continue}if(a&&a.type===2&&!a.content.trim().length){o.removeNode(a);continue}if(a&&a.type===9){n.name==="else-if"&&a.branches[a.branches.length-1].condition===void 0&&o.onError(re(30,t.loc)),o.removeNode();const c=Bs(t,n);if(process.env.NODE_ENV!=="production"&&l.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:p})=>{Id(p,m)&&o.onError(re(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);xn(c,o),d&&d(),o.currentNode=null}else o.onError(re(30,t.loc));break}}}function Bs(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Le(t,"for")?t.children:[t],userKey:qt(t,"key"),isTemplateIf:o}}function Ts(t,n,o){return t.condition?po(t.condition,$s(t,n,o),ve(o.helper(zt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):$s(t,n,o)}function $s(t,n,o){const{helper:s}=o,r=fe("key",Q(`${n}`,!1,Me,2)),{children:l}=t,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return bn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&l.filter(d=>d.type!==3).length===1&&(c|=2048),Ut(o,s(Pt),ze([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=Uc(c);return d.type===13&&fo(d,o),bn(d,r,o),c}}function Id(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function Dd(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Ad=(t,n,o)=>{const{modifiers:s,loc:r}=t,l=t.arg;let{exp:i}=t;if(i&&i.type===4&&!i.content.trim()&&(i=void 0),!i){if(l.type!==4||!l.isStatic)return o.onError(re(52,l.loc)),{props:[fe(l,Q("",!0,r))]};Ls(t),i=t.exp}return l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=st(l.content):l.content=`${o.helperString(io)}(${l.content})`:(l.children.unshift(`${o.helperString(io)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Is(l,"."),s.some(a=>a.content==="attr")&&Is(l,"^")),{props:[fe(l,i)]}},Ls=(t,n)=>{const o=t.arg,s=st(o.content);t.exp=Q(s,!1,o.loc)},Is=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},Od=xs("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Md(t,n,o,l=>{const i=ve(s(no),[l.source]),a=yn(t),c=Le(t,"memo"),d=qt(t,"key",!1,!0);d&&d.type===7&&!d.exp&&Ls(d);let p=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const f=d&&p?fe("key",p):null,b=l.source.type===4&&l.source.constType>0,N=b?64:d?128:256;return l.codegenNode=Ut(o,s(Pt),void 0,i,N,void 0,void 0,!0,!b,!1,t.loc),()=>{let g;const{children:k}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(T=>{if(T.type===1){const E=qt(T,"key");if(E)return o.onError(re(33,E.loc)),!0}});const w=k.length!==1||k[0].type!==1,F=vn(t)?t:a&&t.children.length===1&&vn(t.children[0])?t.children[0]:null;if(F?(g=F.codegenNode,a&&f&&bn(g,f,o)):w?g=Ut(o,s(Pt),f?ze([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(g=k[0].codegenNode,a&&f&&bn(g,f,o),g.isBlock!==!b&&(g.isBlock?(r(dt),r(Bt(o.inSSR,g.isComponent))):r(St(o.inSSR,g.isComponent))),g.isBlock=!b,g.isBlock?(s(dt),s(Bt(o.inSSR,g.isComponent))):s(St(o.inSSR,g.isComponent))),c){const T=Ct(No(l.parseResult,[Q("_cached")]));T.body=$c([He(["const _memo = (",c.exp,")"]),He(["if (_cached",...p?[" && _cached.key === ",p]:[],` && ${o.helperString(ts)}(_cached, _memo)) return _cached`]),He(["const _item = ",g]),Q("_item.memo = _memo"),Q("return _item")]),i.arguments.push(T,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Ct(No(l.parseResult),g,!0))}})});function Md(t,n,o,s){if(!n.exp){o.onError(re(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(re(32,n.loc));return}Ds(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:p}=r,f={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:p,parseResult:r,children:yn(t)?t.children:[t]};o.replaceNode(f),a.vFor++;const b=s&&s(f);return()=>{a.vFor--,b&&b()}}function Ds(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(mt(t.source,n),t.key&&mt(t.key,n,!0),t.index&&mt(t.index,n,!0),t.value&&mt(t.value,n,!0)),t.finalized=!0)}function No({value:t,key:n,index:o},s=[]){return Rd([t,n,o,...s])}function Rd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||Q("_".repeat(s+1),!1))}const As=Q("undefined",!1),Pd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Le(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Fd=(t,n,o,s)=>Ct(t,o,!1,!0,o.length?o[0].loc:s);function zd(t,n,o=Fd){n.helper(ao);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Le(t,"slot",!0);if(c){const{arg:k,exp:w}=c;k&&!$e(k)&&(a=!0),l.push(fe(k||Q("default",!0),o(w,void 0,s,r)))}let d=!1,m=!1;const p=[],f=new Set;let b=0;for(let k=0;k<s.length;k++){const w=s[k];let F;if(!yn(w)||!(F=Le(w,"slot",!0))){w.type!==3&&p.push(w);continue}if(c){n.onError(re(37,F.loc));break}d=!0;const{children:T,loc:E}=w,{arg:y=Q("default",!0),exp:O,loc:q}=F;let L;$e(y)?L=y?y.content:"default":a=!0;const M=Le(w,"for"),W=o(O,M,T,E);let G,J;if(G=Le(w,"if"))a=!0,i.push(po(G.exp,Cn(y,W,b++),As));else if(J=Le(w,/^else(-if)?$/,!0)){let K=k,x;for(;K--&&(x=s[K],!(x.type!==3&&xo(x))););if(x&&yn(x)&&Le(x,/^(else-)?if$/)){let I=i[i.length-1];for(;I.alternate.type===19;)I=I.alternate;I.alternate=J.exp?po(J.exp,Cn(y,W,b++),As):Cn(y,W,b++)}else n.onError(re(30,J.loc))}else if(M){a=!0;const K=M.forParseResult;K?(Ds(K,n),i.push(ve(n.helper(no),[K.source,Ct(No(K),Cn(y,W),!0)]))):n.onError(re(32,M.loc))}else{if(L){if(f.has(L)){n.onError(re(38,q));continue}f.add(L),L==="default"&&(m=!0)}l.push(fe(y,W))}}if(!c){const k=(w,F)=>{const T=o(w,void 0,F,r);return n.compatConfig&&(T.isNonScopedSlot=!0),fe("default",T)};d?p.length&&p.some(w=>xo(w))&&(m?n.onError(re(39,p[0].loc)):l.push(k(void 0,p))):l.push(k(void 0,s))}const N=a?2:Sn(t.children)?3:1;let g=ze(l.concat(fe("_",Q(N+(process.env.NODE_ENV!=="production"?` /* ${cc[N]} */`:""),!1))),r);return i.length&&(g=ve(n.helper(es),[g,pt(i)])),{slots:g,hasDynamicSlots:a}}function Cn(t,n,o){const s=[fe("name",t),fe("fn",n)];return o!=null&&s.push(fe("key",Q(String(o),!0))),ze(s)}function Sn(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Sn(o.children))return!0;break;case 9:if(Sn(o.branches))return!0;break;case 10:case 11:if(Sn(o.children))return!0;break}}return!1}function xo(t){return t.type!==2&&t.type!==12?!0:t.type===2?!!t.content.trim():xo(t.content)}const Os=new WeakMap,jd=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,l=t.tagType===1;let i=l?Hd(t,n):`"${s}"`;const a=rc(i)&&i.callee===Qn;let c,d,m=0,p,f,b,N=a||i===Ft||i===Gn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const g=Ms(t,n,void 0,l,a);c=g.props,m=g.patchFlag,f=g.dynamicPropNames;const k=g.directives;b=k&&k.length?pt(k.map(w=>qd(w,n))):void 0,g.shouldUseBlock&&(N=!0)}if(t.children.length>0)if(i===pn&&(N=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(re(46,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),l&&i!==Ft&&i!==pn){const{slots:k,hasDynamicSlots:w}=zd(t,n);d=k,w&&(m|=1024)}else if(t.children.length===1&&i!==Ft){const k=t.children[0],w=k.type,F=w===5||w===8;F&&Pe(k,n)===0&&(m|=1),F||w===2?d=k:d=t.children}else d=t.children;f&&f.length&&(p=Wd(f)),t.codegenNode=Ut(n,i,c,d,m===0?void 0:m,p,b,!!N,!1,l,t.loc)};function Hd(t,n,o=!1){let{tag:s}=t;const r=_o(s),l=qt(t,"is",!1,!0);if(l)if(r||it("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&Q(l.value.content,!0):(a=l.exp,a||(a=Q("is",!1,l.arg.loc))),a)return ve(n.helper(Qn),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=is(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(Xn),n.components.add(s),Wt(s,"component"))}function Ms(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],p=[],f=c.length>0;let b=!1,N=0,g=!1,k=!1,w=!1,F=!1,T=!1,E=!1;const y=[],O=W=>{d.length&&(m.push(ze(Rs(d),a)),d=[]),W&&m.push(W)},q=()=>{n.scopes.vFor>0&&d.push(fe(Q("ref_for",!0),Q("true")))},L=({key:W,value:G})=>{if($e(W)){const J=W.content,K=Un(J);if(K&&(!s||r)&&J.toLowerCase()!=="onclick"&&J!=="onUpdate:modelValue"&&!Zo(J)&&(F=!0),K&&Zo(J)&&(E=!0),K&&G.type===14&&(G=G.arguments[0]),G.type===20||(G.type===4||G.type===8)&&Pe(G,n)>0)return;J==="ref"?g=!0:J==="class"?k=!0:J==="style"?w=!0:J!=="key"&&!y.includes(J)&&y.push(J),s&&(J==="class"||J==="style")&&!y.includes(J)&&y.push(J)}else T=!0};for(let W=0;W<o.length;W++){const G=o[W];if(G.type===6){const{loc:J,name:K,nameLoc:x,value:I}=G;let _=!0;if(K==="ref"&&(g=!0,q()),K==="is"&&(_o(i)||I&&I.content.startsWith("vue:")||it("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(fe(Q(K,!0,x),Q(I?I.content:"",_,I?I.loc:J)))}else{const{name:J,arg:K,exp:x,loc:I,modifiers:_}=G,P=J==="bind",le=J==="on";if(J==="slot"){s||n.onError(re(40,I));continue}if(J==="once"||J==="memo"||J==="is"||P&<(K,"is")&&(_o(i)||it("COMPILER_IS_ON_ELEMENT",n))||le&&l)continue;if((P&<(K,"key")||le&&f&<(K,"vue:before-update"))&&(b=!0),P&<(K,"ref")&&q(),!K&&(P||le)){if(T=!0,x)if(P){if(O(),process.env.NODE_ENV!=="production"&&m.some(ue=>ue.type===15?ue.properties.some(({key:be})=>be.type!==4||!be.isStatic?!0:be.content!=="class"&&be.content!=="style"&&!Un(be.content)):!0)&&Tt("COMPILER_V_BIND_OBJECT_ORDER",n,I),it("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(x);continue}q(),O(),m.push(x)}else O({type:14,loc:I,callee:n.helper(ro),arguments:s?[x]:[x,"true"]});else n.onError(re(P?34:35,I));continue}P&&_.some(Te=>Te.content==="prop")&&(N|=32);const Ae=n.directiveTransforms[J];if(Ae){const{props:Te,needRuntime:ue}=Ae(G,t,n);!l&&Te.forEach(L),le&&K&&!$e(K)?O(ze(Te,a)):d.push(...Te),ue&&(p.push(G),qn(ue)&&Os.set(G,ue))}else ic(J)||(p.push(G),f&&(b=!0))}}let M;if(m.length?(O(),m.length>1?M=ve(n.helper(un),m,a):M=m[0]):d.length&&(M=ze(Rs(d),a)),T?N|=16:(k&&!s&&(N|=2),w&&!s&&(N|=4),y.length&&(N|=8),F&&(N|=32)),!b&&(N===0||N===32)&&(g||E||p.length>0)&&(N|=512),!n.inSSR&&M)switch(M.type){case 15:let W=-1,G=-1,J=!1;for(let I=0;I<M.properties.length;I++){const _=M.properties[I].key;$e(_)?_.content==="class"?W=I:_.content==="style"&&(G=I):_.isHandlerKey||(J=!0)}const K=M.properties[W],x=M.properties[G];J?M=ve(n.helper(jt),[M]):(K&&!$e(K.value)&&(K.value=ve(n.helper(oo),[K.value])),x&&(w||x.value.type===4&&x.value.content.trim()[0]==="["||x.value.type===17)&&(x.value=ve(n.helper(so),[x.value])));break;case 14:break;default:M=ve(n.helper(jt),[ve(n.helper(Ht),[M])]);break}return{props:M,directives:p,patchFlag:N,dynamicPropNames:y,shouldUseBlock:b}}function Rs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const l=r.key.content,i=n.get(l);i?(l==="style"||l==="class"||Un(l))&&Ud(i,r):(n.set(l,r),o.push(r))}return o}function Ud(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=pt([t.value,n.value],t.loc)}function qd(t,n){const o=[],s=Os.get(t);s?o.push(n.helperString(s)):(n.helper(Vn),n.directives.add(t.name),o.push(Wt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const l=Q("true",!1,r);o.push(ze(t.modifiers.map(i=>fe(i,l)),r))}return pt(o,t.loc)}function Wd(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function _o(t){return t==="component"||t==="Component"}const Kd=(t,n)=>{if(vn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=Gd(t,n),i=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),o.length&&(i[3]=Ct([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),i.splice(a),t.codegenNode=ve(n.helper(Vo),i,s)}};function Gd(t,n){let o='"default"',s;const r=[];for(let l=0;l<t.props.length;l++){const i=t.props[l];if(i.type===6)i.value&&(i.name==="name"?o=JSON.stringify(i.value.content):(i.name=st(i.name),r.push(i)));else if(i.name==="bind"&<(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=st(i.arg.content);o=i.exp=Q(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&$e(i.arg)&&(i.arg.content=st(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Ms(t,n,r,!1,!1);s=l,i.length&&n.onError(re(36,i[0].loc))}return{slotName:o,slotProps:s}}const Ps=(t,n,o,s)=>{const{loc:r,modifiers:l,arg:i}=t;!t.exp&&!l.length&&o.onError(re(35,r));let a;if(i.type===4)if(i.isStatic){let p=i.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&o.onError(re(51,i.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const f=n.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?ac(st(p)):`on:${p}`;a=Q(f,!0,i.loc)}else a=He([`${o.helperString(lo)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(lo)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const p=as(c),f=!(p||Fc(c)),b=c.content.includes(";");process.env.NODE_ENV!=="production"&&mt(c,o,!1,b),(f||d&&p)&&(c=He([`${f?"$event":"(...args)"} => ${b?"{":"("}`,c,b?"}":")"]))}let m={props:[fe(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(p=>p.key.isHandlerKey=!0),m},Zd=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let l=0;l<o.length;l++){const i=o[l];if(go(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(go(c))s||(s=o[l]=He([i],i.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(l=>l.type===7&&!n.directiveTransforms[l.name])&&t.tag!=="template")))for(let l=0;l<o.length;l++){const i=o[l];if(go(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&Pe(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Rt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ve(n.helper(Yn),a)}}}}},Fs=new WeakSet,Jd=(t,n)=>{if(t.type===1&&Le(t,"once",!0))return Fs.has(t)||n.inVOnce||n.inSSR?void 0:(Fs.add(t),n.inVOnce=!0,n.helper(mn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},zs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(re(41,t.loc)),Bn();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=o.bindingMetadata[l];if(a==="props"||a==="props-aliased")return o.onError(re(44,s.loc)),Bn();if(!i.trim()||!as(s))return o.onError(re(42,s.loc)),Bn();const c=r||Q("modelValue",!0),d=r?$e(r)?`onUpdate:${st(r.content)}`:He(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const p=o.isTS?"($event: any)":"$event";m=He([`${p} => ((`,s,") = $event)"]);const f=[fe(c,t.exp),fe(d,m)];if(t.modifiers.length&&n.tagType===1){const b=t.modifiers.map(g=>g.content).map(g=>(ho(g)?g:JSON.stringify(g))+": true").join(", "),N=r?$e(r)?`${r.content}Modifiers`:He([r,' + "Modifiers"']):"modelModifiers";f.push(fe(N,Q(`{ ${b} }`,!1,t.loc,2)))}return Bn(f)};function Bn(t=[]){return{props:t}}const Yd=/[\w).+\-_$\]]/,Xd=(t,n)=>{it("COMPILER_FILTERS",n)&&(t.type===5?Tn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Tn(o.exp,n)}))};function Tn(t,n){if(t.type===4)js(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?js(s,n):s.type===8?Tn(t,n):s.type===5&&Tn(s.content,n))}}function js(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,p,f,b,N,g=[];for(b=0;b<o.length;b++)if(f=p,p=o.charCodeAt(b),s)p===39&&f!==92&&(s=!1);else if(r)p===34&&f!==92&&(r=!1);else if(l)p===96&&f!==92&&(l=!1);else if(i)p===47&&f!==92&&(i=!1);else if(p===124&&o.charCodeAt(b+1)!==124&&o.charCodeAt(b-1)!==124&&!a&&!c&&!d)N===void 0?(m=b+1,N=o.slice(0,b).trim()):k();else{switch(p){case 34:r=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(p===47){let w=b-1,F;for(;w>=0&&(F=o.charAt(w),F===" ");w--);(!F||!Yd.test(F))&&(i=!0)}}N===void 0?N=o.slice(0,b).trim():m!==0&&k();function k(){g.push(o.slice(m,b).trim()),m=b+1}if(g.length){for(process.env.NODE_ENV!=="production"&&gn("COMPILER_FILTERS",n,t.loc),b=0;b<g.length;b++)N=Qd(N,g[b],n);t.content=N,t.ast=void 0}}function Qd(t,n,o){o.helper(eo);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Wt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Wt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Hs=new WeakSet,Vd=(t,n)=>{if(t.type===1){const o=Le(t,"memo");return!o||Hs.has(t)?void 0:(Hs.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&fo(s,n),t.codegenNode=ve(n.helper(co),[o.exp,Ct(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}};function ep(t){return[[Jd,$d,Vd,Od,Xd,...process.env.NODE_ENV!=="production"?[Td]:[],Kd,jd,Pd,Zd],{on:Ps,bind:Ad,model:zs}]}function tp(t,n={}){const o=n.onError||mo,s=n.mode==="module";n.prefixIdentifiers===!0?o(re(47)):s&&o(re(48));const r=!1;n.cacheHandlers&&o(re(49)),n.scopeId&&!s&&o(re(50));const l=ot({},n,{prefixIdentifiers:r}),i=Ee(t)?od(t,l):t,[a,c]=ep();return ld(i,ot({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:ot({},c,n.directiveTransforms||{})})),pd(i,l)}const np=()=>({props:[]});/**
|
|
156
|
+
`,-1),t.hoists.length)){const p=[Jn,Yn,jt,Xn,Qo].filter(u=>m.includes(u)).map(_s).join(", ");r(`const { ${p} } = _Vue
|
|
157
|
+
`,-1)}ud(t.hoists,n),l(),r("return ")}function Eo(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?to:n==="component"?Qn:eo);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Kt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function ud(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const l=t[r];l&&(o(`const _hoisted_${r+1} = `),Se(l,n),s())}n.pure=!1}function md(t){return ke(t)||t.type===4||t.type===2||t.type===5||t.type===8}function wo(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Ze(s)||!md(s));n.push("["),o&&n.indent(),Zt(t,n,o),o&&n.deindent(),n.push("]")}function Zt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ke(a)?r(a,-3):Ze(a)?wo(a,n):Se(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Se(t,n){if(ke(t)){n.push(t,-3);return}if(Wn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&cs(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Se(t.codegenNode,n);break;case 2:hd(t,n);break;case 4:Cs(t,n);break;case 5:gd(t,n);break;case 12:Se(t.codegenNode,n);break;case 8:Ss(t,n);break;case 3:vd(t,n);break;case 13:bd(t,n);break;case 14:Ed(t,n);break;case 15:wd(t,n);break;case 17:Nd(t,n);break;case 18:xd(t,n);break;case 19:_d(t,n);break;case 20:Cd(t,n);break;case 21:Zt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return cs(!1,`unhandled codegen node type: ${t.type}`),t}}function hd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Cs(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function gd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(_n),o(`${s(fn)}(`),Se(t.content,n),o(")")}function Ss(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ke(s)?n.push(s,-3):Se(s,n)}}function yd(t,n){const{push:o}=n;if(t.type===8)o("["),Ss(t,n),o("]");else if(t.isStatic){const s=go(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function vd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(_n),o(`${s(jt)}(${JSON.stringify(t.content)})`,-3,t)}function bd(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:p,disableTracking:u,isComponent:b}=t;let N;if(c)if(process.env.NODE_ENV!=="production")if(c<0)N=c+` /* ${Pt[c]} */`;else{const k=Object.keys(Pt).map(Number).filter(w=>w>0&&c&w).map(w=>Pt[w]).join(", ");N=c+` /* ${k} */`}else N=String(c);m&&o(s(no)+"("),p&&o(`(${s(pt)}(${u?"true":""}), `),r&&o(_n);const g=p?Lt(n.inSSR,b):$t(n.inSSR,b);o(s(g)+"(",-2,t),Zt(kd([l,i,a,N,d]),n),o(")"),p&&o(")"),m&&(o(", "),Se(m,n),o(")"))}function kd(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Ed(t,n){const{push:o,helper:s,pure:r}=n,l=ke(t.callee)?t.callee:s(t.callee);r&&o(_n),o(l+"(",-2,t),Zt(t.arguments,n),o(")")}function wd(t,n){const{push:o,indent:s,deindent:r,newline:l}=n,{properties:i}=t;if(!i.length){o("{}",-2,t);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:d,value:m}=i[c];yd(d,n),o(": "),Se(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Nd(t,n){wo(t.elements,n)}function xd(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${Bt[co]}(`),o("(",-2,t),Ze(l)?Zt(l,n):l&&Se(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Ze(i)?wo(i,n):Se(i,n)):a&&Se(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function _d(t,n){const{test:o,consequent:s,alternate:r,newline:l}=t,{push:i,indent:a,deindent:c,newline:d}=n;if(o.type===4){const p=!go(o.content);p&&i("("),Cs(o,n),p&&i(")")}else i("("),Se(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Se(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,Se(r,n),m||n.indentLevel--,l&&c(!0)}function Cd(t,n){const{push:o,helper:s,indent:r,deindent:l,newline:i}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(mn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Se(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(mn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Sd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Bd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function ht(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(l){let i=l.message;const a=r.replace(Bd,"").match(Sd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(re(45,t.loc,void 0,i))}}const Td=(t,n)=>{if(t.type===5)t.content=No(t.content,n);else if(t.type===1){const o=Le(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const l=r.exp,i=r.arg;l&&l.type===4&&!(r.name==="on"&&i)&&!(o&&i&&i.type===4&&i.content==="key")&&(r.exp=No(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=No(i,n))}}}};function No(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&ht(t,n,o,s),t}const $d=xs(/^(if|else|else-if)$/,(t,n,o)=>Ld(t,n,o,(s,r,l)=>{const i=o.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const d=i[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(l)s.codegenNode=Ts(r,c,o);else{const d=Dd(s.codegenNode);d.alternate=Ts(r,c+s.branches.length-1,o)}}}));function Ld(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(re(28,n.loc)),n.exp=X("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&ht(n.exp,o),n.name==="if"){const r=Bs(t,n),l={type:9,loc:ed(t.loc),branches:[r]};if(o.replaceNode(l),s)return s(l,r,!0)}else{const r=o.parent.children,l=[];let i=r.indexOf(t);for(;i-->=-1;){const a=r[i];if(a&&a.type===3){o.removeNode(a),process.env.NODE_ENV!=="production"&&l.unshift(a);continue}if(a&&a.type===2&&!a.content.trim().length){o.removeNode(a);continue}if(a&&a.type===9){n.name==="else-if"&&a.branches[a.branches.length-1].condition===void 0&&o.onError(re(30,t.loc)),o.removeNode();const c=Bs(t,n);if(process.env.NODE_ENV!=="production"&&l.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:p})=>{Id(p,m)&&o.onError(re(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);xn(c,o),d&&d(),o.currentNode=null}else o.onError(re(30,t.loc));break}}}function Bs(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Le(t,"for")?t.children:[t],userKey:Wt(t,"key"),isTemplateIf:o}}function Ts(t,n,o){return t.condition?fo(t.condition,$s(t,n,o),ye(o.helper(jt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):$s(t,n,o)}function $s(t,n,o){const{helper:s}=o,r=pe("key",X(`${n}`,!1,Oe,2)),{children:l}=t,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return bn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&l.filter(d=>d.type!==3).length===1&&(c|=2048),qt(o,s(Ft),je([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=Uc(c);return d.type===13&&uo(d,o),bn(d,r,o),c}}function Id(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function Dd(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Ad=(t,n,o)=>{const{modifiers:s,loc:r}=t,l=t.arg;let{exp:i}=t;if(i&&i.type===4&&!i.content.trim()&&(i=void 0),!i){if(l.type!==4||!l.isStatic)return o.onError(re(52,l.loc)),{props:[pe(l,X("",!0,r))]};Ls(t),i=t.exp}return l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=it(l.content):l.content=`${o.helperString(lo)}(${l.content})`:(l.children.unshift(`${o.helperString(lo)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Is(l,"."),s.some(a=>a.content==="attr")&&Is(l,"^")),{props:[pe(l,i)]}},Ls=(t,n)=>{const o=t.arg,s=it(o.content);t.exp=X(s,!1,o.loc)},Is=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},Od=xs("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Md(t,n,o,l=>{const i=ye(s(oo),[l.source]),a=yn(t),c=Le(t,"memo"),d=Wt(t,"key",!1,!0);d&&d.type===7&&!d.exp&&Ls(d);let p=d&&(d.type===6?d.value?X(d.value.content,!0):void 0:d.exp);const u=d&&p?pe("key",p):null,b=l.source.type===4&&l.source.constType>0,N=b?64:d?128:256;return l.codegenNode=qt(o,s(Ft),void 0,i,N,void 0,void 0,!0,!b,!1,t.loc),()=>{let g;const{children:k}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(T=>{if(T.type===1){const E=Wt(T,"key");if(E)return o.onError(re(33,E.loc)),!0}});const w=k.length!==1||k[0].type!==1,F=vn(t)?t:a&&t.children.length===1&&vn(t.children[0])?t.children[0]:null;if(F?(g=F.codegenNode,a&&u&&bn(g,u,o)):w?g=qt(o,s(Ft),u?je([u]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(g=k[0].codegenNode,a&&u&&bn(g,u,o),g.isBlock!==!b&&(g.isBlock?(r(pt),r(Lt(o.inSSR,g.isComponent))):r($t(o.inSSR,g.isComponent))),g.isBlock=!b,g.isBlock?(s(pt),s(Lt(o.inSSR,g.isComponent))):s($t(o.inSSR,g.isComponent))),c){const T=Tt(xo(l.parseResult,[X("_cached")]));T.body=$c([He(["const _memo = (",c.exp,")"]),He(["if (_cached",...p?[" && _cached.key === ",p]:[],` && ${o.helperString(ts)}(_cached, _memo)) return _cached`]),He(["const _item = ",g]),X("_item.memo = _memo"),X("return _item")]),i.arguments.push(T,X("_cache"),X(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Tt(xo(l.parseResult),g,!0))}})});function Md(t,n,o,s){if(!n.exp){o.onError(re(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(re(32,n.loc));return}Ds(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:p}=r,u={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:p,parseResult:r,children:yn(t)?t.children:[t]};o.replaceNode(u),a.vFor++;const b=s&&s(u);return()=>{a.vFor--,b&&b()}}function Ds(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(ht(t.source,n),t.key&&ht(t.key,n,!0),t.index&&ht(t.index,n,!0),t.value&&ht(t.value,n,!0)),t.finalized=!0)}function xo({value:t,key:n,index:o},s=[]){return Rd([t,n,o,...s])}function Rd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||X("_".repeat(s+1),!1))}const As=X("undefined",!1),Pd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Le(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Fd=(t,n,o,s)=>Tt(t,o,!1,!0,o.length?o[0].loc:s);function zd(t,n,o=Fd){n.helper(co);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Le(t,"slot",!0);if(c){const{arg:k,exp:w}=c;k&&!$e(k)&&(a=!0),l.push(pe(k||X("default",!0),o(w,void 0,s,r)))}let d=!1,m=!1;const p=[],u=new Set;let b=0;for(let k=0;k<s.length;k++){const w=s[k];let F;if(!yn(w)||!(F=Le(w,"slot",!0))){w.type!==3&&p.push(w);continue}if(c){n.onError(re(37,F.loc));break}d=!0;const{children:T,loc:E}=w,{arg:y=X("default",!0),exp:M,loc:q}=F;let L;$e(y)?L=y?y.content:"default":a=!0;const R=Le(w,"for"),W=o(M,R,T,E);let G,J;if(G=Le(w,"if"))a=!0,i.push(fo(G.exp,Cn(y,W,b++),As));else if(J=Le(w,/^else(-if)?$/,!0)){let K=k,x;for(;K--&&(x=s[K],!(x.type!==3&&_o(x))););if(x&&yn(x)&&Le(x,/^(else-)?if$/)){let I=i[i.length-1];for(;I.alternate.type===19;)I=I.alternate;I.alternate=J.exp?fo(J.exp,Cn(y,W,b++),As):Cn(y,W,b++)}else n.onError(re(30,J.loc))}else if(R){a=!0;const K=R.forParseResult;K?(Ds(K,n),i.push(ye(n.helper(oo),[K.source,Tt(xo(K),Cn(y,W),!0)]))):n.onError(re(32,R.loc))}else{if(L){if(u.has(L)){n.onError(re(38,q));continue}u.add(L),L==="default"&&(m=!0)}l.push(pe(y,W))}}if(!c){const k=(w,F)=>{const T=o(w,void 0,F,r);return n.compatConfig&&(T.isNonScopedSlot=!0),pe("default",T)};d?p.length&&p.some(w=>_o(w))&&(m?n.onError(re(39,p[0].loc)):l.push(k(void 0,p))):l.push(k(void 0,s))}const N=a?2:Sn(t.children)?3:1;let g=je(l.concat(pe("_",X(N+(process.env.NODE_ENV!=="production"?` /* ${cc[N]} */`:""),!1))),r);return i.length&&(g=ye(n.helper(es),[g,ft(i)])),{slots:g,hasDynamicSlots:a}}function Cn(t,n,o){const s=[pe("name",t),pe("fn",n)];return o!=null&&s.push(pe("key",X(String(o),!0))),je(s)}function Sn(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Sn(o.children))return!0;break;case 9:if(Sn(o.branches))return!0;break;case 10:case 11:if(Sn(o.children))return!0;break}}return!1}function _o(t){return t.type!==2&&t.type!==12?!0:t.type===2?!!t.content.trim():_o(t.content)}const Os=new WeakMap,jd=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,l=t.tagType===1;let i=l?Hd(t,n):`"${s}"`;const a=rc(i)&&i.callee===Vn;let c,d,m=0,p,u,b,N=a||i===zt||i===Zn||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const g=Ms(t,n,void 0,l,a);c=g.props,m=g.patchFlag,u=g.dynamicPropNames;const k=g.directives;b=k&&k.length?ft(k.map(w=>qd(w,n))):void 0,g.shouldUseBlock&&(N=!0)}if(t.children.length>0)if(i===pn&&(N=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(re(46,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),l&&i!==zt&&i!==pn){const{slots:k,hasDynamicSlots:w}=zd(t,n);d=k,w&&(m|=1024)}else if(t.children.length===1&&i!==zt){const k=t.children[0],w=k.type,F=w===5||w===8;F&&Re(k,n)===0&&(m|=1),F||w===2?d=k:d=t.children}else d=t.children;u&&u.length&&(p=Wd(u)),t.codegenNode=qt(n,i,c,d,m===0?void 0:m,p,b,!!N,!1,l,t.loc)};function Hd(t,n,o=!1){let{tag:s}=t;const r=Co(s),l=Wt(t,"is",!1,!0);if(l)if(r||at("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&X(l.value.content,!0):(a=l.exp,a||(a=X("is",!1,l.arg.loc))),a)return ye(n.helper(Vn),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=is(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(Qn),n.components.add(s),Kt(s,"component"))}function Ms(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],p=[],u=c.length>0;let b=!1,N=0,g=!1,k=!1,w=!1,F=!1,T=!1,E=!1;const y=[],M=W=>{d.length&&(m.push(je(Rs(d),a)),d=[]),W&&m.push(W)},q=()=>{n.scopes.vFor>0&&d.push(pe(X("ref_for",!0),X("true")))},L=({key:W,value:G})=>{if($e(W)){const J=W.content,K=qn(J);if(K&&(!s||r)&&J.toLowerCase()!=="onclick"&&J!=="onUpdate:modelValue"&&!Zo(J)&&(F=!0),K&&Zo(J)&&(E=!0),K&&G.type===14&&(G=G.arguments[0]),G.type===20||(G.type===4||G.type===8)&&Re(G,n)>0)return;J==="ref"?g=!0:J==="class"?k=!0:J==="style"?w=!0:J!=="key"&&!y.includes(J)&&y.push(J),s&&(J==="class"||J==="style")&&!y.includes(J)&&y.push(J)}else T=!0};for(let W=0;W<o.length;W++){const G=o[W];if(G.type===6){const{loc:J,name:K,nameLoc:x,value:I}=G;let _=!0;if(K==="ref"&&(g=!0,q()),K==="is"&&(Co(i)||I&&I.content.startsWith("vue:")||at("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(pe(X(K,!0,x),X(I?I.content:"",_,I?I.loc:J)))}else{const{name:J,arg:K,exp:x,loc:I,modifiers:_}=G,P=J==="bind",le=J==="on";if(J==="slot"){s||n.onError(re(40,I));continue}if(J==="once"||J==="memo"||J==="is"||P&&ct(K,"is")&&(Co(i)||at("COMPILER_IS_ON_ELEMENT",n))||le&&l)continue;if((P&&ct(K,"key")||le&&u&&ct(K,"vue:before-update"))&&(b=!0),P&&ct(K,"ref")&&q(),!K&&(P||le)){if(T=!0,x)if(P){if(M(),process.env.NODE_ENV!=="production"&&m.some(fe=>fe.type===15?fe.properties.some(({key:ve})=>ve.type!==4||!ve.isStatic?!0:ve.content!=="class"&&ve.content!=="style"&&!qn(ve.content)):!0)&&It("COMPILER_V_BIND_OBJECT_ORDER",n,I),at("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(x);continue}q(),M(),m.push(x)}else M({type:14,loc:I,callee:n.helper(io),arguments:s?[x]:[x,"true"]});else n.onError(re(P?34:35,I));continue}P&&_.some(Te=>Te.content==="prop")&&(N|=32);const Ae=n.directiveTransforms[J];if(Ae){const{props:Te,needRuntime:fe}=Ae(G,t,n);!l&&Te.forEach(L),le&&K&&!$e(K)?M(je(Te,a)):d.push(...Te),fe&&(p.push(G),Wn(fe)&&Os.set(G,fe))}else ic(J)||(p.push(G),u&&(b=!0))}}let R;if(m.length?(M(),m.length>1?R=ye(n.helper(un),m,a):R=m[0]):d.length&&(R=je(Rs(d),a)),T?N|=16:(k&&!s&&(N|=2),w&&!s&&(N|=4),y.length&&(N|=8),F&&(N|=32)),!b&&(N===0||N===32)&&(g||E||p.length>0)&&(N|=512),!n.inSSR&&R)switch(R.type){case 15:let W=-1,G=-1,J=!1;for(let I=0;I<R.properties.length;I++){const _=R.properties[I].key;$e(_)?_.content==="class"?W=I:_.content==="style"&&(G=I):_.isHandlerKey||(J=!0)}const K=R.properties[W],x=R.properties[G];J?R=ye(n.helper(Ht),[R]):(K&&!$e(K.value)&&(K.value=ye(n.helper(so),[K.value])),x&&(w||x.value.type===4&&x.value.content.trim()[0]==="["||x.value.type===17)&&(x.value=ye(n.helper(ro),[x.value])));break;case 14:break;default:R=ye(n.helper(Ht),[ye(n.helper(Ut),[R])]);break}return{props:R,directives:p,patchFlag:N,dynamicPropNames:y,shouldUseBlock:b}}function Rs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const l=r.key.content,i=n.get(l);i?(l==="style"||l==="class"||qn(l))&&Ud(i,r):(n.set(l,r),o.push(r))}return o}function Ud(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=ft([t.value,n.value],t.loc)}function qd(t,n){const o=[],s=Os.get(t);s?o.push(n.helperString(s)):(n.helper(eo),n.directives.add(t.name),o.push(Kt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const l=X("true",!1,r);o.push(je(t.modifiers.map(i=>pe(i,l)),r))}return ft(o,t.loc)}function Wd(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function Co(t){return t==="component"||t==="Component"}const Kd=(t,n)=>{if(vn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=Gd(t,n),i=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),o.length&&(i[3]=Tt([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),i.splice(a),t.codegenNode=ye(n.helper(Vo),i,s)}};function Gd(t,n){let o='"default"',s;const r=[];for(let l=0;l<t.props.length;l++){const i=t.props[l];if(i.type===6)i.value&&(i.name==="name"?o=JSON.stringify(i.value.content):(i.name=it(i.name),r.push(i)));else if(i.name==="bind"&&ct(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=it(i.arg.content);o=i.exp=X(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&$e(i.arg)&&(i.arg.content=it(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Ms(t,n,r,!1,!1);s=l,i.length&&n.onError(re(36,i[0].loc))}return{slotName:o,slotProps:s}}const Ps=(t,n,o,s)=>{const{loc:r,modifiers:l,arg:i}=t;!t.exp&&!l.length&&o.onError(re(35,r));let a;if(i.type===4)if(i.isStatic){let p=i.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&o.onError(re(51,i.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const u=n.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?ac(it(p)):`on:${p}`;a=X(u,!0,i.loc)}else a=He([`${o.helperString(ao)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(ao)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const p=as(c),u=!(p||Fc(c)),b=c.content.includes(";");process.env.NODE_ENV!=="production"&&ht(c,o,!1,b),(u||d&&p)&&(c=He([`${u?"$event":"(...args)"} => ${b?"{":"("}`,c,b?"}":")"]))}let m={props:[pe(a,c||X("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(p=>p.key.isHandlerKey=!0),m},Zd=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let l=0;l<o.length;l++){const i=o[l];if(yo(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(yo(c))s||(s=o[l]=He([i],i.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(l=>l.type===7&&!n.directiveTransforms[l.name])&&t.tag!=="template")))for(let l=0;l<o.length;l++){const i=o[l];if(yo(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&Re(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Pt[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ye(n.helper(Xn),a)}}}}},Fs=new WeakSet,Jd=(t,n)=>{if(t.type===1&&Le(t,"once",!0))return Fs.has(t)||n.inVOnce||n.inSSR?void 0:(Fs.add(t),n.inVOnce=!0,n.helper(mn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},zs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(re(41,t.loc)),Bn();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=o.bindingMetadata[l];if(a==="props"||a==="props-aliased")return o.onError(re(44,s.loc)),Bn();if(!i.trim()||!as(s))return o.onError(re(42,s.loc)),Bn();const c=r||X("modelValue",!0),d=r?$e(r)?`onUpdate:${it(r.content)}`:He(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const p=o.isTS?"($event: any)":"$event";m=He([`${p} => ((`,s,") = $event)"]);const u=[pe(c,t.exp),pe(d,m)];if(t.modifiers.length&&n.tagType===1){const b=t.modifiers.map(g=>g.content).map(g=>(go(g)?g:JSON.stringify(g))+": true").join(", "),N=r?$e(r)?`${r.content}Modifiers`:He([r,' + "Modifiers"']):"modelModifiers";u.push(pe(N,X(`{ ${b} }`,!1,t.loc,2)))}return Bn(u)};function Bn(t=[]){return{props:t}}const Yd=/[\w).+\-_$\]]/,Xd=(t,n)=>{at("COMPILER_FILTERS",n)&&(t.type===5?Tn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Tn(o.exp,n)}))};function Tn(t,n){if(t.type===4)js(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?js(s,n):s.type===8?Tn(t,n):s.type===5&&Tn(s.content,n))}}function js(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,p,u,b,N,g=[];for(b=0;b<o.length;b++)if(u=p,p=o.charCodeAt(b),s)p===39&&u!==92&&(s=!1);else if(r)p===34&&u!==92&&(r=!1);else if(l)p===96&&u!==92&&(l=!1);else if(i)p===47&&u!==92&&(i=!1);else if(p===124&&o.charCodeAt(b+1)!==124&&o.charCodeAt(b-1)!==124&&!a&&!c&&!d)N===void 0?(m=b+1,N=o.slice(0,b).trim()):k();else{switch(p){case 34:r=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(p===47){let w=b-1,F;for(;w>=0&&(F=o.charAt(w),F===" ");w--);(!F||!Yd.test(F))&&(i=!0)}}N===void 0?N=o.slice(0,b).trim():m!==0&&k();function k(){g.push(o.slice(m,b).trim()),m=b+1}if(g.length){for(process.env.NODE_ENV!=="production"&&gn("COMPILER_FILTERS",n,t.loc),b=0;b<g.length;b++)N=Qd(N,g[b],n);t.content=N,t.ast=void 0}}function Qd(t,n,o){o.helper(to);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Kt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Kt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Hs=new WeakSet,Vd=(t,n)=>{if(t.type===1){const o=Le(t,"memo");return!o||Hs.has(t)?void 0:(Hs.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&uo(s,n),t.codegenNode=ye(n.helper(po),[o.exp,Tt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}};function ep(t){return[[Jd,$d,Vd,Od,Xd,...process.env.NODE_ENV!=="production"?[Td]:[],Kd,jd,Pd,Zd],{on:Ps,bind:Ad,model:zs}]}function tp(t,n={}){const o=n.onError||ho,s=n.mode==="module";n.prefixIdentifiers===!0?o(re(47)):s&&o(re(48));const r=!1;n.cacheHandlers&&o(re(49)),n.scopeId&&!s&&o(re(50));const l=rt({},n,{prefixIdentifiers:r}),i=ke(t)?od(t,l):t,[a,c]=ep();return ld(i,rt({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:rt({},c,n.directiveTransforms||{})})),pd(i,l)}const np=()=>({props:[]});/**
|
|
158
158
|
* @vue/compiler-dom v3.5.18
|
|
159
159
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
160
160
|
* @license MIT
|
|
161
|
-
**/const Us=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),qs=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Ws=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Ks=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Co=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Gs=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Zs=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Js=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),So=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Ys=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");Sc({[Us]:"vModelRadio",[qs]:"vModelCheckbox",[Ws]:"vModelText",[Ks]:"vModelSelect",[Co]:"vModelDynamic",[Gs]:"withModifiers",[Zs]:"withKeys",[Js]:"vShow",[So]:"Transition",[Ys]:"TransitionGroup"});let $t;function op(t,n=!1){return $t||($t=document.createElement("div")),n?($t.innerHTML=`<div foo="${t.replace(/"/g,""")}">`,$t.children[0].getAttribute("foo")):($t.innerHTML=t,$t.textContent)}const sp={parseMode:"html",isVoidTag:Ec,isNativeTag:t=>vc(t)||bc(t)||kc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:op,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return So;if(t==="TransitionGroup"||t==="transition-group")return Ys},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},rp=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:Q("style",!0,n.loc),exp:ip(n.value.content,n.loc),modifiers:[],loc:n.loc})})},ip=(t,n)=>{const o=uc(t);return Q(JSON.stringify(o),!1,n,3)};function Ue(t,n){return re(t,n,process.env.NODE_ENV!=="production"?lp:void 0)}const lp={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},ap=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(53,r)),n.children.length&&(o.onError(Ue(54,r)),n.children.length=0),{props:[fe(Q("innerHTML",!0,r),s||Q("",!0))]}},cp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(55,r)),n.children.length&&(o.onError(Ue(56,r)),n.children.length=0),{props:[fe(Q("textContent",!0),s?Pe(s,o)>0?s:ve(o.helperString(fn),[s],r):Q("",!0))]}},dp=(t,n,o)=>{const s=zs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Ue(58,t.arg.loc));function r(){const a=Le(n,"bind");a&<(a.arg,"value")&&o.onError(Ue(60,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Ws,c=!1;if(l==="input"||i){const d=qt(n,"type");if(d){if(d.type===7)a=Co;else if(d.value)switch(d.value.content){case"radio":a=Us;break;case"checkbox":a=qs;break;case"file":c=!0,o.onError(Ue(59,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else zc(n)?a=Co:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=Ks:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Ue(57,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},pp=Ze("passive,once,capture"),fp=Ze("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),up=Ze("left,right"),Xs=Ze("onkeyup,onkeydown,onkeypress"),mp=(t,n,o,s)=>{const r=[],l=[],i=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&Tt("COMPILER_V_ON_NATIVE",o,s)||pp(c)?i.push(c):up(c)?$e(t)?Xs(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):fp(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},Qs=(t,n)=>$e(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?He(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,hp=(t,n,o)=>Ps(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=mp(l,r,o,t.loc);if(c.includes("right")&&(l=Qs(l,"onContextmenu")),c.includes("middle")&&(l=Qs(l,"onMouseup")),c.length&&(i=ve(o.helper(Gs),[i,JSON.stringify(c)])),a.length&&(!$e(l)||Xs(l.content.toLowerCase()))&&(i=ve(o.helper(Zs),[i,JSON.stringify(a)])),d.length){const m=d.map(Kn).join("");l=$e(l)?Q(`${l.content}${m}`,!0):He(["(",l,`) + "${m}"`])}return{props:[fe(l,i)]}}),gp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(61,r)),{props:[],needRuntime:o.helper(Js)}},yp=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===So)return()=>{if(!t.children.length)return;Vs(t)&&n.onError(Ue(62,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function Vs(t){const n=t.children=t.children.filter(s=>s.type!==3&&!(s.type===2&&!s.content.trim())),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(Vs)}const vp=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Ue(63,t.loc)),n.removeNode())};function bp(t,n){return t==="template"?!0:t in er?er[t].has(n):n in tr?tr[n].has(t):!(t in nr&&nr[t].has(n)||n in or&&or[n].has(t))}const Lt=new Set(["h1","h2","h3","h4","h5","h6"]),ht=new Set([]),er={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:ht,iframe:ht,option:ht,textarea:ht,style:ht,title:ht},tr={html:ht,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},nr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},or={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Lt,h2:Lt,h3:Lt,h4:Lt,h5:Lt,h6:Lt},kp=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!bp(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Ep=[rp,...process.env.NODE_ENV!=="production"?[yp,kp]:[]],wp={cloak:np,html:ap,text:cp,model:dp,on:hp,show:gp};function Np(t,n={}){return tp(t,ot({},sp,n,{nodeTransforms:[vp,...Ep,...n.nodeTransforms||[]],directiveTransforms:ot({},wp,n.directiveTransforms||{}),transformHoist:null}))}function xp(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Np(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(hr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Bo={};function _p(t){return Bo[t]||(Bo[t]=xp(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Bo[t]}const Cp={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Sp={class:"flex items-center gap-2"},Bp=["disabled"],Tp={class:"text-sm"},$p=["disabled"],Lp=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,l)=>(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("div",null,e.toDisplayString(r.label),1),e.createElementVNode("div",Sp,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:l[0]||(l[0]=i=>r.$emit("previous"))}," Назад ",8,Bp),e.createElementVNode("span",Tp,"Сторінка "+e.toDisplayString(r.currentPage)+" з "+e.toDisplayString(r.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:l[1]||(l[1]=i=>r.$emit("next"))}," Далі ",8,$p)])]))}}),Ip={class:"relative inline-flex"},Dp=["aria-label"],Ap={class:"px-3 pb-2"},Op={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Mp=["onClick"],Rp={class:"truncate"},Pp={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Fp="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",zp=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),l=e.ref(!1),i=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),p=e.ref({top:0,left:0}),f=e.computed(()=>{if(!i.value)return a.value;const T=i.value.toLowerCase();return a.value.filter(E=>b(E).toLowerCase().includes(T))});e.watch(()=>o.columns,T=>{if(!T){a.value=[];return}const E=JSON.stringify(T),y=JSON.stringify(a.value);E!==y&&(a.value=[...T])},{deep:!0}),e.watch(a,T=>{s("update:columns",T)},{deep:!0});function b(T){return T.ua||T.label||T.name||"Колонка"}function N(T){const E=!T.hidden;E&&a.value.filter(y=>!y.hidden).length<=1||(T.hidden=E)}function g(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),k()})}function k(){if(!c.value)return;const T=c.value.getBoundingClientRect();p.value={top:T.bottom+window.scrollY+6,left:T.left+window.scrollX-200}}function w(T){if(!l.value)return;const E=T.target;E&&(d.value?.contains(E)||c.value?.contains(E)||(l.value=!1))}function F(T){T.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",w,!0),document.addEventListener("keydown",F)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",w,!0),document.removeEventListener("keydown",F)}),(T,E)=>(e.openBlock(),e.createElementBlock("div",Ip,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:g,class:e.normalizeClass([Fp,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},E[2]||(E[2]=[e.createStaticVNode('<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="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)]),10,Dp),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${p.value.top}px`,left:`${p.value.left}px`})},[E[5]||(E[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Ap,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":E[0]||(E[0]=y=>i.value=y),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Op,[E[4]||(E[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:E[1]||(E[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,y=>(e.openBlock(),e.createElementBlock("li",{key:y.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:O=>N(y)},[e.createElementVNode("span",Rp,e.toDisplayString(b(y)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",y.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[y.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Pp,E[3]||(E[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])))],2)],8,Mp))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),jp=["data-action-key"],Hp=["onClick"],Up={key:0,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"},qp={key:1,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"},Wp={key:2,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"},Kp={key:3,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"},Gp=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),l=e.computed(()=>!!o.actions?.length),i=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(N){N.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const N=r.value;if(!N)return{};const g=N.getBoundingClientRect(),k=8,w=160,E=(o.actions?.length??0)*36+k*2,y=i.value.height||(typeof window<"u"?window.innerHeight:0),O=i.value.width||(typeof window<"u"?window.innerWidth:0),q=i.value.scrollX||(typeof window<"u"?window.scrollX:0),L=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let M=g.bottom+L+k,W=g.right+q-w;const G=q+O-w-k;return W>G&&(W=G),W<q+k&&(W=q+k),M+E>L+y-k&&(M=g.top+L-E-k),M<L+k&&(M=L+k),{top:`${M}px`,left:`${W}px`,width:"auto"}});function p(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function f(){typeof window>"u"||a.value||(a.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function b(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>o.isOpen,N=>{N?f():b()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&f()}),e.onBeforeUnmount(()=>{b()}),(N,g)=>l.value&&N.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":N.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},g[1]||(g[1]=[e.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"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[N.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:g[0]||(g[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.actions,k=>(e.openBlock(),e.createElementBlock("button",{key:k.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",k.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:w=>d(k)},[e.renderSlot(N.$slots,"icon",{action:k},()=>[k.type==="view"?(e.openBlock(),e.createElementBlock("svg",Up,g[2]||(g[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))):k.type==="edit"?(e.openBlock(),e.createElementBlock("svg",qp,g[3]||(g[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)]))):k.type==="delete"?(e.openBlock(),e.createElementBlock("svg",Wp,g[4]||(g[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Kp,g[5]||(g[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])))]),e.createTextVNode(" "+e.toDisplayString(k.label),1)],10,Hp))),128))],4)):e.createCommentVNode("",!0)]))],8,jp)):e.createCommentVNode("",!0)}}),sr=typeof window<"u",rr=typeof document<"u";function Zp(t){if(!rr)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function ir(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function To(t,n){if(!rr||!sr)return;const o=Zp(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!sr)return;o.textContent=s.options.text;const i=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(i.left,c));o.style.left=`${d}px`,o.style.top=`${i.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function $o(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const Jp={mounted(t,n){const o=ir(n.value);o&&To(t,o)},updated(t,n){const o=ir(n.value),s=t;if(!o){$o(s);return}const r=s.__tooltipState__;if(!r){To(s,o);return}if(r.options.wrap!==o.wrap){$o(s),To(s,o);return}r.options=o},unmounted(t){$o(t)}},Yp={class:"flex flex-col gap-4 mb-[15px]"},Xp={class:"flex flex-wrap items-center gap-4"},Qp={class:"relative"},Vp={class:"ml-auto flex items-center gap-2"},ef={class:"overflow-x-auto"},tf={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},nf={class:"text-left font-medium text-gray-700"},of={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},sf={class:"divide-y divide-gray-200"},rf=["href"],lf={key:2},af={key:3},cf={key:0,class:"py-2 pr-4 text-right"},df={key:0},pf={key:0},ff=["colspan"],lr=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=Jp,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),p=e.ref(10),f=e.ref(0),b=e.ref(0),N=e.ref("id"),g=e.ref("");let k=null,w=0;const F=e.ref(null);async function T(){const v=m.value,B=++w,C=new URLSearchParams,S=d.value.trim();S&&C.set("search",S),C.set("page",String(v)),C.set("limit",String(p.value));const V=`/api/data/${l.token}${C.toString()?`?${C.toString()}`:""}`;let X;try{const pe=await fetch(V);if(!pe.ok)throw new Error(`Request failed with status ${pe.status}`);X=await pe.json()}catch(pe){B===w&&(o.value=[],b.value=0,f.value=0),console.error("Failed to load table data",pe);return}if(B!==w)return;o.value=Array.isArray(X?.rows)?X.rows:[],s.value=J(X?.columns||[]),i.value=Array.isArray(X?.actions)?X.actions:[],a.value=X?.form,c.value=X?.addToken,N.value=typeof X?.pk=="string"&&X.pk?X.pk:N.value,typeof X?.form=="string"&&X.form&&(g.value=X.form.replace(/\.form$/,".table")),Y();const se=Number(X?.total??X?.count??X?.totalCount),we=Number(X?.filtered??X?.filteredCount);f.value=Number.isFinite(se)&&se>0?se:o.value.length,b.value=Number.isFinite(we)&&we>0?we:Math.max(o.value.length,f.value);const Ge=Math.max(1,Math.ceil((b.value||o.value.length||1)/p.value));let je=v;typeof X?.page=="number"&&X.page>0&&(je=X.page),je>Ge&&(je=Ge),je<1&&(je=1);const At=je!==v;if(m.value=je,At&&b.value>0)return T()}const{$notify:E,$confirm:y,$form:O}=n?.appContext?.config?.globalProperties||{};function q(){if(_e.emitter?.emit){_e.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}T()}async function L(v){typeof O=="function"&&(await O({token:v.token}),q())}async function M(){typeof O=="function"&&(await O({token:c.value}),q())}function W(v){y({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const B=await fetch(`/api/table/${v.token}`,{method:"DELETE"});if(!B.ok){const{error:C}=await B.json();E({title:"Помилка",type:"warning",message:C});return}E({title:"Видаленно",message:"Успішно видалено"}),await T()}})}e.onMounted(async()=>{await T(),_e.emitter?.on?.("updateCard",T)}),e.onBeforeUnmount(()=>{_e.emitter?.off?.("updateCard",T)});function G(v){return typeof v?.format=="string"?v.format.toLowerCase():""}function J(v){const B=new Map;s.value.forEach(S=>{S?.name&&B.set(S.name,!!S.hidden)});const C=v.map(S=>{const V=B.has(S.name)?B.get(S.name):!!S.hidden;return{...S,hidden:V}});return C.length&&!C.some(S=>!S.hidden)&&(C[0].hidden=!1),C}const K=e.computed(()=>{const v=s.value.filter(B=>!B.hidden);return v.length?v:s.value}),x=e.computed(()=>{const v=[],B=new Set;for(const C of i.value){if(typeof C=="string"){if(C==="edit"){const S="row:edit";B.has(S)||(v.push({key:S,type:"edit",label:"Редагувати",scope:"row",handler:ge}),B.add(S));continue}if(C==="delete"||C==="del"){const S="row:delete";B.has(S)||(v.push({key:S,type:"delete",label:"Видалити",scope:"row",handler:Be,variant:"danger"}),B.add(S));continue}if(C==="add"){const S="toolbar:add";B.has(S)||(v.push({key:S,type:"add",label:"Додати",scope:"toolbar"}),B.add(S))}continue}if(C&&typeof C=="object"){const S=String(C.name??C.type??"action"),V=String(C.label??C.title??S),X=C.scope==="toolbar"?"toolbar":"row",se=`${X}:${S}`;if(B.has(se))continue;B.add(se),v.push({key:se,type:S,label:V,scope:X,handler:X==="row"?we=>ke(C,we):void 0,variant:C.variant==="danger"?"danger":"default",original:C})}}return v}),I=e.computed(()=>x.value.filter(v=>v.scope==="row"&&typeof v.handler=="function")),_=e.computed(()=>x.value.filter(v=>v.scope==="toolbar")),P=e.computed(()=>I.value.length>0),le=e.computed(()=>_.value.some(v=>v.type==="add")),Ae=e.computed(()=>o.value),Te=e.computed(()=>{const v=b.value||Ae.value.length,B=Math.ceil(v/p.value);return B>0?B:1}),ue=e.computed(()=>{const v=Ae.value.length,B=b.value||v,C=f.value||B;return`Показано ${v} з ${B} (усього ${C})`});function be(){m.value<Te.value&&(m.value+=1,T())}function z(){m.value>1&&(m.value-=1,T())}e.watch(s,v=>{v?.length&&(v.some(B=>!B.hidden)||(v[0].hidden=!1))},{deep:!0});function U(){k&&clearTimeout(k),Y(),k=setTimeout(()=>{m.value=1,T()},300)}function H(v){const B=N.value||"id",C=v?.token??v?.[B]??v?.id;return C?String(C):""}function oe(v){const B=K.value[v],C=["py-2",...h(B)];v===0&&C.push("pl-4");const S=v===K.value.length-1&&!P.value;return C.push(S?"pr-4":"pr-5"),C.join(" ")}function ae(v,B){const C=["py-2",...h(B)];G(B)==="badge"&&C.push("center"),me(B)==="wrap"?C.push("whitespace-normal","break-words"):C.push("truncate"),v===0&&C.push("pl-4");const S=v===K.value.length-1&&!P.value;return C.push(S?"pr-4":"pr-5"),C.join(" ")}function me(v){return(typeof v?.overflow=="string"?v.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function h(v){const B=[],C=se=>{if(se==null||se==="")return;const we=Number(se);return Number.isFinite(we)&&we>0?`${we}px`:String(se).replace(/\s+/g,"")},S=C(v?.width),V=C(v?.minWidth),X=C(v?.maxWidth);return S?(B.push(`min-w-[${S}]`,`max-w-[${S}]`),B):(B.push(`min-w-[${V??"100px"}]`),B.push(`max-w-[${X??"350px"}]`),B)}function $(v){if(!I.value.length)return!1;const B=N.value||"id";return!!(v?.token||v?.[B]||v?.id)}function A(v){return F.value===H(v)}function j(v){const B=H(v);B&&(F.value=F.value===B?null:B)}function Y(){F.value=null}function Z(v,B){const C=B?.tooltip;if(!C)return;const S=Xt(v,B);let V,X=B?.tooltipWrap!==!1;if(typeof C=="string"){const se=C.trim();if(!se)return;const we=se.toLowerCase();if(["true","1","yes"].includes(we))V=typeof S=="string"?S:String(S??"");else{if(["false","0","no"].includes(we))return;V=se}}else C===!0?V=S:typeof C=="object"&&(typeof C.text=="string"&&(V=C.text.trim()),typeof C.wrap=="boolean"&&(X=C.wrap!==!1));if(!V){if(S==null||S==="")return;V=String(S)}if(V.trim())return X?{text:V,wrap:!0}:V}function ge(v){Y(),L(v)}function Be(v){Y(),W(v)}async function ke(v,B){Y();const C=N.value||"id",S=v.isId?B?.[C]??B?.id:B?.token??B?.[C]??B?.id;if(!S){console.warn("Cannot execute action without identifier",v);return}if(v.form&&typeof v.api=="string"&&v.api&&typeof O=="function"){await Oe(v,B,S);return}if(v.form&&typeof O=="function"){const V=await qe(v.form,S),X={form:v.form,token:V?.token??B?.token??S,schema:V?.schema,mode:V?.mode??"edit"};V?.data!==void 0&&(X.defaultValue=V.data);try{await O(X),q()}catch(se){console.error("Failed to execute form action",se)}return}if(typeof v.api=="string"&&v.api){const V=Ye(v.api,S);window.location.href=V;return}B?.token&&typeof O=="function"&&(await O({token:B.token}),q())}function Ye(v,B){return`${v.endsWith("/")?v:`${v}/`}${B}`}async function qe(v,B){const C=`/api/form/${v}/${B}`;try{const S=await fetch(C);if(!S.ok)throw new Error(`Request failed with status ${S.status}`);return await S.json()}catch(S){console.error("Failed to load form config",S),E({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Yt(v){const B=`/api/template/form/${v}`;try{const C=await fetch(B);if(!C.ok)throw new Error(`Request failed with status ${C.status}`);return(await C.json())?.schema}catch(C){console.error("Failed to load form template",C);return}}function We(v){if(v!=null){if(v?.data!==void 0)return v.data;if(v?.defaultValue!==void 0)return v.defaultValue;if(v?.values!==void 0)return v.values;if(typeof v=="object"&&!Array.isArray(v)){const{schema:B,token:C,mode:S,message:V,successMessage:X,...se}=v;if(Object.keys(se).length)return se}}}async function Oe(v,B,C){const S=Ye(v.api,C),V=(typeof v.method=="string"?v.method:"PUT").toUpperCase();let X;try{const pe=await fetch(S);if(!pe.ok)throw new Error(`Request failed with status ${pe.status}`);X=await pe.json()}catch(pe){console.error("Failed to load action data",pe),yt("Не вдалося отримати дані форми.");return}const se=typeof v.form=="string"?v.form.replace(/\.table$/,".form"):void 0,we=X?.schema??(se?await Yt(se):void 0),Ge={mode:X?.mode??"edit"};se&&(Ge.form=se),we&&(Ge.schema=we);const je=We(X);je!==void 0&&(Ge.defaultValue=je);const At=await O(Ge);if(At)try{const pe=await fetch(S,{method:V,headers:{"Content-Type":"application/json"},body:JSON.stringify(At)});if(!pe.ok){const Ot=await Xe(pe),Lo=Ot?.error??Ot?.message??"Не вдалося зберегти дані.";throw new Error(Lo)}It(`Дані успішно ${Ge.value==="add"?"збережено":"оновлено"}`),q()}catch(pe){console.error("Failed to submit action data",pe),yt("Не вдалося зберегти дані.")}}async function Xe(v){try{return await v.json()}catch{return}}function yt(v){E({title:"Помилка",type:"error",message:v})}function It(v){E({title:"Успіх",type:"success",message:v})}function Dt(v){if(!F.value)return;const B=v.target;if(!B)return;const C=B.closest("[data-action-key]");C&&C.getAttribute("data-action-key")===F.value||Y()}e.onMounted(()=>{document.addEventListener("click",Dt,!0)}),e.onBeforeUnmount(()=>{k&&clearTimeout(k),document.removeEventListener("click",Dt,!0),_e.emitter?.off?.("updateCard",T)});function Qe(v,B){const S=v?.[`${B.name}_text`];if(Array.isArray(S))return S.length?S.join(", "):"-";if(S!=null&&S!=="")return S;const V=v?.[B.name];return Array.isArray(V)?V.length?V.join(", "):"-":V??"-"}function Ke(v,B){const S=v?.[`${B.name}_data`];if(S&&typeof S=="object")return{text:S.text??S.label??S.name??S.title??"-",color:S.color,textColor:S.textColor};const V=v?.[`${B.name}_text`]??v?.[B.name];return{text:(Array.isArray(V)?V.join(", "):V)??"-"}}function ct(v,B){const C=Ke(v,B);return C.color?{backgroundColor:C.color,color:C.textColor??"#ffffff"}:{}}function Xt(v,B){const C=G(B);if(C==="badge")return Ke(v,B).text;if(C==="select")return Qe(v,B);if(C==="slot")return"-";if(C==="text")return v?.[B.name]??"-";const S=v?.[`${B.name}_data`];return S!=null&&typeof S!="object"?S:v?.[`${B.name}_text`]??v?.[B.name]??"-"}return(v,B)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Yp,[e.createElementVNode("div",Xp,[e.createElementVNode("div",Qp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[0]||(B[0]=C=>d.value=C),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:U},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",Vp,[e.createVNode(zp,{columns:s.value,"onUpdate:columns":B[1]||(B[1]=C=>s.value=C)},null,8,["columns"]),le.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:M,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},B[2]||(B[2]=[e.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"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)]))):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",ef,[e.createElementVNode("table",tf,[e.createElementVNode("thead",nf,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(C,S)=>(e.openBlock(),e.createElementBlock("th",{key:C.name,class:e.normalizeClass(oe(S))},e.toDisplayString(C.ua),3))),128)),P.value?(e.openBlock(),e.createElementBlock("th",of," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",sf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,C=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:C.id??JSON.stringify(C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(S,V)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:S.name,class:e.normalizeClass(ae(V,S))},[S.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:S.link.replace("{{id}}",C.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(Xt(C,S)),9,rf)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[G(S)==="slot"&&(S.slot?.content||S.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_p)(S.slot.content||S.slot)),{key:0,data:C,row:C,column:S,value:C?.[S.name]},null,8,["data","row","column","value"])):G(S)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(ct(C,S))},e.toDisplayString(Ke(C,S).text),5)):G(S)==="select"?(e.openBlock(),e.createElementBlock("span",lf,e.toDisplayString(Qe(C,S)),1)):(e.openBlock(),e.createElementBlock("span",af,e.toDisplayString(Xt(C,S)),1))],64))],2)),[[e.unref(r),Z(C,S)]])),128)),P.value?(e.openBlock(),e.createElementBlock("td",cf,[$(C)?(e.openBlock(),e.createElementBlock("div",df,[e.createVNode(Gp,{row:C,actions:I.value,"is-open":A(C),"action-key":H(C),onToggle:S=>j(C)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),Ae.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",pf,[e.createElementVNode("td",{colspan:K.value.length+(P.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,ff)]))])])]),e.createVNode(Lp,{"current-page":m.value,"total-pages":Te.value,label:ue.value,onPrevious:z,onNext:be},null,8,["current-page","total-pages","label"])]))}}),uf={class:"p-[20px]"},mf={class:"flex gap-[6px] mb-5"},hf={class:"vs-form-text relative bg-white rounded-lg flex-grow"},gf={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},yf={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},vf={class:"space-y-8"},bf={key:0},kf={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ef=["onClick"],wf={class:"md:col-span-2"},Nf={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},xf={class:"text-sm text-gray-500 dark:text-neutral-500"},_f={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Cf=["checked","onChange"],Sf={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Bf={class:"md:col-span-2"},Tf={class:"font-semibold text-gray-800 dark:text-neutral-200"},$f=["onClick"],Lf={class:"md:col-span-2"},If={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Df={class:"text-sm text-gray-500 dark:text-neutral-500"},Af={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Of=["checked","onChange"],$n="uk",Ln=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return $n;const E=localStorage.language,y=typeof navigator<"u"?navigator.language:$n;return(E||y||$n).split(/[-_]/)[0].toLowerCase()||$n},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c=()=>{a.value=o()},d=()=>{const E=[];return a.value&&E.push(a.value),n.forEach(y=>{y&&!E.includes(y)&&E.push(y)}),E.includes("path")||E.push("path"),E},m=E=>{const y=d();for(const O of y){const q=E[O];if(typeof q=="string"&&q.trim())return q}return""};e.onMounted(async()=>{c();const y=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();y.routes&&y.routes.forEach(O=>{i.value[O.path]=new Set(O.actions)})});const p=(E,y)=>i.value[E]?.has(y)??!1,f=(E,y)=>{i.value[E]||(i.value[E]=new Set),i.value[E].has(y)?i.value[E].delete(y):i.value[E].add(y)},b=(E,y)=>{E.forEach(O=>{O.path&&(i.value[O.path]||(i.value[O.path]=new Set),i.value[O.path].has(y)?i.value[O.path].delete(y):i.value[O.path].add(y))})},N=e.computed(()=>Object.entries(i.value).map(([E,y])=>({path:E,actions:Array.from(y)})).filter(E=>E.actions.length)),g=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:N.value})}),_e.notify({title:"Success!",message:"Permissions saved."})},k=()=>{i.value={}},w=E=>{if(!r.value.trim())return E;const y=r.value.toLowerCase();return E.filter(O=>m(O).toLowerCase().includes(y)||(O.path?.toLowerCase().includes(y)??!1))},F=e.computed(()=>w(s.data.routers.filter(E=>!E.menu))),T=e.computed(()=>s.data.routers.filter(E=>E.menu).map(E=>({...E,menu:w(E.menu||[])})).filter(E=>E.menu&&E.menu.length>0));return(E,y)=>(e.openBlock(),e.createElementBlock("div",uf,[e.createElementVNode("div",mf,[e.createElementVNode("div",hf,[y[1]||(y[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":y[0]||(y[0]=O=>r.value=O),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm 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,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:k,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:g,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",gf,[y[2]||(y[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(O,q)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:q},[e.createElementVNode("h3",yf,e.toDisplayString(O),1)])),64))]),e.createElementVNode("div",vf,[F.value.length?(e.openBlock(),e.createElementBlock("div",bf,[e.createElementVNode("ul",kf,[y[3]||(y[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(O,q)=>e.createElementVNode("li",{key:q,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:L=>b(F.value,l[q])}," Toggle all ",8,Ef)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(O,q)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+q,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",wf,[e.createElementVNode("p",Nf,e.toDisplayString(m(O)),1),e.createElementVNode("p",xf,e.toDisplayString(O.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(L,M)=>e.createElementVNode("li",{key:M,class:"col-span-1"},[e.createElementVNode("div",_f,[e.createElementVNode("input",{type:"checkbox",checked:p(O.path,L),onChange:W=>f(O.path,L),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Cf)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(O,q)=>(e.openBlock(),e.createElementBlock("div",{key:q,class:"space-y-5"},[e.createElementVNode("ul",Sf,[e.createElementVNode("li",Bf,[e.createElementVNode("h3",Tf,e.toDisplayString(m(O)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(L,M)=>e.createElementVNode("li",{key:M,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:W=>b(O.menu,l[M])}," Toggle all ",8,$f)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.menu,(L,M)=>(e.openBlock(),e.createElementBlock("ul",{key:M,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Lf,[e.createElementVNode("p",If,e.toDisplayString(m(L)),1),e.createElementVNode("p",Df,e.toDisplayString(L.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(W,G)=>e.createElementVNode("li",{key:G,class:"col-span-1"},[e.createElementVNode("div",Af,[e.createElementVNode("input",{type:"checkbox",checked:p(L.path,W),onChange:J=>f(L.path,W),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Of)])])),64))]))),128))]))),128))])]))}}),gt={"vs-widget-comments":en,"vs-widget-history":tn,"vs-widget-gallery":on,"vs-widget-file":nn,"vs-widget-list":Rn,"vs-widget-map":cn,"vs-widget-table":lr,"vs-group-interface":Ln};function ar(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function cr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>cr(o))),n}function Mf(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=ar(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let l=n-r;if(s.length===0)return;l<=0&&(l=n);const i=Math.max(1,Math.floor(l/s.length));let a=Math.max(0,l-i*s.length);s.forEach(c=>{let d=i;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function In(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>cr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=In(s.items,12))}),Mf(o,n),o}function dr(t){const n=ar(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Rf={class:"text-lg font-semibold text-gray-900"},Pf=["innerHTML"],Ff={key:0,class:"grid grid-cols-12 gap-4"},zf={key:0,class:"mb-4 pb-2 border-b border-gray-200"},jf={class:"text-lg font-semibold text-gray-900"},Hf=["innerHTML"],Zt=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>In(n.items));function r(d){const m=["col-span-12"],p=dr(d.col);return p.length&&m.push(...p),m}function l(d){return gt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const p=m.split(".");let f=d;for(const b of p){if(f==null||typeof f!="object"&&!Array.isArray(f))return{found:!1,value:void 0};if(!(b in f))return{found:!1,value:void 0};f=f[b]}return{found:!0,value:f}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([p,f])=>{if(p!=="props"&&typeof f=="string"){const b=i(n.data,f);b.found&&(m[p]=b.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,f])=>{if(typeof f=="string"){const b=i(n.data,f);m[p]=b.found?b.value:f}else m[p]=f}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,d.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!d.hideTitle&&d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",d.styling?.classItemTitle])},[e.createElementVNode("h3",Rf,e.toDisplayString(d.title),1)],2)):e.createCommentVNode("",!0),d.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.html,class:"text-gray-900 leading-relaxed"},null,8,Pf)):d.type?.includes("tabs")?(e.openBlock(),e.createBlock(Jt,{key:2,view:d.type,panels:d.items,data:d.data,styling:d.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Ff,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(p,f)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||f,class:e.normalizeClass(r(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",zf,[e.createElementVNode("h3",jf,e.toDisplayString(p.title||p.label),1)])):e.createCommentVNode("",!0),p.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:p.html,class:"text-gray-900 leading-relaxed"},null,8,Hf)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:d.data.geom,id:d.data.id,...c.value,...a(p),data:d.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),Uf={class:"grid grid-cols-12 gap-[20px]"},qf={key:0,class:"col-span-4"},Wf=["innerHTML"],Kf=["onClick"],Gf=["innerHTML"],Zf={key:1,class:"flex w-full"},Jf={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},Yf=["onClick"],Xf={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},Qf={class:"flex-1 p-4"},Vf=["innerHTML"],eu={class:"grid grid-cols-12 gap-4"},tu={key:3,class:"w-full h-full"},Jt=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const x=typeof window<"u"?window:globalThis,I="__vsCardAnonymousCounter__",_=x[I]??0;return x[I]=_+1,_===0?"tab":`tab${_}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,x=>{x&&(a.value=x)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(x,I){const _=I?.path;return _?(c.has(_)||c.set(_,e.defineAsyncComponent(()=>import(_))),c.get(_)):typeof x=="string"&>[x]?gt[x]:I?.component&>[I.component]?gt[I.component]:I?.name&>[I.name]?gt[I.name]:x}function p(x){return x.forEach(I=>{I.type&&(I.view=I.type)}),r.value=x.filter(I=>I.type==="pin"),x.filter(I=>I.type!=="pin")}const f=e.computed(()=>{let x;return n.panels&&n.panels.length>0?x=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(x=n.data.filter(_=>_.type.includes("tabs"))[0]?.items),In(x,12)}),b=e.computed(()=>a.value);function N(){i||(i=!0)}const g=e.computed(()=>{let x;return n.panels&&n.panels.length>0?x=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(x=n.data),In(x,12)}),k=e.computed(()=>({[`view-${n.view}`]:!0}));function w(x,I){if(!x||typeof I!="string"||!I)return{found:!1,value:void 0};const _=I.split(".");let P=x;for(const le of _){if(P==null||typeof P!="object"&&!Array.isArray(P))return{found:!1,value:void 0};if(!(le in P))return{found:!1,value:void 0};P=P[le]}return{found:!0,value:P}}const F=x=>{const I={...x};return Object.entries(I).forEach(([_,P])=>{if(_!=="props"&&typeof P=="string"){const le=w(n.data,P);le.found&&(I[_]=le.value)}}),x.props&&typeof x.props=="object"&&Object.entries(x.props).forEach(([_,P])=>{if(typeof P=="string"){const le=w(n.data,P);I[_]=le.found?le.value:P}else I[_]=P}),delete I.props,n.data&&(I.data=n.data),I};function T(x){const I=["col-span-12"],_=dr(x.col);return _.length&&I.push(..._),I}const E=e.ref([]),y=e.ref([]),O=e.ref([]);function q(x,I){x&&x instanceof HTMLElement&&(E.value[I]=x)}function L(){y.value=E.value.map(x=>x.offsetWidth),O.value=E.value.map(x=>x.offsetLeft)}function M(){if(typeof window>"u")return null;const x=b.value;if(!x)return null;const _=new URL(window.location.href).searchParams.get(x);if(_===null)return null;const P=Number.parseInt(_,10);return Number.isNaN(P)?null:P}function W(x){if(typeof window>"u")return;const I=b.value;if(!I||!i)return;const _=new URL(window.location.href);x<=0?_.searchParams.delete(I):_.searchParams.set(I,String(x));const P=window.history.state??{};window.history.replaceState(P,document.title,_)}function G(){if(l||!f.value.length)return;N();const x=M();if(x===null)return;const I=Math.min(Math.max(x,0),f.value.length-1);I!==x&&W(I),I!==s.value&&(s.value=I),l=!0}function J(){l=!1,G()}let K=null;return e.onMounted(()=>{e.nextTick(()=>{G(),L()}),typeof window<"u"&&window.addEventListener("popstate",J),K=new ResizeObserver(()=>L()),K.observe(document.body)}),e.onBeforeUnmount(()=>{K?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",J)}),e.watch(s,x=>{e.nextTick(()=>{L()}),W(x)}),e.watch(f,()=>{l=!1,G()}),(x,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(x.classWrapper||k.value)},[e.createElementVNode("div",Uf,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",qf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(_,P)=>(e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Wf)):_.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component,_)),e.mergeProps({key:1,ref_for:!0},_.component==="Card"?_:F(_),{id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[x.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",x.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",x.styling?.classTabHeader])},[y.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:y.value[s.value]+"px",left:O.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,P)=>(e.openBlock(),e.createElementBlock("button",{key:_.name||P,ref_for:!0,ref:le=>q(le,P),onClick:le=>s.value=P,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===P?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(_.title||_.label||_.name||`Tab ${P+1}`),11,Kf))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([x.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x.classPanel||"w-full border-gray-100"])},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Gf)):x.$slots[`tab-${P}`]?e.renderSlot(x.$slots,`tab-${P}`,{key:1,item:_,data:x.data}):_.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Zt),e.mergeProps({key:2,ref_for:!0},F(_),{items:_.items,"hide-title":!0,class:["w-full h-full",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component||_.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component||_.name,_)),e.mergeProps({key:3,ref_for:!0},_.component==="Card"?_:F(_),{styling:x.styling,id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(x.$slots,_.slot||`tab-${P}`,{key:4,item:_,data:x.data})],2)),[[e.vShow,s.value===P]])),128))],2)],2)):x.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",Zf,[e.createElementVNode("div",Jf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,P)=>(e.openBlock(),e.createElementBlock("button",{key:_.name||P,onClick:le=>s.value=P,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===P?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(_.title||_.label||_.name||`Tab ${P+1}`)+" ",1),s.value===P?(e.openBlock(),e.createElementBlock("span",Xf,I[0]||(I[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,Yf))),128))]),e.createElementVNode("div",Qf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x.classPanel||"w-full border-gray-100 py-2"])},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Vf)):x.$slots[`tab-${P}`]?e.renderSlot(x.$slots,`tab-${P}`,{key:1,item:_,data:x.data}):_.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Zt),e.mergeProps({key:2,ref_for:!0},F(_),{items:_.items,"hide-title":!0,class:["w-full h-full",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component||_.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component||_.name,_)),e.mergeProps({key:3,ref_for:!0},_.component==="Card"?_:F(_),{id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(x.$slots,_.slot||`tab-${P}`,{key:4,item:_,data:x.data})],2)),[[e.vShow,s.value===P]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(x.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(_,P)=>(e.openBlock(),e.createElementBlock("div",{key:_.name||_.component||P,class:e.normalizeClass(T(_))},[x.$slots[`panel-${P}`]?e.renderSlot(x.$slots,`panel-${P}`,{key:0,item:_,data:x.data}):_.items||_.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Zt),e.mergeProps({key:1,ref_for:!0},F(_),{items:_.items||[],class:["w-full h-auto",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component,_)),e.mergeProps({key:2,ref_for:!0},F(_),{class:["w-full h-auto",[x.styling?.classItem]],styling:x.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",tu,[e.renderSlot(x.$slots,_.slot||`panel-${P}`,{item:_,data:x.data})]))],2))),128))])],2))],2)])],2))}}),nu=["onClick"],pr=tt(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const i={id:s++,timer:setTimeout(()=>{l(i.id)},1500)};o.value.push(i)},l=i=>{const a=o.value.findIndex(c=>c.id===i);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(i=>{clearTimeout(i.timer)})}),(i,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(wr),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>l(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(On),{class:"h-4 w-4"})],8,nu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);Jt.install=function(t){t.component("vs-widget-file",nn),t.component("vs-widget-comments",en),t.component("vs-widget-history",tn),t.component("vs-widget-gallery",on),t.component("vs-widget-map",cn),t.component("vs-group-interface",Ln),t.component("CommentsWidget",en),t.component("HistoryWidget",tn),t.component("GalleryWidget",on),t.component("FilesWidget",nn),t.component("MapWidget",cn),t.component("Card",Jt),t.component("CardItem",Zt),t.component("DescriptionListWidget",Rn),t.component("CopyNotification",pr),t.component("GroupInterfaceWidget",Ln)},ye.Card=Jt,ye.CardItem=Zt,ye.CommentsWidget=en,ye.CopyNotification=pr,ye.DescriptionListWidget=Rn,ye.FilesWidget=nn,ye.GalleryWidget=on,ye.GroupInterfaceWidget=Ln,ye.HistoryWidget=tn,ye.MapWidget=cn,ye.TableWidget=lr,ye.default=Jt,Object.defineProperties(ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
161
|
+
**/const Us=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),qs=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Ws=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Ks=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),So=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Gs=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Zs=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Js=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Bo=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Ys=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");Sc({[Us]:"vModelRadio",[qs]:"vModelCheckbox",[Ws]:"vModelText",[Ks]:"vModelSelect",[So]:"vModelDynamic",[Gs]:"withModifiers",[Zs]:"withKeys",[Js]:"vShow",[Bo]:"Transition",[Ys]:"TransitionGroup"});let Dt;function op(t,n=!1){return Dt||(Dt=document.createElement("div")),n?(Dt.innerHTML=`<div foo="${t.replace(/"/g,""")}">`,Dt.children[0].getAttribute("foo")):(Dt.innerHTML=t,Dt.textContent)}const sp={parseMode:"html",isVoidTag:Ec,isNativeTag:t=>vc(t)||bc(t)||kc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:op,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Bo;if(t==="TransitionGroup"||t==="transition-group")return Ys},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},rp=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:X("style",!0,n.loc),exp:ip(n.value.content,n.loc),modifiers:[],loc:n.loc})})},ip=(t,n)=>{const o=uc(t);return X(JSON.stringify(o),!1,n,3)};function Ue(t,n){return re(t,n,process.env.NODE_ENV!=="production"?lp:void 0)}const lp={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},ap=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(53,r)),n.children.length&&(o.onError(Ue(54,r)),n.children.length=0),{props:[pe(X("innerHTML",!0,r),s||X("",!0))]}},cp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(55,r)),n.children.length&&(o.onError(Ue(56,r)),n.children.length=0),{props:[pe(X("textContent",!0),s?Re(s,o)>0?s:ye(o.helperString(fn),[s],r):X("",!0))]}},dp=(t,n,o)=>{const s=zs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Ue(58,t.arg.loc));function r(){const a=Le(n,"bind");a&&ct(a.arg,"value")&&o.onError(Ue(60,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=Ws,c=!1;if(l==="input"||i){const d=Wt(n,"type");if(d){if(d.type===7)a=So;else if(d.value)switch(d.value.content){case"radio":a=Us;break;case"checkbox":a=qs;break;case"file":c=!0,o.onError(Ue(59,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else zc(n)?a=So:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=Ks:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Ue(57,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},pp=Ge("passive,once,capture"),fp=Ge("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),up=Ge("left,right"),Xs=Ge("onkeyup,onkeydown,onkeypress"),mp=(t,n,o,s)=>{const r=[],l=[],i=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&It("COMPILER_V_ON_NATIVE",o,s)||pp(c)?i.push(c):up(c)?$e(t)?Xs(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):fp(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},Qs=(t,n)=>$e(t)&&t.content.toLowerCase()==="onclick"?X(n,!0):t.type!==4?He(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,hp=(t,n,o)=>Ps(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=mp(l,r,o,t.loc);if(c.includes("right")&&(l=Qs(l,"onContextmenu")),c.includes("middle")&&(l=Qs(l,"onMouseup")),c.length&&(i=ye(o.helper(Gs),[i,JSON.stringify(c)])),a.length&&(!$e(l)||Xs(l.content.toLowerCase()))&&(i=ye(o.helper(Zs),[i,JSON.stringify(a)])),d.length){const m=d.map(Gn).join("");l=$e(l)?X(`${l.content}${m}`,!0):He(["(",l,`) + "${m}"`])}return{props:[pe(l,i)]}}),gp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(61,r)),{props:[],needRuntime:o.helper(Js)}},yp=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Bo)return()=>{if(!t.children.length)return;Vs(t)&&n.onError(Ue(62,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function Vs(t){const n=t.children=t.children.filter(s=>s.type!==3&&!(s.type===2&&!s.content.trim())),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(Vs)}const vp=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Ue(63,t.loc)),n.removeNode())};function bp(t,n){return t==="template"?!0:t in er?er[t].has(n):n in tr?tr[n].has(t):!(t in nr&&nr[t].has(n)||n in or&&or[n].has(t))}const At=new Set(["h1","h2","h3","h4","h5","h6"]),gt=new Set([]),er={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:gt,iframe:gt,option:gt,textarea:gt,style:gt,title:gt},tr={html:gt,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},nr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},or={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:At,h2:At,h3:At,h4:At,h5:At,h6:At},kp=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!bp(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Ep=[rp,...process.env.NODE_ENV!=="production"?[yp,kp]:[]],wp={cloak:np,html:ap,text:cp,model:dp,on:hp,show:gp};function Np(t,n={}){return tp(t,rt({},sp,n,{nodeTransforms:[vp,...Ep,...n.nodeTransforms||[]],directiveTransforms:rt({},wp,n.directiveTransforms||{}),transformHoist:null}))}function xp(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Np(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(hr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const To={};function _p(t){return To[t]||(To[t]=xp(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),To[t]}const Cp={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Sp={class:"flex items-center gap-2"},Bp=["disabled"],Tp={class:"text-sm"},$p=["disabled"],Lp=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,l)=>(e.openBlock(),e.createElementBlock("div",Cp,[e.createElementVNode("div",null,e.toDisplayString(r.label),1),e.createElementVNode("div",Sp,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:l[0]||(l[0]=i=>r.$emit("previous"))}," Назад ",8,Bp),e.createElementVNode("span",Tp,"Сторінка "+e.toDisplayString(r.currentPage)+" з "+e.toDisplayString(r.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:l[1]||(l[1]=i=>r.$emit("next"))}," Далі ",8,$p)])]))}}),Ip={class:"relative inline-flex"},Dp=["aria-label"],Ap={class:"px-3 pb-2"},Op={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Mp=["onClick"],Rp={class:"truncate"},Pp={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Fp="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",zp=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),l=e.ref(!1),i=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),p=e.ref({top:0,left:0}),u=e.computed(()=>{if(!i.value)return a.value;const T=i.value.toLowerCase();return a.value.filter(E=>b(E).toLowerCase().includes(T))});e.watch(()=>o.columns,T=>{if(!T){a.value=[];return}const E=JSON.stringify(T),y=JSON.stringify(a.value);E!==y&&(a.value=[...T])},{deep:!0}),e.watch(a,T=>{s("update:columns",T)},{deep:!0});function b(T){return T.ua||T.label||T.name||"Колонка"}function N(T){const E=!T.hidden;E&&a.value.filter(y=>!y.hidden).length<=1||(T.hidden=E)}function g(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),k()})}function k(){if(!c.value)return;const T=c.value.getBoundingClientRect();p.value={top:T.bottom+window.scrollY+6,left:T.left+window.scrollX-200}}function w(T){if(!l.value)return;const E=T.target;E&&(d.value?.contains(E)||c.value?.contains(E)||(l.value=!1))}function F(T){T.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",w,!0),document.addEventListener("keydown",F)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",w,!0),document.removeEventListener("keydown",F)}),(T,E)=>(e.openBlock(),e.createElementBlock("div",Ip,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:g,class:e.normalizeClass([Fp,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},E[2]||(E[2]=[e.createStaticVNode('<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="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)]),10,Dp),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${p.value.top}px`,left:`${p.value.left}px`})},[E[5]||(E[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Ap,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":E[0]||(E[0]=y=>i.value=y),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Op,[E[4]||(E[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:E[1]||(E[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,y=>(e.openBlock(),e.createElementBlock("li",{key:y.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:M=>N(y)},[e.createElementVNode("span",Rp,e.toDisplayString(b(y)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",y.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[y.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Pp,E[3]||(E[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])))],2)],8,Mp))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),jp=["data-action-key"],Hp=["onClick"],Up={key:0,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"},qp={key:1,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"},Wp={key:2,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"},Kp={key:3,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"},Gp=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),l=e.computed(()=>!!o.actions?.length),i=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(N){N.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const N=r.value;if(!N)return{};const g=N.getBoundingClientRect(),k=8,w=160,E=(o.actions?.length??0)*36+k*2,y=i.value.height||(typeof window<"u"?window.innerHeight:0),M=i.value.width||(typeof window<"u"?window.innerWidth:0),q=i.value.scrollX||(typeof window<"u"?window.scrollX:0),L=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let R=g.bottom+L+k,W=g.right+q-w;const G=q+M-w-k;return W>G&&(W=G),W<q+k&&(W=q+k),R+E>L+y-k&&(R=g.top+L-E-k),R<L+k&&(R=L+k),{top:`${R}px`,left:`${W}px`,width:"auto"}});function p(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function u(){typeof window>"u"||a.value||(a.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function b(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>o.isOpen,N=>{N?u():b()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&u()}),e.onBeforeUnmount(()=>{b()}),(N,g)=>l.value&&N.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":N.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},g[1]||(g[1]=[e.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"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[N.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:g[0]||(g[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.actions,k=>(e.openBlock(),e.createElementBlock("button",{key:k.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",k.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:w=>d(k)},[e.renderSlot(N.$slots,"icon",{action:k},()=>[k.type==="view"?(e.openBlock(),e.createElementBlock("svg",Up,g[2]||(g[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))):k.type==="edit"?(e.openBlock(),e.createElementBlock("svg",qp,g[3]||(g[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)]))):k.type==="delete"?(e.openBlock(),e.createElementBlock("svg",Wp,g[4]||(g[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Kp,g[5]||(g[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])))]),e.createTextVNode(" "+e.toDisplayString(k.label),1)],10,Hp))),128))],4)):e.createCommentVNode("",!0)]))],8,jp)):e.createCommentVNode("",!0)}}),sr=typeof window<"u",rr=typeof document<"u";function Zp(t){if(!rr)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function ir(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function $o(t,n){if(!rr||!sr)return;const o=Zp(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!sr)return;o.textContent=s.options.text;const i=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(i.left,c));o.style.left=`${d}px`,o.style.top=`${i.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function Lo(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const Jp={mounted(t,n){const o=ir(n.value);o&&$o(t,o)},updated(t,n){const o=ir(n.value),s=t;if(!o){Lo(s);return}const r=s.__tooltipState__;if(!r){$o(s,o);return}if(r.options.wrap!==o.wrap){Lo(s),$o(s,o);return}r.options=o},unmounted(t){Lo(t)}},Yp={class:"flex flex-col gap-4 mb-[15px]"},Xp={class:"flex flex-wrap items-center gap-4"},Qp={class:"relative"},Vp={class:"ml-auto flex items-center gap-2"},ef={class:"overflow-x-auto"},tf={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},nf={class:"text-left font-medium text-gray-700"},of={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},sf={class:"divide-y divide-gray-200"},rf=["href"],lf={key:2},af={key:3},cf={key:0,class:"py-2 pr-4 text-right"},df={key:0},pf={key:0},ff=["colspan"],lr=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=Jp,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),p=e.ref(10),u=e.ref(0),b=e.ref(0),N=e.ref("id"),g=e.ref("");let k=null,w=0;const F=e.ref(null);async function T(){const v=m.value,B=++w,C=new URLSearchParams,S=d.value.trim();S&&C.set("search",S),C.set("page",String(v)),C.set("limit",String(p.value));const V=`/api/data/${l.token}${C.toString()?`?${C.toString()}`:""}`;let Q;try{const Ee=await fetch(V);if(!Ee.ok)throw new Error(`Request failed with status ${Ee.status}`);Q=await Ee.json()}catch(Ee){B===w&&(o.value=[],b.value=0,u.value=0),console.error("Failed to load table data",Ee);return}if(B!==w)return;o.value=Array.isArray(Q?.rows)?Q.rows:[],s.value=J(Q?.columns||[]),i.value=Array.isArray(Q?.actions)?Q.actions:[],a.value=Q?.form,c.value=Q?.addToken,N.value=typeof Q?.pk=="string"&&Q.pk?Q.pk:N.value,typeof Q?.form=="string"&&Q.form&&(g.value=Q.form.replace(/\.form$/,".table")),Y();const se=Number(Q?.total??Q?.count??Q?.totalCount),xe=Number(Q?.filtered??Q?.filteredCount);u.value=Number.isFinite(se)&&se>0?se:o.value.length,b.value=Number.isFinite(xe)&&xe>0?xe:Math.max(o.value.length,u.value);const Ke=Math.max(1,Math.ceil((b.value||o.value.length||1)/p.value));let Fe=v;typeof Q?.page=="number"&&Q.page>0&&(Fe=Q.page),Fe>Ke&&(Fe=Ke),Fe<1&&(Fe=1);const Mt=Fe!==v;if(m.value=Fe,Mt&&b.value>0)return T()}const{$notify:E,$confirm:y,$form:M}=n?.appContext?.config?.globalProperties||{};function q(){if(_e.emitter?.emit){_e.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}T()}async function L(v){typeof M=="function"&&(await M({token:v.token}),q())}async function R(){typeof M=="function"&&(await M({token:c.value}),q())}function W(v){y({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const B=await fetch(`/api/table/${v.token}`,{method:"DELETE"});if(!B.ok){const{error:C}=await B.json();E({title:"Помилка",type:"warning",message:C});return}E({title:"Видаленно",message:"Успішно видалено"}),await T()}})}e.onMounted(async()=>{await T(),_e.emitter?.on?.("updateCard",T)}),e.onBeforeUnmount(()=>{_e.emitter?.off?.("updateCard",T)});function G(v){return typeof v?.format=="string"?v.format.toLowerCase():""}function J(v){const B=new Map;s.value.forEach(S=>{S?.name&&B.set(S.name,!!S.hidden)});const C=v.map(S=>{const V=B.has(S.name)?B.get(S.name):!!S.hidden;return{...S,hidden:V}});return C.length&&!C.some(S=>!S.hidden)&&(C[0].hidden=!1),C}const K=e.computed(()=>{const v=s.value.filter(B=>!B.hidden);return v.length?v:s.value}),x=e.computed(()=>{const v=[],B=new Set;for(const C of i.value){if(typeof C=="string"){if(C==="edit"){const S="row:edit";B.has(S)||(v.push({key:S,type:"edit",label:"Редагувати",scope:"row",handler:he}),B.add(S));continue}if(C==="delete"||C==="del"){const S="row:delete";B.has(S)||(v.push({key:S,type:"delete",label:"Видалити",scope:"row",handler:Be,variant:"danger"}),B.add(S));continue}if(C==="add"){const S="toolbar:add";B.has(S)||(v.push({key:S,type:"add",label:"Додати",scope:"toolbar"}),B.add(S))}continue}if(C&&typeof C=="object"){const S=String(C.name??C.type??"action"),V=String(C.label??C.title??S),Q=C.scope==="toolbar"?"toolbar":"row",se=`${Q}:${S}`;if(B.has(se))continue;B.add(se),v.push({key:se,type:S,label:V,scope:Q,handler:Q==="row"?xe=>be(C,xe):void 0,variant:C.variant==="danger"?"danger":"default",original:C})}}return v}),I=e.computed(()=>x.value.filter(v=>v.scope==="row"&&typeof v.handler=="function")),_=e.computed(()=>x.value.filter(v=>v.scope==="toolbar")),P=e.computed(()=>I.value.length>0),le=e.computed(()=>_.value.some(v=>v.type==="add")),Ae=e.computed(()=>o.value),Te=e.computed(()=>{const v=b.value||Ae.value.length,B=Math.ceil(v/p.value);return B>0?B:1}),fe=e.computed(()=>{const v=Ae.value.length,B=b.value||v,C=u.value||B;return`Показано ${v} з ${B} (усього ${C})`});function ve(){m.value<Te.value&&(m.value+=1,T())}function z(){m.value>1&&(m.value-=1,T())}e.watch(s,v=>{v?.length&&(v.some(B=>!B.hidden)||(v[0].hidden=!1))},{deep:!0});function U(){k&&clearTimeout(k),Y(),k=setTimeout(()=>{m.value=1,T()},300)}function H(v){const B=N.value||"id",C=v?.token??v?.[B]??v?.id;return C?String(C):""}function oe(v){const B=K.value[v],C=["py-2",...h(B)];v===0&&C.push("pl-4");const S=v===K.value.length-1&&!P.value;return C.push(S?"pr-4":"pr-5"),C.join(" ")}function ae(v,B){const C=["py-2",...h(B)];G(B)==="badge"&&C.push("center"),ue(B)==="wrap"?C.push("whitespace-normal","break-words"):C.push("truncate"),v===0&&C.push("pl-4");const S=v===K.value.length-1&&!P.value;return C.push(S?"pr-4":"pr-5"),C.join(" ")}function ue(v){return(typeof v?.overflow=="string"?v.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function h(v){const B=[],C=se=>{if(se==null||se==="")return;const xe=Number(se);return Number.isFinite(xe)&&xe>0?`${xe}px`:String(se).replace(/\s+/g,"")},S=C(v?.width),V=C(v?.minWidth),Q=C(v?.maxWidth);return S?(B.push(`min-w-[${S}]`,`max-w-[${S}]`),B):(B.push(`min-w-[${V??"100px"}]`),B.push(`max-w-[${Q??"350px"}]`),B)}function $(v){if(!I.value.length)return!1;const B=N.value||"id";return!!(v?.token||v?.[B]||v?.id)}function A(v){return F.value===H(v)}function j(v){const B=H(v);B&&(F.value=F.value===B?null:B)}function Y(){F.value=null}function Z(v,B){const C=B?.tooltip;if(!C)return;const S=kt(v,B);let V,Q=B?.tooltipWrap!==!1;if(typeof C=="string"){const se=C.trim();if(!se)return;const xe=se.toLowerCase();if(["true","1","yes"].includes(xe))V=typeof S=="string"?S:String(S??"");else{if(["false","0","no"].includes(xe))return;V=se}}else C===!0?V=S:typeof C=="object"&&(typeof C.text=="string"&&(V=C.text.trim()),typeof C.wrap=="boolean"&&(Q=C.wrap!==!1));if(!V){if(S==null||S==="")return;V=String(S)}if(V.trim())return Q?{text:V,wrap:!0}:V}function he(v){Y(),L(v)}function Be(v){Y(),W(v)}async function be(v,B){Y();const C=N.value||"id",S=v.isId?B?.[C]??B?.id:B?.token??B?.[C]??B?.id;if(!S){console.warn("Cannot execute action without identifier",v);return}if(v.form&&typeof v.api=="string"&&v.api&&typeof M=="function"){await Ye(v,B,S);return}if(v.form&&typeof M=="function"){const V=await qe(v.form,S),Q={form:v.form,token:V?.token??B?.token??S,schema:V?.schema,mode:V?.mode??"edit"};V?.data!==void 0&&(Q.defaultValue=V.data);try{await M(Q),q()}catch(se){console.error("Failed to execute form action",se)}return}if(typeof v.api=="string"&&v.api){const V=Je(v.api,S);window.location.href=V;return}B?.token&&typeof M=="function"&&(await M({token:B.token}),q())}function Je(v,B){return`${v.endsWith("/")?v:`${v}/`}${B}`}async function qe(v,B){const C=`/api/form/${v}/${B}`;try{const S=await fetch(C);if(!S.ok)throw new Error(`Request failed with status ${S.status}`);return await S.json()}catch(S){console.error("Failed to load form config",S),E({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Dn(v){const B=`/api/template/form/${v}`;try{const C=await fetch(B);if(!C.ok)throw new Error(`Request failed with status ${C.status}`);return(await C.json())?.schema}catch(C){console.error("Failed to load form template",C);return}}function Pe(v){if(v!=null){if(v?.data!==void 0)return v.data;if(v?.defaultValue!==void 0)return v.defaultValue;if(v?.values!==void 0)return v.values;if(typeof v=="object"&&!Array.isArray(v)){const{schema:B,token:C,mode:S,message:V,successMessage:Q,...se}=v;if(Object.keys(se).length)return se}}}async function Ye(v,B,C){const S=Je(v.api,C),V=(typeof v.method=="string"?v.method:"PUT").toUpperCase();let Q;try{const Ee=await fetch(S);if(!Ee.ok)throw new Error(`Request failed with status ${Ee.status}`);Q=await Ee.json()}catch(Ee){console.error("Failed to load action data",Ee),nt("Не вдалося отримати дані форми.");return}const se=typeof v.form=="string"?v.form.replace(/\.table$/,".form"):void 0,xe=Q?.schema??(se?await Dn(se):void 0),Ke={mode:Q?.mode??"edit"};se&&(Ke.form=se),xe&&(Ke.schema=xe);const Fe=Pe(Q);Fe!==void 0&&(Ke.defaultValue=Fe);const Mt=await M(Ke);if(Mt)try{const Ee=await fetch(S,{method:V,headers:{"Content-Type":"application/json"},body:JSON.stringify(Mt)});if(!Ee.ok){const Ve=await We(Ee),Xt=Ve?.error??Ve?.message??"Не вдалося зберегти дані.";throw new Error(Xt)}Ot(`Дані успішно ${Ke.value==="add"?"збережено":"оновлено"}`),q()}catch(Ee){console.error("Failed to submit action data",Ee),nt("Не вдалося зберегти дані.")}}async function We(v){try{return await v.json()}catch{return}}function nt(v){E({title:"Помилка",type:"error",message:v})}function Ot(v){E({title:"Успіх",type:"success",message:v})}function vt(v){if(!F.value)return;const B=v.target;if(!B)return;const C=B.closest("[data-action-key]");C&&C.getAttribute("data-action-key")===F.value||Y()}e.onMounted(()=>{document.addEventListener("click",vt,!0)}),e.onBeforeUnmount(()=>{k&&clearTimeout(k),document.removeEventListener("click",vt,!0),_e.emitter?.off?.("updateCard",T)});function bt(v,B){const S=v?.[`${B.name}_text`];if(Array.isArray(S))return S.length?S.join(", "):"-";if(S!=null&&S!=="")return S;const V=v?.[B.name];return Array.isArray(V)?V.length?V.join(", "):"-":V??"-"}function Xe(v,B){const S=v?.[`${B.name}_data`];if(S&&typeof S=="object")return{text:S.text??S.label??S.name??S.title??"-",color:S.color,textColor:S.textColor};const V=v?.[`${B.name}_text`]??v?.[B.name];return{text:(Array.isArray(V)?V.join(", "):V)??"-"}}function Qe(v,B){const C=Xe(v,B);return C.color?{backgroundColor:C.color,color:C.textColor??"#ffffff"}:{}}function kt(v,B){const C=G(B);if(C==="badge")return Xe(v,B).text;if(C==="select")return bt(v,B);if(C==="slot")return"-";if(C==="text")return v?.[B.name]??"-";const S=v?.[`${B.name}_data`];return S!=null&&typeof S!="object"?S:v?.[`${B.name}_text`]??v?.[B.name]??"-"}return(v,B)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Yp,[e.createElementVNode("div",Xp,[e.createElementVNode("div",Qp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[0]||(B[0]=C=>d.value=C),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:U},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",Vp,[e.createVNode(zp,{columns:s.value,"onUpdate:columns":B[1]||(B[1]=C=>s.value=C)},null,8,["columns"]),le.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:R,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},B[2]||(B[2]=[e.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"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)]))):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",ef,[e.createElementVNode("table",tf,[e.createElementVNode("thead",nf,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(C,S)=>(e.openBlock(),e.createElementBlock("th",{key:C.name,class:e.normalizeClass(oe(S))},e.toDisplayString(C.ua),3))),128)),P.value?(e.openBlock(),e.createElementBlock("th",of," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",sf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,C=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:C.id??JSON.stringify(C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(S,V)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:S.name,class:e.normalizeClass(ae(V,S))},[S.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:S.link.replace("{{id}}",C.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(kt(C,S)),9,rf)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[G(S)==="slot"&&(S.slot?.content||S.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_p)(S.slot.content||S.slot)),{key:0,data:C,row:C,column:S,value:C?.[S.name]},null,8,["data","row","column","value"])):G(S)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(Qe(C,S))},e.toDisplayString(Xe(C,S).text),5)):G(S)==="select"?(e.openBlock(),e.createElementBlock("span",lf,e.toDisplayString(bt(C,S)),1)):(e.openBlock(),e.createElementBlock("span",af,e.toDisplayString(kt(C,S)),1))],64))],2)),[[e.unref(r),Z(C,S)]])),128)),P.value?(e.openBlock(),e.createElementBlock("td",cf,[$(C)?(e.openBlock(),e.createElementBlock("div",df,[e.createVNode(Gp,{row:C,actions:I.value,"is-open":A(C),"action-key":H(C),onToggle:S=>j(C)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),Ae.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",pf,[e.createElementVNode("td",{colspan:K.value.length+(P.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,ff)]))])])]),e.createVNode(Lp,{"current-page":m.value,"total-pages":Te.value,label:fe.value,onPrevious:z,onNext:ve},null,8,["current-page","total-pages","label"])]))}}),uf={class:"p-[20px]"},mf={class:"flex gap-[6px] mb-5"},hf={class:"vs-form-text relative bg-white rounded-lg flex-grow"},gf={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},yf={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},vf={class:"space-y-8"},bf={key:0},kf={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ef=["onClick"],wf={class:"md:col-span-2"},Nf={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},xf={class:"text-sm text-gray-500 dark:text-neutral-500"},_f={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Cf=["checked","onChange"],Sf={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Bf={class:"md:col-span-2"},Tf={class:"font-semibold text-gray-800 dark:text-neutral-200"},$f=["onClick"],Lf={class:"md:col-span-2"},If={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Df={class:"text-sm text-gray-500 dark:text-neutral-500"},Af={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Of=["checked","onChange"],$n="uk",Ln=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return $n;const E=localStorage.language,y=typeof navigator<"u"?navigator.language:$n;return(E||y||$n).split(/[-_]/)[0].toLowerCase()||$n},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c=()=>{a.value=o()},d=()=>{const E=[];return a.value&&E.push(a.value),n.forEach(y=>{y&&!E.includes(y)&&E.push(y)}),E.includes("path")||E.push("path"),E},m=E=>{const y=d();for(const M of y){const q=E[M];if(typeof q=="string"&&q.trim())return q}return""};e.onMounted(async()=>{c();const y=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();y.routes&&y.routes.forEach(M=>{i.value[M.path]=new Set(M.actions)})});const p=(E,y)=>i.value[E]?.has(y)??!1,u=(E,y)=>{i.value[E]||(i.value[E]=new Set),i.value[E].has(y)?i.value[E].delete(y):i.value[E].add(y)},b=(E,y)=>{E.forEach(M=>{M.path&&(i.value[M.path]||(i.value[M.path]=new Set),i.value[M.path].has(y)?i.value[M.path].delete(y):i.value[M.path].add(y))})},N=e.computed(()=>Object.entries(i.value).map(([E,y])=>({path:E,actions:Array.from(y)})).filter(E=>E.actions.length)),g=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:N.value})}),_e.notify({title:"Success!",message:"Permissions saved."})},k=()=>{i.value={}},w=E=>{if(!r.value.trim())return E;const y=r.value.toLowerCase();return E.filter(M=>m(M).toLowerCase().includes(y)||(M.path?.toLowerCase().includes(y)??!1))},F=e.computed(()=>w(s.data.routers.filter(E=>!E.menu))),T=e.computed(()=>s.data.routers.filter(E=>E.menu).map(E=>({...E,menu:w(E.menu||[])})).filter(E=>E.menu&&E.menu.length>0));return(E,y)=>(e.openBlock(),e.createElementBlock("div",uf,[e.createElementVNode("div",mf,[e.createElementVNode("div",hf,[y[1]||(y[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":y[0]||(y[0]=M=>r.value=M),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm 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,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:k,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:g,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",gf,[y[2]||(y[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(M,q)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:q},[e.createElementVNode("h3",yf,e.toDisplayString(M),1)])),64))]),e.createElementVNode("div",vf,[F.value.length?(e.openBlock(),e.createElementBlock("div",bf,[e.createElementVNode("ul",kf,[y[3]||(y[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(M,q)=>e.createElementVNode("li",{key:q,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:L=>b(F.value,l[q])}," Toggle all ",8,Ef)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(M,q)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+q,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",wf,[e.createElementVNode("p",Nf,e.toDisplayString(m(M)),1),e.createElementVNode("p",xf,e.toDisplayString(M.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(L,R)=>e.createElementVNode("li",{key:R,class:"col-span-1"},[e.createElementVNode("div",_f,[e.createElementVNode("input",{type:"checkbox",checked:p(M.path,L),onChange:W=>u(M.path,L),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Cf)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(M,q)=>(e.openBlock(),e.createElementBlock("div",{key:q,class:"space-y-5"},[e.createElementVNode("ul",Sf,[e.createElementVNode("li",Bf,[e.createElementVNode("h3",Tf,e.toDisplayString(m(M)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(L,R)=>e.createElementVNode("li",{key:R,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:W=>b(M.menu,l[R])}," Toggle all ",8,$f)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.menu,(L,R)=>(e.openBlock(),e.createElementBlock("ul",{key:R,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Lf,[e.createElementVNode("p",If,e.toDisplayString(m(L)),1),e.createElementVNode("p",Df,e.toDisplayString(L.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(W,G)=>e.createElementVNode("li",{key:G,class:"col-span-1"},[e.createElementVNode("div",Af,[e.createElementVNode("input",{type:"checkbox",checked:p(L.path,W),onChange:J=>u(L.path,W),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Of)])])),64))]))),128))]))),128))])]))}}),yt={"vs-widget-comments":en,"vs-widget-history":tn,"vs-widget-gallery":on,"vs-widget-file":nn,"vs-widget-list":Pn,"vs-widget-map":cn,"vs-widget-table":lr,"vs-group-interface":Ln};function ar(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function cr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>cr(o))),n}function Mf(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=ar(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let l=n-r;if(s.length===0)return;l<=0&&(l=n);const i=Math.max(1,Math.floor(l/s.length));let a=Math.max(0,l-i*s.length);s.forEach(c=>{let d=i;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function In(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>cr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=In(s.items,12))}),Mf(o,n),o}function dr(t){const n=ar(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Rf={class:"text-lg font-semibold text-gray-900"},Pf=["innerHTML"],Ff={key:0,class:"grid grid-cols-12 gap-4"},zf={key:0,class:"mb-4 pb-2 border-b border-gray-200"},jf={class:"text-lg font-semibold text-gray-900"},Hf=["innerHTML"],Jt=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>In(n.items));function r(d){const m=["col-span-12"],p=dr(d.col);return p.length&&m.push(...p),m}function l(d){return yt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const p=m.split(".");let u=d;for(const b of p){if(u==null||typeof u!="object"&&!Array.isArray(u))return{found:!1,value:void 0};if(!(b in u))return{found:!1,value:void 0};u=u[b]}return{found:!0,value:u}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([p,u])=>{if(p!=="props"&&typeof u=="string"){const b=i(n.data,u);b.found&&(m[p]=b.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,u])=>{if(typeof u=="string"){const b=i(n.data,u);m[p]=b.found?b.value:u}else m[p]=u}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,d.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!d.hideTitle&&d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",d.styling?.classItemTitle])},[e.createElementVNode("h3",Rf,e.toDisplayString(d.title),1)],2)):e.createCommentVNode("",!0),d.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.html,class:"text-gray-900 leading-relaxed"},null,8,Pf)):d.type?.includes("tabs")?(e.openBlock(),e.createBlock(Yt,{key:2,view:d.type,panels:d.items,data:d.data,styling:d.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Ff,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(p,u)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||u,class:e.normalizeClass(r(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",zf,[e.createElementVNode("h3",jf,e.toDisplayString(p.title||p.label),1)])):e.createCommentVNode("",!0),p.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:p.html,class:"text-gray-900 leading-relaxed"},null,8,Hf)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:d.data.geom,id:d.data.id,...c.value,...a(p),data:d.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),Uf={class:"grid grid-cols-12 gap-[20px]"},qf={key:0,class:"col-span-4"},Wf=["innerHTML"],Kf=["onClick"],Gf=["innerHTML"],Zf={key:1,class:"flex w-full"},Jf={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},Yf=["onClick"],Xf={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},Qf={class:"flex-1 p-4"},Vf=["innerHTML"],eu={class:"grid grid-cols-12 gap-4"},tu={key:3,class:"w-full h-full"},Yt=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const x=typeof window<"u"?window:globalThis,I="__vsCardAnonymousCounter__",_=x[I]??0;return x[I]=_+1,_===0?"tab":`tab${_}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,x=>{x&&(a.value=x)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(x,I){const _=I?.path;return _?(c.has(_)||c.set(_,e.defineAsyncComponent(()=>import(_))),c.get(_)):typeof x=="string"&&yt[x]?yt[x]:I?.component&&yt[I.component]?yt[I.component]:I?.name&&yt[I.name]?yt[I.name]:x}function p(x){return x.forEach(I=>{I.type&&(I.view=I.type)}),r.value=x.filter(I=>I.type==="pin"),x.filter(I=>I.type!=="pin")}const u=e.computed(()=>{let x;return n.panels&&n.panels.length>0?x=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(x=n.data.filter(_=>_.type.includes("tabs"))[0]?.items),In(x,12)}),b=e.computed(()=>a.value);function N(){i||(i=!0)}const g=e.computed(()=>{let x;return n.panels&&n.panels.length>0?x=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(x=n.data),In(x,12)}),k=e.computed(()=>({[`view-${n.view}`]:!0}));function w(x,I){if(!x||typeof I!="string"||!I)return{found:!1,value:void 0};const _=I.split(".");let P=x;for(const le of _){if(P==null||typeof P!="object"&&!Array.isArray(P))return{found:!1,value:void 0};if(!(le in P))return{found:!1,value:void 0};P=P[le]}return{found:!0,value:P}}const F=x=>{const I={...x};return Object.entries(I).forEach(([_,P])=>{if(_!=="props"&&typeof P=="string"){const le=w(n.data,P);le.found&&(I[_]=le.value)}}),x.props&&typeof x.props=="object"&&Object.entries(x.props).forEach(([_,P])=>{if(typeof P=="string"){const le=w(n.data,P);I[_]=le.found?le.value:P}else I[_]=P}),delete I.props,n.data&&(I.data=n.data),I};function T(x){const I=["col-span-12"],_=dr(x.col);return _.length&&I.push(..._),I}const E=e.ref([]),y=e.ref([]),M=e.ref([]);function q(x,I){x&&x instanceof HTMLElement&&(E.value[I]=x)}function L(){y.value=E.value.map(x=>x.offsetWidth),M.value=E.value.map(x=>x.offsetLeft)}function R(){if(typeof window>"u")return null;const x=b.value;if(!x)return null;const _=new URL(window.location.href).searchParams.get(x);if(_===null)return null;const P=Number.parseInt(_,10);return Number.isNaN(P)?null:P}function W(x){if(typeof window>"u")return;const I=b.value;if(!I||!i)return;const _=new URL(window.location.href);x<=0?_.searchParams.delete(I):_.searchParams.set(I,String(x));const P=window.history.state??{};window.history.replaceState(P,document.title,_)}function G(){if(l||!u.value.length)return;N();const x=R();if(x===null)return;const I=Math.min(Math.max(x,0),u.value.length-1);I!==x&&W(I),I!==s.value&&(s.value=I),l=!0}function J(){l=!1,G()}let K=null;return e.onMounted(()=>{e.nextTick(()=>{G(),L()}),typeof window<"u"&&window.addEventListener("popstate",J),K=new ResizeObserver(()=>L()),K.observe(document.body)}),e.onBeforeUnmount(()=>{K?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",J)}),e.watch(s,x=>{e.nextTick(()=>{L()}),W(x)}),e.watch(u,()=>{l=!1,G()}),(x,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(x.classWrapper||k.value)},[e.createElementVNode("div",Uf,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",qf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(_,P)=>(e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Wf)):_.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component,_)),e.mergeProps({key:1,ref_for:!0},_.component==="Card"?_:F(_),{id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[x.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",x.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",x.styling?.classTabHeader])},[y.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:y.value[s.value]+"px",left:M.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,P)=>(e.openBlock(),e.createElementBlock("button",{key:_.name||P,ref_for:!0,ref:le=>q(le,P),onClick:le=>s.value=P,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===P?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(_.title||_.label||_.name||`Tab ${P+1}`),11,Kf))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([x.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x.classPanel||"w-full border-gray-100"])},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Gf)):x.$slots[`tab-${P}`]?e.renderSlot(x.$slots,`tab-${P}`,{key:1,item:_,data:x.data}):_.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:2,ref_for:!0},F(_),{items:_.items,"hide-title":!0,class:["w-full h-full",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component||_.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component||_.name,_)),e.mergeProps({key:3,ref_for:!0},_.component==="Card"?_:F(_),{styling:x.styling,id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(x.$slots,_.slot||`tab-${P}`,{key:4,item:_,data:x.data})],2)),[[e.vShow,s.value===P]])),128))],2)],2)):x.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",Zf,[e.createElementVNode("div",Jf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,P)=>(e.openBlock(),e.createElementBlock("button",{key:_.name||P,onClick:le=>s.value=P,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===P?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(_.title||_.label||_.name||`Tab ${P+1}`)+" ",1),s.value===P?(e.openBlock(),e.createElementBlock("span",Xf,I[0]||(I[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,Yf))),128))]),e.createElementVNode("div",Qf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,P)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:_.name||P,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===P?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",x.classPanel||"w-full border-gray-100 py-2"])},[_.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:_.html,class:"text-gray-900 leading-relaxed"},null,8,Vf)):x.$slots[`tab-${P}`]?e.renderSlot(x.$slots,`tab-${P}`,{key:1,item:_,data:x.data}):_.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:2,ref_for:!0},F(_),{items:_.items,"hide-title":!0,class:["w-full h-full",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component||_.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component||_.name,_)),e.mergeProps({key:3,ref_for:!0},_.component==="Card"?_:F(_),{id:x.data.id,class:["w-full h-full",x.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(x.$slots,_.slot||`tab-${P}`,{key:4,item:_,data:x.data})],2)),[[e.vShow,s.value===P]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(x.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(_,P)=>(e.openBlock(),e.createElementBlock("div",{key:_.name||_.component||P,class:e.normalizeClass(T(_))},[x.$slots[`panel-${P}`]?e.renderSlot(x.$slots,`panel-${P}`,{key:0,item:_,data:x.data}):_.items||_.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Jt),e.mergeProps({key:1,ref_for:!0},F(_),{items:_.items||[],class:["w-full h-auto",x.styling?.classItem],styling:x.styling}),null,16,["items","class","styling"])):_.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(_.component,_)),e.mergeProps({key:2,ref_for:!0},F(_),{class:["w-full h-auto",[x.styling?.classItem]],styling:x.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",tu,[e.renderSlot(x.$slots,_.slot||`panel-${P}`,{item:_,data:x.data})]))],2))),128))])],2))],2)])],2))}}),nu=["onClick"],pr=ot(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const i={id:s++,timer:setTimeout(()=>{l(i.id)},1500)};o.value.push(i)},l=i=>{const a=o.value.findIndex(c=>c.id===i);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(i=>{clearTimeout(i.timer)})}),(i,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(wr),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>l(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Mn),{class:"h-4 w-4"})],8,nu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);Yt.install=function(t){t.component("vs-widget-file",nn),t.component("vs-widget-comments",en),t.component("vs-widget-history",tn),t.component("vs-widget-gallery",on),t.component("vs-widget-map",cn),t.component("vs-group-interface",Ln),t.component("CommentsWidget",en),t.component("HistoryWidget",tn),t.component("GalleryWidget",on),t.component("FilesWidget",nn),t.component("MapWidget",cn),t.component("Card",Yt),t.component("CardItem",Jt),t.component("DescriptionListWidget",Pn),t.component("CopyNotification",pr),t.component("GroupInterfaceWidget",Ln)},ge.Card=Yt,ge.CardItem=Jt,ge.CommentsWidget=en,ge.CopyNotification=pr,ge.DescriptionListWidget=Pn,ge.FilesWidget=nn,ge.GalleryWidget=on,ge.GroupInterfaceWidget=Ln,ge.HistoryWidget=tn,ge.MapWidget=cn,ge.TableWidget=lr,ge.default=Yt,Object.defineProperties(ge,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|