@featherk/composables 0.12.5 → 0.13.1

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