@featherk/composables 0.10.7 → 0.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,40 @@
1
- import { ref as U, onBeforeUnmount as Le, nextTick as B, computed as f, watchEffect as Fe, toValue as le, reactive as qe, watch as ue, getCurrentScope as Oe, onScopeDispose as Ue, unref as Be, onMounted as Ie, readonly as G, shallowRef as Ke } from "vue";
2
- import { useFocusTrap as Ne } from "@vueuse/integrations/useFocusTrap";
3
- const ft = (e, t) => {
4
- const l = U(null);
5
- let A = !1, m = null, g = null;
6
- const I = [], b = ".k-table-row[data-grid-row-index] [tabindex]", M = () => {
7
- const o = e?.value?.$el;
8
- return o ? o.closest(".k-grid") : null;
9
- }, $ = (o) => {
10
- const w = M();
1
+ import { ref as U, onBeforeUnmount as Pe, nextTick as B, computed as v, watchEffect as Te, toValue as oe, reactive as Ve, watch as ue, unref as Le, onMounted as Me, readonly as X, shallowRef as Ke } from "vue";
2
+ import { useFocusTrap as qe } from "@vueuse/integrations/useFocusTrap";
3
+ const it = (e, t) => {
4
+ const r = U(null);
5
+ let g = !1, f = null, p = null;
6
+ const A = [], C = ".k-table-row[data-grid-row-index] [tabindex]", T = () => {
7
+ const i = e?.value?.$el;
8
+ return i ? i.closest(".k-grid") : null;
9
+ }, q = (i) => {
10
+ const w = T();
11
11
  if (!w) return !1;
12
- const c = o.closest(".k-grid-aria-root");
13
- if (c)
14
- return w.contains(c);
15
- const p = o.closest(
12
+ const d = i.closest(".k-grid-aria-root");
13
+ if (d)
14
+ return w.contains(d);
15
+ const b = i.closest(
16
16
  ".k-grid-header, .k-grid-content, .k-grid-content-locked"
17
17
  );
18
- return p ? w.contains(p) : !1;
19
- }, h = (o) => o.key === "Enter" || o.code === "Enter" || o.code === "NumpadEnter", P = () => e?.value?.columns, E = (o) => {
20
- const w = o.key || o.code;
21
- ([" ", "Spacebar", "Space"].includes(w) || h(o)) && (o.preventDefault(), o.stopPropagation(), l.value = o.target, o.target.click());
22
- }, u = (o) => {
23
- if (!l.value) return;
24
- if (o.code === "Escape") {
25
- o.stopPropagation(), l.value && l.value.focus();
18
+ return b ? w.contains(b) : !1;
19
+ }, D = (i) => i.key === "Enter" || i.code === "Enter" || i.code === "NumpadEnter", $ = () => e?.value?.columns, s = (i) => {
20
+ const w = i.key || i.code;
21
+ ([" ", "Spacebar", "Space"].includes(w) || D(i)) && (i.preventDefault(), i.stopPropagation(), r.value = i.target, i.target.click());
22
+ }, l = (i) => {
23
+ if (!r.value) return;
24
+ if (i.code === "Escape") {
25
+ i.stopPropagation(), r.value && r.value.focus();
26
26
  return;
27
27
  }
28
28
  const w = Array.from(
29
29
  document.querySelectorAll(
30
30
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
31
31
  )
32
- ), c = document.querySelector(
32
+ ), d = document.querySelector(
33
33
  ".k-animation-container .k-popup .k-column-menu .k-filter-menu-container"
34
34
  );
35
- if (c) {
36
- if (o.code === "Tab") {
37
- const p = [
35
+ if (d) {
36
+ if (i.code === "Tab") {
37
+ const b = [
38
38
  // ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
39
39
  // ".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])",
40
40
  // ".k-filter-menu-container button:not([tabindex='-1']):not([disabled])",
@@ -43,129 +43,129 @@ const ft = (e, t) => {
43
43
  "input.k-input-inner:not([tabindex='-1']):not([disabled])",
44
44
  "button:not([tabindex='-1']):not([disabled])",
45
45
  ".k-checkbox"
46
- ], x = t?.focusableMenuSelectors ?? p, y = Array.from(
47
- c.querySelectorAll(x.join(","))
46
+ ], I = t?.focusableMenuSelectors ?? b, S = Array.from(
47
+ d.querySelectorAll(I.join(","))
48
48
  );
49
- if (y.length === 0) return;
50
- const C = y.findIndex(
51
- (Y) => Y === document.activeElement
49
+ if (S.length === 0) return;
50
+ const M = S.findIndex(
51
+ (W) => W === document.activeElement
52
52
  );
53
- let L;
54
- C === -1 ? L = 0 : o.shiftKey ? L = (C - 1 + y.length) % y.length : L = (C + 1) % y.length, o.preventDefault(), o.stopPropagation(), y[L]?.focus();
53
+ let K;
54
+ M === -1 ? K = 0 : i.shiftKey ? K = (M - 1 + S.length) % S.length : K = (M + 1) % S.length, i.preventDefault(), i.stopPropagation(), S[K]?.focus();
55
55
  }
56
- } else if (o.code === "ArrowUp" || o.code === "ArrowDown") {
57
- o.preventDefault(), o.stopPropagation();
58
- const p = w.findIndex(
59
- (y) => y === document.activeElement
56
+ } else if (i.code === "ArrowUp" || i.code === "ArrowDown") {
57
+ i.preventDefault(), i.stopPropagation();
58
+ const b = w.findIndex(
59
+ (S) => S === document.activeElement
60
60
  );
61
- let x = p;
62
- o.code === "ArrowUp" ? x = p > 0 ? p - 1 : w.length - 1 : o.code === "ArrowDown" && (x = p < w.length - 1 ? p + 1 : 0), w[x]?.focus();
61
+ let I = b;
62
+ i.code === "ArrowUp" ? I = b > 0 ? b - 1 : w.length - 1 : i.code === "ArrowDown" && (I = b < w.length - 1 ? b + 1 : 0), w[I]?.focus();
63
63
  return;
64
64
  }
65
- if (o.code === "Tab") {
66
- o.preventDefault(), o.stopPropagation();
67
- const p = l.value?.parentElement;
68
- (o.shiftKey ? p?.previousElementSibling : p?.nextElementSibling)?.querySelector(
65
+ if (i.code === "Tab") {
66
+ i.preventDefault(), i.stopPropagation();
67
+ const b = r.value?.parentElement;
68
+ (i.shiftKey ? b?.previousElementSibling : b?.nextElementSibling)?.querySelector(
69
69
  "button, [role='button'], .k-link"
70
70
  )?.focus();
71
71
  }
72
- }, S = () => {
73
- m = new MutationObserver((o) => {
74
- o.forEach((w) => {
75
- w.addedNodes.forEach((c) => {
76
- if (c.nodeType === Node.ELEMENT_NODE) {
77
- const p = c;
78
- if (p.classList.contains("k-animation-container")) {
79
- const y = l.value;
80
- y && (y.dataset.featherKSortable === "true" || B(() => {
81
- p.querySelectorAll(
72
+ }, y = () => {
73
+ f = new MutationObserver((i) => {
74
+ i.forEach((w) => {
75
+ w.addedNodes.forEach((d) => {
76
+ if (d.nodeType === Node.ELEMENT_NODE) {
77
+ const b = d;
78
+ if (b.classList.contains("k-animation-container")) {
79
+ const S = r.value;
80
+ S && (S.dataset.featherKSortable === "true" || B(() => {
81
+ b.querySelectorAll(
82
82
  ".k-columnmenu-item-wrapper"
83
- ).forEach((Y) => {
84
- Y.textContent?.toLowerCase().includes("sort") && Y.remove();
83
+ ).forEach((W) => {
84
+ W.textContent?.toLowerCase().includes("sort") && W.remove();
85
85
  });
86
- })), p.addEventListener(
86
+ })), b.addEventListener(
87
87
  "keydown",
88
- u
88
+ l
89
89
  ), B(() => {
90
- const C = () => {
91
- const L = Array.from(
92
- p.querySelectorAll(
90
+ const M = () => {
91
+ const K = Array.from(
92
+ b.querySelectorAll(
93
93
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
94
94
  )
95
95
  );
96
- if (L.length === 1)
97
- L[0].focus(), L[0].click(), C.attempts = 0;
98
- else if (L.length > 1) {
99
- C.attempts = 0;
96
+ if (K.length === 1)
97
+ K[0].focus(), K[0].click(), M.attempts = 0;
98
+ else if (K.length > 1) {
99
+ M.attempts = 0;
100
100
  return;
101
101
  } else
102
- C.attempts === void 0 && (C.attempts = 0), C.attempts++ < 3 && setTimeout(C, 200);
102
+ M.attempts === void 0 && (M.attempts = 0), M.attempts++ < 3 && setTimeout(M, 200);
103
103
  };
104
- C();
104
+ M();
105
105
  });
106
106
  }
107
- p.querySelectorAll(
107
+ b.querySelectorAll(
108
108
  ".k-animation-container"
109
- ).forEach((y) => {
110
- y.addEventListener(
109
+ ).forEach((S) => {
110
+ S.addEventListener(
111
111
  "keydown",
112
- u
112
+ l
113
113
  );
114
114
  });
115
115
  }
116
- }), w.removedNodes.forEach((c) => {
117
- if (c.nodeType === Node.ELEMENT_NODE) {
118
- const p = c;
119
- p.classList.contains("k-animation-container") && p.removeEventListener(
116
+ }), w.removedNodes.forEach((d) => {
117
+ if (d.nodeType === Node.ELEMENT_NODE) {
118
+ const b = d;
119
+ b.classList.contains("k-animation-container") && b.removeEventListener(
120
120
  "keydown",
121
- u
122
- ), p.querySelectorAll(
121
+ l
122
+ ), b.querySelectorAll(
123
123
  ".k-animation-container"
124
- ).forEach((y) => {
125
- y.removeEventListener(
124
+ ).forEach((S) => {
125
+ S.removeEventListener(
126
126
  "keydown",
127
- u
127
+ l
128
128
  );
129
129
  });
130
130
  }
131
131
  });
132
132
  });
133
- }), m.observe(document.body, {
133
+ }), f.observe(document.body, {
134
134
  childList: !0,
135
135
  subtree: !0
136
136
  });
137
- }, Z = (o) => {
138
- const w = o.tagName.toLowerCase();
139
- return !!(["input", "textarea", "select", "button"].includes(w) || o.closest(
137
+ }, L = (i) => {
138
+ const w = i.tagName.toLowerCase();
139
+ return !!(["input", "textarea", "select", "button"].includes(w) || i.closest(
140
140
  '.k-picker-wrap, .k-input-inner, .k-textbox, [role="combobox"]'
141
141
  ));
142
- }, v = (o) => {
143
- if (!o.type || !o)
142
+ }, h = (i) => {
143
+ if (!i.type || !i)
144
144
  return;
145
- const w = o.target;
145
+ const w = i.target;
146
146
  if (!w) return;
147
- const c = w.closest(
147
+ const d = w.closest(
148
148
  ".k-table-row[data-grid-row-index]"
149
149
  );
150
- if (!$(w))
150
+ if (!q(w))
151
151
  return;
152
- const p = ["ArrowLeft", "ArrowRight"].includes(
153
- o.code
152
+ const b = ["ArrowLeft", "ArrowRight"].includes(
153
+ i.code
154
154
  );
155
- if (!(Z(w) && !(c && p))) {
156
- if (o.code === "Escape") {
157
- const x = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
- if (x) {
159
- o.preventDefault(), o.stopPropagation();
155
+ if (!(L(w) && !(d && b))) {
156
+ if (i.code === "Escape") {
157
+ const I = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
+ if (I) {
159
+ i.preventDefault(), i.stopPropagation();
160
160
  try {
161
161
  Array.from(
162
162
  e?.value.$el.querySelectorAll(
163
163
  ".k-table-row[data-grid-row-index]"
164
164
  )
165
- ).forEach((C) => C.setAttribute("tabindex", "-1"));
165
+ ).forEach((M) => M.setAttribute("tabindex", "-1"));
166
166
  } catch {
167
167
  }
168
- x.setAttribute("tabindex", "0"), x.focus();
168
+ I.setAttribute("tabindex", "0"), I.focus();
169
169
  return;
170
170
  }
171
171
  }
@@ -177,44 +177,44 @@ const ft = (e, t) => {
177
177
  "Enter",
178
178
  "NumpadEnter",
179
179
  "Space"
180
- ].includes(o.code)) {
180
+ ].includes(i.code)) {
181
181
  if (w.classList.contains("k-grid-header-menu") && w.classList.contains("k-grid-column-menu")) {
182
- l.value = w;
182
+ r.value = w;
183
183
  return;
184
184
  }
185
- if (c) {
186
- if (["ArrowDown", "ArrowUp"].includes(o.code)) {
187
- o.preventDefault(), o.stopPropagation();
188
- const x = (C, L) => {
189
- let Y = L === "next" ? C.nextElementSibling : C.previousElementSibling;
190
- for (; Y; ) {
191
- const ae = Y;
185
+ if (d) {
186
+ if (["ArrowDown", "ArrowUp"].includes(i.code)) {
187
+ i.preventDefault(), i.stopPropagation();
188
+ const I = (M, K) => {
189
+ let W = K === "next" ? M.nextElementSibling : M.previousElementSibling;
190
+ for (; W; ) {
191
+ const ae = W;
192
192
  try {
193
193
  if (ae.classList.contains("k-table-row"))
194
194
  return ae;
195
195
  } catch {
196
196
  }
197
- Y = L === "next" ? Y.nextElementSibling : Y.previousElementSibling;
197
+ W = K === "next" ? W.nextElementSibling : W.previousElementSibling;
198
198
  }
199
199
  return null;
200
- }, y = o.code === "ArrowDown" ? x(c, "next") : x(c, "previous");
201
- y && (c.setAttribute("tabindex", "-1"), y.setAttribute("tabindex", "0"), y.focus());
200
+ }, S = i.code === "ArrowDown" ? I(d, "next") : I(d, "previous");
201
+ S && (d.setAttribute("tabindex", "-1"), S.setAttribute("tabindex", "0"), S.focus());
202
202
  return;
203
203
  }
204
- if (["ArrowLeft", "ArrowRight"].includes(o.code)) {
205
- o.preventDefault(), o.stopPropagation();
206
- const x = c.querySelectorAll(
207
- b
204
+ if (["ArrowLeft", "ArrowRight"].includes(i.code)) {
205
+ i.preventDefault(), i.stopPropagation();
206
+ const I = d.querySelectorAll(
207
+ C
208
208
  );
209
- if (x.length === 0) return;
210
- let y = Array.from(x).findIndex(
211
- (C) => C === document.activeElement
209
+ if (I.length === 0) return;
210
+ let S = Array.from(I).findIndex(
211
+ (M) => M === document.activeElement
212
212
  );
213
- if (y === -1 && document.activeElement === c) {
214
- x[0].focus();
213
+ if (S === -1 && document.activeElement === d) {
214
+ I[0].focus();
215
215
  return;
216
216
  }
217
- o.code === "ArrowRight" ? y = y === x.length - 1 ? 0 : y + 1 : o.code === "ArrowLeft" && (y = y === 0 ? x.length - 1 : y - 1), x[y].focus();
217
+ i.code === "ArrowRight" ? S = S === I.length - 1 ? 0 : S + 1 : i.code === "ArrowLeft" && (S = S === 0 ? I.length - 1 : S - 1), I[S].focus();
218
218
  return;
219
219
  }
220
220
  }
@@ -222,282 +222,380 @@ const ft = (e, t) => {
222
222
  }
223
223
  }, k = () => {
224
224
  B(() => {
225
- const o = e.value?.$el;
226
- if (!o || typeof o.closest != "function") return;
227
- const w = o.closest(".k-grid");
225
+ const i = e.value?.$el;
226
+ if (!i || typeof i.closest != "function") return;
227
+ const w = i.closest(".k-grid");
228
228
  w && w.classList.add("fk-grid");
229
229
  });
230
- }, V = () => {
231
- if (!g)
230
+ }, x = () => {
231
+ if (!p)
232
232
  try {
233
- const o = () => {
233
+ const i = () => {
234
234
  try {
235
- const p = Array.from(
235
+ const b = Array.from(
236
236
  e.value.$el.querySelectorAll(
237
237
  ".k-table-row[data-grid-row-index]"
238
238
  )
239
239
  );
240
- if (!p || p.length === 0 || p.filter(
241
- (C) => C.getAttribute("tabindex") === "0"
240
+ if (!b || b.length === 0 || b.filter(
241
+ (M) => M.getAttribute("tabindex") === "0"
242
242
  ).length === 1) return;
243
- const y = p.find(
244
- (C) => C === document.activeElement || C.contains(document.activeElement)
243
+ const S = b.find(
244
+ (M) => M === document.activeElement || M.contains(document.activeElement)
245
245
  );
246
- if (p.forEach((C) => C.setAttribute("tabindex", "-1")), y) {
247
- y.setAttribute("tabindex", "0");
246
+ if (b.forEach((M) => M.setAttribute("tabindex", "-1")), S) {
247
+ S.setAttribute("tabindex", "0");
248
248
  return;
249
249
  }
250
- p[0].setAttribute("tabindex", "0");
251
- } catch (p) {
252
- console.error("ensureSingleTabindex error:", p);
250
+ b[0].setAttribute("tabindex", "0");
251
+ } catch (b) {
252
+ console.error("ensureSingleTabindex error:", b);
253
253
  }
254
254
  }, w = Array.from(
255
255
  e.value.$el.querySelectorAll(
256
256
  ".k-table-row[data-grid-row-index]"
257
257
  )
258
258
  );
259
- w.length > 0 && w.forEach((p, x) => {
260
- p.setAttribute("tabindex", x === 0 ? "0" : "-1");
259
+ w.length > 0 && w.forEach((b, I) => {
260
+ b.setAttribute("tabindex", I === 0 ? "0" : "-1");
261
261
  });
262
- const c = e.value.$el.querySelector(".k-table-tbody");
263
- c && (g = new MutationObserver(() => {
264
- o();
265
- }), g.observe(c, { childList: !0, subtree: !0 }));
266
- } catch (o) {
267
- console.error("Error setting up row navigation:", o);
262
+ const d = e.value.$el.querySelector(".k-table-tbody");
263
+ d && (p = new MutationObserver(() => {
264
+ i();
265
+ }), p.observe(d, { childList: !0, subtree: !0 }));
266
+ } catch (i) {
267
+ console.error("Error setting up row navigation:", i);
268
268
  }
269
- }, H = () => {
269
+ }, V = () => {
270
270
  B(() => {
271
271
  const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
- w && w.forEach((c) => {
273
- c.setAttribute("role", "button"), c.addEventListener(
272
+ w && w.forEach((d) => {
273
+ d.setAttribute("role", "button"), d.addEventListener(
274
274
  "keydown",
275
- E
275
+ s
276
276
  );
277
- }), S(), J();
277
+ }), y(), _();
278
278
  });
279
- }, Q = () => {
279
+ }, Y = () => {
280
280
  const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
- w && w.forEach((c) => {
282
- c.removeEventListener(
281
+ w && w.forEach((d) => {
282
+ d.removeEventListener(
283
283
  "keydown",
284
- E
284
+ s
285
285
  );
286
- }), m && (m.disconnect(), m = null), g && (g.disconnect(), g = null), I.forEach((c) => c()), I.length = 0;
287
- }, J = () => {
286
+ }), f && (f.disconnect(), f = null), p && (p.disconnect(), p = null), A.forEach((d) => d()), A.length = 0;
287
+ }, _ = () => {
288
288
  document.querySelectorAll(
289
289
  ".k-grid-header .k-table-thead th"
290
- ).forEach((c, p) => {
291
- if (c.dataset.featherKHeaderBound === "true")
290
+ ).forEach((d, b) => {
291
+ if (d.dataset.featherKHeaderBound === "true")
292
292
  return;
293
- const x = c.querySelector(
293
+ const I = d.querySelector(
294
294
  ".k-grid-header-menu.k-grid-column-menu"
295
295
  );
296
- if (!x) return;
297
- const y = P();
298
- if (y && y[p]) {
299
- const a = y[p].field ?? "";
300
- c.setAttribute("data-feather-k-field", a), c.setAttribute(
296
+ if (!I) return;
297
+ const S = $();
298
+ if (S && S[b]) {
299
+ const a = S[b].field ?? "";
300
+ d.setAttribute("data-feather-k-field", a), d.setAttribute(
301
301
  "data-feather-k-filterable",
302
- y[p].filterable === !1 ? "false" : "true"
303
- ), c.setAttribute(
302
+ S[b].filterable === !1 ? "false" : "true"
303
+ ), d.setAttribute(
304
304
  "data-feather-k-sortable",
305
- y[p].sortable === !1 ? "false" : "true"
305
+ S[b].sortable === !1 ? "false" : "true"
306
306
  );
307
307
  }
308
- const C = c.dataset.featherKFilterable !== "false", L = c.dataset.featherKSortable !== "false";
309
- x.setAttribute("tabindex", "-1"), C || L ? c.style.cursor = "pointer" : c.style.cursor = "default", C ? (c.setAttribute("tabindex", "0"), c.setAttribute("role", "button"), c.setAttribute("aria-haspopup", "menu")) : (c.setAttribute("tabindex", "0"), c.setAttribute("role", "columnheader"), c.removeAttribute("aria-haspopup"));
310
- const Y = (a) => {
311
- a.target?.closest(".k-column-resizer") || (l.value = c, x.click());
308
+ const M = d.dataset.featherKFilterable !== "false", K = d.dataset.featherKSortable !== "false";
309
+ I.setAttribute("tabindex", "-1"), M || K ? d.style.cursor = "pointer" : d.style.cursor = "default", M ? (d.setAttribute("tabindex", "0"), d.setAttribute("role", "button"), d.setAttribute("aria-haspopup", "menu")) : (d.setAttribute("tabindex", "0"), d.setAttribute("role", "columnheader"), d.removeAttribute("aria-haspopup"));
310
+ const W = (a) => {
311
+ a.target?.closest(".k-column-resizer") || (r.value = d, I.click());
312
312
  }, ae = (a) => {
313
- if (C)
314
- l.value = c, a.preventDefault(), a.stopPropagation(), Y(a);
315
- else if (L) {
316
- l.value = c;
317
- const d = c.querySelector(".k-link");
318
- d && d.click();
313
+ if (M)
314
+ r.value = d, a.preventDefault(), a.stopPropagation(), W(a);
315
+ else if (K) {
316
+ r.value = d;
317
+ const m = d.querySelector(".k-link");
318
+ m && m.click();
319
319
  }
320
320
  };
321
- c.addEventListener("click", ae), I.push(() => {
322
- c.removeEventListener("click", ae);
321
+ d.addEventListener("click", ae), A.push(() => {
322
+ d.removeEventListener("click", ae);
323
323
  });
324
324
  const se = (a) => {
325
- if ((h(a) || a.code === "Space") && (C || L)) {
326
- if (a.preventDefault(), a.stopPropagation(), l.value = c, l.value.focus(), C)
327
- Y(a);
328
- else if (L) {
329
- const d = c.querySelector(".k-link");
330
- d && d.click();
325
+ if ((D(a) || a.code === "Space") && (M || K)) {
326
+ if (a.preventDefault(), a.stopPropagation(), r.value = d, r.value.focus(), M)
327
+ W(a);
328
+ else if (K) {
329
+ const m = d.querySelector(".k-link");
330
+ m && m.click();
331
331
  }
332
332
  }
333
333
  };
334
- c.addEventListener("keydown", se, !0), I.push(() => {
335
- c.removeEventListener("keydown", se, !0);
336
- }), c.dataset.featherKHeaderBound = "true";
334
+ d.addEventListener("keydown", se, !0), A.push(() => {
335
+ d.removeEventListener("keydown", se, !0);
336
+ }), d.dataset.featherKHeaderBound = "true";
337
337
  });
338
338
  const w = document.querySelector(".k-grid-header .k-table-thead");
339
339
  if (w && w.dataset.featherKHeaderBound !== "true") {
340
- const c = (p) => {
341
- const x = p.target.closest("th");
342
- x && (h(p) || p.code === "Space") && x.dataset.featherKFilterable === "false" && x.dataset.featherKSortable === "false" && (p.preventDefault(), p.stopImmediatePropagation());
340
+ const d = (b) => {
341
+ const I = b.target.closest("th");
342
+ I && (D(b) || b.code === "Space") && I.dataset.featherKFilterable === "false" && I.dataset.featherKSortable === "false" && (b.preventDefault(), b.stopImmediatePropagation());
343
343
  };
344
344
  w.addEventListener(
345
345
  "keydown",
346
- c,
346
+ d,
347
347
  !0
348
348
  // NOTE: capture phase
349
- ), I.push(() => {
349
+ ), A.push(() => {
350
350
  w.removeEventListener(
351
351
  "keydown",
352
- c,
352
+ d,
353
353
  !0
354
354
  );
355
355
  }), w.dataset.featherKHeaderBound = "true";
356
356
  }
357
- }, ee = function(o, w) {
358
- const c = o?.event?.event.target, p = P();
359
- if (!c || !p) return;
360
- const x = c.classList.contains("k-grid-header-menu"), y = c.classList.contains("k-columnmenu-item"), C = p.find((L) => L.field === o?.event?.field)?.sortable && !0;
361
- if (!x) {
362
- if (y && !C) {
363
- o?.event?.sort?.filter(
364
- (Y) => Y.field !== o?.event?.field
357
+ }, Q = function(i, w) {
358
+ const d = i?.event?.event.target, b = $();
359
+ if (!d || !b) return;
360
+ const I = d.classList.contains("k-grid-header-menu"), S = d.classList.contains("k-columnmenu-item"), M = b.find((K) => K.field === i?.event?.field)?.sortable && !0;
361
+ if (!I) {
362
+ if (S && !M) {
363
+ i?.event?.sort?.filter(
364
+ (W) => W.field !== i?.event?.field
365
365
  );
366
366
  return;
367
367
  }
368
368
  typeof w == "function" && B(() => {
369
- l.value && l.value.focus(), w(o), B(() => {
370
- J();
369
+ r.value && r.value.focus(), w(i), B(() => {
370
+ _();
371
371
  });
372
372
  });
373
373
  }
374
- }, oe = () => {
375
- if (!A)
374
+ }, le = () => {
375
+ if (!g)
376
376
  try {
377
- k(), V(), H(), A = !0;
378
- } catch (o) {
379
- console.error("initA11y failed:", o), Q();
377
+ k(), x(), V(), g = !0;
378
+ } catch (i) {
379
+ console.error("initA11y failed:", i), Y();
380
380
  }
381
381
  };
382
- return Le(() => {
383
- Q();
382
+ return Pe(() => {
383
+ Y();
384
384
  }), {
385
- activeFilterButton: l,
386
- handleGridKeyDown: v,
387
- handleSortChange: ee,
388
- initA11y: oe
385
+ activeFilterButton: r,
386
+ handleGridKeyDown: h,
387
+ handleSortChange: Q,
388
+ initA11y: le
389
+ };
390
+ }, Ne = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), Oe = (e) => !!e && typeof e == "object" && "field" in e, Fe = (e, t) => !e || typeof e != "object" ? !1 : Ne(e) ? e.filters.some(
391
+ (r) => Fe(r, t)
392
+ ) : Oe(e) ? e.field === t : !1, st = (e) => (t) => e.value?.filters && e.value.filters.some(
393
+ (r) => Fe(r, t)
394
+ ) ? "active" : "", Ue = [
395
+ "button",
396
+ "a",
397
+ "input",
398
+ "select",
399
+ "textarea",
400
+ '[role="button"]',
401
+ '[role="checkbox"]',
402
+ '[role="link"]',
403
+ '[role="menuitem"]',
404
+ '[role="option"]',
405
+ ".k-checkbox",
406
+ ".k-button",
407
+ ".k-dropdown",
408
+ ".k-picker",
409
+ ".k-hierarchy-cell",
410
+ ".k-grid-header-menu",
411
+ ".k-column-menu"
412
+ ], ut = (e) => {
413
+ const {
414
+ onRowAction: t,
415
+ gridRef: r,
416
+ dataItems: g,
417
+ ignoreSelectors: f = [],
418
+ shouldIgnoreTarget: p,
419
+ enableKeyboardAction: A = !0
420
+ } = e, C = [
421
+ ...Ue,
422
+ ...f
423
+ ], T = (s, l) => {
424
+ if (!s) return !1;
425
+ const y = C.join(",");
426
+ return s.closest && s.closest(y) ? !0 : p && l ? p(s, l) : !1;
427
+ }, q = (s) => {
428
+ if (typeof window > "u") return !1;
429
+ const l = window.getSelection();
430
+ if (!l || l.isCollapsed || !l.toString().trim())
431
+ return !1;
432
+ if (s && l.anchorNode && l.focusNode) {
433
+ const y = s.closest(".k-table-row") || s.closest(".k-grid") || s, L = l.anchorNode.nodeType === Node.ELEMENT_NODE ? l.anchorNode : l.anchorNode.parentElement, h = l.focusNode.nodeType === Node.ELEMENT_NODE ? l.focusNode : l.focusNode.parentElement, k = !!(L && y.contains(L)), x = !!(h && y.contains(h));
434
+ return k || x;
435
+ }
436
+ return !0;
437
+ };
438
+ return {
439
+ handleRowClick: (s) => {
440
+ const l = s?.htmlEvent || s?.event || s?.nativeEvent || (s instanceof Event ? s : void 0);
441
+ if (l && l.button !== void 0 && l.button !== 0)
442
+ return;
443
+ const y = l?.target || s?.target;
444
+ if (y && T(y, l || s) || q(y))
445
+ return;
446
+ const L = {
447
+ dataItem: s.dataItem,
448
+ rowIndex: s.rowIndex,
449
+ field: s.field,
450
+ event: l || s,
451
+ triggerType: "click",
452
+ ctrlKey: !!l?.ctrlKey,
453
+ shiftKey: !!l?.shiftKey,
454
+ metaKey: !!l?.metaKey,
455
+ altKey: !!l?.altKey
456
+ };
457
+ t(s.dataItem, L);
458
+ },
459
+ handleRowKeyDown: (s, l) => {
460
+ if (!A) return;
461
+ const y = s.key || s.code;
462
+ if (!(y === "Enter" || y === "NumpadEnter" || y === " " || y === "Space" || s.code === "Enter" || s.code === "NumpadEnter" || s.code === "Space")) return;
463
+ const h = s.target;
464
+ if (!h) return;
465
+ const k = h.closest(
466
+ ".k-table-row[data-grid-row-index], .k-table-row"
467
+ );
468
+ if (!k || T(h, s))
469
+ return;
470
+ s.preventDefault(), s.stopPropagation();
471
+ const x = k.getAttribute("data-grid-row-index"), V = x !== null ? parseInt(x, 10) : void 0;
472
+ let Y = l;
473
+ if (Y === void 0) {
474
+ const Q = (Array.isArray(g) ? g : g?.value) || r?.value?.props?.dataItems || r?.value?.dataItems;
475
+ Q && V !== void 0 && V >= 0 && V < Q.length && (Y = Q[V]);
476
+ }
477
+ if (Y === void 0) return;
478
+ const _ = {
479
+ dataItem: Y,
480
+ rowIndex: V,
481
+ event: s,
482
+ triggerType: "keyboard",
483
+ ctrlKey: !!s.ctrlKey,
484
+ shiftKey: !!s.shiftKey,
485
+ metaKey: !!s.metaKey,
486
+ altKey: !!s.altKey
487
+ };
488
+ t(Y, _);
489
+ },
490
+ isIgnoredTarget: T
389
491
  };
390
- }, ze = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), He = (e) => !!e && typeof e == "object" && "field" in e, $e = (e, t) => !e || typeof e != "object" ? !1 : ze(e) ? e.filters.some(
391
- (l) => $e(l, t)
392
- ) : He(e) ? e.field === t : !1, pt = (e) => (t) => e.value?.filters && e.value.filters.some(
393
- (l) => $e(l, t)
394
- ) ? "active" : "", Ze = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
492
+ }, Be = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
395
493
  const t = e.replace(/\D/g, "").slice(0, 9);
396
494
  return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
397
- }, Ye = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, We = (e) => e <= 5 ? e : Math.min(e + 1, 10), _e = (e) => {
398
- const t = U(Ce(e.initialValue ?? "")), l = U(!1), A = U(
399
- e.errorMessage?.trim() || Ze
400
- ), m = f(() => t.value.replace(/\D/g, "")), g = f(() => {
401
- const u = m.value.length;
402
- return u === 5 || u === 9;
403
- }), I = f(() => l.value && !g.value), b = f(() => !l.value || g.value), M = f(() => l.value), $ = (u, S) => {
404
- const Z = We(S);
495
+ }, ze = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, He = (e) => e <= 5 ? e : Math.min(e + 1, 10), Ze = (e) => {
496
+ const t = U(Ce(e.initialValue ?? "")), r = U(!1), g = U(
497
+ e.errorMessage?.trim() || Be
498
+ ), f = v(() => t.value.replace(/\D/g, "")), p = v(() => {
499
+ const l = f.value.length;
500
+ return l === 5 || l === 9;
501
+ }), A = v(() => r.value && !p.value), C = v(() => !r.value || p.value), T = v(() => r.value), q = (l, y) => {
502
+ const L = He(y);
405
503
  B(() => {
406
- u.isConnected && u.setSelectionRange(Z, Z);
504
+ l.isConnected && l.setSelectionRange(L, L);
407
505
  });
408
506
  };
409
507
  return {
410
508
  // writable state
411
509
  zipDisplay: t,
412
- submitted: l,
413
- errorMessage: A,
510
+ submitted: r,
511
+ errorMessage: g,
414
512
  // bindings
415
513
  wrapperClass: "fk-zip-textbox",
416
514
  // derived state
417
- zipRaw: m,
418
- isZipValid: g,
419
- showZipError: I,
420
- textBoxValid: b,
421
- textBoxValidate: M,
515
+ zipRaw: f,
516
+ isZipValid: p,
517
+ showZipError: A,
518
+ textBoxValid: C,
519
+ textBoxValidate: T,
422
520
  // actions
423
- handleZipInput: (...u) => {
424
- const S = u[0], v = S?.event?.target, k = S?.value, V = Array.isArray(k) ? k.join("") : String(k ?? ""), H = v?.selectionStart !== void 0 && v.selectionStart !== null ? Ye(
425
- v.value,
426
- v.selectionStart
427
- ) : V.replace(/\D/g, "").length;
428
- t.value = Ce(V), v && $(v, H);
521
+ handleZipInput: (...l) => {
522
+ const y = l[0], h = y?.event?.target, k = y?.value, x = Array.isArray(k) ? k.join("") : String(k ?? ""), V = h?.selectionStart !== void 0 && h.selectionStart !== null ? ze(
523
+ h.value,
524
+ h.selectionStart
525
+ ) : x.replace(/\D/g, "").length;
526
+ t.value = Ce(x), h && q(h, V);
429
527
  },
430
- submitAndValidate: (u) => {
431
- l.value = !0;
432
- const S = g.value;
433
- return !S && u?.focus && B(() => {
528
+ submitAndValidate: (l) => {
529
+ r.value = !0;
530
+ const y = p.value;
531
+ return !y && l?.focus && B(() => {
434
532
  document.getElementById(
435
533
  e.id
436
534
  )?.focus();
437
- }), S;
535
+ }), y;
438
536
  },
439
- buildPayload: () => ({ zip: m.value })
537
+ buildPayload: () => ({ zip: f.value })
440
538
  };
441
539
  };
442
- function je(e, t) {
443
- const l = U(!1);
444
- Fe(() => {
540
+ function Ye(e, t) {
541
+ const r = U(!1);
542
+ Te(() => {
445
543
  e.value?.setAttribute("aria-invalid", String(!t.isValid()));
446
544
  });
447
- function A(g) {
448
- const I = e.value ?? g.currentTarget, b = g.relatedTarget;
449
- (!I || !I.contains(b)) && (l.value = !0);
545
+ function g(p) {
546
+ const A = e.value ?? p.currentTarget, C = p.relatedTarget;
547
+ (!A || !A.contains(C)) && (r.value = !0);
450
548
  }
451
- function m() {
452
- l.value = !1;
549
+ function f() {
550
+ r.value = !1;
453
551
  }
454
- return { touched: l, onFocusout: A, reset: m };
552
+ return { touched: r, onFocusout: g, reset: f };
455
553
  }
456
- function Ge(e, t) {
457
- const l = U(!1), A = U(!1), m = f(
458
- () => le(t.submitted) || l.value
459
- ), g = f(() => !m.value || t.isValid()), I = je(e, {
460
- isValid: () => g.value
554
+ function We(e, t) {
555
+ const r = U(!1), g = U(!1), f = v(
556
+ () => oe(t.submitted) || r.value
557
+ ), p = v(() => !f.value || t.isValid()), A = Ye(e, {
558
+ isValid: () => p.value
461
559
  });
462
- function b(E) {
463
- return f(() => !m.value || le(E));
560
+ function C(s) {
561
+ return v(() => !f.value || oe(s));
464
562
  }
465
- function M(E) {
563
+ function T(s) {
466
564
  return Object.fromEntries(
467
- Object.entries(E).map(([u, S]) => [
468
- u,
469
- b(S)
565
+ Object.entries(s).map(([l, y]) => [
566
+ l,
567
+ C(y)
470
568
  ])
471
569
  );
472
570
  }
473
- function $(E) {
474
- const u = le(E);
475
- if (!u) return;
476
- u.querySelector(
571
+ function q(s) {
572
+ const l = oe(s);
573
+ if (!l) return;
574
+ l.querySelector(
477
575
  '.k-invalid input, .k-invalid[tabindex="0"]'
478
576
  )?.focus();
479
577
  }
480
- function h(E) {
481
- if (A.value) {
482
- A.value = !1;
578
+ function D(s) {
579
+ if (g.value) {
580
+ g.value = !1;
483
581
  return;
484
582
  }
485
- I.onFocusout(E), I.touched.value && (l.value = !0);
583
+ A.onFocusout(s), A.touched.value && (r.value = !0);
486
584
  }
487
- function P() {
488
- l.value = !1, A.value = !0, I.reset();
585
+ function $() {
586
+ r.value = !1, g.value = !0, A.reset();
489
587
  }
490
588
  return {
491
- touched: l,
492
- fieldsetValidate: m,
493
- onFocusout: h,
494
- reset: P,
495
- createFieldValidity: b,
496
- createFieldValidationsMap: M,
497
- focusFirstInvalidField: $
589
+ touched: r,
590
+ fieldsetValidate: f,
591
+ onFocusout: D,
592
+ reset: $,
593
+ createFieldValidity: C,
594
+ createFieldValidationsMap: T,
595
+ focusFirstInvalidField: q
498
596
  };
499
597
  }
500
- const Je = [
598
+ const Ge = [
501
599
  { label: "Alabama", value: "AL" },
502
600
  { label: "Alaska", value: "AK" },
503
601
  { label: "Arizona", value: "AZ" },
@@ -556,8 +654,8 @@ function De(e) {
556
654
  }
557
655
  return "";
558
656
  }
559
- function Xe() {
560
- const e = qe({
657
+ function je() {
658
+ const e = Ve({
561
659
  address1: "",
562
660
  address2: "",
563
661
  city: "",
@@ -566,373 +664,348 @@ function Xe() {
566
664
  });
567
665
  return {
568
666
  formData: e,
569
- onAddress1Input: (...I) => {
570
- e.address1 = De(I[0]);
667
+ onAddress1Input: (...A) => {
668
+ e.address1 = De(A[0]);
571
669
  },
572
- onAddress2Input: (...I) => {
573
- e.address2 = De(I[0]);
670
+ onAddress2Input: (...A) => {
671
+ e.address2 = De(A[0]);
574
672
  },
575
- onCityInput: (...I) => {
576
- e.city = De(I[0]);
673
+ onCityInput: (...A) => {
674
+ e.city = De(A[0]);
577
675
  },
578
- onStateChange: (I) => {
579
- e.state = I.value;
676
+ onStateChange: (A) => {
677
+ e.state = A.value;
580
678
  },
581
679
  resetFormData: () => {
582
680
  e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
583
681
  }
584
682
  };
585
683
  }
586
- function Qe(e, t = "zip") {
587
- const l = _e({ id: t }), {
588
- zipDisplay: A,
589
- zipRaw: m,
590
- isZipValid: g,
591
- wrapperClass: I,
592
- handleZipInput: b
593
- } = l;
594
- return ue(m, ($) => {
595
- e.zip = $;
684
+ function _e(e, t = "zip") {
685
+ const r = Ze({ id: t }), {
686
+ zipDisplay: g,
687
+ zipRaw: f,
688
+ isZipValid: p,
689
+ wrapperClass: A,
690
+ handleZipInput: C
691
+ } = r;
692
+ return ue(f, (q) => {
693
+ e.zip = q;
596
694
  }), {
597
- zipDisplay: A,
598
- isZipValid: g,
599
- zipWrapperClass: I,
600
- onZipInput: b,
695
+ zipDisplay: g,
696
+ isZipValid: p,
697
+ zipWrapperClass: A,
698
+ onZipInput: C,
601
699
  resetZip: () => {
602
- A.value = "", e.zip = "";
700
+ g.value = "", e.zip = "";
603
701
  }
604
702
  };
605
703
  }
606
- function et(e) {
607
- const t = f(
704
+ function Je(e) {
705
+ const t = v(
608
706
  () => e.formData.address1.trim() !== ""
609
- ), l = f(() => e.formData.city.trim() !== ""), A = f(() => !!e.formData.state), m = f(() => le(e.isZipValid)), g = f(
610
- () => t.value && l.value && A.value && m.value
707
+ ), r = v(() => e.formData.city.trim() !== ""), g = v(() => !!e.formData.state), f = v(() => oe(e.isZipValid)), p = v(
708
+ () => t.value && r.value && g.value && f.value
611
709
  );
612
710
  return {
613
711
  strictAddress1Valid: t,
614
- strictCityValid: l,
615
- strictStateValid: A,
616
- strictZipValid: m,
617
- strictAddressValid: g
712
+ strictCityValid: r,
713
+ strictStateValid: g,
714
+ strictZipValid: f,
715
+ strictAddressValid: p
618
716
  };
619
717
  }
620
- function tt(e) {
718
+ function Xe(e) {
621
719
  if (!e) return;
622
720
  e.querySelector(
623
721
  '.k-invalid input, .k-invalid[tabindex="0"]'
624
722
  )?.focus();
625
723
  }
626
- function nt(e, t) {
627
- const l = e ?? t.currentTarget, A = t.relatedTarget;
628
- return !l || !l.contains(A);
724
+ function Qe(e, t) {
725
+ const r = e ?? t.currentTarget, g = t.relatedTarget;
726
+ return !r || !r.contains(g);
629
727
  }
630
- function vt(e) {
728
+ function ct(e) {
631
729
  const t = U(
632
- le(e.fieldsetRef)
730
+ oe(e.fieldsetRef)
633
731
  );
634
- Fe(() => {
635
- t.value = le(e.fieldsetRef);
732
+ Te(() => {
733
+ t.value = oe(e.fieldsetRef);
636
734
  });
637
- const l = U(!1), A = U(!1), m = f(() => le(e.required) ?? !0), {
638
- formData: g,
639
- onAddress1Input: I,
640
- onAddress2Input: b,
641
- onCityInput: M,
642
- onStateChange: $,
643
- resetFormData: h
644
- } = Xe(), P = `${e.addressId}-zip`, { zipDisplay: E, isZipValid: u, zipWrapperClass: S, onZipInput: Z, resetZip: v } = Qe(g, P), {
735
+ const r = U(!1), g = U(!1), f = v(() => oe(e.required) ?? !0), {
736
+ formData: p,
737
+ onAddress1Input: A,
738
+ onAddress2Input: C,
739
+ onCityInput: T,
740
+ onStateChange: q,
741
+ resetFormData: D
742
+ } = je(), $ = `${e.addressId}-zip`, { zipDisplay: s, isZipValid: l, zipWrapperClass: y, onZipInput: L, resetZip: h } = _e(p, $), {
645
743
  strictAddress1Valid: k,
646
- strictCityValid: V,
647
- strictStateValid: H,
648
- strictZipValid: Q,
649
- strictAddressValid: J
650
- } = et({
651
- formData: g,
652
- isZipValid: u
653
- }), ee = Ge(t, {
654
- submitted: l,
655
- isValid: () => J.value
656
- }), { touched: oe, fieldsetValidate: o, onFocusout: w, reset: c } = ee, p = ee.createFieldValidationsMap({
744
+ strictCityValid: x,
745
+ strictStateValid: V,
746
+ strictZipValid: Y,
747
+ strictAddressValid: _
748
+ } = Je({
749
+ formData: p,
750
+ isZipValid: l
751
+ }), Q = We(t, {
752
+ submitted: r,
753
+ isValid: () => _.value
754
+ }), { touched: le, fieldsetValidate: i, onFocusout: w, reset: d } = Q, b = Q.createFieldValidationsMap({
657
755
  address1: k,
658
- city: V,
659
- state: H,
660
- zip: Q,
661
- address: J
756
+ city: x,
757
+ state: V,
758
+ zip: Y,
759
+ address: _
662
760
  }), {
663
- address1: x,
664
- city: y,
665
- state: C,
666
- zip: L,
667
- address: Y
668
- } = p, ae = f(
669
- () => m.value ? o.value : !1
670
- ), se = f(
671
- () => m.value ? x.value : !0
672
- ), a = f(
673
- () => m.value ? y.value : !0
674
- ), d = f(
675
- () => m.value ? C.value : !0
676
- ), F = f(
677
- () => m.value ? L.value : !0
678
- ), K = f(
679
- () => m.value ? Y.value : !0
680
- ), N = { value: null, label: "State" }, W = Je.map(({ label: s, value: D }) => ({
681
- label: s,
682
- value: D
683
- })), n = f(() => ({
684
- address1: g.address1.trim(),
685
- address2: g.address2.trim(),
686
- city: g.city.trim(),
687
- state: (g.state ?? "").trim().toUpperCase(),
688
- zip: g.zip.replace(/\D/g, "")
689
- })), i = f(() => g.address1.trim() === "" && g.address2.trim() === "" && g.city.trim() === "" && (g.state ?? "").trim() === "" && g.zip.replace(/\D/g, "") === ""), T = f(() => !i.value), q = f(() => !m.value && T.value && (!k.value || !V.value || !H.value)), _ = f(() => {
690
- const s = g.zip.replace(/\D/g, "");
691
- return !m.value && T.value && s.length !== 5 && s.length !== 9;
692
- }), X = f(() => !m.value && T.value && !J.value), O = f(() => !m.value && X.value && (A.value || l.value));
761
+ address1: I,
762
+ city: S,
763
+ state: M,
764
+ zip: K,
765
+ address: W
766
+ } = b, ae = v(
767
+ () => f.value ? i.value : !1
768
+ ), se = v(
769
+ () => f.value ? I.value : !0
770
+ ), a = v(
771
+ () => f.value ? S.value : !0
772
+ ), m = v(
773
+ () => f.value ? M.value : !0
774
+ ), R = v(
775
+ () => f.value ? K.value : !0
776
+ ), z = v(
777
+ () => f.value ? W.value : !0
778
+ ), H = { value: null, label: "State" }, G = Ge.map(({ label: c, value: E }) => ({
779
+ label: c,
780
+ value: E
781
+ })), n = v(() => ({
782
+ address1: p.address1.trim(),
783
+ address2: p.address2.trim(),
784
+ city: p.city.trim(),
785
+ state: (p.state ?? "").trim().toUpperCase(),
786
+ zip: p.zip.replace(/\D/g, "")
787
+ })), u = v(() => p.address1.trim() === "" && p.address2.trim() === "" && p.city.trim() === "" && (p.state ?? "").trim() === "" && p.zip.replace(/\D/g, "") === ""), F = v(() => !u.value), N = v(() => !f.value && F.value && (!k.value || !x.value || !V.value)), j = v(() => {
788
+ const c = p.zip.replace(/\D/g, "");
789
+ return !f.value && F.value && c.length !== 5 && c.length !== 9;
790
+ }), ee = v(() => !f.value && F.value && !_.value), O = v(() => !f.value && ee.value && (g.value || r.value));
693
791
  return ue(n, () => {
694
- m.value || (A.value = !1);
695
- }), ue(m, (s) => {
696
- s || (l.value = !1, A.value = !1, c());
792
+ f.value || (g.value = !1);
793
+ }), ue(f, (c) => {
794
+ c || (r.value = !1, g.value = !1, d());
697
795
  }), {
698
- formData: g,
699
- submitted: l,
700
- touched: oe,
796
+ formData: p,
797
+ submitted: r,
798
+ touched: le,
701
799
  addressValidate: ae,
702
800
  address1Valid: se,
703
801
  cityValid: a,
704
- stateValid: d,
705
- zipValid: F,
706
- addressValid: K,
802
+ stateValid: m,
803
+ zipValid: R,
804
+ addressValid: z,
707
805
  optionalFeedbackActive: O,
708
- optionalPartialInvalid: X,
709
- optionalMissingRequiredFields: q,
710
- optionalZipInvalid: _,
711
- stateDefaultItem: N,
712
- stateOptions: W,
713
- zipDisplay: E,
714
- zipWrapperClass: S,
715
- onAddress1Input: I,
716
- onAddress2Input: b,
717
- onCityInput: M,
718
- onStateChange: $,
719
- onZipInput: Z,
720
- onFieldsetFocusout: (s) => {
721
- const D = nt(t.value, s);
722
- w(s), !m.value && D && (A.value = !0);
806
+ optionalPartialInvalid: ee,
807
+ optionalMissingRequiredFields: N,
808
+ optionalZipInvalid: j,
809
+ stateDefaultItem: H,
810
+ stateOptions: G,
811
+ zipDisplay: s,
812
+ zipWrapperClass: y,
813
+ onAddress1Input: A,
814
+ onAddress2Input: C,
815
+ onCityInput: T,
816
+ onStateChange: q,
817
+ onZipInput: L,
818
+ onFieldsetFocusout: (c) => {
819
+ const E = Qe(t.value, c);
820
+ w(c), !f.value && E && (g.value = !0);
723
821
  },
724
822
  normalizedPayload: n,
725
- validateForSubmit: async () => m.value ? (l.value = !0, J.value ? {
823
+ validateForSubmit: async () => f.value ? (r.value = !0, _.value ? {
726
824
  isValid: !0,
727
825
  payload: n.value
728
- } : (await B(), tt(t.value), { isValid: !1, payload: null })) : i.value || J.value ? (l.value = !1, {
826
+ } : (await B(), Xe(t.value), { isValid: !1, payload: null })) : u.value || _.value ? (r.value = !1, {
729
827
  isValid: !0,
730
828
  payload: n.value
731
- }) : (l.value = !0, { isValid: !1, payload: null }),
829
+ }) : (r.value = !0, { isValid: !1, payload: null }),
732
830
  reset: () => {
733
- l.value = !1, A.value = !1, c(), h(), v();
831
+ r.value = !1, g.value = !1, d(), D(), h();
734
832
  }
735
833
  };
736
834
  }
737
- function at(e) {
738
- return Oe() ? (Ue(e), !0) : !1;
739
- }
740
- const Pe = typeof window < "u" && typeof document < "u";
835
+ const et = typeof window < "u" && typeof document < "u";
741
836
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
742
- const rt = Object.prototype.toString, lt = (e) => rt.call(e) === "[object Object]", ye = () => {
743
- }, ot = /* @__PURE__ */ it();
744
- function it() {
745
- var e, t;
746
- return Pe && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
747
- }
837
+ const tt = Object.prototype.toString, nt = (e) => tt.call(e) === "[object Object]", Se = () => {
838
+ };
748
839
  function Ee(e) {
749
840
  return Array.isArray(e) ? e : [e];
750
841
  }
751
- function st(e, t, l) {
752
- return ue(
753
- e,
754
- t,
755
- {
756
- ...l,
757
- immediate: !0
758
- }
759
- );
842
+ function at(e, t, r) {
843
+ return ue(e, t, {
844
+ ...r,
845
+ immediate: !0
846
+ });
760
847
  }
761
- const Ve = Pe ? window : void 0;
762
- function be(e) {
848
+ const Re = et ? window : void 0;
849
+ function he(e) {
763
850
  var t;
764
- const l = le(e);
765
- return (t = l?.$el) != null ? t : l;
851
+ const r = oe(e);
852
+ return (t = r?.$el) !== null && t !== void 0 ? t : r;
766
853
  }
767
- function Me(...e) {
768
- const t = [], l = () => {
769
- t.forEach((b) => b()), t.length = 0;
770
- }, A = (b, M, $, h) => (b.addEventListener(M, $, h), () => b.removeEventListener(M, $, h)), m = f(() => {
771
- const b = Ee(le(e[0])).filter((M) => M != null);
772
- return b.every((M) => typeof M != "string") ? b : void 0;
773
- }), g = st(
774
- () => {
775
- var b, M;
776
- return [
777
- (M = (b = m.value) == null ? void 0 : b.map(($) => be($))) != null ? M : [Ve].filter(($) => $ != null),
778
- Ee(le(m.value ? e[1] : e[0])),
779
- Ee(Be(m.value ? e[2] : e[1])),
780
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
781
- le(m.value ? e[3] : e[2])
782
- ];
783
- },
784
- ([b, M, $, h]) => {
785
- if (l(), !b?.length || !M?.length || !$?.length)
786
- return;
787
- const P = lt(h) ? { ...h } : h;
788
- t.push(
789
- ...b.flatMap(
790
- (E) => M.flatMap(
791
- (u) => $.map((S) => A(E, u, S, P))
792
- )
793
- )
794
- );
795
- },
796
- { flush: "post" }
797
- ), I = () => {
798
- g(), l();
799
- };
800
- return at(l), I;
854
+ function Ie(...e) {
855
+ const t = (g, f, p, A) => (g.addEventListener(f, p, A), () => g.removeEventListener(f, p, A)), r = v(() => {
856
+ const g = Ee(oe(e[0])).filter((f) => f != null);
857
+ return g.every((f) => typeof f != "string") ? g : void 0;
858
+ });
859
+ return at(() => {
860
+ var g, f;
861
+ return [
862
+ (g = (f = r.value) === null || f === void 0 ? void 0 : f.map((p) => he(p))) !== null && g !== void 0 ? g : [Re].filter((p) => p != null),
863
+ Ee(oe(r.value ? e[1] : e[0])),
864
+ Ee(Le(r.value ? e[2] : e[1])),
865
+ oe(r.value ? e[3] : e[2])
866
+ ];
867
+ }, ([g, f, p, A], C, T) => {
868
+ if (!g?.length || !f?.length || !p?.length) return;
869
+ const q = nt(A) ? { ...A } : A, D = g.flatMap(($) => f.flatMap((s) => p.map((l) => t($, s, l, q))));
870
+ T(() => {
871
+ D.forEach(($) => $());
872
+ });
873
+ }, { flush: "post" });
801
874
  }
802
- let Te = !1;
803
- function Re(e, t, l = {}) {
804
- const { window: A = Ve, ignore: m = [], capture: g = !0, detectIframe: I = !1, controls: b = !1 } = l;
805
- if (!A)
806
- return b ? { stop: ye, cancel: ye, trigger: ye } : ye;
807
- if (ot && !Te) {
808
- Te = !0;
809
- const v = { passive: !0 };
810
- Array.from(A.document.body.children).forEach((k) => k.addEventListener("click", ye, v)), A.document.documentElement.addEventListener("click", ye, v);
811
- }
812
- let M = !0;
813
- const $ = (v) => le(m).some((k) => {
814
- if (typeof k == "string")
815
- return Array.from(A.document.querySelectorAll(k)).some((V) => V === v.target || v.composedPath().includes(V));
875
+ function $e(e, t, r = {}) {
876
+ const { window: g = Re, ignore: f = [], capture: p = !0, detectIframe: A = !1, controls: C = !1 } = r;
877
+ if (!g) return C ? {
878
+ stop: Se,
879
+ cancel: Se,
880
+ trigger: Se
881
+ } : Se;
882
+ let T = !0;
883
+ const q = (h) => oe(f).some((k) => {
884
+ if (typeof k == "string") return Array.from(g.document.querySelectorAll(k)).some((x) => x === h.target || h.composedPath().includes(x));
816
885
  {
817
- const V = be(k);
818
- return V && (v.target === V || v.composedPath().includes(V));
886
+ const x = he(k);
887
+ return x && (h.target === x || h.composedPath().includes(x));
819
888
  }
820
889
  });
821
- function h(v) {
822
- const k = le(v);
890
+ function D(h) {
891
+ const k = oe(h);
823
892
  return k && k.$.subTree.shapeFlag === 16;
824
893
  }
825
- function P(v, k) {
826
- const V = le(v), H = V.$.subTree && V.$.subTree.children;
827
- return H == null || !Array.isArray(H) ? !1 : H.some((Q) => Q.el === k.target || k.composedPath().includes(Q.el));
894
+ function $(h, k) {
895
+ const x = oe(h), V = x.$.subTree && x.$.subTree.children;
896
+ return V == null || !Array.isArray(V) ? !1 : V.some((Y) => Y.el === k.target || k.composedPath().includes(Y.el));
828
897
  }
829
- const E = (v) => {
830
- const k = be(e);
831
- if (v.target != null && !(!(k instanceof Element) && h(e) && P(e, v)) && !(!k || k === v.target || v.composedPath().includes(k))) {
832
- if ("detail" in v && v.detail === 0 && (M = !$(v)), !M) {
833
- M = !0;
898
+ const s = (h) => {
899
+ const k = he(e);
900
+ if (h.target != null && !(!(k instanceof Element) && D(e) && $(e, h)) && !(!k || k === h.target || h.composedPath().includes(k))) {
901
+ if ("detail" in h && h.detail === 0 && (T = !q(h)), !T) {
902
+ T = !0;
834
903
  return;
835
904
  }
836
- t(v);
905
+ t(h);
837
906
  }
838
907
  };
839
- let u = !1;
840
- const S = [
841
- Me(A, "click", (v) => {
842
- u || (u = !0, setTimeout(() => {
843
- u = !1;
844
- }, 0), E(v));
845
- }, { passive: !0, capture: g }),
846
- Me(A, "pointerdown", (v) => {
847
- const k = be(e);
848
- M = !$(v) && !!(k && !v.composedPath().includes(k));
908
+ let l = !1;
909
+ const y = [
910
+ Ie(g, "click", (h) => {
911
+ l || (l = !0, setTimeout(() => {
912
+ l = !1;
913
+ }, 0), s(h));
914
+ }, {
915
+ passive: !0,
916
+ capture: p
917
+ }),
918
+ Ie(g, "pointerdown", (h) => {
919
+ const k = he(e);
920
+ T = !q(h) && !!(k && !h.composedPath().includes(k));
849
921
  }, { passive: !0 }),
850
- I && Me(A, "blur", (v) => {
922
+ A && Ie(g, "blur", (h) => {
851
923
  setTimeout(() => {
852
- var k;
853
- const V = be(e);
854
- ((k = A.document.activeElement) == null ? void 0 : k.tagName) === "IFRAME" && !V?.contains(A.document.activeElement) && t(v);
924
+ const k = he(e);
925
+ let x = g.document.activeElement;
926
+ for (; x?.shadowRoot; ) x = x.shadowRoot.activeElement;
927
+ x?.tagName === "IFRAME" && !k?.contains(g.document.activeElement) && t(h);
855
928
  }, 0);
856
929
  }, { passive: !0 })
857
- ].filter(Boolean), Z = () => S.forEach((v) => v());
858
- return b ? {
859
- stop: Z,
930
+ ].filter(Boolean), L = () => y.forEach((h) => h());
931
+ return C ? {
932
+ stop: L,
860
933
  cancel: () => {
861
- M = !1;
934
+ T = !1;
862
935
  },
863
- trigger: (v) => {
864
- M = !0, E(v), M = !1;
936
+ trigger: (h) => {
937
+ T = !0, s(h), T = !1;
865
938
  }
866
- } : Z;
939
+ } : L;
867
940
  }
868
941
  const xe = (e) => {
869
942
  if (e instanceof HTMLElement) return e;
870
943
  const t = e?.$el;
871
944
  return t instanceof HTMLElement ? t : null;
872
- }, ut = (e) => e instanceof HTMLButtonElement || e.getAttribute("role") === "button" || e.hasAttribute("aria-haspopup"), mt = (e) => {
873
- const t = U(null), l = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", A = () => xe(e.triggerRef.value), m = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), g = () => {
874
- const u = m();
875
- if (u)
876
- return u.focus(), !0;
877
- const S = A();
878
- return S?.focus(), !!S;
879
- }, I = () => {
880
- xe(e.menuRef.value)?.querySelector(l)?.focus();
881
- }, b = (u) => {
882
- e.isOpen.value && (t.value = u, e.requestHide());
945
+ }, rt = (e) => e instanceof HTMLButtonElement || e.getAttribute("role") === "button" || e.hasAttribute("aria-haspopup"), dt = (e) => {
946
+ const t = U(null), r = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", g = () => xe(e.triggerRef.value), f = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), p = () => {
947
+ const l = f();
948
+ if (l)
949
+ return l.focus(), !0;
950
+ const y = g();
951
+ return y?.focus(), !!y;
952
+ }, A = () => {
953
+ xe(e.menuRef.value)?.querySelector(r)?.focus();
954
+ }, C = (l) => {
955
+ e.isOpen.value && (t.value = l, e.requestHide());
883
956
  };
884
- Re(e.menuRef, () => b("outside-click"), {
957
+ $e(e.menuRef, () => C("outside-click"), {
885
958
  ignore: [e.triggerRef]
886
959
  }), e.manageAriaExpanded !== !1 && ue(
887
960
  [e.isOpen, e.triggerRef],
888
- ([u]) => {
889
- const S = A();
890
- !S || !ut(S) || S.setAttribute("aria-expanded", u ? "true" : "false");
961
+ ([l]) => {
962
+ const y = g();
963
+ !y || !rt(y) || y.setAttribute("aria-expanded", l ? "true" : "false");
891
964
  },
892
965
  { immediate: !0, flush: "post" }
893
966
  );
894
- const M = () => {
967
+ const T = () => {
895
968
  if (e.isOpen.value) {
896
- b("trigger-click");
969
+ C("trigger-click");
897
970
  return;
898
971
  }
899
- e.requestShow(), B(I);
972
+ e.requestShow(), B(A);
900
973
  };
901
974
  return {
902
975
  /**
903
976
  * Handles Kendo Menu selection: records keyboard or mouse modality,
904
977
  * requests popup close, then runs the optional caller-owned action.
905
978
  */
906
- handleMenuSelect: (u, S) => {
907
- b(
908
- u.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
909
- ), S?.(u);
979
+ handleMenuSelect: (l, y) => {
980
+ C(
981
+ l.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
982
+ ), y?.(l);
910
983
  },
911
984
  /**
912
985
  * Toggles the action menu. When opening, focuses the first enabled Kendo
913
986
  * Menu item after Vue renders the popup.
914
987
  */
915
- handleActionButtonClick: M,
988
+ handleActionButtonClick: T,
916
989
  /**
917
990
  * Handles trigger keyboard input: Enter and Space toggle the menu; Escape
918
991
  * closes an open menu or focuses the configured target when already closed.
919
992
  */
920
- handleActionButtonKeydown: (u) => {
921
- if (u.key === "Enter" || u.code === "Space") {
922
- u.preventDefault(), M();
993
+ handleActionButtonKeydown: (l) => {
994
+ if (l.key === "Enter" || l.code === "Space") {
995
+ l.preventDefault(), T();
923
996
  return;
924
997
  }
925
- if (u.key === "Escape") {
926
- if (u.preventDefault(), u.stopPropagation(), e.isOpen.value) {
927
- b("keyboard");
998
+ if (l.key === "Escape") {
999
+ if (l.preventDefault(), l.stopPropagation(), e.isOpen.value) {
1000
+ C("keyboard");
928
1001
  return;
929
1002
  }
930
- g();
1003
+ p();
931
1004
  }
932
1005
  },
933
1006
  /** Closes the open menu through the keyboard path when Escape is pressed inside it. */
934
- handleActionMenuEscape: (u) => {
935
- u.preventDefault(), u.stopPropagation(), b("keyboard");
1007
+ handleActionMenuEscape: (l) => {
1008
+ l.preventDefault(), l.stopPropagation(), C("keyboard");
936
1009
  },
937
1010
  /**
938
1011
  * Restores focus after Kendo Popup closes: keyboard closes prefer the
@@ -941,91 +1014,91 @@ const xe = (e) => {
941
1014
  */
942
1015
  handlePopupClose: () => {
943
1016
  B(() => {
944
- t.value === "keyboard" ? g() : t.value === "mouse-selection" && A()?.focus(), t.value = null;
1017
+ t.value === "keyboard" ? p() : t.value === "mouse-selection" && g()?.focus(), t.value = null;
945
1018
  });
946
1019
  }
947
1020
  };
948
1021
  };
949
- function gt(e) {
950
- const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(e.dateFormat ?? "mm/dd/yyyy"), g = f(() => !!e.required), I = 1e3, b = U(!1), M = ["ArrowUp", "ArrowDown"], $ = ["ArrowLeft", "ArrowRight"], h = f(() => (t.value ?? "").replace(/\D/g, "")), P = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : h.value.length <= 10 ? "yyyy" : "mm", E = f(() => {
1022
+ function ft(e) {
1023
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(e.dateFormat ?? "mm/dd/yyyy"), p = v(() => !!e.required), A = 1e3, C = U(!1), T = ["ArrowUp", "ArrowDown"], q = ["ArrowLeft", "ArrowRight"], D = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : D.value.length <= 10 ? "yyyy" : "mm", s = v(() => {
951
1024
  const a = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
952
1025
  return parseInt(a).toString().padStart(2, "0");
953
- }), u = f(() => {
1026
+ }), l = v(() => {
954
1027
  const a = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
955
1028
  return parseInt(a).toString().padStart(2, "0");
956
- }), S = f(() => {
1029
+ }), y = v(() => {
957
1030
  const a = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
958
1031
  return parseInt(a).toString().padStart(4, "0");
959
- }), Z = (a) => {
960
- if (h.value.length === 0) {
1032
+ }), L = (a) => {
1033
+ if (D.value.length === 0) {
961
1034
  e.onChange({ value: null, event: a });
962
1035
  return;
963
1036
  }
964
- if (h.value.length < 8) {
1037
+ if (D.value.length < 8) {
965
1038
  e.onChange({ value: null, event: a });
966
1039
  return;
967
1040
  }
968
- if ((t.value ?? "").length === 10 && h.value.length === 8) {
969
- const [d, F, K] = t.value.split("/"), N = parseInt(d), W = parseInt(F), n = parseInt(K);
970
- if (J(n, N, W)) {
971
- const i = H(n, N, W);
972
- v(i) ? e.onChange({ value: i, event: a }) : e.onChange({ value: null, event: a });
1041
+ if ((t.value ?? "").length === 10 && D.value.length === 8) {
1042
+ const [m, R, z] = t.value.split("/"), H = parseInt(m), G = parseInt(R), n = parseInt(z);
1043
+ if (_(n, H, G)) {
1044
+ const u = V(n, H, G);
1045
+ h(u) ? e.onChange({ value: u, event: a }) : e.onChange({ value: null, event: a });
973
1046
  } else
974
1047
  e.onChange({ value: null, event: a });
975
1048
  }
976
- }, v = (a) => {
977
- const d = e.min ?? void 0, F = e.max ?? void 0;
978
- return !(d && a < d || F && a > F);
979
- }, k = f(() => {
980
- if ((t.value ?? "").length === 10 && h.value.length === 8) {
981
- const [a, d, F] = (t.value ?? "").split("/"), K = parseInt(a), N = parseInt(d), W = parseInt(F);
982
- if (J(W, K, N))
983
- return H(W, K, N);
1049
+ }, h = (a) => {
1050
+ const m = e.min ?? void 0, R = e.max ?? void 0;
1051
+ return !(m && a < m || R && a > R);
1052
+ }, k = v(() => {
1053
+ if ((t.value ?? "").length === 10 && D.value.length === 8) {
1054
+ const [a, m, R] = (t.value ?? "").split("/"), z = parseInt(a), H = parseInt(m), G = parseInt(R);
1055
+ if (_(G, z, H))
1056
+ return V(G, z, H);
984
1057
  }
985
1058
  return null;
986
- }), V = f(() => (t.value ?? "").length === 10 && h.value.length === 8), H = (a, d, F) => {
987
- const K = /* @__PURE__ */ new Date(0);
988
- return K.setFullYear(a, d - 1, F), K.setHours(0, 0, 0, 0), K;
989
- }, Q = (a, d) => H(a, d + 1, 0).getDate(), J = (a, d, F) => d >= 1 && d <= 12 && a >= I && F >= 1 && F <= Q(a, d), ee = (a) => {
1059
+ }), x = v(() => (t.value ?? "").length === 10 && D.value.length === 8), V = (a, m, R) => {
1060
+ const z = /* @__PURE__ */ new Date(0);
1061
+ return z.setFullYear(a, m - 1, R), z.setHours(0, 0, 0, 0), z;
1062
+ }, Y = (a, m) => V(a, m + 1, 0).getDate(), _ = (a, m, R) => m >= 1 && m <= 12 && a >= A && R >= 1 && R <= Y(a, m), Q = (a) => {
990
1063
  t.value = a.value;
991
- const d = a.event?.target;
992
- l.value = d?.selectionStart ?? 0, Z(a);
993
- }, oe = (a) => {
994
- l.value = a.target.selectionStart ?? 0;
995
- }, o = (a, d, F) => {
996
- const K = d?.selectionStart ?? l.value ?? 0;
997
- l.value = K;
998
- let N = parseInt(E.value), W = parseInt(u.value), n = parseInt(S.value);
999
- if (!(h.value.length >= 8) || !J(n, N, W)) {
1000
- const z = e.defaultValue ?? /* @__PURE__ */ new Date();
1001
- N = z.getMonth() + 1, W = z.getDate(), n = z.getFullYear(), t.value = `${String(N).padStart(2, "0")}/${String(W).padStart(
1064
+ const m = a.event?.target;
1065
+ r.value = m?.selectionStart ?? 0, L(a);
1066
+ }, le = (a) => {
1067
+ r.value = a.target.selectionStart ?? 0;
1068
+ }, i = (a, m, R) => {
1069
+ const z = m?.selectionStart ?? r.value ?? 0;
1070
+ r.value = z;
1071
+ let H = parseInt(s.value), G = parseInt(l.value), n = parseInt(y.value);
1072
+ if (!(D.value.length >= 8) || !_(n, H, G)) {
1073
+ const Z = e.defaultValue ?? /* @__PURE__ */ new Date();
1074
+ H = Z.getMonth() + 1, G = Z.getDate(), n = Z.getFullYear(), t.value = `${String(H).padStart(2, "0")}/${String(G).padStart(
1002
1075
  2,
1003
1076
  "0"
1004
1077
  )}/${String(n)}`;
1005
- const ce = H(n, N, W);
1006
- e.onChange({ value: v(ce) ? ce : null, event: F }), y({ useRAF: !0 });
1078
+ const ce = V(n, H, G);
1079
+ e.onChange({ value: h(ce) ? ce : null, event: R }), S({ useRAF: !0 });
1007
1080
  return;
1008
1081
  }
1009
- const T = P(K);
1010
- if (T === "mm")
1011
- N = a === "ArrowUp" ? N < 12 ? N + 1 : 1 : N > 1 ? N - 1 : 12;
1012
- else if (T === "dd") {
1013
- const z = new Date(n, N, 0).getDate();
1014
- W = a === "ArrowUp" ? W < z ? W + 1 : 1 : W > 1 ? W - 1 : z;
1015
- } else T === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
1016
- t.value = `${String(N).padStart(2, "0")}/${String(W).padStart(
1082
+ const F = $(z);
1083
+ if (F === "mm")
1084
+ H = a === "ArrowUp" ? H < 12 ? H + 1 : 1 : H > 1 ? H - 1 : 12;
1085
+ else if (F === "dd") {
1086
+ const Z = new Date(n, H, 0).getDate();
1087
+ G = a === "ArrowUp" ? G < Z ? G + 1 : 1 : G > 1 ? G - 1 : Z;
1088
+ } else F === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
1089
+ t.value = `${String(H).padStart(2, "0")}/${String(G).padStart(
1017
1090
  2,
1018
1091
  "0"
1019
1092
  )}/${String(n)}`;
1020
- const [q, _, X] = t.value.split("/"), O = H(
1021
- parseInt(X),
1022
- parseInt(q),
1023
- parseInt(_)
1093
+ const [N, j, ee] = t.value.split("/"), O = V(
1094
+ parseInt(ee),
1095
+ parseInt(N),
1096
+ parseInt(j)
1024
1097
  );
1025
- O.toString() !== "Invalid Date" && parseInt(X) >= 1e3 ? e.onChange({
1026
- value: v(O) ? O : null,
1027
- event: F
1028
- }) : e.onChange({ value: null, event: F }), y({ useRAF: !0 });
1098
+ O.toString() !== "Invalid Date" && parseInt(ee) >= 1e3 ? e.onChange({
1099
+ value: h(O) ? O : null,
1100
+ event: R
1101
+ }) : e.onChange({ value: null, event: R }), S({ useRAF: !0 });
1029
1102
  }, w = (a) => {
1030
1103
  if (a.code === "Space" || a.key === " ") {
1031
1104
  a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
@@ -1035,72 +1108,72 @@ function gt(e) {
1035
1108
  a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
1036
1109
  return;
1037
1110
  }
1038
- if (M.includes(a.key)) {
1111
+ if (T.includes(a.key)) {
1039
1112
  if (a.altKey) return;
1040
1113
  a.preventDefault(), a.stopPropagation();
1041
- const d = a.target;
1042
- o(a.key, d, a);
1114
+ const m = a.target;
1115
+ i(a.key, m, a);
1043
1116
  return;
1044
1117
  }
1045
- }, c = (a) => {
1118
+ }, d = (a) => {
1046
1119
  a.preventDefault();
1047
- const d = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1048
- o(d, a.target, a);
1049
- }, p = (a) => {
1050
- const d = a.target;
1051
- if ($.includes(a.key)) {
1052
- l.value = d?.selectionStart ?? 0;
1120
+ const m = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1121
+ i(m, a.target, a);
1122
+ }, b = (a) => {
1123
+ const m = a.target;
1124
+ if (q.includes(a.key)) {
1125
+ r.value = m?.selectionStart ?? 0;
1053
1126
  return;
1054
1127
  }
1055
- if (M.includes(a.key)) {
1128
+ if (T.includes(a.key)) {
1056
1129
  if (a.altKey) return;
1057
- l.value = d?.selectionStart ?? 0;
1130
+ r.value = m?.selectionStart ?? 0;
1058
1131
  }
1059
- }, x = (a) => {
1060
- b.value = !0, g.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && h.value.length === 0 && (e.externalValue.value = "");
1061
- const d = a.target;
1062
- d && (l.value = d.selectionStart ?? 0);
1063
- }, y = (a) => {
1064
- const d = () => {
1065
- const F = document.getElementById(
1132
+ }, I = (a) => {
1133
+ C.value = !0, p.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && D.value.length === 0 && (e.externalValue.value = "");
1134
+ const m = a.target;
1135
+ m && (r.value = m.selectionStart ?? 0);
1136
+ }, S = (a) => {
1137
+ const m = () => {
1138
+ const R = document.getElementById(
1066
1139
  e.id
1067
1140
  );
1068
- if (!F) return;
1069
- const K = a?.pos ?? l.value ?? F.value.length;
1141
+ if (!R) return;
1142
+ const z = a?.pos ?? r.value ?? R.value.length;
1070
1143
  try {
1071
- F.focus(), F.setSelectionRange(K, K);
1144
+ R.focus(), R.setSelectionRange(z, z);
1072
1145
  } catch {
1073
1146
  }
1074
1147
  };
1075
1148
  B(() => {
1076
1149
  if (a?.delay && a.delay > 0) {
1077
- setTimeout(d, a.delay);
1150
+ setTimeout(m, a.delay);
1078
1151
  return;
1079
1152
  }
1080
1153
  if (a?.useRAF) {
1081
- requestAnimationFrame(d);
1154
+ requestAnimationFrame(m);
1082
1155
  return;
1083
1156
  }
1084
- d();
1157
+ m();
1085
1158
  });
1086
1159
  };
1087
1160
  e.externalValue && ue(
1088
1161
  e.externalValue,
1089
1162
  (a) => {
1090
1163
  if (a) {
1091
- const d = new Date(a);
1092
- if (d.toString() !== "Invalid Date") {
1093
- const F = (d.getMonth() + 1).toString().padStart(2, "0"), K = d.getDate().toString().padStart(2, "0"), N = d.getFullYear().toString();
1094
- t.value = `${F}/${K}/${N}`, y({ delay: 50 });
1164
+ const m = new Date(a);
1165
+ if (m.toString() !== "Invalid Date") {
1166
+ const R = (m.getMonth() + 1).toString().padStart(2, "0"), z = m.getDate().toString().padStart(2, "0"), H = m.getFullYear().toString();
1167
+ t.value = `${R}/${z}/${H}`, S({ delay: 50 });
1095
1168
  return;
1096
1169
  }
1097
1170
  }
1098
1171
  },
1099
1172
  { immediate: !0 }
1100
1173
  );
1101
- const C = f(() => [
1102
- ["Date", `${E.value} / ${u.value} / ${S.value}`],
1103
- ["Digits only", h.value],
1174
+ const M = v(() => [
1175
+ ["Date", `${s.value} / ${l.value} / ${y.value}`],
1176
+ ["Digits only", D.value],
1104
1177
  [
1105
1178
  "min",
1106
1179
  e.min?.toLocaleDateString("en-US", {
@@ -1117,46 +1190,46 @@ function gt(e) {
1117
1190
  day: "2-digit"
1118
1191
  }) ?? null
1119
1192
  ]
1120
- ]), L = f(() => {
1121
- if (!g.value) {
1122
- if (!V.value) return !0;
1123
- const d = k.value;
1124
- return d ? v(d) : !1;
1193
+ ]), K = v(() => {
1194
+ if (!p.value) {
1195
+ if (!x.value) return !0;
1196
+ const m = k.value;
1197
+ return m ? h(m) : !1;
1125
1198
  }
1126
- if (!b.value) return !0;
1199
+ if (!C.value) return !0;
1127
1200
  const a = k.value;
1128
- return !V.value || !a ? !1 : v(a);
1129
- }), Y = f(() => {
1130
- if (!g.value) {
1131
- if (!V.value) return;
1132
- const d = k.value;
1133
- return d ? v(d) ? "valid" : "out-of-bounds" : "invalid-date";
1201
+ return !x.value || !a ? !1 : h(a);
1202
+ }), W = v(() => {
1203
+ if (!p.value) {
1204
+ if (!x.value) return;
1205
+ const m = k.value;
1206
+ return m ? h(m) ? "valid" : "out-of-bounds" : "invalid-date";
1134
1207
  }
1135
- if (!b.value) return;
1136
- if (h.value.length === 0 || !V.value)
1208
+ if (!C.value) return;
1209
+ if (D.value.length === 0 || !x.value)
1137
1210
  return "incomplete";
1138
1211
  const a = k.value;
1139
- return a ? v(a) ? "valid" : "out-of-bounds" : "invalid-date";
1140
- }), ae = f(() => {
1141
- const a = Y.value;
1212
+ return a ? h(a) ? "valid" : "out-of-bounds" : "invalid-date";
1213
+ }), ae = v(() => {
1214
+ const a = W.value;
1142
1215
  if (!a || a === "valid") return "";
1143
1216
  if (a === "incomplete")
1144
1217
  return "Required";
1145
1218
  if (a === "invalid-date")
1146
- return `Must be in ${m.value} format.`;
1147
- const d = e.min ? e.min.toLocaleDateString("en-US", {
1219
+ return `Must be in ${f.value} format.`;
1220
+ const m = e.min ? e.min.toLocaleDateString("en-US", {
1148
1221
  year: "numeric",
1149
1222
  month: "2-digit",
1150
1223
  day: "2-digit"
1151
- }) : null, F = e.max ? e.max.toLocaleDateString("en-US", {
1224
+ }) : null, R = e.max ? e.max.toLocaleDateString("en-US", {
1152
1225
  year: "numeric",
1153
1226
  month: "2-digit",
1154
1227
  day: "2-digit"
1155
1228
  }) : null;
1156
1229
  if (a === "out-of-bounds") {
1157
- if (d && F) return `Must be between ${d} and ${F}.`;
1158
- if (d) return `Must be on or after ${d}.`;
1159
- if (F) return `Must be on or before ${F}.`;
1230
+ if (m && R) return `Must be between ${m} and ${R}.`;
1231
+ if (m) return `Must be on or after ${m}.`;
1232
+ if (R) return `Must be on or before ${R}.`;
1160
1233
  }
1161
1234
  return "";
1162
1235
  }), se = () => {
@@ -1168,84 +1241,84 @@ function gt(e) {
1168
1241
  console.warn(`ID (#${e.id}) not found for styling.`);
1169
1242
  return;
1170
1243
  }
1171
- const d = a.closest(".k-datepicker");
1172
- if (!d) {
1244
+ const m = a.closest(".k-datepicker");
1245
+ if (!m) {
1173
1246
  console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
1174
1247
  return;
1175
1248
  }
1176
- const F = d.parentElement;
1177
- if (F) {
1178
- if (F.classList.contains("fk-datepicker"))
1249
+ const R = m.parentElement;
1250
+ if (R) {
1251
+ if (R.classList.contains("fk-datepicker"))
1179
1252
  return;
1180
- F.classList.add("fk-datepicker");
1253
+ R.classList.add("fk-datepicker");
1181
1254
  } else
1182
1255
  console.warn(
1183
1256
  `Parent of .k-datepicker not found for #${e.id} styling.`
1184
1257
  );
1185
1258
  });
1186
1259
  };
1187
- return Ie(() => {
1260
+ return Me(() => {
1188
1261
  se();
1189
1262
  }), {
1190
1263
  raw: t,
1191
- cursorPos: l,
1192
- debugEnabled: A,
1193
- debugLines: C,
1194
- placeholder: m,
1195
- isValid: L,
1196
- reason: G(Y),
1264
+ cursorPos: r,
1265
+ debugEnabled: g,
1266
+ debugLines: M,
1267
+ placeholder: f,
1268
+ isValid: K,
1269
+ reason: X(W),
1197
1270
  validationMessage: ae,
1198
- digitsOnly: h,
1199
- month: G(E),
1200
- day: G(u),
1201
- year: G(S),
1202
- datePart: P,
1203
- handleChange: ee,
1271
+ digitsOnly: D,
1272
+ month: X(s),
1273
+ day: X(l),
1274
+ year: X(y),
1275
+ datePart: $,
1276
+ handleChange: Q,
1204
1277
  handleKeyDown: w,
1205
- handleWheel: c,
1206
- handleKeyUp: p,
1207
- handleClick: oe,
1208
- handleBlur: x,
1278
+ handleWheel: d,
1279
+ handleKeyUp: b,
1280
+ handleClick: le,
1281
+ handleBlur: I,
1209
1282
  // Expose so consumers can re-run styling when needed
1210
1283
  initStyling: se
1211
1284
  };
1212
1285
  }
1213
- function yt(e) {
1214
- const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(!1), g = 1440 * 60 * 1e3, I = 365 * g, b = /* @__PURE__ */ new Date(), M = new Date(b.getTime() - I), $ = new Date(b.getTime() + I);
1215
- e.min = e.min ?? M, e.max = e.max ?? $;
1216
- const h = f(() => (t.value ?? "").replace(/\D/g, "")), P = (r, s) => new Date(r, s, 0).getDate(), E = (r, s, D) => s >= 1 && s <= 12 && r >= 1e3 && D >= 1 && D <= P(r, s), u = (r) => Date.UTC(r.getFullYear(), r.getMonth(), r.getDate()), S = (r) => {
1217
- if (!r) return null;
1218
- const s = e.min ?? new Date(Date.now() - 90 * g), D = e.max ?? /* @__PURE__ */ new Date(), R = u(r);
1219
- return R < u(s) || R > u(D) ? null : r;
1220
- }, Z = (r, s) => e.allowReverse ?? !1 ? !0 : r <= s, v = f(() => (t.value?.length ?? 0) >= 23 && h.value.length >= 16), k = (r) => {
1221
- if ((r ?? "").length < 23 || h.value.length < 16)
1286
+ function pt(e) {
1287
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(!1), p = 1440 * 60 * 1e3, A = 365 * p, C = /* @__PURE__ */ new Date(), T = new Date(C.getTime() - A), q = new Date(C.getTime() + A);
1288
+ e.min = e.min ?? T, e.max = e.max ?? q;
1289
+ const D = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (o, c) => new Date(o, c, 0).getDate(), s = (o, c, E) => c >= 1 && c <= 12 && o >= 1e3 && E >= 1 && E <= $(o, c), l = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), y = (o) => {
1290
+ if (!o) return null;
1291
+ const c = e.min ?? new Date(Date.now() - 90 * p), E = e.max ?? /* @__PURE__ */ new Date(), P = l(o);
1292
+ return P < l(c) || P > l(E) ? null : o;
1293
+ }, L = (o, c) => e.allowReverse ?? !1 ? !0 : o <= c, h = v(() => (t.value?.length ?? 0) >= 23 && D.value.length >= 16), k = (o) => {
1294
+ if ((o ?? "").length < 23 || D.value.length < 16)
1222
1295
  return { start: null, end: null };
1223
- const s = r.substring(0, 10), D = r.substring(13, 23), [R, te, ne] = s.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, ve, me] = D.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ne, R - 1, te), he = new Date(me, fe - 1, ve), we = E(ne, R, te) && ge.toString() !== "Invalid Date", Ae = E(me, fe, ve) && he.toString() !== "Invalid Date";
1224
- return { start: we ? ge : null, end: Ae ? he : null };
1225
- }, V = e.externalValid ?? U(!0), H = f(() => k(t.value)), Q = f(() => {
1226
- const r = S(H.value.start), s = S(H.value.end);
1227
- return { start: r, end: s };
1228
- }), J = f(() => {
1229
- if (!v.value) return;
1230
- const r = Q.value.start, s = Q.value.end;
1231
- if (!r || !s) return;
1232
- const D = Math.abs(u(s) - u(r));
1233
- return Math.round(D / 864e5 + 1);
1234
- }), ee = U(!1), oe = f(() => {
1235
- if (!ee.value) return;
1236
- const { start: r, end: s } = H.value;
1237
- if (!v.value) return "incomplete";
1238
- if (!r || !s) return "invalid-date";
1239
- if (!Q.value.start || !Q.value.end) return "out-of-bounds";
1240
- const D = Q.value.start, R = Q.value.end;
1241
- return Z(D, R) ? typeof e.maxSpanDays == "number" && J.value !== void 0 && J.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1242
- }), o = f(() => {
1243
- const r = oe.value;
1244
- return r === void 0 || r === "valid";
1245
- }), w = f(() => {
1246
- const { min: r, max: s } = e, D = oe.value;
1247
- if (!D) return "";
1248
- switch (D) {
1296
+ const c = o.substring(0, 10), E = o.substring(13, 23), [P, te, ne] = c.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = E.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ne, P - 1, te), ye = new Date(ve, fe - 1, me), ke = s(ne, P, te) && ge.toString() !== "Invalid Date", we = s(ve, fe, me) && ye.toString() !== "Invalid Date";
1297
+ return { start: ke ? ge : null, end: we ? ye : null };
1298
+ }, x = e.externalValid ?? U(!0), V = v(() => k(t.value)), Y = v(() => {
1299
+ const o = y(V.value.start), c = y(V.value.end);
1300
+ return { start: o, end: c };
1301
+ }), _ = v(() => {
1302
+ if (!h.value) return;
1303
+ const o = Y.value.start, c = Y.value.end;
1304
+ if (!o || !c) return;
1305
+ const E = Math.abs(l(c) - l(o));
1306
+ return Math.round(E / 864e5 + 1);
1307
+ }), Q = U(!1), le = v(() => {
1308
+ if (!Q.value) return;
1309
+ const { start: o, end: c } = V.value;
1310
+ if (!h.value) return "incomplete";
1311
+ if (!o || !c) return "invalid-date";
1312
+ if (!Y.value.start || !Y.value.end) return "out-of-bounds";
1313
+ const E = Y.value.start, P = Y.value.end;
1314
+ return L(E, P) ? typeof e.maxSpanDays == "number" && _.value !== void 0 && _.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1315
+ }), i = v(() => {
1316
+ const o = le.value;
1317
+ return o === void 0 || o === "valid";
1318
+ }), w = v(() => {
1319
+ const { min: o, max: c } = e, E = le.value;
1320
+ if (!E) return "";
1321
+ switch (E) {
1249
1322
  case "incomplete":
1250
1323
  return "Required";
1251
1324
  case "invalid-date":
@@ -1253,154 +1326,154 @@ function yt(e) {
1253
1326
  case "reversed-range":
1254
1327
  return "End Date must be on or after Start Date.";
1255
1328
  case "out-of-bounds":
1256
- return r && s ? `Dates must be between ${y(r)} and ${y(s)}.` : "Dates must be within the allowed range.";
1329
+ return o && c ? `Dates must be between ${S(o)} and ${S(c)}.` : "Dates must be within the allowed range.";
1257
1330
  case "span-exceeds-limit":
1258
1331
  return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
1259
1332
  default:
1260
1333
  return "";
1261
1334
  }
1262
- }), c = ["ArrowUp", "ArrowDown"], p = ["ArrowLeft", "ArrowRight"], x = (r, s) => String(r).padStart(s, "0"), y = (r) => `${x(r.getMonth() + 1, 2)}/${x(r.getDate(), 2)}/${x(
1263
- r.getFullYear(),
1335
+ }), d = ["ArrowUp", "ArrowDown"], b = ["ArrowLeft", "ArrowRight"], I = (o, c) => String(o).padStart(c, "0"), S = (o) => `${I(o.getMonth() + 1, 2)}/${I(o.getDate(), 2)}/${I(
1336
+ o.getFullYear(),
1264
1337
  4
1265
- )}`, C = (r) => r <= 2 ? { side: "start", part: "mm" } : r <= 5 ? { side: "start", part: (r <= 3, "dd") } : r <= 11 ? { side: "start", part: "yyyy" } : r <= 15 ? { side: "end", part: "mm" } : r <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, L = (r, s, D) => {
1266
- const R = s?.selectionStart ?? l.value ?? 0;
1267
- l.value = R;
1338
+ )}`, M = (o) => o <= 2 ? { side: "start", part: "mm" } : o <= 5 ? { side: "start", part: (o <= 3, "dd") } : o <= 11 ? { side: "start", part: "yyyy" } : o <= 15 ? { side: "end", part: "mm" } : o <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, K = (o, c, E) => {
1339
+ const P = c?.selectionStart ?? r.value ?? 0;
1340
+ r.value = P;
1268
1341
  const { start: te, end: ne } = k(t.value);
1269
1342
  if (!te && !ne) {
1270
- const j = /* @__PURE__ */ new Date(), de = y(j);
1271
- t.value = `${de} - ${de}`, e.onChange({ value: { start: j, end: j }, event: D }), B(() => {
1343
+ const J = /* @__PURE__ */ new Date(), de = S(J);
1344
+ t.value = `${de} - ${de}`, e.onChange({ value: { start: J, end: J }, event: E }), B(() => {
1272
1345
  requestAnimationFrame(() => {
1273
1346
  const re = document.getElementById(
1274
1347
  e.id
1275
- ), ie = l.value ?? 0;
1348
+ ), ie = r.value ?? 0;
1276
1349
  re && (re.focus(), re.setSelectionRange(ie, ie));
1277
1350
  });
1278
1351
  });
1279
1352
  return;
1280
1353
  }
1281
- const fe = /* @__PURE__ */ new Date(), ve = C(R);
1282
- let me = te ? new Date(te) : new Date(fe), ge = ne ? new Date(ne) : new Date(fe);
1283
- const he = (j, de) => {
1354
+ const fe = /* @__PURE__ */ new Date(), me = M(P);
1355
+ let ve = te ? new Date(te) : new Date(fe), ge = ne ? new Date(ne) : new Date(fe);
1356
+ const ye = (J, de) => {
1284
1357
  if (de === "mm") {
1285
- const re = j.getMonth() + 1, ie = r === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
1286
- j.setMonth(ie - 1);
1287
- const Se = P(j.getFullYear(), ie);
1288
- j.getDate() > Se && j.setDate(Se);
1358
+ const re = J.getMonth() + 1, ie = o === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
1359
+ J.setMonth(ie - 1);
1360
+ const be = $(J.getFullYear(), ie);
1361
+ J.getDate() > be && J.setDate(be);
1289
1362
  } else if (de === "dd") {
1290
- const re = P(j.getFullYear(), j.getMonth() + 1), ie = j.getDate(), Se = r === "ArrowUp" ? ie < re ? ie + 1 : 1 : ie > 1 ? ie - 1 : re;
1291
- j.setDate(Se);
1363
+ const re = $(J.getFullYear(), J.getMonth() + 1), ie = J.getDate(), be = o === "ArrowUp" ? ie < re ? ie + 1 : 1 : ie > 1 ? ie - 1 : re;
1364
+ J.setDate(be);
1292
1365
  } else if (de === "yyyy") {
1293
- const re = j.getFullYear();
1294
- j.setFullYear(r === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
1295
- const ie = P(j.getFullYear(), j.getMonth() + 1);
1296
- j.getDate() > ie && j.setDate(ie);
1366
+ const re = J.getFullYear();
1367
+ J.setFullYear(o === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
1368
+ const ie = $(J.getFullYear(), J.getMonth() + 1);
1369
+ J.getDate() > ie && J.setDate(ie);
1297
1370
  }
1298
1371
  };
1299
- ve.side === "start" ? he(me, ve.part) : he(ge, ve.part);
1300
- const we = y(me), Ae = y(ge);
1301
- t.value = `${we} - ${Ae}`;
1302
- const pe = S(me), ke = S(ge);
1303
- pe && ke && Z(pe, ke) ? e.onChange({ value: { start: pe, end: ke }, event: D }) : e.onChange({ value: null, event: D }), B(() => {
1372
+ me.side === "start" ? ye(ve, me.part) : ye(ge, me.part);
1373
+ const ke = S(ve), we = S(ge);
1374
+ t.value = `${ke} - ${we}`;
1375
+ const pe = y(ve), Ae = y(ge);
1376
+ pe && Ae && L(pe, Ae) ? e.onChange({ value: { start: pe, end: Ae }, event: E }) : e.onChange({ value: null, event: E }), B(() => {
1304
1377
  requestAnimationFrame(() => {
1305
- const j = document.getElementById(
1378
+ const J = document.getElementById(
1306
1379
  e.id
1307
- ), de = l.value ?? 0;
1308
- j && (j.focus(), j.setSelectionRange(de, de));
1380
+ ), de = r.value ?? 0;
1381
+ J && (J.focus(), J.setSelectionRange(de, de));
1309
1382
  });
1310
1383
  });
1311
- }, Y = (r) => {
1312
- const { start: s, end: D } = k(t.value);
1313
- if (!s || !D) {
1314
- e.onChange({ value: null, event: r });
1384
+ }, W = (o) => {
1385
+ const { start: c, end: E } = k(t.value);
1386
+ if (!c || !E) {
1387
+ e.onChange({ value: null, event: o });
1315
1388
  return;
1316
1389
  }
1317
- const R = S(s), te = S(D);
1318
- if (!R || !te) {
1319
- e.onChange({ value: null, event: r });
1390
+ const P = y(c), te = y(E);
1391
+ if (!P || !te) {
1392
+ e.onChange({ value: null, event: o });
1320
1393
  return;
1321
1394
  }
1322
- if (!Z(R, te)) {
1323
- e.onChange({ value: null, event: r });
1395
+ if (!L(P, te)) {
1396
+ e.onChange({ value: null, event: o });
1324
1397
  return;
1325
1398
  }
1326
- e.onChange({ value: { start: R, end: te }, event: r });
1327
- }, ae = (r) => {
1328
- const s = r.value ?? "", D = r.event;
1329
- if (!s && D && D.type === "click") {
1330
- W(D);
1399
+ e.onChange({ value: { start: P, end: te }, event: o });
1400
+ }, ae = (o) => {
1401
+ const c = o.value ?? "", E = o.event;
1402
+ if (!c && E && E.type === "click") {
1403
+ G(E);
1331
1404
  return;
1332
1405
  }
1333
- t.value = s;
1334
- const R = D?.target;
1335
- l.value = R?.selectionStart ?? 0, Y(r);
1336
- }, se = (r) => {
1337
- l.value = r.target.selectionStart ?? 0;
1338
- }, a = (r) => {
1339
- if (r.code === "Space" || r.key === " ") {
1340
- r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
1406
+ t.value = c;
1407
+ const P = E?.target;
1408
+ r.value = P?.selectionStart ?? 0, W(o);
1409
+ }, se = (o) => {
1410
+ r.value = o.target.selectionStart ?? 0;
1411
+ }, a = (o) => {
1412
+ if (o.code === "Space" || o.key === " ") {
1413
+ o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1341
1414
  return;
1342
1415
  }
1343
- if (r.key === "ArrowDown" && r.altKey) {
1344
- r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
1416
+ if (o.key === "ArrowDown" && o.altKey) {
1417
+ o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1345
1418
  return;
1346
1419
  }
1347
- if (c.includes(r.key)) {
1348
- r.preventDefault(), r.stopPropagation();
1349
- const s = r.target;
1350
- L(r.key, s, r);
1420
+ if (d.includes(o.key)) {
1421
+ o.preventDefault(), o.stopPropagation();
1422
+ const c = o.target;
1423
+ K(o.key, c, o);
1351
1424
  return;
1352
1425
  }
1353
- }, d = (r) => {
1354
- r.preventDefault();
1355
- const s = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1356
- L(s, r.target, r);
1357
- }, F = (r) => {
1358
- if (p.includes(r.key) || c.includes(r.key)) {
1359
- const s = r.target;
1360
- l.value = s?.selectionStart ?? 0;
1426
+ }, m = (o) => {
1427
+ o.preventDefault();
1428
+ const c = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1429
+ K(c, o.target, o);
1430
+ }, R = (o) => {
1431
+ if (b.includes(o.key) || d.includes(o.key)) {
1432
+ const c = o.target;
1433
+ r.value = c?.selectionStart ?? 0;
1361
1434
  }
1362
- }, K = () => {
1363
- ee.value = !0, (e.manageValid ?? !0) && (V.value = o.value);
1364
- }, N = (r) => {
1365
- K();
1366
- }, W = (r) => {
1367
- t.value = "", l.value = 0, e.onChange({ value: null, event: r }), K(), B(() => {
1368
- const s = document.getElementById(
1435
+ }, z = () => {
1436
+ Q.value = !0, (e.manageValid ?? !0) && (x.value = i.value);
1437
+ }, H = (o) => {
1438
+ z();
1439
+ }, G = (o) => {
1440
+ t.value = "", r.value = 0, e.onChange({ value: null, event: o }), z(), B(() => {
1441
+ const c = document.getElementById(
1369
1442
  e.id
1370
1443
  );
1371
- s && (s.focus(), s.setSelectionRange(0, 0));
1444
+ c && (c.focus(), c.setSelectionRange(0, 0));
1372
1445
  });
1373
1446
  };
1374
1447
  e.externalValue && ue(
1375
1448
  e.externalValue,
1376
- (r) => {
1377
- const s = r?.start ?? null, D = r?.end ?? null;
1378
- if (s && D) {
1379
- if (t.value = `${y(s)} - ${y(D)}`, e.isOpen?.value && m.value && e.onRequestClose) {
1380
- const R = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1449
+ (o) => {
1450
+ const c = o?.start ?? null, E = o?.end ?? null;
1451
+ if (c && E) {
1452
+ if (t.value = `${S(c)} - ${S(E)}`, e.isOpen?.value && f.value && e.onRequestClose) {
1453
+ const P = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1381
1454
  setTimeout(() => {
1382
- e.onRequestClose?.(), m.value = !1, K();
1383
- }, R);
1455
+ e.onRequestClose?.(), f.value = !1, z();
1456
+ }, P);
1384
1457
  }
1385
1458
  return;
1386
1459
  }
1387
1460
  },
1388
1461
  { immediate: !0 }
1389
1462
  );
1390
- const n = f(
1463
+ const n = v(
1391
1464
  () => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
1392
- ), i = f(
1465
+ ), u = v(
1393
1466
  () => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
1394
- ), T = f(
1467
+ ), F = v(
1395
1468
  () => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
1396
- ), q = f(
1469
+ ), N = v(
1397
1470
  () => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
1398
- ), _ = f(
1471
+ ), j = v(
1399
1472
  () => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
1400
- ), X = f(
1473
+ ), ee = v(
1401
1474
  () => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
1402
- ), O = f(() => {
1403
- const { start: r, end: s } = k(t.value);
1475
+ ), O = v(() => {
1476
+ const { start: o, end: c } = k(t.value);
1404
1477
  return [
1405
1478
  {
1406
1479
  label: "Raw",
@@ -1417,151 +1490,151 @@ function yt(e) {
1417
1490
  {
1418
1491
  label: "Start",
1419
1492
  value: `${String(n.value).padStart(2, "0")} / ${String(
1420
- i.value
1421
- ).padStart(2, "0")} / ${String(T.value).padStart(4, "0")}`
1493
+ u.value
1494
+ ).padStart(2, "0")} / ${String(F.value).padStart(4, "0")}`
1422
1495
  },
1423
1496
  {
1424
1497
  label: "End",
1425
- value: `${String(q.value).padStart(2, "0")} / ${String(
1426
- _.value
1427
- ).padStart(2, "0")} / ${String(X.value).padStart(4, "0")}`
1498
+ value: `${String(N.value).padStart(2, "0")} / ${String(
1499
+ j.value
1500
+ ).padStart(2, "0")} / ${String(ee.value).padStart(4, "0")}`
1428
1501
  },
1429
- { label: "Digits only", value: h.value },
1430
- { label: "Mask complete", value: `${v.value}` },
1502
+ { label: "Digits only", value: D.value },
1503
+ { label: "Mask complete", value: `${h.value}` },
1431
1504
  {
1432
1505
  label: "Parsed",
1433
- value: `${r ? r.toDateString() : "-"} | ${s ? s.toDateString() : "-"}`
1506
+ value: `${o ? o.toDateString() : "-"} | ${c ? c.toDateString() : "-"}`
1434
1507
  },
1435
1508
  {
1436
1509
  label: "Valid (managed)",
1437
- value: `${V.value ?? "-"}`
1510
+ value: `${x.value ?? "-"}`
1438
1511
  },
1439
- { label: "Span (days)", value: `${J.value ?? "-"}` },
1512
+ { label: "Span (days)", value: `${_.value ?? "-"}` },
1440
1513
  {
1441
1514
  label: "Reason",
1442
- value: `${oe.value ?? "-"}`
1515
+ value: `${le.value ?? "-"}`
1443
1516
  },
1444
1517
  {
1445
1518
  label: "Cursor in",
1446
- value: `${l.value ?? "-"} (${(() => {
1447
- const D = l.value ?? 0, R = C(D);
1448
- return `${R.side}.${R.part}`;
1519
+ value: `${r.value ?? "-"} (${(() => {
1520
+ const E = r.value ?? 0, P = M(E);
1521
+ return `${P.side}.${P.part}`;
1449
1522
  })()})`
1450
1523
  }
1451
1524
  ];
1452
- }), z = () => {
1525
+ }), Z = () => {
1453
1526
  B(() => {
1454
- const r = document.getElementById(e.id);
1455
- if (!r) {
1527
+ const o = document.getElementById(e.id);
1528
+ if (!o) {
1456
1529
  console.warn(`#${e.id} not found for styling.`);
1457
1530
  return;
1458
1531
  }
1459
- const s = r.closest("div");
1460
- if (!s) {
1532
+ const c = o.closest("div");
1533
+ if (!c) {
1461
1534
  console.warn(`Parent div of #${e.id} not found for styling.`);
1462
1535
  return;
1463
1536
  }
1464
- s.classList.contains("fk-daterangepicker") || s.classList.add("fk-daterangepicker");
1537
+ c.classList.contains("fk-daterangepicker") || c.classList.add("fk-daterangepicker");
1465
1538
  });
1466
1539
  };
1467
- Ie(() => {
1468
- z();
1540
+ Me(() => {
1541
+ Z();
1469
1542
  });
1470
1543
  const ce = () => {
1471
1544
  B(() => {
1472
1545
  try {
1473
- const r = Array.from(
1546
+ const o = Array.from(
1474
1547
  document.querySelectorAll(".k-animation-container")
1475
1548
  );
1476
- if (!r.length) return;
1477
- const D = [...r].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
1549
+ if (!o.length) return;
1550
+ const E = [...o].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
1478
1551
  ".k-calendar"
1479
1552
  );
1480
- if (!D) return;
1481
- const R = D.querySelectorAll(
1553
+ if (!E) return;
1554
+ const P = E.querySelectorAll(
1482
1555
  ".k-calendar-table"
1483
1556
  );
1484
1557
  let te = !1;
1485
- R.forEach((ne) => {
1558
+ P.forEach((ne) => {
1486
1559
  ne.tabIndex === 0 && (te ? ne.tabIndex = -1 : te = !0);
1487
1560
  });
1488
- } catch (r) {
1489
- console.warn(r);
1561
+ } catch (o) {
1562
+ console.warn(o);
1490
1563
  }
1491
1564
  });
1492
1565
  };
1493
1566
  return e.isOpen && ue(
1494
1567
  e.isOpen,
1495
- (r) => {
1496
- r && setTimeout(() => ce(), 0);
1568
+ (o) => {
1569
+ o && setTimeout(() => ce(), 0);
1497
1570
  },
1498
1571
  { immediate: !1 }
1499
1572
  ), {
1500
1573
  raw: t,
1501
- cursorPos: l,
1502
- debugEnabled: A,
1574
+ cursorPos: r,
1575
+ debugEnabled: g,
1503
1576
  debugLines: O,
1504
- digitsOnly: h,
1505
- valid: V,
1506
- validComputed: G(o),
1507
- reason: G(oe),
1508
- validationMessage: G(w),
1509
- spanDays: G(J),
1510
- month1: G(n),
1511
- day1: G(i),
1512
- year1: G(T),
1513
- month2: G(q),
1514
- day2: G(_),
1515
- year2: G(X),
1577
+ digitsOnly: D,
1578
+ valid: x,
1579
+ validComputed: X(i),
1580
+ reason: X(le),
1581
+ validationMessage: X(w),
1582
+ spanDays: X(_),
1583
+ month1: X(n),
1584
+ day1: X(u),
1585
+ year1: X(F),
1586
+ month2: X(N),
1587
+ day2: X(j),
1588
+ year2: X(ee),
1516
1589
  handleChange: ae,
1517
1590
  handleKeyDown: a,
1518
- handleWheel: d,
1519
- handleKeyUp: F,
1591
+ handleWheel: m,
1592
+ handleKeyUp: R,
1520
1593
  handleClick: se,
1521
- handleBlur: N,
1522
- handleClear: W,
1594
+ handleBlur: H,
1595
+ handleClear: G,
1523
1596
  onCalendarChange: () => {
1524
- m.value = !0;
1597
+ f.value = !0;
1525
1598
  },
1526
- initStyling: z
1599
+ initStyling: Z
1527
1600
  };
1528
1601
  }
1529
- function ht(e) {
1530
- const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(e.timeFormat ?? "hh:mm AM"), g = f(() => !!e.required), I = U(!1), b = ["ArrowUp", "ArrowDown"], M = ["ArrowLeft", "ArrowRight"], $ = f(() => (t.value ?? "").replace(/\D/g, "")), h = {
1602
+ function mt(e) {
1603
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(e.timeFormat ?? "hh:mm AM"), p = v(() => !!e.required), A = U(!1), C = ["ArrowUp", "ArrowDown"], T = ["ArrowLeft", "ArrowRight"], q = v(() => (t.value ?? "").replace(/\D/g, "")), D = {
1531
1604
  H: /[0-9]/,
1532
1605
  h: /[0-9]/,
1533
1606
  M: /[0-9]/,
1534
1607
  m: /[0-9]/,
1535
1608
  A: /[AaPp]/,
1536
1609
  a: /[Mm]/
1537
- }, P = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = f(() => {
1538
- const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", i = parseInt(n);
1539
- return Math.min(Math.max(i, 0), 23);
1540
- }), u = f(() => {
1541
- const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", i = parseInt(n);
1542
- return Math.min(Math.max(i, 0), 59);
1543
- }), S = f(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), Z = f(() => {
1544
- const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), i = S.value;
1545
- return n === 12 ? i === "AM" ? 0 : 12 : i === "PM" ? n + 12 : n;
1546
- }), v = f(() => k.value ? `${String(Z.value).padStart(2, "0")}:${String(u.value).padStart(2, "0")}:00` : null), k = f(
1610
+ }, $ = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", s = v(() => {
1611
+ const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", u = parseInt(n);
1612
+ return Math.min(Math.max(u, 0), 23);
1613
+ }), l = v(() => {
1614
+ const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", u = parseInt(n);
1615
+ return Math.min(Math.max(u, 0), 59);
1616
+ }), y = v(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), L = v(() => {
1617
+ const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), u = y.value;
1618
+ return n === 12 ? u === "AM" ? 0 : 12 : u === "PM" ? n + 12 : n;
1619
+ }), h = v(() => k.value ? `${String(L.value).padStart(2, "0")}:${String(l.value).padStart(2, "0")}:00` : null), k = v(
1547
1620
  () => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
1548
- ), V = (n, i, T) => {
1549
- let q = n % 12;
1550
- return q === 0 && (q = 12), `${String(q).padStart(2, "0")}:${String(i).padStart(
1621
+ ), x = (n, u, F) => {
1622
+ let N = n % 12;
1623
+ return N === 0 && (N = 12), `${String(N).padStart(2, "0")}:${String(u).padStart(
1551
1624
  2,
1552
1625
  "0"
1553
- )} ${T}`;
1554
- }, H = (n) => {
1555
- const i = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1556
- if (!i) return null;
1557
- const T = parseInt(i[1]), q = parseInt(i[2]), _ = i[3].toUpperCase();
1558
- if (T < 1 || T > 12 || q < 0 || q > 59) return null;
1559
- let X = T % 12;
1560
- _ === "PM" && (X += 12);
1626
+ )} ${F}`;
1627
+ }, V = (n) => {
1628
+ const u = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1629
+ if (!u) return null;
1630
+ const F = parseInt(u[1]), N = parseInt(u[2]), j = u[3].toUpperCase();
1631
+ if (F < 1 || F > 12 || N < 0 || N > 59) return null;
1632
+ let ee = F % 12;
1633
+ j === "PM" && (ee += 12);
1561
1634
  const O = /* @__PURE__ */ new Date();
1562
- return O.setSeconds(0, 0), O.setHours(X), O.setMinutes(q), O;
1563
- }, Q = (n) => {
1564
- if ($.value.length === 0) {
1635
+ return O.setSeconds(0, 0), O.setHours(ee), O.setMinutes(N), O;
1636
+ }, Y = (n) => {
1637
+ if (q.value.length === 0) {
1565
1638
  e.onChange({ value: null, event: n });
1566
1639
  return;
1567
1640
  }
@@ -1569,24 +1642,24 @@ function ht(e) {
1569
1642
  e.onChange({ value: null, event: n });
1570
1643
  return;
1571
1644
  }
1572
- const i = H(t.value);
1573
- i && ee(i) ? e.onChange({ value: i, event: n }) : e.onChange({ value: null, event: n });
1574
- }, J = (n) => n.getHours() * 60 + n.getMinutes(), ee = (n) => {
1575
- const i = e.min ?? void 0, T = e.max ?? void 0, q = J(n);
1576
- if (i) {
1577
- const _ = J(i);
1578
- if (q < _) return !1;
1645
+ const u = V(t.value);
1646
+ u && Q(u) ? e.onChange({ value: u, event: n }) : e.onChange({ value: null, event: n });
1647
+ }, _ = (n) => n.getHours() * 60 + n.getMinutes(), Q = (n) => {
1648
+ const u = e.min ?? void 0, F = e.max ?? void 0, N = _(n);
1649
+ if (u) {
1650
+ const j = _(u);
1651
+ if (N < j) return !1;
1579
1652
  }
1580
- if (T) {
1581
- const _ = J(T);
1582
- if (q > _) return !1;
1653
+ if (F) {
1654
+ const j = _(F);
1655
+ if (N > j) return !1;
1583
1656
  }
1584
1657
  return !0;
1585
- }, oe = (n) => {
1586
- const i = n.getHours(), T = i >= 12 ? "PM" : "AM";
1587
- t.value = V(i, n.getMinutes(), T);
1588
- }, o = (n, i) => {
1589
- e.onChange({ value: n, event: i });
1658
+ }, le = (n) => {
1659
+ const u = n.getHours(), F = u >= 12 ? "PM" : "AM";
1660
+ t.value = x(u, n.getMinutes(), F);
1661
+ }, i = (n, u) => {
1662
+ e.onChange({ value: n, event: u });
1590
1663
  }, w = () => {
1591
1664
  B(() => {
1592
1665
  requestAnimationFrame(() => {
@@ -1596,50 +1669,50 @@ function ht(e) {
1596
1669
  );
1597
1670
  if (n) {
1598
1671
  n.focus();
1599
- const i = (n.value ?? "").length;
1600
- n.setSelectionRange(i, i);
1672
+ const u = (n.value ?? "").length;
1673
+ n.setSelectionRange(u, u);
1601
1674
  }
1602
1675
  });
1603
1676
  });
1604
1677
  });
1605
- }, c = (n) => {
1606
- const i = n?.event?.target;
1607
- return i ? i.closest(".k-time-now") ? "now" : i.closest(".k-time-accept") ? "set" : null : null;
1608
- }, p = (n, i) => {
1609
- n && ee(n) ? o(n, i) : o(null, i);
1610
- }, x = (...n) => {
1611
- const i = n[0];
1612
- if (!i) return;
1613
- const T = c(i);
1614
- if (T === "now") {
1615
- const _ = /* @__PURE__ */ new Date();
1616
- oe(_), p(_, i), w();
1678
+ }, d = (n) => {
1679
+ const u = n?.event?.target;
1680
+ return u ? u.closest(".k-time-now") ? "now" : u.closest(".k-time-accept") ? "set" : null : null;
1681
+ }, b = (n, u) => {
1682
+ n && Q(n) ? i(n, u) : i(null, u);
1683
+ }, I = (...n) => {
1684
+ const u = n[0];
1685
+ if (!u) return;
1686
+ const F = d(u);
1687
+ if (F === "now") {
1688
+ const j = /* @__PURE__ */ new Date();
1689
+ le(j), b(j, u), w();
1617
1690
  return;
1618
1691
  }
1619
- if (i?.value instanceof Date) {
1620
- const _ = new Date(i.value);
1621
- oe(_), p(_, i), T === "set" && w();
1692
+ if (u?.value instanceof Date) {
1693
+ const j = new Date(u.value);
1694
+ le(j), b(j, u), F === "set" && w();
1622
1695
  return;
1623
1696
  }
1624
- if (i?.value === null) {
1625
- t.value = "", o(null, i);
1697
+ if (u?.value === null) {
1698
+ t.value = "", i(null, u);
1626
1699
  return;
1627
1700
  }
1628
- t.value = i.value;
1629
- const q = i.event?.target;
1630
- l.value = q?.selectionStart ?? 0;
1701
+ t.value = u.value;
1702
+ const N = u.event?.target;
1703
+ r.value = N?.selectionStart ?? 0;
1631
1704
  try {
1632
- const _ = l.value ?? 0;
1633
- if (P(_) === "ampm" && (t.value ?? "").length >= 8) {
1634
- const X = t.value.charAt(6);
1635
- /[Aa]/.test(X) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
1705
+ const j = r.value ?? 0;
1706
+ if ($(j) === "ampm" && (t.value ?? "").length >= 8) {
1707
+ const ee = t.value.charAt(6);
1708
+ /[Aa]/.test(ee) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
1636
1709
  requestAnimationFrame(() => {
1637
1710
  const O = document.getElementById(
1638
1711
  e.id
1639
1712
  );
1640
1713
  O && (O.focus(), O.setSelectionRange(8, 8));
1641
1714
  });
1642
- })) : /[Pp]/.test(X) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, B(() => {
1715
+ })) : /[Pp]/.test(ee) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, B(() => {
1643
1716
  requestAnimationFrame(() => {
1644
1717
  const O = document.getElementById(
1645
1718
  e.id
@@ -1650,60 +1723,60 @@ function ht(e) {
1650
1723
  }
1651
1724
  } catch {
1652
1725
  }
1653
- Q(i);
1654
- }, y = (n) => {
1655
- l.value = n.target.selectionStart ?? 0;
1656
- }, C = (n, i, T) => {
1657
- const q = i?.selectionStart ?? l.value ?? 0;
1658
- l.value = q;
1659
- const _ = P(q), X = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1660
- if (!X) {
1661
- if ((t.value ?? "").length === 0 || $.value.length === 0) {
1662
- const s = /* @__PURE__ */ new Date(), D = s.getHours(), R = D >= 12 ? "PM" : "AM";
1663
- t.value = V(D, s.getMinutes(), R);
1664
- const te = H(t.value);
1665
- p(te, T), B(() => {
1726
+ Y(u);
1727
+ }, S = (n) => {
1728
+ r.value = n.target.selectionStart ?? 0;
1729
+ }, M = (n, u, F) => {
1730
+ const N = u?.selectionStart ?? r.value ?? 0;
1731
+ r.value = N;
1732
+ const j = $(N), ee = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1733
+ if (!ee) {
1734
+ if ((t.value ?? "").length === 0 || q.value.length === 0) {
1735
+ const c = /* @__PURE__ */ new Date(), E = c.getHours(), P = E >= 12 ? "PM" : "AM";
1736
+ t.value = x(E, c.getMinutes(), P);
1737
+ const te = V(t.value);
1738
+ b(te, F), B(() => {
1666
1739
  requestAnimationFrame(() => {
1667
1740
  const ne = document.getElementById(
1668
1741
  e.id
1669
- ), fe = l.value ?? 0;
1742
+ ), fe = r.value ?? 0;
1670
1743
  ne && (ne.focus(), ne.setSelectionRange(fe, fe));
1671
1744
  });
1672
1745
  });
1673
1746
  }
1674
1747
  return;
1675
1748
  }
1676
- let O = parseInt(X[1]), z = parseInt(X[2]), ce = X[3].toUpperCase();
1677
- if (_ === "hh")
1749
+ let O = parseInt(ee[1]), Z = parseInt(ee[2]), ce = ee[3].toUpperCase();
1750
+ if (j === "hh")
1678
1751
  n === "ArrowUp" ? O = O < 12 ? O + 1 : 1 : O = O > 1 ? O - 1 : 12;
1679
- else if (_ === "mm") {
1680
- const s = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
1681
- if (s === 1)
1682
- n === "ArrowUp" ? z = z < 59 ? z + 1 : 0 : z = z > 0 ? z - 1 : 59;
1752
+ else if (j === "mm") {
1753
+ const c = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
1754
+ if (c === 1)
1755
+ n === "ArrowUp" ? Z = Z < 59 ? Z + 1 : 0 : Z = Z > 0 ? Z - 1 : 59;
1683
1756
  else if (n === "ArrowUp") {
1684
- const D = z % s;
1685
- let R = D === 0 ? z + s : z + (s - D);
1686
- R >= 60 && (R = 0), z = R;
1757
+ const E = Z % c;
1758
+ let P = E === 0 ? Z + c : Z + (c - E);
1759
+ P >= 60 && (P = 0), Z = P;
1687
1760
  } else {
1688
- const D = z % s;
1689
- let R = D === 0 ? z - s : z - D;
1690
- R < 0 && (R = 60 - s), z = R;
1761
+ const E = Z % c;
1762
+ let P = E === 0 ? Z - c : Z - E;
1763
+ P < 0 && (P = 60 - c), Z = P;
1691
1764
  }
1692
- } else _ === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
1693
- t.value = `${String(O).padStart(2, "0")}:${String(z).padStart(
1765
+ } else j === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
1766
+ t.value = `${String(O).padStart(2, "0")}:${String(Z).padStart(
1694
1767
  2,
1695
1768
  "0"
1696
1769
  )} ${ce}`;
1697
- const r = H(t.value);
1698
- p(r, T), B(() => {
1770
+ const o = V(t.value);
1771
+ b(o, F), B(() => {
1699
1772
  requestAnimationFrame(() => {
1700
- const s = document.getElementById(
1773
+ const c = document.getElementById(
1701
1774
  e.id
1702
- ), D = l.value ?? 0;
1703
- s && (s.focus(), s.setSelectionRange(D, D));
1775
+ ), E = r.value ?? 0;
1776
+ c && (c.focus(), c.setSelectionRange(E, E));
1704
1777
  });
1705
1778
  });
1706
- }, L = (n) => {
1779
+ }, K = (n) => {
1707
1780
  if (n.code === "Space" || n.key === " ") {
1708
1781
  n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
1709
1782
  return;
@@ -1712,57 +1785,57 @@ function ht(e) {
1712
1785
  n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
1713
1786
  return;
1714
1787
  }
1715
- if (b.includes(n.key)) {
1788
+ if (C.includes(n.key)) {
1716
1789
  if (n.altKey) return;
1717
1790
  n.preventDefault(), n.stopPropagation();
1718
- const i = n.target;
1719
- C(n.key, i, n);
1791
+ const u = n.target;
1792
+ M(n.key, u, n);
1720
1793
  return;
1721
1794
  }
1722
- }, Y = (n) => {
1795
+ }, W = (n) => {
1723
1796
  n.preventDefault();
1724
- const i = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1725
- C(i, n.target, n);
1797
+ const u = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1798
+ M(u, n.target, n);
1726
1799
  }, ae = (n) => {
1727
- const i = n.target;
1728
- if (M.includes(n.key)) {
1729
- l.value = i?.selectionStart ?? 0;
1800
+ const u = n.target;
1801
+ if (T.includes(n.key)) {
1802
+ r.value = u?.selectionStart ?? 0;
1730
1803
  return;
1731
1804
  }
1732
- if (b.includes(n.key)) {
1805
+ if (C.includes(n.key)) {
1733
1806
  if (n.altKey) return;
1734
- l.value = i?.selectionStart ?? 0;
1807
+ r.value = u?.selectionStart ?? 0;
1735
1808
  }
1736
1809
  }, se = (n) => {
1737
- I.value = !0, g.value && e.externalValue && e.externalValue.value === void 0 && $.value.length === 0 && (e.externalValue.value = "");
1738
- const i = n.target;
1739
- i && (l.value = i.selectionStart ?? 0);
1810
+ A.value = !0, p.value && e.externalValue && e.externalValue.value === void 0 && q.value.length === 0 && (e.externalValue.value = "");
1811
+ const u = n.target;
1812
+ u && (r.value = u.selectionStart ?? 0);
1740
1813
  };
1741
1814
  e.externalValue && ue(
1742
1815
  e.externalValue,
1743
1816
  (n) => {
1744
1817
  if (n) {
1745
- const i = new Date(n);
1746
- if (i.toString() !== "Invalid Date") {
1747
- const T = i.getHours(), q = T >= 12 ? "PM" : "AM";
1748
- t.value = V(T, i.getMinutes(), q);
1818
+ const u = new Date(n);
1819
+ if (u.toString() !== "Invalid Date") {
1820
+ const F = u.getHours(), N = F >= 12 ? "PM" : "AM";
1821
+ t.value = x(F, u.getMinutes(), N);
1749
1822
  return;
1750
1823
  }
1751
1824
  }
1752
1825
  },
1753
1826
  { immediate: !0 }
1754
1827
  );
1755
- const a = f(() => [
1828
+ const a = v(() => [
1756
1829
  ["Time", t.value || "--:-- --"],
1757
- ["Hour (12h)", E.value],
1758
- ["Hour (24h)", Z.value],
1759
- ["Minute", u.value],
1760
- ["Period", S.value],
1761
- ["Time (24h)", v.value ?? "--:--:--"],
1762
- ["Digits only", $.value],
1830
+ ["Hour (12h)", s.value],
1831
+ ["Hour (24h)", L.value],
1832
+ ["Minute", l.value],
1833
+ ["Period", y.value],
1834
+ ["Time (24h)", h.value ?? "--:--:--"],
1835
+ ["Digits only", q.value],
1763
1836
  [
1764
1837
  "Parsed Date",
1765
- d.value?.toLocaleDateString("en-US", {
1838
+ m.value?.toLocaleDateString("en-US", {
1766
1839
  hour: "2-digit",
1767
1840
  minute: "2-digit"
1768
1841
  }) ?? null
@@ -1781,182 +1854,183 @@ function ht(e) {
1781
1854
  minute: "2-digit"
1782
1855
  }) ?? null
1783
1856
  ],
1784
- ["valid", F.value],
1785
- ["reason", K.value],
1786
- ["validationMessage", N.value]
1787
- ]), d = f(
1788
- () => H(t.value) ?? null
1789
- ), F = f(() => {
1790
- if (!g.value) {
1857
+ ["valid", R.value],
1858
+ ["reason", z.value],
1859
+ ["validationMessage", H.value]
1860
+ ]), m = v(
1861
+ () => V(t.value) ?? null
1862
+ ), R = v(() => {
1863
+ if (!p.value) {
1791
1864
  if (!k.value) return !0;
1792
- const i = d.value;
1793
- return i ? ee(i) : !1;
1865
+ const u = m.value;
1866
+ return u ? Q(u) : !1;
1794
1867
  }
1795
- if (!I.value) return !0;
1796
- const n = d.value;
1797
- return !k.value || !n ? !1 : ee(n);
1798
- }), K = f(() => {
1799
- if (!g.value) {
1868
+ if (!A.value) return !0;
1869
+ const n = m.value;
1870
+ return !k.value || !n ? !1 : Q(n);
1871
+ }), z = v(() => {
1872
+ if (!p.value) {
1800
1873
  if (!k.value) return;
1801
- const i = d.value;
1802
- return i ? ee(i) ? "valid" : "out-of-bounds" : "invalid-time";
1874
+ const u = m.value;
1875
+ return u ? Q(u) ? "valid" : "out-of-bounds" : "invalid-time";
1803
1876
  }
1804
- if (!I.value) return;
1805
- if ($.value.length === 0 || !k.value)
1877
+ if (!A.value) return;
1878
+ if (q.value.length === 0 || !k.value)
1806
1879
  return "incomplete";
1807
- const n = d.value;
1808
- return n ? ee(n) ? "valid" : "out-of-bounds" : "invalid-time";
1809
- }), N = f(() => {
1810
- const n = K.value;
1880
+ const n = m.value;
1881
+ return n ? Q(n) ? "valid" : "out-of-bounds" : "invalid-time";
1882
+ }), H = v(() => {
1883
+ const n = z.value;
1811
1884
  if (!n || n === "valid") return "";
1812
1885
  if (n === "incomplete")
1813
1886
  return "Required";
1814
1887
  if (n === "invalid-time")
1815
- return `Must be in ${m.value} format.`;
1816
- const i = {
1888
+ return `Must be in ${f.value} format.`;
1889
+ const u = {
1817
1890
  hour: "2-digit",
1818
1891
  minute: "2-digit"
1819
- }, T = e.min ? e.min.toLocaleTimeString("en-US", i) : null, q = e.max ? e.max.toLocaleTimeString("en-US", i) : null;
1892
+ }, F = e.min ? e.min.toLocaleTimeString("en-US", u) : null, N = e.max ? e.max.toLocaleTimeString("en-US", u) : null;
1820
1893
  if (n === "out-of-bounds") {
1821
- if (T && q) return `Must be between ${T} and ${q}.`;
1822
- if (T) return `Must be ${T} or later.`;
1823
- if (q) return `Must be ${q} or earlier.`;
1894
+ if (F && N) return `Must be between ${F} and ${N}.`;
1895
+ if (F) return `Must be ${F} or later.`;
1896
+ if (N) return `Must be ${N} or earlier.`;
1824
1897
  }
1825
1898
  return "";
1826
- }), W = () => {
1899
+ }), G = () => {
1827
1900
  B(() => {
1828
1901
  const n = document.getElementById(e.id);
1829
1902
  if (!n) {
1830
1903
  console.warn(`#${e.id} not found for styling.`);
1831
1904
  return;
1832
1905
  }
1833
- const i = n.closest(".k-timepicker");
1834
- if (!i) {
1906
+ const u = n.closest(".k-timepicker");
1907
+ if (!u) {
1835
1908
  console.warn(
1836
1909
  `.k-timepicker parent of #${e.id} not found for styling.`
1837
1910
  );
1838
1911
  return;
1839
1912
  }
1840
- const T = i.parentElement;
1841
- if (!T) {
1913
+ const F = u.parentElement;
1914
+ if (!F) {
1842
1915
  console.warn(
1843
1916
  `Parent of .k-timepicker not found for #${e.id} styling.`
1844
1917
  );
1845
1918
  return;
1846
1919
  }
1847
- T.classList.contains("fk-timepicker") || T.classList.add("fk-timepicker");
1920
+ F.classList.contains("fk-timepicker") || F.classList.add("fk-timepicker");
1848
1921
  });
1849
1922
  };
1850
- return Ie(() => {
1851
- W();
1923
+ return Me(() => {
1924
+ G();
1852
1925
  }), {
1853
1926
  raw: t,
1854
- rules: h,
1855
- debugEnabled: A,
1927
+ rules: D,
1928
+ debugEnabled: g,
1856
1929
  debugLines: a,
1857
- placeholder: m,
1858
- isValid: F,
1859
- reason: G(K),
1860
- validationMessage: N,
1930
+ placeholder: f,
1931
+ isValid: R,
1932
+ reason: X(z),
1933
+ validationMessage: H,
1861
1934
  isComplete: k,
1862
- inRangeTime: ee,
1863
- cursorPos: l,
1864
- hour: G(E),
1865
- hour24: G(Z),
1866
- minute: G(u),
1867
- period: G(S),
1868
- time24: G(v),
1869
- parsedRawTime: G(d),
1870
- handleChange: x,
1871
- handleKeyDown: L,
1935
+ inRangeTime: Q,
1936
+ cursorPos: r,
1937
+ hour: X(s),
1938
+ hour24: X(L),
1939
+ minute: X(l),
1940
+ period: X(y),
1941
+ time24: X(h),
1942
+ parsedRawTime: X(m),
1943
+ handleChange: I,
1944
+ handleKeyDown: K,
1872
1945
  handleKeyUp: ae,
1873
- handleClick: y,
1874
- handleWheel: Y,
1946
+ handleClick: S,
1947
+ handleWheel: W,
1875
1948
  handleBlur: se,
1876
1949
  // Expose so consumers can reapply theming when Kendo updates DOM
1877
- initStyling: W
1950
+ initStyling: G
1878
1951
  };
1879
1952
  }
1880
- function bt(e) {
1881
- const t = Ke(null), l = [
1953
+ function vt(e) {
1954
+ const t = Ke(null), r = [
1882
1955
  ".k-animation-container .k-popup",
1883
1956
  ".k-popup",
1884
1957
  ".k-timepicker-popup",
1885
1958
  ".k-menu-popup"
1886
- ], A = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? l].flat(), m = (h) => h ? typeof e.initialFocus == "string" ? h.querySelector(e.initialFocus) ?? h : typeof e.initialFocus == "function" ? e.initialFocus(h) ?? h : h.querySelector(
1959
+ ], g = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), f = (D) => D ? typeof e.initialFocus == "string" ? D.querySelector(e.initialFocus) ?? D : typeof e.initialFocus == "function" ? e.initialFocus(D) ?? D : D.querySelector(
1887
1960
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1888
- ) ?? h : null, { activate: g, deactivate: I } = Ne(t, {
1961
+ ) ?? D : null, { activate: p, deactivate: A } = qe(t, {
1889
1962
  escapeDeactivates: !1,
1890
1963
  clickOutsideDeactivates: !1,
1891
1964
  fallbackFocus: () => t.value,
1892
- initialFocus: () => m(t.value),
1965
+ initialFocus: () => f(t.value),
1893
1966
  ...e.focusTrapOptions ?? {}
1894
1967
  });
1895
- let b = null, M = U(null);
1896
- const $ = () => {
1968
+ let C = null, T = U(null);
1969
+ const q = () => {
1897
1970
  if (e.resolvePopupEl) return e.resolvePopupEl();
1898
- const h = (E, u) => {
1899
- const S = Array.from(E.querySelectorAll(u));
1900
- if (!S.length) return null;
1901
- const Z = S.filter(
1902
- (v) => v.offsetParent !== null || v.getClientRects().length > 0
1971
+ const D = (s, l) => {
1972
+ const y = Array.from(s.querySelectorAll(l));
1973
+ if (!y.length) return null;
1974
+ const L = y.filter(
1975
+ (h) => h.offsetParent !== null || h.getClientRects().length > 0
1903
1976
  );
1904
- return Z[Z.length - 1] ?? S[S.length - 1] ?? null;
1905
- }, P = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
1906
- for (const E of A) {
1907
- const u = h(P, E);
1908
- if (u) return u;
1977
+ return L[L.length - 1] ?? y[y.length - 1] ?? null;
1978
+ }, $ = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
1979
+ for (const s of g) {
1980
+ const l = D($, s);
1981
+ if (l) return l;
1909
1982
  }
1910
- for (const E of A) {
1911
- const u = h(document, E);
1912
- if (u) return u;
1983
+ for (const s of g) {
1984
+ const l = D(document, s);
1985
+ if (l) return l;
1913
1986
  }
1914
1987
  return null;
1915
1988
  };
1916
- return Re(t, (h) => {
1917
- M.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", h);
1989
+ return $e(t, (D) => {
1990
+ T.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", D);
1918
1991
  }), ue(
1919
1992
  () => e.isOpen.value,
1920
- (h) => {
1921
- h ? (M.value = null, B(() => {
1922
- const P = $();
1923
- P && (t.value = P, setTimeout(() => g(), 0), b || (b = (E) => {
1924
- E.key === "Escape" && (M.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", E));
1925
- }, document.addEventListener("keydown", b, !0)));
1926
- })) : (I(), b && (document.removeEventListener("keydown", b, !0), b = null), t.value = null, M.value === "outside" && B(() => {
1927
- const P = () => {
1928
- const E = e.triggerEl?.value, u = E?.querySelector("input"), S = document.activeElement;
1929
- S && (S === u || E && E.contains(S)) && (u ?? E)?.blur?.();
1993
+ (D) => {
1994
+ D ? (T.value = null, B(() => {
1995
+ const $ = q();
1996
+ $ && (t.value = $, setTimeout(() => p(), 0), C || (C = (s) => {
1997
+ s.key === "Escape" && (T.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", s));
1998
+ }, document.addEventListener("keydown", C, !0)));
1999
+ })) : (A(), C && (document.removeEventListener("keydown", C, !0), C = null), t.value = null, T.value === "outside" && B(() => {
2000
+ const $ = () => {
2001
+ const s = e.triggerEl?.value, l = s?.querySelector("input"), y = document.activeElement;
2002
+ y && (y === l || s && s.contains(y)) && (l ?? s)?.blur?.();
1930
2003
  };
1931
- requestAnimationFrame(() => setTimeout(P, 0));
1932
- }), e.returnFocusToTrigger !== !1 && M.value === "escape" && e.triggerEl?.value && B(() => {
1933
- const P = () => {
1934
- const E = e.triggerEl?.value;
1935
- if (!E) return;
1936
- (E.querySelector("input") ?? E)?.focus?.();
2004
+ requestAnimationFrame(() => setTimeout($, 0));
2005
+ }), e.returnFocusToTrigger !== !1 && T.value === "escape" && e.triggerEl?.value && B(() => {
2006
+ const $ = () => {
2007
+ const s = e.triggerEl?.value;
2008
+ if (!s) return;
2009
+ (s.querySelector("input") ?? s)?.focus?.();
1937
2010
  };
1938
- requestAnimationFrame(() => setTimeout(P, 0));
2011
+ requestAnimationFrame(() => setTimeout($, 0));
1939
2012
  }));
1940
2013
  }
1941
2014
  ), {
1942
2015
  popupRef: t,
1943
- activate: g,
1944
- deactivate: I,
1945
- lastCloseReason: G(M),
1946
- setPopupEl: (h) => t.value = h
2016
+ activate: p,
2017
+ deactivate: A,
2018
+ lastCloseReason: X(T),
2019
+ setPopupEl: (D) => t.value = D
1947
2020
  };
1948
2021
  }
1949
2022
  export {
1950
- je as useFieldsetTouchTracker,
1951
- Ge as useFieldsetValidationKit,
1952
- ft as useGridA11y,
1953
- pt as useGridActiveFilter,
1954
- gt as useMaskedDateInput,
1955
- yt as useMaskedDateRangeInput,
1956
- ht as useMaskedTimeInput,
1957
- mt as usePopupMenu,
1958
- bt as usePopupTrap,
1959
- vt as useUSAddress,
1960
- _e as useZipTextBox
2023
+ Ye as useFieldsetTouchTracker,
2024
+ We as useFieldsetValidationKit,
2025
+ it as useGridA11y,
2026
+ st as useGridActiveFilter,
2027
+ ut as useGridRowAction,
2028
+ ft as useMaskedDateInput,
2029
+ pt as useMaskedDateRangeInput,
2030
+ mt as useMaskedTimeInput,
2031
+ dt as usePopupMenu,
2032
+ vt as usePopupTrap,
2033
+ ct as useUSAddress,
2034
+ Ze as useZipTextBox
1961
2035
  };
1962
2036
  //# sourceMappingURL=featherk-composables.es.js.map