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