@opengis/widgets 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- (function(Fe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(Fe=typeof globalThis<"u"?globalThis:Fe||self,e(Fe.WidgetLib={},Fe.Vue,Fe.OpenGISCore))})(this,(function(Fe,e,fe){"use strict";function ls(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>l[n]})}}return t.default=l,Object.freeze(t)}const os=ls(e);/**
1
+ (function(Fe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(Fe=typeof globalThis<"u"?globalThis:Fe||self,e(Fe.WidgetLib={},Fe.Vue,Fe.OpenGISCore))})(this,(function(Fe,e,fe){"use strict";function os(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>l[n]})}}return t.default=l,Object.freeze(t)}const as=os(e);/**
2
2
  * @license lucide-vue-next v0.535.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const jo=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),as=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),rs=l=>{const t=as(l);return t.charAt(0).toUpperCase()+t.slice(1)},ss=(...l)=>l.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
6
+ */const jo=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rs=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),ss=l=>{const t=rs(l);return t.charAt(0).toUpperCase()+t.slice(1)},is=(...l)=>l.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
7
7
  * @license lucide-vue-next v0.535.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
@@ -13,27 +13,27 @@
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const is=({size:l,strokeWidth:t=2,absoluteStrokeWidth:n,color:o,iconNode:a,name:r,class:s,...i},{slots:c})=>e.h("svg",{...Dn,width:l||Dn.width,height:l||Dn.height,stroke:o||Dn.stroke,"stroke-width":n?Number(t)*24/Number(l):t,class:ss("lucide",...r?[`lucide-${jo(rs(r))}-icon`,`lucide-${jo(r)}`]:["lucide-icon"]),...i},[...a.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);/**
16
+ */const cs=({size:l,strokeWidth:t=2,absoluteStrokeWidth:n,color:o,iconNode:a,name:r,class:s,...i},{slots:c})=>e.h("svg",{...Dn,width:l||Dn.width,height:l||Dn.height,stroke:o||Dn.stroke,"stroke-width":n?Number(t)*24/Number(l):t,class:is("lucide",...r?[`lucide-${jo(ss(r))}-icon`,`lucide-${jo(r)}`]:["lucide-icon"]),...i},[...a.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);/**
17
17
  * @license lucide-vue-next v0.535.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const De=(l,t)=>(n,{slots:o})=>e.h(is,{...n,iconNode:t,name:l},o);/**
21
+ */const De=(l,t)=>(n,{slots:o})=>e.h(cs,{...n,iconNode:t,name:l},o);/**
22
22
  * @license lucide-vue-next v0.535.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const cs=De("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"}]]);/**
26
+ */const ds=De("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"}]]);/**
27
27
  * @license lucide-vue-next v0.535.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const ds=De("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
31
+ */const us=De("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
32
32
  * @license lucide-vue-next v0.535.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const us=De("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"}]]);/**
36
+ */const ps=De("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"}]]);/**
37
37
  * @license lucide-vue-next v0.535.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
@@ -43,37 +43,37 @@
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const ps=De("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"}]]);/**
46
+ */const ms=De("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"}]]);/**
47
47
  * @license lucide-vue-next v0.535.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const Gt=De("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"}]]);/**
51
+ */const Wt=De("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
52
52
  * @license lucide-vue-next v0.535.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const ms=De("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"}]]);/**
56
+ */const fs=De("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"}]]);/**
57
57
  * @license lucide-vue-next v0.535.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const fs=De("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"}]]);/**
61
+ */const hs=De("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"}]]);/**
62
62
  * @license lucide-vue-next v0.535.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const hs=De("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"}]]);/**
66
+ */const vs=De("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"}]]);/**
67
67
  * @license lucide-vue-next v0.535.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const vs=De("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"}]]);/**
71
+ */const gs=De("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"}]]);/**
72
72
  * @license lucide-vue-next v0.535.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const gs=De("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
76
+ */const ys=De("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
77
77
  * @license lucide-vue-next v0.535.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
@@ -83,12 +83,12 @@
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const ys=De("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"}]]);/**
86
+ */const ks=De("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"}]]);/**
87
87
  * @license lucide-vue-next v0.535.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const ks=De("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
91
+ */const bs=De("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
92
92
  * @license lucide-vue-next v0.535.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
@@ -98,22 +98,22 @@
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const bs=De("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);/**
101
+ */const xs=De("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);/**
102
102
  * @license lucide-vue-next v0.535.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const Go=De("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"}]]);/**
106
+ */const Wo=De("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"}]]);/**
107
107
  * @license lucide-vue-next v0.535.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const xs=De("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"}]]);/**
111
+ */const ws=De("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"}]]);/**
112
112
  * @license lucide-vue-next v0.535.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const ws=De("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"}]]);/**
116
+ */const Es=De("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"}]]);/**
117
117
  * @license lucide-vue-next v0.535.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
@@ -123,7 +123,7 @@
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const Es=De("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"}]]);/**
126
+ */const Cs=De("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"}]]);/**
127
127
  * @license lucide-vue-next v0.535.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
@@ -133,32 +133,32 @@
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const Cs=De("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"}]]);/**
136
+ */const _s=De("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"}]]);/**
137
137
  * @license lucide-vue-next v0.535.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */const Ml=De("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_s={class:"border-t pt-3 mt-4"},Ns={class:"flex gap-2"},Bs={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ss={class:"flex-1 space-y-2"},Ms={class:"flex justify-between items-center"},As={class:"flex gap-2"},Ds=["disabled"],Wo=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(l,{emit:t}){const n=e.useModel(l,"isReply"),o=e.ref(""),a=t,r=()=>{o.value.trim()&&(a("sendComment",o.value),o.value="")},s=i=>{(i.ctrlKey||i.metaKey)&&i.key==="Enter"&&(i.preventDefault(),r())};return(i,c)=>(e.openBlock(),e.createElementBlock("div",_s,[e.createElementVNode("div",Ns,[e.createElementVNode("span",Bs,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Ss,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),onKeydown:s,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,o.value]]),e.createElementVNode("div",Ms,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",As,[n.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>n.value=!1)},[e.createVNode(e.unref(Ml),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!o.value.trim(),onClick:r},[e.createVNode(e.unref(Go),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Ds)])])])])]))}}),Ts={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"},Ls=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(l,{emit:t}){const n=t,o=e.useModel(l,"showMoreOptions"),a=e.ref(),r=e.ref(!0),s=async d=>{o.value&&a.value&&!a.value.contains(d.target)&&!r.value&&(o.value=!1),r.value=!1},i=()=>{o.value=!1,n("edit")},c=()=>{o.value=!1,n("delete")};return e.onMounted(()=>{document.addEventListener("click",s)}),e.onUnmounted(()=>{document.removeEventListener("click",s)}),(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:a},[e.createElementVNode("div",Ts,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:i},[e.createVNode(e.unref(ws),{class:"h-3 w-3 mr-2"}),u[0]||(u[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(Bl),{class:"h-3 w-3 mr-2"}),u[1]||(u[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),$s={class:"space-y-2"},Is={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Fs={class:"flex-1 min-w-0 space-y-1 relative"},Os={class:"flex items-center gap-2"},Ps={class:"font-medium text-xs"},Rs={class:"text-xs text-gray-500"},zs={key:0,class:"text-xs text-gray-700 leading-relaxed"},js={class:"flex justify-between text-xs"},Us={class:"flex items-center gap-2"},Hs={key:0,class:"flex gap-2"},qs=["disabled"],Gs={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Ws=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(l,{emit:t}){const n=t,o=l,a=e.ref(o.comment.text),r=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),s=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),i=e.ref(!1),c=e.ref(!1),d=e.ref(!1),u=e.ref(!1),p=f=>{const E=new Date,C=Math.floor((E.getTime()-f.getTime())/(1e3*60*60));return C<1?`${Math.floor((E.getTime()-f.getTime())/6e4)}m`:C<24?`${C}h`:`${Math.floor(C/24)}d`},g=()=>{u.value=!u.value,u.value?n("like",o.comment.id,"add"):n("like",o.comment.id,"delete")},y=()=>{n("edit",o.comment.id,a.value),d.value=!1},w=(f,E)=>{n("like",f,E)},m=(f,E)=>{n("edit",f,E)};return(f,E)=>{const C=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",Is,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Fs,[e.createElementVNode("div",Os,[e.createElementVNode("span",Ps,e.toDisplayString(f.comment?.author),1),e.createElementVNode("span",Rs,e.toDisplayString(p(f.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=_=>a.value=_),class:e.normalizeClass(d.value?s.value:r.value)},null,2)),[[e.vModelText,a.value]]):(e.openBlock(),e.createElementBlock("p",zs,e.toDisplayString(f.comment?.text),1)),e.createElementVNode("div",js,[e.createElementVNode("div",Us,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",u.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=_=>g())},[e.createVNode(e.unref(hs),{class:e.normalizeClass(["h-3 w-3",u.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(f.comment?.likes),1)],2),f.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=_=>c.value=!0)},[e.createVNode(e.unref(bs),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:E[3]||(E[3]=_=>i.value=!0)},[e.createVNode(e.unref(ps),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",Hs,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:E[4]||(E[4]=_=>d.value=!1)},[e.createVNode(e.unref(Ml),{class:"h-3 w-3"}),E[11]||(E[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!a.value.trim(),onClick:E[5]||(E[5]=_=>y())},[e.createVNode(e.unref(Go),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,qs)])):e.createCommentVNode("",!0)])]),i.value?(e.openBlock(),e.createBlock(Ls,{key:0,showMoreOptions:i.value,"onUpdate:showMoreOptions":E[6]||(E[6]=_=>i.value=_),onEdit:E[7]||(E[7]=_=>d.value=!0),onDelete:E[8]||(E[8]=_=>f.$emit("delete",f.comment?.id)),comment:f.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),f.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.comment?.replies,_=>(e.openBlock(),e.createBlock(C,{key:_.id,comment:_,isInside:!0,onDelete:b=>f.$emit("delete",_.id),onLike:w,onEdit:m},null,8,["comment","onDelete"]))),128)),c.value&&!f.isInside?(e.openBlock(),e.createBlock(Wo,{key:0,onSendComment:E[9]||(E[9]=_=>f.$emit("reply",f.comment?.id,_)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=_=>c.value=_)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),Ks=["id"],Ys={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Tn=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(n.comments??[]);async function r(){if(!n.id)return;const p=await fetch(`/api/widget/comment/${n.id}`).then(g=>g.json());a.value=p.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}a.value.length===0&&r();const s=async p=>{n.onAddComment?n.onAddComment(p):n.id&&(await fetch(`/api/widget/comment/${n.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:p})}),await r()),o("add",p)},i=(p,g)=>{n?.onLike?.(p,g),o("like",p,g)},c=(p,g)=>{n.onReply?.(p,g),o("reply",p,g)},d=async(p,g)=>{n.onEdit?n.onEdit(p,g):n.id&&(await fetch(`/api/widget/comment/${n.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await r()),o("edit",p,g)},u=async p=>{n.onDelete?n.onDelete(p):n.id&&(await fetch(`/api/widget/comment/${n.id}/${p}`,{method:"DELETE"}),await r()),o("delete",p)};return(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",p.className]),id:p.id,style:e.normalizeStyle(p.style)},[p.title?(e.openBlock(),e.createElementBlock("h3",Ys,e.toDisplayString(p.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([p.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:p.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,y=>(e.openBlock(),e.createBlock(Ws,{key:y.id,comment:y,onReply:c,onLike:i,onDelete:g[0]||(g[0]=w=>u(w)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Wo,{onSendComment:g[1]||(g[1]=y=>s(y))})],14,Ks))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Gt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:xs}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Es}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:vs}]]),Zs={class:"mx-auto font-sans"},Js={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Xs={class:"relative"},Qs={class:"space-y-3"},Vs={class:"flex-1 min-w-0 pb-2"},ei={class:"flex items-center gap-1.5 mb-1 mt-0.5"},ti={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ni={class:"font-medium text-xs"},li={class:"text-xs text-gray-500"},oi={class:"space-y-1"},ai={class:"text-xs text-gray-700"},ri={class:"capitalize mr-1"},si={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"},ii={key:0,class:"flex items-center gap-1 text-xs"},ci={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},di={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},Ln=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(l){const t=l,n=e.ref(Array.isArray(t.data)?t.data:[]);n.value.length===0&&t.id&&o();async function o(){const a=await fetch(`/api/widget/history/${t.id}`);if(!a.ok)return{data:[]};const r=await a.json();r.rows.forEach(s=>{s.timestamp=new Date(s.cdate),s.id=s.entity_id,s.entityType=s.entity_type,s.entityId=s.entity_id,s.action=s.change_type,s.userId=s.change_user_id,s.userName=s.username,s.timestamp=new Date(s.cdate),s.description=s.username,s.status=s.username}),n.value=r.rows}return(a,r)=>(e.openBlock(),e.createElementBlock("div",Zs,[a.title?(e.openBlock(),e.createElementBlock("h3",Js,e.toDisplayString(a.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:a.maxHeight+"px"})},[e.createElementVNode("div",Xs,[r[0]||(r[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,s=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:s?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Ko).get(s?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(s?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Vs,[e.createElementVNode("div",ei,[e.createElementVNode("span",ti,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",ni,e.toDisplayString(s?.userName),1),e.createElementVNode("span",li,e.toDisplayString(s?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(s?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",oi,[e.createElementVNode("div",ai,[e.createElementVNode("span",ri,e.toDisplayString(s?.action),1),s?.entityId?(e.openBlock(),e.createElementBlock("span",si,e.toDisplayString(s?.entityId),1)):e.createCommentVNode("",!0)]),s?.changes?.[s?.entityId]?(e.openBlock(),e.createElementBlock("div",ii,[s?.changes?.[s?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",ci,e.toDisplayString(s?.changes?.[s?.entityId]?.old),1)):e.createCommentVNode("",!0),s?.changes?.[s?.entityId]?.old&&s?.changes?.[s?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(ds),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),s?.changes?.[s?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",di,e.toDisplayString(s?.changes?.[s?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),ui={key:0,class:"text-xl font-semibold"},pi={class:"flex gap-1"},mi={key:0},fi={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"},hi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(l){const t=e.useModel(l,"modelValue"),n={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",o.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[o.title?(e.openBlock(),e.createElementBlock("h3",ui,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",pi,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",t.value==="list"?n.active:n.inactive]),onClick:a[0]||(a[0]=r=>t.value="list")},[e.createVNode(e.unref(ys),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",t.value==="grid"?n.active:n.inactive]),onClick:a[1]||(a[1]=r=>t.value="grid")},[e.createVNode(e.unref(fs),{class:"h-4 w-4"})],2),o.editable?(e.openBlock(),e.createElementBlock("label",mi,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:a[2]||(a[2]=r=>o.$emit("onAddFile",r))},null,32),e.createElementVNode("div",fi,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),a[3]||(a[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Al={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Gt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:ms,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Cs,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Gt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:cs,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Gt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Gt,label:"PPT"}};function Yo(l,t="en"){const n={month:"short",day:"numeric"};return new Intl.DateTimeFormat(t,n).format(l)}function Zo(l){if(l===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(l)/Math.log(t));return`${parseFloat((l/Math.pow(t,o)).toFixed(1))} ${n[o]}`}const vi={class:"space-y-0.5"},gi=["onClick"],yi=["onClick"],ki={class:"flex items-center gap-2"},bi={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},xi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},wi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ei={class:"flex items-center gap-1"},Ci=["onClick"],_i=["onClick"],Ni=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,o=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:o.id,onClick:e.withModifiers(a=>t.$emit("openLightbox",o),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(Al)[o?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Al)[o?.ext]?.icon||e.unref(Al).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:a=>t.$emit("openLightbox",o)},[e.createElementVNode("div",ki,[e.createElementVNode("span",bi,e.toDisplayString(o?.uploaded_name||o?.name),1)])],8,yi),e.createElementVNode("div",xi,e.toDisplayString(e.unref(Zo)(o.size)),1),e.createElementVNode("div",wi,e.toDisplayString(e.unref(Yo)(o.createdAt)),1),e.createElementVNode("div",Ei,[e.createElementVNode("button",{onClick:e.withModifiers(a=>t.$emit("download",o),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(Uo),{class:"h-3 w-3"})],8,Ci),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(a=>t.$emit("delete",a,o?.file_id),["stop"])},[e.createVNode(e.unref(Bl),{class:"h-3 w-3"})],8,_i)])],8,gi))),128))]))}}),Bi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Si=["onClick"],Mi={class:"space-y-2"},Ai={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Di=["src"],Ti={class:"space-y-1"},Li=["title"],$i={class:"text-xs text-gray-500 text-left"},Ii={class:"absolute top-2 right-1 flex items-center gap-1"},Fi=["onClick"],Oi=["onClick"],Pi=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",Bi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,onClick:e.withModifiers(a=>t.$emit("openLightbox",o),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Mi,[e.createElementVNode("div",Ai,[o.ext==="png"||o.ext==="jpg"||o.ext==="jpeg"||o.ext==="gif"||o.ext==="svg"||o.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${o?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,Di)):(e.openBlock(),e.createBlock(e.unref(Gt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ti,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:o.uploaded_name||o.name},e.toDisplayString(o.uploaded_name||o.name),9,Li),e.createElementVNode("p",$i,e.toDisplayString(e.unref(Yo)(o.createdAt))+", "+e.toDisplayString(e.unref(Zo)(o.size)),1)])]),e.createElementVNode("div",Ii,[e.createElementVNode("button",{onClick:e.withModifiers(a=>t.$emit("download",o),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(Uo),{class:"h-3 w-3"})],8,Fi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(a=>t.$emit("delete",a,o?.file_id),["stop"])},[e.createVNode(e.unref(Bl),{class:"h-3 w-3"})],8,Oi)])],8,Si))),128))]))}}),Ri={class:"mx-auto font-sans"},zi={key:1},$n=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(l,{emit:t}){const n=l,o=e.ref(!1),a=e.ref(null),r=e.ref(!1),s=e.ref(0),i=e.ref(n.files??[]),c=t;i.value.length===0&&E();const d=(b,x)=>{a.value=x,o.value=!0},u=()=>{a.value&&(w(a.value),a.value=null,o.value=!1)},p=e.computed(()=>Array.isArray(i.value)?i.value.map(b=>b?.file_path):[]),g=b=>{const x=p.value.findIndex(D=>D===b.file_path);x!==-1&&(r.value=!0,s.value=x)},y=b=>{n.onAddFile?n.onAddFile(b):C(b),c("add",b)},w=b=>{n.onDelete?n.onDelete(b):_(b),c("delete",b)},m=b=>{const x=document.createElement("a");x.setAttribute("download",b?.uploaded_name||b?.name),x.href=b?.file_path||b?.path,x.click()},f=e.ref("list");async function E(){if(!n.id)return;const b=await fetch(`/api/widget/file/${n.id}`).then(x=>x.json());b.rows.forEach(x=>{x.timestamp=new Date(x.cdate),x.id=x.entity_id,x.entityType=x.entity_type,x.entityId=x.entity_id,x.entityType=x.entity_type,x.action=x.change_type,x.userId=x.change_user_id,x.userName=x.username,x.timestamp=new Date(x.cdate),x.description=x.username,x.status=x.username}),i.value=b.rows}const C=async b=>{if(!(!b.target||!b.target.files||b.target.files.length===0))try{await Promise.all(Array.from(b.target.files).map(async x=>{const D=new FormData;D.append("file",x);const S=`/api/widget/file/${n.id}`,M=await fetch(S,{method:"POST",body:D});if(!M.ok)throw new Error(`HTTP error! status: ${M.status}`);return x})),await E()}catch(x){console.error("Помилка при завантаженні файлів:",x)}},_=async b=>{try{await fetch(`/api/widget/file/${n.id}/${b}`,{method:"DELETE"}),await E()}catch(x){console.error(x)}};return(b,x)=>{const D=e.resolveComponent("MessageBox"),S=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ri,[e.createVNode(hi,{modelValue:f.value,"onUpdate:modelValue":x[0]||(x[0]=M=>f.value=M),title:n.title,onOnAddFile:x[1]||(x[1]=M=>y(M)),editable:n.editable},null,8,["modelValue","title","editable"]),i.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(b.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:b.maxHeight+"px"})},[f.value==="list"?(e.openBlock(),e.createBlock(Ni,{key:0,onDelete:d,onDownload:m,onOpenLightbox:x[2]||(x[2]=M=>g(M)),files:i.value},null,8,["files"])):e.createCommentVNode("",!0),f.value==="grid"?(e.openBlock(),e.createBlock(Pi,{key:1,onDelete:d,onDownload:m,onOpenLightbox:x[3]||(x[3]=M=>g(M)),files:i.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",zi,x[6]||(x[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(D,{modelValue:o.value,"onUpdate:modelValue":x[4]||(x[4]=M=>o.value=M),onConfirm:u,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(S,{modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=M=>r.value=M),images:p.value,"start-index":s.value},null,8,["modelValue","images","start-index"])],64)}}}),ji={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Ui=["onClick"],Hi={key:0,rel:"noreferrer",class:"relative block h-full w-full"},qi=["src"],Gi={key:0,class:"thumb-cover"},Wi=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(l,{emit:t}){const n=t,o=e.ref(!1),a=e.ref(0),r=l,s=e.computed(()=>Array.isArray(r.items)?r.items.map(c=>c?.file_path):[]),i=c=>{const d=s.value.findIndex(u=>u===c.file_path);d!==-1&&(o.value=!0,a.value=d)};return(c,d)=>{const u=e.resolveComponent("Lightbox");return c.items?.length>=1?(e.openBlock(),e.createElementBlock("div",ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.items,(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(y=>i(p),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("img",{src:`/file/resize?filepath=${p?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,qi),g===4&&c.items?.length>5?(e.openBlock(),e.createElementBlock("div",Gi," +"+e.toDisplayString(c.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Ui))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-c.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(c.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(u,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=p=>o.value=p),images:s.value,"start-index":a.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=p=>n("delete",p))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),Ki={key:0,class:"text-xl font-semibold"},Yi={class:"flex gap-1"},Zi={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"},Ji=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ki,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Yi,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:n[0]||(n[0]=o=>t.$emit("onAddImage",o))},null,32),e.createElementVNode("div",Zi,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),n[1]||(n[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Xi={class:"w-full mx-auto font-sans",ref:"containerRef"},Qi={key:1},In=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(l,{emit:t}){const n=l,o=e.ref(n.items??[]),a=t;o.value.length===0&&c();const r=u=>{n.onAddImage?n.onAddImage(u):i(u),a("add",u)},s=u=>{const p=o.value.find(g=>g.file_path===u)?.file_id;p&&(n.onDelete?n.onDelete(p):d(p))},i=async u=>{if(!(!u.target||!u.target.files||u.target.files.length===0))try{await Promise.all(Array.from(u.target.files).map(async p=>{const g=new FormData;g.append("file",p);const y=`/api/widget/file/${n.id}`,w=await fetch(y,{method:"POST",body:g});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return p})),await c()}catch(p){console.error("Помилка при завантаженні файлів:",p)}};async function c(){if(!n.id)return;const u=await fetch(`/api/widget/file/${n.id}`).then(p=>p.json());o.value=u.rows}const d=async u=>{try{await fetch(`/api/widget/file/${n.id}/${u}`,{method:"DELETE"}),await c()}catch(p){console.error(p)}};return(u,p)=>(e.openBlock(),e.createElementBlock("div",Xi,[e.createVNode(Ji,{title:u.title,onOnAddImage:p[0]||(p[0]=g=>r(g))},null,8,["title"]),o.value.length>0?(e.openBlock(),e.createBlock(Wi,{key:0,items:o.value,onDelete:p[1]||(p[1]=g=>s(g))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",Qi,p[2]||(p[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),Vi={class:"text-value"},ec={class:"text-sm text-gray-900"},tc=e.defineComponent({__name:"TextValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=t.item.value;return typeof o=="boolean"?o?"Так":"Ні":o==null?"—":String(o)});return(o,a)=>(e.openBlock(),e.createElementBlock("div",Vi,[e.createElementVNode("span",ec,e.toDisplayString(n.value),1)]))}}),_t=(l,t)=>{const n=l.__vccOpts||l;for(const[o,a]of t)n[o]=a;return n},nc=_t(tc,[["__scopeId","data-v-34a76c89"]]),lc={class:"link-value"},oc=["href"],ac=_t(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=String(t.item.value);try{const a=new URL(o);return a.hostname+a.pathname}catch{return o}});return(o,a)=>(e.openBlock(),e.createElementBlock("div",lc,[e.createElementVNode("a",{href:String(o.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(n.value)+" ",1),a[0]||(a[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,oc)]))}}),[["__scopeId","data-v-932f028c"]]),rc={class:"date-value"},sc={class:"text-sm text-gray-900"},ic=_t(e.defineComponent({__name:"DateValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=t.item.value;if(o instanceof Date)return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof o=="string"){const a=new Date(o);if(!isNaN(a.getTime()))return a.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(o)});return(o,a)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("span",sc,e.toDisplayString(n.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),cc={class:"status-value"},dc={key:0,class:"mr-1"},uc=_t(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{switch(String(t.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"}}),o=e.computed(()=>{switch(String(t.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(a,r)=>(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",n.value])},[o.value?(e.openBlock(),e.createElementBlock("span",dc,[e.createElementVNode("i",{class:e.normalizeClass(o.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(a.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),pc={class:"custom-value"},mc={class:"text-sm text-gray-900"},fc=_t(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",pc,[e.renderSlot(t.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",mc,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),hc=["id"],vc={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},gc={key:1,class:"overflow-x-auto"},yc={class:"min-w-full divide-y divide-gray-200"},kc={class:"bg-white divide-y divide-gray-200"},bc={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},xc={class:"flex items-center gap-2"},wc=["title"],Ec={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Cc={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},_c={class:"flex items-start gap-3"},Nc={key:0,class:"flex-shrink-0"},Bc={class:"flex-1 min-w-0"},Sc={class:"flex items-center gap-2 mb-2"},Mc={class:"text-sm font-medium text-gray-900"},Ac=["title"],Dc={key:3,class:"overflow-x-auto"},Tc={class:"min-w-full divide-y divide-gray-200"},Lc={class:"bg-white divide-y divide-gray-200"},$c={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Ic={class:"flex items-center gap-2"},Fc=["title"],Oc={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Dl=_t(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(l){const t=n=>{switch(n.type){case"link":return ac;case"date":return ic;case"status":return uc;case"custom":return fc;default:return nc}};return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",n.className]),id:n.id,style:e.normalizeStyle(n.style)},[n.title?(e.openBlock(),e.createElementBlock("h3",vc,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),n.view==="table"?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("table",yc,[e.createElementVNode("tbody",kc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("tr",{key:a.id||a.label},[e.createElementVNode("td",bc,[e.createElementVNode("div",xc,[a.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.label)+" ",1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:a.tooltip},o[0]||(o[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,wc)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ec,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])]))),128))])])])):n.view==="grid"?(e.openBlock(),e.createElementBlock("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id||a.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",_c,[a.icon?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("i",{class:e.normalizeClass([a.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bc,[e.createElementVNode("div",Sc,[e.createElementVNode("h4",Mc,e.toDisplayString(a.label),1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:a.tooltip},o[1]||(o[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Ac)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("table",Tc,[e.createElementVNode("tbody",Lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("tr",{key:a.id||a.label},[e.createElementVNode("td",$c,[e.createElementVNode("div",Ic,[a.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.label)+" ",1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:a.tooltip},o[2]||(o[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Fc)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Oc,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])]))),128))])])]))],14,hc))}}),[["__scopeId","data-v-106790ef"]]),Jo=Symbol("vs-widget-map");function Tl(l){if(l==null||l==="")return"";if(typeof l=="object")try{return JSON.stringify(l)}catch{return""}return String(l)}function Pc(l){const t=['<div class="map-popup">'];return t.push('<div class="map-popup__body">'),l.forEach(n=>{t.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${n.label}: </span><span class="text-slate-700">${n.value}</span></div>`)}),t.push("</div></div>"),t.join("")}function Rc(l){return typeof l=="string"?document.getElementById(l):"value"in l?l.value??null:l}function Xo(l){if(!l)return"";const t=l.trim();if(!t)return"";if(/^https?:\/\//i.test(t))return t;const n=window.location?.origin??"",o=t.replace(/^\/+/,"");return n?`${n}/${o}`:o?`/${o}`:""}function zc(l){const t=(l?.service??"").toLowerCase();if(t)return t;const n=(l?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(n)?"vtile":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(n)?"wms":""}function jc(l){return l.sourceLayer||l.layer||l.service_layer||l.service_key||l.map_key||l.dataset?.layer||l.id?.toString()}function Fn(l){if(l!=null){if(typeof l=="number")return l;if(typeof l=="string"){const t=l.trim();if(!t)return;const n=Number(t);return Number.isFinite(n)?n:void 0}}}const Qo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function Uc(l){const t=l?.color??Qo[0],n=(l?.colorAttr??"").trim();if(!n)return t;const o=l?.colorSet&&Object.keys(l.colorSet).length>0,a={};if(o&&l?.colorSet?Object.entries(l.colorSet).forEach(([s,i])=>{const c=typeof i=="string"?i.trim():"",d=String(s).trim();c&&d&&(a[d]=c)}):Qo.forEach((s,i)=>{a[String(i+1)]=s}),!Object.keys(a).length)return t;const r=["match",["to-string",["coalesce",["get",n],""]]];return Object.entries(a).forEach(([s,i])=>{r.push(String(s),i)}),r.push(t),r}const rn="map-highlight-source",Hc="map-highlight-fill",qc="map-highlight-line";function Gc(l){return l?typeof l.toJSON=="function"?l.toJSON():l.geometry?{type:"Feature",geometry:l.geometry,properties:l.properties??{}}:null:null}function Vo(l,t){return l?l.replace(/\{([^}]+)\}/g,(n,o)=>{const a=t?.[o];return a==null?"":String(a)}):""}function Wc(l){return new Promise((t,n)=>{if(typeof document>"u"){n(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(r=>r.src===l)){t();return}const a=document.createElement("script");a.src=l,a.async=!0,a.onload=()=>t(),a.onerror=()=>n(new Error(`Failed to load ${l}`)),document.body.appendChild(a)})}function Kc(l){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(o=>o.href===l))return;const n=document.createElement("link");n.rel="stylesheet",n.href=l,document.head.appendChild(n)}async function Yc(){return Kc("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Wc("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),window?.maplibregl}function On(l){const t=e.inject(Jo,void 0);if(!l){if(!t)throw new Error("useMap() must be called inside a map provider");return t}if(t)return t;const n=e.ref(null),o=e.ref(!1),a=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),r=e.ref([]),s=e.ref([]),i=e.ref(null),c=e.ref(null),d=e.ref(null);let u=l.style??null,p=null;const g=L=>{L&&(n.value?n.value.setStyle(L):u=L)},y=()=>{a.value.overlays=s.value.map(L=>({id:L.id,name:L.config.name,visible:L.visible}))},w=L=>{const le=Array.isArray(L)?L:[];r.value=le,le.some(P=>P.key===a.value.selectedBasemap)||(a.value.selectedBasemap=le[0]?.key??"")},m=L=>{L&&s.value.forEach(le=>{le.layerIds.forEach(T=>{L.getLayer(T)&&L.removeLayer(T)}),L.getSource(le.sourceId)&&L.removeSource(le.sourceId),le.layerIds=[]})},f=()=>{const L=n.value;!L||typeof L.isStyleLoaded!="function"||!L.isStyleLoaded()||(s.value.forEach(le=>{E(L,le)}),K())},E=(L,le)=>{zc(le.config)==="vtile"&&C(L,le)},C=(L,le)=>{const T=le.config,P=le.sourceId,X=Xo(T.url);if(!X)return;L.getSource(P)||L.addSource(P,{type:"vector",tiles:[X],minzoom:T.minzoom??0,maxzoom:T.maxzoom??24});const J=T.style??{},re=Uc(J),xe=[],F={visibility:le.visible?"visible":"none"},te=jc(T),ae={source:P,layout:F};if(te&&(ae["source-layer"]=te),(J.type??"polygon").toLowerCase()==="point"){const Ae=`${le.id}-circle`;L.getLayer(Ae)||L.addLayer({id:Ae,type:"circle",...ae,paint:{"circle-color":re,"circle-opacity":J.opacity??1,"circle-radius":J.radius??J.width??3,"circle-stroke-color":J.stroke??J.color??"#ffffff","circle-stroke-width":J.width??1}}),xe.push(Ae);const Re=J.text??J.label;if(Re){const Ye=`${le.id}-symbol`,dt=Fn(J.textSize)??10,Qe=J.textHaloColor??J.stroke??"#ffffff",ht=Fn(J.textHaloWidth)??1,ze=Fn(J.textZoom??J.pointZoom),Le={"text-color":J.textColor??"#000000","text-halo-color":Qe,"text-halo-width":ht},je={id:Ye,type:"symbol",...ae,layout:{"text-field":["coalesce",["get",Re],""],"text-size":dt,"text-anchor":"top"},paint:Le};ze!=null&&(je.minzoom=ze),L.getLayer(Ye)||L.addLayer(je),xe.push(Ye)}}else{const Ae=`${le.id}-fill`;L.getLayer(Ae)||L.addLayer({id:Ae,type:"fill",...ae,paint:{"fill-color":re,"fill-opacity":J.opacity??.5,"fill-outline-color":J.stroke??J.color??"#0ea5e9"}}),xe.push(Ae);const Re=`${le.id}-line`;L.getLayer(Re)||L.addLayer({id:Re,type:"line",...ae,paint:{"line-color":J.stroke??J.color??"#0b74c4","line-width":Fn(J.width??J.border)??1,"line-opacity":J.opacity??1}}),xe.push(Re)}le.layerIds=xe,_(L,le)},_=(L,le)=>{const T=le.visible?"visible":"none";le.layerIds.forEach(P=>{L.getLayer(P)&&L.setLayoutProperty(P,"visibility",T)})},b=L=>{const le=Array.isArray(L)?L:[];m(n.value??void 0),d.value=null,q();const T=le.map((P,X)=>{if(!P)return null;const J=Xo(P.url);if(!J)return null;const re=P.id!=null?String(P.id):`overlay-${X}`;return{id:re,config:{...P,id:re,url:J},visible:P.enabled!==!1,sourceId:`${re}-source`,layerIds:[]}}).filter(P=>!!P);s.value=T,y(),f()},x=(L,le)=>{const T=s.value.find(X=>X.id===L);if(!T)return;T.visible=le,y();const P=n.value;if(!(!P||typeof P.isStyleLoaded!="function"||!P.isStyleLoaded())){if(!T.layerIds.length){E(P,T);return}_(P,T)}},D=()=>{i.value&&(i.value.remove(),i.value=null)},S=(L,le={})=>!Array.isArray(L.popup)||!L.popup.length?[]:L.popup.map(T=>({label:T.label??T.field,value:Tl(le?.[T.field])})).filter(T=>T.label&&T.value!==void 0),M=L=>{const le=n.value;if(!le||!L?.point)return;const T=le.queryRenderedFeatures(L.point);for(const P of T){const X=P.layer?.id??P.sourceLayer;if(!X)continue;const J=ue(X);if(!J)continue;const re=S(J,P.properties??P.layer?.properties??{});if(!re.length)continue;const xe=Pc(re),F=window?.maplibregl;if(!F)return;const te=L.lngLat;if(c.value===X&&i.value){i.value.setLngLat(te),i.value.setHTML(xe);return}c.value=X,D(),i.value=new F.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(te).setHTML(xe).addTo(le);return}c.value=null,D()},O=()=>{c.value=null,D()},K=()=>{const L=n.value;!L||typeof L.isStyleLoaded!="function"||!L.isStyleLoaded()||L.getSource(rn)||(L.addSource(rn,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),L.addLayer({id:Hc,type:"fill",source:rn,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),L.addLayer({id:qc,type:"line",source:rn,paint:{"line-color":"#1d4ed8","line-width":2}}))},U=L=>{const le=n.value;if(!le||typeof le.isStyleLoaded!="function"||!le.isStyleLoaded())return;K();const T=le.getSource(rn);if(!(!T||typeof T.setData!="function")){if(!L){T.setData({type:"FeatureCollection",features:[]});return}T.setData({type:"FeatureCollection",features:[L]})}},R=L=>{const le=Gc(L);le&&U(le)},q=()=>{U(null)},N=()=>{d.value=null,q()},j=L=>{if(L)return typeof L=="string"?L:L.field??L.name??L.key??L.label},$=L=>{if(L)return typeof L=="string"?L:L.label??L.title??L.field??L.name},Z=(L,le)=>!L||!L.length?[]:L.map(T=>{const P=j(T);if(!P)return null;const X=$(T),J=Tl(le?.[P]);return!X||J===""?null:{label:X,value:J}}).filter(T=>!!T),V=(L,le)=>!Array.isArray(L)||!L.length?[]:L.map(T=>{if(!T?.name)return null;const P=T.title??T.name,X=Tl(le?.[T.name]);return!P||X===""?null:{label:P,value:X}}).filter(T=>!!T),oe=(L,le)=>!Array.isArray(L)||!L.length?[]:L.map(P=>{const X=Vo(P.url,le),J=P.label??P.url;return X?{label:J,url:X,target:P.target}:null}).filter(P=>!!P),ee=async(L,le)=>{const T=Vo(L,le);if(!T)return null;try{const P=await fetch(T);return P.ok?await P.json():null}catch{return null}},H=async(L,le)=>{const T=le.properties??le.layer?.properties??{},P=Z(L.card?.rows,T);let X,J;if(L.card?.api){const F=await ee(L.card.api,T);F&&(typeof F.html=="string"&&F.html.trim()&&(X=F.html),Array.isArray(F.columns)&&F.columns.length&&(J=F.columns))}let re=P;if(!X&&J){const F=V(J,T);F.length&&(re=F)}if(!re.length&&!X)return null;const xe=oe(L.card?.actions,T);return{title:T?.name??L.name,rows:re,html:X,actions:xe.length?xe:void 0}},ie=async L=>{const le=n.value;if(!le||!L?.point)return;const T=le.queryRenderedFeatures(L.point);for(const P of T){const X=P.layer?.id??P.sourceLayer;if(!X)continue;const J=ue(X);if(!J||!J.card)continue;const re=await H(J,P);if(re){d.value=re,R(P);return}}d.value=null,q()},Y=()=>{const L=n.value;L&&(L.on("mousemove",M),L.on("mouseleave",O),L.on("click",ie))},se=()=>{const L=n.value;L&&(L.off("mousemove",M),L.off("mouseleave",O),L.off("click",ie),D(),q())},ue=L=>{if(L)return s.value.find(le=>le.layerIds.includes(L))?.config},he=async()=>{const L=await Yc(),le=Rc(l.container);if(!L||!le)return;const T={container:le,center:l.center??[30.524,50.45],zoom:l.zoom??10,style:u??l.style??"https://demotiles.maplibre.org/style.json",attributionControl:!1,...l.mapOptions};n.value=new L.Map(T);const P=()=>{f()};p=P,n.value.on("style.load",P),n.value.on("load",()=>{o.value=!0,u&&n.value&&(n.value.setStyle(u),u=null),f(),Y()})};e.onMounted(he),e.onBeforeUnmount(()=>{se(),n.value&&p&&n.value.off("style.load",p),m(n.value??void 0),n.value?.remove(),n.value=null,o.value=!1});const be={map:n,ready:o,setStyle:g,flyTo:L=>n.value?.flyTo(L),fitBounds:(L,le)=>n.value?.fitBounds(L,le),setCenter:L=>n.value?.setCenter(L),setZoom:L=>n.value?.setZoom(L),addControl:(L,le)=>n.value?.addControl(L,le),removeControl:L=>n.value?.removeControl(L),on:(L,...le)=>n.value?.on(L,...le),off:(L,...le)=>n.value?.off(L,...le),project:L=>n.value?.project(L),unproject:L=>n.value?.unproject(L),state:a,basemapOptions:r,setOverlays:b,toggleOverlay:x,getOverlayConfig:ue,selectedCard:d,setBasemapOptions:w,clearCard:N};return e.provide(Jo,be),be}const Zc={class:"map-base-layer-menu"},Jc={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Xc={class:"flex items-center justify-between p-2 border-b"},Qc={class:"p-2 border-b"},Vc={class:"flex items-center"},ed=["value","checked","onChange"],td={class:"ml-2"},nd={class:"p-2"},ld={class:"flex items-center"},od=["checked"],ad=["checked","onChange"],rd={class:"ml-2"},sd=e.defineComponent({__name:"LayerMenu",setup(l){const{state:t,basemapOptions:n,setBasemap:o,toggleGeometry:a,toggleOverlay:r}=On(),s=e.ref(!1),i=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>n.value),d=e.computed(()=>t.value.selectedBasemap??""),u=e.computed(()=>t.value.geometryVisible??!0),p=e.computed(()=>t.value.overlays??[]),g=m=>{o?.(m)},y=()=>{a?.(!u.value)},w=m=>{r?.(m.id,!m.visible)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",Zc,[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:f[0]||(f[0]=E=>s.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),s.value?(e.openBlock(),e.createElementBlock("div",Jc,[e.createElementVNode("div",Xc,[f[3]||(f[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:f[1]||(f[1]=E=>s.value=!1)},f[2]||(f[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)]))]),e.createElementVNode("div",Qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",Vc,[e.createElementVNode("input",{type:"radio",name:i,value:E.key,checked:d.value===E.key,onChange:C=>g(E.key)},null,40,ed),e.createElementVNode("span",td,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",nd,[e.createElementVNode("label",ld,[e.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:y},null,40,od),f[4]||(f[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:C=>w(E)},null,40,ad),e.createElementVNode("span",rd,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),id={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},cd={class:"leading-tight"},dd=e.defineComponent({__name:"Legend",props:{items:{}},setup(l){return(t,n)=>t.items.length?(e.openBlock(),e.createElementBlock("div",id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,o=>(e.openBlock(),e.createElementBlock("div",{key:o.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",cd,e.toDisplayString(o.label),1)]))),128))])):e.createCommentVNode("",!0)}}),ud={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},pd={class:"font-mono"},md=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",ud,[e.createElementVNode("span",pd,e.toDisplayString(t.coordinates),1)]))}}),ea=e.defineComponent({__name:"vs-info-tooltip",props:{text:{}},setup(l){const t=l,n=e.ref(!1),o=e.ref({top:"0px",left:"0px"});function a(s){if(!t.text)return;const i=s.currentTarget.getBoundingClientRect();o.value={top:`${i.bottom+4}px`,left:`${Math.min(i.left,window.innerWidth-230)}px`},n.value=!0}function r(){n.value=!1}return(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{class:"inline-flex items-center",onMouseenter:a,onMouseleave:r},[e.renderSlot(s.$slots,"default",{},()=>[i[0]||(i[0]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-gray-400 cursor-help"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1))])],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[n.value&&s.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(o.value),class:"fixed z-[9999] max-w-xs p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"},e.toDisplayString(s.text),5)):e.createCommentVNode("",!0)]))],64))}}),fd={class:"w-full relative"},hd={key:0,class:"text-[14px] font-medium text-gray-900 mb-2 flex items-center gap-1"},vd={class:"opacity-100"},gd={key:0,class:"text-red-500 text-[14px]"},yd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},kd=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,n=e.computed(()=>typeof t.item?.label=="string"&&t.item.label?t.item.label:t.item?.ua||t.label||t.ua),o=e.computed(()=>!!n.value),a=e.computed(()=>!!t.item?.rules?.includes("required")),r=e.computed(()=>t.item?.info||"");return(s,i)=>(e.openBlock(),e.createElementBlock("div",fd,[o.value?(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("span",vd,e.toDisplayString(n.value),1),a.value?(e.openBlock(),e.createElementBlock("span",gd,"*")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(ea,{key:1,text:r.value},null,8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.mergeProps(s.$attrs,{class:{"opacity-60":s.item.disabled}})),s.error?(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(s.error),1)):e.createCommentVNode("",!0)]))}}),bd={class:"w-full relative flex flex-row items-center gap-2"},xd={key:0,class:"text-red-500 text-[14px]"},wd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Ed=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,n=e.computed(()=>t.item?.label||t.label||t.ua),o=e.computed(()=>t.item?.info||""),a=e.computed(()=>t.columns??{container:12,label:3}),r=e.computed(()=>{const{container:d,label:u}=a.value;return!d||d<=0?0:Math.min(Math.max(u??0,0),d)/d}),s=e.computed(()=>t.item?.type==="html"||r.value<=0?!1:!!n.value),i=e.computed(()=>{if(!s.value)return{};const d=`${r.value*100}%`;return{flexBasis:d,maxWidth:d}}),c=e.computed(()=>{const{container:d,label:u}=a.value;if(!d||d<=0)return{};if(t.item?.type==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!s.value)return{flexBasis:"100%",maxWidth:"100%"};const p=Math.max(d-Math.max(u??0,0),0)/d;if(!p)return{};const g=`${p*100}%`;return{flexBasis:g,maxWidth:g}});return(d,u)=>(e.openBlock(),e.createElementBlock("div",bd,[s.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 items-center gap-1",style:e.normalizeStyle(i.value)},[e.createTextVNode(e.toDisplayString(n.value)+" ",1),d.item?.rules?.includes("required")&&n.value?(e.openBlock(),e.createElementBlock("span",xd,"*")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(ea,{key:1,text:o.value},null,8,["text"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(c.value)},[e.renderSlot(d.$slots,"default",e.normalizeProps(e.guardReactiveProps(d.$attrs)))],4),d.error?(e.openBlock(),e.createElementBlock("span",wd,e.toDisplayString(d.error),1)):e.createCommentVNode("",!0)]))}}),Cd={class:"w-full relative"},_d={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Nd=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",Cd,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",_d,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Bd={class:"flex-1 min-w-0"},Sd={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Md={class:"truncate"},Ad={key:0,class:"text-red-500 text-[14px]"},Dd=["innerHTML"],Td={key:0,class:"mt-1 text-xs text-red-500"},Ld=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,n=e.ref("uk");e.computed(()=>(t.item??{})?.[n.value]??t.ua??t.label??"");const o=e.computed(()=>t.item?.description??""),a=e.computed(()=>Array.isArray(t.item?.rules)&&t.item.rules.includes("required")),r=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),s=()=>{const i=typeof localStorage<"u"?localStorage.getItem("locale"):null;n.value=i||"uk"};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(n.value=localStorage.locale)}catch{}window.addEventListener("storage",s)}),e.onUnmounted(()=>{window.removeEventListener("storage",s)}),(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":i.item?.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Bd,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",Sd,[e.createElementVNode("span",Md,e.toDisplayString(i.item[n.value]||i.ua||i.label),1),a.value?(e.openBlock(),e.createElementBlock("span",Ad,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:"text-xs text-slate-500 dark:text-slate-400",innerHTML:o.value},null,8,Dd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(i.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],2)],2),r.value?(e.openBlock(),e.createElementBlock("p",Td,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)],2))}}),$d={default:kd,horizontal:Ed,inline:Nd,settings:Ld};function Xe(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${l?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return l?.size==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const Id=["placeholder","disabled"],Fd=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":i[0]||(i[0]=c=>o.value=c),placeholder:r.value,disabled:a.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Id)),[[e.vModelText,o.value]])}}),Od=["placeholder","disabled","maxlength","minlength"],sn=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??""),s=e.computed(()=>t.maxlength??void 0),i=e.computed(()=>t.minlength??void 0);function c(){typeof o.value=="string"&&(o.value=o.value.trim())}return(d,u)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":u[0]||(u[0]=p=>o.value=p),placeholder:r.value,disabled:a.value,maxlength:s.value,minlength:i.value,onBlur:c,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.customClass,e.unref(n),{"!border-red-600":d.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Od)),[[e.vModelText,o.value]])}}),Pd=["placeholder","disabled","min","max"],Rd=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled);return(r,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":s[0]||(s[0]=i=>o.value=i),placeholder:r.placeholder,disabled:a.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"},min:r.min,max:r.max},null,10,Pd)),[[e.vModelText,o.value]])}}),pe=(l,t)=>{const n=l.__vccOpts||l;for(const[o,a]of t)n[o]=a;return n},zd={},jd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function Ud(l,t){return e.openBlock(),e.createElementBlock("svg",jd,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Hd=pe(zd,[["render",Ud]]),qd={class:"flex items-center gap-[4px]"},Gd=["value","id","disabled"],Wd=["for"],Kd={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},Yd=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=t,o=l,a=e.computed({get:()=>o.modelValue,set:s=>n("update:modelValue",s)}),r=e.computed(()=>!!o.disabled);return(s,i)=>(e.openBlock(),e.createElementBlock("div",qd,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:s.value,"onUpdate:modelValue":i[0]||(i[0]=c=>a.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":r.value}]),id:s.id,disabled:r.value},null,10,Gd),[[e.vModelCheckbox,a.value]]),e.createElementVNode("label",{for:s.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":r.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[a.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",s.error?"border-red-600":""]])},[e.createVNode(Hd,{height:"12",width:"12"})],2),e.createElementVNode("span",Kd,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],10,Wd)]))}}),Zd=["name","value","disabled"],Jd={class:"flex items-center gap-[6px] text-[14px]"},Xd={key:0,class:"text-[16px]"},Qd=["src"],Vd=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=e.computed({get:()=>n.modelValue,set:i=>{o("update:modelValue",i)}}),r=e.computed(()=>Array.isArray(a.value)?a.value.includes(n.value):a.value===!0||a.value===n.value),s=e.computed(()=>n.style?.size==="xs"?"p-1.5 text-xs":n.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[s.value,r.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),disabled:i.disabled},null,8,Zd),[[e.vModelCheckbox,a.value]]),e.createElementVNode("span",Jd,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",Xd,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,Qd)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),eu={class:"flex items-center"},Ll=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=`radio-${Math.floor(Math.random()*1e4)}`,r=e.computed({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:i=>{if(Array.isArray(n.modelValue)){let c=[...n.modelValue];i?c.includes(n.value)||c.push(n.value):c=c.filter(d=>d!==n.value),o("update:modelValue",c)}else o("update:modelValue",i)}}),s=e.ref(`vs-checkbox-${n.view||"default"}`);return(i,c)=>(e.openBlock(),e.createElementBlock("div",eu,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value==="vs-checkbox-buttons"?e.unref(Vd):e.unref(Yd)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),id:a,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),tu={},nu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function lu(l,t){return e.openBlock(),e.createElementBlock("svg",nu,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const $l=pe(tu,[["render",lu]]),ou={},au={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function ru(l,t){return e.openBlock(),e.createElementBlock("svg",au,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Pn=pe(ou,[["render",ru]]),su={},iu={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function cu(l,t){return e.openBlock(),e.createElementBlock("svg",iu,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)])])}const du=pe(su,[["render",cu]]),uu={key:0,class:"flex items-start gap-x-1"},pu={key:0,class:"text-red-500 text-[14px]"},mu=["title"],fu=["disabled"],ta=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue");return(o,a)=>t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",uu,[e.createVNode(Ll,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=r=>n.value=r),label:o.text,error:o.error||""},null,8,["modelValue","label","error"]),o.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",pu,"*")):e.createCommentVNode("",!0),o.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:o.i,onClick:a[1]||(a[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(du),{class:"text-gray-500 w-[14px] h-[14px]"})],8,mu)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[n.value?`bg-${o.style?.primaryColor||"blue"}-500`:"bg-stone-200",o.customClass]]),disabled:o.disabled,onClick:a[2]||(a[2]=r=>n.value=!n.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[n.value?"translate-x-4":"translate-x-0"]])},null,2)],10,fu))}}),hu=["id","innerHTML"],na=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,hu))}}),vu=["placeholder","disabled","name"],Il=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.ref(null);let r=null;function s(i){const c={9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},d=new Set;let u=!1;for(let g=0;g<i.length;g+=1){const y=i[g];y==="{"?u=!0:y==="}"?u=!1:u&&d.add(y)}const p={};return Object.keys(c).forEach(g=>{d.has(g)||(p[g]=c[g])}),{mask:i,definitions:p,lazy:!1}}return e.onMounted(async()=>{if(a.value){const{default:i}=await Promise.resolve().then(()=>zo),c=s(t.mask||"");r=i(a.value,c),r.on("accept",()=>{o.value=t.unmask?r.unmaskedValue:r.value}),r.on("complete",()=>{o.value=t.unmask?r.unmaskedValue:r.value}),r.value=o.value!=null?String(o.value):""}}),e.onBeforeUnmount(()=>{r?.destroy()}),e.watch(()=>t.mask,i=>{if(r){const c=s(i||"");r.updateOptions(c)}}),e.watch(o,i=>{r&&r.unmaskedValue!==i&&(r.value=i!=null?String(i):"")}),(i,c)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:a,placeholder:i.placeholder,disabled:i.disabled,name:i.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,vu))}}),gu={class:"relative w-full bg-white rounded-lg"},yu=["placeholder","disabled"],la=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue");return(a,r)=>(e.openBlock(),e.createElementBlock("div",gu,[r[1]||(r[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),placeholder:a.placeholder,disabled:a.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,yu),[[e.vModelText,o.value]])]))}}),ku={class:"relative w-full bg-white rounded-lg"},bu=["value","placeholder","disabled"],oa=e.defineComponent({__name:"vs-input-tel",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>o.value?o.value.startsWith("+")?o.value.slice(1):o.value:""),r=i=>{let{value:c}=i.target;c=c.replace(/^\+/,""),o.value=c?`+${c}`:""},s=i=>{const c=i,{data:d,inputType:u}=c;u&&u.startsWith("delete")||d&&/\D/.test(d)&&c.preventDefault()};return e.watch(()=>o.value,i=>{i&&!i.startsWith("+")?o.value=`+${i.replace(/^\+/,"")}`:i||(o.value="")},{immediate:!0}),(i,c)=>(e.openBlock(),e.createElementBlock("div",ku,[c[0]||(c[0]=e.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"stroke-gray-500 transition-all"},[e.createElementVNode("path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"})])],-1)),c[1]||(c[1]=e.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[30px] text-gray-500 select-none pointer-events-none"}," + ",-1)),e.createElementVNode("input",{type:"tel",value:a.value,onInput:r,onBeforeinput:s,pattern:"^\\+[1-9]\\d{1,14}$",maxlength:"15",placeholder:i.placeholder,disabled:i.disabled,class:e.normalizeClass(["!pl-10 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,bu)]))}}),xu=["value","disabled"],wu={class:"text-[13px] text-gray-700"},Eu=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>!!t.disabled);return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,o.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s),type:"radio",value:t.value,disabled:o.value,class:"hidden"},null,8,xu),[[e.vModelRadio,n.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${t.style?.primaryColor||"blue"}-500`,o.value?"opacity-50 cursor-not-allowed":""]])},[n.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${t.style?.primaryColor||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",wu,e.toDisplayString(t.text),1)],2))}}),Cu=["value","disabled"],_u={class:"text-[13px] text-gray-700"},Nu=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>!!t.disabled);return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[n.value==t.value?`ring-2 ring-ring ring-${t.style?.primaryColor||"blue"}-500`:"",t.customClass,o.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s),type:"radio",value:t.value,disabled:o.value,class:"hidden"},null,8,Cu),[[e.vModelRadio,n.value]]),e.createElementVNode("span",_u,e.toDisplayString(t.text),1)],2))}}),Bu={"vs-input-radio-default":Eu,"vs-input-radio-buttons":Nu},aa=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>Bu[`vs-input-radio-${t.view}`]);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options,s=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps({key:s?.id,text:s.text,value:s.id.toString(),checked:n.value===s.id,modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=i=>n.value=i)},{ref_for:!0},a.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),Su={key:1,class:"w-full flex flex-col gap-4"},Mu={key:0,class:"text-sm font-medium text-muted-foreground my-2"},Au="Без категорії",Du=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=e.ref([]),r=e.reactive({}),s=y=>y?.value||y?.id||y?.text||y,i=y=>y.text||String(y),c=y=>`lg:col-span-${y||12}`,d=e.computed(()=>[n.position==="vertical"?"flex flex-col":"",n.colSpan?"grid":"flex justify-start"]),u=y=>y==null||y===""?null:typeof y=="string"||typeof y=="number"?y:String(y),p=e.computed(()=>{if(!n.group)return[];const y=new Map;a.value.forEach(C=>{const _=C[n.group],b=u(_);y.has(b)||y.set(b,[]),y.get(b)?.push(C)});const w=[];n.values?.length&&n.values.forEach(C=>{const _=u(C);w.push(_)});const m=new Set,f=C=>{const _=y.get(C)||[];if(!_.length)return null;const b=C===null?"group-null":`group-${String(C)}`,x=C===null?Au:String(C);return m.add(C),{key:b,label:x,options:_}},E=[];return w.forEach(C=>{const _=f(C);_&&E.push(_)}),y.forEach((C,_)=>{if(m.has(_))return;const b=f(_);b&&E.push(b)}),E}),g=async()=>{try{const y=await fetch(`/api/suggest/${n.data}`).then(w=>w.json());a.value=y?.data||y}catch(y){console.error(y)}};return e.watch(()=>n.modelValue,y=>{if(typeof y=="boolean"&&a.value.length===1){const w=s(a.value[0]);r[w]=y}else if(Array.isArray(y)){const w=new Set(y);a.value.forEach(m=>{if(!m.disabled){const f=s(m);r[f]=w.has(f)}})}},{immediate:!0}),e.watch(r,()=>{if(!a.value.length){o("update:modelValue",null);return}const y=Object.entries(r).filter(([,w])=>w).map(([w])=>w);o("update:modelValue",y.length===0?[]:y)},{deep:!0}),e.onMounted(()=>{if(n.data)g().then(()=>{if(typeof n.modelValue=="boolean"&&a.value.length===1){const y=s(a.value[0]);r[y]=n.modelValue}else if(Array.isArray(n.modelValue)){const y=new Set(n.modelValue);a.value.forEach(w=>{if(!w.disabled){const m=s(w);r[m]=y.has(m)}})}});else if(a.value=n.options,typeof n.modelValue=="boolean"&&a.value.length===1){const y=s(a.value[0]);r[y]=n.modelValue}else if(Array.isArray(n.modelValue)){const y=new Set(n.modelValue);a.value.forEach(w=>{if(!w.disabled){const m=s(w);r[m]=y.has(m)}})}}),(y,w)=>n.group?(e.openBlock(),e.createElementBlock("div",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.key,class:"flex flex-col gap-2"},[m.label?(e.openBlock(),e.createElementBlock("span",Mu,e.toDisplayString(m.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,f=>(e.openBlock(),e.createBlock(Ll,{modelValue:r[s(f)],"onUpdate:modelValue":E=>r[s(f)]=E,value:s(f),class:e.normalizeClass(c(y.colSpan)),disabled:n.disabled||f.disabled,label:i(f),key:`${m.key}-${s(f)}`,icon:f?.icon,imgUrl:f?.imgUrl,option:f,view:y.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createBlock(Ll,{modelValue:r[s(m)],"onUpdate:modelValue":f=>r[s(m)]=f,value:s(m),class:e.normalizeClass(c(y.colSpan)),disabled:n.disabled||m.disabled,label:i(m),key:s(m),icon:m?.icon,imgUrl:m?.imgUrl,option:m,view:y.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),Tu=pe(Du,[["__scopeId","data-v-cf0478ce"]]),Lu=["type","placeholder","disabled"],$u=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l;function o(u){return u?n.mode==="datetime"?(u.includes("T")?u:null)||u+(u.includes(" ")?"":"T00:00"):u?.split(" ")[0]:null}const{inputClass:a}=Xe(n.style),r=t,s=e.computed({get:()=>o(n.modelValue),set:u=>r("update:modelValue",u)}),i=e.computed(()=>n.mode==="datetime"?"datetime-local":n.mode),c=e.computed(()=>!!n.disabled),d=e.computed(()=>n.placeholder??"");return(u,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":p[0]||(p[0]=g=>s.value=g),placeholder:d.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.modelValue?"":"text-opacity-50",e.unref(a)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Lu)),[[e.vModelDynamic,s.value]])}}),Iu=(l,t)=>{if(!t||!Object.keys(t).length)return l;const[n,o=""]=l.split("?"),a=new URLSearchParams(o);Object.entries(t).forEach(([s,i])=>{i==null||i===""||a.set(s,String(i))});const r=a.toString();return r?`${n}?${r}`:n},ra=async(l,t={})=>{try{const n=new FormData;n.append("unique","true"),n.append("file",l);const{api:o,id:a="1",form:r="form",table:s="table",customParams:i}=t,c=o||`/file/upload/uploads?id=${a||""}&form=${r||""}&table=${s||""}`,d=Iu(c,i);return(await fetch(d,{method:"POST",body:n}).then(u=>u.json()))?.result}catch(n){return fe.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",n),null}},Fu=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},sa=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),n=await t.arrayBuffer(),o=t.headers["content-type"],a=new TextDecoder("utf-8").decode(n),r=new Blob([a],{type:o}),s=document.createElement("a");s.setAttribute("download",l),s.href=window.URL.createObjectURL(r),s.click()}catch(t){console.error(t.message)}},Ou={},Pu={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Ru(l,t){return e.openBlock(),e.createElementBlock("svg",Pu,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)])])}const vt=pe(Ou,[["render",Ru]]),zu={},ju={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Uu(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",ju,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)])])}const Hu=pe(zu,[["render",Uu]]),qu={},Gu={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Wu(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",Gu,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)])])}const Ku=pe(qu,[["render",Wu]]),Yu={},Zu={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Ju(l,t){return e.openBlock(),e.createElementBlock("svg",Zu,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)])])}const ia=pe(Yu,[["render",Ju]]),Xu={},Qu={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Vu(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",Qu,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)])])}const ep=pe(Xu,[["render",Vu]]),tp={},np={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function lp(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",np,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)])])}const op=pe(tp,[["render",lp]]),ap=l=>{if(!l)return"";const t=l?.split(".");return t[t.length-1]},rp=l=>{const t=ap(l),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(t)?"img":n.sheetsFormat.includes(t)?Ku:n.textsFormat.includes(t)?op:n.documentsFormat.includes(t)?Hu:n.archivesFormat.includes(t)?ep:ia},sp={},ip={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function cp(l,t){return e.openBlock(),e.createElementBlock("svg",ip,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)])])}const Wt=pe(sp,[["render",cp]]),dp={},up={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function pp(l,t){return e.openBlock(),e.createElementBlock("svg",up,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const ca=pe(dp,[["render",pp]]),mp=["title"],fp={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},hp=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),n=e.useModel(l,"item"),o=l;return(a,r)=>(e.openBlock(),e.createElementBlock("div",{title:n.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(rp)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:r[0]||(r[0]=s=>e.unref(sa)(n.value))},null,8,["src"])),e.createElementVNode("div",fp,[e.createElementVNode("button",{type:"button",onClick:r[1]||(r[1]=s=>{e.unref(Fu)(n.value),t.value=o.multiple?t.value?.filter(i=>i!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(Wt,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:r[2]||(r[2]=s=>e.unref(sa)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(ca,{class:"w-4 h-4"})])])],8,mp))}}),Fl=pe(hp,[["__scopeId","data-v-b61a9d9a"]]),vp={class:"flex items-center gap-x-2"},gp=["accept","multiple","disabled"],yp={key:1,class:"flex items-center flex-wrap gap-2"},kp={key:1,class:"loader"},bp={key:1,class:"loader"},xp=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=e.useModel(l,"modelValue"),a=t,r=e.ref(null),s=e.ref(!1),i=e.inject("values"),c=e.computed(()=>n.format?n.format.split(",").map(C=>C.trim().toLowerCase()).filter(Boolean):[]),d=C=>Array.isArray(o.value)&&o.value[C]||"",u=C=>{if(n.max_size&&C.size>n.max_size*1024*1024){const _=(C.size/1048576).toFixed(2);return fe.notify({type:"error",title:"Помилка!",message:`Файл "${C.name}" занадто великий. Максимальний розмір: ${n.max_size} МБ, розмір файлу: ${_} МБ`,position:"right-bottom"}),!1}return!0},p=C=>{if(!c.value.length)return!0;const _=`.${C.name.split(".").pop()?.toLowerCase()||""}`,b=c.value.includes(_);return b||fe.notify({type:"error",title:"Помилка!",message:`Неприпустимий формат файлу "${C.name}". Дозволені формати: ${c.value.join(", ")}`,position:"right-bottom"}),b},g=e.computed(()=>{const C={},_=[];if(!n.customParams?.length)return{params:C,missingSources:_};const b=i?.value??{};return n.customParams.forEach(x=>{if(!x)return;const[D,S]=x.split("="),M=D?.trim(),O=S?.trim();if(!M||!O)return;const K=b[O];if(K==null||K===""){_.push(O);return}C[M]=K}),{params:C,missingSources:_}}),y=()=>{const{params:C}=g.value;return{api:n.api,customParams:Object.keys(C).length?C:void 0}},w=()=>{const C=g.value.missingSources;if(!C.length)return!0;const _=C.join(", ");return fe.notify({type:"warning",title:"Заповніть поля",message:`Поля (${_}) необхідні для завантаження файлу`,position:"right-bottom"}),!1},m=C=>{fe.notify({type:"error",title:"Помилка завантаження",message:C||"Не вдалося завантажити файл. Спробуйте ще раз.",position:"right-bottom"})},f=()=>{n.disabled||s.value||w()&&r.value?.click()},E=async C=>{const{files:_}=C.target;if(!_||_.length===0)return;if(!w()){r.value&&(r.value.value="");return}const b=Array.from(_);if(n.max_size&&b.filter(x=>!u(x)).length>0){r.value&&(r.value.value="");return}if(b.filter(x=>!p(x)).length>0){r.value&&(r.value.value="");return}s.value=!0;try{if(n.multiple){const x=Array.from(_).map(async M=>await ra(M,y())),D=await Promise.all(x),S=D.filter(M=>M!==null).map(M=>M?.file_path).filter(Boolean);if(S.length===0){m();return}S.length<D.length&&m("Деякі файли не вдалося завантажити. Перевірте їх та спробуйте знову."),o.value=[...o.value||[],...S],a("change",o.value)}else{const x=_[0],D=await ra(x,y());if(!D?.file_path){m();return}o.value=D?.file_path,a("change",o.value||"")}}catch(x){const D=x?.message||void 0;m(D)}finally{s.value=!1,r.value&&(r.value.value="")}};return(C,_)=>(e.openBlock(),e.createElementBlock("div",vp,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:r,type:"file",accept:n.format,multiple:C.multiple,onChange:E,disabled:s.value||C.disabled},null,40,gp),!C.multiple&&o.value?(e.openBlock(),e.createBlock(Fl,{key:0,item:o.value,"onUpdate:item":_[0]||(_[0]=b=>o.value=b),value:o.value,"onUpdate:value":_[1]||(_[1]=b=>o.value=b)},null,8,["item","value"])):C.multiple?(e.openBlock(),e.createElementBlock("div",yp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(b,x)=>(e.openBlock(),e.createBlock(Fl,{multiple:C.multiple,key:x,value:o.value,"onUpdate:value":_[2]||(_[2]=D=>o.value=D),item:d(x)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:f,class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",C.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",kp)):(e.openBlock(),e.createBlock(vt,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),C.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:f,class:e.normalizeClass([C.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",bp)):(e.openBlock(),e.createBlock(vt,{key:0,class:"w-6 h-6"}))],2))]))}}),wp=pe(xp,[["__scopeId","data-v-05d41c5c"]]),Ep={class:"vs-input-file2 flex flex-col gap-4"},Cp={class:"flex items-center gap-x-2"},_p=["accept","disabled"],Np={key:0,class:"absolute inset-0 flex flex-col items-center justify-center gap-1 rounded-lg bg-white/90 text-xs font-medium text-slate-600"},Bp={key:0,class:"rounded-lg border border-[#CFD9E0] bg-white p-4 shadow-sm"},Sp={class:"flex items-center justify-between text-sm"},Mp={class:"truncate pr-4"},Ap={class:"font-medium text-slate-800 truncate"},Dp={class:"text-slate-500"},Tp={class:"text-slate-500 whitespace-nowrap"},Lp={class:"mt-3 h-2 rounded-full bg-slate-100 overflow-hidden"},$p={class:"mt-3 flex flex-wrap gap-2 text-sm"},Ip={key:0,class:"mt-2 text-sm text-rose-600"},Fp=e.defineComponent({__name:"vs-input-file2",props:e.mergeModels({format:{},max_size:{},api:{},chunkSize:{default:5*1024*1024},subdir:{default:""},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(null),a=e.ref(null),r=e.ref(""),s=e.ref(0),i=e.ref(!1),c=e.ref(""),d=e.ref(null),u=e.inject("values"),p=e.computed(()=>t.format?t.format.split(",").map(R=>R.trim().toLowerCase()).filter(Boolean):[]),g=e.computed(()=>!a.value||!a.value.size?0:Math.min(100,Math.round(s.value/a.value.size*100))),y=e.computed(()=>a.value?`${f(s.value)} / ${f(a.value.size)}`:""),w=e.computed(()=>t.disabled?"opacity-50 cursor-not-allowed":i.value?"cursor-default text-blue-500":"cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"),m=()=>{t.disabled||i.value||b()&&o.value?.click()},f=R=>{if(!Number.isFinite(R))return"0 B";const q=["B","KB","MB","GB"];let N=0,j=R;for(;j>=1024&&N<q.length-1;)j/=1024,N+=1;return`${j.toFixed(N===0?0:1)} ${q[N]}`},E=R=>{if(!t.max_size)return!0;const q=t.max_size*1024*1024;return R.size>q?(fe.notify({type:"error",title:"Файл занадто великий",message:`Максимальний розмір ${t.max_size} МБ`,position:"right-bottom"}),!1):!0},C=R=>{if(!p.value.length)return!0;const q=`.${R.name.split(".").pop()?.toLowerCase()||""}`;return p.value.includes(q)?!0:(fe.notify({type:"error",title:"Непідтримуваний формат",message:`Дозволені формати: ${p.value.join(", ")}`,position:"right-bottom"}),!1)},_=e.computed(()=>{const R={},q=[];if(!t.customParams?.length)return{params:R,missing:q};const N=u?.value??{};return t.customParams.forEach(j=>{if(!j)return;const[$,Z]=j.split("="),V=$?.trim(),oe=Z?.trim();if(!V||!oe)return;const ee=N[oe];ee==null||ee===""?q.push(oe):R[V]=ee}),{params:R,missing:q}}),b=()=>_.value.missing.length?(fe.notify({type:"warning",title:"Заповніть поля",message:`Потрібні значення: ${_.value.missing.join(", ")}`,position:"right-bottom"}),!1):!0,x=R=>{const q=R.target,N=q.files?.[0];if(N){if(!b()){q.value="";return}if(!E(N)||!C(N)){q.value="";return}a.value=N,s.value=0,r.value="",c.value=""}},D=async()=>{if(!a.value){m();return}try{c.value="";const R={id:r.value||"",fileName:a.value.name,subdir:t.subdir,size:a.value.size,..._.value.params},q=await fetch("/api/file/upload2/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)});if(!q.ok)throw new Error("Не вдалося ініціалізувати завантаження");const N=await q.json();r.value=N.id||r.value,s.value=N.uploaded||0,await S()}catch(R){c.value=R?.message||"Помилка при старті завантаження"}},S=async()=>{if(!(!a.value||!r.value)){i.value=!0;try{for(;s.value<a.value.size;){const R=s.value,q=Math.min(R+t.chunkSize,a.value.size),N=a.value.slice(R,q);d.value=new AbortController;const j=await fetch(`/api/file/upload2/${r.value}`,{method:"PATCH",headers:{"Content-Range":`bytes ${R}-${q-1}/${a.value.size}`},body:N,signal:d.value.signal});if(!j.ok)throw new Error("Помилка завантаження частини");const $=await j.json().catch(()=>({}));if($.uploaded!=null?s.value=Number($.uploaded):s.value=q,$.finished||s.value>=a.value.size){i.value=!1,n.value=$.file_path||$.url||r.value,fe.notify({type:"success",title:"Файл завантажено",message:a.value.name,position:"right-bottom"}),U();return}}}catch(R){if(R?.name==="AbortError")return;c.value=R?.message||"Помилка при завантаженні",i.value=!1}finally{d.value=null,i.value=!1}}},M=()=>{i.value&&(d.value?.abort(),d.value=null,i.value=!1)},O=async()=>{if(a.value){if(!r.value){await D();return}await S()}},K=()=>{d.value?.abort(),d.value=null,U()},U=()=>{const R=o.value;R&&(R.value=""),a.value=null,r.value="",s.value=0,c.value=""};return(R,q)=>(e.openBlock(),e.createElementBlock("div",Ep,[e.createElementVNode("div",Cp,[e.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",class:"hidden",accept:t.format,disabled:i.value||t.disabled,onChange:x},null,40,_p),n.value?(e.openBlock(),e.createBlock(Fl,{key:0,item:n.value,"onUpdate:item":q[0]||(q[0]=N=>n.value=N),value:n.value,"onUpdate:value":q[1]||(q[1]=N=>n.value=N)},null,8,["item","value"])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:m,class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",w.value])},[i.value?(e.openBlock(),e.createElementBlock("div",Np,[q[2]||(q[2]=e.createElementVNode("div",{class:"loader"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(g.value)+"%",1)])):(e.openBlock(),e.createBlock(vt,{key:1,class:"w-6 h-6"}))],2))]),a.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Bp,[e.createElementVNode("div",Sp,[e.createElementVNode("div",Mp,[e.createElementVNode("div",Ap,e.toDisplayString(a.value.name),1),e.createElementVNode("div",Dp,e.toDisplayString(f(a.value.size)),1)]),e.createElementVNode("div",Tp,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Lp,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500 transition-all duration-300",style:e.normalizeStyle({width:`${g.value}%`})},null,4)]),e.createElementVNode("div",$p,[!i.value&&s.value>0&&s.value<(a.value?.size||0)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:O}," Resume ")):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:M}," Pause ")):e.createCommentVNode("",!0),!i.value&&s.value===0?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:D}," Upload ")):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"rounded border border-rose-200 px-3 py-1 text-rose-600",onClick:K}," Cancel ")]),c.value?(e.openBlock(),e.createElementBlock("p",Ip,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}}),Ol=pe(Fp,[["__scopeId","data-v-8f52f552"]]),Op={class:"max-w-[55vw]"},Pp={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Rp={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},zp={class:"px-[5px]"},jp={class:""},Rn=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,n=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function o(a){if(a<1024)return`${a} B`;const r=a/1024;return r<1024?`${r.toFixed(2)} KB`:`${(r/1024).toFixed(2)} MB`}return(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r[1]||(r[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",Op,[e.createElementVNode("p",Pp,e.toDisplayString(a.item?.uploaded_name),1),e.createElementVNode("p",Rp,[e.createElementVNode("span",null,e.toDisplayString(a.item?.username),1),e.withDirectives(e.createElementVNode("span",zp,"|",512),[[e.vShow,a.item?.username]]),e.createElementVNode("span",null,e.toDisplayString(n.value),1),r[0]||(r[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",jp,e.toDisplayString(o(a.item?.size)),1)])])],64))}}),Up={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Hp={key:0,class:"flex w-full gap-x-3 items-center"},qp={key:1,class:"flex gap-x-3 w-full items-center"},Gp={key:2,class:"flex gap-x-3 w-full items-center"},Wp=["href"],Kp={key:3,class:"flex gap-x-3 w-full items-center"},Yp={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},Zp={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},Jp={class:"inline-block"},Xp={class:"inline-block"},Qp=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const n=l,o=t;function a(u){return["pdf","json"].includes(u.ext)}function r(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function s(u){const p=document.createElement("a");p.setAttribute("download",u?.uploaded_name),p.href=u?.file_path,p.click()}async function i(){try{await fetch(`${n.prefix}/widget/file/${n.item.entity_id}/${n.item.file_id}`),o("update")}catch(u){console.error(u)}}function c(){o("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function d(u){(n.item.ext==="jpg"||n.item.ext==="png")&&o("openLightbox",{item:n.item,index:u})}return(u,p)=>(e.openBlock(),e.createElementBlock("div",Up,[u.item.ext==="jpg"||u.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Hp,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=g=>d(u.index))},[e.createVNode(Rn,{item:u.item},null,8,["item"])])])):a(u.item)?(e.openBlock(),e.createElementBlock("div",qp,[e.createVNode(Rn,{item:u.item},null,8,["item"])])):r(u.item)?(e.openBlock(),e.createElementBlock("div",Gp,[e.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(Rn,{item:u.item},null,8,["item"])],8,Wp)])):(e.openBlock(),e.createElementBlock("div",Kp,[e.createVNode(Rn,{item:u.item},null,8,["item"])])),e.createElementVNode("div",Yp,[e.createElementVNode("div",Zp,[e.createElementVNode("div",Jp,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=g=>s(u.item))},[e.createVNode(ca,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",Xp,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=g=>c())},[e.createVNode(Wt,{height:"14",width:"14"})])])])])]))}}),Vp={},em={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function tm(l,t){return e.openBlock(),e.createElementBlock("svg",em,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const nm=pe(Vp,[["render",tm]]),lm={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},om={class:"flex w-full mb-[12px] items-center gap-x-2"},am={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},rm={class1:"ml-auto"},sm={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},im={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},cm={class:"relative"},dm={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},um={key:0},pm=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update"],setup(l,{emit:t}){const n=l,o=e.inject("form"),a=e.computed(()=>o.value.formId),r=e.ref(!1),s=e.ref(0),i=t,c=e.ref(!1),d=e.ref({}),u=e.ref([]),p=e.ref(""),g=e.computed(()=>Array.isArray(u.value)?u.value.filter(_=>_.ext==="jpg"||_.ext==="png").map(_=>_?.file_path):[]),y=e.computed(()=>p.value===""?u.value:u.value.filter(_=>_?.uploaded_name?.includes(p.value))),w=_=>{const b=g.value.findIndex(x=>x===_.item.file_path);b!==-1&&(r.value=!0,s.value=b)},m=async()=>{try{const _=await fetch(`${n.prefix}/widget/file/${a.value}`).then(b=>b.json());u.value=_?.rows}catch(_){console.error(_)}},f=async _=>{await Promise.all(Array.from(_.target.files).map(async b=>{const x=new FormData;x.append("file",b);try{const D=`${n.prefix}/widget/file/${a.value}`,S=await fetch(D,{method:"POST",body:x});return S.ok?(i("update","file-list"),b):(fe.notify({type:S.status>=400&&S.status<500?"warning":"error",title:"Error",message:`Error code: ${S.status}`}),null)}catch(D){return fe.notify({type:"error",title:"Error",message:D.message||"Unknown error"}),console.error(D),null}})),await m()},E=_=>{const b={..._};return _.cancel||(b.cancel=()=>{c.value=!1}),_.updateListOnConfirm&&(b.confirm=async()=>{await _.confirm(),c.value=!1,m()}),b},C=_=>{d.value=E(_),c.value=!0};return e.watch(a,_=>{_&&m()}),e.onMounted(()=>{a.value&&m()}),(_,b)=>{const x=e.resolveComponent("Lightbox"),D=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",lm,[e.createElementVNode("div",om,[e.createElementVNode("h2",am," Файлів: "+e.toDisplayString(u.value?.length),1),e.createElementVNode("div",rm,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:b[0]||(b[0]=S=>f(S))},null,32),e.createElementVNode("div",sm,[e.createVNode(nm,{height:"16",width:"16"})])])])]),u.value?.length>4?(e.openBlock(),e.createElementBlock("div",im,[e.createElementVNode("div",null,[e.createElementVNode("div",cm,[b[8]||(b[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=S=>p.value=S),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),u.value?.length?(e.openBlock(),e.createElementBlock("div",dm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(S,M)=>(e.openBlock(),e.createBlock(Qp,{key:M,prefix:_.prefix,item:S,index:M,onUpdate:b[2]||(b[2]=O=>_.$emit("update","file-list")),onOpenModal:b[3]||(b[3]=O=>C(O)),onOpenLightbox:b[4]||(b[4]=O=>w(O))},null,8,["prefix","item","index"]))),128)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[...b[9]||(b[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])]))])):e.createCommentVNode("",!0),e.createVNode(x,{modelValue:r.value,"onUpdate:modelValue":b[5]||(b[5]=S=>r.value=S),startIndex:s.value,"onUpdate:index":b[6]||(b[6]=S=>s.value=S),images:g.value},null,8,["modelValue","startIndex","images"]),e.createVNode(D,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":b[7]||(b[7]=S=>c.value=S),onConfirm:d.value.confirm},d.value),null,16,["modelValue","onConfirm"])])}}}),mm={class:"flex items-center justify-between"},fm={class:"text-[16px] text-gray-900 font-medium"},hm={class:"grid gap-3"},vm=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,o=>{n.value=o}),(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",mm,[e.createElementVNode("p",fm,e.toDisplayString(l.title),1),e.createVNode(ta,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=r=>n.value=r),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",hm,[e.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),gm=pe(vm,[["__scopeId","data-v-00f2f0fc"]]),ym={class:"text-[16px] text-gray-900 font-medium"},km={class:"grid gap-3"},bm=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,o=>{n.value=o}),(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:a[0]||(a[0]=r=>n.value=!n.value),class:"flex items-center gap-2"},[e.createVNode(e.unref($l),{class:e.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",ym,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",km,[e.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),xm=pe(bm,[["__scopeId","data-v-78778cb5"]]),wm={class:"flex items-center justify-between"},Em=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",wm,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),Cm={switcher:gm,accordion:xm,default:Em},it={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},_m=(l,t)=>String(l)===String(t),Nm=(l,t)=>String(l)!==String(t),Bm=(l,t)=>l>t,Sm=(l,t)=>l>=t,Mm=(l,t)=>l<t,Am=(l,t)=>l<=t,Dm=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,Tm=(l,t)=>String(l).startsWith(String(t)),Lm=(l,t)=>String(l).endsWith(String(t)),$m=(l,t)=>String(l).includes(String(t)),Im=(l,t)=>Array.isArray(t)?t.includes(l):!1,Fm=(l,t)=>Array.isArray(t)?!t.includes(l):!0,da=(l,t)=>{if(!t)return!0;switch(t?.[1]){case it.Equal:return _m(l,t?.[2]);case it.Inequal:return Nm(l,t?.[2]);case it.Higer:return Bm(l,t?.[2]);case it.HigerOrEqual:return Sm(l,t?.[2]);case it.Lower:return Mm(l,t?.[2]);case it.LowerOrEqual:return Am(l,t?.[2]);case it.Between:return Dm(l,t?.[2]);case it.StartWith:return Tm(l,t?.[2]);case it.EndWith:return Lm(l,t?.[2]);case it.Contain:return $m(l,t?.[2]);case it.In:return Im(l,t?.[2]);case it.NotIn:return Fm(l,t?.[2]);default:return!0}},Om=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,n=e.inject("values",e.ref({})),o=e.inject("form"),a=e.computed(()=>t.schema?.filter(i=>{const c=i?.conditions;if(!c)return!0;const d=Array.isArray(c)?c[0]:c,u=t.name?n.value?.[t.name]?.[d]??n.value?.[d]:n.value?.[d];return da(u,c)})),r=e.computed(()=>Cm[t.view]),s=e.computed(()=>{if(n.value||(n.value={}),!t.name)return n.value;const i=n.value[t.name];if(i)return i;const c={};return n.value={...n.value,[t.name]:c},c});return(i,c)=>l.schema?.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,d=>(e.openBlock(),e.createBlock(ma,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:s.value[d.name],"onUpdate:modelValue":u=>s.value[d.name]=u,style:l.style,error:e.unref(o)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}),Pm=["aria-expanded","data-focus"],Rm={class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full"},zm={key:0,class:"flex flex-nowrap items-center gap-1 overflow-x-auto overflow-y-hidden min-w-0 flex-1 py-0.5"},jm={class:"flex items-center min-w-0"},Um=["title"],Hm=["innerHTML"],qm=["onClick"],Gm={class:"flex-1 min-w-[2px]"},Wm=["placeholder"],Km=["title"],Ym=["innerHTML"],Zm={key:2,class:"flex-1 min-w-[2px]"},Jm=["placeholder"],Xm={class:"flex items-center shrink-0"},Qm=["disabled"],Vm=["disabled","title"],ef=["aria-disabled","onClick"],tf=["innerHTML"],nf={key:1,class:"px-3 py-2 text-center text-gray-500"},lf=["disabled"],of=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},start:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{},maxlength:{},minlength:{}},emits:["change","update:modelValue","value-selected"],setup(l,{emit:t}){const n=l,o=t,a=e.computed(()=>n.multiple),r=e.computed(()=>n.disabled);Xe(n.style);const s=e.computed({get:()=>n.modelValue,set:h=>o("update:modelValue",h)});!s.value&&n.defaultValue&&(s.value=n.defaultValue);const i=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref(!1),g=e.ref(!1),y=e.ref(null),w=e.ref([]),m=e.ref(-1),f=e.ref([]),E=e.ref(""),C=e.ref(null),_=e.ref("bottom"),b=e.ref({}),x=e.ref([]),D=e.computed(()=>{if(!x.value.length)return[];const h=w.value,v=new Map(h.map(B=>[B.id?.toString(),B]));return x.value.map(B=>v.get(B?.toString())).filter(B=>!!B)}),S=e.computed(()=>n.placeholder||"Select..."),M=e.computed(()=>V(y.value));e.computed(()=>a.value?!x.value.length&&E.value==="":!M.value&&E.value==="");const O=e.computed(()=>r.value?!1:a.value?x.value.length>0:!!s.value),K=h=>a.value?x.value.some(v=>v?.toString()===h?.toString()):s.value?.toString()===h?.toString(),U=e.computed(()=>{let h=w.value??[];if(!n.data&&E.value.trim()!==""){const v=E.value.toLowerCase();h=h.filter(B=>{const k=V(B).toLowerCase(),A=B.text?.toLowerCase?.()||"";return k.includes(v)||A.includes(v)})}if(a.value&&x.value.length){const v=new Set(x.value.map(B=>B?.toString()));h=h.filter(B=>!v.has(B.id?.toString()))}return h}),R=e.inject("values"),q=e.inject("field-props"),N=/\{\{\s*([^}]+?)\s*\}\}/g,j=h=>(h?String(h):"").replace(/<[^>]*>/g,"").trim(),$=e.computed(()=>n.slot??n?.optionTemplate??""),Z=h=>{if(!h)return"";const v=$.value;return v?v.replace(N,(B,k)=>{const A=k.trim(),I=h[A];return I!=null?String(I):""}):h.text??""},V=h=>{if(!h)return"";if(!$.value)return h.text??"";const v=Z(h);return j(v)||h.text||""},oe=(h,v,B)=>{if(!q)return!1;const k=q.value?.[h]??{},A=(ne,ce,Be)=>{if(!ce.length)return ne;const[Ne,...Ue]=ce,Ve={...ne};if(!Ue.length)return Ve[Ne]=Be,Ve;const an=typeof ne[Ne]=="object"&&ne[Ne]!==null?ne[Ne]:{};return Ve[Ne]=A(an,Ue,Be),Ve},I=A(k,v,B);return q.value={...q.value||{},[h]:I},!0},ee=h=>{if(!n.set)return;const v=R?.value;!v&&!q||Object.entries(n.set).forEach(([B,k])=>{if(!B)return;const A=h?h[k]:null,I=B.split(".").map(Be=>Be.trim()).filter(Boolean);if(!I.length)return;const[ne,...ce]=I;ce.length&&oe(ne,ce,A??null)||v&&(v[ne]=A??null)})},H=e.computed(()=>n.parent?R?.value?.[n.parent]?.toString()??null:null),ie=async h=>{if(!n.data){let v=n.options??[];if(h?.trim()){const B=h.toLowerCase();v=v.filter(k=>{const A=V(k).toLowerCase(),I=k.text?.toLowerCase?.()||"";return A.includes(B)||I.includes(B)})}return v}try{const v=n.host??"",B=n.prefix??"api",k=n.api??`/${B}/suggest/${n.data}`,A=`${v}${k}`,I=new URLSearchParams;return I.set("json","1"),h&&I.set("key",h),H.value!==void 0&&H.value!==null&&H.value!==""&&I.set("parent",H.value),n.start===1&&I.set("start","1"),(await fetch(`${A}?${I.toString()}`).then(ne=>ne.json()))?.data??[]}catch{return[]}},Y=async()=>{n.data?w.value=await ie(E.value):w.value=n.options?[...n.options]:[]},se=async h=>{if(h==null)return null;const v=w.value?.find(B=>B?.id?.toString()===String(h));if(v)return v;if(n.data)try{const B=n.host??"",k=n.prefix??"api",A=n.api??`/${k}/suggest/${n.data}`,I=`${B}${A}`,ne=new URLSearchParams;return ne.set("json","1"),ne.set("val",String(h)),H.value!==void 0&&H.value!==null&&H.value!==""&&ne.set("parent",H.value),n.start===1&&ne.set("start","1"),((await fetch(`${I}?${ne.toString()}`).then(ce=>ce.json()))?.data??[])?.[0]??null}catch{return null}return null},ue=async h=>{const v=new Set(w.value.map(k=>k.id?.toString())),B=h.filter(k=>!v.has(k?.toString()));B.length&&await B.reduce(async(k,A)=>{await k;const I=await se(A);I&&w.value.push(I)},Promise.resolve())},he=()=>{if(!U.value.length){m.value=-1;return}let h=0;if(!a.value&&y.value){const v=y.value.id?.toString(),B=U.value.findIndex(k=>k.id?.toString()===v);B>=0&&(h=B)}m.value=h,e.nextTick(()=>{F(f.value[h],d.value)})},be=async()=>{r.value||(p.value=!0,await Y(),await e.nextTick(()=>{ae(),C.value?.focus()}),he())},L=()=>{p.value=!1,m.value=-1,e.nextTick(()=>{C.value?.blur()})},le=async h=>{r.value||(p.value?L():await be())},T=async()=>{if(!r.value){if(p.value){L();return}await be()}},P=()=>{a.value?(x.value=[],s.value=[],o("change",[]),J(null,[])):(y.value=null,s.value=null,o("change",null),J(null,null)),ee(null),E.value="",e.nextTick(()=>C.value?.focus())},X=h=>{a.value&&(x.value=x.value.filter(v=>v?.toString()!==h?.toString()),s.value=[...x.value],o("change",s.value),J(null),e.nextTick(()=>C.value?.focus()))},J=(h,v)=>{const B=v??(a.value?[...x.value]:h?.id??null);o("value-selected",{name:n.name,value:B,option:h})},re=h=>{a.value?(K(h.id)||(x.value=[...x.value,h.id],s.value=[...x.value],o("change",s.value),J(h)),E.value="",e.nextTick(()=>{C.value?.focus(),m.value=Math.min(m.value,U.value.length-1)}),ee(null)):(y.value=h,s.value=h.id,o("change",s.value),J(h),E.value="",L(),ee(h))},xe=h=>{if(K(h.id)){a.value||L();return}re(h)},F=(h,v)=>{if(!h||!v)return;const B=h.offsetTop,k=B+h.offsetHeight,A=v.scrollTop,I=A+v.clientHeight;let ne=v.scrollTop;B<A?ne=B-80:k>I&&(ne=k-v.clientHeight+4);const ce=v;ce.scrollTop=ne},te=h=>{let v=h.parentElement;for(;v;){if(v.classList.contains("ui-dialog__content"))return v;const B=window.getComputedStyle(v),k=B.overflow+B.overflowY+B.overflowX;if(k.includes("auto")||k.includes("scroll")||v===document.body||v===document.documentElement)return v;v=v.parentElement}return document.body},ae=()=>{if(!c.value)return;const h=c.value.getBoundingClientRect(),v=window.innerHeight||document.documentElement.clientHeight,B=window.innerWidth||document.documentElement.clientWidth,k=8,A=8,I=n.maxHeight||300,ne=v-h.bottom-A-k,ce=h.top-A-k,Be=ne>=ce,Ne=Math.max(B-k*2,0);let{width:Ue}=h;Ne>0&&Ue>Ne&&(Ue=Ne);let{left:Ve}=h;Ve+Ue+k>B&&(Ve=B-Ue-k),Ve=Math.max(Ve,k);const an=Math.min(I,Math.max(Be?ne:ce,50));_.value=Be?"bottom":"top",b.value={position:"fixed",left:`${Ve}px`,width:`${Ue}px`,maxHeight:`${an}px`,transform:Be?"none":"translateY(-100%)",top:Be?`${h.bottom+A}px`:`${h.top-A}px`}},_e=async h=>{r.value||!p.value&&(h.key==="ArrowDown"||h.key==="ArrowUp")&&(h.preventDefault(),await be())},Ae=h=>{if(!p.value)return;const{key:v}=h;if(v==="ArrowDown")h.preventDefault(),m.value+1<U.value.length&&(m.value+=1,F(f.value[m.value],d.value));else if(v==="ArrowUp")h.preventDefault(),m.value>0&&(m.value-=1,F(f.value[m.value],d.value));else if(v==="Enter"){h.preventDefault();const B=U.value[m.value];B&&re(B),C.value?.blur()}else v==="Escape"?(h.preventDefault(),L()):v==="Backspace"?a.value&&E.value===""&&x.value.length&&(x.value=x.value.slice(0,-1),s.value=[...x.value],o("change",s.value)):v==="Home"?(m.value=0,F(f.value[0],d.value)):v==="End"?(m.value=U.value.length-1,F(f.value[m.value],d.value)):v==="Tab"&&L()},Re=()=>{r.value||(g.value=!0)},Ye=()=>{g.value=!1,E.value=""},dt=h=>{h.key==="Escape"&&p.value&&L()},Qe=h=>{const v=h.target;i.value?.contains(v)||u.value?.contains(v)||L()},ht=h=>{p.value&&d.value&&!d.value.contains(h.target)&&ae()},ze=()=>{p.value&&ae()},Le=()=>{p.value&&ae()};e.watch(()=>n.options,h=>{h?.length&&(w.value=[...h],je())},{immediate:!0});async function je(){if(a.value)Array.isArray(s.value)?x.value=[...s.value]:(x.value=s.value==null?[]:[s.value],s.value=[...x.value]),n.data&&x.value.length&&(await ue(x.value),await e.nextTick());else{if(Array.isArray(s.value)){const h=s.value[0]??null;s.value=h??null}s.value!=null&&(y.value=await se(s.value)),ee(y.value??null)}}e.watch(s,()=>{je()}),e.onMounted(async()=>{addEventListener("keydown",dt),addEventListener("scroll",ht,!0),addEventListener("resize",ze),document.addEventListener("click",Qe,!0),c.value&&te(c.value).addEventListener("scroll",Le,!0),n.options?.length&&!n.data?w.value=[...n.options]:n.data&&(w.value=await ie("")),await je(),Ee.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",dt),removeEventListener("scroll",ht,!0),removeEventListener("resize",ze),document.removeEventListener("click",Qe,!0),c.value&&te(c.value).removeEventListener("scroll",Le,!0)});const wt=e.ref(!1),ut=e.ref({}),z=e.ref([]),Q=e.ref(null);async function G(){if(!n.add?.token||Q?.value.validate())return;const h=n.add.api??`/api/table/${n.add.token}`,{id:v}=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ut.value)}).then(B=>B.json());if(!n.options?.length&&n.data){const B=await fetch(`${n.api??`/api/suggest/${n.data}`}?val=${v}`).then(k=>k.json());y.value=B[0],w.value.push(B[0]),s.value=v}wt.value=!1,fe.notify({title:"Success!",message:"Object created."})}async function W(){if(!n.add)return null;const h=await fetch(`/api/template/form/${n.add.form}`).then(v=>v.json());return z.value=h.schema,wt.value=!0,null}function ve(h,v=200){let B;return(...k)=>{B&&clearTimeout(B),B=window.setTimeout(()=>h(...k),v)}}const me=ve(async h=>{w.value=await ie(h)},200);e.watch(E,h=>{n.data&&me(h.trim())}),e.watch(()=>n.options,h=>{!n.data&&h?.length&&(w.value=[...h],je())},{immediate:!0}),e.watch(()=>n.parent??n.parentValue,()=>{n.data&&Y()});const Ee=e.ref(!0);return e.watch(H,async()=>{if(n.data&&(Ee.value||(a.value?(x.value=[],s.value=[],o("change",[])):(y.value=null,s.value=null,o("change",null))),await Y(),n.auto===1&&H.value&&w.value.length>0)){const h=w.value[0];h&&re(h)}}),(h,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(fe.VsModal),{visible:wt.value,"onUpdate:visible":v[1]||(v[1]=B=>wt.value=B),class:"z-[1000]",title:"Додати",buttonText:"Додати",onDone:G,teleport:h.teleport},{default:e.withCtx(()=>[e.createVNode(It,{schema:z.value,modelValue:ut.value,"onUpdate:modelValue":v[0]||(v[0]=B=>ut.value=B),ref_key:"addForm",ref:Q},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:v[5]||(v[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass])},[v[10]||(v[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),v[11]||(v[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["vs-input-select__control flex min-h-[38px] items-center justify-between rounded transition-colors bg-white",r.value?"bg-gray-100 text-gray-400 cursor-not-allowed":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:_e,onClick:T,"data-focus":p.value||g.value?"true":"false",ref_key:"triggerRef",ref:c},[e.createElementVNode("div",Rm,[a.value?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,B=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full",key:B.id},[e.createElementVNode("div",jm,[B?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:B?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",title:V(B)},[$.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:Z(B)},null,8,Hm)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(B.text),1)],64))],8,Um)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border text-[#172b4d] hover:bg-[rgb(255,189,173)] hover:text-[rgb(222,53,11)] flex-shrink-0",onClick:e.withModifiers(k=>X(B.id),["stop"])},[...v[6]||(v[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,qm)]))),128)),e.createElementVNode("div",Gm,[!r.value&&h.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:C,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:x.value.length?" ":S.value,"onUpdate:modelValue":v[2]||(v[2]=B=>E.value=B),onFocus:Re,onBlur:Ye,onKeydown:Ae},null,40,Wm)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)])])):!a.value&&M.value&&E.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900 absolute"]),title:M.value},[y.value?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:y.value?.color})},null,4)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":y.value?.color}),innerHTML:Z(y.value)},null,10,Ym)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":y.value?.color})},e.toDisplayString(y.value?.text),3))],8,Km)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zm,[!r.value&&h.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:C,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:M.value?" ":S.value,"onUpdate:modelValue":v[3]||(v[3]=B=>E.value=B),onFocus:Re,onBlur:Ye,onKeydown:Ae},null,40,Jm)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)]))]),e.createElementVNode("div",Xm,[O.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:e.withModifiers(P,["stop"])},[...v[7]||(v[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Qm)):e.createCommentVNode("",!0),v[9]||(v[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:v[4]||(v[4]=e.withModifiers(B=>le(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},[...v[8]||(v[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)])],8,Vm)])],42,Pm),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(b.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:b.value.maxHeight||"300px"}),ref_key:"listRef",ref:d},[U.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U.value,(B,k)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,ref_for:!0,ref:A=>f.value[k]=A,class:e.normalizeClass(["flex px-3 py-2 cursor-pointer select-none text-gray-900",K(B.id)?"bg-[#2684ff] text-white":"bg-white hover:bg-[#deebff] hover:text-[#172b4d]",m.value===k&&!K(B.id)?"bg-[#deebff] text-[#172b4d]":""]),"aria-disabled":K(B.id)?"true":"false",role:"option",tabindex:"-1",onClick:A=>xe(B)},[B?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:B?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",m.value===B.id?"text-white":"",(m.value,"")])},[$.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:Z(B)},null,8,tf)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(B.text),1)],64))],2)],10,ef))),128)):(e.openBlock(),e.createElementBlock("div",nf," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),n.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:W,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:r.value,type:"button"},[e.createVNode(vt,{width:"16",height:"16"}),v[12]||(v[12]=e.createElementVNode("span",null,"Додати",-1))],8,lf)):e.createCommentVNode("",!0)],512)],64))}}),ua=pe(of,[["__scopeId","data-v-a23a52be"]]),af=["placeholder","disabled"],rf=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??"");function s(){typeof o.value=="string"&&(o.value=o.value.trim())}return(i,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),placeholder:r.value,disabled:a.value,row:"2",onBlur:s,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,42,af)),[[e.vModelText,o.value]])}}),sf={key:1,class:"richtext-error"},cf=e.defineComponent({__name:"vs-input-richtext",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},richtextProps:{default:()=>({})}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.ref(null);e.onMounted(async()=>{try{const c=await new Function("specifier","return import(specifier)")("@opengis/richtext");t.value=c.VsRichtext}catch{console.warn("@opengis/richtext is not installed. Please install it to use richtext input.")}});const n=l,{inputClass:o}=Xe(n.style),a=e.useModel(l,"modelValue"),r=e.computed(()=>!!n.disabled),s=e.computed(()=>n.placeholder??""),i=e.computed(()=>({height:"300px",...n.richtextProps}));return(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["richtext-wrapper !h-full !border-transparent",[c.customClass,e.unref(o),{"richtext-disabled":r.value}]]),style:e.normalizeStyle(r.value?{pointerEvents:"none",opacity:.6}:{})},[t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.mergeProps({key:0,modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=u=>a.value=u),placeholder:s.value},i.value),null,16,["modelValue","placeholder"])):(e.openBlock(),e.createElementBlock("div",sf,[...d[1]||(d[1]=[e.createElementVNode("p",null,"@opengis/richtext package is not installed.",-1),e.createElementVNode("p",null,"Please install it: npm install @opengis/richtext",-1)])]))],6))}}),df={},uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function pf(l,t){return e.openBlock(),e.createElementBlock("svg",uf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const mf=pe(df,[["render",pf]]),ff={},hf={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function vf(l,t){return e.openBlock(),e.createElementBlock("svg",hf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const gf=pe(ff,[["render",vf]]),yf={},kf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function bf(l,t){return e.openBlock(),e.createElementBlock("svg",kf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const xf=pe(yf,[["render",bf]]),wf={},Ef={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Cf(l,t){return e.openBlock(),e.createElementBlock("svg",Ef,[...t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)])])}const zn=pe(wf,[["render",Cf]]),_f={},Nf={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Bf(l,t){return e.openBlock(),e.createElementBlock("svg",Nf,[...t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)])])}const Sf=pe(_f,[["render",Bf]]),Mf={},Af={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Df(l,t){return e.openBlock(),e.createElementBlock("svg",Af,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)])])}const Tf=pe(Mf,[["render",Df]]),Lf={class:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden flex flex-col"},$f={class:"flex flex-col gap-2 !p-4 border-b border-gray-200 sm:flex-row sm:items-center sm:justify-between bg-gray-50"},If={class:"relative w-full"},Ff={class:"flex flex-nowrap items-center justify-end gap-2 w-full overflow-x-auto"},Of={class:"w-full overflow-x-auto"},Pf={class:"w-full min-w-[640px] table-auto divide-y divide-gray-200"},Rf={class:"bg-gray-50"},zf={class:"border-b border-gray-200"},jf={class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center"},Uf=["onClick"],Hf={key:0,class:"text-gray-400"},qf={key:0,colspan:"100%",class:"text-center"},Gf={class:"w-full"},Wf={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Kf=["onDragstart","onDragover","onDrop"],Yf={class:"px-4 py-3 text-center align-middle"},Zf={class:"flex items-center justify-center"},Jf=["innerHTML"],Xf={key:0,class:"flex items-center gap-3 text-sm text-gray-700"},Qf={key:0},Vf=["src"],eh={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},th={key:1,class:"flex items-center justify-center"},nh={key:2,class:"text-sm font-medium text-gray-900"},lh={class:"px-4 py-3 text-right whitespace-nowrap"},oh={class:"flex items-center justify-end gap-2"},ah=["onClick"],rh=["onClick"],sh={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},ih=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useSlots(),o=e.useModel(l,"modelValue"),a=e.ref({}),r=e.ref(""),s=e.ref(null),i=e.ref("asc"),c=e.computed(()=>{const T=o.value??[],P=r.value?T.filter(re=>t.colModel?.some(xe=>{const F=xe.key||xe.name;if(!F)return!1;const te=re[F];return te?Array.isArray(te)?te.join(", ").toLowerCase().includes(r.value.toLowerCase()):String(te).toLowerCase().includes(r.value.toLowerCase()):!1})):T;if(!s.value)return P;const X=s.value,J=[...P].sort((re,xe)=>{const F=ee(re?.[X]),te=ee(xe?.[X]);return typeof F=="number"&&typeof te=="number"?F-te:String(F).localeCompare(String(te))});return i.value==="asc"?J:J.reverse()}),d=e.ref(null),u=e.ref(null),p=e.ref(null),g=T=>{d.value=T},y=T=>{u.value=T},w=T=>{if(d.value===null||d.value===T){d.value=null,u.value=null;return}const P=[...o.value],[X]=P.splice(d.value,1);P.splice(T,0,X),o.value=P,d.value=null,u.value=null},m=()=>{p.value&&p.value.click()},f=T=>{const P=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],X=T.toLowerCase();return P.some(J=>X.endsWith(J))},E=T=>{const P=T.target.files?.[0];if(!P)return;const X=new FileReader;X.onload=J=>{try{const re=J.target?.result;if(typeof re=="string"){const xe=JSON.parse(re);Array.isArray(xe)&&o.value.push(...xe)}}catch(re){console.error("Error parsing file:",re)}},X.readAsText(P)},C=()=>{const T=JSON.stringify(o.value,null,2),P=new Blob([T],{type:"application/json"}),X=URL.createObjectURL(P),J=document.createElement("a");J.href=X,J.download="data.json",J.click(),URL.revokeObjectURL(X)},_=new Set(["autocomplete","select","radio","checkbox","combobox"]),b=new Map,x=(T,P)=>{const X=`/api/suggest/${T}`,J=X.includes("?")?"&":"?",re=P?`&val=${P}`:"";return`${X}${J}json=1${re}`},D=T=>T==null||T===""?null:typeof T=="object"?T?.id!==void 0&&T.id!==null&&T.id!==""?T.id:null:T,S=T=>{const P=new Set;return Array.isArray(o.value)&&o.value.forEach(X=>{const J=X?.[T];if(J==null||J==="")return;if(Array.isArray(J)){J.forEach(xe=>{const F=D(xe);F!==null&&P.add(F)});return}const re=D(J);re!==null&&P.add(re)}),P},M=async()=>{if(!t.colModel?.length)return;const T=t.colModel.filter(P=>P.data&&_.has(P.type?.toLowerCase()||""));T.length&&await Promise.all(T.map(async P=>{const X=P.key||P.name;if(!X)return;const J=S(X),re=Array.from(J).map(te=>String(te)).sort(),xe=re.join(",");if(!re.length||b.get(X)===xe)return;b.set(X,xe);const F=re.map(encodeURIComponent).join(",");try{const te=await(await fetch(x(P.data,F))).json();a.value[X]=te?.data??te}catch(te){console.error("Failed to fetch column values",te)}}))};e.watch([()=>t.colModel,()=>o.value],()=>{M()},{immediate:!0,deep:!0});const O=e.ref(""),K=e.ref(!1);let U="edit",R=0;const q=T=>(T?.format||T?.type||"").toString().toLowerCase(),N=e.computed(()=>t.colModel?.filter(T=>q(T)!=="slot").map(T=>{const{slot:P,...X}=T;return X})??[]),j=e.ref({}),$=e.ref({}),Z=T=>typeof T!="string"?!1:!!n[T],V=(T,P)=>P?P.split(".").reduce((X,J)=>X==null?X:X[J.trim()],T):T,oe=(T,P)=>typeof T!="string"?"":T.replace(/{{\s*([^}]+)\s*}}/g,(X,J)=>V(P,J.trim())??""),ee=T=>{if(T==null||T==="")return"";if(typeof T=="number")return T;if(typeof T=="boolean")return T?1:0;if(typeof T=="string")return T.toLowerCase();if(Array.isArray(T))return T.map(P=>ee(P)).join(", ");if(typeof T=="object"){if(T.text!==void 0)return String(T.text).toLowerCase();if(T.label!==void 0)return String(T.label).toLowerCase();if(T.id!==void 0)return String(T.id).toLowerCase()}return String(T).toLowerCase()},H=T=>{const P=T.key||T.name;if(P){if(s.value===P){i.value=i.value==="asc"?"desc":"asc";return}s.value=P,i.value="asc"}};async function ie(){O.value="Додати",K.value=!0,U="add",j.value={}}function Y(T,P){if(!T?.length)return null;const X=typeof P=="object"?P?.id:P;return X==null||X===""?null:T.find(J=>J?.id?.toString()===X.toString())?.text??null}function se(T){return T==null||T===""?"-":Array.isArray(T)?T.map(P=>typeof P=="object"?P?.text??P?.id??"-":P).join(", "):typeof T=="object"?T?.text??T?.id??"-":T}function ue(T,P){const X=P.key||P.name,J=T?.[X],re=a.value[X];if(!J)return"-";if(Array.isArray(J)){const F=J.map(te=>Y(re,te)).filter(Boolean);return F.length?F.join(", "):se(J)}return Y(re,J)||se(J)}async function he(T,P){O.value="Редагувати",K.value=!0,U="edit",R=P,j.value={...T}}function be(){const T=$.value.validate();if(T){fe.notify({type:"warning",title:"Помилка валідації",message:Object.entries(T).map(([P,X])=>`${P}: ${X}`).join(`
142
- `)});return}U==="add"?Array.isArray(o.value)?o.value=[...o.value,j.value]:o.value=[j.value]:o.value=o.value.map((P,X)=>X===R?j.value:P),K.value=!1}function L(T){o.value=o.value.filter((P,X)=>X!==T)}function le(){K.value=!1}return(T,P)=>(e.openBlock(),e.createElementBlock("div",Lf,[e.createElementVNode("div",$f,[e.createElementVNode("div",If,[e.createVNode(mf,{width:"16",height:"16",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":P[0]||(P[0]=X=>r.value=X),placeholder:"Пошук",class:"w-full rounded-md border border-gray-200 bg-white pl-10 pr-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Ff,[e.createElementVNode("input",{ref_key:"fileInput",ref:p,onChange:E,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("button",{type:"button",onClick:m,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[e.createVNode(gf,{class:"text-gray-700",width:"16",height:"16"}),P[4]||(P[4]=e.createTextVNode(" Імпорт ",-1))]),e.createElementVNode("button",{type:"button",onClick:C,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[e.createVNode(xf,{class:"text-gray-700",width:"16",height:"16"}),P[5]||(P[5]=e.createTextVNode(" Експорт ",-1))]),e.createElementVNode("button",{onClick:ie,type:"button",class:"inline-flex items-center gap-2 rounded-md bg-blue-500 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-600 transition-colors"},[e.createVNode(vt,{class:"text-white"}),P[6]||(P[6]=e.createTextVNode(" Додати ",-1))])])]),e.createElementVNode("div",Of,[e.createElementVNode("table",Pf,[e.createElementVNode("thead",Rf,[e.createElementVNode("tr",zf,[e.createElementVNode("th",jf,[e.createVNode(zn,{width:"20",height:"20",class:"mx-auto text-gray-400"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.colModel,X=>(e.openBlock(),e.createElementBlock("th",{key:X.key,class:"px-4 py-3 text-left text-xs font-semibold text-gray-900"},[e.createElementVNode("button",{type:"button",onClick:J=>H(X),class:"flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"},[e.createElementVNode("span",null,e.toDisplayString(X.ua||X.label),1),s.value===(X.key||X.name)?(e.openBlock(),e.createElementBlock("span",Hf,e.toDisplayString(i.value==="asc"?"▲":"▼"),1)):e.createCommentVNode("",!0)],8,Uf)]))),128)),P[7]||(P[7]=e.createElementVNode("th",{class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 text-center w-[1%] whitespace-nowrap"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass(["divide-y divide-gray-200",{"[&_tr:last-child]:border-0":!u.value}])},[c.value.length===0?(e.openBlock(),e.createElementBlock("td",qf,[e.createElementVNode("div",Gf,[e.createElementVNode("div",Wf,[e.createVNode(Sf,{class:"w-48 mx-auto"}),P[8]||(P[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(X,J)=>(e.openBlock(),e.createElementBlock("tr",{key:X.id,class:e.normalizeClass(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700",{"opacity-50":d.value===J,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":u.value===J}]),draggable:"true",onDragstart:re=>g(J),onDragover:e.withModifiers(re=>y(J),["prevent"]),onDrop:re=>w(J)},[e.createElementVNode("td",Yf,[e.createElementVNode("div",Zf,[e.createVNode(zn,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.colModel,re=>(e.openBlock(),e.createElementBlock("td",{key:re.key,class:"px-4 py-3 align-middle"},[q(re)==="slot"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Z(re.slot)?e.renderSlot(T.$slots,re.slot,{key:0,row:X,value:X[re.key],column:re}):(e.openBlock(),e.createElementBlock("div",{key:1,class:"text-sm text-gray-900",innerHTML:oe(re.slot,X)},null,8,Jf))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[q(re)==="file"?(e.openBlock(),e.createElementBlock("div",Xf,[f(ue(X,re))?(e.openBlock(),e.createElementBlock("div",Qf,[e.createElementVNode("img",{src:ue(X,re),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,Vf)])):(e.openBlock(),e.createElementBlock("div",eh,[e.createVNode(ia,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):q(re)==="color"?(e.openBlock(),e.createElementBlock("div",th,[e.createElementVNode("span",{class:"inline-flex h-6 w-6 rounded border border-gray-200",style:e.normalizeStyle({backgroundColor:ue(X,re)||"#ffffff"})},null,4)])):(e.openBlock(),e.createElementBlock("div",nh,e.toDisplayString(ue(X,re)),1))],64))]))),128)),e.createElementVNode("td",lh,[e.createElementVNode("div",oh,[e.createElementVNode("button",{onClick:re=>he(X,J),class:"p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors"},[e.createVNode(Tf,{width:"16",height:"16"})],8,ah),e.createElementVNode("button",{onClick:re=>L(J),class:"p-1.5 text-gray-600 hover:text-red-600 hover:bg-red-50 rounded transition-colors"},[e.createVNode(Wt,{width:"16",height:"16"})],8,rh)])])],42,Kf))),128))],2)])]),e.createVNode(e.unref(fe.VsModal),{visible:K.value,title:O.value,size:"lg",onClose:le,teleport:"#modal"},{default:e.withCtx(()=>[e.createVNode(It,{schema:N.value,values:j.value,"onUpdate:values":P[1]||(P[1]=X=>j.value=X),form:$.value,"onUpdate:form":P[2]||(P[2]=X=>$.value=X)},null,8,["schema","values","form"]),e.createElementVNode("div",sh,[e.createElementVNode("button",{type:"button",onClick:P[3]||(P[3]=X=>K.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:be,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),ch={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:"Клацніть на шари, щоб видалити їх"}}}}},dh={},uh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function ph(l,t){return e.openBlock(),e.createElementBlock("svg",uh,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)])])}const mh=pe(dh,[["render",ph]]),fh={},hh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function vh(l,t){return e.openBlock(),e.createElementBlock("svg",hh,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)])])}const gh=pe(fh,[["render",vh]]),yh={},kh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function bh(l,t){return e.openBlock(),e.createElementBlock("svg",kh,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)])])}const xh=pe(yh,[["render",bh]]),wh={},Eh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function Ch(l,t){return e.openBlock(),e.createElementBlock("svg",Eh,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)])])}const _h=pe(wh,[["render",Ch]]),Nh={},Bh={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function Sh(l,t){return e.openBlock(),e.createElementBlock("svg",Bh,[...t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)])])}const Mh=pe(Nh,[["render",Sh]]),Ah={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Dh={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},Th=["onClick"],Lh={class:"relative flex-1 min-w-[140px]"},$h=["placeholder"],Ih="https://data.softpro.ua/api-user/gis-url-proxy",Fh="https://geo.rv.ua/api-user/dzk.api",Oh=e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(l,{emit:t}){const n=l,o=t,a=["here","xy","parcel"],r=e.computed(()=>{const b=n.config?.tools?.filter(x=>a.includes(x));return b&&b.length?b:a}),s=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),i=e.ref(r.value[0]??a[0]);e.watch(r,b=>{b.includes(i.value)||(i.value=b[0])});const c=e.ref(""),d=e.ref(!1),u=e.ref(null);e.watch(i,()=>{c.value="",d.value=!1});function p(b){i.value=b}function g(b){if(!d.value)return;const x=u.value;x&&!x.contains(b.target)&&(d.value=!1)}e.onMounted(()=>{window.addEventListener("click",g,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",g,!0)});function y(b){return b==="xy"?"Координати":b==="parcel"?"Кадастр":"Адреси"}function w(b){const x=b.replace(/[,]+/g," ").trim();if(!x)return null;const D=x.split(/\s+/).filter(Boolean);if(D.length<2)return null;const S=D.slice(0,2).map(Number);if(!S.every(N=>Number.isFinite(N)))return null;const[M,O]=S;let K=M,U=O;const R=N=>Math.abs(N)<=90,q=N=>Math.abs(N)<=180;if(!R(K)||!q(U))if(R(U)&&q(K))K=O,U=M;else return null;return{lat:K,lng:U}}function m(b){return(b?.items||[]).map((x,D)=>({id:String(x?.id??D),title:x?.title||x?.address?.label||"Знайдений обʼєкт",lat:Number(x?.position?.lat),lng:Number(x?.position?.lng)})).filter(x=>Number.isFinite(x.lat)&&Number.isFinite(x.lng))}function f(b){const x=b?.result||b?.data||b;if(!x)return[];const D=x.geom_centroid;if(!D||!Array.isArray(D.coordinates))return[];const[S,M]=D.coordinates;return!Number.isFinite(M)||!Number.isFinite(S)?[]:[{id:"parcel",title:x.cadnum||x.cad_num||"Земельна ділянка",lat:M,lng:S}]}function E(b){const x=b.replace(/\s+/g,"").split(":");if(x.length!==4)return!1;const D=[10,2,3,4];return x.every((S,M)=>S.length===D[M]&&/^\d+$/.test(S))}function C(b){o("goToCoordinates",[b.lat,b.lng])}async function _(){const b=c.value.trim();if(b){if(i.value==="xy"){const x=w(b);if(!x){fe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}C(x),c.value="";return}try{const x=new URL(i.value==="here"?Ih:Fh);if(i.value==="here")x.searchParams.set("searchtext",b);else{if(!E(b)){fe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}x.searchParams.set("cad_num",b)}const D=await fetch(x.toString());if(!D.ok)throw new Error(`HTTP ${D.status}`);const S=await D.json(),M=i.value==="here"?m(S):f(S);if(!M.length)fe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const O=M[0];C(O),c.value=""}}catch(x){const D=x?.message||"Помилка пошуку";fe.notify({type:"error",title:"Пошук",message:D})}}}return(b,x)=>(e.openBlock(),e.createElementBlock("div",Ah,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(_,["prevent"])},[r.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:x[0]||(x[0]=D=>d.value=!d.value)},[e.createElementVNode("span",null,e.toDisplayString(y(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":d.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),d.value?(e.openBlock(),e.createElementBlock("div",Dh,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:S=>p(D)},e.toDisplayString(y(D)),9,Th))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",Lh,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=D=>c.value=D),placeholder:s.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,$h),[[e.vModelText,c.value,void 0,{trim:!0}]]),x[3]||(x[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),Ph=pe(Oh,[["__scopeId","data-v-359172e4"]]),Rh={class:"bg-white/30 p-1 rounded-md shadow w-fit"},zh={class:"flex gap-2"},jh=["onClick","title"],Uh=["src"],Hh=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(l,{emit:t}){const n=e.ref(Object.keys(l.basemaps)[0]),o=t;function a(i){o("onLayerChange",i),n.value=i}const r={z:13,x:4790,y:2762};function s(i){if(i?.preview)return i.preview;if(!i?.url)return;const c={"{z}":r.z,"{x}":r.x,"{y}":r.y};let d=i.url;return Object.entries(c).forEach(([u,p])=>{d=d.replace(new RegExp(u,"gi"),String(p))}),d}return(i,c)=>(e.openBlock(),e.createElementBlock("div",Rh,[e.createElementVNode("div",zh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.basemaps,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":n.value===u}]),onClick:p=>a(u),title:d.name||u,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:s(d),alt:"",class:"w-10 h-10 object-cover"},null,8,Uh)],10,jh))),128))])]))}});function cn(l){return l?l.type==="Polygon"?{type:"MultiPolygon",coordinates:[l.coordinates]}:l.type==="Feature"?{...l,geometry:cn(l.geometry)}:l.type==="FeatureCollection"?{...l,features:(l.features||[]).map(t=>cn(t)).filter(Boolean)}:l:null}function qh(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?cn(l):l.geom?{type:"Feature",geometry:cn({type:l.geom.type,coordinates:l.geom.coordinates}),properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:cn(l),properties:{}}:null:null}const Gh={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},Wh={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},Kh={class:"text-sm font-medium"},Yh={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Zh={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},Jh={class:"flex items-center gap-1"},Xh=["disabled"],Qh=["disabled"],Vh=["disabled"],ev={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"},tv={class:"space-y-0.5"},nv={class:"text-gray-500"},lv={class:"text-gray-900 text-right break-all"},ov={class:"absolute top-4 right-4 z-[1000]"},av={class:"flex flex-col gap-[2px]"},rv=["disabled"],sv=["disabled"],iv=["disabled"],cv=["disabled"],dv={class:"flex flex-col gap-2"},uv={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},pv={class:"flex flex-col gap-1"},mv=["checked","disabled","onChange"],fv={class:"text-gray-700 text-xs font-medium"},hv={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},vv={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},gv={class:"shrink-0"},yv={class:"font-bold"},kv={class:"flex items-center"},bv={class:"text-xs mr-2"},xv={key:0,class:"text-xs"},wv={key:1,class:"text-xs"},Ev=["disabled"],Cv=["disabled"],jn="vs-base-tile-pane",Un="vs-overlay-tile-pane",Hn="__vs_form_leaflet_loader__",Pl="__vs_form_leaflet_scripts__",_v=e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},ctrlZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},katottg:{default:""},layers:{default:()=>[]},bounds:{},api:{},center:{default:void 0},zoom:{default:void 0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=e.getCurrentInstance()?.appContext?.config?.globalProperties?.$settings??{},o=Array.isArray(n.center)&&n.center.length===2?n.center:[50,30],a=typeof n.zoom=="number"?n.zoom:typeof n.defaultZoom=="number"?n.defaultZoom:10,r=l,s=t,i=e.computed(()=>!!r.disabled),c=e.ref(!1),d=e.ref(null),u=e.ref(!1),p=e.ref(""),g=e.ref(null),y=e.ref(null),w=e.ref(!1),m=e.ref(null),f=e.ref(null),E=e.ref(0),C=e.ref(Array.isArray(r.center)&&r.center.length===2?[...r.center]:o),_=e.ref(typeof r.zoom=="number"?r.zoom:a),b=e.ref([]),x=e.ref(r.modelValue);let D=!1;const S=e.ref(null),M=e.computed(()=>{const h={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!r.tools?.length)return{...h,point:!0,line:!0,polygon:!0,rectangle:!0};const v=new Set(r.tools.map(B=>B.toLowerCase()));return{search:v.has("search"),import:v.has("import"),export:v.has("export"),point:v.has("point"),line:v.has("line"),polygon:v.has("polygon"),rectangle:v.has("rectangle")}}),O=e.reactive({}),K=e.ref([]),U=e.computed(()=>K.value.map(h=>O[h]).filter(Boolean)),R=e.ref(null),q=e.computed(()=>R.value?.entries??[]),N=e.computed(()=>{if(!R.value)return;const h=12,v=R.value.point.x+h,B=R.value.point.y+h;return{left:`${v}px`,top:`${B}px`}});function j(h){if(typeof h!="string"||!h.trim())return"";if(/^https?:\/\//i.test(h))return h;const v=window?.location?.origin??"",B=h.replace(/^\/+/,"");return B?v?`${v}/${B}`:`/${B}`:v}function $(){if(Array.isArray(n.basemaps)&&n.basemaps.length){const h=n.basemaps.map((v,B)=>{const k=String(v?.key??v?.id??v?.name??`b${B}`),A=j(String(v?.url??""));if(!A)return null;const I=typeof v?.preview=="string"&&v.preview?j(v.preview):"";return[k,{...v,url:A,preview:I}]}).filter(v=>Array.isArray(v)&&v.length===2).reduce((v,[B,k])=>(v[B]=k,v),{});if(Object.keys(h).length)return h}return{voyager:{name:"Оглядова карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{name:"Ортофото 1:10K",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{name:"Open Street Maps",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const Z=$(),V=Object.keys(Z),oe=e.ref(V.length?V[0]:"");let ee,H,ie,Y,se=null;async function ue(){if(typeof window>"u")return null;const h=window;if(h[Hn])return h[Hn];const v=I=>{if(!Array.from(document.styleSheets).some(ne=>ne?.href?.includes(I))){const ne=document.createElement("link");ne.rel="stylesheet",ne.href=I,document.head.appendChild(ne)}};h[Pl]=h[Pl]||{};const B=h[Pl],k=I=>(B[I]||(B[I]=fetch(I).then(ne=>{if(!ne.ok)throw new Error(`Failed to load ${I}: ${ne.status}`);return ne.text()}).then(ne=>{const ce=document.createElement("script");ce.textContent=`/* vs-form loader ${I} */
143
- ${ne}`,document.head.appendChild(ce)})),B[I]),A=(async()=>{v("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),v("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),window.L||await k("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),await k("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"),await k("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js");const I=window.L;if(!I)throw new Error("Leaflet global not available after loading scripts");return I})().catch(I=>{throw delete h[Hn],I});return h[Hn]=A,A}function he(){const h=navigator.platform.toUpperCase().includes("MAC");return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":h?"Використовуйте Ctrl або ⌘ + прокрутка для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}function be(){if(!r.handleZoom||!d.value||!H)return null;let h;const v=k=>{const A=k.ctrlKey||k.metaKey||k.shiftKey;if(!r.ctrlZoom){u.value=!1,H.scrollWheelZoom.enable();return}if(!A){u.value=!0,p.value=he(),clearTimeout(h),h=window.setTimeout(()=>u.value=!1,1200);return}k.preventDefault(),k.stopPropagation(),u.value=!1,H.scrollWheelZoom.enable(),setTimeout(()=>H.scrollWheelZoom.disable(),120)},B=k=>{if(k.touches.length===1){if(!r.ctrlZoom)return;u.value=!0,p.value=he(),clearTimeout(h),h=window.setTimeout(()=>u.value=!1,3e3)}else u.value=!1};return d.value.addEventListener("wheel",v,{passive:!1}),d.value.addEventListener("touchstart",B,{passive:!0}),H.on("wheel",k=>{r.ctrlZoom&&(k.originalEvent?.ctrlKey||k.originalEvent?.metaKey||k.originalEvent?.shiftKey||(k.originalEvent?.preventDefault?.(),k.originalEvent?.stopPropagation?.()))}),()=>{d.value?.removeEventListener("wheel",v),d.value?.removeEventListener("touchstart",B),clearTimeout(h)}}function L(h,v){return h?.id?String(h.id):h?.url?`${h.url}-${v}`:`layer-${v}`}function le(h){const v=(h?.url??"").trim();if(!v)return"";if(/^https?:\/\//i.test(v))return v;const B=window.location?.origin??"",k=v.replace(/^\/+/,"");return`${B}/${k}`}function T(h){const v=h?.style??{};return B=>{const{colorAttr:k}=v,A=v.colorSet??{},I=typeof k=="string"?A?.[B?.[k]]??v.color??"#3388ff":v.color??"#3388ff",ne=v.stroke??I;return{weight:v.width??1,color:ne,opacity:v.opacity??1,fill:v.type?v.type!=="polyline":!0,fillColor:I,fillOpacity:v.opacity??.5}}}function P(h){return h?.layer?.properties||h?.layer?.feature?.properties||h?.properties||{}}function X(h,v={}){return h.popup===!1?[]:Array.isArray(h.popup)&&h.popup.length?h.popup.map(B=>{if(!B?.field)return null;const k=v[B.field];return k==null||k===""?null:{key:B.label||B.field,value:String(k)}}).filter(B=>!!B):Object.entries(v).filter(([B])=>typeof B=="string"&&B).slice(0,5).map(([B,k])=>({key:B,value:k==null?"—":String(k)}))}function J(h,v){if(!H||!v?.latlng)return;const B=H.latLngToContainerPoint(v.latlng),k=P(v),A=X(h,k);if(!A.length){re(h.id);return}R.value={layerId:h.id,title:k?.name||h.title||h.name,properties:k,entries:A,point:{x:B.x,y:B.y}}}function re(h){h&&R.value?.layerId!==h||(R.value=null)}function xe(h){const v=(h?.service??"").toLowerCase(),B=le(h),k=h.sourceLayer||h.layer||h.service_layer||h.service_key||h.map_key||h.dataset?.layer||h.id||h.table_name;if(v==="vtile"){const A=S.value;if(A?.vectorGrid?.protobuf&&!A?.maplibreGL){const I=A.vectorGrid.protobuf(B,{interactive:!0,maxNativeZoom:h.maxzoom??19,vectorTileLayerStyles:{[k??"default"]:T(h),default:T(h)}});return I?.on?.("mouseover",ne=>J(h,ne)),I?.on?.("mousemove",ne=>J(h,ne)),I?.on?.("mouseout",()=>re(h.id)),I}if(A?.maplibreGL&&window?.maplibregl){const I=B;return I?A.maplibreGL({style:I,interactive:!1,pane:"overlayPane"}):null}return null}return v==="tile"||/^https?:\/\//i.test(B)||B.includes("{z}")?S.value.tileLayer(B,{opacity:h?.style?.opacity??1,pane:Un}):S.value.tileLayer(B,{opacity:h?.style?.opacity??1,pane:Un})}function F(h){const v=S.value;if(!v)return null;const B=("bounds"in h?h.bounds:void 0)??r.bounds??b.value;if(!Array.isArray(B)||!B.length)return null;const k={color:h.style?.stroke??h.style?.color??"#2563eb",weight:h.style?.width??2,interactive:!1,opacity:h.style?.opacity??.8,dashArray:"4 4"},A=Array.isArray(h.bounds)&&h.bounds.length?h.bounds:B,I=te(A);if(!I.length||!v?.polyline)return null;const ne=I.map(ce=>{if(!ce.length)return ce;const Be=ce[0],Ne=ce[ce.length-1];return Be&&Ne&&typeof Ne.equals=="function"&&!Ne.equals(Be)?[...ce,Be]:ce});return v.polyline(ne,k)}function te(h){const v=S.value;if(!v||!Array.isArray(h))return[];const B=A=>{if(!Array.isArray(A)||A.length<2)return null;const[I,ne]=A;return!Number.isFinite(Number(ne))||!Number.isFinite(Number(I))?null:v.latLng(Number(ne),Number(I))},k=A=>Array.isArray(A)&&A.length>=2&&A.every(I=>Number.isFinite(Number(I)));if(h.length&&k(h[0])){const A=h.map(B).filter(Boolean);return A.length?[A]:[]}return h.length&&Array.isArray(h[0])&&Array.isArray(h[0][0])&&k(h[0][0][0])?h.flatMap(A=>Array.isArray(A)?A:[]).map(A=>Array.isArray(A)?A.map(B).filter(Boolean):[]).filter(A=>A.length):h.length&&Array.isArray(h[0])&&k(h[0][0])?h.map(A=>Array.isArray(A)?A.map(B).filter(Boolean):[]).filter(A=>A.length):[]}function ae(){if(!H||!S.value)return;se&&H.hasLayer(se)&&(H.removeLayer(se),se=null);const h=F({id:"global-bounds",bounds:r.bounds??b.value,style:{}});h&&(se=h,se.addTo(H))}function _e(){!H||!S.value||K.value.forEach(h=>{const v=O[h];v&&(v.visible?(v.layer||(v.layer=xe(v.config)),v.boundsLayer||(v.boundsLayer=F(v.config)),v.layer&&!H.hasLayer(v.layer)&&v.layer.addTo(H),v.boundsLayer&&!H.hasLayer(v.boundsLayer)&&v.boundsLayer.addTo(H)):(v.layer&&H.hasLayer(v.layer)&&H.removeLayer(v.layer),v.boundsLayer&&H.hasLayer(v.boundsLayer)&&H.removeLayer(v.boundsLayer),re(v.id)))})}function Ae(h){if(i.value)return;const v=O[h];v&&(v.visible=!v.visible,v.visible?(v.layer||(v.layer=xe(v.config)),v.boundsLayer||(v.boundsLayer=F(v.config)),v.layer&&!H.hasLayer(v.layer)&&v.layer.addTo(H),v.boundsLayer&&!H.hasLayer(v.boundsLayer)&&v.boundsLayer.addTo(H)):(v.layer&&H.hasLayer(v.layer)&&H.removeLayer(v.layer),v.boundsLayer&&H.hasLayer(v.boundsLayer)&&H.removeLayer(v.boundsLayer),re(v.id)))}e.watch(()=>r.layers,h=>{const v=Array.isArray(h)?h:[],B=[],k=new Set;v.forEach((A,I)=>{if(!A)return;const ne=L(A,I);B.push(ne),k.add(ne);const ce=O[ne],Be={...A,id:ne},Ne=ce?.visible??!!Be?.visible;ce&&(ce.layer&&H?.hasLayer(ce.layer)&&H.removeLayer(ce.layer),ce.boundsLayer&&H?.hasLayer(ce.boundsLayer)&&H.removeLayer(ce.boundsLayer),re(ne)),O[ne]={id:ne,config:Be,visible:Ne,layer:null,boundsLayer:null}}),Object.keys(O).forEach(A=>{if(!k.has(A)){const I=O[A];I?.layer&&H?.hasLayer(I.layer)&&H.removeLayer(I.layer),I?.boundsLayer&&H?.hasLayer(I.boundsLayer)&&H.removeLayer(I.boundsLayer),re(A),delete O[A]}}),K.value=B,_e()},{immediate:!0,deep:!0}),e.watch(()=>r.bounds,()=>{H&&(Object.values(O).forEach(h=>{h.boundsLayer&&H.hasLayer(h.boundsLayer)&&H.removeLayer(h.boundsLayer),h.boundsLayer=null}),ae(),_e())},{deep:!0}),e.watch(()=>r.katottg,async h=>{if(b.value=[],!h){ae();return}try{const v=await fetch(`https://data.gki.com.ua/api-user/atu/${h}`);if(!v?.ok)return;const B=(await v.json())?.geometry?.coordinates;Array.isArray(B)&&B.length&&(b.value=B)}catch(v){console.error("Failed to fetch KATOTTG bounds",v)}finally{ae(),_e()}},{immediate:!0}),e.watch(()=>r.modelValue,h=>{if(!H||!ie){x.value=h;return}ht(h)},{deep:!0});function Re(h){const v=S.value;return h instanceof v.Circle?"Circle":h instanceof v.Rectangle?"Rectangle":h instanceof v.Polygon&&!(h instanceof v.Rectangle)?"Polygon":h instanceof v.Polyline&&!(h instanceof v.Polygon)?"Polyline":h instanceof v.Marker?"Point":"Feature"}function Ye(h){const v=S.value;if(h instanceof v.Circle){const B=h.getRadius();return Math.PI*(B*B)/1e6}if(h instanceof v.Polygon||h instanceof v.Rectangle)try{const B=h.getLatLngs();if(!Array.isArray(B)||!B.length)return null;if(!Array.isArray(B[0])){const I=v.GeometryUtil?.geodesicArea?v.GeometryUtil.geodesicArea(B):0;return I?Math.abs(I)/1e6:0}const k=B[0];if(k.length>0&&(k[0]instanceof v.LatLng||typeof k[0]?.lat=="number")){const{feature:I}=h;if(I?.geometry?.type==="MultiPolygon"){const ce=B.reduce((Be,Ne)=>{if(!Array.isArray(Ne)||!Ne.length)return Be;if(v.GeometryUtil?.geodesicArea){const Ue=v.GeometryUtil.geodesicArea(Ne);if(Ue)return Be+Math.abs(Ue)}return Be},0);return ce?ce/1e6:0}const ne=v.GeometryUtil?.geodesicArea?v.GeometryUtil.geodesicArea(B):0;return ne?Math.abs(ne)/1e6:0}const A=B.reduce((I,ne)=>{if(!Array.isArray(ne)||!ne.length)return I;const ce=Array.isArray(ne[0])?ne[0]:ne;if(v.GeometryUtil?.geodesicArea){const Be=v.GeometryUtil.geodesicArea(ce);if(Be)return I+Math.abs(Be)}return I},0);return A?A/1e6:0}catch{return null}return null}function dt(h){return h instanceof S.value.Circle?h.getLatLng():h.getBounds?h.getBounds().getCenter():h.getLatLng?h.getLatLng():H.getCenter()}function Qe(h){const v=ie.toGeoJSON(),B=[],k=[];let A=null;const I=ce=>{if(ce)switch(ce.type){case"Point":A=ce;break;case"Polygon":B.push(ce.coordinates);break;case"MultiPolygon":B.push(...ce.coordinates);break;case"LineString":k.push(ce.coordinates);break;case"MultiLineString":k.push(...ce.coordinates);break;case"GeometryCollection":(ce.geometries||[]).forEach(I);break}};(v?.features||[]).forEach(ce=>I(ce.geometry));const ne=A||(B.length?{type:B.length===1?"Polygon":"MultiPolygon",coordinates:B.length===1?B[0]:B}:k.length?{type:k.length===1?"LineString":"MultiLineString",coordinates:k.length===1?k[0]:k}:null);!h?.silent&&!D&&s("update:modelValue",ne),E.value=ie.getLayers().length}function ht(h){if(!ie||!S.value)return;ie.clearLayers();const v=qh(h);if(!v){y.value=null,E.value=0;return}S.value.geoJSON(v).eachLayer(k=>ie.addLayer(k)),D=!0,Qe({silent:!0}),D=!1,ze();const B=ie.getBounds?.();B?.isValid?.()&&H?.fitBounds(B,{padding:[24,24]})}function ze(){const h=ie.getLayers();if(!h.length){y.value=null,E.value=0;return}const v=h[h.length-1],B=Re(v),k=dt(v),A=ie.toGeoJSON(),I=A?.features?.some(Ne=>Ne.geometry?.type==="MultiPolygon")||A?.geometry?.type==="MultiPolygon",ne=h.length>1&&h.every(Ne=>Ne instanceof S.value.Polygon||Ne instanceof S.value.Rectangle),ce=I||ne;let Be=null;if(ce){const Ne=h.reduce((Ue,Ve)=>{const an=Ye(Ve);return Ue+(an?an*1e6:0)},0);Be=Ne?Ne/1e6:0}else Be=Ye(v);y.value={type:B,center:k,areaKm2:Be,layer:v},E.value=h.length}const Le=e.ref("");function je(h){if(i.value||!H||!S.value)return;Y?.disable&&Y.disable();const v=S.value;switch(h){case"marker":Y=new v.Draw.Marker(H);break;case"polyline":Y=new v.Draw.Polyline(H);break;case"polygon":Y=new v.Draw.Polygon(H);break;case"rectangle":Y=new v.Draw.Rectangle(H);break}Y.enable(),Le.value=h}function wt(){if(i.value)return;const h=y.value?.layer;h&&(h.getBounds?H.fitBounds(h.getBounds(),{padding:[30,30]}):h.getLatLng&&H.setView(h.getLatLng(),Math.max(_.value,14)))}function ut(){i.value||ie&&(ie.clearLayers(),s("update:modelValue",null),y.value=null,E.value=0)}const z=e.ref(null);function Q(){i.value||z.value?.click()}function G(h){if(i.value)return;const v=h.target,B=v.files?.[0];if(!B)return;const k=new FileReader;k.onload=()=>{try{const A=JSON.parse(String(k.result));ie.clearLayers(),A&&S.value.geoJSON(A).eachLayer(I=>ie.addLayer(I)),Qe(),ze()}finally{v.value=""}},k.readAsText(B)}function W(){if(i.value)return;const h=ie.toGeoJSON(),v=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),B=URL.createObjectURL(v),k=document.createElement("a");k.href=B,k.download="data.geojson",k.click(),URL.revokeObjectURL(B)}function ve(h){!H||!S.value||!Z[h]||(ee&&H.removeLayer(ee),ee=S.value.tileLayer(Z[h].url,{maxZoom:19,minZoom:6,pane:jn}).addTo(H),oe.value=h)}function me(h){if(!H||!S.value)return;const v=S.value.latLng(h[0],h[1]);H.setView(v,13)}let Ee=null;return e.onMounted(async()=>{S.value=await ue();const h=S.value;h.drawLocal=ch,H=h.map(d.value,{zoomControl:!1,scrollWheelZoom:!1}).setView(C.value,_.value),h.control.zoom({position:"bottomright"}).addTo(H);const v=oe.value||Object.keys(Z)[0];H.createPane(jn),H.getPane(jn).style.zIndex="180",H.createPane(Un),H.getPane(Un).style.zIndex="220",v&&Z[v]&&(oe.value=v,ee=h.tileLayer(Z[v].url,{maxZoom:19,minZoom:6,pane:jn}).addTo(H)),ie=new h.FeatureGroup().addTo(H),H.on(h.Draw.Event.CREATED,k=>{if(i.value)return;const{layer:A}=k;ie.clearLayers(),ie.addLayer(A),Qe(),ze(),Le.value=""}),H.on(h.Draw.Event.EDITED,()=>{i.value||(Qe(),ze())}),H.on(h.Draw.Event.DELETED,()=>{i.value||(Qe(),ze())});let B=!1;H.on("mousemove",k=>{B||(H.invalidateSize(),B=!0)}),H.on("zoomend",()=>{_.value=H.getZoom()}),Ee=be(),_e(),ae(),x.value!==void 0&&(ht(x.value),x.value=void 0)}),e.watch(()=>r.center,h=>{!Array.isArray(h)||h.length!==2||(C.value=[...h],H&&H.setView(C.value,H.getZoom()))},{deep:!0}),e.watch(()=>r.zoom,h=>{typeof h=="number"&&(_.value=h,H&&H.setZoom(h))}),e.onUnmounted(()=>{Ee?.(),re(),se&&H?.hasLayer(se)&&(H.removeLayer(se),se=null),H?.remove&&H.remove()}),e.watch(c,()=>{setTimeout(()=>{H?.invalidateSize&&H.invalidateSize()},50)}),e.watch(w,async h=>{if(!h||!f.value){m.value=null;return}await e.nextTick();const v=f.value.getBoundingClientRect();m.value={top:v.bottom+6,left:v.left}}),(h,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!c.value},[e.createElementVNode("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:c.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:d,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[u.value&&r.handleZoom?(e.openBlock(),e.createElementBlock("div",Gh,[e.createElementVNode("div",Wh,[e.createElementVNode("p",Kh,e.toDisplayString(p.value),1)])])):e.createCommentVNode("",!0)]),_:1}),M.value.search||M.value.import||M.value.export?(e.openBlock(),e.createElementBlock("div",Yh,[M.value.search?(e.openBlock(),e.createBlock(Ph,{key:0,onGoToCoordinates:me})):e.createCommentVNode("",!0),M.value.import||M.value.export?(e.openBlock(),e.createElementBlock("div",Zh,[e.createElementVNode("div",Jh,[M.value.import?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Q,disabled:i.value}," Import ",8,Xh)):e.createCommentVNode("",!0),M.value.export?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:W,disabled:i.value||E.value===0}," Export ",8,Qh)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"importRef",ref:z,type:"file",onChange:G,accept:".json,.geojson",class:"hidden",disabled:i.value},null,40,Vh)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),q.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"absolute z-[1500] pointer-events-none",style:e.normalizeStyle(N.value)},[e.createElementVNode("div",ev,[e.createElementVNode("dl",tv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,B=>(e.openBlock(),e.createElementBlock("div",{key:`${B.key}-${B.value}`,class:"flex justify-between gap-2"},[e.createElementVNode("dt",nv,e.toDisplayString(B.key),1),e.createElementVNode("dd",lv,e.toDisplayString(B.value),1)]))),128))])])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",ov,[e.createElementVNode("div",av,[M.value.point?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="marker"}]),title:"Point",onClick:v[0]||(v[0]=B=>je("marker")),disabled:i.value},[e.createVNode(mh)],10,rv)):e.createCommentVNode("",!0),M.value.line?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="polyline"}]),title:"Line",onClick:v[1]||(v[1]=B=>je("polyline")),disabled:i.value},[e.createVNode(gh)],10,sv)):e.createCommentVNode("",!0),M.value.polygon?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="polygon"}]),title:"Polygon",onClick:v[2]||(v[2]=B=>je("polygon")),disabled:i.value},[e.createVNode(xh)],10,iv)):e.createCommentVNode("",!0),M.value.rectangle?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="rectangle"}]),title:"Rectangle",onClick:v[3]||(v[3]=B=>je("rectangle")),disabled:i.value},[e.createVNode(_h)],10,cv)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:v[4]||(v[4]=B=>c.value=!c.value),title:"Full Screen"},[e.createVNode(Mh,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",y.value?"bottom-8":"bottom-4"])},[e.createElementVNode("div",dv,[e.createVNode(Hh,{basemaps:e.unref(Z),onOnLayerChange:ve},null,8,["basemaps"]),U.value.length?(e.openBlock(),e.createElementBlock("div",uv,[v[9]||(v[9]=e.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Шари",-1)),e.createElementVNode("div",pv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,B=>(e.openBlock(),e.createElementBlock("label",{key:B.id,class:"flex items-center gap-2 cursor-pointer select-none"},[e.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:B.visible,disabled:i.value,onChange:k=>Ae(B.id)},null,40,mv),e.createElementVNode("span",fv,e.toDisplayString(B.config.title||B.config.name||B.id),1)]))),128))])])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",hv,[y.value?(e.openBlock(),e.createElementBlock("div",vv,[e.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:v[5]||(v[5]=B=>w.value=!0),onMouseleave:v[6]||(v[6]=B=>w.value=!1)},[e.createElementVNode("div",gv,[v[10]||(v[10]=e.createTextVNode(" Type: ",-1)),e.createElementVNode("span",yv,e.toDisplayString(y.value.type),1)]),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"addressEl",ref:f,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+e.toDisplayString(g.value),513)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[w.value&&g.value&&m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:e.normalizeStyle({top:m.value.top+"px",left:m.value.left+"px"})},e.toDisplayString(g.value),5)):e.createCommentVNode("",!0)]))],32),e.createElementVNode("div",kv,[e.createElementVNode("div",bv,[v[11]||(v[11]=e.createTextVNode(" Center: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.center.lat.toFixed(5))+", "+e.toDisplayString(y.value.center.lng.toFixed(5)),1)]),y.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",xv,[v[12]||(v[12]=e.createTextVNode(" Area: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.areaKm2.toFixed(1))+" km²",1)])):(e.openBlock(),e.createElementBlock("div",wv,[...v[13]||(v[13]=[e.createTextVNode("Area: ",-1),e.createElementVNode("b",null,"—",-1)])])),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:v[7]||(v[7]=B=>wt()),disabled:i.value},[...v[14]||(v[14]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-3 h-3"},[e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),e.createElementVNode("path",{d:"M7 10l6 0"}),e.createElementVNode("path",{d:"M10 7l0 6"}),e.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)])],8,Ev),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:v[8]||(v[8]=B=>ut()),disabled:i.value},[e.createVNode(Wt,{class:"w-3 h-3"})],8,Cv)])])):e.createCommentVNode("",!0)])],2)],8,["disabled"]))}}),Nv=pe(_v,[["__scopeId","data-v-9ae03533"]]),Bv=["data-focus"],Sv={class:"flex items-center"},Mv={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},Av=["onClick","aria-label"],Dv={key:0,class:"absolute text-gray-500 truncate pl-2"},Tv={class:"flex-1 min-w-[2px]"},Lv=["placeholder"],$v={class:"flex items-center shrink-0"},Iv=["disabled"],Fv=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=t;Xe(n.style);const a=e.ref(null),r=e.ref(null),s=e.ref(null),i=e.ref(!1),c=e.ref(""),d=e.useModel(l,"modelValue"),u=e.computed(()=>n.placeholder||"Add tag…"),p=e.computed(()=>d.value?.length===0&&c.value===""),g=e.computed(()=>!n.disabled&&d.value?.length>0),y=e.computed(()=>n.disabled),w=async()=>{y.value||await e.nextTick(()=>s.value?.focus())},m=D=>{const S=D.trim();S!==""&&(!d.value||!Array.isArray(d.value)?d.value=[S]:n.unique?d.value.includes(S)||(d.value=[...d.value,S]):d.value=[...d.value,S],c.value="")},f=()=>{const D=c.value;D.trim()!==""&&m(D),c.value=""},E=D=>{const S=d.value.slice();S.splice(D,1),o("update:modelValue",S)},C=()=>{o("update:modelValue",[])},_=()=>{y.value||(i.value=!0)},b=()=>{i.value=!1,!y.value&&f()},x=D=>{const{key:S}=D;S==="Enter"?(D.preventDefault(),f()):S==="Backspace"&&c.value===""&&d.value.length>0&&E(d.value.length-1)};return(D,S)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:a,onClick:S[1]||(S[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",y.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:w},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:r},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(M,O)=>(e.openBlock(),e.createElementBlock("div",{key:O,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",Sv,[e.createElementVNode("div",Mv,e.toDisplayString(M),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(K=>E(O),["stop"]),"aria-label":`Remove ${M}`},[...S[2]||(S[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Av)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",Dv,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tv,[y.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:s,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":S[0]||(S[0]=M=>c.value=M),onFocus:_,onBlur:b,onKeydown:x,placeholder:d.value&&d.value.length?"":void 0},null,40,Lv)),[[e.vModelText,c.value]])])],512),e.createElementVNode("div",$v,[g.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:y.value,onClick:e.withModifiers(C,["stop"])},[...S[3]||(S[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Iv)):e.createCommentVNode("",!0)])],10,Bv)],2)],512))}}),Ov={class:"relative flex gap-1 bg-white w-full"},Pv=["disabled","placeholder"],Rv=e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.inject("values"),n=l,o=e.useModel(l,"modelValue");function a(s){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return s.toLowerCase().split("").map(c=>i[c]||c).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const r=()=>{const s=t?.value?.[n.parent||""]?.toString(),i=a(s);o.value=i.toString()};return(s,i)=>(e.openBlock(),e.createElementBlock("div",Ov,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:s.disabled,placeholder:s.placeholder,"onUpdate:modelValue":i[0]||(i[0]=c=>o.value=c),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,Pv),[[e.vModelText,o.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:r}," Gen ")]))}}),zv=pe(Rv,[["__scopeId","data-v-cb7b2b74"]]),jv={class:"relative flex gap-1 bg-white w-full"},Uv=["disabled","placeholder"],Hv=["disabled"],qv={key:0},Gv={key:1},Wv=e.defineComponent({__name:"vs-input-codegen",props:e.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(!1),a=e.computed(()=>t.init!==!1),r=e.computed(()=>!!t.table&&!!t.code),s=()=>{if(!r.value)return"";const d=encodeURIComponent(String(t.table)),u=encodeURIComponent(String(t.code));return`/api/code-gen/${d}/${u}`},i=async()=>{if(!r.value||o.value)return;const d=s();if(d){o.value=!0;try{const u=await(await fetch(d)).text();n.value=u}finally{o.value=!1}}},c=()=>{a.value&&(n.value||i())};return e.onMounted(()=>{c()}),e.watch(()=>[t.table,t.code,t.init],()=>{c()}),(d,u)=>(e.openBlock(),e.createElementBlock("div",jv,[e.withDirectives(e.createElementVNode("input",{disabled:d.disabled,placeholder:d.placeholder,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,Uv),[[e.vModelText,n.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:o.value||d.disabled||!r.value,onClick:i},[o.value?(e.openBlock(),e.createElementBlock("span",Gv,"...")):(e.openBlock(),e.createElementBlock("span",qv,"Gen"))],8,Hv)]))}}),Kv=pe(Wv,[["__scopeId","data-v-8f88fb66"]]),Yv={class:"w-full"},Zv={ref:"sortableContainer",class:"flex flex-col gap-1"},Jv=["onDragstart","onDrop"],Xv={class:"w-1/3"},Qv={class:"w-2/3"},Vv=["onClick"],e0={key:0,class:"text-[14px] text-gray-700"},t0={class:"mt-2 w-full flex items-center"},n0=["disabled"],l0=e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=m=>`${m}-${Math.random().toString(36).substring(2,15)}`,o=e.inject("values"),a=l,r=t,s=a.addButtonText??"Додати",i=a.ignore??[],c=e.ref([]),d=e.ref(null);(()=>{const m=a.parent&&o?.value?.[a.parent]||a.modelValue||{};c.value=Object.entries(m).filter(([f])=>!i.includes(f)).map(([f,E])=>({id:n("key-value-"),key:f,value:E}))})();function u(m){d.value=m}function p(m){if(d.value===null||d.value===m)return;const f=c.value.splice(d.value,1)[0];c.value.splice(m,0,f),d.value=null}const g=e.computed(()=>c.value.some(m=>m.key&&!m.value||!m.key&&m.value)),y=()=>{c.value.push({id:n("key-value-"),key:"",value:""})},w=m=>{c.value=c.value.filter(f=>f.id!==m)};return e.watch(c,m=>{const f={};m.forEach(C=>{C.key&&C.value!==void 0&&(f[C.key]=C.value)});const E={};i.length&&i.forEach(C=>{E[C]=a.parent?o?.value?.[a.parent]?.[C]:void 0}),o?.value&&a.parent&&(o.value[a.parent]={...E,...f}),r("update:modelValue",f)},{deep:!0}),(m,f)=>(e.openBlock(),e.createElementBlock("div",Yv,[e.createElementVNode("div",Zv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(E,C)=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":d.value===C}]),draggable:"true",onDragstart:_=>u(C),onDragover:f[0]||(f[0]=e.withModifiers(()=>{},["prevent"])),onDrop:_=>p(C)},[f[1]||(f[1]=e.createStaticVNode('<button class="cursor-move" data-v-2ae5f16f><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-2ae5f16f><circle cx="15" cy="12" r="1.5" data-v-2ae5f16f></circle><circle cx="15" cy="24" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="12" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="24" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="18" r="1.5" data-v-2ae5f16f></circle><circle cx="15" cy="18" r="1.5" data-v-2ae5f16f></circle></svg></button>',1)),e.createElementVNode("div",Xv,[e.createVNode(sn,{modelValue:E.key,"onUpdate:modelValue":_=>E.key=_,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",Qv,[e.createVNode(sn,{modelValue:E.value,"onUpdate:modelValue":_=>E.value=_,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:_=>w(E.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(Pn),{height:"16",width:"16"})],8,Vv)],42,Jv))),128))],512),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",e0," Дані для відображення відсутні ")),e.createElementVNode("div",t0,[e.createElementVNode("button",{type:"button",onClick:y,disabled:g.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(vt,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s)),1)],8,n0)])]))}}),o0=pe(l0,[["__scopeId","data-v-2ae5f16f"]]),a0={class:"w-full"},r0={ref:"sortableContainer",class:"flex flex-col gap-1"},s0=["onDragstart","onDrop"],i0=["disabled"],c0={class:"flex-1"},d0=["onClick","disabled"],u0={key:0,class:"text-[14px] text-gray-700"},p0={class:"mt-2 w-full flex items-center"},m0=["disabled"],f0=e.defineComponent({__name:"vs-input-text-array",props:e.mergeModels({addButtonText:{default:"Додати"},inputType:{default:"text"},placeholder:{default:"Значення"},mask:{default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref([]),a=e.ref(null),r=e.computed(()=>!!t.disabled),s=e.computed(()=>t.placeholder??""),i=e.computed(()=>t.addButtonText??"Додати");let c=!1;const d=f=>`${f}-${Math.random().toString(36).substring(2,15)}`,u=f=>{const E=f??n.value??[];o.value=E.map((C,_)=>({id:o.value[_]?.id??d("text-array"),value:C??""}))};u(),e.watch(()=>n.value,f=>{if(c){c=!1;return}u(f||[])},{deep:!0}),e.watch(o,f=>{c=!0,n.value=f.map(E=>E.value).filter(E=>E!=null&&E!=="")},{deep:!0});const p=e.computed(()=>r.value||o.value.some(f=>!f.value));function g(){p.value||(o.value=[...o.value,{id:d("text-array"),value:""}])}function y(f){r.value||(o.value=o.value.filter(E=>E.id!==f))}function w(f){r.value||(a.value=f)}function m(f){if(r.value||a.value===null||a.value===f)return;const E=[...o.value],[C]=E.splice(a.value,1);E.splice(f,0,C),o.value=E,a.value=null}return(f,E)=>(e.openBlock(),e.createElementBlock("div",a0,[e.createElementVNode("div",r0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":a.value===_}]),draggable:"true",onDragstart:b=>w(_),onDragover:E[0]||(E[0]=e.withModifiers(()=>{},["prevent"])),onDrop:b=>m(_)},[e.createElementVNode("button",{class:"cursor-move",type:"button",disabled:r.value},[...E[1]||(E[1]=[e.createStaticVNode('<svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-77ce3498><circle cx="15" cy="12" r="1.5" data-v-77ce3498></circle><circle cx="15" cy="24" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="12" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="24" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="18" r="1.5" data-v-77ce3498></circle><circle cx="15" cy="18" r="1.5" data-v-77ce3498></circle></svg>',1)])],8,i0),e.createElementVNode("div",c0,[f.inputType==="text"?(e.openBlock(),e.createBlock(sn,{key:0,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="tel"?(e.openBlock(),e.createBlock(oa,{key:1,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="email"?(e.openBlock(),e.createBlock(la,{key:2,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="mask"?(e.openBlock(),e.createBlock(Il,{key:3,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,mask:f.mask,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","mask","disabled","placeholder"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:b=>y(C.id),disabled:r.value,class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"},[e.createVNode(e.unref(Pn),{height:"16",width:"16"})],8,d0)],42,s0))),128))],512),o.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",u0," Дані для відображення відсутні ")),e.createElementVNode("div",p0,[e.createElementVNode("button",{type:"button",onClick:g,disabled:p.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(vt,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(i.value),1)],8,m0)])]))}}),h0=pe(f0,[["__scopeId","data-v-77ce3498"]]),v0={class:"flex items-center gap-2 w-full"},g0=["disabled"],y0=["disabled"],k0=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,{inputClass:o}=Xe(n.style),a=t,r=e.computed({get:()=>n.modelValue||"#000000",set:i=>a("update:modelValue",i)}),s=e.computed(()=>!!n.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",v0,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),disabled:s.value,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[i.modelValue?"":"text-opacity-50",e.unref(o)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,g0),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),disabled:s.value},null,8,y0),[[e.vModelText,r.value]])]))}}),b0={class:"flex items-center gap-2 w-full"},x0=["min","max","step","disabled"],w0=["disabled"],E0=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,{inputClass:o}=Xe(n.style),a=t,r=e.computed({get:()=>Number(n.modelValue??n.min),set:i=>a("update:modelValue",Number(i))}),s=e.computed(()=>!!n.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",b0,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),min:i.min,max:i.max,step:i.step,disabled:s.value,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[i.modelValue?"":"text-opacity-50",e.unref(o)].join(" ")])},null,10,x0),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),disabled:s.value},null,8,w0),[[e.vModelText,r.value]])]))}}),C0=["placeholder","disabled","name"],_0=["type","value","onInput","placeholder","disabled"],N0=["onClick"],B0=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:1},mask:{default:""},unmask:{type:Boolean,default:!1},inputType:{default:"text"},isAdded:{type:Boolean,default:!1},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.ref(t.count),o=e.computed(()=>t.limit),{inputClass:a}=Xe(t.style),r=e.useModel(l,"modelValue"),s=e.computed(()=>!!t.disabled),i=e.computed(()=>t.placeholder??"");e.watchEffect(()=>{const m=r.value?.length??0;m<n.value&&(r.value=[...r.value??[],...Array(n.value-m)])});const c=e.ref({}),d=e.ref({});function u(m,f){m&&(c.value[f]=m)}async function p(m,f){if(!m||t.inputType!=="mask")return;const{default:E}=await Promise.resolve().then(()=>zo);d.value[f]&&d.value[f].destroy(),d.value[f]=E(m,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),d.value[f].on("accept",()=>{const C=[...r.value||[]];C[f]=t.unmask?d.value[f].unmaskedValue:d.value[f].value,r.value=C}),d.value[f].on("complete",()=>{const C=[...r.value||[]];C[f]=t.unmask?d.value[f].unmaskedValue:d.value[f].value,r.value=C}),r.value?.[f]&&(d.value[f].value=r.value[f])}function g(m,f){if(s.value)return;const E=m.target.value??null,C=[...r.value];C[f]=t.inputType==="text"?E:Number(E),r.value=C}function y(){n.value+=1;const m=t.inputType==="text"||t.inputType==="mask"?null:0;r.value=[...r.value,m],t.inputType==="mask"&&setTimeout(()=>{const f=n.value-1;c.value[f]&&p(c.value[f],f)},0)}function w(m){if(n.value>1){d.value[m]&&(d.value[m].destroy(),delete d.value[m]),n.value-=1,r.value=r.value.filter((E,C)=>C!==m);const f={};Object.keys(d.value).forEach(E=>{const C=parseInt(E,10);C>m?f[C-1]=d.value[C]:C<m&&(f[C]=d.value[C])}),d.value=f}}return e.onMounted(()=>{if(t.inputType==="mask")for(let m=0;m<n.value;m+=1)c.value[m]&&p(c.value[m],m)}),e.onBeforeUnmount(()=>{Object.values(d.value).forEach(m=>{m&&m.destroy()})}),e.watch(()=>t.mask,m=>{t.inputType==="mask"&&Object.values(d.value).forEach(f=>{f&&f.updateOptions({mask:m,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})})}),e.watch(r,m=>{t.inputType==="mask"&&m&&m.forEach((f,E)=>{d.value[E]&&d.value[E].value!==f&&(d.value[E].value=f||"")})},{deep:!0}),(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${o.value}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"flex items-center gap-2 w-full"},[m.inputType==="mask"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",ref_for:!0,ref:C=>u(C,E-1),placeholder:m.placeholder,disabled:m.disabled,name:`${m.name}[${E-1}]`,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":m.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,C0)):(e.openBlock(),e.createElementBlock("input",{key:1,type:m.inputType,value:r.value?.[E-1],onInput:C=>g(C,E-1),placeholder:i.value,disabled:s.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":m.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,_0)),!m.disabled&&E===n.value&&m.isAdded?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",onClick:e.withModifiers(y,["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-green-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[e.createVNode(vt,{height:"18",width:"18"})])):e.createCommentVNode("",!0),!m.disabled&&n.value>1&&m.isAdded?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",onClick:e.withModifiers(C=>w(E-1),["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[e.createVNode(Pn,{height:"18",width:"18"})],8,N0)):e.createCommentVNode("",!0)]))),128))],2))}}),S0=["aria-expanded","data-focus"],M0=["placeholder","disabled","readonly"],A0={class:"max-h-full"},D0=["onClick","disabled"],T0={key:0,class:"px-3 py-2 text-sm text-stone-500"},L0={class:"flex flex-col gap-1"},$0=["onDragstart","onDrop"],I0=["disabled"],F0=["title"],O0=["disabled","onClick","aria-label"],P0={key:0,class:"text-xs text-stone-500"},R0=e.defineComponent({__name:"vs-input-array-select",props:e.mergeModels({options:{default:()=>[]},data:{default:""},api:{default:""},prefix:{default:"api"},host:{default:""},parent:{},search:{type:Boolean,default:!0},maxHeight:{default:280},start:{default:0},slot:{},disabled:{type:Boolean,default:!1},style:{},customClass:{},modelValue:{},error:{},name:{},placeholder:{default:"Оберіть значення"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["change","update:modelValue","value-selected"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=t,a=e.useModel(l,"modelValue"),r=e.ref([]),s=e.ref(n.options??[]),i=e.ref({}),c=e.ref({}),d=e.ref({keyword:"",parent:null}),u=e.ref(""),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref(null);let m=!1,f=!1;const E=e.inject("values"),C=e.computed(()=>!!n.disabled),_=e.computed(()=>n.placeholder??"Оберіть значення"),b=e.computed(()=>n.search!==!1),x=e.computed(()=>`${n.maxHeight??280}px`),D=e.computed(()=>{const F=n.parent??n.parentValue;return F?String(F):""}),S=e.computed(()=>D.value?E?.value?.[D.value]??null:null),M=F=>F==null?"__null__":String(F),O=F=>{if(!F)return"";const te=F.label??F.text??F.name??F.ua??F.en;return te?String(te):F.id!==void 0&&F.id!==null?String(F.id):""},K=F=>{const te=M(F);return c.value[te]||(c.value[te]=`array-select-${te}-${Math.random().toString(36).slice(2,8)}`),c.value[te]},U=e.computed(()=>new Set(r.value.map(F=>M(F.id)))),R=e.computed(()=>{const F=U.value;let te=[...s.value];if(!n.data&&u.value.trim()){const ae=u.value.toLowerCase();te=te.filter(_e=>O(_e).toLowerCase().includes(ae))}return te.filter(ae=>!F.has(M(ae.id)))}),q=()=>{if(!n.data)return"";const F=n.prefix??"api",te=n.api??`/${F}/suggest/${n.data}`;return`${n.host??""}${te}`},N=()=>{r.value.length&&(m=!0,r.value=r.value.map(F=>({...F,text:i.value[M(F.id)]??F.text})))},j=F=>{const te=M(F.id),ae=O(F);ae&&(i.value[te]=ae)},$=F=>{s.value=F?[...F]:[],F?.forEach(j),N()},Z=F=>{if(!F.length)return;const te=new Map(s.value.map(ae=>[M(ae.id),ae]));F.forEach(ae=>{const _e=M(ae.id);te.set(_e,ae),j(ae)}),s.value=Array.from(te.values()),N()},V=async(F="")=>{if(!n.data)return[];const te=q();if(!te)return[];const ae=new URLSearchParams;ae.set("json","1"),F&&ae.set("key",F),n.start===1&&ae.set("start","1"),S.value!==null&&S.value!==void 0&&S.value!==""&&ae.set("parent",String(S.value));try{return(await(await fetch(`${te}?${ae.toString()}`)).json())?.data??[]}catch{return[]}},oe=async F=>{if(!n.data||!F.length)return[];const te=q();if(!te)return[];const ae=Array.from(new Set(F.map(Ae=>M(Ae)))),_e=new URLSearchParams;_e.set("json","1"),_e.set("val",ae.join(",")),n.start===1&&_e.set("start","1"),S.value!==null&&S.value!==void 0&&S.value!==""&&_e.set("parent",String(S.value));try{const Ae=(await(await fetch(`${te}?${_e.toString()}`)).json())?.data??[];return Z(Ae),Ae}catch{return[]}},ee=async(F="",{force:te=!1}={})=>{if(!n.data)return;const ae=S.value??null;if(!te&&d.value.keyword===F&&d.value.parent===ae&&s.value.length>0)return;d.value={keyword:F,parent:ae};const _e=await V(F);$(_e)},H=((F,te=200)=>{let ae;return(..._e)=>{ae&&clearTimeout(ae),ae=setTimeout(()=>F(..._e),te)}})(async F=>{n.data&&await ee(F,{force:!0})},250),ie=e.ref(null),Y=async(F="click")=>{C.value||p.value||(ie.value=F,await ee(u.value.trim()),p.value=!0,await e.nextTick(),w.value?.focus())},se=()=>{p.value=!1,ie.value=null,e.nextTick(()=>{w.value?.blur()})},ue=async F=>{if(F.stopPropagation(),!C.value){if(p.value){if(ie.value==="focus"){ie.value=null;return}se();return}await Y("click")}},he=F=>{F.key==="Escape"&&se()},be=F=>{const te=F.target;y.value?.contains(te)||se()},L=F=>{if(F.key==="Escape"){F.preventDefault(),se();return}if(F.key==="Enter"){F.preventDefault();const te=R.value[0];te&&le(te)}},le=F=>{if(!F)return;const te=M(F.id);if(U.value.has(te))return;j(F);const ae={id:F.id,text:O(F)||String(F.id??""),key:K(F.id)};r.value=[...r.value,ae],T(F),u.value="",e.nextTick(()=>{w.value?.focus()})},T=F=>{const te=r.value.map(ae=>ae.id);o("value-selected",{name:n.name,value:te,option:F})},P=F=>{if(C.value)return;const te=r.value.filter(ae=>M(ae.id)!==M(F));r.value=te},X=F=>{C.value||(g.value=F)},J=F=>{if(C.value||g.value===null||g.value===F)return;const te=[...r.value],[ae]=te.splice(g.value,1);te.splice(F,0,ae),g.value=null,r.value=te},re=async()=>{const F=(Array.isArray(a.value)?[...a.value]:[]).filter(ae=>ae!=null);if(n.data&&F.length){const ae=F.filter(_e=>!i.value[M(_e)]);ae.length&&await oe(ae)}const te=F.map(ae=>({id:ae,text:i.value[M(ae)]??String(ae),key:K(ae)}));m=!0,r.value=te};e.watch(r,F=>{if(m){m=!1;return}const te=F.map(ae=>ae.id);f=!0,a.value=te,o("change",te)},{deep:!0}),e.watch(a,()=>{if(f){f=!1;return}re()},{deep:!0}),e.watch(u,F=>{!n.data||!p.value||H(F.trim())}),e.watch(C,F=>{F&&se()}),e.watch(()=>n.options,async F=>{n.data||($(F??[]),await re())},{immediate:!0,deep:!0}),e.watch(()=>n.data,async F=>{F&&(await ee(u.value.trim()),await re())},{immediate:!0});const xe=e.ref(!1);return e.watch(S,async()=>{if(n.data){if(!xe.value){xe.value=!0;return}r.value=[],await ee(u.value.trim()),await re()}}),e.onMounted(async()=>{document.addEventListener("click",be,!0),window.addEventListener("keydown",he),await re()}),e.onUnmounted(()=>{document.removeEventListener("click",be,!0),window.removeEventListener("keydown",he)}),(F,te)=>(e.openBlock(),e.createElementBlock("div",{class:"flex flex-col gap-2 w-full",ref_key:"rootRef",ref:y},[e.createElementVNode("div",{class:"relative",onClick:te[2]||(te[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white px-3","border-gray-300 hover:border-[#b3d4ff]",p.value?"border-[#2684ff] ring-1 ring-[#2684ff] shadow-[0_0_0_1px_rgba(38,132,255,0.5)]":"",C.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox","data-focus":p.value?"true":"false",onClick:ue},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:w,"onUpdate:modelValue":te[0]||(te[0]=ae=>u.value=ae),placeholder:_.value,disabled:C.value,readonly:!b.value,onFocus:te[1]||(te[1]=()=>Y("focus")),onKeydown:L,class:"flex-1 bg-transparent border-0 outline-none px-0 py-1 text-sm text-stone-900 placeholder:text-stone-400"},null,40,M0),[[e.vModelText,u.value]]),e.createElementVNode("span",{class:e.normalizeClass(["text-stone-400 transition-transform duration-150",p.value?"rotate-180":""]),"aria-hidden":"true"},[e.createVNode($l,{width:"16",height:"16"})],2)],10,S0),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute left-0 right-0 z-10 mt-1 rounded-md border border-stone-200 bg-white shadow-lg overflow-auto",style:e.normalizeStyle({maxHeight:x.value})},[e.createElementVNode("div",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:M(ae.id),type:"button",class:"w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",onClick:e.withModifiers(_e=>le(ae),["stop"]),disabled:C.value},e.toDisplayString(O(ae)),9,D0))),128)),R.value.length===0?(e.openBlock(),e.createElementBlock("p",T0," Немає варіантів ")):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(ae,_e)=>(e.openBlock(),e.createElementBlock("div",{key:ae.key,class:e.normalizeClass(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2",{"opacity-60":g.value===_e}]),draggable:"true",onDragstart:Ae=>X(_e),onDragover:te[3]||(te[3]=e.withModifiers(()=>{},["prevent"])),onDrop:Ae=>J(_e),onDragend:te[4]||(te[4]=Ae=>g.value=null)},[e.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-500 hover:text-stone-900",disabled:C.value,"aria-label":"Перетягнути"},[e.createVNode(zn,{width:"14",height:"14"})],8,I0),e.createElementVNode("div",{class:"flex-1 text-sm text-stone-900",title:ae.text},e.toDisplayString(ae.text),9,F0),e.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-400 hover:text-stone-900",disabled:C.value,onClick:e.withModifiers(Ae=>P(ae.id),["stop"]),"aria-label":`Видалити ${ae.text}`},[e.createVNode(Pn,{width:"14",height:"14"})],8,O0)],42,$0))),128)),r.value.length===0?(e.openBlock(),e.createElementBlock("p",P0,"Немає вибраних значень")):e.createCommentVNode("",!0)])],512))}}),Rl=pe(R0,[["__scopeId","data-v-cffead85"]]),z0={class:"flex items-center gap-2 w-full"},j0={class:"relative flex-1"},U0=["placeholder","disabled","onKeydown"],H0=["disabled"],q0={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},G0={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},W0={key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/50"},K0={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},Y0={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},Z0=["onClick"],J0={key:0,class:"p-4 text-sm text-gray-500"},X0=e.defineComponent({__name:"vs-input-address",props:e.mergeModels({api:{default:""},geom:{default:""},includes:{default:()=>[]},bbox:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(l,{emit:t}){const n=/{{\s*([^}]+?)\s*}}/g,o=l,a=t,{inputClass:r}=Xe(o.style),s=e.useModel(l,"modelValue"),i=e.computed({get:()=>s.value,set:S=>{s.value=S}}),c=e.ref(!1),d=e.ref([]),u=e.ref(!1),p=e.ref(null);e.watch(u,S=>{typeof document>"u"||(S?(p.value=document.body.style.overflow,document.body.style.overflow="hidden"):p.value!=null?(document.body.style.overflow=p.value,p.value=null):document.body.style.removeProperty("overflow"))}),e.onBeforeUnmount(()=>{typeof document>"u"||(p.value!=null?document.body.style.overflow=p.value:document.body.style.removeProperty("overflow"))});const g=e.computed(()=>o.placeholder??""),y=e.computed(()=>!!o.disabled),w=S=>{if(!S)return null;if(Array.isArray(S))return S;if(typeof S=="string"){const M=S.split(",").map(O=>O.trim()).filter(Boolean);return M.length!==4?null:M.map(Number)}return null},m=e.computed(()=>{const S=w(o.bbox);if(!S||S.length!==4)return null;const M=S.map(Number);return M.some(O=>Number.isNaN(O))?null:M}),f=e.computed(()=>{const S=m.value;if(!S)return"";const[M,O,K,U]=S;return`${M},${Math.max(O,U)},${K},${Math.min(O,U)}`});e.computed(()=>f.value?"1":"0");const E=e.inject("values");function C(){!y.value&&i.value.trim()&&_()}async function _(){const S=(i.value||"").trim();if(!S)return;let M=S;if(o.includes?.length&&E?.value){const K=o.includes.map(U=>E.value?.[U]).filter(Boolean);K.length&&(M=`${K.join(", ")}, ${S}`)}const O=D(M);if(O){c.value=!0;try{const K=await(await fetch(O)).json();d.value=Array.isArray(K)?K:[],u.value=!0}catch(K){console.error("Address search error:",K)}finally{c.value=!1}}}function b(){u.value=!u.value}function x(S){if(!S)return;u.value=!1;const M=parseFloat(S.lat),O={type:"Point",coordinates:[parseFloat(S.lon),M]};o.geom&&E?.value&&(E.value[o.geom]=O),a("update:geom",O)}function D(S){if(!o.api)return"";const M={value:encodeURIComponent(S),bbox:m.value?m.value.join(","):""};return o.api.replace(n,(O,K)=>M[K.trim()]??"")}return(S,M)=>(e.openBlock(),e.createElementBlock("div",z0,[e.createElementVNode("div",j0,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":M[0]||(M[0]=O=>i.value=O),placeholder:g.value,disabled:y.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[e.unref(r),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:e.withKeys(e.withModifiers(C,["prevent"]),["enter"])},null,42,U0),[[e.vModelText,i.value]]),d.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:b,title:"Show search results"},[...M[2]||(M[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:_,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:c.value||!i.value?.trim()},[c.value?(e.openBlock(),e.createElementBlock("svg",G0,[...M[4]||(M[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",q0,[...M[3]||(M[3]=[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])]))],8,H0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[u.value?(e.openBlock(),e.createElementBlock("div",W0,[e.createElementVNode("div",K0,[e.createElementVNode("div",Y0,[M[6]||(M[6]=e.createElementVNode("span",null,"Search results",-1)),e.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:M[1]||(M[1]=O=>u.value=!1),title:"Close"},[...M[5]||(M[5]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(O,K)=>(e.openBlock(),e.createElementBlock("li",{key:K,onClick:U=>x(O),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},e.toDisplayString(O.display_name),9,Z0))),128))]),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",J0," No results found "))])])):e.createCommentVNode("",!0)]))]))}}),pa=(l="")=>`${l}${Math.floor(Math.random()*1e4)}`,Q0={class:"vs-datalist space-y-3"},V0={class:"space-y-3"},eg=["onClick","disabled"],tg={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},ng=["disabled"],lg=e.defineComponent({__name:"vs-input-datalist",props:e.mergeModels({schema:{default:()=>[]},minItems:{default:0},maxItems:{default:void 0},addButtonText:{default:"Додати позицію"},emptyLabel:{default:"Немає рядків"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>Array.isArray(n.value)?n.value:[]),a=e.ref([]),r=e.computed(()=>t.schema?.map(m=>({...m,disabled:t.disabled||m.disabled}))??[]),s=e.computed(()=>r.value.map(m=>w(m))),i=e.computed(()=>t.disabled?!1:t.maxItems?o.value.length<t.maxItems:!0),c=e.computed(()=>t.disabled||o.value.length<=(t.minItems||0));e.watch(()=>o.value.length,()=>{d(),u()},{immediate:!0}),e.watch(()=>t.schema,u,{immediate:!0,deep:!0});function d(){const m=o.value.length;a.value.length<m?a.value=[...a.value,...Array.from({length:m-a.value.length},()=>pa())]:a.value.length>m&&a.value.splice(m)}function u(){if(!t.minItems||o.value.length>=t.minItems)return;const m=t.minItems-o.value.length,f=Array.from({length:m},p);n.value=[...o.value,...f]}function p(){const m={};return r.value.forEach(f=>{m[f.name]=f?.default??null}),m}function g(){i.value&&(n.value=[...o.value,p()],d())}function y(m){c.value||(n.value=o.value.filter((f,E)=>E!==m),d(),u())}function w(m){return{...m}}return(m,f)=>(e.openBlock(),e.createElementBlock("div",Q0,[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(E,C)=>(e.openBlock(),e.createElementBlock("div",{key:a.value[C],class:"flex items-center gap-3"},[e.createVNode(It,{schema:s.value,layout:"inline",navigation:!1,values:o.value[C],"onUpdate:values":_=>o.value[C]=_,"form-id":a.value[C]},null,8,["schema","values","onUpdate:values","form-id"]),e.createElementVNode("button",{type:"button",class:"h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",onClick:_=>y(C),disabled:c.value},[e.createVNode(Wt,{class:"w-5 h-5"})],8,eg)]))),128)),o.value.length===0?(e.openBlock(),e.createElementBlock("div",tg,e.toDisplayString(t.emptyLabel),1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:g,disabled:!i.value},[e.createVNode(vt,{class:"w-5 h-5"}),e.createTextVNode(" "+e.toDisplayString(t.addButtonText),1)],8,ng)]))}}),og=pe(lg,[["__scopeId","data-v-c4c0acde"]]),ag={};function rg(l,t){return e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},l.$attrs),[...t[0]||(t[0]=[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},null,-1),e.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},null,-1)])],16)}const sg=pe(ag,[["render",rg]]),ig={class:"vs-dataform space-y-4"},cg=["draggable","onDragstart","onDragover","onDragenter","onDrop"],dg={class:"flex items-center gap-2"},ug=["onClick"],pg={class:"text-sm font-medium text-gray-700"},mg={class:"flex items-center gap-2"},fg=["title","onClick","disabled"],hg=["title","onClick","disabled"],vg={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},gg=["disabled"],yg=e.defineComponent({__name:"vs-input-dataform",props:e.mergeModels({schema:{default:()=>[]},minGroups:{default:0},maxGroups:{default:void 0},addButtonText:{default:"Додати групу фільтрів"},groupLabel:{default:void 0},duplicateTitle:{default:"Дублювати групу"},removeTitle:{default:"Видалити групу"},emptyLabel:{},view:{default:"default"},collapsible:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref([]),a=e.ref([]),r=e.ref(0),s=e.ref(null),i=e.ref(null),c=e.ref(null),d=e.computed(()=>t.groupLabel??"Group"),u=e.computed(()=>t.emptyLabel??"Ще немає груп"),p=e.computed(()=>t.schema?.map(Y=>({...Y,disabled:t.disabled||Y.disabled}))??[]),g=e.computed(()=>p.value.map(Y=>O(Y))),y=e.computed(()=>t.view==="accordion"),w=e.computed(()=>!!(t.collapsible||y.value)),m=e.computed(()=>t.draggable!==!1),f=e.computed(()=>t.disabled?!1:t.maxGroups?n.value.length<t.maxGroups:!0),E=e.computed(()=>t.disabled||n.value.length<=(t.minGroups||0));e.watch(()=>n.value.length,()=>{C(),_(),b()},{immediate:!0}),e.watch(()=>t.schema,b,{immediate:!0,deep:!0}),e.watch(()=>t.view,()=>{_()},{immediate:!0});function C(){const Y=n.value.length;o.value.length<Y?o.value=[...o.value,...Array.from({length:Y-o.value.length},()=>pa())]:o.value.length>Y&&o.value.splice(Y)}function _(){const Y=n.value.length;y.value?Y===0?r.value=-1:r.value>=Y?r.value=Y-1:r.value<0&&(r.value=0):a.value.length<Y?a.value=[...a.value,...Array.from({length:Y-a.value.length},()=>!1)]:a.value.length>Y&&a.value.splice(Y)}function b(){if(!t.minGroups||n.value.length>=t.minGroups)return;const Y=t.minGroups-n.value.length,se=Array.from({length:Y},x);n.value=[...n.value,...se],_()}function x(){const Y={};return p.value.forEach(se=>{Y[se.name]=se?.default??null}),Y}function D(){f.value&&(n.value=[...n.value,x()],C(),_())}function S(Y){E.value||(n.value=n.value.filter((se,ue)=>ue!==Y),C(),y.value?r.value>=n.value.length&&(r.value=n.value.length-1):a.value.splice(Y,1),b())}function M(Y){if(t.disabled)return;const se=JSON.parse(JSON.stringify(n.value[Y]??{}));n.value=[...n.value.slice(0,Y+1),se,...n.value.slice(Y+1)],C(),y.value?r.value>Y&&(r.value+=1):a.value.splice(Y+1,0,a.value[Y]??!1)}function O(Y){return{...Y}}function K(Y){return y.value?r.value===-1&&Y===0?!1:r.value!==Y:!!a.value[Y]}function U(Y){if(w.value){if(y.value){r.value=Y;return}a.value[Y]=!a.value[Y]}}function R(Y,se){if(!m.value||t.disabled){se.preventDefault();return}s.value=Y,i.value=Y,c.value={groups:JSON.parse(JSON.stringify(n.value)),keys:[...o.value],states:[...a.value]},se.dataTransfer?.setData("text/plain",String(Y)),se.dataTransfer?.setDragImage?.(se.currentTarget,0,0)}function q(Y,se){!m.value||t.disabled||s.value!==null&&oe(Y,se)}function N(Y,se){oe(Y,se)}function j(Y){!m.value||t.disabled||ie()}function $(){c.value&&V(),s.value=null,i.value=null,c.value=null}function Z(Y,se){const ue=[...n.value],[he]=ue.splice(Y,1);ue.splice(se,0,he),n.value=ue;const be=[...o.value],[L]=be.splice(Y,1);if(be.splice(se,0,L),o.value=be,y.value)r.value===Y&&(r.value=se);else{const le=[...a.value],[T]=le.splice(Y,1);le.splice(se,0,T),a.value=le}}function V(){c.value&&(n.value=c.value.groups,o.value=c.value.keys,a.value=c.value.states,c.value=null,i.value=null)}function oe(Y,se){if(s.value===null)return;const ue=ee(Y,se);i.value=ue,H(ue)}function ee(Y,se){if(!se?.currentTarget)return Y;const ue=se.currentTarget.getBoundingClientRect(),he=se.clientY-ue.top>ue.height/2?Y+1:Y;return Math.max(0,Math.min(he,n.value.length))}function H(Y){const se=s.value;if(se===null)return;let ue=Y;if(ue>n.value.length&&(ue=n.value.length),ue===se||ue===se+1)return;const he=ue>se?ue-1:ue;Z(se,he),s.value=he,i.value=ue>se?he+1:he}function ie(){c.value=null,s.value=null,i.value=null}return(Y,se)=>(e.openBlock(),e.createElementBlock("div",ig,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(ue,he)=>(e.openBlock(),e.createElementBlock("div",{key:o.value[he],class:e.normalizeClass(["relative border border-gray-200 rounded-lg bg-white transition vs-dataform__group",[t.view==="accordion"?"overflow-hidden":K(he)?"pt-6 px-6":"p-6"]]),draggable:m.value&&!t.disabled,onDragstart:be=>R(he,be),onDragend:$,onDragover:e.withModifiers(be=>q(he,be),["prevent"]),onDragenter:e.withModifiers(be=>N(he,be),["prevent"]),onDrop:e.withModifiers(be=>j(),["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-between gap-2 border-b border-gray-100 px-4 py-3",[t.view!=="accordion"?"-mx-6 -mt-6 px-6":"",t.view!=="accordion"&&!K(he)?"rounded-t-lg":"rounded-lg"]])},[e.createElementVNode("div",dg,[m.value?(e.openBlock(),e.createBlock(zn,{key:0,class:"w-4 h-4 text-gray-400","aria-hidden":"true"})):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"rounded-full p-1 text-gray-500 transition hover:bg-gray-100",onClick:be=>U(he)},[e.createVNode($l,{class:e.normalizeClass(["h-4 w-4 transition",K(he)?"-rotate-90":"rotate-0"])},null,8,["class"])],8,ug)):e.createCommentVNode("",!0),e.createElementVNode("div",pg,e.toDisplayString(`${d.value} (${he+1})`),1)]),e.createElementVNode("div",mg,[e.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:t.duplicateTitle,onClick:be=>M(he),disabled:t.disabled,draggable:"false"},[e.createVNode(sg,{class:"w-5 h-5"})],8,fg),e.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:t.removeTitle,onClick:be=>S(he),disabled:E.value,draggable:"false"},[e.createVNode(Wt,{class:"w-5 h-5"})],8,hg)])],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(t.view==="accordion"?"p-6":"pt-6")},[e.createVNode(It,{class:"vs-dataform__form",schema:g.value,layout:"inline",navigation:!1,values:n.value[he],"onUpdate:values":be=>n.value[he]=be,"form-id":o.value[he],disabled:t.disabled},null,8,["schema","values","onUpdate:values","form-id","disabled"])],2),[[e.vShow,!K(he)]])],42,cg))),128)),n.value.length===0?(e.openBlock(),e.createElementBlock("div",vg,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:D,disabled:!f.value},[e.createVNode(vt,{class:"w-5 h-5"}),e.createTextVNode(" "+e.toDisplayString(t.addButtonText),1)],8,gg)]))}}),kg=pe(yg,[["__scopeId","data-v-473b9d69"]]),qn="__vs_form_monaco_loader__",bg=e.defineComponent({__name:"vs-input-monaco",props:e.mergeModels({syntax:{default:"xml"},theme:{default:"vs-light"},height:{default:280},minimap:{type:Boolean,default:!1},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(null),a=e.computed(()=>typeof t.height=="number"?`${t.height}px`:t.height||"280px");let r=null,s=null,i=!1;const c=()=>{if(s)return Promise.resolve(s);if(typeof window>"u")return Promise.resolve(null);const u=window;if(u.monaco?.editor?.create)return s=u.monaco,Promise.resolve(s);if(u[qn])return u[qn];const p=(async()=>{const g=m=>{if(Array.from(document.styleSheets||[]).some(E=>E?.href?.includes(m)))return;const f=document.createElement("link");f.rel="stylesheet",f.href=m,document.head.appendChild(f)},y=m=>new Promise((f,E)=>{if(Array.from(document.scripts).some(_=>_.src===m))return f();const C=document.createElement("script");C.src=m,C.async=!0,C.onload=()=>f(),C.onerror=_=>E(_),document.body.appendChild(C)}),w="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";return g(`${w}/editor/editor.main.min.css`),await y(`${w}/loader.min.js`),new Promise((m,f)=>{window.require.config({paths:{vs:w}}),window.require(["vs/editor/editor.main"],()=>{s=window.monaco,u.monaco=s,m(s)},E=>f(E))})})().catch(g=>{throw delete u[qn],g});return u[qn]=p,p},d=()=>{!o.value||!s||(r&&(r.dispose(),r=null),r=s.editor.create(o.value,{value:n.value||"",language:t.syntax,theme:t.theme,automaticLayout:!0,minimap:{enabled:!!t.minimap},readOnly:!!t.disabled}),r.onDidChangeModelContent(()=>{i||(n.value=r.getValue())}))};return e.watch(()=>n.value,u=>{if(!r)return;const p=r.getValue();u!==p&&(i=!0,r.setValue(u||""),i=!1)}),e.watch(()=>t.syntax,u=>{!r||!s||s.editor.setModelLanguage(r.getModel(),u||"xml")}),e.watch(()=>t.theme,u=>{s&&s.editor.setTheme(u||"vs-light")}),e.watch(()=>t.disabled,u=>{r&&r.updateOptions({readOnly:!!u})}),e.watch(()=>t.minimap,u=>{r&&r.updateOptions({minimap:{enabled:!!u}})}),e.onMounted(async()=>{try{const u=await c();if(!u||!u.editor)return;s=u,d()}catch(u){console.error("Failed to load Monaco editor",u)}}),e.onBeforeUnmount(()=>{r&&(r.dispose(),r=null)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full",style:e.normalizeStyle({height:a.value})},[e.createElementVNode("div",{ref_key:"editorContainer",ref:o,class:"w-full h-full overflow-hidden border border-[#CFD9E0] rounded"},null,512)],4))}}),xg={VsInputText:sn,VsInputRadio:aa,"vs-input-text":sn,"vs-input-password":Fd,"vs-input-textarea":rf,"vs-input-richtext":cf,"vs-input-mask":Il,"vs-input-number":Rd,"vs-input-radio":aa,"vs-input-select":ua,"vs-input-switcher":ta,"vs-input-static":na,"vs-input-container":Om,"vs-input-date":$u,"vs-input-checkbox":Tu,"vs-input-file":wp,"vs-input-file2":Ol,file2:Ol,File2:Ol,"vs-input-html":na,"vs-input-email":la,"vs-input-tel":oa,"vs-input-datatable":ih,"vs-input-map":Nv,"vs-input-file-list":pm,"vs-input-tags":Fv,"vs-input-slug":zv,"vs-input-codegen":Kv,"vs-input-key-value":o0,"vs-input-text[]":h0,"vs-input-range":E0,"vs-input-color":k0,"vs-input-native-select":ua,VsInputArraySelect:Rl,"vs-input-array":B0,"vs-input-array-select":Rl,"array-select":Rl,"vs-input-address":X0,"vs-input-datalist":og,"vs-input-dataform":kg,"vs-input-monaco":bg},wg=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const t=l,n=e.inject("values");async function o(){try{if(!t.api)return;const a=t.api.replace("{{value}}",t.value),r=await fetch(a);if(!r.ok){fe.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const s=await r.json();if(!t.set||!n)return;for(const[i,c]of Object.entries(t.set))n.value[i]=s.result[c]}catch(a){console.error(t.error,a)}}return(a,r)=>(e.openBlock(),e.createElementBlock("button",{onClick:o,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(a.button),1))}}),Eg={class:"flex flex-col gap-1 w-full"},Cg=["innerHTML"],ma=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:e.mergeModels(["value-selected"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=e.useModel(l,"modelValue"),a=t,r=e.computed(()=>$d[`${n.layout}`]),s=["label","placeholder","info","description","text","html"],i=e.ref(E()),c=e.computed(()=>w(n.item,i.value)),d=e.computed(()=>xg?.[`vs-input-${n.item.type}`]),u=e.inject("field-props"),p=e.computed(()=>{const _=e.unref(d);if(!_)return new Set;const b=_.props??_.__vccOpts?.props;if(!b)return new Set;const x=Array.isArray(b)?b:Object.keys(b);return new Set(x)}),g=e.computed(()=>{const _={...c.value??{}},b=n.item?.name;b&&u?.value?.[b]&&Object.assign(_,u.value[b]);const x=p.value;return x.size?Object.fromEntries(Object.entries(_).filter(([D])=>x.has(D))):{}}),y=_=>{const b=typeof _=="object"&&_!==null?_:{value:_};a("value-selected",{...b,name:b.name??n.item?.name})};e.onMounted(()=>{i.value=E(),window.addEventListener("storage",C)}),e.onUnmounted(()=>{window.removeEventListener("storage",C)});function w(_,b){if(!_)return{};const x={..._};return s.forEach(D=>{const S=f(_,D,b);S!=null&&(x[D]=S)}),Array.isArray(_.options)&&(x.options=_.options.map(D=>m(D,b))),x}function m(_,b){if(!_)return _;const x={..._},D=f(_,"label",b),S=f(_,"text",b);return D!=null&&(x.label=D),S!=null?x.text=S:D!=null&&(x.text=D),x}function f(_,b,x){const D=`${b}:${x}`;if(_?.[D]!=null)return _[D];if(b==="label"&&_?.[x]!=null)return _[x];if(_?.[b]!=null)return _[b];if(b==="label"){if(_?.ua!=null)return _.ua;if(_?.en!=null)return _.en}if(b==="text"||b==="html"){if(_?.ua!=null)return _.ua;if(_?.en!=null)return _.en}return null}function E(){return typeof window>"u"?"uk":localStorage.getItem("locale")||"uk"}function C(){i.value=E()}return(_,b)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{ua:c.value.ua,error:n.error||"",item:c.value,columns:n.columns,label:c.value.label},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${n.item.type}-component`])},[e.createElementVNode("div",Eg,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps(g.value,{modelValue:o.value,"onUpdate:modelValue":b[0]||(b[0]=x=>o.value=x),onValueSelected:y}),null,16,["modelValue"])),c.value.description&&n.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",{key:0,class:"text-sm text-gray-500",innerHTML:c.value.description},null,8,Cg)):e.createCommentVNode("",!0)]),c.value.behavior?.api&&c.value.behavior?.button?(e.openBlock(),e.createBlock(wg,e.mergeProps({key:0},c.value.behavior,{value:o.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]),_:1},8,["ua","error","item","columns","label"]))}}),_g={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},Ng={class:"vs-compact-form-navigation__rail mt-[6px]"},Bg=["onClick"],Sg=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(l,{expose:t}){const n=l,o=e.ref([]),a=e.ref(""),r=e.ref(""),s=e.computed(()=>!!n.enabled),i=e.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),c=e.computed(()=>{const U=n.width;if(U==null)return{};const R=typeof U=="number"?`${U}px`:`${U}`;return{width:R,minWidth:R}});let d=null,u=0,p=0,g=null,y=null,w=null;const m=()=>O(),f=()=>C();e.watch(()=>n.target,async U=>{if(D(),!U){g=null,o.value=[],a.value="";return}g=U,s.value&&(await e.nextTick(),x(U),C())},{immediate:!0}),e.watch(()=>n.scrollContainer,U=>{if(!s.value){y=U??null;return}E(U??null),e.nextTick(()=>C())},{immediate:!0}),e.onMounted(()=>{n.scrollContainer||E(null),C()}),e.onBeforeUnmount(()=>{D(),E(null,!0),g=null,typeof window<"u"&&(u&&window.cancelAnimationFrame(u),p&&window.cancelAnimationFrame(p))});function E(U,R=!1){if(w&&(w(),w=null),R){y=null;return}if(y=U??null,typeof window>"u")return;const q=U??window,N=window;q.addEventListener("scroll",m,{passive:!0}),N.addEventListener("resize",f),w=()=>{q.removeEventListener("scroll",m),N.removeEventListener("resize",f)}}function C(){if(!s.value||!g)return;u&&typeof window<"u"&&window.cancelAnimationFrame(u);const U=()=>{_(),u=0};typeof window>"u"?U():u=window.requestAnimationFrame(U)}function _(){if(!s.value||!g)return;const U=Array.from(g.querySelectorAll("h1, h2")),R=new Set,q=[];U.forEach((N,j)=>{const $=N.textContent?.trim()??"";if(!$)return;let Z=(N.getAttribute("id")??"").trim();Z||(Z=b($)||`heading-${j+1}`);let V=Z,oe=1;for(;R.has(V);)V=`${Z}-${oe+=1}`;N.id!==V&&Object.assign(N,{id:V}),R.add(V),q.push({id:V,text:$,level:N.tagName.toLowerCase()==="h1"?1:2})}),o.value=q,q.length||(a.value=""),M()}function b(U){return U.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function x(U){!U||!s.value||typeof MutationObserver>"u"||(D(),d=new MutationObserver(()=>C()),d.observe(U,{childList:!0,subtree:!0}))}function D(){d&&(d.disconnect(),d=null)}function S(U){const R=y;if(!R)return typeof window>"u"?U.offsetTop:U.getBoundingClientRect().top+window.scrollY;const q=U.getBoundingClientRect(),N=R.getBoundingClientRect();return q.top-N.top+R.scrollTop}function M(){if(!s.value||!o.value.length)return;const U=y,R=(U?U.scrollTop:null)||(typeof window<"u"?window.scrollY:0),q=(U?U.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),N=R+q;let j=null;for(let Z=0;Z<o.value.length;Z+=1){const V=o.value[Z],oe=document.getElementById(V.id);if(oe){const ee=S(oe);ee+oe.offsetHeight>R&&ee<N&&(j=V.id)}}!j&&r.value&&(j=r.value),j&&(r.value=j);const $=U?U.scrollHeight-U.clientHeight:document.documentElement.scrollHeight-window.innerHeight;R+5>=$&&(j=o.value[o.value.length-1].id),j&&(a.value=j)}function O(){s.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{M(),p=0}))}function K(U){if(!s.value)return;const R=document.getElementById(U);if(!R)return;const q=y,N=Math.max(0,S(R));q?q.scrollTo({top:N,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:N,behavior:"smooth"})}return t({refresh:C}),(U,R)=>s.value&&o.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(c.value)},[e.createElementVNode("h2",_g,e.toDisplayString(U.title),1),e.createElementVNode("div",Ng,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.id,class:e.normalizeClass(["vs-compact-form-navigation__item relative",q.level===2?"vs-compact-form-navigation__item--nested":"",q.id===a.value?"vs-compact-form-navigation__item--active":""])},[e.createElementVNode("button",{type:"button",onClick:N=>K(q.id),class:e.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",q.level===2?"pl-[15px]":"pl-[18px]",q.id===a.value?"text-gray-800":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(q.text),1)],10,Bg)],2))),128))])],6)):e.createCommentVNode("",!0)}}),Mg=pe(Sg,[["__scopeId","data-v-b3e16a91"]]),$t={required:"Це поле є обов’язковим",email:"Неправильний email",tel:"Неправильний телефон",minlength:l=>`Мінімальна довжина — ${l} символів`,maxlength:l=>`Максимальна довжина — ${l} символів`},Ag=l=>typeof l=="string"?l.trim()?!1:$t.required:Array.isArray(l)?l.map(t=>typeof t=="string"?t.trim():t).filter(t=>t!=null&&t!=="").length?!1:$t.required:l?!1:$t.required,Dg=l=>l?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?!1:$t.email:!1,Tg=l=>l?/^\+[1-9]\d{1,14}$/.test(l)?!1:$t.tel:!1,fa=l=>l==null?0:typeof l=="string"?l.trim().length:Array.isArray(l)?l.length:typeof l=="number"?l.toString().length:String(l).length,Lg=(l,t)=>{if(l==null)return!1;const n=Number(t?.value??t?.length);return Number.isFinite(n)&&fa(l)<n?t?.message||$t.minlength(n):!1},$g=(l,t)=>{if(l==null||l==="")return!1;const n=Number(t?.value??t?.length);return Number.isFinite(n)&&fa(l)>n?t?.message||$t.maxlength(n):!1},Ig=(l,t)=>{const n=t.pattern??t.regexp,o=typeof n=="string"?new RegExp(n):n;if(Array.isArray(l)){const a=l.filter(Boolean);return a.length===0||a.every(r=>o.test(r))?!1:t.message}return!o.test(l)&&l?t.message:!1},Fg=(l,t)=>!1,Og=(l,t)=>{switch(typeof t=="string"?t:t.type){case"required":return Ag(l);case"email":return Dg(l);case"tel":return Tg(l);case"regexp":return Ig(l,t);case"minlength":return Lg(l,t);case"maxlength":return $g(l,t);case"custom":return Fg();default:return!1}},Pg={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file",dropzone:"file"};function ha(l){const t=l?.toLowerCase();return Pg[t]||t}function zl(l,t=!1){if(Array.isArray(l)){const o=[];return l.forEach(a=>{const r={...a};r.name=(a.name||a.id||a.key||"").toString(),r.type=ha(a.type),r.label=a.label||a.ua,r.rules=a.rules||a.validators,r.type==="email"&&!r.rules&&(r.rules=["email"]),a.data&&(r.api=`/api/suggest/${a.data}`),r.disabled=r.disabled||t,Array.isArray(r.schema)&&(r.schema=zl(r.schema,r.disabled)),o.push(r)}),o}const n=[];return Object.entries(l).forEach(o=>{const a={name:o[0],...o[1],type:ha(o[1].type),label:o[1].label||o[1].ua,rules:o[1].rules||o[1].validators,disabled:o[1].disabled||t};a.type==="email"&&!a.rules&&(a.rules=["email"]),o[1].type?.includes("list")&&(a.multiple=!0),!a.api&&o[1].data&&(a.api=`/api/suggest/${o[1].data}`),Array.isArray(a.schema)&&(a.schema=zl(a.schema,a.disabled)),n.push(a)}),n}function Rg(l,t,n=!1){const o=e.computed(()=>zl(t,typeof n=="boolean"?n:n.value)),a=e.ref({});function r(c){const d=c?.conditions;if(!d)return!0;const u=Array.isArray(d)?d[0]:d,p=l?.value?.[u];return da(p,d)}const s=(c=o.value,d=!0)=>(c.forEach(u=>{const p=[],g=Number(u?.minlength),y=Number(u?.maxlength);!Number.isNaN(g)&&Number.isFinite(g)&&p.push({type:"minlength",value:g}),!Number.isNaN(y)&&Number.isFinite(y)&&p.push({type:"maxlength",value:y});const w=[...p,...u.rules||[]];if(w.length){if(!r(u)){delete a.value[u.name];return}let m=!1,f=null;w.forEach(E=>{const C=Og(l.value[u.name],E);C&&(m=!0,!f&&typeof C=="string"&&(f=C))}),m&&f?a.value[u.name]=f:delete a.value[u.name]}u.schema&&s(u.schema,!1)}),d&&Object.values(a.value).some(Boolean)?a.value:null),i=e.computed(()=>o.value?.filter(c=>c.hidden!==!0&&r(c)));return{errors:a,validate:s,reset:()=>{l.value={},a.value={}},visibleSchema:i}}const zg={class:"flex w-full h-full min-h-0 gap-6"},jg={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},It=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},modelValue:{default:()=>({})},modelModifiers:{},values:{default:void 0},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue","value-selected"],["update:form","update:modelValue","update:values"]),setup(l,{expose:t,emit:n}){const o=n,a=l,r=e.useModel(l,"form"),s=e.useModel(l,"modelValue"),i=e.useModel(l,"values"),c=e.computed({get:()=>i.value??s.value,set:R=>{s.value=R,i.value=R}}),{errors:d,validate:u,reset:p,visibleSchema:g}=Rg(c,a.schema,e.toRef(a,"disabled")),y=e.ref(null),w=e.ref(null),m=e.ref({}),f=e.computed(()=>a.navigation),E=e.computed(()=>a.navWidth),C=e.computed(()=>a.style?.columns),_=Object.freeze({container:12,label:3}),b=e.computed(()=>a.columns??C.value??_),x=e.computed(()=>a.columns!=null||C.value!=null),D=e.computed(()=>x.value?"horizontal":a.layout),S=R=>R?.columns?"horizontal":D.value,M=R=>R?.columns??b.value,O=()=>{o("update:modelValue",c.value),u(),o("handle-submit",c.value)},K=R=>{o("value-selected",R)};t({validate:u,reset:p,errors:d}),e.onMounted(()=>{r.value={value:c.value,errors:d.value,reset:p,validate:u,formId:a.formId}});function U(R,q){if(R===q)return!0;if(typeof R!="object"||typeof q!="object"||!R||!q)return!1;const N=Object.keys(R),j=Object.keys(q);return N.length!==j.length?!1:N.every($=>R[$]===q[$])}return e.provide("form",r),e.provide("values",c),e.provide("field-props",m),(R,q)=>(e.openBlock(),e.createElementBlock("div",zg,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:w},[e.createElementVNode("form",{ref_key:"formRef",ref:y,onSubmit:e.withModifiers(O,["prevent"]),class:e.normalizeClass(["grid grid-cols-12 p-1",D.value==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:N.name,class:e.normalizeClass(S(N)==="horizontal"?"col-span-12":`col-span-${N.col||12}`)},[e.createVNode(ma,{style:e.normalizeStyle(R.style),item:N,layout:S(N),columns:M(N),"model-value":c.value[N.name],"onUpdate:modelValue":$=>{const Z=c.value[N.name];U(Z,$)||(c.value[N.name]=$)},error:e.unref(d)[N.name],onValueSelected:K},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),S(N)==="settings"&&j+1!==e.unref(g).length?(e.openBlock(),e.createElementBlock("div",jg)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(Mg,{target:y.value,"scroll-container":w.value,enabled:f.value,width:E.value},null,8,["target","scroll-container","enabled","width"])]))}}),Ug={class:"relative"},Hg={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},qg={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},Gg={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Wg={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Kg={class:"p-4 mim-h-0 h-full overflow-auto"},Yg=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{},api:{},method:{}},emits:["close","save","edit"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(n.schema),r=e.ref(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),s=e.ref({}),i=e.ref(n.token||""),c=e.ref(n.mode),d=()=>{const w=n.method?.trim().toUpperCase();return w==="GET"||w==="POST"||w==="PUT"?w:c.value==="add"?"POST":"PUT"},u=()=>{fe.notify({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`})},p=async w=>{if(w.ok){await w.json().catch(()=>({})),u(),o("save",r.value);return}if(w.status===400){const m=await w.json().catch(()=>({}));fe.notify({type:"warning",title:"Помилка валідації",message:m.message||"Некоректні дані (400)"});return}if(w.status===500){fe.notify({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"});return}fe.notify({type:"error",title:"Помилка",message:`Статус: ${w.status}`})};async function g(){const w=s.value.validate();if(w){fe.notify({type:"warning",title:"Помилка валідації",message:Object.entries(w).map(([f,E])=>`${f}: ${E}`).join(`
144
- `)});return}const m=n.api?.trim();if(m){const f=d();try{const E=await fetch(m,{method:f,headers:f==="GET"?void 0:{"Content-Type":"application/json"},body:f==="GET"?void 0:JSON.stringify(r.value)});await p(E)}catch(E){fe.notify({type:"error",title:"Помилка з’єднання",message:E.message||"Не вдалося виконати запит"})}return}if(i.value)try{const f=await fetch(`/api/table/${i.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.value)});await p(f)}catch(f){fe.notify({type:"error",title:"Помилка з’єднання",message:f.message||"Не вдалося виконати запит"})}else o("edit",r.value),y()}function y(){o("close")}return e.onMounted(async()=>{try{if(n.form&&!n.schema){const w=await fetch(`/api/template/form/${n.form}`);if(!w.ok){fe.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`});return}const m=await w.json();a.value=m.schema,m.token&&(i.value=m.token)}else if(n.token&&!n.defaultValue){i.value=n.token;const w=await fetch(`/api/form/${i.value}`);if(!w.ok){fe.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`});return}const m=await w.json();a.value=m.schema,m.data?r.value=m.data:c.value="add",m.obj&&(r.value={...r.value,...m.obj})}}catch(w){fe.notify({type:"error",title:"Error",message:w.message||"Unexpected error"}),console.error(w)}}),(w,m)=>(e.openBlock(),e.createElementBlock("div",Ug,[e.createElementVNode("div",Hg,[e.createElementVNode("div",qg,[e.createElementVNode("div",Gg,[e.createElementVNode("h3",Wg,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:y,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},[...m[2]||(m[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",Kg,[a.value?(e.openBlock(),e.createBlock(It,{key:0,schema:a.value,values:r.value,"onUpdate:values":m[0]||(m[0]=f=>r.value=f),form:s.value,"onUpdate:form":m[1]||(m[1]=f=>s.value=f)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:y,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:g,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Zg=1440*60*1e3,Jg=["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],Xg=["січ","лют","бер","квіт","трав","черв","лип","серп","вер","жовт","лист","груд"],Qg=["нд","пн","вт","ср","чт","пт","сб"];function He(l){return l instanceof Date&&!Number.isNaN(l.getTime())}const Kt=l=>new Date(l.getTime());function Ft(l){const t=Kt(l);return t.setHours(0,0,0,0),t}function dn(l){const t=Kt(l);return t.setHours(23,59,59,999),t}function jl(l){return Ft(new Date(l.getFullYear(),l.getMonth(),1))}function Ul(l){return dn(new Date(l.getFullYear(),l.getMonth()+1,0))}function Hl(l,t){const n=new Date(l),o=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const a=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,a)),n}function Vg(l,t){return Hl(l,-1)}function Gn(l,t){const n=new Date(l);return n.setFullYear(n.getFullYear()+t),n}function va(l,t){return Gn(l,-t)}function ga(l){return Ft(new Date(l.getFullYear(),0,1))}function ya(l){return dn(new Date(l.getFullYear(),11,31))}function ey(l){const t=Math.floor(l.getFullYear()/10)*10;return Ft(new Date(t,0,1))}function ty(l){const t=Math.floor(l.getFullYear()/10)*10+9;return dn(new Date(t,11,31))}const pt=l=>l.getFullYear(),Wn=l=>Math.floor(l.getFullYear()/10)*10;function ny(l){const t=[];let n=Ft(l.start);const o=Ft(l.end);for(;n<=o;)t.push(Kt(n)),n=new Date(n.getTime()+Zg);return t}function ly(l){const t=[];let n=jl(l.start);const o=Ul(l.end);for(;n<=o;)t.push(Kt(n)),n=Hl(n,1);return t}function oy(l){const t=[];let n=ga(l.start);const o=ya(l.end);for(;n<=o;)t.push(Kt(n)),n=Gn(n,1);return t}function ql(l,t=1){const n=Ft(l),o=(n.getDay()-t+7)%7;return n.setDate(n.getDate()-o),n}function ay(l,t=1){const n=ql(l,t);return n.setDate(n.getDate()+6),dn(n)}function ry(l,t,n=0){const o=ql(l,n),a=(t-n+7)%7;return o.setDate(o.getDate()+a),o}const Kn=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear()&&l.getMonth()===t.getMonth()&&l.getDate()===t.getDate(),Gl=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear()&&l.getMonth()===t.getMonth(),ka=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear(),ba=(l,t)=>!!l&&!!t&&Kn(l,t)&&l.getHours()===t.getHours(),sy=(l,t)=>!!l&&!!t&&ba(l,t)&&l.getMinutes()===t.getMinutes();function iy(l,t){const n=l.getTime();return n>=t.start.getTime()&&n<=t.end.getTime()}const un=(l,t)=>!!l&&!!t&&l.getTime()<t.getTime(),pn=(l,t)=>!!l&&!!t&&l.getTime()>t.getTime();function cy(l){const t=l.filter(n=>He(n));if(t.length)return t.reduce((n,o)=>n.getTime()>=o.getTime()?n:o)}function dy(l){const t=l.filter(n=>He(n));if(t.length)return t.reduce((n,o)=>n.getTime()<=o.getTime()?n:o)}function xa(l,t){const n=Kt(l);return typeof t.year=="number"&&n.setFullYear(t.year),typeof t.month=="number"&&n.setMonth(t.month),typeof t.date=="number"&&n.setDate(t.date),typeof t.hours=="number"&&n.setHours(t.hours),typeof t.minutes=="number"&&n.setMinutes(t.minutes),typeof t.seconds=="number"&&n.setSeconds(t.seconds),typeof t.milliseconds=="number"&&n.setMilliseconds(t.milliseconds),n}const Yn=(l,t=2)=>String(l).padStart(t,"0");function wa(l,t){return t==="wide"?Jg[l]:Xg[l]}function uy(l){return Qg[l]}const py=[{token:"LLLL",format:l=>wa(l.getMonth(),"wide")},{token:"LLL",format:l=>wa(l.getMonth(),"abbreviated")},{token:"EE",format:l=>uy(l.getDay())},{token:"yyyy",format:l=>String(l.getFullYear())},{token:"MM",format:l=>Yn(l.getMonth()+1)},{token:"dd",format:l=>Yn(l.getDate())},{token:"HH",format:l=>Yn(l.getHours())},{token:"mm",format:l=>Yn(l.getMinutes())}];function Zn(l,t){if(!He(l))return"";let n="",o=0;for(;o<t.length;){const a=py.find(r=>t.startsWith(r.token,o));a?(n+=a.format(l),o+=a.token.length):(n+=t[o],o+=1)}return n}const my={"yyyy-MM-dd":/^(\d{4})-(\d{2})-(\d{2})$/,"dd.MM.yyyy":/^(\d{2})\.(\d{2})\.(\d{4})$/,"dd.MM.yyyy HH:mm":/^(\d{2})\.(\d{2})\.(\d{4}) (\d{2}):(\d{2})$/,"HH:mm":/^(\d{2}):(\d{2})$/,"MM.yyyy":/^(\d{2})\.(\d{4})$/,yyyy:/^(\d{4})$/};function Ea(l,t){const n=my[t];if(!n){const a=new Date(l);return He(a)?a:null}const o=l.match(n);if(!o)return null;switch(t){case"yyyy-MM-dd":{const[,a,r,s]=o,i=new Date(Number(a),Number(r)-1,Number(s));return He(i)?i:null}case"dd.MM.yyyy":{const[,a,r,s]=o,i=new Date(Number(s),Number(r)-1,Number(a));return He(i)?i:null}case"dd.MM.yyyy HH:mm":{const[,a,r,s,i,c]=o,d=new Date(Number(s),Number(r)-1,Number(a),Number(i),Number(c));return He(d)?d:null}case"HH:mm":{const[,a,r]=o,s=new Date;return s.setHours(Number(a),Number(r),0,0),s}case"MM.yyyy":{const[,a,r]=o;return new Date(Number(r),Number(a)-1,1)}case"yyyy":{const[,a]=o;return new Date(Number(a),0,1)}default:return null}}const fy=["year","month","day","time","custom"],hy=e.defineComponent({emits:{elementClick:l=>He(l),left:()=>!0,right:()=>!0,heading:()=>!0},props:{headingClickable:{type:Boolean,default:!1},leftDisabled:{type:Boolean,default:!1},rightDisabled:{type:Boolean,default:!1},columnCount:{type:Number,default:7},items:{type:Array,default:()=>[]},viewMode:{type:String,required:!0,validate:l=>typeof l=="string"&&fy.includes(l)}}}),vy={class:"v3dp__heading"},gy=["disabled"],yy=["disabled"],ky={class:"v3dp__body"},by={class:"v3dp__subheading"},xy={class:"v3dp__elements"},wy=["disabled","onClick"];function Ey(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["v3dp__popout",`v3dp__popout-${l.viewMode}`]),style:e.normalizeStyle({"--popout-column-definition":`repeat(${l.columnCount}, 1fr)`}),onMousedown:t[3]||(t[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",vy,[e.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__left",disabled:l.leftDisabled,onClick:t[0]||(t[0]=e.withModifiers(s=>l.$emit("left"),["stop","prevent"]))},[e.renderSlot(l.$slots,"arrow-left",{},()=>[t[4]||(t[4]=e.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[e.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createElementVNode("path",{stroke:"none",d:"M-9 16V-8h24v24z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 0L1 4l4 4"})])],-1))],!0)],8,gy),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.headingClickable?"button":"span"),{class:"v3dp__heading__center",onClick:t[1]||(t[1]=e.withModifiers(s=>l.$emit("heading"),["stop","prevent"]))},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"heading",{},void 0,!0)]),_:3})),e.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__right",disabled:l.rightDisabled,onClick:t[2]||(t[2]=e.withModifiers(s=>l.$emit("right"),["stop","prevent"]))},[e.renderSlot(l.$slots,"arrow-right",{},()=>[t[5]||(t[5]=e.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[e.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createElementVNode("path",{stroke:"none",d:"M15-8v24H-9V-8z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M1 8l4-4-4-4"})])],-1))],!0)],8,yy)]),e.createElementVNode("div",ky,["subheading"in l.$slots?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",by,[e.renderSlot(l.$slots,"subheading",{},void 0,!0)]),t[6]||(t[6]=e.createElementVNode("hr",{class:"v3dp__divider"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xy,[e.renderSlot(l.$slots,"body",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,s=>(e.openBlock(),e.createElementBlock("button",{key:s.key,disabled:s.disabled,class:e.normalizeClass([{selected:s.selected,current:s.current},`v3dp__element__button__${l.viewMode}`]),onClick:e.withModifiers(i=>l.$emit("elementClick",s.value),["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(s.display),1)],10,wy))),128))],!0)])])],38)}const Jn=pe(hy,[["render",Ey],["__scopeId","data-v-5de7813f"]]),Cy=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l)},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(l,{emit:t}){const n=e.computed(()=>ey(l.pageDate)),o=e.computed(()=>ty(l.pageDate)),a=(d,u,p)=>!u&&!p?!0:!(u&&pt(d)<pt(u)||p&&pt(d)>pt(p)),r=e.computed(()=>oy({start:n.value,end:o.value}).map(d=>({value:d,key:String(pt(d)),display:pt(d),selected:!!l.selected&&pt(d)===pt(l.selected),disabled:!a(d,l.lowerLimit,l.upperLimit)}))),s=e.computed(()=>{const d=pt(n.value),u=pt(o.value);return`${d} - ${u}`}),i=e.computed(()=>l.lowerLimit&&(Wn(l.lowerLimit)===Wn(l.pageDate)||un(l.pageDate,l.lowerLimit))),c=e.computed(()=>l.upperLimit&&(Wn(l.upperLimit)===Wn(l.pageDate)||pn(l.pageDate,l.upperLimit)));return{years:r,heading:s,leftDisabled:i,rightDisabled:c,previousPage:()=>t("update:pageDate",va(l.pageDate,10)),nextPage:()=>t("update:pageDate",Gn(l.pageDate,10))}}});function _y(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{columnCount:3,leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,items:l.years,viewMode:"year",onLeft:l.previousPage,onRight:l.nextPage,onElementClick:t[0]||(t[0]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Ny=pe(Cy,[["render",_y]]),By=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"LLL"},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(l,{emit:t}){const n=e.computed(()=>ga(l.pageDate)),o=e.computed(()=>ya(l.pageDate)),a=e.computed(()=>u=>Zn(u,l.format)),r=(u,p,g)=>!p&&!g?!0:!(p&&un(u,jl(p))||g&&pn(u,Ul(g))),s=e.computed(()=>ly({start:n.value,end:o.value}).map(u=>({value:u,display:a.value(u),key:a.value(u),selected:!!l.selected&&Gl(l.selected,u),disabled:!r(u,l.lowerLimit,l.upperLimit)}))),i=e.computed(()=>pt(n.value)),c=e.computed(()=>l.lowerLimit&&(ka(l.lowerLimit,l.pageDate)||un(l.pageDate,l.lowerLimit))),d=e.computed(()=>l.upperLimit&&(ka(l.upperLimit,l.pageDate)||pn(l.pageDate,l.upperLimit)));return{months:s,heading:i,leftDisabled:c,rightDisabled:d,previousPage:()=>t("update:pageDate",va(l.pageDate,1)),nextPage:()=>t("update:pageDate",Gn(l.pageDate,1))}}});function Sy(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",columnCount:3,items:l.months,leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,viewMode:"month",onLeft:l.previousPage,onRight:l.nextPage,onHeading:t[0]||(t[0]=i=>l.$emit("back")),onElementClick:t[1]||(t[1]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),_:1},8,["items","leftDisabled","rightDisabled","onLeft","onRight"])}const My=pe(By,[["render",Sy]]),Ay=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"dd"},headingFormat:{type:String,required:!1,default:"LLLL yyyy"},weekdayFormat:{type:String,required:!1,default:"EE"},weekStartsOn:{type:Number,required:!1,default:1,validator:l=>typeof l=="number"&&Number.isInteger(l)&&l>=0&&l<=6},customWeekdays:{type:Array,required:!1},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1}},setup(l,{emit:t}){const n=e.computed(()=>w=>m=>Zn(m,w)),o=e.computed(()=>jl(l.pageDate)),a=e.computed(()=>Ul(l.pageDate)),r=e.computed(()=>({start:o.value,end:a.value})),s=e.computed(()=>({start:ql(o.value,l.weekStartsOn),end:ay(a.value,l.weekStartsOn)})),i=e.computed(()=>l.customWeekdays?.length===7?l.customWeekdays:null),c=e.computed(()=>{const w=l.weekStartsOn,m=i.value;if(m)return Array.from({length:7}).map((E,C)=>m[(w+C)%7]);const f=n.value(l.weekdayFormat);return Array.from(Array(7)).map((E,C)=>(w+C)%7).map(E=>ry(new Date,E,l.weekStartsOn)).map(f)}),d=(w,m,f,E)=>E?.dates?.some(C=>Kn(w,C))||E?.predicate?.(w)?!1:!m&&!f?!0:!(m&&un(w,Ft(m))||f&&pn(w,dn(f))),u=e.computed(()=>{const w=new Date,m=n.value(l.format);return ny(s.value).map(f=>({value:f,display:m(f),selected:!!l.selected&&Kn(l.selected,f),current:Kn(w,f),disabled:!l.allowOutsideInterval&&!iy(f,r.value)||!d(f,l.lowerLimit,l.upperLimit,l.disabledDates),key:n.value("yyyy-MM-dd")(f)}))}),p=e.computed(()=>n.value(l.headingFormat)(l.pageDate)),g=e.computed(()=>l.lowerLimit&&(Gl(l.lowerLimit,l.pageDate)||un(l.pageDate,l.lowerLimit))),y=e.computed(()=>l.upperLimit&&(Gl(l.upperLimit,l.pageDate)||pn(l.pageDate,l.upperLimit)));return{weekDays:c,days:u,heading:p,leftDisabled:g,rightDisabled:y,previousPage:()=>t("update:pageDate",Vg(l.pageDate)),nextPage:()=>t("update:pageDate",Hl(l.pageDate,1))}}});function Dy(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,items:l.days,viewMode:"day",onLeft:l.previousPage,onRight:l.nextPage,onHeading:t[0]||(t[0]=i=>l.$emit("back")),onElementClick:t[1]||(t[1]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),subheading:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.weekDays,(i,c)=>(e.openBlock(),e.createElementBlock("span",{key:i,class:e.normalizeClass(`v3dp__subheading__weekday__${c}`)},e.toDisplayString(i),3))),128))]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Ty=pe(Ay,[["render",Dy]]);function Ca(l,t){const n=l.getBoundingClientRect(),o={height:l.clientHeight,width:l.clientWidth},a=t.getBoundingClientRect();if(!(a.top>=n.top&&a.bottom<=n.top+o.height)){const r=a.top-n.top,s=a.bottom-n.bottom;Math.abs(r)<Math.abs(s)?l.scrollTop+=r:l.scrollTop+=s}}const Ly=e.defineComponent({components:{PickerPopup:Jn},emits:{select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},visible:{type:Boolean,required:!0},disabledTime:{type:Object,required:!1}},setup(l,{emit:t}){const n=e.ref(null),o=e.ref(null),a=e.computed(()=>l.pageDate??l.selected),r=e.ref(a.value.getHours()),s=e.ref(a.value.getMinutes());e.watch(()=>l.selected,p=>{let g=0,y=0;p&&(g=p.getHours(),y=p.getMinutes()),r.value=g,s.value=y});const i=e.computed(()=>[...Array(24).keys()].map(p=>({value:p,date:xa(new Date(a.value.getTime()),{hours:p,minutes:s.value,seconds:0}),selected:r.value===p,ref:e.ref(null)}))),c=e.computed(()=>[...Array(60).keys()].map(p=>({value:p,date:xa(new Date(a.value.getTime()),{hours:r.value,minutes:p,seconds:0}),selected:s.value===p,ref:e.ref(null)}))),d=p=>{s.value=p.value,t("select",p.date)},u=()=>{const p=i.value.find(y=>y.ref.value?.classList?.contains("selected")??!1),g=c.value.find(y=>y.ref.value?.classList?.contains("selected")??!1);p&&g&&(Ca(n.value,p.ref.value),Ca(o.value,g.ref.value))};return e.watch(()=>l.visible,p=>{p&&e.nextTick(u)}),{hoursListRef:n,minutesListRef:o,hours:r,minutes:s,hoursList:i,minutesList:c,padStartZero:p=>`0${p}`.substr(-2),selectMinutes:d,isEnabled:p=>!(l.disabledTime?.dates?.some(g=>ba(p,g)&&sy(p,g))||l.disabledTime?.predicate?.(p)),scroll:u}}}),$y={ref:"hoursListRef",class:"v3dp__column"},Iy=["disabled","onClick"],Fy={ref:"minutesListRef",class:"v3dp__column"},Oy=["disabled","onClick"];function Py(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",columnCount:2,leftDisabled:!0,rightDisabled:!0,viewMode:"time",onHeading:t[0]||(t[0]=i=>l.$emit("back"))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.padStartZero(l.hours))+":"+e.toDisplayString(l.padStartZero(l.minutes)),1)]),body:e.withCtx(()=>[e.createElementVNode("div",$y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.hoursList,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,ref_for:!0,ref:i.ref,class:e.normalizeClass([{selected:i.selected},"v3dp__element_button__hour"]),disabled:!l.isEnabled(i.date),onClick:e.withModifiers(c=>l.hours=i.value,["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(l.padStartZero(i.value)),1)],10,Iy))),128))],512),e.createElementVNode("div",Fy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.minutesList,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,ref_for:!0,ref:i.ref,class:e.normalizeClass([{selected:i.selected},"v3dp__element_button__minute"]),disabled:!l.isEnabled(i.date),onClick:e.withModifiers(c=>l.selectMinutes(i),["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(l.padStartZero(i.value)),1)],10,Oy))),128))],512)]),_:1})}const Ry=pe(Ly,[["render",Py],["__scopeId","data-v-43e01bf7"]]),Xn=["time","day","month","year"],zy=(l,t,n=void 0)=>{let o=n||new Date;const a=cy([l,o]);a&&(o=a);const r=dy([t,o]);return r&&(o=r),o};e.defineComponent({components:{YearPicker:Ny,MonthPicker:My,DayPicker:Ty,TimePicker:Ry},inheritAttrs:!1,props:{placeholder:{type:String,default:""},modelValue:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1},disabledTime:{type:Object,required:!1},upperLimit:{type:Date,required:!1},lowerLimit:{type:Date,required:!1},startingView:{type:String,required:!1,default:"day",validate:l=>typeof l=="string"&&Xn.includes(l)},startingViewDate:{type:Date,required:!1,default:()=>new Date},dayPickerHeadingFormat:{type:String,required:!1,default:"LLLL yyyy"},monthListFormat:{type:String,required:!1,default:"LLL"},weekdayFormat:{type:String,required:!1,default:"EE"},dayFormat:{type:String,required:!1,default:"dd"},inputFormat:{type:String,required:!1,default:"yyyy-MM-dd"},weekDayNames:{type:Array,required:!1},weekStartsOn:{type:Number,required:!1,default:1,validator:l=>[0,1,2,3,4,5,6].includes(l)},disabled:{type:Boolean,required:!1,default:!1},clearable:{type:Boolean,required:!1,default:!1},typeable:{type:Boolean,required:!1,default:!1},minimumView:{type:String,required:!1,default:"day",validate:l=>typeof l=="string"&&Xn.includes(l)}},emits:{"update:modelValue":l=>l==null||He(l),decadePageChanged:l=>!0,yearPageChanged:l=>!0,monthPageChanged:l=>!0,opened:()=>!0,closed:()=>!0},setup(l,{emit:t,attrs:n}){const o=e.ref("none"),a=e.ref(l.startingViewDate),r=e.ref(null),s=e.ref(!1),i=e.ref(""),c=N=>{const j=N.replace(/[a-zA-Z]/g,"0");return/0/.test(j)?j:""},d=e.computed(()=>c(l.inputFormat));let u=null,p=null;const g=()=>{u?.destroy(),u=null},y=async()=>{if(!p){const{default:N}=await Promise.resolve().then(()=>zo);p=N}return p},w=()=>{u&&u.value!==i.value&&(u.value=i.value??"")},m=async()=>{g(),!(!r.value||!d.value)&&(u=(await y())(r.value,{mask:d.value,lazy:!0,overwrite:!0}),w())};e.watchEffect(()=>{if(!i.value)return;const N=Ea(i.value,l.inputFormat);N&&(a.value=N)}),e.watchEffect(()=>{i.value=l.modelValue&&He(l.modelValue)?Zn(l.modelValue,l.inputFormat):""}),e.onMounted(()=>{d.value&&e.nextTick(()=>{m()})}),e.onBeforeUnmount(()=>{g()}),e.watch(d,N=>{N?e.nextTick(()=>{m()}):g()}),e.watch(i,()=>{w()});const f=(N="none")=>{l.disabled||(N!=="none"&&o.value==="none"&&(a.value=l.modelValue||zy(l.lowerLimit,l.upperLimit,a.value)),o.value=N,t(N!=="none"?"opened":"closed"))};e.watchEffect(()=>{l.disabled&&(o.value="none")});const E=(N,j)=>{a.value=j,N==="year"?t("decadePageChanged",j):N==="month"?t("yearPageChanged",j):N==="day"&&t("monthPageChanged",j)},C=N=>{a.value=N,l.minimumView==="year"?(f("none"),t("update:modelValue",N)):o.value="month"},_=N=>{a.value=N,l.minimumView==="month"?(f("none"),t("update:modelValue",N)):o.value="day"},b=N=>{a.value=N,l.minimumView==="day"?(f("none"),t("update:modelValue",N)):o.value="time"},x=N=>{f("none"),t("update:modelValue",N)},D=()=>{l.clearable&&(f("none"),t("update:modelValue",null),a.value=l.startingViewDate)},S=()=>s.value=!0,M=()=>f(U.value),O=()=>{s.value=!1,f()},K=N=>{const j=N.keyCode?N.keyCode:N.which;if([27,13].includes(j)&&r.value.blur(),l.typeable){const $=Ea(r.value.value,l.inputFormat);$&&i.value===Zn($,l.inputFormat)&&(i.value=r.value.value,t("update:modelValue",$))}},U=e.computed(()=>{const N=Xn.indexOf(l.startingView),j=Xn.indexOf(l.minimumView);return N<j?l.minimumView:l.startingView}),R=N=>Object.fromEntries(Object.entries(N??{}).filter(([j,$])=>j.startsWith("--"))),q=e.computed(()=>l.weekDayNames?.length===7?l.weekDayNames:void 0);return{blur:O,focus:M,click:S,input:i,inputRef:r,pageDate:a,renderView:f,updatePageDate:E,selectYear:C,selectMonth:_,selectDay:b,selectTime:x,keyUp:K,normalizedWeekdayNames:q,viewShown:o,goBackFromTimepicker:()=>l.startingView==="time"&&l.minimumView==="time"?null:o.value="day",clearModelValue:D,initialView:U,log:N=>console.log(N),variables:R}}});const _a=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:n}=fe.modal({title:l.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:Yg,contentProps:{...l,onClose:()=>{t(null),n()},onSave:o=>{t(o),n()}}})});It.install=function(l){l.component("VForm",It),Object.assign(l.config.globalProperties,{$form:_a}),l.provide("form",_a),window.v3plugin||(window.v3plugin={})};const jy={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Uy=["title"],Hy={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},qy=["onClick"],Gy=["placeholder"],Wy={class:"divide-y divide-gray-100"},Ky=["onClick"],Yy=600,Zy=30,Jy=8,Xy="https://data.softpro.ua/api-user/gis-url-proxy",Qy="https://geo.rv.ua/api-user/dzk.api",Vy="https://nominatim.openstreetmap.org/search",e1=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(l){const t=l,n=On(),o=e.getCurrentInstance();function a(){return o?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const s=!!a()?["xy","parcel","address"]:["xy","parcel"],i=e.computed(()=>{const V=t.config?.tools?.filter(oe=>s.includes(oe));return V&&V.length?V:s}),c=e.computed(()=>t.config?.placeholder?.trim()||"Пошук…"),d=e.ref(i.value[0]);e.watch(i,V=>{V.includes(d.value)||(d.value=V[0])});const u=e.ref(""),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref([]),m=e.ref(null),f=e.computed(()=>d.value==="address"&&w.value.length>0);let E=null;const C=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function _(){if(!y.value)return;const V=y.value.getBoundingClientRect(),oe=V.width+Zy,ee=V.left+window.scrollX,H=V.bottom+window.scrollY+Jy;C.left=`${ee}px`,C.top=`${H}px`,C.width=`${oe}px`,C.display="block"}const b=()=>{f.value&&_()};function x(){E&&(clearTimeout(E),E=null)}e.watch(d,()=>{u.value="",p.value=!1,w.value=[],x()}),e.watch(f,V=>{V?e.nextTick(()=>{_()}):C.display="none"}),e.watch(u,V=>{if(d.value!=="address"){w.value=[],x();return}if(!V.trim()){w.value=[],x();return}x(),E=window.setTimeout(()=>{q(V).catch(oe=>{const ee=oe?.message||"Помилка пошуку адреси";fe.notify({type:"error",title:"Пошук адреси",message:ee})})},Yy)});function D(V){d.value=V}function S(V){const oe=V.target;if(p.value){const ee=g.value;ee&&!ee.contains(oe)&&(p.value=!1)}if(f.value){const ee=m.value;ee&&!ee.contains(oe)&&(w.value=[])}}e.onMounted(()=>{window.addEventListener("click",S,!0),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",S,!0),window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),x()});function M(V){return V==="xy"?"Координати":V==="parcel"?"Кадастр":"Адреси"}function O(V){const oe=V.replace(/[,]+/g," ").trim();if(!oe)return null;const ee=oe.split(/\s+/).filter(Boolean);if(ee.length<2)return null;const H=ee.slice(0,2).map(Number);if(!H.every(L=>Number.isFinite(L)))return null;let[ie,Y]=H,se=ie,ue=Y;const he=L=>Math.abs(L)<=90,be=L=>Math.abs(L)<=180;if(!he(se)||!be(ue))if(he(ue)&&be(se))se=Y,ue=ie;else return null;return{lat:se,lng:ue}}function K(V){return(V?.items||[]).map((ee,H)=>{const ie=Number(ee?.position?.lat),Y=Number(ee?.position?.lng);return!Number.isFinite(ie)||!Number.isFinite(Y)?null:{id:String(ee?.id??H),title:ee?.title||ee?.address?.label||"Знайдений обʼєкт",lat:ie,lng:Y}}).filter(ee=>!!ee)}function U(V){const oe=V?.result||V?.data||V;if(!oe)return[];const ee=oe.geom_centroid;if(!ee||!Array.isArray(ee.coordinates))return[];const[H,ie]=ee.coordinates;return!Number.isFinite(ie)||!Number.isFinite(H)?[]:[{id:"parcel",title:oe.cadnum||oe.cad_num||"Земельна ділянка",lat:ie,lng:H}]}function R(V){return(Array.isArray(V?.features)?V.features:[]).map((ee,H)=>{const ie=ee?.geometry?.coordinates,Y=Number(ie?.[0]),se=Number(ie?.[1]);if(!Number.isFinite(se)||!Number.isFinite(Y))return null;const ue=ee?.properties||{},he=ue?.geocoding?.label||ue?.display_name||ue?.label||"Адреса";return{id:String(ue?.geocoding?.place_id||ue?.place_id||H),title:he,lat:se,lng:Y}}).filter(ee=>!!ee)}async function q(V){w.value=[],x();const oe=new URL(Vy);oe.searchParams.set("format","geojson"),oe.searchParams.set("q",V),oe.searchParams.set("addressdetails","1"),oe.searchParams.set("bounded","1");const ee=a();ee&&oe.searchParams.set("viewbox",ee);const H=await fetch(oe.toString());if(!H.ok)throw new Error(`HTTP ${H.status}`);const ie=await H.json(),Y=R(ie);if(!Y.length){fe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}w.value=Y}function N(V){$(V),w.value=[],u.value=""}function j(V){const ee=V.replace(/\s+/g,"").split(":");if(ee.length!==4)return!1;const H=[10,2,3,4];return ee.every((ie,Y)=>ie.length===H[Y]&&/^\d+$/.test(ie))}function $(V){const oe=t.config?.zoom??17;n.flyTo?.({center:[V.lng,V.lat],zoom:oe})}async function Z(){const V=u.value.trim();if(V){if(d.value==="xy"){const oe=O(V);if(!oe){fe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}$(oe),u.value="";return}if(d.value==="address"){try{await q(V)}catch(oe){const ee=oe?.message||"Помилка пошуку адреси";fe.notify({type:"error",title:"Пошук адреси",message:ee})}return}try{const oe=new URL(d.value==="here"?Xy:Qy);if(d.value==="here")oe.searchParams.set("searchtext",V);else{if(!j(V)){fe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}oe.searchParams.set("cad_num",V)}const ee=await fetch(oe.toString());if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const H=await ee.json(),ie=d.value==="here"?K(H):U(H);if(!ie.length)fe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const Y=ie[0];$(Y),u.value=""}}catch(oe){const ee=oe?.message||"Помилка пошуку";fe.notify({type:"error",title:"Пошук",message:ee})}}}return(V,oe)=>(e.openBlock(),e.createElementBlock("div",jy,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(Z,["prevent"])},[i.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:oe[0]||(oe[0]=ee=>p.value=!p.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:M(d.value)},e.toDisplayString(M(d.value)),9,Uy),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":p.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},oe[3]||(oe[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),p.value?(e.openBlock(),e.createElementBlock("div",Hy,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,ee=>(e.openBlock(),e.createElementBlock("li",{key:ee,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:H=>D(ee)},e.toDisplayString(M(ee)),9,qy))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:y,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?(e.openBlock(),e.createBlock(e.unref(Il),{key:0,modelValue:u.value,"onUpdate:modelValue":oe[1]||(oe[1]=ee=>u.value=ee),mask:"0000000000:00:000:0000",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,["modelValue"])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":oe[2]||(oe[2]=ee=>u.value=ee),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Gy)),[[e.vModelText,u.value,void 0,{trim:!0}]]),oe[4]||(oe[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),f.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:m,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(C)},[e.createElementVNode("ul",Wy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,ee=>(e.openBlock(),e.createElementBlock("li",{key:ee.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:H=>N(ee)},e.toDisplayString(ee.title),9,Ky))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),t1={class:"map-center-control"},n1=["aria-label"],l1=e.defineComponent({directives:{tooltip:fe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(l){const t=l,{map:n,ready:o}=On(),a=e.ref(null),r=e.ref(null),s=e.ref(null),i=e.ref(null);function c(w){if(Array.isArray(w)&&w.length>=2){const[m,f]=w.slice(0,2).map(E=>Number(E));return Number.isNaN(m)||Number.isNaN(f)?null:[m,f]}if(w&&typeof w=="object"){const m=w,f=m.lng??m.lon??m.long??m.x,E=m.lat??m.y;if(f!=null&&E!=null){const C=Number(f),_=Number(E);if(!Number.isNaN(C)&&!Number.isNaN(_))return[C,_]}}if(typeof w=="string"){const m=w.split(",").map(f=>Number(f.trim()));if(m.length>=2&&m.every(f=>!Number.isNaN(f)))return[m[0],m[1]]}return null}e.watch(()=>t.center,w=>{const m=c(w);m&&(a.value=m)},{immediate:!0}),e.watch(()=>t.zoom,w=>{const m=Number(w);Number.isNaN(m)||(r.value=m)},{immediate:!0}),e.watch(()=>t.targetCenter,w=>{s.value=c(w)},{immediate:!0}),e.watch(()=>t.targetZoom,w=>{const m=Number(w);i.value=Number.isNaN(m)?null:m},{immediate:!0});const d=e.computed(()=>t.targetLabel?.trim()||"Точка"),u=e.computed(()=>t.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!s.value);e.onMounted(async()=>{const w=n.value;if(w){if(!a.value){const m=w.getCenter();a.value=[m.lng,m.lat]}r.value==null&&(r.value=w.getZoom())}});function g(){const w=n.value;if(!w)return;const m=a.value||(()=>{const E=w.getCenter();return[E.lng,E.lat]})(),f=r.value??w.getZoom();w.flyTo({center:m,zoom:f})}function y(){const w=n.value;if(!w||!s.value)return;const m=i.value??r.value??w.getZoom();w.flyTo({center:s.value,zoom:m})}return(w,m)=>{const f=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",t1,[p.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(gs),{class:"w-4 h-4"})])),[[f,"Центр мапи"]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":u.value,onClick:e.withModifiers(y,["stop"])},[e.createVNode(e.unref(ks),{class:"w-4 h-4"})],8,n1)),[[f,d.value]]):e.createCommentVNode("",!0)])}}}),Na=_t(l1,[["__scopeId","data-v-bc627616"]]),o1={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},a1={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},r1=["aria-label"],s1={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},i1={class:"text-slate-900 font-semibold mb-1"},c1=["innerHTML"],d1={key:1,class:"space-y-2"},u1={class:"text-gray-500"},p1={class:"font-medium text-slate-900"},m1={key:2,class:"mt-2 flex flex-col gap-2"},f1=["href","target"],Wl="map-basemap-source",h1="map-basemap-layer",v1=20,Yt="map-katottg-geometry-source",Qn="map-katottg-geometry-line",Ot="map-geometry-source",Zt="map-geometry-fill",Jt="map-geometry-line",Vn=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(l){const t=l,n=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],r=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{},s=e.computed(()=>t.katottg!=null?t.katottg:r.katottg),i=e.computed(()=>(Array.isArray(r.basemaps)&&r.basemaps.length?r.basemaps:n).map((I,ne)=>{const ce=typeof I.url=="string"?I.url.trim():"";return ce?{key:(I.key??I.name??`base-${ne}`).trim()||`base-${ne}`,url:ce,name:I.name??I.key??`Layer ${ne+1}`}:null}).filter(I=>!!I)),c=Array.isArray(r.center)&&r.center.length>=2?[Number(r.center[0]),Number(r.center[1])]:void 0,d=typeof r.zoom=="number"?r.zoom:void 0,u=e.ref(null),p=On({container:u,center:t.center??c,zoom:t.zoom??d}),{map:g,setStyle:y,setCenter:w,setZoom:m,state:f,getOverlayConfig:E,selectedCard:C,setBasemapOptions:_,clearCard:b,addControl:x,removeControl:D,ready:S}=p,M=e.computed({get:()=>f.value.selectedBasemap??"",set:k=>{f.value.selectedBasemap=k}}),O=e.computed({get:()=>f.value.geometryVisible??!0,set:k=>{f.value.geometryVisible=k}}),K=e.computed(()=>{const k=t.height;return{height:typeof k=="number"?`${k}px`:String(k)}}),U=e.ref(!1),R=e.computed(()=>U.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),q=e.computed(()=>{const k=["w-full","h-full"];return U.value||k.push(`min-h-[${K.value.height}]`),k.join(" ")}),N=e.computed(()=>C.value),j=()=>b?.(),$=e.ref(t.center??c??null),Z=e.ref(t.zoom??d??null),V=e.computed(()=>t.center??$.value??null),oe=e.computed(()=>typeof t.zoom=="number"?t.zoom:typeof Z.value=="number"?Z.value:v1),ee=["home","fullscreen","scale","position","search"],H=e.computed(()=>!Array.isArray(t.tools)||!t.tools.length?ee:t.tools.filter(k=>ee.includes(k))),ie=k=>H.value.includes(k);e.watch([g,S],([k,A])=>{if(!(!k||!A)){if(!$.value){const I=k.getCenter();$.value=[I.lng,I.lat]}Z.value==null&&(Z.value=k.getZoom())}},{immediate:!0});const Y=e.ref(null),se=e.ref(""),ue=e.ref(null),he=k=>{if(!k)return"";const A=Number(k.lat??k[1]),I=Number(k.lng??k[0]);return!Number.isFinite(A)||!Number.isFinite(I)?"":`${I.toFixed(5)}, ${A.toFixed(5)}`},be=k=>{k?.lngLat&&(se.value=he(k.lngLat))},L=()=>{se.value=""},le=k=>{k&&(k.on("mousemove",be),k.on("mouseleave",L),ue.value=k)},T=k=>{k&&(k.off("mousemove",be),k.off("mouseleave",L),ue.value=null)},P=e.computed(()=>ie("scale"));e.watch([g,S],([k,A],[I])=>{I&&T(I),!(!k||!A)&&le(k)},{immediate:!0}),e.watch([g,S,P],([k,A,I])=>{if(Y.value&&D&&(D(Y.value),Y.value=null),!k||!A||!I)return;const ne=window?.maplibregl;ne&&(Y.value=new ne.ScaleControl({unit:"metric"}),x?.(Y.value,"bottom-left"))},{immediate:!0});const X=e.computed(()=>Array.isArray(t.legend)?t.legend.map((k,A)=>{const I=typeof k?.color=="string"?k.color.trim():"",ne=typeof k?.label=="string"?k.label.trim():"";return!I||!ne?null:{color:I,label:ne,key:`${ne}-${A}`}}).filter(k=>!!k):[]),J=e.computed(()=>Array.isArray(t.layers)&&t.layers.length?t.layers:Array.isArray(r.layers)&&r.layers.length?r.layers:[]);e.watch(i,k=>{if(_?.(k),!k.length){M.value="";return}k.some(A=>A.key===M.value)||(M.value=k[0].key)},{immediate:!0});const re=(k,A)=>{const I=k.getSource(Wl);return I&&typeof I.setTiles=="function"?(I.setTiles([A]),!0):!1},xe=k=>{if(!k)return;const A=g.value;if(A&&A.isStyleLoaded&&A.isStyleLoaded()&&re(A,k.url))return;const I=h(k.url);I&&y(I)};e.watch(M,k=>{if(!k)return;const A=i.value.find(I=>I.key===k);A&&xe(A)},{immediate:!0}),e.watch(J,k=>{p.setOverlays?.(k)},{immediate:!0,deep:!0});const F=e.ref(null);let te=0;const ae=e.computed(()=>v(F.value)),_e={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2}},Ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Re=e.ref(v(t.geom)),Ye=e.ref(B(Re.value)),dt=e.ref(!1),Qe=e.computed(()=>{if(!Ye.value)return null;const[k,A,I,ne]=Ye.value;return[(k+I)/2,(A+ne)/2]});e.ref(!1);const ht=()=>{U.value=!U.value},ze=e.ref(!1),Le=()=>{const k=g.value;if(!k||!k.isStyleLoaded())return;const A=Re.value;if(!A){wt(k);return}let I=k.getSource(Ot);I?I.setData(A):(k.addSource(Ot,{type:"geojson",data:A}),je(k),I=k.getSource(Ot)),ut(k,O.value?"visible":"none"),z(),G(),Ye.value&&(dt.value||!ze.value)&&(k.fitBounds(Ye.value,{padding:40,maxZoom:16,duration:0}),ze.value=!0,dt.value=!1)},je=k=>{const A=_e;k.getLayer(Zt)||k.addLayer({id:Zt,type:"fill",source:Ot,paint:A.fill}),k.getLayer(Jt)||k.addLayer({id:Jt,type:"line",source:Ot,paint:A.line})},wt=k=>{[Jt,Zt].forEach(A=>{k.getLayer(A)&&k.removeLayer(A)}),k.getSource(Ot)&&k.removeSource(Ot)},ut=(k,A)=>{[Jt,Zt].forEach(I=>{k.getLayer(I)&&k.setLayoutProperty(I,"visibility",A)})},z=()=>{const k=g.value;if(!k||!k.isStyleLoaded())return;const A=_e;k.getLayer(Zt)&&Object.entries(A.fill).forEach(([I,ne])=>{k.setPaintProperty(Zt,I,ne)}),k.getLayer(Jt)&&Object.entries(A.line).forEach(([I,ne])=>{k.setPaintProperty(Jt,I,ne)})},Q=k=>{k.getLayer(Qn)||k.addLayer({id:Qn,type:"line",source:Yt,layout:{visibility:"visible"},paint:Ae})},G=()=>{const k=g.value;if(!k)return;const A=ae.value??{type:"FeatureCollection",features:[]};if(!k.getSource(Yt)){k.addSource(Yt,{type:"geojson",data:A}),Q(k);return}const I=k.getSource(Yt);I&&typeof I.setData=="function"&&I.setData(A),Q(k)},W=k=>{k.getLayer(Qn)&&k.removeLayer(Qn),k.getSource(Yt)&&k.removeSource(Yt)},ve=async k=>{const A=typeof k=="string"?k.trim():"",I=++te;if(!A){F.value=null;return}try{const ne=await fetch(`https://data.gki.com.ua/api-user/atu/${A}`);if(te!==I)return;if(!ne.ok){F.value=null;return}const ce=await ne.json();if(te!==I)return;F.value=ce}catch{if(te!==I)return;F.value=null}};e.watch(s,k=>{ve(k)},{immediate:!0}),e.watch(ae,()=>{G()},{immediate:!0}),e.watch(()=>t.geom,k=>{Re.value=v(k),Ye.value=B(Re.value),ze.value=!1,dt.value=!0,Le()},{deep:!0,immediate:!0}),e.watch(O,()=>{const k=g.value;k&&k.isStyleLoaded()&&ut(k,O.value?"visible":"none")}),e.watch(g,(k,A)=>{A&&(A.off("style.load",Le),A.off("load",Le),A.off("idle",Le)),k&&(k.on("load",Le),k.on("style.load",Le),k.on("idle",Le),Le())}),e.watch(()=>t.center,k=>{!g.value||!Array.isArray(k)||k.length<2||w([k[0],k[1]])},{deep:!0}),e.watch(()=>t.zoom,k=>{!g.value||typeof k!="number"||m(k)}),e.onBeforeUnmount(()=>{Y.value&&D&&D(Y.value),ue.value?T(ue.value):g.value&&T(g.value);const k=g.value;k&&(W(k),k.off("style.load",Le))});function me(k){k&&(M.value=k)}function Ee(k){O.value=k}p.setBasemap=me,p.toggleGeometry=Ee,p.setOverlays?.(J.value);function h(k){if(k)return{version:8,sources:{[Wl]:{type:"raster",tiles:[k],tileSize:256}},layers:[{id:h1,type:"raster",source:Wl}]}}function v(k){return k?k.type==="FeatureCollection"?k:k.type==="Feature"?{type:"FeatureCollection",features:[k]}:k.type==="Polygon"||k.type==="MultiPolygon"?{type:"FeatureCollection",features:[{type:"Feature",geometry:k}]}:null:null}function B(k){if(!k?.features?.length)return null;let A=1/0,I=1/0,ne=-1/0,ce=-1/0;const Be=Ne=>{if(typeof Ne[0]=="number"){const[Ue,Ve]=Ne;A=Math.min(A,Ue),I=Math.min(I,Ve),ne=Math.max(ne,Ue),ce=Math.max(ce,Ve);return}Ne.forEach(Ue=>Be(Ue))};return k.features.forEach(Ne=>{Be(Ne.geometry.coordinates)}),A===1/0||I===1/0?null:[A,I,ne,ce]}return(k,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(R.value),style:e.normalizeStyle(U.value?void 0:K.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:e.normalizeClass(q.value)},null,2),e.createVNode(dd,{items:X.value},null,8,["items"]),ie("search")?(e.openBlock(),e.createBlock(e1,{key:0})):e.createCommentVNode("",!0),ie("home")||ie("fullscreen")?(e.openBlock(),e.createElementBlock("div",o1,[ie("home")?(e.openBlock(),e.createElementBlock("div",a1,[e.createVNode(Na,{center:V.value,zoom:oe.value},null,8,["center","zoom"]),e.createVNode(Na,{"target-center":Qe.value,"target-zoom":t.zoom,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])])):e.createCommentVNode("",!0),ie("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:ht,"aria-label":U.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},A[0]||(A[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),8,r1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",s1,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:j},A[1]||(A[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])),e.createElementVNode("div",i1,e.toDisplayString(N.value.title||"Об'єкт"),1),N.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${K.value.height}-120px)]`]),innerHTML:N.value.html},null,10,c1)):(e.openBlock(),e.createElementBlock("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value.rows,I=>(e.openBlock(),e.createElementBlock("div",{key:I.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",u1,e.toDisplayString(I.label)+":",1),e.createElementVNode("span",p1,e.toDisplayString(I.value),1)]))),128))])),N.value.actions?.length?(e.openBlock(),e.createElementBlock("div",m1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value.actions,I=>(e.openBlock(),e.createElementBlock("a",{key:I.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:I.url,target:I.target??void 0,rel:"noreferrer"},e.toDisplayString(I.label),9,f1))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(sd),ie("position")&&se.value?(e.openBlock(),e.createBlock(md,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:se.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});/**
141
+ */const Ml=De("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ns={class:"border-t pt-3 mt-4"},Bs={class:"flex gap-2"},Ss={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ms={class:"flex-1 space-y-2"},As={class:"flex justify-between items-center"},Ds={class:"flex gap-2"},Ts=["disabled"],Go=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(l,{emit:t}){const n=e.useModel(l,"isReply"),o=e.ref(""),a=t,r=()=>{o.value.trim()&&(a("sendComment",o.value),o.value="")},s=i=>{(i.ctrlKey||i.metaKey)&&i.key==="Enter"&&(i.preventDefault(),r())};return(i,c)=>(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",Bs,[e.createElementVNode("span",Ss,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Ms,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),onKeydown:s,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,o.value]]),e.createElementVNode("div",As,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Ds,[n.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:c[1]||(c[1]=d=>n.value=!1)},[e.createVNode(e.unref(Ml),{class:"h-3 w-3"}),c[2]||(c[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!o.value.trim(),onClick:r},[e.createVNode(e.unref(Wo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Ts)])])])])]))}}),Ls={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"},$s=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(l,{emit:t}){const n=t,o=e.useModel(l,"showMoreOptions"),a=e.ref(),r=e.ref(!0),s=async d=>{o.value&&a.value&&!a.value.contains(d.target)&&!r.value&&(o.value=!1),r.value=!1},i=()=>{o.value=!1,n("edit")},c=()=>{o.value=!1,n("delete")};return e.onMounted(()=>{document.addEventListener("click",s)}),e.onUnmounted(()=>{document.removeEventListener("click",s)}),(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:a},[e.createElementVNode("div",Ls,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:i},[e.createVNode(e.unref(Es),{class:"h-3 w-3 mr-2"}),u[0]||(u[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(Bl),{class:"h-3 w-3 mr-2"}),u[1]||(u[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Is={class:"space-y-2"},Fs={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Os={class:"flex-1 min-w-0 space-y-1 relative"},Ps={class:"flex items-center gap-2"},Rs={class:"font-medium text-xs"},zs={class:"text-xs text-gray-500"},js={key:0,class:"text-xs text-gray-700 leading-relaxed"},Us={class:"flex justify-between text-xs"},Hs={class:"flex items-center gap-2"},qs={key:0,class:"flex gap-2"},Ws=["disabled"],Gs={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Ks=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(l,{emit:t}){const n=t,o=l,a=e.ref(o.comment.text),r=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),s=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),i=e.ref(!1),c=e.ref(!1),d=e.ref(!1),u=e.ref(!1),p=f=>{const E=new Date,C=Math.floor((E.getTime()-f.getTime())/(1e3*60*60));return C<1?`${Math.floor((E.getTime()-f.getTime())/6e4)}m`:C<24?`${C}h`:`${Math.floor(C/24)}d`},g=()=>{u.value=!u.value,u.value?n("like",o.comment.id,"add"):n("like",o.comment.id,"delete")},y=()=>{n("edit",o.comment.id,a.value),d.value=!1},w=(f,E)=>{n("like",f,E)},m=(f,E)=>{n("edit",f,E)};return(f,E)=>{const C=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Is,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",Fs,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Os,[e.createElementVNode("div",Ps,[e.createElementVNode("span",Rs,e.toDisplayString(f.comment?.author),1),e.createElementVNode("span",zs,e.toDisplayString(p(f.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=_=>a.value=_),class:e.normalizeClass(d.value?s.value:r.value)},null,2)),[[e.vModelText,a.value]]):(e.openBlock(),e.createElementBlock("p",js,e.toDisplayString(f.comment?.text),1)),e.createElementVNode("div",Us,[e.createElementVNode("div",Hs,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",u.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=_=>g())},[e.createVNode(e.unref(vs),{class:e.normalizeClass(["h-3 w-3",u.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(f.comment?.likes),1)],2),f.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=_=>c.value=!0)},[e.createVNode(e.unref(xs),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:E[3]||(E[3]=_=>i.value=!0)},[e.createVNode(e.unref(ms),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",qs,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:E[4]||(E[4]=_=>d.value=!1)},[e.createVNode(e.unref(Ml),{class:"h-3 w-3"}),E[11]||(E[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!a.value.trim(),onClick:E[5]||(E[5]=_=>y())},[e.createVNode(e.unref(Wo),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,Ws)])):e.createCommentVNode("",!0)])]),i.value?(e.openBlock(),e.createBlock($s,{key:0,showMoreOptions:i.value,"onUpdate:showMoreOptions":E[6]||(E[6]=_=>i.value=_),onEdit:E[7]||(E[7]=_=>d.value=!0),onDelete:E[8]||(E[8]=_=>f.$emit("delete",f.comment?.id)),comment:f.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),f.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.comment?.replies,_=>(e.openBlock(),e.createBlock(C,{key:_.id,comment:_,isInside:!0,onDelete:b=>f.$emit("delete",_.id),onLike:w,onEdit:m},null,8,["comment","onDelete"]))),128)),c.value&&!f.isInside?(e.openBlock(),e.createBlock(Go,{key:0,onSendComment:E[9]||(E[9]=_=>f.$emit("reply",f.comment?.id,_)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=_=>c.value=_)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),Ys=["id"],Zs={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Tn=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(n.comments??[]);async function r(){if(!n.id)return;const p=await fetch(`/api/widget/comment/${n.id}`).then(g=>g.json());a.value=p.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}a.value.length===0&&r();const s=async p=>{n.onAddComment?n.onAddComment(p):n.id&&(await fetch(`/api/widget/comment/${n.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:p})}),await r()),o("add",p)},i=(p,g)=>{n?.onLike?.(p,g),o("like",p,g)},c=(p,g)=>{n.onReply?.(p,g),o("reply",p,g)},d=async(p,g)=>{n.onEdit?n.onEdit(p,g):n.id&&(await fetch(`/api/widget/comment/${n.id}/${p}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await r()),o("edit",p,g)},u=async p=>{n.onDelete?n.onDelete(p):n.id&&(await fetch(`/api/widget/comment/${n.id}/${p}`,{method:"DELETE"}),await r()),o("delete",p)};return(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",p.className]),id:p.id,style:e.normalizeStyle(p.style)},[p.title?(e.openBlock(),e.createElementBlock("h3",Zs,e.toDisplayString(p.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([p.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:p.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,y=>(e.openBlock(),e.createBlock(Ks,{key:y.id,comment:y,onReply:c,onLike:i,onDelete:g[0]||(g[0]=w=>u(w)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Go,{onSendComment:g[1]||(g[1]=y=>s(y))})],14,Ys))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Wt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:ws}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Cs}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:gs}]]),Js={class:"mx-auto font-sans"},Xs={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Qs={class:"relative"},Vs={class:"space-y-3"},ei={class:"flex-1 min-w-0 pb-2"},ti={class:"flex items-center gap-1.5 mb-1 mt-0.5"},ni={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},li={class:"font-medium text-xs"},oi={class:"text-xs text-gray-500"},ai={class:"space-y-1"},ri={class:"text-xs text-gray-700"},si={class:"capitalize mr-1"},ii={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"},ci={key:0,class:"flex items-center gap-1 text-xs"},di={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},ui={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},Ln=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(l){const t=l,n=e.ref(Array.isArray(t.data)?t.data:[]);n.value.length===0&&t.id&&o();async function o(){const a=await fetch(`/api/widget/history/${t.id}`);if(!a.ok)return{data:[]};const r=await a.json();r.rows.forEach(s=>{s.timestamp=new Date(s.cdate),s.id=s.entity_id,s.entityType=s.entity_type,s.entityId=s.entity_id,s.action=s.change_type,s.userId=s.change_user_id,s.userName=s.username,s.timestamp=new Date(s.cdate),s.description=s.username,s.status=s.username}),n.value=r.rows}return(a,r)=>(e.openBlock(),e.createElementBlock("div",Js,[a.title?(e.openBlock(),e.createElementBlock("h3",Xs,e.toDisplayString(a.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:a.maxHeight+"px"})},[e.createElementVNode("div",Qs,[r[0]||(r[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,s=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:s?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(Ko).get(s?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(s?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("span",ni,[e.createVNode(e.unref(Sl),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",li,e.toDisplayString(s?.userName),1),e.createElementVNode("span",oi,e.toDisplayString(s?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(s?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",ai,[e.createElementVNode("div",ri,[e.createElementVNode("span",si,e.toDisplayString(s?.action),1),s?.entityId?(e.openBlock(),e.createElementBlock("span",ii,e.toDisplayString(s?.entityId),1)):e.createCommentVNode("",!0)]),s?.changes?.[s?.entityId]?(e.openBlock(),e.createElementBlock("div",ci,[s?.changes?.[s?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",di,e.toDisplayString(s?.changes?.[s?.entityId]?.old),1)):e.createCommentVNode("",!0),s?.changes?.[s?.entityId]?.old&&s?.changes?.[s?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(us),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),s?.changes?.[s?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",ui,e.toDisplayString(s?.changes?.[s?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),pi={key:0,class:"text-xl font-semibold"},mi={class:"flex gap-1"},fi={key:0},hi={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"},vi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(l){const t=e.useModel(l,"modelValue"),n={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",o.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[o.title?(e.openBlock(),e.createElementBlock("h3",pi,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",mi,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",t.value==="list"?n.active:n.inactive]),onClick:a[0]||(a[0]=r=>t.value="list")},[e.createVNode(e.unref(ks),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",t.value==="grid"?n.active:n.inactive]),onClick:a[1]||(a[1]=r=>t.value="grid")},[e.createVNode(e.unref(hs),{class:"h-4 w-4"})],2),o.editable?(e.openBlock(),e.createElementBlock("label",fi,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:a[2]||(a[2]=r=>o.$emit("onAddFile",r))},null,32),e.createElementVNode("div",hi,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),a[3]||(a[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Al={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Wt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:fs,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:_s,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Wt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:ds,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Wt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Wt,label:"PPT"}};function Yo(l,t="en"){const n={month:"short",day:"numeric"};return new Intl.DateTimeFormat(t,n).format(l)}function Zo(l){if(l===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(l)/Math.log(t));return`${parseFloat((l/Math.pow(t,o)).toFixed(1))} ${n[o]}`}const gi={class:"space-y-0.5"},yi=["onClick"],ki=["onClick"],bi={class:"flex items-center gap-2"},xi={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},wi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Ei={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ci={class:"flex items-center gap-1"},_i=["onClick"],Ni=["onClick"],Bi=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,o=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:o.id,onClick:e.withModifiers(a=>t.$emit("openLightbox",o),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(Al)[o?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Al)[o?.ext]?.icon||e.unref(Al).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:a=>t.$emit("openLightbox",o)},[e.createElementVNode("div",bi,[e.createElementVNode("span",xi,e.toDisplayString(o?.uploaded_name||o?.name),1)])],8,ki),e.createElementVNode("div",wi,e.toDisplayString(e.unref(Zo)(o.size)),1),e.createElementVNode("div",Ei,e.toDisplayString(e.unref(Yo)(o.createdAt)),1),e.createElementVNode("div",Ci,[e.createElementVNode("button",{onClick:e.withModifiers(a=>t.$emit("download",o),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(Uo),{class:"h-3 w-3"})],8,_i),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:e.withModifiers(a=>t.$emit("delete",a,o?.file_id),["stop"])},[e.createVNode(e.unref(Bl),{class:"h-3 w-3"})],8,Ni)])],8,yi))),128))]))}}),Si={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Mi=["onClick"],Ai={class:"space-y-2"},Di={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},Ti=["src"],Li={class:"space-y-1"},$i=["title"],Ii={class:"text-xs text-gray-500 text-left"},Fi={class:"absolute top-2 right-1 flex items-center gap-1"},Oi=["onClick"],Pi=["onClick"],Ri=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,onClick:e.withModifiers(a=>t.$emit("openLightbox",o),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Ai,[e.createElementVNode("div",Di,[o.ext==="png"||o.ext==="jpg"||o.ext==="jpeg"||o.ext==="gif"||o.ext==="svg"||o.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${o?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,Ti)):(e.openBlock(),e.createBlock(e.unref(Wt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Li,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:o.uploaded_name||o.name},e.toDisplayString(o.uploaded_name||o.name),9,$i),e.createElementVNode("p",Ii,e.toDisplayString(e.unref(Yo)(o.createdAt))+", "+e.toDisplayString(e.unref(Zo)(o.size)),1)])]),e.createElementVNode("div",Fi,[e.createElementVNode("button",{onClick:e.withModifiers(a=>t.$emit("download",o),["stop"]),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"},[e.createVNode(e.unref(Uo),{class:"h-3 w-3"})],8,Oi),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e.withModifiers(a=>t.$emit("delete",a,o?.file_id),["stop"])},[e.createVNode(e.unref(Bl),{class:"h-3 w-3"})],8,Pi)])],8,Mi))),128))]))}}),zi={class:"mx-auto font-sans"},ji={key:1},$n=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(l,{emit:t}){const n=l,o=e.ref(!1),a=e.ref(null),r=e.ref(!1),s=e.ref(0),i=e.ref(n.files??[]),c=t;i.value.length===0&&E();const d=(b,x)=>{a.value=x,o.value=!0},u=()=>{a.value&&(w(a.value),a.value=null,o.value=!1)},p=e.computed(()=>Array.isArray(i.value)?i.value.map(b=>b?.file_path):[]),g=b=>{const x=p.value.findIndex(D=>D===b.file_path);x!==-1&&(r.value=!0,s.value=x)},y=b=>{n.onAddFile?n.onAddFile(b):C(b),c("add",b)},w=b=>{n.onDelete?n.onDelete(b):_(b),c("delete",b)},m=b=>{const x=document.createElement("a");x.setAttribute("download",b?.uploaded_name||b?.name),x.href=b?.file_path||b?.path,x.click()},f=e.ref("list");async function E(){if(!n.id)return;const b=await fetch(`/api/widget/file/${n.id}`).then(x=>x.json());b.rows.forEach(x=>{x.timestamp=new Date(x.cdate),x.id=x.entity_id,x.entityType=x.entity_type,x.entityId=x.entity_id,x.entityType=x.entity_type,x.action=x.change_type,x.userId=x.change_user_id,x.userName=x.username,x.timestamp=new Date(x.cdate),x.description=x.username,x.status=x.username}),i.value=b.rows}const C=async b=>{if(!(!b.target||!b.target.files||b.target.files.length===0))try{await Promise.all(Array.from(b.target.files).map(async x=>{const D=new FormData;D.append("file",x);const S=`/api/widget/file/${n.id}`,M=await fetch(S,{method:"POST",body:D});if(!M.ok)throw new Error(`HTTP error! status: ${M.status}`);return x})),await E()}catch(x){console.error("Помилка при завантаженні файлів:",x)}},_=async b=>{try{await fetch(`/api/widget/file/${n.id}/${b}`,{method:"DELETE"}),await E()}catch(x){console.error(x)}};return(b,x)=>{const D=e.resolveComponent("MessageBox"),S=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",zi,[e.createVNode(vi,{modelValue:f.value,"onUpdate:modelValue":x[0]||(x[0]=M=>f.value=M),title:n.title,onOnAddFile:x[1]||(x[1]=M=>y(M)),editable:n.editable},null,8,["modelValue","title","editable"]),i.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(b.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:b.maxHeight+"px"})},[f.value==="list"?(e.openBlock(),e.createBlock(Bi,{key:0,onDelete:d,onDownload:m,onOpenLightbox:x[2]||(x[2]=M=>g(M)),files:i.value},null,8,["files"])):e.createCommentVNode("",!0),f.value==="grid"?(e.openBlock(),e.createBlock(Ri,{key:1,onDelete:d,onDownload:m,onOpenLightbox:x[3]||(x[3]=M=>g(M)),files:i.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",ji,x[6]||(x[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(D,{modelValue:o.value,"onUpdate:modelValue":x[4]||(x[4]=M=>o.value=M),onConfirm:u,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(S,{modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=M=>r.value=M),images:p.value,"start-index":s.value},null,8,["modelValue","images","start-index"])],64)}}}),Ui={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Hi=["onClick"],qi={key:0,rel:"noreferrer",class:"relative block h-full w-full"},Wi=["src"],Gi={key:0,class:"thumb-cover"},Ki=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(l,{emit:t}){const n=t,o=e.ref(!1),a=e.ref(0),r=l,s=e.computed(()=>Array.isArray(r.items)?r.items.map(c=>c?.file_path):[]),i=c=>{const d=s.value.findIndex(u=>u===c.file_path);d!==-1&&(o.value=!0,a.value=d)};return(c,d)=>{const u=e.resolveComponent("Lightbox");return c.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.items,(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(y=>i(p),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",qi,[e.createElementVNode("img",{src:`/file/resize?filepath=${p?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,Wi),g===4&&c.items?.length>5?(e.openBlock(),e.createElementBlock("div",Gi," +"+e.toDisplayString(c.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Hi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-c.items.length),p=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+p,class:e.normalizeClass(["h-full w-full image"+(c.items.length+p-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(u,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=p=>o.value=p),images:s.value,"start-index":a.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=p=>n("delete",p))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),Yi={key:0,class:"text-xl font-semibold"},Zi={class:"flex gap-1"},Ji={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"},Xi=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Yi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Zi,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:n[0]||(n[0]=o=>t.$emit("onAddImage",o))},null,32),e.createElementVNode("div",Ji,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),n[1]||(n[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Qi={class:"w-full mx-auto font-sans",ref:"containerRef"},Vi={key:1},In=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(l,{emit:t}){const n=l,o=e.ref(n.items??[]),a=t;o.value.length===0&&c();const r=u=>{n.onAddImage?n.onAddImage(u):i(u),a("add",u)},s=u=>{const p=o.value.find(g=>g.file_path===u)?.file_id;p&&(n.onDelete?n.onDelete(p):d(p))},i=async u=>{if(!(!u.target||!u.target.files||u.target.files.length===0))try{await Promise.all(Array.from(u.target.files).map(async p=>{const g=new FormData;g.append("file",p);const y=`/api/widget/file/${n.id}`,w=await fetch(y,{method:"POST",body:g});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return p})),await c()}catch(p){console.error("Помилка при завантаженні файлів:",p)}};async function c(){if(!n.id)return;const u=await fetch(`/api/widget/file/${n.id}`).then(p=>p.json());o.value=u.rows}const d=async u=>{try{await fetch(`/api/widget/file/${n.id}/${u}`,{method:"DELETE"}),await c()}catch(p){console.error(p)}};return(u,p)=>(e.openBlock(),e.createElementBlock("div",Qi,[e.createVNode(Xi,{title:u.title,onOnAddImage:p[0]||(p[0]=g=>r(g))},null,8,["title"]),o.value.length>0?(e.openBlock(),e.createBlock(Ki,{key:0,items:o.value,onDelete:p[1]||(p[1]=g=>s(g))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",Vi,p[2]||(p[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),ec={class:"text-value"},tc={class:"text-sm text-gray-900"},nc=e.defineComponent({__name:"TextValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=t.item.value;return typeof o=="boolean"?o?"Так":"Ні":o==null?"—":String(o)});return(o,a)=>(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("span",tc,e.toDisplayString(n.value),1)]))}}),_t=(l,t)=>{const n=l.__vccOpts||l;for(const[o,a]of t)n[o]=a;return n},lc=_t(nc,[["__scopeId","data-v-34a76c89"]]),oc={class:"link-value"},ac=["href"],rc=_t(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=String(t.item.value);try{const a=new URL(o);return a.hostname+a.pathname}catch{return o}});return(o,a)=>(e.openBlock(),e.createElementBlock("div",oc,[e.createElementVNode("a",{href:String(o.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(n.value)+" ",1),a[0]||(a[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,ac)]))}}),[["__scopeId","data-v-932f028c"]]),sc={class:"date-value"},ic={class:"text-sm text-gray-900"},cc=_t(e.defineComponent({__name:"DateValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{const o=t.item.value;if(o instanceof Date)return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof o=="string"){const a=new Date(o);if(!isNaN(a.getTime()))return a.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(o)});return(o,a)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("span",ic,e.toDisplayString(n.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),dc={class:"status-value"},uc={key:0,class:"mr-1"},pc=_t(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(l){const t=l,n=e.computed(()=>{switch(String(t.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"}}),o=e.computed(()=>{switch(String(t.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(a,r)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",n.value])},[o.value?(e.openBlock(),e.createElementBlock("span",uc,[e.createElementVNode("i",{class:e.normalizeClass(o.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(a.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),mc={class:"custom-value"},fc={class:"text-sm text-gray-900"},hc=_t(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",mc,[e.renderSlot(t.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",fc,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),vc=["id"],gc={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},yc={key:1,class:"overflow-x-auto"},kc={class:"min-w-full divide-y divide-gray-200"},bc={class:"bg-white divide-y divide-gray-200"},xc={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},wc={class:"flex items-center gap-2"},Ec=["title"],Cc={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},_c={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Nc={class:"flex items-start gap-3"},Bc={key:0,class:"flex-shrink-0"},Sc={class:"flex-1 min-w-0"},Mc={class:"flex items-center gap-2 mb-2"},Ac={class:"text-sm font-medium text-gray-900"},Dc=["title"],Tc={key:3,class:"overflow-x-auto"},Lc={class:"min-w-full divide-y divide-gray-200"},$c={class:"bg-white divide-y divide-gray-200"},Ic={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Fc={class:"flex items-center gap-2"},Oc=["title"],Pc={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Dl=_t(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(l){const t=n=>{switch(n.type){case"link":return rc;case"date":return cc;case"status":return pc;case"custom":return hc;default:return lc}};return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",n.className]),id:n.id,style:e.normalizeStyle(n.style)},[n.title?(e.openBlock(),e.createElementBlock("h3",gc,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),n.view==="table"?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("table",kc,[e.createElementVNode("tbody",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("tr",{key:a.id||a.label},[e.createElementVNode("td",xc,[e.createElementVNode("div",wc,[a.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.label)+" ",1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:a.tooltip},o[0]||(o[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Ec)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Cc,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])]))),128))])])])):n.view==="grid"?(e.openBlock(),e.createElementBlock("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id||a.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Nc,[a.icon?(e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("i",{class:e.normalizeClass([a.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createElementVNode("div",Mc,[e.createElementVNode("h4",Ac,e.toDisplayString(a.label),1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:a.tooltip},o[1]||(o[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Dc)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("table",Lc,[e.createElementVNode("tbody",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,a=>(e.openBlock(),e.createElementBlock("tr",{key:a.id||a.label},[e.createElementVNode("td",Ic,[e.createElementVNode("div",Fc,[a.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.label)+" ",1),a.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:a.tooltip},o[2]||(o[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Oc)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Pc,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a)),{item:a},null,8,["item"]))])]))),128))])])]))],14,vc))}}),[["__scopeId","data-v-106790ef"]]);function Rc(){return typeof window>"u"?"":window.location?.origin??""}function Jo(){if(!(typeof window>"u"))return window.maplibregl}const Xo=Symbol("vs-widget-map");function Tl(l){if(l==null||l==="")return"";if(typeof l=="object")try{return JSON.stringify(l)}catch{return""}return String(l)}function zc(l){const t=['<div class="map-popup">'];return t.push('<div class="map-popup__body">'),l.forEach(n=>{t.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${n.label}: </span><span class="text-slate-700">${n.value}</span></div>`)}),t.push("</div></div>"),t.join("")}function jc(l){return typeof l=="string"?document.getElementById(l):"value"in l?l.value??null:l}function Qo(l){if(!l)return"";const t=l.trim();if(!t)return"";if(/^https?:\/\//i.test(t))return t;const n=Rc(),o=t.replace(/^\/+/,"");return n?`${n}/${o}`:o?`/${o}`:""}function Uc(l){const t=(l?.service??"").toLowerCase();if(t)return t;const n=(l?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(n)?"vtile":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(n)?"wms":""}function Hc(l){return l.sourceLayer||l.layer||l.service_layer||l.service_key||l.map_key||l.dataset?.layer||l.id?.toString()}function Fn(l){if(l!=null){if(typeof l=="number")return l;if(typeof l=="string"){const t=l.trim();if(!t)return;const n=Number(t);return Number.isFinite(n)?n:void 0}}}const Vo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function qc(l){const t=l?.color??Vo[0],n=(l?.colorAttr??"").trim();if(!n)return t;const o=l?.colorSet&&Object.keys(l.colorSet).length>0,a={};if(o&&l?.colorSet?Object.entries(l.colorSet).forEach(([s,i])=>{const c=typeof i=="string"?i.trim():"",d=String(s).trim();c&&d&&(a[d]=c)}):Vo.forEach((s,i)=>{a[String(i+1)]=s}),!Object.keys(a).length)return t;const r=["match",["to-string",["coalesce",["get",n],""]]];return Object.entries(a).forEach(([s,i])=>{r.push(String(s),i)}),r.push(t),r}const rn="map-highlight-source",Wc="map-highlight-fill",Gc="map-highlight-line";function Kc(l){return l?typeof l.toJSON=="function"?l.toJSON():l.geometry?{type:"Feature",geometry:l.geometry,properties:l.properties??{}}:null:null}function ea(l,t){return l?l.replace(/\{([^}]+)\}/g,(n,o)=>{const a=t?.[o];return a==null?"":String(a)}):""}function Yc(l){return new Promise((t,n)=>{if(typeof document>"u"){n(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(r=>r.src===l)){t();return}const a=document.createElement("script");a.src=l,a.async=!0,a.onload=()=>t(),a.onerror=()=>n(new Error(`Failed to load ${l}`)),document.body.appendChild(a)})}function Zc(l){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(o=>o.href===l))return;const n=document.createElement("link");n.rel="stylesheet",n.href=l,document.head.appendChild(n)}async function Jc(){return Zc("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Yc("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Jo()}function On(l){const t=e.inject(Xo,void 0);if(!l){if(!t)throw new Error("useMap() must be called inside a map provider");return t}if(t)return t;const n=e.ref(null),o=e.ref(!1),a=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),r=e.ref([]),s=e.ref([]),i=e.ref(null),c=e.ref(null),d=e.ref(null);let u=l.style??null,p=null;const g=L=>{L&&(n.value?n.value.setStyle(L):u=L)},y=()=>{a.value.overlays=s.value.map(L=>({id:L.id,name:L.config.name,visible:L.visible}))},w=L=>{const le=Array.isArray(L)?L:[];r.value=le,le.some(P=>P.key===a.value.selectedBasemap)||(a.value.selectedBasemap=le[0]?.key??"")},m=L=>{L&&s.value.forEach(le=>{le.layerIds.forEach(T=>{L.getLayer(T)&&L.removeLayer(T)}),L.getSource(le.sourceId)&&L.removeSource(le.sourceId),le.layerIds=[]})},f=()=>{const L=n.value;!L||typeof L.isStyleLoaded!="function"||!L.isStyleLoaded()||(s.value.forEach(le=>{E(L,le)}),K())},E=(L,le)=>{Uc(le.config)==="vtile"&&C(L,le)},C=(L,le)=>{const T=le.config,P=le.sourceId,X=Qo(T.url);if(!X)return;L.getSource(P)||L.addSource(P,{type:"vector",tiles:[X],minzoom:T.minzoom??0,maxzoom:T.maxzoom??24});const J=T.style??{},re=qc(J),xe=[],F={visibility:le.visible?"visible":"none"},te=Hc(T),ae={source:P,layout:F};if(te&&(ae["source-layer"]=te),(J.type??"polygon").toLowerCase()==="point"){const Ae=`${le.id}-circle`;L.getLayer(Ae)||L.addLayer({id:Ae,type:"circle",...ae,paint:{"circle-color":re,"circle-opacity":J.opacity??1,"circle-radius":J.radius??J.width??3,"circle-stroke-color":J.stroke??J.color??"#ffffff","circle-stroke-width":J.width??1}}),xe.push(Ae);const Re=J.text??J.label;if(Re){const Ye=`${le.id}-symbol`,dt=Fn(J.textSize)??10,Qe=J.textHaloColor??J.stroke??"#ffffff",ht=Fn(J.textHaloWidth)??1,ze=Fn(J.textZoom??J.pointZoom),Le={"text-color":J.textColor??"#000000","text-halo-color":Qe,"text-halo-width":ht},je={id:Ye,type:"symbol",...ae,layout:{"text-field":["coalesce",["get",Re],""],"text-size":dt,"text-anchor":"top"},paint:Le};ze!=null&&(je.minzoom=ze),L.getLayer(Ye)||L.addLayer(je),xe.push(Ye)}}else{const Ae=`${le.id}-fill`;L.getLayer(Ae)||L.addLayer({id:Ae,type:"fill",...ae,paint:{"fill-color":re,"fill-opacity":J.opacity??.5,"fill-outline-color":J.stroke??J.color??"#0ea5e9"}}),xe.push(Ae);const Re=`${le.id}-line`;L.getLayer(Re)||L.addLayer({id:Re,type:"line",...ae,paint:{"line-color":J.stroke??J.color??"#0b74c4","line-width":Fn(J.width??J.border)??1,"line-opacity":J.opacity??1}}),xe.push(Re)}le.layerIds=xe,_(L,le)},_=(L,le)=>{const T=le.visible?"visible":"none";le.layerIds.forEach(P=>{L.getLayer(P)&&L.setLayoutProperty(P,"visibility",T)})},b=L=>{const le=Array.isArray(L)?L:[];m(n.value??void 0),d.value=null,q();const T=le.map((P,X)=>{if(!P)return null;const J=Qo(P.url);if(!J)return null;const re=P.id!=null?String(P.id):`overlay-${X}`;return{id:re,config:{...P,id:re,url:J},visible:P.enabled!==!1,sourceId:`${re}-source`,layerIds:[]}}).filter(P=>!!P);s.value=T,y(),f()},x=(L,le)=>{const T=s.value.find(X=>X.id===L);if(!T)return;T.visible=le,y();const P=n.value;if(!(!P||typeof P.isStyleLoaded!="function"||!P.isStyleLoaded())){if(!T.layerIds.length){E(P,T);return}_(P,T)}},D=()=>{i.value&&(i.value.remove(),i.value=null)},S=(L,le={})=>!Array.isArray(L.popup)||!L.popup.length?[]:L.popup.map(T=>({label:T.label??T.field,value:Tl(le?.[T.field])})).filter(T=>T.label&&T.value!==void 0),M=L=>{const le=n.value;if(!le||!L?.point)return;const T=le.queryRenderedFeatures(L.point);for(const P of T){const X=P.layer?.id??P.sourceLayer;if(!X)continue;const J=ue(X);if(!J)continue;const re=S(J,P.properties??P.layer?.properties??{});if(!re.length)continue;const xe=zc(re),F=Jo();if(!F)return;const te=L.lngLat;if(c.value===X&&i.value){i.value.setLngLat(te),i.value.setHTML(xe);return}c.value=X,D(),i.value=new F.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(te).setHTML(xe).addTo(le);return}c.value=null,D()},O=()=>{c.value=null,D()},K=()=>{const L=n.value;!L||typeof L.isStyleLoaded!="function"||!L.isStyleLoaded()||L.getSource(rn)||(L.addSource(rn,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),L.addLayer({id:Wc,type:"fill",source:rn,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),L.addLayer({id:Gc,type:"line",source:rn,paint:{"line-color":"#1d4ed8","line-width":2}}))},U=L=>{const le=n.value;if(!le||typeof le.isStyleLoaded!="function"||!le.isStyleLoaded())return;K();const T=le.getSource(rn);if(!(!T||typeof T.setData!="function")){if(!L){T.setData({type:"FeatureCollection",features:[]});return}T.setData({type:"FeatureCollection",features:[L]})}},R=L=>{const le=Kc(L);le&&U(le)},q=()=>{U(null)},N=()=>{d.value=null,q()},j=L=>{if(L)return typeof L=="string"?L:L.field??L.name??L.key??L.label},$=L=>{if(L)return typeof L=="string"?L:L.label??L.title??L.field??L.name},Z=(L,le)=>!L||!L.length?[]:L.map(T=>{const P=j(T);if(!P)return null;const X=$(T),J=Tl(le?.[P]);return!X||J===""?null:{label:X,value:J}}).filter(T=>!!T),V=(L,le)=>!Array.isArray(L)||!L.length?[]:L.map(T=>{if(!T?.name)return null;const P=T.title??T.name,X=Tl(le?.[T.name]);return!P||X===""?null:{label:P,value:X}}).filter(T=>!!T),oe=(L,le)=>!Array.isArray(L)||!L.length?[]:L.map(P=>{const X=ea(P.url,le),J=P.label??P.url;return X?{label:J,url:X,target:P.target}:null}).filter(P=>!!P),ee=async(L,le)=>{const T=ea(L,le);if(!T)return null;try{const P=await fetch(T);return P.ok?await P.json():null}catch{return null}},H=async(L,le)=>{const T=le.properties??le.layer?.properties??{},P=Z(L.card?.rows,T);let X,J;if(L.card?.api){const F=await ee(L.card.api,T);F&&(typeof F.html=="string"&&F.html.trim()&&(X=F.html),Array.isArray(F.columns)&&F.columns.length&&(J=F.columns))}let re=P;if(!X&&J){const F=V(J,T);F.length&&(re=F)}if(!re.length&&!X)return null;const xe=oe(L.card?.actions,T);return{title:T?.name??L.name,rows:re,html:X,actions:xe.length?xe:void 0}},ie=async L=>{const le=n.value;if(!le||!L?.point)return;const T=le.queryRenderedFeatures(L.point);for(const P of T){const X=P.layer?.id??P.sourceLayer;if(!X)continue;const J=ue(X);if(!J||!J.card)continue;const re=await H(J,P);if(re){d.value=re,R(P);return}}d.value=null,q()},Y=()=>{const L=n.value;L&&(L.on("mousemove",M),L.on("mouseleave",O),L.on("click",ie))},se=()=>{const L=n.value;L&&(L.off("mousemove",M),L.off("mouseleave",O),L.off("click",ie),D(),q())},ue=L=>{if(L)return s.value.find(le=>le.layerIds.includes(L))?.config},he=async()=>{const L=await Jc(),le=jc(l.container);if(!L||!le)return;const T={container:le,center:l.center??[30.524,50.45],zoom:l.zoom??10,style:u??l.style??"https://demotiles.maplibre.org/style.json",attributionControl:!1,...l.mapOptions};n.value=new L.Map(T);const P=()=>{f()};p=P,n.value.on("style.load",P),n.value.on("load",()=>{o.value=!0,u&&n.value&&(n.value.setStyle(u),u=null),f(),Y()})};e.onMounted(he),e.onBeforeUnmount(()=>{se(),n.value&&p&&n.value.off("style.load",p),m(n.value??void 0),n.value?.remove(),n.value=null,o.value=!1});const be={map:n,ready:o,setStyle:g,flyTo:L=>n.value?.flyTo(L),fitBounds:(L,le)=>n.value?.fitBounds(L,le),setCenter:L=>n.value?.setCenter(L),setZoom:L=>n.value?.setZoom(L),addControl:(L,le)=>n.value?.addControl(L,le),removeControl:L=>n.value?.removeControl(L),on:(L,...le)=>n.value?.on(L,...le),off:(L,...le)=>n.value?.off(L,...le),project:L=>n.value?.project(L),unproject:L=>n.value?.unproject(L),state:a,basemapOptions:r,setOverlays:b,toggleOverlay:x,getOverlayConfig:ue,selectedCard:d,setBasemapOptions:w,clearCard:N};return e.provide(Xo,be),be}const Xc={class:"map-base-layer-menu"},Qc={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Vc={class:"flex items-center justify-between p-2 border-b"},ed={class:"p-2 border-b"},td={class:"flex items-center"},nd=["value","checked","onChange"],ld={class:"ml-2"},od={class:"p-2"},ad={class:"flex items-center"},rd=["checked"],sd=["checked","onChange"],id={class:"ml-2"},cd=e.defineComponent({__name:"LayerMenu",setup(l){const{state:t,basemapOptions:n,setBasemap:o,toggleGeometry:a,toggleOverlay:r}=On(),s=e.ref(!1),i=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>n.value),d=e.computed(()=>t.value.selectedBasemap??""),u=e.computed(()=>t.value.geometryVisible??!0),p=e.computed(()=>t.value.overlays??[]),g=m=>{o?.(m)},y=()=>{a?.(!u.value)},w=m=>{r?.(m.id,!m.visible)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",Xc,[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:f[0]||(f[0]=E=>s.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),s.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Vc,[f[3]||(f[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:f[1]||(f[1]=E=>s.value=!1)},f[2]||(f[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)]))]),e.createElementVNode("div",ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",td,[e.createElementVNode("input",{type:"radio",name:i,value:E.key,checked:d.value===E.key,onChange:C=>g(E.key)},null,40,nd),e.createElementVNode("span",ld,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",od,[e.createElementVNode("label",ad,[e.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:y},null,40,rd),f[4]||(f[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:C=>w(E)},null,40,sd),e.createElementVNode("span",id,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),dd={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},ud={class:"leading-tight"},pd=e.defineComponent({__name:"Legend",props:{items:{}},setup(l){return(t,n)=>t.items.length?(e.openBlock(),e.createElementBlock("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,o=>(e.openBlock(),e.createElementBlock("div",{key:o.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",ud,e.toDisplayString(o.label),1)]))),128))])):e.createCommentVNode("",!0)}}),md={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},fd={class:"font-mono"},hd=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("span",fd,e.toDisplayString(t.coordinates),1)]))}}),ta=e.defineComponent({__name:"vs-info-tooltip",props:{text:{}},setup(l){const t=l,n=e.ref(!1),o=e.ref({top:"0px",left:"0px"});function a(s){if(!t.text)return;const i=s.currentTarget.getBoundingClientRect();o.value={top:`${i.bottom+4}px`,left:`${Math.min(i.left,window.innerWidth-230)}px`},n.value=!0}function r(){n.value=!1}return(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{class:"inline-flex items-center",onMouseenter:a,onMouseleave:r},[e.renderSlot(s.$slots,"default",{},()=>[i[0]||(i[0]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-gray-400 cursor-help"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1))])],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[n.value&&s.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(o.value),class:"fixed z-[9999] max-w-xs p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"},e.toDisplayString(s.text),5)):e.createCommentVNode("",!0)]))],64))}}),vd={class:"w-full relative"},gd={key:0,class:"text-[14px] font-medium text-gray-900 mb-2 flex items-center gap-1"},yd={class:"opacity-100"},kd={key:0,class:"text-red-500 text-[14px]"},bd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},xd=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,n=e.computed(()=>typeof t.item?.label=="string"&&t.item.label?t.item.label:t.item?.ua||t.label||t.ua),o=e.computed(()=>!!n.value),a=e.computed(()=>!!t.item?.rules?.includes("required")),r=e.computed(()=>t.item?.info||"");return(s,i)=>(e.openBlock(),e.createElementBlock("div",vd,[o.value?(e.openBlock(),e.createElementBlock("div",gd,[e.createElementVNode("span",yd,e.toDisplayString(n.value),1),a.value?(e.openBlock(),e.createElementBlock("span",kd,"*")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(ta,{key:1,text:r.value},null,8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.mergeProps(s.$attrs,{class:{"opacity-60":s.item.disabled}})),s.error?(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(s.error),1)):e.createCommentVNode("",!0)]))}}),wd={class:"w-full relative flex flex-row items-center gap-2"},Ed={key:0,class:"text-red-500 text-[14px]"},Cd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_d=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,n=e.computed(()=>t.item?.label||t.label||t.ua),o=e.computed(()=>t.item?.info||""),a=e.computed(()=>t.columns??{container:12,label:3}),r=e.computed(()=>{const{container:d,label:u}=a.value;return!d||d<=0?0:Math.min(Math.max(u??0,0),d)/d}),s=e.computed(()=>t.item?.type==="html"||r.value<=0?!1:!!n.value),i=e.computed(()=>{if(!s.value)return{};const d=`${r.value*100}%`;return{flexBasis:d,maxWidth:d}}),c=e.computed(()=>{const{container:d,label:u}=a.value;if(!d||d<=0)return{};if(t.item?.type==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!s.value)return{flexBasis:"100%",maxWidth:"100%"};const p=Math.max(d-Math.max(u??0,0),0)/d;if(!p)return{};const g=`${p*100}%`;return{flexBasis:g,maxWidth:g}});return(d,u)=>(e.openBlock(),e.createElementBlock("div",wd,[s.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 items-center gap-1",style:e.normalizeStyle(i.value)},[e.createTextVNode(e.toDisplayString(n.value)+" ",1),d.item?.rules?.includes("required")&&n.value?(e.openBlock(),e.createElementBlock("span",Ed,"*")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(ta,{key:1,text:o.value},null,8,["text"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(c.value)},[e.renderSlot(d.$slots,"default",e.normalizeProps(e.guardReactiveProps(d.$attrs)))],4),d.error?(e.openBlock(),e.createElementBlock("span",Cd,e.toDisplayString(d.error),1)):e.createCommentVNode("",!0)]))}}),Nd={class:"w-full relative"},Bd={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Sd=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",Nd,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",Bd,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Md={class:"flex-1 min-w-0"},Ad={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Dd={class:"truncate"},Td={key:0,class:"text-red-500 text-[14px]"},Ld=["innerHTML"],$d={key:0,class:"mt-1 text-xs text-red-500"},Id=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,n=e.ref("uk");e.computed(()=>(t.item??{})?.[n.value]??t.ua??t.label??"");const o=e.computed(()=>t.item?.description??""),a=e.computed(()=>Array.isArray(t.item?.rules)&&t.item.rules.includes("required")),r=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),s=()=>{const i=typeof localStorage<"u"?localStorage.getItem("locale"):null;n.value=i||"uk"};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(n.value=localStorage.locale)}catch{}window.addEventListener("storage",s)}),e.onUnmounted(()=>{window.removeEventListener("storage",s)}),(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":i.item?.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Md,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",Ad,[e.createElementVNode("span",Dd,e.toDisplayString(i.item[n.value]||i.ua||i.label),1),a.value?(e.openBlock(),e.createElementBlock("span",Td,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:"text-xs text-slate-500 dark:text-slate-400",innerHTML:o.value},null,8,Ld)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(i.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],2)],2),r.value?(e.openBlock(),e.createElementBlock("p",$d,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)],2))}}),Fd={default:xd,horizontal:_d,inline:Sd,settings:Id};function Xe(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${l?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return l?.size==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const Od=["placeholder","disabled"],Pd=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":i[0]||(i[0]=c=>o.value=c),placeholder:r.value,disabled:a.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Od)),[[e.vModelText,o.value]])}}),Rd=["placeholder","disabled","maxlength","minlength"],sn=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??""),s=e.computed(()=>t.maxlength??void 0),i=e.computed(()=>t.minlength??void 0);function c(){typeof o.value=="string"&&(o.value=o.value.trim())}return(d,u)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":u[0]||(u[0]=p=>o.value=p),placeholder:r.value,disabled:a.value,maxlength:s.value,minlength:i.value,onBlur:c,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.customClass,e.unref(n),{"!border-red-600":d.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Rd)),[[e.vModelText,o.value]])}}),zd=["placeholder","disabled","min","max"],jd=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled);return(r,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":s[0]||(s[0]=i=>o.value=i),placeholder:r.placeholder,disabled:a.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"},min:r.min,max:r.max},null,10,zd)),[[e.vModelText,o.value]])}}),pe=(l,t)=>{const n=l.__vccOpts||l;for(const[o,a]of t)n[o]=a;return n},Ud={},Hd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function qd(l,t){return e.openBlock(),e.createElementBlock("svg",Hd,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Wd=pe(Ud,[["render",qd]]),Gd={class:"flex items-center gap-[4px]"},Kd=["value","id","disabled"],Yd=["for"],Zd={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},Jd=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=t,o=l,a=e.computed({get:()=>o.modelValue,set:s=>n("update:modelValue",s)}),r=e.computed(()=>!!o.disabled);return(s,i)=>(e.openBlock(),e.createElementBlock("div",Gd,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:s.value,"onUpdate:modelValue":i[0]||(i[0]=c=>a.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":r.value}]),id:s.id,disabled:r.value},null,10,Kd),[[e.vModelCheckbox,a.value]]),e.createElementVNode("label",{for:s.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":r.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[a.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",s.error?"border-red-600":""]])},[e.createVNode(Wd,{height:"12",width:"12"})],2),e.createElementVNode("span",Zd,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],10,Yd)]))}}),Xd=["name","value","disabled"],Qd={class:"flex items-center gap-[6px] text-[14px]"},Vd={key:0,class:"text-[16px]"},eu=["src"],tu=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=e.computed({get:()=>n.modelValue,set:i=>{o("update:modelValue",i)}}),r=e.computed(()=>Array.isArray(a.value)?a.value.includes(n.value):a.value===!0||a.value===n.value),s=e.computed(()=>n.style?.size==="xs"?"p-1.5 text-xs":n.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[s.value,r.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":c[0]||(c[0]=d=>a.value=d),disabled:i.disabled},null,8,Xd),[[e.vModelCheckbox,a.value]]),e.createElementVNode("span",Qd,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",Vd,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,eu)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),nu={class:"flex items-center"},Ll=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=`radio-${Math.floor(Math.random()*1e4)}`,r=e.computed({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:i=>{if(Array.isArray(n.modelValue)){let c=[...n.modelValue];i?c.includes(n.value)||c.push(n.value):c=c.filter(d=>d!==n.value),o("update:modelValue",c)}else o("update:modelValue",i)}}),s=e.ref(`vs-checkbox-${n.view||"default"}`);return(i,c)=>(e.openBlock(),e.createElementBlock("div",nu,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value==="vs-checkbox-buttons"?e.unref(tu):e.unref(Jd)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),id:a,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),lu={},ou={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function au(l,t){return e.openBlock(),e.createElementBlock("svg",ou,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const $l=pe(lu,[["render",au]]),ru={},su={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function iu(l,t){return e.openBlock(),e.createElementBlock("svg",su,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Pn=pe(ru,[["render",iu]]),cu={},du={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function uu(l,t){return e.openBlock(),e.createElementBlock("svg",du,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)])])}const pu=pe(cu,[["render",uu]]),mu={key:0,class:"flex items-start gap-x-1"},fu={key:0,class:"text-red-500 text-[14px]"},hu=["title"],vu=["disabled"],na=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue");return(o,a)=>t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",mu,[e.createVNode(Ll,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=r=>n.value=r),label:o.text,error:o.error||""},null,8,["modelValue","label","error"]),o.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",fu,"*")):e.createCommentVNode("",!0),o.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:o.i,onClick:a[1]||(a[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(pu),{class:"text-gray-500 w-[14px] h-[14px]"})],8,hu)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[n.value?`bg-${o.style?.primaryColor||"blue"}-500`:"bg-stone-200",o.customClass]]),disabled:o.disabled,onClick:a[2]||(a[2]=r=>n.value=!n.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[n.value?"translate-x-4":"translate-x-0"]])},null,2)],10,vu))}}),gu=["id","innerHTML"],la=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,gu))}}),yu=["placeholder","disabled","name"],Il=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.ref(null);let r=null;function s(i){const c={9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},d=new Set;let u=!1;for(let g=0;g<i.length;g+=1){const y=i[g];y==="{"?u=!0:y==="}"?u=!1:u&&d.add(y)}const p={};return Object.keys(c).forEach(g=>{d.has(g)||(p[g]=c[g])}),{mask:i,definitions:p,lazy:!1}}return e.onMounted(async()=>{if(a.value){const{default:i}=await Promise.resolve().then(()=>zo),c=s(t.mask||"");r=i(a.value,c),r.on("accept",()=>{o.value=t.unmask?r.unmaskedValue:r.value}),r.on("complete",()=>{o.value=t.unmask?r.unmaskedValue:r.value}),r.value=o.value!=null?String(o.value):""}}),e.onBeforeUnmount(()=>{r?.destroy()}),e.watch(()=>t.mask,i=>{if(r){const c=s(i||"");r.updateOptions(c)}}),e.watch(o,i=>{r&&r.unmaskedValue!==i&&(r.value=i!=null?String(i):"")}),(i,c)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:a,placeholder:i.placeholder,disabled:i.disabled,name:i.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,yu))}}),ku={class:"relative w-full bg-white rounded-lg"},bu=["placeholder","disabled"],oa=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue");return(a,r)=>(e.openBlock(),e.createElementBlock("div",ku,[r[1]||(r[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),placeholder:a.placeholder,disabled:a.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,bu),[[e.vModelText,o.value]])]))}}),xu={class:"relative w-full bg-white rounded-lg"},wu=["value","placeholder","disabled"],aa=e.defineComponent({__name:"vs-input-tel",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>o.value?o.value.startsWith("+")?o.value.slice(1):o.value:""),r=i=>{let{value:c}=i.target;c=c.replace(/^\+/,""),o.value=c?`+${c}`:""},s=i=>{const c=i,{data:d,inputType:u}=c;u&&u.startsWith("delete")||d&&/\D/.test(d)&&c.preventDefault()};return e.watch(()=>o.value,i=>{i&&!i.startsWith("+")?o.value=`+${i.replace(/^\+/,"")}`:i||(o.value="")},{immediate:!0}),(i,c)=>(e.openBlock(),e.createElementBlock("div",xu,[c[0]||(c[0]=e.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"stroke-gray-500 transition-all"},[e.createElementVNode("path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"})])],-1)),c[1]||(c[1]=e.createElementVNode("div",{class:"absolute bottom-2/4 translate-y-2/4 left-[30px] text-gray-500 select-none pointer-events-none"}," + ",-1)),e.createElementVNode("input",{type:"tel",value:a.value,onInput:r,onBeforeinput:s,pattern:"^\\+[1-9]\\d{1,14}$",maxlength:"15",placeholder:i.placeholder,disabled:i.disabled,class:e.normalizeClass(["!pl-10 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,wu)]))}}),Eu=["value","disabled"],Cu={class:"text-[13px] text-gray-700"},_u=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>!!t.disabled);return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,o.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s),type:"radio",value:t.value,disabled:o.value,class:"hidden"},null,8,Eu),[[e.vModelRadio,n.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${t.style?.primaryColor||"blue"}-500`,o.value?"opacity-50 cursor-not-allowed":""]])},[n.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${t.style?.primaryColor||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",Cu,e.toDisplayString(t.text),1)],2))}}),Nu=["value","disabled"],Bu={class:"text-[13px] text-gray-700"},Su=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>!!t.disabled);return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[n.value==t.value?`ring-2 ring-ring ring-${t.style?.primaryColor||"blue"}-500`:"",t.customClass,o.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s),type:"radio",value:t.value,disabled:o.value,class:"hidden"},null,8,Nu),[[e.vModelRadio,n.value]]),e.createElementVNode("span",Bu,e.toDisplayString(t.text),1)],2))}}),Mu={"vs-input-radio-default":_u,"vs-input-radio-buttons":Su},ra=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>Mu[`vs-input-radio-${t.view}`]);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.options,s=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps({key:s?.id,text:s.text,value:s.id.toString(),checked:n.value===s.id,modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=i=>n.value=i)},{ref_for:!0},a.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),Au={key:1,class:"w-full flex flex-col gap-4"},Du={key:0,class:"text-sm font-medium text-muted-foreground my-2"},Tu="Без категорії",Lu=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,o=t,a=e.ref([]),r=e.reactive({}),s=y=>y?.value||y?.id||y?.text||y,i=y=>y.text||String(y),c=y=>`lg:col-span-${y||12}`,d=e.computed(()=>[n.position==="vertical"?"flex flex-col":"",n.colSpan?"grid":"flex justify-start"]),u=y=>y==null||y===""?null:typeof y=="string"||typeof y=="number"?y:String(y),p=e.computed(()=>{if(!n.group)return[];const y=new Map;a.value.forEach(C=>{const _=C[n.group],b=u(_);y.has(b)||y.set(b,[]),y.get(b)?.push(C)});const w=[];n.values?.length&&n.values.forEach(C=>{const _=u(C);w.push(_)});const m=new Set,f=C=>{const _=y.get(C)||[];if(!_.length)return null;const b=C===null?"group-null":`group-${String(C)}`,x=C===null?Tu:String(C);return m.add(C),{key:b,label:x,options:_}},E=[];return w.forEach(C=>{const _=f(C);_&&E.push(_)}),y.forEach((C,_)=>{if(m.has(_))return;const b=f(_);b&&E.push(b)}),E}),g=async()=>{try{const y=await fetch(`/api/suggest/${n.data}`).then(w=>w.json());a.value=y?.data||y}catch(y){console.error(y)}};return e.watch(()=>n.modelValue,y=>{if(typeof y=="boolean"&&a.value.length===1){const w=s(a.value[0]);r[w]=y}else if(Array.isArray(y)){const w=new Set(y);a.value.forEach(m=>{if(!m.disabled){const f=s(m);r[f]=w.has(f)}})}},{immediate:!0}),e.watch(r,()=>{if(!a.value.length){o("update:modelValue",null);return}const y=Object.entries(r).filter(([,w])=>w).map(([w])=>w);o("update:modelValue",y.length===0?[]:y)},{deep:!0}),e.onMounted(()=>{if(n.data)g().then(()=>{if(typeof n.modelValue=="boolean"&&a.value.length===1){const y=s(a.value[0]);r[y]=n.modelValue}else if(Array.isArray(n.modelValue)){const y=new Set(n.modelValue);a.value.forEach(w=>{if(!w.disabled){const m=s(w);r[m]=y.has(m)}})}});else if(a.value=n.options,typeof n.modelValue=="boolean"&&a.value.length===1){const y=s(a.value[0]);r[y]=n.modelValue}else if(Array.isArray(n.modelValue)){const y=new Set(n.modelValue);a.value.forEach(w=>{if(!w.disabled){const m=s(w);r[m]=y.has(m)}})}}),(y,w)=>n.group?(e.openBlock(),e.createElementBlock("div",Au,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.key,class:"flex flex-col gap-2"},[m.label?(e.openBlock(),e.createElementBlock("span",Du,e.toDisplayString(m.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,f=>(e.openBlock(),e.createBlock(Ll,{modelValue:r[s(f)],"onUpdate:modelValue":E=>r[s(f)]=E,value:s(f),class:e.normalizeClass(c(y.colSpan)),disabled:n.disabled||f.disabled,label:i(f),key:`${m.key}-${s(f)}`,icon:f?.icon,imgUrl:f?.imgUrl,option:f,view:y.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createBlock(Ll,{modelValue:r[s(m)],"onUpdate:modelValue":f=>r[s(m)]=f,value:s(m),class:e.normalizeClass(c(y.colSpan)),disabled:n.disabled||m.disabled,label:i(m),key:s(m),icon:m?.icon,imgUrl:m?.imgUrl,option:m,view:y.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),$u=pe(Lu,[["__scopeId","data-v-cf0478ce"]]),Iu=["type","placeholder","disabled"],Fu=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l;function o(u){return u?n.mode==="datetime"?(u.includes("T")?u:null)||u+(u.includes(" ")?"":"T00:00"):u?.split(" ")[0]:null}const{inputClass:a}=Xe(n.style),r=t,s=e.computed({get:()=>o(n.modelValue),set:u=>r("update:modelValue",u)}),i=e.computed(()=>n.mode==="datetime"?"datetime-local":n.mode),c=e.computed(()=>!!n.disabled),d=e.computed(()=>n.placeholder??"");return(u,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":p[0]||(p[0]=g=>s.value=g),placeholder:d.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.modelValue?"":"text-opacity-50",e.unref(a)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Iu)),[[e.vModelDynamic,s.value]])}}),Ou=(l,t)=>{if(!t||!Object.keys(t).length)return l;const[n,o=""]=l.split("?"),a=new URLSearchParams(o);Object.entries(t).forEach(([s,i])=>{i==null||i===""||a.set(s,String(i))});const r=a.toString();return r?`${n}?${r}`:n},sa=async(l,t={})=>{try{const n=new FormData;n.append("unique","true"),n.append("file",l);const{api:o,id:a="1",form:r="form",table:s="table",customParams:i}=t,c=o||`/file/upload/uploads?id=${a||""}&form=${r||""}&table=${s||""}`,d=Ou(c,i);return(await fetch(d,{method:"POST",body:n}).then(u=>u.json()))?.result}catch(n){return fe.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",n),null}},Pu=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},ia=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),n=await t.arrayBuffer(),o=t.headers["content-type"],a=new TextDecoder("utf-8").decode(n),r=new Blob([a],{type:o}),s=document.createElement("a");s.setAttribute("download",l),s.href=window.URL.createObjectURL(r),s.click()}catch(t){console.error(t.message)}},Ru={},zu={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ju(l,t){return e.openBlock(),e.createElementBlock("svg",zu,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)])])}const vt=pe(Ru,[["render",ju]]),Uu={},Hu={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function qu(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",Hu,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)])])}const Wu=pe(Uu,[["render",qu]]),Gu={},Ku={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Yu(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",Ku,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)])])}const Zu=pe(Gu,[["render",Yu]]),Ju={},Xu={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Qu(l,t){return e.openBlock(),e.createElementBlock("svg",Xu,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)])])}const ca=pe(Ju,[["render",Qu]]),Vu={},ep={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function tp(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",ep,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)])])}const np=pe(Vu,[["render",tp]]),lp={},op={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function ap(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("svg",op,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)])])}const rp=pe(lp,[["render",ap]]),sp=l=>{if(!l)return"";const t=l?.split(".");return t[t.length-1]},ip=l=>{const t=sp(l),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(t)?"img":n.sheetsFormat.includes(t)?Zu:n.textsFormat.includes(t)?rp:n.documentsFormat.includes(t)?Wu:n.archivesFormat.includes(t)?np:ca},cp={},dp={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function up(l,t){return e.openBlock(),e.createElementBlock("svg",dp,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)])])}const Gt=pe(cp,[["render",up]]),pp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function fp(l,t){return e.openBlock(),e.createElementBlock("svg",mp,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const da=pe(pp,[["render",fp]]),hp=["title"],vp={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},gp=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),n=e.useModel(l,"item"),o=l;return(a,r)=>(e.openBlock(),e.createElementBlock("div",{title:n.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ip)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:r[0]||(r[0]=s=>e.unref(ia)(n.value))},null,8,["src"])),e.createElementVNode("div",vp,[e.createElementVNode("button",{type:"button",onClick:r[1]||(r[1]=s=>{e.unref(Pu)(n.value),t.value=o.multiple?t.value?.filter(i=>i!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(Gt,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:r[2]||(r[2]=s=>e.unref(ia)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(da,{class:"w-4 h-4"})])])],8,hp))}}),Fl=pe(gp,[["__scopeId","data-v-b61a9d9a"]]),yp={class:"flex items-center gap-x-2"},kp=["accept","multiple","disabled"],bp={key:1,class:"flex items-center flex-wrap gap-2"},xp={key:1,class:"loader"},wp={key:1,class:"loader"},Ep=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},api:{},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=e.useModel(l,"modelValue"),a=t,r=e.ref(null),s=e.ref(!1),i=e.inject("values"),c=e.computed(()=>n.format?n.format.split(",").map(C=>C.trim().toLowerCase()).filter(Boolean):[]),d=C=>Array.isArray(o.value)&&o.value[C]||"",u=C=>{if(n.max_size&&C.size>n.max_size*1024*1024){const _=(C.size/1048576).toFixed(2);return fe.notify({type:"error",title:"Помилка!",message:`Файл "${C.name}" занадто великий. Максимальний розмір: ${n.max_size} МБ, розмір файлу: ${_} МБ`,position:"right-bottom"}),!1}return!0},p=C=>{if(!c.value.length)return!0;const _=`.${C.name.split(".").pop()?.toLowerCase()||""}`,b=c.value.includes(_);return b||fe.notify({type:"error",title:"Помилка!",message:`Неприпустимий формат файлу "${C.name}". Дозволені формати: ${c.value.join(", ")}`,position:"right-bottom"}),b},g=e.computed(()=>{const C={},_=[];if(!n.customParams?.length)return{params:C,missingSources:_};const b=i?.value??{};return n.customParams.forEach(x=>{if(!x)return;const[D,S]=x.split("="),M=D?.trim(),O=S?.trim();if(!M||!O)return;const K=b[O];if(K==null||K===""){_.push(O);return}C[M]=K}),{params:C,missingSources:_}}),y=()=>{const{params:C}=g.value;return{api:n.api,customParams:Object.keys(C).length?C:void 0}},w=()=>{const C=g.value.missingSources;if(!C.length)return!0;const _=C.join(", ");return fe.notify({type:"warning",title:"Заповніть поля",message:`Поля (${_}) необхідні для завантаження файлу`,position:"right-bottom"}),!1},m=C=>{fe.notify({type:"error",title:"Помилка завантаження",message:C||"Не вдалося завантажити файл. Спробуйте ще раз.",position:"right-bottom"})},f=()=>{n.disabled||s.value||w()&&r.value?.click()},E=async C=>{const{files:_}=C.target;if(!_||_.length===0)return;if(!w()){r.value&&(r.value.value="");return}const b=Array.from(_);if(n.max_size&&b.filter(x=>!u(x)).length>0){r.value&&(r.value.value="");return}if(b.filter(x=>!p(x)).length>0){r.value&&(r.value.value="");return}s.value=!0;try{if(n.multiple){const x=Array.from(_).map(async M=>await sa(M,y())),D=await Promise.all(x),S=D.filter(M=>M!==null).map(M=>M?.file_path).filter(Boolean);if(S.length===0){m();return}S.length<D.length&&m("Деякі файли не вдалося завантажити. Перевірте їх та спробуйте знову."),o.value=[...o.value||[],...S],a("change",o.value)}else{const x=_[0],D=await sa(x,y());if(!D?.file_path){m();return}o.value=D?.file_path,a("change",o.value||"")}}catch(x){const D=x?.message||void 0;m(D)}finally{s.value=!1,r.value&&(r.value.value="")}};return(C,_)=>(e.openBlock(),e.createElementBlock("div",yp,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:r,type:"file",accept:n.format,multiple:C.multiple,onChange:E,disabled:s.value||C.disabled},null,40,kp),!C.multiple&&o.value?(e.openBlock(),e.createBlock(Fl,{key:0,item:o.value,"onUpdate:item":_[0]||(_[0]=b=>o.value=b),value:o.value,"onUpdate:value":_[1]||(_[1]=b=>o.value=b)},null,8,["item","value"])):C.multiple?(e.openBlock(),e.createElementBlock("div",bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(b,x)=>(e.openBlock(),e.createBlock(Fl,{multiple:C.multiple,key:x,value:o.value,"onUpdate:value":_[2]||(_[2]=D=>o.value=D),item:d(x)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:f,class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",C.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",xp)):(e.openBlock(),e.createBlock(vt,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),C.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:f,class:e.normalizeClass([C.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",wp)):(e.openBlock(),e.createBlock(vt,{key:0,class:"w-6 h-6"}))],2))]))}}),Cp=pe(Ep,[["__scopeId","data-v-05d41c5c"]]),_p={class:"vs-input-file2 flex flex-col gap-4"},Np={class:"flex items-center gap-x-2"},Bp=["accept","disabled"],Sp={key:0,class:"absolute inset-0 flex flex-col items-center justify-center gap-1 rounded-lg bg-white/90 text-xs font-medium text-slate-600"},Mp={key:0,class:"rounded-lg border border-[#CFD9E0] bg-white p-4 shadow-sm"},Ap={class:"flex items-center justify-between text-sm"},Dp={class:"truncate pr-4"},Tp={class:"font-medium text-slate-800 truncate"},Lp={class:"text-slate-500"},$p={class:"text-slate-500 whitespace-nowrap"},Ip={class:"mt-3 h-2 rounded-full bg-slate-100 overflow-hidden"},Fp={class:"mt-3 flex flex-wrap gap-2 text-sm"},Op={key:0,class:"mt-2 text-sm text-rose-600"},Pp=e.defineComponent({__name:"vs-input-file2",props:e.mergeModels({format:{},max_size:{},api:{},chunkSize:{default:5*1024*1024},subdir:{default:""},customParams:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(null),a=e.ref(null),r=e.ref(""),s=e.ref(0),i=e.ref(!1),c=e.ref(""),d=e.ref(null),u=e.inject("values"),p=e.computed(()=>t.format?t.format.split(",").map(R=>R.trim().toLowerCase()).filter(Boolean):[]),g=e.computed(()=>!a.value||!a.value.size?0:Math.min(100,Math.round(s.value/a.value.size*100))),y=e.computed(()=>a.value?`${f(s.value)} / ${f(a.value.size)}`:""),w=e.computed(()=>t.disabled?"opacity-50 cursor-not-allowed":i.value?"cursor-default text-blue-500":"cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"),m=()=>{t.disabled||i.value||b()&&o.value?.click()},f=R=>{if(!Number.isFinite(R))return"0 B";const q=["B","KB","MB","GB"];let N=0,j=R;for(;j>=1024&&N<q.length-1;)j/=1024,N+=1;return`${j.toFixed(N===0?0:1)} ${q[N]}`},E=R=>{if(!t.max_size)return!0;const q=t.max_size*1024*1024;return R.size>q?(fe.notify({type:"error",title:"Файл занадто великий",message:`Максимальний розмір ${t.max_size} МБ`,position:"right-bottom"}),!1):!0},C=R=>{if(!p.value.length)return!0;const q=`.${R.name.split(".").pop()?.toLowerCase()||""}`;return p.value.includes(q)?!0:(fe.notify({type:"error",title:"Непідтримуваний формат",message:`Дозволені формати: ${p.value.join(", ")}`,position:"right-bottom"}),!1)},_=e.computed(()=>{const R={},q=[];if(!t.customParams?.length)return{params:R,missing:q};const N=u?.value??{};return t.customParams.forEach(j=>{if(!j)return;const[$,Z]=j.split("="),V=$?.trim(),oe=Z?.trim();if(!V||!oe)return;const ee=N[oe];ee==null||ee===""?q.push(oe):R[V]=ee}),{params:R,missing:q}}),b=()=>_.value.missing.length?(fe.notify({type:"warning",title:"Заповніть поля",message:`Потрібні значення: ${_.value.missing.join(", ")}`,position:"right-bottom"}),!1):!0,x=R=>{const q=R.target,N=q.files?.[0];if(N){if(!b()){q.value="";return}if(!E(N)||!C(N)){q.value="";return}a.value=N,s.value=0,r.value="",c.value=""}},D=async()=>{if(!a.value){m();return}try{c.value="";const R={id:r.value||"",fileName:a.value.name,subdir:t.subdir,size:a.value.size,..._.value.params},q=await fetch("/api/file/upload2/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)});if(!q.ok)throw new Error("Не вдалося ініціалізувати завантаження");const N=await q.json();r.value=N.id||r.value,s.value=N.uploaded||0,await S()}catch(R){c.value=R?.message||"Помилка при старті завантаження"}},S=async()=>{if(!(!a.value||!r.value)){i.value=!0;try{for(;s.value<a.value.size;){const R=s.value,q=Math.min(R+t.chunkSize,a.value.size),N=a.value.slice(R,q);d.value=new AbortController;const j=await fetch(`/api/file/upload2/${r.value}`,{method:"PATCH",headers:{"Content-Range":`bytes ${R}-${q-1}/${a.value.size}`},body:N,signal:d.value.signal});if(!j.ok)throw new Error("Помилка завантаження частини");const $=await j.json().catch(()=>({}));if($.uploaded!=null?s.value=Number($.uploaded):s.value=q,$.finished||s.value>=a.value.size){i.value=!1,n.value=$.file_path||$.url||r.value,fe.notify({type:"success",title:"Файл завантажено",message:a.value.name,position:"right-bottom"}),U();return}}}catch(R){if(R?.name==="AbortError")return;c.value=R?.message||"Помилка при завантаженні",i.value=!1}finally{d.value=null,i.value=!1}}},M=()=>{i.value&&(d.value?.abort(),d.value=null,i.value=!1)},O=async()=>{if(a.value){if(!r.value){await D();return}await S()}},K=()=>{d.value?.abort(),d.value=null,U()},U=()=>{const R=o.value;R&&(R.value=""),a.value=null,r.value="",s.value=0,c.value=""};return(R,q)=>(e.openBlock(),e.createElementBlock("div",_p,[e.createElementVNode("div",Np,[e.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",class:"hidden",accept:t.format,disabled:i.value||t.disabled,onChange:x},null,40,Bp),n.value?(e.openBlock(),e.createBlock(Fl,{key:0,item:n.value,"onUpdate:item":q[0]||(q[0]=N=>n.value=N),value:n.value,"onUpdate:value":q[1]||(q[1]=N=>n.value=N)},null,8,["item","value"])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:m,class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",w.value])},[i.value?(e.openBlock(),e.createElementBlock("div",Sp,[q[2]||(q[2]=e.createElementVNode("div",{class:"loader"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(g.value)+"%",1)])):(e.openBlock(),e.createBlock(vt,{key:1,class:"w-6 h-6"}))],2))]),a.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Mp,[e.createElementVNode("div",Ap,[e.createElementVNode("div",Dp,[e.createElementVNode("div",Tp,e.toDisplayString(a.value.name),1),e.createElementVNode("div",Lp,e.toDisplayString(f(a.value.size)),1)]),e.createElementVNode("div",$p,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Ip,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500 transition-all duration-300",style:e.normalizeStyle({width:`${g.value}%`})},null,4)]),e.createElementVNode("div",Fp,[!i.value&&s.value>0&&s.value<(a.value?.size||0)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:O}," Resume ")):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:M}," Pause ")):e.createCommentVNode("",!0),!i.value&&s.value===0?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"rounded border border-slate-300 px-3 py-1",onClick:D}," Upload ")):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"rounded border border-rose-200 px-3 py-1 text-rose-600",onClick:K}," Cancel ")]),c.value?(e.openBlock(),e.createElementBlock("p",Op,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}}),Ol=pe(Pp,[["__scopeId","data-v-8f52f552"]]),Rp={class:"max-w-[55vw]"},zp={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},jp={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Up={class:"px-[5px]"},Hp={class:""},Rn=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,n=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function o(a){if(a<1024)return`${a} B`;const r=a/1024;return r<1024?`${r.toFixed(2)} KB`:`${(r/1024).toFixed(2)} MB`}return(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r[1]||(r[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",Rp,[e.createElementVNode("p",zp,e.toDisplayString(a.item?.uploaded_name),1),e.createElementVNode("p",jp,[e.createElementVNode("span",null,e.toDisplayString(a.item?.username),1),e.withDirectives(e.createElementVNode("span",Up,"|",512),[[e.vShow,a.item?.username]]),e.createElementVNode("span",null,e.toDisplayString(n.value),1),r[0]||(r[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",Hp,e.toDisplayString(o(a.item?.size)),1)])])],64))}}),qp={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Wp={key:0,class:"flex w-full gap-x-3 items-center"},Gp={key:1,class:"flex gap-x-3 w-full items-center"},Kp={key:2,class:"flex gap-x-3 w-full items-center"},Yp=["href"],Zp={key:3,class:"flex gap-x-3 w-full items-center"},Jp={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},Xp={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},Qp={class:"inline-block"},Vp={class:"inline-block"},em=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const n=l,o=t;function a(u){return["pdf","json"].includes(u.ext)}function r(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function s(u){const p=document.createElement("a");p.setAttribute("download",u?.uploaded_name),p.href=u?.file_path,p.click()}async function i(){try{await fetch(`${n.prefix}/widget/file/${n.item.entity_id}/${n.item.file_id}`),o("update")}catch(u){console.error(u)}}function c(){o("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function d(u){(n.item.ext==="jpg"||n.item.ext==="png")&&o("openLightbox",{item:n.item,index:u})}return(u,p)=>(e.openBlock(),e.createElementBlock("div",qp,[u.item.ext==="jpg"||u.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Wp,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=g=>d(u.index))},[e.createVNode(Rn,{item:u.item},null,8,["item"])])])):a(u.item)?(e.openBlock(),e.createElementBlock("div",Gp,[e.createVNode(Rn,{item:u.item},null,8,["item"])])):r(u.item)?(e.openBlock(),e.createElementBlock("div",Kp,[e.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(Rn,{item:u.item},null,8,["item"])],8,Yp)])):(e.openBlock(),e.createElementBlock("div",Zp,[e.createVNode(Rn,{item:u.item},null,8,["item"])])),e.createElementVNode("div",Jp,[e.createElementVNode("div",Xp,[e.createElementVNode("div",Qp,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=g=>s(u.item))},[e.createVNode(da,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",Vp,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=g=>c())},[e.createVNode(Gt,{height:"14",width:"14"})])])])])]))}}),tm={},nm={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function lm(l,t){return e.openBlock(),e.createElementBlock("svg",nm,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const om=pe(tm,[["render",lm]]),am={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},rm={class:"flex w-full mb-[12px] items-center gap-x-2"},sm={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},im={class1:"ml-auto"},cm={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},dm={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},um={class:"relative"},pm={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},mm={key:0},fm=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update"],setup(l,{emit:t}){const n=l,o=e.inject("form"),a=e.computed(()=>o.value.formId),r=e.ref(!1),s=e.ref(0),i=t,c=e.ref(!1),d=e.ref({}),u=e.ref([]),p=e.ref(""),g=e.computed(()=>Array.isArray(u.value)?u.value.filter(_=>_.ext==="jpg"||_.ext==="png").map(_=>_?.file_path):[]),y=e.computed(()=>p.value===""?u.value:u.value.filter(_=>_?.uploaded_name?.includes(p.value))),w=_=>{const b=g.value.findIndex(x=>x===_.item.file_path);b!==-1&&(r.value=!0,s.value=b)},m=async()=>{try{const _=await fetch(`${n.prefix}/widget/file/${a.value}`).then(b=>b.json());u.value=_?.rows}catch(_){console.error(_)}},f=async _=>{await Promise.all(Array.from(_.target.files).map(async b=>{const x=new FormData;x.append("file",b);try{const D=`${n.prefix}/widget/file/${a.value}`,S=await fetch(D,{method:"POST",body:x});return S.ok?(i("update","file-list"),b):(fe.notify({type:S.status>=400&&S.status<500?"warning":"error",title:"Error",message:`Error code: ${S.status}`}),null)}catch(D){return fe.notify({type:"error",title:"Error",message:D.message||"Unknown error"}),console.error(D),null}})),await m()},E=_=>{const b={..._};return _.cancel||(b.cancel=()=>{c.value=!1}),_.updateListOnConfirm&&(b.confirm=async()=>{await _.confirm(),c.value=!1,m()}),b},C=_=>{d.value=E(_),c.value=!0};return e.watch(a,_=>{_&&m()}),e.onMounted(()=>{a.value&&m()}),(_,b)=>{const x=e.resolveComponent("Lightbox"),D=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",am,[e.createElementVNode("div",rm,[e.createElementVNode("h2",sm," Файлів: "+e.toDisplayString(u.value?.length),1),e.createElementVNode("div",im,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:b[0]||(b[0]=S=>f(S))},null,32),e.createElementVNode("div",cm,[e.createVNode(om,{height:"16",width:"16"})])])])]),u.value?.length>4?(e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("div",null,[e.createElementVNode("div",um,[b[8]||(b[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=S=>p.value=S),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),u.value?.length?(e.openBlock(),e.createElementBlock("div",pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(S,M)=>(e.openBlock(),e.createBlock(em,{key:M,prefix:_.prefix,item:S,index:M,onUpdate:b[2]||(b[2]=O=>_.$emit("update","file-list")),onOpenModal:b[3]||(b[3]=O=>C(O)),onOpenLightbox:b[4]||(b[4]=O=>w(O))},null,8,["prefix","item","index"]))),128)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mm,[...b[9]||(b[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])]))])):e.createCommentVNode("",!0),e.createVNode(x,{modelValue:r.value,"onUpdate:modelValue":b[5]||(b[5]=S=>r.value=S),startIndex:s.value,"onUpdate:index":b[6]||(b[6]=S=>s.value=S),images:g.value},null,8,["modelValue","startIndex","images"]),e.createVNode(D,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":b[7]||(b[7]=S=>c.value=S),onConfirm:d.value.confirm},d.value),null,16,["modelValue","onConfirm"])])}}}),hm={class:"flex items-center justify-between"},vm={class:"text-[16px] text-gray-900 font-medium"},gm={class:"grid gap-3"},ym=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,o=>{n.value=o}),(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",hm,[e.createElementVNode("p",vm,e.toDisplayString(l.title),1),e.createVNode(na,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=r=>n.value=r),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",gm,[e.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),km=pe(ym,[["__scopeId","data-v-00f2f0fc"]]),bm={class:"text-[16px] text-gray-900 font-medium"},xm={class:"grid gap-3"},wm=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,o=>{n.value=o}),(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:a[0]||(a[0]=r=>n.value=!n.value),class:"flex items-center gap-2"},[e.createVNode(e.unref($l),{class:e.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",bm,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",xm,[e.renderSlot(o.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),Em=pe(wm,[["__scopeId","data-v-78778cb5"]]),Cm={class:"flex items-center justify-between"},_m=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Cm,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),Nm={switcher:km,accordion:Em,default:_m},it={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Bm=(l,t)=>String(l)===String(t),Sm=(l,t)=>String(l)!==String(t),Mm=(l,t)=>l>t,Am=(l,t)=>l>=t,Dm=(l,t)=>l<t,Tm=(l,t)=>l<=t,Lm=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,$m=(l,t)=>String(l).startsWith(String(t)),Im=(l,t)=>String(l).endsWith(String(t)),Fm=(l,t)=>String(l).includes(String(t)),Om=(l,t)=>Array.isArray(t)?t.includes(l):!1,Pm=(l,t)=>Array.isArray(t)?!t.includes(l):!0,ua=(l,t)=>{if(!t)return!0;switch(t?.[1]){case it.Equal:return Bm(l,t?.[2]);case it.Inequal:return Sm(l,t?.[2]);case it.Higer:return Mm(l,t?.[2]);case it.HigerOrEqual:return Am(l,t?.[2]);case it.Lower:return Dm(l,t?.[2]);case it.LowerOrEqual:return Tm(l,t?.[2]);case it.Between:return Lm(l,t?.[2]);case it.StartWith:return $m(l,t?.[2]);case it.EndWith:return Im(l,t?.[2]);case it.Contain:return Fm(l,t?.[2]);case it.In:return Om(l,t?.[2]);case it.NotIn:return Pm(l,t?.[2]);default:return!0}},Rm=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,n=e.inject("values",e.ref({})),o=e.inject("form"),a=e.computed(()=>t.schema?.filter(i=>{const c=i?.conditions;if(!c)return!0;const d=Array.isArray(c)?c[0]:c,u=t.name?n.value?.[t.name]?.[d]??n.value?.[d]:n.value?.[d];return ua(u,c)})),r=e.computed(()=>Nm[t.view]),s=e.computed(()=>{if(n.value||(n.value={}),!t.name)return n.value;const i=n.value[t.name];if(i)return i;const c={};return n.value={...n.value,[t.name]:c},c});return(i,c)=>l.schema?.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,d=>(e.openBlock(),e.createBlock(fa,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:s.value[d.name],"onUpdate:modelValue":u=>s.value[d.name]=u,style:l.style,error:e.unref(o)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}),zm=["aria-expanded","data-focus"],jm={class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full"},Um={key:0,class:"flex flex-nowrap items-center gap-1 overflow-x-auto overflow-y-hidden min-w-0 flex-1 py-0.5"},Hm={class:"flex items-center min-w-0"},qm=["title"],Wm=["innerHTML"],Gm=["onClick"],Km={class:"flex-1 min-w-[2px]"},Ym=["placeholder"],Zm=["title"],Jm=["innerHTML"],Xm={key:2,class:"flex-1 min-w-[2px]"},Qm=["placeholder"],Vm={class:"flex items-center shrink-0"},ef=["disabled"],tf=["disabled","title"],nf=["aria-disabled","onClick"],lf=["innerHTML"],of={key:1,class:"px-3 py-2 text-center text-gray-500"},af=["disabled"],rf=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},start:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{},maxlength:{},minlength:{}},emits:["change","update:modelValue","value-selected"],setup(l,{emit:t}){const n=l,o=t,a=e.computed(()=>n.multiple),r=e.computed(()=>n.disabled);Xe(n.style);const s=e.computed({get:()=>n.modelValue,set:h=>o("update:modelValue",h)});!s.value&&n.defaultValue&&(s.value=n.defaultValue);const i=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref(!1),g=e.ref(!1),y=e.ref(null),w=e.ref([]),m=e.ref(-1),f=e.ref([]),E=e.ref(""),C=e.ref(null),_=e.ref("bottom"),b=e.ref({}),x=e.ref([]),D=e.computed(()=>{if(!x.value.length)return[];const h=w.value,v=new Map(h.map(B=>[B.id?.toString(),B]));return x.value.map(B=>v.get(B?.toString())).filter(B=>!!B)}),S=e.computed(()=>n.placeholder||"Select..."),M=e.computed(()=>V(y.value));e.computed(()=>a.value?!x.value.length&&E.value==="":!M.value&&E.value==="");const O=e.computed(()=>r.value?!1:a.value?x.value.length>0:!!s.value),K=h=>a.value?x.value.some(v=>v?.toString()===h?.toString()):s.value?.toString()===h?.toString(),U=e.computed(()=>{let h=w.value??[];if(!n.data&&E.value.trim()!==""){const v=E.value.toLowerCase();h=h.filter(B=>{const k=V(B).toLowerCase(),A=B.text?.toLowerCase?.()||"";return k.includes(v)||A.includes(v)})}if(a.value&&x.value.length){const v=new Set(x.value.map(B=>B?.toString()));h=h.filter(B=>!v.has(B.id?.toString()))}return h}),R=e.inject("values"),q=e.inject("field-props"),N=/\{\{\s*([^}]+?)\s*\}\}/g,j=h=>(h?String(h):"").replace(/<[^>]*>/g,"").trim(),$=e.computed(()=>n.slot??n?.optionTemplate??""),Z=h=>{if(!h)return"";const v=$.value;return v?v.replace(N,(B,k)=>{const A=k.trim(),I=h[A];return I!=null?String(I):""}):h.text??""},V=h=>{if(!h)return"";if(!$.value)return h.text??"";const v=Z(h);return j(v)||h.text||""},oe=(h,v,B)=>{if(!q)return!1;const k=q.value?.[h]??{},A=(ne,ce,Be)=>{if(!ce.length)return ne;const[Ne,...Ue]=ce,Ve={...ne};if(!Ue.length)return Ve[Ne]=Be,Ve;const an=typeof ne[Ne]=="object"&&ne[Ne]!==null?ne[Ne]:{};return Ve[Ne]=A(an,Ue,Be),Ve},I=A(k,v,B);return q.value={...q.value||{},[h]:I},!0},ee=h=>{if(!n.set)return;const v=R?.value;!v&&!q||Object.entries(n.set).forEach(([B,k])=>{if(!B)return;const A=h?h[k]:null,I=B.split(".").map(Be=>Be.trim()).filter(Boolean);if(!I.length)return;const[ne,...ce]=I;ce.length&&oe(ne,ce,A??null)||v&&(v[ne]=A??null)})},H=e.computed(()=>n.parent?R?.value?.[n.parent]?.toString()??null:null),ie=async h=>{if(!n.data){let v=n.options??[];if(h?.trim()){const B=h.toLowerCase();v=v.filter(k=>{const A=V(k).toLowerCase(),I=k.text?.toLowerCase?.()||"";return A.includes(B)||I.includes(B)})}return v}try{const v=n.host??"",B=n.prefix??"api",k=n.api??`/${B}/suggest/${n.data}`,A=`${v}${k}`,I=new URLSearchParams;return I.set("json","1"),h&&I.set("key",h),H.value!==void 0&&H.value!==null&&H.value!==""&&I.set("parent",H.value),n.start===1&&I.set("start","1"),(await fetch(`${A}?${I.toString()}`).then(ne=>ne.json()))?.data??[]}catch{return[]}},Y=async()=>{n.data?w.value=await ie(E.value):w.value=n.options?[...n.options]:[]},se=async h=>{if(h==null)return null;const v=w.value?.find(B=>B?.id?.toString()===String(h));if(v)return v;if(n.data)try{const B=n.host??"",k=n.prefix??"api",A=n.api??`/${k}/suggest/${n.data}`,I=`${B}${A}`,ne=new URLSearchParams;return ne.set("json","1"),ne.set("val",String(h)),H.value!==void 0&&H.value!==null&&H.value!==""&&ne.set("parent",H.value),n.start===1&&ne.set("start","1"),((await fetch(`${I}?${ne.toString()}`).then(ce=>ce.json()))?.data??[])?.[0]??null}catch{return null}return null},ue=async h=>{const v=new Set(w.value.map(k=>k.id?.toString())),B=h.filter(k=>!v.has(k?.toString()));B.length&&await B.reduce(async(k,A)=>{await k;const I=await se(A);I&&w.value.push(I)},Promise.resolve())},he=()=>{if(!U.value.length){m.value=-1;return}let h=0;if(!a.value&&y.value){const v=y.value.id?.toString(),B=U.value.findIndex(k=>k.id?.toString()===v);B>=0&&(h=B)}m.value=h,e.nextTick(()=>{F(f.value[h],d.value)})},be=async()=>{r.value||(p.value=!0,await Y(),await e.nextTick(()=>{ae(),C.value?.focus()}),he())},L=()=>{p.value=!1,m.value=-1,e.nextTick(()=>{C.value?.blur()})},le=async h=>{r.value||(p.value?L():await be())},T=async()=>{if(!r.value){if(p.value){L();return}await be()}},P=()=>{a.value?(x.value=[],s.value=[],o("change",[]),J(null,[])):(y.value=null,s.value=null,o("change",null),J(null,null)),ee(null),E.value="",e.nextTick(()=>C.value?.focus())},X=h=>{a.value&&(x.value=x.value.filter(v=>v?.toString()!==h?.toString()),s.value=[...x.value],o("change",s.value),J(null),e.nextTick(()=>C.value?.focus()))},J=(h,v)=>{const B=v??(a.value?[...x.value]:h?.id??null);o("value-selected",{name:n.name,value:B,option:h})},re=h=>{a.value?(K(h.id)||(x.value=[...x.value,h.id],s.value=[...x.value],o("change",s.value),J(h)),E.value="",e.nextTick(()=>{C.value?.focus(),m.value=Math.min(m.value,U.value.length-1)}),ee(null)):(y.value=h,s.value=h.id,o("change",s.value),J(h),E.value="",L(),ee(h))},xe=h=>{if(K(h.id)){a.value||L();return}re(h)},F=(h,v)=>{if(!h||!v)return;const B=h.offsetTop,k=B+h.offsetHeight,A=v.scrollTop,I=A+v.clientHeight;let ne=v.scrollTop;B<A?ne=B-80:k>I&&(ne=k-v.clientHeight+4);const ce=v;ce.scrollTop=ne},te=h=>{let v=h.parentElement;for(;v;){if(v.classList.contains("ui-dialog__content"))return v;const B=window.getComputedStyle(v),k=B.overflow+B.overflowY+B.overflowX;if(k.includes("auto")||k.includes("scroll")||v===document.body||v===document.documentElement)return v;v=v.parentElement}return document.body},ae=()=>{if(!c.value)return;const h=c.value.getBoundingClientRect(),v=window.innerHeight||document.documentElement.clientHeight,B=window.innerWidth||document.documentElement.clientWidth,k=8,A=8,I=n.maxHeight||300,ne=v-h.bottom-A-k,ce=h.top-A-k,Be=ne>=ce,Ne=Math.max(B-k*2,0);let{width:Ue}=h;Ne>0&&Ue>Ne&&(Ue=Ne);let{left:Ve}=h;Ve+Ue+k>B&&(Ve=B-Ue-k),Ve=Math.max(Ve,k);const an=Math.min(I,Math.max(Be?ne:ce,50));_.value=Be?"bottom":"top",b.value={position:"fixed",left:`${Ve}px`,width:`${Ue}px`,maxHeight:`${an}px`,transform:Be?"none":"translateY(-100%)",top:Be?`${h.bottom+A}px`:`${h.top-A}px`}},_e=async h=>{r.value||!p.value&&(h.key==="ArrowDown"||h.key==="ArrowUp")&&(h.preventDefault(),await be())},Ae=h=>{if(!p.value)return;const{key:v}=h;if(v==="ArrowDown")h.preventDefault(),m.value+1<U.value.length&&(m.value+=1,F(f.value[m.value],d.value));else if(v==="ArrowUp")h.preventDefault(),m.value>0&&(m.value-=1,F(f.value[m.value],d.value));else if(v==="Enter"){h.preventDefault();const B=U.value[m.value];B&&re(B),C.value?.blur()}else v==="Escape"?(h.preventDefault(),L()):v==="Backspace"?a.value&&E.value===""&&x.value.length&&(x.value=x.value.slice(0,-1),s.value=[...x.value],o("change",s.value)):v==="Home"?(m.value=0,F(f.value[0],d.value)):v==="End"?(m.value=U.value.length-1,F(f.value[m.value],d.value)):v==="Tab"&&L()},Re=()=>{r.value||(g.value=!0)},Ye=()=>{g.value=!1,E.value=""},dt=h=>{h.key==="Escape"&&p.value&&L()},Qe=h=>{const v=h.target;i.value?.contains(v)||u.value?.contains(v)||L()},ht=h=>{p.value&&d.value&&!d.value.contains(h.target)&&ae()},ze=()=>{p.value&&ae()},Le=()=>{p.value&&ae()};e.watch(()=>n.options,h=>{h?.length&&(w.value=[...h],je())},{immediate:!0});async function je(){if(a.value)Array.isArray(s.value)?x.value=[...s.value]:(x.value=s.value==null?[]:[s.value],s.value=[...x.value]),n.data&&x.value.length&&(await ue(x.value),await e.nextTick());else{if(Array.isArray(s.value)){const h=s.value[0]??null;s.value=h??null}s.value!=null&&(y.value=await se(s.value)),ee(y.value??null)}}e.watch(s,()=>{je()}),e.onMounted(async()=>{addEventListener("keydown",dt),addEventListener("scroll",ht,!0),addEventListener("resize",ze),document.addEventListener("click",Qe,!0),c.value&&te(c.value).addEventListener("scroll",Le,!0),n.options?.length&&!n.data?w.value=[...n.options]:n.data&&(w.value=await ie("")),await je(),Ee.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",dt),removeEventListener("scroll",ht,!0),removeEventListener("resize",ze),document.removeEventListener("click",Qe,!0),c.value&&te(c.value).removeEventListener("scroll",Le,!0)});const wt=e.ref(!1),ut=e.ref({}),z=e.ref([]),Q=e.ref(null);async function W(){if(!n.add?.token||Q?.value.validate())return;const h=n.add.api??`/api/table/${n.add.token}`,{id:v}=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ut.value)}).then(B=>B.json());if(!n.options?.length&&n.data){const B=await fetch(`${n.api??`/api/suggest/${n.data}`}?val=${v}`).then(k=>k.json());y.value=B[0],w.value.push(B[0]),s.value=v}wt.value=!1,fe.notify({title:"Success!",message:"Object created."})}async function G(){if(!n.add)return null;const h=await fetch(`/api/template/form/${n.add.form}`).then(v=>v.json());return z.value=h.schema,wt.value=!0,null}function ve(h,v=200){let B;return(...k)=>{B&&clearTimeout(B),B=window.setTimeout(()=>h(...k),v)}}const me=ve(async h=>{w.value=await ie(h)},200);e.watch(E,h=>{n.data&&me(h.trim())}),e.watch(()=>n.options,h=>{!n.data&&h?.length&&(w.value=[...h],je())},{immediate:!0}),e.watch(()=>n.parent??n.parentValue,()=>{n.data&&Y()});const Ee=e.ref(!0);return e.watch(H,async()=>{if(n.data&&(Ee.value||(a.value?(x.value=[],s.value=[],o("change",[])):(y.value=null,s.value=null,o("change",null))),await Y(),n.auto===1&&H.value&&w.value.length>0)){const h=w.value[0];h&&re(h)}}),(h,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(fe.VsModal),{visible:wt.value,"onUpdate:visible":v[1]||(v[1]=B=>wt.value=B),class:"z-[1000]",title:"Додати",buttonText:"Додати",onDone:W,teleport:h.teleport},{default:e.withCtx(()=>[e.createVNode(It,{schema:z.value,modelValue:ut.value,"onUpdate:modelValue":v[0]||(v[0]=B=>ut.value=B),ref_key:"addForm",ref:Q},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:v[5]||(v[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass])},[v[10]||(v[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),v[11]||(v[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["vs-input-select__control flex min-h-[38px] items-center justify-between rounded transition-colors bg-white",r.value?"bg-gray-100 text-gray-400 cursor-not-allowed":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:_e,onClick:T,"data-focus":p.value||g.value?"true":"false",ref_key:"triggerRef",ref:c},[e.createElementVNode("div",jm,[a.value?(e.openBlock(),e.createElementBlock("div",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,B=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full",key:B.id},[e.createElementVNode("div",Hm,[B?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:B?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",title:V(B)},[$.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:Z(B)},null,8,Wm)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(B.text),1)],64))],8,qm)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border text-[#172b4d] hover:bg-[rgb(255,189,173)] hover:text-[rgb(222,53,11)] flex-shrink-0",onClick:e.withModifiers(k=>X(B.id),["stop"])},[...v[6]||(v[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Gm)]))),128)),e.createElementVNode("div",Km,[!r.value&&h.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:C,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:x.value.length?" ":S.value,"onUpdate:modelValue":v[2]||(v[2]=B=>E.value=B),onFocus:Re,onBlur:Ye,onKeydown:Ae},null,40,Ym)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)])])):!a.value&&M.value&&E.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900 absolute"]),title:M.value},[y.value?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:y.value?.color})},null,4)):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":y.value?.color}),innerHTML:Z(y.value)},null,10,Jm)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":y.value?.color})},e.toDisplayString(y.value?.text),3))],8,Zm)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xm,[!r.value&&h.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:C,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:M.value?" ":S.value,"onUpdate:modelValue":v[3]||(v[3]=B=>E.value=B),onFocus:Re,onBlur:Ye,onKeydown:Ae},null,40,Qm)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)]))]),e.createElementVNode("div",Vm,[O.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:e.withModifiers(P,["stop"])},[...v[7]||(v[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,ef)):e.createCommentVNode("",!0),v[9]||(v[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:v[4]||(v[4]=e.withModifiers(B=>le(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},[...v[8]||(v[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)])],8,tf)])],42,zm),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(b.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:b.value.maxHeight||"300px"}),ref_key:"listRef",ref:d},[U.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U.value,(B,k)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,ref_for:!0,ref:A=>f.value[k]=A,class:e.normalizeClass(["flex px-3 py-2 cursor-pointer select-none text-gray-900",K(B.id)?"bg-[#2684ff] text-white":"bg-white hover:bg-[#deebff] hover:text-[#172b4d]",m.value===k&&!K(B.id)?"bg-[#deebff] text-[#172b4d]":""]),"aria-disabled":K(B.id)?"true":"false",role:"option",tabindex:"-1",onClick:A=>xe(B)},[B?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:B?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",m.value===B.id?"text-white":"",(m.value,"")])},[$.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:Z(B)},null,8,lf)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(B.text),1)],64))],2)],10,nf))),128)):(e.openBlock(),e.createElementBlock("div",of," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),n.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:G,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:r.value,type:"button"},[e.createVNode(vt,{width:"16",height:"16"}),v[12]||(v[12]=e.createElementVNode("span",null,"Додати",-1))],8,af)):e.createCommentVNode("",!0)],512)],64))}}),pa=pe(rf,[["__scopeId","data-v-a23a52be"]]),sf=["placeholder","disabled"],cf=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:n}=Xe(t.style),o=e.useModel(l,"modelValue"),a=e.computed(()=>!!t.disabled),r=e.computed(()=>t.placeholder??"");function s(){typeof o.value=="string"&&(o.value=o.value.trim())}return(i,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),placeholder:r.value,disabled:a.value,row:"2",onBlur:s,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,42,sf)),[[e.vModelText,o.value]])}}),df={key:1,class:"richtext-error"},uf=e.defineComponent({__name:"vs-input-richtext",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},richtextProps:{default:()=>({})}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.ref(null);e.onMounted(async()=>{try{const c=await new Function("specifier","return import(specifier)")("@opengis/richtext");t.value=c.VsRichtext}catch{console.warn("@opengis/richtext is not installed. Please install it to use richtext input.")}});const n=l,{inputClass:o}=Xe(n.style),a=e.useModel(l,"modelValue"),r=e.computed(()=>!!n.disabled),s=e.computed(()=>n.placeholder??""),i=e.computed(()=>({height:"300px",...n.richtextProps}));return(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["richtext-wrapper !h-full !border-transparent",[c.customClass,e.unref(o),{"richtext-disabled":r.value}]]),style:e.normalizeStyle(r.value?{pointerEvents:"none",opacity:.6}:{})},[t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.mergeProps({key:0,modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=u=>a.value=u),placeholder:s.value},i.value),null,16,["modelValue","placeholder"])):(e.openBlock(),e.createElementBlock("div",df,[...d[1]||(d[1]=[e.createElementVNode("p",null,"@opengis/richtext package is not installed.",-1),e.createElementVNode("p",null,"Please install it: npm install @opengis/richtext",-1)])]))],6))}}),pf={},mf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function ff(l,t){return e.openBlock(),e.createElementBlock("svg",mf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const hf=pe(pf,[["render",ff]]),vf={},gf={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function yf(l,t){return e.openBlock(),e.createElementBlock("svg",gf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const kf=pe(vf,[["render",yf]]),bf={},xf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function wf(l,t){return e.openBlock(),e.createElementBlock("svg",xf,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const Ef=pe(bf,[["render",wf]]),Cf={},_f={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Nf(l,t){return e.openBlock(),e.createElementBlock("svg",_f,[...t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)])])}const zn=pe(Cf,[["render",Nf]]),Bf={},Sf={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Mf(l,t){return e.openBlock(),e.createElementBlock("svg",Sf,[...t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)])])}const Af=pe(Bf,[["render",Mf]]),Df={},Tf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Lf(l,t){return e.openBlock(),e.createElementBlock("svg",Tf,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)])])}const $f=pe(Df,[["render",Lf]]),If={class:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden flex flex-col"},Ff={class:"flex flex-col gap-2 !p-4 border-b border-gray-200 sm:flex-row sm:items-center sm:justify-between bg-gray-50"},Of={class:"relative w-full"},Pf={class:"flex flex-nowrap items-center justify-end gap-2 w-full overflow-x-auto"},Rf={class:"w-full overflow-x-auto"},zf={class:"w-full min-w-[640px] table-auto divide-y divide-gray-200"},jf={class:"bg-gray-50"},Uf={class:"border-b border-gray-200"},Hf={class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center"},qf=["onClick"],Wf={key:0,class:"text-gray-400"},Gf={key:0,colspan:"100%",class:"text-center"},Kf={class:"w-full"},Yf={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Zf=["onDragstart","onDragover","onDrop"],Jf={class:"px-4 py-3 text-center align-middle"},Xf={class:"flex items-center justify-center"},Qf=["innerHTML"],Vf={key:0,class:"flex items-center gap-3 text-sm text-gray-700"},eh={key:0},th=["src"],nh={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},lh={key:1,class:"flex items-center justify-center"},oh={key:2,class:"text-sm font-medium text-gray-900"},ah={class:"px-4 py-3 text-right whitespace-nowrap"},rh={class:"flex items-center justify-end gap-2"},sh=["onClick"],ih=["onClick"],ch={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},dh=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useSlots(),o=e.useModel(l,"modelValue"),a=e.ref({}),r=e.ref(""),s=e.ref(null),i=e.ref("asc"),c=e.computed(()=>{const T=o.value??[],P=r.value?T.filter(re=>t.colModel?.some(xe=>{const F=xe.key||xe.name;if(!F)return!1;const te=re[F];return te?Array.isArray(te)?te.join(", ").toLowerCase().includes(r.value.toLowerCase()):String(te).toLowerCase().includes(r.value.toLowerCase()):!1})):T;if(!s.value)return P;const X=s.value,J=[...P].sort((re,xe)=>{const F=ee(re?.[X]),te=ee(xe?.[X]);return typeof F=="number"&&typeof te=="number"?F-te:String(F).localeCompare(String(te))});return i.value==="asc"?J:J.reverse()}),d=e.ref(null),u=e.ref(null),p=e.ref(null),g=T=>{d.value=T},y=T=>{u.value=T},w=T=>{if(d.value===null||d.value===T){d.value=null,u.value=null;return}const P=[...o.value],[X]=P.splice(d.value,1);P.splice(T,0,X),o.value=P,d.value=null,u.value=null},m=()=>{p.value&&p.value.click()},f=T=>{const P=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],X=T.toLowerCase();return P.some(J=>X.endsWith(J))},E=T=>{const P=T.target.files?.[0];if(!P)return;const X=new FileReader;X.onload=J=>{try{const re=J.target?.result;if(typeof re=="string"){const xe=JSON.parse(re);Array.isArray(xe)&&o.value.push(...xe)}}catch(re){console.error("Error parsing file:",re)}},X.readAsText(P)},C=()=>{const T=JSON.stringify(o.value,null,2),P=new Blob([T],{type:"application/json"}),X=URL.createObjectURL(P),J=document.createElement("a");J.href=X,J.download="data.json",J.click(),URL.revokeObjectURL(X)},_=new Set(["autocomplete","select","radio","checkbox","combobox"]),b=new Map,x=(T,P)=>{const X=`/api/suggest/${T}`,J=X.includes("?")?"&":"?",re=P?`&val=${P}`:"";return`${X}${J}json=1${re}`},D=T=>T==null||T===""?null:typeof T=="object"?T?.id!==void 0&&T.id!==null&&T.id!==""?T.id:null:T,S=T=>{const P=new Set;return Array.isArray(o.value)&&o.value.forEach(X=>{const J=X?.[T];if(J==null||J==="")return;if(Array.isArray(J)){J.forEach(xe=>{const F=D(xe);F!==null&&P.add(F)});return}const re=D(J);re!==null&&P.add(re)}),P},M=async()=>{if(!t.colModel?.length)return;const T=t.colModel.filter(P=>P.data&&_.has(P.type?.toLowerCase()||""));T.length&&await Promise.all(T.map(async P=>{const X=P.key||P.name;if(!X)return;const J=S(X),re=Array.from(J).map(te=>String(te)).sort(),xe=re.join(",");if(!re.length||b.get(X)===xe)return;b.set(X,xe);const F=re.map(encodeURIComponent).join(",");try{const te=await(await fetch(x(P.data,F))).json();a.value[X]=te?.data??te}catch(te){console.error("Failed to fetch column values",te)}}))};e.watch([()=>t.colModel,()=>o.value],()=>{M()},{immediate:!0,deep:!0});const O=e.ref(""),K=e.ref(!1);let U="edit",R=0;const q=T=>(T?.format||T?.type||"").toString().toLowerCase(),N=e.computed(()=>t.colModel?.filter(T=>q(T)!=="slot").map(T=>{const{slot:P,...X}=T;return X})??[]),j=e.ref({}),$=e.ref({}),Z=T=>typeof T!="string"?!1:!!n[T],V=(T,P)=>P?P.split(".").reduce((X,J)=>X==null?X:X[J.trim()],T):T,oe=(T,P)=>typeof T!="string"?"":T.replace(/{{\s*([^}]+)\s*}}/g,(X,J)=>V(P,J.trim())??""),ee=T=>{if(T==null||T==="")return"";if(typeof T=="number")return T;if(typeof T=="boolean")return T?1:0;if(typeof T=="string")return T.toLowerCase();if(Array.isArray(T))return T.map(P=>ee(P)).join(", ");if(typeof T=="object"){if(T.text!==void 0)return String(T.text).toLowerCase();if(T.label!==void 0)return String(T.label).toLowerCase();if(T.id!==void 0)return String(T.id).toLowerCase()}return String(T).toLowerCase()},H=T=>{const P=T.key||T.name;if(P){if(s.value===P){i.value=i.value==="asc"?"desc":"asc";return}s.value=P,i.value="asc"}};async function ie(){O.value="Додати",K.value=!0,U="add",j.value={}}function Y(T,P){if(!T?.length)return null;const X=typeof P=="object"?P?.id:P;return X==null||X===""?null:T.find(J=>J?.id?.toString()===X.toString())?.text??null}function se(T){return T==null||T===""?"-":Array.isArray(T)?T.map(P=>typeof P=="object"?P?.text??P?.id??"-":P).join(", "):typeof T=="object"?T?.text??T?.id??"-":T}function ue(T,P){const X=P.key||P.name,J=T?.[X],re=a.value[X];if(!J)return"-";if(Array.isArray(J)){const F=J.map(te=>Y(re,te)).filter(Boolean);return F.length?F.join(", "):se(J)}return Y(re,J)||se(J)}async function he(T,P){O.value="Редагувати",K.value=!0,U="edit",R=P,j.value={...T}}function be(){const T=$.value.validate();if(T){fe.notify({type:"warning",title:"Помилка валідації",message:Object.entries(T).map(([P,X])=>`${P}: ${X}`).join(`
142
+ `)});return}U==="add"?Array.isArray(o.value)?o.value=[...o.value,j.value]:o.value=[j.value]:o.value=o.value.map((P,X)=>X===R?j.value:P),K.value=!1}function L(T){o.value=o.value.filter((P,X)=>X!==T)}function le(){K.value=!1}return(T,P)=>(e.openBlock(),e.createElementBlock("div",If,[e.createElementVNode("div",Ff,[e.createElementVNode("div",Of,[e.createVNode(hf,{width:"16",height:"16",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":P[0]||(P[0]=X=>r.value=X),placeholder:"Пошук",class:"w-full rounded-md border border-gray-200 bg-white pl-10 pr-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Pf,[e.createElementVNode("input",{ref_key:"fileInput",ref:p,onChange:E,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("button",{type:"button",onClick:m,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[e.createVNode(kf,{class:"text-gray-700",width:"16",height:"16"}),P[4]||(P[4]=e.createTextVNode(" Імпорт ",-1))]),e.createElementVNode("button",{type:"button",onClick:C,class:"inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"},[e.createVNode(Ef,{class:"text-gray-700",width:"16",height:"16"}),P[5]||(P[5]=e.createTextVNode(" Експорт ",-1))]),e.createElementVNode("button",{onClick:ie,type:"button",class:"inline-flex items-center gap-2 rounded-md bg-blue-500 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-600 transition-colors"},[e.createVNode(vt,{class:"text-white"}),P[6]||(P[6]=e.createTextVNode(" Додати ",-1))])])]),e.createElementVNode("div",Rf,[e.createElementVNode("table",zf,[e.createElementVNode("thead",jf,[e.createElementVNode("tr",Uf,[e.createElementVNode("th",Hf,[e.createVNode(zn,{width:"20",height:"20",class:"mx-auto text-gray-400"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.colModel,X=>(e.openBlock(),e.createElementBlock("th",{key:X.key,class:"px-4 py-3 text-left text-xs font-semibold text-gray-900"},[e.createElementVNode("button",{type:"button",onClick:J=>H(X),class:"flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"},[e.createElementVNode("span",null,e.toDisplayString(X.ua||X.label),1),s.value===(X.key||X.name)?(e.openBlock(),e.createElementBlock("span",Wf,e.toDisplayString(i.value==="asc"?"▲":"▼"),1)):e.createCommentVNode("",!0)],8,qf)]))),128)),P[7]||(P[7]=e.createElementVNode("th",{class:"px-4 py-3 text-left text-xs font-semibold text-gray-900 text-center w-[1%] whitespace-nowrap"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass(["divide-y divide-gray-200",{"[&_tr:last-child]:border-0":!u.value}])},[c.value.length===0?(e.openBlock(),e.createElementBlock("td",Gf,[e.createElementVNode("div",Kf,[e.createElementVNode("div",Yf,[e.createVNode(Af,{class:"w-48 mx-auto"}),P[8]||(P[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(X,J)=>(e.openBlock(),e.createElementBlock("tr",{key:X.id,class:e.normalizeClass(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700",{"opacity-50":d.value===J,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":u.value===J}]),draggable:"true",onDragstart:re=>g(J),onDragover:e.withModifiers(re=>y(J),["prevent"]),onDrop:re=>w(J)},[e.createElementVNode("td",Jf,[e.createElementVNode("div",Xf,[e.createVNode(zn,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.colModel,re=>(e.openBlock(),e.createElementBlock("td",{key:re.key,class:"px-4 py-3 align-middle"},[q(re)==="slot"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Z(re.slot)?e.renderSlot(T.$slots,re.slot,{key:0,row:X,value:X[re.key],column:re}):(e.openBlock(),e.createElementBlock("div",{key:1,class:"text-sm text-gray-900",innerHTML:oe(re.slot,X)},null,8,Qf))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[q(re)==="file"?(e.openBlock(),e.createElementBlock("div",Vf,[f(ue(X,re))?(e.openBlock(),e.createElementBlock("div",eh,[e.createElementVNode("img",{src:ue(X,re),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,th)])):(e.openBlock(),e.createElementBlock("div",nh,[e.createVNode(ca,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):q(re)==="color"?(e.openBlock(),e.createElementBlock("div",lh,[e.createElementVNode("span",{class:"inline-flex h-6 w-6 rounded border border-gray-200",style:e.normalizeStyle({backgroundColor:ue(X,re)||"#ffffff"})},null,4)])):(e.openBlock(),e.createElementBlock("div",oh,e.toDisplayString(ue(X,re)),1))],64))]))),128)),e.createElementVNode("td",ah,[e.createElementVNode("div",rh,[e.createElementVNode("button",{onClick:re=>he(X,J),class:"p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors"},[e.createVNode($f,{width:"16",height:"16"})],8,sh),e.createElementVNode("button",{onClick:re=>L(J),class:"p-1.5 text-gray-600 hover:text-red-600 hover:bg-red-50 rounded transition-colors"},[e.createVNode(Gt,{width:"16",height:"16"})],8,ih)])])],42,Zf))),128))],2)])]),e.createVNode(e.unref(fe.VsModal),{visible:K.value,title:O.value,size:"lg",onClose:le,teleport:"#modal"},{default:e.withCtx(()=>[e.createVNode(It,{schema:N.value,values:j.value,"onUpdate:values":P[1]||(P[1]=X=>j.value=X),form:$.value,"onUpdate:form":P[2]||(P[2]=X=>$.value=X)},null,8,["schema","values","form"]),e.createElementVNode("div",ch,[e.createElementVNode("button",{type:"button",onClick:P[3]||(P[3]=X=>K.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:be,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),uh={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:"Клацніть на шари, щоб видалити їх"}}}}},ph={},mh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function fh(l,t){return e.openBlock(),e.createElementBlock("svg",mh,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)])])}const hh=pe(ph,[["render",fh]]),vh={},gh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function yh(l,t){return e.openBlock(),e.createElementBlock("svg",gh,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)])])}const kh=pe(vh,[["render",yh]]),bh={},xh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function wh(l,t){return e.openBlock(),e.createElementBlock("svg",xh,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)])])}const Eh=pe(bh,[["render",wh]]),Ch={},_h={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function Nh(l,t){return e.openBlock(),e.createElementBlock("svg",_h,[...t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)])])}const Bh=pe(Ch,[["render",Nh]]),Sh={},Mh={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function Ah(l,t){return e.openBlock(),e.createElementBlock("svg",Mh,[...t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)])])}const Dh=pe(Sh,[["render",Ah]]),Th={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Lh={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},$h=["onClick"],Ih={class:"relative flex-1 min-w-[140px]"},Fh=["placeholder"],Oh="https://data.softpro.ua/api-user/gis-url-proxy",Ph="https://geo.rv.ua/api-user/dzk.api",Rh=e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(l,{emit:t}){const n=l,o=t,a=["here","xy","parcel"],r=e.computed(()=>{const b=n.config?.tools?.filter(x=>a.includes(x));return b&&b.length?b:a}),s=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),i=e.ref(r.value[0]??a[0]);e.watch(r,b=>{b.includes(i.value)||(i.value=b[0])});const c=e.ref(""),d=e.ref(!1),u=e.ref(null);e.watch(i,()=>{c.value="",d.value=!1});function p(b){i.value=b}function g(b){if(!d.value)return;const x=u.value;x&&!x.contains(b.target)&&(d.value=!1)}e.onMounted(()=>{window.addEventListener("click",g,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",g,!0)});function y(b){return b==="xy"?"Координати":b==="parcel"?"Кадастр":"Адреси"}function w(b){const x=b.replace(/[,]+/g," ").trim();if(!x)return null;const D=x.split(/\s+/).filter(Boolean);if(D.length<2)return null;const S=D.slice(0,2).map(Number);if(!S.every(N=>Number.isFinite(N)))return null;const[M,O]=S;let K=M,U=O;const R=N=>Math.abs(N)<=90,q=N=>Math.abs(N)<=180;if(!R(K)||!q(U))if(R(U)&&q(K))K=O,U=M;else return null;return{lat:K,lng:U}}function m(b){return(b?.items||[]).map((x,D)=>({id:String(x?.id??D),title:x?.title||x?.address?.label||"Знайдений обʼєкт",lat:Number(x?.position?.lat),lng:Number(x?.position?.lng)})).filter(x=>Number.isFinite(x.lat)&&Number.isFinite(x.lng))}function f(b){const x=b?.result||b?.data||b;if(!x)return[];const D=x.geom_centroid;if(!D||!Array.isArray(D.coordinates))return[];const[S,M]=D.coordinates;return!Number.isFinite(M)||!Number.isFinite(S)?[]:[{id:"parcel",title:x.cadnum||x.cad_num||"Земельна ділянка",lat:M,lng:S}]}function E(b){const x=b.replace(/\s+/g,"").split(":");if(x.length!==4)return!1;const D=[10,2,3,4];return x.every((S,M)=>S.length===D[M]&&/^\d+$/.test(S))}function C(b){o("goToCoordinates",[b.lat,b.lng])}async function _(){const b=c.value.trim();if(b){if(i.value==="xy"){const x=w(b);if(!x){fe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}C(x),c.value="";return}try{const x=new URL(i.value==="here"?Oh:Ph);if(i.value==="here")x.searchParams.set("searchtext",b);else{if(!E(b)){fe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}x.searchParams.set("cad_num",b)}const D=await fetch(x.toString());if(!D.ok)throw new Error(`HTTP ${D.status}`);const S=await D.json(),M=i.value==="here"?m(S):f(S);if(!M.length)fe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const O=M[0];C(O),c.value=""}}catch(x){const D=x?.message||"Помилка пошуку";fe.notify({type:"error",title:"Пошук",message:D})}}}return(b,x)=>(e.openBlock(),e.createElementBlock("div",Th,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(_,["prevent"])},[r.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:x[0]||(x[0]=D=>d.value=!d.value)},[e.createElementVNode("span",null,e.toDisplayString(y(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":d.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),d.value?(e.openBlock(),e.createElementBlock("div",Lh,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:S=>p(D)},e.toDisplayString(y(D)),9,$h))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",Ih,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=D=>c.value=D),placeholder:s.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Fh),[[e.vModelText,c.value,void 0,{trim:!0}]]),x[3]||(x[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),zh=pe(Rh,[["__scopeId","data-v-359172e4"]]),jh={class:"bg-white/30 p-1 rounded-md shadow w-fit"},Uh={class:"flex gap-2"},Hh=["onClick","title"],qh=["src"],Wh=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(l,{emit:t}){const n=e.ref(Object.keys(l.basemaps)[0]),o=t;function a(i){o("onLayerChange",i),n.value=i}const r={z:13,x:4790,y:2762};function s(i){if(i?.preview)return i.preview;if(!i?.url)return;const c={"{z}":r.z,"{x}":r.x,"{y}":r.y};let d=i.url;return Object.entries(c).forEach(([u,p])=>{d=d.replace(new RegExp(u,"gi"),String(p))}),d}return(i,c)=>(e.openBlock(),e.createElementBlock("div",jh,[e.createElementVNode("div",Uh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.basemaps,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":n.value===u}]),onClick:p=>a(u),title:d.name||u,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:s(d),alt:"",class:"w-10 h-10 object-cover"},null,8,qh)],10,Hh))),128))])]))}});function cn(l){return l?l.type==="Polygon"?{type:"MultiPolygon",coordinates:[l.coordinates]}:l.type==="Feature"?{...l,geometry:cn(l.geometry)}:l.type==="FeatureCollection"?{...l,features:(l.features||[]).map(t=>cn(t)).filter(Boolean)}:l:null}function Gh(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?cn(l):l.geom?{type:"Feature",geometry:cn({type:l.geom.type,coordinates:l.geom.coordinates}),properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:cn(l),properties:{}}:null:null}const Kh={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},Yh={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},Zh={class:"text-sm font-medium"},Jh={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Xh={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},Qh={class:"flex items-center gap-1"},Vh=["disabled"],ev=["disabled"],tv=["disabled"],nv={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"},lv={class:"space-y-0.5"},ov={class:"text-gray-500"},av={class:"text-gray-900 text-right break-all"},rv={class:"absolute top-4 right-4 z-[1000]"},sv={class:"flex flex-col gap-[2px]"},iv=["disabled"],cv=["disabled"],dv=["disabled"],uv=["disabled"],pv={class:"flex flex-col gap-2"},mv={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},fv={class:"flex flex-col gap-1"},hv=["checked","disabled","onChange"],vv={class:"text-gray-700 text-xs font-medium"},gv={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},yv={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},kv={class:"shrink-0"},bv={class:"font-bold"},xv={class:"flex items-center"},wv={class:"text-xs mr-2"},Ev={key:0,class:"text-xs"},Cv={key:1,class:"text-xs"},_v=["disabled"],Nv=["disabled"],jn="vs-base-tile-pane",Un="vs-overlay-tile-pane",Hn="__vs_form_leaflet_loader__",Pl="__vs_form_leaflet_scripts__",Bv=e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},ctrlZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},katottg:{default:""},layers:{default:()=>[]},bounds:{},api:{},center:{default:void 0},zoom:{default:void 0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=e.getCurrentInstance()?.appContext?.config?.globalProperties?.$settings??{},o=Array.isArray(n.center)&&n.center.length===2?n.center:[50,30],a=typeof n.zoom=="number"?n.zoom:typeof n.defaultZoom=="number"?n.defaultZoom:10,r=l,s=t,i=e.computed(()=>!!r.disabled),c=e.ref(!1),d=e.ref(null),u=e.ref(!1),p=e.ref(""),g=e.ref(null),y=e.ref(null),w=e.ref(!1),m=e.ref(null),f=e.ref(null),E=e.ref(0),C=e.ref(Array.isArray(r.center)&&r.center.length===2?[...r.center]:o),_=e.ref(typeof r.zoom=="number"?r.zoom:a),b=e.ref([]),x=e.ref(r.modelValue);let D=!1;const S=e.ref(null),M=e.computed(()=>{const h={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!r.tools?.length)return{...h,point:!0,line:!0,polygon:!0,rectangle:!0};const v=new Set(r.tools.map(B=>B.toLowerCase()));return{search:v.has("search"),import:v.has("import"),export:v.has("export"),point:v.has("point"),line:v.has("line"),polygon:v.has("polygon"),rectangle:v.has("rectangle")}}),O=e.reactive({}),K=e.ref([]),U=e.computed(()=>K.value.map(h=>O[h]).filter(Boolean)),R=e.ref(null),q=e.computed(()=>R.value?.entries??[]),N=e.computed(()=>{if(!R.value)return;const h=12,v=R.value.point.x+h,B=R.value.point.y+h;return{left:`${v}px`,top:`${B}px`}});function j(h){if(typeof h!="string"||!h.trim())return"";if(/^https?:\/\//i.test(h))return h;const v=window?.location?.origin??"",B=h.replace(/^\/+/,"");return B?v?`${v}/${B}`:`/${B}`:v}function $(){if(Array.isArray(n.basemaps)&&n.basemaps.length){const h=n.basemaps.map((v,B)=>{const k=String(v?.key??v?.id??v?.name??`b${B}`),A=j(String(v?.url??""));if(!A)return null;const I=typeof v?.preview=="string"&&v.preview?j(v.preview):"";return[k,{...v,url:A,preview:I}]}).filter(v=>Array.isArray(v)&&v.length===2).reduce((v,[B,k])=>(v[B]=k,v),{});if(Object.keys(h).length)return h}return{voyager:{name:"Оглядова карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{name:"Ортофото 1:10K",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{name:"Open Street Maps",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const Z=$(),V=Object.keys(Z),oe=e.ref(V.length?V[0]:"");let ee,H,ie,Y,se=null;async function ue(){if(typeof window>"u")return null;const h=window;if(h[Hn])return h[Hn];const v=I=>{if(!Array.from(document.styleSheets).some(ne=>ne?.href?.includes(I))){const ne=document.createElement("link");ne.rel="stylesheet",ne.href=I,document.head.appendChild(ne)}};h[Pl]=h[Pl]||{};const B=h[Pl],k=I=>(B[I]||(B[I]=fetch(I).then(ne=>{if(!ne.ok)throw new Error(`Failed to load ${I}: ${ne.status}`);return ne.text()}).then(ne=>{const ce=document.createElement("script");ce.textContent=`/* vs-form loader ${I} */
143
+ ${ne}`,document.head.appendChild(ce)})),B[I]),A=(async()=>{v("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),v("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),window.L||await k("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),await k("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"),await k("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js");const I=window.L;if(!I)throw new Error("Leaflet global not available after loading scripts");return I})().catch(I=>{throw delete h[Hn],I});return h[Hn]=A,A}function he(){const h=navigator.platform.toUpperCase().includes("MAC");return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":h?"Використовуйте Ctrl або ⌘ + прокрутка для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}function be(){if(!r.handleZoom||!d.value||!H)return null;let h;const v=k=>{const A=k.ctrlKey||k.metaKey||k.shiftKey;if(!r.ctrlZoom){u.value=!1,H.scrollWheelZoom.enable();return}if(!A){u.value=!0,p.value=he(),clearTimeout(h),h=window.setTimeout(()=>u.value=!1,1200);return}k.preventDefault(),k.stopPropagation(),u.value=!1,H.scrollWheelZoom.enable(),setTimeout(()=>H.scrollWheelZoom.disable(),120)},B=k=>{if(k.touches.length===1){if(!r.ctrlZoom)return;u.value=!0,p.value=he(),clearTimeout(h),h=window.setTimeout(()=>u.value=!1,3e3)}else u.value=!1};return d.value.addEventListener("wheel",v,{passive:!1}),d.value.addEventListener("touchstart",B,{passive:!0}),H.on("wheel",k=>{r.ctrlZoom&&(k.originalEvent?.ctrlKey||k.originalEvent?.metaKey||k.originalEvent?.shiftKey||(k.originalEvent?.preventDefault?.(),k.originalEvent?.stopPropagation?.()))}),()=>{d.value?.removeEventListener("wheel",v),d.value?.removeEventListener("touchstart",B),clearTimeout(h)}}function L(h,v){return h?.id?String(h.id):h?.url?`${h.url}-${v}`:`layer-${v}`}function le(h){const v=(h?.url??"").trim();if(!v)return"";if(/^https?:\/\//i.test(v))return v;const B=window.location?.origin??"",k=v.replace(/^\/+/,"");return`${B}/${k}`}function T(h){const v=h?.style??{};return B=>{const{colorAttr:k}=v,A=v.colorSet??{},I=typeof k=="string"?A?.[B?.[k]]??v.color??"#3388ff":v.color??"#3388ff",ne=v.stroke??I;return{weight:v.width??1,color:ne,opacity:v.opacity??1,fill:v.type?v.type!=="polyline":!0,fillColor:I,fillOpacity:v.opacity??.5}}}function P(h){return h?.layer?.properties||h?.layer?.feature?.properties||h?.properties||{}}function X(h,v={}){return h.popup===!1?[]:Array.isArray(h.popup)&&h.popup.length?h.popup.map(B=>{if(!B?.field)return null;const k=v[B.field];return k==null||k===""?null:{key:B.label||B.field,value:String(k)}}).filter(B=>!!B):Object.entries(v).filter(([B])=>typeof B=="string"&&B).slice(0,5).map(([B,k])=>({key:B,value:k==null?"—":String(k)}))}function J(h,v){if(!H||!v?.latlng)return;const B=H.latLngToContainerPoint(v.latlng),k=P(v),A=X(h,k);if(!A.length){re(h.id);return}R.value={layerId:h.id,title:k?.name||h.title||h.name,properties:k,entries:A,point:{x:B.x,y:B.y}}}function re(h){h&&R.value?.layerId!==h||(R.value=null)}function xe(h){const v=(h?.service??"").toLowerCase(),B=le(h),k=h.sourceLayer||h.layer||h.service_layer||h.service_key||h.map_key||h.dataset?.layer||h.id||h.table_name;if(v==="vtile"){const A=S.value;if(A?.vectorGrid?.protobuf&&!A?.maplibreGL){const I=A.vectorGrid.protobuf(B,{interactive:!0,maxNativeZoom:h.maxzoom??19,vectorTileLayerStyles:{[k??"default"]:T(h),default:T(h)}});return I?.on?.("mouseover",ne=>J(h,ne)),I?.on?.("mousemove",ne=>J(h,ne)),I?.on?.("mouseout",()=>re(h.id)),I}if(A?.maplibreGL&&window?.maplibregl){const I=B;return I?A.maplibreGL({style:I,interactive:!1,pane:"overlayPane"}):null}return null}return v==="tile"||/^https?:\/\//i.test(B)||B.includes("{z}")?S.value.tileLayer(B,{opacity:h?.style?.opacity??1,pane:Un}):S.value.tileLayer(B,{opacity:h?.style?.opacity??1,pane:Un})}function F(h){const v=S.value;if(!v)return null;const B=("bounds"in h?h.bounds:void 0)??r.bounds??b.value;if(!Array.isArray(B)||!B.length)return null;const k={color:h.style?.stroke??h.style?.color??"#2563eb",weight:h.style?.width??2,interactive:!1,opacity:h.style?.opacity??.8,dashArray:"4 4"},A=Array.isArray(h.bounds)&&h.bounds.length?h.bounds:B,I=te(A);if(!I.length||!v?.polyline)return null;const ne=I.map(ce=>{if(!ce.length)return ce;const Be=ce[0],Ne=ce[ce.length-1];return Be&&Ne&&typeof Ne.equals=="function"&&!Ne.equals(Be)?[...ce,Be]:ce});return v.polyline(ne,k)}function te(h){const v=S.value;if(!v||!Array.isArray(h))return[];const B=A=>{if(!Array.isArray(A)||A.length<2)return null;const[I,ne]=A;return!Number.isFinite(Number(ne))||!Number.isFinite(Number(I))?null:v.latLng(Number(ne),Number(I))},k=A=>Array.isArray(A)&&A.length>=2&&A.every(I=>Number.isFinite(Number(I)));if(h.length&&k(h[0])){const A=h.map(B).filter(Boolean);return A.length?[A]:[]}return h.length&&Array.isArray(h[0])&&Array.isArray(h[0][0])&&k(h[0][0][0])?h.flatMap(A=>Array.isArray(A)?A:[]).map(A=>Array.isArray(A)?A.map(B).filter(Boolean):[]).filter(A=>A.length):h.length&&Array.isArray(h[0])&&k(h[0][0])?h.map(A=>Array.isArray(A)?A.map(B).filter(Boolean):[]).filter(A=>A.length):[]}function ae(){if(!H||!S.value)return;se&&H.hasLayer(se)&&(H.removeLayer(se),se=null);const h=F({id:"global-bounds",bounds:r.bounds??b.value,style:{}});h&&(se=h,se.addTo(H))}function _e(){!H||!S.value||K.value.forEach(h=>{const v=O[h];v&&(v.visible?(v.layer||(v.layer=xe(v.config)),v.boundsLayer||(v.boundsLayer=F(v.config)),v.layer&&!H.hasLayer(v.layer)&&v.layer.addTo(H),v.boundsLayer&&!H.hasLayer(v.boundsLayer)&&v.boundsLayer.addTo(H)):(v.layer&&H.hasLayer(v.layer)&&H.removeLayer(v.layer),v.boundsLayer&&H.hasLayer(v.boundsLayer)&&H.removeLayer(v.boundsLayer),re(v.id)))})}function Ae(h){if(i.value)return;const v=O[h];v&&(v.visible=!v.visible,v.visible?(v.layer||(v.layer=xe(v.config)),v.boundsLayer||(v.boundsLayer=F(v.config)),v.layer&&!H.hasLayer(v.layer)&&v.layer.addTo(H),v.boundsLayer&&!H.hasLayer(v.boundsLayer)&&v.boundsLayer.addTo(H)):(v.layer&&H.hasLayer(v.layer)&&H.removeLayer(v.layer),v.boundsLayer&&H.hasLayer(v.boundsLayer)&&H.removeLayer(v.boundsLayer),re(v.id)))}e.watch(()=>r.layers,h=>{const v=Array.isArray(h)?h:[],B=[],k=new Set;v.forEach((A,I)=>{if(!A)return;const ne=L(A,I);B.push(ne),k.add(ne);const ce=O[ne],Be={...A,id:ne},Ne=ce?.visible??!!Be?.visible;ce&&(ce.layer&&H?.hasLayer(ce.layer)&&H.removeLayer(ce.layer),ce.boundsLayer&&H?.hasLayer(ce.boundsLayer)&&H.removeLayer(ce.boundsLayer),re(ne)),O[ne]={id:ne,config:Be,visible:Ne,layer:null,boundsLayer:null}}),Object.keys(O).forEach(A=>{if(!k.has(A)){const I=O[A];I?.layer&&H?.hasLayer(I.layer)&&H.removeLayer(I.layer),I?.boundsLayer&&H?.hasLayer(I.boundsLayer)&&H.removeLayer(I.boundsLayer),re(A),delete O[A]}}),K.value=B,_e()},{immediate:!0,deep:!0}),e.watch(()=>r.bounds,()=>{H&&(Object.values(O).forEach(h=>{h.boundsLayer&&H.hasLayer(h.boundsLayer)&&H.removeLayer(h.boundsLayer),h.boundsLayer=null}),ae(),_e())},{deep:!0}),e.watch(()=>r.katottg,async h=>{if(b.value=[],!h){ae();return}try{const v=await fetch(`https://data.gki.com.ua/api-user/atu/${h}`);if(!v?.ok)return;const B=(await v.json())?.geometry?.coordinates;Array.isArray(B)&&B.length&&(b.value=B)}catch(v){console.error("Failed to fetch KATOTTG bounds",v)}finally{ae(),_e()}},{immediate:!0}),e.watch(()=>r.modelValue,h=>{if(!H||!ie){x.value=h;return}ht(h)},{deep:!0});function Re(h){const v=S.value;return h instanceof v.Circle?"Circle":h instanceof v.Rectangle?"Rectangle":h instanceof v.Polygon&&!(h instanceof v.Rectangle)?"Polygon":h instanceof v.Polyline&&!(h instanceof v.Polygon)?"Polyline":h instanceof v.Marker?"Point":"Feature"}function Ye(h){const v=S.value;if(h instanceof v.Circle){const B=h.getRadius();return Math.PI*(B*B)/1e6}if(h instanceof v.Polygon||h instanceof v.Rectangle)try{const B=h.getLatLngs();if(!Array.isArray(B)||!B.length)return null;if(!Array.isArray(B[0])){const I=v.GeometryUtil?.geodesicArea?v.GeometryUtil.geodesicArea(B):0;return I?Math.abs(I)/1e6:0}const k=B[0];if(k.length>0&&(k[0]instanceof v.LatLng||typeof k[0]?.lat=="number")){const{feature:I}=h;if(I?.geometry?.type==="MultiPolygon"){const ce=B.reduce((Be,Ne)=>{if(!Array.isArray(Ne)||!Ne.length)return Be;if(v.GeometryUtil?.geodesicArea){const Ue=v.GeometryUtil.geodesicArea(Ne);if(Ue)return Be+Math.abs(Ue)}return Be},0);return ce?ce/1e6:0}const ne=v.GeometryUtil?.geodesicArea?v.GeometryUtil.geodesicArea(B):0;return ne?Math.abs(ne)/1e6:0}const A=B.reduce((I,ne)=>{if(!Array.isArray(ne)||!ne.length)return I;const ce=Array.isArray(ne[0])?ne[0]:ne;if(v.GeometryUtil?.geodesicArea){const Be=v.GeometryUtil.geodesicArea(ce);if(Be)return I+Math.abs(Be)}return I},0);return A?A/1e6:0}catch{return null}return null}function dt(h){return h instanceof S.value.Circle?h.getLatLng():h.getBounds?h.getBounds().getCenter():h.getLatLng?h.getLatLng():H.getCenter()}function Qe(h){const v=ie.toGeoJSON(),B=[],k=[];let A=null;const I=ce=>{if(ce)switch(ce.type){case"Point":A=ce;break;case"Polygon":B.push(ce.coordinates);break;case"MultiPolygon":B.push(...ce.coordinates);break;case"LineString":k.push(ce.coordinates);break;case"MultiLineString":k.push(...ce.coordinates);break;case"GeometryCollection":(ce.geometries||[]).forEach(I);break}};(v?.features||[]).forEach(ce=>I(ce.geometry));const ne=A||(B.length?{type:B.length===1?"Polygon":"MultiPolygon",coordinates:B.length===1?B[0]:B}:k.length?{type:k.length===1?"LineString":"MultiLineString",coordinates:k.length===1?k[0]:k}:null);!h?.silent&&!D&&s("update:modelValue",ne),E.value=ie.getLayers().length}function ht(h){if(!ie||!S.value)return;ie.clearLayers();const v=Gh(h);if(!v){y.value=null,E.value=0;return}S.value.geoJSON(v).eachLayer(k=>ie.addLayer(k)),D=!0,Qe({silent:!0}),D=!1,ze();const B=ie.getBounds?.();B?.isValid?.()&&H?.fitBounds(B,{padding:[24,24]})}function ze(){const h=ie.getLayers();if(!h.length){y.value=null,E.value=0;return}const v=h[h.length-1],B=Re(v),k=dt(v),A=ie.toGeoJSON(),I=A?.features?.some(Ne=>Ne.geometry?.type==="MultiPolygon")||A?.geometry?.type==="MultiPolygon",ne=h.length>1&&h.every(Ne=>Ne instanceof S.value.Polygon||Ne instanceof S.value.Rectangle),ce=I||ne;let Be=null;if(ce){const Ne=h.reduce((Ue,Ve)=>{const an=Ye(Ve);return Ue+(an?an*1e6:0)},0);Be=Ne?Ne/1e6:0}else Be=Ye(v);y.value={type:B,center:k,areaKm2:Be,layer:v},E.value=h.length}const Le=e.ref("");function je(h){if(i.value||!H||!S.value)return;Y?.disable&&Y.disable();const v=S.value;switch(h){case"marker":Y=new v.Draw.Marker(H);break;case"polyline":Y=new v.Draw.Polyline(H);break;case"polygon":Y=new v.Draw.Polygon(H);break;case"rectangle":Y=new v.Draw.Rectangle(H);break}Y.enable(),Le.value=h}function wt(){if(i.value)return;const h=y.value?.layer;h&&(h.getBounds?H.fitBounds(h.getBounds(),{padding:[30,30]}):h.getLatLng&&H.setView(h.getLatLng(),Math.max(_.value,14)))}function ut(){i.value||ie&&(ie.clearLayers(),s("update:modelValue",null),y.value=null,E.value=0)}const z=e.ref(null);function Q(){i.value||z.value?.click()}function W(h){if(i.value)return;const v=h.target,B=v.files?.[0];if(!B)return;const k=new FileReader;k.onload=()=>{try{const A=JSON.parse(String(k.result));ie.clearLayers(),A&&S.value.geoJSON(A).eachLayer(I=>ie.addLayer(I)),Qe(),ze()}finally{v.value=""}},k.readAsText(B)}function G(){if(i.value)return;const h=ie.toGeoJSON(),v=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),B=URL.createObjectURL(v),k=document.createElement("a");k.href=B,k.download="data.geojson",k.click(),URL.revokeObjectURL(B)}function ve(h){!H||!S.value||!Z[h]||(ee&&H.removeLayer(ee),ee=S.value.tileLayer(Z[h].url,{maxZoom:19,minZoom:6,pane:jn}).addTo(H),oe.value=h)}function me(h){if(!H||!S.value)return;const v=S.value.latLng(h[0],h[1]);H.setView(v,13)}let Ee=null;return e.onMounted(async()=>{S.value=await ue();const h=S.value;h.drawLocal=uh,H=h.map(d.value,{zoomControl:!1,scrollWheelZoom:!1}).setView(C.value,_.value),h.control.zoom({position:"bottomright"}).addTo(H);const v=oe.value||Object.keys(Z)[0];H.createPane(jn),H.getPane(jn).style.zIndex="180",H.createPane(Un),H.getPane(Un).style.zIndex="220",v&&Z[v]&&(oe.value=v,ee=h.tileLayer(Z[v].url,{maxZoom:19,minZoom:6,pane:jn}).addTo(H)),ie=new h.FeatureGroup().addTo(H),H.on(h.Draw.Event.CREATED,k=>{if(i.value)return;const{layer:A}=k;ie.clearLayers(),ie.addLayer(A),Qe(),ze(),Le.value=""}),H.on(h.Draw.Event.EDITED,()=>{i.value||(Qe(),ze())}),H.on(h.Draw.Event.DELETED,()=>{i.value||(Qe(),ze())});let B=!1;H.on("mousemove",k=>{B||(H.invalidateSize(),B=!0)}),H.on("zoomend",()=>{_.value=H.getZoom()}),Ee=be(),_e(),ae(),x.value!==void 0&&(ht(x.value),x.value=void 0)}),e.watch(()=>r.center,h=>{!Array.isArray(h)||h.length!==2||(C.value=[...h],H&&H.setView(C.value,H.getZoom()))},{deep:!0}),e.watch(()=>r.zoom,h=>{typeof h=="number"&&(_.value=h,H&&H.setZoom(h))}),e.onUnmounted(()=>{Ee?.(),re(),se&&H?.hasLayer(se)&&(H.removeLayer(se),se=null),H?.remove&&H.remove()}),e.watch(c,()=>{setTimeout(()=>{H?.invalidateSize&&H.invalidateSize()},50)}),e.watch(w,async h=>{if(!h||!f.value){m.value=null;return}await e.nextTick();const v=f.value.getBoundingClientRect();m.value={top:v.bottom+6,left:v.left}}),(h,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!c.value},[e.createElementVNode("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:c.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:d,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[u.value&&r.handleZoom?(e.openBlock(),e.createElementBlock("div",Kh,[e.createElementVNode("div",Yh,[e.createElementVNode("p",Zh,e.toDisplayString(p.value),1)])])):e.createCommentVNode("",!0)]),_:1}),M.value.search||M.value.import||M.value.export?(e.openBlock(),e.createElementBlock("div",Jh,[M.value.search?(e.openBlock(),e.createBlock(zh,{key:0,onGoToCoordinates:me})):e.createCommentVNode("",!0),M.value.import||M.value.export?(e.openBlock(),e.createElementBlock("div",Xh,[e.createElementVNode("div",Qh,[M.value.import?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Q,disabled:i.value}," Import ",8,Vh)):e.createCommentVNode("",!0),M.value.export?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:G,disabled:i.value||E.value===0}," Export ",8,ev)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"importRef",ref:z,type:"file",onChange:W,accept:".json,.geojson",class:"hidden",disabled:i.value},null,40,tv)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),q.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"absolute z-[1500] pointer-events-none",style:e.normalizeStyle(N.value)},[e.createElementVNode("div",nv,[e.createElementVNode("dl",lv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,B=>(e.openBlock(),e.createElementBlock("div",{key:`${B.key}-${B.value}`,class:"flex justify-between gap-2"},[e.createElementVNode("dt",ov,e.toDisplayString(B.key),1),e.createElementVNode("dd",av,e.toDisplayString(B.value),1)]))),128))])])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",rv,[e.createElementVNode("div",sv,[M.value.point?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="marker"}]),title:"Point",onClick:v[0]||(v[0]=B=>je("marker")),disabled:i.value},[e.createVNode(hh)],10,iv)):e.createCommentVNode("",!0),M.value.line?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="polyline"}]),title:"Line",onClick:v[1]||(v[1]=B=>je("polyline")),disabled:i.value},[e.createVNode(kh)],10,cv)):e.createCommentVNode("",!0),M.value.polygon?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="polygon"}]),title:"Polygon",onClick:v[2]||(v[2]=B=>je("polygon")),disabled:i.value},[e.createVNode(Eh)],10,dv)):e.createCommentVNode("",!0),M.value.rectangle?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vs-btn",{"vs-active":Le.value==="rectangle"}]),title:"Rectangle",onClick:v[3]||(v[3]=B=>je("rectangle")),disabled:i.value},[e.createVNode(Bh)],10,uv)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:v[4]||(v[4]=B=>c.value=!c.value),title:"Full Screen"},[e.createVNode(Dh,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",y.value?"bottom-8":"bottom-4"])},[e.createElementVNode("div",pv,[e.createVNode(Wh,{basemaps:e.unref(Z),onOnLayerChange:ve},null,8,["basemaps"]),U.value.length?(e.openBlock(),e.createElementBlock("div",mv,[v[9]||(v[9]=e.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Шари",-1)),e.createElementVNode("div",fv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,B=>(e.openBlock(),e.createElementBlock("label",{key:B.id,class:"flex items-center gap-2 cursor-pointer select-none"},[e.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:B.visible,disabled:i.value,onChange:k=>Ae(B.id)},null,40,hv),e.createElementVNode("span",vv,e.toDisplayString(B.config.title||B.config.name||B.id),1)]))),128))])])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",gv,[y.value?(e.openBlock(),e.createElementBlock("div",yv,[e.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:v[5]||(v[5]=B=>w.value=!0),onMouseleave:v[6]||(v[6]=B=>w.value=!1)},[e.createElementVNode("div",kv,[v[10]||(v[10]=e.createTextVNode(" Type: ",-1)),e.createElementVNode("span",bv,e.toDisplayString(y.value.type),1)]),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"addressEl",ref:f,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+e.toDisplayString(g.value),513)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[w.value&&g.value&&m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:e.normalizeStyle({top:m.value.top+"px",left:m.value.left+"px"})},e.toDisplayString(g.value),5)):e.createCommentVNode("",!0)]))],32),e.createElementVNode("div",xv,[e.createElementVNode("div",wv,[v[11]||(v[11]=e.createTextVNode(" Center: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.center.lat.toFixed(5))+", "+e.toDisplayString(y.value.center.lng.toFixed(5)),1)]),y.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",Ev,[v[12]||(v[12]=e.createTextVNode(" Area: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.areaKm2.toFixed(1))+" km²",1)])):(e.openBlock(),e.createElementBlock("div",Cv,[...v[13]||(v[13]=[e.createTextVNode("Area: ",-1),e.createElementVNode("b",null,"—",-1)])])),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:v[7]||(v[7]=B=>wt()),disabled:i.value},[...v[14]||(v[14]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-3 h-3"},[e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),e.createElementVNode("path",{d:"M7 10l6 0"}),e.createElementVNode("path",{d:"M10 7l0 6"}),e.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)])],8,_v),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:v[8]||(v[8]=B=>ut()),disabled:i.value},[e.createVNode(Gt,{class:"w-3 h-3"})],8,Nv)])])):e.createCommentVNode("",!0)])],2)],8,["disabled"]))}}),Sv=pe(Bv,[["__scopeId","data-v-9ae03533"]]),Mv=["data-focus"],Av={class:"flex items-center"},Dv={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},Tv=["onClick","aria-label"],Lv={key:0,class:"absolute text-gray-500 truncate pl-2"},$v={class:"flex-1 min-w-[2px]"},Iv=["placeholder"],Fv={class:"flex items-center shrink-0"},Ov=["disabled"],Pv=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=t;Xe(n.style);const a=e.ref(null),r=e.ref(null),s=e.ref(null),i=e.ref(!1),c=e.ref(""),d=e.useModel(l,"modelValue"),u=e.computed(()=>n.placeholder||"Add tag…"),p=e.computed(()=>d.value?.length===0&&c.value===""),g=e.computed(()=>!n.disabled&&d.value?.length>0),y=e.computed(()=>n.disabled),w=async()=>{y.value||await e.nextTick(()=>s.value?.focus())},m=D=>{const S=D.trim();S!==""&&(!d.value||!Array.isArray(d.value)?d.value=[S]:n.unique?d.value.includes(S)||(d.value=[...d.value,S]):d.value=[...d.value,S],c.value="")},f=()=>{const D=c.value;D.trim()!==""&&m(D),c.value=""},E=D=>{const S=d.value.slice();S.splice(D,1),o("update:modelValue",S)},C=()=>{o("update:modelValue",[])},_=()=>{y.value||(i.value=!0)},b=()=>{i.value=!1,!y.value&&f()},x=D=>{const{key:S}=D;S==="Enter"?(D.preventDefault(),f()):S==="Backspace"&&c.value===""&&d.value.length>0&&E(d.value.length-1)};return(D,S)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:a,onClick:S[1]||(S[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",y.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:w},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:r},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(M,O)=>(e.openBlock(),e.createElementBlock("div",{key:O,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",Av,[e.createElementVNode("div",Dv,e.toDisplayString(M),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(K=>E(O),["stop"]),"aria-label":`Remove ${M}`},[...S[2]||(S[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Tv)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",Lv,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",$v,[y.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:s,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":S[0]||(S[0]=M=>c.value=M),onFocus:_,onBlur:b,onKeydown:x,placeholder:d.value&&d.value.length?"":void 0},null,40,Iv)),[[e.vModelText,c.value]])])],512),e.createElementVNode("div",Fv,[g.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:y.value,onClick:e.withModifiers(C,["stop"])},[...S[3]||(S[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)])],8,Ov)):e.createCommentVNode("",!0)])],10,Mv)],2)],512))}}),Rv={class:"relative flex gap-1 bg-white w-full"},zv=["disabled","placeholder"],jv=e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.inject("values"),n=l,o=e.useModel(l,"modelValue");function a(s){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return s.toLowerCase().split("").map(c=>i[c]||c).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const r=()=>{const s=t?.value?.[n.parent||""]?.toString(),i=a(s);o.value=i.toString()};return(s,i)=>(e.openBlock(),e.createElementBlock("div",Rv,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:s.disabled,placeholder:s.placeholder,"onUpdate:modelValue":i[0]||(i[0]=c=>o.value=c),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,zv),[[e.vModelText,o.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:r}," Gen ")]))}}),Uv=pe(jv,[["__scopeId","data-v-cb7b2b74"]]),Hv={class:"relative flex gap-1 bg-white w-full"},qv=["disabled","placeholder"],Wv=["disabled"],Gv={key:0},Kv={key:1},Yv=e.defineComponent({__name:"vs-input-codegen",props:e.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(!1),a=e.computed(()=>t.init!==!1),r=e.computed(()=>!!t.table&&!!t.code),s=()=>{if(!r.value)return"";const d=encodeURIComponent(String(t.table)),u=encodeURIComponent(String(t.code));return`/api/code-gen/${d}/${u}`},i=async()=>{if(!r.value||o.value)return;const d=s();if(d){o.value=!0;try{const u=await(await fetch(d)).text();n.value=u}finally{o.value=!1}}},c=()=>{a.value&&(n.value||i())};return e.onMounted(()=>{c()}),e.watch(()=>[t.table,t.code,t.init],()=>{c()}),(d,u)=>(e.openBlock(),e.createElementBlock("div",Hv,[e.withDirectives(e.createElementVNode("input",{disabled:d.disabled,placeholder:d.placeholder,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,qv),[[e.vModelText,n.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:o.value||d.disabled||!r.value,onClick:i},[o.value?(e.openBlock(),e.createElementBlock("span",Kv,"...")):(e.openBlock(),e.createElementBlock("span",Gv,"Gen"))],8,Wv)]))}}),Zv=pe(Yv,[["__scopeId","data-v-8f88fb66"]]),Jv={class:"w-full"},Xv={ref:"sortableContainer",class:"flex flex-col gap-1"},Qv=["onDragstart","onDrop"],Vv={class:"w-1/3"},e0={class:"w-2/3"},t0=["onClick"],n0={key:0,class:"text-[14px] text-gray-700"},l0={class:"mt-2 w-full flex items-center"},o0=["disabled"],a0=e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=m=>`${m}-${Math.random().toString(36).substring(2,15)}`,o=e.inject("values"),a=l,r=t,s=a.addButtonText??"Додати",i=a.ignore??[],c=e.ref([]),d=e.ref(null);(()=>{const m=a.parent&&o?.value?.[a.parent]||a.modelValue||{};c.value=Object.entries(m).filter(([f])=>!i.includes(f)).map(([f,E])=>({id:n("key-value-"),key:f,value:E}))})();function u(m){d.value=m}function p(m){if(d.value===null||d.value===m)return;const f=c.value.splice(d.value,1)[0];c.value.splice(m,0,f),d.value=null}const g=e.computed(()=>c.value.some(m=>m.key&&!m.value||!m.key&&m.value)),y=()=>{c.value.push({id:n("key-value-"),key:"",value:""})},w=m=>{c.value=c.value.filter(f=>f.id!==m)};return e.watch(c,m=>{const f={};m.forEach(C=>{C.key&&C.value!==void 0&&(f[C.key]=C.value)});const E={};i.length&&i.forEach(C=>{E[C]=a.parent?o?.value?.[a.parent]?.[C]:void 0}),o?.value&&a.parent&&(o.value[a.parent]={...E,...f}),r("update:modelValue",f)},{deep:!0}),(m,f)=>(e.openBlock(),e.createElementBlock("div",Jv,[e.createElementVNode("div",Xv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(E,C)=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":d.value===C}]),draggable:"true",onDragstart:_=>u(C),onDragover:f[0]||(f[0]=e.withModifiers(()=>{},["prevent"])),onDrop:_=>p(C)},[f[1]||(f[1]=e.createStaticVNode('<button class="cursor-move" data-v-2ae5f16f><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-2ae5f16f><circle cx="15" cy="12" r="1.5" data-v-2ae5f16f></circle><circle cx="15" cy="24" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="12" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="24" r="1.5" data-v-2ae5f16f></circle><circle cx="21" cy="18" r="1.5" data-v-2ae5f16f></circle><circle cx="15" cy="18" r="1.5" data-v-2ae5f16f></circle></svg></button>',1)),e.createElementVNode("div",Vv,[e.createVNode(sn,{modelValue:E.key,"onUpdate:modelValue":_=>E.key=_,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",e0,[e.createVNode(sn,{modelValue:E.value,"onUpdate:modelValue":_=>E.value=_,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:_=>w(E.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(Pn),{height:"16",width:"16"})],8,t0)],42,Qv))),128))],512),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",n0," Дані для відображення відсутні ")),e.createElementVNode("div",l0,[e.createElementVNode("button",{type:"button",onClick:y,disabled:g.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(vt,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s)),1)],8,o0)])]))}}),r0=pe(a0,[["__scopeId","data-v-2ae5f16f"]]),s0={class:"w-full"},i0={ref:"sortableContainer",class:"flex flex-col gap-1"},c0=["onDragstart","onDrop"],d0=["disabled"],u0={class:"flex-1"},p0=["onClick","disabled"],m0={key:0,class:"text-[14px] text-gray-700"},f0={class:"mt-2 w-full flex items-center"},h0=["disabled"],v0=e.defineComponent({__name:"vs-input-text-array",props:e.mergeModels({addButtonText:{default:"Додати"},inputType:{default:"text"},placeholder:{default:"Значення"},mask:{default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref([]),a=e.ref(null),r=e.computed(()=>!!t.disabled),s=e.computed(()=>t.placeholder??""),i=e.computed(()=>t.addButtonText??"Додати");let c=!1;const d=f=>`${f}-${Math.random().toString(36).substring(2,15)}`,u=f=>{const E=f??n.value??[];o.value=E.map((C,_)=>({id:o.value[_]?.id??d("text-array"),value:C??""}))};u(),e.watch(()=>n.value,f=>{if(c){c=!1;return}u(f||[])},{deep:!0}),e.watch(o,f=>{c=!0,n.value=f.map(E=>E.value).filter(E=>E!=null&&E!=="")},{deep:!0});const p=e.computed(()=>r.value||o.value.some(f=>!f.value));function g(){p.value||(o.value=[...o.value,{id:d("text-array"),value:""}])}function y(f){r.value||(o.value=o.value.filter(E=>E.id!==f))}function w(f){r.value||(a.value=f)}function m(f){if(r.value||a.value===null||a.value===f)return;const E=[...o.value],[C]=E.splice(a.value,1);E.splice(f,0,C),o.value=E,a.value=null}return(f,E)=>(e.openBlock(),e.createElementBlock("div",s0,[e.createElementVNode("div",i0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":a.value===_}]),draggable:"true",onDragstart:b=>w(_),onDragover:E[0]||(E[0]=e.withModifiers(()=>{},["prevent"])),onDrop:b=>m(_)},[e.createElementVNode("button",{class:"cursor-move",type:"button",disabled:r.value},[...E[1]||(E[1]=[e.createStaticVNode('<svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-77ce3498><circle cx="15" cy="12" r="1.5" data-v-77ce3498></circle><circle cx="15" cy="24" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="12" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="24" r="1.5" data-v-77ce3498></circle><circle cx="21" cy="18" r="1.5" data-v-77ce3498></circle><circle cx="15" cy="18" r="1.5" data-v-77ce3498></circle></svg>',1)])],8,d0),e.createElementVNode("div",u0,[f.inputType==="text"?(e.openBlock(),e.createBlock(sn,{key:0,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="tel"?(e.openBlock(),e.createBlock(aa,{key:1,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="email"?(e.openBlock(),e.createBlock(oa,{key:2,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])):e.createCommentVNode("",!0),f.inputType==="mask"?(e.openBlock(),e.createBlock(Il,{key:3,modelValue:C.value,"onUpdate:modelValue":b=>C.value=b,mask:f.mask,disabled:r.value,placeholder:s.value},null,8,["modelValue","onUpdate:modelValue","mask","disabled","placeholder"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:b=>y(C.id),disabled:r.value,class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"},[e.createVNode(e.unref(Pn),{height:"16",width:"16"})],8,p0)],42,c0))),128))],512),o.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",m0," Дані для відображення відсутні ")),e.createElementVNode("div",f0,[e.createElementVNode("button",{type:"button",onClick:g,disabled:p.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(vt,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(i.value),1)],8,h0)])]))}}),g0=pe(v0,[["__scopeId","data-v-77ce3498"]]),y0={class:"flex items-center gap-2 w-full"},k0=["disabled"],b0=["disabled"],x0=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,{inputClass:o}=Xe(n.style),a=t,r=e.computed({get:()=>n.modelValue||"#000000",set:i=>a("update:modelValue",i)}),s=e.computed(()=>!!n.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",y0,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),disabled:s.value,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[i.modelValue?"":"text-opacity-50",e.unref(o)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,k0),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),disabled:s.value},null,8,b0),[[e.vModelText,r.value]])]))}}),w0={class:"flex items-center gap-2 w-full"},E0=["min","max","step","disabled"],C0=["disabled"],_0=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},maxlength:{},minlength:{},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(l,{emit:t}){const n=l,{inputClass:o}=Xe(n.style),a=t,r=e.computed({get:()=>Number(n.modelValue??n.min),set:i=>a("update:modelValue",Number(i))}),s=e.computed(()=>!!n.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",w0,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),min:i.min,max:i.max,step:i.step,disabled:s.value,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[i.modelValue?"":"text-opacity-50",e.unref(o)].join(" ")])},null,10,E0),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),disabled:s.value},null,8,C0),[[e.vModelText,r.value]])]))}}),N0=["placeholder","disabled","name"],B0=["type","value","onInput","placeholder","disabled"],S0=["onClick"],M0=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:1},mask:{default:""},unmask:{type:Boolean,default:!1},inputType:{default:"text"},isAdded:{type:Boolean,default:!1},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.ref(t.count),o=e.computed(()=>t.limit),{inputClass:a}=Xe(t.style),r=e.useModel(l,"modelValue"),s=e.computed(()=>!!t.disabled),i=e.computed(()=>t.placeholder??"");e.watchEffect(()=>{const m=r.value?.length??0;m<n.value&&(r.value=[...r.value??[],...Array(n.value-m)])});const c=e.ref({}),d=e.ref({});function u(m,f){m&&(c.value[f]=m)}async function p(m,f){if(!m||t.inputType!=="mask")return;const{default:E}=await Promise.resolve().then(()=>zo);d.value[f]&&d.value[f].destroy(),d.value[f]=E(m,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),d.value[f].on("accept",()=>{const C=[...r.value||[]];C[f]=t.unmask?d.value[f].unmaskedValue:d.value[f].value,r.value=C}),d.value[f].on("complete",()=>{const C=[...r.value||[]];C[f]=t.unmask?d.value[f].unmaskedValue:d.value[f].value,r.value=C}),r.value?.[f]&&(d.value[f].value=r.value[f])}function g(m,f){if(s.value)return;const E=m.target.value??null,C=[...r.value];C[f]=t.inputType==="text"?E:Number(E),r.value=C}function y(){n.value+=1;const m=t.inputType==="text"||t.inputType==="mask"?null:0;r.value=[...r.value,m],t.inputType==="mask"&&setTimeout(()=>{const f=n.value-1;c.value[f]&&p(c.value[f],f)},0)}function w(m){if(n.value>1){d.value[m]&&(d.value[m].destroy(),delete d.value[m]),n.value-=1,r.value=r.value.filter((E,C)=>C!==m);const f={};Object.keys(d.value).forEach(E=>{const C=parseInt(E,10);C>m?f[C-1]=d.value[C]:C<m&&(f[C]=d.value[C])}),d.value=f}}return e.onMounted(()=>{if(t.inputType==="mask")for(let m=0;m<n.value;m+=1)c.value[m]&&p(c.value[m],m)}),e.onBeforeUnmount(()=>{Object.values(d.value).forEach(m=>{m&&m.destroy()})}),e.watch(()=>t.mask,m=>{t.inputType==="mask"&&Object.values(d.value).forEach(f=>{f&&f.updateOptions({mask:m,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})})}),e.watch(r,m=>{t.inputType==="mask"&&m&&m.forEach((f,E)=>{d.value[E]&&d.value[E].value!==f&&(d.value[E].value=f||"")})},{deep:!0}),(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${o.value}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"flex items-center gap-2 w-full"},[m.inputType==="mask"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",ref_for:!0,ref:C=>u(C,E-1),placeholder:m.placeholder,disabled:m.disabled,name:`${m.name}[${E-1}]`,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":m.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,N0)):(e.openBlock(),e.createElementBlock("input",{key:1,type:m.inputType,value:r.value?.[E-1],onInput:C=>g(C,E-1),placeholder:i.value,disabled:s.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":m.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,B0)),!m.disabled&&E===n.value&&m.isAdded?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",onClick:e.withModifiers(y,["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-green-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[e.createVNode(vt,{height:"18",width:"18"})])):e.createCommentVNode("",!0),!m.disabled&&n.value>1&&m.isAdded?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",onClick:e.withModifiers(C=>w(E-1),["stop"]),class:"cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"},[e.createVNode(Pn,{height:"18",width:"18"})],8,S0)):e.createCommentVNode("",!0)]))),128))],2))}}),A0=["aria-expanded","data-focus"],D0=["placeholder","disabled","readonly"],T0={class:"max-h-full"},L0=["onClick","disabled"],$0={key:0,class:"px-3 py-2 text-sm text-stone-500"},I0={class:"flex flex-col gap-1"},F0=["onDragstart","onDrop"],O0=["disabled"],P0=["title"],R0=["disabled","onClick","aria-label"],z0={key:0,class:"text-xs text-stone-500"},j0=e.defineComponent({__name:"vs-input-array-select",props:e.mergeModels({options:{default:()=>[]},data:{default:""},api:{default:""},prefix:{default:"api"},host:{default:""},parent:{},search:{type:Boolean,default:!0},maxHeight:{default:280},start:{default:0},slot:{},disabled:{type:Boolean,default:!1},style:{},customClass:{},modelValue:{},error:{},name:{},placeholder:{default:"Оберіть значення"},maxlength:{},minlength:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["change","update:modelValue","value-selected"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=t,a=e.useModel(l,"modelValue"),r=e.ref([]),s=e.ref(n.options??[]),i=e.ref({}),c=e.ref({}),d=e.ref({keyword:"",parent:null}),u=e.ref(""),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref(null);let m=!1,f=!1;const E=e.inject("values"),C=e.computed(()=>!!n.disabled),_=e.computed(()=>n.placeholder??"Оберіть значення"),b=e.computed(()=>n.search!==!1),x=e.computed(()=>`${n.maxHeight??280}px`),D=e.computed(()=>{const F=n.parent??n.parentValue;return F?String(F):""}),S=e.computed(()=>D.value?E?.value?.[D.value]??null:null),M=F=>F==null?"__null__":String(F),O=F=>{if(!F)return"";const te=F.label??F.text??F.name??F.ua??F.en;return te?String(te):F.id!==void 0&&F.id!==null?String(F.id):""},K=F=>{const te=M(F);return c.value[te]||(c.value[te]=`array-select-${te}-${Math.random().toString(36).slice(2,8)}`),c.value[te]},U=e.computed(()=>new Set(r.value.map(F=>M(F.id)))),R=e.computed(()=>{const F=U.value;let te=[...s.value];if(!n.data&&u.value.trim()){const ae=u.value.toLowerCase();te=te.filter(_e=>O(_e).toLowerCase().includes(ae))}return te.filter(ae=>!F.has(M(ae.id)))}),q=()=>{if(!n.data)return"";const F=n.prefix??"api",te=n.api??`/${F}/suggest/${n.data}`;return`${n.host??""}${te}`},N=()=>{r.value.length&&(m=!0,r.value=r.value.map(F=>({...F,text:i.value[M(F.id)]??F.text})))},j=F=>{const te=M(F.id),ae=O(F);ae&&(i.value[te]=ae)},$=F=>{s.value=F?[...F]:[],F?.forEach(j),N()},Z=F=>{if(!F.length)return;const te=new Map(s.value.map(ae=>[M(ae.id),ae]));F.forEach(ae=>{const _e=M(ae.id);te.set(_e,ae),j(ae)}),s.value=Array.from(te.values()),N()},V=async(F="")=>{if(!n.data)return[];const te=q();if(!te)return[];const ae=new URLSearchParams;ae.set("json","1"),F&&ae.set("key",F),n.start===1&&ae.set("start","1"),S.value!==null&&S.value!==void 0&&S.value!==""&&ae.set("parent",String(S.value));try{return(await(await fetch(`${te}?${ae.toString()}`)).json())?.data??[]}catch{return[]}},oe=async F=>{if(!n.data||!F.length)return[];const te=q();if(!te)return[];const ae=Array.from(new Set(F.map(Ae=>M(Ae)))),_e=new URLSearchParams;_e.set("json","1"),_e.set("val",ae.join(",")),n.start===1&&_e.set("start","1"),S.value!==null&&S.value!==void 0&&S.value!==""&&_e.set("parent",String(S.value));try{const Ae=(await(await fetch(`${te}?${_e.toString()}`)).json())?.data??[];return Z(Ae),Ae}catch{return[]}},ee=async(F="",{force:te=!1}={})=>{if(!n.data)return;const ae=S.value??null;if(!te&&d.value.keyword===F&&d.value.parent===ae&&s.value.length>0)return;d.value={keyword:F,parent:ae};const _e=await V(F);$(_e)},H=((F,te=200)=>{let ae;return(..._e)=>{ae&&clearTimeout(ae),ae=setTimeout(()=>F(..._e),te)}})(async F=>{n.data&&await ee(F,{force:!0})},250),ie=e.ref(null),Y=async(F="click")=>{C.value||p.value||(ie.value=F,await ee(u.value.trim()),p.value=!0,await e.nextTick(),w.value?.focus())},se=()=>{p.value=!1,ie.value=null,e.nextTick(()=>{w.value?.blur()})},ue=async F=>{if(F.stopPropagation(),!C.value){if(p.value){if(ie.value==="focus"){ie.value=null;return}se();return}await Y("click")}},he=F=>{F.key==="Escape"&&se()},be=F=>{const te=F.target;y.value?.contains(te)||se()},L=F=>{if(F.key==="Escape"){F.preventDefault(),se();return}if(F.key==="Enter"){F.preventDefault();const te=R.value[0];te&&le(te)}},le=F=>{if(!F)return;const te=M(F.id);if(U.value.has(te))return;j(F);const ae={id:F.id,text:O(F)||String(F.id??""),key:K(F.id)};r.value=[...r.value,ae],T(F),u.value="",e.nextTick(()=>{w.value?.focus()})},T=F=>{const te=r.value.map(ae=>ae.id);o("value-selected",{name:n.name,value:te,option:F})},P=F=>{if(C.value)return;const te=r.value.filter(ae=>M(ae.id)!==M(F));r.value=te},X=F=>{C.value||(g.value=F)},J=F=>{if(C.value||g.value===null||g.value===F)return;const te=[...r.value],[ae]=te.splice(g.value,1);te.splice(F,0,ae),g.value=null,r.value=te},re=async()=>{const F=(Array.isArray(a.value)?[...a.value]:[]).filter(ae=>ae!=null);if(n.data&&F.length){const ae=F.filter(_e=>!i.value[M(_e)]);ae.length&&await oe(ae)}const te=F.map(ae=>({id:ae,text:i.value[M(ae)]??String(ae),key:K(ae)}));m=!0,r.value=te};e.watch(r,F=>{if(m){m=!1;return}const te=F.map(ae=>ae.id);f=!0,a.value=te,o("change",te)},{deep:!0}),e.watch(a,()=>{if(f){f=!1;return}re()},{deep:!0}),e.watch(u,F=>{!n.data||!p.value||H(F.trim())}),e.watch(C,F=>{F&&se()}),e.watch(()=>n.options,async F=>{n.data||($(F??[]),await re())},{immediate:!0,deep:!0}),e.watch(()=>n.data,async F=>{F&&(await ee(u.value.trim()),await re())},{immediate:!0});const xe=e.ref(!1);return e.watch(S,async()=>{if(n.data){if(!xe.value){xe.value=!0;return}r.value=[],await ee(u.value.trim()),await re()}}),e.onMounted(async()=>{document.addEventListener("click",be,!0),window.addEventListener("keydown",he),await re()}),e.onUnmounted(()=>{document.removeEventListener("click",be,!0),window.removeEventListener("keydown",he)}),(F,te)=>(e.openBlock(),e.createElementBlock("div",{class:"flex flex-col gap-2 w-full",ref_key:"rootRef",ref:y},[e.createElementVNode("div",{class:"relative",onClick:te[2]||(te[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white px-3","border-gray-300 hover:border-[#b3d4ff]",p.value?"border-[#2684ff] ring-1 ring-[#2684ff] shadow-[0_0_0_1px_rgba(38,132,255,0.5)]":"",C.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox","data-focus":p.value?"true":"false",onClick:ue},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:w,"onUpdate:modelValue":te[0]||(te[0]=ae=>u.value=ae),placeholder:_.value,disabled:C.value,readonly:!b.value,onFocus:te[1]||(te[1]=()=>Y("focus")),onKeydown:L,class:"flex-1 bg-transparent border-0 outline-none px-0 py-1 text-sm text-stone-900 placeholder:text-stone-400"},null,40,D0),[[e.vModelText,u.value]]),e.createElementVNode("span",{class:e.normalizeClass(["text-stone-400 transition-transform duration-150",p.value?"rotate-180":""]),"aria-hidden":"true"},[e.createVNode($l,{width:"16",height:"16"})],2)],10,A0),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute left-0 right-0 z-10 mt-1 rounded-md border border-stone-200 bg-white shadow-lg overflow-auto",style:e.normalizeStyle({maxHeight:x.value})},[e.createElementVNode("div",T0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:M(ae.id),type:"button",class:"w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",onClick:e.withModifiers(_e=>le(ae),["stop"]),disabled:C.value},e.toDisplayString(O(ae)),9,L0))),128)),R.value.length===0?(e.openBlock(),e.createElementBlock("p",$0," Немає варіантів ")):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",I0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(ae,_e)=>(e.openBlock(),e.createElementBlock("div",{key:ae.key,class:e.normalizeClass(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2",{"opacity-60":g.value===_e}]),draggable:"true",onDragstart:Ae=>X(_e),onDragover:te[3]||(te[3]=e.withModifiers(()=>{},["prevent"])),onDrop:Ae=>J(_e),onDragend:te[4]||(te[4]=Ae=>g.value=null)},[e.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-500 hover:text-stone-900",disabled:C.value,"aria-label":"Перетягнути"},[e.createVNode(zn,{width:"14",height:"14"})],8,O0),e.createElementVNode("div",{class:"flex-1 text-sm text-stone-900",title:ae.text},e.toDisplayString(ae.text),9,P0),e.createElementVNode("button",{type:"button",class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-400 hover:text-stone-900",disabled:C.value,onClick:e.withModifiers(Ae=>P(ae.id),["stop"]),"aria-label":`Видалити ${ae.text}`},[e.createVNode(Pn,{width:"14",height:"14"})],8,R0)],42,F0))),128)),r.value.length===0?(e.openBlock(),e.createElementBlock("p",z0,"Немає вибраних значень")):e.createCommentVNode("",!0)])],512))}}),Rl=pe(j0,[["__scopeId","data-v-cffead85"]]),U0={class:"flex items-center gap-2 w-full"},H0={class:"relative flex-1"},q0=["placeholder","disabled","onKeydown"],W0=["disabled"],G0={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},K0={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Y0={key:0,class:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/50"},Z0={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},J0={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},X0=["onClick"],Q0={key:0,class:"p-4 text-sm text-gray-500"},V0=e.defineComponent({__name:"vs-input-address",props:e.mergeModels({api:{default:""},geom:{default:""},includes:{default:()=>[]},bbox:{},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(l,{emit:t}){const n=/{{\s*([^}]+?)\s*}}/g,o=l,a=t,{inputClass:r}=Xe(o.style),s=e.useModel(l,"modelValue"),i=e.computed({get:()=>s.value,set:S=>{s.value=S}}),c=e.ref(!1),d=e.ref([]),u=e.ref(!1),p=e.ref(null);e.watch(u,S=>{typeof document>"u"||(S?(p.value=document.body.style.overflow,document.body.style.overflow="hidden"):p.value!=null?(document.body.style.overflow=p.value,p.value=null):document.body.style.removeProperty("overflow"))}),e.onBeforeUnmount(()=>{typeof document>"u"||(p.value!=null?document.body.style.overflow=p.value:document.body.style.removeProperty("overflow"))});const g=e.computed(()=>o.placeholder??""),y=e.computed(()=>!!o.disabled),w=S=>{if(!S)return null;if(Array.isArray(S))return S;if(typeof S=="string"){const M=S.split(",").map(O=>O.trim()).filter(Boolean);return M.length!==4?null:M.map(Number)}return null},m=e.computed(()=>{const S=w(o.bbox);if(!S||S.length!==4)return null;const M=S.map(Number);return M.some(O=>Number.isNaN(O))?null:M}),f=e.computed(()=>{const S=m.value;if(!S)return"";const[M,O,K,U]=S;return`${M},${Math.max(O,U)},${K},${Math.min(O,U)}`});e.computed(()=>f.value?"1":"0");const E=e.inject("values");function C(){!y.value&&i.value.trim()&&_()}async function _(){const S=(i.value||"").trim();if(!S)return;let M=S;if(o.includes?.length&&E?.value){const K=o.includes.map(U=>E.value?.[U]).filter(Boolean);K.length&&(M=`${K.join(", ")}, ${S}`)}const O=D(M);if(O){c.value=!0;try{const K=await(await fetch(O)).json();d.value=Array.isArray(K)?K:[],u.value=!0}catch(K){console.error("Address search error:",K)}finally{c.value=!1}}}function b(){u.value=!u.value}function x(S){if(!S)return;u.value=!1;const M=parseFloat(S.lat),O={type:"Point",coordinates:[parseFloat(S.lon),M]};o.geom&&E?.value&&(E.value[o.geom]=O),a("update:geom",O)}function D(S){if(!o.api)return"";const M={value:encodeURIComponent(S),bbox:m.value?m.value.join(","):""};return o.api.replace(n,(O,K)=>M[K.trim()]??"")}return(S,M)=>(e.openBlock(),e.createElementBlock("div",U0,[e.createElementVNode("div",H0,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":M[0]||(M[0]=O=>i.value=O),placeholder:g.value,disabled:y.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[e.unref(r),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:e.withKeys(e.withModifiers(C,["prevent"]),["enter"])},null,42,q0),[[e.vModelText,i.value]]),d.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:b,title:"Show search results"},[...M[2]||(M[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:_,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:c.value||!i.value?.trim()},[c.value?(e.openBlock(),e.createElementBlock("svg",K0,[...M[4]||(M[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",G0,[...M[3]||(M[3]=[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])]))],8,W0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[u.value?(e.openBlock(),e.createElementBlock("div",Y0,[e.createElementVNode("div",Z0,[e.createElementVNode("div",J0,[M[6]||(M[6]=e.createElementVNode("span",null,"Search results",-1)),e.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:M[1]||(M[1]=O=>u.value=!1),title:"Close"},[...M[5]||(M[5]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(O,K)=>(e.openBlock(),e.createElementBlock("li",{key:K,onClick:U=>x(O),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},e.toDisplayString(O.display_name),9,X0))),128))]),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q0," No results found "))])])):e.createCommentVNode("",!0)]))]))}}),ma=(l="")=>`${l}${Math.floor(Math.random()*1e4)}`,eg={class:"vs-datalist space-y-3"},tg={class:"space-y-3"},ng=["onClick","disabled"],lg={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},og=["disabled"],ag=e.defineComponent({__name:"vs-input-datalist",props:e.mergeModels({schema:{default:()=>[]},minItems:{default:0},maxItems:{default:void 0},addButtonText:{default:"Додати позицію"},emptyLabel:{default:"Немає рядків"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.computed(()=>Array.isArray(n.value)?n.value:[]),a=e.ref([]),r=e.computed(()=>t.schema?.map(m=>({...m,disabled:t.disabled||m.disabled}))??[]),s=e.computed(()=>r.value.map(m=>w(m))),i=e.computed(()=>t.disabled?!1:t.maxItems?o.value.length<t.maxItems:!0),c=e.computed(()=>t.disabled||o.value.length<=(t.minItems||0));e.watch(()=>o.value.length,()=>{d(),u()},{immediate:!0}),e.watch(()=>t.schema,u,{immediate:!0,deep:!0});function d(){const m=o.value.length;a.value.length<m?a.value=[...a.value,...Array.from({length:m-a.value.length},()=>ma())]:a.value.length>m&&a.value.splice(m)}function u(){if(!t.minItems||o.value.length>=t.minItems)return;const m=t.minItems-o.value.length,f=Array.from({length:m},p);n.value=[...o.value,...f]}function p(){const m={};return r.value.forEach(f=>{m[f.name]=f?.default??null}),m}function g(){i.value&&(n.value=[...o.value,p()],d())}function y(m){c.value||(n.value=o.value.filter((f,E)=>E!==m),d(),u())}function w(m){return{...m}}return(m,f)=>(e.openBlock(),e.createElementBlock("div",eg,[e.createElementVNode("div",tg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(E,C)=>(e.openBlock(),e.createElementBlock("div",{key:a.value[C],class:"flex items-center gap-3"},[e.createVNode(It,{schema:s.value,layout:"inline",navigation:!1,values:o.value[C],"onUpdate:values":_=>o.value[C]=_,"form-id":a.value[C]},null,8,["schema","values","onUpdate:values","form-id"]),e.createElementVNode("button",{type:"button",class:"h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",onClick:_=>y(C),disabled:c.value},[e.createVNode(Gt,{class:"w-5 h-5"})],8,ng)]))),128)),o.value.length===0?(e.openBlock(),e.createElementBlock("div",lg,e.toDisplayString(t.emptyLabel),1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:g,disabled:!i.value},[e.createVNode(vt,{class:"w-5 h-5"}),e.createTextVNode(" "+e.toDisplayString(t.addButtonText),1)],8,og)]))}}),rg=pe(ag,[["__scopeId","data-v-c4c0acde"]]),sg={};function ig(l,t){return e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},l.$attrs),[...t[0]||(t[0]=[e.createElementVNode("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},null,-1),e.createElementVNode("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},null,-1)])],16)}const cg=pe(sg,[["render",ig]]),dg={class:"vs-dataform space-y-4"},ug=["draggable","onDragstart","onDragover","onDragenter","onDrop"],pg={class:"flex items-center gap-2"},mg=["onClick"],fg={class:"text-sm font-medium text-gray-700"},hg={class:"flex items-center gap-2"},vg=["title","onClick","disabled"],gg=["title","onClick","disabled"],yg={key:0,class:"rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"},kg=["disabled"],bg=e.defineComponent({__name:"vs-input-dataform",props:e.mergeModels({schema:{default:()=>[]},minGroups:{default:0},maxGroups:{default:void 0},addButtonText:{default:"Додати групу фільтрів"},groupLabel:{default:void 0},duplicateTitle:{default:"Дублювати групу"},removeTitle:{default:"Видалити групу"},emptyLabel:{},view:{default:"default"},collapsible:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref([]),a=e.ref([]),r=e.ref(0),s=e.ref(null),i=e.ref(null),c=e.ref(null),d=e.computed(()=>t.groupLabel??"Group"),u=e.computed(()=>t.emptyLabel??"Ще немає груп"),p=e.computed(()=>t.schema?.map(Y=>({...Y,disabled:t.disabled||Y.disabled}))??[]),g=e.computed(()=>p.value.map(Y=>O(Y))),y=e.computed(()=>t.view==="accordion"),w=e.computed(()=>!!(t.collapsible||y.value)),m=e.computed(()=>t.draggable!==!1),f=e.computed(()=>t.disabled?!1:t.maxGroups?n.value.length<t.maxGroups:!0),E=e.computed(()=>t.disabled||n.value.length<=(t.minGroups||0));e.watch(()=>n.value.length,()=>{C(),_(),b()},{immediate:!0}),e.watch(()=>t.schema,b,{immediate:!0,deep:!0}),e.watch(()=>t.view,()=>{_()},{immediate:!0});function C(){const Y=n.value.length;o.value.length<Y?o.value=[...o.value,...Array.from({length:Y-o.value.length},()=>ma())]:o.value.length>Y&&o.value.splice(Y)}function _(){const Y=n.value.length;y.value?Y===0?r.value=-1:r.value>=Y?r.value=Y-1:r.value<0&&(r.value=0):a.value.length<Y?a.value=[...a.value,...Array.from({length:Y-a.value.length},()=>!1)]:a.value.length>Y&&a.value.splice(Y)}function b(){if(!t.minGroups||n.value.length>=t.minGroups)return;const Y=t.minGroups-n.value.length,se=Array.from({length:Y},x);n.value=[...n.value,...se],_()}function x(){const Y={};return p.value.forEach(se=>{Y[se.name]=se?.default??null}),Y}function D(){f.value&&(n.value=[...n.value,x()],C(),_())}function S(Y){E.value||(n.value=n.value.filter((se,ue)=>ue!==Y),C(),y.value?r.value>=n.value.length&&(r.value=n.value.length-1):a.value.splice(Y,1),b())}function M(Y){if(t.disabled)return;const se=JSON.parse(JSON.stringify(n.value[Y]??{}));n.value=[...n.value.slice(0,Y+1),se,...n.value.slice(Y+1)],C(),y.value?r.value>Y&&(r.value+=1):a.value.splice(Y+1,0,a.value[Y]??!1)}function O(Y){return{...Y}}function K(Y){return y.value?r.value===-1&&Y===0?!1:r.value!==Y:!!a.value[Y]}function U(Y){if(w.value){if(y.value){r.value=Y;return}a.value[Y]=!a.value[Y]}}function R(Y,se){if(!m.value||t.disabled){se.preventDefault();return}s.value=Y,i.value=Y,c.value={groups:JSON.parse(JSON.stringify(n.value)),keys:[...o.value],states:[...a.value]},se.dataTransfer?.setData("text/plain",String(Y)),se.dataTransfer?.setDragImage?.(se.currentTarget,0,0)}function q(Y,se){!m.value||t.disabled||s.value!==null&&oe(Y,se)}function N(Y,se){oe(Y,se)}function j(Y){!m.value||t.disabled||ie()}function $(){c.value&&V(),s.value=null,i.value=null,c.value=null}function Z(Y,se){const ue=[...n.value],[he]=ue.splice(Y,1);ue.splice(se,0,he),n.value=ue;const be=[...o.value],[L]=be.splice(Y,1);if(be.splice(se,0,L),o.value=be,y.value)r.value===Y&&(r.value=se);else{const le=[...a.value],[T]=le.splice(Y,1);le.splice(se,0,T),a.value=le}}function V(){c.value&&(n.value=c.value.groups,o.value=c.value.keys,a.value=c.value.states,c.value=null,i.value=null)}function oe(Y,se){if(s.value===null)return;const ue=ee(Y,se);i.value=ue,H(ue)}function ee(Y,se){if(!se?.currentTarget)return Y;const ue=se.currentTarget.getBoundingClientRect(),he=se.clientY-ue.top>ue.height/2?Y+1:Y;return Math.max(0,Math.min(he,n.value.length))}function H(Y){const se=s.value;if(se===null)return;let ue=Y;if(ue>n.value.length&&(ue=n.value.length),ue===se||ue===se+1)return;const he=ue>se?ue-1:ue;Z(se,he),s.value=he,i.value=ue>se?he+1:he}function ie(){c.value=null,s.value=null,i.value=null}return(Y,se)=>(e.openBlock(),e.createElementBlock("div",dg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(ue,he)=>(e.openBlock(),e.createElementBlock("div",{key:o.value[he],class:e.normalizeClass(["relative border border-gray-200 rounded-lg bg-white transition vs-dataform__group",[t.view==="accordion"?"overflow-hidden":K(he)?"pt-6 px-6":"p-6"]]),draggable:m.value&&!t.disabled,onDragstart:be=>R(he,be),onDragend:$,onDragover:e.withModifiers(be=>q(he,be),["prevent"]),onDragenter:e.withModifiers(be=>N(he,be),["prevent"]),onDrop:e.withModifiers(be=>j(),["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-between gap-2 border-b border-gray-100 px-4 py-3",[t.view!=="accordion"?"-mx-6 -mt-6 px-6":"",t.view!=="accordion"&&!K(he)?"rounded-t-lg":"rounded-lg"]])},[e.createElementVNode("div",pg,[m.value?(e.openBlock(),e.createBlock(zn,{key:0,class:"w-4 h-4 text-gray-400","aria-hidden":"true"})):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"rounded-full p-1 text-gray-500 transition hover:bg-gray-100",onClick:be=>U(he)},[e.createVNode($l,{class:e.normalizeClass(["h-4 w-4 transition",K(he)?"-rotate-90":"rotate-0"])},null,8,["class"])],8,mg)):e.createCommentVNode("",!0),e.createElementVNode("div",fg,e.toDisplayString(`${d.value} (${he+1})`),1)]),e.createElementVNode("div",hg,[e.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:t.duplicateTitle,onClick:be=>M(he),disabled:t.disabled,draggable:"false"},[e.createVNode(cg,{class:"w-5 h-5"})],8,vg),e.createElementVNode("button",{type:"button",class:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",title:t.removeTitle,onClick:be=>S(he),disabled:E.value,draggable:"false"},[e.createVNode(Gt,{class:"w-5 h-5"})],8,gg)])],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(t.view==="accordion"?"p-6":"pt-6")},[e.createVNode(It,{class:"vs-dataform__form",schema:g.value,layout:"inline",navigation:!1,values:n.value[he],"onUpdate:values":be=>n.value[he]=be,"form-id":o.value[he],disabled:t.disabled},null,8,["schema","values","onUpdate:values","form-id","disabled"])],2),[[e.vShow,!K(he)]])],42,ug))),128)),n.value.length===0?(e.openBlock(),e.createElementBlock("div",yg,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",onClick:D,disabled:!f.value},[e.createVNode(vt,{class:"w-5 h-5"}),e.createTextVNode(" "+e.toDisplayString(t.addButtonText),1)],8,kg)]))}}),xg=pe(bg,[["__scopeId","data-v-473b9d69"]]),qn="__vs_form_monaco_loader__",wg=e.defineComponent({__name:"vs-input-monaco",props:e.mergeModels({syntax:{default:"xml"},theme:{default:"vs-light"},height:{default:280},minimap:{type:Boolean,default:!1},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{},maxlength:{},minlength:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,n=e.useModel(l,"modelValue"),o=e.ref(null),a=e.computed(()=>typeof t.height=="number"?`${t.height}px`:t.height||"280px");let r=null,s=null,i=!1;const c=()=>{if(s)return Promise.resolve(s);if(typeof window>"u")return Promise.resolve(null);const u=window;if(u.monaco?.editor?.create)return s=u.monaco,Promise.resolve(s);if(u[qn])return u[qn];const p=(async()=>{const g=m=>{if(Array.from(document.styleSheets||[]).some(E=>E?.href?.includes(m)))return;const f=document.createElement("link");f.rel="stylesheet",f.href=m,document.head.appendChild(f)},y=m=>new Promise((f,E)=>{if(Array.from(document.scripts).some(_=>_.src===m))return f();const C=document.createElement("script");C.src=m,C.async=!0,C.onload=()=>f(),C.onerror=_=>E(_),document.body.appendChild(C)}),w="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";return g(`${w}/editor/editor.main.min.css`),await y(`${w}/loader.min.js`),new Promise((m,f)=>{window.require.config({paths:{vs:w}}),window.require(["vs/editor/editor.main"],()=>{s=window.monaco,u.monaco=s,m(s)},E=>f(E))})})().catch(g=>{throw delete u[qn],g});return u[qn]=p,p},d=()=>{!o.value||!s||(r&&(r.dispose(),r=null),r=s.editor.create(o.value,{value:n.value||"",language:t.syntax,theme:t.theme,automaticLayout:!0,minimap:{enabled:!!t.minimap},readOnly:!!t.disabled}),r.onDidChangeModelContent(()=>{i||(n.value=r.getValue())}))};return e.watch(()=>n.value,u=>{if(!r)return;const p=r.getValue();u!==p&&(i=!0,r.setValue(u||""),i=!1)}),e.watch(()=>t.syntax,u=>{!r||!s||s.editor.setModelLanguage(r.getModel(),u||"xml")}),e.watch(()=>t.theme,u=>{s&&s.editor.setTheme(u||"vs-light")}),e.watch(()=>t.disabled,u=>{r&&r.updateOptions({readOnly:!!u})}),e.watch(()=>t.minimap,u=>{r&&r.updateOptions({minimap:{enabled:!!u}})}),e.onMounted(async()=>{try{const u=await c();if(!u||!u.editor)return;s=u,d()}catch(u){console.error("Failed to load Monaco editor",u)}}),e.onBeforeUnmount(()=>{r&&(r.dispose(),r=null)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full",style:e.normalizeStyle({height:a.value})},[e.createElementVNode("div",{ref_key:"editorContainer",ref:o,class:"w-full h-full overflow-hidden border border-[#CFD9E0] rounded"},null,512)],4))}}),Eg={VsInputText:sn,VsInputRadio:ra,"vs-input-text":sn,"vs-input-password":Pd,"vs-input-textarea":cf,"vs-input-richtext":uf,"vs-input-mask":Il,"vs-input-number":jd,"vs-input-radio":ra,"vs-input-select":pa,"vs-input-switcher":na,"vs-input-static":la,"vs-input-container":Rm,"vs-input-date":Fu,"vs-input-checkbox":$u,"vs-input-file":Cp,"vs-input-file2":Ol,file2:Ol,File2:Ol,"vs-input-html":la,"vs-input-email":oa,"vs-input-tel":aa,"vs-input-datatable":dh,"vs-input-map":Sv,"vs-input-file-list":fm,"vs-input-tags":Pv,"vs-input-slug":Uv,"vs-input-codegen":Zv,"vs-input-key-value":r0,"vs-input-text[]":g0,"vs-input-range":_0,"vs-input-color":x0,"vs-input-native-select":pa,VsInputArraySelect:Rl,"vs-input-array":M0,"vs-input-array-select":Rl,"array-select":Rl,"vs-input-address":V0,"vs-input-datalist":rg,"vs-input-dataform":xg,"vs-input-monaco":wg},Cg=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const t=l,n=e.inject("values");async function o(){try{if(!t.api)return;const a=t.api.replace("{{value}}",t.value),r=await fetch(a);if(!r.ok){fe.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const s=await r.json();if(!t.set||!n)return;for(const[i,c]of Object.entries(t.set))n.value[i]=s.result[c]}catch(a){console.error(t.error,a)}}return(a,r)=>(e.openBlock(),e.createElementBlock("button",{onClick:o,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(a.button),1))}}),_g={class:"flex flex-col gap-1 w-full"},Ng=["innerHTML"],fa=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:e.mergeModels(["value-selected"],["update:modelValue"]),setup(l,{emit:t}){const n=l,o=e.useModel(l,"modelValue"),a=t,r=e.computed(()=>Fd[`${n.layout}`]),s=["label","placeholder","info","description","text","html"],i=e.ref(E()),c=e.computed(()=>w(n.item,i.value)),d=e.computed(()=>Eg?.[`vs-input-${n.item.type}`]),u=e.inject("field-props"),p=e.computed(()=>{const _=e.unref(d);if(!_)return new Set;const b=_.props??_.__vccOpts?.props;if(!b)return new Set;const x=Array.isArray(b)?b:Object.keys(b);return new Set(x)}),g=e.computed(()=>{const _={...c.value??{}},b=n.item?.name;b&&u?.value?.[b]&&Object.assign(_,u.value[b]);const x=p.value;return x.size?Object.fromEntries(Object.entries(_).filter(([D])=>x.has(D))):{}}),y=_=>{const b=typeof _=="object"&&_!==null?_:{value:_};a("value-selected",{...b,name:b.name??n.item?.name})};e.onMounted(()=>{i.value=E(),window.addEventListener("storage",C)}),e.onUnmounted(()=>{window.removeEventListener("storage",C)});function w(_,b){if(!_)return{};const x={..._};return s.forEach(D=>{const S=f(_,D,b);S!=null&&(x[D]=S)}),Array.isArray(_.options)&&(x.options=_.options.map(D=>m(D,b))),x}function m(_,b){if(!_)return _;const x={..._},D=f(_,"label",b),S=f(_,"text",b);return D!=null&&(x.label=D),S!=null?x.text=S:D!=null&&(x.text=D),x}function f(_,b,x){const D=`${b}:${x}`;if(_?.[D]!=null)return _[D];if(b==="label"&&_?.[x]!=null)return _[x];if(_?.[b]!=null)return _[b];if(b==="label"){if(_?.ua!=null)return _.ua;if(_?.en!=null)return _.en}if(b==="text"||b==="html"){if(_?.ua!=null)return _.ua;if(_?.en!=null)return _.en}return null}function E(){return typeof window>"u"?"uk":localStorage.getItem("locale")||"uk"}function C(){i.value=E()}return(_,b)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{ua:c.value.ua,error:n.error||"",item:c.value,columns:n.columns,label:c.value.label},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${n.item.type}-component`])},[e.createElementVNode("div",_g,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps(g.value,{modelValue:o.value,"onUpdate:modelValue":b[0]||(b[0]=x=>o.value=x),onValueSelected:y}),null,16,["modelValue"])),c.value.description&&n.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",{key:0,class:"text-sm text-gray-500",innerHTML:c.value.description},null,8,Ng)):e.createCommentVNode("",!0)]),c.value.behavior?.api&&c.value.behavior?.button?(e.openBlock(),e.createBlock(Cg,e.mergeProps({key:0},c.value.behavior,{value:o.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]),_:1},8,["ua","error","item","columns","label"]))}}),Bg={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},Sg={class:"vs-compact-form-navigation__rail mt-[6px]"},Mg=["onClick"],Ag=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(l,{expose:t}){const n=l,o=e.ref([]),a=e.ref(""),r=e.ref(""),s=e.computed(()=>!!n.enabled),i=e.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),c=e.computed(()=>{const U=n.width;if(U==null)return{};const R=typeof U=="number"?`${U}px`:`${U}`;return{width:R,minWidth:R}});let d=null,u=0,p=0,g=null,y=null,w=null;const m=()=>O(),f=()=>C();e.watch(()=>n.target,async U=>{if(D(),!U){g=null,o.value=[],a.value="";return}g=U,s.value&&(await e.nextTick(),x(U),C())},{immediate:!0}),e.watch(()=>n.scrollContainer,U=>{if(!s.value){y=U??null;return}E(U??null),e.nextTick(()=>C())},{immediate:!0}),e.onMounted(()=>{n.scrollContainer||E(null),C()}),e.onBeforeUnmount(()=>{D(),E(null,!0),g=null,typeof window<"u"&&(u&&window.cancelAnimationFrame(u),p&&window.cancelAnimationFrame(p))});function E(U,R=!1){if(w&&(w(),w=null),R){y=null;return}if(y=U??null,typeof window>"u")return;const q=U??window,N=window;q.addEventListener("scroll",m,{passive:!0}),N.addEventListener("resize",f),w=()=>{q.removeEventListener("scroll",m),N.removeEventListener("resize",f)}}function C(){if(!s.value||!g)return;u&&typeof window<"u"&&window.cancelAnimationFrame(u);const U=()=>{_(),u=0};typeof window>"u"?U():u=window.requestAnimationFrame(U)}function _(){if(!s.value||!g)return;const U=Array.from(g.querySelectorAll("h1, h2")),R=new Set,q=[];U.forEach((N,j)=>{const $=N.textContent?.trim()??"";if(!$)return;let Z=(N.getAttribute("id")??"").trim();Z||(Z=b($)||`heading-${j+1}`);let V=Z,oe=1;for(;R.has(V);)V=`${Z}-${oe+=1}`;N.id!==V&&Object.assign(N,{id:V}),R.add(V),q.push({id:V,text:$,level:N.tagName.toLowerCase()==="h1"?1:2})}),o.value=q,q.length||(a.value=""),M()}function b(U){return U.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function x(U){!U||!s.value||typeof MutationObserver>"u"||(D(),d=new MutationObserver(()=>C()),d.observe(U,{childList:!0,subtree:!0}))}function D(){d&&(d.disconnect(),d=null)}function S(U){const R=y;if(!R)return typeof window>"u"?U.offsetTop:U.getBoundingClientRect().top+window.scrollY;const q=U.getBoundingClientRect(),N=R.getBoundingClientRect();return q.top-N.top+R.scrollTop}function M(){if(!s.value||!o.value.length)return;const U=y,R=(U?U.scrollTop:null)||(typeof window<"u"?window.scrollY:0),q=(U?U.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),N=R+q;let j=null;for(let Z=0;Z<o.value.length;Z+=1){const V=o.value[Z],oe=document.getElementById(V.id);if(oe){const ee=S(oe);ee+oe.offsetHeight>R&&ee<N&&(j=V.id)}}!j&&r.value&&(j=r.value),j&&(r.value=j);const $=U?U.scrollHeight-U.clientHeight:document.documentElement.scrollHeight-window.innerHeight;R+5>=$&&(j=o.value[o.value.length-1].id),j&&(a.value=j)}function O(){s.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{M(),p=0}))}function K(U){if(!s.value)return;const R=document.getElementById(U);if(!R)return;const q=y,N=Math.max(0,S(R));q?q.scrollTo({top:N,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:N,behavior:"smooth"})}return t({refresh:C}),(U,R)=>s.value&&o.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(c.value)},[e.createElementVNode("h2",Bg,e.toDisplayString(U.title),1),e.createElementVNode("div",Sg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.id,class:e.normalizeClass(["vs-compact-form-navigation__item relative",q.level===2?"vs-compact-form-navigation__item--nested":"",q.id===a.value?"vs-compact-form-navigation__item--active":""])},[e.createElementVNode("button",{type:"button",onClick:N=>K(q.id),class:e.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",q.level===2?"pl-[15px]":"pl-[18px]",q.id===a.value?"text-gray-800":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(q.text),1)],10,Mg)],2))),128))])],6)):e.createCommentVNode("",!0)}}),Dg=pe(Ag,[["__scopeId","data-v-b3e16a91"]]),$t={required:"Це поле є обов’язковим",email:"Неправильний email",tel:"Неправильний телефон",minlength:l=>`Мінімальна довжина — ${l} символів`,maxlength:l=>`Максимальна довжина — ${l} символів`},Tg=l=>typeof l=="string"?l.trim()?!1:$t.required:Array.isArray(l)?l.map(t=>typeof t=="string"?t.trim():t).filter(t=>t!=null&&t!=="").length?!1:$t.required:l?!1:$t.required,Lg=l=>l?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?!1:$t.email:!1,$g=l=>l?/^\+[1-9]\d{1,14}$/.test(l)?!1:$t.tel:!1,ha=l=>l==null?0:typeof l=="string"?l.trim().length:Array.isArray(l)?l.length:typeof l=="number"?l.toString().length:String(l).length,Ig=(l,t)=>{if(l==null)return!1;const n=Number(t?.value??t?.length);return Number.isFinite(n)&&ha(l)<n?t?.message||$t.minlength(n):!1},Fg=(l,t)=>{if(l==null||l==="")return!1;const n=Number(t?.value??t?.length);return Number.isFinite(n)&&ha(l)>n?t?.message||$t.maxlength(n):!1},Og=(l,t)=>{const n=t.pattern??t.regexp,o=typeof n=="string"?new RegExp(n):n;if(Array.isArray(l)){const a=l.filter(Boolean);return a.length===0||a.every(r=>o.test(r))?!1:t.message}return!o.test(l)&&l?t.message:!1},Pg=(l,t)=>!1,Rg=(l,t)=>{switch(typeof t=="string"?t:t.type){case"required":return Tg(l);case"email":return Lg(l);case"tel":return $g(l);case"regexp":return Og(l,t);case"minlength":return Ig(l,t);case"maxlength":return Fg(l,t);case"custom":return Pg();default:return!1}},zg={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file",dropzone:"file"};function va(l){const t=l?.toLowerCase();return zg[t]||t}function zl(l,t=!1){if(Array.isArray(l)){const o=[];return l.forEach(a=>{const r={...a};r.name=(a.name||a.id||a.key||"").toString(),r.type=va(a.type),r.label=a.label||a.ua,r.rules=a.rules||a.validators,r.type==="email"&&!r.rules&&(r.rules=["email"]),a.data&&(r.api=`/api/suggest/${a.data}`),r.disabled=r.disabled||t,Array.isArray(r.schema)&&(r.schema=zl(r.schema,r.disabled)),o.push(r)}),o}const n=[];return Object.entries(l).forEach(o=>{const a={name:o[0],...o[1],type:va(o[1].type),label:o[1].label||o[1].ua,rules:o[1].rules||o[1].validators,disabled:o[1].disabled||t};a.type==="email"&&!a.rules&&(a.rules=["email"]),o[1].type?.includes("list")&&(a.multiple=!0),!a.api&&o[1].data&&(a.api=`/api/suggest/${o[1].data}`),Array.isArray(a.schema)&&(a.schema=zl(a.schema,a.disabled)),n.push(a)}),n}function jg(l,t,n=!1){const o=e.computed(()=>zl(t,typeof n=="boolean"?n:n.value)),a=e.ref({});function r(c){const d=c?.conditions;if(!d)return!0;const u=Array.isArray(d)?d[0]:d,p=l?.value?.[u];return ua(p,d)}const s=(c=o.value,d=!0)=>(c.forEach(u=>{const p=[],g=Number(u?.minlength),y=Number(u?.maxlength);!Number.isNaN(g)&&Number.isFinite(g)&&p.push({type:"minlength",value:g}),!Number.isNaN(y)&&Number.isFinite(y)&&p.push({type:"maxlength",value:y});const w=[...p,...u.rules||[]];if(w.length){if(!r(u)){delete a.value[u.name];return}let m=!1,f=null;w.forEach(E=>{const C=Rg(l.value[u.name],E);C&&(m=!0,!f&&typeof C=="string"&&(f=C))}),m&&f?a.value[u.name]=f:delete a.value[u.name]}u.schema&&s(u.schema,!1)}),d&&Object.values(a.value).some(Boolean)?a.value:null),i=e.computed(()=>o.value?.filter(c=>c.hidden!==!0&&r(c)));return{errors:a,validate:s,reset:()=>{l.value={},a.value={}},visibleSchema:i}}const Ug={class:"flex w-full h-full min-h-0 gap-6"},Hg={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},It=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},modelValue:{default:()=>({})},modelModifiers:{},values:{default:void 0},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue","value-selected"],["update:form","update:modelValue","update:values"]),setup(l,{expose:t,emit:n}){const o=n,a=l,r=e.useModel(l,"form"),s=e.useModel(l,"modelValue"),i=e.useModel(l,"values"),c=e.computed({get:()=>i.value??s.value,set:R=>{s.value=R,i.value=R}}),{errors:d,validate:u,reset:p,visibleSchema:g}=jg(c,a.schema,e.toRef(a,"disabled")),y=e.ref(null),w=e.ref(null),m=e.ref({}),f=e.computed(()=>a.navigation),E=e.computed(()=>a.navWidth),C=e.computed(()=>a.style?.columns),_=Object.freeze({container:12,label:3}),b=e.computed(()=>a.columns??C.value??_),x=e.computed(()=>a.columns!=null||C.value!=null),D=e.computed(()=>x.value?"horizontal":a.layout),S=R=>R?.columns?"horizontal":D.value,M=R=>R?.columns??b.value,O=()=>{o("update:modelValue",c.value),u(),o("handle-submit",c.value)},K=R=>{o("value-selected",R)};t({validate:u,reset:p,errors:d}),e.onMounted(()=>{r.value={value:c.value,errors:d.value,reset:p,validate:u,formId:a.formId}});function U(R,q){if(R===q)return!0;if(typeof R!="object"||typeof q!="object"||!R||!q)return!1;const N=Object.keys(R),j=Object.keys(q);return N.length!==j.length?!1:N.every($=>R[$]===q[$])}return e.provide("form",r),e.provide("values",c),e.provide("field-props",m),(R,q)=>(e.openBlock(),e.createElementBlock("div",Ug,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:w},[e.createElementVNode("form",{ref_key:"formRef",ref:y,onSubmit:e.withModifiers(O,["prevent"]),class:e.normalizeClass(["grid grid-cols-12 p-1",D.value==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:N.name,class:e.normalizeClass(S(N)==="horizontal"?"col-span-12":`col-span-${N.col||12}`)},[e.createVNode(fa,{style:e.normalizeStyle(R.style),item:N,layout:S(N),columns:M(N),"model-value":c.value[N.name],"onUpdate:modelValue":$=>{const Z=c.value[N.name];U(Z,$)||(c.value[N.name]=$)},error:e.unref(d)[N.name],onValueSelected:K},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),S(N)==="settings"&&j+1!==e.unref(g).length?(e.openBlock(),e.createElementBlock("div",Hg)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(Dg,{target:y.value,"scroll-container":w.value,enabled:f.value,width:E.value},null,8,["target","scroll-container","enabled","width"])]))}}),qg={class:"relative"},Wg={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Gg={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},Kg={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Yg={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Zg={class:"p-4 mim-h-0 h-full overflow-auto"},Jg=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{},api:{},method:{}},emits:["close","save","edit"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(n.schema),r=e.ref(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),s=e.ref({}),i=e.ref(n.token||""),c=e.ref(n.mode),d=()=>{const w=n.method?.trim().toUpperCase();return w==="GET"||w==="POST"||w==="PUT"?w:c.value==="add"?"POST":"PUT"},u=()=>{fe.notify({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`})},p=async w=>{if(w.ok){await w.json().catch(()=>({})),u(),o("save",r.value);return}if(w.status===400){const m=await w.json().catch(()=>({}));fe.notify({type:"warning",title:"Помилка валідації",message:m.message||"Некоректні дані (400)"});return}if(w.status===500){fe.notify({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"});return}fe.notify({type:"error",title:"Помилка",message:`Статус: ${w.status}`})};async function g(){const w=s.value.validate();if(w){fe.notify({type:"warning",title:"Помилка валідації",message:Object.entries(w).map(([f,E])=>`${f}: ${E}`).join(`
144
+ `)});return}const m=n.api?.trim();if(m){const f=d();try{const E=await fetch(m,{method:f,headers:f==="GET"?void 0:{"Content-Type":"application/json"},body:f==="GET"?void 0:JSON.stringify(r.value)});await p(E)}catch(E){fe.notify({type:"error",title:"Помилка з’єднання",message:E.message||"Не вдалося виконати запит"})}return}if(i.value)try{const f=await fetch(`/api/table/${i.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.value)});await p(f)}catch(f){fe.notify({type:"error",title:"Помилка з’єднання",message:f.message||"Не вдалося виконати запит"})}else o("edit",r.value),y()}function y(){o("close")}return e.onMounted(async()=>{try{if(n.form&&!n.schema){const w=await fetch(`/api/template/form/${n.form}`);if(!w.ok){fe.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`});return}const m=await w.json();a.value=m.schema,m.token&&(i.value=m.token)}else if(n.token&&!n.defaultValue){i.value=n.token;const w=await fetch(`/api/form/${i.value}`);if(!w.ok){fe.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`});return}const m=await w.json();a.value=m.schema,m.data?r.value=m.data:c.value="add",m.obj&&(r.value={...r.value,...m.obj})}}catch(w){fe.notify({type:"error",title:"Error",message:w.message||"Unexpected error"}),console.error(w)}}),(w,m)=>(e.openBlock(),e.createElementBlock("div",qg,[e.createElementVNode("div",Wg,[e.createElementVNode("div",Gg,[e.createElementVNode("div",Kg,[e.createElementVNode("h3",Yg,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:y,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},[...m[2]||(m[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",Zg,[a.value?(e.openBlock(),e.createBlock(It,{key:0,schema:a.value,values:r.value,"onUpdate:values":m[0]||(m[0]=f=>r.value=f),form:s.value,"onUpdate:form":m[1]||(m[1]=f=>s.value=f)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:y,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:g,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Xg=1440*60*1e3,Qg=["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],Vg=["січ","лют","бер","квіт","трав","черв","лип","серп","вер","жовт","лист","груд"],ey=["нд","пн","вт","ср","чт","пт","сб"];function He(l){return l instanceof Date&&!Number.isNaN(l.getTime())}const Kt=l=>new Date(l.getTime());function Ft(l){const t=Kt(l);return t.setHours(0,0,0,0),t}function dn(l){const t=Kt(l);return t.setHours(23,59,59,999),t}function jl(l){return Ft(new Date(l.getFullYear(),l.getMonth(),1))}function Ul(l){return dn(new Date(l.getFullYear(),l.getMonth()+1,0))}function Hl(l,t){const n=new Date(l),o=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const a=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,a)),n}function ty(l,t){return Hl(l,-1)}function Wn(l,t){const n=new Date(l);return n.setFullYear(n.getFullYear()+t),n}function ga(l,t){return Wn(l,-t)}function ya(l){return Ft(new Date(l.getFullYear(),0,1))}function ka(l){return dn(new Date(l.getFullYear(),11,31))}function ny(l){const t=Math.floor(l.getFullYear()/10)*10;return Ft(new Date(t,0,1))}function ly(l){const t=Math.floor(l.getFullYear()/10)*10+9;return dn(new Date(t,11,31))}const pt=l=>l.getFullYear(),Gn=l=>Math.floor(l.getFullYear()/10)*10;function oy(l){const t=[];let n=Ft(l.start);const o=Ft(l.end);for(;n<=o;)t.push(Kt(n)),n=new Date(n.getTime()+Xg);return t}function ay(l){const t=[];let n=jl(l.start);const o=Ul(l.end);for(;n<=o;)t.push(Kt(n)),n=Hl(n,1);return t}function ry(l){const t=[];let n=ya(l.start);const o=ka(l.end);for(;n<=o;)t.push(Kt(n)),n=Wn(n,1);return t}function ql(l,t=1){const n=Ft(l),o=(n.getDay()-t+7)%7;return n.setDate(n.getDate()-o),n}function sy(l,t=1){const n=ql(l,t);return n.setDate(n.getDate()+6),dn(n)}function iy(l,t,n=0){const o=ql(l,n),a=(t-n+7)%7;return o.setDate(o.getDate()+a),o}const Kn=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear()&&l.getMonth()===t.getMonth()&&l.getDate()===t.getDate(),Wl=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear()&&l.getMonth()===t.getMonth(),ba=(l,t)=>!!l&&!!t&&l.getFullYear()===t.getFullYear(),xa=(l,t)=>!!l&&!!t&&Kn(l,t)&&l.getHours()===t.getHours(),cy=(l,t)=>!!l&&!!t&&xa(l,t)&&l.getMinutes()===t.getMinutes();function dy(l,t){const n=l.getTime();return n>=t.start.getTime()&&n<=t.end.getTime()}const un=(l,t)=>!!l&&!!t&&l.getTime()<t.getTime(),pn=(l,t)=>!!l&&!!t&&l.getTime()>t.getTime();function uy(l){const t=l.filter(n=>He(n));if(t.length)return t.reduce((n,o)=>n.getTime()>=o.getTime()?n:o)}function py(l){const t=l.filter(n=>He(n));if(t.length)return t.reduce((n,o)=>n.getTime()<=o.getTime()?n:o)}function wa(l,t){const n=Kt(l);return typeof t.year=="number"&&n.setFullYear(t.year),typeof t.month=="number"&&n.setMonth(t.month),typeof t.date=="number"&&n.setDate(t.date),typeof t.hours=="number"&&n.setHours(t.hours),typeof t.minutes=="number"&&n.setMinutes(t.minutes),typeof t.seconds=="number"&&n.setSeconds(t.seconds),typeof t.milliseconds=="number"&&n.setMilliseconds(t.milliseconds),n}const Yn=(l,t=2)=>String(l).padStart(t,"0");function Ea(l,t){return t==="wide"?Qg[l]:Vg[l]}function my(l){return ey[l]}const fy=[{token:"LLLL",format:l=>Ea(l.getMonth(),"wide")},{token:"LLL",format:l=>Ea(l.getMonth(),"abbreviated")},{token:"EE",format:l=>my(l.getDay())},{token:"yyyy",format:l=>String(l.getFullYear())},{token:"MM",format:l=>Yn(l.getMonth()+1)},{token:"dd",format:l=>Yn(l.getDate())},{token:"HH",format:l=>Yn(l.getHours())},{token:"mm",format:l=>Yn(l.getMinutes())}];function Zn(l,t){if(!He(l))return"";let n="",o=0;for(;o<t.length;){const a=fy.find(r=>t.startsWith(r.token,o));a?(n+=a.format(l),o+=a.token.length):(n+=t[o],o+=1)}return n}const hy={"yyyy-MM-dd":/^(\d{4})-(\d{2})-(\d{2})$/,"dd.MM.yyyy":/^(\d{2})\.(\d{2})\.(\d{4})$/,"dd.MM.yyyy HH:mm":/^(\d{2})\.(\d{2})\.(\d{4}) (\d{2}):(\d{2})$/,"HH:mm":/^(\d{2}):(\d{2})$/,"MM.yyyy":/^(\d{2})\.(\d{4})$/,yyyy:/^(\d{4})$/};function Ca(l,t){const n=hy[t];if(!n){const a=new Date(l);return He(a)?a:null}const o=l.match(n);if(!o)return null;switch(t){case"yyyy-MM-dd":{const[,a,r,s]=o,i=new Date(Number(a),Number(r)-1,Number(s));return He(i)?i:null}case"dd.MM.yyyy":{const[,a,r,s]=o,i=new Date(Number(s),Number(r)-1,Number(a));return He(i)?i:null}case"dd.MM.yyyy HH:mm":{const[,a,r,s,i,c]=o,d=new Date(Number(s),Number(r)-1,Number(a),Number(i),Number(c));return He(d)?d:null}case"HH:mm":{const[,a,r]=o,s=new Date;return s.setHours(Number(a),Number(r),0,0),s}case"MM.yyyy":{const[,a,r]=o;return new Date(Number(r),Number(a)-1,1)}case"yyyy":{const[,a]=o;return new Date(Number(a),0,1)}default:return null}}const vy=["year","month","day","time","custom"],gy=e.defineComponent({emits:{elementClick:l=>He(l),left:()=>!0,right:()=>!0,heading:()=>!0},props:{headingClickable:{type:Boolean,default:!1},leftDisabled:{type:Boolean,default:!1},rightDisabled:{type:Boolean,default:!1},columnCount:{type:Number,default:7},items:{type:Array,default:()=>[]},viewMode:{type:String,required:!0,validate:l=>typeof l=="string"&&vy.includes(l)}}}),yy={class:"v3dp__heading"},ky=["disabled"],by=["disabled"],xy={class:"v3dp__body"},wy={class:"v3dp__subheading"},Ey={class:"v3dp__elements"},Cy=["disabled","onClick"];function _y(l,t,n,o,a,r){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["v3dp__popout",`v3dp__popout-${l.viewMode}`]),style:e.normalizeStyle({"--popout-column-definition":`repeat(${l.columnCount}, 1fr)`}),onMousedown:t[3]||(t[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",yy,[e.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__left",disabled:l.leftDisabled,onClick:t[0]||(t[0]=e.withModifiers(s=>l.$emit("left"),["stop","prevent"]))},[e.renderSlot(l.$slots,"arrow-left",{},()=>[t[4]||(t[4]=e.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[e.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createElementVNode("path",{stroke:"none",d:"M-9 16V-8h24v24z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 0L1 4l4 4"})])],-1))],!0)],8,ky),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.headingClickable?"button":"span"),{class:"v3dp__heading__center",onClick:t[1]||(t[1]=e.withModifiers(s=>l.$emit("heading"),["stop","prevent"]))},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"heading",{},void 0,!0)]),_:3})),e.createElementVNode("button",{class:"v3dp__heading__button v3dp__heading__button__right",disabled:l.rightDisabled,onClick:t[2]||(t[2]=e.withModifiers(s=>l.$emit("right"),["stop","prevent"]))},[e.renderSlot(l.$slots,"arrow-right",{},()=>[t[5]||(t[5]=e.createElementVNode("svg",{class:"v3dp__heading__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6 8"},[e.createElementVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createElementVNode("path",{stroke:"none",d:"M15-8v24H-9V-8z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M1 8l4-4-4-4"})])],-1))],!0)],8,by)]),e.createElementVNode("div",xy,["subheading"in l.$slots?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",wy,[e.renderSlot(l.$slots,"subheading",{},void 0,!0)]),t[6]||(t[6]=e.createElementVNode("hr",{class:"v3dp__divider"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Ey,[e.renderSlot(l.$slots,"body",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,s=>(e.openBlock(),e.createElementBlock("button",{key:s.key,disabled:s.disabled,class:e.normalizeClass([{selected:s.selected,current:s.current},`v3dp__element__button__${l.viewMode}`]),onClick:e.withModifiers(i=>l.$emit("elementClick",s.value),["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(s.display),1)],10,Cy))),128))],!0)])])],38)}const Jn=pe(gy,[["render",_y],["__scopeId","data-v-5de7813f"]]),Ny=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l)},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(l,{emit:t}){const n=e.computed(()=>ny(l.pageDate)),o=e.computed(()=>ly(l.pageDate)),a=(d,u,p)=>!u&&!p?!0:!(u&&pt(d)<pt(u)||p&&pt(d)>pt(p)),r=e.computed(()=>ry({start:n.value,end:o.value}).map(d=>({value:d,key:String(pt(d)),display:pt(d),selected:!!l.selected&&pt(d)===pt(l.selected),disabled:!a(d,l.lowerLimit,l.upperLimit)}))),s=e.computed(()=>{const d=pt(n.value),u=pt(o.value);return`${d} - ${u}`}),i=e.computed(()=>l.lowerLimit&&(Gn(l.lowerLimit)===Gn(l.pageDate)||un(l.pageDate,l.lowerLimit))),c=e.computed(()=>l.upperLimit&&(Gn(l.upperLimit)===Gn(l.pageDate)||pn(l.pageDate,l.upperLimit)));return{years:r,heading:s,leftDisabled:i,rightDisabled:c,previousPage:()=>t("update:pageDate",ga(l.pageDate,10)),nextPage:()=>t("update:pageDate",Wn(l.pageDate,10))}}});function By(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{columnCount:3,leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,items:l.years,viewMode:"year",onLeft:l.previousPage,onRight:l.nextPage,onElementClick:t[0]||(t[0]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const Sy=pe(Ny,[["render",By]]),My=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"LLL"},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1}},setup(l,{emit:t}){const n=e.computed(()=>ya(l.pageDate)),o=e.computed(()=>ka(l.pageDate)),a=e.computed(()=>u=>Zn(u,l.format)),r=(u,p,g)=>!p&&!g?!0:!(p&&un(u,jl(p))||g&&pn(u,Ul(g))),s=e.computed(()=>ay({start:n.value,end:o.value}).map(u=>({value:u,display:a.value(u),key:a.value(u),selected:!!l.selected&&Wl(l.selected,u),disabled:!r(u,l.lowerLimit,l.upperLimit)}))),i=e.computed(()=>pt(n.value)),c=e.computed(()=>l.lowerLimit&&(ba(l.lowerLimit,l.pageDate)||un(l.pageDate,l.lowerLimit))),d=e.computed(()=>l.upperLimit&&(ba(l.upperLimit,l.pageDate)||pn(l.pageDate,l.upperLimit)));return{months:s,heading:i,leftDisabled:c,rightDisabled:d,previousPage:()=>t("update:pageDate",ga(l.pageDate,1)),nextPage:()=>t("update:pageDate",Wn(l.pageDate,1))}}});function Ay(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",columnCount:3,items:l.months,leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,viewMode:"month",onLeft:l.previousPage,onRight:l.nextPage,onHeading:t[0]||(t[0]=i=>l.$emit("back")),onElementClick:t[1]||(t[1]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),_:1},8,["items","leftDisabled","rightDisabled","onLeft","onRight"])}const Dy=pe(My,[["render",Ay]]),Ty=e.defineComponent({components:{PickerPopup:Jn},emits:{"update:pageDate":l=>He(l),select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},format:{type:String,required:!1,default:"dd"},headingFormat:{type:String,required:!1,default:"LLLL yyyy"},weekdayFormat:{type:String,required:!1,default:"EE"},weekStartsOn:{type:Number,required:!1,default:1,validator:l=>typeof l=="number"&&Number.isInteger(l)&&l>=0&&l<=6},customWeekdays:{type:Array,required:!1},lowerLimit:{type:Date,required:!1},upperLimit:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1}},setup(l,{emit:t}){const n=e.computed(()=>w=>m=>Zn(m,w)),o=e.computed(()=>jl(l.pageDate)),a=e.computed(()=>Ul(l.pageDate)),r=e.computed(()=>({start:o.value,end:a.value})),s=e.computed(()=>({start:ql(o.value,l.weekStartsOn),end:sy(a.value,l.weekStartsOn)})),i=e.computed(()=>l.customWeekdays?.length===7?l.customWeekdays:null),c=e.computed(()=>{const w=l.weekStartsOn,m=i.value;if(m)return Array.from({length:7}).map((E,C)=>m[(w+C)%7]);const f=n.value(l.weekdayFormat);return Array.from(Array(7)).map((E,C)=>(w+C)%7).map(E=>iy(new Date,E,l.weekStartsOn)).map(f)}),d=(w,m,f,E)=>E?.dates?.some(C=>Kn(w,C))||E?.predicate?.(w)?!1:!m&&!f?!0:!(m&&un(w,Ft(m))||f&&pn(w,dn(f))),u=e.computed(()=>{const w=new Date,m=n.value(l.format);return oy(s.value).map(f=>({value:f,display:m(f),selected:!!l.selected&&Kn(l.selected,f),current:Kn(w,f),disabled:!l.allowOutsideInterval&&!dy(f,r.value)||!d(f,l.lowerLimit,l.upperLimit,l.disabledDates),key:n.value("yyyy-MM-dd")(f)}))}),p=e.computed(()=>n.value(l.headingFormat)(l.pageDate)),g=e.computed(()=>l.lowerLimit&&(Wl(l.lowerLimit,l.pageDate)||un(l.pageDate,l.lowerLimit))),y=e.computed(()=>l.upperLimit&&(Wl(l.upperLimit,l.pageDate)||pn(l.pageDate,l.upperLimit)));return{weekDays:c,days:u,heading:p,leftDisabled:g,rightDisabled:y,previousPage:()=>t("update:pageDate",ty(l.pageDate)),nextPage:()=>t("update:pageDate",Hl(l.pageDate,1))}}});function Ly(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",leftDisabled:l.leftDisabled,rightDisabled:l.rightDisabled,items:l.days,viewMode:"day",onLeft:l.previousPage,onRight:l.nextPage,onHeading:t[0]||(t[0]=i=>l.$emit("back")),onElementClick:t[1]||(t[1]=i=>l.$emit("select",i))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.heading),1)]),subheading:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.weekDays,(i,c)=>(e.openBlock(),e.createElementBlock("span",{key:i,class:e.normalizeClass(`v3dp__subheading__weekday__${c}`)},e.toDisplayString(i),3))),128))]),_:1},8,["leftDisabled","rightDisabled","items","onLeft","onRight"])}const $y=pe(Ty,[["render",Ly]]);function _a(l,t){const n=l.getBoundingClientRect(),o={height:l.clientHeight,width:l.clientWidth},a=t.getBoundingClientRect();if(!(a.top>=n.top&&a.bottom<=n.top+o.height)){const r=a.top-n.top,s=a.bottom-n.bottom;Math.abs(r)<Math.abs(s)?l.scrollTop+=r:l.scrollTop+=s}}const Iy=e.defineComponent({components:{PickerPopup:Jn},emits:{select:l=>He(l),back:()=>!0},props:{selected:{type:Date,required:!1},pageDate:{type:Date,required:!0},visible:{type:Boolean,required:!0},disabledTime:{type:Object,required:!1}},setup(l,{emit:t}){const n=e.ref(null),o=e.ref(null),a=e.computed(()=>l.pageDate??l.selected),r=e.ref(a.value.getHours()),s=e.ref(a.value.getMinutes());e.watch(()=>l.selected,p=>{let g=0,y=0;p&&(g=p.getHours(),y=p.getMinutes()),r.value=g,s.value=y});const i=e.computed(()=>[...Array(24).keys()].map(p=>({value:p,date:wa(new Date(a.value.getTime()),{hours:p,minutes:s.value,seconds:0}),selected:r.value===p,ref:e.ref(null)}))),c=e.computed(()=>[...Array(60).keys()].map(p=>({value:p,date:wa(new Date(a.value.getTime()),{hours:r.value,minutes:p,seconds:0}),selected:s.value===p,ref:e.ref(null)}))),d=p=>{s.value=p.value,t("select",p.date)},u=()=>{const p=i.value.find(y=>y.ref.value?.classList?.contains("selected")??!1),g=c.value.find(y=>y.ref.value?.classList?.contains("selected")??!1);p&&g&&(_a(n.value,p.ref.value),_a(o.value,g.ref.value))};return e.watch(()=>l.visible,p=>{p&&e.nextTick(u)}),{hoursListRef:n,minutesListRef:o,hours:r,minutes:s,hoursList:i,minutesList:c,padStartZero:p=>`0${p}`.substr(-2),selectMinutes:d,isEnabled:p=>!(l.disabledTime?.dates?.some(g=>xa(p,g)&&cy(p,g))||l.disabledTime?.predicate?.(p)),scroll:u}}}),Fy={ref:"hoursListRef",class:"v3dp__column"},Oy=["disabled","onClick"],Py={ref:"minutesListRef",class:"v3dp__column"},Ry=["disabled","onClick"];function zy(l,t,n,o,a,r){const s=e.resolveComponent("picker-popup");return e.openBlock(),e.createBlock(s,{headingClickable:"",columnCount:2,leftDisabled:!0,rightDisabled:!0,viewMode:"time",onHeading:t[0]||(t[0]=i=>l.$emit("back"))},{heading:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.padStartZero(l.hours))+":"+e.toDisplayString(l.padStartZero(l.minutes)),1)]),body:e.withCtx(()=>[e.createElementVNode("div",Fy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.hoursList,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,ref_for:!0,ref:i.ref,class:e.normalizeClass([{selected:i.selected},"v3dp__element_button__hour"]),disabled:!l.isEnabled(i.date),onClick:e.withModifiers(c=>l.hours=i.value,["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(l.padStartZero(i.value)),1)],10,Oy))),128))],512),e.createElementVNode("div",Py,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.minutesList,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,ref_for:!0,ref:i.ref,class:e.normalizeClass([{selected:i.selected},"v3dp__element_button__minute"]),disabled:!l.isEnabled(i.date),onClick:e.withModifiers(c=>l.selectMinutes(i),["stop","prevent"])},[e.createElementVNode("span",null,e.toDisplayString(l.padStartZero(i.value)),1)],10,Ry))),128))],512)]),_:1})}const jy=pe(Iy,[["render",zy],["__scopeId","data-v-43e01bf7"]]),Xn=["time","day","month","year"],Uy=(l,t,n=void 0)=>{let o=n||new Date;const a=uy([l,o]);a&&(o=a);const r=py([t,o]);return r&&(o=r),o};e.defineComponent({components:{YearPicker:Sy,MonthPicker:Dy,DayPicker:$y,TimePicker:jy},inheritAttrs:!1,props:{placeholder:{type:String,default:""},modelValue:{type:Date,required:!1},disabledDates:{type:Object,required:!1},allowOutsideInterval:{type:Boolean,required:!1,default:!1},disabledTime:{type:Object,required:!1},upperLimit:{type:Date,required:!1},lowerLimit:{type:Date,required:!1},startingView:{type:String,required:!1,default:"day",validate:l=>typeof l=="string"&&Xn.includes(l)},startingViewDate:{type:Date,required:!1,default:()=>new Date},dayPickerHeadingFormat:{type:String,required:!1,default:"LLLL yyyy"},monthListFormat:{type:String,required:!1,default:"LLL"},weekdayFormat:{type:String,required:!1,default:"EE"},dayFormat:{type:String,required:!1,default:"dd"},inputFormat:{type:String,required:!1,default:"yyyy-MM-dd"},weekDayNames:{type:Array,required:!1},weekStartsOn:{type:Number,required:!1,default:1,validator:l=>[0,1,2,3,4,5,6].includes(l)},disabled:{type:Boolean,required:!1,default:!1},clearable:{type:Boolean,required:!1,default:!1},typeable:{type:Boolean,required:!1,default:!1},minimumView:{type:String,required:!1,default:"day",validate:l=>typeof l=="string"&&Xn.includes(l)}},emits:{"update:modelValue":l=>l==null||He(l),decadePageChanged:l=>!0,yearPageChanged:l=>!0,monthPageChanged:l=>!0,opened:()=>!0,closed:()=>!0},setup(l,{emit:t,attrs:n}){const o=e.ref("none"),a=e.ref(l.startingViewDate),r=e.ref(null),s=e.ref(!1),i=e.ref(""),c=N=>{const j=N.replace(/[a-zA-Z]/g,"0");return/0/.test(j)?j:""},d=e.computed(()=>c(l.inputFormat));let u=null,p=null;const g=()=>{u?.destroy(),u=null},y=async()=>{if(!p){const{default:N}=await Promise.resolve().then(()=>zo);p=N}return p},w=()=>{u&&u.value!==i.value&&(u.value=i.value??"")},m=async()=>{g(),!(!r.value||!d.value)&&(u=(await y())(r.value,{mask:d.value,lazy:!0,overwrite:!0}),w())};e.watchEffect(()=>{if(!i.value)return;const N=Ca(i.value,l.inputFormat);N&&(a.value=N)}),e.watchEffect(()=>{i.value=l.modelValue&&He(l.modelValue)?Zn(l.modelValue,l.inputFormat):""}),e.onMounted(()=>{d.value&&e.nextTick(()=>{m()})}),e.onBeforeUnmount(()=>{g()}),e.watch(d,N=>{N?e.nextTick(()=>{m()}):g()}),e.watch(i,()=>{w()});const f=(N="none")=>{l.disabled||(N!=="none"&&o.value==="none"&&(a.value=l.modelValue||Uy(l.lowerLimit,l.upperLimit,a.value)),o.value=N,t(N!=="none"?"opened":"closed"))};e.watchEffect(()=>{l.disabled&&(o.value="none")});const E=(N,j)=>{a.value=j,N==="year"?t("decadePageChanged",j):N==="month"?t("yearPageChanged",j):N==="day"&&t("monthPageChanged",j)},C=N=>{a.value=N,l.minimumView==="year"?(f("none"),t("update:modelValue",N)):o.value="month"},_=N=>{a.value=N,l.minimumView==="month"?(f("none"),t("update:modelValue",N)):o.value="day"},b=N=>{a.value=N,l.minimumView==="day"?(f("none"),t("update:modelValue",N)):o.value="time"},x=N=>{f("none"),t("update:modelValue",N)},D=()=>{l.clearable&&(f("none"),t("update:modelValue",null),a.value=l.startingViewDate)},S=()=>s.value=!0,M=()=>f(U.value),O=()=>{s.value=!1,f()},K=N=>{const j=N.keyCode?N.keyCode:N.which;if([27,13].includes(j)&&r.value.blur(),l.typeable){const $=Ca(r.value.value,l.inputFormat);$&&i.value===Zn($,l.inputFormat)&&(i.value=r.value.value,t("update:modelValue",$))}},U=e.computed(()=>{const N=Xn.indexOf(l.startingView),j=Xn.indexOf(l.minimumView);return N<j?l.minimumView:l.startingView}),R=N=>Object.fromEntries(Object.entries(N??{}).filter(([j,$])=>j.startsWith("--"))),q=e.computed(()=>l.weekDayNames?.length===7?l.weekDayNames:void 0);return{blur:O,focus:M,click:S,input:i,inputRef:r,pageDate:a,renderView:f,updatePageDate:E,selectYear:C,selectMonth:_,selectDay:b,selectTime:x,keyUp:K,normalizedWeekdayNames:q,viewShown:o,goBackFromTimepicker:()=>l.startingView==="time"&&l.minimumView==="time"?null:o.value="day",clearModelValue:D,initialView:U,log:N=>console.log(N),variables:R}}});const Na=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:n}=fe.modal({title:l.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:Jg,contentProps:{...l,onClose:()=>{t(null),n()},onSave:o=>{t(o),n()}}})});It.install=function(l){l.component("VForm",It),Object.assign(l.config.globalProperties,{$form:Na}),l.provide("form",Na),window.v3plugin||(window.v3plugin={})};const Hy={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},qy=["title"],Wy={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},Gy=["onClick"],Ky=["placeholder"],Yy={class:"divide-y divide-gray-100"},Zy=["onClick"],Jy=600,Xy=30,Qy=8,Vy="https://data.softpro.ua/api-user/gis-url-proxy",e1="https://geo.rv.ua/api-user/dzk.api",t1="https://nominatim.openstreetmap.org/search",n1=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(l){const t=l,n=On(),o=e.getCurrentInstance();function a(){return o?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const s=!!a()?["xy","parcel","address"]:["xy","parcel"],i=e.computed(()=>{const V=t.config?.tools?.filter(oe=>s.includes(oe));return V&&V.length?V:s}),c=e.computed(()=>t.config?.placeholder?.trim()||"Пошук…"),d=e.ref(i.value[0]);e.watch(i,V=>{V.includes(d.value)||(d.value=V[0])});const u=e.ref(""),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref([]),m=e.ref(null),f=e.computed(()=>d.value==="address"&&w.value.length>0);let E=null;const C=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function _(){if(!y.value)return;const V=y.value.getBoundingClientRect(),oe=V.width+Xy,ee=V.left+window.scrollX,H=V.bottom+window.scrollY+Qy;C.left=`${ee}px`,C.top=`${H}px`,C.width=`${oe}px`,C.display="block"}const b=()=>{f.value&&_()};function x(){E&&(clearTimeout(E),E=null)}e.watch(d,()=>{u.value="",p.value=!1,w.value=[],x()}),e.watch(f,V=>{V?e.nextTick(()=>{_()}):C.display="none"}),e.watch(u,V=>{if(d.value!=="address"){w.value=[],x();return}if(!V.trim()){w.value=[],x();return}x(),E=window.setTimeout(()=>{q(V).catch(oe=>{const ee=oe?.message||"Помилка пошуку адреси";fe.notify({type:"error",title:"Пошук адреси",message:ee})})},Jy)});function D(V){d.value=V}function S(V){const oe=V.target;if(p.value){const ee=g.value;ee&&!ee.contains(oe)&&(p.value=!1)}if(f.value){const ee=m.value;ee&&!ee.contains(oe)&&(w.value=[])}}e.onMounted(()=>{window.addEventListener("click",S,!0),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",S,!0),window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),x()});function M(V){return V==="xy"?"Координати":V==="parcel"?"Кадастр":"Адреси"}function O(V){const oe=V.replace(/[,]+/g," ").trim();if(!oe)return null;const ee=oe.split(/\s+/).filter(Boolean);if(ee.length<2)return null;const H=ee.slice(0,2).map(Number);if(!H.every(L=>Number.isFinite(L)))return null;let[ie,Y]=H,se=ie,ue=Y;const he=L=>Math.abs(L)<=90,be=L=>Math.abs(L)<=180;if(!he(se)||!be(ue))if(he(ue)&&be(se))se=Y,ue=ie;else return null;return{lat:se,lng:ue}}function K(V){return(V?.items||[]).map((ee,H)=>{const ie=Number(ee?.position?.lat),Y=Number(ee?.position?.lng);return!Number.isFinite(ie)||!Number.isFinite(Y)?null:{id:String(ee?.id??H),title:ee?.title||ee?.address?.label||"Знайдений обʼєкт",lat:ie,lng:Y}}).filter(ee=>!!ee)}function U(V){const oe=V?.result||V?.data||V;if(!oe)return[];const ee=oe.geom_centroid;if(!ee||!Array.isArray(ee.coordinates))return[];const[H,ie]=ee.coordinates;return!Number.isFinite(ie)||!Number.isFinite(H)?[]:[{id:"parcel",title:oe.cadnum||oe.cad_num||"Земельна ділянка",lat:ie,lng:H}]}function R(V){return(Array.isArray(V?.features)?V.features:[]).map((ee,H)=>{const ie=ee?.geometry?.coordinates,Y=Number(ie?.[0]),se=Number(ie?.[1]);if(!Number.isFinite(se)||!Number.isFinite(Y))return null;const ue=ee?.properties||{},he=ue?.geocoding?.label||ue?.display_name||ue?.label||"Адреса";return{id:String(ue?.geocoding?.place_id||ue?.place_id||H),title:he,lat:se,lng:Y}}).filter(ee=>!!ee)}async function q(V){w.value=[],x();const oe=new URL(t1);oe.searchParams.set("format","geojson"),oe.searchParams.set("q",V),oe.searchParams.set("addressdetails","1"),oe.searchParams.set("bounded","1");const ee=a();ee&&oe.searchParams.set("viewbox",ee);const H=await fetch(oe.toString());if(!H.ok)throw new Error(`HTTP ${H.status}`);const ie=await H.json(),Y=R(ie);if(!Y.length){fe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}w.value=Y}function N(V){$(V),w.value=[],u.value=""}function j(V){const ee=V.replace(/\s+/g,"").split(":");if(ee.length!==4)return!1;const H=[10,2,3,4];return ee.every((ie,Y)=>ie.length===H[Y]&&/^\d+$/.test(ie))}function $(V){const oe=t.config?.zoom??17;n.flyTo?.({center:[V.lng,V.lat],zoom:oe})}async function Z(){const V=u.value.trim();if(V){if(d.value==="xy"){const oe=O(V);if(!oe){fe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}$(oe),u.value="";return}if(d.value==="address"){try{await q(V)}catch(oe){const ee=oe?.message||"Помилка пошуку адреси";fe.notify({type:"error",title:"Пошук адреси",message:ee})}return}try{const oe=new URL(d.value==="here"?Vy:e1);if(d.value==="here")oe.searchParams.set("searchtext",V);else{if(!j(V)){fe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}oe.searchParams.set("cad_num",V)}const ee=await fetch(oe.toString());if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const H=await ee.json(),ie=d.value==="here"?K(H):U(H);if(!ie.length)fe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const Y=ie[0];$(Y),u.value=""}}catch(oe){const ee=oe?.message||"Помилка пошуку";fe.notify({type:"error",title:"Пошук",message:ee})}}}return(V,oe)=>(e.openBlock(),e.createElementBlock("div",Hy,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(Z,["prevent"])},[i.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:oe[0]||(oe[0]=ee=>p.value=!p.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:M(d.value)},e.toDisplayString(M(d.value)),9,qy),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":p.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},oe[3]||(oe[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),p.value?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,ee=>(e.openBlock(),e.createElementBlock("li",{key:ee,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:H=>D(ee)},e.toDisplayString(M(ee)),9,Gy))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:y,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?(e.openBlock(),e.createBlock(e.unref(Il),{key:0,modelValue:u.value,"onUpdate:modelValue":oe[1]||(oe[1]=ee=>u.value=ee),mask:"0000000000:00:000:0000",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,["modelValue"])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":oe[2]||(oe[2]=ee=>u.value=ee),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Ky)),[[e.vModelText,u.value,void 0,{trim:!0}]]),oe[4]||(oe[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),f.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:m,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(C)},[e.createElementVNode("ul",Yy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,ee=>(e.openBlock(),e.createElementBlock("li",{key:ee.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:H=>N(ee)},e.toDisplayString(ee.title),9,Zy))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),l1={class:"map-center-control"},o1=["aria-label"],a1=e.defineComponent({directives:{tooltip:fe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(l){const t=l,{map:n,ready:o}=On(),a=e.ref(null),r=e.ref(null),s=e.ref(null),i=e.ref(null);function c(w){if(Array.isArray(w)&&w.length>=2){const[m,f]=w.slice(0,2).map(E=>Number(E));return Number.isNaN(m)||Number.isNaN(f)?null:[m,f]}if(w&&typeof w=="object"){const m=w,f=m.lng??m.lon??m.long??m.x,E=m.lat??m.y;if(f!=null&&E!=null){const C=Number(f),_=Number(E);if(!Number.isNaN(C)&&!Number.isNaN(_))return[C,_]}}if(typeof w=="string"){const m=w.split(",").map(f=>Number(f.trim()));if(m.length>=2&&m.every(f=>!Number.isNaN(f)))return[m[0],m[1]]}return null}e.watch(()=>t.center,w=>{const m=c(w);m&&(a.value=m)},{immediate:!0}),e.watch(()=>t.zoom,w=>{const m=Number(w);Number.isNaN(m)||(r.value=m)},{immediate:!0}),e.watch(()=>t.targetCenter,w=>{s.value=c(w)},{immediate:!0}),e.watch(()=>t.targetZoom,w=>{const m=Number(w);i.value=Number.isNaN(m)?null:m},{immediate:!0});const d=e.computed(()=>t.targetLabel?.trim()||"Точка"),u=e.computed(()=>t.targetAriaLabel||"Перейти до точки"),p=e.computed(()=>!!s.value);e.onMounted(async()=>{const w=n.value;if(w){if(!a.value){const m=w.getCenter();a.value=[m.lng,m.lat]}r.value==null&&(r.value=w.getZoom())}});function g(){const w=n.value;if(!w)return;const m=a.value||(()=>{const E=w.getCenter();return[E.lng,E.lat]})(),f=r.value??w.getZoom();w.flyTo({center:m,zoom:f})}function y(){const w=n.value;if(!w||!s.value)return;const m=i.value??r.value??w.getZoom();w.flyTo({center:s.value,zoom:m})}return(w,m)=>{const f=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",l1,[p.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(ys),{class:"w-4 h-4"})])),[[f,"Центр мапи"]]),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":u.value,onClick:e.withModifiers(y,["stop"])},[e.createVNode(e.unref(bs),{class:"w-4 h-4"})],8,o1)),[[f,d.value]]):e.createCommentVNode("",!0)])}}}),Ba=_t(a1,[["__scopeId","data-v-bc627616"]]),r1={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},s1={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},i1=["aria-label"],c1={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},d1={class:"text-slate-900 font-semibold mb-1"},u1=["innerHTML"],p1={key:1,class:"space-y-2"},m1={class:"text-gray-500"},f1={class:"font-medium text-slate-900"},h1={key:2,class:"mt-2 flex flex-col gap-2"},v1=["href","target"],Gl="map-basemap-source",g1="map-basemap-layer",y1=20,Yt="map-katottg-geometry-source",Qn="map-katottg-geometry-line",Ot="map-geometry-source",Zt="map-geometry-fill",Jt="map-geometry-line",Vn=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(l){const t=l,n=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],r=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{},s=e.computed(()=>t.katottg!=null?t.katottg:r.katottg),i=e.computed(()=>(Array.isArray(r.basemaps)&&r.basemaps.length?r.basemaps:n).map((I,ne)=>{const ce=typeof I.url=="string"?I.url.trim():"";return ce?{key:(I.key??I.name??`base-${ne}`).trim()||`base-${ne}`,url:ce,name:I.name??I.key??`Layer ${ne+1}`}:null}).filter(I=>!!I)),c=Array.isArray(r.center)&&r.center.length>=2?[Number(r.center[0]),Number(r.center[1])]:void 0,d=typeof r.zoom=="number"?r.zoom:void 0,u=e.ref(null),p=On({container:u,center:t.center??c,zoom:t.zoom??d}),{map:g,setStyle:y,setCenter:w,setZoom:m,state:f,getOverlayConfig:E,selectedCard:C,setBasemapOptions:_,clearCard:b,addControl:x,removeControl:D,ready:S}=p,M=e.computed({get:()=>f.value.selectedBasemap??"",set:k=>{f.value.selectedBasemap=k}}),O=e.computed({get:()=>f.value.geometryVisible??!0,set:k=>{f.value.geometryVisible=k}}),K=e.computed(()=>{const k=t.height;return{height:typeof k=="number"?`${k}px`:String(k)}}),U=e.ref(!1),R=e.computed(()=>U.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),q=e.computed(()=>{const k=["w-full","h-full"];return U.value||k.push(`min-h-[${K.value.height}]`),k.join(" ")}),N=e.computed(()=>C.value),j=()=>b?.(),$=e.ref(t.center??c??null),Z=e.ref(t.zoom??d??null),V=e.computed(()=>t.center??$.value??null),oe=e.computed(()=>typeof t.zoom=="number"?t.zoom:typeof Z.value=="number"?Z.value:y1),ee=["home","fullscreen","scale","position","search"],H=e.computed(()=>!Array.isArray(t.tools)||!t.tools.length?ee:t.tools.filter(k=>ee.includes(k))),ie=k=>H.value.includes(k);e.watch([g,S],([k,A])=>{if(!(!k||!A)){if(!$.value){const I=k.getCenter();$.value=[I.lng,I.lat]}Z.value==null&&(Z.value=k.getZoom())}},{immediate:!0});const Y=e.ref(null),se=e.ref(""),ue=e.ref(null),he=k=>{if(!k)return"";const A=Number(k.lat??k[1]),I=Number(k.lng??k[0]);return!Number.isFinite(A)||!Number.isFinite(I)?"":`${I.toFixed(5)}, ${A.toFixed(5)}`},be=k=>{k?.lngLat&&(se.value=he(k.lngLat))},L=()=>{se.value=""},le=k=>{k&&(k.on("mousemove",be),k.on("mouseleave",L),ue.value=k)},T=k=>{k&&(k.off("mousemove",be),k.off("mouseleave",L),ue.value=null)},P=e.computed(()=>ie("scale"));e.watch([g,S],([k,A],[I])=>{I&&T(I),!(!k||!A)&&le(k)},{immediate:!0}),e.watch([g,S,P],([k,A,I])=>{if(Y.value&&D&&(D(Y.value),Y.value=null),!k||!A||!I)return;const ne=window?.maplibregl;ne&&(Y.value=new ne.ScaleControl({unit:"metric"}),x?.(Y.value,"bottom-left"))},{immediate:!0});const X=e.computed(()=>Array.isArray(t.legend)?t.legend.map((k,A)=>{const I=typeof k?.color=="string"?k.color.trim():"",ne=typeof k?.label=="string"?k.label.trim():"";return!I||!ne?null:{color:I,label:ne,key:`${ne}-${A}`}}).filter(k=>!!k):[]),J=e.computed(()=>Array.isArray(t.layers)&&t.layers.length?t.layers:Array.isArray(r.layers)&&r.layers.length?r.layers:[]);e.watch(i,k=>{if(_?.(k),!k.length){M.value="";return}k.some(A=>A.key===M.value)||(M.value=k[0].key)},{immediate:!0});const re=(k,A)=>{const I=k.getSource(Gl);return I&&typeof I.setTiles=="function"?(I.setTiles([A]),!0):!1},xe=k=>{if(!k)return;const A=g.value;if(A&&A.isStyleLoaded&&A.isStyleLoaded()&&re(A,k.url))return;const I=h(k.url);I&&y(I)};e.watch(M,k=>{if(!k)return;const A=i.value.find(I=>I.key===k);A&&xe(A)},{immediate:!0}),e.watch(J,k=>{p.setOverlays?.(k)},{immediate:!0,deep:!0});const F=e.ref(null);let te=0;const ae=e.computed(()=>v(F.value)),_e={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2}},Ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},Re=e.ref(v(t.geom)),Ye=e.ref(B(Re.value)),dt=e.ref(!1),Qe=e.computed(()=>{if(!Ye.value)return null;const[k,A,I,ne]=Ye.value;return[(k+I)/2,(A+ne)/2]});e.ref(!1);const ht=()=>{U.value=!U.value},ze=e.ref(!1),Le=()=>{const k=g.value;if(!k||!k.isStyleLoaded())return;const A=Re.value;if(!A){wt(k);return}let I=k.getSource(Ot);I?I.setData(A):(k.addSource(Ot,{type:"geojson",data:A}),je(k),I=k.getSource(Ot)),ut(k,O.value?"visible":"none"),z(),W(),Ye.value&&(dt.value||!ze.value)&&(k.fitBounds(Ye.value,{padding:40,maxZoom:16,duration:0}),ze.value=!0,dt.value=!1)},je=k=>{const A=_e;k.getLayer(Zt)||k.addLayer({id:Zt,type:"fill",source:Ot,paint:A.fill}),k.getLayer(Jt)||k.addLayer({id:Jt,type:"line",source:Ot,paint:A.line})},wt=k=>{[Jt,Zt].forEach(A=>{k.getLayer(A)&&k.removeLayer(A)}),k.getSource(Ot)&&k.removeSource(Ot)},ut=(k,A)=>{[Jt,Zt].forEach(I=>{k.getLayer(I)&&k.setLayoutProperty(I,"visibility",A)})},z=()=>{const k=g.value;if(!k||!k.isStyleLoaded())return;const A=_e;k.getLayer(Zt)&&Object.entries(A.fill).forEach(([I,ne])=>{k.setPaintProperty(Zt,I,ne)}),k.getLayer(Jt)&&Object.entries(A.line).forEach(([I,ne])=>{k.setPaintProperty(Jt,I,ne)})},Q=k=>{k.getLayer(Qn)||k.addLayer({id:Qn,type:"line",source:Yt,layout:{visibility:"visible"},paint:Ae})},W=()=>{const k=g.value;if(!k)return;const A=ae.value??{type:"FeatureCollection",features:[]};if(!k.getSource(Yt)){k.addSource(Yt,{type:"geojson",data:A}),Q(k);return}const I=k.getSource(Yt);I&&typeof I.setData=="function"&&I.setData(A),Q(k)},G=k=>{k.getLayer(Qn)&&k.removeLayer(Qn),k.getSource(Yt)&&k.removeSource(Yt)},ve=async k=>{const A=typeof k=="string"?k.trim():"",I=++te;if(!A){F.value=null;return}try{const ne=await fetch(`https://data.gki.com.ua/api-user/atu/${A}`);if(te!==I)return;if(!ne.ok){F.value=null;return}const ce=await ne.json();if(te!==I)return;F.value=ce}catch{if(te!==I)return;F.value=null}};e.watch(s,k=>{ve(k)},{immediate:!0}),e.watch(ae,()=>{W()},{immediate:!0}),e.watch(()=>t.geom,k=>{Re.value=v(k),Ye.value=B(Re.value),ze.value=!1,dt.value=!0,Le()},{deep:!0,immediate:!0}),e.watch(O,()=>{const k=g.value;k&&k.isStyleLoaded()&&ut(k,O.value?"visible":"none")}),e.watch(g,(k,A)=>{A&&(A.off("style.load",Le),A.off("load",Le),A.off("idle",Le)),k&&(k.on("load",Le),k.on("style.load",Le),k.on("idle",Le),Le())}),e.watch(()=>t.center,k=>{!g.value||!Array.isArray(k)||k.length<2||w([k[0],k[1]])},{deep:!0}),e.watch(()=>t.zoom,k=>{!g.value||typeof k!="number"||m(k)}),e.onBeforeUnmount(()=>{Y.value&&D&&D(Y.value),ue.value?T(ue.value):g.value&&T(g.value);const k=g.value;k&&(G(k),k.off("style.load",Le))});function me(k){k&&(M.value=k)}function Ee(k){O.value=k}p.setBasemap=me,p.toggleGeometry=Ee,p.setOverlays?.(J.value);function h(k){if(k)return{version:8,sources:{[Gl]:{type:"raster",tiles:[k],tileSize:256}},layers:[{id:g1,type:"raster",source:Gl}]}}function v(k){return k?k.type==="FeatureCollection"?k:k.type==="Feature"?{type:"FeatureCollection",features:[k]}:k.type==="Polygon"||k.type==="MultiPolygon"?{type:"FeatureCollection",features:[{type:"Feature",geometry:k}]}:null:null}function B(k){if(!k?.features?.length)return null;let A=1/0,I=1/0,ne=-1/0,ce=-1/0;const Be=Ne=>{if(typeof Ne[0]=="number"){const[Ue,Ve]=Ne;A=Math.min(A,Ue),I=Math.min(I,Ve),ne=Math.max(ne,Ue),ce=Math.max(ce,Ve);return}Ne.forEach(Ue=>Be(Ue))};return k.features.forEach(Ne=>{Be(Ne.geometry.coordinates)}),A===1/0||I===1/0?null:[A,I,ne,ce]}return(k,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(R.value),style:e.normalizeStyle(U.value?void 0:K.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:e.normalizeClass(q.value)},null,2),e.createVNode(pd,{items:X.value},null,8,["items"]),ie("search")?(e.openBlock(),e.createBlock(n1,{key:0})):e.createCommentVNode("",!0),ie("home")||ie("fullscreen")?(e.openBlock(),e.createElementBlock("div",r1,[ie("home")?(e.openBlock(),e.createElementBlock("div",s1,[e.createVNode(Ba,{center:V.value,zoom:oe.value},null,8,["center","zoom"]),e.createVNode(Ba,{"target-center":Qe.value,"target-zoom":t.zoom,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])])):e.createCommentVNode("",!0),ie("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:ht,"aria-label":U.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},A[0]||(A[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),8,i1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",c1,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:j},A[1]||(A[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])),e.createElementVNode("div",d1,e.toDisplayString(N.value.title||"Об'єкт"),1),N.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${K.value.height}-120px)]`]),innerHTML:N.value.html},null,10,u1)):(e.openBlock(),e.createElementBlock("div",p1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value.rows,I=>(e.openBlock(),e.createElementBlock("div",{key:I.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",m1,e.toDisplayString(I.label)+":",1),e.createElementVNode("span",f1,e.toDisplayString(I.value),1)]))),128))])),N.value.actions?.length?(e.openBlock(),e.createElementBlock("div",h1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value.actions,I=>(e.openBlock(),e.createElementBlock("a",{key:I.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:I.url,target:I.target??void 0,rel:"noreferrer"},e.toDisplayString(I.label),9,v1))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(cd),ie("position")&&se.value?(e.openBlock(),e.createBlock(hd,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:se.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});/**
145
145
  * @vue/shared v3.5.18
146
146
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
147
147
  * @license MIT
148
- **//*! #__NO_SIDE_EFFECTS__ */function gt(l){const t=Object.create(null);for(const n of l.split(","))t[n]=1;return n=>n in t}const g1=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kl=()=>{},el=()=>!1,Yl=l=>l.charCodeAt(0)===111&&l.charCodeAt(1)===110&&(l.charCodeAt(2)>122||l.charCodeAt(2)<97),Nt=Object.assign,yt=Array.isArray,Pe=l=>typeof l=="string",Zl=l=>typeof l=="symbol",y1=l=>l!==null&&typeof l=="object",Ba=gt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k1=gt("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jl=l=>{const t=Object.create(null);return n=>t[n]||(t[n]=l(n))},b1=/-(\w)/g,Bt=Jl(l=>l.replace(b1,(t,n)=>n?n.toUpperCase():"")),Xl=Jl(l=>l.charAt(0).toUpperCase()+l.slice(1)),x1=Jl(l=>l?`on${Xl(l)}`:""),mn={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"},w1={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},E1=/;(?![^(]*\))/g,C1=/:([^]+)/,_1=/\/\*[^]*?\*\//g;function N1(l){const t={};return l.replace(_1,"").split(E1).forEach(n=>{if(n){const o=n.split(C1);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}const B1="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",S1="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",M1="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",A1="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",D1=gt(B1),T1=gt(S1),L1=gt(M1),$1=gt(A1);/**
148
+ **//*! #__NO_SIDE_EFFECTS__ */function gt(l){const t=Object.create(null);for(const n of l.split(","))t[n]=1;return n=>n in t}const k1=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kl=()=>{},el=()=>!1,Yl=l=>l.charCodeAt(0)===111&&l.charCodeAt(1)===110&&(l.charCodeAt(2)>122||l.charCodeAt(2)<97),Nt=Object.assign,yt=Array.isArray,Pe=l=>typeof l=="string",Zl=l=>typeof l=="symbol",b1=l=>l!==null&&typeof l=="object",Sa=gt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),x1=gt("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jl=l=>{const t=Object.create(null);return n=>t[n]||(t[n]=l(n))},w1=/-(\w)/g,Bt=Jl(l=>l.replace(w1,(t,n)=>n?n.toUpperCase():"")),Xl=Jl(l=>l.charAt(0).toUpperCase()+l.slice(1)),E1=Jl(l=>l?`on${Xl(l)}`:""),mn={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"},C1={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},_1=/;(?![^(]*\))/g,N1=/:([^]+)/,B1=/\/\*[^]*?\*\//g;function S1(l){const t={};return l.replace(B1,"").split(_1).forEach(n=>{if(n){const o=n.split(N1);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}const M1="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",A1="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",D1="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",T1="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",L1=gt(M1),$1=gt(A1),I1=gt(D1),F1=gt(T1);/**
149
149
  * @vue/compiler-core v3.5.18
150
150
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
151
151
  * @license MIT
152
- **/const fn=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),hn=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Ql=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),tl=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Sa=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),Pt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Ma=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),Aa=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Vl=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),vn=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),Da=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),lo=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),ao=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),so=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),Ta=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),La=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),nl=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),ll=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),io=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),co=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),gn=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),yn=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),uo=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),po=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),I1=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),mo=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),ol=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),F1=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),O1=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),P1=Symbol(process.env.NODE_ENV!=="production"?"unref":""),R1=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),ho=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),$a=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Xt={[fn]:"Fragment",[hn]:"Teleport",[Ql]:"Suspense",[tl]:"KeepAlive",[Sa]:"BaseTransition",[Pt]:"openBlock",[Ma]:"createBlock",[Aa]:"createElementBlock",[Vl]:"createVNode",[eo]:"createElementVNode",[vn]:"createCommentVNode",[to]:"createTextVNode",[Da]:"createStaticVNode",[no]:"resolveComponent",[lo]:"resolveDynamicComponent",[oo]:"resolveDirective",[ao]:"resolveFilter",[ro]:"withDirectives",[so]:"renderList",[Ta]:"renderSlot",[La]:"createSlots",[nl]:"toDisplayString",[ll]:"mergeProps",[io]:"normalizeClass",[co]:"normalizeStyle",[gn]:"normalizeProps",[yn]:"guardReactiveProps",[uo]:"toHandlers",[po]:"camelize",[I1]:"capitalize",[mo]:"toHandlerKey",[ol]:"setBlockTracking",[F1]:"pushScopeId",[O1]:"popScopeId",[fo]:"withCtx",[P1]:"unref",[R1]:"isRef",[ho]:"withMemo",[$a]:"isMemoSame"};function z1(l){Object.getOwnPropertySymbols(l).forEach(t=>{Xt[t]=l[t]})}const at={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function j1(l,t=""){return{type:0,source:t,children:l,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:at}}function kn(l,t,n,o,a,r,s,i=!1,c=!1,d=!1,u=at){return l&&(i?(l.helper(Pt),l.helper(en(l.inSSR,d))):l.helper(Vt(l.inSSR,d)),s&&l.helper(ro)),{type:13,tag:t,props:n,children:o,patchFlag:a,dynamicProps:r,directives:s,isBlock:i,disableTracking:c,isComponent:d,loc:u}}function Rt(l,t=at){return{type:17,loc:t,elements:l}}function ct(l,t=at){return{type:15,loc:t,properties:l}}function $e(l,t){return{type:16,loc:at,key:Pe(l)?ye(l,!0):l,value:t}}function ye(l,t=!1,n=at,o=0){return{type:4,loc:n,content:l,isStatic:t,constType:t?3:o}}function mt(l,t=at){return{type:8,loc:t,children:l}}function Oe(l,t=[],n=at){return{type:14,loc:n,callee:l,arguments:t}}function Qt(l,t=void 0,n=!1,o=!1,a=at){return{type:18,params:l,returns:t,newline:n,isSlot:o,loc:a}}function vo(l,t,n,o=!0){return{type:19,test:l,consequent:t,alternate:n,newline:o,loc:at}}function U1(l,t,n=!1,o=!1){return{type:20,index:l,value:t,needPauseTracking:n,inVOnce:o,needArraySpread:!1,loc:at}}function H1(l){return{type:21,body:l,loc:at}}function Vt(l,t){return l||t?Vl:eo}function en(l,t){return l||t?Ma:Aa}function go(l,{helper:t,removeHelper:n,inSSR:o}){l.isBlock||(l.isBlock=!0,n(Vt(o,l.isComponent)),t(Pt),t(en(o,l.isComponent)))}const Ia=new Uint8Array([123,123]),Fa=new Uint8Array([125,125]);function Oa(l){return l>=97&&l<=122||l>=65&&l<=90}function rt(l){return l===32||l===10||l===9||l===12||l===13}function St(l){return l===47||l===62||rt(l)}function al(l){const t=new Uint8Array(l.length);for(let n=0;n<l.length;n++)t[n]=l.charCodeAt(n);return t}const qe={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 q1{constructor(t,n){this.stack=t,this.cbs=n,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=Ia,this.delimiterClose=Fa,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=Ia,this.delimiterClose=Fa}getPos(t){let n=1,o=t+1;for(let a=this.newlines.length-1;a>=0;a--){const r=this.newlines[a];if(t>r){n=a+2,o=t-r;break}}return{column:o,line:n,offset:t}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(t){t===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t))}stateInterpolationOpen(t){if(t===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(t)):(this.state=1,this.stateText(t))}stateInterpolation(t){t===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(t))}stateInterpolationClose(t){t===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(t))}stateSpecialStartSequence(t){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?St(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(t)}stateInRCDATA(t){if(this.sequenceIndex===this.currentSequence.length){if(t===62||rt(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const o=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=o}this.sectionStart=n+2,this.stateInClosingTagName(t),this.inRCDATA=!1;return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===qe.TitleEnd||this.currentSequence===qe.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===60)}stateCDATASequence(t){t===qe.Cdata[this.sequenceIndex]?++this.sequenceIndex===qe.Cdata.length&&(this.state=28,this.currentSequence=qe.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length;){const n=this.buffer.charCodeAt(this.index);if(n===10&&this.newlines.push(this.index),n===t)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===qe.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):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(t,n){this.enterRCDATA(t,n),this.state=31}enterRCDATA(t,n){this.inRCDATA=!0,this.currentSequence=t,this.sequenceIndex=n}stateBeforeTagName(t){t===33?(this.state=22,this.sectionStart=this.index+1):t===63?(this.state=24,this.sectionStart=this.index+1):Oa(t)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:t===116?this.state=30:this.state=t===115?29:6):t===47?this.state=8:(this.state=1,this.stateText(t))}stateInTagName(t){St(t)&&this.handleTagName(t)}stateInSFCRootTagName(t){if(St(t)){const n=this.buffer.slice(this.sectionStart,this.index);n!=="template"&&this.enterRCDATA(al("</"+n),0),this.handleTagName(t)}}handleTagName(t){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(t)}stateBeforeClosingTagName(t){rt(t)||(t===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=Oa(t)?9:27,this.sectionStart=this.index))}stateInClosingTagName(t){(t===62||rt(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){t===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(t){t===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):t===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):t===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):rt(t)||(process.env.NODE_ENV!=="production"&&t===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(t))}handleAttrStart(t){t===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):t===46||t===58||t===64||t===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(t){t===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):rt(t)||(this.state=11,this.stateBeforeAttrName(t))}stateInAttrName(t){t===61||St(t)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(t)):process.env.NODE_ENV!=="production"&&(t===34||t===39||t===60)&&this.cbs.onerr(17,this.index)}stateInDirName(t){t===61||St(t)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):t===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(t){t===61||St(t)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===91?this.state=15:t===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(t){t===93?this.state=14:(t===61||St(t))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(t),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(t){t===61||St(t)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(t){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(t)}stateAfterAttrName(t){t===61?this.state=18:t===47||t===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(t)):rt(t)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(t))}stateBeforeAttrValue(t){t===34?(this.state=19,this.sectionStart=this.index+1):t===39?(this.state=20,this.sectionStart=this.index+1):rt(t)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(t))}handleInAttrValue(t,n){(t===n||this.fastForwardTo(n))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(t){this.handleInAttrValue(t,34)}stateInAttrValueSingleQuotes(t){this.handleInAttrValue(t,39)}stateInAttrValueNoQuotes(t){rt(t)||t===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(t)):(process.env.NODE_ENV!=="production"&&t===34||t===39||t===60||t===61||t===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(t){t===91?(this.state=26,this.sequenceIndex=0):this.state=t===45?25:23}stateInDeclaration(t){(t===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(t){t===45?(this.state=28,this.currentSequence=qe.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(t){(t===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){t===qe.ScriptEnd[3]?this.startSpecial(qe.ScriptEnd,4):t===qe.StyleEnd[3]?this.startSpecial(qe.StyleEnd,4):(this.state=6,this.stateInTagName(t))}stateBeforeSpecialT(t){t===qe.TitleEnd[3]?this.startSpecial(qe.TitleEnd,4):t===qe.TextareaEnd[3]?this.startSpecial(qe.TextareaEnd,4):(this.state=6,this.stateInTagName(t))}startEntity(){}stateInEntity(){}parse(t){for(this.buffer=t;this.index<this.buffer.length;){const n=this.buffer.charCodeAt(this.index);switch(n===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(n);break}case 2:{this.stateInterpolationOpen(n);break}case 3:{this.stateInterpolation(n);break}case 4:{this.stateInterpolationClose(n);break}case 31:{this.stateSpecialStartSequence(n);break}case 32:{this.stateInRCDATA(n);break}case 26:{this.stateCDATASequence(n);break}case 19:{this.stateInAttrValueDoubleQuotes(n);break}case 12:{this.stateInAttrName(n);break}case 13:{this.stateInDirName(n);break}case 14:{this.stateInDirArg(n);break}case 15:{this.stateInDynamicDirArg(n);break}case 16:{this.stateInDirModifier(n);break}case 28:{this.stateInCommentLike(n);break}case 27:{this.stateInSpecialComment(n);break}case 11:{this.stateBeforeAttrName(n);break}case 6:{this.stateInTagName(n);break}case 34:{this.stateInSFCRootTagName(n);break}case 9:{this.stateInClosingTagName(n);break}case 5:{this.stateBeforeTagName(n);break}case 17:{this.stateAfterAttrName(n);break}case 20:{this.stateInAttrValueSingleQuotes(n);break}case 18:{this.stateBeforeAttrValue(n);break}case 8:{this.stateBeforeClosingTagName(n);break}case 10:{this.stateAfterClosingTagName(n);break}case 29:{this.stateBeforeSpecialS(n);break}case 30:{this.stateBeforeSpecialT(n);break}case 21:{this.stateInAttrValueNoQuotes(n);break}case 7:{this.stateInSelfClosingTag(n);break}case 23:{this.stateInDeclaration(n);break}case 22:{this.stateBeforeDeclaration(n);break}case 25:{this.stateBeforeComment(n);break}case 24:{this.stateInProcessingInstruction(n);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 t=this.buffer.length;this.sectionStart>=t||(this.state===28?this.currentSequence===qe.CdataEnd?this.cbs.oncdata(this.sectionStart,t):this.cbs.oncomment(this.sectionStart,t):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,t))}emitCodePoint(t,n){}}const G1={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:l=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${l}.sync\` should be changed to \`v-model:${l}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(l,{compatConfig:t}){const n=t&&t[l];return l==="MODE"?n||3:n}function Mt(l,t){const n=yo("MODE",t),o=yo(l,t);return n===3?o===!0:o!==!1}function tn(l,t,n,...o){const a=Mt(l,t);return process.env.NODE_ENV!=="production"&&a&&rl(l,t,n,...o),a}function rl(l,t,n,...o){if(yo(l,t)==="suppress-warning")return;const{message:r,link:s}=G1[l],i=`(deprecation ${l}) ${typeof r=="function"?r(...o):r}${s?`
153
- Details: ${s}`:""}`,c=new SyntaxError(i);c.code=l,n&&(c.loc=n),t.onWarn(c)}function ko(l){throw l}function Pa(l){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${l.message}`)}function Se(l,t,n,o){const a=process.env.NODE_ENV!=="production"?(n||W1)[l]+(o||""):`https://vuejs.org/error-reference/#compiler-${l}`,r=new SyntaxError(String(a));return r.code=l,r.loc=t,r}const W1={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.",52:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
154
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""},et=l=>l.type===4&&l.isStatic;function Ra(l){switch(l){case"Teleport":case"teleport":return hn;case"Suspense":case"suspense":return Ql;case"KeepAlive":case"keep-alive":return tl;case"BaseTransition":case"base-transition":return Sa}}const K1=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=l=>!K1.test(l),Y1=/[A-Za-z_$\xA0-\uFFFF]/,Z1=/[\.\?\w$\xA0-\uFFFF]/,J1=/\s+[.[]\s*|\s*[.[]\s+/g,za=l=>l.type===4?l.content:l.loc.source,ja=l=>{const t=za(l).trim().replace(J1,i=>i.trim());let n=0,o=[],a=0,r=0,s=null;for(let i=0;i<t.length;i++){const c=t.charAt(i);switch(n){case 0:if(c==="[")o.push(n),n=1,a++;else if(c==="(")o.push(n),n=2,r++;else if(!(i===0?Y1:Z1).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(o.push(n),n=3,s=c):c==="["?a++:c==="]"&&(--a||(n=o.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")o.push(n),n=3,s=c;else if(c==="(")r++;else if(c===")"){if(i===t.length-1)return!1;--r||(n=o.pop())}break;case 3:c===s&&(n=o.pop(),s=null);break}}return!a&&!r},X1=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Q1=l=>X1.test(za(l));function Ua(l,t){if(!l)throw new Error(t||"unexpected compiler condition")}function tt(l,t,n=!1){for(let o=0;o<l.props.length;o++){const a=l.props[o];if(a.type===7&&(n||a.exp)&&(Pe(t)?a.name===t:t.test(a.name)))return a}}function bn(l,t,n=!1,o=!1){for(let a=0;a<l.props.length;a++){const r=l.props[a];if(r.type===6){if(n)continue;if(r.name===t&&(r.value||o))return r}else if(r.name==="bind"&&(r.exp||o)&&At(r.arg,t))return r}}function At(l,t){return!!(l&&et(l)&&l.content===t)}function V1(l){return l.props.some(t=>t.type===7&&t.name==="bind"&&(!t.arg||t.arg.type!==4||!t.arg.isStatic))}function xo(l){return l.type===5||l.type===2}function Ha(l){return l.type===7&&l.name==="pre"}function ek(l){return l.type===7&&l.name==="slot"}function sl(l){return l.type===1&&l.tagType===3}function il(l){return l.type===1&&l.tagType===2}const tk=new Set([gn,yn]);function qa(l,t=[]){if(l&&!Pe(l)&&l.type===14){const n=l.callee;if(!Pe(n)&&tk.has(n))return qa(l.arguments[0],t.concat(l))}return[l,t]}function cl(l,t,n){let o,a=l.type===13?l.props:l.arguments[2],r=[],s;if(a&&!Pe(a)&&a.type===14){const i=qa(a);a=i[0],r=i[1],s=r[r.length-1]}if(a==null||Pe(a))o=ct([t]);else if(a.type===14){const i=a.arguments[0];!Pe(i)&&i.type===15?Ga(t,i)||i.properties.unshift(t):a.callee===uo?o=Oe(n.helper(ll),[ct([t]),a]):a.arguments.unshift(ct([t])),!o&&(o=a)}else a.type===15?(Ga(t,a)||a.properties.unshift(t),o=a):(o=Oe(n.helper(ll),[ct([t]),a]),s&&s.callee===yn&&(s=r[r.length-2]));l.type===13?s?s.arguments[0]=o:l.props=o:s?s.arguments[0]=o:l.arguments[2]=o}function Ga(l,t){let n=!1;if(l.key.type===4){const o=l.key.content;n=t.properties.some(a=>a.key.type===4&&a.key.content===o)}return n}function xn(l,t){return`_${t}_${l.replace(/[^\w]/g,(n,o)=>n==="-"?"_":l.charCodeAt(o).toString())}`}function nk(l){return l.type===14&&l.callee===ho?l.arguments[1].returns:l}const lk=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,Wa={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:el,isPreTag:el,isIgnoreNewlineTag:el,isCustomElement:el,onError:ko,onWarn:Pa,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let Ce=Wa,wn=null,Et="",Ze=null,we=null,nt="",Ct=-1,zt=-1,wo=0,Dt=!1,Eo=null;const Te=[],Me=new q1(Te,{onerr:lt,ontext(l,t){dl(Ge(l,t),l,t)},ontextentity(l,t,n){dl(l,t,n)},oninterpolation(l,t){if(Dt)return dl(Ge(l,t),l,t);let n=l+Me.delimiterOpen.length,o=t-Me.delimiterClose.length;for(;rt(Et.charCodeAt(n));)n++;for(;rt(Et.charCodeAt(o-1));)o--;let a=Ge(n,o);a.includes("&")&&(a=Ce.decodeEntities(a,!1)),Co({type:5,content:pl(a,!1,Ie(n,o)),loc:Ie(l,t)})},onopentagname(l,t){const n=Ge(l,t);Ze={type:1,tag:n,ns:Ce.getNamespace(n,Te[0],Ce.ns),tagType:0,props:[],children:[],loc:Ie(l-1,t),codegenNode:void 0}},onopentagend(l){Ya(l)},onclosetag(l,t){const n=Ge(l,t);if(!Ce.isVoidTag(n)){let o=!1;for(let a=0;a<Te.length;a++)if(Te[a].tag.toLowerCase()===n.toLowerCase()){o=!0,a>0&&lt(24,Te[0].loc.start.offset);for(let s=0;s<=a;s++){const i=Te.shift();ul(i,t,s<a)}break}o||lt(23,Za(l,60))}},onselfclosingtag(l){const t=Ze.tag;Ze.isSelfClosing=!0,Ya(l),Te[0]&&Te[0].tag===t&&ul(Te.shift(),l)},onattribname(l,t){we={type:6,name:Ge(l,t),nameLoc:Ie(l,t),value:void 0,loc:Ie(l)}},ondirname(l,t){const n=Ge(l,t),o=n==="."||n===":"?"bind":n==="@"?"on":n==="#"?"slot":n.slice(2);if(!Dt&&o===""&&lt(26,l),Dt||o==="")we={type:6,name:n,nameLoc:Ie(l,t),value:void 0,loc:Ie(l)};else if(we={type:7,name:o,rawName:n,exp:void 0,arg:void 0,modifiers:n==="."?[ye("prop")]:[],loc:Ie(l)},o==="pre"){Dt=Me.inVPre=!0,Eo=Ze;const a=Ze.props;for(let r=0;r<a.length;r++)a[r].type===7&&(a[r]=fk(a[r]))}},ondirarg(l,t){if(l===t)return;const n=Ge(l,t);if(Dt&&!Ha(we))we.name+=n,jt(we.nameLoc,t);else{const o=n[0]!=="[";we.arg=pl(o?n:n.slice(1,-1),o,Ie(l,t),o?3:0)}},ondirmodifier(l,t){const n=Ge(l,t);if(Dt&&!Ha(we))we.name+="."+n,jt(we.nameLoc,t);else if(we.name==="slot"){const o=we.arg;o&&(o.content+="."+n,jt(o.loc,t))}else{const o=ye(n,!0,Ie(l,t));we.modifiers.push(o)}},onattribdata(l,t){nt+=Ge(l,t),Ct<0&&(Ct=l),zt=t},onattribentity(l,t,n){nt+=l,Ct<0&&(Ct=t),zt=n},onattribnameend(l){const t=we.loc.start.offset,n=Ge(t,l);we.type===7&&(we.rawName=n),Ze.props.some(o=>(o.type===7?o.rawName:o.name)===n)&&lt(2,t)},onattribend(l,t){if(Ze&&we){if(jt(we.loc,t),l!==0)if(nt.includes("&")&&(nt=Ce.decodeEntities(nt,!0)),we.type===6)we.name==="class"&&(nt=Qa(nt).trim()),l===1&&!nt&&lt(13,t),we.value={type:2,content:nt,loc:l===1?Ie(Ct,zt):Ie(Ct-1,zt+1)},Me.inSFCRoot&&Ze.tag==="template"&&we.name==="lang"&&nt&&nt!=="html"&&Me.enterRCDATA(al("</template"),0);else{let n=0;we.exp=pl(nt,!1,Ie(Ct,zt),0,n),we.name==="for"&&(we.forParseResult=ak(we.exp));let o=-1;we.name==="bind"&&(o=we.modifiers.findIndex(a=>a.content==="sync"))>-1&&tn("COMPILER_V_BIND_SYNC",Ce,we.loc,we.arg.loc.source)&&(we.name="model",we.modifiers.splice(o,1))}(we.type!==7||we.name!=="pre")&&Ze.props.push(we)}nt="",Ct=zt=-1},oncomment(l,t){Ce.comments&&Co({type:3,content:Ge(l,t),loc:Ie(l-4,t+3)})},onend(){const l=Et.length;if(process.env.NODE_ENV!=="production"&&Me.state!==1)switch(Me.state){case 5:case 8:lt(5,l);break;case 3:case 4:lt(25,Me.sectionStart);break;case 28:Me.currentSequence===qe.CdataEnd?lt(6,l):lt(7,l);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:lt(9,l);break}for(let t=0;t<Te.length;t++)ul(Te[t],l-1),lt(24,Te[t].loc.start.offset)},oncdata(l,t){Te[0].ns!==0?dl(Ge(l,t),l,t):lt(1,l-9)},onprocessinginstruction(l){(Te[0]?Te[0].ns:Ce.ns)===0&&lt(21,l-1)}}),Ka=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ok=/^\(|\)$/g;function ak(l){const t=l.loc,n=l.content,o=n.match(lk);if(!o)return;const[,a,r]=o,s=(p,g,y=!1)=>{const w=t.start.offset+g,m=w+p.length;return pl(p,!1,Ie(w,m),0,y?1:0)},i={source:s(r.trim(),n.indexOf(r,a.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=a.trim().replace(ok,"").trim();const d=a.indexOf(c),u=c.match(Ka);if(u){c=c.replace(Ka,"").trim();const p=u[1].trim();let g;if(p&&(g=n.indexOf(p,d+c.length),i.key=s(p,g,!0)),u[2]){const y=u[2].trim();y&&(i.index=s(y,n.indexOf(y,i.key?g+p.length:d+c.length),!0))}}return c&&(i.value=s(c,d,!0)),i}function Ge(l,t){return Et.slice(l,t)}function Ya(l){Me.inSFCRoot&&(Ze.innerLoc=Ie(l+1,l+1)),Co(Ze);const{tag:t,ns:n}=Ze;n===0&&Ce.isPreTag(t)&&wo++,Ce.isVoidTag(t)?ul(Ze,l):(Te.unshift(Ze),(n===1||n===2)&&(Me.inXML=!0)),Ze=null}function dl(l,t,n){{const r=Te[0]&&Te[0].tag;r!=="script"&&r!=="style"&&l.includes("&")&&(l=Ce.decodeEntities(l,!1))}const o=Te[0]||wn,a=o.children[o.children.length-1];a&&a.type===2?(a.content+=l,jt(a.loc,n)):o.children.push({type:2,content:l,loc:Ie(t,n)})}function ul(l,t,n=!1){n?jt(l.loc,Za(t,60)):jt(l.loc,rk(t,62)+1),Me.inSFCRoot&&(l.children.length?l.innerLoc.end=Nt({},l.children[l.children.length-1].loc.end):l.innerLoc.end=Nt({},l.innerLoc.start),l.innerLoc.source=Ge(l.innerLoc.start.offset,l.innerLoc.end.offset));const{tag:o,ns:a,children:r}=l;if(Dt||(o==="slot"?l.tagType=2:Ja(l)?l.tagType=3:ik(l)&&(l.tagType=1)),Me.inRCDATA||(l.children=Xa(r)),a===0&&Ce.isIgnoreNewlineTag(o)){const s=r[0];s&&s.type===2&&(s.content=s.content.replace(/^\r?\n/,""))}a===0&&Ce.isPreTag(o)&&wo--,Eo===l&&(Dt=Me.inVPre=!1,Eo=null),Me.inXML&&(Te[0]?Te[0].ns:Ce.ns)===0&&(Me.inXML=!1);{const s=l.props;if(process.env.NODE_ENV!=="production"&&Mt("COMPILER_V_IF_V_FOR_PRECEDENCE",Ce)){let c=!1,d=!1;for(let u=0;u<s.length;u++){const p=s[u];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){rl("COMPILER_V_IF_V_FOR_PRECEDENCE",Ce,l.loc);break}}}if(!Me.inSFCRoot&&Mt("COMPILER_NATIVE_TEMPLATE",Ce)&&l.tag==="template"&&!Ja(l)){process.env.NODE_ENV!=="production"&&rl("COMPILER_NATIVE_TEMPLATE",Ce,l.loc);const c=Te[0]||wn,d=c.children.indexOf(l);c.children.splice(d,1,...l.children)}const i=s.find(c=>c.type===6&&c.name==="inline-template");i&&tn("COMPILER_INLINE_TEMPLATE",Ce,i.loc)&&l.children.length&&(i.value={type:2,content:Ge(l.children[0].loc.start.offset,l.children[l.children.length-1].loc.end.offset),loc:i.loc})}}function rk(l,t){let n=l;for(;Et.charCodeAt(n)!==t&&n<Et.length-1;)n++;return n}function Za(l,t){let n=l;for(;Et.charCodeAt(n)!==t&&n>=0;)n--;return n}const sk=new Set(["if","else","else-if","for","slot"]);function Ja({tag:l,props:t}){if(l==="template"){for(let n=0;n<t.length;n++)if(t[n].type===7&&sk.has(t[n].name))return!0}return!1}function ik({tag:l,props:t}){if(Ce.isCustomElement(l))return!1;if(l==="component"||ck(l.charCodeAt(0))||Ra(l)||Ce.isBuiltInComponent&&Ce.isBuiltInComponent(l)||Ce.isNativeTag&&!Ce.isNativeTag(l))return!0;for(let n=0;n<t.length;n++){const o=t[n];if(o.type===6){if(o.name==="is"&&o.value){if(o.value.content.startsWith("vue:"))return!0;if(tn("COMPILER_IS_ON_ELEMENT",Ce,o.loc))return!0}}else if(o.name==="bind"&&At(o.arg,"is")&&tn("COMPILER_IS_ON_ELEMENT",Ce,o.loc))return!0}return!1}function ck(l){return l>64&&l<91}const dk=/\r\n/g;function Xa(l){const t=Ce.whitespace!=="preserve";let n=!1;for(let o=0;o<l.length;o++){const a=l[o];if(a.type===2)if(wo)a.content=a.content.replace(dk,`
155
- `);else if(uk(a.content)){const r=l[o-1]&&l[o-1].type,s=l[o+1]&&l[o+1].type;!r||!s||t&&(r===3&&(s===3||s===1)||r===1&&(s===3||s===1&&pk(a.content)))?(n=!0,l[o]=null):a.content=" "}else t&&(a.content=Qa(a.content))}return n?l.filter(Boolean):l}function uk(l){for(let t=0;t<l.length;t++)if(!rt(l.charCodeAt(t)))return!1;return!0}function pk(l){for(let t=0;t<l.length;t++){const n=l.charCodeAt(t);if(n===10||n===13)return!0}return!1}function Qa(l){let t="",n=!1;for(let o=0;o<l.length;o++)rt(l.charCodeAt(o))?n||(t+=" ",n=!0):(t+=l[o],n=!1);return t}function Co(l){(Te[0]||wn).children.push(l)}function Ie(l,t){return{start:Me.getPos(l),end:t==null?t:Me.getPos(t),source:t==null?t:Ge(l,t)}}function mk(l){return Ie(l.start.offset,l.end.offset)}function jt(l,t){l.end=Me.getPos(t),l.source=Ge(l.start.offset,t)}function fk(l){const t={type:6,name:l.rawName,nameLoc:Ie(l.loc.start.offset,l.loc.start.offset+l.rawName.length),value:void 0,loc:l.loc};if(l.exp){const n=l.exp.loc;n.end.offset<l.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:l.exp.content,loc:n}}return t}function pl(l,t=!1,n,o=0,a=0){return ye(l,t,n,o)}function lt(l,t,n){Ce.onError(Se(l,Ie(t,t),void 0,n))}function hk(){Me.reset(),Ze=null,we=null,nt="",Ct=-1,zt=-1,Te.length=0}function vk(l,t){if(hk(),Et=l,Ce=Nt({},Wa),t){let a;for(a in t)t[a]!=null&&(Ce[a]=t[a])}if(process.env.NODE_ENV!=="production"&&!Ce.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");Me.mode=Ce.parseMode==="html"?1:Ce.parseMode==="sfc"?2:0,Me.inXML=Ce.ns===1||Ce.ns===2;const n=t&&t.delimiters;n&&(Me.delimiterOpen=al(n[0]),Me.delimiterClose=al(n[1]));const o=wn=j1([],l);return Me.parse(Et),o.loc=Ie(0,l.length),o.children=Xa(o.children),wn=null,o}function gk(l,t){ml(l,void 0,t,!!Va(l))}function Va(l){const t=l.children.filter(n=>n.type!==3);return t.length===1&&t[0].type===1&&!il(t[0])?t[0]:null}function ml(l,t,n,o=!1,a=!1){const{children:r}=l,s=[];for(let p=0;p<r.length;p++){const g=r[p];if(g.type===1&&g.tagType===0){const y=o?0:st(g,n);if(y>0){if(y>=2){g.codegenNode.patchFlag=-1,s.push(g);continue}}else{const w=g.codegenNode;if(w.type===13){const m=w.patchFlag;if((m===void 0||m===512||m===1)&&tr(g,n)>=2){const f=nr(g);f&&(w.props=n.hoist(f))}w.dynamicProps&&(w.dynamicProps=n.hoist(w.dynamicProps))}}}else if(g.type===12&&(o?0:st(g,n))>=2){g.codegenNode.type===14&&g.codegenNode.arguments.length>0&&g.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${mn[-1]} */`:"")),s.push(g);continue}if(g.type===1){const y=g.tagType===1;y&&n.scopes.vSlot++,ml(g,l,n,!1,a),y&&n.scopes.vSlot--}else if(g.type===11)ml(g,l,n,g.children.length===1,!0);else if(g.type===9)for(let y=0;y<g.branches.length;y++)ml(g.branches[y],l,n,g.branches[y].children.length===1,a)}let i=!1;const c=[];if(s.length===r.length&&l.type===1){if(l.tagType===0&&l.codegenNode&&l.codegenNode.type===13&&yt(l.codegenNode.children))l.codegenNode.children=d(Rt(l.codegenNode.children)),i=!0;else if(l.tagType===1&&l.codegenNode&&l.codegenNode.type===13&&l.codegenNode.children&&!yt(l.codegenNode.children)&&l.codegenNode.children.type===15){const p=u(l.codegenNode,"default");p&&(c.push(n.cached.length),p.returns=d(Rt(p.returns)),i=!0)}else if(l.tagType===3&&t&&t.type===1&&t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!yt(t.codegenNode.children)&&t.codegenNode.children.type===15){const p=tt(l,"slot",!0),g=p&&p.arg&&u(t.codegenNode,p.arg);g&&(c.push(n.cached.length),g.returns=d(Rt(g.returns)),i=!0)}}if(!i)for(const p of s)c.push(n.cached.length),p.codegenNode=n.cache(p.codegenNode);c.length&&l.type===1&&l.tagType===1&&l.codegenNode&&l.codegenNode.type===13&&l.codegenNode.children&&!yt(l.codegenNode.children)&&l.codegenNode.children.type===15&&l.codegenNode.children.properties.push($e("__",ye(JSON.stringify(c),!1)));function d(p){const g=n.cache(p);return a&&n.hmr&&(g.needArraySpread=!0),g}function u(p,g){if(p.children&&!yt(p.children)&&p.children.type===15){const y=p.children.properties.find(w=>w.key===g||w.key.content===g);return y&&y.value}}s.length&&n.transformHoist&&n.transformHoist(r,n,l)}function st(l,t){const{constantCache:n}=t;switch(l.type){case 1:if(l.tagType!==0)return 0;const o=n.get(l);if(o!==void 0)return o;const a=l.codegenNode;if(a.type!==13||a.isBlock&&l.tag!=="svg"&&l.tag!=="foreignObject"&&l.tag!=="math")return 0;if(a.patchFlag===void 0){let s=3;const i=tr(l,t);if(i===0)return n.set(l,0),0;i<s&&(s=i);for(let c=0;c<l.children.length;c++){const d=st(l.children[c],t);if(d===0)return n.set(l,0),0;d<s&&(s=d)}if(s>1)for(let c=0;c<l.props.length;c++){const d=l.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const u=st(d.exp,t);if(u===0)return n.set(l,0),0;u<s&&(s=u)}}if(a.isBlock){for(let c=0;c<l.props.length;c++)if(l.props[c].type===7)return n.set(l,0),0;t.removeHelper(Pt),t.removeHelper(en(t.inSSR,a.isComponent)),a.isBlock=!1,t.helper(Vt(t.inSSR,a.isComponent))}return n.set(l,s),s}else return n.set(l,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return st(l.content,t);case 4:return l.constType;case 8:let r=3;for(let s=0;s<l.children.length;s++){const i=l.children[s];if(Pe(i)||Zl(i))continue;const c=st(i,t);if(c===0)return 0;c<r&&(r=c)}return r;case 20:return 2;default:return process.env.NODE_ENV,0}}const yk=new Set([io,co,gn,yn]);function er(l,t){if(l.type===14&&!Pe(l.callee)&&yk.has(l.callee)){const n=l.arguments[0];if(n.type===4)return st(n,t);if(n.type===14)return er(n,t)}return 0}function tr(l,t){let n=3;const o=nr(l);if(o&&o.type===15){const{properties:a}=o;for(let r=0;r<a.length;r++){const{key:s,value:i}=a[r],c=st(s,t);if(c===0)return c;c<n&&(n=c);let d;if(i.type===4?d=st(i,t):i.type===14?d=er(i,t):d=0,d===0)return d;d<n&&(n=d)}}return n}function nr(l){const t=l.codegenNode;if(t.type===13)return t.props}function kk(l,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:o=!1,hmr:a=!1,cacheHandlers:r=!1,nodeTransforms:s=[],directiveTransforms:i={},transformHoist:c=null,isBuiltInComponent:d=Kl,isCustomElement:u=Kl,expressionPlugins:p=[],scopeId:g=null,slotted:y=!0,ssr:w=!1,inSSR:m=!1,ssrCssVars:f="",bindingMetadata:E=g1,inline:C=!1,isTS:_=!1,onError:b=ko,onWarn:x=Pa,compatConfig:D}){const S=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),M={filename:t,selfName:S&&Xl(Bt(S[1])),prefixIdentifiers:n,hoistStatic:o,hmr:a,cacheHandlers:r,nodeTransforms:s,directiveTransforms:i,transformHoist:c,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:p,scopeId:g,slotted:y,ssr:w,inSSR:m,ssrCssVars:f,bindingMetadata:E,inline:C,isTS:_,onError:b,onWarn:x,compatConfig:D,root:l,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:l,childIndex:0,inVOnce:!1,helper(O){const K=M.helpers.get(O)||0;return M.helpers.set(O,K+1),O},removeHelper(O){const K=M.helpers.get(O);if(K){const U=K-1;U?M.helpers.set(O,U):M.helpers.delete(O)}},helperString(O){return`_${Xt[M.helper(O)]}`},replaceNode(O){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=O},removeNode(O){if(process.env.NODE_ENV!=="production"&&!M.parent)throw new Error("Cannot remove root node.");const K=M.parent.children,U=O?K.indexOf(O):M.currentNode?M.childIndex:-1;if(process.env.NODE_ENV!=="production"&&U<0)throw new Error("node being removed is not a child of current parent");!O||O===M.currentNode?(M.currentNode=null,M.onNodeRemoved()):M.childIndex>U&&(M.childIndex--,M.onNodeRemoved()),M.parent.children.splice(U,1)},onNodeRemoved:Kl,addIdentifiers(O){},removeIdentifiers(O){},hoist(O){Pe(O)&&(O=ye(O)),M.hoists.push(O);const K=ye(`_hoisted_${M.hoists.length}`,!1,O.loc,2);return K.hoisted=O,K},cache(O,K=!1,U=!1){const R=U1(M.cached.length,O,K,U);return M.cached.push(R),R}};return M.filters=new Set,M}function bk(l,t){const n=kk(l,t);fl(l,n),t.hoistStatic&&gk(l,n),t.ssr||xk(l,n),l.helpers=new Set([...n.helpers.keys()]),l.components=[...n.components],l.directives=[...n.directives],l.imports=n.imports,l.hoists=n.hoists,l.temps=n.temps,l.cached=n.cached,l.transformed=!0,l.filters=[...n.filters]}function xk(l,t){const{helper:n}=t,{children:o}=l;if(o.length===1){const a=Va(l);if(a&&a.codegenNode){const r=a.codegenNode;r.type===13&&go(r,t),l.codegenNode=r}else l.codegenNode=o[0]}else if(o.length>1){let a=64;process.env.NODE_ENV!=="production"&&o.filter(r=>r.type!==3).length===1&&(a|=2048),l.codegenNode=kn(t,n(fn),void 0,l.children,a,void 0,void 0,!0,void 0,!1)}}function wk(l,t){let n=0;const o=()=>{n--};for(;n<l.children.length;n++){const a=l.children[n];Pe(a)||(t.grandParent=t.parent,t.parent=l,t.childIndex=n,t.onNodeRemoved=o,fl(a,t))}}function fl(l,t){t.currentNode=l;const{nodeTransforms:n}=t,o=[];for(let r=0;r<n.length;r++){const s=n[r](l,t);if(s&&(yt(s)?o.push(...s):o.push(s)),t.currentNode)l=t.currentNode;else return}switch(l.type){case 3:t.ssr||t.helper(vn);break;case 5:t.ssr||t.helper(nl);break;case 9:for(let r=0;r<l.branches.length;r++)fl(l.branches[r],t);break;case 10:case 11:case 1:case 0:wk(l,t);break}t.currentNode=l;let a=o.length;for(;a--;)o[a]()}function lr(l,t){const n=Pe(l)?o=>o===l:o=>l.test(o);return(o,a)=>{if(o.type===1){const{props:r}=o;if(o.tagType===3&&r.some(ek))return;const s=[];for(let i=0;i<r.length;i++){const c=r[i];if(c.type===7&&n(c.name)){r.splice(i,1),i--;const d=t(o,c,a);d&&s.push(d)}}return s}}}const hl="/*@__PURE__*/",or=l=>`${Xt[l]}: _${Xt[l]}`;function Ek(l,{mode:t="function",prefixIdentifiers:n=t==="module",sourceMap:o=!1,filename:a="template.vue.html",scopeId:r=null,optimizeImports:s=!1,runtimeGlobalName:i="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:g=!1}){const y={mode:t,prefixIdentifiers:n,sourceMap:o,filename:a,scopeId:r,optimizeImports:s,runtimeGlobalName:i,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:u,isTS:p,inSSR:g,source:l.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(m){return`_${Xt[m]}`},push(m,f=-2,E){y.code+=m},indent(){w(++y.indentLevel)},deindent(m=!1){m?--y.indentLevel:w(--y.indentLevel)},newline(){w(y.indentLevel)}};function w(m){y.push(`
156
- `+" ".repeat(m),0)}return y}function Ck(l,t={}){const n=Ek(l,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:a,prefixIdentifiers:r,indent:s,deindent:i,newline:c,scopeId:d,ssr:u}=n,p=Array.from(l.helpers),g=p.length>0,y=!r&&o!=="module";_k(l,n);const m=u?"ssrRender":"render",E=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(a(`function ${m}(${E}) {`),s(),y&&(a("with (_ctx) {"),s(),g&&(a(`const { ${p.map(or).join(", ")} } = _Vue
152
+ **/const fn=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),hn=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Ql=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),tl=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),Ma=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),Pt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),Aa=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),Da=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Vl=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),vn=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),Ta=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),lo=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),ao=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),so=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),La=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),$a=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),nl=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),ll=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),io=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),co=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),gn=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),yn=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),uo=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),po=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),O1=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),mo=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),ol=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),P1=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),R1=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),z1=Symbol(process.env.NODE_ENV!=="production"?"unref":""),j1=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),ho=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),Ia=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Xt={[fn]:"Fragment",[hn]:"Teleport",[Ql]:"Suspense",[tl]:"KeepAlive",[Ma]:"BaseTransition",[Pt]:"openBlock",[Aa]:"createBlock",[Da]:"createElementBlock",[Vl]:"createVNode",[eo]:"createElementVNode",[vn]:"createCommentVNode",[to]:"createTextVNode",[Ta]:"createStaticVNode",[no]:"resolveComponent",[lo]:"resolveDynamicComponent",[oo]:"resolveDirective",[ao]:"resolveFilter",[ro]:"withDirectives",[so]:"renderList",[La]:"renderSlot",[$a]:"createSlots",[nl]:"toDisplayString",[ll]:"mergeProps",[io]:"normalizeClass",[co]:"normalizeStyle",[gn]:"normalizeProps",[yn]:"guardReactiveProps",[uo]:"toHandlers",[po]:"camelize",[O1]:"capitalize",[mo]:"toHandlerKey",[ol]:"setBlockTracking",[P1]:"pushScopeId",[R1]:"popScopeId",[fo]:"withCtx",[z1]:"unref",[j1]:"isRef",[ho]:"withMemo",[Ia]:"isMemoSame"};function U1(l){Object.getOwnPropertySymbols(l).forEach(t=>{Xt[t]=l[t]})}const at={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function H1(l,t=""){return{type:0,source:t,children:l,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:at}}function kn(l,t,n,o,a,r,s,i=!1,c=!1,d=!1,u=at){return l&&(i?(l.helper(Pt),l.helper(en(l.inSSR,d))):l.helper(Vt(l.inSSR,d)),s&&l.helper(ro)),{type:13,tag:t,props:n,children:o,patchFlag:a,dynamicProps:r,directives:s,isBlock:i,disableTracking:c,isComponent:d,loc:u}}function Rt(l,t=at){return{type:17,loc:t,elements:l}}function ct(l,t=at){return{type:15,loc:t,properties:l}}function $e(l,t){return{type:16,loc:at,key:Pe(l)?ye(l,!0):l,value:t}}function ye(l,t=!1,n=at,o=0){return{type:4,loc:n,content:l,isStatic:t,constType:t?3:o}}function mt(l,t=at){return{type:8,loc:t,children:l}}function Oe(l,t=[],n=at){return{type:14,loc:n,callee:l,arguments:t}}function Qt(l,t=void 0,n=!1,o=!1,a=at){return{type:18,params:l,returns:t,newline:n,isSlot:o,loc:a}}function vo(l,t,n,o=!0){return{type:19,test:l,consequent:t,alternate:n,newline:o,loc:at}}function q1(l,t,n=!1,o=!1){return{type:20,index:l,value:t,needPauseTracking:n,inVOnce:o,needArraySpread:!1,loc:at}}function W1(l){return{type:21,body:l,loc:at}}function Vt(l,t){return l||t?Vl:eo}function en(l,t){return l||t?Aa:Da}function go(l,{helper:t,removeHelper:n,inSSR:o}){l.isBlock||(l.isBlock=!0,n(Vt(o,l.isComponent)),t(Pt),t(en(o,l.isComponent)))}const Fa=new Uint8Array([123,123]),Oa=new Uint8Array([125,125]);function Pa(l){return l>=97&&l<=122||l>=65&&l<=90}function rt(l){return l===32||l===10||l===9||l===12||l===13}function St(l){return l===47||l===62||rt(l)}function al(l){const t=new Uint8Array(l.length);for(let n=0;n<l.length;n++)t[n]=l.charCodeAt(n);return t}const qe={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 G1{constructor(t,n){this.stack=t,this.cbs=n,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=Fa,this.delimiterClose=Oa,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=Fa,this.delimiterClose=Oa}getPos(t){let n=1,o=t+1;for(let a=this.newlines.length-1;a>=0;a--){const r=this.newlines[a];if(t>r){n=a+2,o=t-r;break}}return{column:o,line:n,offset:t}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(t){t===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t))}stateInterpolationOpen(t){if(t===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(t)):(this.state=1,this.stateText(t))}stateInterpolation(t){t===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(t))}stateInterpolationClose(t){t===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(t))}stateSpecialStartSequence(t){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?St(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(t)}stateInRCDATA(t){if(this.sequenceIndex===this.currentSequence.length){if(t===62||rt(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const o=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=o}this.sectionStart=n+2,this.stateInClosingTagName(t),this.inRCDATA=!1;return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===qe.TitleEnd||this.currentSequence===qe.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===60)}stateCDATASequence(t){t===qe.Cdata[this.sequenceIndex]?++this.sequenceIndex===qe.Cdata.length&&(this.state=28,this.currentSequence=qe.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length;){const n=this.buffer.charCodeAt(this.index);if(n===10&&this.newlines.push(this.index),n===t)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===qe.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):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(t,n){this.enterRCDATA(t,n),this.state=31}enterRCDATA(t,n){this.inRCDATA=!0,this.currentSequence=t,this.sequenceIndex=n}stateBeforeTagName(t){t===33?(this.state=22,this.sectionStart=this.index+1):t===63?(this.state=24,this.sectionStart=this.index+1):Pa(t)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:t===116?this.state=30:this.state=t===115?29:6):t===47?this.state=8:(this.state=1,this.stateText(t))}stateInTagName(t){St(t)&&this.handleTagName(t)}stateInSFCRootTagName(t){if(St(t)){const n=this.buffer.slice(this.sectionStart,this.index);n!=="template"&&this.enterRCDATA(al("</"+n),0),this.handleTagName(t)}}handleTagName(t){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(t)}stateBeforeClosingTagName(t){rt(t)||(t===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=Pa(t)?9:27,this.sectionStart=this.index))}stateInClosingTagName(t){(t===62||rt(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){t===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(t){t===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):t===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):t===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):rt(t)||(process.env.NODE_ENV!=="production"&&t===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(t))}handleAttrStart(t){t===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):t===46||t===58||t===64||t===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(t){t===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):rt(t)||(this.state=11,this.stateBeforeAttrName(t))}stateInAttrName(t){t===61||St(t)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(t)):process.env.NODE_ENV!=="production"&&(t===34||t===39||t===60)&&this.cbs.onerr(17,this.index)}stateInDirName(t){t===61||St(t)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):t===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(t){t===61||St(t)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===91?this.state=15:t===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(t){t===93?this.state=14:(t===61||St(t))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(t),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(t){t===61||St(t)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(t)):t===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(t){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(t)}stateAfterAttrName(t){t===61?this.state=18:t===47||t===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(t)):rt(t)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(t))}stateBeforeAttrValue(t){t===34?(this.state=19,this.sectionStart=this.index+1):t===39?(this.state=20,this.sectionStart=this.index+1):rt(t)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(t))}handleInAttrValue(t,n){(t===n||this.fastForwardTo(n))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(t){this.handleInAttrValue(t,34)}stateInAttrValueSingleQuotes(t){this.handleInAttrValue(t,39)}stateInAttrValueNoQuotes(t){rt(t)||t===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(t)):(process.env.NODE_ENV!=="production"&&t===34||t===39||t===60||t===61||t===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(t){t===91?(this.state=26,this.sequenceIndex=0):this.state=t===45?25:23}stateInDeclaration(t){(t===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(t){t===45?(this.state=28,this.currentSequence=qe.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(t){(t===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){t===qe.ScriptEnd[3]?this.startSpecial(qe.ScriptEnd,4):t===qe.StyleEnd[3]?this.startSpecial(qe.StyleEnd,4):(this.state=6,this.stateInTagName(t))}stateBeforeSpecialT(t){t===qe.TitleEnd[3]?this.startSpecial(qe.TitleEnd,4):t===qe.TextareaEnd[3]?this.startSpecial(qe.TextareaEnd,4):(this.state=6,this.stateInTagName(t))}startEntity(){}stateInEntity(){}parse(t){for(this.buffer=t;this.index<this.buffer.length;){const n=this.buffer.charCodeAt(this.index);switch(n===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(n);break}case 2:{this.stateInterpolationOpen(n);break}case 3:{this.stateInterpolation(n);break}case 4:{this.stateInterpolationClose(n);break}case 31:{this.stateSpecialStartSequence(n);break}case 32:{this.stateInRCDATA(n);break}case 26:{this.stateCDATASequence(n);break}case 19:{this.stateInAttrValueDoubleQuotes(n);break}case 12:{this.stateInAttrName(n);break}case 13:{this.stateInDirName(n);break}case 14:{this.stateInDirArg(n);break}case 15:{this.stateInDynamicDirArg(n);break}case 16:{this.stateInDirModifier(n);break}case 28:{this.stateInCommentLike(n);break}case 27:{this.stateInSpecialComment(n);break}case 11:{this.stateBeforeAttrName(n);break}case 6:{this.stateInTagName(n);break}case 34:{this.stateInSFCRootTagName(n);break}case 9:{this.stateInClosingTagName(n);break}case 5:{this.stateBeforeTagName(n);break}case 17:{this.stateAfterAttrName(n);break}case 20:{this.stateInAttrValueSingleQuotes(n);break}case 18:{this.stateBeforeAttrValue(n);break}case 8:{this.stateBeforeClosingTagName(n);break}case 10:{this.stateAfterClosingTagName(n);break}case 29:{this.stateBeforeSpecialS(n);break}case 30:{this.stateBeforeSpecialT(n);break}case 21:{this.stateInAttrValueNoQuotes(n);break}case 7:{this.stateInSelfClosingTag(n);break}case 23:{this.stateInDeclaration(n);break}case 22:{this.stateBeforeDeclaration(n);break}case 25:{this.stateBeforeComment(n);break}case 24:{this.stateInProcessingInstruction(n);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 t=this.buffer.length;this.sectionStart>=t||(this.state===28?this.currentSequence===qe.CdataEnd?this.cbs.oncdata(this.sectionStart,t):this.cbs.oncomment(this.sectionStart,t):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,t))}emitCodePoint(t,n){}}const K1={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:l=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${l}.sync\` should be changed to \`v-model:${l}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(l,{compatConfig:t}){const n=t&&t[l];return l==="MODE"?n||3:n}function Mt(l,t){const n=yo("MODE",t),o=yo(l,t);return n===3?o===!0:o!==!1}function tn(l,t,n,...o){const a=Mt(l,t);return process.env.NODE_ENV!=="production"&&a&&rl(l,t,n,...o),a}function rl(l,t,n,...o){if(yo(l,t)==="suppress-warning")return;const{message:r,link:s}=K1[l],i=`(deprecation ${l}) ${typeof r=="function"?r(...o):r}${s?`
153
+ Details: ${s}`:""}`,c=new SyntaxError(i);c.code=l,n&&(c.loc=n),t.onWarn(c)}function ko(l){throw l}function Ra(l){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${l.message}`)}function Se(l,t,n,o){const a=process.env.NODE_ENV!=="production"?(n||Y1)[l]+(o||""):`https://vuejs.org/error-reference/#compiler-${l}`,r=new SyntaxError(String(a));return r.code=l,r.loc=t,r}const Y1={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.",52:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
154
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"Error parsing JavaScript expression: ",46:"<KeepAlive> expects exactly one child component.",51:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",47:'"prefixIdentifiers" option is not supported in this build of compiler.',48:"ES module mode is not supported in this build of compiler.",49:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',50:'"scopeId" option is only supported in module mode.',53:""},et=l=>l.type===4&&l.isStatic;function za(l){switch(l){case"Teleport":case"teleport":return hn;case"Suspense":case"suspense":return Ql;case"KeepAlive":case"keep-alive":return tl;case"BaseTransition":case"base-transition":return Ma}}const Z1=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=l=>!Z1.test(l),J1=/[A-Za-z_$\xA0-\uFFFF]/,X1=/[\.\?\w$\xA0-\uFFFF]/,Q1=/\s+[.[]\s*|\s*[.[]\s+/g,ja=l=>l.type===4?l.content:l.loc.source,Ua=l=>{const t=ja(l).trim().replace(Q1,i=>i.trim());let n=0,o=[],a=0,r=0,s=null;for(let i=0;i<t.length;i++){const c=t.charAt(i);switch(n){case 0:if(c==="[")o.push(n),n=1,a++;else if(c==="(")o.push(n),n=2,r++;else if(!(i===0?J1:X1).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(o.push(n),n=3,s=c):c==="["?a++:c==="]"&&(--a||(n=o.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")o.push(n),n=3,s=c;else if(c==="(")r++;else if(c===")"){if(i===t.length-1)return!1;--r||(n=o.pop())}break;case 3:c===s&&(n=o.pop(),s=null);break}}return!a&&!r},V1=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,ek=l=>V1.test(ja(l));function Ha(l,t){if(!l)throw new Error(t||"unexpected compiler condition")}function tt(l,t,n=!1){for(let o=0;o<l.props.length;o++){const a=l.props[o];if(a.type===7&&(n||a.exp)&&(Pe(t)?a.name===t:t.test(a.name)))return a}}function bn(l,t,n=!1,o=!1){for(let a=0;a<l.props.length;a++){const r=l.props[a];if(r.type===6){if(n)continue;if(r.name===t&&(r.value||o))return r}else if(r.name==="bind"&&(r.exp||o)&&At(r.arg,t))return r}}function At(l,t){return!!(l&&et(l)&&l.content===t)}function tk(l){return l.props.some(t=>t.type===7&&t.name==="bind"&&(!t.arg||t.arg.type!==4||!t.arg.isStatic))}function xo(l){return l.type===5||l.type===2}function qa(l){return l.type===7&&l.name==="pre"}function nk(l){return l.type===7&&l.name==="slot"}function sl(l){return l.type===1&&l.tagType===3}function il(l){return l.type===1&&l.tagType===2}const lk=new Set([gn,yn]);function Wa(l,t=[]){if(l&&!Pe(l)&&l.type===14){const n=l.callee;if(!Pe(n)&&lk.has(n))return Wa(l.arguments[0],t.concat(l))}return[l,t]}function cl(l,t,n){let o,a=l.type===13?l.props:l.arguments[2],r=[],s;if(a&&!Pe(a)&&a.type===14){const i=Wa(a);a=i[0],r=i[1],s=r[r.length-1]}if(a==null||Pe(a))o=ct([t]);else if(a.type===14){const i=a.arguments[0];!Pe(i)&&i.type===15?Ga(t,i)||i.properties.unshift(t):a.callee===uo?o=Oe(n.helper(ll),[ct([t]),a]):a.arguments.unshift(ct([t])),!o&&(o=a)}else a.type===15?(Ga(t,a)||a.properties.unshift(t),o=a):(o=Oe(n.helper(ll),[ct([t]),a]),s&&s.callee===yn&&(s=r[r.length-2]));l.type===13?s?s.arguments[0]=o:l.props=o:s?s.arguments[0]=o:l.arguments[2]=o}function Ga(l,t){let n=!1;if(l.key.type===4){const o=l.key.content;n=t.properties.some(a=>a.key.type===4&&a.key.content===o)}return n}function xn(l,t){return`_${t}_${l.replace(/[^\w]/g,(n,o)=>n==="-"?"_":l.charCodeAt(o).toString())}`}function ok(l){return l.type===14&&l.callee===ho?l.arguments[1].returns:l}const ak=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,Ka={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:el,isPreTag:el,isIgnoreNewlineTag:el,isCustomElement:el,onError:ko,onWarn:Ra,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let Ce=Ka,wn=null,Et="",Ze=null,we=null,nt="",Ct=-1,zt=-1,wo=0,Dt=!1,Eo=null;const Te=[],Me=new G1(Te,{onerr:lt,ontext(l,t){dl(We(l,t),l,t)},ontextentity(l,t,n){dl(l,t,n)},oninterpolation(l,t){if(Dt)return dl(We(l,t),l,t);let n=l+Me.delimiterOpen.length,o=t-Me.delimiterClose.length;for(;rt(Et.charCodeAt(n));)n++;for(;rt(Et.charCodeAt(o-1));)o--;let a=We(n,o);a.includes("&")&&(a=Ce.decodeEntities(a,!1)),Co({type:5,content:pl(a,!1,Ie(n,o)),loc:Ie(l,t)})},onopentagname(l,t){const n=We(l,t);Ze={type:1,tag:n,ns:Ce.getNamespace(n,Te[0],Ce.ns),tagType:0,props:[],children:[],loc:Ie(l-1,t),codegenNode:void 0}},onopentagend(l){Za(l)},onclosetag(l,t){const n=We(l,t);if(!Ce.isVoidTag(n)){let o=!1;for(let a=0;a<Te.length;a++)if(Te[a].tag.toLowerCase()===n.toLowerCase()){o=!0,a>0&&lt(24,Te[0].loc.start.offset);for(let s=0;s<=a;s++){const i=Te.shift();ul(i,t,s<a)}break}o||lt(23,Ja(l,60))}},onselfclosingtag(l){const t=Ze.tag;Ze.isSelfClosing=!0,Za(l),Te[0]&&Te[0].tag===t&&ul(Te.shift(),l)},onattribname(l,t){we={type:6,name:We(l,t),nameLoc:Ie(l,t),value:void 0,loc:Ie(l)}},ondirname(l,t){const n=We(l,t),o=n==="."||n===":"?"bind":n==="@"?"on":n==="#"?"slot":n.slice(2);if(!Dt&&o===""&&lt(26,l),Dt||o==="")we={type:6,name:n,nameLoc:Ie(l,t),value:void 0,loc:Ie(l)};else if(we={type:7,name:o,rawName:n,exp:void 0,arg:void 0,modifiers:n==="."?[ye("prop")]:[],loc:Ie(l)},o==="pre"){Dt=Me.inVPre=!0,Eo=Ze;const a=Ze.props;for(let r=0;r<a.length;r++)a[r].type===7&&(a[r]=vk(a[r]))}},ondirarg(l,t){if(l===t)return;const n=We(l,t);if(Dt&&!qa(we))we.name+=n,jt(we.nameLoc,t);else{const o=n[0]!=="[";we.arg=pl(o?n:n.slice(1,-1),o,Ie(l,t),o?3:0)}},ondirmodifier(l,t){const n=We(l,t);if(Dt&&!qa(we))we.name+="."+n,jt(we.nameLoc,t);else if(we.name==="slot"){const o=we.arg;o&&(o.content+="."+n,jt(o.loc,t))}else{const o=ye(n,!0,Ie(l,t));we.modifiers.push(o)}},onattribdata(l,t){nt+=We(l,t),Ct<0&&(Ct=l),zt=t},onattribentity(l,t,n){nt+=l,Ct<0&&(Ct=t),zt=n},onattribnameend(l){const t=we.loc.start.offset,n=We(t,l);we.type===7&&(we.rawName=n),Ze.props.some(o=>(o.type===7?o.rawName:o.name)===n)&&lt(2,t)},onattribend(l,t){if(Ze&&we){if(jt(we.loc,t),l!==0)if(nt.includes("&")&&(nt=Ce.decodeEntities(nt,!0)),we.type===6)we.name==="class"&&(nt=Va(nt).trim()),l===1&&!nt&&lt(13,t),we.value={type:2,content:nt,loc:l===1?Ie(Ct,zt):Ie(Ct-1,zt+1)},Me.inSFCRoot&&Ze.tag==="template"&&we.name==="lang"&&nt&&nt!=="html"&&Me.enterRCDATA(al("</template"),0);else{let n=0;we.exp=pl(nt,!1,Ie(Ct,zt),0,n),we.name==="for"&&(we.forParseResult=sk(we.exp));let o=-1;we.name==="bind"&&(o=we.modifiers.findIndex(a=>a.content==="sync"))>-1&&tn("COMPILER_V_BIND_SYNC",Ce,we.loc,we.arg.loc.source)&&(we.name="model",we.modifiers.splice(o,1))}(we.type!==7||we.name!=="pre")&&Ze.props.push(we)}nt="",Ct=zt=-1},oncomment(l,t){Ce.comments&&Co({type:3,content:We(l,t),loc:Ie(l-4,t+3)})},onend(){const l=Et.length;if(process.env.NODE_ENV!=="production"&&Me.state!==1)switch(Me.state){case 5:case 8:lt(5,l);break;case 3:case 4:lt(25,Me.sectionStart);break;case 28:Me.currentSequence===qe.CdataEnd?lt(6,l):lt(7,l);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:lt(9,l);break}for(let t=0;t<Te.length;t++)ul(Te[t],l-1),lt(24,Te[t].loc.start.offset)},oncdata(l,t){Te[0].ns!==0?dl(We(l,t),l,t):lt(1,l-9)},onprocessinginstruction(l){(Te[0]?Te[0].ns:Ce.ns)===0&&lt(21,l-1)}}),Ya=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,rk=/^\(|\)$/g;function sk(l){const t=l.loc,n=l.content,o=n.match(ak);if(!o)return;const[,a,r]=o,s=(p,g,y=!1)=>{const w=t.start.offset+g,m=w+p.length;return pl(p,!1,Ie(w,m),0,y?1:0)},i={source:s(r.trim(),n.indexOf(r,a.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=a.trim().replace(rk,"").trim();const d=a.indexOf(c),u=c.match(Ya);if(u){c=c.replace(Ya,"").trim();const p=u[1].trim();let g;if(p&&(g=n.indexOf(p,d+c.length),i.key=s(p,g,!0)),u[2]){const y=u[2].trim();y&&(i.index=s(y,n.indexOf(y,i.key?g+p.length:d+c.length),!0))}}return c&&(i.value=s(c,d,!0)),i}function We(l,t){return Et.slice(l,t)}function Za(l){Me.inSFCRoot&&(Ze.innerLoc=Ie(l+1,l+1)),Co(Ze);const{tag:t,ns:n}=Ze;n===0&&Ce.isPreTag(t)&&wo++,Ce.isVoidTag(t)?ul(Ze,l):(Te.unshift(Ze),(n===1||n===2)&&(Me.inXML=!0)),Ze=null}function dl(l,t,n){{const r=Te[0]&&Te[0].tag;r!=="script"&&r!=="style"&&l.includes("&")&&(l=Ce.decodeEntities(l,!1))}const o=Te[0]||wn,a=o.children[o.children.length-1];a&&a.type===2?(a.content+=l,jt(a.loc,n)):o.children.push({type:2,content:l,loc:Ie(t,n)})}function ul(l,t,n=!1){n?jt(l.loc,Ja(t,60)):jt(l.loc,ik(t,62)+1),Me.inSFCRoot&&(l.children.length?l.innerLoc.end=Nt({},l.children[l.children.length-1].loc.end):l.innerLoc.end=Nt({},l.innerLoc.start),l.innerLoc.source=We(l.innerLoc.start.offset,l.innerLoc.end.offset));const{tag:o,ns:a,children:r}=l;if(Dt||(o==="slot"?l.tagType=2:Xa(l)?l.tagType=3:dk(l)&&(l.tagType=1)),Me.inRCDATA||(l.children=Qa(r)),a===0&&Ce.isIgnoreNewlineTag(o)){const s=r[0];s&&s.type===2&&(s.content=s.content.replace(/^\r?\n/,""))}a===0&&Ce.isPreTag(o)&&wo--,Eo===l&&(Dt=Me.inVPre=!1,Eo=null),Me.inXML&&(Te[0]?Te[0].ns:Ce.ns)===0&&(Me.inXML=!1);{const s=l.props;if(process.env.NODE_ENV!=="production"&&Mt("COMPILER_V_IF_V_FOR_PRECEDENCE",Ce)){let c=!1,d=!1;for(let u=0;u<s.length;u++){const p=s[u];if(p.type===7&&(p.name==="if"?c=!0:p.name==="for"&&(d=!0)),c&&d){rl("COMPILER_V_IF_V_FOR_PRECEDENCE",Ce,l.loc);break}}}if(!Me.inSFCRoot&&Mt("COMPILER_NATIVE_TEMPLATE",Ce)&&l.tag==="template"&&!Xa(l)){process.env.NODE_ENV!=="production"&&rl("COMPILER_NATIVE_TEMPLATE",Ce,l.loc);const c=Te[0]||wn,d=c.children.indexOf(l);c.children.splice(d,1,...l.children)}const i=s.find(c=>c.type===6&&c.name==="inline-template");i&&tn("COMPILER_INLINE_TEMPLATE",Ce,i.loc)&&l.children.length&&(i.value={type:2,content:We(l.children[0].loc.start.offset,l.children[l.children.length-1].loc.end.offset),loc:i.loc})}}function ik(l,t){let n=l;for(;Et.charCodeAt(n)!==t&&n<Et.length-1;)n++;return n}function Ja(l,t){let n=l;for(;Et.charCodeAt(n)!==t&&n>=0;)n--;return n}const ck=new Set(["if","else","else-if","for","slot"]);function Xa({tag:l,props:t}){if(l==="template"){for(let n=0;n<t.length;n++)if(t[n].type===7&&ck.has(t[n].name))return!0}return!1}function dk({tag:l,props:t}){if(Ce.isCustomElement(l))return!1;if(l==="component"||uk(l.charCodeAt(0))||za(l)||Ce.isBuiltInComponent&&Ce.isBuiltInComponent(l)||Ce.isNativeTag&&!Ce.isNativeTag(l))return!0;for(let n=0;n<t.length;n++){const o=t[n];if(o.type===6){if(o.name==="is"&&o.value){if(o.value.content.startsWith("vue:"))return!0;if(tn("COMPILER_IS_ON_ELEMENT",Ce,o.loc))return!0}}else if(o.name==="bind"&&At(o.arg,"is")&&tn("COMPILER_IS_ON_ELEMENT",Ce,o.loc))return!0}return!1}function uk(l){return l>64&&l<91}const pk=/\r\n/g;function Qa(l){const t=Ce.whitespace!=="preserve";let n=!1;for(let o=0;o<l.length;o++){const a=l[o];if(a.type===2)if(wo)a.content=a.content.replace(pk,`
155
+ `);else if(mk(a.content)){const r=l[o-1]&&l[o-1].type,s=l[o+1]&&l[o+1].type;!r||!s||t&&(r===3&&(s===3||s===1)||r===1&&(s===3||s===1&&fk(a.content)))?(n=!0,l[o]=null):a.content=" "}else t&&(a.content=Va(a.content))}return n?l.filter(Boolean):l}function mk(l){for(let t=0;t<l.length;t++)if(!rt(l.charCodeAt(t)))return!1;return!0}function fk(l){for(let t=0;t<l.length;t++){const n=l.charCodeAt(t);if(n===10||n===13)return!0}return!1}function Va(l){let t="",n=!1;for(let o=0;o<l.length;o++)rt(l.charCodeAt(o))?n||(t+=" ",n=!0):(t+=l[o],n=!1);return t}function Co(l){(Te[0]||wn).children.push(l)}function Ie(l,t){return{start:Me.getPos(l),end:t==null?t:Me.getPos(t),source:t==null?t:We(l,t)}}function hk(l){return Ie(l.start.offset,l.end.offset)}function jt(l,t){l.end=Me.getPos(t),l.source=We(l.start.offset,t)}function vk(l){const t={type:6,name:l.rawName,nameLoc:Ie(l.loc.start.offset,l.loc.start.offset+l.rawName.length),value:void 0,loc:l.loc};if(l.exp){const n=l.exp.loc;n.end.offset<l.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:l.exp.content,loc:n}}return t}function pl(l,t=!1,n,o=0,a=0){return ye(l,t,n,o)}function lt(l,t,n){Ce.onError(Se(l,Ie(t,t),void 0,n))}function gk(){Me.reset(),Ze=null,we=null,nt="",Ct=-1,zt=-1,Te.length=0}function yk(l,t){if(gk(),Et=l,Ce=Nt({},Ka),t){let a;for(a in t)t[a]!=null&&(Ce[a]=t[a])}if(process.env.NODE_ENV!=="production"&&!Ce.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");Me.mode=Ce.parseMode==="html"?1:Ce.parseMode==="sfc"?2:0,Me.inXML=Ce.ns===1||Ce.ns===2;const n=t&&t.delimiters;n&&(Me.delimiterOpen=al(n[0]),Me.delimiterClose=al(n[1]));const o=wn=H1([],l);return Me.parse(Et),o.loc=Ie(0,l.length),o.children=Qa(o.children),wn=null,o}function kk(l,t){ml(l,void 0,t,!!er(l))}function er(l){const t=l.children.filter(n=>n.type!==3);return t.length===1&&t[0].type===1&&!il(t[0])?t[0]:null}function ml(l,t,n,o=!1,a=!1){const{children:r}=l,s=[];for(let p=0;p<r.length;p++){const g=r[p];if(g.type===1&&g.tagType===0){const y=o?0:st(g,n);if(y>0){if(y>=2){g.codegenNode.patchFlag=-1,s.push(g);continue}}else{const w=g.codegenNode;if(w.type===13){const m=w.patchFlag;if((m===void 0||m===512||m===1)&&nr(g,n)>=2){const f=lr(g);f&&(w.props=n.hoist(f))}w.dynamicProps&&(w.dynamicProps=n.hoist(w.dynamicProps))}}}else if(g.type===12&&(o?0:st(g,n))>=2){g.codegenNode.type===14&&g.codegenNode.arguments.length>0&&g.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${mn[-1]} */`:"")),s.push(g);continue}if(g.type===1){const y=g.tagType===1;y&&n.scopes.vSlot++,ml(g,l,n,!1,a),y&&n.scopes.vSlot--}else if(g.type===11)ml(g,l,n,g.children.length===1,!0);else if(g.type===9)for(let y=0;y<g.branches.length;y++)ml(g.branches[y],l,n,g.branches[y].children.length===1,a)}let i=!1;const c=[];if(s.length===r.length&&l.type===1){if(l.tagType===0&&l.codegenNode&&l.codegenNode.type===13&&yt(l.codegenNode.children))l.codegenNode.children=d(Rt(l.codegenNode.children)),i=!0;else if(l.tagType===1&&l.codegenNode&&l.codegenNode.type===13&&l.codegenNode.children&&!yt(l.codegenNode.children)&&l.codegenNode.children.type===15){const p=u(l.codegenNode,"default");p&&(c.push(n.cached.length),p.returns=d(Rt(p.returns)),i=!0)}else if(l.tagType===3&&t&&t.type===1&&t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!yt(t.codegenNode.children)&&t.codegenNode.children.type===15){const p=tt(l,"slot",!0),g=p&&p.arg&&u(t.codegenNode,p.arg);g&&(c.push(n.cached.length),g.returns=d(Rt(g.returns)),i=!0)}}if(!i)for(const p of s)c.push(n.cached.length),p.codegenNode=n.cache(p.codegenNode);c.length&&l.type===1&&l.tagType===1&&l.codegenNode&&l.codegenNode.type===13&&l.codegenNode.children&&!yt(l.codegenNode.children)&&l.codegenNode.children.type===15&&l.codegenNode.children.properties.push($e("__",ye(JSON.stringify(c),!1)));function d(p){const g=n.cache(p);return a&&n.hmr&&(g.needArraySpread=!0),g}function u(p,g){if(p.children&&!yt(p.children)&&p.children.type===15){const y=p.children.properties.find(w=>w.key===g||w.key.content===g);return y&&y.value}}s.length&&n.transformHoist&&n.transformHoist(r,n,l)}function st(l,t){const{constantCache:n}=t;switch(l.type){case 1:if(l.tagType!==0)return 0;const o=n.get(l);if(o!==void 0)return o;const a=l.codegenNode;if(a.type!==13||a.isBlock&&l.tag!=="svg"&&l.tag!=="foreignObject"&&l.tag!=="math")return 0;if(a.patchFlag===void 0){let s=3;const i=nr(l,t);if(i===0)return n.set(l,0),0;i<s&&(s=i);for(let c=0;c<l.children.length;c++){const d=st(l.children[c],t);if(d===0)return n.set(l,0),0;d<s&&(s=d)}if(s>1)for(let c=0;c<l.props.length;c++){const d=l.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const u=st(d.exp,t);if(u===0)return n.set(l,0),0;u<s&&(s=u)}}if(a.isBlock){for(let c=0;c<l.props.length;c++)if(l.props[c].type===7)return n.set(l,0),0;t.removeHelper(Pt),t.removeHelper(en(t.inSSR,a.isComponent)),a.isBlock=!1,t.helper(Vt(t.inSSR,a.isComponent))}return n.set(l,s),s}else return n.set(l,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return st(l.content,t);case 4:return l.constType;case 8:let r=3;for(let s=0;s<l.children.length;s++){const i=l.children[s];if(Pe(i)||Zl(i))continue;const c=st(i,t);if(c===0)return 0;c<r&&(r=c)}return r;case 20:return 2;default:return process.env.NODE_ENV,0}}const bk=new Set([io,co,gn,yn]);function tr(l,t){if(l.type===14&&!Pe(l.callee)&&bk.has(l.callee)){const n=l.arguments[0];if(n.type===4)return st(n,t);if(n.type===14)return tr(n,t)}return 0}function nr(l,t){let n=3;const o=lr(l);if(o&&o.type===15){const{properties:a}=o;for(let r=0;r<a.length;r++){const{key:s,value:i}=a[r],c=st(s,t);if(c===0)return c;c<n&&(n=c);let d;if(i.type===4?d=st(i,t):i.type===14?d=tr(i,t):d=0,d===0)return d;d<n&&(n=d)}}return n}function lr(l){const t=l.codegenNode;if(t.type===13)return t.props}function xk(l,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:o=!1,hmr:a=!1,cacheHandlers:r=!1,nodeTransforms:s=[],directiveTransforms:i={},transformHoist:c=null,isBuiltInComponent:d=Kl,isCustomElement:u=Kl,expressionPlugins:p=[],scopeId:g=null,slotted:y=!0,ssr:w=!1,inSSR:m=!1,ssrCssVars:f="",bindingMetadata:E=k1,inline:C=!1,isTS:_=!1,onError:b=ko,onWarn:x=Ra,compatConfig:D}){const S=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),M={filename:t,selfName:S&&Xl(Bt(S[1])),prefixIdentifiers:n,hoistStatic:o,hmr:a,cacheHandlers:r,nodeTransforms:s,directiveTransforms:i,transformHoist:c,isBuiltInComponent:d,isCustomElement:u,expressionPlugins:p,scopeId:g,slotted:y,ssr:w,inSSR:m,ssrCssVars:f,bindingMetadata:E,inline:C,isTS:_,onError:b,onWarn:x,compatConfig:D,root:l,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:l,childIndex:0,inVOnce:!1,helper(O){const K=M.helpers.get(O)||0;return M.helpers.set(O,K+1),O},removeHelper(O){const K=M.helpers.get(O);if(K){const U=K-1;U?M.helpers.set(O,U):M.helpers.delete(O)}},helperString(O){return`_${Xt[M.helper(O)]}`},replaceNode(O){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=O},removeNode(O){if(process.env.NODE_ENV!=="production"&&!M.parent)throw new Error("Cannot remove root node.");const K=M.parent.children,U=O?K.indexOf(O):M.currentNode?M.childIndex:-1;if(process.env.NODE_ENV!=="production"&&U<0)throw new Error("node being removed is not a child of current parent");!O||O===M.currentNode?(M.currentNode=null,M.onNodeRemoved()):M.childIndex>U&&(M.childIndex--,M.onNodeRemoved()),M.parent.children.splice(U,1)},onNodeRemoved:Kl,addIdentifiers(O){},removeIdentifiers(O){},hoist(O){Pe(O)&&(O=ye(O)),M.hoists.push(O);const K=ye(`_hoisted_${M.hoists.length}`,!1,O.loc,2);return K.hoisted=O,K},cache(O,K=!1,U=!1){const R=q1(M.cached.length,O,K,U);return M.cached.push(R),R}};return M.filters=new Set,M}function wk(l,t){const n=xk(l,t);fl(l,n),t.hoistStatic&&kk(l,n),t.ssr||Ek(l,n),l.helpers=new Set([...n.helpers.keys()]),l.components=[...n.components],l.directives=[...n.directives],l.imports=n.imports,l.hoists=n.hoists,l.temps=n.temps,l.cached=n.cached,l.transformed=!0,l.filters=[...n.filters]}function Ek(l,t){const{helper:n}=t,{children:o}=l;if(o.length===1){const a=er(l);if(a&&a.codegenNode){const r=a.codegenNode;r.type===13&&go(r,t),l.codegenNode=r}else l.codegenNode=o[0]}else if(o.length>1){let a=64;process.env.NODE_ENV!=="production"&&o.filter(r=>r.type!==3).length===1&&(a|=2048),l.codegenNode=kn(t,n(fn),void 0,l.children,a,void 0,void 0,!0,void 0,!1)}}function Ck(l,t){let n=0;const o=()=>{n--};for(;n<l.children.length;n++){const a=l.children[n];Pe(a)||(t.grandParent=t.parent,t.parent=l,t.childIndex=n,t.onNodeRemoved=o,fl(a,t))}}function fl(l,t){t.currentNode=l;const{nodeTransforms:n}=t,o=[];for(let r=0;r<n.length;r++){const s=n[r](l,t);if(s&&(yt(s)?o.push(...s):o.push(s)),t.currentNode)l=t.currentNode;else return}switch(l.type){case 3:t.ssr||t.helper(vn);break;case 5:t.ssr||t.helper(nl);break;case 9:for(let r=0;r<l.branches.length;r++)fl(l.branches[r],t);break;case 10:case 11:case 1:case 0:Ck(l,t);break}t.currentNode=l;let a=o.length;for(;a--;)o[a]()}function or(l,t){const n=Pe(l)?o=>o===l:o=>l.test(o);return(o,a)=>{if(o.type===1){const{props:r}=o;if(o.tagType===3&&r.some(nk))return;const s=[];for(let i=0;i<r.length;i++){const c=r[i];if(c.type===7&&n(c.name)){r.splice(i,1),i--;const d=t(o,c,a);d&&s.push(d)}}return s}}}const hl="/*@__PURE__*/",ar=l=>`${Xt[l]}: _${Xt[l]}`;function _k(l,{mode:t="function",prefixIdentifiers:n=t==="module",sourceMap:o=!1,filename:a="template.vue.html",scopeId:r=null,optimizeImports:s=!1,runtimeGlobalName:i="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:g=!1}){const y={mode:t,prefixIdentifiers:n,sourceMap:o,filename:a,scopeId:r,optimizeImports:s,runtimeGlobalName:i,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:u,isTS:p,inSSR:g,source:l.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(m){return`_${Xt[m]}`},push(m,f=-2,E){y.code+=m},indent(){w(++y.indentLevel)},deindent(m=!1){m?--y.indentLevel:w(--y.indentLevel)},newline(){w(y.indentLevel)}};function w(m){y.push(`
156
+ `+" ".repeat(m),0)}return y}function Nk(l,t={}){const n=_k(l,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:a,prefixIdentifiers:r,indent:s,deindent:i,newline:c,scopeId:d,ssr:u}=n,p=Array.from(l.helpers),g=p.length>0,y=!r&&o!=="module";Bk(l,n);const m=u?"ssrRender":"render",E=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(a(`function ${m}(${E}) {`),s(),y&&(a("with (_ctx) {"),s(),g&&(a(`const { ${p.map(ar).join(", ")} } = _Vue
157
157
  `,-1),c())),l.components.length&&(_o(l.components,"component",n),(l.directives.length||l.temps>0)&&c()),l.directives.length&&(_o(l.directives,"directive",n),l.temps>0&&c()),l.filters&&l.filters.length&&(c(),_o(l.filters,"filter",n),c()),l.temps>0){a("let ");for(let C=0;C<l.temps;C++)a(`${C>0?", ":""}_temp${C}`)}return(l.components.length||l.directives.length||l.temps)&&(a(`
158
- `,0),c()),u||a("return "),l.codegenNode?Je(l.codegenNode,n):a("null"),y&&(i(),a("}")),i(),a("}"),{ast:l,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function _k(l,t){const{ssr:n,prefixIdentifiers:o,push:a,newline:r,runtimeModuleName:s,runtimeGlobalName:i,ssrRuntimeModuleName:c}=t,d=i,u=Array.from(l.helpers);if(u.length>0&&(a(`const _Vue = ${d}
159
- `,-1),l.hoists.length)){const p=[Vl,eo,vn,to,Da].filter(g=>u.includes(g)).map(or).join(", ");a(`const { ${p} } = _Vue
160
- `,-1)}Nk(l.hoists,t),r(),a("return ")}function _o(l,t,{helper:n,push:o,newline:a,isTS:r}){const s=n(t==="filter"?ao:t==="component"?no:oo);for(let i=0;i<l.length;i++){let c=l[i];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),o(`const ${xn(c,t)} = ${s}(${JSON.stringify(c)}${d?", true":""})${r?"!":""}`),i<l.length-1&&a()}}function Nk(l,t){if(!l.length)return;t.pure=!0;const{push:n,newline:o}=t;o();for(let a=0;a<l.length;a++){const r=l[a];r&&(n(`const _hoisted_${a+1} = `),Je(r,t),o())}t.pure=!1}function Bk(l){return Pe(l)||l.type===4||l.type===2||l.type===5||l.type===8}function No(l,t){const n=l.length>3||process.env.NODE_ENV!=="production"&&l.some(o=>yt(o)||!Bk(o));t.push("["),n&&t.indent(),En(l,t,n),n&&t.deindent(),t.push("]")}function En(l,t,n=!1,o=!0){const{push:a,newline:r}=t;for(let s=0;s<l.length;s++){const i=l[s];Pe(i)?a(i,-3):yt(i)?No(i,t):Je(i,t),s<l.length-1&&(n?(o&&a(","),r()):o&&a(", "))}}function Je(l,t){if(Pe(l)){t.push(l,-3);return}if(Zl(l)){t.push(t.helper(l));return}switch(l.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&Ua(l.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Je(l.codegenNode,t);break;case 2:Sk(l,t);break;case 4:ar(l,t);break;case 5:Mk(l,t);break;case 12:Je(l.codegenNode,t);break;case 8:rr(l,t);break;case 3:Dk(l,t);break;case 13:Tk(l,t);break;case 14:$k(l,t);break;case 15:Ik(l,t);break;case 17:Fk(l,t);break;case 18:Ok(l,t);break;case 19:Pk(l,t);break;case 20:Rk(l,t);break;case 21:En(l.body,t,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return Ua(!1,`unhandled codegen node type: ${l.type}`),l}}function Sk(l,t){t.push(JSON.stringify(l.content),-3,l)}function ar(l,t){const{content:n,isStatic:o}=l;t.push(o?JSON.stringify(n):n,-3,l)}function Mk(l,t){const{push:n,helper:o,pure:a}=t;a&&n(hl),n(`${o(nl)}(`),Je(l.content,t),n(")")}function rr(l,t){for(let n=0;n<l.children.length;n++){const o=l.children[n];Pe(o)?t.push(o,-3):Je(o,t)}}function Ak(l,t){const{push:n}=t;if(l.type===8)n("["),rr(l,t),n("]");else if(l.isStatic){const o=bo(l.content)?l.content:JSON.stringify(l.content);n(o,-2,l)}else n(`[${l.content}]`,-3,l)}function Dk(l,t){const{push:n,helper:o,pure:a}=t;a&&n(hl),n(`${o(vn)}(${JSON.stringify(l.content)})`,-3,l)}function Tk(l,t){const{push:n,helper:o,pure:a}=t,{tag:r,props:s,children:i,patchFlag:c,dynamicProps:d,directives:u,isBlock:p,disableTracking:g,isComponent:y}=l;let w;if(c)if(process.env.NODE_ENV!=="production")if(c<0)w=c+` /* ${mn[c]} */`;else{const f=Object.keys(mn).map(Number).filter(E=>E>0&&c&E).map(E=>mn[E]).join(", ");w=c+` /* ${f} */`}else w=String(c);u&&n(o(ro)+"("),p&&n(`(${o(Pt)}(${g?"true":""}), `),a&&n(hl);const m=p?en(t.inSSR,y):Vt(t.inSSR,y);n(o(m)+"(",-2,l),En(Lk([r,s,i,w,d]),t),n(")"),p&&n(")"),u&&(n(", "),Je(u,t),n(")"))}function Lk(l){let t=l.length;for(;t--&&l[t]==null;);return l.slice(0,t+1).map(n=>n||"null")}function $k(l,t){const{push:n,helper:o,pure:a}=t,r=Pe(l.callee)?l.callee:o(l.callee);a&&n(hl),n(r+"(",-2,l),En(l.arguments,t),n(")")}function Ik(l,t){const{push:n,indent:o,deindent:a,newline:r}=t,{properties:s}=l;if(!s.length){n("{}",-2,l);return}const i=s.length>1||process.env.NODE_ENV!=="production"&&s.some(c=>c.value.type!==4);n(i?"{":"{ "),i&&o();for(let c=0;c<s.length;c++){const{key:d,value:u}=s[c];Ak(d,t),n(": "),Je(u,t),c<s.length-1&&(n(","),r())}i&&a(),n(i?"}":" }")}function Fk(l,t){No(l.elements,t)}function Ok(l,t){const{push:n,indent:o,deindent:a}=t,{params:r,returns:s,body:i,newline:c,isSlot:d}=l;d&&n(`_${Xt[fo]}(`),n("(",-2,l),yt(r)?En(r,t):r&&Je(r,t),n(") => "),(c||i)&&(n("{"),o()),s?(c&&n("return "),yt(s)?No(s,t):Je(s,t)):i&&Je(i,t),(c||i)&&(a(),n("}")),d&&(l.isNonScopedSlot&&n(", undefined, true"),n(")"))}function Pk(l,t){const{test:n,consequent:o,alternate:a,newline:r}=l,{push:s,indent:i,deindent:c,newline:d}=t;if(n.type===4){const p=!bo(n.content);p&&s("("),ar(n,t),p&&s(")")}else s("("),Je(n,t),s(")");r&&i(),t.indentLevel++,r||s(" "),s("? "),Je(o,t),t.indentLevel--,r&&d(),r||s(" "),s(": ");const u=a.type===19;u||t.indentLevel++,Je(a,t),u||t.indentLevel--,r&&c(!0)}function Rk(l,t){const{push:n,helper:o,indent:a,deindent:r,newline:s}=t,{needPauseTracking:i,needArraySpread:c}=l;c&&n("[...("),n(`_cache[${l.index}] || (`),i&&(a(),n(`${o(ol)}(-1`),l.inVOnce&&n(", true"),n("),"),s(),n("(")),n(`_cache[${l.index}] = `),Je(l.value,t),i&&(n(`).cacheIndex = ${l.index},`),s(),n(`${o(ol)}(1),`),s(),n(`_cache[${l.index}]`),r()),n(")"),c&&n(")]")}const zk=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),jk=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Ut(l,t,n=!1,o=!1){const a=l.content;if(a.trim())try{new Function(o?` ${a} `:`return ${n?`(${a}) => {}`:`(${a})`}`)}catch(r){let s=r.message;const i=a.replace(jk,"").match(zk);i&&(s=`avoid using JavaScript keyword as property name: "${i[0]}"`),t.onError(Se(45,l.loc,void 0,s))}}const Uk=(l,t)=>{if(l.type===5)l.content=Bo(l.content,t);else if(l.type===1){const n=tt(l,"memo");for(let o=0;o<l.props.length;o++){const a=l.props[o];if(a.type===7&&a.name!=="for"){const r=a.exp,s=a.arg;r&&r.type===4&&!(a.name==="on"&&s)&&!(n&&s&&s.type===4&&s.content==="key")&&(a.exp=Bo(r,t,a.name==="slot")),s&&s.type===4&&!s.isStatic&&(a.arg=Bo(s,t))}}}};function Bo(l,t,n=!1,o=!1,a=Object.create(t.identifiers)){return process.env.NODE_ENV!=="production"&&Ut(l,t,n,o),l}const Hk=lr(/^(if|else|else-if)$/,(l,t,n)=>qk(l,t,n,(o,a,r)=>{const s=n.parent.children;let i=s.indexOf(o),c=0;for(;i-->=0;){const d=s[i];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(r)o.codegenNode=ir(a,c,n);else{const d=Wk(o.codegenNode);d.alternate=ir(a,c+o.branches.length-1,n)}}}));function qk(l,t,n,o){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const a=t.exp?t.exp.loc:l.loc;n.onError(Se(28,t.loc)),t.exp=ye("true",!1,a)}if(process.env.NODE_ENV!=="production"&&t.exp&&Ut(t.exp,n),t.name==="if"){const a=sr(l,t),r={type:9,loc:mk(l.loc),branches:[a]};if(n.replaceNode(r),o)return o(r,a,!0)}else{const a=n.parent.children,r=[];let s=a.indexOf(l);for(;s-->=-1;){const i=a[s];if(i&&i.type===3){n.removeNode(i),process.env.NODE_ENV!=="production"&&r.unshift(i);continue}if(i&&i.type===2&&!i.content.trim().length){n.removeNode(i);continue}if(i&&i.type===9){t.name==="else-if"&&i.branches[i.branches.length-1].condition===void 0&&n.onError(Se(30,l.loc)),n.removeNode();const c=sr(l,t);if(process.env.NODE_ENV!=="production"&&r.length&&!(n.parent&&n.parent.type===1&&(n.parent.tag==="transition"||n.parent.tag==="Transition"))&&(c.children=[...r,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&i.branches.forEach(({userKey:p})=>{Gk(p,u)&&n.onError(Se(29,c.userKey.loc))})}i.branches.push(c);const d=o&&o(i,c,!1);fl(c,n),d&&d(),n.currentNode=null}else n.onError(Se(30,l.loc));break}}}function sr(l,t){const n=l.tagType===3;return{type:10,loc:l.loc,condition:t.name==="else"?void 0:t.exp,children:n&&!tt(l,"for")?l.children:[l],userKey:bn(l,"key"),isTemplateIf:n}}function ir(l,t,n){return l.condition?vo(l.condition,cr(l,t,n),Oe(n.helper(vn),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):cr(l,t,n)}function cr(l,t,n){const{helper:o}=n,a=$e("key",ye(`${t}`,!1,at,2)),{children:r}=l,s=r[0];if(r.length!==1||s.type!==1)if(r.length===1&&s.type===11){const c=s.codegenNode;return cl(c,a,n),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!l.isTemplateIf&&r.filter(d=>d.type!==3).length===1&&(c|=2048),kn(n,o(fn),ct([a]),r,c,void 0,void 0,!0,!1,!1,l.loc)}else{const c=s.codegenNode,d=nk(c);return d.type===13&&go(d,n),cl(d,a,n),c}}function Gk(l,t){if(!l||l.type!==t.type)return!1;if(l.type===6){if(l.value.content!==t.value.content)return!1}else{const n=l.exp,o=t.exp;if(n.type!==o.type||n.type!==4||n.isStatic!==o.isStatic||n.content!==o.content)return!1}return!0}function Wk(l){for(;;)if(l.type===19)if(l.alternate.type===19)l=l.alternate;else return l;else l.type===20&&(l=l.value)}const Kk=(l,t,n)=>{const{modifiers:o,loc:a}=l,r=l.arg;let{exp:s}=l;if(s&&s.type===4&&!s.content.trim()&&(s=void 0),!s){if(r.type!==4||!r.isStatic)return n.onError(Se(52,r.loc)),{props:[$e(r,ye("",!0,a))]};dr(l),s=l.exp}return r.type!==4?(r.children.unshift("("),r.children.push(') || ""')):r.isStatic||(r.content=r.content?`${r.content} || ""`:'""'),o.some(i=>i.content==="camel")&&(r.type===4?r.isStatic?r.content=Bt(r.content):r.content=`${n.helperString(po)}(${r.content})`:(r.children.unshift(`${n.helperString(po)}(`),r.children.push(")"))),n.inSSR||(o.some(i=>i.content==="prop")&&ur(r,"."),o.some(i=>i.content==="attr")&&ur(r,"^")),{props:[$e(r,s)]}},dr=(l,t)=>{const n=l.arg,o=Bt(n.content);l.exp=ye(o,!1,n.loc)},ur=(l,t)=>{l.type===4?l.isStatic?l.content=t+l.content:l.content=`\`${t}\${${l.content}}\``:(l.children.unshift(`'${t}' + (`),l.children.push(")"))},Yk=lr("for",(l,t,n)=>{const{helper:o,removeHelper:a}=n;return Zk(l,t,n,r=>{const s=Oe(o(so),[r.source]),i=sl(l),c=tt(l,"memo"),d=bn(l,"key",!1,!0);d&&d.type===7&&!d.exp&&dr(d);let p=d&&(d.type===6?d.value?ye(d.value.content,!0):void 0:d.exp);const g=d&&p?$e("key",p):null,y=r.source.type===4&&r.source.constType>0,w=y?64:d?128:256;return r.codegenNode=kn(n,o(fn),void 0,s,w,void 0,void 0,!0,!y,!1,l.loc),()=>{let m;const{children:f}=r;process.env.NODE_ENV!=="production"&&i&&l.children.some(_=>{if(_.type===1){const b=bn(_,"key");if(b)return n.onError(Se(33,b.loc)),!0}});const E=f.length!==1||f[0].type!==1,C=il(l)?l:i&&l.children.length===1&&il(l.children[0])?l.children[0]:null;if(C?(m=C.codegenNode,i&&g&&cl(m,g,n)):E?m=kn(n,o(fn),g?ct([g]):void 0,l.children,64,void 0,void 0,!0,void 0,!1):(m=f[0].codegenNode,i&&g&&cl(m,g,n),m.isBlock!==!y&&(m.isBlock?(a(Pt),a(en(n.inSSR,m.isComponent))):a(Vt(n.inSSR,m.isComponent))),m.isBlock=!y,m.isBlock?(o(Pt),o(en(n.inSSR,m.isComponent))):o(Vt(n.inSSR,m.isComponent))),c){const _=Qt(So(r.parseResult,[ye("_cached")]));_.body=H1([mt(["const _memo = (",c.exp,")"]),mt(["if (_cached",...p?[" && _cached.key === ",p]:[],` && ${n.helperString($a)}(_cached, _memo)) return _cached`]),mt(["const _item = ",m]),ye("_item.memo = _memo"),ye("return _item")]),s.arguments.push(_,ye("_cache"),ye(String(n.cached.length))),n.cached.push(null)}else s.arguments.push(Qt(So(r.parseResult),m,!0))}})});function Zk(l,t,n,o){if(!t.exp){n.onError(Se(31,t.loc));return}const a=t.forParseResult;if(!a){n.onError(Se(32,t.loc));return}pr(a,n);const{addIdentifiers:r,removeIdentifiers:s,scopes:i}=n,{source:c,value:d,key:u,index:p}=a,g={type:11,loc:t.loc,source:c,valueAlias:d,keyAlias:u,objectIndexAlias:p,parseResult:a,children:sl(l)?l.children:[l]};n.replaceNode(g),i.vFor++;const y=o&&o(g);return()=>{i.vFor--,y&&y()}}function pr(l,t){l.finalized||(process.env.NODE_ENV!=="production"&&(Ut(l.source,t),l.key&&Ut(l.key,t,!0),l.index&&Ut(l.index,t,!0),l.value&&Ut(l.value,t,!0)),l.finalized=!0)}function So({value:l,key:t,index:n},o=[]){return Jk([l,t,n,...o])}function Jk(l){let t=l.length;for(;t--&&!l[t];);return l.slice(0,t+1).map((n,o)=>n||ye("_".repeat(o+1),!1))}const mr=ye("undefined",!1),Xk=(l,t)=>{if(l.type===1&&(l.tagType===1||l.tagType===3)){const n=tt(l,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},Qk=(l,t,n,o)=>Qt(l,n,!1,!0,n.length?n[0].loc:o);function Vk(l,t,n=Qk){t.helper(fo);const{children:o,loc:a}=l,r=[],s=[];let i=t.scopes.vSlot>0||t.scopes.vFor>0;const c=tt(l,"slot",!0);if(c){const{arg:f,exp:E}=c;f&&!et(f)&&(i=!0),r.push($e(f||ye("default",!0),n(E,void 0,o,a)))}let d=!1,u=!1;const p=[],g=new Set;let y=0;for(let f=0;f<o.length;f++){const E=o[f];let C;if(!sl(E)||!(C=tt(E,"slot",!0))){E.type!==3&&p.push(E);continue}if(c){t.onError(Se(37,C.loc));break}d=!0;const{children:_,loc:b}=E,{arg:x=ye("default",!0),exp:D,loc:S}=C;let M;et(x)?M=x?x.content:"default":i=!0;const O=tt(E,"for"),K=n(D,O,_,b);let U,R;if(U=tt(E,"if"))i=!0,s.push(vo(U.exp,vl(x,K,y++),mr));else if(R=tt(E,/^else(-if)?$/,!0)){let q=f,N;for(;q--&&(N=o[q],!(N.type!==3&&Mo(N))););if(N&&sl(N)&&tt(N,/^(else-)?if$/)){let j=s[s.length-1];for(;j.alternate.type===19;)j=j.alternate;j.alternate=R.exp?vo(R.exp,vl(x,K,y++),mr):vl(x,K,y++)}else t.onError(Se(30,R.loc))}else if(O){i=!0;const q=O.forParseResult;q?(pr(q,t),s.push(Oe(t.helper(so),[q.source,Qt(So(q),vl(x,K),!0)]))):t.onError(Se(32,O.loc))}else{if(M){if(g.has(M)){t.onError(Se(38,S));continue}g.add(M),M==="default"&&(u=!0)}r.push($e(x,K))}}if(!c){const f=(E,C)=>{const _=n(E,void 0,C,a);return t.compatConfig&&(_.isNonScopedSlot=!0),$e("default",_)};d?p.length&&p.some(E=>Mo(E))&&(u?t.onError(Se(39,p[0].loc)):r.push(f(void 0,p))):r.push(f(void 0,o))}const w=i?2:gl(l.children)?3:1;let m=ct(r.concat($e("_",ye(w+(process.env.NODE_ENV!=="production"?` /* ${w1[w]} */`:""),!1))),a);return s.length&&(m=Oe(t.helper(La),[m,Rt(s)])),{slots:m,hasDynamicSlots:i}}function vl(l,t,n){const o=[$e("name",l),$e("fn",t)];return n!=null&&o.push($e("key",ye(String(n),!0))),ct(o)}function gl(l){for(let t=0;t<l.length;t++){const n=l[t];switch(n.type){case 1:if(n.tagType===2||gl(n.children))return!0;break;case 9:if(gl(n.branches))return!0;break;case 10:case 11:if(gl(n.children))return!0;break}}return!1}function Mo(l){return l.type!==2&&l.type!==12?!0:l.type===2?!!l.content.trim():Mo(l.content)}const fr=new WeakMap,eb=(l,t)=>function(){if(l=t.currentNode,!(l.type===1&&(l.tagType===0||l.tagType===1)))return;const{tag:o,props:a}=l,r=l.tagType===1;let s=r?tb(l,t):`"${o}"`;const i=y1(s)&&s.callee===lo;let c,d,u=0,p,g,y,w=i||s===hn||s===Ql||!r&&(o==="svg"||o==="foreignObject"||o==="math");if(a.length>0){const m=hr(l,t,void 0,r,i);c=m.props,u=m.patchFlag,g=m.dynamicPropNames;const f=m.directives;y=f&&f.length?Rt(f.map(E=>lb(E,t))):void 0,m.shouldUseBlock&&(w=!0)}if(l.children.length>0)if(s===tl&&(w=!0,u|=1024,process.env.NODE_ENV!=="production"&&l.children.length>1&&t.onError(Se(46,{start:l.children[0].loc.start,end:l.children[l.children.length-1].loc.end,source:""}))),r&&s!==hn&&s!==tl){const{slots:f,hasDynamicSlots:E}=Vk(l,t);d=f,E&&(u|=1024)}else if(l.children.length===1&&s!==hn){const f=l.children[0],E=f.type,C=E===5||E===8;C&&st(f,t)===0&&(u|=1),C||E===2?d=f:d=l.children}else d=l.children;g&&g.length&&(p=ob(g)),l.codegenNode=kn(t,s,c,d,u===0?void 0:u,p,y,!!w,!1,r,l.loc)};function tb(l,t,n=!1){let{tag:o}=l;const a=Ao(o),r=bn(l,"is",!1,!0);if(r)if(a||Mt("COMPILER_IS_ON_ELEMENT",t)){let i;if(r.type===6?i=r.value&&ye(r.value.content,!0):(i=r.exp,i||(i=ye("is",!1,r.arg.loc))),i)return Oe(t.helper(lo),[i])}else r.type===6&&r.value.content.startsWith("vue:")&&(o=r.value.content.slice(4));const s=Ra(o)||t.isBuiltInComponent(o);return s?(n||t.helper(s),s):(t.helper(no),t.components.add(o),xn(o,"component"))}function hr(l,t,n=l.props,o,a,r=!1){const{tag:s,loc:i,children:c}=l;let d=[];const u=[],p=[],g=c.length>0;let y=!1,w=0,m=!1,f=!1,E=!1,C=!1,_=!1,b=!1;const x=[],D=K=>{d.length&&(u.push(ct(vr(d),i)),d=[]),K&&u.push(K)},S=()=>{t.scopes.vFor>0&&d.push($e(ye("ref_for",!0),ye("true")))},M=({key:K,value:U})=>{if(et(K)){const R=K.content,q=Yl(R);if(q&&(!o||a)&&R.toLowerCase()!=="onclick"&&R!=="onUpdate:modelValue"&&!Ba(R)&&(C=!0),q&&Ba(R)&&(b=!0),q&&U.type===14&&(U=U.arguments[0]),U.type===20||(U.type===4||U.type===8)&&st(U,t)>0)return;R==="ref"?m=!0:R==="class"?f=!0:R==="style"?E=!0:R!=="key"&&!x.includes(R)&&x.push(R),o&&(R==="class"||R==="style")&&!x.includes(R)&&x.push(R)}else _=!0};for(let K=0;K<n.length;K++){const U=n[K];if(U.type===6){const{loc:R,name:q,nameLoc:N,value:j}=U;let $=!0;if(q==="ref"&&(m=!0,S()),q==="is"&&(Ao(s)||j&&j.content.startsWith("vue:")||Mt("COMPILER_IS_ON_ELEMENT",t)))continue;d.push($e(ye(q,!0,N),ye(j?j.content:"",$,j?j.loc:R)))}else{const{name:R,arg:q,exp:N,loc:j,modifiers:$}=U,Z=R==="bind",V=R==="on";if(R==="slot"){o||t.onError(Se(40,j));continue}if(R==="once"||R==="memo"||R==="is"||Z&&At(q,"is")&&(Ao(s)||Mt("COMPILER_IS_ON_ELEMENT",t))||V&&r)continue;if((Z&&At(q,"key")||V&&g&&At(q,"vue:before-update"))&&(y=!0),Z&&At(q,"ref")&&S(),!q&&(Z||V)){if(_=!0,N)if(Z){if(D(),process.env.NODE_ENV!=="production"&&u.some(H=>H.type===15?H.properties.some(({key:ie})=>ie.type!==4||!ie.isStatic?!0:ie.content!=="class"&&ie.content!=="style"&&!Yl(ie.content)):!0)&&tn("COMPILER_V_BIND_OBJECT_ORDER",t,j),Mt("COMPILER_V_BIND_OBJECT_ORDER",t)){u.unshift(N);continue}S(),D(),u.push(N)}else D({type:14,loc:j,callee:t.helper(uo),arguments:o?[N]:[N,"true"]});else t.onError(Se(Z?34:35,j));continue}Z&&$.some(ee=>ee.content==="prop")&&(w|=32);const oe=t.directiveTransforms[R];if(oe){const{props:ee,needRuntime:H}=oe(U,l,t);!r&&ee.forEach(M),V&&q&&!et(q)?D(ct(ee,i)):d.push(...ee),H&&(p.push(U),Zl(H)&&fr.set(U,H))}else k1(R)||(p.push(U),g&&(y=!0))}}let O;if(u.length?(D(),u.length>1?O=Oe(t.helper(ll),u,i):O=u[0]):d.length&&(O=ct(vr(d),i)),_?w|=16:(f&&!o&&(w|=2),E&&!o&&(w|=4),x.length&&(w|=8),C&&(w|=32)),!y&&(w===0||w===32)&&(m||b||p.length>0)&&(w|=512),!t.inSSR&&O)switch(O.type){case 15:let K=-1,U=-1,R=!1;for(let j=0;j<O.properties.length;j++){const $=O.properties[j].key;et($)?$.content==="class"?K=j:$.content==="style"&&(U=j):$.isHandlerKey||(R=!0)}const q=O.properties[K],N=O.properties[U];R?O=Oe(t.helper(gn),[O]):(q&&!et(q.value)&&(q.value=Oe(t.helper(io),[q.value])),N&&(E||N.value.type===4&&N.value.content.trim()[0]==="["||N.value.type===17)&&(N.value=Oe(t.helper(co),[N.value])));break;case 14:break;default:O=Oe(t.helper(gn),[Oe(t.helper(yn),[O])]);break}return{props:O,directives:p,patchFlag:w,dynamicPropNames:x,shouldUseBlock:y}}function vr(l){const t=new Map,n=[];for(let o=0;o<l.length;o++){const a=l[o];if(a.key.type===8||!a.key.isStatic){n.push(a);continue}const r=a.key.content,s=t.get(r);s?(r==="style"||r==="class"||Yl(r))&&nb(s,a):(t.set(r,a),n.push(a))}return n}function nb(l,t){l.value.type===17?l.value.elements.push(t.value):l.value=Rt([l.value,t.value],l.loc)}function lb(l,t){const n=[],o=fr.get(l);o?n.push(t.helperString(o)):(t.helper(oo),t.directives.add(l.name),n.push(xn(l.name,"directive")));const{loc:a}=l;if(l.exp&&n.push(l.exp),l.arg&&(l.exp||n.push("void 0"),n.push(l.arg)),Object.keys(l.modifiers).length){l.arg||(l.exp||n.push("void 0"),n.push("void 0"));const r=ye("true",!1,a);n.push(ct(l.modifiers.map(s=>$e(s,r)),a))}return Rt(n,l.loc)}function ob(l){let t="[";for(let n=0,o=l.length;n<o;n++)t+=JSON.stringify(l[n]),n<o-1&&(t+=", ");return t+"]"}function Ao(l){return l==="component"||l==="Component"}const ab=(l,t)=>{if(il(l)){const{children:n,loc:o}=l,{slotName:a,slotProps:r}=rb(l,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",a,"{}","undefined","true"];let i=2;r&&(s[2]=r,i=3),n.length&&(s[3]=Qt([],n,!1,!1,o),i=4),t.scopeId&&!t.slotted&&(i=5),s.splice(i),l.codegenNode=Oe(t.helper(Ta),s,o)}};function rb(l,t){let n='"default"',o;const a=[];for(let r=0;r<l.props.length;r++){const s=l.props[r];if(s.type===6)s.value&&(s.name==="name"?n=JSON.stringify(s.value.content):(s.name=Bt(s.name),a.push(s)));else if(s.name==="bind"&&At(s.arg,"name")){if(s.exp)n=s.exp;else if(s.arg&&s.arg.type===4){const i=Bt(s.arg.content);n=s.exp=ye(i,!1,s.arg.loc)}}else s.name==="bind"&&s.arg&&et(s.arg)&&(s.arg.content=Bt(s.arg.content)),a.push(s)}if(a.length>0){const{props:r,directives:s}=hr(l,t,a,!1,!1);o=r,s.length&&t.onError(Se(36,s[0].loc))}return{slotName:n,slotProps:o}}const gr=(l,t,n,o)=>{const{loc:a,modifiers:r,arg:s}=l;!l.exp&&!r.length&&n.onError(Se(35,a));let i;if(s.type===4)if(s.isStatic){let p=s.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&n.onError(Se(51,s.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const g=t.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?x1(Bt(p)):`on:${p}`;i=ye(g,!0,s.loc)}else i=mt([`${n.helperString(mo)}(`,s,")"]);else i=s,i.children.unshift(`${n.helperString(mo)}(`),i.children.push(")");let c=l.exp;c&&!c.content.trim()&&(c=void 0);let d=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const p=ja(c),g=!(p||Q1(c)),y=c.content.includes(";");process.env.NODE_ENV!=="production"&&Ut(c,n,!1,y),(g||d&&p)&&(c=mt([`${g?"$event":"(...args)"} => ${y?"{":"("}`,c,y?"}":")"]))}let u={props:[$e(i,c||ye("() => {}",!1,a))]};return o&&(u=o(u)),d&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(p=>p.key.isHandlerKey=!0),u},sb=(l,t)=>{if(l.type===0||l.type===1||l.type===11||l.type===10)return()=>{const n=l.children;let o,a=!1;for(let r=0;r<n.length;r++){const s=n[r];if(xo(s)){a=!0;for(let i=r+1;i<n.length;i++){const c=n[i];if(xo(c))o||(o=n[r]=mt([s],s.loc)),o.children.push(" + ",c),n.splice(i,1),i--;else{o=void 0;break}}}}if(!(!a||n.length===1&&(l.type===0||l.type===1&&l.tagType===0&&!l.props.find(r=>r.type===7&&!t.directiveTransforms[r.name])&&l.tag!=="template")))for(let r=0;r<n.length;r++){const s=n[r];if(xo(s)||s.type===8){const i=[];(s.type!==2||s.content!==" ")&&i.push(s),!t.ssr&&st(s,t)===0&&i.push(1+(process.env.NODE_ENV!=="production"?` /* ${mn[1]} */`:"")),n[r]={type:12,content:s,loc:s.loc,codegenNode:Oe(t.helper(to),i)}}}}},yr=new WeakSet,ib=(l,t)=>{if(l.type===1&&tt(l,"once",!0))return yr.has(l)||t.inVOnce||t.inSSR?void 0:(yr.add(l),t.inVOnce=!0,t.helper(ol),()=>{t.inVOnce=!1;const n=t.currentNode;n.codegenNode&&(n.codegenNode=t.cache(n.codegenNode,!0,!0))})},kr=(l,t,n)=>{const{exp:o,arg:a}=l;if(!o)return n.onError(Se(41,l.loc)),yl();const r=o.loc.source.trim(),s=o.type===4?o.content:r,i=n.bindingMetadata[r];if(i==="props"||i==="props-aliased")return n.onError(Se(44,o.loc)),yl();if(!s.trim()||!ja(o))return n.onError(Se(42,o.loc)),yl();const c=a||ye("modelValue",!0),d=a?et(a)?`onUpdate:${Bt(a.content)}`:mt(['"onUpdate:" + ',a]):"onUpdate:modelValue";let u;const p=n.isTS?"($event: any)":"$event";u=mt([`${p} => ((`,o,") = $event)"]);const g=[$e(c,l.exp),$e(d,u)];if(l.modifiers.length&&t.tagType===1){const y=l.modifiers.map(m=>m.content).map(m=>(bo(m)?m:JSON.stringify(m))+": true").join(", "),w=a?et(a)?`${a.content}Modifiers`:mt([a,' + "Modifiers"']):"modelModifiers";g.push($e(w,ye(`{ ${y} }`,!1,l.loc,2)))}return yl(g)};function yl(l=[]){return{props:l}}const cb=/[\w).+\-_$\]]/,db=(l,t)=>{Mt("COMPILER_FILTERS",t)&&(l.type===5?kl(l.content,t):l.type===1&&l.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&kl(n.exp,t)}))};function kl(l,t){if(l.type===4)br(l,t);else for(let n=0;n<l.children.length;n++){const o=l.children[n];typeof o=="object"&&(o.type===4?br(o,t):o.type===8?kl(l,t):o.type===5&&kl(o.content,t))}}function br(l,t){const n=l.content;let o=!1,a=!1,r=!1,s=!1,i=0,c=0,d=0,u=0,p,g,y,w,m=[];for(y=0;y<n.length;y++)if(g=p,p=n.charCodeAt(y),o)p===39&&g!==92&&(o=!1);else if(a)p===34&&g!==92&&(a=!1);else if(r)p===96&&g!==92&&(r=!1);else if(s)p===47&&g!==92&&(s=!1);else if(p===124&&n.charCodeAt(y+1)!==124&&n.charCodeAt(y-1)!==124&&!i&&!c&&!d)w===void 0?(u=y+1,w=n.slice(0,y).trim()):f();else{switch(p){case 34:a=!0;break;case 39:o=!0;break;case 96:r=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:i++;break;case 125:i--;break}if(p===47){let E=y-1,C;for(;E>=0&&(C=n.charAt(E),C===" ");E--);(!C||!cb.test(C))&&(s=!0)}}w===void 0?w=n.slice(0,y).trim():u!==0&&f();function f(){m.push(n.slice(u,y).trim()),u=y+1}if(m.length){for(process.env.NODE_ENV!=="production"&&rl("COMPILER_FILTERS",t,l.loc),y=0;y<m.length;y++)w=ub(w,m[y],t);l.content=w,l.ast=void 0}}function ub(l,t,n){n.helper(ao);const o=t.indexOf("(");if(o<0)return n.filters.add(t),`${xn(t,"filter")}(${l})`;{const a=t.slice(0,o),r=t.slice(o+1);return n.filters.add(a),`${xn(a,"filter")}(${l}${r!==")"?","+r:r}`}}const xr=new WeakSet,pb=(l,t)=>{if(l.type===1){const n=tt(l,"memo");return!n||xr.has(l)?void 0:(xr.add(l),()=>{const o=l.codegenNode||t.currentNode.codegenNode;o&&o.type===13&&(l.tagType!==1&&go(o,t),l.codegenNode=Oe(t.helper(ho),[n.exp,Qt(void 0,o),"_cache",String(t.cached.length)]),t.cached.push(null))})}};function mb(l){return[[ib,Hk,pb,Yk,db,...process.env.NODE_ENV!=="production"?[Uk]:[],ab,eb,Xk,sb],{on:gr,bind:Kk,model:kr}]}function fb(l,t={}){const n=t.onError||ko,o=t.mode==="module";t.prefixIdentifiers===!0?n(Se(47)):o&&n(Se(48));const a=!1;t.cacheHandlers&&n(Se(49)),t.scopeId&&!o&&n(Se(50));const r=Nt({},t,{prefixIdentifiers:a}),s=Pe(l)?vk(l,r):l,[i,c]=mb();return bk(s,Nt({},r,{nodeTransforms:[...i,...t.nodeTransforms||[]],directiveTransforms:Nt({},c,t.directiveTransforms||{})})),Ck(s,r)}const hb=()=>({props:[]});/**
158
+ `,0),c()),u||a("return "),l.codegenNode?Je(l.codegenNode,n):a("null"),y&&(i(),a("}")),i(),a("}"),{ast:l,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Bk(l,t){const{ssr:n,prefixIdentifiers:o,push:a,newline:r,runtimeModuleName:s,runtimeGlobalName:i,ssrRuntimeModuleName:c}=t,d=i,u=Array.from(l.helpers);if(u.length>0&&(a(`const _Vue = ${d}
159
+ `,-1),l.hoists.length)){const p=[Vl,eo,vn,to,Ta].filter(g=>u.includes(g)).map(ar).join(", ");a(`const { ${p} } = _Vue
160
+ `,-1)}Sk(l.hoists,t),r(),a("return ")}function _o(l,t,{helper:n,push:o,newline:a,isTS:r}){const s=n(t==="filter"?ao:t==="component"?no:oo);for(let i=0;i<l.length;i++){let c=l[i];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),o(`const ${xn(c,t)} = ${s}(${JSON.stringify(c)}${d?", true":""})${r?"!":""}`),i<l.length-1&&a()}}function Sk(l,t){if(!l.length)return;t.pure=!0;const{push:n,newline:o}=t;o();for(let a=0;a<l.length;a++){const r=l[a];r&&(n(`const _hoisted_${a+1} = `),Je(r,t),o())}t.pure=!1}function Mk(l){return Pe(l)||l.type===4||l.type===2||l.type===5||l.type===8}function No(l,t){const n=l.length>3||process.env.NODE_ENV!=="production"&&l.some(o=>yt(o)||!Mk(o));t.push("["),n&&t.indent(),En(l,t,n),n&&t.deindent(),t.push("]")}function En(l,t,n=!1,o=!0){const{push:a,newline:r}=t;for(let s=0;s<l.length;s++){const i=l[s];Pe(i)?a(i,-3):yt(i)?No(i,t):Je(i,t),s<l.length-1&&(n?(o&&a(","),r()):o&&a(", "))}}function Je(l,t){if(Pe(l)){t.push(l,-3);return}if(Zl(l)){t.push(t.helper(l));return}switch(l.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&Ha(l.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Je(l.codegenNode,t);break;case 2:Ak(l,t);break;case 4:rr(l,t);break;case 5:Dk(l,t);break;case 12:Je(l.codegenNode,t);break;case 8:sr(l,t);break;case 3:Lk(l,t);break;case 13:$k(l,t);break;case 14:Fk(l,t);break;case 15:Ok(l,t);break;case 17:Pk(l,t);break;case 18:Rk(l,t);break;case 19:zk(l,t);break;case 20:jk(l,t);break;case 21:En(l.body,t,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return Ha(!1,`unhandled codegen node type: ${l.type}`),l}}function Ak(l,t){t.push(JSON.stringify(l.content),-3,l)}function rr(l,t){const{content:n,isStatic:o}=l;t.push(o?JSON.stringify(n):n,-3,l)}function Dk(l,t){const{push:n,helper:o,pure:a}=t;a&&n(hl),n(`${o(nl)}(`),Je(l.content,t),n(")")}function sr(l,t){for(let n=0;n<l.children.length;n++){const o=l.children[n];Pe(o)?t.push(o,-3):Je(o,t)}}function Tk(l,t){const{push:n}=t;if(l.type===8)n("["),sr(l,t),n("]");else if(l.isStatic){const o=bo(l.content)?l.content:JSON.stringify(l.content);n(o,-2,l)}else n(`[${l.content}]`,-3,l)}function Lk(l,t){const{push:n,helper:o,pure:a}=t;a&&n(hl),n(`${o(vn)}(${JSON.stringify(l.content)})`,-3,l)}function $k(l,t){const{push:n,helper:o,pure:a}=t,{tag:r,props:s,children:i,patchFlag:c,dynamicProps:d,directives:u,isBlock:p,disableTracking:g,isComponent:y}=l;let w;if(c)if(process.env.NODE_ENV!=="production")if(c<0)w=c+` /* ${mn[c]} */`;else{const f=Object.keys(mn).map(Number).filter(E=>E>0&&c&E).map(E=>mn[E]).join(", ");w=c+` /* ${f} */`}else w=String(c);u&&n(o(ro)+"("),p&&n(`(${o(Pt)}(${g?"true":""}), `),a&&n(hl);const m=p?en(t.inSSR,y):Vt(t.inSSR,y);n(o(m)+"(",-2,l),En(Ik([r,s,i,w,d]),t),n(")"),p&&n(")"),u&&(n(", "),Je(u,t),n(")"))}function Ik(l){let t=l.length;for(;t--&&l[t]==null;);return l.slice(0,t+1).map(n=>n||"null")}function Fk(l,t){const{push:n,helper:o,pure:a}=t,r=Pe(l.callee)?l.callee:o(l.callee);a&&n(hl),n(r+"(",-2,l),En(l.arguments,t),n(")")}function Ok(l,t){const{push:n,indent:o,deindent:a,newline:r}=t,{properties:s}=l;if(!s.length){n("{}",-2,l);return}const i=s.length>1||process.env.NODE_ENV!=="production"&&s.some(c=>c.value.type!==4);n(i?"{":"{ "),i&&o();for(let c=0;c<s.length;c++){const{key:d,value:u}=s[c];Tk(d,t),n(": "),Je(u,t),c<s.length-1&&(n(","),r())}i&&a(),n(i?"}":" }")}function Pk(l,t){No(l.elements,t)}function Rk(l,t){const{push:n,indent:o,deindent:a}=t,{params:r,returns:s,body:i,newline:c,isSlot:d}=l;d&&n(`_${Xt[fo]}(`),n("(",-2,l),yt(r)?En(r,t):r&&Je(r,t),n(") => "),(c||i)&&(n("{"),o()),s?(c&&n("return "),yt(s)?No(s,t):Je(s,t)):i&&Je(i,t),(c||i)&&(a(),n("}")),d&&(l.isNonScopedSlot&&n(", undefined, true"),n(")"))}function zk(l,t){const{test:n,consequent:o,alternate:a,newline:r}=l,{push:s,indent:i,deindent:c,newline:d}=t;if(n.type===4){const p=!bo(n.content);p&&s("("),rr(n,t),p&&s(")")}else s("("),Je(n,t),s(")");r&&i(),t.indentLevel++,r||s(" "),s("? "),Je(o,t),t.indentLevel--,r&&d(),r||s(" "),s(": ");const u=a.type===19;u||t.indentLevel++,Je(a,t),u||t.indentLevel--,r&&c(!0)}function jk(l,t){const{push:n,helper:o,indent:a,deindent:r,newline:s}=t,{needPauseTracking:i,needArraySpread:c}=l;c&&n("[...("),n(`_cache[${l.index}] || (`),i&&(a(),n(`${o(ol)}(-1`),l.inVOnce&&n(", true"),n("),"),s(),n("(")),n(`_cache[${l.index}] = `),Je(l.value,t),i&&(n(`).cacheIndex = ${l.index},`),s(),n(`${o(ol)}(1),`),s(),n(`_cache[${l.index}]`),r()),n(")"),c&&n(")]")}const Uk=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Hk=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Ut(l,t,n=!1,o=!1){const a=l.content;if(a.trim())try{new Function(o?` ${a} `:`return ${n?`(${a}) => {}`:`(${a})`}`)}catch(r){let s=r.message;const i=a.replace(Hk,"").match(Uk);i&&(s=`avoid using JavaScript keyword as property name: "${i[0]}"`),t.onError(Se(45,l.loc,void 0,s))}}const qk=(l,t)=>{if(l.type===5)l.content=Bo(l.content,t);else if(l.type===1){const n=tt(l,"memo");for(let o=0;o<l.props.length;o++){const a=l.props[o];if(a.type===7&&a.name!=="for"){const r=a.exp,s=a.arg;r&&r.type===4&&!(a.name==="on"&&s)&&!(n&&s&&s.type===4&&s.content==="key")&&(a.exp=Bo(r,t,a.name==="slot")),s&&s.type===4&&!s.isStatic&&(a.arg=Bo(s,t))}}}};function Bo(l,t,n=!1,o=!1,a=Object.create(t.identifiers)){return process.env.NODE_ENV!=="production"&&Ut(l,t,n,o),l}const Wk=or(/^(if|else|else-if)$/,(l,t,n)=>Gk(l,t,n,(o,a,r)=>{const s=n.parent.children;let i=s.indexOf(o),c=0;for(;i-->=0;){const d=s[i];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(r)o.codegenNode=cr(a,c,n);else{const d=Yk(o.codegenNode);d.alternate=cr(a,c+o.branches.length-1,n)}}}));function Gk(l,t,n,o){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const a=t.exp?t.exp.loc:l.loc;n.onError(Se(28,t.loc)),t.exp=ye("true",!1,a)}if(process.env.NODE_ENV!=="production"&&t.exp&&Ut(t.exp,n),t.name==="if"){const a=ir(l,t),r={type:9,loc:hk(l.loc),branches:[a]};if(n.replaceNode(r),o)return o(r,a,!0)}else{const a=n.parent.children,r=[];let s=a.indexOf(l);for(;s-->=-1;){const i=a[s];if(i&&i.type===3){n.removeNode(i),process.env.NODE_ENV!=="production"&&r.unshift(i);continue}if(i&&i.type===2&&!i.content.trim().length){n.removeNode(i);continue}if(i&&i.type===9){t.name==="else-if"&&i.branches[i.branches.length-1].condition===void 0&&n.onError(Se(30,l.loc)),n.removeNode();const c=ir(l,t);if(process.env.NODE_ENV!=="production"&&r.length&&!(n.parent&&n.parent.type===1&&(n.parent.tag==="transition"||n.parent.tag==="Transition"))&&(c.children=[...r,...c.children]),process.env.NODE_ENV!=="production"){const u=c.userKey;u&&i.branches.forEach(({userKey:p})=>{Kk(p,u)&&n.onError(Se(29,c.userKey.loc))})}i.branches.push(c);const d=o&&o(i,c,!1);fl(c,n),d&&d(),n.currentNode=null}else n.onError(Se(30,l.loc));break}}}function ir(l,t){const n=l.tagType===3;return{type:10,loc:l.loc,condition:t.name==="else"?void 0:t.exp,children:n&&!tt(l,"for")?l.children:[l],userKey:bn(l,"key"),isTemplateIf:n}}function cr(l,t,n){return l.condition?vo(l.condition,dr(l,t,n),Oe(n.helper(vn),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):dr(l,t,n)}function dr(l,t,n){const{helper:o}=n,a=$e("key",ye(`${t}`,!1,at,2)),{children:r}=l,s=r[0];if(r.length!==1||s.type!==1)if(r.length===1&&s.type===11){const c=s.codegenNode;return cl(c,a,n),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!l.isTemplateIf&&r.filter(d=>d.type!==3).length===1&&(c|=2048),kn(n,o(fn),ct([a]),r,c,void 0,void 0,!0,!1,!1,l.loc)}else{const c=s.codegenNode,d=ok(c);return d.type===13&&go(d,n),cl(d,a,n),c}}function Kk(l,t){if(!l||l.type!==t.type)return!1;if(l.type===6){if(l.value.content!==t.value.content)return!1}else{const n=l.exp,o=t.exp;if(n.type!==o.type||n.type!==4||n.isStatic!==o.isStatic||n.content!==o.content)return!1}return!0}function Yk(l){for(;;)if(l.type===19)if(l.alternate.type===19)l=l.alternate;else return l;else l.type===20&&(l=l.value)}const Zk=(l,t,n)=>{const{modifiers:o,loc:a}=l,r=l.arg;let{exp:s}=l;if(s&&s.type===4&&!s.content.trim()&&(s=void 0),!s){if(r.type!==4||!r.isStatic)return n.onError(Se(52,r.loc)),{props:[$e(r,ye("",!0,a))]};ur(l),s=l.exp}return r.type!==4?(r.children.unshift("("),r.children.push(') || ""')):r.isStatic||(r.content=r.content?`${r.content} || ""`:'""'),o.some(i=>i.content==="camel")&&(r.type===4?r.isStatic?r.content=Bt(r.content):r.content=`${n.helperString(po)}(${r.content})`:(r.children.unshift(`${n.helperString(po)}(`),r.children.push(")"))),n.inSSR||(o.some(i=>i.content==="prop")&&pr(r,"."),o.some(i=>i.content==="attr")&&pr(r,"^")),{props:[$e(r,s)]}},ur=(l,t)=>{const n=l.arg,o=Bt(n.content);l.exp=ye(o,!1,n.loc)},pr=(l,t)=>{l.type===4?l.isStatic?l.content=t+l.content:l.content=`\`${t}\${${l.content}}\``:(l.children.unshift(`'${t}' + (`),l.children.push(")"))},Jk=or("for",(l,t,n)=>{const{helper:o,removeHelper:a}=n;return Xk(l,t,n,r=>{const s=Oe(o(so),[r.source]),i=sl(l),c=tt(l,"memo"),d=bn(l,"key",!1,!0);d&&d.type===7&&!d.exp&&ur(d);let p=d&&(d.type===6?d.value?ye(d.value.content,!0):void 0:d.exp);const g=d&&p?$e("key",p):null,y=r.source.type===4&&r.source.constType>0,w=y?64:d?128:256;return r.codegenNode=kn(n,o(fn),void 0,s,w,void 0,void 0,!0,!y,!1,l.loc),()=>{let m;const{children:f}=r;process.env.NODE_ENV!=="production"&&i&&l.children.some(_=>{if(_.type===1){const b=bn(_,"key");if(b)return n.onError(Se(33,b.loc)),!0}});const E=f.length!==1||f[0].type!==1,C=il(l)?l:i&&l.children.length===1&&il(l.children[0])?l.children[0]:null;if(C?(m=C.codegenNode,i&&g&&cl(m,g,n)):E?m=kn(n,o(fn),g?ct([g]):void 0,l.children,64,void 0,void 0,!0,void 0,!1):(m=f[0].codegenNode,i&&g&&cl(m,g,n),m.isBlock!==!y&&(m.isBlock?(a(Pt),a(en(n.inSSR,m.isComponent))):a(Vt(n.inSSR,m.isComponent))),m.isBlock=!y,m.isBlock?(o(Pt),o(en(n.inSSR,m.isComponent))):o(Vt(n.inSSR,m.isComponent))),c){const _=Qt(So(r.parseResult,[ye("_cached")]));_.body=W1([mt(["const _memo = (",c.exp,")"]),mt(["if (_cached",...p?[" && _cached.key === ",p]:[],` && ${n.helperString(Ia)}(_cached, _memo)) return _cached`]),mt(["const _item = ",m]),ye("_item.memo = _memo"),ye("return _item")]),s.arguments.push(_,ye("_cache"),ye(String(n.cached.length))),n.cached.push(null)}else s.arguments.push(Qt(So(r.parseResult),m,!0))}})});function Xk(l,t,n,o){if(!t.exp){n.onError(Se(31,t.loc));return}const a=t.forParseResult;if(!a){n.onError(Se(32,t.loc));return}mr(a,n);const{addIdentifiers:r,removeIdentifiers:s,scopes:i}=n,{source:c,value:d,key:u,index:p}=a,g={type:11,loc:t.loc,source:c,valueAlias:d,keyAlias:u,objectIndexAlias:p,parseResult:a,children:sl(l)?l.children:[l]};n.replaceNode(g),i.vFor++;const y=o&&o(g);return()=>{i.vFor--,y&&y()}}function mr(l,t){l.finalized||(process.env.NODE_ENV!=="production"&&(Ut(l.source,t),l.key&&Ut(l.key,t,!0),l.index&&Ut(l.index,t,!0),l.value&&Ut(l.value,t,!0)),l.finalized=!0)}function So({value:l,key:t,index:n},o=[]){return Qk([l,t,n,...o])}function Qk(l){let t=l.length;for(;t--&&!l[t];);return l.slice(0,t+1).map((n,o)=>n||ye("_".repeat(o+1),!1))}const fr=ye("undefined",!1),Vk=(l,t)=>{if(l.type===1&&(l.tagType===1||l.tagType===3)){const n=tt(l,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},eb=(l,t,n,o)=>Qt(l,n,!1,!0,n.length?n[0].loc:o);function tb(l,t,n=eb){t.helper(fo);const{children:o,loc:a}=l,r=[],s=[];let i=t.scopes.vSlot>0||t.scopes.vFor>0;const c=tt(l,"slot",!0);if(c){const{arg:f,exp:E}=c;f&&!et(f)&&(i=!0),r.push($e(f||ye("default",!0),n(E,void 0,o,a)))}let d=!1,u=!1;const p=[],g=new Set;let y=0;for(let f=0;f<o.length;f++){const E=o[f];let C;if(!sl(E)||!(C=tt(E,"slot",!0))){E.type!==3&&p.push(E);continue}if(c){t.onError(Se(37,C.loc));break}d=!0;const{children:_,loc:b}=E,{arg:x=ye("default",!0),exp:D,loc:S}=C;let M;et(x)?M=x?x.content:"default":i=!0;const O=tt(E,"for"),K=n(D,O,_,b);let U,R;if(U=tt(E,"if"))i=!0,s.push(vo(U.exp,vl(x,K,y++),fr));else if(R=tt(E,/^else(-if)?$/,!0)){let q=f,N;for(;q--&&(N=o[q],!(N.type!==3&&Mo(N))););if(N&&sl(N)&&tt(N,/^(else-)?if$/)){let j=s[s.length-1];for(;j.alternate.type===19;)j=j.alternate;j.alternate=R.exp?vo(R.exp,vl(x,K,y++),fr):vl(x,K,y++)}else t.onError(Se(30,R.loc))}else if(O){i=!0;const q=O.forParseResult;q?(mr(q,t),s.push(Oe(t.helper(so),[q.source,Qt(So(q),vl(x,K),!0)]))):t.onError(Se(32,O.loc))}else{if(M){if(g.has(M)){t.onError(Se(38,S));continue}g.add(M),M==="default"&&(u=!0)}r.push($e(x,K))}}if(!c){const f=(E,C)=>{const _=n(E,void 0,C,a);return t.compatConfig&&(_.isNonScopedSlot=!0),$e("default",_)};d?p.length&&p.some(E=>Mo(E))&&(u?t.onError(Se(39,p[0].loc)):r.push(f(void 0,p))):r.push(f(void 0,o))}const w=i?2:gl(l.children)?3:1;let m=ct(r.concat($e("_",ye(w+(process.env.NODE_ENV!=="production"?` /* ${C1[w]} */`:""),!1))),a);return s.length&&(m=Oe(t.helper($a),[m,Rt(s)])),{slots:m,hasDynamicSlots:i}}function vl(l,t,n){const o=[$e("name",l),$e("fn",t)];return n!=null&&o.push($e("key",ye(String(n),!0))),ct(o)}function gl(l){for(let t=0;t<l.length;t++){const n=l[t];switch(n.type){case 1:if(n.tagType===2||gl(n.children))return!0;break;case 9:if(gl(n.branches))return!0;break;case 10:case 11:if(gl(n.children))return!0;break}}return!1}function Mo(l){return l.type!==2&&l.type!==12?!0:l.type===2?!!l.content.trim():Mo(l.content)}const hr=new WeakMap,nb=(l,t)=>function(){if(l=t.currentNode,!(l.type===1&&(l.tagType===0||l.tagType===1)))return;const{tag:o,props:a}=l,r=l.tagType===1;let s=r?lb(l,t):`"${o}"`;const i=b1(s)&&s.callee===lo;let c,d,u=0,p,g,y,w=i||s===hn||s===Ql||!r&&(o==="svg"||o==="foreignObject"||o==="math");if(a.length>0){const m=vr(l,t,void 0,r,i);c=m.props,u=m.patchFlag,g=m.dynamicPropNames;const f=m.directives;y=f&&f.length?Rt(f.map(E=>ab(E,t))):void 0,m.shouldUseBlock&&(w=!0)}if(l.children.length>0)if(s===tl&&(w=!0,u|=1024,process.env.NODE_ENV!=="production"&&l.children.length>1&&t.onError(Se(46,{start:l.children[0].loc.start,end:l.children[l.children.length-1].loc.end,source:""}))),r&&s!==hn&&s!==tl){const{slots:f,hasDynamicSlots:E}=tb(l,t);d=f,E&&(u|=1024)}else if(l.children.length===1&&s!==hn){const f=l.children[0],E=f.type,C=E===5||E===8;C&&st(f,t)===0&&(u|=1),C||E===2?d=f:d=l.children}else d=l.children;g&&g.length&&(p=rb(g)),l.codegenNode=kn(t,s,c,d,u===0?void 0:u,p,y,!!w,!1,r,l.loc)};function lb(l,t,n=!1){let{tag:o}=l;const a=Ao(o),r=bn(l,"is",!1,!0);if(r)if(a||Mt("COMPILER_IS_ON_ELEMENT",t)){let i;if(r.type===6?i=r.value&&ye(r.value.content,!0):(i=r.exp,i||(i=ye("is",!1,r.arg.loc))),i)return Oe(t.helper(lo),[i])}else r.type===6&&r.value.content.startsWith("vue:")&&(o=r.value.content.slice(4));const s=za(o)||t.isBuiltInComponent(o);return s?(n||t.helper(s),s):(t.helper(no),t.components.add(o),xn(o,"component"))}function vr(l,t,n=l.props,o,a,r=!1){const{tag:s,loc:i,children:c}=l;let d=[];const u=[],p=[],g=c.length>0;let y=!1,w=0,m=!1,f=!1,E=!1,C=!1,_=!1,b=!1;const x=[],D=K=>{d.length&&(u.push(ct(gr(d),i)),d=[]),K&&u.push(K)},S=()=>{t.scopes.vFor>0&&d.push($e(ye("ref_for",!0),ye("true")))},M=({key:K,value:U})=>{if(et(K)){const R=K.content,q=Yl(R);if(q&&(!o||a)&&R.toLowerCase()!=="onclick"&&R!=="onUpdate:modelValue"&&!Sa(R)&&(C=!0),q&&Sa(R)&&(b=!0),q&&U.type===14&&(U=U.arguments[0]),U.type===20||(U.type===4||U.type===8)&&st(U,t)>0)return;R==="ref"?m=!0:R==="class"?f=!0:R==="style"?E=!0:R!=="key"&&!x.includes(R)&&x.push(R),o&&(R==="class"||R==="style")&&!x.includes(R)&&x.push(R)}else _=!0};for(let K=0;K<n.length;K++){const U=n[K];if(U.type===6){const{loc:R,name:q,nameLoc:N,value:j}=U;let $=!0;if(q==="ref"&&(m=!0,S()),q==="is"&&(Ao(s)||j&&j.content.startsWith("vue:")||Mt("COMPILER_IS_ON_ELEMENT",t)))continue;d.push($e(ye(q,!0,N),ye(j?j.content:"",$,j?j.loc:R)))}else{const{name:R,arg:q,exp:N,loc:j,modifiers:$}=U,Z=R==="bind",V=R==="on";if(R==="slot"){o||t.onError(Se(40,j));continue}if(R==="once"||R==="memo"||R==="is"||Z&&At(q,"is")&&(Ao(s)||Mt("COMPILER_IS_ON_ELEMENT",t))||V&&r)continue;if((Z&&At(q,"key")||V&&g&&At(q,"vue:before-update"))&&(y=!0),Z&&At(q,"ref")&&S(),!q&&(Z||V)){if(_=!0,N)if(Z){if(D(),process.env.NODE_ENV!=="production"&&u.some(H=>H.type===15?H.properties.some(({key:ie})=>ie.type!==4||!ie.isStatic?!0:ie.content!=="class"&&ie.content!=="style"&&!Yl(ie.content)):!0)&&tn("COMPILER_V_BIND_OBJECT_ORDER",t,j),Mt("COMPILER_V_BIND_OBJECT_ORDER",t)){u.unshift(N);continue}S(),D(),u.push(N)}else D({type:14,loc:j,callee:t.helper(uo),arguments:o?[N]:[N,"true"]});else t.onError(Se(Z?34:35,j));continue}Z&&$.some(ee=>ee.content==="prop")&&(w|=32);const oe=t.directiveTransforms[R];if(oe){const{props:ee,needRuntime:H}=oe(U,l,t);!r&&ee.forEach(M),V&&q&&!et(q)?D(ct(ee,i)):d.push(...ee),H&&(p.push(U),Zl(H)&&hr.set(U,H))}else x1(R)||(p.push(U),g&&(y=!0))}}let O;if(u.length?(D(),u.length>1?O=Oe(t.helper(ll),u,i):O=u[0]):d.length&&(O=ct(gr(d),i)),_?w|=16:(f&&!o&&(w|=2),E&&!o&&(w|=4),x.length&&(w|=8),C&&(w|=32)),!y&&(w===0||w===32)&&(m||b||p.length>0)&&(w|=512),!t.inSSR&&O)switch(O.type){case 15:let K=-1,U=-1,R=!1;for(let j=0;j<O.properties.length;j++){const $=O.properties[j].key;et($)?$.content==="class"?K=j:$.content==="style"&&(U=j):$.isHandlerKey||(R=!0)}const q=O.properties[K],N=O.properties[U];R?O=Oe(t.helper(gn),[O]):(q&&!et(q.value)&&(q.value=Oe(t.helper(io),[q.value])),N&&(E||N.value.type===4&&N.value.content.trim()[0]==="["||N.value.type===17)&&(N.value=Oe(t.helper(co),[N.value])));break;case 14:break;default:O=Oe(t.helper(gn),[Oe(t.helper(yn),[O])]);break}return{props:O,directives:p,patchFlag:w,dynamicPropNames:x,shouldUseBlock:y}}function gr(l){const t=new Map,n=[];for(let o=0;o<l.length;o++){const a=l[o];if(a.key.type===8||!a.key.isStatic){n.push(a);continue}const r=a.key.content,s=t.get(r);s?(r==="style"||r==="class"||Yl(r))&&ob(s,a):(t.set(r,a),n.push(a))}return n}function ob(l,t){l.value.type===17?l.value.elements.push(t.value):l.value=Rt([l.value,t.value],l.loc)}function ab(l,t){const n=[],o=hr.get(l);o?n.push(t.helperString(o)):(t.helper(oo),t.directives.add(l.name),n.push(xn(l.name,"directive")));const{loc:a}=l;if(l.exp&&n.push(l.exp),l.arg&&(l.exp||n.push("void 0"),n.push(l.arg)),Object.keys(l.modifiers).length){l.arg||(l.exp||n.push("void 0"),n.push("void 0"));const r=ye("true",!1,a);n.push(ct(l.modifiers.map(s=>$e(s,r)),a))}return Rt(n,l.loc)}function rb(l){let t="[";for(let n=0,o=l.length;n<o;n++)t+=JSON.stringify(l[n]),n<o-1&&(t+=", ");return t+"]"}function Ao(l){return l==="component"||l==="Component"}const sb=(l,t)=>{if(il(l)){const{children:n,loc:o}=l,{slotName:a,slotProps:r}=ib(l,t),s=[t.prefixIdentifiers?"_ctx.$slots":"$slots",a,"{}","undefined","true"];let i=2;r&&(s[2]=r,i=3),n.length&&(s[3]=Qt([],n,!1,!1,o),i=4),t.scopeId&&!t.slotted&&(i=5),s.splice(i),l.codegenNode=Oe(t.helper(La),s,o)}};function ib(l,t){let n='"default"',o;const a=[];for(let r=0;r<l.props.length;r++){const s=l.props[r];if(s.type===6)s.value&&(s.name==="name"?n=JSON.stringify(s.value.content):(s.name=Bt(s.name),a.push(s)));else if(s.name==="bind"&&At(s.arg,"name")){if(s.exp)n=s.exp;else if(s.arg&&s.arg.type===4){const i=Bt(s.arg.content);n=s.exp=ye(i,!1,s.arg.loc)}}else s.name==="bind"&&s.arg&&et(s.arg)&&(s.arg.content=Bt(s.arg.content)),a.push(s)}if(a.length>0){const{props:r,directives:s}=vr(l,t,a,!1,!1);o=r,s.length&&t.onError(Se(36,s[0].loc))}return{slotName:n,slotProps:o}}const yr=(l,t,n,o)=>{const{loc:a,modifiers:r,arg:s}=l;!l.exp&&!r.length&&n.onError(Se(35,a));let i;if(s.type===4)if(s.isStatic){let p=s.content;process.env.NODE_ENV!=="production"&&p.startsWith("vnode")&&n.onError(Se(51,s.loc)),p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const g=t.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?E1(Bt(p)):`on:${p}`;i=ye(g,!0,s.loc)}else i=mt([`${n.helperString(mo)}(`,s,")"]);else i=s,i.children.unshift(`${n.helperString(mo)}(`),i.children.push(")");let c=l.exp;c&&!c.content.trim()&&(c=void 0);let d=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const p=Ua(c),g=!(p||ek(c)),y=c.content.includes(";");process.env.NODE_ENV!=="production"&&Ut(c,n,!1,y),(g||d&&p)&&(c=mt([`${g?"$event":"(...args)"} => ${y?"{":"("}`,c,y?"}":")"]))}let u={props:[$e(i,c||ye("() => {}",!1,a))]};return o&&(u=o(u)),d&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach(p=>p.key.isHandlerKey=!0),u},cb=(l,t)=>{if(l.type===0||l.type===1||l.type===11||l.type===10)return()=>{const n=l.children;let o,a=!1;for(let r=0;r<n.length;r++){const s=n[r];if(xo(s)){a=!0;for(let i=r+1;i<n.length;i++){const c=n[i];if(xo(c))o||(o=n[r]=mt([s],s.loc)),o.children.push(" + ",c),n.splice(i,1),i--;else{o=void 0;break}}}}if(!(!a||n.length===1&&(l.type===0||l.type===1&&l.tagType===0&&!l.props.find(r=>r.type===7&&!t.directiveTransforms[r.name])&&l.tag!=="template")))for(let r=0;r<n.length;r++){const s=n[r];if(xo(s)||s.type===8){const i=[];(s.type!==2||s.content!==" ")&&i.push(s),!t.ssr&&st(s,t)===0&&i.push(1+(process.env.NODE_ENV!=="production"?` /* ${mn[1]} */`:"")),n[r]={type:12,content:s,loc:s.loc,codegenNode:Oe(t.helper(to),i)}}}}},kr=new WeakSet,db=(l,t)=>{if(l.type===1&&tt(l,"once",!0))return kr.has(l)||t.inVOnce||t.inSSR?void 0:(kr.add(l),t.inVOnce=!0,t.helper(ol),()=>{t.inVOnce=!1;const n=t.currentNode;n.codegenNode&&(n.codegenNode=t.cache(n.codegenNode,!0,!0))})},br=(l,t,n)=>{const{exp:o,arg:a}=l;if(!o)return n.onError(Se(41,l.loc)),yl();const r=o.loc.source.trim(),s=o.type===4?o.content:r,i=n.bindingMetadata[r];if(i==="props"||i==="props-aliased")return n.onError(Se(44,o.loc)),yl();if(!s.trim()||!Ua(o))return n.onError(Se(42,o.loc)),yl();const c=a||ye("modelValue",!0),d=a?et(a)?`onUpdate:${Bt(a.content)}`:mt(['"onUpdate:" + ',a]):"onUpdate:modelValue";let u;const p=n.isTS?"($event: any)":"$event";u=mt([`${p} => ((`,o,") = $event)"]);const g=[$e(c,l.exp),$e(d,u)];if(l.modifiers.length&&t.tagType===1){const y=l.modifiers.map(m=>m.content).map(m=>(bo(m)?m:JSON.stringify(m))+": true").join(", "),w=a?et(a)?`${a.content}Modifiers`:mt([a,' + "Modifiers"']):"modelModifiers";g.push($e(w,ye(`{ ${y} }`,!1,l.loc,2)))}return yl(g)};function yl(l=[]){return{props:l}}const ub=/[\w).+\-_$\]]/,pb=(l,t)=>{Mt("COMPILER_FILTERS",t)&&(l.type===5?kl(l.content,t):l.type===1&&l.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&kl(n.exp,t)}))};function kl(l,t){if(l.type===4)xr(l,t);else for(let n=0;n<l.children.length;n++){const o=l.children[n];typeof o=="object"&&(o.type===4?xr(o,t):o.type===8?kl(l,t):o.type===5&&kl(o.content,t))}}function xr(l,t){const n=l.content;let o=!1,a=!1,r=!1,s=!1,i=0,c=0,d=0,u=0,p,g,y,w,m=[];for(y=0;y<n.length;y++)if(g=p,p=n.charCodeAt(y),o)p===39&&g!==92&&(o=!1);else if(a)p===34&&g!==92&&(a=!1);else if(r)p===96&&g!==92&&(r=!1);else if(s)p===47&&g!==92&&(s=!1);else if(p===124&&n.charCodeAt(y+1)!==124&&n.charCodeAt(y-1)!==124&&!i&&!c&&!d)w===void 0?(u=y+1,w=n.slice(0,y).trim()):f();else{switch(p){case 34:a=!0;break;case 39:o=!0;break;case 96:r=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:i++;break;case 125:i--;break}if(p===47){let E=y-1,C;for(;E>=0&&(C=n.charAt(E),C===" ");E--);(!C||!ub.test(C))&&(s=!0)}}w===void 0?w=n.slice(0,y).trim():u!==0&&f();function f(){m.push(n.slice(u,y).trim()),u=y+1}if(m.length){for(process.env.NODE_ENV!=="production"&&rl("COMPILER_FILTERS",t,l.loc),y=0;y<m.length;y++)w=mb(w,m[y],t);l.content=w,l.ast=void 0}}function mb(l,t,n){n.helper(ao);const o=t.indexOf("(");if(o<0)return n.filters.add(t),`${xn(t,"filter")}(${l})`;{const a=t.slice(0,o),r=t.slice(o+1);return n.filters.add(a),`${xn(a,"filter")}(${l}${r!==")"?","+r:r}`}}const wr=new WeakSet,fb=(l,t)=>{if(l.type===1){const n=tt(l,"memo");return!n||wr.has(l)?void 0:(wr.add(l),()=>{const o=l.codegenNode||t.currentNode.codegenNode;o&&o.type===13&&(l.tagType!==1&&go(o,t),l.codegenNode=Oe(t.helper(ho),[n.exp,Qt(void 0,o),"_cache",String(t.cached.length)]),t.cached.push(null))})}};function hb(l){return[[db,Wk,fb,Jk,pb,...process.env.NODE_ENV!=="production"?[qk]:[],sb,nb,Vk,cb],{on:yr,bind:Zk,model:br}]}function vb(l,t={}){const n=t.onError||ko,o=t.mode==="module";t.prefixIdentifiers===!0?n(Se(47)):o&&n(Se(48));const a=!1;t.cacheHandlers&&n(Se(49)),t.scopeId&&!o&&n(Se(50));const r=Nt({},t,{prefixIdentifiers:a}),s=Pe(l)?yk(l,r):l,[i,c]=hb();return wk(s,Nt({},r,{nodeTransforms:[...i,...t.nodeTransforms||[]],directiveTransforms:Nt({},c,t.directiveTransforms||{})})),Nk(s,r)}const gb=()=>({props:[]});/**
161
161
  * @vue/compiler-dom v3.5.18
162
162
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
163
163
  * @license MIT
164
- **/const wr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Er=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),Cr=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),_r=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Do=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Nr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Br=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Sr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),To=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Mr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");z1({[wr]:"vModelRadio",[Er]:"vModelCheckbox",[Cr]:"vModelText",[_r]:"vModelSelect",[Do]:"vModelDynamic",[Nr]:"withModifiers",[Br]:"withKeys",[Sr]:"vShow",[To]:"Transition",[Mr]:"TransitionGroup"});let nn;function vb(l,t=!1){return nn||(nn=document.createElement("div")),t?(nn.innerHTML=`<div foo="${l.replace(/"/g,"&quot;")}">`,nn.children[0].getAttribute("foo")):(nn.innerHTML=l,nn.textContent)}const gb={parseMode:"html",isVoidTag:$1,isNativeTag:l=>D1(l)||T1(l)||L1(l),isPreTag:l=>l==="pre",isIgnoreNewlineTag:l=>l==="pre"||l==="textarea",decodeEntities:vb,isBuiltInComponent:l=>{if(l==="Transition"||l==="transition")return To;if(l==="TransitionGroup"||l==="transition-group")return Mr},getNamespace(l,t,n){let o=t?t.ns:n;if(t&&o===2)if(t.tag==="annotation-xml"){if(l==="svg")return 1;t.props.some(a=>a.type===6&&a.name==="encoding"&&a.value!=null&&(a.value.content==="text/html"||a.value.content==="application/xhtml+xml"))&&(o=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&l!=="mglyph"&&l!=="malignmark"&&(o=0);else t&&o===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(o=0);if(o===0){if(l==="svg")return 1;if(l==="math")return 2}return o}},yb=l=>{l.type===1&&l.props.forEach((t,n)=>{t.type===6&&t.name==="style"&&t.value&&(l.props[n]={type:7,name:"bind",arg:ye("style",!0,t.loc),exp:kb(t.value.content,t.loc),modifiers:[],loc:t.loc})})},kb=(l,t)=>{const n=N1(l);return ye(JSON.stringify(n),!1,t,3)};function ft(l,t){return Se(l,t,process.env.NODE_ENV!=="production"?bb:void 0)}const bb={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},xb=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(53,a)),t.children.length&&(n.onError(ft(54,a)),t.children.length=0),{props:[$e(ye("innerHTML",!0,a),o||ye("",!0))]}},wb=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(55,a)),t.children.length&&(n.onError(ft(56,a)),t.children.length=0),{props:[$e(ye("textContent",!0),o?st(o,n)>0?o:Oe(n.helperString(nl),[o],a):ye("",!0))]}},Eb=(l,t,n)=>{const o=kr(l,t,n);if(!o.props.length||t.tagType===1)return o;l.arg&&n.onError(ft(58,l.arg.loc));function a(){const i=tt(t,"bind");i&&At(i.arg,"value")&&n.onError(ft(60,i.loc))}const{tag:r}=t,s=n.isCustomElement(r);if(r==="input"||r==="textarea"||r==="select"||s){let i=Cr,c=!1;if(r==="input"||s){const d=bn(t,"type");if(d){if(d.type===7)i=Do;else if(d.value)switch(d.value.content){case"radio":i=wr;break;case"checkbox":i=Er;break;case"file":c=!0,n.onError(ft(59,l.loc));break;default:process.env.NODE_ENV!=="production"&&a();break}}else V1(t)?i=Do:process.env.NODE_ENV!=="production"&&a()}else r==="select"?i=_r:process.env.NODE_ENV!=="production"&&a();c||(o.needRuntime=n.helper(i))}else n.onError(ft(57,l.loc));return o.props=o.props.filter(i=>!(i.key.type===4&&i.key.content==="modelValue")),o},Cb=gt("passive,once,capture"),_b=gt("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Nb=gt("left,right"),Ar=gt("onkeyup,onkeydown,onkeypress"),Bb=(l,t,n,o)=>{const a=[],r=[],s=[];for(let i=0;i<t.length;i++){const c=t[i].content;c==="native"&&tn("COMPILER_V_ON_NATIVE",n,o)||Cb(c)?s.push(c):Nb(c)?et(l)?Ar(l.content.toLowerCase())?a.push(c):r.push(c):(a.push(c),r.push(c)):_b(c)?r.push(c):a.push(c)}return{keyModifiers:a,nonKeyModifiers:r,eventOptionModifiers:s}},Dr=(l,t)=>et(l)&&l.content.toLowerCase()==="onclick"?ye(t,!0):l.type!==4?mt(["(",l,`) === "onClick" ? "${t}" : (`,l,")"]):l,Sb=(l,t,n)=>gr(l,t,n,o=>{const{modifiers:a}=l;if(!a.length)return o;let{key:r,value:s}=o.props[0];const{keyModifiers:i,nonKeyModifiers:c,eventOptionModifiers:d}=Bb(r,a,n,l.loc);if(c.includes("right")&&(r=Dr(r,"onContextmenu")),c.includes("middle")&&(r=Dr(r,"onMouseup")),c.length&&(s=Oe(n.helper(Nr),[s,JSON.stringify(c)])),i.length&&(!et(r)||Ar(r.content.toLowerCase()))&&(s=Oe(n.helper(Br),[s,JSON.stringify(i)])),d.length){const u=d.map(Xl).join("");r=et(r)?ye(`${r.content}${u}`,!0):mt(["(",r,`) + "${u}"`])}return{props:[$e(r,s)]}}),Mb=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(61,a)),{props:[],needRuntime:n.helper(Sr)}},Ab=(l,t)=>{if(l.type===1&&l.tagType===1&&t.isBuiltInComponent(l.tag)===To)return()=>{if(!l.children.length)return;Tr(l)&&t.onError(ft(62,{start:l.children[0].loc.start,end:l.children[l.children.length-1].loc.end,source:""}));const o=l.children[0];if(o.type===1)for(const a of o.props)a.type===7&&a.name==="show"&&l.props.push({type:6,name:"persisted",nameLoc:l.loc,value:void 0,loc:l.loc})}};function Tr(l){const t=l.children=l.children.filter(o=>o.type!==3&&!(o.type===2&&!o.content.trim())),n=t[0];return t.length!==1||n.type===11||n.type===9&&n.branches.some(Tr)}const Db=(l,t)=>{l.type===1&&l.tagType===0&&(l.tag==="script"||l.tag==="style")&&(process.env.NODE_ENV!=="production"&&t.onError(ft(63,l.loc)),t.removeNode())};function Tb(l,t){return l==="template"?!0:l in Lr?Lr[l].has(t):t in $r?$r[t].has(l):!(l in Ir&&Ir[l].has(t)||t in Fr&&Fr[t].has(l))}const ln=new Set(["h1","h2","h3","h4","h5","h6"]),Ht=new Set([]),Lr={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:Ht,iframe:Ht,option:Ht,textarea:Ht,style:Ht,title:Ht},$r={html:Ht,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},Ir={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},Fr={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:ln,h2:ln,h3:ln,h4:ln,h5:ln,h6:ln},Lb=(l,t)=>{if(l.type===1&&l.tagType===0&&t.parent&&t.parent.type===1&&t.parent.tagType===0&&!Tb(t.parent.tag,l.tag)){const n=new SyntaxError(`<${l.tag}> cannot be child of <${t.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);n.loc=l.loc,t.onWarn(n)}},$b=[yb,...process.env.NODE_ENV!=="production"?[Ab,Lb]:[]],Ib={cloak:hb,html:xb,text:wb,model:Eb,on:Sb,show:Mb};function Fb(l,t={}){return fb(l,Nt({},gb,t,{nodeTransforms:[Db,...$b,...t.nodeTransforms||[]],directiveTransforms:Nt({},Ib,t.directiveTransforms||{}),transformHoist:null}))}function Ob(l,t={}){const n=l.trim().startsWith("<")?l:`<span>${l}</span>`,{code:o}=Fb(n,{mode:"function"}),a=new Function("Vue",`${o}; return render;`)(os);return e.defineComponent({name:"DynamicFromString",props:t.props??{},emits:t.emits??[],setup(){return t.setup?.()??{}},render:a})}const Lo={};function Pb(l){return Lo[l]||(Lo[l]=Ob(l,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Lo[l]}const Rb={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},zb={class:"flex items-center gap-2"},jb=["disabled"],Ub={class:"text-sm"},Hb=["disabled"],qb=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(l){const t=l,n=e.computed(()=>t.currentPage<=1),o=e.computed(()=>t.currentPage>=t.totalPages);return(a,r)=>(e.openBlock(),e.createElementBlock("div",Rb,[e.createElementVNode("div",null,e.toDisplayString(a.label),1),e.createElementVNode("div",zb,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:n.value,onClick:r[0]||(r[0]=s=>a.$emit("previous"))}," Назад ",8,jb),e.createElementVNode("span",Ub,"Сторінка "+e.toDisplayString(a.currentPage)+" з "+e.toDisplayString(a.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:r[1]||(r[1]=s=>a.$emit("next"))}," Далі ",8,Hb)])]))}}),Gb={class:"relative inline-flex"},Wb=["aria-label"],Kb={class:"px-3 pb-2"},Yb={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Zb=["onClick"],Jb={class:"truncate"},Xb={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Qb="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",Vb=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(l,{emit:t}){const n=l,o=t,a=e.useAttrs(),r=e.ref(!1),s=e.ref(""),i=e.ref([...n.columns]),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref({top:0,left:0}),g=e.computed(()=>{if(!s.value)return i.value;const _=s.value.toLowerCase();return i.value.filter(b=>y(b).toLowerCase().includes(_))});e.watch(()=>n.columns,_=>{if(!_){i.value=[];return}const b=JSON.stringify(_),x=JSON.stringify(i.value);b!==x&&(i.value=[..._])},{deep:!0}),e.watch(i,_=>{o("update:columns",_)},{deep:!0});function y(_){return _.ua||_.label||_.name||"Колонка"}function w(_){const b=!_.hidden;b&&i.value.filter(x=>!x.hidden).length<=1||(_.hidden=b)}function m(){r.value=!r.value,r.value&&e.nextTick(()=>{u.value?.focus(),f()})}function f(){if(!c.value)return;const _=c.value.getBoundingClientRect();p.value={top:_.bottom+window.scrollY+6,left:_.left+window.scrollX-200}}function E(_){if(!r.value)return;const b=_.target;b&&(d.value?.contains(b)||c.value?.contains(b)||(r.value=!1))}function C(_){_.key==="Escape"&&(r.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E,!0),document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",C)}),(_,b)=>(e.openBlock(),e.createElementBlock("div",Gb,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:m,class:e.normalizeClass([Qb,e.unref(a).class]),"aria-label":e.unref(a)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},b[2]||(b[2]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)]),10,Wb),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${p.value.top}px`,left:`${p.value.left}px`})},[b[5]||(b[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Kb,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":b[0]||(b[0]=x=>s.value=x),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,s.value]])]),e.createElementVNode("div",Yb,[b[4]||(b[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:b[1]||(b[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:D=>w(x)},[e.createElementVNode("span",Jb,e.toDisplayString(y(x)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",x.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[x.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Xb,b[3]||(b[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])))],2)],8,Zb))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),ex=["data-action-key"],tx=["onClick"],nx={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},lx={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ox={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ax={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rx=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(null),r=e.computed(()=>!!n.actions?.length),s=e.ref({scrollX:0,scrollY:0,width:0,height:0}),i=e.ref(!1);function c(){o("toggle")}function d(w){w.handler?.(n.row)}const u=e.computed(()=>{if(!n.isOpen)return{};const w=a.value;if(!w)return{};const m=w.getBoundingClientRect(),f=8,E=160,b=(n.actions?.length??0)*36+f*2,x=s.value.height||(typeof window<"u"?window.innerHeight:0),D=s.value.width||(typeof window<"u"?window.innerWidth:0),S=s.value.scrollX||(typeof window<"u"?window.scrollX:0),M=s.value.scrollY||(typeof window<"u"?window.scrollY:0);let O=m.bottom+M+f,K=m.right+S-E;const U=S+D-E-f;return K>U&&(K=U),K<S+f&&(K=S+f),O+b>M+x-f&&(O=m.top+M-b-f),O<M+f&&(O=M+f),{top:`${O}px`,left:`${K}px`,width:"auto"}});function p(){typeof window>"u"||(s.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function g(){typeof window>"u"||i.value||(i.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function y(){typeof window>"u"||!i.value||(i.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>n.isOpen,w=>{w?g():y()},{immediate:!0}),e.onMounted(()=>{n.isOpen&&g()}),e.onBeforeUnmount(()=>{y()}),(w,m)=>r.value&&w.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":w.actionKey,ref_key:"anchorRef",ref:a},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},m[1]||(m[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[w.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(u.value),onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.actions,f=>(e.openBlock(),e.createElementBlock("button",{key:f.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",f.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:E=>d(f)},[e.renderSlot(w.$slots,"icon",{action:f},()=>[f.type==="view"?(e.openBlock(),e.createElementBlock("svg",nx,m[2]||(m[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))):f.type==="edit"?(e.openBlock(),e.createElementBlock("svg",lx,m[3]||(m[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)]))):f.type==="delete"?(e.openBlock(),e.createElementBlock("svg",ox,m[4]||(m[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",ax,m[5]||(m[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])))]),e.createTextVNode(" "+e.toDisplayString(f.label),1)],10,tx))),128))],4)):e.createCommentVNode("",!0)]))],8,ex)):e.createCommentVNode("",!0)}}),Or=typeof window<"u",Pr=typeof document<"u";function sx(l){if(!Pr)throw new Error("Tooltip requires document to be defined");const t=document.createElement("div");return t.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",t.style.opacity="0",t.style.visibility="hidden",t.style.maxWidth="240px",t.style.whiteSpace="normal",t.style.wordBreak="break-word",document.body.appendChild(t),t}function Rr(l){if(!l)return null;if(typeof l=="string"){const n=l.trim();return n?{text:n,wrap:!0}:null}const t=typeof l.text=="string"&&l.text.trim()?l.text.trim():void 0;return t?{text:t,wrap:l.wrap!==!1}:null}function $o(l,t){if(!Pr||!Or)return;const n=sx(t.wrap),o={options:t,tooltipEl:n,show:a=>{if(!o.options.text||!Or)return;n.textContent=o.options.text;const s=(a.currentTarget??l).getBoundingClientRect(),i=n.getBoundingClientRect(),c=window.innerWidth-i.width-12,d=Math.max(12,Math.min(s.left,c));n.style.left=`${d}px`,n.style.top=`${s.bottom+4}px`,n.style.opacity="1",n.style.visibility="visible"},hide:()=>{n.style.opacity="0",n.style.visibility="hidden"}};l.addEventListener("mouseenter",o.show),l.addEventListener("mouseleave",o.hide),l.addEventListener("focus",o.show),l.addEventListener("blur",o.hide),l.__tooltipState__=o}function Io(l){const t=l.__tooltipState__;t&&(l.removeEventListener("mouseenter",t.show),l.removeEventListener("mouseleave",t.hide),l.removeEventListener("focus",t.show),l.removeEventListener("blur",t.hide),t.tooltipEl.remove(),delete l.__tooltipState__)}const ix={mounted(l,t){const n=Rr(t.value);n&&$o(l,n)},updated(l,t){const n=Rr(t.value),o=l;if(!n){Io(o);return}const a=o.__tooltipState__;if(!a){$o(o,n);return}if(a.options.wrap!==n.wrap){Io(o),$o(o,n);return}a.options=n},unmounted(l){Io(l)}},cx={class:"flex flex-col gap-4 mb-[15px]"},dx={class:"flex flex-wrap items-center gap-4"},ux={class:"relative"},px={class:"ml-auto flex items-center gap-2"},mx={class:"overflow-x-auto"},fx={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},hx={class:"text-left font-medium text-gray-700"},vx={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},gx={class:"divide-y divide-gray-200"},yx=["href"],kx={key:2},bx={key:3},xx={key:0,class:"py-2 pr-4 text-right"},wx={key:0},Ex={key:0},Cx=["colspan"],zr=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(l){const t=e.getCurrentInstance(),n=e.ref([]),o=e.ref([]),a=ix,r=l,s=e.ref([]),i=e.ref(""),c=e.ref(""),d=e.ref(""),u=e.ref(1),p=e.ref(10),g=e.ref(0),y=e.ref(0),w=e.ref("id"),m=e.ref("");let f=null,E=0;const C=e.ref(null);async function _(){const z=u.value,Q=++E,G=new URLSearchParams,W=d.value.trim();W&&G.set("search",W),G.set("page",String(z)),G.set("limit",String(p.value));const ve=`/api/data/${r.token}${G.toString()?`?${G.toString()}`:""}`;let me;try{const A=await fetch(ve);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);me=await A.json()}catch(A){Q===E&&(n.value=[],y.value=0,g.value=0),console.error("Failed to load table data",A);return}if(Q!==E)return;n.value=Array.isArray(me?.rows)?me.rows:[],o.value=R(me?.columns||[]),s.value=Array.isArray(me?.actions)?me.actions:[],i.value=me?.form,c.value=me?.addToken,w.value=typeof me?.pk=="string"&&me.pk?me.pk:w.value,typeof me?.form=="string"&&me.form&&(m.value=me.form.replace(/\.form$/,".table")),J();const Ee=Number(me?.total??me?.count??me?.totalCount),h=Number(me?.filtered??me?.filteredCount);g.value=Number.isFinite(Ee)&&Ee>0?Ee:n.value.length,y.value=Number.isFinite(h)&&h>0?h:Math.max(n.value.length,g.value);const v=Math.max(1,Math.ceil((y.value||n.value.length||1)/p.value));let B=z;typeof me?.page=="number"&&me.page>0&&(B=me.page),B>v&&(B=v),B<1&&(B=1);const k=B!==z;if(u.value=B,k&&y.value>0)return _()}const{$notify:b,$confirm:x,$form:D}=t?.appContext?.config?.globalProperties||{};function S(){if(fe.emitter?.emit){fe.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}_()}async function M(z){typeof D=="function"&&(await D({token:z.token}),S())}async function O(){typeof D=="function"&&(await D({token:c.value}),S())}function K(z){x({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const Q=await fetch(`/api/table/${z.token}`,{method:"DELETE"});if(!Q.ok){const{error:G}=await Q.json();b({title:"Помилка",type:"warning",message:G});return}b({title:"Видаленно",message:"Успішно видалено"}),await _()}})}e.onMounted(async()=>{await _(),fe.emitter?.on?.("updateCard",_)}),e.onBeforeUnmount(()=>{fe.emitter?.off?.("updateCard",_)});function U(z){return typeof z?.format=="string"?z.format.toLowerCase():""}function R(z){const Q=new Map;o.value.forEach(W=>{W?.name&&Q.set(W.name,!!W.hidden)});const G=z.map(W=>{const ve=Q.has(W.name)?Q.get(W.name):!!W.hidden;return{...W,hidden:ve}});return G.length&&!G.some(W=>!W.hidden)&&(G[0].hidden=!1),G}const q=e.computed(()=>{const z=o.value.filter(Q=>!Q.hidden);return z.length?z:o.value}),N=e.computed(()=>{const z=[],Q=new Set;for(const G of s.value){if(typeof G=="string"){if(G==="edit"){const W="row:edit";Q.has(W)||(z.push({key:W,type:"edit",label:"Редагувати",scope:"row",handler:xe}),Q.add(W));continue}if(G==="delete"||G==="del"){const W="row:delete";Q.has(W)||(z.push({key:W,type:"delete",label:"Видалити",scope:"row",handler:F,variant:"danger"}),Q.add(W));continue}if(G==="add"){const W="toolbar:add";Q.has(W)||(z.push({key:W,type:"add",label:"Додати",scope:"toolbar"}),Q.add(W))}continue}if(G&&typeof G=="object"){const W=String(G.name??G.type??"action"),ve=String(G.label??G.title??W),me=G.scope==="toolbar"?"toolbar":"row",Ee=`${me}:${W}`;if(Q.has(Ee))continue;Q.add(Ee),z.push({key:Ee,type:W,label:ve,scope:me,handler:me==="row"?h=>te(G,h):void 0,variant:G.variant==="danger"?"danger":"default",original:G})}}return z}),j=e.computed(()=>N.value.filter(z=>z.scope==="row"&&typeof z.handler=="function")),$=e.computed(()=>N.value.filter(z=>z.scope==="toolbar")),Z=e.computed(()=>j.value.length>0),V=e.computed(()=>$.value.some(z=>z.type==="add")),oe=e.computed(()=>n.value),ee=e.computed(()=>{const z=y.value||oe.value.length,Q=Math.ceil(z/p.value);return Q>0?Q:1}),H=e.computed(()=>{const z=oe.value.length,Q=y.value||z,G=g.value||Q;return`Показано ${z} з ${Q} (усього ${G})`});function ie(){u.value<ee.value&&(u.value+=1,_())}function Y(){u.value>1&&(u.value-=1,_())}e.watch(o,z=>{z?.length&&(z.some(Q=>!Q.hidden)||(z[0].hidden=!1))},{deep:!0});function se(){f&&clearTimeout(f),J(),f=setTimeout(()=>{u.value=1,_()},300)}function ue(z){const Q=w.value||"id",G=z?.token??z?.[Q]??z?.id;return G?String(G):""}function he(z){const Q=q.value[z],G=["py-2",...le(Q)];z===0&&G.push("pl-4");const W=z===q.value.length-1&&!Z.value;return G.push(W?"pr-4":"pr-5"),G.join(" ")}function be(z,Q){const G=["py-2",...le(Q)];U(Q)==="badge"&&G.push("center"),L(Q)==="wrap"?G.push("whitespace-normal","break-words"):G.push("truncate"),z===0&&G.push("pl-4");const W=z===q.value.length-1&&!Z.value;return G.push(W?"pr-4":"pr-5"),G.join(" ")}function L(z){return(typeof z?.overflow=="string"?z.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function le(z){const Q=[],G=Ee=>{if(Ee==null||Ee==="")return;const h=Number(Ee);return Number.isFinite(h)&&h>0?`${h}px`:String(Ee).replace(/\s+/g,"")},W=G(z?.width),ve=G(z?.minWidth),me=G(z?.maxWidth);return W?(Q.push(`min-w-[${W}]`,`max-w-[${W}]`),Q):(Q.push(`min-w-[${ve??"100px"}]`),Q.push(`max-w-[${me??"350px"}]`),Q)}function T(z){if(!j.value.length)return!1;const Q=w.value||"id";return!!(z?.token||z?.[Q]||z?.id)}function P(z){return C.value===ue(z)}function X(z){const Q=ue(z);Q&&(C.value=C.value===Q?null:Q)}function J(){C.value=null}function re(z,Q){const G=Q?.tooltip;if(!G)return;const W=ut(z,Q);let ve,me=Q?.tooltipWrap!==!1;if(typeof G=="string"){const Ee=G.trim();if(!Ee)return;const h=Ee.toLowerCase();if(["true","1","yes"].includes(h))ve=typeof W=="string"?W:String(W??"");else{if(["false","0","no"].includes(h))return;ve=Ee}}else G===!0?ve=W:typeof G=="object"&&(typeof G.text=="string"&&(ve=G.text.trim()),typeof G.wrap=="boolean"&&(me=G.wrap!==!1));if(!ve){if(W==null||W==="")return;ve=String(W)}if(ve.trim())return me?{text:ve,wrap:!0}:ve}function xe(z){J(),M(z)}function F(z){J(),K(z)}async function te(z,Q){J();const G=w.value||"id",W=z.isId?Q?.[G]??Q?.id:Q?.token??Q?.[G]??Q?.id;if(!W){console.warn("Cannot execute action without identifier",z);return}if(z.form&&typeof z.api=="string"&&z.api&&typeof D=="function"){await Ye(z,Q,W);return}if(z.form&&typeof D=="function"){const ve=await _e(z.form,W),me={form:z.form,token:ve?.token??Q?.token??W,schema:ve?.schema,mode:ve?.mode??"edit"};ve?.data!==void 0&&(me.defaultValue=ve.data);try{await D(me),S()}catch(Ee){console.error("Failed to execute form action",Ee)}return}if(typeof z.api=="string"&&z.api){const ve=ae(z.api,W);window.location.href=ve;return}Q?.token&&typeof D=="function"&&(await D({token:Q.token}),S())}function ae(z,Q){return`${z.endsWith("/")?z:`${z}/`}${Q}`}async function _e(z,Q){const G=`/api/form/${z}/${Q}`;try{const W=await fetch(G);if(!W.ok)throw new Error(`Request failed with status ${W.status}`);return await W.json()}catch(W){console.error("Failed to load form config",W),b({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Ae(z){const Q=`/api/template/form/${z}`;try{const G=await fetch(Q);if(!G.ok)throw new Error(`Request failed with status ${G.status}`);return(await G.json())?.schema}catch(G){console.error("Failed to load form template",G);return}}function Re(z){if(z!=null){if(z?.data!==void 0)return z.data;if(z?.defaultValue!==void 0)return z.defaultValue;if(z?.values!==void 0)return z.values;if(typeof z=="object"&&!Array.isArray(z)){const{schema:Q,token:G,mode:W,message:ve,successMessage:me,...Ee}=z;if(Object.keys(Ee).length)return Ee}}}async function Ye(z,Q,G){const W=ae(z.api,G),ve=(typeof z.method=="string"?z.method:"PUT").toUpperCase();let me;try{const A=await fetch(W);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);me=await A.json()}catch(A){console.error("Failed to load action data",A),Qe("Не вдалося отримати дані форми.");return}const Ee=typeof z.form=="string"?z.form.replace(/\.table$/,".form"):void 0,h=me?.schema??(Ee?await Ae(Ee):void 0),v={mode:me?.mode??"edit"};Ee&&(v.form=Ee),h&&(v.schema=h);const B=Re(me);B!==void 0&&(v.defaultValue=B);const k=await D(v);if(k)try{const A=await fetch(W,{method:ve,headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!A.ok){const I=await dt(A),ne=I?.error??I?.message??"Не вдалося зберегти дані.";throw new Error(ne)}ht(`Дані успішно ${v.value==="add"?"збережено":"оновлено"}`),S()}catch(A){console.error("Failed to submit action data",A),Qe("Не вдалося зберегти дані.")}}async function dt(z){try{return await z.json()}catch{return}}function Qe(z){b({title:"Помилка",type:"error",message:z})}function ht(z){b({title:"Успіх",type:"success",message:z})}function ze(z){if(!C.value)return;const Q=z.target;if(!Q)return;const G=Q.closest("[data-action-key]");G&&G.getAttribute("data-action-key")===C.value||J()}e.onMounted(()=>{document.addEventListener("click",ze,!0)}),e.onBeforeUnmount(()=>{f&&clearTimeout(f),document.removeEventListener("click",ze,!0),fe.emitter?.off?.("updateCard",_)});function Le(z,Q){const W=z?.[`${Q.name}_text`];if(Array.isArray(W))return W.length?W.join(", "):"-";if(W!=null&&W!=="")return W;const ve=z?.[Q.name];return Array.isArray(ve)?ve.length?ve.join(", "):"-":ve??"-"}function je(z,Q){const W=z?.[`${Q.name}_data`];if(W&&typeof W=="object")return{text:W.text??W.label??W.name??W.title??"-",color:W.color,textColor:W.textColor};const ve=z?.[`${Q.name}_text`]??z?.[Q.name];return{text:(Array.isArray(ve)?ve.join(", "):ve)??"-"}}function wt(z,Q){const G=je(z,Q);return G.color?{backgroundColor:G.color,color:G.textColor??"#ffffff"}:{}}function ut(z,Q){const G=U(Q);if(G==="badge")return je(z,Q).text;if(G==="select")return Le(z,Q);if(G==="slot")return"-";if(G==="text")return z?.[Q.name]??"-";const W=z?.[`${Q.name}_data`];return W!=null&&typeof W!="object"?W:z?.[`${Q.name}_text`]??z?.[Q.name]??"-"}return(z,Q)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",cx,[e.createElementVNode("div",dx,[e.createElementVNode("div",ux,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Q[0]||(Q[0]=G=>d.value=G),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:se},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",px,[e.createVNode(Vb,{columns:o.value,"onUpdate:columns":Q[1]||(Q[1]=G=>o.value=G)},null,8,["columns"]),V.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:O,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},Q[2]||(Q[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)]))):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",mx,[e.createElementVNode("table",fx,[e.createElementVNode("thead",hx,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(G,W)=>(e.openBlock(),e.createElementBlock("th",{key:G.name,class:e.normalizeClass(he(W))},e.toDisplayString(G.ua),3))),128)),Z.value?(e.openBlock(),e.createElementBlock("th",vx," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",gx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,G=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:G.id??JSON.stringify(G)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(W,ve)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:W.name,class:e.normalizeClass(be(ve,W))},[W.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:W.link.replace("{{id}}",G.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(ut(G,W)),9,yx)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[U(W)==="slot"&&(W.slot?.content||W.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Pb)(W.slot.content||W.slot)),{key:0,data:G,row:G,column:W,value:G?.[W.name]},null,8,["data","row","column","value"])):U(W)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(wt(G,W))},e.toDisplayString(je(G,W).text),5)):U(W)==="select"?(e.openBlock(),e.createElementBlock("span",kx,e.toDisplayString(Le(G,W)),1)):(e.openBlock(),e.createElementBlock("span",bx,e.toDisplayString(ut(G,W)),1))],64))],2)),[[e.unref(a),re(G,W)]])),128)),Z.value?(e.openBlock(),e.createElementBlock("td",xx,[T(G)?(e.openBlock(),e.createElementBlock("div",wx,[e.createVNode(rx,{row:G,actions:j.value,"is-open":P(G),"action-key":ue(G),onToggle:W=>X(G)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),oe.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",Ex,[e.createElementVNode("td",{colspan:q.value.length+(Z.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Cx)]))])])]),e.createVNode(qb,{"current-page":u.value,"total-pages":ee.value,label:H.value,onPrevious:Y,onNext:ie},null,8,["current-page","total-pages","label"])]))}}),_x={class:"p-[20px]"},Nx={class:"flex gap-[6px] mb-5"},Bx={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Sx={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},Mx={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Ax={class:"space-y-8"},Dx={key:0},Tx={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Lx=["onClick"],$x={class:"md:col-span-2"},Ix={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Fx={class:"text-sm text-gray-500 dark:text-neutral-500"},Ox={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Px=["checked","onChange"],Rx={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},zx={class:"md:col-span-2"},jx={class:"font-semibold text-gray-800 dark:text-neutral-200"},Ux=["onClick"],Hx={class:"md:col-span-2"},qx={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Gx={class:"text-sm text-gray-500 dark:text-neutral-500"},Wx={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Kx=["checked","onChange"],bl="uk",xl=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(l){const t=["en","uk","ua"],n=()=>{if(typeof window>"u")return bl;const b=localStorage.language,x=typeof navigator<"u"?navigator.language:bl;return(b||x||bl).split(/[-_]/)[0].toLowerCase()||bl},o=l,a=e.ref(""),r=["view","add","edit","del"],s=e.ref({}),i=e.ref(n()),c=()=>{i.value=n()},d=()=>{const b=[];return i.value&&b.push(i.value),t.forEach(x=>{x&&!b.includes(x)&&b.push(x)}),b.includes("path")||b.push("path"),b},u=b=>{const x=d();for(const D of x){const S=b[D];if(typeof S=="string"&&S.trim())return S}return""};e.onMounted(async()=>{c();const x=await(await fetch(`/api/access-group/${o.id}?tab=vs-group-interface`)).json();x.routes&&x.routes.forEach(D=>{s.value[D.path]=new Set(D.actions)})});const p=(b,x)=>s.value[b]?.has(x)??!1,g=(b,x)=>{s.value[b]||(s.value[b]=new Set),s.value[b].has(x)?s.value[b].delete(x):s.value[b].add(x)},y=(b,x)=>{b.forEach(D=>{D.path&&(s.value[D.path]||(s.value[D.path]=new Set),s.value[D.path].has(x)?s.value[D.path].delete(x):s.value[D.path].add(x))})},w=e.computed(()=>Object.entries(s.value).map(([b,x])=>({path:b,actions:Array.from(x)})).filter(b=>b.actions.length)),m=async()=>{await fetch(`/api/access-group/${o.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:w.value})}),fe.notify({title:"Success!",message:"Permissions saved."})},f=()=>{s.value={}},E=b=>{if(!a.value.trim())return b;const x=a.value.toLowerCase();return b.filter(D=>u(D).toLowerCase().includes(x)||(D.path?.toLowerCase().includes(x)??!1))},C=e.computed(()=>E(o.data.routers.filter(b=>!b.menu))),_=e.computed(()=>o.data.routers.filter(b=>b.menu).map(b=>({...b,menu:E(b.menu||[])})).filter(b=>b.menu&&b.menu.length>0));return(b,x)=>(e.openBlock(),e.createElementBlock("div",_x,[e.createElementVNode("div",Nx,[e.createElementVNode("div",Bx,[x[1]||(x[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":x[0]||(x[0]=D=>a.value=D),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("button",{onClick:f,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:m,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Sx,[x[2]||(x[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(D,S)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:S},[e.createElementVNode("h3",Mx,e.toDisplayString(D),1)])),64))]),e.createElementVNode("div",Ax,[C.value.length?(e.openBlock(),e.createElementBlock("div",Dx,[e.createElementVNode("ul",Tx,[x[3]||(x[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(D,S)=>e.createElementVNode("li",{key:S,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:M=>y(C.value,r[S])}," Toggle all ",8,Lx)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(D,S)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+S,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",$x,[e.createElementVNode("p",Ix,e.toDisplayString(u(D)),1),e.createElementVNode("p",Fx,e.toDisplayString(D.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(M,O)=>e.createElementVNode("li",{key:O,class:"col-span-1"},[e.createElementVNode("div",Ox,[e.createElementVNode("input",{type:"checkbox",checked:p(D.path,M),onChange:K=>g(D.path,M),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Px)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(D,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"space-y-5"},[e.createElementVNode("ul",Rx,[e.createElementVNode("li",zx,[e.createElementVNode("h3",jx,e.toDisplayString(u(D)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(M,O)=>e.createElementVNode("li",{key:O,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:K=>y(D.menu,r[O])}," Toggle all ",8,Ux)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.menu,(M,O)=>(e.openBlock(),e.createElementBlock("ul",{key:O,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Hx,[e.createElementVNode("p",qx,e.toDisplayString(u(M)),1),e.createElementVNode("p",Gx,e.toDisplayString(M.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(K,U)=>e.createElementVNode("li",{key:U,class:"col-span-1"},[e.createElementVNode("div",Wx,[e.createElementVNode("input",{type:"checkbox",checked:p(M.path,K),onChange:R=>g(M.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Kx)])])),64))]))),128))]))),128))])]))}}),qt={"vs-widget-comments":Tn,"vs-widget-history":Ln,"vs-widget-gallery":In,"vs-widget-file":$n,"vs-widget-list":Dl,"vs-widget-map":Vn,"vs-widget-table":zr,"vs-group-interface":xl};function jr(l){if(l==null)return null;const t=Number(l);return Number.isFinite(t)?Math.max(1,Math.min(12,Math.floor(t))):null}function Ur(l){const t={...l};return Array.isArray(l.items)&&(t.items=l.items.map(n=>Ur(n))),t}function Yx(l,t=12){if(!l.length)return;const n=[],o=[];if(l.forEach(c=>{const d=jr(c.col);d?(c.col=d,n.push({item:c,span:d})):o.push(c)}),!n.length&&o.length){o.forEach(c=>{c.col=12});return}const a=n.reduce((c,d)=>c+d.span,0);let r=t-a;if(o.length===0)return;r<=0&&(r=t);const s=Math.max(1,Math.floor(r/o.length));let i=Math.max(0,r-s*o.length);o.forEach(c=>{let d=s;i>0&&(d+=1,i-=1),c.col=Math.max(1,Math.min(12,d))})}function wl(l,t=12){if(!Array.isArray(l)||!l.length)return[];const n=l.map(o=>Ur(o));return n.forEach(o=>{Array.isArray(o.items)&&o.items.length&&(o.items=wl(o.items,12))}),Yx(n,t),n}function Hr(l){const t=jr(l);return t?t>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${t}`,`lg:col-span-${t}`]:[]}const Zx={class:"text-lg font-semibold text-gray-900"},Jx=["innerHTML"],Xx={key:0,class:"grid grid-cols-12 gap-4"},Qx={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Vx={class:"text-lg font-semibold text-gray-900"},ew=["innerHTML"],Cn=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(l){const t=l,n=e.computed(()=>{if(!t.col)return{};const d=Math.max(1,Math.min(12,Number(t.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),o=e.computed(()=>wl(t.items));function a(d){const u=["col-span-12"],p=Hr(d.col);return p.length&&u.push(...p),u}function r(d){return qt[d]||d}function s(d,u){if(!d||typeof u!="string"||!u)return{found:!1,value:void 0};const p=u.split(".");let g=d;for(const y of p){if(g==null||typeof g!="object"&&!Array.isArray(g))return{found:!1,value:void 0};if(!(y in g))return{found:!1,value:void 0};g=g[y]}return{found:!0,value:g}}const i=function(d={}){const u={...d};return Object.entries(u).forEach(([p,g])=>{if(p!=="props"&&typeof g=="string"){const y=s(t.data,g);y.found&&(u[p]=y.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,g])=>{if(typeof g=="string"){const y=s(t.data,g);u[p]=y.found?y.value:g}else u[p]=g}),delete u.props,u},c=e.computed(()=>{const d={};return t.col&&(d.col=t.col),d});return(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[n.value,d.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!d.hideTitle&&d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",d.styling?.classItemTitle])},[e.createElementVNode("h3",Zx,e.toDisplayString(d.title),1)],2)):e.createCommentVNode("",!0),d.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.html,class:"text-gray-900 leading-relaxed"},null,8,Jx)):d.type?.includes("tabs")?(e.openBlock(),e.createBlock(_n,{key:2,view:d.type,panels:d.items,data:d.data,styling:d.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o.value.length?(e.openBlock(),e.createElementBlock("div",Xx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||g,class:e.normalizeClass(a(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",Qx,[e.createElementVNode("h3",Vx,e.toDisplayString(p.title||p.label),1)])):e.createCommentVNode("",!0),p.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:p.html,class:"text-gray-900 leading-relaxed"},null,8,ew)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:d.data.geom,id:d.data.id,...c.value,...i(p),data:d.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),tw={class:"grid grid-cols-12 gap-[20px]"},nw={key:0,class:"col-span-4"},lw=["innerHTML"],ow=["onClick"],aw=["innerHTML"],rw={key:1,class:"flex w-full"},sw={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},iw=["onClick"],cw={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},dw={class:"flex-1 p-4"},uw=["innerHTML"],pw={class:"grid grid-cols-12 gap-4"},mw={key:3,class:"w-full h-full"},_n=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(l){const t=l;function n(){const N=typeof window<"u"?window:globalThis,j="__vsCardAnonymousCounter__",$=N[j]??0;return N[j]=$+1,$===0?"tab":`tab${$}`}const o=e.ref(0),a=e.ref([]);let r=!1,s=!1;const i=e.ref(t.id??n());e.watch(()=>t.id,N=>{N&&(i.value=N)});const c=new Map,d=e.computed(()=>t.view==="tabs"||t.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function u(N,j){const $=j?.path;return $?(c.has($)||c.set($,e.defineAsyncComponent(()=>import($))),c.get($)):typeof N=="string"&&qt[N]?qt[N]:j?.component&&qt[j.component]?qt[j.component]:j?.name&&qt[j.name]?qt[j.name]:N}function p(N){return N.forEach(j=>{j.type&&(j.view=j.type)}),a.value=N.filter(j=>j.type==="pin"),N.filter(j=>j.type!=="pin")}const g=e.computed(()=>{let N;return t.panels&&t.panels.length>0?N=t.normalizeTabs?p(t.panels):t.panels:t.data&&Array.isArray(t.data)&&(N=t.data.filter($=>$.type.includes("tabs"))[0]?.items),wl(N,12)}),y=e.computed(()=>i.value);function w(){s||(s=!0)}const m=e.computed(()=>{let N;return t.panels&&t.panels.length>0?N=t.normalizeTabs?p(t.panels):t.panels:t.data&&Array.isArray(t.data)&&(N=t.data),wl(N,12)}),f=e.computed(()=>({[`view-${t.view}`]:!0}));function E(N,j){if(!N||typeof j!="string"||!j)return{found:!1,value:void 0};const $=j.split(".");let Z=N;for(const V of $){if(Z==null||typeof Z!="object"&&!Array.isArray(Z))return{found:!1,value:void 0};if(!(V in Z))return{found:!1,value:void 0};Z=Z[V]}return{found:!0,value:Z}}const C=N=>{const j={...N};return Object.entries(j).forEach(([$,Z])=>{if($!=="props"&&typeof Z=="string"){const V=E(t.data,Z);V.found&&(j[$]=V.value)}}),N.props&&typeof N.props=="object"&&Object.entries(N.props).forEach(([$,Z])=>{if(typeof Z=="string"){const V=E(t.data,Z);j[$]=V.found?V.value:Z}else j[$]=Z}),delete j.props,t.data&&(j.data=t.data),j};function _(N){const j=["col-span-12"],$=Hr(N.col);return $.length&&j.push(...$),j}const b=e.ref([]),x=e.ref([]),D=e.ref([]);function S(N,j){N&&N instanceof HTMLElement&&(b.value[j]=N)}function M(){x.value=b.value.map(N=>N.offsetWidth),D.value=b.value.map(N=>N.offsetLeft)}function O(){if(typeof window>"u")return null;const N=y.value;if(!N)return null;const $=new URL(window.location.href).searchParams.get(N);if($===null)return null;const Z=Number.parseInt($,10);return Number.isNaN(Z)?null:Z}function K(N){if(typeof window>"u")return;const j=y.value;if(!j||!s)return;const $=new URL(window.location.href);N<=0?$.searchParams.delete(j):$.searchParams.set(j,String(N));const Z=window.history.state??{};window.history.replaceState(Z,document.title,$)}function U(){if(r||!g.value.length)return;w();const N=O();if(N===null)return;const j=Math.min(Math.max(N,0),g.value.length-1);j!==N&&K(j),j!==o.value&&(o.value=j),r=!0}function R(){r=!1,U()}let q=null;return e.onMounted(()=>{e.nextTick(()=>{U(),M()}),typeof window<"u"&&window.addEventListener("popstate",R),q=new ResizeObserver(()=>M()),q.observe(document.body)}),e.onBeforeUnmount(()=>{q?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",R)}),e.watch(o,N=>{e.nextTick(()=>{M()}),K(N)}),e.watch(g,()=>{r=!1,U()}),(N,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(N.classWrapper||f.value)},[e.createElementVNode("div",tw,[a.value.length!==0?(e.openBlock(),e.createElementBlock("div",nw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value[0].items,($,Z)=>(e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,lw)):$.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component,$)),e.mergeProps({key:1,ref_for:!0},$.component==="Card"?$:C($),{id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value.length!==0?"col-span-8":"col-span-12")},[N.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",N.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",N.styling?.classTabHeader])},[x.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:x.value[o.value]+"px",left:D.value[o.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>(e.openBlock(),e.createElementBlock("button",{key:$.name||Z,ref_for:!0,ref:V=>S(V,Z),onClick:V=>o.value=Z,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",o.value===Z?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString($.title||$.label||$.name||`Tab ${Z+1}`),11,ow))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([N.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",o.value===Z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",N.classPanel||"w-full border-gray-100"])},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,aw)):N.$slots[`tab-${Z}`]?e.renderSlot(N.$slots,`tab-${Z}`,{key:1,item:$,data:N.data}):$.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:2,ref_for:!0},C($),{items:$.items,"hide-title":!0,class:["w-full h-full",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component||$.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component||$.name,$)),e.mergeProps({key:3,ref_for:!0},$.component==="Card"?$:C($),{styling:N.styling,id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(N.$slots,$.slot||`tab-${Z}`,{key:4,item:$,data:N.data})],2)),[[e.vShow,o.value===Z]])),128))],2)],2)):N.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",rw,[e.createElementVNode("div",sw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>(e.openBlock(),e.createElementBlock("button",{key:$.name||Z,onClick:V=>o.value=Z,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",o.value===Z?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString($.title||$.label||$.name||`Tab ${Z+1}`)+" ",1),o.value===Z?(e.openBlock(),e.createElementBlock("span",cw,j[0]||(j[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,iw))),128))]),e.createElementVNode("div",dw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",o.value===Z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",N.classPanel||"w-full border-gray-100 py-2"])},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,uw)):N.$slots[`tab-${Z}`]?e.renderSlot(N.$slots,`tab-${Z}`,{key:1,item:$,data:N.data}):$.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:2,ref_for:!0},C($),{items:$.items,"hide-title":!0,class:["w-full h-full",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component||$.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component||$.name,$)),e.mergeProps({key:3,ref_for:!0},$.component==="Card"?$:C($),{id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(N.$slots,$.slot||`tab-${Z}`,{key:4,item:$,data:N.data})],2)),[[e.vShow,o.value===Z]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(N.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",pw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,Z)=>(e.openBlock(),e.createElementBlock("div",{key:$.name||$.component||Z,class:e.normalizeClass(_($))},[N.$slots[`panel-${Z}`]?e.renderSlot(N.$slots,`panel-${Z}`,{key:0,item:$,data:N.data}):$.items||$.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:1,ref_for:!0},C($),{items:$.items||[],class:["w-full h-auto",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component,$)),e.mergeProps({key:2,ref_for:!0},C($),{class:["w-full h-auto",[N.styling?.classItem]],styling:N.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",mw,[e.renderSlot(N.$slots,$.slot||`panel-${Z}`,{item:$,data:N.data})]))],2))),128))])],2))],2)])],2))}}),fw=["onClick"],qr=_t(e.defineComponent({__name:"CopyNotification",setup(l,{expose:t}){const n=e.ref([]);let o=1;const a=()=>{if(n.value.length>=10){const i=n.value[0];clearTimeout(i.timer),n.value.shift()}const s={id:o++,timer:setTimeout(()=>{r(s.id)},1500)};n.value.push(s)},r=s=>{const i=n.value.findIndex(c=>c.id===s);if(i!==-1){const c=n.value[i];clearTimeout(c.timer),n.value.splice(i,1)}};return t({addNotification:a}),e.onUnmounted(()=>{n.value.forEach(s=>{clearTimeout(s.timer)})}),(s,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(us),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),i[0]||(i[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>r(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Ml),{class:"h-4 w-4"})],8,fw)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);_n.install=function(l){l.component("vs-widget-file",$n),l.component("vs-widget-comments",Tn),l.component("vs-widget-history",Ln),l.component("vs-widget-gallery",In),l.component("vs-widget-map",Vn),l.component("vs-group-interface",xl),l.component("CommentsWidget",Tn),l.component("HistoryWidget",Ln),l.component("GalleryWidget",In),l.component("FilesWidget",$n),l.component("MapWidget",Vn),l.component("Card",_n),l.component("CardItem",Cn),l.component("DescriptionListWidget",Dl),l.component("CopyNotification",qr),l.component("GroupInterfaceWidget",xl)};function Tt(l){return typeof l=="string"||l instanceof String}function Gr(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function Wr(l,t){return Array.isArray(t)?Wr(l,(n,o)=>t.includes(o)):Object.entries(l).reduce((n,o)=>{let[a,r]=o;return t(r,a)&&(n[a]=r),n},{})}const de={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Kr(l){switch(l){case de.LEFT:return de.FORCE_LEFT;case de.RIGHT:return de.FORCE_RIGHT;default:return l}}function Fo(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function El(l,t){if(t===l)return!0;const n=Array.isArray(t),o=Array.isArray(l);let a;if(n&&o){if(t.length!=l.length)return!1;for(a=0;a<t.length;a++)if(!El(t[a],l[a]))return!1;return!0}if(n!=o)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const r=t instanceof Date,s=l instanceof Date;if(r&&s)return t.getTime()==l.getTime();if(r!=s)return!1;const i=t instanceof RegExp,c=l instanceof RegExp;if(i&&c)return t.toString()==l.toString();if(i!=c)return!1;const d=Object.keys(t);for(a=0;a<d.length;a++)if(!Object.prototype.hasOwnProperty.call(l,d[a]))return!1;for(a=0;a<d.length;a++)if(!El(l[d[a]],t[d[a]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class hw{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?de.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?de.RIGHT:de.LEFT}}function ge(l,t){return new ge.InputMask(l,t)}function Yr(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ge.MaskedRegExp:Tt(l)?ge.MaskedPattern:l===Date?ge.MaskedDate:l===Number?ge.MaskedNumber:Array.isArray(l)||l===Array?ge.MaskedDynamic:ge.Masked&&l.prototype instanceof ge.Masked?l:ge.Masked&&l instanceof ge.Masked?l.constructor:l instanceof Function?ge.MaskedFunction:(console.warn("Mask not found for mask",l),ge.Masked)}function on(l){if(!l)throw new Error("Options in not defined");if(ge.Masked){if(l.prototype instanceof ge.Masked)return{mask:l};const{mask:t=void 0,...n}=l instanceof ge.Masked?{mask:l}:Gr(l)&&l.mask instanceof ge.Masked?l:{};if(t){const o=t.mask;return{...Wr(t,(a,r)=>!r.startsWith("_")),mask:t.constructor,_mask:o,...n}}}return Gr(l)?{...l}:{mask:l}}function kt(l){if(ge.Masked&&l instanceof ge.Masked)return l;const t=on(l),n=Yr(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}ge.createMask=kt;class Cl{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch{}}get isActive(){return!1}}ge.MaskElement=Cl;const Zr=90,vw=89;class Nn extends Cl{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,o;return(t=(n=(o=this.input).getRootNode)==null?void 0:n.call(o))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Zr&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===vw&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Zr&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ge.HTMLMaskElement=Nn;class Jr extends Nn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}ge.HTMLMaskElement=Nn;class Oo extends Nn{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),o=n&&n.anchorOffset,a=n&&n.focusOffset;return a==null||o==null||o<a?o:a}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),o=n&&n.anchorOffset,a=n&&n.focusOffset;return a==null||o==null||o>a?o:a}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const o=this.rootElement.createRange();o.setStart(this.input.firstChild||this.input,t),o.setEnd(this.input.lastChild||this.input,n);const a=this.rootElement,r=a.getSelection&&a.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ge.HTMLContenteditableMaskElement=Oo;class _l{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>_l.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}_l.MAX_LENGTH=100;class Xr{constructor(t,n){this.el=t instanceof Cl?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Oo(t):new Jr(t),this.masked=kt(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new _l,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ge.Masked)&&this.masked.constructor===Yr(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof ge.Masked?t:kt({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const o=this._listeners[t];o&&o.forEach(a=>a(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,o=this.masked.value,a=this.masked.rawInputValue,r=this.displayValue,s=this.unmaskedValue!==n||this.value!==o||this._rawInputValue!==a;this._unmaskedValue=n,this._value=o,this._rawInputValue=a,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...o}=t,a=!this.maskEquals(n),r=this.masked.optionsIsChanged(o);a&&(this.mask=n),r&&this.masked.updateOptions(o),(a||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,de.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const o=this._listeners[t].indexOf(n);return o>=0&&this._listeners[t].splice(o,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new hw({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),o=this.masked.rawInputValue,a=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,r=o===this.masked.rawInputValue?n.removeDirection:de.NONE;let s=this.masked.nearestInputPos(n.startChangePos+a,r);r!==de.NONE&&(s=this.masked.nearestInputPos(s,de.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ge.InputMask=Xr;class ke{static normalize(t){return Array.isArray(t)?t:[t,new ke]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ge.ChangeDetails=ke;class bt{constructor(t,n,o){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=o}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class We{constructor(t){this._value="",this._update({...We.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new bt(this.extractInput(t,n),t)}appendTail(t){return Tt(t)&&(t=new bt(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new ke({inserted:t,rawInserted:t})):new ke}_appendChar(t,n,o){n===void 0&&(n={});const a=this.state;let r;if([t,r]=this.doPrepareChar(t,n),t&&(r=r.aggregate(this._appendCharRaw(t,n)),!r.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=a;let i=this.pad(n);const c=this._appendCharRaw(t,n);i=i.aggregate(c),c.rawInserted||i.equals(r)?r=i:this.state=s}if(r.inserted){let s,i=this.doValidate(n)!==!1;if(i&&o!=null){const c=this.state;if(this.overwrite===!0){s=o.state;for(let u=0;u<r.rawInserted.length;++u)o.unshift(this.displayValue.length-r.tailShift)}let d=this.appendTail(o);if(i=d.rawInserted.length===o.toString().length,!(i&&d.inserted)&&this.overwrite==="shift"){this.state=c,s=o.state;for(let u=0;u<r.rawInserted.length;++u)o.shift();d=this.appendTail(o),i=d.rawInserted.length===o.toString().length}i&&d.inserted&&(this.state=c)}i||(r=new ke,this.state=a,o&&s&&(o.state=s))}return r}_appendPlaceholder(){return new ke}_appendEager(){return new ke}append(t,n,o){if(!Tt(t))throw new Error("value should be string");const a=Tt(o)?new bt(String(o)):o;n!=null&&n.tail&&(n._beforeTailState=this.state);let r;[t,r]=this.doPrepare(t,n);for(let s=0;s<t.length;++s){const i=this._appendChar(t[s],n,a);if(!i.rawInserted&&!this.doSkipInvalid(t[s],n,a))break;r.aggregate(i)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&r.aggregate(this._appendEager()),a!=null&&(r.tailShift+=this.appendTail(a).tailShift),r}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new ke}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,o=this.value,a=t();return this.rawInputValue=n,this.value&&this.value!==o&&o.indexOf(this.value)===0&&(this.append(o.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,o=t(this);return this.state=n,delete this._isolated,o}doSkipInvalid(t,n,o){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),ke.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),ke.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,o,a,r){o===void 0&&(o=""),a===void 0&&(a=de.NONE),r===void 0&&(r={input:!0});const s=t+n,i=this.extractTail(s),c=this.eager===!0||this.eager==="remove";let d;c&&(a=Kr(a),d=this.extractInput(0,s,{raw:!0}));let u=t;const p=new ke;if(a!==de.NONE&&(u=this.nearestInputPos(t,n>1&&t!==0&&!c?de.NONE:a),p.tailShift=u-t),p.aggregate(this.remove(u)),c&&a!==de.NONE&&d===this.rawInputValue)if(a===de.FORCE_LEFT){let g;for(;d===this.rawInputValue&&(g=this.displayValue.length);)p.aggregate(new ke({tailShift:-1})).aggregate(this.remove(g-1))}else a===de.FORCE_RIGHT&&i.unshift();return p.aggregate(this.append(o,r,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!El(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||We.EMPTY_VALUES.includes(t)&&We.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new ke}}We.DEFAULTS={skipInvalid:!0},We.EMPTY_VALUES=[void 0,null,""],ge.Masked=We;class Lt{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Tt(t)?new bt(String(t)):t;const n=this.chunks[this.chunks.length-1],o=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof bt)o?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Lt){if(t.stop==null){let a;for(;t.chunks.length&&t.chunks[0].stop==null;)a=t.chunks.shift(),a.from+=t.from,this.extend(a)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ge.MaskedPattern))return new bt(this.toString()).appendTo(t);const n=new ke;for(let o=0;o<this.chunks.length;++o){const a=this.chunks[o],r=t._mapPosToBlock(t.displayValue.length),s=a.stop;let i;if(s!=null&&(!r||r.index<=s)&&((a instanceof Lt||t._stops.indexOf(s)>=0)&&n.aggregate(t._appendPlaceholder(s)),i=a instanceof Lt&&t._blocks[s]),i){const c=i.appendTail(a);n.aggregate(c);const d=a.toString().slice(c.rawInserted.length);d&&n.aggregate(t.append(d,{tail:!0}))}else n.aggregate(t.append(a.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...o}=t;Object.assign(this,o),this.chunks=n.map(a=>{const r="chunks"in a?new Lt:new bt;return r.state=a,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let o=0;for(;o<this.chunks.length;){const a=this.chunks[o],r=a.unshift(n);if(a.toString()){if(!r)break;++o}else this.chunks.splice(o,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],o=n.shift();if(n.toString()){if(!o)break;--t}else this.chunks.splice(t,1);if(o)return o}return""}}class gw{constructor(t,n){this.masked=t,this._log=[];const{offset:o,index:a}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=o,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,de.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,de.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,de.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,de.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,de.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,de.NONE),!0})}}class Po{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new ke}nearestInputPos(t,n){n===void 0&&(n=de.NONE);const o=0,a=this._value.length;switch(n){case de.LEFT:case de.FORCE_LEFT:return o;case de.NONE:case de.RIGHT:case de.FORCE_RIGHT:default:return a}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),o===void 0&&(o={}),o.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new ke;const o=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!o)&&!n.tail,r=new ke({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new ke;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new bt("")}appendTail(t){return Tt(t)&&(t=new bt(String(t))),t.appendTo(this)}append(t,n,o){const a=this._appendChar(t[0],n);return o!=null&&(a.tailShift+=this.appendTail(o).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Bn{constructor(t){const{parent:n,isOptional:o,placeholderChar:a,displayChar:r,lazy:s,eager:i,...c}=t;this.masked=kt(c),Object.assign(this,{parent:n,isOptional:o,placeholderChar:a,displayChar:r,lazy:s,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new ke}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new ke;const o=this.masked.state;let a=this.masked._appendChar(t,this.currentMaskFlags(n));return a.inserted&&this.doValidate(n)===!1&&(a=new ke,this.masked.state=o),!a.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(t,n,o){return this.masked.append(t,this.currentMaskFlags(n),o)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ke:(this.isFilled=!0,new ke({inserted:this.placeholderChar}))}_appendEager(){return new ke}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,o)}nearestInputPos(t,n){n===void 0&&(n=de.NONE);const o=0,a=this.value.length,r=Math.min(Math.max(t,o),a);switch(n){case de.LEFT:case de.FORCE_LEFT:return this.isComplete?r:o;case de.RIGHT:case de.FORCE_RIGHT:return this.isComplete?r:a;case de.NONE:default:return r}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||t?._beforeTailState}}pad(t){return new ke}}Bn.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Qr extends We{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=o=>o.search(n)>=0),super._update(t)}}ge.MaskedRegExp=Qr;class Ke extends We{constructor(t){super({...Ke.DEFAULTS,...t,definitions:Object.assign({},Bn.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let o=!1,a=!1;for(let r=0;r<n.length;++r){if(this.blocks){const d=n.slice(r),u=Object.keys(this.blocks).filter(g=>d.indexOf(g)===0);u.sort((g,y)=>y.length-g.length);const p=u[0];if(p){const{expose:g,repeat:y,...w}=on(this.blocks[p]),m={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...w,repeat:y,parent:this},f=y!=null?new ge.RepeatBlock(m):kt(m);f&&(this._blocks.push(f),g&&(this.exposeBlock=f),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),r+=p.length-1;continue}}let s=n[r],i=s in t;if(s===Ke.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){o=!o;continue}if(s==="["||s==="]"){a=!a;continue}if(s===Ke.ESCAPE_CHAR){if(++r,s=n[r],!s)break;i=!1}const c=i?new Bn({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...on(t[s]),parent:this}):new Po({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...o}=t;this._blocks.forEach((a,r)=>a.state=n[r]),super.state=o}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new ke;let o=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(o==null)return n;this._blocks[o].isFilled&&++o;for(let a=o;a<this._blocks.length;++a){const r=this._blocks[a]._appendEager();if(!r.inserted)break;n.aggregate(r)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const o=this._mapPosToBlock(this.displayValue.length),a=new ke;if(!o)return a;for(let s=o.index,i;i=this._blocks[s];++s){var r;const c=i._appendChar(t,{...n,_beforeTailState:(r=n._beforeTailState)==null||(r=r._blocks)==null?void 0:r[s]});if(a.aggregate(c),c.consumed)break}return a}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=new Lt;return t===n||this._forEachBlocksInRange(t,n,(a,r,s,i)=>{const c=a.extractTail(s,i);c.stop=this._findStopBefore(r),c.from=this._blockStartPos(r),c instanceof Lt&&(c.blockIndex=r),o.extend(c)}),o}extractInput(t,n,o){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),o===void 0&&(o={}),t===n)return"";let a="";return this._forEachBlocksInRange(t,n,(r,s,i,c)=>{a+=r.extractInput(i,c,o)}),a}_findStopBefore(t){let n;for(let o=0;o<this._stops.length;++o){const a=this._stops[o];if(a<=t)n=a;else break}return n}_appendPlaceholder(t){const n=new ke;if(this.lazy&&t==null)return n;const o=this._mapPosToBlock(this.displayValue.length);if(!o)return n;const a=o.index,r=t??this._blocks.length;return this._blocks.slice(a,r).forEach(s=>{if(!s.lazy||t!=null){var i;n.aggregate(s._appendPlaceholder((i=s._blocks)==null?void 0:i.length))}}),n}_mapPosToBlock(t){let n="";for(let o=0;o<this._blocks.length;++o){const a=this._blocks[o],r=n.length;if(n+=a.displayValue,t<=n.length)return{index:o,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,o)=>n+=o.displayValue.length,0)}_forEachBlocksInRange(t,n,o){n===void 0&&(n=this.displayValue.length);const a=this._mapPosToBlock(t);if(a){const r=this._mapPosToBlock(n),s=r&&a.index===r.index,i=a.offset,c=r&&s?r.offset:this._blocks[a.index].displayValue.length;if(o(this._blocks[a.index],a.index,i,c),r&&!s){for(let d=a.index+1;d<r.index;++d)o(this._blocks[d],d,0,this._blocks[d].displayValue.length);o(this._blocks[r.index],r.index,0,r.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=super.remove(t,n);return this._forEachBlocksInRange(t,n,(a,r,s,i)=>{o.aggregate(a.remove(s,i))}),o}nearestInputPos(t,n){if(n===void 0&&(n=de.NONE),!this._blocks.length)return 0;const o=new gw(this,t);if(n===de.NONE)return o.pushRightBeforeInput()||(o.popState(),o.pushLeftBeforeInput())?o.pos:this.displayValue.length;if(n===de.LEFT||n===de.FORCE_LEFT){if(n===de.LEFT){if(o.pushRightBeforeFilled(),o.ok&&o.pos===t)return t;o.popState()}if(o.pushLeftBeforeInput(),o.pushLeftBeforeRequired(),o.pushLeftBeforeFilled(),n===de.LEFT){if(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.ok&&o.pos<=t||(o.popState(),o.ok&&o.pos<=t))return o.pos;o.popState()}return o.ok?o.pos:n===de.FORCE_LEFT?0:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:0)}return n===de.RIGHT||n===de.FORCE_RIGHT?(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.pushRightBeforeFilled()?o.pos:n===de.FORCE_RIGHT?this.displayValue.length:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:this.nearestInputPos(t,de.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let o=0;return this._forEachBlocksInRange(t,n,(a,r,s,i)=>{o+=a.totalInputPositions(s,i)}),o}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(o=>this._blocks[o]):[]}pad(t){const n=new ke;return this._forEachBlocksInRange(0,this.displayValue.length,o=>n.aggregate(o.pad(t))),n}}Ke.DEFAULTS={...We.DEFAULTS,lazy:!0,placeholderChar:"_"},Ke.STOP_CHAR="`",Ke.ESCAPE_CHAR="\\",Ke.InputDefinition=Bn,Ke.FixedDefinition=Po,ge.MaskedPattern=Ke;class Sn extends Ke{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:o=this.from||0,maxLength:a=this.maxLength||0,autofix:r=this.autofix,...s}=t;this.to=n,this.from=o,this.maxLength=Math.max(String(n).length,a),this.autofix=r;const i=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let d=0;for(;d<c.length&&c[d]===i[d];)++d;s.mask=c.slice(0,d).replace(/0/g,"\\0")+"0".repeat(this.maxLength-d),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",o="";const[,a,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(n="0".repeat(a.length)+r,o="9".repeat(a.length)+r),n=n.padEnd(this.maxLength,"0"),o=o.padEnd(this.maxLength,"9"),[n,o]}doPrepareChar(t,n){n===void 0&&(n={});let o;return[t,o]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(o.skip=!this.isComplete),[t,o]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const o=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[r,s]=this.boundaries(this.value+t);return Number(s)<this.from?super._appendCharRaw(o[this.value.length],n):Number(r)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(o[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(a[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[o,a]=this.boundaries(n);return this.from<=Number(a)&&Number(o)<=this.to&&super.doValidate(t)}pad(t){const n=new ke;if(this.value.length===this.maxLength)return n;const o=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let r=0;r<a;++r)n.aggregate(super._appendCharRaw("0",t));o.split("").forEach(r=>this._appendCharRaw(r))}return n}}ge.MaskedRange=Sn;const yw="d{.}`m{.}`Y";class xt extends Ke{static extractPatternOptions(t){const{mask:n,pattern:o,...a}=t;return{...a,mask:Tt(n)?n:o}}constructor(t){super(xt.extractPatternOptions({...xt.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:o,blocks:a,...r}={...xt.DEFAULTS,...t},s=Object.assign({},xt.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,a),super._update({...r,mask:Tt(n)?n:o,blocks:s})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(xt.extractPatternOptions(t))}}xt.GET_DEFAULT_BLOCKS=()=>({d:{mask:Sn,from:1,to:31,maxLength:2},m:{mask:Sn,from:1,to:12,maxLength:2},Y:{mask:Sn,from:1900,to:9999}}),xt.DEFAULTS={...Ke.DEFAULTS,mask:Date,pattern:yw,format:(l,t)=>{if(!l)return"";const n=String(l.getDate()).padStart(2,"0"),o=String(l.getMonth()+1).padStart(2,"0"),a=l.getFullYear();return[n,o,a].join(".")},parse:(l,t)=>{const[n,o,a]=l.split(".").map(Number);return new Date(a,o-1,n)}},ge.MaskedDate=xt;class Mn extends We{constructor(t){super({...Mn.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:o,...a}=on(n),r=kt({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a});return o&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const o=this._applyDispatch(t,n);return this.currentMask&&o.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),o}_applyDispatch(t,n,o){t===void 0&&(t=""),n===void 0&&(n={}),o===void 0&&(o="");const a=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,r=this.rawInputValue,s=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:r,i=r.slice(s.length),c=this.currentMask,d=new ke,u=c?.state;return this.currentMask=this.doDispatch(t,{...n},o),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),d.tailShift=this.currentMask.value.length-a.length),i&&(d.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),d}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new ke;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,o;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((o=t._beforeTailState)==null?void 0:o.currentMask)||t._beforeTailState}}doDispatch(t,n,o){return n===void 0&&(n={}),o===void 0&&(o=""),this.dispatch(t,this,n,o)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[o,a]=super.doPrepare(t,n);if(this.currentMask){let r;[o,r]=super.doPrepare(o,this.currentMaskFlags(n)),a=a.aggregate(r)}return[o,a]}doPrepareChar(t,n){n===void 0&&(n={});let[o,a]=super.doPrepareChar(t,n);if(this.currentMask){let r;[o,r]=super.doPrepareChar(o,this.currentMaskFlags(n)),a=a.aggregate(r)}return[o,a]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const o=new ke;return this.currentMask&&o.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),o}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:o,currentMask:a,...r}=t;n&&this.compiledMasks.forEach((s,i)=>s.state=n[i]),o!=null&&(this.currentMask=o,this.currentMask.state=a),super.state=r}extractInput(t,n,o){return this.currentMask?this.currentMask.extractInput(t,n,o):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,o)=>{if(!t[o])return;const{mask:a,...r}=t[o];return El(n,r)&&n.maskEquals(a)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}Mn.DEFAULTS={...We.DEFAULTS,dispatch:(l,t,n,o)=>{if(!t.compiledMasks.length)return;const a=t.rawInputValue,r=t.compiledMasks.map((s,i)=>{const c=t.currentMask===s,d=c?s.displayValue.length:s.nearestInputPos(s.displayValue.length,de.FORCE_LEFT);return s.rawInputValue!==a?(s.reset(),s.append(a,{raw:!0})):c||s.remove(d),s.append(l,t.currentMaskFlags(n)),s.appendTail(o),{index:i,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(d,s.nearestInputPos(s.displayValue.length,de.FORCE_LEFT)))}});return r.sort((s,i)=>i.weight-s.weight||i.totalInputPositions-s.totalInputPositions),t.compiledMasks[r[0].index]}},ge.MaskedDynamic=Mn;class An extends Ke{constructor(t){super({...An.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...o}=t;if(n){const a=n.map(i=>i.length),r=Math.min(...a),s=Math.max(...a)-r;o.mask="*".repeat(r),s&&(o.mask+="["+"*".repeat(s)+"]"),this.enum=n}super._update(o)}_appendCharRaw(t,n){n===void 0&&(n={});const o=Math.min(this.nearestInputPos(0,de.FORCE_RIGHT),this.value.length),a=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,o));if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,i)=>{const c=a[0][i];i>=this.value.length||c===s.value||(s.reset(),s._appendChar(c,n))});const r=super._appendCharRaw(a[0][this.value.length],n);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(s=>r.aggregate(super._appendCharRaw(s))),r}return new ke({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new bt("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new ke;const o=Math.min(super.nearestInputPos(0,de.FORCE_RIGHT),this.value.length);let a;for(a=t;a>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(o,a),o)).length>1);--a);const r=super.remove(a,n);return r.tailShift+=a-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}An.DEFAULTS={...Ke.DEFAULTS,matchValue:(l,t,n)=>l.indexOf(t,n)===n},ge.MaskedEnum=An;class Vr extends We{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ge.MaskedFunction=Vr;var es;class ot extends We{constructor(t){super({...ot.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",o=(this.scale?"("+Fo(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Fo).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Fo(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[o,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!o&&(a.skip=!0),o&&!this.allowPositive&&!this.value&&o!=="-"&&a.aggregate(this._appendChar("-")),[o,a]}_separatorsCount(t,n){n===void 0&&(n=!1);let o=0;for(let a=0;a<t;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++o,n&&(t+=this.thousandsSeparator.length));return o}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,o))}_appendCharRaw(t,n){n===void 0&&(n={});const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(o);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const s=this.number;let i=!isNaN(s),c=!1;if(i){let g;this.min!=null&&this.min<0&&this.number<this.min&&(g=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(g=this.max),g!=null&&(this.autofix?(this._value=this.format(g,this).replace(ot.UNMASKED_RADIX,this.radix),c||(c=r===this._value&&!n.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let d;i?d=new ke({inserted:this._value.slice(r.length),rawInserted:c?"":t,skip:c}):(this._value=r,d=new ke),this._value=this._insertThousandsSeparators(this._value);const u=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(u);return d.tailShift+=(p-a)*this.thousandsSeparator.length,d}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,o=this.value.indexOf(this.thousandsSeparator,n);if(o<=t)return o}return-1}_adjustRangeWithSeparators(t,n){const o=this._findSeparatorAround(t);o>=0&&(t=o);const a=this._findSeparatorAround(n);return a>=0&&(n=a+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const o=this.value.slice(0,t),a=this.value.slice(n),r=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+a));const s=this._separatorsCountFromSlice(o);return new ke({tailShift:(s-r)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case de.NONE:case de.LEFT:case de.FORCE_LEFT:{const o=this._findSeparatorAround(t-1);if(o>=0){const a=o+this.thousandsSeparator.length;if(t<a||this.value.length<=a||n===de.FORCE_LEFT)return o}break}case de.RIGHT:case de.FORCE_RIGHT:{const o=this._findSeparatorAround(t);if(o>=0)return o+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let o=this.value;this.normalizeZeros&&(o=this._normalizeZeros(o)),this.padFractionalZeros&&this.scale>0&&(o=this._padFractionalZeros(o)),this._value=o}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(o,a,r,s)=>a+s),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,o){n===void 0&&(n={});const a=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ot.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,o)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ot.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ot.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ot.EMPTY_VALUES.includes(t)&&ot.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}es=ot,ot.UNMASKED_RADIX=".",ot.EMPTY_VALUES=[...We.EMPTY_VALUES,0],ot.DEFAULTS={...We.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[es.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ge.MaskedNumber=ot;const Nl={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Ro(l,t,n){t===void 0&&(t=Nl.MASKED),n===void 0&&(n=Nl.MASKED);const o=kt(l);return a=>o.runIsolated(r=>(r[t]=a,r[n]))}function ts(l,t,n,o){return Ro(t,n,o)(l)}ge.PIPE_TYPE=Nl,ge.createPipe=Ro,ge.pipe=ts;class ns extends Ke{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,o,a;const{repeat:r,...s}=on(t);this._blockOpts=Object.assign({},this._blockOpts,s);const i=kt(this._blockOpts);this.repeat=(n=(o=r??i.repeat)!=null?o:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(kt(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const o=new ke;for(let c=(a=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?a:Math.max(this._blocks.length-1,0),d,u;d=(s=this._blocks[c])!=null?s:u=!u&&this._allocateBlock(c);++c){var a,r,s,i;const p=d._appendChar(t,{...n,_beforeTailState:(i=n._beforeTailState)==null||(i=i._blocks)==null?void 0:i[c]});if(p.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(p),p.consumed)break}return o}_trimEmptyTail(t,n){var o,a;t===void 0&&(t=0);const r=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0);let s;n!=null&&(s=(a=this._mapPosToBlock(n))==null?void 0:a.index),s==null&&(s=this._blocks.length-1);let i=0;for(let c=s;r<=c&&!this._blocks[c].unmaskedValue;--c,++i);i&&(this._blocks.splice(s-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=super.remove(t,n);return this._trimEmptyTail(t,n),o}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ge.RepeatBlock=ns;try{globalThis.IMask=ge}catch{}const zo=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:ke,ChunksTailDetails:Lt,DIRECTION:de,HTMLContenteditableMaskElement:Oo,HTMLInputMaskElement:Jr,HTMLMaskElement:Nn,InputMask:Xr,MaskElement:Cl,Masked:We,MaskedDate:xt,MaskedDynamic:Mn,MaskedEnum:An,MaskedFunction:Vr,MaskedNumber:ot,MaskedPattern:Ke,MaskedRange:Sn,MaskedRegExp:Qr,PIPE_TYPE:Nl,PatternFixedDefinition:Po,PatternInputDefinition:Bn,RepeatBlock:ns,createMask:kt,createPipe:Ro,default:ge,forceDirection:Kr,normalizeOpts:on,pipe:ts},Symbol.toStringTag,{value:"Module"}));Fe.Card=_n,Fe.CardItem=Cn,Fe.CommentsWidget=Tn,Fe.CopyNotification=qr,Fe.DescriptionListWidget=Dl,Fe.FilesWidget=$n,Fe.GalleryWidget=In,Fe.GroupInterfaceWidget=xl,Fe.HistoryWidget=Ln,Fe.MapWidget=Vn,Fe.TableWidget=zr,Fe.default=_n,Object.defineProperties(Fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
164
+ **/const Er=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),Cr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),_r=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),Nr=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Do=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),Br=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),Sr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),Mr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),To=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),Ar=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");U1({[Er]:"vModelRadio",[Cr]:"vModelCheckbox",[_r]:"vModelText",[Nr]:"vModelSelect",[Do]:"vModelDynamic",[Br]:"withModifiers",[Sr]:"withKeys",[Mr]:"vShow",[To]:"Transition",[Ar]:"TransitionGroup"});let nn;function yb(l,t=!1){return nn||(nn=document.createElement("div")),t?(nn.innerHTML=`<div foo="${l.replace(/"/g,"&quot;")}">`,nn.children[0].getAttribute("foo")):(nn.innerHTML=l,nn.textContent)}const kb={parseMode:"html",isVoidTag:F1,isNativeTag:l=>L1(l)||$1(l)||I1(l),isPreTag:l=>l==="pre",isIgnoreNewlineTag:l=>l==="pre"||l==="textarea",decodeEntities:yb,isBuiltInComponent:l=>{if(l==="Transition"||l==="transition")return To;if(l==="TransitionGroup"||l==="transition-group")return Ar},getNamespace(l,t,n){let o=t?t.ns:n;if(t&&o===2)if(t.tag==="annotation-xml"){if(l==="svg")return 1;t.props.some(a=>a.type===6&&a.name==="encoding"&&a.value!=null&&(a.value.content==="text/html"||a.value.content==="application/xhtml+xml"))&&(o=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&l!=="mglyph"&&l!=="malignmark"&&(o=0);else t&&o===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(o=0);if(o===0){if(l==="svg")return 1;if(l==="math")return 2}return o}},bb=l=>{l.type===1&&l.props.forEach((t,n)=>{t.type===6&&t.name==="style"&&t.value&&(l.props[n]={type:7,name:"bind",arg:ye("style",!0,t.loc),exp:xb(t.value.content,t.loc),modifiers:[],loc:t.loc})})},xb=(l,t)=>{const n=S1(l);return ye(JSON.stringify(n),!1,t,3)};function ft(l,t){return Se(l,t,process.env.NODE_ENV!=="production"?wb:void 0)}const wb={53:"v-html is missing expression.",54:"v-html will override element children.",55:"v-text is missing expression.",56:"v-text will override element children.",57:"v-model can only be used on <input>, <textarea> and <select> elements.",58:"v-model argument is not supported on plain elements.",59:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",60:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",61:"v-show is missing expression.",62:"<Transition> expects exactly one child element or component.",63:"Tags with side effect (<script> and <style>) are ignored in client component templates."},Eb=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(53,a)),t.children.length&&(n.onError(ft(54,a)),t.children.length=0),{props:[$e(ye("innerHTML",!0,a),o||ye("",!0))]}},Cb=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(55,a)),t.children.length&&(n.onError(ft(56,a)),t.children.length=0),{props:[$e(ye("textContent",!0),o?st(o,n)>0?o:Oe(n.helperString(nl),[o],a):ye("",!0))]}},_b=(l,t,n)=>{const o=br(l,t,n);if(!o.props.length||t.tagType===1)return o;l.arg&&n.onError(ft(58,l.arg.loc));function a(){const i=tt(t,"bind");i&&At(i.arg,"value")&&n.onError(ft(60,i.loc))}const{tag:r}=t,s=n.isCustomElement(r);if(r==="input"||r==="textarea"||r==="select"||s){let i=_r,c=!1;if(r==="input"||s){const d=bn(t,"type");if(d){if(d.type===7)i=Do;else if(d.value)switch(d.value.content){case"radio":i=Er;break;case"checkbox":i=Cr;break;case"file":c=!0,n.onError(ft(59,l.loc));break;default:process.env.NODE_ENV!=="production"&&a();break}}else tk(t)?i=Do:process.env.NODE_ENV!=="production"&&a()}else r==="select"?i=Nr:process.env.NODE_ENV!=="production"&&a();c||(o.needRuntime=n.helper(i))}else n.onError(ft(57,l.loc));return o.props=o.props.filter(i=>!(i.key.type===4&&i.key.content==="modelValue")),o},Nb=gt("passive,once,capture"),Bb=gt("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Sb=gt("left,right"),Dr=gt("onkeyup,onkeydown,onkeypress"),Mb=(l,t,n,o)=>{const a=[],r=[],s=[];for(let i=0;i<t.length;i++){const c=t[i].content;c==="native"&&tn("COMPILER_V_ON_NATIVE",n,o)||Nb(c)?s.push(c):Sb(c)?et(l)?Dr(l.content.toLowerCase())?a.push(c):r.push(c):(a.push(c),r.push(c)):Bb(c)?r.push(c):a.push(c)}return{keyModifiers:a,nonKeyModifiers:r,eventOptionModifiers:s}},Tr=(l,t)=>et(l)&&l.content.toLowerCase()==="onclick"?ye(t,!0):l.type!==4?mt(["(",l,`) === "onClick" ? "${t}" : (`,l,")"]):l,Ab=(l,t,n)=>yr(l,t,n,o=>{const{modifiers:a}=l;if(!a.length)return o;let{key:r,value:s}=o.props[0];const{keyModifiers:i,nonKeyModifiers:c,eventOptionModifiers:d}=Mb(r,a,n,l.loc);if(c.includes("right")&&(r=Tr(r,"onContextmenu")),c.includes("middle")&&(r=Tr(r,"onMouseup")),c.length&&(s=Oe(n.helper(Br),[s,JSON.stringify(c)])),i.length&&(!et(r)||Dr(r.content.toLowerCase()))&&(s=Oe(n.helper(Sr),[s,JSON.stringify(i)])),d.length){const u=d.map(Xl).join("");r=et(r)?ye(`${r.content}${u}`,!0):mt(["(",r,`) + "${u}"`])}return{props:[$e(r,s)]}}),Db=(l,t,n)=>{const{exp:o,loc:a}=l;return o||n.onError(ft(61,a)),{props:[],needRuntime:n.helper(Mr)}},Tb=(l,t)=>{if(l.type===1&&l.tagType===1&&t.isBuiltInComponent(l.tag)===To)return()=>{if(!l.children.length)return;Lr(l)&&t.onError(ft(62,{start:l.children[0].loc.start,end:l.children[l.children.length-1].loc.end,source:""}));const o=l.children[0];if(o.type===1)for(const a of o.props)a.type===7&&a.name==="show"&&l.props.push({type:6,name:"persisted",nameLoc:l.loc,value:void 0,loc:l.loc})}};function Lr(l){const t=l.children=l.children.filter(o=>o.type!==3&&!(o.type===2&&!o.content.trim())),n=t[0];return t.length!==1||n.type===11||n.type===9&&n.branches.some(Lr)}const Lb=(l,t)=>{l.type===1&&l.tagType===0&&(l.tag==="script"||l.tag==="style")&&(process.env.NODE_ENV!=="production"&&t.onError(ft(63,l.loc)),t.removeNode())};function $b(l,t){return l==="template"?!0:l in $r?$r[l].has(t):t in Ir?Ir[t].has(l):!(l in Fr&&Fr[l].has(t)||t in Or&&Or[t].has(l))}const ln=new Set(["h1","h2","h3","h4","h5","h6"]),Ht=new Set([]),$r={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:Ht,iframe:Ht,option:Ht,textarea:Ht,style:Ht,title:Ht},Ir={html:Ht,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},Fr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},Or={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:ln,h2:ln,h3:ln,h4:ln,h5:ln,h6:ln},Ib=(l,t)=>{if(l.type===1&&l.tagType===0&&t.parent&&t.parent.type===1&&t.parent.tagType===0&&!$b(t.parent.tag,l.tag)){const n=new SyntaxError(`<${l.tag}> cannot be child of <${t.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);n.loc=l.loc,t.onWarn(n)}},Fb=[bb,...process.env.NODE_ENV!=="production"?[Tb,Ib]:[]],Ob={cloak:gb,html:Eb,text:Cb,model:_b,on:Ab,show:Db};function Pb(l,t={}){return vb(l,Nt({},kb,t,{nodeTransforms:[Lb,...Fb,...t.nodeTransforms||[]],directiveTransforms:Nt({},Ob,t.directiveTransforms||{}),transformHoist:null}))}function Rb(l,t={}){const n=l.trim().startsWith("<")?l:`<span>${l}</span>`,{code:o}=Pb(n,{mode:"function"}),a=new Function("Vue",`${o}; return render;`)(as);return e.defineComponent({name:"DynamicFromString",props:t.props??{},emits:t.emits??[],setup(){return t.setup?.()??{}},render:a})}const Lo={};function zb(l){return Lo[l]||(Lo[l]=Rb(l,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Lo[l]}const jb={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},Ub={class:"flex items-center gap-2"},Hb=["disabled"],qb={class:"text-sm"},Wb=["disabled"],Gb=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(l){const t=l,n=e.computed(()=>t.currentPage<=1),o=e.computed(()=>t.currentPage>=t.totalPages);return(a,r)=>(e.openBlock(),e.createElementBlock("div",jb,[e.createElementVNode("div",null,e.toDisplayString(a.label),1),e.createElementVNode("div",Ub,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:n.value,onClick:r[0]||(r[0]=s=>a.$emit("previous"))}," Назад ",8,Hb),e.createElementVNode("span",qb,"Сторінка "+e.toDisplayString(a.currentPage)+" з "+e.toDisplayString(a.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:r[1]||(r[1]=s=>a.$emit("next"))}," Далі ",8,Wb)])]))}}),Kb={class:"relative inline-flex"},Yb=["aria-label"],Zb={class:"px-3 pb-2"},Jb={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Xb=["onClick"],Qb={class:"truncate"},Vb={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},ex="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",tx=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(l,{emit:t}){const n=l,o=t,a=e.useAttrs(),r=e.ref(!1),s=e.ref(""),i=e.ref([...n.columns]),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref({top:0,left:0}),g=e.computed(()=>{if(!s.value)return i.value;const _=s.value.toLowerCase();return i.value.filter(b=>y(b).toLowerCase().includes(_))});e.watch(()=>n.columns,_=>{if(!_){i.value=[];return}const b=JSON.stringify(_),x=JSON.stringify(i.value);b!==x&&(i.value=[..._])},{deep:!0}),e.watch(i,_=>{o("update:columns",_)},{deep:!0});function y(_){return _.ua||_.label||_.name||"Колонка"}function w(_){const b=!_.hidden;b&&i.value.filter(x=>!x.hidden).length<=1||(_.hidden=b)}function m(){r.value=!r.value,r.value&&e.nextTick(()=>{u.value?.focus(),f()})}function f(){if(!c.value)return;const _=c.value.getBoundingClientRect();p.value={top:_.bottom+window.scrollY+6,left:_.left+window.scrollX-200}}function E(_){if(!r.value)return;const b=_.target;b&&(d.value?.contains(b)||c.value?.contains(b)||(r.value=!1))}function C(_){_.key==="Escape"&&(r.value=!1)}return e.onMounted(()=>{document.addEventListener("click",E,!0),document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",E,!0),document.removeEventListener("keydown",C)}),(_,b)=>(e.openBlock(),e.createElementBlock("div",Kb,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:m,class:e.normalizeClass([ex,e.unref(a).class]),"aria-label":e.unref(a)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},b[2]||(b[2]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)]),10,Yb),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${p.value.top}px`,left:`${p.value.left}px`})},[b[5]||(b[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Zb,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":b[0]||(b[0]=x=>s.value=x),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,s.value]])]),e.createElementVNode("div",Jb,[b[4]||(b[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:b[1]||(b[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:D=>w(x)},[e.createElementVNode("span",Qb,e.toDisplayString(y(x)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",x.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[x.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Vb,b[3]||(b[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])))],2)],8,Xb))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),nx=["data-action-key"],lx=["onClick"],ox={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ax={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rx={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sx={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ix=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(l,{emit:t}){const n=l,o=t,a=e.ref(null),r=e.computed(()=>!!n.actions?.length),s=e.ref({scrollX:0,scrollY:0,width:0,height:0}),i=e.ref(!1);function c(){o("toggle")}function d(w){w.handler?.(n.row)}const u=e.computed(()=>{if(!n.isOpen)return{};const w=a.value;if(!w)return{};const m=w.getBoundingClientRect(),f=8,E=160,b=(n.actions?.length??0)*36+f*2,x=s.value.height||(typeof window<"u"?window.innerHeight:0),D=s.value.width||(typeof window<"u"?window.innerWidth:0),S=s.value.scrollX||(typeof window<"u"?window.scrollX:0),M=s.value.scrollY||(typeof window<"u"?window.scrollY:0);let O=m.bottom+M+f,K=m.right+S-E;const U=S+D-E-f;return K>U&&(K=U),K<S+f&&(K=S+f),O+b>M+x-f&&(O=m.top+M-b-f),O<M+f&&(O=M+f),{top:`${O}px`,left:`${K}px`,width:"auto"}});function p(){typeof window>"u"||(s.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function g(){typeof window>"u"||i.value||(i.value=!0,p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p))}function y(){typeof window>"u"||!i.value||(i.value=!1,window.removeEventListener("scroll",p),window.removeEventListener("resize",p))}return e.watch(()=>n.isOpen,w=>{w?g():y()},{immediate:!0}),e.onMounted(()=>{n.isOpen&&g()}),e.onBeforeUnmount(()=>{y()}),(w,m)=>r.value&&w.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":w.actionKey,ref_key:"anchorRef",ref:a},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},m[1]||(m[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[w.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(u.value),onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.actions,f=>(e.openBlock(),e.createElementBlock("button",{key:f.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",f.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:E=>d(f)},[e.renderSlot(w.$slots,"icon",{action:f},()=>[f.type==="view"?(e.openBlock(),e.createElementBlock("svg",ox,m[2]||(m[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))):f.type==="edit"?(e.openBlock(),e.createElementBlock("svg",ax,m[3]||(m[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)]))):f.type==="delete"?(e.openBlock(),e.createElementBlock("svg",rx,m[4]||(m[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",sx,m[5]||(m[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])))]),e.createTextVNode(" "+e.toDisplayString(f.label),1)],10,lx))),128))],4)):e.createCommentVNode("",!0)]))],8,nx)):e.createCommentVNode("",!0)}}),Pr=typeof window<"u",Rr=typeof document<"u";function cx(l){if(!Rr)throw new Error("Tooltip requires document to be defined");const t=document.createElement("div");return t.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",t.style.opacity="0",t.style.visibility="hidden",t.style.maxWidth="240px",t.style.whiteSpace="normal",t.style.wordBreak="break-word",document.body.appendChild(t),t}function zr(l){if(!l)return null;if(typeof l=="string"){const n=l.trim();return n?{text:n,wrap:!0}:null}const t=typeof l.text=="string"&&l.text.trim()?l.text.trim():void 0;return t?{text:t,wrap:l.wrap!==!1}:null}function $o(l,t){if(!Rr||!Pr)return;const n=cx(t.wrap),o={options:t,tooltipEl:n,show:a=>{if(!o.options.text||!Pr)return;n.textContent=o.options.text;const s=(a.currentTarget??l).getBoundingClientRect(),i=n.getBoundingClientRect(),c=window.innerWidth-i.width-12,d=Math.max(12,Math.min(s.left,c));n.style.left=`${d}px`,n.style.top=`${s.bottom+4}px`,n.style.opacity="1",n.style.visibility="visible"},hide:()=>{n.style.opacity="0",n.style.visibility="hidden"}};l.addEventListener("mouseenter",o.show),l.addEventListener("mouseleave",o.hide),l.addEventListener("focus",o.show),l.addEventListener("blur",o.hide),l.__tooltipState__=o}function Io(l){const t=l.__tooltipState__;t&&(l.removeEventListener("mouseenter",t.show),l.removeEventListener("mouseleave",t.hide),l.removeEventListener("focus",t.show),l.removeEventListener("blur",t.hide),t.tooltipEl.remove(),delete l.__tooltipState__)}const dx={mounted(l,t){const n=zr(t.value);n&&$o(l,n)},updated(l,t){const n=zr(t.value),o=l;if(!n){Io(o);return}const a=o.__tooltipState__;if(!a){$o(o,n);return}if(a.options.wrap!==n.wrap){Io(o),$o(o,n);return}a.options=n},unmounted(l){Io(l)}},ux={class:"flex flex-col gap-4 mb-[15px]"},px={class:"flex flex-wrap items-center gap-4"},mx={class:"relative"},fx={class:"ml-auto flex items-center gap-2"},hx={class:"overflow-x-auto"},vx={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},gx={class:"text-left font-medium text-gray-700"},yx={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},kx={class:"divide-y divide-gray-200"},bx=["href"],xx={key:2},wx={key:3},Ex={key:0,class:"py-2 pr-4 text-right"},Cx={key:0},_x={key:0},Nx=["colspan"],jr=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(l){const t=e.getCurrentInstance(),n=e.ref([]),o=e.ref([]),a=dx,r=l,s=e.ref([]),i=e.ref(""),c=e.ref(""),d=e.ref(""),u=e.ref(1),p=e.ref(10),g=e.ref(0),y=e.ref(0),w=e.ref("id"),m=e.ref("");let f=null,E=0;const C=e.ref(null);async function _(){const z=u.value,Q=++E,W=new URLSearchParams,G=d.value.trim();G&&W.set("search",G),W.set("page",String(z)),W.set("limit",String(p.value));const ve=`/api/data/${r.token}${W.toString()?`?${W.toString()}`:""}`;let me;try{const A=await fetch(ve);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);me=await A.json()}catch(A){Q===E&&(n.value=[],y.value=0,g.value=0),console.error("Failed to load table data",A);return}if(Q!==E)return;n.value=Array.isArray(me?.rows)?me.rows:[],o.value=R(me?.columns||[]),s.value=Array.isArray(me?.actions)?me.actions:[],i.value=me?.form,c.value=me?.addToken,w.value=typeof me?.pk=="string"&&me.pk?me.pk:w.value,typeof me?.form=="string"&&me.form&&(m.value=me.form.replace(/\.form$/,".table")),J();const Ee=Number(me?.total??me?.count??me?.totalCount),h=Number(me?.filtered??me?.filteredCount);g.value=Number.isFinite(Ee)&&Ee>0?Ee:n.value.length,y.value=Number.isFinite(h)&&h>0?h:Math.max(n.value.length,g.value);const v=Math.max(1,Math.ceil((y.value||n.value.length||1)/p.value));let B=z;typeof me?.page=="number"&&me.page>0&&(B=me.page),B>v&&(B=v),B<1&&(B=1);const k=B!==z;if(u.value=B,k&&y.value>0)return _()}const{$notify:b,$confirm:x,$form:D}=t?.appContext?.config?.globalProperties||{};function S(){if(fe.emitter?.emit){fe.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}_()}async function M(z){typeof D=="function"&&(await D({token:z.token}),S())}async function O(){typeof D=="function"&&(await D({token:c.value}),S())}function K(z){x({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const Q=await fetch(`/api/table/${z.token}`,{method:"DELETE"});if(!Q.ok){const{error:W}=await Q.json();b({title:"Помилка",type:"warning",message:W});return}b({title:"Видаленно",message:"Успішно видалено"}),await _()}})}e.onMounted(async()=>{await _(),fe.emitter?.on?.("updateCard",_)}),e.onBeforeUnmount(()=>{fe.emitter?.off?.("updateCard",_)});function U(z){return typeof z?.format=="string"?z.format.toLowerCase():""}function R(z){const Q=new Map;o.value.forEach(G=>{G?.name&&Q.set(G.name,!!G.hidden)});const W=z.map(G=>{const ve=Q.has(G.name)?Q.get(G.name):!!G.hidden;return{...G,hidden:ve}});return W.length&&!W.some(G=>!G.hidden)&&(W[0].hidden=!1),W}const q=e.computed(()=>{const z=o.value.filter(Q=>!Q.hidden);return z.length?z:o.value}),N=e.computed(()=>{const z=[],Q=new Set;for(const W of s.value){if(typeof W=="string"){if(W==="edit"){const G="row:edit";Q.has(G)||(z.push({key:G,type:"edit",label:"Редагувати",scope:"row",handler:xe}),Q.add(G));continue}if(W==="delete"||W==="del"){const G="row:delete";Q.has(G)||(z.push({key:G,type:"delete",label:"Видалити",scope:"row",handler:F,variant:"danger"}),Q.add(G));continue}if(W==="add"){const G="toolbar:add";Q.has(G)||(z.push({key:G,type:"add",label:"Додати",scope:"toolbar"}),Q.add(G))}continue}if(W&&typeof W=="object"){const G=String(W.name??W.type??"action"),ve=String(W.label??W.title??G),me=W.scope==="toolbar"?"toolbar":"row",Ee=`${me}:${G}`;if(Q.has(Ee))continue;Q.add(Ee),z.push({key:Ee,type:G,label:ve,scope:me,handler:me==="row"?h=>te(W,h):void 0,variant:W.variant==="danger"?"danger":"default",original:W})}}return z}),j=e.computed(()=>N.value.filter(z=>z.scope==="row"&&typeof z.handler=="function")),$=e.computed(()=>N.value.filter(z=>z.scope==="toolbar")),Z=e.computed(()=>j.value.length>0),V=e.computed(()=>$.value.some(z=>z.type==="add")),oe=e.computed(()=>n.value),ee=e.computed(()=>{const z=y.value||oe.value.length,Q=Math.ceil(z/p.value);return Q>0?Q:1}),H=e.computed(()=>{const z=oe.value.length,Q=y.value||z,W=g.value||Q;return`Показано ${z} з ${Q} (усього ${W})`});function ie(){u.value<ee.value&&(u.value+=1,_())}function Y(){u.value>1&&(u.value-=1,_())}e.watch(o,z=>{z?.length&&(z.some(Q=>!Q.hidden)||(z[0].hidden=!1))},{deep:!0});function se(){f&&clearTimeout(f),J(),f=setTimeout(()=>{u.value=1,_()},300)}function ue(z){const Q=w.value||"id",W=z?.token??z?.[Q]??z?.id;return W?String(W):""}function he(z){const Q=q.value[z],W=["py-2",...le(Q)];z===0&&W.push("pl-4");const G=z===q.value.length-1&&!Z.value;return W.push(G?"pr-4":"pr-5"),W.join(" ")}function be(z,Q){const W=["py-2",...le(Q)];U(Q)==="badge"&&W.push("center"),L(Q)==="wrap"?W.push("whitespace-normal","break-words"):W.push("truncate"),z===0&&W.push("pl-4");const G=z===q.value.length-1&&!Z.value;return W.push(G?"pr-4":"pr-5"),W.join(" ")}function L(z){return(typeof z?.overflow=="string"?z.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function le(z){const Q=[],W=Ee=>{if(Ee==null||Ee==="")return;const h=Number(Ee);return Number.isFinite(h)&&h>0?`${h}px`:String(Ee).replace(/\s+/g,"")},G=W(z?.width),ve=W(z?.minWidth),me=W(z?.maxWidth);return G?(Q.push(`min-w-[${G}]`,`max-w-[${G}]`),Q):(Q.push(`min-w-[${ve??"100px"}]`),Q.push(`max-w-[${me??"350px"}]`),Q)}function T(z){if(!j.value.length)return!1;const Q=w.value||"id";return!!(z?.token||z?.[Q]||z?.id)}function P(z){return C.value===ue(z)}function X(z){const Q=ue(z);Q&&(C.value=C.value===Q?null:Q)}function J(){C.value=null}function re(z,Q){const W=Q?.tooltip;if(!W)return;const G=ut(z,Q);let ve,me=Q?.tooltipWrap!==!1;if(typeof W=="string"){const Ee=W.trim();if(!Ee)return;const h=Ee.toLowerCase();if(["true","1","yes"].includes(h))ve=typeof G=="string"?G:String(G??"");else{if(["false","0","no"].includes(h))return;ve=Ee}}else W===!0?ve=G:typeof W=="object"&&(typeof W.text=="string"&&(ve=W.text.trim()),typeof W.wrap=="boolean"&&(me=W.wrap!==!1));if(!ve){if(G==null||G==="")return;ve=String(G)}if(ve.trim())return me?{text:ve,wrap:!0}:ve}function xe(z){J(),M(z)}function F(z){J(),K(z)}async function te(z,Q){J();const W=w.value||"id",G=z.isId?Q?.[W]??Q?.id:Q?.token??Q?.[W]??Q?.id;if(!G){console.warn("Cannot execute action without identifier",z);return}if(z.form&&typeof z.api=="string"&&z.api&&typeof D=="function"){await Ye(z,Q,G);return}if(z.form&&typeof D=="function"){const ve=await _e(z.form,G),me={form:z.form,token:ve?.token??Q?.token??G,schema:ve?.schema,mode:ve?.mode??"edit"};ve?.data!==void 0&&(me.defaultValue=ve.data);try{await D(me),S()}catch(Ee){console.error("Failed to execute form action",Ee)}return}if(typeof z.api=="string"&&z.api){const ve=ae(z.api,G);window.location.href=ve;return}Q?.token&&typeof D=="function"&&(await D({token:Q.token}),S())}function ae(z,Q){return`${z.endsWith("/")?z:`${z}/`}${Q}`}async function _e(z,Q){const W=`/api/form/${z}/${Q}`;try{const G=await fetch(W);if(!G.ok)throw new Error(`Request failed with status ${G.status}`);return await G.json()}catch(G){console.error("Failed to load form config",G),b({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Ae(z){const Q=`/api/template/form/${z}`;try{const W=await fetch(Q);if(!W.ok)throw new Error(`Request failed with status ${W.status}`);return(await W.json())?.schema}catch(W){console.error("Failed to load form template",W);return}}function Re(z){if(z!=null){if(z?.data!==void 0)return z.data;if(z?.defaultValue!==void 0)return z.defaultValue;if(z?.values!==void 0)return z.values;if(typeof z=="object"&&!Array.isArray(z)){const{schema:Q,token:W,mode:G,message:ve,successMessage:me,...Ee}=z;if(Object.keys(Ee).length)return Ee}}}async function Ye(z,Q,W){const G=ae(z.api,W),ve=(typeof z.method=="string"?z.method:"PUT").toUpperCase();let me;try{const A=await fetch(G);if(!A.ok)throw new Error(`Request failed with status ${A.status}`);me=await A.json()}catch(A){console.error("Failed to load action data",A),Qe("Не вдалося отримати дані форми.");return}const Ee=typeof z.form=="string"?z.form.replace(/\.table$/,".form"):void 0,h=me?.schema??(Ee?await Ae(Ee):void 0),v={mode:me?.mode??"edit"};Ee&&(v.form=Ee),h&&(v.schema=h);const B=Re(me);B!==void 0&&(v.defaultValue=B);const k=await D(v);if(k)try{const A=await fetch(G,{method:ve,headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!A.ok){const I=await dt(A),ne=I?.error??I?.message??"Не вдалося зберегти дані.";throw new Error(ne)}ht(`Дані успішно ${v.value==="add"?"збережено":"оновлено"}`),S()}catch(A){console.error("Failed to submit action data",A),Qe("Не вдалося зберегти дані.")}}async function dt(z){try{return await z.json()}catch{return}}function Qe(z){b({title:"Помилка",type:"error",message:z})}function ht(z){b({title:"Успіх",type:"success",message:z})}function ze(z){if(!C.value)return;const Q=z.target;if(!Q)return;const W=Q.closest("[data-action-key]");W&&W.getAttribute("data-action-key")===C.value||J()}e.onMounted(()=>{document.addEventListener("click",ze,!0)}),e.onBeforeUnmount(()=>{f&&clearTimeout(f),document.removeEventListener("click",ze,!0),fe.emitter?.off?.("updateCard",_)});function Le(z,Q){const G=z?.[`${Q.name}_text`];if(Array.isArray(G))return G.length?G.join(", "):"-";if(G!=null&&G!=="")return G;const ve=z?.[Q.name];return Array.isArray(ve)?ve.length?ve.join(", "):"-":ve??"-"}function je(z,Q){const G=z?.[`${Q.name}_data`];if(G&&typeof G=="object")return{text:G.text??G.label??G.name??G.title??"-",color:G.color,textColor:G.textColor};const ve=z?.[`${Q.name}_text`]??z?.[Q.name];return{text:(Array.isArray(ve)?ve.join(", "):ve)??"-"}}function wt(z,Q){const W=je(z,Q);return W.color?{backgroundColor:W.color,color:W.textColor??"#ffffff"}:{}}function ut(z,Q){const W=U(Q);if(W==="badge")return je(z,Q).text;if(W==="select")return Le(z,Q);if(W==="slot")return"-";if(W==="text")return z?.[Q.name]??"-";const G=z?.[`${Q.name}_data`];return G!=null&&typeof G!="object"?G:z?.[`${Q.name}_text`]??z?.[Q.name]??"-"}return(z,Q)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ux,[e.createElementVNode("div",px,[e.createElementVNode("div",mx,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Q[0]||(Q[0]=W=>d.value=W),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:se},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",fx,[e.createVNode(tx,{columns:o.value,"onUpdate:columns":Q[1]||(Q[1]=W=>o.value=W)},null,8,["columns"]),V.value&&c.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:O,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},Q[2]||(Q[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)]))):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",hx,[e.createElementVNode("table",vx,[e.createElementVNode("thead",gx,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(W,G)=>(e.openBlock(),e.createElementBlock("th",{key:W.name,class:e.normalizeClass(he(G))},e.toDisplayString(W.ua),3))),128)),Z.value?(e.openBlock(),e.createElementBlock("th",yx," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",kx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,W=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:W.id??JSON.stringify(W)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(G,ve)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:G.name,class:e.normalizeClass(be(ve,G))},[G.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:G.link.replace("{{id}}",W.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(ut(W,G)),9,bx)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[U(G)==="slot"&&(G.slot?.content||G.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zb)(G.slot.content||G.slot)),{key:0,data:W,row:W,column:G,value:W?.[G.name]},null,8,["data","row","column","value"])):U(G)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(wt(W,G))},e.toDisplayString(je(W,G).text),5)):U(G)==="select"?(e.openBlock(),e.createElementBlock("span",xx,e.toDisplayString(Le(W,G)),1)):(e.openBlock(),e.createElementBlock("span",wx,e.toDisplayString(ut(W,G)),1))],64))],2)),[[e.unref(a),re(W,G)]])),128)),Z.value?(e.openBlock(),e.createElementBlock("td",Ex,[T(W)?(e.openBlock(),e.createElementBlock("div",Cx,[e.createVNode(ix,{row:W,actions:j.value,"is-open":P(W),"action-key":ue(W),onToggle:G=>X(W)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),oe.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",_x,[e.createElementVNode("td",{colspan:q.value.length+(Z.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Nx)]))])])]),e.createVNode(Gb,{"current-page":u.value,"total-pages":ee.value,label:H.value,onPrevious:Y,onNext:ie},null,8,["current-page","total-pages","label"])]))}}),Bx={class:"p-[20px]"},Sx={class:"flex gap-[6px] mb-5"},Mx={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Ax={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},Dx={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Tx={class:"space-y-8"},Lx={key:0},$x={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ix=["onClick"],Fx={class:"md:col-span-2"},Ox={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Px={class:"text-sm text-gray-500 dark:text-neutral-500"},Rx={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},zx=["checked","onChange"],jx={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Ux={class:"md:col-span-2"},Hx={class:"font-semibold text-gray-800 dark:text-neutral-200"},qx=["onClick"],Wx={class:"md:col-span-2"},Gx={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Kx={class:"text-sm text-gray-500 dark:text-neutral-500"},Yx={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Zx=["checked","onChange"],bl="uk",xl=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(l){const t=["en","uk","ua"],n=()=>{if(typeof window>"u")return bl;const b=localStorage.language,x=typeof navigator<"u"?navigator.language:bl;return(b||x||bl).split(/[-_]/)[0].toLowerCase()||bl},o=l,a=e.ref(""),r=["view","add","edit","del"],s=e.ref({}),i=e.ref(n()),c=()=>{i.value=n()},d=()=>{const b=[];return i.value&&b.push(i.value),t.forEach(x=>{x&&!b.includes(x)&&b.push(x)}),b.includes("path")||b.push("path"),b},u=b=>{const x=d();for(const D of x){const S=b[D];if(typeof S=="string"&&S.trim())return S}return""};e.onMounted(async()=>{c();const x=await(await fetch(`/api/access-group/${o.id}?tab=vs-group-interface`)).json();x.routes&&x.routes.forEach(D=>{s.value[D.path]=new Set(D.actions)})});const p=(b,x)=>s.value[b]?.has(x)??!1,g=(b,x)=>{s.value[b]||(s.value[b]=new Set),s.value[b].has(x)?s.value[b].delete(x):s.value[b].add(x)},y=(b,x)=>{b.forEach(D=>{D.path&&(s.value[D.path]||(s.value[D.path]=new Set),s.value[D.path].has(x)?s.value[D.path].delete(x):s.value[D.path].add(x))})},w=e.computed(()=>Object.entries(s.value).map(([b,x])=>({path:b,actions:Array.from(x)})).filter(b=>b.actions.length)),m=async()=>{await fetch(`/api/access-group/${o.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:w.value})}),fe.notify({title:"Success!",message:"Permissions saved."})},f=()=>{s.value={}},E=b=>{if(!a.value.trim())return b;const x=a.value.toLowerCase();return b.filter(D=>u(D).toLowerCase().includes(x)||(D.path?.toLowerCase().includes(x)??!1))},C=e.computed(()=>E(o.data.routers.filter(b=>!b.menu))),_=e.computed(()=>o.data.routers.filter(b=>b.menu).map(b=>({...b,menu:E(b.menu||[])})).filter(b=>b.menu&&b.menu.length>0));return(b,x)=>(e.openBlock(),e.createElementBlock("div",Bx,[e.createElementVNode("div",Sx,[e.createElementVNode("div",Mx,[x[1]||(x[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":x[0]||(x[0]=D=>a.value=D),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("button",{onClick:f,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:m,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Ax,[x[2]||(x[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(D,S)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:S},[e.createElementVNode("h3",Dx,e.toDisplayString(D),1)])),64))]),e.createElementVNode("div",Tx,[C.value.length?(e.openBlock(),e.createElementBlock("div",Lx,[e.createElementVNode("ul",$x,[x[3]||(x[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(D,S)=>e.createElementVNode("li",{key:S,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:M=>y(C.value,r[S])}," Toggle all ",8,Ix)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(D,S)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+S,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Fx,[e.createElementVNode("p",Ox,e.toDisplayString(u(D)),1),e.createElementVNode("p",Px,e.toDisplayString(D.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(M,O)=>e.createElementVNode("li",{key:O,class:"col-span-1"},[e.createElementVNode("div",Rx,[e.createElementVNode("input",{type:"checkbox",checked:p(D.path,M),onChange:K=>g(D.path,M),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,zx)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(D,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"space-y-5"},[e.createElementVNode("ul",jx,[e.createElementVNode("li",Ux,[e.createElementVNode("h3",Hx,e.toDisplayString(u(D)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(M,O)=>e.createElementVNode("li",{key:O,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:K=>y(D.menu,r[O])}," Toggle all ",8,qx)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.menu,(M,O)=>(e.openBlock(),e.createElementBlock("ul",{key:O,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Wx,[e.createElementVNode("p",Gx,e.toDisplayString(u(M)),1),e.createElementVNode("p",Kx,e.toDisplayString(M.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,(K,U)=>e.createElementVNode("li",{key:U,class:"col-span-1"},[e.createElementVNode("div",Yx,[e.createElementVNode("input",{type:"checkbox",checked:p(M.path,K),onChange:R=>g(M.path,K),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Zx)])])),64))]))),128))]))),128))])]))}}),qt={"vs-widget-comments":Tn,"vs-widget-history":Ln,"vs-widget-gallery":In,"vs-widget-file":$n,"vs-widget-list":Dl,"vs-widget-map":Vn,"vs-widget-table":jr,"vs-group-interface":xl};function Ur(l){if(l==null)return null;const t=Number(l);return Number.isFinite(t)?Math.max(1,Math.min(12,Math.floor(t))):null}function Hr(l){const t={...l};return Array.isArray(l.items)&&(t.items=l.items.map(n=>Hr(n))),t}function Jx(l,t=12){if(!l.length)return;const n=[],o=[];if(l.forEach(c=>{const d=Ur(c.col);d?(c.col=d,n.push({item:c,span:d})):o.push(c)}),!n.length&&o.length){o.forEach(c=>{c.col=12});return}const a=n.reduce((c,d)=>c+d.span,0);let r=t-a;if(o.length===0)return;r<=0&&(r=t);const s=Math.max(1,Math.floor(r/o.length));let i=Math.max(0,r-s*o.length);o.forEach(c=>{let d=s;i>0&&(d+=1,i-=1),c.col=Math.max(1,Math.min(12,d))})}function wl(l,t=12){if(!Array.isArray(l)||!l.length)return[];const n=l.map(o=>Hr(o));return n.forEach(o=>{Array.isArray(o.items)&&o.items.length&&(o.items=wl(o.items,12))}),Jx(n,t),n}function qr(l){const t=Ur(l);return t?t>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${t}`,`lg:col-span-${t}`]:[]}const Xx={class:"text-lg font-semibold text-gray-900"},Qx=["innerHTML"],Vx={key:0,class:"grid grid-cols-12 gap-4"},ew={key:0,class:"mb-4 pb-2 border-b border-gray-200"},tw={class:"text-lg font-semibold text-gray-900"},nw=["innerHTML"],Cn=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(l){const t=l,n=e.computed(()=>{if(!t.col)return{};const d=Math.max(1,Math.min(12,Number(t.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),o=e.computed(()=>wl(t.items));function a(d){const u=["col-span-12"],p=qr(d.col);return p.length&&u.push(...p),u}function r(d){return qt[d]||d}function s(d,u){if(!d||typeof u!="string"||!u)return{found:!1,value:void 0};const p=u.split(".");let g=d;for(const y of p){if(g==null||typeof g!="object"&&!Array.isArray(g))return{found:!1,value:void 0};if(!(y in g))return{found:!1,value:void 0};g=g[y]}return{found:!0,value:g}}const i=function(d={}){const u={...d};return Object.entries(u).forEach(([p,g])=>{if(p!=="props"&&typeof g=="string"){const y=s(t.data,g);y.found&&(u[p]=y.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([p,g])=>{if(typeof g=="string"){const y=s(t.data,g);u[p]=y.found?y.value:g}else u[p]=g}),delete u.props,u},c=e.computed(()=>{const d={};return t.col&&(d.col=t.col),d});return(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[n.value,d.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!d.hideTitle&&d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",d.styling?.classItemTitle])},[e.createElementVNode("h3",Xx,e.toDisplayString(d.title),1)],2)):e.createCommentVNode("",!0),d.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:d.html,class:"text-gray-900 leading-relaxed"},null,8,Qx)):d.type?.includes("tabs")?(e.openBlock(),e.createBlock(_n,{key:2,view:d.type,panels:d.items,data:d.data,styling:d.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o.value.length?(e.openBlock(),e.createElementBlock("div",Vx,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:p.name||p.component||g,class:e.normalizeClass(a(p))},[p.title||p.label?(e.openBlock(),e.createElementBlock("div",ew,[e.createElementVNode("h3",tw,e.toDisplayString(p.title||p.label),1)])):e.createCommentVNode("",!0),p.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:p.html,class:"text-gray-900 leading-relaxed"},null,8,nw)):p.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r(p.component)),e.mergeProps({key:2,ref_for:!0},{geom:d.data.geom,id:d.data.id,...c.value,...i(p),data:d.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),lw={class:"grid grid-cols-12 gap-[20px]"},ow={key:0,class:"col-span-4"},aw=["innerHTML"],rw=["onClick"],sw=["innerHTML"],iw={key:1,class:"flex w-full"},cw={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},dw=["onClick"],uw={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},pw={class:"flex-1 p-4"},mw=["innerHTML"],fw={class:"grid grid-cols-12 gap-4"},hw={key:3,class:"w-full h-full"},_n=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(l){const t=l;function n(){const N=typeof window<"u"?window:globalThis,j="__vsCardAnonymousCounter__",$=N[j]??0;return N[j]=$+1,$===0?"tab":`tab${$}`}const o=e.ref(0),a=e.ref([]);let r=!1,s=!1;const i=e.ref(t.id??n());e.watch(()=>t.id,N=>{N&&(i.value=N)});const c=new Map,d=e.computed(()=>t.view==="tabs"||t.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function u(N,j){const $=j?.path;return $?(c.has($)||c.set($,e.defineAsyncComponent(()=>import($))),c.get($)):typeof N=="string"&&qt[N]?qt[N]:j?.component&&qt[j.component]?qt[j.component]:j?.name&&qt[j.name]?qt[j.name]:N}function p(N){return N.forEach(j=>{j.type&&(j.view=j.type)}),a.value=N.filter(j=>j.type==="pin"),N.filter(j=>j.type!=="pin")}const g=e.computed(()=>{let N;return t.panels&&t.panels.length>0?N=t.normalizeTabs?p(t.panels):t.panels:t.data&&Array.isArray(t.data)&&(N=t.data.filter($=>$.type.includes("tabs"))[0]?.items),wl(N,12)}),y=e.computed(()=>i.value);function w(){s||(s=!0)}const m=e.computed(()=>{let N;return t.panels&&t.panels.length>0?N=t.normalizeTabs?p(t.panels):t.panels:t.data&&Array.isArray(t.data)&&(N=t.data),wl(N,12)}),f=e.computed(()=>({[`view-${t.view}`]:!0}));function E(N,j){if(!N||typeof j!="string"||!j)return{found:!1,value:void 0};const $=j.split(".");let Z=N;for(const V of $){if(Z==null||typeof Z!="object"&&!Array.isArray(Z))return{found:!1,value:void 0};if(!(V in Z))return{found:!1,value:void 0};Z=Z[V]}return{found:!0,value:Z}}const C=N=>{const j={...N};return Object.entries(j).forEach(([$,Z])=>{if($!=="props"&&typeof Z=="string"){const V=E(t.data,Z);V.found&&(j[$]=V.value)}}),N.props&&typeof N.props=="object"&&Object.entries(N.props).forEach(([$,Z])=>{if(typeof Z=="string"){const V=E(t.data,Z);j[$]=V.found?V.value:Z}else j[$]=Z}),delete j.props,t.data&&(j.data=t.data),j};function _(N){const j=["col-span-12"],$=qr(N.col);return $.length&&j.push(...$),j}const b=e.ref([]),x=e.ref([]),D=e.ref([]);function S(N,j){N&&N instanceof HTMLElement&&(b.value[j]=N)}function M(){x.value=b.value.map(N=>N.offsetWidth),D.value=b.value.map(N=>N.offsetLeft)}function O(){if(typeof window>"u")return null;const N=y.value;if(!N)return null;const $=new URL(window.location.href).searchParams.get(N);if($===null)return null;const Z=Number.parseInt($,10);return Number.isNaN(Z)?null:Z}function K(N){if(typeof window>"u")return;const j=y.value;if(!j||!s)return;const $=new URL(window.location.href);N<=0?$.searchParams.delete(j):$.searchParams.set(j,String(N));const Z=window.history.state??{};window.history.replaceState(Z,document.title,$)}function U(){if(r||!g.value.length)return;w();const N=O();if(N===null)return;const j=Math.min(Math.max(N,0),g.value.length-1);j!==N&&K(j),j!==o.value&&(o.value=j),r=!0}function R(){r=!1,U()}let q=null;return e.onMounted(()=>{e.nextTick(()=>{U(),M()}),typeof window<"u"&&window.addEventListener("popstate",R),q=new ResizeObserver(()=>M()),q.observe(document.body)}),e.onBeforeUnmount(()=>{q?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",R)}),e.watch(o,N=>{e.nextTick(()=>{M()}),K(N)}),e.watch(g,()=>{r=!1,U()}),(N,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(N.classWrapper||f.value)},[e.createElementVNode("div",lw,[a.value.length!==0?(e.openBlock(),e.createElementBlock("div",ow,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value[0].items,($,Z)=>(e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,aw)):$.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component,$)),e.mergeProps({key:1,ref_for:!0},$.component==="Card"?$:C($),{id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value.length!==0?"col-span-8":"col-span-12")},[N.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",N.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",N.styling?.classTabHeader])},[x.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:x.value[o.value]+"px",left:D.value[o.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>(e.openBlock(),e.createElementBlock("button",{key:$.name||Z,ref_for:!0,ref:V=>S(V,Z),onClick:V=>o.value=Z,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",o.value===Z?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString($.title||$.label||$.name||`Tab ${Z+1}`),11,rw))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([N.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",o.value===Z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",N.classPanel||"w-full border-gray-100"])},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,sw)):N.$slots[`tab-${Z}`]?e.renderSlot(N.$slots,`tab-${Z}`,{key:1,item:$,data:N.data}):$.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:2,ref_for:!0},C($),{items:$.items,"hide-title":!0,class:["w-full h-full",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component||$.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component||$.name,$)),e.mergeProps({key:3,ref_for:!0},$.component==="Card"?$:C($),{styling:N.styling,id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(N.$slots,$.slot||`tab-${Z}`,{key:4,item:$,data:N.data})],2)),[[e.vShow,o.value===Z]])),128))],2)],2)):N.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",iw,[e.createElementVNode("div",cw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>(e.openBlock(),e.createElementBlock("button",{key:$.name||Z,onClick:V=>o.value=Z,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",o.value===Z?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString($.title||$.label||$.name||`Tab ${Z+1}`)+" ",1),o.value===Z?(e.openBlock(),e.createElementBlock("span",uw,j[0]||(j[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,dw))),128))]),e.createElementVNode("div",pw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,($,Z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:$.name||Z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",o.value===Z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",N.classPanel||"w-full border-gray-100 py-2"])},[$.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:$.html,class:"text-gray-900 leading-relaxed"},null,8,mw)):N.$slots[`tab-${Z}`]?e.renderSlot(N.$slots,`tab-${Z}`,{key:1,item:$,data:N.data}):$.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:2,ref_for:!0},C($),{items:$.items,"hide-title":!0,class:["w-full h-full",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component||$.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component||$.name,$)),e.mergeProps({key:3,ref_for:!0},$.component==="Card"?$:C($),{id:N.data.id,class:["w-full h-full",N.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(N.$slots,$.slot||`tab-${Z}`,{key:4,item:$,data:N.data})],2)),[[e.vShow,o.value===Z]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(N.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",fw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,Z)=>(e.openBlock(),e.createElementBlock("div",{key:$.name||$.component||Z,class:e.normalizeClass(_($))},[N.$slots[`panel-${Z}`]?e.renderSlot(N.$slots,`panel-${Z}`,{key:0,item:$,data:N.data}):$.items||$.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Cn),e.mergeProps({key:1,ref_for:!0},C($),{items:$.items||[],class:["w-full h-auto",N.styling?.classItem],styling:N.styling}),null,16,["items","class","styling"])):$.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u($.component,$)),e.mergeProps({key:2,ref_for:!0},C($),{class:["w-full h-auto",[N.styling?.classItem]],styling:N.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",hw,[e.renderSlot(N.$slots,$.slot||`panel-${Z}`,{item:$,data:N.data})]))],2))),128))])],2))],2)])],2))}}),vw=["onClick"],Wr=_t(e.defineComponent({__name:"CopyNotification",setup(l,{expose:t}){const n=e.ref([]);let o=1;const a=()=>{if(n.value.length>=10){const i=n.value[0];clearTimeout(i.timer),n.value.shift()}const s={id:o++,timer:setTimeout(()=>{r(s.id)},1500)};n.value.push(s)},r=s=>{const i=n.value.findIndex(c=>c.id===s);if(i!==-1){const c=n.value[i];clearTimeout(c.timer),n.value.splice(i,1)}};return t({addNotification:a}),e.onUnmounted(()=>{n.value.forEach(s=>{clearTimeout(s.timer)})}),(s,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(ps),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),i[0]||(i[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>r(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Ml),{class:"h-4 w-4"})],8,vw)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);_n.install=function(l){l.component("vs-widget-file",$n),l.component("vs-widget-comments",Tn),l.component("vs-widget-history",Ln),l.component("vs-widget-gallery",In),l.component("vs-widget-map",Vn),l.component("vs-group-interface",xl),l.component("CommentsWidget",Tn),l.component("HistoryWidget",Ln),l.component("GalleryWidget",In),l.component("FilesWidget",$n),l.component("MapWidget",Vn),l.component("Card",_n),l.component("CardItem",Cn),l.component("DescriptionListWidget",Dl),l.component("CopyNotification",Wr),l.component("GroupInterfaceWidget",xl)};function Tt(l){return typeof l=="string"||l instanceof String}function Gr(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function Kr(l,t){return Array.isArray(t)?Kr(l,(n,o)=>t.includes(o)):Object.entries(l).reduce((n,o)=>{let[a,r]=o;return t(r,a)&&(n[a]=r),n},{})}const de={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Yr(l){switch(l){case de.LEFT:return de.FORCE_LEFT;case de.RIGHT:return de.FORCE_RIGHT;default:return l}}function Fo(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function El(l,t){if(t===l)return!0;const n=Array.isArray(t),o=Array.isArray(l);let a;if(n&&o){if(t.length!=l.length)return!1;for(a=0;a<t.length;a++)if(!El(t[a],l[a]))return!1;return!0}if(n!=o)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const r=t instanceof Date,s=l instanceof Date;if(r&&s)return t.getTime()==l.getTime();if(r!=s)return!1;const i=t instanceof RegExp,c=l instanceof RegExp;if(i&&c)return t.toString()==l.toString();if(i!=c)return!1;const d=Object.keys(t);for(a=0;a<d.length;a++)if(!Object.prototype.hasOwnProperty.call(l,d[a]))return!1;for(a=0;a<d.length;a++)if(!El(l[d[a]],t[d[a]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class gw{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?de.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?de.RIGHT:de.LEFT}}function ge(l,t){return new ge.InputMask(l,t)}function Zr(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ge.MaskedRegExp:Tt(l)?ge.MaskedPattern:l===Date?ge.MaskedDate:l===Number?ge.MaskedNumber:Array.isArray(l)||l===Array?ge.MaskedDynamic:ge.Masked&&l.prototype instanceof ge.Masked?l:ge.Masked&&l instanceof ge.Masked?l.constructor:l instanceof Function?ge.MaskedFunction:(console.warn("Mask not found for mask",l),ge.Masked)}function on(l){if(!l)throw new Error("Options in not defined");if(ge.Masked){if(l.prototype instanceof ge.Masked)return{mask:l};const{mask:t=void 0,...n}=l instanceof ge.Masked?{mask:l}:Gr(l)&&l.mask instanceof ge.Masked?l:{};if(t){const o=t.mask;return{...Kr(t,(a,r)=>!r.startsWith("_")),mask:t.constructor,_mask:o,...n}}}return Gr(l)?{...l}:{mask:l}}function kt(l){if(ge.Masked&&l instanceof ge.Masked)return l;const t=on(l),n=Zr(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}ge.createMask=kt;class Cl{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch{}}get isActive(){return!1}}ge.MaskElement=Cl;const Jr=90,yw=89;class Nn extends Cl{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,o;return(t=(n=(o=this.input).getRootNode)==null?void 0:n.call(o))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Jr&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===yw&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Jr&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ge.HTMLMaskElement=Nn;class Xr extends Nn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}ge.HTMLMaskElement=Nn;class Oo extends Nn{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),o=n&&n.anchorOffset,a=n&&n.focusOffset;return a==null||o==null||o<a?o:a}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),o=n&&n.anchorOffset,a=n&&n.focusOffset;return a==null||o==null||o>a?o:a}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const o=this.rootElement.createRange();o.setStart(this.input.firstChild||this.input,t),o.setEnd(this.input.lastChild||this.input,n);const a=this.rootElement,r=a.getSelection&&a.getSelection();r&&(r.removeAllRanges(),r.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ge.HTMLContenteditableMaskElement=Oo;class _l{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>_l.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}_l.MAX_LENGTH=100;class Qr{constructor(t,n){this.el=t instanceof Cl?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Oo(t):new Xr(t),this.masked=kt(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new _l,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ge.Masked)&&this.masked.constructor===Zr(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof ge.Masked?t:kt({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const o=this._listeners[t];o&&o.forEach(a=>a(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,o=this.masked.value,a=this.masked.rawInputValue,r=this.displayValue,s=this.unmaskedValue!==n||this.value!==o||this._rawInputValue!==a;this._unmaskedValue=n,this._value=o,this._rawInputValue=a,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...o}=t,a=!this.maskEquals(n),r=this.masked.optionsIsChanged(o);a&&(this.mask=n),r&&this.masked.updateOptions(o),(a||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,de.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const o=this._listeners[t].indexOf(n);return o>=0&&this._listeners[t].splice(o,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new gw({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),o=this.masked.rawInputValue,a=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,r=o===this.masked.rawInputValue?n.removeDirection:de.NONE;let s=this.masked.nearestInputPos(n.startChangePos+a,r);r!==de.NONE&&(s=this.masked.nearestInputPos(s,de.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ge.InputMask=Qr;class ke{static normalize(t){return Array.isArray(t)?t:[t,new ke]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ge.ChangeDetails=ke;class bt{constructor(t,n,o){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=o}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Ge{constructor(t){this._value="",this._update({...Ge.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new bt(this.extractInput(t,n),t)}appendTail(t){return Tt(t)&&(t=new bt(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new ke({inserted:t,rawInserted:t})):new ke}_appendChar(t,n,o){n===void 0&&(n={});const a=this.state;let r;if([t,r]=this.doPrepareChar(t,n),t&&(r=r.aggregate(this._appendCharRaw(t,n)),!r.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=a;let i=this.pad(n);const c=this._appendCharRaw(t,n);i=i.aggregate(c),c.rawInserted||i.equals(r)?r=i:this.state=s}if(r.inserted){let s,i=this.doValidate(n)!==!1;if(i&&o!=null){const c=this.state;if(this.overwrite===!0){s=o.state;for(let u=0;u<r.rawInserted.length;++u)o.unshift(this.displayValue.length-r.tailShift)}let d=this.appendTail(o);if(i=d.rawInserted.length===o.toString().length,!(i&&d.inserted)&&this.overwrite==="shift"){this.state=c,s=o.state;for(let u=0;u<r.rawInserted.length;++u)o.shift();d=this.appendTail(o),i=d.rawInserted.length===o.toString().length}i&&d.inserted&&(this.state=c)}i||(r=new ke,this.state=a,o&&s&&(o.state=s))}return r}_appendPlaceholder(){return new ke}_appendEager(){return new ke}append(t,n,o){if(!Tt(t))throw new Error("value should be string");const a=Tt(o)?new bt(String(o)):o;n!=null&&n.tail&&(n._beforeTailState=this.state);let r;[t,r]=this.doPrepare(t,n);for(let s=0;s<t.length;++s){const i=this._appendChar(t[s],n,a);if(!i.rawInserted&&!this.doSkipInvalid(t[s],n,a))break;r.aggregate(i)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&r.aggregate(this._appendEager()),a!=null&&(r.tailShift+=this.appendTail(a).tailShift),r}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new ke}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,o=this.value,a=t();return this.rawInputValue=n,this.value&&this.value!==o&&o.indexOf(this.value)===0&&(this.append(o.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,o=t(this);return this.state=n,delete this._isolated,o}doSkipInvalid(t,n,o){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),ke.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),ke.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,o,a,r){o===void 0&&(o=""),a===void 0&&(a=de.NONE),r===void 0&&(r={input:!0});const s=t+n,i=this.extractTail(s),c=this.eager===!0||this.eager==="remove";let d;c&&(a=Yr(a),d=this.extractInput(0,s,{raw:!0}));let u=t;const p=new ke;if(a!==de.NONE&&(u=this.nearestInputPos(t,n>1&&t!==0&&!c?de.NONE:a),p.tailShift=u-t),p.aggregate(this.remove(u)),c&&a!==de.NONE&&d===this.rawInputValue)if(a===de.FORCE_LEFT){let g;for(;d===this.rawInputValue&&(g=this.displayValue.length);)p.aggregate(new ke({tailShift:-1})).aggregate(this.remove(g-1))}else a===de.FORCE_RIGHT&&i.unshift();return p.aggregate(this.append(o,r,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!El(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Ge.EMPTY_VALUES.includes(t)&&Ge.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new ke}}Ge.DEFAULTS={skipInvalid:!0},Ge.EMPTY_VALUES=[void 0,null,""],ge.Masked=Ge;class Lt{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Tt(t)?new bt(String(t)):t;const n=this.chunks[this.chunks.length-1],o=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof bt)o?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Lt){if(t.stop==null){let a;for(;t.chunks.length&&t.chunks[0].stop==null;)a=t.chunks.shift(),a.from+=t.from,this.extend(a)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ge.MaskedPattern))return new bt(this.toString()).appendTo(t);const n=new ke;for(let o=0;o<this.chunks.length;++o){const a=this.chunks[o],r=t._mapPosToBlock(t.displayValue.length),s=a.stop;let i;if(s!=null&&(!r||r.index<=s)&&((a instanceof Lt||t._stops.indexOf(s)>=0)&&n.aggregate(t._appendPlaceholder(s)),i=a instanceof Lt&&t._blocks[s]),i){const c=i.appendTail(a);n.aggregate(c);const d=a.toString().slice(c.rawInserted.length);d&&n.aggregate(t.append(d,{tail:!0}))}else n.aggregate(t.append(a.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...o}=t;Object.assign(this,o),this.chunks=n.map(a=>{const r="chunks"in a?new Lt:new bt;return r.state=a,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let o=0;for(;o<this.chunks.length;){const a=this.chunks[o],r=a.unshift(n);if(a.toString()){if(!r)break;++o}else this.chunks.splice(o,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],o=n.shift();if(n.toString()){if(!o)break;--t}else this.chunks.splice(t,1);if(o)return o}return""}}class kw{constructor(t,n){this.masked=t,this._log=[];const{offset:o,index:a}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=o,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,de.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,de.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,de.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,de.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,de.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,de.NONE),!0})}}class Po{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new ke}nearestInputPos(t,n){n===void 0&&(n=de.NONE);const o=0,a=this._value.length;switch(n){case de.LEFT:case de.FORCE_LEFT:return o;case de.NONE:case de.RIGHT:case de.FORCE_RIGHT:default:return a}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),o===void 0&&(o={}),o.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new ke;const o=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!o)&&!n.tail,r=new ke({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new ke;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new bt("")}appendTail(t){return Tt(t)&&(t=new bt(String(t))),t.appendTo(this)}append(t,n,o){const a=this._appendChar(t[0],n);return o!=null&&(a.tailShift+=this.appendTail(o).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Bn{constructor(t){const{parent:n,isOptional:o,placeholderChar:a,displayChar:r,lazy:s,eager:i,...c}=t;this.masked=kt(c),Object.assign(this,{parent:n,isOptional:o,placeholderChar:a,displayChar:r,lazy:s,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new ke}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new ke;const o=this.masked.state;let a=this.masked._appendChar(t,this.currentMaskFlags(n));return a.inserted&&this.doValidate(n)===!1&&(a=new ke,this.masked.state=o),!a.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(t,n,o){return this.masked.append(t,this.currentMaskFlags(n),o)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ke:(this.isFilled=!0,new ke({inserted:this.placeholderChar}))}_appendEager(){return new ke}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,o)}nearestInputPos(t,n){n===void 0&&(n=de.NONE);const o=0,a=this.value.length,r=Math.min(Math.max(t,o),a);switch(n){case de.LEFT:case de.FORCE_LEFT:return this.isComplete?r:o;case de.RIGHT:case de.FORCE_RIGHT:return this.isComplete?r:a;case de.NONE:default:return r}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||t?._beforeTailState}}pad(t){return new ke}}Bn.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Vr extends Ge{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=o=>o.search(n)>=0),super._update(t)}}ge.MaskedRegExp=Vr;class Ke extends Ge{constructor(t){super({...Ke.DEFAULTS,...t,definitions:Object.assign({},Bn.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let o=!1,a=!1;for(let r=0;r<n.length;++r){if(this.blocks){const d=n.slice(r),u=Object.keys(this.blocks).filter(g=>d.indexOf(g)===0);u.sort((g,y)=>y.length-g.length);const p=u[0];if(p){const{expose:g,repeat:y,...w}=on(this.blocks[p]),m={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...w,repeat:y,parent:this},f=y!=null?new ge.RepeatBlock(m):kt(m);f&&(this._blocks.push(f),g&&(this.exposeBlock=f),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),r+=p.length-1;continue}}let s=n[r],i=s in t;if(s===Ke.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){o=!o;continue}if(s==="["||s==="]"){a=!a;continue}if(s===Ke.ESCAPE_CHAR){if(++r,s=n[r],!s)break;i=!1}const c=i?new Bn({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...on(t[s]),parent:this}):new Po({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...o}=t;this._blocks.forEach((a,r)=>a.state=n[r]),super.state=o}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new ke;let o=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(o==null)return n;this._blocks[o].isFilled&&++o;for(let a=o;a<this._blocks.length;++a){const r=this._blocks[a]._appendEager();if(!r.inserted)break;n.aggregate(r)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const o=this._mapPosToBlock(this.displayValue.length),a=new ke;if(!o)return a;for(let s=o.index,i;i=this._blocks[s];++s){var r;const c=i._appendChar(t,{...n,_beforeTailState:(r=n._beforeTailState)==null||(r=r._blocks)==null?void 0:r[s]});if(a.aggregate(c),c.consumed)break}return a}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=new Lt;return t===n||this._forEachBlocksInRange(t,n,(a,r,s,i)=>{const c=a.extractTail(s,i);c.stop=this._findStopBefore(r),c.from=this._blockStartPos(r),c instanceof Lt&&(c.blockIndex=r),o.extend(c)}),o}extractInput(t,n,o){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),o===void 0&&(o={}),t===n)return"";let a="";return this._forEachBlocksInRange(t,n,(r,s,i,c)=>{a+=r.extractInput(i,c,o)}),a}_findStopBefore(t){let n;for(let o=0;o<this._stops.length;++o){const a=this._stops[o];if(a<=t)n=a;else break}return n}_appendPlaceholder(t){const n=new ke;if(this.lazy&&t==null)return n;const o=this._mapPosToBlock(this.displayValue.length);if(!o)return n;const a=o.index,r=t??this._blocks.length;return this._blocks.slice(a,r).forEach(s=>{if(!s.lazy||t!=null){var i;n.aggregate(s._appendPlaceholder((i=s._blocks)==null?void 0:i.length))}}),n}_mapPosToBlock(t){let n="";for(let o=0;o<this._blocks.length;++o){const a=this._blocks[o],r=n.length;if(n+=a.displayValue,t<=n.length)return{index:o,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,o)=>n+=o.displayValue.length,0)}_forEachBlocksInRange(t,n,o){n===void 0&&(n=this.displayValue.length);const a=this._mapPosToBlock(t);if(a){const r=this._mapPosToBlock(n),s=r&&a.index===r.index,i=a.offset,c=r&&s?r.offset:this._blocks[a.index].displayValue.length;if(o(this._blocks[a.index],a.index,i,c),r&&!s){for(let d=a.index+1;d<r.index;++d)o(this._blocks[d],d,0,this._blocks[d].displayValue.length);o(this._blocks[r.index],r.index,0,r.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=super.remove(t,n);return this._forEachBlocksInRange(t,n,(a,r,s,i)=>{o.aggregate(a.remove(s,i))}),o}nearestInputPos(t,n){if(n===void 0&&(n=de.NONE),!this._blocks.length)return 0;const o=new kw(this,t);if(n===de.NONE)return o.pushRightBeforeInput()||(o.popState(),o.pushLeftBeforeInput())?o.pos:this.displayValue.length;if(n===de.LEFT||n===de.FORCE_LEFT){if(n===de.LEFT){if(o.pushRightBeforeFilled(),o.ok&&o.pos===t)return t;o.popState()}if(o.pushLeftBeforeInput(),o.pushLeftBeforeRequired(),o.pushLeftBeforeFilled(),n===de.LEFT){if(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.ok&&o.pos<=t||(o.popState(),o.ok&&o.pos<=t))return o.pos;o.popState()}return o.ok?o.pos:n===de.FORCE_LEFT?0:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:0)}return n===de.RIGHT||n===de.FORCE_RIGHT?(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.pushRightBeforeFilled()?o.pos:n===de.FORCE_RIGHT?this.displayValue.length:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:this.nearestInputPos(t,de.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let o=0;return this._forEachBlocksInRange(t,n,(a,r,s,i)=>{o+=a.totalInputPositions(s,i)}),o}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(o=>this._blocks[o]):[]}pad(t){const n=new ke;return this._forEachBlocksInRange(0,this.displayValue.length,o=>n.aggregate(o.pad(t))),n}}Ke.DEFAULTS={...Ge.DEFAULTS,lazy:!0,placeholderChar:"_"},Ke.STOP_CHAR="`",Ke.ESCAPE_CHAR="\\",Ke.InputDefinition=Bn,Ke.FixedDefinition=Po,ge.MaskedPattern=Ke;class Sn extends Ke{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:o=this.from||0,maxLength:a=this.maxLength||0,autofix:r=this.autofix,...s}=t;this.to=n,this.from=o,this.maxLength=Math.max(String(n).length,a),this.autofix=r;const i=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let d=0;for(;d<c.length&&c[d]===i[d];)++d;s.mask=c.slice(0,d).replace(/0/g,"\\0")+"0".repeat(this.maxLength-d),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",o="";const[,a,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(n="0".repeat(a.length)+r,o="9".repeat(a.length)+r),n=n.padEnd(this.maxLength,"0"),o=o.padEnd(this.maxLength,"9"),[n,o]}doPrepareChar(t,n){n===void 0&&(n={});let o;return[t,o]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(o.skip=!this.isComplete),[t,o]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const o=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[r,s]=this.boundaries(this.value+t);return Number(s)<this.from?super._appendCharRaw(o[this.value.length],n):Number(r)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(o[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(a[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[o,a]=this.boundaries(n);return this.from<=Number(a)&&Number(o)<=this.to&&super.doValidate(t)}pad(t){const n=new ke;if(this.value.length===this.maxLength)return n;const o=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let r=0;r<a;++r)n.aggregate(super._appendCharRaw("0",t));o.split("").forEach(r=>this._appendCharRaw(r))}return n}}ge.MaskedRange=Sn;const bw="d{.}`m{.}`Y";class xt extends Ke{static extractPatternOptions(t){const{mask:n,pattern:o,...a}=t;return{...a,mask:Tt(n)?n:o}}constructor(t){super(xt.extractPatternOptions({...xt.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:o,blocks:a,...r}={...xt.DEFAULTS,...t},s=Object.assign({},xt.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,a),super._update({...r,mask:Tt(n)?n:o,blocks:s})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(xt.extractPatternOptions(t))}}xt.GET_DEFAULT_BLOCKS=()=>({d:{mask:Sn,from:1,to:31,maxLength:2},m:{mask:Sn,from:1,to:12,maxLength:2},Y:{mask:Sn,from:1900,to:9999}}),xt.DEFAULTS={...Ke.DEFAULTS,mask:Date,pattern:bw,format:(l,t)=>{if(!l)return"";const n=String(l.getDate()).padStart(2,"0"),o=String(l.getMonth()+1).padStart(2,"0"),a=l.getFullYear();return[n,o,a].join(".")},parse:(l,t)=>{const[n,o,a]=l.split(".").map(Number);return new Date(a,o-1,n)}},ge.MaskedDate=xt;class Mn extends Ge{constructor(t){super({...Mn.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:o,...a}=on(n),r=kt({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a});return o&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const o=this._applyDispatch(t,n);return this.currentMask&&o.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),o}_applyDispatch(t,n,o){t===void 0&&(t=""),n===void 0&&(n={}),o===void 0&&(o="");const a=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,r=this.rawInputValue,s=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:r,i=r.slice(s.length),c=this.currentMask,d=new ke,u=c?.state;return this.currentMask=this.doDispatch(t,{...n},o),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),d.tailShift=this.currentMask.value.length-a.length),i&&(d.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),d}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new ke;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,o;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((o=t._beforeTailState)==null?void 0:o.currentMask)||t._beforeTailState}}doDispatch(t,n,o){return n===void 0&&(n={}),o===void 0&&(o=""),this.dispatch(t,this,n,o)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[o,a]=super.doPrepare(t,n);if(this.currentMask){let r;[o,r]=super.doPrepare(o,this.currentMaskFlags(n)),a=a.aggregate(r)}return[o,a]}doPrepareChar(t,n){n===void 0&&(n={});let[o,a]=super.doPrepareChar(t,n);if(this.currentMask){let r;[o,r]=super.doPrepareChar(o,this.currentMaskFlags(n)),a=a.aggregate(r)}return[o,a]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const o=new ke;return this.currentMask&&o.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),o}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:o,currentMask:a,...r}=t;n&&this.compiledMasks.forEach((s,i)=>s.state=n[i]),o!=null&&(this.currentMask=o,this.currentMask.state=a),super.state=r}extractInput(t,n,o){return this.currentMask?this.currentMask.extractInput(t,n,o):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,o)=>{if(!t[o])return;const{mask:a,...r}=t[o];return El(n,r)&&n.maskEquals(a)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}Mn.DEFAULTS={...Ge.DEFAULTS,dispatch:(l,t,n,o)=>{if(!t.compiledMasks.length)return;const a=t.rawInputValue,r=t.compiledMasks.map((s,i)=>{const c=t.currentMask===s,d=c?s.displayValue.length:s.nearestInputPos(s.displayValue.length,de.FORCE_LEFT);return s.rawInputValue!==a?(s.reset(),s.append(a,{raw:!0})):c||s.remove(d),s.append(l,t.currentMaskFlags(n)),s.appendTail(o),{index:i,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(d,s.nearestInputPos(s.displayValue.length,de.FORCE_LEFT)))}});return r.sort((s,i)=>i.weight-s.weight||i.totalInputPositions-s.totalInputPositions),t.compiledMasks[r[0].index]}},ge.MaskedDynamic=Mn;class An extends Ke{constructor(t){super({...An.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...o}=t;if(n){const a=n.map(i=>i.length),r=Math.min(...a),s=Math.max(...a)-r;o.mask="*".repeat(r),s&&(o.mask+="["+"*".repeat(s)+"]"),this.enum=n}super._update(o)}_appendCharRaw(t,n){n===void 0&&(n={});const o=Math.min(this.nearestInputPos(0,de.FORCE_RIGHT),this.value.length),a=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,o));if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,i)=>{const c=a[0][i];i>=this.value.length||c===s.value||(s.reset(),s._appendChar(c,n))});const r=super._appendCharRaw(a[0][this.value.length],n);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(s=>r.aggregate(super._appendCharRaw(s))),r}return new ke({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new bt("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new ke;const o=Math.min(super.nearestInputPos(0,de.FORCE_RIGHT),this.value.length);let a;for(a=t;a>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(o,a),o)).length>1);--a);const r=super.remove(a,n);return r.tailShift+=a-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}An.DEFAULTS={...Ke.DEFAULTS,matchValue:(l,t,n)=>l.indexOf(t,n)===n},ge.MaskedEnum=An;class es extends Ge{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ge.MaskedFunction=es;var ts;class ot extends Ge{constructor(t){super({...ot.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",o=(this.scale?"("+Fo(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Fo).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Fo(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[o,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!o&&(a.skip=!0),o&&!this.allowPositive&&!this.value&&o!=="-"&&a.aggregate(this._appendChar("-")),[o,a]}_separatorsCount(t,n){n===void 0&&(n=!1);let o=0;for(let a=0;a<t;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++o,n&&(t+=this.thousandsSeparator.length));return o}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,o){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,o))}_appendCharRaw(t,n){n===void 0&&(n={});const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(o);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const s=this.number;let i=!isNaN(s),c=!1;if(i){let g;this.min!=null&&this.min<0&&this.number<this.min&&(g=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(g=this.max),g!=null&&(this.autofix?(this._value=this.format(g,this).replace(ot.UNMASKED_RADIX,this.radix),c||(c=r===this._value&&!n.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let d;i?d=new ke({inserted:this._value.slice(r.length),rawInserted:c?"":t,skip:c}):(this._value=r,d=new ke),this._value=this._insertThousandsSeparators(this._value);const u=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(u);return d.tailShift+=(p-a)*this.thousandsSeparator.length,d}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,o=this.value.indexOf(this.thousandsSeparator,n);if(o<=t)return o}return-1}_adjustRangeWithSeparators(t,n){const o=this._findSeparatorAround(t);o>=0&&(t=o);const a=this._findSeparatorAround(n);return a>=0&&(n=a+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const o=this.value.slice(0,t),a=this.value.slice(n),r=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+a));const s=this._separatorsCountFromSlice(o);return new ke({tailShift:(s-r)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case de.NONE:case de.LEFT:case de.FORCE_LEFT:{const o=this._findSeparatorAround(t-1);if(o>=0){const a=o+this.thousandsSeparator.length;if(t<a||this.value.length<=a||n===de.FORCE_LEFT)return o}break}case de.RIGHT:case de.FORCE_RIGHT:{const o=this._findSeparatorAround(t);if(o>=0)return o+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let o=this.value;this.normalizeZeros&&(o=this._normalizeZeros(o)),this.padFractionalZeros&&this.scale>0&&(o=this._padFractionalZeros(o)),this._value=o}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(o,a,r,s)=>a+s),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,o){n===void 0&&(n={});const a=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ot.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,o)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ot.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ot.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ot.EMPTY_VALUES.includes(t)&&ot.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}ts=ot,ot.UNMASKED_RADIX=".",ot.EMPTY_VALUES=[...Ge.EMPTY_VALUES,0],ot.DEFAULTS={...Ge.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[ts.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ge.MaskedNumber=ot;const Nl={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Ro(l,t,n){t===void 0&&(t=Nl.MASKED),n===void 0&&(n=Nl.MASKED);const o=kt(l);return a=>o.runIsolated(r=>(r[t]=a,r[n]))}function ns(l,t,n,o){return Ro(t,n,o)(l)}ge.PIPE_TYPE=Nl,ge.createPipe=Ro,ge.pipe=ns;class ls extends Ke{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,o,a;const{repeat:r,...s}=on(t);this._blockOpts=Object.assign({},this._blockOpts,s);const i=kt(this._blockOpts);this.repeat=(n=(o=r??i.repeat)!=null?o:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(kt(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const o=new ke;for(let c=(a=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?a:Math.max(this._blocks.length-1,0),d,u;d=(s=this._blocks[c])!=null?s:u=!u&&this._allocateBlock(c);++c){var a,r,s,i;const p=d._appendChar(t,{...n,_beforeTailState:(i=n._beforeTailState)==null||(i=i._blocks)==null?void 0:i[c]});if(p.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(p),p.consumed)break}return o}_trimEmptyTail(t,n){var o,a;t===void 0&&(t=0);const r=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0);let s;n!=null&&(s=(a=this._mapPosToBlock(n))==null?void 0:a.index),s==null&&(s=this._blocks.length-1);let i=0;for(let c=s;r<=c&&!this._blocks[c].unmaskedValue;--c,++i);i&&(this._blocks.splice(s-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const o=super.remove(t,n);return this._trimEmptyTail(t,n),o}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ge.RepeatBlock=ls;try{globalThis.IMask=ge}catch{}const zo=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:ke,ChunksTailDetails:Lt,DIRECTION:de,HTMLContenteditableMaskElement:Oo,HTMLInputMaskElement:Xr,HTMLMaskElement:Nn,InputMask:Qr,MaskElement:Cl,Masked:Ge,MaskedDate:xt,MaskedDynamic:Mn,MaskedEnum:An,MaskedFunction:es,MaskedNumber:ot,MaskedPattern:Ke,MaskedRange:Sn,MaskedRegExp:Vr,PIPE_TYPE:Nl,PatternFixedDefinition:Po,PatternInputDefinition:Bn,RepeatBlock:ls,createMask:kt,createPipe:Ro,default:ge,forceDirection:Yr,normalizeOpts:on,pipe:ns},Symbol.toStringTag,{value:"Module"}));Fe.Card=_n,Fe.CardItem=Cn,Fe.CommentsWidget=Tn,Fe.CopyNotification=Wr,Fe.DescriptionListWidget=Dl,Fe.FilesWidget=$n,Fe.GalleryWidget=In,Fe.GroupInterfaceWidget=xl,Fe.HistoryWidget=Ln,Fe.MapWidget=Vn,Fe.TableWidget=jr,Fe.default=_n,Object.defineProperties(Fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));