@stonecrop/utilities 0.13.4 → 0.13.6

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.
package/dist/utilities.js CHANGED
@@ -1,6 +1,6 @@
1
- import { watch as S, getCurrentScope as K, onScopeDispose as V, computed as h, shallowRef as M, toValue as C, watchEffect as j, getCurrentInstance as B, onMounted as W, unref as q, ref as F, onBeforeUnmount as G } from "vue";
2
- function _(e, t) {
3
- return K() ? (V(e, t), !0) : !1;
1
+ import { watch as y, getCurrentScope as V, onScopeDispose as j, computed as T, shallowRef as H, toValue as h, watchEffect as B, getCurrentInstance as _, onMounted as W, unref as q, ref as F, onBeforeUnmount as G } from "vue";
2
+ function K(e, t) {
3
+ return V() ? (j(e, t), !0) : !1;
4
4
  }
5
5
  const z = typeof window < "u" && typeof document < "u";
6
6
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
@@ -10,41 +10,41 @@ function b(e) {
10
10
  return Array.isArray(e) ? e : [e];
11
11
  }
12
12
  function Z(e, t, n) {
13
- return S(e, t, {
13
+ return y(e, t, {
14
14
  ...n,
15
15
  immediate: !0
16
16
  });
17
17
  }
18
- const E = z ? window : void 0;
19
- function $(e) {
18
+ const $ = z ? window : void 0;
19
+ function v(e) {
20
20
  var t;
21
- const n = C(e);
21
+ const n = h(e);
22
22
  return (t = n?.$el) !== null && t !== void 0 ? t : n;
23
23
  }
24
- function w(...e) {
25
- const t = (o, r, s, l) => (o.addEventListener(r, s, l), () => o.removeEventListener(r, s, l)), n = h(() => {
26
- const o = b(C(e[0])).filter((r) => r != null);
27
- return o.every((r) => typeof r != "string") ? o : void 0;
24
+ function C(...e) {
25
+ const t = (l, r, o, s) => (l.addEventListener(r, o, s), () => l.removeEventListener(r, o, s)), n = T(() => {
26
+ const l = b(h(e[0])).filter((r) => r != null);
27
+ return l.every((r) => typeof r != "string") ? l : void 0;
28
28
  });
29
29
  return Z(() => {
30
- var o, r;
30
+ var l, r;
31
31
  return [
32
- (o = (r = n.value) === null || r === void 0 ? void 0 : r.map((s) => $(s))) !== null && o !== void 0 ? o : [E].filter((s) => s != null),
33
- b(C(n.value ? e[1] : e[0])),
32
+ (l = (r = n.value) === null || r === void 0 ? void 0 : r.map((o) => v(o))) !== null && l !== void 0 ? l : [$].filter((o) => o != null),
33
+ b(h(n.value ? e[1] : e[0])),
34
34
  b(q(n.value ? e[2] : e[1])),
35
- C(n.value ? e[3] : e[2])
35
+ h(n.value ? e[3] : e[2])
36
36
  ];
37
- }, ([o, r, s, l], i, a) => {
38
- if (!o?.length || !r?.length || !s?.length) return;
39
- const c = X(l) ? { ...l } : l, u = o.flatMap((f) => r.flatMap((d) => s.map((p) => t(f, d, p, c))));
37
+ }, ([l, r, o, s], i, a) => {
38
+ if (!l?.length || !r?.length || !o?.length) return;
39
+ const c = X(s) ? { ...s } : s, f = l.flatMap((u) => r.flatMap((d) => o.map((p) => t(u, d, p, c))));
40
40
  a(() => {
41
- u.forEach((f) => f());
41
+ f.forEach((u) => u());
42
42
  });
43
43
  }, { flush: "post" });
44
44
  }
45
45
  // @__NO_SIDE_EFFECTS__
46
46
  function ee() {
47
- const e = M(!1), t = B();
47
+ const e = H(!1), t = _();
48
48
  return t && W(() => {
49
49
  e.value = !0;
50
50
  }, t), e;
@@ -52,193 +52,211 @@ function ee() {
52
52
  // @__NO_SIDE_EFFECTS__
53
53
  function te(e) {
54
54
  const t = /* @__PURE__ */ ee();
55
- return h(() => (t.value, !!e()));
55
+ return T(() => (t.value, !!e()));
56
56
  }
57
57
  function ne(e, t, n = {}) {
58
- const { window: o = E, ...r } = n;
59
- let s;
60
- const l = /* @__PURE__ */ te(() => o && "MutationObserver" in o), i = () => {
61
- s && (s.disconnect(), s = void 0);
62
- }, a = S(h(() => {
63
- const f = b(C(e)).map($).filter(J);
64
- return new Set(f);
65
- }), (f) => {
66
- i(), l.value && f.size && (s = new MutationObserver(t), f.forEach((d) => s.observe(d, r)));
58
+ const { window: l = $, ...r } = n;
59
+ let o;
60
+ const s = /* @__PURE__ */ te(() => l && "MutationObserver" in l), i = () => {
61
+ o && (o.disconnect(), o = void 0);
62
+ }, a = y(T(() => {
63
+ const u = b(h(e)).map(v).filter(J);
64
+ return new Set(u);
65
+ }), (u) => {
66
+ i(), s.value && u.size && (o = new MutationObserver(t), u.forEach((d) => o.observe(d, r)));
67
67
  }, {
68
68
  immediate: !0,
69
69
  flush: "post"
70
- }), c = () => s?.takeRecords(), u = () => {
70
+ }), c = () => o?.takeRecords(), f = () => {
71
71
  a(), i();
72
72
  };
73
- return _(u), {
74
- isSupported: l,
75
- stop: u,
73
+ return K(f), {
74
+ isSupported: s,
75
+ stop: f,
76
76
  takeRecords: c
77
77
  };
78
78
  }
79
79
  function oe(e, t, n = {}) {
80
- const { window: o = E, document: r = o?.document, flush: s = "sync" } = n;
81
- if (!o || !r) return Y;
82
- let l;
83
- const i = (u) => {
84
- l?.(), l = u;
85
- }, a = j(() => {
86
- const u = $(e);
87
- if (u) {
88
- const { stop: f } = ne(r, (d) => {
89
- d.map((p) => [...p.removedNodes]).flat().some((p) => p === u || p.contains(u)) && t(d);
80
+ const { window: l = $, document: r = l?.document, flush: o = "sync" } = n;
81
+ if (!l || !r) return Y;
82
+ let s;
83
+ const i = (f) => {
84
+ s?.(), s = f;
85
+ }, a = B(() => {
86
+ const f = v(e);
87
+ if (f) {
88
+ const { stop: u } = ne(r, (d) => {
89
+ d.map((p) => [...p.removedNodes]).flat().some((p) => p === f || p.contains(f)) && t(d);
90
90
  }, {
91
- window: o,
91
+ window: l,
92
92
  childList: !0,
93
93
  subtree: !0
94
94
  });
95
- i(f);
95
+ i(u);
96
96
  }
97
- }, { flush: s }), c = () => {
97
+ }, { flush: o }), c = () => {
98
98
  a(), i();
99
99
  };
100
- return _(c), c;
100
+ return K(c), c;
101
101
  }
102
102
  // @__NO_SIDE_EFFECTS__
103
103
  function le(e = {}) {
104
104
  var t;
105
- const { window: n = E, deep: o = !0, triggerOnRemoval: r = !1 } = e, s = (t = e.document) !== null && t !== void 0 ? t : n?.document, l = () => {
106
- let c = s?.activeElement;
107
- if (o)
108
- for (var u; c?.shadowRoot; ) c = c == null || (u = c.shadowRoot) === null || u === void 0 ? void 0 : u.activeElement;
105
+ const { window: n = $, deep: l = !0, triggerOnRemoval: r = !1 } = e, o = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {
106
+ let c = o?.activeElement;
107
+ if (l)
108
+ for (var f; c?.shadowRoot; ) c = c == null || (f = c.shadowRoot) === null || f === void 0 ? void 0 : f.activeElement;
109
109
  return c;
110
- }, i = M(), a = () => {
111
- i.value = l();
110
+ }, i = H(), a = () => {
111
+ i.value = s();
112
112
  };
113
113
  if (n) {
114
114
  const c = {
115
115
  capture: !0,
116
116
  passive: !0
117
117
  };
118
- w(n, "blur", (u) => {
119
- u.relatedTarget === null && a();
120
- }, c), w(n, "focus", a, c);
118
+ C(n, "blur", (f) => {
119
+ f.relatedTarget === null && a();
120
+ }, c), C(n, "focus", a, c);
121
121
  }
122
- return r && oe(i, a, { document: s }), a(), i;
122
+ return r && oe(i, a, { document: o }), a(), i;
123
123
  }
124
124
  const re = "focusin", se = "focusout", ie = ":focus-within";
125
125
  function ce(e, t = {}) {
126
- const { window: n = E } = t, o = h(() => $(e)), r = M(!1), s = h(() => r.value);
127
- if (!n || !(/* @__PURE__ */ le(t)).value) return { focused: s };
126
+ const { window: n = $ } = t, l = T(() => v(e)), r = H(!1), o = T(() => r.value);
127
+ if (!n || !(/* @__PURE__ */ le(t)).value) return { focused: o };
128
128
  const i = { passive: !0 };
129
- return w(o, re, () => r.value = !0, i), w(o, se, () => {
130
- var a, c, u;
131
- return r.value = (a = (c = o.value) === null || c === void 0 || (u = c.matches) === null || u === void 0 ? void 0 : u.call(c, ie)) !== null && a !== void 0 ? a : !1;
132
- }, i), { focused: s };
129
+ return C(l, re, () => r.value = !0, i), C(l, se, () => {
130
+ var a, c, f;
131
+ return r.value = (a = (c = l.value) === null || c === void 0 || (f = c.matches) === null || f === void 0 ? void 0 : f.call(c, ie)) !== null && a !== void 0 ? a : !1;
132
+ }, i), { focused: o };
133
133
  }
134
- function ae(e, { window: t = E, scrollTarget: n } = {}) {
135
- const o = F(!1), r = () => {
134
+ function ae(e, { window: t = $, scrollTarget: n } = {}) {
135
+ const l = F(!1), r = () => {
136
136
  if (!t) return;
137
- const s = t.document, l = $(e);
138
- if (!l)
139
- o.value = !1;
137
+ const o = t.document, s = v(e);
138
+ if (!s)
139
+ l.value = !1;
140
140
  else {
141
- const i = l.getBoundingClientRect();
142
- o.value = i.top <= (t.innerHeight || s.documentElement.clientHeight) && i.left <= (t.innerWidth || s.documentElement.clientWidth) && i.bottom >= 0 && i.right >= 0;
141
+ const i = s.getBoundingClientRect();
142
+ l.value = i.top <= (t.innerHeight || o.documentElement.clientHeight) && i.left <= (t.innerWidth || o.documentElement.clientWidth) && i.bottom >= 0 && i.right >= 0;
143
143
  }
144
144
  };
145
- return S(
146
- () => $(e),
145
+ return y(
146
+ () => v(e),
147
147
  () => r(),
148
148
  { immediate: !0, flush: "post" }
149
- ), t && w(n || t, "scroll", r, {
149
+ ), t && C(n || t, "scroll", r, {
150
150
  capture: !1,
151
151
  passive: !0
152
- }), o;
152
+ }), l;
153
153
  }
154
154
  const m = (e) => {
155
155
  let t = ae(e).value;
156
156
  return t = t && e.offsetHeight > 0, t;
157
- }, g = (e) => e.tabIndex >= 0, D = (e) => {
158
- const t = e.target;
159
- return k(t);
160
- }, k = (e) => {
157
+ }, E = (e) => e.tabIndex >= 0, D = (e) => {
158
+ if (e.target instanceof HTMLElement)
159
+ return S(e.target);
160
+ }, S = (e) => {
161
161
  let t;
162
162
  if (e instanceof HTMLTableCellElement) {
163
163
  const n = e.parentElement?.previousElementSibling;
164
- if (n) {
164
+ if (n instanceof HTMLTableRowElement) {
165
165
  const r = Array.from(n.children)[e.cellIndex];
166
- r && (t = r);
166
+ r instanceof HTMLElement && (t = r);
167
167
  }
168
168
  } else if (e instanceof HTMLTableRowElement) {
169
169
  const n = e.previousElementSibling;
170
- n && (t = n);
170
+ n instanceof HTMLTableRowElement && (t = n);
171
171
  }
172
- return t && (!g(t) || !m(t)) ? k(t) : t;
173
- }, ue = (e) => {
172
+ return t && (!E(t) || !m(t)) ? S(t) : t;
173
+ }, fe = (e) => {
174
+ if (!(e.target instanceof HTMLElement)) return;
174
175
  const t = e.target;
175
176
  let n;
176
177
  if (t instanceof HTMLTableCellElement) {
177
- const o = t.parentElement?.parentElement;
178
- if (o) {
179
- const s = o.firstElementChild?.children[t.cellIndex];
180
- s && (n = s);
178
+ const l = t.parentElement?.parentElement;
179
+ if (l) {
180
+ const o = l.firstElementChild?.children[t.cellIndex];
181
+ o instanceof HTMLElement && (n = o);
181
182
  }
182
183
  } else if (t instanceof HTMLTableRowElement) {
183
- const o = t.parentElement;
184
- if (o) {
185
- const r = o.firstElementChild;
186
- r && (n = r);
184
+ const l = t.parentElement;
185
+ if (l) {
186
+ const r = l.firstElementChild;
187
+ r instanceof HTMLTableRowElement && (n = r);
187
188
  }
188
189
  }
189
- return n && (!g(n) || !m(n)) ? A(n) : n;
190
+ return n && (!E(n) || !m(n)) ? R(n) : n;
190
191
  }, P = (e) => {
191
- const t = e.target;
192
- return A(t);
193
- }, A = (e) => {
192
+ if (e.target instanceof HTMLElement)
193
+ return R(e.target);
194
+ }, R = (e) => {
194
195
  let t;
195
196
  if (e instanceof HTMLTableCellElement) {
196
197
  const n = e.parentElement?.nextElementSibling;
197
198
  if (n) {
198
199
  const r = Array.from(n.children)[e.cellIndex];
199
- r && (t = r);
200
+ r instanceof HTMLElement && (t = r);
200
201
  }
201
202
  } else if (e instanceof HTMLTableRowElement) {
202
203
  const n = e.nextElementSibling;
203
- n && (t = n);
204
+ n instanceof HTMLTableRowElement && (t = n);
204
205
  }
205
- return t && (!g(t) || !m(t)) ? A(t) : t;
206
- }, fe = (e) => {
206
+ return t && (!E(t) || !m(t)) ? R(t) : t;
207
+ }, ue = (e) => {
208
+ if (!(e.target instanceof HTMLElement)) return;
207
209
  const t = e.target;
208
210
  let n;
209
211
  if (t instanceof HTMLTableCellElement) {
210
- const o = t.parentElement?.parentElement;
211
- if (o) {
212
- const s = o.lastElementChild?.children[t.cellIndex];
213
- s && (n = s);
212
+ const l = t.parentElement?.parentElement;
213
+ if (l) {
214
+ const o = l.lastElementChild?.children[t.cellIndex];
215
+ o instanceof HTMLElement && (n = o);
214
216
  }
215
217
  } else if (t instanceof HTMLTableRowElement) {
216
- const o = t.parentElement;
217
- if (o) {
218
- const r = o.lastElementChild;
219
- r && (n = r);
218
+ const l = t.parentElement;
219
+ if (l) {
220
+ const r = l.lastElementChild;
221
+ r instanceof HTMLTableRowElement && (n = r);
220
222
  }
221
223
  }
222
- return n && (!g(n) || !m(n)) ? k(n) : n;
224
+ return n && (!E(n) || !m(n)) ? S(n) : n;
223
225
  }, O = (e) => {
224
- const t = e.target;
225
- return L(t);
226
- }, L = (e) => {
226
+ if (e.target instanceof HTMLElement)
227
+ return k(e.target);
228
+ }, k = (e) => {
227
229
  let t;
228
- return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!g(t) || !m(t)) ? L(t) : t;
230
+ const n = e.previousElementSibling;
231
+ if (n instanceof HTMLElement)
232
+ t = n;
233
+ else {
234
+ const r = e.parentElement?.previousElementSibling?.lastElementChild;
235
+ r instanceof HTMLElement && (t = r);
236
+ }
237
+ return t && (!E(t) || !m(t)) ? k(t) : t;
229
238
  }, U = (e) => {
230
- const t = e.target;
231
- return x(t);
232
- }, x = (e) => {
239
+ if (e.target instanceof HTMLElement)
240
+ return A(e.target);
241
+ }, A = (e) => {
233
242
  let t;
234
- return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!g(t) || !m(t)) ? x(t) : t;
243
+ const n = e.nextElementSibling;
244
+ if (n instanceof HTMLElement)
245
+ t = n;
246
+ else {
247
+ const r = e.parentElement?.nextElementSibling?.firstElementChild;
248
+ r instanceof HTMLElement && (t = r);
249
+ }
250
+ return t && (!E(t) || !m(t)) ? A(t) : t;
235
251
  }, I = (e) => {
236
- const o = e.target.parentElement?.firstElementChild;
237
- return o && (!g(o) || !m(o)) ? x(o) : o;
252
+ if (!(e.target instanceof HTMLElement)) return;
253
+ const n = e.target.parentElement?.firstElementChild, l = n instanceof HTMLElement ? n : null;
254
+ return l && (!E(l) || !m(l)) ? A(l) : l;
238
255
  }, N = (e) => {
239
- const o = e.target.parentElement?.lastElementChild;
240
- return o && (!g(o) || !m(o)) ? L(o) : o;
241
- }, y = ["alt", "control", "shift", "meta"], de = {
256
+ if (!(e.target instanceof HTMLElement)) return;
257
+ const n = e.target.parentElement?.lastElementChild, l = n instanceof HTMLElement ? n : null;
258
+ return l && (!E(l) || !m(l)) ? k(l) : l;
259
+ }, w = ["alt", "control", "shift", "meta"], de = {
242
260
  ArrowUp: "up",
243
261
  ArrowDown: "down",
244
262
  ArrowLeft: "left",
@@ -261,11 +279,11 @@ const m = (e) => {
261
279
  e.preventDefault(), e.stopPropagation(), t && t.focus();
262
280
  },
263
281
  "keydown.control.up": (e) => {
264
- const t = ue(e);
282
+ const t = fe(e);
265
283
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
266
284
  },
267
285
  "keydown.control.down": (e) => {
268
- const t = fe(e);
286
+ const t = ue(e);
269
287
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
270
288
  },
271
289
  "keydown.control.left": (e) => {
@@ -281,6 +299,7 @@ const m = (e) => {
281
299
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
282
300
  },
283
301
  "keydown.enter": (e) => {
302
+ if (!(e.target instanceof HTMLElement)) return;
284
303
  if (e.target instanceof HTMLTableCellElement) {
285
304
  e.preventDefault(), e.stopPropagation();
286
305
  const n = P(e);
@@ -288,6 +307,7 @@ const m = (e) => {
288
307
  }
289
308
  },
290
309
  "keydown.shift.enter": (e) => {
310
+ if (!(e.target instanceof HTMLElement)) return;
291
311
  if (e.target instanceof HTMLTableCellElement) {
292
312
  e.preventDefault(), e.stopPropagation();
293
313
  const n = D(e);
@@ -307,75 +327,76 @@ const m = (e) => {
307
327
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
308
328
  }
309
329
  };
310
- function ge(e) {
311
- const t = (l) => {
312
- let i = null;
313
- return l.parent && (typeof l.parent == "string" ? i = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? i = l.parent : i = l.parent.value), i;
314
- }, n = (l) => {
315
- const i = t(l);
316
- let a = [];
317
- if (typeof l.selectors == "string")
318
- a = Array.from(i ? i.querySelectorAll(l.selectors) : document.querySelectorAll(l.selectors));
319
- else if (Array.isArray(l.selectors))
320
- for (const c of l.selectors)
321
- c instanceof HTMLElement ? a.push(c) : a.push(c.$el);
322
- else if (l.selectors instanceof HTMLElement)
323
- a.push(l.selectors);
324
- else if (l.selectors?.value)
325
- if (Array.isArray(l.selectors.value))
326
- for (const c of l.selectors.value)
327
- c instanceof HTMLElement ? a.push(c) : a.push(c.$el);
330
+ function L(e) {
331
+ let t = null;
332
+ return e.parent && (typeof e.parent == "string" ? t = document.querySelector(e.parent) : e.parent instanceof HTMLElement ? t = e.parent : t = e.parent.value), t;
333
+ }
334
+ function Ee(e) {
335
+ const t = (o) => {
336
+ const s = L(o);
337
+ let i = [];
338
+ if (typeof o.selectors == "string")
339
+ i = Array.from(s ? s.querySelectorAll(o.selectors) : document.querySelectorAll(o.selectors));
340
+ else if (Array.isArray(o.selectors))
341
+ for (const a of o.selectors)
342
+ a instanceof HTMLElement ? i.push(a) : i.push(a.$el);
343
+ else if (o.selectors instanceof HTMLElement)
344
+ i.push(o.selectors);
345
+ else if (o.selectors?.value)
346
+ if (Array.isArray(o.selectors.value))
347
+ for (const a of o.selectors.value)
348
+ a instanceof HTMLElement ? i.push(a) : i.push(a.$el);
328
349
  else
329
- a.push(l.selectors.value);
330
- return a;
331
- }, o = (l) => {
332
- const i = t(l);
333
- let a = [];
334
- return l.selectors ? a = n(l) : i && (a = Array.from(i.children).filter((u) => g(u) && m(u))), a;
335
- }, r = (l) => (i) => {
336
- const a = de[i.key] || i.key.toLowerCase();
337
- if (y.includes(a)) return;
338
- const c = l.handlers || pe;
339
- for (const u of Object.keys(c)) {
340
- const [f, ...d] = u.split(".");
341
- if (f === "keydown" && d.includes(a)) {
342
- const p = c[u], T = d.filter((v) => y.includes(v)), H = y.some((v) => {
343
- const R = v.charAt(0).toUpperCase() + v.slice(1);
344
- return i.getModifierState(R);
350
+ i.push(o.selectors.value);
351
+ return i;
352
+ }, n = (o) => {
353
+ const s = L(o);
354
+ let i = [];
355
+ return o.selectors ? i = t(o) : s && (i = Array.from(s.children).filter((c) => c instanceof HTMLElement).filter((c) => E(c) && m(c))), i;
356
+ }, l = (o) => (s) => {
357
+ const i = de[s.key] || s.key.toLowerCase();
358
+ if (w.includes(i)) return;
359
+ const a = o.handlers || pe;
360
+ for (const c of Object.keys(a)) {
361
+ const [f, ...u] = c.split(".");
362
+ if (f === "keydown" && u.includes(i)) {
363
+ const d = a[c], p = u.filter((g) => w.includes(g)), x = w.some((g) => {
364
+ const M = g.charAt(0).toUpperCase() + g.slice(1);
365
+ return s.getModifierState(M);
345
366
  });
346
- if (T.length > 0) {
347
- if (H) {
348
- for (const v of y)
349
- if (d.includes(v)) {
350
- const R = v.charAt(0).toUpperCase() + v.slice(1);
351
- i.getModifierState(R) && p(i);
367
+ if (p.length > 0) {
368
+ if (x) {
369
+ for (const g of w)
370
+ if (u.includes(g)) {
371
+ const M = g.charAt(0).toUpperCase() + g.slice(1);
372
+ s.getModifierState(M) && d(s);
352
373
  }
353
374
  }
354
375
  } else
355
- H || p(i);
376
+ x || d(s);
356
377
  }
357
378
  }
358
- }, s = [];
379
+ }, r = [];
359
380
  W(() => {
360
- for (const l of e) {
361
- const i = t(l), a = o(l), c = r(l), u = i ? [i] : a;
362
- for (const f of u) {
363
- const { focused: d } = ce(F(f)), p = S(d, (T) => {
364
- T ? f.addEventListener("keydown", c) : f.removeEventListener("keydown", c);
381
+ for (const o of e) {
382
+ const s = L(o), i = n(o), a = l(o), c = s ? [s] : i;
383
+ for (const f of c) {
384
+ const { focused: u } = ce(F(f)), d = y(u, (p) => {
385
+ p ? f.addEventListener("keydown", a) : f.removeEventListener("keydown", a);
365
386
  });
366
- s.push(p);
387
+ r.push(d);
367
388
  }
368
389
  }
369
390
  }), G(() => {
370
- for (const l of s)
371
- l();
391
+ for (const o of r)
392
+ o();
372
393
  });
373
394
  }
374
- function ve(e) {
395
+ function ge(e) {
375
396
  }
376
397
  export {
377
398
  pe as defaultKeypressHandlers,
378
- ve as install,
379
- ge as useKeyboardNav
399
+ ge as install,
400
+ Ee as useKeyboardNav
380
401
  };
381
402
  //# sourceMappingURL=utilities.js.map