@krosoft/react 0.0.86 → 0.0.88

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 (41) hide show
  1. package/dist/AppSubTitle-DaFa30Qp.js +13 -0
  2. package/dist/{AppTitle-2BwwWSnl.js → AppTitle-COtcNGNr.js} +4 -4
  3. package/dist/AppVerticalTabs-aeKDheVe.js +829 -0
  4. package/dist/{FormDialog--99pXUqP.js → FormDialog-B3u7bHU_.js} +18 -18
  5. package/dist/{MetricCard-BRAVWmNa.js → MetricCard-L5ETuqBs.js} +3 -3
  6. package/dist/{SearchInput-CJe4D2eD.js → SearchInput-BxnaShYy.js} +3 -3
  7. package/dist/{TableFilter-5_KAD-Po.js → TableFilter-RzydxKBF.js} +5 -5
  8. package/dist/{TableSettings-XUosW5z7.js → TableSettings-Bwysm3KH.js} +15 -15
  9. package/dist/{ThemeSelector-CpHyRG1j.js → ThemeSelector-mZBbr2qt.js} +3 -3
  10. package/dist/{Topbar-B-4vtD89.js → Topbar-DzFClMWt.js} +4 -4
  11. package/dist/{badge-Bw-aBz_H.js → badge-DCS7KMnM.js} +1 -1
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/dialogs/index.js +1 -1
  14. package/dist/components/core/filters/index.js +1 -1
  15. package/dist/components/core/index.js +38 -36
  16. package/dist/components/core/inputs/index.js +1 -1
  17. package/dist/components/core/layouts/AppSubTitle.d.ts +8 -0
  18. package/dist/components/core/layouts/AppSubTitle.d.ts.map +1 -0
  19. package/dist/components/core/layouts/index.d.ts +1 -0
  20. package/dist/components/core/layouts/index.d.ts.map +1 -1
  21. package/dist/components/core/layouts/index.js +5 -3
  22. package/dist/components/core/navbar/index.js +1 -1
  23. package/dist/components/core/table/index.js +1 -1
  24. package/dist/components/core/tabs/index.js +1 -1
  25. package/dist/components/core/theme/index.js +1 -1
  26. package/dist/components/index.js +84 -82
  27. package/dist/components/ui/index.js +4 -4
  28. package/dist/dropdown-menu-BDcm9kW8.js +1086 -0
  29. package/dist/index-DUnCfjrC.js +2176 -0
  30. package/dist/popover-PsZp711z.js +4533 -0
  31. package/dist/select-C6w0ck7-.js +1737 -0
  32. package/dist/tooltip-CtjaR1qq.js +337 -0
  33. package/dist/types/UseDataTableResult.d.ts +1 -1
  34. package/dist/types/UseDataTableResult.d.ts.map +1 -1
  35. package/package.json +7 -6
  36. package/dist/AppVerticalTabs-Czaejh1i.js +0 -1302
  37. package/dist/dropdown-menu-D3C3wkLH.js +0 -1685
  38. package/dist/floating-ui.react-dom-BIcsGc3t.js +0 -1681
  39. package/dist/popover-BEB_r1Wm.js +0 -5897
  40. package/dist/select-B_OLzx1W.js +0 -2071
  41. package/dist/tooltip-DzQngJZK.js +0 -828
