@signal24/vue-foundation 4.19.1 → 4.19.2

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,19 +1,19 @@
1
- var kt = Object.defineProperty;
2
- var bt = (e, t, n) => t in e ? kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var A = (e, t, n) => bt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as N, ref as T, computed as x, watch as F, onMounted as V, openBlock as w, createElementBlock as k, createElementVNode as D, toDisplayString as U, withDirectives as Q, createCommentVNode as O, Fragment as J, renderList as me, vModelSelect as Tt, getCurrentInstance as he, withModifiers as pe, normalizeStyle as St, normalizeClass as B, renderSlot as G, reactive as Ct, h as ee, Teleport as Lt, markRaw as Mt, onBeforeUnmount as ye, resolveDirective as xt, createBlock as Pe, createSlots as It, withCtx as ue, createTextVNode as De, vModelText as Ht, onActivated as qe, onDeactivated as ze } from "vue";
5
- import { compact as Ye, debounce as At, isEqual as Ke, startCase as Ft, upperFirst as Dt, cloneDeep as Ot, remove as $t, last as Bt } from "lodash";
6
- import { escapeHtml as Vt } from "@vue/shared";
7
- import { escapeHtml as Ro } from "@vue/shared";
8
- import { configureOpenApiClient as _t, OpenApiError as Nt } from "@signal24/openapi-client-codegen/browser";
9
- import { format as fe } from "date-fns";
10
- const Rt = {
1
+ var Tt = Object.defineProperty;
2
+ var St = (e, t, n) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var O = (e, t, n) => St(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as N, ref as T, computed as M, watch as A, onMounted as V, openBlock as E, createElementBlock as k, createElementVNode as F, toDisplayString as U, withDirectives as Q, createCommentVNode as D, Fragment as J, renderList as he, vModelSelect as Ct, getCurrentInstance as pe, withModifiers as ye, normalizeStyle as xt, normalizeClass as $, renderSlot as G, reactive as Lt, h as ee, Teleport as Mt, markRaw as It, onBeforeUnmount as ge, resolveDirective as Ht, createBlock as qe, createSlots as Ot, withCtx as ue, createTextVNode as ce, vModelText as At, onActivated as ze, onDeactivated as Ye } from "vue";
5
+ import { compact as Ke, debounce as Ft, isEqual as Xe, startCase as Dt, upperFirst as Bt, cloneDeep as $t, remove as Vt, last as _t } from "lodash";
6
+ import { escapeHtml as Nt } from "@vue/shared";
7
+ import { escapeHtml as Uo } from "@vue/shared";
8
+ import { configureOpenApiClient as Rt, OpenApiError as Wt } from "@signal24/openapi-client-codegen/browser";
9
+ import { format as ve } from "date-fns";
10
+ const Ut = {
11
11
  key: 0,
12
12
  disabled: ""
13
- }, Wt = {
13
+ }, jt = {
14
14
  key: 0,
15
15
  value: null
16
- }, Ut = ["value"], fo = /* @__PURE__ */ N({
16
+ }, Pt = ["value"], mo = /* @__PURE__ */ N({
17
17
  __name: "vf-ajax-select",
18
18
  props: {
19
19
  modelValue: {},
@@ -25,104 +25,104 @@ const Rt = {
25
25
  },
26
26
  emits: ["update:modelValue"],
27
27
  setup(e, { emit: t }) {
28
- const n = e, o = t, i = T(null), l = x(() => i.value ? i.value.map((y) => {
29
- const b = y;
28
+ const n = e, o = t, i = T(null), l = M(() => i.value ? i.value.map((g) => {
29
+ const b = g;
30
30
  return n.preprocesor ? n.preprocesor(b) : n.displayKey ? b[n.displayKey] : "";
31
31
  }) : null), u = T(n.modelValue ?? null);
32
- F(() => n.loadFn, r), F(
32
+ A(() => n.loadFn, r), A(
33
33
  () => n.modelValue,
34
34
  () => u.value = n.modelValue
35
- ), F(u, () => o("update:modelValue", u.value));
35
+ ), A(u, () => o("update:modelValue", u.value));
36
36
  async function r() {
37
37
  i.value = await n.loadFn();
38
38
  }
39
- return V(r), (d, y) => l.value ? Q((w(), k("select", {
39
+ return V(r), (d, g) => l.value ? Q((E(), k("select", {
40
40
  key: 1,
41
- "onUpdate:modelValue": y[0] || (y[0] = (b) => u.value = b)
41
+ "onUpdate:modelValue": g[0] || (g[0] = (b) => u.value = b)
42
42
  }, [
43
- n.nullText ? (w(), k("option", Wt, U(n.nullText), 1)) : O("", !0),
44
- (w(!0), k(J, null, me(l.value, (b, f) => {
45
- var g;
46
- return w(), k("option", {
43
+ n.nullText ? (E(), k("option", jt, U(n.nullText), 1)) : D("", !0),
44
+ (E(!0), k(J, null, he(l.value, (b, f) => {
45
+ var w;
46
+ return E(), k("option", {
47
47
  key: f,
48
- value: (g = i.value) == null ? void 0 : g[f]
49
- }, U(b), 9, Ut);
48
+ value: (w = i.value) == null ? void 0 : w[f]
49
+ }, U(b), 9, Pt);
50
50
  }), 128))
51
51
  ], 512)), [
52
- [Tt, u.value]
53
- ]) : (w(), k("select", Rt, [
54
- D("option", null, U(n.loadingText || "Loading..."), 1)
52
+ [Ct, u.value]
53
+ ]) : (E(), k("select", Ut, [
54
+ F("option", null, U(n.loadingText || "Loading..."), 1)
55
55
  ]));
56
56
  }
57
- }), jt = /* @__PURE__ */ N({
57
+ }), qt = /* @__PURE__ */ N({
58
58
  __name: "overlay-anchor",
59
59
  props: {
60
60
  overlayId: {},
61
61
  anchor: {}
62
62
  },
63
63
  setup(e) {
64
- const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = T({ visibility: "hidden", top: "0", left: "0" }), i = T([]), l = he();
64
+ const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = T({ visibility: "hidden", top: "0", left: "0" }), i = T([]), l = pe();
65
65
  V(u);
66
66
  function u() {
67
67
  if (!l) return;
68
- const y = l.vnode.el, { styles: b, classes: f } = r(y, n);
68
+ const g = l.vnode.el, { styles: b, classes: f } = r(g, n);
69
69
  o.value = b, i.value = f;
70
70
  }
71
- function r(y, b) {
72
- const f = t.anchor instanceof HTMLElement ? {} : t.anchor, g = b.getBoundingClientRect(), v = y.getBoundingClientRect();
73
- f.matchWidth && (v.width = g.width), f.matchHeight && (v.height = g.height);
71
+ function r(g, b) {
72
+ const f = t.anchor instanceof HTMLElement ? {} : t.anchor, w = b.getBoundingClientRect(), m = g.getBoundingClientRect();
73
+ f.matchWidth && (m.width = w.width), f.matchHeight && (m.height = w.height);
74
74
  const a = f.class ? Array.isArray(f.class) ? f.class : [f.class] : [];
75
75
  let c, S;
76
76
  if (f.y === "center")
77
- c = g.top + g.height / 2 - v.height / 2, a.push("anchored-center-y");
77
+ c = w.top + w.height / 2 - m.height / 2, a.push("anchored-center-y");
78
78
  else {
79
- const L = (g.bottom + v.height < window.innerHeight || f.y === "below") && f.y !== "above";
80
- c = L ? g.bottom : g.top - v.height, a.push(L ? "anchored-top" : "anchored-bottom");
79
+ const x = (w.bottom + m.height < window.innerHeight || f.y === "below") && f.y !== "above";
80
+ c = x ? w.bottom : w.top - m.height, a.push(x ? "anchored-top" : "anchored-bottom");
81
81
  }
82
82
  if (f.x === "center")
83
- S = g.left + g.width / 2 - v.width / 2, a.push("anchored-center-x");
83
+ S = w.left + w.width / 2 - m.width / 2, a.push("anchored-center-x");
84
84
  else {
85
- const L = (g.left + v.width < window.innerWidth || f.x === "left") && f.x !== "right";
86
- S = L ? g.left : g.right - v.width, a.push(L ? "anchored-left" : "anchored-right");
85
+ const x = (w.left + m.width < window.innerWidth || f.x === "left") && f.x !== "right";
86
+ S = x ? w.left : w.right - m.width, a.push(x ? "anchored-left" : "anchored-right");
87
87
  }
88
88
  return {
89
89
  styles: {
90
90
  top: `${c}px`,
91
91
  left: `${S}px`,
92
- ...f.matchWidth ? { width: `${v.width}px` } : {},
93
- ...f.matchHeight ? { height: `${v.height}px` } : {}
92
+ ...f.matchWidth ? { width: `${m.width}px` } : {},
93
+ ...f.matchHeight ? { height: `${m.height}px` } : {}
94
94
  },
95
95
  classes: a
96
96
  };
97
97
  }
98
98
  function d() {
99
- window.removeEventListener("click", d), zt(t.overlayId);
99
+ window.removeEventListener("click", d), Kt(t.overlayId);
100
100
  }
101
101
  return V(() => {
102
102
  setTimeout(() => {
103
103
  window.addEventListener("click", d);
104
104
  }, 10);
105
- }), (y, b) => (w(), k("div", {
106
- class: B(["vf-overlay-anchor", i.value]),
107
- style: St(o.value),
108
- onClick: pe(d, ["stop"])
105
+ }), (g, b) => (E(), k("div", {
106
+ class: $(["vf-overlay-anchor", i.value]),
107
+ style: xt(o.value),
108
+ onClick: ye(d, ["stop"])
109
109
  }, [
110
- G(y.$slots, "default")
110
+ G(g.$slots, "default")
111
111
  ], 6));
112
112
  }
113
113
  });
114
- let Pt = 0;
115
- const _ = Ct([]), vo = N({
114
+ let zt = 0;
115
+ const _ = Lt([]), ho = N({
116
116
  setup() {
117
117
  return () => ee("div", [
118
- me(_, (e) => ee(Lt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
118
+ he(_, (e) => ee(Mt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
119
119
  ]);
120
120
  }
121
121
  });
122
- function ge(e, t, n) {
122
+ function we(e, t, n) {
123
123
  const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
124
124
  o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
125
- const i = String(++Pt), l = Mt(e), u = ee(l, t), r = n != null && n.anchor ? ee(jt, { overlayId: i, anchor: n.anchor }, () => [u]) : void 0, d = {
125
+ const i = String(++zt), l = It(e), u = ee(l, t), r = n != null && n.anchor ? ee(qt, { overlayId: i, anchor: n.anchor }, () => [u]) : void 0, d = {
126
126
  id: i,
127
127
  component: l,
128
128
  props: t,
@@ -132,19 +132,19 @@ function ge(e, t, n) {
132
132
  };
133
133
  return _.push(d), d;
134
134
  }
135
- function mo(e) {
136
- e.$ && Xe(e.$);
135
+ function po(e) {
136
+ e.$ && Ze(e.$);
137
137
  }
138
- function Xe(e) {
138
+ function Ze(e) {
139
139
  let t = e;
140
- for (; t && !qt(t.vnode); )
140
+ for (; t && !Yt(t.vnode); )
141
141
  t = t.parent;
142
142
  }
143
- function qt(e) {
143
+ function Yt(e) {
144
144
  const t = _.findIndex((n) => n.vnode.component === e.component);
145
145
  return t >= 0 ? (_[t].props.callback(), !0) : !1;
146
146
  }
147
- function zt(e) {
147
+ function Kt(e) {
148
148
  const t = _.findIndex((n) => n.id === e);
149
149
  return t >= 0 ? (_[t].props.callback(), !0) : !1;
150
150
  }
@@ -163,7 +163,7 @@ async function Ee(e, t, n) {
163
163
  }
164
164
  te(i), o(r);
165
165
  } };
166
- i = ge(e, u, n);
166
+ i = we(e, u, n);
167
167
  });
168
168
  }
169
169
  function ne(e, t) {
@@ -172,17 +172,17 @@ function ne(e, t) {
172
172
  classes: e.classes ?? []
173
173
  } : { title: t ? e : void 0, message: t ?? e, classes: [] };
174
174
  }
175
- async function Yt(e, t) {
175
+ async function Xt(e, t) {
176
176
  await Ee(le, ne(e, t));
177
177
  }
178
- async function ho(e, t) {
178
+ async function yo(e, t) {
179
179
  const n = ne(e, t);
180
180
  return await Ee(le, {
181
181
  ...n,
182
182
  shouldConfirm: !0
183
183
  }) === !0;
184
184
  }
185
- async function po(e, t) {
185
+ async function go(e, t) {
186
186
  const n = ne(e, t);
187
187
  return await Ee(le, {
188
188
  ...n,
@@ -190,8 +190,8 @@ async function po(e, t) {
190
190
  classes: ["destructive", ...n.classes]
191
191
  }) === !0;
192
192
  }
193
- function yo(e, t) {
194
- const n = ne(e, t), o = ge(le, {
193
+ function wo(e, t) {
194
+ const n = ne(e, t), o = we(le, {
195
195
  ...n,
196
196
  isBare: !0,
197
197
  classes: ["wait", ...n.classes],
@@ -200,66 +200,66 @@ function yo(e, t) {
200
200
  });
201
201
  return () => te(o);
202
202
  }
203
- const $ = {
203
+ const B = {
204
204
  unhandledErrorSupportText: "please contact support",
205
205
  errorHandler: (e) => console.error("Unhandled error:", e),
206
206
  defaultDateFormat: "M/d/yy",
207
207
  defaultTimeFormat: "H:mm"
208
208
  };
209
- function go(e) {
210
- Object.assign($, e);
209
+ function Eo(e) {
210
+ Object.assign(B, e);
211
211
  }
212
212
  class oe extends Error {
213
213
  constructor(t) {
214
214
  super(t), this.name = "UserError";
215
215
  }
216
216
  }
217
- function Kt(e) {
217
+ function Zt(e) {
218
218
  return e instanceof oe ? e.message : `An application error has occurred:
219
219
 
220
- ${we(e).message}
220
+ ${ke(e).message}
221
221
 
222
- Please refresh the page and try again. If this error persists, ${$.unhandledErrorSupportText}.`;
222
+ Please refresh the page and try again. If this error persists, ${B.unhandledErrorSupportText}.`;
223
223
  }
224
- function we(e) {
224
+ function ke(e) {
225
225
  return e instanceof Error ? e : new Error(String(e));
226
226
  }
227
- async function Eo(e, t) {
228
- const n = we(e);
229
- return n instanceof oe || $.errorHandler(n), Yt({
227
+ async function ko(e, t) {
228
+ const n = ke(e);
229
+ return n instanceof oe || B.errorHandler(n), Xt({
230
230
  title: t == null ? void 0 : t.title,
231
231
  message: n,
232
232
  classes: t == null ? void 0 : t.classes
233
233
  });
234
234
  }
235
- async function wo(e) {
236
- const t = we(e);
237
- t instanceof oe || $.errorHandler(t);
235
+ async function bo(e) {
236
+ const t = ke(e);
237
+ t instanceof oe || B.errorHandler(t);
238
238
  }
239
239
  const z = Symbol("MaskState");
240
- function ko(e, t) {
240
+ function To(e, t) {
241
241
  var i;
242
242
  const n = (i = e.$) == null ? void 0 : i.vnode.el, o = n.closest(".vf-modal");
243
- return Xt(o ?? n, t);
243
+ return Gt(o ?? n, t);
244
244
  }
245
- function bo(e) {
245
+ function So(e) {
246
246
  var o;
247
247
  const t = (o = e.$) == null ? void 0 : o.vnode.el, n = t.closest(".vf-modal");
248
- return Ze(n ?? t);
248
+ return Ge(n ?? t);
249
249
  }
250
- function Xt(e, t) {
250
+ function Gt(e, t) {
251
251
  if (!e[z]) {
252
252
  const n = document.createElement("div");
253
253
  n.classList.add("vf-mask"), e.appendChild(n), e[z] = { maskEl: n };
254
254
  }
255
- return e[z].maskEl.innerText = t ?? "", () => Ze(e);
255
+ return e[z].maskEl.innerText = t ?? "", () => Ge(e);
256
256
  }
257
- function Ze(e) {
257
+ function Ge(e) {
258
258
  e[z] && e.removeChild(e[z].maskEl);
259
259
  }
260
- const ve = Symbol("FormMaskState");
261
- function Zt(e, t, n) {
262
- const o = e instanceof Element ? e : Qe(e);
260
+ const me = Symbol("FormMaskState");
261
+ function Qt(e, t, n) {
262
+ const o = e instanceof Element ? e : Je(e);
263
263
  if (!o) return () => {
264
264
  };
265
265
  o.classList.add("vf-masked");
@@ -267,30 +267,30 @@ function Zt(e, t, n) {
267
267
  let l;
268
268
  i && (l = i.tagName === "INPUT" ? i.value : i.innerHTML, i.setAttribute("disabled", "disabled"), i.innerText = n ?? "Please wait...");
269
269
  const r = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
270
- return r.forEach((d) => d.setAttribute("disabled", "disabled")), o[ve] = {
270
+ return r.forEach((d) => d.setAttribute("disabled", "disabled")), o[me] = {
271
271
  disabledElements: r,
272
272
  waitButton: i,
273
273
  buttonHtml: l
274
- }, () => Ge(o);
274
+ }, () => Qe(o);
275
275
  }
276
- function Ge(e) {
277
- const t = e instanceof Element ? e : Qe(e);
276
+ function Qe(e) {
277
+ const t = e instanceof Element ? e : Je(e);
278
278
  if (!t) return;
279
- const n = t[ve];
280
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ve]);
279
+ const n = t[me];
280
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[me]);
281
281
  }
282
- function Qe(e) {
282
+ function Je(e) {
283
283
  var n;
284
284
  const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
285
285
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
286
286
  }
287
- const Gt = ["id"], Qt = {
287
+ const Jt = ["id"], en = {
288
288
  key: 0,
289
289
  class: "vf-modal-header"
290
- }, Jt = { class: "vf-modal-content" }, en = {
290
+ }, tn = { class: "vf-modal-content" }, nn = {
291
291
  key: 1,
292
292
  class: "vf-modal-footer"
293
- }, tn = /* @__PURE__ */ N({
293
+ }, on = /* @__PURE__ */ N({
294
294
  __name: "vf-modal",
295
295
  props: {
296
296
  id: {},
@@ -301,70 +301,70 @@ const Gt = ["id"], Qt = {
301
301
  },
302
302
  emits: ["formSubmit"],
303
303
  setup(e, { expose: t }) {
304
- const n = he(), o = e;
305
- t({ mask: f, unmask: g, hide: v, unhide: a });
306
- const i = T(), l = T(), u = T(!1), r = x(() => Ye([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
304
+ const n = pe(), o = e;
305
+ t({ mask: f, unmask: w, hide: m, unhide: a });
306
+ const i = T(), l = T(), u = T(!1), r = M(() => Ke([...Array.isArray(o.class) ? o.class : [o.class], u.value && "hidden"]));
307
307
  V(() => {
308
308
  var c;
309
- document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", y), (c = i.value) == null || c.addEventListener("click", d));
310
- }), ye(() => {
311
- window.removeEventListener("keydown", y), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
309
+ document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", g), (c = i.value) == null || c.addEventListener("click", d));
310
+ }), ge(() => {
311
+ window.removeEventListener("keydown", g), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
312
312
  });
313
313
  function d(c) {
314
314
  c.target == i.value && b();
315
315
  }
316
- function y(c) {
316
+ function g(c) {
317
317
  if (c.key === "Esc" || c.key === "Escape") {
318
318
  const S = document.querySelectorAll(".vf-modal-wrap");
319
319
  S[S.length - 1] === i.value && b();
320
320
  }
321
321
  }
322
322
  function b() {
323
- Xe(n);
323
+ Ze(n);
324
324
  }
325
325
  function f() {
326
- return Zt(l.value), () => g();
326
+ return Qt(l.value), () => w();
327
327
  }
328
- function g() {
329
- Ge(l.value);
328
+ function w() {
329
+ Qe(l.value);
330
330
  }
331
- function v() {
331
+ function m() {
332
332
  return u.value = !0, () => a();
333
333
  }
334
334
  function a() {
335
335
  u.value = !1;
336
336
  }
337
- return (c, S) => (w(), k("div", {
337
+ return (c, S) => (E(), k("div", {
338
338
  id: c.id,
339
339
  ref_key: "overlay",
340
340
  ref: i,
341
- class: B(["vf-overlay vf-modal-wrap", r.value])
341
+ class: $(["vf-overlay vf-modal-wrap", r.value])
342
342
  }, [
343
- D("form", {
343
+ F("form", {
344
344
  ref_key: "form",
345
345
  ref: l,
346
346
  action: ".",
347
- class: B(["vf-modal", { scrolls: c.scrolls }]),
348
- onSubmit: S[0] || (S[0] = pe((I) => c.$emit("formSubmit"), ["prevent"]))
347
+ class: $(["vf-modal", { scrolls: c.scrolls }]),
348
+ onSubmit: S[0] || (S[0] = ye((I) => c.$emit("formSubmit"), ["prevent"]))
349
349
  }, [
350
- c.$slots.header ? (w(), k("div", Qt, [
350
+ c.$slots.header ? (E(), k("div", en, [
351
351
  G(c.$slots, "header"),
352
- o.closeX ? (w(), k("i", {
352
+ o.closeX ? (E(), k("i", {
353
353
  key: 0,
354
354
  class: "close",
355
355
  onClick: b
356
- })) : O("", !0)
357
- ])) : O("", !0),
358
- D("div", Jt, [
356
+ })) : D("", !0)
357
+ ])) : D("", !0),
358
+ F("div", tn, [
359
359
  G(c.$slots, "default")
360
360
  ]),
361
- c.$slots.footer ? (w(), k("div", en, [
361
+ c.$slots.footer ? (E(), k("div", nn, [
362
362
  G(c.$slots, "footer")
363
- ])) : O("", !0)
363
+ ])) : D("", !0)
364
364
  ], 34)
365
- ], 10, Gt));
365
+ ], 10, Jt));
366
366
  }
367
- }), nn = ["innerHtml"], on = ["innerText"], le = /* @__PURE__ */ N({
367
+ }), ln = ["innerHtml"], sn = ["innerText"], le = /* @__PURE__ */ N({
368
368
  __name: "vf-alert-modal",
369
369
  props: {
370
370
  isBare: { type: Boolean },
@@ -376,53 +376,53 @@ const Gt = ["id"], Qt = {
376
376
  callback: { type: Function }
377
377
  },
378
378
  setup(e) {
379
- const t = e, n = x(() => t.message instanceof Error ? Kt(t.message) : t.message);
379
+ const t = e, n = M(() => t.message instanceof Error ? Zt(t.message) : t.message);
380
380
  return (o, i) => {
381
- const l = xt("autofocus");
382
- return w(), Pe(tn, {
383
- class: B(["vf-alert", ...o.classes ?? []])
384
- }, It({
381
+ const l = Ht("autofocus");
382
+ return E(), qe(on, {
383
+ class: $(["vf-alert", ...o.classes ?? []])
384
+ }, Ot({
385
385
  default: ue(() => [
386
- o.isHtml ? (w(), k("div", {
386
+ o.isHtml ? (E(), k("div", {
387
387
  key: 0,
388
388
  innerHtml: o.message,
389
389
  class: "user-message"
390
- }, null, 8, nn)) : (w(), k("div", {
390
+ }, null, 8, ln)) : (E(), k("div", {
391
391
  key: 1,
392
392
  innerText: n.value
393
- }, null, 8, on))
393
+ }, null, 8, sn))
394
394
  ]),
395
395
  _: 2
396
396
  }, [
397
397
  o.title ? {
398
398
  name: "header",
399
399
  fn: ue(() => [
400
- D("h1", null, U(o.title), 1)
400
+ ce(U(o.title), 1)
401
401
  ]),
402
402
  key: "0"
403
403
  } : void 0,
404
404
  o.isBare ? void 0 : {
405
405
  name: "footer",
406
406
  fn: ue(() => [
407
- o.shouldConfirm ? (w(), k(J, { key: 0 }, [
408
- Q((w(), k("button", {
407
+ o.shouldConfirm ? (E(), k(J, { key: 0 }, [
408
+ Q((E(), k("button", {
409
409
  class: "primary",
410
410
  onClick: i[0] || (i[0] = () => o.callback(!0))
411
411
  }, i[3] || (i[3] = [
412
- De("Confirm")
412
+ ce("Confirm")
413
413
  ]))), [
414
414
  [l]
415
415
  ]),
416
- D("button", {
416
+ F("button", {
417
417
  class: "default",
418
418
  onClick: i[1] || (i[1] = () => o.callback(!1))
419
419
  }, "Cancel")
420
- ], 64)) : Q((w(), k("button", {
420
+ ], 64)) : Q((E(), k("button", {
421
421
  key: 1,
422
422
  class: "default",
423
423
  onClick: i[2] || (i[2] = () => o.callback(!0))
424
424
  }, i[4] || (i[4] = [
425
- De("OK")
425
+ ce("OK")
426
426
  ]))), [
427
427
  [l]
428
428
  ])
@@ -432,53 +432,53 @@ const Gt = ["id"], Qt = {
432
432
  ]), 1032, ["class"]);
433
433
  };
434
434
  }
435
- }), M = [];
435
+ }), L = [];
436
436
  for (let e = 0; e < 256; ++e)
437
- M.push((e + 256).toString(16).slice(1));
438
- function ln(e, t = 0) {
439
- 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();
440
- }
441
- let ce;
442
- const sn = new Uint8Array(16);
443
- function rn() {
444
- if (!ce) {
437
+ L.push((e + 256).toString(16).slice(1));
438
+ function rn(e, t = 0) {
439
+ return (L[e[t + 0]] + L[e[t + 1]] + L[e[t + 2]] + L[e[t + 3]] + "-" + L[e[t + 4]] + L[e[t + 5]] + "-" + L[e[t + 6]] + L[e[t + 7]] + "-" + L[e[t + 8]] + L[e[t + 9]] + "-" + L[e[t + 10]] + L[e[t + 11]] + L[e[t + 12]] + L[e[t + 13]] + L[e[t + 14]] + L[e[t + 15]]).toLowerCase();
440
+ }
441
+ let de;
442
+ const an = new Uint8Array(16);
443
+ function un() {
444
+ if (!de) {
445
445
  if (typeof crypto > "u" || !crypto.getRandomValues)
446
446
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
447
- ce = crypto.getRandomValues.bind(crypto);
447
+ de = crypto.getRandomValues.bind(crypto);
448
448
  }
449
- return ce(sn);
449
+ return de(an);
450
450
  }
451
- const an = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Oe = { randomUUID: an };
452
- function un(e, t, n) {
453
- if (Oe.randomUUID && !t && !e)
454
- return Oe.randomUUID();
451
+ const cn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Be = { randomUUID: cn };
452
+ function dn(e, t, n) {
453
+ if (Be.randomUUID && !t && !e)
454
+ return Be.randomUUID();
455
455
  e = e || {};
456
- const o = e.random || (e.rng || rn)();
457
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, ln(o);
456
+ const o = e.random || (e.rng || un)();
457
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, rn(o);
458
458
  }
459
- function To(e) {
459
+ function Co(e) {
460
460
  return e.replace(/\n/g, "<br>");
461
461
  }
462
- function cn(e) {
462
+ function fn(e) {
463
463
  return e.replace(/_/g, " ");
464
464
  }
465
- function dn(e) {
465
+ function vn(e) {
466
466
  const t = e.replace(/\D/g, "").replace(/^1/, "");
467
467
  return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
468
468
  }
469
- function fn(e, t = 1) {
469
+ function mn(e, t = 1) {
470
470
  return "$" + (Number(e) / t).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
471
471
  }
472
- function So() {
473
- return un();
472
+ function xo() {
473
+ return dn();
474
474
  }
475
- const vn = ["disabled", "placeholder", "required"], mn = {
475
+ const hn = ["disabled", "placeholder", "required"], pn = {
476
476
  key: 0,
477
477
  class: "no-results"
478
- }, hn = ["onMousemove", "onMousedown"], pn = ["innerHTML"], yn = ["innerHTML"], gn = {
478
+ }, yn = ["onMousemove", "onMousedown"], gn = ["innerHTML"], wn = ["innerHTML"], En = {
479
479
  key: 0,
480
480
  class: "no-results"
481
- }, En = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", wn = /* @__PURE__ */ N({
481
+ }, kn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", bn = /* @__PURE__ */ N({
482
482
  __name: "vf-smart-select",
483
483
  props: {
484
484
  modelValue: {},
@@ -503,43 +503,44 @@ const vn = ["disabled", "placeholder", "required"], mn = {
503
503
  disabled: { type: Boolean },
504
504
  optionsListId: {},
505
505
  debug: { type: Boolean },
506
- required: { type: Boolean }
506
+ required: { type: Boolean },
507
+ showCreateTextOnNewItem: { type: Boolean }
507
508
  },
508
509
  emits: ["optionsLoaded", "update:modelValue"],
509
510
  setup(e, { expose: t, emit: n }) {
510
511
  const o = Symbol("null"), i = Symbol("create"), l = e, u = n;
511
512
  t({
512
- addRemoteOption: wt
513
+ addRemoteOption: bt
513
514
  });
514
- const r = T(), d = T(), y = T(), b = T(!1), f = T(!1), g = T([]), v = T(!1), a = T(""), c = T(null), S = T(null), I = T(!1), L = T(null), Te = T(!1), it = x(() => l.prependOptions ?? []), rt = x(() => l.appendOptions ?? []), Se = x(() => !!l.disabled), at = x(() => !f.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), ut = x(() => l.noResultsText || "No options match your search."), W = x(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = x(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : W.value ? (s) => String(W.value(s)) : null), se = x(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), Ce = x(() => [...it.value, ...g.value, ...rt.value]), ie = x(() => Ce.value.map((s, m) => {
515
- var He, Ae;
516
- const h = se.value(s), p = (He = l.subtitleFormatter) == null ? void 0 : He.call(l, s), E = h ? h.trim().toLowerCase() : "", C = p ? p.trim().toLowerCase() : "", Z = [];
517
- return l.searchFields ? l.searchFields.forEach((Fe) => {
518
- s[Fe] && Z.push(String(s[Fe]).toLowerCase());
519
- }) : (Z.push(E), C && Z.push(C)), {
520
- key: ((Ae = j.value) == null ? void 0 : Ae.call(j, s)) ?? String(m),
515
+ const r = T(), d = T(), g = T(), b = T(!1), f = T(!1), w = T([]), m = T(!1), a = T(""), c = T(null), S = T(null), I = T(!1), x = T(null), Se = T(!1), rt = M(() => l.showCreateTextOnNewItem ?? !0), at = M(() => l.prependOptions ?? []), ut = M(() => l.appendOptions ?? []), Ce = M(() => !!l.disabled), ct = M(() => !f.value && l.preload ? "Loading..." : l.nullTitle ? l.nullTitle : l.placeholder || ""), dt = M(() => l.noResultsText || "No options match your search."), W = M(() => l.valueExtractor ? l.valueExtractor : l.valueField ? (s) => s[l.valueField] : null), j = M(() => l.keyExtractor ? l.keyExtractor : l.keyField ? (s) => String(s[l.keyField]) : W.value ? (s) => String(W.value(s)) : null), se = M(() => l.formatter ? l.formatter : l.labelField ? (s) => String(s[l.labelField]) : (s) => String(s)), xe = M(() => [...at.value, ...w.value, ...ut.value]), ie = M(() => xe.value.map((s, v) => {
516
+ var Ae, Fe;
517
+ const h = se.value(s), p = (Ae = l.subtitleFormatter) == null ? void 0 : Ae.call(l, s), y = h ? h.trim().toLowerCase() : "", C = p ? p.trim().toLowerCase() : "", Z = [];
518
+ return l.searchFields ? l.searchFields.forEach((De) => {
519
+ s[De] && Z.push(String(s[De]).toLowerCase());
520
+ }) : (Z.push(y), C && Z.push(C)), {
521
+ key: ((Fe = j.value) == null ? void 0 : Fe.call(j, s)) ?? String(v),
521
522
  title: h,
522
523
  subtitle: p,
523
524
  searchContent: Z.join(""),
524
525
  ref: s
525
526
  };
526
- })), H = x(() => {
527
+ })), H = M(() => {
527
528
  let s = [...ie.value];
528
- if (v.value) {
529
- const m = a.value.trim().toLowerCase();
530
- if (m.length) {
531
- s = s.filter((E) => E.searchContent.includes(m));
532
- const h = Vt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${h})`, "ig");
533
- s = s.map((E) => {
529
+ if (m.value) {
530
+ const v = a.value.trim().toLowerCase();
531
+ if (v.length) {
532
+ s = s.filter((y) => y.searchContent.includes(v));
533
+ const h = Nt(a.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`(${h})`, "ig");
534
+ s = s.map((y) => {
534
535
  var C;
535
536
  return {
536
- ...E,
537
- title: E.title.replace(p, "<mark>$1</mark>"),
538
- subtitle: (C = E.subtitle) == null ? void 0 : C.replace(p, "<mark>$1</mark>")
537
+ ...y,
538
+ title: y.title.replace(p, "<mark>$1</mark>"),
539
+ subtitle: (C = y.subtitle) == null ? void 0 : C.replace(p, "<mark>$1</mark>")
539
540
  };
540
- }), Te.value && (s.find((C) => C.searchContent === m) !== void 0 || s.push({
541
+ }), Se.value && (s.find((C) => C.searchContent === v) !== void 0 || s.push({
541
542
  key: i,
542
- title: "Create <strong>" + a.value.trim() + "</strong>..."
543
+ title: rt.value ? "Create <strong>" + a.value.trim() + "</strong>..." : a.value.trim()
543
544
  }));
544
545
  }
545
546
  } else l.nullTitle && s.unshift({
@@ -548,47 +549,47 @@ const vn = ["disabled", "placeholder", "required"], mn = {
548
549
  });
549
550
  return s;
550
551
  });
551
- F(() => l.modelValue, ae), F(
552
+ A(() => l.modelValue, ae), A(
552
553
  () => l.options,
553
554
  () => {
554
- g.value = l.options ?? [], f.value = !0;
555
+ w.value = l.options ?? [], f.value = !0;
555
556
  }
556
- ), F(ie, () => {
557
- I.value && setTimeout(xe, 0);
558
- }), F(a, () => {
559
- v.value && !l.remoteSearch && !a.value.trim().length && (v.value = !1);
560
- }), F(I, () => {
561
- I.value ? setTimeout(yt, 0) : (v.value = !1, a.value = S.value || "", y.value && (y.value.style.visibility = "hidden"));
562
- }), F(H, () => {
557
+ ), A(ie, () => {
558
+ I.value && setTimeout(Ie, 0);
559
+ }), A(a, () => {
560
+ m.value && !l.remoteSearch && !a.value.trim().length && (m.value = !1);
561
+ }), A(I, () => {
562
+ I.value ? setTimeout(wt, 0) : (m.value = !1, a.value = S.value || "", g.value && (g.value.style.visibility = "hidden"));
563
+ }), A(H, () => {
563
564
  var s;
564
- l.modelValue && !c.value && ae(), (L.value || v.value) && !H.value.find((m) => m.key == L.value) && (L.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
565
+ l.modelValue && !c.value && ae(), (x.value || m.value) && !H.value.find((v) => v.key == x.value) && (x.value = ((s = H.value[0]) == null ? void 0 : s.key) ?? o);
565
566
  }), V(async () => {
566
- Te.value = l.onCreateItem !== void 0, l.options ? (g.value = [...l.options], f.value = !0) : l.preload && await Le(), ae(), F(c, () => {
567
+ Se.value = l.onCreateItem !== void 0, l.options ? (w.value = [...l.options], f.value = !0) : l.preload && await Le(), ae(), A(c, () => {
567
568
  c.value !== l.modelValue && u(
568
569
  "update:modelValue",
569
570
  c.value && W.value ? W.value(c.value) : c.value
570
571
  );
571
- }), l.remoteSearch && F(a, At(ct, 250));
572
+ }), l.remoteSearch && A(a, Ft(ft, 250));
572
573
  });
573
574
  async function Le() {
574
- await Me(), g.value && u("optionsLoaded", g.value);
575
+ await Me(), w.value && u("optionsLoaded", w.value);
575
576
  }
576
577
  async function Me() {
577
- var m;
578
- const s = l.remoteSearch && v.value && a.value ? a.value : null;
579
- b.value = !0, g.value = await ((m = l.loadOptions) == null ? void 0 : m.call(l, s)) ?? [], b.value = !1, f.value = !0;
578
+ var v;
579
+ const s = l.remoteSearch && m.value && a.value ? a.value : null;
580
+ b.value = !0, w.value = await ((v = l.loadOptions) == null ? void 0 : v.call(l, s)) ?? [], b.value = !1, f.value = !0;
580
581
  }
581
- function ct() {
582
- v.value && (Me(), v.value = a.value.trim().length > 0);
582
+ function ft() {
583
+ m.value && (Me(), m.value = a.value.trim().length > 0);
583
584
  }
584
- function dt(s) {
585
+ function vt(s) {
585
586
  if (s.key == "Escape") {
586
- s.stopPropagation(), s.target.blur();
587
+ s.stopPropagation(), s.target.blur(), Oe();
587
588
  return;
588
589
  }
589
590
  if (!(s.key == "ArrowLeft" || s.key == "ArrowRight") && s.key != "Tab") {
590
591
  if (!f.value) {
591
- v.value || s.preventDefault();
592
+ m.value || s.preventDefault();
592
593
  return;
593
594
  }
594
595
  if (s.key == "ArrowUp" || s.key == "ArrowDown")
@@ -599,140 +600,151 @@ const vn = ["disabled", "placeholder", "required"], mn = {
599
600
  return s.preventDefault(), re(s.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
600
601
  if (s.key == "Enter") {
601
602
  s.preventDefault();
602
- const m = H.value.find((h) => h.key == L.value);
603
- if (m) return Ie(m);
603
+ const v = H.value.find((h) => h.key == x.value);
604
+ if (v) return He(v);
604
605
  }
605
606
  if (s.key === "Delete" || s.key === "Backspace") {
606
- a.value.length > 1 && (v.value = !0);
607
+ a.value.length > 1 && (m.value = !0);
607
608
  return;
608
609
  }
609
- !s.metaKey && En.includes(s.key) && (v.value = !0);
610
+ !s.metaKey && kn.includes(s.key) && (m.value = !0);
610
611
  }
611
612
  }
612
- function ft() {
613
- vt(), I.value = !0, setTimeout(() => {
613
+ function mt() {
614
+ ht(), I.value = !0, setTimeout(() => {
614
615
  var s;
615
616
  return (s = d.value) == null ? void 0 : s.select();
616
617
  }, 0);
617
618
  }
618
- function vt(s) {
619
- c.value ? L.value = mt(c.value) : l.nullTitle && (L.value = o);
619
+ function ht(s) {
620
+ c.value ? x.value = pt(c.value) : l.nullTitle && (x.value = o);
620
621
  }
621
- function mt(s) {
622
- var m;
623
- return j.value ? j.value(c.value) : ((m = ht(s)) == null ? void 0 : m.key) ?? "";
622
+ function pt(s) {
623
+ var v;
624
+ return j.value ? j.value(c.value) : ((v = yt(s)) == null ? void 0 : v.key) ?? "";
624
625
  }
625
- function ht(s) {
626
- const m = H.value.find((E) => E.ref === s);
627
- if (m)
628
- return m;
629
- const h = l.keyExtractor ? (E, C) => l.keyExtractor(E) === l.keyExtractor(C) : Ke, p = H.value.find((E) => h(E.ref, s));
626
+ function yt(s) {
627
+ const v = H.value.find((y) => y.ref === s);
628
+ if (v)
629
+ return v;
630
+ const h = l.keyExtractor ? (y, C) => l.keyExtractor(y) === l.keyExtractor(C) : Xe, p = H.value.find((y) => h(y.ref, s));
630
631
  return p || null;
631
632
  }
632
- function pt() {
633
+ function gt() {
633
634
  l.debug || (!a.value.length && l.nullTitle && (c.value = null, S.value = null), I.value = !1);
634
635
  }
635
- function yt() {
636
+ function wt() {
636
637
  var s;
637
- f.value || Le(), l.optionsListId && ((s = y.value) == null || s.setAttribute("id", l.optionsListId)), gt();
638
+ f.value || Le(), l.optionsListId && ((s = g.value) == null || s.setAttribute("id", l.optionsListId)), Et();
638
639
  }
639
- function gt() {
640
- const s = r.value.getBoundingClientRect(), m = s.y + s.height + 2, h = s.x, p = y.value, E = window.getComputedStyle(r.value);
641
- for (let C in E)
642
- /^(font|text)/.test(C) && (p.style[C] = E[C]);
643
- if (p.style.top = m + "px", p.style.left = h + "px", p.style.minWidth = s.width + "px", !E.maxHeight || E.maxHeight == "none") {
644
- const C = window.innerHeight - m - 12;
640
+ function Et() {
641
+ const s = r.value.getBoundingClientRect(), v = s.y + s.height + 2, h = s.x, p = g.value, y = window.getComputedStyle(r.value);
642
+ for (let C in y)
643
+ /^(font|text)/.test(C) && (p.style[C] = y[C]);
644
+ if (p.style.top = v + "px", p.style.left = h + "px", p.style.minWidth = s.width + "px", !y.maxHeight || y.maxHeight == "none") {
645
+ const C = window.innerHeight - v - 12;
645
646
  p.style.maxHeight = C + "px";
646
647
  }
647
- p.style.visibility = "visible", document.body.appendChild(p), setTimeout(xe, 0);
648
+ p.style.visibility = "visible", document.body.appendChild(p), setTimeout(Ie, 0);
648
649
  }
649
- function xe() {
650
- if (!f.value || !L.value) return;
651
- const s = H.value.findIndex((p) => p.key == L.value), m = y.value, h = m == null ? void 0 : m.querySelectorAll(".option")[s];
652
- h && (m.scrollTop = h.offsetTop);
650
+ function Ie() {
651
+ if (!f.value || !x.value) return;
652
+ const s = H.value.findIndex((p) => p.key == x.value), v = g.value, h = v == null ? void 0 : v.querySelectorAll(".option")[s];
653
+ h && (v.scrollTop = h.offsetTop);
653
654
  }
654
- function Et(s) {
655
- L.value = s ? s.key : null;
655
+ function kt(s) {
656
+ x.value = s ? s.key : null;
656
657
  }
657
658
  function re(s) {
658
- const m = H.value.findIndex((C) => C.key == L.value);
659
- let h = m + s;
660
- if (h < 0 ? h = 0 : h >= H.value.length && (h = H.value.length - 1), m == h) return;
661
- L.value = H.value[h].key;
662
- const p = y.value, E = p == null ? void 0 : p.querySelectorAll(".option")[h];
663
- E && (E.offsetTop < p.scrollTop ? p.scrollTop = E.offsetTop : E.offsetTop + E.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = E.offsetTop + E.offsetHeight - p.clientHeight));
659
+ const v = H.value.findIndex((C) => C.key == x.value);
660
+ let h = v + s;
661
+ if (h < 0 ? h = 0 : h >= H.value.length && (h = H.value.length - 1), v == h) return;
662
+ x.value = H.value[h].key;
663
+ const p = g.value, y = p == null ? void 0 : p.querySelectorAll(".option")[h];
664
+ y && (y.offsetTop < p.scrollTop ? p.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > p.scrollTop + p.clientHeight && (p.scrollTop = y.offsetTop + y.offsetHeight - p.clientHeight));
664
665
  }
665
- function Ie(s) {
666
- var m, h;
667
- if (v.value = !1, s.key == o)
666
+ function He(s) {
667
+ var v, h;
668
+ if (m.value = !1, s.key == o)
668
669
  a.value = "", c.value = null, S.value = null;
669
670
  else if (s.key === i) {
670
671
  const p = a.value.trim();
671
- a.value = "", c.value = null, S.value = null, (m = l.onCreateItem) == null || m.call(l, p);
672
+ a.value = "", c.value = null, S.value = null, (v = l.onCreateItem) == null || v.call(l, p);
672
673
  } else {
673
- const E = ie.value.find((C) => C.key == s.key).ref;
674
- c.value = E, S.value = se.value(E), a.value = S.value || "";
674
+ const y = ie.value.find((C) => C.key == s.key).ref;
675
+ c.value = y, S.value = se.value(y), a.value = S.value || "";
675
676
  }
676
- (h = d.value) == null || h.blur();
677
+ (h = d.value) == null || h.blur(), Oe();
677
678
  }
678
679
  function ae() {
679
- l.modelValue ? (c.value = W.value ? Ce.value.find((s) => l.modelValue === W.value(s)) : l.modelValue, S.value = c.value ? se.value(c.value) : null, a.value = S.value || "") : (c.value = null, S.value = null, a.value = "");
680
+ l.modelValue ? (c.value = W.value ? xe.value.find((s) => l.modelValue === W.value(s)) : l.modelValue, S.value = c.value ? se.value(c.value) : null, a.value = S.value || "") : (c.value = null, S.value = null, a.value = "");
680
681
  }
681
- function wt(s) {
682
- g.value.unshift(s);
682
+ function bt(s) {
683
+ w.value.unshift(s);
683
684
  }
684
- return (s, m) => (w(), k("div", {
685
+ function Oe() {
686
+ var y;
687
+ let s = (y = r.value) == null ? void 0 : y.parentElement;
688
+ for (; s && s.tagName !== "FORM" && s.tagName !== "BODY"; )
689
+ s = s.parentElement;
690
+ if (!s) return;
691
+ const v = s.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
692
+ if (!v) return;
693
+ const h = Array.from(v).findIndex((C) => C === d.value), p = v[h + 1];
694
+ p && setTimeout(() => p.focus(), 0);
695
+ }
696
+ return (s, v) => (E(), k("div", {
685
697
  ref_key: "el",
686
698
  ref: r,
687
- class: B(["vf-smart-select", { disabled: Se.value, open: I.value }])
699
+ class: $(["vf-smart-select", { disabled: Ce.value, open: I.value }])
688
700
  }, [
689
- Q(D("input", {
701
+ Q(F("input", {
690
702
  ref_key: "searchField",
691
703
  ref: d,
692
- "onUpdate:modelValue": m[0] || (m[0] = (h) => a.value = h),
704
+ "onUpdate:modelValue": v[0] || (v[0] = (h) => a.value = h),
693
705
  type: "text",
694
- disabled: Se.value,
695
- class: B({ nullable: !!s.nullTitle }),
696
- placeholder: at.value,
706
+ disabled: Ce.value,
707
+ class: $({ nullable: !!s.nullTitle }),
708
+ placeholder: ct.value,
697
709
  required: s.required,
698
710
  "data-1p-ignore": "",
699
- onKeydown: dt,
700
- onFocus: ft,
701
- onBlur: pt
702
- }, null, 42, vn), [
703
- [Ht, a.value]
711
+ onKeydown: vt,
712
+ onFocus: mt,
713
+ onBlur: gt
714
+ }, null, 42, hn), [
715
+ [At, a.value]
704
716
  ]),
705
- I.value ? (w(), k("div", {
717
+ I.value ? (E(), k("div", {
706
718
  key: 0,
707
719
  ref_key: "optionsContainer",
708
- ref: y,
720
+ ref: g,
709
721
  class: "vf-smart-select-options"
710
722
  }, [
711
- f.value ? (w(), k(J, { key: 1 }, [
712
- (w(!0), k(J, null, me(H.value, (h) => (w(), k("div", {
723
+ f.value ? (E(), k(J, { key: 1 }, [
724
+ (E(!0), k(J, null, he(H.value, (h) => (E(), k("div", {
713
725
  key: String(h.key),
714
- class: B(["option", {
715
- highlighted: L.value === h.key
726
+ class: $(["option", {
727
+ highlighted: x.value === h.key
716
728
  }]),
717
- onMousemove: (p) => Et(h),
718
- onMousedown: (p) => Ie(h)
729
+ onMousemove: (p) => kt(h),
730
+ onMousedown: (p) => He(h)
719
731
  }, [
720
- D("div", {
732
+ F("div", {
721
733
  class: "title",
722
734
  innerHTML: h.title
723
- }, null, 8, pn),
724
- h.subtitle ? (w(), k("div", {
735
+ }, null, 8, gn),
736
+ h.subtitle ? (E(), k("div", {
725
737
  key: 0,
726
738
  class: "subtitle",
727
739
  innerHTML: h.subtitle
728
- }, null, 8, yn)) : O("", !0)
729
- ], 42, hn))), 128)),
730
- !H.value.length && a.value ? (w(), k("div", gn, U(ut.value), 1)) : O("", !0)
731
- ], 64)) : (w(), k("div", mn, "Loading..."))
732
- ], 512)) : O("", !0)
740
+ }, null, 8, wn)) : D("", !0)
741
+ ], 42, yn))), 128)),
742
+ !H.value.length && a.value ? (E(), k("div", En, U(dt.value), 1)) : D("", !0)
743
+ ], 64)) : (E(), k("div", pn, "Loading..."))
744
+ ], 512)) : D("", !0)
733
745
  ], 2));
734
746
  }
735
- }), Co = /* @__PURE__ */ N({
747
+ }), Lo = /* @__PURE__ */ N({
736
748
  __name: "vf-ez-smart-select",
737
749
  props: {
738
750
  modelValue: {},
@@ -743,38 +755,38 @@ const vn = ["disabled", "placeholder", "required"], mn = {
743
755
  },
744
756
  emits: ["update:modelValue"],
745
757
  setup(e, { emit: t }) {
746
- const n = e, o = x(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, d]) => ({
758
+ const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: r })) : Object.entries(n.options).map(([r, d]) => ({
747
759
  value: r,
748
760
  label: d
749
- }))), i = x(() => n.formatter ? (r) => n.formatter(r) : (r) => r.label), l = t, u = T(o.value.find((r) => r.value === n.modelValue) ?? null);
750
- return F(
761
+ }))), i = M(() => n.formatter ? (r) => n.formatter(r) : (r) => r.label), l = t, u = T(o.value.find((r) => r.value === n.modelValue) ?? null);
762
+ return A(
751
763
  () => n.modelValue,
752
764
  (r) => {
753
765
  u.value = o.value.find((d) => d.value === r) ?? null;
754
766
  }
755
- ), F(u, (r) => {
756
- var y;
757
- const d = r ? (y = o.value.find((b) => Ke(b, r))) == null ? void 0 : y.value : null;
767
+ ), A(u, (r) => {
768
+ var g;
769
+ const d = r ? (g = o.value.find((b) => Xe(b, r))) == null ? void 0 : g.value : null;
758
770
  l("update:modelValue", d ?? null);
759
- }), (r, d) => (w(), Pe(wn, {
771
+ }), (r, d) => (E(), qe(bn, {
760
772
  modelValue: u.value,
761
- "onUpdate:modelValue": d[0] || (d[0] = (y) => u.value = y),
773
+ "onUpdate:modelValue": d[0] || (d[0] = (g) => u.value = g),
762
774
  options: o.value,
763
775
  formatter: i.value,
764
776
  "null-title": r.nullTitle
765
777
  }, null, 8, ["modelValue", "options", "formatter", "null-title"]));
766
778
  }
767
779
  });
768
- function Lo() {
780
+ function Mo() {
769
781
  return T();
770
782
  }
771
- const kn = { class: "content" }, bn = { class: "message" }, Tn = {
783
+ const Tn = { class: "content" }, Sn = { class: "message" }, Cn = {
772
784
  key: 0,
773
785
  class: "close"
774
- }, Sn = {
786
+ }, xn = {
775
787
  key: 0,
776
788
  class: "progress-bar"
777
- }, Cn = /* @__PURE__ */ N({
789
+ }, Ln = /* @__PURE__ */ N({
778
790
  __name: "vf-toast",
779
791
  props: {
780
792
  message: {},
@@ -797,104 +809,104 @@ const kn = { class: "content" }, bn = { class: "message" }, Tn = {
797
809
  duration: i * 1e3,
798
810
  easing: "linear"
799
811
  }), setTimeout(() => t.callback(), i * 1e3);
800
- }), (i, l) => (w(), k("div", {
801
- class: B(["vf-toast", i.className]),
802
- onClick: pe(n, ["stop"])
812
+ }), (i, l) => (E(), k("div", {
813
+ class: $(["vf-toast", i.className]),
814
+ onClick: ye(n, ["stop"])
803
815
  }, [
804
- D("div", kn, [
805
- D("div", bn, U(i.message), 1),
806
- i.disableClose ? O("", !0) : (w(), k("div", Tn, "x"))
816
+ F("div", Tn, [
817
+ F("div", Sn, U(i.message), 1),
818
+ i.disableClose ? D("", !0) : (E(), k("div", Cn, "x"))
807
819
  ]),
808
- i.durationSecs !== null ? (w(), k("div", Sn, [
809
- D("div", {
820
+ i.durationSecs !== null ? (E(), k("div", xn, [
821
+ F("div", {
810
822
  ref_key: "progressInnerEl",
811
823
  ref: o,
812
824
  class: "inner"
813
825
  }, null, 512)
814
- ])) : O("", !0)
826
+ ])) : D("", !0)
815
827
  ], 2));
816
828
  }
817
829
  });
818
- function Mo(e) {
819
- const t = ge(Cn, {
830
+ function Io(e) {
831
+ const t = we(Ln, {
820
832
  ...e,
821
833
  callback: () => te(t)
822
834
  });
823
835
  return () => te(t);
824
836
  }
825
- function Ln(e) {
837
+ function Mn(e) {
826
838
  const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), i = ["B", "KB", "MB", "GB", "TB"][t];
827
839
  return `${o} ${i}`;
828
840
  }
829
- function Mn(e) {
841
+ function In(e) {
830
842
  return e != null && String(e).length ? e : "-";
831
843
  }
832
- function xn(e) {
844
+ function Hn(e) {
833
845
  return e || "-";
834
846
  }
835
- function In(e) {
836
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Vn(Number(e));
837
- }
838
- function Hn(e) {
839
- return e && dn(e);
847
+ function On(e) {
848
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Nn(Number(e));
840
849
  }
841
850
  function An(e) {
842
- return e ? Dt(e) : null;
851
+ return e && vn(e);
843
852
  }
844
853
  function Fn(e) {
845
- return e ? Ft(e) : null;
854
+ return e ? Bt(e) : null;
846
855
  }
847
856
  function Dn(e) {
857
+ return e ? Dt(e) : null;
858
+ }
859
+ function Bn(e) {
848
860
  return e ? e.toUpperCase() : null;
849
861
  }
850
- function On(e) {
851
- return e ? cn(e) : null;
862
+ function $n(e) {
863
+ return e ? fn(e) : null;
852
864
  }
853
- function $n(e, t = 1) {
854
- return fn(e, t);
865
+ function Vn(e, t = 1) {
866
+ return mn(e, t);
855
867
  }
856
868
  const $e = {
857
- bytes: Ln,
858
- dash: Mn,
859
- dashZeros: xn,
860
- number: In,
861
- phone: Hn,
862
- upperFirst: An,
863
- startCase: Fn,
864
- upperCase: Dn,
865
- desnake: On,
866
- usCurrency: $n
867
- }, xo = (e) => ({
869
+ bytes: Mn,
870
+ dash: In,
871
+ dashZeros: Hn,
872
+ number: On,
873
+ phone: An,
874
+ upperFirst: Fn,
875
+ startCase: Dn,
876
+ upperCase: Bn,
877
+ desnake: $n,
878
+ usCurrency: Vn
879
+ }, Ho = (e) => ({
868
880
  ...$e,
869
881
  ...e($e)
870
882
  });
871
- function Io(e, t, n) {
883
+ function Oo(e, t, n) {
872
884
  const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
873
885
  return o === -1 ? !1 : (e.splice(o, 1, n), !0);
874
886
  }
875
- function Ho(e, t) {
887
+ function Ao(e, t) {
876
888
  const n = document.createElement("div");
877
889
  n.classList.add("vf-overlay"), n.addEventListener("click", f), document.body.appendChild(n);
878
890
  const o = document.createElement("div");
879
891
  o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
880
892
  const i = e.currentTarget;
881
- i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((v) => {
882
- if (v == "-") {
893
+ i.style.userSelect = "none", i.classList.add("context-menu-active"), t.targetClass && i.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((m) => {
894
+ if (m == "-") {
883
895
  const c = document.createElement("div");
884
896
  c.classList.add("separator"), o.appendChild(c);
885
897
  return;
886
898
  }
887
899
  const a = document.createElement("div");
888
- a.classList.add("item"), a.style.userSelect = "none", a.innerText = v.title, o.appendChild(a), v.class && a.classList.add(v.class), v.shouldConfirm ? a.addEventListener("click", (c) => g(c, a, v.handler)) : a.addEventListener("click", () => v.handler());
900
+ a.classList.add("item"), a.style.userSelect = "none", a.innerText = m.title, o.appendChild(a), m.class && a.classList.add(m.class), m.shouldConfirm ? a.addEventListener("click", (c) => w(c, a, m.handler)) : a.addEventListener("click", () => m.handler());
889
901
  });
890
- const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth, y = l < d ? e.clientX - d - 1 : e.clientX + 1, b = u < r ? e.clientY - r - 1 : e.clientY + 1;
891
- o.style.left = y + "px", o.style.top = b + "px", setTimeout(() => {
902
+ const l = window.innerWidth - e.clientX, u = window.innerHeight - e.clientY, r = o.offsetHeight, d = o.offsetWidth, g = l < d ? e.clientX - d - 1 : e.clientX + 1, b = u < r ? e.clientY - r - 1 : e.clientY + 1;
903
+ o.style.left = g + "px", o.style.top = b + "px", setTimeout(() => {
892
904
  o.style.width = o.offsetWidth + "px";
893
905
  }, 50);
894
906
  function f() {
895
907
  t.targetClass && i.classList.remove(t.targetClass), i.classList.remove("context-menu-active"), i.style.userSelect = "", n.remove();
896
908
  }
897
- function g(v, a, c) {
909
+ function w(m, a, c) {
898
910
  if (a.classList.contains("pending-confirm"))
899
911
  return c();
900
912
  const S = a.innerHTML;
@@ -902,67 +914,67 @@ function Ho(e, t) {
902
914
  const I = () => {
903
915
  a.classList.remove("pending-confirm"), a.innerHTML = S, a.removeEventListener("mouseleave", I);
904
916
  };
905
- a.addEventListener("mouseleave", I), v.stopPropagation();
917
+ a.addEventListener("mouseleave", I), m.stopPropagation();
906
918
  }
907
919
  }
908
- const Bn = (e) => new Promise((t) => setTimeout(t, e)), Ao = (e) => Bn(e * 1e3);
909
- function Vn(e) {
920
+ const _n = (e) => new Promise((t) => setTimeout(t, e)), Fo = (e) => _n(e * 1e3);
921
+ function Nn(e) {
910
922
  return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
911
923
  }
912
- function Fo(e, t) {
913
- return e != null ? Ot(e) : t;
914
- }
915
924
  function Do(e, t) {
925
+ return e != null ? $t(e) : t;
926
+ }
927
+ function Bo(e, t) {
916
928
  const n = { ...e };
917
929
  for (const o of t)
918
930
  n[o] === "" && (n[o] = null);
919
931
  return n;
920
932
  }
921
- function Oo(e, t) {
922
- _t(e, {
933
+ function $o(e, t) {
934
+ Rt(e, {
923
935
  ...t,
924
936
  onError(n, o) {
925
937
  var l;
926
- n instanceof Nt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new oe(n.body.error));
938
+ n instanceof Wt && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new oe(n.body.error));
927
939
  const i = (l = t.onError) == null ? void 0 : l.call(t, n, o);
928
940
  return i !== void 0 ? i : n;
929
941
  }
930
942
  });
931
943
  }
932
- const ke = Symbol("HookState");
933
- function $o(e, t) {
934
- const n = t ?? he();
935
- V(() => _n(n, e), n), qe(() => Nn(n), n), ze(() => Be(n), n), ye(() => Be(n), n);
944
+ const be = Symbol("HookState");
945
+ function Vo(e, t) {
946
+ const n = t ?? pe();
947
+ V(() => Rn(n, e), n), ze(() => Wn(n), n), Ye(() => Ve(n), n), ge(() => Ve(n), n);
936
948
  }
937
- function _n(e, t) {
949
+ function Rn(e, t) {
938
950
  const n = {};
939
951
  if (t.elScrolledToBottom && (n.el = new Y(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
940
- const o = Je(e.vnode.el);
952
+ const o = et(e.vnode.el);
941
953
  o ? n.ancestor = new Y(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
942
954
  }
943
- t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[ke] = n;
955
+ t.windowScrolledToBottom && (n.window = new Y(window, t.windowScrolledToBottom)), e[be] = n;
944
956
  }
945
- function Nn(e) {
957
+ function Wn(e) {
946
958
  var n, o, i;
947
- const t = e[ke];
959
+ const t = e[be];
948
960
  (n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (i = t == null ? void 0 : t.window) == null || i.install();
949
961
  }
950
- function Be(e) {
962
+ function Ve(e) {
951
963
  var n, o, i;
952
- const t = e[ke];
964
+ const t = e[be];
953
965
  (n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (i = t == null ? void 0 : t.window) == null || i.uninstall();
954
966
  }
955
- const de = ["auto", "scroll"];
956
- function Je(e) {
967
+ const fe = ["auto", "scroll"];
968
+ function et(e) {
957
969
  const t = e.parentElement;
958
970
  if (!t) return null;
959
971
  const n = window.getComputedStyle(t);
960
- return de.includes(n.overflow) || de.includes(n.overflowX) || de.includes(n.overflowY) ? t : Je(t);
972
+ return fe.includes(n.overflow) || fe.includes(n.overflowX) || fe.includes(n.overflowY) ? t : et(t);
961
973
  }
962
974
  class Y {
963
975
  constructor(t, n) {
964
- A(this, "isTripped", !1);
965
- A(this, "onScrollWithContext", this.onScroll.bind(this));
976
+ O(this, "isTripped", !1);
977
+ O(this, "onScrollWithContext", this.onScroll.bind(this));
966
978
  this.el = t, this.handler = n, this.install();
967
979
  }
968
980
  install() {
@@ -975,23 +987,23 @@ class Y {
975
987
  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);
976
988
  }
977
989
  }
978
- function Bo(e) {
979
- V(() => window.addEventListener("resize", e)), qe(() => window.addEventListener("resize", e)), ze(() => window.removeEventListener("resize", e)), ye(() => window.removeEventListener("resize", e));
990
+ function _o(e) {
991
+ V(() => window.addEventListener("resize", e)), ze(() => window.addEventListener("resize", e)), Ye(() => window.removeEventListener("resize", e)), ge(() => window.removeEventListener("resize", e));
980
992
  }
981
- const Rn = {
982
- mounted: _e,
983
- updated: _e
984
- }, Ve = Symbol("HasAutoFocused");
985
- function _e(e, t) {
986
- if (t.value === void 0 && e[Ve] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
987
- e[Ve] = !0;
993
+ const Un = {
994
+ mounted: Ne,
995
+ updated: Ne
996
+ }, _e = Symbol("HasAutoFocused");
997
+ function Ne(e, t) {
998
+ if (t.value === void 0 && e[_e] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
999
+ e[_e] = !0;
988
1000
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
989
1001
  setTimeout(() => n.focus(), 10);
990
1002
  }
991
- const Wn = {
992
- mounted: Un
1003
+ const jn = {
1004
+ mounted: Pn
993
1005
  }, P = Symbol("ConfirmState");
994
- function Un(e, t) {
1006
+ function Pn(e, t) {
995
1007
  e.addEventListener("click", (n) => {
996
1008
  var u, r;
997
1009
  const o = Date.now(), i = ((u = t.value) == null ? void 0 : u.text) !== void 0 ? t.value.text : "Confirm";
@@ -1013,28 +1025,28 @@ function Un(e, t) {
1013
1025
  e[P] = l, i && (e.innerHTML = i), (r = t.value) != null && r.class && e.classList.add(t.value.class), e.addEventListener("mouseout", l.resetHandler);
1014
1026
  });
1015
1027
  }
1016
- const jn = {
1017
- beforeMount: Pn
1028
+ const qn = {
1029
+ beforeMount: zn
1018
1030
  };
1019
- function Pn(e) {
1031
+ function zn(e) {
1020
1032
  e.addEventListener("blur", () => {
1021
1033
  let t = e.value;
1022
- /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + fe(/* @__PURE__ */ new Date(), "yy"));
1034
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + ve(/* @__PURE__ */ new Date(), "yy"));
1023
1035
  const n = Date.parse(t);
1024
- isNaN(n) ? e.value = "" : e.value = fe(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1036
+ isNaN(n) ? e.value = "" : e.value = ve(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1025
1037
  });
1026
1038
  }
1027
- const qn = {
1028
- beforeMount: Ne,
1029
- updated: Ne
1039
+ const Yn = {
1040
+ beforeMount: Re,
1041
+ updated: Re
1030
1042
  };
1031
- function Ne(e, t) {
1032
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = zn(e, t));
1043
+ function Re(e, t) {
1044
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = Kn(e, t));
1033
1045
  }
1034
- function zn(e, t) {
1035
- var y, b;
1046
+ function Kn(e, t) {
1047
+ var g, b;
1036
1048
  if (!t.value)
1037
- return ((y = e.attributes.getNamedItem("placeholder")) == null ? void 0 : y.value) ?? "";
1049
+ return ((g = e.attributes.getNamedItem("placeholder")) == null ? void 0 : g.value) ?? "";
1038
1050
  let n = "";
1039
1051
  const o = t.value.replace(/ /g, "T").replace(/\.\d+Z$/, "Z"), i = e.attributes.getNamedItem("local") !== null ? o.replace(/Z$/, "") : o.replace(/(Z|\+00:00)?$/, "Z"), l = new Date(i);
1040
1052
  e.attributes.getNamedItem("display-utc") !== null && l.setMinutes(l.getMinutes() - l.getTimezoneOffset());
@@ -1046,53 +1058,53 @@ function zn(e, t) {
1046
1058
  }
1047
1059
  if (!u && e.attributes.getNamedItem("simplified-date") !== null) {
1048
1060
  let f = null;
1049
- const g = /* @__PURE__ */ new Date();
1050
- g.getFullYear() === l.getFullYear() ? (g.getMonth() !== l.getMonth() || g.getDate() !== l.getDate()) && (f = "M/d") : f = "M/d/YY";
1051
- const v = r ? null : $.defaultTimeFormat;
1052
- u = Ye([f, v]).join(" ");
1061
+ const w = /* @__PURE__ */ new Date();
1062
+ w.getFullYear() === l.getFullYear() ? (w.getMonth() !== l.getMonth() || w.getDate() !== l.getDate()) && (f = "M/d") : f = "M/d/YY";
1063
+ const m = r ? null : B.defaultTimeFormat;
1064
+ u = Ke([f, m]).join(" ");
1053
1065
  }
1054
- u || (r ? u = $.defaultDateFormat : u = `${$.defaultDateFormat} ${$.defaultTimeFormat}`);
1055
- let d = fe(l, u);
1066
+ u || (r ? u = B.defaultDateFormat : u = `${B.defaultDateFormat} ${B.defaultTimeFormat}`);
1067
+ let d = ve(l, u);
1056
1068
  return n && (d = n + " " + d), d;
1057
1069
  }
1058
- const Yn = {
1059
- beforeMount: Re,
1060
- updated: Re,
1061
- unmounted: Kn
1070
+ const Xn = {
1071
+ beforeMount: We,
1072
+ updated: We,
1073
+ unmounted: Zn
1062
1074
  };
1063
- function Re(e, t) {
1075
+ function We(e, t) {
1064
1076
  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");
1065
1077
  }
1066
- function Kn(e) {
1078
+ function Zn(e) {
1067
1079
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1068
1080
  }
1069
- const Xn = {
1070
- beforeMount: We,
1071
- updated: We,
1072
- unmounted: tt
1073
- }, X = Symbol("HasAutoFocused"), be = [];
1074
- function Zn() {
1075
- be.forEach(et);
1081
+ const Gn = {
1082
+ beforeMount: Ue,
1083
+ updated: Ue,
1084
+ unmounted: nt
1085
+ }, X = Symbol("HasAutoFocused"), Te = [];
1086
+ function Qn() {
1087
+ Te.forEach(tt);
1076
1088
  }
1077
- setInterval(Zn, 1e3);
1078
- function We(e, t) {
1089
+ setInterval(Qn, 1e3);
1090
+ function Ue(e, t) {
1079
1091
  var u;
1080
1092
  if (t.value == t.oldValue) return;
1081
- if (!t.value) return tt(e);
1093
+ if (!t.value) return nt(e);
1082
1094
  const n = new Date(t.value), o = (u = e.attributes.getNamedItem("base-time")) == null ? void 0 : u.value, i = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), l = e.getAttribute("no-seconds") === null;
1083
- e[X] || be.push(e), e[X] = {
1095
+ e[X] || Te.push(e), e[X] = {
1084
1096
  startTs: i,
1085
1097
  includeSeconds: l
1086
- }, et(e);
1098
+ }, tt(e);
1087
1099
  }
1088
- function et(e) {
1100
+ function tt(e) {
1089
1101
  const t = e[X], n = Math.round((Date.now() - t.startTs) / 1e3);
1090
- e.innerText = Gn(n, t.includeSeconds);
1102
+ e.innerText = Jn(n, t.includeSeconds);
1091
1103
  }
1092
- function tt(e) {
1093
- e[X] && ($t(be, e), delete e[X]), e.innerText = "-";
1104
+ function nt(e) {
1105
+ e[X] && (Vt(Te, e), delete e[X]), e.innerText = "-";
1094
1106
  }
1095
- function Gn(e, t) {
1107
+ function Jn(e, t) {
1096
1108
  const n = [], o = Math.floor(e / 86400);
1097
1109
  o && n.push(o + "d"), e -= o * 86400;
1098
1110
  const i = Math.floor(e / 3600);
@@ -1100,34 +1112,34 @@ function Gn(e, t) {
1100
1112
  const l = Math.floor(e / 60);
1101
1113
  return (o || i || l) && n.push(l + "m"), t ? n.length || n.push("0m") : (e -= l * 60, n.push(e + "s")), n.join(" ");
1102
1114
  }
1103
- const Qn = {
1104
- mounted: nt,
1105
- updated: Jn,
1106
- unmounted: ot
1115
+ const eo = {
1116
+ mounted: ot,
1117
+ updated: to,
1118
+ unmounted: lt
1107
1119
  }, R = /* @__PURE__ */ new Map();
1108
- function nt(e, t) {
1109
- R.size === 0 && window.addEventListener("keydown", lt), R.set(t.value.toLowerCase(), [...R.get(t.value.toLowerCase()) ?? [], e]);
1110
- }
1111
1120
  function ot(e, t) {
1121
+ R.size === 0 && window.addEventListener("keydown", st), R.set(t.value.toLowerCase(), [...R.get(t.value.toLowerCase()) ?? [], e]);
1122
+ }
1123
+ function lt(e, t) {
1112
1124
  const n = R.get(t.value.toLowerCase());
1113
1125
  if (n) {
1114
1126
  const o = n.indexOf(e);
1115
1127
  o !== -1 && n.splice(o, 1), n.length === 0 && R.delete(t.value.toLowerCase());
1116
1128
  }
1117
- R.size === 0 && window.removeEventListener("keydown", lt);
1129
+ R.size === 0 && window.removeEventListener("keydown", st);
1118
1130
  }
1119
- function Jn(e, t) {
1120
- ot(e, t), nt(e, t);
1131
+ function to(e, t) {
1132
+ lt(e, t), ot(e, t);
1121
1133
  }
1122
- function lt(e) {
1134
+ function st(e) {
1123
1135
  if (typeof e.key != "string") return;
1124
1136
  const t = e.key.toLowerCase(), n = R.get(t);
1125
1137
  if (n) {
1126
- const o = Bt(n);
1138
+ const o = _t(n);
1127
1139
  o == null || o.click(), e.preventDefault();
1128
1140
  }
1129
1141
  }
1130
- const q = Symbol("InfiniteScrollHandler"), eo = {
1142
+ const q = Symbol("InfiniteScrollHandler"), no = {
1131
1143
  mounted(e, t) {
1132
1144
  e[q] = new Y(e, t.value);
1133
1145
  },
@@ -1139,19 +1151,19 @@ const q = Symbol("InfiniteScrollHandler"), eo = {
1139
1151
  var t;
1140
1152
  (t = e[q]) == null || t.uninstall(), delete e[q];
1141
1153
  }
1142
- }, to = {
1143
- beforeMount: Ue,
1144
- updated: Ue
1154
+ }, oo = {
1155
+ beforeMount: je,
1156
+ updated: je
1145
1157
  };
1146
- function Ue(e, t) {
1158
+ function je(e, t) {
1147
1159
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1148
1160
  }
1149
- const no = {
1150
- mounted: je,
1151
- updated: je,
1152
- unmounted: st
1161
+ const lo = {
1162
+ mounted: Pe,
1163
+ updated: Pe,
1164
+ unmounted: it
1153
1165
  }, K = Symbol("TooltipState");
1154
- function je(e, t) {
1166
+ function Pe(e, t) {
1155
1167
  var o;
1156
1168
  let n = ((o = e.attributes.getNamedItem("tip")) == null ? void 0 : o.value) ?? t.value;
1157
1169
  if (t.value || (n = null), n) {
@@ -1159,26 +1171,26 @@ function je(e, t) {
1159
1171
  content: n,
1160
1172
  html: e.getAttribute("html") !== null
1161
1173
  };
1162
- e[K] ? e[K].configure(i) : e[K] = new oo(e, i);
1174
+ e[K] ? e[K].configure(i) : e[K] = new so(e, i);
1163
1175
  } else
1164
- st(e);
1176
+ it(e);
1165
1177
  }
1166
- function st(e) {
1178
+ function it(e) {
1167
1179
  var t;
1168
1180
  (t = e[K]) == null || t.destroy(), delete e[K];
1169
1181
  }
1170
- class oo {
1182
+ class so {
1171
1183
  constructor(t, n) {
1172
- A(this, "lastMoveEvt");
1173
- A(this, "checkInterval");
1174
- A(this, "shouldShow", !1);
1175
- A(this, "tipEl");
1176
- A(this, "titleEl");
1177
- A(this, "contentEl");
1178
- A(this, "mouseMoveBound", !1);
1179
- A(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1180
- A(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1181
- A(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1184
+ O(this, "lastMoveEvt");
1185
+ O(this, "checkInterval");
1186
+ O(this, "shouldShow", !1);
1187
+ O(this, "tipEl");
1188
+ O(this, "titleEl");
1189
+ O(this, "contentEl");
1190
+ O(this, "mouseMoveBound", !1);
1191
+ O(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1192
+ O(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1193
+ O(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1182
1194
  this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), t.addEventListener("click", this.handleTargetMouseLeaveWithContext);
1183
1195
  }
1184
1196
  configure(t) {
@@ -1215,60 +1227,60 @@ class oo {
1215
1227
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
1216
1228
  }
1217
1229
  }
1218
- function lo(e) {
1219
- e.directive("autofocus", Rn), e.directive("confirm-button", Wn), e.directive("date-input", jn), e.directive("datetime", qn), e.directive("disabled", Yn), e.directive("duration", Xn), e.directive("hotkey", Qn), e.directive("infinite-scroll", eo), e.directive("readonly", to), e.directive("tooltip", no);
1230
+ function io(e) {
1231
+ e.directive("autofocus", Un), e.directive("confirm-button", jn), e.directive("date-input", qn), e.directive("datetime", Yn), e.directive("disabled", Xn), e.directive("duration", Gn), e.directive("hotkey", eo), e.directive("infinite-scroll", no), e.directive("readonly", oo), e.directive("tooltip", lo);
1220
1232
  }
1221
- function Vo(e) {
1222
- lo(e);
1233
+ function No(e) {
1234
+ io(e);
1223
1235
  }
1224
1236
  export {
1225
- vo as OverlayContainer,
1237
+ ho as OverlayContainer,
1226
1238
  oe as UserError,
1227
- fo as VfAjaxSelect,
1239
+ mo as VfAjaxSelect,
1228
1240
  le as VfAlertModal,
1229
- Co as VfEzSmartSelect,
1230
- tn as VfModal,
1231
- wn as VfSmartSelect,
1232
- Fo as cloneProp,
1233
- go as configureVf,
1234
- Oo as configureVfOpenApiClient,
1235
- xo as createFilters,
1236
- ge as createOverlayInjection,
1237
- cn as desnakeCase,
1238
- zt as dismissOverlayInjectionById,
1239
- mo as dismissOverlayInjectionByInstance,
1240
- Xe as dismissOverlayInjectionByInternalInstance,
1241
- qt as dismissOverlayInjectionByVnode,
1242
- Ro as escapeHtml,
1243
- Kt as formatError,
1244
- Vn as formatNumber,
1245
- dn as formatPhone,
1246
- fn as formatUSCurrency,
1247
- wo as handleError,
1248
- Eo as handleErrorAndAlert,
1249
- Vo as installVf,
1250
- ko as maskComponent,
1251
- Xt as maskEl,
1252
- Zt as maskForm,
1253
- To as nl2br,
1254
- Do as nullifyEmptyInputs,
1241
+ Lo as VfEzSmartSelect,
1242
+ on as VfModal,
1243
+ bn as VfSmartSelect,
1244
+ Do as cloneProp,
1245
+ Eo as configureVf,
1246
+ $o as configureVfOpenApiClient,
1247
+ Ho as createFilters,
1248
+ we as createOverlayInjection,
1249
+ fn as desnakeCase,
1250
+ Kt as dismissOverlayInjectionById,
1251
+ po as dismissOverlayInjectionByInstance,
1252
+ Ze as dismissOverlayInjectionByInternalInstance,
1253
+ Yt as dismissOverlayInjectionByVnode,
1254
+ Uo as escapeHtml,
1255
+ Zt as formatError,
1256
+ Nn as formatNumber,
1257
+ vn as formatPhone,
1258
+ mn as formatUSCurrency,
1259
+ bo as handleError,
1260
+ ko as handleErrorAndAlert,
1261
+ No as installVf,
1262
+ To as maskComponent,
1263
+ Gt as maskEl,
1264
+ Qt as maskForm,
1265
+ Co as nl2br,
1266
+ Bo as nullifyEmptyInputs,
1255
1267
  Ee as presentOverlay,
1256
1268
  te as removeOverlayInjection,
1257
- Io as replaceElement,
1258
- Yt as showAlert,
1259
- ho as showConfirm,
1260
- po as showConfirmDestroy,
1261
- Ho as showContextMenu,
1262
- Mo as showToast,
1263
- yo as showWait,
1264
- Bn as sleep,
1265
- Ao as sleepSecs,
1266
- we as toError,
1267
- bo as unmaskComponent,
1268
- Ze as unmaskEl,
1269
- Ge as unmaskForm,
1270
- $o as useInfiniteScroll,
1271
- Bo as useResizeWatcher,
1272
- So as uuid,
1273
- Lo as vfModalRef
1269
+ Oo as replaceElement,
1270
+ Xt as showAlert,
1271
+ yo as showConfirm,
1272
+ go as showConfirmDestroy,
1273
+ Ao as showContextMenu,
1274
+ Io as showToast,
1275
+ wo as showWait,
1276
+ _n as sleep,
1277
+ Fo as sleepSecs,
1278
+ ke as toError,
1279
+ So as unmaskComponent,
1280
+ Ge as unmaskEl,
1281
+ Qe as unmaskForm,
1282
+ Vo as useInfiniteScroll,
1283
+ _o as useResizeWatcher,
1284
+ xo as uuid,
1285
+ Mo as vfModalRef
1274
1286
  };