@signal24/vue-foundation 4.28.2 → 4.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,15 @@
1
- import { defineComponent as N, ref as S, computed as T, watch as I, onMounted as _, createElementBlock as k, withDirectives as ie, openBlock as b, createElementVNode as $, toDisplayString as R, createCommentVNode as V, Fragment as le, renderList as re, vModelSelect as Vt, getCurrentInstance as be, withModifiers as ke, normalizeStyle as Ht, normalizeClass as H, renderSlot as W, reactive as At, h as ae, Teleport as $t, markRaw as Bt, onBeforeUnmount as ue, resolveDirective as _t, createBlock as Je, createSlots as Nt, withCtx as he, createTextVNode as X, vModelText as Rt, onActivated as Qe, onDeactivated as et } from "vue";
2
- import { compact as tt, cloneDeep as Wt, uniq as jt, groupBy as Ut, isEqual as we, debounce as Pt, startCase as qt, upperFirst as zt, remove as Kt, last as Yt } from "lodash";
3
- import { configureOpenApiClient as Xt, OpenApiError as Zt } from "@signal24/openapi-client-codegen/browser";
4
- import { escapeHtml as Gt } from "@vue/shared";
5
- import { escapeHtml as vs } from "@vue/shared";
6
- import { format as U, addDays as Jt, parse as Qt } from "date-fns";
1
+ import { defineComponent as _, ref as S, computed as T, watch as I, onMounted as N, createElementBlock as k, withDirectives as re, openBlock as b, createElementVNode as $, toDisplayString as R, createCommentVNode as H, Fragment as ie, renderList as le, vModelSelect as At, getCurrentInstance as be, withModifiers as ke, normalizeStyle as $t, normalizeClass as V, renderSlot as U, reactive as Bt, h as ae, Teleport as Nt, markRaw as _t, onBeforeUnmount as ue, resolveDirective as Rt, createBlock as Qe, createSlots as Ut, withCtx as he, createTextVNode as X, vModelText as jt, onActivated as et, onDeactivated as tt } from "vue";
2
+ import { compact as nt, cloneDeep as Pt, uniq as Wt, groupBy as qt, isEqual as we, debounce as zt, startCase as Kt, upperFirst as Yt, remove as Xt, last as Gt } from "lodash";
3
+ import { escapeHtml as Zt } from "@vue/shared";
4
+ import { escapeHtml as ys } from "@vue/shared";
5
+ import { format as P, addDays as Jt, parse as Qt } from "date-fns";
7
6
  const en = {
8
7
  key: 0,
9
8
  disabled: ""
10
9
  }, tn = {
11
10
  key: 0,
12
11
  value: null
13
- }, nn = ["value"], _o = /* @__PURE__ */ N({
12
+ }, nn = ["value"], jo = /* @__PURE__ */ _({
14
13
  __name: "vf-ajax-select",
15
14
  props: {
16
15
  modelValue: {},
@@ -22,28 +21,28 @@ const en = {
22
21
  },
23
22
  emits: ["update:modelValue"],
24
23
  setup(e, { emit: t }) {
25
- const n = e, o = t, l = S(null), s = T(() => l.value ? l.value.map((d) => {
26
- const E = d;
27
- return n.preprocesor ? n.preprocesor(E) : n.displayKey ? E[n.displayKey] : "";
28
- }) : null), u = S(n.modelValue ?? null);
29
- I(() => n.loadFn, r), I(
24
+ const n = e, o = t, r = S(null), s = T(() => r.value ? r.value.map((d) => {
25
+ const h = d;
26
+ return n.preprocesor ? n.preprocesor(h) : n.displayKey ? h[n.displayKey] : "";
27
+ }) : null), a = S(n.modelValue ?? null);
28
+ I(() => n.loadFn, l), I(
30
29
  () => n.modelValue,
31
- () => u.value = n.modelValue
32
- ), I(u, () => o("update:modelValue", u.value));
33
- async function r() {
34
- l.value = await n.loadFn();
30
+ () => a.value = n.modelValue
31
+ ), I(a, () => o("update:modelValue", a.value));
32
+ async function l() {
33
+ r.value = await n.loadFn();
35
34
  }
36
- return _(r), (c, d) => s.value ? ie((b(), k("select", {
35
+ return N(l), (u, d) => s.value ? re((b(), k("select", {
37
36
  key: 1,
38
- "onUpdate:modelValue": d[0] || (d[0] = (E) => u.value = E)
37
+ "onUpdate:modelValue": d[0] || (d[0] = (h) => a.value = h)
39
38
  }, [
40
- n.nullText ? (b(), k("option", tn, R(n.nullText), 1)) : V("", !0),
41
- (b(!0), k(le, null, re(s.value, (E, h) => (b(), k("option", {
42
- key: h,
43
- value: l.value?.[h]
44
- }, R(E), 9, nn))), 128))
39
+ n.nullText ? (b(), k("option", tn, R(n.nullText), 1)) : H("", !0),
40
+ (b(!0), k(ie, null, le(s.value, (h, m) => (b(), k("option", {
41
+ key: m,
42
+ value: r.value?.[m]
43
+ }, R(h), 9, nn))), 128))
45
44
  ], 512)), [
46
- [Vt, u.value]
45
+ [At, a.value]
47
46
  ]) : (b(), k("select", en, [
48
47
  $("option", null, R(n.loadingText || "Loading..."), 1)
49
48
  ]));
@@ -55,104 +54,104 @@ const en = {
55
54
  defaultTimeFormat: "H:mm",
56
55
  defaultCurrencyDivisor: 1
57
56
  };
58
- function No(e) {
57
+ function Po(e) {
59
58
  Object.assign(F, e);
60
59
  }
61
- const on = /* @__PURE__ */ N({
60
+ const on = /* @__PURE__ */ _({
62
61
  __name: "overlay-anchor",
63
62
  props: {
64
63
  overlayId: {},
65
64
  anchor: {}
66
65
  },
67
66
  setup(e) {
68
- const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }), l = S([]), s = be();
69
- _(u);
70
- function u() {
67
+ const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = S({ visibility: "hidden", top: "0", left: "0" }), r = S([]), s = be();
68
+ N(a);
69
+ function a() {
71
70
  if (!s) return;
72
- const d = s.vnode.el, { styles: E, classes: h } = r(d, n);
73
- o.value = E, l.value = h;
71
+ const d = s.vnode.el, { styles: h, classes: m } = l(d, n);
72
+ o.value = h, r.value = m;
74
73
  }
75
- function r(d, E) {
76
- const h = t.anchor instanceof HTMLElement ? {} : t.anchor, g = E.getBoundingClientRect(), a = d.getBoundingClientRect();
77
- h.matchWidth && (a.width = g.width), h.matchHeight && (a.height = g.height);
78
- const f = h.class ? Array.isArray(h.class) ? h.class : [h.class] : [];
79
- let m, C;
80
- if (h.y === "center")
81
- m = g.top + g.height / 2 - a.height / 2, f.push("anchored-center-y");
74
+ function l(d, h) {
75
+ const m = t.anchor instanceof HTMLElement ? {} : t.anchor, w = h.getBoundingClientRect(), c = d.getBoundingClientRect();
76
+ m.matchWidth && (c.width = w.width), m.matchHeight && (c.height = w.height);
77
+ const f = m.class ? Array.isArray(m.class) ? m.class : [m.class] : [];
78
+ let y, C;
79
+ if (m.y === "center")
80
+ y = w.top + w.height / 2 - c.height / 2, f.push("anchored-center-y");
82
81
  else {
83
- const B = (g.bottom + a.height < window.innerHeight || h.y === "below") && h.y !== "above";
84
- m = B ? g.bottom : g.top - a.height, f.push(B ? "anchored-top" : "anchored-bottom");
82
+ const B = (w.bottom + c.height < window.innerHeight || m.y === "below") && m.y !== "above";
83
+ y = B ? w.bottom : w.top - c.height, f.push(B ? "anchored-top" : "anchored-bottom");
85
84
  }
86
- if (h.x === "center")
87
- C = g.left + g.width / 2 - a.width / 2, f.push("anchored-center-x");
85
+ if (m.x === "center")
86
+ C = w.left + w.width / 2 - c.width / 2, f.push("anchored-center-x");
88
87
  else {
89
- const B = (g.left + a.width < window.innerWidth || h.x === "left") && h.x !== "right";
90
- C = B ? g.left : g.right - a.width, f.push(B ? "anchored-left" : "anchored-right");
88
+ const B = (w.left + c.width < window.innerWidth || m.x === "left") && m.x !== "right";
89
+ C = B ? w.left : w.right - c.width, f.push(B ? "anchored-left" : "anchored-right");
91
90
  }
92
91
  return {
93
92
  styles: {
94
- top: `${m}px`,
93
+ top: `${y}px`,
95
94
  left: `${C}px`,
96
- ...h.matchWidth ? { width: `${a.width}px` } : {},
97
- ...h.matchHeight ? { height: `${a.height}px` } : {}
95
+ ...m.matchWidth ? { width: `${c.width}px` } : {},
96
+ ...m.matchHeight ? { height: `${c.height}px` } : {}
98
97
  },
99
98
  classes: f
100
99
  };
101
100
  }
102
- function c() {
103
- window.removeEventListener("click", c), rn(t.overlayId);
101
+ function u() {
102
+ window.removeEventListener("click", u), ln(t.overlayId);
104
103
  }
105
- return _(() => {
104
+ return N(() => {
106
105
  setTimeout(() => {
107
- window.addEventListener("click", c);
106
+ window.addEventListener("click", u);
108
107
  }, 10);
109
- }), (d, E) => (b(), k("div", {
110
- class: H(["vf-overlay-anchor", l.value]),
111
- style: Ht(o.value),
112
- onClick: ke(c, ["stop"])
108
+ }), (d, h) => (b(), k("div", {
109
+ class: V(["vf-overlay-anchor", r.value]),
110
+ style: $t(o.value),
111
+ onClick: ke(u, ["stop"])
113
112
  }, [
114
- W(d.$slots, "default")
113
+ U(d.$slots, "default")
115
114
  ], 6));
116
115
  }
117
116
  });
118
117
  let sn = 0;
119
- const A = At([]);
118
+ const A = Bt([]);
120
119
  I(A, () => {
121
120
  F.onOverlaysChanged?.(A.length);
122
121
  });
123
- const Ro = N({
122
+ const Wo = _({
124
123
  setup() {
125
124
  return () => ae("div", [
126
- re(A, (e) => ae($t, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
125
+ le(A, (e) => ae(Nt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
127
126
  ]);
128
127
  }
129
128
  });
130
129
  function ce(e, t, n) {
131
130
  const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
132
131
  o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
133
- const l = String(++sn), s = Bt(e), u = ae(s, t), r = n?.anchor ? ae(on, { overlayId: l, anchor: n.anchor }, () => [u]) : void 0, c = {
134
- id: l,
132
+ const r = String(++sn), s = _t(e), a = ae(s, t), l = n?.anchor ? ae(on, { overlayId: r, anchor: n.anchor }, () => [a]) : void 0, u = {
133
+ id: r,
135
134
  component: s,
136
135
  props: t,
137
136
  options: n ?? {},
138
- vnode: u,
139
- wrapperVnode: r
137
+ vnode: a,
138
+ wrapperVnode: l
140
139
  };
141
- return A.push(c), c;
140
+ return A.push(u), u;
142
141
  }
143
- function Wo(e) {
144
- e.$ && nt(e.$);
142
+ function qo(e) {
143
+ e.$ && ot(e.$);
145
144
  }
146
- function nt(e) {
145
+ function ot(e) {
147
146
  let t = e;
148
- for (; t && !ln(t.vnode); )
147
+ for (; t && !rn(t.vnode); )
149
148
  t = t.parent;
150
149
  }
151
- function ln(e) {
150
+ function rn(e) {
152
151
  const t = A.findIndex((n) => n.vnode.component === e.component);
153
152
  return t >= 0 ? (A[t].props.callback(), !0) : !1;
154
153
  }
155
- function rn(e) {
154
+ function ln(e) {
156
155
  const t = A.findIndex((n) => n.id === e);
157
156
  return t >= 0 ? (A[t].props.callback(), !0) : !1;
158
157
  }
@@ -162,16 +161,16 @@ function Q(e) {
162
161
  }
163
162
  async function Te(e, t, n) {
164
163
  return new Promise((o) => {
165
- let l = null;
166
- const u = { ...t, callback: async (r) => {
164
+ let r = null;
165
+ const a = { ...t, callback: async (l) => {
167
166
  if (n?.onCallback) {
168
- const c = n.onCallback(r);
169
- if (typeof c == "object" && "then" in c && typeof c.then == "function" && await c === !1)
167
+ const u = n.onCallback(l);
168
+ if (typeof u == "object" && "then" in u && typeof u.then == "function" && await u === !1)
170
169
  return;
171
170
  }
172
- Q(l), o(r);
171
+ Q(r), o(l);
173
172
  } };
174
- l = ce(e, u, n);
173
+ r = ce(e, a, n);
175
174
  });
176
175
  }
177
176
  async function an(e, t) {
@@ -188,14 +187,14 @@ function te(e, t) {
188
187
  async function un(e, t) {
189
188
  await Te(ne, te(e, t));
190
189
  }
191
- async function jo(e, t) {
190
+ async function zo(e, t) {
192
191
  const n = te(e, t);
193
192
  return await Te(ne, {
194
193
  ...n,
195
194
  shouldConfirm: !0
196
195
  }) === !0;
197
196
  }
198
- async function Uo(e, t) {
197
+ async function Ko(e, t) {
199
198
  const n = te(e, t);
200
199
  return await Te(ne, {
201
200
  ...n,
@@ -203,7 +202,7 @@ async function Uo(e, t) {
203
202
  classes: ["destructive", ...n.classes]
204
203
  }) === !0;
205
204
  }
206
- function Po(e, t) {
205
+ function Yo(e, t) {
207
206
  const n = te(e, t), o = ce(ne, {
208
207
  ...n,
209
208
  isBare: !0,
@@ -213,7 +212,7 @@ function Po(e, t) {
213
212
  });
214
213
  return () => Q(o);
215
214
  }
216
- function qo(e, t) {
215
+ function Xo(e, t) {
217
216
  const n = te(e, t), o = ce(ne, {
218
217
  ...n,
219
218
  isBare: !0,
@@ -222,8 +221,8 @@ function qo(e, t) {
222
221
  }
223
222
  });
224
223
  return {
225
- update: (l) => {
226
- an(o, { message: l });
224
+ update: (r) => {
225
+ an(o, { message: r });
227
226
  },
228
227
  dismiss: () => Q(o)
229
228
  };
@@ -246,7 +245,7 @@ function Se(e) {
246
245
  function dn(e) {
247
246
  return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
248
247
  }
249
- async function zo(e, t) {
248
+ async function Go(e, t) {
250
249
  const n = Se(e);
251
250
  return n instanceof de || F.errorHandler(n), un({
252
251
  title: t?.title,
@@ -254,46 +253,46 @@ async function zo(e, t) {
254
253
  classes: t?.classes
255
254
  });
256
255
  }
257
- async function Ko(e) {
256
+ async function Zo(e) {
258
257
  const t = Se(e);
259
258
  t instanceof de || F.errorHandler(t);
260
259
  }
261
- const Z = Symbol("MaskState");
262
- function Yo(e, t) {
260
+ const G = Symbol("MaskState");
261
+ function Jo(e, t) {
263
262
  const n = e.$?.vnode.el, o = n.closest(".vf-modal");
264
263
  return fn(o ?? n, t);
265
264
  }
266
- function Xo(e) {
265
+ function Qo(e) {
267
266
  const t = e.$?.vnode.el, n = t.closest(".vf-modal");
268
- return ot(n ?? t);
267
+ return st(n ?? t);
269
268
  }
270
269
  function fn(e, t) {
271
- if (!e[Z]) {
270
+ if (!e[G]) {
272
271
  const n = document.createElement("div");
273
- n.classList.add("vf-mask"), e.appendChild(n), e[Z] = { maskEl: n };
272
+ n.classList.add("vf-mask"), e.appendChild(n), e[G] = { maskEl: n };
274
273
  }
275
- return e[Z].maskEl.innerText = t ?? "", () => ot(e);
274
+ return e[G].maskEl.innerText = t ?? "", () => st(e);
276
275
  }
277
- function ot(e) {
278
- e[Z] && e.removeChild(e[Z].maskEl);
276
+ function st(e) {
277
+ e[G] && e.removeChild(e[G].maskEl);
279
278
  }
280
279
  const Ee = Symbol("FormMaskState");
281
- function vn(e, t, n) {
280
+ function pn(e, t, n) {
282
281
  const o = e instanceof Element ? e : it(e);
283
282
  if (!o) return () => {
284
283
  };
285
284
  o.classList.add("vf-masked");
286
- const l = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
285
+ const r = t instanceof Element ? t : o.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0];
287
286
  let s;
288
- l && (s = l.tagName === "INPUT" ? l.value : l.innerHTML, l.setAttribute("disabled", "disabled"), l.innerText = n ?? "Please wait...");
289
- const r = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
290
- return r.forEach((c) => c.setAttribute("disabled", "disabled")), o[Ee] = {
291
- disabledElements: r,
292
- waitButton: l,
287
+ r && (s = r.tagName === "INPUT" ? r.value : r.innerHTML, r.setAttribute("disabled", "disabled"), r.innerText = n ?? "Please wait...");
288
+ const l = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
289
+ return l.forEach((u) => u.setAttribute("disabled", "disabled")), o[Ee] = {
290
+ disabledElements: l,
291
+ waitButton: r,
293
292
  buttonHtml: s
294
- }, () => st(o);
293
+ }, () => rt(o);
295
294
  }
296
- function st(e) {
295
+ function rt(e) {
297
296
  const t = e instanceof Element ? e : it(e);
298
297
  if (!t) return;
299
298
  const n = t[Ee];
@@ -303,13 +302,13 @@ function it(e) {
303
302
  const t = e?.$?.vnode.el;
304
303
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
305
304
  }
306
- const pn = ["id"], mn = {
305
+ const vn = ["id"], mn = {
307
306
  key: 0,
308
307
  class: "vf-modal-header"
309
308
  }, hn = { class: "vf-modal-content" }, yn = {
310
309
  key: 1,
311
310
  class: "vf-modal-footer"
312
- }, gn = /* @__PURE__ */ N({
311
+ }, gn = /* @__PURE__ */ _({
313
312
  __name: "vf-modal",
314
313
  props: {
315
314
  id: {},
@@ -321,68 +320,68 @@ const pn = ["id"], mn = {
321
320
  emits: ["formSubmit"],
322
321
  setup(e, { expose: t }) {
323
322
  const n = be(), o = e;
324
- t({ mask: h, unmask: g, hide: a, unhide: f });
325
- const l = S(), s = S(), u = S(!1), r = T(() => tt([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
326
- _(() => {
327
- document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d), l.value?.addEventListener("click", c));
323
+ t({ mask: m, unmask: w, hide: c, unhide: f });
324
+ const r = S(), s = S(), a = S(!1), l = T(() => nt([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
325
+ N(() => {
326
+ document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", d), r.value?.addEventListener("click", u));
328
327
  }), ue(() => {
329
328
  window.removeEventListener("keydown", d), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
330
329
  });
331
- function c(m) {
332
- m.target == l.value && E();
330
+ function u(y) {
331
+ y.target == r.value && h();
333
332
  }
334
- function d(m) {
335
- if (m.key === "Esc" || m.key === "Escape") {
333
+ function d(y) {
334
+ if (y.key === "Esc" || y.key === "Escape") {
336
335
  const C = document.querySelectorAll(".vf-modal-wrap");
337
- C[C.length - 1] === l.value && E();
336
+ C[C.length - 1] === r.value && h();
338
337
  }
339
338
  }
340
- function E() {
341
- nt(n);
342
- }
343
339
  function h() {
344
- return vn(s.value), () => g();
340
+ ot(n);
345
341
  }
346
- function g() {
347
- st(s.value);
342
+ function m() {
343
+ return pn(s.value), () => w();
348
344
  }
349
- function a() {
350
- return u.value = !0, () => f();
345
+ function w() {
346
+ rt(s.value);
347
+ }
348
+ function c() {
349
+ return a.value = !0, () => f();
351
350
  }
352
351
  function f() {
353
- u.value = !1;
352
+ a.value = !1;
354
353
  }
355
- return (m, C) => (b(), k("div", {
356
- id: m.id,
354
+ return (y, C) => (b(), k("div", {
355
+ id: y.id,
357
356
  ref_key: "overlay",
358
- ref: l,
359
- class: H(["vf-overlay vf-modal-wrap", r.value])
357
+ ref: r,
358
+ class: V(["vf-overlay vf-modal-wrap", l.value])
360
359
  }, [
361
360
  $("form", {
362
361
  ref_key: "form",
363
362
  ref: s,
364
363
  action: ".",
365
- class: H(["vf-modal", { scrolls: m.scrolls }]),
366
- onSubmit: C[0] || (C[0] = ke((x) => m.$emit("formSubmit"), ["prevent"]))
364
+ class: V(["vf-modal", { scrolls: y.scrolls }]),
365
+ onSubmit: C[0] || (C[0] = ke((x) => y.$emit("formSubmit"), ["prevent"]))
367
366
  }, [
368
- m.$slots.header ? (b(), k("div", mn, [
369
- W(m.$slots, "header"),
367
+ y.$slots.header ? (b(), k("div", mn, [
368
+ U(y.$slots, "header"),
370
369
  o.closeX ? (b(), k("i", {
371
370
  key: 0,
372
371
  class: "close",
373
- onClick: E
374
- })) : V("", !0)
375
- ])) : V("", !0),
372
+ onClick: h
373
+ })) : H("", !0)
374
+ ])) : H("", !0),
376
375
  $("div", hn, [
377
- W(m.$slots, "default")
376
+ U(y.$slots, "default")
378
377
  ]),
379
- m.$slots.footer ? (b(), k("div", yn, [
380
- W(m.$slots, "footer")
381
- ])) : V("", !0)
378
+ y.$slots.footer ? (b(), k("div", yn, [
379
+ U(y.$slots, "footer")
380
+ ])) : H("", !0)
382
381
  ], 34)
383
- ], 10, pn));
382
+ ], 10, vn));
384
383
  }
385
- }), wn = ["innerHtml"], En = ["innerText"], ne = /* @__PURE__ */ N({
384
+ }), wn = ["innerHtml"], En = ["innerText"], ne = /* @__PURE__ */ _({
386
385
  __name: "vf-alert-modal",
387
386
  props: {
388
387
  isBare: { type: Boolean },
@@ -396,16 +395,16 @@ const pn = ["id"], mn = {
396
395
  },
397
396
  setup(e) {
398
397
  const t = e, n = T(() => t.message instanceof Error ? cn(t.message) : t.message);
399
- return (o, l) => {
400
- const s = _t("autofocus");
401
- return b(), Je(gn, {
402
- class: H(["vf-alert", ...o.classes ?? []])
403
- }, Nt({
398
+ return (o, r) => {
399
+ const s = Rt("autofocus");
400
+ return b(), Qe(gn, {
401
+ class: V(["vf-alert", ...o.classes ?? []])
402
+ }, Ut({
404
403
  default: he(() => [
405
404
  o.iconClass ? (b(), k("i", {
406
405
  key: 0,
407
- class: H(["vf-alert-icon", o.iconClass])
408
- }, null, 2)) : V("", !0),
406
+ class: V(["vf-alert-icon", o.iconClass])
407
+ }, null, 2)) : H("", !0),
409
408
  o.isHtml ? (b(), k("div", {
410
409
  key: 1,
411
410
  innerHtml: o.message,
@@ -427,24 +426,24 @@ const pn = ["id"], mn = {
427
426
  o.isBare ? void 0 : {
428
427
  name: "footer",
429
428
  fn: he(() => [
430
- o.shouldConfirm ? (b(), k(le, { key: 0 }, [
431
- ie((b(), k("button", {
429
+ o.shouldConfirm ? (b(), k(ie, { key: 0 }, [
430
+ re((b(), k("button", {
432
431
  class: "primary",
433
- onClick: l[0] || (l[0] = () => o.callback(!0))
434
- }, l[3] || (l[3] = [
432
+ onClick: r[0] || (r[0] = () => o.callback(!0))
433
+ }, r[3] || (r[3] = [
435
434
  X("Confirm")
436
435
  ]))), [
437
436
  [s]
438
437
  ]),
439
438
  $("button", {
440
439
  class: "default",
441
- onClick: l[1] || (l[1] = () => o.callback(!1))
440
+ onClick: r[1] || (r[1] = () => o.callback(!1))
442
441
  }, "Cancel")
443
- ], 64)) : ie((b(), k("button", {
442
+ ], 64)) : re((b(), k("button", {
444
443
  key: 1,
445
444
  class: "default",
446
- onClick: l[2] || (l[2] = () => o.callback(!0))
447
- }, l[4] || (l[4] = [
445
+ onClick: r[2] || (r[2] = () => o.callback(!0))
446
+ }, r[4] || (r[4] = [
448
447
  X("OK")
449
448
  ]))), [
450
449
  [s]
@@ -456,66 +455,138 @@ const pn = ["id"], mn = {
456
455
  };
457
456
  }
458
457
  });
459
- function Zo(e, t, n) {
458
+ function es(e, t, n) {
460
459
  const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
461
460
  return o === -1 ? !1 : (e.splice(o, 1, n), !0);
462
461
  }
463
- function Go(e, t) {
462
+ function ts(e, t) {
464
463
  const n = document.createElement("div");
465
- n.classList.add("vf-overlay"), n.addEventListener("click", h), document.body.appendChild(n);
464
+ n.classList.add("vf-overlay"), n.addEventListener("click", m), document.body.appendChild(n);
466
465
  const o = document.createElement("div");
467
466
  o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
468
- const l = e.currentTarget;
469
- l.style.userSelect = "none", l.classList.add("context-menu-active"), t.targetClass && l.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((a) => {
470
- if (a == "-") {
471
- const m = document.createElement("div");
472
- m.classList.add("separator"), o.appendChild(m);
467
+ const r = e.currentTarget;
468
+ r.style.userSelect = "none", r.classList.add("context-menu-active"), t.targetClass && r.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((c) => {
469
+ if (c == "-") {
470
+ const y = document.createElement("div");
471
+ y.classList.add("separator"), o.appendChild(y);
473
472
  return;
474
473
  }
475
474
  const f = document.createElement("div");
476
- f.classList.add("item"), f.style.userSelect = "none", f.innerText = a.title, o.appendChild(f), a.class && f.classList.add(a.class), a.shouldConfirm ? f.addEventListener("click", (m) => g(m, f, a.handler)) : f.addEventListener("click", () => a.handler());
475
+ f.classList.add("item"), f.style.userSelect = "none", f.innerText = c.title, o.appendChild(f), c.class && f.classList.add(c.class), c.shouldConfirm ? f.addEventListener("click", (y) => w(y, f, c.handler)) : f.addEventListener("click", () => c.handler());
477
476
  });
478
- const s = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, c = o.offsetWidth, d = s < c ? e.clientX - c - 1 : e.clientX + 1, E = u < r ? e.clientY - r - 1 : e.clientY + 1;
479
- o.style.left = d + "px", o.style.top = E + "px", setTimeout(() => {
477
+ const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, l = o.offsetHeight, u = o.offsetWidth, d = s < u ? e.clientX - u - 1 : e.clientX + 1, h = a < l ? e.clientY - l - 1 : e.clientY + 1;
478
+ o.style.left = d + "px", o.style.top = h + "px", setTimeout(() => {
480
479
  o.style.width = o.offsetWidth + "px";
481
480
  }, 50);
482
- function h() {
483
- t.targetClass && l.classList.remove(t.targetClass), l.classList.remove("context-menu-active"), l.style.userSelect = "", n.remove();
481
+ function m() {
482
+ t.targetClass && r.classList.remove(t.targetClass), r.classList.remove("context-menu-active"), r.style.userSelect = "", n.remove();
484
483
  }
485
- function g(a, f, m) {
484
+ function w(c, f, y) {
486
485
  if (f.classList.contains("pending-confirm"))
487
- return m();
486
+ return y();
488
487
  const C = f.innerHTML;
489
488
  f.classList.add("pending-confirm"), f.innerText = "Confirm";
490
489
  const x = () => {
491
490
  f.classList.remove("pending-confirm"), f.innerHTML = C, f.removeEventListener("mouseleave", x);
492
491
  };
493
- f.addEventListener("mouseleave", x), a.stopPropagation();
492
+ f.addEventListener("mouseleave", x), c.stopPropagation();
494
493
  }
495
494
  }
496
- const bn = (e) => new Promise((t) => setTimeout(t, e)), Jo = (e) => bn(e * 1e3);
495
+ const bn = (e) => new Promise((t) => setTimeout(t, e)), ns = (e) => bn(e * 1e3);
497
496
  function kn(e) {
498
497
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
499
498
  }
500
- function Qo(e, t) {
501
- return e != null ? Wt(e) : t;
499
+ function os(e, t) {
500
+ return e != null ? Pt(e) : t;
502
501
  }
503
- function es(e, t) {
502
+ function ss(e, t) {
504
503
  const n = { ...e };
505
504
  for (const o of t)
506
505
  n[o] === "" && (n[o] = null);
507
506
  return n;
508
507
  }
509
- function We(e) {
508
+ function je(e) {
510
509
  return e != null;
511
510
  }
512
- function ts(e, t) {
513
- Xt(e, {
511
+ class Ce {
512
+ validator = null;
513
+ lastModifiedDate = null;
514
+ size = 0;
515
+ path = "";
516
+ name = "";
517
+ type = "";
518
+ }
519
+ class Tn extends Ce {
520
+ blob;
521
+ constructor(t) {
522
+ super(), this.blob = t;
523
+ }
524
+ }
525
+ class Sn extends Ce {
526
+ uri;
527
+ constructor(t) {
528
+ super(), this.uri = t.uri, this.name = t.name ?? void 0, this.type = t.type ?? t.mimeType ?? void 0, this.size = t.size ?? 0;
529
+ }
530
+ }
531
+ function Cn(e) {
532
+ if (typeof e.body != "object" || !Object.values(e.body).some((r) => r instanceof Ce))
533
+ return e;
534
+ const n = new FormData(), o = {};
535
+ for (const [r, s] of Object.entries(e.body))
536
+ s instanceof Sn ? n.append(r, s) : s instanceof Tn ? n.append(r, s.blob) : o[r] = s;
537
+ return n.append("_payload", JSON.stringify(o)), {
538
+ ...e,
539
+ headers: {
540
+ ...e.headers,
541
+ "content-type": null
542
+ // deletes default JSON content-type header
543
+ },
544
+ body: n,
545
+ bodySerializer: void 0
546
+ };
547
+ }
548
+ class lt extends Error {
549
+ request;
550
+ response;
551
+ body;
552
+ constructor(t, n, o, r) {
553
+ super(t), this.request = n, this.response = o, this.body = r;
554
+ }
555
+ }
556
+ function xn(e, t) {
557
+ e.setConfig({
558
+ throwOnError: !0
559
+ }), e.interceptors.error.use((s, a, l, u) => {
560
+ const d = Mn(s, a), h = new lt(d, l, a, s);
561
+ if (t.onError) {
562
+ const m = t.onError(h, u);
563
+ if (m instanceof Error)
564
+ throw m;
565
+ if (m === null)
566
+ return new Promise(() => {
567
+ });
568
+ }
569
+ throw h;
570
+ }), t.headers && e.interceptors.request.use(async (s) => {
571
+ const a = typeof t.headers == "function" ? await t.headers(s) : t.headers;
572
+ if (a)
573
+ for (const [l, u] of Object.entries(a))
574
+ u === null ? s.headers.delete(l) : u !== void 0 && s.headers.set(l, u);
575
+ return s;
576
+ });
577
+ const n = t.wrapper ?? ((s, a) => a(s)), o = e.request, r = (s) => (s = Cn(s), n(s, o));
578
+ e.request = r, e.connect = (s) => r({ ...s, method: "CONNECT" }), e.delete = (s) => r({ ...s, method: "DELETE" }), e.get = (s) => r({ ...s, method: "GET" }), e.head = (s) => r({ ...s, method: "HEAD" }), e.options = (s) => r({ ...s, method: "OPTIONS" }), e.patch = (s) => r({ ...s, method: "PATCH" }), e.post = (s) => r({ ...s, method: "POST" }), e.put = (s) => r({ ...s, method: "PUT" }), e.trace = (s) => r({ ...s, method: "TRACE" });
579
+ }
580
+ function Mn(e, t) {
581
+ return e && typeof e == "object" ? "error" in e && typeof e.error == "string" ? `${e.error} (${t.status})` : JSON.stringify(e) : String(e);
582
+ }
583
+ function rs(e, t) {
584
+ xn(e, {
514
585
  ...t,
515
586
  onError(n, o) {
516
- n instanceof Zt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new de(n.body.error));
517
- const l = t.onError?.(n, o);
518
- return l !== void 0 ? l : n;
587
+ n instanceof lt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new de(n.body.error));
588
+ const r = t.onError?.(n, o);
589
+ return r !== void 0 ? r : n;
519
590
  }
520
591
  });
521
592
  }
@@ -526,7 +597,7 @@ function ts(e, t) {
526
597
  * Copyright (c) 2021 Jason Wilson
527
598
  * Released under MIT license
528
599
  */
529
- var Tn = {
600
+ var Ln = {
530
601
  symbol: "$",
531
602
  separator: ",",
532
603
  decimal: ".",
@@ -534,41 +605,41 @@ var Tn = {
534
605
  precision: 2,
535
606
  pattern: "!#",
536
607
  negativePattern: "-!#",
537
- format: Mn,
608
+ format: Dn,
538
609
  fromCents: !1
539
- }, lt = function(t) {
610
+ }, at = function(t) {
540
611
  return Math.round(t);
541
- }, Ce = function(t) {
612
+ }, xe = function(t) {
542
613
  return Math.pow(10, t);
543
- }, Sn = function(t, n) {
544
- return lt(t / n) * n;
545
- }, Cn = /(\d)(?=(\d{3})+\b)/g, xn = /(\d)(?=(\d\d)+\d\b)/g;
614
+ }, Fn = function(t, n) {
615
+ return at(t / n) * n;
616
+ }, On = /(\d)(?=(\d{3})+\b)/g, In = /(\d)(?=(\d\d)+\d\b)/g;
546
617
  function D(e, t) {
547
618
  var n = this;
548
619
  if (!(n instanceof D))
549
620
  return new D(e, t);
550
- var o = Object.assign({}, Tn, t), l = Ce(o.precision), s = se(e, o);
551
- n.intValue = s, n.value = s / l, o.increment = o.increment || 1 / l, o.useVedic ? o.groups = xn : o.groups = Cn, this.s = o, this.p = l;
621
+ var o = Object.assign({}, Ln, t), r = xe(o.precision), s = se(e, o);
622
+ n.intValue = s, n.value = s / r, o.increment = o.increment || 1 / r, o.useVedic ? o.groups = In : o.groups = On, this.s = o, this.p = r;
552
623
  }
553
624
  function se(e, t) {
554
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, u = t.precision, r = t.fromCents, c = Ce(u), d = typeof e == "number", E = e instanceof D;
555
- if (E && r)
625
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, r = t.decimal, s = t.errorOnInvalid, a = t.precision, l = t.fromCents, u = xe(a), d = typeof e == "number", h = e instanceof D;
626
+ if (h && l)
556
627
  return e.intValue;
557
- if (d || E)
558
- o = E ? e.value : e;
628
+ if (d || h)
629
+ o = h ? e.value : e;
559
630
  else if (typeof e == "string") {
560
- var h = new RegExp("[^-\\d" + l + "]", "g"), g = new RegExp("\\" + l, "g");
561
- o = e.replace(/\((.*)\)/, "-$1").replace(h, "").replace(g, "."), o = o || 0;
631
+ var m = new RegExp("[^-\\d" + r + "]", "g"), w = new RegExp("\\" + r, "g");
632
+ o = e.replace(/\((.*)\)/, "-$1").replace(m, "").replace(w, "."), o = o || 0;
562
633
  } else {
563
634
  if (s)
564
635
  throw Error("Invalid Input");
565
636
  o = 0;
566
637
  }
567
- return r || (o *= c, o = o.toFixed(4)), n ? lt(o) : o;
638
+ return l || (o *= u, o = o.toFixed(4)), n ? at(o) : o;
568
639
  }
569
- function Mn(e, t) {
570
- var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, u = t.decimal, r = t.groups, c = ("" + e).replace(/^-/, "").split("."), d = c[0], E = c[1];
571
- return (e.value >= 0 ? n : o).replace("!", l).replace("#", d.replace(r, "$1" + s) + (E ? u + E : ""));
640
+ function Dn(e, t) {
641
+ var n = t.pattern, o = t.negativePattern, r = t.symbol, s = t.separator, a = t.decimal, l = t.groups, u = ("" + e).replace(/^-/, "").split("."), d = u[0], h = u[1];
642
+ return (e.value >= 0 ? n : o).replace("!", r).replace("#", d.replace(l, "$1" + s) + (h ? a + h : ""));
572
643
  }
573
644
  D.prototype = {
574
645
  /**
@@ -577,8 +648,8 @@ D.prototype = {
577
648
  * @returns {currency}
578
649
  */
579
650
  add: function(t) {
580
- var n = this.intValue, o = this.s, l = this.p;
581
- return D((n += se(t, o)) / (o.fromCents ? 1 : l), o);
651
+ var n = this.intValue, o = this.s, r = this.p;
652
+ return D((n += se(t, o)) / (o.fromCents ? 1 : r), o);
582
653
  },
583
654
  /**
584
655
  * Subtracts value.
@@ -586,8 +657,8 @@ D.prototype = {
586
657
  * @returns {currency}
587
658
  */
588
659
  subtract: function(t) {
589
- var n = this.intValue, o = this.s, l = this.p;
590
- return D((n -= se(t, o)) / (o.fromCents ? 1 : l), o);
660
+ var n = this.intValue, o = this.s, r = this.p;
661
+ return D((n -= se(t, o)) / (o.fromCents ? 1 : r), o);
591
662
  },
592
663
  /**
593
664
  * Multiplies values.
@@ -596,7 +667,7 @@ D.prototype = {
596
667
  */
597
668
  multiply: function(t) {
598
669
  var n = this.intValue, o = this.s;
599
- return D((n *= t) / (o.fromCents ? 1 : Ce(o.precision)), o);
670
+ return D((n *= t) / (o.fromCents ? 1 : xe(o.precision)), o);
600
671
  },
601
672
  /**
602
673
  * Divides value.
@@ -614,9 +685,9 @@ D.prototype = {
614
685
  * @returns {array}
615
686
  */
616
687
  distribute: function(t) {
617
- for (var n = this.intValue, o = this.p, l = this.s, s = [], u = Math[n >= 0 ? "floor" : "ceil"](n / t), r = Math.abs(n - u * t), c = l.fromCents ? 1 : o; t !== 0; t--) {
618
- var d = D(u / c, l);
619
- r-- > 0 && (d = d[n >= 0 ? "add" : "subtract"](1 / c)), s.push(d);
688
+ for (var n = this.intValue, o = this.p, r = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), l = Math.abs(n - a * t), u = r.fromCents ? 1 : o; t !== 0; t--) {
689
+ var d = D(a / u, r);
690
+ l-- > 0 && (d = d[n >= 0 ? "add" : "subtract"](1 / u)), s.push(d);
620
691
  }
621
692
  return s;
622
693
  },
@@ -650,7 +721,7 @@ D.prototype = {
650
721
  */
651
722
  toString: function() {
652
723
  var t = this.intValue, n = this.p, o = this.s;
653
- return Sn(t / n, o.increment).toFixed(o.precision);
724
+ return Fn(t / n, o.increment).toFixed(o.precision);
654
725
  },
655
726
  /**
656
727
  * Value for JSON serialization.
@@ -663,55 +734,55 @@ D.prototype = {
663
734
  const M = [];
664
735
  for (let e = 0; e < 256; ++e)
665
736
  M.push((e + 256).toString(16).slice(1));
666
- function Ln(e, t = 0) {
737
+ function Hn(e, t = 0) {
667
738
  return (M[e[t + 0]] + M[e[t + 1]] + M[e[t + 2]] + M[e[t + 3]] + "-" + M[e[t + 4]] + M[e[t + 5]] + "-" + M[e[t + 6]] + M[e[t + 7]] + "-" + M[e[t + 8]] + M[e[t + 9]] + "-" + M[e[t + 10]] + M[e[t + 11]] + M[e[t + 12]] + M[e[t + 13]] + M[e[t + 14]] + M[e[t + 15]]).toLowerCase();
668
739
  }
669
740
  let ye;
670
- const Fn = new Uint8Array(16);
671
- function On() {
741
+ const Vn = new Uint8Array(16);
742
+ function An() {
672
743
  if (!ye) {
673
744
  if (typeof crypto > "u" || !crypto.getRandomValues)
674
745
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
675
746
  ye = crypto.getRandomValues.bind(crypto);
676
747
  }
677
- return ye(Fn);
748
+ return ye(Vn);
678
749
  }
679
- const In = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = { randomUUID: In };
680
- function Dn(e, t, n) {
681
- if (je.randomUUID && !e)
682
- return je.randomUUID();
750
+ const $n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Pe = { randomUUID: $n };
751
+ function Bn(e, t, n) {
752
+ if (Pe.randomUUID && !e)
753
+ return Pe.randomUUID();
683
754
  e = e || {};
684
- const o = e.random ?? e.rng?.() ?? On();
755
+ const o = e.random ?? e.rng?.() ?? An();
685
756
  if (o.length < 16)
686
757
  throw new Error("Random bytes length must be >= 16");
687
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ln(o);
758
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Hn(o);
688
759
  }
689
- function ns(e) {
760
+ function is(e) {
690
761
  return e.replace(/\n/g, "<br>");
691
762
  }
692
- function Vn(e) {
763
+ function Nn(e) {
693
764
  return e.replace(/_/g, " ");
694
765
  }
695
- function Hn(e) {
766
+ function _n(e) {
696
767
  const t = e.replace(/\D/g, "").replace(/^1/, "");
697
768
  return t.length !== 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
698
769
  }
699
- function An(e, t) {
770
+ function Rn(e, t) {
700
771
  return D(e).divide(t ?? F.defaultCurrencyDivisor).format();
701
772
  }
702
- function os() {
703
- return Dn();
773
+ function ls() {
774
+ return Bn();
704
775
  }
705
- const $n = ["disabled", "placeholder", "required", "name"], Bn = {
776
+ const Un = ["disabled", "placeholder", "required", "name"], jn = {
706
777
  key: 0,
707
778
  class: "no-results"
708
- }, _n = {
779
+ }, Pn = {
709
780
  key: 0,
710
781
  class: "group-title"
711
- }, Nn = ["onMousemove", "onMousedown"], Rn = ["innerHTML"], Wn = ["innerHTML"], jn = {
782
+ }, Wn = ["onMousemove", "onMousedown"], qn = ["innerHTML"], zn = ["innerHTML"], Kn = {
712
783
  key: 1,
713
784
  class: "no-results"
714
- }, Un = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Pn = /* @__PURE__ */ N({
785
+ }, Yn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Xn = /* @__PURE__ */ _({
715
786
  __name: "vf-smart-select",
716
787
  props: {
717
788
  modelValue: {},
@@ -748,36 +819,36 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
748
819
  },
749
820
  emits: ["optionsLoaded", "update:modelValue"],
750
821
  setup(e, { expose: t, emit: n }) {
751
- const o = Symbol("null"), l = Symbol("create"), s = e, u = n;
822
+ const o = Symbol("null"), r = Symbol("create"), s = e, a = n;
752
823
  t({
753
- addRemoteOption: Dt
824
+ addRemoteOption: Vt
754
825
  });
755
- const r = S(), c = S(), d = S(), E = S(!1), h = S(), g = S(!1), a = S(""), f = S(null), m = S(null), C = S(!1), x = S(null), B = S(!1), mt = T(() => s.showCreateTextOnNewItem ?? !0), P = T(() => !!(s.options || h.value)), ht = T(() => s.options ?? h.value ?? []), yt = T(() => s.prependOptions ?? []), gt = T(() => s.appendOptions ?? []), Le = T(() => !!s.disabled || !P.value && !s.loadOptions), z = T(() => s.loadingText || "..."), wt = T(() => !P.value && (!s.loadOptions || s.preload || s.modelValue && (s.valueField || s.valueExtractor)) ? z.value : s.nullTitle ? s.nullTitle : s.placeholder || ""), Et = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), fe = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), bt = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Fe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Oe = T(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Ie = T(() => [...yt.value, ...ht.value, ...gt.value]), De = T(() => !!(s.groupField || s.groupFormatter)), ve = T(() => Ie.value.map((i, w) => {
756
- const p = bt.value?.(i), v = Fe.value(i), y = s.subtitleFormatter?.(i), O = v ? v.trim().toLowerCase() : "", Ne = y ? y.trim().toLowerCase() : "", oe = [];
757
- return s.searchFields ? s.searchFields.forEach((Re) => {
758
- i[Re] && oe.push(String(i[Re]).toLowerCase());
759
- }) : (oe.push(O), Ne && oe.push(Ne)), {
760
- key: fe.value?.(i) ?? String(w),
761
- group: p,
762
- title: v,
763
- subtitle: y,
826
+ const l = S(), u = S(), d = S(), h = S(!1), m = S(), w = S(!1), c = S(""), f = S(null), y = S(null), C = S(!1), x = S(null), B = S(!1), yt = T(() => s.showCreateTextOnNewItem ?? !0), W = T(() => !!(s.options || m.value)), gt = T(() => s.options ?? m.value ?? []), wt = T(() => s.prependOptions ?? []), Et = T(() => s.appendOptions ?? []), Fe = T(() => !!s.disabled || !W.value && (h.value || !s.loadOptions)), z = T(() => s.loadingText || "..."), bt = T(() => !W.value && (!s.loadOptions || s.preload || s.modelValue && (s.valueField || s.valueExtractor)) ? z.value : s.nullTitle ? s.nullTitle : s.placeholder || ""), kt = T(() => s.noResultsText || "No options match your search."), q = T(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), fe = T(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), Tt = T(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Oe = T(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Ie = T(() => s.selectionFormatter ? s.selectionFormatter : Oe.value), De = T(() => [...wt.value, ...gt.value, ...Et.value]), He = T(() => !!(s.groupField || s.groupFormatter)), pe = T(() => De.value.map((i, E) => {
827
+ const v = Tt.value?.(i), p = Oe.value(i), g = s.subtitleFormatter?.(i), O = p ? p.trim().toLowerCase() : "", Re = g ? g.trim().toLowerCase() : "", oe = [];
828
+ return s.searchFields ? s.searchFields.forEach((Ue) => {
829
+ i[Ue] && oe.push(String(i[Ue]).toLowerCase());
830
+ }) : (oe.push(O), Re && oe.push(Re)), {
831
+ key: fe.value?.(i) ?? String(E),
832
+ group: v,
833
+ title: p,
834
+ subtitle: g,
764
835
  searchContent: oe.join(""),
765
836
  ref: i
766
837
  };
767
838
  })), L = T(() => {
768
- let i = [...ve.value];
769
- if (g.value) {
770
- const w = a.value.trim().toLowerCase();
771
- if (w.length) {
772
- i = i.filter((y) => y.searchContent.includes(w));
773
- const p = Gt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), v = new RegExp(`(${p})`, "ig");
774
- i = i.map((y) => ({
775
- ...y,
776
- title: y.title.replace(v, "<mark>$1</mark>"),
777
- subtitle: y.subtitle?.replace(v, "<mark>$1</mark>")
778
- })), B.value && (i.find((O) => O.searchContent === w) !== void 0 || i.push({
779
- key: l,
780
- title: mt.value ? "Create <strong>" + a.value.trim() + "</strong>..." : a.value.trim()
839
+ let i = [...pe.value];
840
+ if (w.value) {
841
+ const E = c.value.trim().toLowerCase();
842
+ if (E.length) {
843
+ i = i.filter((g) => g.searchContent.includes(E));
844
+ const v = Zt(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${v})`, "ig");
845
+ i = i.map((g) => ({
846
+ ...g,
847
+ title: g.title.replace(p, "<mark>$1</mark>"),
848
+ subtitle: g.subtitle?.replace(p, "<mark>$1</mark>")
849
+ })), B.value && (i.find((O) => O.searchContent === E) !== void 0 || i.push({
850
+ key: r,
851
+ title: yt.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
781
852
  }));
782
853
  }
783
854
  } else s.nullTitle && i.unshift({
@@ -785,218 +856,218 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
785
856
  title: s.nullTitle
786
857
  });
787
858
  return i;
788
- }), kt = T(() => {
789
- if (!De.value)
859
+ }), St = T(() => {
860
+ if (!He.value)
790
861
  return [
791
862
  {
792
863
  groupTitle: "",
793
864
  options: L.value
794
865
  }
795
866
  ];
796
- const i = jt(L.value.map((p) => p.group ?? "")), w = Ut(L.value, (p) => p.group ?? "");
797
- return i.map((p) => ({
798
- groupTitle: p,
799
- options: w[p]
867
+ const i = Wt(L.value.map((v) => v.group ?? "")), E = qt(L.value, (v) => v.group ?? "");
868
+ return i.map((v) => ({
869
+ groupTitle: v,
870
+ options: E[v]
800
871
  }));
801
872
  });
802
- I(() => s.modelValue, me), I(ve, () => {
803
- C.value && setTimeout($e, 0);
804
- }), I(a, () => {
805
- g.value && !s.remoteSearch && !a.value.trim().length && (g.value = !1);
873
+ I(() => s.modelValue, me), I(pe, () => {
874
+ C.value && setTimeout(Be, 0);
875
+ }), I(c, () => {
876
+ w.value && !s.remoteSearch && !c.value.trim().length && (w.value = !1);
806
877
  }), I(C, () => {
807
- C.value ? setTimeout(Ft, 0) : (g.value = !1, a.value = m.value ?? "", d.value && (d.value.style.visibility = "hidden"));
878
+ C.value ? setTimeout(It, 0) : (w.value = !1, c.value = y.value ?? "", d.value && (d.value.style.visibility = "hidden"));
808
879
  }), I(L, () => {
809
- s.modelValue !== null && f.value === null && me(), (x.value !== null || g.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
810
- }), _(async () => {
811
- B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (a.value = z.value, await Ve(), a.value = ""), !s.options && !s.loadOptions && (s.valueField || s.valueExtractor) ? a.value = z.value : me(), I(f, () => {
812
- const i = We(f.value) && q.value !== null ? q.value(f.value) : f.value;
813
- we(s.modelValue, i) || u("update:modelValue", i);
814
- }), s.remoteSearch && I(a, Pt(Tt, 250));
880
+ s.modelValue !== null && f.value === null && me(), (x.value !== null || w.value) && !L.value.find((i) => i.key == x.value) && (x.value = L.value[0]?.key ?? o);
881
+ }), N(async () => {
882
+ B.value = s.onCreateItem !== void 0, s.loadOptions && s.preload && (c.value = z.value, await Ve(), c.value = ""), !s.options && !s.loadOptions && (s.valueField || s.valueExtractor) ? c.value = z.value : me(), I(f, () => {
883
+ const i = je(f.value) && q.value !== null ? q.value(f.value) : f.value;
884
+ we(s.modelValue, i) || a("update:modelValue", i);
885
+ }), s.remoteSearch && I(c, zt(Ct, 250));
815
886
  }), ue(() => {
816
887
  d.value?.remove();
817
888
  });
818
889
  async function Ve() {
819
- await He(), h.value && u("optionsLoaded", h.value);
890
+ await Ae(), m.value && a("optionsLoaded", m.value);
820
891
  }
821
- async function He() {
822
- const i = s.remoteSearch && g.value && a.value.length ? a.value : null;
823
- E.value = !0, h.value = await s.loadOptions?.(i) ?? [], E.value = !1, Ae();
892
+ async function Ae() {
893
+ const i = s.remoteSearch && w.value && c.value.length ? c.value : null;
894
+ h.value = !0, m.value = await s.loadOptions?.(i) ?? [], h.value = !1, $e();
824
895
  }
825
- function Tt() {
826
- g.value && (He(), g.value = a.value.trim().length > 0);
896
+ function Ct() {
897
+ w.value && (Ae(), w.value = c.value.trim().length > 0);
827
898
  }
828
- function St(i) {
899
+ function xt(i) {
829
900
  if (i.key == "Escape") {
830
901
  i.stopPropagation(), i.target.blur(), _e();
831
902
  return;
832
903
  }
833
904
  if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
834
- if (!P.value) {
835
- g.value || i.preventDefault();
905
+ if (!W.value) {
906
+ w.value || i.preventDefault();
836
907
  return;
837
908
  }
838
909
  if (i.key == "ArrowUp" || i.key == "ArrowDown")
839
- return i.preventDefault(), pe(i.key == "ArrowUp" ? -1 : 1);
910
+ return i.preventDefault(), ve(i.key == "ArrowUp" ? -1 : 1);
840
911
  if (i.key == "PageUp" || i.key == "PageDown")
841
- return i.preventDefault(), pe(i.key == "PageUp" ? -10 : 10);
912
+ return i.preventDefault(), ve(i.key == "PageUp" ? -10 : 10);
842
913
  if (i.key == "Home" || i.key == "End")
843
- return i.preventDefault(), pe(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
914
+ return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
844
915
  if (i.key == "Enter") {
845
916
  i.preventDefault();
846
- const w = L.value.find((p) => p.key == x.value);
847
- if (w) return Be(w);
917
+ const E = L.value.find((v) => v.key == x.value);
918
+ if (E) return Ne(E);
848
919
  }
849
920
  if (i.key === "Delete" || i.key === "Backspace") {
850
- a.value.length > 1 && (g.value = !0);
921
+ c.value.length > 1 && (w.value = !0);
851
922
  return;
852
923
  }
853
- !i.metaKey && Un.includes(i.key) && (g.value = !0);
924
+ !i.metaKey && Yn.includes(i.key) && (w.value = !0);
854
925
  }
855
926
  }
856
- function Ct() {
857
- Ae(), C.value = !0, setTimeout(() => c.value?.select(), 0);
927
+ function Mt() {
928
+ $e(), C.value = !0, setTimeout(() => u.value?.select(), 0);
858
929
  }
859
- function Ae(i) {
860
- f.value ? x.value = xt(f.value) : s.nullTitle && (x.value = o);
930
+ function $e(i) {
931
+ f.value ? x.value = Lt(f.value) : s.nullTitle && (x.value = o);
861
932
  }
862
- function xt(i) {
863
- return fe.value ? fe.value(f.value) : Mt(i)?.key ?? "";
933
+ function Lt(i) {
934
+ return fe.value ? fe.value(f.value) : Ft(i)?.key ?? "";
864
935
  }
865
- function Mt(i) {
866
- const w = L.value.find((y) => y.ref === i);
867
- if (w)
868
- return w;
869
- const p = s.keyExtractor ? (y, O) => s.keyExtractor(y) === s.keyExtractor(O) : we, v = L.value.find((y) => p(y.ref, i));
870
- return v || null;
936
+ function Ft(i) {
937
+ const E = L.value.find((g) => g.ref === i);
938
+ if (E)
939
+ return E;
940
+ const v = s.keyExtractor ? (g, O) => s.keyExtractor(g) === s.keyExtractor(O) : we, p = L.value.find((g) => v(g.ref, i));
941
+ return p || null;
871
942
  }
872
- function Lt() {
873
- s.debug || (!a.value.length && s.nullTitle && (f.value = null, m.value = null), C.value = !1);
943
+ function Ot() {
944
+ s.debug || (!c.value.length && s.nullTitle && (f.value = null, y.value = null), C.value = !1);
874
945
  }
875
- function Ft() {
876
- P.value || Ve(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), Ot();
946
+ function It() {
947
+ W.value || Ve(), s.optionsListId && d.value?.setAttribute("id", s.optionsListId), Dt();
877
948
  }
878
- function Ot() {
879
- const i = r.value.getBoundingClientRect(), w = i.y + i.height + 2, p = i.x, v = d.value, y = window.getComputedStyle(r.value);
880
- for (let O in y)
881
- /^(font|text)/.test(O) && (v.style[O] = y[O]);
882
- if (v.style.top = w + "px", v.style.left = p + "px", v.style.minWidth = i.width + "px", !y.maxHeight || y.maxHeight == "none") {
883
- const O = window.innerHeight - w - 12;
884
- v.style.maxHeight = O + "px";
949
+ function Dt() {
950
+ const i = l.value.getBoundingClientRect(), E = i.y + i.height + 2, v = i.x, p = d.value, g = window.getComputedStyle(l.value);
951
+ for (let O in g)
952
+ /^(font|text)/.test(O) && (p.style[O] = g[O]);
953
+ if (p.style.top = E + "px", p.style.left = v + "px", p.style.minWidth = i.width + "px", !g.maxHeight || g.maxHeight == "none") {
954
+ const O = window.innerHeight - E - 12;
955
+ p.style.maxHeight = O + "px";
885
956
  }
886
- v.style.visibility = "visible", document.body.appendChild(v), setTimeout($e, 0);
957
+ p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Be, 0);
887
958
  }
888
- function $e() {
889
- if (!P.value || !x.value) return;
890
- const i = L.value.findIndex((v) => v.key == x.value), w = d.value, p = w?.querySelectorAll(".option")[i];
891
- p && (w.scrollTop = p.offsetTop);
959
+ function Be() {
960
+ if (!W.value || !x.value) return;
961
+ const i = L.value.findIndex((p) => p.key == x.value), E = d.value, v = E?.querySelectorAll(".option")[i];
962
+ v && (E.scrollTop = v.offsetTop);
892
963
  }
893
- function It(i) {
964
+ function Ht(i) {
894
965
  x.value = i ? i.key : null;
895
966
  }
896
- function pe(i) {
897
- const w = L.value.findIndex((O) => O.key == x.value);
898
- let p = w + i;
899
- if (p < 0 ? p = 0 : p >= L.value.length && (p = L.value.length - 1), w == p) return;
900
- x.value = L.value[p].key;
901
- const v = d.value, y = v?.querySelectorAll(".option")[p];
902
- y && (y.offsetTop < v.scrollTop ? v.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > v.scrollTop + v.clientHeight && (v.scrollTop = y.offsetTop + y.offsetHeight - v.clientHeight));
967
+ function ve(i) {
968
+ const E = L.value.findIndex((O) => O.key == x.value);
969
+ let v = E + i;
970
+ if (v < 0 ? v = 0 : v >= L.value.length && (v = L.value.length - 1), E == v) return;
971
+ x.value = L.value[v].key;
972
+ const p = d.value, g = p?.querySelectorAll(".option")[v];
973
+ g && (g.offsetTop < p.scrollTop ? p.scrollTop = g.offsetTop : g.offsetTop + g.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = g.offsetTop + g.offsetHeight - p.clientHeight));
903
974
  }
904
- function Be(i) {
905
- if (g.value = !1, i.key === o)
906
- a.value = "", f.value = null, m.value = null;
907
- else if (i.key === l) {
908
- const w = a.value.trim();
909
- a.value = "", f.value = null, m.value = null, s.onCreateItem?.(w);
975
+ function Ne(i) {
976
+ if (w.value = !1, i.key === o)
977
+ c.value = "", f.value = null, y.value = null;
978
+ else if (i.key === r) {
979
+ const E = c.value.trim();
980
+ c.value = "", f.value = null, y.value = null, s.onCreateItem?.(E);
910
981
  } else {
911
- const p = ve.value.find((v) => v.key == i.key).ref;
912
- f.value = p, m.value = Oe.value(p), a.value = m.value ?? "";
982
+ const v = pe.value.find((p) => p.key == i.key).ref;
983
+ f.value = v, y.value = Ie.value(v), c.value = y.value ?? "";
913
984
  }
914
- c.value?.blur(), _e();
985
+ u.value?.blur(), _e();
915
986
  }
916
987
  function me() {
917
- s.modelValue !== null ? (f.value = q.value ? Ie.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, m.value = We(f.value) ? Oe.value(f.value) : null, a.value = m.value ?? "") : (f.value = null, m.value = null, a.value = "");
988
+ s.modelValue !== null ? (f.value = q.value ? De.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, y.value = je(f.value) ? Ie.value(f.value) : null, c.value = y.value ?? "") : (f.value = null, y.value = null, c.value = "");
918
989
  }
919
- function Dt(i) {
920
- h.value.unshift(i);
990
+ function Vt(i) {
991
+ m.value.unshift(i);
921
992
  }
922
993
  function _e() {
923
994
  if (!s.autoNext) return;
924
- let i = r.value?.parentElement;
995
+ let i = l.value?.parentElement;
925
996
  for (; i && i.tagName !== "FORM" && i.tagName !== "BODY"; )
926
997
  i = i.parentElement;
927
998
  if (!i) return;
928
- const w = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
929
- if (!w) return;
930
- const p = Array.from(w).findIndex((y) => y === c.value), v = w[p + 1];
931
- v && setTimeout(() => v.focus(), 0);
999
+ const E = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
1000
+ if (!E) return;
1001
+ const v = Array.from(E).findIndex((g) => g === u.value), p = E[v + 1];
1002
+ p && setTimeout(() => p.focus(), 0);
932
1003
  }
933
- return (i, w) => (b(), k("div", {
1004
+ return (i, E) => (b(), k("div", {
934
1005
  ref_key: "el",
935
- ref: r,
936
- class: H(["vf-smart-select", { disabled: Le.value, open: C.value }])
1006
+ ref: l,
1007
+ class: V(["vf-smart-select", { disabled: Fe.value, open: C.value }])
937
1008
  }, [
938
- ie($("input", {
1009
+ re($("input", {
939
1010
  ref_key: "searchField",
940
- ref: c,
941
- "onUpdate:modelValue": w[0] || (w[0] = (p) => a.value = p),
1011
+ ref: u,
1012
+ "onUpdate:modelValue": E[0] || (E[0] = (v) => c.value = v),
942
1013
  type: "text",
943
- disabled: Le.value,
944
- class: H({ nullable: !!i.nullTitle }),
945
- placeholder: wt.value,
1014
+ disabled: Fe.value,
1015
+ class: V({ nullable: !!i.nullTitle }),
1016
+ placeholder: bt.value,
946
1017
  required: i.required,
947
1018
  name: i.name,
948
1019
  "data-1p-ignore": "",
949
- onKeydown: St,
950
- onFocus: Ct,
951
- onBlur: Lt
952
- }, null, 42, $n), [
953
- [Rt, a.value]
1020
+ onKeydown: xt,
1021
+ onFocus: Mt,
1022
+ onBlur: Ot
1023
+ }, null, 42, Un), [
1024
+ [jt, c.value]
954
1025
  ]),
955
1026
  C.value ? (b(), k("div", {
956
1027
  key: 0,
957
1028
  ref_key: "optionsContainer",
958
1029
  ref: d,
959
- class: H(["vf-smart-select-options", { grouped: De.value }])
1030
+ class: V(["vf-smart-select-options", { grouped: He.value }])
960
1031
  }, [
961
- P.value ? (b(!0), k(le, { key: 1 }, re(kt.value, (p) => (b(), k("div", {
962
- key: p.groupTitle,
1032
+ W.value ? (b(!0), k(ie, { key: 1 }, le(St.value, (v) => (b(), k("div", {
1033
+ key: v.groupTitle,
963
1034
  class: "group"
964
1035
  }, [
965
- p.groupTitle ? (b(), k("div", _n, [
966
- W(i.$slots, "group", {
967
- group: p.groupTitle
1036
+ v.groupTitle ? (b(), k("div", Pn, [
1037
+ U(i.$slots, "group", {
1038
+ group: v.groupTitle
968
1039
  }, () => [
969
- X(R(p.groupTitle), 1)
1040
+ X(R(v.groupTitle), 1)
970
1041
  ])
971
- ])) : V("", !0),
972
- (b(!0), k(le, null, re(p.options, (v) => (b(), k("div", {
973
- key: v.key,
974
- class: H(["option", [x.value === v.key && "highlighted", v.ref && i.classForOption?.(v.ref)]]),
975
- onMousemove: (y) => It(v),
976
- onMousedown: (y) => Be(v)
1042
+ ])) : H("", !0),
1043
+ (b(!0), k(ie, null, le(v.options, (p) => (b(), k("div", {
1044
+ key: p.key,
1045
+ class: V(["option", [x.value === p.key && "highlighted", p.ref && i.classForOption?.(p.ref)]]),
1046
+ onMousemove: (g) => Ht(p),
1047
+ onMousedown: (g) => Ne(p)
977
1048
  }, [
978
- W(i.$slots, "option", { option: v }, () => [
1049
+ U(i.$slots, "option", { option: p }, () => [
979
1050
  $("div", {
980
1051
  class: "title",
981
- innerHTML: v.title
982
- }, null, 8, Rn),
983
- v.subtitle ? (b(), k("div", {
1052
+ innerHTML: p.title
1053
+ }, null, 8, qn),
1054
+ p.subtitle ? (b(), k("div", {
984
1055
  key: 0,
985
1056
  class: "subtitle",
986
- innerHTML: v.subtitle
987
- }, null, 8, Wn)) : V("", !0)
1057
+ innerHTML: p.subtitle
1058
+ }, null, 8, zn)) : H("", !0)
988
1059
  ])
989
- ], 42, Nn))), 128)),
990
- !L.value.length && a.value ? (b(), k("div", jn, [
991
- W(i.$slots, "no-results", {}, () => [
992
- X(R(Et.value), 1)
1060
+ ], 42, Wn))), 128)),
1061
+ !L.value.length && c.value ? (b(), k("div", Kn, [
1062
+ U(i.$slots, "no-results", {}, () => [
1063
+ X(R(kt.value), 1)
993
1064
  ])
994
- ])) : V("", !0)
995
- ]))), 128)) : (b(), k("div", Bn, "Loading..."))
996
- ], 2)) : V("", !0)
1065
+ ])) : H("", !0)
1066
+ ]))), 128)) : (b(), k("div", jn, "Loading..."))
1067
+ ], 2)) : H("", !0)
997
1068
  ], 2));
998
1069
  }
999
- }), ss = /* @__PURE__ */ N({
1070
+ }), as = /* @__PURE__ */ _({
1000
1071
  __name: "vf-ez-smart-select",
1001
1072
  props: {
1002
1073
  modelValue: {},
@@ -1008,39 +1079,39 @@ const $n = ["disabled", "placeholder", "required", "name"], Bn = {
1008
1079
  },
1009
1080
  emits: ["update:modelValue"],
1010
1081
  setup(e, { emit: t }) {
1011
- const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: String(r) })) : Object.entries(n.options).map(([r, c]) => ({
1012
- value: r,
1013
- label: c
1014
- }))), l = T(() => n.formatter ? (r) => n.formatter(r.label, r.value) : (r) => r.label), s = t, u = S(o.value.find((r) => r.value === n.modelValue) ?? null);
1082
+ const n = e, o = T(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: String(l) })) : Object.entries(n.options).map(([l, u]) => ({
1083
+ value: l,
1084
+ label: u
1085
+ }))), r = T(() => n.formatter ? (l) => n.formatter(l.label, l.value) : (l) => l.label), s = t, a = S(o.value.find((l) => l.value === n.modelValue) ?? null);
1015
1086
  return I(
1016
1087
  () => n.modelValue,
1017
- (r) => {
1018
- u.value = o.value.find((c) => c.value === r) ?? null;
1088
+ (l) => {
1089
+ a.value = o.value.find((u) => u.value === l) ?? null;
1019
1090
  }
1020
- ), I(u, (r) => {
1021
- const c = r ? o.value.find((d) => we(d, r))?.value : null;
1022
- s("update:modelValue", c ?? null);
1023
- }), (r, c) => (b(), Je(Pn, {
1024
- modelValue: u.value,
1025
- "onUpdate:modelValue": c[0] || (c[0] = (d) => u.value = d),
1091
+ ), I(a, (l) => {
1092
+ const u = l ? o.value.find((d) => we(d, l))?.value : null;
1093
+ s("update:modelValue", u ?? null);
1094
+ }), (l, u) => (b(), Qe(Xn, {
1095
+ modelValue: a.value,
1096
+ "onUpdate:modelValue": u[0] || (u[0] = (d) => a.value = d),
1026
1097
  options: o.value,
1027
- formatter: l.value,
1028
- "null-title": r.nullTitle,
1029
- placeholder: r.placeholder,
1030
- name: r.name
1098
+ formatter: r.value,
1099
+ "null-title": l.nullTitle,
1100
+ placeholder: l.placeholder,
1101
+ name: l.name
1031
1102
  }, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
1032
1103
  }
1033
1104
  });
1034
- function is() {
1105
+ function us() {
1035
1106
  return S();
1036
1107
  }
1037
- const qn = { class: "content" }, zn = { class: "message" }, Kn = {
1108
+ const Gn = { class: "content" }, Zn = { class: "message" }, Jn = {
1038
1109
  key: 0,
1039
1110
  class: "close"
1040
- }, Yn = {
1111
+ }, Qn = {
1041
1112
  key: 0,
1042
1113
  class: "progress-bar"
1043
- }, Xn = /* @__PURE__ */ N({
1114
+ }, eo = /* @__PURE__ */ _({
1044
1115
  __name: "vf-toast",
1045
1116
  props: {
1046
1117
  message: {},
@@ -1056,135 +1127,135 @@ const qn = { class: "content" }, zn = { class: "message" }, Kn = {
1056
1127
  t.onClick ? t.onClick() : t.disableClose || t.callback();
1057
1128
  }
1058
1129
  const o = S();
1059
- return t.durationSecs !== null && _(() => {
1060
- const l = t.durationSecs ?? 5;
1130
+ return t.durationSecs !== null && N(() => {
1131
+ const r = t.durationSecs ?? 5;
1061
1132
  o.value?.animate([{ width: "0%" }, { width: "100%" }], {
1062
- duration: l * 1e3,
1133
+ duration: r * 1e3,
1063
1134
  easing: "linear"
1064
- }), setTimeout(() => t.callback(), l * 1e3);
1065
- }), (l, s) => (b(), k("div", {
1066
- class: H(["vf-toast", l.className]),
1135
+ }), setTimeout(() => t.callback(), r * 1e3);
1136
+ }), (r, s) => (b(), k("div", {
1137
+ class: V(["vf-toast", r.className]),
1067
1138
  onClick: ke(n, ["stop"])
1068
1139
  }, [
1069
- $("div", qn, [
1070
- $("div", zn, R(l.message), 1),
1071
- l.disableClose ? V("", !0) : (b(), k("div", Kn, "x"))
1140
+ $("div", Gn, [
1141
+ $("div", Zn, R(r.message), 1),
1142
+ r.disableClose ? H("", !0) : (b(), k("div", Jn, "x"))
1072
1143
  ]),
1073
- l.durationSecs !== null ? (b(), k("div", Yn, [
1144
+ r.durationSecs !== null ? (b(), k("div", Qn, [
1074
1145
  $("div", {
1075
1146
  ref_key: "progressInnerEl",
1076
1147
  ref: o,
1077
1148
  class: "inner"
1078
1149
  }, null, 512)
1079
- ])) : V("", !0)
1150
+ ])) : H("", !0)
1080
1151
  ], 2));
1081
1152
  }
1082
1153
  });
1083
- function ls(e) {
1084
- const t = ce(Xn, {
1154
+ function cs(e) {
1155
+ const t = ce(eo, {
1085
1156
  ...e,
1086
1157
  callback: () => Q(t)
1087
1158
  });
1088
1159
  return () => Q(t);
1089
1160
  }
1090
- function Zn(e) {
1091
- const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), l = ["B", "KB", "MB", "GB", "TB"][t];
1092
- return `${o} ${l}`;
1161
+ function to(e) {
1162
+ const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), r = ["B", "KB", "MB", "GB", "TB"][t];
1163
+ return `${o} ${r}`;
1093
1164
  }
1094
- function Gn(e) {
1165
+ function no(e) {
1095
1166
  return e != null && String(e).length ? e : "-";
1096
1167
  }
1097
- function Jn(e) {
1168
+ function oo(e) {
1098
1169
  return e || "-";
1099
1170
  }
1100
- function Qn(e) {
1171
+ function so(e) {
1101
1172
  return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : kn(Number(e));
1102
1173
  }
1103
- function eo(e) {
1104
- return e && Hn(e);
1174
+ function ro(e) {
1175
+ return e && _n(e);
1105
1176
  }
1106
- function to(e) {
1107
- return e ? zt(e) : null;
1177
+ function io(e) {
1178
+ return e ? Yt(e) : null;
1108
1179
  }
1109
- function rt(e) {
1110
- return e ? qt(e) : null;
1180
+ function ut(e) {
1181
+ return e ? Kt(e) : null;
1111
1182
  }
1112
- function no(e) {
1183
+ function lo(e) {
1113
1184
  return e ? e.toUpperCase() : null;
1114
1185
  }
1115
- function oo(e) {
1116
- return e ? rt(e.toLowerCase()) : null;
1186
+ function ao(e) {
1187
+ return e ? ut(e.toLowerCase()) : null;
1117
1188
  }
1118
- function so(e) {
1119
- return e ? Vn(e) : null;
1189
+ function uo(e) {
1190
+ return e ? Nn(e) : null;
1120
1191
  }
1121
- function io(e, t) {
1122
- return An(e, t);
1192
+ function co(e, t) {
1193
+ return Rn(e, t);
1123
1194
  }
1124
- function lo(e, t) {
1195
+ function fo(e, t) {
1125
1196
  return D(e).divide(t).value;
1126
1197
  }
1127
- function ro(e, t) {
1128
- return e && U(new Date(e), t ?? F.defaultDateFormat);
1129
- }
1130
- function ao(e, t) {
1131
- return e && U(new Date(e), t ?? F.defaultTimeFormat);
1132
- }
1133
- function uo(e, t) {
1134
- return e && U(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1135
- }
1136
- function co(e) {
1137
- return e && U(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
1138
- }
1139
- const Ue = {
1140
- bytes: Zn,
1141
- dash: Gn,
1142
- dashZeros: Jn,
1143
- number: Qn,
1144
- phone: eo,
1145
- upperFirst: to,
1146
- startCase: rt,
1147
- upperCase: no,
1148
- upperWords: oo,
1149
- desnake: so,
1150
- usCurrency: io,
1151
- divide: lo,
1152
- date: ro,
1153
- time: ao,
1154
- dateTime: uo,
1155
- oneDayForward: co
1156
- }, rs = (e) => ({
1157
- ...Ue,
1158
- ...e(Ue)
1159
- }), xe = Symbol("HookState");
1160
- function as(e, t) {
1198
+ function po(e, t) {
1199
+ return e && P(new Date(e), t ?? F.defaultDateFormat);
1200
+ }
1201
+ function vo(e, t) {
1202
+ return e && P(new Date(e), t ?? F.defaultTimeFormat);
1203
+ }
1204
+ function mo(e, t) {
1205
+ return e && P(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1206
+ }
1207
+ function ho(e) {
1208
+ return e && P(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
1209
+ }
1210
+ const We = {
1211
+ bytes: to,
1212
+ dash: no,
1213
+ dashZeros: oo,
1214
+ number: so,
1215
+ phone: ro,
1216
+ upperFirst: io,
1217
+ startCase: ut,
1218
+ upperCase: lo,
1219
+ upperWords: ao,
1220
+ desnake: uo,
1221
+ usCurrency: co,
1222
+ divide: fo,
1223
+ date: po,
1224
+ time: vo,
1225
+ dateTime: mo,
1226
+ oneDayForward: ho
1227
+ }, ds = (e) => ({
1228
+ ...We,
1229
+ ...e(We)
1230
+ }), Me = Symbol("HookState");
1231
+ function fs(e, t) {
1161
1232
  const n = t ?? be();
1162
- _(() => fo(n, e), n), Qe(() => vo(n), n), et(() => Pe(n), n), ue(() => Pe(n), n);
1233
+ N(() => yo(n, e), n), et(() => go(n), n), tt(() => qe(n), n), ue(() => qe(n), n);
1163
1234
  }
1164
- function fo(e, t) {
1235
+ function yo(e, t) {
1165
1236
  const n = {};
1166
- if (t.elScrolledToBottom && (n.el = new G(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1167
- const o = at(e.vnode.el);
1168
- o ? n.ancestor = new G(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1237
+ if (t.elScrolledToBottom && (n.el = new Z(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1238
+ const o = ct(e.vnode.el);
1239
+ o ? n.ancestor = new Z(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1169
1240
  }
1170
- t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[xe] = n;
1241
+ t.windowScrolledToBottom && (n.window = new Z(window, t.windowScrolledToBottom)), e[Me] = n;
1171
1242
  }
1172
- function vo(e) {
1173
- const t = e[xe];
1243
+ function go(e) {
1244
+ const t = e[Me];
1174
1245
  t?.el?.install(), t?.ancestor?.install(), t?.window?.install();
1175
1246
  }
1176
- function Pe(e) {
1177
- const t = e[xe];
1247
+ function qe(e) {
1248
+ const t = e[Me];
1178
1249
  t?.el?.uninstall(), t?.ancestor?.uninstall(), t?.window?.uninstall();
1179
1250
  }
1180
1251
  const ge = ["auto", "scroll"];
1181
- function at(e) {
1252
+ function ct(e) {
1182
1253
  const t = e.parentElement;
1183
1254
  if (!t) return null;
1184
1255
  const n = window.getComputedStyle(t);
1185
- return ge.includes(n.overflow) || ge.includes(n.overflowX) || ge.includes(n.overflowY) ? t : at(t);
1256
+ return ge.includes(n.overflow) || ge.includes(n.overflowX) || ge.includes(n.overflowY) ? t : ct(t);
1186
1257
  }
1187
- class G {
1258
+ class Z {
1188
1259
  constructor(t, n) {
1189
1260
  this.el = t, this.handler = n, this.install();
1190
1261
  }
@@ -1200,25 +1271,25 @@ class G {
1200
1271
  Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight ? this.isTripped || (this.handler(t), this.isTripped = !0) : this.isTripped && (this.isTripped = !1);
1201
1272
  }
1202
1273
  }
1203
- function us(e) {
1204
- _(() => window.addEventListener("resize", e)), Qe(() => window.addEventListener("resize", e)), et(() => window.removeEventListener("resize", e)), ue(() => window.removeEventListener("resize", e));
1274
+ function ps(e) {
1275
+ N(() => window.addEventListener("resize", e)), et(() => window.addEventListener("resize", e)), tt(() => window.removeEventListener("resize", e)), ue(() => window.removeEventListener("resize", e));
1205
1276
  }
1206
- const po = {
1207
- mounted: ze,
1208
- updated: ze
1209
- }, qe = Symbol("HasAutoFocused");
1210
- function ze(e, t) {
1211
- if (t.value === void 0 && e[qe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1212
- e[qe] = !0;
1277
+ const wo = {
1278
+ mounted: Ke,
1279
+ updated: Ke
1280
+ }, ze = Symbol("HasAutoFocused");
1281
+ function Ke(e, t) {
1282
+ if (t.value === void 0 && e[ze] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1283
+ e[ze] = !0;
1213
1284
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
1214
1285
  setTimeout(() => n.focus(), 10);
1215
1286
  }
1216
- const mo = {
1217
- mounted: ho
1287
+ const Eo = {
1288
+ mounted: bo
1218
1289
  }, K = Symbol("ConfirmState");
1219
- function ho(e, t) {
1290
+ function bo(e, t) {
1220
1291
  e.addEventListener("click", (n) => {
1221
- const o = Date.now(), l = t.value?.text !== void 0 ? t.value.text : "Confirm";
1292
+ const o = Date.now(), r = t.value?.text !== void 0 ? t.value.text : "Confirm";
1222
1293
  if (e[K]) {
1223
1294
  if (o - e[K].initTime < 300)
1224
1295
  return;
@@ -1230,158 +1301,158 @@ function ho(e, t) {
1230
1301
  initTime: o,
1231
1302
  preconfirmHtml: e.innerHTML,
1232
1303
  resetHandler: () => {
1233
- l && (e.innerHTML = s.preconfirmHtml), t.value?.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
1304
+ r && (e.innerHTML = s.preconfirmHtml), t.value?.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
1234
1305
  }
1235
1306
  };
1236
- e[K] = s, l && (e.innerHTML = l), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
1307
+ e[K] = s, r && (e.innerHTML = r), t.value?.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
1237
1308
  });
1238
1309
  }
1239
- const yo = {
1240
- beforeMount: go
1310
+ const ko = {
1311
+ beforeMount: To
1241
1312
  };
1242
- function go(e) {
1313
+ function To(e) {
1243
1314
  e.addEventListener("blur", () => {
1244
1315
  let t = e.value;
1245
- /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + U(/* @__PURE__ */ new Date(), "yy"));
1316
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
1246
1317
  const n = Date.parse(t);
1247
- isNaN(n) ? e.value = "" : e.value = U(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1318
+ isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1248
1319
  });
1249
1320
  }
1250
- const wo = {
1251
- beforeMount: Ke,
1252
- updated: Ke
1321
+ const So = {
1322
+ beforeMount: Ye,
1323
+ updated: Ye
1253
1324
  };
1254
- function Ke(e, t) {
1255
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = Eo(e, t));
1325
+ function Ye(e, t) {
1326
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = Co(e, t));
1256
1327
  }
1257
- function Eo(e, t) {
1328
+ function Co(e, t) {
1258
1329
  if (!t.value)
1259
1330
  return e.attributes.getNamedItem("placeholder")?.value ?? "";
1260
1331
  let n = "";
1261
- const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), l = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), s = new Date(l);
1332
+ const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), r = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), s = new Date(r);
1262
1333
  e.attributes.getNamedItem("display-utc") !== null && s.setMinutes(s.getMinutes() - s.getTimezoneOffset());
1263
- let u = e.attributes.getNamedItem("format")?.value;
1264
- const r = e.attributes.getNamedItem("date-only") !== null;
1265
- if (!u && e.attributes.getNamedItem("relative-date") !== null) {
1334
+ let a = e.attributes.getNamedItem("format")?.value;
1335
+ const l = e.attributes.getNamedItem("date-only") !== null;
1336
+ if (!a && e.attributes.getNamedItem("relative-date") !== null) {
1266
1337
  const d = /* @__PURE__ */ new Date();
1267
- d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at", u = "HH:mm");
1338
+ d.getFullYear() === s.getFullYear() && d.getMonth() === s.getMonth() && d.getDate() === s.getDate() && (n = "at", a = "HH:mm");
1268
1339
  }
1269
- if (!u && e.attributes.getNamedItem("simplified-date") !== null) {
1340
+ if (!a && e.attributes.getNamedItem("simplified-date") !== null) {
1270
1341
  let d = null;
1271
- const E = /* @__PURE__ */ new Date();
1272
- E.getFullYear() === s.getFullYear() ? (E.getMonth() !== s.getMonth() || E.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
1273
- const h = r ? null : F.defaultTimeFormat;
1274
- u = tt([d, h]).join(" ");
1342
+ const h = /* @__PURE__ */ new Date();
1343
+ h.getFullYear() === s.getFullYear() ? (h.getMonth() !== s.getMonth() || h.getDate() !== s.getDate()) && (d = "M/d") : d = "M/d/yy";
1344
+ const m = l ? null : F.defaultTimeFormat;
1345
+ a = nt([d, m]).join(" ");
1275
1346
  }
1276
- u || (r ? u = F.defaultDateFormat : u = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1277
- let c = U(s, u);
1278
- return n && (c = n + " " + c), c;
1347
+ a || (l ? a = F.defaultDateFormat : a = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1348
+ let u = P(s, a);
1349
+ return n && (u = n + " " + u), u;
1279
1350
  }
1280
- const bo = {
1281
- beforeMount: Ye,
1282
- updated: Ye,
1283
- unmounted: ko
1351
+ const xo = {
1352
+ beforeMount: Xe,
1353
+ updated: Xe,
1354
+ unmounted: Mo
1284
1355
  };
1285
- function Ye(e, t) {
1356
+ function Xe(e, t) {
1286
1357
  e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
1287
1358
  }
1288
- function ko(e) {
1359
+ function Mo(e) {
1289
1360
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1290
1361
  }
1291
- const To = {
1292
- beforeMount: Xe,
1293
- updated: Xe,
1294
- unmounted: ct
1295
- }, ee = Symbol("HasAutoFocused"), Me = [];
1296
- function So() {
1297
- Me.forEach(ut);
1362
+ const Lo = {
1363
+ beforeMount: Ge,
1364
+ updated: Ge,
1365
+ unmounted: ft
1366
+ }, ee = Symbol("HasAutoFocused"), Le = [];
1367
+ function Fo() {
1368
+ Le.forEach(dt);
1298
1369
  }
1299
- setInterval(So, 1e3);
1300
- function Xe(e, t) {
1370
+ setInterval(Fo, 1e3);
1371
+ function Ge(e, t) {
1301
1372
  if (t.value == t.oldValue) return;
1302
- if (!t.value) return ct(e);
1303
- const n = new Date(t.value), o = e.attributes.getNamedItem("base-time")?.value, l = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
1304
- e[ee] || Me.push(e), e[ee] = {
1305
- startTs: l,
1373
+ if (!t.value) return ft(e);
1374
+ const n = new Date(t.value), o = e.attributes.getNamedItem("base-time")?.value, r = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
1375
+ e[ee] || Le.push(e), e[ee] = {
1376
+ startTs: r,
1306
1377
  includeSeconds: s
1307
- }, ut(e);
1378
+ }, dt(e);
1308
1379
  }
1309
- function ut(e) {
1380
+ function dt(e) {
1310
1381
  const t = e[ee], n = Math.round((Date.now() - t.startTs) / 1e3);
1311
- e.innerText = Co(n, t.includeSeconds);
1382
+ e.innerText = Oo(n, t.includeSeconds);
1312
1383
  }
1313
- function ct(e) {
1314
- e[ee] && (Kt(Me, e), delete e[ee]), e.innerText = "-";
1384
+ function ft(e) {
1385
+ e[ee] && (Xt(Le, e), delete e[ee]), e.innerText = "-";
1315
1386
  }
1316
- function Co(e, t) {
1387
+ function Oo(e, t) {
1317
1388
  const n = [], o = Math.floor(e / 86400);
1318
1389
  o && n.push(o + "d"), e -= o * 86400;
1319
- const l = Math.floor(e / 3600);
1320
- (o || l) && n.push(l + "h"), e -= l * 3600;
1390
+ const r = Math.floor(e / 3600);
1391
+ (o || r) && n.push(r + "h"), e -= r * 3600;
1321
1392
  const s = Math.floor(e / 60);
1322
- return (o || l || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
1393
+ return (o || r || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
1323
1394
  }
1324
- const xo = {
1325
- mounted: dt,
1326
- updated: Mo,
1327
- unmounted: ft
1395
+ const Io = {
1396
+ mounted: pt,
1397
+ updated: Do,
1398
+ unmounted: vt
1328
1399
  }, j = /* @__PURE__ */ new Map();
1329
- function dt(e, t) {
1330
- j.size === 0 && window.addEventListener("keydown", vt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1400
+ function pt(e, t) {
1401
+ j.size === 0 && window.addEventListener("keydown", mt), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1331
1402
  }
1332
- function ft(e, t) {
1403
+ function vt(e, t) {
1333
1404
  const n = j.get(t.value.toLowerCase());
1334
1405
  if (n) {
1335
1406
  const o = n.indexOf(e);
1336
1407
  o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
1337
1408
  }
1338
- j.size === 0 && window.removeEventListener("keydown", vt);
1409
+ j.size === 0 && window.removeEventListener("keydown", mt);
1339
1410
  }
1340
- function Mo(e, t) {
1341
- ft(e, t), dt(e, t);
1411
+ function Do(e, t) {
1412
+ vt(e, t), pt(e, t);
1342
1413
  }
1343
- function vt(e) {
1414
+ function mt(e) {
1344
1415
  if (typeof e.key != "string") return;
1345
1416
  const t = e.key.toLowerCase(), n = j.get(t);
1346
- n && (Yt(n)?.click(), e.preventDefault());
1417
+ n && (Gt(n)?.click(), e.preventDefault());
1347
1418
  }
1348
- const Y = Symbol("InfiniteScrollHandler"), Lo = {
1419
+ const Y = Symbol("InfiniteScrollHandler"), Ho = {
1349
1420
  mounted(e, t) {
1350
- e[Y] = new G(e, t.value);
1421
+ e[Y] = new Z(e, t.value);
1351
1422
  },
1352
1423
  updated(e, t) {
1353
- e[Y]?.uninstall(), e[Y] = new G(e, t.value);
1424
+ e[Y]?.uninstall(), e[Y] = new Z(e, t.value);
1354
1425
  },
1355
1426
  unmounted(e) {
1356
1427
  e[Y]?.uninstall(), delete e[Y];
1357
1428
  }
1358
- }, Fo = {
1429
+ }, Vo = {
1359
1430
  beforeMount: Ze,
1360
1431
  updated: Ze
1361
1432
  };
1362
1433
  function Ze(e, t) {
1363
1434
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1364
1435
  }
1365
- const Oo = {
1366
- mounted: Ge,
1367
- updated: Ge,
1368
- unmounted: pt
1436
+ const Ao = {
1437
+ mounted: Je,
1438
+ updated: Je,
1439
+ unmounted: ht
1369
1440
  }, J = Symbol("TooltipState");
1370
- function Ge(e, t) {
1441
+ function Je(e, t) {
1371
1442
  let n = e.attributes.getNamedItem("tip")?.value ?? t.value;
1372
1443
  if (t.value || (n = null), n) {
1373
1444
  const o = {
1374
1445
  content: n,
1375
1446
  html: e.getAttribute("html") !== null
1376
1447
  };
1377
- e[J] ? e[J].configure(o) : e[J] = new Io(e, o);
1448
+ e[J] ? e[J].configure(o) : e[J] = new $o(e, o);
1378
1449
  } else
1379
- pt(e);
1450
+ ht(e);
1380
1451
  }
1381
- function pt(e) {
1452
+ function ht(e) {
1382
1453
  e[J]?.destroy(), delete e[J];
1383
1454
  }
1384
- class Io {
1455
+ class $o {
1385
1456
  constructor(t, n) {
1386
1457
  this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
1387
1458
  }
@@ -1417,9 +1488,9 @@ class Io {
1417
1488
  this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
1418
1489
  }
1419
1490
  handleMouseMove(t) {
1420
- const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, l = window.innerWidth, s = window.innerHeight;
1421
- let u = t.pageX + 10, r = t.pageY + 20;
1422
- u + n > l && (u = Math.max(10, t.pageX - 5 - n)), r + o > s && (r = Math.max(10, t.pageY - 5 - o)), this.tipEl.style.left = u + "px", this.tipEl.style.top = r + "px", this.lastMoveEvt = t;
1491
+ const n = this.tipEl.offsetWidth, o = this.tipEl.offsetHeight, r = window.innerWidth, s = window.innerHeight;
1492
+ let a = t.pageX + 10, l = t.pageY + 20;
1493
+ a + n > r && (a = Math.max(10, t.pageX - 5 - n)), l + o > s && (l = Math.max(10, t.pageY - 5 - o)), this.tipEl.style.left = a + "px", this.tipEl.style.top = l + "px", this.lastMoveEvt = t;
1423
1494
  }
1424
1495
  checkMoveEvent() {
1425
1496
  this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && (this.tipEl?.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
@@ -1428,64 +1499,64 @@ class Io {
1428
1499
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
1429
1500
  }
1430
1501
  }
1431
- function Do(e) {
1432
- e.directive("autofocus", po), e.directive("confirm-button", mo), e.directive("date-input", yo), e.directive("datetime", wo), e.directive("disabled", bo), e.directive("duration", To), e.directive("hotkey", xo), e.directive("infinite-scroll", Lo), e.directive("readonly", Fo), e.directive("tooltip", Oo);
1502
+ function Bo(e) {
1503
+ e.directive("autofocus", wo), e.directive("confirm-button", Eo), e.directive("date-input", ko), e.directive("datetime", So), e.directive("disabled", xo), e.directive("duration", Lo), e.directive("hotkey", Io), e.directive("infinite-scroll", Ho), e.directive("readonly", Vo), e.directive("tooltip", Ao);
1433
1504
  }
1434
- function cs(e) {
1435
- Do(e);
1505
+ function vs(e) {
1506
+ Bo(e);
1436
1507
  }
1437
1508
  export {
1438
- Ro as OverlayContainer,
1509
+ Wo as OverlayContainer,
1439
1510
  de as UserError,
1440
- _o as VfAjaxSelect,
1511
+ jo as VfAjaxSelect,
1441
1512
  ne as VfAlertModal,
1442
- ss as VfEzSmartSelect,
1513
+ as as VfEzSmartSelect,
1443
1514
  gn as VfModal,
1444
- Pn as VfSmartSelect,
1445
- Qo as cloneProp,
1446
- No as configureVf,
1447
- ts as configureVfOpenApiClient,
1448
- rs as createFilters,
1515
+ Xn as VfSmartSelect,
1516
+ os as cloneProp,
1517
+ Po as configureVf,
1518
+ rs as configureVfOpenApiClient,
1519
+ ds as createFilters,
1449
1520
  ce as createOverlayInjection,
1450
- Vn as desnakeCase,
1451
- rn as dismissOverlayInjectionById,
1452
- Wo as dismissOverlayInjectionByInstance,
1453
- nt as dismissOverlayInjectionByInternalInstance,
1454
- ln as dismissOverlayInjectionByVnode,
1455
- vs as escapeHtml,
1521
+ Nn as desnakeCase,
1522
+ ln as dismissOverlayInjectionById,
1523
+ qo as dismissOverlayInjectionByInstance,
1524
+ ot as dismissOverlayInjectionByInternalInstance,
1525
+ rn as dismissOverlayInjectionByVnode,
1526
+ ys as escapeHtml,
1456
1527
  cn as formatError,
1457
1528
  kn as formatNumber,
1458
- Hn as formatPhone,
1459
- An as formatUSCurrency,
1460
- Ko as handleError,
1461
- zo as handleErrorAndAlert,
1462
- cs as installVf,
1529
+ _n as formatPhone,
1530
+ Rn as formatUSCurrency,
1531
+ Zo as handleError,
1532
+ Go as handleErrorAndAlert,
1533
+ vs as installVf,
1463
1534
  dn as isError,
1464
- We as isNotNullOrUndefined,
1465
- Yo as maskComponent,
1535
+ je as isNotNullOrUndefined,
1536
+ Jo as maskComponent,
1466
1537
  fn as maskEl,
1467
- vn as maskForm,
1468
- ns as nl2br,
1469
- es as nullifyEmptyInputs,
1538
+ pn as maskForm,
1539
+ is as nl2br,
1540
+ ss as nullifyEmptyInputs,
1470
1541
  Te as presentOverlay,
1471
1542
  Q as removeOverlayInjection,
1472
- Zo as replaceElement,
1543
+ es as replaceElement,
1473
1544
  un as showAlert,
1474
- jo as showConfirm,
1475
- Uo as showConfirmDestroy,
1476
- Go as showContextMenu,
1477
- qo as showMutableWait,
1478
- ls as showToast,
1479
- Po as showWait,
1545
+ zo as showConfirm,
1546
+ Ko as showConfirmDestroy,
1547
+ ts as showContextMenu,
1548
+ Xo as showMutableWait,
1549
+ cs as showToast,
1550
+ Yo as showWait,
1480
1551
  bn as sleep,
1481
- Jo as sleepSecs,
1552
+ ns as sleepSecs,
1482
1553
  Se as toError,
1483
- Xo as unmaskComponent,
1484
- ot as unmaskEl,
1485
- st as unmaskForm,
1554
+ Qo as unmaskComponent,
1555
+ st as unmaskEl,
1556
+ rt as unmaskForm,
1486
1557
  an as updateOverlayProps,
1487
- as as useInfiniteScroll,
1488
- us as useResizeWatcher,
1489
- os as uuid,
1490
- is as vfModalRef
1558
+ fs as useInfiniteScroll,
1559
+ ps as useResizeWatcher,
1560
+ ls as uuid,
1561
+ us as vfModalRef
1491
1562
  };