@signal24/vue-foundation 3.8.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.eslintrc.cjs +35 -0
  2. package/.prettierrc.json +4 -2
  3. package/dist/src/components/ajax-select.vue.d.ts +21 -0
  4. package/dist/src/components/alert-helpers.d.ts +8 -0
  5. package/dist/src/components/alert-modal.vue.d.ts +27 -0
  6. package/dist/src/components/ez-smart-select.vue.d.ts +27 -0
  7. package/dist/src/components/index.d.ts +8 -0
  8. package/dist/src/components/modal-container.d.ts +33 -0
  9. package/dist/src/components/modal.vue.d.ts +34 -0
  10. package/dist/src/components/smart-select.vue.d.ts +121 -0
  11. package/dist/src/config.d.ts +8 -0
  12. package/dist/src/directives/autofocus.d.ts +2 -0
  13. package/dist/src/directives/confirm-button.d.ts +2 -0
  14. package/dist/src/directives/date-input.d.ts +2 -0
  15. package/dist/src/directives/datetime.d.ts +2 -0
  16. package/dist/src/directives/disabled.d.ts +2 -0
  17. package/dist/src/directives/duration.d.ts +2 -0
  18. package/dist/src/directives/index.d.ts +24 -0
  19. package/dist/src/directives/infinite-scroll.d.ts +3 -0
  20. package/dist/src/directives/readonly.d.ts +2 -0
  21. package/dist/src/directives/tooltip.d.ts +41 -0
  22. package/dist/src/filters/index.d.ts +39 -0
  23. package/dist/src/helpers/array.d.ts +3 -0
  24. package/dist/src/helpers/context-menu.d.ts +13 -0
  25. package/dist/src/helpers/delay.d.ts +2 -0
  26. package/dist/src/helpers/error.d.ts +7 -0
  27. package/dist/src/helpers/index.d.ts +9 -0
  28. package/dist/src/helpers/mask.d.ts +15 -0
  29. package/dist/src/helpers/number.d.ts +1 -0
  30. package/dist/src/helpers/object.d.ts +2 -0
  31. package/dist/src/helpers/openapi.d.ts +34 -0
  32. package/dist/src/helpers/string.d.ts +5 -0
  33. package/dist/src/hooks/index.d.ts +2 -0
  34. package/dist/src/hooks/infinite-scroll.d.ts +30 -0
  35. package/dist/src/hooks/resize-watcher.d.ts +1 -0
  36. package/dist/src/index.d.ts +8 -0
  37. package/dist/src/types.d.ts +14 -0
  38. package/dist/src/vite-plugins/index.d.ts +1 -0
  39. package/dist/src/vite-plugins/index.js +2 -0
  40. package/dist/src/vite-plugins/vite-openapi-plugin.d.ts +4 -0
  41. package/dist/src/vite-plugins/vite-openapi-plugin.js +58 -0
  42. package/dist/vue-foundation.css +1 -1
  43. package/dist/vue-foundation.es.js +880 -1880
  44. package/package.json +44 -16
  45. package/src/components/ajax-select.vue +44 -23
  46. package/src/components/alert-helpers.ts +45 -0
  47. package/src/components/alert-modal.vue +68 -0
  48. package/src/components/ez-smart-select.vue +51 -0
  49. package/src/components/index.ts +10 -0
  50. package/src/components/modal-container.ts +131 -0
  51. package/src/components/modal.vue +44 -129
  52. package/src/components/smart-select.vue +196 -243
  53. package/src/config.ts +15 -0
  54. package/src/directives/autofocus.ts +20 -0
  55. package/src/directives/confirm-button.ts +50 -0
  56. package/src/directives/date-input.ts +19 -0
  57. package/src/directives/datetime.ts +48 -0
  58. package/src/directives/disabled.ts +30 -0
  59. package/src/directives/duration.ts +79 -0
  60. package/src/directives/index.ts +37 -0
  61. package/src/directives/infinite-scroll.ts +9 -0
  62. package/src/directives/readonly.ts +15 -0
  63. package/src/directives/tooltip.ts +190 -0
  64. package/src/filters/index.ts +79 -0
  65. package/src/helpers/array.ts +7 -0
  66. package/src/helpers/context-menu.ts +108 -0
  67. package/src/helpers/delay.ts +2 -0
  68. package/src/helpers/error.ts +41 -0
  69. package/src/helpers/index.ts +9 -0
  70. package/src/helpers/mask.ts +105 -0
  71. package/src/helpers/number.ts +3 -0
  72. package/src/helpers/object.ts +19 -0
  73. package/src/helpers/openapi.ts +82 -0
  74. package/src/helpers/string.ts +27 -0
  75. package/src/hooks/index.ts +2 -0
  76. package/src/hooks/infinite-scroll.ts +107 -0
  77. package/src/hooks/resize-watcher.ts +8 -0
  78. package/src/index.ts +14 -0
  79. package/src/types.ts +14 -0
  80. package/src/vite-plugins/index.ts +2 -0
  81. package/src/vite-plugins/vite-openapi-plugin.ts +71 -0
  82. package/tsconfig.app.json +22 -0
  83. package/tsconfig.json +14 -0
  84. package/tsconfig.node.json +9 -0
  85. package/tsconfig.vite-plugins.json +10 -0
  86. package/tsconfig.vitest.json +9 -0
  87. package/vite.config.js +37 -35
  88. package/vitest.config.js +17 -0
  89. package/.eslintrc.js +0 -16
  90. package/CHANGES.md +0 -2
  91. package/dist/vue-foundation.cjs.js +0 -5
  92. package/dist/vue-foundation.umd.js +0 -6
  93. package/postcss.config.cjs +0 -5
  94. package/src/app.js +0 -25
  95. package/src/components/alert.vue +0 -130
  96. package/src/components/index.js +0 -12
  97. package/src/config.js +0 -11
  98. package/src/directives/autofocus.js +0 -17
  99. package/src/directives/confirm-button.js +0 -40
  100. package/src/directives/date-input.js +0 -18
  101. package/src/directives/datetime.js +0 -46
  102. package/src/directives/disabled.js +0 -28
  103. package/src/directives/duration.js +0 -72
  104. package/src/directives/index.js +0 -10
  105. package/src/directives/infinite-scroll.js +0 -17
  106. package/src/directives/readonly.js +0 -17
  107. package/src/directives/tooltip.js +0 -178
  108. package/src/directives/user-text.js +0 -11
  109. package/src/filters/index.js +0 -82
  110. package/src/helpers/array.js +0 -99
  111. package/src/helpers/context-menu.js +0 -66
  112. package/src/helpers/delay.js +0 -3
  113. package/src/helpers/error.js +0 -36
  114. package/src/helpers/http.js +0 -44
  115. package/src/helpers/index.js +0 -9
  116. package/src/helpers/mask.js +0 -90
  117. package/src/helpers/number.js +0 -6
  118. package/src/helpers/string.js +0 -36
  119. package/src/helpers/vue.js +0 -5
  120. package/src/index.js +0 -33
  121. package/src/plugins/index.js +0 -10
  122. package/src/plugins/infinite-scroll/hook.js +0 -30
  123. package/src/plugins/infinite-scroll.js +0 -100
  124. package/src/plugins/resize-watcher.js +0 -28
