@sps-woodland/modal 8.2.2 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,159 +1,162 @@
1
- import { Metadata as Ce, cl as le, combineEventHandlers as $e, I18nContext as ot, useChildTestIdAttrBuilder as rt, selectChildren as nt, modChildren as at, Icon as lt, contentOf as oe } from "@sps-woodland/core";
2
- import { Button as he } from "@sps-woodland/buttons";
1
+ import { Metadata as Oe, cl as ue, combineEventHandlers as Me, I18nContext as st, useChildTestIdAttrBuilder as dt, selectChildren as ut, modChildren as ct, Icon as mt, contentOf as le } from "@sps-woodland/core";
2
+ import { Button as ye } from "@sps-woodland/buttons";
3
3
  import * as u from "react";
4
- import h, { useState as z, useRef as M, useEffect as S, useCallback as k, useContext as q, useMemo as W } from "react";
5
- import it from "react-dom";
4
+ import h, { useState as H, useRef as y, useEffect as F, useCallback as T, useContext as V, useMemo as z } from "react";
5
+ import ft from "react-dom";
6
6
  import { code as b } from "@spscommerce/utils";
7
- function st(e, t, o) {
8
- let [r, n] = z(e || t), a = M(e !== void 0), l = e !== void 0;
9
- S(() => {
10
- let d = a.current;
11
- d !== l && console.warn(`WARN: A component changed from ${d ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}.`), a.current = l;
7
+ function pt(e, t, o) {
8
+ let [r, n] = H(e || t), l = y(e !== void 0), a = e !== void 0;
9
+ F(() => {
10
+ let d = l.current;
11
+ d !== a && console.warn(`WARN: A component changed from ${d ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}.`), l.current = a;
12
12
  }, [
13
- l
13
+ a
14
14
  ]);
15
- let s = l ? e : r, i = k((d, ...c) => {
16
- let p = (m, ...g) => {
17
- o && (Object.is(s, m) || o(m, ...g)), l || (s = m);
15
+ let s = a ? e : r, c = T((d, ...i) => {
16
+ let f = (m, ...g) => {
17
+ o && (Object.is(s, m) || o(m, ...g)), a || (s = m);
18
18
  };
19
- typeof d == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((g, ...f) => {
20
- let P = d(l ? s : g, ...f);
21
- return p(P, ...c), l ? g : P;
22
- })) : (l || n(d), p(d, ...c));
19
+ typeof d == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((g, ...p) => {
20
+ let x = d(a ? s : g, ...p);
21
+ return f(x, ...i), a ? g : x;
22
+ })) : (a || n(d), f(d, ...i));
23
23
  }, [
24
- l,
24
+ a,
25
25
  s,
26
26
  o
27
27
  ]);
28
28
  return [
29
29
  s,
30
- i
30
+ c
31
31
  ];
32
32
  }
33
- const j = {
33
+ const G = {
34
34
  prefix: String(Math.round(Math.random() * 1e10)),
35
35
  current: 0
36
- }, Ne = /* @__PURE__ */ h.createContext(j), dt = /* @__PURE__ */ h.createContext(!1);
37
- let ut = Boolean(typeof window < "u" && window.document && window.document.createElement), re = /* @__PURE__ */ new WeakMap();
38
- function ct(e = !1) {
39
- let t = q(Ne), o = M(null);
36
+ }, De = /* @__PURE__ */ h.createContext(G), gt = /* @__PURE__ */ h.createContext(!1);
37
+ let bt = Boolean(typeof window < "u" && window.document && window.document.createElement), ie = /* @__PURE__ */ new WeakMap();
38
+ function vt(e = !1) {
39
+ let t = V(De), o = y(null);
40
40
  if (o.current === null && !e) {
41
41
  var r, n;
42
- let a = (n = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || n === void 0 || (r = n.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
43
- if (a) {
44
- let l = re.get(a);
45
- l == null ? re.set(a, {
42
+ let l = (n = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || n === void 0 || (r = n.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
43
+ if (l) {
44
+ let a = ie.get(l);
45
+ a == null ? ie.set(l, {
46
46
  id: t.current,
47
- state: a.memoizedState
48
- }) : a.memoizedState !== l.state && (t.current = l.id, re.delete(a));
47
+ state: l.memoizedState
48
+ }) : l.memoizedState !== a.state && (t.current = a.id, ie.delete(l));
49
49
  }
50
50
  o.current = ++t.current;
51
51
  }
52
52
  return o.current;
53
53
  }
54
- function mt(e) {
55
- let t = q(Ne);
56
- t === j && !ut && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
57
- let o = ct(!!e), r = t === j && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
54
+ function $t(e) {
55
+ let t = V(De);
56
+ t === G && !bt && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
57
+ let o = vt(!!e), r = t === G && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
58
58
  return e || `${r}-${o}`;
59
59
  }
60
- function pt(e) {
61
- let t = h.useId(), [o] = z(Oe()), r = o || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${j.prefix}`;
60
+ function ht(e) {
61
+ let t = h.useId(), [o] = H(We()), r = o || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${G.prefix}`;
62
62
  return e || `${r}-${t}`;
63
63
  }
64
- const ft = typeof h.useId == "function" ? pt : mt;
65
- function gt() {
64
+ const wt = typeof h.useId == "function" ? ht : $t;
65
+ function Et() {
66
66
  return !1;
67
67
  }
68
- function bt() {
68
+ function Mt() {
69
69
  return !0;
70
70
  }
71
- function vt(e) {
71
+ function yt(e) {
72
72
  return () => {
73
73
  };
74
74
  }
75
- function Oe() {
76
- return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(vt, gt, bt) : q(dt);
75
+ function We() {
76
+ return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(yt, Et, Mt) : V(gt);
77
77
  }
78
- function De(e) {
78
+ function Ae(e) {
79
79
  var t, o, r = "";
80
80
  if (typeof e == "string" || typeof e == "number")
81
81
  r += e;
82
82
  else if (typeof e == "object")
83
- if (Array.isArray(e))
84
- for (t = 0; t < e.length; t++)
85
- e[t] && (o = De(e[t])) && (r && (r += " "), r += o);
86
- else
87
- for (t in e)
88
- e[t] && (r && (r += " "), r += t);
83
+ if (Array.isArray(e)) {
84
+ var n = e.length;
85
+ for (t = 0; t < n; t++)
86
+ e[t] && (o = Ae(e[t])) && (r && (r += " "), r += o);
87
+ } else
88
+ for (o in e)
89
+ e[o] && (r && (r += " "), r += o);
89
90
  return r;
90
91
  }
91
- function $t() {
92
- for (var e, t, o = 0, r = ""; o < arguments.length; )
93
- (e = arguments[o++]) && (t = De(e)) && (r && (r += " "), r += t);
92
+ function Pt() {
93
+ for (var e, t, o = 0, r = "", n = arguments.length; o < n; o++)
94
+ (e = arguments[o]) && (t = Ae(e)) && (r && (r += " "), r += t);
94
95
  return r;
95
96
  }
96
97
  const w = typeof document < "u" ? h.useLayoutEffect : () => {
97
98
  };
98
99
  function R(e) {
99
- const t = M(null);
100
+ const t = y(null);
100
101
  return w(() => {
101
102
  t.current = e;
102
103
  }, [
103
104
  e
104
- ]), k((...o) => {
105
+ ]), T((...o) => {
105
106
  const r = t.current;
106
- return r(...o);
107
+ return r == null ? void 0 : r(...o);
107
108
  }, []);
108
109
  }
109
- function ht(e) {
110
- let [t, o] = z(e), r = M(null), n = R(() => {
111
- let l = r.current.next();
112
- if (l.done) {
110
+ function kt(e) {
111
+ let [t, o] = H(e), r = y(null), n = R(() => {
112
+ if (!r.current)
113
+ return;
114
+ let a = r.current.next();
115
+ if (a.done) {
113
116
  r.current = null;
114
117
  return;
115
118
  }
116
- t === l.value ? n() : o(l.value);
119
+ t === a.value ? n() : o(a.value);
117
120
  });
118
121
  w(() => {
119
122
  r.current && n();
120
123
  });
121
- let a = R((l) => {
122
- r.current = l(t), n();
124
+ let l = R((a) => {
125
+ r.current = a(t), n();
123
126
  });
124
127
  return [
125
128
  t,
126
- a
129
+ l
127
130
  ];
128
131
  }
129
- let wt = Boolean(typeof window < "u" && window.document && window.document.createElement), U = /* @__PURE__ */ new Map();
130
- function Ae(e) {
131
- let [t, o] = z(e), r = M(null), n = ft(t), a = k((l) => {
132
- r.current = l;
132
+ let xt = Boolean(typeof window < "u" && window.document && window.document.createElement), X = /* @__PURE__ */ new Map();
133
+ function Ie(e) {
134
+ let [t, o] = H(e), r = y(null), n = wt(t), l = T((a) => {
135
+ r.current = a;
133
136
  }, []);
134
- return wt && U.set(n, a), w(() => {
135
- let l = n;
137
+ return xt && X.set(n, l), w(() => {
138
+ let a = n;
136
139
  return () => {
137
- U.delete(l);
140
+ X.delete(a);
138
141
  };
139
142
  }, [
140
143
  n
141
- ]), S(() => {
142
- let l = r.current;
143
- l && (r.current = null, o(l));
144
+ ]), F(() => {
145
+ let a = r.current;
146
+ a && (r.current = null, o(a));
144
147
  }), n;
145
148
  }
146
- function Et(e, t) {
149
+ function Tt(e, t) {
147
150
  if (e === t)
148
151
  return e;
149
- let o = U.get(e);
152
+ let o = X.get(e);
150
153
  if (o)
151
154
  return o(t), t;
152
- let r = U.get(t);
155
+ let r = X.get(t);
153
156
  return r ? (r(e), e) : t;
154
157
  }
155
- function Mt(e = []) {
156
- let t = Ae(), [o, r] = ht(t), n = k(() => {
158
+ function St(e = []) {
159
+ let t = Ie(), [o, r] = kt(t), n = T(() => {
157
160
  r(function* () {
158
161
  yield t, yield document.getElementById(t) ? t : void 0;
159
162
  });
@@ -167,78 +170,78 @@ function Mt(e = []) {
167
170
  ...e
168
171
  ]), o;
169
172
  }
170
- function G(...e) {
173
+ function J(...e) {
171
174
  return (...t) => {
172
175
  for (let o of e)
173
176
  typeof o == "function" && o(...t);
174
177
  };
175
178
  }
176
- const yt = (e) => {
179
+ const E = (e) => {
177
180
  var t;
178
181
  return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
179
- };
180
- function Pt(...e) {
182
+ }, Y = (e) => e && "window" in e && e.window === e ? e : E(e).defaultView || window;
183
+ function Lt(...e) {
181
184
  let t = {
182
185
  ...e[0]
183
186
  };
184
187
  for (let o = 1; o < e.length; o++) {
185
188
  let r = e[o];
186
189
  for (let n in r) {
187
- let a = t[n], l = r[n];
188
- typeof a == "function" && typeof l == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = G(a, l) : (n === "className" || n === "UNSAFE_className") && typeof a == "string" && typeof l == "string" ? t[n] = $t(a, l) : n === "id" && a && l ? t.id = Et(a, l) : t[n] = l !== void 0 ? l : a;
190
+ let l = t[n], a = r[n];
191
+ typeof l == "function" && typeof a == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = J(l, a) : (n === "className" || n === "UNSAFE_className") && typeof l == "string" && typeof a == "string" ? t[n] = Pt(l, a) : n === "id" && l && a ? t.id = Tt(l, a) : t[n] = a !== void 0 ? a : l;
189
192
  }
190
193
  }
191
194
  return t;
192
195
  }
193
- const kt = /* @__PURE__ */ new Set([
196
+ const Ft = /* @__PURE__ */ new Set([
194
197
  "id"
195
- ]), Tt = /* @__PURE__ */ new Set([
198
+ ]), Bt = /* @__PURE__ */ new Set([
196
199
  "aria-label",
197
200
  "aria-labelledby",
198
201
  "aria-describedby",
199
202
  "aria-details"
200
- ]), xt = /* @__PURE__ */ new Set([
203
+ ]), Ct = /* @__PURE__ */ new Set([
201
204
  "href",
202
205
  "target",
203
206
  "rel",
204
207
  "download",
205
208
  "ping",
206
209
  "referrerPolicy"
207
- ]), St = /^(data-.*)$/;
208
- function Ft(e, t = {}) {
209
- let { labelable: o, isLink: r, propNames: n } = t, a = {};
210
- for (const l in e)
211
- Object.prototype.hasOwnProperty.call(e, l) && (kt.has(l) || o && Tt.has(l) || r && xt.has(l) || (n == null ? void 0 : n.has(l)) || St.test(l)) && (a[l] = e[l]);
212
- return a;
213
- }
214
- function we(e) {
215
- if (Lt())
210
+ ]), Nt = /^(data-.*)$/;
211
+ function Ot(e, t = {}) {
212
+ let { labelable: o, isLink: r, propNames: n } = t, l = {};
213
+ for (const a in e)
214
+ Object.prototype.hasOwnProperty.call(e, a) && (Ft.has(a) || o && Bt.has(a) || r && Ct.has(a) || (n == null ? void 0 : n.has(a)) || Nt.test(a)) && (l[a] = e[a]);
215
+ return l;
216
+ }
217
+ function Pe(e) {
218
+ if (Dt())
216
219
  e.focus({
217
220
  preventScroll: !0
218
221
  });
219
222
  else {
220
- let t = Bt(e);
221
- e.focus(), Ct(t);
223
+ let t = Wt(e);
224
+ e.focus(), At(t);
222
225
  }
223
226
  }
224
- let H = null;
225
- function Lt() {
226
- if (H == null) {
227
- H = !1;
227
+ let _ = null;
228
+ function Dt() {
229
+ if (_ == null) {
230
+ _ = !1;
228
231
  try {
229
- var e = document.createElement("div");
230
- e.focus({
232
+ document.createElement("div").focus({
231
233
  get preventScroll() {
232
- return H = !0, !0;
234
+ return _ = !0, !0;
233
235
  }
234
236
  });
235
237
  } catch {
236
238
  }
237
239
  }
238
- return H;
240
+ return _;
239
241
  }
240
- function Bt(e) {
241
- for (var t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== r; )
242
+ function Wt(e) {
243
+ let t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement;
244
+ for (; t instanceof HTMLElement && t !== r; )
242
245
  (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && o.push({
243
246
  element: t,
244
247
  scrollTop: t.scrollTop,
@@ -250,75 +253,85 @@ function Bt(e) {
250
253
  scrollLeft: r.scrollLeft
251
254
  }), o;
252
255
  }
253
- function Ct(e) {
256
+ function At(e) {
254
257
  for (let { element: t, scrollTop: o, scrollLeft: r } of e)
255
258
  t.scrollTop = o, t.scrollLeft = r;
256
259
  }
257
- function Nt(e) {
260
+ function It(e) {
258
261
  var t;
259
262
  return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((o) => e.test(o.brand))) || e.test(window.navigator.userAgent);
260
263
  }
261
- function ce(e) {
264
+ function ge(e) {
262
265
  var t;
263
266
  return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
264
267
  }
265
- function We() {
266
- return ce(/^Mac/i);
268
+ function ze() {
269
+ return ge(/^Mac/i);
267
270
  }
268
- function Ot() {
269
- return ce(/^iPhone/i);
271
+ function zt() {
272
+ return ge(/^iPhone/i);
270
273
  }
271
- function Dt() {
272
- return ce(/^iPad/i) || We() && navigator.maxTouchPoints > 1;
274
+ function qt() {
275
+ return ge(/^iPad/i) || ze() && navigator.maxTouchPoints > 1;
273
276
  }
274
- function At() {
275
- return Ot() || Dt();
277
+ function Rt() {
278
+ return zt() || qt();
276
279
  }
277
- function Wt() {
278
- return Nt(/Android/i);
280
+ function Ht() {
281
+ return It(/Android/i);
279
282
  }
280
- let N = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Set();
281
- function Ee() {
283
+ let O = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set();
284
+ function ke() {
282
285
  if (typeof window > "u")
283
286
  return;
284
- let e = (o) => {
285
- let r = N.get(o.target);
286
- r || (r = /* @__PURE__ */ new Set(), N.set(o.target, r), o.target.addEventListener("transitioncancel", t)), r.add(o.propertyName);
287
- }, t = (o) => {
288
- let r = N.get(o.target);
289
- if (!!r && (r.delete(o.propertyName), r.size === 0 && (o.target.removeEventListener("transitioncancel", t), N.delete(o.target)), N.size === 0)) {
290
- for (let n of ie)
291
- n();
292
- ie.clear();
287
+ function e(r) {
288
+ return "propertyName" in r;
289
+ }
290
+ let t = (r) => {
291
+ if (!e(r) || !r.target)
292
+ return;
293
+ let n = O.get(r.target);
294
+ n || (n = /* @__PURE__ */ new Set(), O.set(r.target, n), r.target.addEventListener("transitioncancel", o, {
295
+ once: !0
296
+ })), n.add(r.propertyName);
297
+ }, o = (r) => {
298
+ if (!e(r) || !r.target)
299
+ return;
300
+ let n = O.get(r.target);
301
+ if (!!n && (n.delete(r.propertyName), n.size === 0 && (r.target.removeEventListener("transitioncancel", o), O.delete(r.target)), O.size === 0)) {
302
+ for (let l of ce)
303
+ l();
304
+ ce.clear();
293
305
  }
294
306
  };
295
- document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
307
+ document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", o);
296
308
  }
297
- typeof document < "u" && (document.readyState !== "loading" ? Ee() : document.addEventListener("DOMContentLoaded", Ee));
298
- function It(e) {
309
+ typeof document < "u" && (document.readyState !== "loading" ? ke() : document.addEventListener("DOMContentLoaded", ke));
310
+ function Vt(e) {
299
311
  requestAnimationFrame(() => {
300
- N.size === 0 ? e() : ie.add(e);
312
+ O.size === 0 ? e() : ce.add(e);
301
313
  });
302
314
  }
303
- function Ie(e) {
304
- for (Me(e) && (e = e.parentElement); e && !Me(e); )
305
- e = e.parentElement;
306
- return e || document.scrollingElement || document.documentElement;
315
+ function qe(e, t) {
316
+ let o = e;
317
+ for (xe(o, t) && (o = o.parentElement); o && !xe(o, t); )
318
+ o = o.parentElement;
319
+ return o || document.scrollingElement || document.documentElement;
307
320
  }
308
- function Me(e) {
309
- let t = window.getComputedStyle(e);
310
- return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
321
+ function xe(e, t) {
322
+ let o = window.getComputedStyle(e), r = /(auto|scroll)/.test(o.overflow + o.overflowX + o.overflowY);
323
+ return r && t && (r = e.scrollHeight !== e.clientHeight || e.scrollWidth !== e.clientWidth), r;
311
324
  }
312
- function Rt(e) {
313
- return e.mozInputSource === 0 && e.isTrusted ? !0 : Wt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
325
+ function Kt(e) {
326
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : Ht() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
314
327
  }
315
328
  const Re = h.createContext({
316
329
  register: () => {
317
330
  }
318
331
  });
319
332
  Re.displayName = "PressResponderContext";
320
- function zt({ children: e }) {
321
- let t = W(() => ({
333
+ function _t({ children: e }) {
334
+ let t = z(() => ({
322
335
  register: () => {
323
336
  }
324
337
  }), []);
@@ -326,7 +339,7 @@ function zt({ children: e }) {
326
339
  value: t
327
340
  }, e);
328
341
  }
329
- class qt {
342
+ class jt {
330
343
  isDefaultPrevented() {
331
344
  return this.nativeEvent.defaultPrevented;
332
345
  }
@@ -345,8 +358,8 @@ class qt {
345
358
  this.nativeEvent = o, this.target = o.target, this.currentTarget = o.currentTarget, this.relatedTarget = o.relatedTarget, this.bubbles = o.bubbles, this.cancelable = o.cancelable, this.defaultPrevented = o.defaultPrevented, this.eventPhase = o.eventPhase, this.isTrusted = o.isTrusted, this.timeStamp = o.timeStamp, this.type = t;
346
359
  }
347
360
  }
348
- function Vt(e) {
349
- let t = M({
361
+ function Ut(e) {
362
+ let t = y({
350
363
  isFocused: !1,
351
364
  observer: null
352
365
  });
@@ -359,18 +372,18 @@ function Vt(e) {
359
372
  let o = R((r) => {
360
373
  e == null || e(r);
361
374
  });
362
- return k((r) => {
375
+ return T((r) => {
363
376
  if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
364
377
  t.current.isFocused = !0;
365
- let n = r.target, a = (l) => {
366
- t.current.isFocused = !1, n.disabled && o(new qt("blur", l)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
378
+ let n = r.target, l = (a) => {
379
+ t.current.isFocused = !1, n.disabled && o(new jt("blur", a)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
367
380
  };
368
- n.addEventListener("focusout", a, {
381
+ n.addEventListener("focusout", l, {
369
382
  once: !0
370
383
  }), t.current.observer = new MutationObserver(() => {
371
384
  if (t.current.isFocused && n.disabled) {
372
- var l;
373
- (l = t.current.observer) === null || l === void 0 || l.disconnect();
385
+ var a;
386
+ (a = t.current.observer) === null || a === void 0 || a.disconnect();
374
387
  let s = n === document.activeElement ? null : document.activeElement;
375
388
  n.dispatchEvent(new FocusEvent("blur", {
376
389
  relatedTarget: s
@@ -390,52 +403,70 @@ function Vt(e) {
390
403
  o
391
404
  ]);
392
405
  }
393
- let V = null, Ht = /* @__PURE__ */ new Set(), ye = !1, B = !1, se = !1;
394
- function me(e, t) {
395
- for (let o of Ht)
406
+ let K = null, Gt = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Map(), N = !1, me = !1;
407
+ function be(e, t) {
408
+ for (let o of Gt)
396
409
  o(e, t);
397
410
  }
398
- function Kt(e) {
399
- return !(e.metaKey || !We() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
411
+ function Xt(e) {
412
+ return !(e.metaKey || !ze() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
400
413
  }
401
- function Pe(e) {
402
- B = !0, Kt(e) && (V = "keyboard", me("keyboard", e));
414
+ function Q(e) {
415
+ N = !0, Xt(e) && (K = "keyboard", be("keyboard", e));
403
416
  }
404
- function C(e) {
405
- V = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (B = !0, me("pointer", e));
417
+ function k(e) {
418
+ K = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (N = !0, be("pointer", e));
406
419
  }
407
- function _t(e) {
408
- Rt(e) && (B = !0, V = "virtual");
420
+ function He(e) {
421
+ Kt(e) && (N = !0, K = "virtual");
409
422
  }
410
- function jt(e) {
411
- e.target === window || e.target === document || (!B && !se && (V = "virtual", me("virtual", e)), B = !1, se = !1);
423
+ function Ve(e) {
424
+ e.target === window || e.target === document || (!N && !me && (K = "virtual", be("virtual", e)), N = !1, me = !1);
412
425
  }
413
- function Ut() {
414
- B = !1, se = !0;
426
+ function Ke() {
427
+ N = !1, me = !0;
415
428
  }
416
- function ke() {
417
- if (typeof window > "u" || ye)
429
+ function Te(e) {
430
+ if (typeof window > "u" || q.get(Y(e)))
418
431
  return;
419
- let e = HTMLElement.prototype.focus;
420
- HTMLElement.prototype.focus = function() {
421
- B = !0, e.apply(this, arguments);
422
- }, document.addEventListener("keydown", Pe, !0), document.addEventListener("keyup", Pe, !0), document.addEventListener("click", _t, !0), window.addEventListener("focus", jt, !0), window.addEventListener("blur", Ut, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", C, !0), document.addEventListener("pointermove", C, !0), document.addEventListener("pointerup", C, !0)) : (document.addEventListener("mousedown", C, !0), document.addEventListener("mousemove", C, !0), document.addEventListener("mouseup", C, !0)), ye = !0;
423
- }
424
- typeof document < "u" && (document.readyState !== "loading" ? ke() : document.addEventListener("DOMContentLoaded", ke));
425
- function Gt() {
426
- return V;
432
+ const t = Y(e), o = E(e);
433
+ let r = t.HTMLElement.prototype.focus;
434
+ t.HTMLElement.prototype.focus = function() {
435
+ N = !0, r.apply(this, arguments);
436
+ }, o.addEventListener("keydown", Q, !0), o.addEventListener("keyup", Q, !0), o.addEventListener("click", He, !0), t.addEventListener("focus", Ve, !0), t.addEventListener("blur", Ke, !1), typeof PointerEvent < "u" ? (o.addEventListener("pointerdown", k, !0), o.addEventListener("pointermove", k, !0), o.addEventListener("pointerup", k, !0)) : (o.addEventListener("mousedown", k, !0), o.addEventListener("mousemove", k, !0), o.addEventListener("mouseup", k, !0)), t.addEventListener("beforeunload", () => {
437
+ _e(e);
438
+ }, {
439
+ once: !0
440
+ }), q.set(t, {
441
+ focus: r
442
+ });
427
443
  }
428
- function Yt(e) {
429
- let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, a = M({
444
+ const _e = (e, t) => {
445
+ const o = Y(e), r = E(e);
446
+ t && r.removeEventListener("DOMContentLoaded", t), q.has(o) && (o.HTMLElement.prototype.focus = q.get(o).focus, r.removeEventListener("keydown", Q, !0), r.removeEventListener("keyup", Q, !0), r.removeEventListener("click", He, !0), o.removeEventListener("focus", Ve, !0), o.removeEventListener("blur", Ke, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", k, !0), r.removeEventListener("pointermove", k, !0), r.removeEventListener("pointerup", k, !0)) : (r.removeEventListener("mousedown", k, !0), r.removeEventListener("mousemove", k, !0), r.removeEventListener("mouseup", k, !0)), q.delete(o));
447
+ };
448
+ function Jt(e) {
449
+ const t = E(e);
450
+ let o;
451
+ return t.readyState !== "loading" ? Te(e) : (o = () => {
452
+ Te(e);
453
+ }, t.addEventListener("DOMContentLoaded", o)), () => _e(e, o);
454
+ }
455
+ typeof document < "u" && Jt();
456
+ function Yt() {
457
+ return K;
458
+ }
459
+ function Qt(e) {
460
+ let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, l = y({
430
461
  isFocusWithin: !1
431
- }), l = k((d) => {
432
- a.current.isFocusWithin && !d.currentTarget.contains(d.relatedTarget) && (a.current.isFocusWithin = !1, o && o(d), n && n(!1));
462
+ }), a = T((d) => {
463
+ l.current.isFocusWithin && !d.currentTarget.contains(d.relatedTarget) && (l.current.isFocusWithin = !1, o && o(d), n && n(!1));
433
464
  }, [
434
465
  o,
435
466
  n,
436
- a
437
- ]), s = Vt(l), i = k((d) => {
438
- !a.current.isFocusWithin && document.activeElement === d.target && (r && r(d), n && n(!0), a.current.isFocusWithin = !0, s(d));
467
+ l
468
+ ]), s = Ut(a), c = T((d) => {
469
+ !l.current.isFocusWithin && document.activeElement === d.target && (r && r(d), n && n(!0), l.current.isFocusWithin = !0, s(d));
439
470
  }, [
440
471
  r,
441
472
  n,
@@ -448,50 +479,50 @@ function Yt(e) {
448
479
  }
449
480
  } : {
450
481
  focusWithinProps: {
451
- onFocus: i,
452
- onBlur: l
482
+ onFocus: c,
483
+ onBlur: a
453
484
  }
454
485
  };
455
486
  }
456
- function Xt(e) {
457
- let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, a = M({
487
+ function Zt(e) {
488
+ let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, l = y({
458
489
  isPointerDown: !1,
459
490
  ignoreEmulatedMouseEvents: !1
460
- }), l = R((i) => {
461
- o && K(i, t) && (n && n(i), a.current.isPointerDown = !0);
462
- }), s = R((i) => {
463
- o && o(i);
491
+ }), a = R((c) => {
492
+ o && j(c, t) && (n && n(c), l.current.isPointerDown = !0);
493
+ }), s = R((c) => {
494
+ o && o(c);
464
495
  });
465
- S(() => {
466
- let i = a.current;
496
+ F(() => {
497
+ let c = l.current;
467
498
  if (r)
468
499
  return;
469
- const d = t.current, c = yt(d);
500
+ const d = t.current, i = E(d);
470
501
  if (typeof PointerEvent < "u") {
471
- let p = (m) => {
472
- i.isPointerDown && K(m, t) && s(m), i.isPointerDown = !1;
502
+ let f = (m) => {
503
+ c.isPointerDown && j(m, t) && s(m), c.isPointerDown = !1;
473
504
  };
474
- return c.addEventListener("pointerdown", l, !0), c.addEventListener("pointerup", p, !0), () => {
475
- c.removeEventListener("pointerdown", l, !0), c.removeEventListener("pointerup", p, !0);
505
+ return i.addEventListener("pointerdown", a, !0), i.addEventListener("pointerup", f, !0), () => {
506
+ i.removeEventListener("pointerdown", a, !0), i.removeEventListener("pointerup", f, !0);
476
507
  };
477
508
  } else {
478
- let p = (g) => {
479
- i.ignoreEmulatedMouseEvents ? i.ignoreEmulatedMouseEvents = !1 : i.isPointerDown && K(g, t) && s(g), i.isPointerDown = !1;
509
+ let f = (g) => {
510
+ c.ignoreEmulatedMouseEvents ? c.ignoreEmulatedMouseEvents = !1 : c.isPointerDown && j(g, t) && s(g), c.isPointerDown = !1;
480
511
  }, m = (g) => {
481
- i.ignoreEmulatedMouseEvents = !0, i.isPointerDown && K(g, t) && s(g), i.isPointerDown = !1;
512
+ c.ignoreEmulatedMouseEvents = !0, c.isPointerDown && j(g, t) && s(g), c.isPointerDown = !1;
482
513
  };
483
- return c.addEventListener("mousedown", l, !0), c.addEventListener("mouseup", p, !0), c.addEventListener("touchstart", l, !0), c.addEventListener("touchend", m, !0), () => {
484
- c.removeEventListener("mousedown", l, !0), c.removeEventListener("mouseup", p, !0), c.removeEventListener("touchstart", l, !0), c.removeEventListener("touchend", m, !0);
514
+ return i.addEventListener("mousedown", a, !0), i.addEventListener("mouseup", f, !0), i.addEventListener("touchstart", a, !0), i.addEventListener("touchend", m, !0), () => {
515
+ i.removeEventListener("mousedown", a, !0), i.removeEventListener("mouseup", f, !0), i.removeEventListener("touchstart", a, !0), i.removeEventListener("touchend", m, !0);
485
516
  };
486
517
  }
487
518
  }, [
488
519
  t,
489
520
  r,
490
- l,
521
+ a,
491
522
  s
492
523
  ]);
493
524
  }
494
- function K(e, t) {
525
+ function j(e, t) {
495
526
  if (e.button > 0)
496
527
  return !1;
497
528
  if (e.target) {
@@ -501,50 +532,52 @@ function K(e, t) {
501
532
  }
502
533
  return t.current && !t.current.contains(e.target);
503
534
  }
504
- function de(e) {
505
- if (Gt() === "virtual") {
506
- let t = document.activeElement;
507
- It(() => {
508
- document.activeElement === t && document.contains(e) && we(e);
535
+ function fe(e) {
536
+ const t = E(e);
537
+ if (Yt() === "virtual") {
538
+ let o = t.activeElement;
539
+ Vt(() => {
540
+ t.activeElement === o && e.isConnected && Pe(e);
509
541
  });
510
542
  } else
511
- we(e);
543
+ Pe(e);
512
544
  }
513
- function Jt(e) {
514
- if (!(e instanceof HTMLElement) && !(e instanceof SVGElement))
545
+ function eo(e) {
546
+ const t = Y(e);
547
+ if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement))
515
548
  return !1;
516
- let { display: t, visibility: o } = e.style, r = t !== "none" && o !== "hidden" && o !== "collapse";
517
- if (r) {
518
- const { getComputedStyle: n } = e.ownerDocument.defaultView;
519
- let { display: a, visibility: l } = n(e);
520
- r = a !== "none" && l !== "hidden" && l !== "collapse";
549
+ let { display: o, visibility: r } = e.style, n = o !== "none" && r !== "hidden" && r !== "collapse";
550
+ if (n) {
551
+ const { getComputedStyle: l } = e.ownerDocument.defaultView;
552
+ let { display: a, visibility: s } = l(e);
553
+ n = a !== "none" && s !== "hidden" && s !== "collapse";
521
554
  }
522
- return r;
555
+ return n;
523
556
  }
524
- function Qt(e, t) {
557
+ function to(e, t) {
525
558
  return !e.hasAttribute("hidden") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
526
559
  }
527
- function ze(e, t) {
528
- return e.nodeName !== "#comment" && Jt(e) && Qt(e, t) && (!e.parentElement || ze(e.parentElement, e));
560
+ function je(e, t) {
561
+ return e.nodeName !== "#comment" && eo(e) && to(e, t) && (!e.parentElement || je(e.parentElement, e));
529
562
  }
530
- const Te = /* @__PURE__ */ h.createContext(null);
563
+ const Se = /* @__PURE__ */ h.createContext(null);
531
564
  let v = null;
532
- function Zt(e) {
533
- let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, a = M(null), l = M(null), s = M([]), { parentNode: i } = q(Te) || {}, d = W(() => new ue({
565
+ function oo(e) {
566
+ let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, l = y(null), a = y(null), s = y([]), { parentNode: c } = V(Se) || {}, d = z(() => new pe({
534
567
  scopeRef: s
535
568
  }), [
536
569
  s
537
570
  ]);
538
571
  w(() => {
539
- let m = i || $.root;
540
- if ($.getTreeNode(m.scopeRef) && v && !X(v, m.scopeRef)) {
572
+ let m = c || $.root;
573
+ if ($.getTreeNode(m.scopeRef) && v && !ee(v, m.scopeRef)) {
541
574
  let g = $.getTreeNode(v);
542
575
  g && (m = g);
543
576
  }
544
577
  m.addChild(d), $.addNode(d);
545
578
  }, [
546
579
  d,
547
- i
580
+ c
548
581
  ]), w(() => {
549
582
  let m = $.getTreeNode(s);
550
583
  m && (m.contain = !!o);
@@ -552,88 +585,89 @@ function Zt(e) {
552
585
  o
553
586
  ]), w(() => {
554
587
  var m;
555
- let g = (m = a.current) === null || m === void 0 ? void 0 : m.nextSibling, f = [];
556
- for (; g && g !== l.current; )
557
- f.push(g), g = g.nextSibling;
558
- s.current = f;
588
+ let g = (m = l.current) === null || m === void 0 ? void 0 : m.nextSibling, p = [];
589
+ for (; g && g !== a.current; )
590
+ p.push(g), g = g.nextSibling;
591
+ s.current = p;
559
592
  }, [
560
593
  t
561
- ]), lo(s, r, o), ro(s, o), so(s, r, o), ao(s, n), S(() => {
562
- let m = document.activeElement, g = null;
563
- if (E(m, s.current)) {
564
- for (let f of $.traverse())
565
- f.scopeRef && E(m, f.scopeRef.current) && (g = f);
594
+ ]), uo(s, r, o), lo(s, o), mo(s, r, o), so(s, n), F(() => {
595
+ const m = E(s.current ? s.current[0] : void 0).activeElement;
596
+ let g = null;
597
+ if (M(m, s.current)) {
598
+ for (let p of $.traverse())
599
+ p.scopeRef && M(m, p.scopeRef.current) && (g = p);
566
600
  g === $.getTreeNode(s) && (v = g.scopeRef);
567
601
  }
568
602
  }, [
569
603
  s
570
604
  ]), w(() => () => {
571
- var m, g, f;
572
- let P = (f = (g = $.getTreeNode(s)) === null || g === void 0 || (m = g.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && f !== void 0 ? f : null;
573
- (s === v || X(s, v)) && (!P || $.getTreeNode(P)) && (v = P), $.removeTreeNode(s);
605
+ var m, g, p;
606
+ let x = (p = (g = $.getTreeNode(s)) === null || g === void 0 || (m = g.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && p !== void 0 ? p : null;
607
+ (s === v || ee(s, v)) && (!x || $.getTreeNode(x)) && (v = x), $.removeTreeNode(s);
574
608
  }, [
575
609
  s
576
610
  ]);
577
- let c = W(() => eo(s), []), p = W(() => ({
578
- focusManager: c,
611
+ let i = z(() => ro(s), []), f = z(() => ({
612
+ focusManager: i,
579
613
  parentNode: d
580
614
  }), [
581
615
  d,
582
- c
616
+ i
583
617
  ]);
584
- return /* @__PURE__ */ h.createElement(Te.Provider, {
585
- value: p
618
+ return /* @__PURE__ */ h.createElement(Se.Provider, {
619
+ value: f
586
620
  }, /* @__PURE__ */ h.createElement("span", {
587
621
  "data-focus-scope-start": !0,
588
622
  hidden: !0,
589
- ref: a
623
+ ref: l
590
624
  }), t, /* @__PURE__ */ h.createElement("span", {
591
625
  "data-focus-scope-end": !0,
592
626
  hidden: !0,
593
- ref: l
627
+ ref: a
594
628
  }));
595
629
  }
596
- function eo(e) {
630
+ function ro(e) {
597
631
  return {
598
632
  focusNext(t = {}) {
599
- let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, s = r || document.activeElement, i = o[0].previousElementSibling, d = L(o), c = F(d, {
633
+ let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, s = r || E(o[0]).activeElement, c = o[0].previousElementSibling, d = C(o), i = B(d, {
600
634
  tabbable: n,
601
- accept: l
635
+ accept: a
602
636
  }, o);
603
- c.currentNode = E(s, o) ? s : i;
604
- let p = c.nextNode();
605
- return !p && a && (c.currentNode = i, p = c.nextNode()), p && x(p, !0), p;
637
+ i.currentNode = M(s, o) ? s : c;
638
+ let f = i.nextNode();
639
+ return !f && l && (i.currentNode = c, f = i.nextNode()), f && L(f, !0), f;
606
640
  },
607
641
  focusPrevious(t = {}) {
608
- let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, s = r || document.activeElement, i = o[o.length - 1].nextElementSibling, d = L(o), c = F(d, {
642
+ let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, s = r || E(o[0]).activeElement, c = o[o.length - 1].nextElementSibling, d = C(o), i = B(d, {
609
643
  tabbable: n,
610
- accept: l
644
+ accept: a
611
645
  }, o);
612
- c.currentNode = E(s, o) ? s : i;
613
- let p = c.previousNode();
614
- return !p && a && (c.currentNode = i, p = c.previousNode()), p && x(p, !0), p;
646
+ i.currentNode = M(s, o) ? s : c;
647
+ let f = i.previousNode();
648
+ return !f && l && (i.currentNode = c, f = i.previousNode()), f && L(f, !0), f;
615
649
  },
616
650
  focusFirst(t = {}) {
617
- let o = e.current, { tabbable: r, accept: n } = t, a = L(o), l = F(a, {
651
+ let o = e.current, { tabbable: r, accept: n } = t, l = C(o), a = B(l, {
618
652
  tabbable: r,
619
653
  accept: n
620
654
  }, o);
621
- l.currentNode = o[0].previousElementSibling;
622
- let s = l.nextNode();
623
- return s && x(s, !0), s;
655
+ a.currentNode = o[0].previousElementSibling;
656
+ let s = a.nextNode();
657
+ return s && L(s, !0), s;
624
658
  },
625
659
  focusLast(t = {}) {
626
- let o = e.current, { tabbable: r, accept: n } = t, a = L(o), l = F(a, {
660
+ let o = e.current, { tabbable: r, accept: n } = t, l = C(o), a = B(l, {
627
661
  tabbable: r,
628
662
  accept: n
629
663
  }, o);
630
- l.currentNode = o[o.length - 1].nextElementSibling;
631
- let s = l.previousNode();
632
- return s && x(s, !0), s;
664
+ a.currentNode = o[o.length - 1].nextElementSibling;
665
+ let s = a.previousNode();
666
+ return s && L(s, !0), s;
633
667
  }
634
668
  };
635
669
  }
636
- const pe = [
670
+ const ve = [
637
671
  "input:not([disabled]):not([type=hidden])",
638
672
  "select:not([disabled])",
639
673
  "textarea:not([disabled])",
@@ -647,13 +681,13 @@ const pe = [
647
681
  "audio[controls]",
648
682
  "video[controls]",
649
683
  "[contenteditable]"
650
- ], to = pe.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
651
- pe.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
652
- const oo = pe.join(':not([hidden]):not([tabindex="-1"]),');
653
- function L(e) {
684
+ ], no = ve.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
685
+ ve.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
686
+ const ao = ve.join(':not([hidden]):not([tabindex="-1"]),');
687
+ function C(e) {
654
688
  return e[0].parentElement;
655
689
  }
656
- function A(e) {
690
+ function I(e) {
657
691
  let t = $.getTreeNode(v);
658
692
  for (; t && t.scopeRef !== e; ) {
659
693
  if (t.contain)
@@ -662,42 +696,43 @@ function A(e) {
662
696
  }
663
697
  return !0;
664
698
  }
665
- function ro(e, t) {
666
- let o = M(), r = M();
699
+ function lo(e, t) {
700
+ let o = y(), r = y();
667
701
  w(() => {
668
702
  let n = e.current;
669
703
  if (!t) {
670
704
  r.current && (cancelAnimationFrame(r.current), r.current = void 0);
671
705
  return;
672
706
  }
673
- let a = (i) => {
674
- if (i.key !== "Tab" || i.altKey || i.ctrlKey || i.metaKey || !A(e))
707
+ const l = E(n ? n[0] : void 0);
708
+ let a = (d) => {
709
+ if (d.key !== "Tab" || d.altKey || d.ctrlKey || d.metaKey || !I(e))
675
710
  return;
676
- let d = document.activeElement, c = e.current;
677
- if (!c || !E(d, c))
711
+ let i = l.activeElement, f = e.current;
712
+ if (!f || !M(i, f))
678
713
  return;
679
- let p = L(c), m = F(p, {
714
+ let m = C(f), g = B(m, {
680
715
  tabbable: !0
681
- }, c);
682
- if (!d)
716
+ }, f);
717
+ if (!i)
683
718
  return;
684
- m.currentNode = d;
685
- let g = i.shiftKey ? m.previousNode() : m.nextNode();
686
- g || (m.currentNode = i.shiftKey ? c[c.length - 1].nextElementSibling : c[0].previousElementSibling, g = i.shiftKey ? m.previousNode() : m.nextNode()), i.preventDefault(), g && x(g, !0);
687
- }, l = (i) => {
688
- (!v || X(v, e)) && E(i.target, e.current) ? (v = e, o.current = i.target) : A(e) && !Y(i.target, e) ? o.current ? o.current.focus() : v && v.current && J(v.current) : A(e) && (o.current = i.target);
689
- }, s = (i) => {
719
+ g.currentNode = i;
720
+ let p = d.shiftKey ? g.previousNode() : g.nextNode();
721
+ p || (g.currentNode = d.shiftKey ? f[f.length - 1].nextElementSibling : f[0].previousElementSibling, p = d.shiftKey ? g.previousNode() : g.nextNode()), d.preventDefault(), p && L(p, !0);
722
+ }, s = (d) => {
723
+ (!v || ee(v, e)) && M(d.target, e.current) ? (v = e, o.current = d.target) : I(e) && !Z(d.target, e) ? o.current ? o.current.focus() : v && v.current && te(v.current) : I(e) && (o.current = d.target);
724
+ }, c = (d) => {
690
725
  r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
691
- if (document.activeElement && A(e) && !Y(document.activeElement, e))
692
- if (v = e, document.body.contains(i.target)) {
693
- var d;
694
- o.current = i.target, (d = o.current) === null || d === void 0 || d.focus();
726
+ if (l.activeElement && I(e) && !Z(l.activeElement, e))
727
+ if (v = e, l.body.contains(d.target)) {
728
+ var i;
729
+ o.current = d.target, (i = o.current) === null || i === void 0 || i.focus();
695
730
  } else
696
- v.current && J(v.current);
731
+ v.current && te(v.current);
697
732
  });
698
733
  };
699
- return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", l, !1), n == null || n.forEach((i) => i.addEventListener("focusin", l, !1)), n == null || n.forEach((i) => i.addEventListener("focusout", s, !1)), () => {
700
- document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", l, !1), n == null || n.forEach((i) => i.removeEventListener("focusin", l, !1)), n == null || n.forEach((i) => i.removeEventListener("focusout", s, !1));
734
+ return l.addEventListener("keydown", a, !1), l.addEventListener("focusin", s, !1), n == null || n.forEach((d) => d.addEventListener("focusin", s, !1)), n == null || n.forEach((d) => d.addEventListener("focusout", c, !1)), () => {
735
+ l.removeEventListener("keydown", a, !1), l.removeEventListener("focusin", s, !1), n == null || n.forEach((d) => d.removeEventListener("focusin", s, !1)), n == null || n.forEach((d) => d.removeEventListener("focusout", c, !1));
701
736
  };
702
737
  }, [
703
738
  e,
@@ -708,24 +743,24 @@ function ro(e, t) {
708
743
  r
709
744
  ]);
710
745
  }
711
- function qe(e) {
712
- return Y(e);
746
+ function Ue(e) {
747
+ return Z(e);
713
748
  }
714
- function E(e, t) {
749
+ function M(e, t) {
715
750
  return !e || !t ? !1 : t.some((o) => o.contains(e));
716
751
  }
717
- function Y(e, t = null) {
752
+ function Z(e, t = null) {
718
753
  if (e instanceof Element && e.closest("[data-react-aria-top-layer]"))
719
754
  return !0;
720
755
  for (let { scopeRef: o } of $.traverse($.getTreeNode(t)))
721
- if (o && E(e, o.current))
756
+ if (o && M(e, o.current))
722
757
  return !0;
723
758
  return !1;
724
759
  }
725
- function no(e) {
726
- return Y(e, v);
760
+ function io(e) {
761
+ return Z(e, v);
727
762
  }
728
- function X(e, t) {
763
+ function ee(e, t) {
729
764
  var o;
730
765
  let r = (o = $.getTreeNode(t)) === null || o === void 0 ? void 0 : o.parent;
731
766
  for (; r; ) {
@@ -735,10 +770,10 @@ function X(e, t) {
735
770
  }
736
771
  return !1;
737
772
  }
738
- function x(e, t = !1) {
773
+ function L(e, t = !1) {
739
774
  if (e != null && !t)
740
775
  try {
741
- de(e);
776
+ fe(e);
742
777
  } catch {
743
778
  }
744
779
  else if (e != null)
@@ -747,34 +782,41 @@ function x(e, t = !1) {
747
782
  } catch {
748
783
  }
749
784
  }
750
- function J(e, t = !0) {
751
- let o = e[0].previousElementSibling, r = L(e), n = F(r, {
785
+ function te(e, t = !0) {
786
+ let o = e[0].previousElementSibling, r = C(e), n = B(r, {
752
787
  tabbable: t
753
788
  }, e);
754
789
  n.currentNode = o;
755
- let a = n.nextNode();
756
- t && !a && (r = L(e), n = F(r, {
790
+ let l = n.nextNode();
791
+ t && !l && (r = C(e), n = B(r, {
757
792
  tabbable: !1
758
- }, e), n.currentNode = o, a = n.nextNode()), x(a);
793
+ }, e), n.currentNode = o, l = n.nextNode()), L(l);
759
794
  }
760
- function ao(e, t) {
795
+ function so(e, t) {
761
796
  const o = h.useRef(t);
762
- S(() => {
763
- o.current && (v = e, !E(document.activeElement, v.current) && e.current && J(e.current)), o.current = !1;
797
+ F(() => {
798
+ if (o.current) {
799
+ v = e;
800
+ const r = E(e.current ? e.current[0] : void 0);
801
+ !M(r.activeElement, v.current) && e.current && te(e.current);
802
+ }
803
+ o.current = !1;
764
804
  }, [
765
805
  e
766
806
  ]);
767
807
  }
768
- function lo(e, t, o) {
808
+ function uo(e, t, o) {
769
809
  w(() => {
770
810
  if (t || o)
771
811
  return;
772
- let r = e.current, n = (a) => {
773
- let l = a.target;
774
- E(l, e.current) ? v = e : qe(l) || (v = null);
812
+ let r = e.current;
813
+ const n = E(r ? r[0] : void 0);
814
+ let l = (a) => {
815
+ let s = a.target;
816
+ M(s, e.current) ? v = e : Ue(s) || (v = null);
775
817
  };
776
- return document.addEventListener("focusin", n, !1), r == null || r.forEach((a) => a.addEventListener("focusin", n, !1)), () => {
777
- document.removeEventListener("focusin", n, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", n, !1));
818
+ return n.addEventListener("focusin", l, !1), r == null || r.forEach((a) => a.addEventListener("focusin", l, !1)), () => {
819
+ n.removeEventListener("focusin", l, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", l, !1));
778
820
  };
779
821
  }, [
780
822
  e,
@@ -782,7 +824,7 @@ function lo(e, t, o) {
782
824
  o
783
825
  ]);
784
826
  }
785
- function io(e) {
827
+ function co(e) {
786
828
  let t = $.getTreeNode(v);
787
829
  for (; t && t.scopeRef !== e; ) {
788
830
  if (t.nodeToRestore)
@@ -791,82 +833,85 @@ function io(e) {
791
833
  }
792
834
  return (t == null ? void 0 : t.scopeRef) === e;
793
835
  }
794
- function so(e, t, o) {
795
- const r = M(typeof document < "u" ? document.activeElement : null);
836
+ function mo(e, t, o) {
837
+ const r = y(typeof document < "u" ? E(e.current ? e.current[0] : void 0).activeElement : null);
796
838
  w(() => {
797
839
  let n = e.current;
840
+ const l = E(n ? n[0] : void 0);
798
841
  if (!t || o)
799
842
  return;
800
843
  let a = () => {
801
- (!v || X(v, e)) && E(document.activeElement, e.current) && (v = e);
844
+ (!v || ee(v, e)) && M(l.activeElement, e.current) && (v = e);
802
845
  };
803
- return document.addEventListener("focusin", a, !1), n == null || n.forEach((l) => l.addEventListener("focusin", a, !1)), () => {
804
- document.removeEventListener("focusin", a, !1), n == null || n.forEach((l) => l.removeEventListener("focusin", a, !1));
846
+ return l.addEventListener("focusin", a, !1), n == null || n.forEach((s) => s.addEventListener("focusin", a, !1)), () => {
847
+ l.removeEventListener("focusin", a, !1), n == null || n.forEach((s) => s.removeEventListener("focusin", a, !1));
805
848
  };
806
849
  }, [
807
850
  e,
808
851
  o
809
852
  ]), w(() => {
853
+ const n = E(e.current ? e.current[0] : void 0);
810
854
  if (!t)
811
855
  return;
812
- let n = (a) => {
813
- if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !A(e))
856
+ let l = (a) => {
857
+ if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !I(e))
814
858
  return;
815
- let l = document.activeElement;
816
- if (!E(l, e.current))
859
+ let s = n.activeElement;
860
+ if (!M(s, e.current))
817
861
  return;
818
- let s = $.getTreeNode(e);
819
- if (!s)
862
+ let c = $.getTreeNode(e);
863
+ if (!c)
820
864
  return;
821
- let i = s.nodeToRestore, d = F(document.body, {
865
+ let d = c.nodeToRestore, i = B(n.body, {
822
866
  tabbable: !0
823
867
  });
824
- d.currentNode = l;
825
- let c = a.shiftKey ? d.previousNode() : d.nextNode();
826
- if ((!i || !document.body.contains(i) || i === document.body) && (i = void 0, s.nodeToRestore = void 0), (!c || !E(c, e.current)) && i) {
827
- d.currentNode = i;
868
+ i.currentNode = s;
869
+ let f = a.shiftKey ? i.previousNode() : i.nextNode();
870
+ if ((!d || !n.body.contains(d) || d === n.body) && (d = void 0, c.nodeToRestore = void 0), (!f || !M(f, e.current)) && d) {
871
+ i.currentNode = d;
828
872
  do
829
- c = a.shiftKey ? d.previousNode() : d.nextNode();
830
- while (E(c, e.current));
831
- a.preventDefault(), a.stopPropagation(), c ? x(c, !0) : qe(i) ? x(i, !0) : l.blur();
873
+ f = a.shiftKey ? i.previousNode() : i.nextNode();
874
+ while (M(f, e.current));
875
+ a.preventDefault(), a.stopPropagation(), f ? L(f, !0) : Ue(d) ? L(d, !0) : s.blur();
832
876
  }
833
877
  };
834
- return o || document.addEventListener("keydown", n, !0), () => {
835
- o || document.removeEventListener("keydown", n, !0);
878
+ return o || n.addEventListener("keydown", l, !0), () => {
879
+ o || n.removeEventListener("keydown", l, !0);
836
880
  };
837
881
  }, [
838
882
  e,
839
883
  t,
840
884
  o
841
885
  ]), w(() => {
886
+ const n = E(e.current ? e.current[0] : void 0);
842
887
  if (!t)
843
888
  return;
844
- let n = $.getTreeNode(e);
845
- if (!!n) {
889
+ let l = $.getTreeNode(e);
890
+ if (!!l) {
846
891
  var a;
847
- return n.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
848
- let l = $.getTreeNode(e);
849
- if (!l)
892
+ return l.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
893
+ let s = $.getTreeNode(e);
894
+ if (!s)
850
895
  return;
851
- let s = l.nodeToRestore;
852
- if (t && s && (E(document.activeElement, e.current) || document.activeElement === document.body && io(e))) {
853
- let i = $.clone();
896
+ let c = s.nodeToRestore;
897
+ if (t && c && (M(n.activeElement, e.current) || n.activeElement === n.body && co(e))) {
898
+ let d = $.clone();
854
899
  requestAnimationFrame(() => {
855
- if (document.activeElement === document.body) {
856
- let d = i.getTreeNode(e);
857
- for (; d; ) {
858
- if (d.nodeToRestore && document.body.contains(d.nodeToRestore)) {
859
- x(d.nodeToRestore);
900
+ if (n.activeElement === n.body) {
901
+ let i = d.getTreeNode(e);
902
+ for (; i; ) {
903
+ if (i.nodeToRestore && i.nodeToRestore.isConnected) {
904
+ L(i.nodeToRestore);
860
905
  return;
861
906
  }
862
- d = d.parent;
907
+ i = i.parent;
863
908
  }
864
- for (d = i.getTreeNode(e); d; ) {
865
- if (d.scopeRef && d.scopeRef.current && $.getTreeNode(d.scopeRef)) {
866
- J(d.scopeRef.current, !0);
909
+ for (i = d.getTreeNode(e); i; ) {
910
+ if (i.scopeRef && i.scopeRef.current && $.getTreeNode(i.scopeRef)) {
911
+ te(i.scopeRef.current, !0);
867
912
  return;
868
913
  }
869
- d = d.parent;
914
+ i = i.parent;
870
915
  }
871
916
  }
872
917
  });
@@ -878,16 +923,16 @@ function so(e, t, o) {
878
923
  t
879
924
  ]);
880
925
  }
881
- function F(e, t, o) {
882
- let r = t != null && t.tabbable ? oo : to, n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
883
- acceptNode(a) {
884
- var l;
885
- return !(t == null || (l = t.from) === null || l === void 0) && l.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) && ze(a) && (!o || E(a, o)) && (!(t != null && t.accept) || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
926
+ function B(e, t, o) {
927
+ let r = t != null && t.tabbable ? ao : no, n = E(e).createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
928
+ acceptNode(l) {
929
+ var a;
930
+ return !(t == null || (a = t.from) === null || a === void 0) && a.contains(l) ? NodeFilter.FILTER_REJECT : l.matches(r) && je(l) && (!o || M(l, o)) && (!(t != null && t.accept) || t.accept(l)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
886
931
  }
887
932
  });
888
933
  return t != null && t.from && (n.currentNode = t.from), n;
889
934
  }
890
- class fe {
935
+ class $e {
891
936
  get size() {
892
937
  return this.fastMap.size;
893
938
  }
@@ -898,10 +943,10 @@ class fe {
898
943
  let n = this.fastMap.get(o != null ? o : null);
899
944
  if (!n)
900
945
  return;
901
- let a = new ue({
946
+ let l = new pe({
902
947
  scopeRef: t
903
948
  });
904
- n.addChild(a), a.parent = n, this.fastMap.set(t, a), r && (a.nodeToRestore = r);
949
+ n.addChild(l), l.parent = n, this.fastMap.set(t, l), r && (l.nodeToRestore = r);
905
950
  }
906
951
  addNode(t) {
907
952
  this.fastMap.set(t.scopeRef, t);
@@ -913,10 +958,10 @@ class fe {
913
958
  if (!o)
914
959
  return;
915
960
  let r = o.parent;
916
- for (let a of this.traverse())
917
- a !== o && o.nodeToRestore && a.nodeToRestore && o.scopeRef && o.scopeRef.current && E(a.nodeToRestore, o.scopeRef.current) && (a.nodeToRestore = o.nodeToRestore);
961
+ for (let l of this.traverse())
962
+ l !== o && o.nodeToRestore && l.nodeToRestore && o.scopeRef && o.scopeRef.current && M(l.nodeToRestore, o.scopeRef.current) && (l.nodeToRestore = o.nodeToRestore);
918
963
  let n = o.children;
919
- r && (r.removeChild(o), n.size > 0 && n.forEach((a) => r && r.addChild(a))), this.fastMap.delete(o.scopeRef);
964
+ r && (r.removeChild(o), n.size > 0 && n.forEach((l) => r && r.addChild(l))), this.fastMap.delete(o.scopeRef);
920
965
  }
921
966
  *traverse(t = this.root) {
922
967
  if (t.scopeRef != null && (yield t), t.children.size > 0)
@@ -925,19 +970,19 @@ class fe {
925
970
  }
926
971
  clone() {
927
972
  var t;
928
- let o = new fe();
973
+ let o = new $e();
929
974
  var r;
930
975
  for (let n of this.traverse())
931
976
  o.addTreeNode(n.scopeRef, (r = (t = n.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, n.nodeToRestore);
932
977
  return o;
933
978
  }
934
979
  constructor() {
935
- this.fastMap = /* @__PURE__ */ new Map(), this.root = new ue({
980
+ this.fastMap = /* @__PURE__ */ new Map(), this.root = new pe({
936
981
  scopeRef: null
937
982
  }), this.fastMap.set(null, this.root);
938
983
  }
939
984
  }
940
- class ue {
985
+ class pe {
941
986
  addChild(t) {
942
987
  this.children.add(t), t.parent = this;
943
988
  }
@@ -948,42 +993,42 @@ class ue {
948
993
  this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
949
994
  }
950
995
  }
951
- let $ = new fe();
952
- const uo = /* @__PURE__ */ new WeakMap(), T = [];
953
- function co(e, t) {
954
- let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: a = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: s } = e;
955
- S(() => (n && T.push(t), () => {
956
- let f = T.indexOf(t);
957
- f >= 0 && T.splice(f, 1);
996
+ let $ = new $e();
997
+ const fo = /* @__PURE__ */ new WeakMap(), S = [];
998
+ function po(e, t) {
999
+ let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: l = !1, isKeyboardDismissDisabled: a = !1, shouldCloseOnInteractOutside: s } = e;
1000
+ F(() => (n && S.push(t), () => {
1001
+ let p = S.indexOf(t);
1002
+ p >= 0 && S.splice(p, 1);
958
1003
  }), [
959
1004
  n,
960
1005
  t
961
1006
  ]);
962
- let i = () => {
963
- T[T.length - 1] === t && o && o();
964
- }, d = (f) => {
965
- (!s || s(f.target)) && T[T.length - 1] === t && (f.stopPropagation(), f.preventDefault());
966
- }, c = (f) => {
967
- (!s || s(f.target)) && (T[T.length - 1] === t && (f.stopPropagation(), f.preventDefault()), i());
968
- }, p = (f) => {
969
- f.key === "Escape" && !l && (f.stopPropagation(), f.preventDefault(), i());
1007
+ let c = () => {
1008
+ S[S.length - 1] === t && o && o();
1009
+ }, d = (p) => {
1010
+ (!s || s(p.target)) && S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault());
1011
+ }, i = (p) => {
1012
+ (!s || s(p.target)) && (S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault()), c());
1013
+ }, f = (p) => {
1014
+ p.key === "Escape" && !a && (p.stopPropagation(), p.preventDefault(), c());
970
1015
  };
971
- Xt({
1016
+ Zt({
972
1017
  ref: t,
973
- onInteractOutside: a && n ? c : null,
1018
+ onInteractOutside: l && n ? i : null,
974
1019
  onInteractOutsideStart: d
975
1020
  });
976
- let { focusWithinProps: m } = Yt({
1021
+ let { focusWithinProps: m } = Qt({
977
1022
  isDisabled: !r,
978
- onBlurWithin: (f) => {
979
- !f.relatedTarget || no(f.relatedTarget) || (!s || s(f.relatedTarget)) && o();
1023
+ onBlurWithin: (p) => {
1024
+ !p.relatedTarget || io(p.relatedTarget) || (!s || s(p.relatedTarget)) && o();
980
1025
  }
981
- }), g = (f) => {
982
- f.target === f.currentTarget && f.preventDefault();
1026
+ }), g = (p) => {
1027
+ p.target === p.currentTarget && p.preventDefault();
983
1028
  };
984
1029
  return {
985
1030
  overlayProps: {
986
- onKeyDown: p,
1031
+ onKeyDown: f,
987
1032
  ...m
988
1033
  },
989
1034
  underlayProps: {
@@ -991,27 +1036,27 @@ function co(e, t) {
991
1036
  }
992
1037
  };
993
1038
  }
994
- function mo(e, t, o) {
1039
+ function go(e, t, o) {
995
1040
  let { type: r } = e, { isOpen: n } = t;
996
- S(() => {
997
- o && o.current && uo.set(o.current, t.close);
1041
+ F(() => {
1042
+ o && o.current && fo.set(o.current, t.close);
998
1043
  });
999
- let a;
1000
- r === "menu" ? a = !0 : r === "listbox" && (a = "listbox");
1001
- let l = Ae();
1044
+ let l;
1045
+ r === "menu" ? l = !0 : r === "listbox" && (l = "listbox");
1046
+ let a = Ie();
1002
1047
  return {
1003
1048
  triggerProps: {
1004
- "aria-haspopup": a,
1049
+ "aria-haspopup": l,
1005
1050
  "aria-expanded": n,
1006
- "aria-controls": n ? l : null,
1051
+ "aria-controls": n ? a : null,
1007
1052
  onPress: t.toggle
1008
1053
  },
1009
1054
  overlayProps: {
1010
- id: l
1055
+ id: a
1011
1056
  }
1012
1057
  };
1013
1058
  }
1014
- const ne = typeof document < "u" && window.visualViewport, po = /* @__PURE__ */ new Set([
1059
+ const se = typeof document < "u" && window.visualViewport, bo = /* @__PURE__ */ new Set([
1015
1060
  "checkbox",
1016
1061
  "radio",
1017
1062
  "range",
@@ -1022,78 +1067,82 @@ const ne = typeof document < "u" && window.visualViewport, po = /* @__PURE__ */
1022
1067
  "submit",
1023
1068
  "reset"
1024
1069
  ]);
1025
- let _ = 0, ae;
1026
- function fo(e = {}) {
1070
+ let U = 0, de;
1071
+ function vo(e = {}) {
1027
1072
  let { isDisabled: t } = e;
1028
1073
  w(() => {
1029
1074
  if (!t)
1030
- return _++, _ === 1 && (At() ? ae = bo() : ae = go()), () => {
1031
- _--, _ === 0 && ae();
1075
+ return U++, U === 1 && (Rt() ? de = ho() : de = $o()), () => {
1076
+ U--, U === 0 && de();
1032
1077
  };
1033
1078
  }, [
1034
1079
  t
1035
1080
  ]);
1036
1081
  }
1037
- function go() {
1038
- return G(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"));
1082
+ function $o() {
1083
+ return J(D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"));
1039
1084
  }
1040
- function bo() {
1041
- let e, t = 0, o = (p) => {
1042
- e = Ie(p.target), !(e === document.documentElement && e === document.body) && (t = p.changedTouches[0].pageY);
1043
- }, r = (p) => {
1085
+ function ho() {
1086
+ let e, t, o = (d) => {
1087
+ e = qe(d.target, !0), !(e === document.documentElement && e === document.body) && e instanceof HTMLElement && window.getComputedStyle(e).overscrollBehavior === "auto" && (t = D(e, "overscrollBehavior", "contain"));
1088
+ }, r = (d) => {
1044
1089
  if (!e || e === document.documentElement || e === document.body) {
1045
- p.preventDefault();
1090
+ d.preventDefault();
1046
1091
  return;
1047
1092
  }
1048
- let m = p.changedTouches[0].pageY, g = e.scrollTop, f = e.scrollHeight - e.clientHeight;
1049
- f !== 0 && ((g <= 0 && m > t || g >= f && m < t) && p.preventDefault(), t = m);
1050
- }, n = (p) => {
1051
- let m = p.target;
1052
- Se(m) && m !== document.activeElement && (p.preventDefault(), m.style.transform = "translateY(-2000px)", m.focus(), requestAnimationFrame(() => {
1053
- m.style.transform = "";
1054
- }));
1055
- }, a = (p) => {
1056
- let m = p.target;
1057
- Se(m) && (m.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
1058
- m.style.transform = "", ne && (ne.height < window.innerHeight ? requestAnimationFrame(() => {
1059
- xe(m);
1060
- }) : ne.addEventListener("resize", () => xe(m), {
1093
+ e.scrollHeight === e.clientHeight && e.scrollWidth === e.clientWidth && d.preventDefault();
1094
+ }, n = (d) => {
1095
+ let i = d.target;
1096
+ Fe(i) && i !== document.activeElement && (d.preventDefault(), s(), i.style.transform = "translateY(-2000px)", i.focus(), requestAnimationFrame(() => {
1097
+ i.style.transform = "";
1098
+ })), t && t();
1099
+ }, l = (d) => {
1100
+ let i = d.target;
1101
+ Fe(i) && (s(), i.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
1102
+ i.style.transform = "", se && (se.height < window.innerHeight ? requestAnimationFrame(() => {
1103
+ Le(i);
1104
+ }) : se.addEventListener("resize", () => Le(i), {
1061
1105
  once: !0
1062
1106
  }));
1063
1107
  }));
1064
- }, l = () => {
1065
- window.scrollTo(0, 0);
1066
- }, s = window.pageXOffset, i = window.pageYOffset, d = G(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"), I(document.body, "marginTop", `-${i}px`));
1067
- window.scrollTo(0, 0);
1068
- let c = G(O(document, "touchstart", o, {
1108
+ }, a = null, s = () => {
1109
+ if (a)
1110
+ return;
1111
+ let d = () => {
1112
+ window.scrollTo(0, 0);
1113
+ }, i = window.pageXOffset, f = window.pageYOffset;
1114
+ a = J(W(window, "scroll", d), D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"), D(document.body, "marginTop", `-${f}px`), () => {
1115
+ window.scrollTo(i, f);
1116
+ }), window.scrollTo(0, 0);
1117
+ }, c = J(W(document, "touchstart", o, {
1069
1118
  passive: !1,
1070
1119
  capture: !0
1071
- }), O(document, "touchmove", r, {
1120
+ }), W(document, "touchmove", r, {
1072
1121
  passive: !1,
1073
1122
  capture: !0
1074
- }), O(document, "touchend", n, {
1123
+ }), W(document, "touchend", n, {
1075
1124
  passive: !1,
1076
1125
  capture: !0
1077
- }), O(document, "focus", a, !0), O(window, "scroll", l));
1126
+ }), W(document, "focus", l, !0));
1078
1127
  return () => {
1079
- d(), c(), window.scrollTo(s, i);
1128
+ t == null || t(), a == null || a(), c();
1080
1129
  };
1081
1130
  }
1082
- function I(e, t, o) {
1131
+ function D(e, t, o) {
1083
1132
  let r = e.style[t];
1084
1133
  return e.style[t] = o, () => {
1085
1134
  e.style[t] = r;
1086
1135
  };
1087
1136
  }
1088
- function O(e, t, o, r) {
1137
+ function W(e, t, o, r) {
1089
1138
  return e.addEventListener(t, o, r), () => {
1090
1139
  e.removeEventListener(t, o, r);
1091
1140
  };
1092
1141
  }
1093
- function xe(e) {
1142
+ function Le(e) {
1094
1143
  let t = document.scrollingElement || document.documentElement;
1095
1144
  for (; e && e !== t; ) {
1096
- let o = Ie(e);
1145
+ let o = qe(e);
1097
1146
  if (o !== document.documentElement && o !== document.body && o !== e) {
1098
1147
  let r = o.getBoundingClientRect().top, n = e.getBoundingClientRect().top;
1099
1148
  n > r + e.clientHeight && (o.scrollTop += n - r);
@@ -1101,13 +1150,13 @@ function xe(e) {
1101
1150
  e = o.parentElement;
1102
1151
  }
1103
1152
  }
1104
- function Se(e) {
1105
- return e instanceof HTMLInputElement && !po.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1153
+ function Fe(e) {
1154
+ return e instanceof HTMLInputElement && !bo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1106
1155
  }
1107
- let D = /* @__PURE__ */ new WeakMap(), y = [];
1108
- function vo(e, t = document.body) {
1109
- let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (i) => {
1110
- for (let m of i.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1156
+ let A = /* @__PURE__ */ new WeakMap(), P = [];
1157
+ function wo(e, t = document.body) {
1158
+ let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (c) => {
1159
+ for (let m of c.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1111
1160
  o.add(m);
1112
1161
  let d = (m) => {
1113
1162
  if (o.has(m) || r.has(m.parentElement) && m.parentElement.getAttribute("role") !== "row")
@@ -1116,130 +1165,130 @@ function vo(e, t = document.body) {
1116
1165
  if (m.contains(g))
1117
1166
  return NodeFilter.FILTER_SKIP;
1118
1167
  return NodeFilter.FILTER_ACCEPT;
1119
- }, c = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
1168
+ }, i = document.createTreeWalker(c, NodeFilter.SHOW_ELEMENT, {
1120
1169
  acceptNode: d
1121
- }), p = d(i);
1122
- if (p === NodeFilter.FILTER_ACCEPT && a(i), p !== NodeFilter.FILTER_REJECT) {
1123
- let m = c.nextNode();
1170
+ }), f = d(c);
1171
+ if (f === NodeFilter.FILTER_ACCEPT && l(c), f !== NodeFilter.FILTER_REJECT) {
1172
+ let m = i.nextNode();
1124
1173
  for (; m != null; )
1125
- a(m), m = c.nextNode();
1174
+ l(m), m = i.nextNode();
1126
1175
  }
1127
- }, a = (i) => {
1176
+ }, l = (c) => {
1128
1177
  var d;
1129
- let c = (d = D.get(i)) !== null && d !== void 0 ? d : 0;
1130
- i.getAttribute("aria-hidden") === "true" && c === 0 || (c === 0 && i.setAttribute("aria-hidden", "true"), r.add(i), D.set(i, c + 1));
1178
+ let i = (d = A.get(c)) !== null && d !== void 0 ? d : 0;
1179
+ c.getAttribute("aria-hidden") === "true" && i === 0 || (i === 0 && c.setAttribute("aria-hidden", "true"), r.add(c), A.set(c, i + 1));
1131
1180
  };
1132
- y.length && y[y.length - 1].disconnect(), n(t);
1133
- let l = new MutationObserver((i) => {
1134
- for (let d of i)
1181
+ P.length && P[P.length - 1].disconnect(), n(t);
1182
+ let a = new MutationObserver((c) => {
1183
+ for (let d of c)
1135
1184
  if (!(d.type !== "childList" || d.addedNodes.length === 0) && ![
1136
1185
  ...o,
1137
1186
  ...r
1138
- ].some((c) => c.contains(d.target))) {
1139
- for (let c of d.removedNodes)
1140
- c instanceof Element && (o.delete(c), r.delete(c));
1141
- for (let c of d.addedNodes)
1142
- (c instanceof HTMLElement || c instanceof SVGElement) && (c.dataset.liveAnnouncer === "true" || c.dataset.reactAriaTopLayer === "true") ? o.add(c) : c instanceof Element && n(c);
1187
+ ].some((i) => i.contains(d.target))) {
1188
+ for (let i of d.removedNodes)
1189
+ i instanceof Element && (o.delete(i), r.delete(i));
1190
+ for (let i of d.addedNodes)
1191
+ (i instanceof HTMLElement || i instanceof SVGElement) && (i.dataset.liveAnnouncer === "true" || i.dataset.reactAriaTopLayer === "true") ? o.add(i) : i instanceof Element && n(i);
1143
1192
  }
1144
1193
  });
1145
- l.observe(t, {
1194
+ a.observe(t, {
1146
1195
  childList: !0,
1147
1196
  subtree: !0
1148
1197
  });
1149
1198
  let s = {
1150
1199
  observe() {
1151
- l.observe(t, {
1200
+ a.observe(t, {
1152
1201
  childList: !0,
1153
1202
  subtree: !0
1154
1203
  });
1155
1204
  },
1156
1205
  disconnect() {
1157
- l.disconnect();
1206
+ a.disconnect();
1158
1207
  }
1159
1208
  };
1160
- return y.push(s), () => {
1161
- l.disconnect();
1162
- for (let i of r) {
1163
- let d = D.get(i);
1164
- d === 1 ? (i.removeAttribute("aria-hidden"), D.delete(i)) : D.set(i, d - 1);
1209
+ return P.push(s), () => {
1210
+ a.disconnect();
1211
+ for (let c of r) {
1212
+ let d = A.get(c);
1213
+ d === 1 ? (c.removeAttribute("aria-hidden"), A.delete(c)) : A.set(c, d - 1);
1165
1214
  }
1166
- s === y[y.length - 1] ? (y.pop(), y.length && y[y.length - 1].observe()) : y.splice(y.indexOf(s), 1);
1215
+ s === P[P.length - 1] ? (P.pop(), P.length && P[P.length - 1].observe()) : P.splice(P.indexOf(s), 1);
1167
1216
  };
1168
1217
  }
1169
- const Ve = /* @__PURE__ */ h.createContext(null);
1170
- function $o(e) {
1171
- let t = Oe(), { portalContainer: o = t ? null : document.body, isExiting: r } = e, [n, a] = z(!1), l = W(() => ({
1218
+ const Ge = /* @__PURE__ */ h.createContext(null);
1219
+ function Eo(e) {
1220
+ let t = We(), { portalContainer: o = t ? null : document.body, isExiting: r } = e, [n, l] = H(!1), a = z(() => ({
1172
1221
  contain: n,
1173
- setContain: a
1222
+ setContain: l
1174
1223
  }), [
1175
1224
  n,
1176
- a
1225
+ l
1177
1226
  ]);
1178
1227
  if (!o)
1179
1228
  return null;
1180
1229
  let s = e.children;
1181
- return e.disableFocusManagement || (s = /* @__PURE__ */ h.createElement(Zt, {
1230
+ return e.disableFocusManagement || (s = /* @__PURE__ */ h.createElement(oo, {
1182
1231
  restoreFocus: !0,
1183
1232
  contain: n && !r
1184
- }, s)), s = /* @__PURE__ */ h.createElement(Ve.Provider, {
1185
- value: l
1186
- }, /* @__PURE__ */ h.createElement(zt, null, s)), /* @__PURE__ */ it.createPortal(s, o);
1233
+ }, s)), s = /* @__PURE__ */ h.createElement(Ge.Provider, {
1234
+ value: a
1235
+ }, /* @__PURE__ */ h.createElement(_t, null, s)), /* @__PURE__ */ ft.createPortal(s, o);
1187
1236
  }
1188
- function He() {
1189
- let e = q(Ve), t = e == null ? void 0 : e.setContain;
1237
+ function Xe() {
1238
+ let e = V(Ge), t = e == null ? void 0 : e.setContain;
1190
1239
  w(() => {
1191
1240
  t == null || t(!0);
1192
1241
  }, [
1193
1242
  t
1194
1243
  ]);
1195
1244
  }
1196
- function ho(e, t, o) {
1197
- let { overlayProps: r, underlayProps: n } = co({
1245
+ function Mo(e, t, o) {
1246
+ let { overlayProps: r, underlayProps: n } = po({
1198
1247
  ...e,
1199
1248
  isOpen: t.isOpen,
1200
1249
  onClose: t.close
1201
1250
  }, o);
1202
- return fo({
1251
+ return vo({
1203
1252
  isDisabled: !t.isOpen
1204
- }), He(), S(() => {
1253
+ }), Xe(), F(() => {
1205
1254
  if (t.isOpen)
1206
- return vo([
1255
+ return wo([
1207
1256
  o.current
1208
1257
  ]);
1209
1258
  }, [
1210
1259
  t.isOpen,
1211
1260
  o
1212
1261
  ]), {
1213
- modalProps: Pt(r),
1262
+ modalProps: Lt(r),
1214
1263
  underlayProps: n
1215
1264
  };
1216
1265
  }
1217
- function wo(e, t) {
1218
- let { role: o = "dialog" } = e, r = Mt();
1266
+ function yo(e, t) {
1267
+ let { role: o = "dialog" } = e, r = St();
1219
1268
  r = e["aria-label"] ? void 0 : r;
1220
- let n = M(!1);
1221
- return S(() => {
1269
+ let n = y(!1);
1270
+ return F(() => {
1222
1271
  if (t.current && !t.current.contains(document.activeElement)) {
1223
- de(t.current);
1224
- let a = setTimeout(() => {
1225
- document.activeElement === t.current && (n.current = !0, t.current.blur(), de(t.current), n.current = !1);
1272
+ fe(t.current);
1273
+ let l = setTimeout(() => {
1274
+ document.activeElement === t.current && (n.current = !0, t.current && (t.current.blur(), fe(t.current)), n.current = !1);
1226
1275
  }, 500);
1227
1276
  return () => {
1228
- clearTimeout(a);
1277
+ clearTimeout(l);
1229
1278
  };
1230
1279
  }
1231
1280
  }, [
1232
1281
  t
1233
- ]), He(), {
1282
+ ]), Xe(), {
1234
1283
  dialogProps: {
1235
- ...Ft(e, {
1284
+ ...Ot(e, {
1236
1285
  labelable: !0
1237
1286
  }),
1238
1287
  role: o,
1239
1288
  tabIndex: -1,
1240
1289
  "aria-labelledby": e["aria-labelledby"] || r,
1241
- onBlur: (a) => {
1242
- n.current && a.stopPropagation();
1290
+ onBlur: (l) => {
1291
+ n.current && l.stopPropagation();
1243
1292
  }
1244
1293
  },
1245
1294
  titleProps: {
@@ -1247,7 +1296,7 @@ function wo(e, t) {
1247
1296
  }
1248
1297
  };
1249
1298
  }
1250
- function Eo(e, t, o) {
1299
+ function Po(e, t, o) {
1251
1300
  return t in e ? Object.defineProperty(e, t, {
1252
1301
  value: o,
1253
1302
  enumerable: !0,
@@ -1255,7 +1304,7 @@ function Eo(e, t, o) {
1255
1304
  writable: !0
1256
1305
  }) : e[t] = o, e;
1257
1306
  }
1258
- function Fe(e, t) {
1307
+ function Be(e, t) {
1259
1308
  var o = Object.keys(e);
1260
1309
  if (Object.getOwnPropertySymbols) {
1261
1310
  var r = Object.getOwnPropertySymbols(e);
@@ -1265,48 +1314,48 @@ function Fe(e, t) {
1265
1314
  }
1266
1315
  return o;
1267
1316
  }
1268
- function Le(e) {
1317
+ function Ce(e) {
1269
1318
  for (var t = 1; t < arguments.length; t++) {
1270
1319
  var o = arguments[t] != null ? arguments[t] : {};
1271
- t % 2 ? Fe(Object(o), !0).forEach(function(r) {
1272
- Eo(e, r, o[r]);
1273
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Fe(Object(o)).forEach(function(r) {
1320
+ t % 2 ? Be(Object(o), !0).forEach(function(r) {
1321
+ Po(e, r, o[r]);
1322
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Be(Object(o)).forEach(function(r) {
1274
1323
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(o, r));
1275
1324
  });
1276
1325
  }
1277
1326
  return e;
1278
1327
  }
1279
- var Mo = (e, t, o) => {
1328
+ var ko = (e, t, o) => {
1280
1329
  for (var r of Object.keys(e)) {
1281
1330
  var n;
1282
1331
  if (e[r] !== ((n = t[r]) !== null && n !== void 0 ? n : o[r]))
1283
1332
  return !1;
1284
1333
  }
1285
1334
  return !0;
1286
- }, Ke = (e) => (t) => {
1287
- var o = e.defaultClassName, r = Le(Le({}, e.defaultVariants), t);
1335
+ }, Je = (e) => (t) => {
1336
+ var o = e.defaultClassName, r = Ce(Ce({}, e.defaultVariants), t);
1288
1337
  for (var n in r) {
1289
- var a, l = (a = r[n]) !== null && a !== void 0 ? a : e.defaultVariants[n];
1290
- if (l != null) {
1291
- var s = l;
1338
+ var l, a = (l = r[n]) !== null && l !== void 0 ? l : e.defaultVariants[n];
1339
+ if (a != null) {
1340
+ var s = a;
1292
1341
  typeof s == "boolean" && (s = s === !0 ? "true" : "false");
1293
- var i = e.variantClassNames[n][s];
1294
- i && (o += " " + i);
1342
+ var c = e.variantClassNames[n][s];
1343
+ c && (o += " " + c);
1295
1344
  }
1296
1345
  }
1297
- for (var [d, c] of e.compoundVariants)
1298
- Mo(d, r, e.defaultVariants) && (o += " " + c);
1346
+ for (var [d, i] of e.compoundVariants)
1347
+ ko(d, r, e.defaultVariants) && (o += " " + i);
1299
1348
  return o;
1300
- }, yo = "_3moto2o", Po = "_3moto2q", ko = "_3moto2r", _e = "_3moto2p", To = Ke({ defaultClassName: "_3moto20", variantClassNames: { kind: { informational: "_3moto21", delete: "_3moto22", failure: "_3moto23", success: "_3moto24", warning: "_3moto25", successWithFailures: "_3moto26", form: "_3moto27" }, size: { sm: "_3moto28", md: "_3moto29", lg: "_3moto2a", xl: "_3moto2b" }, fullHeight: { true: "_3moto2c", false: "_3moto2d" } }, defaultVariants: {}, compoundVariants: [] }), xo = "_3moto2n", So = Ke({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), Fo = "_3moto2m", Lo = "_3moto2s";
1301
- function je({
1349
+ }, xo = "_3moto2o", To = "_3moto2q", So = "_3moto2r", Ye = "_3moto2p", Lo = Je({ defaultClassName: "_3moto20", variantClassNames: { kind: { informational: "_3moto21", delete: "_3moto22", failure: "_3moto23", success: "_3moto24", warning: "_3moto25", successWithFailures: "_3moto26", form: "_3moto27" }, size: { sm: "_3moto28", md: "_3moto29", lg: "_3moto2a", xl: "_3moto2b" }, fullHeight: { true: "_3moto2c", false: "_3moto2d" } }, defaultVariants: {}, compoundVariants: [] }), Fo = "_3moto2n", Bo = Je({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), Co = "_3moto2m", No = "_3moto2s";
1350
+ function Qe({
1302
1351
  children: e,
1303
1352
  className: t = "",
1304
1353
  ...o
1305
1354
  }) {
1306
- return /* @__PURE__ */ u.createElement("div", { className: le(_e, t), ...o }, e);
1355
+ return /* @__PURE__ */ u.createElement("div", { className: ue(Ye, t), ...o }, e);
1307
1356
  }
1308
- Ce.set(je, { name: "ModalFooter" });
1309
- const Be = Object.freeze({
1357
+ Oe.set(Qe, { name: "ModalFooter" });
1358
+ const Ne = Object.freeze({
1310
1359
  form: "pencil",
1311
1360
  delete: "trash",
1312
1361
  failure: "status-error",
@@ -1315,77 +1364,77 @@ const Be = Object.freeze({
1315
1364
  successWithFailures: "status-warning",
1316
1365
  warning: "status-warning"
1317
1366
  });
1318
- function Bo({
1367
+ function Oo({
1319
1368
  children: e,
1320
1369
  className: t,
1321
1370
  "data-testid": o,
1322
1371
  kind: r = "informational",
1323
1372
  onBlur: n,
1324
- onFocus: a,
1325
- overlayProps: l,
1373
+ onFocus: l,
1374
+ overlayProps: a,
1326
1375
  size: s = "sm",
1327
- state: i,
1376
+ state: c,
1328
1377
  title: d,
1329
- dismissible: c,
1330
- dismissable: p = !0,
1378
+ dismissible: i,
1379
+ dismissable: f = !0,
1331
1380
  onClose: m,
1332
1381
  fullHeight: g = !1,
1333
- ...f
1382
+ ...p
1334
1383
  }) {
1335
- const P = c != null ? c : p, Q = u.useRef(null), { modalProps: Z, underlayProps: Ge } = ho(
1384
+ const x = i != null ? i : f, oe = u.useRef(null), { modalProps: re, underlayProps: et } = Mo(
1336
1385
  {
1337
- isDismissable: P,
1338
- isKeyboardDismissDisabled: !P,
1339
- ...f
1386
+ isDismissable: x,
1387
+ isKeyboardDismissDisabled: !x,
1388
+ ...p
1340
1389
  },
1341
- i,
1342
- Q
1343
- ), { dialogProps: ee, titleProps: Ye } = wo(f, Q), Xe = $e(Z.onFocus, ee.onFocus, a), Je = $e(Z.onBlur, ee.onBlur, n), { t: Qe } = u.useContext(ot), Ze = rt({ "data-testid": o }), [te, et] = nt(
1390
+ c,
1391
+ oe
1392
+ ), { dialogProps: ne, titleProps: tt } = yo(p, oe), ot = Me(re.onFocus, ne.onFocus, l), rt = Me(re.onBlur, ne.onBlur, n), { t: nt } = u.useContext(st), at = dt({ "data-testid": o }), [ae, lt] = ut(
1344
1393
  e,
1345
- [{ type: je }]
1394
+ [{ type: Qe }]
1346
1395
  );
1347
- function ge() {
1348
- m && typeof m == "function" && m(), i.close();
1396
+ function he() {
1397
+ m && typeof m == "function" && m(), c.close();
1349
1398
  }
1350
- const be = function() {
1351
- return P ? /* @__PURE__ */ u.createElement(
1352
- he,
1399
+ const we = function() {
1400
+ return x ? /* @__PURE__ */ u.createElement(
1401
+ ye,
1353
1402
  {
1354
1403
  "aria-label": "Close",
1355
- onClick: ge,
1404
+ onClick: he,
1356
1405
  kind: "icon",
1357
1406
  icon: "x",
1358
- className: Po
1407
+ className: To
1359
1408
  }
1360
1409
  ) : null;
1361
- }, tt = at(et, (ve) => ve.type === be ? [{ className: le(ve.props.classname, ko) }] : []);
1362
- return /* @__PURE__ */ u.createElement($o, null, /* @__PURE__ */ u.createElement("div", { className: Lo, ...Ge, ...f }, /* @__PURE__ */ u.createElement(
1410
+ }, it = ct(lt, (Ee) => Ee.type === we ? [{ className: ue(Ee.props.classname, So) }] : []);
1411
+ return /* @__PURE__ */ u.createElement(Eo, null, /* @__PURE__ */ u.createElement("div", { className: No, ...et, ...p }, /* @__PURE__ */ u.createElement(
1363
1412
  "div",
1364
1413
  {
1365
- ...Z,
1366
- ...ee,
1367
- ...l,
1368
- onFocus: Xe,
1369
- onBlur: Je,
1370
- ...Ze("dialog"),
1371
- ref: Q,
1372
- className: le(To({ kind: r, size: s, fullHeight: g }), t)
1414
+ ...re,
1415
+ ...ne,
1416
+ ...a,
1417
+ onFocus: ot,
1418
+ onBlur: rt,
1419
+ ...at("dialog"),
1420
+ ref: oe,
1421
+ className: ue(Lo({ kind: r, size: s, fullHeight: g }), t)
1373
1422
  },
1374
- /* @__PURE__ */ u.createElement("div", { ...Ye, className: So({ kind: r }) }, r && /* @__PURE__ */ u.createElement(
1375
- lt,
1423
+ /* @__PURE__ */ u.createElement("div", { ...tt, className: Bo({ kind: r }) }, r && /* @__PURE__ */ u.createElement(
1424
+ mt,
1376
1425
  {
1377
- icon: Be[r] || Be.informational,
1378
- className: xo
1426
+ icon: Ne[r] || Ne.informational,
1427
+ className: Fo
1379
1428
  }
1380
- ), /* @__PURE__ */ u.createElement("div", { className: Fo }, oe(d, i.close)), /* @__PURE__ */ u.createElement(be, null)),
1381
- /* @__PURE__ */ u.createElement("div", { className: yo }, oe(tt, i.close)),
1382
- te && te.length > 0 ? /* @__PURE__ */ u.createElement(u.Fragment, null, oe(te, i.close)) : /* @__PURE__ */ u.createElement("div", { className: _e }, /* @__PURE__ */ u.createElement(he, { kind: "key", onClick: ge }, Qe("design-system:modal.defaultButtonLabel")))
1429
+ ), /* @__PURE__ */ u.createElement("div", { className: Co }, le(d, c.close)), /* @__PURE__ */ u.createElement(we, null)),
1430
+ /* @__PURE__ */ u.createElement("div", { className: xo }, le(it, c.close)),
1431
+ ae && ae.length > 0 ? /* @__PURE__ */ u.createElement(u.Fragment, null, le(ae, c.close)) : /* @__PURE__ */ u.createElement("div", { className: Ye }, /* @__PURE__ */ u.createElement(ye, { kind: "key", onClick: he }, nt("design-system:modal.defaultButtonLabel")))
1383
1432
  )));
1384
1433
  }
1385
- function Ue(e) {
1386
- return e.state.isOpen ? /* @__PURE__ */ u.createElement(Bo, { ...e }, e.children) : /* @__PURE__ */ u.createElement(u.Fragment, null);
1434
+ function Ze(e) {
1435
+ return e.state.isOpen ? /* @__PURE__ */ u.createElement(Oo, { ...e }, e.children) : /* @__PURE__ */ u.createElement(u.Fragment, null);
1387
1436
  }
1388
- Ce.set(Ue, {
1437
+ Oe.set(Ze, {
1389
1438
  name: "Modal",
1390
1439
  props: {
1391
1440
  dismissable: { type: "boolean", default: "true" },
@@ -1398,17 +1447,17 @@ Ce.set(Ue, {
1398
1447
  title: { type: "string" }
1399
1448
  }
1400
1449
  });
1401
- function Co(e) {
1402
- let [t, o] = st(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1403
- const r = k(() => {
1450
+ function Do(e) {
1451
+ let [t, o] = pt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1452
+ const r = T(() => {
1404
1453
  o(!0);
1405
1454
  }, [
1406
1455
  o
1407
- ]), n = k(() => {
1456
+ ]), n = T(() => {
1408
1457
  o(!1);
1409
1458
  }, [
1410
1459
  o
1411
- ]), a = k(() => {
1460
+ ]), l = T(() => {
1412
1461
  o(!t);
1413
1462
  }, [
1414
1463
  o,
@@ -1419,31 +1468,31 @@ function Co(e) {
1419
1468
  setOpen: o,
1420
1469
  open: r,
1421
1470
  close: n,
1422
- toggle: a
1471
+ toggle: l
1423
1472
  };
1424
1473
  }
1425
- function Ro(e = {}) {
1426
- const t = Co(e), o = M(null), { triggerProps: r, overlayProps: n } = mo(
1474
+ function Ho(e = {}) {
1475
+ const t = Do(e), o = y(null), { triggerProps: r, overlayProps: n } = go(
1427
1476
  { type: "dialog" },
1428
1477
  t,
1429
1478
  o
1430
1479
  ), {
1431
- onPress: a,
1432
- ...l
1480
+ onPress: l,
1481
+ ...a
1433
1482
  } = r;
1434
1483
  return {
1435
1484
  triggerProps: {
1436
- ...l,
1437
- onClick: a,
1485
+ ...a,
1486
+ onClick: l,
1438
1487
  ref: o
1439
1488
  },
1440
1489
  modalState: t,
1441
1490
  modalProps: { overlayProps: n, state: t }
1442
1491
  };
1443
1492
  }
1444
- const No = {
1493
+ const Wo = {
1445
1494
  description: () => /* @__PURE__ */ u.createElement("p", null, "Modals are overlays on a page that focus a user\u2019s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),
1446
- components: [Ue],
1495
+ components: [Ze],
1447
1496
  examples: {
1448
1497
  general: {
1449
1498
  label: "Usage",
@@ -2182,13 +2231,13 @@ const No = {
2182
2231
  }
2183
2232
  }
2184
2233
  }
2185
- }, zo = {
2186
- Modals: No
2234
+ }, Vo = {
2235
+ Modals: Wo
2187
2236
  };
2188
2237
  export {
2189
- zo as MANIFEST,
2190
- Ue as Modal,
2191
- je as ModalFooter,
2192
- Be as ModalIcons,
2193
- Ro as useModal
2238
+ Vo as MANIFEST,
2239
+ Ze as Modal,
2240
+ Qe as ModalFooter,
2241
+ Ne as ModalIcons,
2242
+ Ho as useModal
2194
2243
  };