@opengis/form 0.0.22 → 0.0.24

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,15 +1,15 @@
1
- import { defineComponent as A, ref as k, onMounted as ne, onUnmounted as Fe, createElementBlock as u, openBlock as i, normalizeClass as S, createCommentVNode as B, renderSlot as me, createElementVNode as l, toDisplayString as F, normalizeProps as Oe, guardReactiveProps as De, createTextVNode as oe, computed as D, mergeModels as Z, useModel as W, withDirectives as q, unref as H, vModelText as ie, vModelCheckbox as Ye, createVNode as j, createBlock as X, resolveDynamicComponent as we, normalizeStyle as ve, withCtx as Me, withModifiers as se, onBeforeUnmount as dt, watch as re, createStaticVNode as ae, vModelRadio as et, Fragment as K, renderList as Y, mergeProps as Ve, reactive as ct, vShow as Ue, inject as Be, resolveComponent as Ne, Transition as tt, nextTick as Ce, Teleport as pt, provide as He } from "vue";
2
- import { notify as fe, modal as ft, TooltipDirective as qe } from "@opengis/core";
3
- const vt = {
1
+ import { defineComponent as E, ref as x, onMounted as pe, onUnmounted as Ue, createElementBlock as u, openBlock as i, normalizeClass as M, createCommentVNode as z, renderSlot as ke, createElementVNode as l, toDisplayString as F, normalizeProps as Te, guardReactiveProps as Re, createTextVNode as ie, computed as T, mergeModels as W, useModel as Q, withDirectives as X, unref as G, vModelText as fe, vModelCheckbox as Xe, createVNode as I, createBlock as te, resolveDynamicComponent as Ve, normalizeStyle as we, withCtx as Me, withModifiers as ce, onBeforeUnmount as ut, watch as ue, createStaticVNode as re, vModelRadio as Ye, Fragment as ee, renderList as le, mergeProps as je, reactive as dt, vShow as Pe, inject as ze, resolveComponent as Ne, Transition as et, nextTick as Be, Teleport as ct, getCurrentInstance as pt, provide as He } from "vue";
2
+ import { notify as me, modal as ft, VsModal as vt } from "@opengis/core";
3
+ const mt = {
4
4
  key: 0,
5
5
  class: "text-[14px] font-medium text-gray-900 mb-2"
6
- }, mt = { class: "opacity-100" }, ht = {
6
+ }, ht = { class: "opacity-100" }, gt = {
7
7
  key: 0,
8
8
  class: "text-red-500 text-[14px]"
9
- }, gt = {
9
+ }, bt = {
10
10
  key: 1,
11
11
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
12
- }, bt = /* @__PURE__ */ A({
12
+ }, yt = /* @__PURE__ */ E({
13
13
  __name: "vs-layout-default",
14
14
  props: {
15
15
  ua: { default: "" },
@@ -23,34 +23,34 @@ const vt = {
23
23
  label: { default: "" }
24
24
  },
25
25
  setup(o) {
26
- const e = k("uk"), t = (n) => {
27
- n.detail.key === "locale" && (e.value = n.detail.newValue);
26
+ const e = x("uk"), t = (r) => {
27
+ r.detail.key === "locale" && (e.value = r.detail.newValue);
28
28
  };
29
- return ne(() => {
29
+ return pe(() => {
30
30
  e.value = localStorage.locale, window.addEventListener("storage", t);
31
- }), Fe(() => {
31
+ }), Ue(() => {
32
32
  window.removeEventListener("resize", t);
33
- }), (n, s) => (i(), u("div", {
34
- class: S(["w-full relative", { "opacity-60": n.item.disabled }])
33
+ }), (r, s) => (i(), u("div", {
34
+ class: M(["w-full relative", { "opacity-60": r.item.disabled }])
35
35
  }, [
36
- n.ua || n.label ? (i(), u("div", vt, [
37
- l("span", mt, F(n.item[e.value] || n.ua || n.label), 1),
38
- n.item?.rules?.includes("required") ? (i(), u("span", ht, "*")) : B("", !0)
39
- ])) : B("", !0),
40
- me(n.$slots, "default", Oe(De(n.$attrs))),
41
- n.error ? (i(), u("span", gt, F(n.error), 1)) : B("", !0)
36
+ r.ua || r.label ? (i(), u("div", mt, [
37
+ l("span", ht, F(r.item[e.value] || r.ua || r.label), 1),
38
+ r.item?.rules?.includes("required") ? (i(), u("span", gt, "*")) : z("", !0)
39
+ ])) : z("", !0),
40
+ ke(r.$slots, "default", Te(Re(r.$attrs))),
41
+ r.error ? (i(), u("span", bt, F(r.error), 1)) : z("", !0)
42
42
  ], 2));
43
43
  }
44
- }), yt = { class: "w-full relative flex flex-row items-center gap-2" }, xt = {
44
+ }), xt = { class: "w-full relative flex flex-row items-center gap-2" }, wt = {
45
45
  key: 0,
46
46
  class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
47
- }, wt = {
47
+ }, kt = {
48
48
  key: 0,
49
49
  class: "text-red-500 text-[14px]"
50
- }, kt = {
50
+ }, _t = {
51
51
  key: 1,
52
52
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
53
- }, _t = /* @__PURE__ */ A({
53
+ }, $t = /* @__PURE__ */ E({
54
54
  __name: "vs-layout-horizontal",
55
55
  props: {
56
56
  ua: { default: "" },
@@ -64,19 +64,19 @@ const vt = {
64
64
  label: { default: "" }
65
65
  },
66
66
  setup(o) {
67
- return (e, t) => (i(), u("div", yt, [
68
- e.item?.type !== "html" ? (i(), u("span", xt, [
69
- oe(F(e.ua || e.label) + " ", 1),
70
- e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", wt, "*")) : B("", !0)
71
- ])) : B("", !0),
72
- me(e.$slots, "default", Oe(De(e.$attrs))),
73
- e.error ? (i(), u("span", kt, F(e.error), 1)) : B("", !0)
67
+ return (e, t) => (i(), u("div", xt, [
68
+ e.item?.type !== "html" ? (i(), u("span", wt, [
69
+ ie(F(e.ua || e.label) + " ", 1),
70
+ e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", kt, "*")) : z("", !0)
71
+ ])) : z("", !0),
72
+ ke(e.$slots, "default", Te(Re(e.$attrs))),
73
+ e.error ? (i(), u("span", _t, F(e.error), 1)) : z("", !0)
74
74
  ]));
75
75
  }
76
- }), $t = { class: "w-full relative" }, Ct = {
76
+ }), Ct = { class: "w-full relative" }, Vt = {
77
77
  key: 0,
78
78
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
79
- }, Vt = /* @__PURE__ */ A({
79
+ }, Mt = /* @__PURE__ */ E({
80
80
  __name: "vs-layout-inline",
81
81
  props: {
82
82
  ua: { default: "" },
@@ -90,27 +90,27 @@ const vt = {
90
90
  label: { default: "" }
91
91
  },
92
92
  setup(o) {
93
- return (e, t) => (i(), u("div", $t, [
94
- me(e.$slots, "default", Oe(De(e.$attrs))),
95
- e.error ? (i(), u("span", Ct, F(e.error), 1)) : B("", !0)
93
+ return (e, t) => (i(), u("div", Ct, [
94
+ ke(e.$slots, "default", Te(Re(e.$attrs))),
95
+ e.error ? (i(), u("span", Vt, F(e.error), 1)) : z("", !0)
96
96
  ]));
97
97
  }
98
98
  }), Lt = {
99
- default: bt,
100
- horizontal: _t,
101
- inline: Vt
99
+ default: yt,
100
+ horizontal: $t,
101
+ inline: Mt
102
102
  };
103
- function he(o) {
103
+ function _e(o) {
104
104
  return {
105
- inputClass: D(() => {
105
+ inputClass: T(() => {
106
106
  const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
107
107
  return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
108
108
  })
109
109
  };
110
110
  }
111
- const Mt = ["placeholder", "disabled"], Ge = /* @__PURE__ */ A({
111
+ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
112
112
  __name: "vs-input-text",
113
- props: /* @__PURE__ */ Z({
113
+ props: /* @__PURE__ */ W({
114
114
  style: { default: () => ({}) },
115
115
  customClass: { default: "" },
116
116
  disabled: { type: Boolean, default: !1 },
@@ -124,23 +124,23 @@ const Mt = ["placeholder", "disabled"], Ge = /* @__PURE__ */ A({
124
124
  }),
125
125
  emits: ["update:modelValue"],
126
126
  setup(o) {
127
- const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue");
128
- return (s, a) => q((i(), u("input", {
127
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
128
+ return (s, n) => X((i(), u("input", {
129
129
  type: "text",
130
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
130
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
131
131
  placeholder: s.placeholder,
132
132
  disabled: s.disabled,
133
- class: S(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [H(t), { "!border-red-600": s.error }]]),
133
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
134
134
  style: {
135
135
  border: "1px solid #CFD9E0"
136
136
  }
137
- }, null, 10, Mt)), [
138
- [ie, n.value]
137
+ }, null, 10, St)), [
138
+ [fe, r.value]
139
139
  ]);
140
140
  }
141
- }), St = ["placeholder"], Bt = /* @__PURE__ */ A({
141
+ }), Bt = ["placeholder"], jt = /* @__PURE__ */ E({
142
142
  __name: "vs-input-number",
143
- props: /* @__PURE__ */ Z({
143
+ props: /* @__PURE__ */ W({
144
144
  style: { default: () => ({}) },
145
145
  customClass: {},
146
146
  disabled: { type: Boolean },
@@ -154,26 +154,26 @@ const Mt = ["placeholder", "disabled"], Ge = /* @__PURE__ */ A({
154
154
  }),
155
155
  emits: ["update:modelValue"],
156
156
  setup(o) {
157
- const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue");
158
- return (s, a) => q((i(), u("input", {
157
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
158
+ return (s, n) => X((i(), u("input", {
159
159
  type: "number",
160
160
  step: "any",
161
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
161
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
162
162
  placeholder: s.placeholder,
163
- class: S(["py-1.5 px-3 block w-full", [H(t)]]),
163
+ class: M(["py-1.5 px-3 block w-full bg-white", [G(t)]]),
164
164
  style: {
165
165
  border: "1px solid #CFD9E0"
166
166
  }
167
- }, null, 10, St)), [
168
- [ie, n.value]
167
+ }, null, 10, Bt)), [
168
+ [fe, r.value]
169
169
  ]);
170
170
  }
171
- }), R = (o, e) => {
171
+ }), P = (o, e) => {
172
172
  const t = o.__vccOpts || o;
173
- for (const [n, s] of e)
174
- t[n] = s;
173
+ for (const [r, s] of e)
174
+ t[r] = s;
175
175
  return t;
176
- }, jt = {}, It = {
176
+ }, It = {}, zt = {
177
177
  xmlns: "http://www.w3.org/2000/svg",
178
178
  viewBox: "0 0 24 24",
179
179
  fill: "none",
@@ -183,8 +183,8 @@ const Mt = ["placeholder", "disabled"], Ge = /* @__PURE__ */ A({
183
183
  "stroke-linejoin": "round",
184
184
  class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
185
185
  };
186
- function zt(o, e) {
187
- return i(), u("svg", It, e[0] || (e[0] = [
186
+ function At(o, e) {
187
+ return i(), u("svg", zt, e[0] || (e[0] = [
188
188
  l("path", {
189
189
  stroke: "none",
190
190
  d: "M0 0h24v24H0z",
@@ -193,7 +193,7 @@ function zt(o, e) {
193
193
  l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
194
194
  ]));
195
195
  }
196
- const At = /* @__PURE__ */ R(jt, [["render", zt]]), Et = { class: "flex items-center gap-[4px]" }, Ft = ["value", "id", "disabled"], Ot = ["for"], Dt = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Ut = /* @__PURE__ */ A({
196
+ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-center gap-[4px]" }, Ft = ["value", "id", "disabled"], Dt = ["for"], Ut = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Tt = /* @__PURE__ */ E({
197
197
  __name: "vs-checkbox-default",
198
198
  props: {
199
199
  value: { default: "" },
@@ -206,45 +206,45 @@ const At = /* @__PURE__ */ R(jt, [["render", zt]]), Et = { class: "flex items-ce
206
206
  },
207
207
  emits: ["update:modelValue"],
208
208
  setup(o, { emit: e }) {
209
- const t = e, n = o, s = D({
210
- get: () => n.modelValue,
211
- set: (a) => t("update:modelValue", a)
209
+ const t = e, r = o, s = T({
210
+ get: () => r.modelValue,
211
+ set: (n) => t("update:modelValue", n)
212
212
  });
213
- return (a, r) => (i(), u("div", Et, [
214
- q(l("input", {
213
+ return (n, a) => (i(), u("div", Et, [
214
+ X(l("input", {
215
215
  type: "checkbox",
216
- value: a.value,
217
- "onUpdate:modelValue": r[0] || (r[0] = (d) => s.value = d),
218
- class: S(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": a.disabled }]),
219
- id: a.id,
220
- disabled: a.disabled
216
+ value: n.value,
217
+ "onUpdate:modelValue": a[0] || (a[0] = (d) => s.value = d),
218
+ class: M(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": n.disabled }]),
219
+ id: n.id,
220
+ disabled: n.disabled
221
221
  }, null, 10, Ft), [
222
- [Ye, s.value]
222
+ [Xe, s.value]
223
223
  ]),
224
224
  l("label", {
225
- for: a.id,
226
- class: S(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": a.disabled }])
225
+ for: n.id,
226
+ class: M(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": n.disabled }])
227
227
  }, [
228
228
  l("div", {
229
- class: S(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", a.error ? "border-red-600" : ""]])
229
+ class: M(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", n.error ? "border-red-600" : ""]])
230
230
  }, [
231
- j(At, {
231
+ I(Ot, {
232
232
  height: "12",
233
233
  width: "12"
234
234
  })
235
235
  ], 2),
236
- l("span", Dt, [
237
- me(a.$slots, "default", {}, () => [
238
- oe(F(a.label), 1)
236
+ l("span", Ut, [
237
+ ke(n.$slots, "default", {}, () => [
238
+ ie(F(n.label), 1)
239
239
  ])
240
240
  ])
241
- ], 10, Ot)
241
+ ], 10, Dt)
242
242
  ]));
243
243
  }
244
- }), Tt = ["name", "value", "disabled"], Rt = { class: "flex items-center gap-[6px] text-[14px]" }, Pt = {
244
+ }), Rt = ["name", "value", "disabled"], Pt = { class: "flex items-center gap-[6px] text-[14px]" }, Nt = {
245
245
  key: 0,
246
246
  class: "text-[16px]"
247
- }, Nt = ["src"], Ht = /* @__PURE__ */ A({
247
+ }, Ht = ["src"], qt = /* @__PURE__ */ E({
248
248
  __name: "vs-checkbox-buttons",
249
249
  props: {
250
250
  value: { type: [String, Number, Boolean], default: "" },
@@ -258,46 +258,46 @@ const At = /* @__PURE__ */ R(jt, [["render", zt]]), Et = { class: "flex items-ce
258
258
  },
259
259
  emits: ["update:modelValue"],
260
260
  setup(o, { emit: e }) {
261
- const t = o, n = e, s = D({
261
+ const t = o, r = e, s = T({
262
262
  get: () => t.modelValue,
263
263
  set: (d) => {
264
- n("update:modelValue", d);
264
+ r("update:modelValue", d);
265
265
  }
266
- }), a = D(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), r = D(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
266
+ }), n = T(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), a = T(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
267
267
  return (d, p) => (i(), u("label", {
268
- class: S(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, a.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
268
+ class: M(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [a.value, n.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
269
269
  }, [
270
- q(l("input", {
270
+ X(l("input", {
271
271
  type: "checkbox",
272
272
  class: "hidden",
273
273
  name: d.id,
274
274
  value: d.value,
275
275
  "onUpdate:modelValue": p[0] || (p[0] = (f) => s.value = f),
276
276
  disabled: d.disabled
277
- }, null, 8, Tt), [
278
- [Ye, s.value]
277
+ }, null, 8, Rt), [
278
+ [Xe, s.value]
279
279
  ]),
280
- l("span", Rt, [
281
- d.icon || d.imgUrl ? (i(), u("span", Pt, [
280
+ l("span", Pt, [
281
+ d.icon || d.imgUrl ? (i(), u("span", Nt, [
282
282
  d.icon ? (i(), u("i", {
283
283
  key: 0,
284
- class: S(d.icon)
285
- }, null, 2)) : B("", !0),
284
+ class: M(d.icon)
285
+ }, null, 2)) : z("", !0),
286
286
  d.imgUrl ? (i(), u("img", {
287
287
  key: 1,
288
288
  src: d.imgUrl,
289
289
  width: "16",
290
290
  height: "16",
291
291
  alt: "icon"
292
- }, null, 8, Nt)) : B("", !0)
293
- ])) : B("", !0),
294
- me(d.$slots, "default", {}, () => [
295
- oe(F(d.label), 1)
292
+ }, null, 8, Ht)) : z("", !0)
293
+ ])) : z("", !0),
294
+ ke(d.$slots, "default", {}, () => [
295
+ ie(F(d.label), 1)
296
296
  ])
297
297
  ])
298
298
  ], 2));
299
299
  }
300
- }), qt = { class: "flex items-center" }, lt = /* @__PURE__ */ A({
300
+ }), Gt = { class: "flex items-center" }, tt = /* @__PURE__ */ E({
301
301
  __name: "vs-input-checkbox-item",
302
302
  props: {
303
303
  value: { default: "" },
@@ -314,38 +314,38 @@ const At = /* @__PURE__ */ R(jt, [["render", zt]]), Et = { class: "flex items-ce
314
314
  },
315
315
  emits: ["update:modelValue"],
316
316
  setup(o, { emit: e }) {
317
- const t = o, n = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, a = D({
317
+ const t = o, r = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, n = T({
318
318
  get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
319
319
  set: (d) => {
320
320
  if (Array.isArray(t.modelValue)) {
321
321
  let p = [...t.modelValue];
322
- d ? p.includes(t.value) || p.push(t.value) : p = p.filter((f) => f !== t.value), n("update:modelValue", p);
322
+ d ? p.includes(t.value) || p.push(t.value) : p = p.filter((f) => f !== t.value), r("update:modelValue", p);
323
323
  } else
324
- n("update:modelValue", d);
324
+ r("update:modelValue", d);
325
325
  }
326
- }), r = k(`vs-checkbox-${t.view || "default"}`);
327
- return (d, p) => (i(), u("div", qt, [
328
- (i(), X(we(r.value === "vs-checkbox-buttons" ? H(Ht) : H(Ut)), {
326
+ }), a = x(`vs-checkbox-${t.view || "default"}`);
327
+ return (d, p) => (i(), u("div", Gt, [
328
+ (i(), te(Ve(a.value === "vs-checkbox-buttons" ? G(qt) : G(Tt)), {
329
329
  value: d.value,
330
330
  label: d.label,
331
331
  info: d.option?.info,
332
332
  disabled: d.disabled,
333
- modelValue: a.value,
334
- "onUpdate:modelValue": p[0] || (p[0] = (f) => a.value = f),
333
+ modelValue: n.value,
334
+ "onUpdate:modelValue": p[0] || (p[0] = (f) => n.value = f),
335
335
  id: s,
336
336
  icon: d.icon,
337
337
  imgUrl: d.imgUrl,
338
- style: ve(d.style),
338
+ style: we(d.style),
339
339
  error: d.error
340
340
  }, {
341
341
  default: Me(() => [
342
- oe(F(d.label), 1)
342
+ ie(F(d.label), 1)
343
343
  ]),
344
344
  _: 1
345
345
  }, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
346
346
  ]));
347
347
  }
348
- }), Gt = {}, Jt = {
348
+ }), Jt = {}, Kt = {
349
349
  xmlns: "http://www.w3.org/2000/svg",
350
350
  viewBox: "0 0 24 24",
351
351
  fill: "none",
@@ -355,8 +355,8 @@ const At = /* @__PURE__ */ R(jt, [["render", zt]]), Et = { class: "flex items-ce
355
355
  "stroke-linejoin": "round",
356
356
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
357
357
  };
358
- function Kt(o, e) {
359
- return i(), u("svg", Jt, e[0] || (e[0] = [
358
+ function Zt(o, e) {
359
+ return i(), u("svg", Kt, e[0] || (e[0] = [
360
360
  l("path", {
361
361
  stroke: "none",
362
362
  d: "M0 0h24v24H0z",
@@ -365,7 +365,7 @@ function Kt(o, e) {
365
365
  l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
366
366
  ]));
367
367
  }
368
- const Zt = /* @__PURE__ */ R(Gt, [["render", Kt]]), Wt = {}, Qt = {
368
+ const Wt = /* @__PURE__ */ P(Jt, [["render", Zt]]), Qt = {}, Xt = {
369
369
  xmlns: "http://www.w3.org/2000/svg",
370
370
  width: "24",
371
371
  height: "24",
@@ -376,8 +376,8 @@ const Zt = /* @__PURE__ */ R(Gt, [["render", Kt]]), Wt = {}, Qt = {
376
376
  "stroke-linecap": "round",
377
377
  "stroke-linejoin": "round"
378
378
  };
379
- function Xt(o, e) {
380
- return i(), u("svg", Qt, e[0] || (e[0] = [
379
+ function Yt(o, e) {
380
+ return i(), u("svg", Xt, e[0] || (e[0] = [
381
381
  l("path", {
382
382
  stroke: "none",
383
383
  d: "M0 0h24v24H0z",
@@ -388,15 +388,15 @@ function Xt(o, e) {
388
388
  l("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
389
389
  ]));
390
390
  }
391
- const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
391
+ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
392
392
  key: 0,
393
393
  class: "flex items-start gap-x-1"
394
- }, tl = {
394
+ }, ll = {
395
395
  key: 0,
396
396
  class: "text-red-500 text-[14px]"
397
- }, ll = ["title"], ol = ["disabled"], ot = /* @__PURE__ */ A({
397
+ }, ol = ["title"], al = ["disabled"], lt = /* @__PURE__ */ E({
398
398
  __name: "vs-input-switcher",
399
- props: /* @__PURE__ */ Z({
399
+ props: /* @__PURE__ */ W({
400
400
  rules: { default: () => [] },
401
401
  view: { default: "checkbox" },
402
402
  label: { default: "" },
@@ -415,38 +415,38 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
415
415
  }),
416
416
  emits: ["update:modelValue"],
417
417
  setup(o) {
418
- const e = o, t = W(o, "modelValue");
419
- return (n, s) => e.view === "checkbox" ? (i(), u("div", el, [
420
- j(lt, {
418
+ const e = o, t = Q(o, "modelValue");
419
+ return (r, s) => e.view === "checkbox" ? (i(), u("div", tl, [
420
+ I(tt, {
421
421
  modelValue: t.value,
422
- "onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
423
- label: n.text,
424
- error: n.error || ""
422
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
423
+ label: r.text,
424
+ error: r.error || ""
425
425
  }, null, 8, ["modelValue", "label", "error"]),
426
- n.rules?.includes("required") ? (i(), u("span", tl, "*")) : B("", !0),
427
- n.i ? (i(), u("button", {
426
+ r.rules?.includes("required") ? (i(), u("span", ll, "*")) : z("", !0),
427
+ r.i ? (i(), u("button", {
428
428
  key: 1,
429
429
  class: "cursor-pointer",
430
- title: n.i,
431
- onClick: s[1] || (s[1] = se(() => {
430
+ title: r.i,
431
+ onClick: s[1] || (s[1] = ce(() => {
432
432
  }, ["prevent"]))
433
433
  }, [
434
- j(H(Yt), { class: "text-gray-500 w-[14px] h-[14px]" })
435
- ], 8, ll)) : B("", !0)
434
+ I(G(el), { class: "text-gray-500 w-[14px] h-[14px]" })
435
+ ], 8, ol)) : z("", !0)
436
436
  ])) : (i(), u("button", {
437
437
  key: 1,
438
438
  type: "button",
439
- class: S(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${n.style?.primaryColor || "blue"}-500` : "bg-stone-200", n.customClass]]),
440
- disabled: n.disabled,
441
- onClick: s[2] || (s[2] = (a) => t.value = !t.value)
439
+ class: M(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${r.style?.primaryColor || "blue"}-500` : "bg-stone-200", r.customClass]]),
440
+ disabled: r.disabled,
441
+ onClick: s[2] || (s[2] = (n) => t.value = !t.value)
442
442
  }, [
443
443
  l("span", {
444
444
  "data-state": "checked",
445
- class: S(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
445
+ class: M(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
446
446
  }, null, 2)
447
- ], 10, ol));
447
+ ], 10, al));
448
448
  }
449
- }), al = ["innerHTML"], Je = /* @__PURE__ */ A({
449
+ }), sl = ["innerHTML"], Ge = /* @__PURE__ */ E({
450
450
  __name: "vs-input-static",
451
451
  props: {
452
452
  text: { default: "" },
@@ -461,13 +461,13 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
461
461
  },
462
462
  setup(o) {
463
463
  return (e, t) => (i(), u("div", {
464
- class: S(e.customClass),
464
+ class: M(e.customClass),
465
465
  innerHTML: e.html ? e.html : e.text
466
- }, null, 10, al));
466
+ }, null, 10, sl));
467
467
  }
468
- }), sl = ["placeholder", "disabled", "name"], rl = /* @__PURE__ */ A({
468
+ }), rl = ["placeholder", "disabled", "name"], nl = /* @__PURE__ */ E({
469
469
  __name: "vs-input-mask",
470
- props: /* @__PURE__ */ Z({
470
+ props: /* @__PURE__ */ W({
471
471
  name: {},
472
472
  mask: { default: "" },
473
473
  unmask: { type: Boolean, default: !1 },
@@ -483,12 +483,12 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
483
483
  }),
484
484
  emits: ["update:modelValue"],
485
485
  setup(o) {
486
- const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue"), s = k(null);
487
- let a = null;
488
- return ne(async () => {
486
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue"), s = x(null);
487
+ let n = null;
488
+ return pe(async () => {
489
489
  if (s.value) {
490
- const { default: r } = await import("./index-W-qQIppj.js");
491
- a = r(s.value, {
490
+ const { default: a } = await import("./index-W-qQIppj.js");
491
+ n = a(s.value, {
492
492
  mask: e.mask || "",
493
493
  definitions: {
494
494
  9: /[0-9]/,
@@ -496,41 +496,41 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
496
496
  "*": /[a-zA-Z0-9]/
497
497
  },
498
498
  lazy: !1
499
- }), a.on("accept", () => {
500
- n.value = e.unmask ? a.unmaskedValue : a.value;
501
- }), a.on("complete", () => {
502
- n.value = e.unmask ? a.unmaskedValue : a.value;
503
- }), a.value = n.value ?? "";
499
+ }), n.on("accept", () => {
500
+ r.value = e.unmask ? n.unmaskedValue : n.value;
501
+ }), n.on("complete", () => {
502
+ r.value = e.unmask ? n.unmaskedValue : n.value;
503
+ }), n.value = r.value ?? "";
504
504
  }
505
- }), dt(() => {
506
- a?.destroy();
507
- }), re(() => e.mask, (r) => {
508
- a && a.updateOptions({
509
- mask: r,
505
+ }), ut(() => {
506
+ n?.destroy();
507
+ }), ue(() => e.mask, (a) => {
508
+ n && n.updateOptions({
509
+ mask: a,
510
510
  definitions: {
511
511
  9: /[0-9]/,
512
512
  A: /[a-zA-Z]/,
513
513
  "*": /[a-zA-Z0-9]/
514
514
  }
515
515
  });
516
- }), re(n, (r) => {
517
- a && a.unmaskedValue !== r && (a.value = r || "");
518
- }), (r, d) => (i(), u("input", {
516
+ }), ue(r, (a) => {
517
+ n && n.unmaskedValue !== a && (n.value = a || "");
518
+ }), (a, d) => (i(), u("input", {
519
519
  type: "text",
520
520
  ref_key: "inputEl",
521
521
  ref: s,
522
- placeholder: r.placeholder,
523
- disabled: r.disabled,
524
- name: r.name,
525
- class: S(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [H(t)]]),
522
+ placeholder: a.placeholder,
523
+ disabled: a.disabled,
524
+ name: a.name,
525
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t)]]),
526
526
  style: {
527
527
  border: "1px solid #CFD9E0"
528
528
  }
529
- }, null, 10, sl));
529
+ }, null, 10, rl));
530
530
  }
531
- }), nl = { class: "relative w-full bg-white rounded-lg" }, il = ["placeholder", "disabled"], ul = /* @__PURE__ */ A({
531
+ }), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ E({
532
532
  __name: "vs-input-email",
533
- props: /* @__PURE__ */ Z({
533
+ props: /* @__PURE__ */ W({
534
534
  style: { default: () => ({}) },
535
535
  customClass: { default: "" },
536
536
  disabled: { type: Boolean, default: !1 },
@@ -544,26 +544,26 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
544
544
  }),
545
545
  emits: ["update:modelValue"],
546
546
  setup(o) {
547
- const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue");
548
- return (s, a) => (i(), u("div", nl, [
549
- a[1] || (a[1] = ae('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
550
- q(l("input", {
547
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
548
+ return (s, n) => (i(), u("div", il, [
549
+ n[1] || (n[1] = re('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
550
+ X(l("input", {
551
551
  type: "email",
552
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
552
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
553
553
  placeholder: s.placeholder,
554
554
  disabled: s.disabled,
555
- class: S(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [H(t), { "!border-red-600": s.error }]]),
555
+ class: M(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
556
556
  style: {
557
557
  border: "1px solid #CFD9E0"
558
558
  }
559
- }, null, 10, il), [
560
- [ie, n.value]
559
+ }, null, 10, ul), [
560
+ [fe, r.value]
561
561
  ])
562
562
  ]));
563
563
  }
564
- }), dl = ["value", "disabled"], cl = { class: "text-[13px] text-gray-700" }, pl = /* @__PURE__ */ A({
564
+ }), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */ E({
565
565
  __name: "vs-input-radio-default",
566
- props: /* @__PURE__ */ Z({
566
+ props: /* @__PURE__ */ W({
567
567
  style: {},
568
568
  customClass: { default: "" },
569
569
  disabled: { type: Boolean, default: !1 },
@@ -579,36 +579,36 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
579
579
  }),
580
580
  emits: ["update:modelValue"],
581
581
  setup(o) {
582
- const e = W(o, "modelValue");
583
- return (t, n) => (i(), u("label", {
584
- class: S(["flex items-center gap-0", [t.customClass]])
582
+ const e = Q(o, "modelValue");
583
+ return (t, r) => (i(), u("label", {
584
+ class: M(["flex items-center gap-0", [t.customClass]])
585
585
  }, [
586
- q(l("input", {
587
- "onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
586
+ X(l("input", {
587
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
588
588
  type: "radio",
589
589
  value: t.value,
590
590
  disabled: t.disabled,
591
591
  class: "hidden"
592
- }, null, 8, dl), [
593
- [et, e.value]
592
+ }, null, 8, cl), [
593
+ [Ye, e.value]
594
594
  ]),
595
595
  l("span", {
596
- class: S(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
596
+ class: M(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
597
597
  `border-${t.style?.primaryColor || "blue"}-500`,
598
598
  t.disabled ? "opacity-50 cursor-not-allowed" : ""
599
599
  ]])
600
600
  }, [
601
601
  e.value == t.value ? (i(), u("span", {
602
602
  key: 0,
603
- class: S(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
604
- }, null, 2)) : B("", !0)
603
+ class: M(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
604
+ }, null, 2)) : z("", !0)
605
605
  ], 2),
606
- l("span", cl, F(t.text), 1)
606
+ l("span", pl, F(t.text), 1)
607
607
  ], 2));
608
608
  }
609
- }), fl = ["value", "disabled"], vl = { class: "text-[13px] text-gray-700" }, ml = /* @__PURE__ */ A({
609
+ }), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */ E({
610
610
  __name: "vs-input-radio-buttons",
611
- props: /* @__PURE__ */ Z({
611
+ props: /* @__PURE__ */ W({
612
612
  style: {},
613
613
  customClass: { default: "" },
614
614
  disabled: { type: Boolean, default: !1 },
@@ -624,31 +624,31 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
624
624
  }),
625
625
  emits: ["update:modelValue"],
626
626
  setup(o) {
627
- const e = W(o, "modelValue");
628
- return (t, n) => (i(), u("label", {
629
- class: S(["flex items-center border rounded-lg px-2 py-1", [
627
+ const e = Q(o, "modelValue");
628
+ return (t, r) => (i(), u("label", {
629
+ class: M(["flex items-center border rounded-lg px-2 py-1", [
630
630
  e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
631
631
  t.customClass
632
632
  ]])
633
633
  }, [
634
- q(l("input", {
635
- "onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
634
+ X(l("input", {
635
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
636
636
  type: "radio",
637
637
  value: t.value,
638
638
  disabled: t.disabled,
639
639
  class: "hidden"
640
- }, null, 8, fl), [
641
- [et, e.value]
640
+ }, null, 8, vl), [
641
+ [Ye, e.value]
642
642
  ]),
643
- l("span", vl, F(t.text), 1)
643
+ l("span", ml, F(t.text), 1)
644
644
  ], 2));
645
645
  }
646
- }), hl = {
647
- "vs-input-radio-default": pl,
648
- "vs-input-radio-buttons": ml
649
- }, Ke = /* @__PURE__ */ A({
646
+ }), gl = {
647
+ "vs-input-radio-default": fl,
648
+ "vs-input-radio-buttons": hl
649
+ }, Je = /* @__PURE__ */ E({
650
650
  __name: "vs-input-radio",
651
- props: /* @__PURE__ */ Z({
651
+ props: /* @__PURE__ */ W({
652
652
  options: {},
653
653
  position: { default: "vertical" },
654
654
  view: { default: "default" },
@@ -665,21 +665,21 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
665
665
  }),
666
666
  emits: ["update:modelValue"],
667
667
  setup(o) {
668
- const e = o, t = W(o, "modelValue"), n = D(() => hl[`vs-input-radio-${e.view}`]);
669
- return (s, a) => (i(), u("div", {
670
- class: S([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
668
+ const e = o, t = Q(o, "modelValue"), r = T(() => gl[`vs-input-radio-${e.view}`]);
669
+ return (s, n) => (i(), u("div", {
670
+ class: M([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
671
671
  }, [
672
- (i(!0), u(K, null, Y(s.options, (r) => (i(), X(we(n.value), Ve({
673
- key: r?.id,
674
- text: r.text,
675
- value: r.id.toString(),
676
- checked: t.value === r.id,
672
+ (i(!0), u(ee, null, le(s.options, (a) => (i(), te(Ve(r.value), je({
673
+ key: a?.id,
674
+ text: a.text,
675
+ value: a.id.toString(),
676
+ checked: t.value === a.id,
677
677
  modelValue: t.value,
678
- "onUpdate:modelValue": a[0] || (a[0] = (d) => t.value = d)
678
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => t.value = d)
679
679
  }, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
680
680
  ], 2));
681
681
  }
682
- }), gl = /* @__PURE__ */ A({
682
+ }), bl = /* @__PURE__ */ E({
683
683
  __name: "vs-input-checkbox",
684
684
  props: {
685
685
  options: { default: () => [] },
@@ -698,81 +698,81 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
698
698
  },
699
699
  emits: ["update:modelValue"],
700
700
  setup(o, { emit: e }) {
701
- const t = o, n = e, s = k([]), a = ct({}), r = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
701
+ const t = o, r = e, s = x([]), n = dt({}), a = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
702
702
  try {
703
- const c = await fetch(`/api/suggest/${t.data}`).then((g) => g.json());
703
+ const c = await fetch(`/api/suggest/${t.data}`).then((b) => b.json());
704
704
  s.value = c?.data || c;
705
705
  } catch (c) {
706
706
  console.error(c);
707
707
  }
708
708
  };
709
- return re(
709
+ return ue(
710
710
  () => t.modelValue,
711
711
  (c) => {
712
712
  if (typeof c == "boolean" && s.value.length === 1) {
713
- const g = r(s.value[0]);
714
- a[g] = c;
713
+ const b = a(s.value[0]);
714
+ n[b] = c;
715
715
  } else if (Array.isArray(c)) {
716
- const g = new Set(c);
716
+ const b = new Set(c);
717
717
  s.value.forEach((v) => {
718
718
  if (!v.disabled) {
719
- const M = r(v);
720
- a[M] = g.has(M);
719
+ const C = a(v);
720
+ n[C] = b.has(C);
721
721
  }
722
722
  });
723
723
  }
724
724
  },
725
725
  { immediate: !0 }
726
- ), re(
727
- a,
726
+ ), ue(
727
+ n,
728
728
  () => {
729
729
  if (!s.value.length) {
730
- n("update:modelValue", null);
730
+ r("update:modelValue", null);
731
731
  return;
732
732
  }
733
- const c = Object.entries(a).filter(([, g]) => g).map(([g]) => g);
734
- n("update:modelValue", c.length === 0 ? [] : c);
733
+ const c = Object.entries(n).filter(([, b]) => b).map(([b]) => b);
734
+ r("update:modelValue", c.length === 0 ? [] : c);
735
735
  },
736
736
  { deep: !0 }
737
- ), ne(() => {
737
+ ), pe(() => {
738
738
  if (t.data)
739
739
  f().then(() => {
740
740
  if (typeof t.modelValue == "boolean" && s.value.length === 1) {
741
- const c = r(s.value[0]);
742
- a[c] = t.modelValue;
741
+ const c = a(s.value[0]);
742
+ n[c] = t.modelValue;
743
743
  } else if (Array.isArray(t.modelValue)) {
744
744
  const c = new Set(t.modelValue);
745
- s.value.forEach((g) => {
746
- if (!g.disabled) {
747
- const v = r(g);
748
- a[v] = c.has(v);
745
+ s.value.forEach((b) => {
746
+ if (!b.disabled) {
747
+ const v = a(b);
748
+ n[v] = c.has(v);
749
749
  }
750
750
  });
751
751
  }
752
752
  });
753
753
  else if (s.value = t.options, typeof t.modelValue == "boolean" && s.value.length === 1) {
754
- const c = r(s.value[0]);
755
- a[c] = t.modelValue;
754
+ const c = a(s.value[0]);
755
+ n[c] = t.modelValue;
756
756
  } else if (Array.isArray(t.modelValue)) {
757
757
  const c = new Set(t.modelValue);
758
- s.value.forEach((g) => {
759
- if (!g.disabled) {
760
- const v = r(g);
761
- a[v] = c.has(v);
758
+ s.value.forEach((b) => {
759
+ if (!b.disabled) {
760
+ const v = a(b);
761
+ n[v] = c.has(v);
762
762
  }
763
763
  });
764
764
  }
765
- }), (c, g) => (i(), u("div", {
766
- class: S(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
765
+ }), (c, b) => (i(), u("div", {
766
+ class: M(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
767
767
  }, [
768
- (i(!0), u(K, null, Y(s.value, (v) => (i(), X(lt, {
769
- modelValue: a[r(v)],
770
- "onUpdate:modelValue": (M) => a[r(v)] = M,
771
- value: r(v),
772
- class: S(p(c.colSpan)),
768
+ (i(!0), u(ee, null, le(s.value, (v) => (i(), te(tt, {
769
+ modelValue: n[a(v)],
770
+ "onUpdate:modelValue": (C) => n[a(v)] = C,
771
+ value: a(v),
772
+ class: M(p(c.colSpan)),
773
773
  disabled: v.disabled,
774
774
  label: d(v),
775
- key: r(v),
775
+ key: a(v),
776
776
  icon: v?.icon,
777
777
  imgUrl: v?.imgUrl,
778
778
  option: v,
@@ -780,7 +780,7 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
780
780
  }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
781
781
  ], 2));
782
782
  }
783
- }), bl = /* @__PURE__ */ R(gl, [["__scopeId", "data-v-91f3584a"]]), yl = ["placeholder", "disabled"], xl = /* @__PURE__ */ A({
783
+ }), yl = /* @__PURE__ */ P(bl, [["__scopeId", "data-v-91f3584a"]]), xl = ["placeholder", "disabled"], wl = /* @__PURE__ */ E({
784
784
  __name: "vs-input-date1",
785
785
  props: {
786
786
  style: { default: () => ({}) },
@@ -793,56 +793,56 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
793
793
  },
794
794
  emits: ["update:modelValue"],
795
795
  setup(o, { emit: e }) {
796
- const t = o, { inputClass: n } = he(t.style), s = e, a = D({
796
+ const t = o, { inputClass: r } = _e(t.style), s = e, n = T({
797
797
  get: () => t.modelValue?.split(" ")[0],
798
- set: (r) => s("update:modelValue", r)
798
+ set: (a) => s("update:modelValue", a)
799
799
  });
800
- return (r, d) => q((i(), u("input", {
800
+ return (a, d) => X((i(), u("input", {
801
801
  type: "date",
802
- "onUpdate:modelValue": d[0] || (d[0] = (p) => a.value = p),
803
- placeholder: r.placeholder,
804
- disabled: r.disabled,
802
+ "onUpdate:modelValue": d[0] || (d[0] = (p) => n.value = p),
803
+ placeholder: a.placeholder,
804
+ disabled: a.disabled,
805
805
  ref: "date",
806
- class: S(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [r.modelValue ? "" : "text-opacity-50", H(n)].join(" ")]),
806
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [a.modelValue ? "" : "text-opacity-50", G(r)].join(" ")]),
807
807
  style: {
808
808
  border: "1px solid #CFD9E0"
809
809
  }
810
- }, null, 10, yl)), [
811
- [ie, a.value]
810
+ }, null, 10, xl)), [
811
+ [fe, n.value]
812
812
  ]);
813
813
  }
814
- }), wl = async (o, e, t, n) => {
814
+ }), kl = async (o, e, t, r) => {
815
815
  try {
816
816
  const s = new FormData();
817
817
  return s.append("unique", "true"), s.append("file", o), (await fetch(
818
- `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${n || ""}`,
818
+ `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${r || ""}`,
819
819
  {
820
820
  method: "POST",
821
821
  body: s
822
822
  }
823
- ).then((r) => r.json()))?.result;
823
+ ).then((a) => a.json()))?.result;
824
824
  } catch (s) {
825
- return fe({
825
+ return me({
826
826
  type: "error",
827
827
  title: "Помилка!",
828
828
  message: "Сталась помилка під час завантаження файлу",
829
829
  position: "right-bottom"
830
830
  }), console.error("Сталась помилка завантаження файлу", s), null;
831
831
  }
832
- }, kl = async (o) => {
832
+ }, _l = async (o) => {
833
833
  try {
834
834
  return await fetch(`file/delete${o}`), !0;
835
835
  } catch (e) {
836
836
  return console.error(e), !1;
837
837
  }
838
- }, Ze = async (o) => {
838
+ }, Ke = async (o) => {
839
839
  try {
840
- const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), n = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), a = new Blob([s], { type: n }), r = document.createElement("a");
841
- r.setAttribute("download", o), r.href = window.URL.createObjectURL(a), r.click();
840
+ const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), r = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), n = new Blob([s], { type: r }), a = document.createElement("a");
841
+ a.setAttribute("download", o), a.href = window.URL.createObjectURL(n), a.click();
842
842
  } catch (e) {
843
843
  console.error(e.message);
844
844
  }
845
- }, _l = {}, $l = {
845
+ }, $l = {}, Cl = {
846
846
  xmlns: "http://www.w3.org/2000/svg",
847
847
  width: "24",
848
848
  height: "24",
@@ -853,13 +853,13 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
853
853
  "stroke-linecap": "round",
854
854
  "stroke-linejoin": "round"
855
855
  };
856
- function Cl(o, e) {
857
- return i(), u("svg", $l, e[0] || (e[0] = [
856
+ function Vl(o, e) {
857
+ return i(), u("svg", Cl, e[0] || (e[0] = [
858
858
  l("path", { d: "M5 12h14" }, null, -1),
859
859
  l("path", { d: "M12 5v14" }, null, -1)
860
860
  ]));
861
861
  }
862
- const je = /* @__PURE__ */ R(_l, [["render", Cl]]), Vl = {}, Ll = {
862
+ const Ae = /* @__PURE__ */ P($l, [["render", Vl]]), Ml = {}, Ll = {
863
863
  xmlns: "http://www.w3.org/2000/svg",
864
864
  class: "icon icon-tabler icon-tabler-file-text",
865
865
  width: "44",
@@ -871,12 +871,12 @@ const je = /* @__PURE__ */ R(_l, [["render", Cl]]), Vl = {}, Ll = {
871
871
  "stroke-linecap": "round",
872
872
  "stroke-linejoin": "round"
873
873
  };
874
- function Ml(o, e, t, n, s, a) {
874
+ function Sl(o, e, t, r, s, n) {
875
875
  return i(), u("svg", Ll, e[0] || (e[0] = [
876
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
876
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
877
877
  ]));
878
878
  }
879
- const Sl = /* @__PURE__ */ R(Vl, [["render", Ml]]), Bl = {}, jl = {
879
+ const Bl = /* @__PURE__ */ P(Ml, [["render", Sl]]), jl = {}, Il = {
880
880
  xmlns: "http://www.w3.org/2000/svg",
881
881
  class: "icon icon-tabler icon-tabler-table",
882
882
  width: "44",
@@ -888,8 +888,8 @@ const Sl = /* @__PURE__ */ R(Vl, [["render", Ml]]), Bl = {}, jl = {
888
888
  "stroke-linecap": "round",
889
889
  "stroke-linejoin": "round"
890
890
  };
891
- function Il(o, e, t, n, s, a) {
892
- return i(), u("svg", jl, e[0] || (e[0] = [
891
+ function zl(o, e, t, r, s, n) {
892
+ return i(), u("svg", Il, e[0] || (e[0] = [
893
893
  l("path", {
894
894
  stroke: "none",
895
895
  d: "M0 0h24v24H0z",
@@ -916,7 +916,7 @@ function Il(o, e, t, n, s, a) {
916
916
  }, null, -1)
917
917
  ]));
918
918
  }
919
- const zl = /* @__PURE__ */ R(Bl, [["render", Il]]), Al = {}, El = {
919
+ const Al = /* @__PURE__ */ P(jl, [["render", zl]]), Ol = {}, El = {
920
920
  xmlns: "http://www.w3.org/2000/svg",
921
921
  width: "24",
922
922
  height: "24",
@@ -928,12 +928,12 @@ const zl = /* @__PURE__ */ R(Bl, [["render", Il]]), Al = {}, El = {
928
928
  "stroke-linejoin": "round",
929
929
  class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
930
930
  };
931
- function Fl(o, e, t, n, s, a) {
931
+ function Fl(o, e, t, r, s, n) {
932
932
  return i(), u("svg", El, e[0] || (e[0] = [
933
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
933
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
934
934
  ]));
935
935
  }
936
- const Ol = /* @__PURE__ */ R(Al, [["render", Fl]]), Dl = {}, Ul = {
936
+ const Dl = /* @__PURE__ */ P(Ol, [["render", Fl]]), Ul = {}, Tl = {
937
937
  xmlns: "http://www.w3.org/2000/svg",
938
938
  class: "icon icon-tabler icon-tabler-file-zip",
939
939
  width: "44",
@@ -945,12 +945,12 @@ const Ol = /* @__PURE__ */ R(Al, [["render", Fl]]), Dl = {}, Ul = {
945
945
  "stroke-linecap": "round",
946
946
  "stroke-linejoin": "round"
947
947
  };
948
- function Tl(o, e, t, n, s, a) {
949
- return i(), u("svg", Ul, e[0] || (e[0] = [
950
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
948
+ function Rl(o, e, t, r, s, n) {
949
+ return i(), u("svg", Tl, e[0] || (e[0] = [
950
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
951
951
  ]));
952
952
  }
953
- const Rl = /* @__PURE__ */ R(Dl, [["render", Tl]]), Pl = {}, Nl = {
953
+ const Pl = /* @__PURE__ */ P(Ul, [["render", Rl]]), Nl = {}, Hl = {
954
954
  xmlns: "http://www.w3.org/2000/svg",
955
955
  class: "icon icon-tabler icon-tabler-file-code",
956
956
  width: "44",
@@ -962,25 +962,25 @@ const Rl = /* @__PURE__ */ R(Dl, [["render", Tl]]), Pl = {}, Nl = {
962
962
  "stroke-linecap": "round",
963
963
  "stroke-linejoin": "round"
964
964
  };
965
- function Hl(o, e, t, n, s, a) {
966
- return i(), u("svg", Nl, e[0] || (e[0] = [
967
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
965
+ function ql(o, e, t, r, s, n) {
966
+ return i(), u("svg", Hl, e[0] || (e[0] = [
967
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
968
968
  ]));
969
969
  }
970
- const ql = /* @__PURE__ */ R(Pl, [["render", Hl]]), Gl = (o) => {
970
+ const Gl = /* @__PURE__ */ P(Nl, [["render", ql]]), Jl = (o) => {
971
971
  if (!o) return "";
972
972
  const e = o?.split(".");
973
973
  return e[e.length - 1];
974
- }, Jl = (o) => {
975
- const e = Gl(o), t = {
974
+ }, Kl = (o) => {
975
+ const e = Jl(o), t = {
976
976
  imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
977
977
  sheetsFormat: ["xls", "csv", "xlsx"],
978
978
  archivesFormat: ["zip", "rar"],
979
979
  textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
980
980
  documentsFormat: ["pdf"]
981
981
  };
982
- return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? zl : t.textsFormat.includes(e) ? ql : t.documentsFormat.includes(e) ? Sl : t.archivesFormat.includes(e) ? Rl : Ol;
983
- }, Kl = {}, Zl = {
982
+ return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? Al : t.textsFormat.includes(e) ? Gl : t.documentsFormat.includes(e) ? Bl : t.archivesFormat.includes(e) ? Pl : Dl;
983
+ }, Zl = {}, Wl = {
984
984
  xmlns: "http://www.w3.org/2000/svg",
985
985
  width: "24",
986
986
  height: "24",
@@ -992,12 +992,12 @@ const ql = /* @__PURE__ */ R(Pl, [["render", Hl]]), Gl = (o) => {
992
992
  "stroke-linejoin": "round",
993
993
  class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
994
994
  };
995
- function Wl(o, e) {
996
- return i(), u("svg", Zl, e[0] || (e[0] = [
997
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
995
+ function Ql(o, e) {
996
+ return i(), u("svg", Wl, e[0] || (e[0] = [
997
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
998
998
  ]));
999
999
  }
1000
- const Ie = /* @__PURE__ */ R(Kl, [["render", Wl]]), Ql = {}, Xl = {
1000
+ const Ee = /* @__PURE__ */ P(Zl, [["render", Ql]]), Xl = {}, Yl = {
1001
1001
  xmlns: "http://www.w3.org/2000/svg",
1002
1002
  width: "24",
1003
1003
  height: "24",
@@ -1009,8 +1009,8 @@ const Ie = /* @__PURE__ */ R(Kl, [["render", Wl]]), Ql = {}, Xl = {
1009
1009
  "stroke-linejoin": "round",
1010
1010
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1011
1011
  };
1012
- function Yl(o, e) {
1013
- return i(), u("svg", Xl, e[0] || (e[0] = [
1012
+ function eo(o, e) {
1013
+ return i(), u("svg", Yl, e[0] || (e[0] = [
1014
1014
  l("path", {
1015
1015
  stroke: "none",
1016
1016
  d: "M0 0h24v24H0z",
@@ -1021,9 +1021,9 @@ function Yl(o, e) {
1021
1021
  l("path", { d: "M12 4l0 12" }, null, -1)
1022
1022
  ]));
1023
1023
  }
1024
- const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, to = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, lo = /* @__PURE__ */ A({
1024
+ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, lo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, oo = /* @__PURE__ */ E({
1025
1025
  __name: "vs-input-file-list-item",
1026
- props: /* @__PURE__ */ Z({
1026
+ props: /* @__PURE__ */ W({
1027
1027
  format: {},
1028
1028
  multiple: { type: Boolean },
1029
1029
  style: {},
@@ -1041,40 +1041,40 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1041
1041
  }),
1042
1042
  emits: ["update:value", "update:item"],
1043
1043
  setup(o) {
1044
- const e = W(o, "value"), t = W(o, "item"), n = o;
1045
- return (s, a) => (i(), u("div", eo, [
1046
- (i(), X(we(H(Jl)(t.value)), {
1044
+ const e = Q(o, "value"), t = Q(o, "item"), r = o;
1045
+ return (s, n) => (i(), u("div", to, [
1046
+ (i(), te(Ve(G(Kl)(t.value)), {
1047
1047
  src: t.value,
1048
1048
  alt: "file",
1049
1049
  class: "w-full h-full object-cover cursor-pointer",
1050
- onClick: a[0] || (a[0] = (r) => H(Ze)(t.value))
1050
+ onClick: n[0] || (n[0] = (a) => G(Ke)(t.value))
1051
1051
  }, null, 8, ["src"])),
1052
- l("div", to, [
1052
+ l("div", lo, [
1053
1053
  l("button", {
1054
1054
  type: "button",
1055
- onClick: a[1] || (a[1] = (r) => {
1056
- H(kl)(t.value), e.value = n.multiple ? e.value?.filter((d) => d !== t.value) : "";
1055
+ onClick: n[1] || (n[1] = (a) => {
1056
+ G(_l)(t.value), e.value = r.multiple ? e.value?.filter((d) => d !== t.value) : "";
1057
1057
  }),
1058
1058
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
1059
1059
  }, [
1060
- j(Ie, { class: "w-4 h-4" })
1060
+ I(Ee, { class: "w-4 h-4" })
1061
1061
  ]),
1062
1062
  l("button", {
1063
1063
  type: "button",
1064
- onClick: a[2] || (a[2] = (r) => H(Ze)(t.value)),
1064
+ onClick: n[2] || (n[2] = (a) => G(Ke)(t.value)),
1065
1065
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
1066
1066
  }, [
1067
- j(at, { class: "w-4 h-4" })
1067
+ I(ot, { class: "w-4 h-4" })
1068
1068
  ])
1069
1069
  ])
1070
1070
  ]));
1071
1071
  }
1072
- }), We = /* @__PURE__ */ R(lo, [["__scopeId", "data-v-0ca886b3"]]), oo = { class: "flex items-center gap-x-2" }, ao = {
1072
+ }), Ze = /* @__PURE__ */ P(oo, [["__scopeId", "data-v-0ca886b3"]]), ao = { class: "flex items-center gap-x-2" }, so = {
1073
1073
  key: 1,
1074
1074
  class: "flex items-center flex-wrap gap-2"
1075
- }, so = /* @__PURE__ */ A({
1075
+ }, ro = /* @__PURE__ */ E({
1076
1076
  __name: "vs-input-file",
1077
- props: /* @__PURE__ */ Z({
1077
+ props: /* @__PURE__ */ W({
1078
1078
  format: {},
1079
1079
  multiple: { type: Boolean },
1080
1080
  style: {},
@@ -1090,65 +1090,65 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1090
1090
  }),
1091
1091
  emits: ["update:modelValue"],
1092
1092
  setup(o) {
1093
- const e = o, t = W(o, "modelValue"), n = k(null), s = (r) => Array.isArray(t.value) && t.value[r] || "", a = async (r) => {
1093
+ const e = o, t = Q(o, "modelValue"), r = x(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", n = async (a) => {
1094
1094
  if (e.format) {
1095
- const f = r.target.files?.[0];
1095
+ const f = a.target.files?.[0];
1096
1096
  if (!f || !f.name.endsWith(e.format))
1097
1097
  return;
1098
1098
  }
1099
- const d = r.target.files?.[0];
1099
+ const d = a.target.files?.[0];
1100
1100
  if (!d) return;
1101
- const p = await wl(d, "1", "form", "table");
1101
+ const p = await kl(d, "1", "form", "table");
1102
1102
  t.value = e.multiple ? [...t.value || [], p?.file_path] : p?.file_path;
1103
1103
  };
1104
- return (r, d) => (i(), u("div", oo, [
1104
+ return (a, d) => (i(), u("div", ao, [
1105
1105
  l("input", {
1106
1106
  class: "hidden",
1107
1107
  ref_key: "fileInput",
1108
- ref: n,
1108
+ ref: r,
1109
1109
  type: "file",
1110
- onChange: a
1110
+ onChange: n
1111
1111
  }, null, 544),
1112
- !r.multiple && t.value ? (i(), X(We, {
1112
+ !a.multiple && t.value ? (i(), te(Ze, {
1113
1113
  key: 0,
1114
1114
  item: t.value,
1115
1115
  "onUpdate:item": d[0] || (d[0] = (p) => t.value = p),
1116
1116
  value: t.value,
1117
1117
  "onUpdate:value": d[1] || (d[1] = (p) => t.value = p)
1118
- }, null, 8, ["item", "value"])) : r.multiple ? (i(), u("div", ao, [
1119
- (i(!0), u(K, null, Y(t.value, (p, f) => (i(), X(We, {
1120
- multiple: r.multiple,
1118
+ }, null, 8, ["item", "value"])) : a.multiple ? (i(), u("div", so, [
1119
+ (i(!0), u(ee, null, le(t.value, (p, f) => (i(), te(Ze, {
1120
+ multiple: a.multiple,
1121
1121
  key: f,
1122
1122
  value: t.value,
1123
1123
  "onUpdate:value": d[2] || (d[2] = (c) => t.value = c),
1124
1124
  item: s(f)
1125
1125
  }, null, 8, ["multiple", "value", "item"]))), 128)),
1126
1126
  l("div", {
1127
- onClick: d[3] || (d[3] = (p) => !r.disabled && n.value?.click()),
1128
- class: S([
1127
+ onClick: d[3] || (d[3] = (p) => !a.disabled && r.value?.click()),
1128
+ class: M([
1129
1129
  "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
1130
- r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1130
+ a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1131
1131
  ])
1132
1132
  }, [
1133
- j(je, { class: "w-6 h-6" })
1133
+ I(Ae, { class: "w-6 h-6" })
1134
1134
  ], 2)
1135
- ])) : B("", !0),
1136
- r.multiple ? B("", !0) : (i(), u("div", {
1135
+ ])) : z("", !0),
1136
+ a.multiple ? z("", !0) : (i(), u("div", {
1137
1137
  key: 2,
1138
- onClick: d[4] || (d[4] = (p) => n.value?.click()),
1139
- class: S([r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1138
+ onClick: d[4] || (d[4] = (p) => r.value?.click()),
1139
+ class: M([a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1140
1140
  }, [
1141
- j(je, { class: "w-6 h-6" })
1141
+ I(Ae, { class: "w-6 h-6" })
1142
1142
  ], 2))
1143
1143
  ]));
1144
1144
  }
1145
- }), ro = { class: "max-w-[55vw]" }, no = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, io = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, uo = { class: "px-[5px]" }, co = { class: "" }, Se = /* @__PURE__ */ A({
1145
+ }), no = { class: "max-w-[55vw]" }, io = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, uo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, co = { class: "px-[5px]" }, po = { class: "" }, Ie = /* @__PURE__ */ E({
1146
1146
  __name: "vs-widget-file-info",
1147
1147
  props: {
1148
1148
  item: { default: null }
1149
1149
  },
1150
1150
  setup(o) {
1151
- const e = o, t = D(() => {
1151
+ const e = o, t = T(() => {
1152
1152
  try {
1153
1153
  return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
1154
1154
  day: "2-digit",
@@ -1159,41 +1159,41 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1159
1159
  return "";
1160
1160
  }
1161
1161
  });
1162
- function n(s) {
1162
+ function r(s) {
1163
1163
  if (s < 1024)
1164
1164
  return `${s} B`;
1165
- const a = s / 1024;
1166
- return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
1165
+ const n = s / 1024;
1166
+ return n < 1024 ? `${n.toFixed(2)} KB` : `${(n / 1024).toFixed(2)} MB`;
1167
1167
  }
1168
- return (s, a) => (i(), u(K, null, [
1169
- a[1] || (a[1] = ae('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1170
- l("div", ro, [
1171
- l("p", no, F(s.item?.uploaded_name), 1),
1172
- l("p", io, [
1168
+ return (s, n) => (i(), u(ee, null, [
1169
+ n[1] || (n[1] = re('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1170
+ l("div", no, [
1171
+ l("p", io, F(s.item?.uploaded_name), 1),
1172
+ l("p", uo, [
1173
1173
  l("span", null, F(s.item?.username), 1),
1174
- q(l("span", uo, "|", 512), [
1175
- [Ue, s.item?.username]
1174
+ X(l("span", co, "|", 512), [
1175
+ [Pe, s.item?.username]
1176
1176
  ]),
1177
1177
  l("span", null, F(t.value), 1),
1178
- a[0] || (a[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1179
- l("span", co, F(n(s.item?.size)), 1)
1178
+ n[0] || (n[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1179
+ l("span", po, F(r(s.item?.size)), 1)
1180
1180
  ])
1181
1181
  ])
1182
1182
  ], 64));
1183
1183
  }
1184
- }), po = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, fo = {
1184
+ }), fo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, vo = {
1185
1185
  key: 0,
1186
1186
  class: "flex w-full gap-x-3 items-center"
1187
- }, vo = {
1187
+ }, mo = {
1188
1188
  key: 1,
1189
1189
  class: "flex gap-x-3 w-full items-center"
1190
- }, mo = {
1190
+ }, ho = {
1191
1191
  key: 2,
1192
1192
  class: "flex gap-x-3 w-full items-center"
1193
- }, ho = ["href"], go = {
1193
+ }, go = ["href"], bo = {
1194
1194
  key: 3,
1195
1195
  class: "flex gap-x-3 w-full items-center"
1196
- }, bo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, yo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, xo = { class: "inline-block" }, wo = { class: "inline-block" }, ko = /* @__PURE__ */ A({
1196
+ }, yo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, xo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, wo = { class: "inline-block" }, ko = { class: "inline-block" }, _o = /* @__PURE__ */ E({
1197
1197
  __name: "vs-widget-file-item",
1198
1198
  props: {
1199
1199
  item: { default: null },
@@ -1202,28 +1202,28 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1202
1202
  },
1203
1203
  emits: ["update", "openModal", "openLightbox"],
1204
1204
  setup(o, { emit: e }) {
1205
- const t = o, n = e;
1205
+ const t = o, r = e;
1206
1206
  function s(c) {
1207
1207
  return ["pdf", "json"].includes(c.ext);
1208
1208
  }
1209
- function a(c) {
1209
+ function n(c) {
1210
1210
  return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(c.ext);
1211
1211
  }
1212
- function r(c) {
1213
- const g = document.createElement("a");
1214
- g.setAttribute("download", c?.uploaded_name), g.href = c?.file_path, g.click();
1212
+ function a(c) {
1213
+ const b = document.createElement("a");
1214
+ b.setAttribute("download", c?.uploaded_name), b.href = c?.file_path, b.click();
1215
1215
  }
1216
1216
  async function d() {
1217
1217
  try {
1218
1218
  await fetch(
1219
1219
  `${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
1220
- ), n("update");
1220
+ ), r("update");
1221
1221
  } catch (c) {
1222
1222
  console.error(c);
1223
1223
  }
1224
1224
  }
1225
1225
  function p() {
1226
- n("openModal", {
1226
+ r("openModal", {
1227
1227
  title: "Ви впевнені?",
1228
1228
  message: "Ви впевнені, що хочете видалити цей файл?",
1229
1229
  confirmButtonText: "Так, я впевнена/ий",
@@ -1233,50 +1233,50 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1233
1233
  });
1234
1234
  }
1235
1235
  function f(c) {
1236
- (t.item.ext === "jpg" || t.item.ext === "png") && n("openLightbox", { item: t.item, index: c });
1236
+ (t.item.ext === "jpg" || t.item.ext === "png") && r("openLightbox", { item: t.item, index: c });
1237
1237
  }
1238
- return (c, g) => (i(), u("div", po, [
1239
- c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", fo, [
1238
+ return (c, b) => (i(), u("div", fo, [
1239
+ c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", vo, [
1240
1240
  l("div", {
1241
1241
  class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
1242
- onClick: g[0] || (g[0] = (v) => f(c.index))
1242
+ onClick: b[0] || (b[0] = (v) => f(c.index))
1243
1243
  }, [
1244
- j(Se, { item: c.item }, null, 8, ["item"])
1244
+ I(Ie, { item: c.item }, null, 8, ["item"])
1245
1245
  ])
1246
- ])) : s(c.item) ? (i(), u("div", vo, [
1247
- j(Se, { item: c.item }, null, 8, ["item"])
1248
- ])) : a(c.item) ? (i(), u("div", mo, [
1246
+ ])) : s(c.item) ? (i(), u("div", mo, [
1247
+ I(Ie, { item: c.item }, null, 8, ["item"])
1248
+ ])) : n(c.item) ? (i(), u("div", ho, [
1249
1249
  l("a", {
1250
1250
  href: `/api/file-preview?id=${c.item.file_id}`,
1251
1251
  target: "_blank",
1252
1252
  class: "flex gap-x-3 w-full items-center"
1253
1253
  }, [
1254
- j(Se, { item: c.item }, null, 8, ["item"])
1255
- ], 8, ho)
1256
- ])) : (i(), u("div", go, [
1257
- j(Se, { item: c.item }, null, 8, ["item"])
1254
+ I(Ie, { item: c.item }, null, 8, ["item"])
1255
+ ], 8, go)
1256
+ ])) : (i(), u("div", bo, [
1257
+ I(Ie, { item: c.item }, null, 8, ["item"])
1258
1258
  ])),
1259
- l("div", bo, [
1260
- l("div", yo, [
1261
- l("div", xo, [
1259
+ l("div", yo, [
1260
+ l("div", xo, [
1261
+ l("div", wo, [
1262
1262
  l("button", {
1263
1263
  class: "inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
1264
- onClick: g[1] || (g[1] = (v) => r(c.item))
1264
+ onClick: b[1] || (b[1] = (v) => a(c.item))
1265
1265
  }, [
1266
- j(at, {
1266
+ I(ot, {
1267
1267
  height: "14",
1268
1268
  width: "14"
1269
1269
  })
1270
1270
  ])
1271
1271
  ]),
1272
- g[3] || (g[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1273
- l("div", wo, [
1272
+ b[3] || (b[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1273
+ l("div", ko, [
1274
1274
  l("button", {
1275
1275
  type: "button",
1276
1276
  class: "size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",
1277
- onClick: g[2] || (g[2] = (v) => p())
1277
+ onClick: b[2] || (b[2] = (v) => p())
1278
1278
  }, [
1279
- j(Ie, {
1279
+ I(Ee, {
1280
1280
  height: "14",
1281
1281
  width: "14"
1282
1282
  })
@@ -1286,7 +1286,7 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1286
1286
  ])
1287
1287
  ]));
1288
1288
  }
1289
- }), _o = {}, $o = {
1289
+ }), $o = {}, Co = {
1290
1290
  xmlns: "http://www.w3.org/2000/svg",
1291
1291
  width: "24",
1292
1292
  height: "24",
@@ -1298,8 +1298,8 @@ const at = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
1298
1298
  "stroke-linejoin": "round",
1299
1299
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1300
1300
  };
1301
- function Co(o, e) {
1302
- return i(), u("svg", $o, e[0] || (e[0] = [
1301
+ function Vo(o, e) {
1302
+ return i(), u("svg", Co, e[0] || (e[0] = [
1303
1303
  l("path", {
1304
1304
  stroke: "none",
1305
1305
  d: "M0 0h24v24H0z",
@@ -1310,13 +1310,13 @@ function Co(o, e) {
1310
1310
  l("path", { d: "M12 4l0 12" }, null, -1)
1311
1311
  ]));
1312
1312
  }
1313
- const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, Mo = { class: "flex w-full mb-[12px] items-center gap-x-2" }, So = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, Bo = { class1: "ml-auto" }, jo = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Io = {
1313
+ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, So = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, jo = { class1: "ml-auto" }, Io = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, zo = {
1314
1314
  key: 0,
1315
1315
  class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
1316
- }, zo = { class: "relative" }, Ao = {
1316
+ }, Ao = { class: "relative" }, Oo = {
1317
1317
  key: 1,
1318
1318
  class: "space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"
1319
- }, Eo = { key: 0 }, Fo = /* @__PURE__ */ A({
1319
+ }, Eo = { key: 0 }, Fo = /* @__PURE__ */ E({
1320
1320
  __name: "vs-input-file-list",
1321
1321
  props: {
1322
1322
  id: { default: "" },
@@ -1331,57 +1331,57 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1331
1331
  },
1332
1332
  emits: ["update"],
1333
1333
  setup(o, { emit: e }) {
1334
- const t = o, n = Be("form"), s = D(() => n.value.formId), a = k(!1), r = k(0), d = e, p = k(!1), f = k({}), c = k([]), g = k(""), v = D(() => Array.isArray(c.value) ? c.value.filter((x) => x.ext === "jpg" || x.ext === "png").map((x) => x?.file_path) : []), M = D(() => g.value === "" ? c.value : c.value.filter((x) => x?.uploaded_name?.includes(g.value))), I = (x) => {
1335
- const h = v.value.findIndex((G) => G === x.item.file_path);
1336
- h !== -1 && (a.value = !0, r.value = h);
1337
- }, U = async () => {
1334
+ const t = o, r = ze("form"), s = T(() => r.value.formId), n = x(!1), a = x(0), d = e, p = x(!1), f = x({}), c = x([]), b = x(""), v = T(() => Array.isArray(c.value) ? c.value.filter((h) => h.ext === "jpg" || h.ext === "png").map((h) => h?.file_path) : []), C = T(() => b.value === "" ? c.value : c.value.filter((h) => h?.uploaded_name?.includes(b.value))), V = (h) => {
1335
+ const g = v.value.findIndex((K) => K === h.item.file_path);
1336
+ g !== -1 && (n.value = !0, a.value = g);
1337
+ }, D = async () => {
1338
1338
  try {
1339
- const x = await fetch(`${t.prefix}/widget/file/${s.value}`).then((h) => h.json());
1340
- c.value = x?.rows;
1341
- } catch (x) {
1342
- console.error(x);
1339
+ const h = await fetch(`${t.prefix}/widget/file/${s.value}`).then((g) => g.json());
1340
+ c.value = h?.rows;
1341
+ } catch (h) {
1342
+ console.error(h);
1343
1343
  }
1344
- }, T = async (x) => {
1344
+ }, U = async (h) => {
1345
1345
  await Promise.all(
1346
- Array.from(x.target.files).map(async (h) => {
1347
- const G = new FormData();
1348
- G.append("file", h);
1346
+ Array.from(h.target.files).map(async (g) => {
1347
+ const K = new FormData();
1348
+ K.append("file", g);
1349
1349
  try {
1350
- const C = `${t.prefix}/widget/file/${s.value}`;
1351
- return await fetch(C, { method: "POST", body: G }), d("update", "file-list"), h;
1352
- } catch (C) {
1353
- return console.error(C), null;
1350
+ const A = `${t.prefix}/widget/file/${s.value}`;
1351
+ return await fetch(A, { method: "POST", body: K }), d("update", "file-list"), g;
1352
+ } catch (A) {
1353
+ return console.error(A), null;
1354
1354
  }
1355
1355
  })
1356
- ), await U();
1357
- }, P = (x) => {
1358
- const h = { ...x };
1359
- return x.cancel || (h.cancel = () => {
1356
+ ), await D();
1357
+ }, N = (h) => {
1358
+ const g = { ...h };
1359
+ return h.cancel || (g.cancel = () => {
1360
1360
  p.value = !1;
1361
- }), x.updateListOnConfirm && (h.confirm = async () => {
1362
- await x.confirm(), p.value = !1, U();
1363
- }), h;
1364
- }, _ = (x) => {
1365
- f.value = P(x), p.value = !0;
1361
+ }), h.updateListOnConfirm && (g.confirm = async () => {
1362
+ await h.confirm(), p.value = !1, D();
1363
+ }), g;
1364
+ }, $ = (h) => {
1365
+ f.value = N(h), p.value = !0;
1366
1366
  };
1367
- return re(s, (x) => {
1368
- x && U();
1369
- }), ne(() => {
1370
- s.value && U();
1371
- }), (x, h) => {
1372
- const G = Ne("Lightbox"), C = Ne("MessageBox");
1367
+ return ue(s, (h) => {
1368
+ h && D();
1369
+ }), pe(() => {
1370
+ s.value && D();
1371
+ }), (h, g) => {
1372
+ const K = Ne("Lightbox"), A = Ne("MessageBox");
1373
1373
  return i(), u("div", Lo, [
1374
- l("div", Mo, [
1375
- l("h2", So, " Файлів: " + F(c.value?.length), 1),
1376
- l("div", Bo, [
1374
+ l("div", So, [
1375
+ l("h2", Bo, " Файлів: " + F(c.value?.length), 1),
1376
+ l("div", jo, [
1377
1377
  l("label", null, [
1378
1378
  l("input", {
1379
1379
  type: "file",
1380
1380
  class: "hidden",
1381
- onChange: h[0] || (h[0] = (m) => T(m))
1381
+ onChange: g[0] || (g[0] = (S) => U(S))
1382
1382
  }, null, 32),
1383
- l("div", jo, [
1384
- j(Vo, {
1383
+ l("div", Io, [
1384
+ I(Mo, {
1385
1385
  height: "16",
1386
1386
  width: "16"
1387
1387
  })
@@ -1389,10 +1389,10 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1389
1389
  ])
1390
1390
  ])
1391
1391
  ]),
1392
- c.value?.length > 4 ? (i(), u("div", Io, [
1392
+ c.value?.length > 4 ? (i(), u("div", zo, [
1393
1393
  l("div", null, [
1394
- l("div", zo, [
1395
- h[8] || (h[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1394
+ l("div", Ao, [
1395
+ g[8] || (g[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1396
1396
  l("svg", {
1397
1397
  class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
1398
1398
  xmlns: "http://www.w3.org/2000/svg",
@@ -1413,52 +1413,52 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1413
1413
  l("path", { d: "m21 21-4.3-4.3" })
1414
1414
  ])
1415
1415
  ], -1)),
1416
- q(l("input", {
1416
+ X(l("input", {
1417
1417
  type: "text",
1418
- "onUpdate:modelValue": h[1] || (h[1] = (m) => g.value = m),
1418
+ "onUpdate:modelValue": g[1] || (g[1] = (S) => b.value = S),
1419
1419
  class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
1420
1420
  placeholder: "Введіть назву файлу"
1421
1421
  }, null, 512), [
1422
1422
  [
1423
- ie,
1424
- g.value,
1423
+ fe,
1424
+ b.value,
1425
1425
  void 0,
1426
1426
  { trim: !0 }
1427
1427
  ]
1428
1428
  ])
1429
1429
  ])
1430
1430
  ])
1431
- ])) : B("", !0),
1432
- c.value?.length ? (i(), u("div", Ao, [
1433
- (i(!0), u(K, null, Y(M.value, (m, V) => (i(), X(ko, {
1434
- key: V,
1435
- prefix: x.prefix,
1436
- item: m,
1437
- index: V,
1438
- onUpdate: h[2] || (h[2] = (E) => x.$emit("update", "file-list")),
1439
- onOpenModal: h[3] || (h[3] = (E) => _(E)),
1440
- onOpenLightbox: h[4] || (h[4] = (E) => I(E))
1431
+ ])) : z("", !0),
1432
+ c.value?.length ? (i(), u("div", Oo, [
1433
+ (i(!0), u(ee, null, le(C.value, (S, J) => (i(), te(_o, {
1434
+ key: J,
1435
+ prefix: h.prefix,
1436
+ item: S,
1437
+ index: J,
1438
+ onUpdate: g[2] || (g[2] = (Y) => h.$emit("update", "file-list")),
1439
+ onOpenModal: g[3] || (g[3] = (Y) => $(Y)),
1440
+ onOpenLightbox: g[4] || (g[4] = (Y) => V(Y))
1441
1441
  }, null, 8, ["prefix", "item", "index"]))), 128)),
1442
- M.value.length ? B("", !0) : (i(), u("div", Eo, h[9] || (h[9] = [
1442
+ C.value.length ? z("", !0) : (i(), u("div", Eo, g[9] || (g[9] = [
1443
1443
  l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
1444
1444
  ])))
1445
- ])) : B("", !0),
1446
- j(G, {
1447
- modelValue: a.value,
1448
- "onUpdate:modelValue": h[5] || (h[5] = (m) => a.value = m),
1449
- startIndex: r.value,
1450
- "onUpdate:index": h[6] || (h[6] = (m) => r.value = m),
1445
+ ])) : z("", !0),
1446
+ I(K, {
1447
+ modelValue: n.value,
1448
+ "onUpdate:modelValue": g[5] || (g[5] = (S) => n.value = S),
1449
+ startIndex: a.value,
1450
+ "onUpdate:index": g[6] || (g[6] = (S) => a.value = S),
1451
1451
  images: v.value
1452
1452
  }, null, 8, ["modelValue", "startIndex", "images"]),
1453
- j(C, Ve({
1453
+ I(A, je({
1454
1454
  modelValue: p.value,
1455
- "onUpdate:modelValue": h[7] || (h[7] = (m) => p.value = m),
1455
+ "onUpdate:modelValue": g[7] || (g[7] = (S) => p.value = S),
1456
1456
  onConfirm: f.value.confirm
1457
1457
  }, f.value), null, 16, ["modelValue", "onConfirm"])
1458
1458
  ]);
1459
1459
  };
1460
1460
  }
1461
- }), Oo = { class: "flex items-center justify-between" }, Do = { class: "text-[16px] text-gray-900 font-medium" }, Uo = { class: "grid gap-3" }, To = /* @__PURE__ */ A({
1461
+ }), Do = { class: "flex items-center justify-between" }, Uo = { class: "text-[16px] text-gray-900 font-medium" }, To = { class: "grid gap-3" }, Ro = /* @__PURE__ */ E({
1462
1462
  __name: "vs-container-switcher",
1463
1463
  props: {
1464
1464
  title: {
@@ -1475,34 +1475,34 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1475
1475
  }
1476
1476
  },
1477
1477
  setup(o) {
1478
- const e = o, t = k(e.isOpen);
1479
- return re(
1478
+ const e = o, t = x(e.isOpen);
1479
+ return ue(
1480
1480
  () => e.isOpen,
1481
- (n) => {
1482
- t.value = n;
1481
+ (r) => {
1482
+ t.value = r;
1483
1483
  }
1484
- ), (n, s) => (i(), u("div", null, [
1485
- l("div", Oo, [
1486
- l("p", Do, F(o.title), 1),
1487
- j(ot, {
1484
+ ), (r, s) => (i(), u("div", null, [
1485
+ l("div", Do, [
1486
+ l("p", Uo, F(o.title), 1),
1487
+ I(lt, {
1488
1488
  modelValue: t.value,
1489
- "onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
1490
- style: ve(o.style)
1489
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
1490
+ style: we(o.style)
1491
1491
  }, null, 8, ["modelValue", "style"])
1492
1492
  ]),
1493
- j(tt, { name: "slide-fade" }, {
1493
+ I(et, { name: "slide-fade" }, {
1494
1494
  default: Me(() => [
1495
- q(l("div", Uo, [
1496
- me(n.$slots, "default", {}, void 0, !0)
1495
+ X(l("div", To, [
1496
+ ke(r.$slots, "default", {}, void 0, !0)
1497
1497
  ], 512), [
1498
- [Ue, t.value]
1498
+ [Pe, t.value]
1499
1499
  ])
1500
1500
  ]),
1501
1501
  _: 3
1502
1502
  })
1503
1503
  ]));
1504
1504
  }
1505
- }), Ro = /* @__PURE__ */ R(To, [["__scopeId", "data-v-90320b87"]]), Po = { class: "text-[16px] text-gray-900 font-medium" }, No = { class: "grid gap-3" }, Ho = /* @__PURE__ */ A({
1505
+ }), Po = /* @__PURE__ */ P(Ro, [["__scopeId", "data-v-90320b87"]]), No = { class: "text-[16px] text-gray-900 font-medium" }, Ho = { class: "grid gap-3" }, qo = /* @__PURE__ */ E({
1506
1506
  __name: "vs-container-accordion",
1507
1507
  props: {
1508
1508
  title: {
@@ -1519,36 +1519,36 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1519
1519
  }
1520
1520
  },
1521
1521
  setup(o) {
1522
- const e = o, t = k(e.isOpen);
1523
- return re(
1522
+ const e = o, t = x(e.isOpen);
1523
+ return ue(
1524
1524
  () => e.isOpen,
1525
- (n) => {
1526
- t.value = n;
1525
+ (r) => {
1526
+ t.value = r;
1527
1527
  }
1528
- ), (n, s) => (i(), u("div", null, [
1528
+ ), (r, s) => (i(), u("div", null, [
1529
1529
  l("button", {
1530
1530
  type: "button",
1531
- onClick: s[0] || (s[0] = (a) => t.value = !t.value),
1531
+ onClick: s[0] || (s[0] = (n) => t.value = !t.value),
1532
1532
  class: "flex items-center gap-2"
1533
1533
  }, [
1534
- j(H(Zt), {
1535
- class: S(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1534
+ I(G(Wt), {
1535
+ class: M(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1536
1536
  }, null, 8, ["class"]),
1537
- l("span", Po, F(o.title), 1)
1537
+ l("span", No, F(o.title), 1)
1538
1538
  ]),
1539
- j(tt, { name: "slide-fade" }, {
1539
+ I(et, { name: "slide-fade" }, {
1540
1540
  default: Me(() => [
1541
- q(l("div", No, [
1542
- me(n.$slots, "default", {}, void 0, !0)
1541
+ X(l("div", Ho, [
1542
+ ke(r.$slots, "default", {}, void 0, !0)
1543
1543
  ], 512), [
1544
- [Ue, t.value]
1544
+ [Pe, t.value]
1545
1545
  ])
1546
1546
  ]),
1547
1547
  _: 3
1548
1548
  })
1549
1549
  ]));
1550
1550
  }
1551
- }), qo = /* @__PURE__ */ R(Ho, [["__scopeId", "data-v-590eff11"]]), Go = { class: "flex items-center justify-between" }, Jo = /* @__PURE__ */ A({
1551
+ }), Go = /* @__PURE__ */ P(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */ E({
1552
1552
  __name: "vs-container-default",
1553
1553
  props: {
1554
1554
  title: {
@@ -1562,17 +1562,17 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1562
1562
  },
1563
1563
  setup(o) {
1564
1564
  return (e, t) => (i(), u("div", null, [
1565
- l("div", Go, [
1565
+ l("div", Jo, [
1566
1566
  l("p", null, F(o.title), 1)
1567
1567
  ]),
1568
- me(e.$slots, "default")
1568
+ ke(e.$slots, "default")
1569
1569
  ]));
1570
1570
  }
1571
- }), Ko = {
1572
- switcher: Ro,
1573
- accordion: qo,
1574
- default: Jo
1575
- }, le = {
1571
+ }), Zo = {
1572
+ switcher: Po,
1573
+ accordion: Go,
1574
+ default: Ko
1575
+ }, se = {
1576
1576
  Equal: "==",
1577
1577
  Inequal: "!=",
1578
1578
  Higer: ">",
@@ -1585,37 +1585,37 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1585
1585
  Contain: "*",
1586
1586
  In: "in",
1587
1587
  NotIn: "not_in"
1588
- }, Zo = (o, e) => String(o) === String(e), Wo = (o, e) => String(o) !== String(e), Qo = (o, e) => o > e, Xo = (o, e) => o >= e, Yo = (o, e) => o < e, ea = (o, e) => o <= e, ta = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, la = (o, e) => String(o).startsWith(String(e)), oa = (o, e) => String(o).endsWith(String(e)), aa = (o, e) => String(o).includes(String(e)), sa = (o, e) => Array.isArray(e) ? e.includes(o) : !1, ra = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, st = (o, e) => {
1588
+ }, Wo = (o, e) => String(o) === String(e), Qo = (o, e) => String(o) !== String(e), Xo = (o, e) => o > e, Yo = (o, e) => o >= e, ea = (o, e) => o < e, ta = (o, e) => o <= e, la = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, oa = (o, e) => String(o).startsWith(String(e)), aa = (o, e) => String(o).endsWith(String(e)), sa = (o, e) => String(o).includes(String(e)), ra = (o, e) => Array.isArray(e) ? e.includes(o) : !1, na = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, at = (o, e) => {
1589
1589
  if (!e) return !0;
1590
1590
  switch (e?.[1]) {
1591
- case le.Equal:
1592
- return Zo(o, e?.[2]);
1593
- case le.Inequal:
1591
+ case se.Equal:
1594
1592
  return Wo(o, e?.[2]);
1595
- case le.Higer:
1593
+ case se.Inequal:
1596
1594
  return Qo(o, e?.[2]);
1597
- case le.HigerOrEqual:
1595
+ case se.Higer:
1598
1596
  return Xo(o, e?.[2]);
1599
- case le.Lower:
1597
+ case se.HigerOrEqual:
1600
1598
  return Yo(o, e?.[2]);
1601
- case le.LowerOrEqual:
1599
+ case se.Lower:
1602
1600
  return ea(o, e?.[2]);
1603
- case le.Between:
1601
+ case se.LowerOrEqual:
1604
1602
  return ta(o, e?.[2]);
1605
- case le.StartWith:
1603
+ case se.Between:
1606
1604
  return la(o, e?.[2]);
1607
- case le.EndWith:
1605
+ case se.StartWith:
1608
1606
  return oa(o, e?.[2]);
1609
- case le.Contain:
1607
+ case se.EndWith:
1610
1608
  return aa(o, e?.[2]);
1611
- case le.In:
1609
+ case se.Contain:
1612
1610
  return sa(o, e?.[2]);
1613
- case le.NotIn:
1611
+ case se.In:
1614
1612
  return ra(o, e?.[2]);
1613
+ case se.NotIn:
1614
+ return na(o, e?.[2]);
1615
1615
  default:
1616
1616
  return !0;
1617
1617
  }
1618
- }, na = /* @__PURE__ */ A({
1618
+ }, ia = /* @__PURE__ */ E({
1619
1619
  __name: "vs-input-container",
1620
1620
  props: {
1621
1621
  style: {
@@ -1636,32 +1636,32 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1636
1636
  }
1637
1637
  },
1638
1638
  setup(o) {
1639
- const e = o, t = Be("formValues", { default: {} }), n = Be("form"), s = D(() => e.schema?.filter((r) => {
1640
- const d = r?.conditions;
1639
+ const e = o, t = ze("formValues", { default: {} }), r = ze("form"), s = T(() => e.schema?.filter((a) => {
1640
+ const d = a?.conditions;
1641
1641
  if (!d) return !0;
1642
1642
  const p = Array.isArray(d) ? d[0] : d, f = t?.value?.[p];
1643
- return st(f, d);
1644
- })), a = D(() => Ko[e.view]);
1645
- return (r, d) => o.schema?.length ? (i(), X(we(a.value), {
1643
+ return at(f, d);
1644
+ })), n = T(() => Zo[e.view]);
1645
+ return (a, d) => o.schema?.length ? (i(), te(Ve(n.value), {
1646
1646
  key: 0,
1647
1647
  title: o.title,
1648
- style: ve(o.style)
1648
+ style: we(o.style)
1649
1649
  }, {
1650
1650
  default: Me(() => [
1651
- (i(!0), u(K, null, Y(s.value, (p) => (i(), X(rt, Ve({
1651
+ (i(!0), u(ee, null, le(s.value, (p) => (i(), te(st, je({
1652
1652
  key: p.name
1653
1653
  }, { ref_for: !0 }, p, {
1654
1654
  item: p,
1655
- modelValue: H(t)[p.name],
1656
- "onUpdate:modelValue": (f) => H(t)[p.name] = f,
1655
+ modelValue: G(t)[p.name],
1656
+ "onUpdate:modelValue": (f) => G(t)[p.name] = f,
1657
1657
  style: o.style,
1658
- error: H(n)?.errors?.[p.name]
1658
+ error: G(r)?.errors?.[p.name]
1659
1659
  }), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
1660
1660
  ]),
1661
1661
  _: 1
1662
- }, 8, ["title", "style"])) : B("", !0);
1662
+ }, 8, ["title", "style"])) : z("", !0);
1663
1663
  }
1664
- }), ia = { class: "p-4 mim-h-0 h-full overflow-auto" }, ua = /* @__PURE__ */ A({
1664
+ }), ua = { class: "relative" }, da = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ca = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, pa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, fa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, va = { class: "p-4 mim-h-0 h-full overflow-auto" }, ma = /* @__PURE__ */ E({
1665
1665
  __name: "modal-edit",
1666
1666
  props: {
1667
1667
  schema: {},
@@ -1672,11 +1672,11 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1672
1672
  },
1673
1673
  emits: ["close", "save", "edit"],
1674
1674
  setup(o, { emit: e }) {
1675
- const t = o, n = e, s = k(t.schema), a = k(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = k({}), d = k(), p = k(t.mode);
1675
+ const t = o, r = e, s = x(t.schema), n = x(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), a = x({}), d = x(), p = x(t.mode);
1676
1676
  async function f() {
1677
- const g = r.value.validate();
1678
- if (g) {
1679
- fe({ type: "warning", title: "Помилка валідації", message: Object.entries(g).map(([v, M]) => `${v}: ${M}`).join(`
1677
+ const b = a.value.validate();
1678
+ if (b) {
1679
+ me({ type: "warning", title: "Помилка валідації", message: Object.entries(b).map(([v, C]) => `${v}: ${C}`).join(`
1680
1680
  `) });
1681
1681
  return;
1682
1682
  }
@@ -1687,106 +1687,133 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1687
1687
  headers: {
1688
1688
  "Content-Type": "application/json"
1689
1689
  },
1690
- body: JSON.stringify(a.value)
1690
+ body: JSON.stringify(n.value)
1691
1691
  });
1692
1692
  if (v.ok)
1693
- await v.json(), fe({
1693
+ await v.json(), me({
1694
1694
  type: "success",
1695
1695
  title: "Успішно",
1696
1696
  message: `Дані успішно ${p.value === "add" ? "збережено" : "оновлено"}`
1697
- }), n("save", a.value);
1697
+ }), r("save", n.value);
1698
1698
  else if (v.status === 400) {
1699
- const M = await v.json().catch(() => ({}));
1700
- fe({
1699
+ const C = await v.json().catch(() => ({}));
1700
+ me({
1701
1701
  type: "warning",
1702
1702
  title: "Помилка валідації",
1703
- message: M.message || "Некоректні дані (400)"
1703
+ message: C.message || "Некоректні дані (400)"
1704
1704
  });
1705
- } else v.status === 500 ? fe({
1705
+ } else v.status === 500 ? me({
1706
1706
  type: "error",
1707
1707
  title: "Серверна помилка",
1708
1708
  message: "Виникла помилка на сервері (500)"
1709
- }) : fe({
1709
+ }) : me({
1710
1710
  type: "error",
1711
1711
  title: "Помилка",
1712
1712
  message: `Статус: ${v.status}`
1713
1713
  });
1714
1714
  } catch (v) {
1715
- fe({
1715
+ me({
1716
1716
  type: "error",
1717
1717
  title: "Помилка з’єднання",
1718
1718
  message: v.message || "Не вдалося виконати запит"
1719
1719
  });
1720
1720
  }
1721
- else
1722
- n("save", a.value);
1723
1721
  }
1724
1722
  function c() {
1725
- n("close");
1723
+ r("close");
1726
1724
  }
1727
- return ne(async () => {
1725
+ return pe(async () => {
1728
1726
  if (t.form) {
1729
- const g = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1730
- s.value = g.schema, d.value = g.token;
1727
+ const b = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1728
+ s.value = b.schema, d.value = b.token;
1731
1729
  } else if (t.token) {
1732
1730
  d.value = t.token;
1733
- const g = await fetch(`/api/form/${d.value}`).then((v) => v.json());
1734
- s.value = g.schema, g.data ? a.value = g.data : p.value = "add";
1731
+ const b = await fetch(`/api/form/${d.value}`).then((v) => v.json());
1732
+ s.value = b.schema, b.data ? n.value = b.data : p.value = "add";
1735
1733
  }
1736
- }), (g, v) => (i(), u(K, null, [
1737
- l("div", ia, [
1738
- s.value ? (i(), X(Ee, {
1739
- key: 0,
1740
- schema: s.value,
1741
- values: a.value,
1742
- "onUpdate:values": v[0] || (v[0] = (M) => a.value = M),
1743
- form: r.value,
1744
- "onUpdate:form": v[1] || (v[1] = (M) => r.value = M)
1745
- }, null, 8, ["schema", "values", "form"])) : B("", !0)
1746
- ]),
1747
- l("div", { class: "vs-form__head mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
1748
- l("button", {
1749
- type: "button",
1750
- onClick: c,
1751
- class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
1752
- }, " Скасувати "),
1753
- l("button", {
1754
- onClick: f,
1755
- type: "button",
1756
- class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
1757
- }, " Зберегти ")
1734
+ }), (b, v) => (i(), u("div", ua, [
1735
+ l("div", da, [
1736
+ l("div", ca, [
1737
+ l("div", pa, [
1738
+ l("h3", fa, F(p.value === "add" ? "Додати" : "Змінити"), 1),
1739
+ l("button", {
1740
+ onClick: c,
1741
+ type: "button",
1742
+ class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
1743
+ }, v[2] || (v[2] = [
1744
+ l("span", { class: "sr-only" }, "Close", -1),
1745
+ l("svg", {
1746
+ class: "flex-shrink-0 w-4 h-4",
1747
+ xmlns: "http://www.w3.org/2000/svg",
1748
+ width: "24",
1749
+ height: "24",
1750
+ viewBox: "0 0 24 24",
1751
+ fill: "none",
1752
+ stroke: "currentColor",
1753
+ "stroke-width": "2",
1754
+ "stroke-linecap": "round",
1755
+ "stroke-linejoin": "round"
1756
+ }, [
1757
+ l("path", { d: "M18 6 6 18" }),
1758
+ l("path", { d: "m6 6 12 12" })
1759
+ ], -1)
1760
+ ]))
1761
+ ]),
1762
+ l("div", va, [
1763
+ s.value ? (i(), te(Oe, {
1764
+ key: 0,
1765
+ schema: s.value,
1766
+ values: n.value,
1767
+ "onUpdate:values": v[0] || (v[0] = (C) => n.value = C),
1768
+ form: a.value,
1769
+ "onUpdate:form": v[1] || (v[1] = (C) => a.value = C)
1770
+ }, null, 8, ["schema", "values", "form"])) : z("", !0)
1771
+ ]),
1772
+ l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
1773
+ l("button", {
1774
+ type: "button",
1775
+ onClick: c,
1776
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
1777
+ }, " Скасувати "),
1778
+ l("button", {
1779
+ onClick: f,
1780
+ type: "button",
1781
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
1782
+ }, " Зберегти ")
1783
+ ])
1784
+ ])
1758
1785
  ])
1759
- ], 64));
1786
+ ]));
1760
1787
  }
1761
- }), Le = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1788
+ }), De = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1762
1789
  const { close: t } = ft({
1763
1790
  title: o.mode === "add" ? "Додати" : "Редагувати",
1764
1791
  template: "",
1765
1792
  visible: !0,
1766
1793
  size: "medium",
1767
1794
  closeClickBack: !0,
1768
- content: ua,
1795
+ content: ma,
1769
1796
  contentProps: {
1770
1797
  ...o,
1771
1798
  onClose: () => {
1772
1799
  e(null), t();
1773
1800
  },
1774
- onSave: (n) => {
1775
- e(n), t();
1801
+ onSave: (r) => {
1802
+ e(r), t();
1776
1803
  }
1777
1804
  }
1778
1805
  });
1779
- }), da = ["aria-expanded", "data-focus"], ca = { class: "flex items-center" }, pa = { class: "truncate text-gray-900 overflow-hidden" }, fa = ["onClick"], va = ["title"], ma = {
1806
+ }), ha = ["aria-expanded", "data-focus"], ga = { class: "flex items-center" }, ba = ["title"], ya = ["onClick"], xa = ["title"], wa = {
1780
1807
  key: 2,
1781
1808
  class: "text-gray-500 truncate"
1782
- }, ha = { class: "flex-1 min-w-[2px]" }, ga = ["placeholder"], ba = { class: "flex items-center shrink-0" }, ya = ["disabled"], xa = ["disabled"], wa = {
1809
+ }, ka = { class: "flex-1 min-w-[2px]" }, _a = ["placeholder"], $a = { class: "flex items-center shrink-0" }, Ca = ["disabled"], Va = ["disabled"], Ma = {
1783
1810
  key: 0,
1784
1811
  class: "absolute z-10 w-full mt-2 rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
1785
1812
  role: "listbox"
1786
- }, ka = ["aria-disabled", "onClick"], _a = {
1813
+ }, La = ["aria-disabled", "onClick"], Sa = {
1787
1814
  key: 1,
1788
1815
  class: "px-3 py-2 text-center text-gray-500"
1789
- }, $a = ["disabled"], Ca = /* @__PURE__ */ A({
1816
+ }, Ba = ["disabled"], ja = /* @__PURE__ */ E({
1790
1817
  __name: "vs-input-select",
1791
1818
  props: {
1792
1819
  multiple: { type: Boolean, default: !1 },
@@ -1810,147 +1837,147 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1810
1837
  },
1811
1838
  emits: ["change", "update:modelValue"],
1812
1839
  setup(o, { emit: e }) {
1813
- const t = o, n = e, s = D(() => t.multiple), a = D(() => t.disabled);
1814
- he(t.style);
1815
- const r = D({
1840
+ const t = o, r = e, s = T(() => t.multiple), n = T(() => t.disabled);
1841
+ _e(t.style);
1842
+ const a = T({
1816
1843
  get: () => t.modelValue,
1817
- set: (y) => n("update:modelValue", y)
1844
+ set: (w) => r("update:modelValue", w)
1818
1845
  });
1819
- !r.value && t.defaultValue && (r.value = t.defaultValue);
1820
- const d = k(null), p = k(null), f = k(null), c = k(!1), g = k(!1), v = k(null), M = k([]), I = k(-1), U = k([]), T = k(""), P = k(null), _ = k([]), x = D(() => {
1821
- if (!_.value.length) return [];
1822
- const y = new Map(M.value.map((w) => [w.id?.toString(), w]));
1823
- return _.value.map((w) => y.get(w?.toString())).filter((w) => !!w);
1824
- }), h = D(() => t.placeholder || "Select..."), G = D(() => s.value ? !_.value.length && T.value === "" : !v.value?.text && T.value === ""), C = D(() => a.value ? !1 : s.value ? _.value.length > 0 : !!r.value), m = (y) => s.value ? _.value.some((w) => w?.toString() === y?.toString()) : r.value?.toString() === y?.toString(), V = D(() => {
1825
- let y = M.value ?? [];
1826
- if (T.value.trim() !== "") {
1827
- const w = T.value.toLowerCase();
1828
- y = y.filter((z) => z.text?.toLowerCase?.().includes(w));
1846
+ !a.value && t.defaultValue && (a.value = t.defaultValue);
1847
+ const d = x(null), p = x(null), f = x(null), c = x(!1), b = x(!1), v = x(null), C = x([]), V = x(-1), D = x([]), U = x(""), N = x(null), $ = x([]), h = T(() => {
1848
+ if (!$.value.length) return [];
1849
+ const w = new Map(C.value.map((k) => [k.id?.toString(), k]));
1850
+ return $.value.map((k) => w.get(k?.toString())).filter((k) => !!k);
1851
+ }), g = T(() => t.placeholder || "Select..."), K = T(() => s.value ? !$.value.length && U.value === "" : !v.value?.text && U.value === ""), A = T(() => n.value ? !1 : s.value ? $.value.length > 0 : !!a.value), S = (w) => s.value ? $.value.some((k) => k?.toString() === w?.toString()) : a.value?.toString() === w?.toString(), J = T(() => {
1852
+ let w = C.value ?? [];
1853
+ if (U.value.trim() !== "") {
1854
+ const k = U.value.toLowerCase();
1855
+ w = w.filter((O) => O.text?.toLowerCase?.().includes(k));
1829
1856
  }
1830
- if (s.value && _.value.length) {
1831
- const w = new Set(_.value.map((z) => z?.toString()));
1832
- y = y.filter((z) => !w.has(z.id?.toString()));
1857
+ if (s.value && $.value.length) {
1858
+ const k = new Set($.value.map((O) => O?.toString()));
1859
+ w = w.filter((O) => !k.has(O.id?.toString()));
1833
1860
  }
1834
- return y;
1835
- }), E = async (y) => {
1861
+ return w;
1862
+ }), Y = async (w) => {
1836
1863
  if (!t.data) return [];
1837
1864
  try {
1838
- const w = t.api ? t.api : `/suggest/${t.data}`, z = "?json=1", J = y ? `&val=${encodeURIComponent(y)}` : "";
1839
- return (await fetch(w.concat(z, J)).then((xe) => xe.json())).data ?? [];
1865
+ const k = t.api ? t.api : `/suggest/${t.data}`, O = "?json=1", Z = w ? `&val=${encodeURIComponent(w)}` : "";
1866
+ return (await fetch(k.concat(O, Z)).then((Ce) => Ce.json())).data ?? [];
1840
1867
  } catch {
1841
1868
  return [];
1842
1869
  }
1843
- }, Q = async () => {
1844
- t.options?.length ? M.value = [...t.options] : t.data && (M.value = await E(T.value));
1845
- }, te = async (y) => {
1846
- if (y == null) return null;
1847
- const w = M.value?.find((J) => J?.id?.toString() === String(y));
1848
- return w || ((await E(String(y)))?.[0] ?? null);
1849
- }, ye = async (y) => {
1850
- const w = new Set(M.value.map((J) => J.id?.toString())), z = y.filter((J) => !w.has(J?.toString()));
1851
- z.length && await z.reduce(async (J, pe) => {
1852
- await J;
1853
- const xe = await te(pe);
1854
- xe && M.value.push(xe);
1870
+ }, ae = async () => {
1871
+ t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y(U.value));
1872
+ }, $e = async (w) => {
1873
+ if (w == null) return null;
1874
+ const k = C.value?.find((Z) => Z?.id?.toString() === String(w));
1875
+ return k || ((await Y(String(w)))?.[0] ?? null);
1876
+ }, Le = async (w) => {
1877
+ const k = new Set(C.value.map((Z) => Z.id?.toString())), O = w.filter((Z) => !k.has(Z?.toString()));
1878
+ O.length && await O.reduce(async (Z, xe) => {
1879
+ await Z;
1880
+ const Ce = await $e(xe);
1881
+ Ce && C.value.push(Ce);
1855
1882
  }, Promise.resolve());
1856
- }, ke = async () => {
1857
- a.value || (c.value = !0, await Q(), await Ce(() => {
1858
- P.value?.focus(), V.value.length ? I.value = 0 : I.value = -1;
1883
+ }, B = async () => {
1884
+ n.value || (c.value = !0, await ae(), await Be(() => {
1885
+ N.value?.focus(), J.value.length ? V.value = 0 : V.value = -1;
1859
1886
  }));
1860
- }, ue = () => {
1861
- c.value = !1, I.value = -1;
1862
- }, ze = async (y) => {
1863
- if (a.value) return;
1864
- !c.value ? await ke() : ue();
1865
- }, _e = async () => {
1866
- c.value ? P.value?.focus() : await ke();
1867
- }, b = () => {
1868
- s.value ? (_.value = [], r.value = [], n("change", [])) : (v.value = null, r.value = null, n("change", null)), T.value = "", Ce(() => P.value?.focus());
1869
- }, $ = (y) => {
1870
- s.value && (_.value = _.value.filter((w) => w?.toString() !== y?.toString()), r.value = [..._.value], n("change", r.value), Ce(() => P.value?.focus()));
1871
- }, O = (y) => {
1872
- s.value ? (m(y.id) || (_.value = [..._.value, y.id], r.value = [..._.value], n("change", r.value)), T.value = "", Ce(() => {
1873
- P.value?.focus(), I.value = Math.min(I.value, V.value.length - 1);
1874
- })) : (v.value = y, r.value = y.id, n("change", r.value), T.value = "", ue());
1875
- }, N = (y) => {
1876
- m(y.id) || O(y);
1877
- }, ee = (y, w) => {
1878
- if (!y || !w) return;
1879
- const z = y.offsetTop, J = z + y.offsetHeight, pe = w.scrollTop, xe = pe + w.clientHeight;
1880
- let Ae = w.scrollTop;
1881
- z < pe ? Ae = z - 80 : J > xe && (Ae = J - w.clientHeight + 4);
1882
- const ut = w;
1883
- ut.scrollTop = Ae;
1884
- }, $e = async (y) => {
1885
- a.value || !c.value && (y.key === "ArrowDown" || y.key === "ArrowUp") && (y.preventDefault(), await ke());
1886
- }, de = (y) => {
1887
+ }, _ = () => {
1888
+ c.value = !1, V.value = -1;
1889
+ }, j = async (w) => {
1890
+ if (n.value) return;
1891
+ !c.value ? await B() : _();
1892
+ }, q = async () => {
1893
+ c.value ? N.value?.focus() : await B();
1894
+ }, oe = () => {
1895
+ s.value ? ($.value = [], a.value = [], r("change", [])) : (v.value = null, a.value = null, r("change", null)), U.value = "", Be(() => N.value?.focus());
1896
+ }, he = (w) => {
1897
+ s.value && ($.value = $.value.filter((k) => k?.toString() !== w?.toString()), a.value = [...$.value], r("change", a.value), Be(() => N.value?.focus()));
1898
+ }, de = (w) => {
1899
+ s.value ? (S(w.id) || ($.value = [...$.value, w.id], a.value = [...$.value], r("change", a.value)), U.value = "", Be(() => {
1900
+ N.value?.focus(), V.value = Math.min(V.value, J.value.length - 1);
1901
+ })) : (v.value = w, a.value = w.id, r("change", a.value), U.value = "", _());
1902
+ }, m = (w) => {
1903
+ S(w.id) || de(w);
1904
+ }, y = (w, k) => {
1905
+ if (!w || !k) return;
1906
+ const O = w.offsetTop, Z = O + w.offsetHeight, xe = k.scrollTop, Ce = xe + k.clientHeight;
1907
+ let Fe = k.scrollTop;
1908
+ O < xe ? Fe = O - 80 : Z > Ce && (Fe = Z - k.clientHeight + 4);
1909
+ const it = k;
1910
+ it.scrollTop = Fe;
1911
+ }, R = async (w) => {
1912
+ n.value || !c.value && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), await B());
1913
+ }, H = (w) => {
1887
1914
  if (!c.value) return;
1888
- const { key: w } = y;
1889
- if (w === "ArrowDown")
1890
- y.preventDefault(), I.value + 1 < V.value.length && (I.value += 1, ee(U.value[I.value], f.value));
1891
- else if (w === "ArrowUp")
1892
- y.preventDefault(), I.value > 0 && (I.value -= 1, ee(U.value[I.value], f.value));
1893
- else if (w === "Enter") {
1894
- y.preventDefault();
1895
- const z = V.value[I.value];
1896
- z && O(z);
1897
- } else w === "Escape" ? (y.preventDefault(), ue()) : w === "Backspace" ? s.value && T.value === "" && _.value.length && (_.value = _.value.slice(0, -1), r.value = [..._.value], n("change", r.value)) : w === "Home" ? (I.value = 0, ee(U.value[0], f.value)) : w === "End" ? (I.value = V.value.length - 1, ee(U.value[I.value], f.value)) : w === "Tab" && ue();
1898
- }, ge = () => {
1899
- a.value || (g.value = !0);
1900
- }, be = () => {
1901
- g.value = !1, T.value = "";
1902
- }, ce = (y) => {
1903
- y.key === "Escape" && c.value && ue();
1904
- }, Te = (y) => {
1905
- d.value && (d.value.contains(y.target) || ue());
1906
- }, Re = (y) => {
1907
- c.value && f.value && !f.value.contains(y.target) && ue();
1915
+ const { key: k } = w;
1916
+ if (k === "ArrowDown")
1917
+ w.preventDefault(), V.value + 1 < J.value.length && (V.value += 1, y(D.value[V.value], f.value));
1918
+ else if (k === "ArrowUp")
1919
+ w.preventDefault(), V.value > 0 && (V.value -= 1, y(D.value[V.value], f.value));
1920
+ else if (k === "Enter") {
1921
+ w.preventDefault();
1922
+ const O = J.value[V.value];
1923
+ O && de(O);
1924
+ } else k === "Escape" ? (w.preventDefault(), _()) : k === "Backspace" ? s.value && U.value === "" && $.value.length && ($.value = $.value.slice(0, -1), a.value = [...$.value], r("change", a.value)) : k === "Home" ? (V.value = 0, y(D.value[0], f.value)) : k === "End" ? (V.value = J.value.length - 1, y(D.value[V.value], f.value)) : k === "Tab" && _();
1925
+ }, ne = () => {
1926
+ n.value || (b.value = !0);
1927
+ }, Se = () => {
1928
+ b.value = !1, U.value = "";
1929
+ }, ve = (w) => {
1930
+ w.key === "Escape" && c.value && _();
1931
+ }, ge = (w) => {
1932
+ d.value && (d.value.contains(w.target) || _());
1933
+ }, be = (w) => {
1934
+ c.value && f.value && !f.value.contains(w.target) && _();
1908
1935
  };
1909
- re(() => t.options, (y) => {
1910
- y?.length && (M.value = [...y]);
1936
+ ue(() => t.options, (w) => {
1937
+ w?.length && (C.value = [...w]);
1911
1938
  }, { immediate: !0 });
1912
- const Pe = async () => {
1939
+ const ye = async () => {
1913
1940
  if (s.value)
1914
- Array.isArray(r.value) ? _.value = [...r.value] : (_.value = r.value == null ? [] : [r.value], r.value = [..._.value]), !t.options?.length && t.data && await ye(_.value);
1941
+ Array.isArray(a.value) ? $.value = [...a.value] : ($.value = a.value == null ? [] : [a.value], a.value = [...$.value]), !t.options?.length && t.data && await Le($.value);
1915
1942
  else {
1916
- if (Array.isArray(r.value)) {
1917
- const y = r.value[0] ?? null;
1918
- r.value = y ?? null;
1943
+ if (Array.isArray(a.value)) {
1944
+ const w = a.value[0] ?? null;
1945
+ a.value = w ?? null;
1919
1946
  }
1920
- v.value = await te(r.value);
1947
+ v.value = await $e(a.value);
1921
1948
  }
1922
1949
  };
1923
- re(r, () => {
1924
- Pe();
1925
- }), ne(async () => {
1926
- addEventListener("keydown", ce), addEventListener("scroll", Re, !0), document.addEventListener("click", Te, !0), t.options?.length ? M.value = [...t.options] : t.data && (M.value = await E("")), await Pe();
1927
- }), Fe(() => {
1928
- removeEventListener("keydown", ce), removeEventListener("scroll", Re, !0), document.removeEventListener("click", Te, !0);
1950
+ ue(a, () => {
1951
+ ye();
1952
+ }), pe(async () => {
1953
+ addEventListener("keydown", ve), addEventListener("scroll", be, !0), document.addEventListener("click", ge, !0), t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y("")), await ye();
1954
+ }), Ue(() => {
1955
+ removeEventListener("keydown", ve), removeEventListener("scroll", be, !0), document.removeEventListener("click", ge, !0);
1929
1956
  });
1930
- async function it() {
1957
+ async function nt() {
1931
1958
  if (!t.add) return;
1932
- const y = await Le({ form: t.add.form, mode: "add" });
1933
- y && (await fetch(`/api/table/${t.add.token}`, {
1959
+ const w = await De({ form: t.add.form, mode: "add" });
1960
+ w && (await fetch(`/api/table/${t.add.token}`, {
1934
1961
  method: "POST",
1935
1962
  headers: { "Content-Type": "application/json" },
1936
- body: JSON.stringify(y)
1937
- }).then((w) => w.json()), !t.options?.length && t.data && (M.value = await E(T.value)));
1963
+ body: JSON.stringify(w)
1964
+ }).then((k) => k.json()), !t.options?.length && t.data && (C.value = await Y(U.value)));
1938
1965
  }
1939
- return (y, w) => (i(), u("div", {
1966
+ return (w, k) => (i(), u("div", {
1940
1967
  class: "flex gap-1 w-full",
1941
1968
  ref_key: "selectRoot",
1942
1969
  ref: d,
1943
- onClick: w[2] || (w[2] = se(() => {
1970
+ onClick: k[2] || (k[2] = ce(() => {
1944
1971
  }, ["stop"]))
1945
1972
  }, [
1946
1973
  l("div", {
1947
- class: S(["relative w-full font-sans", t.customClass])
1974
+ class: M(["relative w-full font-sans", t.customClass])
1948
1975
  }, [
1949
- w[7] || (w[7] = l("span", {
1976
+ k[7] || (k[7] = l("span", {
1950
1977
  id: "react-select-live-region",
1951
1978
  class: "sr-only"
1952
1979
  }, null, -1)),
1953
- w[8] || (w[8] = l("span", {
1980
+ k[8] || (k[8] = l("span", {
1954
1981
  "aria-live": "polite",
1955
1982
  "aria-atomic": "false",
1956
1983
  "aria-relevant": "additions text",
@@ -1958,45 +1985,44 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
1958
1985
  class: "sr-only"
1959
1986
  }, null, -1)),
1960
1987
  l("div", {
1961
- class: S([
1988
+ class: M([
1962
1989
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
1963
1990
  "border-gray-300 hover:border-gray-400",
1964
- c.value || g.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1965
- a.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1991
+ c.value || b.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1992
+ n.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1966
1993
  ]),
1967
1994
  role: "combobox",
1968
1995
  "aria-expanded": c.value,
1969
1996
  "aria-haspopup": "listbox",
1970
- onKeydown: $e,
1971
- onClick: _e,
1972
- "data-focus": c.value || g.value ? "true" : "false"
1997
+ onKeydown: R,
1998
+ onClick: q,
1999
+ "data-focus": c.value || b.value ? "true" : "false"
1973
2000
  }, [
1974
2001
  l("div", {
1975
2002
  class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
1976
2003
  ref_key: "triggerRef",
1977
2004
  ref: p
1978
2005
  }, [
1979
- s.value && _.value.length ? (i(!0), u(K, { key: 0 }, Y(x.value, (z) => (i(), u("div", {
2006
+ s.value && $.value.length ? (i(!0), u(ee, { key: 0 }, le(h.value, (O) => (i(), u("div", {
1980
2007
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
1981
- key: z.id
2008
+ key: O.id
1982
2009
  }, [
1983
- l("div", ca, [
1984
- z?.color ? (i(), u("span", {
2010
+ l("div", ga, [
2011
+ O?.color ? (i(), u("span", {
1985
2012
  key: 0,
1986
2013
  class: "w-[16px] h-[16px] rounded-md block ml-1.5",
1987
- style: ve({ backgroundColor: z?.color })
1988
- }, null, 4)) : B("", !0),
1989
- q((i(), u("div", pa, [
1990
- oe(F(z.text), 1)
1991
- ])), [
1992
- [H(qe), z.text]
1993
- ])
2014
+ style: we({ backgroundColor: O?.color })
2015
+ }, null, 4)) : z("", !0),
2016
+ l("div", {
2017
+ class: "truncate text-gray-900 overflow-hidden",
2018
+ title: O.text
2019
+ }, F(O.text), 9, ba)
1994
2020
  ]),
1995
2021
  l("div", {
1996
2022
  role: "button",
1997
2023
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
1998
- onClick: se((J) => $(z.id), ["stop"])
1999
- }, w[3] || (w[3] = [
2024
+ onClick: ce((Z) => he(O.id), ["stop"])
2025
+ }, k[3] || (k[3] = [
2000
2026
  l("svg", {
2001
2027
  height: "14",
2002
2028
  width: "14",
@@ -2007,29 +2033,27 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2007
2033
  }, [
2008
2034
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2009
2035
  ], -1)
2010
- ]), 8, fa)
2011
- ]))), 128)) : !s.value && !g.value && v.value?.text && T.value === "" ? q((i(), u("div", {
2036
+ ]), 8, ya)
2037
+ ]))), 128)) : !s.value && !b.value && v.value?.text && U.value === "" ? (i(), u("div", {
2012
2038
  key: 1,
2013
- class: S(["truncate text-gray-900"]),
2039
+ class: M(["truncate text-gray-900"]),
2014
2040
  title: v.value.text
2015
2041
  }, [
2016
2042
  v.value?.color ? (i(), u("span", {
2017
2043
  key: 0,
2018
2044
  class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2019
- style: ve({ backgroundColor: v.value?.color })
2020
- }, null, 4)) : B("", !0),
2045
+ style: we({ backgroundColor: v.value?.color })
2046
+ }, null, 4)) : z("", !0),
2021
2047
  l("span", {
2022
- class: S({ "pl-5": v.value?.color })
2048
+ class: M({ "pl-5": v.value?.color })
2023
2049
  }, F(v.value.text), 3)
2024
- ], 8, va)), [
2025
- [H(qe), v.value.text]
2026
- ]) : B("", !0),
2027
- G.value ? (i(), u("div", ma, F(h.value), 1)) : B("", !0),
2028
- l("div", ha, [
2029
- !a.value && y.search ? q((i(), u("input", {
2050
+ ], 8, xa)) : z("", !0),
2051
+ K.value ? (i(), u("div", wa, F(g.value), 1)) : z("", !0),
2052
+ l("div", ka, [
2053
+ !n.value && w.search ? X((i(), u("input", {
2030
2054
  key: 0,
2031
2055
  ref_key: "inputRef",
2032
- ref: P,
2056
+ ref: N,
2033
2057
  class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
2034
2058
  autocapitalize: "none",
2035
2059
  autocomplete: "off",
@@ -2038,25 +2062,25 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2038
2062
  type: "text",
2039
2063
  tabindex: "0",
2040
2064
  "aria-autocomplete": "list",
2041
- placeholder: (s.value && _.value.length ? " " : null) || (g.value && !T.value?.length ? v.value?.text : " "),
2042
- "onUpdate:modelValue": w[0] || (w[0] = (z) => T.value = z),
2043
- onFocus: ge,
2044
- onBlur: be,
2045
- onKeydown: de
2046
- }, null, 40, ga)), [
2047
- [ie, T.value]
2048
- ]) : B("", !0)
2065
+ placeholder: (s.value && $.value.length ? " " : null) || (b.value && !U.value?.length ? v.value?.text : " "),
2066
+ "onUpdate:modelValue": k[0] || (k[0] = (O) => U.value = O),
2067
+ onFocus: ne,
2068
+ onBlur: Se,
2069
+ onKeydown: H
2070
+ }, null, 40, _a)), [
2071
+ [fe, U.value]
2072
+ ]) : z("", !0)
2049
2073
  ])
2050
2074
  ], 512),
2051
- l("div", ba, [
2052
- C.value ? (i(), u("button", {
2075
+ l("div", $a, [
2076
+ A.value ? (i(), u("button", {
2053
2077
  key: 0,
2054
2078
  type: "button",
2055
2079
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2056
2080
  "aria-hidden": "true",
2057
- disabled: a.value,
2058
- onClick: se(b, ["stop"])
2059
- }, w[4] || (w[4] = [
2081
+ disabled: n.value,
2082
+ onClick: ce(oe, ["stop"])
2083
+ }, k[4] || (k[4] = [
2060
2084
  l("svg", {
2061
2085
  height: "20",
2062
2086
  width: "20",
@@ -2065,15 +2089,15 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2065
2089
  }, [
2066
2090
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2067
2091
  ], -1)
2068
- ]), 8, ya)) : B("", !0),
2069
- w[6] || (w[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2092
+ ]), 8, Ca)) : z("", !0),
2093
+ k[6] || (k[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2070
2094
  l("button", {
2071
2095
  type: "button",
2072
2096
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2073
2097
  "aria-hidden": "true",
2074
- disabled: a.value,
2075
- onClick: w[1] || (w[1] = se((z) => ze(), ["stop"]))
2076
- }, w[5] || (w[5] = [
2098
+ disabled: n.value,
2099
+ onClick: k[1] || (k[1] = ce((O) => j(), ["stop"]))
2100
+ }, k[5] || (k[5] = [
2077
2101
  l("svg", {
2078
2102
  height: "20",
2079
2103
  width: "20",
@@ -2082,64 +2106,64 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2082
2106
  }, [
2083
2107
  l("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })
2084
2108
  ], -1)
2085
- ]), 8, xa)
2109
+ ]), 8, Va)
2086
2110
  ])
2087
- ], 42, da),
2088
- c.value ? (i(), u("div", wa, [
2111
+ ], 42, ha),
2112
+ c.value ? (i(), u("div", Ma, [
2089
2113
  l("div", {
2090
2114
  class: "max-h-[300px] overflow-y-auto py-1",
2091
2115
  ref_key: "listRef",
2092
2116
  ref: f
2093
2117
  }, [
2094
- V.value.length ? (i(!0), u(K, { key: 0 }, Y(V.value, (z, J) => (i(), u("div", {
2095
- key: z.id,
2118
+ J.value.length ? (i(!0), u(ee, { key: 0 }, le(J.value, (O, Z) => (i(), u("div", {
2119
+ key: O.id,
2096
2120
  ref_for: !0,
2097
- ref: (pe) => U.value[J] = pe,
2098
- class: S([
2121
+ ref: (xe) => D.value[Z] = xe,
2122
+ class: M([
2099
2123
  "flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
2100
- I.value === J ? "bg-blue-300" : "",
2101
- m(z.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2124
+ V.value === Z ? "bg-blue-300" : "",
2125
+ S(O.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2102
2126
  ]),
2103
- "aria-disabled": m(z.id) ? "true" : "false",
2127
+ "aria-disabled": S(O.id) ? "true" : "false",
2104
2128
  role: "option",
2105
2129
  tabindex: "-1",
2106
- onClick: (pe) => N(z)
2130
+ onClick: (xe) => m(O)
2107
2131
  }, [
2108
- z?.color ? (i(), u("span", {
2132
+ O?.color ? (i(), u("span", {
2109
2133
  key: 0,
2110
2134
  class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2111
- style: ve({ backgroundColor: z?.color })
2112
- }, null, 4)) : B("", !0),
2135
+ style: we({ backgroundColor: O?.color })
2136
+ }, null, 4)) : z("", !0),
2113
2137
  l("div", {
2114
- class: S([
2138
+ class: M([
2115
2139
  "leading-[19px]",
2116
- I.value === z.id ? "text-white" : "",
2140
+ V.value === O.id ? "text-white" : "",
2117
2141
  // active style like react-select
2118
- (I.value === J, "")
2142
+ (V.value === Z, "")
2119
2143
  ])
2120
- }, F(z.text), 3)
2121
- ], 10, ka))), 128)) : (i(), u("div", _a, " No options "))
2144
+ }, F(O.text), 3)
2145
+ ], 10, La))), 128)) : (i(), u("div", Sa, " No options "))
2122
2146
  ], 512)
2123
- ])) : B("", !0)
2147
+ ])) : z("", !0)
2124
2148
  ], 2),
2125
2149
  t.add ? (i(), u("button", {
2126
2150
  key: 0,
2127
- onClick: it,
2151
+ onClick: nt,
2128
2152
  class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
2129
- disabled: a.value,
2153
+ disabled: n.value,
2130
2154
  type: "button"
2131
2155
  }, [
2132
- j(je, {
2156
+ I(Ae, {
2133
2157
  width: "16",
2134
2158
  height: "16"
2135
2159
  }),
2136
- w[9] || (w[9] = l("span", null, "Додати", -1))
2137
- ], 8, $a)) : B("", !0)
2160
+ k[9] || (k[9] = l("span", null, "Додати", -1))
2161
+ ], 8, Ba)) : z("", !0)
2138
2162
  ], 512));
2139
2163
  }
2140
- }), Va = ["placeholder", "disabled"], La = /* @__PURE__ */ A({
2164
+ }), Ia = ["placeholder", "disabled"], za = /* @__PURE__ */ E({
2141
2165
  __name: "vs-input-textarea",
2142
- props: /* @__PURE__ */ Z({
2166
+ props: /* @__PURE__ */ W({
2143
2167
  style: { default: () => ({}) },
2144
2168
  customClass: { default: "" },
2145
2169
  disabled: { type: Boolean, default: !1 },
@@ -2153,21 +2177,21 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2153
2177
  }),
2154
2178
  emits: ["update:modelValue"],
2155
2179
  setup(o) {
2156
- const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue");
2157
- return (s, a) => q((i(), u("textarea", {
2158
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
2180
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
2181
+ return (s, n) => X((i(), u("textarea", {
2182
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
2159
2183
  placeholder: s.placeholder,
2160
2184
  disabled: s.disabled,
2161
2185
  row: "2",
2162
- class: S(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [H(t)]]),
2186
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [G(t)]]),
2163
2187
  style: {
2164
2188
  border: "1px solid #CFD9E0"
2165
2189
  }
2166
- }, null, 10, Va)), [
2167
- [ie, n.value]
2190
+ }, null, 10, Ia)), [
2191
+ [fe, r.value]
2168
2192
  ]);
2169
2193
  }
2170
- }), Ma = {}, Sa = {
2194
+ }), Aa = {}, Oa = {
2171
2195
  xmlns: "http://www.w3.org/2000/svg",
2172
2196
  viewBox: "0 0 24 24",
2173
2197
  fill: "none",
@@ -2177,8 +2201,8 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Lo = { class: "flex flex-col
2177
2201
  "stroke-linejoin": "round",
2178
2202
  class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
2179
2203
  };
2180
- function Ba(o, e) {
2181
- return i(), u("svg", Sa, e[0] || (e[0] = [
2204
+ function Ea(o, e) {
2205
+ return i(), u("svg", Oa, e[0] || (e[0] = [
2182
2206
  l("path", {
2183
2207
  stroke: "none",
2184
2208
  d: "M0 0h24v24H0z",
@@ -2188,7 +2212,7 @@ function Ba(o, e) {
2188
2212
  l("path", { d: "M21 21l-6 -6" }, null, -1)
2189
2213
  ]));
2190
2214
  }
2191
- const ja = /* @__PURE__ */ R(Ma, [["render", Ba]]), Ia = {}, za = {
2215
+ const Fa = /* @__PURE__ */ P(Aa, [["render", Ea]]), Da = {}, Ua = {
2192
2216
  class: "flex-shrink-0 mt-0.5 size-3.5",
2193
2217
  xmlns: "http://www.w3.org/2000/svg",
2194
2218
  viewBox: "0 0 24 24",
@@ -2198,15 +2222,15 @@ const ja = /* @__PURE__ */ R(Ma, [["render", Ba]]), Ia = {}, za = {
2198
2222
  "stroke-linecap": "round",
2199
2223
  "stroke-linejoin": "round"
2200
2224
  };
2201
- function Aa(o, e) {
2202
- return i(), u("svg", za, e[0] || (e[0] = [
2225
+ function Ta(o, e) {
2226
+ return i(), u("svg", Ua, e[0] || (e[0] = [
2203
2227
  l("path", { d: "m3 16 4 4 4-4" }, null, -1),
2204
2228
  l("path", { d: "M7 20V4" }, null, -1),
2205
2229
  l("path", { d: "m21 8-4-4-4 4" }, null, -1),
2206
2230
  l("path", { d: "M17 4v16" }, null, -1)
2207
2231
  ]));
2208
2232
  }
2209
- const Ea = /* @__PURE__ */ R(Ia, [["render", Aa]]), Fa = {}, Oa = {
2233
+ const Ra = /* @__PURE__ */ P(Da, [["render", Ta]]), Pa = {}, Na = {
2210
2234
  xmlns: "http://www.w3.org/2000/svg",
2211
2235
  width: "14",
2212
2236
  height: "14",
@@ -2217,8 +2241,8 @@ const Ea = /* @__PURE__ */ R(Ia, [["render", Aa]]), Fa = {}, Oa = {
2217
2241
  "stroke-linecap": "round",
2218
2242
  "stroke-linejoin": "round"
2219
2243
  };
2220
- function Da(o, e) {
2221
- return i(), u("svg", Oa, e[0] || (e[0] = [
2244
+ function Ha(o, e) {
2245
+ return i(), u("svg", Na, e[0] || (e[0] = [
2222
2246
  l("path", {
2223
2247
  stroke: "none",
2224
2248
  d: "M0 0h24v24H0z",
@@ -2229,7 +2253,7 @@ function Da(o, e) {
2229
2253
  l("path", { d: "M12 4l0 12" }, null, -1)
2230
2254
  ]));
2231
2255
  }
2232
- const Ua = /* @__PURE__ */ R(Fa, [["render", Da]]), Ta = {}, Ra = {
2256
+ const qa = /* @__PURE__ */ P(Pa, [["render", Ha]]), Ga = {}, Ja = {
2233
2257
  xmlns: "http://www.w3.org/2000/svg",
2234
2258
  viewBox: "0 0 24 24",
2235
2259
  fill: "none",
@@ -2238,8 +2262,8 @@ const Ua = /* @__PURE__ */ R(Fa, [["render", Da]]), Ta = {}, Ra = {
2238
2262
  "stroke-linecap": "round",
2239
2263
  "stroke-linejoin": "round"
2240
2264
  };
2241
- function Pa(o, e) {
2242
- return i(), u("svg", Ra, e[0] || (e[0] = [
2265
+ function Ka(o, e) {
2266
+ return i(), u("svg", Ja, e[0] || (e[0] = [
2243
2267
  l("path", {
2244
2268
  stroke: "none",
2245
2269
  d: "M0 0h24v24H0z",
@@ -2250,7 +2274,7 @@ function Pa(o, e) {
2250
2274
  l("path", { d: "M12 4l0 12" }, null, -1)
2251
2275
  ]));
2252
2276
  }
2253
- const Na = /* @__PURE__ */ R(Ta, [["render", Pa]]), Ha = {}, qa = {
2277
+ const Za = /* @__PURE__ */ P(Ga, [["render", Ka]]), Wa = {}, Qa = {
2254
2278
  xmlns: "http://www.w3.org/2000/svg",
2255
2279
  viewBox: "0 0 24 24",
2256
2280
  fill: "none",
@@ -2259,22 +2283,22 @@ const Na = /* @__PURE__ */ R(Ta, [["render", Pa]]), Ha = {}, qa = {
2259
2283
  "stroke-linecap": "round",
2260
2284
  "stroke-linejoin": "round"
2261
2285
  };
2262
- function Ga(o, e) {
2263
- return i(), u("svg", qa, e[0] || (e[0] = [
2264
- ae('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
2286
+ function Xa(o, e) {
2287
+ return i(), u("svg", Qa, e[0] || (e[0] = [
2288
+ re('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
2265
2289
  ]));
2266
2290
  }
2267
- const Qe = /* @__PURE__ */ R(Ha, [["render", Ga]]), Ja = {}, Ka = {
2291
+ const We = /* @__PURE__ */ P(Wa, [["render", Xa]]), Ya = {}, es = {
2268
2292
  viewBox: "0 0 178 90",
2269
2293
  fill: "none",
2270
2294
  xmlns: "http://www.w3.org/2000/svg"
2271
2295
  };
2272
- function Za(o, e) {
2273
- return i(), u("svg", Ka, e[0] || (e[0] = [
2274
- ae('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
2296
+ function ts(o, e) {
2297
+ return i(), u("svg", es, e[0] || (e[0] = [
2298
+ re('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
2275
2299
  ]));
2276
2300
  }
2277
- const Wa = /* @__PURE__ */ R(Ja, [["render", Za]]), Qa = {}, Xa = {
2301
+ const ls = /* @__PURE__ */ P(Ya, [["render", ts]]), os = {}, as = {
2278
2302
  xmlns: "http://www.w3.org/2000/svg",
2279
2303
  viewBox: "0 0 24 24",
2280
2304
  fill: "none",
@@ -2283,18 +2307,18 @@ const Wa = /* @__PURE__ */ R(Ja, [["render", Za]]), Qa = {}, Xa = {
2283
2307
  "stroke-linecap": "round",
2284
2308
  "stroke-linejoin": "round"
2285
2309
  };
2286
- function Ya(o, e) {
2287
- return i(), u("svg", Xa, e[0] || (e[0] = [
2310
+ function ss(o, e) {
2311
+ return i(), u("svg", as, e[0] || (e[0] = [
2288
2312
  l("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
2289
2313
  ]));
2290
2314
  }
2291
- const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "vs-datatable border rounded-xl w-full flex-grow" }, ls = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, os = { class: "relative w-full" }, as = { class: "table-wrapper flex gap-2" }, ss = { class: "vs-popover inline-block text-slate-700" }, rs = { class: "text-center" }, ns = { class: "" }, is = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, us = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, ds = { class: "text-sm items-center text-gray-800 flex gap-1" }, cs = { class: "w-full overflow-x-auto" }, ps = { class: "w-full table-auto caption-bottom text-sm" }, fs = { class: "[&_tr]:border-b" }, vs = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ms = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, hs = {
2315
+ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable border rounded-xl w-full flex-grow" }, is = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, us = { class: "relative w-full" }, ds = { class: "table-wrapper flex gap-2" }, cs = { class: "vs-popover inline-block text-slate-700" }, ps = { class: "text-center" }, fs = { class: "" }, vs = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ms = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, hs = { class: "text-sm items-center text-gray-800 flex gap-1" }, gs = { class: "w-full overflow-x-auto" }, bs = { class: "w-full table-auto caption-bottom text-sm" }, ys = { class: "[&_tr]:border-b" }, xs = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ws = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, ks = {
2292
2316
  key: 0,
2293
2317
  colspan: "100%",
2294
2318
  class: "text-center"
2295
- }, gs = { class: "w-full" }, bs = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, ys = ["onDragstart", "onDragover", "onDrop"], xs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, ws = { class: "flex items-center justify-center" }, ks = { class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors" }, _s = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, $s = { class: "flex items-center justify-center gap-2" }, Cs = ["onClick"], Vs = ["onClick"], Ls = /* @__PURE__ */ A({
2319
+ }, _s = { class: "w-full" }, $s = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Cs = ["onDragstart", "onDragover", "onDrop"], Vs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ms = { class: "flex items-center justify-center" }, Ls = { class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors" }, Ss = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Bs = { class: "flex items-center justify-center gap-2" }, js = ["onClick"], Is = ["onClick"], zs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, As = /* @__PURE__ */ E({
2296
2320
  __name: "vs-input-datatable",
2297
- props: /* @__PURE__ */ Z({
2321
+ props: /* @__PURE__ */ W({
2298
2322
  colModel: {},
2299
2323
  style: {},
2300
2324
  customClass: {},
@@ -2309,109 +2333,112 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "vs-datatable
2309
2333
  }),
2310
2334
  emits: ["update:modelValue"],
2311
2335
  setup(o) {
2312
- const e = o, t = W(o, "modelValue"), n = k({}), s = k(""), a = D(() => {
2336
+ const e = o, t = Q(o, "modelValue"), r = x({}), s = x(""), n = T(() => {
2313
2337
  if (!s.value) return t.value ?? [];
2314
- const C = s.value.toLowerCase();
2315
- return t.value.filter((m) => e.colModel?.some((V) => {
2316
- const E = m[V.key];
2317
- return E ? Array.isArray(E) ? E.join(", ").toLowerCase().includes(C) : String(E).toLowerCase().includes(C) : !1;
2338
+ const B = s.value.toLowerCase();
2339
+ return t.value.filter((_) => e.colModel?.some((j) => {
2340
+ const q = _[j.key];
2341
+ return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(B) : String(q).toLowerCase().includes(B) : !1;
2318
2342
  }));
2319
- }), r = k(null), d = k(null), p = k(!1), f = k(null), c = k({ top: 0, left: 0 }), g = (C) => {
2320
- r.value = C;
2321
- }, v = (C) => {
2322
- d.value = C;
2323
- }, M = (C) => {
2324
- if (r.value === null || r.value === C) {
2325
- r.value = null, d.value = null;
2343
+ }), a = x(null), d = x(null), p = x(!1), f = x(null), c = x({ top: 0, left: 0 }), b = (B) => {
2344
+ a.value = B;
2345
+ }, v = (B) => {
2346
+ d.value = B;
2347
+ }, C = (B) => {
2348
+ if (a.value === null || a.value === B) {
2349
+ a.value = null, d.value = null;
2326
2350
  return;
2327
2351
  }
2328
- const m = [...t.value], [V] = m.splice(r.value, 1);
2329
- m.splice(C, 0, V), t.value = m, r.value = null, d.value = null;
2330
- }, I = (C) => {
2331
- const V = C.currentTarget.getBoundingClientRect();
2332
- c.value = { top: V.bottom + window.scrollY, left: V.left + window.scrollX }, p.value = !p.value;
2333
- }, U = () => {
2352
+ const _ = [...t.value], [j] = _.splice(a.value, 1);
2353
+ _.splice(B, 0, j), t.value = _, a.value = null, d.value = null;
2354
+ }, V = (B) => {
2355
+ const j = B.currentTarget.getBoundingClientRect();
2356
+ c.value = { top: j.bottom + window.scrollY, left: j.left + window.scrollX }, p.value = !p.value;
2357
+ }, D = () => {
2334
2358
  f.value && f.value.click();
2335
- }, T = (C) => {
2336
- const V = C.target.files?.[0];
2337
- if (!V) return;
2338
- const E = new FileReader();
2339
- E.onload = (Q) => {
2359
+ }, U = (B) => {
2360
+ const j = B.target.files?.[0];
2361
+ if (!j) return;
2362
+ const q = new FileReader();
2363
+ q.onload = (oe) => {
2340
2364
  try {
2341
- const te = Q.target?.result;
2342
- if (typeof te == "string") {
2343
- const ye = JSON.parse(te);
2344
- Array.isArray(ye) && t.value.push(...ye);
2365
+ const he = oe.target?.result;
2366
+ if (typeof he == "string") {
2367
+ const de = JSON.parse(he);
2368
+ Array.isArray(de) && t.value.push(...de);
2345
2369
  }
2346
- } catch (te) {
2347
- console.error("Error parsing file:", te);
2370
+ } catch (he) {
2371
+ console.error("Error parsing file:", he);
2348
2372
  }
2349
- }, E.readAsText(V);
2350
- }, P = () => {
2351
- const C = JSON.stringify(t.value, null, 2), m = new Blob([C], { type: "application/json" }), V = URL.createObjectURL(m), E = document.createElement("a");
2352
- E.href = V, E.download = "data.json", E.click(), URL.revokeObjectURL(V);
2373
+ }, q.readAsText(j);
2374
+ }, N = () => {
2375
+ const B = JSON.stringify(t.value, null, 2), _ = new Blob([B], { type: "application/json" }), j = URL.createObjectURL(_), q = document.createElement("a");
2376
+ q.href = j, q.download = "data.json", q.click(), URL.revokeObjectURL(j);
2353
2377
  };
2354
- ne(async () => {
2355
- const C = e.colModel?.filter((m) => m.data);
2356
- C?.length && Promise.all(C.map(async (m) => {
2357
- n.value[m.key] = await fetch(`/api/suggest/${m.data}`).then((V) => V.json());
2378
+ pe(async () => {
2379
+ const B = e.colModel?.filter((_) => _.data);
2380
+ B?.length && Promise.all(B.map(async (_) => {
2381
+ r.value[_.key] = await fetch(`/api/suggest/${_.data}`).then((j) => j.json());
2358
2382
  }));
2359
2383
  });
2360
- async function _() {
2361
- const C = await Le({
2362
- schema: e.colModel,
2363
- mode: "add"
2364
- });
2365
- C && (Array.isArray(t.value) ? t.value = [...t.value, C] : t.value = [C]);
2384
+ const $ = x(""), h = x(!1);
2385
+ let g = "edit", K = 0;
2386
+ const A = x({}), S = x({});
2387
+ async function J() {
2388
+ $.value = "Додати", h.value = !0, g = "add", A.value = {};
2366
2389
  }
2367
- function x(C, m) {
2368
- return n.value[m.key] && C[m.key] ? n.value[m.key].find((V) => V.id.toString() === C[m.key].toString())?.text ?? C[m.key] : C[m.key] || "-";
2390
+ function Y(B, _) {
2391
+ return r.value[_.key] && B[_.key] ? r.value[_.key].find((j) => j.id.toString() === B[_.key].toString())?.text ?? B[_.key] : B[_.key] || "-";
2369
2392
  }
2370
- async function h(C, m) {
2371
- const V = await Le({
2372
- schema: e.colModel,
2373
- mode: "add",
2374
- defaultValue: C
2375
- });
2376
- V && (t.value = t.value.map((E, Q) => Q === m ? V : E));
2393
+ async function ae(B, _) {
2394
+ $.value = "Редагувати", h.value = !0, g = "edit", K = _, A.value = { ...B };
2395
+ }
2396
+ function $e() {
2397
+ const B = S.value.validate();
2398
+ if (B) {
2399
+ me({ type: "warning", title: "Помилка валідації", message: Object.entries(B).map(([_, j]) => `${_}: ${j}`).join(`
2400
+ `) });
2401
+ return;
2402
+ }
2403
+ g === "add" ? Array.isArray(t.value) ? t.value = [...t.value, A.value] : t.value = [A.value] : t.value = t.value.map((_, j) => j === K ? A.value : _), h.value = !1;
2377
2404
  }
2378
- function G(C) {
2379
- t.value = t.value.filter((m, V) => V !== C);
2405
+ function Le(B) {
2406
+ t.value = t.value.filter((_, j) => j !== B);
2380
2407
  }
2381
- return (C, m) => (i(), u("div", ts, [
2382
- l("div", ls, [
2383
- l("div", os, [
2384
- j(ja, {
2408
+ return (B, _) => (i(), u("div", ns, [
2409
+ l("div", is, [
2410
+ l("div", us, [
2411
+ I(Fa, {
2385
2412
  width: "14",
2386
2413
  height: "14",
2387
2414
  class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
2388
2415
  }),
2389
- q(l("input", {
2416
+ X(l("input", {
2390
2417
  type: "text",
2391
- "onUpdate:modelValue": m[0] || (m[0] = (V) => s.value = V),
2418
+ "onUpdate:modelValue": _[0] || (_[0] = (j) => s.value = j),
2392
2419
  placeholder: "Пошук",
2393
2420
  class: "py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"
2394
2421
  }, null, 512), [
2395
- [ie, s.value]
2422
+ [fe, s.value]
2396
2423
  ])
2397
2424
  ]),
2398
- l("div", as, [
2425
+ l("div", ds, [
2399
2426
  l("input", {
2400
2427
  ref_key: "fileInput",
2401
2428
  ref: f,
2402
- onChange: T,
2429
+ onChange: U,
2403
2430
  class: "hidden",
2404
2431
  accept: ".json",
2405
2432
  type: "file"
2406
2433
  }, null, 544),
2407
- l("div", ss, [
2408
- l("div", rs, [
2409
- l("div", ns, [
2434
+ l("div", cs, [
2435
+ l("div", ps, [
2436
+ l("div", fs, [
2410
2437
  l("button", {
2411
- onClick: I,
2438
+ onClick: V,
2412
2439
  class: "bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2413
2440
  }, [
2414
- j(Ea, {
2441
+ I(Ra, {
2415
2442
  height: "16",
2416
2443
  width: "16"
2417
2444
  })
@@ -2420,139 +2447,167 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "vs-datatable
2420
2447
  ])
2421
2448
  ])
2422
2449
  ]),
2423
- (i(), X(pt, { to: "body" }, [
2450
+ (i(), te(ct, { to: "body" }, [
2424
2451
  p.value ? (i(), u("div", {
2425
2452
  key: 0,
2426
2453
  class: "text-slate-700 vsTailwind vs-popover__content bottom",
2427
- style: ve([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2454
+ style: we([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2428
2455
  }, [
2429
- l("div", is, [
2430
- l("div", us, [
2456
+ l("div", vs, [
2457
+ l("div", ms, [
2431
2458
  l("button", {
2432
- onClick: U,
2459
+ onClick: D,
2433
2460
  class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2434
2461
  }, [
2435
- j(Ua, {
2462
+ I(qa, {
2436
2463
  class: "text-black",
2437
2464
  width: "14",
2438
2465
  height: "14"
2439
2466
  }),
2440
- m[1] || (m[1] = oe(" Імпортувати "))
2467
+ _[4] || (_[4] = ie(" Імпортувати "))
2441
2468
  ]),
2442
2469
  l("button", {
2443
- onClick: P,
2470
+ onClick: N,
2444
2471
  class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2445
2472
  }, [
2446
- l("span", ds, [
2447
- j(Na, {
2473
+ l("span", hs, [
2474
+ I(Za, {
2448
2475
  class: "text-black",
2449
2476
  width: "14",
2450
2477
  height: "14"
2451
2478
  }),
2452
- m[2] || (m[2] = oe(" Експортувати "))
2479
+ _[5] || (_[5] = ie(" Експортувати "))
2453
2480
  ])
2454
2481
  ])
2455
2482
  ])
2456
2483
  ])
2457
- ], 4)) : B("", !0)
2484
+ ], 4)) : z("", !0)
2458
2485
  ])),
2459
2486
  l("button", {
2460
- onClick: _,
2487
+ onClick: J,
2461
2488
  class: "text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2462
2489
  }, [
2463
- j(je),
2464
- m[3] || (m[3] = oe(" Додати "))
2490
+ I(Ae),
2491
+ _[6] || (_[6] = ie(" Додати "))
2465
2492
  ])
2466
2493
  ]),
2467
- l("div", cs, [
2468
- l("table", ps, [
2469
- l("thead", fs, [
2470
- l("tr", vs, [
2471
- l("th", ms, [
2472
- j(Qe, {
2494
+ l("div", gs, [
2495
+ l("table", bs, [
2496
+ l("thead", ys, [
2497
+ l("tr", xs, [
2498
+ l("th", ws, [
2499
+ I(We, {
2473
2500
  width: "24",
2474
2501
  height: "24",
2475
2502
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2476
2503
  })
2477
2504
  ]),
2478
- (i(!0), u(K, null, Y(C.colModel, (V) => (i(), u("th", {
2479
- key: V.key,
2505
+ (i(!0), u(ee, null, le(B.colModel, (j) => (i(), u("th", {
2506
+ key: j.key,
2480
2507
  class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
2481
- }, F(V.ua || V.label), 1))), 128)),
2482
- m[4] || (m[4] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
2508
+ }, F(j.ua || j.label), 1))), 128)),
2509
+ _[7] || (_[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
2483
2510
  ])
2484
2511
  ]),
2485
2512
  l("tbody", {
2486
- class: S({ "[&_tr:last-child]:border-0": !d.value })
2513
+ class: M({ "[&_tr:last-child]:border-0": !d.value })
2487
2514
  }, [
2488
- a.value.length === 0 ? (i(), u("td", hs, [
2489
- l("div", gs, [
2490
- l("div", bs, [
2491
- j(Wa, { class: "w-48 mx-auto" }),
2492
- m[5] || (m[5] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2515
+ n.value.length === 0 ? (i(), u("td", ks, [
2516
+ l("div", _s, [
2517
+ l("div", $s, [
2518
+ I(ls, { class: "w-48 mx-auto" }),
2519
+ _[8] || (_[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2493
2520
  l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
2494
2521
  l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
2495
2522
  ], -1))
2496
2523
  ])
2497
2524
  ])
2498
- ])) : B("", !0),
2499
- (i(!0), u(K, null, Y(a.value, (V, E) => (i(), u("tr", {
2500
- key: V.id,
2501
- class: S(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2502
- "opacity-50": r.value === E,
2503
- "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === E
2525
+ ])) : z("", !0),
2526
+ (i(!0), u(ee, null, le(n.value, (j, q) => (i(), u("tr", {
2527
+ key: j.id,
2528
+ class: M(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2529
+ "opacity-50": a.value === q,
2530
+ "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === q
2504
2531
  }]),
2505
2532
  draggable: "true",
2506
- onDragstart: (Q) => g(E),
2507
- onDragover: se((Q) => v(E), ["prevent"]),
2508
- onDrop: (Q) => M(E)
2533
+ onDragstart: (oe) => b(q),
2534
+ onDragover: ce((oe) => v(q), ["prevent"]),
2535
+ onDrop: (oe) => C(q)
2509
2536
  }, [
2510
- l("td", xs, [
2511
- l("div", ws, [
2512
- j(Qe, {
2537
+ l("td", Vs, [
2538
+ l("div", Ms, [
2539
+ I(We, {
2513
2540
  width: "24",
2514
2541
  height: "24",
2515
2542
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2516
2543
  })
2517
2544
  ])
2518
2545
  ]),
2519
- (i(!0), u(K, null, Y(C.colModel, (Q) => (i(), u("td", {
2520
- key: Q.key,
2546
+ (i(!0), u(ee, null, le(B.colModel, (oe) => (i(), u("td", {
2547
+ key: oe.key,
2521
2548
  class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
2522
2549
  }, [
2523
- l("div", ks, F(x(V, Q)), 1)
2550
+ l("div", Ls, F(Y(j, oe)), 1)
2524
2551
  ]))), 128)),
2525
- l("td", _s, [
2526
- l("div", $s, [
2552
+ l("td", Ss, [
2553
+ l("div", Bs, [
2527
2554
  l("button", {
2528
- onClick: (Q) => h(V, E),
2555
+ onClick: (oe) => ae(j, q),
2529
2556
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2530
2557
  }, [
2531
- j(es, {
2558
+ I(rs, {
2532
2559
  width: "24",
2533
2560
  height: "24",
2534
2561
  class: "w-3 h-3"
2535
2562
  })
2536
- ], 8, Cs),
2563
+ ], 8, js),
2537
2564
  l("button", {
2538
- onClick: (Q) => G(E),
2565
+ onClick: (oe) => Le(q),
2539
2566
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2540
2567
  }, [
2541
- j(Ie, {
2568
+ I(Ee, {
2542
2569
  width: "24",
2543
2570
  height: "24",
2544
2571
  class: "w-3 h-3"
2545
2572
  })
2546
- ], 8, Vs)
2573
+ ], 8, Is)
2547
2574
  ])
2548
2575
  ])
2549
- ], 42, ys))), 128))
2576
+ ], 42, Cs))), 128))
2550
2577
  ], 2)
2551
2578
  ])
2552
- ])
2579
+ ]),
2580
+ I(G(vt), {
2581
+ visible: h.value,
2582
+ title: $.value,
2583
+ size: "lg"
2584
+ }, {
2585
+ default: Me(() => [
2586
+ I(Oe, {
2587
+ schema: e.colModel,
2588
+ values: A.value,
2589
+ "onUpdate:values": _[1] || (_[1] = (j) => A.value = j),
2590
+ form: S.value,
2591
+ "onUpdate:form": _[2] || (_[2] = (j) => S.value = j)
2592
+ }, null, 8, ["schema", "values", "form"]),
2593
+ l("div", zs, [
2594
+ l("button", {
2595
+ type: "button",
2596
+ onClick: _[3] || (_[3] = (j) => h.value = !1),
2597
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
2598
+ }, " Скасувати "),
2599
+ l("button", {
2600
+ onClick: $e,
2601
+ type: "button",
2602
+ class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
2603
+ }, " Зберегти ")
2604
+ ])
2605
+ ]),
2606
+ _: 1
2607
+ }, 8, ["visible", "title"])
2553
2608
  ]));
2554
2609
  }
2555
- }), Ms = {
2610
+ }), Os = {
2556
2611
  draw: {
2557
2612
  toolbar: {
2558
2613
  actions: {
@@ -2660,7 +2715,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "vs-datatable
2660
2715
  }
2661
2716
  }
2662
2717
  };
2663
- function Ss(o) {
2718
+ function Es(o) {
2664
2719
  return o ? o.type === "FeatureCollection" || o.type === "Feature" ? o : o.geom ? {
2665
2720
  type: "Feature",
2666
2721
  geometry: {
@@ -2674,7 +2729,7 @@ function Ss(o) {
2674
2729
  properties: {}
2675
2730
  } : null : null;
2676
2731
  }
2677
- const Bs = {}, js = {
2732
+ const Fs = {}, Ds = {
2678
2733
  xmlns: "http://www.w3.org/2000/svg",
2679
2734
  viewBox: "0 0 24 24",
2680
2735
  stroke: "currentColor",
@@ -2684,8 +2739,8 @@ const Bs = {}, js = {
2684
2739
  "stroke-linejoin": "round",
2685
2740
  class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
2686
2741
  };
2687
- function Is(o, e) {
2688
- return i(), u("svg", js, e[0] || (e[0] = [
2742
+ function Us(o, e) {
2743
+ return i(), u("svg", Ds, e[0] || (e[0] = [
2689
2744
  l("path", {
2690
2745
  stroke: "none",
2691
2746
  d: "M0 0h24v24H0z",
@@ -2695,7 +2750,7 @@ function Is(o, e) {
2695
2750
  l("path", { d: "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" }, null, -1)
2696
2751
  ]));
2697
2752
  }
2698
- const zs = /* @__PURE__ */ R(Bs, [["render", Is]]), As = {}, Es = {
2753
+ const Ts = /* @__PURE__ */ P(Fs, [["render", Us]]), Rs = {}, Ps = {
2699
2754
  xmlns: "http://www.w3.org/2000/svg",
2700
2755
  viewBox: "0 0 24 24",
2701
2756
  fill: "none",
@@ -2705,8 +2760,8 @@ const zs = /* @__PURE__ */ R(Bs, [["render", Is]]), As = {}, Es = {
2705
2760
  "stroke-linejoin": "round",
2706
2761
  class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
2707
2762
  };
2708
- function Fs(o, e) {
2709
- return i(), u("svg", Es, e[0] || (e[0] = [
2763
+ function Ns(o, e) {
2764
+ return i(), u("svg", Ps, e[0] || (e[0] = [
2710
2765
  l("path", {
2711
2766
  stroke: "none",
2712
2767
  d: "M0 0h24v24H0z",
@@ -2717,7 +2772,7 @@ function Fs(o, e) {
2717
2772
  l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
2718
2773
  ]));
2719
2774
  }
2720
- const Os = /* @__PURE__ */ R(As, [["render", Fs]]), Ds = {}, Us = {
2775
+ const Hs = /* @__PURE__ */ P(Rs, [["render", Ns]]), qs = {}, Gs = {
2721
2776
  xmlns: "http://www.w3.org/2000/svg",
2722
2777
  viewBox: "0 0 24 24",
2723
2778
  fill: "none",
@@ -2727,12 +2782,12 @@ const Os = /* @__PURE__ */ R(As, [["render", Fs]]), Ds = {}, Us = {
2727
2782
  "stroke-linejoin": "round",
2728
2783
  class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
2729
2784
  };
2730
- function Ts(o, e) {
2731
- return i(), u("svg", Us, e[0] || (e[0] = [
2732
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
2785
+ function Js(o, e) {
2786
+ return i(), u("svg", Gs, e[0] || (e[0] = [
2787
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
2733
2788
  ]));
2734
2789
  }
2735
- const Rs = /* @__PURE__ */ R(Ds, [["render", Ts]]), Ps = {}, Ns = {
2790
+ const Ks = /* @__PURE__ */ P(qs, [["render", Js]]), Zs = {}, Ws = {
2736
2791
  xmlns: "http://www.w3.org/2000/svg",
2737
2792
  viewBox: "0 0 24 24",
2738
2793
  fill: "none",
@@ -2742,12 +2797,12 @@ const Rs = /* @__PURE__ */ R(Ds, [["render", Ts]]), Ps = {}, Ns = {
2742
2797
  "stroke-linejoin": "round",
2743
2798
  class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
2744
2799
  };
2745
- function Hs(o, e) {
2746
- return i(), u("svg", Ns, e[0] || (e[0] = [
2747
- ae('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
2800
+ function Qs(o, e) {
2801
+ return i(), u("svg", Ws, e[0] || (e[0] = [
2802
+ re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
2748
2803
  ]));
2749
2804
  }
2750
- const qs = /* @__PURE__ */ R(Ps, [["render", Hs]]), Gs = {}, Js = {
2805
+ const Xs = /* @__PURE__ */ P(Zs, [["render", Qs]]), Ys = {}, er = {
2751
2806
  version: "1.1",
2752
2807
  viewBox: "0 0 14 14",
2753
2808
  xmlns: "http://www.w3.org/2000/svg",
@@ -2755,8 +2810,8 @@ const qs = /* @__PURE__ */ R(Ps, [["render", Hs]]), Gs = {}, Js = {
2755
2810
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
2756
2811
  class: "fullscreen-icon"
2757
2812
  };
2758
- function Ks(o, e) {
2759
- return i(), u("svg", Js, e[0] || (e[0] = [
2813
+ function tr(o, e) {
2814
+ return i(), u("svg", er, e[0] || (e[0] = [
2760
2815
  l("title", null, null, -1),
2761
2816
  l("desc", null, null, -1),
2762
2817
  l("defs", null, null, -1),
@@ -2785,10 +2840,10 @@ function Ks(o, e) {
2785
2840
  ], -1)
2786
2841
  ]));
2787
2842
  }
2788
- const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__search" }, Qs = { class: "map-search__input" }, Xs = { class: "flex flex-nowrap relative" }, Ys = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, er = { class: "flex items-center w-full" }, tr = { class: "max-w-[90%] truncate" }, lr = {
2843
+ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__search" }, ar = { class: "map-search__input" }, sr = { class: "flex flex-nowrap relative" }, rr = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, nr = { class: "flex items-center w-full" }, ir = { class: "max-w-[90%] truncate" }, ur = {
2789
2844
  key: 0,
2790
2845
  class: "absolute z-[3100] mt-0.5 left-0 right-0"
2791
- }, or = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, ar = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, sr = ["onClick"], rr = { class: "flex justify-between items-center w-full" }, nr = { class: "flex items-center" }, ir = {
2846
+ }, dr = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, cr = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, pr = ["onClick"], fr = { class: "flex justify-between items-center w-full" }, vr = { class: "flex items-center" }, mr = {
2792
2847
  key: 0,
2793
2848
  class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
2794
2849
  width: "24",
@@ -2799,87 +2854,87 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
2799
2854
  "stroke-width": "2",
2800
2855
  "stroke-linecap": "round",
2801
2856
  "stroke-linejoin": "round"
2802
- }, ur = { class: "relative w-full" }, dr = { class: "vs-form-text relative bg-white rounded-lg" }, cr = {
2857
+ }, hr = { class: "relative w-full" }, gr = { class: "vs-form-text relative bg-white rounded-lg" }, br = {
2803
2858
  key: 1,
2804
2859
  class: "absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"
2805
- }, pr = { key: 0 }, fr = ["onClick"], vr = {
2860
+ }, yr = { key: 0 }, xr = ["onClick"], wr = {
2806
2861
  key: 1,
2807
2862
  class: "px-3 py-2 text-xs text-gray-500"
2808
- }, mr = {
2863
+ }, kr = {
2809
2864
  key: 2,
2810
2865
  class: "px-3 py-2 text-xs text-gray-400"
2811
- }, hr = /* @__PURE__ */ A({
2866
+ }, _r = /* @__PURE__ */ E({
2812
2867
  __name: "map-search",
2813
2868
  props: {
2814
2869
  placeholder: { default: "50, 30" }
2815
2870
  },
2816
2871
  emits: ["goToCoordinates"],
2817
2872
  setup(o, { emit: e }) {
2818
- const t = e, n = k(!1), s = k("coordinates"), a = k(""), r = k([]), d = k(!1), p = k(!1);
2873
+ const t = e, r = x(!1), s = x("coordinates"), n = x(""), a = x([]), d = x(!1), p = x(!1);
2819
2874
  let f;
2820
2875
  const c = [
2821
2876
  { value: "coordinates", label: "Пошук по кординатам" },
2822
2877
  { value: "atu", label: "АТУ" },
2823
2878
  { value: "address", label: "Адресса" },
2824
2879
  { value: "search_here", label: "Пошук HERE" }
2825
- ], g = D(() => c.find((_) => _.value === s.value)?.label ?? "АТУ");
2826
- function v(_) {
2827
- s.value = _.value, n.value = !1, a.value = "", a.value && U();
2880
+ ], b = T(() => c.find(($) => $.value === s.value)?.label ?? "АТУ");
2881
+ function v($) {
2882
+ s.value = $.value, r.value = !1, n.value = "", n.value && D();
2828
2883
  }
2829
- function M(_) {
2830
- _.target.closest(".map-search__input") || (n.value = !1);
2884
+ function C($) {
2885
+ $.target.closest(".map-search__input") || (r.value = !1);
2831
2886
  }
2832
- ne(() => document.addEventListener("click", M)), Fe(() => document.removeEventListener("click", M));
2833
- async function I(_) {
2834
- let x;
2835
- s.value === "atu" ? x = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? x = "/api/suggest/map.address_id" : s.value === "search_here" && (x = "/api/gis-url-proxy");
2836
- const h = new URL(x || "");
2837
- return s.value === "search_here" ? h.searchParams.set("searchtext", _) : (s.value === "atu" || s.value === "address") && h.searchParams.set("key", _), h.searchParams.set("limit", "20"), h.searchParams.set("q", _), (await fetch(h.toString())).json();
2887
+ pe(() => document.addEventListener("click", C)), Ue(() => document.removeEventListener("click", C));
2888
+ async function V($) {
2889
+ let h;
2890
+ s.value === "atu" ? h = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? h = "/api/suggest/map.address_id" : s.value === "search_here" && (h = "/api/gis-url-proxy");
2891
+ const g = new URL(h || "");
2892
+ return s.value === "search_here" ? g.searchParams.set("searchtext", $) : (s.value === "atu" || s.value === "address") && g.searchParams.set("key", $), g.searchParams.set("limit", "20"), g.searchParams.set("q", $), (await fetch(g.toString())).json();
2838
2893
  }
2839
- function U() {
2894
+ function D() {
2840
2895
  if (d.value = !0, p.value = !0, s.value === "coordinates") {
2841
- const _ = a.value.trim().split(",");
2842
- if (_.length === 2) {
2843
- const x = parseFloat(_[0]), h = parseFloat(_[1]);
2844
- !Number.isNaN(x) && !Number.isNaN(h) && t("goToCoordinates", [x, h]);
2896
+ const $ = n.value.trim().split(",");
2897
+ if ($.length === 2) {
2898
+ const h = parseFloat($[0]), g = parseFloat($[1]);
2899
+ !Number.isNaN(h) && !Number.isNaN(g) && t("goToCoordinates", [h, g]);
2845
2900
  }
2846
2901
  return;
2847
2902
  }
2848
2903
  f && window.clearTimeout(f), f = window.setTimeout(async () => {
2849
- const _ = a.value.trim();
2850
- if (!_) {
2851
- r.value = [], p.value = !1;
2904
+ const $ = n.value.trim();
2905
+ if (!$) {
2906
+ a.value = [], p.value = !1;
2852
2907
  return;
2853
2908
  }
2854
2909
  try {
2855
- const x = await I(_);
2856
- r.value = Array.isArray(x.features) ? x.features : [];
2910
+ const h = await V($);
2911
+ a.value = Array.isArray(h.features) ? h.features : [];
2857
2912
  } catch {
2858
- r.value = [];
2913
+ a.value = [];
2859
2914
  } finally {
2860
2915
  p.value = !1;
2861
2916
  }
2862
2917
  }, 300);
2863
2918
  }
2864
- function T() {
2865
- a.value = "", r.value = [], d.value = !1, p.value = !1;
2919
+ function U() {
2920
+ n.value = "", a.value = [], d.value = !1, p.value = !1;
2866
2921
  }
2867
- function P(_) {
2868
- t("goToCoordinates", _), d.value = !1, p.value = !1, r.value = [];
2922
+ function N($) {
2923
+ t("goToCoordinates", $), d.value = !1, p.value = !1, a.value = [];
2869
2924
  }
2870
- return (_, x) => (i(), u("div", Ws, [
2871
- l("div", Qs, [
2872
- l("div", Xs, [
2873
- l("div", Ys, [
2925
+ return ($, h) => (i(), u("div", or, [
2926
+ l("div", ar, [
2927
+ l("div", sr, [
2928
+ l("div", rr, [
2874
2929
  l("button", {
2875
2930
  type: "button",
2876
- onClick: x[0] || (x[0] = (h) => n.value = !n.value),
2931
+ onClick: h[0] || (h[0] = (g) => r.value = !r.value),
2877
2932
  class: "h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"
2878
2933
  }, [
2879
- l("div", er, [
2880
- l("span", tr, F(g.value), 1)
2934
+ l("div", nr, [
2935
+ l("span", ir, F(b.value), 1)
2881
2936
  ]),
2882
- x[3] || (x[3] = l("svg", {
2937
+ h[3] || (h[3] = l("svg", {
2883
2938
  class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
2884
2939
  width: "15",
2885
2940
  height: "15",
@@ -2894,30 +2949,30 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
2894
2949
  })
2895
2950
  ], -1))
2896
2951
  ]),
2897
- n.value ? (i(), u("div", lr, [
2898
- l("div", or, [
2899
- l("div", ar, [
2900
- (i(), u(K, null, Y(c, (h) => l("div", {
2901
- onClick: (G) => v(h),
2902
- key: h.value,
2952
+ r.value ? (i(), u("div", ur, [
2953
+ l("div", dr, [
2954
+ l("div", cr, [
2955
+ (i(), u(ee, null, le(c, (g) => l("div", {
2956
+ onClick: (K) => v(g),
2957
+ key: g.value,
2903
2958
  class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
2904
2959
  }, [
2905
- l("div", rr, [
2906
- l("div", nr, [
2907
- l("div", null, F(h.label), 1)
2960
+ l("div", fr, [
2961
+ l("div", vr, [
2962
+ l("div", null, F(g.label), 1)
2908
2963
  ]),
2909
- h.value === s.value ? (i(), u("svg", ir, x[4] || (x[4] = [
2964
+ g.value === s.value ? (i(), u("svg", mr, h[4] || (h[4] = [
2910
2965
  l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2911
- ]))) : B("", !0)
2966
+ ]))) : z("", !0)
2912
2967
  ])
2913
- ], 8, sr)), 64))
2968
+ ], 8, pr)), 64))
2914
2969
  ])
2915
2970
  ])
2916
- ])) : B("", !0)
2971
+ ])) : z("", !0)
2917
2972
  ]),
2918
- l("div", ur, [
2919
- l("div", dr, [
2920
- x[6] || (x[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
2973
+ l("div", hr, [
2974
+ l("div", gr, [
2975
+ h[6] || (h[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
2921
2976
  l("svg", {
2922
2977
  width: "16",
2923
2978
  height: "16",
@@ -2940,23 +2995,23 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
2940
2995
  })
2941
2996
  ])
2942
2997
  ], -1)),
2943
- q(l("input", {
2998
+ X(l("input", {
2944
2999
  type: "text",
2945
- "onUpdate:modelValue": x[1] || (x[1] = (h) => a.value = h),
2946
- onInput: U,
2947
- onFocus: x[2] || (x[2] = (h) => d.value = !0),
3000
+ "onUpdate:modelValue": h[1] || (h[1] = (g) => n.value = g),
3001
+ onInput: D,
3002
+ onFocus: h[2] || (h[2] = (g) => d.value = !0),
2948
3003
  placeholder: "lat, lng ex. 50, 30",
2949
3004
  class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
2950
3005
  }, null, 544), [
2951
- [ie, a.value]
3006
+ [fe, n.value]
2952
3007
  ]),
2953
- a.value ? (i(), u("button", {
3008
+ n.value ? (i(), u("button", {
2954
3009
  key: 0,
2955
- onClick: T,
3010
+ onClick: U,
2956
3011
  class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
2957
3012
  "aria-label": "Очистити",
2958
3013
  type: "button"
2959
- }, x[5] || (x[5] = [
3014
+ }, h[5] || (h[5] = [
2960
3015
  l("svg", {
2961
3016
  width: "15",
2962
3017
  height: "15",
@@ -2971,41 +3026,40 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
2971
3026
  "stroke-linejoin": "round"
2972
3027
  })
2973
3028
  ], -1)
2974
- ]))) : B("", !0),
2975
- d.value && s.value !== "coordinates" ? (i(), u("div", cr, [
2976
- r.value.length ? (i(), u("ul", pr, [
2977
- (i(!0), u(K, null, Y(r.value, (h) => (i(), u("li", {
2978
- key: h.properties.place_id,
2979
- onClick: (G) => P(h),
3029
+ ]))) : z("", !0),
3030
+ d.value && s.value !== "coordinates" ? (i(), u("div", br, [
3031
+ a.value.length ? (i(), u("ul", yr, [
3032
+ (i(!0), u(ee, null, le(a.value, (g) => (i(), u("li", {
3033
+ key: g.properties.place_id,
3034
+ onClick: (K) => N(g),
2980
3035
  class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
2981
- }, F(h.properties.display_name), 9, fr))), 128))
2982
- ])) : p.value ? (i(), u("div", vr, "Шукаю…")) : (i(), u("div", mr, "Нічого не знайдено"))
2983
- ])) : B("", !0)
3036
+ }, F(g.properties.display_name), 9, xr))), 128))
3037
+ ])) : p.value ? (i(), u("div", wr, "Шукаю…")) : (i(), u("div", kr, "Нічого не знайдено"))
3038
+ ])) : z("", !0)
2984
3039
  ])
2985
3040
  ])
2986
3041
  ])
2987
3042
  ])
2988
3043
  ]));
2989
3044
  }
2990
- }), gr = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, br = { class: "flex gap-2" }, yr = ["onClick", "title"], xr = ["src"], wr = /* @__PURE__ */ A({
3045
+ }), $r = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Cr = { class: "flex gap-2" }, Vr = ["onClick", "title"], Mr = ["src"], Lr = /* @__PURE__ */ E({
2991
3046
  __name: "map-layers",
2992
3047
  props: {
2993
- basemaps: {},
2994
- defaultLayer: {}
3048
+ basemaps: {}
2995
3049
  },
2996
3050
  emits: ["onLayerChange"],
2997
3051
  setup(o, { emit: e }) {
2998
- const n = k(o.defaultLayer ?? ""), s = e;
2999
- function a(r) {
3000
- s("onLayerChange", r), n.value = r;
3052
+ const r = x(Object.keys(o.basemaps)[0]), s = e;
3053
+ function n(a) {
3054
+ s("onLayerChange", a), r.value = a;
3001
3055
  }
3002
- return (r, d) => (i(), u("div", gr, [
3003
- l("div", br, [
3004
- (i(!0), u(K, null, Y(r.basemaps, (p, f) => (i(), u("div", {
3056
+ return (a, d) => (i(), u("div", $r, [
3057
+ l("div", Cr, [
3058
+ (i(!0), u(ee, null, le(a.basemaps, (p, f) => (i(), u("div", {
3005
3059
  key: f,
3006
- class: S(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === f }]),
3007
- onClick: (c) => a(f),
3008
- title: f,
3060
+ class: M(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": r.value === f }]),
3061
+ onClick: (c) => n(f),
3062
+ title: p.name || f,
3009
3063
  role: "button",
3010
3064
  tabindex: "0"
3011
3065
  }, [
@@ -3013,21 +3067,21 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3013
3067
  src: p.preview,
3014
3068
  alt: "",
3015
3069
  class: "w-14 h-14 object-cover"
3016
- }, null, 8, xr)
3017
- ], 10, yr))), 128))
3070
+ }, null, 8, Mr)
3071
+ ], 10, Vr))), 128))
3018
3072
  ])
3019
3073
  ]));
3020
3074
  }
3021
- }), kr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, _r = { class: "form-geom__panel flex gap-1 items-start mt-2" }, $r = { class: "flex items-center gap-1" }, Cr = ["disabled"], Vr = { class: "absolute top-4 right-4 z-[1000]" }, Lr = { class: "flex flex-col gap-[2px]" }, Mr = ["aria-pressed"], Sr = ["aria-pressed"], Br = ["aria-pressed"], jr = ["aria-pressed"], Ir = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, zr = {
3075
+ }), Sr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, Br = { class: "form-geom__panel flex gap-1 items-start mt-2" }, jr = { class: "flex items-center gap-1" }, Ir = ["disabled"], zr = { class: "absolute top-4 right-4 z-[1000]" }, Ar = { class: "flex flex-col gap-[2px]" }, Or = ["aria-pressed"], Er = ["aria-pressed"], Fr = ["aria-pressed"], Dr = ["aria-pressed"], Ur = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, Tr = {
3022
3076
  key: 0,
3023
3077
  class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
3024
- }, Ar = { class: "mr-auto" }, Er = { class: "font-bold" }, Fr = { class: "flex items-center" }, Or = { class: "text-xs mr-2" }, Dr = {
3078
+ }, Rr = { class: "mr-auto" }, Pr = { class: "font-bold" }, Nr = { class: "flex items-center" }, Hr = { class: "text-xs mr-2" }, qr = {
3025
3079
  key: 0,
3026
3080
  class: "text-xs"
3027
- }, Ur = {
3081
+ }, Gr = {
3028
3082
  key: 1,
3029
3083
  class: "text-xs"
3030
- }, Tr = /* @__PURE__ */ A({
3084
+ }, Jr = /* @__PURE__ */ E({
3031
3085
  __name: "vs-input-map",
3032
3086
  props: {
3033
3087
  tools: {},
@@ -3041,315 +3095,321 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3041
3095
  },
3042
3096
  emits: ["update:modelValue"],
3043
3097
  setup(o, { emit: e }) {
3044
- const t = o;
3045
- console.log(t);
3046
- const n = e, s = k(null);
3047
- let a, r, d;
3048
- const p = k(null), f = k(null), c = k(6), g = k(0), v = k(null), M = {
3049
- topo100: {
3050
- url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3051
- preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
3052
- },
3053
- orto10: {
3054
- url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
3055
- preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"
3056
- },
3057
- osmb: {
3058
- url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",
3059
- preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
3060
- }
3061
- };
3062
- let I;
3063
- const U = k("topo100");
3064
- function T() {
3065
- return new Promise((b, $) => {
3066
- window.L && window.L.Draw && b(0);
3067
- const O = (ee) => {
3068
- if (Array.from(document.styleSheets).some((ge) => ge?.href?.includes(ee))) return;
3069
- const de = document.createElement("link");
3070
- de.rel = "stylesheet", de.href = ee, document.head.appendChild(de);
3071
- }, N = (ee) => new Promise(($e, de) => {
3072
- const ge = Array.from(document.scripts).find((ce) => ce.src === ee);
3098
+ const t = pt(), r = o, s = e, n = x(null);
3099
+ let a, d, p;
3100
+ const f = x(null), c = x(null), b = x(6), v = x(0), C = x(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), V = x(null), D = he();
3101
+ let U;
3102
+ const N = x("topo100");
3103
+ function $() {
3104
+ return new Promise((m, y) => {
3105
+ window.L && window.L.Draw && m(0);
3106
+ const R = (ne) => {
3107
+ if (Array.from(document.styleSheets).some((ge) => ge?.href?.includes(ne))) return;
3108
+ const ve = document.createElement("link");
3109
+ ve.rel = "stylesheet", ve.href = ne, document.head.appendChild(ve);
3110
+ }, H = (ne) => new Promise((Se, ve) => {
3111
+ const ge = Array.from(document.scripts).find((ye) => ye.src === ne);
3073
3112
  if (ge) {
3074
- ge.addEventListener("load", () => $e()), ge.addEventListener("error", (ce) => de(ce));
3113
+ ge.addEventListener("load", () => Se()), ge.addEventListener("error", (ye) => ve(ye));
3075
3114
  return;
3076
3115
  }
3077
3116
  const be = document.createElement("script");
3078
- be.src = ee, be.async = !0, be.onload = () => $e(), be.onerror = (ce) => de(ce), document.body.appendChild(be);
3117
+ be.src = ne, be.async = !0, be.onload = () => Se(), be.onerror = (ye) => ve(ye), document.body.appendChild(be);
3079
3118
  });
3080
- O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), N("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => N("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => b(0)).catch($);
3119
+ R("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), R("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(() => m(0)).catch(y);
3081
3120
  });
3082
3121
  }
3083
- function P() {
3084
- const b = r.toGeoJSON();
3085
- let $ = null;
3086
- b?.features?.length && ($ = b.features[0].geometry), n("update:modelValue", $), g.value = r.getLayers().length;
3122
+ function h() {
3123
+ const m = d.toGeoJSON();
3124
+ let y = null;
3125
+ m?.features?.length && (y = m.features[0].geometry), s("update:modelValue", y), v.value = d.getLayers().length;
3087
3126
  }
3088
- function _(b = 30) {
3089
- const $ = r.getLayers();
3090
- if (!$.length) return;
3091
- const N = L.featureGroup($).getBounds();
3092
- N && N.isValid() && a.fitBounds(N, { padding: [b, b] });
3127
+ function g(m = 30) {
3128
+ const y = d.getLayers();
3129
+ if (!y.length) return;
3130
+ const H = L.featureGroup(y).getBounds();
3131
+ H && H.isValid() && a.fitBounds(H, { padding: [m, m] });
3093
3132
  }
3094
- function x() {
3095
- p.value?.click();
3133
+ function K() {
3134
+ f.value?.click();
3096
3135
  }
3097
- const h = k("");
3098
- function G(b) {
3099
- return b instanceof L.Circle ? "Circle" : b instanceof L.Rectangle ? "Rectangle" : b instanceof L.Polygon && !(b instanceof L.Rectangle) ? "Polygon" : b instanceof L.Polyline && !(b instanceof L.Polygon) ? "Polyline" : b instanceof L.Marker ? "Point" : "Feature";
3136
+ const A = x("");
3137
+ function S(m) {
3138
+ return m instanceof L.Circle ? "Circle" : m instanceof L.Rectangle ? "Rectangle" : m instanceof L.Polygon && !(m instanceof L.Rectangle) ? "Polygon" : m instanceof L.Polyline && !(m instanceof L.Polygon) ? "Polyline" : m instanceof L.Marker ? "Point" : "Feature";
3100
3139
  }
3101
- function C(b) {
3102
- if (b instanceof L.Circle) {
3103
- const $ = b.getRadius();
3104
- return Math.PI * ($ * $) / 1e6;
3140
+ function J(m) {
3141
+ if (m instanceof L.Circle) {
3142
+ const y = m.getRadius();
3143
+ return Math.PI * (y * y) / 1e6;
3105
3144
  }
3106
- if (b instanceof L.Polygon || b instanceof L.Rectangle)
3145
+ if (m instanceof L.Polygon || m instanceof L.Rectangle)
3107
3146
  try {
3108
- const $ = b.getLatLngs(), O = Array.isArray($[0]) ? $[0] : $, N = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(O) : 0;
3109
- return N ? N / 1e6 : 0;
3147
+ const y = m.getLatLngs(), R = Array.isArray(y[0]) ? y[0] : y, H = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(R) : 0;
3148
+ return H ? H / 1e6 : 0;
3110
3149
  } catch {
3111
3150
  return null;
3112
3151
  }
3113
3152
  return null;
3114
3153
  }
3115
- function m(b) {
3116
- return b instanceof L.Circle ? b.getLatLng() : b.getBounds ? b.getBounds().getCenter() : b.getLatLng ? b.getLatLng() : a.getCenter();
3154
+ function Y(m) {
3155
+ return m instanceof L.Circle ? m.getLatLng() : m.getBounds ? m.getBounds().getCenter() : m.getLatLng ? m.getLatLng() : a.getCenter();
3117
3156
  }
3118
- function V() {
3119
- const b = r.getLayers();
3120
- if (!b.length) {
3121
- v.value = null, g.value = 0;
3157
+ function ae() {
3158
+ const m = d.getLayers();
3159
+ if (!m.length) {
3160
+ V.value = null, v.value = 0;
3122
3161
  return;
3123
3162
  }
3124
- const $ = b[b.length - 1], O = G($), N = m($), ee = C($);
3125
- v.value = {
3126
- type: O,
3127
- center: N,
3128
- areaKm2: ee,
3129
- layer: $
3130
- }, g.value = b.length;
3163
+ const y = m[m.length - 1], R = S(y), H = Y(y), ne = J(y);
3164
+ V.value = {
3165
+ type: R,
3166
+ center: H,
3167
+ areaKm2: ne,
3168
+ layer: y
3169
+ }, v.value = m.length;
3131
3170
  }
3132
- function E() {
3133
- const b = v.value?.layer;
3134
- b && (b instanceof L.Circle && b.getBounds ? a.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getBounds ? a.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getLatLng && a.setView(b.getLatLng(), Math.max(c.value, 14)));
3171
+ function $e() {
3172
+ const m = V.value?.layer;
3173
+ m && (m instanceof L.Circle && m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getLatLng && a.setView(m.getLatLng(), Math.max(b.value, 14)));
3135
3174
  }
3136
- function Q() {
3137
- const b = v.value?.layer;
3138
- b && (r.removeLayer(b), P(), V());
3175
+ function Le() {
3176
+ const m = V.value?.layer;
3177
+ m && (d.removeLayer(m), h(), ae());
3139
3178
  }
3140
- ne(async () => {
3141
- await T(), L.drawLocal = Ms, a = L.map(s.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(a), I = L.tileLayer(M.topo100.url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = "topo100", r = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (O) => {
3142
- const { layer: N } = O;
3143
- r.clearLayers(), r.addLayer(N), P(), V(), _(), h.value = "";
3179
+ pe(async () => {
3180
+ await $(), L.drawLocal = Os, a = L.map(n.value, { zoomControl: !1 }).setView(C.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), N.value = Object.keys(D)[0], U = L.tileLayer(D[N.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), d = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (R) => {
3181
+ const { layer: H } = R;
3182
+ d.clearLayers(), d.addLayer(H), h(), ae(), g(), A.value = "";
3144
3183
  }), a.on(L.Draw.Event.EDITED, () => {
3145
- P(), V(), _();
3184
+ h(), ae(), g();
3146
3185
  }), a.on(L.Draw.Event.DELETED, () => {
3147
- P(), V(), _();
3186
+ h(), ae(), g();
3148
3187
  });
3149
- let b = !1;
3150
- a.on("mousemove", (O) => {
3151
- b || (a.invalidateSize(), b = !0), f.value = O.latlng;
3188
+ let m = !1;
3189
+ a.on("mousemove", (R) => {
3190
+ m || (a.invalidateSize(), m = !0), c.value = R.latlng;
3152
3191
  }), a.on("zoomend", () => {
3153
- c.value = a.getZoom();
3192
+ b.value = a.getZoom();
3154
3193
  });
3155
- const $ = Ss(t.modelValue);
3156
- if ($) {
3157
- const O = [];
3158
- L.geoJSON($).eachLayer((N) => O.push(N)), O.length && r.addLayer(O[0]), P(), V(), _();
3194
+ const y = Es(r.modelValue);
3195
+ if (y) {
3196
+ const R = [];
3197
+ L.geoJSON(y).eachLayer((H) => R.push(H)), R.length && d.addLayer(R[0]), h(), ae(), g();
3159
3198
  }
3160
3199
  });
3161
- function te(b) {
3200
+ function B(m) {
3162
3201
  if (a) {
3163
- switch (d && d.disable(), b) {
3202
+ switch (p && p.disable(), m) {
3164
3203
  case "marker":
3165
- d = new L.Draw.Marker(a);
3204
+ p = new L.Draw.Marker(a);
3166
3205
  break;
3167
3206
  case "polyline":
3168
- d = new L.Draw.Polyline(a);
3207
+ p = new L.Draw.Polyline(a);
3169
3208
  break;
3170
3209
  case "polygon":
3171
- d = new L.Draw.Polygon(a);
3210
+ p = new L.Draw.Polygon(a);
3172
3211
  break;
3173
3212
  case "rectangle":
3174
- d = new L.Draw.Rectangle(a);
3213
+ p = new L.Draw.Rectangle(a);
3175
3214
  break;
3176
3215
  default:
3177
- d = new L.Draw.Rectangle(a);
3216
+ p = new L.Draw.Rectangle(a);
3178
3217
  break;
3179
3218
  }
3180
- d && (d.enable(), h.value = b);
3219
+ p && (p.enable(), A.value = m);
3181
3220
  }
3182
3221
  }
3183
- function ye() {
3184
- const b = r.toGeoJSON(), $ = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }), O = URL.createObjectURL($), N = document.createElement("a");
3185
- N.href = O, N.download = "data.geojson", N.click(), URL.revokeObjectURL(O);
3222
+ function _() {
3223
+ const m = d.toGeoJSON(), y = new Blob([JSON.stringify(m, null, 2)], { type: "application/json" }), R = URL.createObjectURL(y), H = document.createElement("a");
3224
+ H.href = R, H.download = "data.geojson", H.click(), URL.revokeObjectURL(R);
3186
3225
  }
3187
- function ke(b) {
3188
- const $ = b.target.files?.[0];
3189
- if (!$) return;
3190
- const O = new FileReader();
3191
- O.onload = () => {
3192
- if (typeof O.result == "string")
3226
+ function j(m) {
3227
+ const y = m.target.files?.[0];
3228
+ if (!y) return;
3229
+ const R = new FileReader();
3230
+ R.onload = () => {
3231
+ if (typeof R.result == "string")
3193
3232
  try {
3194
- const N = JSON.parse(O.result);
3195
- r.clearLayers(), N && L.geoJSON({ type: "Feature", geometry: N }).eachLayer((ee) => {
3196
- r.addLayer(ee);
3197
- }), P(), V(), _();
3233
+ const H = JSON.parse(R.result);
3234
+ d.clearLayers(), H && L.geoJSON({ type: "Feature", geometry: H }).eachLayer((ne) => {
3235
+ d.addLayer(ne);
3236
+ }), h(), ae(), g();
3198
3237
  } finally {
3199
- b.target.value = "";
3238
+ m.target.value = "";
3200
3239
  }
3201
- }, O.readAsText($);
3240
+ }, R.readAsText(y);
3202
3241
  }
3203
- function ue(b) {
3204
- a && (I && a.removeLayer(I), I = L.tileLayer(M[b].url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = b);
3242
+ function q(m) {
3243
+ a && (U && a.removeLayer(U), U = L.tileLayer(D[m].url, { maxZoom: 19, minZoom: 6 }).addTo(a), N.value = m);
3205
3244
  }
3206
- function ze(b) {
3207
- const $ = L.latLng(b[0], b[1]);
3208
- a.setView($, 13);
3245
+ function oe(m) {
3246
+ const y = L.latLng(m[0], m[1]);
3247
+ a.setView(y, 13);
3209
3248
  }
3210
- re(
3211
- () => t.modelValue,
3212
- (b) => {
3213
- r.clearLayers(), b && L.geoJSON({ type: "Feature", geometry: b }).eachLayer(($) => {
3214
- r.addLayer($);
3215
- }), g.value = r.getLayers().length, V(), _();
3249
+ ue(
3250
+ () => r.modelValue,
3251
+ (m) => {
3252
+ d.clearLayers(), m && L.geoJSON({ type: "Feature", geometry: m }).eachLayer((y) => {
3253
+ d.addLayer(y);
3254
+ }), v.value = d.getLayers().length, ae(), g();
3216
3255
  }
3217
3256
  );
3218
- const _e = k(!1);
3219
- return (b, $) => (i(), u("div", {
3220
- class: S(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: _e.value }])
3257
+ function he() {
3258
+ return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((m, y) => Object.assign(m, { key: `b${y}`, preview: m.preview || m.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((m, y) => ({ ...m, [y.key]: y }), {}) : {
3259
+ topo100: {
3260
+ url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3261
+ preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
3262
+ },
3263
+ orto10: {
3264
+ url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
3265
+ preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"
3266
+ },
3267
+ osmb: {
3268
+ url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",
3269
+ preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
3270
+ }
3271
+ };
3272
+ }
3273
+ const de = x(!1);
3274
+ return ue(de, () => {
3275
+ setTimeout(() => {
3276
+ a.invalidateSize();
3277
+ }, 50);
3278
+ }), (m, y) => (i(), u("div", {
3279
+ class: M(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: de.value }])
3221
3280
  }, [
3222
3281
  l("div", {
3223
3282
  ref_key: "mapContainer",
3224
- ref: s,
3283
+ ref: n,
3225
3284
  class: "w-full h-full"
3226
3285
  }, null, 512),
3227
- l("div", kr, [
3228
- j(hr, { onGoToCoordinates: ze }),
3229
- l("div", _r, [
3230
- l("div", $r, [
3286
+ l("div", Sr, [
3287
+ I(_r, { onGoToCoordinates: oe }),
3288
+ l("div", Br, [
3289
+ l("div", jr, [
3231
3290
  l("button", {
3232
3291
  type: "button",
3233
3292
  class: "vs-btn-row",
3234
- onClick: x
3293
+ onClick: K
3235
3294
  }, "Import"),
3236
3295
  l("button", {
3237
3296
  type: "button",
3238
3297
  class: "vs-btn-row",
3239
- onClick: ye,
3240
- disabled: g.value === 0
3241
- }, "Export ", 8, Cr)
3298
+ onClick: _,
3299
+ disabled: v.value === 0
3300
+ }, "Export ", 8, Ir)
3242
3301
  ]),
3243
3302
  l("input", {
3244
3303
  ref_key: "importRef",
3245
- ref: p,
3304
+ ref: f,
3246
3305
  type: "file",
3247
- onChange: ke,
3306
+ onChange: j,
3248
3307
  accept: ".json,.geojson",
3249
3308
  class: "hidden"
3250
3309
  }, null, 544)
3251
3310
  ])
3252
3311
  ]),
3253
- l("div", Vr, [
3254
- l("div", Lr, [
3312
+ l("div", zr, [
3313
+ l("div", Ar, [
3255
3314
  l("button", {
3256
- class: S(["vs-btn", { "vs-active": h.value === "marker" }]),
3257
- "aria-pressed": h.value === "marker",
3315
+ class: M(["vs-btn", { "vs-active": A.value === "marker" }]),
3316
+ "aria-pressed": A.value === "marker",
3258
3317
  title: "Point (P)",
3259
3318
  "aria-label": "Draw point",
3260
- onClick: $[0] || ($[0] = (O) => te("marker"))
3319
+ onClick: y[0] || (y[0] = (R) => B("marker"))
3261
3320
  }, [
3262
- j(zs)
3263
- ], 10, Mr),
3321
+ I(Ts)
3322
+ ], 10, Or),
3264
3323
  l("button", {
3265
- class: S(["vs-btn", { "vs-active": h.value === "polyline" }]),
3266
- "aria-pressed": h.value === "polyline",
3324
+ class: M(["vs-btn", { "vs-active": A.value === "polyline" }]),
3325
+ "aria-pressed": A.value === "polyline",
3267
3326
  title: "Line (L)",
3268
3327
  "aria-label": "Draw polyline",
3269
- onClick: $[1] || ($[1] = (O) => te("polyline"))
3328
+ onClick: y[1] || (y[1] = (R) => B("polyline"))
3270
3329
  }, [
3271
- j(Os)
3272
- ], 10, Sr),
3330
+ I(Hs)
3331
+ ], 10, Er),
3273
3332
  l("button", {
3274
- class: S(["vs-btn", { "vs-active": h.value === "polygon" }]),
3275
- "aria-pressed": h.value === "polygon",
3333
+ class: M(["vs-btn", { "vs-active": A.value === "polygon" }]),
3334
+ "aria-pressed": A.value === "polygon",
3276
3335
  title: "Polygon (G)",
3277
3336
  "aria-label": "Draw polygon",
3278
- onClick: $[2] || ($[2] = (O) => te("polygon"))
3337
+ onClick: y[2] || (y[2] = (R) => B("polygon"))
3279
3338
  }, [
3280
- j(Rs)
3281
- ], 10, Br),
3339
+ I(Ks)
3340
+ ], 10, Fr),
3282
3341
  l("button", {
3283
- class: S(["vs-btn", { "vs-active": h.value === "rectangle" }]),
3284
- "aria-pressed": h.value === "rectangle",
3342
+ class: M(["vs-btn", { "vs-active": A.value === "rectangle" }]),
3343
+ "aria-pressed": A.value === "rectangle",
3285
3344
  title: "Rectangle (R)",
3286
3345
  "aria-label": "Draw rectangle",
3287
- onClick: $[3] || ($[3] = (O) => te("rectangle"))
3346
+ onClick: y[3] || (y[3] = (R) => B("rectangle"))
3288
3347
  }, [
3289
- j(qs)
3290
- ], 10, jr),
3348
+ I(Xs)
3349
+ ], 10, Dr),
3291
3350
  l("button", {
3292
3351
  class: "vs-btn mt-5",
3293
- onClick: $[4] || ($[4] = (O) => _e.value = !_e.value),
3352
+ onClick: y[4] || (y[4] = (R) => {
3353
+ de.value = !de.value;
3354
+ }),
3294
3355
  title: "Full Screen",
3295
3356
  "aria-label": "Full Screen"
3296
3357
  }, [
3297
- j(Zs, { style: { width: "12px", height: "12px" } })
3358
+ I(lr, { style: { width: "12px", height: "12px" } })
3298
3359
  ])
3299
3360
  ])
3300
3361
  ]),
3301
3362
  l("div", {
3302
- class: S(["absolute left-4 z-[1000]", v.value ? "bottom-8" : "bottom-4"])
3363
+ class: M(["absolute left-4 z-[1000]", V.value ? "bottom-8" : "bottom-4"])
3303
3364
  }, [
3304
- j(wr, {
3305
- basemaps: M,
3306
- "default-layer": "topo100",
3307
- onOnLayerChange: ue
3308
- })
3365
+ I(Lr, {
3366
+ basemaps: G(D),
3367
+ onOnLayerChange: q
3368
+ }, null, 8, ["basemaps"])
3309
3369
  ], 2),
3310
- l("div", Ir, [
3311
- v.value ? (i(), u("div", zr, [
3312
- l("div", Ar, [
3313
- $[7] || ($[7] = oe(" Тип: ")),
3314
- l("span", Er, F(v.value.type), 1)
3370
+ l("div", Ur, [
3371
+ V.value ? (i(), u("div", Tr, [
3372
+ l("div", Rr, [
3373
+ y[7] || (y[7] = ie(" Тип: ")),
3374
+ l("span", Pr, F(V.value.type), 1)
3315
3375
  ]),
3316
- l("div", Fr, [
3317
- l("div", Or, [
3318
- $[8] || ($[8] = oe(" Центр: ")),
3319
- l("b", null, F(v.value.center.lat.toFixed(5)) + ", " + F(v.value.center.lng.toFixed(5)), 1)
3376
+ l("div", Nr, [
3377
+ l("div", Hr, [
3378
+ y[8] || (y[8] = ie(" Центр: ")),
3379
+ l("b", null, F(V.value.center.lat.toFixed(5)) + ", " + F(V.value.center.lng.toFixed(5)), 1)
3320
3380
  ]),
3321
- v.value.areaKm2 !== null ? (i(), u("div", Dr, [
3322
- $[9] || ($[9] = oe(" Площа: ")),
3323
- l("b", null, F(v.value.areaKm2.toFixed(1)) + "км²", 1)
3324
- ])) : (i(), u("div", Ur, $[10] || ($[10] = [
3325
- oe(" Площа: "),
3381
+ V.value.areaKm2 !== null ? (i(), u("div", qr, [
3382
+ y[9] || (y[9] = ie(" Площа: ")),
3383
+ l("b", null, F(V.value.areaKm2.toFixed(1)) + "км²", 1)
3384
+ ])) : (i(), u("div", Gr, y[10] || (y[10] = [
3385
+ ie(" Площа: "),
3326
3386
  l("b", null, "—", -1)
3327
3387
  ]))),
3328
3388
  l("button", {
3329
3389
  class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
3330
3390
  title: "Наблизити",
3331
- onClick: $[5] || ($[5] = (O) => E())
3332
- }, $[11] || ($[11] = [
3333
- ae('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-55d330eb><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-55d330eb></path><path d="M7 10l6 0" data-v-55d330eb></path><path d="M10 7l0 6" data-v-55d330eb></path><path d="M21 21l-6 -6" data-v-55d330eb></path></svg>', 1)
3391
+ onClick: y[5] || (y[5] = (R) => $e())
3392
+ }, y[11] || (y[11] = [
3393
+ re('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-e82d2d97><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-e82d2d97></path><path d="M7 10l6 0" data-v-e82d2d97></path><path d="M10 7l0 6" data-v-e82d2d97></path><path d="M21 21l-6 -6" data-v-e82d2d97></path></svg>', 1)
3334
3394
  ])),
3335
3395
  l("button", {
3336
3396
  class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
3337
3397
  title: "Видалити",
3338
- onClick: $[6] || ($[6] = (O) => Q())
3398
+ onClick: y[6] || (y[6] = (R) => Le())
3339
3399
  }, [
3340
- j(Ie, { class: "w-3 h-3" })
3400
+ I(Ee, { class: "w-3 h-3" })
3341
3401
  ])
3342
3402
  ])
3343
- ])) : B("", !0)
3403
+ ])) : z("", !0)
3344
3404
  ])
3345
3405
  ], 2));
3346
3406
  }
3347
- }), Rr = /* @__PURE__ */ R(Tr, [["__scopeId", "data-v-55d330eb"]]), Pr = ["data-focus"], Nr = { class: "flex items-center" }, Hr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, qr = ["onClick", "aria-label"], Gr = {
3407
+ }), Kr = /* @__PURE__ */ P(Jr, [["__scopeId", "data-v-e82d2d97"]]), Zr = ["data-focus"], Wr = { class: "flex items-center" }, Qr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Xr = ["onClick", "aria-label"], Yr = {
3348
3408
  key: 0,
3349
3409
  class: "absolute text-gray-500 truncate pl-2"
3350
- }, Jr = { class: "flex-1 min-w-[2px]" }, Kr = ["placeholder"], Zr = { class: "flex items-center shrink-0" }, Wr = ["disabled"], Qr = /* @__PURE__ */ A({
3410
+ }, en = { class: "flex-1 min-w-[2px]" }, tn = ["placeholder"], ln = { class: "flex items-center shrink-0" }, on = ["disabled"], an = /* @__PURE__ */ E({
3351
3411
  __name: "vs-input-tag",
3352
- props: /* @__PURE__ */ Z({
3412
+ props: /* @__PURE__ */ W({
3353
3413
  unique: { type: Boolean, default: !0 },
3354
3414
  style: { default: () => ({}) },
3355
3415
  customClass: { default: "" },
@@ -3362,71 +3422,71 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3362
3422
  modelValue: { default: [] },
3363
3423
  modelModifiers: {}
3364
3424
  }),
3365
- emits: /* @__PURE__ */ Z(["update:modelValue"], ["update:modelValue"]),
3425
+ emits: /* @__PURE__ */ W(["update:modelValue"], ["update:modelValue"]),
3366
3426
  setup(o, { emit: e }) {
3367
- const t = o, n = e;
3368
- he(t.style);
3369
- const s = k(null), a = k(null), r = k(null), d = k(!1), p = k(""), f = W(o, "modelValue"), c = D(() => t.placeholder || "Add tag…"), g = D(() => f.value?.length === 0 && p.value === ""), v = D(() => !t.disabled && f.value?.length > 0), M = D(() => t.disabled), I = async () => {
3370
- M.value || await Ce(() => r.value?.focus());
3371
- }, U = (C) => {
3372
- const m = C.trim();
3373
- m !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [m] : t.unique ? f.value.includes(m) || (f.value = [...f.value, m]) : f.value = [...f.value, m], p.value = "");
3374
- }, T = () => {
3375
- const C = p.value;
3376
- C.trim() !== "" && U(C), p.value = "";
3377
- }, P = (C) => {
3378
- const m = f.value.slice();
3379
- m.splice(C, 1), n("update:modelValue", m);
3380
- }, _ = () => {
3381
- n("update:modelValue", []);
3382
- }, x = () => {
3383
- M.value || (d.value = !0);
3427
+ const t = o, r = e;
3428
+ _e(t.style);
3429
+ const s = x(null), n = x(null), a = x(null), d = x(!1), p = x(""), f = Q(o, "modelValue"), c = T(() => t.placeholder || "Add tag…"), b = T(() => f.value?.length === 0 && p.value === ""), v = T(() => !t.disabled && f.value?.length > 0), C = T(() => t.disabled), V = async () => {
3430
+ C.value || await Be(() => a.value?.focus());
3431
+ }, D = (A) => {
3432
+ const S = A.trim();
3433
+ S !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [S] : t.unique ? f.value.includes(S) || (f.value = [...f.value, S]) : f.value = [...f.value, S], p.value = "");
3434
+ }, U = () => {
3435
+ const A = p.value;
3436
+ A.trim() !== "" && D(A), p.value = "";
3437
+ }, N = (A) => {
3438
+ const S = f.value.slice();
3439
+ S.splice(A, 1), r("update:modelValue", S);
3440
+ }, $ = () => {
3441
+ r("update:modelValue", []);
3384
3442
  }, h = () => {
3443
+ C.value || (d.value = !0);
3444
+ }, g = () => {
3385
3445
  d.value = !1;
3386
- }, G = (C) => {
3387
- const { key: m } = C;
3388
- m === "Enter" ? (C.preventDefault(), T()) : m === "Backspace" && p.value === "" && f.value.length > 0 && P(f.value.length - 1);
3446
+ }, K = (A) => {
3447
+ const { key: S } = A;
3448
+ S === "Enter" ? (A.preventDefault(), U()) : S === "Backspace" && p.value === "" && f.value.length > 0 && N(f.value.length - 1);
3389
3449
  };
3390
- return (C, m) => (i(), u("div", {
3450
+ return (A, S) => (i(), u("div", {
3391
3451
  class: "flex gap-1 w-full",
3392
3452
  ref_key: "root",
3393
3453
  ref: s,
3394
- onClick: m[1] || (m[1] = se(() => {
3454
+ onClick: S[1] || (S[1] = ce(() => {
3395
3455
  }, ["stop"]))
3396
3456
  }, [
3397
3457
  l("div", {
3398
- class: S(["relative w-full font-sans", t.customClass]),
3458
+ class: M(["relative w-full font-sans", t.customClass]),
3399
3459
  role: "group",
3400
3460
  "aria-label": "Tag input"
3401
3461
  }, [
3402
3462
  l("div", {
3403
- class: S([
3463
+ class: M([
3404
3464
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
3405
3465
  "border-gray-300 hover:border-gray-400",
3406
3466
  d.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3407
- M.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3467
+ C.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3408
3468
  ]),
3409
3469
  "data-focus": d.value ? "true" : "false",
3410
- onClick: I
3470
+ onClick: V
3411
3471
  }, [
3412
3472
  l("div", {
3413
3473
  class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
3414
3474
  ref_key: "chipsRef",
3415
- ref: a
3475
+ ref: n
3416
3476
  }, [
3417
- (i(!0), u(K, null, Y(f.value, (V, E) => (i(), u("div", {
3418
- key: E,
3477
+ (i(!0), u(ee, null, le(f.value, (J, Y) => (i(), u("div", {
3478
+ key: Y,
3419
3479
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
3420
3480
  }, [
3421
- l("div", Nr, [
3422
- l("div", Hr, F(V), 1)
3481
+ l("div", Wr, [
3482
+ l("div", Qr, F(J), 1)
3423
3483
  ]),
3424
3484
  l("div", {
3425
3485
  role: "button",
3426
3486
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
3427
- onClick: se((Q) => P(E), ["stop"]),
3428
- "aria-label": `Remove ${V}`
3429
- }, m[2] || (m[2] = [
3487
+ onClick: ce((ae) => N(Y), ["stop"]),
3488
+ "aria-label": `Remove ${J}`
3489
+ }, S[2] || (S[2] = [
3430
3490
  l("svg", {
3431
3491
  height: "14",
3432
3492
  width: "14",
@@ -3437,14 +3497,14 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3437
3497
  }, [
3438
3498
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
3439
3499
  ], -1)
3440
- ]), 8, qr)
3500
+ ]), 8, Xr)
3441
3501
  ]))), 128)),
3442
- g.value ? (i(), u("div", Gr, F(c.value), 1)) : B("", !0),
3443
- l("div", Jr, [
3444
- M.value ? B("", !0) : q((i(), u("input", {
3502
+ b.value ? (i(), u("div", Yr, F(c.value), 1)) : z("", !0),
3503
+ l("div", en, [
3504
+ C.value ? z("", !0) : X((i(), u("input", {
3445
3505
  key: 0,
3446
3506
  ref_key: "inputRef",
3447
- ref: r,
3507
+ ref: a,
3448
3508
  class: "pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
3449
3509
  autocapitalize: "none",
3450
3510
  autocomplete: "off",
@@ -3453,25 +3513,25 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3453
3513
  type: "text",
3454
3514
  tabindex: "0",
3455
3515
  "aria-label": "Add tag",
3456
- "onUpdate:modelValue": m[0] || (m[0] = (V) => p.value = V),
3457
- onFocus: x,
3458
- onBlur: h,
3459
- onKeydown: G,
3516
+ "onUpdate:modelValue": S[0] || (S[0] = (J) => p.value = J),
3517
+ onFocus: h,
3518
+ onBlur: g,
3519
+ onKeydown: K,
3460
3520
  placeholder: f.value && f.value.length ? "" : void 0
3461
- }, null, 40, Kr)), [
3462
- [ie, p.value]
3521
+ }, null, 40, tn)), [
3522
+ [fe, p.value]
3463
3523
  ])
3464
3524
  ])
3465
3525
  ], 512),
3466
- l("div", Zr, [
3526
+ l("div", ln, [
3467
3527
  v.value ? (i(), u("button", {
3468
3528
  key: 0,
3469
3529
  type: "button",
3470
3530
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
3471
3531
  "aria-label": "Clear all tags",
3472
- disabled: M.value,
3473
- onClick: se(_, ["stop"])
3474
- }, m[3] || (m[3] = [
3532
+ disabled: C.value,
3533
+ onClick: ce($, ["stop"])
3534
+ }, S[3] || (S[3] = [
3475
3535
  l("svg", {
3476
3536
  height: "20",
3477
3537
  width: "20",
@@ -3480,34 +3540,34 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3480
3540
  }, [
3481
3541
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
3482
3542
  ], -1)
3483
- ]), 8, Wr)) : B("", !0)
3543
+ ]), 8, on)) : z("", !0)
3484
3544
  ])
3485
- ], 10, Pr)
3545
+ ], 10, Zr)
3486
3546
  ], 2)
3487
3547
  ], 512));
3488
3548
  }
3489
- }), Xr = {
3490
- VsInputText: Ge,
3491
- VsInputRadio: Ke,
3492
- "vs-input-text": Ge,
3493
- "vs-input-textarea": La,
3494
- "vs-input-mask": rl,
3495
- "vs-input-number": Bt,
3496
- "vs-input-radio": Ke,
3497
- "vs-input-select": Ca,
3498
- "vs-input-switcher": ot,
3499
- "vs-input-static": Je,
3500
- "vs-input-container": na,
3501
- "vs-input-date": xl,
3502
- "vs-input-checkbox": bl,
3503
- "vs-input-file": so,
3504
- "vs-input-html": Je,
3505
- "vs-input-email": ul,
3506
- "vs-input-datatable": Ls,
3507
- "vs-input-map": Rr,
3549
+ }), sn = {
3550
+ VsInputText: qe,
3551
+ VsInputRadio: Je,
3552
+ "vs-input-text": qe,
3553
+ "vs-input-textarea": za,
3554
+ "vs-input-mask": nl,
3555
+ "vs-input-number": jt,
3556
+ "vs-input-radio": Je,
3557
+ "vs-input-select": ja,
3558
+ "vs-input-switcher": lt,
3559
+ "vs-input-static": Ge,
3560
+ "vs-input-container": ia,
3561
+ "vs-input-date": wl,
3562
+ "vs-input-checkbox": yl,
3563
+ "vs-input-file": ro,
3564
+ "vs-input-html": Ge,
3565
+ "vs-input-email": dl,
3566
+ "vs-input-datatable": As,
3567
+ "vs-input-map": Kr,
3508
3568
  "vs-input-file-list": Fo,
3509
- "vs-input-tag": Qr
3510
- }, Yr = /* @__PURE__ */ A({
3569
+ "vs-input-tag": an
3570
+ }, rn = /* @__PURE__ */ E({
3511
3571
  __name: "behavior",
3512
3572
  props: {
3513
3573
  api: {},
@@ -3517,31 +3577,31 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3517
3577
  value: {}
3518
3578
  },
3519
3579
  setup(o) {
3520
- const e = o, t = Be("values");
3521
- async function n() {
3580
+ const e = o, t = ze("values");
3581
+ async function r() {
3522
3582
  try {
3523
3583
  if (!e.api) return;
3524
- const s = e.api.replace("{{value}}", e.value), a = await fetch(s);
3525
- if (!a.ok) {
3526
- fe({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3584
+ const s = e.api.replace("{{value}}", e.value), n = await fetch(s);
3585
+ if (!n.ok) {
3586
+ me({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3527
3587
  return;
3528
3588
  }
3529
- const r = await a.json();
3589
+ const a = await n.json();
3530
3590
  if (!e.set || !t) return;
3531
3591
  for (const [d, p] of Object.entries(e.set))
3532
- t.value[d] = r.result[p];
3592
+ t.value[d] = a.result[p];
3533
3593
  } catch (s) {
3534
3594
  console.error(e.error, s);
3535
3595
  }
3536
3596
  }
3537
- return (s, a) => (i(), u("button", {
3538
- onClick: n,
3597
+ return (s, n) => (i(), u("button", {
3598
+ onClick: r,
3539
3599
  class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
3540
3600
  }, F(s.button), 1));
3541
3601
  }
3542
- }), en = { class: "flex w-full" }, rt = /* @__PURE__ */ A({
3602
+ }), nn = { class: "flex w-full" }, st = /* @__PURE__ */ E({
3543
3603
  __name: "vs-compact-form-layout",
3544
- props: /* @__PURE__ */ Z({
3604
+ props: /* @__PURE__ */ W({
3545
3605
  item: { default: {} },
3546
3606
  layout: { default: "default" },
3547
3607
  style: { default: {} },
@@ -3553,55 +3613,55 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3553
3613
  }),
3554
3614
  emits: ["update:modelValue"],
3555
3615
  setup(o) {
3556
- const e = o, t = W(o, "modelValue"), n = D(() => Lt[`${e.layout}`]), s = D(() => Xr?.[`vs-input-${e.item.type}`]), a = D(() => {
3557
- const d = H(s);
3616
+ const e = o, t = Q(o, "modelValue"), r = T(() => Lt[`${e.layout}`]), s = T(() => sn?.[`vs-input-${e.item.type}`]), n = T(() => {
3617
+ const d = G(s);
3558
3618
  if (!d) return /* @__PURE__ */ new Set();
3559
3619
  const p = d.props ?? d.__vccOpts?.props;
3560
3620
  if (!p) return /* @__PURE__ */ new Set();
3561
3621
  const f = Array.isArray(p) ? p : Object.keys(p);
3562
3622
  return new Set(f);
3563
- }), r = D(() => {
3564
- const d = e.item ?? {}, p = a.value;
3623
+ }), a = T(() => {
3624
+ const d = e.item ?? {}, p = n.value;
3565
3625
  return p.size ? Object.fromEntries(Object.entries(d).filter(([f]) => p.has(f))) : {};
3566
3626
  });
3567
- return (d, p) => (i(), X(we(n.value), {
3627
+ return (d, p) => (i(), te(Ve(r.value), {
3568
3628
  ua: e.item.ua,
3569
3629
  error: e.error || "",
3570
3630
  item: d.item,
3571
3631
  label: e.item.label
3572
3632
  }, {
3573
3633
  default: Me(() => [
3574
- l("div", en, [
3575
- (i(), X(we(s.value), Ve(r.value, {
3634
+ l("div", nn, [
3635
+ (i(), te(Ve(s.value), je(a.value, {
3576
3636
  modelValue: t.value,
3577
3637
  "onUpdate:modelValue": p[0] || (p[0] = (f) => t.value = f)
3578
3638
  }), null, 16, ["modelValue"])),
3579
- d.item.behavior ? (i(), X(Yr, Ve({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : B("", !0)
3639
+ d.item.behavior ? (i(), te(rn, je({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : z("", !0)
3580
3640
  ])
3581
3641
  ]),
3582
3642
  _: 1
3583
3643
  }, 8, ["ua", "error", "item", "label"]));
3584
3644
  }
3585
- }), nt = {
3645
+ }), rt = {
3586
3646
  required: "Це поле є обов’язковим",
3587
3647
  email: "Неправильний email"
3588
- }, tn = (o) => o ? !1 : nt.required, ln = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? nt.email : !1, on = (o, e) => {
3648
+ }, un = (o) => o ? !1 : rt.required, dn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? rt.email : !1, cn = (o, e) => {
3589
3649
  const t = e.pattern ?? e.regexp;
3590
3650
  return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
3591
- }, an = (o, e) => !1, sn = (o, e) => {
3651
+ }, pn = (o, e) => !1, fn = (o, e) => {
3592
3652
  switch (typeof e == "string" ? e : e.type) {
3593
3653
  case "required":
3594
- return tn(o);
3654
+ return un(o);
3595
3655
  case "email":
3596
- return ln(o);
3656
+ return dn(o);
3597
3657
  case "regexp":
3598
- return on(o, e);
3658
+ return cn(o, e);
3599
3659
  case "custom":
3600
- return an();
3660
+ return pn();
3601
3661
  default:
3602
3662
  return !1;
3603
3663
  }
3604
- }, rn = {
3664
+ }, vn = {
3605
3665
  autocomplete: "select",
3606
3666
  combobox: "select",
3607
3667
  datepicker: "date",
@@ -3613,63 +3673,63 @@ const Zs = /* @__PURE__ */ R(Gs, [["render", Ks]]), Ws = { class: "form-geom__se
3613
3673
  file: "file"
3614
3674
  // mask: 'text',
3615
3675
  };
3616
- function Xe(o) {
3676
+ function Qe(o) {
3617
3677
  const e = o.toLowerCase();
3618
- return rn[e] || e;
3678
+ return vn[e] || e;
3619
3679
  }
3620
- function nn(o) {
3680
+ function mn(o) {
3621
3681
  if (Array.isArray(o)) {
3622
3682
  const t = [];
3623
- return o.forEach((n) => {
3624
- const s = { ...n };
3625
- s.name = (n.name || n.id || n.key || "").toString(), s.type = Xe(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, n.data && (s.api = `/api/suggest/${n.data}`), t.push(s);
3683
+ return o.forEach((r) => {
3684
+ const s = { ...r };
3685
+ s.name = (r.name || r.id || r.key || "").toString(), s.type = Qe(r.type), s.label = r.label || r.ua, s.rules = r.rules || r.validators, r.data && (s.api = `/api/suggest/${r.data}`), t.push(s);
3626
3686
  }), t;
3627
3687
  }
3628
3688
  const e = [];
3629
3689
  return Object.entries(o).forEach((t) => {
3630
- const n = {
3690
+ const r = {
3631
3691
  name: t[0],
3632
3692
  ...t[1],
3633
- type: Xe(t[1].type),
3693
+ type: Qe(t[1].type),
3634
3694
  label: t[1].label || t[1].ua,
3635
3695
  rules: t[1].rules || t[1].validators
3636
3696
  };
3637
- t[1].type.includes("list") && (n.multiple = !0), t[1].data && (n.api = `/api/suggest/${t[1].data}`), e.push(n);
3697
+ t[1].type.includes("list") && (r.multiple = !0), t[1].data && (r.api = `/api/suggest/${t[1].data}`), e.push(r);
3638
3698
  }), e;
3639
3699
  }
3640
- function un(o, e) {
3641
- const t = nn(e), n = k({});
3700
+ function hn(o, e) {
3701
+ const t = mn(e), r = x({});
3642
3702
  function s(p) {
3643
3703
  const f = p?.conditions;
3644
3704
  if (!f) return !0;
3645
- const c = Array.isArray(f) ? f[0] : f, g = o?.value?.[c];
3646
- return st(g, f);
3705
+ const c = Array.isArray(f) ? f[0] : f, b = o?.value?.[c];
3706
+ return at(b, f);
3647
3707
  }
3648
- const a = (p = t, f = !0) => (p.forEach((c) => {
3708
+ const n = (p = t, f = !0) => (p.forEach((c) => {
3649
3709
  if (c.rules) {
3650
3710
  if (!s(c)) {
3651
- delete n.value[c.name];
3711
+ delete r.value[c.name];
3652
3712
  return;
3653
3713
  }
3654
- c.rules.forEach((g) => {
3655
- const v = sn(o.value[c.name], g);
3656
- v ? n.value[c.name] = v : delete n.value[c.name];
3714
+ c.rules.forEach((b) => {
3715
+ const v = fn(o.value[c.name], b);
3716
+ v ? r.value[c.name] = v : delete r.value[c.name];
3657
3717
  });
3658
3718
  }
3659
- c.schema && a(c.schema, !1);
3660
- }), f && Object.values(n.value).some(Boolean) ? n.value : null), r = D(() => t?.filter((p) => s(p)));
3719
+ c.schema && n(c.schema, !1);
3720
+ }), f && Object.values(r.value).some(Boolean) ? r.value : null), a = T(() => t?.filter((p) => s(p)));
3661
3721
  return {
3662
- errors: n,
3663
- validate: a,
3722
+ errors: r,
3723
+ validate: n,
3664
3724
  reset: () => {
3665
- o.value = {}, n.value = {};
3725
+ o.value = {}, r.value = {};
3666
3726
  },
3667
- visibleSchema: r
3727
+ visibleSchema: a
3668
3728
  };
3669
3729
  }
3670
- const Ee = /* @__PURE__ */ A({
3730
+ const Oe = /* @__PURE__ */ E({
3671
3731
  __name: "vs-compact-form",
3672
- props: /* @__PURE__ */ Z({
3732
+ props: /* @__PURE__ */ W({
3673
3733
  schema: { default: () => [] },
3674
3734
  style: { default: () => ({}) },
3675
3735
  modelValue: {},
@@ -3681,74 +3741,74 @@ const Ee = /* @__PURE__ */ A({
3681
3741
  values: { default: () => ({}) },
3682
3742
  valuesModifiers: {}
3683
3743
  }),
3684
- emits: /* @__PURE__ */ Z(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3744
+ emits: /* @__PURE__ */ W(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3685
3745
  setup(o, { expose: e, emit: t }) {
3686
- const n = t, s = o, a = W(o, "form"), r = W(o, "values"), {
3746
+ const r = t, s = o, n = Q(o, "form"), a = Q(o, "values"), {
3687
3747
  errors: d,
3688
3748
  validate: p,
3689
3749
  reset: f,
3690
3750
  visibleSchema: c
3691
- } = un(r, s.schema), g = () => {
3692
- n("update:modelValue", r.value), p(), n("handle-submit", r.value);
3751
+ } = hn(a, s.schema), b = () => {
3752
+ r("update:modelValue", a.value), p(), r("handle-submit", a.value);
3693
3753
  };
3694
3754
  e({
3695
3755
  validate: p,
3696
3756
  reset: f,
3697
3757
  errors: d
3698
- }), ne(() => {
3699
- s.modelValue && (r.value = s.modelValue), a.value.value = r.value, a.value.errors = d.value, a.value.reset = f, a.value.validate = p, a.value.formId = s.formId;
3758
+ }), pe(() => {
3759
+ s.modelValue && (a.value = s.modelValue), n.value.value = a.value, n.value.errors = d.value, n.value.reset = f, n.value.validate = p, n.value.formId = s.formId;
3700
3760
  });
3701
- function v(M, I) {
3702
- if (M === I) return !0;
3703
- if (typeof M != "object" || typeof I != "object" || !M || !I) return !1;
3704
- const U = Object.keys(M), T = Object.keys(I);
3705
- return U.length !== T.length ? !1 : U.every((P) => M[P] === I[P]);
3761
+ function v(C, V) {
3762
+ if (C === V) return !0;
3763
+ if (typeof C != "object" || typeof V != "object" || !C || !V) return !1;
3764
+ const D = Object.keys(C), U = Object.keys(V);
3765
+ return D.length !== U.length ? !1 : D.every((N) => C[N] === V[N]);
3706
3766
  }
3707
- return He("form", a), He("values", r), (M, I) => (i(), u("form", {
3708
- onSubmit: se(g, ["prevent"]),
3709
- class: S(["grid grid-cols-12", M.layout === "default" ? "gap-6" : "gap-4"])
3767
+ return He("form", n), He("values", a), (C, V) => (i(), u("form", {
3768
+ onSubmit: ce(b, ["prevent"]),
3769
+ class: M(["grid grid-cols-12", C.layout === "default" ? "gap-6" : "gap-4"])
3710
3770
  }, [
3711
- (i(!0), u(K, null, Y(H(c), (U) => (i(), X(rt, {
3712
- key: U.name,
3713
- class: S(M.layout === "horizontal" ? "col-span-12" : `col-span-${U.col || 12} `),
3714
- style: ve(M.style),
3715
- item: U,
3716
- layout: M.layout,
3717
- "model-value": r.value[U.name],
3718
- "onUpdate:modelValue": (T) => {
3719
- const P = r.value[U.name];
3720
- v(P, T) || (r.value[U.name] = T);
3771
+ (i(!0), u(ee, null, le(G(c), (D) => (i(), te(st, {
3772
+ key: D.name,
3773
+ class: M(C.layout === "horizontal" ? "col-span-12" : `col-span-${D.col || 12} `),
3774
+ style: we(C.style),
3775
+ item: D,
3776
+ layout: C.layout,
3777
+ "model-value": a.value[D.name],
3778
+ "onUpdate:modelValue": (U) => {
3779
+ const N = a.value[D.name];
3780
+ v(N, U) || (a.value[D.name] = U);
3721
3781
  },
3722
- error: H(d)[U.name]
3782
+ error: G(d)[D.name]
3723
3783
  }, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
3724
3784
  ], 34));
3725
3785
  }
3726
3786
  });
3727
- Ee.install = function(e) {
3728
- e.component("VForm", Ee), Object.assign(e.config.globalProperties, {
3729
- $form: Le
3730
- }), e.provide("form", Le), window.v3plugin || (window.v3plugin = {});
3787
+ Oe.install = function(e) {
3788
+ e.component("VForm", Oe), Object.assign(e.config.globalProperties, {
3789
+ $form: De
3790
+ }), e.provide("form", De), window.v3plugin || (window.v3plugin = {});
3731
3791
  };
3732
3792
  export {
3733
- ua as ModalEdit,
3734
- Ee as VForm,
3735
- bl as VsInputCheckbox,
3736
- na as VsInputContainer,
3737
- xl as VsInputDate,
3738
- ul as VsInputEmail,
3739
- so as VsInputFile,
3793
+ ma as ModalEdit,
3794
+ Oe as VForm,
3795
+ yl as VsInputCheckbox,
3796
+ ia as VsInputContainer,
3797
+ wl as VsInputDate,
3798
+ dl as VsInputEmail,
3799
+ ro as VsInputFile,
3740
3800
  Fo as VsInputFileList,
3741
- rl as VsInputMask,
3742
- Bt as VsInputNumber,
3743
- Ke as VsInputRadio,
3744
- Ca as VsInputSelect,
3745
- Je as VsInputStatic,
3746
- ot as VsInputSwitcher,
3747
- Qr as VsInputTag,
3748
- Ge as VsInputText,
3749
- La as VsInputTextarea,
3750
- Ee as default,
3751
- Xr as inputs,
3752
- Ls as vsInputDatatable,
3753
- Rr as vsInputMap
3801
+ nl as VsInputMask,
3802
+ jt as VsInputNumber,
3803
+ Je as VsInputRadio,
3804
+ ja as VsInputSelect,
3805
+ Ge as VsInputStatic,
3806
+ lt as VsInputSwitcher,
3807
+ an as VsInputTag,
3808
+ qe as VsInputText,
3809
+ za as VsInputTextarea,
3810
+ Oe as default,
3811
+ sn as inputs,
3812
+ As as vsInputDatatable,
3813
+ Kr as vsInputMap
3754
3814
  };