@opengis/widgets 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- import { h as te, defineComponent as j, mergeModels as X, useModel as de, ref as w, createElementBlock as a, openBlock as o, createElementVNode as e, createVNode as $, unref as k, withDirectives as R, vModelText as ye, createCommentVNode as _, createTextVNode as S, onMounted as Q, onUnmounted as ce, resolveComponent as se, normalizeClass as D, createBlock as I, toDisplayString as b, Fragment as V, renderList as A, normalizeStyle as U, resolveDynamicComponent as B, withModifiers as K, computed as O, Teleport as be, TransitionGroup as De, withCtx as Te, nextTick as Ie, renderSlot as G, vModelRadio as ee, vModelCheckbox as je, mergeProps as Z, vShow as ze } from "vue";
1
+ import { h as te, defineComponent as j, mergeModels as X, useModel as ae, ref as $, createElementBlock as i, openBlock as s, createElementVNode as t, createVNode as M, unref as w, withDirectives as R, vModelText as fe, createCommentVNode as b, createTextVNode as F, onMounted as re, onUnmounted as ye, resolveComponent as Q, normalizeClass as D, createBlock as A, toDisplayString as x, Fragment as I, renderList as E, normalizeStyle as Z, resolveDynamicComponent as B, withModifiers as U, computed as N, renderSlot as q, vModelRadio as Y, vModelCheckbox as Te, getCurrentInstance as De, createStaticVNode as Ie, mergeProps as K, vShow as je, Teleport as Ve, TransitionGroup as Ae, withCtx as ze } from "vue";
2
2
  /**
3
3
  * @license lucide-vue-next v0.535.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const ge = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ve = (r) => r.replace(
8
+ const pe = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), He = (a) => a.replace(
9
9
  /^([A-Z])|[\s-_]+(\w)/g,
10
- (l, i, t) => t ? t.toUpperCase() : i.toLowerCase()
11
- ), Fe = (r) => {
12
- const l = Ve(r);
10
+ (l, o, e) => e ? e.toUpperCase() : o.toLowerCase()
11
+ ), Ee = (a) => {
12
+ const l = He(a);
13
13
  return l.charAt(0).toUpperCase() + l.slice(1);
14
- }, He = (...r) => r.filter((l, i, t) => !!l && l.trim() !== "" && t.indexOf(l) === i).join(" ").trim();
14
+ }, Fe = (...a) => a.filter((l, o, e) => !!l && l.trim() !== "" && e.indexOf(l) === o).join(" ").trim();
15
15
  /**
16
16
  * @license lucide-vue-next v0.535.0 - ISC
17
17
  *
@@ -35,21 +35,21 @@ var J = {
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
37
  */
