@featherk/composables 0.9.0 → 0.9.2

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