@still-forest/canopy 0.28.1 → 0.29.0

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