@moises.ai/design-system 1.0.21 → 1.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/Readme.md +60 -18
- package/dist/icons.js +426 -114
- package/dist/index-CpglT-SS.js +8383 -0
- package/dist/index.js +2040 -3
- package/dist/primitives.js +3126 -0
- package/dist/react-icons.esm-DrgObs82.js +6780 -0
- package/dist/styles.css +10 -0
- package/package.json +18 -13
- package/styles.css +0 -110
|
@@ -0,0 +1,3126 @@
|
|
|
1
|
+
import { aS as ge, aT as oe, aU as X, aV as te, aW as O, aX as Ce, v as A, aY as K, aZ as Pe, a_ as he, a$ as _n, b0 as In, b1 as Mn, b2 as Pn, b3 as xn, b4 as Sn, b5 as An, b6 as Nn, b7 as Fn, b8 as ue, b9 as Be, ba as On, bb as Dn, bc as Ln, bd as kn, be as Vn, bf as Gn, bg as $n, bh as xe, bi as Kn, bj as Bn, bk as Hn, aN as ee, bl as jn, bm as zn, bn as rt, bo as Un, bp as Wn, bq as Tr, br as wr, bs as qn, bt as Yn, aR as yr, aQ as Xn, aI as Zn } from "./index-CpglT-SS.js";
|
|
2
|
+
import { bu as Cc, bv as hc, bw as Tc, bx as wc, by as yc, bz as Ec, bA as Rc, bB as _c, bC as Ic, bD as Mc, bE as Pc, bF as xc, bG as Sc, bH as Ac, bI as Nc, bJ as Fc, bK as Oc, bL as Dc, bM as Lc, bN as kc, bO as Vc, bP as Gc } from "./index-CpglT-SS.js";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import V from "react";
|
|
5
|
+
import { jsx as i, Fragment as _e, jsxs as Ie } from "react/jsx-runtime";
|
|
6
|
+
import * as Jn from "react-dom";
|
|
7
|
+
import Qn, { flushSync as me } from "react-dom";
|
|
8
|
+
var cr = a[" useEffectEvent ".trim().toString()], lr = a[" useInsertionEffect ".trim().toString()];
|
|
9
|
+
function Er(e) {
|
|
10
|
+
if (typeof cr == "function")
|
|
11
|
+
return cr(e);
|
|
12
|
+
const t = a.useRef(() => {
|
|
13
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
14
|
+
});
|
|
15
|
+
return typeof lr == "function" ? lr(() => {
|
|
16
|
+
t.current = e;
|
|
17
|
+
}) : ge(() => {
|
|
18
|
+
t.current = e;
|
|
19
|
+
}), a.useMemo(() => (...o) => {
|
|
20
|
+
var r;
|
|
21
|
+
return (r = t.current) == null ? void 0 : r.call(t, ...o);
|
|
22
|
+
}, []);
|
|
23
|
+
}
|
|
24
|
+
var He = "Collapsible", [ea, Rt] = oe(He), [ta, _t] = ea(He), It = a.forwardRef(
|
|
25
|
+
(e, t) => {
|
|
26
|
+
const {
|
|
27
|
+
__scopeCollapsible: o,
|
|
28
|
+
open: r,
|
|
29
|
+
defaultOpen: n,
|
|
30
|
+
disabled: s,
|
|
31
|
+
onOpenChange: c,
|
|
32
|
+
...l
|
|
33
|
+
} = e, [u, d] = X({
|
|
34
|
+
prop: r,
|
|
35
|
+
defaultProp: n ?? !1,
|
|
36
|
+
onChange: c,
|
|
37
|
+
caller: He
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ i(
|
|
40
|
+
ta,
|
|
41
|
+
{
|
|
42
|
+
scope: o,
|
|
43
|
+
disabled: s,
|
|
44
|
+
contentId: te(),
|
|
45
|
+
open: u,
|
|
46
|
+
onOpenToggle: a.useCallback(() => d((f) => !f), [d]),
|
|
47
|
+
children: /* @__PURE__ */ i(
|
|
48
|
+
O.div,
|
|
49
|
+
{
|
|
50
|
+
"data-state": St(u),
|
|
51
|
+
"data-disabled": s ? "" : void 0,
|
|
52
|
+
...l,
|
|
53
|
+
ref: t
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
It.displayName = He;
|
|
61
|
+
var Rr = "CollapsibleTrigger", Mt = a.forwardRef(
|
|
62
|
+
(e, t) => {
|
|
63
|
+
const { __scopeCollapsible: o, ...r } = e, n = _t(Rr, o);
|
|
64
|
+
return /* @__PURE__ */ i(
|
|
65
|
+
O.button,
|
|
66
|
+
{
|
|
67
|
+
type: "button",
|
|
68
|
+
"aria-controls": n.contentId,
|
|
69
|
+
"aria-expanded": n.open || !1,
|
|
70
|
+
"data-state": St(n.open),
|
|
71
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
72
|
+
disabled: n.disabled,
|
|
73
|
+
...r,
|
|
74
|
+
ref: t,
|
|
75
|
+
onClick: A(e.onClick, n.onOpenToggle)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
Mt.displayName = Rr;
|
|
81
|
+
var Pt = "CollapsibleContent", xt = a.forwardRef(
|
|
82
|
+
(e, t) => {
|
|
83
|
+
const { forceMount: o, ...r } = e, n = _t(Pt, e.__scopeCollapsible);
|
|
84
|
+
return /* @__PURE__ */ i(Ce, { present: o || n.open, children: ({ present: s }) => /* @__PURE__ */ i(oa, { ...r, ref: t, present: s }) });
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
xt.displayName = Pt;
|
|
88
|
+
var oa = a.forwardRef((e, t) => {
|
|
89
|
+
const { __scopeCollapsible: o, present: r, children: n, ...s } = e, c = _t(Pt, o), [l, u] = a.useState(r), d = a.useRef(null), f = K(t, d), b = a.useRef(0), w = b.current, E = a.useRef(0), C = E.current, v = c.open || l, m = a.useRef(v), h = a.useRef(void 0);
|
|
90
|
+
return a.useEffect(() => {
|
|
91
|
+
const p = requestAnimationFrame(() => m.current = !1);
|
|
92
|
+
return () => cancelAnimationFrame(p);
|
|
93
|
+
}, []), ge(() => {
|
|
94
|
+
const p = d.current;
|
|
95
|
+
if (p) {
|
|
96
|
+
h.current = h.current || {
|
|
97
|
+
transitionDuration: p.style.transitionDuration,
|
|
98
|
+
animationName: p.style.animationName
|
|
99
|
+
}, p.style.transitionDuration = "0s", p.style.animationName = "none";
|
|
100
|
+
const g = p.getBoundingClientRect();
|
|
101
|
+
b.current = g.height, E.current = g.width, m.current || (p.style.transitionDuration = h.current.transitionDuration, p.style.animationName = h.current.animationName), u(r);
|
|
102
|
+
}
|
|
103
|
+
}, [c.open, r]), /* @__PURE__ */ i(
|
|
104
|
+
O.div,
|
|
105
|
+
{
|
|
106
|
+
"data-state": St(c.open),
|
|
107
|
+
"data-disabled": c.disabled ? "" : void 0,
|
|
108
|
+
id: c.contentId,
|
|
109
|
+
hidden: !v,
|
|
110
|
+
...s,
|
|
111
|
+
ref: f,
|
|
112
|
+
style: {
|
|
113
|
+
"--radix-collapsible-content-height": w ? `${w}px` : void 0,
|
|
114
|
+
"--radix-collapsible-content-width": C ? `${C}px` : void 0,
|
|
115
|
+
...e.style
|
|
116
|
+
},
|
|
117
|
+
children: v && n
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
function St(e) {
|
|
122
|
+
return e ? "open" : "closed";
|
|
123
|
+
}
|
|
124
|
+
var _r = It, Ir = Mt, Mr = xt;
|
|
125
|
+
const rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
126
|
+
__proto__: null,
|
|
127
|
+
Collapsible: It,
|
|
128
|
+
CollapsibleContent: xt,
|
|
129
|
+
CollapsibleTrigger: Mt,
|
|
130
|
+
Content: Mr,
|
|
131
|
+
Root: _r,
|
|
132
|
+
Trigger: Ir,
|
|
133
|
+
createCollapsibleScope: Rt
|
|
134
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
135
|
+
var re = "Accordion", ra = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [At, na, aa] = Pe(re), [je, sa] = oe(re, [
|
|
136
|
+
aa,
|
|
137
|
+
Rt
|
|
138
|
+
]), Nt = Rt(), Ft = V.forwardRef(
|
|
139
|
+
(e, t) => {
|
|
140
|
+
const { type: o, ...r } = e, n = r, s = r;
|
|
141
|
+
return /* @__PURE__ */ i(At.Provider, { scope: e.__scopeAccordion, children: o === "multiple" ? /* @__PURE__ */ i(ua, { ...s, ref: t }) : /* @__PURE__ */ i(la, { ...n, ref: t }) });
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
Ft.displayName = re;
|
|
145
|
+
var [Pr, ia] = je(re), [xr, ca] = je(
|
|
146
|
+
re,
|
|
147
|
+
{ collapsible: !1 }
|
|
148
|
+
), la = V.forwardRef(
|
|
149
|
+
(e, t) => {
|
|
150
|
+
const {
|
|
151
|
+
value: o,
|
|
152
|
+
defaultValue: r,
|
|
153
|
+
onValueChange: n = () => {
|
|
154
|
+
},
|
|
155
|
+
collapsible: s = !1,
|
|
156
|
+
...c
|
|
157
|
+
} = e, [l, u] = X({
|
|
158
|
+
prop: o,
|
|
159
|
+
defaultProp: r ?? "",
|
|
160
|
+
onChange: n,
|
|
161
|
+
caller: re
|
|
162
|
+
});
|
|
163
|
+
return /* @__PURE__ */ i(
|
|
164
|
+
Pr,
|
|
165
|
+
{
|
|
166
|
+
scope: e.__scopeAccordion,
|
|
167
|
+
value: V.useMemo(() => l ? [l] : [], [l]),
|
|
168
|
+
onItemOpen: u,
|
|
169
|
+
onItemClose: V.useCallback(() => s && u(""), [s, u]),
|
|
170
|
+
children: /* @__PURE__ */ i(xr, { scope: e.__scopeAccordion, collapsible: s, children: /* @__PURE__ */ i(Sr, { ...c, ref: t }) })
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
), ua = V.forwardRef((e, t) => {
|
|
175
|
+
const {
|
|
176
|
+
value: o,
|
|
177
|
+
defaultValue: r,
|
|
178
|
+
onValueChange: n = () => {
|
|
179
|
+
},
|
|
180
|
+
...s
|
|
181
|
+
} = e, [c, l] = X({
|
|
182
|
+
prop: o,
|
|
183
|
+
defaultProp: r ?? [],
|
|
184
|
+
onChange: n,
|
|
185
|
+
caller: re
|
|
186
|
+
}), u = V.useCallback(
|
|
187
|
+
(f) => l((b = []) => [...b, f]),
|
|
188
|
+
[l]
|
|
189
|
+
), d = V.useCallback(
|
|
190
|
+
(f) => l((b = []) => b.filter((w) => w !== f)),
|
|
191
|
+
[l]
|
|
192
|
+
);
|
|
193
|
+
return /* @__PURE__ */ i(
|
|
194
|
+
Pr,
|
|
195
|
+
{
|
|
196
|
+
scope: e.__scopeAccordion,
|
|
197
|
+
value: c,
|
|
198
|
+
onItemOpen: u,
|
|
199
|
+
onItemClose: d,
|
|
200
|
+
children: /* @__PURE__ */ i(xr, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(Sr, { ...s, ref: t }) })
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}), [da, ze] = je(re), Sr = V.forwardRef(
|
|
204
|
+
(e, t) => {
|
|
205
|
+
const { __scopeAccordion: o, disabled: r, dir: n, orientation: s = "vertical", ...c } = e, l = V.useRef(null), u = K(l, t), d = na(o), b = he(n) === "ltr", w = A(e.onKeyDown, (E) => {
|
|
206
|
+
var F;
|
|
207
|
+
if (!ra.includes(E.key)) return;
|
|
208
|
+
const C = E.target, v = d().filter((I) => {
|
|
209
|
+
var T;
|
|
210
|
+
return !((T = I.ref.current) != null && T.disabled);
|
|
211
|
+
}), m = v.findIndex((I) => I.ref.current === C), h = v.length;
|
|
212
|
+
if (m === -1) return;
|
|
213
|
+
E.preventDefault();
|
|
214
|
+
let p = m;
|
|
215
|
+
const g = 0, y = h - 1, R = () => {
|
|
216
|
+
p = m + 1, p > y && (p = g);
|
|
217
|
+
}, P = () => {
|
|
218
|
+
p = m - 1, p < g && (p = y);
|
|
219
|
+
};
|
|
220
|
+
switch (E.key) {
|
|
221
|
+
case "Home":
|
|
222
|
+
p = g;
|
|
223
|
+
break;
|
|
224
|
+
case "End":
|
|
225
|
+
p = y;
|
|
226
|
+
break;
|
|
227
|
+
case "ArrowRight":
|
|
228
|
+
s === "horizontal" && (b ? R() : P());
|
|
229
|
+
break;
|
|
230
|
+
case "ArrowDown":
|
|
231
|
+
s === "vertical" && R();
|
|
232
|
+
break;
|
|
233
|
+
case "ArrowLeft":
|
|
234
|
+
s === "horizontal" && (b ? P() : R());
|
|
235
|
+
break;
|
|
236
|
+
case "ArrowUp":
|
|
237
|
+
s === "vertical" && P();
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
const D = p % h;
|
|
241
|
+
(F = v[D].ref.current) == null || F.focus();
|
|
242
|
+
});
|
|
243
|
+
return /* @__PURE__ */ i(
|
|
244
|
+
da,
|
|
245
|
+
{
|
|
246
|
+
scope: o,
|
|
247
|
+
disabled: r,
|
|
248
|
+
direction: n,
|
|
249
|
+
orientation: s,
|
|
250
|
+
children: /* @__PURE__ */ i(At.Slot, { scope: o, children: /* @__PURE__ */ i(
|
|
251
|
+
O.div,
|
|
252
|
+
{
|
|
253
|
+
...c,
|
|
254
|
+
"data-orientation": s,
|
|
255
|
+
ref: u,
|
|
256
|
+
onKeyDown: r ? void 0 : w
|
|
257
|
+
}
|
|
258
|
+
) })
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
), ke = "AccordionItem", [fa, Ot] = je(ke), Dt = V.forwardRef(
|
|
263
|
+
(e, t) => {
|
|
264
|
+
const { __scopeAccordion: o, value: r, ...n } = e, s = ze(ke, o), c = ia(ke, o), l = Nt(o), u = te(), d = r && c.value.includes(r) || !1, f = s.disabled || e.disabled;
|
|
265
|
+
return /* @__PURE__ */ i(
|
|
266
|
+
fa,
|
|
267
|
+
{
|
|
268
|
+
scope: o,
|
|
269
|
+
open: d,
|
|
270
|
+
disabled: f,
|
|
271
|
+
triggerId: u,
|
|
272
|
+
children: /* @__PURE__ */ i(
|
|
273
|
+
_r,
|
|
274
|
+
{
|
|
275
|
+
"data-orientation": s.orientation,
|
|
276
|
+
"data-state": Fr(d),
|
|
277
|
+
...l,
|
|
278
|
+
...n,
|
|
279
|
+
ref: t,
|
|
280
|
+
disabled: f,
|
|
281
|
+
open: d,
|
|
282
|
+
onOpenChange: (b) => {
|
|
283
|
+
b ? c.onItemOpen(r) : c.onItemClose(r);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
Dt.displayName = ke;
|
|
292
|
+
var Ar = "AccordionHeader", Lt = V.forwardRef(
|
|
293
|
+
(e, t) => {
|
|
294
|
+
const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(Ar, o);
|
|
295
|
+
return /* @__PURE__ */ i(
|
|
296
|
+
O.h3,
|
|
297
|
+
{
|
|
298
|
+
"data-orientation": n.orientation,
|
|
299
|
+
"data-state": Fr(s.open),
|
|
300
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
301
|
+
...r,
|
|
302
|
+
ref: t
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
Lt.displayName = Ar;
|
|
308
|
+
var nt = "AccordionTrigger", kt = V.forwardRef(
|
|
309
|
+
(e, t) => {
|
|
310
|
+
const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(nt, o), c = ca(nt, o), l = Nt(o);
|
|
311
|
+
return /* @__PURE__ */ i(At.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
312
|
+
Ir,
|
|
313
|
+
{
|
|
314
|
+
"aria-disabled": s.open && !c.collapsible || void 0,
|
|
315
|
+
"data-orientation": n.orientation,
|
|
316
|
+
id: s.triggerId,
|
|
317
|
+
...l,
|
|
318
|
+
...r,
|
|
319
|
+
ref: t
|
|
320
|
+
}
|
|
321
|
+
) });
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
kt.displayName = nt;
|
|
325
|
+
var Nr = "AccordionContent", Vt = V.forwardRef(
|
|
326
|
+
(e, t) => {
|
|
327
|
+
const { __scopeAccordion: o, ...r } = e, n = ze(re, o), s = Ot(Nr, o), c = Nt(o);
|
|
328
|
+
return /* @__PURE__ */ i(
|
|
329
|
+
Mr,
|
|
330
|
+
{
|
|
331
|
+
role: "region",
|
|
332
|
+
"aria-labelledby": s.triggerId,
|
|
333
|
+
"data-orientation": n.orientation,
|
|
334
|
+
...c,
|
|
335
|
+
...r,
|
|
336
|
+
ref: t,
|
|
337
|
+
style: {
|
|
338
|
+
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
339
|
+
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
340
|
+
...e.style
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
Vt.displayName = Nr;
|
|
347
|
+
function Fr(e) {
|
|
348
|
+
return e ? "open" : "closed";
|
|
349
|
+
}
|
|
350
|
+
var pa = Ft, va = Dt, ma = Lt, ga = kt, ba = Vt;
|
|
351
|
+
const nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
352
|
+
__proto__: null,
|
|
353
|
+
Accordion: Ft,
|
|
354
|
+
AccordionContent: Vt,
|
|
355
|
+
AccordionHeader: Lt,
|
|
356
|
+
AccordionItem: Dt,
|
|
357
|
+
AccordionTrigger: kt,
|
|
358
|
+
Content: ba,
|
|
359
|
+
Header: ma,
|
|
360
|
+
Item: va,
|
|
361
|
+
Root: pa,
|
|
362
|
+
Trigger: ga,
|
|
363
|
+
createAccordionScope: sa
|
|
364
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
365
|
+
var Ca = "Label", Ue = a.forwardRef((e, t) => /* @__PURE__ */ i(
|
|
366
|
+
O.label,
|
|
367
|
+
{
|
|
368
|
+
...e,
|
|
369
|
+
ref: t,
|
|
370
|
+
onMouseDown: (o) => {
|
|
371
|
+
var n;
|
|
372
|
+
o.target.closest("button, input, select, textarea") || ((n = e.onMouseDown) == null || n.call(e, o), !o.defaultPrevented && o.detail > 1 && o.preventDefault());
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
));
|
|
376
|
+
Ue.displayName = Ca;
|
|
377
|
+
var ha = Ue;
|
|
378
|
+
const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
379
|
+
__proto__: null,
|
|
380
|
+
Label: Ue,
|
|
381
|
+
Root: ha
|
|
382
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
383
|
+
var [Gt, Ta] = oe("Form"), $t = "Form", [wa, Te] = Gt($t), [ya, Or] = Gt($t), Kt = a.forwardRef(
|
|
384
|
+
(e, t) => {
|
|
385
|
+
const { __scopeForm: o, onClearServerErrors: r = () => {
|
|
386
|
+
}, ...n } = e, s = a.useRef(null), c = K(t, s), [l, u] = a.useState({}), d = a.useCallback(
|
|
387
|
+
(T) => l[T],
|
|
388
|
+
[l]
|
|
389
|
+
), f = a.useCallback(
|
|
390
|
+
(T, _) => u((x) => ({
|
|
391
|
+
...x,
|
|
392
|
+
[T]: { ...x[T] ?? {}, ..._ }
|
|
393
|
+
})),
|
|
394
|
+
[]
|
|
395
|
+
), b = a.useCallback((T) => {
|
|
396
|
+
u((_) => ({ ..._, [T]: void 0 })), p((_) => ({ ..._, [T]: {} }));
|
|
397
|
+
}, []), [w, E] = a.useState({}), C = a.useCallback(
|
|
398
|
+
(T) => w[T] ?? [],
|
|
399
|
+
[w]
|
|
400
|
+
), v = a.useCallback((T, _) => {
|
|
401
|
+
E((x) => ({
|
|
402
|
+
...x,
|
|
403
|
+
[T]: [...x[T] ?? [], _]
|
|
404
|
+
}));
|
|
405
|
+
}, []), m = a.useCallback((T, _) => {
|
|
406
|
+
E((x) => ({
|
|
407
|
+
...x,
|
|
408
|
+
[T]: (x[T] ?? []).filter(
|
|
409
|
+
(L) => L.id !== _
|
|
410
|
+
)
|
|
411
|
+
}));
|
|
412
|
+
}, []), [h, p] = a.useState({}), g = a.useCallback(
|
|
413
|
+
(T) => h[T] ?? {},
|
|
414
|
+
[h]
|
|
415
|
+
), y = a.useCallback((T, _) => {
|
|
416
|
+
p((x) => ({
|
|
417
|
+
...x,
|
|
418
|
+
[T]: { ...x[T] ?? {}, ..._ }
|
|
419
|
+
}));
|
|
420
|
+
}, []), [R, P] = a.useState({}), D = a.useCallback((T, _) => {
|
|
421
|
+
P((x) => {
|
|
422
|
+
const L = new Set(x[T]).add(_);
|
|
423
|
+
return { ...x, [T]: L };
|
|
424
|
+
});
|
|
425
|
+
}, []), F = a.useCallback((T, _) => {
|
|
426
|
+
P((x) => {
|
|
427
|
+
const L = new Set(x[T]);
|
|
428
|
+
return L.delete(_), { ...x, [T]: L };
|
|
429
|
+
});
|
|
430
|
+
}, []), I = a.useCallback(
|
|
431
|
+
(T) => Array.from(R[T] ?? []).join(" ") || void 0,
|
|
432
|
+
[R]
|
|
433
|
+
);
|
|
434
|
+
return /* @__PURE__ */ i(
|
|
435
|
+
wa,
|
|
436
|
+
{
|
|
437
|
+
scope: o,
|
|
438
|
+
getFieldValidity: d,
|
|
439
|
+
onFieldValidityChange: f,
|
|
440
|
+
getFieldCustomMatcherEntries: C,
|
|
441
|
+
onFieldCustomMatcherEntryAdd: v,
|
|
442
|
+
onFieldCustomMatcherEntryRemove: m,
|
|
443
|
+
getFieldCustomErrors: g,
|
|
444
|
+
onFieldCustomErrorsChange: y,
|
|
445
|
+
onFieldValiditionClear: b,
|
|
446
|
+
children: /* @__PURE__ */ i(
|
|
447
|
+
ya,
|
|
448
|
+
{
|
|
449
|
+
scope: o,
|
|
450
|
+
onFieldMessageIdAdd: D,
|
|
451
|
+
onFieldMessageIdRemove: F,
|
|
452
|
+
getFieldDescription: I,
|
|
453
|
+
children: /* @__PURE__ */ i(
|
|
454
|
+
O.form,
|
|
455
|
+
{
|
|
456
|
+
...n,
|
|
457
|
+
ref: c,
|
|
458
|
+
onInvalid: A(e.onInvalid, (T) => {
|
|
459
|
+
const _ = Dr(T.currentTarget);
|
|
460
|
+
_ === T.target && _.focus(), T.preventDefault();
|
|
461
|
+
}),
|
|
462
|
+
onSubmit: A(e.onSubmit, r, {
|
|
463
|
+
checkForDefaultPrevented: !1
|
|
464
|
+
}),
|
|
465
|
+
onReset: A(e.onReset, r)
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
}
|
|
469
|
+
)
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
Kt.displayName = $t;
|
|
475
|
+
var Bt = "FormField", [Ea, We] = Gt(Bt), Ht = a.forwardRef(
|
|
476
|
+
(e, t) => {
|
|
477
|
+
const { __scopeForm: o, name: r, serverInvalid: n = !1, ...s } = e, l = Te(Bt, o).getFieldValidity(r), u = te();
|
|
478
|
+
return /* @__PURE__ */ i(Ea, { scope: o, id: u, name: r, serverInvalid: n, children: /* @__PURE__ */ i(
|
|
479
|
+
O.div,
|
|
480
|
+
{
|
|
481
|
+
"data-valid": Xt(l, n),
|
|
482
|
+
"data-invalid": Zt(l, n),
|
|
483
|
+
...s,
|
|
484
|
+
ref: t
|
|
485
|
+
}
|
|
486
|
+
) });
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
Ht.displayName = Bt;
|
|
490
|
+
var at = "FormLabel", jt = a.forwardRef(
|
|
491
|
+
(e, t) => {
|
|
492
|
+
const { __scopeForm: o, ...r } = e, n = Te(at, o), s = We(at, o), c = r.htmlFor || s.id, l = n.getFieldValidity(s.name);
|
|
493
|
+
return /* @__PURE__ */ i(
|
|
494
|
+
Ue,
|
|
495
|
+
{
|
|
496
|
+
"data-valid": Xt(l, s.serverInvalid),
|
|
497
|
+
"data-invalid": Zt(l, s.serverInvalid),
|
|
498
|
+
...r,
|
|
499
|
+
ref: t,
|
|
500
|
+
htmlFor: c
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
jt.displayName = at;
|
|
506
|
+
var De = "FormControl", zt = a.forwardRef(
|
|
507
|
+
(e, t) => {
|
|
508
|
+
const { __scopeForm: o, ...r } = e, n = Te(De, o), s = We(De, o), c = Or(De, o), l = a.useRef(null), u = K(t, l), d = r.name || s.name, f = r.id || s.id, b = n.getFieldCustomMatcherEntries(d), { onFieldValidityChange: w, onFieldCustomErrorsChange: E, onFieldValiditionClear: C } = n, v = a.useCallback(
|
|
509
|
+
async (p) => {
|
|
510
|
+
if (Lr(p.validity)) {
|
|
511
|
+
const x = tt(p.validity);
|
|
512
|
+
w(d, x);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const g = p.form ? new FormData(p.form) : new FormData(), y = [p.value, g], R = [], P = [];
|
|
516
|
+
b.forEach((x) => {
|
|
517
|
+
Aa(x, y) ? P.push(x) : Na(x) && R.push(x);
|
|
518
|
+
});
|
|
519
|
+
const D = R.map(({ id: x, match: L }) => [x, L(...y)]), F = Object.fromEntries(D), I = Object.values(F).some(Boolean), T = I;
|
|
520
|
+
p.setCustomValidity(T ? Me : "");
|
|
521
|
+
const _ = tt(p.validity);
|
|
522
|
+
if (w(d, _), E(d, F), !I && P.length > 0) {
|
|
523
|
+
const x = P.map(
|
|
524
|
+
({ id: U, match: ne }) => ne(...y).then((Y) => [U, Y])
|
|
525
|
+
), L = await Promise.all(x), M = Object.fromEntries(L), G = Object.values(M).some(Boolean);
|
|
526
|
+
p.setCustomValidity(G ? Me : "");
|
|
527
|
+
const Z = tt(p.validity);
|
|
528
|
+
w(d, Z), E(d, M);
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
[b, d, E, w]
|
|
532
|
+
);
|
|
533
|
+
a.useEffect(() => {
|
|
534
|
+
const p = l.current;
|
|
535
|
+
if (p) {
|
|
536
|
+
const g = () => v(p);
|
|
537
|
+
return p.addEventListener("change", g), () => p.removeEventListener("change", g);
|
|
538
|
+
}
|
|
539
|
+
}, [v]);
|
|
540
|
+
const m = a.useCallback(() => {
|
|
541
|
+
const p = l.current;
|
|
542
|
+
p && (p.setCustomValidity(""), C(d));
|
|
543
|
+
}, [d, C]);
|
|
544
|
+
a.useEffect(() => {
|
|
545
|
+
var g;
|
|
546
|
+
const p = (g = l.current) == null ? void 0 : g.form;
|
|
547
|
+
if (p)
|
|
548
|
+
return p.addEventListener("reset", m), () => p.removeEventListener("reset", m);
|
|
549
|
+
}, [m]), a.useEffect(() => {
|
|
550
|
+
const p = l.current, g = p == null ? void 0 : p.closest("form");
|
|
551
|
+
if (g && s.serverInvalid) {
|
|
552
|
+
const y = Dr(g);
|
|
553
|
+
y === p && y.focus();
|
|
554
|
+
}
|
|
555
|
+
}, [s.serverInvalid]);
|
|
556
|
+
const h = n.getFieldValidity(d);
|
|
557
|
+
return /* @__PURE__ */ i(
|
|
558
|
+
O.input,
|
|
559
|
+
{
|
|
560
|
+
"data-valid": Xt(h, s.serverInvalid),
|
|
561
|
+
"data-invalid": Zt(h, s.serverInvalid),
|
|
562
|
+
"aria-invalid": s.serverInvalid ? !0 : void 0,
|
|
563
|
+
"aria-describedby": c.getFieldDescription(d),
|
|
564
|
+
title: "",
|
|
565
|
+
...r,
|
|
566
|
+
ref: u,
|
|
567
|
+
id: f,
|
|
568
|
+
name: d,
|
|
569
|
+
onInvalid: A(e.onInvalid, (p) => {
|
|
570
|
+
const g = p.currentTarget;
|
|
571
|
+
v(g);
|
|
572
|
+
}),
|
|
573
|
+
onChange: A(e.onChange, (p) => {
|
|
574
|
+
m();
|
|
575
|
+
})
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
zt.displayName = De;
|
|
581
|
+
var Me = "This value is not valid", Ra = {
|
|
582
|
+
badInput: Me,
|
|
583
|
+
patternMismatch: "This value does not match the required pattern",
|
|
584
|
+
rangeOverflow: "This value is too large",
|
|
585
|
+
rangeUnderflow: "This value is too small",
|
|
586
|
+
stepMismatch: "This value does not match the required step",
|
|
587
|
+
tooLong: "This value is too long",
|
|
588
|
+
tooShort: "This value is too short",
|
|
589
|
+
typeMismatch: "This value does not match the required type",
|
|
590
|
+
valid: void 0,
|
|
591
|
+
valueMissing: "This value is missing"
|
|
592
|
+
}, Se = "FormMessage", Ut = a.forwardRef(
|
|
593
|
+
(e, t) => {
|
|
594
|
+
const { match: o, name: r, ...n } = e, s = We(Se, e.__scopeForm), c = r ?? s.name;
|
|
595
|
+
return o === void 0 ? /* @__PURE__ */ i(Wt, { ...n, ref: t, name: c, children: e.children || Me }) : typeof o == "function" ? /* @__PURE__ */ i(Ia, { match: o, ...n, ref: t, name: c }) : /* @__PURE__ */ i(_a, { match: o, ...n, ref: t, name: c });
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
Ut.displayName = Se;
|
|
599
|
+
var _a = a.forwardRef(
|
|
600
|
+
(e, t) => {
|
|
601
|
+
const { match: o, forceMatch: r = !1, name: n, children: s, ...c } = e, u = Te(Se, c.__scopeForm).getFieldValidity(n);
|
|
602
|
+
return r || (u == null ? void 0 : u[o]) ? /* @__PURE__ */ i(Wt, { ref: t, ...c, name: n, children: s ?? Ra[o] }) : null;
|
|
603
|
+
}
|
|
604
|
+
), Ia = a.forwardRef(
|
|
605
|
+
(e, t) => {
|
|
606
|
+
const { match: o, forceMatch: r = !1, name: n, id: s, children: c, ...l } = e, u = Te(Se, l.__scopeForm), d = a.useRef(null), f = K(t, d), b = te(), w = s ?? b, E = a.useMemo(() => ({ id: w, match: o }), [w, o]), { onFieldCustomMatcherEntryAdd: C, onFieldCustomMatcherEntryRemove: v } = u;
|
|
607
|
+
a.useEffect(() => (C(n, E), () => v(n, E.id)), [E, n, C, v]);
|
|
608
|
+
const m = u.getFieldValidity(n), p = u.getFieldCustomErrors(n)[w];
|
|
609
|
+
return r || m && !Lr(m) && p ? /* @__PURE__ */ i(Wt, { id: w, ref: f, ...l, name: n, children: c ?? Me }) : null;
|
|
610
|
+
}
|
|
611
|
+
), Wt = a.forwardRef(
|
|
612
|
+
(e, t) => {
|
|
613
|
+
const { __scopeForm: o, id: r, name: n, ...s } = e, c = Or(Se, o), l = te(), u = r ?? l, { onFieldMessageIdAdd: d, onFieldMessageIdRemove: f } = c;
|
|
614
|
+
return a.useEffect(() => (d(n, u), () => f(n, u)), [n, u, d, f]), /* @__PURE__ */ i(O.span, { id: u, ...s, ref: t });
|
|
615
|
+
}
|
|
616
|
+
), st = "FormValidityState", qt = (e) => {
|
|
617
|
+
const { __scopeForm: t, name: o, children: r } = e, n = Te(st, t), s = We(st, t), c = o ?? s.name, l = n.getFieldValidity(c);
|
|
618
|
+
return /* @__PURE__ */ i(_e, { children: r(l) });
|
|
619
|
+
};
|
|
620
|
+
qt.displayName = st;
|
|
621
|
+
var Ma = "FormSubmit", Yt = a.forwardRef(
|
|
622
|
+
(e, t) => {
|
|
623
|
+
const { __scopeForm: o, ...r } = e;
|
|
624
|
+
return /* @__PURE__ */ i(O.button, { type: "submit", ...r, ref: t });
|
|
625
|
+
}
|
|
626
|
+
);
|
|
627
|
+
Yt.displayName = Ma;
|
|
628
|
+
function tt(e) {
|
|
629
|
+
const t = {};
|
|
630
|
+
for (const o in e)
|
|
631
|
+
t[o] = e[o];
|
|
632
|
+
return t;
|
|
633
|
+
}
|
|
634
|
+
function Pa(e) {
|
|
635
|
+
return e instanceof HTMLElement;
|
|
636
|
+
}
|
|
637
|
+
function xa(e) {
|
|
638
|
+
return "validity" in e;
|
|
639
|
+
}
|
|
640
|
+
function Sa(e) {
|
|
641
|
+
return xa(e) && (e.validity.valid === !1 || e.getAttribute("aria-invalid") === "true");
|
|
642
|
+
}
|
|
643
|
+
function Dr(e) {
|
|
644
|
+
const t = e.elements, [o] = Array.from(t).filter(Pa).filter(Sa);
|
|
645
|
+
return o;
|
|
646
|
+
}
|
|
647
|
+
function Aa(e, t) {
|
|
648
|
+
return e.match.constructor.name === "AsyncFunction" || Fa(e.match, t);
|
|
649
|
+
}
|
|
650
|
+
function Na(e) {
|
|
651
|
+
return e.match.constructor.name === "Function";
|
|
652
|
+
}
|
|
653
|
+
function Fa(e, t) {
|
|
654
|
+
return e(...t) instanceof Promise;
|
|
655
|
+
}
|
|
656
|
+
function Lr(e) {
|
|
657
|
+
let t = !1;
|
|
658
|
+
for (const o in e) {
|
|
659
|
+
const r = o;
|
|
660
|
+
if (r !== "valid" && r !== "customError" && e[r]) {
|
|
661
|
+
t = !0;
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return t;
|
|
666
|
+
}
|
|
667
|
+
function Xt(e, t) {
|
|
668
|
+
if ((e == null ? void 0 : e.valid) === !0 && !t) return !0;
|
|
669
|
+
}
|
|
670
|
+
function Zt(e, t) {
|
|
671
|
+
if ((e == null ? void 0 : e.valid) === !1 || t) return !0;
|
|
672
|
+
}
|
|
673
|
+
var Oa = Kt, Da = Ht, La = jt, ka = zt, Va = Ut, Ga = qt, $a = Yt;
|
|
674
|
+
const sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
675
|
+
__proto__: null,
|
|
676
|
+
Control: ka,
|
|
677
|
+
Field: Da,
|
|
678
|
+
Form: Kt,
|
|
679
|
+
FormControl: zt,
|
|
680
|
+
FormField: Ht,
|
|
681
|
+
FormLabel: jt,
|
|
682
|
+
FormMessage: Ut,
|
|
683
|
+
FormSubmit: Yt,
|
|
684
|
+
FormValidityState: qt,
|
|
685
|
+
Label: La,
|
|
686
|
+
Message: Va,
|
|
687
|
+
Root: Oa,
|
|
688
|
+
Submit: $a,
|
|
689
|
+
ValidityState: Ga,
|
|
690
|
+
createFormScope: Ta
|
|
691
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
692
|
+
var Ae = "Menubar", [it, Ka, Ba] = Pe(Ae), [kr, Ha] = oe(Ae, [
|
|
693
|
+
Ba,
|
|
694
|
+
ue
|
|
695
|
+
]), z = _n(), Vr = ue(), [ja, Jt] = kr(Ae), Qt = a.forwardRef(
|
|
696
|
+
(e, t) => {
|
|
697
|
+
const {
|
|
698
|
+
__scopeMenubar: o,
|
|
699
|
+
value: r,
|
|
700
|
+
onValueChange: n,
|
|
701
|
+
defaultValue: s,
|
|
702
|
+
loop: c = !0,
|
|
703
|
+
dir: l,
|
|
704
|
+
...u
|
|
705
|
+
} = e, d = he(l), f = Vr(o), [b, w] = X({
|
|
706
|
+
prop: r,
|
|
707
|
+
onChange: n,
|
|
708
|
+
defaultProp: s ?? "",
|
|
709
|
+
caller: Ae
|
|
710
|
+
}), [E, C] = a.useState(null);
|
|
711
|
+
return /* @__PURE__ */ i(
|
|
712
|
+
ja,
|
|
713
|
+
{
|
|
714
|
+
scope: o,
|
|
715
|
+
value: b,
|
|
716
|
+
onMenuOpen: a.useCallback(
|
|
717
|
+
(v) => {
|
|
718
|
+
w(v), C(v);
|
|
719
|
+
},
|
|
720
|
+
[w]
|
|
721
|
+
),
|
|
722
|
+
onMenuClose: a.useCallback(() => w(""), [w]),
|
|
723
|
+
onMenuToggle: a.useCallback(
|
|
724
|
+
(v) => {
|
|
725
|
+
w((m) => m ? "" : v), C(v);
|
|
726
|
+
},
|
|
727
|
+
[w]
|
|
728
|
+
),
|
|
729
|
+
dir: d,
|
|
730
|
+
loop: c,
|
|
731
|
+
children: /* @__PURE__ */ i(it.Provider, { scope: o, children: /* @__PURE__ */ i(it.Slot, { scope: o, children: /* @__PURE__ */ i(
|
|
732
|
+
Be,
|
|
733
|
+
{
|
|
734
|
+
asChild: !0,
|
|
735
|
+
...f,
|
|
736
|
+
orientation: "horizontal",
|
|
737
|
+
loop: c,
|
|
738
|
+
dir: d,
|
|
739
|
+
currentTabStopId: E,
|
|
740
|
+
onCurrentTabStopIdChange: C,
|
|
741
|
+
children: /* @__PURE__ */ i(O.div, { role: "menubar", ...u, ref: t })
|
|
742
|
+
}
|
|
743
|
+
) }) })
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
Qt.displayName = Ae;
|
|
749
|
+
var eo = "MenubarMenu", [za, Gr] = kr(eo), to = (e) => {
|
|
750
|
+
const { __scopeMenubar: t, value: o, ...r } = e, n = te(), s = o || n || "LEGACY_REACT_AUTO_VALUE", c = Jt(eo, t), l = z(t), u = a.useRef(null), d = a.useRef(!1), f = c.value === s;
|
|
751
|
+
return a.useEffect(() => {
|
|
752
|
+
f || (d.current = !1);
|
|
753
|
+
}, [f]), /* @__PURE__ */ i(
|
|
754
|
+
za,
|
|
755
|
+
{
|
|
756
|
+
scope: t,
|
|
757
|
+
value: s,
|
|
758
|
+
triggerId: te(),
|
|
759
|
+
triggerRef: u,
|
|
760
|
+
contentId: te(),
|
|
761
|
+
wasKeyboardTriggerOpenRef: d,
|
|
762
|
+
children: /* @__PURE__ */ i(
|
|
763
|
+
Fn,
|
|
764
|
+
{
|
|
765
|
+
...l,
|
|
766
|
+
open: f,
|
|
767
|
+
onOpenChange: (b) => {
|
|
768
|
+
b || c.onMenuClose();
|
|
769
|
+
},
|
|
770
|
+
modal: !1,
|
|
771
|
+
dir: c.dir,
|
|
772
|
+
...r
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
);
|
|
777
|
+
};
|
|
778
|
+
to.displayName = eo;
|
|
779
|
+
var ct = "MenubarTrigger", oo = a.forwardRef(
|
|
780
|
+
(e, t) => {
|
|
781
|
+
const { __scopeMenubar: o, disabled: r = !1, ...n } = e, s = Vr(o), c = z(o), l = Jt(ct, o), u = Gr(ct, o), d = a.useRef(null), f = K(t, d, u.triggerRef), [b, w] = a.useState(!1), E = l.value === u.value;
|
|
782
|
+
return /* @__PURE__ */ i(it.ItemSlot, { scope: o, value: u.value, disabled: r, children: /* @__PURE__ */ i(
|
|
783
|
+
xe,
|
|
784
|
+
{
|
|
785
|
+
asChild: !0,
|
|
786
|
+
...s,
|
|
787
|
+
focusable: !r,
|
|
788
|
+
tabStopId: u.value,
|
|
789
|
+
children: /* @__PURE__ */ i(Kn, { asChild: !0, ...c, children: /* @__PURE__ */ i(
|
|
790
|
+
O.button,
|
|
791
|
+
{
|
|
792
|
+
type: "button",
|
|
793
|
+
role: "menuitem",
|
|
794
|
+
id: u.triggerId,
|
|
795
|
+
"aria-haspopup": "menu",
|
|
796
|
+
"aria-expanded": E,
|
|
797
|
+
"aria-controls": E ? u.contentId : void 0,
|
|
798
|
+
"data-highlighted": b ? "" : void 0,
|
|
799
|
+
"data-state": E ? "open" : "closed",
|
|
800
|
+
"data-disabled": r ? "" : void 0,
|
|
801
|
+
disabled: r,
|
|
802
|
+
...n,
|
|
803
|
+
ref: f,
|
|
804
|
+
onPointerDown: A(e.onPointerDown, (C) => {
|
|
805
|
+
!r && C.button === 0 && C.ctrlKey === !1 && (l.onMenuOpen(u.value), E || C.preventDefault());
|
|
806
|
+
}),
|
|
807
|
+
onPointerEnter: A(e.onPointerEnter, () => {
|
|
808
|
+
var v;
|
|
809
|
+
!!l.value && !E && (l.onMenuOpen(u.value), (v = d.current) == null || v.focus());
|
|
810
|
+
}),
|
|
811
|
+
onKeyDown: A(e.onKeyDown, (C) => {
|
|
812
|
+
r || (["Enter", " "].includes(C.key) && l.onMenuToggle(u.value), C.key === "ArrowDown" && l.onMenuOpen(u.value), ["Enter", " ", "ArrowDown"].includes(C.key) && (u.wasKeyboardTriggerOpenRef.current = !0, C.preventDefault()));
|
|
813
|
+
}),
|
|
814
|
+
onFocus: A(e.onFocus, () => w(!0)),
|
|
815
|
+
onBlur: A(e.onBlur, () => w(!1))
|
|
816
|
+
}
|
|
817
|
+
) })
|
|
818
|
+
}
|
|
819
|
+
) });
|
|
820
|
+
}
|
|
821
|
+
);
|
|
822
|
+
oo.displayName = ct;
|
|
823
|
+
var Ua = "MenubarPortal", ro = (e) => {
|
|
824
|
+
const { __scopeMenubar: t, ...o } = e, r = z(t);
|
|
825
|
+
return /* @__PURE__ */ i(On, { ...r, ...o });
|
|
826
|
+
};
|
|
827
|
+
ro.displayName = Ua;
|
|
828
|
+
var lt = "MenubarContent", no = a.forwardRef(
|
|
829
|
+
(e, t) => {
|
|
830
|
+
const { __scopeMenubar: o, align: r = "start", ...n } = e, s = z(o), c = Jt(lt, o), l = Gr(lt, o), u = Ka(o), d = a.useRef(!1);
|
|
831
|
+
return /* @__PURE__ */ i(
|
|
832
|
+
Pn,
|
|
833
|
+
{
|
|
834
|
+
id: l.contentId,
|
|
835
|
+
"aria-labelledby": l.triggerId,
|
|
836
|
+
"data-radix-menubar-content": "",
|
|
837
|
+
...s,
|
|
838
|
+
...n,
|
|
839
|
+
ref: t,
|
|
840
|
+
align: r,
|
|
841
|
+
onCloseAutoFocus: A(e.onCloseAutoFocus, (f) => {
|
|
842
|
+
var w;
|
|
843
|
+
!!!c.value && !d.current && ((w = l.triggerRef.current) == null || w.focus()), d.current = !1, f.preventDefault();
|
|
844
|
+
}),
|
|
845
|
+
onFocusOutside: A(e.onFocusOutside, (f) => {
|
|
846
|
+
const b = f.target;
|
|
847
|
+
u().some((E) => {
|
|
848
|
+
var C;
|
|
849
|
+
return (C = E.ref.current) == null ? void 0 : C.contains(b);
|
|
850
|
+
}) && f.preventDefault();
|
|
851
|
+
}),
|
|
852
|
+
onInteractOutside: A(e.onInteractOutside, () => {
|
|
853
|
+
d.current = !0;
|
|
854
|
+
}),
|
|
855
|
+
onEntryFocus: (f) => {
|
|
856
|
+
l.wasKeyboardTriggerOpenRef.current || f.preventDefault();
|
|
857
|
+
},
|
|
858
|
+
onKeyDown: A(
|
|
859
|
+
e.onKeyDown,
|
|
860
|
+
(f) => {
|
|
861
|
+
if (["ArrowRight", "ArrowLeft"].includes(f.key)) {
|
|
862
|
+
const b = f.target, w = b.hasAttribute("data-radix-menubar-subtrigger"), E = b.closest("[data-radix-menubar-content]") !== f.currentTarget, v = (c.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === f.key;
|
|
863
|
+
if (!v && w || E && v) return;
|
|
864
|
+
let p = u().filter((R) => !R.disabled).map((R) => R.value);
|
|
865
|
+
v && p.reverse();
|
|
866
|
+
const g = p.indexOf(l.value);
|
|
867
|
+
p = c.loop ? ns(p, g + 1) : p.slice(g + 1);
|
|
868
|
+
const [y] = p;
|
|
869
|
+
y && c.onMenuOpen(y);
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
{ checkForDefaultPrevented: !1 }
|
|
873
|
+
),
|
|
874
|
+
style: {
|
|
875
|
+
...e.style,
|
|
876
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
877
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
878
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
879
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
880
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
no.displayName = lt;
|
|
887
|
+
var Wa = "MenubarGroup", ao = a.forwardRef(
|
|
888
|
+
(e, t) => {
|
|
889
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
890
|
+
return /* @__PURE__ */ i(xn, { ...n, ...r, ref: t });
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
ao.displayName = Wa;
|
|
894
|
+
var qa = "MenubarLabel", so = a.forwardRef(
|
|
895
|
+
(e, t) => {
|
|
896
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
897
|
+
return /* @__PURE__ */ i(Nn, { ...n, ...r, ref: t });
|
|
898
|
+
}
|
|
899
|
+
);
|
|
900
|
+
so.displayName = qa;
|
|
901
|
+
var Ya = "MenubarItem", io = a.forwardRef(
|
|
902
|
+
(e, t) => {
|
|
903
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
904
|
+
return /* @__PURE__ */ i(Sn, { ...n, ...r, ref: t });
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
io.displayName = Ya;
|
|
908
|
+
var Xa = "MenubarCheckboxItem", co = a.forwardRef(
|
|
909
|
+
(e, t) => {
|
|
910
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
911
|
+
return /* @__PURE__ */ i(Mn, { ...n, ...r, ref: t });
|
|
912
|
+
}
|
|
913
|
+
);
|
|
914
|
+
co.displayName = Xa;
|
|
915
|
+
var Za = "MenubarRadioGroup", lo = a.forwardRef(
|
|
916
|
+
(e, t) => {
|
|
917
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
918
|
+
return /* @__PURE__ */ i(Dn, { ...n, ...r, ref: t });
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
lo.displayName = Za;
|
|
922
|
+
var Ja = "MenubarRadioItem", uo = a.forwardRef(
|
|
923
|
+
(e, t) => {
|
|
924
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
925
|
+
return /* @__PURE__ */ i(Ln, { ...n, ...r, ref: t });
|
|
926
|
+
}
|
|
927
|
+
);
|
|
928
|
+
uo.displayName = Ja;
|
|
929
|
+
var Qa = "MenubarItemIndicator", fo = a.forwardRef((e, t) => {
|
|
930
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
931
|
+
return /* @__PURE__ */ i(An, { ...n, ...r, ref: t });
|
|
932
|
+
});
|
|
933
|
+
fo.displayName = Qa;
|
|
934
|
+
var es = "MenubarSeparator", po = a.forwardRef(
|
|
935
|
+
(e, t) => {
|
|
936
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
937
|
+
return /* @__PURE__ */ i(kn, { ...n, ...r, ref: t });
|
|
938
|
+
}
|
|
939
|
+
);
|
|
940
|
+
po.displayName = es;
|
|
941
|
+
var ts = "MenubarArrow", vo = a.forwardRef(
|
|
942
|
+
(e, t) => {
|
|
943
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
944
|
+
return /* @__PURE__ */ i(In, { ...n, ...r, ref: t });
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
vo.displayName = ts;
|
|
948
|
+
var $r = "MenubarSub", mo = (e) => {
|
|
949
|
+
const { __scopeMenubar: t, children: o, open: r, onOpenChange: n, defaultOpen: s } = e, c = z(t), [l, u] = X({
|
|
950
|
+
prop: r,
|
|
951
|
+
defaultProp: s ?? !1,
|
|
952
|
+
onChange: n,
|
|
953
|
+
caller: $r
|
|
954
|
+
});
|
|
955
|
+
return /* @__PURE__ */ i(Vn, { ...c, open: l, onOpenChange: u, children: o });
|
|
956
|
+
};
|
|
957
|
+
mo.displayName = $r;
|
|
958
|
+
var os = "MenubarSubTrigger", go = a.forwardRef(
|
|
959
|
+
(e, t) => {
|
|
960
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
961
|
+
return /* @__PURE__ */ i(
|
|
962
|
+
$n,
|
|
963
|
+
{
|
|
964
|
+
"data-radix-menubar-subtrigger": "",
|
|
965
|
+
...n,
|
|
966
|
+
...r,
|
|
967
|
+
ref: t
|
|
968
|
+
}
|
|
969
|
+
);
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
go.displayName = os;
|
|
973
|
+
var rs = "MenubarSubContent", bo = a.forwardRef(
|
|
974
|
+
(e, t) => {
|
|
975
|
+
const { __scopeMenubar: o, ...r } = e, n = z(o);
|
|
976
|
+
return /* @__PURE__ */ i(
|
|
977
|
+
Gn,
|
|
978
|
+
{
|
|
979
|
+
...n,
|
|
980
|
+
"data-radix-menubar-content": "",
|
|
981
|
+
...r,
|
|
982
|
+
ref: t,
|
|
983
|
+
style: {
|
|
984
|
+
...e.style,
|
|
985
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
986
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
987
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
988
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
989
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
);
|
|
993
|
+
}
|
|
994
|
+
);
|
|
995
|
+
bo.displayName = rs;
|
|
996
|
+
function ns(e, t) {
|
|
997
|
+
return e.map((o, r) => e[(t + r) % e.length]);
|
|
998
|
+
}
|
|
999
|
+
var as = Qt, ss = to, is = oo, cs = ro, ls = no, us = ao, ds = so, fs = io, ps = co, vs = lo, ms = uo, gs = fo, bs = po, Cs = vo, hs = mo, Ts = go, ws = bo;
|
|
1000
|
+
const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1001
|
+
__proto__: null,
|
|
1002
|
+
Arrow: Cs,
|
|
1003
|
+
CheckboxItem: ps,
|
|
1004
|
+
Content: ls,
|
|
1005
|
+
Group: us,
|
|
1006
|
+
Item: fs,
|
|
1007
|
+
ItemIndicator: gs,
|
|
1008
|
+
Label: ds,
|
|
1009
|
+
Menu: ss,
|
|
1010
|
+
Menubar: Qt,
|
|
1011
|
+
MenubarArrow: vo,
|
|
1012
|
+
MenubarCheckboxItem: co,
|
|
1013
|
+
MenubarContent: no,
|
|
1014
|
+
MenubarGroup: ao,
|
|
1015
|
+
MenubarItem: io,
|
|
1016
|
+
MenubarItemIndicator: fo,
|
|
1017
|
+
MenubarLabel: so,
|
|
1018
|
+
MenubarMenu: to,
|
|
1019
|
+
MenubarPortal: ro,
|
|
1020
|
+
MenubarRadioGroup: lo,
|
|
1021
|
+
MenubarRadioItem: uo,
|
|
1022
|
+
MenubarSeparator: po,
|
|
1023
|
+
MenubarSub: mo,
|
|
1024
|
+
MenubarSubContent: bo,
|
|
1025
|
+
MenubarSubTrigger: go,
|
|
1026
|
+
MenubarTrigger: oo,
|
|
1027
|
+
Portal: cs,
|
|
1028
|
+
RadioGroup: vs,
|
|
1029
|
+
RadioItem: ms,
|
|
1030
|
+
Root: as,
|
|
1031
|
+
Separator: bs,
|
|
1032
|
+
Sub: hs,
|
|
1033
|
+
SubContent: ws,
|
|
1034
|
+
SubTrigger: Ts,
|
|
1035
|
+
Trigger: is,
|
|
1036
|
+
createMenubarScope: Ha
|
|
1037
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1038
|
+
var pe = "NavigationMenu", [Co, Kr, ys] = Pe(pe), [ut, Es, Rs] = Pe(pe), [ho, _s] = oe(
|
|
1039
|
+
pe,
|
|
1040
|
+
[ys, Rs]
|
|
1041
|
+
), [Is, Q] = ho(pe), [Ms, Ps] = ho(pe), To = a.forwardRef(
|
|
1042
|
+
(e, t) => {
|
|
1043
|
+
const {
|
|
1044
|
+
__scopeNavigationMenu: o,
|
|
1045
|
+
value: r,
|
|
1046
|
+
onValueChange: n,
|
|
1047
|
+
defaultValue: s,
|
|
1048
|
+
delayDuration: c = 200,
|
|
1049
|
+
skipDelayDuration: l = 300,
|
|
1050
|
+
orientation: u = "horizontal",
|
|
1051
|
+
dir: d,
|
|
1052
|
+
...f
|
|
1053
|
+
} = e, [b, w] = a.useState(null), E = K(t, (I) => w(I)), C = he(d), v = a.useRef(0), m = a.useRef(0), h = a.useRef(0), [p, g] = a.useState(!0), [y, R] = X({
|
|
1054
|
+
prop: r,
|
|
1055
|
+
onChange: (I) => {
|
|
1056
|
+
const T = I !== "", _ = l > 0;
|
|
1057
|
+
T ? (window.clearTimeout(h.current), _ && g(!1)) : (window.clearTimeout(h.current), h.current = window.setTimeout(
|
|
1058
|
+
() => g(!0),
|
|
1059
|
+
l
|
|
1060
|
+
)), n == null || n(I);
|
|
1061
|
+
},
|
|
1062
|
+
defaultProp: s ?? "",
|
|
1063
|
+
caller: pe
|
|
1064
|
+
}), P = a.useCallback(() => {
|
|
1065
|
+
window.clearTimeout(m.current), m.current = window.setTimeout(() => R(""), 150);
|
|
1066
|
+
}, [R]), D = a.useCallback(
|
|
1067
|
+
(I) => {
|
|
1068
|
+
window.clearTimeout(m.current), R(I);
|
|
1069
|
+
},
|
|
1070
|
+
[R]
|
|
1071
|
+
), F = a.useCallback(
|
|
1072
|
+
(I) => {
|
|
1073
|
+
y === I ? window.clearTimeout(m.current) : v.current = window.setTimeout(() => {
|
|
1074
|
+
window.clearTimeout(m.current), R(I);
|
|
1075
|
+
}, c);
|
|
1076
|
+
},
|
|
1077
|
+
[y, R, c]
|
|
1078
|
+
);
|
|
1079
|
+
return a.useEffect(() => () => {
|
|
1080
|
+
window.clearTimeout(v.current), window.clearTimeout(m.current), window.clearTimeout(h.current);
|
|
1081
|
+
}, []), /* @__PURE__ */ i(
|
|
1082
|
+
Br,
|
|
1083
|
+
{
|
|
1084
|
+
scope: o,
|
|
1085
|
+
isRootMenu: !0,
|
|
1086
|
+
value: y,
|
|
1087
|
+
dir: C,
|
|
1088
|
+
orientation: u,
|
|
1089
|
+
rootNavigationMenu: b,
|
|
1090
|
+
onTriggerEnter: (I) => {
|
|
1091
|
+
window.clearTimeout(v.current), p ? F(I) : D(I);
|
|
1092
|
+
},
|
|
1093
|
+
onTriggerLeave: () => {
|
|
1094
|
+
window.clearTimeout(v.current), P();
|
|
1095
|
+
},
|
|
1096
|
+
onContentEnter: () => window.clearTimeout(m.current),
|
|
1097
|
+
onContentLeave: P,
|
|
1098
|
+
onItemSelect: (I) => {
|
|
1099
|
+
R((T) => T === I ? "" : I);
|
|
1100
|
+
},
|
|
1101
|
+
onItemDismiss: () => R(""),
|
|
1102
|
+
children: /* @__PURE__ */ i(
|
|
1103
|
+
O.nav,
|
|
1104
|
+
{
|
|
1105
|
+
"aria-label": "Main",
|
|
1106
|
+
"data-orientation": u,
|
|
1107
|
+
dir: C,
|
|
1108
|
+
...f,
|
|
1109
|
+
ref: E
|
|
1110
|
+
}
|
|
1111
|
+
)
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
To.displayName = pe;
|
|
1117
|
+
var dt = "NavigationMenuSub", wo = a.forwardRef(
|
|
1118
|
+
(e, t) => {
|
|
1119
|
+
const {
|
|
1120
|
+
__scopeNavigationMenu: o,
|
|
1121
|
+
value: r,
|
|
1122
|
+
onValueChange: n,
|
|
1123
|
+
defaultValue: s,
|
|
1124
|
+
orientation: c = "horizontal",
|
|
1125
|
+
...l
|
|
1126
|
+
} = e, u = Q(dt, o), [d, f] = X({
|
|
1127
|
+
prop: r,
|
|
1128
|
+
onChange: n,
|
|
1129
|
+
defaultProp: s ?? "",
|
|
1130
|
+
caller: dt
|
|
1131
|
+
});
|
|
1132
|
+
return /* @__PURE__ */ i(
|
|
1133
|
+
Br,
|
|
1134
|
+
{
|
|
1135
|
+
scope: o,
|
|
1136
|
+
isRootMenu: !1,
|
|
1137
|
+
value: d,
|
|
1138
|
+
dir: u.dir,
|
|
1139
|
+
orientation: c,
|
|
1140
|
+
rootNavigationMenu: u.rootNavigationMenu,
|
|
1141
|
+
onTriggerEnter: (b) => f(b),
|
|
1142
|
+
onItemSelect: (b) => f(b),
|
|
1143
|
+
onItemDismiss: () => f(""),
|
|
1144
|
+
children: /* @__PURE__ */ i(O.div, { "data-orientation": c, ...l, ref: t })
|
|
1145
|
+
}
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
);
|
|
1149
|
+
wo.displayName = dt;
|
|
1150
|
+
var Br = (e) => {
|
|
1151
|
+
const {
|
|
1152
|
+
scope: t,
|
|
1153
|
+
isRootMenu: o,
|
|
1154
|
+
rootNavigationMenu: r,
|
|
1155
|
+
dir: n,
|
|
1156
|
+
orientation: s,
|
|
1157
|
+
children: c,
|
|
1158
|
+
value: l,
|
|
1159
|
+
onItemSelect: u,
|
|
1160
|
+
onItemDismiss: d,
|
|
1161
|
+
onTriggerEnter: f,
|
|
1162
|
+
onTriggerLeave: b,
|
|
1163
|
+
onContentEnter: w,
|
|
1164
|
+
onContentLeave: E
|
|
1165
|
+
} = e, [C, v] = a.useState(null), [m, h] = a.useState(/* @__PURE__ */ new Map()), [p, g] = a.useState(null);
|
|
1166
|
+
return /* @__PURE__ */ i(
|
|
1167
|
+
Is,
|
|
1168
|
+
{
|
|
1169
|
+
scope: t,
|
|
1170
|
+
isRootMenu: o,
|
|
1171
|
+
rootNavigationMenu: r,
|
|
1172
|
+
value: l,
|
|
1173
|
+
previousValue: jn(l),
|
|
1174
|
+
baseId: te(),
|
|
1175
|
+
dir: n,
|
|
1176
|
+
orientation: s,
|
|
1177
|
+
viewport: C,
|
|
1178
|
+
onViewportChange: v,
|
|
1179
|
+
indicatorTrack: p,
|
|
1180
|
+
onIndicatorTrackChange: g,
|
|
1181
|
+
onTriggerEnter: ee(f),
|
|
1182
|
+
onTriggerLeave: ee(b),
|
|
1183
|
+
onContentEnter: ee(w),
|
|
1184
|
+
onContentLeave: ee(E),
|
|
1185
|
+
onItemSelect: ee(u),
|
|
1186
|
+
onItemDismiss: ee(d),
|
|
1187
|
+
onViewportContentChange: a.useCallback((y, R) => {
|
|
1188
|
+
h((P) => (P.set(y, R), new Map(P)));
|
|
1189
|
+
}, []),
|
|
1190
|
+
onViewportContentRemove: a.useCallback((y) => {
|
|
1191
|
+
h((R) => R.has(y) ? (R.delete(y), new Map(R)) : R);
|
|
1192
|
+
}, []),
|
|
1193
|
+
children: /* @__PURE__ */ i(Co.Provider, { scope: t, children: /* @__PURE__ */ i(Ms, { scope: t, items: m, children: c }) })
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
1196
|
+
}, Hr = "NavigationMenuList", yo = a.forwardRef(
|
|
1197
|
+
(e, t) => {
|
|
1198
|
+
const { __scopeNavigationMenu: o, ...r } = e, n = Q(Hr, o), s = /* @__PURE__ */ i(O.ul, { "data-orientation": n.orientation, ...r, ref: t });
|
|
1199
|
+
return /* @__PURE__ */ i(O.div, { style: { position: "relative" }, ref: n.onIndicatorTrackChange, children: /* @__PURE__ */ i(Co.Slot, { scope: o, children: n.isRootMenu ? /* @__PURE__ */ i(Wr, { asChild: !0, children: s }) : s }) });
|
|
1200
|
+
}
|
|
1201
|
+
);
|
|
1202
|
+
yo.displayName = Hr;
|
|
1203
|
+
var jr = "NavigationMenuItem", [xs, zr] = ho(jr), Eo = a.forwardRef(
|
|
1204
|
+
(e, t) => {
|
|
1205
|
+
const { __scopeNavigationMenu: o, value: r, ...n } = e, s = te(), c = r || s || "LEGACY_REACT_AUTO_VALUE", l = a.useRef(null), u = a.useRef(null), d = a.useRef(null), f = a.useRef(() => {
|
|
1206
|
+
}), b = a.useRef(!1), w = a.useCallback((C = "start") => {
|
|
1207
|
+
if (l.current) {
|
|
1208
|
+
f.current();
|
|
1209
|
+
const v = pt(l.current);
|
|
1210
|
+
v.length && Ao(C === "start" ? v : v.reverse());
|
|
1211
|
+
}
|
|
1212
|
+
}, []), E = a.useCallback(() => {
|
|
1213
|
+
if (l.current) {
|
|
1214
|
+
const C = pt(l.current);
|
|
1215
|
+
C.length && (f.current = Ls(C));
|
|
1216
|
+
}
|
|
1217
|
+
}, []);
|
|
1218
|
+
return /* @__PURE__ */ i(
|
|
1219
|
+
xs,
|
|
1220
|
+
{
|
|
1221
|
+
scope: o,
|
|
1222
|
+
value: c,
|
|
1223
|
+
triggerRef: u,
|
|
1224
|
+
contentRef: l,
|
|
1225
|
+
focusProxyRef: d,
|
|
1226
|
+
wasEscapeCloseRef: b,
|
|
1227
|
+
onEntryKeyDown: w,
|
|
1228
|
+
onFocusProxyEnter: w,
|
|
1229
|
+
onRootContentClose: E,
|
|
1230
|
+
onContentFocusOutside: E,
|
|
1231
|
+
children: /* @__PURE__ */ i(O.li, { ...n, ref: t })
|
|
1232
|
+
}
|
|
1233
|
+
);
|
|
1234
|
+
}
|
|
1235
|
+
);
|
|
1236
|
+
Eo.displayName = jr;
|
|
1237
|
+
var ft = "NavigationMenuTrigger", Ro = a.forwardRef((e, t) => {
|
|
1238
|
+
const { __scopeNavigationMenu: o, disabled: r, ...n } = e, s = Q(ft, e.__scopeNavigationMenu), c = zr(ft, e.__scopeNavigationMenu), l = a.useRef(null), u = K(l, c.triggerRef, t), d = Yr(s.baseId, c.value), f = Xr(s.baseId, c.value), b = a.useRef(!1), w = a.useRef(!1), E = c.value === s.value;
|
|
1239
|
+
return /* @__PURE__ */ Ie(_e, { children: [
|
|
1240
|
+
/* @__PURE__ */ i(Co.ItemSlot, { scope: o, value: c.value, children: /* @__PURE__ */ i(qr, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1241
|
+
O.button,
|
|
1242
|
+
{
|
|
1243
|
+
id: d,
|
|
1244
|
+
disabled: r,
|
|
1245
|
+
"data-disabled": r ? "" : void 0,
|
|
1246
|
+
"data-state": No(E),
|
|
1247
|
+
"aria-expanded": E,
|
|
1248
|
+
"aria-controls": f,
|
|
1249
|
+
...n,
|
|
1250
|
+
ref: u,
|
|
1251
|
+
onPointerEnter: A(e.onPointerEnter, () => {
|
|
1252
|
+
w.current = !1, c.wasEscapeCloseRef.current = !1;
|
|
1253
|
+
}),
|
|
1254
|
+
onPointerMove: A(
|
|
1255
|
+
e.onPointerMove,
|
|
1256
|
+
Ve(() => {
|
|
1257
|
+
r || w.current || c.wasEscapeCloseRef.current || b.current || (s.onTriggerEnter(c.value), b.current = !0);
|
|
1258
|
+
})
|
|
1259
|
+
),
|
|
1260
|
+
onPointerLeave: A(
|
|
1261
|
+
e.onPointerLeave,
|
|
1262
|
+
Ve(() => {
|
|
1263
|
+
r || (s.onTriggerLeave(), b.current = !1);
|
|
1264
|
+
})
|
|
1265
|
+
),
|
|
1266
|
+
onClick: A(e.onClick, () => {
|
|
1267
|
+
s.onItemSelect(c.value), w.current = E;
|
|
1268
|
+
}),
|
|
1269
|
+
onKeyDown: A(e.onKeyDown, (C) => {
|
|
1270
|
+
const m = { horizontal: "ArrowDown", vertical: s.dir === "rtl" ? "ArrowLeft" : "ArrowRight" }[s.orientation];
|
|
1271
|
+
E && C.key === m && (c.onEntryKeyDown(), C.preventDefault());
|
|
1272
|
+
})
|
|
1273
|
+
}
|
|
1274
|
+
) }) }),
|
|
1275
|
+
E && /* @__PURE__ */ Ie(_e, { children: [
|
|
1276
|
+
/* @__PURE__ */ i(
|
|
1277
|
+
Bn,
|
|
1278
|
+
{
|
|
1279
|
+
"aria-hidden": !0,
|
|
1280
|
+
tabIndex: 0,
|
|
1281
|
+
ref: c.focusProxyRef,
|
|
1282
|
+
onFocus: (C) => {
|
|
1283
|
+
const v = c.contentRef.current, m = C.relatedTarget, h = m === l.current, p = v == null ? void 0 : v.contains(m);
|
|
1284
|
+
(h || !p) && c.onFocusProxyEnter(h ? "start" : "end");
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
),
|
|
1288
|
+
s.viewport && /* @__PURE__ */ i("span", { "aria-owns": f })
|
|
1289
|
+
] })
|
|
1290
|
+
] });
|
|
1291
|
+
});
|
|
1292
|
+
Ro.displayName = ft;
|
|
1293
|
+
var Ss = "NavigationMenuLink", ur = "navigationMenu.linkSelect", _o = a.forwardRef(
|
|
1294
|
+
(e, t) => {
|
|
1295
|
+
const { __scopeNavigationMenu: o, active: r, onSelect: n, ...s } = e;
|
|
1296
|
+
return /* @__PURE__ */ i(qr, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1297
|
+
O.a,
|
|
1298
|
+
{
|
|
1299
|
+
"data-active": r ? "" : void 0,
|
|
1300
|
+
"aria-current": r ? "page" : void 0,
|
|
1301
|
+
...s,
|
|
1302
|
+
ref: t,
|
|
1303
|
+
onClick: A(
|
|
1304
|
+
e.onClick,
|
|
1305
|
+
(c) => {
|
|
1306
|
+
const l = c.target, u = new CustomEvent(ur, {
|
|
1307
|
+
bubbles: !0,
|
|
1308
|
+
cancelable: !0
|
|
1309
|
+
});
|
|
1310
|
+
if (l.addEventListener(ur, (d) => n == null ? void 0 : n(d), { once: !0 }), rt(l, u), !u.defaultPrevented && !c.metaKey) {
|
|
1311
|
+
const d = new CustomEvent(Le, {
|
|
1312
|
+
bubbles: !0,
|
|
1313
|
+
cancelable: !0
|
|
1314
|
+
});
|
|
1315
|
+
rt(l, d);
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
{ checkForDefaultPrevented: !1 }
|
|
1319
|
+
)
|
|
1320
|
+
}
|
|
1321
|
+
) });
|
|
1322
|
+
}
|
|
1323
|
+
);
|
|
1324
|
+
_o.displayName = Ss;
|
|
1325
|
+
var Io = "NavigationMenuIndicator", Mo = a.forwardRef((e, t) => {
|
|
1326
|
+
const { forceMount: o, ...r } = e, n = Q(Io, e.__scopeNavigationMenu), s = !!n.value;
|
|
1327
|
+
return n.indicatorTrack ? Qn.createPortal(
|
|
1328
|
+
/* @__PURE__ */ i(Ce, { present: o || s, children: /* @__PURE__ */ i(As, { ...r, ref: t }) }),
|
|
1329
|
+
n.indicatorTrack
|
|
1330
|
+
) : null;
|
|
1331
|
+
});
|
|
1332
|
+
Mo.displayName = Io;
|
|
1333
|
+
var As = a.forwardRef((e, t) => {
|
|
1334
|
+
const { __scopeNavigationMenu: o, ...r } = e, n = Q(Io, o), s = Kr(o), [c, l] = a.useState(
|
|
1335
|
+
null
|
|
1336
|
+
), [u, d] = a.useState(null), f = n.orientation === "horizontal", b = !!n.value;
|
|
1337
|
+
a.useEffect(() => {
|
|
1338
|
+
var v;
|
|
1339
|
+
const C = (v = s().find((m) => m.value === n.value)) == null ? void 0 : v.ref.current;
|
|
1340
|
+
C && l(C);
|
|
1341
|
+
}, [s, n.value]);
|
|
1342
|
+
const w = () => {
|
|
1343
|
+
c && d({
|
|
1344
|
+
size: f ? c.offsetWidth : c.offsetHeight,
|
|
1345
|
+
offset: f ? c.offsetLeft : c.offsetTop
|
|
1346
|
+
});
|
|
1347
|
+
};
|
|
1348
|
+
return vt(c, w), vt(n.indicatorTrack, w), u ? /* @__PURE__ */ i(
|
|
1349
|
+
O.div,
|
|
1350
|
+
{
|
|
1351
|
+
"aria-hidden": !0,
|
|
1352
|
+
"data-state": b ? "visible" : "hidden",
|
|
1353
|
+
"data-orientation": n.orientation,
|
|
1354
|
+
...r,
|
|
1355
|
+
ref: t,
|
|
1356
|
+
style: {
|
|
1357
|
+
position: "absolute",
|
|
1358
|
+
...f ? {
|
|
1359
|
+
left: 0,
|
|
1360
|
+
width: u.size + "px",
|
|
1361
|
+
transform: `translateX(${u.offset}px)`
|
|
1362
|
+
} : {
|
|
1363
|
+
top: 0,
|
|
1364
|
+
height: u.size + "px",
|
|
1365
|
+
transform: `translateY(${u.offset}px)`
|
|
1366
|
+
},
|
|
1367
|
+
...r.style
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
) : null;
|
|
1371
|
+
}), be = "NavigationMenuContent", Po = a.forwardRef((e, t) => {
|
|
1372
|
+
const { forceMount: o, ...r } = e, n = Q(be, e.__scopeNavigationMenu), s = zr(be, e.__scopeNavigationMenu), c = K(s.contentRef, t), l = s.value === n.value, u = {
|
|
1373
|
+
value: s.value,
|
|
1374
|
+
triggerRef: s.triggerRef,
|
|
1375
|
+
focusProxyRef: s.focusProxyRef,
|
|
1376
|
+
wasEscapeCloseRef: s.wasEscapeCloseRef,
|
|
1377
|
+
onContentFocusOutside: s.onContentFocusOutside,
|
|
1378
|
+
onRootContentClose: s.onRootContentClose,
|
|
1379
|
+
...r
|
|
1380
|
+
};
|
|
1381
|
+
return n.viewport ? /* @__PURE__ */ i(Ns, { forceMount: o, ...u, ref: c }) : /* @__PURE__ */ i(Ce, { present: o || l, children: /* @__PURE__ */ i(
|
|
1382
|
+
Ur,
|
|
1383
|
+
{
|
|
1384
|
+
"data-state": No(l),
|
|
1385
|
+
...u,
|
|
1386
|
+
ref: c,
|
|
1387
|
+
onPointerEnter: A(e.onPointerEnter, n.onContentEnter),
|
|
1388
|
+
onPointerLeave: A(
|
|
1389
|
+
e.onPointerLeave,
|
|
1390
|
+
Ve(n.onContentLeave)
|
|
1391
|
+
),
|
|
1392
|
+
style: {
|
|
1393
|
+
// Prevent interaction when animating out
|
|
1394
|
+
pointerEvents: !l && n.isRootMenu ? "none" : void 0,
|
|
1395
|
+
...u.style
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
) });
|
|
1399
|
+
});
|
|
1400
|
+
Po.displayName = be;
|
|
1401
|
+
var Ns = a.forwardRef((e, t) => {
|
|
1402
|
+
const o = Q(be, e.__scopeNavigationMenu), { onViewportContentChange: r, onViewportContentRemove: n } = o;
|
|
1403
|
+
return ge(() => {
|
|
1404
|
+
r(e.value, {
|
|
1405
|
+
ref: t,
|
|
1406
|
+
...e
|
|
1407
|
+
});
|
|
1408
|
+
}, [e, t, r]), ge(() => () => n(e.value), [e.value, n]), null;
|
|
1409
|
+
}), Le = "navigationMenu.rootContentDismiss", Ur = a.forwardRef((e, t) => {
|
|
1410
|
+
const {
|
|
1411
|
+
__scopeNavigationMenu: o,
|
|
1412
|
+
value: r,
|
|
1413
|
+
triggerRef: n,
|
|
1414
|
+
focusProxyRef: s,
|
|
1415
|
+
wasEscapeCloseRef: c,
|
|
1416
|
+
onRootContentClose: l,
|
|
1417
|
+
onContentFocusOutside: u,
|
|
1418
|
+
...d
|
|
1419
|
+
} = e, f = Q(be, o), b = a.useRef(null), w = K(b, t), E = Yr(f.baseId, r), C = Xr(f.baseId, r), v = Kr(o), m = a.useRef(null), { onItemDismiss: h } = f;
|
|
1420
|
+
a.useEffect(() => {
|
|
1421
|
+
const g = b.current;
|
|
1422
|
+
if (f.isRootMenu && g) {
|
|
1423
|
+
const y = () => {
|
|
1424
|
+
var R;
|
|
1425
|
+
h(), l(), g.contains(document.activeElement) && ((R = n.current) == null || R.focus());
|
|
1426
|
+
};
|
|
1427
|
+
return g.addEventListener(Le, y), () => g.removeEventListener(Le, y);
|
|
1428
|
+
}
|
|
1429
|
+
}, [f.isRootMenu, e.value, n, h, l]);
|
|
1430
|
+
const p = a.useMemo(() => {
|
|
1431
|
+
const y = v().map((T) => T.value);
|
|
1432
|
+
f.dir === "rtl" && y.reverse();
|
|
1433
|
+
const R = y.indexOf(f.value), P = y.indexOf(f.previousValue), D = r === f.value, F = P === y.indexOf(r);
|
|
1434
|
+
if (!D && !F) return m.current;
|
|
1435
|
+
const I = (() => {
|
|
1436
|
+
if (R !== P) {
|
|
1437
|
+
if (D && P !== -1) return R > P ? "from-end" : "from-start";
|
|
1438
|
+
if (F && R !== -1) return R > P ? "to-start" : "to-end";
|
|
1439
|
+
}
|
|
1440
|
+
return null;
|
|
1441
|
+
})();
|
|
1442
|
+
return m.current = I, I;
|
|
1443
|
+
}, [f.previousValue, f.value, f.dir, v, r]);
|
|
1444
|
+
return /* @__PURE__ */ i(Wr, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1445
|
+
Hn,
|
|
1446
|
+
{
|
|
1447
|
+
id: C,
|
|
1448
|
+
"aria-labelledby": E,
|
|
1449
|
+
"data-motion": p,
|
|
1450
|
+
"data-orientation": f.orientation,
|
|
1451
|
+
...d,
|
|
1452
|
+
ref: w,
|
|
1453
|
+
disableOutsidePointerEvents: !1,
|
|
1454
|
+
onDismiss: () => {
|
|
1455
|
+
var y;
|
|
1456
|
+
const g = new Event(Le, {
|
|
1457
|
+
bubbles: !0,
|
|
1458
|
+
cancelable: !0
|
|
1459
|
+
});
|
|
1460
|
+
(y = b.current) == null || y.dispatchEvent(g);
|
|
1461
|
+
},
|
|
1462
|
+
onFocusOutside: A(e.onFocusOutside, (g) => {
|
|
1463
|
+
var R;
|
|
1464
|
+
u();
|
|
1465
|
+
const y = g.target;
|
|
1466
|
+
(R = f.rootNavigationMenu) != null && R.contains(y) && g.preventDefault();
|
|
1467
|
+
}),
|
|
1468
|
+
onPointerDownOutside: A(e.onPointerDownOutside, (g) => {
|
|
1469
|
+
var D;
|
|
1470
|
+
const y = g.target, R = v().some((F) => {
|
|
1471
|
+
var I;
|
|
1472
|
+
return (I = F.ref.current) == null ? void 0 : I.contains(y);
|
|
1473
|
+
}), P = f.isRootMenu && ((D = f.viewport) == null ? void 0 : D.contains(y));
|
|
1474
|
+
(R || P || !f.isRootMenu) && g.preventDefault();
|
|
1475
|
+
}),
|
|
1476
|
+
onKeyDown: A(e.onKeyDown, (g) => {
|
|
1477
|
+
var P;
|
|
1478
|
+
const y = g.altKey || g.ctrlKey || g.metaKey;
|
|
1479
|
+
if (g.key === "Tab" && !y) {
|
|
1480
|
+
const D = pt(g.currentTarget), F = document.activeElement, I = D.findIndex((x) => x === F), _ = g.shiftKey ? D.slice(0, I).reverse() : D.slice(I + 1, D.length);
|
|
1481
|
+
Ao(_) ? g.preventDefault() : (P = s.current) == null || P.focus();
|
|
1482
|
+
}
|
|
1483
|
+
}),
|
|
1484
|
+
onEscapeKeyDown: A(e.onEscapeKeyDown, (g) => {
|
|
1485
|
+
c.current = !0;
|
|
1486
|
+
})
|
|
1487
|
+
}
|
|
1488
|
+
) });
|
|
1489
|
+
}), xo = "NavigationMenuViewport", So = a.forwardRef((e, t) => {
|
|
1490
|
+
const { forceMount: o, ...r } = e, s = !!Q(xo, e.__scopeNavigationMenu).value;
|
|
1491
|
+
return /* @__PURE__ */ i(Ce, { present: o || s, children: /* @__PURE__ */ i(Fs, { ...r, ref: t }) });
|
|
1492
|
+
});
|
|
1493
|
+
So.displayName = xo;
|
|
1494
|
+
var Fs = a.forwardRef((e, t) => {
|
|
1495
|
+
const { __scopeNavigationMenu: o, children: r, ...n } = e, s = Q(xo, o), c = K(t, s.onViewportChange), l = Ps(
|
|
1496
|
+
be,
|
|
1497
|
+
e.__scopeNavigationMenu
|
|
1498
|
+
), [u, d] = a.useState(null), [f, b] = a.useState(null), w = u ? (u == null ? void 0 : u.width) + "px" : void 0, E = u ? (u == null ? void 0 : u.height) + "px" : void 0, C = !!s.value, v = C ? s.value : s.previousValue;
|
|
1499
|
+
return vt(f, () => {
|
|
1500
|
+
f && d({ width: f.offsetWidth, height: f.offsetHeight });
|
|
1501
|
+
}), /* @__PURE__ */ i(
|
|
1502
|
+
O.div,
|
|
1503
|
+
{
|
|
1504
|
+
"data-state": No(C),
|
|
1505
|
+
"data-orientation": s.orientation,
|
|
1506
|
+
...n,
|
|
1507
|
+
ref: c,
|
|
1508
|
+
style: {
|
|
1509
|
+
// Prevent interaction when animating out
|
|
1510
|
+
pointerEvents: !C && s.isRootMenu ? "none" : void 0,
|
|
1511
|
+
"--radix-navigation-menu-viewport-width": w,
|
|
1512
|
+
"--radix-navigation-menu-viewport-height": E,
|
|
1513
|
+
...n.style
|
|
1514
|
+
},
|
|
1515
|
+
onPointerEnter: A(e.onPointerEnter, s.onContentEnter),
|
|
1516
|
+
onPointerLeave: A(e.onPointerLeave, Ve(s.onContentLeave)),
|
|
1517
|
+
children: Array.from(l.items).map(([h, { ref: p, forceMount: g, ...y }]) => {
|
|
1518
|
+
const R = v === h;
|
|
1519
|
+
return /* @__PURE__ */ i(Ce, { present: g || R, children: /* @__PURE__ */ i(
|
|
1520
|
+
Ur,
|
|
1521
|
+
{
|
|
1522
|
+
...y,
|
|
1523
|
+
ref: zn(p, (P) => {
|
|
1524
|
+
R && P && b(P);
|
|
1525
|
+
})
|
|
1526
|
+
}
|
|
1527
|
+
) }, h);
|
|
1528
|
+
})
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
}), Os = "FocusGroup", Wr = a.forwardRef(
|
|
1532
|
+
(e, t) => {
|
|
1533
|
+
const { __scopeNavigationMenu: o, ...r } = e, n = Q(Os, o);
|
|
1534
|
+
return /* @__PURE__ */ i(ut.Provider, { scope: o, children: /* @__PURE__ */ i(ut.Slot, { scope: o, children: /* @__PURE__ */ i(O.div, { dir: n.dir, ...r, ref: t }) }) });
|
|
1535
|
+
}
|
|
1536
|
+
), dr = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"], Ds = "FocusGroupItem", qr = a.forwardRef(
|
|
1537
|
+
(e, t) => {
|
|
1538
|
+
const { __scopeNavigationMenu: o, ...r } = e, n = Es(o), s = Q(Ds, o);
|
|
1539
|
+
return /* @__PURE__ */ i(ut.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
1540
|
+
O.button,
|
|
1541
|
+
{
|
|
1542
|
+
...r,
|
|
1543
|
+
ref: t,
|
|
1544
|
+
onKeyDown: A(e.onKeyDown, (c) => {
|
|
1545
|
+
if (["Home", "End", ...dr].includes(c.key)) {
|
|
1546
|
+
let u = n().map((b) => b.ref.current);
|
|
1547
|
+
if ([s.dir === "rtl" ? "ArrowRight" : "ArrowLeft", "ArrowUp", "End"].includes(c.key) && u.reverse(), dr.includes(c.key)) {
|
|
1548
|
+
const b = u.indexOf(c.currentTarget);
|
|
1549
|
+
u = u.slice(b + 1);
|
|
1550
|
+
}
|
|
1551
|
+
setTimeout(() => Ao(u)), c.preventDefault();
|
|
1552
|
+
}
|
|
1553
|
+
})
|
|
1554
|
+
}
|
|
1555
|
+
) });
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
function pt(e) {
|
|
1559
|
+
const t = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
1560
|
+
acceptNode: (r) => {
|
|
1561
|
+
const n = r.tagName === "INPUT" && r.type === "hidden";
|
|
1562
|
+
return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
1563
|
+
}
|
|
1564
|
+
});
|
|
1565
|
+
for (; o.nextNode(); ) t.push(o.currentNode);
|
|
1566
|
+
return t;
|
|
1567
|
+
}
|
|
1568
|
+
function Ao(e) {
|
|
1569
|
+
const t = document.activeElement;
|
|
1570
|
+
return e.some((o) => o === t ? !0 : (o.focus(), document.activeElement !== t));
|
|
1571
|
+
}
|
|
1572
|
+
function Ls(e) {
|
|
1573
|
+
return e.forEach((t) => {
|
|
1574
|
+
t.dataset.tabindex = t.getAttribute("tabindex") || "", t.setAttribute("tabindex", "-1");
|
|
1575
|
+
}), () => {
|
|
1576
|
+
e.forEach((t) => {
|
|
1577
|
+
const o = t.dataset.tabindex;
|
|
1578
|
+
t.setAttribute("tabindex", o);
|
|
1579
|
+
});
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
function vt(e, t) {
|
|
1583
|
+
const o = ee(t);
|
|
1584
|
+
ge(() => {
|
|
1585
|
+
let r = 0;
|
|
1586
|
+
if (e) {
|
|
1587
|
+
const n = new ResizeObserver(() => {
|
|
1588
|
+
cancelAnimationFrame(r), r = window.requestAnimationFrame(o);
|
|
1589
|
+
});
|
|
1590
|
+
return n.observe(e), () => {
|
|
1591
|
+
window.cancelAnimationFrame(r), n.unobserve(e);
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
}, [e, o]);
|
|
1595
|
+
}
|
|
1596
|
+
function No(e) {
|
|
1597
|
+
return e ? "open" : "closed";
|
|
1598
|
+
}
|
|
1599
|
+
function Yr(e, t) {
|
|
1600
|
+
return `${e}-trigger-${t}`;
|
|
1601
|
+
}
|
|
1602
|
+
function Xr(e, t) {
|
|
1603
|
+
return `${e}-content-${t}`;
|
|
1604
|
+
}
|
|
1605
|
+
function Ve(e) {
|
|
1606
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
1607
|
+
}
|
|
1608
|
+
var ks = To, Vs = wo, Gs = yo, $s = Eo, Ks = Ro, Bs = _o, Hs = Mo, js = Po, zs = So;
|
|
1609
|
+
const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1610
|
+
__proto__: null,
|
|
1611
|
+
Content: js,
|
|
1612
|
+
Indicator: Hs,
|
|
1613
|
+
Item: $s,
|
|
1614
|
+
Link: Bs,
|
|
1615
|
+
List: Gs,
|
|
1616
|
+
NavigationMenu: To,
|
|
1617
|
+
NavigationMenuContent: Po,
|
|
1618
|
+
NavigationMenuIndicator: Mo,
|
|
1619
|
+
NavigationMenuItem: Eo,
|
|
1620
|
+
NavigationMenuLink: _o,
|
|
1621
|
+
NavigationMenuList: yo,
|
|
1622
|
+
NavigationMenuSub: wo,
|
|
1623
|
+
NavigationMenuTrigger: Ro,
|
|
1624
|
+
NavigationMenuViewport: So,
|
|
1625
|
+
Root: ks,
|
|
1626
|
+
Sub: Vs,
|
|
1627
|
+
Trigger: Ks,
|
|
1628
|
+
Viewport: zs,
|
|
1629
|
+
createNavigationMenuScope: _s
|
|
1630
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1631
|
+
var Ge = {
|
|
1632
|
+
numeric: {
|
|
1633
|
+
type: "numeric",
|
|
1634
|
+
regexp: /[^\d]/g,
|
|
1635
|
+
pattern: "\\d{1}",
|
|
1636
|
+
inputMode: "numeric"
|
|
1637
|
+
},
|
|
1638
|
+
alpha: {
|
|
1639
|
+
type: "alpha",
|
|
1640
|
+
regexp: /[^a-zA-Z]/g,
|
|
1641
|
+
pattern: "[a-zA-Z]{1}",
|
|
1642
|
+
inputMode: "text"
|
|
1643
|
+
},
|
|
1644
|
+
alphanumeric: {
|
|
1645
|
+
type: "alphanumeric",
|
|
1646
|
+
regexp: /[^a-zA-Z0-9]/g,
|
|
1647
|
+
pattern: "[a-zA-Z0-9]{1}",
|
|
1648
|
+
inputMode: "text"
|
|
1649
|
+
},
|
|
1650
|
+
none: null
|
|
1651
|
+
}, Fo = "OneTimePasswordField", [mt, { useCollection: Us, createCollectionScope: Ws, useInitCollection: qs }] = Un(Fo), [Ys] = oe(Fo, [
|
|
1652
|
+
Ws,
|
|
1653
|
+
ue
|
|
1654
|
+
]), Zr = ue(), [Xs, Jr] = Ys(Fo), fr = a.forwardRef(
|
|
1655
|
+
function({
|
|
1656
|
+
__scopeOneTimePasswordField: t,
|
|
1657
|
+
defaultValue: o,
|
|
1658
|
+
value: r,
|
|
1659
|
+
onValueChange: n,
|
|
1660
|
+
autoSubmit: s = !1,
|
|
1661
|
+
children: c,
|
|
1662
|
+
onPaste: l,
|
|
1663
|
+
onAutoSubmit: u,
|
|
1664
|
+
disabled: d = !1,
|
|
1665
|
+
readOnly: f = !1,
|
|
1666
|
+
autoComplete: b = "one-time-code",
|
|
1667
|
+
autoFocus: w = !1,
|
|
1668
|
+
form: E,
|
|
1669
|
+
name: C,
|
|
1670
|
+
placeholder: v,
|
|
1671
|
+
type: m = "text",
|
|
1672
|
+
// TODO: Change default to vertical when inputs use vertical writing mode
|
|
1673
|
+
orientation: h = "horizontal",
|
|
1674
|
+
dir: p,
|
|
1675
|
+
validationType: g = "numeric",
|
|
1676
|
+
sanitizeValue: y,
|
|
1677
|
+
...R
|
|
1678
|
+
}, P) {
|
|
1679
|
+
var ye;
|
|
1680
|
+
const D = Zr(t), F = he(p), I = qs(), [T] = I, _ = Ge[g] ? Ge[g] : null, x = a.useCallback(
|
|
1681
|
+
(N) => {
|
|
1682
|
+
if (Array.isArray(N) ? N = N.map(mr).join("") : N = mr(N), _) {
|
|
1683
|
+
const B = new RegExp(_.regexp);
|
|
1684
|
+
N = N.replace(B, "");
|
|
1685
|
+
} else y && (N = y(N));
|
|
1686
|
+
return N.split("");
|
|
1687
|
+
},
|
|
1688
|
+
[_, y]
|
|
1689
|
+
), L = a.useMemo(() => r != null ? x(r) : void 0, [r, x]), [M, k] = X({
|
|
1690
|
+
caller: "OneTimePasswordField",
|
|
1691
|
+
prop: L,
|
|
1692
|
+
defaultProp: o != null ? x(o) : [],
|
|
1693
|
+
onChange: a.useCallback(
|
|
1694
|
+
(N) => n == null ? void 0 : n(N.join("")),
|
|
1695
|
+
[n]
|
|
1696
|
+
)
|
|
1697
|
+
}), G = Er((N) => {
|
|
1698
|
+
var B, Ee, tr, or, rr, nr, ar, sr, ir;
|
|
1699
|
+
switch (N.type) {
|
|
1700
|
+
case "SET_CHAR": {
|
|
1701
|
+
const { index: se, char: q } = N, J = (B = T.at(se)) == null ? void 0 : B.element;
|
|
1702
|
+
if (M[se] === q) {
|
|
1703
|
+
const le = J && ((Ee = T.from(J, 1)) == null ? void 0 : Ee.element);
|
|
1704
|
+
ie(le);
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
if (q === "")
|
|
1708
|
+
return;
|
|
1709
|
+
if (_) {
|
|
1710
|
+
const le = new RegExp(_.regexp);
|
|
1711
|
+
if (q.replace(le, "") !== q)
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
if (M.length >= T.size) {
|
|
1715
|
+
const le = [...M];
|
|
1716
|
+
le[se] = q, me(() => k(le));
|
|
1717
|
+
const Fe = J && ((tr = T.from(J, 1)) == null ? void 0 : tr.element);
|
|
1718
|
+
ie(Fe);
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
const ve = [...M];
|
|
1722
|
+
ve[se] = q;
|
|
1723
|
+
const et = (or = T.at(-1)) == null ? void 0 : or.element;
|
|
1724
|
+
if (me(() => k(ve)), J !== et) {
|
|
1725
|
+
const le = J && ((rr = T.from(J, 1)) == null ? void 0 : rr.element);
|
|
1726
|
+
ie(le);
|
|
1727
|
+
} else
|
|
1728
|
+
J == null || J.select();
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
case "CLEAR_CHAR": {
|
|
1732
|
+
const { index: se, reason: q } = N;
|
|
1733
|
+
if (!M[se])
|
|
1734
|
+
return;
|
|
1735
|
+
const J = M.filter((le, Fe) => Fe !== se), ve = (nr = T.at(se)) == null ? void 0 : nr.element, et = ve && ((ar = T.from(ve, -1)) == null ? void 0 : ar.element);
|
|
1736
|
+
me(() => k(J)), q === "Backspace" ? ie(et) : (q === "Delete" || q === "Cut") && ie(ve);
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
case "CLEAR": {
|
|
1740
|
+
if (M.length === 0)
|
|
1741
|
+
return;
|
|
1742
|
+
N.reason === "Backspace" || N.reason === "Delete" ? (me(() => k([])), ie((sr = T.at(0)) == null ? void 0 : sr.element)) : k([]);
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
case "PASTE": {
|
|
1746
|
+
const { value: se } = N, q = x(se);
|
|
1747
|
+
if (!q)
|
|
1748
|
+
return;
|
|
1749
|
+
me(() => k(q)), ie((ir = T.at(q.length - 1)) == null ? void 0 : ir.element);
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
}), Z = a.useRef(_);
|
|
1754
|
+
a.useEffect(() => {
|
|
1755
|
+
var N;
|
|
1756
|
+
_ && ((N = Z.current) == null ? void 0 : N.type) !== _.type && (Z.current = _, k(x(M.join(""))));
|
|
1757
|
+
}, [x, k, _, M]);
|
|
1758
|
+
const U = a.useRef(null), ne = a.useRef(null), Y = a.useRef(null), we = K(P, Y), ce = (ye = T.at(0)) == null ? void 0 : ye.element, W = a.useCallback(() => {
|
|
1759
|
+
var B;
|
|
1760
|
+
let N;
|
|
1761
|
+
if (E) {
|
|
1762
|
+
const Ee = (((B = Y.current) == null ? void 0 : B.ownerDocument) ?? document).getElementById(E);
|
|
1763
|
+
Zs(Ee) && (N = Ee);
|
|
1764
|
+
} else U.current ? N = U.current.form : ce && (N = ce.form);
|
|
1765
|
+
return N ?? null;
|
|
1766
|
+
}, [E, ce]), S = a.useCallback(() => {
|
|
1767
|
+
const N = W();
|
|
1768
|
+
N == null || N.requestSubmit();
|
|
1769
|
+
}, [W]);
|
|
1770
|
+
a.useEffect(() => {
|
|
1771
|
+
const N = W();
|
|
1772
|
+
if (N) {
|
|
1773
|
+
const B = () => G({ type: "CLEAR", reason: "Reset" });
|
|
1774
|
+
return N.addEventListener("reset", B), () => N.removeEventListener("reset", B);
|
|
1775
|
+
}
|
|
1776
|
+
}, [G, W]);
|
|
1777
|
+
const H = M.join(""), j = a.useRef(H), $ = T.size;
|
|
1778
|
+
a.useEffect(() => {
|
|
1779
|
+
const N = j.current;
|
|
1780
|
+
j.current = H, N !== H && s && M.every((B) => B !== "") && M.length === $ && (u == null || u(M.join("")), S());
|
|
1781
|
+
}, [S, s, H, $, u, M]);
|
|
1782
|
+
const ae = wr();
|
|
1783
|
+
return /* @__PURE__ */ i(
|
|
1784
|
+
Xs,
|
|
1785
|
+
{
|
|
1786
|
+
scope: t,
|
|
1787
|
+
value: M,
|
|
1788
|
+
attemptSubmit: S,
|
|
1789
|
+
disabled: d,
|
|
1790
|
+
readOnly: f,
|
|
1791
|
+
autoComplete: b,
|
|
1792
|
+
autoFocus: w,
|
|
1793
|
+
form: E,
|
|
1794
|
+
name: C,
|
|
1795
|
+
placeholder: v,
|
|
1796
|
+
type: m,
|
|
1797
|
+
hiddenInputRef: U,
|
|
1798
|
+
userActionRef: ne,
|
|
1799
|
+
dispatch: G,
|
|
1800
|
+
validationType: g,
|
|
1801
|
+
orientation: h,
|
|
1802
|
+
isHydrated: ae,
|
|
1803
|
+
sanitizeValue: x,
|
|
1804
|
+
children: /* @__PURE__ */ i(mt.Provider, { scope: t, state: I, children: /* @__PURE__ */ i(mt.Slot, { scope: t, children: /* @__PURE__ */ i(
|
|
1805
|
+
Be,
|
|
1806
|
+
{
|
|
1807
|
+
asChild: !0,
|
|
1808
|
+
...D,
|
|
1809
|
+
orientation: h,
|
|
1810
|
+
dir: F,
|
|
1811
|
+
children: /* @__PURE__ */ i(
|
|
1812
|
+
Tr.div,
|
|
1813
|
+
{
|
|
1814
|
+
...R,
|
|
1815
|
+
role: "group",
|
|
1816
|
+
ref: we,
|
|
1817
|
+
onPaste: A(
|
|
1818
|
+
l,
|
|
1819
|
+
(N) => {
|
|
1820
|
+
N.preventDefault();
|
|
1821
|
+
const B = N.clipboardData.getData("Text");
|
|
1822
|
+
G({ type: "PASTE", value: B });
|
|
1823
|
+
}
|
|
1824
|
+
),
|
|
1825
|
+
children: c
|
|
1826
|
+
}
|
|
1827
|
+
)
|
|
1828
|
+
}
|
|
1829
|
+
) }) })
|
|
1830
|
+
}
|
|
1831
|
+
);
|
|
1832
|
+
}
|
|
1833
|
+
), pr = a.forwardRef(function({ __scopeOneTimePasswordField: t, ...o }, r) {
|
|
1834
|
+
const { value: n, hiddenInputRef: s, name: c } = Jr(
|
|
1835
|
+
"OneTimePasswordFieldHiddenInput",
|
|
1836
|
+
t
|
|
1837
|
+
), l = K(s, r);
|
|
1838
|
+
return /* @__PURE__ */ i(
|
|
1839
|
+
"input",
|
|
1840
|
+
{
|
|
1841
|
+
ref: l,
|
|
1842
|
+
name: c,
|
|
1843
|
+
value: n.join("").trim(),
|
|
1844
|
+
autoComplete: "off",
|
|
1845
|
+
autoFocus: !1,
|
|
1846
|
+
autoCapitalize: "off",
|
|
1847
|
+
autoCorrect: "off",
|
|
1848
|
+
autoSave: "off",
|
|
1849
|
+
spellCheck: !1,
|
|
1850
|
+
...o,
|
|
1851
|
+
type: "hidden",
|
|
1852
|
+
readOnly: !0
|
|
1853
|
+
}
|
|
1854
|
+
);
|
|
1855
|
+
}), vr = a.forwardRef(function({
|
|
1856
|
+
__scopeOneTimePasswordField: t,
|
|
1857
|
+
onInvalidChange: o,
|
|
1858
|
+
index: r,
|
|
1859
|
+
...n
|
|
1860
|
+
}, s) {
|
|
1861
|
+
const {
|
|
1862
|
+
value: c,
|
|
1863
|
+
defaultValue: l,
|
|
1864
|
+
disabled: u,
|
|
1865
|
+
readOnly: d,
|
|
1866
|
+
autoComplete: f,
|
|
1867
|
+
autoFocus: b,
|
|
1868
|
+
form: w,
|
|
1869
|
+
name: E,
|
|
1870
|
+
placeholder: C,
|
|
1871
|
+
type: v,
|
|
1872
|
+
...m
|
|
1873
|
+
} = n, h = Jr(
|
|
1874
|
+
"OneTimePasswordFieldInput",
|
|
1875
|
+
t
|
|
1876
|
+
), { dispatch: p, userActionRef: g, validationType: y, isHydrated: R } = h, P = Us(t), D = Zr(t), F = a.useRef(null), [I, T] = a.useState(null), _ = r ?? (I ? P.indexOf(I) : -1), x = r != null || R;
|
|
1877
|
+
let L;
|
|
1878
|
+
x && h.placeholder && h.value.length === 0 && (L = h.placeholder[_]);
|
|
1879
|
+
const M = K(s, F, T), k = h.value[_] ?? "", G = a.useRef(null);
|
|
1880
|
+
a.useEffect(() => () => {
|
|
1881
|
+
window.clearTimeout(G.current);
|
|
1882
|
+
}, []);
|
|
1883
|
+
const Z = h.value.join("").trim(), U = Wn(Z.length, [0, P.size - 1]), ne = _ <= U, Y = y in Ge ? Ge[y] : void 0;
|
|
1884
|
+
return /* @__PURE__ */ i(mt.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
|
|
1885
|
+
xe,
|
|
1886
|
+
{
|
|
1887
|
+
...D,
|
|
1888
|
+
asChild: !0,
|
|
1889
|
+
focusable: !h.disabled && ne,
|
|
1890
|
+
active: _ === U,
|
|
1891
|
+
children: ({ hasTabStop: we, isCurrentTabStop: ce }) => {
|
|
1892
|
+
const W = we ? ce : _ === 0;
|
|
1893
|
+
return /* @__PURE__ */ i(
|
|
1894
|
+
Tr.input,
|
|
1895
|
+
{
|
|
1896
|
+
ref: M,
|
|
1897
|
+
type: h.type,
|
|
1898
|
+
"aria-label": `Character ${_ + 1} of ${P.size}`,
|
|
1899
|
+
autoComplete: W ? h.autoComplete : "off",
|
|
1900
|
+
"data-1p-ignore": W ? void 0 : "true",
|
|
1901
|
+
"data-lpignore": W ? void 0 : "true",
|
|
1902
|
+
"data-protonpass-ignore": W ? void 0 : "true",
|
|
1903
|
+
"data-bwignore": W ? void 0 : "true",
|
|
1904
|
+
inputMode: Y == null ? void 0 : Y.inputMode,
|
|
1905
|
+
maxLength: 1,
|
|
1906
|
+
pattern: Y == null ? void 0 : Y.pattern,
|
|
1907
|
+
readOnly: h.readOnly,
|
|
1908
|
+
value: k,
|
|
1909
|
+
placeholder: L,
|
|
1910
|
+
"data-radix-otp-input": "",
|
|
1911
|
+
"data-radix-index": _,
|
|
1912
|
+
...m,
|
|
1913
|
+
onFocus: A(n.onFocus, (S) => {
|
|
1914
|
+
S.currentTarget.select();
|
|
1915
|
+
}),
|
|
1916
|
+
onCut: A(n.onCut, (S) => {
|
|
1917
|
+
S.currentTarget.value !== "" && (g.current = {
|
|
1918
|
+
type: "cut"
|
|
1919
|
+
}, G.current = window.setTimeout(() => {
|
|
1920
|
+
g.current = null;
|
|
1921
|
+
}, 10));
|
|
1922
|
+
}),
|
|
1923
|
+
onInput: A(n.onInput, (S) => {
|
|
1924
|
+
const H = S.currentTarget.value;
|
|
1925
|
+
H.length > 1 && (S.preventDefault(), p({ type: "PASTE", value: H }));
|
|
1926
|
+
}),
|
|
1927
|
+
onChange: A(n.onChange, (S) => {
|
|
1928
|
+
const H = S.target.value;
|
|
1929
|
+
S.preventDefault();
|
|
1930
|
+
const j = g.current;
|
|
1931
|
+
if (g.current = null, j)
|
|
1932
|
+
switch (j.type) {
|
|
1933
|
+
case "cut":
|
|
1934
|
+
p({ type: "CLEAR_CHAR", index: _, reason: "Cut" });
|
|
1935
|
+
return;
|
|
1936
|
+
case "keydown": {
|
|
1937
|
+
if (j.key === "Char")
|
|
1938
|
+
return;
|
|
1939
|
+
const $ = j.key === "Backspace" && (j.metaKey || j.ctrlKey);
|
|
1940
|
+
j.key === "Clear" || $ ? p({ type: "CLEAR", reason: "Backspace" }) : p({ type: "CLEAR_CHAR", index: _, reason: j.key });
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
default:
|
|
1944
|
+
return;
|
|
1945
|
+
}
|
|
1946
|
+
if (S.target.validity.valid)
|
|
1947
|
+
if (H === "") {
|
|
1948
|
+
let $ = "Backspace";
|
|
1949
|
+
if (Js(S.nativeEvent)) {
|
|
1950
|
+
const ae = S.nativeEvent.inputType;
|
|
1951
|
+
ae === "deleteContentBackward" ? $ = "Backspace" : ae === "deleteByCut" && ($ = "Cut");
|
|
1952
|
+
}
|
|
1953
|
+
p({ type: "CLEAR_CHAR", index: _, reason: $ });
|
|
1954
|
+
} else
|
|
1955
|
+
p({ type: "SET_CHAR", char: H, index: _, event: S });
|
|
1956
|
+
else {
|
|
1957
|
+
const $ = S.target;
|
|
1958
|
+
o == null || o($.value), requestAnimationFrame(() => {
|
|
1959
|
+
$.ownerDocument.activeElement === $ && $.select();
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1962
|
+
}),
|
|
1963
|
+
onKeyDown: A(n.onKeyDown, (S) => {
|
|
1964
|
+
var H, j, $;
|
|
1965
|
+
switch (S.key) {
|
|
1966
|
+
case "Clear":
|
|
1967
|
+
case "Delete":
|
|
1968
|
+
case "Backspace": {
|
|
1969
|
+
if (S.currentTarget.value === "") {
|
|
1970
|
+
if (S.key === "Delete") return;
|
|
1971
|
+
if (S.key === "Clear" || S.metaKey || S.ctrlKey)
|
|
1972
|
+
p({ type: "CLEAR", reason: "Backspace" });
|
|
1973
|
+
else {
|
|
1974
|
+
const N = S.currentTarget;
|
|
1975
|
+
requestAnimationFrame(() => {
|
|
1976
|
+
var B;
|
|
1977
|
+
ie((B = P.from(N, -1)) == null ? void 0 : B.element);
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
} else
|
|
1981
|
+
g.current = {
|
|
1982
|
+
type: "keydown",
|
|
1983
|
+
key: S.key,
|
|
1984
|
+
metaKey: S.metaKey,
|
|
1985
|
+
ctrlKey: S.ctrlKey
|
|
1986
|
+
}, G.current = window.setTimeout(() => {
|
|
1987
|
+
g.current = null;
|
|
1988
|
+
}, 10);
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
case "Enter": {
|
|
1992
|
+
S.preventDefault(), h.attemptSubmit();
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1995
|
+
case "ArrowDown":
|
|
1996
|
+
case "ArrowUp": {
|
|
1997
|
+
h.orientation === "horizontal" && S.preventDefault();
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
default:
|
|
2001
|
+
if (S.currentTarget.value === S.key) {
|
|
2002
|
+
const ae = S.currentTarget;
|
|
2003
|
+
S.preventDefault(), ie((H = P.from(ae, 1)) == null ? void 0 : H.element);
|
|
2004
|
+
return;
|
|
2005
|
+
} else if (
|
|
2006
|
+
// input already has a value, but...
|
|
2007
|
+
S.currentTarget.value && // the value is not selected
|
|
2008
|
+
!(S.currentTarget.selectionStart === 0 && S.currentTarget.selectionEnd != null && S.currentTarget.selectionEnd > 0)
|
|
2009
|
+
) {
|
|
2010
|
+
const ae = S.key;
|
|
2011
|
+
if (S.key.length > 1 || S.key === " ")
|
|
2012
|
+
return;
|
|
2013
|
+
{
|
|
2014
|
+
const ye = (j = P.from(S.currentTarget, 1)) == null ? void 0 : j.element, N = ($ = P.at(-1)) == null ? void 0 : $.element;
|
|
2015
|
+
ye !== N && S.currentTarget !== N && (S.currentTarget.selectionStart === 0 ? p({ type: "SET_CHAR", char: ae, index: _, event: S }) : p({
|
|
2016
|
+
type: "SET_CHAR",
|
|
2017
|
+
char: ae,
|
|
2018
|
+
index: _ + 1,
|
|
2019
|
+
event: S
|
|
2020
|
+
}), g.current = {
|
|
2021
|
+
type: "keydown",
|
|
2022
|
+
key: "Char",
|
|
2023
|
+
metaKey: S.metaKey,
|
|
2024
|
+
ctrlKey: S.ctrlKey
|
|
2025
|
+
}, G.current = window.setTimeout(() => {
|
|
2026
|
+
g.current = null;
|
|
2027
|
+
}, 10));
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}),
|
|
2032
|
+
onPointerDown: A(n.onPointerDown, (S) => {
|
|
2033
|
+
var $;
|
|
2034
|
+
S.preventDefault();
|
|
2035
|
+
const H = Math.min(_, U), j = ($ = P.at(H)) == null ? void 0 : $.element;
|
|
2036
|
+
ie(j);
|
|
2037
|
+
})
|
|
2038
|
+
}
|
|
2039
|
+
);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
) });
|
|
2043
|
+
});
|
|
2044
|
+
function Zs(e) {
|
|
2045
|
+
return (e == null ? void 0 : e.tagName) === "FORM";
|
|
2046
|
+
}
|
|
2047
|
+
function mr(e) {
|
|
2048
|
+
return e.replace(/\s/g, "");
|
|
2049
|
+
}
|
|
2050
|
+
function ie(e) {
|
|
2051
|
+
e && (e.ownerDocument.activeElement === e ? window.requestAnimationFrame(() => {
|
|
2052
|
+
var t;
|
|
2053
|
+
(t = e.select) == null || t.call(e);
|
|
2054
|
+
}) : e.focus());
|
|
2055
|
+
}
|
|
2056
|
+
function Js(e) {
|
|
2057
|
+
return e.type === "input";
|
|
2058
|
+
}
|
|
2059
|
+
const lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2060
|
+
__proto__: null,
|
|
2061
|
+
HiddenInput: pr,
|
|
2062
|
+
Input: vr,
|
|
2063
|
+
OneTimePasswordField: fr,
|
|
2064
|
+
OneTimePasswordFieldHiddenInput: pr,
|
|
2065
|
+
OneTimePasswordFieldInput: vr,
|
|
2066
|
+
Root: fr
|
|
2067
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2068
|
+
var de = "PasswordToggleField", [Qs] = oe(de), [ei, qe] = Qs(de), Re = {
|
|
2069
|
+
clickTriggered: !1,
|
|
2070
|
+
selectionStart: null,
|
|
2071
|
+
selectionEnd: null
|
|
2072
|
+
}, gt = ({
|
|
2073
|
+
__scopePasswordToggleField: e,
|
|
2074
|
+
...t
|
|
2075
|
+
}) => {
|
|
2076
|
+
const r = `${te(t.id)}-input`, [n, s] = a.useState(r), c = n ?? r, l = a.useCallback(
|
|
2077
|
+
(m) => s(m != null ? String(m) : null),
|
|
2078
|
+
[]
|
|
2079
|
+
), { visible: u, defaultVisible: d, onVisiblityChange: f, children: b } = t, [w = !1, E] = X({
|
|
2080
|
+
caller: de,
|
|
2081
|
+
prop: u,
|
|
2082
|
+
defaultProp: d ?? !1,
|
|
2083
|
+
onChange: f
|
|
2084
|
+
}), C = a.useRef(null), v = a.useRef(Re);
|
|
2085
|
+
return /* @__PURE__ */ i(
|
|
2086
|
+
ei,
|
|
2087
|
+
{
|
|
2088
|
+
scope: e,
|
|
2089
|
+
inputId: c,
|
|
2090
|
+
inputRef: C,
|
|
2091
|
+
setVisible: E,
|
|
2092
|
+
syncInputId: l,
|
|
2093
|
+
visible: w,
|
|
2094
|
+
focusState: v,
|
|
2095
|
+
children: b
|
|
2096
|
+
}
|
|
2097
|
+
);
|
|
2098
|
+
};
|
|
2099
|
+
gt.displayName = de;
|
|
2100
|
+
var Qr = de + "Input", bt = a.forwardRef(
|
|
2101
|
+
({
|
|
2102
|
+
__scopePasswordToggleField: e,
|
|
2103
|
+
autoComplete: t = "current-password",
|
|
2104
|
+
autoCapitalize: o = "off",
|
|
2105
|
+
spellCheck: r = !1,
|
|
2106
|
+
id: n,
|
|
2107
|
+
...s
|
|
2108
|
+
}, c) => {
|
|
2109
|
+
const { visible: l, inputRef: u, inputId: d, syncInputId: f, setVisible: b, focusState: w } = qe(Qr, e);
|
|
2110
|
+
a.useEffect(() => {
|
|
2111
|
+
f(n);
|
|
2112
|
+
}, [n, f]);
|
|
2113
|
+
const E = Er(b);
|
|
2114
|
+
return a.useEffect(() => {
|
|
2115
|
+
const C = u.current, v = C == null ? void 0 : C.form;
|
|
2116
|
+
if (!v)
|
|
2117
|
+
return;
|
|
2118
|
+
const m = new AbortController();
|
|
2119
|
+
return v.addEventListener(
|
|
2120
|
+
"reset",
|
|
2121
|
+
(h) => {
|
|
2122
|
+
h.defaultPrevented || E(!1);
|
|
2123
|
+
},
|
|
2124
|
+
{ signal: m.signal }
|
|
2125
|
+
), v.addEventListener(
|
|
2126
|
+
"submit",
|
|
2127
|
+
() => {
|
|
2128
|
+
E(!1);
|
|
2129
|
+
},
|
|
2130
|
+
{ signal: m.signal }
|
|
2131
|
+
), () => {
|
|
2132
|
+
m.abort();
|
|
2133
|
+
};
|
|
2134
|
+
}, [u, E]), /* @__PURE__ */ i(
|
|
2135
|
+
O.input,
|
|
2136
|
+
{
|
|
2137
|
+
...s,
|
|
2138
|
+
id: n ?? d,
|
|
2139
|
+
autoCapitalize: o,
|
|
2140
|
+
autoComplete: t,
|
|
2141
|
+
ref: K(c, u),
|
|
2142
|
+
spellCheck: r,
|
|
2143
|
+
type: l ? "text" : "password",
|
|
2144
|
+
onBlur: A(s.onBlur, (C) => {
|
|
2145
|
+
const { selectionStart: v, selectionEnd: m } = C.currentTarget;
|
|
2146
|
+
w.current.selectionStart = v, w.current.selectionEnd = m;
|
|
2147
|
+
})
|
|
2148
|
+
}
|
|
2149
|
+
);
|
|
2150
|
+
}
|
|
2151
|
+
);
|
|
2152
|
+
bt.displayName = Qr;
|
|
2153
|
+
var en = de + "Toggle", Ct = a.forwardRef(
|
|
2154
|
+
({
|
|
2155
|
+
__scopePasswordToggleField: e,
|
|
2156
|
+
onClick: t,
|
|
2157
|
+
onPointerDown: o,
|
|
2158
|
+
onPointerCancel: r,
|
|
2159
|
+
onPointerUp: n,
|
|
2160
|
+
onFocus: s,
|
|
2161
|
+
children: c,
|
|
2162
|
+
"aria-label": l,
|
|
2163
|
+
"aria-controls": u,
|
|
2164
|
+
"aria-hidden": d,
|
|
2165
|
+
tabIndex: f,
|
|
2166
|
+
...b
|
|
2167
|
+
}, w) => {
|
|
2168
|
+
const { setVisible: E, visible: C, inputRef: v, inputId: m, focusState: h } = qe(
|
|
2169
|
+
en,
|
|
2170
|
+
e
|
|
2171
|
+
), [p, g] = a.useState(void 0), y = a.useRef(null), R = K(w, y), P = wr();
|
|
2172
|
+
a.useEffect(() => {
|
|
2173
|
+
const F = y.current;
|
|
2174
|
+
if (!F || l) {
|
|
2175
|
+
g(void 0);
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
const I = C ? "Hide password" : "Show password";
|
|
2179
|
+
function T(x) {
|
|
2180
|
+
g(x || void 0 ? void 0 : I);
|
|
2181
|
+
}
|
|
2182
|
+
T(F.textContent);
|
|
2183
|
+
const _ = new MutationObserver((x) => {
|
|
2184
|
+
let L;
|
|
2185
|
+
for (const M of x)
|
|
2186
|
+
M.type === "characterData" && F.textContent && (L = F.textContent);
|
|
2187
|
+
T(L);
|
|
2188
|
+
});
|
|
2189
|
+
return _.observe(F, { characterData: !0, subtree: !0 }), () => {
|
|
2190
|
+
_.disconnect();
|
|
2191
|
+
};
|
|
2192
|
+
}, [C, l]);
|
|
2193
|
+
const D = l || p;
|
|
2194
|
+
return P ? u ?? (u = m) : (d ?? (d = !0), f ?? (f = -1)), a.useEffect(() => {
|
|
2195
|
+
var x, L;
|
|
2196
|
+
let F = () => {
|
|
2197
|
+
};
|
|
2198
|
+
const I = ((L = (x = y.current) == null ? void 0 : x.ownerDocument) == null ? void 0 : L.defaultView) || window, T = () => h.current.clickTriggered = !1, _ = () => F = ti(I, T);
|
|
2199
|
+
return I.addEventListener("pointerup", _), () => {
|
|
2200
|
+
F(), I.removeEventListener("pointerup", _);
|
|
2201
|
+
};
|
|
2202
|
+
}, [h]), /* @__PURE__ */ i(
|
|
2203
|
+
O.button,
|
|
2204
|
+
{
|
|
2205
|
+
"aria-controls": u,
|
|
2206
|
+
"aria-hidden": d,
|
|
2207
|
+
"aria-label": D,
|
|
2208
|
+
ref: R,
|
|
2209
|
+
id: m,
|
|
2210
|
+
...b,
|
|
2211
|
+
onPointerDown: A(o, () => {
|
|
2212
|
+
h.current.clickTriggered = !0;
|
|
2213
|
+
}),
|
|
2214
|
+
onPointerCancel: (F) => {
|
|
2215
|
+
r == null || r(F), h.current = Re;
|
|
2216
|
+
},
|
|
2217
|
+
onClick: (F) => {
|
|
2218
|
+
if (t == null || t(F), F.defaultPrevented) {
|
|
2219
|
+
h.current = Re;
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
if (me(() => {
|
|
2223
|
+
E((I) => !I);
|
|
2224
|
+
}), h.current.clickTriggered) {
|
|
2225
|
+
const I = v.current;
|
|
2226
|
+
if (I) {
|
|
2227
|
+
const { selectionStart: T, selectionEnd: _ } = h.current;
|
|
2228
|
+
I.focus(), (T !== null || _ !== null) && requestAnimationFrame(() => {
|
|
2229
|
+
I.ownerDocument.activeElement === I && (I.selectionStart = T, I.selectionEnd = _);
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
h.current = Re;
|
|
2234
|
+
},
|
|
2235
|
+
onPointerUp: (F) => {
|
|
2236
|
+
n == null || n(F), setTimeout(() => {
|
|
2237
|
+
h.current = Re;
|
|
2238
|
+
}, 50);
|
|
2239
|
+
},
|
|
2240
|
+
type: "button",
|
|
2241
|
+
children: c
|
|
2242
|
+
}
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
);
|
|
2246
|
+
Ct.displayName = en;
|
|
2247
|
+
var tn = de + "Slot", ht = ({
|
|
2248
|
+
__scopePasswordToggleField: e,
|
|
2249
|
+
...t
|
|
2250
|
+
}) => {
|
|
2251
|
+
const { visible: o } = qe(
|
|
2252
|
+
tn,
|
|
2253
|
+
e
|
|
2254
|
+
);
|
|
2255
|
+
return "render" in t ? (
|
|
2256
|
+
//
|
|
2257
|
+
t.render({ visible: o })
|
|
2258
|
+
) : o ? t.visible : t.hidden;
|
|
2259
|
+
};
|
|
2260
|
+
ht.displayName = tn;
|
|
2261
|
+
var on = de + "Icon", Tt = a.forwardRef(
|
|
2262
|
+
({
|
|
2263
|
+
__scopePasswordToggleField: e,
|
|
2264
|
+
// @ts-expect-error
|
|
2265
|
+
children: t,
|
|
2266
|
+
...o
|
|
2267
|
+
}, r) => {
|
|
2268
|
+
const { visible: n } = qe(
|
|
2269
|
+
on,
|
|
2270
|
+
e
|
|
2271
|
+
), { visible: s, hidden: c, ...l } = o;
|
|
2272
|
+
return /* @__PURE__ */ i(O.svg, { ...l, ref: r, "aria-hidden": !0, asChild: !0, children: n ? s : c });
|
|
2273
|
+
}
|
|
2274
|
+
);
|
|
2275
|
+
Tt.displayName = on;
|
|
2276
|
+
function ti(e, t, o) {
|
|
2277
|
+
if (e.requestIdleCallback) {
|
|
2278
|
+
const s = e.requestIdleCallback(t, o);
|
|
2279
|
+
return () => {
|
|
2280
|
+
e.cancelIdleCallback(s);
|
|
2281
|
+
};
|
|
2282
|
+
}
|
|
2283
|
+
const r = Date.now(), n = e.setTimeout(() => {
|
|
2284
|
+
t({ didTimeout: !1, timeRemaining: () => Math.max(0, 50 - (Date.now() - r)) });
|
|
2285
|
+
}, 1);
|
|
2286
|
+
return () => {
|
|
2287
|
+
e.clearTimeout(n);
|
|
2288
|
+
};
|
|
2289
|
+
}
|
|
2290
|
+
const uc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2291
|
+
__proto__: null,
|
|
2292
|
+
Icon: Tt,
|
|
2293
|
+
Input: bt,
|
|
2294
|
+
PasswordToggleField: gt,
|
|
2295
|
+
PasswordToggleFieldIcon: Tt,
|
|
2296
|
+
PasswordToggleFieldInput: bt,
|
|
2297
|
+
PasswordToggleFieldSlot: ht,
|
|
2298
|
+
PasswordToggleFieldToggle: Ct,
|
|
2299
|
+
Root: gt,
|
|
2300
|
+
Slot: ht,
|
|
2301
|
+
Toggle: Ct
|
|
2302
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2303
|
+
var Oo = "Progress", Do = 100, [oi, ri] = oe(Oo), [ni, ai] = oi(Oo), Lo = a.forwardRef(
|
|
2304
|
+
(e, t) => {
|
|
2305
|
+
const {
|
|
2306
|
+
__scopeProgress: o,
|
|
2307
|
+
value: r = null,
|
|
2308
|
+
max: n,
|
|
2309
|
+
getValueLabel: s = si,
|
|
2310
|
+
...c
|
|
2311
|
+
} = e;
|
|
2312
|
+
(n || n === 0) && !gr(n) && console.error(ii(`${n}`, "Progress"));
|
|
2313
|
+
const l = gr(n) ? n : Do;
|
|
2314
|
+
r !== null && !br(r, l) && console.error(ci(`${r}`, "Progress"));
|
|
2315
|
+
const u = br(r, l) ? r : null, d = $e(u) ? s(u, l) : void 0;
|
|
2316
|
+
return /* @__PURE__ */ i(ni, { scope: o, value: u, max: l, children: /* @__PURE__ */ i(
|
|
2317
|
+
O.div,
|
|
2318
|
+
{
|
|
2319
|
+
"aria-valuemax": l,
|
|
2320
|
+
"aria-valuemin": 0,
|
|
2321
|
+
"aria-valuenow": $e(u) ? u : void 0,
|
|
2322
|
+
"aria-valuetext": d,
|
|
2323
|
+
role: "progressbar",
|
|
2324
|
+
"data-state": nn(u, l),
|
|
2325
|
+
"data-value": u ?? void 0,
|
|
2326
|
+
"data-max": l,
|
|
2327
|
+
...c,
|
|
2328
|
+
ref: t
|
|
2329
|
+
}
|
|
2330
|
+
) });
|
|
2331
|
+
}
|
|
2332
|
+
);
|
|
2333
|
+
Lo.displayName = Oo;
|
|
2334
|
+
var rn = "ProgressIndicator", ko = a.forwardRef(
|
|
2335
|
+
(e, t) => {
|
|
2336
|
+
const { __scopeProgress: o, ...r } = e, n = ai(rn, o);
|
|
2337
|
+
return /* @__PURE__ */ i(
|
|
2338
|
+
O.div,
|
|
2339
|
+
{
|
|
2340
|
+
"data-state": nn(n.value, n.max),
|
|
2341
|
+
"data-value": n.value ?? void 0,
|
|
2342
|
+
"data-max": n.max,
|
|
2343
|
+
...r,
|
|
2344
|
+
ref: t
|
|
2345
|
+
}
|
|
2346
|
+
);
|
|
2347
|
+
}
|
|
2348
|
+
);
|
|
2349
|
+
ko.displayName = rn;
|
|
2350
|
+
function si(e, t) {
|
|
2351
|
+
return `${Math.round(e / t * 100)}%`;
|
|
2352
|
+
}
|
|
2353
|
+
function nn(e, t) {
|
|
2354
|
+
return e == null ? "indeterminate" : e === t ? "complete" : "loading";
|
|
2355
|
+
}
|
|
2356
|
+
function $e(e) {
|
|
2357
|
+
return typeof e == "number";
|
|
2358
|
+
}
|
|
2359
|
+
function gr(e) {
|
|
2360
|
+
return $e(e) && !isNaN(e) && e > 0;
|
|
2361
|
+
}
|
|
2362
|
+
function br(e, t) {
|
|
2363
|
+
return $e(e) && !isNaN(e) && e <= t && e >= 0;
|
|
2364
|
+
}
|
|
2365
|
+
function ii(e, t) {
|
|
2366
|
+
return `Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Do}\`.`;
|
|
2367
|
+
}
|
|
2368
|
+
function ci(e, t) {
|
|
2369
|
+
return `Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2370
|
+
- a positive number
|
|
2371
|
+
- less than the value passed to \`max\` (or ${Do} if no \`max\` prop is set)
|
|
2372
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
2373
|
+
|
|
2374
|
+
Defaulting to \`null\`.`;
|
|
2375
|
+
}
|
|
2376
|
+
var li = Lo, ui = ko;
|
|
2377
|
+
const dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2378
|
+
__proto__: null,
|
|
2379
|
+
Indicator: ui,
|
|
2380
|
+
Progress: Lo,
|
|
2381
|
+
ProgressIndicator: ko,
|
|
2382
|
+
Root: li,
|
|
2383
|
+
createProgressScope: ri
|
|
2384
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2385
|
+
var Vo = "ToastProvider", [Go, di, fi] = Pe("Toast"), [an, pi] = oe("Toast", [fi]), [vi, Ye] = an(Vo), $o = (e) => {
|
|
2386
|
+
const {
|
|
2387
|
+
__scopeToast: t,
|
|
2388
|
+
label: o = "Notification",
|
|
2389
|
+
duration: r = 5e3,
|
|
2390
|
+
swipeDirection: n = "right",
|
|
2391
|
+
swipeThreshold: s = 50,
|
|
2392
|
+
children: c
|
|
2393
|
+
} = e, [l, u] = a.useState(null), [d, f] = a.useState(0), b = a.useRef(!1), w = a.useRef(!1);
|
|
2394
|
+
return o.trim() || console.error(
|
|
2395
|
+
`Invalid prop \`label\` supplied to \`${Vo}\`. Expected non-empty \`string\`.`
|
|
2396
|
+
), /* @__PURE__ */ i(Go.Provider, { scope: t, children: /* @__PURE__ */ i(
|
|
2397
|
+
vi,
|
|
2398
|
+
{
|
|
2399
|
+
scope: t,
|
|
2400
|
+
label: o,
|
|
2401
|
+
duration: r,
|
|
2402
|
+
swipeDirection: n,
|
|
2403
|
+
swipeThreshold: s,
|
|
2404
|
+
toastCount: d,
|
|
2405
|
+
viewport: l,
|
|
2406
|
+
onViewportChange: u,
|
|
2407
|
+
onToastAdd: a.useCallback(() => f((E) => E + 1), []),
|
|
2408
|
+
onToastRemove: a.useCallback(() => f((E) => E - 1), []),
|
|
2409
|
+
isFocusedToastEscapeKeyDownRef: b,
|
|
2410
|
+
isClosePausedRef: w,
|
|
2411
|
+
children: c
|
|
2412
|
+
}
|
|
2413
|
+
) });
|
|
2414
|
+
};
|
|
2415
|
+
$o.displayName = Vo;
|
|
2416
|
+
var sn = "ToastViewport", mi = ["F8"], wt = "toast.viewportPause", yt = "toast.viewportResume", Ko = a.forwardRef(
|
|
2417
|
+
(e, t) => {
|
|
2418
|
+
const {
|
|
2419
|
+
__scopeToast: o,
|
|
2420
|
+
hotkey: r = mi,
|
|
2421
|
+
label: n = "Notifications ({hotkey})",
|
|
2422
|
+
...s
|
|
2423
|
+
} = e, c = Ye(sn, o), l = di(o), u = a.useRef(null), d = a.useRef(null), f = a.useRef(null), b = a.useRef(null), w = K(t, b, c.onViewportChange), E = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), C = c.toastCount > 0;
|
|
2424
|
+
a.useEffect(() => {
|
|
2425
|
+
const m = (h) => {
|
|
2426
|
+
var g;
|
|
2427
|
+
r.length !== 0 && r.every((y) => h[y] || h.code === y) && ((g = b.current) == null || g.focus());
|
|
2428
|
+
};
|
|
2429
|
+
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
2430
|
+
}, [r]), a.useEffect(() => {
|
|
2431
|
+
const m = u.current, h = b.current;
|
|
2432
|
+
if (C && m && h) {
|
|
2433
|
+
const p = () => {
|
|
2434
|
+
if (!c.isClosePausedRef.current) {
|
|
2435
|
+
const P = new CustomEvent(wt);
|
|
2436
|
+
h.dispatchEvent(P), c.isClosePausedRef.current = !0;
|
|
2437
|
+
}
|
|
2438
|
+
}, g = () => {
|
|
2439
|
+
if (c.isClosePausedRef.current) {
|
|
2440
|
+
const P = new CustomEvent(yt);
|
|
2441
|
+
h.dispatchEvent(P), c.isClosePausedRef.current = !1;
|
|
2442
|
+
}
|
|
2443
|
+
}, y = (P) => {
|
|
2444
|
+
!m.contains(P.relatedTarget) && g();
|
|
2445
|
+
}, R = () => {
|
|
2446
|
+
m.contains(document.activeElement) || g();
|
|
2447
|
+
};
|
|
2448
|
+
return m.addEventListener("focusin", p), m.addEventListener("focusout", y), m.addEventListener("pointermove", p), m.addEventListener("pointerleave", R), window.addEventListener("blur", p), window.addEventListener("focus", g), () => {
|
|
2449
|
+
m.removeEventListener("focusin", p), m.removeEventListener("focusout", y), m.removeEventListener("pointermove", p), m.removeEventListener("pointerleave", R), window.removeEventListener("blur", p), window.removeEventListener("focus", g);
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
}, [C, c.isClosePausedRef]);
|
|
2453
|
+
const v = a.useCallback(
|
|
2454
|
+
({ tabbingDirection: m }) => {
|
|
2455
|
+
const p = l().map((g) => {
|
|
2456
|
+
const y = g.ref.current, R = [y, ...Pi(y)];
|
|
2457
|
+
return m === "forwards" ? R : R.reverse();
|
|
2458
|
+
});
|
|
2459
|
+
return (m === "forwards" ? p.reverse() : p).flat();
|
|
2460
|
+
},
|
|
2461
|
+
[l]
|
|
2462
|
+
);
|
|
2463
|
+
return a.useEffect(() => {
|
|
2464
|
+
const m = b.current;
|
|
2465
|
+
if (m) {
|
|
2466
|
+
const h = (p) => {
|
|
2467
|
+
var R, P, D;
|
|
2468
|
+
const g = p.altKey || p.ctrlKey || p.metaKey;
|
|
2469
|
+
if (p.key === "Tab" && !g) {
|
|
2470
|
+
const F = document.activeElement, I = p.shiftKey;
|
|
2471
|
+
if (p.target === m && I) {
|
|
2472
|
+
(R = d.current) == null || R.focus();
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
const x = v({ tabbingDirection: I ? "backwards" : "forwards" }), L = x.findIndex((M) => M === F);
|
|
2476
|
+
ot(x.slice(L + 1)) ? p.preventDefault() : I ? (P = d.current) == null || P.focus() : (D = f.current) == null || D.focus();
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
return m.addEventListener("keydown", h), () => m.removeEventListener("keydown", h);
|
|
2480
|
+
}
|
|
2481
|
+
}, [l, v]), /* @__PURE__ */ Ie(
|
|
2482
|
+
qn,
|
|
2483
|
+
{
|
|
2484
|
+
ref: u,
|
|
2485
|
+
role: "region",
|
|
2486
|
+
"aria-label": n.replace("{hotkey}", E),
|
|
2487
|
+
tabIndex: -1,
|
|
2488
|
+
style: { pointerEvents: C ? void 0 : "none" },
|
|
2489
|
+
children: [
|
|
2490
|
+
C && /* @__PURE__ */ i(
|
|
2491
|
+
Et,
|
|
2492
|
+
{
|
|
2493
|
+
ref: d,
|
|
2494
|
+
onFocusFromOutsideViewport: () => {
|
|
2495
|
+
const m = v({
|
|
2496
|
+
tabbingDirection: "forwards"
|
|
2497
|
+
});
|
|
2498
|
+
ot(m);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
),
|
|
2502
|
+
/* @__PURE__ */ i(Go.Slot, { scope: o, children: /* @__PURE__ */ i(O.ol, { tabIndex: -1, ...s, ref: w }) }),
|
|
2503
|
+
C && /* @__PURE__ */ i(
|
|
2504
|
+
Et,
|
|
2505
|
+
{
|
|
2506
|
+
ref: f,
|
|
2507
|
+
onFocusFromOutsideViewport: () => {
|
|
2508
|
+
const m = v({
|
|
2509
|
+
tabbingDirection: "backwards"
|
|
2510
|
+
});
|
|
2511
|
+
ot(m);
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
)
|
|
2515
|
+
]
|
|
2516
|
+
}
|
|
2517
|
+
);
|
|
2518
|
+
}
|
|
2519
|
+
);
|
|
2520
|
+
Ko.displayName = sn;
|
|
2521
|
+
var cn = "ToastFocusProxy", Et = a.forwardRef(
|
|
2522
|
+
(e, t) => {
|
|
2523
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: r, ...n } = e, s = Ye(cn, o);
|
|
2524
|
+
return /* @__PURE__ */ i(
|
|
2525
|
+
yr,
|
|
2526
|
+
{
|
|
2527
|
+
"aria-hidden": !0,
|
|
2528
|
+
tabIndex: 0,
|
|
2529
|
+
...n,
|
|
2530
|
+
ref: t,
|
|
2531
|
+
style: { position: "fixed" },
|
|
2532
|
+
onFocus: (c) => {
|
|
2533
|
+
var d;
|
|
2534
|
+
const l = c.relatedTarget;
|
|
2535
|
+
!((d = s.viewport) != null && d.contains(l)) && r();
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
);
|
|
2539
|
+
}
|
|
2540
|
+
);
|
|
2541
|
+
Et.displayName = cn;
|
|
2542
|
+
var Ne = "Toast", gi = "toast.swipeStart", bi = "toast.swipeMove", Ci = "toast.swipeCancel", hi = "toast.swipeEnd", Bo = a.forwardRef(
|
|
2543
|
+
(e, t) => {
|
|
2544
|
+
const { forceMount: o, open: r, defaultOpen: n, onOpenChange: s, ...c } = e, [l, u] = X({
|
|
2545
|
+
prop: r,
|
|
2546
|
+
defaultProp: n ?? !0,
|
|
2547
|
+
onChange: s,
|
|
2548
|
+
caller: Ne
|
|
2549
|
+
});
|
|
2550
|
+
return /* @__PURE__ */ i(Ce, { present: o || l, children: /* @__PURE__ */ i(
|
|
2551
|
+
yi,
|
|
2552
|
+
{
|
|
2553
|
+
open: l,
|
|
2554
|
+
...c,
|
|
2555
|
+
ref: t,
|
|
2556
|
+
onClose: () => u(!1),
|
|
2557
|
+
onPause: ee(e.onPause),
|
|
2558
|
+
onResume: ee(e.onResume),
|
|
2559
|
+
onSwipeStart: A(e.onSwipeStart, (d) => {
|
|
2560
|
+
d.currentTarget.setAttribute("data-swipe", "start");
|
|
2561
|
+
}),
|
|
2562
|
+
onSwipeMove: A(e.onSwipeMove, (d) => {
|
|
2563
|
+
const { x: f, y: b } = d.detail.delta;
|
|
2564
|
+
d.currentTarget.setAttribute("data-swipe", "move"), d.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${f}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${b}px`);
|
|
2565
|
+
}),
|
|
2566
|
+
onSwipeCancel: A(e.onSwipeCancel, (d) => {
|
|
2567
|
+
d.currentTarget.setAttribute("data-swipe", "cancel"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
2568
|
+
}),
|
|
2569
|
+
onSwipeEnd: A(e.onSwipeEnd, (d) => {
|
|
2570
|
+
const { x: f, y: b } = d.detail.delta;
|
|
2571
|
+
d.currentTarget.setAttribute("data-swipe", "end"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${f}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${b}px`), u(!1);
|
|
2572
|
+
})
|
|
2573
|
+
}
|
|
2574
|
+
) });
|
|
2575
|
+
}
|
|
2576
|
+
);
|
|
2577
|
+
Bo.displayName = Ne;
|
|
2578
|
+
var [Ti, wi] = an(Ne, {
|
|
2579
|
+
onClose() {
|
|
2580
|
+
}
|
|
2581
|
+
}), yi = a.forwardRef(
|
|
2582
|
+
(e, t) => {
|
|
2583
|
+
const {
|
|
2584
|
+
__scopeToast: o,
|
|
2585
|
+
type: r = "foreground",
|
|
2586
|
+
duration: n,
|
|
2587
|
+
open: s,
|
|
2588
|
+
onClose: c,
|
|
2589
|
+
onEscapeKeyDown: l,
|
|
2590
|
+
onPause: u,
|
|
2591
|
+
onResume: d,
|
|
2592
|
+
onSwipeStart: f,
|
|
2593
|
+
onSwipeMove: b,
|
|
2594
|
+
onSwipeCancel: w,
|
|
2595
|
+
onSwipeEnd: E,
|
|
2596
|
+
...C
|
|
2597
|
+
} = e, v = Ye(Ne, o), [m, h] = a.useState(null), p = K(t, (M) => h(M)), g = a.useRef(null), y = a.useRef(null), R = n || v.duration, P = a.useRef(0), D = a.useRef(R), F = a.useRef(0), { onToastAdd: I, onToastRemove: T } = v, _ = ee(() => {
|
|
2598
|
+
var k;
|
|
2599
|
+
(m == null ? void 0 : m.contains(document.activeElement)) && ((k = v.viewport) == null || k.focus()), c();
|
|
2600
|
+
}), x = a.useCallback(
|
|
2601
|
+
(M) => {
|
|
2602
|
+
!M || M === 1 / 0 || (window.clearTimeout(F.current), P.current = (/* @__PURE__ */ new Date()).getTime(), F.current = window.setTimeout(_, M));
|
|
2603
|
+
},
|
|
2604
|
+
[_]
|
|
2605
|
+
);
|
|
2606
|
+
a.useEffect(() => {
|
|
2607
|
+
const M = v.viewport;
|
|
2608
|
+
if (M) {
|
|
2609
|
+
const k = () => {
|
|
2610
|
+
x(D.current), d == null || d();
|
|
2611
|
+
}, G = () => {
|
|
2612
|
+
const Z = (/* @__PURE__ */ new Date()).getTime() - P.current;
|
|
2613
|
+
D.current = D.current - Z, window.clearTimeout(F.current), u == null || u();
|
|
2614
|
+
};
|
|
2615
|
+
return M.addEventListener(wt, G), M.addEventListener(yt, k), () => {
|
|
2616
|
+
M.removeEventListener(wt, G), M.removeEventListener(yt, k);
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
}, [v.viewport, R, u, d, x]), a.useEffect(() => {
|
|
2620
|
+
s && !v.isClosePausedRef.current && x(R);
|
|
2621
|
+
}, [s, R, v.isClosePausedRef, x]), a.useEffect(() => (I(), () => T()), [I, T]);
|
|
2622
|
+
const L = a.useMemo(() => m ? fn(m) : null, [m]);
|
|
2623
|
+
return v.viewport ? /* @__PURE__ */ Ie(_e, { children: [
|
|
2624
|
+
L && /* @__PURE__ */ i(
|
|
2625
|
+
Ei,
|
|
2626
|
+
{
|
|
2627
|
+
__scopeToast: o,
|
|
2628
|
+
role: "status",
|
|
2629
|
+
"aria-live": r === "foreground" ? "assertive" : "polite",
|
|
2630
|
+
"aria-atomic": !0,
|
|
2631
|
+
children: L
|
|
2632
|
+
}
|
|
2633
|
+
),
|
|
2634
|
+
/* @__PURE__ */ i(Ti, { scope: o, onClose: _, children: Jn.createPortal(
|
|
2635
|
+
/* @__PURE__ */ i(Go.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
2636
|
+
Yn,
|
|
2637
|
+
{
|
|
2638
|
+
asChild: !0,
|
|
2639
|
+
onEscapeKeyDown: A(l, () => {
|
|
2640
|
+
v.isFocusedToastEscapeKeyDownRef.current || _(), v.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
2641
|
+
}),
|
|
2642
|
+
children: /* @__PURE__ */ i(
|
|
2643
|
+
O.li,
|
|
2644
|
+
{
|
|
2645
|
+
role: "status",
|
|
2646
|
+
"aria-live": "off",
|
|
2647
|
+
"aria-atomic": !0,
|
|
2648
|
+
tabIndex: 0,
|
|
2649
|
+
"data-state": s ? "open" : "closed",
|
|
2650
|
+
"data-swipe-direction": v.swipeDirection,
|
|
2651
|
+
...C,
|
|
2652
|
+
ref: p,
|
|
2653
|
+
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
2654
|
+
onKeyDown: A(e.onKeyDown, (M) => {
|
|
2655
|
+
M.key === "Escape" && (l == null || l(M.nativeEvent), M.nativeEvent.defaultPrevented || (v.isFocusedToastEscapeKeyDownRef.current = !0, _()));
|
|
2656
|
+
}),
|
|
2657
|
+
onPointerDown: A(e.onPointerDown, (M) => {
|
|
2658
|
+
M.button === 0 && (g.current = { x: M.clientX, y: M.clientY });
|
|
2659
|
+
}),
|
|
2660
|
+
onPointerMove: A(e.onPointerMove, (M) => {
|
|
2661
|
+
if (!g.current) return;
|
|
2662
|
+
const k = M.clientX - g.current.x, G = M.clientY - g.current.y, Z = !!y.current, U = ["left", "right"].includes(v.swipeDirection), ne = ["left", "up"].includes(v.swipeDirection) ? Math.min : Math.max, Y = U ? ne(0, k) : 0, we = U ? 0 : ne(0, G), ce = M.pointerType === "touch" ? 10 : 2, W = { x: Y, y: we }, S = { originalEvent: M, delta: W };
|
|
2663
|
+
Z ? (y.current = W, Oe(bi, b, S, {
|
|
2664
|
+
discrete: !1
|
|
2665
|
+
})) : Cr(W, v.swipeDirection, ce) ? (y.current = W, Oe(gi, f, S, {
|
|
2666
|
+
discrete: !1
|
|
2667
|
+
}), M.target.setPointerCapture(M.pointerId)) : (Math.abs(k) > ce || Math.abs(G) > ce) && (g.current = null);
|
|
2668
|
+
}),
|
|
2669
|
+
onPointerUp: A(e.onPointerUp, (M) => {
|
|
2670
|
+
const k = y.current, G = M.target;
|
|
2671
|
+
if (G.hasPointerCapture(M.pointerId) && G.releasePointerCapture(M.pointerId), y.current = null, g.current = null, k) {
|
|
2672
|
+
const Z = M.currentTarget, U = { originalEvent: M, delta: k };
|
|
2673
|
+
Cr(k, v.swipeDirection, v.swipeThreshold) ? Oe(hi, E, U, {
|
|
2674
|
+
discrete: !0
|
|
2675
|
+
}) : Oe(
|
|
2676
|
+
Ci,
|
|
2677
|
+
w,
|
|
2678
|
+
U,
|
|
2679
|
+
{
|
|
2680
|
+
discrete: !0
|
|
2681
|
+
}
|
|
2682
|
+
), Z.addEventListener("click", (ne) => ne.preventDefault(), {
|
|
2683
|
+
once: !0
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
})
|
|
2687
|
+
}
|
|
2688
|
+
)
|
|
2689
|
+
}
|
|
2690
|
+
) }),
|
|
2691
|
+
v.viewport
|
|
2692
|
+
) })
|
|
2693
|
+
] }) : null;
|
|
2694
|
+
}
|
|
2695
|
+
), Ei = (e) => {
|
|
2696
|
+
const { __scopeToast: t, children: o, ...r } = e, n = Ye(Ne, t), [s, c] = a.useState(!1), [l, u] = a.useState(!1);
|
|
2697
|
+
return Ii(() => c(!0)), a.useEffect(() => {
|
|
2698
|
+
const d = window.setTimeout(() => u(!0), 1e3);
|
|
2699
|
+
return () => window.clearTimeout(d);
|
|
2700
|
+
}, []), l ? null : /* @__PURE__ */ i(Xn, { asChild: !0, children: /* @__PURE__ */ i(yr, { ...r, children: s && /* @__PURE__ */ Ie(_e, { children: [
|
|
2701
|
+
n.label,
|
|
2702
|
+
" ",
|
|
2703
|
+
o
|
|
2704
|
+
] }) }) });
|
|
2705
|
+
}, Ri = "ToastTitle", Ho = a.forwardRef(
|
|
2706
|
+
(e, t) => {
|
|
2707
|
+
const { __scopeToast: o, ...r } = e;
|
|
2708
|
+
return /* @__PURE__ */ i(O.div, { ...r, ref: t });
|
|
2709
|
+
}
|
|
2710
|
+
);
|
|
2711
|
+
Ho.displayName = Ri;
|
|
2712
|
+
var _i = "ToastDescription", jo = a.forwardRef(
|
|
2713
|
+
(e, t) => {
|
|
2714
|
+
const { __scopeToast: o, ...r } = e;
|
|
2715
|
+
return /* @__PURE__ */ i(O.div, { ...r, ref: t });
|
|
2716
|
+
}
|
|
2717
|
+
);
|
|
2718
|
+
jo.displayName = _i;
|
|
2719
|
+
var ln = "ToastAction", zo = a.forwardRef(
|
|
2720
|
+
(e, t) => {
|
|
2721
|
+
const { altText: o, ...r } = e;
|
|
2722
|
+
return o.trim() ? /* @__PURE__ */ i(dn, { altText: o, asChild: !0, children: /* @__PURE__ */ i(Xe, { ...r, ref: t }) }) : (console.error(
|
|
2723
|
+
`Invalid prop \`altText\` supplied to \`${ln}\`. Expected non-empty \`string\`.`
|
|
2724
|
+
), null);
|
|
2725
|
+
}
|
|
2726
|
+
);
|
|
2727
|
+
zo.displayName = ln;
|
|
2728
|
+
var un = "ToastClose", Xe = a.forwardRef(
|
|
2729
|
+
(e, t) => {
|
|
2730
|
+
const { __scopeToast: o, ...r } = e, n = wi(un, o);
|
|
2731
|
+
return /* @__PURE__ */ i(dn, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2732
|
+
O.button,
|
|
2733
|
+
{
|
|
2734
|
+
type: "button",
|
|
2735
|
+
...r,
|
|
2736
|
+
ref: t,
|
|
2737
|
+
onClick: A(e.onClick, n.onClose)
|
|
2738
|
+
}
|
|
2739
|
+
) });
|
|
2740
|
+
}
|
|
2741
|
+
);
|
|
2742
|
+
Xe.displayName = un;
|
|
2743
|
+
var dn = a.forwardRef((e, t) => {
|
|
2744
|
+
const { __scopeToast: o, altText: r, ...n } = e;
|
|
2745
|
+
return /* @__PURE__ */ i(
|
|
2746
|
+
O.div,
|
|
2747
|
+
{
|
|
2748
|
+
"data-radix-toast-announce-exclude": "",
|
|
2749
|
+
"data-radix-toast-announce-alt": r || void 0,
|
|
2750
|
+
...n,
|
|
2751
|
+
ref: t
|
|
2752
|
+
}
|
|
2753
|
+
);
|
|
2754
|
+
});
|
|
2755
|
+
function fn(e) {
|
|
2756
|
+
const t = [];
|
|
2757
|
+
return Array.from(e.childNodes).forEach((r) => {
|
|
2758
|
+
if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), Mi(r)) {
|
|
2759
|
+
const n = r.ariaHidden || r.hidden || r.style.display === "none", s = r.dataset.radixToastAnnounceExclude === "";
|
|
2760
|
+
if (!n)
|
|
2761
|
+
if (s) {
|
|
2762
|
+
const c = r.dataset.radixToastAnnounceAlt;
|
|
2763
|
+
c && t.push(c);
|
|
2764
|
+
} else
|
|
2765
|
+
t.push(...fn(r));
|
|
2766
|
+
}
|
|
2767
|
+
}), t;
|
|
2768
|
+
}
|
|
2769
|
+
function Oe(e, t, o, { discrete: r }) {
|
|
2770
|
+
const n = o.originalEvent.currentTarget, s = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
|
|
2771
|
+
t && n.addEventListener(e, t, { once: !0 }), r ? rt(n, s) : n.dispatchEvent(s);
|
|
2772
|
+
}
|
|
2773
|
+
var Cr = (e, t, o = 0) => {
|
|
2774
|
+
const r = Math.abs(e.x), n = Math.abs(e.y), s = r > n;
|
|
2775
|
+
return t === "left" || t === "right" ? s && r > o : !s && n > o;
|
|
2776
|
+
};
|
|
2777
|
+
function Ii(e = () => {
|
|
2778
|
+
}) {
|
|
2779
|
+
const t = ee(e);
|
|
2780
|
+
ge(() => {
|
|
2781
|
+
let o = 0, r = 0;
|
|
2782
|
+
return o = window.requestAnimationFrame(() => r = window.requestAnimationFrame(t)), () => {
|
|
2783
|
+
window.cancelAnimationFrame(o), window.cancelAnimationFrame(r);
|
|
2784
|
+
};
|
|
2785
|
+
}, [t]);
|
|
2786
|
+
}
|
|
2787
|
+
function Mi(e) {
|
|
2788
|
+
return e.nodeType === e.ELEMENT_NODE;
|
|
2789
|
+
}
|
|
2790
|
+
function Pi(e) {
|
|
2791
|
+
const t = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
2792
|
+
acceptNode: (r) => {
|
|
2793
|
+
const n = r.tagName === "INPUT" && r.type === "hidden";
|
|
2794
|
+
return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
2795
|
+
}
|
|
2796
|
+
});
|
|
2797
|
+
for (; o.nextNode(); ) t.push(o.currentNode);
|
|
2798
|
+
return t;
|
|
2799
|
+
}
|
|
2800
|
+
function ot(e) {
|
|
2801
|
+
const t = document.activeElement;
|
|
2802
|
+
return e.some((o) => o === t ? !0 : (o.focus(), document.activeElement !== t));
|
|
2803
|
+
}
|
|
2804
|
+
var xi = $o, Si = Ko, Ai = Bo, Ni = Ho, Fi = jo, Oi = zo, Di = Xe;
|
|
2805
|
+
const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2806
|
+
__proto__: null,
|
|
2807
|
+
Action: Oi,
|
|
2808
|
+
Close: Di,
|
|
2809
|
+
Description: Fi,
|
|
2810
|
+
Provider: xi,
|
|
2811
|
+
Root: Ai,
|
|
2812
|
+
Title: Ni,
|
|
2813
|
+
Toast: Bo,
|
|
2814
|
+
ToastAction: zo,
|
|
2815
|
+
ToastClose: Xe,
|
|
2816
|
+
ToastDescription: jo,
|
|
2817
|
+
ToastProvider: $o,
|
|
2818
|
+
ToastTitle: Ho,
|
|
2819
|
+
ToastViewport: Ko,
|
|
2820
|
+
Viewport: Si,
|
|
2821
|
+
createToastScope: pi
|
|
2822
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2823
|
+
var pn = "Toggle", Ze = a.forwardRef((e, t) => {
|
|
2824
|
+
const { pressed: o, defaultPressed: r, onPressedChange: n, ...s } = e, [c, l] = X({
|
|
2825
|
+
prop: o,
|
|
2826
|
+
onChange: n,
|
|
2827
|
+
defaultProp: r ?? !1,
|
|
2828
|
+
caller: pn
|
|
2829
|
+
});
|
|
2830
|
+
return /* @__PURE__ */ i(
|
|
2831
|
+
O.button,
|
|
2832
|
+
{
|
|
2833
|
+
type: "button",
|
|
2834
|
+
"aria-pressed": c,
|
|
2835
|
+
"data-state": c ? "on" : "off",
|
|
2836
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
2837
|
+
...s,
|
|
2838
|
+
ref: t,
|
|
2839
|
+
onClick: A(e.onClick, () => {
|
|
2840
|
+
e.disabled || l(!c);
|
|
2841
|
+
})
|
|
2842
|
+
}
|
|
2843
|
+
);
|
|
2844
|
+
});
|
|
2845
|
+
Ze.displayName = pn;
|
|
2846
|
+
var Li = Ze;
|
|
2847
|
+
const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2848
|
+
__proto__: null,
|
|
2849
|
+
Root: Li,
|
|
2850
|
+
Toggle: Ze
|
|
2851
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2852
|
+
var fe = "ToggleGroup", [vn, Uo] = oe(fe, [
|
|
2853
|
+
ue
|
|
2854
|
+
]), mn = ue(), Je = V.forwardRef((e, t) => {
|
|
2855
|
+
const { type: o, ...r } = e;
|
|
2856
|
+
if (o === "single")
|
|
2857
|
+
return /* @__PURE__ */ i(ki, { ...r, ref: t });
|
|
2858
|
+
if (o === "multiple")
|
|
2859
|
+
return /* @__PURE__ */ i(Vi, { ...r, ref: t });
|
|
2860
|
+
throw new Error(`Missing prop \`type\` expected on \`${fe}\``);
|
|
2861
|
+
});
|
|
2862
|
+
Je.displayName = fe;
|
|
2863
|
+
var [gn, bn] = vn(fe), ki = V.forwardRef((e, t) => {
|
|
2864
|
+
const {
|
|
2865
|
+
value: o,
|
|
2866
|
+
defaultValue: r,
|
|
2867
|
+
onValueChange: n = () => {
|
|
2868
|
+
},
|
|
2869
|
+
...s
|
|
2870
|
+
} = e, [c, l] = X({
|
|
2871
|
+
prop: o,
|
|
2872
|
+
defaultProp: r ?? "",
|
|
2873
|
+
onChange: n,
|
|
2874
|
+
caller: fe
|
|
2875
|
+
});
|
|
2876
|
+
return /* @__PURE__ */ i(
|
|
2877
|
+
gn,
|
|
2878
|
+
{
|
|
2879
|
+
scope: e.__scopeToggleGroup,
|
|
2880
|
+
type: "single",
|
|
2881
|
+
value: V.useMemo(() => c ? [c] : [], [c]),
|
|
2882
|
+
onItemActivate: l,
|
|
2883
|
+
onItemDeactivate: V.useCallback(() => l(""), [l]),
|
|
2884
|
+
children: /* @__PURE__ */ i(Cn, { ...s, ref: t })
|
|
2885
|
+
}
|
|
2886
|
+
);
|
|
2887
|
+
}), Vi = V.forwardRef((e, t) => {
|
|
2888
|
+
const {
|
|
2889
|
+
value: o,
|
|
2890
|
+
defaultValue: r,
|
|
2891
|
+
onValueChange: n = () => {
|
|
2892
|
+
},
|
|
2893
|
+
...s
|
|
2894
|
+
} = e, [c, l] = X({
|
|
2895
|
+
prop: o,
|
|
2896
|
+
defaultProp: r ?? [],
|
|
2897
|
+
onChange: n,
|
|
2898
|
+
caller: fe
|
|
2899
|
+
}), u = V.useCallback(
|
|
2900
|
+
(f) => l((b = []) => [...b, f]),
|
|
2901
|
+
[l]
|
|
2902
|
+
), d = V.useCallback(
|
|
2903
|
+
(f) => l((b = []) => b.filter((w) => w !== f)),
|
|
2904
|
+
[l]
|
|
2905
|
+
);
|
|
2906
|
+
return /* @__PURE__ */ i(
|
|
2907
|
+
gn,
|
|
2908
|
+
{
|
|
2909
|
+
scope: e.__scopeToggleGroup,
|
|
2910
|
+
type: "multiple",
|
|
2911
|
+
value: c,
|
|
2912
|
+
onItemActivate: u,
|
|
2913
|
+
onItemDeactivate: d,
|
|
2914
|
+
children: /* @__PURE__ */ i(Cn, { ...s, ref: t })
|
|
2915
|
+
}
|
|
2916
|
+
);
|
|
2917
|
+
});
|
|
2918
|
+
Je.displayName = fe;
|
|
2919
|
+
var [Gi, $i] = vn(fe), Cn = V.forwardRef(
|
|
2920
|
+
(e, t) => {
|
|
2921
|
+
const {
|
|
2922
|
+
__scopeToggleGroup: o,
|
|
2923
|
+
disabled: r = !1,
|
|
2924
|
+
rovingFocus: n = !0,
|
|
2925
|
+
orientation: s,
|
|
2926
|
+
dir: c,
|
|
2927
|
+
loop: l = !0,
|
|
2928
|
+
...u
|
|
2929
|
+
} = e, d = mn(o), f = he(c), b = { role: "group", dir: f, ...u };
|
|
2930
|
+
return /* @__PURE__ */ i(Gi, { scope: o, rovingFocus: n, disabled: r, children: n ? /* @__PURE__ */ i(
|
|
2931
|
+
Be,
|
|
2932
|
+
{
|
|
2933
|
+
asChild: !0,
|
|
2934
|
+
...d,
|
|
2935
|
+
orientation: s,
|
|
2936
|
+
dir: f,
|
|
2937
|
+
loop: l,
|
|
2938
|
+
children: /* @__PURE__ */ i(O.div, { ...b, ref: t })
|
|
2939
|
+
}
|
|
2940
|
+
) : /* @__PURE__ */ i(O.div, { ...b, ref: t }) });
|
|
2941
|
+
}
|
|
2942
|
+
), Ke = "ToggleGroupItem", Wo = V.forwardRef(
|
|
2943
|
+
(e, t) => {
|
|
2944
|
+
const o = bn(Ke, e.__scopeToggleGroup), r = $i(Ke, e.__scopeToggleGroup), n = mn(e.__scopeToggleGroup), s = o.value.includes(e.value), c = r.disabled || e.disabled, l = { ...e, pressed: s, disabled: c }, u = V.useRef(null);
|
|
2945
|
+
return r.rovingFocus ? /* @__PURE__ */ i(
|
|
2946
|
+
xe,
|
|
2947
|
+
{
|
|
2948
|
+
asChild: !0,
|
|
2949
|
+
...n,
|
|
2950
|
+
focusable: !c,
|
|
2951
|
+
active: s,
|
|
2952
|
+
ref: u,
|
|
2953
|
+
children: /* @__PURE__ */ i(hr, { ...l, ref: t })
|
|
2954
|
+
}
|
|
2955
|
+
) : /* @__PURE__ */ i(hr, { ...l, ref: t });
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
Wo.displayName = Ke;
|
|
2959
|
+
var hr = V.forwardRef(
|
|
2960
|
+
(e, t) => {
|
|
2961
|
+
const { __scopeToggleGroup: o, value: r, ...n } = e, s = bn(Ke, o), c = { role: "radio", "aria-checked": e.pressed, "aria-pressed": void 0 }, l = s.type === "single" ? c : void 0;
|
|
2962
|
+
return /* @__PURE__ */ i(
|
|
2963
|
+
Ze,
|
|
2964
|
+
{
|
|
2965
|
+
...l,
|
|
2966
|
+
...n,
|
|
2967
|
+
ref: t,
|
|
2968
|
+
onPressedChange: (u) => {
|
|
2969
|
+
u ? s.onItemActivate(r) : s.onItemDeactivate(r);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
);
|
|
2973
|
+
}
|
|
2974
|
+
), hn = Je, Tn = Wo;
|
|
2975
|
+
const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2976
|
+
__proto__: null,
|
|
2977
|
+
Item: Tn,
|
|
2978
|
+
Root: hn,
|
|
2979
|
+
ToggleGroup: Je,
|
|
2980
|
+
ToggleGroupItem: Wo,
|
|
2981
|
+
createToggleGroupScope: Uo
|
|
2982
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2983
|
+
var qo = "Toolbar", [Ki, Bi] = oe(qo, [
|
|
2984
|
+
ue,
|
|
2985
|
+
Uo
|
|
2986
|
+
]), Yo = ue(), wn = Uo(), [Hi, yn] = Ki(qo), Xo = a.forwardRef(
|
|
2987
|
+
(e, t) => {
|
|
2988
|
+
const { __scopeToolbar: o, orientation: r = "horizontal", dir: n, loop: s = !0, ...c } = e, l = Yo(o), u = he(n);
|
|
2989
|
+
return /* @__PURE__ */ i(Hi, { scope: o, orientation: r, dir: u, children: /* @__PURE__ */ i(
|
|
2990
|
+
Be,
|
|
2991
|
+
{
|
|
2992
|
+
asChild: !0,
|
|
2993
|
+
...l,
|
|
2994
|
+
orientation: r,
|
|
2995
|
+
dir: u,
|
|
2996
|
+
loop: s,
|
|
2997
|
+
children: /* @__PURE__ */ i(
|
|
2998
|
+
O.div,
|
|
2999
|
+
{
|
|
3000
|
+
role: "toolbar",
|
|
3001
|
+
"aria-orientation": r,
|
|
3002
|
+
dir: u,
|
|
3003
|
+
...c,
|
|
3004
|
+
ref: t
|
|
3005
|
+
}
|
|
3006
|
+
)
|
|
3007
|
+
}
|
|
3008
|
+
) });
|
|
3009
|
+
}
|
|
3010
|
+
);
|
|
3011
|
+
Xo.displayName = qo;
|
|
3012
|
+
var En = "ToolbarSeparator", Zo = a.forwardRef(
|
|
3013
|
+
(e, t) => {
|
|
3014
|
+
const { __scopeToolbar: o, ...r } = e, n = yn(En, o);
|
|
3015
|
+
return /* @__PURE__ */ i(
|
|
3016
|
+
Zn,
|
|
3017
|
+
{
|
|
3018
|
+
orientation: n.orientation === "horizontal" ? "vertical" : "horizontal",
|
|
3019
|
+
...r,
|
|
3020
|
+
ref: t
|
|
3021
|
+
}
|
|
3022
|
+
);
|
|
3023
|
+
}
|
|
3024
|
+
);
|
|
3025
|
+
Zo.displayName = En;
|
|
3026
|
+
var ji = "ToolbarButton", Qe = a.forwardRef(
|
|
3027
|
+
(e, t) => {
|
|
3028
|
+
const { __scopeToolbar: o, ...r } = e, n = Yo(o);
|
|
3029
|
+
return /* @__PURE__ */ i(xe, { asChild: !0, ...n, focusable: !e.disabled, children: /* @__PURE__ */ i(O.button, { type: "button", ...r, ref: t }) });
|
|
3030
|
+
}
|
|
3031
|
+
);
|
|
3032
|
+
Qe.displayName = ji;
|
|
3033
|
+
var zi = "ToolbarLink", Jo = a.forwardRef(
|
|
3034
|
+
(e, t) => {
|
|
3035
|
+
const { __scopeToolbar: o, ...r } = e, n = Yo(o);
|
|
3036
|
+
return /* @__PURE__ */ i(xe, { asChild: !0, ...n, focusable: !0, children: /* @__PURE__ */ i(
|
|
3037
|
+
O.a,
|
|
3038
|
+
{
|
|
3039
|
+
...r,
|
|
3040
|
+
ref: t,
|
|
3041
|
+
onKeyDown: A(e.onKeyDown, (s) => {
|
|
3042
|
+
s.key === " " && s.currentTarget.click();
|
|
3043
|
+
})
|
|
3044
|
+
}
|
|
3045
|
+
) });
|
|
3046
|
+
}
|
|
3047
|
+
);
|
|
3048
|
+
Jo.displayName = zi;
|
|
3049
|
+
var Rn = "ToolbarToggleGroup", Qo = a.forwardRef(
|
|
3050
|
+
(e, t) => {
|
|
3051
|
+
const { __scopeToolbar: o, ...r } = e, n = yn(Rn, o), s = wn(o);
|
|
3052
|
+
return /* @__PURE__ */ i(
|
|
3053
|
+
hn,
|
|
3054
|
+
{
|
|
3055
|
+
"data-orientation": n.orientation,
|
|
3056
|
+
dir: n.dir,
|
|
3057
|
+
...s,
|
|
3058
|
+
...r,
|
|
3059
|
+
ref: t,
|
|
3060
|
+
rovingFocus: !1
|
|
3061
|
+
}
|
|
3062
|
+
);
|
|
3063
|
+
}
|
|
3064
|
+
);
|
|
3065
|
+
Qo.displayName = Rn;
|
|
3066
|
+
var Ui = "ToolbarToggleItem", er = a.forwardRef(
|
|
3067
|
+
(e, t) => {
|
|
3068
|
+
const { __scopeToolbar: o, ...r } = e, n = wn(o), s = { __scopeToolbar: e.__scopeToolbar };
|
|
3069
|
+
return /* @__PURE__ */ i(Qe, { asChild: !0, ...s, children: /* @__PURE__ */ i(Tn, { ...n, ...r, ref: t }) });
|
|
3070
|
+
}
|
|
3071
|
+
);
|
|
3072
|
+
er.displayName = Ui;
|
|
3073
|
+
var Wi = Xo, qi = Zo, Yi = Qe, Xi = Jo, Zi = Qo, Ji = er;
|
|
3074
|
+
const mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3075
|
+
__proto__: null,
|
|
3076
|
+
Button: Yi,
|
|
3077
|
+
Link: Xi,
|
|
3078
|
+
Root: Wi,
|
|
3079
|
+
Separator: qi,
|
|
3080
|
+
ToggleGroup: Zi,
|
|
3081
|
+
ToggleItem: Ji,
|
|
3082
|
+
Toolbar: Xo,
|
|
3083
|
+
ToolbarButton: Qe,
|
|
3084
|
+
ToolbarLink: Jo,
|
|
3085
|
+
ToolbarSeparator: Zo,
|
|
3086
|
+
ToolbarToggleGroup: Qo,
|
|
3087
|
+
ToolbarToggleItem: er,
|
|
3088
|
+
createToolbarScope: Bi
|
|
3089
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3090
|
+
export {
|
|
3091
|
+
Cc as AccessibleIcon,
|
|
3092
|
+
nc as Accordion,
|
|
3093
|
+
hc as AlertDialog,
|
|
3094
|
+
Tc as AspectRatio,
|
|
3095
|
+
wc as Avatar,
|
|
3096
|
+
yc as Checkbox,
|
|
3097
|
+
rc as Collapsible,
|
|
3098
|
+
Ec as ContextMenu,
|
|
3099
|
+
Rc as Dialog,
|
|
3100
|
+
_c as Direction,
|
|
3101
|
+
Ic as DropdownMenu,
|
|
3102
|
+
sc as Form,
|
|
3103
|
+
Mc as HoverCard,
|
|
3104
|
+
ac as Label,
|
|
3105
|
+
ic as Menubar,
|
|
3106
|
+
cc as NavigationMenu,
|
|
3107
|
+
Pc as Popover,
|
|
3108
|
+
xc as Portal,
|
|
3109
|
+
dc as Progress,
|
|
3110
|
+
Sc as RadioGroup,
|
|
3111
|
+
Ac as ScrollArea,
|
|
3112
|
+
Nc as Select,
|
|
3113
|
+
Fc as Separator,
|
|
3114
|
+
Oc as Slider,
|
|
3115
|
+
Dc as Slot,
|
|
3116
|
+
Lc as Switch,
|
|
3117
|
+
kc as Tabs,
|
|
3118
|
+
fc as Toast,
|
|
3119
|
+
pc as Toggle,
|
|
3120
|
+
vc as ToggleGroup,
|
|
3121
|
+
mc as Toolbar,
|
|
3122
|
+
Vc as Tooltip,
|
|
3123
|
+
Gc as VisuallyHidden,
|
|
3124
|
+
lc as unstable_OneTimePasswordField,
|
|
3125
|
+
uc as unstable_PasswordToggleField
|
|
3126
|
+
};
|