@opengis/widgets 0.0.65 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
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,Ne){"use strict";function Br(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 $r=Br(e);const jo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Lr=t=>{const n=Tr(t);return n.charAt(0).toUpperCase()+n.slice(1)},Ar=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var an={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Dr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:i,class:l,...a},{slots:c})=>e.h("svg",{...an,width:t||an.width,height:t||an.height,stroke:s||an.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:Ar("lucide",...i?[`lucide-${jo(Lr(i))}-icon`,`lucide-${jo(i)}`]:["lucide-icon"]),...a},[...r.map(p=>e.h(...p)),...c.default?[c.default()]:[]]);const le=(t,n)=>(o,{slots:s})=>e.h(Dr,{...o,iconNode:n,name:t},s);const Ir=le("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Or=le("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Mr=le("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Rr=le("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);const Fr=le("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Pr=le("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ho=le("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const zr=le("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const _t=le("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"}]]);const jr=le("file",[["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"}]]);const Hr=le("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Ur=le("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const Wr=le("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const qr=le("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Uo=le("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const Kr=le("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const Gr=le("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Wo=le("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Zr=le("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const qo=le("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Jr=le("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const Ko=le("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const cn=le("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"}]]);const Yr=le("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Go=le("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"}]]);const Xr=le("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const zn=le("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qr={class:"border-t pt-3 mt-4"},Vr={class:"flex gap-2"},ei={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ti={class:"flex-1 space-y-2"},ni={class:"flex justify-between items-center"},oi={class:"flex gap-2"},si=["disabled"],Zo=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,i=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},l=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),i())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Qr,[e.createElementVNode("div",Vr,[e.createElementVNode("span",ei,[e.createVNode(e.unref(Go),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ti,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=p=>s.value=p),onKeydown:l,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",ni,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",oi,[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]=p=>o.value=!1)},[e.createVNode(e.unref(zn),{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:i},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,si)])])])])]))}}),ri={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"},ii=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(),i=e.ref(!0),l=async p=>{s.value&&r.value&&!r.value.contains(p.target)&&!i.value&&(s.value=!1),i.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",l)}),e.onUnmounted(()=>{document.removeEventListener("click",l)}),(p,u)=>(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",ri,[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(Ko),{class:"h-3 w-3 mr-2"}),u[0]||(u[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(cn),{class:"h-3 w-3 mr-2"}),u[1]||(u[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),li={class:"space-y-2"},ai={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ci={class:"flex-1 min-w-0 space-y-1 relative"},di={class:"flex items-center gap-2"},fi={class:"font-medium text-xs"},pi={class:"text-xs text-gray-500"},ui={key:0,class:"text-xs text-gray-700 leading-relaxed"},mi={class:"flex justify-between text-xs"},hi={class:"flex items-center gap-2"},gi={key:0,class:"flex gap-2"},yi=["disabled"],vi={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},bi=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),i=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),l=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),p=e.ref(!1),u=e.ref(!1),d=_=>{const x=new Date,T=Math.floor((x.getTime()-_.getTime())/(1e3*60*60));return T<1?`${Math.floor((x.getTime()-_.getTime())/6e4)}m`:T<24?`${T}h`:`${Math.floor(T/24)}d`},m=()=>{u.value=!u.value,u.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},w=()=>{o("edit",s.comment.id,r.value),p.value=!1},b=(_,x)=>{o("like",_,x)},k=(_,x)=>{o("edit",_,x)};return(_,x)=>{const T=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",p.value?"bg-gray-50":""])},[e.createElementVNode("span",ai,[e.createVNode(e.unref(Go),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("span",fi,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",pi,e.toDisplayString(d(t.comment?.createdAt)),1)]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":x[0]||(x[0]=B=>r.value=B),class:e.normalizeClass(p.value?l.value:i.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ui,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",mi,[e.createElementVNode("div",hi,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",u.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:x[1]||(x[1]=B=>m())},[e.createVNode(e.unref(Ur),{class:e.normalizeClass(["h-3 w-3",u.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:x[2]||(x[2]=B=>c.value=!0)},[e.createVNode(e.unref(Zr),{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:x[3]||(x[3]=B=>a.value=!0)},[e.createVNode(e.unref(zr),{class:"h-3 w-3"})])]),p.value?(e.openBlock(),e.createElementBlock("div",gi,[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:x[4]||(x[4]=B=>p.value=!1)},[e.createVNode(e.unref(zn),{class:"h-3 w-3"}),x[11]||(x[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:x[5]||(x[5]=B=>w())},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),x[12]||(x[12]=e.createTextVNode(" Send ",-1))],8,yi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ii,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":x[6]||(x[6]=B=>a.value=B),onEdit:x[7]||(x[7]=B=>p.value=!0),onDelete:x[8]||(x[8]=B=>_.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,B=>(e.openBlock(),e.createBlock(T,{key:B.id,comment:B,isInside:!0,onDelete:E=>_.$emit("delete",B.id),onLike:b,onEdit:k},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Zo,{key:0,onSendComment:x[9]||(x[9]=B=>_.$emit("reply",t.comment?.id,B)),isReply:c.value,"onUpdate:isReply":x[10]||(x[10]=B=>c.value=B)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),ki=["id"],Ei={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},dn=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 i(){if(!o.id)return;const d=await fetch(`/api/widget/comment/${o.id}`).then(m=>m.json());r.value=d.rows.map(m=>({id:m.communication_id,author:m.username,text:m.body,createdAt:new Date(m.cdate)}))}r.value.length===0&&i();const l=async d=>{o.onAddComment?o.onAddComment(d):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:d})}),await i()),s("add",d)},a=(d,m)=>{o?.onLike?.(d,m),s("like",d,m)},c=(d,m)=>{o.onReply?.(d,m),s("reply",d,m)},p=async(d,m)=>{o.onEdit?o.onEdit(d,m):o.id&&(await fetch(`/api/widget/comment/${o.id}/${d}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:m})}),await i()),s("edit",d,m)},u=async d=>{o.onDelete?o.onDelete(d):o.id&&(await fetch(`/api/widget/comment/${o.id}/${d}`,{method:"DELETE"}),await i()),s("delete",d)};return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",Ei,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,w=>(e.openBlock(),e.createBlock(bi,{key:w.id,comment:w,onReply:c,onLike:a,onDelete:m[0]||(m[0]=b=>u(b)),onEdit:p},null,8,["comment"]))),128))],6),e.createVNode(Zo,{onSendComment:m[1]||(m[1]=w=>l(w))})],14,ki))}}),Jo={CopyPlus:Pr,SquarePen:Ko,Trash2:cn},Yo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:_t}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Jr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Yr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Wr}]]),wi={class:"mx-auto font-sans"},xi={class:"bg-white rounded-lg border border-neutral-200 p-4 sm:p-6"},Ni={key:0,class:"py-8 text-center text-gray-500 text-sm"},Ci={key:1,class:"py-8 text-center text-gray-500 text-sm"},Si={key:2,class:"space-y-6"},_i={class:"flex justify-end"},Bi={class:"flex items-center gap-2 mb-3 sticky top-0 bg-white py-2 z-20"},$i={class:"text-xs font-semibold text-gray-800 uppercase tracking-wide"},Ti={class:"text-xs text-gray-500"},Li={class:"relative"},Ai={class:"bg-white border border-neutral-200 rounded-lg overflow-hidden divide-y divide-neutral-200"},Di=["onClick"],Ii={class:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center"},Oi={class:"flex-1 min-w-0 flex items-center gap-2 text-sm"},Mi={class:"font-medium text-gray-800"},Ri={class:"text-gray-500"},Fi=["title"],Pi={class:"flex-shrink-0 flex items-center gap-2 text-xs text-gray-500 whitespace-nowrap"},zi={class:"px-4 pb-3 pl-[60px] space-y-2"},ji={class:"space-y-1.5"},Hi={class:"text-gray-500 font-[600] text-[0.92rem] min-w-[80px]"},Ui={class:"pl-2 text-gray-500 line-through"},Wi={class:"text-gray-800 font-semibold"},qi={key:0,class:"mt-4 text-center"},Ki={class:"text-xs text-gray-500"},fn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},hideChangesValuesKeys:{},iconSource:{default:"entityType"},showEntityId:{type:Boolean,default:!1},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?[...n.data]:[]),s=e.ref(!1),r=e.reactive({}),i=e.ref(new Map);function l(T){return T?Array.isArray(T)?T:Object.entries(T).map(([B,E],N)=>({changeDataId:`legacy-${N}`,entityKey:B,valueOld:String(E?.old??""),valueNew:String(E?.new??"")})):[]}function a(T){return l(T.changes).length>0}o.value.forEach(T=>{a(T)&&(r[T.id]=!0)}),e.onMounted(async()=>{try{const T=await fetch("/api/suggest/change_type");if(!T.ok)return;const B=await T.json(),E=Array.isArray(B)?B:B?.data;if(!Array.isArray(E))return;const N=new Map;for(const $ of E)$?.id!=null&&N.set(String($.id).toLowerCase(),{text:$.text??$.id,icon:$.icon??null});i.value=N}catch{}}),o.value.length===0&&n.id&&x(),e.watch(()=>n.id,()=>{n.id&&x()});function c(T){return Yo.get(T)??Yo.get("custom")}function p(T){if(n.iconSource==="actionType"){const E=i.value.get((T.action??"").toLowerCase())?.icon;if(E&&E in Jo)return Jo[E]}return c(T.entityType)?.icon}const u=e.computed(()=>new Set(n.hideChangesValuesKeys??[]));function d(T){return i.value.get((T??"").toLowerCase())?.text??T??""}function m(T){try{return new Date(T+"T00:00:00").toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})}catch{return T}}const w=e.computed(()=>{const T=new Map;for(const B of o.value){const E=B.changeDate??B.timestamp?.toLocaleDateString("uk-UA")??"unknown";if(!T.has(E)){const N=B.changeDate?m(B.changeDate):B.timestamp?.toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})??"Без дати";T.set(E,{dateKey:E,dateDisplay:N,rows:[]})}T.get(E).rows.push(B)}return Array.from(T.values()).sort((B,E)=>E.dateKey.localeCompare(B.dateKey))}),b=e.computed(()=>o.value.filter(a).some(T=>!r[T.id]));function k(T){r[T]=!r[T]}function _(){const T=b.value;o.value.forEach(B=>{a(B)&&(r[B.id]=T)})}async function x(){if(n.id){s.value=!0;try{const T=await fetch(`/api/widget/history/${n.id}`);if(!T.ok){o.value=[];return}const E=((await T.json()).rows??[]).map(N=>({id:N.change_id??N.entity_id??"",entityId:N.entity_id??"",entityType:N.entity_type??"custom",action:N.change_type??"",userId:N.change_user_id??"",userName:N.username??"",timestamp:new Date(N.cdate),changeDate:N.change_date,login:N.login,avatar:N.avatar??null,changes:Array.isArray(N.changes)?N.changes.map($=>({changeDataId:$.change_data_id,entityKey:$.entity_key,valueOld:$.value_old??"",valueNew:$.value_new??""})):[]}));o.value=E,E.forEach(N=>{a(N)&&(r[N.id]=!0)})}finally{s.value=!1}}}return(T,B)=>(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("div",{class:"overflow-y-auto",style:e.normalizeStyle({maxHeight:t.maxHeight?t.maxHeight+"px":"calc(100vh - 320px)"})},[s.value?(e.openBlock(),e.createElementBlock("div",Ni," Завантаження... ")):o.value.length===0?(e.openBlock(),e.createElementBlock("div",Ci," Немає записів ")):(e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("button",{onClick:_,class:"flex items-center gap-2 text-sm font-semibold text-gray-800 hover:text-blue-600 transition-colors px-4 py-2 rounded-lg border border-neutral-300 hover:border-blue-500 bg-white hover:shadow-sm"},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["w-4 h-4",{"rotate-180":b.value}])},null,8,["class"]),e.createElementVNode("span",null,e.toDisplayString(b.value?"Розгорнути всі":"Згорнути всі"),1)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.dateKey},[e.createElementVNode("div",Bi,[e.createElementVNode("h3",$i,e.toDisplayString(E.dateDisplay),1),B[0]||(B[0]=e.createElementVNode("div",{class:"flex-1 h-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("span",Ti,e.toDisplayString(E.rows.length),1)]),e.createElementVNode("div",Li,[B[1]||(B[1]=e.createElementVNode("div",{class:"absolute left-[58px] top-6 bottom-0 w-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("div",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.rows,N=>(e.openBlock(),e.createElementBlock("div",{key:N.id,class:"hover:bg-neutral-50 transition-colors"},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-3 px-4 py-2.5",{"cursor-pointer":a(N)}]),onClick:$=>a(N)&&k(N.id)},[e.createElementVNode("div",Ii,[a(N)?(e.openBlock(),e.createBlock(e.unref(Mr),{key:0,class:e.normalizeClass(["w-3.5 h-3.5 text-gray-500 transition-transform duration-200",{"rotate-180":r[N.id]}]),"stroke-width":"1.5"},null,8,["class"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-8 h-8 rounded-full border-2 border-white shadow-sm flex items-center justify-center relative z-10 ${c(N.entityType)?.color??"bg-gray-100"}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p(N)),{class:"w-4 h-4 relative z-10","stroke-width":"1.5"}))],2),e.createElementVNode("div",Oi,[e.createElementVNode("span",Mi,e.toDisplayString(N.userName),1),e.createElementVNode("span",Ri,e.toDisplayString(d(N.action)),1),t.showEntityId&&N.entityId?(e.openBlock(),e.createElementBlock("span",{key:0,class:"rounded border border-neutral-300 bg-neutral-50 px-1.5 py-0.5 font-mono text-[0.65rem] text-gray-600 max-w-[140px] truncate",title:N.entityId},e.toDisplayString(N.entityId),9,Fi)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pi,[e.createElementVNode("span",null,e.toDisplayString(N.timestamp?.toLocaleTimeString("uk-UA",{hour:"2-digit",minute:"2-digit"})),1)])],10,Di),e.withDirectives(e.createElementVNode("div",zi,[e.createElementVNode("div",ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l(N.changes),$=>(e.openBlock(),e.createElementBlock("div",{key:$.changeDataId,class:"flex items-center gap-2 text-sm pl-2"},[e.createElementVNode("span",Hi,e.toDisplayString($.entityKey),1),u.value.has($.entityKey)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Ui,e.toDisplayString($.valueOld),1),e.createVNode(e.unref(Or),{class:"w-3 h-3 text-neutral-400","stroke-width":"1.5"}),e.createElementVNode("span",Wi,e.toDisplayString($.valueNew),1)],64))]))),128))])],512),[[e.vShow,a(N)&&r[N.id]]])]))),128))])])]))),128))]))],4),!s.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("div",qi,[e.createElementVNode("p",Ki,e.toDisplayString(o.value.length)+" записів",1)])):e.createCommentVNode("",!0)])]))}}),Gi={key:0,class:"text-xl font-semibold"},Zi={class:"flex gap-1"},Ji={key:0},Yi=["accept"],Xi={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"},Qi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{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",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Zi,[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]=i=>n.value="list")},[e.createVNode(e.unref(Kr),{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]=i=>n.value="grid")},[e.createVNode(e.unref(Hr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Ji,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=i=>s.$emit("onAddFile",i))},null,40,Yi),e.createElementVNode("div",Xi,[e.createVNode(e.unref(Wo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),jn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:_t,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:jr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Xr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:_t,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Ir,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Uo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Uo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:_t,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:_t,label:"PPT"}};function Xo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Qo(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 Vi={class:"space-y-0.5"},el=["onClick"],tl=["onClick"],nl={class:"flex items-center gap-2"},ol={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},sl={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},rl={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},il={class:"flex items-center gap-1"},ll=["onClick"],al=["onClick"],cl=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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(jn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(jn)[s?.ext]?.icon||e.unref(jn).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",nl,[e.createElementVNode("span",ol,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,tl),e.createElementVNode("div",sl,e.toDisplayString(e.unref(Qo)(s.size)),1),e.createElementVNode("div",rl,e.toDisplayString(e.unref(Xo)(s.createdAt)),1),e.createElementVNode("div",il,[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(Ho),{class:"h-3 w-3"})],8,ll),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(cn),{class:"h-3 w-3"})],8,al)])],8,el))),128))]))}}),dl={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},fl=["onClick"],pl={class:"space-y-2"},ul={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},ml=["src"],hl={class:"space-y-1"},gl=["title"],yl={class:"text-xs text-gray-500 text-left"},vl={class:"absolute top-2 right-1 flex items-center gap-1"},bl=["onClick"],kl=["onClick"],El=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",pl,[e.createElementVNode("div",ul,[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,ml)):(e.openBlock(),e.createBlock(e.unref(_t),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",hl,[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,gl),e.createElementVNode("p",yl,e.toDisplayString(e.unref(Xo)(s.createdAt))+", "+e.toDisplayString(e.unref(Qo)(s.size)),1)])]),e.createElementVNode("div",vl,[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(Ho),{class:"h-3 w-3"})],8,bl),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(cn),{class:"h-3 w-3"})],8,kl)])],8,fl))),128))]))}}),wl={class:"mx-auto font-sans"},xl={key:1},pn=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{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),i=e.ref(!1),l=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const g=(o.format??[]).map(z=>typeof z=="string"?z.trim():z==null?"":String(z).trim()).filter(z=>z.length>0),I=[];return g.forEach(z=>{const U=z.toLowerCase(),K=U.indexOf("/"),G=K>=0;let O,j=!1,C;if(G){O=U;const ee=U.slice(K+1);j=ee==="*",!j&&ee&&(C=`.${ee.replace(/^\.+/,"")}`)}else C=U.startsWith(".")?U:`.${U.replace(/^\.+/,"")}`;const q=G?O:C??"";q&&I.push({acceptValue:q,mime:O,wildcard:j,extension:C})}),I.length?I:null}),p=e.computed(()=>{const L=c.value;if(!L)return;const g=L.map(I=>I.acceptValue).filter(Boolean);return g.length?g.join(","):void 0}),u=L=>{if(!c.value)return!0;const g=L.type?.toLowerCase(),I=L.name?.toLowerCase();return c.value.some(z=>{if(z.mime){if(g){if(z.wildcard){const U=z.mime.split("/")[0];if(g.startsWith(`${U}/`))return!0}else if(g===z.mime)return!0}return!!(z.extension&&I?.endsWith(z.extension))}return!!(z.extension&&I?.endsWith(z.extension))})},d=n;a.value.length===0&&E();const m=(L,g)=>{r.value=g,s.value=!0},w=()=>{r.value&&(x(r.value),r.value=null,s.value=!1)},b=e.computed(()=>Array.isArray(a.value)?a.value.map(L=>L?.file_path):[]),k=L=>{const g=b.value.findIndex(I=>I===L.file_path);g!==-1&&(i.value=!0,l.value=g)},_=L=>{o.onAddFile?o.onAddFile(L):N(L),d("add",L)},x=L=>{o.onDelete?o.onDelete(L):$(L),d("delete",L)},T=L=>{const g=document.createElement("a");g.setAttribute("download",L?.uploaded_name||L?.name),g.href=L?.file_path||L?.path,g.click()},B=e.ref(o.view==="grid"?"grid":"list");async function E(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(g=>g.json());L.rows.forEach(g=>{g.timestamp=new Date(g.cdate),g.id=g.entity_id,g.entityType=g.entity_type,g.entityId=g.entity_id,g.entityType=g.entity_type,g.action=g.change_type,g.userId=g.change_user_id,g.userName=g.username,g.timestamp=new Date(g.cdate),g.description=g.username,g.status=g.username}),a.value=L.rows}const N=async L=>{const I=L.target?.files;if(!I||I.length===0)return;const z=Array.from(I),U=[],K=[];if(z.forEach(G=>{u(G)?U.push(G):K.push(G)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(G=>G.name).join(", ")}`),U.length!==0)try{await Promise.all(U.map(async G=>{const O=new FormData;O.append("file",G);const j=`/api/widget/file/${o.id}`,C=await fetch(j,{method:"POST",body:O});if(!C.ok)throw new Error(`HTTP error! status: ${C.status}`);return G})),await E()}catch(G){console.error("Помилка при завантаженні файлів:",G)}},$=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await E()}catch(g){console.error(g)}};return(L,g)=>{const I=e.resolveComponent("MessageBox"),z=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",wl,[e.createVNode(Qi,{modelValue:B.value,"onUpdate:modelValue":g[0]||(g[0]=U=>B.value=U),title:o.title,onOnAddFile:g[1]||(g[1]=U=>_(U)),editable:o.editable,accept:p.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[B.value==="list"?(e.openBlock(),e.createBlock(cl,{key:0,onDelete:m,onDownload:T,onOpenLightbox:g[2]||(g[2]=U=>k(U)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),B.value==="grid"?(e.openBlock(),e.createBlock(El,{key:1,onDelete:m,onDownload:T,onOpenLightbox:g[3]||(g[3]=U=>k(U)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",xl,[...g[6]||(g[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(I,{modelValue:s.value,"onUpdate:modelValue":g[4]||(g[4]=U=>s.value=U),onConfirm:w,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(z,{modelValue:i.value,"onUpdate:modelValue":g[5]||(g[5]=U=>i.value=U),images:b.value,"start-index":l.value},null,8,["modelValue","images","start-index"])],64)}}}),Nl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Cl=["onClick"],Sl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},_l=["src"],Bl={key:0,class:"thumb-cover"},$l=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},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),i=t,l=e.computed(()=>Array.isArray(i.items)?i.items.map(c=>c?.file_path):[]),a=c=>{const p=l.value.findIndex(u=>u===c.file_path);p!==-1&&(s.value=!0,r.value=p)};return(c,p)=>{const u=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+m,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:m,onClick:e.withModifiers(w=>a(d),["stop"])},[m<5?(e.openBlock(),e.createElementBlock("div",Sl,[e.createElementVNode("img",{src:`/file/resize?filepath=${d?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",m===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,_l),m===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",Bl," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Cl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),d=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+d,class:e.normalizeClass(["h-full w-full image"+(t.items.length+d-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(u,{modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=d=>s.value=d),images:l.value,"start-index":r.value,delete:"true",download:"true",onDelete:p[1]||(p[1]=d=>o("delete",d))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),Tl={key:0,class:"text-xl font-semibold"},Ll={class:"flex gap-1"},Al=["accept"],Dl={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"},Il=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},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",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Tl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ll,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,Al),e.createElementVNode("div",Dl,[e.createVNode(e.unref(Wo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Ol={class:"w-full mx-auto font-sans",ref:"containerRef"},Ml={key:1},un=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=E=>{if(!E)return[];const N=Array.isArray(E)?E:E.split(",");return Array.from(new Set(N.map($=>$.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],i=e.computed(()=>{const E=s(o.format);return E.length>0?E:void 0}),l=e.computed(()=>{const E=i.value;return!E||E.length===0?"image/*":E.map(N=>N.startsWith(".")?N:`.${N}`).join(",")}),a=E=>E?.split(".").pop()?.toLowerCase()??"",c=E=>{const N=E?.toLowerCase();return!!N&&!!i.value&&i.value.includes(N)},p=E=>{const N=E?.toLowerCase();return!!N&&r.includes(N)},u=E=>{const N=E.type?.toLowerCase(),$=E.ext?.toLowerCase();return N?.startsWith("image/")?i.value?c($):!0:$?i.value?c($):p($):!1},d=E=>{if(!E.type?.toLowerCase()?.startsWith("image/"))return!1;if(!i.value)return!0;const $=a(E.name);return c($)},m=E=>E.filter(u),w=e.ref(m(o.items??[])),b=n;w.value.length===0&&T();const k=E=>{o.onAddImage?o.onAddImage(E):x(E),b("add",E)},_=E=>{const N=w.value.find($=>$.file_path===E)?.file_id;N&&(o.onDelete?o.onDelete(N):B(N))},x=async E=>{const N=E.target;if(!N?.files||N.files.length===0)return;const $=Array.from(N.files),L=$.filter(I=>d(I)),g=i.value?.join(", ")??"image/*";if(L.length===0){console.warn(`Допустимі формати: ${g}. Завантажте зображення дозволеного типу.`);return}L.length!==$.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${g}.`);try{await Promise.all(L.map(async I=>{const z=new FormData;z.append("file",I);const U=`/api/widget/file/${o.id}`,K=await fetch(U,{method:"POST",body:z});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return I})),await T()}catch(I){console.error("Помилка при завантаженні файлів:",I)}};async function T(){if(!o.id)return;const E=await fetch(`/api/widget/file/${o.id}`).then(N=>N.json());w.value=m(E.rows)}const B=async E=>{try{await fetch(`/api/widget/file/${o.id}/${E}`,{method:"DELETE"}),await T()}catch(N){console.error(N)}};return(E,N)=>(e.openBlock(),e.createElementBlock("div",Ol,[e.createVNode(Il,{title:t.title,accept:l.value,onOnAddImage:N[0]||(N[0]=$=>k($))},null,8,["title","accept"]),w.value.length>0?(e.openBlock(),e.createBlock($l,{key:0,items:w.value,onDelete:N[1]||(N[1]=$=>_($))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",Ml,[...N[2]||(N[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),Rl={class:"text-value"},Fl={class:"text-sm text-gray-900"},Pl=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",Rl,[e.createElementVNode("span",Fl,e.toDisplayString(o.value),1)]))}}),st=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},zl=st(Pl,[["__scopeId","data-v-34a76c89"]]),jl={class:"link-value"},Hl=["href"],Ul=st(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",jl,[e.createElementVNode("a",{href:String(t.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"]]),Wl={class:"date-value"},ql={class:"text-sm text-gray-900"},Kl=st(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",Wl,[e.createElementVNode("span",ql,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Gl={class:"status-value"},Zl={key:0,class:"mr-1"},Jl=st(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,i)=>(e.openBlock(),e.createElementBlock("div",Gl,[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",Zl,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Yl={class:"custom-value"},Xl={class:"text-sm text-gray-900"},Ql=st(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yl,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Xl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Vl=["id"],ea={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},ta={key:1,class:"overflow-x-auto"},na={class:"min-w-full divide-y divide-gray-200"},oa={class:"bg-white divide-y divide-gray-200"},sa={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ra={class:"flex items-center gap-2"},ia=["title"],la={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},aa={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},ca={class:"flex items-start gap-3"},da={key:0,class:"flex-shrink-0"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-2"},ua={class:"text-sm font-medium text-gray-900"},ma=["title"],ha={key:3,class:"overflow-x-auto"},ga={class:"min-w-full divide-y divide-gray-200"},ya={class:"bg-white divide-y divide-gray-200"},va={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ba={class:"flex items-center gap-2"},ka=["title"],Ea={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Hn=st(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return Ul;case"date":return Kl;case"status":return Jl;case"custom":return Ql;default:return zl}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",ea,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("table",na,[e.createElementVNode("tbody",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",sa,[e.createElementVNode("div",ra,[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,ia)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",la,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",ca,[r.icon?(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",fa,[e.createElementVNode("div",pa,[e.createElementVNode("h4",ua,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,ma)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ha,[e.createElementVNode("table",ga,[e.createElementVNode("tbody",ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",va,[e.createElementVNode("div",ba,[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,ka)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ea,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Vl))}}),[["__scopeId","data-v-106790ef"]]);function Vo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(i=>i.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 wa(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 xa="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Un=null;function Na(){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 Ca(){return Un||(Un=Vo(xa).then(()=>{const t=Na();if(!t)throw new Error("IMask is not available after loading the script");return t})),Un}function Sa(){return typeof window>"u"?"":window.location?.origin??""}function es(){if(!(typeof window>"u"))return window.maplibregl}const ts=Symbol("vs-widget-map");function Wn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function _a(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 Ba(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function qn(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=Sa(),i=s.replace(/^\/+/,"");return r?`${r}/${i}`:i?`/${i}`:""}function $a(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 Ta(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function mn(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 ns=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function La(t){const n=t?.color??ns[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(([l,a])=>{const c=typeof a=="string"?a.trim():"",p=String(l).trim();c&&p&&(r[p]=c)}):ns.forEach((l,a)=>{r[String(a+1)]=l}),!Object.keys(r).length)return n;const i=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([l,a])=>{i.push(String(l),a)}),i.push(n),i}const Ht="map-highlight-source",Aa="map-highlight-fill",Da="map-highlight-line";function Ia(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function os(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Oa(){return wa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Vo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),es()}function hn(t){const n=e.inject(ts,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:[]}),i=e.ref([]),l=e.ref([]),a=e.ref(null),c=e.ref(null),p=e.ref(null);let u=t.style??null,d=null;const m=h=>{h&&(o.value?o.value.setStyle(h):u=h)},w=()=>{r.value.overlays=l.value.map(h=>({id:h.id,name:h.config.name,visible:h.visible}))},b=h=>{const H=Array.isArray(h)?h:[];i.value=H,H.some(S=>S.key===r.value.selectedBasemap)||(r.value.selectedBasemap=H[0]?.key??"")},k=h=>{h&&l.value.forEach(H=>{H.layerIds.forEach(y=>{h.getLayer(y)&&h.removeLayer(y)}),h.getSource(H.sourceId)&&h.removeSource(H.sourceId),H.layerIds=[]})},_=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||(l.value.forEach(H=>{x(h,H)}),U())},x=(h,H)=>{const y=$a(H.config);y==="vtile"?B(h,H):y==="raster"&&T(h,H)},T=(h,H)=>{const y=H.config,S=H.sourceId,M=qn(y.url);if(!M)return;h.getSource(S)||h.addSource(S,{type:"raster",tiles:[M],minzoom:y.minzoom??0,maxzoom:y.maxzoom??24});const P=`${H.id}-raster`;h.getLayer(P)||h.addLayer({id:P,type:"raster",source:S,layout:{visibility:H.visible?"visible":"none"}}),H.layerIds=[P],E(h,H)},B=(h,H)=>{const y=H.config,S=H.sourceId,M=qn(y.url);if(!M)return;h.getSource(S)||h.addSource(S,{type:"vector",tiles:[M],minzoom:y.minzoom??0,maxzoom:y.maxzoom??24});const P=y.style??{},Z=La(P),X=[],se={visibility:H.visible?"visible":"none"},ae=Ta(y),pe={source:S,layout:se};if(ae&&(pe["source-layer"]=ae),(P.type??"polygon").toLowerCase()==="point"){const ke=`${H.id}-circle`;h.getLayer(ke)||h.addLayer({id:ke,type:"circle",...pe,paint:{"circle-color":Z,"circle-opacity":P.opacity??1,"circle-radius":P.radius??P.width??3,"circle-stroke-color":P.stroke??P.color??"#ffffff","circle-stroke-width":P.width??1}}),X.push(ke);const $e=P.text??P.label;if($e){const tt=`${H.id}-symbol`,sn=mn(P.textSize)??10,Pt=P.textHaloColor??P.stroke??"#ffffff",zt=mn(P.textHaloWidth)??1,xt=mn(P.textZoom??P.pointZoom),Nt={"text-color":P.textColor??"#000000","text-halo-color":Pt,"text-halo-width":zt},ut={id:tt,type:"symbol",...pe,layout:{"text-field":["coalesce",["get",$e],""],"text-size":sn,"text-anchor":"top"},paint:Nt};xt!=null&&(ut.minzoom=xt),h.getLayer(tt)||h.addLayer(ut),X.push(tt)}}else{const ke=`${H.id}-fill`;h.getLayer(ke)||h.addLayer({id:ke,type:"fill",...pe,paint:{"fill-color":Z,"fill-opacity":P.opacity??.5,"fill-outline-color":P.stroke??P.color??"#0ea5e9"}}),X.push(ke);const $e=`${H.id}-line`;h.getLayer($e)||h.addLayer({id:$e,type:"line",...pe,paint:{"line-color":P.stroke??P.color??"#0b74c4","line-width":mn(P.width??P.border)??1,"line-opacity":P.opacity??1}}),X.push($e)}H.layerIds=X,E(h,H)},E=(h,H)=>{const y=H.visible?"visible":"none";H.layerIds.forEach(S=>{h.getLayer(S)&&h.setLayoutProperty(S,"visibility",y)})},N=h=>{const H=Array.isArray(h)?h:[];k(o.value??void 0),p.value=null,O();const y=H.map((S,M)=>{if(!S)return null;const P=qn(S.url);if(!P)return null;const Z=S.id!=null?String(S.id):`overlay-${M}`;return{id:Z,config:{...S,id:Z,url:P},visible:!1,sourceId:`${Z}-source`,layerIds:[]}}).filter(S=>!!S);l.value=y,w(),_()},$=(h,H)=>{const y=l.value.find(M=>M.id===h);if(!y)return;y.visible=H,w();const S=o.value;if(!(!S||typeof S.isStyleLoaded!="function"||!S.isStyleLoaded())){if(!y.layerIds.length){x(S,y);return}E(S,y)}},L=()=>{a.value&&(a.value.remove(),a.value=null)},g=(h,H={})=>!Array.isArray(h.popup)||!h.popup.length?[]:h.popup.map(y=>({label:y.label??y.field,value:Wn(H?.[y.field])})).filter(y=>y.label&&y.value!==void 0),I=h=>{const H=o.value;if(!H||!h?.point)return;const y=H.queryRenderedFeatures(h.point);for(const S of y){const M=S.layer?.id??S.sourceLayer;if(!M)continue;const P=ze(M);if(!P)continue;const Z=g(P,S.properties??S.layer?.properties??{});if(!Z.length)continue;const X=_a(Z),se=es();if(!se)return;const ae=h.lngLat;if(c.value===M&&a.value){a.value.setLngLat(ae),a.value.setHTML(X);return}c.value=M,L(),a.value=new se.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(ae).setHTML(X).addTo(H);return}c.value=null,L()},z=()=>{c.value=null,L()},U=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||h.getSource(Ht)||(h.addSource(Ht,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),h.addLayer({id:Aa,type:"fill",source:Ht,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),h.addLayer({id:Da,type:"line",source:Ht,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=h=>{const H=o.value;if(!H||typeof H.isStyleLoaded!="function"||!H.isStyleLoaded())return;U();const y=H.getSource(Ht);if(!(!y||typeof y.setData!="function")){if(!h){y.setData({type:"FeatureCollection",features:[]});return}y.setData({type:"FeatureCollection",features:[h]})}},G=h=>{const H=Ia(h);H&&K(H)},O=()=>{K(null)},j=()=>{p.value=null,O()},C=h=>{if(h)return typeof h=="string"?h:h.field??h.name??h.key??h.label},q=h=>{if(h)return typeof h=="string"?h:h.label??h.title??h.field??h.name},ee=(h,H)=>!h||!h.length?[]:h.map(y=>{const S=C(y);if(!S)return null;const M=q(y),P=Wn(H?.[S]);return!M||P===""?null:{label:M,value:P}}).filter(y=>!!y),_e=(h,H)=>!Array.isArray(h)||!h.length?[]:h.map(y=>{if(!y?.name)return null;const S=y.title??y.name,M=Wn(H?.[y.name]);return!S||M===""?null:{label:S,value:M}}).filter(y=>!!y),me=(h,H)=>!Array.isArray(h)||!h.length?[]:h.map(S=>{const M=os(S.url,H),P=S.label??S.url;return M?{label:P,url:M,target:S.target}:null}).filter(S=>!!S),he=async(h,H)=>{const y=os(h,H);if(!y)return null;try{const S=await fetch(y);return S.ok?await S.json():null}catch{return null}},Be=async(h,H)=>{const y=H.properties??H.layer?.properties??{},S=ee(h.card?.rows,y);let M,P;if(h.card?.api){const se=await he(h.card.api,y);se&&(typeof se.html=="string"&&se.html.trim()&&(M=se.html),Array.isArray(se.columns)&&se.columns.length&&(P=se.columns))}let Z=S;if(!M&&P){const se=_e(P,y);se.length&&(Z=se)}if(!Z.length&&!M)return null;const X=me(h.card?.actions,y);return{title:y?.name??h.name,rows:Z,html:M,actions:X.length?X:void 0}},pt=async h=>{const H=o.value;if(!H||!h?.point)return;const y=H.queryRenderedFeatures(h.point);for(const S of y){const M=S.layer?.id??S.sourceLayer;if(!M)continue;const P=ze(M);if(!P||!P.card)continue;const Z=await Be(P,S);if(Z){p.value=Z,G(S);return}}p.value=null,O()},wt=()=>{const h=o.value;h&&(h.on("mousemove",I),h.on("mouseleave",z),h.on("click",pt))},Fe=()=>{const h=o.value;h&&(h.off("mousemove",I),h.off("mouseleave",z),h.off("click",pt),L(),O())},ze=h=>{if(h)return l.value.find(H=>H.layerIds.includes(h))?.config},et=async()=>{const h=await Oa(),H=Ba(t.container);if(!h||!H)return;const y={container:H,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:u??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new h.Map(y);const S=()=>{_()};d=S,o.value.on("style.load",S),o.value.on("load",()=>{s.value=!0,u&&o.value&&(o.value.setStyle(u),u=null),_(),wt()})};e.onMounted(et),e.onBeforeUnmount(()=>{Fe(),o.value&&d&&o.value.off("style.load",d),k(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const We={map:o,ready:s,setStyle:m,flyTo:h=>o.value?.flyTo(h),fitBounds:(h,H)=>o.value?.fitBounds(h,H),setCenter:h=>o.value?.setCenter(h),setZoom:h=>o.value?.setZoom(h),addControl:(h,H)=>o.value?.addControl(h,H),removeControl:h=>o.value?.removeControl(h),on:(h,...H)=>o.value?.on(h,...H),off:(h,...H)=>o.value?.off(h,...H),project:h=>o.value?.project(h),unproject:h=>o.value?.unproject(h),state:r,basemapOptions:i,setOverlays:N,toggleOverlay:$,getOverlayConfig:ze,selectedCard:p,setBasemapOptions:b,clearCard:j};return e.provide(ts,We),We}const Ma={class:"map-base-layer-menu"},Ra={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Fa={class:"flex items-center justify-between p-2 border-b"},Pa={class:"p-2 border-b"},za={class:"flex items-center"},ja=["value","checked","onChange"],Ha={class:"ml-2"},Ua={class:"p-2"},Wa={class:"flex items-center"},qa=["checked"],Ka=["checked","onChange"],Ga={class:"ml-2"},Za=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:i}=hn(),l=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),p=e.computed(()=>n.value.selectedBasemap??""),u=e.computed(()=>n.value.geometryVisible??!0),d=e.computed(()=>n.value.overlays??[]),m=k=>{s?.(k)},w=()=>{r?.(!u.value)},b=k=>{i?.(k.id,!k.visible)};return(k,_)=>(e.openBlock(),e.createElementBlock("div",Ma,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:_[0]||(_[0]=x=>l.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),l.value?(e.openBlock(),e.createElementBlock("div",Ra,[e.createElementVNode("div",Fa,[_[3]||(_[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:_[1]||(_[1]=x=>l.value=!1)},[..._[2]||(_[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",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,x=>(e.openBlock(),e.createElementBlock("div",{key:x.key},[e.createElementVNode("label",za,[e.createElementVNode("input",{type:"radio",name:a,value:x.key,checked:p.value===x.key,onChange:T=>m(x.key)},null,40,ja),e.createElementVNode("span",Ha,e.toDisplayString(x.name||x.key),1)])]))),128))]),e.createElementVNode("div",Ua,[e.createElementVNode("label",Wa,[e.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:w},null,40,qa),_[4]||(_[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,x=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:x.id},[e.createElementVNode("input",{type:"checkbox",checked:x.visible,onChange:T=>b(x)},null,40,Ka),e.createElementVNode("span",Ga,e.toDisplayString(x.name||x.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Ja={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]"},Ya={class:"leading-tight"},Xa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",Ya,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Qa={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]"},Va={class:"font-mono"},ec=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Qa,[e.createElementVNode("span",Va,e.toDisplayString(t.coordinates),1)]))}}),tc={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},nc=["title"],oc={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"},sc=["onClick"],rc=["placeholder"],ic={class:"divide-y divide-gray-100"},lc=["onClick"],ac=600,cc="0000000000:00:000:0000",dc=30,fc=8,pc="https://data.softpro.ua/api-user/gis-url-proxy",uc="https://geo.rv.ua/api-user/dzk.api",mc="https://nominatim.openstreetmap.org/search",hc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=hn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const l=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const y=n.config?.tools?.filter(S=>l.includes(S));return y&&y.length?y:l}),c={here:"Пошук…",xy:`50.4501 30.5234 або 50°27'00"N 30°31'24"E`,parcel:"Пошук…",address:"Пошук…"},p=e.computed(()=>{const y=n.config?.placeholder?.trim();return y||c[u.value]||"Пошук…"}),u=e.ref(a.value[0]);e.watch(a,y=>{y.includes(u.value)||(u.value=y[0])});const d=e.ref(""),m=e.ref(!1),w=e.ref(null),b=e.ref(null),k=e.ref(null),_=e.ref([]),x=e.ref(null),T=e.computed(()=>u.value==="address"&&_.value.length>0);let B=null,E=null,N=null;const $=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function L(){if(!b.value)return;const y=b.value.getBoundingClientRect(),S=y.width+dc,M=y.left+window.scrollX,P=y.bottom+window.scrollY+fc;$.left=`${M}px`,$.top=`${P}px`,$.width=`${S}px`,$.display="block"}const g=()=>{T.value&&L()};function I(){B&&(clearTimeout(B),B=null)}function z(){E?.destroy(),E=null}async function U(){if(u.value!=="parcel")return;const y=k.value;if(!y)return;const S=await Ca();u.value==="parcel"&&(z(),E=S(y,{mask:cc,lazy:!1,placeholderChar:"_"}),E.on("accept",()=>{d.value=E?.value??""}))}function K(){return(E?.value??d.value).trim()}function G(){if(!(typeof window>"u"))return window.maplibregl}function O(y){const S=o.map.value;if(!S)return;const M=G();if(M){if(N){N.setLngLat([y.lng,y.lat]);return}N=new M.Marker({color:"#2563eb"}).setLngLat([y.lng,y.lat]).addTo(S)}}function j(){N&&(N.remove(),N=null)}e.watch(u,y=>{d.value="",m.value=!1,_.value=[],I(),y==="parcel"?e.nextTick(()=>{U().catch(S=>{Ne.notify({type:"error",title:"Маска кадастру",message:S?.message||"Не вдалося ініціалізувати маску"})})}):z()}),e.watch(T,y=>{y?e.nextTick(()=>{L()}):$.display="none"}),e.watch(d,y=>{if(u.value!=="address"){_.value=[],I();return}if(!y.trim()){_.value=[],I();return}I(),B=window.setTimeout(()=>{ze(y).catch(S=>{const M=S?.message||"Помилка пошуку адреси";Ne.notify({type:"error",title:"Пошук адреси",message:M})})},ac)});function C(y){u.value=y}function q(y){const S=y.target;if(m.value){const M=w.value;M&&!M.contains(S)&&(m.value=!1)}if(T.value){const M=x.value;M&&!M.contains(S)&&(_.value=[])}}e.onMounted(()=>{window.addEventListener("click",q,!0),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),u.value==="parcel"&&e.nextTick(()=>{U().catch(y=>{Ne.notify({type:"error",title:"Маска кадастру",message:y?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",q,!0),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),I(),z(),j()});function ee(y){return y==="xy"?"Координати":y==="parcel"?"Кадастр":"Адреси"}const _e=/([+-]?\d{1,3})\s*[°º˚]\s*(\d{1,2})\s*['’′`]\s*(\d{1,2}(?:\.\d+)?)\s*["”″]\s*([NSEW])/gi;function me(y,S){const M=Number(y[1]),P=Number(y[2]),Z=Number(y[3]),X=String(y[4]).toUpperCase();if(!Number.isFinite(M)||!Number.isFinite(P)||!Number.isFinite(Z)||S==="lat"&&!(X==="N"||X==="S")||S==="lng"&&!(X==="E"||X==="W")||P<0||P>59||Z<0||Z>59)return null;const pe=Math.abs(M),je=S==="lat"?90:180;if(pe>je||pe===je&&(P!==0||Z!==0))return null;const ke=pe+P/60+Z/3600;return X==="S"||X==="W"?-ke:ke}function he(y){const S=y.trim();if(!S)return{ok:!1};_e.lastIndex=0;const M=[...S.matchAll(_e)];if(M.length!==2)return{ok:!1};if(_e.lastIndex=0,S.replace(_e," ").replace(/[\s,;]+/g,"").trim().length)return{ok:!1};const Z=me(M[0],"lat"),X=me(M[1],"lng");return!Number.isFinite(Z)||!Number.isFinite(X)?{ok:!1}:{ok:!0,lat:Z,lng:X}}function Be(y){const S=he(y);if(S.ok)return S;const M=y.replace(/[,]+/g," ").trim();if(!M)return{ok:!1};const P=M.split(/\s+/).filter(Boolean);if(P.length<2)return{ok:!1};const Z=P.slice(0,2).map(Number);if(!Z.every($e=>Number.isFinite($e)))return{ok:!1};let[X,se]=Z,ae=X,pe=se;const je=$e=>Math.abs($e)<=90,ke=$e=>Math.abs($e)<=180;if(!je(ae)||!ke(pe))if(je(pe)&&ke(ae))ae=se,pe=X;else return{ok:!1};return{ok:!0,lat:ae,lng:pe}}function pt(y){return(y?.items||[]).map((M,P)=>{const Z=Number(M?.position?.lat),X=Number(M?.position?.lng);return!Number.isFinite(Z)||!Number.isFinite(X)?null:{id:String(M?.id??P),title:M?.title||M?.address?.label||"Знайдений обʼєкт",lat:Z,lng:X}}).filter(M=>!!M)}function wt(y){const S=y?.result||y?.data||y;if(!S)return[];const M=S.geom_centroid;if(!M||!Array.isArray(M.coordinates))return[];const[P,Z]=M.coordinates;return!Number.isFinite(Z)||!Number.isFinite(P)?[]:[{id:"parcel",title:S.cadnum||S.cad_num||"Земельна ділянка",lat:Z,lng:P}]}function Fe(y){return(Array.isArray(y?.features)?y.features:[]).map((M,P)=>{const Z=M?.geometry?.coordinates,X=Number(Z?.[0]),se=Number(Z?.[1]);if(!Number.isFinite(se)||!Number.isFinite(X))return null;const ae=M?.properties||{},pe=ae?.geocoding?.label||ae?.display_name||ae?.label||"Адреса";return{id:String(ae?.geocoding?.place_id||ae?.place_id||P),title:pe,lat:se,lng:X}}).filter(M=>!!M)}async function ze(y){_.value=[],I();const S=new URL(mc);S.searchParams.set("format","geojson"),S.searchParams.set("q",y),S.searchParams.set("addressdetails","1"),S.searchParams.set("bounded","1");const M=r();M&&S.searchParams.set("viewbox",M);const P=await fetch(S.toString());if(!P.ok)throw new Error(`HTTP ${P.status}`);const Z=await P.json(),X=Fe(Z);if(!X.length){Ne.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}_.value=X}function et(y){h(y),_.value=[],d.value=""}function We(y){const M=y.replace(/\s+/g,"").split(":");if(M.length!==4)return!1;const P=[10,2,3,4];return M.every((Z,X)=>Z.length===P[X]&&/^\d+$/.test(Z))}function h(y){const S=n.config?.zoom??17;o.flyTo?.({center:[y.lng,y.lat],zoom:S}),O(y)}async function H(){const y=u.value==="parcel"?K():d.value.trim();if(y){if(u.value==="xy"){const S=Be(y);if(!S.ok){Ne.notify({type:"warning",title:"Пошук координат",message:"Використайте `lat lon` або DMS у форматі `50°27'00\"N 30°31'24\"E`."});return}h(S),d.value="";return}if(u.value==="address"){try{await ze(y)}catch(S){const M=S?.message||"Помилка пошуку адреси";Ne.notify({type:"error",title:"Пошук адреси",message:M})}return}try{const S=new URL(u.value==="here"?pc:uc);if(u.value==="here")S.searchParams.set("searchtext",y);else{if(!We(y)){Ne.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}S.searchParams.set("cad_num",y)}const M=await fetch(S.toString());if(!M.ok)throw new Error(`HTTP ${M.status}`);const P=await M.json(),Z=u.value==="here"?pt(P):wt(P);if(!Z.length)Ne.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const X=Z[0];h(X),u.value==="parcel"&&E&&(E.value=""),d.value=""}}catch(S){const M=S?.message||"Помилка пошуку";Ne.notify({type:"error",title:"Пошук",message:M})}}}return(y,S)=>(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(H,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:w,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:S[0]||(S[0]=M=>m.value=!m.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:ee(u.value)},e.toDisplayString(ee(u.value)),9,nc),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":m.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...S[3]||(S[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),m.value?(e.openBlock(),e.createElementBlock("div",oc,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:P=>C(M)},e.toDisplayString(ee(M)),9,sc))),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"},[u.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:k,"onUpdate:modelValue":S[1]||(S[1]=M=>d.value=M),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,d.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":S[2]||(S[2]=M=>d.value=M),placeholder:p.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,rc)),[[e.vModelText,d.value,void 0,{trim:!0}]]),S[4]||(S[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)),T.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:x,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.createElementVNode("ul",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,M=>(e.openBlock(),e.createElementBlock("li",{key:M.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:P=>et(M)},e.toDisplayString(M.title),9,lc))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),gc={class:"map-center-control"},yc=["aria-label"],vc=e.defineComponent({directives:{tooltip:Ne.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=hn(),r=e.ref(null),i=e.ref(null),l=e.ref(null),a=e.ref(null);function c(b){if(Array.isArray(b)&&b.length>=2){const[k,_]=b.slice(0,2).map(x=>Number(x));return Number.isNaN(k)||Number.isNaN(_)?null:[k,_]}if(b&&typeof b=="object"){const k=b,_=k.lng??k.lon??k.long??k.x,x=k.lat??k.y;if(_!=null&&x!=null){const T=Number(_),B=Number(x);if(!Number.isNaN(T)&&!Number.isNaN(B))return[T,B]}}if(typeof b=="string"){const k=b.split(",").map(_=>Number(_.trim()));if(k.length>=2&&k.every(_=>!Number.isNaN(_)))return[k[0],k[1]]}return null}e.watch(()=>n.center,b=>{const k=c(b);k&&(r.value=k)},{immediate:!0}),e.watch(()=>n.zoom,b=>{const k=Number(b);Number.isNaN(k)||(i.value=k)},{immediate:!0}),e.watch(()=>n.targetCenter,b=>{l.value=c(b)},{immediate:!0}),e.watch(()=>n.targetZoom,b=>{const k=Number(b);a.value=Number.isNaN(k)?null:k},{immediate:!0});const p=e.computed(()=>n.targetLabel?.trim()||"Точка"),u=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),d=e.computed(()=>!!l.value);e.onMounted(async()=>{const b=o.value;if(b){if(!r.value){const k=b.getCenter();r.value=[k.lng,k.lat]}i.value==null&&(i.value=b.getZoom())}});function m(){const b=o.value;if(!b)return;const k=r.value||(()=>{const x=b.getCenter();return[x.lng,x.lat]})(),_=i.value??b.getZoom();b.flyTo({center:k,zoom:_})}function w(){const b=o.value;if(!b||!l.value)return;const k=a.value??i.value??b.getZoom();b.flyTo({center:l.value,zoom:k})}return(b,k)=>{const _=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",gc,[d.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(m,["stop"])},[e.createVNode(e.unref(qr),{class:"w-4 h-4"})])),[[_,"Центр мапи"]]),d.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":u.value,onClick:e.withModifiers(w,["stop"])},[e.createVNode(e.unref(Gr),{class:"w-4 h-4"})],8,yc)),[[_,p.value]]):e.createCommentVNode("",!0)])}}}),ss=st(vc,[["__scopeId","data-v-bc627616"]]),bc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},kc={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Ec=["aria-label"],wc={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)]"},xc={class:"text-slate-900 font-semibold mb-1"},Nc=["innerHTML"],Cc={key:1,class:"space-y-2"},Sc={class:"text-gray-500"},_c={class:"font-medium text-slate-900"},Bc={key:2,class:"mt-2 flex flex-col gap-2"},$c=["href","target"],mt="map-basemap-source",Ut="map-basemap-layer",Tc=20,Bt="map-katottg-geometry-source",gn="map-katottg-geometry-line",rt="map-geometry-source",$t="map-geometry-fill",Tt="map-geometry-line",Lt="map-geometry-circle",yn=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"}],i=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function l(f){if(f){if(Array.isArray(f)&&f.length>=2){const F=Number(f[0]),W=Number(f[1]);return!Number.isFinite(F)||!Number.isFinite(W)?void 0:[F,W]}if(typeof f=="object"){const F=f,W=F.lng??F.lon??F.long??F.x,Y=F.lat??F.y;if(W!=null&&Y!=null){const Te=Number(W),Ye=Number(Y);if(Number.isFinite(Te)&&Number.isFinite(Ye))return[Te,Ye]}}}}function a(f){if(f==null)return;const F=Number(f);return Number.isFinite(F)?F:void 0}const c=()=>typeof window>"u"?"":window.location?.origin??"",p=f=>{if(!f)return"";const F=f.trim();if(!F)return"";const Y=F.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const Te=c(),Ye=Y.replace(/^\/+/,"");return Te?`${Te}/${Ye}`:Ye?`/${Ye}`:""},u=e.computed(()=>n.katottg!=null?n.katottg:i.katottg),d=e.computed(()=>(Array.isArray(i.basemaps)&&i.basemaps.length?i.basemaps:o).map((W,Y)=>{const Te=typeof W.url=="string"?W.url.trim():"";return Te?{key:(W.key??W.name??`base-${Y}`).trim()||`base-${Y}`,url:Te,name:W.name??W.key??`Layer ${Y+1}`}:null}).filter(W=>!!W)),m=l(i.center),w=a(i.zoom),b=zo(n.geom),k=Sr(b),_=k?[(k[0]+k[2])/2,(k[1]+k[3])/2]:void 0,x=e.ref(null),T=e.computed(()=>l(n.center)??null),B=e.computed(()=>T.value??m??null),E=f=>f?{version:8,sources:{[mt]:{type:"raster",tiles:[f],tileSize:256}},layers:[{id:Ut,type:"raster",source:mt,layout:{visibility:"visible"}}]}:{version:8,sources:{},layers:[]},N=p(d.value[0]?.url),$=hn({container:x,center:_??B.value??void 0,zoom:n.zoom??w,style:E(N)}),{map:L,setCenter:g,setZoom:I,state:z,getOverlayConfig:U,selectedCard:K,setBasemapOptions:G,clearCard:O,addControl:j,removeControl:C,ready:q}=$,ee=e.computed({get:()=>z.value.selectedBasemap??"",set:f=>{z.value.selectedBasemap=f}}),_e=e.computed({get:()=>z.value.geometryVisible??!0,set:f=>{z.value.geometryVisible=f}}),me=e.computed(()=>{const f=n.height;return{height:typeof f=="number"?`${f}px`:String(f)}}),he=e.ref(!1),Be=e.ref(!1),pt=e.computed(()=>he.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),wt=e.computed(()=>{const f=["w-full","h-full"];return he.value||f.push(`min-h-[${me.value.height}]`),f.join(" ")}),Fe=e.computed(()=>K.value),ze=()=>O?.(),et=e.ref(_??B.value??null),We=e.ref(n.zoom??w??null),h=e.ref(B.value);e.watch(B,f=>{h.value=f},{immediate:!0});const H=e.computed(()=>h.value??null),y=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof We.value=="number"?We.value:Tc),S=["home","fullscreen","scale","position","search"],M=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?S:n.tools.filter(f=>S.includes(f))),P=f=>M.value.includes(f);e.watch([L,q],([f,F])=>{if(!(!f||!F)){if(!et.value){const W=f.getCenter();et.value=[W.lng,W.lat]}We.value==null&&(We.value=f.getZoom())}},{immediate:!0});const Z=e.ref(null),X=e.ref(""),se=e.ref(null),ae=f=>f?Be.value?!0:typeof f.isStyleLoaded=="function"&&f.isStyleLoaded()?(Be.value=!0,!0):!1:!1,pe=f=>{if(!f)return"";const F=Number(f.lat??f[1]),W=Number(f.lng??f[0]);return!Number.isFinite(F)||!Number.isFinite(W)?"":`${W.toFixed(5)}, ${F.toFixed(5)}`},je=f=>{f?.lngLat&&(X.value=pe(f.lngLat))},ke=()=>{X.value=""},$e=f=>{f&&(f.on("mousemove",je),f.on("mouseleave",ke),se.value=f)},tt=f=>{f&&(f.off("mousemove",je),f.off("mouseleave",ke),se.value=null)},sn=e.computed(()=>P("scale"));e.watch([L,q],([f,F],[W])=>{W&&tt(W),!(!f||!F)&&$e(f)},{immediate:!0}),e.watch([L,q,sn],([f,F,W])=>{if(Z.value&&C&&(C(Z.value),Z.value=null),!f||!F||!W)return;const Y=window?.maplibregl;Y&&(Z.value=new Y.ScaleControl({unit:"metric"}),j?.(Z.value,"bottom-left"))},{immediate:!0});const Pt=e.computed(()=>Array.isArray(n.legend)?n.legend.map((f,F)=>{const W=typeof f?.color=="string"?f.color.trim():"",Y=typeof f?.label=="string"?f.label.trim():"";return!W||!Y?null:{color:W,label:Y,key:`${Y}-${F}`}}).filter(f=>!!f):[]),zt=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(i.layers)&&i.layers.length?i.layers:[]);e.watch(d,f=>{if(G?.(f),!f.length){ee.value="";return}f.some(F=>F.key===ee.value)||(ee.value=f[0].key)},{immediate:!0});const xt=f=>{if(!f?.getStyle)return;const F=f.getStyle()??{},W=Array.isArray(F.layers)?F.layers:[];return W.length?W.find(Te=>Te.type!=="background")?.id??W[0]?.id:void 0},Nt=f=>{f&&(f.getLayer(Ut)&&f.removeLayer(Ut),f.getSource(mt)&&f.removeSource(mt))},ut=(f,F)=>{if(!f)return;const W=xt(f);f.addSource(mt,{type:"raster",tiles:[F],tileSize:256}),f.addLayer({id:Ut,type:"raster",source:mt,layout:{visibility:"visible"}},W)},Mo=f=>{if(!f)return;const F=p(f.url);if(!F){nt.value=null;return}nt.value=F,Nt(L.value),A()},nt=e.ref(null),v=e.ref(N||null),R=f=>{if(!f||f.__pendingBasemapHooked)return;f.__pendingBasemapHooked=!0;const F=()=>{f.__pendingBasemapHooked=!1,A()};f.once("style.load",F),f.once("styledata",F)},A=()=>{const f=L.value,F=nt.value;if(!(!F||!f)){if(!ae(f)){R(f);return}if(v.value===F&&f.getSource(mt)&&f.getLayer(Ut)){nt.value=null;return}Nt(f),ut(f,F),v.value=F,nt.value=null}},D=()=>{const f=ee.value;if(!f)return;const F=d.value.find(W=>W.key===f);F&&Mo(F)};e.watch(ee,()=>{D()},{immediate:!0}),e.watch(zt,f=>{$.setOverlays?.(f)},{immediate:!0,deep:!0});const J=e.ref(null);let ie=0;const ne=e.computed(()=>zo(J.value)),xe={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}},ot={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},re=e.ref(b),qe=e.ref(k),ve=e.ref(!1),Ze=e.computed(()=>{if(!qe.value)return null;const[f,F,W,Y]=qe.value;return[(f+W)/2,(F+Y)/2]}),jt=e.computed(()=>!!qe.value),Ke=e.ref(!!k);e.ref(!1);const Ro=()=>{he.value=!he.value},Je=e.ref(!1),Fo=()=>{const f=L.value;if(!f||!ae(f))return;const F=re.value;if(!F){Tu(f),rn();return}let W=f.getSource(rt);W?W.setData(F):(f.addSource(rt,{type:"geojson",data:F}),$u(f),W=f.getSource(rt)),Nr(f,_e.value?"visible":"none"),Lu(),rn(),qe.value&&(!Ke.value&&(ve.value||!Je.value)?(f.fitBounds(qe.value,{padding:40,maxZoom:16,duration:0}),Je.value=!0,ve.value=!1):Ke.value&&(Ke.value=!1,ve.value=!1,Je.value=!0))},$u=f=>{const F=xe;f.getLayer($t)||f.addLayer({id:$t,type:"fill",source:rt,paint:F.fill}),f.getLayer(Tt)||f.addLayer({id:Tt,type:"line",source:rt,paint:F.line}),f.getLayer(Lt)||f.addLayer({id:Lt,type:"circle",source:rt,paint:F.circle,filter:["==","$type","Point"]})},Tu=f=>{[Lt,Tt,$t].forEach(F=>{f.getLayer(F)&&f.removeLayer(F)}),f.getSource(rt)&&f.removeSource(rt)},Nr=(f,F)=>{ae(f)&&[Lt,Tt,$t].forEach(W=>{f.getLayer(W)&&f.setLayoutProperty(W,"visibility",F)})},Lu=()=>{const f=L.value;if(!f||!ae(f))return;const F=xe;f.getLayer($t)&&Object.entries(F.fill).forEach(([W,Y])=>{f.setPaintProperty($t,W,Y)}),f.getLayer(Tt)&&Object.entries(F.line).forEach(([W,Y])=>{f.setPaintProperty(Tt,W,Y)}),f.getLayer(Lt)&&Object.entries(F.circle).forEach(([W,Y])=>{f.setPaintProperty(Lt,W,Y)})},Cr=f=>{f.getLayer(gn)||f.addLayer({id:gn,type:"line",source:Bt,layout:{visibility:"visible"},paint:ot})},rn=()=>{const f=L.value;if(!f||!ae(f))return;const F=ne.value??{type:"FeatureCollection",features:[]};if(!f.getSource(Bt)){f.addSource(Bt,{type:"geojson",data:F}),Cr(f);return}const W=f.getSource(Bt);W&&typeof W.setData=="function"&&W.setData(F),Cr(f)},Au=f=>{f.getLayer(gn)&&f.removeLayer(gn),f.getSource(Bt)&&f.removeSource(Bt)},Du=async f=>{const F=typeof f=="string"?f.trim():"",W=++ie;if(!F){J.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${F}`);if(ie!==W)return;if(!Y.ok){J.value=null;return}const Te=await Y.json();if(ie!==W)return;J.value=Te}catch{if(ie!==W)return;J.value=null}};e.watch(u,f=>{Du(f)},{immediate:!0}),e.watch(ne,()=>{rn()},{immediate:!0}),e.watch(()=>n.geom,f=>{re.value=zo(f),qe.value=Sr(re.value),Ze.value&&(et.value=Ze.value),Je.value=!1,ve.value=!0,Fo()},{deep:!0,immediate:!0}),e.watch(_e,()=>{const f=L.value;f&&ae(f)&&Nr(f,_e.value?"visible":"none")});const Ct=()=>{Be.value=!0,Fo(),rn(),A()},Po=()=>{Fo(),rn()};e.watch(L,(f,F)=>{F&&(F.off("style.load",Ct),F.off("load",Ct),F.off("idle",Po)),Be.value=!1,f&&(f.on("load",Ct),f.on("style.load",Ct),f.on("idle",Po),typeof f.isStyleLoaded=="function"&&f.isStyleLoaded()&&Ct())}),e.watch(T,f=>{!L.value||!f||jt.value||g(f)}),e.watch(()=>n.zoom,f=>{!L.value||typeof f!="number"||I(f)}),e.onBeforeUnmount(()=>{Z.value&&C&&C(Z.value),se.value?tt(se.value):L.value&&tt(L.value);const f=L.value;f&&(Au(f),f.off("style.load",Ct),f.off("load",Ct),f.off("idle",Po))});function Iu(f){f&&(ee.value=f)}function Ou(f){_e.value=f}$.setBasemap=Iu,$.toggleGeometry=Ou,$.setOverlays?.(zt.value);function zo(f){if(!f)return null;if(f.type==="FeatureCollection")return f;if(f.type==="Feature")return{type:"FeatureCollection",features:[f]};const F=f.geometry??f;if(!F?.type)return null;if(F.type==="GeometryCollection"&&Array.isArray(F.geometries)){const W=F.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return W.length?{type:"FeatureCollection",features:W}:null}if(F.type==="MultiPoint"&&Array.isArray(F.coordinates)){const W=F.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return W.length?{type:"FeatureCollection",features:W}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:F}]}}function Sr(f){if(!f?.features?.length)return null;let F=1/0,W=1/0,Y=-1/0,Te=-1/0;const Ye=ln=>{if(typeof ln[0]=="number"){const[St,_r]=ln;F=Math.min(F,St),W=Math.min(W,_r),Y=Math.max(Y,St),Te=Math.max(Te,_r);return}ln.forEach(St=>Ye(St))};return f.features.forEach(ln=>{const St=ln?.geometry?.coordinates;St&&Ye(St)}),F===1/0||W===1/0?null:[F,W,Y,Te]}return(f,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(pt.value),style:e.normalizeStyle(he.value?void 0:me.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:x,class:e.normalizeClass(wt.value)},null,2),e.createVNode(Xa,{items:Pt.value},null,8,["items"]),P("search")?(e.openBlock(),e.createBlock(hc,{key:0})):e.createCommentVNode("",!0),P("home")||P("fullscreen")?(e.openBlock(),e.createElementBlock("div",bc,[P("home")?(e.openBlock(),e.createElementBlock("div",kc,[e.createVNode(ss,{center:H.value,zoom:y.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(ss,{key:0,"target-center":Ze.value,"target-zoom":y.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),P("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:Ro,"aria-label":he.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...F[0]||(F[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,Ec)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Fe.value?(e.openBlock(),e.createElementBlock("div",wc,[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:ze},[...F[1]||(F[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",xc,e.toDisplayString(Fe.value.title||"Об'єкт"),1),Fe.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(${me.value.height}-120px)]`]),innerHTML:Fe.value.html},null,10,Nc)):(e.openBlock(),e.createElementBlock("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.rows,W=>(e.openBlock(),e.createElementBlock("div",{key:W.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",Sc,e.toDisplayString(W.label)+":",1),e.createElementVNode("span",_c,e.toDisplayString(W.value),1)]))),128))])),Fe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",Bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.actions,W=>(e.openBlock(),e.createElementBlock("a",{key:W.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:W.url,target:W.target??void 0,rel:"noreferrer"},e.toDisplayString(W.label),9,$c))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Za),P("position")&&X.value?(e.openBlock(),e.createBlock(ec,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:X.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function Ge(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const Lc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},vn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),it=Object.assign,Xe=Array.isArray,be=t=>typeof t=="string",Zn=t=>typeof t=="symbol",Ac=t=>t!==null&&typeof t=="object",rs=Ge(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Dc=Ge("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},Ic=/-\w/g,lt=Jn(t=>t.replace(Ic,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Oc=Jn(t=>t?`on${Yn(t)}`:""),Wt={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"},Mc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},Rc=/;(?![^(]*\))/g,Fc=/:([^]+)/,Pc=/\/\*[^]*?\*\//g;function zc(t){const n={};return t.replace(Pc,"").split(Rc).forEach(o=>{if(o){const s=o.split(Fc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const jc="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",Uc="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",Wc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",qc=Ge(jc),Kc=Ge(Hc),Gc=Ge(Uc),Zc=Ge(Wc);const qt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),bn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),is=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ht=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),as=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),Gt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),cs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),so=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),io=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),ds=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),fs=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),kn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),En=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Zt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Jt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Jc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),wn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Yc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Xc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Qc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Vc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ps=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),At={[qt]:"Fragment",[Kt]:"Teleport",[Xn]:"Suspense",[bn]:"KeepAlive",[is]:"BaseTransition",[ht]:"openBlock",[ls]:"createBlock",[as]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[Gt]:"createCommentVNode",[eo]:"createTextVNode",[cs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[ds]:"renderSlot",[fs]:"createSlots",[kn]:"toDisplayString",[En]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Zt]:"normalizeProps",[Jt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Jc]:"capitalize",[po]:"toHandlerKey",[wn]:"setBlockTracking",[Yc]:"pushScopeId",[Xc]:"popScopeId",[uo]:"withCtx",[Qc]:"unref",[Vc]:"isRef",[mo]:"withMemo",[ps]:"isMemoSame"};function ed(t){Object.getOwnPropertySymbols(t).forEach(n=>{At[n]=t[n]})}const Oe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function td(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 Yt(t,n,o,s,r,i,l,a=!1,c=!1,p=!1,u=Oe){return t&&(a?(t.helper(ht),t.helper(Ot(t.inSSR,p))):t.helper(It(t.inSSR,p)),l&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:i,directives:l,isBlock:a,disableTracking:c,isComponent:p,loc:u}}function gt(t,n=Oe){return{type:17,loc:n,elements:t}}function Pe(t,n=Oe){return{type:15,loc:n,properties:t}}function ue(t,n){return{type:16,loc:Oe,key:be(t)?Q(t,!0):t,value:n}}function Q(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 Dt(t,n=void 0,o=!1,s=!1,r=Oe){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ho(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Oe}}function nd(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Oe}}function od(t){return{type:21,body:t,loc:Oe}}function It(t,n){return t||n?Qn:Vn}function Ot(t,n){return t||n?ls:as}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(It(s,t.isComponent)),n(ht),n(Ot(s,t.isComponent)))}const us=new Uint8Array([123,123]),ms=new Uint8Array([125,125]);function hs(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 at(t){return t===47||t===62||Me(t)}function xn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const Ee={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 sd{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=us,this.delimiterClose=ms,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=us,this.delimiterClose=ms}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let i=-1;if(r>100){let l=-1,a=r;for(;l+1<a;){const c=l+a>>>1;this.newlines[c]<n?l=c:a=c}i=l}else for(let l=r-1;l>=0;l--)if(n>this.newlines[l]){i=l;break}return i>=0&&(o=i+2,s=n-this.newlines[i]),{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?at(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===Ee.TitleEnd||this.currentSequence===Ee.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===Ee.Cdata[this.sequenceIndex]?++this.sequenceIndex===Ee.Cdata.length&&(this.state=28,this.currentSequence=Ee.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===Ee.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):hs(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){at(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(at(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(xn("</"+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=hs(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||at(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||at(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||at(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||at(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||at(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=Ee.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===Ee.ScriptEnd[3]?this.startSpecial(Ee.ScriptEnd,4):n===Ee.StyleEnd[3]?this.startSpecial(Ee.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===Ee.TitleEnd[3]?this.startSpecial(Ee.TitleEnd,4):n===Ee.TextareaEnd[3]?this.startSpecial(Ee.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===Ee.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 rd={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 yo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function ct(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function Mt(t,n,o,...s){const r=ct(t,n);return process.env.NODE_ENV!=="production"&&r&&Nn(t,n,o,...s),r}function Nn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:i,link:l}=rd[t],a=`(deprecation ${t}) ${typeof i=="function"?i(...s):i}${l?`
2
- Details: ${l}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function vo(t){throw t}function gs(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function oe(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||id)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,i=new SyntaxError(String(r));return i.code=t,i.loc=n,i}const id={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 '&lt;' 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.",53:"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.
3
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"v-model cannot be used on a const binding because it is not writable.",46:"Error parsing JavaScript expression: ",47:"<KeepAlive> expects exactly one child component.",52:"@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.",48:'"prefixIdentifiers" option is not supported in this build of compiler.',49:"ES module mode is not supported in this build of compiler.",50:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',51:'"scopeId" option is only supported in module mode.',54:""},Le=t=>t.type===4&&t.isStatic;function ys(t){switch(t){case"Teleport":case"teleport":return Kt;case"Suspense":case"suspense":return Xn;case"KeepAlive":case"keep-alive":return bn;case"BaseTransition":case"base-transition":return is}}const ld=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=t=>!ld.test(t),vs=/[A-Za-z_$\xA0-\uFFFF]/,ad=/[\.\?\w$\xA0-\uFFFF]/,cd=/\s+[.[]\s*|\s*[.[]\s+/g,bs=t=>t.type===4?t.content:t.loc.source,ks=t=>{const n=bs(t).trim().replace(cd,a=>a.trim());let o=0,s=[],r=0,i=0,l=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,i++;else if(!(a===0?vs:ad).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,l=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,l=c;else if(c==="(")i++;else if(c===")"){if(a===n.length-1)return!1;--i||(o=s.pop())}break;case 3:c===l&&(o=s.pop(),l=null);break}}return!r&&!i},dd=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,fd=t=>dd.test(bs(t));function Es(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Ae(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)&&(be(n)?r.name===n:n.test(r.name)))return r}}function Xt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const i=t.props[r];if(i.type===6){if(o)continue;if(i.name===n&&(i.value||s))return i}else if(i.name==="bind"&&(i.exp||s)&&dt(i.arg,n))return i}}function dt(t,n){return!!(t&&Le(t)&&t.content===n)}function pd(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function ko(t){return t.type===5||t.type===2}function ws(t){return t.type===7&&t.name==="pre"}function ud(t){return t.type===7&&t.name==="slot"}function Cn(t){return t.type===1&&t.tagType===3}function Sn(t){return t.type===1&&t.tagType===2}const md=new Set([Zt,Jt]);function xs(t,n=[]){if(t&&!be(t)&&t.type===14){const o=t.callee;if(!be(o)&&md.has(o))return xs(t.arguments[0],n.concat(t))}return[t,n]}function _n(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],i=[],l;if(r&&!be(r)&&r.type===14){const a=xs(r);r=a[0],i=a[1],l=i[i.length-1]}if(r==null||be(r))s=Pe([n]);else if(r.type===14){const a=r.arguments[0];!be(a)&&a.type===15?Ns(n,a)||a.properties.unshift(n):r.callee===co?s=ye(o.helper(En),[Pe([n]),r]):r.arguments.unshift(Pe([n])),!s&&(s=r)}else r.type===15?(Ns(n,r)||r.properties.unshift(n),s=r):(s=ye(o.helper(En),[Pe([n]),r]),l&&l.callee===Jt&&(l=i[i.length-2]));t.type===13?l?l.arguments[0]=s:t.props=s:l?l.arguments[0]=s:t.arguments[2]=s}function Ns(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 Qt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function hd(t){return t.type===14&&t.callee===mo?t.arguments[1].returns:t}const gd=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Cs(t){for(let n=0;n<t.length;n++)if(!Me(t.charCodeAt(n)))return!1;return!0}function Eo(t){return t.type===2&&Cs(t.content)||t.type===12&&Eo(t.content)}function wo(t){return t.type===3||Eo(t)}const Ss={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:vn,isPreTag:vn,isIgnoreNewlineTag:vn,isCustomElement:vn,onError:vo,onWarn:gs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let te=Ss,Vt=null,Qe="",Ce=null,V=null,De="",Ve=-1,yt=-1,xo=0,ft=!1,No=null;const de=[],ce=new sd(de,{onerr:Ie,ontext(t,n){Bn(we(t,n),t,n)},ontextentity(t,n,o){Bn(t,n,o)},oninterpolation(t,n){if(ft)return Bn(we(t,n),t,n);let o=t+ce.delimiterOpen.length,s=n-ce.delimiterClose.length;for(;Me(Qe.charCodeAt(o));)o++;for(;Me(Qe.charCodeAt(s-1));)s--;let r=we(o,s);r.includes("&")&&(r=te.decodeEntities(r,!1)),Co({type:5,content:Tn(r,!1,fe(o,s)),loc:fe(t,n)})},onopentagname(t,n){const o=we(t,n);Ce={type:1,tag:o,ns:te.getNamespace(o,de[0],te.ns),tagType:0,props:[],children:[],loc:fe(t-1,n),codegenNode:void 0}},onopentagend(t){Bs(t)},onclosetag(t,n){const o=we(t,n);if(!te.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Ie(24,de[0].loc.start.offset);for(let l=0;l<=r;l++){const a=de.shift();$n(a,n,l<r)}break}s||Ie(23,$s(t,60))}},onselfclosingtag(t){const n=Ce.tag;Ce.isSelfClosing=!0,Bs(t),de[0]&&de[0].tag===n&&$n(de.shift(),t)},onattribname(t,n){V={type:6,name:we(t,n),nameLoc:fe(t,n),value:void 0,loc:fe(t)}},ondirname(t,n){const o=we(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!ft&&s===""&&Ie(26,t),ft||s==="")V={type:6,name:o,nameLoc:fe(t,n),value:void 0,loc:fe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:fe(t)},s==="pre"){ft=ce.inVPre=!0,No=Ce;const r=Ce.props;for(let i=0;i<r.length;i++)r[i].type===7&&(r[i]=Sd(r[i]))}},ondirarg(t,n){if(t===n)return;const o=we(t,n);if(ft&&!ws(V))V.name+=o,vt(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Tn(s?o:o.slice(1,-1),s,fe(t,n),s?3:0)}},ondirmodifier(t,n){const o=we(t,n);if(ft&&!ws(V))V.name+="."+o,vt(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,vt(s.loc,n))}else{const s=Q(o,!0,fe(t,n));V.modifiers.push(s)}},onattribdata(t,n){De+=we(t,n),Ve<0&&(Ve=t),yt=n},onattribentity(t,n,o){De+=t,Ve<0&&(Ve=n),yt=o},onattribnameend(t){const n=V.loc.start.offset,o=we(n,t);V.type===7&&(V.rawName=o),Ce.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Ie(2,n)},onattribend(t,n){if(Ce&&V){if(vt(V.loc,n),t!==0)if(De.includes("&")&&(De=te.decodeEntities(De,!0)),V.type===6)V.name==="class"&&(De=As(De).trim()),t===1&&!De&&Ie(13,n),V.value={type:2,content:De,loc:t===1?fe(Ve,yt):fe(Ve-1,yt+1)},ce.inSFCRoot&&Ce.tag==="template"&&V.name==="lang"&&De&&De!=="html"&&ce.enterRCDATA(xn("</template"),0);else{let o=0;V.exp=Tn(De,!1,fe(Ve,yt),0,o),V.name==="for"&&(V.forParseResult=vd(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&Mt("COMPILER_V_BIND_SYNC",te,V.loc,V.arg.loc.source)&&(V.name="model",V.modifiers.splice(s,1))}(V.type!==7||V.name!=="pre")&&Ce.props.push(V)}De="",Ve=yt=-1},oncomment(t,n){te.comments&&Co({type:3,content:we(t,n),loc:fe(t-4,n+3)})},onend(){const t=Qe.length;if(process.env.NODE_ENV!=="production"&&ce.state!==1)switch(ce.state){case 5:case 8:Ie(5,t);break;case 3:case 4:Ie(25,ce.sectionStart);break;case 28:ce.currentSequence===Ee.CdataEnd?Ie(6,t):Ie(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:Ie(9,t);break}for(let n=0;n<de.length;n++)$n(de[n],t-1),Ie(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?Bn(we(t,n),t,n):Ie(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:te.ns)===0&&Ie(21,t-1)}}),_s=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,yd=/^\(|\)$/g;function vd(t){const n=t.loc,o=t.content,s=o.match(gd);if(!s)return;const[,r,i]=s,l=(d,m,w=!1)=>{const b=n.start.offset+m,k=b+d.length;return Tn(d,!1,fe(b,k),0,w?1:0)},a={source:l(i.trim(),o.indexOf(i,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(yd,"").trim();const p=r.indexOf(c),u=c.match(_s);if(u){c=c.replace(_s,"").trim();const d=u[1].trim();let m;if(d&&(m=o.indexOf(d,p+c.length),a.key=l(d,m,!0)),u[2]){const w=u[2].trim();w&&(a.index=l(w,o.indexOf(w,a.key?m+d.length:p+c.length),!0))}}return c&&(a.value=l(c,p,!0)),a}function we(t,n){return Qe.slice(t,n)}function Bs(t){ce.inSFCRoot&&(Ce.innerLoc=fe(t+1,t+1)),Co(Ce);const{tag:n,ns:o}=Ce;o===0&&te.isPreTag(n)&&xo++,te.isVoidTag(n)?$n(Ce,t):(de.unshift(Ce),(o===1||o===2)&&(ce.inXML=!0)),Ce=null}function Bn(t,n,o){{const i=de[0]&&de[0].tag;i!=="script"&&i!=="style"&&t.includes("&")&&(t=te.decodeEntities(t,!1))}const s=de[0]||Vt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,vt(r.loc,o)):s.children.push({type:2,content:t,loc:fe(n,o)})}function $n(t,n,o=!1){o?vt(t.loc,$s(n,60)):vt(t.loc,bd(n,62)+1),ce.inSFCRoot&&(t.children.length?t.innerLoc.end=it({},t.children[t.children.length-1].loc.end):t.innerLoc.end=it({},t.innerLoc.start),t.innerLoc.source=we(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:i}=t;if(ft||(s==="slot"?t.tagType=2:Ts(t)?t.tagType=3:Ed(t)&&(t.tagType=1)),ce.inRCDATA||(t.children=Ls(i)),r===0&&te.isIgnoreNewlineTag(s)){const l=i[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}r===0&&te.isPreTag(s)&&xo--,No===t&&(ft=ce.inVPre=!1,No=null),ce.inXML&&(de[0]?de[0].ns:te.ns)===0&&(ce.inXML=!1);{const l=t.props;if(process.env.NODE_ENV!=="production"&&ct("COMPILER_V_IF_V_FOR_PRECEDENCE",te)){let c=!1,p=!1;for(let u=0;u<l.length;u++){const d=l[u];if(d.type===7&&(d.name==="if"?c=!0:d.name==="for"&&(p=!0)),c&&p){Nn("COMPILER_V_IF_V_FOR_PRECEDENCE",te,t.loc);break}}}if(!ce.inSFCRoot&&ct("COMPILER_NATIVE_TEMPLATE",te)&&t.tag==="template"&&!Ts(t)){process.env.NODE_ENV!=="production"&&Nn("COMPILER_NATIVE_TEMPLATE",te,t.loc);const c=de[0]||Vt,p=c.children.indexOf(t);c.children.splice(p,1,...t.children)}const a=l.find(c=>c.type===6&&c.name==="inline-template");a&&Mt("COMPILER_INLINE_TEMPLATE",te,a.loc)&&t.children.length&&(a.value={type:2,content:we(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function bd(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o<Qe.length-1;)o++;return o}function $s(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o>=0;)o--;return o}const kd=new Set(["if","else","else-if","for","slot"]);function Ts({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&kd.has(n[o].name))return!0}return!1}function Ed({tag:t,props:n}){if(te.isCustomElement(t))return!1;if(t==="component"||wd(t.charCodeAt(0))||ys(t)||te.isBuiltInComponent&&te.isBuiltInComponent(t)||te.isNativeTag&&!te.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(Mt("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}}else if(s.name==="bind"&&dt(s.arg,"is")&&Mt("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}return!1}function wd(t){return t>64&&t<91}const xd=/\r\n/g;function Ls(t){const n=te.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(xo)r.content=r.content.replace(xd,`
4
- `);else if(Cs(r.content)){const i=t[s-1]&&t[s-1].type,l=t[s+1]&&t[s+1].type;!i||!l||n&&(i===3&&(l===3||l===1)||i===1&&(l===3||l===1&&Nd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=As(r.content))}return o?t.filter(Boolean):t}function Nd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function As(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 Co(t){(de[0]||Vt).children.push(t)}function fe(t,n){return{start:ce.getPos(t),end:n==null?n:ce.getPos(n),source:n==null?n:we(t,n)}}function Cd(t){return fe(t.start.offset,t.end.offset)}function vt(t,n){t.end=ce.getPos(n),t.source=we(t.start.offset,n)}function Sd(t){const n={type:6,name:t.rawName,nameLoc:fe(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 Tn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Ie(t,n,o){te.onError(oe(t,fe(n,n),void 0,o))}function _d(){ce.reset(),Ce=null,V=null,De="",Ve=-1,yt=-1,de.length=0}function Bd(t,n){if(_d(),Qe=t,te=it({},Ss),n){let r;for(r in n)n[r]!=null&&(te[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!te.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");ce.mode=te.parseMode==="html"?1:te.parseMode==="sfc"?2:0,ce.inXML=te.ns===1||te.ns===2;const o=n&&n.delimiters;o&&(ce.delimiterOpen=xn(o[0]),ce.delimiterClose=xn(o[1]));const s=Vt=td([],t);return ce.parse(Qe),s.loc=fe(0,t.length),s.children=Ls(s.children),Vt=null,s}function $d(t,n){Ln(t,void 0,n,!!Ds(t))}function Ds(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!Sn(n[0])?n[0]:null}function Ln(t,n,o,s=!1,r=!1){const{children:i}=t,l=[];for(let u=0;u<i.length;u++){const d=i[u];if(d.type===1&&d.tagType===0){const m=s?0:Re(d,o);if(m>0){if(m>=2){d.codegenNode.patchFlag=-1,l.push(d);continue}}else{const w=d.codegenNode;if(w.type===13){const b=w.patchFlag;if((b===void 0||b===512||b===1)&&Os(d,o)>=2){const k=Ms(d);k&&(w.props=o.hoist(k))}w.dynamicProps&&(w.dynamicProps=o.hoist(w.dynamicProps))}}}else if(d.type===12&&(s?0:Re(d,o))>=2){d.codegenNode.type===14&&d.codegenNode.arguments.length>0&&d.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Wt[-1]} */`:"")),l.push(d);continue}if(d.type===1){const m=d.tagType===1;m&&o.scopes.vSlot++,Ln(d,t,o,!1,r),m&&o.scopes.vSlot--}else if(d.type===11)Ln(d,t,o,d.children.length===1,!0);else if(d.type===9)for(let m=0;m<d.branches.length;m++)Ln(d.branches[m],t,o,d.branches[m].children.length===1,r)}let a=!1;if(l.length===i.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Xe(t.codegenNode.children))t.codegenNode.children=c(gt(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Xe(t.codegenNode.children)&&t.codegenNode.children.type===15){const u=p(t.codegenNode,"default");u&&(u.returns=c(gt(u.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Xe(n.codegenNode.children)&&n.codegenNode.children.type===15){const u=Ae(t,"slot",!0),d=u&&u.arg&&p(n.codegenNode,u.arg);d&&(d.returns=c(gt(d.returns)),a=!0)}}if(!a)for(const u of l)u.codegenNode=o.cache(u.codegenNode);function c(u){const d=o.cache(u);return d.needArraySpread=!0,d}function p(u,d){if(u.children&&!Xe(u.children)&&u.children.type===15){const m=u.children.properties.find(w=>w.key===d||w.key.content===d);return m&&m.value}}l.length&&o.transformHoist&&o.transformHoist(i,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 l=3;const a=Os(t,n);if(a===0)return o.set(t,0),0;a<l&&(l=a);for(let c=0;c<t.children.length;c++){const p=Re(t.children[c],n);if(p===0)return o.set(t,0),0;p<l&&(l=p)}if(l>1)for(let c=0;c<t.props.length;c++){const p=t.props[c];if(p.type===7&&p.name==="bind"&&p.exp){const u=Re(p.exp,n);if(u===0)return o.set(t,0),0;u<l&&(l=u)}}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(ht),n.removeHelper(Ot(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(It(n.inSSR,r.isComponent))}return o.set(t,l),l}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 i=3;for(let l=0;l<t.children.length;l++){const a=t.children[l];if(be(a)||Zn(a))continue;const c=Re(a,n);if(c===0)return 0;c<i&&(i=c)}return i;case 20:return 2;default:return process.env.NODE_ENV,0}}const Td=new Set([lo,ao,Zt,Jt]);function Is(t,n){if(t.type===14&&!be(t.callee)&&Td.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Re(o,n);if(o.type===14)return Is(o,n)}return 0}function Os(t,n){let o=3;const s=Ms(t);if(s&&s.type===15){const{properties:r}=s;for(let i=0;i<r.length;i++){const{key:l,value:a}=r[i],c=Re(l,n);if(c===0)return c;c<o&&(o=c);let p;if(a.type===4?p=Re(a,n):a.type===14?p=Is(a,n):p=0,p===0)return p;p<o&&(o=p)}}return o}function Ms(t){const n=t.codegenNode;if(n.type===13)return n.props}function Ld(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:i=!1,nodeTransforms:l=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:p=Kn,isCustomElement:u=Kn,expressionPlugins:d=[],scopeId:m=null,slotted:w=!0,ssr:b=!1,inSSR:k=!1,ssrCssVars:_="",bindingMetadata:x=Lc,inline:T=!1,isTS:B=!1,onError:E=vo,onWarn:N=gs,compatConfig:$}){const L=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),g={filename:n,selfName:L&&Yn(lt(L[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:i,nodeTransforms:l,directiveTransforms:a,transformHoist:c,isBuiltInComponent:p,isCustomElement:u,expressionPlugins:d,scopeId:m,slotted:w,ssr:b,inSSR:k,ssrCssVars:_,bindingMetadata:x,inline:T,isTS:B,onError:E,onWarn:N,compatConfig:$,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(I){const z=g.helpers.get(I)||0;return g.helpers.set(I,z+1),I},removeHelper(I){const z=g.helpers.get(I);if(z){const U=z-1;U?g.helpers.set(I,U):g.helpers.delete(I)}},helperString(I){return`_${At[g.helper(I)]}`},replaceNode(I){if(process.env.NODE_ENV!=="production"){if(!g.currentNode)throw new Error("Node being replaced is already removed.");if(!g.parent)throw new Error("Cannot replace root node.")}g.parent.children[g.childIndex]=g.currentNode=I},removeNode(I){if(process.env.NODE_ENV!=="production"&&!g.parent)throw new Error("Cannot remove root node.");const z=g.parent.children,U=I?z.indexOf(I):g.currentNode?g.childIndex:-1;if(process.env.NODE_ENV!=="production"&&U<0)throw new Error("node being removed is not a child of current parent");!I||I===g.currentNode?(g.currentNode=null,g.onNodeRemoved()):g.childIndex>U&&(g.childIndex--,g.onNodeRemoved()),g.parent.children.splice(U,1)},onNodeRemoved:Kn,addIdentifiers(I){},removeIdentifiers(I){},hoist(I){be(I)&&(I=Q(I)),g.hoists.push(I);const z=Q(`_hoisted_${g.hoists.length}`,!1,I.loc,2);return z.hoisted=I,z},cache(I,z=!1,U=!1){const K=nd(g.cached.length,I,z,U);return g.cached.push(K),K}};return g.filters=new Set,g}function Ad(t,n){const o=Ld(t,n);An(t,o),n.hoistStatic&&$d(t,o),n.ssr||Dd(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 Dd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=Ds(t);if(r&&r.codegenNode){const i=r.codegenNode;i.type===13&&go(i,n),t.codegenNode=i}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(i=>i.type!==3).length===1&&(r|=2048),t.codegenNode=Yt(n,o(qt),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function Id(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];be(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,An(r,n))}}function An(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let i=0;i<o.length;i++){const l=o[i](t,n);if(l&&(Xe(l)?s.push(...l):s.push(l)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(Gt);break;case 5:n.ssr||n.helper(kn);break;case 9:for(let i=0;i<t.branches.length;i++)An(t.branches[i],n);break;case 10:case 11:case 1:case 0:Id(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Rs(t,n){const o=be(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:i}=s;if(s.tagType===3&&i.some(ud))return;const l=[];for(let a=0;a<i.length;a++){const c=i[a];if(c.type===7&&o(c.name)){i.splice(a,1),a--;const p=n(s,c,r);p&&l.push(p)}}return l}}}const Dn="/*@__PURE__*/",Fs=t=>`${At[t]}: _${At[t]}`;function Od(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:i=null,optimizeImports:l=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:p="vue/server-renderer",ssr:u=!1,isTS:d=!1,inSSR:m=!1}){const w={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:i,optimizeImports:l,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:p,ssr:u,isTS:d,inSSR:m,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(k){return`_${At[k]}`},push(k,_=-2,x){w.code+=k},indent(){b(++w.indentLevel)},deindent(k=!1){k?--w.indentLevel:b(--w.indentLevel)},newline(){b(w.indentLevel)}};function b(k){w.push(`
5
- `+" ".repeat(k),0)}return w}function Md(t,n={}){const o=Od(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:i,indent:l,deindent:a,newline:c,scopeId:p,ssr:u}=o,d=Array.from(t.helpers),m=d.length>0,w=!i&&s!=="module";Rd(t,o);const k=u?"ssrRender":"render",x=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${k}(${x}) {`),l(),w&&(r("with (_ctx) {"),l(),m&&(r(`const { ${d.map(Fs).join(", ")} } = _Vue
6
- `,-1),c())),t.components.length&&(So(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(So(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),So(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let T=0;T<t.temps;T++)r(`${T>0?", ":""}_temp${T}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
- `,0),c()),u||r("return "),t.codegenNode?Se(t.codegenNode,o):r("null"),w&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function Rd(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:i,runtimeModuleName:l,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,p=a,u=Array.from(t.helpers);if(u.length>0&&(r(`const _Vue = ${p}
8
- `,-1),t.hoists.length)){const d=[Qn,Vn,Gt,eo,cs].filter(m=>u.includes(m)).map(Fs).join(", ");r(`const { ${d} } = _Vue
9
- `,-1)}Fd(t.hoists,n),i(),r("return ")}function So(t,n,{helper:o,push:s,newline:r,isTS:i}){const l=o(n==="filter"?so:n==="component"?to:oo);for(let a=0;a<t.length;a++){let c=t[a];const p=c.endsWith("__self");p&&(c=c.slice(0,-6)),s(`const ${Qt(c,n)} = ${l}(${JSON.stringify(c)}${p?", true":""})${i?"!":""}`),a<t.length-1&&r()}}function Fd(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 i=t[r];i&&(o(`const _hoisted_${r+1} = `),Se(i,n),s())}n.pure=!1}function Pd(t){return be(t)||t.type===4||t.type===2||t.type===5||t.type===8}function _o(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Xe(s)||!Pd(s));n.push("["),o&&n.indent(),en(t,n,o),o&&n.deindent(),n.push("]")}function en(t,n,o=!1,s=!0){const{push:r,newline:i}=n;for(let l=0;l<t.length;l++){const a=t[l];be(a)?r(a,-3):Xe(a)?_o(a,n):Se(a,n),l<t.length-1&&(o?(s&&r(","),i()):s&&r(", "))}}function Se(t,n){if(be(t)){n.push(t,-3);return}if(Zn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&Es(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Se(t.codegenNode,n);break;case 2:zd(t,n);break;case 4:Ps(t,n);break;case 5:jd(t,n);break;case 12:Se(t.codegenNode,n);break;case 8:zs(t,n);break;case 3:Ud(t,n);break;case 13:Wd(t,n);break;case 14:Kd(t,n);break;case 15:Gd(t,n);break;case 17:Zd(t,n);break;case 18:Jd(t,n);break;case 19:Yd(t,n);break;case 20:Xd(t,n);break;case 21:en(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 Es(!1,`unhandled codegen node type: ${t.type}`),t}}function zd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Ps(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function jd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(kn)}(`),Se(t.content,n),o(")")}function zs(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];be(s)?n.push(s,-3):Se(s,n)}}function Hd(t,n){const{push:o}=n;if(t.type===8)o("["),zs(t,n),o("]");else if(t.isStatic){const s=bo(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function Ud(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(Gt)}(${JSON.stringify(t.content)})`,-3,t)}function Wd(t,n){const{push:o,helper:s,pure:r}=n,{tag:i,props:l,children:a,patchFlag:c,dynamicProps:p,directives:u,isBlock:d,disableTracking:m,isComponent:w}=t;let b;if(c)if(process.env.NODE_ENV!=="production")if(c<0)b=c+` /* ${Wt[c]} */`;else{const _=Object.keys(Wt).map(Number).filter(x=>x>0&&c&x).map(x=>Wt[x]).join(", ");b=c+` /* ${_} */`}else b=String(c);u&&o(s(ro)+"("),d&&o(`(${s(ht)}(${m?"true":""}), `),r&&o(Dn);const k=d?Ot(n.inSSR,w):It(n.inSSR,w);o(s(k)+"(",-2,t),en(qd([i,l,a,b,p]),n),o(")"),d&&o(")"),u&&(o(", "),Se(u,n),o(")"))}function qd(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Kd(t,n){const{push:o,helper:s,pure:r}=n,i=be(t.callee)?t.callee:s(t.callee);r&&o(Dn),o(i+"(",-2,t),en(t.arguments,n),o(")")}function Gd(t,n){const{push:o,indent:s,deindent:r,newline:i}=n,{properties:l}=t;if(!l.length){o("{}",-2,t);return}const a=l.length>1||process.env.NODE_ENV!=="production"&&l.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<l.length;c++){const{key:p,value:u}=l[c];Hd(p,n),o(": "),Se(u,n),c<l.length-1&&(o(","),i())}a&&r(),o(a?"}":" }")}function Zd(t,n){_o(t.elements,n)}function Jd(t,n){const{push:o,indent:s,deindent:r}=n,{params:i,returns:l,body:a,newline:c,isSlot:p}=t;p&&o(`_${At[uo]}(`),o("(",-2,t),Xe(i)?en(i,n):i&&Se(i,n),o(") => "),(c||a)&&(o("{"),s()),l?(c&&o("return "),Xe(l)?_o(l,n):Se(l,n)):a&&Se(a,n),(c||a)&&(r(),o("}")),p&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Yd(t,n){const{test:o,consequent:s,alternate:r,newline:i}=t,{push:l,indent:a,deindent:c,newline:p}=n;if(o.type===4){const d=!bo(o.content);d&&l("("),Ps(o,n),d&&l(")")}else l("("),Se(o,n),l(")");i&&a(),n.indentLevel++,i||l(" "),l("? "),Se(s,n),n.indentLevel--,i&&p(),i||l(" "),l(": ");const u=r.type===19;u||n.indentLevel++,Se(r,n),u||n.indentLevel--,i&&c(!0)}function Xd(t,n){const{push:o,helper:s,indent:r,deindent:i,newline:l}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(wn)}(-1`),t.inVOnce&&o(", true"),o("),"),l(),o("(")),o(`_cache[${t.index}] = `),Se(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),l(),o(`${s(wn)}(1),`),l(),o(`_cache[${t.index}]`),i()),o(")"),c&&o(")]")}const Qd=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"),Vd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function bt(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(i){let l=i.message;const a=r.replace(Vd,"").match(Qd);a&&(l=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,l))}}const ef=(t,n)=>{if(t.type===5)t.content=Bo(t.content,n);else if(t.type===1){const o=Ae(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const i=r.exp,l=r.arg;i&&i.type===4&&!(r.name==="on"&&l)&&!(o&&l&&l.type===4&&l.content==="key")&&(r.exp=Bo(i,n,r.name==="slot")),l&&l.type===4&&!l.isStatic&&(r.arg=Bo(l,n))}}}};function Bo(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&bt(t,n,o,s),t}const tf=Rs(/^(?:if|else|else-if)$/,(t,n,o)=>nf(t,n,o,(s,r,i)=>{const l=o.parent.children;let a=l.indexOf(s),c=0;for(;a-->=0;){const p=l[a];p&&p.type===9&&(c+=p.branches.length)}return()=>{if(i)s.codegenNode=Hs(r,c,o);else{const p=sf(s.codegenNode);p.alternate=Hs(r,c+s.branches.length-1,o)}}}));function nf(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(oe(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&bt(n.exp,o),n.name==="if"){const r=js(t,n),i={type:9,loc:Cd(t.loc),branches:[r]};if(o.replaceNode(i),s)return s(i,r,!0)}else{const r=o.parent.children,i=[];let l=r.indexOf(t);for(;l-->=-1;){const a=r[l];if(a&&wo(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&i.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(oe(30,t.loc)),o.removeNode();const c=js(t,n);if(process.env.NODE_ENV!=="production"&&i.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...i,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&a.branches.forEach(({userKey:d})=>{of(d,u)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const p=s&&s(a,c,!1);An(c,o),p&&p(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function js(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Ae(t,"for")?t.children:[t],userKey:Xt(t,"key"),isTemplateIf:o}}function Hs(t,n,o){return t.condition?ho(t.condition,Us(t,n,o),ye(o.helper(Gt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Us(t,n,o)}function Us(t,n,o){const{helper:s}=o,r=ue("key",Q(`${n}`,!1,Oe,2)),{children:i}=t,l=i[0];if(i.length!==1||l.type!==1)if(i.length===1&&l.type===11){const c=l.codegenNode;return _n(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&i.filter(p=>p.type!==3).length===1&&(c|=2048),Yt(o,s(qt),Pe([r]),i,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=l.codegenNode,p=hd(c);return p.type===13&&go(p,o),_n(p,r,o),c}}function of(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 sf(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 rf=Rs("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return lf(t,n,o,i=>{const l=ye(s(io),[i.source]),a=Cn(t),c=Ae(t,"memo"),p=Xt(t,"key",!1,!0);p&&p.type;let u=p&&(p.type===6?p.value?Q(p.value.content,!0):void 0:p.exp);const d=p&&u?ue("key",u):null,m=i.source.type===4&&i.source.constType>0,w=m?64:p?128:256;return i.codegenNode=Yt(o,s(qt),void 0,l,w,void 0,void 0,!0,!m,!1,t.loc),()=>{let b;const{children:k}=i;process.env.NODE_ENV!=="production"&&a&&t.children.some(T=>{if(T.type===1){const B=Xt(T,"key");if(B)return o.onError(oe(33,B.loc)),!0}});const _=k.length!==1||k[0].type!==1,x=Sn(t)?t:a&&t.children.length===1&&Sn(t.children[0])?t.children[0]:null;if(x?(b=x.codegenNode,a&&d&&_n(b,d,o)):_?b=Yt(o,s(qt),d?Pe([d]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(b=k[0].codegenNode,a&&d&&_n(b,d,o),b.isBlock!==!m&&(b.isBlock?(r(ht),r(Ot(o.inSSR,b.isComponent))):r(It(o.inSSR,b.isComponent))),b.isBlock=!m,b.isBlock?(s(ht),s(Ot(o.inSSR,b.isComponent))):s(It(o.inSSR,b.isComponent))),c){const T=Dt($o(i.parseResult,[Q("_cached")]));T.body=od([He(["const _memo = (",c.exp,")"]),He(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${o.helperString(ps)}(_cached, _memo)) return _cached`]),He(["const _item = ",b]),Q("_item.memo = _memo"),Q("return _item")]),l.arguments.push(T,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else l.arguments.push(Dt($o(i.parseResult),b,!0))}})});function lf(t,n,o,s){if(!n.exp){o.onError(oe(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(oe(32,n.loc));return}Ws(r,o);const{addIdentifiers:i,removeIdentifiers:l,scopes:a}=o,{source:c,value:p,key:u,index:d}=r,m={type:11,loc:n.loc,source:c,valueAlias:p,keyAlias:u,objectIndexAlias:d,parseResult:r,children:Cn(t)?t.children:[t]};o.replaceNode(m),a.vFor++;const w=s&&s(m);return()=>{a.vFor--,w&&w()}}function Ws(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(bt(t.source,n),t.key&&bt(t.key,n,!0),t.index&&bt(t.index,n,!0),t.value&&bt(t.value,n,!0)),t.finalized=!0)}function $o({value:t,key:n,index:o},s=[]){return af([t,n,o,...s])}function af(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 qs=Q("undefined",!1),cf=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Ae(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},df=(t,n,o,s)=>Dt(t,o,!1,!0,o.length?o[0].loc:s);function ff(t,n,o=df){n.helper(uo);const{children:s,loc:r}=t,i=[],l=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Ae(t,"slot",!0);if(c){const{arg:_,exp:x}=c;_&&!Le(_)&&(a=!0),i.push(ue(_||Q("default",!0),o(x,void 0,s,r)))}let p=!1,u=!1;const d=[],m=new Set;let w=0;for(let _=0;_<s.length;_++){const x=s[_];let T;if(!Cn(x)||!(T=Ae(x,"slot",!0))){x.type!==3&&d.push(x);continue}if(c){n.onError(oe(37,T.loc));break}p=!0;const{children:B,loc:E}=x,{arg:N=Q("default",!0),exp:$,loc:L}=T;let g;Le(N)?g=N?N.content:"default":a=!0;const I=Ae(x,"for"),z=o($,I,B,E);let U,K;if(U=Ae(x,"if"))a=!0,l.push(ho(U.exp,In(N,z,w++),qs));else if(K=Ae(x,/^else(?:-if)?$/,!0)){let G=_,O;for(;G--&&(O=s[G],!!wo(O)););if(O&&Cn(O)&&Ae(O,/^(?:else-)?if$/)){let j=l[l.length-1];for(;j.alternate.type===19;)j=j.alternate;j.alternate=K.exp?ho(K.exp,In(N,z,w++),qs):In(N,z,w++)}else n.onError(oe(30,K.loc))}else if(I){a=!0;const G=I.forParseResult;G?(Ws(G,n),l.push(ye(n.helper(io),[G.source,Dt($o(G),In(N,z),!0)]))):n.onError(oe(32,I.loc))}else{if(g){if(m.has(g)){n.onError(oe(38,L));continue}m.add(g),g==="default"&&(u=!0)}i.push(ue(N,z))}}if(!c){const _=(x,T)=>{const B=o(x,void 0,T,r);return n.compatConfig&&(B.isNonScopedSlot=!0),ue("default",B)};p?d.length&&!d.every(Eo)&&(u?n.onError(oe(39,d[0].loc)):i.push(_(void 0,d))):i.push(_(void 0,s))}const b=a?2:On(t.children)?3:1;let k=Pe(i.concat(ue("_",Q(b+(process.env.NODE_ENV!=="production"?` /* ${Mc[b]} */`:""),!1))),r);return l.length&&(k=ye(n.helper(fs),[k,gt(l)])),{slots:k,hasDynamicSlots:a}}function In(t,n,o){const s=[ue("name",t),ue("fn",n)];return o!=null&&s.push(ue("key",Q(String(o),!0))),Pe(s)}function On(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||On(o.children))return!0;break;case 9:if(On(o.branches))return!0;break;case 10:case 11:if(On(o.children))return!0;break}}return!1}const Ks=new WeakMap,pf=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,i=t.tagType===1;let l=i?uf(t,n):`"${s}"`;const a=Ac(l)&&l.callee===no;let c,p,u=0,d,m,w,b=a||l===Kt||l===Xn||!i&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const k=Gs(t,n,void 0,i,a);c=k.props,u=k.patchFlag,m=k.dynamicPropNames;const _=k.directives;w=_&&_.length?gt(_.map(x=>hf(x,n))):void 0,k.shouldUseBlock&&(b=!0)}if(t.children.length>0)if(l===bn&&(b=!0,u|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(oe(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),i&&l!==Kt&&l!==bn){const{slots:_,hasDynamicSlots:x}=ff(t,n);p=_,x&&(u|=1024)}else if(t.children.length===1&&l!==Kt){const _=t.children[0],x=_.type,T=x===5||x===8;T&&Re(_,n)===0&&(u|=1),T||x===2?p=_:p=t.children}else p=t.children;m&&m.length&&(d=gf(m)),t.codegenNode=Yt(n,l,c,p,u===0?void 0:u,d,w,!!b,!1,i,t.loc)};function uf(t,n,o=!1){let{tag:s}=t;const r=To(s),i=Xt(t,"is",!1,!0);if(i)if(r||ct("COMPILER_IS_ON_ELEMENT",n)){let a;if(i.type===6?a=i.value&&Q(i.value.content,!0):(a=i.exp,a||(a=Q("is",!1,i.arg.loc))),a)return ye(n.helper(no),[a])}else i.type===6&&i.value.content.startsWith("vue:")&&(s=i.value.content.slice(4));const l=ys(s)||n.isBuiltInComponent(s);return l?(o||n.helper(l),l):(n.helper(to),n.components.add(s),Qt(s,"component"))}function Gs(t,n,o=t.props,s,r,i=!1){const{tag:l,loc:a,children:c}=t;let p=[];const u=[],d=[],m=c.length>0;let w=!1,b=0,k=!1,_=!1,x=!1,T=!1,B=!1,E=!1;const N=[],$=z=>{p.length&&(u.push(Pe(Zs(p),a)),p=[]),z&&u.push(z)},L=()=>{n.scopes.vFor>0&&p.push(ue(Q("ref_for",!0),Q("true")))},g=({key:z,value:U})=>{if(Le(z)){const K=z.content,G=Gn(K);if(G&&(!s||r)&&K.toLowerCase()!=="onclick"&&K!=="onUpdate:modelValue"&&!rs(K)&&(T=!0),G&&rs(K)&&(E=!0),G&&U.type===14&&(U=U.arguments[0]),U.type===20||(U.type===4||U.type===8)&&Re(U,n)>0)return;K==="ref"?k=!0:K==="class"?_=!0:K==="style"?x=!0:K!=="key"&&!N.includes(K)&&N.push(K),s&&(K==="class"||K==="style")&&!N.includes(K)&&N.push(K)}else B=!0};for(let z=0;z<o.length;z++){const U=o[z];if(U.type===6){const{loc:K,name:G,nameLoc:O,value:j}=U;let C=!0;if(G==="ref"&&(k=!0,L()),G==="is"&&(To(l)||j&&j.content.startsWith("vue:")||ct("COMPILER_IS_ON_ELEMENT",n)))continue;p.push(ue(Q(G,!0,O),Q(j?j.content:"",C,j?j.loc:K)))}else{const{name:K,arg:G,exp:O,loc:j,modifiers:C}=U,q=K==="bind",ee=K==="on";if(K==="slot"){s||n.onError(oe(40,j));continue}if(K==="once"||K==="memo"||K==="is"||q&&dt(G,"is")&&(To(l)||ct("COMPILER_IS_ON_ELEMENT",n))||ee&&i)continue;if((q&&dt(G,"key")||ee&&m&&dt(G,"vue:before-update"))&&(w=!0),q&&dt(G,"ref")&&L(),!G&&(q||ee)){if(B=!0,O)if(q){if($(),process.env.NODE_ENV!=="production"&&u.some(he=>he.type===15?he.properties.some(({key:Be})=>Be.type!==4||!Be.isStatic?!0:Be.content!=="class"&&Be.content!=="style"&&!Gn(Be.content)):!0)&&Mt("COMPILER_V_BIND_OBJECT_ORDER",n,j),ct("COMPILER_V_BIND_OBJECT_ORDER",n)){u.unshift(O);continue}L(),$(),u.push(O)}else $({type:14,loc:j,callee:n.helper(co),arguments:s?[O]:[O,"true"]});else n.onError(oe(q?34:35,j));continue}q&&C.some(me=>me.content==="prop")&&(b|=32);const _e=n.directiveTransforms[K];if(_e){const{props:me,needRuntime:he}=_e(U,t,n);!i&&me.forEach(g),ee&&G&&!Le(G)?$(Pe(me,a)):p.push(...me),he&&(d.push(U),Zn(he)&&Ks.set(U,he))}else Dc(K)||(d.push(U),m&&(w=!0))}}let I;if(u.length?($(),u.length>1?I=ye(n.helper(En),u,a):I=u[0]):p.length&&(I=Pe(Zs(p),a)),B?b|=16:(_&&!s&&(b|=2),x&&!s&&(b|=4),N.length&&(b|=8),T&&(b|=32)),!w&&(b===0||b===32)&&(k||E||d.length>0)&&(b|=512),!n.inSSR&&I)switch(I.type){case 15:let z=-1,U=-1,K=!1;for(let j=0;j<I.properties.length;j++){const C=I.properties[j].key;Le(C)?C.content==="class"?z=j:C.content==="style"&&(U=j):C.isHandlerKey||(K=!0)}const G=I.properties[z],O=I.properties[U];K?I=ye(n.helper(Zt),[I]):(G&&!Le(G.value)&&(G.value=ye(n.helper(lo),[G.value])),O&&(x||O.value.type===4&&O.value.content.trim()[0]==="["||O.value.type===17)&&(O.value=ye(n.helper(ao),[O.value])));break;case 14:break;default:I=ye(n.helper(Zt),[ye(n.helper(Jt),[I])]);break}return{props:I,directives:d,patchFlag:b,dynamicPropNames:N,shouldUseBlock:w}}function Zs(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 i=r.key.content,l=n.get(i);l?(i==="style"||i==="class"||Gn(i))&&mf(l,r):(n.set(i,r),o.push(r))}return o}function mf(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=gt([t.value,n.value],t.loc)}function hf(t,n){const o=[],s=Ks.get(t);s?o.push(n.helperString(s)):(n.helper(oo),n.directives.add(t.name),o.push(Qt(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 i=Q("true",!1,r);o.push(Pe(t.modifiers.map(l=>ue(l,i)),r))}return gt(o,t.loc)}function gf(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 To(t){return t==="component"||t==="Component"}const yf=(t,n)=>{if(Sn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:i}=vf(t,n),l=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;i&&(l[2]=i,a=3),o.length&&(l[3]=Dt([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),l.splice(a),t.codegenNode=ye(n.helper(ds),l,s)}};function vf(t,n){let o='"default"',s;const r=[];for(let i=0;i<t.props.length;i++){const l=t.props[i];if(l.type===6)l.value&&(l.name==="name"?o=JSON.stringify(l.value.content):(l.name=lt(l.name),r.push(l)));else if(l.name==="bind"&&dt(l.arg,"name")){if(l.exp)o=l.exp;else if(l.arg&&l.arg.type===4){const a=lt(l.arg.content);o=l.exp=Q(a,!1,l.arg.loc)}}else l.name==="bind"&&l.arg&&Le(l.arg)&&(l.arg.content=lt(l.arg.content)),r.push(l)}if(r.length>0){const{props:i,directives:l}=Gs(t,n,r,!1,!1);s=i,l.length&&n.onError(oe(36,l[0].loc))}return{slotName:o,slotProps:s}}const Js=(t,n,o,s)=>{const{loc:r,modifiers:i,arg:l}=t;!t.exp&&!i.length&&o.onError(oe(35,r));let a;if(l.type===4)if(l.isStatic){let d=l.content;process.env.NODE_ENV!=="production"&&d.startsWith("vnode")&&o.onError(oe(52,l.loc)),d.startsWith("vue:")&&(d=`vnode-${d.slice(4)}`);const m=n.tagType!==0||d.startsWith("vnode")||!/[A-Z]/.test(d)?Oc(lt(d)):`on:${d}`;a=Q(m,!0,l.loc)}else a=He([`${o.helperString(po)}(`,l,")"]);else a=l,a.children.unshift(`${o.helperString(po)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let p=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const d=ks(c),m=!(d||fd(c)),w=c.content.includes(";");process.env.NODE_ENV!=="production"&&bt(c,o,!1,w),(m||p&&d)&&(c=He([`${m?"$event":"(...args)"} => ${w?"{":"("}`,c,w?"}":")"]))}let u={props:[ue(a,c||Q("() => {}",!1,r))]};return s&&(u=s(u)),p&&(u.props[0].value=o.cache(u.props[0].value)),u.props.forEach(d=>d.key.isHandlerKey=!0),u},bf=(t,n,o)=>{const{modifiers:s,loc:r}=t,i=t.arg;let{exp:l}=t;return l&&l.type===4&&!l.content.trim()&&(l=void 0),i.type!==4?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=i.content?`${i.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(i.type===4?i.isStatic?i.content=lt(i.content):i.content=`${o.helperString(fo)}(${i.content})`:(i.children.unshift(`${o.helperString(fo)}(`),i.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Ys(i,"."),s.some(a=>a.content==="attr")&&Ys(i,"^")),{props:[ue(i,l)]}},Ys=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},kf=(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 i=0;i<o.length;i++){const l=o[i];if(ko(l)){r=!0;for(let a=i+1;a<o.length;a++){const c=o[a];if(ko(c))s||(s=o[i]=He([l],l.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(i=>i.type===7&&!n.directiveTransforms[i.name])&&t.tag!=="template")))for(let i=0;i<o.length;i++){const l=o[i];if(ko(l)||l.type===8){const a=[];(l.type!==2||l.content!==" ")&&a.push(l),!n.ssr&&Re(l,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Wt[1]} */`:"")),o[i]={type:12,content:l,loc:l.loc,codegenNode:ye(n.helper(eo),a)}}}}},Xs=new WeakSet,Ef=(t,n)=>{if(t.type===1&&Ae(t,"once",!0))return Xs.has(t)||n.inVOnce||n.inSSR?void 0:(Xs.add(t),n.inVOnce=!0,n.helper(wn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Qs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),tn();const i=s.loc.source.trim(),l=s.type===4?s.content:i,a=o.bindingMetadata[i];if(a==="props"||a==="props-aliased")return o.onError(oe(44,s.loc)),tn();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),tn();if(!l.trim()||!ks(s))return o.onError(oe(42,s.loc)),tn();const c=r||Q("modelValue",!0),p=r?Le(r)?`onUpdate:${lt(r.content)}`:He(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;const d=o.isTS?"($event: any)":"$event";u=He([`${d} => ((`,s,") = $event)"]);const m=[ue(c,t.exp),ue(p,u)];if(t.modifiers.length&&n.tagType===1){const w=t.modifiers.map(k=>k.content).map(k=>(bo(k)?k:JSON.stringify(k))+": true").join(", "),b=r?Le(r)?`${r.content}Modifiers`:He([r,' + "Modifiers"']):"modelModifiers";m.push(ue(b,Q(`{ ${w} }`,!1,t.loc,2)))}return tn(m)};function tn(t=[]){return{props:t}}const wf=/[\w).+\-_$\]]/,xf=(t,n)=>{ct("COMPILER_FILTERS",n)&&(t.type===5?Mn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Mn(o.exp,n)}))};function Mn(t,n){if(t.type===4)Vs(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Vs(s,n):s.type===8?Mn(t,n):s.type===5&&Mn(s.content,n))}}function Vs(t,n){const o=t.content;let s=!1,r=!1,i=!1,l=!1,a=0,c=0,p=0,u=0,d,m,w,b,k=[];for(w=0;w<o.length;w++)if(m=d,d=o.charCodeAt(w),s)d===39&&m!==92&&(s=!1);else if(r)d===34&&m!==92&&(r=!1);else if(i)d===96&&m!==92&&(i=!1);else if(l)d===47&&m!==92&&(l=!1);else if(d===124&&o.charCodeAt(w+1)!==124&&o.charCodeAt(w-1)!==124&&!a&&!c&&!p)b===void 0?(u=w+1,b=o.slice(0,w).trim()):_();else{switch(d){case 34:r=!0;break;case 39:s=!0;break;case 96:i=!0;break;case 40:p++;break;case 41:p--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(d===47){let x=w-1,T;for(;x>=0&&(T=o.charAt(x),T===" ");x--);(!T||!wf.test(T))&&(l=!0)}}b===void 0?b=o.slice(0,w).trim():u!==0&&_();function _(){k.push(o.slice(u,w).trim()),u=w+1}if(k.length){for(process.env.NODE_ENV!=="production"&&Nn("COMPILER_FILTERS",n,t.loc),w=0;w<k.length;w++)b=Nf(b,k[w],n);t.content=b,t.ast=void 0}}function Nf(t,n,o){o.helper(so);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Qt(n,"filter")}(${t})`;{const r=n.slice(0,s),i=n.slice(s+1);return o.filters.add(r),`${Qt(r,"filter")}(${t}${i!==")"?","+i:i}`}}const er=new WeakSet,Cf=(t,n)=>{if(t.type===1){const o=Ae(t,"memo");return!o||er.has(t)||n.inSSR?void 0:(er.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&go(s,n),t.codegenNode=ye(n.helper(mo),[o.exp,Dt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},Sf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(oe(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=lt(s.content);(vs.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function _f(t){return[[Sf,Ef,tf,Cf,rf,xf,...process.env.NODE_ENV!=="production"?[ef]:[],yf,pf,cf,kf],{on:Js,bind:bf,model:Qs}]}function Bf(t,n={}){const o=n.onError||vo,s=n.mode==="module";n.prefixIdentifiers===!0?o(oe(48)):s&&o(oe(49));const r=!1;n.cacheHandlers&&o(oe(50)),n.scopeId&&!s&&o(oe(51));const i=it({},n,{prefixIdentifiers:r}),l=be(t)?Bd(t,i):t,[a,c]=_f();return Ad(l,it({},i,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:it({},c,n.directiveTransforms||{})})),Md(l,i)}const $f=()=>({props:[]});const tr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),nr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),or=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),sr=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Lo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),rr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),ir=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),lr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Ao=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),ar=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");ed({[tr]:"vModelRadio",[nr]:"vModelCheckbox",[or]:"vModelText",[sr]:"vModelSelect",[Lo]:"vModelDynamic",[rr]:"withModifiers",[ir]:"withKeys",[lr]:"vShow",[Ao]:"Transition",[ar]:"TransitionGroup"});let Rt;function Tf(t,n=!1){return Rt||(Rt=document.createElement("div")),n?(Rt.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Rt.children[0].getAttribute("foo")):(Rt.innerHTML=t,Rt.textContent)}const Lf={parseMode:"html",isVoidTag:Zc,isNativeTag:t=>qc(t)||Kc(t)||Gc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:Tf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Ao;if(t==="TransitionGroup"||t==="transition-group")return ar},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}},Af=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:Df(n.value.content,n.loc),modifiers:[],loc:n.loc})})},Df=(t,n)=>{const o=zc(t);return Q(JSON.stringify(o),!1,n,3)};function Ue(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?If:void 0)}const If={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},Of=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(54,r)),n.children.length&&(o.onError(Ue(55,r)),n.children.length=0),{props:[ue(Q("innerHTML",!0,r),s||Q("",!0))]}},Mf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(56,r)),n.children.length&&(o.onError(Ue(57,r)),n.children.length=0),{props:[ue(Q("textContent",!0),s?Re(s,o)>0?s:ye(o.helperString(kn),[s],r):Q("",!0))]}},Rf=(t,n,o)=>{const s=Qs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Ue(59,t.arg.loc));function r(){const a=Ae(n,"bind");a&&dt(a.arg,"value")&&o.onError(Ue(61,a.loc))}const{tag:i}=n,l=o.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||l){let a=or,c=!1;if(i==="input"||l){const p=Xt(n,"type");if(p){if(p.type===7)a=Lo;else if(p.value)switch(p.value.content){case"radio":a=tr;break;case"checkbox":a=nr;break;case"file":c=!0,o.onError(Ue(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else pd(n)?a=Lo:process.env.NODE_ENV!=="production"&&r()}else i==="select"?a=sr:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Ue(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},Ff=Ge("passive,once,capture"),Pf=Ge("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),zf=Ge("left,right"),cr=Ge("onkeyup,onkeydown,onkeypress"),jf=(t,n,o,s)=>{const r=[],i=[],l=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&Mt("COMPILER_V_ON_NATIVE",o,s)||Ff(c)?l.push(c):zf(c)?Le(t)?cr(t.content.toLowerCase())?r.push(c):i.push(c):(r.push(c),i.push(c)):Pf(c)?i.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:i,eventOptionModifiers:l}},dr=(t,n)=>Le(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?He(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Hf=(t,n,o)=>Js(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:i,value:l}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:p}=jf(i,r,o,t.loc);if(c.includes("right")&&(i=dr(i,"onContextmenu")),c.includes("middle")&&(i=dr(i,"onMouseup")),c.length&&(l=ye(o.helper(rr),[l,JSON.stringify(c)])),a.length&&(!Le(i)||cr(i.content.toLowerCase()))&&(l=ye(o.helper(ir),[l,JSON.stringify(a)])),p.length){const u=p.map(Yn).join("");i=Le(i)?Q(`${i.content}${u}`,!0):He(["(",i,`) + "${u}"`])}return{props:[ue(i,l)]}}),Uf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(62,r)),{props:[],needRuntime:o.helper(lr)}},Wf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Ao)return()=>{if(!t.children.length)return;fr(t)&&n.onError(Ue(63,{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 fr(t){const n=t.children=t.children.filter(s=>!wo(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(fr)}const qf=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Ue(64,t.loc)),n.removeNode())};function Kf(t,n){return t==="template"?!0:t in pr?pr[t].has(n):n in ur?ur[n].has(t):!(t in mr&&mr[t].has(n)||n in hr&&hr[n].has(t))}const Ft=new Set(["h1","h2","h3","h4","h5","h6"]),kt=new Set([]),pr={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:kt,iframe:kt,option:kt,textarea:kt,style:kt,title:kt},ur={html:kt,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"])},mr={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"])},hr={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:Ft,h2:Ft,h3:Ft,h4:Ft,h5:Ft,h6:Ft},Gf=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!Kf(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)}},Zf=[Af,...process.env.NODE_ENV!=="production"?[Wf,Gf]:[]],Jf={cloak:$f,html:Of,text:Mf,model:Rf,on:Hf,show:Uf};function Yf(t,n={}){return Bf(t,it({},Lf,n,{nodeTransforms:[qf,...Zf,...n.nodeTransforms||[]],directiveTransforms:it({},Jf,n.directiveTransforms||{}),transformHoist:null}))}function Xf(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Yf(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)($r);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Do={};function Qf(t){return Do[t]||(Do[t]=Xf(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}}})),Do[t]}const Vf={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},ep={class:"flex items-center gap-2"},tp=["disabled"],np={class:"text-sm"},op=["disabled"],sp=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,i)=>(e.openBlock(),e.createElementBlock("div",Vf,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",ep,[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:i[0]||(i[0]=l=>r.$emit("previous"))}," Назад ",8,tp),e.createElementVNode("span",np,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.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:i[1]||(i[1]=l=>r.$emit("next"))}," Далі ",8,op)])]))}}),rp={class:"relative inline-flex"},ip=["aria-label"],lp={class:"px-3 pb-2"},ap={class:"px-3 pb-3 max-h-64 overflow-y-auto"},cp=["onClick"],dp={class:"truncate"},fp={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"},pp="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",up=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),i=e.ref(!1),l=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),p=e.ref(null),u=e.ref(null),d=e.ref({top:0,left:0}),m=e.computed(()=>{if(!l.value)return a.value;const B=l.value.toLowerCase();return a.value.filter(E=>w(E).toLowerCase().includes(B))});e.watch(()=>o.columns,B=>{if(!B){a.value=[];return}const E=JSON.stringify(B),N=JSON.stringify(a.value);E!==N&&(a.value=[...B])},{deep:!0}),e.watch(a,B=>{s("update:columns",B)},{deep:!0});function w(B){return B.ua||B.label||B.name||"Колонка"}function b(B){const E=!B.hidden;E&&a.value.filter(N=>!N.hidden).length<=1||(B.hidden=E)}function k(){i.value=!i.value,i.value&&e.nextTick(()=>{u.value?.focus(),_()})}function _(){if(!c.value)return;const B=c.value.getBoundingClientRect();d.value={top:B.bottom+window.scrollY+6,left:B.left+window.scrollX-200}}function x(B){if(!i.value)return;const E=B.target;E&&(p.value?.contains(E)||c.value?.contains(E)||(i.value=!1))}function T(B){B.key==="Escape"&&(i.value=!1)}return e.onMounted(()=>{document.addEventListener("click",x,!0),document.addEventListener("keydown",T)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",x,!0),document.removeEventListener("keydown",T)}),(B,E)=>(e.openBlock(),e.createElementBlock("div",rp,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:k,class:e.normalizeClass([pp,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,ip),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:p,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:`${d.value.top}px`,left:`${d.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",lp,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":E[0]||(E[0]=N=>l.value=N),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,l.value]])]),e.createElementVNode("div",ap,[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(m.value,N=>(e.openBlock(),e.createElementBlock("li",{key:N.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:$=>b(N)},[e.createElementVNode("span",dp,e.toDisplayString(w(N)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",N.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[N.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",fp,[...E[3]||(E[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,cp))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),mp=["data-action-key"],hp=["onClick"],gp={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"},yp={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"},vp={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"},bp={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"},kp=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),i=e.computed(()=>!!o.actions?.length),l=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function p(b){b.handler?.(o.row)}const u=e.computed(()=>{if(!o.isOpen)return{};const b=r.value;if(!b)return{};const k=b.getBoundingClientRect(),_=8,x=160,E=(o.actions?.length??0)*36+_*2,N=l.value.height||(typeof window<"u"?window.innerHeight:0),$=l.value.width||(typeof window<"u"?window.innerWidth:0),L=l.value.scrollX||(typeof window<"u"?window.scrollX:0),g=l.value.scrollY||(typeof window<"u"?window.scrollY:0);let I=k.bottom+g+_,z=k.right+L-x;const U=L+$-x-_;return z>U&&(z=U),z<L+_&&(z=L+_),I+E>g+N-_&&(I=k.top+g-E-_),I<g+_&&(I=g+_),{top:`${I}px`,left:`${z}px`,width:"auto"}});function d(){typeof window>"u"||(l.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function m(){typeof window>"u"||a.value||(a.value=!0,d(),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d))}function w(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",d),window.removeEventListener("resize",d))}return e.watch(()=>o.isOpen,b=>{b?m():w()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&m()}),e.onBeforeUnmount(()=>{w()}),(b,k)=>i.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.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"])},[...k[1]||(k[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"},[t.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(u.value),onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,_=>(e.openBlock(),e.createElementBlock("button",{key:_.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",_.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:x=>p(_)},[e.renderSlot(b.$slots,"icon",{action:_},()=>[_.type==="view"?(e.openBlock(),e.createElementBlock("svg",gp,[...k[2]||(k[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)])])):_.type==="edit"?(e.openBlock(),e.createElementBlock("svg",yp,[...k[3]||(k[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):_.type==="delete"?(e.openBlock(),e.createElementBlock("svg",vp,[...k[4]||(k[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",bp,[...k[5]||(k[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(_.label),1)],10,hp))),128))],4)):e.createCommentVNode("",!0)]))],8,mp)):e.createCommentVNode("",!0)}}),gr=typeof window<"u",yr=typeof document<"u";function Ep(t){if(!yr)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 vr(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 Io(t,n){if(!yr||!gr)return;const o=Ep(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!gr)return;o.textContent=s.options.text;const l=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,p=Math.max(12,Math.min(l.left,c));o.style.left=`${p}px`,o.style.top=`${l.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 Oo(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 wp={mounted(t,n){const o=vr(n.value);o&&Io(t,o)},updated(t,n){const o=vr(n.value),s=t;if(!o){Oo(s);return}const r=s.__tooltipState__;if(!r){Io(s,o);return}if(r.options.wrap!==o.wrap){Oo(s),Io(s,o);return}r.options=o},unmounted(t){Oo(t)}},xp={class:"flex flex-col gap-4 mb-[15px]"},Np={class:"flex flex-wrap items-center gap-4"},Cp={class:"relative"},Sp={class:"ml-auto flex items-center gap-2"},_p={class:"overflow-x-auto"},Bp={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"},$p={class:"text-left font-medium text-gray-700"},Tp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},Lp={class:"divide-y divide-gray-200"},Ap=["href"],Dp={key:2},Ip={key:3},Op={key:0,class:"py-2 pr-4 text-right"},Mp={key:0},Rp={key:0},Fp=["colspan"],br=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},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=wp,i=t,l=e.ref([]),a=e.ref(""),c=e.ref(""),p=e.ref(""),u=e.ref(1),d=e.ref(10),m=e.ref(0),w=e.ref(0),b=e.ref("id"),k=e.ref("");let _=null,x=0;const T=e.ref(null);async function B(){const v=u.value,R=++x,A=i.columns!==void 0,D=A?Array.isArray(i.columns)?i.columns:[]:void 0;A&&(s.value=K(D??[]));const J=i.actions!==void 0,ie=J?Array.isArray(i.actions)?i.actions:[]:void 0;J&&(l.value=ie??[]);const ne=new URLSearchParams,xe=p.value.trim();xe&&ne.set("search",xe),ne.set("page",String(v)),ne.set("limit",String(d.value));const ot=`/api/data/${i.token}${ne.toString()?`?${ne.toString()}`:""}`;let re;try{const Je=await fetch(ot);if(!Je.ok)throw new Error(`Request failed with status ${Je.status}`);re=await Je.json()}catch(Je){R===x&&(o.value=[],w.value=0,m.value=0),console.error("Failed to load table data",Je);return}if(R!==x)return;o.value=Array.isArray(re?.rows)?re.rows:[];const qe=Array.isArray(re?.columns)?re.columns:[];s.value=K(D??qe),l.value=ie!==void 0?Array.isArray(ie)?ie:[]:Array.isArray(re?.actions)?re.actions:[],a.value=re?.form,c.value=re?.addToken,b.value=typeof re?.pk=="string"&&re.pk?re.pk:b.value,typeof re?.form=="string"&&re.form&&(k.value=re.form.replace(/\.form$/,".table")),P();const ve=Number(re?.total??re?.count??re?.totalCount),Ze=Number(re?.filtered??re?.filteredCount);m.value=Number.isFinite(ve)&&ve>0?ve:o.value.length,w.value=Number.isFinite(Ze)&&Ze>0?Ze:Math.max(o.value.length,m.value);const jt=Math.max(1,Math.ceil((w.value||o.value.length||1)/d.value));let Ke=v;typeof re?.page=="number"&&re.page>0&&(Ke=re.page),Ke>jt&&(Ke=jt),Ke<1&&(Ke=1);const Ro=Ke!==v;if(u.value=Ke,Ro&&w.value>0)return B()}const{$notify:E,$confirm:N,$form:$}=n?.appContext?.config?.globalProperties||{};function L(){if(Ne.emitter?.emit){Ne.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}B()}async function g(v){typeof $=="function"&&(await $({token:v.token}),L())}async function I(){typeof $=="function"&&(await $({token:c.value}),L())}function z(v){N({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const R=await fetch(`/api/table/${v.token}`,{method:"DELETE"});if(!R.ok){const{error:A}=await R.json();E({title:"Помилка",type:"warning",message:A});return}E({title:"Видаленно",message:"Успішно видалено"}),await B()}})}e.onMounted(async()=>{await B(),Ne.emitter?.on?.("updateCard",B)}),e.onBeforeUnmount(()=>{Ne.emitter?.off?.("updateCard",B)});function U(v){return typeof v?.format=="string"?v.format.toLowerCase():""}function K(v){const R=new Map;s.value.forEach(D=>{D?.name&&R.set(D.name,!!D.hidden)});const A=v.map(D=>{const J=R.has(D.name)?R.get(D.name):!!D.hidden;return{...D,hidden:J}});return A.length&&!A.some(D=>!D.hidden)&&(A[0].hidden=!1),A}const G=e.computed(()=>{const v=s.value.filter(R=>!R.hidden);return v.length?v:s.value}),O=e.computed(()=>{const v=[],R=new Set;for(const A of l.value){if(typeof A=="string"){if(A==="edit"){const D="row:edit";R.has(D)||(v.push({key:D,type:"edit",label:"Редагувати",scope:"row",handler:X}),R.add(D));continue}if(A==="delete"||A==="del"){const D="row:delete";R.has(D)||(v.push({key:D,type:"delete",label:"Видалити",scope:"row",handler:se,variant:"danger"}),R.add(D));continue}if(A==="add"){const D="toolbar:add";R.has(D)||(v.push({key:D,type:"add",label:"Додати",scope:"toolbar"}),R.add(D))}continue}if(A&&typeof A=="object"){const D=String(A.name??A.type??"action"),J=String(A.label??A.title??D),ie=A.scope==="toolbar"?"toolbar":"row",ne=`${ie}:${D}`;if(R.has(ne))continue;R.add(ne),v.push({key:ne,type:D,label:J,scope:ie,handler:ie==="row"?xe=>ae(A,xe):void 0,variant:A.variant==="danger"?"danger":"default",original:A})}}return v}),j=e.computed(()=>O.value.filter(v=>v.scope==="row"&&typeof v.handler=="function")),C=e.computed(()=>O.value.filter(v=>v.scope==="toolbar")),q=e.computed(()=>j.value.length>0),ee=e.computed(()=>C.value.some(v=>v.type==="add")),_e=e.computed(()=>{const v=!!c.value;return i.addButton!==void 0?i.addButton&&v:ee.value&&v}),me=e.computed(()=>o.value),he=e.computed(()=>{const v=w.value||me.value.length,R=Math.ceil(v/d.value);return R>0?R:1}),Be=e.computed(()=>{const v=me.value.length,R=w.value||v,A=m.value||R;return`Показано ${v} з ${R} (усього ${A})`});function pt(){u.value<he.value&&(u.value+=1,B())}function wt(){u.value>1&&(u.value-=1,B())}e.watch(s,v=>{v?.length&&(v.some(R=>!R.hidden)||(v[0].hidden=!1))},{deep:!0}),e.watch(()=>i.columns,v=>{if(v===void 0){B();return}const R=Array.isArray(v)?v:[];s.value=K(R)},{deep:!0}),e.watch(()=>i.actions,v=>{if(v===void 0){B();return}l.value=Array.isArray(v)?v:[]},{deep:!0});function Fe(){_&&clearTimeout(_),P(),_=setTimeout(()=>{u.value=1,B()},300)}function ze(v){const R=b.value||"id",A=v?.token??v?.[R]??v?.id;return A?String(A):""}function et(v){const R=G.value[v],A=["py-2",...H(R)];v===0&&A.push("pl-4");const D=v===G.value.length-1&&!q.value;return A.push(D?"pr-4":"pr-5"),A.join(" ")}function We(v,R){const A=["py-2",...H(R)];U(R)==="badge"&&A.push("center"),h(R)==="wrap"?A.push("whitespace-normal","break-words"):A.push("truncate"),v===0&&A.push("pl-4");const D=v===G.value.length-1&&!q.value;return A.push(D?"pr-4":"pr-5"),A.join(" ")}function h(v){return(typeof v?.overflow=="string"?v.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function H(v){const R=[],A=ne=>{if(ne==null||ne==="")return;const xe=Number(ne);return Number.isFinite(xe)&&xe>0?`${xe}px`:String(ne).replace(/\s+/g,"")},D=A(v?.width),J=A(v?.minWidth),ie=A(v?.maxWidth);return D?(R.push(`min-w-[${D}]`,`max-w-[${D}]`),R):(R.push(`min-w-[${J??"100px"}]`),R.push(`max-w-[${ie??"350px"}]`),R)}function y(v){if(!j.value.length)return!1;const R=b.value||"id";return!!(v?.token||v?.[R]||v?.id)}function S(v){return T.value===ze(v)}function M(v){const R=ze(v);R&&(T.value=T.value===R?null:R)}function P(){T.value=null}function Z(v,R){const A=R?.tooltip;if(!A)return;const D=nt(v,R);let J,ie=R?.tooltipWrap!==!1;if(typeof A=="string"){const ne=A.trim();if(!ne)return;const xe=ne.toLowerCase();if(["true","1","yes"].includes(xe))J=typeof D=="string"?D:String(D??"");else{if(["false","0","no"].includes(xe))return;J=ne}}else A===!0?J=D:typeof A=="object"&&(typeof A.text=="string"&&(J=A.text.trim()),typeof A.wrap=="boolean"&&(ie=A.wrap!==!1));if(!J){if(D==null||D==="")return;J=String(D)}if(J.trim())return ie?{text:J,wrap:!0}:J}function X(v){P(),g(v)}function se(v){P(),z(v)}async function ae(v,R){P();const A=b.value||"id",D=v.isId?R?.[A]??R?.id:R?.token??R?.[A]??R?.id;if(!D){console.warn("Cannot execute action without identifier",v);return}if(v.form&&typeof v.api=="string"&&v.api&&typeof $=="function"){await tt(v,R,D);return}if(v.form&&typeof $=="function"){const J=await je(v.form,D),ie={form:v.form,token:J?.token??R?.token??D,schema:J?.schema,mode:J?.mode??"edit"};J?.data!==void 0&&(ie.defaultValue=J.data);try{await $(ie),L()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof v.api=="string"&&v.api){const J=pe(v.api,D);window.location.href=J;return}R?.token&&typeof $=="function"&&(await $({token:R.token}),L())}function pe(v,R){return`${v.endsWith("/")?v:`${v}/`}${R}`}async function je(v,R){const A=`/api/form/${v}/${R}`;try{const D=await fetch(A);if(!D.ok)throw new Error(`Request failed with status ${D.status}`);return await D.json()}catch(D){console.error("Failed to load form config",D),E({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function ke(v){const R=`/api/template/form/${v}`;try{const A=await fetch(R);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);return(await A.json())?.schema}catch(A){console.error("Failed to load form template",A);return}}function $e(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:R,token:A,mode:D,message:J,successMessage:ie,...ne}=v;if(Object.keys(ne).length)return ne}}}async function tt(v,R,A){const D=pe(v.api,A),J=(typeof v.method=="string"?v.method:"PUT").toUpperCase();let ie;try{const ve=await fetch(D);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);ie=await ve.json()}catch(ve){console.error("Failed to load action data",ve),Pt("Не вдалося отримати дані форми.");return}const ne=typeof v.form=="string"?v.form.replace(/\.table$/,".form"):void 0,xe=ie?.schema??(ne?await ke(ne):void 0),ot={mode:ie?.mode??"edit"};ne&&(ot.form=ne),xe&&(ot.schema=xe);const re=$e(ie);re!==void 0&&(ot.defaultValue=re);const qe=await $(ot);if(qe)try{const ve=await fetch(D,{method:J,headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!ve.ok){const Ze=await sn(ve),jt=Ze?.error??Ze?.message??"Не вдалося зберегти дані.";throw new Error(jt)}zt(`Дані успішно ${ot.value==="add"?"збережено":"оновлено"}`),L()}catch(ve){console.error("Failed to submit action data",ve),Pt("Не вдалося зберегти дані.")}}async function sn(v){try{return await v.json()}catch{return}}function Pt(v){E({title:"Помилка",type:"error",message:v})}function zt(v){E({title:"Успіх",type:"success",message:v})}function xt(v){if(!T.value)return;const R=v.target;if(!R)return;const A=R.closest("[data-action-key]");A&&A.getAttribute("data-action-key")===T.value||P()}e.onMounted(()=>{document.addEventListener("click",xt,!0)}),e.onBeforeUnmount(()=>{_&&clearTimeout(_),document.removeEventListener("click",xt,!0),Ne.emitter?.off?.("updateCard",B)});function Nt(v,R){const D=v?.[`${R.name}_text`];if(Array.isArray(D))return D.length?D.join(", "):"-";if(D!=null&&D!=="")return D;const J=v?.[R.name];return Array.isArray(J)?J.length?J.join(", "):"-":J??"-"}function ut(v,R){const D=v?.[`${R.name}_data`];if(D&&typeof D=="object")return{text:D.text??D.label??D.name??D.title??"-",color:D.color,textColor:D.textColor};const J=v?.[`${R.name}_text`]??v?.[R.name];return{text:(Array.isArray(J)?J.join(", "):J)??"-"}}function Mo(v,R){const A=ut(v,R);return A.color?{backgroundColor:A.color,color:A.textColor??"#ffffff"}:{}}function nt(v,R){const A=U(R);if(A==="badge")return ut(v,R).text;if(A==="select")return Nt(v,R);if(A==="slot")return"-";if(A==="text")return v?.[R.name]??"-";const D=v?.[`${R.name}_data`];return D!=null&&typeof D!="object"?D:v?.[`${R.name}_text`]??v?.[R.name]??"-"}return(v,R)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",xp,[e.createElementVNode("div",Np,[e.createElementVNode("div",Cp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":R[0]||(R[0]=A=>p.value=A),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:Fe},null,544),[[e.vModelText,p.value]])]),e.createElementVNode("div",Sp,[e.createVNode(up,{columns:s.value,"onUpdate:columns":R[1]||(R[1]=A=>s.value=A)},null,8,["columns"]),_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:I,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":"Додати запис"},[...R[2]||(R[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",_p,[e.createElementVNode("table",Bp,[e.createElementVNode("thead",$p,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(A,D)=>(e.openBlock(),e.createElementBlock("th",{key:A.name,class:e.normalizeClass(et(D))},e.toDisplayString(A.ua),3))),128)),q.value?(e.openBlock(),e.createElementBlock("th",Tp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",Lp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,A=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:A.id??JSON.stringify(A)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(D,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:D.name,class:e.normalizeClass(We(J,D))},[D.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:D.link.replace("{{id}}",A.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(nt(A,D)),9,Ap)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[U(D)==="slot"&&(D.slot?.content||D.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Qf)(D.slot.content||D.slot)),{key:0,data:A,row:A,column:D,value:A?.[D.name]},null,8,["data","row","column","value"])):U(D)==="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(Mo(A,D))},e.toDisplayString(ut(A,D).text),5)):U(D)==="select"?(e.openBlock(),e.createElementBlock("span",Dp,e.toDisplayString(Nt(A,D)),1)):(e.openBlock(),e.createElementBlock("span",Ip,e.toDisplayString(nt(A,D)),1))],64))],2)),[[e.unref(r),Z(A,D)]])),128)),q.value?(e.openBlock(),e.createElementBlock("td",Op,[y(A)?(e.openBlock(),e.createElementBlock("div",Mp,[e.createVNode(kp,{row:A,actions:j.value,"is-open":S(A),"action-key":ze(A),onToggle:D=>M(A)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),me.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",Rp,[e.createElementVNode("td",{colspan:G.value.length+(q.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Fp)]))])])]),e.createVNode(sp,{"current-page":u.value,"total-pages":he.value,label:Be.value,onPrevious:wt,onNext:pt},null,8,["current-page","total-pages","label"])]))}}),Pp={class:"p-[20px]"},zp={class:"flex gap-[6px] mb-5"},jp={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Hp={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},Up={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Wp={class:"space-y-8"},qp={key:0},Kp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Gp=["onClick"],Zp={class:"md:col-span-2"},Jp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Yp={class:"text-sm text-gray-500 dark:text-neutral-500"},Xp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Qp=["checked","onChange"],Vp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},eu={class:"md:col-span-2"},tu={class:"font-semibold text-gray-800 dark:text-neutral-200"},nu=["onClick"],ou={class:"md:col-span-2"},su={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},ru={class:"text-sm text-gray-500 dark:text-neutral-500"},iu={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},lu=["checked","onChange"],Rn="uk",Fn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return Rn;const $=localStorage.language,L=typeof navigator<"u"?navigator.language:Rn;return($||L||Rn).split(/[-_]/)[0].toLowerCase()||Rn},s=t,r=e.ref(""),i=["view","add","edit","del"],l=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},p=$=>c[$]??$,u=()=>{a.value=o()},d=()=>{const $=[];return a.value&&$.push(a.value),n.forEach(L=>{L&&!$.includes(L)&&$.push(L)}),$.includes("path")||$.push("path"),$},m=$=>{const L=d();for(const g of L){const I=$[g];if(typeof I=="string"&&I.trim())return I}return""};e.onMounted(async()=>{u();const L=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();L.routes&&L.routes.forEach(g=>{l.value[g.path]=new Set(g.actions)})});const w=($,L)=>l.value[$]?.has(L)??!1,b=($,L)=>{l.value[$]||(l.value[$]=new Set),l.value[$].has(L)?l.value[$].delete(L):l.value[$].add(L)},k=($,L)=>{$.forEach(g=>{g.path&&(l.value[g.path]||(l.value[g.path]=new Set),l.value[g.path].has(L)?l.value[g.path].delete(L):l.value[g.path].add(L))})},_=e.computed(()=>Object.entries(l.value).map(([$,L])=>({path:$,actions:Array.from(L)})).filter($=>$.actions.length)),x=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:_.value})}),Ne.notify({title:"Success!",message:"Permissions saved."})},T=()=>{l.value={}},B=$=>{if(!r.value.trim())return $;const L=r.value.toLowerCase();return $.filter(g=>m(g).toLowerCase().includes(L)||(g.path?.toLowerCase().includes(L)??!1))},E=e.computed(()=>B(s.data.routers.filter($=>!$.menu))),N=e.computed(()=>s.data.routers.filter($=>$.menu).map($=>({...$,menu:B($.menu||[])})).filter($=>$.menu&&$.menu.length>0));return($,L)=>(e.openBlock(),e.createElementBlock("div",Pp,[e.createElementVNode("div",zp,[e.createElementVNode("div",jp,[L[1]||(L[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":L[0]||(L[0]=g=>r.value=g),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:T,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:x,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",Hp,[L[2]||(L[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(i,(g,I)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:I},[e.createElementVNode("h3",Up,e.toDisplayString(p(g)),1)])),64))]),e.createElementVNode("div",Wp,[E.value.length?(e.openBlock(),e.createElementBlock("div",qp,[e.createElementVNode("ul",Kp,[L[3]||(L[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(i,(g,I)=>e.createElementVNode("li",{key:I,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:z=>k(E.value,i[I])}," Перемкнути всі ",8,Gp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(g,I)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+I,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Zp,[e.createElementVNode("p",Jp,e.toDisplayString(m(g)),1),e.createElementVNode("p",Yp,e.toDisplayString(g.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(z,U)=>e.createElementVNode("li",{key:U,class:"col-span-1"},[e.createElementVNode("div",Xp,[e.createElementVNode("input",{type:"checkbox",checked:w(g.path,z),onChange:K=>b(g.path,z),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Qp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(g,I)=>(e.openBlock(),e.createElementBlock("div",{key:I,class:"space-y-5"},[e.createElementVNode("ul",Vp,[e.createElementVNode("li",eu,[e.createElementVNode("h3",tu,e.toDisplayString(m(g)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(z,U)=>e.createElementVNode("li",{key:U,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:K=>k(g.menu,i[U])}," Перемкнути всі ",8,nu)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.menu,(z,U)=>(e.openBlock(),e.createElementBlock("ul",{key:U,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",ou,[e.createElementVNode("p",su,e.toDisplayString(m(z)),1),e.createElementVNode("p",ru,e.toDisplayString(z.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(K,G)=>e.createElementVNode("li",{key:G,class:"col-span-1"},[e.createElementVNode("div",iu,[e.createElementVNode("input",{type:"checkbox",checked:w(z.path,K),onChange:O=>b(z.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,lu)])])),64))]))),128))]))),128))])]))}}),Et={"vs-widget-comments":dn,"vs-widget-history":fn,"vs-widget-gallery":un,"vs-widget-file":pn,"vs-widget-list":Hn,"vs-widget-map":yn,"vs-widget-table":br,"vs-group-interface":Fn};function kr(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 Er(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>Er(o))),n}function au(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const p=kr(c.col);p?(c.col=p,o.push({item:c,span:p})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,p)=>c+p.span,0);let i=n-r;if(s.length===0)return;i<=0&&(i=n);const l=Math.max(1,Math.floor(i/s.length));let a=Math.max(0,i-l*s.length);s.forEach(c=>{let p=l;a>0&&(p+=1,a-=1),c.col=Math.max(1,Math.min(12,p))})}function Pn(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>Er(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=Pn(s.items,12))}),au(o,n),o}function wr(t){const n=kr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const cu={class:"text-lg font-semibold text-gray-900"},du=["innerHTML"],fu={key:0,class:"grid grid-cols-12 gap-4"},pu={key:0,class:"mb-4 pb-2 border-b border-gray-200"},uu={class:"text-lg font-semibold text-gray-900"},mu=["innerHTML"],nn=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 p=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${p}`]:!0,[`lg:col-span-${p}`]:!0}}),s=e.computed(()=>Pn(n.items));function r(p){const u=["col-span-12"],d=wr(p.col);return d.length&&u.push(...d),u}function i(p){return Et[p]||p}function l(p,u){if(!p||typeof u!="string"||!u)return{found:!1,value:void 0};const d=u.split(".");let m=p;for(const w of d){if(m==null||typeof m!="object"&&!Array.isArray(m))return{found:!1,value:void 0};if(!(w in m))return{found:!1,value:void 0};m=m[w]}return{found:!0,value:m}}const a=function(p={}){const u={...p};return Object.entries(u).forEach(([d,m])=>{if(d!=="props"&&typeof m=="string"){const w=l(n.data,m);w.found&&(u[d]=w.value)}}),p.props&&typeof p.props=="object"&&Object.entries(p.props).forEach(([d,m])=>{if(typeof m=="string"){const w=l(n.data,m);u[d]=w.found?w.value:m}else u[d]=m}),delete u.props,u},c=e.computed(()=>{const p={};return n.col&&(p.col=n.col),p});return(p,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",cu,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,du)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(on,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(d,m)=>(e.openBlock(),e.createElementBlock("div",{key:d.name||d.component||m,class:e.normalizeClass(r(d))},[d.title||d.label?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("h3",uu,e.toDisplayString(d.title||d.label),1)])):e.createCommentVNode("",!0),d.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.html,class:"text-gray-900 leading-relaxed"},null,8,mu)):d.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i(d.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(d),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(p.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),hu={class:"grid grid-cols-12 gap-[20px]"},gu={key:0,class:"col-span-4"},yu=["innerHTML"],vu=["onClick"],bu=["innerHTML"],ku={key:1,class:"flex w-full"},Eu={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},wu=["onClick"],xu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},Nu={class:"flex-1 p-4"},Cu=["innerHTML"],Su={class:"grid grid-cols-12 gap-4"},_u={key:3,class:"w-full h-full"},on=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 O=typeof window<"u"?window:globalThis,j="__vsCardAnonymousCounter__",C=O[j]??0;return O[j]=C+1,C===0?"tab":`tab${C}`}const s=e.ref(0),r=e.ref([]);let i=!1,l=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,O=>{O&&(a.value=O)});const c=new Map,p=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",p);function u(O,j){const C=j?.path;return C?(c.has(C)||c.set(C,e.defineAsyncComponent(()=>import(C))),c.get(C)):typeof O=="string"&&Et[O]?Et[O]:j?.component&&Et[j.component]?Et[j.component]:j?.name&&Et[j.name]?Et[j.name]:O}function d(O){return O.forEach(j=>{j.type&&(j.view=j.type)}),r.value=O.filter(j=>j.type==="pin"),O.filter(j=>j.type!=="pin")}const m=e.computed(()=>{let O;return n.panels&&n.panels.length>0?O=n.normalizeTabs?d(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(O=n.data.filter(C=>C.type.includes("tabs"))[0]?.items),Pn(O,12)}),w=e.computed(()=>a.value);function b(){l||(l=!0)}const k=e.computed(()=>{let O;return n.panels&&n.panels.length>0?O=n.normalizeTabs?d(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(O=n.data),Pn(O,12)}),_=e.computed(()=>({[`view-${n.view}`]:!0}));function x(O,j){if(!O||typeof j!="string"||!j)return{found:!1,value:void 0};const C=j.split(".");let q=O;for(const ee of C){if(q==null||typeof q!="object"&&!Array.isArray(q))return{found:!1,value:void 0};if(!(ee in q))return{found:!1,value:void 0};q=q[ee]}return{found:!0,value:q}}const T=O=>{const j={...O};return Object.entries(j).forEach(([C,q])=>{if(C!=="props"&&typeof q=="string"){const ee=x(n.data,q);ee.found&&(j[C]=ee.value)}}),O.props&&typeof O.props=="object"&&Object.entries(O.props).forEach(([C,q])=>{if(typeof q=="string"){const ee=x(n.data,q);j[C]=ee.found?ee.value:q}else j[C]=q}),delete j.props,n.data&&(j.data=n.data),j};function B(O){const j=["col-span-12"],C=wr(O.col);return C.length&&j.push(...C),j}const E=e.ref([]),N=e.ref([]),$=e.ref([]);function L(O,j){O&&O instanceof HTMLElement&&(E.value[j]=O)}function g(){N.value=E.value.map(O=>O.offsetWidth),$.value=E.value.map(O=>O.offsetLeft)}function I(){if(typeof window>"u")return null;const O=w.value;if(!O)return null;const C=new URL(window.location.href).searchParams.get(O);if(C===null)return null;const q=Number.parseInt(C,10);return Number.isNaN(q)?null:q}function z(O){if(typeof window>"u")return;const j=w.value;if(!j||!l)return;const C=new URL(window.location.href);O<=0?C.searchParams.delete(j):C.searchParams.set(j,String(O));const q=window.history.state??{};window.history.replaceState(q,document.title,C)}function U(){if(i||!m.value.length)return;b();const O=I();if(O===null)return;const j=Math.min(Math.max(O,0),m.value.length-1);j!==O&&z(j),j!==s.value&&(s.value=j),i=!0}function K(){i=!1,U()}let G=null;return e.onMounted(()=>{e.nextTick(()=>{U(),g()}),typeof window<"u"&&window.addEventListener("popstate",K),G=new ResizeObserver(()=>g()),G.observe(document.body)}),e.onBeforeUnmount(()=>{G?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",K)}),e.watch(s,O=>{e.nextTick(()=>{g()}),z(O)}),e.watch(m,()=>{i=!1,U()}),(O,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||_.value)},[e.createElementVNode("div",hu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",gu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(C,q)=>(e.openBlock(),e.createElementBlock("div",{key:C.name||q,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[C.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:C.html,class:"text-gray-900 leading-relaxed"},null,8,yu)):C.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(C.component,C)),e.mergeProps({key:1,ref_for:!0},C.component==="Card"?C:T(C),{id:t.data.id,class:["w-full h-full",t.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")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[N.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:N.value[s.value]+"px",left:$.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(C,q)=>(e.openBlock(),e.createElementBlock("button",{key:C.name||q,ref_for:!0,ref:ee=>L(ee,q),onClick:ee=>s.value=q,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===q?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(C.title||C.label||C.name||`Tab ${q+1}`),11,vu))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(C,q)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:C.name||q,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===q?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[C.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:C.html,class:"text-gray-900 leading-relaxed"},null,8,bu)):O.$slots[`tab-${q}`]?e.renderSlot(O.$slots,`tab-${q}`,{key:1,item:C,data:t.data}):C.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nn),e.mergeProps({key:2,ref_for:!0},T(C),{items:C.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):C.component||C.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(C.component||C.name,C)),e.mergeProps({key:3,ref_for:!0},C.component==="Card"?C:T(C),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(O.$slots,C.slot||`tab-${q}`,{key:4,item:C,data:t.data})],2)),[[e.vShow,s.value===q]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(C,q)=>(e.openBlock(),e.createElementBlock("button",{key:C.name||q,onClick:ee=>s.value=q,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===q?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(C.title||C.label||C.name||`Tab ${q+1}`)+" ",1),s.value===q?(e.openBlock(),e.createElementBlock("span",xu,[...j[0]||(j[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,wu))),128))]),e.createElementVNode("div",Nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(C,q)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:C.name||q,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===q?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[C.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:C.html,class:"text-gray-900 leading-relaxed"},null,8,Cu)):O.$slots[`tab-${q}`]?e.renderSlot(O.$slots,`tab-${q}`,{key:1,item:C,data:t.data}):C.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nn),e.mergeProps({key:2,ref_for:!0},T(C),{items:C.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):C.component||C.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(C.component||C.name,C)),e.mergeProps({key:3,ref_for:!0},C.component==="Card"?C:T(C),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(O.$slots,C.slot||`tab-${q}`,{key:4,item:C,data:t.data})],2)),[[e.vShow,s.value===q]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(C,q)=>(e.openBlock(),e.createElementBlock("div",{key:C.name||C.component||q,class:e.normalizeClass(B(C))},[O.$slots[`panel-${q}`]?e.renderSlot(O.$slots,`panel-${q}`,{key:0,item:C,data:t.data}):C.items||C.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(nn),e.mergeProps({key:1,ref_for:!0},T(C),{items:C.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):C.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(C.component,C)),e.mergeProps({key:2,ref_for:!0},T(C),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",_u,[e.renderSlot(O.$slots,C.slot||`panel-${q}`,{item:C,data:t.data})]))],2))),128))])],2))],2)])],2))}}),Bu=["onClick"],xr=st(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 l={id:s++,timer:setTimeout(()=>{i(l.id)},1500)};o.value.push(l)},i=l=>{const a=o.value.findIndex(c=>c.id===l);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(l=>{clearTimeout(l.timer)})}),(l,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(Fr),{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:p=>i(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(zn),{class:"h-4 w-4"})],8,Bu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);on.install=function(t){t.component("vs-widget-file",pn),t.component("vs-widget-comments",dn),t.component("vs-widget-history",fn),t.component("vs-widget-gallery",un),t.component("vs-widget-map",yn),t.component("vs-group-interface",Fn),t.component("CommentsWidget",dn),t.component("HistoryWidget",fn),t.component("GalleryWidget",un),t.component("FilesWidget",pn),t.component("MapWidget",yn),t.component("Card",on),t.component("CardItem",nn),t.component("DescriptionListWidget",Hn),t.component("CopyNotification",xr),t.component("GroupInterfaceWidget",Fn)},ge.Card=on,ge.CardItem=nn,ge.CommentsWidget=dn,ge.CopyNotification=xr,ge.DescriptionListWidget=Hn,ge.FilesWidget=pn,ge.GalleryWidget=un,ge.GroupInterfaceWidget=Fn,ge.HistoryWidget=fn,ge.MapWidget=yn,ge.TableWidget=br,ge.default=on,Object.defineProperties(ge,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(ve,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):(ve=typeof globalThis<"u"?globalThis:ve||self,e(ve.WidgetLib={},ve.Vue,ve.OpenGISCore))})(this,(function(ve,e,Ce){"use strict";function Rr(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 zr=Rr(e);const qo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Hr=t=>{const n=jr(t);return n.charAt(0).toUpperCase()+n.slice(1)},Ur=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var dn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Wr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:i,class:l,...a},{slots:c})=>e.h("svg",{...dn,width:t||dn.width,height:t||dn.height,stroke:s||dn.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:Ur("lucide",...i?[`lucide-${qo(Hr(i))}-icon`,`lucide-${qo(i)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ae=(t,n)=>(o,{slots:s})=>e.h(Wr,{...o,iconNode:n,name:t},s);const qr=ae("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Kr=ae("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ko=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Gr=ae("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);const Zr=ae("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Yr=ae("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Go=ae("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Jr=ae("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const _t=ae("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"}]]);const Xr=ae("file",[["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"}]]);const Qr=ae("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Vr=ae("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const ei=ae("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const ti=ae("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Zo=ae("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const ni=ae("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const oi=ae("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Yo=ae("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const si=ae("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const Jo=ae("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const ri=ae("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const Xo=ae("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const fn=ae("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"}]]);const ii=ae("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Qo=ae("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"}]]);const li=ae("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const Wn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ai={class:"border-t pt-3 mt-4"},ci={class:"flex gap-2"},di={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},fi={class:"flex-1 space-y-2"},pi={class:"flex justify-between items-center"},ui={class:"flex gap-2"},mi=["disabled"],Vo=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,i=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},l=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),i())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",ai,[e.createElementVNode("div",ci,[e.createElementVNode("span",di,[e.createVNode(e.unref(Qo),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",fi,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:l,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",pi,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ui,[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(Wn),{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:i},[e.createVNode(e.unref(Jo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,mi)])])])])]))}}),hi={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"},gi=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(),i=e.ref(!0),l=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!i.value&&(s.value=!1),i.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",l)}),e.onUnmounted(()=>{document.removeEventListener("click",l)}),(d,u)=>(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",hi,[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(Xo),{class:"h-3 w-3 mr-2"}),u[0]||(u[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(fn),{class:"h-3 w-3 mr-2"}),u[1]||(u[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),yi={class:"space-y-2"},vi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},bi={class:"flex-1 min-w-0 space-y-1 relative"},ki={class:"flex items-center gap-2"},Ei={class:"font-medium text-xs"},wi={class:"text-xs text-gray-500"},xi={key:0,class:"text-xs text-gray-700 leading-relaxed"},Ni={class:"flex justify-between text-xs"},Ci={class:"flex items-center gap-2"},Si={key:0,class:"flex gap-2"},_i=["disabled"],Bi={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},$i=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),i=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),l=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),u=e.ref(!1),p=x=>{const _=new Date,W=Math.floor((_.getTime()-x.getTime())/(1e3*60*60));return W<1?`${Math.floor((_.getTime()-x.getTime())/6e4)}m`:W<24?`${W}h`:`${Math.floor(W/24)}d`},m=()=>{u.value=!u.value,u.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},S=()=>{o("edit",s.comment.id,r.value),d.value=!1},w=(x,_)=>{o("like",x,_)},g=(x,_)=>{o("edit",x,_)};return(x,_)=>{const W=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",yi,[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",vi,[e.createVNode(e.unref(Qo),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",bi,[e.createElementVNode("div",ki,[e.createElementVNode("span",Ei,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",wi,e.toDisplayString(p(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":_[0]||(_[0]=N=>r.value=N),class:e.normalizeClass(d.value?l.value:i.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",xi,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",Ni,[e.createElementVNode("div",Ci,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",u.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:_[1]||(_[1]=N=>m())},[e.createVNode(e.unref(Vr),{class:e.normalizeClass(["h-3 w-3",u.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:_[2]||(_[2]=N=>c.value=!0)},[e.createVNode(e.unref(si),{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:_[3]||(_[3]=N=>a.value=!0)},[e.createVNode(e.unref(Jr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",Si,[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:_[4]||(_[4]=N=>d.value=!1)},[e.createVNode(e.unref(Wn),{class:"h-3 w-3"}),_[11]||(_[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:_[5]||(_[5]=N=>S())},[e.createVNode(e.unref(Jo),{class:"h-3 w-3 mr-1"}),_[12]||(_[12]=e.createTextVNode(" Send ",-1))],8,_i)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(gi,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":_[6]||(_[6]=N=>a.value=N),onEdit:_[7]||(_[7]=N=>d.value=!0),onDelete:_[8]||(_[8]=N=>x.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,N=>(e.openBlock(),e.createBlock(W,{key:N.id,comment:N,isInside:!0,onDelete:C=>x.$emit("delete",N.id),onLike:w,onEdit:g},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Vo,{key:0,onSendComment:_[9]||(_[9]=N=>x.$emit("reply",t.comment?.id,N)),isReply:c.value,"onUpdate:isReply":_[10]||(_[10]=N=>c.value=N)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),Ti=["id"],Li={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},pn=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 i(){if(!o.id)return;const p=await fetch(`/api/widget/comment/${o.id}`).then(m=>m.json());r.value=p.rows.map(m=>({id:m.communication_id,author:m.username,text:m.body,createdAt:new Date(m.cdate)}))}r.value.length===0&&i();const l=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 i()),s("add",p)},a=(p,m)=>{o?.onLike?.(p,m),s("like",p,m)},c=(p,m)=>{o.onReply?.(p,m),s("reply",p,m)},d=async(p,m)=>{o.onEdit?o.onEdit(p,m):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:m})}),await i()),s("edit",p,m)},u=async p=>{o.onDelete?o.onDelete(p):o.id&&(await fetch(`/api/widget/comment/${o.id}/${p}`,{method:"DELETE"}),await i()),s("delete",p)};return(p,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",Li,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,S=>(e.openBlock(),e.createBlock($i,{key:S.id,comment:S,onReply:c,onLike:a,onDelete:m[0]||(m[0]=w=>u(w)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Vo,{onSendComment:m[1]||(m[1]=S=>l(S))})],14,Ti))}}),es={CopyPlus:Yr,SquarePen:Xo,Trash2:fn},ts=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:_t}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:ri}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:ii}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:ei}]]);function ns(t){if(t==null||typeof t!="string")return null;const n=t.trim();if(!n)return null;const o=/^([-\d.]+)\s*,\s*([-\d.]+)$/.exec(n);if(o){const a=Number(o[1]),c=Number(o[2]);if(Number.isFinite(a)&&Number.isFinite(c))return{type:"Point",coordinates:[a,c]}}const s=n.indexOf("(");if(s<0)return null;const r=n.slice(0,s).trim().toUpperCase(),i=n.slice(s).replace(/[()]/g,""),l=a=>a.trim().split(/\s+/).map(Number);try{if(r==="POINT"){const a=l(i);return!Number.isFinite(a[0])||!Number.isFinite(a[1])?null:{type:"Point",coordinates:a}}if(r==="LINESTRING"){const a=i.split(",").map(l);return!a.length||a.some(c=>!Number.isFinite(c[0])||!Number.isFinite(c[1]))?null:{type:"LineString",coordinates:a}}if(r==="POLYGON"){const a=i.split(",").map(l);return!a.length||a.some(c=>!Number.isFinite(c[0])||!Number.isFinite(c[1]))?null:{type:"Polygon",coordinates:[a]}}}catch{return null}return null}function os(t){if(t==null||typeof t!="string")return!1;const n=t.trim().toUpperCase();return n.startsWith("POINT(")||n.startsWith("LINESTRING(")||n.startsWith("POLYGON(")}function ss(t){if(!t)return null;let n=1/0,o=1/0,s=-1/0,r=-1/0;const i=a=>{if(typeof a[0]=="number"){const[c,d]=a;n=Math.min(n,c),o=Math.min(o,d),s=Math.max(s,c),r=Math.max(r,d);return}a.forEach(c=>i(c))},l=t.coordinates;return!l||(i(l),n===1/0||o===1/0)?null:[n,o,s,r]}function Ai(t,n){return t?n?[Math.min(t[0],n[0]),Math.min(t[1],n[1]),Math.max(t[2],n[2]),Math.max(t[3],n[3])]:t:n}function un(t){if(!t)return[];const n=t.coordinates;if(!n)return[];if(t.type==="Point")return[n];if(t.type==="LineString")return n;if(t.type==="Polygon"){const o=n[0]??[];if(o.length<2)return o;const s=o[0],r=o[o.length-1],i=1e-8;return Math.abs(s[0]-r[0])<i&&Math.abs(s[1]-r[1])<i?o.slice(0,-1):o}return[]}const mn=1e-8;function Di(t,n){const o=un(t),s=un(n);if(!o.length&&!s.length)return 0;if(!o.length)return s.length;if(!s.length)return o.length;const r=(d,u)=>Math.abs(d[0]-u[0])<mn&&Math.abs(d[1]-u[1])<mn,i=new Set,l=new Set;for(let d=0;d<o.length;d++)for(let u=0;u<s.length;u++)if(r(o[d],s[u])){i.add(d),l.add(u);break}const a=o.length-i.size,c=s.length-l.size;return Math.max(a,c)}function Ii(t,n){const o=un(t),s=un(n),r=(d,u)=>Math.abs(d[0]-u[0])<mn&&Math.abs(d[1]-u[1])<mn,i=new Set,l=new Set;for(let d=0;d<o.length;d++)for(let u=0;u<s.length;u++)if(r(o[d],s[u])){i.add(d),l.add(u);break}const a=o.filter((d,u)=>!i.has(u)),c=s.filter((d,u)=>!l.has(u));return{removed:a,added:c}}function rs(t){return t?{type:"FeatureCollection",features:[{type:"Feature",geometry:t}]}:null}function is(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(i=>i.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 Oi(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 Mi="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let qn=null;function Fi(){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 Pi(){return qn||(qn=is(Mi).then(()=>{const t=Fi();if(!t)throw new Error("IMask is not available after loading the script");return t})),qn}function Ri(){return typeof window>"u"?"":window.location?.origin??""}function ls(){if(!(typeof window>"u"))return window.maplibregl}const as=Symbol("vs-widget-map");function Kn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function zi(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 ji(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function Gn(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=Ri(),i=s.replace(/^\/+/,"");return r?`${r}/${i}`:i?`/${i}`:""}function Hi(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 Ui(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function hn(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 cs=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function Wi(t){const n=t?.color??cs[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(([l,a])=>{const c=typeof a=="string"?a.trim():"",d=String(l).trim();c&&d&&(r[d]=c)}):cs.forEach((l,a)=>{r[String(a+1)]=l}),!Object.keys(r).length)return n;const i=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([l,a])=>{i.push(String(l),a)}),i.push(n),i}const Wt="map-highlight-source",qi="map-highlight-fill",Ki="map-highlight-line";function Gi(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function ds(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Zi(){return Oi("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await is("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),ls()}function gn(t){const n=e.inject(as,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:[]}),i=e.ref([]),l=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let u=t.style??null,p=null;const m=h=>{h&&(o.value?o.value.setStyle(h):u=h)},S=()=>{r.value.overlays=l.value.map(h=>({id:h.id,name:h.config.name,visible:h.visible}))},w=h=>{const j=Array.isArray(h)?h:[];i.value=j,j.some($=>$.key===r.value.selectedBasemap)||(r.value.selectedBasemap=j[0]?.key??"")},g=h=>{h&&l.value.forEach(j=>{j.layerIds.forEach(b=>{h.getLayer(b)&&h.removeLayer(b)}),h.getSource(j.sourceId)&&h.removeSource(j.sourceId),j.layerIds=[]})},x=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||(l.value.forEach(j=>{_(h,j)}),H())},_=(h,j)=>{const b=Hi(j.config);b==="vtile"?N(h,j):b==="raster"&&W(h,j)},W=(h,j)=>{const b=j.config,$=j.sourceId,O=Gn(b.url);if(!O)return;h.getSource($)||h.addSource($,{type:"raster",tiles:[O],minzoom:b.minzoom??0,maxzoom:b.maxzoom??24});const P=`${j.id}-raster`;h.getLayer(P)||h.addLayer({id:P,type:"raster",source:$,layout:{visibility:j.visible?"visible":"none"}}),j.layerIds=[P],C(h,j)},N=(h,j)=>{const b=j.config,$=j.sourceId,O=Gn(b.url);if(!O)return;h.getSource($)||h.addSource($,{type:"vector",tiles:[O],minzoom:b.minzoom??0,maxzoom:b.maxzoom??24});const P=b.style??{},Z=Wi(P),X=[],se={visibility:j.visible?"visible":"none"},ie=Ui(b),pe={source:$,layout:se};if(ie&&(pe["source-layer"]=ie),(P.type??"polygon").toLowerCase()==="point"){const Ee=`${j.id}-circle`;h.getLayer(Ee)||h.addLayer({id:Ee,type:"circle",...pe,paint:{"circle-color":Z,"circle-opacity":P.opacity??1,"circle-radius":P.radius??P.width??3,"circle-stroke-color":P.stroke??P.color??"#ffffff","circle-stroke-width":P.width??1}}),X.push(Ee);const Te=P.text??P.label;if(Te){const nt=`${j.id}-symbol`,an=hn(P.textSize)??10,zt=P.textHaloColor??P.stroke??"#ffffff",jt=hn(P.textHaloWidth)??1,xt=hn(P.textZoom??P.pointZoom),Nt={"text-color":P.textColor??"#000000","text-halo-color":zt,"text-halo-width":jt},ut={id:nt,type:"symbol",...pe,layout:{"text-field":["coalesce",["get",Te],""],"text-size":an,"text-anchor":"top"},paint:Nt};xt!=null&&(ut.minzoom=xt),h.getLayer(nt)||h.addLayer(ut),X.push(nt)}}else{const Ee=`${j.id}-fill`;h.getLayer(Ee)||h.addLayer({id:Ee,type:"fill",...pe,paint:{"fill-color":Z,"fill-opacity":P.opacity??.5,"fill-outline-color":P.stroke??P.color??"#0ea5e9"}}),X.push(Ee);const Te=`${j.id}-line`;h.getLayer(Te)||h.addLayer({id:Te,type:"line",...pe,paint:{"line-color":P.stroke??P.color??"#0b74c4","line-width":hn(P.width??P.border)??1,"line-opacity":P.opacity??1}}),X.push(Te)}j.layerIds=X,C(h,j)},C=(h,j)=>{const b=j.visible?"visible":"none";j.layerIds.forEach($=>{h.getLayer($)&&h.setLayoutProperty($,"visibility",b)})},T=h=>{const j=Array.isArray(h)?h:[];g(o.value??void 0),d.value=null,I();const b=j.map(($,O)=>{if(!$)return null;const P=Gn($.url);if(!P)return null;const Z=$.id!=null?String($.id):`overlay-${O}`;return{id:Z,config:{...$,id:Z,url:P},visible:!1,sourceId:`${Z}-source`,layerIds:[]}}).filter($=>!!$);l.value=b,S(),x()},v=(h,j)=>{const b=l.value.find(O=>O.id===h);if(!b)return;b.visible=j,S();const $=o.value;if(!(!$||typeof $.isStyleLoaded!="function"||!$.isStyleLoaded())){if(!b.layerIds.length){_($,b);return}C($,b)}},E=()=>{a.value&&(a.value.remove(),a.value=null)},y=(h,j={})=>!Array.isArray(h.popup)||!h.popup.length?[]:h.popup.map(b=>({label:b.label??b.field,value:Kn(j?.[b.field])})).filter(b=>b.label&&b.value!==void 0),D=h=>{const j=o.value;if(!j||!h?.point)return;const b=j.queryRenderedFeatures(h.point);for(const $ of b){const O=$.layer?.id??$.sourceLayer;if(!O)continue;const P=je(O);if(!P)continue;const Z=y(P,$.properties??$.layer?.properties??{});if(!Z.length)continue;const X=zi(Z),se=ls();if(!se)return;const ie=h.lngLat;if(c.value===O&&a.value){a.value.setLngLat(ie),a.value.setHTML(X);return}c.value=O,E(),a.value=new se.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(ie).setHTML(X).addTo(j);return}c.value=null,E()},R=()=>{c.value=null,E()},H=()=>{const h=o.value;!h||typeof h.isStyleLoaded!="function"||!h.isStyleLoaded()||h.getSource(Wt)||(h.addSource(Wt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),h.addLayer({id:qi,type:"fill",source:Wt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),h.addLayer({id:Ki,type:"line",source:Wt,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=h=>{const j=o.value;if(!j||typeof j.isStyleLoaded!="function"||!j.isStyleLoaded())return;H();const b=j.getSource(Wt);if(!(!b||typeof b.setData!="function")){if(!h){b.setData({type:"FeatureCollection",features:[]});return}b.setData({type:"FeatureCollection",features:[h]})}},G=h=>{const j=Gi(h);j&&K(j)},I=()=>{K(null)},z=()=>{d.value=null,I()},B=h=>{if(h)return typeof h=="string"?h:h.field??h.name??h.key??h.label},q=h=>{if(h)return typeof h=="string"?h:h.label??h.title??h.field??h.name},ee=(h,j)=>!h||!h.length?[]:h.map(b=>{const $=B(b);if(!$)return null;const O=q(b),P=Kn(j?.[$]);return!O||P===""?null:{label:O,value:P}}).filter(b=>!!b),Be=(h,j)=>!Array.isArray(h)||!h.length?[]:h.map(b=>{if(!b?.name)return null;const $=b.title??b.name,O=Kn(j?.[b.name]);return!$||O===""?null:{label:$,value:O}}).filter(b=>!!b),me=(h,j)=>!Array.isArray(h)||!h.length?[]:h.map($=>{const O=ds($.url,j),P=$.label??$.url;return O?{label:P,url:O,target:$.target}:null}).filter($=>!!$),he=async(h,j)=>{const b=ds(h,j);if(!b)return null;try{const $=await fetch(b);return $.ok?await $.json():null}catch{return null}},$e=async(h,j)=>{const b=j.properties??j.layer?.properties??{},$=ee(h.card?.rows,b);let O,P;if(h.card?.api){const se=await he(h.card.api,b);se&&(typeof se.html=="string"&&se.html.trim()&&(O=se.html),Array.isArray(se.columns)&&se.columns.length&&(P=se.columns))}let Z=$;if(!O&&P){const se=Be(P,b);se.length&&(Z=se)}if(!Z.length&&!O)return null;const X=me(h.card?.actions,b);return{title:b?.name??h.name,rows:Z,html:O,actions:X.length?X:void 0}},pt=async h=>{const j=o.value;if(!j||!h?.point)return;const b=j.queryRenderedFeatures(h.point);for(const $ of b){const O=$.layer?.id??$.sourceLayer;if(!O)continue;const P=je(O);if(!P||!P.card)continue;const Z=await $e(P,$);if(Z){d.value=Z,G($);return}}d.value=null,I()},wt=()=>{const h=o.value;h&&(h.on("mousemove",D),h.on("mouseleave",R),h.on("click",pt))},Pe=()=>{const h=o.value;h&&(h.off("mousemove",D),h.off("mouseleave",R),h.off("click",pt),E(),I())},je=h=>{if(h)return l.value.find(j=>j.layerIds.includes(h))?.config},tt=async()=>{const h=await Zi(),j=ji(t.container);if(!h||!j)return;const b={container:j,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:u??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new h.Map(b);const $=()=>{x()};p=$,o.value.on("style.load",$),o.value.on("load",()=>{s.value=!0,u&&o.value&&(o.value.setStyle(u),u=null),x(),wt()})};e.onMounted(tt),e.onBeforeUnmount(()=>{Pe(),o.value&&p&&o.value.off("style.load",p),g(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const Ke={map:o,ready:s,setStyle:m,flyTo:h=>o.value?.flyTo(h),fitBounds:(h,j)=>o.value?.fitBounds(h,j),setCenter:h=>o.value?.setCenter(h),setZoom:h=>o.value?.setZoom(h),addControl:(h,j)=>o.value?.addControl(h,j),removeControl:h=>o.value?.removeControl(h),on:(h,...j)=>o.value?.on(h,...j),off:(h,...j)=>o.value?.off(h,...j),project:h=>o.value?.project(h),unproject:h=>o.value?.unproject(h),state:r,basemapOptions:i,setOverlays:T,toggleOverlay:v,getOverlayConfig:je,selectedCard:d,setBasemapOptions:w,clearCard:z};return e.provide(as,Ke),Ke}const Yi={class:"map-base-layer-menu"},Ji={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Xi={class:"flex items-center justify-between p-2 border-b"},Qi={class:"p-2 border-b"},Vi={class:"flex items-center"},el=["value","checked","onChange"],tl={class:"ml-2"},nl={class:"p-2"},ol={class:"flex items-center"},sl=["checked"],rl=["checked","onChange"],il={class:"ml-2"},ll=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:i}=gn(),l=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??""),u=e.computed(()=>n.value.geometryVisible??!0),p=e.computed(()=>n.value.overlays??[]),m=g=>{s?.(g)},S=()=>{r?.(!u.value)},w=g=>{i?.(g.id,!g.visible)};return(g,x)=>(e.openBlock(),e.createElementBlock("div",Yi,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=_=>l.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),l.value?(e.openBlock(),e.createElementBlock("div",Ji,[e.createElementVNode("div",Xi,[x[3]||(x[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:x[1]||(x[1]=_=>l.value=!1)},[...x[2]||(x[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",Qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.key},[e.createElementVNode("label",Vi,[e.createElementVNode("input",{type:"radio",name:a,value:_.key,checked:d.value===_.key,onChange:W=>m(_.key)},null,40,el),e.createElementVNode("span",tl,e.toDisplayString(_.name||_.key),1)])]))),128))]),e.createElementVNode("div",nl,[e.createElementVNode("label",ol,[e.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:S},null,40,sl),x[4]||(x[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,_=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:_.id},[e.createElementVNode("input",{type:"checkbox",checked:_.visible,onChange:W=>w(_)},null,40,rl),e.createElementVNode("span",il,e.toDisplayString(_.name||_.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),al={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]"},cl={class:"leading-tight"},dl=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",al,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",cl,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),fl={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]"},pl={class:"font-mono"},ul=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",fl,[e.createElementVNode("span",pl,e.toDisplayString(t.coordinates),1)]))}}),ml={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},hl=["title"],gl={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"},yl=["onClick"],vl=["placeholder"],bl={class:"divide-y divide-gray-100"},kl=["onClick"],El=600,wl="0000000000:00:000:0000",xl=30,Nl=8,Cl="https://data.softpro.ua/api-user/gis-url-proxy",Sl="https://geo.rv.ua/api-user/dzk.api",_l="https://nominatim.openstreetmap.org/search",Bl=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=gn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const l=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const b=n.config?.tools?.filter($=>l.includes($));return b&&b.length?b:l}),c={here:"Пошук…",xy:`50.4501 30.5234 або 50°27'00"N 30°31'24"E`,parcel:"Пошук…",address:"Пошук…"},d=e.computed(()=>{const b=n.config?.placeholder?.trim();return b||c[u.value]||"Пошук…"}),u=e.ref(a.value[0]);e.watch(a,b=>{b.includes(u.value)||(u.value=b[0])});const p=e.ref(""),m=e.ref(!1),S=e.ref(null),w=e.ref(null),g=e.ref(null),x=e.ref([]),_=e.ref(null),W=e.computed(()=>u.value==="address"&&x.value.length>0);let N=null,C=null,T=null;const v=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function E(){if(!w.value)return;const b=w.value.getBoundingClientRect(),$=b.width+xl,O=b.left+window.scrollX,P=b.bottom+window.scrollY+Nl;v.left=`${O}px`,v.top=`${P}px`,v.width=`${$}px`,v.display="block"}const y=()=>{W.value&&E()};function D(){N&&(clearTimeout(N),N=null)}function R(){C?.destroy(),C=null}async function H(){if(u.value!=="parcel")return;const b=g.value;if(!b)return;const $=await Pi();u.value==="parcel"&&(R(),C=$(b,{mask:wl,lazy:!1,placeholderChar:"_"}),C.on("accept",()=>{p.value=C?.value??""}))}function K(){return(C?.value??p.value).trim()}function G(){if(!(typeof window>"u"))return window.maplibregl}function I(b){const $=o.map.value;if(!$)return;const O=G();if(O){if(T){T.setLngLat([b.lng,b.lat]);return}T=new O.Marker({color:"#2563eb"}).setLngLat([b.lng,b.lat]).addTo($)}}function z(){T&&(T.remove(),T=null)}e.watch(u,b=>{p.value="",m.value=!1,x.value=[],D(),b==="parcel"?e.nextTick(()=>{H().catch($=>{Ce.notify({type:"error",title:"Маска кадастру",message:$?.message||"Не вдалося ініціалізувати маску"})})}):R()}),e.watch(W,b=>{b?e.nextTick(()=>{E()}):v.display="none"}),e.watch(p,b=>{if(u.value!=="address"){x.value=[],D();return}if(!b.trim()){x.value=[],D();return}D(),N=window.setTimeout(()=>{je(b).catch($=>{const O=$?.message||"Помилка пошуку адреси";Ce.notify({type:"error",title:"Пошук адреси",message:O})})},El)});function B(b){u.value=b}function q(b){const $=b.target;if(m.value){const O=S.value;O&&!O.contains($)&&(m.value=!1)}if(W.value){const O=_.value;O&&!O.contains($)&&(x.value=[])}}e.onMounted(()=>{window.addEventListener("click",q,!0),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),u.value==="parcel"&&e.nextTick(()=>{H().catch(b=>{Ce.notify({type:"error",title:"Маска кадастру",message:b?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",q,!0),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y),D(),R(),z()});function ee(b){return b==="xy"?"Координати":b==="parcel"?"Кадастр":"Адреси"}const Be=/([+-]?\d{1,3})\s*[°º˚]\s*(\d{1,2})\s*['’′`]\s*(\d{1,2}(?:\.\d+)?)\s*["”″]\s*([NSEW])/gi;function me(b,$){const O=Number(b[1]),P=Number(b[2]),Z=Number(b[3]),X=String(b[4]).toUpperCase();if(!Number.isFinite(O)||!Number.isFinite(P)||!Number.isFinite(Z)||$==="lat"&&!(X==="N"||X==="S")||$==="lng"&&!(X==="E"||X==="W")||P<0||P>59||Z<0||Z>59)return null;const pe=Math.abs(O),He=$==="lat"?90:180;if(pe>He||pe===He&&(P!==0||Z!==0))return null;const Ee=pe+P/60+Z/3600;return X==="S"||X==="W"?-Ee:Ee}function he(b){const $=b.trim();if(!$)return{ok:!1};Be.lastIndex=0;const O=[...$.matchAll(Be)];if(O.length!==2)return{ok:!1};if(Be.lastIndex=0,$.replace(Be," ").replace(/[\s,;]+/g,"").trim().length)return{ok:!1};const Z=me(O[0],"lat"),X=me(O[1],"lng");return!Number.isFinite(Z)||!Number.isFinite(X)?{ok:!1}:{ok:!0,lat:Z,lng:X}}function $e(b){const $=he(b);if($.ok)return $;const O=b.replace(/[,]+/g," ").trim();if(!O)return{ok:!1};const P=O.split(/\s+/).filter(Boolean);if(P.length<2)return{ok:!1};const Z=P.slice(0,2).map(Number);if(!Z.every(Te=>Number.isFinite(Te)))return{ok:!1};let[X,se]=Z,ie=X,pe=se;const He=Te=>Math.abs(Te)<=90,Ee=Te=>Math.abs(Te)<=180;if(!He(ie)||!Ee(pe))if(He(pe)&&Ee(ie))ie=se,pe=X;else return{ok:!1};return{ok:!0,lat:ie,lng:pe}}function pt(b){return(b?.items||[]).map((O,P)=>{const Z=Number(O?.position?.lat),X=Number(O?.position?.lng);return!Number.isFinite(Z)||!Number.isFinite(X)?null:{id:String(O?.id??P),title:O?.title||O?.address?.label||"Знайдений обʼєкт",lat:Z,lng:X}}).filter(O=>!!O)}function wt(b){const $=b?.result||b?.data||b;if(!$)return[];const O=$.geom_centroid;if(!O||!Array.isArray(O.coordinates))return[];const[P,Z]=O.coordinates;return!Number.isFinite(Z)||!Number.isFinite(P)?[]:[{id:"parcel",title:$.cadnum||$.cad_num||"Земельна ділянка",lat:Z,lng:P}]}function Pe(b){return(Array.isArray(b?.features)?b.features:[]).map((O,P)=>{const Z=O?.geometry?.coordinates,X=Number(Z?.[0]),se=Number(Z?.[1]);if(!Number.isFinite(se)||!Number.isFinite(X))return null;const ie=O?.properties||{},pe=ie?.geocoding?.label||ie?.display_name||ie?.label||"Адреса";return{id:String(ie?.geocoding?.place_id||ie?.place_id||P),title:pe,lat:se,lng:X}}).filter(O=>!!O)}async function je(b){x.value=[],D();const $=new URL(_l);$.searchParams.set("format","geojson"),$.searchParams.set("q",b),$.searchParams.set("addressdetails","1"),$.searchParams.set("bounded","1");const O=r();O&&$.searchParams.set("viewbox",O);const P=await fetch($.toString());if(!P.ok)throw new Error(`HTTP ${P.status}`);const Z=await P.json(),X=Pe(Z);if(!X.length){Ce.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}x.value=X}function tt(b){h(b),x.value=[],p.value=""}function Ke(b){const O=b.replace(/\s+/g,"").split(":");if(O.length!==4)return!1;const P=[10,2,3,4];return O.every((Z,X)=>Z.length===P[X]&&/^\d+$/.test(Z))}function h(b){const $=n.config?.zoom??17;o.flyTo?.({center:[b.lng,b.lat],zoom:$}),I(b)}async function j(){const b=u.value==="parcel"?K():p.value.trim();if(b){if(u.value==="xy"){const $=$e(b);if(!$.ok){Ce.notify({type:"warning",title:"Пошук координат",message:"Використайте `lat lon` або DMS у форматі `50°27'00\"N 30°31'24\"E`."});return}h($),p.value="";return}if(u.value==="address"){try{await je(b)}catch($){const O=$?.message||"Помилка пошуку адреси";Ce.notify({type:"error",title:"Пошук адреси",message:O})}return}try{const $=new URL(u.value==="here"?Cl:Sl);if(u.value==="here")$.searchParams.set("searchtext",b);else{if(!Ke(b)){Ce.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}$.searchParams.set("cad_num",b)}const O=await fetch($.toString());if(!O.ok)throw new Error(`HTTP ${O.status}`);const P=await O.json(),Z=u.value==="here"?pt(P):wt(P);if(!Z.length)Ce.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const X=Z[0];h(X),u.value==="parcel"&&C&&(C.value=""),p.value=""}}catch($){const O=$?.message||"Помилка пошуку";Ce.notify({type:"error",title:"Пошук",message:O})}}}return(b,$)=>(e.openBlock(),e.createElementBlock("div",ml,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(j,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:S,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:$[0]||($[0]=O=>m.value=!m.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:ee(u.value)},e.toDisplayString(ee(u.value)),9,hl),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":m.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...$[3]||($[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),m.value?(e.openBlock(),e.createElementBlock("div",gl,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,O=>(e.openBlock(),e.createElementBlock("li",{key:O,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:P=>B(O)},e.toDisplayString(ee(O)),9,yl))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:w,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[u.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:g,"onUpdate:modelValue":$[1]||($[1]=O=>p.value=O),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,p.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":$[2]||($[2]=O=>p.value=O),placeholder:d.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,vl)),[[e.vModelText,p.value,void 0,{trim:!0}]]),$[4]||($[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:_,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(v)},[e.createElementVNode("ul",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,O=>(e.openBlock(),e.createElementBlock("li",{key:O.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:P=>tt(O)},e.toDisplayString(O.title),9,kl))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),$l={class:"map-center-control"},Tl=["aria-label"],Ll=e.defineComponent({directives:{tooltip:Ce.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=gn(),r=e.ref(null),i=e.ref(null),l=e.ref(null),a=e.ref(null);function c(w){if(Array.isArray(w)&&w.length>=2){const[g,x]=w.slice(0,2).map(_=>Number(_));return Number.isNaN(g)||Number.isNaN(x)?null:[g,x]}if(w&&typeof w=="object"){const g=w,x=g.lng??g.lon??g.long??g.x,_=g.lat??g.y;if(x!=null&&_!=null){const W=Number(x),N=Number(_);if(!Number.isNaN(W)&&!Number.isNaN(N))return[W,N]}}if(typeof w=="string"){const g=w.split(",").map(x=>Number(x.trim()));if(g.length>=2&&g.every(x=>!Number.isNaN(x)))return[g[0],g[1]]}return null}e.watch(()=>n.center,w=>{const g=c(w);g&&(r.value=g)},{immediate:!0}),e.watch(()=>n.zoom,w=>{const g=Number(w);Number.isNaN(g)||(i.value=g)},{immediate:!0}),e.watch(()=>n.targetCenter,w=>{l.value=c(w)},{immediate:!0}),e.watch(()=>n.targetZoom,w=>{const g=Number(w);a.value=Number.isNaN(g)?null:g},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),u=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!l.value);e.onMounted(async()=>{const w=o.value;if(w){if(!r.value){const g=w.getCenter();r.value=[g.lng,g.lat]}i.value==null&&(i.value=w.getZoom())}});function m(){const w=o.value;if(!w)return;const g=r.value||(()=>{const _=w.getCenter();return[_.lng,_.lat]})(),x=i.value??w.getZoom();w.flyTo({center:g,zoom:x})}function S(){const w=o.value;if(!w||!l.value)return;const g=a.value??i.value??w.getZoom();w.flyTo({center:l.value,zoom:g})}return(w,g)=>{const x=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",$l,[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(m,["stop"])},[e.createVNode(e.unref(ti),{class:"w-4 h-4"})])),[[x,"Центр мапи"]]),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":u.value,onClick:e.withModifiers(S,["stop"])},[e.createVNode(e.unref(oi),{class:"w-4 h-4"})],8,Tl)),[[x,d.value]]):e.createCommentVNode("",!0)])}}}),Xe=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},fs=Xe(Ll,[["__scopeId","data-v-73fcd71f"]]),Al={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},Dl={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Il=["aria-label"],Ol={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)]"},Ml={class:"text-slate-900 font-semibold mb-1"},Fl=["innerHTML"],Pl={key:1,class:"space-y-2"},Rl={class:"text-gray-500"},zl={class:"font-medium text-slate-900"},jl={key:2,class:"mt-2 flex flex-col gap-2"},Hl=["href","target"],mt="map-basemap-source",qt="map-basemap-layer",Ul=20,Bt="map-katottg-geometry-source",yn="map-katottg-geometry-line",rt="map-geometry-source",$t="map-geometry-fill",Tt="map-geometry-line",Lt="map-geometry-circle",Kt="map-highlight-points-source",Zn="map-highlight-points-layer",At=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},bounds:{},highlightPoints:{},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"}],i=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function l(f){if(f){if(Array.isArray(f)&&f.length>=2){const F=Number(f[0]),U=Number(f[1]);return!Number.isFinite(F)||!Number.isFinite(U)?void 0:[F,U]}if(typeof f=="object"){const F=f,U=F.lng??F.lon??F.long??F.x,Y=F.lat??F.y;if(U!=null&&Y!=null){const ye=Number(U),Ue=Number(Y);if(Number.isFinite(ye)&&Number.isFinite(Ue))return[ye,Ue]}}}}function a(f){if(f==null)return;const F=Number(f);return Number.isFinite(F)?F:void 0}const c=()=>typeof window>"u"?"":window.location?.origin??"",d=f=>{if(!f)return"";const F=f.trim();if(!F)return"";const Y=F.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const ye=c(),Ue=Y.replace(/^\/+/,"");return ye?`${ye}/${Ue}`:Ue?`/${Ue}`:""},u=e.computed(()=>n.katottg!=null?n.katottg:i.katottg),p=e.computed(()=>(Array.isArray(i.basemaps)&&i.basemaps.length?i.basemaps:o).map((U,Y)=>{const ye=typeof U.url=="string"?U.url.trim():"";return ye?{key:(U.key??U.name??`base-${Y}`).trim()||`base-${Y}`,url:ye,name:U.name??U.key??`Layer ${Y+1}`}:null}).filter(U=>!!U)),m=l(i.center),S=a(i.zoom),w=Wo(n.geom),g=Fr(w),x=g?[(g[0]+g[2])/2,(g[1]+g[3])/2]:void 0,_=e.ref(null),W=e.computed(()=>l(n.center)??null),N=e.computed(()=>W.value??m??null),C=f=>f?{version:8,sources:{[mt]:{type:"raster",tiles:[f],tileSize:256}},layers:[{id:qt,type:"raster",source:mt,layout:{visibility:"visible"}}]}:{version:8,sources:{},layers:[]},T=d(p.value[0]?.url),v=gn({container:_,center:x??N.value??void 0,zoom:n.zoom??S,style:C(T)}),{map:E,setCenter:y,setZoom:D,state:R,getOverlayConfig:H,selectedCard:K,setBasemapOptions:G,clearCard:I,addControl:z,removeControl:B,ready:q}=v,ee=e.computed({get:()=>R.value.selectedBasemap??"",set:f=>{R.value.selectedBasemap=f}}),Be=e.computed({get:()=>R.value.geometryVisible??!0,set:f=>{R.value.geometryVisible=f}}),me=e.computed(()=>{const f=n.height;return{height:typeof f=="number"?`${f}px`:String(f)}}),he=e.ref(!1),$e=e.ref(!1),pt=e.computed(()=>he.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),wt=e.computed(()=>{const f=["w-full","h-full"];return he.value||f.push(`min-h-[${me.value.height}]`),f.join(" ")}),Pe=e.computed(()=>K.value),je=()=>I?.(),tt=e.ref(x??N.value??null),Ke=e.ref(n.zoom??S??null),h=e.ref(N.value);e.watch(N,f=>{h.value=f},{immediate:!0});const j=e.computed(()=>h.value??null),b=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof Ke.value=="number"?Ke.value:Ul),$=["home","fullscreen","scale","position","search"],O=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?$:n.tools.filter(f=>$.includes(f))),P=f=>O.value.includes(f);e.watch([E,q],([f,F])=>{if(!(!f||!F)){if(!tt.value){const U=f.getCenter();tt.value=[U.lng,U.lat]}Ke.value==null&&(Ke.value=f.getZoom())}},{immediate:!0});const Z=e.ref(null),X=e.ref(""),se=e.ref(null),ie=f=>f?$e.value?!0:typeof f.isStyleLoaded=="function"&&f.isStyleLoaded()?($e.value=!0,!0):!1:!1,pe=f=>{if(!f)return"";const F=Number(f.lat??f[1]),U=Number(f.lng??f[0]);return!Number.isFinite(F)||!Number.isFinite(U)?"":`${U.toFixed(5)}, ${F.toFixed(5)}`},He=f=>{f?.lngLat&&(X.value=pe(f.lngLat))},Ee=()=>{X.value=""},Te=f=>{f&&(f.on("mousemove",He),f.on("mouseleave",Ee),se.value=f)},nt=f=>{f&&(f.off("mousemove",He),f.off("mouseleave",Ee),se.value=null)},an=e.computed(()=>P("scale"));e.watch([E,q],([f,F],[U])=>{U&&nt(U),!(!f||!F)&&Te(f)},{immediate:!0}),e.watch([E,q,an],([f,F,U])=>{if(Z.value&&B&&(B(Z.value),Z.value=null),!f||!F||!U)return;const Y=window?.maplibregl;Y&&(Z.value=new Y.ScaleControl({unit:"metric"}),z?.(Z.value,"bottom-left"))},{immediate:!0});const zt=e.computed(()=>Array.isArray(n.legend)?n.legend.map((f,F)=>{const U=typeof f?.color=="string"?f.color.trim():"",Y=typeof f?.label=="string"?f.label.trim():"";return!U||!Y?null:{color:U,label:Y,key:`${Y}-${F}`}}).filter(f=>!!f):[]),jt=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(i.layers)&&i.layers.length?i.layers:[]);e.watch(p,f=>{if(G?.(f),!f.length){ee.value="";return}f.some(F=>F.key===ee.value)||(ee.value=f[0].key)},{immediate:!0});const xt=f=>{if(!f?.getStyle)return;const F=f.getStyle()??{},U=Array.isArray(F.layers)?F.layers:[];return U.length?U.find(ye=>ye.type!=="background")?.id??U[0]?.id:void 0},Nt=f=>{f&&(f.getLayer(qt)&&f.removeLayer(qt),f.getSource(mt)&&f.removeSource(mt))},ut=(f,F)=>{if(!f)return;const U=xt(f);f.addSource(mt,{type:"raster",tiles:[F],tileSize:256}),f.addLayer({id:qt,type:"raster",source:mt,layout:{visibility:"visible"}},U)},jo=f=>{if(!f)return;const F=d(f.url);if(!F){ot.value=null;return}ot.value=F,Nt(E.value),L()},ot=e.ref(null),k=e.ref(T||null),M=f=>{if(!f||f.__pendingBasemapHooked)return;f.__pendingBasemapHooked=!0;const F=()=>{f.__pendingBasemapHooked=!1,L()};f.once("style.load",F),f.once("styledata",F)},L=()=>{const f=E.value,F=ot.value;if(!(!F||!f)){if(!ie(f)){M(f);return}if(k.value===F&&f.getSource(mt)&&f.getLayer(qt)){ot.value=null;return}Nt(f),ut(f,F),k.value=F,ot.value=null}},A=()=>{const f=ee.value;if(!f)return;const F=p.value.find(U=>U.key===f);F&&jo(F)};e.watch(ee,()=>{A()},{immediate:!0}),e.watch(jt,f=>{v.setOverlays?.(f)},{immediate:!0,deep:!0});const J=e.ref(null);let le=0;const ne=e.computed(()=>Wo(J.value)),Ne={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}},st={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},re=e.ref(w),Ye=e.ref(g),ge=e.ref(!1),Je=e.computed(()=>{if(!Ye.value)return null;const[f,F,U,Y]=Ye.value;return[(f+U)/2,(F+Y)/2]}),Ht=e.computed(()=>!!Ye.value),Re=e.ref(!!g);e.ref(!1);const Ho=()=>{he.value=!he.value},Ge=e.ref(!1),Un=()=>{const f=E.value;if(!f||!ie(f))return;const F=re.value;if(!F){tm(f),Ir(f),cn();return}Dr(f);let U=f.getSource(rt);U?U.setData(F):(f.addSource(rt,{type:"geojson",data:F}),em(f),U=f.getSource(rt)),Or(f,Be.value?"visible":"none"),nm(),cn();const Y=n.bounds??Ye.value;if(Y){const ye=[[Y[0],Y[1]],[Y[2],Y[3]]],Ue=!!n.bounds;!Ge.value&&(Ue||!Re.value&&(ge.value||!0))?(typeof f.resize=="function"&&f.resize(),f.fitBounds(ye,{padding:20,maxZoom:18,duration:0}),Ge.value=!0,ge.value=!1,Re.value&&(Re.value=!1)):Re.value&&(Re.value=!1,ge.value=!1,Ge.value=!0)}},em=f=>{const F=Ne;f.getLayer($t)||f.addLayer({id:$t,type:"fill",source:rt,paint:F.fill}),f.getLayer(Tt)||f.addLayer({id:Tt,type:"line",source:rt,paint:F.line}),f.getLayer(Lt)||f.addLayer({id:Lt,type:"circle",source:rt,paint:F.circle,filter:["==","$type","Point"]})},tm=f=>{[Lt,Tt,$t].forEach(F=>{f.getLayer(F)&&f.removeLayer(F)}),f.getSource(rt)&&f.removeSource(rt)},Dr=f=>{const F=n.highlightPoints;if(!F?.length){Ir(f);return}const U={type:"FeatureCollection",features:F.map(ye=>({type:"Feature",geometry:{type:"Point",coordinates:ye},properties:{}}))};let Y=f.getSource(Kt);Y?Y.setData(U):(f.addSource(Kt,{type:"geojson",data:U}),f.addLayer({id:Zn,type:"circle",source:Kt,paint:{"circle-radius":4,"circle-color":"#dc2626","circle-stroke-color":"#fff","circle-stroke-width":2}}))},Ir=f=>{f.getLayer(Zn)&&f.removeLayer(Zn),f.getSource(Kt)&&f.removeSource(Kt)},Or=(f,F)=>{ie(f)&&[Lt,Tt,$t].forEach(U=>{f.getLayer(U)&&f.setLayoutProperty(U,"visibility",F)})},nm=()=>{const f=E.value;if(!f||!ie(f))return;const F=Ne;f.getLayer($t)&&Object.entries(F.fill).forEach(([U,Y])=>{f.setPaintProperty($t,U,Y)}),f.getLayer(Tt)&&Object.entries(F.line).forEach(([U,Y])=>{f.setPaintProperty(Tt,U,Y)}),f.getLayer(Lt)&&Object.entries(F.circle).forEach(([U,Y])=>{f.setPaintProperty(Lt,U,Y)})},Mr=f=>{f.getLayer(yn)||f.addLayer({id:yn,type:"line",source:Bt,layout:{visibility:"visible"},paint:st})},cn=()=>{const f=E.value;if(!f||!ie(f))return;const F=ne.value??{type:"FeatureCollection",features:[]};if(!f.getSource(Bt)){f.addSource(Bt,{type:"geojson",data:F}),Mr(f);return}const U=f.getSource(Bt);U&&typeof U.setData=="function"&&U.setData(F),Mr(f)},om=f=>{f.getLayer(yn)&&f.removeLayer(yn),f.getSource(Bt)&&f.removeSource(Bt)},sm=async f=>{const F=typeof f=="string"?f.trim():"",U=++le;if(!F){J.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${F}`);if(le!==U)return;if(!Y.ok){J.value=null;return}const ye=await Y.json();if(le!==U)return;J.value=ye}catch{if(le!==U)return;J.value=null}};e.watch(u,f=>{sm(f)},{immediate:!0}),e.watch(ne,()=>{cn()},{immediate:!0}),e.watch(()=>n.geom,f=>{re.value=Wo(f),Ye.value=Fr(re.value),Je.value&&(tt.value=Je.value),Ge.value=!1,ge.value=!0,Un()},{deep:!0,immediate:!0}),e.watch(()=>n.bounds,()=>{n.bounds&&(Ge.value=!1,ge.value=!0,Un())},{deep:!0}),e.watch(()=>n.highlightPoints,()=>{const f=E.value;f&&ie(f)&&Dr(f)},{deep:!0}),e.watch(Be,()=>{const f=E.value;f&&ie(f)&&Or(f,Be.value?"visible":"none")});const Ct=()=>{$e.value=!0,Un(),cn(),L()},Uo=()=>{Un(),cn()};e.watch(E,(f,F)=>{F&&(F.off("style.load",Ct),F.off("load",Ct),F.off("idle",Uo)),$e.value=!1,f&&(f.on("load",Ct),f.on("style.load",Ct),f.on("idle",Uo),typeof f.isStyleLoaded=="function"&&f.isStyleLoaded()&&Ct())}),e.watch(W,f=>{!E.value||!f||Ht.value||y(f)}),e.watch(()=>n.zoom,f=>{!E.value||typeof f!="number"||D(f)}),e.onBeforeUnmount(()=>{Z.value&&B&&B(Z.value),se.value?nt(se.value):E.value&&nt(E.value);const f=E.value;f&&(om(f),f.off("style.load",Ct),f.off("load",Ct),f.off("idle",Uo))});function rm(f){f&&(ee.value=f)}function im(f){Be.value=f}v.setBasemap=rm,v.toggleGeometry=im,v.setOverlays?.(jt.value);function Wo(f){if(!f)return null;if(f.type==="FeatureCollection")return f;if(f.type==="Feature")return{type:"FeatureCollection",features:[f]};const F=f.geometry??f;if(!F?.type)return null;if(F.type==="GeometryCollection"&&Array.isArray(F.geometries)){const U=F.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return U.length?{type:"FeatureCollection",features:U}:null}if(F.type==="MultiPoint"&&Array.isArray(F.coordinates)){const U=F.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return U.length?{type:"FeatureCollection",features:U}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:F}]}}function Fr(f){if(!f?.features?.length)return null;let F=1/0,U=1/0,Y=-1/0,ye=-1/0;const Ue=Ut=>{if(typeof Ut[0]=="number"){const[St,Pr]=Ut;F=Math.min(F,St),U=Math.min(U,Pr),Y=Math.max(Y,St),ye=Math.max(ye,Pr);return}Ut.forEach(St=>Ue(St))};return f.features.forEach(Ut=>{const St=Ut?.geometry?.coordinates;St&&Ue(St)}),F===1/0||U===1/0?null:[F,U,Y,ye]}return(f,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(pt.value),style:e.normalizeStyle(he.value?void 0:me.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:_,class:e.normalizeClass(wt.value)},null,2),e.createVNode(dl,{items:zt.value},null,8,["items"]),P("search")?(e.openBlock(),e.createBlock(Bl,{key:0})):e.createCommentVNode("",!0),P("home")||P("fullscreen")?(e.openBlock(),e.createElementBlock("div",Al,[P("home")?(e.openBlock(),e.createElementBlock("div",Dl,[e.createVNode(fs,{center:j.value,zoom:b.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(fs,{key:0,"target-center":Je.value,"target-zoom":b.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),P("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:Ho,"aria-label":he.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...F[0]||(F[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,Il)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Pe.value?(e.openBlock(),e.createElementBlock("div",Ol,[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:je},[...F[1]||(F[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",Ml,e.toDisplayString(Pe.value.title||"Об'єкт"),1),Pe.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(${me.value.height}-120px)]`]),innerHTML:Pe.value.html},null,10,Fl)):(e.openBlock(),e.createElementBlock("div",Pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.rows,U=>(e.openBlock(),e.createElementBlock("div",{key:U.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",Rl,e.toDisplayString(U.label)+":",1),e.createElementVNode("span",zl,e.toDisplayString(U.value),1)]))),128))])),Pe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",jl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.actions,U=>(e.openBlock(),e.createElementBlock("a",{key:U.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:U.url,target:U.target??void 0,rel:"noreferrer"},e.toDisplayString(U.label),9,Hl))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(ll),P("position")&&X.value?(e.openBlock(),e.createBlock(ul,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:X.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}}),Wl={class:"text-sm text-gray-600"},ql={key:0,class:"inline-flex items-center gap-1"},Kl={class:"mt-2 border border-neutral-200 rounded-lg overflow-hidden bg-neutral-50"},Gl={key:0,class:"grid grid-cols-2 divide-x divide-neutral-200"},Zl={class:"p-3"},Yl={key:0,class:"geom-change-mini-map h-[120px] rounded border border-neutral-100 overflow-hidden",style:{"min-height":"120px"}},Jl={key:1,class:"h-[120px] rounded border border-neutral-100 flex items-center justify-center bg-white text-xs text-gray-400"},Xl={class:"p-3"},Ql={key:0,class:"geom-change-mini-map h-[120px] rounded border border-neutral-100 overflow-hidden",style:{"min-height":"120px"}},Vl={key:1,class:"h-[120px] rounded border border-neutral-100 flex items-center justify-center bg-white text-xs text-gray-400"},ea=Xe(e.defineComponent({__name:"GeomChange",props:{oldWkt:{default:null},newWkt:{default:null}},setup(t){const n=t,o=e.ref(!1),s=e.computed(()=>ns(n.oldWkt)),r=e.computed(()=>ns(n.newWkt)),i=e.computed(()=>{const g=n.oldWkt;return g==null||String(g).trim()===""?!1:!s.value}),l=e.computed(()=>{const g=n.newWkt;return g==null||String(g).trim()===""?!1:!r.value}),a=e.computed(()=>rs(s.value)),c=e.computed(()=>rs(r.value)),d=e.computed(()=>s.value?ss(s.value):null),u=e.computed(()=>r.value?ss(r.value):null),p=e.computed(()=>Ai(d.value,u.value)),m=e.computed(()=>{const g=Di(s.value,r.value);return g>0?g:null}),S=e.computed(()=>Ii(s.value,r.value)),w=e.computed(()=>{const g=m.value;return g==null?"":g===1?"вершина змінена":g>=2&&g<=4?"вершини змінено":"вершин змінено"});return(g,x)=>(e.openBlock(),e.createElementBlock("div",Wl,[e.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-800 transition-colors py-1 mt-1",onClick:x[0]||(x[0]=_=>o.value=!o.value)},[e.createVNode(e.unref(Ko),{class:e.normalizeClass(["w-3.5 h-3.5",{"rotate-180":o.value}]),"stroke-width":1.5},null,8,["class"]),x[2]||(x[2]=e.createElementVNode("span",{class:"font-medium"},"Переглянути зміни геометрії",-1)),m.value!=null?(e.openBlock(),e.createElementBlock("span",ql,[x[1]||(x[1]=e.createElementVNode("span",{class:"w-1.5 h-1.5 rounded-full bg-rose-950"},null,-1)),e.createTextVNode(" "+e.toDisplayString(m.value)+" "+e.toDisplayString(w.value),1)])):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("div",Kl,[o.value?(e.openBlock(),e.createElementBlock("div",Gl,[e.createElementVNode("div",Zl,[x[3]||(x[3]=e.createElementVNode("div",{class:"text-xs font-medium text-gray-500 mb-2"},"Було",-1)),a.value?(e.openBlock(),e.createElementBlock("div",Yl,[e.createVNode(At,{geom:a.value,bounds:p.value,"highlight-points":S.value.removed,height:"120px",tools:["scale"]},null,8,["geom","bounds","highlight-points"])])):(e.openBlock(),e.createElementBlock("div",Jl,e.toDisplayString(i.value?"Не вдалося прочитати геометрію":"—"),1))]),e.createElementVNode("div",Xl,[x[4]||(x[4]=e.createElementVNode("div",{class:"text-xs font-medium text-gray-500 mb-2"},"Стало",-1)),c.value?(e.openBlock(),e.createElementBlock("div",Ql,[e.createVNode(At,{geom:c.value,bounds:p.value,"highlight-points":S.value.added,height:"120px",tools:["scale"]},null,8,["geom","bounds","highlight-points"])])):(e.openBlock(),e.createElementBlock("div",Vl,e.toDisplayString(l.value?"Не вдалося прочитати геометрію":"—"),1))])])):e.createCommentVNode("",!0)],512),[[e.vShow,o.value]])]))}}),[["__scopeId","data-v-2c0770bb"]]),ta={class:"mx-auto font-sans"},na={class:"bg-white rounded-lg border border-neutral-200 p-4 sm:p-6"},oa={key:0,class:"py-8 text-center text-gray-500 text-sm"},sa={key:1,class:"py-8 text-center text-gray-500 text-sm"},ra={key:2,class:"space-y-6"},ia={class:"flex justify-end"},la={class:"flex items-center gap-2 mb-3 sticky top-0 bg-white py-2 z-20"},aa={class:"text-xs font-semibold text-gray-800 uppercase tracking-wide"},ca={class:"text-xs text-gray-500"},da={class:"relative"},fa={class:"bg-white border border-neutral-200 rounded-lg overflow-hidden divide-y divide-neutral-200"},pa=["onClick"],ua={class:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center"},ma={class:"flex-1 min-w-0 flex items-center gap-2 text-sm"},ha={class:"font-medium text-gray-800"},ga={class:"text-gray-500"},ya={key:0},va=["title"],ba={class:"flex-shrink-0 flex items-center gap-2 text-xs text-gray-500 whitespace-nowrap"},ka={class:"px-4 pb-3 pl-[60px] space-y-2"},Ea={class:"space-y-1.5"},wa={class:"text-gray-500 font-[600] text-[0.92rem] min-w-[80px]"},xa={key:1,class:"flex items-center gap-2"},Na={class:"pl-2 text-gray-500 line-through"},Ca={class:"text-gray-800 font-semibold"},Sa={key:0,class:"mt-4 text-center"},_a={class:"text-xs text-gray-500"},vn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},hideChangesValuesKeys:{},iconSource:{default:"entityType"},showEntityId:{type:Boolean,default:!1},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?[...n.data]:[]),s=e.ref(!1),r=e.reactive({}),i=e.ref(new Map);function l(N){return N?Array.isArray(N)?N:Object.entries(N).map(([C,T],v)=>({changeDataId:`legacy-${v}`,entityKey:C,valueOld:String(T?.old??""),valueNew:String(T?.new??"")})):[]}function a(N){return l(N.changes).length>0}e.onMounted(async()=>{try{const N=await fetch("/api/suggest/change_type");if(!N.ok)return;const C=await N.json(),T=Array.isArray(C)?C:C?.data;if(!Array.isArray(T))return;const v=new Map;for(const E of T)E?.id!=null&&v.set(String(E.id).toLowerCase(),{text:E.text??E.id,icon:E.icon??null});i.value=v}catch{}}),o.value.length===0&&n.id&&W(),e.watch(()=>n.id,()=>{n.id&&W()});function c(N){return ts.get(N)??ts.get("custom")}function d(N){if(n.iconSource==="actionType"){const T=i.value.get((N.action??"").toLowerCase())?.icon;if(T&&T in es)return es[T]}return c(N.entityType)?.icon}const u=e.computed(()=>new Set(n.hideChangesValuesKeys??[]));function p(N){return i.value.get((N??"").toLowerCase())?.text??N??""}function m(N,C=3){const T=l(N.changes).map(E=>E.entityKey);if(T.length===0)return"";const v=T.slice(0,C).join(", ");return T.length>C?`${v} ...`:v}function S(N){try{return new Date(N+"T00:00:00").toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})}catch{return N}}const w=e.computed(()=>{const N=new Map;for(const C of o.value){const T=C.changeDate??C.timestamp?.toLocaleDateString("uk-UA")??"unknown";if(!N.has(T)){const v=C.changeDate?S(C.changeDate):C.timestamp?.toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})??"Без дати";N.set(T,{dateKey:T,dateDisplay:v,rows:[]})}N.get(T).rows.push(C)}return Array.from(N.values()).sort((C,T)=>T.dateKey.localeCompare(C.dateKey))}),g=e.computed(()=>o.value.filter(a).some(N=>!r[N.id]));function x(N){r[N]=!r[N]}function _(){const N=g.value;o.value.forEach(C=>{a(C)&&(r[C.id]=N)})}async function W(){if(n.id){s.value=!0;try{const N=await fetch(`/api/widget/history/${n.id}`);if(!N.ok){o.value=[];return}const T=((await N.json()).rows??[]).map(v=>({id:v.change_id??v.entity_id??"",entityId:v.entity_id??"",entityType:v.entity_type??"custom",action:v.change_type??"",userId:v.change_user_id??"",userName:v.username??"",timestamp:new Date(v.cdate),changeDate:v.change_date,login:v.login,avatar:v.avatar??null,changes:Array.isArray(v.changes)?v.changes.map(E=>({changeDataId:E.change_data_id,entityKey:E.entity_key,valueOld:E.value_old??"",valueNew:E.value_new??""})):[]}));o.value=T}finally{s.value=!1}}}return(N,C)=>(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("div",na,[e.createElementVNode("div",{class:"overflow-y-auto",style:e.normalizeStyle({maxHeight:t.maxHeight?t.maxHeight+"px":"calc(100vh - 320px)"})},[s.value?(e.openBlock(),e.createElementBlock("div",oa," Завантаження... ")):o.value.length===0?(e.openBlock(),e.createElementBlock("div",sa," Немає записів ")):(e.openBlock(),e.createElementBlock("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("button",{onClick:_,class:"flex items-center gap-2 text-sm font-semibold text-gray-800 hover:text-blue-600 transition-colors px-4 py-2 rounded-lg border border-neutral-300 hover:border-blue-500 bg-white hover:shadow-sm"},[e.createVNode(e.unref(Gr),{class:e.normalizeClass(["w-4 h-4",{"rotate-180":g.value}])},null,8,["class"]),e.createElementVNode("span",null,e.toDisplayString(g.value?"Розгорнути всі":"Згорнути всі"),1)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,T=>(e.openBlock(),e.createElementBlock("div",{key:T.dateKey},[e.createElementVNode("div",la,[e.createElementVNode("h3",aa,e.toDisplayString(T.dateDisplay),1),C[0]||(C[0]=e.createElementVNode("div",{class:"flex-1 h-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("span",ca,e.toDisplayString(T.rows.length),1)]),e.createElementVNode("div",da,[C[1]||(C[1]=e.createElementVNode("div",{class:"absolute left-[58px] top-6 bottom-0 w-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.rows,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"hover:bg-neutral-50 transition-colors"},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-3 px-4 py-2.5",{"cursor-pointer":a(v)}]),onClick:E=>a(v)&&x(v.id)},[e.createElementVNode("div",ua,[a(v)?(e.openBlock(),e.createBlock(e.unref(Ko),{key:0,class:e.normalizeClass(["w-3.5 h-3.5 text-gray-500 transition-transform duration-200",{"rotate-180":r[v.id]}]),"stroke-width":"1.5"},null,8,["class"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-8 h-8 rounded-full border-2 border-white shadow-sm flex items-center justify-center relative z-10 ${c(v.entityType)?.color??"bg-gray-100"}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(v)),{class:"w-4 h-4 relative z-10","stroke-width":"1.5"}))],2),e.createElementVNode("div",ma,[e.createElementVNode("span",ha,e.toDisplayString(v.userName),1),e.createElementVNode("span",ga,[e.createTextVNode(e.toDisplayString(p(v.action)),1),m(v)?(e.openBlock(),e.createElementBlock("span",ya,": "+e.toDisplayString(m(v)),1)):e.createCommentVNode("",!0)]),t.showEntityId&&v.entityId?(e.openBlock(),e.createElementBlock("span",{key:0,class:"rounded border border-neutral-300 bg-neutral-50 px-1.5 py-0.5 font-mono text-[0.65rem] text-gray-600 max-w-[140px] truncate",title:v.entityId},e.toDisplayString(v.entityId),9,va)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ba,[e.createElementVNode("span",null,e.toDisplayString(v.timestamp?.toLocaleTimeString("uk-UA",{hour:"2-digit",minute:"2-digit"})),1)])],10,pa),e.withDirectives(e.createElementVNode("div",ka,[e.createElementVNode("div",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l(v.changes),E=>(e.openBlock(),e.createElementBlock("div",{key:E.changeDataId,class:"flex flex-col gap-2 text-sm pl-2"},[e.createElementVNode("span",wa,e.toDisplayString(E.entityKey),1),u.value.has(E.entityKey)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(os)(E.valueOld)||e.unref(os)(E.valueNew)?(e.openBlock(),e.createBlock(ea,{key:0,"old-wkt":E.valueOld,"new-wkt":E.valueNew},null,8,["old-wkt","new-wkt"])):(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("span",Na,e.toDisplayString(E.valueOld),1),e.createVNode(e.unref(Kr),{class:"w-3 h-3 text-neutral-400 flex-shrink-0","stroke-width":"1.5"}),e.createElementVNode("span",Ca,e.toDisplayString(E.valueNew),1)]))],64))]))),128))])],512),[[e.vShow,a(v)&&r[v.id]]])]))),128))])])]))),128))]))],4),!s.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("div",Sa,[e.createElementVNode("p",_a,e.toDisplayString(o.value.length)+" записів",1)])):e.createCommentVNode("",!0)])]))}}),Ba={key:0,class:"text-xl font-semibold"},$a={class:"flex gap-1"},Ta={key:0},La=["accept"],Aa={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"},Da=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{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",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ba,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",$a,[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]=i=>n.value="list")},[e.createVNode(e.unref(ni),{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]=i=>n.value="grid")},[e.createVNode(e.unref(Qr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Ta,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=i=>s.$emit("onAddFile",i))},null,40,La),e.createElementVNode("div",Aa,[e.createVNode(e.unref(Yo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Yn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:_t,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:li,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:_t,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:qr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Zo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Zo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:_t,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:_t,label:"PPT"}};function ps(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function us(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 Ia={class:"space-y-0.5"},Oa=["onClick"],Ma=["onClick"],Fa={class:"flex items-center gap-2"},Pa={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Ra={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},za={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},ja={class:"flex items-center gap-1"},Ha=["onClick"],Ua=["onClick"],Wa=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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(Yn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Yn)[s?.ext]?.icon||e.unref(Yn).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",Fa,[e.createElementVNode("span",Pa,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Ma),e.createElementVNode("div",Ra,e.toDisplayString(e.unref(us)(s.size)),1),e.createElementVNode("div",za,e.toDisplayString(e.unref(ps)(s.createdAt)),1),e.createElementVNode("div",ja,[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(Go),{class:"h-3 w-3"})],8,Ha),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(fn),{class:"h-3 w-3"})],8,Ua)])],8,Oa))),128))]))}}),qa={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Ka=["onClick"],Ga={class:"space-y-2"},Za={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Ya=["src"],Ja={class:"space-y-1"},Xa=["title"],Qa={class:"text-xs text-gray-500 text-left"},Va={class:"absolute top-2 right-1 flex items-center gap-1"},ec=["onClick"],tc=["onClick"],nc=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",Ga,[e.createElementVNode("div",Za,[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,Ya)):(e.openBlock(),e.createBlock(e.unref(_t),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ja,[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,Xa),e.createElementVNode("p",Qa,e.toDisplayString(e.unref(ps)(s.createdAt))+", "+e.toDisplayString(e.unref(us)(s.size)),1)])]),e.createElementVNode("div",Va,[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(Go),{class:"h-3 w-3"})],8,ec),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(fn),{class:"h-3 w-3"})],8,tc)])],8,Ka))),128))]))}}),oc={class:"mx-auto font-sans"},sc={key:1},bn=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{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),i=e.ref(!1),l=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const y=(o.format??[]).map(R=>typeof R=="string"?R.trim():R==null?"":String(R).trim()).filter(R=>R.length>0),D=[];return y.forEach(R=>{const H=R.toLowerCase(),K=H.indexOf("/"),G=K>=0;let I,z=!1,B;if(G){I=H;const ee=H.slice(K+1);z=ee==="*",!z&&ee&&(B=`.${ee.replace(/^\.+/,"")}`)}else B=H.startsWith(".")?H:`.${H.replace(/^\.+/,"")}`;const q=G?I:B??"";q&&D.push({acceptValue:q,mime:I,wildcard:z,extension:B})}),D.length?D:null}),d=e.computed(()=>{const E=c.value;if(!E)return;const y=E.map(D=>D.acceptValue).filter(Boolean);return y.length?y.join(","):void 0}),u=E=>{if(!c.value)return!0;const y=E.type?.toLowerCase(),D=E.name?.toLowerCase();return c.value.some(R=>{if(R.mime){if(y){if(R.wildcard){const H=R.mime.split("/")[0];if(y.startsWith(`${H}/`))return!0}else if(y===R.mime)return!0}return!!(R.extension&&D?.endsWith(R.extension))}return!!(R.extension&&D?.endsWith(R.extension))})},p=n;a.value.length===0&&C();const m=(E,y)=>{r.value=y,s.value=!0},S=()=>{r.value&&(_(r.value),r.value=null,s.value=!1)},w=e.computed(()=>Array.isArray(a.value)?a.value.map(E=>E?.file_path):[]),g=E=>{const y=w.value.findIndex(D=>D===E.file_path);y!==-1&&(i.value=!0,l.value=y)},x=E=>{o.onAddFile?o.onAddFile(E):T(E),p("add",E)},_=E=>{o.onDelete?o.onDelete(E):v(E),p("delete",E)},W=E=>{const y=document.createElement("a");y.setAttribute("download",E?.uploaded_name||E?.name),y.href=E?.file_path||E?.path,y.click()},N=e.ref(o.view==="grid"?"grid":"list");async function C(){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 T=async E=>{const D=E.target?.files;if(!D||D.length===0)return;const R=Array.from(D),H=[],K=[];if(R.forEach(G=>{u(G)?H.push(G):K.push(G)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(G=>G.name).join(", ")}`),H.length!==0)try{await Promise.all(H.map(async G=>{const I=new FormData;I.append("file",G);const z=`/api/widget/file/${o.id}`,B=await fetch(z,{method:"POST",body:I});if(!B.ok)throw new Error(`HTTP error! status: ${B.status}`);return G})),await C()}catch(G){console.error("Помилка при завантаженні файлів:",G)}},v=async E=>{try{await fetch(`/api/widget/file/${o.id}/${E}`,{method:"DELETE"}),await C()}catch(y){console.error(y)}};return(E,y)=>{const D=e.resolveComponent("MessageBox"),R=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",oc,[e.createVNode(Da,{modelValue:N.value,"onUpdate:modelValue":y[0]||(y[0]=H=>N.value=H),title:o.title,onOnAddFile:y[1]||(y[1]=H=>x(H)),editable:o.editable,accept:d.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[N.value==="list"?(e.openBlock(),e.createBlock(Wa,{key:0,onDelete:m,onDownload:W,onOpenLightbox:y[2]||(y[2]=H=>g(H)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),N.value==="grid"?(e.openBlock(),e.createBlock(nc,{key:1,onDelete:m,onDownload:W,onOpenLightbox:y[3]||(y[3]=H=>g(H)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",sc,[...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(D,{modelValue:s.value,"onUpdate:modelValue":y[4]||(y[4]=H=>s.value=H),onConfirm:S,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(R,{modelValue:i.value,"onUpdate:modelValue":y[5]||(y[5]=H=>i.value=H),images:w.value,"start-index":l.value},null,8,["modelValue","images","start-index"])],64)}}}),rc={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},ic=["onClick"],lc={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ac=["src"],cc={key:0,class:"thumb-cover"},dc=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},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),i=t,l=e.computed(()=>Array.isArray(i.items)?i.items.map(c=>c?.file_path):[]),a=c=>{const d=l.value.findIndex(u=>u===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const u=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(p,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+m,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:m,onClick:e.withModifiers(S=>a(p),["stop"])},[m<5?(e.openBlock(),e.createElementBlock("div",lc,[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]",m===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,ac),m===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",cc," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,ic))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(t.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(u,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),images:l.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)}}}),fc={key:0,class:"text-xl font-semibold"},pc={class:"flex gap-1"},uc=["accept"],mc={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"},hc=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},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",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",fc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",pc,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,uc),e.createElementVNode("div",mc,[e.createVNode(e.unref(Yo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),gc={class:"w-full mx-auto font-sans",ref:"containerRef"},yc={key:1},kn=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=C=>{if(!C)return[];const T=Array.isArray(C)?C:C.split(",");return Array.from(new Set(T.map(v=>v.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],i=e.computed(()=>{const C=s(o.format);return C.length>0?C:void 0}),l=e.computed(()=>{const C=i.value;return!C||C.length===0?"image/*":C.map(T=>T.startsWith(".")?T:`.${T}`).join(",")}),a=C=>C?.split(".").pop()?.toLowerCase()??"",c=C=>{const T=C?.toLowerCase();return!!T&&!!i.value&&i.value.includes(T)},d=C=>{const T=C?.toLowerCase();return!!T&&r.includes(T)},u=C=>{const T=C.type?.toLowerCase(),v=C.ext?.toLowerCase();return T?.startsWith("image/")?i.value?c(v):!0:v?i.value?c(v):d(v):!1},p=C=>{if(!C.type?.toLowerCase()?.startsWith("image/"))return!1;if(!i.value)return!0;const v=a(C.name);return c(v)},m=C=>C.filter(u),S=e.ref(m(o.items??[])),w=n;S.value.length===0&&W();const g=C=>{o.onAddImage?o.onAddImage(C):_(C),w("add",C)},x=C=>{const T=S.value.find(v=>v.file_path===C)?.file_id;T&&(o.onDelete?o.onDelete(T):N(T))},_=async C=>{const T=C.target;if(!T?.files||T.files.length===0)return;const v=Array.from(T.files),E=v.filter(D=>p(D)),y=i.value?.join(", ")??"image/*";if(E.length===0){console.warn(`Допустимі формати: ${y}. Завантажте зображення дозволеного типу.`);return}E.length!==v.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${y}.`);try{await Promise.all(E.map(async D=>{const R=new FormData;R.append("file",D);const H=`/api/widget/file/${o.id}`,K=await fetch(H,{method:"POST",body:R});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return D})),await W()}catch(D){console.error("Помилка при завантаженні файлів:",D)}};async function W(){if(!o.id)return;const C=await fetch(`/api/widget/file/${o.id}`).then(T=>T.json());S.value=m(C.rows)}const N=async C=>{try{await fetch(`/api/widget/file/${o.id}/${C}`,{method:"DELETE"}),await W()}catch(T){console.error(T)}};return(C,T)=>(e.openBlock(),e.createElementBlock("div",gc,[e.createVNode(hc,{title:t.title,accept:l.value,onOnAddImage:T[0]||(T[0]=v=>g(v))},null,8,["title","accept"]),S.value.length>0?(e.openBlock(),e.createBlock(dc,{key:0,items:S.value,onDelete:T[1]||(T[1]=v=>x(v))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",yc,[...T[2]||(T[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),vc={class:"text-value"},bc={class:"text-sm text-gray-900"},kc=Xe(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",vc,[e.createElementVNode("span",bc,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-c14550b7"]]),Ec={class:"link-value"},wc=["href"],xc=Xe(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",Ec,[e.createElementVNode("a",{href:String(t.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,wc)]))}}),[["__scopeId","data-v-e6eb07a6"]]),Nc={class:"date-value"},Cc={class:"text-sm text-gray-900"},Sc=Xe(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",Nc,[e.createElementVNode("span",Cc,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),_c={class:"status-value"},Bc={key:0,class:"mr-1"},$c=Xe(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,i)=>(e.openBlock(),e.createElementBlock("div",_c,[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",Bc,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),Tc={class:"custom-value"},Lc={class:"text-sm text-gray-900"},Ac=Xe(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Lc,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),Dc=["id"],Ic={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Oc={key:1,class:"overflow-x-auto"},Mc={class:"min-w-full divide-y divide-gray-200"},Fc={class:"bg-white divide-y divide-gray-200"},Pc={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Rc={class:"flex items-center gap-2"},zc=["title"],jc={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Hc={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Uc={class:"flex items-start gap-3"},Wc={key:0,class:"flex-shrink-0"},qc={class:"flex-1 min-w-0"},Kc={class:"flex items-center gap-2 mb-2"},Gc={class:"text-sm font-medium text-gray-900"},Zc=["title"],Yc={key:3,class:"overflow-x-auto"},Jc={class:"min-w-full divide-y divide-gray-200"},Xc={class:"bg-white divide-y divide-gray-200"},Qc={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Vc={class:"flex items-center gap-2"},ed=["title"],td={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Jn=Xe(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return xc;case"date":return Sc;case"status":return $c;case"custom":return Ac;default:return kc}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",Ic,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("table",Mc,[e.createElementVNode("tbody",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Pc,[e.createElementVNode("div",Rc,[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,zc)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",jc,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.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",Uc,[r.icon?(e.openBlock(),e.createElementBlock("div",Wc,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",qc,[e.createElementVNode("div",Kc,[e.createElementVNode("h4",Gc,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,Zc)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Yc,[e.createElementVNode("table",Jc,[e.createElementVNode("tbody",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",Qc,[e.createElementVNode("div",Vc,[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,ed)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",td,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Dc))}}),[["__scopeId","data-v-36d43e50"]]);function Ze(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const nd=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Xn=()=>{},En=()=>!1,Qn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),it=Object.assign,Qe=Array.isArray,ke=t=>typeof t=="string",Vn=t=>typeof t=="symbol",od=t=>t!==null&&typeof t=="object",ms=Ze(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),sd=Ze("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),eo=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},rd=/-\w/g,lt=eo(t=>t.replace(rd,n=>n.slice(1).toUpperCase())),to=eo(t=>t.charAt(0).toUpperCase()+t.slice(1)),id=eo(t=>t?`on${to(t)}`:""),Gt={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"},ld={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},ad=/;(?![^(]*\))/g,cd=/:([^]+)/,dd=/\/\*[^]*?\*\//g;function fd(t){const n={};return t.replace(dd,"").split(ad).forEach(o=>{if(o){const s=o.split(cd);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const pd="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",ud="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",md="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",hd="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",gd=Ze(pd),yd=Ze(ud),vd=Ze(md),bd=Ze(hd);const Zt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Yt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),no=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),wn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),hs=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ht=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),gs=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ys=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),oo=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),so=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),Jt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),ro=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),vs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),io=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),lo=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),ao=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),co=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),po=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),bs=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ks=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),xn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),Nn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),uo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),mo=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Xt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Qt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),ho=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),go=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),kd=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),yo=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),Cn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Ed=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),wd=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),vo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),xd=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Nd=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),bo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),Es=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Dt={[Zt]:"Fragment",[Yt]:"Teleport",[no]:"Suspense",[wn]:"KeepAlive",[hs]:"BaseTransition",[ht]:"openBlock",[gs]:"createBlock",[ys]:"createElementBlock",[oo]:"createVNode",[so]:"createElementVNode",[Jt]:"createCommentVNode",[ro]:"createTextVNode",[vs]:"createStaticVNode",[io]:"resolveComponent",[lo]:"resolveDynamicComponent",[ao]:"resolveDirective",[co]:"resolveFilter",[fo]:"withDirectives",[po]:"renderList",[bs]:"renderSlot",[ks]:"createSlots",[xn]:"toDisplayString",[Nn]:"mergeProps",[uo]:"normalizeClass",[mo]:"normalizeStyle",[Xt]:"normalizeProps",[Qt]:"guardReactiveProps",[ho]:"toHandlers",[go]:"camelize",[kd]:"capitalize",[yo]:"toHandlerKey",[Cn]:"setBlockTracking",[Ed]:"pushScopeId",[wd]:"popScopeId",[vo]:"withCtx",[xd]:"unref",[Nd]:"isRef",[bo]:"withMemo",[Es]:"isMemoSame"};function Cd(t){Object.getOwnPropertySymbols(t).forEach(n=>{Dt[n]=t[n]})}const Oe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Sd(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 Vt(t,n,o,s,r,i,l,a=!1,c=!1,d=!1,u=Oe){return t&&(a?(t.helper(ht),t.helper(Mt(t.inSSR,d))):t.helper(Ot(t.inSSR,d)),l&&t.helper(fo)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:i,directives:l,isBlock:a,disableTracking:c,isComponent:d,loc:u}}function gt(t,n=Oe){return{type:17,loc:n,elements:t}}function ze(t,n=Oe){return{type:15,loc:n,properties:t}}function ue(t,n){return{type:16,loc:Oe,key:ke(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Oe,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function We(t,n=Oe){return{type:8,loc:n,children:t}}function be(t,n=[],o=Oe){return{type:14,loc:o,callee:t,arguments:n}}function It(t,n=void 0,o=!1,s=!1,r=Oe){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ko(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Oe}}function _d(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Oe}}function Bd(t){return{type:21,body:t,loc:Oe}}function Ot(t,n){return t||n?oo:so}function Mt(t,n){return t||n?gs:ys}function Eo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Ot(s,t.isComponent)),n(ht),n(Mt(s,t.isComponent)))}const ws=new Uint8Array([123,123]),xs=new Uint8Array([125,125]);function Ns(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 at(t){return t===47||t===62||Me(t)}function Sn(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 $d{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=ws,this.delimiterClose=xs,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=ws,this.delimiterClose=xs}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let i=-1;if(r>100){let l=-1,a=r;for(;l+1<a;){const c=l+a>>>1;this.newlines[c]<n?l=c:a=c}i=l}else for(let l=r-1;l>=0;l--)if(n>this.newlines[l]){i=l;break}return i>=0&&(o=i+2,s=n-this.newlines[i]),{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?at(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):Ns(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){at(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(at(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(Sn("</"+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=Ns(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||at(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||at(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||at(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||at(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||at(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 Td={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 wo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function ct(t,n){const o=wo("MODE",n),s=wo(t,n);return o===3?s===!0:s!==!1}function Ft(t,n,o,...s){const r=ct(t,n);return process.env.NODE_ENV!=="production"&&r&&_n(t,n,o,...s),r}function _n(t,n,o,...s){if(wo(t,n)==="suppress-warning")return;const{message:i,link:l}=Td[t],a=`(deprecation ${t}) ${typeof i=="function"?i(...s):i}${l?`
2
+ Details: ${l}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function xo(t){throw t}function Cs(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function oe(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||Ld)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,i=new SyntaxError(String(r));return i.code=t,i.loc=n,i}const Ld={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 '&lt;' 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.",53:"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.
3
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"v-model cannot be used on a const binding because it is not writable.",46:"Error parsing JavaScript expression: ",47:"<KeepAlive> expects exactly one child component.",52:"@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.",48:'"prefixIdentifiers" option is not supported in this build of compiler.',49:"ES module mode is not supported in this build of compiler.",50:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',51:'"scopeId" option is only supported in module mode.',54:""},Le=t=>t.type===4&&t.isStatic;function Ss(t){switch(t){case"Teleport":case"teleport":return Yt;case"Suspense":case"suspense":return no;case"KeepAlive":case"keep-alive":return wn;case"BaseTransition":case"base-transition":return hs}}const Ad=/^$|^\d|[^\$\w\xA0-\uFFFF]/,No=t=>!Ad.test(t),_s=/[A-Za-z_$\xA0-\uFFFF]/,Dd=/[\.\?\w$\xA0-\uFFFF]/,Id=/\s+[.[]\s*|\s*[.[]\s+/g,Bs=t=>t.type===4?t.content:t.loc.source,$s=t=>{const n=Bs(t).trim().replace(Id,a=>a.trim());let o=0,s=[],r=0,i=0,l=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,i++;else if(!(a===0?_s:Dd).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,l=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,l=c;else if(c==="(")i++;else if(c===")"){if(a===n.length-1)return!1;--i||(o=s.pop())}break;case 3:c===l&&(o=s.pop(),l=null);break}}return!r&&!i},Od=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Md=t=>Od.test(Bs(t));function Ts(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Ae(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 en(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const i=t.props[r];if(i.type===6){if(o)continue;if(i.name===n&&(i.value||s))return i}else if(i.name==="bind"&&(i.exp||s)&&dt(i.arg,n))return i}}function dt(t,n){return!!(t&&Le(t)&&t.content===n)}function Fd(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function Co(t){return t.type===5||t.type===2}function Ls(t){return t.type===7&&t.name==="pre"}function Pd(t){return t.type===7&&t.name==="slot"}function Bn(t){return t.type===1&&t.tagType===3}function $n(t){return t.type===1&&t.tagType===2}const Rd=new Set([Xt,Qt]);function As(t,n=[]){if(t&&!ke(t)&&t.type===14){const o=t.callee;if(!ke(o)&&Rd.has(o))return As(t.arguments[0],n.concat(t))}return[t,n]}function Tn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],i=[],l;if(r&&!ke(r)&&r.type===14){const a=As(r);r=a[0],i=a[1],l=i[i.length-1]}if(r==null||ke(r))s=ze([n]);else if(r.type===14){const a=r.arguments[0];!ke(a)&&a.type===15?Ds(n,a)||a.properties.unshift(n):r.callee===ho?s=be(o.helper(Nn),[ze([n]),r]):r.arguments.unshift(ze([n])),!s&&(s=r)}else r.type===15?(Ds(n,r)||r.properties.unshift(n),s=r):(s=be(o.helper(Nn),[ze([n]),r]),l&&l.callee===Qt&&(l=i[i.length-2]));t.type===13?l?l.arguments[0]=s:t.props=s:l?l.arguments[0]=s:t.arguments[2]=s}function Ds(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 tn(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function zd(t){return t.type===14&&t.callee===bo?t.arguments[1].returns:t}const jd=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Is(t){for(let n=0;n<t.length;n++)if(!Me(t.charCodeAt(n)))return!1;return!0}function So(t){return t.type===2&&Is(t.content)||t.type===12&&So(t.content)}function _o(t){return t.type===3||So(t)}const Os={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:En,isPreTag:En,isIgnoreNewlineTag:En,isCustomElement:En,onError:xo,onWarn:Cs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let te=Os,nn=null,Ve="",Se=null,V=null,De="",et=-1,yt=-1,Bo=0,ft=!1,$o=null;const de=[],ce=new $d(de,{onerr:Ie,ontext(t,n){Ln(xe(t,n),t,n)},ontextentity(t,n,o){Ln(t,n,o)},oninterpolation(t,n){if(ft)return Ln(xe(t,n),t,n);let o=t+ce.delimiterOpen.length,s=n-ce.delimiterClose.length;for(;Me(Ve.charCodeAt(o));)o++;for(;Me(Ve.charCodeAt(s-1));)s--;let r=xe(o,s);r.includes("&")&&(r=te.decodeEntities(r,!1)),To({type:5,content:Dn(r,!1,fe(o,s)),loc:fe(t,n)})},onopentagname(t,n){const o=xe(t,n);Se={type:1,tag:o,ns:te.getNamespace(o,de[0],te.ns),tagType:0,props:[],children:[],loc:fe(t-1,n),codegenNode:void 0}},onopentagend(t){Fs(t)},onclosetag(t,n){const o=xe(t,n);if(!te.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Ie(24,de[0].loc.start.offset);for(let l=0;l<=r;l++){const a=de.shift();An(a,n,l<r)}break}s||Ie(23,Ps(t,60))}},onselfclosingtag(t){const n=Se.tag;Se.isSelfClosing=!0,Fs(t),de[0]&&de[0].tag===n&&An(de.shift(),t)},onattribname(t,n){V={type:6,name:xe(t,n),nameLoc:fe(t,n),value:void 0,loc:fe(t)}},ondirname(t,n){const o=xe(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!ft&&s===""&&Ie(26,t),ft||s==="")V={type:6,name:o,nameLoc:fe(t,n),value:void 0,loc:fe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:fe(t)},s==="pre"){ft=ce.inVPre=!0,$o=Se;const r=Se.props;for(let i=0;i<r.length;i++)r[i].type===7&&(r[i]=Xd(r[i]))}},ondirarg(t,n){if(t===n)return;const o=xe(t,n);if(ft&&!Ls(V))V.name+=o,vt(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Dn(s?o:o.slice(1,-1),s,fe(t,n),s?3:0)}},ondirmodifier(t,n){const o=xe(t,n);if(ft&&!Ls(V))V.name+="."+o,vt(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,vt(s.loc,n))}else{const s=Q(o,!0,fe(t,n));V.modifiers.push(s)}},onattribdata(t,n){De+=xe(t,n),et<0&&(et=t),yt=n},onattribentity(t,n,o){De+=t,et<0&&(et=n),yt=o},onattribnameend(t){const n=V.loc.start.offset,o=xe(n,t);V.type===7&&(V.rawName=o),Se.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Ie(2,n)},onattribend(t,n){if(Se&&V){if(vt(V.loc,n),t!==0)if(De.includes("&")&&(De=te.decodeEntities(De,!0)),V.type===6)V.name==="class"&&(De=js(De).trim()),t===1&&!De&&Ie(13,n),V.value={type:2,content:De,loc:t===1?fe(et,yt):fe(et-1,yt+1)},ce.inSFCRoot&&Se.tag==="template"&&V.name==="lang"&&De&&De!=="html"&&ce.enterRCDATA(Sn("</template"),0);else{let o=0;V.exp=Dn(De,!1,fe(et,yt),0,o),V.name==="for"&&(V.forParseResult=Ud(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&Ft("COMPILER_V_BIND_SYNC",te,V.loc,V.arg.loc.source)&&(V.name="model",V.modifiers.splice(s,1))}(V.type!==7||V.name!=="pre")&&Se.props.push(V)}De="",et=yt=-1},oncomment(t,n){te.comments&&To({type:3,content:xe(t,n),loc:fe(t-4,n+3)})},onend(){const t=Ve.length;if(process.env.NODE_ENV!=="production"&&ce.state!==1)switch(ce.state){case 5:case 8:Ie(5,t);break;case 3:case 4:Ie(25,ce.sectionStart);break;case 28:ce.currentSequence===we.CdataEnd?Ie(6,t):Ie(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:Ie(9,t);break}for(let n=0;n<de.length;n++)An(de[n],t-1),Ie(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?Ln(xe(t,n),t,n):Ie(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:te.ns)===0&&Ie(21,t-1)}}),Ms=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Hd=/^\(|\)$/g;function Ud(t){const n=t.loc,o=t.content,s=o.match(jd);if(!s)return;const[,r,i]=s,l=(p,m,S=!1)=>{const w=n.start.offset+m,g=w+p.length;return Dn(p,!1,fe(w,g),0,S?1:0)},a={source:l(i.trim(),o.indexOf(i,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(Hd,"").trim();const d=r.indexOf(c),u=c.match(Ms);if(u){c=c.replace(Ms,"").trim();const p=u[1].trim();let m;if(p&&(m=o.indexOf(p,d+c.length),a.key=l(p,m,!0)),u[2]){const S=u[2].trim();S&&(a.index=l(S,o.indexOf(S,a.key?m+p.length:d+c.length),!0))}}return c&&(a.value=l(c,d,!0)),a}function xe(t,n){return Ve.slice(t,n)}function Fs(t){ce.inSFCRoot&&(Se.innerLoc=fe(t+1,t+1)),To(Se);const{tag:n,ns:o}=Se;o===0&&te.isPreTag(n)&&Bo++,te.isVoidTag(n)?An(Se,t):(de.unshift(Se),(o===1||o===2)&&(ce.inXML=!0)),Se=null}function Ln(t,n,o){{const i=de[0]&&de[0].tag;i!=="script"&&i!=="style"&&t.includes("&")&&(t=te.decodeEntities(t,!1))}const s=de[0]||nn,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,vt(r.loc,o)):s.children.push({type:2,content:t,loc:fe(n,o)})}function An(t,n,o=!1){o?vt(t.loc,Ps(n,60)):vt(t.loc,Wd(n,62)+1),ce.inSFCRoot&&(t.children.length?t.innerLoc.end=it({},t.children[t.children.length-1].loc.end):t.innerLoc.end=it({},t.innerLoc.start),t.innerLoc.source=xe(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:i}=t;if(ft||(s==="slot"?t.tagType=2:Rs(t)?t.tagType=3:Kd(t)&&(t.tagType=1)),ce.inRCDATA||(t.children=zs(i)),r===0&&te.isIgnoreNewlineTag(s)){const l=i[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}r===0&&te.isPreTag(s)&&Bo--,$o===t&&(ft=ce.inVPre=!1,$o=null),ce.inXML&&(de[0]?de[0].ns:te.ns)===0&&(ce.inXML=!1);{const l=t.props;if(process.env.NODE_ENV!=="production"&&ct("COMPILER_V_IF_V_FOR_PRECEDENCE",te)){let c=!1,d=!1;for(let u=0;u<l.length;u++){const p=l[u];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){_n("COMPILER_V_IF_V_FOR_PRECEDENCE",te,t.loc);break}}}if(!ce.inSFCRoot&&ct("COMPILER_NATIVE_TEMPLATE",te)&&t.tag==="template"&&!Rs(t)){process.env.NODE_ENV!=="production"&&_n("COMPILER_NATIVE_TEMPLATE",te,t.loc);const c=de[0]||nn,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=l.find(c=>c.type===6&&c.name==="inline-template");a&&Ft("COMPILER_INLINE_TEMPLATE",te,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 Wd(t,n){let o=t;for(;Ve.charCodeAt(o)!==n&&o<Ve.length-1;)o++;return o}function Ps(t,n){let o=t;for(;Ve.charCodeAt(o)!==n&&o>=0;)o--;return o}const qd=new Set(["if","else","else-if","for","slot"]);function Rs({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&qd.has(n[o].name))return!0}return!1}function Kd({tag:t,props:n}){if(te.isCustomElement(t))return!1;if(t==="component"||Gd(t.charCodeAt(0))||Ss(t)||te.isBuiltInComponent&&te.isBuiltInComponent(t)||te.isNativeTag&&!te.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(Ft("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}}else if(s.name==="bind"&&dt(s.arg,"is")&&Ft("COMPILER_IS_ON_ELEMENT",te,s.loc))return!0}return!1}function Gd(t){return t>64&&t<91}const Zd=/\r\n/g;function zs(t){const n=te.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(Bo)r.content=r.content.replace(Zd,`
4
+ `);else if(Is(r.content)){const i=t[s-1]&&t[s-1].type,l=t[s+1]&&t[s+1].type;!i||!l||n&&(i===3&&(l===3||l===1)||i===1&&(l===3||l===1&&Yd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=js(r.content))}return o?t.filter(Boolean):t}function Yd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function js(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 To(t){(de[0]||nn).children.push(t)}function fe(t,n){return{start:ce.getPos(t),end:n==null?n:ce.getPos(n),source:n==null?n:xe(t,n)}}function Jd(t){return fe(t.start.offset,t.end.offset)}function vt(t,n){t.end=ce.getPos(n),t.source=xe(t.start.offset,n)}function Xd(t){const n={type:6,name:t.rawName,nameLoc:fe(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 Dn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Ie(t,n,o){te.onError(oe(t,fe(n,n),void 0,o))}function Qd(){ce.reset(),Se=null,V=null,De="",et=-1,yt=-1,de.length=0}function Vd(t,n){if(Qd(),Ve=t,te=it({},Os),n){let r;for(r in n)n[r]!=null&&(te[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!te.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");ce.mode=te.parseMode==="html"?1:te.parseMode==="sfc"?2:0,ce.inXML=te.ns===1||te.ns===2;const o=n&&n.delimiters;o&&(ce.delimiterOpen=Sn(o[0]),ce.delimiterClose=Sn(o[1]));const s=nn=Sd([],t);return ce.parse(Ve),s.loc=fe(0,t.length),s.children=zs(s.children),nn=null,s}function ef(t,n){In(t,void 0,n,!!Hs(t))}function Hs(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!$n(n[0])?n[0]:null}function In(t,n,o,s=!1,r=!1){const{children:i}=t,l=[];for(let u=0;u<i.length;u++){const p=i[u];if(p.type===1&&p.tagType===0){const m=s?0:Fe(p,o);if(m>0){if(m>=2){p.codegenNode.patchFlag=-1,l.push(p);continue}}else{const S=p.codegenNode;if(S.type===13){const w=S.patchFlag;if((w===void 0||w===512||w===1)&&Ws(p,o)>=2){const g=qs(p);g&&(S.props=o.hoist(g))}S.dynamicProps&&(S.dynamicProps=o.hoist(S.dynamicProps))}}}else if(p.type===12&&(s?0:Fe(p,o))>=2){p.codegenNode.type===14&&p.codegenNode.arguments.length>0&&p.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Gt[-1]} */`:"")),l.push(p);continue}if(p.type===1){const m=p.tagType===1;m&&o.scopes.vSlot++,In(p,t,o,!1,r),m&&o.scopes.vSlot--}else if(p.type===11)In(p,t,o,p.children.length===1,!0);else if(p.type===9)for(let m=0;m<p.branches.length;m++)In(p.branches[m],t,o,p.branches[m].children.length===1,r)}let a=!1;if(l.length===i.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Qe(t.codegenNode.children))t.codegenNode.children=c(gt(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Qe(t.codegenNode.children)&&t.codegenNode.children.type===15){const u=d(t.codegenNode,"default");u&&(u.returns=c(gt(u.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Qe(n.codegenNode.children)&&n.codegenNode.children.type===15){const u=Ae(t,"slot",!0),p=u&&u.arg&&d(n.codegenNode,u.arg);p&&(p.returns=c(gt(p.returns)),a=!0)}}if(!a)for(const u of l)u.codegenNode=o.cache(u.codegenNode);function c(u){const p=o.cache(u);return p.needArraySpread=!0,p}function d(u,p){if(u.children&&!Qe(u.children)&&u.children.type===15){const m=u.children.properties.find(S=>S.key===p||S.key.content===p);return m&&m.value}}l.length&&o.transformHoist&&o.transformHoist(i,o,t)}function Fe(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 l=3;const a=Ws(t,n);if(a===0)return o.set(t,0),0;a<l&&(l=a);for(let c=0;c<t.children.length;c++){const d=Fe(t.children[c],n);if(d===0)return o.set(t,0),0;d<l&&(l=d)}if(l>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 u=Fe(d.exp,n);if(u===0)return o.set(t,0),0;u<l&&(l=u)}}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(ht),n.removeHelper(Mt(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(Ot(n.inSSR,r.isComponent))}return o.set(t,l),l}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 Fe(t.content,n);case 4:return t.constType;case 8:let i=3;for(let l=0;l<t.children.length;l++){const a=t.children[l];if(ke(a)||Vn(a))continue;const c=Fe(a,n);if(c===0)return 0;c<i&&(i=c)}return i;case 20:return 2;default:return process.env.NODE_ENV,0}}const tf=new Set([uo,mo,Xt,Qt]);function Us(t,n){if(t.type===14&&!ke(t.callee)&&tf.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Fe(o,n);if(o.type===14)return Us(o,n)}return 0}function Ws(t,n){let o=3;const s=qs(t);if(s&&s.type===15){const{properties:r}=s;for(let i=0;i<r.length;i++){const{key:l,value:a}=r[i],c=Fe(l,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Fe(a,n):a.type===14?d=Us(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function qs(t){const n=t.codegenNode;if(n.type===13)return n.props}function nf(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:i=!1,nodeTransforms:l=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Xn,isCustomElement:u=Xn,expressionPlugins:p=[],scopeId:m=null,slotted:S=!0,ssr:w=!1,inSSR:g=!1,ssrCssVars:x="",bindingMetadata:_=nd,inline:W=!1,isTS:N=!1,onError:C=xo,onWarn:T=Cs,compatConfig:v}){const E=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),y={filename:n,selfName:E&&to(lt(E[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:i,nodeTransforms:l,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:p,scopeId:m,slotted:S,ssr:w,inSSR:g,ssrCssVars:x,bindingMetadata:_,inline:W,isTS:N,onError:C,onWarn:T,compatConfig:v,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(D){const R=y.helpers.get(D)||0;return y.helpers.set(D,R+1),D},removeHelper(D){const R=y.helpers.get(D);if(R){const H=R-1;H?y.helpers.set(D,H):y.helpers.delete(D)}},helperString(D){return`_${Dt[y.helper(D)]}`},replaceNode(D){if(process.env.NODE_ENV!=="production"){if(!y.currentNode)throw new Error("Node being replaced is already removed.");if(!y.parent)throw new Error("Cannot replace root node.")}y.parent.children[y.childIndex]=y.currentNode=D},removeNode(D){if(process.env.NODE_ENV!=="production"&&!y.parent)throw new Error("Cannot remove root node.");const R=y.parent.children,H=D?R.indexOf(D):y.currentNode?y.childIndex:-1;if(process.env.NODE_ENV!=="production"&&H<0)throw new Error("node being removed is not a child of current parent");!D||D===y.currentNode?(y.currentNode=null,y.onNodeRemoved()):y.childIndex>H&&(y.childIndex--,y.onNodeRemoved()),y.parent.children.splice(H,1)},onNodeRemoved:Xn,addIdentifiers(D){},removeIdentifiers(D){},hoist(D){ke(D)&&(D=Q(D)),y.hoists.push(D);const R=Q(`_hoisted_${y.hoists.length}`,!1,D.loc,2);return R.hoisted=D,R},cache(D,R=!1,H=!1){const K=_d(y.cached.length,D,R,H);return y.cached.push(K),K}};return y.filters=new Set,y}function of(t,n){const o=nf(t,n);On(t,o),n.hoistStatic&&ef(t,o),n.ssr||sf(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 sf(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=Hs(t);if(r&&r.codegenNode){const i=r.codegenNode;i.type===13&&Eo(i,n),t.codegenNode=i}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(i=>i.type!==3).length===1&&(r|=2048),t.codegenNode=Vt(n,o(Zt),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function rf(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,On(r,n))}}function On(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let i=0;i<o.length;i++){const l=o[i](t,n);if(l&&(Qe(l)?s.push(...l):s.push(l)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(Jt);break;case 5:n.ssr||n.helper(xn);break;case 9:for(let i=0;i<t.branches.length;i++)On(t.branches[i],n);break;case 10:case 11:case 1:case 0:rf(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Ks(t,n){const o=ke(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:i}=s;if(s.tagType===3&&i.some(Pd))return;const l=[];for(let a=0;a<i.length;a++){const c=i[a];if(c.type===7&&o(c.name)){i.splice(a,1),a--;const d=n(s,c,r);d&&l.push(d)}}return l}}}const Mn="/*@__PURE__*/",Gs=t=>`${Dt[t]}: _${Dt[t]}`;function lf(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:i=null,optimizeImports:l=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:m=!1}){const S={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:i,optimizeImports:l,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:u,isTS:p,inSSR:m,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(g){return`_${Dt[g]}`},push(g,x=-2,_){S.code+=g},indent(){w(++S.indentLevel)},deindent(g=!1){g?--S.indentLevel:w(--S.indentLevel)},newline(){w(S.indentLevel)}};function w(g){S.push(`
5
+ `+" ".repeat(g),0)}return S}function af(t,n={}){const o=lf(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:i,indent:l,deindent:a,newline:c,scopeId:d,ssr:u}=o,p=Array.from(t.helpers),m=p.length>0,S=!i&&s!=="module";cf(t,o);const g=u?"ssrRender":"render",_=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${g}(${_}) {`),l(),S&&(r("with (_ctx) {"),l(),m&&(r(`const { ${p.map(Gs).join(", ")} } = _Vue
6
+ `,-1),c())),t.components.length&&(Lo(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(Lo(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),Lo(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let W=0;W<t.temps;W++)r(`${W>0?", ":""}_temp${W}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
+ `,0),c()),u||r("return "),t.codegenNode?_e(t.codegenNode,o):r("null"),S&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function cf(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:i,runtimeModuleName:l,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,u=Array.from(t.helpers);if(u.length>0&&(r(`const _Vue = ${d}
8
+ `,-1),t.hoists.length)){const p=[oo,so,Jt,ro,vs].filter(m=>u.includes(m)).map(Gs).join(", ");r(`const { ${p} } = _Vue
9
+ `,-1)}df(t.hoists,n),i(),r("return ")}function Lo(t,n,{helper:o,push:s,newline:r,isTS:i}){const l=o(n==="filter"?co:n==="component"?io:ao);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 ${tn(c,n)} = ${l}(${JSON.stringify(c)}${d?", true":""})${i?"!":""}`),a<t.length-1&&r()}}function df(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 i=t[r];i&&(o(`const _hoisted_${r+1} = `),_e(i,n),s())}n.pure=!1}function ff(t){return ke(t)||t.type===4||t.type===2||t.type===5||t.type===8}function Ao(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Qe(s)||!ff(s));n.push("["),o&&n.indent(),on(t,n,o),o&&n.deindent(),n.push("]")}function on(t,n,o=!1,s=!0){const{push:r,newline:i}=n;for(let l=0;l<t.length;l++){const a=t[l];ke(a)?r(a,-3):Qe(a)?Ao(a,n):_e(a,n),l<t.length-1&&(o?(s&&r(","),i()):s&&r(", "))}}function _e(t,n){if(ke(t)){n.push(t,-3);return}if(Vn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&Ts(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),_e(t.codegenNode,n);break;case 2:pf(t,n);break;case 4:Zs(t,n);break;case 5:uf(t,n);break;case 12:_e(t.codegenNode,n);break;case 8:Ys(t,n);break;case 3:hf(t,n);break;case 13:gf(t,n);break;case 14:vf(t,n);break;case 15:bf(t,n);break;case 17:kf(t,n);break;case 18:Ef(t,n);break;case 19:wf(t,n);break;case 20:xf(t,n);break;case 21:on(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 Ts(!1,`unhandled codegen node type: ${t.type}`),t}}function pf(t,n){n.push(JSON.stringify(t.content),-3,t)}function Zs(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function uf(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Mn),o(`${s(xn)}(`),_e(t.content,n),o(")")}function Ys(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ke(s)?n.push(s,-3):_e(s,n)}}function mf(t,n){const{push:o}=n;if(t.type===8)o("["),Ys(t,n),o("]");else if(t.isStatic){const s=No(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function hf(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Mn),o(`${s(Jt)}(${JSON.stringify(t.content)})`,-3,t)}function gf(t,n){const{push:o,helper:s,pure:r}=n,{tag:i,props:l,children:a,patchFlag:c,dynamicProps:d,directives:u,isBlock:p,disableTracking:m,isComponent:S}=t;let w;if(c)if(process.env.NODE_ENV!=="production")if(c<0)w=c+` /* ${Gt[c]} */`;else{const x=Object.keys(Gt).map(Number).filter(_=>_>0&&c&_).map(_=>Gt[_]).join(", ");w=c+` /* ${x} */`}else w=String(c);u&&o(s(fo)+"("),p&&o(`(${s(ht)}(${m?"true":""}), `),r&&o(Mn);const g=p?Mt(n.inSSR,S):Ot(n.inSSR,S);o(s(g)+"(",-2,t),on(yf([i,l,a,w,d]),n),o(")"),p&&o(")"),u&&(o(", "),_e(u,n),o(")"))}function yf(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function vf(t,n){const{push:o,helper:s,pure:r}=n,i=ke(t.callee)?t.callee:s(t.callee);r&&o(Mn),o(i+"(",-2,t),on(t.arguments,n),o(")")}function bf(t,n){const{push:o,indent:s,deindent:r,newline:i}=n,{properties:l}=t;if(!l.length){o("{}",-2,t);return}const a=l.length>1||process.env.NODE_ENV!=="production"&&l.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<l.length;c++){const{key:d,value:u}=l[c];mf(d,n),o(": "),_e(u,n),c<l.length-1&&(o(","),i())}a&&r(),o(a?"}":" }")}function kf(t,n){Ao(t.elements,n)}function Ef(t,n){const{push:o,indent:s,deindent:r}=n,{params:i,returns:l,body:a,newline:c,isSlot:d}=t;d&&o(`_${Dt[vo]}(`),o("(",-2,t),Qe(i)?on(i,n):i&&_e(i,n),o(") => "),(c||a)&&(o("{"),s()),l?(c&&o("return "),Qe(l)?Ao(l,n):_e(l,n)):a&&_e(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function wf(t,n){const{test:o,consequent:s,alternate:r,newline:i}=t,{push:l,indent:a,deindent:c,newline:d}=n;if(o.type===4){const p=!No(o.content);p&&l("("),Zs(o,n),p&&l(")")}else l("("),_e(o,n),l(")");i&&a(),n.indentLevel++,i||l(" "),l("? "),_e(s,n),n.indentLevel--,i&&d(),i||l(" "),l(": ");const u=r.type===19;u||n.indentLevel++,_e(r,n),u||n.indentLevel--,i&&c(!0)}function xf(t,n){const{push:o,helper:s,indent:r,deindent:i,newline:l}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(Cn)}(-1`),t.inVOnce&&o(", true"),o("),"),l(),o("(")),o(`_cache[${t.index}] = `),_e(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),l(),o(`${s(Cn)}(1),`),l(),o(`_cache[${t.index}]`),i()),o(")"),c&&o(")]")}const Nf=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"),Cf=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function bt(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(i){let l=i.message;const a=r.replace(Cf,"").match(Nf);a&&(l=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(oe(46,t.loc,void 0,l))}}const Sf=(t,n)=>{if(t.type===5)t.content=Do(t.content,n);else if(t.type===1){const o=Ae(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const i=r.exp,l=r.arg;i&&i.type===4&&!(r.name==="on"&&l)&&!(o&&l&&l.type===4&&l.content==="key")&&(r.exp=Do(i,n,r.name==="slot")),l&&l.type===4&&!l.isStatic&&(r.arg=Do(l,n))}}}};function Do(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&bt(t,n,o,s),t}const _f=Ks(/^(?:if|else|else-if)$/,(t,n,o)=>Bf(t,n,o,(s,r,i)=>{const l=o.parent.children;let a=l.indexOf(s),c=0;for(;a-->=0;){const d=l[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(i)s.codegenNode=Xs(r,c,o);else{const d=Tf(s.codegenNode);d.alternate=Xs(r,c+s.branches.length-1,o)}}}));function Bf(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(oe(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&bt(n.exp,o),n.name==="if"){const r=Js(t,n),i={type:9,loc:Jd(t.loc),branches:[r]};if(o.replaceNode(i),s)return s(i,r,!0)}else{const r=o.parent.children,i=[];let l=r.indexOf(t);for(;l-->=-1;){const a=r[l];if(a&&_o(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&i.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(oe(30,t.loc)),o.removeNode();const c=Js(t,n);if(process.env.NODE_ENV!=="production"&&i.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...i,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&a.branches.forEach(({userKey:p})=>{$f(p,u)&&o.onError(oe(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);On(c,o),d&&d(),o.currentNode=null}else o.onError(oe(30,t.loc));break}}}function Js(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Ae(t,"for")?t.children:[t],userKey:en(t,"key"),isTemplateIf:o}}function Xs(t,n,o){return t.condition?ko(t.condition,Qs(t,n,o),be(o.helper(Jt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Qs(t,n,o)}function Qs(t,n,o){const{helper:s}=o,r=ue("key",Q(`${n}`,!1,Oe,2)),{children:i}=t,l=i[0];if(i.length!==1||l.type!==1)if(i.length===1&&l.type===11){const c=l.codegenNode;return Tn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&i.filter(d=>d.type!==3).length===1&&(c|=2048),Vt(o,s(Zt),ze([r]),i,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=l.codegenNode,d=zd(c);return d.type===13&&Eo(d,o),Tn(d,r,o),c}}function $f(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 Tf(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 Lf=Ks("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Af(t,n,o,i=>{const l=be(s(po),[i.source]),a=Bn(t),c=Ae(t,"memo"),d=en(t,"key",!1,!0);d&&d.type;let u=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const p=d&&u?ue("key",u):null,m=i.source.type===4&&i.source.constType>0,S=m?64:d?128:256;return i.codegenNode=Vt(o,s(Zt),void 0,l,S,void 0,void 0,!0,!m,!1,t.loc),()=>{let w;const{children:g}=i;process.env.NODE_ENV!=="production"&&a&&t.children.some(W=>{if(W.type===1){const N=en(W,"key");if(N)return o.onError(oe(33,N.loc)),!0}});const x=g.length!==1||g[0].type!==1,_=$n(t)?t:a&&t.children.length===1&&$n(t.children[0])?t.children[0]:null;if(_?(w=_.codegenNode,a&&p&&Tn(w,p,o)):x?w=Vt(o,s(Zt),p?ze([p]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(w=g[0].codegenNode,a&&p&&Tn(w,p,o),w.isBlock!==!m&&(w.isBlock?(r(ht),r(Mt(o.inSSR,w.isComponent))):r(Ot(o.inSSR,w.isComponent))),w.isBlock=!m,w.isBlock?(s(ht),s(Mt(o.inSSR,w.isComponent))):s(Ot(o.inSSR,w.isComponent))),c){const W=It(Io(i.parseResult,[Q("_cached")]));W.body=Bd([We(["const _memo = (",c.exp,")"]),We(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${o.helperString(Es)}(_cached, _memo)) return _cached`]),We(["const _item = ",w]),Q("_item.memo = _memo"),Q("return _item")]),l.arguments.push(W,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else l.arguments.push(It(Io(i.parseResult),w,!0))}})});function Af(t,n,o,s){if(!n.exp){o.onError(oe(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(oe(32,n.loc));return}Vs(r,o);const{addIdentifiers:i,removeIdentifiers:l,scopes:a}=o,{source:c,value:d,key:u,index:p}=r,m={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:u,objectIndexAlias:p,parseResult:r,children:Bn(t)?t.children:[t]};o.replaceNode(m),a.vFor++;const S=s&&s(m);return()=>{a.vFor--,S&&S()}}function Vs(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(bt(t.source,n),t.key&&bt(t.key,n,!0),t.index&&bt(t.index,n,!0),t.value&&bt(t.value,n,!0)),t.finalized=!0)}function Io({value:t,key:n,index:o},s=[]){return Df([t,n,o,...s])}function Df(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 er=Q("undefined",!1),If=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Ae(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Of=(t,n,o,s)=>It(t,o,!1,!0,o.length?o[0].loc:s);function Mf(t,n,o=Of){n.helper(vo);const{children:s,loc:r}=t,i=[],l=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Ae(t,"slot",!0);if(c){const{arg:x,exp:_}=c;x&&!Le(x)&&(a=!0),i.push(ue(x||Q("default",!0),o(_,void 0,s,r)))}let d=!1,u=!1;const p=[],m=new Set;let S=0;for(let x=0;x<s.length;x++){const _=s[x];let W;if(!Bn(_)||!(W=Ae(_,"slot",!0))){_.type!==3&&p.push(_);continue}if(c){n.onError(oe(37,W.loc));break}d=!0;const{children:N,loc:C}=_,{arg:T=Q("default",!0),exp:v,loc:E}=W;let y;Le(T)?y=T?T.content:"default":a=!0;const D=Ae(_,"for"),R=o(v,D,N,C);let H,K;if(H=Ae(_,"if"))a=!0,l.push(ko(H.exp,Fn(T,R,S++),er));else if(K=Ae(_,/^else(?:-if)?$/,!0)){let G=x,I;for(;G--&&(I=s[G],!!_o(I)););if(I&&Bn(I)&&Ae(I,/^(?:else-)?if$/)){let z=l[l.length-1];for(;z.alternate.type===19;)z=z.alternate;z.alternate=K.exp?ko(K.exp,Fn(T,R,S++),er):Fn(T,R,S++)}else n.onError(oe(30,K.loc))}else if(D){a=!0;const G=D.forParseResult;G?(Vs(G,n),l.push(be(n.helper(po),[G.source,It(Io(G),Fn(T,R),!0)]))):n.onError(oe(32,D.loc))}else{if(y){if(m.has(y)){n.onError(oe(38,E));continue}m.add(y),y==="default"&&(u=!0)}i.push(ue(T,R))}}if(!c){const x=(_,W)=>{const N=o(_,void 0,W,r);return n.compatConfig&&(N.isNonScopedSlot=!0),ue("default",N)};d?p.length&&!p.every(So)&&(u?n.onError(oe(39,p[0].loc)):i.push(x(void 0,p))):i.push(x(void 0,s))}const w=a?2:Pn(t.children)?3:1;let g=ze(i.concat(ue("_",Q(w+(process.env.NODE_ENV!=="production"?` /* ${ld[w]} */`:""),!1))),r);return l.length&&(g=be(n.helper(ks),[g,gt(l)])),{slots:g,hasDynamicSlots:a}}function Fn(t,n,o){const s=[ue("name",t),ue("fn",n)];return o!=null&&s.push(ue("key",Q(String(o),!0))),ze(s)}function Pn(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Pn(o.children))return!0;break;case 9:if(Pn(o.branches))return!0;break;case 10:case 11:if(Pn(o.children))return!0;break}}return!1}const tr=new WeakMap,Ff=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,i=t.tagType===1;let l=i?Pf(t,n):`"${s}"`;const a=od(l)&&l.callee===lo;let c,d,u=0,p,m,S,w=a||l===Yt||l===no||!i&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const g=nr(t,n,void 0,i,a);c=g.props,u=g.patchFlag,m=g.dynamicPropNames;const x=g.directives;S=x&&x.length?gt(x.map(_=>zf(_,n))):void 0,g.shouldUseBlock&&(w=!0)}if(t.children.length>0)if(l===wn&&(w=!0,u|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(oe(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),i&&l!==Yt&&l!==wn){const{slots:x,hasDynamicSlots:_}=Mf(t,n);d=x,_&&(u|=1024)}else if(t.children.length===1&&l!==Yt){const x=t.children[0],_=x.type,W=_===5||_===8;W&&Fe(x,n)===0&&(u|=1),W||_===2?d=x:d=t.children}else d=t.children;m&&m.length&&(p=jf(m)),t.codegenNode=Vt(n,l,c,d,u===0?void 0:u,p,S,!!w,!1,i,t.loc)};function Pf(t,n,o=!1){let{tag:s}=t;const r=Oo(s),i=en(t,"is",!1,!0);if(i)if(r||ct("COMPILER_IS_ON_ELEMENT",n)){let a;if(i.type===6?a=i.value&&Q(i.value.content,!0):(a=i.exp,a||(a=Q("is",!1,i.arg.loc))),a)return be(n.helper(lo),[a])}else i.type===6&&i.value.content.startsWith("vue:")&&(s=i.value.content.slice(4));const l=Ss(s)||n.isBuiltInComponent(s);return l?(o||n.helper(l),l):(n.helper(io),n.components.add(s),tn(s,"component"))}function nr(t,n,o=t.props,s,r,i=!1){const{tag:l,loc:a,children:c}=t;let d=[];const u=[],p=[],m=c.length>0;let S=!1,w=0,g=!1,x=!1,_=!1,W=!1,N=!1,C=!1;const T=[],v=R=>{d.length&&(u.push(ze(or(d),a)),d=[]),R&&u.push(R)},E=()=>{n.scopes.vFor>0&&d.push(ue(Q("ref_for",!0),Q("true")))},y=({key:R,value:H})=>{if(Le(R)){const K=R.content,G=Qn(K);if(G&&(!s||r)&&K.toLowerCase()!=="onclick"&&K!=="onUpdate:modelValue"&&!ms(K)&&(W=!0),G&&ms(K)&&(C=!0),G&&H.type===14&&(H=H.arguments[0]),H.type===20||(H.type===4||H.type===8)&&Fe(H,n)>0)return;K==="ref"?g=!0:K==="class"?x=!0:K==="style"?_=!0:K!=="key"&&!T.includes(K)&&T.push(K),s&&(K==="class"||K==="style")&&!T.includes(K)&&T.push(K)}else N=!0};for(let R=0;R<o.length;R++){const H=o[R];if(H.type===6){const{loc:K,name:G,nameLoc:I,value:z}=H;let B=!0;if(G==="ref"&&(g=!0,E()),G==="is"&&(Oo(l)||z&&z.content.startsWith("vue:")||ct("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(ue(Q(G,!0,I),Q(z?z.content:"",B,z?z.loc:K)))}else{const{name:K,arg:G,exp:I,loc:z,modifiers:B}=H,q=K==="bind",ee=K==="on";if(K==="slot"){s||n.onError(oe(40,z));continue}if(K==="once"||K==="memo"||K==="is"||q&&dt(G,"is")&&(Oo(l)||ct("COMPILER_IS_ON_ELEMENT",n))||ee&&i)continue;if((q&&dt(G,"key")||ee&&m&&dt(G,"vue:before-update"))&&(S=!0),q&&dt(G,"ref")&&E(),!G&&(q||ee)){if(N=!0,I)if(q){if(v(),process.env.NODE_ENV!=="production"&&u.some(he=>he.type===15?he.properties.some(({key:$e})=>$e.type!==4||!$e.isStatic?!0:$e.content!=="class"&&$e.content!=="style"&&!Qn($e.content)):!0)&&Ft("COMPILER_V_BIND_OBJECT_ORDER",n,z),ct("COMPILER_V_BIND_OBJECT_ORDER",n)){u.unshift(I);continue}E(),v(),u.push(I)}else v({type:14,loc:z,callee:n.helper(ho),arguments:s?[I]:[I,"true"]});else n.onError(oe(q?34:35,z));continue}q&&B.some(me=>me.content==="prop")&&(w|=32);const Be=n.directiveTransforms[K];if(Be){const{props:me,needRuntime:he}=Be(H,t,n);!i&&me.forEach(y),ee&&G&&!Le(G)?v(ze(me,a)):d.push(...me),he&&(p.push(H),Vn(he)&&tr.set(H,he))}else sd(K)||(p.push(H),m&&(S=!0))}}let D;if(u.length?(v(),u.length>1?D=be(n.helper(Nn),u,a):D=u[0]):d.length&&(D=ze(or(d),a)),N?w|=16:(x&&!s&&(w|=2),_&&!s&&(w|=4),T.length&&(w|=8),W&&(w|=32)),!S&&(w===0||w===32)&&(g||C||p.length>0)&&(w|=512),!n.inSSR&&D)switch(D.type){case 15:let R=-1,H=-1,K=!1;for(let z=0;z<D.properties.length;z++){const B=D.properties[z].key;Le(B)?B.content==="class"?R=z:B.content==="style"&&(H=z):B.isHandlerKey||(K=!0)}const G=D.properties[R],I=D.properties[H];K?D=be(n.helper(Xt),[D]):(G&&!Le(G.value)&&(G.value=be(n.helper(uo),[G.value])),I&&(_||I.value.type===4&&I.value.content.trim()[0]==="["||I.value.type===17)&&(I.value=be(n.helper(mo),[I.value])));break;case 14:break;default:D=be(n.helper(Xt),[be(n.helper(Qt),[D])]);break}return{props:D,directives:p,patchFlag:w,dynamicPropNames:T,shouldUseBlock:S}}function or(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 i=r.key.content,l=n.get(i);l?(i==="style"||i==="class"||Qn(i))&&Rf(l,r):(n.set(i,r),o.push(r))}return o}function Rf(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=gt([t.value,n.value],t.loc)}function zf(t,n){const o=[],s=tr.get(t);s?o.push(n.helperString(s)):(n.helper(ao),n.directives.add(t.name),o.push(tn(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 i=Q("true",!1,r);o.push(ze(t.modifiers.map(l=>ue(l,i)),r))}return gt(o,t.loc)}function jf(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 Oo(t){return t==="component"||t==="Component"}const Hf=(t,n)=>{if($n(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:i}=Uf(t,n),l=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;i&&(l[2]=i,a=3),o.length&&(l[3]=It([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),l.splice(a),t.codegenNode=be(n.helper(bs),l,s)}};function Uf(t,n){let o='"default"',s;const r=[];for(let i=0;i<t.props.length;i++){const l=t.props[i];if(l.type===6)l.value&&(l.name==="name"?o=JSON.stringify(l.value.content):(l.name=lt(l.name),r.push(l)));else if(l.name==="bind"&&dt(l.arg,"name")){if(l.exp)o=l.exp;else if(l.arg&&l.arg.type===4){const a=lt(l.arg.content);o=l.exp=Q(a,!1,l.arg.loc)}}else l.name==="bind"&&l.arg&&Le(l.arg)&&(l.arg.content=lt(l.arg.content)),r.push(l)}if(r.length>0){const{props:i,directives:l}=nr(t,n,r,!1,!1);s=i,l.length&&n.onError(oe(36,l[0].loc))}return{slotName:o,slotProps:s}}const sr=(t,n,o,s)=>{const{loc:r,modifiers:i,arg:l}=t;!t.exp&&!i.length&&o.onError(oe(35,r));let a;if(l.type===4)if(l.isStatic){let p=l.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&o.onError(oe(52,l.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const m=n.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?id(lt(p)):`on:${p}`;a=Q(m,!0,l.loc)}else a=We([`${o.helperString(yo)}(`,l,")"]);else a=l,a.children.unshift(`${o.helperString(yo)}(`),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=$s(c),m=!(p||Md(c)),S=c.content.includes(";");process.env.NODE_ENV!=="production"&&bt(c,o,!1,S),(m||d&&p)&&(c=We([`${m?"$event":"(...args)"} => ${S?"{":"("}`,c,S?"}":")"]))}let u={props:[ue(a,c||Q("() => {}",!1,r))]};return s&&(u=s(u)),d&&(u.props[0].value=o.cache(u.props[0].value)),u.props.forEach(p=>p.key.isHandlerKey=!0),u},Wf=(t,n,o)=>{const{modifiers:s,loc:r}=t,i=t.arg;let{exp:l}=t;return l&&l.type===4&&!l.content.trim()&&(l=void 0),i.type!==4?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=i.content?`${i.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(i.type===4?i.isStatic?i.content=lt(i.content):i.content=`${o.helperString(go)}(${i.content})`:(i.children.unshift(`${o.helperString(go)}(`),i.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&rr(i,"."),s.some(a=>a.content==="attr")&&rr(i,"^")),{props:[ue(i,l)]}},rr=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},qf=(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 i=0;i<o.length;i++){const l=o[i];if(Co(l)){r=!0;for(let a=i+1;a<o.length;a++){const c=o[a];if(Co(c))s||(s=o[i]=We([l],l.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(i=>i.type===7&&!n.directiveTransforms[i.name])&&t.tag!=="template")))for(let i=0;i<o.length;i++){const l=o[i];if(Co(l)||l.type===8){const a=[];(l.type!==2||l.content!==" ")&&a.push(l),!n.ssr&&Fe(l,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Gt[1]} */`:"")),o[i]={type:12,content:l,loc:l.loc,codegenNode:be(n.helper(ro),a)}}}}},ir=new WeakSet,Kf=(t,n)=>{if(t.type===1&&Ae(t,"once",!0))return ir.has(t)||n.inVOnce||n.inSSR?void 0:(ir.add(t),n.inVOnce=!0,n.helper(Cn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},lr=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(oe(41,t.loc)),sn();const i=s.loc.source.trim(),l=s.type===4?s.content:i,a=o.bindingMetadata[i];if(a==="props"||a==="props-aliased")return o.onError(oe(44,s.loc)),sn();if(a==="literal-const"||a==="setup-const")return o.onError(oe(45,s.loc)),sn();if(!l.trim()||!$s(s))return o.onError(oe(42,s.loc)),sn();const c=r||Q("modelValue",!0),d=r?Le(r)?`onUpdate:${lt(r.content)}`:We(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;const p=o.isTS?"($event: any)":"$event";u=We([`${p} => ((`,s,") = $event)"]);const m=[ue(c,t.exp),ue(d,u)];if(t.modifiers.length&&n.tagType===1){const S=t.modifiers.map(g=>g.content).map(g=>(No(g)?g:JSON.stringify(g))+": true").join(", "),w=r?Le(r)?`${r.content}Modifiers`:We([r,' + "Modifiers"']):"modelModifiers";m.push(ue(w,Q(`{ ${S} }`,!1,t.loc,2)))}return sn(m)};function sn(t=[]){return{props:t}}const Gf=/[\w).+\-_$\]]/,Zf=(t,n)=>{ct("COMPILER_FILTERS",n)&&(t.type===5?Rn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Rn(o.exp,n)}))};function Rn(t,n){if(t.type===4)ar(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?ar(s,n):s.type===8?Rn(t,n):s.type===5&&Rn(s.content,n))}}function ar(t,n){const o=t.content;let s=!1,r=!1,i=!1,l=!1,a=0,c=0,d=0,u=0,p,m,S,w,g=[];for(S=0;S<o.length;S++)if(m=p,p=o.charCodeAt(S),s)p===39&&m!==92&&(s=!1);else if(r)p===34&&m!==92&&(r=!1);else if(i)p===96&&m!==92&&(i=!1);else if(l)p===47&&m!==92&&(l=!1);else if(p===124&&o.charCodeAt(S+1)!==124&&o.charCodeAt(S-1)!==124&&!a&&!c&&!d)w===void 0?(u=S+1,w=o.slice(0,S).trim()):x();else{switch(p){case 34:r=!0;break;case 39:s=!0;break;case 96:i=!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 _=S-1,W;for(;_>=0&&(W=o.charAt(_),W===" ");_--);(!W||!Gf.test(W))&&(l=!0)}}w===void 0?w=o.slice(0,S).trim():u!==0&&x();function x(){g.push(o.slice(u,S).trim()),u=S+1}if(g.length){for(process.env.NODE_ENV!=="production"&&_n("COMPILER_FILTERS",n,t.loc),S=0;S<g.length;S++)w=Yf(w,g[S],n);t.content=w,t.ast=void 0}}function Yf(t,n,o){o.helper(co);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${tn(n,"filter")}(${t})`;{const r=n.slice(0,s),i=n.slice(s+1);return o.filters.add(r),`${tn(r,"filter")}(${t}${i!==")"?","+i:i}`}}const cr=new WeakSet,Jf=(t,n)=>{if(t.type===1){const o=Ae(t,"memo");return!o||cr.has(t)||n.inSSR?void 0:(cr.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&Eo(s,n),t.codegenNode=be(n.helper(bo),[o.exp,It(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},Xf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(oe(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=lt(s.content);(_s.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function Qf(t){return[[Xf,Kf,_f,Jf,Lf,Zf,...process.env.NODE_ENV!=="production"?[Sf]:[],Hf,Ff,If,qf],{on:sr,bind:Wf,model:lr}]}function Vf(t,n={}){const o=n.onError||xo,s=n.mode==="module";n.prefixIdentifiers===!0?o(oe(48)):s&&o(oe(49));const r=!1;n.cacheHandlers&&o(oe(50)),n.scopeId&&!s&&o(oe(51));const i=it({},n,{prefixIdentifiers:r}),l=ke(t)?Vd(t,i):t,[a,c]=Qf();return of(l,it({},i,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:it({},c,n.directiveTransforms||{})})),af(l,i)}const ep=()=>({props:[]});const dr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),fr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),pr=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),ur=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Mo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),mr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),hr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),gr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Fo=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),yr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");Cd({[dr]:"vModelRadio",[fr]:"vModelCheckbox",[pr]:"vModelText",[ur]:"vModelSelect",[Mo]:"vModelDynamic",[mr]:"withModifiers",[hr]:"withKeys",[gr]:"vShow",[Fo]:"Transition",[yr]:"TransitionGroup"});let Pt;function tp(t,n=!1){return Pt||(Pt=document.createElement("div")),n?(Pt.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Pt.children[0].getAttribute("foo")):(Pt.innerHTML=t,Pt.textContent)}const np={parseMode:"html",isVoidTag:bd,isNativeTag:t=>gd(t)||yd(t)||vd(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:tp,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Fo;if(t==="TransitionGroup"||t==="transition-group")return yr},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}},op=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:sp(n.value.content,n.loc),modifiers:[],loc:n.loc})})},sp=(t,n)=>{const o=fd(t);return Q(JSON.stringify(o),!1,n,3)};function qe(t,n){return oe(t,n,process.env.NODE_ENV!=="production"?rp:void 0)}const rp={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},ip=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(qe(54,r)),n.children.length&&(o.onError(qe(55,r)),n.children.length=0),{props:[ue(Q("innerHTML",!0,r),s||Q("",!0))]}},lp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(qe(56,r)),n.children.length&&(o.onError(qe(57,r)),n.children.length=0),{props:[ue(Q("textContent",!0),s?Fe(s,o)>0?s:be(o.helperString(xn),[s],r):Q("",!0))]}},ap=(t,n,o)=>{const s=lr(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(qe(59,t.arg.loc));function r(){const a=Ae(n,"bind");a&&dt(a.arg,"value")&&o.onError(qe(61,a.loc))}const{tag:i}=n,l=o.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||l){let a=pr,c=!1;if(i==="input"||l){const d=en(n,"type");if(d){if(d.type===7)a=Mo;else if(d.value)switch(d.value.content){case"radio":a=dr;break;case"checkbox":a=fr;break;case"file":c=!0,o.onError(qe(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Fd(n)?a=Mo:process.env.NODE_ENV!=="production"&&r()}else i==="select"?a=ur:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(qe(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},cp=Ze("passive,once,capture"),dp=Ze("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),fp=Ze("left,right"),vr=Ze("onkeyup,onkeydown,onkeypress"),pp=(t,n,o,s)=>{const r=[],i=[],l=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&Ft("COMPILER_V_ON_NATIVE",o,s)||cp(c)?l.push(c):fp(c)?Le(t)?vr(t.content.toLowerCase())?r.push(c):i.push(c):(r.push(c),i.push(c)):dp(c)?i.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:i,eventOptionModifiers:l}},br=(t,n)=>Le(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?We(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,up=(t,n,o)=>sr(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:i,value:l}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=pp(i,r,o,t.loc);if(c.includes("right")&&(i=br(i,"onContextmenu")),c.includes("middle")&&(i=br(i,"onMouseup")),c.length&&(l=be(o.helper(mr),[l,JSON.stringify(c)])),a.length&&(!Le(i)||vr(i.content.toLowerCase()))&&(l=be(o.helper(hr),[l,JSON.stringify(a)])),d.length){const u=d.map(to).join("");i=Le(i)?Q(`${i.content}${u}`,!0):We(["(",i,`) + "${u}"`])}return{props:[ue(i,l)]}}),mp=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(qe(62,r)),{props:[],needRuntime:o.helper(gr)}},hp=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Fo)return()=>{if(!t.children.length)return;kr(t)&&n.onError(qe(63,{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 kr(t){const n=t.children=t.children.filter(s=>!_o(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(kr)}const gp=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(qe(64,t.loc)),n.removeNode())};function yp(t,n){return t==="template"?!0:t in Er?Er[t].has(n):n in wr?wr[n].has(t):!(t in xr&&xr[t].has(n)||n in Nr&&Nr[n].has(t))}const Rt=new Set(["h1","h2","h3","h4","h5","h6"]),kt=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:kt,iframe:kt,option:kt,textarea:kt,style:kt,title:kt},wr={html:kt,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"])},xr={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"])},Nr={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:Rt,h2:Rt,h3:Rt,h4:Rt,h5:Rt,h6:Rt},vp=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!yp(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)}},bp=[op,...process.env.NODE_ENV!=="production"?[hp,vp]:[]],kp={cloak:ep,html:ip,text:lp,model:ap,on:up,show:mp};function Ep(t,n={}){return Vf(t,it({},np,n,{nodeTransforms:[gp,...bp,...n.nodeTransforms||[]],directiveTransforms:it({},kp,n.directiveTransforms||{}),transformHoist:null}))}function wp(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Ep(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(zr);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Po={};function xp(t){return Po[t]||(Po[t]=wp(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}}})),Po[t]}const Np={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Cp={class:"flex items-center gap-2"},Sp=["disabled"],_p={class:"text-sm"},Bp=["disabled"],$p=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,i)=>(e.openBlock(),e.createElementBlock("div",Np,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",Cp,[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:i[0]||(i[0]=l=>r.$emit("previous"))}," Назад ",8,Sp),e.createElementVNode("span",_p,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.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:i[1]||(i[1]=l=>r.$emit("next"))}," Далі ",8,Bp)])]))}}),Tp={class:"relative inline-flex"},Lp=["aria-label"],Ap={class:"px-3 pb-2"},Dp={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Ip=["onClick"],Op={class:"truncate"},Mp={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",Pp=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),i=e.ref(!1),l=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref({top:0,left:0}),m=e.computed(()=>{if(!l.value)return a.value;const N=l.value.toLowerCase();return a.value.filter(C=>S(C).toLowerCase().includes(N))});e.watch(()=>o.columns,N=>{if(!N){a.value=[];return}const C=JSON.stringify(N),T=JSON.stringify(a.value);C!==T&&(a.value=[...N])},{deep:!0}),e.watch(a,N=>{s("update:columns",N)},{deep:!0});function S(N){return N.ua||N.label||N.name||"Колонка"}function w(N){const C=!N.hidden;C&&a.value.filter(T=>!T.hidden).length<=1||(N.hidden=C)}function g(){i.value=!i.value,i.value&&e.nextTick(()=>{u.value?.focus(),x()})}function x(){if(!c.value)return;const N=c.value.getBoundingClientRect();p.value={top:N.bottom+window.scrollY+6,left:N.left+window.scrollX-200}}function _(N){if(!i.value)return;const C=N.target;C&&(d.value?.contains(C)||c.value?.contains(C)||(i.value=!1))}function W(N){N.key==="Escape"&&(i.value=!1)}return e.onMounted(()=>{document.addEventListener("click",_,!0),document.addEventListener("keydown",W)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",_,!0),document.removeEventListener("keydown",W)}),(N,C)=>(e.openBlock(),e.createElementBlock("div",Tp,[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:"Налаштування колонок"},[...C[2]||(C[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,Lp),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.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`})},[C[5]||(C[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:u,"onUpdate:modelValue":C[0]||(C[0]=T=>l.value=T),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,l.value]])]),e.createElementVNode("div",Dp,[C[4]||(C[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:C[1]||(C[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.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:v=>w(T)},[e.createElementVNode("span",Op,e.toDisplayString(S(T)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",T.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[T.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Mp,[...C[3]||(C[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,Ip))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),Rp=["data-action-key"],zp=["onClick"],jp={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"},Hp={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"},Up={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"},Wp={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"},qp=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),i=e.computed(()=>!!o.actions?.length),l=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(w){w.handler?.(o.row)}const u=e.computed(()=>{if(!o.isOpen)return{};const w=r.value;if(!w)return{};const g=w.getBoundingClientRect(),x=8,_=160,C=(o.actions?.length??0)*36+x*2,T=l.value.height||(typeof window<"u"?window.innerHeight:0),v=l.value.width||(typeof window<"u"?window.innerWidth:0),E=l.value.scrollX||(typeof window<"u"?window.scrollX:0),y=l.value.scrollY||(typeof window<"u"?window.scrollY:0);let D=g.bottom+y+x,R=g.right+E-_;const H=E+v-_-x;return R>H&&(R=H),R<E+x&&(R=E+x),D+C>y+T-x&&(D=g.top+y-C-x),D<y+x&&(D=y+x),{top:`${D}px`,left:`${R}px`,width:"auto"}});function p(){typeof window>"u"||(l.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function m(){typeof window>"u"||a.value||(a.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function S(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>o.isOpen,w=>{w?m():S()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&m()}),e.onBeforeUnmount(()=>{S()}),(w,g)=>i.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.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"},[t.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(u.value),onClick:g[0]||(g[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,x=>(e.openBlock(),e.createElementBlock("button",{key:x.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",x.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:_=>d(x)},[e.renderSlot(w.$slots,"icon",{action:x},()=>[x.type==="view"?(e.openBlock(),e.createElementBlock("svg",jp,[...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)])])):x.type==="edit"?(e.openBlock(),e.createElementBlock("svg",Hp,[...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)])])):x.type==="delete"?(e.openBlock(),e.createElementBlock("svg",Up,[...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",Wp,[...g[5]||(g[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(x.label),1)],10,zp))),128))],4)):e.createCommentVNode("",!0)]))],8,Rp)):e.createCommentVNode("",!0)}}),Cr=typeof window<"u",Sr=typeof document<"u";function Kp(t){if(!Sr)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 _r(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 Ro(t,n){if(!Sr||!Cr)return;const o=Kp(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!Cr)return;o.textContent=s.options.text;const l=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(l.left,c));o.style.left=`${d}px`,o.style.top=`${l.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 zo(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 Gp={mounted(t,n){const o=_r(n.value);o&&Ro(t,o)},updated(t,n){const o=_r(n.value),s=t;if(!o){zo(s);return}const r=s.__tooltipState__;if(!r){Ro(s,o);return}if(r.options.wrap!==o.wrap){zo(s),Ro(s,o);return}r.options=o},unmounted(t){zo(t)}},Zp={class:"flex flex-col gap-4 mb-[15px]"},Yp={class:"flex flex-wrap items-center gap-4"},Jp={class:"relative"},Xp={class:"ml-auto flex items-center gap-2"},Qp={class:"overflow-x-auto"},Vp={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"},eu={class:"text-left font-medium text-gray-700"},tu={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},nu={class:"divide-y divide-gray-200"},ou=["href"],su={key:2},ru={key:3},iu={key:0,class:"py-2 pr-4 text-right"},lu={key:0},au={key:0},cu=["colspan"],Br=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},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=Gp,i=t,l=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),u=e.ref(1),p=e.ref(10),m=e.ref(0),S=e.ref(0),w=e.ref("id"),g=e.ref("");let x=null,_=0;const W=e.ref(null);async function N(){const k=u.value,M=++_,L=i.columns!==void 0,A=L?Array.isArray(i.columns)?i.columns:[]:void 0;L&&(s.value=K(A??[]));const J=i.actions!==void 0,le=J?Array.isArray(i.actions)?i.actions:[]:void 0;J&&(l.value=le??[]);const ne=new URLSearchParams,Ne=d.value.trim();Ne&&ne.set("search",Ne),ne.set("page",String(k)),ne.set("limit",String(p.value));const st=`/api/data/${i.token}${ne.toString()?`?${ne.toString()}`:""}`;let re;try{const Ge=await fetch(st);if(!Ge.ok)throw new Error(`Request failed with status ${Ge.status}`);re=await Ge.json()}catch(Ge){M===_&&(o.value=[],S.value=0,m.value=0),console.error("Failed to load table data",Ge);return}if(M!==_)return;o.value=Array.isArray(re?.rows)?re.rows:[];const Ye=Array.isArray(re?.columns)?re.columns:[];s.value=K(A??Ye),l.value=le!==void 0?Array.isArray(le)?le:[]:Array.isArray(re?.actions)?re.actions:[],a.value=re?.form,c.value=re?.addToken,w.value=typeof re?.pk=="string"&&re.pk?re.pk:w.value,typeof re?.form=="string"&&re.form&&(g.value=re.form.replace(/\.form$/,".table")),P();const ge=Number(re?.total??re?.count??re?.totalCount),Je=Number(re?.filtered??re?.filteredCount);m.value=Number.isFinite(ge)&&ge>0?ge:o.value.length,S.value=Number.isFinite(Je)&&Je>0?Je:Math.max(o.value.length,m.value);const Ht=Math.max(1,Math.ceil((S.value||o.value.length||1)/p.value));let Re=k;typeof re?.page=="number"&&re.page>0&&(Re=re.page),Re>Ht&&(Re=Ht),Re<1&&(Re=1);const Ho=Re!==k;if(u.value=Re,Ho&&S.value>0)return N()}const{$notify:C,$confirm:T,$form:v}=n?.appContext?.config?.globalProperties||{};function E(){if(Ce.emitter?.emit){Ce.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}N()}async function y(k){typeof v=="function"&&(await v({token:k.token}),E())}async function D(){typeof v=="function"&&(await v({token:c.value}),E())}function R(k){T({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const M=await fetch(`/api/table/${k.token}`,{method:"DELETE"});if(!M.ok){const{error:L}=await M.json();C({title:"Помилка",type:"warning",message:L});return}C({title:"Видаленно",message:"Успішно видалено"}),await N()}})}e.onMounted(async()=>{await N(),Ce.emitter?.on?.("updateCard",N)}),e.onBeforeUnmount(()=>{Ce.emitter?.off?.("updateCard",N)});function H(k){return typeof k?.format=="string"?k.format.toLowerCase():""}function K(k){const M=new Map;s.value.forEach(A=>{A?.name&&M.set(A.name,!!A.hidden)});const L=k.map(A=>{const J=M.has(A.name)?M.get(A.name):!!A.hidden;return{...A,hidden:J}});return L.length&&!L.some(A=>!A.hidden)&&(L[0].hidden=!1),L}const G=e.computed(()=>{const k=s.value.filter(M=>!M.hidden);return k.length?k:s.value}),I=e.computed(()=>{const k=[],M=new Set;for(const L of l.value){if(typeof L=="string"){if(L==="edit"){const A="row:edit";M.has(A)||(k.push({key:A,type:"edit",label:"Редагувати",scope:"row",handler:X}),M.add(A));continue}if(L==="delete"||L==="del"){const A="row:delete";M.has(A)||(k.push({key:A,type:"delete",label:"Видалити",scope:"row",handler:se,variant:"danger"}),M.add(A));continue}if(L==="add"){const A="toolbar:add";M.has(A)||(k.push({key:A,type:"add",label:"Додати",scope:"toolbar"}),M.add(A))}continue}if(L&&typeof L=="object"){const A=String(L.name??L.type??"action"),J=String(L.label??L.title??A),le=L.scope==="toolbar"?"toolbar":"row",ne=`${le}:${A}`;if(M.has(ne))continue;M.add(ne),k.push({key:ne,type:A,label:J,scope:le,handler:le==="row"?Ne=>ie(L,Ne):void 0,variant:L.variant==="danger"?"danger":"default",original:L})}}return k}),z=e.computed(()=>I.value.filter(k=>k.scope==="row"&&typeof k.handler=="function")),B=e.computed(()=>I.value.filter(k=>k.scope==="toolbar")),q=e.computed(()=>z.value.length>0),ee=e.computed(()=>B.value.some(k=>k.type==="add")),Be=e.computed(()=>{const k=!!c.value;return i.addButton!==void 0?i.addButton&&k:ee.value&&k}),me=e.computed(()=>o.value),he=e.computed(()=>{const k=S.value||me.value.length,M=Math.ceil(k/p.value);return M>0?M:1}),$e=e.computed(()=>{const k=me.value.length,M=S.value||k,L=m.value||M;return`Показано ${k} з ${M} (усього ${L})`});function pt(){u.value<he.value&&(u.value+=1,N())}function wt(){u.value>1&&(u.value-=1,N())}e.watch(s,k=>{k?.length&&(k.some(M=>!M.hidden)||(k[0].hidden=!1))},{deep:!0}),e.watch(()=>i.columns,k=>{if(k===void 0){N();return}const M=Array.isArray(k)?k:[];s.value=K(M)},{deep:!0}),e.watch(()=>i.actions,k=>{if(k===void 0){N();return}l.value=Array.isArray(k)?k:[]},{deep:!0});function Pe(){x&&clearTimeout(x),P(),x=setTimeout(()=>{u.value=1,N()},300)}function je(k){const M=w.value||"id",L=k?.token??k?.[M]??k?.id;return L?String(L):""}function tt(k){const M=G.value[k],L=["py-2",...j(M)];k===0&&L.push("pl-4");const A=k===G.value.length-1&&!q.value;return L.push(A?"pr-4":"pr-5"),L.join(" ")}function Ke(k,M){const L=["py-2",...j(M)];H(M)==="badge"&&L.push("center"),h(M)==="wrap"?L.push("whitespace-normal","break-words"):L.push("truncate"),k===0&&L.push("pl-4");const A=k===G.value.length-1&&!q.value;return L.push(A?"pr-4":"pr-5"),L.join(" ")}function h(k){return(typeof k?.overflow=="string"?k.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function j(k){const M=[],L=ne=>{if(ne==null||ne==="")return;const Ne=Number(ne);return Number.isFinite(Ne)&&Ne>0?`${Ne}px`:String(ne).replace(/\s+/g,"")},A=L(k?.width),J=L(k?.minWidth),le=L(k?.maxWidth);return A?(M.push(`min-w-[${A}]`,`max-w-[${A}]`),M):(M.push(`min-w-[${J??"100px"}]`),M.push(`max-w-[${le??"350px"}]`),M)}function b(k){if(!z.value.length)return!1;const M=w.value||"id";return!!(k?.token||k?.[M]||k?.id)}function $(k){return W.value===je(k)}function O(k){const M=je(k);M&&(W.value=W.value===M?null:M)}function P(){W.value=null}function Z(k,M){const L=M?.tooltip;if(!L)return;const A=ot(k,M);let J,le=M?.tooltipWrap!==!1;if(typeof L=="string"){const ne=L.trim();if(!ne)return;const Ne=ne.toLowerCase();if(["true","1","yes"].includes(Ne))J=typeof A=="string"?A:String(A??"");else{if(["false","0","no"].includes(Ne))return;J=ne}}else L===!0?J=A:typeof L=="object"&&(typeof L.text=="string"&&(J=L.text.trim()),typeof L.wrap=="boolean"&&(le=L.wrap!==!1));if(!J){if(A==null||A==="")return;J=String(A)}if(J.trim())return le?{text:J,wrap:!0}:J}function X(k){P(),y(k)}function se(k){P(),R(k)}async function ie(k,M){P();const L=w.value||"id",A=k.isId?M?.[L]??M?.id:M?.token??M?.[L]??M?.id;if(!A){console.warn("Cannot execute action without identifier",k);return}if(k.form&&typeof k.api=="string"&&k.api&&typeof v=="function"){await nt(k,M,A);return}if(k.form&&typeof v=="function"){const J=await He(k.form,A),le={form:k.form,token:J?.token??M?.token??A,schema:J?.schema,mode:J?.mode??"edit"};J?.data!==void 0&&(le.defaultValue=J.data);try{await v(le),E()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof k.api=="string"&&k.api){const J=pe(k.api,A);window.location.href=J;return}M?.token&&typeof v=="function"&&(await v({token:M.token}),E())}function pe(k,M){return`${k.endsWith("/")?k:`${k}/`}${M}`}async function He(k,M){const L=`/api/form/${k}/${M}`;try{const A=await fetch(L);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);return await A.json()}catch(A){console.error("Failed to load form config",A),C({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Ee(k){const M=`/api/template/form/${k}`;try{const L=await fetch(M);if(!L.ok)throw new Error(`Request failed with status ${L.status}`);return(await L.json())?.schema}catch(L){console.error("Failed to load form template",L);return}}function Te(k){if(k!=null){if(k?.data!==void 0)return k.data;if(k?.defaultValue!==void 0)return k.defaultValue;if(k?.values!==void 0)return k.values;if(typeof k=="object"&&!Array.isArray(k)){const{schema:M,token:L,mode:A,message:J,successMessage:le,...ne}=k;if(Object.keys(ne).length)return ne}}}async function nt(k,M,L){const A=pe(k.api,L),J=(typeof k.method=="string"?k.method:"PUT").toUpperCase();let le;try{const ge=await fetch(A);if(!ge.ok)throw new Error(`Request failed with status ${ge.status}`);le=await ge.json()}catch(ge){console.error("Failed to load action data",ge),zt("Не вдалося отримати дані форми.");return}const ne=typeof k.form=="string"?k.form.replace(/\.table$/,".form"):void 0,Ne=le?.schema??(ne?await Ee(ne):void 0),st={mode:le?.mode??"edit"};ne&&(st.form=ne),Ne&&(st.schema=Ne);const re=Te(le);re!==void 0&&(st.defaultValue=re);const Ye=await v(st);if(Ye)try{const ge=await fetch(A,{method:J,headers:{"Content-Type":"application/json"},body:JSON.stringify(Ye)});if(!ge.ok){const Je=await an(ge),Ht=Je?.error??Je?.message??"Не вдалося зберегти дані.";throw new Error(Ht)}jt(`Дані успішно ${st.value==="add"?"збережено":"оновлено"}`),E()}catch(ge){console.error("Failed to submit action data",ge),zt("Не вдалося зберегти дані.")}}async function an(k){try{return await k.json()}catch{return}}function zt(k){C({title:"Помилка",type:"error",message:k})}function jt(k){C({title:"Успіх",type:"success",message:k})}function xt(k){if(!W.value)return;const M=k.target;if(!M)return;const L=M.closest("[data-action-key]");L&&L.getAttribute("data-action-key")===W.value||P()}e.onMounted(()=>{document.addEventListener("click",xt,!0)}),e.onBeforeUnmount(()=>{x&&clearTimeout(x),document.removeEventListener("click",xt,!0),Ce.emitter?.off?.("updateCard",N)});function Nt(k,M){const A=k?.[`${M.name}_text`];if(Array.isArray(A))return A.length?A.join(", "):"-";if(A!=null&&A!=="")return A;const J=k?.[M.name];return Array.isArray(J)?J.length?J.join(", "):"-":J??"-"}function ut(k,M){const A=k?.[`${M.name}_data`];if(A&&typeof A=="object")return{text:A.text??A.label??A.name??A.title??"-",color:A.color,textColor:A.textColor};const J=k?.[`${M.name}_text`]??k?.[M.name];return{text:(Array.isArray(J)?J.join(", "):J)??"-"}}function jo(k,M){const L=ut(k,M);return L.color?{backgroundColor:L.color,color:L.textColor??"#ffffff"}:{}}function ot(k,M){const L=H(M);if(L==="badge")return ut(k,M).text;if(L==="select")return Nt(k,M);if(L==="slot")return"-";if(L==="text")return k?.[M.name]??"-";const A=k?.[`${M.name}_data`];return A!=null&&typeof A!="object"?A:k?.[`${M.name}_text`]??k?.[M.name]??"-"}return(k,M)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Zp,[e.createElementVNode("div",Yp,[e.createElementVNode("div",Jp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":M[0]||(M[0]=L=>d.value=L),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:Pe},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",Xp,[e.createVNode(Pp,{columns:s.value,"onUpdate:columns":M[1]||(M[1]=L=>s.value=L)},null,8,["columns"]),Be.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:D,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":"Додати запис"},[...M[2]||(M[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",Qp,[e.createElementVNode("table",Vp,[e.createElementVNode("thead",eu,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(L,A)=>(e.openBlock(),e.createElementBlock("th",{key:L.name,class:e.normalizeClass(tt(A))},e.toDisplayString(L.ua),3))),128)),q.value?(e.openBlock(),e.createElementBlock("th",tu," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,L=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:L.id??JSON.stringify(L)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(A,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:A.name,class:e.normalizeClass(Ke(J,A))},[A.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:A.link.replace("{{id}}",L.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(ot(L,A)),9,ou)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[H(A)==="slot"&&(A.slot?.content||A.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(xp)(A.slot.content||A.slot)),{key:0,data:L,row:L,column:A,value:L?.[A.name]},null,8,["data","row","column","value"])):H(A)==="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(jo(L,A))},e.toDisplayString(ut(L,A).text),5)):H(A)==="select"?(e.openBlock(),e.createElementBlock("span",su,e.toDisplayString(Nt(L,A)),1)):(e.openBlock(),e.createElementBlock("span",ru,e.toDisplayString(ot(L,A)),1))],64))],2)),[[e.unref(r),Z(L,A)]])),128)),q.value?(e.openBlock(),e.createElementBlock("td",iu,[b(L)?(e.openBlock(),e.createElementBlock("div",lu,[e.createVNode(qp,{row:L,actions:z.value,"is-open":$(L),"action-key":je(L),onToggle:A=>O(L)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),me.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",au,[e.createElementVNode("td",{colspan:G.value.length+(q.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,cu)]))])])]),e.createVNode($p,{"current-page":u.value,"total-pages":he.value,label:$e.value,onPrevious:wt,onNext:pt},null,8,["current-page","total-pages","label"])]))}}),du={class:"p-[20px]"},fu={class:"flex gap-[6px] mb-5"},pu={class:"vs-form-text relative bg-white rounded-lg flex-grow"},uu={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},mu={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},hu={class:"space-y-8"},gu={key:0},yu={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},vu=["onClick"],bu={class:"md:col-span-2"},ku={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Eu={class:"text-sm text-gray-500 dark:text-neutral-500"},wu={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},xu=["checked","onChange"],Nu={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Cu={class:"md:col-span-2"},Su={class:"font-semibold text-gray-800 dark:text-neutral-200"},_u=["onClick"],Bu={class:"md:col-span-2"},$u={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Tu={class:"text-sm text-gray-500 dark:text-neutral-500"},Lu={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Au=["checked","onChange"],zn="uk",jn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return zn;const v=localStorage.language,E=typeof navigator<"u"?navigator.language:zn;return(v||E||zn).split(/[-_]/)[0].toLowerCase()||zn},s=t,r=e.ref(""),i=["view","add","edit","del"],l=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},d=v=>c[v]??v,u=()=>{a.value=o()},p=()=>{const v=[];return a.value&&v.push(a.value),n.forEach(E=>{E&&!v.includes(E)&&v.push(E)}),v.includes("path")||v.push("path"),v},m=v=>{const E=p();for(const y of E){const D=v[y];if(typeof D=="string"&&D.trim())return D}return""};e.onMounted(async()=>{u();const E=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();E.routes&&E.routes.forEach(y=>{l.value[y.path]=new Set(y.actions)})});const S=(v,E)=>l.value[v]?.has(E)??!1,w=(v,E)=>{l.value[v]||(l.value[v]=new Set),l.value[v].has(E)?l.value[v].delete(E):l.value[v].add(E)},g=(v,E)=>{v.forEach(y=>{y.path&&(l.value[y.path]||(l.value[y.path]=new Set),l.value[y.path].has(E)?l.value[y.path].delete(E):l.value[y.path].add(E))})},x=e.computed(()=>Object.entries(l.value).map(([v,E])=>({path:v,actions:Array.from(E)})).filter(v=>v.actions.length)),_=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:x.value})}),Ce.notify({title:"Success!",message:"Permissions saved."})},W=()=>{l.value={}},N=v=>{if(!r.value.trim())return v;const E=r.value.toLowerCase();return v.filter(y=>m(y).toLowerCase().includes(E)||(y.path?.toLowerCase().includes(E)??!1))},C=e.computed(()=>N(s.data.routers.filter(v=>!v.menu))),T=e.computed(()=>s.data.routers.filter(v=>v.menu).map(v=>({...v,menu:N(v.menu||[])})).filter(v=>v.menu&&v.menu.length>0));return(v,E)=>(e.openBlock(),e.createElementBlock("div",du,[e.createElementVNode("div",fu,[e.createElementVNode("div",pu,[E[1]||(E[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":E[0]||(E[0]=y=>r.value=y),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:W,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:_,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",uu,[E[2]||(E[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(i,(y,D)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:D},[e.createElementVNode("h3",mu,e.toDisplayString(d(y)),1)])),64))]),e.createElementVNode("div",hu,[C.value.length?(e.openBlock(),e.createElementBlock("div",gu,[e.createElementVNode("ul",yu,[E[3]||(E[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(i,(y,D)=>e.createElementVNode("li",{key:D,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:R=>g(C.value,i[D])}," Перемкнути всі ",8,vu)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(y,D)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+D,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",bu,[e.createElementVNode("p",ku,e.toDisplayString(m(y)),1),e.createElementVNode("p",Eu,e.toDisplayString(y.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(R,H)=>e.createElementVNode("li",{key:H,class:"col-span-1"},[e.createElementVNode("div",wu,[e.createElementVNode("input",{type:"checkbox",checked:S(y.path,R),onChange:K=>w(y.path,R),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,xu)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(y,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:"space-y-5"},[e.createElementVNode("ul",Nu,[e.createElementVNode("li",Cu,[e.createElementVNode("h3",Su,e.toDisplayString(m(y)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(R,H)=>e.createElementVNode("li",{key:H,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:K=>g(y.menu,i[H])}," Перемкнути всі ",8,_u)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.menu,(R,H)=>(e.openBlock(),e.createElementBlock("ul",{key:H,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Bu,[e.createElementVNode("p",$u,e.toDisplayString(m(R)),1),e.createElementVNode("p",Tu,e.toDisplayString(R.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(K,G)=>e.createElementVNode("li",{key:G,class:"col-span-1"},[e.createElementVNode("div",Lu,[e.createElementVNode("input",{type:"checkbox",checked:S(R.path,K),onChange:I=>w(R.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Au)])])),64))]))),128))]))),128))])]))}}),Et={"vs-widget-comments":pn,"vs-widget-history":vn,"vs-widget-gallery":kn,"vs-widget-file":bn,"vs-widget-list":Jn,"vs-widget-map":At,"vs-widget-table":Br,"vs-group-interface":jn};function $r(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 Tr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>Tr(o))),n}function Du(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=$r(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 i=n-r;if(s.length===0)return;i<=0&&(i=n);const l=Math.max(1,Math.floor(i/s.length));let a=Math.max(0,i-l*s.length);s.forEach(c=>{let d=l;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function Hn(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>Tr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=Hn(s.items,12))}),Du(o,n),o}function Lr(t){const n=$r(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Iu={class:"text-lg font-semibold text-gray-900"},Ou=["innerHTML"],Mu={key:0,class:"grid grid-cols-12 gap-4"},Fu={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Pu={class:"text-lg font-semibold text-gray-900"},Ru=["innerHTML"],rn=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(()=>Hn(n.items));function r(d){const u=["col-span-12"],p=Lr(d.col);return p.length&&u.push(...p),u}function i(d){return Et[d]||d}function l(d,u){if(!d||typeof u!="string"||!u)return{found:!1,value:void 0};const p=u.split(".");let m=d;for(const S of p){if(m==null||typeof m!="object"&&!Array.isArray(m))return{found:!1,value:void 0};if(!(S in m))return{found:!1,value:void 0};m=m[S]}return{found:!0,value:m}}const a=function(d={}){const u={...d};return Object.entries(u).forEach(([p,m])=>{if(p!=="props"&&typeof m=="string"){const S=l(n.data,m);S.found&&(u[p]=S.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,m])=>{if(typeof m=="string"){const S=l(n.data,m);u[p]=S.found?S.value:m}else u[p]=m}),delete u.props,u},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",Iu,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,Ou)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(ln,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Mu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||m,class:e.normalizeClass(r(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",Fu,[e.createElementVNode("h3",Pu,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,Ru)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(p),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),zu={class:"grid grid-cols-12 gap-[20px]"},ju={key:0,class:"col-span-4"},Hu=["innerHTML"],Uu=["onClick"],Wu=["innerHTML"],qu={key:1,class:"flex w-full"},Ku={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},Gu=["onClick"],Zu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},Yu={class:"flex-1 p-4"},Ju=["innerHTML"],Xu={class:"grid grid-cols-12 gap-4"},Qu={key:3,class:"w-full h-full"},ln=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 I=typeof window<"u"?window:globalThis,z="__vsCardAnonymousCounter__",B=I[z]??0;return I[z]=B+1,B===0?"tab":`tab${B}`}const s=e.ref(0),r=e.ref([]);let i=!1,l=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,I=>{I&&(a.value=I)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function u(I,z){const B=z?.path;return B?(c.has(B)||c.set(B,e.defineAsyncComponent(()=>import(B))),c.get(B)):typeof I=="string"&&Et[I]?Et[I]:z?.component&&Et[z.component]?Et[z.component]:z?.name&&Et[z.name]?Et[z.name]:I}function p(I){return I.forEach(z=>{z.type&&(z.view=z.type)}),r.value=I.filter(z=>z.type==="pin"),I.filter(z=>z.type!=="pin")}const m=e.computed(()=>{let I;return n.panels&&n.panels.length>0?I=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(I=n.data.filter(B=>B.type.includes("tabs"))[0]?.items),Hn(I,12)}),S=e.computed(()=>a.value);function w(){l||(l=!0)}const g=e.computed(()=>{let I;return n.panels&&n.panels.length>0?I=n.normalizeTabs?p(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(I=n.data),Hn(I,12)}),x=e.computed(()=>({[`view-${n.view}`]:!0}));function _(I,z){if(!I||typeof z!="string"||!z)return{found:!1,value:void 0};const B=z.split(".");let q=I;for(const ee of B){if(q==null||typeof q!="object"&&!Array.isArray(q))return{found:!1,value:void 0};if(!(ee in q))return{found:!1,value:void 0};q=q[ee]}return{found:!0,value:q}}const W=I=>{const z={...I};return Object.entries(z).forEach(([B,q])=>{if(B!=="props"&&typeof q=="string"){const ee=_(n.data,q);ee.found&&(z[B]=ee.value)}}),I.props&&typeof I.props=="object"&&Object.entries(I.props).forEach(([B,q])=>{if(typeof q=="string"){const ee=_(n.data,q);z[B]=ee.found?ee.value:q}else z[B]=q}),delete z.props,n.data&&(z.data=n.data),z};function N(I){const z=["col-span-12"],B=Lr(I.col);return B.length&&z.push(...B),z}const C=e.ref([]),T=e.ref([]),v=e.ref([]);function E(I,z){I&&I instanceof HTMLElement&&(C.value[z]=I)}function y(){T.value=C.value.map(I=>I.offsetWidth),v.value=C.value.map(I=>I.offsetLeft)}function D(){if(typeof window>"u")return null;const I=S.value;if(!I)return null;const B=new URL(window.location.href).searchParams.get(I);if(B===null)return null;const q=Number.parseInt(B,10);return Number.isNaN(q)?null:q}function R(I){if(typeof window>"u")return;const z=S.value;if(!z||!l)return;const B=new URL(window.location.href);I<=0?B.searchParams.delete(z):B.searchParams.set(z,String(I));const q=window.history.state??{};window.history.replaceState(q,document.title,B)}function H(){if(i||!m.value.length)return;w();const I=D();if(I===null)return;const z=Math.min(Math.max(I,0),m.value.length-1);z!==I&&R(z),z!==s.value&&(s.value=z),i=!0}function K(){i=!1,H()}let G=null;return e.onMounted(()=>{e.nextTick(()=>{H(),y()}),typeof window<"u"&&window.addEventListener("popstate",K),G=new ResizeObserver(()=>y()),G.observe(document.body)}),e.onBeforeUnmount(()=>{G?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",K)}),e.watch(s,I=>{e.nextTick(()=>{y()}),R(I)}),e.watch(m,()=>{i=!1,H()}),(I,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||x.value)},[e.createElementVNode("div",zu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",ju,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(B,q)=>(e.openBlock(),e.createElementBlock("div",{key:B.name||q,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[B.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:B.html,class:"text-gray-900 leading-relaxed"},null,8,Hu)):B.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(B.component,B)),e.mergeProps({key:1,ref_for:!0},B.component==="Card"?B:W(B),{id:t.data.id,class:["w-full h-full",t.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")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[T.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:T.value[s.value]+"px",left:v.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,q)=>(e.openBlock(),e.createElementBlock("button",{key:B.name||q,ref_for:!0,ref:ee=>E(ee,q),onClick:ee=>s.value=q,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===q?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(B.title||B.label||B.name||`Tab ${q+1}`),11,Uu))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,q)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:B.name||q,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===q?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[B.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:B.html,class:"text-gray-900 leading-relaxed"},null,8,Wu)):I.$slots[`tab-${q}`]?e.renderSlot(I.$slots,`tab-${q}`,{key:1,item:B,data:t.data}):B.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(rn),e.mergeProps({key:2,ref_for:!0},W(B),{items:B.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):B.component||B.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(B.component||B.name,B)),e.mergeProps({key:3,ref_for:!0},B.component==="Card"?B:W(B),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(I.$slots,B.slot||`tab-${q}`,{key:4,item:B,data:t.data})],2)),[[e.vShow,s.value===q]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",Ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,q)=>(e.openBlock(),e.createElementBlock("button",{key:B.name||q,onClick:ee=>s.value=q,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===q?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(B.title||B.label||B.name||`Tab ${q+1}`)+" ",1),s.value===q?(e.openBlock(),e.createElementBlock("span",Zu,[...z[0]||(z[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,Gu))),128))]),e.createElementVNode("div",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(B,q)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:B.name||q,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===q?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[B.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:B.html,class:"text-gray-900 leading-relaxed"},null,8,Ju)):I.$slots[`tab-${q}`]?e.renderSlot(I.$slots,`tab-${q}`,{key:1,item:B,data:t.data}):B.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(rn),e.mergeProps({key:2,ref_for:!0},W(B),{items:B.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):B.component||B.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(B.component||B.name,B)),e.mergeProps({key:3,ref_for:!0},B.component==="Card"?B:W(B),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(I.$slots,B.slot||`tab-${q}`,{key:4,item:B,data:t.data})],2)),[[e.vShow,s.value===q]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(B,q)=>(e.openBlock(),e.createElementBlock("div",{key:B.name||B.component||q,class:e.normalizeClass(N(B))},[I.$slots[`panel-${q}`]?e.renderSlot(I.$slots,`panel-${q}`,{key:0,item:B,data:t.data}):B.items||B.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(rn),e.mergeProps({key:1,ref_for:!0},W(B),{items:B.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):B.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(B.component,B)),e.mergeProps({key:2,ref_for:!0},W(B),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",Qu,[e.renderSlot(I.$slots,B.slot||`panel-${q}`,{item:B,data:t.data})]))],2))),128))])],2))],2)])],2))}}),Vu=["onClick"],Ar=Xe(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 l={id:s++,timer:setTimeout(()=>{i(l.id)},1500)};o.value.push(l)},i=l=>{const a=o.value.findIndex(c=>c.id===l);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(l=>{clearTimeout(l.timer)})}),(l,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(Zr),{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=>i(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Wn),{class:"h-4 w-4"})],8,Vu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-55903525"]]);ln.install=function(t){t.component("vs-widget-file",bn),t.component("vs-widget-comments",pn),t.component("vs-widget-history",vn),t.component("vs-widget-gallery",kn),t.component("vs-widget-map",At),t.component("vs-group-interface",jn),t.component("CommentsWidget",pn),t.component("HistoryWidget",vn),t.component("GalleryWidget",kn),t.component("FilesWidget",bn),t.component("MapWidget",At),t.component("Card",ln),t.component("CardItem",rn),t.component("DescriptionListWidget",Jn),t.component("CopyNotification",Ar),t.component("GroupInterfaceWidget",jn)},ve.Card=ln,ve.CardItem=rn,ve.CommentsWidget=pn,ve.CopyNotification=Ar,ve.DescriptionListWidget=Jn,ve.FilesWidget=bn,ve.GalleryWidget=kn,ve.GroupInterfaceWidget=jn,ve.HistoryWidget=vn,ve.MapWidget=At,ve.TableWidget=Br,ve.default=ln,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));