@featherk/composables 0.11.1 → 0.12.0

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