@@ -1,47 +1,27 @@
1
- import { createApp as gr, h as yr, openBlock as O, createElementBlock as w, createElementVNode as P, toDisplayString as Y, withDirectives as X, createCommentVNode as L, Fragment as re, renderList as Lt, vModelSelect as mr, markRaw as $r, createBlock as kt, Teleport as br, normalizeClass as F, withModifiers as _r, renderSlot as ye, resolveComponent as Tr, resolveDirective as Se, createSlots as Or, withCtx as me, createTextVNode as Be, vModelText as Sr } from "vue";
2
- import u from "jquery";
3
- import k from "moment";
4
- import ne from "axios";
5
- import wr from "vue-stash-nested";
6
- let Dt;
7
- function Ar(e) {
8
- Dt = e;
9
- }
10
- const f = gr({
11
- data() {
12
- return {
13
- store: {
14
- session: null,
15
- globalError: window.gErr || null,
16
- rootInjections: []
17
- }
18
- };
19
- },
20
- render() {
21
- return yr(Dt);
22
- }
23
- }), oe = (e, t) => {
24
- const r = e.__vccOpts || e;
25
- for (const [n, i] of t)
26
- r[n] = i;
27
- return r;
28
- }, Cr = {
29
- props: ["modelValue", "url", "params", "itemsKey", "preprocessor", "textKey", "nullText", "loadingText"],
30
- data() {
31
- return {
32
- options: null,
33
- selectedItem: null
34
- };
1
+ var Le = Object.defineProperty;
2
+ var Ie = (e, t, n) => t in e ? Le(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var f = (e, t, n) => (Ie(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { defineComponent as M, defineProps as De, defineEmits as He, ref as I, computed as D, openBlock as a, createElementBlock as d, createElementVNode as v, toDisplayString as w, withDirectives as H, createCommentVNode as g, Fragment as $, renderList as W, vModelSelect as $e, reactive as Ae, h as he, markRaw as Be, onMounted as q, onBeforeUnmount as U, getCurrentInstance as fe, createBlock as z, Teleport as Ve, normalizeClass as E, withModifiers as Fe, renderSlot as F, resolveDirective as pe, createSlots as Ne, withCtx as N, unref as R, createTextVNode as J, vModelText as _e, watch as ee, onActivated as me, onDeactivated as ve } from "vue";
5
+ import { debounce as Ke, isEqual as ge, upperFirst as Re, startCase as je, cloneDeep as Pe, remove as We } from "lodash";
6
+ import { escapeHtml as qe } from "@vue/shared";
7
+ import { escapeHtml as $n } from "@vue/shared";
8
+ import { format as j } from "date-fns";
9
+ const Ue = M({
10
+ setup() {
11
+ const e = De();
12
+ He(["update:modelValue"]);
13
+ const t = I(null), n = D(() => t.value ? t.value.map((o) => e.preprocesor ? e.preprocesor(o) : o[e.displayKey ?? ""]) : null), i = I(e.modelValue ?? null);
14
+ return { props: e, options: t, renderOptions: n, selectedItem: i };
35
15
  },
36
16
  watch: {
37
- params() {
17
+ loadFn() {
38
18
  this.load();
39
19
  },
40
20
  selectedItem() {
41
21
  this.$emit("update:modelValue", this.selectedItem);
42
22
  },
43
23
  modelValue() {
44
- this.selectedItem = this.modelValue;
24
+ this.selectedItem = this.props.modelValue;
45
25
  }
46
26
  },
47
27
  mounted() {
@@ -49,1169 +29,330 @@ const f = gr({
49
29
  },
50
30
  methods: {
51
31
  async load() {
52
- this.options = null;
53
- let e = this.params ? { params: this.params } : void 0, t = await this.$http.get(this.url, e), r = this.itemsKey ? t.data[this.itemsKey] : t.data;
54
- this.preprocessor && this.preprocessor(r), this.options = r, this.selectedItem = this.modelValue;
32
+ this.options = await this.props.loadFn();
55
33
  }
56
34
  }
57
- }, xr = {
35
+ }), ye = (e, t) => {
36
+ const n = e.__vccOpts || e;
37
+ for (const [i, s] of t)
38
+ n[i] = s;
39
+ return n;
40
+ }, ze = {
58
41
  key: 0,
59
42
  disabled: ""
60
- }, Er = {
43
+ }, Xe = {
61
44
  key: 0,
62
45
  value: null
63
- }, Ir = ["value"];
64
- function jr(e, t, r, n, i, a) {
65
- return i.options ? X((O(), w("select", {
46
+ }, Ye = ["value"];
47
+ function Ze(e, t, n, i, s, o) {
48
+ return e.renderOptions ? H((a(), d("select", {
66
49
  key: 1,
67
- "onUpdate:modelValue": t[0] || (t[0] = (s) => i.selectedItem = s)
50
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => e.selectedItem = l)
68
51
  }, [
69
- r.nullText ? (O(), w("option", Er, Y(r.nullText), 1)) : L("", !0),
70
- (O(!0), w(re, null, Lt(i.options, (s) => (O(), w("option", {
71
- key: s.id,
72
- value: s
73
- }, Y(r.textKey ? s[r.textKey] : s), 9, Ir))), 128))
52
+ e.props.nullText ? (a(), d("option", Xe, w(e.props.nullText), 1)) : g("", !0),
53
+ (a(!0), d($, null, W(e.renderOptions, (l, r) => {
54
+ var c;
55
+ return a(), d("option", {
56
+ key: r,
57
+ value: (c = e.options) == null ? void 0 : c[r]
58
+ }, w(l), 9, Ye);
59
+ }), 128))
74
60
  ], 512)), [
75
- [mr, i.selectedItem]
76
- ]) : (O(), w("select", xr, [
77
- P("option", null, Y(r.loadingText || "Loading..."), 1)
61
+ [$e, e.selectedItem]
62
+ ]) : (a(), d("select", ze, [
63
+ v("option", null, w(e.props.loadingText || "Loading..."), 1)
78
64
  ]));
79
65
  }
80
- const Pr = /* @__PURE__ */ oe(Cr, [["render", jr]]);
81
- var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
82
- function Hr() {
83
- this.__data__ = [], this.size = 0;
84
- }
85
- var Mr = Hr;
86
- function Lr(e, t) {
87
- return e === t || e !== e && t !== t;
88
- }
89
- var Ie = Lr, kr = Ie;
90
- function Dr(e, t) {
91
- for (var r = e.length; r--; )
92
- if (kr(e[r][0], t))
93
- return r;
94
- return -1;
95
- }
96
- var le = Dr, Kr = le, Rr = Array.prototype, Fr = Rr.splice;
97
- function Br(e) {
98
- var t = this.__data__, r = Kr(t, e);
99
- if (r < 0)
100
- return !1;
101
- var n = t.length - 1;
102
- return r == n ? t.pop() : Fr.call(t, r, 1), --this.size, !0;
103
- }
104
- var Nr = Br, Ur = le;
105
- function Gr(e) {
106
- var t = this.__data__, r = Ur(t, e);
107
- return r < 0 ? void 0 : t[r][1];
108
- }
109
- var Vr = Gr, Wr = le;
110
- function zr(e) {
111
- return Wr(this.__data__, e) > -1;
112
- }
113
- var qr = zr, Yr = le;
114
- function Xr(e, t) {
115
- var r = this.__data__, n = Yr(r, e);
116
- return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
117
- }
118
- var Jr = Xr, Zr = Mr, Qr = Nr, en = Vr, tn = qr, rn = Jr;
119
- function U(e) {
120
- var t = -1, r = e == null ? 0 : e.length;
121
- for (this.clear(); ++t < r; ) {
122
- var n = e[t];
123
- this.set(n[0], n[1]);
66
+ const an = /* @__PURE__ */ ye(Ue, [["render", Ze]]);
67
+ let Ge = 0;
68
+ const y = Ae([]), cn = M({
69
+ setup() {
70
+ return () => he("div", { id: "modal-container" }, [
71
+ W(y, (e) => e.vnode)
72
+ ]);
124
73
  }
74
+ });
75
+ function Ee(e, t) {
76
+ const n = document.getElementById("vf-modal-target") ?? document.createElement("div");
77
+ n.id = "vf-modal-target", n.removeAttribute("inert"), document.body.appendChild(n);
78
+ const i = Be(e), s = {
79
+ id: String(++Ge),
80
+ component: i,
81
+ props: t,
82
+ vnode: he(i, t)
83
+ };
84
+ return y.push(s), s;
85
+ }
86
+ function Te(e) {
87
+ const t = y.indexOf(e);
88
+ t >= 0 && y.splice(t, 1);
89
+ }
90
+ function dn(e) {
91
+ Oe(e.$);
92
+ }
93
+ function Oe(e) {
94
+ let t = e;
95
+ for (; t && !Qe(t.vnode); )
96
+ t = t.parent;
97
+ }
98
+ function Qe(e) {
99
+ var n, i;
100
+ const t = y.findIndex((s) => s.vnode.component === e.component);
101
+ return t >= 0 ? ((i = (n = y[t].props).callback) == null || i.call(n, void 0), y.splice(t, 1), !0) : !1;
102
+ }
103
+ async function X(e, t) {
104
+ return new Promise((n) => {
105
+ let i = null;
106
+ const o = { ...t, callback: (l) => {
107
+ Te(i), n(l);
108
+ } };
109
+ i = Ee(e, o);
110
+ });
125
111
  }
126
- U.prototype.clear = Zr;
127
- U.prototype.delete = Qr;
128
- U.prototype.get = en;
129
- U.prototype.has = tn;
130
- U.prototype.set = rn;
131
- var ce = U, nn = ce;
132
- function an() {
133
- this.__data__ = new nn(), this.size = 0;
134
- }
135
- var sn = an;
136
- function on(e) {
137
- var t = this.__data__, r = t.delete(e);
138
- return this.size = t.size, r;
139
- }
140
- var ln = on;
141
- function cn(e) {
142
- return this.__data__.get(e);
143
- }
144
- var un = cn;
145
- function fn(e) {
146
- return this.__data__.has(e);
147
- }
148
- var dn = fn, hn = typeof Z == "object" && Z && Z.Object === Object && Z, Kt = hn, pn = Kt, vn = typeof self == "object" && self && self.Object === Object && self, gn = pn || vn || Function("return this")(), E = gn, yn = E, mn = yn.Symbol, ue = mn, Ne = ue, Rt = Object.prototype, $n = Rt.hasOwnProperty, bn = Rt.toString, q = Ne ? Ne.toStringTag : void 0;
149
- function _n(e) {
150
- var t = $n.call(e, q), r = e[q];
151
- try {
152
- e[q] = void 0;
153
- var n = !0;
154
- } catch {
155
- }
156
- var i = bn.call(e);
157
- return n && (t ? e[q] = r : delete e[q]), i;
158
- }
159
- var Tn = _n, On = Object.prototype, Sn = On.toString;
160
- function wn(e) {
161
- return Sn.call(e);
162
- }
163
- var An = wn, Ue = ue, Cn = Tn, xn = An, En = "[object Null]", In = "[object Undefined]", Ge = Ue ? Ue.toStringTag : void 0;
164
- function jn(e) {
165
- return e == null ? e === void 0 ? In : En : Ge && Ge in Object(e) ? Cn(e) : xn(e);
166
- }
167
- var J = jn;
168
- function Pn(e) {
169
- var t = typeof e;
170
- return e != null && (t == "object" || t == "function");
171
- }
172
- var D = Pn, Hn = J, Mn = D, Ln = "[object AsyncFunction]", kn = "[object Function]", Dn = "[object GeneratorFunction]", Kn = "[object Proxy]";
173
- function Rn(e) {
174
- if (!Mn(e))
175
- return !1;
176
- var t = Hn(e);
177
- return t == kn || t == Dn || t == Ln || t == Kn;
178
- }
179
- var Ft = Rn, Fn = E, Bn = Fn["__core-js_shared__"], Nn = Bn, $e = Nn, Ve = function() {
180
- var e = /[^.]+$/.exec($e && $e.keys && $e.keys.IE_PROTO || "");
181
- return e ? "Symbol(src)_1." + e : "";
182
- }();
183
- function Un(e) {
184
- return !!Ve && Ve in e;
185
- }
186
- var Gn = Un, Vn = Function.prototype, Wn = Vn.toString;
187
- function zn(e) {
188
- if (e != null) {
189
- try {
190
- return Wn.call(e);
191
- } catch {
192
- }
193
- try {
194
- return e + "";
195
- } catch {
112
+ function A(e, t) {
113
+ return { title: t ? e : void 0, message: t ?? e };
114
+ }
115
+ async function te(e, t) {
116
+ await X(V, A(e, t));
117
+ }
118
+ async function un(e, t) {
119
+ return await X(V, {
120
+ ...A(e, t),
121
+ shouldConfirm: !0
122
+ }) === !0;
123
+ }
124
+ async function hn(e, t) {
125
+ return await X(V, {
126
+ ...A(e, t),
127
+ shouldConfirm: !0,
128
+ classes: ["destructive"]
129
+ }) === !0;
130
+ }
131
+ function fn(e, t) {
132
+ const n = Ee(V, {
133
+ ...A(e, t),
134
+ callback: () => {
196
135
  }
197
- }
198
- return "";
199
- }
200
- var Bt = zn, qn = Ft, Yn = Gn, Xn = D, Jn = Bt, Zn = /[\\^$.*+?()[\]{}|]/g, Qn = /^\[object .+?Constructor\]$/, ei = Function.prototype, ti = Object.prototype, ri = ei.toString, ni = ti.hasOwnProperty, ii = RegExp(
201
- "^" + ri.call(ni).replace(Zn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
202
- );
203
- function ai(e) {
204
- if (!Xn(e) || Yn(e))
205
- return !1;
206
- var t = qn(e) ? ii : Qn;
207
- return t.test(Jn(e));
208
- }
209
- var si = ai;
210
- function oi(e, t) {
211
- return e == null ? void 0 : e[t];
212
- }
213
- var li = oi, ci = si, ui = li;
214
- function fi(e, t) {
215
- var r = ui(e, t);
216
- return ci(r) ? r : void 0;
217
- }
218
- var K = fi, di = K, hi = E, pi = di(hi, "Map"), je = pi, vi = K, gi = vi(Object, "create"), fe = gi, We = fe;
219
- function yi() {
220
- this.__data__ = We ? We(null) : {}, this.size = 0;
221
- }
222
- var mi = yi;
223
- function $i(e) {
224
- var t = this.has(e) && delete this.__data__[e];
225
- return this.size -= t ? 1 : 0, t;
226
- }
227
- var bi = $i, _i = fe, Ti = "__lodash_hash_undefined__", Oi = Object.prototype, Si = Oi.hasOwnProperty;
228
- function wi(e) {
229
- var t = this.__data__;
230
- if (_i) {
231
- var r = t[e];
232
- return r === Ti ? void 0 : r;
233
- }
234
- return Si.call(t, e) ? t[e] : void 0;
235
- }
236
- var Ai = wi, Ci = fe, xi = Object.prototype, Ei = xi.hasOwnProperty;
237
- function Ii(e) {
238
- var t = this.__data__;
239
- return Ci ? t[e] !== void 0 : Ei.call(t, e);
240
- }
241
- var ji = Ii, Pi = fe, Hi = "__lodash_hash_undefined__";
242
- function Mi(e, t) {
243
- var r = this.__data__;
244
- return this.size += this.has(e) ? 0 : 1, r[e] = Pi && t === void 0 ? Hi : t, this;
245
- }
246
- var Li = Mi, ki = mi, Di = bi, Ki = Ai, Ri = ji, Fi = Li;
247
- function G(e) {
248
- var t = -1, r = e == null ? 0 : e.length;
249
- for (this.clear(); ++t < r; ) {
250
- var n = e[t];
251
- this.set(n[0], n[1]);
252
- }
136
+ });
137
+ return () => Te(n);
253
138
  }
254
- G.prototype.clear = ki;
255
- G.prototype.delete = Di;
256
- G.prototype.get = Ki;
257
- G.prototype.has = Ri;
258
- G.prototype.set = Fi;
259
- var Bi = G, ze = Bi, Ni = ce, Ui = je;
260
- function Gi() {
261
- this.size = 0, this.__data__ = {
262
- hash: new ze(),
263
- map: new (Ui || Ni)(),
264
- string: new ze()
265
- };
139
+ const C = {
140
+ unhandledErrorSupportText: "please contact support",
141
+ errorHandler: (e) => console.error("Unhandled error:", e),
142
+ defaultDateTimeFormat: "MM/dd/yy HH:mm"
143
+ };
144
+ function pn(e) {
145
+ Object.assign(C, e);
266
146
  }
267
- var Vi = Gi;
268
- function Wi(e) {
269
- var t = typeof e;
270
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
271
- }
272
- var zi = Wi, qi = zi;
273
- function Yi(e, t) {
274
- var r = e.__data__;
275
- return qi(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
276
- }
277
- var de = Yi, Xi = de;
278
- function Ji(e) {
279
- var t = Xi(this, e).delete(e);
280
- return this.size -= t ? 1 : 0, t;
281
- }
282
- var Zi = Ji, Qi = de;
283
- function ea(e) {
284
- return Qi(this, e).get(e);
285
- }
286
- var ta = ea, ra = de;
287
- function na(e) {
288
- return ra(this, e).has(e);
289
- }
290
- var ia = na, aa = de;
291
- function sa(e, t) {
292
- var r = aa(this, e), n = r.size;
293
- return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
294
- }
295
- var oa = sa, la = Vi, ca = Zi, ua = ta, fa = ia, da = oa;
296
- function V(e) {
297
- var t = -1, r = e == null ? 0 : e.length;
298
- for (this.clear(); ++t < r; ) {
299
- var n = e[t];
300
- this.set(n[0], n[1]);
147
+ class B extends Error {
148
+ constructor(t) {
149
+ super(t), this.name = "UserError";
301
150
  }
302
151
  }
303
- V.prototype.clear = la;
304
- V.prototype.delete = ca;
305
- V.prototype.get = ua;
306
- V.prototype.has = fa;
307
- V.prototype.set = da;
308
- var Nt = V, ha = ce, pa = je, va = Nt, ga = 200;
309
- function ya(e, t) {
310
- var r = this.__data__;
311
- if (r instanceof ha) {
312
- var n = r.__data__;
313
- if (!pa || n.length < ga - 1)
314
- return n.push([e, t]), this.size = ++r.size, this;
315
- r = this.__data__ = new va(n);
316
- }
317
- return r.set(e, t), this.size = r.size, this;
318
- }
319
- var ma = ya, $a = ce, ba = sn, _a = ln, Ta = un, Oa = dn, Sa = ma;
320
- function W(e) {
321
- var t = this.__data__ = new $a(e);
322
- this.size = t.size;
323
- }
324
- W.prototype.clear = ba;
325
- W.prototype.delete = _a;
326
- W.prototype.get = Ta;
327
- W.prototype.has = Oa;
328
- W.prototype.set = Sa;
329
- var Ut = W;
330
- function wa(e, t) {
331
- for (var r = -1, n = e == null ? 0 : e.length; ++r < n && t(e[r], r, e) !== !1; )
332
- ;
333
- return e;
334
- }
335
- var Aa = wa, Ca = K, xa = function() {
336
- try {
337
- var e = Ca(Object, "defineProperty");
338
- return e({}, "", {}), e;
339
- } catch {
340
- }
341
- }(), Ea = xa, qe = Ea;
342
- function Ia(e, t, r) {
343
- t == "__proto__" && qe ? qe(e, t, {
344
- configurable: !0,
345
- enumerable: !0,
346
- value: r,
347
- writable: !0
348
- }) : e[t] = r;
349
- }
350
- var Gt = Ia, ja = Gt, Pa = Ie, Ha = Object.prototype, Ma = Ha.hasOwnProperty;
351
- function La(e, t, r) {
352
- var n = e[t];
353
- (!(Ma.call(e, t) && Pa(n, r)) || r === void 0 && !(t in e)) && ja(e, t, r);
354
- }
355
- var Vt = La, ka = Vt, Da = Gt;
356
- function Ka(e, t, r, n) {
357
- var i = !r;
358
- r || (r = {});
359
- for (var a = -1, s = t.length; ++a < s; ) {
360
- var o = t[a], l = n ? n(r[o], e[o], o, r, e) : void 0;
361
- l === void 0 && (l = e[o]), i ? Da(r, o, l) : ka(r, o, l);
362
- }
363
- return r;
152
+ function Je(e) {
153
+ return e instanceof B ? e.message : `An application error has occurred:
154
+
155
+ ${Y(e).message}
156
+
157
+ Please refresh the page and try again. If this error persists, ${C.unhandledErrorSupportText}.`;
364
158
  }
365
- var he = Ka;
366
- function Ra(e, t) {
367
- for (var r = -1, n = Array(e); ++r < e; )
368
- n[r] = t(r);
369
- return n;
159
+ function Y(e) {
160
+ return e instanceof Error ? e : new Error(String(e));
370
161
  }
371
- var Fa = Ra;
372
- function Ba(e) {
373
- return e != null && typeof e == "object";
374
- }
375
- var R = Ba, Na = J, Ua = R, Ga = "[object Arguments]";
376
- function Va(e) {
377
- return Ua(e) && Na(e) == Ga;
378
- }
379
- var Wa = Va, Ye = Wa, za = R, Wt = Object.prototype, qa = Wt.hasOwnProperty, Ya = Wt.propertyIsEnumerable, Xa = Ye(function() {
380
- return arguments;
381
- }()) ? Ye : function(e) {
382
- return za(e) && qa.call(e, "callee") && !Ya.call(e, "callee");
383
- }, Ja = Xa, Za = Array.isArray, pe = Za, B = {}, Qa = {
384
- get exports() {
385
- return B;
386
- },
387
- set exports(e) {
388
- B = e;
389
- }
390
- };
391
- function es() {
392
- return !1;
393
- }
394
- var ts = es;
395
- (function(e, t) {
396
- var r = E, n = ts, i = t && !t.nodeType && t, a = i && !0 && e && !e.nodeType && e, s = a && a.exports === i, o = s ? r.Buffer : void 0, l = o ? o.isBuffer : void 0, c = l || n;
397
- e.exports = c;
398
- })(Qa, B);
399
- var rs = 9007199254740991, ns = /^(?:0|[1-9]\d*)$/;
400
- function is(e, t) {
401
- var r = typeof e;
402
- return t = t ?? rs, !!t && (r == "number" || r != "symbol" && ns.test(e)) && e > -1 && e % 1 == 0 && e < t;
403
- }
404
- var as = is, ss = 9007199254740991;
405
- function os(e) {
406
- return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ss;
407
- }
408
- var zt = os, ls = J, cs = zt, us = R, fs = "[object Arguments]", ds = "[object Array]", hs = "[object Boolean]", ps = "[object Date]", vs = "[object Error]", gs = "[object Function]", ys = "[object Map]", ms = "[object Number]", $s = "[object Object]", bs = "[object RegExp]", _s = "[object Set]", Ts = "[object String]", Os = "[object WeakMap]", Ss = "[object ArrayBuffer]", ws = "[object DataView]", As = "[object Float32Array]", Cs = "[object Float64Array]", xs = "[object Int8Array]", Es = "[object Int16Array]", Is = "[object Int32Array]", js = "[object Uint8Array]", Ps = "[object Uint8ClampedArray]", Hs = "[object Uint16Array]", Ms = "[object Uint32Array]", $ = {};
409
- $[As] = $[Cs] = $[xs] = $[Es] = $[Is] = $[js] = $[Ps] = $[Hs] = $[Ms] = !0;
410
- $[fs] = $[ds] = $[Ss] = $[hs] = $[ws] = $[ps] = $[vs] = $[gs] = $[ys] = $[ms] = $[$s] = $[bs] = $[_s] = $[Ts] = $[Os] = !1;
411
- function Ls(e) {
412
- return us(e) && cs(e.length) && !!$[ls(e)];
413
- }
414
- var ks = Ls;
415
- function Ds(e) {
416
- return function(t) {
417
- return e(t);
418
- };
162
+ async function mn(e, t) {
163
+ const n = Y(e);
164
+ return n instanceof B || C.errorHandler(n), t ? te(t, n) : te(n);
419
165
  }
420
- var Pe = Ds, N = {}, Ks = {
421
- get exports() {
422
- return N;
423
- },
424
- set exports(e) {
425
- N = e;
426
- }
427
- };
428
- (function(e, t) {
429
- var r = Kt, n = t && !t.nodeType && t, i = n && !0 && e && !e.nodeType && e, a = i && i.exports === n, s = a && r.process, o = function() {
430
- try {
431
- var l = i && i.require && i.require("util").types;
432
- return l || s && s.binding && s.binding("util");
433
- } catch {
434
- }
435
- }();
436
- e.exports = o;
437
- })(Ks, N);
438
- var Rs = ks, Fs = Pe, Xe = N, Je = Xe && Xe.isTypedArray, Bs = Je ? Fs(Je) : Rs, qt = Bs, Ns = Fa, Us = Ja, Gs = pe, Vs = B, Ws = as, zs = qt, qs = Object.prototype, Ys = qs.hasOwnProperty;
439
- function Xs(e, t) {
440
- var r = Gs(e), n = !r && Us(e), i = !r && !n && Vs(e), a = !r && !n && !i && zs(e), s = r || n || i || a, o = s ? Ns(e.length, String) : [], l = o.length;
441
- for (var c in e)
442
- (t || Ys.call(e, c)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
443
- (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
444
- i && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
445
- a && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
446
- Ws(c, l))) && o.push(c);
447
- return o;
448
- }
449
- var Yt = Xs, Js = Object.prototype;
450
- function Zs(e) {
451
- var t = e && e.constructor, r = typeof t == "function" && t.prototype || Js;
452
- return e === r;
453
- }
454
- var He = Zs;
455
- function Qs(e, t) {
456
- return function(r) {
457
- return e(t(r));
458
- };
166
+ async function vn(e) {
167
+ const t = Y(e);
168
+ t instanceof B || C.errorHandler(t);
459
169
  }
460
- var Xt = Qs, eo = Xt, to = eo(Object.keys, Object), ro = to, no = He, io = ro, ao = Object.prototype, so = ao.hasOwnProperty;
461
- function oo(e) {
462
- if (!no(e))
463
- return io(e);
464
- var t = [];
465
- for (var r in Object(e))
466
- so.call(e, r) && r != "constructor" && t.push(r);
467
- return t;
468
- }
469
- var lo = oo, co = Ft, uo = zt;
470
- function fo(e) {
471
- return e != null && uo(e.length) && !co(e);
472
- }
473
- var Jt = fo, ho = Yt, po = lo, vo = Jt;
474
- function go(e) {
475
- return vo(e) ? ho(e) : po(e);
476
- }
477
- var Me = go, yo = he, mo = Me;
478
- function $o(e, t) {
479
- return e && yo(t, mo(t), e);
480
- }
481
- var bo = $o;
482
- function _o(e) {
483
- var t = [];
484
- if (e != null)
485
- for (var r in Object(e))
486
- t.push(r);
487
- return t;
488
- }
489
- var To = _o, Oo = D, So = He, wo = To, Ao = Object.prototype, Co = Ao.hasOwnProperty;
490
- function xo(e) {
491
- if (!Oo(e))
492
- return wo(e);
493
- var t = So(e), r = [];
494
- for (var n in e)
495
- n == "constructor" && (t || !Co.call(e, n)) || r.push(n);
496
- return r;
497
- }
498
- var Eo = xo, Io = Yt, jo = Eo, Po = Jt;
499
- function Ho(e) {
500
- return Po(e) ? Io(e, !0) : jo(e);
501
- }
502
- var Le = Ho, Mo = he, Lo = Le;
503
- function ko(e, t) {
504
- return e && Mo(t, Lo(t), e);
505
- }
506
- var Do = ko, ie = {}, Ko = {
507
- get exports() {
508
- return ie;
170
+ const et = ["id"], tt = {
171
+ key: 0,
172
+ class: "vf-modal-header"
173
+ }, nt = { class: "vf-modal-content" }, it = {
174
+ key: 1,
175
+ class: "vf-modal-footer"
176
+ }, st = /* @__PURE__ */ M({
177
+ __name: "modal",
178
+ props: {
179
+ id: null,
180
+ closeOnMaskClick: { type: Boolean },
181
+ scrolls: { type: Boolean },
182
+ closeX: { type: Boolean },
183
+ class: null
509
184
  },
510
- set exports(e) {
511
- ie = e;
512
- }
513
- };
514
- (function(e, t) {
515
- var r = E, n = t && !t.nodeType && t, i = n && !0 && e && !e.nodeType && e, a = i && i.exports === n, s = a ? r.Buffer : void 0, o = s ? s.allocUnsafe : void 0;
516
- function l(c, b) {
517
- if (b)
518
- return c.slice();
519
- var d = c.length, h = o ? o(d) : new c.constructor(d);
520
- return c.copy(h), h;
521
- }
522
- e.exports = l;
523
- })(Ko, ie);
524
- function Ro(e, t) {
525
- var r = -1, n = e.length;
526
- for (t || (t = Array(n)); ++r < n; )
527
- t[r] = e[r];
528
- return t;
529
- }
530
- var Fo = Ro;
531
- function Bo(e, t) {
532
- for (var r = -1, n = e == null ? 0 : e.length, i = 0, a = []; ++r < n; ) {
533
- var s = e[r];
534
- t(s, r, e) && (a[i++] = s);
535
- }
536
- return a;
537
- }
538
- var No = Bo;
539
- function Uo() {
540
- return [];
541
- }
542
- var Zt = Uo, Go = No, Vo = Zt, Wo = Object.prototype, zo = Wo.propertyIsEnumerable, Ze = Object.getOwnPropertySymbols, qo = Ze ? function(e) {
543
- return e == null ? [] : (e = Object(e), Go(Ze(e), function(t) {
544
- return zo.call(e, t);
545
- }));
546
- } : Vo, ke = qo, Yo = he, Xo = ke;
547
- function Jo(e, t) {
548
- return Yo(e, Xo(e), t);
549
- }
550
- var Zo = Jo;
551
- function Qo(e, t) {
552
- for (var r = -1, n = t.length, i = e.length; ++r < n; )
553
- e[i + r] = t[r];
554
- return e;
555
- }
556
- var Qt = Qo, el = Xt, tl = el(Object.getPrototypeOf, Object), er = tl, rl = Qt, nl = er, il = ke, al = Zt, sl = Object.getOwnPropertySymbols, ol = sl ? function(e) {
557
- for (var t = []; e; )
558
- rl(t, il(e)), e = nl(e);
559
- return t;
560
- } : al, tr = ol, ll = he, cl = tr;
561
- function ul(e, t) {
562
- return ll(e, cl(e), t);
563
- }
564
- var fl = ul, dl = Qt, hl = pe;
565
- function pl(e, t, r) {
566
- var n = t(e);
567
- return hl(e) ? n : dl(n, r(e));
568
- }
569
- var rr = pl, vl = rr, gl = ke, yl = Me;
570
- function ml(e) {
571
- return vl(e, yl, gl);
572
- }
573
- var nr = ml, $l = rr, bl = tr, _l = Le;
574
- function Tl(e) {
575
- return $l(e, _l, bl);
576
- }
577
- var Ol = Tl, Sl = K, wl = E, Al = Sl(wl, "DataView"), Cl = Al, xl = K, El = E, Il = xl(El, "Promise"), jl = Il, Pl = K, Hl = E, Ml = Pl(Hl, "Set"), Ll = Ml, kl = K, Dl = E, Kl = kl(Dl, "WeakMap"), Rl = Kl, we = Cl, Ae = je, Ce = jl, xe = Ll, Ee = Rl, ir = J, z = Bt, Qe = "[object Map]", Fl = "[object Object]", et = "[object Promise]", tt = "[object Set]", rt = "[object WeakMap]", nt = "[object DataView]", Bl = z(we), Nl = z(Ae), Ul = z(Ce), Gl = z(xe), Vl = z(Ee), M = ir;
578
- (we && M(new we(new ArrayBuffer(1))) != nt || Ae && M(new Ae()) != Qe || Ce && M(Ce.resolve()) != et || xe && M(new xe()) != tt || Ee && M(new Ee()) != rt) && (M = function(e) {
579
- var t = ir(e), r = t == Fl ? e.constructor : void 0, n = r ? z(r) : "";
580
- if (n)
581
- switch (n) {
582
- case Bl:
583
- return nt;
584
- case Nl:
585
- return Qe;
586
- case Ul:
587
- return et;
588
- case Gl:
589
- return tt;
590
- case Vl:
591
- return rt;
592
- }
593
- return t;
594
- });
595
- var ve = M, Wl = Object.prototype, zl = Wl.hasOwnProperty;
596
- function ql(e) {
597
- var t = e.length, r = new e.constructor(t);
598
- return t && typeof e[0] == "string" && zl.call(e, "index") && (r.index = e.index, r.input = e.input), r;
599
- }
600
- var Yl = ql, Xl = E, Jl = Xl.Uint8Array, ar = Jl, it = ar;
601
- function Zl(e) {
602
- var t = new e.constructor(e.byteLength);
603
- return new it(t).set(new it(e)), t;
604
- }
605
- var De = Zl, Ql = De;
606
- function ec(e, t) {
607
- var r = t ? Ql(e.buffer) : e.buffer;
608
- return new e.constructor(r, e.byteOffset, e.byteLength);
609
- }
610
- var tc = ec, rc = /\w*$/;
611
- function nc(e) {
612
- var t = new e.constructor(e.source, rc.exec(e));
613
- return t.lastIndex = e.lastIndex, t;
614
- }
615
- var ic = nc, at = ue, st = at ? at.prototype : void 0, ot = st ? st.valueOf : void 0;
616
- function ac(e) {
617
- return ot ? Object(ot.call(e)) : {};
618
- }
619
- var sc = ac, oc = De;
620
- function lc(e, t) {
621
- var r = t ? oc(e.buffer) : e.buffer;
622
- return new e.constructor(r, e.byteOffset, e.length);
623
- }
624
- var cc = lc, uc = De, fc = tc, dc = ic, hc = sc, pc = cc, vc = "[object Boolean]", gc = "[object Date]", yc = "[object Map]", mc = "[object Number]", $c = "[object RegExp]", bc = "[object Set]", _c = "[object String]", Tc = "[object Symbol]", Oc = "[object ArrayBuffer]", Sc = "[object DataView]", wc = "[object Float32Array]", Ac = "[object Float64Array]", Cc = "[object Int8Array]", xc = "[object Int16Array]", Ec = "[object Int32Array]", Ic = "[object Uint8Array]", jc = "[object Uint8ClampedArray]", Pc = "[object Uint16Array]", Hc = "[object Uint32Array]";
625
- function Mc(e, t, r) {
626
- var n = e.constructor;
627
- switch (t) {
628
- case Oc:
629
- return uc(e);
630
- case vc:
631
- case gc:
632
- return new n(+e);
633
- case Sc:
634
- return fc(e, r);
635
- case wc:
636
- case Ac:
637
- case Cc:
638
- case xc:
639
- case Ec:
640
- case Ic:
641
- case jc:
642
- case Pc:
643
- case Hc:
644
- return pc(e, r);
645
- case yc:
646
- return new n();
647
- case mc:
648
- case _c:
649
- return new n(e);
650
- case $c:
651
- return dc(e);
652
- case bc:
653
- return new n();
654
- case Tc:
655
- return hc(e);
656
- }
657
- }
658
- var Lc = Mc, kc = D, lt = Object.create, Dc = function() {
659
- function e() {
660
- }
661
- return function(t) {
662
- if (!kc(t))
663
- return {};
664
- if (lt)
665
- return lt(t);
666
- e.prototype = t;
667
- var r = new e();
668
- return e.prototype = void 0, r;
669
- };
670
- }(), Kc = Dc, Rc = Kc, Fc = er, Bc = He;
671
- function Nc(e) {
672
- return typeof e.constructor == "function" && !Bc(e) ? Rc(Fc(e)) : {};
673
- }
674
- var Uc = Nc, Gc = ve, Vc = R, Wc = "[object Map]";
675
- function zc(e) {
676
- return Vc(e) && Gc(e) == Wc;
677
- }
678
- var qc = zc, Yc = qc, Xc = Pe, ct = N, ut = ct && ct.isMap, Jc = ut ? Xc(ut) : Yc, Zc = Jc, Qc = ve, eu = R, tu = "[object Set]";
679
- function ru(e) {
680
- return eu(e) && Qc(e) == tu;
681
- }
682
- var nu = ru, iu = nu, au = Pe, ft = N, dt = ft && ft.isSet, su = dt ? au(dt) : iu, ou = su, lu = Ut, cu = Aa, uu = Vt, fu = bo, du = Do, hu = ie, pu = Fo, vu = Zo, gu = fl, yu = nr, mu = Ol, $u = ve, bu = Yl, _u = Lc, Tu = Uc, Ou = pe, Su = B, wu = Zc, Au = D, Cu = ou, xu = Me, Eu = Le, Iu = 1, ju = 2, Pu = 4, sr = "[object Arguments]", Hu = "[object Array]", Mu = "[object Boolean]", Lu = "[object Date]", ku = "[object Error]", or = "[object Function]", Du = "[object GeneratorFunction]", Ku = "[object Map]", Ru = "[object Number]", lr = "[object Object]", Fu = "[object RegExp]", Bu = "[object Set]", Nu = "[object String]", Uu = "[object Symbol]", Gu = "[object WeakMap]", Vu = "[object ArrayBuffer]", Wu = "[object DataView]", zu = "[object Float32Array]", qu = "[object Float64Array]", Yu = "[object Int8Array]", Xu = "[object Int16Array]", Ju = "[object Int32Array]", Zu = "[object Uint8Array]", Qu = "[object Uint8ClampedArray]", ef = "[object Uint16Array]", tf = "[object Uint32Array]", y = {};
683
- y[sr] = y[Hu] = y[Vu] = y[Wu] = y[Mu] = y[Lu] = y[zu] = y[qu] = y[Yu] = y[Xu] = y[Ju] = y[Ku] = y[Ru] = y[lr] = y[Fu] = y[Bu] = y[Nu] = y[Uu] = y[Zu] = y[Qu] = y[ef] = y[tf] = !0;
684
- y[ku] = y[or] = y[Gu] = !1;
685
- function ee(e, t, r, n, i, a) {
686
- var s, o = t & Iu, l = t & ju, c = t & Pu;
687
- if (r && (s = i ? r(e, n, i, a) : r(e)), s !== void 0)
688
- return s;
689
- if (!Au(e))
690
- return e;
691
- var b = Ou(e);
692
- if (b) {
693
- if (s = bu(e), !o)
694
- return pu(e, s);
695
- } else {
696
- var d = $u(e), h = d == or || d == Du;
697
- if (Su(e))
698
- return hu(e, o);
699
- if (d == lr || d == sr || h && !i) {
700
- if (s = l || h ? {} : Tu(e), !o)
701
- return l ? gu(e, du(s, e)) : vu(e, fu(s, e));
702
- } else {
703
- if (!y[d])
704
- return i ? e : {};
705
- s = _u(e, d, o);
706
- }
707
- }
708
- a || (a = new lu());
709
- var p = a.get(e);
710
- if (p)
711
- return p;
712
- a.set(e, s), Cu(e) ? e.forEach(function(_) {
713
- s.add(ee(_, t, r, _, e, a));
714
- }) : wu(e) && e.forEach(function(_, S) {
715
- s.set(S, ee(_, t, r, S, e, a));
716
- });
717
- var v = c ? l ? mu : yu : l ? Eu : xu, T = b ? void 0 : v(e);
718
- return cu(T || e, function(_, S) {
719
- T && (S = _, _ = e[S]), uu(s, S, ee(_, t, r, S, e, a));
720
- }), s;
721
- }
722
- var rf = ee, nf = rf, af = 1, sf = 4;
723
- function of(e) {
724
- return nf(e, af | sf);
725
- }
726
- var lf = of;
727
- const cf = {
728
- props: ["id", "closeOnMaskClick", "scrolls", "closeX", "class"],
729
185
  emits: ["formSubmit"],
730
- beforeCreate() {
731
- const e = document.getElementById("vf-modal-target") ?? document.createElement("div");
732
- e.id = "vf-modal-target", e.removeAttribute("inert"), document.body.appendChild(e);
733
- },
734
- mounted() {
735
- window.addEventListener("keydown", this.handleEscapeKey), document.body.classList.add("vf-modal-open"), this.$isPropTruthy(this.closeOnMaskClick) && this.$el.addEventListener("click", (e) => {
736
- e.target == this.$el && this.$parent.$dismiss();
186
+ setup(e) {
187
+ const t = e, n = I();
188
+ q(() => {
189
+ var l;
190
+ window.addEventListener("keydown", s), document.body.classList.add("vf-modal-open"), t.closeOnMaskClick && ((l = n.value) == null || l.addEventListener("click", i));
191
+ }), U(() => {
192
+ document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
737
193
  });
738
- },
739
- unmounted() {
740
- window.removeEventListener("keydown", this.handleEscapeKey), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
741
- },
742
- methods: {
743
- handleEscapeKey(e) {
744
- if (e.key === "Esc" || e.key === "Escape") {
745
- const t = document.querySelectorAll(".vf-modal-wrap");
746
- t[t.length - 1] === this.$el && this.$parent.$dismiss();
194
+ function i(l) {
195
+ l.target == n.value && o();
196
+ }
197
+ function s(l) {
198
+ if (l.key === "Esc" || l.key === "Escape") {
199
+ const r = document.querySelectorAll(".vf-modal-wrap");
200
+ r[r.length - 1] === n.value && o();
747
201
  }
748
202
  }
749
- }
750
- };
751
- let ae = {};
752
- function uf(e) {
753
- const t = ae[e];
754
- this.$modalOpener = t.opener, this.$modalResult = void 0, this.$options.storeParent = this.$modalOpener;
755
- let r = this.$options.data;
756
- this.$options.data = function() {
757
- const n = t.injectedData || {}, i = this.$options.keepOriginal || [];
758
- let a = r ? r.apply(this) : {};
759
- for (let s in n)
760
- i.includes(s) || (n[s] !== null && typeof n[s] == "object" && n[s].constructor === Object ? a[s] = lf(n[s]) : a[s] = n[s]);
761
- return a;
762
- }, this.$dismiss = (...n) => new Promise((i) => {
763
- setTimeout(() => {
764
- delete ae[e];
765
- let a = f.vm.store.rootInjections;
766
- const s = a.find((o) => o.__modalId === e);
767
- s && (a.remove(s), this.$nextTick(() => {
768
- t.resolve.apply(this, n[0] !== void 0 ? n : this.$modalResult), i();
769
- }));
770
- }, 0);
771
- }), t.instanceCreationCallback && t.instanceCreationCallback(this);
772
- }
773
- f.mixin({
774
- beforeCreate() {
775
- const e = this.$options.__modalId || this.$options.__file;
776
- e && ae[e] && uf.call(this, e);
203
+ function o() {
204
+ const l = fe();
205
+ Oe(l);
206
+ }
207
+ return (l, r) => (a(), z(Ve, { to: "#vf-modal-target" }, [
208
+ v("div", {
209
+ id: e.id,
210
+ class: E(["vf-overlay vf-modal-wrap", t.class]),
211
+ ref_key: "overlay",
212
+ ref: n
213
+ }, [
214
+ v("form", {
215
+ action: ".",
216
+ class: E(["vf-modal", { scrolls: e.scrolls }]),
217
+ onSubmit: r[0] || (r[0] = Fe((c) => l.$emit("formSubmit"), ["prevent"]))
218
+ }, [
219
+ l.$slots.header ? (a(), d("div", tt, [
220
+ F(l.$slots, "header"),
221
+ t.closeX ? (a(), d("i", {
222
+ key: 0,
223
+ class: "close",
224
+ onClick: o
225
+ })) : g("", !0)
226
+ ])) : g("", !0),
227
+ v("div", nt, [
228
+ F(l.$slots, "default")
229
+ ]),
230
+ l.$slots.footer ? (a(), d("div", it, [
231
+ F(l.$slots, "footer")
232
+ ])) : g("", !0)
233
+ ], 34)
234
+ ], 10, et)
235
+ ]));
777
236
  }
778
237
  });
779
- f.config.globalProperties.$modal = function(e, t, r) {
780
- return new Promise((n, i) => {
781
- const a = e.__modalId || e.__file || Math.random().toString(36).substring(2, 10);
782
- e.__modalId = a, ae[a] = {
783
- opener: this,
784
- injectedData: t,
785
- instanceCreationCallback: r,
786
- resolve: n
787
- }, this.$nextTick(() => {
788
- f.vm.store.rootInjections.push($r(e));
789
- });
790
- });
791
- };
792
- const ff = ["id"], df = {
793
- key: 0,
794
- class: "vf-modal-header"
795
- }, hf = { class: "vf-modal-content" }, pf = {
796
- key: 1,
797
- class: "vf-modal-footer"
798
- };
799
- function vf(e, t, r, n, i, a) {
800
- return O(), kt(br, { to: "#vf-modal-target" }, [
801
- P("div", {
802
- id: r.id,
803
- class: F(["vf-overlay vf-modal-wrap", r.class])
804
- }, [
805
- P("form", {
806
- action: ".",
807
- class: F(["vf-modal", { scrolls: e.$isPropTruthy(this.scrolls) }]),
808
- onSubmit: t[1] || (t[1] = _r((s) => e.$emit("formSubmit"), ["prevent"]))
809
- }, [
810
- e.$slots.header ? (O(), w("div", df, [
811
- ye(e.$slots, "header"),
812
- e.$isPropTruthy(this.closeX) ? (O(), w("i", {
238
+ const ot = ["innerHtml"], lt = ["innerText"], V = /* @__PURE__ */ M({
239
+ __name: "alert-modal",
240
+ props: {
241
+ isBare: { type: Boolean },
242
+ isHtml: { type: Boolean },
243
+ classes: null,
244
+ title: null,
245
+ message: null,
246
+ shouldConfirm: { type: Boolean },
247
+ callback: { type: Function }
248
+ },
249
+ setup(e) {
250
+ const t = e, n = D(() => t.message instanceof Error ? Je(t.message) : t.message);
251
+ return (i, s) => {
252
+ const o = pe("autofocus");
253
+ return a(), z(st, {
254
+ class: E(["vf-alert", e.classes])
255
+ }, Ne({
256
+ default: N(() => [
257
+ e.isHtml ? (a(), d("div", {
813
258
  key: 0,
814
- class: "close",
815
- onClick: t[0] || (t[0] = (s) => e.$parent.$dismiss())
816
- })) : L("", !0)
817
- ])) : L("", !0),
818
- P("div", hf, [
819
- ye(e.$slots, "default")
259
+ innerHtml: e.message,
260
+ class: "user-message"
261
+ }, null, 8, ot)) : (a(), d("div", {
262
+ key: 1,
263
+ innerText: R(n)
264
+ }, null, 8, lt))
820
265
  ]),
821
- e.$slots.footer ? (O(), w("div", pf, [
822
- ye(e.$slots, "footer")
823
- ])) : L("", !0)
824
- ], 34)
825
- ], 10, ff)
826
- ]);
827
- }
828
- const cr = /* @__PURE__ */ oe(cf, [["render", vf]]);
829
- const ge = {
830
- components: {
831
- Modal: cr
832
- },
833
- data() {
834
- return {
835
- isBare: !1,
836
- isHtml: !1,
837
- classes: [],
838
- title: null,
839
- message: null,
840
- shouldConfirm: !1
266
+ _: 2
267
+ }, [
268
+ e.isBare ? void 0 : {
269
+ name: "header",
270
+ fn: N(() => [
271
+ v("h1", null, w(e.title), 1)
272
+ ]),
273
+ key: "0"
274
+ },
275
+ e.isBare ? void 0 : {
276
+ name: "footer",
277
+ fn: N(() => [
278
+ e.shouldConfirm ? (a(), d($, { key: 0 }, [
279
+ H((a(), d("button", {
280
+ class: "primary",
281
+ onClick: s[0] || (s[0] = () => e.callback(!0))
282
+ }, [
283
+ J("Confirm")
284
+ ])), [
285
+ [o]
286
+ ]),
287
+ v("button", {
288
+ class: "default",
289
+ onClick: s[1] || (s[1] = () => e.callback(!1))
290
+ }, "Cancel")
291
+ ], 64)) : H((a(), d("button", {
292
+ key: 1,
293
+ class: "default",
294
+ onClick: s[2] || (s[2] = () => e.callback(!0))
295
+ }, [
296
+ J("OK")
297
+ ])), [
298
+ [o]
299
+ ])
300
+ ]),
301
+ key: "1"
302
+ }
303
+ ]), 1032, ["class"]);
841
304
  };
842
- },
843
- created() {
844
- if (typeof this.message == "object") {
845
- if (this.message.html)
846
- this.isHtml = !0, this.message = this.message.html;
847
- else if (this.message instanceof Error) {
848
- let e = this.message;
849
- e.handle(), this.message = e.userMessage;
850
- }
851
- }
852
- },
853
- methods: {
854
- ok() {
855
- this.$dismiss(!0);
856
- }
857
305
  }
858
- }, gf = ge;
859
- async function Ke(e, t, ...r) {
860
- return t = { ...t, __modalId: Math.random().toString(36).substring(2, 10) }, await e.$modal.apply(e, [t, ...r]);
306
+ });
307
+ function gn(e) {
308
+ return e.replace(/\n/g, "<br>");
861
309
  }
862
- f.config.globalProperties.$alert = async function(e, t) {
863
- return await Ke(this, ge, { title: e, message: t });
864
- };
865
- f.config.globalProperties.$confirm = async function(e, t, r) {
866
- return r = r || {}, !!await Ke(this, ge, { title: e, message: t, shouldConfirm: !0, ...r });
867
- };
868
- f.config.globalProperties.$confirmDestroy = function(e, t, r) {
869
- return r = r || {}, r.classes = r.classes || [], r.classes.push("destructive"), this.$confirm(e, t, r);
870
- };
871
- f.config.globalProperties.$wait = function(e, t) {
872
- e && !t ? (t = e, e = void 0) : !e && !t && (t = "Please wait...");
873
- let r = null, n = new Promise((i, a) => {
874
- Ke(this, ge, { title: e, message: t, isBare: !0, classes: ["wait"] }, i);
875
- }).then((i) => r = i);
876
- return this.$endWait = async () => {
877
- delete this.$endWait, r ? await r.$dismiss() : await n.then(() => r.$dismiss());
878
- }, this.$endWait;
879
- };
880
- const yf = ["innerHTML"], mf = { key: 1 };
881
- function $f(e, t, r, n, i, a) {
882
- const s = Tr("Modal"), o = Se("user-text"), l = Se("autofocus");
883
- return O(), kt(s, {
884
- class: F(["vf-alert", e.classes])
885
- }, Or({
886
- default: me(() => [
887
- e.isHtml ? (O(), w("div", {
888
- key: 0,
889
- innerHTML: e.message,
890
- class: "user-message"
891
- }, null, 8, yf)) : X((O(), w("div", mf, null, 512)), [
892
- [o, e.message]
893
- ])
894
- ]),
895
- _: 2
896
- }, [
897
- this.isBare ? void 0 : {
898
- name: "header",
899
- fn: me(() => [
900
- P("h1", null, Y(e.title), 1)
901
- ]),
902
- key: "0"
903
- },
904
- this.isBare ? void 0 : {
905
- name: "footer",
906
- fn: me(() => [
907
- e.shouldConfirm ? (O(), w(re, { key: 0 }, [
908
- X((O(), w("button", {
909
- class: "primary",
910
- onClick: t[0] || (t[0] = (...c) => e.ok && e.ok(...c))
911
- }, [
912
- Be("Confirm")
913
- ])), [
914
- [l]
915
- ]),
916
- P("button", {
917
- class: "default",
918
- onClick: t[1] || (t[1] = (c) => e.$dismiss())
919
- }, "Cancel")
920
- ], 64)) : X((O(), w("button", {
921
- key: 1,
922
- class: "default",
923
- onClick: t[2] || (t[2] = (...c) => e.ok && e.ok(...c))
924
- }, [
925
- Be("OK")
926
- ])), [
927
- [l]
928
- ])
929
- ]),
930
- key: "1"
931
- }
932
- ]), 1032, ["class"]);
933
- }
934
- const bf = /* @__PURE__ */ oe(gf, [["render", $f]]);
935
- var _f = E, Tf = function() {
936
- return _f.Date.now();
937
- }, Of = Tf, Sf = /\s/;
938
- function wf(e) {
939
- for (var t = e.length; t-- && Sf.test(e.charAt(t)); )
940
- ;
941
- return t;
942
- }
943
- var Af = wf, Cf = Af, xf = /^\s+/;
944
- function Ef(e) {
945
- return e && e.slice(0, Cf(e) + 1).replace(xf, "");
946
- }
947
- var If = Ef, jf = J, Pf = R, Hf = "[object Symbol]";
948
- function Mf(e) {
949
- return typeof e == "symbol" || Pf(e) && jf(e) == Hf;
950
- }
951
- var Lf = Mf, kf = If, ht = D, Df = Lf, pt = 0 / 0, Kf = /^[-+]0x[0-9a-f]+$/i, Rf = /^0b[01]+$/i, Ff = /^0o[0-7]+$/i, Bf = parseInt;
952
- function Nf(e) {
953
- if (typeof e == "number")
954
- return e;
955
- if (Df(e))
956
- return pt;
957
- if (ht(e)) {
958
- var t = typeof e.valueOf == "function" ? e.valueOf() : e;
959
- e = ht(t) ? t + "" : t;
960
- }
961
- if (typeof e != "string")
962
- return e === 0 ? e : +e;
963
- e = kf(e);
964
- var r = Rf.test(e);
965
- return r || Ff.test(e) ? Bf(e.slice(2), r ? 2 : 8) : Kf.test(e) ? pt : +e;
966
- }
967
- var Uf = Nf, Gf = D, be = Of, vt = Uf, Vf = "Expected a function", Wf = Math.max, zf = Math.min;
968
- function qf(e, t, r) {
969
- var n, i, a, s, o, l, c = 0, b = !1, d = !1, h = !0;
970
- if (typeof e != "function")
971
- throw new TypeError(Vf);
972
- t = vt(t) || 0, Gf(r) && (b = !!r.leading, d = "maxWait" in r, a = d ? Wf(vt(r.maxWait) || 0, t) : a, h = "trailing" in r ? !!r.trailing : h);
973
- function p(m) {
974
- var C = n, j = i;
975
- return n = i = void 0, c = m, s = e.apply(j, C), s;
976
- }
977
- function v(m) {
978
- return c = m, o = setTimeout(S, t), b ? p(m) : s;
979
- }
980
- function T(m) {
981
- var C = m - l, j = m - c, Fe = t - C;
982
- return d ? zf(Fe, a - j) : Fe;
983
- }
984
- function _(m) {
985
- var C = m - l, j = m - c;
986
- return l === void 0 || C >= t || C < 0 || d && j >= a;
987
- }
988
- function S() {
989
- var m = be();
990
- if (_(m))
991
- return g(m);
992
- o = setTimeout(S, T(m));
993
- }
994
- function g(m) {
995
- return o = void 0, h && n ? p(m) : (n = i = void 0, s);
996
- }
997
- function I() {
998
- o !== void 0 && clearTimeout(o), c = 0, n = l = i = o = void 0;
999
- }
1000
- function x() {
1001
- return o === void 0 ? s : g(be());
1002
- }
1003
- function A() {
1004
- var m = be(), C = _(m);
1005
- if (n = arguments, i = this, l = m, C) {
1006
- if (o === void 0)
1007
- return v(l);
1008
- if (d)
1009
- return clearTimeout(o), o = setTimeout(S, t), p(l);
1010
- }
1011
- return o === void 0 && (o = setTimeout(S, t)), s;
1012
- }
1013
- return A.cancel = I, A.flush = x, A;
310
+ function rt(e) {
311
+ return e.replace(/_/g, " ");
1014
312
  }
1015
- var Yf = qf, Xf = "__lodash_hash_undefined__";
1016
- function Jf(e) {
1017
- return this.__data__.set(e, Xf), this;
313
+ function at(e) {
314
+ const t = e.replace(/\D/g, "").replace(/^1/, "");
315
+ return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
1018
316
  }
1019
- var Zf = Jf;
1020
- function Qf(e) {
1021
- return this.__data__.has(e);
317
+ function ct(e) {
318
+ return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1022
319
  }
1023
- var ed = Qf, td = Nt, rd = Zf, nd = ed;
1024
- function se(e) {
1025
- var t = -1, r = e == null ? 0 : e.length;
1026
- for (this.__data__ = new td(); ++t < r; )
1027
- this.add(e[t]);
1028
- }
1029
- se.prototype.add = se.prototype.push = rd;
1030
- se.prototype.has = nd;
1031
- var id = se;
1032
- function ad(e, t) {
1033
- for (var r = -1, n = e == null ? 0 : e.length; ++r < n; )
1034
- if (t(e[r], r, e))
1035
- return !0;
1036
- return !1;
1037
- }
1038
- var sd = ad;
1039
- function od(e, t) {
1040
- return e.has(t);
1041
- }
1042
- var ld = od, cd = id, ud = sd, fd = ld, dd = 1, hd = 2;
1043
- function pd(e, t, r, n, i, a) {
1044
- var s = r & dd, o = e.length, l = t.length;
1045
- if (o != l && !(s && l > o))
1046
- return !1;
1047
- var c = a.get(e), b = a.get(t);
1048
- if (c && b)
1049
- return c == t && b == e;
1050
- var d = -1, h = !0, p = r & hd ? new cd() : void 0;
1051
- for (a.set(e, t), a.set(t, e); ++d < o; ) {
1052
- var v = e[d], T = t[d];
1053
- if (n)
1054
- var _ = s ? n(T, v, d, t, e, a) : n(v, T, d, e, t, a);
1055
- if (_ !== void 0) {
1056
- if (_)
1057
- continue;
1058
- h = !1;
1059
- break;
1060
- }
1061
- if (p) {
1062
- if (!ud(t, function(S, g) {
1063
- if (!fd(p, g) && (v === S || i(v, S, r, n, a)))
1064
- return p.push(g);
1065
- })) {
1066
- h = !1;
1067
- break;
1068
- }
1069
- } else if (!(v === T || i(v, T, r, n, a))) {
1070
- h = !1;
1071
- break;
1072
- }
1073
- }
1074
- return a.delete(e), a.delete(t), h;
1075
- }
1076
- var ur = pd;
1077
- function vd(e) {
1078
- var t = -1, r = Array(e.size);
1079
- return e.forEach(function(n, i) {
1080
- r[++t] = [i, n];
1081
- }), r;
1082
- }
1083
- var gd = vd;
1084
- function yd(e) {
1085
- var t = -1, r = Array(e.size);
1086
- return e.forEach(function(n) {
1087
- r[++t] = n;
1088
- }), r;
1089
- }
1090
- var md = yd, gt = ue, yt = ar, $d = Ie, bd = ur, _d = gd, Td = md, Od = 1, Sd = 2, wd = "[object Boolean]", Ad = "[object Date]", Cd = "[object Error]", xd = "[object Map]", Ed = "[object Number]", Id = "[object RegExp]", jd = "[object Set]", Pd = "[object String]", Hd = "[object Symbol]", Md = "[object ArrayBuffer]", Ld = "[object DataView]", mt = gt ? gt.prototype : void 0, _e = mt ? mt.valueOf : void 0;
1091
- function kd(e, t, r, n, i, a, s) {
1092
- switch (r) {
1093
- case Ld:
1094
- if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
1095
- return !1;
1096
- e = e.buffer, t = t.buffer;
1097
- case Md:
1098
- return !(e.byteLength != t.byteLength || !a(new yt(e), new yt(t)));
1099
- case wd:
1100
- case Ad:
1101
- case Ed:
1102
- return $d(+e, +t);
1103
- case Cd:
1104
- return e.name == t.name && e.message == t.message;
1105
- case Id:
1106
- case Pd:
1107
- return e == t + "";
1108
- case xd:
1109
- var o = _d;
1110
- case jd:
1111
- var l = n & Od;
1112
- if (o || (o = Td), e.size != t.size && !l)
1113
- return !1;
1114
- var c = s.get(e);
1115
- if (c)
1116
- return c == t;
1117
- n |= Sd, s.set(e, t);
1118
- var b = bd(o(e), o(t), n, i, a, s);
1119
- return s.delete(e), b;
1120
- case Hd:
1121
- if (_e)
1122
- return _e.call(e) == _e.call(t);
1123
- }
1124
- return !1;
1125
- }
1126
- var Dd = kd, $t = nr, Kd = 1, Rd = Object.prototype, Fd = Rd.hasOwnProperty;
1127
- function Bd(e, t, r, n, i, a) {
1128
- var s = r & Kd, o = $t(e), l = o.length, c = $t(t), b = c.length;
1129
- if (l != b && !s)
1130
- return !1;
1131
- for (var d = l; d--; ) {
1132
- var h = o[d];
1133
- if (!(s ? h in t : Fd.call(t, h)))
1134
- return !1;
1135
- }
1136
- var p = a.get(e), v = a.get(t);
1137
- if (p && v)
1138
- return p == t && v == e;
1139
- var T = !0;
1140
- a.set(e, t), a.set(t, e);
1141
- for (var _ = s; ++d < l; ) {
1142
- h = o[d];
1143
- var S = e[h], g = t[h];
1144
- if (n)
1145
- var I = s ? n(g, S, h, t, e, a) : n(S, g, h, e, t, a);
1146
- if (!(I === void 0 ? S === g || i(S, g, r, n, a) : I)) {
1147
- T = !1;
1148
- break;
1149
- }
1150
- _ || (_ = h == "constructor");
1151
- }
1152
- if (T && !_) {
1153
- var x = e.constructor, A = t.constructor;
1154
- x != A && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof A == "function" && A instanceof A) && (T = !1);
1155
- }
1156
- return a.delete(e), a.delete(t), T;
1157
- }
1158
- var Nd = Bd, Te = Ut, Ud = ur, Gd = Dd, Vd = Nd, bt = ve, _t = pe, Tt = B, Wd = qt, zd = 1, Ot = "[object Arguments]", St = "[object Array]", Q = "[object Object]", qd = Object.prototype, wt = qd.hasOwnProperty;
1159
- function Yd(e, t, r, n, i, a) {
1160
- var s = _t(e), o = _t(t), l = s ? St : bt(e), c = o ? St : bt(t);
1161
- l = l == Ot ? Q : l, c = c == Ot ? Q : c;
1162
- var b = l == Q, d = c == Q, h = l == c;
1163
- if (h && Tt(e)) {
1164
- if (!Tt(t))
1165
- return !1;
1166
- s = !0, b = !1;
1167
- }
1168
- if (h && !b)
1169
- return a || (a = new Te()), s || Wd(e) ? Ud(e, t, r, n, i, a) : Gd(e, t, l, r, n, i, a);
1170
- if (!(r & zd)) {
1171
- var p = b && wt.call(e, "__wrapped__"), v = d && wt.call(t, "__wrapped__");
1172
- if (p || v) {
1173
- var T = p ? e.value() : e, _ = v ? t.value() : t;
1174
- return a || (a = new Te()), i(T, _, r, n, a);
1175
- }
1176
- }
1177
- return h ? (a || (a = new Te()), Vd(e, t, r, n, i, a)) : !1;
1178
- }
1179
- var Xd = Yd, Jd = Xd, At = R;
1180
- function fr(e, t, r, n, i) {
1181
- return e === t ? !0 : e == null || t == null || !At(e) && !At(t) ? e !== e && t !== t : Jd(e, t, r, n, fr, i);
1182
- }
1183
- var Zd = fr, Qd = Zd;
1184
- function eh(e, t) {
1185
- return Qd(e, t);
1186
- }
1187
- var th = eh;
1188
- const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", nh = {
1189
- emits: ["optionsLoaded", "createItem", "update:modelValue"],
1190
- props: [
1191
- "modelValue",
1192
- "options",
1193
- "prependOptions",
1194
- "appendOptions",
1195
- "preload",
1196
- "url",
1197
- "urlParams",
1198
- "remoteSearch",
1199
- "searchFields",
1200
- "placeholder",
1201
- "valueKey",
1202
- "idKey",
1203
- "titleKey",
1204
- "titleFormatter",
1205
- "subtitleKey",
1206
- "subtitleFormatter",
1207
- "nullTitle",
1208
- "noResultsText",
1209
- "disabled",
1210
- "optionsListId",
1211
- "debug"
1212
- ],
320
+ const O = Symbol("null"), ne = Symbol("create"), dt = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", ut = {
321
+ props: {
322
+ modelValue: {
323
+ type: null,
324
+ default: null
325
+ },
326
+ loadOptions: Function,
327
+ options: Object,
328
+ prependOptions: Object,
329
+ appendOptions: Object,
330
+ onCreateItem: Function,
331
+ preload: Boolean,
332
+ remoteSearch: Boolean,
333
+ searchFields: Object,
334
+ placeholder: String,
335
+ keyExtractor: Function,
336
+ valueExtractor: Function,
337
+ formatter: {
338
+ type: Function,
339
+ required: !0
340
+ },
341
+ subtitleFormatter: Function,
342
+ nullTitle: String,
343
+ noResultsText: String,
344
+ disabled: Boolean,
345
+ optionsListId: String,
346
+ debug: Boolean
347
+ },
348
+ emits: {
349
+ optionsLoaded: Object,
350
+ createItem: Object,
351
+ "update:modelValue": Object
352
+ },
1213
353
  data() {
1214
354
  return {
355
+ isLoading: !1,
1215
356
  isLoaded: !1,
1216
357
  loadedOptions: [],
1217
358
  isSearching: !1,
@@ -1227,56 +368,42 @@ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#
1227
368
  /**
1228
369
  * EFFECTIVE PROPS
1229
370
  */
1230
- effectiveDisabled() {
1231
- return this.disabled || !this.loadedOptions;
371
+ effectivePrependOptions() {
372
+ return this.prependOptions ?? [];
1232
373
  },
1233
- effectivePlaceholder() {
1234
- return !this.isLoaded && this.$isPropTruthy(this.preload) ? "Loading..." : this.nullTitle ? this.nullTitle : this.placeholder || "";
374
+ effectiveAppendOptions() {
375
+ return this.appendOptions ?? [];
1235
376
  },
1236
- effectiveIdKey() {
1237
- return this.idKey || "id";
1238
- },
1239
- effectiveTitleKey() {
1240
- return this.titleKey || "name";
377
+ effectiveDisabled() {
378
+ return !!this.disabled;
1241
379
  },
1242
- effectiveValueKey() {
1243
- if (this.valueKey)
1244
- return this.valueKey;
1245
- if (this.options && !Array.isArray(this.options))
1246
- return this.effectiveIdKey;
380
+ effectivePlaceholder() {
381
+ return !this.isLoaded && this.preload ? "Loading..." : this.nullTitle ? this.nullTitle : this.placeholder || "";
1247
382
  },
1248
383
  effectiveNoResultsText() {
1249
384
  return this.noResultsText || "No options match your search.";
1250
385
  },
1251
- effectiveRemoteSearch() {
1252
- return this.$isPropTruthy(this.remoteSearch);
386
+ effectiveKeyExtractor() {
387
+ return this.keyExtractor ?? this.valueExtractor;
1253
388
  },
1254
389
  /**
1255
390
  * OPTIONS GENERATION
1256
391
  */
1257
- loadedOptionsArray() {
1258
- return this.arrayifyOptions(this.loadedOptions);
1259
- },
1260
- prependOptionsArray() {
1261
- return this.prependOptions ? this.arrayifyOptions(this.prependOptions) : [];
1262
- },
1263
- appendOptionsArray() {
1264
- return this.appendOptions ? this.arrayifyOptions(this.appendOptions) : [];
1265
- },
1266
- fullOptionsArray() {
1267
- return [...this.prependOptionsArray, ...this.loadedOptionsArray, ...this.appendOptionsArray];
392
+ allOptions() {
393
+ return [...this.effectivePrependOptions, ...this.loadedOptions, ...this.effectiveAppendOptions];
1268
394
  },
1269
395
  optionsDescriptors() {
1270
- return this.fullOptionsArray.map((e, t) => {
1271
- const r = this.getOptionTitle(e), n = this.getOptionSubtitle(e), i = r ? r.text.trim().toLowerCase() : "", a = n ? n.text.trim().toLowerCase() : "";
1272
- let s = [];
1273
- return this.searchFields ? this.searchFields.forEach((o) => {
1274
- e[o] && s.push(String(e[o]).toLowerCase());
1275
- }) : (s.push(i), a && s.push(a)), {
1276
- key: typeof e == "object" ? e[this.effectiveIdKey] || t : e,
1277
- titleHtml: r.html,
1278
- subtitleHtml: n == null ? void 0 : n.html,
1279
- searchContent: s.join(""),
396
+ return this.allOptions.map((e, t) => {
397
+ var r, c;
398
+ const n = this.formatter(e), i = (r = this.subtitleFormatter) == null ? void 0 : r.call(this, e), s = n ? n.trim().toLowerCase() : "", o = i ? i.trim().toLowerCase() : "", l = [];
399
+ return this.searchFields ? this.searchFields.forEach((p) => {
400
+ e[p] && l.push(String(e[p]).toLowerCase());
401
+ }) : (l.push(s), o && l.push(o)), {
402
+ // eslint-disable-next-line vue/no-use-computed-property-like-method
403
+ key: ((c = this.effectiveKeyExtractor) == null ? void 0 : c.call(this, e)) ?? String(t),
404
+ title: n,
405
+ subtitle: i,
406
+ searchContent: l.join(""),
1280
407
  ref: e
1281
408
  };
1282
409
  });
@@ -1286,17 +413,24 @@ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#
1286
413
  if (this.isSearching) {
1287
414
  const t = this.searchText.trim().toLowerCase();
1288
415
  if (t.length) {
1289
- e = e.filter((i) => i.searchContent.includes(t));
1290
- const r = this.searchText.escapeHtml().replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), n = new RegExp(`(${r})`, "ig");
1291
- e = e.map((i) => (i = { ...i }, i.titleHtml = i.titleHtml.replace(n, "<mark>$1</mark>"), i.subtitleHtml && (i.subtitleHtml = i.subtitleHtml.replace(n, "<mark>$1</mark>")), i)), this.shouldShowCreateOption && (e.find((a) => a.searchContent === t) !== void 0 || e.push({
1292
- key: Ct,
1293
- titleHtml: "Create <strong>" + this.searchText.trim() + "</strong>..."
416
+ e = e.filter((s) => s.searchContent.includes(t));
417
+ const n = qe(this.searchText).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), i = new RegExp(`(${n})`, "ig");
418
+ e = e.map((s) => {
419
+ var o;
420
+ return {
421
+ ...s,
422
+ title: s.title.replace(i, "<mark>$1</mark>"),
423
+ subtitle: (o = s.subtitle) == null ? void 0 : o.replace(i, "<mark>$1</mark>")
424
+ };
425
+ }), this.shouldShowCreateOption && (e.find((o) => o.searchContent === t) !== void 0 || e.push({
426
+ key: ne,
427
+ title: "Create <strong>" + this.searchText.trim() + "</strong>..."
1294
428
  }));
1295
429
  }
1296
430
  } else
1297
431
  this.nullTitle && e.unshift({
1298
- key: Oe,
1299
- titleHtml: this.nullTitle
432
+ key: O,
433
+ title: this.nullTitle
1300
434
  });
1301
435
  return e;
1302
436
  }
@@ -1307,52 +441,44 @@ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#
1307
441
  this.handleValueChanged();
1308
442
  },
1309
443
  options() {
1310
- this.loadedOptions = this.options;
1311
- },
1312
- url() {
1313
- console.log("url changed"), this.handleSourceUpdate();
1314
- },
1315
- // we should probably solve this more consistently across the board,
1316
- // but for now: urlParams may be a hardcoded object in the parent, so
1317
- // on re-render, a new object literal may be created, which is *technically*
1318
- // a change that will fire this
1319
- urlParams(e, t) {
1320
- th(t, e) || this.handleSourceUpdate();
444
+ this.loadedOptions = this.options ?? [];
1321
445
  },
1322
446
  // data
1323
447
  optionsDescriptors() {
1324
448
  this.shouldDisplayOptions && setTimeout(this.highlightInitialOption, 0);
1325
449
  },
1326
450
  searchText() {
1327
- this.isSearching && !this.effectiveRemoteSearch && !this.searchText.trim().length && (this.isSearching = !1);
451
+ this.isSearching && !this.remoteSearch && !this.searchText.trim().length && (this.isSearching = !1);
1328
452
  },
1329
453
  shouldDisplayOptions() {
1330
- this.shouldDisplayOptions ? setTimeout(this.handleOptionsDisplayed, 0) : (this.isSearching = !1, this.searchText = this.selectedOptionTitle || "");
454
+ this.shouldDisplayOptions ? setTimeout(this.handleOptionsDisplayed, 0) : (this.isSearching = !1, this.searchText = this.selectedOptionTitle || "", this.$refs.optionsContainer && (this.$refs.optionsContainer.style.visibility = "hidden"));
1331
455
  },
1332
456
  effectiveOptions() {
1333
- (!this.highlightedOptionKey || !this.effectiveOptions.find((e) => e.key == this.highlightedOptionKey)) && (this.highlightedOptionKey = this.effectiveOptions.length ? this.effectiveOptions[0].key : null);
457
+ var e;
458
+ 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) ?? O);
1334
459
  }
1335
460
  },
1336
461
  async mounted() {
1337
- this.shouldShowCreateOption = this.$attrs.onCreateItem !== void 0, this.options ? (this.loadedOptions = this.options, this.isLoaded = !0) : this.$isPropTruthy(this.preload) && await this.loadRemoteOptions(), this.handleValueChanged(), this.$watch("selectedOption", () => {
1338
- const e = this.selectedOption && this.effectiveValueKey ? this.selectedOption[this.effectiveValueKey] : this.selectedOption;
1339
- e !== this.modelValue && this.$emit("update:modelValue", e);
1340
- }), this.effectiveRemoteSearch && this.$watch("searchText", Yf(this.reloadOptionsIfSearching, 250));
462
+ this.shouldShowCreateOption = this.$attrs.onCreateItem !== void 0, this.options ? (this.loadedOptions = this.options, this.isLoaded = !0) : this.preload && await this.loadRemoteOptions(), this.handleValueChanged(), this.$watch("selectedOption", () => {
463
+ this.selectedOption !== this.modelValue && this.$emit(
464
+ "update:modelValue",
465
+ this.selectedOption && this.valueExtractor ? this.valueExtractor(this.selectedOption) : this.selectedOption
466
+ );
467
+ }), this.remoteSearch && this.$watch("searchText", Ke(this.reloadOptionsIfSearching, 250));
1341
468
  },
1342
469
  methods: {
1343
470
  async loadRemoteOptions() {
1344
- await this.reloadOptions(), this.$emit("optionsLoaded", this.loadedOptions);
471
+ await this.reloadOptions(), this.loadedOptions && this.$emit("optionsLoaded", this.loadedOptions);
1345
472
  },
1346
473
  handleSourceUpdate() {
1347
- if (console.log("source updated"), this.preload)
474
+ if (this.preload)
1348
475
  return this.reloadOptions();
1349
476
  this.isLoaded && (this.isLoaded = !1, this.loadedOptions = []);
1350
477
  },
1351
478
  async reloadOptions() {
1352
- let e = {};
1353
- this.urlParams && Object.assign(e, this.urlParams), this.effectiveRemoteSearch && this.isSearching && this.searchText && (e.q = this.searchText);
1354
- const t = await this.$http.get(this.url, { params: e });
1355
- this.loadedOptions = t.data, this.isLoaded = !0;
479
+ var t;
480
+ const e = this.remoteSearch && this.isSearching && this.searchText ? this.searchText : null;
481
+ this.isLoading = !0, this.loadedOptions = await ((t = this.loadOptions) == null ? void 0 : t.call(this, e)) ?? [], this.isLoading = !1, this.isLoaded = !0;
1356
482
  },
1357
483
  reloadOptionsIfSearching() {
1358
484
  this.isSearching && (this.reloadOptions(), this.isSearching = this.searchText.trim().length > 0);
@@ -1372,12 +498,10 @@ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#
1372
498
  if (e.key == "PageUp" || e.key == "PageDown")
1373
499
  return e.preventDefault(), this.incrementHighlightedOption(e.key == "PageUp" ? -10 : 10);
1374
500
  if (e.key == "Home" || e.key == "End")
1375
- return e.preventDefault(), this.incrementHighlightedOption(
1376
- e.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER
1377
- );
501
+ return e.preventDefault(), this.incrementHighlightedOption(e.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
1378
502
  if (e.key == "Enter") {
1379
503
  e.preventDefault();
1380
- const t = this.effectiveOptions.find((r) => r.key == this.highlightedOptionKey);
504
+ const t = this.effectiveOptions.find((n) => n.key == this.highlightedOptionKey);
1381
505
  if (t)
1382
506
  return this.selectOption(t);
1383
507
  }
@@ -1385,745 +509,621 @@ const Oe = Symbol(null), Ct = Symbol("create"), rh = "`1234567890-=[]\\;',./~!@#
1385
509
  this.searchText.length > 1 && (this.isSearching = !0);
1386
510
  return;
1387
511
  }
1388
- !e.metaKey && rh.includes(e.key) && (this.isSearching = !0);
512
+ !e.metaKey && dt.includes(e.key) && (this.isSearching = !0);
1389
513
  }
1390
514
  },
1391
515
  handleInputFocused() {
1392
- this.selectedOption ? this.highlightedOptionKey = typeof this.selectedOption == "object" && this.selectedOption !== null ? this.selectedOption[this.effectiveIdKey] : this.selectedOption : this.nullTitle && (this.highlightedOptionKey = Oe), this.shouldDisplayOptions = !0;
516
+ this.setHighlightedOptionKey(), this.shouldDisplayOptions = !0;
517
+ },
518
+ setHighlightedOptionKey(e) {
519
+ var t;
520
+ this.selectedOption ? this.highlightedOptionKey = this.getOptionKey(this.selectedOption) : e ? this.highlightedOptionKey = ((t = this.effectiveOptions) == null ? void 0 : t[0].key) ?? O : this.nullTitle && (this.highlightedOptionKey = O);
521
+ },
522
+ getOptionKey(e) {
523
+ var t;
524
+ return this.effectiveKeyExtractor ? this.effectiveKeyExtractor(this.selectedOption) : ((t = this.getOptionDescriptor(e)) == null ? void 0 : t.key) ?? "";
525
+ },
526
+ getOptionDescriptor(e) {
527
+ const t = this.effectiveOptions.find((i) => i.ref === e);
528
+ if (t)
529
+ return t;
530
+ const n = this.effectiveOptions.find((i) => ge(i.ref, e));
531
+ return n || null;
1393
532
  },
1394
533
  handleInputBlurred() {
1395
- this.$isPropTruthy(this.debug) || (!this.searchText.length && this.nullTitle && (this.selectedOption = null, this.selectedOptionTitle = null), this.shouldDisplayOptions = !1);
534
+ this.debug || (!this.searchText.length && this.nullTitle && (this.selectedOption = null, this.selectedOptionTitle = null), this.shouldDisplayOptions = !1);
1396
535
  },
1397
536
  handleOptionsDisplayed() {
1398
- this.isLoaded || this.loadRemoteOptions(), this.teleportOptionsContainer(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId);
537
+ this.isLoaded || this.loadRemoteOptions(), this.optionsListId && this.$refs.optionsContainer.setAttribute("id", this.optionsListId), this.teleportOptionsContainer();
1399
538
  },
1400
539
  teleportOptionsContainer() {
1401
- const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, r = e.x, n = this.$refs.optionsContainer, i = window.getComputedStyle(this.$el);
1402
- for (let a in i)
1403
- /^(font|text)/.test(a) && (n.style[a] = i[a]);
1404
- if (n.style.top = t + "px", n.style.left = r + "px", n.style.minWidth = e.width + "px", !i.maxHeight || i.maxHeight == "none") {
1405
- const a = window.innerHeight - t - 12;
1406
- n.style.maxHeight = a + "px";
540
+ const e = this.$el.getBoundingClientRect(), t = e.y + e.height + 2, n = e.x, i = this.$refs.optionsContainer, s = window.getComputedStyle(this.$el);
541
+ for (let o in s)
542
+ /^(font|text)/.test(o) && (i.style[o] = s[o]);
543
+ if (i.style.top = t + "px", i.style.left = n + "px", i.style.minWidth = e.width + "px", !s.maxHeight || s.maxHeight == "none") {
544
+ const o = window.innerHeight - t - 12;
545
+ i.style.maxHeight = o + "px";
1407
546
  }
1408
- document.body.appendChild(n), setTimeout(this.highlightInitialOption, 0);
547
+ i.style.visibility = "visible", document.body.appendChild(i), setTimeout(this.highlightInitialOption, 0);
1409
548
  },
1410
549
  highlightInitialOption() {
1411
550
  if (!this.isLoaded || !this.highlightedOptionKey)
1412
551
  return;
1413
- const e = this.effectiveOptions.findIndex(
1414
- (n) => n.key == this.highlightedOptionKey
1415
- ), t = this.$refs.optionsContainer, r = t.querySelectorAll(".option")[e];
1416
- t.scrollTop = r.offsetTop;
552
+ const e = this.effectiveOptions.findIndex((i) => i.key == this.highlightedOptionKey), t = this.$refs.optionsContainer, n = t.querySelectorAll(".option")[e];
553
+ t.scrollTop = n.offsetTop;
1417
554
  },
1418
555
  handleOptionHover(e) {
1419
556
  this.highlightedOptionKey = e ? e.key : null;
1420
557
  },
1421
558
  incrementHighlightedOption(e) {
1422
- const t = this.effectiveOptions.findIndex(
1423
- (a) => a.key == this.highlightedOptionKey
1424
- );
1425
- let r = t + e;
1426
- if (r < 0 ? r = 0 : r >= this.effectiveOptions.length && (r = this.effectiveOptions.length - 1), t == r)
559
+ const t = this.effectiveOptions.findIndex((o) => o.key == this.highlightedOptionKey);
560
+ let n = t + e;
561
+ if (n < 0 ? n = 0 : n >= this.effectiveOptions.length && (n = this.effectiveOptions.length - 1), t == n)
1427
562
  return;
1428
- this.highlightedOptionKey = this.effectiveOptions[r].key;
1429
- const n = this.$refs.optionsContainer, i = n.querySelectorAll(".option")[r];
1430
- i.offsetTop < n.scrollTop ? n.scrollTop = i.offsetTop : i.offsetTop + i.offsetHeight > n.scrollTop + n.clientHeight && (n.scrollTop = i.offsetTop + i.offsetHeight - n.clientHeight);
563
+ this.highlightedOptionKey = this.effectiveOptions[n].key;
564
+ const i = this.$refs.optionsContainer, s = i.querySelectorAll(".option")[n];
565
+ s.offsetTop < i.scrollTop ? i.scrollTop = s.offsetTop : s.offsetTop + s.offsetHeight > i.scrollTop + i.clientHeight && (i.scrollTop = s.offsetTop + s.offsetHeight - i.clientHeight);
1431
566
  },
1432
567
  selectOption(e) {
1433
- if (this.isSearching = !1, e.key == Oe)
568
+ if (this.isSearching = !1, e.key == O)
1434
569
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null;
1435
- else if (e.key === Ct) {
570
+ else if (e.key === ne) {
1436
571
  const t = this.searchText.trim();
1437
572
  this.searchText = "", this.selectedOption = null, this.selectedOptionTitle = null, this.$emit("createItem", t);
1438
573
  } else {
1439
- const r = this.optionsDescriptors.find(
1440
- (n) => n.key == e.key
1441
- ).ref;
1442
- this.selectedOption = r, this.selectedOptionTitle = this.getOptionTitle(this.selectedOption).text, this.searchText = this.selectedOptionTitle || "";
574
+ const n = this.optionsDescriptors.find((i) => i.key == e.key).ref;
575
+ this.selectedOption = n, this.selectedOptionTitle = this.formatter(n), this.searchText = this.selectedOptionTitle || "";
1443
576
  }
1444
577
  this.$refs.searchField.blur();
1445
578
  },
1446
579
  handleValueChanged() {
1447
- this.modelValue ? (this.effectiveValueKey ? this.selectedOption = this.fullOptionsArray.find(
1448
- (e) => e[this.effectiveValueKey] === this.modelValue
1449
- ) : this.selectedOption = this.modelValue, this.selectedOptionTitle = this.getOptionTitle(this.selectedOption).text, this.searchText = this.selectedOptionTitle || "") : (this.selectedOption = null, this.selectedOptionTitle = null, this.searchText = "");
1450
- },
1451
- getOptionTitle(e) {
1452
- if (e === null)
1453
- return null;
1454
- if (this.titleFormatter) {
1455
- const r = this.titleFormatter(e);
1456
- return typeof r == "object" ? {
1457
- text: r.text || r.html.replace(/<[^>]+>/g, ""),
1458
- html: r.html
1459
- } : {
1460
- text: r,
1461
- html: r.escapeHtml()
1462
- };
1463
- }
1464
- const t = String(typeof e != "object" ? e : e[this.effectiveTitleKey]);
1465
- return { text: t, html: t.escapeHtml() };
1466
- },
1467
- getOptionSubtitle(e) {
1468
- if (e === null)
1469
- return null;
1470
- if (this.subtitleFormatter) {
1471
- const r = this.subtitleFormatter(e);
1472
- return r ? typeof r == "object" ? {
1473
- text: r.text || r.html.replace(/<[^>]+>/g, ""),
1474
- html: r.html
1475
- } : {
1476
- text: r,
1477
- html: r.escapeHtml()
1478
- } : null;
1479
- }
1480
- let t = typeof e != "object" ? null : e[this.subtitleKey];
1481
- return t ? (t = String(t), { text: t, html: t.escapeHtml() }) : null;
580
+ this.modelValue ? (this.selectedOption = this.valueExtractor ? this.allOptions.find((e) => this.modelValue === this.valueExtractor(e)) : this.modelValue, this.selectedOptionTitle = this.selectedOption ? this.formatter(this.selectedOption) : null, this.searchText = this.selectedOptionTitle || "") : (this.selectedOption = null, this.selectedOptionTitle = null, this.searchText = "");
1482
581
  },
1483
582
  addRemoteOption(e) {
1484
583
  this.loadedOptions.push(e);
1485
- },
1486
- arrayifyOptions(e) {
1487
- return Array.isArray(e) ? e : Object.entries(e).map((t) => ({
1488
- [this.effectiveIdKey]: t[0],
1489
- [this.effectiveTitleKey]: t[1]
1490
- }));
1491
584
  }
1492
585
  }
1493
- }, ih = ["placeholder"], ah = {
586
+ };
587
+ const ht = ["placeholder"], ft = {
1494
588
  key: 0,
1495
589
  ref: "optionsContainer",
1496
590
  class: "vf-smart-select-options"
1497
- }, sh = {
591
+ }, pt = {
1498
592
  key: 0,
1499
593
  class: "no-results"
1500
- }, oh = ["onMousemove", "onMousedown"], lh = ["innerHTML"], ch = ["innerHTML"], uh = {
594
+ }, mt = ["onMousemove", "onMousedown"], vt = ["innerHTML"], gt = ["innerHTML"], yt = {
1501
595
  key: 0,
1502
596
  class: "no-results"
1503
597
  };
1504
- function fh(e, t, r, n, i, a) {
1505
- const s = Se("disabled");
1506
- return O(), w("div", {
1507
- class: F(["vf-smart-select", { disabled: a.effectiveDisabled, open: i.shouldDisplayOptions }])
598
+ function Et(e, t, n, i, s, o) {
599
+ const l = pe("disabled");
600
+ return a(), d("div", {
601
+ class: E(["vf-smart-select", { disabled: o.effectiveDisabled, open: e.shouldDisplayOptions }])
1508
602
  }, [
1509
- X(P("input", {
1510
- "onUpdate:modelValue": t[0] || (t[0] = (o) => i.searchText = o),
603
+ H(v("input", {
604
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.searchText = r),
1511
605
  ref: "searchField",
1512
606
  type: "text",
1513
- class: F({ nullable: !!r.nullTitle }),
1514
- onKeydown: t[1] || (t[1] = (...o) => a.handleKeyDown && a.handleKeyDown(...o)),
1515
- placeholder: a.effectivePlaceholder,
1516
- onFocus: t[2] || (t[2] = (...o) => a.handleInputFocused && a.handleInputFocused(...o)),
1517
- onBlur: t[3] || (t[3] = (...o) => a.handleInputBlurred && a.handleInputBlurred(...o))
1518
- }, null, 42, ih), [
1519
- [Sr, i.searchText],
1520
- [s, a.effectiveDisabled]
607
+ class: E({ nullable: !!n.nullTitle }),
608
+ onKeydown: t[1] || (t[1] = (...r) => o.handleKeyDown && o.handleKeyDown(...r)),
609
+ placeholder: o.effectivePlaceholder,
610
+ onFocus: t[2] || (t[2] = (...r) => o.handleInputFocused && o.handleInputFocused(...r)),
611
+ onBlur: t[3] || (t[3] = (...r) => o.handleInputBlurred && o.handleInputBlurred(...r))
612
+ }, null, 42, ht), [
613
+ [_e, e.searchText],
614
+ [l, o.effectiveDisabled]
1521
615
  ]),
1522
- i.shouldDisplayOptions ? (O(), w("div", ah, [
1523
- i.isLoaded ? (O(), w(re, { key: 1 }, [
1524
- (O(!0), w(re, null, Lt(a.effectiveOptions, (o) => (O(), w("div", {
1525
- key: o.key,
1526
- class: F(["option", {
1527
- highlighted: i.highlightedOptionKey === o.key
616
+ e.shouldDisplayOptions ? (a(), d("div", ft, [
617
+ e.isLoaded ? (a(), d($, { key: 1 }, [
618
+ (a(!0), d($, null, W(o.effectiveOptions, (r) => (a(), d("div", {
619
+ key: String(r.key),
620
+ class: E(["option", {
621
+ highlighted: e.highlightedOptionKey === r.key
1528
622
  }]),
1529
- onMousemove: (l) => a.handleOptionHover(o),
1530
- onMousedown: (l) => a.selectOption(o)
623
+ onMousemove: (c) => o.handleOptionHover(r),
624
+ onMousedown: (c) => o.selectOption(r)
1531
625
  }, [
1532
- P("div", {
626
+ v("div", {
1533
627
  class: "title",
1534
- innerHTML: o.titleHtml
1535
- }, null, 8, lh),
1536
- o.subtitleHtml ? (O(), w("div", {
628
+ innerHTML: r.title
629
+ }, null, 8, vt),
630
+ r.subtitle ? (a(), d("div", {
1537
631
  key: 0,
1538
632
  class: "subtitle",
1539
- innerHTML: o.subtitleHtml
1540
- }, null, 8, ch)) : L("", !0)
1541
- ], 42, oh))), 128)),
1542
- !a.effectiveOptions.length && i.searchText ? (O(), w("div", uh, Y(a.effectiveNoResultsText), 1)) : L("", !0)
1543
- ], 64)) : (O(), w("div", sh, "Loading..."))
1544
- ], 512)) : L("", !0)
633
+ innerHTML: r.subtitle
634
+ }, null, 8, gt)) : g("", !0)
635
+ ], 42, mt))), 128)),
636
+ !o.effectiveOptions.length && e.searchText ? (a(), d("div", yt, w(o.effectiveNoResultsText), 1)) : g("", !0)
637
+ ], 64)) : (a(), d("div", pt, "Loading..."))
638
+ ], 512)) : g("", !0)
1545
639
  ], 2);
1546
640
  }
1547
- const dh = /* @__PURE__ */ oe(nh, [["render", fh]]);
1548
- f.component("AjaxSelect", Pr);
1549
- f.component("Alert", bf);
1550
- f.component("Modal", cr);
1551
- f.component("SmartSelect", dh);
1552
- f.directive("autofocus", {
1553
- mounted: xt,
1554
- updated: xt
1555
- });
1556
- function xt(e, t) {
1557
- t.value === void 0 && e.hasAutoFocused || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue || (e.hasAutoFocused = !0, e = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : u(e).find("input:first")[0], setTimeout(() => e.focus(), 10));
1558
- }
1559
- f.directive("confirm-button", {
1560
- mounted(e) {
1561
- e.addEventListener("click", (t) => {
1562
- let r = Date.now();
1563
- if (e._isConfirming) {
1564
- if (r - e._confirmInitTime < 300)
1565
- return;
1566
- e._resetHandler(), e.dispatchEvent(new Event("confirm"));
1567
- return;
641
+ const Tt = /* @__PURE__ */ ye(ut, [["render", Et]]), yn = /* @__PURE__ */ M({
642
+ __name: "ez-smart-select",
643
+ props: {
644
+ modelValue: null,
645
+ nullTitle: null,
646
+ placeholder: null,
647
+ options: null,
648
+ formatter: { type: Function }
649
+ },
650
+ emits: ["update:modelValue"],
651
+ setup(e, { emit: t }) {
652
+ const n = e, i = D(() => Array.isArray(n.options) ? n.options.map((l) => ({ value: l, label: l })) : Object.entries(n.options).map(([l, r]) => ({
653
+ value: l,
654
+ label: r
655
+ }))), s = D(() => n.formatter ? (l) => {
656
+ var r;
657
+ return (r = n.formatter) == null ? void 0 : r.call(n, l.label);
658
+ } : (l) => l.label), o = I(i.value.find((l) => l.value === n.modelValue) ?? null);
659
+ return ee(
660
+ () => n.modelValue,
661
+ (l) => {
662
+ o.value = i.value.find((r) => r.value === l) ?? null;
1568
663
  }
1569
- t.preventDefault(), t.stopImmediatePropagation(), e._resetHandler = () => {
1570
- e.innerHTML = e._preConfirmHTML, e.blur(), e.removeEventListener("mouseout", e._resetHandler), delete e._isConfirming, delete e._preConfirmHTML, delete e._resetHandler;
1571
- }, e._isConfirming = !0, e._confirmInitTime = r, e._preConfirmHTML = e.innerHTML, e.innerHTML = "Confirm", e.addEventListener("mouseout", e._resetHandler);
1572
- });
664
+ ), ee(o, (l) => {
665
+ var r;
666
+ t("update:modelValue", l ? ((r = i.value.find((c) => ge(c, l))) == null ? void 0 : r.value) ?? null : null);
667
+ }), (l, r) => (a(), z(Tt, {
668
+ modelValue: o.value,
669
+ "onUpdate:modelValue": r[0] || (r[0] = (c) => o.value = c),
670
+ options: R(i),
671
+ formatter: R(s),
672
+ "null-title": e.nullTitle
673
+ }, null, 8, ["modelValue", "options", "formatter", "null-title"]));
1573
674
  }
1574
675
  });
1575
- f.directive("datetime", {
1576
- beforeMount: Et,
1577
- updated: Et
676
+ function Ot(e) {
677
+ 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];
678
+ return `${i} ${s}`;
679
+ }
680
+ function bt(e) {
681
+ return e != null && String(e).length ? e : "-";
682
+ }
683
+ function wt(e) {
684
+ return e || "-";
685
+ }
686
+ function St(e) {
687
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : At(Number(e));
688
+ }
689
+ function kt(e) {
690
+ return e && at(e);
691
+ }
692
+ function xt(e) {
693
+ return e ? Re(e) : null;
694
+ }
695
+ function Mt(e) {
696
+ return e ? je(e) : null;
697
+ }
698
+ function Ct(e) {
699
+ return e ? e.toUpperCase() : null;
700
+ }
701
+ function Lt(e) {
702
+ return e ? rt(e) : null;
703
+ }
704
+ function It(e) {
705
+ return ct(e);
706
+ }
707
+ const ie = {
708
+ bytes: Ot,
709
+ dash: bt,
710
+ dashZeros: wt,
711
+ number: St,
712
+ phone: kt,
713
+ upperFirst: xt,
714
+ startCase: Mt,
715
+ upperCase: Ct,
716
+ desnake: Lt,
717
+ usCurrency: It
718
+ }, En = (e) => ({
719
+ ...ie,
720
+ ...e(ie)
1578
721
  });
1579
- function Et(e, t) {
1580
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = hh(e, t));
1581
- }
1582
- function hh(e, t) {
1583
- if (!t.value)
1584
- return e.attributes.placeholder ? e.attributes.placeholder.value : "";
1585
- let r = "", n = e.attributes.local ? k(t.value) : k.utc(t.value);
1586
- e.attributes["display-utc"] || n.local();
1587
- let i = e.attributes.format ? e.attributes.format.value : null;
1588
- if (!i && e.attributes["relative-date"]) {
1589
- let s = k();
1590
- s.year() == n.year() && s.month() == n.month() && s.date() == n.date() && (r = "at", i = "HH:mm");
722
+ function Tn(e, t, n) {
723
+ const i = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
724
+ return i === -1 ? !1 : (e.splice(i, 1, n), !0);
725
+ }
726
+ function On(e, t) {
727
+ const n = document.createElement("div");
728
+ n.classList.add("vf-overlay"), n.addEventListener("click", T), document.body.appendChild(n);
729
+ const i = document.createElement("div");
730
+ i.classList.add("vf-context-menu"), i.style.position = "absolute", n.appendChild(i);
731
+ const s = e.currentTarget;
732
+ 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((u) => {
733
+ if (u == "-") {
734
+ const L = document.createElement("div");
735
+ L.classList.add("separator"), i.appendChild(L);
736
+ return;
737
+ }
738
+ const m = document.createElement("div");
739
+ m.classList.add("item"), m.style.userSelect = "none", m.innerText = u.title, i.appendChild(m), u.class && m.classList.add(u.class), u.shouldConfirm ? m.addEventListener("click", () => u.handler()) : m.addEventListener("click", () => Ce(m, u.handler));
740
+ });
741
+ const o = window.innerWidth - e.clientX, l = window.innerHeight - e.clientY, r = i.offsetHeight, c = i.offsetWidth, p = o < c ? e.clientX - c - 1 : e.clientX + 1, h = l < r ? e.clientY - r - 1 : e.clientY + 1;
742
+ i.style.left = p + "px", i.style.top = h + "px", setTimeout(() => {
743
+ i.style.width = i.offsetWidth + "px";
744
+ }, 50);
745
+ function T() {
746
+ t.targetClass && s.classList.remove(t.targetClass), s.classList.remove("context-menu-active"), s.style.userSelect = "", n.remove();
747
+ }
748
+ function Ce(u, m) {
749
+ if (u.classList.contains("pending-confirm"))
750
+ return m();
751
+ const L = u.innerHTML;
752
+ u.classList.add("pending-confirm"), u.innerText = "Confirm";
753
+ const Q = () => {
754
+ u.classList.remove("pending-confirm"), u.innerHTML = L, u.removeEventListener("mouseleave", Q);
755
+ };
756
+ u.addEventListener("mouseleave", Q), e.stopPropagation();
1591
757
  }
1592
- i || (i = "MM/DD/YY HH:mm");
1593
- let a = n.format(i);
1594
- return r && (a = r + " " + a), a;
1595
758
  }
1596
- f.directive("date-input", {
1597
- beforeMount: ph
1598
- });
1599
- function ph(e) {
1600
- e.addEventListener("blur", () => {
1601
- let t = e.value;
1602
- /^[0-9]{1,2}\/[0-9]{1,2}$/.test(t) && (t += "/" + k().format("YY"));
1603
- let r = Date.parse(t);
1604
- isNaN(r) ? e.value = "" : e.value = k(r).format("MM/DD/YYYY"), e.dispatchEvent(new Event("input"));
1605
- });
759
+ const Dt = (e) => new Promise((t) => setTimeout(t, e)), bn = (e) => Dt(e * 1e3), S = Symbol("MaskState");
760
+ function wn(e, t) {
761
+ const n = e.$.vnode.el, i = n.closest(".vf-modal");
762
+ return Ht(i ?? n, t);
1606
763
  }
1607
- f.directive("disabled", {
1608
- beforeMount: It,
1609
- updated: It,
1610
- unmounted: vh
1611
- });
1612
- function It(e, t) {
1613
- e.tagName == "LABEL" && (u(e).toggleClass("disabled", !!t.value), e = u(e).find("input")[0]), t.value ? u(e).attr("disabled", "disabled") : u(e).removeAttr("disabled");
764
+ function Sn(e) {
765
+ const t = e.$.vnode.el, n = t.closest(".vf-modal");
766
+ return be(n ?? t);
767
+ }
768
+ function Ht(e, t) {
769
+ if (!e[S]) {
770
+ const n = document.createElement("div");
771
+ n.classList.add("vf-mask"), e.appendChild(n), e[S] = { maskEl: n };
772
+ }
773
+ return e[S].maskEl.innerText = t ?? "", () => be(e);
774
+ }
775
+ function be(e) {
776
+ e[S] && e.removeChild(e[S].maskEl);
777
+ }
778
+ const P = Symbol("FormMaskState");
779
+ function kn(e, t, n) {
780
+ const i = e instanceof Element ? e : we(e);
781
+ i.classList.add("vf-masked");
782
+ const s = t instanceof Element ? t : i.querySelectorAll(t ?? "button:not([disabled])")[0], o = s.tagName === "INPUT" ? s.value : s.innerText;
783
+ s.setAttribute("disabled", "disabled"), s.innerText = n ?? "Please wait...";
784
+ const r = [...i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
785
+ return r.forEach((c) => c.setAttribute("disabled", "disabled")), i[P] = {
786
+ disabledElements: r,
787
+ waitButton: s,
788
+ buttonText: o
789
+ }, () => $t(i);
790
+ }
791
+ function $t(e) {
792
+ const t = e instanceof Element ? e : we(e), n = t[P];
793
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((i) => i.removeAttribute("disabled")), n.waitButton.innerText = n.buttonText, n.waitButton.removeAttribute("disabled"), delete t[P]);
794
+ }
795
+ function we(e) {
796
+ const t = e.$.vnode.el;
797
+ return t.tagName === "FORM" ? t : t.querySelector("form");
798
+ }
799
+ function At(e) {
800
+ return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
801
+ }
802
+ function xn(e, t) {
803
+ return e != null ? Pe(e) : t;
804
+ }
805
+ function Mn(e, t) {
806
+ const n = { ...e };
807
+ for (const i of t)
808
+ n[i] === "" && (n[i] = null);
809
+ return n;
1614
810
  }
1615
- function vh(e) {
1616
- e.tagName == "LABEL" && (u(e).removeClass("disabled"), e = u(e).find("input")[0]), u(e).removeAttr("disabled");
811
+ function Bt(e) {
812
+ return e instanceof Error && "status" in e && "body" in e;
813
+ }
814
+ function Cn({ apiClient: e, onRequest: t, onError: n, CancelablePromise: i }) {
815
+ const s = e.request.request.bind(e.request);
816
+ e.request.request = (o) => (t && (o = t(o)), new i((l, r, c) => {
817
+ const p = s(o);
818
+ c(p.cancel), p.then(l).catch((h) => {
819
+ if (Bt(h) && typeof h.body == "object" && "error" in h.body && h.status === 422)
820
+ return r(new B(h.body.error));
821
+ if (n) {
822
+ const T = n(h, o);
823
+ if (T === null)
824
+ return;
825
+ if (T instanceof Error)
826
+ return r(T);
827
+ }
828
+ r(h);
829
+ });
830
+ }));
1617
831
  }
1618
- let Re = [];
1619
- function gh() {
1620
- Re.forEach(dr);
832
+ const Z = Symbol("HookState");
833
+ function Vt(e, t) {
834
+ const n = t ?? fe();
835
+ q(() => Ft(n, e), n), me(() => Nt(n), n), ve(() => se(n), n), U(() => se(n), n);
1621
836
  }
1622
- setInterval(gh, 1e3);
1623
- f.directive("duration", {
1624
- beforeMount: jt,
1625
- updated: jt,
1626
- unmounted: hr
1627
- });
1628
- function jt(e, t) {
1629
- if (t.value == t.oldValue)
1630
- return;
1631
- if (!t.value)
1632
- return hr(e);
1633
- e.$includeSeconds = typeof e.attributes["no-seconds"] > "u";
1634
- let r = e.attributes["base-time"];
1635
- r ? e.$startTs = k(r.value).valueOf() - t.value * 1e3 : e.$startTs = k(t.value).valueOf(), e.$isConfigured || (e.$isConfigured = !0, Re.push(e)), dr(e);
1636
- }
1637
- function dr(e) {
1638
- let t = e.$startTs, r = Math.round((Date.now() - t) / 1e3);
1639
- e.innerText = yh(r, e.$includeSeconds === !1);
1640
- }
1641
- function hr(e) {
1642
- e.$isConfigured && (Re.remove(e), e.$isConfigured = !1), e.innerText = "-";
1643
- }
1644
- function yh(e, t) {
1645
- let r = [], n = Math.floor(e / 86400);
1646
- n && r.push(n + "d"), e -= n * 86400;
1647
- let i = Math.floor(e / 3600);
1648
- (n || i) && r.push(i + "h"), e -= i * 3600;
1649
- let a = Math.floor(e / 60);
1650
- return (n || i || a) && r.push(a + "m"), t ? r.length || r.push("0m") : (e -= a * 60, r.push(e + "s")), r.join(" ");
1651
- }
1652
- class te {
1653
- constructor(t, r) {
1654
- this.el = t, this.handler = r, this.isTripped = !1, this.onScroll = this._onScroll.bind(this);
837
+ function Ft(e, t) {
838
+ const n = {};
839
+ if (t.elScrolledToBottom && (n.el = new K(e.vnode.el, t.elScrolledToBottom), n.el.install()), t.ancestorScrolledToBottom) {
840
+ const i = Se(e.vnode.el);
841
+ i ? (n.ancestor = new K(i, t.ancestorScrolledToBottom), n.ancestor.install()) : console.warn("no scollable ancestor found for component:", e);
842
+ }
843
+ t.windowScrolledToBottom && (n.window = new K(window, t.windowScrolledToBottom), n.window.install()), e[Z] = n;
844
+ }
845
+ function Nt(e) {
846
+ var n, i, s;
847
+ const t = e[Z];
848
+ (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();
849
+ }
850
+ function se(e) {
851
+ var n, i, s;
852
+ const t = e[Z];
853
+ (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();
854
+ }
855
+ const _ = ["auto", "scroll"];
856
+ function Se(e) {
857
+ const t = e.parentElement;
858
+ if (!t)
859
+ return null;
860
+ const n = window.getComputedStyle(t);
861
+ return _.includes(n.overflow) || _.includes(n.overflowX) || _.includes(n.overflowY) ? t : Se(t);
862
+ }
863
+ class K {
864
+ constructor(t, n) {
865
+ f(this, "isTripped", !1);
866
+ f(this, "onScrollWithContext", this.onScroll.bind(this));
867
+ this.el = t, this.handler = n;
1655
868
  }
1656
869
  install() {
1657
- this.el.addEventListener("scroll", this.onScroll);
870
+ this.el.addEventListener("scroll", this.onScrollWithContext);
1658
871
  }
1659
872
  uninstall() {
1660
- this.el.removeEventListener("scroll", this.onScroll);
873
+ this.el.removeEventListener("scroll", this.onScrollWithContext);
1661
874
  }
1662
- _onScroll(t) {
875
+ onScroll(t) {
1663
876
  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);
1664
877
  }
1665
878
  }
1666
- f.directive("infinite-scroll", {
1667
- beforeMount(e, t) {
1668
- t.value && (e._infiniteScrollHook = new te(e, t.value), e._infiniteScrollHook.install());
1669
- },
1670
- unmounted(e) {
1671
- e._infiniteScrollHook && e._infiniteScrollHook.uninstall();
1672
- }
1673
- });
1674
- f.directive("readonly", {
1675
- beforeMount: Pt,
1676
- updated: Pt
1677
- });
1678
- function Pt(e, t) {
1679
- e.tagName == "LABEL" && (e = u(e).find("input")[0]), t.value ? u(e).attr("readonly", "readonly") : u(e).removeAttr("readonly");
879
+ function Ln(e) {
880
+ q(() => window.addEventListener("resize", e)), me(() => window.addEventListener("resize", e)), ve(() => window.removeEventListener("resize", e)), U(() => window.removeEventListener("resize", e));
1680
881
  }
1681
- f.directive("tip", {
1682
- mounted: Ht,
1683
- updated: Ht,
1684
- unmounted: mh
1685
- });
1686
- function Ht(e, t) {
1687
- let r = e.attributes.tip ? e.attributes.tip.value : t.value;
1688
- if (t.value === !1 && (r = null), r) {
1689
- let n = {};
1690
- n[t.modifiers.html ? "html" : "text"] = r, e.attributes["tip-class"] && (n.class = e.attributes["tip-class"].value), u(e).vfTooltip(n);
1691
- } else
1692
- u(e).vfTooltip("destroy");
1693
- }
1694
- function mh(e) {
1695
- u(e).vfTooltip("destroy");
1696
- }
1697
- u.fn.vfTooltip = function(e) {
1698
- return this.each(function(t, r) {
1699
- var n = u(r).data("vf-tooltip");
1700
- if (typeof e == "string") {
1701
- if (!n)
882
+ const _t = {
883
+ mounted: le,
884
+ updated: le
885
+ }, oe = Symbol("HasAutoFocused");
886
+ function le(e, t) {
887
+ if (t.value === void 0 && e[oe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue)
888
+ return;
889
+ e[oe] = !0;
890
+ const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
891
+ setTimeout(() => n.focus(), 10);
892
+ }
893
+ const Kt = {
894
+ mounted: Rt
895
+ }, b = Symbol("ConfirmState");
896
+ function Rt(e) {
897
+ e.addEventListener("click", (t) => {
898
+ const n = Date.now();
899
+ if (e[b]) {
900
+ if (n - e[b].initTime < 300)
1702
901
  return;
1703
- n[e]();
1704
- } else if (n)
1705
- n.configure(e);
1706
- else {
1707
- var i = new $h(r, e);
1708
- u(r).data("vf-tooltip", i);
902
+ e[b].resetHandler(), e.dispatchEvent(new Event("confirm"));
903
+ return;
1709
904
  }
905
+ t.preventDefault(), t.stopImmediatePropagation();
906
+ const i = {
907
+ initTime: n,
908
+ preconfirmHtml: e.innerHTML,
909
+ resetHandler: () => {
910
+ e.innerHTML = i.preconfirmHtml, e.blur(), e.removeEventListener("mouseout", i.resetHandler), delete e[b];
911
+ }
912
+ };
913
+ e[b] = i, e.innerHTML = "Confirm", e.addEventListener("mouseout", i.resetHandler);
1710
914
  });
915
+ }
916
+ const jt = {
917
+ beforeMount: Pt
1711
918
  };
1712
- function $h(e, t) {
1713
- this.configure = l, this.destroy = S;
1714
- var r, n, i, a, s = !1;
1715
- this.configure(t);
1716
- var o = u(e);
1717
- o.on("mouseenter", c), o.on("mouseleave", b), n.now && c(n.now);
1718
- function l(g) {
1719
- n = u.extend(
1720
- {
1721
- delay: 0
1722
- },
1723
- g
1724
- );
1725
- }
1726
- function c(g) {
1727
- s || (s = !0, setTimeout(function() {
1728
- s && (d(), n.static ? v() : T(g), r.show());
1729
- }, n.delay));
1730
- }
1731
- function b() {
1732
- s = !1, h();
1733
- }
1734
- function d() {
1735
- r ? r.remove() : n.static || u(window).on("mousemove", T), r = u('<div class="vf-tooltip">').css("position", "absolute").css("z-index", "1000000").addClass(n.class).appendTo(document.body), n.title && u('<div class="title">').text(n.title).appendTo(r);
1736
- var g = u('<div class="content">').appendTo(r);
1737
- n.callback ? n.callback(g[0]) : n.text ? g.text(n.text).html(g.html().replace(/\n/g, "<br>")) : n.html && g.html(n.html), n.static ? r.mouseover(function() {
1738
- s = !0;
1739
- }).mouseout(function() {
1740
- s = !1, h();
1741
- }) : a = setInterval(_, 250);
1742
- }
1743
- function h() {
1744
- n.static ? setTimeout(p, 50) : p();
1745
- }
1746
- function p() {
1747
- s || r && (r.remove(), r = null, clearInterval(a), n.static || u(window).off("mousemove", T));
1748
- }
1749
- function v() {
1750
- var g = o.position(), I = r.height(), x = o.outerWidth(!0), A = g.left, m = g.top - I - 1;
1751
- m - 2 < 0 && (m = g.top + o.outerHeight(!0) + 1), r.css("min-width", x + "px").css("left", A + "px").css("top", m + "px");
1752
- }
1753
- function T(g) {
1754
- var I = r.outerWidth(), x = r.outerHeight(), A = window.innerWidth, m = window.innerHeight, C = g.pageX + 10, j = g.pageY + 20;
1755
- C + I > A && (C = g.pageX - 5 - I), j + x > m && (j = g.pageY - 5 - x), r.css("left", C + "px").css("top", j + "px"), i = g;
1756
- }
1757
- function _() {
1758
- i && e != i.target && !u.contains(e, i.target) && b();
1759
- }
1760
- function S() {
1761
- s = !1, p(), o.off("mouseenter", c), o.off("mouseleave", b), o.removeData("vf-tooltip");
1762
- }
919
+ function Pt(e) {
920
+ e.addEventListener("blur", () => {
921
+ let t = e.value;
922
+ /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + j(/* @__PURE__ */ new Date(), "yy"));
923
+ const n = Date.parse(t);
924
+ isNaN(n) ? e.value = "" : e.value = j(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
925
+ });
1763
926
  }
1764
- f.directive("user-text", {
1765
- beforeMount: Mt,
1766
- updated: Mt
1767
- });
1768
- function Mt(e, t) {
1769
- t.value != t.oldValue && (e.innerHTML = t.value.escapeHtml().nl2br());
1770
- }
1771
- Object.defineProperty(Array.prototype, "diff", {
1772
- enumerable: !1,
1773
- value: function(...e) {
1774
- return this.filter((t) => {
1775
- for (let r = 0; r < e.length; r++)
1776
- if (e[r].includes(t))
1777
- return !1;
1778
- return !0;
1779
- });
1780
- }
1781
- });
1782
- Object.defineProperty(Array.prototype, "first", {
1783
- enumerable: !1,
1784
- value: function() {
1785
- return this[0] || void 0;
1786
- }
1787
- });
1788
- Object.defineProperty(Array.prototype, "intersect", {
1789
- enumerable: !1,
1790
- value: function(...e) {
1791
- return this.filter((t) => {
1792
- for (let r = 0; r < e.length; r++)
1793
- if (e[r].includes(t))
1794
- return !0;
1795
- return !1;
1796
- });
1797
- }
1798
- });
1799
- Object.defineProperty(Array.prototype, "keyBy", {
1800
- enumerable: !1,
1801
- value: function(e) {
1802
- let t = {};
1803
- return this.forEach((r) => {
1804
- t[r[e]] = r;
1805
- }), t;
1806
- }
1807
- });
1808
- Object.defineProperty(Array.prototype, "last", {
1809
- enumerable: !1,
1810
- value: function() {
1811
- return this.length ? this[this.length - 1] : void 0;
1812
- }
1813
- });
1814
- Object.defineProperty(Array.prototype, "pluck", {
1815
- enumerable: !1,
1816
- value: function(e, t) {
1817
- if (typeof t > "u")
1818
- return this.map((n) => n[e]);
1819
- let r = {};
1820
- return this.forEach((n) => {
1821
- r[n[t]] = n[e];
1822
- }), r;
1823
- }
1824
- });
1825
- Object.defineProperty(Array.prototype, "remove", {
1826
- enumerable: !1,
1827
- value: function(e) {
1828
- const t = this.indexOf(e);
1829
- t > -1 && this.splice(t, 1);
1830
- }
1831
- });
1832
- Object.defineProperty(Array.prototype, "replace", {
1833
- enumerable: !1,
1834
- value: function(e, t) {
1835
- const r = this.indexOf(e);
1836
- r > -1 && this.splice(r, 1, t);
927
+ const Wt = {
928
+ beforeMount: re,
929
+ updated: re
930
+ };
931
+ function re(e, t) {
932
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = qt(e, t));
933
+ }
934
+ function qt(e, t) {
935
+ var c, p;
936
+ if (!t.value)
937
+ return ((c = e.attributes.getNamedItem("placeholder")) == null ? void 0 : c.value) ?? "";
938
+ let n = "";
939
+ 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);
940
+ !e.attributes.getNamedItem("display-utc") !== null && o.setMinutes(o.getMinutes() - o.getTimezoneOffset());
941
+ let l = (p = e.attributes.getNamedItem("format")) == null ? void 0 : p.value;
942
+ if (!l && e.attributes.getNamedItem("relative-date") !== null) {
943
+ const h = /* @__PURE__ */ new Date();
944
+ h.getFullYear() == o.getFullYear() && h.getMonth() == o.getMonth() && h.getDate() == o.getDate() && (n = "at", l = "HH:mm");
945
+ }
946
+ l || (l = C.defaultDateTimeFormat);
947
+ let r = j(o, l);
948
+ return n && (r = n + " " + r), r;
949
+ }
950
+ const Ut = {
951
+ beforeMount: ae,
952
+ updated: ae,
953
+ unmounted: zt
954
+ };
955
+ function ae(e, t) {
956
+ 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");
957
+ }
958
+ function zt(e) {
959
+ e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
960
+ }
961
+ const Xt = {
962
+ beforeMount: ce,
963
+ updated: ce,
964
+ unmounted: xe
965
+ }, x = Symbol("HasAutoFocused"), G = [];
966
+ function Yt() {
967
+ G.forEach(ke);
968
+ }
969
+ setInterval(Yt, 1e3);
970
+ function ce(e, t) {
971
+ var l;
972
+ if (t.value == t.oldValue)
973
+ return;
974
+ if (!t.value)
975
+ return xe(e);
976
+ const n = new Date(t.value), i = (l = e.attributes.getNamedItem("base-time")) == null ? void 0 : l.value, s = n.getTime() - (i ? new Date(i).getTime() - t.value * 1e3 : 0), o = e.getAttribute("no-seconds") === null;
977
+ e[x] || G.push(e), e[x] = {
978
+ startTs: s,
979
+ includeSeconds: o
980
+ }, ke(e);
981
+ }
982
+ function ke(e) {
983
+ const t = e[x], n = Math.round((Date.now() - t.startTs) / 1e3);
984
+ e.innerText = Zt(n, t.includeSeconds);
985
+ }
986
+ function xe(e) {
987
+ e[x] && (We(G, e), delete e[x]), e.innerText = "-";
988
+ }
989
+ function Zt(e, t) {
990
+ const n = [], i = Math.floor(e / 86400);
991
+ i && n.push(i + "d"), e -= i * 86400;
992
+ const s = Math.floor(e / 3600);
993
+ (i || s) && n.push(s + "h"), e -= s * 3600;
994
+ const o = Math.floor(e / 60);
995
+ return (i || s || o) && n.push(o + "m"), t ? n.length || n.push("0m") : (e -= o * 60, n.push(e + "s")), n.join(" ");
996
+ }
997
+ const Gt = {
998
+ created(e, t) {
999
+ Vt(t.value, t.instance.$);
1000
+ }
1001
+ }, Qt = {
1002
+ beforeMount: de,
1003
+ updated: de
1004
+ };
1005
+ function de(e, t) {
1006
+ e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1007
+ }
1008
+ const Jt = {
1009
+ mounted: ue,
1010
+ updated: ue,
1011
+ unmounted: Me
1012
+ }, k = Symbol("TooltipState");
1013
+ function ue(e, t) {
1014
+ var i;
1015
+ let n = ((i = e.attributes.getNamedItem("tip")) == null ? void 0 : i.value) ?? t.value;
1016
+ if (t.value || (n = null), n) {
1017
+ const s = {
1018
+ content: n,
1019
+ html: e.getAttribute("html") !== null
1020
+ };
1021
+ e[k] ? e[k].configure(s) : e[k] = new en(e, s);
1022
+ } else
1023
+ Me(e);
1024
+ }
1025
+ function Me(e) {
1026
+ var t;
1027
+ (t = e[k]) == null || t.destroy(), delete e[k];
1028
+ }
1029
+ class en {
1030
+ constructor(t, n) {
1031
+ f(this, "lastMoveEvt");
1032
+ f(this, "checkInterval");
1033
+ f(this, "shouldShow", !1);
1034
+ f(this, "tipEl");
1035
+ f(this, "titleEl");
1036
+ f(this, "contentEl");
1037
+ f(this, "mouseMoveBound", !1);
1038
+ f(this, "handleMouseMoveWithContext", this.handleMouseMove.bind(this));
1039
+ f(this, "handleTargetMouseEnterWithContext", this.handleTargetMouseEnter.bind(this));
1040
+ f(this, "handleTargetMouseLeaveWithContext", this.handleTargetMouseLeave.bind(this));
1041
+ this.el = t, this.config = n, t.addEventListener("mouseenter", this.handleTargetMouseEnterWithContext), t.addEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
1837
1042
  }
1838
- });
1839
- Object.defineProperty(Array.prototype, "sortBy", {
1840
- enumerable: !1,
1841
- value: function(e) {
1842
- this.sort((t, r) => String(t[e]).toLowerCase().localeCompare(String(r[e]).toLowerCase()));
1043
+ configure(t) {
1044
+ this.config = t;
1843
1045
  }
1844
- });
1845
- Object.defineProperty(Array.prototype, "unique", {
1846
- enumerable: !1,
1847
- value: function() {
1848
- return [...new Set(this)];
1046
+ handleTargetMouseEnter(t) {
1047
+ this.shouldShow = !0, setTimeout(() => this.show(t), this.config.delay ?? 0);
1849
1048
  }
1850
- });
1851
- f.config.globalProperties.$contextMenu = function(e, t) {
1852
- var r = u('<div class="vf-overlay">').click(d).appendTo(document.body), n = u('<div class="vf-context-menu">').css("position", "absolute").appendTo(r), i = u(e.currentTarget);
1853
- i.css("user-select", "none"), i.addClass("context-menu-active"), t.targetClass && i.addClass(t.targetClass), t.class && n.addClass(t.class), t.items && t.items.forEach((p) => {
1854
- if (p == "-")
1855
- return u('<div class="separator">').appendTo(n);
1856
- var v = u('<div class="item">').css("user-select", "none").text(p.title).appendTo(n);
1857
- p.class && v.addClass(p.class), p.shouldConfirm ? v.data("handler", p.handler).click(h) : p.handler && v.click(p.handler);
1858
- });
1859
- const a = window.innerWidth - e.clientX, s = window.innerHeight - e.clientY, o = n.outerHeight(), l = n.outerWidth(), c = a < l ? e.clientX - l - 1 : e.clientX + 1, b = s < o ? e.clientY - o - 1 : e.clientY + 1;
1860
- n.css("left", c + "px"), n.css("top", b + "px"), t.onCreate && t.onCreate(n[0]), setTimeout(() => {
1861
- n.css("width", n.outerWidth() + "px");
1862
- }, 50);
1863
- function d() {
1864
- t.targetClass && i.removeClass(t.targetClass), i.removeClass("context-menu-active"), i.css("user-select", ""), r.remove();
1049
+ handleTargetMouseLeave() {
1050
+ this.shouldShow = !1, this.removeTooltip();
1865
1051
  }
1866
- function h(p) {
1867
- var v = u(p.currentTarget);
1868
- if (v.hasClass("pending-confirm")) {
1869
- var T = v.data("handler");
1870
- T && T();
1871
- } else {
1872
- var _ = v.html();
1873
- v.addClass("pending-confirm").text("Confirm"), v.one("mouseleave", function() {
1874
- v.removeClass("pending-confirm").html(_);
1875
- }), p.stopPropagation();
1876
- }
1052
+ show(t) {
1053
+ this.shouldShow && (this.renderTooltip(), t && this.handleMouseMove(t));
1877
1054
  }
1878
- };
1879
- f.config.globalProperties.$delay = (e) => new Promise((t) => setTimeout(t, e));
1880
- let H = {
1881
- unhandledErrorSupportText: "please contact support"
1882
- };
1883
- function bh(e) {
1884
- Object.assign(H, e);
1885
- }
1886
- Object.defineProperty(H, "set", { value: bh, enumerable: !1 });
1887
- f.config.globalProperties.$reportError = (e) => {
1888
- e instanceof Error || (e = new Error(e)), H.reportErrorHandler ? H.reportErrorHandler(e) : console.error(e);
1889
- };
1890
- f.config.globalProperties.$throwUserError = (e) => {
1891
- let t = new Error(e);
1892
- throw t.code = "USERERR", t;
1893
- };
1894
- Object.defineProperty(Error.prototype, "userMessage", {
1895
- get() {
1896
- return this.code == "USERERR" ? this.message : `An application error has occurred:
1897
-
1898
- ${this.message}
1899
-
1900
- Please refresh the page and try again. If this error persists, ${H.unhandledErrorSupportText}.`;
1055
+ renderTooltip() {
1056
+ this.tipEl || (this.tipEl = document.createElement("div"), this.tipEl.style.position = "absolute", this.tipEl.style.zIndex = "1000000", document.body.appendChild(this.tipEl)), this.tipEl.className = this.getClasses().join(" "), this.config.title ? (this.titleEl || (this.titleEl = document.createElement("div"), this.titleEl.className = "title", this.tipEl.appendChild(this.titleEl)), this.titleEl.innerText = this.config.title) : this.titleEl && this.titleEl.remove(), this.contentEl || (this.contentEl = document.createElement("div"), this.contentEl.className = "content", this.tipEl.appendChild(this.contentEl)), this.contentEl[this.config.html ? "innerHTML" : "innerText"] = this.config.content, this.checkInterval && (this.checkInterval = setInterval(() => this.checkMoveEvent(), 250)), this.mouseMoveBound || (this.mouseMoveBound = !0, window.addEventListener("mousemove", this.handleMouseMoveWithContext));
1901
1057
  }
1902
- });
1903
- Error.prototype.handle = function() {
1904
- return this.code != "USERERR" && f.config.globalProperties.$reportError(this), this;
1905
- };
1906
- f.config.globalProperties.$http = ne;
1907
- ne.postOrPut = (e, t, ...r) => {
1908
- const n = t ? "put" : "post", i = t ? `${e}/${t}` : e;
1909
- return ne[n](i, ...r);
1910
- };
1911
- ne.interceptors.response.use(
1912
- (e) => {
1913
- if (e.data && typeof e.data != "object")
1914
- throw new Error("response was not JSON");
1915
- return e;
1916
- },
1917
- (e) => {
1918
- if (e.response && e.response.status == 401 && H.unauthorizedHttpResponseHandler && H.unauthorizedHttpResponseHandler(e.response))
1919
- return new Promise(() => {
1920
- });
1921
- throw e.response && e.response.data && e.response.data.error && (e.code = e.response.status == 422 ? "USERERR" : "APIERR", e.message = e.response.data.error, e.field = e.response.data.errorField), e;
1058
+ getClasses() {
1059
+ return ["vf-tooltip", ...Array.isArray(this.config.class) ? this.config.class : this.config.class ? [this.config.class] : []];
1922
1060
  }
1923
- );
1924
- f.config.globalProperties.$mask = function(e) {
1925
- let t = u(this.$el);
1926
- this.$maskEl(t.hasClass("vf-overlay") ? t.find(".vf-modal")[0] : this.$el, e);
1927
- };
1928
- f.config.globalProperties.$maskEl = function(e, t) {
1929
- this._currentMask || (this._currentMask = u('<div class="mask">').text(t || "Please wait...").appendTo(e));
1930
- };
1931
- f.config.globalProperties.$unmask = function() {
1932
- this._currentMask && (u(this._currentMask).remove(), delete this._currentMask);
1933
- };
1934
- f.config.globalProperties.$maskForm = function(e, t) {
1935
- let r = this.$el;
1936
- e !== void 0 && e.tagName == "FORM" && (r = e, e = void 0);
1937
- let n = r.tagName == "FORM" ? u(r) : u(r).find("form"), i = n.find("input, select, textarea, button").not("[disabled]");
1938
- if (n.addClass("masked"), n.data("vf-masked-inputs", i), i.attr("disabled", "disabled"), e === void 0 && (e = n.find("button:first")), e) {
1939
- let a = n.find(e);
1940
- a.disable(t || "Please wait..."), n.data("vf-masked-wait-btn", a);
1061
+ removeTooltip() {
1062
+ this.shouldShow || this.tipEl && (this.tipEl.remove(), this.tipEl = void 0, this.titleEl = void 0, this.contentEl = void 0, this.checkInterval && (clearInterval(this.checkInterval), this.checkInterval = void 0), window.removeEventListener("mousemove", this.handleMouseMoveWithContext), this.mouseMoveBound = !1);
1941
1063
  }
1942
- };
1943
- f.config.globalProperties.$unmaskForm = function() {
1944
- let e = this.$el.tagName == "FORM" ? u(this.$el) : u(this.$el).find("form.masked");
1945
- if (!e.length)
1946
- return;
1947
- e.data("vf-masked-inputs").removeAttr("disabled"), e.removeData("vf-masked-inputs");
1948
- let r = e.data("vf-masked-wait-btn");
1949
- r && (e.removeData("vf-masked-wait-btn"), r.enable()), e.removeClass("masked");
1950
- };
1951
- u.fn.disable = function(e) {
1952
- return this.each(function(t, r) {
1953
- var n = u(r), i = r.tagName == "INPUT";
1954
- e && n.data("originalValue", i ? n.val() : n.html()) && n[i ? "val" : "text"](e), n.attr("disabled", "disabled");
1955
- }), this;
1956
- };
1957
- u.fn.enable = function() {
1958
- return this.each(function(e, t) {
1959
- var r = u(t);
1960
- r.removeAttr("disabled");
1961
- var n = r.data("originalValue");
1962
- n != null && r[t.tagName == "INPUT" ? "val" : "html"](n) && r.removeData("originalValue");
1963
- }), this;
1964
- };
1965
- Number.prototype.format = function() {
1966
- return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1967
- };
1968
- String.prototype.escapeHtml = function() {
1969
- return this.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1970
- };
1971
- String.prototype.nl2br = function() {
1972
- return this.replace(/\n/g, "<br>");
1973
- };
1974
- String.prototype.kebab = function() {
1975
- return this.replace(/ /g, "-");
1976
- };
1977
- String.prototype.lcfirst = function() {
1978
- return this.substr(0, 1).toLowerCase() + this.substr(1);
1979
- };
1980
- String.prototype.snake = function() {
1981
- return this.replace(/ /g, "_");
1982
- };
1983
- String.prototype.ucfirst = function() {
1984
- return this.substr(0, 1).toUpperCase() + this.substr(1);
1985
- };
1986
- String.prototype.ucwords = function() {
1987
- return this.replace(/^[a-z]| [a-z]/gi, function(e) {
1988
- return e.toUpperCase();
1989
- });
1990
- };
1991
- String.prototype.unsnake = function() {
1992
- return this.replace(/_/g, " ");
1993
- };
1994
- f.config.globalProperties.$isPropTruthy = function(e) {
1995
- return e !== void 0 && (e === "" || e);
1996
- };
1997
- class _h {
1998
- static install(t) {
1999
- const r = ["auto", "scroll"], n = function(o) {
2000
- if (o = o.parentElement, !o)
2001
- return null;
2002
- const l = window.getComputedStyle(o);
2003
- return r.includes(l.overflow) || r.includes(l.overflowX) || r.includes(l.overflowY) ? o : n(o);
2004
- }, i = function() {
2005
- if (this.$options.windowScrolledToBottom && (this._windowScrollHook = new te(
2006
- window,
2007
- this.$options.windowScrolledToBottom.bind(this)
2008
- ), this._windowScrollHook.install()), this.$options.elScrolledToBottom && (this._elScrollHook = new te(this.$el, this.$options.elScrolledToBottom.bind(this)), this._elScrollHook.install()), this.$options.ancestorScrolledToBottom) {
2009
- const o = n(this.$el);
2010
- o ? (this._ancestorScrollHook = new te(
2011
- o,
2012
- this.$options.ancestorScrolledToBottom.bind(this)
2013
- ), this._ancestorScrollHook.install()) : console.warn("no scollable ancestor found for component:", this);
2014
- }
2015
- }, a = function() {
2016
- this._windowScrollHandler && this._windowScrollHandler.install(), this._elScrollHandler && this._elScrollHandler.install(), this._ancestorScrollHook && this._ancestorScrollHook.install();
2017
- }, s = function() {
2018
- this._windowScrollHandler && this._windowScrollHandler.uninstall(), this._elScrollHandler && this._elScrollHandler.uninstall(), this._ancestorScrollHook && this._ancestorScrollHook.uninstall();
2019
- };
2020
- t.mixin({
2021
- mounted() {
2022
- i.call(this);
2023
- },
2024
- activated() {
2025
- a.call(this);
2026
- },
2027
- deactivated() {
2028
- s.call(this);
2029
- },
2030
- beforeUnmount() {
2031
- s.call(this);
2032
- }
2033
- });
1064
+ handleMouseMove(t) {
1065
+ const n = this.tipEl.offsetWidth, i = this.tipEl.offsetHeight, s = window.innerWidth, o = window.innerHeight;
1066
+ let l = t.pageX + 10, r = t.pageY + 20;
1067
+ l + n > s && (l = t.pageX - 5 - n), r + i > o && (r = t.pageY - 5 - i), this.tipEl.style.left = l + "px", this.tipEl.style.top = r + "px", this.lastMoveEvt = t;
2034
1068
  }
2035
- }
2036
- class Th {
2037
- static install(t) {
2038
- t.mixin({
2039
- mounted() {
2040
- this.$options.windowResized && (this._resizeWatcherHandler = this.$options.windowResized.bind(this), window.addEventListener("resize", this._resizeWatcherHandler));
2041
- },
2042
- activated() {
2043
- this._resizeWatcherHandler && window.addEventListener("resize", this._resizeWatcherHandler);
2044
- },
2045
- deactivated() {
2046
- this._resizeWatcherHandler && window.removeEventListener("resize", this._resizeWatcherHandler);
2047
- },
2048
- beforeUnmount() {
2049
- this._resizeWatcherHandler && window.removeEventListener("resize", this._resizeWatcherHandler);
2050
- }
2051
- });
1069
+ checkMoveEvent() {
1070
+ var t;
1071
+ this.lastMoveEvt && this.tipEl !== this.lastMoveEvt.target && ((t = this.tipEl) != null && t.contains(this.lastMoveEvt.target) || this.handleTargetMouseLeave());
2052
1072
  }
2053
- }
2054
- f.use(wr);
2055
- f.use(_h);
2056
- f.use(Th);
2057
- const pr = {
2058
- bytes(e) {
2059
- var t = Math.floor(Math.log(e) / Math.log(1024));
2060
- return (e / Math.pow(1024, t)).toFixed(2) * 1 + " " + ["B", "KB", "MB", "GB", "TB"][t];
2061
- },
2062
- dash(e) {
2063
- return e != null && String(e).length ? e : "-";
2064
- },
2065
- dashZeros(e) {
2066
- return e || "-";
2067
- },
2068
- grammarcase(e) {
2069
- return e ? e.grammarcase() : null;
2070
- },
2071
- lowercase(e) {
2072
- return e ? e.toLowerCase() : null;
2073
- },
2074
- number(e) {
2075
- return e === null || !/^[0-9]+$/.test(e) ? e : e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2076
- },
2077
- phone(e) {
2078
- if (!e)
2079
- return e;
2080
- let t = e.replace(/[^0-9]/g, "").replace(/^1/, "");
2081
- return t.length != 10 ? e : "(" + t.substr(0, 3) + ") " + t.substr(3, 3) + "-" + t.substr(6);
2082
- },
2083
- ucfirst(e) {
2084
- return e ? e.ucfirst() : null;
2085
- },
2086
- ucwords(e) {
2087
- return e ? e.ucwords() : null;
2088
- },
2089
- uppercase(e) {
2090
- return e ? e.toUpperCase() : null;
2091
- },
2092
- unsnake(e) {
2093
- return e ? e.unsnake() : null;
2094
- },
2095
- usCurrency(e) {
2096
- return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1073
+ destroy() {
1074
+ this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext);
2097
1075
  }
2098
- };
2099
- function Oh(e) {
2100
- for (let t of Object.keys(e))
2101
- vr(t, e[t]);
2102
- }
2103
- function vr(e, t) {
2104
- pr[e] = t;
2105
- }
2106
- f.config.globalProperties.$filter = (e, ...t) => {
2107
- for (let r of t)
2108
- e = pr[r](e);
2109
- return e;
2110
- };
2111
- const Ph = {
2112
- getApp: Ah,
2113
- configure: Sh,
2114
- mount: wh,
2115
- registerFilter: vr,
2116
- registerFilters: Oh
2117
- };
2118
- function Sh(e) {
2119
- H.set(e);
2120
1076
  }
2121
- function wh(e, t) {
2122
- Ar(e), f.vm = f.mount(t);
1077
+ function tn(e) {
1078
+ e.directive("autofocus", _t), e.directive("confirm-button", Kt), e.directive("date-input", jt), e.directive("datetime", Wt), e.directive("disabled", Ut), e.directive("duration", Xt), e.directive("infinite-scroll", Gt), e.directive("readonly", Qt), e.directive("tooltip", Jt);
2123
1079
  }
2124
- function Ah() {
2125
- return f;
1080
+ function In(e) {
1081
+ tn(e);
2126
1082
  }
2127
1083
  export {
2128
- Ph as default
1084
+ cn as ModalContainer,
1085
+ B as UserError,
1086
+ an as VfAjaxSelect,
1087
+ V as VfAlertModal,
1088
+ yn as VfEzSmartSelect,
1089
+ st as VfModal,
1090
+ Tt as VfSmartSelect,
1091
+ xn as cloneProp,
1092
+ pn as configureVf,
1093
+ En as createFilters,
1094
+ Ee as createModalInjection,
1095
+ rt as desnakeCase,
1096
+ $n as escapeHtml,
1097
+ Je as formatError,
1098
+ At as formatNumber,
1099
+ at as formatPhone,
1100
+ ct as formatUSCurrency,
1101
+ vn as handleError,
1102
+ mn as handleErrorAndAlert,
1103
+ Cn as installApiClientInterceptors,
1104
+ In as installVf,
1105
+ wn as maskComponent,
1106
+ Ht as maskEl,
1107
+ kn as maskForm,
1108
+ gn as nl2br,
1109
+ Mn as nullifyEmptyInputs,
1110
+ X as presentModal,
1111
+ Te as removeModalInjection,
1112
+ dn as removeModalInjectionByInstance,
1113
+ Oe as removeModalInjectionByInternalInstance,
1114
+ Qe as removeModalInjectionByVnode,
1115
+ Tn as replaceElement,
1116
+ te as showAlert,
1117
+ un as showConfirm,
1118
+ hn as showConfirmDestroy,
1119
+ On as showContextMenu,
1120
+ fn as showWait,
1121
+ Dt as sleep,
1122
+ bn as sleepSecs,
1123
+ Y as toError,
1124
+ Sn as unmaskComponent,
1125
+ be as unmaskEl,
1126
+ $t as unmaskForm,
1127
+ Vt as useInfiniteScroll,
1128
+ Ln as useResizeWatcher
2129
1129
  };