welcome-ui 9.0.0-alpha.4 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +47 -3
  2. package/dist/2W3RN7C5-bkX-rIa3.js +61 -0
  3. package/dist/4I4MLMKD-BLxAidnq.js +43 -0
  4. package/dist/Accordion.js +6 -6
  5. package/dist/Alert.js +1 -1
  6. package/dist/AspectRatio.js +1 -1
  7. package/dist/Avatar.js +1 -1
  8. package/dist/{4CMBR7SL-Dhp8uJop.js → B7UTNDHN-BlIblHCu.js} +59 -59
  9. package/dist/Badge.js +1 -1
  10. package/dist/Breadcrumb.css +1 -1
  11. package/dist/Breadcrumb.js +27 -27
  12. package/dist/Button.js +2 -2
  13. package/dist/ButtonGroup.js +1 -1
  14. package/dist/Card.js +1 -1
  15. package/dist/Checkbox.css +1 -1
  16. package/dist/Checkbox.js +22 -22
  17. package/dist/CloseButton.js +3 -3
  18. package/dist/{SYRFVSLH-CHNUB1rW.js → DSAASPLT-BaaCUKsb.js} +7 -7
  19. package/dist/DatePicker.js +5 -5
  20. package/dist/DateTimePicker.js +2 -2
  21. package/dist/Drawer.css +1 -1
  22. package/dist/Drawer.js +67 -67
  23. package/dist/DropdownMenu.js +261 -259
  24. package/dist/Field.js +1 -1
  25. package/dist/FieldGroup.js +1 -1
  26. package/dist/FileDrop.js +194 -221
  27. package/dist/FileUpload.js +2 -2
  28. package/dist/GVVKDT6A-bET6V7Py.js +724 -0
  29. package/dist/Hint.js +1 -1
  30. package/dist/{Icon-BisRi8B3.js → Icon-EG7O4YwD.js} +1 -1
  31. package/dist/Icon.js +12 -12
  32. package/dist/InputText.js +1 -1
  33. package/dist/{ASMQKSDT-SH1qSiMi.js → KPUWHTQJ-D2TPji47.js} +30 -30
  34. package/dist/Label.js +3 -3
  35. package/dist/Link.css +1 -1
  36. package/dist/Link.js +27 -27
  37. package/dist/Loader.js +1 -1
  38. package/dist/Logo.js +1 -1
  39. package/dist/Modal.js +10 -10
  40. package/dist/{JC64G2H7-DPy9R0De.js → NI3IVY7K-Ztb3-XAv.js} +571 -571
  41. package/dist/{P4IRICAX-7kH4HzWI.js → NMGNQVTG-C6TqBngP.js} +5 -5
  42. package/dist/{LVA2YJMS-NUHCRwFZ.js → OE2EFRVA-C3721cM3.js} +316 -315
  43. package/dist/{ITI7HKP4-C5xLpoVY.js → OLVWQA7U-DysaSaZj.js} +59 -59
  44. package/dist/Pagination.css +1 -1
  45. package/dist/Pagination.js +81 -73
  46. package/dist/PasswordInput.js +17 -18
  47. package/dist/Popover.js +14 -14
  48. package/dist/{YV4JVR4I-CVFstk2K.js → RTNCFSKZ-qpPg689E.js} +75 -73
  49. package/dist/Radio.css +1 -1
  50. package/dist/Radio.js +29 -29
  51. package/dist/RadioGroup.js +21 -21
  52. package/dist/RadioTab.js +2 -2
  53. package/dist/{P2CTZE2T-D1TepwxQ.js → SBSPVDDI-DJKkC1eb.js} +43 -43
  54. package/dist/{NLEBE274-B4zy25kL.js → SQZLCNLX-CHDXnZ16.js} +16 -16
  55. package/dist/Search.js +2 -2
  56. package/dist/Select.js +170 -181
  57. package/dist/Slider.js +1 -1
  58. package/dist/Swiper.css +1 -1
  59. package/dist/Swiper.js +151 -151
  60. package/dist/{VGCJ63VH-CVhs4PYt.js → T22PY7TE-C1N0q8Kn.js} +109 -109
  61. package/dist/Table.js +1 -1
  62. package/dist/Tabs.js +303 -308
  63. package/dist/Tag.js +3 -3
  64. package/dist/Text.js +1 -1
  65. package/dist/Textarea.js +1 -1
  66. package/dist/TimePicker.js +2 -2
  67. package/dist/Toast.js +1 -1
  68. package/dist/Toggle.js +2 -2
  69. package/dist/Tooltip.js +72 -72
  70. package/dist/VariantIcon.js +3 -3
  71. package/dist/WelcomeLoader.js +1 -1
  72. package/dist/XCKGTAUF-DkxWCbaW.js +25 -0
  73. package/dist/Y67KZUMI-DFEgrUv2.js +15 -0
  74. package/dist/{AXB53BZF-BHeessqV.js → ZTXFEM5L-CkrIQCN1.js} +7 -7
  75. package/dist/{field-icon-size-Du58qHNC.js → field-icon-size-Z5NulTSk.js} +216 -224
  76. package/dist/{index-5rXezknO.js → index-BC2bF45u.js} +1 -1
  77. package/dist/{index-C8GsqBDe.js → index-BeetbagJ.js} +1 -1
  78. package/dist/{index-BJLXLdM3.js → index-Bt79XJ8R.js} +1 -1
  79. package/dist/{index-Dcq5gh3E.js → index-BtwrJ6N4.js} +1 -1
  80. package/dist/{index-DL4-ut3P.js → index-CCASZBtz.js} +1 -1
  81. package/dist/{index-lbUBMgHp.js → index-CPqDZeah.js} +2 -2
  82. package/dist/{index-CTgip19b.js → index-CQEPCbEE.js} +1 -1
  83. package/dist/{index-CnxSNAPH.js → index-Crpe9CvH.js} +1 -1
  84. package/dist/{index-CWVOLBDY.js → index-D5a8Oe6k.js} +1 -1
  85. package/dist/{index-C1jjVTAc.js → index-D8dq-I5s.js} +1 -1
  86. package/dist/{index-Cvtm6uuS.js → index-DkwTwo3z.js} +1 -1
  87. package/dist/{index-BG2aV9o8.js → index-DnO8yBVT.js} +1 -1
  88. package/dist/index.css +0 -0
  89. package/dist/tslib.es6-DpB4Y59c.js +683 -0
  90. package/dist/types/components/Pagination/index.d.ts +1 -2
  91. package/dist/types/components/Pagination/types.d.ts +5 -2
  92. package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
  93. package/dist/types/components/PasswordInput/types.d.ts +1 -1
  94. package/dist/types/components/Tabs/components/TabList/index.d.ts +1 -1
  95. package/dist/types/components/Tabs/index.d.ts +1 -1
  96. package/dist/types/components/Tabs/types.d.ts +1 -2
  97. package/dist/types/components/Tabs/utils.d.ts +1 -2
  98. package/dist/types/utils/index.d.ts +1 -0
  99. package/dist/types/utils/theme/index.d.ts +0 -0
  100. package/dist/types/utils/useForkRef.d.ts +7 -1
  101. package/dist/useForkRef-D807AV7D.js +22 -0
  102. package/dist/{utils-BNMgUIHQ.js → utils-BpbIqM56.js} +1 -1
  103. package/dist/utils.js +2 -2
  104. package/package.json +5 -5
  105. package/dist/BYC7LY2E-DbSoi9cN.js +0 -673
  106. package/dist/KUU7WJ55-CsIy9XMu.js +0 -61
  107. package/dist/MTZPJQMC-D_TnSwZf.js +0 -15
  108. package/dist/QYJ6MIDR-Dm7lYMh6.js +0 -43
  109. package/dist/X5NMLKT6-PeY306ft.js +0 -25
  110. package/dist/index--0U5Rubs.js +0 -644
  111. /package/dist/{index-PAaZGbyz.js → index-CdiHdiVB.js} +0 -0
@@ -1,24 +1,263 @@
1
1
  "use client";
