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