@krosoft/react 0.0.72 → 0.0.73

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.
Files changed (37) hide show
  1. package/dist/KpiCards-Bjsd4bSz.js +40 -0
  2. package/dist/{SearchInput-LIey3bo9.js → SearchInput-Bu4wb0gI.js} +10 -9
  3. package/dist/ThemeSelector-DMgBLEYm.js +49 -0
  4. package/dist/Topbar-CFALRIJn.js +168 -0
  5. package/dist/{badge-Cj2EQgcL.js → badge-C4pCH7IL.js} +1 -1
  6. package/dist/components/core/cards/KpiCards.d.ts.map +1 -1
  7. package/dist/components/core/cards/index.js +1 -1
  8. package/dist/components/core/index.d.ts +1 -0
  9. package/dist/components/core/index.d.ts.map +1 -1
  10. package/dist/components/core/index.js +10 -8
  11. package/dist/components/core/inputs/index.js +1 -1
  12. package/dist/components/core/navbar/index.js +1 -1
  13. package/dist/components/core/theme/ThemeSelector.d.ts +8 -0
  14. package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -0
  15. package/dist/components/core/theme/index.d.ts +3 -0
  16. package/dist/components/core/theme/index.d.ts.map +1 -0
  17. package/dist/components/core/theme/index.js +4 -0
  18. package/dist/components/index.js +41 -30
  19. package/dist/components/ui/index.d.ts +1 -0
  20. package/dist/components/ui/index.d.ts.map +1 -1
  21. package/dist/components/ui/index.js +27 -18
  22. package/dist/components/ui/select.d.ts +14 -0
  23. package/dist/components/ui/select.d.ts.map +1 -0
  24. package/dist/hooks/index.d.ts +2 -0
  25. package/dist/hooks/index.d.ts.map +1 -1
  26. package/dist/hooks/index.js +16 -112
  27. package/dist/hooks/ui/useTheme.d.ts +20 -0
  28. package/dist/hooks/ui/useTheme.d.ts.map +1 -0
  29. package/dist/index-BQOmHRsD.js +1662 -0
  30. package/dist/select-CdiR6cO0.js +2020 -0
  31. package/dist/{toast-B6CC_ory.js → toast-BypnW71k.js} +1 -1
  32. package/dist/tooltip-Dep8OR3c.js +779 -0
  33. package/dist/useTheme-D__o7mLN.js +122 -0
  34. package/package.json +10 -2
  35. package/dist/KpiCards-D4Cy8CLT.js +0 -38
  36. package/dist/Topbar-CtXJ337W.js +0 -2314
  37. package/dist/index-BNCR478R.js +0 -272