2
- import { o as P, S as j, j as R, l as W, n as K, c as J, M as H, e as F, g as S, T as ge, a0 as mt, $ as Et, a1 as Je, a2 as yt, a3 as St, a4 as De, a5 as Pt, b as Qe, a6 as wt, _ as xe, D as U, a7 as Dt, f as et, a8 as je, a9 as te, aa as he, ab as We, ac as xt, ad as Ft, ae as Ot, C as Tt, af as tt, O as At, a as be, ag as Ct, ah as re, W as Rt, Z as _t, ai as Lt, aj as Ht } from "./LVA2YJMS-NUHCRwFZ.js";
3
- import { d as Nt, e as Mt, u as Vt, f as rt, b as Fe, i as $t, g as It, h as kt, j as Bt } from "./VGCJ63VH-CVhs4PYt.js";
4
- import { u as qt, d as q, a as jt } from "./YV4JVR4I-CVFstk2K.js";
5
- import { useRef as N, useEffect as x, isValidElement as Wt, useCallback as de, useContext as Oe, createContext as Te, useState as X, useMemo as Yt } from "react";
2
+ import { createContext as xe, useRef as H, useContext as De, useState as X, useEffect as D, useCallback as de, useMemo as mt, isValidElement as Et } from "react";
3
+ import { c as J, d as F, a as S, f as j, b as K, _ as Fe, p as Je, M as N, a0 as We, g as P, x as U, a1 as te, a2 as ge, a3 as je, a4 as yt, a5 as St, a6 as Pt, a7 as Oe, S as W, q as R, a8 as wt, u as Qe, a9 as xt, $ as Dt, aa as et, ab as Ft, ac as Ot, T as he, ad as Tt, ae as At, w as Ct, af as tt, O as Rt, l as be, ag as _t, ah as re, W as Lt, Z as Ht, ai as Nt, aj as Mt } from "./OE2EFRVA-C3721cM3.js";
4
+ import { createPortal as Ye, flushSync as Vt } from "react-dom";
6
5
  import { jsx as E, jsxs as le, Fragment as fe } from "react/jsx-runtime";
