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