@@ -1,2314 +0,0 @@
1
- import { jsx as y, jsxs as $, Fragment as nt } from "react/jsx-runtime";
2
- import * as h from "react";
3
- import { useLayoutEffect as un } from "react";
4
- import { d as dn, u as ne, e as pn, f as X, g as He, h as ie, a as gt, j as hn, i as mn, B as gn } from "./index-BNCR478R.js";
5
- import * as vt from "react-dom";
6
- import { c as G } from "./index-gWiv5-6R.js";
7
- import { c as xt } from "./createLucideIcon-CRdjzt2A.js";
8
- /**
9
- * @license lucide-react v1.16.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const vn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], xn = xt("chevron-down", vn);
15
- /**
16
- * @license lucide-react v1.16.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- const wn = [
22
- ["path", { d: "M4 5h16", key: "1tepv9" }],
23
- ["path", { d: "M4 12h16", key: "1lakjw" }],
24
- ["path", { d: "M4 19h16", key: "1djgab" }]
25
- ], yn = xt("menu", wn);
26
- var bn = [
27
- "a",
28
- "button",
29
- "div",
30
- "form",
31
- "h2",
32
- "h3",
33
- "img",
34
- "input",
35
- "label",
36
- "li",
37
- "nav",
38
- "ol",
39
- "p",
40
- "select",
41
- "span",
42
- "svg",
43
- "ul"
44
- ], re = bn.reduce((e, t) => {
45
- const n = dn(`Primitive.${t}`), r = h.forwardRef((o, i) => {
46
- const { asChild: s, ...a } = o, c = s ? n : t;
47
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ y(c, { ...a, ref: i });
48
- });
49
- return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
50
- }, {});
51
- function Cn(e, t) {
52
- e && vt.flushSync(() => e.dispatchEvent(t));
53
- }
54
- var An = "DismissableLayer", Me = "dismissableLayer.update", Rn = "dismissableLayer.pointerDownOutside", En = "dismissableLayer.focusOutside", rt, wt = h.createContext({
55
- layers: /* @__PURE__ */ new Set(),
56
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
57
- branches: /* @__PURE__ */ new Set()
58
- }), yt = h.forwardRef(
59
- (e, t) => {
60
- const {
61
- disableOutsidePointerEvents: n = !1,
62
- onEscapeKeyDown: r,
63
- onPointerDownOutside: o,
64
- onFocusOutside: i,
65
- onInteractOutside: s,
66
- onDismiss: a,
67
- ...c
68
- } = e, l = h.useContext(wt), [f, d] = h.useState(null), p = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, u] = h.useState({}), g = ne(t, (A) => d(A)), m = Array.from(l.layers), [v] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), x = m.indexOf(v), w = f ? m.indexOf(f) : -1, C = l.layersWithOutsidePointerEventsDisabled.size > 0, b = w >= x, E = Tn((A) => {
69
- const P = A.target, M = [...l.branches].some((T) => T.contains(P));
70
- !b || M || (o == null || o(A), s == null || s(A), A.defaultPrevented || a == null || a());
71
- }, p), R = Sn((A) => {
72
- const P = A.target;
73
- [...l.branches].some((T) => T.contains(P)) || (i == null || i(A), s == null || s(A), A.defaultPrevented || a == null || a());
74
- }, p);
75
- return pn((A) => {
76
- w === l.layers.size - 1 && (r == null || r(A), !A.defaultPrevented && a && (A.preventDefault(), a()));
77
- }, p), h.useEffect(() => {
78
- if (f)
79
- return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (rt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), ot(), () => {
80
- n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = rt);
81
- };
82
- }, [f, p, n, l]), h.useEffect(() => () => {
83
- f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), ot());
84
- }, [f, l]), h.useEffect(() => {
85
- const A = () => u({});
86
- return document.addEventListener(Me, A), () => document.removeEventListener(Me, A);
87
- }, []), /* @__PURE__ */ y(
88
- re.div,
89
- {
90
- ...c,
91
- ref: g,
92
- style: {
93
- pointerEvents: C ? b ? "auto" : "none" : void 0,
94
- ...e.style
95
- },
96
- onFocusCapture: X(e.onFocusCapture, R.onFocusCapture),
97
- onBlurCapture: X(e.onBlurCapture, R.onBlurCapture),
98
- onPointerDownCapture: X(
99
- e.onPointerDownCapture,
100
- E.onPointerDownCapture
101
- )
102
- }
103
- );
104
- }
105
- );
106
- yt.displayName = An;
107
- var On = "DismissableLayerBranch", Pn = h.forwardRef((e, t) => {
108
- const n = h.useContext(wt), r = h.useRef(null), o = ne(t, r);
109
- return h.useEffect(() => {
110
- const i = r.current;
111
- if (i)
112
- return n.branches.add(i), () => {
113
- n.branches.delete(i);
114
- };
115
- }, [n.branches]), /* @__PURE__ */ y(re.div, { ...e, ref: o });
116
- });
117
- Pn.displayName = On;
118
- function Tn(e, t = globalThis == null ? void 0 : globalThis.document) {
119
- const n = He(e), r = h.useRef(!1), o = h.useRef(() => {
120
- });
121
- return h.useEffect(() => {
122
- const i = (a) => {
123
- if (a.target && !r.current) {
124
- let c = function() {
125
- bt(
126
- Rn,
127
- n,
128
- l,
129
- { discrete: !0 }
130
- );
131
- };
132
- const l = { originalEvent: a };
133
- a.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = c, t.addEventListener("click", o.current, { once: !0 })) : c();
134
- } else
135
- t.removeEventListener("click", o.current);
136
- r.current = !1;
137
- }, s = window.setTimeout(() => {
138
- t.addEventListener("pointerdown", i);
139
- }, 0);
140
- return () => {
141
- window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
142
- };
143
- }, [t, n]), {
144
- // ensures we check React component tree (not just DOM tree)
145
- onPointerDownCapture: () => r.current = !0
146
- };
147
- }
148
- function Sn(e, t = globalThis == null ? void 0 : globalThis.document) {
149
- const n = He(e), r = h.useRef(!1);
150
- return h.useEffect(() => {
151
- const o = (i) => {
152
- i.target && !r.current && bt(En, n, { originalEvent: i }, {
153
- discrete: !1
154
- });
155
- };
156
- return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
157
- }, [t, n]), {
158
- onFocusCapture: () => r.current = !0,
159
- onBlurCapture: () => r.current = !1
160
- };
161
- }
162
- function ot() {
163
- const e = new CustomEvent(Me);
164
- document.dispatchEvent(e);
165
- }
166
- function bt(e, t, n, { discrete: r }) {
167
- const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
168
- t && o.addEventListener(e, t, { once: !0 }), r ? Cn(o, i) : o.dispatchEvent(i);
169
- }
170
- var Nn = h[" useId ".trim().toString()] || (() => {
171
- }), Dn = 0;
172
- function Ln(e) {
173
- const [t, n] = h.useState(Nn());
174
- return ie(() => {
175
- n((r) => r ?? String(Dn++));
176
- }, [e]), t ? `radix-${t}` : "";
177
- }
178
- const Mn = ["top", "right", "bottom", "left"], J = Math.min, H = Math.max, we = Math.round, ge = Math.floor, U = (e) => ({
179
- x: e,
180
- y: e
181
- }), kn = {
182
- left: "right",
183
- right: "left",
184
- bottom: "top",
185
- top: "bottom"
186
- };
187
- function ke(e, t, n) {
188
- return H(e, J(t, n));
189
- }
190
- function q(e, t) {
191
- return typeof e == "function" ? e(t) : e;
192
- }
193
- function K(e) {
194
- return e.split("-")[0];
195
- }
196
- function ae(e) {
197
- return e.split("-")[1];
198
- }
199
- function Be(e) {
200
- return e === "x" ? "y" : "x";
201
- }
202
- function ze(e) {
203
- return e === "y" ? "height" : "width";
204
- }
205
- function V(e) {
206
- const t = e[0];
207
- return t === "t" || t === "b" ? "y" : "x";
208
- }
209
- function Ie(e) {
210
- return Be(V(e));
211
- }
212
- function _n(e, t, n) {
213
- n === void 0 && (n = !1);
214
- const r = ae(e), o = Ie(e), i = ze(o);
215
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
216
- return t.reference[i] > t.floating[i] && (s = ye(s)), [s, ye(s)];
217
- }
218
- function Wn(e) {
219
- const t = ye(e);
220
- return [_e(e), t, _e(t)];
221
- }
222
- function _e(e) {
223
- return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
224
- }
225
- const it = ["left", "right"], st = ["right", "left"], $n = ["top", "bottom"], Fn = ["bottom", "top"];
226
- function Hn(e, t, n) {
227
- switch (e) {
228
- case "top":
229
- case "bottom":
230
- return n ? t ? st : it : t ? it : st;
231
- case "left":
232
- case "right":
233
- return t ? $n : Fn;
234
- default:
235
- return [];
236
- }
237
- }
238
- function Bn(e, t, n, r) {
239
- const o = ae(e);
240
- let i = Hn(K(e), n === "start", r);
241
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(_e)))), i;
242
- }
243
- function ye(e) {
244
- const t = K(e);
245
- return kn[t] + e.slice(t.length);
246
- }
247
- function zn(e) {
248
- return {
249
- top: 0,
250
- right: 0,
251
- bottom: 0,
252
- left: 0,
253
- ...e
254
- };
255
- }
256
- function Ct(e) {
257
- return typeof e != "number" ? zn(e) : {
258
- top: e,
259
- right: e,
260
- bottom: e,
261
- left: e
262
- };
263
- }
264
- function be(e) {
265
- const {
266
- x: t,
267
- y: n,
268
- width: r,
269
- height: o
270
- } = e;
271
- return {
272
- width: r,
273
- height: o,
274
- top: n,
275
- left: t,
276
- right: t + r,
277
- bottom: n + o,
278
- x: t,
279
- y: n
280
- };
281
- }
282
- function ct(e, t, n) {
283
- let {
284
- reference: r,
285
- floating: o
286
- } = e;
287
- const i = V(t), s = Ie(t), a = ze(s), c = K(t), l = i === "y", f = r.x + r.width / 2 - o.width / 2, d = r.y + r.height / 2 - o.height / 2, p = r[a] / 2 - o[a] / 2;
288
- let u;
289
- switch (c) {
290
- case "top":
291
- u = {
292
- x: f,
293
- y: r.y - o.height
294
- };
295
- break;
296
- case "bottom":
297
- u = {
298
- x: f,
299
- y: r.y + r.height
300
- };
301
- break;
302
- case "right":
303
- u = {
304
- x: r.x + r.width,
305
- y: d
306
- };
307
- break;
308
- case "left":
309
- u = {
310
- x: r.x - o.width,
311
- y: d
312
- };
313
- break;
314
- default:
315
- u = {
316
- x: r.x,
317
- y: r.y
318
- };
319
- }
320
- switch (ae(t)) {
321
- case "start":
322
- u[s] -= p * (n && l ? -1 : 1);
323
- break;
324
- case "end":
325
- u[s] += p * (n && l ? -1 : 1);
326
- break;
327
- }
328
- return u;
329
- }
330
- async function In(e, t) {
331
- var n;
332
- t === void 0 && (t = {});
333
- const {
334
- x: r,
335
- y: o,
336
- platform: i,
337
- rects: s,
338
- elements: a,
339
- strategy: c
340
- } = e, {
341
- boundary: l = "clippingAncestors",
342
- rootBoundary: f = "viewport",
343
- elementContext: d = "floating",
344
- altBoundary: p = !1,
345
- padding: u = 0
346
- } = q(t, e), g = Ct(u), v = a[p ? d === "floating" ? "reference" : "floating" : d], x = be(await i.getClippingRect({
347
- element: (n = await (i.isElement == null ? void 0 : i.isElement(v))) == null || n ? v : v.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
348
- boundary: l,
349
- rootBoundary: f,
350
- strategy: c
351
- })), w = d === "floating" ? {
352
- x: r,
353
- y: o,
354
- width: s.floating.width,
355
- height: s.floating.height
356
- } : s.reference, C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), b = await (i.isElement == null ? void 0 : i.isElement(C)) ? await (i.getScale == null ? void 0 : i.getScale(C)) || {
357
- x: 1,
358
- y: 1
359
- } : {
360
- x: 1,
361
- y: 1
362
- }, E = be(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
363
- elements: a,
364
- rect: w,
365
- offsetParent: C,
366
- strategy: c
367
- }) : w);
368
- return {
369
- top: (x.top - E.top + g.top) / b.y,
370
- bottom: (E.bottom - x.bottom + g.bottom) / b.y,
371
- left: (x.left - E.left + g.left) / b.x,
372
- right: (E.right - x.right + g.right) / b.x
373
- };
374
- }
375
- const jn = 50, Vn = async (e, t, n) => {
376
- const {
377
- placement: r = "bottom",
378
- strategy: o = "absolute",
379
- middleware: i = [],
380
- platform: s
381
- } = n, a = s.detectOverflow ? s : {
382
- ...s,
383
- detectOverflow: In
384
- }, c = await (s.isRTL == null ? void 0 : s.isRTL(t));
385
- let l = await s.getElementRects({
386
- reference: e,
387
- floating: t,
388
- strategy: o
389
- }), {
390
- x: f,
391
- y: d
392
- } = ct(l, r, c), p = r, u = 0;
393
- const g = {};
394
- for (let m = 0; m < i.length; m++) {
395
- const v = i[m];
396
- if (!v)
397
- continue;
398
- const {
399
- name: x,
400
- fn: w
401
- } = v, {
402
- x: C,
403
- y: b,
404
- data: E,
405
- reset: R
406
- } = await w({
407
- x: f,
408
- y: d,
409
- initialPlacement: r,
410
- placement: p,
411
- strategy: o,
412
- middlewareData: g,
413
- rects: l,
414
- platform: a,
415
- elements: {
416
- reference: e,
417
- floating: t
418
- }
419
- });
420
- f = C ?? f, d = b ?? d, g[x] = {
421
- ...g[x],
422
- ...E
423
- }, R && u < jn && (u++, typeof R == "object" && (R.placement && (p = R.placement), R.rects && (l = R.rects === !0 ? await s.getElementRects({
424
- reference: e,
425
- floating: t,
426
- strategy: o
427
- }) : R.rects), {
428
- x: f,
429
- y: d
430
- } = ct(l, p, c)), m = -1);
431
- }
432
- return {
433
- x: f,
434
- y: d,
435
- placement: p,
436
- strategy: o,
437
- middlewareData: g
438
- };
439
- }, Un = (e) => ({
440
- name: "arrow",
441
- options: e,
442
- async fn(t) {
443
- const {
444
- x: n,
445
- y: r,
446
- placement: o,
447
- rects: i,
448
- platform: s,
449
- elements: a,
450
- middlewareData: c
451
- } = t, {
452
- element: l,
453
- padding: f = 0
454
- } = q(e, t) || {};
455
- if (l == null)
456
- return {};
457
- const d = Ct(f), p = {
458
- x: n,
459
- y: r
460
- }, u = Ie(o), g = ze(u), m = await s.getDimensions(l), v = u === "y", x = v ? "top" : "left", w = v ? "bottom" : "right", C = v ? "clientHeight" : "clientWidth", b = i.reference[g] + i.reference[u] - p[u] - i.floating[g], E = p[u] - i.reference[u], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
461
- let A = R ? R[C] : 0;
462
- (!A || !await (s.isElement == null ? void 0 : s.isElement(R))) && (A = a.floating[C] || i.floating[g]);
463
- const P = b / 2 - E / 2, M = A / 2 - m[g] / 2 - 1, T = J(d[x], M), _ = J(d[w], M), W = T, N = A - m[g] - _, S = A / 2 - m[g] / 2 + P, F = ke(W, S, N), D = !c.arrow && ae(o) != null && S !== F && i.reference[g] / 2 - (S < W ? T : _) - m[g] / 2 < 0, L = D ? S < W ? S - W : S - N : 0;
464
- return {
465
- [u]: p[u] + L,
466
- data: {
467
- [u]: F,
468
- centerOffset: S - F - L,
469
- ...D && {
470
- alignmentOffset: L
471
- }
472
- },
473
- reset: D
474
- };
475
- }
476
- }), Yn = function(e) {
477
- return e === void 0 && (e = {}), {
478
- name: "flip",
479
- options: e,
480
- async fn(t) {
481
- var n, r;
482
- const {
483
- placement: o,
484
- middlewareData: i,
485
- rects: s,
486
- initialPlacement: a,
487
- platform: c,
488
- elements: l
489
- } = t, {
490
- mainAxis: f = !0,
491
- crossAxis: d = !0,
492
- fallbackPlacements: p,
493
- fallbackStrategy: u = "bestFit",
494
- fallbackAxisSideDirection: g = "none",
495
- flipAlignment: m = !0,
496
- ...v
497
- } = q(e, t);
498
- if ((n = i.arrow) != null && n.alignmentOffset)
499
- return {};
500
- const x = K(o), w = V(a), C = K(a) === a, b = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), E = p || (C || !m ? [ye(a)] : Wn(a)), R = g !== "none";
501
- !p && R && E.push(...Bn(a, m, g, b));
502
- const A = [a, ...E], P = await c.detectOverflow(t, v), M = [];
503
- let T = ((r = i.flip) == null ? void 0 : r.overflows) || [];
504
- if (f && M.push(P[x]), d) {
505
- const S = _n(o, s, b);
506
- M.push(P[S[0]], P[S[1]]);
507
- }
508
- if (T = [...T, {
509
- placement: o,
510
- overflows: M
511
- }], !M.every((S) => S <= 0)) {
512
- var _, W;
513
- const S = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, F = A[S];
514
- if (F && (!(d === "alignment" ? w !== V(F) : !1) || // We leave the current main axis only if every placement on that axis
515
- // overflows the main axis.
516
- T.every((O) => V(O.placement) === w ? O.overflows[0] > 0 : !0)))
517
- return {
518
- data: {
519
- index: S,
520
- overflows: T
521
- },
522
- reset: {
523
- placement: F
524
- }
525
- };
526
- let D = (W = T.filter((L) => L.overflows[0] <= 0).sort((L, O) => L.overflows[1] - O.overflows[1])[0]) == null ? void 0 : W.placement;
527
- if (!D)
528
- switch (u) {
529
- case "bestFit": {
530
- var N;
531
- const L = (N = T.filter((O) => {
532
- if (R) {
533
- const k = V(O.placement);
534
- return k === w || // Create a bias to the `y` side axis due to horizontal
535
- // reading directions favoring greater width.
536
- k === "y";
537
- }
538
- return !0;
539
- }).map((O) => [O.placement, O.overflows.filter((k) => k > 0).reduce((k, j) => k + j, 0)]).sort((O, k) => O[1] - k[1])[0]) == null ? void 0 : N[0];
540
- L && (D = L);
541
- break;
542
- }
543
- case "initialPlacement":
544
- D = a;
545
- break;
546
- }
547
- if (o !== D)
548
- return {
549
- reset: {
550
- placement: D
551
- }
552
- };
553
- }
554
- return {};
555
- }
556
- };
557
- };
558
- function at(e, t) {
559
- return {
560
- top: e.top - t.height,
561
- right: e.right - t.width,
562
- bottom: e.bottom - t.height,
563
- left: e.left - t.width
564
- };
565
- }
566
- function lt(e) {
567
- return Mn.some((t) => e[t] >= 0);
568
- }
569
- const Xn = function(e) {
570
- return e === void 0 && (e = {}), {
571
- name: "hide",
572
- options: e,
573
- async fn(t) {
574
- const {
575
- rects: n,
576
- platform: r
577
- } = t, {
578
- strategy: o = "referenceHidden",
579
- ...i
580
- } = q(e, t);
581
- switch (o) {
582
- case "referenceHidden": {
583
- const s = await r.detectOverflow(t, {
584
- ...i,
585
- elementContext: "reference"
586
- }), a = at(s, n.reference);
587
- return {
588
- data: {
589
- referenceHiddenOffsets: a,
590
- referenceHidden: lt(a)
591
- }
592
- };
593
- }
594
- case "escaped": {
595
- const s = await r.detectOverflow(t, {
596
- ...i,
597
- altBoundary: !0
598
- }), a = at(s, n.floating);
599
- return {
600
- data: {
601
- escapedOffsets: a,
602
- escaped: lt(a)
603
- }
604
- };
605
- }
606
- default:
607
- return {};
608
- }
609
- }
610
- };
611
- }, At = /* @__PURE__ */ new Set(["left", "top"]);
612
- async function Gn(e, t) {
613
- const {
614
- placement: n,
615
- platform: r,
616
- elements: o
617
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = K(n), a = ae(n), c = V(n) === "y", l = At.has(s) ? -1 : 1, f = i && c ? -1 : 1, d = q(t, e);
618
- let {
619
- mainAxis: p,
620
- crossAxis: u,
621
- alignmentAxis: g
622
- } = typeof d == "number" ? {
623
- mainAxis: d,
624
- crossAxis: 0,
625
- alignmentAxis: null
626
- } : {
627
- mainAxis: d.mainAxis || 0,
628
- crossAxis: d.crossAxis || 0,
629
- alignmentAxis: d.alignmentAxis
630
- };
631
- return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), c ? {
632
- x: u * f,
633
- y: p * l
634
- } : {
635
- x: p * l,
636
- y: u * f
637
- };
638
- }
639
- const qn = function(e) {
640
- return e === void 0 && (e = 0), {
641
- name: "offset",
642
- options: e,
643
- async fn(t) {
644
- var n, r;
645
- const {
646
- x: o,
647
- y: i,
648
- placement: s,
649
- middlewareData: a
650
- } = t, c = await Gn(t, e);
651
- return s === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : {
652
- x: o + c.x,
653
- y: i + c.y,
654
- data: {
655
- ...c,
656
- placement: s
657
- }
658
- };
659
- }
660
- };
661
- }, Kn = function(e) {
662
- return e === void 0 && (e = {}), {
663
- name: "shift",
664
- options: e,
665
- async fn(t) {
666
- const {
667
- x: n,
668
- y: r,
669
- placement: o,
670
- platform: i
671
- } = t, {
672
- mainAxis: s = !0,
673
- crossAxis: a = !1,
674
- limiter: c = {
675
- fn: (x) => {
676
- let {
677
- x: w,
678
- y: C
679
- } = x;
680
- return {
681
- x: w,
682
- y: C
683
- };
684
- }
685
- },
686
- ...l
687
- } = q(e, t), f = {
688
- x: n,
689
- y: r
690
- }, d = await i.detectOverflow(t, l), p = V(K(o)), u = Be(p);
691
- let g = f[u], m = f[p];
692
- if (s) {
693
- const x = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", C = g + d[x], b = g - d[w];
694
- g = ke(C, g, b);
695
- }
696
- if (a) {
697
- const x = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", C = m + d[x], b = m - d[w];
698
- m = ke(C, m, b);
699
- }
700
- const v = c.fn({
701
- ...t,
702
- [u]: g,
703
- [p]: m
704
- });
705
- return {
706
- ...v,
707
- data: {
708
- x: v.x - n,
709
- y: v.y - r,
710
- enabled: {
711
- [u]: s,
712
- [p]: a
713
- }
714
- }
715
- };
716
- }
717
- };
718
- }, Zn = function(e) {
719
- return e === void 0 && (e = {}), {
720
- options: e,
721
- fn(t) {
722
- const {
723
- x: n,
724
- y: r,
725
- placement: o,
726
- rects: i,
727
- middlewareData: s
728
- } = t, {
729
- offset: a = 0,
730
- mainAxis: c = !0,
731
- crossAxis: l = !0
732
- } = q(e, t), f = {
733
- x: n,
734
- y: r
735
- }, d = V(o), p = Be(d);
736
- let u = f[p], g = f[d];
737
- const m = q(a, t), v = typeof m == "number" ? {
738
- mainAxis: m,
739
- crossAxis: 0
740
- } : {
741
- mainAxis: 0,
742
- crossAxis: 0,
743
- ...m
744
- };
745
- if (c) {
746
- const C = p === "y" ? "height" : "width", b = i.reference[p] - i.floating[C] + v.mainAxis, E = i.reference[p] + i.reference[C] - v.mainAxis;
747
- u < b ? u = b : u > E && (u = E);
748
- }
749
- if (l) {
750
- var x, w;
751
- const C = p === "y" ? "width" : "height", b = At.has(K(o)), E = i.reference[d] - i.floating[C] + (b && ((x = s.offset) == null ? void 0 : x[d]) || 0) + (b ? 0 : v.crossAxis), R = i.reference[d] + i.reference[C] + (b ? 0 : ((w = s.offset) == null ? void 0 : w[d]) || 0) - (b ? v.crossAxis : 0);
752
- g < E ? g = E : g > R && (g = R);
753
- }
754
- return {
755
- [p]: u,
756
- [d]: g
757
- };
758
- }
759
- };
760
- }, Jn = function(e) {
761
- return e === void 0 && (e = {}), {
762
- name: "size",
763
- options: e,
764
- async fn(t) {
765
- var n, r;
766
- const {
767
- placement: o,
768
- rects: i,
769
- platform: s,
770
- elements: a
771
- } = t, {
772
- apply: c = () => {
773
- },
774
- ...l
775
- } = q(e, t), f = await s.detectOverflow(t, l), d = K(o), p = ae(o), u = V(o) === "y", {
776
- width: g,
777
- height: m
778
- } = i.floating;
779
- let v, x;
780
- d === "top" || d === "bottom" ? (v = d, x = p === (await (s.isRTL == null ? void 0 : s.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = d, v = p === "end" ? "top" : "bottom");
781
- const w = m - f.top - f.bottom, C = g - f.left - f.right, b = J(m - f[v], w), E = J(g - f[x], C), R = !t.middlewareData.shift;
782
- let A = b, P = E;
783
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (P = C), (r = t.middlewareData.shift) != null && r.enabled.y && (A = w), R && !p) {
784
- const T = H(f.left, 0), _ = H(f.right, 0), W = H(f.top, 0), N = H(f.bottom, 0);
785
- u ? P = g - 2 * (T !== 0 || _ !== 0 ? T + _ : H(f.left, f.right)) : A = m - 2 * (W !== 0 || N !== 0 ? W + N : H(f.top, f.bottom));
786
- }
787
- await c({
788
- ...t,
789
- availableWidth: P,
790
- availableHeight: A
791
- });
792
- const M = await s.getDimensions(a.floating);
793
- return g !== M.width || m !== M.height ? {
794
- reset: {
795
- rects: !0
796
- }
797
- } : {};
798
- }
799
- };
800
- };
801
- function Ae() {
802
- return typeof window < "u";
803
- }
804
- function le(e) {
805
- return Rt(e) ? (e.nodeName || "").toLowerCase() : "#document";
806
- }
807
- function B(e) {
808
- var t;
809
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
810
- }
811
- function Y(e) {
812
- var t;
813
- return (t = (Rt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
814
- }
815
- function Rt(e) {
816
- return Ae() ? e instanceof Node || e instanceof B(e).Node : !1;
817
- }
818
- function z(e) {
819
- return Ae() ? e instanceof Element || e instanceof B(e).Element : !1;
820
- }
821
- function Z(e) {
822
- return Ae() ? e instanceof HTMLElement || e instanceof B(e).HTMLElement : !1;
823
- }
824
- function ft(e) {
825
- return !Ae() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof B(e).ShadowRoot;
826
- }
827
- function pe(e) {
828
- const {
829
- overflow: t,
830
- overflowX: n,
831
- overflowY: r,
832
- display: o
833
- } = I(e);
834
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && o !== "inline" && o !== "contents";
835
- }
836
- function Qn(e) {
837
- return /^(table|td|th)$/.test(le(e));
838
- }
839
- function Re(e) {
840
- try {
841
- if (e.matches(":popover-open"))
842
- return !0;
843
- } catch {
844
- }
845
- try {
846
- return e.matches(":modal");
847
- } catch {
848
- return !1;
849
- }
850
- }
851
- const er = /transform|translate|scale|rotate|perspective|filter/, tr = /paint|layout|strict|content/, ee = (e) => !!e && e !== "none";
852
- let Ne;
853
- function je(e) {
854
- const t = z(e) ? I(e) : e;
855
- return ee(t.transform) || ee(t.translate) || ee(t.scale) || ee(t.rotate) || ee(t.perspective) || !Ve() && (ee(t.backdropFilter) || ee(t.filter)) || er.test(t.willChange || "") || tr.test(t.contain || "");
856
- }
857
- function nr(e) {
858
- let t = Q(e);
859
- for (; Z(t) && !se(t); ) {
860
- if (je(t))
861
- return t;
862
- if (Re(t))
863
- return null;
864
- t = Q(t);
865
- }
866
- return null;
867
- }
868
- function Ve() {
869
- return Ne == null && (Ne = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Ne;
870
- }
871
- function se(e) {
872
- return /^(html|body|#document)$/.test(le(e));
873
- }
874
- function I(e) {
875
- return B(e).getComputedStyle(e);
876
- }
877
- function Ee(e) {
878
- return z(e) ? {
879
- scrollLeft: e.scrollLeft,
880
- scrollTop: e.scrollTop
881
- } : {
882
- scrollLeft: e.scrollX,
883
- scrollTop: e.scrollY
884
- };
885
- }
886
- function Q(e) {
887
- if (le(e) === "html")
888
- return e;
889
- const t = (
890
- // Step into the shadow DOM of the parent of a slotted node.
891
- e.assignedSlot || // DOM Element detected.
892
- e.parentNode || // ShadowRoot detected.
893
- ft(e) && e.host || // Fallback.
894
- Y(e)
895
- );
896
- return ft(t) ? t.host : t;
897
- }
898
- function Et(e) {
899
- const t = Q(e);
900
- return se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Z(t) && pe(t) ? t : Et(t);
901
- }
902
- function ue(e, t, n) {
903
- var r;
904
- t === void 0 && (t = []), n === void 0 && (n = !0);
905
- const o = Et(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = B(o);
906
- if (i) {
907
- const a = We(s);
908
- return t.concat(s, s.visualViewport || [], pe(o) ? o : [], a && n ? ue(a) : []);
909
- } else
910
- return t.concat(o, ue(o, [], n));
911
- }
912
- function We(e) {
913
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
914
- }
915
- function Ot(e) {
916
- const t = I(e);
917
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
918
- const o = Z(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, a = we(n) !== i || we(r) !== s;
919
- return a && (n = i, r = s), {
920
- width: n,
921
- height: r,
922
- $: a
923
- };
924
- }
925
- function Ue(e) {
926
- return z(e) ? e : e.contextElement;
927
- }
928
- function oe(e) {
929
- const t = Ue(e);
930
- if (!Z(t))
931
- return U(1);
932
- const n = t.getBoundingClientRect(), {
933
- width: r,
934
- height: o,
935
- $: i
936
- } = Ot(t);
937
- let s = (i ? we(n.width) : n.width) / r, a = (i ? we(n.height) : n.height) / o;
938
- return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
939
- x: s,
940
- y: a
941
- };
942
- }
943
- const rr = /* @__PURE__ */ U(0);
944
- function Pt(e) {
945
- const t = B(e);
946
- return !Ve() || !t.visualViewport ? rr : {
947
- x: t.visualViewport.offsetLeft,
948
- y: t.visualViewport.offsetTop
949
- };
950
- }
951
- function or(e, t, n) {
952
- return t === void 0 && (t = !1), !n || t && n !== B(e) ? !1 : t;
953
- }
954
- function te(e, t, n, r) {
955
- t === void 0 && (t = !1), n === void 0 && (n = !1);
956
- const o = e.getBoundingClientRect(), i = Ue(e);
957
- let s = U(1);
958
- t && (r ? z(r) && (s = oe(r)) : s = oe(e));
959
- const a = or(i, n, r) ? Pt(i) : U(0);
960
- let c = (o.left + a.x) / s.x, l = (o.top + a.y) / s.y, f = o.width / s.x, d = o.height / s.y;
961
- if (i) {
962
- const p = B(i), u = r && z(r) ? B(r) : r;
963
- let g = p, m = We(g);
964
- for (; m && r && u !== g; ) {
965
- const v = oe(m), x = m.getBoundingClientRect(), w = I(m), C = x.left + (m.clientLeft + parseFloat(w.paddingLeft)) * v.x, b = x.top + (m.clientTop + parseFloat(w.paddingTop)) * v.y;
966
- c *= v.x, l *= v.y, f *= v.x, d *= v.y, c += C, l += b, g = B(m), m = We(g);
967
- }
968
- }
969
- return be({
970
- width: f,
971
- height: d,
972
- x: c,
973
- y: l
974
- });
975
- }
976
- function Oe(e, t) {
977
- const n = Ee(e).scrollLeft;
978
- return t ? t.left + n : te(Y(e)).left + n;
979
- }
980
- function Tt(e, t) {
981
- const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - Oe(e, n), o = n.top + t.scrollTop;
982
- return {
983
- x: r,
984
- y: o
985
- };
986
- }
987
- function ir(e) {
988
- let {
989
- elements: t,
990
- rect: n,
991
- offsetParent: r,
992
- strategy: o
993
- } = e;
994
- const i = o === "fixed", s = Y(r), a = t ? Re(t.floating) : !1;
995
- if (r === s || a && i)
996
- return n;
997
- let c = {
998
- scrollLeft: 0,
999
- scrollTop: 0
1000
- }, l = U(1);
1001
- const f = U(0), d = Z(r);
1002
- if ((d || !d && !i) && ((le(r) !== "body" || pe(s)) && (c = Ee(r)), d)) {
1003
- const u = te(r);
1004
- l = oe(r), f.x = u.x + r.clientLeft, f.y = u.y + r.clientTop;
1005
- }
1006
- const p = s && !d && !i ? Tt(s, c) : U(0);
1007
- return {
1008
- width: n.width * l.x,
1009
- height: n.height * l.y,
1010
- x: n.x * l.x - c.scrollLeft * l.x + f.x + p.x,
1011
- y: n.y * l.y - c.scrollTop * l.y + f.y + p.y
1012
- };
1013
- }
1014
- function sr(e) {
1015
- return Array.from(e.getClientRects());
1016
- }
1017
- function cr(e) {
1018
- const t = Y(e), n = Ee(e), r = e.ownerDocument.body, o = H(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = H(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1019
- let s = -n.scrollLeft + Oe(e);
1020
- const a = -n.scrollTop;
1021
- return I(r).direction === "rtl" && (s += H(t.clientWidth, r.clientWidth) - o), {
1022
- width: o,
1023
- height: i,
1024
- x: s,
1025
- y: a
1026
- };
1027
- }
1028
- const ut = 25;
1029
- function ar(e, t) {
1030
- const n = B(e), r = Y(e), o = n.visualViewport;
1031
- let i = r.clientWidth, s = r.clientHeight, a = 0, c = 0;
1032
- if (o) {
1033
- i = o.width, s = o.height;
1034
- const f = Ve();
1035
- (!f || f && t === "fixed") && (a = o.offsetLeft, c = o.offsetTop);
1036
- }
1037
- const l = Oe(r);
1038
- if (l <= 0) {
1039
- const f = r.ownerDocument, d = f.body, p = getComputedStyle(d), u = f.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, g = Math.abs(r.clientWidth - d.clientWidth - u);
1040
- g <= ut && (i -= g);
1041
- } else l <= ut && (i += l);
1042
- return {
1043
- width: i,
1044
- height: s,
1045
- x: a,
1046
- y: c
1047
- };
1048
- }
1049
- function lr(e, t) {
1050
- const n = te(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = Z(e) ? oe(e) : U(1), s = e.clientWidth * i.x, a = e.clientHeight * i.y, c = o * i.x, l = r * i.y;
1051
- return {
1052
- width: s,
1053
- height: a,
1054
- x: c,
1055
- y: l
1056
- };
1057
- }
1058
- function dt(e, t, n) {
1059
- let r;
1060
- if (t === "viewport")
1061
- r = ar(e, n);
1062
- else if (t === "document")
1063
- r = cr(Y(e));
1064
- else if (z(t))
1065
- r = lr(t, n);
1066
- else {
1067
- const o = Pt(e);
1068
- r = {
1069
- x: t.x - o.x,
1070
- y: t.y - o.y,
1071
- width: t.width,
1072
- height: t.height
1073
- };
1074
- }
1075
- return be(r);
1076
- }
1077
- function St(e, t) {
1078
- const n = Q(e);
1079
- return n === t || !z(n) || se(n) ? !1 : I(n).position === "fixed" || St(n, t);
1080
- }
1081
- function fr(e, t) {
1082
- const n = t.get(e);
1083
- if (n)
1084
- return n;
1085
- let r = ue(e, [], !1).filter((a) => z(a) && le(a) !== "body"), o = null;
1086
- const i = I(e).position === "fixed";
1087
- let s = i ? Q(e) : e;
1088
- for (; z(s) && !se(s); ) {
1089
- const a = I(s), c = je(s);
1090
- !c && a.position === "fixed" && (o = null), (i ? !c && !o : !c && a.position === "static" && !!o && (o.position === "absolute" || o.position === "fixed") || pe(s) && !c && St(e, s)) ? r = r.filter((f) => f !== s) : o = a, s = Q(s);
1091
- }
1092
- return t.set(e, r), r;
1093
- }
1094
- function ur(e) {
1095
- let {
1096
- element: t,
1097
- boundary: n,
1098
- rootBoundary: r,
1099
- strategy: o
1100
- } = e;
1101
- const s = [...n === "clippingAncestors" ? Re(t) ? [] : fr(t, this._c) : [].concat(n), r], a = dt(t, s[0], o);
1102
- let c = a.top, l = a.right, f = a.bottom, d = a.left;
1103
- for (let p = 1; p < s.length; p++) {
1104
- const u = dt(t, s[p], o);
1105
- c = H(u.top, c), l = J(u.right, l), f = J(u.bottom, f), d = H(u.left, d);
1106
- }
1107
- return {
1108
- width: l - d,
1109
- height: f - c,
1110
- x: d,
1111
- y: c
1112
- };
1113
- }
1114
- function dr(e) {
1115
- const {
1116
- width: t,
1117
- height: n
1118
- } = Ot(e);
1119
- return {
1120
- width: t,
1121
- height: n
1122
- };
1123
- }
1124
- function pr(e, t, n) {
1125
- const r = Z(t), o = Y(t), i = n === "fixed", s = te(e, !0, i, t);
1126
- let a = {
1127
- scrollLeft: 0,
1128
- scrollTop: 0
1129
- };
1130
- const c = U(0);
1131
- function l() {
1132
- c.x = Oe(o);
1133
- }
1134
- if (r || !r && !i)
1135
- if ((le(t) !== "body" || pe(o)) && (a = Ee(t)), r) {
1136
- const u = te(t, !0, i, t);
1137
- c.x = u.x + t.clientLeft, c.y = u.y + t.clientTop;
1138
- } else o && l();
1139
- i && !r && o && l();
1140
- const f = o && !r && !i ? Tt(o, a) : U(0), d = s.left + a.scrollLeft - c.x - f.x, p = s.top + a.scrollTop - c.y - f.y;
1141
- return {
1142
- x: d,
1143
- y: p,
1144
- width: s.width,
1145
- height: s.height
1146
- };
1147
- }
1148
- function De(e) {
1149
- return I(e).position === "static";
1150
- }
1151
- function pt(e, t) {
1152
- if (!Z(e) || I(e).position === "fixed")
1153
- return null;
1154
- if (t)
1155
- return t(e);
1156
- let n = e.offsetParent;
1157
- return Y(e) === n && (n = n.ownerDocument.body), n;
1158
- }
1159
- function Nt(e, t) {
1160
- const n = B(e);
1161
- if (Re(e))
1162
- return n;
1163
- if (!Z(e)) {
1164
- let o = Q(e);
1165
- for (; o && !se(o); ) {
1166
- if (z(o) && !De(o))
1167
- return o;
1168
- o = Q(o);
1169
- }
1170
- return n;
1171
- }
1172
- let r = pt(e, t);
1173
- for (; r && Qn(r) && De(r); )
1174
- r = pt(r, t);
1175
- return r && se(r) && De(r) && !je(r) ? n : r || nr(e) || n;
1176
- }
1177
- const hr = async function(e) {
1178
- const t = this.getOffsetParent || Nt, n = this.getDimensions, r = await n(e.floating);
1179
- return {
1180
- reference: pr(e.reference, await t(e.floating), e.strategy),
1181
- floating: {
1182
- x: 0,
1183
- y: 0,
1184
- width: r.width,
1185
- height: r.height
1186
- }
1187
- };
1188
- };
1189
- function mr(e) {
1190
- return I(e).direction === "rtl";
1191
- }
1192
- const gr = {
1193
- convertOffsetParentRelativeRectToViewportRelativeRect: ir,
1194
- getDocumentElement: Y,
1195
- getClippingRect: ur,
1196
- getOffsetParent: Nt,
1197
- getElementRects: hr,
1198
- getClientRects: sr,
1199
- getDimensions: dr,
1200
- getScale: oe,
1201
- isElement: z,
1202
- isRTL: mr
1203
- };
1204
- function Dt(e, t) {
1205
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1206
- }
1207
- function vr(e, t) {
1208
- let n = null, r;
1209
- const o = Y(e);
1210
- function i() {
1211
- var a;
1212
- clearTimeout(r), (a = n) == null || a.disconnect(), n = null;
1213
- }
1214
- function s(a, c) {
1215
- a === void 0 && (a = !1), c === void 0 && (c = 1), i();
1216
- const l = e.getBoundingClientRect(), {
1217
- left: f,
1218
- top: d,
1219
- width: p,
1220
- height: u
1221
- } = l;
1222
- if (a || t(), !p || !u)
1223
- return;
1224
- const g = ge(d), m = ge(o.clientWidth - (f + p)), v = ge(o.clientHeight - (d + u)), x = ge(f), C = {
1225
- rootMargin: -g + "px " + -m + "px " + -v + "px " + -x + "px",
1226
- threshold: H(0, J(1, c)) || 1
1227
- };
1228
- let b = !0;
1229
- function E(R) {
1230
- const A = R[0].intersectionRatio;
1231
- if (A !== c) {
1232
- if (!b)
1233
- return s();
1234
- A ? s(!1, A) : r = setTimeout(() => {
1235
- s(!1, 1e-7);
1236
- }, 1e3);
1237
- }
1238
- A === 1 && !Dt(l, e.getBoundingClientRect()) && s(), b = !1;
1239
- }
1240
- try {
1241
- n = new IntersectionObserver(E, {
1242
- ...C,
1243
- // Handle <iframe>s
1244
- root: o.ownerDocument
1245
- });
1246
- } catch {
1247
- n = new IntersectionObserver(E, C);
1248
- }
1249
- n.observe(e);
1250
- }
1251
- return s(!0), i;
1252
- }
1253
- function xr(e, t, n, r) {
1254
- r === void 0 && (r = {});
1255
- const {
1256
- ancestorScroll: o = !0,
1257
- ancestorResize: i = !0,
1258
- elementResize: s = typeof ResizeObserver == "function",
1259
- layoutShift: a = typeof IntersectionObserver == "function",
1260
- animationFrame: c = !1
1261
- } = r, l = Ue(e), f = o || i ? [...l ? ue(l) : [], ...t ? ue(t) : []] : [];
1262
- f.forEach((x) => {
1263
- o && x.addEventListener("scroll", n, {
1264
- passive: !0
1265
- }), i && x.addEventListener("resize", n);
1266
- });
1267
- const d = l && a ? vr(l, n) : null;
1268
- let p = -1, u = null;
1269
- s && (u = new ResizeObserver((x) => {
1270
- let [w] = x;
1271
- w && w.target === l && u && t && (u.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1272
- var C;
1273
- (C = u) == null || C.observe(t);
1274
- })), n();
1275
- }), l && !c && u.observe(l), t && u.observe(t));
1276
- let g, m = c ? te(e) : null;
1277
- c && v();
1278
- function v() {
1279
- const x = te(e);
1280
- m && !Dt(m, x) && n(), m = x, g = requestAnimationFrame(v);
1281
- }
1282
- return n(), () => {
1283
- var x;
1284
- f.forEach((w) => {
1285
- o && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
1286
- }), d == null || d(), (x = u) == null || x.disconnect(), u = null, c && cancelAnimationFrame(g);
1287
- };
1288
- }
1289
- const wr = qn, yr = Kn, br = Yn, Cr = Jn, Ar = Xn, ht = Un, Rr = Zn, Er = (e, t, n) => {
1290
- const r = /* @__PURE__ */ new Map(), o = {
1291
- platform: gr,
1292
- ...n
1293
- }, i = {
1294
- ...o.platform,
1295
- _c: r
1296
- };
1297
- return Vn(e, t, {
1298
- ...o,
1299
- platform: i
1300
- });
1301
- };
1302
- var Or = typeof document < "u", Pr = function() {
1303
- }, xe = Or ? un : Pr;
1304
- function Ce(e, t) {
1305
- if (e === t)
1306
- return !0;
1307
- if (typeof e != typeof t)
1308
- return !1;
1309
- if (typeof e == "function" && e.toString() === t.toString())
1310
- return !0;
1311
- let n, r, o;
1312
- if (e && t && typeof e == "object") {
1313
- if (Array.isArray(e)) {
1314
- if (n = e.length, n !== t.length) return !1;
1315
- for (r = n; r-- !== 0; )
1316
- if (!Ce(e[r], t[r]))
1317
- return !1;
1318
- return !0;
1319
- }
1320
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1321
- return !1;
1322
- for (r = n; r-- !== 0; )
1323
- if (!{}.hasOwnProperty.call(t, o[r]))
1324
- return !1;
1325
- for (r = n; r-- !== 0; ) {
1326
- const i = o[r];
1327
- if (!(i === "_owner" && e.$$typeof) && !Ce(e[i], t[i]))
1328
- return !1;
1329
- }
1330
- return !0;
1331
- }
1332
- return e !== e && t !== t;
1333
- }
1334
- function Lt(e) {
1335
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1336
- }
1337
- function mt(e, t) {
1338
- const n = Lt(e);
1339
- return Math.round(t * n) / n;
1340
- }
1341
- function Le(e) {
1342
- const t = h.useRef(e);
1343
- return xe(() => {
1344
- t.current = e;
1345
- }), t;
1346
- }
1347
- function Tr(e) {
1348
- e === void 0 && (e = {});
1349
- const {
1350
- placement: t = "bottom",
1351
- strategy: n = "absolute",
1352
- middleware: r = [],
1353
- platform: o,
1354
- elements: {
1355
- reference: i,
1356
- floating: s
1357
- } = {},
1358
- transform: a = !0,
1359
- whileElementsMounted: c,
1360
- open: l
1361
- } = e, [f, d] = h.useState({
1362
- x: 0,
1363
- y: 0,
1364
- strategy: n,
1365
- placement: t,
1366
- middlewareData: {},
1367
- isPositioned: !1
1368
- }), [p, u] = h.useState(r);
1369
- Ce(p, r) || u(r);
1370
- const [g, m] = h.useState(null), [v, x] = h.useState(null), w = h.useCallback((O) => {
1371
- O !== R.current && (R.current = O, m(O));
1372
- }, []), C = h.useCallback((O) => {
1373
- O !== A.current && (A.current = O, x(O));
1374
- }, []), b = i || g, E = s || v, R = h.useRef(null), A = h.useRef(null), P = h.useRef(f), M = c != null, T = Le(c), _ = Le(o), W = Le(l), N = h.useCallback(() => {
1375
- if (!R.current || !A.current)
1376
- return;
1377
- const O = {
1378
- placement: t,
1379
- strategy: n,
1380
- middleware: p
1381
- };
1382
- _.current && (O.platform = _.current), Er(R.current, A.current, O).then((k) => {
1383
- const j = {
1384
- ...k,
1385
- // The floating element's position may be recomputed while it's closed
1386
- // but still mounted (such as when transitioning out). To ensure
1387
- // `isPositioned` will be `false` initially on the next open, avoid
1388
- // setting it to `true` when `open === false` (must be specified).
1389
- isPositioned: W.current !== !1
1390
- };
1391
- S.current && !Ce(P.current, j) && (P.current = j, vt.flushSync(() => {
1392
- d(j);
1393
- }));
1394
- });
1395
- }, [p, t, n, _, W]);
1396
- xe(() => {
1397
- l === !1 && P.current.isPositioned && (P.current.isPositioned = !1, d((O) => ({
1398
- ...O,
1399
- isPositioned: !1
1400
- })));
1401
- }, [l]);
1402
- const S = h.useRef(!1);
1403
- xe(() => (S.current = !0, () => {
1404
- S.current = !1;
1405
- }), []), xe(() => {
1406
- if (b && (R.current = b), E && (A.current = E), b && E) {
1407
- if (T.current)
1408
- return T.current(b, E, N);
1409
- N();
1410
- }
1411
- }, [b, E, N, T, M]);
1412
- const F = h.useMemo(() => ({
1413
- reference: R,
1414
- floating: A,
1415
- setReference: w,
1416
- setFloating: C
1417
- }), [w, C]), D = h.useMemo(() => ({
1418
- reference: b,
1419
- floating: E
1420
- }), [b, E]), L = h.useMemo(() => {
1421
- const O = {
1422
- position: n,
1423
- left: 0,
1424
- top: 0
1425
- };
1426
- if (!D.floating)
1427
- return O;
1428
- const k = mt(D.floating, f.x), j = mt(D.floating, f.y);
1429
- return a ? {
1430
- ...O,
1431
- transform: "translate(" + k + "px, " + j + "px)",
1432
- ...Lt(D.floating) >= 1.5 && {
1433
- willChange: "transform"
1434
- }
1435
- } : {
1436
- position: n,
1437
- left: k,
1438
- top: j
1439
- };
1440
- }, [n, a, D.floating, f.x, f.y]);
1441
- return h.useMemo(() => ({
1442
- ...f,
1443
- update: N,
1444
- refs: F,
1445
- elements: D,
1446
- floatingStyles: L
1447
- }), [f, N, F, D, L]);
1448
- }
1449
- const Sr = (e) => {
1450
- function t(n) {
1451
- return {}.hasOwnProperty.call(n, "current");
1452
- }
1453
- return {
1454
- name: "arrow",
1455
- options: e,
1456
- fn(n) {
1457
- const {
1458
- element: r,
1459
- padding: o
1460
- } = typeof e == "function" ? e(n) : e;
1461
- return r && t(r) ? r.current != null ? ht({
1462
- element: r.current,
1463
- padding: o
1464
- }).fn(n) : {} : r ? ht({
1465
- element: r,
1466
- padding: o
1467
- }).fn(n) : {};
1468
- }
1469
- };
1470
- }, Nr = (e, t) => {
1471
- const n = wr(e);
1472
- return {
1473
- name: n.name,
1474
- fn: n.fn,
1475
- options: [e, t]
1476
- };
1477
- }, Dr = (e, t) => {
1478
- const n = yr(e);
1479
- return {
1480
- name: n.name,
1481
- fn: n.fn,
1482
- options: [e, t]
1483
- };
1484
- }, Lr = (e, t) => ({
1485
- fn: Rr(e).fn,
1486
- options: [e, t]
1487
- }), Mr = (e, t) => {
1488
- const n = br(e);
1489
- return {
1490
- name: n.name,
1491
- fn: n.fn,
1492
- options: [e, t]
1493
- };
1494
- }, kr = (e, t) => {
1495
- const n = Cr(e);
1496
- return {
1497
- name: n.name,
1498
- fn: n.fn,
1499
- options: [e, t]
1500
- };
1501
- }, _r = (e, t) => {
1502
- const n = Ar(e);
1503
- return {
1504
- name: n.name,
1505
- fn: n.fn,
1506
- options: [e, t]
1507
- };
1508
- }, Wr = (e, t) => {
1509
- const n = Sr(e);
1510
- return {
1511
- name: n.name,
1512
- fn: n.fn,
1513
- options: [e, t]
1514
- };
1515
- };
1516
- var $r = "Arrow", Mt = h.forwardRef((e, t) => {
1517
- const { children: n, width: r = 10, height: o = 5, ...i } = e;
1518
- return /* @__PURE__ */ y(
1519
- re.svg,
1520
- {
1521
- ...i,
1522
- ref: t,
1523
- width: r,
1524
- height: o,
1525
- viewBox: "0 0 30 10",
1526
- preserveAspectRatio: "none",
1527
- children: e.asChild ? n : /* @__PURE__ */ y("polygon", { points: "0,0 30,0 15,10" })
1528
- }
1529
- );
1530
- });
1531
- Mt.displayName = $r;
1532
- var Fr = Mt;
1533
- function Hr(e) {
1534
- const [t, n] = h.useState(void 0);
1535
- return ie(() => {
1536
- if (e) {
1537
- n({ width: e.offsetWidth, height: e.offsetHeight });
1538
- const r = new ResizeObserver((o) => {
1539
- if (!Array.isArray(o) || !o.length)
1540
- return;
1541
- const i = o[0];
1542
- let s, a;
1543
- if ("borderBoxSize" in i) {
1544
- const c = i.borderBoxSize, l = Array.isArray(c) ? c[0] : c;
1545
- s = l.inlineSize, a = l.blockSize;
1546
- } else
1547
- s = e.offsetWidth, a = e.offsetHeight;
1548
- n({ width: s, height: a });
1549
- });
1550
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
1551
- } else
1552
- n(void 0);
1553
- }, [e]), t;
1554
- }
1555
- var Ye = "Popper", [kt, _t] = gt(Ye), [Br, Wt] = kt(Ye), $t = (e) => {
1556
- const { __scopePopper: t, children: n } = e, [r, o] = h.useState(null);
1557
- return /* @__PURE__ */ y(Br, { scope: t, anchor: r, onAnchorChange: o, children: n });
1558
- };
1559
- $t.displayName = Ye;
1560
- var Ft = "PopperAnchor", Ht = h.forwardRef(
1561
- (e, t) => {
1562
- const { __scopePopper: n, virtualRef: r, ...o } = e, i = Wt(Ft, n), s = h.useRef(null), a = ne(t, s), c = h.useRef(null);
1563
- return h.useEffect(() => {
1564
- const l = c.current;
1565
- c.current = (r == null ? void 0 : r.current) || s.current, l !== c.current && i.onAnchorChange(c.current);
1566
- }), r ? null : /* @__PURE__ */ y(re.div, { ...o, ref: a });
1567
- }
1568
- );
1569
- Ht.displayName = Ft;
1570
- var Xe = "PopperContent", [zr, Ir] = kt(Xe), Bt = h.forwardRef(
1571
- (e, t) => {
1572
- var qe, Ke, Ze, Je, Qe, et;
1573
- const {
1574
- __scopePopper: n,
1575
- side: r = "bottom",
1576
- sideOffset: o = 0,
1577
- align: i = "center",
1578
- alignOffset: s = 0,
1579
- arrowPadding: a = 0,
1580
- avoidCollisions: c = !0,
1581
- collisionBoundary: l = [],
1582
- collisionPadding: f = 0,
1583
- sticky: d = "partial",
1584
- hideWhenDetached: p = !1,
1585
- updatePositionStrategy: u = "optimized",
1586
- onPlaced: g,
1587
- ...m
1588
- } = e, v = Wt(Xe, n), [x, w] = h.useState(null), C = ne(t, (fe) => w(fe)), [b, E] = h.useState(null), R = Hr(b), A = (R == null ? void 0 : R.width) ?? 0, P = (R == null ? void 0 : R.height) ?? 0, M = r + (i !== "center" ? "-" + i : ""), T = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, _ = Array.isArray(l) ? l : [l], W = _.length > 0, N = {
1589
- padding: T,
1590
- boundary: _.filter(Vr),
1591
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1592
- altBoundary: W
1593
- }, { refs: S, floatingStyles: F, placement: D, isPositioned: L, middlewareData: O } = Tr({
1594
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1595
- strategy: "fixed",
1596
- placement: M,
1597
- whileElementsMounted: (...fe) => xr(...fe, {
1598
- animationFrame: u === "always"
1599
- }),
1600
- elements: {
1601
- reference: v.anchor
1602
- },
1603
- middleware: [
1604
- Nr({ mainAxis: o + P, alignmentAxis: s }),
1605
- c && Dr({
1606
- mainAxis: !0,
1607
- crossAxis: !1,
1608
- limiter: d === "partial" ? Lr() : void 0,
1609
- ...N
1610
- }),
1611
- c && Mr({ ...N }),
1612
- kr({
1613
- ...N,
1614
- apply: ({ elements: fe, rects: tt, availableWidth: cn, availableHeight: an }) => {
1615
- const { width: ln, height: fn } = tt.reference, me = fe.floating.style;
1616
- me.setProperty("--radix-popper-available-width", `${cn}px`), me.setProperty("--radix-popper-available-height", `${an}px`), me.setProperty("--radix-popper-anchor-width", `${ln}px`), me.setProperty("--radix-popper-anchor-height", `${fn}px`);
1617
- }
1618
- }),
1619
- b && Wr({ element: b, padding: a }),
1620
- Ur({ arrowWidth: A, arrowHeight: P }),
1621
- p && _r({ strategy: "referenceHidden", ...N })
1622
- ]
1623
- }), [k, j] = jt(D), he = He(g);
1624
- ie(() => {
1625
- L && (he == null || he());
1626
- }, [L, he]);
1627
- const tn = (qe = O.arrow) == null ? void 0 : qe.x, nn = (Ke = O.arrow) == null ? void 0 : Ke.y, rn = ((Ze = O.arrow) == null ? void 0 : Ze.centerOffset) !== 0, [on, sn] = h.useState();
1628
- return ie(() => {
1629
- x && sn(window.getComputedStyle(x).zIndex);
1630
- }, [x]), /* @__PURE__ */ y(
1631
- "div",
1632
- {
1633
- ref: S.setFloating,
1634
- "data-radix-popper-content-wrapper": "",
1635
- style: {
1636
- ...F,
1637
- transform: L ? F.transform : "translate(0, -200%)",
1638
- // keep off the page when measuring
1639
- minWidth: "max-content",
1640
- zIndex: on,
1641
- "--radix-popper-transform-origin": [
1642
- (Je = O.transformOrigin) == null ? void 0 : Je.x,
1643
- (Qe = O.transformOrigin) == null ? void 0 : Qe.y
1644
- ].join(" "),
1645
- // hide the content if using the hide middleware and should be hidden
1646
- // set visibility to hidden and disable pointer events so the UI behaves
1647
- // as if the PopperContent isn't there at all
1648
- ...((et = O.hide) == null ? void 0 : et.referenceHidden) && {
1649
- visibility: "hidden",
1650
- pointerEvents: "none"
1651
- }
1652
- },
1653
- dir: e.dir,
1654
- children: /* @__PURE__ */ y(
1655
- zr,
1656
- {
1657
- scope: n,
1658
- placedSide: k,
1659
- onArrowChange: E,
1660
- arrowX: tn,
1661
- arrowY: nn,
1662
- shouldHideArrow: rn,
1663
- children: /* @__PURE__ */ y(
1664
- re.div,
1665
- {
1666
- "data-side": k,
1667
- "data-align": j,
1668
- ...m,
1669
- ref: C,
1670
- style: {
1671
- ...m.style,
1672
- // if the PopperContent hasn't been placed yet (not all measurements done)
1673
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
1674
- animation: L ? void 0 : "none"
1675
- }
1676
- }
1677
- )
1678
- }
1679
- )
1680
- }
1681
- );
1682
- }
1683
- );
1684
- Bt.displayName = Xe;
1685
- var zt = "PopperArrow", jr = {
1686
- top: "bottom",
1687
- right: "left",
1688
- bottom: "top",
1689
- left: "right"
1690
- }, It = h.forwardRef(function(t, n) {
1691
- const { __scopePopper: r, ...o } = t, i = Ir(zt, r), s = jr[i.placedSide];
1692
- return (
1693
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1694
- // doesn't report size as we'd expect on SVG elements.
1695
- // it reports their bounding box which is effectively the largest path inside the SVG.
1696
- /* @__PURE__ */ y(
1697
- "span",
1698
- {
1699
- ref: i.onArrowChange,
1700
- style: {
1701
- position: "absolute",
1702
- left: i.arrowX,
1703
- top: i.arrowY,
1704
- [s]: 0,
1705
- transformOrigin: {
1706
- top: "",
1707
- right: "0 0",
1708
- bottom: "center 0",
1709
- left: "100% 0"
1710
- }[i.placedSide],
1711
- transform: {
1712
- top: "translateY(100%)",
1713
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
1714
- bottom: "rotate(180deg)",
1715
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
1716
- }[i.placedSide],
1717
- visibility: i.shouldHideArrow ? "hidden" : void 0
1718
- },
1719
- children: /* @__PURE__ */ y(
1720
- Fr,
1721
- {
1722
- ...o,
1723
- ref: n,
1724
- style: {
1725
- ...o.style,
1726
- // ensures the element can be measured correctly (mostly for if SVG)
1727
- display: "block"
1728
- }
1729
- }
1730
- )
1731
- }
1732
- )
1733
- );
1734
- });
1735
- It.displayName = zt;
1736
- function Vr(e) {
1737
- return e !== null;
1738
- }
1739
- var Ur = (e) => ({
1740
- name: "transformOrigin",
1741
- options: e,
1742
- fn(t) {
1743
- var v, x, w;
1744
- const { placement: n, rects: r, middlewareData: o } = t, s = ((v = o.arrow) == null ? void 0 : v.centerOffset) !== 0, a = s ? 0 : e.arrowWidth, c = s ? 0 : e.arrowHeight, [l, f] = jt(n), d = { start: "0%", center: "50%", end: "100%" }[f], p = (((x = o.arrow) == null ? void 0 : x.x) ?? 0) + a / 2, u = (((w = o.arrow) == null ? void 0 : w.y) ?? 0) + c / 2;
1745
- let g = "", m = "";
1746
- return l === "bottom" ? (g = s ? d : `${p}px`, m = `${-c}px`) : l === "top" ? (g = s ? d : `${p}px`, m = `${r.floating.height + c}px`) : l === "right" ? (g = `${-c}px`, m = s ? d : `${u}px`) : l === "left" && (g = `${r.floating.width + c}px`, m = s ? d : `${u}px`), { data: { x: g, y: m } };
1747
- }
1748
- });
1749
- function jt(e) {
1750
- const [t, n = "center"] = e.split("-");
1751
- return [t, n];
1752
- }
1753
- var Yr = $t, Xr = Ht, Gr = Bt, qr = It;
1754
- function Kr(e, t) {
1755
- return h.useReducer((n, r) => t[n][r] ?? n, e);
1756
- }
1757
- var Vt = (e) => {
1758
- const { present: t, children: n } = e, r = Zr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : h.Children.only(n), i = ne(r.ref, Jr(o));
1759
- return typeof n == "function" || r.isPresent ? h.cloneElement(o, { ref: i }) : null;
1760
- };
1761
- Vt.displayName = "Presence";
1762
- function Zr(e) {
1763
- const [t, n] = h.useState(), r = h.useRef(null), o = h.useRef(e), i = h.useRef("none"), s = e ? "mounted" : "unmounted", [a, c] = Kr(s, {
1764
- mounted: {
1765
- UNMOUNT: "unmounted",
1766
- ANIMATION_OUT: "unmountSuspended"
1767
- },
1768
- unmountSuspended: {
1769
- MOUNT: "mounted",
1770
- ANIMATION_END: "unmounted"
1771
- },
1772
- unmounted: {
1773
- MOUNT: "mounted"
1774
- }
1775
- });
1776
- return h.useEffect(() => {
1777
- const l = ve(r.current);
1778
- i.current = a === "mounted" ? l : "none";
1779
- }, [a]), ie(() => {
1780
- const l = r.current, f = o.current;
1781
- if (f !== e) {
1782
- const p = i.current, u = ve(l);
1783
- e ? c("MOUNT") : u === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(f && p !== u ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
1784
- }
1785
- }, [e, c]), ie(() => {
1786
- if (t) {
1787
- let l;
1788
- const f = t.ownerDocument.defaultView ?? window, d = (u) => {
1789
- const m = ve(r.current).includes(CSS.escape(u.animationName));
1790
- if (u.target === t && m && (c("ANIMATION_END"), !o.current)) {
1791
- const v = t.style.animationFillMode;
1792
- t.style.animationFillMode = "forwards", l = f.setTimeout(() => {
1793
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
1794
- });
1795
- }
1796
- }, p = (u) => {
1797
- u.target === t && (i.current = ve(r.current));
1798
- };
1799
- return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
1800
- f.clearTimeout(l), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
1801
- };
1802
- } else
1803
- c("ANIMATION_END");
1804
- }, [t, c]), {
1805
- isPresent: ["mounted", "unmountSuspended"].includes(a),
1806
- ref: h.useCallback((l) => {
1807
- r.current = l ? getComputedStyle(l) : null, n(l);
1808
- }, [])
1809
- };
1810
- }
1811
- function ve(e) {
1812
- return (e == null ? void 0 : e.animationName) || "none";
1813
- }
1814
- function Jr(e) {
1815
- var r, o;
1816
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
1817
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1818
- }
1819
- var Qr = Object.freeze({
1820
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
1821
- position: "absolute",
1822
- border: 0,
1823
- width: 1,
1824
- height: 1,
1825
- padding: 0,
1826
- margin: -1,
1827
- overflow: "hidden",
1828
- clip: "rect(0, 0, 0, 0)",
1829
- whiteSpace: "nowrap",
1830
- wordWrap: "normal"
1831
- }), eo = "VisuallyHidden", Ut = h.forwardRef(
1832
- (e, t) => /* @__PURE__ */ y(
1833
- re.span,
1834
- {
1835
- ...e,
1836
- ref: t,
1837
- style: { ...Qr, ...e.style }
1838
- }
1839
- )
1840
- );
1841
- Ut.displayName = eo;
1842
- var to = Ut, [Pe] = gt("Tooltip", [
1843
- _t
1844
- ]), Te = _t(), Yt = "TooltipProvider", no = 700, $e = "tooltip.open", [ro, Ge] = Pe(Yt), Xt = (e) => {
1845
- const {
1846
- __scopeTooltip: t,
1847
- delayDuration: n = no,
1848
- skipDelayDuration: r = 300,
1849
- disableHoverableContent: o = !1,
1850
- children: i
1851
- } = e, s = h.useRef(!0), a = h.useRef(!1), c = h.useRef(0);
1852
- return h.useEffect(() => {
1853
- const l = c.current;
1854
- return () => window.clearTimeout(l);
1855
- }, []), /* @__PURE__ */ y(
1856
- ro,
1857
- {
1858
- scope: t,
1859
- isOpenDelayedRef: s,
1860
- delayDuration: n,
1861
- onOpen: h.useCallback(() => {
1862
- window.clearTimeout(c.current), s.current = !1;
1863
- }, []),
1864
- onClose: h.useCallback(() => {
1865
- window.clearTimeout(c.current), c.current = window.setTimeout(
1866
- () => s.current = !0,
1867
- r
1868
- );
1869
- }, [r]),
1870
- isPointerInTransitRef: a,
1871
- onPointerInTransitChange: h.useCallback((l) => {
1872
- a.current = l;
1873
- }, []),
1874
- disableHoverableContent: o,
1875
- children: i
1876
- }
1877
- );
1878
- };
1879
- Xt.displayName = Yt;
1880
- var de = "Tooltip", [oo, Se] = Pe(de), Gt = (e) => {
1881
- const {
1882
- __scopeTooltip: t,
1883
- children: n,
1884
- open: r,
1885
- defaultOpen: o,
1886
- onOpenChange: i,
1887
- disableHoverableContent: s,
1888
- delayDuration: a
1889
- } = e, c = Ge(de, e.__scopeTooltip), l = Te(t), [f, d] = h.useState(null), p = Ln(), u = h.useRef(0), g = s ?? c.disableHoverableContent, m = a ?? c.delayDuration, v = h.useRef(!1), [x, w] = mn({
1890
- prop: r,
1891
- defaultProp: o ?? !1,
1892
- onChange: (A) => {
1893
- A ? (c.onOpen(), document.dispatchEvent(new CustomEvent($e))) : c.onClose(), i == null || i(A);
1894
- },
1895
- caller: de
1896
- }), C = h.useMemo(() => x ? v.current ? "delayed-open" : "instant-open" : "closed", [x]), b = h.useCallback(() => {
1897
- window.clearTimeout(u.current), u.current = 0, v.current = !1, w(!0);
1898
- }, [w]), E = h.useCallback(() => {
1899
- window.clearTimeout(u.current), u.current = 0, w(!1);
1900
- }, [w]), R = h.useCallback(() => {
1901
- window.clearTimeout(u.current), u.current = window.setTimeout(() => {
1902
- v.current = !0, w(!0), u.current = 0;
1903
- }, m);
1904
- }, [m, w]);
1905
- return h.useEffect(() => () => {
1906
- u.current && (window.clearTimeout(u.current), u.current = 0);
1907
- }, []), /* @__PURE__ */ y(Yr, { ...l, children: /* @__PURE__ */ y(
1908
- oo,
1909
- {
1910
- scope: t,
1911
- contentId: p,
1912
- open: x,
1913
- stateAttribute: C,
1914
- trigger: f,
1915
- onTriggerChange: d,
1916
- onTriggerEnter: h.useCallback(() => {
1917
- c.isOpenDelayedRef.current ? R() : b();
1918
- }, [c.isOpenDelayedRef, R, b]),
1919
- onTriggerLeave: h.useCallback(() => {
1920
- g ? E() : (window.clearTimeout(u.current), u.current = 0);
1921
- }, [E, g]),
1922
- onOpen: b,
1923
- onClose: E,
1924
- disableHoverableContent: g,
1925
- children: n
1926
- }
1927
- ) });
1928
- };
1929
- Gt.displayName = de;
1930
- var Fe = "TooltipTrigger", qt = h.forwardRef(
1931
- (e, t) => {
1932
- const { __scopeTooltip: n, ...r } = e, o = Se(Fe, n), i = Ge(Fe, n), s = Te(n), a = h.useRef(null), c = ne(t, a, o.onTriggerChange), l = h.useRef(!1), f = h.useRef(!1), d = h.useCallback(() => l.current = !1, []);
1933
- return h.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ y(Xr, { asChild: !0, ...s, children: /* @__PURE__ */ y(
1934
- re.button,
1935
- {
1936
- "aria-describedby": o.open ? o.contentId : void 0,
1937
- "data-state": o.stateAttribute,
1938
- ...r,
1939
- ref: c,
1940
- onPointerMove: X(e.onPointerMove, (p) => {
1941
- p.pointerType !== "touch" && !f.current && !i.isPointerInTransitRef.current && (o.onTriggerEnter(), f.current = !0);
1942
- }),
1943
- onPointerLeave: X(e.onPointerLeave, () => {
1944
- o.onTriggerLeave(), f.current = !1;
1945
- }),
1946
- onPointerDown: X(e.onPointerDown, () => {
1947
- o.open && o.onClose(), l.current = !0, document.addEventListener("pointerup", d, { once: !0 });
1948
- }),
1949
- onFocus: X(e.onFocus, () => {
1950
- l.current || o.onOpen();
1951
- }),
1952
- onBlur: X(e.onBlur, o.onClose),
1953
- onClick: X(e.onClick, o.onClose)
1954
- }
1955
- ) });
1956
- }
1957
- );
1958
- qt.displayName = Fe;
1959
- var io = "TooltipPortal", [Do, so] = Pe(io, {
1960
- forceMount: void 0
1961
- }), ce = "TooltipContent", Kt = h.forwardRef(
1962
- (e, t) => {
1963
- const n = so(ce, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...i } = e, s = Se(ce, e.__scopeTooltip);
1964
- return /* @__PURE__ */ y(Vt, { present: r || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ y(Zt, { side: o, ...i, ref: t }) : /* @__PURE__ */ y(co, { side: o, ...i, ref: t }) });
1965
- }
1966
- ), co = h.forwardRef((e, t) => {
1967
- const n = Se(ce, e.__scopeTooltip), r = Ge(ce, e.__scopeTooltip), o = h.useRef(null), i = ne(t, o), [s, a] = h.useState(null), { trigger: c, onClose: l } = n, f = o.current, { onPointerInTransitChange: d } = r, p = h.useCallback(() => {
1968
- a(null), d(!1);
1969
- }, [d]), u = h.useCallback(
1970
- (g, m) => {
1971
- const v = g.currentTarget, x = { x: g.clientX, y: g.clientY }, w = po(x, v.getBoundingClientRect()), C = ho(x, w), b = mo(m.getBoundingClientRect()), E = vo([...C, ...b]);
1972
- a(E), d(!0);
1973
- },
1974
- [d]
1975
- );
1976
- return h.useEffect(() => () => p(), [p]), h.useEffect(() => {
1977
- if (c && f) {
1978
- const g = (v) => u(v, f), m = (v) => u(v, c);
1979
- return c.addEventListener("pointerleave", g), f.addEventListener("pointerleave", m), () => {
1980
- c.removeEventListener("pointerleave", g), f.removeEventListener("pointerleave", m);
1981
- };
1982
- }
1983
- }, [c, f, u, p]), h.useEffect(() => {
1984
- if (s) {
1985
- const g = (m) => {
1986
- const v = m.target, x = { x: m.clientX, y: m.clientY }, w = (c == null ? void 0 : c.contains(v)) || (f == null ? void 0 : f.contains(v)), C = !go(x, s);
1987
- w ? p() : C && (p(), l());
1988
- };
1989
- return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
1990
- }
1991
- }, [c, f, s, l, p]), /* @__PURE__ */ y(Zt, { ...e, ref: i });
1992
- }), [ao, lo] = Pe(de, { isInside: !1 }), fo = hn("TooltipContent"), Zt = h.forwardRef(
1993
- (e, t) => {
1994
- const {
1995
- __scopeTooltip: n,
1996
- children: r,
1997
- "aria-label": o,
1998
- onEscapeKeyDown: i,
1999
- onPointerDownOutside: s,
2000
- ...a
2001
- } = e, c = Se(ce, n), l = Te(n), { onClose: f } = c;
2002
- return h.useEffect(() => (document.addEventListener($e, f), () => document.removeEventListener($e, f)), [f]), h.useEffect(() => {
2003
- if (c.trigger) {
2004
- const d = (p) => {
2005
- const u = p.target;
2006
- u != null && u.contains(c.trigger) && f();
2007
- };
2008
- return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
2009
- }
2010
- }, [c.trigger, f]), /* @__PURE__ */ y(
2011
- yt,
2012
- {
2013
- asChild: !0,
2014
- disableOutsidePointerEvents: !1,
2015
- onEscapeKeyDown: i,
2016
- onPointerDownOutside: s,
2017
- onFocusOutside: (d) => d.preventDefault(),
2018
- onDismiss: f,
2019
- children: /* @__PURE__ */ $(
2020
- Gr,
2021
- {
2022
- "data-state": c.stateAttribute,
2023
- ...l,
2024
- ...a,
2025
- ref: t,
2026
- style: {
2027
- ...a.style,
2028
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
2029
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
2030
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
2031
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
2032
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
2033
- },
2034
- children: [
2035
- /* @__PURE__ */ y(fo, { children: r }),
2036
- /* @__PURE__ */ y(ao, { scope: n, isInside: !0, children: /* @__PURE__ */ y(to, { id: c.contentId, role: "tooltip", children: o || r }) })
2037
- ]
2038
- }
2039
- )
2040
- }
2041
- );
2042
- }
2043
- );
2044
- Kt.displayName = ce;
2045
- var Jt = "TooltipArrow", uo = h.forwardRef(
2046
- (e, t) => {
2047
- const { __scopeTooltip: n, ...r } = e, o = Te(n);
2048
- return lo(
2049
- Jt,
2050
- n
2051
- ).isInside ? null : /* @__PURE__ */ y(qr, { ...o, ...r, ref: t });
2052
- }
2053
- );
2054
- uo.displayName = Jt;
2055
- function po(e, t) {
2056
- const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
2057
- switch (Math.min(n, r, o, i)) {
2058
- case i:
2059
- return "left";
2060
- case o:
2061
- return "right";
2062
- case n:
2063
- return "top";
2064
- case r:
2065
- return "bottom";
2066
- default:
2067
- throw new Error("unreachable");
2068
- }
2069
- }
2070
- function ho(e, t, n = 5) {
2071
- const r = [];
2072
- switch (t) {
2073
- case "top":
2074
- r.push(
2075
- { x: e.x - n, y: e.y + n },
2076
- { x: e.x + n, y: e.y + n }
2077
- );
2078
- break;
2079
- case "bottom":
2080
- r.push(
2081
- { x: e.x - n, y: e.y - n },
2082
- { x: e.x + n, y: e.y - n }
2083
- );
2084
- break;
2085
- case "left":
2086
- r.push(
2087
- { x: e.x + n, y: e.y - n },
2088
- { x: e.x + n, y: e.y + n }
2089
- );
2090
- break;
2091
- case "right":
2092
- r.push(
2093
- { x: e.x - n, y: e.y - n },
2094
- { x: e.x - n, y: e.y + n }
2095
- );
2096
- break;
2097
- }
2098
- return r;
2099
- }
2100
- function mo(e) {
2101
- const { top: t, right: n, bottom: r, left: o } = e;
2102
- return [
2103
- { x: o, y: t },
2104
- { x: n, y: t },
2105
- { x: n, y: r },
2106
- { x: o, y: r }
2107
- ];
2108
- }
2109
- function go(e, t) {
2110
- const { x: n, y: r } = e;
2111
- let o = !1;
2112
- for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
2113
- const a = t[i], c = t[s], l = a.x, f = a.y, d = c.x, p = c.y;
2114
- f > r != p > r && n < (d - l) * (r - f) / (p - f) + l && (o = !o);
2115
- }
2116
- return o;
2117
- }
2118
- function vo(e) {
2119
- const t = e.slice();
2120
- return t.sort((n, r) => n.x < r.x ? -1 : n.x > r.x ? 1 : n.y < r.y ? -1 : n.y > r.y ? 1 : 0), xo(t);
2121
- }
2122
- function xo(e) {
2123
- if (e.length <= 1) return e.slice();
2124
- const t = [];
2125
- for (let r = 0; r < e.length; r++) {
2126
- const o = e[r];
2127
- for (; t.length >= 2; ) {
2128
- const i = t[t.length - 1], s = t[t.length - 2];
2129
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x)) t.pop();
2130
- else break;
2131
- }
2132
- t.push(o);
2133
- }
2134
- t.pop();
2135
- const n = [];
2136
- for (let r = e.length - 1; r >= 0; r--) {
2137
- const o = e[r];
2138
- for (; n.length >= 2; ) {
2139
- const i = n[n.length - 1], s = n[n.length - 2];
2140
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x)) n.pop();
2141
- else break;
2142
- }
2143
- n.push(o);
2144
- }
2145
- return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
2146
- }
2147
- var wo = Xt, yo = Gt, bo = qt, Qt = Kt;
2148
- const Co = wo, Ao = yo, Ro = bo, en = h.forwardRef(
2149
- ({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ y(
2150
- Qt,
2151
- {
2152
- ref: r,
2153
- sideOffset: t,
2154
- className: G(
2155
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2156
- e
2157
- ),
2158
- ...n
2159
- }
2160
- )
2161
- );
2162
- en.displayName = Qt.displayName;
2163
- const Eo = ({
2164
- path: e,
2165
- // eslint-disable-next-line @typescript-eslint/naming-convention
2166
- icon: t,
2167
- label: n,
2168
- badge: r,
2169
- subItems: o,
2170
- currentPath: i,
2171
- collapsed: s,
2172
- onItemClick: a
2173
- }) => {
2174
- const [c, l] = h.useState((o == null ? void 0 : o.some((m) => i === m.path || i.startsWith(`${m.path}/`))) || !1), f = e ? i === e || e !== "/" && i.startsWith(`${e}/`) : !1, d = o == null ? void 0 : o.some((m) => i === m.path || i.startsWith(`${m.path}/`)), g = /* @__PURE__ */ $(
2175
- "a",
2176
- {
2177
- href: e || "#",
2178
- onClick: (m) => {
2179
- m.preventDefault(), o && o.length > 0 ? s || l(!c) : e && a(e);
2180
- },
2181
- className: G(
2182
- "flex items-center gap-3 rounded-2xl cursor-pointer mb-2 transition-all duration-200 group",
2183
- s ? "justify-center p-3 h-12 w-12 mx-auto" : "px-4 py-3 h-12",
2184
- f || !s && d ? "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
2185
- ),
2186
- children: [
2187
- /* @__PURE__ */ y("div", { className: G("flex-shrink-0 transition-transform group-hover:scale-110", s ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ y(t, { className: "size-4" }) }),
2188
- !s && /* @__PURE__ */ $(nt, { children: [
2189
- /* @__PURE__ */ y("span", { className: "flex-grow transition-opacity duration-150 font-medium", children: n }),
2190
- r !== void 0 && /* @__PURE__ */ y("span", { className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold", children: r }),
2191
- o && o.length > 0 && /* @__PURE__ */ y(xn, { className: G("size-4 transition-transform duration-200", c ? "rotate-180" : "") })
2192
- ] })
2193
- ]
2194
- }
2195
- );
2196
- return /* @__PURE__ */ $(nt, { children: [
2197
- s ? /* @__PURE__ */ $(Ao, { children: [
2198
- /* @__PURE__ */ y(Ro, { asChild: !0, children: g }),
2199
- /* @__PURE__ */ y(
2200
- en,
2201
- {
2202
- side: "right",
2203
- sideOffset: 6,
2204
- className: "rounded-xl z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
2205
- children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ $("div", { className: "flex items-center gap-2", children: [
2206
- /* @__PURE__ */ y("p", { className: "font-semibold", children: n }),
2207
- r !== void 0 && /* @__PURE__ */ $("span", { className: "ml-1 text-xs", children: [
2208
- "(",
2209
- r,
2210
- ")"
2211
- ] })
2212
- ] }) })
2213
- }
2214
- )
2215
- ] }) : g,
2216
- !s && o && o.length > 0 && c && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1 mb-2 ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200", children: o.map((m, v) => {
2217
- const x = i === m.path || m.path !== "/" && i.startsWith(`${m.path}/`);
2218
- return /* @__PURE__ */ $(
2219
- "a",
2220
- {
2221
- href: m.path,
2222
- onClick: (w) => {
2223
- w.preventDefault(), a(m.path);
2224
- },
2225
- className: G(
2226
- "flex items-center justify-between px-4 py-2 rounded-xl text-sm transition-all duration-200",
2227
- x ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
2228
- ),
2229
- children: [
2230
- /* @__PURE__ */ y("span", { children: m.label }),
2231
- m.badge !== void 0 && /* @__PURE__ */ y("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: m.badge })
2232
- ]
2233
- },
2234
- v
2235
- );
2236
- }) })
2237
- ] });
2238
- }, Lo = ({
2239
- groups: e,
2240
- collapsed: t,
2241
- mobileOpen: n,
2242
- isMobile: r,
2243
- onMobileClose: o,
2244
- onItemClick: i,
2245
- currentPath: s,
2246
- appName: a = "appname",
2247
- appSubName: c = "appsubname",
2248
- appIcon: l,
2249
- headerNode: f,
2250
- footerNode: d
2251
- }) => {
2252
- const p = (u) => {
2253
- i(u), r && o();
2254
- };
2255
- return /* @__PURE__ */ y(Co, { delayDuration: 0, children: /* @__PURE__ */ $(
2256
- "aside",
2257
- {
2258
- className: G(
2259
- "flex flex-col bg-sidebar h-screen transition-all duration-300",
2260
- t ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
2261
- r && !n ? "hidden" : "flex"
2262
- ),
2263
- style: {
2264
- "--navbar-width": "16rem",
2265
- "--navbar-width-icon": "5rem"
2266
- },
2267
- children: [
2268
- f || /* @__PURE__ */ $("div", { className: G("flex items-center h-16 md:h-20 flex-shrink-0 gap-3 px-4", t ? "justify-center" : ""), children: [
2269
- l !== void 0 && /* @__PURE__ */ y("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ y(l, { className: "size-6" }) }),
2270
- !t && /* @__PURE__ */ $("div", { className: "flex flex-col", children: [
2271
- /* @__PURE__ */ y("h1", { className: "font-bold text-lg text-sidebar-foreground leading-tight", children: a }),
2272
- /* @__PURE__ */ y("span", { className: "text-xs text-sidebar-muted font-medium", children: c })
2273
- ] })
2274
- ] }),
2275
- /* @__PURE__ */ y("div", { className: "flex-1 overflow-y-auto py-4 px-2 scrollbar-modern", children: e.map((u, g) => /* @__PURE__ */ $("div", { className: "mb-6", children: [
2276
- !t && u.title !== void 0 && u.title !== "" && /* @__PURE__ */ y("h3", { className: "px-4 mb-2 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", children: u.title }),
2277
- /* @__PURE__ */ y("nav", { className: "flex flex-col gap-1", children: u.items.map((m, v) => /* @__PURE__ */ y(Eo, { ...m, currentPath: s, collapsed: t, onItemClick: p }, v)) })
2278
- ] }, g)) }),
2279
- d && /* @__PURE__ */ y("div", { className: G("p-4 border-t border-sidebar-border", t ? "flex justify-center" : ""), children: d })
2280
- ]
2281
- }
2282
- ) });
2283
- }, Mo = ({ collapsed: e, isMobile: t, onToggleSidebar: n, actionsNode: r, userMenuNode: o }) => /* @__PURE__ */ $(
2284
- "header",
2285
- {
2286
- className: G(
2287
- "fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300",
2288
- t && "left-0",
2289
- !t && e && "left-[5rem]",
2290
- !t && !e && "left-[16rem]"
2291
- ),
2292
- tabIndex: -1,
2293
- children: [
2294
- /* @__PURE__ */ y("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ y(
2295
- gn,
2296
- {
2297
- variant: "ghost",
2298
- size: "icon",
2299
- onClick: n,
2300
- className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
2301
- children: /* @__PURE__ */ y(yn, { className: "size-4" })
2302
- }
2303
- ) }),
2304
- /* @__PURE__ */ $("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
2305
- r,
2306
- o
2307
- ] })
2308
- ]
2309
- }
2310
- );
2311
- export {
2312
- Lo as S,
2313
- Mo as T
2314
- };