@featherk/composables 0.13.8 → 0.13.9

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