7
- import { flushSync as Xt, createPortal as Ye } from "react-dom";
8
- function zt(e = {}) {
9
- return Nt(e);
6
+ import { u as q, a as $t, b as It } from "./RTNCFSKZ-qpPg689E.js";
7
+ import { u as kt, d as rt, e as Bt, f as qt, b as Te, i as Wt, g as jt, h as Yt, j as Xt } from "./T22PY7TE-C1N0q8Kn.js";
8
+ var Xe = xe(null), zt = "span", nt = J(
9
+ function(t) {
10
+ return t = F(S({}, t), {
11
+ style: S({
12
+ border: 0,
13
+ clip: "rect(0 0 0 0)",
14
+ height: "1px",
15
+ margin: "-1px",
16
+ overflow: "hidden",
17
+ padding: 0,
18
+ position: "absolute",
19
+ whiteSpace: "nowrap",
20
+ width: "1px"
21
+ }, t.style)
22
+ }), t;
23
+ }
24
+ );
25
+ j(function(t) {
26
+ const r = nt(t);
27
+ return K(zt, r);
28
+ });
29
+ var Kt = "span", Gt = J(
30
+ function(t) {
31
+ return t = F(S({
32
+ "data-focus-trap": "",
33
+ tabIndex: 0,
34
+ "aria-hidden": !0
35
+ }, t), {
36
+ style: S({
37
+ // Prevents unintended scroll jumps.
38
+ position: "fixed",
39
+ top: 0,
40
+ left: 0
41
+ }, t.style)
42
+ }), t = nt(t), t;
43
+ }
44
+ ), ce = j(function(t) {
45
+ const r = Gt(t);
46
+ return K(Kt, r);
47
+ }), Ut = "div";
48
+ function Zt(e) {
49
+ return P(e).body;
50
+ }
51
+ function Jt(e, t) {
52
+ return t ? typeof t == "function" ? t(e) : t : P(e).createElement("div");
10
53
  }
11
- function Kt(e, t, r) {
12
- return Mt(e, t, r);
54
+ function Qt(e = "id") {
55
+ return `${e ? `${e}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
13
56
  }
14
- function Gt(e = {}) {
15
- const [t, r] = qt(zt, e);
16
- return Kt(t, r, e);
57
+ function B(e) {
58
+ queueMicrotask(() => {
59
+ e == null || e.focus();
60
+ });
17
61
  }
18
- function nt(e, ...t) {
19
- if (!e) return !1;
20
- const r = e.getAttribute("data-backdrop");
21
- return r == null ? !1 : r === "" || r === "true" || !t.length ? !0 : t.some((n) => r === n);
62
+ var ot = J(function(t) {
63
+ var r = t, {
64
+ preserveTabOrder: n,
65
+ preserveTabOrderAnchor: o,
66
+ portalElement: s,
67
+ portalRef: i,
68
+ portal: u = !0
69
+ } = r, c = Fe(r, [
70
+ "preserveTabOrder",
71
+ "preserveTabOrderAnchor",
72
+ "portalElement",
73
+ "portalRef",
74
+ "portal"
75
+ ]);
76
+ const h = H(null), m = Je(h, c.ref), O = De(Xe), [f, V] = X(null), [$, I] = X(
77
+ null
78
+ ), k = H(null), M = H(null), G = H(null), T = H(null);
79
+ return N(() => {
80
+ const l = h.current;
81
+ if (!l || !u) {
82
+ V(null);
83
+ return;
84
+ }
85
+ const b = Jt(l, s);
86
+ if (!b) {
87
+ V(null);
88
+ return;
89
+ }
90
+ const g = b.isConnected;
91
+ if (g || (O || Zt(l)).appendChild(b), b.id || (b.id = l.id ? `portal/${l.id}` : Qt()), V(b), We(i, b), !g)
92
+ return () => {
93
+ b.remove(), We(i, null);
94
+ };
95
+ }, [u, s, O, i]), N(() => {
96
+ if (!u || !n || !o) return;
97
+ const b = P(o).createElement("span");
98
+ return b.style.position = "fixed", o.insertAdjacentElement("afterend", b), I(b), () => {
99
+ b.remove(), I(null);
100
+ };
101
+ }, [u, n, o]), D(() => {
102
+ if (!f || !n) return;
103
+ let l = 0;
104
+ const b = (g) => {
105
+ if (!te(g)) return;
106
+ const d = g.type === "focusin";
107
+ if (cancelAnimationFrame(l), d)
108
+ return yt(f);
109
+ l = requestAnimationFrame(() => {
110
+ St(f, !0);
111
+ });
112
+ };
113
+ return f.addEventListener("focusin", b, !0), f.addEventListener("focusout", b, !0), () => {
114
+ cancelAnimationFrame(l), f.removeEventListener("focusin", b, !0), f.removeEventListener("focusout", b, !0);
115
+ };
116
+ }, [f, n]), c = U(
117
+ c,
118
+ (l) => {
119
+ if (l = // While the portal node is not in the DOM, we need to pass the
120
+ // current context to the portal context, otherwise it's going to
121
+ // reset to the body element on nested portals.
122
+ /* @__PURE__ */ E(Xe.Provider, { value: f || O, children: l }), !u) return l;
123
+ if (!f)
124
+ return /* @__PURE__ */ E(
125
+ "span",
126
+ {
127
+ ref: m,
128
+ id: c.id,
129
+ style: { position: "fixed" },
130
+ hidden: !0
131
+ }
132
+ );
133
+ l = /* @__PURE__ */ le(fe, { children: [
134
+ n && f && /* @__PURE__ */ E(
135
+ ce,
136
+ {
137
+ ref: M,
138
+ "data-focus-trap": c.id,
139
+ className: "__focus-trap-inner-before",
140
+ onFocus: (g) => {
141
+ te(g, f) ? B(ge()) : B(k.current);
142
+ }
143
+ }
144
+ ),
145
+ l,
146
+ n && f && /* @__PURE__ */ E(
147
+ ce,
148
+ {
149
+ ref: G,
150
+ "data-focus-trap": c.id,
151
+ className: "__focus-trap-inner-after",
152
+ onFocus: (g) => {
153
+ te(g, f) ? B(je()) : B(T.current);
154
+ }
155
+ }
156
+ )
157
+ ] }), f && (l = Ye(l, f));
158
+ let b = /* @__PURE__ */ le(fe, { children: [
159
+ n && f && /* @__PURE__ */ E(
160
+ ce,
161
+ {
162
+ ref: k,
163
+ "data-focus-trap": c.id,
164
+ className: "__focus-trap-outer-before",
165
+ onFocus: (g) => {
166
+ !(g.relatedTarget === T.current) && te(g, f) ? B(M.current) : B(je());
167
+ }
168
+ }
169
+ ),
170
+ n && // We're using position: fixed here so that the browser doesn't
171
+ // add margin to the element when setting gap on a parent element.
172
+ /* @__PURE__ */ E("span", { "aria-owns": f == null ? void 0 : f.id, style: { position: "fixed" } }),
173
+ n && f && /* @__PURE__ */ E(
174
+ ce,
175
+ {
176
+ ref: T,
177
+ "data-focus-trap": c.id,
178
+ className: "__focus-trap-outer-after",
179
+ onFocus: (g) => {
180
+ if (te(g, f))
181
+ B(G.current);
182
+ else {
183
+ const d = ge();
184
+ if (d === M.current) {
185
+ requestAnimationFrame(() => {
186
+ var oe;
187
+ return (oe = ge()) == null ? void 0 : oe.focus();
188
+ });
189
+ return;
190
+ }
191
+ B(d);
192
+ }
193
+ }
194
+ }
195
+ )
196
+ ] });
197
+ return $ && n && (b = Ye(
198
+ b,
199
+ $
200
+ )), /* @__PURE__ */ le(fe, { children: [
201
+ b,
202
+ l
203
+ ] });
204
+ },
205
+ [f, O, u, c.id, n, $]
206
+ ), c = F(S({}, c), {
207
+ ref: m
208
+ }), c;
209
+ });
210
+ j(function(t) {
211
+ const r = ot(t);
212
+ return K(Ut, r);
213
+ });
214
+ var ze = xe(0);
215
+ function er({ level: e, children: t }) {
216
+ const r = De(ze), n = Math.max(
217
+ Math.min(e || r + 1, 6),
218
+ 1
219
+ );
220
+ return /* @__PURE__ */ E(ze.Provider, { value: n, children: t });
221
+ }
222
+ var tr = "div", st = J(function(t) {
223
+ var r = t, { autoFocusOnShow: n = !0 } = r, o = Fe(r, ["autoFocusOnShow"]);
224
+ return o = U(
225
+ o,
226
+ (s) => /* @__PURE__ */ E(Pt.Provider, { value: n, children: s }),
227
+ [n]
228
+ ), o;
229
+ });
230
+ j(function(t) {
231
+ const r = st(t);
232
+ return K(tr, r);
233
+ });
234
+ function rr(e, t) {
235
+ const n = P(e).createElement("button");
236
+ return n.type = "button", n.tabIndex = -1, n.textContent = "Dismiss popup", Object.assign(n.style, {
237
+ border: "0px",
238
+ clip: "rect(0 0 0 0)",
239
+ height: "1px",
240
+ margin: "-1px",
241
+ overflow: "hidden",
242
+ padding: "0px",
243
+ position: "absolute",
244
+ whiteSpace: "nowrap",
245
+ width: "1px"
246
+ }), n.addEventListener("click", t), e.prepend(n), () => {
247
+ n.removeEventListener("click", t), n.remove();
248
+ };
249
+ }
250
+ function nr(e) {
251
+ const t = H();
252
+ return D(() => {
253
+ if (!e) {
254
+ t.current = null;
255
+ return;
256
+ }
257
+ return Oe("mousedown", (n) => {
258
+ t.current = n.target;
259
+ }, !0);
260
+ }, [e]), t;
22
261
  }
23
262
  var me = /* @__PURE__ */ new WeakMap();
24
263
  function ne(e, t, r) {
@@ -61,7 +300,7 @@ function Se(e, t) {
61
300
  }) : () => {
62
301
  };
63
302
  }
64
- function Ut(e, t, r) {
303
+ function or(e, t, r) {
65
304
  return e ? ne(e, t, () => {
66
305
  const o = e.style.getPropertyValue(t);
67
306
  return e.style.setProperty(t, r), () => {
@@ -70,11 +309,11 @@ function Ut(e, t, r) {
70
309
  }) : () => {
71
310
  };
72
311
  }
73
- var Zt = ["SCRIPT", "STYLE"];
312
+ var sr = ["SCRIPT", "STYLE"];
74
313
  function Pe(e) {
75
314
  return `__ariakit-dialog-snapshot-${e}`;
76
315
  }
77
- function Jt(e, t) {
316
+ function ur(e, t) {
78
317
  const r = P(t), n = Pe(e);
79
318
  if (!r.body[n]) return !0;
80
319
  do {
@@ -84,8 +323,8 @@ function Jt(e, t) {
84
323
  t = t.parentElement;
85
324
  } while (!0);
86
325
  }
87
- function Qt(e, t, r) {
88
- return Zt.includes(t.tagName) || !Jt(e, t) ? !1 : !r.some(
326
+ function ir(e, t, r) {
327
+ return sr.includes(t.tagName) || !ur(e, t) ? !1 : !r.some(
89
328
  (n) => n && R(t, n)
90
329
  );
91
330
  }
@@ -96,31 +335,36 @@ function Ce(e, t, r, n) {
96
335
  for (; o.parentElement && o !== i.body; ) {
97
336
  if (n == null || n(o.parentElement, u), !s)
98
337
  for (const c of o.parentElement.children)
99
- Qt(e, c, t) && r(c, u);
338
+ ir(e, c, t) && r(c, u);
100
339
  o = o.parentElement;
101
340
  }
102
341
  }
103
342
  }
104
- function er(e, t) {
343
+ function ar(e, t) {
105
344
  const { body: r } = P(t[0]), n = [];
106
345
  return Ce(e, t, (s) => {
107
346
  n.push(z(s, Pe(e), !0));
108
- }), j(z(r, Pe(e), !0), () => {
347
+ }), W(z(r, Pe(e), !0), () => {
109
348
  for (const s of n)
110
349
  s();
111
350
  });
112
351
  }
352
+ function ut(e, ...t) {
353
+ if (!e) return !1;
354
+ const r = e.getAttribute("data-backdrop");
355
+ return r == null ? !1 : r === "" || r === "true" || !t.length ? !0 : t.some((n) => r === n);
356
+ }
113
357
  function Z(e = "", t = !1) {
114
358
  return `__ariakit-dialog-${t ? "ancestor" : "outside"}${e ? `-${e}` : ""}`;
115
359
  }
116
- function tr(e, t = "") {
117
- return j(
360
+ function cr(e, t = "") {
361
+ return W(
118
362
  z(e, Z(), !0),
119
363
  z(e, Z(t), !0)
120
364
  );
121
365
  }
122
- function ot(e, t = "") {
123
- return j(
366
+ function it(e, t = "") {
367
+ return W(
124
368
  z(e, Z("", !0), !0),
125
369
  z(e, Z(t, !0), !0)
126
370
  );
@@ -135,197 +379,151 @@ function Re(e, t) {
135
379
  e = e.parentElement;
136
380
  } while (!0);
137
381
  }
138
- function Xe(e, t) {
382
+ function Ke(e, t) {
139
383
  const r = [], n = t.map((s) => s == null ? void 0 : s.id);
140
384
  return Ce(
141
385
  e,
142
386
  t,
143
387
  (s) => {
144
- nt(s, ...n) || r.unshift(tr(s, e));
388
+ ut(s, ...n) || r.unshift(cr(s, e));
145
389
  },
146
390
  (s, i) => {
147
- i.hasAttribute("data-dialog") && i.id !== e || r.unshift(ot(s, e));
391
+ i.hasAttribute("data-dialog") && i.id !== e || r.unshift(it(s, e));
148
392
  }
149
393
  ), () => {
150
394
  for (const s of r)
151
395
  s();
152
396
  };
153
397
  }
154
- var rr = "div", nr = [
155
- "a",
156
- "button",
157
- "details",
158
- "dialog",
159
- "div",
160
- "form",
161
- "h1",
162
- "h2",
163
- "h3",
164
- "h4",
165
- "h5",
166
- "h6",
167
- "header",
168
- "img",
169
- "input",
170
- "label",
171
- "li",
172
- "nav",
173
- "ol",
174
- "p",
175
- "section",
176
- "select",
177
- "span",
178
- "summary",
179
- "textarea",
180
- "ul",
181
- "svg"
182
- ];
183
- J(
184
- function(t) {
185
- return t;
186
- }
187
- );
188
- var we = W(
189
- // @ts-expect-error
190
- function(t) {
191
- return K(rr, t);
398
+ function lr(e) {
399
+ return e.tagName === "HTML" ? !0 : R(P(e).body, e);
400
+ }
401
+ function fr(e, t) {
402
+ if (!e) return !1;
403
+ if (R(e, t)) return !0;
404
+ const r = t.getAttribute("aria-activedescendant");
405
+ if (r) {
406
+ const n = P(e).getElementById(r);
407
+ if (n)
408
+ return R(e, n);
192
409
  }
193
- );
194
- Object.assign(
195
- we,
196
- nr.reduce((e, t) => (e[t] = W(function(n) {
197
- return K(t, n);
198
- }), e), {})
199
- );
200
- function or({
201
- store: e,
202
- backdrop: t,
203
- alwaysVisible: r,
204
- hidden: n
205
- }) {
206
- const o = N(null), s = Vt({ disclosure: e }), i = q(e, "contentElement");
207
- x(() => {
208
- const h = o.current, m = i;
209
- h && m && (h.style.zIndex = getComputedStyle(m).zIndex);
210
- }, [i]), H(() => {
211
- const h = i == null ? void 0 : i.id;
212
- if (!h) return;
213
- const m = o.current;
214
- if (m)
215
- return ot(m, h);
216
- }, [i]);
217
- const u = rt({
218
- ref: o,
219
- store: s,
220
- role: "presentation",
221
- "data-backdrop": (i == null ? void 0 : i.id) || "",
222
- alwaysVisible: r,
223
- hidden: n ?? void 0,
224
- style: {
225
- position: "fixed",
226
- top: 0,
227
- right: 0,
228
- bottom: 0,
229
- left: 0
230
- }
231
- });
232
- if (!t) return null;
233
- if (Wt(t))
234
- return /* @__PURE__ */ E(we, F(S({}, u), { render: t }));
235
- const c = typeof t != "boolean" ? t : "div";
236
- return /* @__PURE__ */ E(we, F(S({}, u), { render: /* @__PURE__ */ E(c, {}) }));
410
+ return !1;
237
411
  }
238
- function sr(e, ...t) {
239
- if (!e) return !1;
240
- const r = e.getAttribute("data-focus-trap");
241
- return r == null ? !1 : t.length ? r === "" ? !1 : t.some((n) => r === n) : !0;
412
+ function dr(e, t) {
413
+ if (!("clientY" in e)) return !1;
414
+ const r = t.getBoundingClientRect();
415
+ return r.width === 0 || r.height === 0 ? !1 : r.top <= e.clientY && e.clientY <= r.top + r.height && r.left <= e.clientX && e.clientX <= r.left + r.width;
242
416
  }
243
- function ur(e) {
244
- return Ae(e, "aria-hidden", "true");
417
+ function Ee({
418
+ store: e,
419
+ type: t,
420
+ listener: r,
421
+ capture: n,
422
+ domReady: o
423
+ }) {
424
+ const s = Qe(r), i = q(e, "open"), u = H(!1);
425
+ N(() => {
426
+ if (!i || !o) return;
427
+ const { contentElement: c } = e.getState();
428
+ if (!c) return;
429
+ const h = () => {
430
+ u.current = !0;
431
+ };
432
+ return c.addEventListener("focusin", h, !0), () => c.removeEventListener("focusin", h, !0);
433
+ }, [e, i, o]), D(() => i ? Oe(t, (h) => {
434
+ const { contentElement: m, disclosureElement: O } = e.getState(), f = h.target;
435
+ !m || !f || !lr(f) || R(m, f) || fr(O, f) || f.hasAttribute("data-focus-trap") || dr(h, m) || u.current && !Re(f, m.id) || xt(f) || s(h);
436
+ }, n) : void 0, [i, n]);
245
437
  }
246
- function st() {
247
- return "inert" in HTMLElement.prototype;
438
+ function ye(e, t) {
439
+ return typeof e == "function" ? e(t) : !!e;
248
440
  }
249
- function ut(e, t) {
250
- if (!("style" in e)) return ge;
251
- if (st())
252
- return z(e, "inert", !0);
253
- const n = mt(e, !0).map((o) => {
254
- if (t != null && t.some((i) => i && R(i, o))) return ge;
255
- const s = ne(o, "focus", () => (o.focus = ge, () => {
256
- delete o.focus;
257
- }));
258
- return j(Ae(o, "tabindex", "-1"), s);
259
- });
260
- return j(
261
- ...n,
262
- ur(e),
263
- Se(e, {
264
- pointerEvents: "none",
265
- userSelect: "none",
266
- cursor: "default"
267
- })
268
- );
441
+ function pr(e, t, r) {
442
+ const n = q(e, "open"), o = nr(n), s = { store: e, domReady: r, capture: !0 };
443
+ Ee(F(S({}, s), {
444
+ type: "click",
445
+ listener: (i) => {
446
+ const { contentElement: u } = e.getState(), c = o.current;
447
+ c && wt(c) && Re(c, u == null ? void 0 : u.id) && ye(t, i) && e.hide();
448
+ }
449
+ })), Ee(F(S({}, s), {
450
+ type: "focusin",
451
+ listener: (i) => {
452
+ const { contentElement: u } = e.getState();
453
+ u && i.target !== P(u) && ye(t, i) && e.hide();
454
+ }
455
+ })), Ee(F(S({}, s), {
456
+ type: "contextmenu",
457
+ listener: (i) => {
458
+ ye(t, i) && e.hide();
459
+ }
460
+ }));
269
461
  }
270
- function ir(e, t) {
271
- const r = [], n = t.map((s) => s == null ? void 0 : s.id);
272
- return Ce(
273
- e,
274
- t,
275
- (s) => {
276
- nt(s, ...n) || sr(s, ...n) || r.unshift(ut(s, t));
462
+ var Ge = xe({});
463
+ function vr(e) {
464
+ const t = De(Ge), [r, n] = X([]), o = de(
465
+ (u) => {
466
+ var c;
467
+ return n((h) => [...h, u]), W((c = t.add) == null ? void 0 : c.call(t, u), () => {
468
+ n((h) => h.filter((m) => m !== u));
469
+ });
277
470
  },
278
- (s) => {
279
- s.hasAttribute("role") && (t.some((i) => i && R(i, s)) || r.unshift(Ae(s, "role", "none")));
280
- }
281
- ), () => {
282
- for (const s of r)
283
- s();
284
- };
471
+ [t]
472
+ );
473
+ N(() => $t(e, ["open", "contentElement"], (u) => {
474
+ var c;
475
+ if (u.open && u.contentElement)
476
+ return (c = t.add) == null ? void 0 : c.call(t, e);
477
+ }), [e, t]);
478
+ const s = mt(() => ({ store: e, add: o }), [e, o]);
479
+ return { wrapElement: de(
480
+ (u) => /* @__PURE__ */ E(Ge.Provider, { value: s, children: u }),
481
+ [s]
482
+ ), nestedDialogs: r };
285
483
  }
286
- function ar({
484
+ function gr({
287
485
  attribute: e,
288
486
  contentId: t,
289
487
  contentElement: r,
290
488
  enabled: n
291
489
  }) {
292
- const [o, s] = Et(), i = de(() => {
490
+ const [o, s] = Dt(), i = de(() => {
293
491
  if (!n || !r) return !1;
294
492
  const { body: u } = P(r), c = u.getAttribute(e);
295
493
  return !c || c === t;
296
494
  }, [o, n, r, e, t]);
297
- return x(() => {
495
+ return D(() => {
298
496
  if (!n || !t || !r) return;
299
497
  const { body: u } = P(r);
300
498
  if (i())
301
499
  return u.setAttribute(e, t), () => u.removeAttribute(e);
302
- const c = new MutationObserver(() => Xt(s));
500
+ const c = new MutationObserver(() => Vt(s));
303
501
  return c.observe(u, { attributeFilter: [e] }), () => c.disconnect();
304
502
  }, [o, n, t, r, i, e]), i;
305
503
  }
306
- function cr(e) {
504
+ function hr(e) {
307
505
  const t = e.getBoundingClientRect().left;
308
506
  return Math.round(t) + e.scrollLeft ? "paddingLeft" : "paddingRight";
309
507
  }
310
- function lr(e, t, r) {
311
- const n = ar({
508
+ function br(e, t, r) {
509
+ const n = gr({
312
510
  attribute: "data-dialog-prevent-body-scroll",
313
511
  contentElement: e,
314
512
  contentId: t,
315
513
  enabled: r
316
514
  });
317
- x(() => {
515
+ D(() => {
318
516
  if (!n() || !e) return;
319
- const o = P(e), s = Je(e), { documentElement: i, body: u } = o, c = i.style.getPropertyValue("--scrollbar-width"), h = c ? Number.parseInt(c) : s.innerWidth - i.clientWidth, m = () => Ut(
517
+ const o = P(e), s = et(e), { documentElement: i, body: u } = o, c = i.style.getPropertyValue("--scrollbar-width"), h = c ? Number.parseInt(c, 10) : s.innerWidth - i.clientWidth, m = () => or(
320
518
  i,
321
519
  "--scrollbar-width",
322
520
  `${h}px`
323
- ), O = cr(i), f = () => Se(u, {
521
+ ), O = hr(i), f = () => Se(u, {
324
522
  overflow: "hidden",
325
523
  [O]: `${h}px`
326
524
  }), V = () => {
327
525
  var I, k;
328
- const { scrollX: M, scrollY: G, visualViewport: T } = s, l = (I = T == null ? void 0 : T.offsetLeft) != null ? I : 0, b = (k = T == null ? void 0 : T.offsetTop) != null ? k : 0, v = Se(u, {
526
+ const { scrollX: M, scrollY: G, visualViewport: T } = s, l = (I = T == null ? void 0 : T.offsetLeft) != null ? I : 0, b = (k = T == null ? void 0 : T.offsetTop) != null ? k : 0, g = Se(u, {
329
527
  position: "fixed",
330
528
  overflow: "hidden",
331
529
  top: `${-(G - Math.floor(b))}px`,
@@ -334,356 +532,158 @@ function lr(e, t, r) {
334
532
  [O]: `${h}px`
335
533
  });
336
534
  return () => {
337
- v(), process.env.NODE_ENV !== "test" && s.scrollTo({ left: M, top: G, behavior: "instant" });
535
+ g(), process.env.NODE_ENV !== "test" && s.scrollTo({ left: M, top: G, behavior: "instant" });
338
536
  };
339
- }, $ = yt() && !St();
340
- return j(
537
+ }, $ = Ft() && !Ot();
538
+ return W(
341
539
  m(),
342
540
  $ ? V() : f()
343
541
  );
344
542
  }, [n, e]);
345
543
  }
346
- var ze = Te({});
347
- function fr(e) {
348
- const t = Oe(ze), [r, n] = X([]), o = de(
349
- (u) => {
350
- var c;
351
- return n((h) => [...h, u]), j((c = t.add) == null ? void 0 : c.call(t, u), () => {
352
- n((h) => h.filter((m) => m !== u));
353
- });
354
- },
355
- [t]
356
- );
357
- H(() => jt(e, ["open", "contentElement"], (u) => {
358
- var c;
359
- if (u.open && u.contentElement)
360
- return (c = t.add) == null ? void 0 : c.call(t, e);
361
- }), [e, t]);
362
- const s = Yt(() => ({ store: e, add: o }), [e, o]);
363
- return { wrapElement: de(
364
- (u) => /* @__PURE__ */ E(ze.Provider, { value: s, children: u }),
365
- [s]
366
- ), nestedDialogs: r };
367
- }
368
- function dr(e) {
369
- const t = N();
370
- return x(() => {
371
- if (!e) {
372
- t.current = null;
373
- return;
374
- }
375
- return De("mousedown", (n) => {
376
- t.current = n.target;
377
- }, !0);
378
- }, [e]), t;
379
- }
380
- function pr(e) {
381
- return e.tagName === "HTML" ? !0 : R(P(e).body, e);
382
- }
383
- function vr(e, t) {
544
+ function mr(e, ...t) {
384
545
  if (!e) return !1;
385
- if (R(e, t)) return !0;
386
- const r = t.getAttribute("aria-activedescendant");
387
- if (r) {
388
- const n = P(e).getElementById(r);
389
- if (n)
390
- return R(e, n);
391
- }
392
- return !1;
546
+ const r = e.getAttribute("data-focus-trap");
547
+ return r == null ? !1 : t.length ? r === "" ? !1 : t.some((n) => r === n) : !0;
393
548
  }
394
- function gr(e, t) {
395
- if (!("clientY" in e)) return !1;
396
- const r = t.getBoundingClientRect();
397
- return r.width === 0 || r.height === 0 ? !1 : r.top <= e.clientY && e.clientY <= r.top + r.height && r.left <= e.clientX && e.clientX <= r.left + r.width;
549
+ function at() {
550
+ return "inert" in HTMLElement.prototype;
398
551
  }
399
- function Ee({
400
- store: e,
401
- type: t,
402
- listener: r,
403
- capture: n,
404
- domReady: o
405
- }) {
406
- const s = Qe(r), i = q(e, "open"), u = N(!1);
407
- H(() => {
408
- if (!i || !o) return;
409
- const { contentElement: c } = e.getState();
410
- if (!c) return;
411
- const h = () => {
412
- u.current = !0;
413
- };
414
- return c.addEventListener("focusin", h, !0), () => c.removeEventListener("focusin", h, !0);
415
- }, [e, i, o]), x(() => i ? De(t, (h) => {
416
- const { contentElement: m, disclosureElement: O } = e.getState(), f = h.target;
417
- !m || !f || !pr(f) || R(m, f) || vr(O, f) || f.hasAttribute("data-focus-trap") || gr(h, m) || u.current && !Re(f, m.id) || wt(f) || s(h);
418
- }, n) : void 0, [i, n]);
552
+ function Er(e) {
553
+ return Ae(e, "aria-hidden", "true");
419
554
  }
420
- function ye(e, t) {
421
- return typeof e == "function" ? e(t) : !!e;
555
+ function ct(e, t) {
556
+ if (!("style" in e)) return he;
557
+ if (at())
558
+ return z(e, "inert", !0);
559
+ const n = Tt(e, !0).map((o) => {
560
+ if (t != null && t.some((i) => i && R(i, o))) return he;
561
+ const s = ne(o, "focus", () => (o.focus = he, () => {
562
+ delete o.focus;
563
+ }));
564
+ return W(Ae(o, "tabindex", "-1"), s);
565
+ });
566
+ return W(
567
+ ...n,
568
+ Er(e),
569
+ Se(e, {
570
+ pointerEvents: "none",
571
+ userSelect: "none",
572
+ cursor: "default"
573
+ })
574
+ );
422
575
  }
423
- function hr(e, t, r) {
424
- const n = q(e, "open"), o = dr(n), s = { store: e, domReady: r, capture: !0 };
425
- Ee(F(S({}, s), {
426
- type: "click",
427
- listener: (i) => {
428
- const { contentElement: u } = e.getState(), c = o.current;
429
- c && Pt(c) && Re(c, u == null ? void 0 : u.id) && ye(t, i) && e.hide();
430
- }
431
- })), Ee(F(S({}, s), {
432
- type: "focusin",
433
- listener: (i) => {
434
- const { contentElement: u } = e.getState();
435
- u && i.target !== P(u) && ye(t, i) && e.hide();
436
- }
437
- })), Ee(F(S({}, s), {
438
- type: "contextmenu",
439
- listener: (i) => {
440
- ye(t, i) && e.hide();
576
+ function yr(e, t) {
577
+ const r = [], n = t.map((s) => s == null ? void 0 : s.id);
578
+ return Ce(
579
+ e,
580
+ t,
581
+ (s) => {
582
+ ut(s, ...n) || mr(s, ...n) || r.unshift(ct(s, t));
583
+ },
584
+ (s) => {
585
+ s.hasAttribute("role") && (t.some((i) => i && R(i, s)) || r.unshift(Ae(s, "role", "none")));
441
586
  }
442
- }));
443
- }
444
- function br(e, t) {
445
- const n = P(e).createElement("button");
446
- return n.type = "button", n.tabIndex = -1, n.textContent = "Dismiss popup", Object.assign(n.style, {
447
- border: "0px",
448
- clip: "rect(0 0 0 0)",
449
- height: "1px",
450
- margin: "-1px",
451
- overflow: "hidden",
452
- padding: "0px",
453
- position: "absolute",
454
- whiteSpace: "nowrap",
455
- width: "1px"
456
- }), n.addEventListener("click", t), e.prepend(n), () => {
457
- n.removeEventListener("click", t), n.remove();
587
+ ), () => {
588
+ for (const s of r)
589
+ s();
458
590
  };
459
591
  }
460
- var mr = "div", it = J(function(t) {
461
- var r = t, { autoFocusOnShow: n = !0 } = r, o = xe(r, ["autoFocusOnShow"]);
462
- return o = U(
463
- o,
464
- (s) => /* @__PURE__ */ E(Dt.Provider, { value: n, children: s }),
465
- [n]
466
- ), o;
467
- });
468
- W(function(t) {
469
- const r = it(t);
470
- return K(mr, r);
471
- });
472
- var Ke = Te(0);
473
- function Er({ level: e, children: t }) {
474
- const r = Oe(Ke), n = Math.max(
475
- Math.min(e || r + 1, 6),
476
- 1
477
- );
478
- return /* @__PURE__ */ E(Ke.Provider, { value: n, children: t });
479
- }
480
- var yr = "span", at = J(
592
+ var Sr = "div", Pr = [
593
+ "a",
594
+ "button",
595
+ "details",
596
+ "dialog",
597
+ "div",
598
+ "form",
599
+ "h1",
600
+ "h2",
601
+ "h3",
602
+ "h4",
603
+ "h5",
604
+ "h6",
605
+ "header",
606
+ "img",
607
+ "input",
608
+ "label",
609
+ "li",
610
+ "nav",
611
+ "ol",
612
+ "p",
613
+ "section",
614
+ "select",
615
+ "span",
616
+ "summary",
617
+ "textarea",
618
+ "ul",
619
+ "svg"
620
+ ];
621
+ J(
481
622
  function(t) {
482
- return t = F(S({}, t), {
483
- style: S({
484
- border: 0,
485
- clip: "rect(0 0 0 0)",
486
- height: "1px",
487
- margin: "-1px",
488
- overflow: "hidden",
489
- padding: 0,
490
- position: "absolute",
491
- whiteSpace: "nowrap",
492
- width: "1px"
493
- }, t.style)
494
- }), t;
623
+ return t;
495
624
  }
496
625
  );
497
- W(function(t) {
498
- const r = at(t);
499
- return K(yr, r);
500
- });
501
- var Sr = "span", Pr = J(
626
+ var we = j(
627
+ // @ts-expect-error
502
628
  function(t) {
503
- return t = F(S({
504
- "data-focus-trap": "",
505
- tabIndex: 0,
506
- "aria-hidden": !0
507
- }, t), {
508
- style: S({
509
- // Prevents unintended scroll jumps.
510
- position: "fixed",
511
- top: 0,
512
- left: 0
513
- }, t.style)
514
- }), t = at(t), t;
629
+ return K(Sr, t);
515
630
  }
516
- ), ce = W(function(t) {
517
- const r = Pr(t);
518
- return K(Sr, r);
519
- }), Ge = Te(null), wr = "div";
520
- function Dr(e) {
521
- return P(e).body;
631
+ );
632
+ Object.assign(
633
+ we,
634
+ Pr.reduce((e, t) => (e[t] = j(function(n) {
635
+ return K(t, n);
636
+ }), e), {})
637
+ );
638
+ function wr({
639
+ store: e,
640
+ backdrop: t,
641
+ alwaysVisible: r,
642
+ hidden: n
643
+ }) {
644
+ const o = H(null), s = kt({ disclosure: e }), i = q(e, "contentElement");
645
+ D(() => {
646
+ const h = o.current, m = i;
647
+ h && m && (h.style.zIndex = getComputedStyle(m).zIndex);
648
+ }, [i]), N(() => {
649
+ const h = i == null ? void 0 : i.id;
650
+ if (!h) return;
651
+ const m = o.current;
652
+ if (m)
653
+ return it(m, h);
654
+ }, [i]);
655
+ const u = rt({
656
+ ref: o,
657
+ store: s,
658
+ role: "presentation",
659
+ "data-backdrop": (i == null ? void 0 : i.id) || "",
660
+ alwaysVisible: r,
661
+ hidden: n ?? void 0,
662
+ style: {
663
+ position: "fixed",
664
+ top: 0,
665
+ right: 0,
666
+ bottom: 0,
667
+ left: 0
668
+ }
669
+ });
670
+ if (!t) return null;
671
+ if (Et(t))
672
+ return /* @__PURE__ */ E(we, F(S({}, u), { render: t }));
673
+ const c = typeof t != "boolean" ? t : "div";
674
+ return /* @__PURE__ */ E(we, F(S({}, u), { render: /* @__PURE__ */ E(c, {}) }));
522
675
  }
523
- function xr(e, t) {
524
- return t ? typeof t == "function" ? t(e) : t : P(e).createElement("div");
676
+ function xr(e = {}) {
677
+ return Bt(e);
525
678
  }
526
- function Fr(e = "id") {
527
- return `${e ? `${e}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
679
+ function Dr(e, t, r) {
680
+ return qt(e, t, r);
528
681
  }
529
- function B(e) {
530
- queueMicrotask(() => {
531
- e == null || e.focus();
532
- });
682
+ function Fr(e = {}) {
683
+ const [t, r] = It(xr, e);
684
+ return Dr(t, r, e);
533
685
  }
534
- var ct = J(function(t) {
535
- var r = t, {
536
- preserveTabOrder: n,
537
- preserveTabOrderAnchor: o,
538
- portalElement: s,
539
- portalRef: i,
540
- portal: u = !0
541
- } = r, c = xe(r, [
542
- "preserveTabOrder",
543
- "preserveTabOrderAnchor",
544
- "portalElement",
545
- "portalRef",
546
- "portal"
547
- ]);
548
- const h = N(null), m = et(h, c.ref), O = Oe(Ge), [f, V] = X(null), [$, I] = X(
549
- null
550
- ), k = N(null), M = N(null), G = N(null), T = N(null);
551
- return H(() => {
552
- const l = h.current;
553
- if (!l || !u) {
554
- V(null);
555
- return;
556
- }
557
- const b = xr(l, s);
558
- if (!b) {
559
- V(null);
560
- return;
561
- }
562
- const v = b.isConnected;
563
- if (v || (O || Dr(l)).appendChild(b), b.id || (b.id = l.id ? `portal/${l.id}` : Fr()), V(b), je(i, b), !v)
564
- return () => {
565
- b.remove(), je(i, null);
566
- };
567
- }, [u, s, O, i]), H(() => {
568
- if (!u || !n || !o) return;
569
- const b = P(o).createElement("span");
570
- return b.style.position = "fixed", o.insertAdjacentElement("afterend", b), I(b), () => {
571
- b.remove(), I(null);
572
- };
573
- }, [u, n, o]), x(() => {
574
- if (!f || !n) return;
575
- let l = 0;
576
- const b = (v) => {
577
- if (!te(v)) return;
578
- const d = v.type === "focusin";
579
- if (cancelAnimationFrame(l), d)
580
- return xt(f);
581
- l = requestAnimationFrame(() => {
582
- Ft(f, !0);
583
- });
584
- };
585
- return f.addEventListener("focusin", b, !0), f.addEventListener("focusout", b, !0), () => {
586
- cancelAnimationFrame(l), f.removeEventListener("focusin", b, !0), f.removeEventListener("focusout", b, !0);
587
- };
588
- }, [f, n]), c = U(
589
- c,
590
- (l) => {
591
- if (l = // While the portal node is not in the DOM, we need to pass the
592
- // current context to the portal context, otherwise it's going to
593
- // reset to the body element on nested portals.
594
- /* @__PURE__ */ E(Ge.Provider, { value: f || O, children: l }), !u) return l;
595
- if (!f)
596
- return /* @__PURE__ */ E(
597
- "span",
598
- {
599
- ref: m,
600
- id: c.id,
601
- style: { position: "fixed" },
602
- hidden: !0
603
- }
604
- );
605
- l = /* @__PURE__ */ le(fe, { children: [
606
- n && f && /* @__PURE__ */ E(
607
- ce,
608
- {
609
- ref: M,
610
- "data-focus-trap": c.id,
611
- className: "__focus-trap-inner-before",
612
- onFocus: (v) => {
613
- te(v, f) ? B(he()) : B(k.current);
614
- }
615
- }
616
- ),
617
- l,
618
- n && f && /* @__PURE__ */ E(
619
- ce,
620
- {
621
- ref: G,
622
- "data-focus-trap": c.id,
623
- className: "__focus-trap-inner-after",
624
- onFocus: (v) => {
625
- te(v, f) ? B(We()) : B(T.current);
626
- }
627
- }
628
- )
629
- ] }), f && (l = Ye(l, f));
630
- let b = /* @__PURE__ */ le(fe, { children: [
631
- n && f && /* @__PURE__ */ E(
632
- ce,
633
- {
634
- ref: k,
635
- "data-focus-trap": c.id,
636
- className: "__focus-trap-outer-before",
637
- onFocus: (v) => {
638
- !(v.relatedTarget === T.current) && te(v, f) ? B(M.current) : B(We());
639
- }
640
- }
641
- ),
642
- n && // We're using position: fixed here so that the browser doesn't
643
- // add margin to the element when setting gap on a parent element.
644
- /* @__PURE__ */ E("span", { "aria-owns": f == null ? void 0 : f.id, style: { position: "fixed" } }),
645
- n && f && /* @__PURE__ */ E(
646
- ce,
647
- {
648
- ref: T,
649
- "data-focus-trap": c.id,
650
- className: "__focus-trap-outer-after",
651
- onFocus: (v) => {
652
- if (te(v, f))
653
- B(G.current);
654
- else {
655
- const d = he();
656
- if (d === M.current) {
657
- requestAnimationFrame(() => {
658
- var oe;
659
- return (oe = he()) == null ? void 0 : oe.focus();
660
- });
661
- return;
662
- }
663
- B(d);
664
- }
665
- }
666
- }
667
- )
668
- ] });
669
- return $ && n && (b = Ye(
670
- b,
671
- $
672
- )), /* @__PURE__ */ le(fe, { children: [
673
- b,
674
- l
675
- ] });
676
- },
677
- [f, O, u, c.id, n, $]
678
- ), c = F(S({}, c), {
679
- ref: m
680
- }), c;
681
- });
682
- W(function(t) {
683
- const r = ct(t);
684
- return K(wr, r);
685
- });
686
- var Or = "div", Ue = Ht();
686
+ var Or = "div", Ue = Mt();
687
687
  function Tr(e) {
688
688
  const t = tt();
689
689
  return !t || e && R(e, t) ? !1 : !!re(t);
@@ -712,7 +712,7 @@ var Ar = J(function(t) {
712
712
  finalFocus: M,
713
713
  unmountOnHide: G,
714
714
  unstable_treeSnapshotKey: T
715
- } = r, l = xe(r, [
715
+ } = r, l = Fe(r, [
716
716
  "store",
717
717
  "open",
718
718
  "onClose",
@@ -731,83 +731,83 @@ var Ar = J(function(t) {
731
731
  "unmountOnHide",
732
732
  "unstable_treeSnapshotKey"
733
733
  ]);
734
- const b = Fe(), v = N(null), d = Gt({
734
+ const b = Te(), g = H(null), d = Fr({
735
735
  store: n || b,
736
736
  open: o,
737
737
  setOpen(a) {
738
738
  if (a) return;
739
- const g = v.current;
740
- if (!g) return;
739
+ const v = g.current;
740
+ if (!v) return;
741
741
  const y = new Event("close", { bubbles: !1, cancelable: !0 });
742
- s && g.addEventListener("close", s, { once: !0 }), g.dispatchEvent(y), y.defaultPrevented && d.setOpen(!0);
742
+ s && v.addEventListener("close", s, { once: !0 }), v.dispatchEvent(y), y.defaultPrevented && d.setOpen(!0);
743
743
  }
744
- }), { portalRef: oe, domReady: w } = Ot(c, l.portalRef), lt = l.preserveTabOrder, pe = q(
744
+ }), { portalRef: oe, domReady: w } = At(c, l.portalRef), lt = l.preserveTabOrder, pe = q(
745
745
  d,
746
746
  (a) => lt && !u && a.mounted
747
- ), _ = Tt(l.id), A = q(d, "open"), C = q(d, "mounted"), Y = q(d, "contentElement"), ft = $t(C, l.hidden, l.alwaysVisible);
748
- lr(Y, _, V && !ft), hr(d, O, w);
749
- const { wrapElement: _e, nestedDialogs: Le } = fr(d);
750
- l = U(l, _e, [_e]), H(() => {
747
+ ), _ = Ct(l.id), A = q(d, "open"), C = q(d, "mounted"), Y = q(d, "contentElement"), ft = Wt(C, l.hidden, l.alwaysVisible);
748
+ br(Y, _, V && !ft), pr(d, O, w);
749
+ const { wrapElement: _e, nestedDialogs: Le } = vr(d);
750
+ l = U(l, _e, [_e]), N(() => {
751
751
  if (!A) return;
752
- const a = v.current, g = tt(a, !0);
753
- g && g.tagName !== "BODY" && (a && R(a, g) || d.setDisclosureElement(g));
754
- }, [d, A]), Ue && x(() => {
752
+ const a = g.current, v = tt(a, !0);
753
+ v && v.tagName !== "BODY" && (a && R(a, v) || d.setDisclosureElement(v));
754
+ }, [d, A]), Ue && D(() => {
755
755
  if (!C) return;
756
756
  const { disclosureElement: a } = d.getState();
757
- if (!a || !At(a)) return;
758
- const g = () => {
757
+ if (!a || !Rt(a)) return;
758
+ const v = () => {
759
759
  let y = !1;
760
760
  const p = () => {
761
761
  y = !0;
762
- }, D = { capture: !0, once: !0 };
763
- a.addEventListener("focusin", p, D), _t(a, "mouseup", () => {
764
- a.removeEventListener("focusin", p, !0), !y && Lt(a);
762
+ }, x = { capture: !0, once: !0 };
763
+ a.addEventListener("focusin", p, x), Ht(a, "mouseup", () => {
764
+ a.removeEventListener("focusin", p, !0), !y && Nt(a);
765
765
  });
766
766
  };
767
- return a.addEventListener("mousedown", g), () => {
768
- a.removeEventListener("mousedown", g);
767
+ return a.addEventListener("mousedown", v), () => {
768
+ a.removeEventListener("mousedown", v);
769
769
  };
770
- }, [d, C]), x(() => {
770
+ }, [d, C]), D(() => {
771
771
  if (!C || !w) return;
772
- const a = v.current;
772
+ const a = g.current;
773
773
  if (!a) return;
774
- const g = Je(a), y = g.visualViewport || g, p = () => {
775
- var D, L;
776
- const ee = (L = (D = g.visualViewport) == null ? void 0 : D.height) != null ? L : g.innerHeight;
774
+ const v = et(a), y = v.visualViewport || v, p = () => {
775
+ var x, L;
776
+ const ee = (L = (x = v.visualViewport) == null ? void 0 : x.height) != null ? L : v.innerHeight;
777
777
  a.style.setProperty("--dialog-viewport-height", `${ee}px`);
778
778
  };
779
779
  return p(), y.addEventListener("resize", p), () => {
780
780
  y.removeEventListener("resize", p);
781
781
  };
782
- }, [C, w]), x(() => {
782
+ }, [C, w]), D(() => {
783
783
  if (!u || !C || !w) return;
784
- const a = v.current;
784
+ const a = g.current;
785
785
  if (!(!a || a.querySelector("[data-dialog-dismiss]")))
786
- return br(a, d.hide);
787
- }, [d, u, C, w]), H(() => {
788
- if (!st() || A || !C || !w) return;
789
- const a = v.current;
786
+ return rr(a, d.hide);
787
+ }, [d, u, C, w]), N(() => {
788
+ if (!at() || A || !C || !w) return;
789
+ const a = g.current;
790
790
  if (a)
791
- return ut(a);
791
+ return ct(a);
792
792
  }, [A, C, w]);
793
793
  const se = A && w;
794
- H(() => {
794
+ N(() => {
795
795
  if (!_ || !se) return;
796
- const a = v.current;
797
- return er(_, [a]);
796
+ const a = g.current;
797
+ return ar(_, [a]);
798
798
  }, [_, se, T]);
799
799
  const He = Qe(f);
800
- H(() => {
800
+ N(() => {
801
801
  if (!_ || !se) return;
802
- const { disclosureElement: a } = d.getState(), g = v.current, y = He() || [], p = [
803
- g,
802
+ const { disclosureElement: a } = d.getState(), v = g.current, y = He() || [], p = [
803
+ v,
804
804
  ...y,
805
- ...Le.map((D) => D.getState().contentElement)
805
+ ...Le.map((x) => x.getState().contentElement)
806
806
  ];
807
- return u ? j(
808
- Xe(_, p),
809
- ir(_, p)
810
- ) : Xe(_, [a, ...p]);
807
+ return u ? W(
808
+ Ke(_, p),
809
+ yr(_, p)
810
+ ) : Ke(_, [a, ...p]);
811
811
  }, [
812
812
  _,
813
813
  d,
@@ -818,7 +818,7 @@ var Ar = J(function(t) {
818
818
  T
819
819
  ]);
820
820
  const Ne = !!$, Me = be($), [dt, pt] = X(!1);
821
- x(() => {
821
+ D(() => {
822
822
  if (!A || !Ne || !w || !(Y != null && Y.isConnected)) return;
823
823
  const a = Ze(k, !0) || // If no initial focus is specified, we try to focus the first element
824
824
  // with the autofocus attribute. If it's an Ariakit component, the
@@ -830,10 +830,10 @@ var Ar = J(function(t) {
830
830
  // dialogs with preserveTabOrder set to true will not receive focus
831
831
  // properly because the elements aren't tabbable until the dialog receives
832
832
  // focus.
833
- Ct(Y, !0, c && pe) || // Finally, we fallback to the dialog element itself.
834
- Y, g = re(a);
835
- Me(g ? a : null) && (pt(!0), queueMicrotask(() => {
836
- a.focus(), Ue && a.scrollIntoView({ block: "nearest", inline: "nearest" });
833
+ _t(Y, !0, c && pe) || // Finally, we fallback to the dialog element itself.
834
+ Y, v = re(a);
835
+ Me(v ? a : null) && (pt(!0), queueMicrotask(() => {
836
+ a.focus(), Ue && v && a.scrollIntoView({ block: "nearest", inline: "nearest" });
837
837
  }));
838
838
  }, [
839
839
  A,
@@ -846,12 +846,12 @@ var Ar = J(function(t) {
846
846
  Me
847
847
  ]);
848
848
  const ue = !!I, Ve = be(I), [ie, $e] = X(!1);
849
- x(() => {
849
+ D(() => {
850
850
  if (A)
851
851
  return $e(!0), () => $e(!1);
852
852
  }, [A]);
853
853
  const Q = de(
854
- (a, g = !0) => {
854
+ (a, v = !0) => {
855
855
  const { disclosureElement: y } = d.getState();
856
856
  if (Tr(a)) return;
857
857
  let p = Ze(M) || y;
@@ -866,22 +866,22 @@ var Ar = J(function(t) {
866
866
  qe && (p = qe);
867
867
  }
868
868
  }
869
- const D = p && re(p);
870
- if (!D && g) {
869
+ const x = p && re(p);
870
+ if (!x && v) {
871
871
  requestAnimationFrame(() => Q(a, !1));
872
872
  return;
873
873
  }
874
- Ve(D ? p : null) && D && (p == null || p.focus());
874
+ Ve(x ? p : null) && x && (p == null || p.focus({ preventScroll: !0 }));
875
875
  },
876
876
  [d, M, Ve]
877
- ), ve = N(!1);
878
- H(() => {
877
+ ), ve = H(!1);
878
+ N(() => {
879
879
  if (A || !ie || !ue) return;
880
- const a = v.current;
880
+ const a = g.current;
881
881
  ve.current = !0, Q(a);
882
- }, [A, ie, w, ue, Q]), x(() => {
882
+ }, [A, ie, w, ue, Q]), D(() => {
883
883
  if (!ie || !ue) return;
884
- const a = v.current;
884
+ const a = g.current;
885
885
  return () => {
886
886
  if (ve.current) {
887
887
  ve.current = !1;
@@ -891,17 +891,17 @@ var Ar = J(function(t) {
891
891
  };
892
892
  }, [ie, ue, Q]);
893
893
  const Ie = be(m);
894
- x(() => !w || !C ? void 0 : De("keydown", (g) => {
895
- if (g.key !== "Escape" || g.defaultPrevented) return;
896
- const y = v.current;
894
+ D(() => !w || !C ? void 0 : Oe("keydown", (v) => {
895
+ if (v.key !== "Escape" || v.defaultPrevented) return;
896
+ const y = g.current;
897
897
  if (!y || Re(y)) return;
898
- const p = g.target;
898
+ const p = v.target;
899
899
  if (!p) return;
900
- const { disclosureElement: D } = d.getState();
901
- !!(p.tagName === "BODY" || R(y, p) || !D || R(D, p)) && Ie(g) && d.hide();
900
+ const { disclosureElement: x } = d.getState();
901
+ !!(p.tagName === "BODY" || R(y, p) || !x || R(x, p)) && Ie(v) && d.hide();
902
902
  }, !0), [d, w, C, Ie]), l = U(
903
903
  l,
904
- (a) => /* @__PURE__ */ E(Er, { level: u ? 1 : void 0, children: a }),
904
+ (a) => /* @__PURE__ */ E(er, { level: u ? 1 : void 0, children: a }),
905
905
  [u]
906
906
  );
907
907
  const ke = l.hidden, Be = l.alwaysVisible;
@@ -909,7 +909,7 @@ var Ar = J(function(t) {
909
909
  l,
910
910
  (a) => h ? /* @__PURE__ */ le(fe, { children: [
911
911
  /* @__PURE__ */ E(
912
- or,
912
+ wr,
913
913
  {
914
914
  store: d,
915
915
  backdrop: h,
@@ -924,7 +924,7 @@ var Ar = J(function(t) {
924
924
  const [vt, gt] = X(), [ht, bt] = X();
925
925
  return l = U(
926
926
  l,
927
- (a) => /* @__PURE__ */ E(It, { value: d, children: /* @__PURE__ */ E(kt.Provider, { value: gt, children: /* @__PURE__ */ E(Bt.Provider, { value: bt, children: a }) }) }),
927
+ (a) => /* @__PURE__ */ E(jt, { value: d, children: /* @__PURE__ */ E(Yt.Provider, { value: gt, children: /* @__PURE__ */ E(Xt.Provider, { value: bt, children: a }) }) }),
928
928
  [d]
929
929
  ), l = F(S({
930
930
  id: _,
@@ -934,13 +934,13 @@ var Ar = J(function(t) {
934
934
  "aria-labelledby": vt,
935
935
  "aria-describedby": ht
936
936
  }, l), {
937
- ref: et(v, l.ref)
938
- }), l = it(F(S({}, l), {
937
+ ref: Je(g, l.ref)
938
+ }), l = st(F(S({}, l), {
939
939
  autoFocusOnShow: dt
940
- })), l = rt(S({ store: d }, l)), l = Rt(F(S({}, l), { focusable: i })), l = ct(F(S({ portal: c }, l), { portalRef: oe, preserveTabOrder: pe })), l;
940
+ })), l = rt(S({ store: d }, l)), l = Lt(F(S({}, l), { focusable: i })), l = ot(F(S({ portal: c }, l), { portalRef: oe, preserveTabOrder: pe })), l;
941
941
  });
942
- function Cr(e, t = Fe) {
943
- return W(function(n) {
942
+ function Cr(e, t = Te) {
943
+ return j(function(n) {
944
944
  const o = t(), s = n.store || o;
945
945
  return q(
946
946
  s,
@@ -949,18 +949,18 @@ function Cr(e, t = Fe) {
949
949
  });
950
950
  }
951
951
  var Vr = Cr(
952
- W(function(t) {
952
+ j(function(t) {
953
953
  const r = Ar(t);
954
954
  return K(Or, r);
955
955
  }),
956
- Fe
956
+ Te
957
957
  );
958
958
  export {
959
959
  Vr as D,
960
960
  we as R,
961
- zt as a,
962
- Kt as b,
961
+ Ar as a,
962
+ xr as b,
963
963
  Cr as c,
964
- Ar as d,
965
- Gt as u
964
+ Dr as d,
965
+ Fr as u
966
966
  };