@still-forest/canopy 0.37.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2911 +0,0 @@
1
- import { c as Vn, f as Me, u as Y } from "./calendar-DKwGFkIw.js";
2
- import * as l from "react";
3
- import oe, { useState as Un, useLayoutEffect as Yn } from "react";
4
- import { j as S } from "./jsx-runtime-B0GD0xBr.js";
5
- import { c as Xn } from "./index-CRiPKpXj.js";
6
- import * as Wt from "react-dom";
7
- import Kn from "react-dom";
8
- /**
9
- * @license lucide-react v0.543.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const qn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], rs = Vn("chevron-down", qn);
15
- var Gn = [
16
- "a",
17
- "button",
18
- "div",
19
- "form",
20
- "h2",
21
- "h3",
22
- "img",
23
- "input",
24
- "label",
25
- "li",
26
- "nav",
27
- "ol",
28
- "p",
29
- "select",
30
- "span",
31
- "svg",
32
- "ul"
33
- ], K = Gn.reduce((e, t) => {
34
- const n = Me(`Primitive.${t}`), r = l.forwardRef((o, i) => {
35
- const { asChild: s, ...c } = o, u = s ? n : t;
36
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ S.jsx(u, { ...c, ref: i });
37
- });
38
- return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
39
- }, {});
40
- function Zn(e, t) {
41
- e && Wt.flushSync(() => e.dispatchEvent(t));
42
- }
43
- var Qn = Object.freeze({
44
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
45
- position: "absolute",
46
- border: 0,
47
- width: 1,
48
- height: 1,
49
- padding: 0,
50
- margin: -1,
51
- overflow: "hidden",
52
- clip: "rect(0, 0, 0, 0)",
53
- whiteSpace: "nowrap",
54
- wordWrap: "normal"
55
- }), Jn = "VisuallyHidden", jt = l.forwardRef(
56
- (e, t) => /* @__PURE__ */ S.jsx(
57
- K.span,
58
- {
59
- ...e,
60
- ref: t,
61
- style: { ...Qn, ...e.style }
62
- }
63
- )
64
- );
65
- jt.displayName = Jn;
66
- var os = jt;
67
- function is(e, t) {
68
- const n = l.createContext(t), r = (i) => {
69
- const { children: s, ...c } = i, u = l.useMemo(() => c, Object.values(c));
70
- return /* @__PURE__ */ S.jsx(n.Provider, { value: u, children: s });
71
- };
72
- r.displayName = e + "Provider";
73
- function o(i) {
74
- const s = l.useContext(n);
75
- if (s) return s;
76
- if (t !== void 0) return t;
77
- throw new Error(`\`${i}\` must be used within \`${e}\``);
78
- }
79
- return [r, o];
80
- }
81
- function nt(e, t = []) {
82
- let n = [];
83
- function r(i, s) {
84
- const c = l.createContext(s), u = n.length;
85
- n = [...n, s];
86
- const a = (d) => {
87
- const { scope: h, children: m, ...g } = d, p = h?.[e]?.[u] || c, v = l.useMemo(() => g, Object.values(g));
88
- return /* @__PURE__ */ S.jsx(p.Provider, { value: v, children: m });
89
- };
90
- a.displayName = i + "Provider";
91
- function f(d, h) {
92
- const m = h?.[e]?.[u] || c, g = l.useContext(m);
93
- if (g) return g;
94
- if (s !== void 0) return s;
95
- throw new Error(`\`${d}\` must be used within \`${i}\``);
96
- }
97
- return [a, f];
98
- }
99
- const o = () => {
100
- const i = n.map((s) => l.createContext(s));
101
- return function(c) {
102
- const u = c?.[e] || i;
103
- return l.useMemo(
104
- () => ({ [`__scope${e}`]: { ...c, [e]: u } }),
105
- [c, u]
106
- );
107
- };
108
- };
109
- return o.scopeName = e, [r, er(o, ...t)];
110
- }
111
- function er(...e) {
112
- const t = e[0];
113
- if (e.length === 1) return t;
114
- const n = () => {
115
- const r = e.map((o) => ({
116
- useScope: o(),
117
- scopeName: o.scopeName
118
- }));
119
- return function(i) {
120
- const s = r.reduce((c, { useScope: u, scopeName: a }) => {
121
- const d = u(i)[`__scope${a}`];
122
- return { ...c, ...d };
123
- }, {});
124
- return l.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
125
- };
126
- };
127
- return n.scopeName = t.scopeName, n;
128
- }
129
- function ss(e) {
130
- const t = e + "CollectionProvider", [n, r] = nt(t), [o, i] = n(
131
- t,
132
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
133
- ), s = (p) => {
134
- const { scope: v, children: y } = p, w = oe.useRef(null), x = oe.useRef(/* @__PURE__ */ new Map()).current;
135
- return /* @__PURE__ */ S.jsx(o, { scope: v, itemMap: x, collectionRef: w, children: y });
136
- };
137
- s.displayName = t;
138
- const c = e + "CollectionSlot", u = Me(c), a = oe.forwardRef(
139
- (p, v) => {
140
- const { scope: y, children: w } = p, x = i(c, y), b = Y(v, x.collectionRef);
141
- return /* @__PURE__ */ S.jsx(u, { ref: b, children: w });
142
- }
143
- );
144
- a.displayName = c;
145
- const f = e + "CollectionItemSlot", d = "data-radix-collection-item", h = Me(f), m = oe.forwardRef(
146
- (p, v) => {
147
- const { scope: y, children: w, ...x } = p, b = oe.useRef(null), E = Y(v, b), P = i(f, y);
148
- return oe.useEffect(() => (P.itemMap.set(b, { ref: b, ...x }), () => void P.itemMap.delete(b))), /* @__PURE__ */ S.jsx(h, { [d]: "", ref: E, children: w });
149
- }
150
- );
151
- m.displayName = f;
152
- function g(p) {
153
- const v = i(e + "CollectionConsumer", p);
154
- return oe.useCallback(() => {
155
- const w = v.collectionRef.current;
156
- if (!w) return [];
157
- const x = Array.from(w.querySelectorAll(`[${d}]`));
158
- return Array.from(v.itemMap.values()).sort(
159
- (P, C) => x.indexOf(P.ref.current) - x.indexOf(C.ref.current)
160
- );
161
- }, [v.collectionRef, v.itemMap]);
162
- }
163
- return [
164
- { Provider: s, Slot: a, ItemSlot: m },
165
- g,
166
- r
167
- ];
168
- }
169
- function J(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
170
- return function(o) {
171
- if (e?.(o), n === !1 || !o.defaultPrevented)
172
- return t?.(o);
173
- };
174
- }
175
- var ee = globalThis?.document ? l.useLayoutEffect : () => {
176
- }, tr = l[" useInsertionEffect ".trim().toString()] || ee;
177
- function nr({
178
- prop: e,
179
- defaultProp: t,
180
- onChange: n = () => {
181
- },
182
- caller: r
183
- }) {
184
- const [o, i, s] = rr({
185
- defaultProp: t,
186
- onChange: n
187
- }), c = e !== void 0, u = c ? e : o;
188
- {
189
- const f = l.useRef(e !== void 0);
190
- l.useEffect(() => {
191
- const d = f.current;
192
- d !== c && console.warn(
193
- `${r} is changing from ${d ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
194
- ), f.current = c;
195
- }, [c, r]);
196
- }
197
- const a = l.useCallback(
198
- (f) => {
199
- if (c) {
200
- const d = or(f) ? f(e) : f;
201
- d !== e && s.current?.(d);
202
- } else
203
- i(f);
204
- },
205
- [c, e, i, s]
206
- );
207
- return [u, a];
208
- }
209
- function rr({
210
- defaultProp: e,
211
- onChange: t
212
- }) {
213
- const [n, r] = l.useState(e), o = l.useRef(n), i = l.useRef(t);
214
- return tr(() => {
215
- i.current = t;
216
- }, [t]), l.useEffect(() => {
217
- o.current !== n && (i.current?.(n), o.current = n);
218
- }, [n, o]), [n, r, i];
219
- }
220
- function or(e) {
221
- return typeof e == "function";
222
- }
223
- function ir(e, t) {
224
- return l.useReducer((n, r) => t[n][r] ?? n, e);
225
- }
226
- var rt = (e) => {
227
- const { present: t, children: n } = e, r = sr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : l.Children.only(n), i = Y(r.ref, cr(o));
228
- return typeof n == "function" || r.isPresent ? l.cloneElement(o, { ref: i }) : null;
229
- };
230
- rt.displayName = "Presence";
231
- function sr(e) {
232
- const [t, n] = l.useState(), r = l.useRef(null), o = l.useRef(e), i = l.useRef("none"), s = e ? "mounted" : "unmounted", [c, u] = ir(s, {
233
- mounted: {
234
- UNMOUNT: "unmounted",
235
- ANIMATION_OUT: "unmountSuspended"
236
- },
237
- unmountSuspended: {
238
- MOUNT: "mounted",
239
- ANIMATION_END: "unmounted"
240
- },
241
- unmounted: {
242
- MOUNT: "mounted"
243
- }
244
- });
245
- return l.useEffect(() => {
246
- const a = Ee(r.current);
247
- i.current = c === "mounted" ? a : "none";
248
- }, [c]), ee(() => {
249
- const a = r.current, f = o.current;
250
- if (f !== e) {
251
- const h = i.current, m = Ee(a);
252
- e ? u("MOUNT") : m === "none" || a?.display === "none" ? u("UNMOUNT") : u(f && h !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
253
- }
254
- }, [e, u]), ee(() => {
255
- if (t) {
256
- let a;
257
- const f = t.ownerDocument.defaultView ?? window, d = (m) => {
258
- const p = Ee(r.current).includes(CSS.escape(m.animationName));
259
- if (m.target === t && p && (u("ANIMATION_END"), !o.current)) {
260
- const v = t.style.animationFillMode;
261
- t.style.animationFillMode = "forwards", a = f.setTimeout(() => {
262
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
263
- });
264
- }
265
- }, h = (m) => {
266
- m.target === t && (i.current = Ee(r.current));
267
- };
268
- return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
269
- f.clearTimeout(a), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
270
- };
271
- } else
272
- u("ANIMATION_END");
273
- }, [t, u]), {
274
- isPresent: ["mounted", "unmountSuspended"].includes(c),
275
- ref: l.useCallback((a) => {
276
- r.current = a ? getComputedStyle(a) : null, n(a);
277
- }, [])
278
- };
279
- }
280
- function Ee(e) {
281
- return e?.animationName || "none";
282
- }
283
- function cr(e) {
284
- let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
285
- return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
286
- }
287
- var ar = l[" useId ".trim().toString()] || (() => {
288
- }), lr = 0;
289
- function ur(e) {
290
- const [t, n] = l.useState(ar());
291
- return ee(() => {
292
- n((r) => r ?? String(lr++));
293
- }, [e]), e || (t ? `radix-${t}` : "");
294
- }
295
- var fr = l.createContext(void 0);
296
- function cs(e) {
297
- const t = l.useContext(fr);
298
- return e || t || "ltr";
299
- }
300
- function fe(e) {
301
- const t = l.useRef(e);
302
- return l.useEffect(() => {
303
- t.current = e;
304
- }), l.useMemo(() => (...n) => t.current?.(...n), []);
305
- }
306
- function dr(e, t = globalThis?.document) {
307
- const n = fe(e);
308
- l.useEffect(() => {
309
- const r = (o) => {
310
- o.key === "Escape" && n(o);
311
- };
312
- return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
313
- }, [n, t]);
314
- }
315
- var pr = "DismissableLayer", Ze = "dismissableLayer.update", mr = "dismissableLayer.pointerDownOutside", hr = "dismissableLayer.focusOutside", ht, $t = l.createContext({
316
- layers: /* @__PURE__ */ new Set(),
317
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
318
- branches: /* @__PURE__ */ new Set()
319
- }), Bt = l.forwardRef(
320
- (e, t) => {
321
- const {
322
- disableOutsidePointerEvents: n = !1,
323
- onEscapeKeyDown: r,
324
- onPointerDownOutside: o,
325
- onFocusOutside: i,
326
- onInteractOutside: s,
327
- onDismiss: c,
328
- ...u
329
- } = e, a = l.useContext($t), [f, d] = l.useState(null), h = f?.ownerDocument ?? globalThis?.document, [, m] = l.useState({}), g = Y(t, (C) => d(C)), p = Array.from(a.layers), [v] = [...a.layersWithOutsidePointerEventsDisabled].slice(-1), y = p.indexOf(v), w = f ? p.indexOf(f) : -1, x = a.layersWithOutsidePointerEventsDisabled.size > 0, b = w >= y, E = yr((C) => {
330
- const R = C.target, T = [...a.branches].some((O) => O.contains(R));
331
- !b || T || (o?.(C), s?.(C), C.defaultPrevented || c?.());
332
- }, h), P = wr((C) => {
333
- const R = C.target;
334
- [...a.branches].some((O) => O.contains(R)) || (i?.(C), s?.(C), C.defaultPrevented || c?.());
335
- }, h);
336
- return dr((C) => {
337
- w === a.layers.size - 1 && (r?.(C), !C.defaultPrevented && c && (C.preventDefault(), c()));
338
- }, h), l.useEffect(() => {
339
- if (f)
340
- return n && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (ht = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(f)), a.layers.add(f), vt(), () => {
341
- n && a.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = ht);
342
- };
343
- }, [f, h, n, a]), l.useEffect(() => () => {
344
- f && (a.layers.delete(f), a.layersWithOutsidePointerEventsDisabled.delete(f), vt());
345
- }, [f, a]), l.useEffect(() => {
346
- const C = () => m({});
347
- return document.addEventListener(Ze, C), () => document.removeEventListener(Ze, C);
348
- }, []), /* @__PURE__ */ S.jsx(
349
- K.div,
350
- {
351
- ...u,
352
- ref: g,
353
- style: {
354
- pointerEvents: x ? b ? "auto" : "none" : void 0,
355
- ...e.style
356
- },
357
- onFocusCapture: J(e.onFocusCapture, P.onFocusCapture),
358
- onBlurCapture: J(e.onBlurCapture, P.onBlurCapture),
359
- onPointerDownCapture: J(
360
- e.onPointerDownCapture,
361
- E.onPointerDownCapture
362
- )
363
- }
364
- );
365
- }
366
- );
367
- Bt.displayName = pr;
368
- var vr = "DismissableLayerBranch", gr = l.forwardRef((e, t) => {
369
- const n = l.useContext($t), r = l.useRef(null), o = Y(t, r);
370
- return l.useEffect(() => {
371
- const i = r.current;
372
- if (i)
373
- return n.branches.add(i), () => {
374
- n.branches.delete(i);
375
- };
376
- }, [n.branches]), /* @__PURE__ */ S.jsx(K.div, { ...e, ref: o });
377
- });
378
- gr.displayName = vr;
379
- function yr(e, t = globalThis?.document) {
380
- const n = fe(e), r = l.useRef(!1), o = l.useRef(() => {
381
- });
382
- return l.useEffect(() => {
383
- const i = (c) => {
384
- if (c.target && !r.current) {
385
- let u = function() {
386
- Ht(
387
- mr,
388
- n,
389
- a,
390
- { discrete: !0 }
391
- );
392
- };
393
- const a = { originalEvent: c };
394
- c.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = u, t.addEventListener("click", o.current, { once: !0 })) : u();
395
- } else
396
- t.removeEventListener("click", o.current);
397
- r.current = !1;
398
- }, s = window.setTimeout(() => {
399
- t.addEventListener("pointerdown", i);
400
- }, 0);
401
- return () => {
402
- window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
403
- };
404
- }, [t, n]), {
405
- // ensures we check React component tree (not just DOM tree)
406
- onPointerDownCapture: () => r.current = !0
407
- };
408
- }
409
- function wr(e, t = globalThis?.document) {
410
- const n = fe(e), r = l.useRef(!1);
411
- return l.useEffect(() => {
412
- const o = (i) => {
413
- i.target && !r.current && Ht(hr, n, { originalEvent: i }, {
414
- discrete: !1
415
- });
416
- };
417
- return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
418
- }, [t, n]), {
419
- onFocusCapture: () => r.current = !0,
420
- onBlurCapture: () => r.current = !1
421
- };
422
- }
423
- function vt() {
424
- const e = new CustomEvent(Ze);
425
- document.dispatchEvent(e);
426
- }
427
- function Ht(e, t, n, { discrete: r }) {
428
- const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
429
- t && o.addEventListener(e, t, { once: !0 }), r ? Zn(o, i) : o.dispatchEvent(i);
430
- }
431
- var He = "focusScope.autoFocusOnMount", ze = "focusScope.autoFocusOnUnmount", gt = { bubbles: !1, cancelable: !0 }, xr = "FocusScope", zt = l.forwardRef((e, t) => {
432
- const {
433
- loop: n = !1,
434
- trapped: r = !1,
435
- onMountAutoFocus: o,
436
- onUnmountAutoFocus: i,
437
- ...s
438
- } = e, [c, u] = l.useState(null), a = fe(o), f = fe(i), d = l.useRef(null), h = Y(t, (p) => u(p)), m = l.useRef({
439
- paused: !1,
440
- pause() {
441
- this.paused = !0;
442
- },
443
- resume() {
444
- this.paused = !1;
445
- }
446
- }).current;
447
- l.useEffect(() => {
448
- if (r) {
449
- let p = function(x) {
450
- if (m.paused || !c) return;
451
- const b = x.target;
452
- c.contains(b) ? d.current = b : Q(d.current, { select: !0 });
453
- }, v = function(x) {
454
- if (m.paused || !c) return;
455
- const b = x.relatedTarget;
456
- b !== null && (c.contains(b) || Q(d.current, { select: !0 }));
457
- }, y = function(x) {
458
- if (document.activeElement === document.body)
459
- for (const E of x)
460
- E.removedNodes.length > 0 && Q(c);
461
- };
462
- document.addEventListener("focusin", p), document.addEventListener("focusout", v);
463
- const w = new MutationObserver(y);
464
- return c && w.observe(c, { childList: !0, subtree: !0 }), () => {
465
- document.removeEventListener("focusin", p), document.removeEventListener("focusout", v), w.disconnect();
466
- };
467
- }
468
- }, [r, c, m.paused]), l.useEffect(() => {
469
- if (c) {
470
- wt.add(m);
471
- const p = document.activeElement;
472
- if (!c.contains(p)) {
473
- const y = new CustomEvent(He, gt);
474
- c.addEventListener(He, a), c.dispatchEvent(y), y.defaultPrevented || (br(Ar(Vt(c)), { select: !0 }), document.activeElement === p && Q(c));
475
- }
476
- return () => {
477
- c.removeEventListener(He, a), setTimeout(() => {
478
- const y = new CustomEvent(ze, gt);
479
- c.addEventListener(ze, f), c.dispatchEvent(y), y.defaultPrevented || Q(p ?? document.body, { select: !0 }), c.removeEventListener(ze, f), wt.remove(m);
480
- }, 0);
481
- };
482
- }
483
- }, [c, a, f, m]);
484
- const g = l.useCallback(
485
- (p) => {
486
- if (!n && !r || m.paused) return;
487
- const v = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, y = document.activeElement;
488
- if (v && y) {
489
- const w = p.currentTarget, [x, b] = Er(w);
490
- x && b ? !p.shiftKey && y === b ? (p.preventDefault(), n && Q(x, { select: !0 })) : p.shiftKey && y === x && (p.preventDefault(), n && Q(b, { select: !0 })) : y === w && p.preventDefault();
491
- }
492
- },
493
- [n, r, m.paused]
494
- );
495
- return /* @__PURE__ */ S.jsx(K.div, { tabIndex: -1, ...s, ref: h, onKeyDown: g });
496
- });
497
- zt.displayName = xr;
498
- function br(e, { select: t = !1 } = {}) {
499
- const n = document.activeElement;
500
- for (const r of e)
501
- if (Q(r, { select: t }), document.activeElement !== n) return;
502
- }
503
- function Er(e) {
504
- const t = Vt(e), n = yt(t, e), r = yt(t.reverse(), e);
505
- return [n, r];
506
- }
507
- function Vt(e) {
508
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
509
- acceptNode: (r) => {
510
- const o = r.tagName === "INPUT" && r.type === "hidden";
511
- return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
512
- }
513
- });
514
- for (; n.nextNode(); ) t.push(n.currentNode);
515
- return t;
516
- }
517
- function yt(e, t) {
518
- for (const n of e)
519
- if (!Cr(n, { upTo: t })) return n;
520
- }
521
- function Cr(e, { upTo: t }) {
522
- if (getComputedStyle(e).visibility === "hidden") return !0;
523
- for (; e; ) {
524
- if (t !== void 0 && e === t) return !1;
525
- if (getComputedStyle(e).display === "none") return !0;
526
- e = e.parentElement;
527
- }
528
- return !1;
529
- }
530
- function Sr(e) {
531
- return e instanceof HTMLInputElement && "select" in e;
532
- }
533
- function Q(e, { select: t = !1 } = {}) {
534
- if (e && e.focus) {
535
- const n = document.activeElement;
536
- e.focus({ preventScroll: !0 }), e !== n && Sr(e) && t && e.select();
537
- }
538
- }
539
- var wt = Pr();
540
- function Pr() {
541
- let e = [];
542
- return {
543
- add(t) {
544
- const n = e[0];
545
- t !== n && n?.pause(), e = xt(e, t), e.unshift(t);
546
- },
547
- remove(t) {
548
- e = xt(e, t), e[0]?.resume();
549
- }
550
- };
551
- }
552
- function xt(e, t) {
553
- const n = [...e], r = n.indexOf(t);
554
- return r !== -1 && n.splice(r, 1), n;
555
- }
556
- function Ar(e) {
557
- return e.filter((t) => t.tagName !== "A");
558
- }
559
- var Rr = "Portal", Ut = l.forwardRef((e, t) => {
560
- const { container: n, ...r } = e, [o, i] = l.useState(!1);
561
- ee(() => i(!0), []);
562
- const s = n || o && globalThis?.document?.body;
563
- return s ? Kn.createPortal(/* @__PURE__ */ S.jsx(K.div, { ...r, ref: t }), s) : null;
564
- });
565
- Ut.displayName = Rr;
566
- var Ve = 0;
567
- function Or() {
568
- l.useEffect(() => {
569
- const e = document.querySelectorAll("[data-radix-focus-guard]");
570
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? bt()), document.body.insertAdjacentElement("beforeend", e[1] ?? bt()), Ve++, () => {
571
- Ve === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Ve--;
572
- };
573
- }, []);
574
- }
575
- function bt() {
576
- const e = document.createElement("span");
577
- 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;
578
- }
579
- var z = function() {
580
- return z = Object.assign || function(t) {
581
- for (var n, r = 1, o = arguments.length; r < o; r++) {
582
- n = arguments[r];
583
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
584
- }
585
- return t;
586
- }, z.apply(this, arguments);
587
- };
588
- function Yt(e, t) {
589
- var n = {};
590
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
591
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
592
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
593
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
594
- return n;
595
- }
596
- function Nr(e, t, n) {
597
- if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
598
- (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
599
- return e.concat(i || Array.prototype.slice.call(t));
600
- }
601
- var Oe = "right-scroll-bar-position", Ne = "width-before-scroll-bar", Tr = "with-scroll-bars-hidden", Mr = "--removed-body-scroll-bar-size";
602
- function Ue(e, t) {
603
- return typeof e == "function" ? e(t) : e && (e.current = t), e;
604
- }
605
- function Dr(e, t) {
606
- var n = Un(function() {
607
- return {
608
- // value
609
- value: e,
610
- // last callback
611
- callback: t,
612
- // "memoized" public interface
613
- facade: {
614
- get current() {
615
- return n.value;
616
- },
617
- set current(r) {
618
- var o = n.value;
619
- o !== r && (n.value = r, n.callback(r, o));
620
- }
621
- }
622
- };
623
- })[0];
624
- return n.callback = t, n.facade;
625
- }
626
- var Lr = typeof window < "u" ? l.useLayoutEffect : l.useEffect, Et = /* @__PURE__ */ new WeakMap();
627
- function Fr(e, t) {
628
- var n = Dr(null, function(r) {
629
- return e.forEach(function(o) {
630
- return Ue(o, r);
631
- });
632
- });
633
- return Lr(function() {
634
- var r = Et.get(n);
635
- if (r) {
636
- var o = new Set(r), i = new Set(e), s = n.current;
637
- o.forEach(function(c) {
638
- i.has(c) || Ue(c, null);
639
- }), i.forEach(function(c) {
640
- o.has(c) || Ue(c, s);
641
- });
642
- }
643
- Et.set(n, e);
644
- }, [e]), n;
645
- }
646
- function kr(e) {
647
- return e;
648
- }
649
- function _r(e, t) {
650
- t === void 0 && (t = kr);
651
- var n = [], r = !1, o = {
652
- read: function() {
653
- if (r)
654
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
655
- return n.length ? n[n.length - 1] : e;
656
- },
657
- useMedium: function(i) {
658
- var s = t(i, r);
659
- return n.push(s), function() {
660
- n = n.filter(function(c) {
661
- return c !== s;
662
- });
663
- };
664
- },
665
- assignSyncMedium: function(i) {
666
- for (r = !0; n.length; ) {
667
- var s = n;
668
- n = [], s.forEach(i);
669
- }
670
- n = {
671
- push: function(c) {
672
- return i(c);
673
- },
674
- filter: function() {
675
- return n;
676
- }
677
- };
678
- },
679
- assignMedium: function(i) {
680
- r = !0;
681
- var s = [];
682
- if (n.length) {
683
- var c = n;
684
- n = [], c.forEach(i), s = n;
685
- }
686
- var u = function() {
687
- var f = s;
688
- s = [], f.forEach(i);
689
- }, a = function() {
690
- return Promise.resolve().then(u);
691
- };
692
- a(), n = {
693
- push: function(f) {
694
- s.push(f), a();
695
- },
696
- filter: function(f) {
697
- return s = s.filter(f), n;
698
- }
699
- };
700
- }
701
- };
702
- return o;
703
- }
704
- function Ir(e) {
705
- e === void 0 && (e = {});
706
- var t = _r(null);
707
- return t.options = z({ async: !0, ssr: !1 }, e), t;
708
- }
709
- var Xt = function(e) {
710
- var t = e.sideCar, n = Yt(e, ["sideCar"]);
711
- if (!t)
712
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
713
- var r = t.read();
714
- if (!r)
715
- throw new Error("Sidecar medium not found");
716
- return l.createElement(r, z({}, n));
717
- };
718
- Xt.isSideCarExport = !0;
719
- function Wr(e, t) {
720
- return e.useMedium(t), Xt;
721
- }
722
- var Kt = Ir(), Ye = function() {
723
- }, _e = l.forwardRef(function(e, t) {
724
- var n = l.useRef(null), r = l.useState({
725
- onScrollCapture: Ye,
726
- onWheelCapture: Ye,
727
- onTouchMoveCapture: Ye
728
- }), o = r[0], i = r[1], s = e.forwardProps, c = e.children, u = e.className, a = e.removeScrollBar, f = e.enabled, d = e.shards, h = e.sideCar, m = e.noRelative, g = e.noIsolation, p = e.inert, v = e.allowPinchZoom, y = e.as, w = y === void 0 ? "div" : y, x = e.gapMode, b = Yt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = h, P = Fr([n, t]), C = z(z({}, b), o);
729
- return l.createElement(
730
- l.Fragment,
731
- null,
732
- f && l.createElement(E, { sideCar: Kt, removeScrollBar: a, shards: d, noRelative: m, noIsolation: g, inert: p, setCallbacks: i, allowPinchZoom: !!v, lockRef: n, gapMode: x }),
733
- s ? l.cloneElement(l.Children.only(c), z(z({}, C), { ref: P })) : l.createElement(w, z({}, C, { className: u, ref: P }), c)
734
- );
735
- });
736
- _e.defaultProps = {
737
- enabled: !0,
738
- removeScrollBar: !0,
739
- inert: !1
740
- };
741
- _e.classNames = {
742
- fullWidth: Ne,
743
- zeroRight: Oe
744
- };
745
- var jr = function() {
746
- if (typeof __webpack_nonce__ < "u")
747
- return __webpack_nonce__;
748
- };
749
- function $r() {
750
- if (!document)
751
- return null;
752
- var e = document.createElement("style");
753
- e.type = "text/css";
754
- var t = jr();
755
- return t && e.setAttribute("nonce", t), e;
756
- }
757
- function Br(e, t) {
758
- e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
759
- }
760
- function Hr(e) {
761
- var t = document.head || document.getElementsByTagName("head")[0];
762
- t.appendChild(e);
763
- }
764
- var zr = function() {
765
- var e = 0, t = null;
766
- return {
767
- add: function(n) {
768
- e == 0 && (t = $r()) && (Br(t, n), Hr(t)), e++;
769
- },
770
- remove: function() {
771
- e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
772
- }
773
- };
774
- }, Vr = function() {
775
- var e = zr();
776
- return function(t, n) {
777
- l.useEffect(function() {
778
- return e.add(t), function() {
779
- e.remove();
780
- };
781
- }, [t && n]);
782
- };
783
- }, qt = function() {
784
- var e = Vr(), t = function(n) {
785
- var r = n.styles, o = n.dynamic;
786
- return e(r, o), null;
787
- };
788
- return t;
789
- }, Ur = {
790
- left: 0,
791
- top: 0,
792
- right: 0,
793
- gap: 0
794
- }, Xe = function(e) {
795
- return parseInt(e || "", 10) || 0;
796
- }, Yr = function(e) {
797
- var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
798
- return [Xe(n), Xe(r), Xe(o)];
799
- }, Xr = function(e) {
800
- if (e === void 0 && (e = "margin"), typeof window > "u")
801
- return Ur;
802
- var t = Yr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
803
- return {
804
- left: t[0],
805
- top: t[1],
806
- right: t[2],
807
- gap: Math.max(0, r - n + t[2] - t[0])
808
- };
809
- }, Kr = qt(), le = "data-scroll-locked", qr = function(e, t, n, r) {
810
- var o = e.left, i = e.top, s = e.right, c = e.gap;
811
- return n === void 0 && (n = "margin"), `
812
- .`.concat(Tr, ` {
813
- overflow: hidden `).concat(r, `;
814
- padding-right: `).concat(c, "px ").concat(r, `;
815
- }
816
- body[`).concat(le, `] {
817
- overflow: hidden `).concat(r, `;
818
- overscroll-behavior: contain;
819
- `).concat([
820
- t && "position: relative ".concat(r, ";"),
821
- n === "margin" && `
822
- padding-left: `.concat(o, `px;
823
- padding-top: `).concat(i, `px;
824
- padding-right: `).concat(s, `px;
825
- margin-left:0;
826
- margin-top:0;
827
- margin-right: `).concat(c, "px ").concat(r, `;
828
- `),
829
- n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
830
- ].filter(Boolean).join(""), `
831
- }
832
-
833
- .`).concat(Oe, ` {
834
- right: `).concat(c, "px ").concat(r, `;
835
- }
836
-
837
- .`).concat(Ne, ` {
838
- margin-right: `).concat(c, "px ").concat(r, `;
839
- }
840
-
841
- .`).concat(Oe, " .").concat(Oe, ` {
842
- right: 0 `).concat(r, `;
843
- }
844
-
845
- .`).concat(Ne, " .").concat(Ne, ` {
846
- margin-right: 0 `).concat(r, `;
847
- }
848
-
849
- body[`).concat(le, `] {
850
- `).concat(Mr, ": ").concat(c, `px;
851
- }
852
- `);
853
- }, Ct = function() {
854
- var e = parseInt(document.body.getAttribute(le) || "0", 10);
855
- return isFinite(e) ? e : 0;
856
- }, Gr = function() {
857
- l.useEffect(function() {
858
- return document.body.setAttribute(le, (Ct() + 1).toString()), function() {
859
- var e = Ct() - 1;
860
- e <= 0 ? document.body.removeAttribute(le) : document.body.setAttribute(le, e.toString());
861
- };
862
- }, []);
863
- }, Zr = function(e) {
864
- var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
865
- Gr();
866
- var i = l.useMemo(function() {
867
- return Xr(o);
868
- }, [o]);
869
- return l.createElement(Kr, { styles: qr(i, !t, o, n ? "" : "!important") });
870
- }, Qe = !1;
871
- if (typeof window < "u")
872
- try {
873
- var Ce = Object.defineProperty({}, "passive", {
874
- get: function() {
875
- return Qe = !0, !0;
876
- }
877
- });
878
- window.addEventListener("test", Ce, Ce), window.removeEventListener("test", Ce, Ce);
879
- } catch {
880
- Qe = !1;
881
- }
882
- var se = Qe ? { passive: !1 } : !1, Qr = function(e) {
883
- return e.tagName === "TEXTAREA";
884
- }, Gt = function(e, t) {
885
- if (!(e instanceof Element))
886
- return !1;
887
- var n = window.getComputedStyle(e);
888
- return (
889
- // not-not-scrollable
890
- n[t] !== "hidden" && // contains scroll inside self
891
- !(n.overflowY === n.overflowX && !Qr(e) && n[t] === "visible")
892
- );
893
- }, Jr = function(e) {
894
- return Gt(e, "overflowY");
895
- }, eo = function(e) {
896
- return Gt(e, "overflowX");
897
- }, St = function(e, t) {
898
- var n = t.ownerDocument, r = t;
899
- do {
900
- typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
901
- var o = Zt(e, r);
902
- if (o) {
903
- var i = Qt(e, r), s = i[1], c = i[2];
904
- if (s > c)
905
- return !0;
906
- }
907
- r = r.parentNode;
908
- } while (r && r !== n.body);
909
- return !1;
910
- }, to = function(e) {
911
- var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
912
- return [
913
- t,
914
- n,
915
- r
916
- ];
917
- }, no = function(e) {
918
- var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
919
- return [
920
- t,
921
- n,
922
- r
923
- ];
924
- }, Zt = function(e, t) {
925
- return e === "v" ? Jr(t) : eo(t);
926
- }, Qt = function(e, t) {
927
- return e === "v" ? to(t) : no(t);
928
- }, ro = function(e, t) {
929
- return e === "h" && t === "rtl" ? -1 : 1;
930
- }, oo = function(e, t, n, r, o) {
931
- var i = ro(e, window.getComputedStyle(t).direction), s = i * r, c = n.target, u = t.contains(c), a = !1, f = s > 0, d = 0, h = 0;
932
- do {
933
- if (!c)
934
- break;
935
- var m = Qt(e, c), g = m[0], p = m[1], v = m[2], y = p - v - i * g;
936
- (g || y) && Zt(e, c) && (d += y, h += g);
937
- var w = c.parentNode;
938
- c = w && w.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? w.host : w;
939
- } while (
940
- // portaled content
941
- !u && c !== document.body || // self content
942
- u && (t.contains(c) || t === c)
943
- );
944
- return (f && Math.abs(d) < 1 || !f && Math.abs(h) < 1) && (a = !0), a;
945
- }, Se = function(e) {
946
- return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
947
- }, Pt = function(e) {
948
- return [e.deltaX, e.deltaY];
949
- }, At = function(e) {
950
- return e && "current" in e ? e.current : e;
951
- }, io = function(e, t) {
952
- return e[0] === t[0] && e[1] === t[1];
953
- }, so = function(e) {
954
- return `
955
- .block-interactivity-`.concat(e, ` {pointer-events: none;}
956
- .allow-interactivity-`).concat(e, ` {pointer-events: all;}
957
- `);
958
- }, co = 0, ce = [];
959
- function ao(e) {
960
- var t = l.useRef([]), n = l.useRef([0, 0]), r = l.useRef(), o = l.useState(co++)[0], i = l.useState(qt)[0], s = l.useRef(e);
961
- l.useEffect(function() {
962
- s.current = e;
963
- }, [e]), l.useEffect(function() {
964
- if (e.inert) {
965
- document.body.classList.add("block-interactivity-".concat(o));
966
- var p = Nr([e.lockRef.current], (e.shards || []).map(At), !0).filter(Boolean);
967
- return p.forEach(function(v) {
968
- return v.classList.add("allow-interactivity-".concat(o));
969
- }), function() {
970
- document.body.classList.remove("block-interactivity-".concat(o)), p.forEach(function(v) {
971
- return v.classList.remove("allow-interactivity-".concat(o));
972
- });
973
- };
974
- }
975
- }, [e.inert, e.lockRef.current, e.shards]);
976
- var c = l.useCallback(function(p, v) {
977
- if ("touches" in p && p.touches.length === 2 || p.type === "wheel" && p.ctrlKey)
978
- return !s.current.allowPinchZoom;
979
- var y = Se(p), w = n.current, x = "deltaX" in p ? p.deltaX : w[0] - y[0], b = "deltaY" in p ? p.deltaY : w[1] - y[1], E, P = p.target, C = Math.abs(x) > Math.abs(b) ? "h" : "v";
980
- if ("touches" in p && C === "h" && P.type === "range")
981
- return !1;
982
- var R = St(C, P);
983
- if (!R)
984
- return !0;
985
- if (R ? E = C : (E = C === "v" ? "h" : "v", R = St(C, P)), !R)
986
- return !1;
987
- if (!r.current && "changedTouches" in p && (x || b) && (r.current = E), !E)
988
- return !0;
989
- var T = r.current || E;
990
- return oo(T, v, p, T === "h" ? x : b);
991
- }, []), u = l.useCallback(function(p) {
992
- var v = p;
993
- if (!(!ce.length || ce[ce.length - 1] !== i)) {
994
- var y = "deltaY" in v ? Pt(v) : Se(v), w = t.current.filter(function(E) {
995
- return E.name === v.type && (E.target === v.target || v.target === E.shadowParent) && io(E.delta, y);
996
- })[0];
997
- if (w && w.should) {
998
- v.cancelable && v.preventDefault();
999
- return;
1000
- }
1001
- if (!w) {
1002
- var x = (s.current.shards || []).map(At).filter(Boolean).filter(function(E) {
1003
- return E.contains(v.target);
1004
- }), b = x.length > 0 ? c(v, x[0]) : !s.current.noIsolation;
1005
- b && v.cancelable && v.preventDefault();
1006
- }
1007
- }
1008
- }, []), a = l.useCallback(function(p, v, y, w) {
1009
- var x = { name: p, delta: v, target: y, should: w, shadowParent: lo(y) };
1010
- t.current.push(x), setTimeout(function() {
1011
- t.current = t.current.filter(function(b) {
1012
- return b !== x;
1013
- });
1014
- }, 1);
1015
- }, []), f = l.useCallback(function(p) {
1016
- n.current = Se(p), r.current = void 0;
1017
- }, []), d = l.useCallback(function(p) {
1018
- a(p.type, Pt(p), p.target, c(p, e.lockRef.current));
1019
- }, []), h = l.useCallback(function(p) {
1020
- a(p.type, Se(p), p.target, c(p, e.lockRef.current));
1021
- }, []);
1022
- l.useEffect(function() {
1023
- return ce.push(i), e.setCallbacks({
1024
- onScrollCapture: d,
1025
- onWheelCapture: d,
1026
- onTouchMoveCapture: h
1027
- }), document.addEventListener("wheel", u, se), document.addEventListener("touchmove", u, se), document.addEventListener("touchstart", f, se), function() {
1028
- ce = ce.filter(function(p) {
1029
- return p !== i;
1030
- }), document.removeEventListener("wheel", u, se), document.removeEventListener("touchmove", u, se), document.removeEventListener("touchstart", f, se);
1031
- };
1032
- }, []);
1033
- var m = e.removeScrollBar, g = e.inert;
1034
- return l.createElement(
1035
- l.Fragment,
1036
- null,
1037
- g ? l.createElement(i, { styles: so(o) }) : null,
1038
- m ? l.createElement(Zr, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
1039
- );
1040
- }
1041
- function lo(e) {
1042
- for (var t = null; e !== null; )
1043
- e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
1044
- return t;
1045
- }
1046
- const uo = Wr(Kt, ao);
1047
- var Jt = l.forwardRef(function(e, t) {
1048
- return l.createElement(_e, z({}, e, { ref: t, sideCar: uo }));
1049
- });
1050
- Jt.classNames = _e.classNames;
1051
- var fo = function(e) {
1052
- if (typeof document > "u")
1053
- return null;
1054
- var t = Array.isArray(e) ? e[0] : e;
1055
- return t.ownerDocument.body;
1056
- }, ae = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Ae = {}, Ke = 0, en = function(e) {
1057
- return e && (e.host || en(e.parentNode));
1058
- }, po = function(e, t) {
1059
- return t.map(function(n) {
1060
- if (e.contains(n))
1061
- return n;
1062
- var r = en(n);
1063
- return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1064
- }).filter(function(n) {
1065
- return !!n;
1066
- });
1067
- }, mo = function(e, t, n, r) {
1068
- var o = po(t, Array.isArray(e) ? e : [e]);
1069
- Ae[n] || (Ae[n] = /* @__PURE__ */ new WeakMap());
1070
- var i = Ae[n], s = [], c = /* @__PURE__ */ new Set(), u = new Set(o), a = function(d) {
1071
- !d || c.has(d) || (c.add(d), a(d.parentNode));
1072
- };
1073
- o.forEach(a);
1074
- var f = function(d) {
1075
- !d || u.has(d) || Array.prototype.forEach.call(d.children, function(h) {
1076
- if (c.has(h))
1077
- f(h);
1078
- else
1079
- try {
1080
- var m = h.getAttribute(r), g = m !== null && m !== "false", p = (ae.get(h) || 0) + 1, v = (i.get(h) || 0) + 1;
1081
- ae.set(h, p), i.set(h, v), s.push(h), p === 1 && g && Pe.set(h, !0), v === 1 && h.setAttribute(n, "true"), g || h.setAttribute(r, "true");
1082
- } catch (y) {
1083
- console.error("aria-hidden: cannot operate on ", h, y);
1084
- }
1085
- });
1086
- };
1087
- return f(t), c.clear(), Ke++, function() {
1088
- s.forEach(function(d) {
1089
- var h = ae.get(d) - 1, m = i.get(d) - 1;
1090
- ae.set(d, h), i.set(d, m), h || (Pe.has(d) || d.removeAttribute(r), Pe.delete(d)), m || d.removeAttribute(n);
1091
- }), Ke--, Ke || (ae = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Ae = {});
1092
- };
1093
- }, ho = function(e, t, n) {
1094
- n === void 0 && (n = "data-aria-hidden");
1095
- var r = Array.from(Array.isArray(e) ? e : [e]), o = fo(e);
1096
- return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), mo(r, o, n, "aria-hidden")) : function() {
1097
- return null;
1098
- };
1099
- };
1100
- function vo(e) {
1101
- const [t, n] = l.useState(void 0);
1102
- return ee(() => {
1103
- if (e) {
1104
- n({ width: e.offsetWidth, height: e.offsetHeight });
1105
- const r = new ResizeObserver((o) => {
1106
- if (!Array.isArray(o) || !o.length)
1107
- return;
1108
- const i = o[0];
1109
- let s, c;
1110
- if ("borderBoxSize" in i) {
1111
- const u = i.borderBoxSize, a = Array.isArray(u) ? u[0] : u;
1112
- s = a.inlineSize, c = a.blockSize;
1113
- } else
1114
- s = e.offsetWidth, c = e.offsetHeight;
1115
- n({ width: s, height: c });
1116
- });
1117
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
1118
- } else
1119
- n(void 0);
1120
- }, [e]), t;
1121
- }
1122
- const go = ["top", "right", "bottom", "left"], te = Math.min, W = Math.max, De = Math.round, Re = Math.floor, U = (e) => ({
1123
- x: e,
1124
- y: e
1125
- }), yo = {
1126
- left: "right",
1127
- right: "left",
1128
- bottom: "top",
1129
- top: "bottom"
1130
- }, wo = {
1131
- start: "end",
1132
- end: "start"
1133
- };
1134
- function Je(e, t, n) {
1135
- return W(e, te(t, n));
1136
- }
1137
- function G(e, t) {
1138
- return typeof e == "function" ? e(t) : e;
1139
- }
1140
- function Z(e) {
1141
- return e.split("-")[0];
1142
- }
1143
- function me(e) {
1144
- return e.split("-")[1];
1145
- }
1146
- function ot(e) {
1147
- return e === "x" ? "y" : "x";
1148
- }
1149
- function it(e) {
1150
- return e === "y" ? "height" : "width";
1151
- }
1152
- const xo = /* @__PURE__ */ new Set(["top", "bottom"]);
1153
- function V(e) {
1154
- return xo.has(Z(e)) ? "y" : "x";
1155
- }
1156
- function st(e) {
1157
- return ot(V(e));
1158
- }
1159
- function bo(e, t, n) {
1160
- n === void 0 && (n = !1);
1161
- const r = me(e), o = st(e), i = it(o);
1162
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
1163
- return t.reference[i] > t.floating[i] && (s = Le(s)), [s, Le(s)];
1164
- }
1165
- function Eo(e) {
1166
- const t = Le(e);
1167
- return [et(e), t, et(t)];
1168
- }
1169
- function et(e) {
1170
- return e.replace(/start|end/g, (t) => wo[t]);
1171
- }
1172
- const Rt = ["left", "right"], Ot = ["right", "left"], Co = ["top", "bottom"], So = ["bottom", "top"];
1173
- function Po(e, t, n) {
1174
- switch (e) {
1175
- case "top":
1176
- case "bottom":
1177
- return n ? t ? Ot : Rt : t ? Rt : Ot;
1178
- case "left":
1179
- case "right":
1180
- return t ? Co : So;
1181
- default:
1182
- return [];
1183
- }
1184
- }
1185
- function Ao(e, t, n, r) {
1186
- const o = me(e);
1187
- let i = Po(Z(e), n === "start", r);
1188
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(et)))), i;
1189
- }
1190
- function Le(e) {
1191
- return e.replace(/left|right|bottom|top/g, (t) => yo[t]);
1192
- }
1193
- function Ro(e) {
1194
- return {
1195
- top: 0,
1196
- right: 0,
1197
- bottom: 0,
1198
- left: 0,
1199
- ...e
1200
- };
1201
- }
1202
- function tn(e) {
1203
- return typeof e != "number" ? Ro(e) : {
1204
- top: e,
1205
- right: e,
1206
- bottom: e,
1207
- left: e
1208
- };
1209
- }
1210
- function Fe(e) {
1211
- const {
1212
- x: t,
1213
- y: n,
1214
- width: r,
1215
- height: o
1216
- } = e;
1217
- return {
1218
- width: r,
1219
- height: o,
1220
- top: n,
1221
- left: t,
1222
- right: t + r,
1223
- bottom: n + o,
1224
- x: t,
1225
- y: n
1226
- };
1227
- }
1228
- function Nt(e, t, n) {
1229
- let {
1230
- reference: r,
1231
- floating: o
1232
- } = e;
1233
- const i = V(t), s = st(t), c = it(s), u = Z(t), a = i === "y", f = r.x + r.width / 2 - o.width / 2, d = r.y + r.height / 2 - o.height / 2, h = r[c] / 2 - o[c] / 2;
1234
- let m;
1235
- switch (u) {
1236
- case "top":
1237
- m = {
1238
- x: f,
1239
- y: r.y - o.height
1240
- };
1241
- break;
1242
- case "bottom":
1243
- m = {
1244
- x: f,
1245
- y: r.y + r.height
1246
- };
1247
- break;
1248
- case "right":
1249
- m = {
1250
- x: r.x + r.width,
1251
- y: d
1252
- };
1253
- break;
1254
- case "left":
1255
- m = {
1256
- x: r.x - o.width,
1257
- y: d
1258
- };
1259
- break;
1260
- default:
1261
- m = {
1262
- x: r.x,
1263
- y: r.y
1264
- };
1265
- }
1266
- switch (me(t)) {
1267
- case "start":
1268
- m[s] -= h * (n && a ? -1 : 1);
1269
- break;
1270
- case "end":
1271
- m[s] += h * (n && a ? -1 : 1);
1272
- break;
1273
- }
1274
- return m;
1275
- }
1276
- const Oo = async (e, t, n) => {
1277
- const {
1278
- placement: r = "bottom",
1279
- strategy: o = "absolute",
1280
- middleware: i = [],
1281
- platform: s
1282
- } = n, c = i.filter(Boolean), u = await (s.isRTL == null ? void 0 : s.isRTL(t));
1283
- let a = await s.getElementRects({
1284
- reference: e,
1285
- floating: t,
1286
- strategy: o
1287
- }), {
1288
- x: f,
1289
- y: d
1290
- } = Nt(a, r, u), h = r, m = {}, g = 0;
1291
- for (let p = 0; p < c.length; p++) {
1292
- const {
1293
- name: v,
1294
- fn: y
1295
- } = c[p], {
1296
- x: w,
1297
- y: x,
1298
- data: b,
1299
- reset: E
1300
- } = await y({
1301
- x: f,
1302
- y: d,
1303
- initialPlacement: r,
1304
- placement: h,
1305
- strategy: o,
1306
- middlewareData: m,
1307
- rects: a,
1308
- platform: s,
1309
- elements: {
1310
- reference: e,
1311
- floating: t
1312
- }
1313
- });
1314
- f = w ?? f, d = x ?? d, m = {
1315
- ...m,
1316
- [v]: {
1317
- ...m[v],
1318
- ...b
1319
- }
1320
- }, E && g <= 50 && (g++, typeof E == "object" && (E.placement && (h = E.placement), E.rects && (a = E.rects === !0 ? await s.getElementRects({
1321
- reference: e,
1322
- floating: t,
1323
- strategy: o
1324
- }) : E.rects), {
1325
- x: f,
1326
- y: d
1327
- } = Nt(a, h, u)), p = -1);
1328
- }
1329
- return {
1330
- x: f,
1331
- y: d,
1332
- placement: h,
1333
- strategy: o,
1334
- middlewareData: m
1335
- };
1336
- };
1337
- async function ge(e, t) {
1338
- var n;
1339
- t === void 0 && (t = {});
1340
- const {
1341
- x: r,
1342
- y: o,
1343
- platform: i,
1344
- rects: s,
1345
- elements: c,
1346
- strategy: u
1347
- } = e, {
1348
- boundary: a = "clippingAncestors",
1349
- rootBoundary: f = "viewport",
1350
- elementContext: d = "floating",
1351
- altBoundary: h = !1,
1352
- padding: m = 0
1353
- } = G(t, e), g = tn(m), v = c[h ? d === "floating" ? "reference" : "floating" : d], y = Fe(await i.getClippingRect({
1354
- element: (n = await (i.isElement == null ? void 0 : i.isElement(v))) == null || n ? v : v.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
1355
- boundary: a,
1356
- rootBoundary: f,
1357
- strategy: u
1358
- })), w = d === "floating" ? {
1359
- x: r,
1360
- y: o,
1361
- width: s.floating.width,
1362
- height: s.floating.height
1363
- } : s.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), b = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
1364
- x: 1,
1365
- y: 1
1366
- } : {
1367
- x: 1,
1368
- y: 1
1369
- }, E = Fe(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
1370
- elements: c,
1371
- rect: w,
1372
- offsetParent: x,
1373
- strategy: u
1374
- }) : w);
1375
- return {
1376
- top: (y.top - E.top + g.top) / b.y,
1377
- bottom: (E.bottom - y.bottom + g.bottom) / b.y,
1378
- left: (y.left - E.left + g.left) / b.x,
1379
- right: (E.right - y.right + g.right) / b.x
1380
- };
1381
- }
1382
- const No = (e) => ({
1383
- name: "arrow",
1384
- options: e,
1385
- async fn(t) {
1386
- const {
1387
- x: n,
1388
- y: r,
1389
- placement: o,
1390
- rects: i,
1391
- platform: s,
1392
- elements: c,
1393
- middlewareData: u
1394
- } = t, {
1395
- element: a,
1396
- padding: f = 0
1397
- } = G(e, t) || {};
1398
- if (a == null)
1399
- return {};
1400
- const d = tn(f), h = {
1401
- x: n,
1402
- y: r
1403
- }, m = st(o), g = it(m), p = await s.getDimensions(a), v = m === "y", y = v ? "top" : "left", w = v ? "bottom" : "right", x = v ? "clientHeight" : "clientWidth", b = i.reference[g] + i.reference[m] - h[m] - i.floating[g], E = h[m] - i.reference[m], P = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
1404
- let C = P ? P[x] : 0;
1405
- (!C || !await (s.isElement == null ? void 0 : s.isElement(P))) && (C = c.floating[x] || i.floating[g]);
1406
- const R = b / 2 - E / 2, T = C / 2 - p[g] / 2 - 1, O = te(d[y], T), k = te(d[w], T), _ = O, M = C - p[g] - k, N = C / 2 - p[g] / 2 + R, I = Je(_, N, M), D = !u.arrow && me(o) != null && N !== I && i.reference[g] / 2 - (N < _ ? O : k) - p[g] / 2 < 0, L = D ? N < _ ? N - _ : N - M : 0;
1407
- return {
1408
- [m]: h[m] + L,
1409
- data: {
1410
- [m]: I,
1411
- centerOffset: N - I - L,
1412
- ...D && {
1413
- alignmentOffset: L
1414
- }
1415
- },
1416
- reset: D
1417
- };
1418
- }
1419
- }), To = function(e) {
1420
- return e === void 0 && (e = {}), {
1421
- name: "flip",
1422
- options: e,
1423
- async fn(t) {
1424
- var n, r;
1425
- const {
1426
- placement: o,
1427
- middlewareData: i,
1428
- rects: s,
1429
- initialPlacement: c,
1430
- platform: u,
1431
- elements: a
1432
- } = t, {
1433
- mainAxis: f = !0,
1434
- crossAxis: d = !0,
1435
- fallbackPlacements: h,
1436
- fallbackStrategy: m = "bestFit",
1437
- fallbackAxisSideDirection: g = "none",
1438
- flipAlignment: p = !0,
1439
- ...v
1440
- } = G(e, t);
1441
- if ((n = i.arrow) != null && n.alignmentOffset)
1442
- return {};
1443
- const y = Z(o), w = V(c), x = Z(c) === c, b = await (u.isRTL == null ? void 0 : u.isRTL(a.floating)), E = h || (x || !p ? [Le(c)] : Eo(c)), P = g !== "none";
1444
- !h && P && E.push(...Ao(c, p, g, b));
1445
- const C = [c, ...E], R = await ge(t, v), T = [];
1446
- let O = ((r = i.flip) == null ? void 0 : r.overflows) || [];
1447
- if (f && T.push(R[y]), d) {
1448
- const N = bo(o, s, b);
1449
- T.push(R[N[0]], R[N[1]]);
1450
- }
1451
- if (O = [...O, {
1452
- placement: o,
1453
- overflows: T
1454
- }], !T.every((N) => N <= 0)) {
1455
- var k, _;
1456
- const N = (((k = i.flip) == null ? void 0 : k.index) || 0) + 1, I = C[N];
1457
- if (I && (!(d === "alignment" ? w !== V(I) : !1) || // We leave the current main axis only if every placement on that axis
1458
- // overflows the main axis.
1459
- O.every((A) => V(A.placement) === w ? A.overflows[0] > 0 : !0)))
1460
- return {
1461
- data: {
1462
- index: N,
1463
- overflows: O
1464
- },
1465
- reset: {
1466
- placement: I
1467
- }
1468
- };
1469
- let D = (_ = O.filter((L) => L.overflows[0] <= 0).sort((L, A) => L.overflows[1] - A.overflows[1])[0]) == null ? void 0 : _.placement;
1470
- if (!D)
1471
- switch (m) {
1472
- case "bestFit": {
1473
- var M;
1474
- const L = (M = O.filter((A) => {
1475
- if (P) {
1476
- const F = V(A.placement);
1477
- return F === w || // Create a bias to the `y` side axis due to horizontal
1478
- // reading directions favoring greater width.
1479
- F === "y";
1480
- }
1481
- return !0;
1482
- }).map((A) => [A.placement, A.overflows.filter((F) => F > 0).reduce((F, H) => F + H, 0)]).sort((A, F) => A[1] - F[1])[0]) == null ? void 0 : M[0];
1483
- L && (D = L);
1484
- break;
1485
- }
1486
- case "initialPlacement":
1487
- D = c;
1488
- break;
1489
- }
1490
- if (o !== D)
1491
- return {
1492
- reset: {
1493
- placement: D
1494
- }
1495
- };
1496
- }
1497
- return {};
1498
- }
1499
- };
1500
- };
1501
- function Tt(e, t) {
1502
- return {
1503
- top: e.top - t.height,
1504
- right: e.right - t.width,
1505
- bottom: e.bottom - t.height,
1506
- left: e.left - t.width
1507
- };
1508
- }
1509
- function Mt(e) {
1510
- return go.some((t) => e[t] >= 0);
1511
- }
1512
- const Mo = function(e) {
1513
- return e === void 0 && (e = {}), {
1514
- name: "hide",
1515
- options: e,
1516
- async fn(t) {
1517
- const {
1518
- rects: n
1519
- } = t, {
1520
- strategy: r = "referenceHidden",
1521
- ...o
1522
- } = G(e, t);
1523
- switch (r) {
1524
- case "referenceHidden": {
1525
- const i = await ge(t, {
1526
- ...o,
1527
- elementContext: "reference"
1528
- }), s = Tt(i, n.reference);
1529
- return {
1530
- data: {
1531
- referenceHiddenOffsets: s,
1532
- referenceHidden: Mt(s)
1533
- }
1534
- };
1535
- }
1536
- case "escaped": {
1537
- const i = await ge(t, {
1538
- ...o,
1539
- altBoundary: !0
1540
- }), s = Tt(i, n.floating);
1541
- return {
1542
- data: {
1543
- escapedOffsets: s,
1544
- escaped: Mt(s)
1545
- }
1546
- };
1547
- }
1548
- default:
1549
- return {};
1550
- }
1551
- }
1552
- };
1553
- }, nn = /* @__PURE__ */ new Set(["left", "top"]);
1554
- async function Do(e, t) {
1555
- const {
1556
- placement: n,
1557
- platform: r,
1558
- elements: o
1559
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = Z(n), c = me(n), u = V(n) === "y", a = nn.has(s) ? -1 : 1, f = i && u ? -1 : 1, d = G(t, e);
1560
- let {
1561
- mainAxis: h,
1562
- crossAxis: m,
1563
- alignmentAxis: g
1564
- } = typeof d == "number" ? {
1565
- mainAxis: d,
1566
- crossAxis: 0,
1567
- alignmentAxis: null
1568
- } : {
1569
- mainAxis: d.mainAxis || 0,
1570
- crossAxis: d.crossAxis || 0,
1571
- alignmentAxis: d.alignmentAxis
1572
- };
1573
- return c && typeof g == "number" && (m = c === "end" ? g * -1 : g), u ? {
1574
- x: m * f,
1575
- y: h * a
1576
- } : {
1577
- x: h * a,
1578
- y: m * f
1579
- };
1580
- }
1581
- const Lo = function(e) {
1582
- return e === void 0 && (e = 0), {
1583
- name: "offset",
1584
- options: e,
1585
- async fn(t) {
1586
- var n, r;
1587
- const {
1588
- x: o,
1589
- y: i,
1590
- placement: s,
1591
- middlewareData: c
1592
- } = t, u = await Do(t, e);
1593
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
1594
- x: o + u.x,
1595
- y: i + u.y,
1596
- data: {
1597
- ...u,
1598
- placement: s
1599
- }
1600
- };
1601
- }
1602
- };
1603
- }, Fo = function(e) {
1604
- return e === void 0 && (e = {}), {
1605
- name: "shift",
1606
- options: e,
1607
- async fn(t) {
1608
- const {
1609
- x: n,
1610
- y: r,
1611
- placement: o
1612
- } = t, {
1613
- mainAxis: i = !0,
1614
- crossAxis: s = !1,
1615
- limiter: c = {
1616
- fn: (v) => {
1617
- let {
1618
- x: y,
1619
- y: w
1620
- } = v;
1621
- return {
1622
- x: y,
1623
- y: w
1624
- };
1625
- }
1626
- },
1627
- ...u
1628
- } = G(e, t), a = {
1629
- x: n,
1630
- y: r
1631
- }, f = await ge(t, u), d = V(Z(o)), h = ot(d);
1632
- let m = a[h], g = a[d];
1633
- if (i) {
1634
- const v = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", w = m + f[v], x = m - f[y];
1635
- m = Je(w, m, x);
1636
- }
1637
- if (s) {
1638
- const v = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", w = g + f[v], x = g - f[y];
1639
- g = Je(w, g, x);
1640
- }
1641
- const p = c.fn({
1642
- ...t,
1643
- [h]: m,
1644
- [d]: g
1645
- });
1646
- return {
1647
- ...p,
1648
- data: {
1649
- x: p.x - n,
1650
- y: p.y - r,
1651
- enabled: {
1652
- [h]: i,
1653
- [d]: s
1654
- }
1655
- }
1656
- };
1657
- }
1658
- };
1659
- }, ko = function(e) {
1660
- return e === void 0 && (e = {}), {
1661
- options: e,
1662
- fn(t) {
1663
- const {
1664
- x: n,
1665
- y: r,
1666
- placement: o,
1667
- rects: i,
1668
- middlewareData: s
1669
- } = t, {
1670
- offset: c = 0,
1671
- mainAxis: u = !0,
1672
- crossAxis: a = !0
1673
- } = G(e, t), f = {
1674
- x: n,
1675
- y: r
1676
- }, d = V(o), h = ot(d);
1677
- let m = f[h], g = f[d];
1678
- const p = G(c, t), v = typeof p == "number" ? {
1679
- mainAxis: p,
1680
- crossAxis: 0
1681
- } : {
1682
- mainAxis: 0,
1683
- crossAxis: 0,
1684
- ...p
1685
- };
1686
- if (u) {
1687
- const x = h === "y" ? "height" : "width", b = i.reference[h] - i.floating[x] + v.mainAxis, E = i.reference[h] + i.reference[x] - v.mainAxis;
1688
- m < b ? m = b : m > E && (m = E);
1689
- }
1690
- if (a) {
1691
- var y, w;
1692
- const x = h === "y" ? "width" : "height", b = nn.has(Z(o)), E = i.reference[d] - i.floating[x] + (b && ((y = s.offset) == null ? void 0 : y[d]) || 0) + (b ? 0 : v.crossAxis), P = i.reference[d] + i.reference[x] + (b ? 0 : ((w = s.offset) == null ? void 0 : w[d]) || 0) - (b ? v.crossAxis : 0);
1693
- g < E ? g = E : g > P && (g = P);
1694
- }
1695
- return {
1696
- [h]: m,
1697
- [d]: g
1698
- };
1699
- }
1700
- };
1701
- }, _o = function(e) {
1702
- return e === void 0 && (e = {}), {
1703
- name: "size",
1704
- options: e,
1705
- async fn(t) {
1706
- var n, r;
1707
- const {
1708
- placement: o,
1709
- rects: i,
1710
- platform: s,
1711
- elements: c
1712
- } = t, {
1713
- apply: u = () => {
1714
- },
1715
- ...a
1716
- } = G(e, t), f = await ge(t, a), d = Z(o), h = me(o), m = V(o) === "y", {
1717
- width: g,
1718
- height: p
1719
- } = i.floating;
1720
- let v, y;
1721
- d === "top" || d === "bottom" ? (v = d, y = h === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (y = d, v = h === "end" ? "top" : "bottom");
1722
- const w = p - f.top - f.bottom, x = g - f.left - f.right, b = te(p - f[v], w), E = te(g - f[y], x), P = !t.middlewareData.shift;
1723
- let C = b, R = E;
1724
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = x), (r = t.middlewareData.shift) != null && r.enabled.y && (C = w), P && !h) {
1725
- const O = W(f.left, 0), k = W(f.right, 0), _ = W(f.top, 0), M = W(f.bottom, 0);
1726
- m ? R = g - 2 * (O !== 0 || k !== 0 ? O + k : W(f.left, f.right)) : C = p - 2 * (_ !== 0 || M !== 0 ? _ + M : W(f.top, f.bottom));
1727
- }
1728
- await u({
1729
- ...t,
1730
- availableWidth: R,
1731
- availableHeight: C
1732
- });
1733
- const T = await s.getDimensions(c.floating);
1734
- return g !== T.width || p !== T.height ? {
1735
- reset: {
1736
- rects: !0
1737
- }
1738
- } : {};
1739
- }
1740
- };
1741
- };
1742
- function Ie() {
1743
- return typeof window < "u";
1744
- }
1745
- function he(e) {
1746
- return rn(e) ? (e.nodeName || "").toLowerCase() : "#document";
1747
- }
1748
- function j(e) {
1749
- var t;
1750
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1751
- }
1752
- function q(e) {
1753
- var t;
1754
- return (t = (rn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1755
- }
1756
- function rn(e) {
1757
- return Ie() ? e instanceof Node || e instanceof j(e).Node : !1;
1758
- }
1759
- function $(e) {
1760
- return Ie() ? e instanceof Element || e instanceof j(e).Element : !1;
1761
- }
1762
- function X(e) {
1763
- return Ie() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
1764
- }
1765
- function Dt(e) {
1766
- return !Ie() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
1767
- }
1768
- const Io = /* @__PURE__ */ new Set(["inline", "contents"]);
1769
- function we(e) {
1770
- const {
1771
- overflow: t,
1772
- overflowX: n,
1773
- overflowY: r,
1774
- display: o
1775
- } = B(e);
1776
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !Io.has(o);
1777
- }
1778
- const Wo = /* @__PURE__ */ new Set(["table", "td", "th"]);
1779
- function jo(e) {
1780
- return Wo.has(he(e));
1781
- }
1782
- const $o = [":popover-open", ":modal"];
1783
- function We(e) {
1784
- return $o.some((t) => {
1785
- try {
1786
- return e.matches(t);
1787
- } catch {
1788
- return !1;
1789
- }
1790
- });
1791
- }
1792
- const Bo = ["transform", "translate", "scale", "rotate", "perspective"], Ho = ["transform", "translate", "scale", "rotate", "perspective", "filter"], zo = ["paint", "layout", "strict", "content"];
1793
- function ct(e) {
1794
- const t = at(), n = $(e) ? B(e) : e;
1795
- return Bo.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Ho.some((r) => (n.willChange || "").includes(r)) || zo.some((r) => (n.contain || "").includes(r));
1796
- }
1797
- function Vo(e) {
1798
- let t = ne(e);
1799
- for (; X(t) && !de(t); ) {
1800
- if (ct(t))
1801
- return t;
1802
- if (We(t))
1803
- return null;
1804
- t = ne(t);
1805
- }
1806
- return null;
1807
- }
1808
- function at() {
1809
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1810
- }
1811
- const Uo = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1812
- function de(e) {
1813
- return Uo.has(he(e));
1814
- }
1815
- function B(e) {
1816
- return j(e).getComputedStyle(e);
1817
- }
1818
- function je(e) {
1819
- return $(e) ? {
1820
- scrollLeft: e.scrollLeft,
1821
- scrollTop: e.scrollTop
1822
- } : {
1823
- scrollLeft: e.scrollX,
1824
- scrollTop: e.scrollY
1825
- };
1826
- }
1827
- function ne(e) {
1828
- if (he(e) === "html")
1829
- return e;
1830
- const t = (
1831
- // Step into the shadow DOM of the parent of a slotted node.
1832
- e.assignedSlot || // DOM Element detected.
1833
- e.parentNode || // ShadowRoot detected.
1834
- Dt(e) && e.host || // Fallback.
1835
- q(e)
1836
- );
1837
- return Dt(t) ? t.host : t;
1838
- }
1839
- function on(e) {
1840
- const t = ne(e);
1841
- return de(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : X(t) && we(t) ? t : on(t);
1842
- }
1843
- function ye(e, t, n) {
1844
- var r;
1845
- t === void 0 && (t = []), n === void 0 && (n = !0);
1846
- const o = on(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = j(o);
1847
- if (i) {
1848
- const c = tt(s);
1849
- return t.concat(s, s.visualViewport || [], we(o) ? o : [], c && n ? ye(c) : []);
1850
- }
1851
- return t.concat(o, ye(o, [], n));
1852
- }
1853
- function tt(e) {
1854
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1855
- }
1856
- function sn(e) {
1857
- const t = B(e);
1858
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
1859
- const o = X(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, c = De(n) !== i || De(r) !== s;
1860
- return c && (n = i, r = s), {
1861
- width: n,
1862
- height: r,
1863
- $: c
1864
- };
1865
- }
1866
- function lt(e) {
1867
- return $(e) ? e : e.contextElement;
1868
- }
1869
- function ue(e) {
1870
- const t = lt(e);
1871
- if (!X(t))
1872
- return U(1);
1873
- const n = t.getBoundingClientRect(), {
1874
- width: r,
1875
- height: o,
1876
- $: i
1877
- } = sn(t);
1878
- let s = (i ? De(n.width) : n.width) / r, c = (i ? De(n.height) : n.height) / o;
1879
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1880
- x: s,
1881
- y: c
1882
- };
1883
- }
1884
- const Yo = /* @__PURE__ */ U(0);
1885
- function cn(e) {
1886
- const t = j(e);
1887
- return !at() || !t.visualViewport ? Yo : {
1888
- x: t.visualViewport.offsetLeft,
1889
- y: t.visualViewport.offsetTop
1890
- };
1891
- }
1892
- function Xo(e, t, n) {
1893
- return t === void 0 && (t = !1), !n || t && n !== j(e) ? !1 : t;
1894
- }
1895
- function ie(e, t, n, r) {
1896
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1897
- const o = e.getBoundingClientRect(), i = lt(e);
1898
- let s = U(1);
1899
- t && (r ? $(r) && (s = ue(r)) : s = ue(e));
1900
- const c = Xo(i, n, r) ? cn(i) : U(0);
1901
- let u = (o.left + c.x) / s.x, a = (o.top + c.y) / s.y, f = o.width / s.x, d = o.height / s.y;
1902
- if (i) {
1903
- const h = j(i), m = r && $(r) ? j(r) : r;
1904
- let g = h, p = tt(g);
1905
- for (; p && r && m !== g; ) {
1906
- const v = ue(p), y = p.getBoundingClientRect(), w = B(p), x = y.left + (p.clientLeft + parseFloat(w.paddingLeft)) * v.x, b = y.top + (p.clientTop + parseFloat(w.paddingTop)) * v.y;
1907
- u *= v.x, a *= v.y, f *= v.x, d *= v.y, u += x, a += b, g = j(p), p = tt(g);
1908
- }
1909
- }
1910
- return Fe({
1911
- width: f,
1912
- height: d,
1913
- x: u,
1914
- y: a
1915
- });
1916
- }
1917
- function $e(e, t) {
1918
- const n = je(e).scrollLeft;
1919
- return t ? t.left + n : ie(q(e)).left + n;
1920
- }
1921
- function an(e, t) {
1922
- const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - $e(e, n), o = n.top + t.scrollTop;
1923
- return {
1924
- x: r,
1925
- y: o
1926
- };
1927
- }
1928
- function Ko(e) {
1929
- let {
1930
- elements: t,
1931
- rect: n,
1932
- offsetParent: r,
1933
- strategy: o
1934
- } = e;
1935
- const i = o === "fixed", s = q(r), c = t ? We(t.floating) : !1;
1936
- if (r === s || c && i)
1937
- return n;
1938
- let u = {
1939
- scrollLeft: 0,
1940
- scrollTop: 0
1941
- }, a = U(1);
1942
- const f = U(0), d = X(r);
1943
- if ((d || !d && !i) && ((he(r) !== "body" || we(s)) && (u = je(r)), X(r))) {
1944
- const m = ie(r);
1945
- a = ue(r), f.x = m.x + r.clientLeft, f.y = m.y + r.clientTop;
1946
- }
1947
- const h = s && !d && !i ? an(s, u) : U(0);
1948
- return {
1949
- width: n.width * a.x,
1950
- height: n.height * a.y,
1951
- x: n.x * a.x - u.scrollLeft * a.x + f.x + h.x,
1952
- y: n.y * a.y - u.scrollTop * a.y + f.y + h.y
1953
- };
1954
- }
1955
- function qo(e) {
1956
- return Array.from(e.getClientRects());
1957
- }
1958
- function Go(e) {
1959
- const t = q(e), n = je(e), r = e.ownerDocument.body, o = W(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = W(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1960
- let s = -n.scrollLeft + $e(e);
1961
- const c = -n.scrollTop;
1962
- return B(r).direction === "rtl" && (s += W(t.clientWidth, r.clientWidth) - o), {
1963
- width: o,
1964
- height: i,
1965
- x: s,
1966
- y: c
1967
- };
1968
- }
1969
- const Lt = 25;
1970
- function Zo(e, t) {
1971
- const n = j(e), r = q(e), o = n.visualViewport;
1972
- let i = r.clientWidth, s = r.clientHeight, c = 0, u = 0;
1973
- if (o) {
1974
- i = o.width, s = o.height;
1975
- const f = at();
1976
- (!f || f && t === "fixed") && (c = o.offsetLeft, u = o.offsetTop);
1977
- }
1978
- const a = $e(r);
1979
- if (a <= 0) {
1980
- const f = r.ownerDocument, d = f.body, h = getComputedStyle(d), m = f.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, g = Math.abs(r.clientWidth - d.clientWidth - m);
1981
- g <= Lt && (i -= g);
1982
- } else a <= Lt && (i += a);
1983
- return {
1984
- width: i,
1985
- height: s,
1986
- x: c,
1987
- y: u
1988
- };
1989
- }
1990
- const Qo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1991
- function Jo(e, t) {
1992
- const n = ie(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = X(e) ? ue(e) : U(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, u = o * i.x, a = r * i.y;
1993
- return {
1994
- width: s,
1995
- height: c,
1996
- x: u,
1997
- y: a
1998
- };
1999
- }
2000
- function Ft(e, t, n) {
2001
- let r;
2002
- if (t === "viewport")
2003
- r = Zo(e, n);
2004
- else if (t === "document")
2005
- r = Go(q(e));
2006
- else if ($(t))
2007
- r = Jo(t, n);
2008
- else {
2009
- const o = cn(e);
2010
- r = {
2011
- x: t.x - o.x,
2012
- y: t.y - o.y,
2013
- width: t.width,
2014
- height: t.height
2015
- };
2016
- }
2017
- return Fe(r);
2018
- }
2019
- function ln(e, t) {
2020
- const n = ne(e);
2021
- return n === t || !$(n) || de(n) ? !1 : B(n).position === "fixed" || ln(n, t);
2022
- }
2023
- function ei(e, t) {
2024
- const n = t.get(e);
2025
- if (n)
2026
- return n;
2027
- let r = ye(e, [], !1).filter((c) => $(c) && he(c) !== "body"), o = null;
2028
- const i = B(e).position === "fixed";
2029
- let s = i ? ne(e) : e;
2030
- for (; $(s) && !de(s); ) {
2031
- const c = B(s), u = ct(s);
2032
- !u && c.position === "fixed" && (o = null), (i ? !u && !o : !u && c.position === "static" && !!o && Qo.has(o.position) || we(s) && !u && ln(e, s)) ? r = r.filter((f) => f !== s) : o = c, s = ne(s);
2033
- }
2034
- return t.set(e, r), r;
2035
- }
2036
- function ti(e) {
2037
- let {
2038
- element: t,
2039
- boundary: n,
2040
- rootBoundary: r,
2041
- strategy: o
2042
- } = e;
2043
- const s = [...n === "clippingAncestors" ? We(t) ? [] : ei(t, this._c) : [].concat(n), r], c = s[0], u = s.reduce((a, f) => {
2044
- const d = Ft(t, f, o);
2045
- return a.top = W(d.top, a.top), a.right = te(d.right, a.right), a.bottom = te(d.bottom, a.bottom), a.left = W(d.left, a.left), a;
2046
- }, Ft(t, c, o));
2047
- return {
2048
- width: u.right - u.left,
2049
- height: u.bottom - u.top,
2050
- x: u.left,
2051
- y: u.top
2052
- };
2053
- }
2054
- function ni(e) {
2055
- const {
2056
- width: t,
2057
- height: n
2058
- } = sn(e);
2059
- return {
2060
- width: t,
2061
- height: n
2062
- };
2063
- }
2064
- function ri(e, t, n) {
2065
- const r = X(t), o = q(t), i = n === "fixed", s = ie(e, !0, i, t);
2066
- let c = {
2067
- scrollLeft: 0,
2068
- scrollTop: 0
2069
- };
2070
- const u = U(0);
2071
- function a() {
2072
- u.x = $e(o);
2073
- }
2074
- if (r || !r && !i)
2075
- if ((he(t) !== "body" || we(o)) && (c = je(t)), r) {
2076
- const m = ie(t, !0, i, t);
2077
- u.x = m.x + t.clientLeft, u.y = m.y + t.clientTop;
2078
- } else o && a();
2079
- i && !r && o && a();
2080
- const f = o && !r && !i ? an(o, c) : U(0), d = s.left + c.scrollLeft - u.x - f.x, h = s.top + c.scrollTop - u.y - f.y;
2081
- return {
2082
- x: d,
2083
- y: h,
2084
- width: s.width,
2085
- height: s.height
2086
- };
2087
- }
2088
- function qe(e) {
2089
- return B(e).position === "static";
2090
- }
2091
- function kt(e, t) {
2092
- if (!X(e) || B(e).position === "fixed")
2093
- return null;
2094
- if (t)
2095
- return t(e);
2096
- let n = e.offsetParent;
2097
- return q(e) === n && (n = n.ownerDocument.body), n;
2098
- }
2099
- function un(e, t) {
2100
- const n = j(e);
2101
- if (We(e))
2102
- return n;
2103
- if (!X(e)) {
2104
- let o = ne(e);
2105
- for (; o && !de(o); ) {
2106
- if ($(o) && !qe(o))
2107
- return o;
2108
- o = ne(o);
2109
- }
2110
- return n;
2111
- }
2112
- let r = kt(e, t);
2113
- for (; r && jo(r) && qe(r); )
2114
- r = kt(r, t);
2115
- return r && de(r) && qe(r) && !ct(r) ? n : r || Vo(e) || n;
2116
- }
2117
- const oi = async function(e) {
2118
- const t = this.getOffsetParent || un, n = this.getDimensions, r = await n(e.floating);
2119
- return {
2120
- reference: ri(e.reference, await t(e.floating), e.strategy),
2121
- floating: {
2122
- x: 0,
2123
- y: 0,
2124
- width: r.width,
2125
- height: r.height
2126
- }
2127
- };
2128
- };
2129
- function ii(e) {
2130
- return B(e).direction === "rtl";
2131
- }
2132
- const si = {
2133
- convertOffsetParentRelativeRectToViewportRelativeRect: Ko,
2134
- getDocumentElement: q,
2135
- getClippingRect: ti,
2136
- getOffsetParent: un,
2137
- getElementRects: oi,
2138
- getClientRects: qo,
2139
- getDimensions: ni,
2140
- getScale: ue,
2141
- isElement: $,
2142
- isRTL: ii
2143
- };
2144
- function fn(e, t) {
2145
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
2146
- }
2147
- function ci(e, t) {
2148
- let n = null, r;
2149
- const o = q(e);
2150
- function i() {
2151
- var c;
2152
- clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
2153
- }
2154
- function s(c, u) {
2155
- c === void 0 && (c = !1), u === void 0 && (u = 1), i();
2156
- const a = e.getBoundingClientRect(), {
2157
- left: f,
2158
- top: d,
2159
- width: h,
2160
- height: m
2161
- } = a;
2162
- if (c || t(), !h || !m)
2163
- return;
2164
- const g = Re(d), p = Re(o.clientWidth - (f + h)), v = Re(o.clientHeight - (d + m)), y = Re(f), x = {
2165
- rootMargin: -g + "px " + -p + "px " + -v + "px " + -y + "px",
2166
- threshold: W(0, te(1, u)) || 1
2167
- };
2168
- let b = !0;
2169
- function E(P) {
2170
- const C = P[0].intersectionRatio;
2171
- if (C !== u) {
2172
- if (!b)
2173
- return s();
2174
- C ? s(!1, C) : r = setTimeout(() => {
2175
- s(!1, 1e-7);
2176
- }, 1e3);
2177
- }
2178
- C === 1 && !fn(a, e.getBoundingClientRect()) && s(), b = !1;
2179
- }
2180
- try {
2181
- n = new IntersectionObserver(E, {
2182
- ...x,
2183
- // Handle <iframe>s
2184
- root: o.ownerDocument
2185
- });
2186
- } catch {
2187
- n = new IntersectionObserver(E, x);
2188
- }
2189
- n.observe(e);
2190
- }
2191
- return s(!0), i;
2192
- }
2193
- function ai(e, t, n, r) {
2194
- r === void 0 && (r = {});
2195
- const {
2196
- ancestorScroll: o = !0,
2197
- ancestorResize: i = !0,
2198
- elementResize: s = typeof ResizeObserver == "function",
2199
- layoutShift: c = typeof IntersectionObserver == "function",
2200
- animationFrame: u = !1
2201
- } = r, a = lt(e), f = o || i ? [...a ? ye(a) : [], ...ye(t)] : [];
2202
- f.forEach((y) => {
2203
- o && y.addEventListener("scroll", n, {
2204
- passive: !0
2205
- }), i && y.addEventListener("resize", n);
2206
- });
2207
- const d = a && c ? ci(a, n) : null;
2208
- let h = -1, m = null;
2209
- s && (m = new ResizeObserver((y) => {
2210
- let [w] = y;
2211
- w && w.target === a && m && (m.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
2212
- var x;
2213
- (x = m) == null || x.observe(t);
2214
- })), n();
2215
- }), a && !u && m.observe(a), m.observe(t));
2216
- let g, p = u ? ie(e) : null;
2217
- u && v();
2218
- function v() {
2219
- const y = ie(e);
2220
- p && !fn(p, y) && n(), p = y, g = requestAnimationFrame(v);
2221
- }
2222
- return n(), () => {
2223
- var y;
2224
- f.forEach((w) => {
2225
- o && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
2226
- }), d?.(), (y = m) == null || y.disconnect(), m = null, u && cancelAnimationFrame(g);
2227
- };
2228
- }
2229
- const li = Lo, ui = Fo, fi = To, di = _o, pi = Mo, _t = No, mi = ko, hi = (e, t, n) => {
2230
- const r = /* @__PURE__ */ new Map(), o = {
2231
- platform: si,
2232
- ...n
2233
- }, i = {
2234
- ...o.platform,
2235
- _c: r
2236
- };
2237
- return Oo(e, t, {
2238
- ...o,
2239
- platform: i
2240
- });
2241
- };
2242
- var vi = typeof document < "u", gi = function() {
2243
- }, Te = vi ? Yn : gi;
2244
- function ke(e, t) {
2245
- if (e === t)
2246
- return !0;
2247
- if (typeof e != typeof t)
2248
- return !1;
2249
- if (typeof e == "function" && e.toString() === t.toString())
2250
- return !0;
2251
- let n, r, o;
2252
- if (e && t && typeof e == "object") {
2253
- if (Array.isArray(e)) {
2254
- if (n = e.length, n !== t.length) return !1;
2255
- for (r = n; r-- !== 0; )
2256
- if (!ke(e[r], t[r]))
2257
- return !1;
2258
- return !0;
2259
- }
2260
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
2261
- return !1;
2262
- for (r = n; r-- !== 0; )
2263
- if (!{}.hasOwnProperty.call(t, o[r]))
2264
- return !1;
2265
- for (r = n; r-- !== 0; ) {
2266
- const i = o[r];
2267
- if (!(i === "_owner" && e.$$typeof) && !ke(e[i], t[i]))
2268
- return !1;
2269
- }
2270
- return !0;
2271
- }
2272
- return e !== e && t !== t;
2273
- }
2274
- function dn(e) {
2275
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
2276
- }
2277
- function It(e, t) {
2278
- const n = dn(e);
2279
- return Math.round(t * n) / n;
2280
- }
2281
- function Ge(e) {
2282
- const t = l.useRef(e);
2283
- return Te(() => {
2284
- t.current = e;
2285
- }), t;
2286
- }
2287
- function yi(e) {
2288
- e === void 0 && (e = {});
2289
- const {
2290
- placement: t = "bottom",
2291
- strategy: n = "absolute",
2292
- middleware: r = [],
2293
- platform: o,
2294
- elements: {
2295
- reference: i,
2296
- floating: s
2297
- } = {},
2298
- transform: c = !0,
2299
- whileElementsMounted: u,
2300
- open: a
2301
- } = e, [f, d] = l.useState({
2302
- x: 0,
2303
- y: 0,
2304
- strategy: n,
2305
- placement: t,
2306
- middlewareData: {},
2307
- isPositioned: !1
2308
- }), [h, m] = l.useState(r);
2309
- ke(h, r) || m(r);
2310
- const [g, p] = l.useState(null), [v, y] = l.useState(null), w = l.useCallback((A) => {
2311
- A !== P.current && (P.current = A, p(A));
2312
- }, []), x = l.useCallback((A) => {
2313
- A !== C.current && (C.current = A, y(A));
2314
- }, []), b = i || g, E = s || v, P = l.useRef(null), C = l.useRef(null), R = l.useRef(f), T = u != null, O = Ge(u), k = Ge(o), _ = Ge(a), M = l.useCallback(() => {
2315
- if (!P.current || !C.current)
2316
- return;
2317
- const A = {
2318
- placement: t,
2319
- strategy: n,
2320
- middleware: h
2321
- };
2322
- k.current && (A.platform = k.current), hi(P.current, C.current, A).then((F) => {
2323
- const H = {
2324
- ...F,
2325
- // The floating element's position may be recomputed while it's closed
2326
- // but still mounted (such as when transitioning out). To ensure
2327
- // `isPositioned` will be `false` initially on the next open, avoid
2328
- // setting it to `true` when `open === false` (must be specified).
2329
- isPositioned: _.current !== !1
2330
- };
2331
- N.current && !ke(R.current, H) && (R.current = H, Wt.flushSync(() => {
2332
- d(H);
2333
- }));
2334
- });
2335
- }, [h, t, n, k, _]);
2336
- Te(() => {
2337
- a === !1 && R.current.isPositioned && (R.current.isPositioned = !1, d((A) => ({
2338
- ...A,
2339
- isPositioned: !1
2340
- })));
2341
- }, [a]);
2342
- const N = l.useRef(!1);
2343
- Te(() => (N.current = !0, () => {
2344
- N.current = !1;
2345
- }), []), Te(() => {
2346
- if (b && (P.current = b), E && (C.current = E), b && E) {
2347
- if (O.current)
2348
- return O.current(b, E, M);
2349
- M();
2350
- }
2351
- }, [b, E, M, O, T]);
2352
- const I = l.useMemo(() => ({
2353
- reference: P,
2354
- floating: C,
2355
- setReference: w,
2356
- setFloating: x
2357
- }), [w, x]), D = l.useMemo(() => ({
2358
- reference: b,
2359
- floating: E
2360
- }), [b, E]), L = l.useMemo(() => {
2361
- const A = {
2362
- position: n,
2363
- left: 0,
2364
- top: 0
2365
- };
2366
- if (!D.floating)
2367
- return A;
2368
- const F = It(D.floating, f.x), H = It(D.floating, f.y);
2369
- return c ? {
2370
- ...A,
2371
- transform: "translate(" + F + "px, " + H + "px)",
2372
- ...dn(D.floating) >= 1.5 && {
2373
- willChange: "transform"
2374
- }
2375
- } : {
2376
- position: n,
2377
- left: F,
2378
- top: H
2379
- };
2380
- }, [n, c, D.floating, f.x, f.y]);
2381
- return l.useMemo(() => ({
2382
- ...f,
2383
- update: M,
2384
- refs: I,
2385
- elements: D,
2386
- floatingStyles: L
2387
- }), [f, M, I, D, L]);
2388
- }
2389
- const wi = (e) => {
2390
- function t(n) {
2391
- return {}.hasOwnProperty.call(n, "current");
2392
- }
2393
- return {
2394
- name: "arrow",
2395
- options: e,
2396
- fn(n) {
2397
- const {
2398
- element: r,
2399
- padding: o
2400
- } = typeof e == "function" ? e(n) : e;
2401
- return r && t(r) ? r.current != null ? _t({
2402
- element: r.current,
2403
- padding: o
2404
- }).fn(n) : {} : r ? _t({
2405
- element: r,
2406
- padding: o
2407
- }).fn(n) : {};
2408
- }
2409
- };
2410
- }, xi = (e, t) => ({
2411
- ...li(e),
2412
- options: [e, t]
2413
- }), bi = (e, t) => ({
2414
- ...ui(e),
2415
- options: [e, t]
2416
- }), Ei = (e, t) => ({
2417
- ...mi(e),
2418
- options: [e, t]
2419
- }), Ci = (e, t) => ({
2420
- ...fi(e),
2421
- options: [e, t]
2422
- }), Si = (e, t) => ({
2423
- ...di(e),
2424
- options: [e, t]
2425
- }), Pi = (e, t) => ({
2426
- ...pi(e),
2427
- options: [e, t]
2428
- }), Ai = (e, t) => ({
2429
- ...wi(e),
2430
- options: [e, t]
2431
- });
2432
- var Ri = "Arrow", pn = l.forwardRef((e, t) => {
2433
- const { children: n, width: r = 10, height: o = 5, ...i } = e;
2434
- return /* @__PURE__ */ S.jsx(
2435
- K.svg,
2436
- {
2437
- ...i,
2438
- ref: t,
2439
- width: r,
2440
- height: o,
2441
- viewBox: "0 0 30 10",
2442
- preserveAspectRatio: "none",
2443
- children: e.asChild ? n : /* @__PURE__ */ S.jsx("polygon", { points: "0,0 30,0 15,10" })
2444
- }
2445
- );
2446
- });
2447
- pn.displayName = Ri;
2448
- var Oi = pn, ut = "Popper", [mn, hn] = nt(ut), [Ni, vn] = mn(ut), gn = (e) => {
2449
- const { __scopePopper: t, children: n } = e, [r, o] = l.useState(null);
2450
- return /* @__PURE__ */ S.jsx(Ni, { scope: t, anchor: r, onAnchorChange: o, children: n });
2451
- };
2452
- gn.displayName = ut;
2453
- var yn = "PopperAnchor", wn = l.forwardRef(
2454
- (e, t) => {
2455
- const { __scopePopper: n, virtualRef: r, ...o } = e, i = vn(yn, n), s = l.useRef(null), c = Y(t, s), u = l.useRef(null);
2456
- return l.useEffect(() => {
2457
- const a = u.current;
2458
- u.current = r?.current || s.current, a !== u.current && i.onAnchorChange(u.current);
2459
- }), r ? null : /* @__PURE__ */ S.jsx(K.div, { ...o, ref: c });
2460
- }
2461
- );
2462
- wn.displayName = yn;
2463
- var ft = "PopperContent", [Ti, Mi] = mn(ft), xn = l.forwardRef(
2464
- (e, t) => {
2465
- const {
2466
- __scopePopper: n,
2467
- side: r = "bottom",
2468
- sideOffset: o = 0,
2469
- align: i = "center",
2470
- alignOffset: s = 0,
2471
- arrowPadding: c = 0,
2472
- avoidCollisions: u = !0,
2473
- collisionBoundary: a = [],
2474
- collisionPadding: f = 0,
2475
- sticky: d = "partial",
2476
- hideWhenDetached: h = !1,
2477
- updatePositionStrategy: m = "optimized",
2478
- onPlaced: g,
2479
- ...p
2480
- } = e, v = vn(ft, n), [y, w] = l.useState(null), x = Y(t, (ve) => w(ve)), [b, E] = l.useState(null), P = vo(b), C = P?.width ?? 0, R = P?.height ?? 0, T = r + (i !== "center" ? "-" + i : ""), O = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, k = Array.isArray(a) ? a : [a], _ = k.length > 0, M = {
2481
- padding: O,
2482
- boundary: k.filter(Li),
2483
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2484
- altBoundary: _
2485
- }, { refs: N, floatingStyles: I, placement: D, isPositioned: L, middlewareData: A } = yi({
2486
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2487
- strategy: "fixed",
2488
- placement: T,
2489
- whileElementsMounted: (...ve) => ai(...ve, {
2490
- animationFrame: m === "always"
2491
- }),
2492
- elements: {
2493
- reference: v.anchor
2494
- },
2495
- middleware: [
2496
- xi({ mainAxis: o + R, alignmentAxis: s }),
2497
- u && bi({
2498
- mainAxis: !0,
2499
- crossAxis: !1,
2500
- limiter: d === "partial" ? Ei() : void 0,
2501
- ...M
2502
- }),
2503
- u && Ci({ ...M }),
2504
- Si({
2505
- ...M,
2506
- apply: ({ elements: ve, rects: mt, availableWidth: $n, availableHeight: Bn }) => {
2507
- const { width: Hn, height: zn } = mt.reference, be = ve.floating.style;
2508
- be.setProperty("--radix-popper-available-width", `${$n}px`), be.setProperty("--radix-popper-available-height", `${Bn}px`), be.setProperty("--radix-popper-anchor-width", `${Hn}px`), be.setProperty("--radix-popper-anchor-height", `${zn}px`);
2509
- }
2510
- }),
2511
- b && Ai({ element: b, padding: c }),
2512
- Fi({ arrowWidth: C, arrowHeight: R }),
2513
- h && Pi({ strategy: "referenceHidden", ...M })
2514
- ]
2515
- }), [F, H] = Cn(D), pt = fe(g);
2516
- ee(() => {
2517
- L && pt?.();
2518
- }, [L, pt]);
2519
- const kn = A.arrow?.x, _n = A.arrow?.y, In = A.arrow?.centerOffset !== 0, [Wn, jn] = l.useState();
2520
- return ee(() => {
2521
- y && jn(window.getComputedStyle(y).zIndex);
2522
- }, [y]), /* @__PURE__ */ S.jsx(
2523
- "div",
2524
- {
2525
- ref: N.setFloating,
2526
- "data-radix-popper-content-wrapper": "",
2527
- style: {
2528
- ...I,
2529
- transform: L ? I.transform : "translate(0, -200%)",
2530
- // keep off the page when measuring
2531
- minWidth: "max-content",
2532
- zIndex: Wn,
2533
- "--radix-popper-transform-origin": [
2534
- A.transformOrigin?.x,
2535
- A.transformOrigin?.y
2536
- ].join(" "),
2537
- // hide the content if using the hide middleware and should be hidden
2538
- // set visibility to hidden and disable pointer events so the UI behaves
2539
- // as if the PopperContent isn't there at all
2540
- ...A.hide?.referenceHidden && {
2541
- visibility: "hidden",
2542
- pointerEvents: "none"
2543
- }
2544
- },
2545
- dir: e.dir,
2546
- children: /* @__PURE__ */ S.jsx(
2547
- Ti,
2548
- {
2549
- scope: n,
2550
- placedSide: F,
2551
- onArrowChange: E,
2552
- arrowX: kn,
2553
- arrowY: _n,
2554
- shouldHideArrow: In,
2555
- children: /* @__PURE__ */ S.jsx(
2556
- K.div,
2557
- {
2558
- "data-side": F,
2559
- "data-align": H,
2560
- ...p,
2561
- ref: x,
2562
- style: {
2563
- ...p.style,
2564
- // if the PopperContent hasn't been placed yet (not all measurements done)
2565
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
2566
- animation: L ? void 0 : "none"
2567
- }
2568
- }
2569
- )
2570
- }
2571
- )
2572
- }
2573
- );
2574
- }
2575
- );
2576
- xn.displayName = ft;
2577
- var bn = "PopperArrow", Di = {
2578
- top: "bottom",
2579
- right: "left",
2580
- bottom: "top",
2581
- left: "right"
2582
- }, En = l.forwardRef(function(t, n) {
2583
- const { __scopePopper: r, ...o } = t, i = Mi(bn, r), s = Di[i.placedSide];
2584
- return (
2585
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
2586
- // doesn't report size as we'd expect on SVG elements.
2587
- // it reports their bounding box which is effectively the largest path inside the SVG.
2588
- /* @__PURE__ */ S.jsx(
2589
- "span",
2590
- {
2591
- ref: i.onArrowChange,
2592
- style: {
2593
- position: "absolute",
2594
- left: i.arrowX,
2595
- top: i.arrowY,
2596
- [s]: 0,
2597
- transformOrigin: {
2598
- top: "",
2599
- right: "0 0",
2600
- bottom: "center 0",
2601
- left: "100% 0"
2602
- }[i.placedSide],
2603
- transform: {
2604
- top: "translateY(100%)",
2605
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
2606
- bottom: "rotate(180deg)",
2607
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
2608
- }[i.placedSide],
2609
- visibility: i.shouldHideArrow ? "hidden" : void 0
2610
- },
2611
- children: /* @__PURE__ */ S.jsx(
2612
- Oi,
2613
- {
2614
- ...o,
2615
- ref: n,
2616
- style: {
2617
- ...o.style,
2618
- // ensures the element can be measured correctly (mostly for if SVG)
2619
- display: "block"
2620
- }
2621
- }
2622
- )
2623
- }
2624
- )
2625
- );
2626
- });
2627
- En.displayName = bn;
2628
- function Li(e) {
2629
- return e !== null;
2630
- }
2631
- var Fi = (e) => ({
2632
- name: "transformOrigin",
2633
- options: e,
2634
- fn(t) {
2635
- const { placement: n, rects: r, middlewareData: o } = t, s = o.arrow?.centerOffset !== 0, c = s ? 0 : e.arrowWidth, u = s ? 0 : e.arrowHeight, [a, f] = Cn(n), d = { start: "0%", center: "50%", end: "100%" }[f], h = (o.arrow?.x ?? 0) + c / 2, m = (o.arrow?.y ?? 0) + u / 2;
2636
- let g = "", p = "";
2637
- return a === "bottom" ? (g = s ? d : `${h}px`, p = `${-u}px`) : a === "top" ? (g = s ? d : `${h}px`, p = `${r.floating.height + u}px`) : a === "right" ? (g = `${-u}px`, p = s ? d : `${m}px`) : a === "left" && (g = `${r.floating.width + u}px`, p = s ? d : `${m}px`), { data: { x: g, y: p } };
2638
- }
2639
- });
2640
- function Cn(e) {
2641
- const [t, n = "center"] = e.split("-");
2642
- return [t, n];
2643
- }
2644
- var ki = gn, Sn = wn, _i = xn, Ii = En, Be = "Popover", [Pn, as] = nt(Be, [
2645
- hn
2646
- ]), xe = hn(), [Wi, re] = Pn(Be), An = (e) => {
2647
- const {
2648
- __scopePopover: t,
2649
- children: n,
2650
- open: r,
2651
- defaultOpen: o,
2652
- onOpenChange: i,
2653
- modal: s = !1
2654
- } = e, c = xe(t), u = l.useRef(null), [a, f] = l.useState(!1), [d, h] = nr({
2655
- prop: r,
2656
- defaultProp: o ?? !1,
2657
- onChange: i,
2658
- caller: Be
2659
- });
2660
- return /* @__PURE__ */ S.jsx(ki, { ...c, children: /* @__PURE__ */ S.jsx(
2661
- Wi,
2662
- {
2663
- scope: t,
2664
- contentId: ur(),
2665
- triggerRef: u,
2666
- open: d,
2667
- onOpenChange: h,
2668
- onOpenToggle: l.useCallback(() => h((m) => !m), [h]),
2669
- hasCustomAnchor: a,
2670
- onCustomAnchorAdd: l.useCallback(() => f(!0), []),
2671
- onCustomAnchorRemove: l.useCallback(() => f(!1), []),
2672
- modal: s,
2673
- children: n
2674
- }
2675
- ) });
2676
- };
2677
- An.displayName = Be;
2678
- var Rn = "PopoverAnchor", ji = l.forwardRef(
2679
- (e, t) => {
2680
- const { __scopePopover: n, ...r } = e, o = re(Rn, n), i = xe(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: c } = o;
2681
- return l.useEffect(() => (s(), () => c()), [s, c]), /* @__PURE__ */ S.jsx(Sn, { ...i, ...r, ref: t });
2682
- }
2683
- );
2684
- ji.displayName = Rn;
2685
- var On = "PopoverTrigger", Nn = l.forwardRef(
2686
- (e, t) => {
2687
- const { __scopePopover: n, ...r } = e, o = re(On, n), i = xe(n), s = Y(t, o.triggerRef), c = /* @__PURE__ */ S.jsx(
2688
- K.button,
2689
- {
2690
- type: "button",
2691
- "aria-haspopup": "dialog",
2692
- "aria-expanded": o.open,
2693
- "aria-controls": o.contentId,
2694
- "data-state": Fn(o.open),
2695
- ...r,
2696
- ref: s,
2697
- onClick: J(e.onClick, o.onOpenToggle)
2698
- }
2699
- );
2700
- return o.hasCustomAnchor ? c : /* @__PURE__ */ S.jsx(Sn, { asChild: !0, ...i, children: c });
2701
- }
2702
- );
2703
- Nn.displayName = On;
2704
- var dt = "PopoverPortal", [$i, Bi] = Pn(dt, {
2705
- forceMount: void 0
2706
- }), Tn = (e) => {
2707
- const { __scopePopover: t, forceMount: n, children: r, container: o } = e, i = re(dt, t);
2708
- return /* @__PURE__ */ S.jsx($i, { scope: t, forceMount: n, children: /* @__PURE__ */ S.jsx(rt, { present: n || i.open, children: /* @__PURE__ */ S.jsx(Ut, { asChild: !0, container: o, children: r }) }) });
2709
- };
2710
- Tn.displayName = dt;
2711
- var pe = "PopoverContent", Mn = l.forwardRef(
2712
- (e, t) => {
2713
- const n = Bi(pe, e.__scopePopover), { forceMount: r = n.forceMount, ...o } = e, i = re(pe, e.__scopePopover);
2714
- return /* @__PURE__ */ S.jsx(rt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ S.jsx(zi, { ...o, ref: t }) : /* @__PURE__ */ S.jsx(Vi, { ...o, ref: t }) });
2715
- }
2716
- );
2717
- Mn.displayName = pe;
2718
- var Hi = Me("PopoverContent.RemoveScroll"), zi = l.forwardRef(
2719
- (e, t) => {
2720
- const n = re(pe, e.__scopePopover), r = l.useRef(null), o = Y(t, r), i = l.useRef(!1);
2721
- return l.useEffect(() => {
2722
- const s = r.current;
2723
- if (s) return ho(s);
2724
- }, []), /* @__PURE__ */ S.jsx(Jt, { as: Hi, allowPinchZoom: !0, children: /* @__PURE__ */ S.jsx(
2725
- Dn,
2726
- {
2727
- ...e,
2728
- ref: o,
2729
- trapFocus: n.open,
2730
- disableOutsidePointerEvents: !0,
2731
- onCloseAutoFocus: J(e.onCloseAutoFocus, (s) => {
2732
- s.preventDefault(), i.current || n.triggerRef.current?.focus();
2733
- }),
2734
- onPointerDownOutside: J(
2735
- e.onPointerDownOutside,
2736
- (s) => {
2737
- const c = s.detail.originalEvent, u = c.button === 0 && c.ctrlKey === !0, a = c.button === 2 || u;
2738
- i.current = a;
2739
- },
2740
- { checkForDefaultPrevented: !1 }
2741
- ),
2742
- onFocusOutside: J(
2743
- e.onFocusOutside,
2744
- (s) => s.preventDefault(),
2745
- { checkForDefaultPrevented: !1 }
2746
- )
2747
- }
2748
- ) });
2749
- }
2750
- ), Vi = l.forwardRef(
2751
- (e, t) => {
2752
- const n = re(pe, e.__scopePopover), r = l.useRef(!1), o = l.useRef(!1);
2753
- return /* @__PURE__ */ S.jsx(
2754
- Dn,
2755
- {
2756
- ...e,
2757
- ref: t,
2758
- trapFocus: !1,
2759
- disableOutsidePointerEvents: !1,
2760
- onCloseAutoFocus: (i) => {
2761
- e.onCloseAutoFocus?.(i), i.defaultPrevented || (r.current || n.triggerRef.current?.focus(), i.preventDefault()), r.current = !1, o.current = !1;
2762
- },
2763
- onInteractOutside: (i) => {
2764
- e.onInteractOutside?.(i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
2765
- const s = i.target;
2766
- n.triggerRef.current?.contains(s) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
2767
- }
2768
- }
2769
- );
2770
- }
2771
- ), Dn = l.forwardRef(
2772
- (e, t) => {
2773
- const {
2774
- __scopePopover: n,
2775
- trapFocus: r,
2776
- onOpenAutoFocus: o,
2777
- onCloseAutoFocus: i,
2778
- disableOutsidePointerEvents: s,
2779
- onEscapeKeyDown: c,
2780
- onPointerDownOutside: u,
2781
- onFocusOutside: a,
2782
- onInteractOutside: f,
2783
- ...d
2784
- } = e, h = re(pe, n), m = xe(n);
2785
- return Or(), /* @__PURE__ */ S.jsx(
2786
- zt,
2787
- {
2788
- asChild: !0,
2789
- loop: !0,
2790
- trapped: r,
2791
- onMountAutoFocus: o,
2792
- onUnmountAutoFocus: i,
2793
- children: /* @__PURE__ */ S.jsx(
2794
- Bt,
2795
- {
2796
- asChild: !0,
2797
- disableOutsidePointerEvents: s,
2798
- onInteractOutside: f,
2799
- onEscapeKeyDown: c,
2800
- onPointerDownOutside: u,
2801
- onFocusOutside: a,
2802
- onDismiss: () => h.onOpenChange(!1),
2803
- children: /* @__PURE__ */ S.jsx(
2804
- _i,
2805
- {
2806
- "data-state": Fn(h.open),
2807
- role: "dialog",
2808
- id: h.contentId,
2809
- ...m,
2810
- ...d,
2811
- ref: t,
2812
- style: {
2813
- ...d.style,
2814
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
2815
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
2816
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
2817
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
2818
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
2819
- }
2820
- }
2821
- )
2822
- }
2823
- )
2824
- }
2825
- );
2826
- }
2827
- ), Ln = "PopoverClose", Ui = l.forwardRef(
2828
- (e, t) => {
2829
- const { __scopePopover: n, ...r } = e, o = re(Ln, n);
2830
- return /* @__PURE__ */ S.jsx(
2831
- K.button,
2832
- {
2833
- type: "button",
2834
- ...r,
2835
- ref: t,
2836
- onClick: J(e.onClick, () => o.onOpenChange(!1))
2837
- }
2838
- );
2839
- }
2840
- );
2841
- Ui.displayName = Ln;
2842
- var Yi = "PopoverArrow", Xi = l.forwardRef(
2843
- (e, t) => {
2844
- const { __scopePopover: n, ...r } = e, o = xe(n);
2845
- return /* @__PURE__ */ S.jsx(Ii, { ...o, ...r, ref: t });
2846
- }
2847
- );
2848
- Xi.displayName = Yi;
2849
- function Fn(e) {
2850
- return e ? "open" : "closed";
2851
- }
2852
- var Ki = An, qi = Nn, Gi = Tn, Zi = Mn;
2853
- function ls({ ...e }) {
2854
- return /* @__PURE__ */ S.jsx(Ki, { "data-slot": "popover", ...e });
2855
- }
2856
- function us({ ...e }) {
2857
- return /* @__PURE__ */ S.jsx(qi, { "data-slot": "popover-trigger", ...e });
2858
- }
2859
- function fs({
2860
- className: e,
2861
- align: t = "center",
2862
- sideOffset: n = 4,
2863
- ...r
2864
- }) {
2865
- return /* @__PURE__ */ S.jsx(Gi, { children: /* @__PURE__ */ S.jsx(
2866
- Zi,
2867
- {
2868
- align: t,
2869
- className: Xn(
2870
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",
2871
- e
2872
- ),
2873
- "data-slot": "popover-content",
2874
- sideOffset: n,
2875
- ...r
2876
- }
2877
- ) });
2878
- }
2879
- export {
2880
- Sn as A,
2881
- _i as C,
2882
- Bt as D,
2883
- zt as F,
2884
- K as P,
2885
- Jt as R,
2886
- Qn as V,
2887
- nr as a,
2888
- ur as b,
2889
- nt as c,
2890
- rt as d,
2891
- J as e,
2892
- ee as f,
2893
- ss as g,
2894
- Ut as h,
2895
- ho as i,
2896
- Or as j,
2897
- is as k,
2898
- hn as l,
2899
- ki as m,
2900
- Ii as n,
2901
- os as o,
2902
- rs as p,
2903
- ls as q,
2904
- us as r,
2905
- fs as s,
2906
- vo as t,
2907
- cs as u,
2908
- fe as v,
2909
- dr as w,
2910
- Zn as x
2911
- };