@pdf-viewer/react 0.5.0-beta.2 → 0.5.0-beta.4

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 (53) hide show
  1. package/dist/{RPLayout-fab108d3.js → RPLayout-7fd91861.js} +18 -15
  2. package/dist/components/RPController.js +1 -1
  3. package/dist/components/RPViewer.js +1 -1
  4. package/dist/components/layout/RPLayout.js +1 -1
  5. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  6. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  7. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  8. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  9. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  10. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  11. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  12. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  13. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  14. package/dist/components/layout/toolbar/Paginate.js +1 -1
  15. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  16. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  17. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  18. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  19. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  20. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  21. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  22. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  24. package/dist/components/page/AnnotationLayer.js +1 -1
  25. package/dist/components/page/CanvasLayer.js +1 -1
  26. package/dist/components/page/DualPage.js +1 -1
  27. package/dist/components/page/RPPage.js +1 -1
  28. package/dist/components/page/SinglePage.js +1 -1
  29. package/dist/components/page/TextLayer.js +1 -1
  30. package/dist/components/ui/Checkbox.js +1 -1
  31. package/dist/components/ui/DropDown.js +1 -1
  32. package/dist/components/ui/LoadingIndicator.js +1 -1
  33. package/dist/components/ui/RPTooltip.js +568 -1877
  34. package/dist/contexts/PaginateContext.js +1 -1
  35. package/dist/contexts/PrintContext.js +1 -1
  36. package/dist/contexts/SearchContext.js +1 -1
  37. package/dist/contexts/ThumbnailsContext.js +1 -1
  38. package/dist/contexts/ToolbarComponentContext.js +14 -12
  39. package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
  40. package/dist/index-316854c1.js +2299 -0
  41. package/dist/index-71898eb9.js +139 -0
  42. package/dist/main.js +1 -1
  43. package/dist/utils/hooks/useFileDownload.js +1 -1
  44. package/dist/utils/hooks/useLicense.js +24 -16
  45. package/dist/utils/hooks/usePaginate.js +1 -1
  46. package/dist/utils/hooks/usePrint.js +1 -1
  47. package/dist/utils/hooks/useScrollToPage.js +1 -1
  48. package/dist/utils/hooks/useSearch.js +1 -1
  49. package/dist/utils/hooks/useThumbnail.js +1 -1
  50. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/index-2b077daa.js +0 -122
  53. package/dist/index-8049287f.js +0 -3639
