@opengis/widgets 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -788,7 +788,7 @@ const Rr = { class: "space-y-0.5" }, Pr = ["onClick"], Fr = ["onClick"], jr = {
788
788
  title: {},
789
789
  view: {},
790
790
  files: { default: () => [] },
791
- editable: { type: Boolean },
791
+ editable: { type: Boolean, default: !0 },
792
792
  maxHeight: {},
793
793
  onAddFile: {},
794
794
  id: {},
@@ -1,4 +1,4 @@
1
- (function(V,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],t):(V=typeof globalThis<"u"?globalThis:V||self,t(V.WidgetLib={},V.Vue,V.OpenGISCore))})(this,(function(V,t,We){"use strict";function Fs(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const js=Fs(t);const ao=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Hs=e=>{const n=zs(e);return n.charAt(0).toUpperCase()+n.slice(1)},Us=(...e)=>e.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var xt={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 qs=({size:e,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>t.h("svg",{...xt,width:e||xt.width,height:e||xt.height,stroke:s||xt.stroke,"stroke-width":o?Number(n)*24/Number(e):n,class:Us("lucide",...l?[`lucide-${ao(Hs(l))}-icon`,`lucide-${ao(l)}`]:["lucide-icon"]),...a},[...r.map(u=>t.h(...u)),...c.default?[c.default()]:[]]);const Y=(e,n)=>(o,{slots:s})=>t.h(qs,{...o,iconNode:n,name:e},s);const Ws=Y("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 Ks=Y("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Gs=Y("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 co=Y("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 Js=Y("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 Ke=Y("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 Zs=Y("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 Ys=Y("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 Xs=Y("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 Qs=Y("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 po=Y("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 Vs=Y("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 fo=Y("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const er=Y("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 mo=Y("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 tr=Y("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 nr=Y("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 on=Y("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 or=Y("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 sn=Y("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 sr=Y("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 rn=Y("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rr={class:"border-t pt-3 mt-4"},ir={class:"flex gap-2"},lr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ar={class:"flex-1 space-y-2"},cr={class:"flex justify-between items-center"},dr={class:"flex gap-2"},pr=["disabled"],uo=t.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:t.mergeModels(["sendComment"],["update:isReply"]),setup(e,{emit:n}){const o=t.useModel(e,"isReply"),s=t.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(t.openBlock(),t.createElementBlock("div",rr,[t.createElementVNode("div",ir,[t.createElementVNode("span",lr,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("div",ar,[t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[t.vModelText,s.value]]),t.createElementVNode("div",cr,[c[4]||(c[4]=t.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),t.createElementVNode("div",dr,[o.value?(t.openBlock(),t.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]=u=>o.value=!1)},[t.createVNode(t.unref(rn),{class:"h-3 w-3"}),c[2]||(c[2]=t.createTextVNode(" Cancel ",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[t.createVNode(t.unref(mo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=t.createTextVNode(" Send ",-1))],8,pr)])])])])]))}}),fr={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"},mr=t.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:t.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(e,{emit:n}){const o=n,s=t.useModel(e,"showMoreOptions"),r=t.ref(),l=t.ref(!0),i=async u=>{s.value&&r.value&&!r.value.contains(u.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return t.onMounted(()=>{document.addEventListener("click",i)}),t.onUnmounted(()=>{document.removeEventListener("click",i)}),(u,p)=>(t.openBlock(),t.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[t.createElementVNode("div",fr,[t.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},[t.createVNode(t.unref(nr),{class:"h-3 w-3 mr-2"}),p[0]||(p[0]=t.createTextVNode(" Edit ",-1))]),t.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},[t.createVNode(t.unref(on),{class:"h-3 w-3 mr-2"}),p[1]||(p[1]=t.createTextVNode(" Delete ",-1))])])],512))}}),ur={class:"space-y-2"},hr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},gr={class:"flex-1 min-w-0 space-y-1 relative"},yr={class:"flex items-center gap-2"},vr={class:"font-medium text-xs"},br={class:"text-xs text-gray-500"},kr={key:0,class:"text-xs text-gray-700 leading-relaxed"},Er={class:"flex justify-between text-xs"},xr={class:"flex items-center gap-2"},wr={key:0,class:"flex gap-2"},Nr=["disabled"],Cr={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Sr=t.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(e,{emit:n}){const o=n,s=e,r=t.ref(s.comment.text),l=t.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=t.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=t.ref(!1),c=t.ref(!1),u=t.ref(!1),p=t.ref(!1),f=w=>{const S=new Date,I=Math.floor((S.getTime()-w.getTime())/(1e3*60*60));return I<1?`${Math.floor((S.getTime()-w.getTime())/6e4)}m`:I<24?`${I}h`:`${Math.floor(I/24)}d`},b=()=>{p.value=!p.value,p.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},k=()=>{o("edit",s.comment.id,r.value),u.value=!1},E=(w,S)=>{o("like",w,S)},N=(w,S)=>{o("edit",w,S)};return(w,S)=>{const I=t.resolveComponent("CommentItem",!0);return t.openBlock(),t.createElementBlock("div",ur,[t.createElementVNode("div",{class:t.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",u.value?"bg-gray-50":""])},[t.createElementVNode("span",hr,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("div",gr,[t.createElementVNode("div",yr,[t.createElementVNode("span",vr,t.toDisplayString(e.comment?.author),1),t.createElementVNode("span",br,t.toDisplayString(f(e.comment?.createdAt)),1)]),u.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,"onUpdate:modelValue":S[0]||(S[0]=B=>r.value=B),class:t.normalizeClass(u.value?i.value:l.value)},null,2)),[[t.vModelText,r.value]]):(t.openBlock(),t.createElementBlock("p",kr,t.toDisplayString(e.comment?.text),1)),t.createElementVNode("div",Er,[t.createElementVNode("div",xr,[t.createElementVNode("button",{class:t.normalizeClass(["flex items-center gap-1",p.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:S[1]||(S[1]=B=>b())},[t.createVNode(t.unref(Xs),{class:t.normalizeClass(["h-3 w-3",p.value?"fill-blue-600":""])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString(e.comment?.likes),1)],2),e.isInside?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:S[2]||(S[2]=B=>c.value=!0)},[t.createVNode(t.unref(er),{class:"h-3 w-3"})])),t.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:S[3]||(S[3]=B=>a.value=!0)},[t.createVNode(t.unref(Js),{class:"h-3 w-3"})])]),u.value?(t.openBlock(),t.createElementBlock("div",wr,[t.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:S[4]||(S[4]=B=>u.value=!1)},[t.createVNode(t.unref(rn),{class:"h-3 w-3"}),S[11]||(S[11]=t.createTextVNode(" Cancel ",-1))]),t.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:S[5]||(S[5]=B=>k())},[t.createVNode(t.unref(mo),{class:"h-3 w-3 mr-1"}),S[12]||(S[12]=t.createTextVNode(" Send ",-1))],8,Nr)])):t.createCommentVNode("",!0)])]),a.value?(t.openBlock(),t.createBlock(mr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":S[6]||(S[6]=B=>a.value=B),onEdit:S[7]||(S[7]=B=>u.value=!0),onDelete:S[8]||(S[8]=B=>w.$emit("delete",e.comment?.id)),comment:e.comment},null,8,["showMoreOptions","comment"])):t.createCommentVNode("",!0)],2),e.isInside?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Cr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.comment?.replies,B=>(t.openBlock(),t.createBlock(I,{key:B.id,comment:B,isInside:!0,onDelete:L=>w.$emit("delete",B.id),onLike:E,onEdit:N},null,8,["comment","onDelete"]))),128)),c.value&&!e.isInside?(t.openBlock(),t.createBlock(uo,{key:0,onSendComment:S[9]||(S[9]=B=>w.$emit("reply",e.comment?.id,B)),isReply:c.value,"onUpdate:isReply":S[10]||(S[10]=B=>c.value=B)},null,8,["isReply"])):t.createCommentVNode("",!0)]))])}}}),_r=["id"],Br={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},wt=t.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(e,{emit:n}){const o=e,s=n,r=t.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(b=>b.json());r.value=f.rows.map(b=>({id:b.communication_id,author:b.username,text:b.body,createdAt:new Date(b.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,b)=>{o?.onLike?.(f,b),s("like",f,b)},c=(f,b)=>{o.onReply?.(f,b),s("reply",f,b)},u=async(f,b)=>{o.onEdit?o.onEdit(f,b):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:b})}),await l()),s("edit",f,b)},p=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,b)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["mx-auto font-sans",e.className]),id:e.id,style:t.normalizeStyle(e.style)},[e.title?(t.openBlock(),t.createElementBlock("h3",Br,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass([e.maxHeight?"overflow-y-auto":"","space-y-3"]),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,k=>(t.openBlock(),t.createBlock(Sr,{key:k.id,comment:k,onReply:c,onLike:a,onDelete:b[0]||(b[0]=E=>p(E)),onEdit:u},null,8,["comment"]))),128))],6),t.createVNode(uo,{onSendComment:b[1]||(b[1]=k=>i(k))})],14,_r))}}),ho=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Ke}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:tr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:or}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Qs}]]),Tr={class:"mx-auto font-sans"},$r={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Dr={class:"relative"},Lr={class:"space-y-3"},Or={class:"flex-1 min-w-0 pb-2"},Ar={class:"flex items-center gap-1.5 mb-1 mt-0.5"},Ir={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Mr={class:"font-medium text-xs"},Rr={class:"text-xs text-gray-500"},Pr={class:"space-y-1"},Fr={class:"text-xs text-gray-700"},jr={class:"capitalize mr-1"},zr={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Hr={key:0,class:"flex items-center gap-1 text-xs"},Ur={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},qr={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},Nt=t.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(e){const n=e,o=t.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(t.openBlock(),t.createElementBlock("div",Tr,[e.title?(t.openBlock(),t.createElementBlock("h3",$r,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(e.maxHeight?"overflow-y-auto":""),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[t.createElementVNode("div",Dr,[l[0]||(l[0]=t.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),t.createElementVNode("div",Lr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,i=>(t.openBlock(),t.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[t.createElementVNode("div",{class:t.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${t.unref(ho).get(i?.entityType)?.color}`)},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(ho).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),t.createElementVNode("div",Or,[t.createElementVNode("div",Ar,[t.createElementVNode("span",Ir,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("span",Mr,t.toDisplayString(i?.userName),1),t.createElementVNode("span",Rr,t.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+t.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),t.createElementVNode("div",Pr,[t.createElementVNode("div",Fr,[t.createElementVNode("span",jr,t.toDisplayString(i?.action),1),i?.entityId?(t.openBlock(),t.createElementBlock("span",zr,t.toDisplayString(i?.entityId),1)):t.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(t.openBlock(),t.createElementBlock("div",Hr,[i?.changes?.[i?.entityId]?.old?(t.openBlock(),t.createElementBlock("span",Ur,t.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):t.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(t.openBlock(),t.createBlock(t.unref(Ks),{key:1,class:"h-2 w-2 text-gray-400"})):t.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(t.openBlock(),t.createElementBlock("span",qr,t.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Wr={key:0,class:"text-xl font-semibold"},Kr={class:"flex gap-1"},Gr={key:0},Jr={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"},Zr=t.defineComponent({__name:"FileHeader",props:t.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:t.mergeModels(["onAddFile"],["update:modelValue"]),setup(e){const n=t.useModel(e,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",e.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[e.title?(t.openBlock(),t.createElementBlock("h3",Wr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Kr,[t.createElementVNode("button",{class:t.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[t.createVNode(t.unref(Vs),{class:"h-4 w-4"})],2),t.createElementVNode("button",{class:t.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[t.createVNode(t.unref(Ys),{class:"h-4 w-4"})],2),e.editable?(t.openBlock(),t.createElementBlock("label",Gr,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,32),t.createElementVNode("div",Jr,[t.createVNode(t.unref(fo),{class:"h-4 w-4"}),r[3]||(r[3]=t.createTextVNode(" Додати файл ",-1))])])):t.createCommentVNode("",!0)])],2))}}),ln={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Ke,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Zs,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:sr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ke,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Ws,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:po,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:po,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Ke,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Ke,label:"PPT"}};function go(e,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(e)}function yo(e){if(e===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Yr={class:"space-y-0.5"},Xr=["onClick"],Qr=["onClick"],Vr={class:"flex items-center gap-2"},ei={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},ti={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},ni={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},oi={class:"flex items-center gap-1"},si=["onClick"],ri=["onClick"],ii=t.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Yr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.files,s=>(t.openBlock(),t.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:t.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[t.createElementVNode("div",{class:t.normalizeClass(["p-1 rounded",t.unref(ln)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(ln)[s?.ext]?.icon||t.unref(ln).pdf.icon),{class:"h-3 w-3"}))],2),t.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[t.createElementVNode("div",Vr,[t.createElementVNode("span",ei,t.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Qr),t.createElementVNode("div",ti,t.toDisplayString(t.unref(yo)(s.size)),1),t.createElementVNode("div",ni,t.toDisplayString(t.unref(go)(s.createdAt)),1),t.createElementVNode("div",oi,[t.createElementVNode("button",{onClick:t.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"},[t.createVNode(t.unref(co),{class:"h-3 w-3"})],8,si),t.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:t.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[t.createVNode(t.unref(on),{class:"h-3 w-3"})],8,ri)])],8,Xr))),128))]))}}),li={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},ai=["onClick"],ci={class:"space-y-2"},di={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},pi=["src"],fi={class:"space-y-1"},mi=["title"],ui={class:"text-xs text-gray-500 text-left"},hi={class:"absolute top-2 right-1 flex items-center gap-1"},gi=["onClick"],yi=["onClick"],vi=t.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",li,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.files,s=>(t.openBlock(),t.createElementBlock("div",{key:s.id,onClick:t.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"},[t.createElementVNode("div",ci,[t.createElementVNode("div",di,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(t.openBlock(),t.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,pi)):(t.openBlock(),t.createBlock(t.unref(Ke),{key:1,class:"h-10 w-10 text-gray-500"}))]),t.createElementVNode("div",fi,[t.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},t.toDisplayString(s.uploaded_name||s.name),9,mi),t.createElementVNode("p",ui,t.toDisplayString(t.unref(go)(s.createdAt))+", "+t.toDisplayString(t.unref(yo)(s.size)),1)])]),t.createElementVNode("div",hi,[t.createElementVNode("button",{onClick:t.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"},[t.createVNode(t.unref(co),{class:"h-3 w-3"})],8,gi),t.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:t.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[t.createVNode(t.unref(on),{class:"h-3 w-3"})],8,yi)])],8,ai))),128))]))}}),bi={class:"mx-auto font-sans"},ki={key:1},Ct=t.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(e,{emit:n}){const o=e,s=t.ref(!1),r=t.ref(null),l=t.ref(!1),i=t.ref(0),a=t.ref(o.files??[]),c=n;a.value.length===0&&S();const u=(L,_)=>{r.value=_,s.value=!0},p=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},f=t.computed(()=>Array.isArray(a.value)?a.value.map(L=>L?.file_path):[]),b=L=>{const _=f.value.findIndex(H=>H===L.file_path);_!==-1&&(l.value=!0,i.value=_)},k=L=>{o.onAddFile?o.onAddFile(L):I(L),c("add",L)},E=L=>{o.onDelete?o.onDelete(L):B(L),c("delete",L)},N=L=>{const _=document.createElement("a");_.setAttribute("download",L?.uploaded_name||L?.name),_.href=L?.file_path||L?.path,_.click()},w=t.ref("list");async function S(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(_=>_.json());L.rows.forEach(_=>{_.timestamp=new Date(_.cdate),_.id=_.entity_id,_.entityType=_.entity_type,_.entityId=_.entity_id,_.entityType=_.entity_type,_.action=_.change_type,_.userId=_.change_user_id,_.userName=_.username,_.timestamp=new Date(_.cdate),_.description=_.username,_.status=_.username}),a.value=L.rows}const I=async L=>{if(!(!L.target||!L.target.files||L.target.files.length===0))try{await Promise.all(Array.from(L.target.files).map(async _=>{const H=new FormData;H.append("file",_);const K=`/api/widget/file/${o.id}`,M=await fetch(K,{method:"POST",body:H});if(!M.ok)throw new Error(`HTTP error! status: ${M.status}`);return _})),await S()}catch(_){console.error("Помилка при завантаженні файлів:",_)}},B=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await S()}catch(_){console.error(_)}};return(L,_)=>{const H=t.resolveComponent("MessageBox"),K=t.resolveComponent("Lightbox");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",bi,[t.createVNode(Zr,{modelValue:w.value,"onUpdate:modelValue":_[0]||(_[0]=M=>w.value=M),title:o.title,onOnAddFile:_[1]||(_[1]=M=>k(M)),editable:o.editable},null,8,["modelValue","title","editable"]),a.value.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.maxHeight?"overflow-y-auto":""),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[w.value==="list"?(t.openBlock(),t.createBlock(ii,{key:0,onDelete:u,onDownload:N,onOpenLightbox:_[2]||(_[2]=M=>b(M)),files:a.value},null,8,["files"])):t.createCommentVNode("",!0),w.value==="grid"?(t.openBlock(),t.createBlock(vi,{key:1,onDelete:u,onDownload:N,onOpenLightbox:_[3]||(_[3]=M=>b(M)),files:a.value},null,8,["files"])):t.createCommentVNode("",!0)],6)):(t.openBlock(),t.createElementBlock("div",ki,[..._[6]||(_[6]=[t.createElementVNode("div",{class:"flex items-center justify-center h-full"},[t.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),t.createVNode(H,{modelValue:s.value,"onUpdate:modelValue":_[4]||(_[4]=M=>s.value=M),onConfirm:p,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),t.createVNode(K,{modelValue:l.value,"onUpdate:modelValue":_[5]||(_[5]=M=>l.value=M),images:f.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),Ei={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},xi=["onClick"],wi={key:0,rel:"noreferrer",class:"relative block h-full w-full"},Ni=["src"],Ci={key:0,class:"thumb-cover"},Si=t.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(e,{emit:n}){const o=n,s=t.ref(!1),r=t.ref(0),l=e,i=t.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const u=i.value.findIndex(p=>p===c.file_path);u!==-1&&(s.value=!0,r.value=u)};return(c,u)=>{const p=t.resolveComponent("Lightbox");return e.items?.length>=1?(t.openBlock(),t.createElementBlock("div",Ei,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(f,b)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["h-full w-full image"+b,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:b,onClick:t.withModifiers(k=>a(f),["stop"])},[b<5?(t.openBlock(),t.createElementBlock("div",wi,[t.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:t.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",b===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,Ni),b===4&&e.items?.length>5?(t.openBlock(),t.createElementBlock("div",Ci," +"+t.toDisplayString(e.items?.length-5),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],10,xi))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Math.max(0,5-e.items.length),f=>(t.openBlock(),t.createElementBlock("div",{key:"empty-"+f,class:t.normalizeClass(["h-full w-full image"+(e.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),t.createVNode(p,{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:u[1]||(u[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):t.createCommentVNode("",!0)}}}),_i={key:0,class:"text-xl font-semibold"},Bi={class:"flex gap-1"},Ti={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"},$i=t.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",e.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[e.title?(t.openBlock(),t.createElementBlock("h3",_i,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Bi,[t.createElementVNode("label",null,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s))},null,32),t.createElementVNode("div",Ti,[t.createVNode(t.unref(fo),{class:"h-4 w-4"}),o[1]||(o[1]=t.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Di={class:"w-full mx-auto font-sans",ref:"containerRef"},Li={key:1},St=t.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(e,{emit:n}){const o=e,s=t.ref(o.items??[]),r=n;s.value.length===0&&c();const l=p=>{o.onAddImage?o.onAddImage(p):a(p),r("add",p)},i=p=>{const f=s.value.find(b=>b.file_path===p)?.file_id;f&&(o.onDelete?o.onDelete(f):u(f))},a=async p=>{if(!(!p.target||!p.target.files||p.target.files.length===0))try{await Promise.all(Array.from(p.target.files).map(async f=>{const b=new FormData;b.append("file",f);const k=`/api/widget/file/${o.id}`,E=await fetch(k,{method:"POST",body:b});if(!E.ok)throw new Error(`HTTP error! status: ${E.status}`);return f})),await c()}catch(f){console.error("Помилка при завантаженні файлів:",f)}};async function c(){if(!o.id)return;const p=await fetch(`/api/widget/file/${o.id}`).then(f=>f.json());s.value=p.rows}const u=async p=>{try{await fetch(`/api/widget/file/${o.id}/${p}`,{method:"DELETE"}),await c()}catch(f){console.error(f)}};return(p,f)=>(t.openBlock(),t.createElementBlock("div",Di,[t.createVNode($i,{title:e.title,onOnAddImage:f[0]||(f[0]=b=>l(b))},null,8,["title"]),s.value.length>0?(t.openBlock(),t.createBlock(Si,{key:0,items:s.value,onDelete:f[1]||(f[1]=b=>i(b))},null,8,["items"])):(t.openBlock(),t.createElementBlock("div",Li,[...f[2]||(f[2]=[t.createElementVNode("div",{class:"flex items-center justify-center h-full"},[t.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),Oi={class:"text-value"},Ai={class:"text-sm text-gray-900"},Ii=t.defineComponent({__name:"TextValue",props:{item:{}},setup(e){const n=e,o=t.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(t.openBlock(),t.createElementBlock("div",Oi,[t.createElementVNode("span",Ai,t.toDisplayString(o.value),1)]))}}),Me=(e,n)=>{const o=e.__vccOpts||e;for(const[s,r]of n)o[s]=r;return o},Mi=Me(Ii,[["__scopeId","data-v-c14550b7"]]),Ri={class:"link-value"},Pi=["href"],Fi=Me(t.defineComponent({__name:"LinkValue",props:{item:{}},setup(e){const n=e,o=t.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(t.openBlock(),t.createElementBlock("div",Ri,[t.createElementVNode("a",{href:String(e.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[t.createTextVNode(t.toDisplayString(o.value)+" ",1),r[0]||(r[0]=t.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Pi)]))}}),[["__scopeId","data-v-e6eb07a6"]]),ji={class:"date-value"},zi={class:"text-sm text-gray-900"},Hi=Me(t.defineComponent({__name:"DateValue",props:{item:{}},setup(e){const n=e,o=t.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)=>(t.openBlock(),t.createElementBlock("div",ji,[t.createElementVNode("span",zi,t.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),Ui={class:"status-value"},qi={key:0,class:"mr-1"},Wi=Me(t.defineComponent({__name:"StatusValue",props:{item:{}},setup(e){const n=e,o=t.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=t.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(t.openBlock(),t.createElementBlock("div",Ui,[t.createElementVNode("span",{class:t.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(t.openBlock(),t.createElementBlock("span",qi,[t.createElementVNode("i",{class:t.normalizeClass(s.value)},null,2)])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(String(e.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),Ki={class:"custom-value"},Gi={class:"text-sm text-gray-900"},Ji=Me(t.defineComponent({__name:"CustomValue",props:{item:{}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Ki,[t.renderSlot(n.$slots,"default",{item:e.item,value:e.item.value},()=>[t.createElementVNode("span",Gi,t.toDisplayString(String(e.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),Zi=["id"],Yi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Xi={key:1,class:"overflow-x-auto"},Qi={class:"min-w-full divide-y divide-gray-200"},Vi={class:"bg-white divide-y divide-gray-200"},el={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},tl={class:"flex items-center gap-2"},nl=["title"],ol={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},sl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},rl={class:"flex items-start gap-3"},il={key:0,class:"flex-shrink-0"},ll={class:"flex-1 min-w-0"},al={class:"flex items-center gap-2 mb-2"},cl={class:"text-sm font-medium text-gray-900"},dl=["title"],pl={key:3,class:"overflow-x-auto"},fl={class:"min-w-full divide-y divide-gray-200"},ml={class:"bg-white divide-y divide-gray-200"},ul={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},hl={class:"flex items-center gap-2"},gl=["title"],yl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},an=Me(t.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(e){const n=o=>{switch(o.type){case"link":return Fi;case"date":return Hi;case"status":return Wi;case"custom":return Ji;default:return Mi}};return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["description-list-widget",e.className]),id:e.id,style:t.normalizeStyle(e.style)},[e.title?(t.openBlock(),t.createElementBlock("h3",Yi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.view==="table"?(t.openBlock(),t.createElementBlock("div",Xi,[t.createElementVNode("table",Qi,[t.createElementVNode("tbody",Vi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("tr",{key:r.id||r.label},[t.createElementVNode("td",el,[t.createElementVNode("div",tl,[r.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([r.icon,"text-gray-500"])},null,2)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(r.label)+" ",1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,nl)):t.createCommentVNode("",!0)])]),t.createElementVNode("td",ol,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):e.view==="grid"?(t.openBlock(),t.createElementBlock("div",sl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[t.createElementVNode("div",rl,[r.icon?(t.openBlock(),t.createElementBlock("div",il,[t.createElementVNode("i",{class:t.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):t.createCommentVNode("",!0),t.createElementVNode("div",ll,[t.createElementVNode("div",al,[t.createElementVNode("h4",cl,t.toDisplayString(r.label),1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,dl)):t.createCommentVNode("",!0)]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(t.openBlock(),t.createElementBlock("div",pl,[t.createElementVNode("table",fl,[t.createElementVNode("tbody",ml,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("tr",{key:r.id||r.label},[t.createElementVNode("td",ul,[t.createElementVNode("div",hl,[r.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([r.icon,"text-gray-500"])},null,2)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(r.label)+" ",1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,gl)):t.createCommentVNode("",!0)])]),t.createElementVNode("td",yl,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Zi))}}),[["__scopeId","data-v-36d43e50"]]),vl={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function vo(e){return e?e.type==="FeatureCollection"||e.type==="Feature"?e:e.geom?{type:"Feature",geometry:{type:e.geom.type,coordinates:e.geom.coordinates},properties:{}}:e.type&&e.coordinates?{type:"Feature",geometry:e,properties:{}}:null:null}const bl={key:0,class:"absolute inset-0 z-[600] flex items-center justify-center pointer-events-none bg-black/20"},kl={class:"bg-black/70 text-white text-xs sm:text-sm px-4 py-2 rounded-md shadow"},El={class:"bg-white/95 border border-gray-200 rounded-md shadow-xl px-3 py-2 max-w-[240px] text-[11px] sm:text-xs text-gray-900"},xl={class:"space-y-0.5"},wl={class:"text-gray-500"},Nl={class:"text-gray-900 text-right break-all"},Cl={key:2,class:"absolute bottom-3 left-3 z-[400] bg-white/90 border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Sl={class:"leading-tight"},_l={key:4,class:"bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer max-w-[400px]"},Bl={class:"flex items-center justify-between p-2 border-b"},Tl={class:"p-2 border-b"},$l={class:"flex items-center"},Dl=["value"],Ll={class:"ml-2"},Ol={class:"p-2"},Al={class:"flex items-center"},Il=["checked","onChange"],Ml={class:"ml-2"},_t=t.defineComponent({__name:"MapWidget",props:{pattern:{},geom:{},id:{},katottg:{},tms:{},layers:{},title:{},height:{},bounds:{},legend:{},ctrlZoom:{type:Boolean}},setup(e){function n(g){let y=g?.parent??null;for(;y;){const d=y.props?.view;if(d==="tabs"||d==="vertical-tabs")return!0;y=y.parent??null}return!1}const o=e,s=t.getCurrentInstance(),r=t.inject("vsCardTabsContext",!1),l=t.computed(()=>(typeof r=="boolean"?r:r.value)?!0:n(s)),i=s?.appContext.config.globalProperties?.$settings??{},a=(()=>{const g=Array.isArray(i.center)?i.center:[],y=Number(g[0]),d=Number(g[1]);return Number.isFinite(y)&&Number.isFinite(d)?[y,d]:[50,30]})(),c=s?.uid??Math.floor(Math.random()*1e4),u=t.ref(null);let p,f,b,k;const E=ke(),N=t.ref(Object.keys(E)[0]),w=`base-layer-${c}`;let S;const I=t.ref(!0),B=t.ref(!1),L=t.ref(!1),_=t.ref(!1),H=t.ref("Використовуйте Ctrl + колесо миші для зміни масштабу");let K=null;const M=t.ref([]),A=t.reactive({}),F=t.ref([]),j=t.computed(()=>F.value.map(g=>A[g]).filter(Boolean)),C=t.ref(null),T=t.computed(()=>C.value?.entries??[]),x=t.computed(()=>{if(!C.value)return;const g=12,y=C.value.point.x+g,d=C.value.point.y+g;return{left:`${y}px`,top:`${d}px`}}),$=t.computed(()=>Array.isArray(o.legend)?o.legend.map((g,y)=>{const d=typeof g?.color=="string"?g.color.trim():"",m=typeof g?.label=="string"?g.label.trim():"";return!d||!m?null:{color:d,label:m,key:`${m}-${y}`}}).filter(g=>!!g):[]),J=t.computed(()=>{if(B.value)return"fixed inset-0 w-screen h-screen z-[9999] bg-white";const g=["relative","h-full"];return o.height||g.push("min-h-[300px]"),o.title&&!l.value&&g.push("pb-[3.25rem]"),g.join(" ")}),le=t.computed(()=>B.value||o.height==null?void 0:{height:typeof o.height=="number"?`${o.height}px`:String(o.height)}),Ie=t.computed(()=>{const g=["w-full","h-full"];return!o.height&&!B.value&&g.push("min-h-[300px]"),g.join(" ")});async function _e(){const g=m=>{if(!Array.from(document.styleSheets??[]).some(v=>v?.href?.includes(m))){const v=document.createElement("link");v.rel="stylesheet",v.href=m,document.head.appendChild(v)}};g("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),g("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css");const y=m=>new Promise((h,v)=>{if(Array.from(document.scripts??[]).some(P=>P.src===m))return h();const R=document.createElement("script");R.src=m,R.async=!0,R.onload=()=>h(),R.onerror=P=>v(P),document.body.appendChild(R)});return await y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").catch(()=>{}),await y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js").catch(()=>{}),await y("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>{}),window.L}function ke(){const g=y=>y.map((d,m)=>{const h=typeof d?.key=="string"&&d.key?d.key:`b${m}`,v=xe(d?.url);return v?{...d,key:h,url:v}:null}).filter(d=>!!d).reduce((d,m)=>({...d,[m.key]:m}),{});return Array.isArray(i?.basemaps)&&i.basemaps.length?g(i.basemaps):g([{key:"topo100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}])}function xe(g){if(typeof g!="string"||!g.trim())return"";const y=g.trim();if(/^https?:\/\//i.test(y))return y;const d=window.location?.origin??"",m=y.replace(/^\/+/,"");return d?`${d}/${m}`:`/${m}`}function we(g,y){return g?.id!=null?String(g.id):g?.url?`${g.url}-${y}`:`layer-${y}`}function Qn(g){if(!g||typeof g!="object")return;const y={},d=O=>{if(typeof O=="string"){const D=O.trim().replace(/,+$/,"");return D?/^-?\d+(\.\d+)?$/.test(D)?Number(D):D:void 0}return O},m=()=>(y.colorSet||(y.colorSet={}),y.colorSet),h=(O,D)=>{if(O==null||typeof D!="string")return;const R=D.trim().replace(/,+$/,"");R&&(m()[String(O)]=R)},v=O=>{const D=["color","fill","hex","valueColor","value_color"].map(P=>O[P]).find(P=>typeof P=="string"&&P.trim());if(!D)return!1;const R=["value","key","id","code","status"].map(P=>O[P]).find(P=>P!=null&&P!=="");return R==null?!1:(h(R,D),!0)};return Object.entries(g).forEach(([O,D])=>{if(O==="colorSet"&&D!=null){Array.isArray(D)?D.forEach(P=>{P&&(typeof P=="object"&&v(P)||typeof P=="object"&&Object.entries(P).forEach(([he,ge])=>h(he,typeof ge=="string"?ge:void 0)))}):typeof D=="object"&&(v(D)||Object.entries(D).forEach(([P,he])=>h(P,typeof he=="string"?he:void 0)));return}const R=d(D);if(R!==void 0){if(O==="border"){typeof R=="number"&&y.width==null?y.width=R:typeof R=="string"&&y.stroke==null&&(y.stroke=R);return}y[O]=R}}),y.colorSet&&!Object.keys(y.colorSet).length&&delete y.colorSet,Object.keys(y).length?y:void 0}function Vn(){if(Array.isArray(o.layers)&&o.layers.length)return o.layers.map((y,d)=>{if(!y)return null;const m=we(y,d),h=y.url||(o.pattern&&m?o.pattern.replace("{{id}}",String(y.id??m)):"");return h?{...y,id:m,url:h,name:y.name||`Шар ${d+1}`,style:Qn(y.style)}:null}).filter(y=>!!y?.url);const g=Array.isArray(o.tms)?o.tms:o.tms?.split(",");return g?g.map((y,d)=>{if(!y)return null;const m=typeof y=="string"?y.trim():`${y}`;if(!m)return null;const h=`legacy-${d}`,v=o.pattern?o.pattern.replace("{{id}}",m):m;return{id:h,name:`Шар ${d+1}`,url:v,visible:!0}}).filter(y=>!!y?.url):[]}function ht(g){const y=(g?.url??"").trim();if(!y)return"";if(/^https?:\/\//i.test(y))return y;const d=window.location?.origin??"",m=y.replace(/^\/+/,"");return`${d}/${m}`}function Zt(g){const y=g.style??{};return d=>{const m=y.colorAttr,h=y.colorSet??{},v=typeof m=="string"?h?.[d?.[m]]??y.color??"#3388ff":y.color??"#3388ff",O=y.stroke??v;return{weight:y.width??1,color:O,opacity:y.opacity??1,fill:y.type?y.type!=="polyline":!0,fillColor:v,fillOpacity:y.opacity??.5}}}function Yt(g,y){if(!p||!y?.latlng||g.popup===!1)return;const d=p.latLngToContainerPoint(y.latlng),m=gt(y),h=Xt(g,m);if(!h.length){et(g.id);return}C.value={layerId:g.id,title:m?.name??g.name,properties:m,entries:h,point:{x:d.x,y:d.y}}}function et(g){g&&C.value?.layerId!==g||(C.value=null)}function gt(g){return g?.layer?.properties||g?.layer?.feature?.properties||g?.properties||g?.data||{}}function Xt(g,y={}){const d=m=>m==null||m===""?"—":typeof m=="object"?JSON.stringify(m):String(m);return g.popup&&Array.isArray(g.popup)&&g.popup.length?g.popup.map(m=>({label:m.label||m.field,value:d(y?.[m.field])})):Object.entries(y).map(([m,h])=>({label:m,value:d(h)}))}function eo(g,y){if(!p||g.popup===!1||!y?.latlng)return;const d=gt(y),m=Xt(g,d);if(!m.length)return;const h=['<div class="map-popup">'];h.push('<div class="map-popup__body">'),m.forEach(v=>{h.push(`<div class="map-popup__row"><span class="map-popup__label">${v.label}: </span><span class="map-popup__value">${v.value}</span></div>`)}),h.push("</div></div>"),k.popup({maxWidth:360}).setLatLng(y.latlng).setContent(h.join("")).openOn(p)}t.onMounted(async()=>{k=await _e(),k.drawLocal={...vl};const g=typeof i?.zoom=="number"&&Number.isFinite(i.zoom)?i.zoom:10;p=k.map(u.value,{zoomControl:!1}).setView(a,g),k.control.zoom({position:"bottomright"}).addTo(p),S=k.tileLayer(E[N.value].url,{maxZoom:19}).addTo(p),f=new k.FeatureGroup().addTo(p),bt(),qe(),o.ctrlZoom&&(K=Et());const y=vo(o.geom);if(y){const d=[];k.geoJSON(y).eachLayer(m=>d.push(m)),d.length&&f.addLayer(d[0]),kt()}if(u.value){const d=new ResizeObserver(()=>{p&&p.invalidateSize()});d.observe(u.value),t.onBeforeUnmount(()=>{d.disconnect()})}});function to(){if(!f)return;f.clearLayers();const g=vo(o.geom);if(!g)return;const y=[];k.geoJSON(g).eachLayer(d=>y.push(d)),y.length&&(y.forEach(d=>f.addLayer(d)),kt())}t.onBeforeUnmount(()=>{K?.(),oo(),b&&p?.hasLayer(b)&&p.removeLayer(b)});function Be(g){const y=(g?.service??"").toLowerCase();if(y)return y;const d=(g?.url??"").toLowerCase();return/\.(mvt|pbf|vtile|vmt)(\?|$)/.test(d)?"vtile":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(d)?"wms":""}function Qt(g){const y=Be(g),d=ht(g),h={opacity:g?.style?.opacity??1,...g.options??{}},v=!!(g?.style&&Object.keys(g.style).length),O=g.sourceLayer||g.layer||g.service_layer||g.service_key||g.map_key||g.dataset?.layer||g.id;if(y==="vtile"){const D=k?.vectorGrid;if(D?.protobuf&&(v||!k?.maplibreGL)){const R=D.protobuf(d,{interactive:!0,maxNativeZoom:g.maxzoom??19,vectorTileLayerStyles:{[O??"default"]:Zt(g),default:Zt(g)}});return R.on?.("mouseover",P=>Yt(g,P)),R.on?.("mousemove",P=>Yt(g,P)),R.on?.("mouseout",()=>et(g.id)),R.on?.("click",P=>eo(g,P)),R}if(!v&&k?.maplibreGL&&window?.maplibregl){const R=d;return k.maplibreGL({style:R,interactive:!1,pane:"overlayPane"})}}if(y==="wms"&&k?.tileLayer?.wms){const D={...g.params??{}};return O&&!D.layers&&(D.layers=O),D.format==null&&(D.format="image/png"),D.transparent==null&&(D.transparent=!0),k.tileLayer.wms(d,{...D,...h})}return k.tileLayer(d,h)}function yt(g){const y=("bounds"in g?g.bounds:void 0)??o.bounds??M.value;if(!Array.isArray(y)||!y.length||!k)return null;const m={color:g.style?.stroke??g.style?.color??"#2563eb",weight:g.style?.width??2,interactive:!1,opacity:g.style?.opacity??.8,dashArray:"4 4"},h=Array.isArray(g.bounds)&&g.bounds.length?g.bounds:y,v=no(h);if(!v.length||!k.polyline)return null;const O=v.map(D=>{if(!D.length)return D;const R=D[0],P=D[D.length-1];return R&&P&&(!P.equals||!P.equals(R))?[...D,R]:D});return k.polyline(O,m)}function no(g){const y=h=>{if(!Array.isArray(h)||h.length<2)return null;const[v,O]=h;return!Number.isFinite(Number(O))||!Number.isFinite(Number(v))?null:k.latLng(Number(O),Number(v))},d=h=>Array.isArray(h)&&h.length>=2&&h.every(v=>Number.isFinite(Number(v))),m=h=>Array.isArray(h)?h.map(y).filter(Boolean):[];if(!Array.isArray(g))return[];if(g.length&&d(g[0])){const h=g.map(y).filter(Boolean);return h.length?[h]:[]}if(g.length&&Array.isArray(g[0])){if(d(g[0][0]))return g.map(v=>m(v)).filter(v=>v.length);if(Array.isArray(g[0][0])&&d(g[0][0][0]))return g.flatMap(v=>Array.isArray(v)?v.map(O=>m(O)).filter(O=>O.length):[]).filter(v=>v.length)}return[]}function oo(){Object.values(A).forEach(g=>{g.layer&&p?.hasLayer(g.layer)&&p.removeLayer(g.layer),g.boundsLayer&&p?.hasLayer(g.boundsLayer)&&p.removeLayer(g.boundsLayer),g.layer=null,g.boundsLayer=null}),et()}function qe(){if(!p)return;b&&p.hasLayer(b)&&p.removeLayer(b);const g=yt({id:"global-bounds",bounds:o.bounds,style:{}});g?(b=g,b.addTo(p)):b=null}function vt(){p&&F.value.forEach(g=>{const y=A[g];y&&(y.visible?(y.layer||(y.layer=Qt(y.config)),y.boundsLayer||(y.boundsLayer=yt(y.config)),y.layer&&!p.hasLayer(y.layer)&&y.layer.addTo(p),y.boundsLayer&&!p.hasLayer(y.boundsLayer)&&y.boundsLayer.addTo(p)):(y.layer&&p.hasLayer(y.layer)&&p.removeLayer(y.layer),y.boundsLayer&&p.hasLayer(y.boundsLayer)&&p.removeLayer(y.boundsLayer)))})}function bt(){const g=Vn(),y=[],d=new Set;g.forEach((m,h)=>{const v=we(m,h);y.push(v),d.add(v);const O=A[v];O&&O.config.url!==m.url&&(O.layer&&p?.hasLayer(O.layer)&&p.removeLayer(O.layer),O.layer=null);const D=O?.visible??m.visible??!1;A[v]={id:v,config:{...m,id:v},visible:D,layer:O?.layer??null,boundsLayer:O?.boundsLayer??null}}),Object.keys(A).forEach(m=>{if(!d.has(m)){const h=A[m];h?.layer&&p?.hasLayer(h.layer)&&p.removeLayer(h.layer),delete A[m]}}),F.value=y,p&&vt()}function so(g,y){const d=typeof y=="boolean"?y:y.target?.checked;if(d==null)return;const m=A[g];m&&(m.visible=d,m.visible?(m.layer||(m.layer=Qt(m.config)),m.boundsLayer||(m.boundsLayer=yt(m.config)),m.layer&&!p.hasLayer(m.layer)&&m.layer.addTo(p),m.boundsLayer&&!p.hasLayer(m.boundsLayer)&&m.boundsLayer.addTo(p)):(m.layer&&p.hasLayer(m.layer)&&(p.removeLayer(m.layer),et(g)),m.boundsLayer&&p.hasLayer(m.boundsLayer)&&p.removeLayer(m.boundsLayer)))}function ro(g){Vt(g),N.value=g}function Vt(g){if(!p||!E[g])return;S&&S.removeFrom(p);const y=E[g];S=k.tileLayer(y.url,y.options||{}).addTo(p),S.bringToBack()}function en(){!p||!f||I.value&&!p.hasLayer(f)&&f.addTo(p)}function io(){ro(N.value)}function lo(){I.value?f.addTo(p):f.removeFrom(p)}function tn(){B.value=!B.value}function kt(g=30){const y=f.getLayers();if(!y.length)return;const m=k.featureGroup(y).getBounds();m&&m.isValid()&&p.fitBounds(m,{padding:[g,g],maxZoom:16})}function Et(){if(!p||!u.value)return null;p.scrollWheelZoom.disable(),H.value="Використовуйте Ctrl + колесо миші для зміни масштабу";let g;const y=(m=1500)=>{_.value=!0,g&&clearTimeout(g),g=window.setTimeout(()=>_.value=!1,m)},d=m=>{if(!(m.ctrlKey||m.metaKey||m.shiftKey)){y(),p.scrollWheelZoom.disable();return}m.preventDefault(),m.stopPropagation(),p.scrollWheelZoom.enable(),_.value=!1,g&&clearTimeout(g),g=window.setTimeout(()=>p.scrollWheelZoom.disable(),200)};return u.value.addEventListener("wheel",d,{passive:!1}),()=>{p.scrollWheelZoom.enable(),u.value?.removeEventListener("wheel",d),g&&clearTimeout(g),_.value=!1}}return t.watch(B,async()=>{await t.nextTick(),requestAnimationFrame(()=>{p?.invalidateSize(!0),Vt(N.value),en(),vt(),b&&!p?.hasLayer(b)&&b.addTo(p)})}),t.watch(()=>o.layers,()=>bt(),{deep:!0}),t.watch(()=>[o.tms,o.pattern],()=>{o.layers?.length||bt()}),t.watch(()=>o.bounds,()=>qe(),{deep:!0}),t.watch(()=>o.geom,()=>to(),{deep:!0}),t.watch(()=>o.katottg,async g=>{if(M.value=[],!g){qe();return}try{const y=await fetch(`https://data.gki.com.ua/api-user/atu/${g}`);if(!y?.ok)return;const m=(await y.json())?.geometry?.coordinates;Array.isArray(m)&&m.length&&(M.value=m)}catch(y){console.error("Failed to fetch KATOTTG bounds",y)}finally{qe(),vt()}},{immediate:!0}),(g,y)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(J.value),style:t.normalizeStyle(le.value)},[t.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:t.normalizeClass(Ie.value)},null,2),_.value?(t.openBlock(),t.createElementBlock("div",bl,[t.createElementVNode("div",kl,t.toDisplayString(H.value),1)])):t.createCommentVNode("",!0),T.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,class:"absolute z-[550] pointer-events-none",style:t.normalizeStyle(x.value)},[t.createElementVNode("div",El,[t.createElementVNode("dl",xl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,d=>(t.openBlock(),t.createElementBlock("div",{key:`${d.label}-${d.value}`,class:"flex justify-between gap-2"},[t.createElementVNode("dt",wl,t.toDisplayString(d.label),1),t.createElementVNode("dd",Nl,t.toDisplayString(d.value),1)]))),128))])])],4)):t.createCommentVNode("",!0),$.value.length?(t.openBlock(),t.createElementBlock("div",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,d=>(t.openBlock(),t.createElementBlock("div",{key:d.key,class:"flex items-center gap-2 text-gray-800"},[t.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:t.normalizeStyle({backgroundColor:d.color})},null,4),t.createElementVNode("span",Sl,t.toDisplayString(d.label),1)]))),128))])):t.createCommentVNode("",!0),L.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:3,onClick:y[0]||(y[0]=d=>L.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer layers-button"}," Шари ")),L.value?(t.openBlock(),t.createElementBlock("div",_l,[t.createElementVNode("div",Bl,[y[5]||(y[5]=t.createElementVNode("div",null,"Шари",-1)),(t.openBlock(),t.createElementBlock("svg",{onClick:y[1]||(y[1]=d=>L.value=!1),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"},[...y[4]||(y[4]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),t.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])]))]),t.createElementVNode("div",Tl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(E),(d,m)=>(t.openBlock(),t.createElementBlock("div",{key:`base-${m}`},[t.createElementVNode("label",$l,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:w,value:m,"onUpdate:modelValue":y[2]||(y[2]=h=>N.value=h),onChange:io},null,40,Dl),[[t.vModelRadio,N.value]]),t.createElementVNode("span",Ll,t.toDisplayString(d.name||m),1)])]))),128))]),t.createElementVNode("div",Ol,[t.createElementVNode("label",Al,[t.withDirectives(t.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":y[3]||(y[3]=d=>I.value=d),onChange:lo},null,544),[[t.vModelCheckbox,I.value]]),y[6]||(y[6]=t.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.value,d=>(t.openBlock(),t.createElementBlock("label",{class:"flex items-center",key:d.id},[t.createElementVNode("input",{type:"checkbox",checked:d.visible,onChange:m=>so(d.id,m)},null,40,Il),t.createElementVNode("span",Ml,t.toDisplayString(d.config.name||d.id),1)]))),128))])])):t.createCommentVNode("",!0),t.createElementVNode("button",{type:"button",class:"absolute z-[500] bg-white p-2 border rounded-lg cursor-pointer fullscreen-button bottom-[100px] right-[7px]",onClick:tn,"aria-label":"Toggle fullscreen"},[...y[7]||(y[7]=[t.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"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)])])],6))}});function Ee(e){const n=Object.create(null);for(const o of e.split(","))n[o]=1;return o=>o in n}const Rl=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const cn=()=>{},Bt=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Te=Object.assign,Ne=Array.isArray,te=e=>typeof e=="string",pn=e=>typeof e=="symbol",Pl=e=>e!==null&&typeof e=="object",bo=Ee(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fl=Ee("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),fn=e=>{const n=Object.create(null);return(o=>n[o]||(n[o]=e(o)))},jl=/-\w/g,$e=fn(e=>e.replace(jl,n=>n.slice(1).toUpperCase())),mn=fn(e=>e.charAt(0).toUpperCase()+e.slice(1)),zl=fn(e=>e?`on${mn(e)}`:""),tt={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"},Hl={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},Ul=/;(?![^(]*\))/g,ql=/:([^]+)/,Wl=/\/\*[^]*?\*\//g;function Kl(e){const n={};return e.replace(Wl,"").split(Ul).forEach(o=>{if(o){const s=o.split(ql);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const Gl="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",Jl="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",Zl="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",Yl="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Xl=Ee(Gl),Ql=Ee(Jl),Vl=Ee(Zl),ea=Ee(Yl);const nt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),ot=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),un=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),Tt=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ko=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),Re=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Eo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),xo=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),hn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),gn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),st=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),yn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),wo=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),vn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),bn=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),kn=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),En=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),xn=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),wn=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),No=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),Co=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),$t=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),Dt=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),Nn=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),Cn=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),rt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),it=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),Sn=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),_n=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),ta=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),Bn=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),Lt=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),na=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),oa=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),Tn=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),sa=Symbol(process.env.NODE_ENV!=="production"?"unref":""),ra=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),$n=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),So=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Ge={[nt]:"Fragment",[ot]:"Teleport",[un]:"Suspense",[Tt]:"KeepAlive",[ko]:"BaseTransition",[Re]:"openBlock",[Eo]:"createBlock",[xo]:"createElementBlock",[hn]:"createVNode",[gn]:"createElementVNode",[st]:"createCommentVNode",[yn]:"createTextVNode",[wo]:"createStaticVNode",[vn]:"resolveComponent",[bn]:"resolveDynamicComponent",[kn]:"resolveDirective",[En]:"resolveFilter",[xn]:"withDirectives",[wn]:"renderList",[No]:"renderSlot",[Co]:"createSlots",[$t]:"toDisplayString",[Dt]:"mergeProps",[Nn]:"normalizeClass",[Cn]:"normalizeStyle",[rt]:"normalizeProps",[it]:"guardReactiveProps",[Sn]:"toHandlers",[_n]:"camelize",[ta]:"capitalize",[Bn]:"toHandlerKey",[Lt]:"setBlockTracking",[na]:"pushScopeId",[oa]:"popScopeId",[Tn]:"withCtx",[sa]:"unref",[ra]:"isRef",[$n]:"withMemo",[So]:"isMemoSame"};function ia(e){Object.getOwnPropertySymbols(e).forEach(n=>{Ge[n]=e[n]})}const fe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function la(e,n=""){return{type:0,source:n,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:fe}}function lt(e,n,o,s,r,l,i,a=!1,c=!1,u=!1,p=fe){return e&&(a?(e.helper(Re),e.helper(Ye(e.inSSR,u))):e.helper(Ze(e.inSSR,u)),i&&e.helper(xn)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:u,loc:p}}function Pe(e,n=fe){return{type:17,loc:n,elements:e}}function ye(e,n=fe){return{type:15,loc:n,properties:e}}function Q(e,n){return{type:16,loc:fe,key:te(e)?z(e,!0):e,value:n}}function z(e,n=!1,o=fe,s=0){return{type:4,loc:o,content:e,isStatic:n,constType:n?3:s}}function ve(e,n=fe){return{type:8,loc:n,children:e}}function ee(e,n=[],o=fe){return{type:14,loc:o,callee:e,arguments:n}}function Je(e,n=void 0,o=!1,s=!1,r=fe){return{type:18,params:e,returns:n,newline:o,isSlot:s,loc:r}}function Dn(e,n,o,s=!0){return{type:19,test:e,consequent:n,alternate:o,newline:s,loc:fe}}function aa(e,n,o=!1,s=!1){return{type:20,index:e,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:fe}}function ca(e){return{type:21,body:e,loc:fe}}function Ze(e,n){return e||n?hn:gn}function Ye(e,n){return e||n?Eo:xo}function Ln(e,{helper:n,removeHelper:o,inSSR:s}){e.isBlock||(e.isBlock=!0,o(Ze(s,e.isComponent)),n(Re),n(Ye(s,e.isComponent)))}const _o=new Uint8Array([123,123]),Bo=new Uint8Array([125,125]);function To(e){return e>=97&&e<=122||e>=65&&e<=90}function me(e){return e===32||e===10||e===9||e===12||e===13}function De(e){return e===47||e===62||me(e)}function Ot(e){const n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}const ne={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class da{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=_o,this.delimiterClose=Bo,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=_o,this.delimiterClose=Bo}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{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?De(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===ne.TitleEnd||this.currentSequence===ne.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ne.Cdata[this.sequenceIndex]?++this.sequenceIndex===ne.Cdata.length&&(this.state=28,this.currentSequence=ne.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ne.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):To(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){De(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(De(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(Ot("</"+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=To(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||De(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||De(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||De(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||De(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||De(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=ne.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ne.ScriptEnd[3]?this.startSpecial(ne.ScriptEnd,4):n===ne.StyleEnd[3]?this.startSpecial(ne.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ne.TitleEnd[3]?this.startSpecial(ne.TitleEnd,4):n===ne.TextareaEnd[3]?this.startSpecial(ne.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ne.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const pa={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:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,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 On(e,{compatConfig:n}){const o=n&&n[e];return e==="MODE"?o||3:o}function Le(e,n){const o=On("MODE",n),s=On(e,n);return o===3?s===!0:s!==!1}function Xe(e,n,o,...s){const r=Le(e,n);return process.env.NODE_ENV!=="production"&&r&&At(e,n,o,...s),r}function At(e,n,o,...s){if(On(e,n)==="suppress-warning")return;const{message:l,link:i}=pa[e],a=`(deprecation ${e}) ${typeof l=="function"?l(...s):l}${i?`
1
+ (function(V,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],t):(V=typeof globalThis<"u"?globalThis:V||self,t(V.WidgetLib={},V.Vue,V.OpenGISCore))})(this,(function(V,t,We){"use strict";function Fs(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const js=Fs(t);const ao=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Hs=e=>{const n=zs(e);return n.charAt(0).toUpperCase()+n.slice(1)},Us=(...e)=>e.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var xt={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 qs=({size:e,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>t.h("svg",{...xt,width:e||xt.width,height:e||xt.height,stroke:s||xt.stroke,"stroke-width":o?Number(n)*24/Number(e):n,class:Us("lucide",...l?[`lucide-${ao(Hs(l))}-icon`,`lucide-${ao(l)}`]:["lucide-icon"]),...a},[...r.map(u=>t.h(...u)),...c.default?[c.default()]:[]]);const Y=(e,n)=>(o,{slots:s})=>t.h(qs,{...o,iconNode:n,name:e},s);const Ws=Y("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 Ks=Y("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Gs=Y("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 co=Y("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 Js=Y("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 Ke=Y("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 Zs=Y("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 Ys=Y("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 Xs=Y("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 Qs=Y("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 po=Y("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 Vs=Y("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 fo=Y("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const er=Y("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 mo=Y("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 tr=Y("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 nr=Y("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 on=Y("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 or=Y("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 sn=Y("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 sr=Y("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 rn=Y("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rr={class:"border-t pt-3 mt-4"},ir={class:"flex gap-2"},lr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ar={class:"flex-1 space-y-2"},cr={class:"flex justify-between items-center"},dr={class:"flex gap-2"},pr=["disabled"],uo=t.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:t.mergeModels(["sendComment"],["update:isReply"]),setup(e,{emit:n}){const o=t.useModel(e,"isReply"),s=t.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(t.openBlock(),t.createElementBlock("div",rr,[t.createElementVNode("div",ir,[t.createElementVNode("span",lr,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("div",ar,[t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),onKeydown:i,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[t.vModelText,s.value]]),t.createElementVNode("div",cr,[c[4]||(c[4]=t.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),t.createElementVNode("div",dr,[o.value?(t.openBlock(),t.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]=u=>o.value=!1)},[t.createVNode(t.unref(rn),{class:"h-3 w-3"}),c[2]||(c[2]=t.createTextVNode(" Cancel ",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!s.value.trim(),onClick:l},[t.createVNode(t.unref(mo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=t.createTextVNode(" Send ",-1))],8,pr)])])])])]))}}),fr={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"},mr=t.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:t.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(e,{emit:n}){const o=n,s=t.useModel(e,"showMoreOptions"),r=t.ref(),l=t.ref(!0),i=async u=>{s.value&&r.value&&!r.value.contains(u.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return t.onMounted(()=>{document.addEventListener("click",i)}),t.onUnmounted(()=>{document.removeEventListener("click",i)}),(u,p)=>(t.openBlock(),t.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[t.createElementVNode("div",fr,[t.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},[t.createVNode(t.unref(nr),{class:"h-3 w-3 mr-2"}),p[0]||(p[0]=t.createTextVNode(" Edit ",-1))]),t.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},[t.createVNode(t.unref(on),{class:"h-3 w-3 mr-2"}),p[1]||(p[1]=t.createTextVNode(" Delete ",-1))])])],512))}}),ur={class:"space-y-2"},hr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},gr={class:"flex-1 min-w-0 space-y-1 relative"},yr={class:"flex items-center gap-2"},vr={class:"font-medium text-xs"},br={class:"text-xs text-gray-500"},kr={key:0,class:"text-xs text-gray-700 leading-relaxed"},Er={class:"flex justify-between text-xs"},xr={class:"flex items-center gap-2"},wr={key:0,class:"flex gap-2"},Nr=["disabled"],Cr={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Sr=t.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(e,{emit:n}){const o=n,s=e,r=t.ref(s.comment.text),l=t.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=t.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=t.ref(!1),c=t.ref(!1),u=t.ref(!1),p=t.ref(!1),f=w=>{const S=new Date,I=Math.floor((S.getTime()-w.getTime())/(1e3*60*60));return I<1?`${Math.floor((S.getTime()-w.getTime())/6e4)}m`:I<24?`${I}h`:`${Math.floor(I/24)}d`},b=()=>{p.value=!p.value,p.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},k=()=>{o("edit",s.comment.id,r.value),u.value=!1},E=(w,S)=>{o("like",w,S)},N=(w,S)=>{o("edit",w,S)};return(w,S)=>{const I=t.resolveComponent("CommentItem",!0);return t.openBlock(),t.createElementBlock("div",ur,[t.createElementVNode("div",{class:t.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",u.value?"bg-gray-50":""])},[t.createElementVNode("span",hr,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("div",gr,[t.createElementVNode("div",yr,[t.createElementVNode("span",vr,t.toDisplayString(e.comment?.author),1),t.createElementVNode("span",br,t.toDisplayString(f(e.comment?.createdAt)),1)]),u.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,"onUpdate:modelValue":S[0]||(S[0]=B=>r.value=B),class:t.normalizeClass(u.value?i.value:l.value)},null,2)),[[t.vModelText,r.value]]):(t.openBlock(),t.createElementBlock("p",kr,t.toDisplayString(e.comment?.text),1)),t.createElementVNode("div",Er,[t.createElementVNode("div",xr,[t.createElementVNode("button",{class:t.normalizeClass(["flex items-center gap-1",p.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:S[1]||(S[1]=B=>b())},[t.createVNode(t.unref(Xs),{class:t.normalizeClass(["h-3 w-3",p.value?"fill-blue-600":""])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString(e.comment?.likes),1)],2),e.isInside?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:S[2]||(S[2]=B=>c.value=!0)},[t.createVNode(t.unref(er),{class:"h-3 w-3"})])),t.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:S[3]||(S[3]=B=>a.value=!0)},[t.createVNode(t.unref(Js),{class:"h-3 w-3"})])]),u.value?(t.openBlock(),t.createElementBlock("div",wr,[t.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:S[4]||(S[4]=B=>u.value=!1)},[t.createVNode(t.unref(rn),{class:"h-3 w-3"}),S[11]||(S[11]=t.createTextVNode(" Cancel ",-1))]),t.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:S[5]||(S[5]=B=>k())},[t.createVNode(t.unref(mo),{class:"h-3 w-3 mr-1"}),S[12]||(S[12]=t.createTextVNode(" Send ",-1))],8,Nr)])):t.createCommentVNode("",!0)])]),a.value?(t.openBlock(),t.createBlock(mr,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":S[6]||(S[6]=B=>a.value=B),onEdit:S[7]||(S[7]=B=>u.value=!0),onDelete:S[8]||(S[8]=B=>w.$emit("delete",e.comment?.id)),comment:e.comment},null,8,["showMoreOptions","comment"])):t.createCommentVNode("",!0)],2),e.isInside?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Cr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.comment?.replies,B=>(t.openBlock(),t.createBlock(I,{key:B.id,comment:B,isInside:!0,onDelete:L=>w.$emit("delete",B.id),onLike:E,onEdit:N},null,8,["comment","onDelete"]))),128)),c.value&&!e.isInside?(t.openBlock(),t.createBlock(uo,{key:0,onSendComment:S[9]||(S[9]=B=>w.$emit("reply",e.comment?.id,B)),isReply:c.value,"onUpdate:isReply":S[10]||(S[10]=B=>c.value=B)},null,8,["isReply"])):t.createCommentVNode("",!0)]))])}}}),_r=["id"],Br={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},wt=t.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(e,{emit:n}){const o=e,s=n,r=t.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(b=>b.json());r.value=f.rows.map(b=>({id:b.communication_id,author:b.username,text:b.body,createdAt:new Date(b.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,b)=>{o?.onLike?.(f,b),s("like",f,b)},c=(f,b)=>{o.onReply?.(f,b),s("reply",f,b)},u=async(f,b)=>{o.onEdit?o.onEdit(f,b):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:b})}),await l()),s("edit",f,b)},p=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,b)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["mx-auto font-sans",e.className]),id:e.id,style:t.normalizeStyle(e.style)},[e.title?(t.openBlock(),t.createElementBlock("h3",Br,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass([e.maxHeight?"overflow-y-auto":"","space-y-3"]),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,k=>(t.openBlock(),t.createBlock(Sr,{key:k.id,comment:k,onReply:c,onLike:a,onDelete:b[0]||(b[0]=E=>p(E)),onEdit:u},null,8,["comment"]))),128))],6),t.createVNode(uo,{onSendComment:b[1]||(b[1]=k=>i(k))})],14,_r))}}),ho=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Ke}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:tr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:or}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Qs}]]),Tr={class:"mx-auto font-sans"},$r={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Dr={class:"relative"},Lr={class:"space-y-3"},Or={class:"flex-1 min-w-0 pb-2"},Ar={class:"flex items-center gap-1.5 mb-1 mt-0.5"},Ir={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Mr={class:"font-medium text-xs"},Rr={class:"text-xs text-gray-500"},Pr={class:"space-y-1"},Fr={class:"text-xs text-gray-700"},jr={class:"capitalize mr-1"},zr={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Hr={key:0,class:"flex items-center gap-1 text-xs"},Ur={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},qr={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},Nt=t.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(e){const n=e,o=t.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(t.openBlock(),t.createElementBlock("div",Tr,[e.title?(t.openBlock(),t.createElementBlock("h3",$r,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(e.maxHeight?"overflow-y-auto":""),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[t.createElementVNode("div",Dr,[l[0]||(l[0]=t.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),t.createElementVNode("div",Lr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,i=>(t.openBlock(),t.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.id},[t.createElementVNode("div",{class:t.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${t.unref(ho).get(i?.entityType)?.color}`)},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(ho).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),t.createElementVNode("div",Or,[t.createElementVNode("div",Ar,[t.createElementVNode("span",Ir,[t.createVNode(t.unref(sn),{class:"h-3 w-3 text-gray-500"})]),t.createElementVNode("span",Mr,t.toDisplayString(i?.userName),1),t.createElementVNode("span",Rr,t.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+t.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),t.createElementVNode("div",Pr,[t.createElementVNode("div",Fr,[t.createElementVNode("span",jr,t.toDisplayString(i?.action),1),i?.entityId?(t.openBlock(),t.createElementBlock("span",zr,t.toDisplayString(i?.entityId),1)):t.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(t.openBlock(),t.createElementBlock("div",Hr,[i?.changes?.[i?.entityId]?.old?(t.openBlock(),t.createElementBlock("span",Ur,t.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):t.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(t.openBlock(),t.createBlock(t.unref(Ks),{key:1,class:"h-2 w-2 text-gray-400"})):t.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(t.openBlock(),t.createElementBlock("span",qr,t.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Wr={key:0,class:"text-xl font-semibold"},Kr={class:"flex gap-1"},Gr={key:0},Jr={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"},Zr=t.defineComponent({__name:"FileHeader",props:t.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:t.mergeModels(["onAddFile"],["update:modelValue"]),setup(e){const n=t.useModel(e,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",e.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[e.title?(t.openBlock(),t.createElementBlock("h3",Wr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Kr,[t.createElementVNode("button",{class:t.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[t.createVNode(t.unref(Vs),{class:"h-4 w-4"})],2),t.createElementVNode("button",{class:t.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[t.createVNode(t.unref(Ys),{class:"h-4 w-4"})],2),e.editable?(t.openBlock(),t.createElementBlock("label",Gr,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,32),t.createElementVNode("div",Jr,[t.createVNode(t.unref(fo),{class:"h-4 w-4"}),r[3]||(r[3]=t.createTextVNode(" Додати файл ",-1))])])):t.createCommentVNode("",!0)])],2))}}),ln={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Ke,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Zs,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:sr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ke,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Ws,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:po,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:po,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Ke,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Ke,label:"PPT"}};function go(e,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(e)}function yo(e){if(e===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Yr={class:"space-y-0.5"},Xr=["onClick"],Qr=["onClick"],Vr={class:"flex items-center gap-2"},ei={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},ti={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},ni={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},oi={class:"flex items-center gap-1"},si=["onClick"],ri=["onClick"],ii=t.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Yr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.files,s=>(t.openBlock(),t.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:t.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[t.createElementVNode("div",{class:t.normalizeClass(["p-1 rounded",t.unref(ln)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(ln)[s?.ext]?.icon||t.unref(ln).pdf.icon),{class:"h-3 w-3"}))],2),t.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[t.createElementVNode("div",Vr,[t.createElementVNode("span",ei,t.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Qr),t.createElementVNode("div",ti,t.toDisplayString(t.unref(yo)(s.size)),1),t.createElementVNode("div",ni,t.toDisplayString(t.unref(go)(s.createdAt)),1),t.createElementVNode("div",oi,[t.createElementVNode("button",{onClick:t.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"},[t.createVNode(t.unref(co),{class:"h-3 w-3"})],8,si),t.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:t.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[t.createVNode(t.unref(on),{class:"h-3 w-3"})],8,ri)])],8,Xr))),128))]))}}),li={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},ai=["onClick"],ci={class:"space-y-2"},di={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},pi=["src"],fi={class:"space-y-1"},mi=["title"],ui={class:"text-xs text-gray-500 text-left"},hi={class:"absolute top-2 right-1 flex items-center gap-1"},gi=["onClick"],yi=["onClick"],vi=t.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",li,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.files,s=>(t.openBlock(),t.createElementBlock("div",{key:s.id,onClick:t.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"},[t.createElementVNode("div",ci,[t.createElementVNode("div",di,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(t.openBlock(),t.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,pi)):(t.openBlock(),t.createBlock(t.unref(Ke),{key:1,class:"h-10 w-10 text-gray-500"}))]),t.createElementVNode("div",fi,[t.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},t.toDisplayString(s.uploaded_name||s.name),9,mi),t.createElementVNode("p",ui,t.toDisplayString(t.unref(go)(s.createdAt))+", "+t.toDisplayString(t.unref(yo)(s.size)),1)])]),t.createElementVNode("div",hi,[t.createElementVNode("button",{onClick:t.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"},[t.createVNode(t.unref(co),{class:"h-3 w-3"})],8,gi),t.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:t.withModifiers(r=>n.$emit("delete",r,s?.file_id),["stop"])},[t.createVNode(t.unref(on),{class:"h-3 w-3"})],8,yi)])],8,ai))),128))]))}}),bi={class:"mx-auto font-sans"},ki={key:1},Ct=t.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(e,{emit:n}){const o=e,s=t.ref(!1),r=t.ref(null),l=t.ref(!1),i=t.ref(0),a=t.ref(o.files??[]),c=n;a.value.length===0&&S();const u=(L,_)=>{r.value=_,s.value=!0},p=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},f=t.computed(()=>Array.isArray(a.value)?a.value.map(L=>L?.file_path):[]),b=L=>{const _=f.value.findIndex(H=>H===L.file_path);_!==-1&&(l.value=!0,i.value=_)},k=L=>{o.onAddFile?o.onAddFile(L):I(L),c("add",L)},E=L=>{o.onDelete?o.onDelete(L):B(L),c("delete",L)},N=L=>{const _=document.createElement("a");_.setAttribute("download",L?.uploaded_name||L?.name),_.href=L?.file_path||L?.path,_.click()},w=t.ref("list");async function S(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(_=>_.json());L.rows.forEach(_=>{_.timestamp=new Date(_.cdate),_.id=_.entity_id,_.entityType=_.entity_type,_.entityId=_.entity_id,_.entityType=_.entity_type,_.action=_.change_type,_.userId=_.change_user_id,_.userName=_.username,_.timestamp=new Date(_.cdate),_.description=_.username,_.status=_.username}),a.value=L.rows}const I=async L=>{if(!(!L.target||!L.target.files||L.target.files.length===0))try{await Promise.all(Array.from(L.target.files).map(async _=>{const H=new FormData;H.append("file",_);const K=`/api/widget/file/${o.id}`,M=await fetch(K,{method:"POST",body:H});if(!M.ok)throw new Error(`HTTP error! status: ${M.status}`);return _})),await S()}catch(_){console.error("Помилка при завантаженні файлів:",_)}},B=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await S()}catch(_){console.error(_)}};return(L,_)=>{const H=t.resolveComponent("MessageBox"),K=t.resolveComponent("Lightbox");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",bi,[t.createVNode(Zr,{modelValue:w.value,"onUpdate:modelValue":_[0]||(_[0]=M=>w.value=M),title:o.title,onOnAddFile:_[1]||(_[1]=M=>k(M)),editable:o.editable},null,8,["modelValue","title","editable"]),a.value.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.maxHeight?"overflow-y-auto":""),style:t.normalizeStyle({maxHeight:e.maxHeight+"px"})},[w.value==="list"?(t.openBlock(),t.createBlock(ii,{key:0,onDelete:u,onDownload:N,onOpenLightbox:_[2]||(_[2]=M=>b(M)),files:a.value},null,8,["files"])):t.createCommentVNode("",!0),w.value==="grid"?(t.openBlock(),t.createBlock(vi,{key:1,onDelete:u,onDownload:N,onOpenLightbox:_[3]||(_[3]=M=>b(M)),files:a.value},null,8,["files"])):t.createCommentVNode("",!0)],6)):(t.openBlock(),t.createElementBlock("div",ki,[..._[6]||(_[6]=[t.createElementVNode("div",{class:"flex items-center justify-center h-full"},[t.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),t.createVNode(H,{modelValue:s.value,"onUpdate:modelValue":_[4]||(_[4]=M=>s.value=M),onConfirm:p,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),t.createVNode(K,{modelValue:l.value,"onUpdate:modelValue":_[5]||(_[5]=M=>l.value=M),images:f.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),Ei={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},xi=["onClick"],wi={key:0,rel:"noreferrer",class:"relative block h-full w-full"},Ni=["src"],Ci={key:0,class:"thumb-cover"},Si=t.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(e,{emit:n}){const o=n,s=t.ref(!1),r=t.ref(0),l=e,i=t.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const u=i.value.findIndex(p=>p===c.file_path);u!==-1&&(s.value=!0,r.value=u)};return(c,u)=>{const p=t.resolveComponent("Lightbox");return e.items?.length>=1?(t.openBlock(),t.createElementBlock("div",Ei,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(f,b)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["h-full w-full image"+b,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:b,onClick:t.withModifiers(k=>a(f),["stop"])},[b<5?(t.openBlock(),t.createElementBlock("div",wi,[t.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:t.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",b===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,Ni),b===4&&e.items?.length>5?(t.openBlock(),t.createElementBlock("div",Ci," +"+t.toDisplayString(e.items?.length-5),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],10,xi))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Math.max(0,5-e.items.length),f=>(t.openBlock(),t.createElementBlock("div",{key:"empty-"+f,class:t.normalizeClass(["h-full w-full image"+(e.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),t.createVNode(p,{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:u[1]||(u[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):t.createCommentVNode("",!0)}}}),_i={key:0,class:"text-xl font-semibold"},Bi={class:"flex gap-1"},Ti={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"},$i=t.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",e.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[e.title?(t.openBlock(),t.createElementBlock("h3",_i,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Bi,[t.createElementVNode("label",null,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s))},null,32),t.createElementVNode("div",Ti,[t.createVNode(t.unref(fo),{class:"h-4 w-4"}),o[1]||(o[1]=t.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Di={class:"w-full mx-auto font-sans",ref:"containerRef"},Li={key:1},St=t.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(e,{emit:n}){const o=e,s=t.ref(o.items??[]),r=n;s.value.length===0&&c();const l=p=>{o.onAddImage?o.onAddImage(p):a(p),r("add",p)},i=p=>{const f=s.value.find(b=>b.file_path===p)?.file_id;f&&(o.onDelete?o.onDelete(f):u(f))},a=async p=>{if(!(!p.target||!p.target.files||p.target.files.length===0))try{await Promise.all(Array.from(p.target.files).map(async f=>{const b=new FormData;b.append("file",f);const k=`/api/widget/file/${o.id}`,E=await fetch(k,{method:"POST",body:b});if(!E.ok)throw new Error(`HTTP error! status: ${E.status}`);return f})),await c()}catch(f){console.error("Помилка при завантаженні файлів:",f)}};async function c(){if(!o.id)return;const p=await fetch(`/api/widget/file/${o.id}`).then(f=>f.json());s.value=p.rows}const u=async p=>{try{await fetch(`/api/widget/file/${o.id}/${p}`,{method:"DELETE"}),await c()}catch(f){console.error(f)}};return(p,f)=>(t.openBlock(),t.createElementBlock("div",Di,[t.createVNode($i,{title:e.title,onOnAddImage:f[0]||(f[0]=b=>l(b))},null,8,["title"]),s.value.length>0?(t.openBlock(),t.createBlock(Si,{key:0,items:s.value,onDelete:f[1]||(f[1]=b=>i(b))},null,8,["items"])):(t.openBlock(),t.createElementBlock("div",Li,[...f[2]||(f[2]=[t.createElementVNode("div",{class:"flex items-center justify-center h-full"},[t.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),Oi={class:"text-value"},Ai={class:"text-sm text-gray-900"},Ii=t.defineComponent({__name:"TextValue",props:{item:{}},setup(e){const n=e,o=t.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(t.openBlock(),t.createElementBlock("div",Oi,[t.createElementVNode("span",Ai,t.toDisplayString(o.value),1)]))}}),Me=(e,n)=>{const o=e.__vccOpts||e;for(const[s,r]of n)o[s]=r;return o},Mi=Me(Ii,[["__scopeId","data-v-c14550b7"]]),Ri={class:"link-value"},Pi=["href"],Fi=Me(t.defineComponent({__name:"LinkValue",props:{item:{}},setup(e){const n=e,o=t.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(t.openBlock(),t.createElementBlock("div",Ri,[t.createElementVNode("a",{href:String(e.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[t.createTextVNode(t.toDisplayString(o.value)+" ",1),r[0]||(r[0]=t.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Pi)]))}}),[["__scopeId","data-v-e6eb07a6"]]),ji={class:"date-value"},zi={class:"text-sm text-gray-900"},Hi=Me(t.defineComponent({__name:"DateValue",props:{item:{}},setup(e){const n=e,o=t.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)=>(t.openBlock(),t.createElementBlock("div",ji,[t.createElementVNode("span",zi,t.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),Ui={class:"status-value"},qi={key:0,class:"mr-1"},Wi=Me(t.defineComponent({__name:"StatusValue",props:{item:{}},setup(e){const n=e,o=t.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=t.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(t.openBlock(),t.createElementBlock("div",Ui,[t.createElementVNode("span",{class:t.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(t.openBlock(),t.createElementBlock("span",qi,[t.createElementVNode("i",{class:t.normalizeClass(s.value)},null,2)])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(String(e.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),Ki={class:"custom-value"},Gi={class:"text-sm text-gray-900"},Ji=Me(t.defineComponent({__name:"CustomValue",props:{item:{}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Ki,[t.renderSlot(n.$slots,"default",{item:e.item,value:e.item.value},()=>[t.createElementVNode("span",Gi,t.toDisplayString(String(e.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),Zi=["id"],Yi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Xi={key:1,class:"overflow-x-auto"},Qi={class:"min-w-full divide-y divide-gray-200"},Vi={class:"bg-white divide-y divide-gray-200"},el={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},tl={class:"flex items-center gap-2"},nl=["title"],ol={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},sl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},rl={class:"flex items-start gap-3"},il={key:0,class:"flex-shrink-0"},ll={class:"flex-1 min-w-0"},al={class:"flex items-center gap-2 mb-2"},cl={class:"text-sm font-medium text-gray-900"},dl=["title"],pl={key:3,class:"overflow-x-auto"},fl={class:"min-w-full divide-y divide-gray-200"},ml={class:"bg-white divide-y divide-gray-200"},ul={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},hl={class:"flex items-center gap-2"},gl=["title"],yl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},an=Me(t.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(e){const n=o=>{switch(o.type){case"link":return Fi;case"date":return Hi;case"status":return Wi;case"custom":return Ji;default:return Mi}};return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["description-list-widget",e.className]),id:e.id,style:t.normalizeStyle(e.style)},[e.title?(t.openBlock(),t.createElementBlock("h3",Yi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.view==="table"?(t.openBlock(),t.createElementBlock("div",Xi,[t.createElementVNode("table",Qi,[t.createElementVNode("tbody",Vi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("tr",{key:r.id||r.label},[t.createElementVNode("td",el,[t.createElementVNode("div",tl,[r.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([r.icon,"text-gray-500"])},null,2)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(r.label)+" ",1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,nl)):t.createCommentVNode("",!0)])]),t.createElementVNode("td",ol,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):e.view==="grid"?(t.openBlock(),t.createElementBlock("div",sl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[t.createElementVNode("div",rl,[r.icon?(t.openBlock(),t.createElementBlock("div",il,[t.createElementVNode("i",{class:t.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):t.createCommentVNode("",!0),t.createElementVNode("div",ll,[t.createElementVNode("div",al,[t.createElementVNode("h4",cl,t.toDisplayString(r.label),1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,dl)):t.createCommentVNode("",!0)]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(t.openBlock(),t.createElementBlock("div",pl,[t.createElementVNode("table",fl,[t.createElementVNode("tbody",ml,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,r=>(t.openBlock(),t.createElementBlock("tr",{key:r.id||r.label},[t.createElementVNode("td",ul,[t.createElementVNode("div",hl,[r.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass([r.icon,"text-gray-500"])},null,2)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(r.label)+" ",1),r.tooltip?(t.openBlock(),t.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[t.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,gl)):t.createCommentVNode("",!0)])]),t.createElementVNode("td",yl,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Zi))}}),[["__scopeId","data-v-36d43e50"]]),vl={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function vo(e){return e?e.type==="FeatureCollection"||e.type==="Feature"?e:e.geom?{type:"Feature",geometry:{type:e.geom.type,coordinates:e.geom.coordinates},properties:{}}:e.type&&e.coordinates?{type:"Feature",geometry:e,properties:{}}:null:null}const bl={key:0,class:"absolute inset-0 z-[600] flex items-center justify-center pointer-events-none bg-black/20"},kl={class:"bg-black/70 text-white text-xs sm:text-sm px-4 py-2 rounded-md shadow"},El={class:"bg-white/95 border border-gray-200 rounded-md shadow-xl px-3 py-2 max-w-[240px] text-[11px] sm:text-xs text-gray-900"},xl={class:"space-y-0.5"},wl={class:"text-gray-500"},Nl={class:"text-gray-900 text-right break-all"},Cl={key:2,class:"absolute bottom-3 left-3 z-[400] bg-white/90 border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Sl={class:"leading-tight"},_l={key:4,class:"bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer max-w-[400px]"},Bl={class:"flex items-center justify-between p-2 border-b"},Tl={class:"p-2 border-b"},$l={class:"flex items-center"},Dl=["value"],Ll={class:"ml-2"},Ol={class:"p-2"},Al={class:"flex items-center"},Il=["checked","onChange"],Ml={class:"ml-2"},_t=t.defineComponent({__name:"MapWidget",props:{pattern:{},geom:{},id:{},katottg:{},tms:{},layers:{},title:{},height:{},bounds:{},legend:{},ctrlZoom:{type:Boolean}},setup(e){function n(g){let y=g?.parent??null;for(;y;){const d=y.props?.view;if(d==="tabs"||d==="vertical-tabs")return!0;y=y.parent??null}return!1}const o=e,s=t.getCurrentInstance(),r=t.inject("vsCardTabsContext",!1),l=t.computed(()=>(typeof r=="boolean"?r:r.value)?!0:n(s)),i=s?.appContext.config.globalProperties?.$settings??{},a=(()=>{const g=Array.isArray(i.center)?i.center:[],y=Number(g[0]),d=Number(g[1]);return Number.isFinite(y)&&Number.isFinite(d)?[y,d]:[50,30]})(),c=s?.uid??Math.floor(Math.random()*1e4),u=t.ref(null);let p,f,b,k;const E=ke(),N=t.ref(Object.keys(E)[0]),w=`base-layer-${c}`;let S;const I=t.ref(!0),B=t.ref(!1),L=t.ref(!1),_=t.ref(!1),H=t.ref("Використовуйте Ctrl + колесо миші для зміни масштабу");let K=null;const M=t.ref([]),A=t.reactive({}),F=t.ref([]),j=t.computed(()=>F.value.map(g=>A[g]).filter(Boolean)),C=t.ref(null),T=t.computed(()=>C.value?.entries??[]),x=t.computed(()=>{if(!C.value)return;const g=12,y=C.value.point.x+g,d=C.value.point.y+g;return{left:`${y}px`,top:`${d}px`}}),$=t.computed(()=>Array.isArray(o.legend)?o.legend.map((g,y)=>{const d=typeof g?.color=="string"?g.color.trim():"",m=typeof g?.label=="string"?g.label.trim():"";return!d||!m?null:{color:d,label:m,key:`${m}-${y}`}}).filter(g=>!!g):[]),J=t.computed(()=>{if(B.value)return"fixed inset-0 w-screen h-screen z-[9999] bg-white";const g=["relative","h-full"];return o.height||g.push("min-h-[300px]"),o.title&&!l.value&&g.push("pb-[3.25rem]"),g.join(" ")}),le=t.computed(()=>B.value||o.height==null?void 0:{height:typeof o.height=="number"?`${o.height}px`:String(o.height)}),Ie=t.computed(()=>{const g=["w-full","h-full"];return!o.height&&!B.value&&g.push("min-h-[300px]"),g.join(" ")});async function _e(){const g=m=>{if(!Array.from(document.styleSheets??[]).some(v=>v?.href?.includes(m))){const v=document.createElement("link");v.rel="stylesheet",v.href=m,document.head.appendChild(v)}};g("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),g("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css");const y=m=>new Promise((h,v)=>{if(Array.from(document.scripts??[]).some(P=>P.src===m))return h();const R=document.createElement("script");R.src=m,R.async=!0,R.onload=()=>h(),R.onerror=P=>v(P),document.body.appendChild(R)});return await y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").catch(()=>{}),await y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js").catch(()=>{}),await y("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>{}),window.L}function ke(){const g=y=>y.map((d,m)=>{const h=typeof d?.key=="string"&&d.key?d.key:`b${m}`,v=xe(d?.url);return v?{...d,key:h,url:v}:null}).filter(d=>!!d).reduce((d,m)=>({...d,[m.key]:m}),{});return Array.isArray(i?.basemaps)&&i.basemaps.length?g(i.basemaps):g([{key:"topo100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}])}function xe(g){if(typeof g!="string"||!g.trim())return"";const y=g.trim();if(/^https?:\/\//i.test(y))return y;const d=window.location?.origin??"",m=y.replace(/^\/+/,"");return d?`${d}/${m}`:`/${m}`}function we(g,y){return g?.id!=null?String(g.id):g?.url?`${g.url}-${y}`:`layer-${y}`}function Qn(g){if(!g||typeof g!="object")return;const y={},d=O=>{if(typeof O=="string"){const D=O.trim().replace(/,+$/,"");return D?/^-?\d+(\.\d+)?$/.test(D)?Number(D):D:void 0}return O},m=()=>(y.colorSet||(y.colorSet={}),y.colorSet),h=(O,D)=>{if(O==null||typeof D!="string")return;const R=D.trim().replace(/,+$/,"");R&&(m()[String(O)]=R)},v=O=>{const D=["color","fill","hex","valueColor","value_color"].map(P=>O[P]).find(P=>typeof P=="string"&&P.trim());if(!D)return!1;const R=["value","key","id","code","status"].map(P=>O[P]).find(P=>P!=null&&P!=="");return R==null?!1:(h(R,D),!0)};return Object.entries(g).forEach(([O,D])=>{if(O==="colorSet"&&D!=null){Array.isArray(D)?D.forEach(P=>{P&&(typeof P=="object"&&v(P)||typeof P=="object"&&Object.entries(P).forEach(([he,ge])=>h(he,typeof ge=="string"?ge:void 0)))}):typeof D=="object"&&(v(D)||Object.entries(D).forEach(([P,he])=>h(P,typeof he=="string"?he:void 0)));return}const R=d(D);if(R!==void 0){if(O==="border"){typeof R=="number"&&y.width==null?y.width=R:typeof R=="string"&&y.stroke==null&&(y.stroke=R);return}y[O]=R}}),y.colorSet&&!Object.keys(y.colorSet).length&&delete y.colorSet,Object.keys(y).length?y:void 0}function Vn(){if(Array.isArray(o.layers)&&o.layers.length)return o.layers.map((y,d)=>{if(!y)return null;const m=we(y,d),h=y.url||(o.pattern&&m?o.pattern.replace("{{id}}",String(y.id??m)):"");return h?{...y,id:m,url:h,name:y.name||`Шар ${d+1}`,style:Qn(y.style)}:null}).filter(y=>!!y?.url);const g=Array.isArray(o.tms)?o.tms:o.tms?.split(",");return g?g.map((y,d)=>{if(!y)return null;const m=typeof y=="string"?y.trim():`${y}`;if(!m)return null;const h=`legacy-${d}`,v=o.pattern?o.pattern.replace("{{id}}",m):m;return{id:h,name:`Шар ${d+1}`,url:v,visible:!0}}).filter(y=>!!y?.url):[]}function ht(g){const y=(g?.url??"").trim();if(!y)return"";if(/^https?:\/\//i.test(y))return y;const d=window.location?.origin??"",m=y.replace(/^\/+/,"");return`${d}/${m}`}function Zt(g){const y=g.style??{};return d=>{const m=y.colorAttr,h=y.colorSet??{},v=typeof m=="string"?h?.[d?.[m]]??y.color??"#3388ff":y.color??"#3388ff",O=y.stroke??v;return{weight:y.width??1,color:O,opacity:y.opacity??1,fill:y.type?y.type!=="polyline":!0,fillColor:v,fillOpacity:y.opacity??.5}}}function Yt(g,y){if(!p||!y?.latlng||g.popup===!1)return;const d=p.latLngToContainerPoint(y.latlng),m=gt(y),h=Xt(g,m);if(!h.length){et(g.id);return}C.value={layerId:g.id,title:m?.name??g.name,properties:m,entries:h,point:{x:d.x,y:d.y}}}function et(g){g&&C.value?.layerId!==g||(C.value=null)}function gt(g){return g?.layer?.properties||g?.layer?.feature?.properties||g?.properties||g?.data||{}}function Xt(g,y={}){const d=m=>m==null||m===""?"—":typeof m=="object"?JSON.stringify(m):String(m);return g.popup&&Array.isArray(g.popup)&&g.popup.length?g.popup.map(m=>({label:m.label||m.field,value:d(y?.[m.field])})):Object.entries(y).map(([m,h])=>({label:m,value:d(h)}))}function eo(g,y){if(!p||g.popup===!1||!y?.latlng)return;const d=gt(y),m=Xt(g,d);if(!m.length)return;const h=['<div class="map-popup">'];h.push('<div class="map-popup__body">'),m.forEach(v=>{h.push(`<div class="map-popup__row"><span class="map-popup__label">${v.label}: </span><span class="map-popup__value">${v.value}</span></div>`)}),h.push("</div></div>"),k.popup({maxWidth:360}).setLatLng(y.latlng).setContent(h.join("")).openOn(p)}t.onMounted(async()=>{k=await _e(),k.drawLocal={...vl};const g=typeof i?.zoom=="number"&&Number.isFinite(i.zoom)?i.zoom:10;p=k.map(u.value,{zoomControl:!1}).setView(a,g),k.control.zoom({position:"bottomright"}).addTo(p),S=k.tileLayer(E[N.value].url,{maxZoom:19}).addTo(p),f=new k.FeatureGroup().addTo(p),bt(),qe(),o.ctrlZoom&&(K=Et());const y=vo(o.geom);if(y){const d=[];k.geoJSON(y).eachLayer(m=>d.push(m)),d.length&&f.addLayer(d[0]),kt()}if(u.value){const d=new ResizeObserver(()=>{p&&p.invalidateSize()});d.observe(u.value),t.onBeforeUnmount(()=>{d.disconnect()})}});function to(){if(!f)return;f.clearLayers();const g=vo(o.geom);if(!g)return;const y=[];k.geoJSON(g).eachLayer(d=>y.push(d)),y.length&&(y.forEach(d=>f.addLayer(d)),kt())}t.onBeforeUnmount(()=>{K?.(),oo(),b&&p?.hasLayer(b)&&p.removeLayer(b)});function Be(g){const y=(g?.service??"").toLowerCase();if(y)return y;const d=(g?.url??"").toLowerCase();return/\.(mvt|pbf|vtile|vmt)(\?|$)/.test(d)?"vtile":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(d)?"wms":""}function Qt(g){const y=Be(g),d=ht(g),h={opacity:g?.style?.opacity??1,...g.options??{}},v=!!(g?.style&&Object.keys(g.style).length),O=g.sourceLayer||g.layer||g.service_layer||g.service_key||g.map_key||g.dataset?.layer||g.id;if(y==="vtile"){const D=k?.vectorGrid;if(D?.protobuf&&(v||!k?.maplibreGL)){const R=D.protobuf(d,{interactive:!0,maxNativeZoom:g.maxzoom??19,vectorTileLayerStyles:{[O??"default"]:Zt(g),default:Zt(g)}});return R.on?.("mouseover",P=>Yt(g,P)),R.on?.("mousemove",P=>Yt(g,P)),R.on?.("mouseout",()=>et(g.id)),R.on?.("click",P=>eo(g,P)),R}if(!v&&k?.maplibreGL&&window?.maplibregl){const R=d;return k.maplibreGL({style:R,interactive:!1,pane:"overlayPane"})}}if(y==="wms"&&k?.tileLayer?.wms){const D={...g.params??{}};return O&&!D.layers&&(D.layers=O),D.format==null&&(D.format="image/png"),D.transparent==null&&(D.transparent=!0),k.tileLayer.wms(d,{...D,...h})}return k.tileLayer(d,h)}function yt(g){const y=("bounds"in g?g.bounds:void 0)??o.bounds??M.value;if(!Array.isArray(y)||!y.length||!k)return null;const m={color:g.style?.stroke??g.style?.color??"#2563eb",weight:g.style?.width??2,interactive:!1,opacity:g.style?.opacity??.8,dashArray:"4 4"},h=Array.isArray(g.bounds)&&g.bounds.length?g.bounds:y,v=no(h);if(!v.length||!k.polyline)return null;const O=v.map(D=>{if(!D.length)return D;const R=D[0],P=D[D.length-1];return R&&P&&(!P.equals||!P.equals(R))?[...D,R]:D});return k.polyline(O,m)}function no(g){const y=h=>{if(!Array.isArray(h)||h.length<2)return null;const[v,O]=h;return!Number.isFinite(Number(O))||!Number.isFinite(Number(v))?null:k.latLng(Number(O),Number(v))},d=h=>Array.isArray(h)&&h.length>=2&&h.every(v=>Number.isFinite(Number(v))),m=h=>Array.isArray(h)?h.map(y).filter(Boolean):[];if(!Array.isArray(g))return[];if(g.length&&d(g[0])){const h=g.map(y).filter(Boolean);return h.length?[h]:[]}if(g.length&&Array.isArray(g[0])){if(d(g[0][0]))return g.map(v=>m(v)).filter(v=>v.length);if(Array.isArray(g[0][0])&&d(g[0][0][0]))return g.flatMap(v=>Array.isArray(v)?v.map(O=>m(O)).filter(O=>O.length):[]).filter(v=>v.length)}return[]}function oo(){Object.values(A).forEach(g=>{g.layer&&p?.hasLayer(g.layer)&&p.removeLayer(g.layer),g.boundsLayer&&p?.hasLayer(g.boundsLayer)&&p.removeLayer(g.boundsLayer),g.layer=null,g.boundsLayer=null}),et()}function qe(){if(!p)return;b&&p.hasLayer(b)&&p.removeLayer(b);const g=yt({id:"global-bounds",bounds:o.bounds,style:{}});g?(b=g,b.addTo(p)):b=null}function vt(){p&&F.value.forEach(g=>{const y=A[g];y&&(y.visible?(y.layer||(y.layer=Qt(y.config)),y.boundsLayer||(y.boundsLayer=yt(y.config)),y.layer&&!p.hasLayer(y.layer)&&y.layer.addTo(p),y.boundsLayer&&!p.hasLayer(y.boundsLayer)&&y.boundsLayer.addTo(p)):(y.layer&&p.hasLayer(y.layer)&&p.removeLayer(y.layer),y.boundsLayer&&p.hasLayer(y.boundsLayer)&&p.removeLayer(y.boundsLayer)))})}function bt(){const g=Vn(),y=[],d=new Set;g.forEach((m,h)=>{const v=we(m,h);y.push(v),d.add(v);const O=A[v];O&&O.config.url!==m.url&&(O.layer&&p?.hasLayer(O.layer)&&p.removeLayer(O.layer),O.layer=null);const D=O?.visible??m.visible??!1;A[v]={id:v,config:{...m,id:v},visible:D,layer:O?.layer??null,boundsLayer:O?.boundsLayer??null}}),Object.keys(A).forEach(m=>{if(!d.has(m)){const h=A[m];h?.layer&&p?.hasLayer(h.layer)&&p.removeLayer(h.layer),delete A[m]}}),F.value=y,p&&vt()}function so(g,y){const d=typeof y=="boolean"?y:y.target?.checked;if(d==null)return;const m=A[g];m&&(m.visible=d,m.visible?(m.layer||(m.layer=Qt(m.config)),m.boundsLayer||(m.boundsLayer=yt(m.config)),m.layer&&!p.hasLayer(m.layer)&&m.layer.addTo(p),m.boundsLayer&&!p.hasLayer(m.boundsLayer)&&m.boundsLayer.addTo(p)):(m.layer&&p.hasLayer(m.layer)&&(p.removeLayer(m.layer),et(g)),m.boundsLayer&&p.hasLayer(m.boundsLayer)&&p.removeLayer(m.boundsLayer)))}function ro(g){Vt(g),N.value=g}function Vt(g){if(!p||!E[g])return;S&&S.removeFrom(p);const y=E[g];S=k.tileLayer(y.url,y.options||{}).addTo(p),S.bringToBack()}function en(){!p||!f||I.value&&!p.hasLayer(f)&&f.addTo(p)}function io(){ro(N.value)}function lo(){I.value?f.addTo(p):f.removeFrom(p)}function tn(){B.value=!B.value}function kt(g=30){const y=f.getLayers();if(!y.length)return;const m=k.featureGroup(y).getBounds();m&&m.isValid()&&p.fitBounds(m,{padding:[g,g],maxZoom:16})}function Et(){if(!p||!u.value)return null;p.scrollWheelZoom.disable(),H.value="Використовуйте Ctrl + колесо миші для зміни масштабу";let g;const y=(m=1500)=>{_.value=!0,g&&clearTimeout(g),g=window.setTimeout(()=>_.value=!1,m)},d=m=>{if(!(m.ctrlKey||m.metaKey||m.shiftKey)){y(),p.scrollWheelZoom.disable();return}m.preventDefault(),m.stopPropagation(),p.scrollWheelZoom.enable(),_.value=!1,g&&clearTimeout(g),g=window.setTimeout(()=>p.scrollWheelZoom.disable(),200)};return u.value.addEventListener("wheel",d,{passive:!1}),()=>{p.scrollWheelZoom.enable(),u.value?.removeEventListener("wheel",d),g&&clearTimeout(g),_.value=!1}}return t.watch(B,async()=>{await t.nextTick(),requestAnimationFrame(()=>{p?.invalidateSize(!0),Vt(N.value),en(),vt(),b&&!p?.hasLayer(b)&&b.addTo(p)})}),t.watch(()=>o.layers,()=>bt(),{deep:!0}),t.watch(()=>[o.tms,o.pattern],()=>{o.layers?.length||bt()}),t.watch(()=>o.bounds,()=>qe(),{deep:!0}),t.watch(()=>o.geom,()=>to(),{deep:!0}),t.watch(()=>o.katottg,async g=>{if(M.value=[],!g){qe();return}try{const y=await fetch(`https://data.gki.com.ua/api-user/atu/${g}`);if(!y?.ok)return;const m=(await y.json())?.geometry?.coordinates;Array.isArray(m)&&m.length&&(M.value=m)}catch(y){console.error("Failed to fetch KATOTTG bounds",y)}finally{qe(),vt()}},{immediate:!0}),(g,y)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(J.value),style:t.normalizeStyle(le.value)},[t.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:t.normalizeClass(Ie.value)},null,2),_.value?(t.openBlock(),t.createElementBlock("div",bl,[t.createElementVNode("div",kl,t.toDisplayString(H.value),1)])):t.createCommentVNode("",!0),T.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,class:"absolute z-[550] pointer-events-none",style:t.normalizeStyle(x.value)},[t.createElementVNode("div",El,[t.createElementVNode("dl",xl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,d=>(t.openBlock(),t.createElementBlock("div",{key:`${d.label}-${d.value}`,class:"flex justify-between gap-2"},[t.createElementVNode("dt",wl,t.toDisplayString(d.label),1),t.createElementVNode("dd",Nl,t.toDisplayString(d.value),1)]))),128))])])],4)):t.createCommentVNode("",!0),$.value.length?(t.openBlock(),t.createElementBlock("div",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,d=>(t.openBlock(),t.createElementBlock("div",{key:d.key,class:"flex items-center gap-2 text-gray-800"},[t.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:t.normalizeStyle({backgroundColor:d.color})},null,4),t.createElementVNode("span",Sl,t.toDisplayString(d.label),1)]))),128))])):t.createCommentVNode("",!0),L.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:3,onClick:y[0]||(y[0]=d=>L.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer layers-button"}," Шари ")),L.value?(t.openBlock(),t.createElementBlock("div",_l,[t.createElementVNode("div",Bl,[y[5]||(y[5]=t.createElementVNode("div",null,"Шари",-1)),(t.openBlock(),t.createElementBlock("svg",{onClick:y[1]||(y[1]=d=>L.value=!1),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"},[...y[4]||(y[4]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),t.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])]))]),t.createElementVNode("div",Tl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(E),(d,m)=>(t.openBlock(),t.createElementBlock("div",{key:`base-${m}`},[t.createElementVNode("label",$l,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:w,value:m,"onUpdate:modelValue":y[2]||(y[2]=h=>N.value=h),onChange:io},null,40,Dl),[[t.vModelRadio,N.value]]),t.createElementVNode("span",Ll,t.toDisplayString(d.name||m),1)])]))),128))]),t.createElementVNode("div",Ol,[t.createElementVNode("label",Al,[t.withDirectives(t.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":y[3]||(y[3]=d=>I.value=d),onChange:lo},null,544),[[t.vModelCheckbox,I.value]]),y[6]||(y[6]=t.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.value,d=>(t.openBlock(),t.createElementBlock("label",{class:"flex items-center",key:d.id},[t.createElementVNode("input",{type:"checkbox",checked:d.visible,onChange:m=>so(d.id,m)},null,40,Il),t.createElementVNode("span",Ml,t.toDisplayString(d.config.name||d.id),1)]))),128))])])):t.createCommentVNode("",!0),t.createElementVNode("button",{type:"button",class:"absolute z-[500] bg-white p-2 border rounded-lg cursor-pointer fullscreen-button bottom-[100px] right-[7px]",onClick:tn,"aria-label":"Toggle fullscreen"},[...y[7]||(y[7]=[t.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"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)])])],6))}});function Ee(e){const n=Object.create(null);for(const o of e.split(","))n[o]=1;return o=>o in n}const Rl=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const cn=()=>{},Bt=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Te=Object.assign,Ne=Array.isArray,te=e=>typeof e=="string",pn=e=>typeof e=="symbol",Pl=e=>e!==null&&typeof e=="object",bo=Ee(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fl=Ee("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),fn=e=>{const n=Object.create(null);return(o=>n[o]||(n[o]=e(o)))},jl=/-\w/g,$e=fn(e=>e.replace(jl,n=>n.slice(1).toUpperCase())),mn=fn(e=>e.charAt(0).toUpperCase()+e.slice(1)),zl=fn(e=>e?`on${mn(e)}`:""),tt={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"},Hl={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},Ul=/;(?![^(]*\))/g,ql=/:([^]+)/,Wl=/\/\*[^]*?\*\//g;function Kl(e){const n={};return e.replace(Wl,"").split(Ul).forEach(o=>{if(o){const s=o.split(ql);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const Gl="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",Jl="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",Zl="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",Yl="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Xl=Ee(Gl),Ql=Ee(Jl),Vl=Ee(Zl),ea=Ee(Yl);const nt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),ot=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),un=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),Tt=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ko=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),Re=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Eo=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),xo=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),hn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),gn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),st=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),yn=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),wo=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),vn=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),bn=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),kn=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),En=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),xn=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),wn=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),No=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),Co=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),$t=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),Dt=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),Nn=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),Cn=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),rt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),it=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),Sn=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),_n=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),ta=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),Bn=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),Lt=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),na=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),oa=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),Tn=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),sa=Symbol(process.env.NODE_ENV!=="production"?"unref":""),ra=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),$n=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),So=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Ge={[nt]:"Fragment",[ot]:"Teleport",[un]:"Suspense",[Tt]:"KeepAlive",[ko]:"BaseTransition",[Re]:"openBlock",[Eo]:"createBlock",[xo]:"createElementBlock",[hn]:"createVNode",[gn]:"createElementVNode",[st]:"createCommentVNode",[yn]:"createTextVNode",[wo]:"createStaticVNode",[vn]:"resolveComponent",[bn]:"resolveDynamicComponent",[kn]:"resolveDirective",[En]:"resolveFilter",[xn]:"withDirectives",[wn]:"renderList",[No]:"renderSlot",[Co]:"createSlots",[$t]:"toDisplayString",[Dt]:"mergeProps",[Nn]:"normalizeClass",[Cn]:"normalizeStyle",[rt]:"normalizeProps",[it]:"guardReactiveProps",[Sn]:"toHandlers",[_n]:"camelize",[ta]:"capitalize",[Bn]:"toHandlerKey",[Lt]:"setBlockTracking",[na]:"pushScopeId",[oa]:"popScopeId",[Tn]:"withCtx",[sa]:"unref",[ra]:"isRef",[$n]:"withMemo",[So]:"isMemoSame"};function ia(e){Object.getOwnPropertySymbols(e).forEach(n=>{Ge[n]=e[n]})}const fe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function la(e,n=""){return{type:0,source:n,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:fe}}function lt(e,n,o,s,r,l,i,a=!1,c=!1,u=!1,p=fe){return e&&(a?(e.helper(Re),e.helper(Ye(e.inSSR,u))):e.helper(Ze(e.inSSR,u)),i&&e.helper(xn)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:u,loc:p}}function Pe(e,n=fe){return{type:17,loc:n,elements:e}}function ye(e,n=fe){return{type:15,loc:n,properties:e}}function Q(e,n){return{type:16,loc:fe,key:te(e)?z(e,!0):e,value:n}}function z(e,n=!1,o=fe,s=0){return{type:4,loc:o,content:e,isStatic:n,constType:n?3:s}}function ve(e,n=fe){return{type:8,loc:n,children:e}}function ee(e,n=[],o=fe){return{type:14,loc:o,callee:e,arguments:n}}function Je(e,n=void 0,o=!1,s=!1,r=fe){return{type:18,params:e,returns:n,newline:o,isSlot:s,loc:r}}function Dn(e,n,o,s=!0){return{type:19,test:e,consequent:n,alternate:o,newline:s,loc:fe}}function aa(e,n,o=!1,s=!1){return{type:20,index:e,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:fe}}function ca(e){return{type:21,body:e,loc:fe}}function Ze(e,n){return e||n?hn:gn}function Ye(e,n){return e||n?Eo:xo}function Ln(e,{helper:n,removeHelper:o,inSSR:s}){e.isBlock||(e.isBlock=!0,o(Ze(s,e.isComponent)),n(Re),n(Ye(s,e.isComponent)))}const _o=new Uint8Array([123,123]),Bo=new Uint8Array([125,125]);function To(e){return e>=97&&e<=122||e>=65&&e<=90}function me(e){return e===32||e===10||e===9||e===12||e===13}function De(e){return e===47||e===62||me(e)}function Ot(e){const n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}const ne={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class da{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=_o,this.delimiterClose=Bo,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=_o,this.delimiterClose=Bo}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{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?De(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===ne.TitleEnd||this.currentSequence===ne.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ne.Cdata[this.sequenceIndex]?++this.sequenceIndex===ne.Cdata.length&&(this.state=28,this.currentSequence=ne.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ne.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):To(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){De(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(De(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(Ot("</"+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=To(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||De(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||De(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||De(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||De(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||De(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=ne.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ne.ScriptEnd[3]?this.startSpecial(ne.ScriptEnd,4):n===ne.StyleEnd[3]?this.startSpecial(ne.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ne.TitleEnd[3]?this.startSpecial(ne.TitleEnd,4):n===ne.TextareaEnd[3]?this.startSpecial(ne.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ne.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const pa={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:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,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 On(e,{compatConfig:n}){const o=n&&n[e];return e==="MODE"?o||3:o}function Le(e,n){const o=On("MODE",n),s=On(e,n);return o===3?s===!0:s!==!1}function Xe(e,n,o,...s){const r=Le(e,n);return process.env.NODE_ENV!=="production"&&r&&At(e,n,o,...s),r}function At(e,n,o,...s){if(On(e,n)==="suppress-warning")return;const{message:l,link:i}=pa[e],a=`(deprecation ${e}) ${typeof l=="function"?l(...s):l}${i?`
2
2
  Details: ${i}`:""}`,c=new SyntaxError(a);c.code=e,o&&(c.loc=o),n.onWarn(c)}function An(e){throw e}function $o(e){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${e.message}`)}function W(e,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||fa)[e]+(s||""):`https://vuejs.org/error-reference/#compiler-${e}`,l=new SyntaxError(String(r));return l.code=e,l.loc=n,l}const fa={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
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:""},ae=e=>e.type===4&&e.isStatic;function Do(e){switch(e){case"Teleport":case"teleport":return ot;case"Suspense":case"suspense":return un;case"KeepAlive":case"keep-alive":return Tt;case"BaseTransition":case"base-transition":return ko}}const ma=/^$|^\d|[^\$\w\xA0-\uFFFF]/,In=e=>!ma.test(e),Lo=/[A-Za-z_$\xA0-\uFFFF]/,ua=/[\.\?\w$\xA0-\uFFFF]/,ha=/\s+[.[]\s*|\s*[.[]\s+/g,Oo=e=>e.type===4?e.content:e.loc.source,Ao=e=>{const n=Oo(e).trim().replace(ha,a=>a.trim());let o=0,s=[],r=0,l=0,i=null;for(let a=0;a<n.length;a++){const c=n.charAt(a);switch(o){case 0:if(c==="[")s.push(o),o=1,r++;else if(c==="(")s.push(o),o=2,l++;else if(!(a===0?Lo:ua).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,i=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,i=c;else if(c==="(")l++;else if(c===")"){if(a===n.length-1)return!1;--l||(o=s.pop())}break;case 3:c===i&&(o=s.pop(),i=null);break}}return!r&&!l},ga=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,ya=e=>ga.test(Oo(e));function Io(e,n){if(!e)throw new Error(n||"unexpected compiler condition")}function ce(e,n,o=!1){for(let s=0;s<e.props.length;s++){const r=e.props[s];if(r.type===7&&(o||r.exp)&&(te(n)?r.name===n:n.test(r.name)))return r}}function at(e,n,o=!1,s=!1){for(let r=0;r<e.props.length;r++){const l=e.props[r];if(l.type===6){if(o)continue;if(l.name===n&&(l.value||s))return l}else if(l.name==="bind"&&(l.exp||s)&&Oe(l.arg,n))return l}}function Oe(e,n){return!!(e&&ae(e)&&e.content===n)}function va(e){return e.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function Mn(e){return e.type===5||e.type===2}function Mo(e){return e.type===7&&e.name==="pre"}function ba(e){return e.type===7&&e.name==="slot"}function It(e){return e.type===1&&e.tagType===3}function Mt(e){return e.type===1&&e.tagType===2}const ka=new Set([rt,it]);function Ro(e,n=[]){if(e&&!te(e)&&e.type===14){const o=e.callee;if(!te(o)&&ka.has(o))return Ro(e.arguments[0],n.concat(e))}return[e,n]}function Rt(e,n,o){let s,r=e.type===13?e.props:e.arguments[2],l=[],i;if(r&&!te(r)&&r.type===14){const a=Ro(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||te(r))s=ye([n]);else if(r.type===14){const a=r.arguments[0];!te(a)&&a.type===15?Po(n,a)||a.properties.unshift(n):r.callee===Sn?s=ee(o.helper(Dt),[ye([n]),r]):r.arguments.unshift(ye([n])),!s&&(s=r)}else r.type===15?(Po(n,r)||r.properties.unshift(n),s=r):(s=ee(o.helper(Dt),[ye([n]),r]),i&&i.callee===it&&(i=l[l.length-2]));e.type===13?i?i.arguments[0]=s:e.props=s:i?i.arguments[0]=s:e.arguments[2]=s}function Po(e,n){let o=!1;if(e.key.type===4){const s=e.key.content;o=n.properties.some(r=>r.key.type===4&&r.key.content===s)}return o}function ct(e,n){return`_${n}_${e.replace(/[^\w]/g,(o,s)=>o==="-"?"_":e.charCodeAt(s).toString())}`}function Ea(e){return e.type===14&&e.callee===$n?e.arguments[1].returns:e}const xa=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Fo(e){for(let n=0;n<e.length;n++)if(!me(e.charCodeAt(n)))return!1;return!0}function Rn(e){return e.type===2&&Fo(e.content)||e.type===12&&Rn(e.content)}function Pn(e){return e.type===3||Rn(e)}const jo={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:Bt,isPreTag:Bt,isIgnoreNewlineTag:Bt,isCustomElement:Bt,onError:An,onWarn:$o,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let q=jo,dt=null,Ce="",se=null,U=null,de="",Se=-1,Fe=-1,Fn=0,Ae=!1,jn=null;const Z=[],G=new da(Z,{onerr:pe,ontext(e,n){Pt(oe(e,n),e,n)},ontextentity(e,n,o){Pt(e,n,o)},oninterpolation(e,n){if(Ae)return Pt(oe(e,n),e,n);let o=e+G.delimiterOpen.length,s=n-G.delimiterClose.length;for(;me(Ce.charCodeAt(o));)o++;for(;me(Ce.charCodeAt(s-1));)s--;let r=oe(o,s);r.includes("&")&&(r=q.decodeEntities(r,!1)),zn({type:5,content:jt(r,!1,X(o,s)),loc:X(e,n)})},onopentagname(e,n){const o=oe(e,n);se={type:1,tag:o,ns:q.getNamespace(o,Z[0],q.ns),tagType:0,props:[],children:[],loc:X(e-1,n),codegenNode:void 0}},onopentagend(e){Ho(e)},onclosetag(e,n){const o=oe(e,n);if(!q.isVoidTag(o)){let s=!1;for(let r=0;r<Z.length;r++)if(Z[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&pe(24,Z[0].loc.start.offset);for(let i=0;i<=r;i++){const a=Z.shift();Ft(a,n,i<r)}break}s||pe(23,Uo(e,60))}},onselfclosingtag(e){const n=se.tag;se.isSelfClosing=!0,Ho(e),Z[0]&&Z[0].tag===n&&Ft(Z.shift(),e)},onattribname(e,n){U={type:6,name:oe(e,n),nameLoc:X(e,n),value:void 0,loc:X(e)}},ondirname(e,n){const o=oe(e,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!Ae&&s===""&&pe(26,e),Ae||s==="")U={type:6,name:o,nameLoc:X(e,n),value:void 0,loc:X(e)};else if(U={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[z("prop")]:[],loc:X(e)},s==="pre"){Ae=G.inVPre=!0,jn=se;const r=se.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=La(r[l]))}},ondirarg(e,n){if(e===n)return;const o=oe(e,n);if(Ae&&!Mo(U))U.name+=o,je(U.nameLoc,n);else{const s=o[0]!=="[";U.arg=jt(s?o:o.slice(1,-1),s,X(e,n),s?3:0)}},ondirmodifier(e,n){const o=oe(e,n);if(Ae&&!Mo(U))U.name+="."+o,je(U.nameLoc,n);else if(U.name==="slot"){const s=U.arg;s&&(s.content+="."+o,je(s.loc,n))}else{const s=z(o,!0,X(e,n));U.modifiers.push(s)}},onattribdata(e,n){de+=oe(e,n),Se<0&&(Se=e),Fe=n},onattribentity(e,n,o){de+=e,Se<0&&(Se=n),Fe=o},onattribnameend(e){const n=U.loc.start.offset,o=oe(n,e);U.type===7&&(U.rawName=o),se.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&pe(2,n)},onattribend(e,n){if(se&&U){if(je(U.loc,n),e!==0)if(de.includes("&")&&(de=q.decodeEntities(de,!0)),U.type===6)U.name==="class"&&(de=Ko(de).trim()),e===1&&!de&&pe(13,n),U.value={type:2,content:de,loc:e===1?X(Se,Fe):X(Se-1,Fe+1)},G.inSFCRoot&&se.tag==="template"&&U.name==="lang"&&de&&de!=="html"&&G.enterRCDATA(Ot("</template"),0);else{let o=0;U.exp=jt(de,!1,X(Se,Fe),0,o),U.name==="for"&&(U.forParseResult=Na(U.exp));let s=-1;U.name==="bind"&&(s=U.modifiers.findIndex(r=>r.content==="sync"))>-1&&Xe("COMPILER_V_BIND_SYNC",q,U.loc,U.arg.loc.source)&&(U.name="model",U.modifiers.splice(s,1))}(U.type!==7||U.name!=="pre")&&se.props.push(U)}de="",Se=Fe=-1},oncomment(e,n){q.comments&&zn({type:3,content:oe(e,n),loc:X(e-4,n+3)})},onend(){const e=Ce.length;if(process.env.NODE_ENV!=="production"&&G.state!==1)switch(G.state){case 5:case 8:pe(5,e);break;case 3:case 4:pe(25,G.sectionStart);break;case 28:G.currentSequence===ne.CdataEnd?pe(6,e):pe(7,e);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:pe(9,e);break}for(let n=0;n<Z.length;n++)Ft(Z[n],e-1),pe(24,Z[n].loc.start.offset)},oncdata(e,n){Z[0].ns!==0?Pt(oe(e,n),e,n):pe(1,e-9)},onprocessinginstruction(e){(Z[0]?Z[0].ns:q.ns)===0&&pe(21,e-1)}}),zo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,wa=/^\(|\)$/g;function Na(e){const n=e.loc,o=e.content,s=o.match(xa);if(!s)return;const[,r,l]=s,i=(f,b,k=!1)=>{const E=n.start.offset+b,N=E+f.length;return jt(f,!1,X(E,N),0,k?1:0)},a={source:i(l.trim(),o.indexOf(l,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(wa,"").trim();const u=r.indexOf(c),p=c.match(zo);if(p){c=c.replace(zo,"").trim();const f=p[1].trim();let b;if(f&&(b=o.indexOf(f,u+c.length),a.key=i(f,b,!0)),p[2]){const k=p[2].trim();k&&(a.index=i(k,o.indexOf(k,a.key?b+f.length:u+c.length),!0))}}return c&&(a.value=i(c,u,!0)),a}function oe(e,n){return Ce.slice(e,n)}function Ho(e){G.inSFCRoot&&(se.innerLoc=X(e+1,e+1)),zn(se);const{tag:n,ns:o}=se;o===0&&q.isPreTag(n)&&Fn++,q.isVoidTag(n)?Ft(se,e):(Z.unshift(se),(o===1||o===2)&&(G.inXML=!0)),se=null}function Pt(e,n,o){{const l=Z[0]&&Z[0].tag;l!=="script"&&l!=="style"&&e.includes("&")&&(e=q.decodeEntities(e,!1))}const s=Z[0]||dt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=e,je(r.loc,o)):s.children.push({type:2,content:e,loc:X(n,o)})}function Ft(e,n,o=!1){o?je(e.loc,Uo(n,60)):je(e.loc,Ca(n,62)+1),G.inSFCRoot&&(e.children.length?e.innerLoc.end=Te({},e.children[e.children.length-1].loc.end):e.innerLoc.end=Te({},e.innerLoc.start),e.innerLoc.source=oe(e.innerLoc.start.offset,e.innerLoc.end.offset));const{tag:s,ns:r,children:l}=e;if(Ae||(s==="slot"?e.tagType=2:qo(e)?e.tagType=3:_a(e)&&(e.tagType=1)),G.inRCDATA||(e.children=Wo(l)),r===0&&q.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&q.isPreTag(s)&&Fn--,jn===e&&(Ae=G.inVPre=!1,jn=null),G.inXML&&(Z[0]?Z[0].ns:q.ns)===0&&(G.inXML=!1);{const i=e.props;if(process.env.NODE_ENV!=="production"&&Le("COMPILER_V_IF_V_FOR_PRECEDENCE",q)){let c=!1,u=!1;for(let p=0;p<i.length;p++){const f=i[p];if(f.type===7&&(f.name==="if"?c=!0:f.name==="for"&&(u=!0)),c&&u){At("COMPILER_V_IF_V_FOR_PRECEDENCE",q,e.loc);break}}}if(!G.inSFCRoot&&Le("COMPILER_NATIVE_TEMPLATE",q)&&e.tag==="template"&&!qo(e)){process.env.NODE_ENV!=="production"&&At("COMPILER_NATIVE_TEMPLATE",q,e.loc);const c=Z[0]||dt,u=c.children.indexOf(e);c.children.splice(u,1,...e.children)}const a=i.find(c=>c.type===6&&c.name==="inline-template");a&&Xe("COMPILER_INLINE_TEMPLATE",q,a.loc)&&e.children.length&&(a.value={type:2,content:oe(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:a.loc})}}function Ca(e,n){let o=e;for(;Ce.charCodeAt(o)!==n&&o<Ce.length-1;)o++;return o}function Uo(e,n){let o=e;for(;Ce.charCodeAt(o)!==n&&o>=0;)o--;return o}const Sa=new Set(["if","else","else-if","for","slot"]);function qo({tag:e,props:n}){if(e==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&Sa.has(n[o].name))return!0}return!1}function _a({tag:e,props:n}){if(q.isCustomElement(e))return!1;if(e==="component"||Ba(e.charCodeAt(0))||Do(e)||q.isBuiltInComponent&&q.isBuiltInComponent(e)||q.isNativeTag&&!q.isNativeTag(e))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(Xe("COMPILER_IS_ON_ELEMENT",q,s.loc))return!0}}else if(s.name==="bind"&&Oe(s.arg,"is")&&Xe("COMPILER_IS_ON_ELEMENT",q,s.loc))return!0}return!1}function Ba(e){return e>64&&e<91}const Ta=/\r\n/g;function Wo(e){const n=q.whitespace!=="preserve";let o=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r.type===2)if(Fn)r.content=r.content.replace(Ta,`
4
4
  `);else if(Fo(r.content)){const l=e[s-1]&&e[s-1].type,i=e[s+1]&&e[s+1].type;!l||!i||n&&(l===3&&(i===3||i===1)||l===1&&(i===3||i===1&&$a(r.content)))?(o=!0,e[s]=null):r.content=" "}else n&&(r.content=Ko(r.content))}return o?e.filter(Boolean):e}function $a(e){for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o===10||o===13)return!0}return!1}function Ko(e){let n="",o=!1;for(let s=0;s<e.length;s++)me(e.charCodeAt(s))?o||(n+=" ",o=!0):(n+=e[s],o=!1);return n}function zn(e){(Z[0]||dt).children.push(e)}function X(e,n){return{start:G.getPos(e),end:n==null?n:G.getPos(n),source:n==null?n:oe(e,n)}}function Da(e){return X(e.start.offset,e.end.offset)}function je(e,n){e.end=G.getPos(n),e.source=oe(e.start.offset,n)}function La(e){const n={type:6,name:e.rawName,nameLoc:X(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){const o=e.exp.loc;o.end.offset<e.loc.end.offset&&(o.start.offset--,o.start.column--,o.end.offset++,o.end.column++),n.value={type:2,content:e.exp.content,loc:o}}return n}function jt(e,n=!1,o,s=0,r=0){return z(e,n,o,s)}function pe(e,n,o){q.onError(W(e,X(n,n),void 0,o))}function Oa(){G.reset(),se=null,U=null,de="",Se=-1,Fe=-1,Z.length=0}function Aa(e,n){if(Oa(),Ce=e,q=Te({},jo),n){let r;for(r in n)n[r]!=null&&(q[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!q.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");G.mode=q.parseMode==="html"?1:q.parseMode==="sfc"?2:0,G.inXML=q.ns===1||q.ns===2;const o=n&&n.delimiters;o&&(G.delimiterOpen=Ot(o[0]),G.delimiterClose=Ot(o[1]));const s=dt=la([],e);return G.parse(Ce),s.loc=X(0,e.length),s.children=Wo(s.children),dt=null,s}function Ia(e,n){zt(e,void 0,n,!!Go(e))}function Go(e){const n=e.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!Mt(n[0])?n[0]:null}function zt(e,n,o,s=!1,r=!1){const{children:l}=e,i=[];for(let p=0;p<l.length;p++){const f=l[p];if(f.type===1&&f.tagType===0){const b=s?0:ue(f,o);if(b>0){if(b>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const k=f.codegenNode;if(k.type===13){const E=k.patchFlag;if((E===void 0||E===512||E===1)&&Zo(f,o)>=2){const N=Yo(f);N&&(k.props=o.hoist(N))}k.dynamicProps&&(k.dynamicProps=o.hoist(k.dynamicProps))}}}else if(f.type===12&&(s?0:ue(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${tt[-1]} */`:"")),i.push(f);continue}if(f.type===1){const b=f.tagType===1;b&&o.scopes.vSlot++,zt(f,e,o,!1,r),b&&o.scopes.vSlot--}else if(f.type===11)zt(f,e,o,f.children.length===1,!0);else if(f.type===9)for(let b=0;b<f.branches.length;b++)zt(f.branches[b],e,o,f.branches[b].children.length===1,r)}let a=!1;if(i.length===l.length&&e.type===1){if(e.tagType===0&&e.codegenNode&&e.codegenNode.type===13&&Ne(e.codegenNode.children))e.codegenNode.children=c(Pe(e.codegenNode.children)),a=!0;else if(e.tagType===1&&e.codegenNode&&e.codegenNode.type===13&&e.codegenNode.children&&!Ne(e.codegenNode.children)&&e.codegenNode.children.type===15){const p=u(e.codegenNode,"default");p&&(p.returns=c(Pe(p.returns)),a=!0)}else if(e.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Ne(n.codegenNode.children)&&n.codegenNode.children.type===15){const p=ce(e,"slot",!0),f=p&&p.arg&&u(n.codegenNode,p.arg);f&&(f.returns=c(Pe(f.returns)),a=!0)}}if(!a)for(const p of i)p.codegenNode=o.cache(p.codegenNode);function c(p){const f=o.cache(p);return f.needArraySpread=!0,f}function u(p,f){if(p.children&&!Ne(p.children)&&p.children.type===15){const b=p.children.properties.find(k=>k.key===f||k.key.content===f);return b&&b.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,e)}function ue(e,n){const{constantCache:o}=n;switch(e.type){case 1:if(e.tagType!==0)return 0;const s=o.get(e);if(s!==void 0)return s;const r=e.codegenNode;if(r.type!==13||r.isBlock&&e.tag!=="svg"&&e.tag!=="foreignObject"&&e.tag!=="math")return 0;if(r.patchFlag===void 0){let i=3;const a=Zo(e,n);if(a===0)return o.set(e,0),0;a<i&&(i=a);for(let c=0;c<e.children.length;c++){const u=ue(e.children[c],n);if(u===0)return o.set(e,0),0;u<i&&(i=u)}if(i>1)for(let c=0;c<e.props.length;c++){const u=e.props[c];if(u.type===7&&u.name==="bind"&&u.exp){const p=ue(u.exp,n);if(p===0)return o.set(e,0),0;p<i&&(i=p)}}if(r.isBlock){for(let c=0;c<e.props.length;c++)if(e.props[c].type===7)return o.set(e,0),0;n.removeHelper(Re),n.removeHelper(Ye(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(Ze(n.inSSR,r.isComponent))}return o.set(e,i),i}else return o.set(e,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return ue(e.content,n);case 4:return e.constType;case 8:let l=3;for(let i=0;i<e.children.length;i++){const a=e.children[i];if(te(a)||pn(a))continue;const c=ue(a,n);if(c===0)return 0;c<l&&(l=c)}return l;case 20:return 2;default:return process.env.NODE_ENV,0}}const Ma=new Set([Nn,Cn,rt,it]);function Jo(e,n){if(e.type===14&&!te(e.callee)&&Ma.has(e.callee)){const o=e.arguments[0];if(o.type===4)return ue(o,n);if(o.type===14)return Jo(o,n)}return 0}function Zo(e,n){let o=3;const s=Yo(e);if(s&&s.type===15){const{properties:r}=s;for(let l=0;l<r.length;l++){const{key:i,value:a}=r[l],c=ue(i,n);if(c===0)return c;c<o&&(o=c);let u;if(a.type===4?u=ue(a,n):a.type===14?u=Jo(a,n):u=0,u===0)return u;u<o&&(o=u)}}return o}function Yo(e){const n=e.codegenNode;if(n.type===13)return n.props}function Ra(e,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:u=cn,isCustomElement:p=cn,expressionPlugins:f=[],scopeId:b=null,slotted:k=!0,ssr:E=!1,inSSR:N=!1,ssrCssVars:w="",bindingMetadata:S=Rl,inline:I=!1,isTS:B=!1,onError:L=An,onWarn:_=$o,compatConfig:H}){const K=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),M={filename:n,selfName:K&&mn($e(K[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:u,isCustomElement:p,expressionPlugins:f,scopeId:b,slotted:k,ssr:E,inSSR:N,ssrCssVars:w,bindingMetadata:S,inline:I,isTS:B,onError:L,onWarn:_,compatConfig:H,root:e,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:e,childIndex:0,inVOnce:!1,helper(A){const F=M.helpers.get(A)||0;return M.helpers.set(A,F+1),A},removeHelper(A){const F=M.helpers.get(A);if(F){const j=F-1;j?M.helpers.set(A,j):M.helpers.delete(A)}},helperString(A){return`_${Ge[M.helper(A)]}`},replaceNode(A){if(process.env.NODE_ENV!=="production"){if(!M.currentNode)throw new Error("Node being replaced is already removed.");if(!M.parent)throw new Error("Cannot replace root node.")}M.parent.children[M.childIndex]=M.currentNode=A},removeNode(A){if(process.env.NODE_ENV!=="production"&&!M.parent)throw new Error("Cannot remove root node.");const F=M.parent.children,j=A?F.indexOf(A):M.currentNode?M.childIndex:-1;if(process.env.NODE_ENV!=="production"&&j<0)throw new Error("node being removed is not a child of current parent");!A||A===M.currentNode?(M.currentNode=null,M.onNodeRemoved()):M.childIndex>j&&(M.childIndex--,M.onNodeRemoved()),M.parent.children.splice(j,1)},onNodeRemoved:cn,addIdentifiers(A){},removeIdentifiers(A){},hoist(A){te(A)&&(A=z(A)),M.hoists.push(A);const F=z(`_hoisted_${M.hoists.length}`,!1,A.loc,2);return F.hoisted=A,F},cache(A,F=!1,j=!1){const C=aa(M.cached.length,A,F,j);return M.cached.push(C),C}};return M.filters=new Set,M}function Pa(e,n){const o=Ra(e,n);Ht(e,o),n.hoistStatic&&Ia(e,o),n.ssr||Fa(e,o),e.helpers=new Set([...o.helpers.keys()]),e.components=[...o.components],e.directives=[...o.directives],e.imports=o.imports,e.hoists=o.hoists,e.temps=o.temps,e.cached=o.cached,e.transformed=!0,e.filters=[...o.filters]}function Fa(e,n){const{helper:o}=n,{children:s}=e;if(s.length===1){const r=Go(e);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&Ln(l,n),e.codegenNode=l}else e.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(l=>l.type!==3).length===1&&(r|=2048),e.codegenNode=lt(n,o(nt),void 0,e.children,r,void 0,void 0,!0,void 0,!1)}}function ja(e,n){let o=0;const s=()=>{o--};for(;o<e.children.length;o++){const r=e.children[o];te(r)||(n.grandParent=n.parent,n.parent=e,n.childIndex=o,n.onNodeRemoved=s,Ht(r,n))}}function Ht(e,n){n.currentNode=e;const{nodeTransforms:o}=n,s=[];for(let l=0;l<o.length;l++){const i=o[l](e,n);if(i&&(Ne(i)?s.push(...i):s.push(i)),n.currentNode)e=n.currentNode;else return}switch(e.type){case 3:n.ssr||n.helper(st);break;case 5:n.ssr||n.helper($t);break;case 9:for(let l=0;l<e.branches.length;l++)Ht(e.branches[l],n);break;case 10:case 11:case 1:case 0:ja(e,n);break}n.currentNode=e;let r=s.length;for(;r--;)s[r]()}function Xo(e,n){const o=te(e)?s=>s===e:s=>e.test(s);return(s,r)=>{if(s.type===1){const{props:l}=s;if(s.tagType===3&&l.some(ba))return;const i=[];for(let a=0;a<l.length;a++){const c=l[a];if(c.type===7&&o(c.name)){l.splice(a,1),a--;const u=n(s,c,r);u&&i.push(u)}}return i}}}const Ut="/*@__PURE__*/",Qo=e=>`${Ge[e]}: _${Ge[e]}`;function za(e,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:l=null,optimizeImports:i=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:p=!1,isTS:f=!1,inSSR:b=!1}){const k={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:u,ssr:p,isTS:f,inSSR:b,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(N){return`_${Ge[N]}`},push(N,w=-2,S){k.code+=N},indent(){E(++k.indentLevel)},deindent(N=!1){N?--k.indentLevel:E(--k.indentLevel)},newline(){E(k.indentLevel)}};function E(N){k.push(`
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
13
13
  onOpenLightbox?: ((event: Event) => any) | undefined;
14
14
  }>, {
15
15
  files: FileItem[];
16
+ editable: boolean;
16
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
18
  export default _default;
18
19
  //# sourceMappingURL=FilesWidget.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilesWidget.vue.d.ts","sourceRoot":"","sources":["../../../src/widgets/files/FilesWidget.vue"],"names":[],"mappings":"AAgMA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM1D,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;;;;;;;;;;;;AAuVF,wBAQG"}
1
+ {"version":3,"file":"FilesWidget.vue.d.ts","sourceRoot":"","sources":["../../../src/widgets/files/FilesWidget.vue"],"names":[],"mappings":"AAkMA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM1D,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAEjC,CAAC;;;;;;;;;;;;;AAyVF,wBAQG"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opengis/widgets",
3
3
  "private": false,
4
- "version": "0.0.40",
4
+ "version": "0.0.41",
5
5
  "type": "module",
6
6
  "description": "A collection of independent widgets for comments, history, files, and gallery",
7
7
  "types": "./dist/index.d.ts",