@signal24/vue-foundation 4.3.3 → 4.3.5

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,16 @@
1
- var De = Object.defineProperty;
2
- var $e = (e, t, n) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var p = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { defineComponent as I, defineProps as Ae, defineEmits as Ve, ref as A, computed as V, openBlock as c, createElementBlock as d, createElementVNode as g, toDisplayString as k, withDirectives as B, createCommentVNode as y, Fragment as F, renderList as q, vModelSelect as Be, reactive as Fe, h as me, markRaw as _e, getCurrentInstance as ve, onMounted as z, onBeforeUnmount as X, createBlock as Y, Teleport as Ne, normalizeClass as T, withModifiers as Ke, renderSlot as R, resolveDirective as ge, createSlots as Re, withCtx as U, createTextVNode as te, vModelText as Ue, watch as ne, onActivated as ye, onDeactivated as Ee } from "vue";
5
- import { debounce as je, isEqual as Te, upperFirst as Pe, startCase as We, cloneDeep as qe, remove as ze } from "lodash";
6
- import { escapeHtml as Xe } from "@vue/shared";
1
+ var $e = Object.defineProperty;
2
+ var Ae = (e, t, n) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var m = (e, t, n) => (Ae(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { defineComponent as D, defineProps as Ve, defineEmits as Be, ref as I, computed as B, openBlock as c, createElementBlock as u, createElementVNode as y, toDisplayString as M, withDirectives as F, createCommentVNode as T, Fragment as _, renderList as z, vModelSelect as Fe, reactive as _e, h as ve, markRaw as Ne, getCurrentInstance as ge, onMounted as X, onBeforeUnmount as Y, createBlock as Z, Teleport as Ke, normalizeClass as b, withModifiers as Re, renderSlot as U, resolveDirective as ye, createSlots as Ue, withCtx as j, createTextVNode as ne, vModelText as je, watch as ie, onActivated as Ee, onDeactivated as Te } from "vue";
5
+ import { debounce as Pe, isEqual as Oe, upperFirst as We, startCase as qe, cloneDeep as ze, remove as Xe } from "lodash";
6
+ import { escapeHtml as Ye } from "@vue/shared";
7
7
  import { escapeHtml as Un } from "@vue/shared";
8
- import { format as P } from "date-fns";
9
- const Ye = I({
8
+ import { format as W } from "date-fns";
9
+ const Ze = D({
10
10
  setup() {
11
- const e = Ae();
12
- Ve(["update:modelValue"]);
13
- const t = A(null), n = V(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = A(e.modelValue ?? null);
11
+ const e = Ve();
12
+ Be(["update:modelValue"]);
13
+ const t = I(null), n = B(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = I(e.modelValue ?? null);
14
14
  return { props: e, options: t, renderOptions: n, selectedItem: i };
15
15
  },
16
16
  watch: {
@@ -32,148 +32,190 @@ const Ye = I({
32
32
  this.options = await this.props.loadFn();
33
33
  }
34
34
  }
35
- }), Oe = (e, t) => {
35
+ }), be = (e, t) => {
36
36
  const n = e.__vccOpts || e;
37
37
  for (const [i, s] of t)
38
38
  n[i] = s;
39
39
  return n;
40
- }, Ze = {
40
+ }, Ge = {
41
41
  key: 0,
42
42
  disabled: ""
43
- }, Ge = {
43
+ }, Qe = {
44
44
  key: 0,
45
45
  value: null
46
- }, Qe = ["value"];
47
- function Je(e, t, n, i, s, o) {
48
- return e.renderOptions ? B((c(), d("select", {
46
+ }, Je = ["value"];
47
+ function et(e, t, n, i, s, o) {
48
+ return e.renderOptions ? F((c(), u("select", {
49
49
  key: 1,
50
50
  "onUpdate:modelValue": t[0] || (t[0] = (r) => e.selectedItem = r)
51
51
  }, [
52
- e.props.nullText ? (c(), d("option", Ge, k(e.props.nullText), 1)) : y("", !0),
53
- (c(!0), d(F, null, q(e.renderOptions, (r, l) => {
52
+ e.props.nullText ? (c(), u("option", Qe, M(e.props.nullText), 1)) : T("", !0),
53
+ (c(!0), u(_, null, z(e.renderOptions, (r, l) => {
54
54
  var a;
55
- return c(), d("option", {
55
+ return c(), u("option", {
56
56
  key: l,
57
57
  value: (a = e.options) == null ? void 0 : a[l]
58
- }, k(r), 9, Qe);
58
+ }, M(r), 9, Je);
59
59
  }), 128))
60
60
  ], 512)), [
61
- [Be, e.selectedItem]
62
- ]) : (c(), d("select", Ze, [
63
- g("option", null, k(e.props.loadingText || "Loading..."), 1)
61
+ [Fe, e.selectedItem]
62
+ ]) : (c(), u("select", Ge, [
63
+ y("option", null, M(e.props.loadingText || "Loading..."), 1)
64
64
  ]));
65
65
  }
66
- const mn = /* @__PURE__ */ Oe(Ye, [["render", Je]]);
67
- let et = 0;
68
- const E = Fe([]), vn = I({
66
+ const vn = /* @__PURE__ */ be(Ze, [["render", et]]);
67
+ let tt = 0;
68
+ const O = _e([]), gn = D({
69
69
  setup() {
70
- return () => me("div", { id: "modal-container" }, [
71
- q(E, (e) => e.vnode)
70
+ return () => ve("div", { id: "modal-container" }, [
71
+ z(O, (e) => e.vnode)
72
72
  ]);
73
73
  }
74
74
  });
75
- function be(e, t) {
75
+ function we(e, t) {
76
76
  const n = document.getElementById("vf-modal-target") ?? document.createElement("div");
77
77
  n.id = "vf-modal-target", n.removeAttribute("inert"), document.body.appendChild(n);
78
- const i = _e(e), s = {
79
- id: String(++et),
78
+ const i = Ne(e), s = {
79
+ id: String(++tt),
80
80
  component: i,
81
81
  props: t,
82
- vnode: me(i, t)
82
+ vnode: ve(i, t)
83
83
  };
84
- return E.push(s), s;
84
+ return O.push(s), s;
85
85
  }
86
- function we(e) {
87
- const t = E.indexOf(e);
88
- t >= 0 && E.splice(t, 1);
86
+ function Se(e) {
87
+ const t = O.indexOf(e);
88
+ t >= 0 && O.splice(t, 1);
89
89
  }
90
- function gn(e) {
91
- Se(e.$);
90
+ function yn(e) {
91
+ ke(e.$);
92
92
  }
93
- function Se(e) {
93
+ function ke(e) {
94
94
  let t = e;
95
- for (; t && !tt(t.vnode); )
95
+ for (; t && !nt(t.vnode); )
96
96
  t = t.parent;
97
97
  }
98
- function tt(e) {
98
+ function nt(e) {
99
99
  var n, i;
100
- const t = E.findIndex((s) => s.vnode.component === e.component);
101
- return t >= 0 ? ((i = (n = E[t].props).callback) == null || i.call(n, void 0), E.splice(t, 1), !0) : !1;
100
+ const t = O.findIndex((s) => s.vnode.component === e.component);
101
+ return t >= 0 ? ((i = (n = O[t].props).callback) == null || i.call(n, void 0), O.splice(t, 1), !0) : !1;
102
102
  }
103
- async function Z(e, t) {
103
+ async function G(e, t) {
104
104
  return new Promise((n) => {
105
105
  let i = null;
106
106
  const o = { ...t, callback: (r) => {
107
- we(i), n(r);
107
+ Se(i), n(r);
108
108
  } };
109
- i = be(e, o);
109
+ i = we(e, o);
110
110
  });
111
111
  }
112
- function _(e, t) {
112
+ function N(e, t) {
113
113
  return { title: t ? e : void 0, message: t ?? e };
114
114
  }
115
- async function ie(e, t) {
116
- await Z(K, _(e, t));
115
+ async function se(e, t) {
116
+ await G(R, N(e, t));
117
117
  }
118
- async function yn(e, t) {
119
- return await Z(K, {
120
- ..._(e, t),
118
+ async function En(e, t) {
119
+ return await G(R, {
120
+ ...N(e, t),
121
121
  shouldConfirm: !0
122
122
  }) === !0;
123
123
  }
124
- async function En(e, t) {
125
- return await Z(K, {
126
- ..._(e, t),
124
+ async function Tn(e, t) {
125
+ return await G(R, {
126
+ ...N(e, t),
127
127
  shouldConfirm: !0,
128
128
  classes: ["destructive"]
129
129
  }) === !0;
130
130
  }
131
- function Tn(e, t) {
132
- const n = be(K, {
133
- ..._(e, t),
131
+ function On(e, t) {
132
+ const n = we(R, {
133
+ ...N(e, t),
134
+ isBare: !0,
135
+ classes: ["wait"],
134
136
  callback: () => {
135
137
  }
136
138
  });
137
- return () => we(n);
139
+ return () => Se(n);
138
140
  }
139
- const H = {
141
+ const $ = {
140
142
  unhandledErrorSupportText: "please contact support",
141
143
  errorHandler: (e) => console.error("Unhandled error:", e),
142
144
  defaultDateTimeFormat: "MM/dd/yy HH:mm"
143
145
  };
144
- function On(e) {
145
- Object.assign(H, e);
146
+ function bn(e) {
147
+ Object.assign($, e);
146
148
  }
147
- class N extends Error {
149
+ class K extends Error {
148
150
  constructor(t) {
149
151
  super(t), this.name = "UserError";
150
152
  }
151
153
  }
152
- function nt(e) {
153
- return e instanceof N ? e.message : `An application error has occurred:
154
+ function it(e) {
155
+ return e instanceof K ? e.message : `An application error has occurred:
154
156
 
155
- ${G(e).message}
157
+ ${Q(e).message}
156
158
 
157
- Please refresh the page and try again. If this error persists, ${H.unhandledErrorSupportText}.`;
159
+ Please refresh the page and try again. If this error persists, ${$.unhandledErrorSupportText}.`;
158
160
  }
159
- function G(e) {
161
+ function Q(e) {
160
162
  return e instanceof Error ? e : new Error(String(e));
161
163
  }
162
- async function bn(e, t) {
163
- const n = G(e);
164
- return n instanceof N || H.errorHandler(n), t ? ie(t, n) : ie(n);
164
+ async function wn(e, t) {
165
+ const n = Q(e);
166
+ return n instanceof K || $.errorHandler(n), t ? se(t, n) : se(n);
167
+ }
168
+ async function Sn(e) {
169
+ const t = Q(e);
170
+ t instanceof K || $.errorHandler(t);
171
+ }
172
+ const x = Symbol("MaskState");
173
+ function kn(e, t) {
174
+ const n = e.$.vnode.el, i = n.closest(".vf-modal");
175
+ return st(i ?? n, t);
176
+ }
177
+ function Mn(e) {
178
+ const t = e.$.vnode.el, n = t.closest(".vf-modal");
179
+ return Me(n ?? t);
165
180
  }
166
- async function wn(e) {
167
- const t = G(e);
168
- t instanceof N || H.errorHandler(t);
181
+ function st(e, t) {
182
+ if (!e[x]) {
183
+ const n = document.createElement("div");
184
+ n.classList.add("vf-mask"), e.appendChild(n), e[x] = { maskEl: n };
185
+ }
186
+ return e[x].maskEl.innerText = t ?? "", () => Me(e);
187
+ }
188
+ function Me(e) {
189
+ e[x] && e.removeChild(e[x].maskEl);
190
+ }
191
+ const q = Symbol("FormMaskState");
192
+ function ot(e, t, n) {
193
+ const i = e instanceof Element ? e : Le(e);
194
+ i.classList.add("vf-masked");
195
+ const s = t instanceof Element ? t : i.querySelectorAll(t ?? 'button:not([disabled]):not([type="button"])')[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
196
+ s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
197
+ const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
198
+ return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[q] = {
199
+ disabledElements: l,
200
+ waitButton: s,
201
+ buttonHtml: o
202
+ }, () => xe(i);
203
+ }
204
+ function xe(e) {
205
+ const t = e instanceof Element ? e : Le(e), n = t[q];
206
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[q]);
169
207
  }
170
- const it = ["id"], st = {
208
+ function Le(e) {
209
+ const t = e.$.vnode.el;
210
+ return t.tagName === "FORM" ? t : t.querySelector("form");
211
+ }
212
+ const lt = ["id"], rt = {
171
213
  key: 0,
172
214
  class: "vf-modal-header"
173
- }, ot = { class: "vf-modal-content" }, lt = {
215
+ }, at = { class: "vf-modal-content" }, ct = {
174
216
  key: 1,
175
217
  class: "vf-modal-footer"
176
- }, rt = /* @__PURE__ */ I({
218
+ }, dt = /* @__PURE__ */ D({
177
219
  __name: "modal",
178
220
  props: {
179
221
  id: {},
@@ -183,58 +225,68 @@ const it = ["id"], st = {
183
225
  class: {}
184
226
  },
185
227
  emits: ["formSubmit"],
186
- setup(e) {
187
- const t = e, n = ve(), i = A();
188
- z(() => {
189
- var l;
190
- document.body.classList.add("vf-modal-open"), t.closeOnMaskClick && (window.addEventListener("keydown", o), (l = i.value) == null || l.addEventListener("click", s));
191
- }), X(() => {
192
- window.removeEventListener("keydown", o), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
228
+ setup(e, { expose: t }) {
229
+ const n = e, i = ge();
230
+ t({ mask: v, unmask: h });
231
+ const s = I(), o = I();
232
+ X(() => {
233
+ var d;
234
+ document.body.classList.add("vf-modal-open"), n.closeOnMaskClick && (window.addEventListener("keydown", l), (d = s.value) == null || d.addEventListener("click", r));
235
+ }), Y(() => {
236
+ window.removeEventListener("keydown", l), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
193
237
  });
194
- function s(l) {
195
- l.target == i.value && r();
238
+ function r(d) {
239
+ d.target == s.value && a();
196
240
  }
197
- function o(l) {
198
- if (l.key === "Esc" || l.key === "Escape") {
199
- const a = document.querySelectorAll(".vf-modal-wrap");
200
- a[a.length - 1] === i.value && r();
241
+ function l(d) {
242
+ if (d.key === "Esc" || d.key === "Escape") {
243
+ const E = document.querySelectorAll(".vf-modal-wrap");
244
+ E[E.length - 1] === s.value && a();
201
245
  }
202
246
  }
203
- function r() {
204
- Se(n);
247
+ function a() {
248
+ ke(i);
249
+ }
250
+ function v() {
251
+ ot(o.value);
205
252
  }
206
- return (l, a) => (c(), Y(Ne, { to: "#vf-modal-target" }, [
207
- g("div", {
208
- id: l.id,
209
- class: T(["vf-overlay vf-modal-wrap", t.class]),
253
+ function h() {
254
+ xe(o.value);
255
+ }
256
+ return (d, E) => (c(), Z(Ke, { to: "#vf-modal-target" }, [
257
+ y("div", {
258
+ id: d.id,
259
+ class: b(["vf-overlay vf-modal-wrap", n.class]),
210
260
  ref_key: "overlay",
211
- ref: i
261
+ ref: s
212
262
  }, [
213
- g("form", {
263
+ y("form", {
214
264
  action: ".",
215
- class: T(["vf-modal", { scrolls: l.scrolls }]),
216
- onSubmit: a[0] || (a[0] = Ke((m) => l.$emit("formSubmit"), ["prevent"]))
265
+ class: b(["vf-modal", { scrolls: d.scrolls }]),
266
+ onSubmit: E[0] || (E[0] = Re((f) => d.$emit("formSubmit"), ["prevent"])),
267
+ ref_key: "form",
268
+ ref: o
217
269
  }, [
218
- l.$slots.header ? (c(), d("div", st, [
219
- R(l.$slots, "header"),
220
- t.closeX ? (c(), d("i", {
270
+ d.$slots.header ? (c(), u("div", rt, [
271
+ U(d.$slots, "header"),
272
+ n.closeX ? (c(), u("i", {
221
273
  key: 0,
222
274
  class: "close",
223
- onClick: r
224
- })) : y("", !0)
225
- ])) : y("", !0),
226
- g("div", ot, [
227
- R(l.$slots, "default")
275
+ onClick: a
276
+ })) : T("", !0)
277
+ ])) : T("", !0),
278
+ y("div", at, [
279
+ U(d.$slots, "default")
228
280
  ]),
229
- l.$slots.footer ? (c(), d("div", lt, [
230
- R(l.$slots, "footer")
231
- ])) : y("", !0)
281
+ d.$slots.footer ? (c(), u("div", ct, [
282
+ U(d.$slots, "footer")
283
+ ])) : T("", !0)
232
284
  ], 34)
233
- ], 10, it)
285
+ ], 10, lt)
234
286
  ]));
235
287
  }
236
288
  });
237
- const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
289
+ const ut = ["innerHtml"], ht = ["innerText"], R = /* @__PURE__ */ D({
238
290
  __name: "alert-modal",
239
291
  props: {
240
292
  isBare: { type: Boolean },
@@ -246,53 +298,53 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
246
298
  callback: { type: Function }
247
299
  },
248
300
  setup(e) {
249
- const t = e, n = V(() => t.message instanceof Error ? nt(t.message) : t.message);
301
+ const t = e, n = B(() => t.message instanceof Error ? it(t.message) : t.message);
250
302
  return (i, s) => {
251
- const o = ge("autofocus");
252
- return c(), Y(rt, {
253
- class: T(["vf-alert", i.classes])
254
- }, Re({
255
- default: U(() => [
256
- i.isHtml ? (c(), d("div", {
303
+ const o = ye("autofocus");
304
+ return c(), Z(dt, {
305
+ class: b(["vf-alert", i.classes])
306
+ }, Ue({
307
+ default: j(() => [
308
+ i.isHtml ? (c(), u("div", {
257
309
  key: 0,
258
310
  innerHtml: i.message,
259
311
  class: "user-message"
260
- }, null, 8, at)) : (c(), d("div", {
312
+ }, null, 8, ut)) : (c(), u("div", {
261
313
  key: 1,
262
314
  innerText: n.value
263
- }, null, 8, ct))
315
+ }, null, 8, ht))
264
316
  ]),
265
317
  _: 2
266
318
  }, [
267
- !i.isBare && i.title ? {
319
+ i.title ? {
268
320
  name: "header",
269
- fn: U(() => [
270
- g("h1", null, k(i.title), 1)
321
+ fn: j(() => [
322
+ y("h1", null, M(i.title), 1)
271
323
  ]),
272
324
  key: "0"
273
325
  } : void 0,
274
326
  i.isBare ? void 0 : {
275
327
  name: "footer",
276
- fn: U(() => [
277
- i.shouldConfirm ? (c(), d(F, { key: 0 }, [
278
- B((c(), d("button", {
328
+ fn: j(() => [
329
+ i.shouldConfirm ? (c(), u(_, { key: 0 }, [
330
+ F((c(), u("button", {
279
331
  class: "primary",
280
332
  onClick: s[0] || (s[0] = () => i.callback(!0))
281
333
  }, [
282
- te("Confirm")
334
+ ne("Confirm")
283
335
  ])), [
284
336
  [o]
285
337
  ]),
286
- g("button", {
338
+ y("button", {
287
339
  class: "default",
288
340
  onClick: s[1] || (s[1] = () => i.callback(!1))
289
341
  }, "Cancel")
290
- ], 64)) : B((c(), d("button", {
342
+ ], 64)) : F((c(), u("button", {
291
343
  key: 1,
292
344
  class: "default",
293
345
  onClick: s[2] || (s[2] = () => i.callback(!0))
294
346
  }, [
295
- te("OK")
347
+ ne("OK")
296
348
  ])), [
297
349
  [o]
298
350
  ])
@@ -303,52 +355,52 @@ const at = ["innerHtml"], ct = ["innerText"], K = /* @__PURE__ */ I({
303
355
  };
304
356
  }
305
357
  });
306
- let $;
307
- const dt = new Uint8Array(16);
308
- function ut() {
309
- if (!$ && ($ = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !$))
358
+ let V;
359
+ const ft = new Uint8Array(16);
360
+ function pt() {
361
+ if (!V && (V = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !V))
310
362
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
311
- return $(dt);
363
+ return V(ft);
312
364
  }
313
- const u = [];
365
+ const p = [];
314
366
  for (let e = 0; e < 256; ++e)
315
- u.push((e + 256).toString(16).slice(1));
316
- function ht(e, t = 0) {
317
- return (u[e[t + 0]] + u[e[t + 1]] + u[e[t + 2]] + u[e[t + 3]] + "-" + u[e[t + 4]] + u[e[t + 5]] + "-" + u[e[t + 6]] + u[e[t + 7]] + "-" + u[e[t + 8]] + u[e[t + 9]] + "-" + u[e[t + 10]] + u[e[t + 11]] + u[e[t + 12]] + u[e[t + 13]] + u[e[t + 14]] + u[e[t + 15]]).toLowerCase();
367
+ p.push((e + 256).toString(16).slice(1));
368
+ function mt(e, t = 0) {
369
+ return (p[e[t + 0]] + p[e[t + 1]] + p[e[t + 2]] + p[e[t + 3]] + "-" + p[e[t + 4]] + p[e[t + 5]] + "-" + p[e[t + 6]] + p[e[t + 7]] + "-" + p[e[t + 8]] + p[e[t + 9]] + "-" + p[e[t + 10]] + p[e[t + 11]] + p[e[t + 12]] + p[e[t + 13]] + p[e[t + 14]] + p[e[t + 15]]).toLowerCase();
318
370
  }
319
- const ft = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), se = {
320
- randomUUID: ft
371
+ const vt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = {
372
+ randomUUID: vt
321
373
  };
322
- function pt(e, t, n) {
323
- if (se.randomUUID && !t && !e)
324
- return se.randomUUID();
374
+ function gt(e, t, n) {
375
+ if (oe.randomUUID && !t && !e)
376
+ return oe.randomUUID();
325
377
  e = e || {};
326
- const i = e.random || (e.rng || ut)();
378
+ const i = e.random || (e.rng || pt)();
327
379
  if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
328
380
  n = n || 0;
329
381
  for (let s = 0; s < 16; ++s)
330
382
  t[n + s] = i[s];
331
383
  return t;
332
384
  }
333
- return ht(i);
385
+ return mt(i);
334
386
  }
335
- function Sn(e) {
387
+ function xn(e) {
336
388
  return e.replace(/\n/g, "<br>");
337
389
  }
338
- function mt(e) {
390
+ function yt(e) {
339
391
  return e.replace(/_/g, " ");
340
392
  }
341
- function vt(e) {
393
+ function Et(e) {
342
394
  const t = e.replace(/\D/g, "").replace(/^1/, "");
343
395
  return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
344
396
  }
345
- function gt(e) {
397
+ function Tt(e) {
346
398
  return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
347
399
  }
348
- function kn() {
349
- return pt();
400
+ function Ln() {
401
+ return gt();
350
402
  }
351
- const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Et = {
403
+ const w = Symbol("null"), le = Symbol("create"), Ot = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", bt = {
352
404
  props: {
353
405
  modelValue: {
354
406
  type: null,
@@ -427,8 +479,8 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
427
479
  return this.allOptions.map((e, t) => {
428
480
  var l, a;
429
481
  const n = this.formatter(e), i = (l = this.subtitleFormatter) == null ? void 0 : l.call(this, e), s = n ? n.trim().toLowerCase() : "", o = i ? i.trim().toLowerCase() : "", r = [];
430
- return this.searchFields ? this.searchFields.forEach((m) => {
431
- e[m] && r.push(String(e[m]).toLowerCase());
482
+ return this.searchFields ? this.searchFields.forEach((v) => {
483
+ e[v] && r.push(String(e[v]).toLowerCase());
432
484
  }) : (r.push(s), o && r.push(o)), {
433
485
  // eslint-disable-next-line vue/no-use-computed-property-like-method
434
486
  key: ((a = this.effectiveKeyExtractor) == null ? void 0 : a.call(this, e)) ?? String(t),
@@ -445,7 +497,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
445
497
  const t = this.searchText.trim().toLowerCase();
446
498
  if (t.length) {
447
499
  e = e.filter((s) => s.searchContent.includes(t));
448
- const n = Xe(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
500
+ const n = Ye(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
449
501
  e = e.map((s) => {
450
502
  var o;
451
503
  return {
@@ -454,13 +506,13 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
454
506
  subtitle: (o = s.subtitle) == null ? void 0 : o.replace(i, "<mark>$1</mark>")
455
507
  };
456
508
  }), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
457
- key: oe,
509
+ key: le,
458
510
  title: "Create <strong>" + this.searchText.trim() + "</strong>..."
459
511
  }));
460
512
  }
461
513
  } else
462
514
  this.nullTitle && e.unshift({
463
- key: b,
515
+ key: w,
464
516
  title: this.nullTitle
465
517
  });
466
518
  return e;
@@ -486,7 +538,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
486
538
  },
487
539
  effectiveOptions() {
488
540
  var e;
489
- this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ?? b);
541
+ this.modelValue && !this.selectedOption && this.handleValueChanged(), this.highlightedOptionKey && !this.effectiveOptions.find((t) => t.key == this.highlightedOptionKey) && (this.highlightedOptionKey = ((e = this.effectiveOptions[0]) == null ? void 0 : e.key) ?? w);
490
542
  }
491
543
  },
492
544
  async mounted() {
@@ -495,7 +547,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
495
547
  "update:modelValue",
496
548
  this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
497
549
  );
498
- }), this.remoteSearch && this.$watch("searchText", je(this.reloadOptionsIfSearching, 250));
550
+ }), this.remoteSearch && this.$watch("searchText", Pe(this.reloadOptionsIfSearching, 250));
499
551
  },
500
552
  methods: {
501
553
  async loadRemoteOptions() {
@@ -540,7 +592,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
540
592
  this.searchText.length > 1 && (this.isSearching = !0);
541
593
  return;
542
594
  }
543
- !e.metaKey && yt.includes(e.key) && (this.isSearching = !0);
595
+ !e.metaKey && Ot.includes(e.key) && (this.isSearching = !0);
544
596
  }
545
597
  },
546
598
  handleInputFocused() {
@@ -548,7 +600,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
548
600
  },
549
601
  setHighlightedOptionKey(e) {
550
602
  var t;
551
- this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? b : this.nullTitle && (this.highlightedOptionKey = b);
603
+ this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? w : this.nullTitle && (this.highlightedOptionKey = w);
552
604
  },
553
605
  getOptionKey(e) {
554
606
  var t;
@@ -558,7 +610,7 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
558
610
  const t = this.effectiveOptions.find((i) => i.ref === e);
559
611
  if (t)
560
612
  return t;
561
- const n = this.effectiveOptions.find((i) => Te(i.ref, e));
613
+ const n = this.effectiveOptions.find((i) => Oe(i.ref, e));
562
614
  return n || null;
563
615
  },
564
616
  handleInputBlurred() {
@@ -596,9 +648,9 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
596
648
  s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
597
649
  },
598
650
  selectOption(e) {
599
- if (this.isSearching = !1, e.key == b)
651
+ if (this.isSearching = !1, e.key == w)
600
652
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
601
- else if (e.key === oe) {
653
+ else if (e.key === le) {
602
654
  const t = this.searchText.trim();
603
655
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, this.$emit("createItem", t);
604
656
  } else {
@@ -615,61 +667,61 @@ const b = Symbol("null"), oe = Symbol("create"), yt = "`1234567890-=[]\\;',./~!@
615
667
  }
616
668
  }
617
669
  };
618
- const Tt = ["placeholder"], Ot = {
670
+ const wt = ["placeholder"], St = {
619
671
  key: 0,
620
672
  ref: "optionsContainer",
621
673
  class: "vf-smart-select-options"
622
- }, bt = {
674
+ }, kt = {
623
675
  key: 0,
624
676
  class: "no-results"
625
- }, wt = ["onMousemove", "onMousedown"], St = ["innerHTML"], kt = ["innerHTML"], Mt = {
677
+ }, Mt = ["onMousemove", "onMousedown"], xt = ["innerHTML"], Lt = ["innerHTML"], Ct = {
626
678
  key: 0,
627
679
  class: "no-results"
628
680
  };
629
- function Lt(e, t, n, i, s, o) {
630
- const r = ge("disabled");
631
- return c(), d("div", {
632
- class: T(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
681
+ function It(e, t, n, i, s, o) {
682
+ const r = ye("disabled");
683
+ return c(), u("div", {
684
+ class: b(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
633
685
  }, [
634
- B(g("input", {
686
+ F(y("input", {
635
687
  "onUpdate:modelValue": t[0] || (t[0] = (l) => e.searchText = l),
636
688
  ref: "searchField",
637
689
  type: "text",
638
- class: T({ nullable: !!n.nullTitle }),
690
+ class: b({ nullable: !!n.nullTitle }),
639
691
  onKeydown: t[1] || (t[1] = (...l) => o.handleKeyDown && o.handleKeyDown(...l)),
640
692
  placeholder: o.effectivePlaceholder,
641
693
  onFocus: t[2] || (t[2] = (...l) => o.handleInputFocused && o.handleInputFocused(...l)),
642
694
  onBlur: t[3] || (t[3] = (...l) => o.handleInputBlurred && o.handleInputBlurred(...l))
643
- }, null, 42, Tt), [
644
- [Ue, e.searchText],
695
+ }, null, 42, wt), [
696
+ [je, e.searchText],
645
697
  [r, o.effectiveDisabled]
646
698
  ]),
647
- e.shouldDisplayOptions ? (c(), d("div", Ot, [
648
- e.isLoaded ? (c(), d(F, { key: 1 }, [
649
- (c(!0), d(F, null, q(o.effectiveOptions, (l) => (c(), d("div", {
699
+ e.shouldDisplayOptions ? (c(), u("div", St, [
700
+ e.isLoaded ? (c(), u(_, { key: 1 }, [
701
+ (c(!0), u(_, null, z(o.effectiveOptions, (l) => (c(), u("div", {
650
702
  key: String(l.key),
651
- class: T(["option", {
703
+ class: b(["option", {
652
704
  highlighted: e.highlightedOptionKey === l.key
653
705
  }]),
654
706
  onMousemove: (a) => o.handleOptionHover(l),
655
707
  onMousedown: (a) => o.selectOption(l)
656
708
  }, [
657
- g("div", {
709
+ y("div", {
658
710
  class: "title",
659
711
  innerHTML: l.title
660
- }, null, 8, St),
661
- l.subtitle ? (c(), d("div", {
712
+ }, null, 8, xt),
713
+ l.subtitle ? (c(), u("div", {
662
714
  key: 0,
663
715
  class: "subtitle",
664
716
  innerHTML: l.subtitle
665
- }, null, 8, kt)) : y("", !0)
666
- ], 42, wt))), 128)),
667
- !o.effectiveOptions.length && e.searchText ? (c(), d("div", Mt, k(o.effectiveNoResultsText), 1)) : y("", !0)
668
- ], 64)) : (c(), d("div", bt, "Loading..."))
669
- ], 512)) : y("", !0)
717
+ }, null, 8, Lt)) : T("", !0)
718
+ ], 42, Mt))), 128)),
719
+ !o.effectiveOptions.length && e.searchText ? (c(), u("div", Ct, M(o.effectiveNoResultsText), 1)) : T("", !0)
720
+ ], 64)) : (c(), u("div", kt, "Loading..."))
721
+ ], 512)) : T("", !0)
670
722
  ], 2);
671
723
  }
672
- const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
724
+ const Ht = /* @__PURE__ */ be(bt, [["render", It]]), Cn = /* @__PURE__ */ D({
673
725
  __name: "ez-smart-select",
674
726
  props: {
675
727
  modelValue: {},
@@ -680,22 +732,22 @@ const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
680
732
  },
681
733
  emits: ["update:modelValue"],
682
734
  setup(e, { emit: t }) {
683
- const n = e, i = V(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
735
+ const n = e, i = B(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, l]) => ({
684
736
  value: r,
685
737
  label: l
686
- }))), s = V(() => n.formatter ? (r) => {
738
+ }))), s = B(() => n.formatter ? (r) => {
687
739
  var l;
688
740
  return (l = n.formatter) == null ? void 0 : l.call(n, r.label);
689
- } : (r) => r.label), o = A(i.value.find((r) => r.value === n.modelValue) ?? null);
690
- return ne(
741
+ } : (r) => r.label), o = I(i.value.find((r) => r.value === n.modelValue) ?? null);
742
+ return ie(
691
743
  () => n.modelValue,
692
744
  (r) => {
693
745
  o.value = i.value.find((l) => l.value === r) ?? null;
694
746
  }
695
- ), ne(o, (r) => {
747
+ ), ie(o, (r) => {
696
748
  var l;
697
- t("update:modelValue", r ? ((l = i.value.find((a) => Te(a, r))) == null ? void 0 : l.value) ?? null : null);
698
- }), (r, l) => (c(), Y(xt, {
749
+ t("update:modelValue", r ? ((l = i.value.find((a) => Oe(a, r))) == null ? void 0 : l.value) ?? null : null);
750
+ }), (r, l) => (c(), Z(Ht, {
699
751
  modelValue: o.value,
700
752
  "onUpdate:modelValue": l[0] || (l[0] = (a) => o.value = a),
701
753
  options: i.value,
@@ -704,134 +756,95 @@ const xt = /* @__PURE__ */ Oe(Et, [["render", Lt]]), Mn = /* @__PURE__ */ I({
704
756
  }, null, 8, ["modelValue", "options", "formatter", "null-title"]));
705
757
  }
706
758
  });
707
- function Ct(e) {
759
+ function Dt(e) {
708
760
  const t = Math.floor(Math.log(e) / Math.log(1024)), i = (e / Math.pow(1024, t)).toFixed(2), s = ["B", "KB", "MB", "GB", "TB"][t];
709
761
  return `${i} ${s}`;
710
762
  }
711
- function It(e) {
712
- return e != null && String(e).length ? e : "-";
713
- }
714
- function Ht(e) {
715
- return e || "-";
716
- }
717
- function Dt(e) {
718
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Ut(Number(e));
719
- }
720
763
  function $t(e) {
721
- return e && vt(e);
764
+ return e != null && String(e).length ? e : "-";
722
765
  }
723
766
  function At(e) {
724
- return e ? Pe(e) : null;
767
+ return e || "-";
725
768
  }
726
769
  function Vt(e) {
727
- return e ? We(e) : null;
770
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : jt(Number(e));
728
771
  }
729
772
  function Bt(e) {
730
- return e ? e.toUpperCase() : null;
773
+ return e && Et(e);
731
774
  }
732
775
  function Ft(e) {
733
- return e ? mt(e) : null;
776
+ return e ? We(e) : null;
734
777
  }
735
778
  function _t(e) {
736
- return gt(e);
737
- }
738
- const le = {
739
- bytes: Ct,
740
- dash: It,
741
- dashZeros: Ht,
742
- number: Dt,
743
- phone: $t,
744
- upperFirst: At,
745
- startCase: Vt,
746
- upperCase: Bt,
747
- desnake: Ft,
748
- usCurrency: _t
749
- }, Ln = (e) => ({
750
- ...le,
751
- ...e(le)
779
+ return e ? qe(e) : null;
780
+ }
781
+ function Nt(e) {
782
+ return e ? e.toUpperCase() : null;
783
+ }
784
+ function Kt(e) {
785
+ return e ? yt(e) : null;
786
+ }
787
+ function Rt(e) {
788
+ return Tt(e);
789
+ }
790
+ const re = {
791
+ bytes: Dt,
792
+ dash: $t,
793
+ dashZeros: At,
794
+ number: Vt,
795
+ phone: Bt,
796
+ upperFirst: Ft,
797
+ startCase: _t,
798
+ upperCase: Nt,
799
+ desnake: Kt,
800
+ usCurrency: Rt
801
+ }, In = (e) => ({
802
+ ...re,
803
+ ...e(re)
752
804
  });
753
- function xn(e, t, n) {
805
+ function Hn(e, t, n) {
754
806
  const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
755
807
  return i === -1 ? !1 : (e.splice(i, 1, n), !0);
756
808
  }
757
- function Cn(e, t) {
809
+ function Dn(e, t) {
758
810
  const n = document.createElement("div");
759
- n.classList.add("vf-overlay"), n.addEventListener("click", O), document.body.appendChild(n);
811
+ n.classList.add("vf-overlay"), n.addEventListener("click", d), document.body.appendChild(n);
760
812
  const i = document.createElement("div");
761
813
  i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
762
814
  const s = e.currentTarget;
763
815
  s.style.userSelect = "none", s.classList.add("context-menu-active"), t.targetClass && s.classList.add(t.targetClass), t.class && i.classList.add(t.class), t.items.forEach((f) => {
764
816
  if (f == "-") {
765
- const D = document.createElement("div");
766
- D.classList.add("separator"), i.appendChild(D);
817
+ const A = document.createElement("div");
818
+ A.classList.add("separator"), i.appendChild(A);
767
819
  return;
768
820
  }
769
- const v = document.createElement("div");
770
- v.classList.add("item"), v.style.userSelect = "none", v.innerText = f.title, i.appendChild(v), f.class && v.classList.add(f.class), f.shouldConfirm ? v.addEventListener("click", () => f.handler()) : v.addEventListener("click", () => He(v, f.handler));
821
+ const g = document.createElement("div");
822
+ g.classList.add("item"), g.style.userSelect = "none", g.innerText = f.title, i.appendChild(g), f.class && g.classList.add(f.class), f.shouldConfirm ? g.addEventListener("click", () => f.handler()) : g.addEventListener("click", () => E(g, f.handler));
771
823
  });
772
- const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, m = o < a ? e.clientX - a - 1 : e.clientX + 1, h = r < l ? e.clientY - l - 1 : e.clientY + 1;
773
- i.style.left = m + "px", i.style.top = h + "px", setTimeout(() => {
824
+ const o = window.innerWidth - e.clientX, r = window.innerHeight - e.clientY, l = i.offsetHeight, a = i.offsetWidth, v = o < a ? e.clientX - a - 1 : e.clientX + 1, h = r < l ? e.clientY - l - 1 : e.clientY + 1;
825
+ i.style.left = v + "px", i.style.top = h + "px", setTimeout(() => {
774
826
  i.style.width = i.offsetWidth + "px";
775
827
  }, 50);
776
- function O() {
828
+ function d() {
777
829
  t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
778
830
  }
779
- function He(f, v) {
831
+ function E(f, g) {
780
832
  if (f.classList.contains("pending-confirm"))
781
- return v();
782
- const D = f.innerHTML;
833
+ return g();
834
+ const A = f.innerHTML;
783
835
  f.classList.add("pending-confirm"), f.innerText = "Confirm";
784
- const ee = () => {
785
- f.classList.remove("pending-confirm"), f.innerHTML = D, f.removeEventListener("mouseleave", ee);
836
+ const te = () => {
837
+ f.classList.remove("pending-confirm"), f.innerHTML = A, f.removeEventListener("mouseleave", te);
786
838
  };
787
- f.addEventListener("mouseleave", ee), e.stopPropagation();
839
+ f.addEventListener("mouseleave", te), e.stopPropagation();
788
840
  }
789
841
  }
790
- const Nt = (e) => new Promise((t) => setTimeout(t, e)), In = (e) => Nt(e * 1e3), M = Symbol("MaskState");
791
- function Hn(e, t) {
792
- const n = e.$.vnode.el, i = n.closest(".vf-modal");
793
- return Kt(i ?? n, t);
794
- }
795
- function Dn(e) {
796
- const t = e.$.vnode.el, n = t.closest(".vf-modal");
797
- return ke(n ?? t);
798
- }
799
- function Kt(e, t) {
800
- if (!e[M]) {
801
- const n = document.createElement("div");
802
- n.classList.add("vf-mask"), e.appendChild(n), e[M] = { maskEl: n };
803
- }
804
- return e[M].maskEl.innerText = t ?? "", () => ke(e);
805
- }
806
- function ke(e) {
807
- e[M] && e.removeChild(e[M].maskEl);
808
- }
809
- const W = Symbol("FormMaskState");
810
- function $n(e, t, n) {
811
- const i = e instanceof Element ? e : Me(e);
812
- i.classList.add("vf-masked");
813
- const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerHTML;
814
- s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
815
- const l = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
816
- return l.forEach((a) => a.setAttribute("disabled", "disabled")), i[W] = {
817
- disabledElements: l,
818
- waitButton: s,
819
- buttonHtml: o
820
- }, () => Rt(i);
821
- }
822
- function Rt(e) {
823
- const t = e instanceof Element ? e : Me(e), n = t[W];
824
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled"), delete t[W]);
825
- }
826
- function Me(e) {
827
- const t = e.$.vnode.el;
828
- return t.tagName === "FORM" ? t : t.querySelector("form");
829
- }
830
- function Ut(e) {
842
+ const Ut = (e) => new Promise((t) => setTimeout(t, e)), $n = (e) => Ut(e * 1e3);
843
+ function jt(e) {
831
844
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
832
845
  }
833
846
  function An(e, t) {
834
- return e != null ? qe(e) : t;
847
+ return e != null ? ze(e) : t;
835
848
  }
836
849
  function Vn(e, t) {
837
850
  const n = { ...e };
@@ -839,65 +852,65 @@ function Vn(e, t) {
839
852
  n[i] === "" && (n[i] = null);
840
853
  return n;
841
854
  }
842
- function jt(e) {
855
+ function Pt(e) {
843
856
  return e instanceof Error && "status" in e && "body" in e;
844
857
  }
845
858
  function Bn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
846
859
  const s = e.request.request.bind(e.request);
847
860
  e.request.request = (o) => (t && (o = t(o)), new i((r, l, a) => {
848
- const m = s(o);
849
- a(m.cancel), m.then(r).catch((h) => {
850
- if (jt(h) && typeof h.body == "object" && "error" in h.body) {
861
+ const v = s(o);
862
+ a(v.cancel), v.then(r).catch((h) => {
863
+ if (Pt(h) && typeof h.body == "object" && "error" in h.body) {
851
864
  if (h.status === 422)
852
- return l(new N(h.body.error));
865
+ return l(new K(h.body.error));
853
866
  h.message = `${h.body.error} (${h.status})`;
854
867
  }
855
868
  if (n) {
856
- const O = n(h, o);
857
- if (O === null)
869
+ const d = n(h, o);
870
+ if (d === null)
858
871
  return;
859
- if (O instanceof Error)
860
- return l(O);
872
+ if (d instanceof Error)
873
+ return l(d);
861
874
  }
862
875
  l(h);
863
876
  });
864
877
  }));
865
878
  }
866
- const Q = Symbol("HookState");
879
+ const J = Symbol("HookState");
867
880
  function Fn(e, t) {
868
- const n = t ?? ve();
869
- z(() => Pt(n, e), n), ye(() => Wt(n), n), Ee(() => re(n), n), X(() => re(n), n);
881
+ const n = t ?? ge();
882
+ X(() => Wt(n, e), n), Ee(() => qt(n), n), Te(() => ae(n), n), Y(() => ae(n), n);
870
883
  }
871
- function Pt(e, t) {
884
+ function Wt(e, t) {
872
885
  const n = {};
873
886
  if (t.elScrolledToBottom && (n.el = new L(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
874
- const i = Le(e.vnode.el);
887
+ const i = Ce(e.vnode.el);
875
888
  i ? n.ancestor = new L(i, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
876
889
  }
877
- t.windowScrolledToBottom && (n.window = new L(window, t.windowScrolledToBottom)), e[Q] = n;
890
+ t.windowScrolledToBottom && (n.window = new L(window, t.windowScrolledToBottom)), e[J] = n;
878
891
  }
879
- function Wt(e) {
892
+ function qt(e) {
880
893
  var n, i, s;
881
- const t = e[Q];
894
+ const t = e[J];
882
895
  (n = t == null ? void 0 : t.el) == null || n.install(), (i = t == null ? void 0 : t.ancestor) == null || i.install(), (s = t == null ? void 0 : t.window) == null || s.install();
883
896
  }
884
- function re(e) {
897
+ function ae(e) {
885
898
  var n, i, s;
886
- const t = e[Q];
899
+ const t = e[J];
887
900
  (n = t == null ? void 0 : t.el) == null || n.uninstall(), (i = t == null ? void 0 : t.ancestor) == null || i.uninstall(), (s = t == null ? void 0 : t.window) == null || s.uninstall();
888
901
  }
889
- const j = ["auto", "scroll"];
890
- function Le(e) {
902
+ const P = ["auto", "scroll"];
903
+ function Ce(e) {
891
904
  const t = e.parentElement;
892
905
  if (!t)
893
906
  return null;
894
907
  const n = window.getComputedStyle(t);
895
- return j.includes(n.overflow) || j.includes(n.overflowX) || j.includes(n.overflowY) ? t : Le(t);
908
+ return P.includes(n.overflow) || P.includes(n.overflowX) || P.includes(n.overflowY) ? t : Ce(t);
896
909
  }
897
910
  class L {
898
911
  constructor(t, n) {
899
- p(this, "isTripped", !1);
900
- p(this, "onScrollWithContext", this.onScroll.bind(this));
912
+ m(this, "isTripped", !1);
913
+ m(this, "onScrollWithContext", this.onScroll.bind(this));
901
914
  this.el = t, this.handler = n, this.install();
902
915
  }
903
916
  install() {
@@ -911,29 +924,29 @@ class L {
911
924
  }
912
925
  }
913
926
  function _n(e) {
914
- z(() => window.addEventListener("resize", e)), ye(() => window.addEventListener("resize", e)), Ee(() => window.removeEventListener("resize", e)), X(() => window.removeEventListener("resize", e));
915
- }
916
- const qt = {
917
- mounted: ce,
918
- updated: ce
919
- }, ae = Symbol("HasAutoFocused");
920
- function ce(e, t) {
921
- if (t.value === void 0 && e[ae] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
927
+ X(() => window.addEventListener("resize", e)), Ee(() => window.addEventListener("resize", e)), Te(() => window.removeEventListener("resize", e)), Y(() => window.removeEventListener("resize", e));
928
+ }
929
+ const zt = {
930
+ mounted: de,
931
+ updated: de
932
+ }, ce = Symbol("HasAutoFocused");
933
+ function de(e, t) {
934
+ if (t.value === void 0 && e[ce] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
922
935
  return;
923
- e[ae] = !0;
936
+ e[ce] = !0;
924
937
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
925
938
  setTimeout(() => n.focus(), 10);
926
939
  }
927
- const zt = {
928
- mounted: Xt
929
- }, w = Symbol("ConfirmState");
930
- function Xt(e) {
940
+ const Xt = {
941
+ mounted: Yt
942
+ }, S = Symbol("ConfirmState");
943
+ function Yt(e) {
931
944
  e.addEventListener("click", (t) => {
932
945
  const n = Date.now();
933
- if (e[w]) {
934
- if (n - e[w].initTime < 300)
946
+ if (e[S]) {
947
+ if (n - e[S].initTime < 300)
935
948
  return;
936
- e[w].resetHandler(), e.dispatchEvent(new Event("confirm"));
949
+ e[S].resetHandler(), e.dispatchEvent(new Event("confirm"));
937
950
  return;
938
951
  }
939
952
  t.preventDefault(), t.stopImmediatePropagation();
@@ -941,86 +954,86 @@ function Xt(e) {
941
954
  initTime: n,
942
955
  preconfirmHtml: e.innerHTML,
943
956
  resetHandler: () => {
944
- e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[w];
957
+ e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[S];
945
958
  }
946
959
  };
947
- e[w] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
960
+ e[S] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
948
961
  });
949
962
  }
950
- const Yt = {
951
- beforeMount: Zt
963
+ const Zt = {
964
+ beforeMount: Gt
952
965
  };
953
- function Zt(e) {
966
+ function Gt(e) {
954
967
  e.addEventListener("blur", () => {
955
968
  let t = e.value;
956
- /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
969
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + W(/* @__PURE__ */ new Date(), "yy"));
957
970
  const n = Date.parse(t);
958
- isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
971
+ isNaN(n) ? e.value = "" : e.value = W(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
959
972
  });
960
973
  }
961
- const Gt = {
962
- beforeMount: de,
963
- updated: de
974
+ const Qt = {
975
+ beforeMount: ue,
976
+ updated: ue
964
977
  };
965
- function de(e, t) {
966
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = Qt(e, t));
978
+ function ue(e, t) {
979
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = Jt(e, t));
967
980
  }
968
- function Qt(e, t) {
969
- var a, m;
981
+ function Jt(e, t) {
982
+ var a, v;
970
983
  if (!t.value)
971
984
  return ((a = e.attributes.getNamedItem("placeholder")) == null ? void 0 : a.value) ?? "";
972
985
  let n = "";
973
986
  const i = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), s = e.attributes.getNamedItem("local") !== null ? i.replace(/Z$/, "") : i.replace(/(Z|\+00:00)?$/, "Z"), o = new Date(s);
974
987
  e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
975
- let r = (m = e.attributes.getNamedItem("format")) == null ? void 0 : m.value;
988
+ let r = (v = e.attributes.getNamedItem("format")) == null ? void 0 : v.value;
976
989
  if (!r && e.attributes.getNamedItem("relative-date") !== null) {
977
990
  const h = /* @__PURE__ */ new Date();
978
991
  h.getFullYear() == o.getFullYear() && h.getMonth() == o.getMonth() && h.getDate() == o.getDate() && (n = "at", r = "HH:mm");
979
992
  }
980
- r || (r = H.defaultDateTimeFormat);
981
- let l = P(o, r);
993
+ r || (r = $.defaultDateTimeFormat);
994
+ let l = W(o, r);
982
995
  return n && (l = n + " " + l), l;
983
996
  }
984
- const Jt = {
985
- beforeMount: ue,
986
- updated: ue,
987
- unmounted: en
997
+ const en = {
998
+ beforeMount: he,
999
+ updated: he,
1000
+ unmounted: tn
988
1001
  };
989
- function ue(e, t) {
1002
+ function he(e, t) {
990
1003
  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");
991
1004
  }
992
- function en(e) {
1005
+ function tn(e) {
993
1006
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
994
1007
  }
995
- const tn = {
996
- beforeMount: he,
997
- updated: he,
998
- unmounted: Ce
999
- }, C = Symbol("HasAutoFocused"), J = [];
1000
- function nn() {
1001
- J.forEach(xe);
1008
+ const nn = {
1009
+ beforeMount: fe,
1010
+ updated: fe,
1011
+ unmounted: He
1012
+ }, H = Symbol("HasAutoFocused"), ee = [];
1013
+ function sn() {
1014
+ ee.forEach(Ie);
1002
1015
  }
1003
- setInterval(nn, 1e3);
1004
- function he(e, t) {
1016
+ setInterval(sn, 1e3);
1017
+ function fe(e, t) {
1005
1018
  var r;
1006
1019
  if (t.value == t.oldValue)
1007
1020
  return;
1008
1021
  if (!t.value)
1009
- return Ce(e);
1022
+ return He(e);
1010
1023
  const n = new Date(t.value), i = (r = e.attributes.getNamedItem("base-time")) == null ? void 0 : r.value, s = n.getTime() - (i ? new Date(i).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
1011
- e[C] || J.push(e), e[C] = {
1024
+ e[H] || ee.push(e), e[H] = {
1012
1025
  startTs: s,
1013
1026
  includeSeconds: o
1014
- }, xe(e);
1027
+ }, Ie(e);
1015
1028
  }
1016
- function xe(e) {
1017
- const t = e[C], n = Math.round((Date.now() - t.startTs) / 1e3);
1018
- e.innerText = sn(n, t.includeSeconds);
1029
+ function Ie(e) {
1030
+ const t = e[H], n = Math.round((Date.now() - t.startTs) / 1e3);
1031
+ e.innerText = on(n, t.includeSeconds);
1019
1032
  }
1020
- function Ce(e) {
1021
- e[C] && (ze(J, e), delete e[C]), e.innerText = "-";
1033
+ function He(e) {
1034
+ e[H] && (Xe(ee, e), delete e[H]), e.innerText = "-";
1022
1035
  }
1023
- function sn(e, t) {
1036
+ function on(e, t) {
1024
1037
  const n = [], i = Math.floor(e / 86400);
1025
1038
  i && n.push(i + "d"), e -= i * 86400;
1026
1039
  const s = Math.floor(e / 3600);
@@ -1028,31 +1041,31 @@ function sn(e, t) {
1028
1041
  const o = Math.floor(e / 60);
1029
1042
  return (i || s || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
1030
1043
  }
1031
- const S = Symbol("InfiniteScrollHandler"), on = {
1044
+ const k = Symbol("InfiniteScrollHandler"), ln = {
1032
1045
  mounted(e, t) {
1033
- e[S] = new L(e, t.value);
1046
+ e[k] = new L(e, t.value);
1034
1047
  },
1035
1048
  updated(e, t) {
1036
1049
  var n;
1037
- (n = e[S]) == null || n.uninstall(), e[S] = new L(e, t.value);
1050
+ (n = e[k]) == null || n.uninstall(), e[k] = new L(e, t.value);
1038
1051
  },
1039
1052
  unmounted(e) {
1040
1053
  var t;
1041
- (t = e[S]) == null || t.uninstall(), delete e[S];
1054
+ (t = e[k]) == null || t.uninstall(), delete e[k];
1042
1055
  }
1043
- }, ln = {
1044
- beforeMount: fe,
1045
- updated: fe
1056
+ }, rn = {
1057
+ beforeMount: pe,
1058
+ updated: pe
1046
1059
  };
1047
- function fe(e, t) {
1060
+ function pe(e, t) {
1048
1061
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1049
1062
  }
1050
- const rn = {
1051
- mounted: pe,
1052
- updated: pe,
1053
- unmounted: Ie
1054
- }, x = Symbol("TooltipState");
1055
- function pe(e, t) {
1063
+ const an = {
1064
+ mounted: me,
1065
+ updated: me,
1066
+ unmounted: De
1067
+ }, C = Symbol("TooltipState");
1068
+ function me(e, t) {
1056
1069
  var i;
1057
1070
  let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
1058
1071
  if (t.value || (n = null), n) {
@@ -1060,26 +1073,26 @@ function pe(e, t) {
1060
1073
  content: n,
1061
1074
  html: e.getAttribute("html") !== null
1062
1075
  };
1063
- e[x] ? e[x].configure(s) : e[x] = new an(e, s);
1076
+ e[C] ? e[C].configure(s) : e[C] = new cn(e, s);
1064
1077
  } else
1065
- Ie(e);
1078
+ De(e);
1066
1079
  }
1067
- function Ie(e) {
1080
+ function De(e) {
1068
1081
  var t;
1069
- (t = e[x]) == null || t.destroy(), delete e[x];
1082
+ (t = e[C]) == null || t.destroy(), delete e[C];
1070
1083
  }
1071
- class an {
1084
+ class cn {
1072
1085
  constructor(t, n) {
1073
- p(this, "lastMoveEvt");
1074
- p(this, "checkInterval");
1075
- p(this, "shouldShow", !1);
1076
- p(this, "tipEl");
1077
- p(this, "titleEl");
1078
- p(this, "contentEl");
1079
- p(this, "mouseMoveBound", !1);
1080
- p(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1081
- p(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1082
- p(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1086
+ m(this, "lastMoveEvt");
1087
+ m(this, "checkInterval");
1088
+ m(this, "shouldShow", !1);
1089
+ m(this, "tipEl");
1090
+ m(this, "titleEl");
1091
+ m(this, "contentEl");
1092
+ m(this, "mouseMoveBound", !1);
1093
+ m(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1094
+ m(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1095
+ m(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1083
1096
  this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
1084
1097
  }
1085
1098
  configure(t) {
@@ -1116,58 +1129,58 @@ class an {
1116
1129
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
1117
1130
  }
1118
1131
  }
1119
- function cn(e) {
1120
- e.directive("autofocus", qt), e.directive("confirm-button", zt), e.directive("date-input", Yt), e.directive("datetime", Gt), e.directive("disabled", Jt), e.directive("duration", tn), e.directive("infinite-scroll", on), e.directive("readonly", ln), e.directive("tooltip", rn);
1132
+ function dn(e) {
1133
+ e.directive("autofocus", zt), e.directive("confirm-button", Xt), e.directive("date-input", Zt), e.directive("datetime", Qt), e.directive("disabled", en), e.directive("duration", nn), e.directive("infinite-scroll", ln), e.directive("readonly", rn), e.directive("tooltip", an);
1121
1134
  }
1122
1135
  function Nn(e) {
1123
- cn(e);
1136
+ dn(e);
1124
1137
  }
1125
1138
  export {
1126
- vn as ModalContainer,
1127
- N as UserError,
1128
- mn as VfAjaxSelect,
1129
- K as VfAlertModal,
1130
- Mn as VfEzSmartSelect,
1131
- rt as VfModal,
1132
- xt as VfSmartSelect,
1139
+ gn as ModalContainer,
1140
+ K as UserError,
1141
+ vn as VfAjaxSelect,
1142
+ R as VfAlertModal,
1143
+ Cn as VfEzSmartSelect,
1144
+ dt as VfModal,
1145
+ Ht as VfSmartSelect,
1133
1146
  An as cloneProp,
1134
- On as configureVf,
1135
- Ln as createFilters,
1136
- be as createModalInjection,
1137
- mt as desnakeCase,
1147
+ bn as configureVf,
1148
+ In as createFilters,
1149
+ we as createModalInjection,
1150
+ yt as desnakeCase,
1138
1151
  Un as escapeHtml,
1139
- nt as formatError,
1140
- Ut as formatNumber,
1141
- vt as formatPhone,
1142
- gt as formatUSCurrency,
1143
- wn as handleError,
1144
- bn as handleErrorAndAlert,
1152
+ it as formatError,
1153
+ jt as formatNumber,
1154
+ Et as formatPhone,
1155
+ Tt as formatUSCurrency,
1156
+ Sn as handleError,
1157
+ wn as handleErrorAndAlert,
1145
1158
  Bn as installApiClientInterceptors,
1146
1159
  Nn as installVf,
1147
- jt as isApiError,
1148
- Hn as maskComponent,
1149
- Kt as maskEl,
1150
- $n as maskForm,
1151
- Sn as nl2br,
1160
+ Pt as isApiError,
1161
+ kn as maskComponent,
1162
+ st as maskEl,
1163
+ ot as maskForm,
1164
+ xn as nl2br,
1152
1165
  Vn as nullifyEmptyInputs,
1153
- Z as presentModal,
1154
- we as removeModalInjection,
1155
- gn as removeModalInjectionByInstance,
1156
- Se as removeModalInjectionByInternalInstance,
1157
- tt as removeModalInjectionByVnode,
1158
- xn as replaceElement,
1159
- ie as showAlert,
1160
- yn as showConfirm,
1161
- En as showConfirmDestroy,
1162
- Cn as showContextMenu,
1163
- Tn as showWait,
1164
- Nt as sleep,
1165
- In as sleepSecs,
1166
- G as toError,
1167
- Dn as unmaskComponent,
1168
- ke as unmaskEl,
1169
- Rt as unmaskForm,
1166
+ G as presentModal,
1167
+ Se as removeModalInjection,
1168
+ yn as removeModalInjectionByInstance,
1169
+ ke as removeModalInjectionByInternalInstance,
1170
+ nt as removeModalInjectionByVnode,
1171
+ Hn as replaceElement,
1172
+ se as showAlert,
1173
+ En as showConfirm,
1174
+ Tn as showConfirmDestroy,
1175
+ Dn as showContextMenu,
1176
+ On as showWait,
1177
+ Ut as sleep,
1178
+ $n as sleepSecs,
1179
+ Q as toError,
1180
+ Mn as unmaskComponent,
1181
+ Me as unmaskEl,
1182
+ xe as unmaskForm,
1170
1183
  Fn as useInfiniteScroll,
1171
1184
  _n as useResizeWatcher,
1172
- kn as uuid
1185
+ Ln as uuid
1173
1186
  };