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