38
- const Ae = ({ size: r, strokeWidth: l = 2, absoluteStrokeWidth: i, color: t, iconNode: s, name: c, class: n, ...u }, { slots: v }) => te(
38
+ const Se = ({ size: a, strokeWidth: l = 2, absoluteStrokeWidth: o, color: e, iconNode: n, name: g, class: d, ...y }, { slots: v }) => te(
39
39
  "svg",
40
40
  {
41
41
  ...J,
42
- width: r || J.width,
43
- height: r || J.height,
44
- stroke: t || J.stroke,
45
- "stroke-width": i ? Number(l) * 24 / Number(r) : l,
46
- class: He(
42
+ width: a || J.width,
43
+ height: a || J.height,
44
+ stroke: e || J.stroke,
45
+ "stroke-width": o ? Number(l) * 24 / Number(a) : l,
46
+ class: Fe(
47
47
  "lucide",
48
- ...c ? [`lucide-${ge(Fe(c))}-icon`, `lucide-${ge(c)}`] : ["lucide-icon"]
48
+ ...g ? [`lucide-${pe(Ee(g))}-icon`, `lucide-${pe(g)}`] : ["lucide-icon"]
49
49
  ),
50
- ...u
50
+ ...y
51
51
  },
52
- [...s.map((g) => te(...g)), ...v.default ? [v.default()] : []]
52
+ [...n.map((p) => te(...p)), ...v.default ? [v.default()] : []]
53
53
  );
54
54
  /**
55
55
  * @license lucide-vue-next v0.535.0 - ISC
@@ -57,14 +57,14 @@ const Ae = ({ size: r, strokeWidth: l = 2, absoluteStrokeWidth: i, color: t, ico
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
- const T = (r, l) => (i, { slots: t }) => te(
61
- Ae,
60
+ const V = (a, l) => (o, { slots: e }) => te(
61
+ Se,
62
62
  {
63
- ...i,
63
+ ...o,
64
64
  iconNode: l,
65
- name: r
65
+ name: a
66
66
  },
67
- t
67
+ e
68
68
  );
69
69
  /**
70
70
  * @license lucide-vue-next v0.535.0 - ISC
@@ -72,7 +72,7 @@ const T = (r, l) => (i, { slots: t }) => te(
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
74
  */
75
- const Se = T("archive", [
75
+ const Ne = V("archive", [
76
76
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
77
77
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
78
78
  ["path", { d: "M10 12h4", key: "a56b0p" }]
@@ -83,7 +83,7 @@ const Se = T("archive", [
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
85
  */
86
- const Ee = T("arrow-right", [
86
+ const Oe = V("arrow-right", [
87
87
  ["path", { d: "M5 12h14", key: "1ays0h" }],
88
88
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
89
89
  ]);
@@ -93,7 +93,7 @@ const Ee = T("arrow-right", [
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const Oe = T("circle-check-big", [
96
+ const Be = V("circle-check-big", [
97
97
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
98
98
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
99
99
  ]);
@@ -103,7 +103,7 @@ const Oe = T("circle-check-big", [
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
105
  */
106
- const ue = T("download", [
106
+ const ve = V("download", [
107
107
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
108
108
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
109
109
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
@@ -114,7 +114,7 @@ const ue = T("download", [
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
116
  */
117
- const Be = T("ellipsis", [
117
+ const Pe = V("ellipsis", [
118
118
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
119
119
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
120
120
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
@@ -125,7 +125,7 @@ const Be = T("ellipsis", [
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
127
  */
128
- const q = T("file-text", [
128
+ const G = V("file-text", [
129
129
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
130
130
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
131
131
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
@@ -138,7 +138,7 @@ const q = T("file-text", [
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
140
  */
141
- const Ne = T("file", [
141
+ const Re = V("file", [
142
142
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
143
143
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
144
144
  ]);
@@ -148,7 +148,7 @@ const Ne = T("file", [
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
150
  */
151
- const Re = T("grid-3x3", [
151
+ const Ue = V("grid-3x3", [
152
152
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
153
153
  ["path", { d: "M3 9h18", key: "1pudct" }],
154
154
  ["path", { d: "M3 15h18", key: "5xshup" }],
@@ -161,7 +161,7 @@ const Re = T("grid-3x3", [
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
163
  */
164
- const Ue = T("heart", [
164
+ const We = V("heart", [
165
165
  [
166
166
  "path",
167
167
  {
@@ -176,7 +176,7 @@ const Ue = T("heart", [
176
176
  * This source code is licensed under the ISC license.
177
177
  * See the LICENSE file in the root directory of this source tree.
178
178
  */
179
- const We = T("history", [
179
+ const qe = V("history", [
180
180
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
181
181
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
182
182
  ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
@@ -187,7 +187,7 @@ const We = T("history", [
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
189
  */
190
- const he = T("image", [
190
+ const me = V("image", [
191
191
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
192
192
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
193
193
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
@@ -198,7 +198,7 @@ const he = T("image", [
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
200
  */
201
- const Pe = T("list", [
201
+ const Ge = V("list", [
202
202
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
203
203
  ["path", { d: "M3 18h.01", key: "1tta3j" }],
204
204
  ["path", { d: "M3 6h.01", key: "1rqtza" }],
@@ -212,7 +212,7 @@ const Pe = T("list", [
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
214
  */
215
- const Ge = T("plus", [
215
+ const be = V("plus", [
216
216
  ["path", { d: "M5 12h14", key: "1ays0h" }],
217
217
  ["path", { d: "M12 5v14", key: "s699le" }]
218
218
  ]);
@@ -222,7 +222,7 @@ const Ge = T("plus", [
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
224
  */
225
- const qe = T("reply", [
225
+ const Ke = V("reply", [
226
226
  ["path", { d: "M20 18v-2a4 4 0 0 0-4-4H4", key: "5vmcpk" }],
227
227
  ["path", { d: "m9 17-5-5 5-5", key: "nvlc11" }]
228
228
  ]);
@@ -232,7 +232,7 @@ const qe = T("reply", [
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
234
  */
235
- const xe = T("send", [
235
+ const xe = V("send", [
236
236
  [
237
237
  "path",
238
238
  {
@@ -248,18 +248,7 @@ const xe = T("send", [
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
250
  */
251
- const Ke = T("share", [
252
- ["path", { d: "M12 2v13", key: "1km8f5" }],
253
- ["path", { d: "m16 6-4-4-4 4", key: "13yo43" }],
254
- ["path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8", key: "1b2hhj" }]
255
- ]);
256
- /**
257
- * @license lucide-vue-next v0.535.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */
262
- const Ze = T("sheet", [
251
+ const Ze = V("sheet", [
263
252
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
264
253
  ["line", { x1: "3", x2: "21", y1: "9", y2: "9", key: "1vqk6q" }],
265
254
  ["line", { x1: "3", x2: "21", y1: "15", y2: "15", key: "o2sbyz" }],
@@ -272,7 +261,7 @@ const Ze = T("sheet", [
272
261
  * This source code is licensed under the ISC license.
273
262
  * See the LICENSE file in the root directory of this source tree.
274
263
  */
275
- const Je = T("square-pen", [
264
+ const Je = V("square-pen", [
276
265
  ["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" }],
277
266
  [
278
267
  "path",
@@ -288,7 +277,7 @@ const Je = T("square-pen", [
288
277
  * This source code is licensed under the ISC license.
289
278
  * See the LICENSE file in the root directory of this source tree.
290
279
  */
291
- const pe = T("trash-2", [
280
+ const de = V("trash-2", [
292
281
  ["path", { d: "M10 11v6", key: "nco0om" }],
293
282
  ["path", { d: "M14 11v6", key: "outv1u" }],
294
283
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
@@ -301,7 +290,7 @@ const pe = T("trash-2", [
301
290
  * This source code is licensed under the ISC license.
302
291
  * See the LICENSE file in the root directory of this source tree.
303
292
  */
304
- const Xe = T("user-check", [
293
+ const Xe = V("user-check", [
305
294
  ["path", { d: "m16 11 2 2 4-4", key: "9rsbq5" }],
306
295
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
307
296
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
@@ -312,7 +301,7 @@ const Xe = T("user-check", [
312
301
  * This source code is licensed under the ISC license.
313
302
  * See the LICENSE file in the root directory of this source tree.
314
303
  */
315
- const me = T("user", [
304
+ const ce = V("user", [
316
305
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
317
306
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
318
307
  ]);
@@ -322,7 +311,7 @@ const me = T("user", [
322
311
  * This source code is licensed under the ISC license.
323
312
  * See the LICENSE file in the root directory of this source tree.
324
313
  */
325
- const Qe = T("video", [
314
+ const Qe = V("video", [
326
315
  [
327
316
  "path",
328
317
  {
@@ -338,7 +327,7 @@ const Qe = T("video", [
338
327
  * This source code is licensed under the ISC license.
339
328
  * See the LICENSE file in the root directory of this source tree.
340
329
  */
341
- const Y = T("x", [
330
+ const ue = V("x", [
342
331
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
343
332
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
344
333
  ]), Ye = { class: "border-t pt-3 mt-4" }, et = { class: "flex gap-2" }, tt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, st = { class: "flex-1 space-y-2" }, ot = { class: "flex justify-between items-center" }, nt = { class: "flex gap-2" }, it = ["disabled"], ke = /* @__PURE__ */ j({
@@ -348,44 +337,44 @@ const Y = T("x", [
348
337
  isReplyModifiers: {}
349
338
  },
350
339
  emits: /* @__PURE__ */ X(["sendComment"], ["update:isReply"]),
351
- setup(r, { emit: l }) {
352
- const i = de(r, "isReply"), t = w(""), s = l, c = () => {
353
- t.value.trim() && (s("sendComment", t.value), t.value = "");
354
- }, n = (u) => {
355
- (u.ctrlKey || u.metaKey) && u.key === "Enter" && (u.preventDefault(), c());
340
+ setup(a, { emit: l }) {
341
+ const o = ae(a, "isReply"), e = $(""), n = l, g = () => {
342
+ e.value.trim() && (n("sendComment", e.value), e.value = "");
343
+ }, d = (y) => {
344
+ (y.ctrlKey || y.metaKey) && y.key === "Enter" && (y.preventDefault(), g());
356
345
  };
357
- return (u, v) => (o(), a("div", Ye, [
358
- e("div", et, [
359
- e("span", tt, [
360
- $(k(me), { class: "h-3 w-3 text-gray-500" })
346
+ return (y, v) => (s(), i("div", Ye, [
347
+ t("div", et, [
348
+ t("span", tt, [
349
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
361
350
  ]),
362
- e("div", st, [
363
- R(e("textarea", {
364
- "onUpdate:modelValue": v[0] || (v[0] = (g) => t.value = g),
365
- onKeydown: n,
351
+ t("div", st, [
352
+ R(t("textarea", {
353
+ "onUpdate:modelValue": v[0] || (v[0] = (p) => e.value = p),
354
+ onKeydown: d,
366
355
  placeholder: "Add a comment...",
367
356
  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"
368
357
  }, null, 544), [
369
- [ye, t.value]
358
+ [fe, e.value]
370
359
  ]),
371
- e("div", ot, [
372
- v[4] || (v[4] = e("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
373
- e("div", nt, [
374
- i.value ? (o(), a("button", {
360
+ t("div", ot, [
361
+ v[4] || (v[4] = t("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
362
+ t("div", nt, [
363
+ o.value ? (s(), i("button", {
375
364
  key: 0,
376
365
  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",
377
- onClick: v[1] || (v[1] = (g) => i.value = !1)
366
+ onClick: v[1] || (v[1] = (p) => o.value = !1)
378
367
  }, [
379
- $(k(Y), { class: "h-3 w-3" }),
380
- v[2] || (v[2] = S(" Cancel ", -1))
381
- ])) : _("", !0),
382
- e("button", {
368
+ M(w(ue), { class: "h-3 w-3" }),
369
+ v[2] || (v[2] = F(" Cancel ", -1))
370
+ ])) : b("", !0),
371
+ t("button", {
383
372
  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",
384
- disabled: !t.value.trim(),
385
- onClick: c
373
+ disabled: !e.value.trim(),
374
+ onClick: g
386
375
  }, [
387
- $(k(xe), { class: "h-3 w-3 mr-1" }),
388
- v[3] || (v[3] = S(" Send ", -1))
376
+ M(w(xe), { class: "h-3 w-3 mr-1" }),
377
+ v[3] || (v[3] = F(" Send ", -1))
389
378
  ], 8, it)
390
379
  ])
391
380
  ])
@@ -400,37 +389,37 @@ const Y = T("x", [
400
389
  showMoreOptionsModifiers: {}
401
390
  },
402
391
  emits: /* @__PURE__ */ X(["edit", "delete"], ["update:showMoreOptions"]),
403
- setup(r, { emit: l }) {
404
- const i = l, t = de(r, "showMoreOptions"), s = w(), c = w(!0), n = async (g) => {
405
- t.value && s.value && !s.value.contains(g.target) && !c.value && (t.value = !1), c.value = !1;
406
- }, u = () => {
407
- t.value = !1, i("edit");
392
+ setup(a, { emit: l }) {
393
+ const o = l, e = ae(a, "showMoreOptions"), n = $(), g = $(!0), d = async (p) => {
394
+ e.value && n.value && !n.value.contains(p.target) && !g.value && (e.value = !1), g.value = !1;
395
+ }, y = () => {
396
+ e.value = !1, o("edit");
408
397
  }, v = () => {
409
- t.value = !1, i("delete");
398
+ e.value = !1, o("delete");
410
399
  };
411
- return Q(() => {
412
- document.addEventListener("click", n);
413
- }), ce(() => {
414
- document.removeEventListener("click", n);
415
- }), (g, d) => (o(), a("div", {
400
+ return re(() => {
401
+ document.addEventListener("click", d);
402
+ }), ye(() => {
403
+ document.removeEventListener("click", d);
404
+ }), (p, r) => (s(), i("div", {
416
405
  class: "absolute bg-white left-0 top-full transform min-w-max z-50",
417
406
  ref_key: "moreOptionsRef",
418
- ref: s
407
+ ref: n
419
408
  }, [
420
- e("div", lt, [
421
- e("div", {
409
+ t("div", lt, [
410
+ t("div", {
422
411
  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",
423
- onClick: u
412
+ onClick: y
424
413
  }, [
425
- $(k(Je), { class: "h-3 w-3 mr-2" }),
426
- d[0] || (d[0] = S(" Edit ", -1))
414
+ M(w(Je), { class: "h-3 w-3 mr-2" }),
415
+ r[0] || (r[0] = F(" Edit ", -1))
427
416
  ]),
428
- e("div", {
417
+ t("div", {
429
418
  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",
430
419
  onClick: v
431
420
  }, [
432
- $(k(pe), { class: "h-3 w-3 mr-2" }),
433
- d[1] || (d[1] = S(" Delete ", -1))
421
+ M(w(de), { class: "h-3 w-3 mr-2" }),
422
+ r[1] || (r[1] = F(" Delete ", -1))
434
423
  ])
435
424
  ])
436
425
  ], 512));
@@ -438,10 +427,10 @@ const Y = T("x", [
438
427
  }), rt = { class: "space-y-2" }, dt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, ct = { class: "flex-1 min-w-0 space-y-1 relative" }, ut = { class: "flex items-center gap-2" }, pt = { class: "font-medium text-xs" }, mt = { class: "text-xs text-gray-500" }, gt = {
439
428
  key: 0,
440
429
  class: "text-xs text-gray-700 leading-relaxed"
441
- }, ht = { class: "flex justify-between text-xs" }, ft = { class: "flex items-center gap-2" }, vt = {
430
+ }, ht = { class: "flex justify-between text-xs" }, ft = { class: "flex items-center gap-2" }, yt = {
442
431
  key: 0,
443
432
  class: "flex gap-2"
444
- }, yt = ["disabled"], bt = {
433
+ }, vt = ["disabled"], bt = {
445
434
  key: 0,
446
435
  class: "ml-8 space-y-1 border-l-2 border-gray-100 pl-3"
447
436
  }, xt = /* @__PURE__ */ j({
@@ -451,113 +440,113 @@ const Y = T("x", [
451
440
  isInside: { type: Boolean }
452
441
  },
453
442
  emits: ["like", "reply", "edit", "delete"],
454
- setup(r, { emit: l }) {
455
- const i = l, t = r, s = w(t.comment.text), c = w("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), n = w("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"), u = w(!1), v = w(!1), g = w(!1), d = w(!1), y = (p) => {
456
- const f = /* @__PURE__ */ new Date(), H = Math.floor(
457
- (f.getTime() - p.getTime()) / (1e3 * 60 * 60)
443
+ setup(a, { emit: l }) {
444
+ const o = l, e = a, n = $(e.comment.text), g = $("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), d = $("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"), y = $(!1), v = $(!1), p = $(!1), r = $(!1), f = (c) => {
445
+ const u = /* @__PURE__ */ new Date(), T = Math.floor(
446
+ (u.getTime() - c.getTime()) / (1e3 * 60 * 60)
458
447
  );
459
- return H < 1 ? `${Math.floor(
460
- (f.getTime() - p.getTime()) / 6e4
461
- )}m` : H < 24 ? `${H}h` : `${Math.floor(H / 24)}d`;
462
- }, h = () => {
463
- d.value = !d.value, d.value ? i("like", t.comment.id, "add") : i("like", t.comment.id, "delete");
464
- }, M = () => {
465
- i("edit", t.comment.id, s.value), g.value = !1;
466
- }, P = (p, f) => {
467
- i("like", p, f);
468
- }, F = (p, f) => {
469
- i("edit", p, f);
448
+ return T < 1 ? `${Math.floor(
449
+ (u.getTime() - c.getTime()) / 6e4
450
+ )}m` : T < 24 ? `${T}h` : `${Math.floor(T / 24)}d`;
451
+ }, m = () => {
452
+ r.value = !r.value, r.value ? o("like", e.comment.id, "add") : o("like", e.comment.id, "delete");
453
+ }, C = () => {
454
+ o("edit", e.comment.id, n.value), p.value = !1;
455
+ }, O = (c, u) => {
456
+ o("like", c, u);
457
+ }, z = (c, u) => {
458
+ o("edit", c, u);
470
459
  };
471
- return (p, f) => {
472
- const H = se("CommentItem", !0);
473
- return o(), a("div", rt, [
474
- e("div", {
475
- class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", g.value ? "bg-gray-50" : ""])
460
+ return (c, u) => {
461
+ const T = Q("CommentItem", !0);
462
+ return s(), i("div", rt, [
463
+ t("div", {
464
+ class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", p.value ? "bg-gray-50" : ""])
476
465
  }, [
477
- e("span", dt, [
478
- $(k(me), { class: "h-3 w-3 text-gray-500" })
466
+ t("span", dt, [
467
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
479
468
  ]),
480
- e("div", ct, [
481
- e("div", ut, [
482
- e("span", pt, b(p.comment?.author), 1),
483
- e("span", mt, b(y(p.comment?.createdAt)), 1)
469
+ t("div", ct, [
470
+ t("div", ut, [
471
+ t("span", pt, x(c.comment?.author), 1),
472
+ t("span", mt, x(f(c.comment?.createdAt)), 1)
484
473
  ]),
485
- g.value ? R((o(), a("textarea", {
474
+ p.value ? R((s(), i("textarea", {
486
475
  key: 1,
487
- "onUpdate:modelValue": f[0] || (f[0] = (C) => s.value = C),
488
- class: D(g.value ? n.value : c.value)
476
+ "onUpdate:modelValue": u[0] || (u[0] = (k) => n.value = k),
477
+ class: D(p.value ? d.value : g.value)
489
478
  }, null, 2)), [
490
- [ye, s.value]
491
- ]) : (o(), a("p", gt, b(p.comment?.text), 1)),
492
- e("div", ht, [
493
- e("div", ft, [
494
- e("button", {
495
- class: D(["flex items-center gap-1", d.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
496
- onClick: f[1] || (f[1] = (C) => h())
479
+ [fe, n.value]
480
+ ]) : (s(), i("p", gt, x(c.comment?.text), 1)),
481
+ t("div", ht, [
482
+ t("div", ft, [
483
+ t("button", {
484
+ class: D(["flex items-center gap-1", r.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
485
+ onClick: u[1] || (u[1] = (k) => m())
497
486
  }, [
498
- $(k(Ue), {
499
- class: D(["h-3 w-3", d.value ? "fill-blue-600" : ""])
487
+ M(w(We), {
488
+ class: D(["h-3 w-3", r.value ? "fill-blue-600" : ""])
500
489
  }, null, 8, ["class"]),
501
- S(" " + b(p.comment?.likes), 1)
490
+ F(" " + x(c.comment?.likes), 1)
502
491
  ], 2),
503
- p.isInside ? _("", !0) : (o(), a("button", {
492
+ c.isInside ? b("", !0) : (s(), i("button", {
504
493
  key: 0,
505
494
  class: "text-gray-500 hover:text-blue-600 transition-colors",
506
- onClick: f[2] || (f[2] = (C) => v.value = !0)
495
+ onClick: u[2] || (u[2] = (k) => v.value = !0)
507
496
  }, [
508
- $(k(qe), { class: "h-3 w-3" })
497
+ M(w(Ke), { class: "h-3 w-3" })
509
498
  ])),
510
- e("button", {
499
+ t("button", {
511
500
  class: "text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",
512
501
  type: "button",
513
- onClick: f[3] || (f[3] = (C) => u.value = !0)
502
+ onClick: u[3] || (u[3] = (k) => y.value = !0)
514
503
  }, [
515
- $(k(Be), { class: "h-3 w-3" })
504
+ M(w(Pe), { class: "h-3 w-3" })
516
505
  ])
517
506
  ]),
518
- g.value ? (o(), a("div", vt, [
519
- e("button", {
507
+ p.value ? (s(), i("div", yt, [
508
+ t("button", {
520
509
  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",
521
- onClick: f[4] || (f[4] = (C) => g.value = !1)
510
+ onClick: u[4] || (u[4] = (k) => p.value = !1)
522
511
  }, [
523
- $(k(Y), { class: "h-3 w-3" }),
524
- f[11] || (f[11] = S(" Cancel ", -1))
512
+ M(w(ue), { class: "h-3 w-3" }),
513
+ u[11] || (u[11] = F(" Cancel ", -1))
525
514
  ]),
526
- e("button", {
515
+ t("button", {
527
516
  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",
528
- disabled: !s.value.trim(),
529
- onClick: f[5] || (f[5] = (C) => M())
517
+ disabled: !n.value.trim(),
518
+ onClick: u[5] || (u[5] = (k) => C())
530
519
  }, [
531
- $(k(xe), { class: "h-3 w-3 mr-1" }),
532
- f[12] || (f[12] = S(" Send ", -1))
533
- ], 8, yt)
534
- ])) : _("", !0)
520
+ M(w(xe), { class: "h-3 w-3 mr-1" }),
521
+ u[12] || (u[12] = F(" Send ", -1))
522
+ ], 8, vt)
523
+ ])) : b("", !0)
535
524
  ])
536
525
  ]),
537
- u.value ? (o(), I(at, {
526
+ y.value ? (s(), A(at, {
538
527
  key: 0,
539
- showMoreOptions: u.value,
540
- "onUpdate:showMoreOptions": f[6] || (f[6] = (C) => u.value = C),
541
- onEdit: f[7] || (f[7] = (C) => g.value = !0),
542
- onDelete: f[8] || (f[8] = (C) => p.$emit("delete", p.comment?.id)),
543
- comment: p.comment
544
- }, null, 8, ["showMoreOptions", "comment"])) : _("", !0)
528
+ showMoreOptions: y.value,
529
+ "onUpdate:showMoreOptions": u[6] || (u[6] = (k) => y.value = k),
530
+ onEdit: u[7] || (u[7] = (k) => p.value = !0),
531
+ onDelete: u[8] || (u[8] = (k) => c.$emit("delete", c.comment?.id)),
532
+ comment: c.comment
533
+ }, null, 8, ["showMoreOptions", "comment"])) : b("", !0)
545
534
  ], 2),
546
- p.isInside ? _("", !0) : (o(), a("div", bt, [
547
- (o(!0), a(V, null, A(p.comment?.replies, (C) => (o(), I(H, {
548
- key: C.id,
549
- comment: C,
535
+ c.isInside ? b("", !0) : (s(), i("div", bt, [
536
+ (s(!0), i(I, null, E(c.comment?.replies, (k) => (s(), A(T, {
537
+ key: k.id,
538
+ comment: k,
550
539
  isInside: !0,
551
- onDelete: (x) => p.$emit("delete", C.id),
552
- onLike: P,
553
- onEdit: F
540
+ onDelete: (_) => c.$emit("delete", k.id),
541
+ onLike: O,
542
+ onEdit: z
554
543
  }, null, 8, ["comment", "onDelete"]))), 128)),
555
- v.value && !p.isInside ? (o(), I(ke, {
544
+ v.value && !c.isInside ? (s(), A(ke, {
556
545
  key: 0,
557
- onSendComment: f[9] || (f[9] = (C) => p.$emit("reply", p.comment?.id, C)),
546
+ onSendComment: u[9] || (u[9] = (k) => c.$emit("reply", c.comment?.id, k)),
558
547
  isReply: v.value,
559
- "onUpdate:isReply": f[10] || (f[10] = (C) => v.value = C)
560
- }, null, 8, ["isReply"])) : _("", !0)
548
+ "onUpdate:isReply": u[10] || (u[10] = (k) => v.value = k)
549
+ }, null, 8, ["isReply"])) : b("", !0)
561
550
  ]))
562
551
  ]);
563
552
  };
@@ -565,7 +554,7 @@ const Y = T("x", [
565
554
  }), kt = ["id"], _t = {
566
555
  key: 0,
567
556
  class: "text-xl font-semibold text-gray-900 mb-4"
568
- }, oe = /* @__PURE__ */ j({
557
+ }, se = /* @__PURE__ */ j({
569
558
  __name: "CommentsWidget",
570
559
  props: {
571
560
  title: {},
@@ -581,47 +570,47 @@ const Y = T("x", [
581
570
  style: {}
582
571
  },
583
572
  emits: ["add", "reply", "like", "delete", "edit"],
584
- setup(r, { emit: l }) {
585
- const i = r, t = l, s = (g) => {
586
- i?.onAddComment?.(g), t("add", g);
587
- }, c = (g, d) => {
588
- i?.onLike?.(g, d), t("like", g, d);
589
- }, n = (g, d) => {
590
- i.onReply?.(g, d), t("reply", g, d);
591
- }, u = (g, d) => {
592
- i.onEdit?.(g, d), t("edit", g, d);
593
- }, v = (g) => {
594
- i.onDelete?.(g), t("delete", g);
573
+ setup(a, { emit: l }) {
574
+ const o = a, e = l, n = (p) => {
575
+ o?.onAddComment?.(p), e("add", p);
576
+ }, g = (p, r) => {
577
+ o?.onLike?.(p, r), e("like", p, r);
578
+ }, d = (p, r) => {
579
+ o.onReply?.(p, r), e("reply", p, r);
580
+ }, y = (p, r) => {
581
+ o.onEdit?.(p, r), e("edit", p, r);
582
+ }, v = (p) => {
583
+ o.onDelete?.(p), e("delete", p);
595
584
  };
596
- return (g, d) => (o(), a("div", {
597
- class: D(["mx-auto font-sans", g.className]),
598
- id: g.id,
599
- style: U(g.style)
585
+ return (p, r) => (s(), i("div", {
586
+ class: D(["mx-auto font-sans", p.className]),
587
+ id: p.id,
588
+ style: Z(p.style)
600
589
  }, [
601
- g.title ? (o(), a("h3", _t, b(g.title), 1)) : _("", !0),
602
- e("div", {
603
- class: D([g.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
604
- style: U({ maxHeight: g.maxHeight + "px" })
590
+ p.title ? (s(), i("h3", _t, x(p.title), 1)) : b("", !0),
591
+ t("div", {
592
+ class: D([p.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
593
+ style: Z({ maxHeight: p.maxHeight + "px" })
605
594
  }, [
606
- (o(!0), a(V, null, A(g.comments, (y) => (o(), I(xt, {
607
- key: y.id,
608
- comment: y,
609
- onReply: n,
610
- onLike: c,
611
- onDelete: d[0] || (d[0] = (h) => v(h)),
612
- onEdit: u
595
+ (s(!0), i(I, null, E(p.comments, (f) => (s(), A(xt, {
596
+ key: f.id,
597
+ comment: f,
598
+ onReply: d,
599
+ onLike: g,
600
+ onDelete: r[0] || (r[0] = (m) => v(m)),
601
+ onEdit: y
613
602
  }, null, 8, ["comment"]))), 128))
614
603
  ], 6),
615
- $(ke, {
616
- onSendComment: d[1] || (d[1] = (y) => s(y))
604
+ M(ke, {
605
+ onSendComment: r[1] || (r[1] = (f) => n(f))
617
606
  })
618
607
  ], 14, kt));
619
608
  }
620
- }), fe = /* @__PURE__ */ new Map([
609
+ }), ge = /* @__PURE__ */ new Map([
621
610
  ["file", {
622
611
  name: "File",
623
612
  color: "bg-green-100 text-green-700 border-green-200",
624
- icon: q
613
+ icon: G
625
614
  }],
626
615
  ["post", {
627
616
  name: "Post",
@@ -636,24 +625,24 @@ const Y = T("x", [
636
625
  ["custom", {
637
626
  name: "Custom",
638
627
  color: "bg-gray-100 text-gray-700 border-gray-200",
639
- icon: We
628
+ icon: qe
640
629
  }]
641
630
  ]), wt = { class: "mx-auto font-sans" }, $t = {
642
631
  key: 0,
643
632
  class: "text-xl font-semibold text-gray-900 mb-4"
644
- }, Ct = { class: "relative" }, Mt = { class: "space-y-3" }, Lt = { class: "flex-1 min-w-0 pb-2" }, Dt = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Tt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, It = { class: "font-medium text-xs" }, jt = { class: "text-xs text-gray-500" }, zt = { class: "space-y-1" }, Vt = { class: "text-xs text-gray-700" }, Ft = { class: "capitalize mr-1" }, Ht = {
633
+ }, Ct = { class: "relative" }, Mt = { class: "space-y-3" }, Lt = { class: "flex-1 min-w-0 pb-2" }, Tt = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Dt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, It = { class: "font-medium text-xs" }, jt = { class: "text-xs text-gray-500" }, Vt = { class: "space-y-1" }, At = { class: "text-xs text-gray-700" }, zt = { class: "capitalize mr-1" }, Ht = {
645
634
  key: 0,
646
635
  class: "inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"
647
- }, At = {
636
+ }, Et = {
648
637
  key: 0,
649
638
  class: "flex items-center gap-1 text-xs"
650
- }, St = {
639
+ }, Ft = {
651
640
  key: 0,
652
641
  class: "bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"
653
- }, Et = {
642
+ }, St = {
654
643
  key: 2,
655
644
  class: "bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"
656
- }, ne = /* @__PURE__ */ j({
645
+ }, oe = /* @__PURE__ */ j({
657
646
  __name: "HistoryWidget",
658
647
  props: {
659
648
  data: {},
@@ -663,57 +652,57 @@ const Y = T("x", [
663
652
  className: {},
664
653
  style: {}
665
654
  },
666
- setup(r) {
667
- const l = r, i = w(Array.isArray(l.data) ? l.data : []);
668
- i.value.length === 0 && l.id && t();
669
- async function t() {
670
- const s = await fetch(`/api/widget/history/${l.id}`);
671
- if (!s.ok)
655
+ setup(a) {
656
+ const l = a, o = $(Array.isArray(l.data) ? l.data : []);
657
+ o.value.length === 0 && l.id && e();
658
+ async function e() {
659
+ const n = await fetch(`/api/widget/history/${l.id}`);
660
+ if (!n.ok)
672
661
  return { data: [] };
673
- const c = await s.json();
674
- c.rows.forEach((n) => {
675
- n.timestamp = new Date(n.cdate), n.id = n.entity_id, n.entityType = n.entity_type, n.entityId = n.entity_id, n.action = n.change_type, n.userId = n.change_user_id, n.userName = n.username, n.timestamp = new Date(n.cdate), n.description = n.username, n.status = n.username;
676
- }), i.value = c.rows;
662
+ const g = await n.json();
663
+ g.rows.forEach((d) => {
664
+ d.timestamp = new Date(d.cdate), d.id = d.entity_id, d.entityType = d.entity_type, d.entityId = d.entity_id, d.action = d.change_type, d.userId = d.change_user_id, d.userName = d.username, d.timestamp = new Date(d.cdate), d.description = d.username, d.status = d.username;
665
+ }), o.value = g.rows;
677
666
  }
678
- return (s, c) => (o(), a("div", wt, [
679
- s.title ? (o(), a("h3", $t, b(s.title), 1)) : _("", !0),
680
- e("div", {
681
- class: D(s.maxHeight ? "overflow-y-auto" : ""),
682
- style: U({ maxHeight: s.maxHeight + "px" })
667
+ return (n, g) => (s(), i("div", wt, [
668
+ n.title ? (s(), i("h3", $t, x(n.title), 1)) : b("", !0),
669
+ t("div", {
670
+ class: D(n.maxHeight ? "overflow-y-auto" : ""),
671
+ style: Z({ maxHeight: n.maxHeight + "px" })
683
672
  }, [
684
- e("div", Ct, [
685
- c[0] || (c[0] = e("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
686
- e("div", Mt, [
687
- (o(!0), a(V, null, A(i.value, (n) => (o(), a("div", {
673
+ t("div", Ct, [
674
+ g[0] || (g[0] = t("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
675
+ t("div", Mt, [
676
+ (s(!0), i(I, null, E(o.value, (d) => (s(), i("div", {
688
677
  class: "relative flex items-start gap-2",
689
- key: n?.id
678
+ key: d?.id
690
679
  }, [
691
- e("div", {
692
- class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${k(fe).get(n?.entityType)?.color}`)
680
+ t("div", {
681
+ class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${w(ge).get(d?.entityType)?.color}`)
693
682
  }, [
694
- (o(), I(B(k(fe).get(n?.entityType)?.icon), { class: "h-3 w-3" }))
683
+ (s(), A(B(w(ge).get(d?.entityType)?.icon), { class: "h-3 w-3" }))
695
684
  ], 2),
696
- e("div", Lt, [
697
- e("div", Dt, [
698
- e("span", Tt, [
699
- $(k(me), { class: "h-3 w-3 text-gray-500" })
685
+ t("div", Lt, [
686
+ t("div", Tt, [
687
+ t("span", Dt, [
688
+ M(w(ce), { class: "h-3 w-3 text-gray-500" })
700
689
  ]),
701
- e("span", It, b(n?.userName), 1),
702
- e("span", jt, b(n?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
690
+ t("span", It, x(d?.userName), 1),
691
+ t("span", jt, x(d?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
703
692
  ]),
704
- e("div", zt, [
705
- e("div", Vt, [
706
- e("span", Ft, b(n?.action), 1),
707
- n?.entityId ? (o(), a("span", Ht, b(n?.entityId), 1)) : _("", !0)
693
+ t("div", Vt, [
694
+ t("div", At, [
695
+ t("span", zt, x(d?.action), 1),
696
+ d?.entityId ? (s(), i("span", Ht, x(d?.entityId), 1)) : b("", !0)
708
697
  ]),
709
- n?.changes?.[n?.entityId] ? (o(), a("div", At, [
710
- n?.changes?.[n?.entityId]?.old ? (o(), a("span", St, b(n?.changes?.[n?.entityId]?.old), 1)) : _("", !0),
711
- n?.changes?.[n?.entityId]?.old && n?.changes?.[n?.entityId]?.new ? (o(), I(k(Ee), {
698
+ d?.changes?.[d?.entityId] ? (s(), i("div", Et, [
699
+ d?.changes?.[d?.entityId]?.old ? (s(), i("span", Ft, x(d?.changes?.[d?.entityId]?.old), 1)) : b("", !0),
700
+ d?.changes?.[d?.entityId]?.old && d?.changes?.[d?.entityId]?.new ? (s(), A(w(Oe), {
712
701
  key: 1,
713
702
  class: "h-2 w-2 text-gray-400"
714
- })) : _("", !0),
715
- n?.changes?.[n?.entityId]?.new ? (o(), a("span", Et, b(n?.changes?.[n?.entityId]?.new), 1)) : _("", !0)
716
- ])) : _("", !0)
703
+ })) : b("", !0),
704
+ d?.changes?.[d?.entityId]?.new ? (s(), i("span", St, x(d?.changes?.[d?.entityId]?.new), 1)) : b("", !0)
705
+ ])) : b("", !0)
717
706
  ])
718
707
  ])
719
708
  ]))), 128))
@@ -722,10 +711,10 @@ const Y = T("x", [
722
711
  ], 6)
723
712
  ]));
724
713
  }
725
- }), Ot = {
714
+ }), Nt = {
726
715
  key: 0,
727
716
  class: "text-xl font-semibold"
728
- }, Bt = { class: "flex gap-1" }, Nt = { 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" }, Rt = /* @__PURE__ */ j({
717
+ }, Ot = { class: "flex gap-1" }, Bt = { 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" }, Pt = /* @__PURE__ */ j({
729
718
  __name: "FileHeader",
730
719
  props: /* @__PURE__ */ X({
731
720
  title: {}
@@ -734,51 +723,51 @@ const Y = T("x", [
734
723
  modelModifiers: {}
735
724
  }),
736
725
  emits: /* @__PURE__ */ X(["onAddFile"], ["update:modelValue"]),
737
- setup(r) {
738
- const l = de(r, "modelValue"), i = {
726
+ setup(a) {
727
+ const l = ae(a, "modelValue"), o = {
739
728
  active: "bg-blue-100 text-black hover:bg-blue-100",
740
729
  inactive: "bg-white text-black hover:bg-blue-100"
741
730
  };
742
- return (t, s) => (o(), a("div", {
743
- class: D(["flex flex-col sm:flex-row gap-3 mb-4", t.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
731
+ return (e, n) => (s(), i("div", {
732
+ class: D(["flex flex-col sm:flex-row gap-3 mb-4", e.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
744
733
  }, [
745
- t.title ? (o(), a("h3", Ot, b(t.title), 1)) : _("", !0),
746
- e("div", Bt, [
747
- e("button", {
748
- class: D(["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", l.value === "list" ? i.active : i.inactive]),
749
- onClick: s[0] || (s[0] = (c) => l.value = "list")
734
+ e.title ? (s(), i("h3", Nt, x(e.title), 1)) : b("", !0),
735
+ t("div", Ot, [
736
+ t("button", {
737
+ class: D(["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", l.value === "list" ? o.active : o.inactive]),
738
+ onClick: n[0] || (n[0] = (g) => l.value = "list")
750
739
  }, [
751
- $(k(Pe), { class: "h-4 w-4" })
740
+ M(w(Ge), { class: "h-4 w-4" })
752
741
  ], 2),
753
- e("button", {
754
- class: D(["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", l.value === "grid" ? i.active : i.inactive]),
755
- onClick: s[1] || (s[1] = (c) => l.value = "grid")
742
+ t("button", {
743
+ class: D(["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", l.value === "grid" ? o.active : o.inactive]),
744
+ onClick: n[1] || (n[1] = (g) => l.value = "grid")
756
745
  }, [
757
- $(k(Re), { class: "h-4 w-4" })
746
+ M(w(Ue), { class: "h-4 w-4" })
758
747
  ], 2),
759
- e("label", null, [
760
- e("input", {
748
+ t("label", null, [
749
+ t("input", {
761
750
  type: "file",
762
751
  class: "hidden",
763
- onChange: s[2] || (s[2] = (c) => t.$emit("onAddFile", c))
752
+ onChange: n[2] || (n[2] = (g) => e.$emit("onAddFile", g))
764
753
  }, null, 32),
765
- e("div", Nt, [
766
- $(k(Ge), { class: "h-4 w-4" }),
767
- s[3] || (s[3] = S(" Додати файл ", -1))
754
+ t("div", Bt, [
755
+ M(w(be), { class: "h-4 w-4" }),
756
+ n[3] || (n[3] = F(" Додати файл ", -1))
768
757
  ])
769
758
  ])
770
759
  ])
771
760
  ], 2));
772
761
  }
773
- }), ve = {
762
+ }), ee = {
774
763
  pdf: {
775
764
  color: "bg-red-100 text-red-700 border-red-200",
776
- icon: q,
765
+ icon: G,
777
766
  label: "PDF"
778
767
  },
779
768
  sketch: {
780
769
  color: "bg-gray-100 text-gray-700 border-gray-200",
781
- icon: Ne,
770
+ icon: Re,
782
771
  label: "SKETCH"
783
772
  },
784
773
  mp4: {
@@ -788,143 +777,143 @@ const Y = T("x", [
788
777
  },
789
778
  docx: {
790
779
  color: "bg-blue-100 text-blue-700 border-blue-200",
791
- icon: q,
780
+ icon: G,
792
781
  label: "DOC"
793
782
  },
794
783
  zip: {
795
784
  color: "bg-orange-100 text-orange-700 border-orange-200",
796
- icon: Se,
785
+ icon: Ne,
797
786
  label: "ARCHIVE"
798
787
  },
799
788
  png: {
800
789
  color: "bg-green-100 text-green-700 border-green-200",
801
- icon: he,
790
+ icon: me,
802
791
  label: "IMAGE"
803
792
  },
804
793
  jpg: {
805
794
  color: "bg-green-100 text-green-700 border-green-200",
806
- icon: he,
795
+ icon: me,
807
796
  label: "IMAGE"
808
797
  },
809
798
  xlsx: {
810
799
  color: "bg-emerald-100 text-emerald-700 border-emerald-200",
811
- icon: q,
800
+ icon: G,
812
801
  label: "EXCEL"
813
802
  },
814
803
  pptx: {
815
804
  color: "bg-amber-100 text-amber-700 border-amber-200",
816
- icon: q,
805
+ icon: G,
817
806
  label: "PPT"
818
807
  }
819
808
  };
820
- function _e(r, l = "en") {
821
- const i = {
809
+ function _e(a, l = "en") {
810
+ const o = {
822
811
  month: "short",
823
812
  day: "numeric"
824
813
  };
825
- return new Intl.DateTimeFormat(l, i).format(r);
814
+ return new Intl.DateTimeFormat(l, o).format(a);
826
815
  }
827
- function we(r) {
828
- if (r === 0) return "0 B";
829
- const l = 1024, i = ["B", "KB", "MB", "GB", "TB"], t = Math.floor(Math.log(r) / Math.log(l));
830
- return `${parseFloat((r / Math.pow(l, t)).toFixed(1))} ${i[t]}`;
816
+ function we(a) {
817
+ if (a === 0) return "0 B";
818
+ const l = 1024, o = ["B", "KB", "MB", "GB", "TB"], e = Math.floor(Math.log(a) / Math.log(l));
819
+ return `${parseFloat((a / Math.pow(l, e)).toFixed(1))} ${o[e]}`;
831
820
  }
832
- const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = { class: "flex items-center gap-2" }, qt = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, Kt = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, Zt = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, Jt = { class: "flex items-center gap-1" }, Xt = ["onClick"], Qt = ["onClick"], Yt = /* @__PURE__ */ j({
821
+ const Rt = { class: "space-y-0.5" }, Ut = ["onClick"], Wt = ["onClick"], qt = { class: "flex items-center gap-2" }, Gt = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, Kt = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, Zt = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, Jt = { class: "flex items-center gap-1" }, Xt = ["onClick"], Qt = ["onClick"], $e = /* @__PURE__ */ j({
833
822
  __name: "FileList",
834
823
  props: {
835
824
  files: {}
836
825
  },
837
826
  emits: ["delete", "download", "openLightbox"],
838
- setup(r) {
839
- return (l, i) => (o(), a("div", Ut, [
840
- (o(!0), a(V, null, A(l.files, (t) => (o(), a("div", {
827
+ setup(a) {
828
+ return (l, o) => (s(), i("div", Rt, [
829
+ (s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
841
830
  class: "flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",
842
- key: t.id,
843
- onClick: K((s) => l.$emit("openLightbox", t), ["stop"])
831
+ key: e.id,
832
+ onClick: U((n) => l.$emit("openLightbox", e), ["stop"])
844
833
  }, [
845
- e("div", {
846
- class: D(["p-1 rounded", k(ve)[t?.ext]?.color])
834
+ t("div", {
835
+ class: D(["p-1 rounded", w(ee)[e?.ext]?.color || "bg-blue-100 text-blue-700 border-blue-200"])
847
836
  }, [
848
- (o(), I(B(k(ve)[t?.ext]?.icon), { class: "h-3 w-3" }))
837
+ (s(), A(B(w(ee)[e?.ext]?.icon || w(ee).pdf.icon), { class: "h-3 w-3" }))
849
838
  ], 2),
850
- e("div", {
839
+ t("div", {
851
840
  class: "flex-1 min-w-0",
852
- onClick: (s) => l.$emit("openLightbox", t)
841
+ onClick: (n) => l.$emit("openLightbox", e)
853
842
  }, [
854
- e("div", Gt, [
855
- e("span", qt, b(t?.uploaded_name || t?.name), 1)
843
+ t("div", qt, [
844
+ t("span", Gt, x(e?.uploaded_name || e?.name), 1)
856
845
  ])
857
- ], 8, Pt),
858
- e("div", Kt, b(k(we)(t.size)), 1),
859
- e("div", Zt, b(k(_e)(t.createdAt)), 1),
860
- e("div", Jt, [
861
- e("button", {
862
- onClick: K((s) => l.$emit("download", t), ["stop"]),
846
+ ], 8, Wt),
847
+ t("div", Kt, x(w(we)(e.size)), 1),
848
+ t("div", Zt, x(w(_e)(e.createdAt)), 1),
849
+ t("div", Jt, [
850
+ t("button", {
851
+ onClick: U((n) => l.$emit("download", e), ["stop"]),
863
852
  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"
864
853
  }, [
865
- $(k(ue), { class: "h-3 w-3" })
854
+ M(w(ve), { class: "h-3 w-3" })
866
855
  ], 8, Xt),
867
- e("button", {
856
+ t("button", {
868
857
  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",
869
- onClick: K((s) => l.$emit("delete", s, t?.file_id), ["stop"])
858
+ onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
870
859
  }, [
871
- $(k(pe), { class: "h-3 w-3" })
860
+ M(w(de), { class: "h-3 w-3" })
872
861
  ], 8, Qt)
873
862
  ])
874
- ], 8, Wt))), 128))
863
+ ], 8, Ut))), 128))
875
864
  ]));
876
865
  }
877
- }), es = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, ts = ["onClick"], ss = { class: "space-y-2" }, os = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, ns = ["src"], is = { class: "space-y-1" }, ls = ["title"], as = { class: "text-xs text-gray-500 text-left" }, rs = { class: "absolute top-2 right-1 flex items-center gap-1" }, ds = ["onClick"], cs = ["onClick"], us = /* @__PURE__ */ j({
866
+ }), Yt = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, es = ["onClick"], ts = { class: "space-y-2" }, ss = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, os = ["src"], ns = { class: "space-y-1" }, is = ["title"], ls = { class: "text-xs text-gray-500 text-left" }, as = { class: "absolute top-2 right-1 flex items-center gap-1" }, rs = ["onClick"], ds = ["onClick"], cs = /* @__PURE__ */ j({
878
867
  __name: "FileGrid",
879
868
  props: {
880
869
  files: {}
881
870
  },
882
871
  emits: ["delete", "download", "openLightbox"],
883
- setup(r) {
884
- return (l, i) => (o(), a("div", es, [
885
- (o(!0), a(V, null, A(l.files, (t) => (o(), a("div", {
886
- key: t.id,
887
- onClick: K((s) => l.$emit("openLightbox", t), ["stop"]),
872
+ setup(a) {
873
+ return (l, o) => (s(), i("div", Yt, [
874
+ (s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
875
+ key: e.id,
876
+ onClick: U((n) => l.$emit("openLightbox", e), ["stop"]),
888
877
  class: "group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"
889
878
  }, [
890
- e("div", ss, [
891
- e("div", os, [
892
- t.ext === "png" || t.ext === "jpg" || t.ext === "jpeg" || t.ext === "gif" || t.ext === "svg" || t.ext === "webp" ? (o(), a("img", {
879
+ t("div", ts, [
880
+ t("div", ss, [
881
+ e.ext === "png" || e.ext === "jpg" || e.ext === "jpeg" || e.ext === "gif" || e.ext === "svg" || e.ext === "webp" ? (s(), i("img", {
893
882
  key: 0,
894
- src: `/file/resize?filepath=${t?.file_path}&w=500`,
883
+ src: `/file/resize?filepath=${e?.file_path}&w=500`,
895
884
  alt: "file",
896
885
  class: "w-full h-full object-cover"
897
- }, null, 8, ns)) : (o(), I(k(q), {
886
+ }, null, 8, os)) : (s(), A(w(G), {
898
887
  key: 1,
899
888
  class: "h-10 w-10 text-gray-500"
900
889
  }))
901
890
  ]),
902
- e("div", is, [
903
- e("h3", {
891
+ t("div", ns, [
892
+ t("h3", {
904
893
  class: "font-medium text-xs leading-tight text-left",
905
- title: t.uploaded_name || t.name
906
- }, b(t.uploaded_name || t.name), 9, ls),
907
- e("p", as, b(k(_e)(t.createdAt)) + ", " + b(k(we)(t.size)), 1)
894
+ title: e.uploaded_name || e.name
895
+ }, x(e.uploaded_name || e.name), 9, is),
896
+ t("p", ls, x(w(_e)(e.createdAt)) + ", " + x(w(we)(e.size)), 1)
908
897
  ])
909
898
  ]),
910
- e("div", rs, [
911
- e("button", {
912
- onClick: K((s) => l.$emit("download", t), ["stop"]),
899
+ t("div", as, [
900
+ t("button", {
901
+ onClick: U((n) => l.$emit("download", e), ["stop"]),
913
902
  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"
914
903
  }, [
915
- $(k(ue), { class: "h-3 w-3" })
916
- ], 8, ds),
917
- e("a", {
904
+ M(w(ve), { class: "h-3 w-3" })
905
+ ], 8, rs),
906
+ t("button", {
918
907
  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",
919
- onClick: K((s) => l.$emit("delete", s, t?.file_id), ["stop"])
908
+ onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
920
909
  }, [
921
- $(k(pe), { class: "h-3 w-3" })
922
- ], 8, cs)
910
+ M(w(de), { class: "h-3 w-3" })
911
+ ], 8, ds)
923
912
  ])
924
- ], 8, ts))), 128))
913
+ ], 8, es))), 128))
925
914
  ]));
926
915
  }
927
- }), ps = { class: "mx-auto font-sans" }, ms = { key: 1 }, ie = /* @__PURE__ */ j({
916
+ }), us = { class: "mx-auto font-sans" }, ps = { key: 1 }, he = /* @__PURE__ */ j({
928
917
  __name: "FilesWidget",
929
918
  props: {
930
919
  title: {},
@@ -938,392 +927,363 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
938
927
  onDelete: {}
939
928
  },
940
929
  emits: ["delete", "add", "openLightbox"],
941
- setup(r, { emit: l }) {
942
- const i = r, t = w(!1), s = w(null), c = w(!1), n = w(0), u = w(i.files ?? []), v = l;
943
- u.value.length === 0 && f();
944
- const g = (x, m) => {
945
- s.value = m, t.value = !0;
946
- }, d = () => {
947
- s.value && (P(s.value), s.value = null, t.value = !1);
948
- }, y = O(() => Array.isArray(u.value) ? u.value.map((x) => x?.file_path) : []), h = (x) => {
949
- const m = y.value.findIndex((E) => E === x.file_path);
950
- m !== -1 && (c.value = !0, n.value = m);
951
- }, M = (x) => {
952
- i.onAddFile ? i.onAddFile(x) : H(x), v("add", x);
953
- }, P = (x) => {
954
- i.onDelete ? i.onDelete(x) : C(x), v("delete", x);
955
- }, F = (x) => {
956
- const m = document.createElement("a");
957
- m.setAttribute("download", x?.uploaded_name || x?.name), m.href = x?.file_path || x?.path, m.click();
958
- }, p = w("list");
959
- async function f() {
960
- if (!i.id)
930
+ setup(a, { emit: l }) {
931
+ const o = a, e = $(!1), n = $(null), g = $(!1), d = $(0), y = $(o.files ?? []), v = l;
932
+ y.value.length === 0 && u();
933
+ const p = (_, h) => {
934
+ n.value = h, e.value = !0;
935
+ }, r = () => {
936
+ n.value && (O(n.value), n.value = null, e.value = !1);
937
+ }, f = N(() => Array.isArray(y.value) ? y.value.map((_) => _?.file_path) : []), m = (_) => {
938
+ const h = f.value.findIndex((S) => S === _.file_path);
939
+ h !== -1 && (g.value = !0, d.value = h);
940
+ }, C = (_) => {
941
+ o.onAddFile ? o.onAddFile(_) : T(_), v("add", _);
942
+ }, O = (_) => {
943
+ o.onDelete ? o.onDelete(_) : k(_), v("delete", _);
944
+ }, z = (_) => {
945
+ const h = document.createElement("a");
946
+ h.setAttribute("download", _?.uploaded_name || _?.name), h.href = _?.file_path || _?.path, h.click();
947
+ }, c = $("list");
948
+ async function u() {
949
+ if (!o.id)
961
950
  return;
962
- const x = await fetch(`/api/widget/file/${i.id}`).then((m) => m.json());
963
- x.rows.forEach((m) => {
964
- m.timestamp = new Date(m.cdate), m.id = m.entity_id, m.entityType = m.entity_type, m.entityId = m.entity_id, m.entityType = m.entity_type, m.action = m.change_type, m.userId = m.change_user_id, m.userName = m.username, m.timestamp = new Date(m.cdate), m.description = m.username, m.status = m.username;
965
- }), u.value = x.rows;
951
+ const _ = await fetch(`/api/widget/file/${o.id}`).then((h) => h.json());
952
+ _.rows.forEach((h) => {
953
+ h.timestamp = new Date(h.cdate), h.id = h.entity_id, h.entityType = h.entity_type, h.entityId = h.entity_id, h.entityType = h.entity_type, h.action = h.change_type, h.userId = h.change_user_id, h.userName = h.username, h.timestamp = new Date(h.cdate), h.description = h.username, h.status = h.username;
954
+ }), y.value = _.rows;
966
955
  }
967
- const H = async (x) => {
968
- if (!(!x.target || !x.target.files || x.target.files.length === 0))
956
+ const T = async (_) => {
957
+ if (!(!_.target || !_.target.files || _.target.files.length === 0))
969
958
  try {
970
959
  await Promise.all(
971
- Array.from(x.target.files).map(async (m) => {
972
- const E = new FormData();
973
- E.append("file", m);
974
- const N = `/api/widget/file/${i.id}`, z = await fetch(N, {
960
+ Array.from(_.target.files).map(async (h) => {
961
+ const S = new FormData();
962
+ S.append("file", h);
963
+ const P = `/api/widget/file/${o.id}`, H = await fetch(P, {
975
964
  method: "POST",
976
- body: E
965
+ body: S
977
966
  });
978
- if (!z.ok)
979
- throw new Error(`HTTP error! status: ${z.status}`);
980
- return m;
967
+ if (!H.ok)
968
+ throw new Error(`HTTP error! status: ${H.status}`);
969
+ return h;
981
970
  })
982
- ), await f();
983
- } catch (m) {
984
- console.error("Помилка при завантаженні файлів:", m);
971
+ ), await u();
972
+ } catch (h) {
973
+ console.error("Помилка при завантаженні файлів:", h);
985
974
  }
986
- }, C = async (x) => {
975
+ }, k = async (_) => {
987
976
  try {
988
977
  await fetch(
989
- `/api/widget/file/${i.id}/${x}`,
978
+ `/api/widget/file/${o.id}/${_}`,
990
979
  {
991
980
  method: "DELETE"
992
981
  }
993
- ), await f();
994
- } catch (m) {
995
- console.error(m);
982
+ ), await u();
983
+ } catch (h) {
984
+ console.error(h);
996
985
  }
997
986
  };
998
- return (x, m) => {
999
- const E = se("MessageBox"), N = se("Lightbox");
1000
- return o(), a(V, null, [
1001
- e("div", ps, [
1002
- $(Rt, {
1003
- modelValue: p.value,
1004
- "onUpdate:modelValue": m[0] || (m[0] = (z) => p.value = z),
1005
- title: i.title,
1006
- onOnAddFile: m[1] || (m[1] = (z) => M(z))
987
+ return (_, h) => {
988
+ const S = Q("MessageBox"), P = Q("Lightbox");
989
+ return s(), i(I, null, [
990
+ t("div", us, [
991
+ M(Pt, {
992
+ modelValue: c.value,
993
+ "onUpdate:modelValue": h[0] || (h[0] = (H) => c.value = H),
994
+ title: o.title,
995
+ onOnAddFile: h[1] || (h[1] = (H) => C(H))
1007
996
  }, null, 8, ["modelValue", "title"]),
1008
- u.value.length > 0 ? (o(), a("div", {
997
+ y.value.length > 0 ? (s(), i("div", {
1009
998
  key: 0,
1010
- class: D(x.maxHeight ? "overflow-y-auto" : ""),
1011
- style: U({ maxHeight: x.maxHeight + "px" })
999
+ class: D(_.maxHeight ? "overflow-y-auto" : ""),
1000
+ style: Z({ maxHeight: _.maxHeight + "px" })
1012
1001
  }, [
1013
- p.value === "list" ? (o(), I(Yt, {
1002
+ c.value === "list" ? (s(), A($e, {
1014
1003
  key: 0,
1015
- onDelete: g,
1016
- onDownload: F,
1017
- onOpenLightbox: m[2] || (m[2] = (z) => h(z)),
1018
- files: u.value
1019
- }, null, 8, ["files"])) : _("", !0),
1020
- p.value === "grid" ? (o(), I(us, {
1004
+ onDelete: p,
1005
+ onDownload: z,
1006
+ onOpenLightbox: h[2] || (h[2] = (H) => m(H)),
1007
+ files: y.value
1008
+ }, null, 8, ["files"])) : b("", !0),
1009
+ c.value === "grid" ? (s(), A(cs, {
1021
1010
  key: 1,
1022
- onDelete: g,
1023
- onDownload: F,
1024
- onOpenLightbox: m[3] || (m[3] = (z) => h(z)),
1025
- files: u.value
1026
- }, null, 8, ["files"])) : _("", !0)
1027
- ], 6)) : (o(), a("div", ms, m[6] || (m[6] = [
1028
- e("div", { class: "flex items-center justify-center h-full" }, [
1029
- e("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
1011
+ onDelete: p,
1012
+ onDownload: z,
1013
+ onOpenLightbox: h[3] || (h[3] = (H) => m(H)),
1014
+ files: y.value
1015
+ }, null, 8, ["files"])) : b("", !0)
1016
+ ], 6)) : (s(), i("div", ps, [...h[6] || (h[6] = [
1017
+ t("div", { class: "flex items-center justify-center h-full" }, [
1018
+ t("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
1030
1019
  ], -1)
1031
- ])))
1020
+ ])]))
1032
1021
  ]),
1033
- $(E, {
1034
- modelValue: t.value,
1035
- "onUpdate:modelValue": m[4] || (m[4] = (z) => t.value = z),
1036
- onConfirm: d,
1022
+ M(S, {
1023
+ modelValue: e.value,
1024
+ "onUpdate:modelValue": h[4] || (h[4] = (H) => e.value = H),
1025
+ onConfirm: r,
1037
1026
  title: "Ви впевнені?",
1038
1027
  message: "Ви впевнені, що хочете видалити цей файл?",
1039
1028
  confirmButtonText: "Так, я впевнена/ий",
1040
1029
  cancelButtonText: "Скасувати"
1041
1030
  }, null, 8, ["modelValue"]),
1042
- $(N, {
1043
- modelValue: c.value,
1044
- "onUpdate:modelValue": m[5] || (m[5] = (z) => c.value = z),
1045
- images: y.value,
1046
- "start-index": n.value
1031
+ M(P, {
1032
+ modelValue: g.value,
1033
+ "onUpdate:modelValue": h[5] || (h[5] = (H) => g.value = H),
1034
+ images: f.value,
1035
+ "start-index": d.value
1047
1036
  }, null, 8, ["modelValue", "images", "start-index"])
1048
1037
  ], 64);
1049
1038
  };
1050
1039
  }
1051
- }), gs = ["onClick"], hs = /* @__PURE__ */ j({
1052
- __name: "CopyNotification",
1053
- setup(r, { expose: l }) {
1054
- const i = w([]);
1055
- let t = 1;
1056
- const s = () => {
1057
- if (i.value.length >= 10) {
1058
- const u = i.value[0];
1059
- clearTimeout(u.timer), i.value.shift();
1060
- }
1061
- const n = {
1062
- id: t++,
1063
- timer: setTimeout(() => {
1064
- c(n.id);
1065
- }, 1500)
1066
- };
1067
- i.value.push(n);
1068
- }, c = (n) => {
1069
- const u = i.value.findIndex((v) => v.id === n);
1070
- if (u !== -1) {
1071
- const v = i.value[u];
1072
- clearTimeout(v.timer), i.value.splice(u, 1);
1073
- }
1074
- };
1075
- return l({
1076
- addNotification: s
1077
- }), ce(() => {
1078
- i.value.forEach((n) => {
1079
- clearTimeout(n.timer);
1080
- });
1081
- }), (n, u) => (o(), I(be, { to: "body" }, [
1082
- $(De, {
1083
- name: "notification",
1084
- tag: "div",
1085
- class: "fixed top-4 right-4 z-50 space-y-2"
1086
- }, {
1087
- default: Te(() => [
1088
- (o(!0), a(V, null, A(i.value, (v) => (o(), a("div", {
1089
- key: v.id,
1090
- 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"
1091
- }, [
1092
- $(k(Oe), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
1093
- u[0] || (u[0] = e("div", { class: "flex-1" }, [
1094
- e("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
1095
- e("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
1096
- ], -1)),
1097
- e("button", {
1098
- onClick: (g) => c(v.id),
1099
- class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
1100
- }, [
1101
- $(k(Y), { class: "h-4 w-4" })
1102
- ], 8, gs)
1103
- ]))), 128))
1104
- ]),
1105
- _: 1
1106
- })
1107
- ]));
1108
- }
1109
- }), W = (r, l) => {
1110
- const i = r.__vccOpts || r;
1111
- for (const [t, s] of l)
1112
- i[t] = s;
1113
- return i;
1114
- }, $e = /* @__PURE__ */ W(hs, [["__scopeId", "data-v-55903525"]]), fs = { class: "fixed inset-0 z-50 bg-black/80" }, vs = { class: "fixed bg-white left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 sm:rounded-lg max-w-4xl max-h-[90vh] p-0" }, ys = { class: "flex flex-col space-y-1.5 text-center sm:text-left p-4 pb-2" }, bs = { class: "flex items-center justify-between" }, xs = { class: "flex items-center gap-2" }, ks = { class: "tracking-tight text-base font-medium" }, _s = { class: "p-4 pt-0" }, ws = { class: "flex flex-col items-center" }, $s = ["src", "alt"], Cs = { class: "mt-3 flex items-center gap-4 text-sm text-gray-600" }, Ms = { class: "mt-3 flex gap-2" }, Ls = /* @__PURE__ */ j({
1115
- __name: "GalleryModal",
1040
+ }), ms = {
1041
+ key: 0,
1042
+ class: "image-wrapper h-full max-h-[400px]",
1043
+ id: "lightbox-gallery"
1044
+ }, gs = ["onClick"], hs = {
1045
+ key: 0,
1046
+ rel: "noreferrer",
1047
+ class: "relative block h-full w-full"
1048
+ }, fs = ["src"], ys = {
1049
+ key: 0,
1050
+ class: "thumb-cover"
1051
+ }, vs = /* @__PURE__ */ j({
1052
+ __name: "GalleryContent",
1116
1053
  props: {
1117
- item: {}
1054
+ title: {},
1055
+ items: {},
1056
+ columns: {},
1057
+ maxHeight: {},
1058
+ onAddImage: { type: Function },
1059
+ onDelete: { type: Function },
1060
+ id: {},
1061
+ className: {},
1062
+ style: {}
1118
1063
  },
1119
- emits: ["close"],
1120
- setup(r) {
1121
- const l = w(), i = (n) => new Date(n).toLocaleDateString("uk-UA", {
1122
- day: "2-digit",
1123
- month: "2-digit",
1124
- year: "numeric"
1125
- }), t = (n) => n >= 1024 * 1024 * 1024 ? (n / (1024 * 1024 * 1024)).toFixed(2) + " GB" : n >= 1024 * 1024 ? (n / (1024 * 1024)).toFixed(2) + " MB" : n >= 1024 ? (n / 1024).toFixed(2) + " KB" : n + " B", s = (n) => {
1126
- navigator.clipboard.writeText(n), l.value?.addNotification();
1127
- }, c = async (n, u) => {
1128
- try {
1129
- const g = await (await fetch(n)).blob(), d = window.URL.createObjectURL(g), y = document.createElement("a");
1130
- y.href = d, y.download = u, document.body.appendChild(y), y.click(), window.URL.revokeObjectURL(d), document.body.removeChild(y);
1131
- } catch (v) {
1132
- console.error("Download failed:", v), alert("Download failed. Please try opening the image in a new tab.");
1133
- }
1064
+ emits: ["delete"],
1065
+ setup(a, { emit: l }) {
1066
+ const o = l, e = $(!1), n = $(0), g = a, d = N(
1067
+ () => Array.isArray(g.items) ? g.items.map((v) => v?.file_path) : []
1068
+ ), y = (v) => {
1069
+ const p = d.value.findIndex(
1070
+ (r) => r === v.file_path
1071
+ );
1072
+ p !== -1 && (e.value = !0, n.value = p);
1134
1073
  };
1135
- return (n, u) => (o(), a("div", fs, [
1136
- e("div", vs, [
1137
- e("div", ys, [
1138
- e("div", bs, [
1139
- e("div", xs, [
1140
- e("h2", ks, b(n.item.name), 1)
1141
- ])
1142
- ])
1143
- ]),
1144
- e("div", _s, [
1145
- e("div", ws, [
1146
- e("img", {
1147
- src: n.item.path,
1148
- alt: n.item.name,
1149
- class: "max-w-full max-h-[60vh] object-contain rounded border"
1150
- }, null, 8, $s),
1151
- e("div", Cs, [
1152
- e("span", null, "Size: " + b(t(n.item.size)), 1),
1153
- u[3] || (u[3] = e("span", null, "•", -1)),
1154
- e("span", null, "Date: " + b(i(n.item.createdAt)), 1)
1155
- ]),
1156
- e("div", Ms, [
1157
- e("button", {
1158
- onClick: u[0] || (u[0] = (v) => c(n.item.path, n.item.name)),
1159
- 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 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 h-9 rounded-md px-3"
1160
- }, [
1161
- $(k(ue), { class: "h-3 w-3 mr-1" }),
1162
- u[4] || (u[4] = S(" Download ", -1))
1163
- ]),
1164
- e("button", {
1165
- onClick: u[1] || (u[1] = (v) => s(n.item.path)),
1166
- 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 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 h-9 rounded-md px-3"
1167
- }, [
1168
- $(k(Ke), { class: "h-3 w-3 mr-1" }),
1169
- u[5] || (u[5] = S(" Share ", -1))
1074
+ return (v, p) => {
1075
+ const r = Q("Lightbox");
1076
+ return v.items?.length >= 1 ? (s(), i("div", ms, [
1077
+ (s(!0), i(I, null, E(v.items, (f, m) => (s(), i("div", {
1078
+ class: D(["h-full w-full image" + m, "cursor-pointer bg-teal-500 rounded-[3px]"]),
1079
+ key: m,
1080
+ onClick: U((C) => y(f), ["stop"])
1081
+ }, [
1082
+ m < 5 ? (s(), i("div", hs, [
1083
+ t("img", {
1084
+ src: `/file/resize?filepath=${f?.file_path}&w=500`,
1085
+ alt: "alt",
1086
+ height: "auto",
1087
+ width: "100%",
1088
+ class: D([
1089
+ "object-cover h-full w-full bg-gray-200 rounded-[3px]",
1090
+ m === 0 ? "max-h-[411px]" : "max-h-[calc((411px-3px)/2)]"
1170
1091
  ])
1171
- ])
1092
+ }, null, 10, fs),
1093
+ m === 4 && v.items?.length > 5 ? (s(), i("div", ys, " +" + x(v.items?.length - 5), 1)) : b("", !0)
1094
+ ])) : b("", !0)
1095
+ ], 10, gs))), 128)),
1096
+ (s(!0), i(I, null, E(Math.max(0, 5 - v.items.length), (f) => (s(), i("div", {
1097
+ key: "empty-" + f,
1098
+ class: D(["h-full w-full image" + (v.items.length + f - 1), "bg-gray-300 rounded-[3px]"])
1099
+ }, null, 2))), 128)),
1100
+ M(r, {
1101
+ modelValue: e.value,
1102
+ "onUpdate:modelValue": p[0] || (p[0] = (f) => e.value = f),
1103
+ images: d.value,
1104
+ "start-index": n.value,
1105
+ delete: "true",
1106
+ download: "true",
1107
+ onDelete: p[1] || (p[1] = (f) => o("delete", f))
1108
+ }, null, 8, ["modelValue", "images", "start-index"])
1109
+ ])) : b("", !0);
1110
+ };
1111
+ }
1112
+ }), bs = {
1113
+ key: 0,
1114
+ class: "text-xl font-semibold"
1115
+ }, xs = { class: "flex gap-1" }, ks = { 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" }, _s = /* @__PURE__ */ j({
1116
+ __name: "widgetHeader",
1117
+ props: {
1118
+ title: {}
1119
+ },
1120
+ emits: ["onAddImage"],
1121
+ setup(a) {
1122
+ return (l, o) => (s(), i("div", {
1123
+ class: D(["flex flex-col sm:flex-row gap-3 mb-4", l.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
1124
+ }, [
1125
+ l.title ? (s(), i("h3", bs, x(l.title), 1)) : b("", !0),
1126
+ t("div", xs, [
1127
+ t("label", null, [
1128
+ t("input", {
1129
+ type: "file",
1130
+ class: "hidden",
1131
+ onChange: o[0] || (o[0] = (e) => l.$emit("onAddImage", e))
1132
+ }, null, 32),
1133
+ t("div", ks, [
1134
+ M(w(be), { class: "h-4 w-4" }),
1135
+ o[1] || (o[1] = F(" Додати зображення ", -1))
1172
1136
  ])
1173
- ]),
1174
- e("button", {
1175
- type: "button",
1176
- onClick: u[2] || (u[2] = (v) => n.$emit("close")),
1177
- class: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
1178
- }, [
1179
- $(k(Y), { class: "h-4 w-4" }),
1180
- u[6] || (u[6] = e("span", { class: "sr-only" }, "Close", -1))
1181
1137
  ])
1182
- ]),
1183
- $($e, {
1184
- ref_key: "copyNotificationRef",
1185
- ref: l
1186
- }, null, 512)
1187
- ]));
1138
+ ])
1139
+ ], 2));
1188
1140
  }
1189
- }), Ds = {
1190
- key: 0,
1191
- class: "text-xl font-semibold text-gray-900 mb-4"
1192
- }, Ts = ["onClick"], Is = ["src", "alt"], le = /* @__PURE__ */ j({
1141
+ }), ws = {
1142
+ class: "w-full mx-auto font-sans",
1143
+ ref: "containerRef"
1144
+ }, $s = { key: 1 }, ne = /* @__PURE__ */ j({
1193
1145
  __name: "GalleryWidget",
1194
1146
  props: {
1195
1147
  title: {},
1196
- items: {},
1148
+ items: { default: () => [] },
1197
1149
  columns: {},
1198
1150
  maxHeight: {},
1151
+ onAddImage: {},
1152
+ onDelete: {},
1199
1153
  id: {},
1200
1154
  className: {},
1201
1155
  style: {}
1202
1156
  },
1203
- setup(r) {
1204
- const l = r, i = w(!1), t = w(null), s = w(), c = w(0);
1205
- let n = null;
1206
- const u = O(() => {
1207
- const d = l.columns || 4;
1208
- return c.value >= 1440 ? d : c.value >= 1024 ? Math.max(1, d - 1) : c.value >= 768 ? Math.max(1, d - 2) : c.value >= 640 ? Math.max(1, d - 3) : 1;
1209
- }), v = () => {
1210
- s.value && (c.value = s.value.offsetWidth);
1157
+ emits: ["delete", "add", "openLightbox"],
1158
+ setup(a, { emit: l }) {
1159
+ const o = a, e = $(o.items ?? []), n = l;
1160
+ e.value.length === 0 && v();
1161
+ const g = (r) => {
1162
+ o.onAddImage ? o.onAddImage(r) : y(r), n("add", r);
1163
+ }, d = (r) => {
1164
+ const f = e.value.find(
1165
+ (m) => m.file_path === r
1166
+ )?.file_id;
1167
+ f && (o.onDelete ? o.onDelete(f) : p(f));
1168
+ }, y = async (r) => {
1169
+ if (!(!r.target || !r.target.files || r.target.files.length === 0))
1170
+ try {
1171
+ await Promise.all(
1172
+ Array.from(r.target.files).map(async (f) => {
1173
+ const m = new FormData();
1174
+ m.append("file", f);
1175
+ const C = `/api/widget/file/${o.id}`, O = await fetch(C, {
1176
+ method: "POST",
1177
+ body: m
1178
+ });
1179
+ if (!O.ok)
1180
+ throw new Error(`HTTP error! status: ${O.status}`);
1181
+ return f;
1182
+ })
1183
+ ), await v();
1184
+ } catch (f) {
1185
+ console.error("Помилка при завантаженні файлів:", f);
1186
+ }
1211
1187
  };
1212
- Q(() => {
1213
- Ie(() => {
1214
- s.value && (n = new ResizeObserver((d) => {
1215
- for (const y of d)
1216
- y.target === s.value && (c.value = y.contentRect.width);
1217
- }), n.observe(s.value), v());
1218
- });
1219
- }), ce(() => {
1220
- n && n.disconnect();
1221
- });
1222
- const g = (d) => {
1223
- t.value = d, i.value = !0;
1188
+ async function v() {
1189
+ if (!o.id)
1190
+ return;
1191
+ const r = await fetch(`/api/widget/file/${o.id}`).then(
1192
+ (f) => f.json()
1193
+ );
1194
+ e.value = r.rows;
1195
+ }
1196
+ const p = async (r) => {
1197
+ try {
1198
+ await fetch(`/api/widget/file/${o.id}/${r}`, {
1199
+ method: "DELETE"
1200
+ }), await v();
1201
+ } catch (f) {
1202
+ console.error(f);
1203
+ }
1224
1204
  };
1225
- return (d, y) => (o(), a("div", {
1226
- class: "w-full mx-auto font-sans",
1227
- ref_key: "containerRef",
1228
- ref: s
1229
- }, [
1230
- d.title ? (o(), a("h3", Ds, b(d.title), 1)) : _("", !0),
1231
- e("div", {
1232
- class: D(d.maxHeight ? "overflow-y-auto" : ""),
1233
- style: U({ maxHeight: d.maxHeight + "px" })
1234
- }, [
1235
- e("div", {
1236
- style: U({ columns: u.value + " auto", gap: "12px" }),
1237
- class: "space-y-3"
1238
- }, [
1239
- (o(!0), a(V, null, A(d.items, (h) => (o(), a("div", {
1240
- key: h.id,
1241
- onClick: (M) => g(h),
1242
- class: "group relative break-inside-avoid bg-gray-200 rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-all mb-3"
1243
- }, [
1244
- e("img", {
1245
- src: h.path,
1246
- alt: h.name,
1247
- class: "w-full h-auto min-h-40 rounded-md object-contain"
1248
- }, null, 8, Is),
1249
- y[1] || (y[1] = e("div", { class: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-12" }, [
1250
- e("h3", { class: "text-white font-medium text-base leading-tight mb-1" }, "Mountain Landscape"),
1251
- e("p", { class: "text-white/90 text-sm" }, "2.4 MB")
1252
- ], -1)),
1253
- y[2] || (y[2] = e("div", { class: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-200" }, null, -1))
1254
- ], 8, Ts))), 128))
1255
- ], 4)
1256
- ], 6),
1257
- (o(), I(be, { to: "body" }, [
1258
- i.value && t.value ? (o(), I(Ls, {
1259
- key: 0,
1260
- item: t.value,
1261
- onClose: y[0] || (y[0] = (h) => i.value = !1)
1262
- }, null, 8, ["item"])) : _("", !0)
1263
- ]))
1205
+ return (r, f) => (s(), i("div", ws, [
1206
+ M(_s, {
1207
+ title: r.title,
1208
+ onOnAddImage: f[0] || (f[0] = (m) => g(m))
1209
+ }, null, 8, ["title"]),
1210
+ e.value.length > 0 ? (s(), A(vs, {
1211
+ key: 0,
1212
+ items: e.value,
1213
+ onDelete: f[1] || (f[1] = (m) => d(m))
1214
+ }, null, 8, ["items"])) : (s(), i("div", $s, [...f[2] || (f[2] = [
1215
+ t("div", { class: "flex items-center justify-center h-full" }, [
1216
+ t("p", { class: "text-gray-500 leading-[3]" }, "Зображень не знайдено")
1217
+ ], -1)
1218
+ ])]))
1264
1219
  ], 512));
1265
1220
  }
1266
- }), js = { class: "text-value" }, zs = { class: "text-sm text-gray-900" }, Vs = /* @__PURE__ */ j({
1221
+ }), Cs = { class: "text-value" }, Ms = { class: "text-sm text-gray-900" }, Ls = /* @__PURE__ */ j({
1267
1222
  __name: "TextValue",
1268
1223
  props: {
1269
1224
  item: {}
1270
1225
  },
1271
- setup(r) {
1272
- const l = r, i = O(() => {
1273
- const t = l.item.value;
1274
- return typeof t == "boolean" ? t ? "Так" : "Ні" : t == null ? "—" : String(t);
1226
+ setup(a) {
1227
+ const l = a, o = N(() => {
1228
+ const e = l.item.value;
1229
+ return typeof e == "boolean" ? e ? "Так" : "Ні" : e == null ? "—" : String(e);
1275
1230
  });
1276
- return (t, s) => (o(), a("div", js, [
1277
- e("span", zs, b(i.value), 1)
1231
+ return (e, n) => (s(), i("div", Cs, [
1232
+ t("span", Ms, x(o.value), 1)
1278
1233
  ]));
1279
1234
  }
1280
- }), Fs = /* @__PURE__ */ W(Vs, [["__scopeId", "data-v-c14550b7"]]), Hs = { class: "link-value" }, As = ["href"], Ss = /* @__PURE__ */ j({
1235
+ }), W = (a, l) => {
1236
+ const o = a.__vccOpts || a;
1237
+ for (const [e, n] of l)
1238
+ o[e] = n;
1239
+ return o;
1240
+ }, Ts = /* @__PURE__ */ W(Ls, [["__scopeId", "data-v-c14550b7"]]), Ds = { class: "link-value" }, Is = ["href"], js = /* @__PURE__ */ j({
1281
1241
  __name: "LinkValue",
1282
1242
  props: {
1283
1243
  item: {}
1284
1244
  },
1285
- setup(r) {
1286
- const l = r, i = O(() => {
1287
- const t = String(l.item.value);
1245
+ setup(a) {
1246
+ const l = a, o = N(() => {
1247
+ const e = String(l.item.value);
1288
1248
  try {
1289
- const s = new URL(t);
1290
- return s.hostname + s.pathname;
1249
+ const n = new URL(e);
1250
+ return n.hostname + n.pathname;
1291
1251
  } catch {
1292
- return t;
1252
+ return e;
1293
1253
  }
1294
1254
  });
1295
- return (t, s) => (o(), a("div", Hs, [
1296
- e("a", {
1297
- href: String(t.item.value),
1255
+ return (e, n) => (s(), i("div", Ds, [
1256
+ t("a", {
1257
+ href: String(e.item.value),
1298
1258
  target: "_blank",
1299
1259
  rel: "noopener noreferrer",
1300
1260
  class: "text-blue-600 hover:text-blue-800 underline text-sm"
1301
1261
  }, [
1302
- S(b(i.value) + " ", 1),
1303
- s[0] || (s[0] = e("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
1304
- ], 8, As)
1262
+ F(x(o.value) + " ", 1),
1263
+ n[0] || (n[0] = t("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
1264
+ ], 8, Is)
1305
1265
  ]));
1306
1266
  }
1307
- }), Es = /* @__PURE__ */ W(Ss, [["__scopeId", "data-v-e6eb07a6"]]), Os = { class: "date-value" }, Bs = { class: "text-sm text-gray-900" }, Ns = /* @__PURE__ */ j({
1267
+ }), Vs = /* @__PURE__ */ W(js, [["__scopeId", "data-v-e6eb07a6"]]), As = { class: "date-value" }, zs = { class: "text-sm text-gray-900" }, Hs = /* @__PURE__ */ j({
1308
1268
  __name: "DateValue",
1309
1269
  props: {
1310
1270
  item: {}
1311
1271
  },
1312
- setup(r) {
1313
- const l = r, i = O(() => {
1314
- const t = l.item.value;
1315
- if (t instanceof Date)
1316
- return t.toLocaleDateString("uk-UA", {
1272
+ setup(a) {
1273
+ const l = a, o = N(() => {
1274
+ const e = l.item.value;
1275
+ if (e instanceof Date)
1276
+ return e.toLocaleDateString("uk-UA", {
1317
1277
  year: "numeric",
1318
1278
  month: "long",
1319
1279
  day: "numeric",
1320
1280
  hour: "2-digit",
1321
1281
  minute: "2-digit"
1322
1282
  });
1323
- if (typeof t == "string") {
1324
- const s = new Date(t);
1325
- if (!isNaN(s.getTime()))
1326
- return s.toLocaleDateString("uk-UA", {
1283
+ if (typeof e == "string") {
1284
+ const n = new Date(e);
1285
+ if (!isNaN(n.getTime()))
1286
+ return n.toLocaleDateString("uk-UA", {
1327
1287
  year: "numeric",
1328
1288
  month: "long",
1329
1289
  day: "numeric",
@@ -1331,22 +1291,22 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
1331
1291
  minute: "2-digit"
1332
1292
  });
1333
1293
  }
1334
- return String(t);
1294
+ return String(e);
1335
1295
  });
1336
- return (t, s) => (o(), a("div", Os, [
1337
- e("span", Bs, b(i.value), 1)
1296
+ return (e, n) => (s(), i("div", As, [
1297
+ t("span", zs, x(o.value), 1)
1338
1298
  ]));
1339
1299
  }
1340
- }), Rs = /* @__PURE__ */ W(Ns, [["__scopeId", "data-v-b9600618"]]), Us = { class: "status-value" }, Ws = {
1300
+ }), Es = /* @__PURE__ */ W(Hs, [["__scopeId", "data-v-b9600618"]]), Fs = { class: "status-value" }, Ss = {
1341
1301
  key: 0,
1342
1302
  class: "mr-1"
1343
- }, Ps = /* @__PURE__ */ j({
1303
+ }, Ns = /* @__PURE__ */ j({
1344
1304
  __name: "StatusValue",
1345
1305
  props: {
1346
1306
  item: {}
1347
1307
  },
1348
- setup(r) {
1349
- const l = r, i = O(() => {
1308
+ setup(a) {
1309
+ const l = a, o = N(() => {
1350
1310
  switch (String(l.item.value).toLowerCase()) {
1351
1311
  case "active":
1352
1312
  case "активний":
@@ -1369,7 +1329,7 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
1369
1329
  default:
1370
1330
  return "bg-blue-100 text-blue-800";
1371
1331
  }
1372
- }), t = O(() => {
1332
+ }), e = N(() => {
1373
1333
  switch (String(l.item.value).toLowerCase()) {
1374
1334
  case "active":
1375
1335
  case "активний":
@@ -1393,50 +1353,50 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
1393
1353
  return "fas fa-info-circle";
1394
1354
  }
1395
1355
  });
1396
- return (s, c) => (o(), a("div", Us, [
1397
- e("span", {
1398
- class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", i.value])
1356
+ return (n, g) => (s(), i("div", Fs, [
1357
+ t("span", {
1358
+ class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", o.value])
1399
1359
  }, [
1400
- t.value ? (o(), a("span", Ws, [
1401
- e("i", {
1402
- class: D(t.value)
1360
+ e.value ? (s(), i("span", Ss, [
1361
+ t("i", {
1362
+ class: D(e.value)
1403
1363
  }, null, 2)
1404
- ])) : _("", !0),
1405
- S(" " + b(String(s.item.value)), 1)
1364
+ ])) : b("", !0),
1365
+ F(" " + x(String(n.item.value)), 1)
1406
1366
  ], 2)
1407
1367
  ]));
1408
1368
  }
1409
- }), Gs = /* @__PURE__ */ W(Ps, [["__scopeId", "data-v-c72e0b01"]]), qs = { class: "custom-value" }, Ks = { class: "text-sm text-gray-900" }, Zs = /* @__PURE__ */ j({
1369
+ }), Os = /* @__PURE__ */ W(Ns, [["__scopeId", "data-v-c72e0b01"]]), Bs = { class: "custom-value" }, Ps = { class: "text-sm text-gray-900" }, Rs = /* @__PURE__ */ j({
1410
1370
  __name: "CustomValue",
1411
1371
  props: {
1412
1372
  item: {}
1413
1373
  },
1414
- setup(r) {
1415
- return (l, i) => (o(), a("div", qs, [
1416
- G(l.$slots, "default", {
1374
+ setup(a) {
1375
+ return (l, o) => (s(), i("div", Bs, [
1376
+ q(l.$slots, "default", {
1417
1377
  item: l.item,
1418
1378
  value: l.item.value
1419
1379
  }, () => [
1420
- e("span", Ks, b(String(l.item.value)), 1)
1380
+ t("span", Ps, x(String(l.item.value)), 1)
1421
1381
  ], !0)
1422
1382
  ]));
1423
1383
  }
1424
- }), Js = /* @__PURE__ */ W(Zs, [["__scopeId", "data-v-11a73810"]]), Xs = ["id"], Qs = {
1384
+ }), Us = /* @__PURE__ */ W(Rs, [["__scopeId", "data-v-11a73810"]]), Ws = ["id"], qs = {
1425
1385
  key: 0,
1426
1386
  class: "text-xl font-semibold text-gray-900 mb-4"
1427
- }, Ys = {
1387
+ }, Gs = {
1428
1388
  key: 1,
1429
1389
  class: "overflow-x-auto"
1430
- }, eo = { class: "min-w-full divide-y divide-gray-200" }, to = { class: "bg-white divide-y divide-gray-200" }, so = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, oo = { class: "flex items-center gap-2" }, no = ["title"], io = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, lo = {
1390
+ }, Ks = { class: "min-w-full divide-y divide-gray-200" }, Zs = { class: "bg-white divide-y divide-gray-200" }, Js = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, Xs = { class: "flex items-center gap-2" }, Qs = ["title"], Ys = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, eo = {
1431
1391
  key: 2,
1432
1392
  class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
1433
- }, ao = { class: "flex items-start gap-3" }, ro = {
1393
+ }, to = { class: "flex items-start gap-3" }, so = {
1434
1394
  key: 0,
1435
1395
  class: "flex-shrink-0"
1436
- }, co = { class: "flex-1 min-w-0" }, uo = { class: "flex items-center gap-2 mb-2" }, po = { class: "text-sm font-medium text-gray-900" }, mo = ["title"], go = {
1396
+ }, oo = { class: "flex-1 min-w-0" }, no = { class: "flex items-center gap-2 mb-2" }, io = { class: "text-sm font-medium text-gray-900" }, lo = ["title"], ao = {
1437
1397
  key: 3,
1438
1398
  class: "overflow-x-auto"
1439
- }, ho = { class: "min-w-full divide-y divide-gray-200" }, fo = { class: "bg-white divide-y divide-gray-200" }, vo = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, yo = { class: "flex items-center gap-2" }, bo = ["title"], xo = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, ko = /* @__PURE__ */ j({
1399
+ }, ro = { class: "min-w-full divide-y divide-gray-200" }, co = { class: "bg-white divide-y divide-gray-200" }, uo = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, po = { class: "flex items-center gap-2" }, mo = ["title"], go = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, ho = /* @__PURE__ */ j({
1440
1400
  __name: "DescriptionListWidget",
1441
1401
  props: {
1442
1402
  title: {},
@@ -1446,113 +1406,113 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
1446
1406
  className: {},
1447
1407
  style: {}
1448
1408
  },
1449
- setup(r) {
1450
- const l = (i) => {
1451
- switch (i.type) {
1409
+ setup(a) {
1410
+ const l = (o) => {
1411
+ switch (o.type) {
1452
1412
  case "link":
1453
- return Es;
1413
+ return Vs;
1454
1414
  case "date":
1455
- return Rs;
1415
+ return Es;
1456
1416
  case "status":
1457
- return Gs;
1417
+ return Os;
1458
1418
  case "custom":
1459
- return Js;
1419
+ return Us;
1460
1420
  default:
1461
- return Fs;
1421
+ return Ts;
1462
1422
  }
1463
1423
  };
1464
- return (i, t) => (o(), a("div", {
1465
- class: D(["description-list-widget", i.className]),
1466
- id: i.id,
1467
- style: U(i.style)
1424
+ return (o, e) => (s(), i("div", {
1425
+ class: D(["description-list-widget", o.className]),
1426
+ id: o.id,
1427
+ style: Z(o.style)
1468
1428
  }, [
1469
- i.title ? (o(), a("h3", Qs, b(i.title), 1)) : _("", !0),
1470
- i.view === "table" ? (o(), a("div", Ys, [
1471
- e("table", eo, [
1472
- e("tbody", to, [
1473
- (o(!0), a(V, null, A(i.items, (s) => (o(), a("tr", {
1474
- key: s.id || s.label
1429
+ o.title ? (s(), i("h3", qs, x(o.title), 1)) : b("", !0),
1430
+ o.view === "table" ? (s(), i("div", Gs, [
1431
+ t("table", Ks, [
1432
+ t("tbody", Zs, [
1433
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
1434
+ key: n.id || n.label
1475
1435
  }, [
1476
- e("td", so, [
1477
- e("div", oo, [
1478
- s.icon ? (o(), a("i", {
1436
+ t("td", Js, [
1437
+ t("div", Xs, [
1438
+ n.icon ? (s(), i("i", {
1479
1439
  key: 0,
1480
- class: D([s.icon, "text-gray-500"])
1481
- }, null, 2)) : _("", !0),
1482
- S(" " + b(s.label) + " ", 1),
1483
- s.tooltip ? (o(), a("span", {
1440
+ class: D([n.icon, "text-gray-500"])
1441
+ }, null, 2)) : b("", !0),
1442
+ F(" " + x(n.label) + " ", 1),
1443
+ n.tooltip ? (s(), i("span", {
1484
1444
  key: 1,
1485
1445
  class: "text-gray-400 cursor-help",
1486
- title: s.tooltip
1487
- }, t[0] || (t[0] = [
1488
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1489
- ]), 8, no)) : _("", !0)
1446
+ title: n.tooltip
1447
+ }, [...e[0] || (e[0] = [
1448
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1449
+ ])], 8, Qs)) : b("", !0)
1490
1450
  ])
1491
1451
  ]),
1492
- e("td", io, [
1493
- (o(), I(B(l(s)), { item: s }, null, 8, ["item"]))
1452
+ t("td", Ys, [
1453
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1494
1454
  ])
1495
1455
  ]))), 128))
1496
1456
  ])
1497
1457
  ])
1498
- ])) : i.view === "grid" ? (o(), a("div", lo, [
1499
- (o(!0), a(V, null, A(i.items, (s) => (o(), a("div", {
1500
- key: s.id || s.label,
1458
+ ])) : o.view === "grid" ? (s(), i("div", eo, [
1459
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("div", {
1460
+ key: n.id || n.label,
1501
1461
  class: "description-item-card bg-white border border-gray-200 rounded-lg p-4"
1502
1462
  }, [
1503
- e("div", ao, [
1504
- s.icon ? (o(), a("div", ro, [
1505
- e("i", {
1506
- class: D([s.icon, "text-gray-500 text-lg"])
1463
+ t("div", to, [
1464
+ n.icon ? (s(), i("div", so, [
1465
+ t("i", {
1466
+ class: D([n.icon, "text-gray-500 text-lg"])
1507
1467
  }, null, 2)
1508
- ])) : _("", !0),
1509
- e("div", co, [
1510
- e("div", uo, [
1511
- e("h4", po, b(s.label), 1),
1512
- s.tooltip ? (o(), a("span", {
1468
+ ])) : b("", !0),
1469
+ t("div", oo, [
1470
+ t("div", no, [
1471
+ t("h4", io, x(n.label), 1),
1472
+ n.tooltip ? (s(), i("span", {
1513
1473
  key: 0,
1514
1474
  class: "text-gray-400 cursor-help",
1515
- title: s.tooltip
1516
- }, t[1] || (t[1] = [
1517
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1518
- ]), 8, mo)) : _("", !0)
1475
+ title: n.tooltip
1476
+ }, [...e[1] || (e[1] = [
1477
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1478
+ ])], 8, lo)) : b("", !0)
1519
1479
  ]),
1520
- (o(), I(B(l(s)), { item: s }, null, 8, ["item"]))
1480
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1521
1481
  ])
1522
1482
  ])
1523
1483
  ]))), 128))
1524
- ])) : (o(), a("div", go, [
1525
- e("table", ho, [
1526
- e("tbody", fo, [
1527
- (o(!0), a(V, null, A(i.items, (s) => (o(), a("tr", {
1528
- key: s.id || s.label
1484
+ ])) : (s(), i("div", ao, [
1485
+ t("table", ro, [
1486
+ t("tbody", co, [
1487
+ (s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
1488
+ key: n.id || n.label
1529
1489
  }, [
1530
- e("td", vo, [
1531
- e("div", yo, [
1532
- s.icon ? (o(), a("i", {
1490
+ t("td", uo, [
1491
+ t("div", po, [
1492
+ n.icon ? (s(), i("i", {
1533
1493
  key: 0,
1534
- class: D([s.icon, "text-gray-500"])
1535
- }, null, 2)) : _("", !0),
1536
- S(" " + b(s.label) + " ", 1),
1537
- s.tooltip ? (o(), a("span", {
1494
+ class: D([n.icon, "text-gray-500"])
1495
+ }, null, 2)) : b("", !0),
1496
+ F(" " + x(n.label) + " ", 1),
1497
+ n.tooltip ? (s(), i("span", {
1538
1498
  key: 1,
1539
1499
  class: "text-gray-400 cursor-help",
1540
- title: s.tooltip
1541
- }, t[2] || (t[2] = [
1542
- e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1543
- ]), 8, bo)) : _("", !0)
1500
+ title: n.tooltip
1501
+ }, [...e[2] || (e[2] = [
1502
+ t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
1503
+ ])], 8, mo)) : b("", !0)
1544
1504
  ])
1545
1505
  ]),
1546
- e("td", xo, [
1547
- (o(), I(B(l(s)), { item: s }, null, 8, ["item"]))
1506
+ t("td", go, [
1507
+ (s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
1548
1508
  ])
1549
1509
  ]))), 128))
1550
1510
  ])
1551
1511
  ])
1552
1512
  ]))
1553
- ], 14, Xs));
1513
+ ], 14, Ws));
1554
1514
  }
1555
- }), Ce = /* @__PURE__ */ W(ko, [["__scopeId", "data-v-36d43e50"]]), _o = {
1515
+ }), Ce = /* @__PURE__ */ W(ho, [["__scopeId", "data-v-36d43e50"]]), fo = {
1556
1516
  draw: {
1557
1517
  toolbar: {
1558
1518
  actions: {
@@ -1660,24 +1620,24 @@ const Ut = { class: "space-y-0.5" }, Wt = ["onClick"], Pt = ["onClick"], Gt = {
1660
1620
  }
1661
1621
  }
1662
1622
  };
1663
- function wo(r) {
1664
- return r ? r.type === "FeatureCollection" || r.type === "Feature" ? r : r.geom ? {
1623
+ function yo(a) {
1624
+ return a ? a.type === "FeatureCollection" || a.type === "Feature" ? a : a.geom ? {
1665
1625
  type: "Feature",
1666
1626
  geometry: {
1667
- type: r.geom.type,
1668
- coordinates: r.geom.coordinates
1627
+ type: a.geom.type,
1628
+ coordinates: a.geom.coordinates
1669
1629
  },
1670
1630
  properties: {}
1671
- } : r.type && r.coordinates ? {
1631
+ } : a.type && a.coordinates ? {
1672
1632
  type: "Feature",
1673
- geometry: r,
1633
+ geometry: a,
1674
1634
  properties: {}
1675
1635
  } : null : null;
1676
1636
  }
1677
- const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1637
+ const vo = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, bo = {
1678
1638
  key: 1,
1679
1639
  class: "bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"
1680
- }, Mo = { class: "flex items-center justify-between p-2 border-b" }, Lo = { class: "p-2 border-b" }, Do = { class: "flex items-center" }, To = { class: "flex items-center" }, Io = { class: "flex items-center" }, jo = { class: "p-2" }, zo = { class: "flex items-center" }, ae = /* @__PURE__ */ j({
1640
+ }, xo = { class: "flex items-center justify-between p-2 border-b" }, ko = { class: "p-2 border-b" }, _o = { class: "flex items-center" }, wo = { class: "flex items-center" }, $o = { class: "flex items-center" }, Co = { class: "p-2" }, Mo = { class: "flex items-center" }, ie = /* @__PURE__ */ j({
1681
1641
  __name: "MapWidget",
1682
1642
  props: {
1683
1643
  geom: {},
@@ -1685,10 +1645,10 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1685
1645
  className: {},
1686
1646
  style: {}
1687
1647
  },
1688
- setup(r) {
1689
- const l = r, i = w(null);
1690
- let t, s;
1691
- const c = {
1648
+ setup(a) {
1649
+ const l = a, o = $(null);
1650
+ let e, n;
1651
+ const g = {
1692
1652
  topo100: {
1693
1653
  url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"
1694
1654
  },
@@ -1698,69 +1658,69 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1698
1658
  osmb: {
1699
1659
  url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"
1700
1660
  }
1701
- }, n = w("topo100");
1702
- let u;
1703
- const v = w(!0), g = w(!1);
1704
- function d() {
1705
- return new Promise((F, p) => {
1706
- if (window.L && window.L.Draw) return F(0);
1707
- const f = (C) => {
1708
- if (Array.from(document.styleSheets).some((E) => E?.href?.includes(C))) return;
1709
- const m = document.createElement("link");
1710
- m.rel = "stylesheet", m.href = C, document.head.appendChild(m);
1711
- }, H = (C) => new Promise((x, m) => {
1712
- const E = Array.from(document.scripts).find((z) => z.src === C);
1713
- if (E) {
1714
- E.addEventListener("load", () => x()), E.addEventListener("error", (z) => m(z));
1661
+ }, d = $("topo100");
1662
+ let y;
1663
+ const v = $(!0), p = $(!1);
1664
+ function r() {
1665
+ return new Promise((z, c) => {
1666
+ if (window.L && window.L.Draw) return z(0);
1667
+ const u = (k) => {
1668
+ if (Array.from(document.styleSheets).some((S) => S?.href?.includes(k))) return;
1669
+ const h = document.createElement("link");
1670
+ h.rel = "stylesheet", h.href = k, document.head.appendChild(h);
1671
+ }, T = (k) => new Promise((_, h) => {
1672
+ const S = Array.from(document.scripts).find((H) => H.src === k);
1673
+ if (S) {
1674
+ S.addEventListener("load", () => _()), S.addEventListener("error", (H) => h(H));
1715
1675
  return;
1716
1676
  }
1717
- const N = document.createElement("script");
1718
- N.src = C, N.async = !0, N.onload = () => x(), N.onerror = (z) => m(z), document.body.appendChild(N);
1677
+ const P = document.createElement("script");
1678
+ P.src = k, P.async = !0, P.onload = () => _(), P.onerror = (H) => h(H), document.body.appendChild(P);
1719
1679
  });
1720
- f("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), f("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), H("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => H("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => F(0)).catch(p);
1680
+ u("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), u("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), T("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => T("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => z(0)).catch(c);
1721
1681
  });
1722
1682
  }
1723
- Q(async () => {
1724
- await d(), L.drawLocal = _o, t = L.map(i.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(t), u = L.tileLayer(c.topo100.url, { maxZoom: 19 }).addTo(t), n.value = "topo100", s = new L.FeatureGroup().addTo(t);
1725
- const F = wo(l.geom);
1726
- if (F) {
1727
- const p = [];
1728
- L.geoJSON(F).eachLayer((f) => p.push(f)), p.length && s.addLayer(p[0]), s.toGeoJSON(), y();
1683
+ re(async () => {
1684
+ await r(), L.drawLocal = fo, e = L.map(o.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(e), y = L.tileLayer(g.topo100.url, { maxZoom: 19 }).addTo(e), d.value = "topo100", n = new L.FeatureGroup().addTo(e);
1685
+ const z = yo(l.geom);
1686
+ if (z) {
1687
+ const c = [];
1688
+ L.geoJSON(z).eachLayer((u) => c.push(u)), c.length && n.addLayer(c[0]), n.toGeoJSON(), f();
1729
1689
  }
1730
1690
  });
1731
- function y(F = 30) {
1732
- const p = s.getLayers();
1733
- if (!p.length) return;
1734
- const H = L.featureGroup(p).getBounds();
1735
- H && H.isValid() && t.fitBounds(H, { padding: [F, F] });
1691
+ function f(z = 30) {
1692
+ const c = n.getLayers();
1693
+ if (!c.length) return;
1694
+ const T = L.featureGroup(c).getBounds();
1695
+ T && T.isValid() && e.fitBounds(T, { padding: [z, z] });
1736
1696
  }
1737
- function h(F) {
1738
- u && u.removeFrom(t);
1739
- const p = c[F];
1740
- u = L.tileLayer(p.url, p.options || {}).addTo(t), n.value = F;
1697
+ function m(z) {
1698
+ y && y.removeFrom(e);
1699
+ const c = g[z];
1700
+ y = L.tileLayer(c.url, c.options || {}).addTo(e), d.value = z;
1741
1701
  }
1742
- function M() {
1743
- h(n.value);
1702
+ function C() {
1703
+ m(d.value);
1744
1704
  }
1745
- function P() {
1746
- s && (v.value ? s.addTo(t) : s.removeFrom(t));
1705
+ function O() {
1706
+ n && (v.value ? n.addTo(e) : n.removeFrom(e));
1747
1707
  }
1748
- return (F, p) => (o(), a("div", $o, [
1749
- e("div", {
1708
+ return (z, c) => (s(), i("div", vo, [
1709
+ t("div", {
1750
1710
  ref_key: "mapContainer",
1751
- ref: i,
1711
+ ref: o,
1752
1712
  class: "w-full h-full min-h-[300px]"
1753
1713
  }, null, 512),
1754
- g.value ? _("", !0) : (o(), a("div", {
1714
+ p.value ? b("", !0) : (s(), i("div", {
1755
1715
  key: 0,
1756
- onClick: p[0] || (p[0] = (f) => g.value = !0),
1716
+ onClick: c[0] || (c[0] = (u) => p.value = !0),
1757
1717
  class: "z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"
1758
1718
  }, " Шари ")),
1759
- g.value ? (o(), a("div", Co, [
1760
- e("div", Mo, [
1761
- p[7] || (p[7] = e("div", null, "Шари", -1)),
1762
- (o(), a("svg", {
1763
- onClick: p[1] || (p[1] = (f) => g.value = !1),
1719
+ p.value ? (s(), i("div", bo, [
1720
+ t("div", xo, [
1721
+ c[7] || (c[7] = t("div", null, "Шари", -1)),
1722
+ (s(), i("svg", {
1723
+ onClick: c[1] || (c[1] = (u) => p.value = !1),
1764
1724
  xmlns: "http://www.w3.org/2000/svg",
1765
1725
  viewBox: "0 0 24 24",
1766
1726
  fill: "none",
@@ -1769,77 +1729,80 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1769
1729
  "stroke-linecap": "round",
1770
1730
  "stroke-linejoin": "round",
1771
1731
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"
1772
- }, p[6] || (p[6] = [
1773
- e("path", {
1732
+ }, [...c[6] || (c[6] = [
1733
+ t("path", {
1774
1734
  stroke: "none",
1775
1735
  d: "M0 0h24v24H0z",
1776
1736
  fill: "none"
1777
1737
  }, null, -1),
1778
- e("path", { d: "M18 6l-12 12" }, null, -1),
1779
- e("path", { d: "M6 6l12 12" }, null, -1)
1780
- ])))
1738
+ t("path", { d: "M18 6l-12 12" }, null, -1),
1739
+ t("path", { d: "M6 6l12 12" }, null, -1)
1740
+ ])]))
1781
1741
  ]),
1782
- e("div", Lo, [
1783
- e("div", null, [
1784
- e("label", Do, [
1785
- R(e("input", {
1742
+ t("div", ko, [
1743
+ t("div", null, [
1744
+ t("label", _o, [
1745
+ R(t("input", {
1786
1746
  type: "radio",
1787
1747
  name: "base-layer",
1788
1748
  value: "topo100",
1789
- "onUpdate:modelValue": p[2] || (p[2] = (f) => n.value = f),
1790
- onChange: M
1749
+ "onUpdate:modelValue": c[2] || (c[2] = (u) => d.value = u),
1750
+ onChange: C
1791
1751
  }, null, 544), [
1792
- [ee, n.value]
1752
+ [Y, d.value]
1793
1753
  ]),
1794
- p[8] || (p[8] = e("span", { class: "ml-2" }, "Карта України", -1))
1754
+ c[8] || (c[8] = t("span", { class: "ml-2" }, "Карта України", -1))
1795
1755
  ])
1796
1756
  ]),
1797
- e("div", null, [
1798
- e("label", To, [
1799
- R(e("input", {
1757
+ t("div", null, [
1758
+ t("label", wo, [
1759
+ R(t("input", {
1800
1760
  type: "radio",
1801
1761
  name: "base-layer",
1802
1762
  value: "orto10",
1803
- "onUpdate:modelValue": p[3] || (p[3] = (f) => n.value = f),
1804
- onChange: M
1763
+ "onUpdate:modelValue": c[3] || (c[3] = (u) => d.value = u),
1764
+ onChange: C
1805
1765
  }, null, 544), [
1806
- [ee, n.value]
1766
+ [Y, d.value]
1807
1767
  ]),
1808
- p[9] || (p[9] = e("span", { class: "ml-2" }, "Ortophoto 1:10К", -1))
1768
+ c[9] || (c[9] = t("span", { class: "ml-2" }, "Ortophoto 1:10К", -1))
1809
1769
  ])
1810
1770
  ]),
1811
- e("div", null, [
1812
- e("label", Io, [
1813
- R(e("input", {
1771
+ t("div", null, [
1772
+ t("label", $o, [
1773
+ R(t("input", {
1814
1774
  type: "radio",
1815
1775
  name: "base-layer",
1816
1776
  value: "osmb",
1817
- "onUpdate:modelValue": p[4] || (p[4] = (f) => n.value = f),
1818
- onChange: M
1777
+ "onUpdate:modelValue": c[4] || (c[4] = (u) => d.value = u),
1778
+ onChange: C
1819
1779
  }, null, 544), [
1820
- [ee, n.value]
1780
+ [Y, d.value]
1821
1781
  ]),
1822
- p[10] || (p[10] = e("span", { class: "ml-2" }, "Open Street Map", -1))
1782
+ c[10] || (c[10] = t("span", { class: "ml-2" }, "Open Street Map", -1))
1823
1783
  ])
1824
1784
  ])
1825
1785
  ]),
1826
- e("div", jo, [
1827
- e("label", zo, [
1828
- R(e("input", {
1786
+ t("div", Co, [
1787
+ t("label", Mo, [
1788
+ R(t("input", {
1829
1789
  type: "checkbox",
1830
- "onUpdate:modelValue": p[5] || (p[5] = (f) => v.value = f),
1831
- onChange: P
1790
+ "onUpdate:modelValue": c[5] || (c[5] = (u) => v.value = u),
1791
+ onChange: O
1832
1792
  }, null, 544), [
1833
- [je, v.value]
1793
+ [Te, v.value]
1834
1794
  ]),
1835
- p[11] || (p[11] = e("span", { class: "ml-2" }, " Показати геометрію ", -1))
1795
+ c[11] || (c[11] = t("span", { class: "ml-2" }, " Показати геометрію ", -1))
1836
1796
  ])
1837
1797
  ])
1838
- ])) : _("", !0)
1798
+ ])) : b("", !0)
1839
1799
  ]));
1840
1800
  }
1841
- }), Vo = /* @__PURE__ */ j({
1842
- __name: "table",
1801
+ }), Lo = { class: "flex justify-between items-center mb-[15px]" }, To = { class: "font-semibold text-[16px]" }, Do = { class: "overflow-x-auto" }, Io = { 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" }, jo = { class: "text-left font-medium text-gray-700" }, Vo = { class: "py-2 min-w-[200px]" }, Ao = {
1802
+ key: 0,
1803
+ class: "py-2 min-w-[200px]"
1804
+ }, zo = { class: "divide-y divide-gray-200" }, Ho = { class: "bg-white odd:bg-gray-50" }, Eo = { class: "py-2 pr-5" }, Fo = ["href"], So = { class: "py-2 pr-5 gap-2 inline-flex" }, No = ["onClick"], Oo = ["onClick"], Bo = /* @__PURE__ */ j({
1805
+ __name: "TableWidget",
1843
1806
  props: {
1844
1807
  name: {},
1845
1808
  label: {},
@@ -1854,28 +1817,133 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1854
1817
  count: {},
1855
1818
  items: {}
1856
1819
  },
1857
- setup(r) {
1858
- const l = w([]), i = w([]), t = r;
1859
- return Q(async () => {
1860
- const s = await fetch("/api/data/" + t.token).then((c) => c.json());
1861
- l.value = s.rows, i.value = s.columns;
1862
- }), (s, c) => b(t) + " " + b(i.value) + " " + b(l.value);
1820
+ setup(a) {
1821
+ const l = De(), o = $([]), e = $([]), n = a, g = $([]), d = $(""), y = $("");
1822
+ async function v() {
1823
+ const c = await fetch("/api/data/" + n.token).then((u) => u.json());
1824
+ o.value = c.rows, e.value = c.columns, g.value = c.actions, d.value = c.form, y.value = c.addToken;
1825
+ }
1826
+ const { $notify: p = console.log, $confirm: r, $form: f } = l?.appContext?.config?.globalProperties || {};
1827
+ async function m(c) {
1828
+ await f({ token: c.token }), v();
1829
+ }
1830
+ function C() {
1831
+ f({ token: y.value });
1832
+ }
1833
+ function O(c) {
1834
+ r({
1835
+ title: "Підтвердіть дію",
1836
+ type: "error",
1837
+ message: "Ви впевненні що бажаєте видалити даний рядок?",
1838
+ onConfirm: async () => {
1839
+ const u = await fetch(`/api/table/${c.token}`, { method: "DELETE" });
1840
+ if (!u.ok) {
1841
+ const { error: T, code: k } = await u.json();
1842
+ p({ title: "Помилка", type: "warning", message: T });
1843
+ return;
1844
+ }
1845
+ p({ title: "Видаленно", message: "Успішно видалено" }), await v();
1846
+ }
1847
+ });
1848
+ }
1849
+ re(async () => {
1850
+ await v();
1851
+ });
1852
+ function z(c, u) {
1853
+ return u.format?.toLowerCase() === "text" ? c[u.name] : c[u.name + "_data"] ?? c[u.name + "_text"] ?? "-";
1854
+ }
1855
+ return (c, u) => (s(), i("div", null, [
1856
+ t("div", Lo, [
1857
+ t("div", To, x(c.title), 1),
1858
+ g.value.includes("add") && y.value ? (s(), i("button", {
1859
+ key: 0,
1860
+ onClick: C,
1861
+ class: "px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-blue-100 text-blue-500 hover:bg-blue-500 focus:ring-blue-500"
1862
+ }, "Додати")) : b("", !0)
1863
+ ]),
1864
+ t("div", Do, [
1865
+ t("table", Io, [
1866
+ t("thead", jo, [
1867
+ t("tr", null, [
1868
+ (s(!0), i(I, null, E(e.value, (T) => (s(), i("th", Vo, x(T.ua), 1))), 256)),
1869
+ g.value.includes("edit") ? (s(), i("th", Ao, " Дії ")) : b("", !0)
1870
+ ])
1871
+ ]),
1872
+ t("tbody", zo, [
1873
+ (s(!0), i(I, null, E(o.value, (T) => (s(), i("tr", Ho, [
1874
+ (s(!0), i(I, null, E(e.value, (k) => (s(), i("td", Eo, [
1875
+ k.link ? (s(), i("a", {
1876
+ key: 0,
1877
+ href: k.link.replace("{{id}}", T.id),
1878
+ 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"
1879
+ }, x(z(T, k)), 9, Fo)) : (s(), i(I, { key: 1 }, [
1880
+ F(x(z(T, k)), 1)
1881
+ ], 64))
1882
+ ]))), 256)),
1883
+ t("td", So, [
1884
+ T.token ? (s(), i("button", {
1885
+ key: 0,
1886
+ onClick: (k) => m(T),
1887
+ class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
1888
+ }, [...u[0] || (u[0] = [
1889
+ t("svg", {
1890
+ xmlns: "http://www.w3.org/2000/svg",
1891
+ width: "12px",
1892
+ height: "24",
1893
+ viewBox: "0 0 24 24",
1894
+ fill: "none",
1895
+ stroke: "currentColor",
1896
+ "stroke-width": "2",
1897
+ "stroke-linecap": "round",
1898
+ "stroke-linejoin": "round"
1899
+ }, [
1900
+ t("path", {
1901
+ d: "M20,16v4a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4H8",
1902
+ fill: "none",
1903
+ stroke: "#000000",
1904
+ "stroke-linecap": "round",
1905
+ "stroke-linejoin": "round",
1906
+ "stroke-width": "2"
1907
+ }),
1908
+ t("polygon", {
1909
+ fill: "none",
1910
+ points: "12.5 15.8 22 6.2 17.8 2 8.3 11.5 8 16 12.5 15.8",
1911
+ stroke: "#000000",
1912
+ "stroke-linecap": "round",
1913
+ "stroke-linejoin": "round",
1914
+ "stroke-width": "2"
1915
+ })
1916
+ ], -1)
1917
+ ])], 8, No)) : b("", !0),
1918
+ T.token ? (s(), i("button", {
1919
+ key: 1,
1920
+ onClick: (k) => O(T),
1921
+ class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
1922
+ }, [...u[1] || (u[1] = [
1923
+ Ie('<svg class="flex-shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>', 1)
1924
+ ])], 8, Oo)) : b("", !0)
1925
+ ])
1926
+ ]))), 256))
1927
+ ])
1928
+ ])
1929
+ ])
1930
+ ]));
1863
1931
  }
1864
1932
  }), Me = {
1865
- "vs-widget-map": ae,
1866
- "vs-widget-comments": oe,
1867
- "vs-widget-history": ne,
1868
- "vs-widget-gallery": le,
1869
- "vs-widget-file": ie,
1933
+ "vs-widget-map": ie,
1934
+ "vs-widget-comments": se,
1935
+ "vs-widget-history": oe,
1936
+ "vs-widget-gallery": ne,
1937
+ "vs-widget-file": $e,
1870
1938
  "vs-widget-list": Ce,
1871
- "vs-widget-table": Vo
1872
- }, Fo = {
1939
+ "vs-widget-table": Bo
1940
+ }, Po = {
1873
1941
  key: 0,
1874
1942
  class: "mb-4 pb-2 border-b border-gray-200"
1875
- }, Ho = { class: "text-lg font-semibold text-gray-900" }, Ao = ["innerHTML"], So = {
1943
+ }, Ro = { class: "text-lg font-semibold text-gray-900" }, Uo = ["innerHTML"], Wo = {
1876
1944
  key: 0,
1877
1945
  class: "mb-4 pb-2 border-b border-gray-200"
1878
- }, Eo = { class: "text-lg font-semibold text-gray-900" }, Oo = ["innerHTML"], Le = /* @__PURE__ */ j({
1946
+ }, qo = { class: "text-lg font-semibold text-gray-900" }, Go = ["innerHTML"], Le = /* @__PURE__ */ j({
1879
1947
  __name: "CardItem",
1880
1948
  props: {
1881
1949
  items: {},
@@ -1892,57 +1960,57 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1892
1960
  className: {},
1893
1961
  style: {}
1894
1962
  },
1895
- setup(r) {
1896
- const l = r, i = O(() => l.col ? {
1963
+ setup(a) {
1964
+ const l = a, o = N(() => l.col ? {
1897
1965
  [`lg:col-span-${l.col}`]: !0
1898
1966
  } : {});
1899
- function t(c) {
1900
- return Me[c] || c;
1967
+ function e(g) {
1968
+ return Me[g] || g;
1901
1969
  }
1902
- const s = O(() => {
1903
- const c = {};
1904
- return c.col && (c.col = c.col), c;
1970
+ const n = N(() => {
1971
+ const g = {};
1972
+ return g.col && (g.col = g.col), g;
1905
1973
  });
1906
- return (c, n) => (o(), a("div", {
1907
- class: D(["w-full bg-gray-50 rounded-lg p-4 col-span-12", i.value])
1974
+ return (g, d) => (s(), i("div", {
1975
+ class: D(["w-full bg-gray-50 rounded-lg p-4 col-span-12", o.value])
1908
1976
  }, [
1909
- c.title ? (o(), a("div", Fo, [
1910
- e("h3", Ho, b(c.title), 1)
1911
- ])) : _("", !0),
1912
- c.html ? (o(), a("div", {
1977
+ g.title ? (s(), i("div", Po, [
1978
+ t("h3", Ro, x(g.title), 1)
1979
+ ])) : b("", !0),
1980
+ g.html ? (s(), i("div", {
1913
1981
  key: 1,
1914
- innerHTML: c.html,
1982
+ innerHTML: g.html,
1915
1983
  class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1916
- }, null, 8, Ao)) : c.type?.includes("tabs") ? (o(), I(re, {
1984
+ }, null, 8, Uo)) : g.type?.includes("tabs") ? (s(), A(le, {
1917
1985
  key: 2,
1918
1986
  view: "tab",
1919
- panels: c.items,
1920
- data: c.data
1921
- }, null, 8, ["panels", "data"])) : (o(!0), a(V, { key: 3 }, A(c.items, (u) => (o(), a(V, null, [
1922
- u.title || u.label ? (o(), a("div", So, [
1923
- e("h3", Eo, b(u.title || u.label), 1)
1924
- ])) : _("", !0),
1925
- u.html ? (o(), a("div", {
1987
+ panels: g.items,
1988
+ data: g.data
1989
+ }, null, 8, ["panels", "data"])) : (s(!0), i(I, { key: 3 }, E(g.items, (y) => (s(), i(I, null, [
1990
+ y.title || y.label ? (s(), i("div", Wo, [
1991
+ t("h3", qo, x(y.title || y.label), 1)
1992
+ ])) : b("", !0),
1993
+ y.html ? (s(), i("div", {
1926
1994
  key: 1,
1927
- innerHTML: u.html,
1995
+ innerHTML: y.html,
1928
1996
  class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
1929
- }, null, 8, Oo)) : u.component ? (o(), I(B(t(u.component)), Z({
1997
+ }, null, 8, Go)) : y.component ? (s(), A(B(e(y.component)), K({
1930
1998
  key: 2,
1931
1999
  ref_for: !0
1932
- }, { ...s.value, ...c.data }, { class: "w-full" }), null, 16)) : G(c.$slots, "default", { key: 3 })
2000
+ }, { ...n.value, ...g.data }, { class: "w-full" }), null, 16)) : q(g.$slots, "default", { key: 3 })
1933
2001
  ], 64))), 256))
1934
2002
  ], 2));
1935
2003
  }
1936
- }), Bo = { class: "md:flex gap-[20px]" }, No = {
2004
+ }), Ko = { class: "md:flex gap-[20px]" }, Zo = {
1937
2005
  key: 0,
1938
2006
  class: "col-span-4"
1939
- }, Ro = ["innerHTML"], Uo = {
2007
+ }, Jo = ["innerHTML"], Xo = {
1940
2008
  key: 1,
1941
2009
  class: "overflow-hidden w-full"
1942
- }, Wo = { class: "flex border-b border-gray-200 bg-gray-50" }, Po = ["onClick"], Go = { class: "p-1" }, qo = ["innerHTML"], Ko = {
2010
+ }, Qo = { class: "flex border-b border-gray-200 bg-gray-50" }, Yo = ["onClick"], en = { class: "p-1" }, tn = ["innerHTML"], sn = {
1943
2011
  key: 2,
1944
2012
  class: "p-1 w-full"
1945
- }, Zo = { class: "grid grid-cols-12 gap-4" }, re = /* @__PURE__ */ j({
2013
+ }, on = { class: "grid grid-cols-12 gap-4" }, le = /* @__PURE__ */ j({
1946
2014
  __name: "Card",
1947
2015
  props: {
1948
2016
  panels: { default: () => [] },
@@ -1955,106 +2023,106 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
1955
2023
  className: {},
1956
2024
  style: {}
1957
2025
  },
1958
- setup(r) {
1959
- const l = r, i = w(0), t = w([]);
1960
- function s(d) {
1961
- return Me[d] || d;
2026
+ setup(a) {
2027
+ const l = a, o = $(0), e = $([]);
2028
+ function n(r) {
2029
+ return Me[r] || r;
1962
2030
  }
1963
- function c(d) {
1964
- return t.value = d.filter((y) => y.type === "pin"), d.filter((y) => y.type !== "pin");
2031
+ function g(r) {
2032
+ return e.value = r.filter((f) => f.type === "pin"), r.filter((f) => f.type !== "pin");
1965
2033
  }
1966
- const n = O(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? c(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data.filter((y) => y.type === "tabs")[0]?.items || [] : []), u = O(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? c(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data : []), v = O(() => ({
2034
+ const d = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data.filter((f) => f.type === "tabs")[0]?.items || [] : []), y = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data : []), v = N(() => ({
1967
2035
  [`view-${l.view}`]: !0
1968
- })), g = (d) => {
1969
- const y = {};
1970
- return d.count && (y.count = d.count), d.col && (y.col = d.col), d.html && (y.html = d.html), d.title && (y.title = d.title), d.type && (y.type = d.type), d.token && (y.token = d.token), l.data && (y.data = l.data), y;
2036
+ })), p = (r) => {
2037
+ const f = {};
2038
+ return r.count && (f.count = r.count), r.col && (f.col = r.col), r.html && (f.html = r.html), r.title && (f.title = r.title), r.type && (f.type = r.type), r.token && (f.token = r.token), l.data && (f.data = l.data), f;
1971
2039
  };
1972
- return (d, y) => (o(), a("div", {
1973
- class: D(d.classWrapper || v.value)
2040
+ return (r, f) => (s(), i("div", {
2041
+ class: D(r.classWrapper || v.value)
1974
2042
  }, [
1975
- e("div", Bo, [
1976
- t.value.length !== 0 ? (o(), a("div", No, [
1977
- (o(!0), a(V, null, A(t.value[0].items, (h, M) => (o(), a("div", {
1978
- key: h.name || M,
2043
+ t("div", Ko, [
2044
+ e.value.length !== 0 ? (s(), i("div", Zo, [
2045
+ (s(!0), i(I, null, E(e.value[0].items, (m, C) => (s(), i("div", {
2046
+ key: m.name || C,
1979
2047
  class: "w-full bg-gray-50 rounded-lg p-4 col-span-12 w-full m-1 mb-3"
1980
2048
  }, [
1981
- h.html ? (o(), a("div", {
2049
+ m.html ? (s(), i("div", {
1982
2050
  key: 0,
1983
- innerHTML: h.html,
2051
+ innerHTML: m.html,
1984
2052
  class: "text-gray-900 leading-relaxed"
1985
- }, null, 8, Ro)) : h.component ? (o(), I(B(s(h.component)), Z({
2053
+ }, null, 8, Jo)) : m.component ? (s(), A(B(n(m.component)), K({
1986
2054
  key: 1,
1987
2055
  ref_for: !0
1988
- }, h.component === "Card" ? h : g(h), {
1989
- id: d.data.id,
2056
+ }, m.component === "Card" ? m : p(m), {
2057
+ id: r.data.id,
1990
2058
  class: "w-full h-full"
1991
- }), null, 16, ["id"])) : _("", !0)
2059
+ }), null, 16, ["id"])) : b("", !0)
1992
2060
  ]))), 128))
1993
- ])) : _("", !0),
1994
- d.view === "tab" ? (o(), a("div", Uo, [
1995
- e("div", Wo, [
1996
- (o(!0), a(V, null, A(n.value, (h, M) => (o(), a("button", {
1997
- key: h.name || M,
1998
- onClick: (P) => i.value = M,
2061
+ ])) : b("", !0),
2062
+ r.view === "tab" ? (s(), i("div", Xo, [
2063
+ t("div", Qo, [
2064
+ (s(!0), i(I, null, E(d.value, (m, C) => (s(), i("button", {
2065
+ key: m.name || C,
2066
+ onClick: (O) => o.value = C,
1999
2067
  class: D([
2000
2068
  "px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
2001
- { "text-blue-600 bg-white border-b-2 border-blue-600": i.value === M }
2069
+ { "text-blue-600 bg-white border-b-2 border-blue-600": o.value === C }
2002
2070
  ])
2003
- }, b(h.title || h.label || h.name || `Tab ${M + 1}`), 11, Po))), 128))
2071
+ }, x(m.title || m.label || m.name || `Tab ${C + 1}`), 11, Yo))), 128))
2004
2072
  ]),
2005
- e("div", Go, [
2006
- (o(!0), a(V, null, A(n.value, (h, M) => R((o(), a("div", {
2007
- key: h.name || M,
2073
+ t("div", en, [
2074
+ (s(!0), i(I, null, E(d.value, (m, C) => R((s(), i("div", {
2075
+ key: m.name || C,
2008
2076
  class: D([
2009
- d.classPanel || "w-full border-gray-100 py-2",
2010
- `col-span-${h.col || 12}`
2077
+ r.classPanel || "w-full border-gray-100 py-2",
2078
+ `col-span-${m.col || 12}`
2011
2079
  ])
2012
2080
  }, [
2013
- h.html ? (o(), a("div", {
2081
+ m.html ? (s(), i("div", {
2014
2082
  key: 0,
2015
- innerHTML: h.html,
2083
+ innerHTML: m.html,
2016
2084
  class: "text-gray-900 leading-relaxed"
2017
- }, null, 8, qo)) : d.$slots[`tab-${M}`] ? G(d.$slots, `tab-${M}`, {
2085
+ }, null, 8, tn)) : r.$slots[`tab-${C}`] ? q(r.$slots, `tab-${C}`, {
2018
2086
  key: 1,
2019
- item: h,
2020
- data: d.data
2021
- }) : h.component || h.name ? (o(), I(B(s(h.component || h.name)), Z({
2087
+ item: m,
2088
+ data: r.data
2089
+ }) : m.component || m.name ? (s(), A(B(n(m.component || m.name)), K({
2022
2090
  key: 2,
2023
2091
  ref_for: !0
2024
- }, h.component === "Card" ? h : g(h), {
2025
- id: d.data.id,
2092
+ }, m.component === "Card" ? m : p(m), {
2093
+ id: r.data.id,
2026
2094
  class: "w-full h-full"
2027
- }), null, 16, ["id"])) : G(d.$slots, h.slot || `tab-${M}`, {
2095
+ }), null, 16, ["id"])) : q(r.$slots, m.slot || `tab-${C}`, {
2028
2096
  key: 3,
2029
- item: h,
2030
- data: d.data
2097
+ item: m,
2098
+ data: r.data
2031
2099
  })
2032
2100
  ], 2)), [
2033
- [ze, i.value === M]
2101
+ [je, o.value === C]
2034
2102
  ])), 128))
2035
2103
  ])
2036
- ])) : (o(), a("div", Ko, [
2037
- e("div", Zo, [
2038
- (o(!0), a(V, null, A(u.value, (h, M) => (o(), a(V, {
2039
- key: h.name || M
2104
+ ])) : (s(), i("div", sn, [
2105
+ t("div", on, [
2106
+ (s(!0), i(I, null, E(y.value, (m, C) => (s(), i(I, {
2107
+ key: m.name || C
2040
2108
  }, [
2041
- d.$slots[`panel-${M}`] ? G(d.$slots, `panel-${M}`, {
2109
+ r.$slots[`panel-${C}`] ? q(r.$slots, `panel-${C}`, {
2042
2110
  key: 0,
2043
- item: h,
2044
- data: d.data
2045
- }) : h.items || h.html ? (o(), I(B(Le), Z({
2111
+ item: m,
2112
+ data: r.data
2113
+ }) : m.items || m.html ? (s(), A(B(Le), K({
2046
2114
  key: 1,
2047
2115
  ref_for: !0
2048
- }, g(h), {
2049
- items: h.items,
2116
+ }, p(m), {
2117
+ items: m.items,
2050
2118
  class: "w-full h-full"
2051
- }), null, 16, ["items"])) : h.component ? (o(), I(B(s(h.component)), Z({
2119
+ }), null, 16, ["items"])) : m.component ? (s(), A(B(n(m.component)), K({
2052
2120
  key: 2,
2053
2121
  ref_for: !0
2054
- }, g(h), { class: "w-full h-full" }), null, 16)) : G(d.$slots, h.slot || `panel-${M}`, {
2122
+ }, p(m), { class: "w-full h-full" }), null, 16)) : q(r.$slots, m.slot || `panel-${C}`, {
2055
2123
  key: 3,
2056
- item: h,
2057
- data: d.data
2124
+ item: m,
2125
+ data: r.data
2058
2126
  })
2059
2127
  ], 64))), 128))
2060
2128
  ])
@@ -2062,19 +2130,78 @@ const $o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, Co = {
2062
2130
  ])
2063
2131
  ], 2));
2064
2132
  }
2065
- });
2066
- re.install = function(r) {
2067
- r.component("vs-widget-file", ie), r.component("vs-widget-comments", oe), r.component("vs-widget-history", ne), r.component("vs-widget-gallery", le), r.component("vs-widget-map", ae), r.component("CommentsWidget", oe), r.component("HistoryWidget", ne), r.component("GalleryWidget", le), r.component("FilesWidget", ie), r.component("MapWidget", ae), r.component("Card", re), r.component("CardItem", Le), r.component("DescriptionListWidget", Ce), r.component("CopyNotification", $e);
2133
+ }), nn = ["onClick"], ln = /* @__PURE__ */ j({
2134
+ __name: "CopyNotification",
2135
+ setup(a, { expose: l }) {
2136
+ const o = $([]);
2137
+ let e = 1;
2138
+ const n = () => {
2139
+ if (o.value.length >= 10) {
2140
+ const y = o.value[0];
2141
+ clearTimeout(y.timer), o.value.shift();
2142
+ }
2143
+ const d = {
2144
+ id: e++,
2145
+ timer: setTimeout(() => {
2146
+ g(d.id);
2147
+ }, 1500)
2148
+ };
2149
+ o.value.push(d);
2150
+ }, g = (d) => {
2151
+ const y = o.value.findIndex((v) => v.id === d);
2152
+ if (y !== -1) {
2153
+ const v = o.value[y];
2154
+ clearTimeout(v.timer), o.value.splice(y, 1);
2155
+ }
2156
+ };
2157
+ return l({
2158
+ addNotification: n
2159
+ }), ye(() => {
2160
+ o.value.forEach((d) => {
2161
+ clearTimeout(d.timer);
2162
+ });
2163
+ }), (d, y) => (s(), A(Ve, { to: "body" }, [
2164
+ M(Ae, {
2165
+ name: "notification",
2166
+ tag: "div",
2167
+ class: "fixed top-4 right-4 z-50 space-y-2"
2168
+ }, {
2169
+ default: ze(() => [
2170
+ (s(!0), i(I, null, E(o.value, (v) => (s(), i("div", {
2171
+ key: v.id,
2172
+ 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"
2173
+ }, [
2174
+ M(w(Be), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
2175
+ y[0] || (y[0] = t("div", { class: "flex-1" }, [
2176
+ t("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
2177
+ t("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
2178
+ ], -1)),
2179
+ t("button", {
2180
+ onClick: (p) => g(v.id),
2181
+ class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
2182
+ }, [
2183
+ M(w(ue), { class: "h-4 w-4" })
2184
+ ], 8, nn)
2185
+ ]))), 128))
2186
+ ]),
2187
+ _: 1
2188
+ })
2189
+ ]));
2190
+ }
2191
+ }), an = /* @__PURE__ */ W(ln, [["__scopeId", "data-v-55903525"]]);
2192
+ le.install = function(a) {
2193
+ a.component("vs-widget-file", he), a.component("vs-widget-comments", se), a.component("vs-widget-history", oe), a.component("vs-widget-gallery", ne), a.component("vs-widget-map", ie), a.component("CommentsWidget", se), a.component("HistoryWidget", oe), a.component("GalleryWidget", ne), a.component("FilesWidget", he), a.component("MapWidget", ie), a.component("Card", le), a.component("CardItem", Le), a.component("DescriptionListWidget", Ce), a.component("CopyNotification", an);
2068
2194
  };
2069
2195
  export {
2070
- re as Card,
2196
+ le as Card,
2071
2197
  Le as CardItem,
2072
- oe as CommentsWidget,
2073
- $e as CopyNotification,
2198
+ se as CommentsWidget,
2199
+ an as CopyNotification,
2074
2200
  Ce as DescriptionListWidget,
2075
- ie as FilesWidget,
2076
- le as GalleryWidget,
2077
- ne as HistoryWidget,
2078
- ae as MapWidget,
2079
- re as default
2201
+ he as FilesWidget,
2202
+ ne as GalleryWidget,
2203
+ oe as HistoryWidget,
2204
+ ie as MapWidget,
2205
+ Bo as TableWidget,
2206
+ le as default
2080
2207
  };