@arkitektbedriftene/fe-lib 0.4.33 → 0.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4060 +0,0 @@
1
- import { jsx as M, jsxs as te, Fragment as zn } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import Re, { forwardRef as ue, useLayoutEffect as on, useEffect as rn, useRef as Wn, createContext as Nn, useMemo as qe, useContext as sn, isValidElement as jn, cloneElement as Hn, useId as bt } from "react";
4
- import * as Vn from "react-dom";
5
- import { createPortal as _n } from "react-dom";
6
- import * as He from "@radix-ui/react-toolbar";
7
- import { g as Yn, h as Xn, i as ln, j as Kn, k as Gn } from "./index.esm-3266b7f8.js";
8
- import * as Ne from "@radix-ui/react-dialog";
9
- import * as oe from "@radix-ui/react-dropdown-menu";
10
- import Un from "react-select";
11
- import * as an from "@radix-ui/react-checkbox";
12
- var N = "colors", X = "sizes", C = "space", qn = { gap: C, gridGap: C, columnGap: C, gridColumnGap: C, rowGap: C, gridRowGap: C, inset: C, insetBlock: C, insetBlockEnd: C, insetBlockStart: C, insetInline: C, insetInlineEnd: C, insetInlineStart: C, margin: C, marginTop: C, marginRight: C, marginBottom: C, marginLeft: C, marginBlock: C, marginBlockEnd: C, marginBlockStart: C, marginInline: C, marginInlineEnd: C, marginInlineStart: C, padding: C, paddingTop: C, paddingRight: C, paddingBottom: C, paddingLeft: C, paddingBlock: C, paddingBlockEnd: C, paddingBlockStart: C, paddingInline: C, paddingInlineEnd: C, paddingInlineStart: C, top: C, right: C, bottom: C, left: C, scrollMargin: C, scrollMarginTop: C, scrollMarginRight: C, scrollMarginBottom: C, scrollMarginLeft: C, scrollMarginX: C, scrollMarginY: C, scrollMarginBlock: C, scrollMarginBlockEnd: C, scrollMarginBlockStart: C, scrollMarginInline: C, scrollMarginInlineEnd: C, scrollMarginInlineStart: C, scrollPadding: C, scrollPaddingTop: C, scrollPaddingRight: C, scrollPaddingBottom: C, scrollPaddingLeft: C, scrollPaddingX: C, scrollPaddingY: C, scrollPaddingBlock: C, scrollPaddingBlockEnd: C, scrollPaddingBlockStart: C, scrollPaddingInline: C, scrollPaddingInlineEnd: C, scrollPaddingInlineStart: C, fontSize: "fontSizes", background: N, backgroundColor: N, backgroundImage: N, borderImage: N, border: N, borderBlock: N, borderBlockEnd: N, borderBlockStart: N, borderBottom: N, borderBottomColor: N, borderColor: N, borderInline: N, borderInlineEnd: N, borderInlineStart: N, borderLeft: N, borderLeftColor: N, borderRight: N, borderRightColor: N, borderTop: N, borderTopColor: N, caretColor: N, color: N, columnRuleColor: N, fill: N, outline: N, outlineColor: N, stroke: N, textDecorationColor: N, fontFamily: "fonts", fontWeight: "fontWeights", lineHeight: "lineHeights", letterSpacing: "letterSpacings", blockSize: X, minBlockSize: X, maxBlockSize: X, inlineSize: X, minInlineSize: X, maxInlineSize: X, width: X, minWidth: X, maxWidth: X, height: X, minHeight: X, maxHeight: X, flexBasis: X, gridTemplateColumns: X, gridTemplateRows: X, borderWidth: "borderWidths", borderTopWidth: "borderWidths", borderRightWidth: "borderWidths", borderBottomWidth: "borderWidths", borderLeftWidth: "borderWidths", borderStyle: "borderStyles", borderTopStyle: "borderStyles", borderRightStyle: "borderStyles", borderBottomStyle: "borderStyles", borderLeftStyle: "borderStyles", borderRadius: "radii", borderTopLeftRadius: "radii", borderTopRightRadius: "radii", borderBottomRightRadius: "radii", borderBottomLeftRadius: "radii", boxShadow: "shadows", textShadow: "shadows", transition: "transitions", zIndex: "zIndices" }, Zn = (e, t) => typeof t == "function" ? { "()": Function.prototype.toString.call(t) } : t, De = () => {
13
- const e = /* @__PURE__ */ Object.create(null);
14
- return (t, n, ...o) => {
15
- const r = ((i) => JSON.stringify(i, Zn))(t);
16
- return r in e ? e[r] : e[r] = n(t, ...o);
17
- };
18
- }, be = Symbol.for("sxs.internal"), yt = (e, t) => Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)), Tt = (e) => {
19
- for (const t in e)
20
- return !0;
21
- return !1;
22
- }, { hasOwnProperty: Jn } = Object.prototype, dt = (e) => e.includes("-") ? e : e.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase()), Qn = /\s+(?![^()]*\))/, Ce = (e) => (t) => e(...typeof t == "string" ? String(t).split(Qn) : [t]), It = { appearance: (e) => ({ WebkitAppearance: e, appearance: e }), backfaceVisibility: (e) => ({ WebkitBackfaceVisibility: e, backfaceVisibility: e }), backdropFilter: (e) => ({ WebkitBackdropFilter: e, backdropFilter: e }), backgroundClip: (e) => ({ WebkitBackgroundClip: e, backgroundClip: e }), boxDecorationBreak: (e) => ({ WebkitBoxDecorationBreak: e, boxDecorationBreak: e }), clipPath: (e) => ({ WebkitClipPath: e, clipPath: e }), content: (e) => ({ content: e.includes('"') || e.includes("'") || /^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e) ? e : `"${e}"` }), hyphens: (e) => ({ WebkitHyphens: e, hyphens: e }), maskImage: (e) => ({ WebkitMaskImage: e, maskImage: e }), maskSize: (e) => ({ WebkitMaskSize: e, maskSize: e }), tabSize: (e) => ({ MozTabSize: e, tabSize: e }), textSizeAdjust: (e) => ({ WebkitTextSizeAdjust: e, textSizeAdjust: e }), userSelect: (e) => ({ WebkitUserSelect: e, userSelect: e }), marginBlock: Ce((e, t) => ({ marginBlockStart: e, marginBlockEnd: t || e })), marginInline: Ce((e, t) => ({ marginInlineStart: e, marginInlineEnd: t || e })), maxSize: Ce((e, t) => ({ maxBlockSize: e, maxInlineSize: t || e })), minSize: Ce((e, t) => ({ minBlockSize: e, minInlineSize: t || e })), paddingBlock: Ce((e, t) => ({ paddingBlockStart: e, paddingBlockEnd: t || e })), paddingInline: Ce((e, t) => ({ paddingInlineStart: e, paddingInlineEnd: t || e })) }, it = /([\d.]+)([^]*)/, eo = (e, t) => e.length ? e.reduce((n, o) => (n.push(...t.map((r) => r.includes("&") ? r.replace(/&/g, /[ +>|~]/.test(o) && /&.*&/.test(r) ? `:is(${o})` : o) : o + " " + r)), n), []) : t, to = (e, t) => e in no && typeof t == "string" ? t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/, (n, o, r, i) => o + (r === "stretch" ? `-moz-available${i};${dt(e)}:${o}-webkit-fill-available` : `-moz-fit-content${i};${dt(e)}:${o}fit-content`) + i) : String(t), no = { blockSize: 1, height: 1, inlineSize: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, width: 1 }, re = (e) => e ? e + "-" : "", cn = (e, t, n) => e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g, (o, r, i, s, l) => s == "$" == !!i ? o : (r || s == "--" ? "calc(" : "") + "var(--" + (s === "$" ? re(t) + (l.includes("$") ? "" : re(n)) + l.replace(/\$/g, "-") : l) + ")" + (r || s == "--" ? "*" + (r || "") + (i || "1") + ")" : "")), oo = /\s*,\s*(?![^()]*\))/, ro = Object.prototype.toString, Ie = (e, t, n, o, r) => {
23
- let i, s, l;
24
- const a = (c, m, u) => {
25
- let f, d;
26
- const g = (p) => {
27
- for (f in p) {
28
- const x = f.charCodeAt(0) === 64, B = x && Array.isArray(p[f]) ? p[f] : [p[f]];
29
- for (d of B) {
30
- const S = /[A-Z]/.test(h = f) ? h : h.replace(/-[^]/g, (E) => E[1].toUpperCase()), k = typeof d == "object" && d && d.toString === ro && (!o.utils[S] || !m.length);
31
- if (S in o.utils && !k) {
32
- const E = o.utils[S];
33
- if (E !== s) {
34
- s = E, g(E(d)), s = null;
35
- continue;
36
- }
37
- } else if (S in It) {
38
- const E = It[S];
39
- if (E !== l) {
40
- l = E, g(E(d)), l = null;
41
- continue;
42
- }
43
- }
44
- if (x && ($ = f.slice(1) in o.media ? "@media " + o.media[f.slice(1)] : f, f = $.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g, (E, P, T, D, A, F) => {
45
- const L = it.test(P), O = 0.0625 * (L ? -1 : 1), [b, v] = L ? [D, P] : [P, D];
46
- return "(" + (T[0] === "=" ? "" : T[0] === ">" === L ? "max-" : "min-") + b + ":" + (T[0] !== "=" && T.length === 1 ? v.replace(it, (I, R, w) => Number(R) + O * (T === ">" ? 1 : -1) + w) : v) + (A ? ") and (" + (A[0] === ">" ? "min-" : "max-") + b + ":" + (A.length === 1 ? F.replace(it, (I, R, w) => Number(R) + O * (A === ">" ? -1 : 1) + w) : F) : "") + ")";
47
- })), k) {
48
- const E = x ? u.concat(f) : [...u], P = x ? [...m] : eo(m, f.split(oo));
49
- i !== void 0 && r(Bt(...i)), i = void 0, a(d, P, E);
50
- } else
51
- i === void 0 && (i = [[], m, u]), f = x || f.charCodeAt(0) !== 36 ? f : `--${re(o.prefix)}${f.slice(1).replace(/\$/g, "-")}`, d = k ? d : typeof d == "number" ? d && S in io ? String(d) + "px" : String(d) : cn(to(S, d ?? ""), o.prefix, o.themeMap[S]), i[0].push(`${x ? `${f} ` : `${dt(f)}:`}${d}`);
52
- }
53
- }
54
- var $, h;
55
- };
56
- g(c), i !== void 0 && r(Bt(...i)), i = void 0;
57
- };
58
- a(e, t, n);
59
- }, Bt = (e, t, n) => `${n.map((o) => `${o}{`).join("")}${t.length ? `${t.join(",")}{` : ""}${e.join(";")}${t.length ? "}" : ""}${Array(n.length ? n.length + 1 : 0).join("}")}`, io = { animationDelay: 1, animationDuration: 1, backgroundSize: 1, blockSize: 1, border: 1, borderBlock: 1, borderBlockEnd: 1, borderBlockEndWidth: 1, borderBlockStart: 1, borderBlockStartWidth: 1, borderBlockWidth: 1, borderBottom: 1, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, borderBottomWidth: 1, borderEndEndRadius: 1, borderEndStartRadius: 1, borderInlineEnd: 1, borderInlineEndWidth: 1, borderInlineStart: 1, borderInlineStartWidth: 1, borderInlineWidth: 1, borderLeft: 1, borderLeftWidth: 1, borderRadius: 1, borderRight: 1, borderRightWidth: 1, borderSpacing: 1, borderStartEndRadius: 1, borderStartStartRadius: 1, borderTop: 1, borderTopLeftRadius: 1, borderTopRightRadius: 1, borderTopWidth: 1, borderWidth: 1, bottom: 1, columnGap: 1, columnRule: 1, columnRuleWidth: 1, columnWidth: 1, containIntrinsicSize: 1, flexBasis: 1, fontSize: 1, gap: 1, gridAutoColumns: 1, gridAutoRows: 1, gridTemplateColumns: 1, gridTemplateRows: 1, height: 1, inlineSize: 1, inset: 1, insetBlock: 1, insetBlockEnd: 1, insetBlockStart: 1, insetInline: 1, insetInlineEnd: 1, insetInlineStart: 1, left: 1, letterSpacing: 1, margin: 1, marginBlock: 1, marginBlockEnd: 1, marginBlockStart: 1, marginBottom: 1, marginInline: 1, marginInlineEnd: 1, marginInlineStart: 1, marginLeft: 1, marginRight: 1, marginTop: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, offsetDistance: 1, offsetRotate: 1, outline: 1, outlineOffset: 1, outlineWidth: 1, overflowClipMargin: 1, padding: 1, paddingBlock: 1, paddingBlockEnd: 1, paddingBlockStart: 1, paddingBottom: 1, paddingInline: 1, paddingInlineEnd: 1, paddingInlineStart: 1, paddingLeft: 1, paddingRight: 1, paddingTop: 1, perspective: 1, right: 1, rowGap: 1, scrollMargin: 1, scrollMarginBlock: 1, scrollMarginBlockEnd: 1, scrollMarginBlockStart: 1, scrollMarginBottom: 1, scrollMarginInline: 1, scrollMarginInlineEnd: 1, scrollMarginInlineStart: 1, scrollMarginLeft: 1, scrollMarginRight: 1, scrollMarginTop: 1, scrollPadding: 1, scrollPaddingBlock: 1, scrollPaddingBlockEnd: 1, scrollPaddingBlockStart: 1, scrollPaddingBottom: 1, scrollPaddingInline: 1, scrollPaddingInlineEnd: 1, scrollPaddingInlineStart: 1, scrollPaddingLeft: 1, scrollPaddingRight: 1, scrollPaddingTop: 1, shapeMargin: 1, textDecoration: 1, textDecorationThickness: 1, textIndent: 1, textUnderlineOffset: 1, top: 1, transitionDelay: 1, transitionDuration: 1, verticalAlign: 1, width: 1, wordSpacing: 1 }, Pt = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), ye = (e) => ((t) => {
60
- let n, o = "";
61
- for (n = Math.abs(t); n > 52; n = n / 52 | 0)
62
- o = Pt(n % 52) + o;
63
- return Pt(n % 52) + o;
64
- })(((t, n) => {
65
- let o = n.length;
66
- for (; o; )
67
- t = 33 * t ^ n.charCodeAt(--o);
68
- return t;
69
- })(5381, JSON.stringify(e)) >>> 0), We = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], so = (e) => {
70
- if (e.href && !e.href.startsWith(location.origin))
71
- return !1;
72
- try {
73
- return !!e.cssRules;
74
- } catch {
75
- return !1;
76
- }
77
- }, lo = (e) => {
78
- let t;
79
- const n = () => {
80
- const { cssRules: r } = t.sheet;
81
- return [].map.call(r, (i, s) => {
82
- const { cssText: l } = i;
83
- let a = "";
84
- if (l.startsWith("--sxs"))
85
- return "";
86
- if (r[s - 1] && (a = r[s - 1].cssText).startsWith("--sxs")) {
87
- if (!i.cssRules.length)
88
- return "";
89
- for (const c in t.rules)
90
- if (t.rules[c].group === i)
91
- return `--sxs{--sxs:${[...t.rules[c].cache].join(" ")}}${l}`;
92
- return i.cssRules.length ? `${a}${l}` : "";
93
- }
94
- return l;
95
- }).join("");
96
- }, o = () => {
97
- if (t) {
98
- const { rules: l, sheet: a } = t;
99
- if (!a.deleteRule) {
100
- for (; Object(Object(a.cssRules)[0]).type === 3; )
101
- a.cssRules.splice(0, 1);
102
- a.cssRules = [];
103
- }
104
- for (const c in l)
105
- delete l[c];
106
- }
107
- const r = Object(e).styleSheets || [];
108
- for (const l of r)
109
- if (so(l)) {
110
- for (let a = 0, c = l.cssRules; c[a]; ++a) {
111
- const m = Object(c[a]);
112
- if (m.type !== 1)
113
- continue;
114
- const u = Object(c[a + 1]);
115
- if (u.type !== 4)
116
- continue;
117
- ++a;
118
- const { cssText: f } = m;
119
- if (!f.startsWith("--sxs"))
120
- continue;
121
- const d = f.slice(14, -3).trim().split(/\s+/), g = We[d[0]];
122
- g && (t || (t = { sheet: l, reset: o, rules: {}, toString: n }), t.rules[g] = { group: u, index: a, cache: new Set(d) });
123
- }
124
- if (t)
125
- break;
126
- }
127
- if (!t) {
128
- const l = (a, c) => ({ type: c, cssRules: [], insertRule(m, u) {
129
- this.cssRules.splice(u, 0, l(m, { import: 3, undefined: 1 }[(m.toLowerCase().match(/^@([a-z]+)/) || [])[1]] || 4));
130
- }, get cssText() {
131
- return a === "@media{}" ? `@media{${[].map.call(this.cssRules, (m) => m.cssText).join("")}}` : a;
132
- } });
133
- t = { sheet: e ? (e.head || e).appendChild(document.createElement("style")).sheet : l("", "text/css"), rules: {}, reset: o, toString: n };
134
- }
135
- const { sheet: i, rules: s } = t;
136
- for (let l = We.length - 1; l >= 0; --l) {
137
- const a = We[l];
138
- if (!s[a]) {
139
- const c = We[l + 1], m = s[c] ? s[c].index : i.cssRules.length;
140
- i.insertRule("@media{}", m), i.insertRule(`--sxs{--sxs:${l}}`, m), s[a] = { group: i.cssRules[m + 1], index: m, cache: /* @__PURE__ */ new Set([l]) };
141
- }
142
- ao(s[a]);
143
- }
144
- };
145
- return o(), t;
146
- }, ao = (e) => {
147
- const t = e.group;
148
- let n = t.cssRules.length;
149
- e.apply = (o) => {
150
- try {
151
- t.insertRule(o, n), ++n;
152
- } catch {
153
- }
154
- };
155
- }, ze = Symbol(), co = De(), At = (e, t) => co(e, () => (...n) => {
156
- let o = { type: null, composers: /* @__PURE__ */ new Set() };
157
- for (const r of n)
158
- if (r != null)
159
- if (r[be]) {
160
- o.type == null && (o.type = r[be].type);
161
- for (const i of r[be].composers)
162
- o.composers.add(i);
163
- } else
164
- r.constructor !== Object || r.$$typeof ? o.type == null && (o.type = r) : o.composers.add(uo(r, e));
165
- return o.type == null && (o.type = "span"), o.composers.size || o.composers.add(["PJLV", {}, [], [], {}, []]), fo(e, o, t);
166
- }), uo = ({ variants: e, compoundVariants: t, defaultVariants: n, ...o }, r) => {
167
- const i = `${re(r.prefix)}c-${ye(o)}`, s = [], l = [], a = /* @__PURE__ */ Object.create(null), c = [];
168
- for (const f in n)
169
- a[f] = String(n[f]);
170
- if (typeof e == "object" && e)
171
- for (const f in e) {
172
- m = a, u = f, Jn.call(m, u) || (a[f] = "undefined");
173
- const d = e[f];
174
- for (const g in d) {
175
- const p = { [f]: String(g) };
176
- String(g) === "undefined" && c.push(f);
177
- const $ = d[g], h = [p, $, !Tt($)];
178
- s.push(h);
179
- }
180
- }
181
- var m, u;
182
- if (typeof t == "object" && t)
183
- for (const f of t) {
184
- let { css: d, ...g } = f;
185
- d = typeof d == "object" && d || {};
186
- for (const $ in g)
187
- g[$] = String(g[$]);
188
- const p = [g, d, !Tt(d)];
189
- l.push(p);
190
- }
191
- return [i, o, s, l, a, c];
192
- }, fo = (e, t, n) => {
193
- const [o, r, i, s] = mo(t.composers), l = typeof t.type == "function" || t.type.$$typeof ? ((u) => {
194
- function f() {
195
- for (let d = 0; d < f[ze].length; d++) {
196
- const [g, p] = f[ze][d];
197
- u.rules[g].apply(p);
198
- }
199
- return f[ze] = [], null;
200
- }
201
- return f[ze] = [], f.rules = {}, We.forEach((d) => f.rules[d] = { apply: (g) => f[ze].push([d, g]) }), f;
202
- })(n) : null, a = (l || n).rules, c = `.${o}${r.length > 1 ? `:where(.${r.slice(1).join(".")})` : ""}`, m = (u) => {
203
- u = typeof u == "object" && u || go;
204
- const { css: f, ...d } = u, g = {};
205
- for (const h in i)
206
- if (delete d[h], h in u) {
207
- let x = u[h];
208
- typeof x == "object" && x ? g[h] = { "@initial": i[h], ...x } : (x = String(x), g[h] = x !== "undefined" || s.has(h) ? x : i[h]);
209
- } else
210
- g[h] = i[h];
211
- const p = /* @__PURE__ */ new Set([...r]);
212
- for (const [h, x, B, S] of t.composers) {
213
- n.rules.styled.cache.has(h) || (n.rules.styled.cache.add(h), Ie(x, [`.${h}`], [], e, (P) => {
214
- a.styled.apply(P);
215
- }));
216
- const k = Ot(B, g, e.media), E = Ot(S, g, e.media, !0);
217
- for (const P of k)
218
- if (P !== void 0)
219
- for (const [T, D, A] of P) {
220
- const F = `${h}-${ye(D)}-${T}`;
221
- p.add(F);
222
- const L = (A ? n.rules.resonevar : n.rules.onevar).cache, O = A ? a.resonevar : a.onevar;
223
- L.has(F) || (L.add(F), Ie(D, [`.${F}`], [], e, (b) => {
224
- O.apply(b);
225
- }));
226
- }
227
- for (const P of E)
228
- if (P !== void 0)
229
- for (const [T, D] of P) {
230
- const A = `${h}-${ye(D)}-${T}`;
231
- p.add(A), n.rules.allvar.cache.has(A) || (n.rules.allvar.cache.add(A), Ie(D, [`.${A}`], [], e, (F) => {
232
- a.allvar.apply(F);
233
- }));
234
- }
235
- }
236
- if (typeof f == "object" && f) {
237
- const h = `${o}-i${ye(f)}-css`;
238
- p.add(h), n.rules.inline.cache.has(h) || (n.rules.inline.cache.add(h), Ie(f, [`.${h}`], [], e, (x) => {
239
- a.inline.apply(x);
240
- }));
241
- }
242
- for (const h of String(u.className || "").trim().split(/\s+/))
243
- h && p.add(h);
244
- const $ = d.className = [...p].join(" ");
245
- return { type: t.type, className: $, selector: c, props: d, toString: () => $, deferredInjector: l };
246
- };
247
- return yt(m, { className: o, selector: c, [be]: t, toString: () => (n.rules.styled.cache.has(o) || m(), o) });
248
- }, mo = (e) => {
249
- let t = "";
250
- const n = [], o = {}, r = [];
251
- for (const [i, , , , s, l] of e) {
252
- t === "" && (t = i), n.push(i), r.push(...l);
253
- for (const a in s) {
254
- const c = s[a];
255
- (o[a] === void 0 || c !== "undefined" || l.includes(c)) && (o[a] = c);
256
- }
257
- }
258
- return [t, n, o, new Set(r)];
259
- }, Ot = (e, t, n, o) => {
260
- const r = [];
261
- e:
262
- for (let [i, s, l] of e) {
263
- if (l)
264
- continue;
265
- let a, c = 0, m = !1;
266
- for (a in i) {
267
- const u = i[a];
268
- let f = t[a];
269
- if (f !== u) {
270
- if (typeof f != "object" || !f)
271
- continue e;
272
- {
273
- let d, g, p = 0;
274
- for (const $ in f) {
275
- if (u === String(f[$])) {
276
- if ($ !== "@initial") {
277
- const h = $.slice(1);
278
- (g = g || []).push(h in n ? n[h] : $.replace(/^@media ?/, "")), m = !0;
279
- }
280
- c += p, d = !0;
281
- }
282
- ++p;
283
- }
284
- if (g && g.length && (s = { ["@media " + g.join(", ")]: s }), !d)
285
- continue e;
286
- }
287
- }
288
- }
289
- (r[c] = r[c] || []).push([o ? "cv" : `${a}-${i[a]}`, s, m]);
290
- }
291
- return r;
292
- }, go = {}, po = De(), ho = (e, t) => po(e, () => (...n) => {
293
- const o = () => {
294
- for (let r of n) {
295
- r = typeof r == "object" && r || {};
296
- let i = ye(r);
297
- if (!t.rules.global.cache.has(i)) {
298
- if (t.rules.global.cache.add(i), "@import" in r) {
299
- let s = [].indexOf.call(t.sheet.cssRules, t.rules.themed.group) - 1;
300
- for (let l of [].concat(r["@import"]))
301
- l = l.includes('"') || l.includes("'") ? l : `"${l}"`, t.sheet.insertRule(`@import ${l};`, s++);
302
- delete r["@import"];
303
- }
304
- Ie(r, [], [], e, (s) => {
305
- t.rules.global.apply(s);
306
- });
307
- }
308
- }
309
- return "";
310
- };
311
- return yt(o, { toString: o });
312
- }), bo = De(), yo = (e, t) => bo(e, () => (n) => {
313
- const o = `${re(e.prefix)}k-${ye(n)}`, r = () => {
314
- if (!t.rules.global.cache.has(o)) {
315
- t.rules.global.cache.add(o);
316
- const i = [];
317
- Ie(n, [], [], e, (l) => i.push(l));
318
- const s = `@keyframes ${o}{${i.join("")}}`;
319
- t.rules.global.apply(s);
320
- }
321
- return o;
322
- };
323
- return yt(r, { get name() {
324
- return r();
325
- }, toString: r });
326
- }), vo = class {
327
- constructor(e, t, n, o) {
328
- this.token = e == null ? "" : String(e), this.value = t == null ? "" : String(t), this.scale = n == null ? "" : String(n), this.prefix = o == null ? "" : String(o);
329
- }
330
- get computedValue() {
331
- return "var(" + this.variable + ")";
332
- }
333
- get variable() {
334
- return "--" + re(this.prefix) + re(this.scale) + this.token;
335
- }
336
- toString() {
337
- return this.computedValue;
338
- }
339
- }, xo = De(), $o = (e, t) => xo(e, () => (n, o) => {
340
- o = typeof n == "object" && n || Object(o);
341
- const r = `.${n = (n = typeof n == "string" ? n : "") || `${re(e.prefix)}t-${ye(o)}`}`, i = {}, s = [];
342
- for (const a in o) {
343
- i[a] = {};
344
- for (const c in o[a]) {
345
- const m = `--${re(e.prefix)}${a}-${c}`, u = cn(String(o[a][c]), e.prefix, a);
346
- i[a][c] = new vo(c, u, a, e.prefix), s.push(`${m}:${u}`);
347
- }
348
- }
349
- const l = () => {
350
- if (s.length && !t.rules.themed.cache.has(n)) {
351
- t.rules.themed.cache.add(n);
352
- const a = `${o === e.theme ? ":root," : ""}.${n}{${s.join(";")}}`;
353
- t.rules.themed.apply(a);
354
- }
355
- return n;
356
- };
357
- return { ...i, get className() {
358
- return l();
359
- }, selector: r, toString: l };
360
- }), wo = De(), So = De(), Ro = (e) => {
361
- const t = ((n) => {
362
- let o = !1;
363
- const r = wo(n, (i) => {
364
- o = !0;
365
- const s = "prefix" in (i = typeof i == "object" && i || {}) ? String(i.prefix) : "", l = typeof i.media == "object" && i.media || {}, a = typeof i.root == "object" ? i.root || null : globalThis.document || null, c = typeof i.theme == "object" && i.theme || {}, m = { prefix: s, media: l, theme: c, themeMap: typeof i.themeMap == "object" && i.themeMap || { ...qn }, utils: typeof i.utils == "object" && i.utils || {} }, u = lo(a), f = { css: At(m, u), globalCss: ho(m, u), keyframes: yo(m, u), createTheme: $o(m, u), reset() {
366
- u.reset(), f.theme.toString();
367
- }, theme: {}, sheet: u, config: m, prefix: s, getCssText: u.toString, toString: u.toString };
368
- return String(f.theme = f.createTheme(c)), f;
369
- });
370
- return o || r.reset(), r;
371
- })(e);
372
- return t.styled = (({ config: n, sheet: o }) => So(n, () => {
373
- const r = At(n, o);
374
- return (...i) => {
375
- const s = r(...i), l = s[be].type, a = Re.forwardRef((c, m) => {
376
- const u = c && c.as || l, { props: f, deferredInjector: d } = s(c);
377
- return delete f.as, f.ref = m, d ? Re.createElement(Re.Fragment, null, Re.createElement(u, f), Re.createElement(d, null)) : Re.createElement(u, f);
378
- });
379
- return a.className = s.className, a.displayName = `Styled.${l.displayName || l.name || l}`, a.selector = s.selector, a.toString = () => s.selector, a[be] = s[be], a;
380
- };
381
- }))(t), t;
382
- };
383
- let Dt = 9999;
384
- const Mt = () => (Dt--, Dt), { styled: W, css: Ve, keyframes: Me, globalCss: Xi, getCssText: Ki } = Ro({
385
- theme: {
386
- colors: {
387
- gray50: "#F9FAFA",
388
- gray100: "#EBEEEE",
389
- gray200: "#CFD6D7",
390
- gray300: "#B3BEC0",
391
- gray400: "#97A6A8",
392
- gray500: "#7C8E91",
393
- gray600: "#627578",
394
- gray700: "#4F5F61",
395
- gray800: "#414D4F",
396
- gray900: "#2C3435",
397
- blue50: "#F7FBFB",
398
- blue100: "#E3F0F2",
399
- blue200: "#BADADF",
400
- blue300: "#92C5CC",
401
- blue400: "#67AEB8",
402
- blue500: "#3C97A3",
403
- blue600: "#1F7D8A",
404
- blue700: "#19656F",
405
- blue800: "#14525B",
406
- blue900: "#0E383E",
407
- yellow50: "#FDFAEF",
408
- yellow100: "#F9EDCA",
409
- yellow200: "#EFD27A",
410
- yellow300: "#E5B626",
411
- yellow400: "#C89E1C",
412
- yellow500: "#AA8618",
413
- yellow600: "#8C6E14",
414
- yellow700: "#715910",
415
- yellow800: "#5C490D",
416
- yellow900: "#3E3109",
417
- orange500: "#D1721C",
418
- red50: "#FDF9F9",
419
- red100: "#F7EBEB",
420
- red200: "#EBCECD",
421
- red300: "#DFB1B0",
422
- red400: "#D39392",
423
- red500: "#C67473",
424
- red600: "#B85250",
425
- red700: "#A92F2D",
426
- red800: "#901F1E",
427
- red900: "#631614",
428
- green50: "#F8FAF9",
429
- green100: "#E7F0EA",
430
- green200: "#C5D9CB",
431
- green300: "#A4C4AD",
432
- green400: "#82AD8D",
433
- green500: "#60976F",
434
- green600: "#3C7F4E",
435
- green700: "#296839",
436
- green800: "#21552F",
437
- green900: "#163920",
438
- // Primary
439
- primaryTextOnLightBg: "#194b58",
440
- primaryBg: "$blue600",
441
- primaryBgHover: "$blue700",
442
- primaryTextOnWhite: "$blue600",
443
- bodyGray: "$gray100",
444
- hoverDarker: "hsla(214deg, 25%, 21%, 0.06)",
445
- borderDarker: "hsla(214deg, 25%, 21%, 0.1)",
446
- selectedDarker: "hsla(214deg, 25%, 21%, 0.06)",
447
- selectedOnBodyGray: "hsl(214deg, 35%, 80%)",
448
- darkGrayBg: "#1f2937",
449
- border: "hsl(214deg, 25%, 80%)",
450
- text: "#1f2937",
451
- secondaryText: "$gray500",
452
- focusRing: "hsla(214deg, 15%, 10%, 0.6)"
453
- },
454
- fontSizes: {
455
- xs: "0.75rem",
456
- // 12px
457
- sm: "0.875rem",
458
- // 14px
459
- md: "1rem",
460
- // 16px
461
- lg: "1.125rem",
462
- // 18px
463
- xl: "1.25rem",
464
- // 20px
465
- "2xl": "1.5rem",
466
- // 24px
467
- "3xl": "1.875rem"
468
- // 30px
469
- },
470
- fontWeights: {
471
- normal: "var(--ui-font-weight-normal)",
472
- medium: "var(--ui-font-weight-semibold)",
473
- bold: "var(--ui-font-weight-bold)"
474
- },
475
- space: {
476
- 1: "0.25rem",
477
- 2: "0.5rem",
478
- 3: "0.75rem",
479
- 4: "1rem",
480
- 6: "1.5rem",
481
- 8: "2rem"
482
- },
483
- shadows: {
484
- xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
485
- sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
486
- md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
487
- lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
488
- overlayCard: "0 5px 50px 0px rgb(0 0 0 / 0.15), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
489
- },
490
- radii: {
491
- xs: "0.125rem",
492
- sm: "0.25rem",
493
- md: "0.5rem",
494
- mdmd: "calc(0.5rem - 0.125rem)",
495
- full: "9999px"
496
- },
497
- zIndices: {
498
- /**
499
- * By using createLayerBelow() we can order the list of layers.
500
- * Layers higher up will be on top of layers lower down.
501
- */
502
- toast: Mt(),
503
- overlayCard: Mt()
504
- }
505
- },
506
- media: {
507
- lg: "(min-width: 1200px)",
508
- print: "print"
509
- }
510
- }), Co = Me({
511
- "0%": {
512
- transform: "rotate(0)"
513
- },
514
- "100%": {
515
- transform: "rotate(360deg)"
516
- }
517
- }), Eo = Me({
518
- "0%": {
519
- strokeDashoffset: 600
520
- },
521
- "100%": {
522
- strokeDashoffset: 0
523
- }
524
- }), ko = W("svg", {
525
- animation: `${Co} 2s linear infinite`
526
- }), To = W("circle", {
527
- animation: `${Eo} 1.6s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite`,
528
- fill: "transparent",
529
- stroke: "currentColor",
530
- strokeDasharray: 300,
531
- strokeDashoffset: 600,
532
- strokeLinecap: "round",
533
- strokeMiterlimit: 10,
534
- strokeWidth: 12
535
- }), Io = W("div", {
536
- lineHeight: 0,
537
- flexShrink: 0,
538
- variants: {
539
- size: {
540
- xs: {
541
- width: "1rem",
542
- height: "1rem"
543
- },
544
- sm: {
545
- width: "1.25rem",
546
- height: "1.25rem"
547
- },
548
- md: {
549
- width: "1.75rem",
550
- height: "1.75rem"
551
- },
552
- lg: {
553
- width: "2.25rem",
554
- height: "2.25rem"
555
- }
556
- },
557
- color: {
558
- light: {
559
- color: "$gray200"
560
- },
561
- dark: {
562
- color: "$gray800"
563
- },
564
- inherit: {
565
- color: "inherit"
566
- }
567
- }
568
- },
569
- defaultVariants: {
570
- size: "sm",
571
- color: "dark"
572
- }
573
- }), Bo = ue(
574
- (e, t) => /* @__PURE__ */ M(
575
- Io,
576
- {
577
- ref: t,
578
- ...e,
579
- children: /* @__PURE__ */ M(
580
- ko,
581
- {
582
- x: "0px",
583
- y: "0px",
584
- viewBox: "0 0 150 150",
585
- children: /* @__PURE__ */ M(
586
- To,
587
- {
588
- cx: "75",
589
- cy: "75",
590
- r: "60"
591
- }
592
- )
593
- }
594
- )
595
- }
596
- )
597
- ), Po = W("button", {
598
- appearance: "none",
599
- margin: 0,
600
- padding: 0,
601
- border: "none",
602
- background: "none",
603
- cursor: "pointer",
604
- fontFamily: "inherit",
605
- textAlign: "left",
606
- textDecoration: "none",
607
- textIndent: 0,
608
- lineHeight: 1.25,
609
- display: "inline-flex",
610
- justifyContent: "center",
611
- alignItems: "center",
612
- gap: "$2",
613
- position: "relative",
614
- fontWeight: "$medium",
615
- borderRadius: "$sm",
616
- whiteSpace: "nowrap",
617
- transition: "background 0.2s ease-in-out",
618
- "&:focus, &:focus-visible": {
619
- outline: "none"
620
- },
621
- "&:focus-visible": {
622
- boxShadow: "0 0 0 2px white, 0 0 0 4px $colors$focusRing"
623
- },
624
- "&:disabled": {
625
- cursor: "not-allowed"
626
- },
627
- variants: {
628
- color: {
629
- primary: {
630
- $$solid: "$colors$blue600",
631
- $$solidHover: "$colors$blue700",
632
- $$outline: "$colors$blue600",
633
- $$outlineHover: "$colors$blue100",
634
- $$outlineText: "$colors$blue600",
635
- $$disabled: "$colors$blue200"
636
- },
637
- secondary: {
638
- $$solid: "$colors$gray600",
639
- $$solidHover: "$colors$gray700",
640
- $$outline: "$colors$gray400",
641
- $$outlineHover: "$colors$gray100",
642
- $$outlineText: "$colors$gray600",
643
- $$disabled: "$colors$gray200"
644
- },
645
- success: {
646
- $$solid: "$colors$green600",
647
- $$solidHover: "$colors$green700",
648
- $$outline: "$colors$green600",
649
- $$outlineHover: "$colors$green100",
650
- $$outlineText: "$colors$green600",
651
- $$disabled: "$colors$green200"
652
- },
653
- danger: {
654
- $$solid: "$colors$red600",
655
- $$solidHover: "$colors$red700",
656
- $$outline: "$colors$red600",
657
- $$outlineHover: "$colors$red100",
658
- $$outlineText: "$colors$red600",
659
- $$disabled: "$colors$red200"
660
- },
661
- warning: {
662
- $$solid: "$colors$yellow600",
663
- $$solidHover: "$colors$yellow700",
664
- $$outline: "$colors$yellow400",
665
- $$outlineHover: "$colors$yellow50",
666
- $$outlineText: "$colors$yellow600",
667
- $$disabled: "$colors$yellow100"
668
- }
669
- },
670
- size: {
671
- sm: {
672
- fontSize: "$sm",
673
- padding: "$1 $2",
674
- height: "1.75rem"
675
- },
676
- md: {
677
- fontSize: "$sm",
678
- padding: "$2 $4",
679
- height: "2.25rem"
680
- },
681
- lg: {
682
- fontSize: "$md",
683
- padding: "$3 $6",
684
- height: "2.75rem"
685
- }
686
- },
687
- variant: {
688
- primary: {
689
- background: "$$solid",
690
- color: "white",
691
- "&:hover:not(:disabled)": {
692
- backgroundColor: "$$solidHover"
693
- },
694
- "&:disabled": {
695
- backgroundColor: "$$disabled"
696
- }
697
- },
698
- outline: {
699
- boxShadow: "inset 0 0 0 1px $$outline",
700
- color: "$$outlineText",
701
- "&:hover:not(:disabled)": {
702
- backgroundColor: "$$outlineHover"
703
- },
704
- "&:disabled": {
705
- boxShadow: "inset 0 0 0 1px $$disabled",
706
- color: "$$disabled"
707
- }
708
- },
709
- transparent: {
710
- backgroundColor: "transparent",
711
- color: "$$outlineText",
712
- "&:hover:not(:disabled)": {
713
- backgroundColor: "$$outlineHover"
714
- },
715
- "&:disabled": {
716
- color: "$$disabled"
717
- }
718
- }
719
- },
720
- icon: {
721
- true: {}
722
- }
723
- },
724
- compoundVariants: [
725
- {
726
- icon: !0,
727
- size: "sm",
728
- css: {
729
- padding: "$1",
730
- width: "1.75rem"
731
- }
732
- },
733
- {
734
- icon: !0,
735
- size: "md",
736
- css: {
737
- padding: "$2",
738
- width: "2.25rem"
739
- }
740
- },
741
- {
742
- icon: !0,
743
- size: "lg",
744
- css: {
745
- padding: "$2",
746
- width: "2.75rem"
747
- }
748
- }
749
- ],
750
- defaultVariants: {
751
- variant: "outline",
752
- color: "secondary",
753
- size: "md"
754
- }
755
- }), un = ue(
756
- ({ children: e, disabled: t, isLoading: n, variant: o, color: r, ...i }, s) => (!r && o === "primary" && (r = "primary"), /* @__PURE__ */ te(
757
- Po,
758
- {
759
- ref: s,
760
- type: "button",
761
- role: "button",
762
- disabled: t || n,
763
- variant: o,
764
- color: r,
765
- ...i,
766
- children: [
767
- e,
768
- n && /* @__PURE__ */ M(Bo, { color: "inherit" })
769
- ]
770
- }
771
- ))
772
- ), Ao = W("div", {
773
- padding: "$3",
774
- borderRadius: "$md",
775
- variants: {
776
- color: {
777
- warning: {
778
- background: "$yellow200",
779
- border: "1px solid $yellow400",
780
- color: "$yellow900"
781
- },
782
- danger: {
783
- background: "$red200",
784
- border: "1px solid $red400",
785
- color: "$red900"
786
- },
787
- info: {
788
- background: "$blue200",
789
- border: "1px solid $blue400",
790
- color: "$blue900"
791
- },
792
- success: {
793
- background: "$green200",
794
- border: "1px solid $green400",
795
- color: "$green900"
796
- }
797
- },
798
- size: {
799
- sm: {
800
- fontSize: "$sm"
801
- },
802
- md: {
803
- fontSize: "$md"
804
- }
805
- }
806
- },
807
- defaultVariants: {
808
- color: "info",
809
- size: "md"
810
- }
811
- }), Gi = ue(
812
- ({ children: e, ...t }, n) => /* @__PURE__ */ M(
813
- Ao,
814
- {
815
- ref: n,
816
- role: "alert",
817
- ...t,
818
- children: e
819
- }
820
- )
821
- ), Oo = Me({
822
- "0%": { opacity: 0, transform: "translateY(0.5rem)" },
823
- "100%": { opacity: 1, transform: "translateY(0)" }
824
- }), Do = Me({
825
- "0%": { opacity: 0, transform: "translateX(-0.5rem)" },
826
- "100%": { opacity: 1, transform: "translateX(0)" }
827
- }), Mo = Me({
828
- "0%": { opacity: 0, transform: "translateY(-0.5rem)" },
829
- "100%": { opacity: 1, transform: "translateY(0)" }
830
- }), Lo = Me({
831
- "0%": { opacity: 0, transform: "translateX(0.5rem)" },
832
- "100%": { opacity: 1, transform: "translateX(0)" }
833
- }), Fo = Ve({
834
- backgroundColor: "white",
835
- boxShadow: "$overlayCard",
836
- borderRadius: "$sm",
837
- overflow: "hidden",
838
- zIndex: "$overlayCard",
839
- // radix dialogs sets `pointer-events: none;` on body,
840
- // so for other popups that uses `OverlayCard` to work
841
- // we need to explicitly set this.
842
- pointerEvents: "auto"
843
- }), zo = Ve({
844
- animationDuration: "400ms",
845
- animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
846
- willChange: "transform, opacity",
847
- '&[data-state="open"]': {
848
- '&[data-side="top"]': { animationName: Mo },
849
- '&[data-side="right"]': { animationName: Lo },
850
- '&[data-side="bottom"]': { animationName: Oo },
851
- '&[data-side="left"]': { animationName: Do }
852
- }
853
- }), dn = W(
854
- "div",
855
- Fo,
856
- zo
857
- );
858
- function ae(e) {
859
- return fn(e) ? (e.nodeName || "").toLowerCase() : "#document";
860
- }
861
- function q(e) {
862
- var t;
863
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
864
- }
865
- function se(e) {
866
- var t;
867
- return (t = (fn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
868
- }
869
- function fn(e) {
870
- return e instanceof Node || e instanceof q(e).Node;
871
- }
872
- function j(e) {
873
- return e instanceof Element || e instanceof q(e).Element;
874
- }
875
- function Z(e) {
876
- return e instanceof HTMLElement || e instanceof q(e).HTMLElement;
877
- }
878
- function ft(e) {
879
- return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof q(e).ShadowRoot;
880
- }
881
- function _e(e) {
882
- const {
883
- overflow: t,
884
- overflowX: n,
885
- overflowY: o,
886
- display: r
887
- } = J(e);
888
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(r);
889
- }
890
- function Wo(e) {
891
- return ["table", "td", "th"].includes(ae(e));
892
- }
893
- function vt(e) {
894
- const t = xt(), n = J(e);
895
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
896
- }
897
- function No(e) {
898
- let t = xe(e);
899
- for (; Z(t) && !Ae(t); ) {
900
- if (vt(t))
901
- return t;
902
- t = xe(t);
903
- }
904
- return null;
905
- }
906
- function xt() {
907
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
908
- }
909
- function Ae(e) {
910
- return ["html", "body", "#document"].includes(ae(e));
911
- }
912
- function J(e) {
913
- return q(e).getComputedStyle(e);
914
- }
915
- function ot(e) {
916
- return j(e) ? {
917
- scrollLeft: e.scrollLeft,
918
- scrollTop: e.scrollTop
919
- } : {
920
- scrollLeft: e.pageXOffset,
921
- scrollTop: e.pageYOffset
922
- };
923
- }
924
- function xe(e) {
925
- if (ae(e) === "html")
926
- return e;
927
- const t = (
928
- // Step into the shadow DOM of the parent of a slotted node.
929
- e.assignedSlot || // DOM Element detected.
930
- e.parentNode || // ShadowRoot detected.
931
- ft(e) && e.host || // Fallback.
932
- se(e)
933
- );
934
- return ft(t) ? t.host : t;
935
- }
936
- function mn(e) {
937
- const t = xe(e);
938
- return Ae(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Z(t) && _e(t) ? t : mn(t);
939
- }
940
- function le(e, t, n) {
941
- var o;
942
- t === void 0 && (t = []), n === void 0 && (n = !0);
943
- const r = mn(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = q(r);
944
- return i ? t.concat(s, s.visualViewport || [], _e(r) ? r : [], s.frameElement && n ? le(s.frameElement) : []) : t.concat(r, le(r, [], n));
945
- }
946
- function jo(e) {
947
- let t = e.activeElement;
948
- for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
949
- var n;
950
- t = t.shadowRoot.activeElement;
951
- }
952
- return t;
953
- }
954
- function ve(e, t) {
955
- if (!e || !t)
956
- return !1;
957
- const n = t.getRootNode == null ? void 0 : t.getRootNode();
958
- if (e.contains(t))
959
- return !0;
960
- if (n && ft(n)) {
961
- let o = t;
962
- for (; o; ) {
963
- if (e === o)
964
- return !0;
965
- o = o.parentNode || o.host;
966
- }
967
- }
968
- return !1;
969
- }
970
- function Ho() {
971
- return /apple/i.test(navigator.vendor);
972
- }
973
- function Ze(e, t) {
974
- const n = ["mouse", "pen"];
975
- return t || n.push("", void 0), n.includes(e);
976
- }
977
- function Vo(e) {
978
- return "nativeEvent" in e;
979
- }
980
- function _o(e) {
981
- return e.matches("html,body");
982
- }
983
- function he(e) {
984
- return (e == null ? void 0 : e.ownerDocument) || document;
985
- }
986
- function st(e, t) {
987
- if (t == null)
988
- return !1;
989
- if ("composedPath" in e)
990
- return e.composedPath().includes(t);
991
- const n = e;
992
- return n.target != null && t.contains(n.target);
993
- }
994
- function ke(e) {
995
- return "composedPath" in e ? e.composedPath()[0] : e.target;
996
- }
997
- const Yo = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
998
- function Xo(e) {
999
- return Z(e) && e.matches(Yo);
1000
- }
1001
- const ie = Math.min, Y = Math.max, Je = Math.round, Xe = Math.floor, ce = (e) => ({
1002
- x: e,
1003
- y: e
1004
- }), Ko = {
1005
- left: "right",
1006
- right: "left",
1007
- bottom: "top",
1008
- top: "bottom"
1009
- }, Go = {
1010
- start: "end",
1011
- end: "start"
1012
- };
1013
- function Lt(e, t, n) {
1014
- return Y(e, ie(t, n));
1015
- }
1016
- function Le(e, t) {
1017
- return typeof e == "function" ? e(t) : e;
1018
- }
1019
- function ne(e) {
1020
- return e.split("-")[0];
1021
- }
1022
- function Ye(e) {
1023
- return e.split("-")[1];
1024
- }
1025
- function gn(e) {
1026
- return e === "x" ? "y" : "x";
1027
- }
1028
- function pn(e) {
1029
- return e === "y" ? "height" : "width";
1030
- }
1031
- function Fe(e) {
1032
- return ["top", "bottom"].includes(ne(e)) ? "y" : "x";
1033
- }
1034
- function hn(e) {
1035
- return gn(Fe(e));
1036
- }
1037
- function Uo(e, t, n) {
1038
- n === void 0 && (n = !1);
1039
- const o = Ye(e), r = hn(e), i = pn(r);
1040
- let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
1041
- return t.reference[i] > t.floating[i] && (s = Qe(s)), [s, Qe(s)];
1042
- }
1043
- function qo(e) {
1044
- const t = Qe(e);
1045
- return [mt(e), t, mt(t)];
1046
- }
1047
- function mt(e) {
1048
- return e.replace(/start|end/g, (t) => Go[t]);
1049
- }
1050
- function Zo(e, t, n) {
1051
- const o = ["left", "right"], r = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
1052
- switch (e) {
1053
- case "top":
1054
- case "bottom":
1055
- return n ? t ? r : o : t ? o : r;
1056
- case "left":
1057
- case "right":
1058
- return t ? i : s;
1059
- default:
1060
- return [];
1061
- }
1062
- }
1063
- function Jo(e, t, n, o) {
1064
- const r = Ye(e);
1065
- let i = Zo(ne(e), n === "start", o);
1066
- return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(mt)))), i;
1067
- }
1068
- function Qe(e) {
1069
- return e.replace(/left|right|bottom|top/g, (t) => Ko[t]);
1070
- }
1071
- function Qo(e) {
1072
- return {
1073
- top: 0,
1074
- right: 0,
1075
- bottom: 0,
1076
- left: 0,
1077
- ...e
1078
- };
1079
- }
1080
- function bn(e) {
1081
- return typeof e != "number" ? Qo(e) : {
1082
- top: e,
1083
- right: e,
1084
- bottom: e,
1085
- left: e
1086
- };
1087
- }
1088
- function Oe(e) {
1089
- return {
1090
- ...e,
1091
- top: e.y,
1092
- left: e.x,
1093
- right: e.x + e.width,
1094
- bottom: e.y + e.height
1095
- };
1096
- }
1097
- function Ft(e, t, n) {
1098
- let {
1099
- reference: o,
1100
- floating: r
1101
- } = e;
1102
- const i = Fe(t), s = hn(t), l = pn(s), a = ne(t), c = i === "y", m = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, f = o[l] / 2 - r[l] / 2;
1103
- let d;
1104
- switch (a) {
1105
- case "top":
1106
- d = {
1107
- x: m,
1108
- y: o.y - r.height
1109
- };
1110
- break;
1111
- case "bottom":
1112
- d = {
1113
- x: m,
1114
- y: o.y + o.height
1115
- };
1116
- break;
1117
- case "right":
1118
- d = {
1119
- x: o.x + o.width,
1120
- y: u
1121
- };
1122
- break;
1123
- case "left":
1124
- d = {
1125
- x: o.x - r.width,
1126
- y: u
1127
- };
1128
- break;
1129
- default:
1130
- d = {
1131
- x: o.x,
1132
- y: o.y
1133
- };
1134
- }
1135
- switch (Ye(t)) {
1136
- case "start":
1137
- d[s] -= f * (n && c ? -1 : 1);
1138
- break;
1139
- case "end":
1140
- d[s] += f * (n && c ? -1 : 1);
1141
- break;
1142
- }
1143
- return d;
1144
- }
1145
- const er = async (e, t, n) => {
1146
- const {
1147
- placement: o = "bottom",
1148
- strategy: r = "absolute",
1149
- middleware: i = [],
1150
- platform: s
1151
- } = n, l = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
1152
- let c = await s.getElementRects({
1153
- reference: e,
1154
- floating: t,
1155
- strategy: r
1156
- }), {
1157
- x: m,
1158
- y: u
1159
- } = Ft(c, o, a), f = o, d = {}, g = 0;
1160
- for (let p = 0; p < l.length; p++) {
1161
- const {
1162
- name: $,
1163
- fn: h
1164
- } = l[p], {
1165
- x,
1166
- y: B,
1167
- data: S,
1168
- reset: k
1169
- } = await h({
1170
- x: m,
1171
- y: u,
1172
- initialPlacement: o,
1173
- placement: f,
1174
- strategy: r,
1175
- middlewareData: d,
1176
- rects: c,
1177
- platform: s,
1178
- elements: {
1179
- reference: e,
1180
- floating: t
1181
- }
1182
- });
1183
- m = x ?? m, u = B ?? u, d = {
1184
- ...d,
1185
- [$]: {
1186
- ...d[$],
1187
- ...S
1188
- }
1189
- }, k && g <= 50 && (g++, typeof k == "object" && (k.placement && (f = k.placement), k.rects && (c = k.rects === !0 ? await s.getElementRects({
1190
- reference: e,
1191
- floating: t,
1192
- strategy: r
1193
- }) : k.rects), {
1194
- x: m,
1195
- y: u
1196
- } = Ft(c, f, a)), p = -1);
1197
- }
1198
- return {
1199
- x: m,
1200
- y: u,
1201
- placement: f,
1202
- strategy: r,
1203
- middlewareData: d
1204
- };
1205
- };
1206
- async function $t(e, t) {
1207
- var n;
1208
- t === void 0 && (t = {});
1209
- const {
1210
- x: o,
1211
- y: r,
1212
- platform: i,
1213
- rects: s,
1214
- elements: l,
1215
- strategy: a
1216
- } = e, {
1217
- boundary: c = "clippingAncestors",
1218
- rootBoundary: m = "viewport",
1219
- elementContext: u = "floating",
1220
- altBoundary: f = !1,
1221
- padding: d = 0
1222
- } = Le(t, e), g = bn(d), $ = l[f ? u === "floating" ? "reference" : "floating" : u], h = Oe(await i.getClippingRect({
1223
- element: (n = await (i.isElement == null ? void 0 : i.isElement($))) == null || n ? $ : $.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
1224
- boundary: c,
1225
- rootBoundary: m,
1226
- strategy: a
1227
- })), x = u === "floating" ? {
1228
- ...s.floating,
1229
- x: o,
1230
- y: r
1231
- } : s.reference, B = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), S = await (i.isElement == null ? void 0 : i.isElement(B)) ? await (i.getScale == null ? void 0 : i.getScale(B)) || {
1232
- x: 1,
1233
- y: 1
1234
- } : {
1235
- x: 1,
1236
- y: 1
1237
- }, k = Oe(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
1238
- elements: l,
1239
- rect: x,
1240
- offsetParent: B,
1241
- strategy: a
1242
- }) : x);
1243
- return {
1244
- top: (h.top - k.top + g.top) / S.y,
1245
- bottom: (k.bottom - h.bottom + g.bottom) / S.y,
1246
- left: (h.left - k.left + g.left) / S.x,
1247
- right: (k.right - h.right + g.right) / S.x
1248
- };
1249
- }
1250
- const tr = function(e) {
1251
- return e === void 0 && (e = {}), {
1252
- name: "flip",
1253
- options: e,
1254
- async fn(t) {
1255
- var n, o;
1256
- const {
1257
- placement: r,
1258
- middlewareData: i,
1259
- rects: s,
1260
- initialPlacement: l,
1261
- platform: a,
1262
- elements: c
1263
- } = t, {
1264
- mainAxis: m = !0,
1265
- crossAxis: u = !0,
1266
- fallbackPlacements: f,
1267
- fallbackStrategy: d = "bestFit",
1268
- fallbackAxisSideDirection: g = "none",
1269
- flipAlignment: p = !0,
1270
- ...$
1271
- } = Le(e, t);
1272
- if ((n = i.arrow) != null && n.alignmentOffset)
1273
- return {};
1274
- const h = ne(r), x = ne(l) === l, B = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), S = f || (x || !p ? [Qe(l)] : qo(l));
1275
- !f && g !== "none" && S.push(...Jo(l, p, g, B));
1276
- const k = [l, ...S], E = await $t(t, $), P = [];
1277
- let T = ((o = i.flip) == null ? void 0 : o.overflows) || [];
1278
- if (m && P.push(E[h]), u) {
1279
- const L = Uo(r, s, B);
1280
- P.push(E[L[0]], E[L[1]]);
1281
- }
1282
- if (T = [...T, {
1283
- placement: r,
1284
- overflows: P
1285
- }], !P.every((L) => L <= 0)) {
1286
- var D, A;
1287
- const L = (((D = i.flip) == null ? void 0 : D.index) || 0) + 1, O = k[L];
1288
- if (O)
1289
- return {
1290
- data: {
1291
- index: L,
1292
- overflows: T
1293
- },
1294
- reset: {
1295
- placement: O
1296
- }
1297
- };
1298
- let b = (A = T.filter((v) => v.overflows[0] <= 0).sort((v, I) => v.overflows[1] - I.overflows[1])[0]) == null ? void 0 : A.placement;
1299
- if (!b)
1300
- switch (d) {
1301
- case "bestFit": {
1302
- var F;
1303
- const v = (F = T.map((I) => [I.placement, I.overflows.filter((R) => R > 0).reduce((R, w) => R + w, 0)]).sort((I, R) => I[1] - R[1])[0]) == null ? void 0 : F[0];
1304
- v && (b = v);
1305
- break;
1306
- }
1307
- case "initialPlacement":
1308
- b = l;
1309
- break;
1310
- }
1311
- if (r !== b)
1312
- return {
1313
- reset: {
1314
- placement: b
1315
- }
1316
- };
1317
- }
1318
- return {};
1319
- }
1320
- };
1321
- };
1322
- function yn(e) {
1323
- const t = ie(...e.map((i) => i.left)), n = ie(...e.map((i) => i.top)), o = Y(...e.map((i) => i.right)), r = Y(...e.map((i) => i.bottom));
1324
- return {
1325
- x: t,
1326
- y: n,
1327
- width: o - t,
1328
- height: r - n
1329
- };
1330
- }
1331
- function nr(e) {
1332
- const t = e.slice().sort((r, i) => r.y - i.y), n = [];
1333
- let o = null;
1334
- for (let r = 0; r < t.length; r++) {
1335
- const i = t[r];
1336
- !o || i.y - o.y > o.height / 2 ? n.push([i]) : n[n.length - 1].push(i), o = i;
1337
- }
1338
- return n.map((r) => Oe(yn(r)));
1339
- }
1340
- const or = function(e) {
1341
- return e === void 0 && (e = {}), {
1342
- name: "inline",
1343
- options: e,
1344
- async fn(t) {
1345
- const {
1346
- placement: n,
1347
- elements: o,
1348
- rects: r,
1349
- platform: i,
1350
- strategy: s
1351
- } = t, {
1352
- padding: l = 2,
1353
- x: a,
1354
- y: c
1355
- } = Le(e, t), m = Array.from(await (i.getClientRects == null ? void 0 : i.getClientRects(o.reference)) || []), u = nr(m), f = Oe(yn(m)), d = bn(l);
1356
- function g() {
1357
- if (u.length === 2 && u[0].left > u[1].right && a != null && c != null)
1358
- return u.find(($) => a > $.left - d.left && a < $.right + d.right && c > $.top - d.top && c < $.bottom + d.bottom) || f;
1359
- if (u.length >= 2) {
1360
- if (Fe(n) === "y") {
1361
- const A = u[0], F = u[u.length - 1], L = ne(n) === "top", O = A.top, b = F.bottom, v = L ? A.left : F.left, I = L ? A.right : F.right, R = I - v, w = b - O;
1362
- return {
1363
- top: O,
1364
- bottom: b,
1365
- left: v,
1366
- right: I,
1367
- width: R,
1368
- height: w,
1369
- x: v,
1370
- y: O
1371
- };
1372
- }
1373
- const $ = ne(n) === "left", h = Y(...u.map((A) => A.right)), x = ie(...u.map((A) => A.left)), B = u.filter((A) => $ ? A.left === x : A.right === h), S = B[0].top, k = B[B.length - 1].bottom, E = x, P = h, T = P - E, D = k - S;
1374
- return {
1375
- top: S,
1376
- bottom: k,
1377
- left: E,
1378
- right: P,
1379
- width: T,
1380
- height: D,
1381
- x: E,
1382
- y: S
1383
- };
1384
- }
1385
- return f;
1386
- }
1387
- const p = await i.getElementRects({
1388
- reference: {
1389
- getBoundingClientRect: g
1390
- },
1391
- floating: o.floating,
1392
- strategy: s
1393
- });
1394
- return r.reference.x !== p.reference.x || r.reference.y !== p.reference.y || r.reference.width !== p.reference.width || r.reference.height !== p.reference.height ? {
1395
- reset: {
1396
- rects: p
1397
- }
1398
- } : {};
1399
- }
1400
- };
1401
- };
1402
- async function rr(e, t) {
1403
- const {
1404
- placement: n,
1405
- platform: o,
1406
- elements: r
1407
- } = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = ne(n), l = Ye(n), a = Fe(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, m = i && a ? -1 : 1, u = Le(t, e);
1408
- let {
1409
- mainAxis: f,
1410
- crossAxis: d,
1411
- alignmentAxis: g
1412
- } = typeof u == "number" ? {
1413
- mainAxis: u,
1414
- crossAxis: 0,
1415
- alignmentAxis: null
1416
- } : {
1417
- mainAxis: 0,
1418
- crossAxis: 0,
1419
- alignmentAxis: null,
1420
- ...u
1421
- };
1422
- return l && typeof g == "number" && (d = l === "end" ? g * -1 : g), a ? {
1423
- x: d * m,
1424
- y: f * c
1425
- } : {
1426
- x: f * c,
1427
- y: d * m
1428
- };
1429
- }
1430
- const ir = function(e) {
1431
- return e === void 0 && (e = 0), {
1432
- name: "offset",
1433
- options: e,
1434
- async fn(t) {
1435
- var n, o;
1436
- const {
1437
- x: r,
1438
- y: i,
1439
- placement: s,
1440
- middlewareData: l
1441
- } = t, a = await rr(t, e);
1442
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
1443
- x: r + a.x,
1444
- y: i + a.y,
1445
- data: {
1446
- ...a,
1447
- placement: s
1448
- }
1449
- };
1450
- }
1451
- };
1452
- }, sr = function(e) {
1453
- return e === void 0 && (e = {}), {
1454
- name: "shift",
1455
- options: e,
1456
- async fn(t) {
1457
- const {
1458
- x: n,
1459
- y: o,
1460
- placement: r
1461
- } = t, {
1462
- mainAxis: i = !0,
1463
- crossAxis: s = !1,
1464
- limiter: l = {
1465
- fn: ($) => {
1466
- let {
1467
- x: h,
1468
- y: x
1469
- } = $;
1470
- return {
1471
- x: h,
1472
- y: x
1473
- };
1474
- }
1475
- },
1476
- ...a
1477
- } = Le(e, t), c = {
1478
- x: n,
1479
- y: o
1480
- }, m = await $t(t, a), u = Fe(ne(r)), f = gn(u);
1481
- let d = c[f], g = c[u];
1482
- if (i) {
1483
- const $ = f === "y" ? "top" : "left", h = f === "y" ? "bottom" : "right", x = d + m[$], B = d - m[h];
1484
- d = Lt(x, d, B);
1485
- }
1486
- if (s) {
1487
- const $ = u === "y" ? "top" : "left", h = u === "y" ? "bottom" : "right", x = g + m[$], B = g - m[h];
1488
- g = Lt(x, g, B);
1489
- }
1490
- const p = l.fn({
1491
- ...t,
1492
- [f]: d,
1493
- [u]: g
1494
- });
1495
- return {
1496
- ...p,
1497
- data: {
1498
- x: p.x - n,
1499
- y: p.y - o
1500
- }
1501
- };
1502
- }
1503
- };
1504
- }, lr = function(e) {
1505
- return e === void 0 && (e = {}), {
1506
- name: "size",
1507
- options: e,
1508
- async fn(t) {
1509
- const {
1510
- placement: n,
1511
- rects: o,
1512
- platform: r,
1513
- elements: i
1514
- } = t, {
1515
- apply: s = () => {
1516
- },
1517
- ...l
1518
- } = Le(e, t), a = await $t(t, l), c = ne(n), m = Ye(n), u = Fe(n) === "y", {
1519
- width: f,
1520
- height: d
1521
- } = o.floating;
1522
- let g, p;
1523
- c === "top" || c === "bottom" ? (g = c, p = m === (await (r.isRTL == null ? void 0 : r.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (p = c, g = m === "end" ? "top" : "bottom");
1524
- const $ = d - a[g], h = f - a[p], x = !t.middlewareData.shift;
1525
- let B = $, S = h;
1526
- if (u) {
1527
- const E = f - a.left - a.right;
1528
- S = m || x ? ie(h, E) : E;
1529
- } else {
1530
- const E = d - a.top - a.bottom;
1531
- B = m || x ? ie($, E) : E;
1532
- }
1533
- if (x && !m) {
1534
- const E = Y(a.left, 0), P = Y(a.right, 0), T = Y(a.top, 0), D = Y(a.bottom, 0);
1535
- u ? S = f - 2 * (E !== 0 || P !== 0 ? E + P : Y(a.left, a.right)) : B = d - 2 * (T !== 0 || D !== 0 ? T + D : Y(a.top, a.bottom));
1536
- }
1537
- await s({
1538
- ...t,
1539
- availableWidth: S,
1540
- availableHeight: B
1541
- });
1542
- const k = await r.getDimensions(i.floating);
1543
- return f !== k.width || d !== k.height ? {
1544
- reset: {
1545
- rects: !0
1546
- }
1547
- } : {};
1548
- }
1549
- };
1550
- };
1551
- function vn(e) {
1552
- const t = J(e);
1553
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1554
- const r = Z(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, l = Je(n) !== i || Je(o) !== s;
1555
- return l && (n = i, o = s), {
1556
- width: n,
1557
- height: o,
1558
- $: l
1559
- };
1560
- }
1561
- function wt(e) {
1562
- return j(e) ? e : e.contextElement;
1563
- }
1564
- function Pe(e) {
1565
- const t = wt(e);
1566
- if (!Z(t))
1567
- return ce(1);
1568
- const n = t.getBoundingClientRect(), {
1569
- width: o,
1570
- height: r,
1571
- $: i
1572
- } = vn(t);
1573
- let s = (i ? Je(n.width) : n.width) / o, l = (i ? Je(n.height) : n.height) / r;
1574
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1575
- x: s,
1576
- y: l
1577
- };
1578
- }
1579
- const ar = /* @__PURE__ */ ce(0);
1580
- function xn(e) {
1581
- const t = q(e);
1582
- return !xt() || !t.visualViewport ? ar : {
1583
- x: t.visualViewport.offsetLeft,
1584
- y: t.visualViewport.offsetTop
1585
- };
1586
- }
1587
- function cr(e, t, n) {
1588
- return t === void 0 && (t = !1), !n || t && n !== q(e) ? !1 : t;
1589
- }
1590
- function $e(e, t, n, o) {
1591
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1592
- const r = e.getBoundingClientRect(), i = wt(e);
1593
- let s = ce(1);
1594
- t && (o ? j(o) && (s = Pe(o)) : s = Pe(e));
1595
- const l = cr(i, n, o) ? xn(i) : ce(0);
1596
- let a = (r.left + l.x) / s.x, c = (r.top + l.y) / s.y, m = r.width / s.x, u = r.height / s.y;
1597
- if (i) {
1598
- const f = q(i), d = o && j(o) ? q(o) : o;
1599
- let g = f, p = g.frameElement;
1600
- for (; p && o && d !== g; ) {
1601
- const $ = Pe(p), h = p.getBoundingClientRect(), x = J(p), B = h.left + (p.clientLeft + parseFloat(x.paddingLeft)) * $.x, S = h.top + (p.clientTop + parseFloat(x.paddingTop)) * $.y;
1602
- a *= $.x, c *= $.y, m *= $.x, u *= $.y, a += B, c += S, g = q(p), p = g.frameElement;
1603
- }
1604
- }
1605
- return Oe({
1606
- width: m,
1607
- height: u,
1608
- x: a,
1609
- y: c
1610
- });
1611
- }
1612
- const ur = [":popover-open", ":modal"];
1613
- function $n(e) {
1614
- return ur.some((t) => {
1615
- try {
1616
- return e.matches(t);
1617
- } catch {
1618
- return !1;
1619
- }
1620
- });
1621
- }
1622
- function dr(e) {
1623
- let {
1624
- elements: t,
1625
- rect: n,
1626
- offsetParent: o,
1627
- strategy: r
1628
- } = e;
1629
- const i = r === "fixed", s = se(o), l = t ? $n(t.floating) : !1;
1630
- if (o === s || l && i)
1631
- return n;
1632
- let a = {
1633
- scrollLeft: 0,
1634
- scrollTop: 0
1635
- }, c = ce(1);
1636
- const m = ce(0), u = Z(o);
1637
- if ((u || !u && !i) && ((ae(o) !== "body" || _e(s)) && (a = ot(o)), Z(o))) {
1638
- const f = $e(o);
1639
- c = Pe(o), m.x = f.x + o.clientLeft, m.y = f.y + o.clientTop;
1640
- }
1641
- return {
1642
- width: n.width * c.x,
1643
- height: n.height * c.y,
1644
- x: n.x * c.x - a.scrollLeft * c.x + m.x,
1645
- y: n.y * c.y - a.scrollTop * c.y + m.y
1646
- };
1647
- }
1648
- function fr(e) {
1649
- return Array.from(e.getClientRects());
1650
- }
1651
- function wn(e) {
1652
- return $e(se(e)).left + ot(e).scrollLeft;
1653
- }
1654
- function mr(e) {
1655
- const t = se(e), n = ot(e), o = e.ownerDocument.body, r = Y(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = Y(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1656
- let s = -n.scrollLeft + wn(e);
1657
- const l = -n.scrollTop;
1658
- return J(o).direction === "rtl" && (s += Y(t.clientWidth, o.clientWidth) - r), {
1659
- width: r,
1660
- height: i,
1661
- x: s,
1662
- y: l
1663
- };
1664
- }
1665
- function gr(e, t) {
1666
- const n = q(e), o = se(e), r = n.visualViewport;
1667
- let i = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
1668
- if (r) {
1669
- i = r.width, s = r.height;
1670
- const c = xt();
1671
- (!c || c && t === "fixed") && (l = r.offsetLeft, a = r.offsetTop);
1672
- }
1673
- return {
1674
- width: i,
1675
- height: s,
1676
- x: l,
1677
- y: a
1678
- };
1679
- }
1680
- function pr(e, t) {
1681
- const n = $e(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = Z(e) ? Pe(e) : ce(1), s = e.clientWidth * i.x, l = e.clientHeight * i.y, a = r * i.x, c = o * i.y;
1682
- return {
1683
- width: s,
1684
- height: l,
1685
- x: a,
1686
- y: c
1687
- };
1688
- }
1689
- function zt(e, t, n) {
1690
- let o;
1691
- if (t === "viewport")
1692
- o = gr(e, n);
1693
- else if (t === "document")
1694
- o = mr(se(e));
1695
- else if (j(t))
1696
- o = pr(t, n);
1697
- else {
1698
- const r = xn(e);
1699
- o = {
1700
- ...t,
1701
- x: t.x - r.x,
1702
- y: t.y - r.y
1703
- };
1704
- }
1705
- return Oe(o);
1706
- }
1707
- function Sn(e, t) {
1708
- const n = xe(e);
1709
- return n === t || !j(n) || Ae(n) ? !1 : J(n).position === "fixed" || Sn(n, t);
1710
- }
1711
- function hr(e, t) {
1712
- const n = t.get(e);
1713
- if (n)
1714
- return n;
1715
- let o = le(e, [], !1).filter((l) => j(l) && ae(l) !== "body"), r = null;
1716
- const i = J(e).position === "fixed";
1717
- let s = i ? xe(e) : e;
1718
- for (; j(s) && !Ae(s); ) {
1719
- const l = J(s), a = vt(s);
1720
- !a && l.position === "fixed" && (r = null), (i ? !a && !r : !a && l.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || _e(s) && !a && Sn(e, s)) ? o = o.filter((m) => m !== s) : r = l, s = xe(s);
1721
- }
1722
- return t.set(e, o), o;
1723
- }
1724
- function br(e) {
1725
- let {
1726
- element: t,
1727
- boundary: n,
1728
- rootBoundary: o,
1729
- strategy: r
1730
- } = e;
1731
- const s = [...n === "clippingAncestors" ? hr(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((c, m) => {
1732
- const u = zt(t, m, r);
1733
- return c.top = Y(u.top, c.top), c.right = ie(u.right, c.right), c.bottom = ie(u.bottom, c.bottom), c.left = Y(u.left, c.left), c;
1734
- }, zt(t, l, r));
1735
- return {
1736
- width: a.right - a.left,
1737
- height: a.bottom - a.top,
1738
- x: a.left,
1739
- y: a.top
1740
- };
1741
- }
1742
- function yr(e) {
1743
- const {
1744
- width: t,
1745
- height: n
1746
- } = vn(e);
1747
- return {
1748
- width: t,
1749
- height: n
1750
- };
1751
- }
1752
- function vr(e, t, n) {
1753
- const o = Z(t), r = se(t), i = n === "fixed", s = $e(e, !0, i, t);
1754
- let l = {
1755
- scrollLeft: 0,
1756
- scrollTop: 0
1757
- };
1758
- const a = ce(0);
1759
- if (o || !o && !i)
1760
- if ((ae(t) !== "body" || _e(r)) && (l = ot(t)), o) {
1761
- const u = $e(t, !0, i, t);
1762
- a.x = u.x + t.clientLeft, a.y = u.y + t.clientTop;
1763
- } else
1764
- r && (a.x = wn(r));
1765
- const c = s.left + l.scrollLeft - a.x, m = s.top + l.scrollTop - a.y;
1766
- return {
1767
- x: c,
1768
- y: m,
1769
- width: s.width,
1770
- height: s.height
1771
- };
1772
- }
1773
- function Wt(e, t) {
1774
- return !Z(e) || J(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
1775
- }
1776
- function Rn(e, t) {
1777
- const n = q(e);
1778
- if (!Z(e) || $n(e))
1779
- return n;
1780
- let o = Wt(e, t);
1781
- for (; o && Wo(o) && J(o).position === "static"; )
1782
- o = Wt(o, t);
1783
- return o && (ae(o) === "html" || ae(o) === "body" && J(o).position === "static" && !vt(o)) ? n : o || No(e) || n;
1784
- }
1785
- const xr = async function(e) {
1786
- const t = this.getOffsetParent || Rn, n = this.getDimensions;
1787
- return {
1788
- reference: vr(e.reference, await t(e.floating), e.strategy),
1789
- floating: {
1790
- x: 0,
1791
- y: 0,
1792
- ...await n(e.floating)
1793
- }
1794
- };
1795
- };
1796
- function $r(e) {
1797
- return J(e).direction === "rtl";
1798
- }
1799
- const wr = {
1800
- convertOffsetParentRelativeRectToViewportRelativeRect: dr,
1801
- getDocumentElement: se,
1802
- getClippingRect: br,
1803
- getOffsetParent: Rn,
1804
- getElementRects: xr,
1805
- getClientRects: fr,
1806
- getDimensions: yr,
1807
- getScale: Pe,
1808
- isElement: j,
1809
- isRTL: $r
1810
- };
1811
- function Sr(e, t) {
1812
- let n = null, o;
1813
- const r = se(e);
1814
- function i() {
1815
- var l;
1816
- clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
1817
- }
1818
- function s(l, a) {
1819
- l === void 0 && (l = !1), a === void 0 && (a = 1), i();
1820
- const {
1821
- left: c,
1822
- top: m,
1823
- width: u,
1824
- height: f
1825
- } = e.getBoundingClientRect();
1826
- if (l || t(), !u || !f)
1827
- return;
1828
- const d = Xe(m), g = Xe(r.clientWidth - (c + u)), p = Xe(r.clientHeight - (m + f)), $ = Xe(c), x = {
1829
- rootMargin: -d + "px " + -g + "px " + -p + "px " + -$ + "px",
1830
- threshold: Y(0, ie(1, a)) || 1
1831
- };
1832
- let B = !0;
1833
- function S(k) {
1834
- const E = k[0].intersectionRatio;
1835
- if (E !== a) {
1836
- if (!B)
1837
- return s();
1838
- E ? s(!1, E) : o = setTimeout(() => {
1839
- s(!1, 1e-7);
1840
- }, 100);
1841
- }
1842
- B = !1;
1843
- }
1844
- try {
1845
- n = new IntersectionObserver(S, {
1846
- ...x,
1847
- // Handle <iframe>s
1848
- root: r.ownerDocument
1849
- });
1850
- } catch {
1851
- n = new IntersectionObserver(S, x);
1852
- }
1853
- n.observe(e);
1854
- }
1855
- return s(!0), i;
1856
- }
1857
- function Rr(e, t, n, o) {
1858
- o === void 0 && (o = {});
1859
- const {
1860
- ancestorScroll: r = !0,
1861
- ancestorResize: i = !0,
1862
- elementResize: s = typeof ResizeObserver == "function",
1863
- layoutShift: l = typeof IntersectionObserver == "function",
1864
- animationFrame: a = !1
1865
- } = o, c = wt(e), m = r || i ? [...c ? le(c) : [], ...le(t)] : [];
1866
- m.forEach((h) => {
1867
- r && h.addEventListener("scroll", n, {
1868
- passive: !0
1869
- }), i && h.addEventListener("resize", n);
1870
- });
1871
- const u = c && l ? Sr(c, n) : null;
1872
- let f = -1, d = null;
1873
- s && (d = new ResizeObserver((h) => {
1874
- let [x] = h;
1875
- x && x.target === c && d && (d.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1876
- var B;
1877
- (B = d) == null || B.observe(t);
1878
- })), n();
1879
- }), c && !a && d.observe(c), d.observe(t));
1880
- let g, p = a ? $e(e) : null;
1881
- a && $();
1882
- function $() {
1883
- const h = $e(e);
1884
- p && (h.x !== p.x || h.y !== p.y || h.width !== p.width || h.height !== p.height) && n(), p = h, g = requestAnimationFrame($);
1885
- }
1886
- return n(), () => {
1887
- var h;
1888
- m.forEach((x) => {
1889
- r && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
1890
- }), u == null || u(), (h = d) == null || h.disconnect(), d = null, a && cancelAnimationFrame(g);
1891
- };
1892
- }
1893
- const Cr = sr, Er = tr, Ui = lr, qi = or, kr = (e, t, n) => {
1894
- const o = /* @__PURE__ */ new Map(), r = {
1895
- platform: wr,
1896
- ...n
1897
- }, i = {
1898
- ...r.platform,
1899
- _c: o
1900
- };
1901
- return er(e, t, {
1902
- ...r,
1903
- platform: i
1904
- });
1905
- };
1906
- var Ke = typeof document < "u" ? on : rn;
1907
- function et(e, t) {
1908
- if (e === t)
1909
- return !0;
1910
- if (typeof e != typeof t)
1911
- return !1;
1912
- if (typeof e == "function" && e.toString() === t.toString())
1913
- return !0;
1914
- let n, o, r;
1915
- if (e && t && typeof e == "object") {
1916
- if (Array.isArray(e)) {
1917
- if (n = e.length, n !== t.length)
1918
- return !1;
1919
- for (o = n; o-- !== 0; )
1920
- if (!et(e[o], t[o]))
1921
- return !1;
1922
- return !0;
1923
- }
1924
- if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
1925
- return !1;
1926
- for (o = n; o-- !== 0; )
1927
- if (!{}.hasOwnProperty.call(t, r[o]))
1928
- return !1;
1929
- for (o = n; o-- !== 0; ) {
1930
- const i = r[o];
1931
- if (!(i === "_owner" && e.$$typeof) && !et(e[i], t[i]))
1932
- return !1;
1933
- }
1934
- return !0;
1935
- }
1936
- return e !== e && t !== t;
1937
- }
1938
- function Cn(e) {
1939
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1940
- }
1941
- function Nt(e, t) {
1942
- const n = Cn(e);
1943
- return Math.round(t * n) / n;
1944
- }
1945
- function jt(e) {
1946
- const t = y.useRef(e);
1947
- return Ke(() => {
1948
- t.current = e;
1949
- }), t;
1950
- }
1951
- function Tr(e) {
1952
- e === void 0 && (e = {});
1953
- const {
1954
- placement: t = "bottom",
1955
- strategy: n = "absolute",
1956
- middleware: o = [],
1957
- platform: r,
1958
- elements: {
1959
- reference: i,
1960
- floating: s
1961
- } = {},
1962
- transform: l = !0,
1963
- whileElementsMounted: a,
1964
- open: c
1965
- } = e, [m, u] = y.useState({
1966
- x: 0,
1967
- y: 0,
1968
- strategy: n,
1969
- placement: t,
1970
- middlewareData: {},
1971
- isPositioned: !1
1972
- }), [f, d] = y.useState(o);
1973
- et(f, o) || d(o);
1974
- const [g, p] = y.useState(null), [$, h] = y.useState(null), x = y.useCallback((R) => {
1975
- R !== E.current && (E.current = R, p(R));
1976
- }, []), B = y.useCallback((R) => {
1977
- R !== P.current && (P.current = R, h(R));
1978
- }, []), S = i || g, k = s || $, E = y.useRef(null), P = y.useRef(null), T = y.useRef(m), D = a != null, A = jt(a), F = jt(r), L = y.useCallback(() => {
1979
- if (!E.current || !P.current)
1980
- return;
1981
- const R = {
1982
- placement: t,
1983
- strategy: n,
1984
- middleware: f
1985
- };
1986
- F.current && (R.platform = F.current), kr(E.current, P.current, R).then((w) => {
1987
- const z = {
1988
- ...w,
1989
- isPositioned: !0
1990
- };
1991
- O.current && !et(T.current, z) && (T.current = z, Vn.flushSync(() => {
1992
- u(z);
1993
- }));
1994
- });
1995
- }, [f, t, n, F]);
1996
- Ke(() => {
1997
- c === !1 && T.current.isPositioned && (T.current.isPositioned = !1, u((R) => ({
1998
- ...R,
1999
- isPositioned: !1
2000
- })));
2001
- }, [c]);
2002
- const O = y.useRef(!1);
2003
- Ke(() => (O.current = !0, () => {
2004
- O.current = !1;
2005
- }), []), Ke(() => {
2006
- if (S && (E.current = S), k && (P.current = k), S && k) {
2007
- if (A.current)
2008
- return A.current(S, k, L);
2009
- L();
2010
- }
2011
- }, [S, k, L, A, D]);
2012
- const b = y.useMemo(() => ({
2013
- reference: E,
2014
- floating: P,
2015
- setReference: x,
2016
- setFloating: B
2017
- }), [x, B]), v = y.useMemo(() => ({
2018
- reference: S,
2019
- floating: k
2020
- }), [S, k]), I = y.useMemo(() => {
2021
- const R = {
2022
- position: n,
2023
- left: 0,
2024
- top: 0
2025
- };
2026
- if (!v.floating)
2027
- return R;
2028
- const w = Nt(v.floating, m.x), z = Nt(v.floating, m.y);
2029
- return l ? {
2030
- ...R,
2031
- transform: "translate(" + w + "px, " + z + "px)",
2032
- ...Cn(v.floating) >= 1.5 && {
2033
- willChange: "transform"
2034
- }
2035
- } : {
2036
- position: n,
2037
- left: w,
2038
- top: z
2039
- };
2040
- }, [n, l, v.floating, m.x, m.y]);
2041
- return y.useMemo(() => ({
2042
- ...m,
2043
- update: L,
2044
- refs: b,
2045
- elements: v,
2046
- floatingStyles: I
2047
- }), [m, L, b, v, I]);
2048
- }
2049
- /*!
2050
- * tabbable 6.2.0
2051
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
2052
- */
2053
- var Ir = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], gt = /* @__PURE__ */ Ir.join(","), En = typeof Element > "u", je = En ? function() {
2054
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, tt = !En && Element.prototype.getRootNode ? function(e) {
2055
- var t;
2056
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
2057
- } : function(e) {
2058
- return e == null ? void 0 : e.ownerDocument;
2059
- }, nt = function e(t, n) {
2060
- var o;
2061
- n === void 0 && (n = !0);
2062
- var r = t == null || (o = t.getAttribute) === null || o === void 0 ? void 0 : o.call(t, "inert"), i = r === "" || r === "true", s = i || n && t && e(t.parentNode);
2063
- return s;
2064
- }, Br = function(t) {
2065
- var n, o = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
2066
- return o === "" || o === "true";
2067
- }, Pr = function(t, n, o) {
2068
- if (nt(t))
2069
- return [];
2070
- var r = Array.prototype.slice.apply(t.querySelectorAll(gt));
2071
- return n && je.call(t, gt) && r.unshift(t), r = r.filter(o), r;
2072
- }, Ar = function e(t, n, o) {
2073
- for (var r = [], i = Array.from(t); i.length; ) {
2074
- var s = i.shift();
2075
- if (!nt(s, !1))
2076
- if (s.tagName === "SLOT") {
2077
- var l = s.assignedElements(), a = l.length ? l : s.children, c = e(a, !0, o);
2078
- o.flatten ? r.push.apply(r, c) : r.push({
2079
- scopeParent: s,
2080
- candidates: c
2081
- });
2082
- } else {
2083
- var m = je.call(s, gt);
2084
- m && o.filter(s) && (n || !t.includes(s)) && r.push(s);
2085
- var u = s.shadowRoot || // check for an undisclosed shadow
2086
- typeof o.getShadowRoot == "function" && o.getShadowRoot(s), f = !nt(u, !1) && (!o.shadowRootFilter || o.shadowRootFilter(s));
2087
- if (u && f) {
2088
- var d = e(u === !0 ? s.children : u.children, !0, o);
2089
- o.flatten ? r.push.apply(r, d) : r.push({
2090
- scopeParent: s,
2091
- candidates: d
2092
- });
2093
- } else
2094
- i.unshift.apply(i, s.children);
2095
- }
2096
- }
2097
- return r;
2098
- }, kn = function(t) {
2099
- return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
2100
- }, Tn = function(t) {
2101
- if (!t)
2102
- throw new Error("No node provided");
2103
- return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || Br(t)) && !kn(t) ? 0 : t.tabIndex;
2104
- }, Or = function(t, n) {
2105
- var o = Tn(t);
2106
- return o < 0 && n && !kn(t) ? 0 : o;
2107
- }, Dr = function(t, n) {
2108
- return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
2109
- }, In = function(t) {
2110
- return t.tagName === "INPUT";
2111
- }, Mr = function(t) {
2112
- return In(t) && t.type === "hidden";
2113
- }, Lr = function(t) {
2114
- var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(o) {
2115
- return o.tagName === "SUMMARY";
2116
- });
2117
- return n;
2118
- }, Fr = function(t, n) {
2119
- for (var o = 0; o < t.length; o++)
2120
- if (t[o].checked && t[o].form === n)
2121
- return t[o];
2122
- }, zr = function(t) {
2123
- if (!t.name)
2124
- return !0;
2125
- var n = t.form || tt(t), o = function(l) {
2126
- return n.querySelectorAll('input[type="radio"][name="' + l + '"]');
2127
- }, r;
2128
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
2129
- r = o(window.CSS.escape(t.name));
2130
- else
2131
- try {
2132
- r = o(t.name);
2133
- } catch (s) {
2134
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
2135
- }
2136
- var i = Fr(r, t.form);
2137
- return !i || i === t;
2138
- }, Wr = function(t) {
2139
- return In(t) && t.type === "radio";
2140
- }, Nr = function(t) {
2141
- return Wr(t) && !zr(t);
2142
- }, jr = function(t) {
2143
- var n, o = t && tt(t), r = (n = o) === null || n === void 0 ? void 0 : n.host, i = !1;
2144
- if (o && o !== t) {
2145
- var s, l, a;
2146
- for (i = !!((s = r) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(r) || t != null && (a = t.ownerDocument) !== null && a !== void 0 && a.contains(t)); !i && r; ) {
2147
- var c, m, u;
2148
- o = tt(r), r = (c = o) === null || c === void 0 ? void 0 : c.host, i = !!((m = r) !== null && m !== void 0 && (u = m.ownerDocument) !== null && u !== void 0 && u.contains(r));
2149
- }
2150
- }
2151
- return i;
2152
- }, Ht = function(t) {
2153
- var n = t.getBoundingClientRect(), o = n.width, r = n.height;
2154
- return o === 0 && r === 0;
2155
- }, Hr = function(t, n) {
2156
- var o = n.displayCheck, r = n.getShadowRoot;
2157
- if (getComputedStyle(t).visibility === "hidden")
2158
- return !0;
2159
- var i = je.call(t, "details>summary:first-of-type"), s = i ? t.parentElement : t;
2160
- if (je.call(s, "details:not([open]) *"))
2161
- return !0;
2162
- if (!o || o === "full" || o === "legacy-full") {
2163
- if (typeof r == "function") {
2164
- for (var l = t; t; ) {
2165
- var a = t.parentElement, c = tt(t);
2166
- if (a && !a.shadowRoot && r(a) === !0)
2167
- return Ht(t);
2168
- t.assignedSlot ? t = t.assignedSlot : !a && c !== t.ownerDocument ? t = c.host : t = a;
2169
- }
2170
- t = l;
2171
- }
2172
- if (jr(t))
2173
- return !t.getClientRects().length;
2174
- if (o !== "legacy-full")
2175
- return !0;
2176
- } else if (o === "non-zero-area")
2177
- return Ht(t);
2178
- return !1;
2179
- }, Vr = function(t) {
2180
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
2181
- for (var n = t.parentElement; n; ) {
2182
- if (n.tagName === "FIELDSET" && n.disabled) {
2183
- for (var o = 0; o < n.children.length; o++) {
2184
- var r = n.children.item(o);
2185
- if (r.tagName === "LEGEND")
2186
- return je.call(n, "fieldset[disabled] *") ? !0 : !r.contains(t);
2187
- }
2188
- return !0;
2189
- }
2190
- n = n.parentElement;
2191
- }
2192
- return !1;
2193
- }, _r = function(t, n) {
2194
- return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
2195
- // because we're limited in the type of selectors we can use in JSDom (see related
2196
- // note related to `candidateSelectors`)
2197
- nt(n) || Mr(n) || Hr(n, t) || // For a details element with a summary, the summary element gets the focus
2198
- Lr(n) || Vr(n));
2199
- }, Vt = function(t, n) {
2200
- return !(Nr(n) || Tn(n) < 0 || !_r(t, n));
2201
- }, Yr = function(t) {
2202
- var n = parseInt(t.getAttribute("tabindex"), 10);
2203
- return !!(isNaN(n) || n >= 0);
2204
- }, Xr = function e(t) {
2205
- var n = [], o = [];
2206
- return t.forEach(function(r, i) {
2207
- var s = !!r.scopeParent, l = s ? r.scopeParent : r, a = Or(l, s), c = s ? e(r.candidates) : l;
2208
- a === 0 ? s ? n.push.apply(n, c) : n.push(l) : o.push({
2209
- documentOrder: i,
2210
- tabIndex: a,
2211
- item: r,
2212
- isScope: s,
2213
- content: c
2214
- });
2215
- }), o.sort(Dr).reduce(function(r, i) {
2216
- return i.isScope ? r.push.apply(r, i.content) : r.push(i.content), r;
2217
- }, []).concat(n);
2218
- }, Bn = function(t, n) {
2219
- n = n || {};
2220
- var o;
2221
- return n.getShadowRoot ? o = Ar([t], n.includeContainer, {
2222
- filter: Vt.bind(null, n),
2223
- flatten: !1,
2224
- getShadowRoot: n.getShadowRoot,
2225
- shadowRootFilter: Yr
2226
- }) : o = Pr(t, n.includeContainer, Vt.bind(null, n)), Xr(o);
2227
- };
2228
- const Kr = y[/* @__PURE__ */ "useInsertionEffect".toString()], Gr = Kr || ((e) => e());
2229
- function Te(e) {
2230
- const t = y.useRef(() => {
2231
- if (process.env.NODE_ENV !== "production")
2232
- throw new Error("Cannot call an event handler while rendering.");
2233
- });
2234
- return Gr(() => {
2235
- t.current = e;
2236
- }), y.useCallback(function() {
2237
- for (var n = arguments.length, o = new Array(n), r = 0; r < n; r++)
2238
- o[r] = arguments[r];
2239
- return t.current == null ? void 0 : t.current(...o);
2240
- }, []);
2241
- }
2242
- var ee = typeof document < "u" ? on : rn;
2243
- function pt() {
2244
- return pt = Object.assign ? Object.assign.bind() : function(e) {
2245
- for (var t = 1; t < arguments.length; t++) {
2246
- var n = arguments[t];
2247
- for (var o in n)
2248
- Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
2249
- }
2250
- return e;
2251
- }, pt.apply(this, arguments);
2252
- }
2253
- let lt = !1, Ur = 0;
2254
- const _t = () => "floating-ui-" + Ur++;
2255
- function qr() {
2256
- const [e, t] = y.useState(() => lt ? _t() : void 0);
2257
- return ee(() => {
2258
- e == null && t(_t());
2259
- }, []), y.useEffect(() => {
2260
- lt || (lt = !0);
2261
- }, []), e;
2262
- }
2263
- const Zr = y[/* @__PURE__ */ "useId".toString()], St = Zr || qr;
2264
- function Jr() {
2265
- const e = /* @__PURE__ */ new Map();
2266
- return {
2267
- emit(t, n) {
2268
- var o;
2269
- (o = e.get(t)) == null || o.forEach((r) => r(n));
2270
- },
2271
- on(t, n) {
2272
- e.set(t, [...e.get(t) || [], n]);
2273
- },
2274
- off(t, n) {
2275
- var o;
2276
- e.set(t, ((o = e.get(t)) == null ? void 0 : o.filter((r) => r !== n)) || []);
2277
- }
2278
- };
2279
- }
2280
- const Qr = /* @__PURE__ */ y.createContext(null), ei = /* @__PURE__ */ y.createContext(null), Rt = () => {
2281
- var e;
2282
- return ((e = y.useContext(Qr)) == null ? void 0 : e.id) || null;
2283
- }, Ct = () => y.useContext(ei);
2284
- function rt(e) {
2285
- return "data-floating-ui-" + e;
2286
- }
2287
- function Be(e) {
2288
- const t = Wn(e);
2289
- return ee(() => {
2290
- t.current = e;
2291
- }), t;
2292
- }
2293
- const Yt = /* @__PURE__ */ rt("safe-polygon");
2294
- function at(e, t, n) {
2295
- return n && !Ze(n) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[t];
2296
- }
2297
- function ti(e, t) {
2298
- t === void 0 && (t = {});
2299
- const {
2300
- open: n,
2301
- onOpenChange: o,
2302
- dataRef: r,
2303
- events: i,
2304
- elements: {
2305
- domReference: s,
2306
- floating: l
2307
- },
2308
- refs: a
2309
- } = e, {
2310
- enabled: c = !0,
2311
- delay: m = 0,
2312
- handleClose: u = null,
2313
- mouseOnly: f = !1,
2314
- restMs: d = 0,
2315
- move: g = !0
2316
- } = t, p = Ct(), $ = Rt(), h = Be(u), x = Be(m), B = y.useRef(), S = y.useRef(), k = y.useRef(), E = y.useRef(), P = y.useRef(!0), T = y.useRef(!1), D = y.useRef(() => {
2317
- }), A = y.useCallback(() => {
2318
- var b;
2319
- const v = (b = r.current.openEvent) == null ? void 0 : b.type;
2320
- return (v == null ? void 0 : v.includes("mouse")) && v !== "mousedown";
2321
- }, [r]);
2322
- y.useEffect(() => {
2323
- if (!c)
2324
- return;
2325
- function b(v) {
2326
- let {
2327
- open: I
2328
- } = v;
2329
- I || (clearTimeout(S.current), clearTimeout(E.current), P.current = !0);
2330
- }
2331
- return i.on("openchange", b), () => {
2332
- i.off("openchange", b);
2333
- };
2334
- }, [c, i]), y.useEffect(() => {
2335
- if (!c || !h.current || !n)
2336
- return;
2337
- function b(I) {
2338
- A() && o(!1, I, "hover");
2339
- }
2340
- const v = he(l).documentElement;
2341
- return v.addEventListener("mouseleave", b), () => {
2342
- v.removeEventListener("mouseleave", b);
2343
- };
2344
- }, [l, n, o, c, h, A]);
2345
- const F = y.useCallback(function(b, v, I) {
2346
- v === void 0 && (v = !0), I === void 0 && (I = "hover");
2347
- const R = at(x.current, "close", B.current);
2348
- R && !k.current ? (clearTimeout(S.current), S.current = setTimeout(() => o(!1, b, I), R)) : v && (clearTimeout(S.current), o(!1, b, I));
2349
- }, [x, o]), L = y.useCallback(() => {
2350
- D.current(), k.current = void 0;
2351
- }, []), O = y.useCallback(() => {
2352
- if (T.current) {
2353
- const b = he(a.floating.current).body;
2354
- b.style.pointerEvents = "", b.removeAttribute(Yt), T.current = !1;
2355
- }
2356
- }, [a]);
2357
- return y.useEffect(() => {
2358
- if (!c)
2359
- return;
2360
- function b() {
2361
- return r.current.openEvent ? ["click", "mousedown"].includes(r.current.openEvent.type) : !1;
2362
- }
2363
- function v(w) {
2364
- if (clearTimeout(S.current), P.current = !1, f && !Ze(B.current) || d > 0 && at(x.current, "open") === 0)
2365
- return;
2366
- const z = at(x.current, "open", B.current);
2367
- z ? S.current = setTimeout(() => {
2368
- o(!0, w, "hover");
2369
- }, z) : o(!0, w, "hover");
2370
- }
2371
- function I(w) {
2372
- if (b())
2373
- return;
2374
- D.current();
2375
- const z = he(l);
2376
- if (clearTimeout(E.current), h.current) {
2377
- n || clearTimeout(S.current), k.current = h.current({
2378
- ...e,
2379
- tree: p,
2380
- x: w.clientX,
2381
- y: w.clientY,
2382
- onClose() {
2383
- O(), L(), F(w, !0, "safe-polygon");
2384
- }
2385
- });
2386
- const U = k.current;
2387
- z.addEventListener("mousemove", U), D.current = () => {
2388
- z.removeEventListener("mousemove", U);
2389
- };
2390
- return;
2391
- }
2392
- (B.current === "touch" ? !ve(l, w.relatedTarget) : !0) && F(w);
2393
- }
2394
- function R(w) {
2395
- b() || h.current == null || h.current({
2396
- ...e,
2397
- tree: p,
2398
- x: w.clientX,
2399
- y: w.clientY,
2400
- onClose() {
2401
- O(), L(), F(w);
2402
- }
2403
- })(w);
2404
- }
2405
- if (j(s)) {
2406
- const w = s;
2407
- return n && w.addEventListener("mouseleave", R), l == null || l.addEventListener("mouseleave", R), g && w.addEventListener("mousemove", v, {
2408
- once: !0
2409
- }), w.addEventListener("mouseenter", v), w.addEventListener("mouseleave", I), () => {
2410
- n && w.removeEventListener("mouseleave", R), l == null || l.removeEventListener("mouseleave", R), g && w.removeEventListener("mousemove", v), w.removeEventListener("mouseenter", v), w.removeEventListener("mouseleave", I);
2411
- };
2412
- }
2413
- }, [s, l, c, e, f, d, g, F, L, O, o, n, p, x, h, r]), ee(() => {
2414
- var b;
2415
- if (c && n && (b = h.current) != null && b.__options.blockPointerEvents && A()) {
2416
- const I = he(l).body;
2417
- if (I.setAttribute(Yt, ""), I.style.pointerEvents = "none", T.current = !0, j(s) && l) {
2418
- var v;
2419
- const R = s, w = p == null || (v = p.nodesRef.current.find((z) => z.id === $)) == null || (v = v.context) == null ? void 0 : v.elements.floating;
2420
- return w && (w.style.pointerEvents = ""), R.style.pointerEvents = "auto", l.style.pointerEvents = "auto", () => {
2421
- R.style.pointerEvents = "", l.style.pointerEvents = "";
2422
- };
2423
- }
2424
- }
2425
- }, [c, n, $, l, s, p, h, A]), ee(() => {
2426
- n || (B.current = void 0, L(), O());
2427
- }, [n, L, O]), y.useEffect(() => () => {
2428
- L(), clearTimeout(S.current), clearTimeout(E.current), O();
2429
- }, [c, s, L, O]), y.useMemo(() => {
2430
- if (!c)
2431
- return {};
2432
- function b(v) {
2433
- B.current = v.pointerType;
2434
- }
2435
- return {
2436
- reference: {
2437
- onPointerDown: b,
2438
- onPointerEnter: b,
2439
- onMouseMove(v) {
2440
- n || d === 0 || (clearTimeout(E.current), E.current = setTimeout(() => {
2441
- P.current || o(!0, v.nativeEvent, "hover");
2442
- }, d));
2443
- }
2444
- },
2445
- floating: {
2446
- onMouseEnter() {
2447
- clearTimeout(S.current);
2448
- },
2449
- onMouseLeave(v) {
2450
- F(v.nativeEvent, !1);
2451
- }
2452
- }
2453
- };
2454
- }, [c, d, n, o, F]);
2455
- }
2456
- function Ge(e, t) {
2457
- let n = e.filter((r) => {
2458
- var i;
2459
- return r.parentId === t && ((i = r.context) == null ? void 0 : i.open);
2460
- }), o = n;
2461
- for (; o.length; )
2462
- o = e.filter((r) => {
2463
- var i;
2464
- return (i = o) == null ? void 0 : i.some((s) => {
2465
- var l;
2466
- return r.parentId === s.id && ((l = r.context) == null ? void 0 : l.open);
2467
- });
2468
- }), n = n.concat(o);
2469
- return n;
2470
- }
2471
- const Pn = () => ({
2472
- getShadowRoot: !0,
2473
- displayCheck: (
2474
- // JSDOM does not support the `tabbable` library. To solve this we can
2475
- // check if `ResizeObserver` is a real function (not polyfilled), which
2476
- // determines if the current environment is JSDOM-like.
2477
- typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
2478
- )
2479
- });
2480
- function An(e, t) {
2481
- const n = Bn(e, Pn());
2482
- t === "prev" && n.reverse();
2483
- const o = n.indexOf(jo(he(e)));
2484
- return n.slice(o + 1)[0];
2485
- }
2486
- function ni() {
2487
- return An(document.body, "next");
2488
- }
2489
- function oi() {
2490
- return An(document.body, "prev");
2491
- }
2492
- function ct(e, t) {
2493
- const n = t || e.currentTarget, o = e.relatedTarget;
2494
- return !o || !ve(n, o);
2495
- }
2496
- function ri(e) {
2497
- Bn(e, Pn()).forEach((n) => {
2498
- n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
2499
- });
2500
- }
2501
- function ii(e) {
2502
- e.querySelectorAll("[data-tabindex]").forEach((n) => {
2503
- const o = n.dataset.tabindex;
2504
- delete n.dataset.tabindex, o ? n.setAttribute("tabindex", o) : n.removeAttribute("tabindex");
2505
- });
2506
- }
2507
- const On = {
2508
- border: 0,
2509
- clip: "rect(0 0 0 0)",
2510
- height: "1px",
2511
- margin: "-1px",
2512
- overflow: "hidden",
2513
- padding: 0,
2514
- position: "fixed",
2515
- whiteSpace: "nowrap",
2516
- width: "1px",
2517
- top: 0,
2518
- left: 0
2519
- };
2520
- let si;
2521
- function Xt(e) {
2522
- e.key === "Tab" && (e.target, clearTimeout(si));
2523
- }
2524
- const Kt = /* @__PURE__ */ y.forwardRef(function(t, n) {
2525
- const [o, r] = y.useState();
2526
- ee(() => (Ho() && r("button"), document.addEventListener("keydown", Xt), () => {
2527
- document.removeEventListener("keydown", Xt);
2528
- }), []);
2529
- const i = {
2530
- ref: n,
2531
- tabIndex: 0,
2532
- // Role is only for VoiceOver
2533
- role: o,
2534
- "aria-hidden": o ? void 0 : !0,
2535
- [rt("focus-guard")]: "",
2536
- style: On
2537
- };
2538
- return /* @__PURE__ */ y.createElement("span", pt({}, t, i));
2539
- }), Dn = /* @__PURE__ */ y.createContext(null), Gt = /* @__PURE__ */ rt("portal");
2540
- function li(e) {
2541
- let {
2542
- id: t,
2543
- root: n
2544
- } = e === void 0 ? {} : e;
2545
- const [o, r] = y.useState(null), i = St(), s = ci(), l = y.useRef(null);
2546
- return ee(() => () => {
2547
- o == null || o.remove(), queueMicrotask(() => {
2548
- l.current = null;
2549
- });
2550
- }, [o]), ee(() => {
2551
- if (l.current)
2552
- return;
2553
- const a = t ? document.getElementById(t) : null;
2554
- if (!a)
2555
- return;
2556
- const c = document.createElement("div");
2557
- c.id = i, c.setAttribute(Gt, ""), a.appendChild(c), l.current = c, r(c);
2558
- }, [t, i]), ee(() => {
2559
- if (l.current)
2560
- return;
2561
- let a = n || (s == null ? void 0 : s.portalNode);
2562
- a && !j(a) && (a = a.current), a = a || document.body;
2563
- let c = null;
2564
- t && (c = document.createElement("div"), c.id = t, a.appendChild(c));
2565
- const m = document.createElement("div");
2566
- m.id = i, m.setAttribute(Gt, ""), a = c || a, a.appendChild(m), l.current = m, r(m);
2567
- }, [t, n, i, s]), o;
2568
- }
2569
- function ai(e) {
2570
- let {
2571
- children: t,
2572
- id: n,
2573
- root: o = null,
2574
- preserveTabOrder: r = !0
2575
- } = e;
2576
- const i = li({
2577
- id: n,
2578
- root: o
2579
- }), [s, l] = y.useState(null), a = y.useRef(null), c = y.useRef(null), m = y.useRef(null), u = y.useRef(null), f = (
2580
- // The FocusManager and therefore floating element are currently open/
2581
- // rendered.
2582
- !!s && // Guards are only for non-modal focus management.
2583
- !s.modal && // Don't render if unmount is transitioning.
2584
- s.open && r && !!(o || i)
2585
- );
2586
- return y.useEffect(() => {
2587
- if (!i || !r || s != null && s.modal)
2588
- return;
2589
- function d(g) {
2590
- i && ct(g) && (g.type === "focusin" ? ii : ri)(i);
2591
- }
2592
- return i.addEventListener("focusin", d, !0), i.addEventListener("focusout", d, !0), () => {
2593
- i.removeEventListener("focusin", d, !0), i.removeEventListener("focusout", d, !0);
2594
- };
2595
- }, [i, r, s == null ? void 0 : s.modal]), /* @__PURE__ */ y.createElement(Dn.Provider, {
2596
- value: y.useMemo(() => ({
2597
- preserveTabOrder: r,
2598
- beforeOutsideRef: a,
2599
- afterOutsideRef: c,
2600
- beforeInsideRef: m,
2601
- afterInsideRef: u,
2602
- portalNode: i,
2603
- setFocusManagerState: l
2604
- }), [r, i])
2605
- }, f && i && /* @__PURE__ */ y.createElement(Kt, {
2606
- "data-type": "outside",
2607
- ref: a,
2608
- onFocus: (d) => {
2609
- if (ct(d, i)) {
2610
- var g;
2611
- (g = m.current) == null || g.focus();
2612
- } else {
2613
- const p = oi() || (s == null ? void 0 : s.refs.domReference.current);
2614
- p == null || p.focus();
2615
- }
2616
- }
2617
- }), f && i && /* @__PURE__ */ y.createElement("span", {
2618
- "aria-owns": i.id,
2619
- style: On
2620
- }), i && /* @__PURE__ */ _n(t, i), f && i && /* @__PURE__ */ y.createElement(Kt, {
2621
- "data-type": "outside",
2622
- ref: c,
2623
- onFocus: (d) => {
2624
- if (ct(d, i)) {
2625
- var g;
2626
- (g = u.current) == null || g.focus();
2627
- } else {
2628
- const p = ni() || (s == null ? void 0 : s.refs.domReference.current);
2629
- p == null || p.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, d.nativeEvent));
2630
- }
2631
- }
2632
- }));
2633
- }
2634
- const ci = () => y.useContext(Dn);
2635
- function Ut(e) {
2636
- return Z(e.target) && e.target.tagName === "BUTTON";
2637
- }
2638
- function qt(e) {
2639
- return Xo(e);
2640
- }
2641
- function ui(e, t) {
2642
- t === void 0 && (t = {});
2643
- const {
2644
- open: n,
2645
- onOpenChange: o,
2646
- dataRef: r,
2647
- elements: {
2648
- domReference: i
2649
- }
2650
- } = e, {
2651
- enabled: s = !0,
2652
- event: l = "click",
2653
- toggle: a = !0,
2654
- ignoreMouse: c = !1,
2655
- keyboardHandlers: m = !0
2656
- } = t, u = y.useRef(), f = y.useRef(!1);
2657
- return y.useMemo(() => s ? {
2658
- reference: {
2659
- onPointerDown(d) {
2660
- u.current = d.pointerType;
2661
- },
2662
- onMouseDown(d) {
2663
- d.button === 0 && (Ze(u.current, !0) && c || l !== "click" && (n && a && (!r.current.openEvent || r.current.openEvent.type === "mousedown") ? o(!1, d.nativeEvent, "click") : (d.preventDefault(), o(!0, d.nativeEvent, "click"))));
2664
- },
2665
- onClick(d) {
2666
- if (l === "mousedown" && u.current) {
2667
- u.current = void 0;
2668
- return;
2669
- }
2670
- Ze(u.current, !0) && c || (n && a && (!r.current.openEvent || r.current.openEvent.type === "click") ? o(!1, d.nativeEvent, "click") : o(!0, d.nativeEvent, "click"));
2671
- },
2672
- onKeyDown(d) {
2673
- u.current = void 0, !(d.defaultPrevented || !m || Ut(d)) && (d.key === " " && !qt(i) && (d.preventDefault(), f.current = !0), d.key === "Enter" && o(!(n && a), d.nativeEvent, "click"));
2674
- },
2675
- onKeyUp(d) {
2676
- d.defaultPrevented || !m || Ut(d) || qt(i) || d.key === " " && f.current && (f.current = !1, o(!(n && a), d.nativeEvent, "click"));
2677
- }
2678
- }
2679
- } : {}, [s, r, l, c, m, i, a, n, o]);
2680
- }
2681
- const di = {
2682
- pointerdown: "onPointerDown",
2683
- mousedown: "onMouseDown",
2684
- click: "onClick"
2685
- }, fi = {
2686
- pointerdown: "onPointerDownCapture",
2687
- mousedown: "onMouseDownCapture",
2688
- click: "onClickCapture"
2689
- }, Zt = (e) => {
2690
- var t, n;
2691
- return {
2692
- escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
2693
- outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
2694
- };
2695
- };
2696
- function mi(e, t) {
2697
- t === void 0 && (t = {});
2698
- const {
2699
- open: n,
2700
- onOpenChange: o,
2701
- nodeId: r,
2702
- elements: {
2703
- reference: i,
2704
- domReference: s,
2705
- floating: l
2706
- },
2707
- dataRef: a
2708
- } = e, {
2709
- enabled: c = !0,
2710
- escapeKey: m = !0,
2711
- outsidePress: u = !0,
2712
- outsidePressEvent: f = "pointerdown",
2713
- referencePress: d = !1,
2714
- referencePressEvent: g = "pointerdown",
2715
- ancestorScroll: p = !1,
2716
- bubbles: $,
2717
- capture: h
2718
- } = t, x = Ct(), B = Te(typeof u == "function" ? u : () => !1), S = typeof u == "function" ? B : u, k = y.useRef(!1), E = y.useRef(!1), {
2719
- escapeKey: P,
2720
- outsidePress: T
2721
- } = Zt($), {
2722
- escapeKey: D,
2723
- outsidePress: A
2724
- } = Zt(h), F = Te((v) => {
2725
- if (!n || !c || !m || v.key !== "Escape")
2726
- return;
2727
- const I = x ? Ge(x.nodesRef.current, r) : [];
2728
- if (!P && (v.stopPropagation(), I.length > 0)) {
2729
- let R = !0;
2730
- if (I.forEach((w) => {
2731
- var z;
2732
- if ((z = w.context) != null && z.open && !w.context.dataRef.current.__escapeKeyBubbles) {
2733
- R = !1;
2734
- return;
2735
- }
2736
- }), !R)
2737
- return;
2738
- }
2739
- o(!1, Vo(v) ? v.nativeEvent : v, "escape-key");
2740
- }), L = Te((v) => {
2741
- var I;
2742
- const R = () => {
2743
- var w;
2744
- F(v), (w = ke(v)) == null || w.removeEventListener("keydown", R);
2745
- };
2746
- (I = ke(v)) == null || I.addEventListener("keydown", R);
2747
- }), O = Te((v) => {
2748
- const I = k.current;
2749
- k.current = !1;
2750
- const R = E.current;
2751
- if (E.current = !1, f === "click" && R || I || typeof S == "function" && !S(v))
2752
- return;
2753
- const w = ke(v), z = "[" + rt("inert") + "]", K = he(l).querySelectorAll(z);
2754
- let U = j(w) ? w : null;
2755
- for (; U && !Ae(U); ) {
2756
- const V = xe(U);
2757
- if (Ae(V) || !j(V))
2758
- break;
2759
- U = V;
2760
- }
2761
- if (K.length && j(w) && !_o(w) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
2762
- !ve(w, l) && // If the target root element contains none of the markers, then the
2763
- // element was injected after the floating element rendered.
2764
- Array.from(K).every((V) => !ve(U, V)))
2765
- return;
2766
- if (Z(w) && l) {
2767
- const V = w.clientWidth > 0 && w.scrollWidth > w.clientWidth, G = w.clientHeight > 0 && w.scrollHeight > w.clientHeight;
2768
- let fe = G && v.offsetX > w.clientWidth;
2769
- if (G && J(w).direction === "rtl" && (fe = v.offsetX <= w.offsetWidth - w.clientWidth), fe || V && v.offsetY > w.clientHeight)
2770
- return;
2771
- }
2772
- const we = x && Ge(x.nodesRef.current, r).some((V) => {
2773
- var G;
2774
- return st(v, (G = V.context) == null ? void 0 : G.elements.floating);
2775
- });
2776
- if (st(v, l) || st(v, s) || we)
2777
- return;
2778
- const de = x ? Ge(x.nodesRef.current, r) : [];
2779
- if (de.length > 0) {
2780
- let V = !0;
2781
- if (de.forEach((G) => {
2782
- var fe;
2783
- if ((fe = G.context) != null && fe.open && !G.context.dataRef.current.__outsidePressBubbles) {
2784
- V = !1;
2785
- return;
2786
- }
2787
- }), !V)
2788
- return;
2789
- }
2790
- o(!1, v, "outside-press");
2791
- }), b = Te((v) => {
2792
- var I;
2793
- const R = () => {
2794
- var w;
2795
- O(v), (w = ke(v)) == null || w.removeEventListener(f, R);
2796
- };
2797
- (I = ke(v)) == null || I.addEventListener(f, R);
2798
- });
2799
- return y.useEffect(() => {
2800
- if (!n || !c)
2801
- return;
2802
- a.current.__escapeKeyBubbles = P, a.current.__outsidePressBubbles = T;
2803
- function v(w) {
2804
- o(!1, w, "ancestor-scroll");
2805
- }
2806
- const I = he(l);
2807
- m && I.addEventListener("keydown", D ? L : F, D), S && I.addEventListener(f, A ? b : O, A);
2808
- let R = [];
2809
- return p && (j(s) && (R = le(s)), j(l) && (R = R.concat(le(l))), !j(i) && i && i.contextElement && (R = R.concat(le(i.contextElement)))), R = R.filter((w) => {
2810
- var z;
2811
- return w !== ((z = I.defaultView) == null ? void 0 : z.visualViewport);
2812
- }), R.forEach((w) => {
2813
- w.addEventListener("scroll", v, {
2814
- passive: !0
2815
- });
2816
- }), () => {
2817
- m && I.removeEventListener("keydown", D ? L : F, D), S && I.removeEventListener(f, A ? b : O, A), R.forEach((w) => {
2818
- w.removeEventListener("scroll", v);
2819
- });
2820
- };
2821
- }, [a, l, s, i, m, S, f, n, o, p, c, P, T, F, D, L, O, A, b]), y.useEffect(() => {
2822
- k.current = !1;
2823
- }, [S, f]), y.useMemo(() => c ? {
2824
- reference: {
2825
- onKeyDown: F,
2826
- [di[g]]: (v) => {
2827
- d && o(!1, v.nativeEvent, "reference-press");
2828
- }
2829
- },
2830
- floating: {
2831
- onKeyDown: F,
2832
- onMouseDown() {
2833
- E.current = !0;
2834
- },
2835
- onMouseUp() {
2836
- E.current = !0;
2837
- },
2838
- [fi[f]]: () => {
2839
- k.current = !0;
2840
- }
2841
- }
2842
- } : {}, [c, d, f, g, o, F]);
2843
- }
2844
- let ht;
2845
- process.env.NODE_ENV !== "production" && (ht = /* @__PURE__ */ new Set());
2846
- function gi(e) {
2847
- var t;
2848
- e === void 0 && (e = {});
2849
- const {
2850
- open: n = !1,
2851
- onOpenChange: o,
2852
- nodeId: r
2853
- } = e;
2854
- if (process.env.NODE_ENV !== "production") {
2855
- var i;
2856
- const T = "Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";
2857
- if ((i = e.elements) != null && i.reference && !j(e.elements.reference)) {
2858
- var s;
2859
- if (!((s = ht) != null && s.has(T))) {
2860
- var l;
2861
- (l = ht) == null || l.add(T), console.error(T);
2862
- }
2863
- }
2864
- }
2865
- const [a, c] = y.useState(null), m = ((t = e.elements) == null ? void 0 : t.reference) || a, u = Tr(e), f = Ct(), d = Rt() != null, g = Te((T, D, A) => {
2866
- T && ($.current.openEvent = D), h.emit("openchange", {
2867
- open: T,
2868
- event: D,
2869
- reason: A,
2870
- nested: d
2871
- }), o == null || o(T, D, A);
2872
- }), p = y.useRef(null), $ = y.useRef({}), h = y.useState(() => Jr())[0], x = St(), B = y.useCallback((T) => {
2873
- const D = j(T) ? {
2874
- getBoundingClientRect: () => T.getBoundingClientRect(),
2875
- contextElement: T
2876
- } : T;
2877
- u.refs.setReference(D);
2878
- }, [u.refs]), S = y.useCallback((T) => {
2879
- (j(T) || T === null) && (p.current = T, c(T)), (j(u.refs.reference.current) || u.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2880
- // `null` to support `positionReference` + an unstable `reference`
2881
- // callback ref.
2882
- T !== null && !j(T)) && u.refs.setReference(T);
2883
- }, [u.refs]), k = y.useMemo(() => ({
2884
- ...u.refs,
2885
- setReference: S,
2886
- setPositionReference: B,
2887
- domReference: p
2888
- }), [u.refs, S, B]), E = y.useMemo(() => ({
2889
- ...u.elements,
2890
- domReference: m
2891
- }), [u.elements, m]), P = y.useMemo(() => ({
2892
- ...u,
2893
- refs: k,
2894
- elements: E,
2895
- dataRef: $,
2896
- nodeId: r,
2897
- floatingId: x,
2898
- events: h,
2899
- open: n,
2900
- onOpenChange: g
2901
- }), [u, r, x, h, n, g, k, E]);
2902
- return ee(() => {
2903
- const T = f == null ? void 0 : f.nodesRef.current.find((D) => D.id === r);
2904
- T && (T.context = P);
2905
- }), y.useMemo(() => ({
2906
- ...u,
2907
- context: P,
2908
- refs: k,
2909
- elements: E
2910
- }), [u, k, E, P]);
2911
- }
2912
- const Jt = "active", Qt = "selected";
2913
- function ut(e, t, n) {
2914
- const o = /* @__PURE__ */ new Map(), r = n === "item";
2915
- let i = e;
2916
- if (r && e) {
2917
- const {
2918
- [Jt]: s,
2919
- [Qt]: l,
2920
- ...a
2921
- } = e;
2922
- i = a;
2923
- }
2924
- return {
2925
- ...n === "floating" && {
2926
- tabIndex: -1
2927
- },
2928
- ...i,
2929
- ...t.map((s) => {
2930
- const l = s ? s[n] : null;
2931
- return typeof l == "function" ? e ? l(e) : null : l;
2932
- }).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
2933
- let [c, m] = a;
2934
- if (!(r && [Jt, Qt].includes(c)))
2935
- if (c.indexOf("on") === 0) {
2936
- if (o.has(c) || o.set(c, []), typeof m == "function") {
2937
- var u;
2938
- (u = o.get(c)) == null || u.push(m), s[c] = function() {
2939
- for (var f, d = arguments.length, g = new Array(d), p = 0; p < d; p++)
2940
- g[p] = arguments[p];
2941
- return (f = o.get(c)) == null ? void 0 : f.map(($) => $(...g)).find(($) => $ !== void 0);
2942
- };
2943
- }
2944
- } else
2945
- s[c] = m;
2946
- }), s), {})
2947
- };
2948
- }
2949
- function pi(e) {
2950
- e === void 0 && (e = []);
2951
- const t = e, n = y.useCallback((i) => ut(i, e, "reference"), t), o = y.useCallback((i) => ut(i, e, "floating"), t), r = y.useCallback(
2952
- (i) => ut(i, e, "item"),
2953
- // Granularly check for `item` changes, because the `getItemProps` getter
2954
- // should be as referentially stable as possible since it may be passed as
2955
- // a prop to many components. All `item` key values must therefore be
2956
- // memoized.
2957
- e.map((i) => i == null ? void 0 : i.item)
2958
- );
2959
- return y.useMemo(() => ({
2960
- getReferenceProps: n,
2961
- getFloatingProps: o,
2962
- getItemProps: r
2963
- }), [n, o, r]);
2964
- }
2965
- const hi = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
2966
- function bi(e, t) {
2967
- var n;
2968
- t === void 0 && (t = {});
2969
- const {
2970
- open: o,
2971
- floatingId: r
2972
- } = e, {
2973
- enabled: i = !0,
2974
- role: s = "dialog"
2975
- } = t, l = (n = hi.get(s)) != null ? n : s, a = St(), m = Rt() != null;
2976
- return y.useMemo(() => {
2977
- if (!i)
2978
- return {};
2979
- const u = {
2980
- id: r,
2981
- ...l && {
2982
- role: l
2983
- }
2984
- };
2985
- return l === "tooltip" || s === "label" ? {
2986
- reference: {
2987
- ["aria-" + (s === "label" ? "labelledby" : "describedby")]: o ? r : void 0
2988
- },
2989
- floating: u
2990
- } : {
2991
- reference: {
2992
- "aria-expanded": o ? "true" : "false",
2993
- "aria-haspopup": l === "alertdialog" ? "dialog" : l,
2994
- "aria-controls": o ? r : void 0,
2995
- ...l === "listbox" && {
2996
- role: "combobox"
2997
- },
2998
- ...l === "menu" && {
2999
- id: a
3000
- },
3001
- ...l === "menu" && m && {
3002
- role: "menuitem"
3003
- },
3004
- ...s === "select" && {
3005
- "aria-autocomplete": "none"
3006
- },
3007
- ...s === "combobox" && {
3008
- "aria-autocomplete": "list"
3009
- }
3010
- },
3011
- floating: {
3012
- ...u,
3013
- ...l === "menu" && {
3014
- "aria-labelledby": a
3015
- }
3016
- },
3017
- item(f) {
3018
- let {
3019
- active: d,
3020
- selected: g
3021
- } = f;
3022
- const p = {
3023
- role: "option",
3024
- ...d && {
3025
- id: r + "-option"
3026
- }
3027
- };
3028
- switch (s) {
3029
- case "select":
3030
- return {
3031
- ...p,
3032
- "aria-selected": d && g
3033
- };
3034
- case "combobox":
3035
- return {
3036
- ...p,
3037
- ...d && {
3038
- "aria-selected": !0
3039
- }
3040
- };
3041
- }
3042
- return {};
3043
- }
3044
- };
3045
- }, [i, s, l, o, r, a, m]);
3046
- }
3047
- const en = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, n) => (n ? "-" : "") + t.toLowerCase());
3048
- function Ee(e, t) {
3049
- return typeof e == "function" ? e(t) : e;
3050
- }
3051
- function yi(e, t) {
3052
- const [n, o] = y.useState(e);
3053
- return e && !n && o(!0), y.useEffect(() => {
3054
- if (!e) {
3055
- const r = setTimeout(() => o(!1), t);
3056
- return () => clearTimeout(r);
3057
- }
3058
- }, [e, t]), n;
3059
- }
3060
- function vi(e, t) {
3061
- t === void 0 && (t = {});
3062
- const {
3063
- open: n,
3064
- elements: {
3065
- floating: o
3066
- }
3067
- } = e, {
3068
- duration: r = 250
3069
- } = t, s = (typeof r == "number" ? r : r.close) || 0, [l, a] = y.useState(!1), [c, m] = y.useState("unmounted"), u = yi(n, s);
3070
- return ee(() => {
3071
- l && !u && m("unmounted");
3072
- }, [l, u]), ee(() => {
3073
- if (o) {
3074
- if (n) {
3075
- m("initial");
3076
- const f = requestAnimationFrame(() => {
3077
- m("open");
3078
- });
3079
- return () => {
3080
- cancelAnimationFrame(f);
3081
- };
3082
- }
3083
- a(!0), m("close");
3084
- }
3085
- }, [n, o]), {
3086
- isMounted: u,
3087
- status: c
3088
- };
3089
- }
3090
- function xi(e, t) {
3091
- t === void 0 && (t = {});
3092
- const {
3093
- initial: n = {
3094
- opacity: 0
3095
- },
3096
- open: o,
3097
- close: r,
3098
- common: i,
3099
- duration: s = 250
3100
- } = t, l = e.placement, a = l.split("-")[0], c = y.useMemo(() => ({
3101
- side: a,
3102
- placement: l
3103
- }), [a, l]), m = typeof s == "number", u = (m ? s : s.open) || 0, f = (m ? s : s.close) || 0, [d, g] = y.useState(() => ({
3104
- ...Ee(i, c),
3105
- ...Ee(n, c)
3106
- })), {
3107
- isMounted: p,
3108
- status: $
3109
- } = vi(e, {
3110
- duration: s
3111
- }), h = Be(n), x = Be(o), B = Be(r), S = Be(i);
3112
- return ee(() => {
3113
- const k = Ee(h.current, c), E = Ee(B.current, c), P = Ee(S.current, c), T = Ee(x.current, c) || Object.keys(k).reduce((D, A) => (D[A] = "", D), {});
3114
- if ($ === "initial" && g((D) => ({
3115
- transitionProperty: D.transitionProperty,
3116
- ...P,
3117
- ...k
3118
- })), $ === "open" && g({
3119
- transitionProperty: Object.keys(T).map(en).join(","),
3120
- transitionDuration: u + "ms",
3121
- ...P,
3122
- ...T
3123
- }), $ === "close") {
3124
- const D = E || k;
3125
- g({
3126
- transitionProperty: Object.keys(D).map(en).join(","),
3127
- transitionDuration: f + "ms",
3128
- ...P,
3129
- ...D
3130
- });
3131
- }
3132
- }, [f, B, h, x, S, u, $, c]), {
3133
- isMounted: p,
3134
- styles: d
3135
- };
3136
- }
3137
- function tn(e, t) {
3138
- const [n, o] = e;
3139
- let r = !1;
3140
- const i = t.length;
3141
- for (let s = 0, l = i - 1; s < i; l = s++) {
3142
- const [a, c] = t[s] || [0, 0], [m, u] = t[l] || [0, 0];
3143
- c >= o != u >= o && n <= (m - a) * (o - c) / (u - c) + a && (r = !r);
3144
- }
3145
- return r;
3146
- }
3147
- function $i(e, t) {
3148
- return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
3149
- }
3150
- function wi(e) {
3151
- e === void 0 && (e = {});
3152
- const {
3153
- buffer: t = 0.5,
3154
- blockPointerEvents: n = !1,
3155
- requireIntent: o = !0
3156
- } = e;
3157
- let r, i = !1, s = null, l = null, a = performance.now();
3158
- function c(u, f) {
3159
- const d = performance.now(), g = d - a;
3160
- if (s === null || l === null || g === 0)
3161
- return s = u, l = f, a = d, null;
3162
- const p = u - s, $ = f - l, x = Math.sqrt(p * p + $ * $) / g;
3163
- return s = u, l = f, a = d, x;
3164
- }
3165
- const m = (u) => {
3166
- let {
3167
- x: f,
3168
- y: d,
3169
- placement: g,
3170
- elements: p,
3171
- onClose: $,
3172
- nodeId: h,
3173
- tree: x
3174
- } = u;
3175
- return function(S) {
3176
- function k() {
3177
- clearTimeout(r), $();
3178
- }
3179
- if (clearTimeout(r), !p.domReference || !p.floating || g == null || f == null || d == null)
3180
- return;
3181
- const {
3182
- clientX: E,
3183
- clientY: P
3184
- } = S, T = [E, P], D = ke(S), A = S.type === "mouseleave", F = ve(p.floating, D), L = ve(p.domReference, D), O = p.domReference.getBoundingClientRect(), b = p.floating.getBoundingClientRect(), v = g.split("-")[0], I = f > b.right - b.width / 2, R = d > b.bottom - b.height / 2, w = $i(T, O), z = b.width > O.width, K = b.height > O.height, U = (z ? O : b).left, we = (z ? O : b).right, de = (K ? O : b).top, V = (K ? O : b).bottom;
3185
- if (F && (i = !0, !A))
3186
- return;
3187
- if (L && (i = !1), L && !A) {
3188
- i = !0;
3189
- return;
3190
- }
3191
- if (A && j(S.relatedTarget) && ve(p.floating, S.relatedTarget) || x && Ge(x.nodesRef.current, h).some((me) => {
3192
- let {
3193
- context: H
3194
- } = me;
3195
- return H == null ? void 0 : H.open;
3196
- }))
3197
- return;
3198
- if (v === "top" && d >= O.bottom - 1 || v === "bottom" && d <= O.top + 1 || v === "left" && f >= O.right - 1 || v === "right" && f <= O.left + 1)
3199
- return k();
3200
- let G = [];
3201
- switch (v) {
3202
- case "top":
3203
- G = [[U, O.top + 1], [U, b.bottom - 1], [we, b.bottom - 1], [we, O.top + 1]];
3204
- break;
3205
- case "bottom":
3206
- G = [[U, b.top + 1], [U, O.bottom - 1], [we, O.bottom - 1], [we, b.top + 1]];
3207
- break;
3208
- case "left":
3209
- G = [[b.right - 1, V], [b.right - 1, de], [O.left + 1, de], [O.left + 1, V]];
3210
- break;
3211
- case "right":
3212
- G = [[O.right - 1, V], [O.right - 1, de], [b.left + 1, de], [b.left + 1, V]];
3213
- break;
3214
- }
3215
- function fe(me) {
3216
- let [H, _] = me;
3217
- switch (v) {
3218
- case "top": {
3219
- const ge = [z ? H + t / 2 : I ? H + t * 4 : H - t * 4, _ + t + 1], pe = [z ? H - t / 2 : I ? H + t * 4 : H - t * 4, _ + t + 1], Se = [[b.left, I || z ? b.bottom - t : b.top], [b.right, I ? z ? b.bottom - t : b.top : b.bottom - t]];
3220
- return [ge, pe, ...Se];
3221
- }
3222
- case "bottom": {
3223
- const ge = [z ? H + t / 2 : I ? H + t * 4 : H - t * 4, _ - t], pe = [z ? H - t / 2 : I ? H + t * 4 : H - t * 4, _ - t], Se = [[b.left, I || z ? b.top + t : b.bottom], [b.right, I ? z ? b.top + t : b.bottom : b.top + t]];
3224
- return [ge, pe, ...Se];
3225
- }
3226
- case "left": {
3227
- const ge = [H + t + 1, K ? _ + t / 2 : R ? _ + t * 4 : _ - t * 4], pe = [H + t + 1, K ? _ - t / 2 : R ? _ + t * 4 : _ - t * 4];
3228
- return [...[[R || K ? b.right - t : b.left, b.top], [R ? K ? b.right - t : b.left : b.right - t, b.bottom]], ge, pe];
3229
- }
3230
- case "right": {
3231
- const ge = [H - t, K ? _ + t / 2 : R ? _ + t * 4 : _ - t * 4], pe = [H - t, K ? _ - t / 2 : R ? _ + t * 4 : _ - t * 4], Se = [[R || K ? b.left + t : b.right, b.top], [R ? K ? b.left + t : b.right : b.left + t, b.bottom]];
3232
- return [ge, pe, ...Se];
3233
- }
3234
- }
3235
- }
3236
- if (!tn([E, P], G)) {
3237
- if (i && !w)
3238
- return k();
3239
- if (!A && o) {
3240
- const me = c(S.clientX, S.clientY);
3241
- if (me !== null && me < 0.1)
3242
- return k();
3243
- }
3244
- tn([E, P], fe([f, d])) ? !i && o && (r = window.setTimeout(k, 40)) : k();
3245
- }
3246
- };
3247
- };
3248
- return m.__options = {
3249
- blockPointerEvents: n
3250
- }, m;
3251
- }
3252
- const Q = W("div"), Et = Nn(
3253
- {}
3254
- ), Zi = ({
3255
- children: e,
3256
- offset: t,
3257
- open: n,
3258
- onOpenChange: o,
3259
- trigger: r = "click",
3260
- hoverDelay: i,
3261
- placement: s = "bottom",
3262
- role: l = "dialog"
3263
- }) => {
3264
- const { refs: a, floatingStyles: c, context: m } = gi({
3265
- open: n,
3266
- onOpenChange: o,
3267
- placement: s,
3268
- whileElementsMounted: Rr,
3269
- middleware: [ir(t), Er(), Cr()]
3270
- }), { isMounted: u, styles: f } = xi(m, {
3271
- initial: ({ side: S }) => ({
3272
- opacity: 0,
3273
- transform: {
3274
- top: "translateY(-0.5rem)",
3275
- right: "translateX(0.5rem)",
3276
- bottom: "translateY(0.5rem)",
3277
- left: "translateX(-0.5rem)"
3278
- }[S]
3279
- })
3280
- }), d = ui(m, { enabled: r === "click" }), g = ti(m, {
3281
- enabled: r === "hover",
3282
- delay: i,
3283
- handleClose: wi()
3284
- }), p = mi(m), $ = bi(m, { role: l }), { getFloatingProps: h, getReferenceProps: x } = pi([
3285
- d,
3286
- g,
3287
- p,
3288
- $
3289
- ]), B = qe(
3290
- () => ({
3291
- getFloatingProps: h,
3292
- getReferenceProps: x,
3293
- floatingStyles: c,
3294
- refs: a,
3295
- isMounted: u,
3296
- transitionStyles: f
3297
- }),
3298
- [
3299
- h,
3300
- x,
3301
- u,
3302
- a,
3303
- c,
3304
- f
3305
- ]
3306
- );
3307
- return /* @__PURE__ */ M(Et.Provider, { value: B, children: e });
3308
- }, Ji = ({ children: e }) => {
3309
- const { getReferenceProps: t, refs: n } = sn(Et);
3310
- return /* @__PURE__ */ M(zn, { children: jn(e) && Hn(e, {
3311
- ref: n.setReference,
3312
- ...t()
3313
- }) });
3314
- }, Qi = ({ children: e, overlayCardProps: t }) => {
3315
- const {
3316
- getFloatingProps: n,
3317
- isMounted: o,
3318
- refs: r,
3319
- floatingStyles: i,
3320
- transitionStyles: s
3321
- } = sn(Et);
3322
- return o ? /* @__PURE__ */ M(ai, { children: /* @__PURE__ */ M(
3323
- Q,
3324
- {
3325
- ref: r.setFloating,
3326
- style: i,
3327
- ...n(),
3328
- css: {
3329
- zIndex: "$overlayCard"
3330
- },
3331
- children: /* @__PURE__ */ M(dn, { ...t, style: s, children: e })
3332
- }
3333
- ) }) : null;
3334
- }, es = W("span", {
3335
- flex: "0 0 auto",
3336
- display: "inline-flex",
3337
- padding: "$1 $2",
3338
- fontSize: "$xs",
3339
- fontWeight: "$medium",
3340
- lineHeight: "1",
3341
- whiteSpace: "nowrap",
3342
- borderRadius: "$sm",
3343
- overflow: "hidden",
3344
- variants: {
3345
- color: {
3346
- success: {
3347
- backgroundColor: "$green200",
3348
- color: "$green800"
3349
- },
3350
- warning: {
3351
- backgroundColor: "$yellow100",
3352
- color: "$yellow700"
3353
- },
3354
- danger: {
3355
- backgroundColor: "$red200",
3356
- color: "$red800"
3357
- },
3358
- primary: {
3359
- backgroundColor: "$blue200",
3360
- color: "$blue800"
3361
- },
3362
- secondary: {
3363
- backgroundColor: "$gray200",
3364
- color: "$gray800"
3365
- }
3366
- }
3367
- },
3368
- defaultVariants: {
3369
- color: "primary"
3370
- }
3371
- }), ts = W(He.Root, {
3372
- backgroundColor: "$gray50",
3373
- display: "flex",
3374
- alignItems: "center",
3375
- padding: "$1",
3376
- gap: "$1"
3377
- }), ns = W(He.ToggleGroup, {
3378
- display: "flex",
3379
- gap: "$1",
3380
- alignItems: "center"
3381
- }), os = W(He.Separator, {
3382
- width: "1px",
3383
- height: "1.5rem",
3384
- my: "$1",
3385
- mx: "$1",
3386
- backgroundColor: "$border"
3387
- }), Mn = ue(({ css: e, ...t }, n) => /* @__PURE__ */ M(
3388
- un,
3389
- {
3390
- ref: n,
3391
- icon: !0,
3392
- css: {
3393
- width: "auto",
3394
- "&[data-state='on']": {
3395
- backgroundColor: "$blue200",
3396
- color: "$blue800"
3397
- },
3398
- ...e
3399
- },
3400
- ...t
3401
- }
3402
- )), rs = ue(
3403
- ({ children: e, dropdown: t, ...n }, o) => /* @__PURE__ */ M(
3404
- He.Button,
3405
- {
3406
- asChild: !0,
3407
- ref: o,
3408
- children: /* @__PURE__ */ te(
3409
- Mn,
3410
- {
3411
- variant: "transparent",
3412
- color: "primary",
3413
- ...n,
3414
- children: [
3415
- e,
3416
- t && /* @__PURE__ */ M(Yn, {})
3417
- ]
3418
- }
3419
- )
3420
- }
3421
- )
3422
- ), is = ue(({
3423
- children: e,
3424
- value: t,
3425
- ...n
3426
- }, o) => /* @__PURE__ */ M(
3427
- He.ToggleItem,
3428
- {
3429
- value: t,
3430
- asChild: !0,
3431
- ref: o,
3432
- children: /* @__PURE__ */ M(
3433
- Mn,
3434
- {
3435
- variant: "transparent",
3436
- color: "primary",
3437
- icon: !0,
3438
- ...n,
3439
- children: e
3440
- }
3441
- )
3442
- }
3443
- )), ss = W("div", {
3444
- color: "$$cardText",
3445
- backgroundColor: "$$cardBackground",
3446
- borderRadius: "$md",
3447
- padding: "$4",
3448
- variants: {
3449
- variant: {
3450
- primary: {
3451
- $$cardBackground: "white",
3452
- $$cardText: "$text"
3453
- }
3454
- },
3455
- elevation: {
3456
- none: {
3457
- boxShadow: "none"
3458
- },
3459
- raised: {
3460
- boxShadow: "$md"
3461
- }
3462
- }
3463
- },
3464
- defaultVariants: {
3465
- variant: "primary",
3466
- elevation: "raised"
3467
- }
3468
- }), Si = W("div", {
3469
- borderRadius: "$md",
3470
- padding: "$1",
3471
- border: "2px solid $blue100",
3472
- background: "white",
3473
- display: "flex",
3474
- alignItems: "center",
3475
- gap: "$1"
3476
- }), ls = (e) => /* @__PURE__ */ M(Si, { ...e }), as = ({
3477
- children: e,
3478
- active: t = !1,
3479
- ...n
3480
- }) => /* @__PURE__ */ M(
3481
- un,
3482
- {
3483
- variant: "transparent",
3484
- color: "primary",
3485
- "data-active": t,
3486
- css: {
3487
- '&[aria-current="page"],&[data-active="true"]': {
3488
- background: "$blue100"
3489
- }
3490
- },
3491
- ...n,
3492
- children: e
3493
- }
3494
- ), Ri = W(Ne.Overlay, {
3495
- backgroundColor: "rgba(0, 0, 0, 0.7)",
3496
- position: "fixed",
3497
- zIndex: "$overlayCard",
3498
- inset: 0
3499
- }), Ci = W(Ne.Content, {
3500
- backgroundColor: "white",
3501
- borderRadius: "$md",
3502
- position: "fixed",
3503
- zIndex: "$overlayCard",
3504
- top: "50%",
3505
- left: "50%",
3506
- transform: "translate(-50%, -50%)",
3507
- width: "auto",
3508
- maxWidth: "90wv",
3509
- minWidth: "600px",
3510
- maxHeight: "85vh",
3511
- padding: "$8",
3512
- "&:focus": { outline: "none" }
3513
- }), cs = ({
3514
- children: e,
3515
- open: t,
3516
- onOpenChange: n,
3517
- trigger: o,
3518
- css: r,
3519
- contentProps: i
3520
- }) => /* @__PURE__ */ te(Ne.Root, { open: t, onOpenChange: n, children: [
3521
- o && /* @__PURE__ */ M(Ne.Trigger, { asChild: !0, children: o }),
3522
- /* @__PURE__ */ te(Ne.Portal, { children: [
3523
- /* @__PURE__ */ M(Ri, {}),
3524
- /* @__PURE__ */ M(Ci, { css: r, ...i, children: e })
3525
- ] })
3526
- ] }), us = W("h2", {
3527
- fontSize: "$xl",
3528
- fontWeight: "$medium",
3529
- marginBottom: "$6"
3530
- }), ds = W("div", {
3531
- display: "flex",
3532
- gap: "$2",
3533
- justifyContent: "flex-end",
3534
- background: "$gray100",
3535
- margin: "$6 -$8 -$8 -$8",
3536
- padding: "$4",
3537
- borderBottomRightRadius: "$md",
3538
- borderBottomLeftRadius: "$md"
3539
- }), fs = W("div", {
3540
- display: "flex",
3541
- variants: {
3542
- direction: {
3543
- row: {
3544
- flexDirection: "row"
3545
- },
3546
- column: {
3547
- flexDirection: "column"
3548
- }
3549
- },
3550
- align: {
3551
- start: {
3552
- alignItems: "flex-start"
3553
- },
3554
- center: {
3555
- alignItems: "center"
3556
- }
3557
- },
3558
- gap: {
3559
- 0: { gap: 0 },
3560
- 1: { gap: "$1" },
3561
- 2: { gap: "$2" },
3562
- 3: { gap: "$3" },
3563
- 4: { gap: "$4" },
3564
- 5: { gap: "$5" },
3565
- 6: { gap: "$6" },
3566
- 7: { gap: "$7" },
3567
- 8: { gap: "$8" }
3568
- }
3569
- },
3570
- defaultVariants: {
3571
- direction: "column",
3572
- gap: 4
3573
- }
3574
- }), nn = /* @__PURE__ */ new Map(), Ei = (e) => {
3575
- const t = nn.get(e);
3576
- if (t)
3577
- return t;
3578
- let n = 0;
3579
- for (let l = 0; l < e.length; l++)
3580
- n = e.charCodeAt(l) + ((n << 5) - n);
3581
- const s = `hsl(${n % 360}, 80%, 40%)`;
3582
- return nn.set(e, s), s;
3583
- }, ki = W("div", {
3584
- flex: "0 0 auto",
3585
- display: "inline-flex",
3586
- alignItems: "center",
3587
- justifyContent: "center",
3588
- color: "white",
3589
- borderRadius: "$full",
3590
- transition: "background-color 150ms",
3591
- userSelect: "none",
3592
- variants: {
3593
- size: {
3594
- xs: {
3595
- fontSize: "0.6rem",
3596
- width: "1.50rem",
3597
- height: "1.50rem"
3598
- },
3599
- sm: {
3600
- fontSize: "0.8rem",
3601
- width: "1.75rem",
3602
- height: "1.75rem"
3603
- },
3604
- md: {
3605
- fontSize: "0.9rem",
3606
- width: "2rem",
3607
- height: "2rem"
3608
- }
3609
- }
3610
- },
3611
- defaultVariants: {
3612
- size: "md"
3613
- }
3614
- }), ms = ({
3615
- css: e,
3616
- colorString: t,
3617
- ...n
3618
- }) => {
3619
- const o = qe(
3620
- () => t ? Ei(t) : "$gray200",
3621
- [t]
3622
- );
3623
- return /* @__PURE__ */ M(ki, { css: { backgroundColor: o, ...e }, ...n });
3624
- }, Ti = W(dn, {
3625
- minWidth: "max(var(--radix-popper-anchor-width), 12rem)",
3626
- padding: "$1"
3627
- }), kt = Ve({
3628
- padding: "$2 $2 $2 1.5rem",
3629
- fontSize: "$sm",
3630
- lineHeight: "1.25",
3631
- cursor: "pointer",
3632
- borderRadius: "$sm",
3633
- position: "relative",
3634
- color: "$primaryTextOnWhite",
3635
- display: "flex",
3636
- alignItems: "center",
3637
- ":focus-visisble": {
3638
- outline: "none"
3639
- },
3640
- "&[data-highlighted], &:hover": {
3641
- outline: "none",
3642
- backgroundColor: "$hoverDarker"
3643
- },
3644
- "&[data-disabled]": {
3645
- color: "$gray500",
3646
- "&:hover": {
3647
- backgroundColor: "transparent"
3648
- }
3649
- }
3650
- }), gs = ({
3651
- side: e = "bottom",
3652
- align: t = "center",
3653
- trigger: n,
3654
- children: o,
3655
- sideOffset: r,
3656
- modal: i
3657
- }) => /* @__PURE__ */ te(oe.Root, { modal: i, children: [
3658
- /* @__PURE__ */ M(oe.Trigger, { asChild: !0, children: n }),
3659
- /* @__PURE__ */ M(oe.Portal, { children: /* @__PURE__ */ M(
3660
- oe.Content,
3661
- {
3662
- asChild: !0,
3663
- side: e,
3664
- align: t,
3665
- collisionPadding: 10,
3666
- sideOffset: r,
3667
- children: /* @__PURE__ */ M(Ti, { children: o })
3668
- }
3669
- ) })
3670
- ] }), Ii = W(oe.ItemIndicator, {
3671
- position: "absolute",
3672
- left: 0,
3673
- top: 0,
3674
- bottom: 0,
3675
- width: "1.5rem",
3676
- display: "flex",
3677
- justifyContent: "center",
3678
- alignItems: "center"
3679
- }), ps = W(oe.Separator, {
3680
- height: 1,
3681
- backgroundColor: "$gray200",
3682
- margin: 1
3683
- }), hs = W(oe.Item, kt), bs = W(oe.Item, kt, {
3684
- padding: "$2",
3685
- display: "flex",
3686
- alignItems: "center",
3687
- gap: "$2"
3688
- }), Bi = W(oe.CheckboxItem, kt), ys = ({
3689
- value: e,
3690
- onChange: t,
3691
- children: n
3692
- }) => /* @__PURE__ */ te(
3693
- Bi,
3694
- {
3695
- checked: e,
3696
- onCheckedChange: t,
3697
- children: [
3698
- /* @__PURE__ */ M(Ii, { children: /* @__PURE__ */ M(Xn, { size: "0.75rem" }) }),
3699
- n
3700
- ]
3701
- }
3702
- ), Ue = {
3703
- container: (e) => ({
3704
- ...e,
3705
- minWidth: "200px"
3706
- }),
3707
- control: (e, { isFocused: t }) => ({
3708
- ...e,
3709
- "&:hover": {},
3710
- border: t ? "1px solid var(--colors-blue300)" : "1px solid var(--colors-gray300)",
3711
- outline: "none",
3712
- borderRadius: "var(--radii-md)",
3713
- boxShadow: t ? "0 0 0 4px var(--colors-blue100)" : "none"
3714
- }),
3715
- menu: (e) => ({
3716
- ...e,
3717
- boxShadow: "var(--shadows-overlayCard)",
3718
- borderRadius: "var(--radii-md)",
3719
- border: "none",
3720
- padding: "var(--space-1)"
3721
- }),
3722
- option: (e, { isFocused: t, isSelected: n }) => ({
3723
- ...e,
3724
- background: t ? "var(--colors-gray100)" : n ? "var(--colors-blue100)" : "transparent",
3725
- "&:active": {
3726
- background: "var(--colors-gray200)"
3727
- },
3728
- borderRadius: "var(--radii-sm)",
3729
- color: "var(--colors-text)"
3730
- }),
3731
- menuList: (e) => ({
3732
- ...e,
3733
- padding: 0
3734
- }),
3735
- multiValueRemove: (e) => ({
3736
- ...e,
3737
- background: "transparent",
3738
- color: "var(--colors-text)",
3739
- "&:hover": {
3740
- background: "var(--colors-red200)",
3741
- color: "var(--colors-red800)"
3742
- }
3743
- }),
3744
- clearIndicator: (e) => ({
3745
- ...e,
3746
- paddingLeft: 0,
3747
- paddingRight: 0
3748
- }),
3749
- menuPortal: (e) => ({
3750
- ...e,
3751
- zIndex: "var(--zIndices-overlayCard)"
3752
- })
3753
- }, Pi = {
3754
- control: (e, t) => {
3755
- var n;
3756
- return {
3757
- ...(n = Ue.control) == null ? void 0 : n.call(Ue, e, t),
3758
- border: "1px solid var(--colors-red500)",
3759
- boxShadow: t.isFocused ? "0 0 0 4px var(--colors-red100)" : "none"
3760
- };
3761
- }
3762
- }, Ai = {
3763
- IndicatorSeparator: () => null
3764
- }, Oi = ({
3765
- styles: e,
3766
- components: t,
3767
- error: n,
3768
- ...o
3769
- }) => {
3770
- const r = qe(
3771
- () => ({
3772
- ...Ue,
3773
- ...e,
3774
- ...n ? Pi : void 0
3775
- }),
3776
- [e, n]
3777
- ), i = qe(
3778
- () => ({
3779
- ...Ai,
3780
- ...t
3781
- }),
3782
- [t]
3783
- );
3784
- return /* @__PURE__ */ M(Un, { components: i, styles: r, ...o });
3785
- }, vs = (e) => /* @__PURE__ */ M(Oi, { ...e, isSearchable: !0 }), Ln = Ve({
3786
- display: "block",
3787
- width: "100%",
3788
- padding: "0.5rem 0.75rem",
3789
- background: "transparent",
3790
- borderRadius: "none",
3791
- outline: "none",
3792
- border: "none",
3793
- fontSize: "$md",
3794
- "-webkit-appearance": "none",
3795
- "-moz-appearance": "none",
3796
- appearance: "none"
3797
- }), Fn = Ve({
3798
- display: "block",
3799
- width: "100%",
3800
- background: "#fff",
3801
- border: "1px solid $colors$gray300",
3802
- borderRadius: "$md",
3803
- outline: "none",
3804
- transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
3805
- "&:focus-within": {
3806
- border: "1px solid $colors$blue300",
3807
- boxShadow: "0 0 0 4px $colors$blue100",
3808
- background: "#fff"
3809
- },
3810
- variants: {
3811
- error: {
3812
- true: {
3813
- border: "1px solid $colors$red500",
3814
- "&:focus-within": {
3815
- border: "1px solid $colors$red500",
3816
- boxShadow: "0 0 0 4px $colors$red100"
3817
- }
3818
- }
3819
- }
3820
- }
3821
- }), Di = W("input", Ln), Mi = W("div", Fn, {
3822
- display: "flex",
3823
- alignItems: "center",
3824
- gap: "$2",
3825
- width: "100%"
3826
- }), xs = ue(
3827
- ({ type: e = "text", label: t, error: n, style: o, css: r, suffix: i, id: s, ...l }, a) => {
3828
- const c = bt();
3829
- return s = s || c, /* @__PURE__ */ te(Q, { css: r, children: [
3830
- t && /* @__PURE__ */ M(
3831
- Q,
3832
- {
3833
- as: "label",
3834
- htmlFor: s,
3835
- css: {
3836
- display: "block",
3837
- marginBottom: "$2",
3838
- fontSize: "$md"
3839
- },
3840
- children: t
3841
- }
3842
- ),
3843
- /* @__PURE__ */ te(Mi, { error: !!n, children: [
3844
- /* @__PURE__ */ M(
3845
- Di,
3846
- {
3847
- id: s,
3848
- ref: a,
3849
- type: e,
3850
- "aria-invalid": n ? "true" : "false",
3851
- ...l
3852
- }
3853
- ),
3854
- i && /* @__PURE__ */ M(
3855
- Q,
3856
- {
3857
- css: {
3858
- fontSize: "$sm",
3859
- fontWeight: "$medium",
3860
- marginRight: "$2"
3861
- },
3862
- children: i
3863
- }
3864
- ),
3865
- n && /* @__PURE__ */ M(
3866
- Q,
3867
- {
3868
- as: ln,
3869
- css: { color: "$red600", marginRight: "$2" },
3870
- size: 24
3871
- }
3872
- )
3873
- ] }),
3874
- typeof n == "string" && /* @__PURE__ */ M(Q, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: n })
3875
- ] });
3876
- }
3877
- ), Li = W("textarea", Ln), Fi = W("div", Fn, {
3878
- display: "flex",
3879
- alignItems: "center",
3880
- gap: "$2",
3881
- width: "100%"
3882
- }), $s = ue(
3883
- ({ label: e, error: t, style: n, css: o, suffix: r, id: i, ...s }, l) => {
3884
- const a = bt();
3885
- return i = i || a, /* @__PURE__ */ te(Q, { css: o, children: [
3886
- e && /* @__PURE__ */ M(
3887
- Q,
3888
- {
3889
- as: "label",
3890
- htmlFor: i,
3891
- css: {
3892
- display: "block",
3893
- marginBottom: "$2",
3894
- fontSize: "$md"
3895
- },
3896
- children: e
3897
- }
3898
- ),
3899
- /* @__PURE__ */ te(Fi, { error: !!t, children: [
3900
- /* @__PURE__ */ M(
3901
- Li,
3902
- {
3903
- id: i,
3904
- ref: l,
3905
- "aria-invalid": t ? "true" : "false",
3906
- ...s
3907
- }
3908
- ),
3909
- r && /* @__PURE__ */ M(
3910
- Q,
3911
- {
3912
- css: {
3913
- fontSize: "$sm",
3914
- fontWeight: "$medium",
3915
- marginRight: "$2"
3916
- },
3917
- children: r
3918
- }
3919
- ),
3920
- t && /* @__PURE__ */ M(
3921
- Q,
3922
- {
3923
- as: ln,
3924
- css: { color: "$red600", marginRight: "$2" },
3925
- size: 24
3926
- }
3927
- )
3928
- ] }),
3929
- typeof t == "string" && /* @__PURE__ */ M(Q, { css: { color: "$red600", fontSize: "$sm", marginTop: "$2" }, children: t })
3930
- ] });
3931
- }
3932
- ), zi = W(an.Root, {
3933
- display: "flex",
3934
- alignItems: "center",
3935
- justifyContent: "center",
3936
- gap: "$2",
3937
- color: "#fff",
3938
- border: "2px solid $blue600",
3939
- backgroundColor: "transparent",
3940
- borderRadius: "$sm",
3941
- "&[data-state=checked], &[data-state=indeterminate]": {
3942
- backgroundColor: "$blue500"
3943
- },
3944
- "&[data-disabled]": {
3945
- borderColor: "$gray200",
3946
- backgroundColor: "$gray100",
3947
- color: "$gray400"
3948
- },
3949
- variants: {
3950
- size: {
3951
- sm: {
3952
- width: "1.2rem",
3953
- height: "1.2rem"
3954
- },
3955
- md: {
3956
- width: "1.5rem",
3957
- height: "1.5rem"
3958
- },
3959
- lg: {
3960
- width: "2rem",
3961
- height: "2rem"
3962
- }
3963
- }
3964
- },
3965
- defaultVariants: {
3966
- size: "md"
3967
- }
3968
- }), Wi = W(an.Indicator, {
3969
- "[data-icon]": {
3970
- display: "none"
3971
- },
3972
- "&[data-state=checked] [data-icon=checked], &[data-state=indeterminate] [data-icon=indeterminate]": {
3973
- display: "block"
3974
- }
3975
- }), Ni = W("label", {
3976
- flex: "0 1 auto",
3977
- variants: {
3978
- size: {
3979
- sm: {
3980
- fontSize: "$sm"
3981
- },
3982
- md: {
3983
- fontSize: "$md"
3984
- },
3985
- lg: {
3986
- fontSize: "$lg"
3987
- }
3988
- }
3989
- },
3990
- defaultVariants: {
3991
- size: "md"
3992
- }
3993
- }), ws = ({
3994
- id: e,
3995
- size: t,
3996
- label: n,
3997
- ...o
3998
- }) => {
3999
- const r = bt();
4000
- return e = e || r, /* @__PURE__ */ te(Q, { css: { display: "flex", alignItems: "center", gap: "$2" }, children: [
4001
- /* @__PURE__ */ M(zi, { id: e, size: t, ...o, children: /* @__PURE__ */ te(Wi, { children: [
4002
- /* @__PURE__ */ M(Kn, { "data-icon": "indeterminate" }),
4003
- /* @__PURE__ */ M(Gn, { "data-icon": "checked" })
4004
- ] }) }),
4005
- n && /* @__PURE__ */ M(Ni, { htmlFor: e, size: t, children: n })
4006
- ] });
4007
- };
4008
- export {
4009
- Me as A,
4010
- Q as B,
4011
- vs as C,
4012
- gs as D,
4013
- Xi as E,
4014
- ai as F,
4015
- Ki as G,
4016
- Gi as H,
4017
- es as I,
4018
- Mn as J,
4019
- ss as K,
4020
- us as L,
4021
- fs as M,
4022
- ls as N,
4023
- dn as O,
4024
- Zi as P,
4025
- ms as Q,
4026
- Oi as R,
4027
- Bo as S,
4028
- rs as T,
4029
- Ti as U,
4030
- kt as V,
4031
- ys as W,
4032
- $s as X,
4033
- ws as Y,
4034
- bs as a,
4035
- ns as b,
4036
- is as c,
4037
- Rr as d,
4038
- Ui as e,
4039
- Er as f,
4040
- Cr as g,
4041
- pi as h,
4042
- bi as i,
4043
- ts as j,
4044
- os as k,
4045
- Ve as l,
4046
- un as m,
4047
- hs as n,
4048
- ir as o,
4049
- ps as p,
4050
- cs as q,
4051
- as as r,
4052
- W as s,
4053
- xs as t,
4054
- gi as u,
4055
- ds as v,
4056
- qi as w,
4057
- mi as x,
4058
- Ji as y,
4059
- Qi as z
4060
- };