@@ -1,3639 +0,0 @@
1
- import * as a from "react";
2
- import le, { useLayoutEffect as jr, useEffect as Xr, useState as Zr } from "react";
3
- import { jsx as y, Fragment as qr } from "react/jsx-runtime";
4
- import * as wn from "react-dom";
5
- import Qr from "react-dom";
6
- function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
7
- return function(o) {
8
- if (e == null || e(o), n === !1 || !o.defaultPrevented)
9
- return t == null ? void 0 : t(o);
10
- };
11
- }
12
- function Jr(e, t) {
13
- typeof e == "function" ? e(t) : e != null && (e.current = t);
14
- }
15
- function tt(...e) {
16
- return (t) => e.forEach((n) => Jr(n, t));
17
- }
18
- function G(...e) {
19
- return a.useCallback(tt(...e), e);
20
- }
21
- function ea(e, t) {
22
- const n = a.createContext(t), r = (i) => {
23
- const { children: c, ...s } = i, f = a.useMemo(() => s, Object.values(s));
24
- return /* @__PURE__ */ y(n.Provider, { value: f, children: c });
25
- };
26
- r.displayName = e + "Provider";
27
- function o(i) {
28
- const c = a.useContext(n);
29
- if (c)
30
- return c;
31
- if (t !== void 0)
32
- return t;
33
- throw new Error(`\`${i}\` must be used within \`${e}\``);
34
- }
35
- return [r, o];
36
- }
37
- function yn(e, t = []) {
38
- let n = [];
39
- function r(i, c) {
40
- const s = a.createContext(c), f = n.length;
41
- n = [...n, c];
42
- const u = (l) => {
43
- var w;
44
- const { scope: p, children: h, ...v } = l, m = ((w = p == null ? void 0 : p[e]) == null ? void 0 : w[f]) || s, g = a.useMemo(() => v, Object.values(v));
45
- return /* @__PURE__ */ y(m.Provider, { value: g, children: h });
46
- };
47
- u.displayName = i + "Provider";
48
- function d(l, p) {
49
- var m;
50
- const h = ((m = p == null ? void 0 : p[e]) == null ? void 0 : m[f]) || s, v = a.useContext(h);
51
- if (v)
52
- return v;
53
- if (c !== void 0)
54
- return c;
55
- throw new Error(`\`${l}\` must be used within \`${i}\``);
56
- }
57
- return [u, d];
58
- }
59
- const o = () => {
60
- const i = n.map((c) => a.createContext(c));
61
- return function(s) {
62
- const f = (s == null ? void 0 : s[e]) || i;
63
- return a.useMemo(
64
- () => ({ [`__scope${e}`]: { ...s, [e]: f } }),
65
- [s, f]
66
- );
67
- };
68
- };
69
- return o.scopeName = e, [r, eo(o, ...t)];
70
- }
71
- function eo(...e) {
72
- const t = e[0];
73
- if (e.length === 1)
74
- return t;
75
- const n = () => {
76
- const r = e.map((o) => ({
77
- useScope: o(),
78
- scopeName: o.scopeName
79
- }));
80
- return function(i) {
81
- const c = r.reduce((s, { useScope: f, scopeName: u }) => {
82
- const l = f(i)[`__scope${u}`];
83
- return { ...s, ...l };
84
- }, {});
85
- return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
86
- };
87
- };
88
- return n.scopeName = t.scopeName, n;
89
- }
90
- function j(e) {
91
- const t = a.useRef(e);
92
- return a.useEffect(() => {
93
- t.current = e;
94
- }), a.useMemo(() => (...n) => {
95
- var r;
96
- return (r = t.current) == null ? void 0 : r.call(t, ...n);
97
- }, []);
98
- }
99
- function bn({
100
- prop: e,
101
- defaultProp: t,
102
- onChange: n = () => {
103
- }
104
- }) {
105
- const [r, o] = to({ defaultProp: t, onChange: n }), i = e !== void 0, c = i ? e : r, s = j(n), f = a.useCallback(
106
- (u) => {
107
- if (i) {
108
- const l = typeof u == "function" ? u(e) : u;
109
- l !== e && s(l);
110
- } else
111
- o(u);
112
- },
113
- [i, e, o, s]
114
- );
115
- return [c, f];
116
- }
117
- function to({
118
- defaultProp: e,
119
- onChange: t
120
- }) {
121
- const n = a.useState(e), [r] = n, o = a.useRef(r), i = j(t);
122
- return a.useEffect(() => {
123
- o.current !== r && (i(r), o.current = r);
124
- }, [r, o, i]), n;
125
- }
126
- var Oe = a.forwardRef((e, t) => {
127
- const { children: n, ...r } = e, o = a.Children.toArray(n), i = o.find(ro);
128
- if (i) {
129
- const c = i.props.children, s = o.map((f) => f === i ? a.Children.count(c) > 1 ? a.Children.only(null) : a.isValidElement(c) ? c.props.children : null : f);
130
- return /* @__PURE__ */ y(yt, { ...r, ref: t, children: a.isValidElement(c) ? a.cloneElement(c, void 0, s) : null });
131
- }
132
- return /* @__PURE__ */ y(yt, { ...r, ref: t, children: n });
133
- });
134
- Oe.displayName = "Slot";
135
- var yt = a.forwardRef((e, t) => {
136
- const { children: n, ...r } = e;
137
- if (a.isValidElement(n)) {
138
- const o = io(n);
139
- return a.cloneElement(n, {
140
- ...oo(r, n.props),
141
- // @ts-ignore
142
- ref: t ? tt(t, o) : o
143
- });
144
- }
145
- return a.Children.count(n) > 1 ? a.Children.only(null) : null;
146
- });
147
- yt.displayName = "SlotClone";
148
- var no = ({ children: e }) => /* @__PURE__ */ y(qr, { children: e });
149
- function ro(e) {
150
- return a.isValidElement(e) && e.type === no;
151
- }
152
- function oo(e, t) {
153
- const n = { ...t };
154
- for (const r in t) {
155
- const o = e[r], i = t[r];
156
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...s) => {
157
- i(...s), o(...s);
158
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
159
- }
160
- return { ...e, ...n };
161
- }
162
- function io(e) {
163
- var r, o;
164
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
165
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
166
- }
167
- var co = [
168
- "a",
169
- "button",
170
- "div",
171
- "form",
172
- "h2",
173
- "h3",
174
- "img",
175
- "input",
176
- "label",
177
- "li",
178
- "nav",
179
- "ol",
180
- "p",
181
- "span",
182
- "svg",
183
- "ul"
184
- ], U = co.reduce((e, t) => {
185
- const n = a.forwardRef((r, o) => {
186
- const { asChild: i, ...c } = r, s = i ? Oe : t;
187
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ y(s, { ...c, ref: o });
188
- });
189
- return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
190
- }, {});
191
- function xn(e, t) {
192
- e && wn.flushSync(() => e.dispatchEvent(t));
193
- }
194
- function At(e, t = []) {
195
- let n = [];
196
- function r(i, c) {
197
- const s = a.createContext(c), f = n.length;
198
- n = [...n, c];
199
- function u(l) {
200
- const { scope: p, children: h, ...v } = l, m = (p == null ? void 0 : p[e][f]) || s, g = a.useMemo(() => v, Object.values(v));
201
- return /* @__PURE__ */ y(m.Provider, { value: g, children: h });
202
- }
203
- function d(l, p) {
204
- const h = (p == null ? void 0 : p[e][f]) || s, v = a.useContext(h);
205
- if (v)
206
- return v;
207
- if (c !== void 0)
208
- return c;
209
- throw new Error(`\`${l}\` must be used within \`${i}\``);
210
- }
211
- return u.displayName = i + "Provider", [u, d];
212
- }
213
- const o = () => {
214
- const i = n.map((c) => a.createContext(c));
215
- return function(s) {
216
- const f = (s == null ? void 0 : s[e]) || i;
217
- return a.useMemo(
218
- () => ({ [`__scope${e}`]: { ...s, [e]: f } }),
219
- [s, f]
220
- );
221
- };
222
- };
223
- return o.scopeName = e, [r, so(o, ...t)];
224
- }
225
- function so(...e) {
226
- const t = e[0];
227
- if (e.length === 1)
228
- return t;
229
- const n = () => {
230
- const r = e.map((o) => ({
231
- useScope: o(),
232
- scopeName: o.scopeName
233
- }));
234
- return function(i) {
235
- const c = r.reduce((s, { useScope: f, scopeName: u }) => {
236
- const l = f(i)[`__scope${u}`];
237
- return { ...s, ...l };
238
- }, {});
239
- return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
240
- };
241
- };
242
- return n.scopeName = t.scopeName, n;
243
- }
244
- function Cn(e) {
245
- const t = e + "CollectionProvider", [n, r] = At(t), [o, i] = n(
246
- t,
247
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
248
- ), c = (h) => {
249
- const { scope: v, children: m } = h, g = le.useRef(null), w = le.useRef(/* @__PURE__ */ new Map()).current;
250
- return /* @__PURE__ */ y(o, { scope: v, itemMap: w, collectionRef: g, children: m });
251
- };
252
- c.displayName = t;
253
- const s = e + "CollectionSlot", f = le.forwardRef(
254
- (h, v) => {
255
- const { scope: m, children: g } = h, w = i(s, m), b = G(v, w.collectionRef);
256
- return /* @__PURE__ */ y(Oe, { ref: b, children: g });
257
- }
258
- );
259
- f.displayName = s;
260
- const u = e + "CollectionItemSlot", d = "data-radix-collection-item", l = le.forwardRef(
261
- (h, v) => {
262
- const { scope: m, children: g, ...w } = h, b = le.useRef(null), x = G(v, b), C = i(u, m);
263
- return le.useEffect(() => (C.itemMap.set(b, { ref: b, ...w }), () => void C.itemMap.delete(b))), /* @__PURE__ */ y(Oe, { [d]: "", ref: x, children: g });
264
- }
265
- );
266
- l.displayName = u;
267
- function p(h) {
268
- const v = i(e + "CollectionConsumer", h);
269
- return le.useCallback(() => {
270
- const g = v.collectionRef.current;
271
- if (!g)
272
- return [];
273
- const w = Array.from(g.querySelectorAll(`[${d}]`));
274
- return Array.from(v.itemMap.values()).sort(
275
- (C, E) => w.indexOf(C.ref.current) - w.indexOf(E.ref.current)
276
- );
277
- }, [v.collectionRef, v.itemMap]);
278
- }
279
- return [
280
- { Provider: c, Slot: f, ItemSlot: l },
281
- p,
282
- r
283
- ];
284
- }
285
- var ao = a.createContext(void 0);
286
- function En(e) {
287
- const t = a.useContext(ao);
288
- return e || t || "ltr";
289
- }
290
- function uo(e, t = globalThis == null ? void 0 : globalThis.document) {
291
- const n = j(e);
292
- a.useEffect(() => {
293
- const r = (o) => {
294
- o.key === "Escape" && n(o);
295
- };
296
- return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
297
- }, [n, t]);
298
- }
299
- var lo = "DismissableLayer", bt = "dismissableLayer.update", fo = "dismissableLayer.pointerDownOutside", po = "dismissableLayer.focusOutside", Xt, Sn = a.createContext({
300
- layers: /* @__PURE__ */ new Set(),
301
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
302
- branches: /* @__PURE__ */ new Set()
303
- }), Rn = a.forwardRef(
304
- (e, t) => {
305
- const {
306
- disableOutsidePointerEvents: n = !1,
307
- onEscapeKeyDown: r,
308
- onPointerDownOutside: o,
309
- onFocusOutside: i,
310
- onInteractOutside: c,
311
- onDismiss: s,
312
- ...f
313
- } = e, u = a.useContext(Sn), [d, l] = a.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = a.useState({}), v = G(t, (R) => l(R)), m = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), w = m.indexOf(g), b = d ? m.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= w, E = vo((R) => {
314
- const P = R.target, D = [...u.branches].some((_) => _.contains(P));
315
- !C || D || (o == null || o(R), c == null || c(R), R.defaultPrevented || s == null || s());
316
- }, p), M = go((R) => {
317
- const P = R.target;
318
- [...u.branches].some((_) => _.contains(P)) || (i == null || i(R), c == null || c(R), R.defaultPrevented || s == null || s());
319
- }, p);
320
- return uo((R) => {
321
- b === u.layers.size - 1 && (r == null || r(R), !R.defaultPrevented && s && (R.preventDefault(), s()));
322
- }, p), a.useEffect(() => {
323
- if (d)
324
- return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (Xt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), Zt(), () => {
325
- n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Xt);
326
- };
327
- }, [d, p, n, u]), a.useEffect(() => () => {
328
- d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), Zt());
329
- }, [d, u]), a.useEffect(() => {
330
- const R = () => h({});
331
- return document.addEventListener(bt, R), () => document.removeEventListener(bt, R);
332
- }, []), /* @__PURE__ */ y(
333
- U.div,
334
- {
335
- ...f,
336
- ref: v,
337
- style: {
338
- pointerEvents: x ? C ? "auto" : "none" : void 0,
339
- ...e.style
340
- },
341
- onFocusCapture: O(e.onFocusCapture, M.onFocusCapture),
342
- onBlurCapture: O(e.onBlurCapture, M.onBlurCapture),
343
- onPointerDownCapture: O(
344
- e.onPointerDownCapture,
345
- E.onPointerDownCapture
346
- )
347
- }
348
- );
349
- }
350
- );
351
- Rn.displayName = lo;
352
- var mo = "DismissableLayerBranch", ho = a.forwardRef((e, t) => {
353
- const n = a.useContext(Sn), r = a.useRef(null), o = G(t, r);
354
- return a.useEffect(() => {
355
- const i = r.current;
356
- if (i)
357
- return n.branches.add(i), () => {
358
- n.branches.delete(i);
359
- };
360
- }, [n.branches]), /* @__PURE__ */ y(U.div, { ...e, ref: o });
361
- });
362
- ho.displayName = mo;
363
- function vo(e, t = globalThis == null ? void 0 : globalThis.document) {
364
- const n = j(e), r = a.useRef(!1), o = a.useRef(() => {
365
- });
366
- return a.useEffect(() => {
367
- const i = (s) => {
368
- if (s.target && !r.current) {
369
- let f = function() {
370
- Mn(
371
- fo,
372
- n,
373
- u,
374
- { discrete: !0 }
375
- );
376
- };
377
- const u = { originalEvent: s };
378
- s.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = f, t.addEventListener("click", o.current, { once: !0 })) : f();
379
- } else
380
- t.removeEventListener("click", o.current);
381
- r.current = !1;
382
- }, c = window.setTimeout(() => {
383
- t.addEventListener("pointerdown", i);
384
- }, 0);
385
- return () => {
386
- window.clearTimeout(c), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
387
- };
388
- }, [t, n]), {
389
- // ensures we check React component tree (not just DOM tree)
390
- onPointerDownCapture: () => r.current = !0
391
- };
392
- }
393
- function go(e, t = globalThis == null ? void 0 : globalThis.document) {
394
- const n = j(e), r = a.useRef(!1);
395
- return a.useEffect(() => {
396
- const o = (i) => {
397
- i.target && !r.current && Mn(po, n, { originalEvent: i }, {
398
- discrete: !1
399
- });
400
- };
401
- return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
402
- }, [t, n]), {
403
- onFocusCapture: () => r.current = !0,
404
- onBlurCapture: () => r.current = !1
405
- };
406
- }
407
- function Zt() {
408
- const e = new CustomEvent(bt);
409
- document.dispatchEvent(e);
410
- }
411
- function Mn(e, t, n, { discrete: r }) {
412
- const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
413
- t && o.addEventListener(e, t, { once: !0 }), r ? xn(o, i) : o.dispatchEvent(i);
414
- }
415
- var ut = 0;
416
- function wo() {
417
- a.useEffect(() => {
418
- const e = document.querySelectorAll("[data-radix-focus-guard]");
419
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? qt()), document.body.insertAdjacentElement("beforeend", e[1] ?? qt()), ut++, () => {
420
- ut === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ut--;
421
- };
422
- }, []);
423
- }
424
- function qt() {
425
- const e = document.createElement("span");
426
- return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
427
- }
428
- var lt = "focusScope.autoFocusOnMount", ft = "focusScope.autoFocusOnUnmount", Qt = { bubbles: !1, cancelable: !0 }, yo = "FocusScope", Pn = a.forwardRef((e, t) => {
429
- const {
430
- loop: n = !1,
431
- trapped: r = !1,
432
- onMountAutoFocus: o,
433
- onUnmountAutoFocus: i,
434
- ...c
435
- } = e, [s, f] = a.useState(null), u = j(o), d = j(i), l = a.useRef(null), p = G(t, (m) => f(m)), h = a.useRef({
436
- paused: !1,
437
- pause() {
438
- this.paused = !0;
439
- },
440
- resume() {
441
- this.paused = !1;
442
- }
443
- }).current;
444
- a.useEffect(() => {
445
- if (r) {
446
- let m = function(x) {
447
- if (h.paused || !s)
448
- return;
449
- const C = x.target;
450
- s.contains(C) ? l.current = C : ie(l.current, { select: !0 });
451
- }, g = function(x) {
452
- if (h.paused || !s)
453
- return;
454
- const C = x.relatedTarget;
455
- C !== null && (s.contains(C) || ie(l.current, { select: !0 }));
456
- }, w = function(x) {
457
- if (document.activeElement === document.body)
458
- for (const E of x)
459
- E.removedNodes.length > 0 && ie(s);
460
- };
461
- document.addEventListener("focusin", m), document.addEventListener("focusout", g);
462
- const b = new MutationObserver(w);
463
- return s && b.observe(s, { childList: !0, subtree: !0 }), () => {
464
- document.removeEventListener("focusin", m), document.removeEventListener("focusout", g), b.disconnect();
465
- };
466
- }
467
- }, [r, s, h.paused]), a.useEffect(() => {
468
- if (s) {
469
- en.add(h);
470
- const m = document.activeElement;
471
- if (!s.contains(m)) {
472
- const w = new CustomEvent(lt, Qt);
473
- s.addEventListener(lt, u), s.dispatchEvent(w), w.defaultPrevented || (bo(Ro(An(s)), { select: !0 }), document.activeElement === m && ie(s));
474
- }
475
- return () => {
476
- s.removeEventListener(lt, u), setTimeout(() => {
477
- const w = new CustomEvent(ft, Qt);
478
- s.addEventListener(ft, d), s.dispatchEvent(w), w.defaultPrevented || ie(m ?? document.body, { select: !0 }), s.removeEventListener(ft, d), en.remove(h);
479
- }, 0);
480
- };
481
- }
482
- }, [s, u, d, h]);
483
- const v = a.useCallback(
484
- (m) => {
485
- if (!n && !r || h.paused)
486
- return;
487
- const g = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, w = document.activeElement;
488
- if (g && w) {
489
- const b = m.currentTarget, [x, C] = xo(b);
490
- x && C ? !m.shiftKey && w === C ? (m.preventDefault(), n && ie(x, { select: !0 })) : m.shiftKey && w === x && (m.preventDefault(), n && ie(C, { select: !0 })) : w === b && m.preventDefault();
491
- }
492
- },
493
- [n, r, h.paused]
494
- );
495
- return /* @__PURE__ */ y(U.div, { tabIndex: -1, ...c, ref: p, onKeyDown: v });
496
- });
497
- Pn.displayName = yo;
498
- function bo(e, { select: t = !1 } = {}) {
499
- const n = document.activeElement;
500
- for (const r of e)
501
- if (ie(r, { select: t }), document.activeElement !== n)
502
- return;
503
- }
504
- function xo(e) {
505
- const t = An(e), n = Jt(t, e), r = Jt(t.reverse(), e);
506
- return [n, r];
507
- }
508
- function An(e) {
509
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
510
- acceptNode: (r) => {
511
- const o = r.tagName === "INPUT" && r.type === "hidden";
512
- return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
513
- }
514
- });
515
- for (; n.nextNode(); )
516
- t.push(n.currentNode);
517
- return t;
518
- }
519
- function Jt(e, t) {
520
- for (const n of e)
521
- if (!Co(n, { upTo: t }))
522
- return n;
523
- }
524
- function Co(e, { upTo: t }) {
525
- if (getComputedStyle(e).visibility === "hidden")
526
- return !0;
527
- for (; e; ) {
528
- if (t !== void 0 && e === t)
529
- return !1;
530
- if (getComputedStyle(e).display === "none")
531
- return !0;
532
- e = e.parentElement;
533
- }
534
- return !1;
535
- }
536
- function Eo(e) {
537
- return e instanceof HTMLInputElement && "select" in e;
538
- }
539
- function ie(e, { select: t = !1 } = {}) {
540
- if (e && e.focus) {
541
- const n = document.activeElement;
542
- e.focus({ preventScroll: !0 }), e !== n && Eo(e) && t && e.select();
543
- }
544
- }
545
- var en = So();
546
- function So() {
547
- let e = [];
548
- return {
549
- add(t) {
550
- const n = e[0];
551
- t !== n && (n == null || n.pause()), e = tn(e, t), e.unshift(t);
552
- },
553
- remove(t) {
554
- var n;
555
- e = tn(e, t), (n = e[0]) == null || n.resume();
556
- }
557
- };
558
- }
559
- function tn(e, t) {
560
- const n = [...e], r = n.indexOf(t);
561
- return r !== -1 && n.splice(r, 1), n;
562
- }
563
- function Ro(e) {
564
- return e.filter((t) => t.tagName !== "A");
565
- }
566
- var fe = globalThis != null && globalThis.document ? a.useLayoutEffect : () => {
567
- }, Mo = a["useId".toString()] || (() => {
568
- }), Po = 0;
569
- function xt(e) {
570
- const [t, n] = a.useState(Mo());
571
- return fe(() => {
572
- e || n((r) => r ?? String(Po++));
573
- }, [e]), e || (t ? `radix-${t}` : "");
574
- }
575
- const Ao = ["top", "right", "bottom", "left"], ce = Math.min, H = Math.max, Xe = Math.round, We = Math.floor, J = (e) => ({
576
- x: e,
577
- y: e
578
- }), Oo = {
579
- left: "right",
580
- right: "left",
581
- bottom: "top",
582
- top: "bottom"
583
- }, _o = {
584
- start: "end",
585
- end: "start"
586
- };
587
- function Ct(e, t, n) {
588
- return H(e, ce(t, n));
589
- }
590
- function re(e, t) {
591
- return typeof e == "function" ? e(t) : e;
592
- }
593
- function oe(e) {
594
- return e.split("-")[0];
595
- }
596
- function xe(e) {
597
- return e.split("-")[1];
598
- }
599
- function Ot(e) {
600
- return e === "x" ? "y" : "x";
601
- }
602
- function _t(e) {
603
- return e === "y" ? "height" : "width";
604
- }
605
- function se(e) {
606
- return ["top", "bottom"].includes(oe(e)) ? "y" : "x";
607
- }
608
- function Tt(e) {
609
- return Ot(se(e));
610
- }
611
- function To(e, t, n) {
612
- n === void 0 && (n = !1);
613
- const r = xe(e), o = Tt(e), i = _t(o);
614
- let c = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
615
- return t.reference[i] > t.floating[i] && (c = Ze(c)), [c, Ze(c)];
616
- }
617
- function Do(e) {
618
- const t = Ze(e);
619
- return [Et(e), t, Et(t)];
620
- }
621
- function Et(e) {
622
- return e.replace(/start|end/g, (t) => _o[t]);
623
- }
624
- function Io(e, t, n) {
625
- const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], c = ["bottom", "top"];
626
- switch (e) {
627
- case "top":
628
- case "bottom":
629
- return n ? t ? o : r : t ? r : o;
630
- case "left":
631
- case "right":
632
- return t ? i : c;
633
- default:
634
- return [];
635
- }
636
- }
637
- function No(e, t, n, r) {
638
- const o = xe(e);
639
- let i = Io(oe(e), n === "start", r);
640
- return o && (i = i.map((c) => c + "-" + o), t && (i = i.concat(i.map(Et)))), i;
641
- }
642
- function Ze(e) {
643
- return e.replace(/left|right|bottom|top/g, (t) => Oo[t]);
644
- }
645
- function Lo(e) {
646
- return {
647
- top: 0,
648
- right: 0,
649
- bottom: 0,
650
- left: 0,
651
- ...e
652
- };
653
- }
654
- function On(e) {
655
- return typeof e != "number" ? Lo(e) : {
656
- top: e,
657
- right: e,
658
- bottom: e,
659
- left: e
660
- };
661
- }
662
- function qe(e) {
663
- const {
664
- x: t,
665
- y: n,
666
- width: r,
667
- height: o
668
- } = e;
669
- return {
670
- width: r,
671
- height: o,
672
- top: n,
673
- left: t,
674
- right: t + r,
675
- bottom: n + o,
676
- x: t,
677
- y: n
678
- };
679
- }
680
- function nn(e, t, n) {
681
- let {
682
- reference: r,
683
- floating: o
684
- } = e;
685
- const i = se(t), c = Tt(t), s = _t(c), f = oe(t), u = i === "y", d = r.x + r.width / 2 - o.width / 2, l = r.y + r.height / 2 - o.height / 2, p = r[s] / 2 - o[s] / 2;
686
- let h;
687
- switch (f) {
688
- case "top":
689
- h = {
690
- x: d,
691
- y: r.y - o.height
692
- };
693
- break;
694
- case "bottom":
695
- h = {
696
- x: d,
697
- y: r.y + r.height
698
- };
699
- break;
700
- case "right":
701
- h = {
702
- x: r.x + r.width,
703
- y: l
704
- };
705
- break;
706
- case "left":
707
- h = {
708
- x: r.x - o.width,
709
- y: l
710
- };
711
- break;
712
- default:
713
- h = {
714
- x: r.x,
715
- y: r.y
716
- };
717
- }
718
- switch (xe(t)) {
719
- case "start":
720
- h[c] -= p * (n && u ? -1 : 1);
721
- break;
722
- case "end":
723
- h[c] += p * (n && u ? -1 : 1);
724
- break;
725
- }
726
- return h;
727
- }
728
- const Fo = async (e, t, n) => {
729
- const {
730
- placement: r = "bottom",
731
- strategy: o = "absolute",
732
- middleware: i = [],
733
- platform: c
734
- } = n, s = i.filter(Boolean), f = await (c.isRTL == null ? void 0 : c.isRTL(t));
735
- let u = await c.getElementRects({
736
- reference: e,
737
- floating: t,
738
- strategy: o
739
- }), {
740
- x: d,
741
- y: l
742
- } = nn(u, r, f), p = r, h = {}, v = 0;
743
- for (let m = 0; m < s.length; m++) {
744
- const {
745
- name: g,
746
- fn: w
747
- } = s[m], {
748
- x: b,
749
- y: x,
750
- data: C,
751
- reset: E
752
- } = await w({
753
- x: d,
754
- y: l,
755
- initialPlacement: r,
756
- placement: p,
757
- strategy: o,
758
- middlewareData: h,
759
- rects: u,
760
- platform: c,
761
- elements: {
762
- reference: e,
763
- floating: t
764
- }
765
- });
766
- d = b ?? d, l = x ?? l, h = {
767
- ...h,
768
- [g]: {
769
- ...h[g],
770
- ...C
771
- }
772
- }, E && v <= 50 && (v++, typeof E == "object" && (E.placement && (p = E.placement), E.rects && (u = E.rects === !0 ? await c.getElementRects({
773
- reference: e,
774
- floating: t,
775
- strategy: o
776
- }) : E.rects), {
777
- x: d,
778
- y: l
779
- } = nn(u, p, f)), m = -1);
780
- }
781
- return {
782
- x: d,
783
- y: l,
784
- placement: p,
785
- strategy: o,
786
- middlewareData: h
787
- };
788
- };
789
- async function _e(e, t) {
790
- var n;
791
- t === void 0 && (t = {});
792
- const {
793
- x: r,
794
- y: o,
795
- platform: i,
796
- rects: c,
797
- elements: s,
798
- strategy: f
799
- } = e, {
800
- boundary: u = "clippingAncestors",
801
- rootBoundary: d = "viewport",
802
- elementContext: l = "floating",
803
- altBoundary: p = !1,
804
- padding: h = 0
805
- } = re(t, e), v = On(h), g = s[p ? l === "floating" ? "reference" : "floating" : l], w = qe(await i.getClippingRect({
806
- element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(s.floating)),
807
- boundary: u,
808
- rootBoundary: d,
809
- strategy: f
810
- })), b = l === "floating" ? {
811
- x: r,
812
- y: o,
813
- width: c.floating.width,
814
- height: c.floating.height
815
- } : c.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s.floating)), C = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
816
- x: 1,
817
- y: 1
818
- } : {
819
- x: 1,
820
- y: 1
821
- }, E = qe(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
822
- elements: s,
823
- rect: b,
824
- offsetParent: x,
825
- strategy: f
826
- }) : b);
827
- return {
828
- top: (w.top - E.top + v.top) / C.y,
829
- bottom: (E.bottom - w.bottom + v.bottom) / C.y,
830
- left: (w.left - E.left + v.left) / C.x,
831
- right: (E.right - w.right + v.right) / C.x
832
- };
833
- }
834
- const ko = (e) => ({
835
- name: "arrow",
836
- options: e,
837
- async fn(t) {
838
- const {
839
- x: n,
840
- y: r,
841
- placement: o,
842
- rects: i,
843
- platform: c,
844
- elements: s,
845
- middlewareData: f
846
- } = t, {
847
- element: u,
848
- padding: d = 0
849
- } = re(e, t) || {};
850
- if (u == null)
851
- return {};
852
- const l = On(d), p = {
853
- x: n,
854
- y: r
855
- }, h = Tt(o), v = _t(h), m = await c.getDimensions(u), g = h === "y", w = g ? "top" : "left", b = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", C = i.reference[v] + i.reference[h] - p[h] - i.floating[v], E = p[h] - i.reference[h], M = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(u));
856
- let R = M ? M[x] : 0;
857
- (!R || !await (c.isElement == null ? void 0 : c.isElement(M))) && (R = s.floating[x] || i.floating[v]);
858
- const P = C / 2 - E / 2, D = R / 2 - m[v] / 2 - 1, _ = ce(l[w], D), F = ce(l[b], D), k = _, N = R - m[v] - F, I = R / 2 - m[v] / 2 + P, B = Ct(k, I, N), T = !f.arrow && xe(o) != null && I !== B && i.reference[v] / 2 - (I < k ? _ : F) - m[v] / 2 < 0, $ = T ? I < k ? I - k : I - N : 0;
859
- return {
860
- [h]: p[h] + $,
861
- data: {
862
- [h]: B,
863
- centerOffset: I - B - $,
864
- ...T && {
865
- alignmentOffset: $
866
- }
867
- },
868
- reset: T
869
- };
870
- }
871
- }), $o = function(e) {
872
- return e === void 0 && (e = {}), {
873
- name: "flip",
874
- options: e,
875
- async fn(t) {
876
- var n, r;
877
- const {
878
- placement: o,
879
- middlewareData: i,
880
- rects: c,
881
- initialPlacement: s,
882
- platform: f,
883
- elements: u
884
- } = t, {
885
- mainAxis: d = !0,
886
- crossAxis: l = !0,
887
- fallbackPlacements: p,
888
- fallbackStrategy: h = "bestFit",
889
- fallbackAxisSideDirection: v = "none",
890
- flipAlignment: m = !0,
891
- ...g
892
- } = re(e, t);
893
- if ((n = i.arrow) != null && n.alignmentOffset)
894
- return {};
895
- const w = oe(o), b = se(s), x = oe(s) === s, C = await (f.isRTL == null ? void 0 : f.isRTL(u.floating)), E = p || (x || !m ? [Ze(s)] : Do(s)), M = v !== "none";
896
- !p && M && E.push(...No(s, m, v, C));
897
- const R = [s, ...E], P = await _e(t, g), D = [];
898
- let _ = ((r = i.flip) == null ? void 0 : r.overflows) || [];
899
- if (d && D.push(P[w]), l) {
900
- const I = To(o, c, C);
901
- D.push(P[I[0]], P[I[1]]);
902
- }
903
- if (_ = [..._, {
904
- placement: o,
905
- overflows: D
906
- }], !D.every((I) => I <= 0)) {
907
- var F, k;
908
- const I = (((F = i.flip) == null ? void 0 : F.index) || 0) + 1, B = R[I];
909
- if (B)
910
- return {
911
- data: {
912
- index: I,
913
- overflows: _
914
- },
915
- reset: {
916
- placement: B
917
- }
918
- };
919
- let T = (k = _.filter(($) => $.overflows[0] <= 0).sort(($, A) => $.overflows[1] - A.overflows[1])[0]) == null ? void 0 : k.placement;
920
- if (!T)
921
- switch (h) {
922
- case "bestFit": {
923
- var N;
924
- const $ = (N = _.filter((A) => {
925
- if (M) {
926
- const S = se(A.placement);
927
- return S === b || // Create a bias to the `y` side axis due to horizontal
928
- // reading directions favoring greater width.
929
- S === "y";
930
- }
931
- return !0;
932
- }).map((A) => [A.placement, A.overflows.filter((S) => S > 0).reduce((S, L) => S + L, 0)]).sort((A, S) => A[1] - S[1])[0]) == null ? void 0 : N[0];
933
- $ && (T = $);
934
- break;
935
- }
936
- case "initialPlacement":
937
- T = s;
938
- break;
939
- }
940
- if (o !== T)
941
- return {
942
- reset: {
943
- placement: T
944
- }
945
- };
946
- }
947
- return {};
948
- }
949
- };
950
- };
951
- function rn(e, t) {
952
- return {
953
- top: e.top - t.height,
954
- right: e.right - t.width,
955
- bottom: e.bottom - t.height,
956
- left: e.left - t.width
957
- };
958
- }
959
- function on(e) {
960
- return Ao.some((t) => e[t] >= 0);
961
- }
962
- const Bo = function(e) {
963
- return e === void 0 && (e = {}), {
964
- name: "hide",
965
- options: e,
966
- async fn(t) {
967
- const {
968
- rects: n
969
- } = t, {
970
- strategy: r = "referenceHidden",
971
- ...o
972
- } = re(e, t);
973
- switch (r) {
974
- case "referenceHidden": {
975
- const i = await _e(t, {
976
- ...o,
977
- elementContext: "reference"
978
- }), c = rn(i, n.reference);
979
- return {
980
- data: {
981
- referenceHiddenOffsets: c,
982
- referenceHidden: on(c)
983
- }
984
- };
985
- }
986
- case "escaped": {
987
- const i = await _e(t, {
988
- ...o,
989
- altBoundary: !0
990
- }), c = rn(i, n.floating);
991
- return {
992
- data: {
993
- escapedOffsets: c,
994
- escaped: on(c)
995
- }
996
- };
997
- }
998
- default:
999
- return {};
1000
- }
1001
- }
1002
- };
1003
- };
1004
- async function Wo(e, t) {
1005
- const {
1006
- placement: n,
1007
- platform: r,
1008
- elements: o
1009
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), c = oe(n), s = xe(n), f = se(n) === "y", u = ["left", "top"].includes(c) ? -1 : 1, d = i && f ? -1 : 1, l = re(t, e);
1010
- let {
1011
- mainAxis: p,
1012
- crossAxis: h,
1013
- alignmentAxis: v
1014
- } = typeof l == "number" ? {
1015
- mainAxis: l,
1016
- crossAxis: 0,
1017
- alignmentAxis: null
1018
- } : {
1019
- mainAxis: l.mainAxis || 0,
1020
- crossAxis: l.crossAxis || 0,
1021
- alignmentAxis: l.alignmentAxis
1022
- };
1023
- return s && typeof v == "number" && (h = s === "end" ? v * -1 : v), f ? {
1024
- x: h * d,
1025
- y: p * u
1026
- } : {
1027
- x: p * u,
1028
- y: h * d
1029
- };
1030
- }
1031
- const Uo = function(e) {
1032
- return e === void 0 && (e = 0), {
1033
- name: "offset",
1034
- options: e,
1035
- async fn(t) {
1036
- var n, r;
1037
- const {
1038
- x: o,
1039
- y: i,
1040
- placement: c,
1041
- middlewareData: s
1042
- } = t, f = await Wo(t, e);
1043
- return c === ((n = s.offset) == null ? void 0 : n.placement) && (r = s.arrow) != null && r.alignmentOffset ? {} : {
1044
- x: o + f.x,
1045
- y: i + f.y,
1046
- data: {
1047
- ...f,
1048
- placement: c
1049
- }
1050
- };
1051
- }
1052
- };
1053
- }, Ko = function(e) {
1054
- return e === void 0 && (e = {}), {
1055
- name: "shift",
1056
- options: e,
1057
- async fn(t) {
1058
- const {
1059
- x: n,
1060
- y: r,
1061
- placement: o
1062
- } = t, {
1063
- mainAxis: i = !0,
1064
- crossAxis: c = !1,
1065
- limiter: s = {
1066
- fn: (g) => {
1067
- let {
1068
- x: w,
1069
- y: b
1070
- } = g;
1071
- return {
1072
- x: w,
1073
- y: b
1074
- };
1075
- }
1076
- },
1077
- ...f
1078
- } = re(e, t), u = {
1079
- x: n,
1080
- y: r
1081
- }, d = await _e(t, f), l = se(oe(o)), p = Ot(l);
1082
- let h = u[p], v = u[l];
1083
- if (i) {
1084
- const g = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", b = h + d[g], x = h - d[w];
1085
- h = Ct(b, h, x);
1086
- }
1087
- if (c) {
1088
- const g = l === "y" ? "top" : "left", w = l === "y" ? "bottom" : "right", b = v + d[g], x = v - d[w];
1089
- v = Ct(b, v, x);
1090
- }
1091
- const m = s.fn({
1092
- ...t,
1093
- [p]: h,
1094
- [l]: v
1095
- });
1096
- return {
1097
- ...m,
1098
- data: {
1099
- x: m.x - n,
1100
- y: m.y - r,
1101
- enabled: {
1102
- [p]: i,
1103
- [l]: c
1104
- }
1105
- }
1106
- };
1107
- }
1108
- };
1109
- }, Go = function(e) {
1110
- return e === void 0 && (e = {}), {
1111
- options: e,
1112
- fn(t) {
1113
- const {
1114
- x: n,
1115
- y: r,
1116
- placement: o,
1117
- rects: i,
1118
- middlewareData: c
1119
- } = t, {
1120
- offset: s = 0,
1121
- mainAxis: f = !0,
1122
- crossAxis: u = !0
1123
- } = re(e, t), d = {
1124
- x: n,
1125
- y: r
1126
- }, l = se(o), p = Ot(l);
1127
- let h = d[p], v = d[l];
1128
- const m = re(s, t), g = typeof m == "number" ? {
1129
- mainAxis: m,
1130
- crossAxis: 0
1131
- } : {
1132
- mainAxis: 0,
1133
- crossAxis: 0,
1134
- ...m
1135
- };
1136
- if (f) {
1137
- const x = p === "y" ? "height" : "width", C = i.reference[p] - i.floating[x] + g.mainAxis, E = i.reference[p] + i.reference[x] - g.mainAxis;
1138
- h < C ? h = C : h > E && (h = E);
1139
- }
1140
- if (u) {
1141
- var w, b;
1142
- const x = p === "y" ? "width" : "height", C = ["top", "left"].includes(oe(o)), E = i.reference[l] - i.floating[x] + (C && ((w = c.offset) == null ? void 0 : w[l]) || 0) + (C ? 0 : g.crossAxis), M = i.reference[l] + i.reference[x] + (C ? 0 : ((b = c.offset) == null ? void 0 : b[l]) || 0) - (C ? g.crossAxis : 0);
1143
- v < E ? v = E : v > M && (v = M);
1144
- }
1145
- return {
1146
- [p]: h,
1147
- [l]: v
1148
- };
1149
- }
1150
- };
1151
- }, Ho = function(e) {
1152
- return e === void 0 && (e = {}), {
1153
- name: "size",
1154
- options: e,
1155
- async fn(t) {
1156
- var n, r;
1157
- const {
1158
- placement: o,
1159
- rects: i,
1160
- platform: c,
1161
- elements: s
1162
- } = t, {
1163
- apply: f = () => {
1164
- },
1165
- ...u
1166
- } = re(e, t), d = await _e(t, u), l = oe(o), p = xe(o), h = se(o) === "y", {
1167
- width: v,
1168
- height: m
1169
- } = i.floating;
1170
- let g, w;
1171
- l === "top" || l === "bottom" ? (g = l, w = p === (await (c.isRTL == null ? void 0 : c.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (w = l, g = p === "end" ? "top" : "bottom");
1172
- const b = m - d.top - d.bottom, x = v - d.left - d.right, C = ce(m - d[g], b), E = ce(v - d[w], x), M = !t.middlewareData.shift;
1173
- let R = C, P = E;
1174
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (P = x), (r = t.middlewareData.shift) != null && r.enabled.y && (R = b), M && !p) {
1175
- const _ = H(d.left, 0), F = H(d.right, 0), k = H(d.top, 0), N = H(d.bottom, 0);
1176
- h ? P = v - 2 * (_ !== 0 || F !== 0 ? _ + F : H(d.left, d.right)) : R = m - 2 * (k !== 0 || N !== 0 ? k + N : H(d.top, d.bottom));
1177
- }
1178
- await f({
1179
- ...t,
1180
- availableWidth: P,
1181
- availableHeight: R
1182
- });
1183
- const D = await c.getDimensions(s.floating);
1184
- return v !== D.width || m !== D.height ? {
1185
- reset: {
1186
- rects: !0
1187
- }
1188
- } : {};
1189
- }
1190
- };
1191
- };
1192
- function nt() {
1193
- return typeof window < "u";
1194
- }
1195
- function Ce(e) {
1196
- return _n(e) ? (e.nodeName || "").toLowerCase() : "#document";
1197
- }
1198
- function V(e) {
1199
- var t;
1200
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1201
- }
1202
- function te(e) {
1203
- var t;
1204
- return (t = (_n(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1205
- }
1206
- function _n(e) {
1207
- return nt() ? e instanceof Node || e instanceof V(e).Node : !1;
1208
- }
1209
- function X(e) {
1210
- return nt() ? e instanceof Element || e instanceof V(e).Element : !1;
1211
- }
1212
- function ee(e) {
1213
- return nt() ? e instanceof HTMLElement || e instanceof V(e).HTMLElement : !1;
1214
- }
1215
- function cn(e) {
1216
- return !nt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof V(e).ShadowRoot;
1217
- }
1218
- function Ne(e) {
1219
- const {
1220
- overflow: t,
1221
- overflowX: n,
1222
- overflowY: r,
1223
- display: o
1224
- } = Z(e);
1225
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
1226
- }
1227
- function Vo(e) {
1228
- return ["table", "td", "th"].includes(Ce(e));
1229
- }
1230
- function rt(e) {
1231
- return [":popover-open", ":modal"].some((t) => {
1232
- try {
1233
- return e.matches(t);
1234
- } catch {
1235
- return !1;
1236
- }
1237
- });
1238
- }
1239
- function Dt(e) {
1240
- const t = It(), n = X(e) ? Z(e) : e;
1241
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
1242
- }
1243
- function zo(e) {
1244
- let t = ae(e);
1245
- for (; ee(t) && !be(t); ) {
1246
- if (Dt(t))
1247
- return t;
1248
- if (rt(t))
1249
- return null;
1250
- t = ae(t);
1251
- }
1252
- return null;
1253
- }
1254
- function It() {
1255
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1256
- }
1257
- function be(e) {
1258
- return ["html", "body", "#document"].includes(Ce(e));
1259
- }
1260
- function Z(e) {
1261
- return V(e).getComputedStyle(e);
1262
- }
1263
- function ot(e) {
1264
- return X(e) ? {
1265
- scrollLeft: e.scrollLeft,
1266
- scrollTop: e.scrollTop
1267
- } : {
1268
- scrollLeft: e.scrollX,
1269
- scrollTop: e.scrollY
1270
- };
1271
- }
1272
- function ae(e) {
1273
- if (Ce(e) === "html")
1274
- return e;
1275
- const t = (
1276
- // Step into the shadow DOM of the parent of a slotted node.
1277
- e.assignedSlot || // DOM Element detected.
1278
- e.parentNode || // ShadowRoot detected.
1279
- cn(e) && e.host || // Fallback.
1280
- te(e)
1281
- );
1282
- return cn(t) ? t.host : t;
1283
- }
1284
- function Tn(e) {
1285
- const t = ae(e);
1286
- return be(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : ee(t) && Ne(t) ? t : Tn(t);
1287
- }
1288
- function Te(e, t, n) {
1289
- var r;
1290
- t === void 0 && (t = []), n === void 0 && (n = !0);
1291
- const o = Tn(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), c = V(o);
1292
- if (i) {
1293
- const s = St(c);
1294
- return t.concat(c, c.visualViewport || [], Ne(o) ? o : [], s && n ? Te(s) : []);
1295
- }
1296
- return t.concat(o, Te(o, [], n));
1297
- }
1298
- function St(e) {
1299
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1300
- }
1301
- function Dn(e) {
1302
- const t = Z(e);
1303
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
1304
- const o = ee(e), i = o ? e.offsetWidth : n, c = o ? e.offsetHeight : r, s = Xe(n) !== i || Xe(r) !== c;
1305
- return s && (n = i, r = c), {
1306
- width: n,
1307
- height: r,
1308
- $: s
1309
- };
1310
- }
1311
- function Nt(e) {
1312
- return X(e) ? e : e.contextElement;
1313
- }
1314
- function we(e) {
1315
- const t = Nt(e);
1316
- if (!ee(t))
1317
- return J(1);
1318
- const n = t.getBoundingClientRect(), {
1319
- width: r,
1320
- height: o,
1321
- $: i
1322
- } = Dn(t);
1323
- let c = (i ? Xe(n.width) : n.width) / r, s = (i ? Xe(n.height) : n.height) / o;
1324
- return (!c || !Number.isFinite(c)) && (c = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1325
- x: c,
1326
- y: s
1327
- };
1328
- }
1329
- const Yo = /* @__PURE__ */ J(0);
1330
- function In(e) {
1331
- const t = V(e);
1332
- return !It() || !t.visualViewport ? Yo : {
1333
- x: t.visualViewport.offsetLeft,
1334
- y: t.visualViewport.offsetTop
1335
- };
1336
- }
1337
- function jo(e, t, n) {
1338
- return t === void 0 && (t = !1), !n || t && n !== V(e) ? !1 : t;
1339
- }
1340
- function de(e, t, n, r) {
1341
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1342
- const o = e.getBoundingClientRect(), i = Nt(e);
1343
- let c = J(1);
1344
- t && (r ? X(r) && (c = we(r)) : c = we(e));
1345
- const s = jo(i, n, r) ? In(i) : J(0);
1346
- let f = (o.left + s.x) / c.x, u = (o.top + s.y) / c.y, d = o.width / c.x, l = o.height / c.y;
1347
- if (i) {
1348
- const p = V(i), h = r && X(r) ? V(r) : r;
1349
- let v = p, m = St(v);
1350
- for (; m && r && h !== v; ) {
1351
- const g = we(m), w = m.getBoundingClientRect(), b = Z(m), x = w.left + (m.clientLeft + parseFloat(b.paddingLeft)) * g.x, C = w.top + (m.clientTop + parseFloat(b.paddingTop)) * g.y;
1352
- f *= g.x, u *= g.y, d *= g.x, l *= g.y, f += x, u += C, v = V(m), m = St(v);
1353
- }
1354
- }
1355
- return qe({
1356
- width: d,
1357
- height: l,
1358
- x: f,
1359
- y: u
1360
- });
1361
- }
1362
- function Lt(e, t) {
1363
- const n = ot(e).scrollLeft;
1364
- return t ? t.left + n : de(te(e)).left + n;
1365
- }
1366
- function Nn(e, t, n) {
1367
- n === void 0 && (n = !1);
1368
- const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
1369
- // RTL <body> scrollbar.
1370
- Lt(e, r)
1371
- )), i = r.top + t.scrollTop;
1372
- return {
1373
- x: o,
1374
- y: i
1375
- };
1376
- }
1377
- function Xo(e) {
1378
- let {
1379
- elements: t,
1380
- rect: n,
1381
- offsetParent: r,
1382
- strategy: o
1383
- } = e;
1384
- const i = o === "fixed", c = te(r), s = t ? rt(t.floating) : !1;
1385
- if (r === c || s && i)
1386
- return n;
1387
- let f = {
1388
- scrollLeft: 0,
1389
- scrollTop: 0
1390
- }, u = J(1);
1391
- const d = J(0), l = ee(r);
1392
- if ((l || !l && !i) && ((Ce(r) !== "body" || Ne(c)) && (f = ot(r)), ee(r))) {
1393
- const h = de(r);
1394
- u = we(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop;
1395
- }
1396
- const p = c && !l && !i ? Nn(c, f, !0) : J(0);
1397
- return {
1398
- width: n.width * u.x,
1399
- height: n.height * u.y,
1400
- x: n.x * u.x - f.scrollLeft * u.x + d.x + p.x,
1401
- y: n.y * u.y - f.scrollTop * u.y + d.y + p.y
1402
- };
1403
- }
1404
- function Zo(e) {
1405
- return Array.from(e.getClientRects());
1406
- }
1407
- function qo(e) {
1408
- const t = te(e), n = ot(e), r = e.ownerDocument.body, o = H(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = H(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1409
- let c = -n.scrollLeft + Lt(e);
1410
- const s = -n.scrollTop;
1411
- return Z(r).direction === "rtl" && (c += H(t.clientWidth, r.clientWidth) - o), {
1412
- width: o,
1413
- height: i,
1414
- x: c,
1415
- y: s
1416
- };
1417
- }
1418
- function Qo(e, t) {
1419
- const n = V(e), r = te(e), o = n.visualViewport;
1420
- let i = r.clientWidth, c = r.clientHeight, s = 0, f = 0;
1421
- if (o) {
1422
- i = o.width, c = o.height;
1423
- const u = It();
1424
- (!u || u && t === "fixed") && (s = o.offsetLeft, f = o.offsetTop);
1425
- }
1426
- return {
1427
- width: i,
1428
- height: c,
1429
- x: s,
1430
- y: f
1431
- };
1432
- }
1433
- function Jo(e, t) {
1434
- const n = de(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = ee(e) ? we(e) : J(1), c = e.clientWidth * i.x, s = e.clientHeight * i.y, f = o * i.x, u = r * i.y;
1435
- return {
1436
- width: c,
1437
- height: s,
1438
- x: f,
1439
- y: u
1440
- };
1441
- }
1442
- function sn(e, t, n) {
1443
- let r;
1444
- if (t === "viewport")
1445
- r = Qo(e, n);
1446
- else if (t === "document")
1447
- r = qo(te(e));
1448
- else if (X(t))
1449
- r = Jo(t, n);
1450
- else {
1451
- const o = In(e);
1452
- r = {
1453
- x: t.x - o.x,
1454
- y: t.y - o.y,
1455
- width: t.width,
1456
- height: t.height
1457
- };
1458
- }
1459
- return qe(r);
1460
- }
1461
- function Ln(e, t) {
1462
- const n = ae(e);
1463
- return n === t || !X(n) || be(n) ? !1 : Z(n).position === "fixed" || Ln(n, t);
1464
- }
1465
- function ei(e, t) {
1466
- const n = t.get(e);
1467
- if (n)
1468
- return n;
1469
- let r = Te(e, [], !1).filter((s) => X(s) && Ce(s) !== "body"), o = null;
1470
- const i = Z(e).position === "fixed";
1471
- let c = i ? ae(e) : e;
1472
- for (; X(c) && !be(c); ) {
1473
- const s = Z(c), f = Dt(c);
1474
- !f && s.position === "fixed" && (o = null), (i ? !f && !o : !f && s.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Ne(c) && !f && Ln(e, c)) ? r = r.filter((d) => d !== c) : o = s, c = ae(c);
1475
- }
1476
- return t.set(e, r), r;
1477
- }
1478
- function ti(e) {
1479
- let {
1480
- element: t,
1481
- boundary: n,
1482
- rootBoundary: r,
1483
- strategy: o
1484
- } = e;
1485
- const c = [...n === "clippingAncestors" ? rt(t) ? [] : ei(t, this._c) : [].concat(n), r], s = c[0], f = c.reduce((u, d) => {
1486
- const l = sn(t, d, o);
1487
- return u.top = H(l.top, u.top), u.right = ce(l.right, u.right), u.bottom = ce(l.bottom, u.bottom), u.left = H(l.left, u.left), u;
1488
- }, sn(t, s, o));
1489
- return {
1490
- width: f.right - f.left,
1491
- height: f.bottom - f.top,
1492
- x: f.left,
1493
- y: f.top
1494
- };
1495
- }
1496
- function ni(e) {
1497
- const {
1498
- width: t,
1499
- height: n
1500
- } = Dn(e);
1501
- return {
1502
- width: t,
1503
- height: n
1504
- };
1505
- }
1506
- function ri(e, t, n) {
1507
- const r = ee(t), o = te(t), i = n === "fixed", c = de(e, !0, i, t);
1508
- let s = {
1509
- scrollLeft: 0,
1510
- scrollTop: 0
1511
- };
1512
- const f = J(0);
1513
- if (r || !r && !i)
1514
- if ((Ce(t) !== "body" || Ne(o)) && (s = ot(t)), r) {
1515
- const p = de(t, !0, i, t);
1516
- f.x = p.x + t.clientLeft, f.y = p.y + t.clientTop;
1517
- } else
1518
- o && (f.x = Lt(o));
1519
- const u = o && !r && !i ? Nn(o, s) : J(0), d = c.left + s.scrollLeft - f.x - u.x, l = c.top + s.scrollTop - f.y - u.y;
1520
- return {
1521
- x: d,
1522
- y: l,
1523
- width: c.width,
1524
- height: c.height
1525
- };
1526
- }
1527
- function dt(e) {
1528
- return Z(e).position === "static";
1529
- }
1530
- function an(e, t) {
1531
- if (!ee(e) || Z(e).position === "fixed")
1532
- return null;
1533
- if (t)
1534
- return t(e);
1535
- let n = e.offsetParent;
1536
- return te(e) === n && (n = n.ownerDocument.body), n;
1537
- }
1538
- function Fn(e, t) {
1539
- const n = V(e);
1540
- if (rt(e))
1541
- return n;
1542
- if (!ee(e)) {
1543
- let o = ae(e);
1544
- for (; o && !be(o); ) {
1545
- if (X(o) && !dt(o))
1546
- return o;
1547
- o = ae(o);
1548
- }
1549
- return n;
1550
- }
1551
- let r = an(e, t);
1552
- for (; r && Vo(r) && dt(r); )
1553
- r = an(r, t);
1554
- return r && be(r) && dt(r) && !Dt(r) ? n : r || zo(e) || n;
1555
- }
1556
- const oi = async function(e) {
1557
- const t = this.getOffsetParent || Fn, n = this.getDimensions, r = await n(e.floating);
1558
- return {
1559
- reference: ri(e.reference, await t(e.floating), e.strategy),
1560
- floating: {
1561
- x: 0,
1562
- y: 0,
1563
- width: r.width,
1564
- height: r.height
1565
- }
1566
- };
1567
- };
1568
- function ii(e) {
1569
- return Z(e).direction === "rtl";
1570
- }
1571
- const ci = {
1572
- convertOffsetParentRelativeRectToViewportRelativeRect: Xo,
1573
- getDocumentElement: te,
1574
- getClippingRect: ti,
1575
- getOffsetParent: Fn,
1576
- getElementRects: oi,
1577
- getClientRects: Zo,
1578
- getDimensions: ni,
1579
- getScale: we,
1580
- isElement: X,
1581
- isRTL: ii
1582
- };
1583
- function si(e, t) {
1584
- let n = null, r;
1585
- const o = te(e);
1586
- function i() {
1587
- var s;
1588
- clearTimeout(r), (s = n) == null || s.disconnect(), n = null;
1589
- }
1590
- function c(s, f) {
1591
- s === void 0 && (s = !1), f === void 0 && (f = 1), i();
1592
- const {
1593
- left: u,
1594
- top: d,
1595
- width: l,
1596
- height: p
1597
- } = e.getBoundingClientRect();
1598
- if (s || t(), !l || !p)
1599
- return;
1600
- const h = We(d), v = We(o.clientWidth - (u + l)), m = We(o.clientHeight - (d + p)), g = We(u), b = {
1601
- rootMargin: -h + "px " + -v + "px " + -m + "px " + -g + "px",
1602
- threshold: H(0, ce(1, f)) || 1
1603
- };
1604
- let x = !0;
1605
- function C(E) {
1606
- const M = E[0].intersectionRatio;
1607
- if (M !== f) {
1608
- if (!x)
1609
- return c();
1610
- M ? c(!1, M) : r = setTimeout(() => {
1611
- c(!1, 1e-7);
1612
- }, 1e3);
1613
- }
1614
- x = !1;
1615
- }
1616
- try {
1617
- n = new IntersectionObserver(C, {
1618
- ...b,
1619
- // Handle <iframe>s
1620
- root: o.ownerDocument
1621
- });
1622
- } catch {
1623
- n = new IntersectionObserver(C, b);
1624
- }
1625
- n.observe(e);
1626
- }
1627
- return c(!0), i;
1628
- }
1629
- function ai(e, t, n, r) {
1630
- r === void 0 && (r = {});
1631
- const {
1632
- ancestorScroll: o = !0,
1633
- ancestorResize: i = !0,
1634
- elementResize: c = typeof ResizeObserver == "function",
1635
- layoutShift: s = typeof IntersectionObserver == "function",
1636
- animationFrame: f = !1
1637
- } = r, u = Nt(e), d = o || i ? [...u ? Te(u) : [], ...Te(t)] : [];
1638
- d.forEach((w) => {
1639
- o && w.addEventListener("scroll", n, {
1640
- passive: !0
1641
- }), i && w.addEventListener("resize", n);
1642
- });
1643
- const l = u && s ? si(u, n) : null;
1644
- let p = -1, h = null;
1645
- c && (h = new ResizeObserver((w) => {
1646
- let [b] = w;
1647
- b && b.target === u && h && (h.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1648
- var x;
1649
- (x = h) == null || x.observe(t);
1650
- })), n();
1651
- }), u && !f && h.observe(u), h.observe(t));
1652
- let v, m = f ? de(e) : null;
1653
- f && g();
1654
- function g() {
1655
- const w = de(e);
1656
- m && (w.x !== m.x || w.y !== m.y || w.width !== m.width || w.height !== m.height) && n(), m = w, v = requestAnimationFrame(g);
1657
- }
1658
- return n(), () => {
1659
- var w;
1660
- d.forEach((b) => {
1661
- o && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1662
- }), l == null || l(), (w = h) == null || w.disconnect(), h = null, f && cancelAnimationFrame(v);
1663
- };
1664
- }
1665
- const ui = Uo, li = Ko, fi = $o, di = Ho, pi = Bo, un = ko, mi = Go, hi = (e, t, n) => {
1666
- const r = /* @__PURE__ */ new Map(), o = {
1667
- platform: ci,
1668
- ...n
1669
- }, i = {
1670
- ...o.platform,
1671
- _c: r
1672
- };
1673
- return Fo(e, t, {
1674
- ...o,
1675
- platform: i
1676
- });
1677
- };
1678
- var ze = typeof document < "u" ? jr : Xr;
1679
- function Qe(e, t) {
1680
- if (e === t)
1681
- return !0;
1682
- if (typeof e != typeof t)
1683
- return !1;
1684
- if (typeof e == "function" && e.toString() === t.toString())
1685
- return !0;
1686
- let n, r, o;
1687
- if (e && t && typeof e == "object") {
1688
- if (Array.isArray(e)) {
1689
- if (n = e.length, n !== t.length)
1690
- return !1;
1691
- for (r = n; r-- !== 0; )
1692
- if (!Qe(e[r], t[r]))
1693
- return !1;
1694
- return !0;
1695
- }
1696
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1697
- return !1;
1698
- for (r = n; r-- !== 0; )
1699
- if (!{}.hasOwnProperty.call(t, o[r]))
1700
- return !1;
1701
- for (r = n; r-- !== 0; ) {
1702
- const i = o[r];
1703
- if (!(i === "_owner" && e.$$typeof) && !Qe(e[i], t[i]))
1704
- return !1;
1705
- }
1706
- return !0;
1707
- }
1708
- return e !== e && t !== t;
1709
- }
1710
- function kn(e) {
1711
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1712
- }
1713
- function ln(e, t) {
1714
- const n = kn(e);
1715
- return Math.round(t * n) / n;
1716
- }
1717
- function pt(e) {
1718
- const t = a.useRef(e);
1719
- return ze(() => {
1720
- t.current = e;
1721
- }), t;
1722
- }
1723
- function vi(e) {
1724
- e === void 0 && (e = {});
1725
- const {
1726
- placement: t = "bottom",
1727
- strategy: n = "absolute",
1728
- middleware: r = [],
1729
- platform: o,
1730
- elements: {
1731
- reference: i,
1732
- floating: c
1733
- } = {},
1734
- transform: s = !0,
1735
- whileElementsMounted: f,
1736
- open: u
1737
- } = e, [d, l] = a.useState({
1738
- x: 0,
1739
- y: 0,
1740
- strategy: n,
1741
- placement: t,
1742
- middlewareData: {},
1743
- isPositioned: !1
1744
- }), [p, h] = a.useState(r);
1745
- Qe(p, r) || h(r);
1746
- const [v, m] = a.useState(null), [g, w] = a.useState(null), b = a.useCallback((A) => {
1747
- A !== M.current && (M.current = A, m(A));
1748
- }, []), x = a.useCallback((A) => {
1749
- A !== R.current && (R.current = A, w(A));
1750
- }, []), C = i || v, E = c || g, M = a.useRef(null), R = a.useRef(null), P = a.useRef(d), D = f != null, _ = pt(f), F = pt(o), k = pt(u), N = a.useCallback(() => {
1751
- if (!M.current || !R.current)
1752
- return;
1753
- const A = {
1754
- placement: t,
1755
- strategy: n,
1756
- middleware: p
1757
- };
1758
- F.current && (A.platform = F.current), hi(M.current, R.current, A).then((S) => {
1759
- const L = {
1760
- ...S,
1761
- // The floating element's position may be recomputed while it's closed
1762
- // but still mounted (such as when transitioning out). To ensure
1763
- // `isPositioned` will be `false` initially on the next open, avoid
1764
- // setting it to `true` when `open === false` (must be specified).
1765
- isPositioned: k.current !== !1
1766
- };
1767
- I.current && !Qe(P.current, L) && (P.current = L, wn.flushSync(() => {
1768
- l(L);
1769
- }));
1770
- });
1771
- }, [p, t, n, F, k]);
1772
- ze(() => {
1773
- u === !1 && P.current.isPositioned && (P.current.isPositioned = !1, l((A) => ({
1774
- ...A,
1775
- isPositioned: !1
1776
- })));
1777
- }, [u]);
1778
- const I = a.useRef(!1);
1779
- ze(() => (I.current = !0, () => {
1780
- I.current = !1;
1781
- }), []), ze(() => {
1782
- if (C && (M.current = C), E && (R.current = E), C && E) {
1783
- if (_.current)
1784
- return _.current(C, E, N);
1785
- N();
1786
- }
1787
- }, [C, E, N, _, D]);
1788
- const B = a.useMemo(() => ({
1789
- reference: M,
1790
- floating: R,
1791
- setReference: b,
1792
- setFloating: x
1793
- }), [b, x]), T = a.useMemo(() => ({
1794
- reference: C,
1795
- floating: E
1796
- }), [C, E]), $ = a.useMemo(() => {
1797
- const A = {
1798
- position: n,
1799
- left: 0,
1800
- top: 0
1801
- };
1802
- if (!T.floating)
1803
- return A;
1804
- const S = ln(T.floating, d.x), L = ln(T.floating, d.y);
1805
- return s ? {
1806
- ...A,
1807
- transform: "translate(" + S + "px, " + L + "px)",
1808
- ...kn(T.floating) >= 1.5 && {
1809
- willChange: "transform"
1810
- }
1811
- } : {
1812
- position: n,
1813
- left: S,
1814
- top: L
1815
- };
1816
- }, [n, s, T.floating, d.x, d.y]);
1817
- return a.useMemo(() => ({
1818
- ...d,
1819
- update: N,
1820
- refs: B,
1821
- elements: T,
1822
- floatingStyles: $
1823
- }), [d, N, B, T, $]);
1824
- }
1825
- const gi = (e) => {
1826
- function t(n) {
1827
- return {}.hasOwnProperty.call(n, "current");
1828
- }
1829
- return {
1830
- name: "arrow",
1831
- options: e,
1832
- fn(n) {
1833
- const {
1834
- element: r,
1835
- padding: o
1836
- } = typeof e == "function" ? e(n) : e;
1837
- return r && t(r) ? r.current != null ? un({
1838
- element: r.current,
1839
- padding: o
1840
- }).fn(n) : {} : r ? un({
1841
- element: r,
1842
- padding: o
1843
- }).fn(n) : {};
1844
- }
1845
- };
1846
- }, wi = (e, t) => ({
1847
- ...ui(e),
1848
- options: [e, t]
1849
- }), yi = (e, t) => ({
1850
- ...li(e),
1851
- options: [e, t]
1852
- }), bi = (e, t) => ({
1853
- ...mi(e),
1854
- options: [e, t]
1855
- }), xi = (e, t) => ({
1856
- ...fi(e),
1857
- options: [e, t]
1858
- }), Ci = (e, t) => ({
1859
- ...di(e),
1860
- options: [e, t]
1861
- }), Ei = (e, t) => ({
1862
- ...pi(e),
1863
- options: [e, t]
1864
- }), Si = (e, t) => ({
1865
- ...gi(e),
1866
- options: [e, t]
1867
- });
1868
- var Ri = "Arrow", $n = a.forwardRef((e, t) => {
1869
- const { children: n, width: r = 10, height: o = 5, ...i } = e;
1870
- return /* @__PURE__ */ y(
1871
- U.svg,
1872
- {
1873
- ...i,
1874
- ref: t,
1875
- width: r,
1876
- height: o,
1877
- viewBox: "0 0 30 10",
1878
- preserveAspectRatio: "none",
1879
- children: e.asChild ? n : /* @__PURE__ */ y("polygon", { points: "0,0 30,0 15,10" })
1880
- }
1881
- );
1882
- });
1883
- $n.displayName = Ri;
1884
- var Mi = $n;
1885
- function Pi(e) {
1886
- const [t, n] = a.useState(void 0);
1887
- return fe(() => {
1888
- if (e) {
1889
- n({ width: e.offsetWidth, height: e.offsetHeight });
1890
- const r = new ResizeObserver((o) => {
1891
- if (!Array.isArray(o) || !o.length)
1892
- return;
1893
- const i = o[0];
1894
- let c, s;
1895
- if ("borderBoxSize" in i) {
1896
- const f = i.borderBoxSize, u = Array.isArray(f) ? f[0] : f;
1897
- c = u.inlineSize, s = u.blockSize;
1898
- } else
1899
- c = e.offsetWidth, s = e.offsetHeight;
1900
- n({ width: c, height: s });
1901
- });
1902
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
1903
- } else
1904
- n(void 0);
1905
- }, [e]), t;
1906
- }
1907
- var Ft = "Popper", [Bn, Wn] = At(Ft), [Ai, Un] = Bn(Ft), Kn = (e) => {
1908
- const { __scopePopper: t, children: n } = e, [r, o] = a.useState(null);
1909
- return /* @__PURE__ */ y(Ai, { scope: t, anchor: r, onAnchorChange: o, children: n });
1910
- };
1911
- Kn.displayName = Ft;
1912
- var Gn = "PopperAnchor", Hn = a.forwardRef(
1913
- (e, t) => {
1914
- const { __scopePopper: n, virtualRef: r, ...o } = e, i = Un(Gn, n), c = a.useRef(null), s = G(t, c);
1915
- return a.useEffect(() => {
1916
- i.onAnchorChange((r == null ? void 0 : r.current) || c.current);
1917
- }), r ? null : /* @__PURE__ */ y(U.div, { ...o, ref: s });
1918
- }
1919
- );
1920
- Hn.displayName = Gn;
1921
- var kt = "PopperContent", [Oi, _i] = Bn(kt), Vn = a.forwardRef(
1922
- (e, t) => {
1923
- var ne, Re, z, Me, zt, Yt;
1924
- const {
1925
- __scopePopper: n,
1926
- side: r = "bottom",
1927
- sideOffset: o = 0,
1928
- align: i = "center",
1929
- alignOffset: c = 0,
1930
- arrowPadding: s = 0,
1931
- avoidCollisions: f = !0,
1932
- collisionBoundary: u = [],
1933
- collisionPadding: d = 0,
1934
- sticky: l = "partial",
1935
- hideWhenDetached: p = !1,
1936
- updatePositionStrategy: h = "optimized",
1937
- onPlaced: v,
1938
- ...m
1939
- } = e, g = Un(kt, n), [w, b] = a.useState(null), x = G(t, (Pe) => b(Pe)), [C, E] = a.useState(null), M = Pi(C), R = (M == null ? void 0 : M.width) ?? 0, P = (M == null ? void 0 : M.height) ?? 0, D = r + (i !== "center" ? "-" + i : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, F = Array.isArray(u) ? u : [u], k = F.length > 0, N = {
1940
- padding: _,
1941
- boundary: F.filter(Di),
1942
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1943
- altBoundary: k
1944
- }, { refs: I, floatingStyles: B, placement: T, isPositioned: $, middlewareData: A } = vi({
1945
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1946
- strategy: "fixed",
1947
- placement: D,
1948
- whileElementsMounted: (...Pe) => ai(...Pe, {
1949
- animationFrame: h === "always"
1950
- }),
1951
- elements: {
1952
- reference: g.anchor
1953
- },
1954
- middleware: [
1955
- wi({ mainAxis: o + P, alignmentAxis: c }),
1956
- f && yi({
1957
- mainAxis: !0,
1958
- crossAxis: !1,
1959
- limiter: l === "partial" ? bi() : void 0,
1960
- ...N
1961
- }),
1962
- f && xi({ ...N }),
1963
- Ci({
1964
- ...N,
1965
- apply: ({ elements: Pe, rects: jt, availableWidth: Hr, availableHeight: Vr }) => {
1966
- const { width: zr, height: Yr } = jt.reference, Be = Pe.floating.style;
1967
- Be.setProperty("--radix-popper-available-width", `${Hr}px`), Be.setProperty("--radix-popper-available-height", `${Vr}px`), Be.setProperty("--radix-popper-anchor-width", `${zr}px`), Be.setProperty("--radix-popper-anchor-height", `${Yr}px`);
1968
- }
1969
- }),
1970
- C && Si({ element: C, padding: s }),
1971
- Ii({ arrowWidth: R, arrowHeight: P }),
1972
- p && Ei({ strategy: "referenceHidden", ...N })
1973
- ]
1974
- }), [S, L] = jn(T), W = j(v);
1975
- fe(() => {
1976
- $ && (W == null || W());
1977
- }, [$, W]);
1978
- const q = (ne = A.arrow) == null ? void 0 : ne.x, Ee = (Re = A.arrow) == null ? void 0 : Re.y, Se = ((z = A.arrow) == null ? void 0 : z.centerOffset) !== 0, [$e, ue] = a.useState();
1979
- return fe(() => {
1980
- w && ue(window.getComputedStyle(w).zIndex);
1981
- }, [w]), /* @__PURE__ */ y(
1982
- "div",
1983
- {
1984
- ref: I.setFloating,
1985
- "data-radix-popper-content-wrapper": "",
1986
- style: {
1987
- ...B,
1988
- transform: $ ? B.transform : "translate(0, -200%)",
1989
- // keep off the page when measuring
1990
- minWidth: "max-content",
1991
- zIndex: $e,
1992
- "--radix-popper-transform-origin": [
1993
- (Me = A.transformOrigin) == null ? void 0 : Me.x,
1994
- (zt = A.transformOrigin) == null ? void 0 : zt.y
1995
- ].join(" "),
1996
- // hide the content if using the hide middleware and should be hidden
1997
- // set visibility to hidden and disable pointer events so the UI behaves
1998
- // as if the PopperContent isn't there at all
1999
- ...((Yt = A.hide) == null ? void 0 : Yt.referenceHidden) && {
2000
- visibility: "hidden",
2001
- pointerEvents: "none"
2002
- }
2003
- },
2004
- dir: e.dir,
2005
- children: /* @__PURE__ */ y(
2006
- Oi,
2007
- {
2008
- scope: n,
2009
- placedSide: S,
2010
- onArrowChange: E,
2011
- arrowX: q,
2012
- arrowY: Ee,
2013
- shouldHideArrow: Se,
2014
- children: /* @__PURE__ */ y(
2015
- U.div,
2016
- {
2017
- "data-side": S,
2018
- "data-align": L,
2019
- ...m,
2020
- ref: x,
2021
- style: {
2022
- ...m.style,
2023
- // if the PopperContent hasn't been placed yet (not all measurements done)
2024
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
2025
- animation: $ ? void 0 : "none"
2026
- }
2027
- }
2028
- )
2029
- }
2030
- )
2031
- }
2032
- );
2033
- }
2034
- );
2035
- Vn.displayName = kt;
2036
- var zn = "PopperArrow", Ti = {
2037
- top: "bottom",
2038
- right: "left",
2039
- bottom: "top",
2040
- left: "right"
2041
- }, Yn = a.forwardRef(function(t, n) {
2042
- const { __scopePopper: r, ...o } = t, i = _i(zn, r), c = Ti[i.placedSide];
2043
- return (
2044
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
2045
- // doesn't report size as we'd expect on SVG elements.
2046
- // it reports their bounding box which is effectively the largest path inside the SVG.
2047
- /* @__PURE__ */ y(
2048
- "span",
2049
- {
2050
- ref: i.onArrowChange,
2051
- style: {
2052
- position: "absolute",
2053
- left: i.arrowX,
2054
- top: i.arrowY,
2055
- [c]: 0,
2056
- transformOrigin: {
2057
- top: "",
2058
- right: "0 0",
2059
- bottom: "center 0",
2060
- left: "100% 0"
2061
- }[i.placedSide],
2062
- transform: {
2063
- top: "translateY(100%)",
2064
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
2065
- bottom: "rotate(180deg)",
2066
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
2067
- }[i.placedSide],
2068
- visibility: i.shouldHideArrow ? "hidden" : void 0
2069
- },
2070
- children: /* @__PURE__ */ y(
2071
- Mi,
2072
- {
2073
- ...o,
2074
- ref: n,
2075
- style: {
2076
- ...o.style,
2077
- // ensures the element can be measured correctly (mostly for if SVG)
2078
- display: "block"
2079
- }
2080
- }
2081
- )
2082
- }
2083
- )
2084
- );
2085
- });
2086
- Yn.displayName = zn;
2087
- function Di(e) {
2088
- return e !== null;
2089
- }
2090
- var Ii = (e) => ({
2091
- name: "transformOrigin",
2092
- options: e,
2093
- fn(t) {
2094
- var g, w, b;
2095
- const { placement: n, rects: r, middlewareData: o } = t, c = ((g = o.arrow) == null ? void 0 : g.centerOffset) !== 0, s = c ? 0 : e.arrowWidth, f = c ? 0 : e.arrowHeight, [u, d] = jn(n), l = { start: "0%", center: "50%", end: "100%" }[d], p = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + s / 2, h = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + f / 2;
2096
- let v = "", m = "";
2097
- return u === "bottom" ? (v = c ? l : `${p}px`, m = `${-f}px`) : u === "top" ? (v = c ? l : `${p}px`, m = `${r.floating.height + f}px`) : u === "right" ? (v = `${-f}px`, m = c ? l : `${h}px`) : u === "left" && (v = `${r.floating.width + f}px`, m = c ? l : `${h}px`), { data: { x: v, y: m } };
2098
- }
2099
- });
2100
- function jn(e) {
2101
- const [t, n = "center"] = e.split("-");
2102
- return [t, n];
2103
- }
2104
- var Ni = Kn, Li = Hn, Fi = Vn, ki = Yn, $i = "Portal", Xn = a.forwardRef((e, t) => {
2105
- var s;
2106
- const { container: n, ...r } = e, [o, i] = a.useState(!1);
2107
- fe(() => i(!0), []);
2108
- const c = n || o && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
2109
- return c ? Qr.createPortal(/* @__PURE__ */ y(U.div, { ...r, ref: t }), c) : null;
2110
- });
2111
- Xn.displayName = $i;
2112
- function Bi(e, t) {
2113
- return a.useReducer((n, r) => t[n][r] ?? n, e);
2114
- }
2115
- var Le = (e) => {
2116
- const { present: t, children: n } = e, r = Wi(t), o = typeof n == "function" ? n({ present: r.isPresent }) : a.Children.only(n), i = G(r.ref, Ui(o));
2117
- return typeof n == "function" || r.isPresent ? a.cloneElement(o, { ref: i }) : null;
2118
- };
2119
- Le.displayName = "Presence";
2120
- function Wi(e) {
2121
- const [t, n] = a.useState(), r = a.useRef({}), o = a.useRef(e), i = a.useRef("none"), c = e ? "mounted" : "unmounted", [s, f] = Bi(c, {
2122
- mounted: {
2123
- UNMOUNT: "unmounted",
2124
- ANIMATION_OUT: "unmountSuspended"
2125
- },
2126
- unmountSuspended: {
2127
- MOUNT: "mounted",
2128
- ANIMATION_END: "unmounted"
2129
- },
2130
- unmounted: {
2131
- MOUNT: "mounted"
2132
- }
2133
- });
2134
- return a.useEffect(() => {
2135
- const u = Ue(r.current);
2136
- i.current = s === "mounted" ? u : "none";
2137
- }, [s]), fe(() => {
2138
- const u = r.current, d = o.current;
2139
- if (d !== e) {
2140
- const p = i.current, h = Ue(u);
2141
- e ? f("MOUNT") : h === "none" || (u == null ? void 0 : u.display) === "none" ? f("UNMOUNT") : f(d && p !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
2142
- }
2143
- }, [e, f]), fe(() => {
2144
- if (t) {
2145
- let u;
2146
- const d = t.ownerDocument.defaultView ?? window, l = (h) => {
2147
- const m = Ue(r.current).includes(h.animationName);
2148
- if (h.target === t && m && (f("ANIMATION_END"), !o.current)) {
2149
- const g = t.style.animationFillMode;
2150
- t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
2151
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
2152
- });
2153
- }
2154
- }, p = (h) => {
2155
- h.target === t && (i.current = Ue(r.current));
2156
- };
2157
- return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", l), t.addEventListener("animationend", l), () => {
2158
- d.clearTimeout(u), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", l), t.removeEventListener("animationend", l);
2159
- };
2160
- } else
2161
- f("ANIMATION_END");
2162
- }, [t, f]), {
2163
- isPresent: ["mounted", "unmountSuspended"].includes(s),
2164
- ref: a.useCallback((u) => {
2165
- u && (r.current = getComputedStyle(u)), n(u);
2166
- }, [])
2167
- };
2168
- }
2169
- function Ue(e) {
2170
- return (e == null ? void 0 : e.animationName) || "none";
2171
- }
2172
- function Ui(e) {
2173
- var r, o;
2174
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
2175
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
2176
- }
2177
- var mt = "rovingFocusGroup.onEntryFocus", Ki = { bubbles: !1, cancelable: !0 }, it = "RovingFocusGroup", [Rt, Zn, Gi] = Cn(it), [Hi, qn] = At(
2178
- it,
2179
- [Gi]
2180
- ), [Vi, zi] = Hi(it), Qn = a.forwardRef(
2181
- (e, t) => /* @__PURE__ */ y(Rt.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ y(Rt.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ y(Yi, { ...e, ref: t }) }) })
2182
- );
2183
- Qn.displayName = it;
2184
- var Yi = a.forwardRef((e, t) => {
2185
- const {
2186
- __scopeRovingFocusGroup: n,
2187
- orientation: r,
2188
- loop: o = !1,
2189
- dir: i,
2190
- currentTabStopId: c,
2191
- defaultCurrentTabStopId: s,
2192
- onCurrentTabStopIdChange: f,
2193
- onEntryFocus: u,
2194
- preventScrollOnEntryFocus: d = !1,
2195
- ...l
2196
- } = e, p = a.useRef(null), h = G(t, p), v = En(i), [m = null, g] = bn({
2197
- prop: c,
2198
- defaultProp: s,
2199
- onChange: f
2200
- }), [w, b] = a.useState(!1), x = j(u), C = Zn(n), E = a.useRef(!1), [M, R] = a.useState(0);
2201
- return a.useEffect(() => {
2202
- const P = p.current;
2203
- if (P)
2204
- return P.addEventListener(mt, x), () => P.removeEventListener(mt, x);
2205
- }, [x]), /* @__PURE__ */ y(
2206
- Vi,
2207
- {
2208
- scope: n,
2209
- orientation: r,
2210
- dir: v,
2211
- loop: o,
2212
- currentTabStopId: m,
2213
- onItemFocus: a.useCallback(
2214
- (P) => g(P),
2215
- [g]
2216
- ),
2217
- onItemShiftTab: a.useCallback(() => b(!0), []),
2218
- onFocusableItemAdd: a.useCallback(
2219
- () => R((P) => P + 1),
2220
- []
2221
- ),
2222
- onFocusableItemRemove: a.useCallback(
2223
- () => R((P) => P - 1),
2224
- []
2225
- ),
2226
- children: /* @__PURE__ */ y(
2227
- U.div,
2228
- {
2229
- tabIndex: w || M === 0 ? -1 : 0,
2230
- "data-orientation": r,
2231
- ...l,
2232
- ref: h,
2233
- style: { outline: "none", ...e.style },
2234
- onMouseDown: O(e.onMouseDown, () => {
2235
- E.current = !0;
2236
- }),
2237
- onFocus: O(e.onFocus, (P) => {
2238
- const D = !E.current;
2239
- if (P.target === P.currentTarget && D && !w) {
2240
- const _ = new CustomEvent(mt, Ki);
2241
- if (P.currentTarget.dispatchEvent(_), !_.defaultPrevented) {
2242
- const F = C().filter((T) => T.focusable), k = F.find((T) => T.active), N = F.find((T) => T.id === m), B = [k, N, ...F].filter(
2243
- Boolean
2244
- ).map((T) => T.ref.current);
2245
- tr(B, d);
2246
- }
2247
- }
2248
- E.current = !1;
2249
- }),
2250
- onBlur: O(e.onBlur, () => b(!1))
2251
- }
2252
- )
2253
- }
2254
- );
2255
- }), Jn = "RovingFocusGroupItem", er = a.forwardRef(
2256
- (e, t) => {
2257
- const {
2258
- __scopeRovingFocusGroup: n,
2259
- focusable: r = !0,
2260
- active: o = !1,
2261
- tabStopId: i,
2262
- ...c
2263
- } = e, s = xt(), f = i || s, u = zi(Jn, n), d = u.currentTabStopId === f, l = Zn(n), { onFocusableItemAdd: p, onFocusableItemRemove: h } = u;
2264
- return a.useEffect(() => {
2265
- if (r)
2266
- return p(), () => h();
2267
- }, [r, p, h]), /* @__PURE__ */ y(
2268
- Rt.ItemSlot,
2269
- {
2270
- scope: n,
2271
- id: f,
2272
- focusable: r,
2273
- active: o,
2274
- children: /* @__PURE__ */ y(
2275
- U.span,
2276
- {
2277
- tabIndex: d ? 0 : -1,
2278
- "data-orientation": u.orientation,
2279
- ...c,
2280
- ref: t,
2281
- onMouseDown: O(e.onMouseDown, (v) => {
2282
- r ? u.onItemFocus(f) : v.preventDefault();
2283
- }),
2284
- onFocus: O(e.onFocus, () => u.onItemFocus(f)),
2285
- onKeyDown: O(e.onKeyDown, (v) => {
2286
- if (v.key === "Tab" && v.shiftKey) {
2287
- u.onItemShiftTab();
2288
- return;
2289
- }
2290
- if (v.target !== v.currentTarget)
2291
- return;
2292
- const m = Zi(v, u.orientation, u.dir);
2293
- if (m !== void 0) {
2294
- if (v.metaKey || v.ctrlKey || v.altKey || v.shiftKey)
2295
- return;
2296
- v.preventDefault();
2297
- let w = l().filter((b) => b.focusable).map((b) => b.ref.current);
2298
- if (m === "last")
2299
- w.reverse();
2300
- else if (m === "prev" || m === "next") {
2301
- m === "prev" && w.reverse();
2302
- const b = w.indexOf(v.currentTarget);
2303
- w = u.loop ? qi(w, b + 1) : w.slice(b + 1);
2304
- }
2305
- setTimeout(() => tr(w));
2306
- }
2307
- })
2308
- }
2309
- )
2310
- }
2311
- );
2312
- }
2313
- );
2314
- er.displayName = Jn;
2315
- var ji = {
2316
- ArrowLeft: "prev",
2317
- ArrowUp: "prev",
2318
- ArrowRight: "next",
2319
- ArrowDown: "next",
2320
- PageUp: "first",
2321
- Home: "first",
2322
- PageDown: "last",
2323
- End: "last"
2324
- };
2325
- function Xi(e, t) {
2326
- return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
2327
- }
2328
- function Zi(e, t, n) {
2329
- const r = Xi(e.key, n);
2330
- if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
2331
- return ji[r];
2332
- }
2333
- function tr(e, t = !1) {
2334
- const n = document.activeElement;
2335
- for (const r of e)
2336
- if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n))
2337
- return;
2338
- }
2339
- function qi(e, t) {
2340
- return e.map((n, r) => e[(t + r) % e.length]);
2341
- }
2342
- var Qi = Qn, Ji = er, ec = function(e) {
2343
- if (typeof document > "u")
2344
- return null;
2345
- var t = Array.isArray(e) ? e[0] : e;
2346
- return t.ownerDocument.body;
2347
- }, he = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Ge = {}, ht = 0, nr = function(e) {
2348
- return e && (e.host || nr(e.parentNode));
2349
- }, tc = function(e, t) {
2350
- return t.map(function(n) {
2351
- if (e.contains(n))
2352
- return n;
2353
- var r = nr(n);
2354
- return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
2355
- }).filter(function(n) {
2356
- return !!n;
2357
- });
2358
- }, nc = function(e, t, n, r) {
2359
- var o = tc(t, Array.isArray(e) ? e : [e]);
2360
- Ge[n] || (Ge[n] = /* @__PURE__ */ new WeakMap());
2361
- var i = Ge[n], c = [], s = /* @__PURE__ */ new Set(), f = new Set(o), u = function(l) {
2362
- !l || s.has(l) || (s.add(l), u(l.parentNode));
2363
- };
2364
- o.forEach(u);
2365
- var d = function(l) {
2366
- !l || f.has(l) || Array.prototype.forEach.call(l.children, function(p) {
2367
- if (s.has(p))
2368
- d(p);
2369
- else
2370
- try {
2371
- var h = p.getAttribute(r), v = h !== null && h !== "false", m = (he.get(p) || 0) + 1, g = (i.get(p) || 0) + 1;
2372
- he.set(p, m), i.set(p, g), c.push(p), m === 1 && v && Ke.set(p, !0), g === 1 && p.setAttribute(n, "true"), v || p.setAttribute(r, "true");
2373
- } catch (w) {
2374
- console.error("aria-hidden: cannot operate on ", p, w);
2375
- }
2376
- });
2377
- };
2378
- return d(t), s.clear(), ht++, function() {
2379
- c.forEach(function(l) {
2380
- var p = he.get(l) - 1, h = i.get(l) - 1;
2381
- he.set(l, p), i.set(l, h), p || (Ke.has(l) || l.removeAttribute(r), Ke.delete(l)), h || l.removeAttribute(n);
2382
- }), ht--, ht || (he = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Ge = {});
2383
- };
2384
- }, rc = function(e, t, n) {
2385
- n === void 0 && (n = "data-aria-hidden");
2386
- var r = Array.from(Array.isArray(e) ? e : [e]), o = t || ec(e);
2387
- return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live]"))), nc(r, o, n, "aria-hidden")) : function() {
2388
- return null;
2389
- };
2390
- }, Q = function() {
2391
- return Q = Object.assign || function(t) {
2392
- for (var n, r = 1, o = arguments.length; r < o; r++) {
2393
- n = arguments[r];
2394
- for (var i in n)
2395
- Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
2396
- }
2397
- return t;
2398
- }, Q.apply(this, arguments);
2399
- };
2400
- function rr(e, t) {
2401
- var n = {};
2402
- for (var r in e)
2403
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2404
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2405
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2406
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2407
- return n;
2408
- }
2409
- function oc(e, t, n) {
2410
- if (n || arguments.length === 2)
2411
- for (var r = 0, o = t.length, i; r < o; r++)
2412
- (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
2413
- return e.concat(i || Array.prototype.slice.call(t));
2414
- }
2415
- var Ye = "right-scroll-bar-position", je = "width-before-scroll-bar", ic = "with-scroll-bars-hidden", cc = "--removed-body-scroll-bar-size";
2416
- function vt(e, t) {
2417
- return typeof e == "function" ? e(t) : e && (e.current = t), e;
2418
- }
2419
- function sc(e, t) {
2420
- var n = Zr(function() {
2421
- return {
2422
- // value
2423
- value: e,
2424
- // last callback
2425
- callback: t,
2426
- // "memoized" public interface
2427
- facade: {
2428
- get current() {
2429
- return n.value;
2430
- },
2431
- set current(r) {
2432
- var o = n.value;
2433
- o !== r && (n.value = r, n.callback(r, o));
2434
- }
2435
- }
2436
- };
2437
- })[0];
2438
- return n.callback = t, n.facade;
2439
- }
2440
- var ac = typeof window < "u" ? a.useLayoutEffect : a.useEffect, fn = /* @__PURE__ */ new WeakMap();
2441
- function uc(e, t) {
2442
- var n = sc(t || null, function(r) {
2443
- return e.forEach(function(o) {
2444
- return vt(o, r);
2445
- });
2446
- });
2447
- return ac(function() {
2448
- var r = fn.get(n);
2449
- if (r) {
2450
- var o = new Set(r), i = new Set(e), c = n.current;
2451
- o.forEach(function(s) {
2452
- i.has(s) || vt(s, null);
2453
- }), i.forEach(function(s) {
2454
- o.has(s) || vt(s, c);
2455
- });
2456
- }
2457
- fn.set(n, e);
2458
- }, [e]), n;
2459
- }
2460
- function lc(e) {
2461
- return e;
2462
- }
2463
- function fc(e, t) {
2464
- t === void 0 && (t = lc);
2465
- var n = [], r = !1, o = {
2466
- read: function() {
2467
- if (r)
2468
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
2469
- return n.length ? n[n.length - 1] : e;
2470
- },
2471
- useMedium: function(i) {
2472
- var c = t(i, r);
2473
- return n.push(c), function() {
2474
- n = n.filter(function(s) {
2475
- return s !== c;
2476
- });
2477
- };
2478
- },
2479
- assignSyncMedium: function(i) {
2480
- for (r = !0; n.length; ) {
2481
- var c = n;
2482
- n = [], c.forEach(i);
2483
- }
2484
- n = {
2485
- push: function(s) {
2486
- return i(s);
2487
- },
2488
- filter: function() {
2489
- return n;
2490
- }
2491
- };
2492
- },
2493
- assignMedium: function(i) {
2494
- r = !0;
2495
- var c = [];
2496
- if (n.length) {
2497
- var s = n;
2498
- n = [], s.forEach(i), c = n;
2499
- }
2500
- var f = function() {
2501
- var d = c;
2502
- c = [], d.forEach(i);
2503
- }, u = function() {
2504
- return Promise.resolve().then(f);
2505
- };
2506
- u(), n = {
2507
- push: function(d) {
2508
- c.push(d), u();
2509
- },
2510
- filter: function(d) {
2511
- return c = c.filter(d), n;
2512
- }
2513
- };
2514
- }
2515
- };
2516
- return o;
2517
- }
2518
- function dc(e) {
2519
- e === void 0 && (e = {});
2520
- var t = fc(null);
2521
- return t.options = Q({ async: !0, ssr: !1 }, e), t;
2522
- }
2523
- var or = function(e) {
2524
- var t = e.sideCar, n = rr(e, ["sideCar"]);
2525
- if (!t)
2526
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
2527
- var r = t.read();
2528
- if (!r)
2529
- throw new Error("Sidecar medium not found");
2530
- return a.createElement(r, Q({}, n));
2531
- };
2532
- or.isSideCarExport = !0;
2533
- function pc(e, t) {
2534
- return e.useMedium(t), or;
2535
- }
2536
- var ir = dc(), gt = function() {
2537
- }, ct = a.forwardRef(function(e, t) {
2538
- var n = a.useRef(null), r = a.useState({
2539
- onScrollCapture: gt,
2540
- onWheelCapture: gt,
2541
- onTouchMoveCapture: gt
2542
- }), o = r[0], i = r[1], c = e.forwardProps, s = e.children, f = e.className, u = e.removeScrollBar, d = e.enabled, l = e.shards, p = e.sideCar, h = e.noIsolation, v = e.inert, m = e.allowPinchZoom, g = e.as, w = g === void 0 ? "div" : g, b = e.gapMode, x = rr(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = p, E = uc([n, t]), M = Q(Q({}, x), o);
2543
- return a.createElement(
2544
- a.Fragment,
2545
- null,
2546
- d && a.createElement(C, { sideCar: ir, removeScrollBar: u, shards: l, noIsolation: h, inert: v, setCallbacks: i, allowPinchZoom: !!m, lockRef: n, gapMode: b }),
2547
- c ? a.cloneElement(a.Children.only(s), Q(Q({}, M), { ref: E })) : a.createElement(w, Q({}, M, { className: f, ref: E }), s)
2548
- );
2549
- });
2550
- ct.defaultProps = {
2551
- enabled: !0,
2552
- removeScrollBar: !0,
2553
- inert: !1
2554
- };
2555
- ct.classNames = {
2556
- fullWidth: je,
2557
- zeroRight: Ye
2558
- };
2559
- var dn, mc = function() {
2560
- if (dn)
2561
- return dn;
2562
- if (typeof __webpack_nonce__ < "u")
2563
- return __webpack_nonce__;
2564
- };
2565
- function hc() {
2566
- if (!document)
2567
- return null;
2568
- var e = document.createElement("style");
2569
- e.type = "text/css";
2570
- var t = mc();
2571
- return t && e.setAttribute("nonce", t), e;
2572
- }
2573
- function vc(e, t) {
2574
- e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
2575
- }
2576
- function gc(e) {
2577
- var t = document.head || document.getElementsByTagName("head")[0];
2578
- t.appendChild(e);
2579
- }
2580
- var wc = function() {
2581
- var e = 0, t = null;
2582
- return {
2583
- add: function(n) {
2584
- e == 0 && (t = hc()) && (vc(t, n), gc(t)), e++;
2585
- },
2586
- remove: function() {
2587
- e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
2588
- }
2589
- };
2590
- }, yc = function() {
2591
- var e = wc();
2592
- return function(t, n) {
2593
- a.useEffect(function() {
2594
- return e.add(t), function() {
2595
- e.remove();
2596
- };
2597
- }, [t && n]);
2598
- };
2599
- }, cr = function() {
2600
- var e = yc(), t = function(n) {
2601
- var r = n.styles, o = n.dynamic;
2602
- return e(r, o), null;
2603
- };
2604
- return t;
2605
- }, bc = {
2606
- left: 0,
2607
- top: 0,
2608
- right: 0,
2609
- gap: 0
2610
- }, wt = function(e) {
2611
- return parseInt(e || "", 10) || 0;
2612
- }, xc = function(e) {
2613
- var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
2614
- return [wt(n), wt(r), wt(o)];
2615
- }, Cc = function(e) {
2616
- if (e === void 0 && (e = "margin"), typeof window > "u")
2617
- return bc;
2618
- var t = xc(e), n = document.documentElement.clientWidth, r = window.innerWidth;
2619
- return {
2620
- left: t[0],
2621
- top: t[1],
2622
- right: t[2],
2623
- gap: Math.max(0, r - n + t[2] - t[0])
2624
- };
2625
- }, Ec = cr(), ye = "data-scroll-locked", Sc = function(e, t, n, r) {
2626
- var o = e.left, i = e.top, c = e.right, s = e.gap;
2627
- return n === void 0 && (n = "margin"), `
2628
- .`.concat(ic, ` {
2629
- overflow: hidden `).concat(r, `;
2630
- padding-right: `).concat(s, "px ").concat(r, `;
2631
- }
2632
- body[`).concat(ye, `] {
2633
- overflow: hidden `).concat(r, `;
2634
- overscroll-behavior: contain;
2635
- `).concat([
2636
- t && "position: relative ".concat(r, ";"),
2637
- n === "margin" && `
2638
- padding-left: `.concat(o, `px;
2639
- padding-top: `).concat(i, `px;
2640
- padding-right: `).concat(c, `px;
2641
- margin-left:0;
2642
- margin-top:0;
2643
- margin-right: `).concat(s, "px ").concat(r, `;
2644
- `),
2645
- n === "padding" && "padding-right: ".concat(s, "px ").concat(r, ";")
2646
- ].filter(Boolean).join(""), `
2647
- }
2648
-
2649
- .`).concat(Ye, ` {
2650
- right: `).concat(s, "px ").concat(r, `;
2651
- }
2652
-
2653
- .`).concat(je, ` {
2654
- margin-right: `).concat(s, "px ").concat(r, `;
2655
- }
2656
-
2657
- .`).concat(Ye, " .").concat(Ye, ` {
2658
- right: 0 `).concat(r, `;
2659
- }
2660
-
2661
- .`).concat(je, " .").concat(je, ` {
2662
- margin-right: 0 `).concat(r, `;
2663
- }
2664
-
2665
- body[`).concat(ye, `] {
2666
- `).concat(cc, ": ").concat(s, `px;
2667
- }
2668
- `);
2669
- }, pn = function() {
2670
- var e = parseInt(document.body.getAttribute(ye) || "0", 10);
2671
- return isFinite(e) ? e : 0;
2672
- }, Rc = function() {
2673
- a.useEffect(function() {
2674
- return document.body.setAttribute(ye, (pn() + 1).toString()), function() {
2675
- var e = pn() - 1;
2676
- e <= 0 ? document.body.removeAttribute(ye) : document.body.setAttribute(ye, e.toString());
2677
- };
2678
- }, []);
2679
- }, Mc = function(e) {
2680
- var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
2681
- Rc();
2682
- var i = a.useMemo(function() {
2683
- return Cc(o);
2684
- }, [o]);
2685
- return a.createElement(Ec, { styles: Sc(i, !t, o, n ? "" : "!important") });
2686
- }, Mt = !1;
2687
- if (typeof window < "u")
2688
- try {
2689
- var He = Object.defineProperty({}, "passive", {
2690
- get: function() {
2691
- return Mt = !0, !0;
2692
- }
2693
- });
2694
- window.addEventListener("test", He, He), window.removeEventListener("test", He, He);
2695
- } catch {
2696
- Mt = !1;
2697
- }
2698
- var ve = Mt ? { passive: !1 } : !1, Pc = function(e) {
2699
- return e.tagName === "TEXTAREA";
2700
- }, sr = function(e, t) {
2701
- if (!(e instanceof Element))
2702
- return !1;
2703
- var n = window.getComputedStyle(e);
2704
- return (
2705
- // not-not-scrollable
2706
- n[t] !== "hidden" && // contains scroll inside self
2707
- !(n.overflowY === n.overflowX && !Pc(e) && n[t] === "visible")
2708
- );
2709
- }, Ac = function(e) {
2710
- return sr(e, "overflowY");
2711
- }, Oc = function(e) {
2712
- return sr(e, "overflowX");
2713
- }, mn = function(e, t) {
2714
- var n = t.ownerDocument, r = t;
2715
- do {
2716
- typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
2717
- var o = ar(e, r);
2718
- if (o) {
2719
- var i = ur(e, r), c = i[1], s = i[2];
2720
- if (c > s)
2721
- return !0;
2722
- }
2723
- r = r.parentNode;
2724
- } while (r && r !== n.body);
2725
- return !1;
2726
- }, _c = function(e) {
2727
- var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
2728
- return [
2729
- t,
2730
- n,
2731
- r
2732
- ];
2733
- }, Tc = function(e) {
2734
- var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
2735
- return [
2736
- t,
2737
- n,
2738
- r
2739
- ];
2740
- }, ar = function(e, t) {
2741
- return e === "v" ? Ac(t) : Oc(t);
2742
- }, ur = function(e, t) {
2743
- return e === "v" ? _c(t) : Tc(t);
2744
- }, Dc = function(e, t) {
2745
- return e === "h" && t === "rtl" ? -1 : 1;
2746
- }, Ic = function(e, t, n, r, o) {
2747
- var i = Dc(e, window.getComputedStyle(t).direction), c = i * r, s = n.target, f = t.contains(s), u = !1, d = c > 0, l = 0, p = 0;
2748
- do {
2749
- var h = ur(e, s), v = h[0], m = h[1], g = h[2], w = m - g - i * v;
2750
- (v || w) && ar(e, s) && (l += w, p += v), s instanceof ShadowRoot ? s = s.host : s = s.parentNode;
2751
- } while (
2752
- // portaled content
2753
- !f && s !== document.body || // self content
2754
- f && (t.contains(s) || t === s)
2755
- );
2756
- return (d && (o && Math.abs(l) < 1 || !o && c > l) || !d && (o && Math.abs(p) < 1 || !o && -c > p)) && (u = !0), u;
2757
- }, Ve = function(e) {
2758
- return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
2759
- }, hn = function(e) {
2760
- return [e.deltaX, e.deltaY];
2761
- }, vn = function(e) {
2762
- return e && "current" in e ? e.current : e;
2763
- }, Nc = function(e, t) {
2764
- return e[0] === t[0] && e[1] === t[1];
2765
- }, Lc = function(e) {
2766
- return `
2767
- .block-interactivity-`.concat(e, ` {pointer-events: none;}
2768
- .allow-interactivity-`).concat(e, ` {pointer-events: all;}
2769
- `);
2770
- }, Fc = 0, ge = [];
2771
- function kc(e) {
2772
- var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(Fc++)[0], i = a.useState(cr)[0], c = a.useRef(e);
2773
- a.useEffect(function() {
2774
- c.current = e;
2775
- }, [e]), a.useEffect(function() {
2776
- if (e.inert) {
2777
- document.body.classList.add("block-interactivity-".concat(o));
2778
- var m = oc([e.lockRef.current], (e.shards || []).map(vn), !0).filter(Boolean);
2779
- return m.forEach(function(g) {
2780
- return g.classList.add("allow-interactivity-".concat(o));
2781
- }), function() {
2782
- document.body.classList.remove("block-interactivity-".concat(o)), m.forEach(function(g) {
2783
- return g.classList.remove("allow-interactivity-".concat(o));
2784
- });
2785
- };
2786
- }
2787
- }, [e.inert, e.lockRef.current, e.shards]);
2788
- var s = a.useCallback(function(m, g) {
2789
- if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
2790
- return !c.current.allowPinchZoom;
2791
- var w = Ve(m), b = n.current, x = "deltaX" in m ? m.deltaX : b[0] - w[0], C = "deltaY" in m ? m.deltaY : b[1] - w[1], E, M = m.target, R = Math.abs(x) > Math.abs(C) ? "h" : "v";
2792
- if ("touches" in m && R === "h" && M.type === "range")
2793
- return !1;
2794
- var P = mn(R, M);
2795
- if (!P)
2796
- return !0;
2797
- if (P ? E = R : (E = R === "v" ? "h" : "v", P = mn(R, M)), !P)
2798
- return !1;
2799
- if (!r.current && "changedTouches" in m && (x || C) && (r.current = E), !E)
2800
- return !0;
2801
- var D = r.current || E;
2802
- return Ic(D, g, m, D === "h" ? x : C, !0);
2803
- }, []), f = a.useCallback(function(m) {
2804
- var g = m;
2805
- if (!(!ge.length || ge[ge.length - 1] !== i)) {
2806
- var w = "deltaY" in g ? hn(g) : Ve(g), b = t.current.filter(function(E) {
2807
- return E.name === g.type && (E.target === g.target || g.target === E.shadowParent) && Nc(E.delta, w);
2808
- })[0];
2809
- if (b && b.should) {
2810
- g.cancelable && g.preventDefault();
2811
- return;
2812
- }
2813
- if (!b) {
2814
- var x = (c.current.shards || []).map(vn).filter(Boolean).filter(function(E) {
2815
- return E.contains(g.target);
2816
- }), C = x.length > 0 ? s(g, x[0]) : !c.current.noIsolation;
2817
- C && g.cancelable && g.preventDefault();
2818
- }
2819
- }
2820
- }, []), u = a.useCallback(function(m, g, w, b) {
2821
- var x = { name: m, delta: g, target: w, should: b, shadowParent: $c(w) };
2822
- t.current.push(x), setTimeout(function() {
2823
- t.current = t.current.filter(function(C) {
2824
- return C !== x;
2825
- });
2826
- }, 1);
2827
- }, []), d = a.useCallback(function(m) {
2828
- n.current = Ve(m), r.current = void 0;
2829
- }, []), l = a.useCallback(function(m) {
2830
- u(m.type, hn(m), m.target, s(m, e.lockRef.current));
2831
- }, []), p = a.useCallback(function(m) {
2832
- u(m.type, Ve(m), m.target, s(m, e.lockRef.current));
2833
- }, []);
2834
- a.useEffect(function() {
2835
- return ge.push(i), e.setCallbacks({
2836
- onScrollCapture: l,
2837
- onWheelCapture: l,
2838
- onTouchMoveCapture: p
2839
- }), document.addEventListener("wheel", f, ve), document.addEventListener("touchmove", f, ve), document.addEventListener("touchstart", d, ve), function() {
2840
- ge = ge.filter(function(m) {
2841
- return m !== i;
2842
- }), document.removeEventListener("wheel", f, ve), document.removeEventListener("touchmove", f, ve), document.removeEventListener("touchstart", d, ve);
2843
- };
2844
- }, []);
2845
- var h = e.removeScrollBar, v = e.inert;
2846
- return a.createElement(
2847
- a.Fragment,
2848
- null,
2849
- v ? a.createElement(i, { styles: Lc(o) }) : null,
2850
- h ? a.createElement(Mc, { gapMode: e.gapMode }) : null
2851
- );
2852
- }
2853
- function $c(e) {
2854
- for (var t = null; e !== null; )
2855
- e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
2856
- return t;
2857
- }
2858
- const Bc = pc(ir, kc);
2859
- var lr = a.forwardRef(function(e, t) {
2860
- return a.createElement(ct, Q({}, e, { ref: t, sideCar: Bc }));
2861
- });
2862
- lr.classNames = ct.classNames;
2863
- const Wc = lr;
2864
- var Pt = ["Enter", " "], Uc = ["ArrowDown", "PageUp", "Home"], fr = ["ArrowUp", "PageDown", "End"], Kc = [...Uc, ...fr], Gc = {
2865
- ltr: [...Pt, "ArrowRight"],
2866
- rtl: [...Pt, "ArrowLeft"]
2867
- }, Hc = {
2868
- ltr: ["ArrowLeft"],
2869
- rtl: ["ArrowRight"]
2870
- }, Fe = "Menu", [De, Vc, zc] = Cn(Fe), [pe, dr] = yn(Fe, [
2871
- zc,
2872
- Wn,
2873
- qn
2874
- ]), st = Wn(), pr = qn(), [Yc, me] = pe(Fe), [jc, ke] = pe(Fe), mr = (e) => {
2875
- const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: i, modal: c = !0 } = e, s = st(t), [f, u] = a.useState(null), d = a.useRef(!1), l = j(i), p = En(o);
2876
- return a.useEffect(() => {
2877
- const h = () => {
2878
- d.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
2879
- }, v = () => d.current = !1;
2880
- return document.addEventListener("keydown", h, { capture: !0 }), () => {
2881
- document.removeEventListener("keydown", h, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
2882
- };
2883
- }, []), /* @__PURE__ */ y(Ni, { ...s, children: /* @__PURE__ */ y(
2884
- Yc,
2885
- {
2886
- scope: t,
2887
- open: n,
2888
- onOpenChange: l,
2889
- content: f,
2890
- onContentChange: u,
2891
- children: /* @__PURE__ */ y(
2892
- jc,
2893
- {
2894
- scope: t,
2895
- onClose: a.useCallback(() => l(!1), [l]),
2896
- isUsingKeyboardRef: d,
2897
- dir: p,
2898
- modal: c,
2899
- children: r
2900
- }
2901
- )
2902
- }
2903
- ) });
2904
- };
2905
- mr.displayName = Fe;
2906
- var Xc = "MenuAnchor", $t = a.forwardRef(
2907
- (e, t) => {
2908
- const { __scopeMenu: n, ...r } = e, o = st(n);
2909
- return /* @__PURE__ */ y(Li, { ...o, ...r, ref: t });
2910
- }
2911
- );
2912
- $t.displayName = Xc;
2913
- var Bt = "MenuPortal", [Zc, hr] = pe(Bt, {
2914
- forceMount: void 0
2915
- }), vr = (e) => {
2916
- const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, i = me(Bt, t);
2917
- return /* @__PURE__ */ y(Zc, { scope: t, forceMount: n, children: /* @__PURE__ */ y(Le, { present: n || i.open, children: /* @__PURE__ */ y(Xn, { asChild: !0, container: o, children: r }) }) });
2918
- };
2919
- vr.displayName = Bt;
2920
- var Y = "MenuContent", [qc, Wt] = pe(Y), gr = a.forwardRef(
2921
- (e, t) => {
2922
- const n = hr(Y, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = me(Y, e.__scopeMenu), c = ke(Y, e.__scopeMenu);
2923
- return /* @__PURE__ */ y(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(Le, { present: r || i.open, children: /* @__PURE__ */ y(De.Slot, { scope: e.__scopeMenu, children: c.modal ? /* @__PURE__ */ y(Qc, { ...o, ref: t }) : /* @__PURE__ */ y(Jc, { ...o, ref: t }) }) }) });
2924
- }
2925
- ), Qc = a.forwardRef(
2926
- (e, t) => {
2927
- const n = me(Y, e.__scopeMenu), r = a.useRef(null), o = G(t, r);
2928
- return a.useEffect(() => {
2929
- const i = r.current;
2930
- if (i)
2931
- return rc(i);
2932
- }, []), /* @__PURE__ */ y(
2933
- Ut,
2934
- {
2935
- ...e,
2936
- ref: o,
2937
- trapFocus: n.open,
2938
- disableOutsidePointerEvents: n.open,
2939
- disableOutsideScroll: !0,
2940
- onFocusOutside: O(
2941
- e.onFocusOutside,
2942
- (i) => i.preventDefault(),
2943
- { checkForDefaultPrevented: !1 }
2944
- ),
2945
- onDismiss: () => n.onOpenChange(!1)
2946
- }
2947
- );
2948
- }
2949
- ), Jc = a.forwardRef((e, t) => {
2950
- const n = me(Y, e.__scopeMenu);
2951
- return /* @__PURE__ */ y(
2952
- Ut,
2953
- {
2954
- ...e,
2955
- ref: t,
2956
- trapFocus: !1,
2957
- disableOutsidePointerEvents: !1,
2958
- disableOutsideScroll: !1,
2959
- onDismiss: () => n.onOpenChange(!1)
2960
- }
2961
- );
2962
- }), Ut = a.forwardRef(
2963
- (e, t) => {
2964
- const {
2965
- __scopeMenu: n,
2966
- loop: r = !1,
2967
- trapFocus: o,
2968
- onOpenAutoFocus: i,
2969
- onCloseAutoFocus: c,
2970
- disableOutsidePointerEvents: s,
2971
- onEntryFocus: f,
2972
- onEscapeKeyDown: u,
2973
- onPointerDownOutside: d,
2974
- onFocusOutside: l,
2975
- onInteractOutside: p,
2976
- onDismiss: h,
2977
- disableOutsideScroll: v,
2978
- ...m
2979
- } = e, g = me(Y, n), w = ke(Y, n), b = st(n), x = pr(n), C = Vc(n), [E, M] = a.useState(null), R = a.useRef(null), P = G(t, R, g.onContentChange), D = a.useRef(0), _ = a.useRef(""), F = a.useRef(0), k = a.useRef(null), N = a.useRef("right"), I = a.useRef(0), B = v ? Wc : a.Fragment, T = v ? { as: Oe, allowPinchZoom: !0 } : void 0, $ = (S) => {
2980
- var ne, Re;
2981
- const L = _.current + S, W = C().filter((z) => !z.disabled), q = document.activeElement, Ee = (ne = W.find((z) => z.ref.current === q)) == null ? void 0 : ne.textValue, Se = W.map((z) => z.textValue), $e = fs(Se, L, Ee), ue = (Re = W.find((z) => z.textValue === $e)) == null ? void 0 : Re.ref.current;
2982
- (function z(Me) {
2983
- _.current = Me, window.clearTimeout(D.current), Me !== "" && (D.current = window.setTimeout(() => z(""), 1e3));
2984
- })(L), ue && setTimeout(() => ue.focus());
2985
- };
2986
- a.useEffect(() => () => window.clearTimeout(D.current), []), wo();
2987
- const A = a.useCallback((S) => {
2988
- var W, q;
2989
- return N.current === ((W = k.current) == null ? void 0 : W.side) && ps(S, (q = k.current) == null ? void 0 : q.area);
2990
- }, []);
2991
- return /* @__PURE__ */ y(
2992
- qc,
2993
- {
2994
- scope: n,
2995
- searchRef: _,
2996
- onItemEnter: a.useCallback(
2997
- (S) => {
2998
- A(S) && S.preventDefault();
2999
- },
3000
- [A]
3001
- ),
3002
- onItemLeave: a.useCallback(
3003
- (S) => {
3004
- var L;
3005
- A(S) || ((L = R.current) == null || L.focus(), M(null));
3006
- },
3007
- [A]
3008
- ),
3009
- onTriggerLeave: a.useCallback(
3010
- (S) => {
3011
- A(S) && S.preventDefault();
3012
- },
3013
- [A]
3014
- ),
3015
- pointerGraceTimerRef: F,
3016
- onPointerGraceIntentChange: a.useCallback((S) => {
3017
- k.current = S;
3018
- }, []),
3019
- children: /* @__PURE__ */ y(B, { ...T, children: /* @__PURE__ */ y(
3020
- Pn,
3021
- {
3022
- asChild: !0,
3023
- trapped: o,
3024
- onMountAutoFocus: O(i, (S) => {
3025
- var L;
3026
- S.preventDefault(), (L = R.current) == null || L.focus({ preventScroll: !0 });
3027
- }),
3028
- onUnmountAutoFocus: c,
3029
- children: /* @__PURE__ */ y(
3030
- Rn,
3031
- {
3032
- asChild: !0,
3033
- disableOutsidePointerEvents: s,
3034
- onEscapeKeyDown: u,
3035
- onPointerDownOutside: d,
3036
- onFocusOutside: l,
3037
- onInteractOutside: p,
3038
- onDismiss: h,
3039
- children: /* @__PURE__ */ y(
3040
- Qi,
3041
- {
3042
- asChild: !0,
3043
- ...x,
3044
- dir: w.dir,
3045
- orientation: "vertical",
3046
- loop: r,
3047
- currentTabStopId: E,
3048
- onCurrentTabStopIdChange: M,
3049
- onEntryFocus: O(f, (S) => {
3050
- w.isUsingKeyboardRef.current || S.preventDefault();
3051
- }),
3052
- preventScrollOnEntryFocus: !0,
3053
- children: /* @__PURE__ */ y(
3054
- Fi,
3055
- {
3056
- role: "menu",
3057
- "aria-orientation": "vertical",
3058
- "data-state": Ir(g.open),
3059
- "data-radix-menu-content": "",
3060
- dir: w.dir,
3061
- ...b,
3062
- ...m,
3063
- ref: P,
3064
- style: { outline: "none", ...m.style },
3065
- onKeyDown: O(m.onKeyDown, (S) => {
3066
- const W = S.target.closest("[data-radix-menu-content]") === S.currentTarget, q = S.ctrlKey || S.altKey || S.metaKey, Ee = S.key.length === 1;
3067
- W && (S.key === "Tab" && S.preventDefault(), !q && Ee && $(S.key));
3068
- const Se = R.current;
3069
- if (S.target !== Se || !Kc.includes(S.key))
3070
- return;
3071
- S.preventDefault();
3072
- const ue = C().filter((ne) => !ne.disabled).map((ne) => ne.ref.current);
3073
- fr.includes(S.key) && ue.reverse(), us(ue);
3074
- }),
3075
- onBlur: O(e.onBlur, (S) => {
3076
- S.currentTarget.contains(S.target) || (window.clearTimeout(D.current), _.current = "");
3077
- }),
3078
- onPointerMove: O(
3079
- e.onPointerMove,
3080
- Ie((S) => {
3081
- const L = S.target, W = I.current !== S.clientX;
3082
- if (S.currentTarget.contains(L) && W) {
3083
- const q = S.clientX > I.current ? "right" : "left";
3084
- N.current = q, I.current = S.clientX;
3085
- }
3086
- })
3087
- )
3088
- }
3089
- )
3090
- }
3091
- )
3092
- }
3093
- )
3094
- }
3095
- ) })
3096
- }
3097
- );
3098
- }
3099
- );
3100
- gr.displayName = Y;
3101
- var es = "MenuGroup", Kt = a.forwardRef(
3102
- (e, t) => {
3103
- const { __scopeMenu: n, ...r } = e;
3104
- return /* @__PURE__ */ y(U.div, { role: "group", ...r, ref: t });
3105
- }
3106
- );
3107
- Kt.displayName = es;
3108
- var ts = "MenuLabel", wr = a.forwardRef(
3109
- (e, t) => {
3110
- const { __scopeMenu: n, ...r } = e;
3111
- return /* @__PURE__ */ y(U.div, { ...r, ref: t });
3112
- }
3113
- );
3114
- wr.displayName = ts;
3115
- var Je = "MenuItem", gn = "menu.itemSelect", at = a.forwardRef(
3116
- (e, t) => {
3117
- const { disabled: n = !1, onSelect: r, ...o } = e, i = a.useRef(null), c = ke(Je, e.__scopeMenu), s = Wt(Je, e.__scopeMenu), f = G(t, i), u = a.useRef(!1), d = () => {
3118
- const l = i.current;
3119
- if (!n && l) {
3120
- const p = new CustomEvent(gn, { bubbles: !0, cancelable: !0 });
3121
- l.addEventListener(gn, (h) => r == null ? void 0 : r(h), { once: !0 }), xn(l, p), p.defaultPrevented ? u.current = !1 : c.onClose();
3122
- }
3123
- };
3124
- return /* @__PURE__ */ y(
3125
- yr,
3126
- {
3127
- ...o,
3128
- ref: f,
3129
- disabled: n,
3130
- onClick: O(e.onClick, d),
3131
- onPointerDown: (l) => {
3132
- var p;
3133
- (p = e.onPointerDown) == null || p.call(e, l), u.current = !0;
3134
- },
3135
- onPointerUp: O(e.onPointerUp, (l) => {
3136
- var p;
3137
- u.current || (p = l.currentTarget) == null || p.click();
3138
- }),
3139
- onKeyDown: O(e.onKeyDown, (l) => {
3140
- const p = s.searchRef.current !== "";
3141
- n || p && l.key === " " || Pt.includes(l.key) && (l.currentTarget.click(), l.preventDefault());
3142
- })
3143
- }
3144
- );
3145
- }
3146
- );
3147
- at.displayName = Je;
3148
- var yr = a.forwardRef(
3149
- (e, t) => {
3150
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...i } = e, c = Wt(Je, n), s = pr(n), f = a.useRef(null), u = G(t, f), [d, l] = a.useState(!1), [p, h] = a.useState("");
3151
- return a.useEffect(() => {
3152
- const v = f.current;
3153
- v && h((v.textContent ?? "").trim());
3154
- }, [i.children]), /* @__PURE__ */ y(
3155
- De.ItemSlot,
3156
- {
3157
- scope: n,
3158
- disabled: r,
3159
- textValue: o ?? p,
3160
- children: /* @__PURE__ */ y(Ji, { asChild: !0, ...s, focusable: !r, children: /* @__PURE__ */ y(
3161
- U.div,
3162
- {
3163
- role: "menuitem",
3164
- "data-highlighted": d ? "" : void 0,
3165
- "aria-disabled": r || void 0,
3166
- "data-disabled": r ? "" : void 0,
3167
- ...i,
3168
- ref: u,
3169
- onPointerMove: O(
3170
- e.onPointerMove,
3171
- Ie((v) => {
3172
- r ? c.onItemLeave(v) : (c.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 }));
3173
- })
3174
- ),
3175
- onPointerLeave: O(
3176
- e.onPointerLeave,
3177
- Ie((v) => c.onItemLeave(v))
3178
- ),
3179
- onFocus: O(e.onFocus, () => l(!0)),
3180
- onBlur: O(e.onBlur, () => l(!1))
3181
- }
3182
- ) })
3183
- }
3184
- );
3185
- }
3186
- ), ns = "MenuCheckboxItem", br = a.forwardRef(
3187
- (e, t) => {
3188
- const { checked: n = !1, onCheckedChange: r, ...o } = e;
3189
- return /* @__PURE__ */ y(Rr, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ y(
3190
- at,
3191
- {
3192
- role: "menuitemcheckbox",
3193
- "aria-checked": et(n) ? "mixed" : n,
3194
- ...o,
3195
- ref: t,
3196
- "data-state": Ht(n),
3197
- onSelect: O(
3198
- o.onSelect,
3199
- () => r == null ? void 0 : r(et(n) ? !0 : !n),
3200
- { checkForDefaultPrevented: !1 }
3201
- )
3202
- }
3203
- ) });
3204
- }
3205
- );
3206
- br.displayName = ns;
3207
- var xr = "MenuRadioGroup", [rs, os] = pe(
3208
- xr,
3209
- { value: void 0, onValueChange: () => {
3210
- } }
3211
- ), Cr = a.forwardRef(
3212
- (e, t) => {
3213
- const { value: n, onValueChange: r, ...o } = e, i = j(r);
3214
- return /* @__PURE__ */ y(rs, { scope: e.__scopeMenu, value: n, onValueChange: i, children: /* @__PURE__ */ y(Kt, { ...o, ref: t }) });
3215
- }
3216
- );
3217
- Cr.displayName = xr;
3218
- var Er = "MenuRadioItem", Sr = a.forwardRef(
3219
- (e, t) => {
3220
- const { value: n, ...r } = e, o = os(Er, e.__scopeMenu), i = n === o.value;
3221
- return /* @__PURE__ */ y(Rr, { scope: e.__scopeMenu, checked: i, children: /* @__PURE__ */ y(
3222
- at,
3223
- {
3224
- role: "menuitemradio",
3225
- "aria-checked": i,
3226
- ...r,
3227
- ref: t,
3228
- "data-state": Ht(i),
3229
- onSelect: O(
3230
- r.onSelect,
3231
- () => {
3232
- var c;
3233
- return (c = o.onValueChange) == null ? void 0 : c.call(o, n);
3234
- },
3235
- { checkForDefaultPrevented: !1 }
3236
- )
3237
- }
3238
- ) });
3239
- }
3240
- );
3241
- Sr.displayName = Er;
3242
- var Gt = "MenuItemIndicator", [Rr, is] = pe(
3243
- Gt,
3244
- { checked: !1 }
3245
- ), Mr = a.forwardRef(
3246
- (e, t) => {
3247
- const { __scopeMenu: n, forceMount: r, ...o } = e, i = is(Gt, n);
3248
- return /* @__PURE__ */ y(
3249
- Le,
3250
- {
3251
- present: r || et(i.checked) || i.checked === !0,
3252
- children: /* @__PURE__ */ y(
3253
- U.span,
3254
- {
3255
- ...o,
3256
- ref: t,
3257
- "data-state": Ht(i.checked)
3258
- }
3259
- )
3260
- }
3261
- );
3262
- }
3263
- );
3264
- Mr.displayName = Gt;
3265
- var cs = "MenuSeparator", Pr = a.forwardRef(
3266
- (e, t) => {
3267
- const { __scopeMenu: n, ...r } = e;
3268
- return /* @__PURE__ */ y(
3269
- U.div,
3270
- {
3271
- role: "separator",
3272
- "aria-orientation": "horizontal",
3273
- ...r,
3274
- ref: t
3275
- }
3276
- );
3277
- }
3278
- );
3279
- Pr.displayName = cs;
3280
- var ss = "MenuArrow", Ar = a.forwardRef(
3281
- (e, t) => {
3282
- const { __scopeMenu: n, ...r } = e, o = st(n);
3283
- return /* @__PURE__ */ y(ki, { ...o, ...r, ref: t });
3284
- }
3285
- );
3286
- Ar.displayName = ss;
3287
- var as = "MenuSub", [ta, Or] = pe(as), Ae = "MenuSubTrigger", _r = a.forwardRef(
3288
- (e, t) => {
3289
- const n = me(Ae, e.__scopeMenu), r = ke(Ae, e.__scopeMenu), o = Or(Ae, e.__scopeMenu), i = Wt(Ae, e.__scopeMenu), c = a.useRef(null), { pointerGraceTimerRef: s, onPointerGraceIntentChange: f } = i, u = { __scopeMenu: e.__scopeMenu }, d = a.useCallback(() => {
3290
- c.current && window.clearTimeout(c.current), c.current = null;
3291
- }, []);
3292
- return a.useEffect(() => d, [d]), a.useEffect(() => {
3293
- const l = s.current;
3294
- return () => {
3295
- window.clearTimeout(l), f(null);
3296
- };
3297
- }, [s, f]), /* @__PURE__ */ y($t, { asChild: !0, ...u, children: /* @__PURE__ */ y(
3298
- yr,
3299
- {
3300
- id: o.triggerId,
3301
- "aria-haspopup": "menu",
3302
- "aria-expanded": n.open,
3303
- "aria-controls": o.contentId,
3304
- "data-state": Ir(n.open),
3305
- ...e,
3306
- ref: tt(t, o.onTriggerChange),
3307
- onClick: (l) => {
3308
- var p;
3309
- (p = e.onClick) == null || p.call(e, l), !(e.disabled || l.defaultPrevented) && (l.currentTarget.focus(), n.open || n.onOpenChange(!0));
3310
- },
3311
- onPointerMove: O(
3312
- e.onPointerMove,
3313
- Ie((l) => {
3314
- i.onItemEnter(l), !l.defaultPrevented && !e.disabled && !n.open && !c.current && (i.onPointerGraceIntentChange(null), c.current = window.setTimeout(() => {
3315
- n.onOpenChange(!0), d();
3316
- }, 100));
3317
- })
3318
- ),
3319
- onPointerLeave: O(
3320
- e.onPointerLeave,
3321
- Ie((l) => {
3322
- var h, v;
3323
- d();
3324
- const p = (h = n.content) == null ? void 0 : h.getBoundingClientRect();
3325
- if (p) {
3326
- const m = (v = n.content) == null ? void 0 : v.dataset.side, g = m === "right", w = g ? -5 : 5, b = p[g ? "left" : "right"], x = p[g ? "right" : "left"];
3327
- i.onPointerGraceIntentChange({
3328
- area: [
3329
- // Apply a bleed on clientX to ensure that our exit point is
3330
- // consistently within polygon bounds
3331
- { x: l.clientX + w, y: l.clientY },
3332
- { x: b, y: p.top },
3333
- { x, y: p.top },
3334
- { x, y: p.bottom },
3335
- { x: b, y: p.bottom }
3336
- ],
3337
- side: m
3338
- }), window.clearTimeout(s.current), s.current = window.setTimeout(
3339
- () => i.onPointerGraceIntentChange(null),
3340
- 300
3341
- );
3342
- } else {
3343
- if (i.onTriggerLeave(l), l.defaultPrevented)
3344
- return;
3345
- i.onPointerGraceIntentChange(null);
3346
- }
3347
- })
3348
- ),
3349
- onKeyDown: O(e.onKeyDown, (l) => {
3350
- var h;
3351
- const p = i.searchRef.current !== "";
3352
- e.disabled || p && l.key === " " || Gc[r.dir].includes(l.key) && (n.onOpenChange(!0), (h = n.content) == null || h.focus(), l.preventDefault());
3353
- })
3354
- }
3355
- ) });
3356
- }
3357
- );
3358
- _r.displayName = Ae;
3359
- var Tr = "MenuSubContent", Dr = a.forwardRef(
3360
- (e, t) => {
3361
- const n = hr(Y, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = me(Y, e.__scopeMenu), c = ke(Y, e.__scopeMenu), s = Or(Tr, e.__scopeMenu), f = a.useRef(null), u = G(t, f);
3362
- return /* @__PURE__ */ y(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(Le, { present: r || i.open, children: /* @__PURE__ */ y(De.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(
3363
- Ut,
3364
- {
3365
- id: s.contentId,
3366
- "aria-labelledby": s.triggerId,
3367
- ...o,
3368
- ref: u,
3369
- align: "start",
3370
- side: c.dir === "rtl" ? "left" : "right",
3371
- disableOutsidePointerEvents: !1,
3372
- disableOutsideScroll: !1,
3373
- trapFocus: !1,
3374
- onOpenAutoFocus: (d) => {
3375
- var l;
3376
- c.isUsingKeyboardRef.current && ((l = f.current) == null || l.focus()), d.preventDefault();
3377
- },
3378
- onCloseAutoFocus: (d) => d.preventDefault(),
3379
- onFocusOutside: O(e.onFocusOutside, (d) => {
3380
- d.target !== s.trigger && i.onOpenChange(!1);
3381
- }),
3382
- onEscapeKeyDown: O(e.onEscapeKeyDown, (d) => {
3383
- c.onClose(), d.preventDefault();
3384
- }),
3385
- onKeyDown: O(e.onKeyDown, (d) => {
3386
- var h;
3387
- const l = d.currentTarget.contains(d.target), p = Hc[c.dir].includes(d.key);
3388
- l && p && (i.onOpenChange(!1), (h = s.trigger) == null || h.focus(), d.preventDefault());
3389
- })
3390
- }
3391
- ) }) }) });
3392
- }
3393
- );
3394
- Dr.displayName = Tr;
3395
- function Ir(e) {
3396
- return e ? "open" : "closed";
3397
- }
3398
- function et(e) {
3399
- return e === "indeterminate";
3400
- }
3401
- function Ht(e) {
3402
- return et(e) ? "indeterminate" : e ? "checked" : "unchecked";
3403
- }
3404
- function us(e) {
3405
- const t = document.activeElement;
3406
- for (const n of e)
3407
- if (n === t || (n.focus(), document.activeElement !== t))
3408
- return;
3409
- }
3410
- function ls(e, t) {
3411
- return e.map((n, r) => e[(t + r) % e.length]);
3412
- }
3413
- function fs(e, t, n) {
3414
- const o = t.length > 1 && Array.from(t).every((u) => u === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
3415
- let c = ls(e, Math.max(i, 0));
3416
- o.length === 1 && (c = c.filter((u) => u !== n));
3417
- const f = c.find(
3418
- (u) => u.toLowerCase().startsWith(o.toLowerCase())
3419
- );
3420
- return f !== n ? f : void 0;
3421
- }
3422
- function ds(e, t) {
3423
- const { x: n, y: r } = e;
3424
- let o = !1;
3425
- for (let i = 0, c = t.length - 1; i < t.length; c = i++) {
3426
- const s = t[i].x, f = t[i].y, u = t[c].x, d = t[c].y;
3427
- f > r != d > r && n < (u - s) * (r - f) / (d - f) + s && (o = !o);
3428
- }
3429
- return o;
3430
- }
3431
- function ps(e, t) {
3432
- if (!t)
3433
- return !1;
3434
- const n = { x: e.clientX, y: e.clientY };
3435
- return ds(n, t);
3436
- }
3437
- function Ie(e) {
3438
- return (t) => t.pointerType === "mouse" ? e(t) : void 0;
3439
- }
3440
- var ms = mr, hs = $t, vs = vr, gs = gr, ws = Kt, ys = wr, bs = at, xs = br, Cs = Cr, Es = Sr, Ss = Mr, Rs = Pr, Ms = Ar, Ps = _r, As = Dr, Vt = "DropdownMenu", [Os, na] = yn(
3441
- Vt,
3442
- [dr]
3443
- ), K = dr(), [_s, Nr] = Os(Vt), Lr = (e) => {
3444
- const {
3445
- __scopeDropdownMenu: t,
3446
- children: n,
3447
- dir: r,
3448
- open: o,
3449
- defaultOpen: i,
3450
- onOpenChange: c,
3451
- modal: s = !0
3452
- } = e, f = K(t), u = a.useRef(null), [d = !1, l] = bn({
3453
- prop: o,
3454
- defaultProp: i,
3455
- onChange: c
3456
- });
3457
- return /* @__PURE__ */ y(
3458
- _s,
3459
- {
3460
- scope: t,
3461
- triggerId: xt(),
3462
- triggerRef: u,
3463
- contentId: xt(),
3464
- open: d,
3465
- onOpenChange: l,
3466
- onOpenToggle: a.useCallback(() => l((p) => !p), [l]),
3467
- modal: s,
3468
- children: /* @__PURE__ */ y(ms, { ...f, open: d, onOpenChange: l, dir: r, modal: s, children: n })
3469
- }
3470
- );
3471
- };
3472
- Lr.displayName = Vt;
3473
- var Fr = "DropdownMenuTrigger", kr = a.forwardRef(
3474
- (e, t) => {
3475
- const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, i = Nr(Fr, n), c = K(n);
3476
- return /* @__PURE__ */ y(hs, { asChild: !0, ...c, children: /* @__PURE__ */ y(
3477
- U.button,
3478
- {
3479
- type: "button",
3480
- id: i.triggerId,
3481
- "aria-haspopup": "menu",
3482
- "aria-expanded": i.open,
3483
- "aria-controls": i.open ? i.contentId : void 0,
3484
- "data-state": i.open ? "open" : "closed",
3485
- "data-disabled": r ? "" : void 0,
3486
- disabled: r,
3487
- ...o,
3488
- ref: tt(t, i.triggerRef),
3489
- onPointerDown: O(e.onPointerDown, (s) => {
3490
- !r && s.button === 0 && s.ctrlKey === !1 && (i.onOpenToggle(), i.open || s.preventDefault());
3491
- }),
3492
- onKeyDown: O(e.onKeyDown, (s) => {
3493
- r || (["Enter", " "].includes(s.key) && i.onOpenToggle(), s.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(s.key) && s.preventDefault());
3494
- })
3495
- }
3496
- ) });
3497
- }
3498
- );
3499
- kr.displayName = Fr;
3500
- var Ts = "DropdownMenuPortal", $r = (e) => {
3501
- const { __scopeDropdownMenu: t, ...n } = e, r = K(t);
3502
- return /* @__PURE__ */ y(vs, { ...r, ...n });
3503
- };
3504
- $r.displayName = Ts;
3505
- var Br = "DropdownMenuContent", Wr = a.forwardRef(
3506
- (e, t) => {
3507
- const { __scopeDropdownMenu: n, ...r } = e, o = Nr(Br, n), i = K(n), c = a.useRef(!1);
3508
- return /* @__PURE__ */ y(
3509
- gs,
3510
- {
3511
- id: o.contentId,
3512
- "aria-labelledby": o.triggerId,
3513
- ...i,
3514
- ...r,
3515
- ref: t,
3516
- onCloseAutoFocus: O(e.onCloseAutoFocus, (s) => {
3517
- var f;
3518
- c.current || (f = o.triggerRef.current) == null || f.focus(), c.current = !1, s.preventDefault();
3519
- }),
3520
- onInteractOutside: O(e.onInteractOutside, (s) => {
3521
- const f = s.detail.originalEvent, u = f.button === 0 && f.ctrlKey === !0, d = f.button === 2 || u;
3522
- (!o.modal || d) && (c.current = !0);
3523
- }),
3524
- style: {
3525
- ...e.style,
3526
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3527
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
3528
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
3529
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
3530
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
3531
- }
3532
- }
3533
- );
3534
- }
3535
- );
3536
- Wr.displayName = Br;
3537
- var Ds = "DropdownMenuGroup", Ur = a.forwardRef(
3538
- (e, t) => {
3539
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3540
- return /* @__PURE__ */ y(ws, { ...o, ...r, ref: t });
3541
- }
3542
- );
3543
- Ur.displayName = Ds;
3544
- var Is = "DropdownMenuLabel", Ns = a.forwardRef(
3545
- (e, t) => {
3546
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3547
- return /* @__PURE__ */ y(ys, { ...o, ...r, ref: t });
3548
- }
3549
- );
3550
- Ns.displayName = Is;
3551
- var Ls = "DropdownMenuItem", Kr = a.forwardRef(
3552
- (e, t) => {
3553
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3554
- return /* @__PURE__ */ y(bs, { ...o, ...r, ref: t });
3555
- }
3556
- );
3557
- Kr.displayName = Ls;
3558
- var Fs = "DropdownMenuCheckboxItem", ks = a.forwardRef((e, t) => {
3559
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3560
- return /* @__PURE__ */ y(xs, { ...o, ...r, ref: t });
3561
- });
3562
- ks.displayName = Fs;
3563
- var $s = "DropdownMenuRadioGroup", Bs = a.forwardRef((e, t) => {
3564
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3565
- return /* @__PURE__ */ y(Cs, { ...o, ...r, ref: t });
3566
- });
3567
- Bs.displayName = $s;
3568
- var Ws = "DropdownMenuRadioItem", Us = a.forwardRef((e, t) => {
3569
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3570
- return /* @__PURE__ */ y(Es, { ...o, ...r, ref: t });
3571
- });
3572
- Us.displayName = Ws;
3573
- var Ks = "DropdownMenuItemIndicator", Gs = a.forwardRef((e, t) => {
3574
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3575
- return /* @__PURE__ */ y(Ss, { ...o, ...r, ref: t });
3576
- });
3577
- Gs.displayName = Ks;
3578
- var Hs = "DropdownMenuSeparator", Gr = a.forwardRef((e, t) => {
3579
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3580
- return /* @__PURE__ */ y(Rs, { ...o, ...r, ref: t });
3581
- });
3582
- Gr.displayName = Hs;
3583
- var Vs = "DropdownMenuArrow", zs = a.forwardRef(
3584
- (e, t) => {
3585
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3586
- return /* @__PURE__ */ y(Ms, { ...o, ...r, ref: t });
3587
- }
3588
- );
3589
- zs.displayName = Vs;
3590
- var Ys = "DropdownMenuSubTrigger", js = a.forwardRef((e, t) => {
3591
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3592
- return /* @__PURE__ */ y(Ps, { ...o, ...r, ref: t });
3593
- });
3594
- js.displayName = Ys;
3595
- var Xs = "DropdownMenuSubContent", Zs = a.forwardRef((e, t) => {
3596
- const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3597
- return /* @__PURE__ */ y(
3598
- As,
3599
- {
3600
- ...o,
3601
- ...r,
3602
- ref: t,
3603
- style: {
3604
- ...e.style,
3605
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3606
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
3607
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
3608
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
3609
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
3610
- }
3611
- }
3612
- );
3613
- });
3614
- Zs.displayName = Xs;
3615
- var ra = Lr, oa = kr, ia = $r, ca = Wr, sa = Ur, aa = Kr, ua = Gr;
3616
- export {
3617
- ca as C,
3618
- Rn as D,
3619
- Pn as F,
3620
- sa as G,
3621
- aa as I,
3622
- ia as P,
3623
- ra as R,
3624
- ua as S,
3625
- oa as T,
3626
- U as a,
3627
- O as b,
3628
- yn as c,
3629
- Le as d,
3630
- Wc as e,
3631
- Oe as f,
3632
- wo as g,
3633
- rc as h,
3634
- ea as i,
3635
- bn as j,
3636
- xt as k,
3637
- Xn as l,
3638
- G as u
3639
- };