@@ -1,1681 +0,0 @@
1
- import * as g from "react";
2
- import { useLayoutEffect as ne } from "react";
3
- import { jsx as nt } from "react/jsx-runtime";
4
- import { c as oe } from "./createLucideIcon-CRdjzt2A.js";
5
- import { a as re, c as ie } from "./index-gWiv5-6R.js";
6
- import * as se from "react-dom";
7
- const Lt = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Tt = re, ce = (t, e) => (n) => {
8
- var o;
9
- if ((e == null ? void 0 : e.variants) == null) return Tt(t, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
10
- const { variants: r, defaultVariants: i } = e, s = Object.keys(r).map((a) => {
11
- const l = n == null ? void 0 : n[a], u = i == null ? void 0 : i[a];
12
- if (l === null) return null;
13
- const d = Lt(l) || Lt(u);
14
- return r[a][d];
15
- }), c = n && Object.entries(n).reduce((a, l) => {
16
- let [u, d] = l;
17
- return d === void 0 || (a[u] = d), a;
18
- }, {}), f = e == null || (o = e.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((a, l) => {
19
- let { class: u, className: d, ...m } = l;
20
- return Object.entries(m).every((h) => {
21
- let [p, y] = h;
22
- return Array.isArray(y) ? y.includes({
23
- ...i,
24
- ...c
25
- }[p]) : {
26
- ...i,
27
- ...c
28
- }[p] === y;
29
- }) ? [
30
- ...a,
31
- u,
32
- d
33
- ] : a;
34
- }, []);
35
- return Tt(t, s, f, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
36
- };
37
- function Dt(t, e) {
38
- if (typeof t == "function")
39
- return t(e);
40
- t != null && (t.current = e);
41
- }
42
- function It(...t) {
43
- return (e) => {
44
- let n = !1;
45
- const o = t.map((r) => {
46
- const i = Dt(r, e);
47
- return !n && typeof i == "function" && (n = !0), i;
48
- });
49
- if (n)
50
- return () => {
51
- for (let r = 0; r < o.length; r++) {
52
- const i = o[r];
53
- typeof i == "function" ? i() : Dt(t[r], null);
54
- }
55
- };
56
- };
57
- }
58
- function En(...t) {
59
- return g.useCallback(It(...t), t);
60
- }
61
- function Pn(t, e) {
62
- const n = g.createContext(e), o = (i) => {
63
- const { children: s, ...c } = i, f = g.useMemo(() => c, Object.values(c));
64
- return /* @__PURE__ */ nt(n.Provider, { value: f, children: s });
65
- };
66
- o.displayName = t + "Provider";
67
- function r(i) {
68
- const s = g.useContext(n);
69
- if (s) return s;
70
- if (e !== void 0) return e;
71
- throw new Error(`\`${i}\` must be used within \`${t}\``);
72
- }
73
- return [o, r];
74
- }
75
- function Ln(t, e = []) {
76
- let n = [];
77
- function o(i, s) {
78
- const c = g.createContext(s), f = n.length;
79
- n = [...n, s];
80
- const a = (u) => {
81
- var w;
82
- const { scope: d, children: m, ...h } = u, p = ((w = d == null ? void 0 : d[t]) == null ? void 0 : w[f]) || c, y = g.useMemo(() => h, Object.values(h));
83
- return /* @__PURE__ */ nt(p.Provider, { value: y, children: m });
84
- };
85
- a.displayName = i + "Provider";
86
- function l(u, d) {
87
- var p;
88
- const m = ((p = d == null ? void 0 : d[t]) == null ? void 0 : p[f]) || c, h = g.useContext(m);
89
- if (h) return h;
90
- if (s !== void 0) return s;
91
- throw new Error(`\`${u}\` must be used within \`${i}\``);
92
- }
93
- return [a, l];
94
- }
95
- const r = () => {
96
- const i = n.map((s) => g.createContext(s));
97
- return function(c) {
98
- const f = (c == null ? void 0 : c[t]) || i;
99
- return g.useMemo(
100
- () => ({ [`__scope${t}`]: { ...c, [t]: f } }),
101
- [c, f]
102
- );
103
- };
104
- };
105
- return r.scopeName = t, [o, le(r, ...e)];
106
- }
107
- function le(...t) {
108
- const e = t[0];
109
- if (t.length === 1) return e;
110
- const n = () => {
111
- const o = t.map((r) => ({
112
- useScope: r(),
113
- scopeName: r.scopeName
114
- }));
115
- return function(i) {
116
- const s = o.reduce((c, { useScope: f, scopeName: a }) => {
117
- const u = f(i)[`__scope${a}`];
118
- return { ...c, ...u };
119
- }, {});
120
- return g.useMemo(() => ({ [`__scope${e.scopeName}`]: s }), [s]);
121
- };
122
- };
123
- return n.scopeName = e.scopeName, n;
124
- }
125
- function Tn(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
126
- return function(r) {
127
- if (t == null || t(r), n === !1 || !r.defaultPrevented)
128
- return e == null ? void 0 : e(r);
129
- };
130
- }
131
- var Rt = globalThis != null && globalThis.document ? g.useLayoutEffect : () => {
132
- }, fe = g[" useInsertionEffect ".trim().toString()] || Rt;
133
- function Dn({
134
- prop: t,
135
- defaultProp: e,
136
- onChange: n = () => {
137
- },
138
- caller: o
139
- }) {
140
- const [r, i, s] = ae({
141
- defaultProp: e,
142
- onChange: n
143
- }), c = t !== void 0, f = c ? t : r;
144
- {
145
- const l = g.useRef(t !== void 0);
146
- g.useEffect(() => {
147
- const u = l.current;
148
- u !== c && console.warn(
149
- `${o} is changing from ${u ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
150
- ), l.current = c;
151
- }, [c, o]);
152
- }
153
- const a = g.useCallback(
154
- (l) => {
155
- var u;
156
- if (c) {
157
- const d = ue(l) ? l(t) : l;
158
- d !== t && ((u = s.current) == null || u.call(s, d));
159
- } else
160
- i(l);
161
- },
162
- [c, t, i, s]
163
- );
164
- return [f, a];
165
- }
166
- function ae({
167
- defaultProp: t,
168
- onChange: e
169
- }) {
170
- const [n, o] = g.useState(t), r = g.useRef(n), i = g.useRef(e);
171
- return fe(() => {
172
- i.current = e;
173
- }, [e]), g.useEffect(() => {
174
- var s;
175
- r.current !== n && ((s = i.current) == null || s.call(i, n), r.current = n);
176
- }, [n, r]), [n, o, i];
177
- }
178
- function ue(t) {
179
- return typeof t == "function";
180
- }
181
- function Mn(t) {
182
- const [e, n] = g.useState(void 0);
183
- return Rt(() => {
184
- if (t) {
185
- n({ width: t.offsetWidth, height: t.offsetHeight });
186
- const o = new ResizeObserver((r) => {
187
- if (!Array.isArray(r) || !r.length)
188
- return;
189
- const i = r[0];
190
- let s, c;
191
- if ("borderBoxSize" in i) {
192
- const f = i.borderBoxSize, a = Array.isArray(f) ? f[0] : f;
193
- s = a.inlineSize, c = a.blockSize;
194
- } else
195
- s = t.offsetWidth, c = t.offsetHeight;
196
- n({ width: s, height: c });
197
- });
198
- return o.observe(t, { box: "border-box" }), () => o.unobserve(t);
199
- } else
200
- n(void 0);
201
- }, [t]), e;
202
- }
203
- /**
204
- * @license lucide-react v1.16.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */
209
- const de = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], kn = oe("chevron-down", de);
210
- var me = Symbol.for("react.lazy"), ct = g[" use ".trim().toString()];
211
- function he(t) {
212
- return typeof t == "object" && t !== null && "then" in t;
213
- }
214
- function Ht(t) {
215
- return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === me && "_payload" in t && he(t._payload);
216
- }
217
- // @__NO_SIDE_EFFECTS__
218
- function ge(t) {
219
- const e = /* @__PURE__ */ ye(t), n = g.forwardRef((o, r) => {
220
- let { children: i, ...s } = o;
221
- Ht(i) && typeof ct == "function" && (i = ct(i._payload));
222
- const c = g.Children.toArray(i), f = c.find(xe);
223
- if (f) {
224
- const a = f.props.children, l = c.map((u) => u === f ? g.Children.count(a) > 1 ? g.Children.only(null) : g.isValidElement(a) ? a.props.children : null : u);
225
- return /* @__PURE__ */ nt(e, { ...s, ref: r, children: g.isValidElement(a) ? g.cloneElement(a, void 0, l) : null });
226
- }
227
- return /* @__PURE__ */ nt(e, { ...s, ref: r, children: i });
228
- });
229
- return n.displayName = `${t}.Slot`, n;
230
- }
231
- var pe = /* @__PURE__ */ ge("Slot");
232
- // @__NO_SIDE_EFFECTS__
233
- function ye(t) {
234
- const e = g.forwardRef((n, o) => {
235
- let { children: r, ...i } = n;
236
- if (Ht(r) && typeof ct == "function" && (r = ct(r._payload)), g.isValidElement(r)) {
237
- const s = be(r), c = ve(i, r.props);
238
- return r.type !== g.Fragment && (c.ref = o ? It(o, s) : s), g.cloneElement(r, c);
239
- }
240
- return g.Children.count(r) > 1 ? g.Children.only(null) : null;
241
- });
242
- return e.displayName = `${t}.SlotClone`, e;
243
- }
244
- var we = Symbol("radix.slottable");
245
- function xe(t) {
246
- return g.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === we;
247
- }
248
- function ve(t, e) {
249
- const n = { ...e };
250
- for (const o in e) {
251
- const r = t[o], i = e[o];
252
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
253
- const f = i(...c);
254
- return r(...c), f;
255
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
256
- }
257
- return { ...t, ...n };
258
- }
259
- function be(t) {
260
- var o, r;
261
- let e = (o = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : o.get, n = e && "isReactWarning" in e && e.isReactWarning;
262
- return n ? t.ref : (e = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
263
- }
264
- const Re = ce(
265
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
266
- {
267
- variants: {
268
- variant: {
269
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
270
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
271
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
272
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
273
- ghost: "hover:bg-accent hover:text-accent-foreground",
274
- link: "text-primary underline-offset-4 hover:underline",
275
- styled: "bg-gradient-to-r from-slate-900 to-purple-700 hover:from-slate-800 hover:to-purple-600 text-white shadow-lg shadow-purple-500/25 px-6 h-12"
276
- },
277
- size: {
278
- default: "h-10 px-4 py-2",
279
- sm: "h-9 rounded-md px-3",
280
- lg: "h-11 rounded-md px-8",
281
- icon: "h-10 w-10"
282
- }
283
- },
284
- defaultVariants: {
285
- variant: "default",
286
- size: "default"
287
- }
288
- }
289
- ), Ce = g.forwardRef(({ className: t, variant: e, size: n, asChild: o = !1, ...r }, i) => /* @__PURE__ */ nt(o ? pe : "button", { className: ie(Re({ variant: e, size: n, className: t })), ref: i, ...r }));
290
- Ce.displayName = "Button";
291
- function Se(t) {
292
- const e = g.useRef(t);
293
- return g.useEffect(() => {
294
- e.current = t;
295
- }), g.useMemo(() => (...n) => {
296
- var o;
297
- return (o = e.current) == null ? void 0 : o.call(e, ...n);
298
- }, []);
299
- }
300
- function $n(t, e = globalThis == null ? void 0 : globalThis.document) {
301
- const n = Se(t);
302
- g.useEffect(() => {
303
- const o = (r) => {
304
- r.key === "Escape" && n(r);
305
- };
306
- return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
307
- }, [n, e]);
308
- }
309
- var Ae = g[" useId ".trim().toString()] || (() => {
310
- }), Oe = 0;
311
- function _n(t) {
312
- const [e, n] = g.useState(Ae());
313
- return Rt(() => {
314
- n((o) => o ?? String(Oe++));
315
- }, [t]), e ? `radix-${e}` : "";
316
- }
317
- const Ee = ["top", "right", "bottom", "left"], K = Math.min, $ = Math.max, lt = Math.round, it = Math.floor, j = (t) => ({
318
- x: t,
319
- y: t
320
- }), Pe = {
321
- left: "right",
322
- right: "left",
323
- bottom: "top",
324
- top: "bottom"
325
- };
326
- function xt(t, e, n) {
327
- return $(t, K(e, n));
328
- }
329
- function H(t, e) {
330
- return typeof t == "function" ? t(e) : t;
331
- }
332
- function X(t) {
333
- return t.split("-")[0];
334
- }
335
- function tt(t) {
336
- return t.split("-")[1];
337
- }
338
- function Ct(t) {
339
- return t === "x" ? "y" : "x";
340
- }
341
- function St(t) {
342
- return t === "y" ? "height" : "width";
343
- }
344
- function B(t) {
345
- const e = t[0];
346
- return e === "t" || e === "b" ? "y" : "x";
347
- }
348
- function At(t) {
349
- return Ct(B(t));
350
- }
351
- function Le(t, e, n) {
352
- n === void 0 && (n = !1);
353
- const o = tt(t), r = At(t), i = St(r);
354
- let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
355
- return e.reference[i] > e.floating[i] && (s = ft(s)), [s, ft(s)];
356
- }
357
- function Te(t) {
358
- const e = ft(t);
359
- return [vt(t), e, vt(e)];
360
- }
361
- function vt(t) {
362
- return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
363
- }
364
- const Mt = ["left", "right"], kt = ["right", "left"], De = ["top", "bottom"], Me = ["bottom", "top"];
365
- function ke(t, e, n) {
366
- switch (t) {
367
- case "top":
368
- case "bottom":
369
- return n ? e ? kt : Mt : e ? Mt : kt;
370
- case "left":
371
- case "right":
372
- return e ? De : Me;
373
- default:
374
- return [];
375
- }
376
- }
377
- function $e(t, e, n, o) {
378
- const r = tt(t);
379
- let i = ke(X(t), n === "start", o);
380
- return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(vt)))), i;
381
- }
382
- function ft(t) {
383
- const e = X(t);
384
- return Pe[e] + t.slice(e.length);
385
- }
386
- function _e(t) {
387
- return {
388
- top: 0,
389
- right: 0,
390
- bottom: 0,
391
- left: 0,
392
- ...t
393
- };
394
- }
395
- function Xt(t) {
396
- return typeof t != "number" ? _e(t) : {
397
- top: t,
398
- right: t,
399
- bottom: t,
400
- left: t
401
- };
402
- }
403
- function at(t) {
404
- const {
405
- x: e,
406
- y: n,
407
- width: o,
408
- height: r
409
- } = t;
410
- return {
411
- width: o,
412
- height: r,
413
- top: n,
414
- left: e,
415
- right: e + o,
416
- bottom: n + r,
417
- x: e,
418
- y: n
419
- };
420
- }
421
- function $t(t, e, n) {
422
- let {
423
- reference: o,
424
- floating: r
425
- } = t;
426
- const i = B(e), s = At(e), c = St(s), f = X(e), a = i === "y", l = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
427
- let m;
428
- switch (f) {
429
- case "top":
430
- m = {
431
- x: l,
432
- y: o.y - r.height
433
- };
434
- break;
435
- case "bottom":
436
- m = {
437
- x: l,
438
- y: o.y + o.height
439
- };
440
- break;
441
- case "right":
442
- m = {
443
- x: o.x + o.width,
444
- y: u
445
- };
446
- break;
447
- case "left":
448
- m = {
449
- x: o.x - r.width,
450
- y: u
451
- };
452
- break;
453
- default:
454
- m = {
455
- x: o.x,
456
- y: o.y
457
- };
458
- }
459
- switch (tt(e)) {
460
- case "start":
461
- m[s] -= d * (n && a ? -1 : 1);
462
- break;
463
- case "end":
464
- m[s] += d * (n && a ? -1 : 1);
465
- break;
466
- }
467
- return m;
468
- }
469
- async function Ne(t, e) {
470
- var n;
471
- e === void 0 && (e = {});
472
- const {
473
- x: o,
474
- y: r,
475
- platform: i,
476
- rects: s,
477
- elements: c,
478
- strategy: f
479
- } = t, {
480
- boundary: a = "clippingAncestors",
481
- rootBoundary: l = "viewport",
482
- elementContext: u = "floating",
483
- altBoundary: d = !1,
484
- padding: m = 0
485
- } = H(e, t), h = Xt(m), y = c[d ? u === "floating" ? "reference" : "floating" : u], w = at(await i.getClippingRect({
486
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
487
- boundary: a,
488
- rootBoundary: l,
489
- strategy: f
490
- })), b = u === "floating" ? {
491
- x: o,
492
- y: r,
493
- width: s.floating.width,
494
- height: s.floating.height
495
- } : s.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
496
- x: 1,
497
- y: 1
498
- } : {
499
- x: 1,
500
- y: 1
501
- }, R = at(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
502
- elements: c,
503
- rect: b,
504
- offsetParent: v,
505
- strategy: f
506
- }) : b);
507
- return {
508
- top: (w.top - R.top + h.top) / x.y,
509
- bottom: (R.bottom - w.bottom + h.bottom) / x.y,
510
- left: (w.left - R.left + h.left) / x.x,
511
- right: (R.right - w.right + h.right) / x.x
512
- };
513
- }
514
- const We = 50, Fe = async (t, e, n) => {
515
- const {
516
- placement: o = "bottom",
517
- strategy: r = "absolute",
518
- middleware: i = [],
519
- platform: s
520
- } = n, c = s.detectOverflow ? s : {
521
- ...s,
522
- detectOverflow: Ne
523
- }, f = await (s.isRTL == null ? void 0 : s.isRTL(e));
524
- let a = await s.getElementRects({
525
- reference: t,
526
- floating: e,
527
- strategy: r
528
- }), {
529
- x: l,
530
- y: u
531
- } = $t(a, o, f), d = o, m = 0;
532
- const h = {};
533
- for (let p = 0; p < i.length; p++) {
534
- const y = i[p];
535
- if (!y)
536
- continue;
537
- const {
538
- name: w,
539
- fn: b
540
- } = y, {
541
- x: v,
542
- y: x,
543
- data: R,
544
- reset: C
545
- } = await b({
546
- x: l,
547
- y: u,
548
- initialPlacement: o,
549
- placement: d,
550
- strategy: r,
551
- middlewareData: h,
552
- rects: a,
553
- platform: c,
554
- elements: {
555
- reference: t,
556
- floating: e
557
- }
558
- });
559
- l = v ?? l, u = x ?? u, h[w] = {
560
- ...h[w],
561
- ...R
562
- }, C && m < We && (m++, typeof C == "object" && (C.placement && (d = C.placement), C.rects && (a = C.rects === !0 ? await s.getElementRects({
563
- reference: t,
564
- floating: e,
565
- strategy: r
566
- }) : C.rects), {
567
- x: l,
568
- y: u
569
- } = $t(a, d, f)), p = -1);
570
- }
571
- return {
572
- x: l,
573
- y: u,
574
- placement: d,
575
- strategy: r,
576
- middlewareData: h
577
- };
578
- }, Ve = (t) => ({
579
- name: "arrow",
580
- options: t,
581
- async fn(e) {
582
- const {
583
- x: n,
584
- y: o,
585
- placement: r,
586
- rects: i,
587
- platform: s,
588
- elements: c,
589
- middlewareData: f
590
- } = e, {
591
- element: a,
592
- padding: l = 0
593
- } = H(t, e) || {};
594
- if (a == null)
595
- return {};
596
- const u = Xt(l), d = {
597
- x: n,
598
- y: o
599
- }, m = At(r), h = St(m), p = await s.getDimensions(a), y = m === "y", w = y ? "top" : "left", b = y ? "bottom" : "right", v = y ? "clientHeight" : "clientWidth", x = i.reference[h] + i.reference[m] - d[m] - i.floating[h], R = d[m] - i.reference[m], C = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
600
- let A = C ? C[v] : 0;
601
- (!A || !await (s.isElement == null ? void 0 : s.isElement(C))) && (A = c.floating[v] || i.floating[h]);
602
- const L = x / 2 - R / 2, N = A / 2 - p[h] / 2 - 1, P = K(u[w], N), W = K(u[b], N), M = P, T = A - p[h] - W, O = A / 2 - p[h] / 2 + L, z = xt(M, O, T), E = !f.arrow && tt(r) != null && O !== z && i.reference[h] / 2 - (O < M ? P : W) - p[h] / 2 < 0, D = E ? O < M ? O - M : O - T : 0;
603
- return {
604
- [m]: d[m] + D,
605
- data: {
606
- [m]: z,
607
- centerOffset: O - z - D,
608
- ...E && {
609
- alignmentOffset: D
610
- }
611
- },
612
- reset: E
613
- };
614
- }
615
- }), ze = function(t) {
616
- return t === void 0 && (t = {}), {
617
- name: "flip",
618
- options: t,
619
- async fn(e) {
620
- var n, o;
621
- const {
622
- placement: r,
623
- middlewareData: i,
624
- rects: s,
625
- initialPlacement: c,
626
- platform: f,
627
- elements: a
628
- } = e, {
629
- mainAxis: l = !0,
630
- crossAxis: u = !0,
631
- fallbackPlacements: d,
632
- fallbackStrategy: m = "bestFit",
633
- fallbackAxisSideDirection: h = "none",
634
- flipAlignment: p = !0,
635
- ...y
636
- } = H(t, e);
637
- if ((n = i.arrow) != null && n.alignmentOffset)
638
- return {};
639
- const w = X(r), b = B(c), v = X(c) === c, x = await (f.isRTL == null ? void 0 : f.isRTL(a.floating)), R = d || (v || !p ? [ft(c)] : Te(c)), C = h !== "none";
640
- !d && C && R.push(...$e(c, p, h, x));
641
- const A = [c, ...R], L = await f.detectOverflow(e, y), N = [];
642
- let P = ((o = i.flip) == null ? void 0 : o.overflows) || [];
643
- if (l && N.push(L[w]), u) {
644
- const O = Le(r, s, x);
645
- N.push(L[O[0]], L[O[1]]);
646
- }
647
- if (P = [...P, {
648
- placement: r,
649
- overflows: N
650
- }], !N.every((O) => O <= 0)) {
651
- var W, M;
652
- const O = (((W = i.flip) == null ? void 0 : W.index) || 0) + 1, z = A[O];
653
- if (z && (!(u === "alignment" ? b !== B(z) : !1) || // We leave the current main axis only if every placement on that axis
654
- // overflows the main axis.
655
- P.every((S) => B(S.placement) === b ? S.overflows[0] > 0 : !0)))
656
- return {
657
- data: {
658
- index: O,
659
- overflows: P
660
- },
661
- reset: {
662
- placement: z
663
- }
664
- };
665
- let E = (M = P.filter((D) => D.overflows[0] <= 0).sort((D, S) => D.overflows[1] - S.overflows[1])[0]) == null ? void 0 : M.placement;
666
- if (!E)
667
- switch (m) {
668
- case "bestFit": {
669
- var T;
670
- const D = (T = P.filter((S) => {
671
- if (C) {
672
- const k = B(S.placement);
673
- return k === b || // Create a bias to the `y` side axis due to horizontal
674
- // reading directions favoring greater width.
675
- k === "y";
676
- }
677
- return !0;
678
- }).map((S) => [S.placement, S.overflows.filter((k) => k > 0).reduce((k, q) => k + q, 0)]).sort((S, k) => S[1] - k[1])[0]) == null ? void 0 : T[0];
679
- D && (E = D);
680
- break;
681
- }
682
- case "initialPlacement":
683
- E = c;
684
- break;
685
- }
686
- if (r !== E)
687
- return {
688
- reset: {
689
- placement: E
690
- }
691
- };
692
- }
693
- return {};
694
- }
695
- };
696
- };
697
- function _t(t, e) {
698
- return {
699
- top: t.top - e.height,
700
- right: t.right - e.width,
701
- bottom: t.bottom - e.height,
702
- left: t.left - e.width
703
- };
704
- }
705
- function Nt(t) {
706
- return Ee.some((e) => t[e] >= 0);
707
- }
708
- const Be = function(t) {
709
- return t === void 0 && (t = {}), {
710
- name: "hide",
711
- options: t,
712
- async fn(e) {
713
- const {
714
- rects: n,
715
- platform: o
716
- } = e, {
717
- strategy: r = "referenceHidden",
718
- ...i
719
- } = H(t, e);
720
- switch (r) {
721
- case "referenceHidden": {
722
- const s = await o.detectOverflow(e, {
723
- ...i,
724
- elementContext: "reference"
725
- }), c = _t(s, n.reference);
726
- return {
727
- data: {
728
- referenceHiddenOffsets: c,
729
- referenceHidden: Nt(c)
730
- }
731
- };
732
- }
733
- case "escaped": {
734
- const s = await o.detectOverflow(e, {
735
- ...i,
736
- altBoundary: !0
737
- }), c = _t(s, n.floating);
738
- return {
739
- data: {
740
- escapedOffsets: c,
741
- escaped: Nt(c)
742
- }
743
- };
744
- }
745
- default:
746
- return {};
747
- }
748
- }
749
- };
750
- }, Yt = /* @__PURE__ */ new Set(["left", "top"]);
751
- async function je(t, e) {
752
- const {
753
- placement: n,
754
- platform: o,
755
- elements: r
756
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = X(n), c = tt(n), f = B(n) === "y", a = Yt.has(s) ? -1 : 1, l = i && f ? -1 : 1, u = H(e, t);
757
- let {
758
- mainAxis: d,
759
- crossAxis: m,
760
- alignmentAxis: h
761
- } = typeof u == "number" ? {
762
- mainAxis: u,
763
- crossAxis: 0,
764
- alignmentAxis: null
765
- } : {
766
- mainAxis: u.mainAxis || 0,
767
- crossAxis: u.crossAxis || 0,
768
- alignmentAxis: u.alignmentAxis
769
- };
770
- return c && typeof h == "number" && (m = c === "end" ? h * -1 : h), f ? {
771
- x: m * l,
772
- y: d * a
773
- } : {
774
- x: d * a,
775
- y: m * l
776
- };
777
- }
778
- const Ie = function(t) {
779
- return t === void 0 && (t = 0), {
780
- name: "offset",
781
- options: t,
782
- async fn(e) {
783
- var n, o;
784
- const {
785
- x: r,
786
- y: i,
787
- placement: s,
788
- middlewareData: c
789
- } = e, f = await je(e, t);
790
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
791
- x: r + f.x,
792
- y: i + f.y,
793
- data: {
794
- ...f,
795
- placement: s
796
- }
797
- };
798
- }
799
- };
800
- }, He = function(t) {
801
- return t === void 0 && (t = {}), {
802
- name: "shift",
803
- options: t,
804
- async fn(e) {
805
- const {
806
- x: n,
807
- y: o,
808
- placement: r,
809
- platform: i
810
- } = e, {
811
- mainAxis: s = !0,
812
- crossAxis: c = !1,
813
- limiter: f = {
814
- fn: (w) => {
815
- let {
816
- x: b,
817
- y: v
818
- } = w;
819
- return {
820
- x: b,
821
- y: v
822
- };
823
- }
824
- },
825
- ...a
826
- } = H(t, e), l = {
827
- x: n,
828
- y: o
829
- }, u = await i.detectOverflow(e, a), d = B(X(r)), m = Ct(d);
830
- let h = l[m], p = l[d];
831
- if (s) {
832
- const w = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", v = h + u[w], x = h - u[b];
833
- h = xt(v, h, x);
834
- }
835
- if (c) {
836
- const w = d === "y" ? "top" : "left", b = d === "y" ? "bottom" : "right", v = p + u[w], x = p - u[b];
837
- p = xt(v, p, x);
838
- }
839
- const y = f.fn({
840
- ...e,
841
- [m]: h,
842
- [d]: p
843
- });
844
- return {
845
- ...y,
846
- data: {
847
- x: y.x - n,
848
- y: y.y - o,
849
- enabled: {
850
- [m]: s,
851
- [d]: c
852
- }
853
- }
854
- };
855
- }
856
- };
857
- }, Xe = function(t) {
858
- return t === void 0 && (t = {}), {
859
- options: t,
860
- fn(e) {
861
- const {
862
- x: n,
863
- y: o,
864
- placement: r,
865
- rects: i,
866
- middlewareData: s
867
- } = e, {
868
- offset: c = 0,
869
- mainAxis: f = !0,
870
- crossAxis: a = !0
871
- } = H(t, e), l = {
872
- x: n,
873
- y: o
874
- }, u = B(r), d = Ct(u);
875
- let m = l[d], h = l[u];
876
- const p = H(c, e), y = typeof p == "number" ? {
877
- mainAxis: p,
878
- crossAxis: 0
879
- } : {
880
- mainAxis: 0,
881
- crossAxis: 0,
882
- ...p
883
- };
884
- if (f) {
885
- const v = d === "y" ? "height" : "width", x = i.reference[d] - i.floating[v] + y.mainAxis, R = i.reference[d] + i.reference[v] - y.mainAxis;
886
- m < x ? m = x : m > R && (m = R);
887
- }
888
- if (a) {
889
- var w, b;
890
- const v = d === "y" ? "width" : "height", x = Yt.has(X(r)), R = i.reference[u] - i.floating[v] + (x && ((w = s.offset) == null ? void 0 : w[u]) || 0) + (x ? 0 : y.crossAxis), C = i.reference[u] + i.reference[v] + (x ? 0 : ((b = s.offset) == null ? void 0 : b[u]) || 0) - (x ? y.crossAxis : 0);
891
- h < R ? h = R : h > C && (h = C);
892
- }
893
- return {
894
- [d]: m,
895
- [u]: h
896
- };
897
- }
898
- };
899
- }, Ye = function(t) {
900
- return t === void 0 && (t = {}), {
901
- name: "size",
902
- options: t,
903
- async fn(e) {
904
- var n, o;
905
- const {
906
- placement: r,
907
- rects: i,
908
- platform: s,
909
- elements: c
910
- } = e, {
911
- apply: f = () => {
912
- },
913
- ...a
914
- } = H(t, e), l = await s.detectOverflow(e, a), u = X(r), d = tt(r), m = B(r) === "y", {
915
- width: h,
916
- height: p
917
- } = i.floating;
918
- let y, w;
919
- u === "top" || u === "bottom" ? (y = u, w = d === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = u, y = d === "end" ? "top" : "bottom");
920
- const b = p - l.top - l.bottom, v = h - l.left - l.right, x = K(p - l[y], b), R = K(h - l[w], v), C = !e.middlewareData.shift;
921
- let A = x, L = R;
922
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (L = v), (o = e.middlewareData.shift) != null && o.enabled.y && (A = b), C && !d) {
923
- const P = $(l.left, 0), W = $(l.right, 0), M = $(l.top, 0), T = $(l.bottom, 0);
924
- m ? L = h - 2 * (P !== 0 || W !== 0 ? P + W : $(l.left, l.right)) : A = p - 2 * (M !== 0 || T !== 0 ? M + T : $(l.top, l.bottom));
925
- }
926
- await f({
927
- ...e,
928
- availableWidth: L,
929
- availableHeight: A
930
- });
931
- const N = await s.getDimensions(c.floating);
932
- return h !== N.width || p !== N.height ? {
933
- reset: {
934
- rects: !0
935
- }
936
- } : {};
937
- }
938
- };
939
- };
940
- function dt() {
941
- return typeof window < "u";
942
- }
943
- function et(t) {
944
- return qt(t) ? (t.nodeName || "").toLowerCase() : "#document";
945
- }
946
- function _(t) {
947
- var e;
948
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
949
- }
950
- function I(t) {
951
- var e;
952
- return (e = (qt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
953
- }
954
- function qt(t) {
955
- return dt() ? t instanceof Node || t instanceof _(t).Node : !1;
956
- }
957
- function F(t) {
958
- return dt() ? t instanceof Element || t instanceof _(t).Element : !1;
959
- }
960
- function Y(t) {
961
- return dt() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
962
- }
963
- function Wt(t) {
964
- return !dt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
965
- }
966
- function rt(t) {
967
- const {
968
- overflow: e,
969
- overflowX: n,
970
- overflowY: o,
971
- display: r
972
- } = V(t);
973
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && r !== "inline" && r !== "contents";
974
- }
975
- function qe(t) {
976
- return /^(table|td|th)$/.test(et(t));
977
- }
978
- function mt(t) {
979
- try {
980
- if (t.matches(":popover-open"))
981
- return !0;
982
- } catch {
983
- }
984
- try {
985
- return t.matches(":modal");
986
- } catch {
987
- return !1;
988
- }
989
- }
990
- const Ke = /transform|translate|scale|rotate|perspective|filter/, Ue = /paint|layout|strict|content/, Z = (t) => !!t && t !== "none";
991
- let pt;
992
- function Ot(t) {
993
- const e = F(t) ? V(t) : t;
994
- return Z(e.transform) || Z(e.translate) || Z(e.scale) || Z(e.rotate) || Z(e.perspective) || !Et() && (Z(e.backdropFilter) || Z(e.filter)) || Ke.test(e.willChange || "") || Ue.test(e.contain || "");
995
- }
996
- function Ze(t) {
997
- let e = U(t);
998
- for (; Y(e) && !Q(e); ) {
999
- if (Ot(e))
1000
- return e;
1001
- if (mt(e))
1002
- return null;
1003
- e = U(e);
1004
- }
1005
- return null;
1006
- }
1007
- function Et() {
1008
- return pt == null && (pt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), pt;
1009
- }
1010
- function Q(t) {
1011
- return /^(html|body|#document)$/.test(et(t));
1012
- }
1013
- function V(t) {
1014
- return _(t).getComputedStyle(t);
1015
- }
1016
- function ht(t) {
1017
- return F(t) ? {
1018
- scrollLeft: t.scrollLeft,
1019
- scrollTop: t.scrollTop
1020
- } : {
1021
- scrollLeft: t.scrollX,
1022
- scrollTop: t.scrollY
1023
- };
1024
- }
1025
- function U(t) {
1026
- if (et(t) === "html")
1027
- return t;
1028
- const e = (
1029
- // Step into the shadow DOM of the parent of a slotted node.
1030
- t.assignedSlot || // DOM Element detected.
1031
- t.parentNode || // ShadowRoot detected.
1032
- Wt(t) && t.host || // Fallback.
1033
- I(t)
1034
- );
1035
- return Wt(e) ? e.host : e;
1036
- }
1037
- function Kt(t) {
1038
- const e = U(t);
1039
- return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : Y(e) && rt(e) ? e : Kt(e);
1040
- }
1041
- function ot(t, e, n) {
1042
- var o;
1043
- e === void 0 && (e = []), n === void 0 && (n = !0);
1044
- const r = Kt(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(r);
1045
- if (i) {
1046
- const c = bt(s);
1047
- return e.concat(s, s.visualViewport || [], rt(r) ? r : [], c && n ? ot(c) : []);
1048
- } else
1049
- return e.concat(r, ot(r, [], n));
1050
- }
1051
- function bt(t) {
1052
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1053
- }
1054
- function Ut(t) {
1055
- const e = V(t);
1056
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
1057
- const r = Y(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = lt(n) !== i || lt(o) !== s;
1058
- return c && (n = i, o = s), {
1059
- width: n,
1060
- height: o,
1061
- $: c
1062
- };
1063
- }
1064
- function Pt(t) {
1065
- return F(t) ? t : t.contextElement;
1066
- }
1067
- function J(t) {
1068
- const e = Pt(t);
1069
- if (!Y(e))
1070
- return j(1);
1071
- const n = e.getBoundingClientRect(), {
1072
- width: o,
1073
- height: r,
1074
- $: i
1075
- } = Ut(e);
1076
- let s = (i ? lt(n.width) : n.width) / o, c = (i ? lt(n.height) : n.height) / r;
1077
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1078
- x: s,
1079
- y: c
1080
- };
1081
- }
1082
- const Ge = /* @__PURE__ */ j(0);
1083
- function Zt(t) {
1084
- const e = _(t);
1085
- return !Et() || !e.visualViewport ? Ge : {
1086
- x: e.visualViewport.offsetLeft,
1087
- y: e.visualViewport.offsetTop
1088
- };
1089
- }
1090
- function Je(t, e, n) {
1091
- return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
1092
- }
1093
- function G(t, e, n, o) {
1094
- e === void 0 && (e = !1), n === void 0 && (n = !1);
1095
- const r = t.getBoundingClientRect(), i = Pt(t);
1096
- let s = j(1);
1097
- e && (o ? F(o) && (s = J(o)) : s = J(t));
1098
- const c = Je(i, n, o) ? Zt(i) : j(0);
1099
- let f = (r.left + c.x) / s.x, a = (r.top + c.y) / s.y, l = r.width / s.x, u = r.height / s.y;
1100
- if (i) {
1101
- const d = _(i), m = o && F(o) ? _(o) : o;
1102
- let h = d, p = bt(h);
1103
- for (; p && o && m !== h; ) {
1104
- const y = J(p), w = p.getBoundingClientRect(), b = V(p), v = w.left + (p.clientLeft + parseFloat(b.paddingLeft)) * y.x, x = w.top + (p.clientTop + parseFloat(b.paddingTop)) * y.y;
1105
- f *= y.x, a *= y.y, l *= y.x, u *= y.y, f += v, a += x, h = _(p), p = bt(h);
1106
- }
1107
- }
1108
- return at({
1109
- width: l,
1110
- height: u,
1111
- x: f,
1112
- y: a
1113
- });
1114
- }
1115
- function gt(t, e) {
1116
- const n = ht(t).scrollLeft;
1117
- return e ? e.left + n : G(I(t)).left + n;
1118
- }
1119
- function Gt(t, e) {
1120
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - gt(t, n), r = n.top + e.scrollTop;
1121
- return {
1122
- x: o,
1123
- y: r
1124
- };
1125
- }
1126
- function Qe(t) {
1127
- let {
1128
- elements: e,
1129
- rect: n,
1130
- offsetParent: o,
1131
- strategy: r
1132
- } = t;
1133
- const i = r === "fixed", s = I(o), c = e ? mt(e.floating) : !1;
1134
- if (o === s || c && i)
1135
- return n;
1136
- let f = {
1137
- scrollLeft: 0,
1138
- scrollTop: 0
1139
- }, a = j(1);
1140
- const l = j(0), u = Y(o);
1141
- if ((u || !u && !i) && ((et(o) !== "body" || rt(s)) && (f = ht(o)), u)) {
1142
- const m = G(o);
1143
- a = J(o), l.x = m.x + o.clientLeft, l.y = m.y + o.clientTop;
1144
- }
1145
- const d = s && !u && !i ? Gt(s, f) : j(0);
1146
- return {
1147
- width: n.width * a.x,
1148
- height: n.height * a.y,
1149
- x: n.x * a.x - f.scrollLeft * a.x + l.x + d.x,
1150
- y: n.y * a.y - f.scrollTop * a.y + l.y + d.y
1151
- };
1152
- }
1153
- function tn(t) {
1154
- return Array.from(t.getClientRects());
1155
- }
1156
- function en(t) {
1157
- const e = I(t), n = ht(t), o = t.ownerDocument.body, r = $(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = $(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
1158
- let s = -n.scrollLeft + gt(t);
1159
- const c = -n.scrollTop;
1160
- return V(o).direction === "rtl" && (s += $(e.clientWidth, o.clientWidth) - r), {
1161
- width: r,
1162
- height: i,
1163
- x: s,
1164
- y: c
1165
- };
1166
- }
1167
- const Ft = 25;
1168
- function nn(t, e) {
1169
- const n = _(t), o = I(t), r = n.visualViewport;
1170
- let i = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
1171
- if (r) {
1172
- i = r.width, s = r.height;
1173
- const l = Et();
1174
- (!l || l && e === "fixed") && (c = r.offsetLeft, f = r.offsetTop);
1175
- }
1176
- const a = gt(o);
1177
- if (a <= 0) {
1178
- const l = o.ownerDocument, u = l.body, d = getComputedStyle(u), m = l.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, h = Math.abs(o.clientWidth - u.clientWidth - m);
1179
- h <= Ft && (i -= h);
1180
- } else a <= Ft && (i += a);
1181
- return {
1182
- width: i,
1183
- height: s,
1184
- x: c,
1185
- y: f
1186
- };
1187
- }
1188
- function on(t, e) {
1189
- const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = Y(t) ? J(t) : j(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, f = r * i.x, a = o * i.y;
1190
- return {
1191
- width: s,
1192
- height: c,
1193
- x: f,
1194
- y: a
1195
- };
1196
- }
1197
- function Vt(t, e, n) {
1198
- let o;
1199
- if (e === "viewport")
1200
- o = nn(t, n);
1201
- else if (e === "document")
1202
- o = en(I(t));
1203
- else if (F(e))
1204
- o = on(e, n);
1205
- else {
1206
- const r = Zt(t);
1207
- o = {
1208
- x: e.x - r.x,
1209
- y: e.y - r.y,
1210
- width: e.width,
1211
- height: e.height
1212
- };
1213
- }
1214
- return at(o);
1215
- }
1216
- function Jt(t, e) {
1217
- const n = U(t);
1218
- return n === e || !F(n) || Q(n) ? !1 : V(n).position === "fixed" || Jt(n, e);
1219
- }
1220
- function rn(t, e) {
1221
- const n = e.get(t);
1222
- if (n)
1223
- return n;
1224
- let o = ot(t, [], !1).filter((c) => F(c) && et(c) !== "body"), r = null;
1225
- const i = V(t).position === "fixed";
1226
- let s = i ? U(t) : t;
1227
- for (; F(s) && !Q(s); ) {
1228
- const c = V(s), f = Ot(s);
1229
- !f && c.position === "fixed" && (r = null), (i ? !f && !r : !f && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || rt(s) && !f && Jt(t, s)) ? o = o.filter((l) => l !== s) : r = c, s = U(s);
1230
- }
1231
- return e.set(t, o), o;
1232
- }
1233
- function sn(t) {
1234
- let {
1235
- element: e,
1236
- boundary: n,
1237
- rootBoundary: o,
1238
- strategy: r
1239
- } = t;
1240
- const s = [...n === "clippingAncestors" ? mt(e) ? [] : rn(e, this._c) : [].concat(n), o], c = Vt(e, s[0], r);
1241
- let f = c.top, a = c.right, l = c.bottom, u = c.left;
1242
- for (let d = 1; d < s.length; d++) {
1243
- const m = Vt(e, s[d], r);
1244
- f = $(m.top, f), a = K(m.right, a), l = K(m.bottom, l), u = $(m.left, u);
1245
- }
1246
- return {
1247
- width: a - u,
1248
- height: l - f,
1249
- x: u,
1250
- y: f
1251
- };
1252
- }
1253
- function cn(t) {
1254
- const {
1255
- width: e,
1256
- height: n
1257
- } = Ut(t);
1258
- return {
1259
- width: e,
1260
- height: n
1261
- };
1262
- }
1263
- function ln(t, e, n) {
1264
- const o = Y(e), r = I(e), i = n === "fixed", s = G(t, !0, i, e);
1265
- let c = {
1266
- scrollLeft: 0,
1267
- scrollTop: 0
1268
- };
1269
- const f = j(0);
1270
- function a() {
1271
- f.x = gt(r);
1272
- }
1273
- if (o || !o && !i)
1274
- if ((et(e) !== "body" || rt(r)) && (c = ht(e)), o) {
1275
- const m = G(e, !0, i, e);
1276
- f.x = m.x + e.clientLeft, f.y = m.y + e.clientTop;
1277
- } else r && a();
1278
- i && !o && r && a();
1279
- const l = r && !o && !i ? Gt(r, c) : j(0), u = s.left + c.scrollLeft - f.x - l.x, d = s.top + c.scrollTop - f.y - l.y;
1280
- return {
1281
- x: u,
1282
- y: d,
1283
- width: s.width,
1284
- height: s.height
1285
- };
1286
- }
1287
- function yt(t) {
1288
- return V(t).position === "static";
1289
- }
1290
- function zt(t, e) {
1291
- if (!Y(t) || V(t).position === "fixed")
1292
- return null;
1293
- if (e)
1294
- return e(t);
1295
- let n = t.offsetParent;
1296
- return I(t) === n && (n = n.ownerDocument.body), n;
1297
- }
1298
- function Qt(t, e) {
1299
- const n = _(t);
1300
- if (mt(t))
1301
- return n;
1302
- if (!Y(t)) {
1303
- let r = U(t);
1304
- for (; r && !Q(r); ) {
1305
- if (F(r) && !yt(r))
1306
- return r;
1307
- r = U(r);
1308
- }
1309
- return n;
1310
- }
1311
- let o = zt(t, e);
1312
- for (; o && qe(o) && yt(o); )
1313
- o = zt(o, e);
1314
- return o && Q(o) && yt(o) && !Ot(o) ? n : o || Ze(t) || n;
1315
- }
1316
- const fn = async function(t) {
1317
- const e = this.getOffsetParent || Qt, n = this.getDimensions, o = await n(t.floating);
1318
- return {
1319
- reference: ln(t.reference, await e(t.floating), t.strategy),
1320
- floating: {
1321
- x: 0,
1322
- y: 0,
1323
- width: o.width,
1324
- height: o.height
1325
- }
1326
- };
1327
- };
1328
- function an(t) {
1329
- return V(t).direction === "rtl";
1330
- }
1331
- const un = {
1332
- convertOffsetParentRelativeRectToViewportRelativeRect: Qe,
1333
- getDocumentElement: I,
1334
- getClippingRect: sn,
1335
- getOffsetParent: Qt,
1336
- getElementRects: fn,
1337
- getClientRects: tn,
1338
- getDimensions: cn,
1339
- getScale: J,
1340
- isElement: F,
1341
- isRTL: an
1342
- };
1343
- function te(t, e) {
1344
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1345
- }
1346
- function dn(t, e) {
1347
- let n = null, o;
1348
- const r = I(t);
1349
- function i() {
1350
- var c;
1351
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1352
- }
1353
- function s(c, f) {
1354
- c === void 0 && (c = !1), f === void 0 && (f = 1), i();
1355
- const a = t.getBoundingClientRect(), {
1356
- left: l,
1357
- top: u,
1358
- width: d,
1359
- height: m
1360
- } = a;
1361
- if (c || e(), !d || !m)
1362
- return;
1363
- const h = it(u), p = it(r.clientWidth - (l + d)), y = it(r.clientHeight - (u + m)), w = it(l), v = {
1364
- rootMargin: -h + "px " + -p + "px " + -y + "px " + -w + "px",
1365
- threshold: $(0, K(1, f)) || 1
1366
- };
1367
- let x = !0;
1368
- function R(C) {
1369
- const A = C[0].intersectionRatio;
1370
- if (A !== f) {
1371
- if (!x)
1372
- return s();
1373
- A ? s(!1, A) : o = setTimeout(() => {
1374
- s(!1, 1e-7);
1375
- }, 1e3);
1376
- }
1377
- A === 1 && !te(a, t.getBoundingClientRect()) && s(), x = !1;
1378
- }
1379
- try {
1380
- n = new IntersectionObserver(R, {
1381
- ...v,
1382
- // Handle <iframe>s
1383
- root: r.ownerDocument
1384
- });
1385
- } catch {
1386
- n = new IntersectionObserver(R, v);
1387
- }
1388
- n.observe(t);
1389
- }
1390
- return s(!0), i;
1391
- }
1392
- function Nn(t, e, n, o) {
1393
- o === void 0 && (o = {});
1394
- const {
1395
- ancestorScroll: r = !0,
1396
- ancestorResize: i = !0,
1397
- elementResize: s = typeof ResizeObserver == "function",
1398
- layoutShift: c = typeof IntersectionObserver == "function",
1399
- animationFrame: f = !1
1400
- } = o, a = Pt(t), l = r || i ? [...a ? ot(a) : [], ...e ? ot(e) : []] : [];
1401
- l.forEach((w) => {
1402
- r && w.addEventListener("scroll", n, {
1403
- passive: !0
1404
- }), i && w.addEventListener("resize", n);
1405
- });
1406
- const u = a && c ? dn(a, n) : null;
1407
- let d = -1, m = null;
1408
- s && (m = new ResizeObserver((w) => {
1409
- let [b] = w;
1410
- b && b.target === a && m && e && (m.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
1411
- var v;
1412
- (v = m) == null || v.observe(e);
1413
- })), n();
1414
- }), a && !f && m.observe(a), e && m.observe(e));
1415
- let h, p = f ? G(t) : null;
1416
- f && y();
1417
- function y() {
1418
- const w = G(t);
1419
- p && !te(p, w) && n(), p = w, h = requestAnimationFrame(y);
1420
- }
1421
- return n(), () => {
1422
- var w;
1423
- l.forEach((b) => {
1424
- r && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1425
- }), u == null || u(), (w = m) == null || w.disconnect(), m = null, f && cancelAnimationFrame(h);
1426
- };
1427
- }
1428
- const mn = Ie, hn = He, gn = ze, pn = Ye, yn = Be, Bt = Ve, wn = Xe, xn = (t, e, n) => {
1429
- const o = /* @__PURE__ */ new Map(), r = {
1430
- platform: un,
1431
- ...n
1432
- }, i = {
1433
- ...r.platform,
1434
- _c: o
1435
- };
1436
- return Fe(t, e, {
1437
- ...r,
1438
- platform: i
1439
- });
1440
- };
1441
- var vn = typeof document < "u", bn = function() {
1442
- }, st = vn ? ne : bn;
1443
- function ut(t, e) {
1444
- if (t === e)
1445
- return !0;
1446
- if (typeof t != typeof e)
1447
- return !1;
1448
- if (typeof t == "function" && t.toString() === e.toString())
1449
- return !0;
1450
- let n, o, r;
1451
- if (t && e && typeof t == "object") {
1452
- if (Array.isArray(t)) {
1453
- if (n = t.length, n !== e.length) return !1;
1454
- for (o = n; o-- !== 0; )
1455
- if (!ut(t[o], e[o]))
1456
- return !1;
1457
- return !0;
1458
- }
1459
- if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
1460
- return !1;
1461
- for (o = n; o-- !== 0; )
1462
- if (!{}.hasOwnProperty.call(e, r[o]))
1463
- return !1;
1464
- for (o = n; o-- !== 0; ) {
1465
- const i = r[o];
1466
- if (!(i === "_owner" && t.$$typeof) && !ut(t[i], e[i]))
1467
- return !1;
1468
- }
1469
- return !0;
1470
- }
1471
- return t !== t && e !== e;
1472
- }
1473
- function ee(t) {
1474
- return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1475
- }
1476
- function jt(t, e) {
1477
- const n = ee(t);
1478
- return Math.round(e * n) / n;
1479
- }
1480
- function wt(t) {
1481
- const e = g.useRef(t);
1482
- return st(() => {
1483
- e.current = t;
1484
- }), e;
1485
- }
1486
- function Wn(t) {
1487
- t === void 0 && (t = {});
1488
- const {
1489
- placement: e = "bottom",
1490
- strategy: n = "absolute",
1491
- middleware: o = [],
1492
- platform: r,
1493
- elements: {
1494
- reference: i,
1495
- floating: s
1496
- } = {},
1497
- transform: c = !0,
1498
- whileElementsMounted: f,
1499
- open: a
1500
- } = t, [l, u] = g.useState({
1501
- x: 0,
1502
- y: 0,
1503
- strategy: n,
1504
- placement: e,
1505
- middlewareData: {},
1506
- isPositioned: !1
1507
- }), [d, m] = g.useState(o);
1508
- ut(d, o) || m(o);
1509
- const [h, p] = g.useState(null), [y, w] = g.useState(null), b = g.useCallback((S) => {
1510
- S !== C.current && (C.current = S, p(S));
1511
- }, []), v = g.useCallback((S) => {
1512
- S !== A.current && (A.current = S, w(S));
1513
- }, []), x = i || h, R = s || y, C = g.useRef(null), A = g.useRef(null), L = g.useRef(l), N = f != null, P = wt(f), W = wt(r), M = wt(a), T = g.useCallback(() => {
1514
- if (!C.current || !A.current)
1515
- return;
1516
- const S = {
1517
- placement: e,
1518
- strategy: n,
1519
- middleware: d
1520
- };
1521
- W.current && (S.platform = W.current), xn(C.current, A.current, S).then((k) => {
1522
- const q = {
1523
- ...k,
1524
- // The floating element's position may be recomputed while it's closed
1525
- // but still mounted (such as when transitioning out). To ensure
1526
- // `isPositioned` will be `false` initially on the next open, avoid
1527
- // setting it to `true` when `open === false` (must be specified).
1528
- isPositioned: M.current !== !1
1529
- };
1530
- O.current && !ut(L.current, q) && (L.current = q, se.flushSync(() => {
1531
- u(q);
1532
- }));
1533
- });
1534
- }, [d, e, n, W, M]);
1535
- st(() => {
1536
- a === !1 && L.current.isPositioned && (L.current.isPositioned = !1, u((S) => ({
1537
- ...S,
1538
- isPositioned: !1
1539
- })));
1540
- }, [a]);
1541
- const O = g.useRef(!1);
1542
- st(() => (O.current = !0, () => {
1543
- O.current = !1;
1544
- }), []), st(() => {
1545
- if (x && (C.current = x), R && (A.current = R), x && R) {
1546
- if (P.current)
1547
- return P.current(x, R, T);
1548
- T();
1549
- }
1550
- }, [x, R, T, P, N]);
1551
- const z = g.useMemo(() => ({
1552
- reference: C,
1553
- floating: A,
1554
- setReference: b,
1555
- setFloating: v
1556
- }), [b, v]), E = g.useMemo(() => ({
1557
- reference: x,
1558
- floating: R
1559
- }), [x, R]), D = g.useMemo(() => {
1560
- const S = {
1561
- position: n,
1562
- left: 0,
1563
- top: 0
1564
- };
1565
- if (!E.floating)
1566
- return S;
1567
- const k = jt(E.floating, l.x), q = jt(E.floating, l.y);
1568
- return c ? {
1569
- ...S,
1570
- transform: "translate(" + k + "px, " + q + "px)",
1571
- ...ee(E.floating) >= 1.5 && {
1572
- willChange: "transform"
1573
- }
1574
- } : {
1575
- position: n,
1576
- left: k,
1577
- top: q
1578
- };
1579
- }, [n, c, E.floating, l.x, l.y]);
1580
- return g.useMemo(() => ({
1581
- ...l,
1582
- update: T,
1583
- refs: z,
1584
- elements: E,
1585
- floatingStyles: D
1586
- }), [l, T, z, E, D]);
1587
- }
1588
- const Rn = (t) => {
1589
- function e(n) {
1590
- return {}.hasOwnProperty.call(n, "current");
1591
- }
1592
- return {
1593
- name: "arrow",
1594
- options: t,
1595
- fn(n) {
1596
- const {
1597
- element: o,
1598
- padding: r
1599
- } = typeof t == "function" ? t(n) : t;
1600
- return o && e(o) ? o.current != null ? Bt({
1601
- element: o.current,
1602
- padding: r
1603
- }).fn(n) : {} : o ? Bt({
1604
- element: o,
1605
- padding: r
1606
- }).fn(n) : {};
1607
- }
1608
- };
1609
- }, Fn = (t, e) => {
1610
- const n = mn(t);
1611
- return {
1612
- name: n.name,
1613
- fn: n.fn,
1614
- options: [t, e]
1615
- };
1616
- }, Vn = (t, e) => {
1617
- const n = hn(t);
1618
- return {
1619
- name: n.name,
1620
- fn: n.fn,
1621
- options: [t, e]
1622
- };
1623
- }, zn = (t, e) => ({
1624
- fn: wn(t).fn,
1625
- options: [t, e]
1626
- }), Bn = (t, e) => {
1627
- const n = gn(t);
1628
- return {
1629
- name: n.name,
1630
- fn: n.fn,
1631
- options: [t, e]
1632
- };
1633
- }, jn = (t, e) => {
1634
- const n = pn(t);
1635
- return {
1636
- name: n.name,
1637
- fn: n.fn,
1638
- options: [t, e]
1639
- };
1640
- }, In = (t, e) => {
1641
- const n = yn(t);
1642
- return {
1643
- name: n.name,
1644
- fn: n.fn,
1645
- options: [t, e]
1646
- };
1647
- }, Hn = (t, e) => {
1648
- const n = Rn(t);
1649
- return {
1650
- name: n.name,
1651
- fn: n.fn,
1652
- options: [t, e]
1653
- };
1654
- };
1655
- export {
1656
- Ce as B,
1657
- kn as C,
1658
- It as a,
1659
- Re as b,
1660
- ce as c,
1661
- $n as d,
1662
- Tn as e,
1663
- Se as f,
1664
- Mn as g,
1665
- Wn as h,
1666
- Bn as i,
1667
- jn as j,
1668
- Hn as k,
1669
- zn as l,
1670
- In as m,
1671
- Nn as n,
1672
- Fn as o,
1673
- Rt as p,
1674
- Ln as q,
1675
- _n as r,
1676
- Vn as s,
1677
- Dn as t,
1678
- En as u,
1679
- ge as v,
1680
- Pn as w
1681
- };