@imfusion/web-ui 0.5.1-dev.52.gcaa229a7 → 0.5.1-dev.56.gcf89961f

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.
@@ -1,3790 +0,0 @@
1
- import { n as e, t } from "./chunk-DA_OvQe2.js";
2
- import { n } from "./meta-BwCupYyq.js";
3
- import * as r from "react";
4
- import { Children as i, createElement as a } from "react";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import * as c from "react-dom";
7
- //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
8
- function l() {
9
- return typeof window < "u";
10
- }
11
- function u(e) {
12
- return p(e) ? (e.nodeName || "").toLowerCase() : "#document";
13
- }
14
- function d(e) {
15
- var t;
16
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
17
- }
18
- function f(e) {
19
- return ((p(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
20
- }
21
- function p(e) {
22
- return l() ? e instanceof Node || e instanceof d(e).Node : !1;
23
- }
24
- function m(e) {
25
- return l() ? e instanceof Element || e instanceof d(e).Element : !1;
26
- }
27
- function h(e) {
28
- return l() ? e instanceof HTMLElement || e instanceof d(e).HTMLElement : !1;
29
- }
30
- function g(e) {
31
- return !l() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof d(e).ShadowRoot;
32
- }
33
- function _(e) {
34
- let { overflow: t, overflowX: n, overflowY: r, display: i } = O(e);
35
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
36
- }
37
- function v(e) {
38
- return /^(table|td|th)$/.test(u(e));
39
- }
40
- function y(e) {
41
- try {
42
- if (e.matches(":popover-open")) return !0;
43
- } catch {}
44
- try {
45
- return e.matches(":modal");
46
- } catch {
47
- return !1;
48
- }
49
- }
50
- var b = /transform|translate|scale|rotate|perspective|filter/, x = /paint|layout|strict|content/, S = (e) => !!e && e !== "none", C;
51
- function w(e) {
52
- let t = m(e) ? O(e) : e;
53
- return S(t.transform) || S(t.translate) || S(t.scale) || S(t.rotate) || S(t.perspective) || !E() && (S(t.backdropFilter) || S(t.filter)) || b.test(t.willChange || "") || x.test(t.contain || "");
54
- }
55
- function T(e) {
56
- let t = A(e);
57
- for (; h(t) && !D(t);) {
58
- if (w(t)) return t;
59
- if (y(t)) return null;
60
- t = A(t);
61
- }
62
- return null;
63
- }
64
- function E() {
65
- return C ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), C;
66
- }
67
- function D(e) {
68
- return /^(html|body|#document)$/.test(u(e));
69
- }
70
- function O(e) {
71
- return d(e).getComputedStyle(e);
72
- }
73
- function k(e) {
74
- return m(e) ? {
75
- scrollLeft: e.scrollLeft,
76
- scrollTop: e.scrollTop
77
- } : {
78
- scrollLeft: e.scrollX,
79
- scrollTop: e.scrollY
80
- };
81
- }
82
- function A(e) {
83
- if (u(e) === "html") return e;
84
- let t = e.assignedSlot || e.parentNode || g(e) && e.host || f(e);
85
- return g(t) ? t.host : t;
86
- }
87
- function j(e) {
88
- let t = A(e);
89
- return D(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : h(t) && _(t) ? t : j(t);
90
- }
91
- function M(e, t, n) {
92
- t === void 0 && (t = []), n === void 0 && (n = !0);
93
- let r = j(e), i = r === e.ownerDocument?.body, a = d(r);
94
- if (i) {
95
- let e = ee(a);
96
- return t.concat(a, a.visualViewport || [], _(r) ? r : [], e && n ? M(e) : []);
97
- } else return t.concat(r, M(r, [], n));
98
- }
99
- function ee(e) {
100
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
101
- }
102
- //#endregion
103
- //#region node_modules/@base-ui/utils/safeReact.mjs
104
- var N = { ...r }, P = {};
105
- function F(e, t) {
106
- let n = r.useRef(P);
107
- return n.current === P && (n.current = e(t)), n;
108
- }
109
- //#endregion
110
- //#region node_modules/@base-ui/utils/useStableCallback.mjs
111
- var te = N.useInsertionEffect, I = te && te !== N.useLayoutEffect ? te : (e) => e();
112
- function L(e) {
113
- let t = F(R).current;
114
- return t.next = e, I(t.effect), t.trampoline;
115
- }
116
- function R() {
117
- let e = {
118
- next: void 0,
119
- callback: ne,
120
- trampoline: (...t) => e.callback?.(...t),
121
- effect: () => {
122
- e.callback = e.next;
123
- }
124
- };
125
- return e;
126
- }
127
- function ne() {
128
- if (process.env.NODE_ENV !== "production") throw Error("Base UI: Cannot call an event handler while rendering.");
129
- }
130
- //#endregion
131
- //#region node_modules/@base-ui/utils/error.mjs
132
- var z;
133
- process.env.NODE_ENV !== "production" && (z = /* @__PURE__ */ new Set());
134
- function B(...e) {
135
- if (process.env.NODE_ENV !== "production") {
136
- let t = e.join(" ");
137
- z.has(t) || (z.add(t), console.error(`Base UI: ${t}`));
138
- }
139
- }
140
- var V = typeof document < "u" ? r.useLayoutEffect : () => {};
141
- //#endregion
142
- //#region node_modules/@base-ui/utils/mergeObjects.mjs
143
- function H(e, t) {
144
- if (e && !t) return e;
145
- if (!e && t) return t;
146
- if (e || t) return {
147
- ...e,
148
- ...t
149
- };
150
- }
151
- //#endregion
152
- //#region node_modules/@base-ui/react/merge-props/mergeProps.mjs
153
- var re = {};
154
- function U(e, t, n, r, i) {
155
- if (!n && !r && !i && !e) return ae(t);
156
- let a = ae(e);
157
- return t && (a = W(a, t)), n && (a = W(a, n)), r && (a = W(a, r)), i && (a = W(a, i)), a;
158
- }
159
- function ie(e) {
160
- if (e.length === 0) return re;
161
- if (e.length === 1) return ae(e[0]);
162
- let t = ae(e[0]);
163
- for (let n = 1; n < e.length; n += 1) t = W(t, e[n]);
164
- return t;
165
- }
166
- function ae(e) {
167
- return G(e) ? { ...K(e, re) } : oe(e);
168
- }
169
- function W(e, t) {
170
- return G(t) ? K(t, e) : se(e, t);
171
- }
172
- function oe(e) {
173
- let t = { ...e };
174
- for (let e in t) {
175
- let n = t[e];
176
- ce(e, n) && (t[e] = ue(n));
177
- }
178
- return t;
179
- }
180
- function se(e, t) {
181
- if (!t) return e;
182
- for (let n in t) {
183
- let r = t[n];
184
- switch (n) {
185
- case "style":
186
- e[n] = H(e.style, r);
187
- break;
188
- case "className":
189
- e[n] = de(e.className, r);
190
- break;
191
- default: ce(n, r) ? e[n] = le(e[n], r) : e[n] = r;
192
- }
193
- }
194
- return e;
195
- }
196
- function ce(e, t) {
197
- let n = e.charCodeAt(0), r = e.charCodeAt(1), i = e.charCodeAt(2);
198
- return n === 111 && r === 110 && i >= 65 && i <= 90 && (typeof t == "function" || t === void 0);
199
- }
200
- function G(e) {
201
- return typeof e == "function";
202
- }
203
- function K(e, t) {
204
- return G(e) ? e(t) : e ?? re;
205
- }
206
- function le(e, t) {
207
- return t ? e ? (...n) => {
208
- let r = n[0];
209
- if (fe(r)) {
210
- let i = r;
211
- q(i);
212
- let a = t(...n);
213
- return i.baseUIHandlerPrevented || e?.(...n), a;
214
- }
215
- let i = t(...n);
216
- return e?.(...n), i;
217
- } : ue(t) : e;
218
- }
219
- function ue(e) {
220
- return e && ((...t) => {
221
- let n = t[0];
222
- return fe(n) && q(n), e(...t);
223
- });
224
- }
225
- function q(e) {
226
- return e.preventBaseUIHandler = () => {
227
- e.baseUIHandlerPrevented = !0;
228
- }, e;
229
- }
230
- function de(e, t) {
231
- return t ? e ? t + " " + e : t : e;
232
- }
233
- function fe(e) {
234
- return typeof e == "object" && !!e && "nativeEvent" in e;
235
- }
236
- //#endregion
237
- //#region node_modules/@base-ui/utils/formatErrorMessage.mjs
238
- function pe(e, t) {
239
- return function(n, ...r) {
240
- let i = new URL(e);
241
- return i.searchParams.set("code", n.toString()), r.forEach((e) => i.searchParams.append("args[]", e)), `${t} error #${n}; visit ${i} for the full message.`;
242
- };
243
- }
244
- var J = pe("https://base-ui.com/production-error", "Base UI"), me = /* @__PURE__ */ r.createContext(void 0);
245
- process.env.NODE_ENV !== "production" && (me.displayName = "CompositeRootContext");
246
- function he(e = !1) {
247
- let t = r.useContext(me);
248
- if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? J(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
249
- return t;
250
- }
251
- //#endregion
252
- //#region node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
253
- function ge(e) {
254
- let { focusableWhenDisabled: t, disabled: n, composite: i = !1, tabIndex: a = 0, isNativeButton: o } = e, s = i && t !== !1, c = i && t === !1;
255
- return { props: r.useMemo(() => {
256
- let e = { onKeyDown(e) {
257
- n && t && e.key !== "Tab" && e.preventDefault();
258
- } };
259
- return i || (e.tabIndex = a, !o && n && (e.tabIndex = t ? a : -1)), (o && (t || s) || !o && n) && (e["aria-disabled"] = n), o && (!t || c) && (e.disabled = n), e;
260
- }, [
261
- i,
262
- n,
263
- t,
264
- s,
265
- c,
266
- o,
267
- a
268
- ]) };
269
- }
270
- //#endregion
271
- //#region node_modules/@base-ui/react/internals/use-button/useButton.mjs
272
- function _e(e = {}) {
273
- let { disabled: t = !1, focusableWhenDisabled: n, tabIndex: i = 0, native: a = !0, composite: o } = e, s = r.useRef(null), c = he(!0), l = o ?? c !== void 0, { props: u } = ge({
274
- focusableWhenDisabled: n,
275
- disabled: t,
276
- composite: l,
277
- tabIndex: i,
278
- isNativeButton: a
279
- });
280
- process.env.NODE_ENV !== "production" && r.useEffect(() => {
281
- if (!s.current) return;
282
- let e = ve(s.current);
283
- a ? e || B(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${N.captureOwnerStack?.() || ""}`) : e && B(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${N.captureOwnerStack?.() || ""}`);
284
- }, [a]);
285
- let d = r.useCallback(() => {
286
- let e = s.current;
287
- ve(e) && l && t && u.disabled === void 0 && e.disabled && (e.disabled = !1);
288
- }, [
289
- t,
290
- u.disabled,
291
- l
292
- ]);
293
- return V(d, [d]), {
294
- getButtonProps: r.useCallback((e = {}) => {
295
- let { onClick: n, onMouseDown: r, onKeyUp: i, onKeyDown: o, onPointerDown: s, ...c } = e;
296
- return U({
297
- onClick(e) {
298
- if (t) {
299
- e.preventDefault();
300
- return;
301
- }
302
- n?.(e);
303
- },
304
- onMouseDown(e) {
305
- t || r?.(e);
306
- },
307
- onKeyDown(e) {
308
- if (t || (q(e), o?.(e), e.baseUIHandlerPrevented)) return;
309
- let r = e.target === e.currentTarget, i = e.currentTarget, s = ve(i), c = !a && ye(i), u = r && (a ? s : !c), d = e.key === "Enter", f = e.key === " ", p = i.getAttribute("role"), m = p?.startsWith("menuitem") || p === "option" || p === "gridcell";
310
- if (r && l && f) {
311
- if (e.defaultPrevented && m) return;
312
- e.preventDefault(), c || a && s ? (i.click(), e.preventBaseUIHandler()) : u && (n?.(e), e.preventBaseUIHandler());
313
- return;
314
- }
315
- u && (!a && (f || d) && e.preventDefault(), !a && d && n?.(e));
316
- },
317
- onKeyUp(e) {
318
- if (!t) {
319
- if (q(e), i?.(e), e.target === e.currentTarget && a && l && ve(e.currentTarget) && e.key === " ") {
320
- e.preventDefault();
321
- return;
322
- }
323
- e.baseUIHandlerPrevented || e.target === e.currentTarget && !a && !l && e.key === " " && n?.(e);
324
- }
325
- },
326
- onPointerDown(e) {
327
- if (t) {
328
- e.preventDefault();
329
- return;
330
- }
331
- s?.(e);
332
- }
333
- }, a ? { type: "button" } : { role: "button" }, u, c);
334
- }, [
335
- t,
336
- u,
337
- l,
338
- a
339
- ]),
340
- buttonRef: L((e) => {
341
- s.current = e, d();
342
- })
343
- };
344
- }
345
- function ve(e) {
346
- return h(e) && e.tagName === "BUTTON";
347
- }
348
- function ye(e) {
349
- return !!(e?.tagName === "A" && e?.href);
350
- }
351
- //#endregion
352
- //#region node_modules/@base-ui/utils/useMergedRefs.mjs
353
- function be(e, t, n, r) {
354
- let i = F(Se).current;
355
- return Ce(i, e, t, n, r) && we(i, [
356
- e,
357
- t,
358
- n,
359
- r
360
- ]), i.callback;
361
- }
362
- function xe(e) {
363
- let t = F(Se).current;
364
- return Y(t, e) && we(t, e), t.callback;
365
- }
366
- function Se() {
367
- return {
368
- callback: null,
369
- cleanup: null,
370
- refs: []
371
- };
372
- }
373
- function Ce(e, t, n, r, i) {
374
- return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
375
- }
376
- function Y(e, t) {
377
- return e.refs.length !== t.length || e.refs.some((e, n) => e !== t[n]);
378
- }
379
- function we(e, t) {
380
- if (e.refs = t, t.every((e) => e == null)) {
381
- e.callback = null;
382
- return;
383
- }
384
- e.callback = (n) => {
385
- if (e.cleanup &&= (e.cleanup(), null), n != null) {
386
- let r = Array(t.length).fill(null);
387
- for (let e = 0; e < t.length; e += 1) {
388
- let i = t[e];
389
- if (i != null) switch (typeof i) {
390
- case "function": {
391
- let t = i(n);
392
- typeof t == "function" && (r[e] = t);
393
- break;
394
- }
395
- case "object":
396
- i.current = n;
397
- break;
398
- default:
399
- }
400
- }
401
- e.cleanup = () => {
402
- for (let e = 0; e < t.length; e += 1) {
403
- let n = t[e];
404
- if (n != null) switch (typeof n) {
405
- case "function": {
406
- let t = r[e];
407
- typeof t == "function" ? t() : n(null);
408
- break;
409
- }
410
- case "object":
411
- n.current = null;
412
- break;
413
- default:
414
- }
415
- }
416
- };
417
- }
418
- };
419
- }
420
- //#endregion
421
- //#region node_modules/@base-ui/utils/reactVersion.mjs
422
- var Te = parseInt(r.version, 10);
423
- function Ee(e) {
424
- return Te >= e;
425
- }
426
- //#endregion
427
- //#region node_modules/@base-ui/utils/getReactElementRef.mjs
428
- function De(e) {
429
- if (!/* @__PURE__ */ r.isValidElement(e)) return null;
430
- let t = e, n = t.props;
431
- return (Ee(19) ? n?.ref : t.ref) ?? null;
432
- }
433
- //#endregion
434
- //#region node_modules/@base-ui/utils/warn.mjs
435
- var Oe;
436
- process.env.NODE_ENV !== "production" && (Oe = /* @__PURE__ */ new Set());
437
- function ke(...e) {
438
- if (process.env.NODE_ENV !== "production") {
439
- let t = e.join(" ");
440
- Oe.has(t) || (Oe.add(t), console.warn(`Base UI: ${t}`));
441
- }
442
- }
443
- //#endregion
444
- //#region node_modules/@base-ui/utils/empty.mjs
445
- function X() {}
446
- var Ae = Object.freeze([]), je = Object.freeze({});
447
- //#endregion
448
- //#region node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
449
- function Me(e, t) {
450
- let n = {};
451
- for (let r in e) {
452
- let i = e[r];
453
- if (t?.hasOwnProperty(r)) {
454
- let e = t[r](i);
455
- e != null && Object.assign(n, e);
456
- continue;
457
- }
458
- i === !0 ? n[`data-${r.toLowerCase()}`] = "" : i && (n[`data-${r.toLowerCase()}`] = i.toString());
459
- }
460
- return n;
461
- }
462
- //#endregion
463
- //#region node_modules/@base-ui/react/utils/resolveClassName.mjs
464
- function Ne(e, t) {
465
- return typeof e == "function" ? e(t) : e;
466
- }
467
- //#endregion
468
- //#region node_modules/@base-ui/react/utils/resolveStyle.mjs
469
- function Pe(e, t) {
470
- return typeof e == "function" ? e(t) : e;
471
- }
472
- //#endregion
473
- //#region node_modules/@base-ui/react/internals/useRenderElement.mjs
474
- function Z(e, t, n = {}) {
475
- let r = t.render, i = Fe(t, n);
476
- return n.enabled === !1 ? null : Be(e, r, i, n.state ?? je);
477
- }
478
- function Fe(e, t = {}) {
479
- let { className: n, style: r, render: i } = e, { state: a = je, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ? Ne(n, a) : void 0, d = l ? Pe(r, a) : void 0, f = l ? Me(a, c) : je, p = l && s ? Ie(s) : void 0, m = l ? H(f, p) ?? {} : je;
480
- return typeof document < "u" && (l ? Array.isArray(o) ? m.ref = xe([
481
- m.ref,
482
- De(i),
483
- ...o
484
- ]) : m.ref = be(m.ref, De(i), o) : be(null, null)), l ? (u !== void 0 && (m.className = de(m.className, u)), d !== void 0 && (m.style = H(m.style, d)), m) : je;
485
- }
486
- function Ie(e) {
487
- return Array.isArray(e) ? ie(e) : U(void 0, e);
488
- }
489
- var Le = Symbol.for("react.lazy"), Re = /^[A-Z][A-Za-z0-9$]*$/, ze = /[a-z]/;
490
- function Be(e, t, n, i) {
491
- if (t) {
492
- if (typeof t == "function") return process.env.NODE_ENV !== "production" && Ve(t), t(n, i);
493
- let e = U(n, t.props);
494
- e.ref = n.ref;
495
- let a = t;
496
- if (a?.$$typeof === Le && (a = r.Children.toArray(t)[0]), process.env.NODE_ENV !== "production" && !/* @__PURE__ */ r.isValidElement(a)) throw Error([
497
- "Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.",
498
- "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",
499
- "https://base-ui.com/r/invalid-render-prop"
500
- ].join("\n"));
501
- return /* @__PURE__ */ r.cloneElement(a, e);
502
- }
503
- if (e && typeof e == "string") return He(e, n);
504
- throw Error(process.env.NODE_ENV === "production" ? J(8) : "Base UI: Render element or function are not defined.");
505
- }
506
- function Ve(e) {
507
- let t = e.name;
508
- t.length !== 0 && Re.test(t) && ze.test(t) && ke(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
509
- }
510
- function He(e, t) {
511
- return e === "button" ? /* @__PURE__ */ a("button", {
512
- type: "button",
513
- ...t,
514
- key: t.key
515
- }) : e === "img" ? /* @__PURE__ */ a("img", {
516
- alt: "",
517
- ...t,
518
- key: t.key
519
- }) : /* @__PURE__ */ r.createElement(e, t);
520
- }
521
- //#endregion
522
- //#region node_modules/@base-ui/utils/useControlled.mjs
523
- function Ue({ controlled: e, default: t, name: n, state: i = "value" }) {
524
- let { current: a } = r.useRef(e !== void 0), [o, s] = r.useState(t), c = a ? e : o;
525
- if (process.env.NODE_ENV !== "production") {
526
- r.useEffect(() => {
527
- a !== (e !== void 0) && B([
528
- `A component is changing the ${a ? "" : "un"}controlled ${i} state of ${n} to be ${a ? "un" : ""}controlled.`,
529
- "Elements should not switch from uncontrolled to controlled (or vice versa).",
530
- `Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,
531
- "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",
532
- "More info: https://fb.me/react-controlled-components"
533
- ].join("\n"));
534
- }, [
535
- i,
536
- n,
537
- e
538
- ]);
539
- let { current: o } = r.useRef(t);
540
- r.useEffect(() => {
541
- !a && We(o) !== We(t) && B([`A component is changing the default ${i} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join("\n"));
542
- }, [t]);
543
- }
544
- return [c, r.useCallback((e) => {
545
- a || s(e);
546
- }, [])];
547
- }
548
- function We(e) {
549
- let t = 0, n = /* @__PURE__ */ new WeakMap();
550
- try {
551
- return JSON.stringify(e, function(e, r) {
552
- if (!(e === "_owner" && this != null && typeof this == "object" && "$$typeof" in this)) {
553
- if (typeof r == "bigint") return `__bigint__:${r}`;
554
- if (typeof r == "object" && r) {
555
- let e = n.get(r);
556
- if (e !== void 0) return `__object__:${e}`;
557
- n.set(r, t), t += 1;
558
- }
559
- return r;
560
- }
561
- }) ?? `__top__:${typeof e}`;
562
- } catch {
563
- return "__unserializable__";
564
- }
565
- }
566
- //#endregion
567
- //#region node_modules/@base-ui/utils/visuallyHidden.mjs
568
- var Ge = {
569
- clipPath: "inset(50%)",
570
- overflow: "hidden",
571
- whiteSpace: "nowrap",
572
- border: 0,
573
- padding: 0,
574
- width: 1,
575
- height: 1,
576
- margin: -1
577
- }, Ke = {
578
- ...Ge,
579
- position: "fixed",
580
- top: 0,
581
- left: 0
582
- }, qe = {
583
- ...Ge,
584
- position: "absolute"
585
- };
586
- //#endregion
587
- //#region node_modules/@base-ui/utils/owner.mjs
588
- function Je(e) {
589
- return e?.ownerDocument || document;
590
- }
591
- //#endregion
592
- //#region node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
593
- var Ye = /* @__PURE__ */ function(e) {
594
- return e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
595
- }({}), Xe = {
596
- badInput: !1,
597
- customError: !1,
598
- patternMismatch: !1,
599
- rangeOverflow: !1,
600
- rangeUnderflow: !1,
601
- stepMismatch: !1,
602
- tooLong: !1,
603
- tooShort: !1,
604
- typeMismatch: !1,
605
- valid: null,
606
- valueMissing: !1
607
- }, Ze = {
608
- valid: null,
609
- touched: !1,
610
- dirty: !1,
611
- filled: !1,
612
- focused: !1
613
- }, Qe = {
614
- disabled: !1,
615
- ...Ze
616
- }, $e = { valid(e) {
617
- return e === null ? null : e ? { [Ye.valid]: "" } : { [Ye.invalid]: "" };
618
- } }, et = 0;
619
- function tt(e, t = "mui") {
620
- let [n, i] = r.useState(e), a = e || n;
621
- return r.useEffect(() => {
622
- n ?? (et += 1, i(`${t}-${et}`));
623
- }, [n, t]), a;
624
- }
625
- var nt = N.useId;
626
- function rt(e, t) {
627
- if (nt !== void 0) {
628
- let n = nt();
629
- return e ?? (t ? `${t}-${n}` : n);
630
- }
631
- return tt(e, t);
632
- }
633
- //#endregion
634
- //#region node_modules/@base-ui/react/internals/useBaseUiId.mjs
635
- function it(e) {
636
- return rt(e, "base-ui");
637
- }
638
- //#endregion
639
- //#region node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
640
- var at = {
641
- invalid: void 0,
642
- name: void 0,
643
- validityData: {
644
- state: Xe,
645
- errors: [],
646
- error: "",
647
- value: "",
648
- initialValue: null
649
- },
650
- setValidityData: X,
651
- disabled: void 0,
652
- touched: Ze.touched,
653
- setTouched: X,
654
- dirty: Ze.dirty,
655
- setDirty: X,
656
- filled: Ze.filled,
657
- setFilled: X,
658
- focused: Ze.focused,
659
- setFocused: X,
660
- validate: () => null,
661
- validationMode: "onSubmit",
662
- validationDebounceTime: 0,
663
- shouldValidateOnChange: () => !1,
664
- state: Qe,
665
- markedDirtyRef: { current: !1 },
666
- registerFieldControl: X,
667
- validation: {
668
- getValidationProps: (e, t = je) => t,
669
- inputRef: { current: null },
670
- registerInput: X,
671
- commit: async () => {},
672
- change: X
673
- }
674
- }, ot = /* @__PURE__ */ r.createContext(at);
675
- process.env.NODE_ENV !== "production" && (ot.displayName = "FieldRootContext");
676
- function st(e = !0) {
677
- let t = r.useContext(ot);
678
- if (t.setValidityData === X && !e) throw Error(process.env.NODE_ENV === "production" ? J(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
679
- return t;
680
- }
681
- //#endregion
682
- //#region node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
683
- function ct(e, t, n, i, a = !0, o) {
684
- let { registerFieldControl: s } = st(), c = r.useRef(null);
685
- c.current ||= Symbol(), V(() => {
686
- let r = c.current;
687
- if (!(!r || !a)) return s(r, {
688
- controlRef: e,
689
- getValue: i,
690
- id: t,
691
- name: o,
692
- value: n
693
- }), () => {
694
- s(r, void 0);
695
- };
696
- }, [
697
- e,
698
- a,
699
- i,
700
- t,
701
- o,
702
- s,
703
- n
704
- ]);
705
- }
706
- //#endregion
707
- //#region node_modules/@base-ui/react/internals/form-context/FormContext.mjs
708
- var lt = /* @__PURE__ */ r.createContext({
709
- formRef: { current: { fields: /* @__PURE__ */ new Map() } },
710
- errors: {},
711
- clearErrors: X,
712
- validationMode: "onSubmit",
713
- submitAttemptedRef: { current: !1 }
714
- });
715
- process.env.NODE_ENV !== "production" && (lt.displayName = "FormContext");
716
- function ut() {
717
- return r.useContext(lt);
718
- }
719
- //#endregion
720
- //#region node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
721
- var dt = /* @__PURE__ */ r.createContext({
722
- controlId: void 0,
723
- registerControlId: X,
724
- labelId: void 0,
725
- setLabelId: X,
726
- messageIds: [],
727
- setMessageIds: X,
728
- getDescriptionProps: (e) => e
729
- });
730
- process.env.NODE_ENV !== "production" && (dt.displayName = "LabelableContext");
731
- function ft() {
732
- return r.useContext(dt);
733
- }
734
- //#endregion
735
- //#region node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs
736
- function pt(e, t, n, i = !0, a) {
737
- let [o, s] = r.useState(), c = it(a ? `${a}-label` : void 0), l = e ?? t ?? o;
738
- return V(() => {
739
- let r = e || t || !i ? void 0 : mt(n.current, c);
740
- o !== r && s(r);
741
- }), l;
742
- }
743
- function mt(e, t) {
744
- let n = ht(e);
745
- if (n) return !n.id && t && (n.id = t), n.id || void 0;
746
- }
747
- function ht(e) {
748
- if (!e) return;
749
- let t = e.parentElement;
750
- if (t && t.tagName === "LABEL") return t;
751
- let n = e.id;
752
- if (n) {
753
- let t = e.nextElementSibling;
754
- if (t && t.htmlFor === n) return t;
755
- }
756
- let r = e.labels;
757
- return r && r[0];
758
- }
759
- //#endregion
760
- //#region node_modules/@base-ui/react/internals/reason-parts.mjs
761
- var gt = "none", _t = "trigger-press", vt = "trigger-hover", yt = "trigger-focus", bt = "outside-press", xt = "item-press", St = "close-press", Ct = "link-press", wt = "input-change", Tt = "focus-out", Et = "escape-key", Dt = "close-watcher", Ot = "list-navigation", kt = "keyboard", At = "cancel-open", jt = "disabled", Mt = "missing", Nt = "initial", Pt = "imperative-action", Ft = "swipe", It = "window-resize";
762
- //#endregion
763
- //#region node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
764
- function Lt(e, t, n, r) {
765
- let i = !1, a = !1, o = r ?? je;
766
- return {
767
- reason: e,
768
- event: t ?? new Event("base-ui"),
769
- cancel() {
770
- i = !0;
771
- },
772
- allowPropagation() {
773
- a = !0;
774
- },
775
- get isCanceled() {
776
- return i;
777
- },
778
- get isPropagationAllowed() {
779
- return a;
780
- },
781
- trigger: n,
782
- ...o
783
- };
784
- }
785
- function Rt(e, t, n) {
786
- let r = n ?? je;
787
- return {
788
- reason: e,
789
- event: t ?? new Event("base-ui"),
790
- ...r
791
- };
792
- }
793
- //#endregion
794
- //#region node_modules/@base-ui/react/internals/useValueChanged.mjs
795
- function zt(e, t) {
796
- let n = r.useRef(e), i = L(t);
797
- V(() => {
798
- n.current !== e && i(n.current);
799
- }, [e, i]), V(() => {
800
- n.current = e;
801
- }, [e]);
802
- }
803
- //#endregion
804
- //#region node_modules/@base-ui/utils/useOnMount.mjs
805
- var Bt = [];
806
- function Vt(e) {
807
- r.useEffect(e, Bt);
808
- }
809
- //#endregion
810
- //#region node_modules/@base-ui/utils/useAnimationFrame.mjs
811
- var Ht = null, Ut = globalThis.requestAnimationFrame, Wt = new class {
812
- callbacks = [];
813
- callbacksCount = 0;
814
- nextId = 1;
815
- startId = 1;
816
- isScheduled = !1;
817
- tick = (e) => {
818
- this.isScheduled = !1;
819
- let t = this.callbacks, n = this.callbacksCount;
820
- if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, n > 0) for (let n = 0; n < t.length; n += 1) t[n]?.(e);
821
- };
822
- request(e) {
823
- let t = this.nextId;
824
- this.nextId += 1, this.callbacks.push(e), this.callbacksCount += 1;
825
- let n = process.env.NODE_ENV !== "production" && Ut !== requestAnimationFrame && (Ut = requestAnimationFrame, !0);
826
- return (!this.isScheduled || n) && (requestAnimationFrame(this.tick), this.isScheduled = !0), t;
827
- }
828
- cancel(e) {
829
- let t = e - this.startId;
830
- t < 0 || t >= this.callbacks.length || (this.callbacks[t] = null, --this.callbacksCount);
831
- }
832
- }(), Gt = class e {
833
- static create() {
834
- return new e();
835
- }
836
- static request(e) {
837
- return Wt.request(e);
838
- }
839
- static cancel(e) {
840
- return Wt.cancel(e);
841
- }
842
- currentId = Ht;
843
- request(e) {
844
- this.cancel(), this.currentId = Wt.request(() => {
845
- this.currentId = Ht, e();
846
- });
847
- }
848
- cancel = () => {
849
- this.currentId !== Ht && (Wt.cancel(this.currentId), this.currentId = Ht);
850
- };
851
- disposeEffect = () => this.cancel;
852
- };
853
- function Kt() {
854
- let e = F(Gt.create).current;
855
- return Vt(e.disposeEffect), e;
856
- }
857
- //#endregion
858
- //#region node_modules/@base-ui/react/utils/resolveRef.mjs
859
- function qt(e) {
860
- return e == null ? e : "current" in e ? e.current : e;
861
- }
862
- //#endregion
863
- //#region node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
864
- var Jt = /* @__PURE__ */ function(e) {
865
- return e.startingStyle = "data-starting-style", e.endingStyle = "data-ending-style", e;
866
- }({}), Yt = { [Jt.startingStyle]: "" }, Xt = { [Jt.endingStyle]: "" }, Zt = { transitionStatus(e) {
867
- return e === "starting" ? Yt : e === "ending" ? Xt : null;
868
- } };
869
- //#endregion
870
- //#region node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
871
- function Qt(e, t = !1, n = !0) {
872
- let r = Kt();
873
- return L((i, a = null) => {
874
- r.cancel();
875
- let o = qt(e);
876
- if (o == null) return;
877
- let s = o, l = () => {
878
- c.flushSync(i);
879
- };
880
- if (typeof s.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
881
- i();
882
- return;
883
- }
884
- function u() {
885
- Promise.all(s.getAnimations().map((e) => e.finished)).then(() => {
886
- a?.aborted || l();
887
- }).catch(() => {
888
- if (n) {
889
- a?.aborted || l();
890
- return;
891
- }
892
- let e = s.getAnimations();
893
- !a?.aborted && e.length > 0 && e.some((e) => e.pending || e.playState !== "finished") && u();
894
- });
895
- }
896
- if (t) {
897
- let e = Jt.startingStyle;
898
- if (!s.hasAttribute(e)) {
899
- r.request(u);
900
- return;
901
- }
902
- let t = new MutationObserver(() => {
903
- s.hasAttribute(e) || (t.disconnect(), u());
904
- });
905
- t.observe(s, {
906
- attributes: !0,
907
- attributeFilter: [e]
908
- }), a?.addEventListener("abort", () => t.disconnect(), { once: !0 });
909
- return;
910
- }
911
- r.request(u);
912
- });
913
- }
914
- //#endregion
915
- //#region node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
916
- function $t(e) {
917
- let { enabled: t = !0, open: n, ref: i, onComplete: a } = e, o = L(a), s = Qt(i, n, !1);
918
- r.useEffect(() => {
919
- if (!t) return;
920
- let e = new AbortController();
921
- return s(o, e.signal), () => {
922
- e.abort();
923
- };
924
- }, [
925
- t,
926
- n,
927
- o,
928
- s
929
- ]);
930
- }
931
- //#endregion
932
- //#region node_modules/@base-ui/react/internals/useTransitionStatus.mjs
933
- function en(e, t = !1, n = !1) {
934
- let [i, a] = r.useState(e && t ? "idle" : void 0), [o, s] = r.useState(e);
935
- return e && !o && (s(!0), a("starting")), !e && o && i !== "ending" && !n && a("ending"), !e && !o && i === "ending" && a(void 0), V(() => {
936
- if (!e && o && i !== "ending" && n) {
937
- let e = Gt.request(() => {
938
- a("ending");
939
- });
940
- return () => {
941
- Gt.cancel(e);
942
- };
943
- }
944
- }, [
945
- e,
946
- o,
947
- i,
948
- n
949
- ]), V(() => {
950
- if (!e || t) return;
951
- let n = Gt.request(() => {
952
- a(void 0);
953
- });
954
- return () => {
955
- Gt.cancel(n);
956
- };
957
- }, [t, e]), V(() => {
958
- if (!e || !t) return;
959
- e && o && i !== "idle" && a("starting");
960
- let n = Gt.request(() => {
961
- a("idle");
962
- });
963
- return () => {
964
- Gt.cancel(n);
965
- };
966
- }, [
967
- t,
968
- e,
969
- o,
970
- i
971
- ]), {
972
- mounted: o,
973
- setMounted: s,
974
- transitionStatus: i
975
- };
976
- }
977
- //#endregion
978
- //#region node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
979
- function tn(e = {}) {
980
- let { id: t, implicit: n = !1, controlRef: i } = e, { controlId: a, registerControlId: o } = ft(), s = it(t), c = n ? a : void 0, l = F(() => Symbol("labelable-control")), u = r.useRef(!1), d = r.useRef(t != null), f = L(() => {
981
- !u.current || o === X || (u.current = !1, o(l.current, void 0));
982
- });
983
- return V(() => {
984
- if (o === X) return;
985
- let e;
986
- if (n) {
987
- let n = i?.current;
988
- e = m(n) && n.closest("label") != null ? t ?? null : c ?? s;
989
- } else if (t != null) d.current = !0, e = t;
990
- else if (d.current) e = s;
991
- else {
992
- f();
993
- return;
994
- }
995
- if (e === void 0) {
996
- f();
997
- return;
998
- }
999
- u.current = !0, o(l.current, e);
1000
- }, [
1001
- t,
1002
- i,
1003
- c,
1004
- o,
1005
- n,
1006
- s,
1007
- l,
1008
- f
1009
- ]), r.useEffect(() => f, [f]), a ?? s;
1010
- }
1011
- //#endregion
1012
- //#region node_modules/@base-ui/utils/platform/shared.mjs
1013
- function nn() {
1014
- if (typeof navigator > "u") return {
1015
- userAgent: "",
1016
- platform: "",
1017
- maxTouchPoints: 0
1018
- };
1019
- if (process.env.NODE_ENV !== "production") {
1020
- let e = navigator.userAgentData;
1021
- if (e && Array.isArray(e.brands)) return {
1022
- userAgent: e.brands.map(({ brand: e, version: t }) => `${e}/${t}`).join(" "),
1023
- platform: e.platform ?? navigator.platform ?? "",
1024
- maxTouchPoints: navigator.maxTouchPoints ?? 0
1025
- };
1026
- }
1027
- return {
1028
- userAgent: navigator.userAgent,
1029
- platform: navigator.platform ?? "",
1030
- maxTouchPoints: navigator.maxTouchPoints ?? 0
1031
- };
1032
- }
1033
- var { userAgent: rn, platform: an, maxTouchPoints: on } = nn(), sn = rn.toLowerCase(), cn = an.toLowerCase(), ln = /^i(os$|p)/.test(cn) || cn === "macintel" && on > 1, un = "android", dn = cn === un || sn.includes(un), fn = !ln && cn.startsWith("mac");
1034
- cn.startsWith("win"), !dn && /^(linux|chrome os)/.test(cn);
1035
- var pn = fn || ln, mn = /jsdom|happydom/.test(sn), hn = "data-base-ui-focusable", gn = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", _n = "ArrowLeft", vn = "ArrowRight", yn = "ArrowUp", bn = "ArrowDown";
1036
- //#endregion
1037
- //#region node_modules/@base-ui/react/internals/shadowDom.mjs
1038
- function xn(e) {
1039
- let t = e.activeElement;
1040
- for (; t?.shadowRoot?.activeElement != null;) t = t.shadowRoot.activeElement;
1041
- return t;
1042
- }
1043
- function Sn(e, t) {
1044
- if (!e || !t) return !1;
1045
- let n = t.getRootNode?.();
1046
- if (e.contains(t)) return !0;
1047
- if (n && g(n)) {
1048
- let n = t;
1049
- for (; n;) {
1050
- if (e === n) return !0;
1051
- n = n.parentNode || n.host;
1052
- }
1053
- }
1054
- return !1;
1055
- }
1056
- function Cn(e) {
1057
- return "composedPath" in e ? e.composedPath()[0] : e.target;
1058
- }
1059
- //#endregion
1060
- //#region node_modules/@base-ui/react/floating-ui-react/utils/element.mjs
1061
- function wn(e, t) {
1062
- if (!m(e)) return !1;
1063
- let n = e;
1064
- if (t.hasElement(n)) return !n.hasAttribute("data-trigger-disabled");
1065
- for (let [, e] of t.entries()) if (Sn(e, n)) return !e.hasAttribute("data-trigger-disabled");
1066
- return !1;
1067
- }
1068
- function Tn(e, t) {
1069
- if (t == null) return !1;
1070
- if ("composedPath" in e) return e.composedPath().includes(t);
1071
- let n = e;
1072
- return n.target != null && t.contains(n.target);
1073
- }
1074
- function En(e) {
1075
- return e.matches("html,body");
1076
- }
1077
- function Dn(e) {
1078
- return h(e) && e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])");
1079
- }
1080
- function On(e) {
1081
- return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gn}`) != null;
1082
- }
1083
- function kn(e) {
1084
- return e ? e.getAttribute("role") === "combobox" && Dn(e) : !1;
1085
- }
1086
- function An(e) {
1087
- if (!e || mn) return !0;
1088
- try {
1089
- return e.matches(":focus-visible");
1090
- } catch {
1091
- return !0;
1092
- }
1093
- }
1094
- function jn(e) {
1095
- return e ? e.hasAttribute("data-base-ui-focusable") ? e : e.querySelector("[data-base-ui-focusable]") || e : null;
1096
- }
1097
- //#endregion
1098
- //#region node_modules/@base-ui/react/floating-ui-react/utils/event.mjs
1099
- function Mn(e) {
1100
- e.preventDefault(), e.stopPropagation();
1101
- }
1102
- function Nn(e) {
1103
- return "nativeEvent" in e;
1104
- }
1105
- function Pn(e) {
1106
- return e.pointerType === "" && e.isTrusted ? !0 : dn && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
1107
- }
1108
- function Fn(e) {
1109
- return mn ? !1 : !dn && e.width === 0 && e.height === 0 || dn && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
1110
- }
1111
- function In(e, t) {
1112
- let n = ["mouse", "pen"];
1113
- return t || n.push("", void 0), n.includes(e);
1114
- }
1115
- function Ln(e) {
1116
- let t = e.type;
1117
- return t === "click" || t === "mousedown" || t === "keydown" || t === "keyup";
1118
- }
1119
- //#endregion
1120
- //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1121
- var Rn = [
1122
- "top",
1123
- "right",
1124
- "bottom",
1125
- "left"
1126
- ], zn = Math.min, Bn = Math.max, Vn = Math.round, Hn = Math.floor, Un = (e) => ({
1127
- x: e,
1128
- y: e
1129
- }), Wn = {
1130
- left: "right",
1131
- right: "left",
1132
- bottom: "top",
1133
- top: "bottom"
1134
- };
1135
- function Gn(e, t, n) {
1136
- return Bn(e, zn(t, n));
1137
- }
1138
- function Kn(e, t) {
1139
- return typeof e == "function" ? e(t) : e;
1140
- }
1141
- function qn(e) {
1142
- return e.split("-")[0];
1143
- }
1144
- function Jn(e) {
1145
- return e.split("-")[1];
1146
- }
1147
- function Yn(e) {
1148
- return e === "x" ? "y" : "x";
1149
- }
1150
- function Xn(e) {
1151
- return e === "y" ? "height" : "width";
1152
- }
1153
- function Zn(e) {
1154
- let t = e[0];
1155
- return t === "t" || t === "b" ? "y" : "x";
1156
- }
1157
- function Qn(e) {
1158
- return Yn(Zn(e));
1159
- }
1160
- function $n(e, t, n) {
1161
- n === void 0 && (n = !1);
1162
- let r = Jn(e), i = Qn(e), a = Xn(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
1163
- return t.reference[a] > t.floating[a] && (o = cr(o)), [o, cr(o)];
1164
- }
1165
- function er(e) {
1166
- let t = cr(e);
1167
- return [
1168
- tr(e),
1169
- t,
1170
- tr(t)
1171
- ];
1172
- }
1173
- function tr(e) {
1174
- return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
1175
- }
1176
- var nr = ["left", "right"], rr = ["right", "left"], ir = ["top", "bottom"], ar = ["bottom", "top"];
1177
- function or(e, t, n) {
1178
- switch (e) {
1179
- case "top":
1180
- case "bottom": return n ? t ? rr : nr : t ? nr : rr;
1181
- case "left":
1182
- case "right": return t ? ir : ar;
1183
- default: return [];
1184
- }
1185
- }
1186
- function sr(e, t, n, r) {
1187
- let i = Jn(e), a = or(qn(e), n === "start", r);
1188
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(tr)))), a;
1189
- }
1190
- function cr(e) {
1191
- let t = qn(e);
1192
- return Wn[t] + e.slice(t.length);
1193
- }
1194
- function lr(e) {
1195
- return {
1196
- top: 0,
1197
- right: 0,
1198
- bottom: 0,
1199
- left: 0,
1200
- ...e
1201
- };
1202
- }
1203
- function ur(e) {
1204
- return typeof e == "number" ? {
1205
- top: e,
1206
- right: e,
1207
- bottom: e,
1208
- left: e
1209
- } : lr(e);
1210
- }
1211
- function dr(e) {
1212
- let { x: t, y: n, width: r, height: i } = e;
1213
- return {
1214
- width: r,
1215
- height: i,
1216
- top: n,
1217
- left: t,
1218
- right: t + r,
1219
- bottom: n + i,
1220
- x: t,
1221
- y: n
1222
- };
1223
- }
1224
- //#endregion
1225
- //#region node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
1226
- function fr(e, t) {
1227
- return t < 0 || t >= e.length;
1228
- }
1229
- function pr(e, t) {
1230
- return hr(e.current, { disabledIndices: t });
1231
- }
1232
- function mr(e, t) {
1233
- return hr(e.current, {
1234
- decrement: !0,
1235
- startingIndex: e.current.length,
1236
- disabledIndices: t
1237
- });
1238
- }
1239
- function hr(e, { startingIndex: t = -1, decrement: n = !1, disabledIndices: r, amount: i = 1 } = {}) {
1240
- let a = t;
1241
- do
1242
- a += n ? -i : i;
1243
- while (a >= 0 && a <= e.length - 1 && gr(e, a, r));
1244
- return a;
1245
- }
1246
- function gr(e, t, n) {
1247
- if (typeof n == "function" ? n(t) : n?.includes(t) ?? !1) return !0;
1248
- let r = e[t];
1249
- return r ? vr(r) ? !n && (r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true") : !0 : !1;
1250
- }
1251
- function _r(e) {
1252
- return e.visibility === "hidden" || e.visibility === "collapse";
1253
- }
1254
- function vr(e, t = e ? O(e) : null) {
1255
- return !e || !e.isConnected || !t || _r(t) ? !1 : typeof e.checkVisibility == "function" ? e.checkVisibility() : t.display !== "none" && t.display !== "contents";
1256
- }
1257
- //#endregion
1258
- //#region node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
1259
- function yr(e, t) {
1260
- let n = it(e);
1261
- return V(() => (t(n), () => {
1262
- t(void 0);
1263
- }), [n, t]), n;
1264
- }
1265
- //#endregion
1266
- //#region node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
1267
- function br(e = {}) {
1268
- let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } = ft(), c = yr(t, L((e) => {
1269
- s(e), i?.(e);
1270
- })), l = o ?? n;
1271
- function u(e) {
1272
- if (a) {
1273
- a(e, l);
1274
- return;
1275
- }
1276
- if (!l) return;
1277
- let t = Je(e.currentTarget).getElementById(l);
1278
- h(t) && xr(t);
1279
- }
1280
- function d(e) {
1281
- Cn(e.nativeEvent)?.closest("button,input,select,textarea") || (!e.defaultPrevented && e.detail > 1 && e.preventDefault(), !r && u(e));
1282
- }
1283
- return r ? {
1284
- id: c,
1285
- htmlFor: l ?? void 0,
1286
- onMouseDown: d
1287
- } : {
1288
- id: c,
1289
- onClick: d,
1290
- onPointerDown(e) {
1291
- e.preventDefault();
1292
- }
1293
- };
1294
- }
1295
- function xr(e) {
1296
- e.focus({ focusVisible: !0 });
1297
- }
1298
- //#endregion
1299
- //#region node_modules/@base-ui/utils/isElementDisabled.mjs
1300
- function Sr(e) {
1301
- return e == null || e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true";
1302
- }
1303
- //#endregion
1304
- //#region node_modules/@base-ui/utils/useValueAsRef.mjs
1305
- function Cr(e) {
1306
- let t = F(wr, e).current;
1307
- return t.next = e, V(t.effect), t;
1308
- }
1309
- function wr(e) {
1310
- let t = {
1311
- current: e,
1312
- next: e,
1313
- effect: () => {
1314
- t.current = t.next;
1315
- }
1316
- };
1317
- return t;
1318
- }
1319
- //#endregion
1320
- //#region builtin:esm-external-require-react
1321
- var Tr = /* @__PURE__ */ t(((e, t) => {
1322
- t.exports = { ...r };
1323
- })), Er = /* @__PURE__ */ t(((e) => {
1324
- var t = Tr();
1325
- function n(e, t) {
1326
- return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
1327
- }
1328
- var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
1329
- function c(e, t) {
1330
- var n = t(), r = i({ inst: {
1331
- value: n,
1332
- getSnapshot: t
1333
- } }), c = r[0].inst, u = r[1];
1334
- return o(function() {
1335
- c.value = n, c.getSnapshot = t, l(c) && u({ inst: c });
1336
- }, [
1337
- e,
1338
- n,
1339
- t
1340
- ]), a(function() {
1341
- return l(c) && u({ inst: c }), e(function() {
1342
- l(c) && u({ inst: c });
1343
- });
1344
- }, [e]), s(n), n;
1345
- }
1346
- function l(e) {
1347
- var t = e.getSnapshot;
1348
- e = e.value;
1349
- try {
1350
- var n = t();
1351
- return !r(e, n);
1352
- } catch {
1353
- return !0;
1354
- }
1355
- }
1356
- function u(e, t) {
1357
- return t();
1358
- }
1359
- var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
1360
- e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
1361
- })), Dr = /* @__PURE__ */ t(((e) => {
1362
- process.env.NODE_ENV !== "production" && (function() {
1363
- function t(e, t) {
1364
- return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
1365
- }
1366
- function n(e, t) {
1367
- d || a.startTransition === void 0 || (d = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
1368
- var n = t();
1369
- if (!f) {
1370
- var i = t();
1371
- o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
1372
- }
1373
- i = s({ inst: {
1374
- value: n,
1375
- getSnapshot: t
1376
- } });
1377
- var p = i[0].inst, m = i[1];
1378
- return l(function() {
1379
- p.value = n, p.getSnapshot = t, r(p) && m({ inst: p });
1380
- }, [
1381
- e,
1382
- n,
1383
- t
1384
- ]), c(function() {
1385
- return r(p) && m({ inst: p }), e(function() {
1386
- r(p) && m({ inst: p });
1387
- });
1388
- }, [e]), u(n), n;
1389
- }
1390
- function r(e) {
1391
- var t = e.getSnapshot;
1392
- e = e.value;
1393
- try {
1394
- var n = t();
1395
- return !o(e, n);
1396
- } catch {
1397
- return !0;
1398
- }
1399
- }
1400
- function i(e, t) {
1401
- return t();
1402
- }
1403
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1404
- var a = Tr(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
1405
- e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1406
- })();
1407
- })), Or = /* @__PURE__ */ t(((e, t) => {
1408
- process.env.NODE_ENV === "production" ? t.exports = Er() : t.exports = Dr();
1409
- }));
1410
- //#endregion
1411
- //#region node_modules/@base-ui/utils/addEventListener.mjs
1412
- function kr(e, t, n, r) {
1413
- return e.addEventListener(t, n, r), () => {
1414
- e.removeEventListener(t, n, r);
1415
- };
1416
- }
1417
- //#endregion
1418
- //#region node_modules/@base-ui/utils/useForcedRerendering.mjs
1419
- var Ar = Or();
1420
- function jr() {
1421
- let [, e] = r.useState({});
1422
- return r.useCallback(() => {
1423
- e({});
1424
- }, []);
1425
- }
1426
- //#endregion
1427
- //#region node_modules/@base-ui/react/internals/areArraysEqual.mjs
1428
- function Mr(e, t, n = (e, t) => e === t) {
1429
- return e.length === t.length && e.every((e, r) => n(e, t[r]));
1430
- }
1431
- //#endregion
1432
- //#region node_modules/@base-ui/react/internals/clamp.mjs
1433
- function Nr(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
1434
- return Math.max(t, Math.min(e, n));
1435
- }
1436
- //#endregion
1437
- //#region node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs
1438
- function Pr(e) {
1439
- return e == null ? void 0 : `${e}-label`;
1440
- }
1441
- function Fr(e, t) {
1442
- return e ?? t;
1443
- }
1444
- //#endregion
1445
- //#region node_modules/@base-ui/utils/inertValue.mjs
1446
- function Ir(e) {
1447
- return Ee(19) ? e : e ? "true" : void 0;
1448
- }
1449
- //#endregion
1450
- //#region node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
1451
- var Lr = /* @__PURE__ */ r.createContext({
1452
- register: () => {},
1453
- unregister: () => {},
1454
- subscribeMapChange: () => () => {},
1455
- elementsRef: { current: [] },
1456
- nextIndexRef: { current: 0 }
1457
- });
1458
- process.env.NODE_ENV !== "production" && (Lr.displayName = "CompositeListContext");
1459
- function Rr() {
1460
- return r.useContext(Lr);
1461
- }
1462
- //#endregion
1463
- //#region node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
1464
- function zr(e) {
1465
- let { children: t, elementsRef: n, labelsRef: i, onMapChange: a } = e, s = L(a), c = r.useRef(0), l = F(Vr).current, u = F(Br).current, [d, f] = r.useState(0), p = r.useRef(d), m = L((e, t) => {
1466
- u.set(e, t ?? null), p.current += 1, f(p.current);
1467
- }), h = L((e) => {
1468
- u.delete(e), p.current += 1, f(p.current);
1469
- }), g = r.useMemo(() => {
1470
- let e = /* @__PURE__ */ new Map();
1471
- return Array.from(u.keys()).filter((e) => e.isConnected).sort(Hr).forEach((t, n) => {
1472
- let r = u.get(t) ?? {};
1473
- e.set(t, {
1474
- ...r,
1475
- index: n
1476
- });
1477
- }), e;
1478
- }, [u, d]);
1479
- V(() => {
1480
- if (typeof MutationObserver != "function" || g.size === 0) return;
1481
- let e = new MutationObserver((e) => {
1482
- let t = /* @__PURE__ */ new Set(), n = (e) => t.has(e) ? t.delete(e) : t.add(e);
1483
- e.forEach((e) => {
1484
- e.removedNodes.forEach(n), e.addedNodes.forEach(n);
1485
- }), t.size === 0 && (p.current += 1, f(p.current));
1486
- });
1487
- return g.forEach((t, n) => {
1488
- n.parentElement && e.observe(n.parentElement, { childList: !0 });
1489
- }), () => {
1490
- e.disconnect();
1491
- };
1492
- }, [g]), V(() => {
1493
- p.current === d && (n.current.length !== g.size && (n.current.length = g.size), i && i.current.length !== g.size && (i.current.length = g.size), c.current = g.size), s(g);
1494
- }, [
1495
- s,
1496
- g,
1497
- n,
1498
- i,
1499
- d
1500
- ]), V(() => () => {
1501
- n.current = [];
1502
- }, [n]), V(() => () => {
1503
- i && (i.current = []);
1504
- }, [i]);
1505
- let _ = L((e) => (l.add(e), () => {
1506
- l.delete(e);
1507
- }));
1508
- V(() => {
1509
- l.forEach((e) => e(g));
1510
- }, [l, g]);
1511
- let v = r.useMemo(() => ({
1512
- register: m,
1513
- unregister: h,
1514
- subscribeMapChange: _,
1515
- elementsRef: n,
1516
- labelsRef: i,
1517
- nextIndexRef: c
1518
- }), [
1519
- m,
1520
- h,
1521
- _,
1522
- n,
1523
- i,
1524
- c
1525
- ]);
1526
- return /* @__PURE__ */ o(Lr.Provider, {
1527
- value: v,
1528
- children: t
1529
- });
1530
- }
1531
- function Br() {
1532
- return /* @__PURE__ */ new Map();
1533
- }
1534
- function Vr() {
1535
- return /* @__PURE__ */ new Set();
1536
- }
1537
- function Hr(e, t) {
1538
- let n = e.compareDocumentPosition(t);
1539
- return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
1540
- }
1541
- //#endregion
1542
- //#region node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
1543
- var Ur = /* @__PURE__ */ r.createContext(void 0);
1544
- process.env.NODE_ENV !== "production" && (Ur.displayName = "DirectionContext");
1545
- function Wr() {
1546
- return r.useContext(Ur)?.direction ?? "ltr";
1547
- }
1548
- //#endregion
1549
- //#region node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs
1550
- var Gr = /* @__PURE__ */ r.createContext(void 0);
1551
- process.env.NODE_ENV !== "production" && (Gr.displayName = "ToolbarRootContext");
1552
- function Kr(e) {
1553
- let t = r.useContext(Gr);
1554
- if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? J(69) : "Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.");
1555
- return t;
1556
- }
1557
- //#endregion
1558
- //#region node_modules/@base-ui/react/internals/composite/composite.mjs
1559
- var qr = "ArrowUp", Jr = "ArrowDown", Yr = "ArrowLeft", Xr = "ArrowRight", Zr = "Home", Qr = "PageUp", $r = "PageDown", ei = new Set([Yr, Xr]), ti = new Set([
1560
- Yr,
1561
- Xr,
1562
- Zr,
1563
- "End"
1564
- ]), ni = new Set([qr, Jr]), ri = new Set([
1565
- qr,
1566
- Jr,
1567
- Zr,
1568
- "End"
1569
- ]), ii = new Set([...ei, ...ni]), ai = new Set([
1570
- ...ii,
1571
- Zr,
1572
- "End"
1573
- ]), oi = new Set([
1574
- "Shift",
1575
- "Control",
1576
- "Alt",
1577
- "Meta"
1578
- ]);
1579
- function si(e) {
1580
- return h(e) && e.tagName === "INPUT";
1581
- }
1582
- function ci(e) {
1583
- return !!(si(e) && e.selectionStart != null || h(e) && e.tagName === "TEXTAREA");
1584
- }
1585
- function li(e, t, n, r) {
1586
- if (!e || !t || !t.scrollTo) return;
1587
- let i = e.scrollLeft, a = e.scrollTop, o = e.clientWidth < e.scrollWidth, s = e.clientHeight < e.scrollHeight;
1588
- if (o && r !== "vertical") {
1589
- let r = ui(e, t, "left"), a = di(e), o = di(t);
1590
- n === "ltr" && (r + t.offsetWidth + o.scrollMarginRight > e.scrollLeft + e.clientWidth - a.scrollPaddingRight ? i = r + t.offsetWidth + o.scrollMarginRight - e.clientWidth + a.scrollPaddingRight : r - o.scrollMarginLeft < e.scrollLeft + a.scrollPaddingLeft && (i = r - o.scrollMarginLeft - a.scrollPaddingLeft)), n === "rtl" && (r - o.scrollMarginRight < e.scrollLeft + a.scrollPaddingLeft ? i = r - o.scrollMarginLeft - a.scrollPaddingLeft : r + t.offsetWidth + o.scrollMarginRight > e.scrollLeft + e.clientWidth - a.scrollPaddingRight && (i = r + t.offsetWidth + o.scrollMarginRight - e.clientWidth + a.scrollPaddingRight));
1591
- }
1592
- if (s && r !== "horizontal") {
1593
- let n = ui(e, t, "top"), r = di(e), i = di(t);
1594
- n - i.scrollMarginTop < e.scrollTop + r.scrollPaddingTop ? a = n - i.scrollMarginTop - r.scrollPaddingTop : n + t.offsetHeight + i.scrollMarginBottom > e.scrollTop + e.clientHeight - r.scrollPaddingBottom && (a = n + t.offsetHeight + i.scrollMarginBottom - e.clientHeight + r.scrollPaddingBottom);
1595
- }
1596
- e.scrollTo({
1597
- left: i,
1598
- top: a,
1599
- behavior: "auto"
1600
- });
1601
- }
1602
- function ui(e, t, n) {
1603
- let r = n === "left" ? "offsetLeft" : "offsetTop", i = 0;
1604
- for (; t.offsetParent && (i += t[r], t.offsetParent !== e);) t = t.offsetParent;
1605
- return i;
1606
- }
1607
- function di(e) {
1608
- let t = getComputedStyle(e);
1609
- return {
1610
- scrollMarginTop: parseFloat(t.scrollMarginTop) || 0,
1611
- scrollMarginRight: parseFloat(t.scrollMarginRight) || 0,
1612
- scrollMarginBottom: parseFloat(t.scrollMarginBottom) || 0,
1613
- scrollMarginLeft: parseFloat(t.scrollMarginLeft) || 0,
1614
- scrollPaddingTop: parseFloat(t.scrollPaddingTop) || 0,
1615
- scrollPaddingRight: parseFloat(t.scrollPaddingRight) || 0,
1616
- scrollPaddingBottom: parseFloat(t.scrollPaddingBottom) || 0,
1617
- scrollPaddingLeft: parseFloat(t.scrollPaddingLeft) || 0
1618
- };
1619
- }
1620
- //#endregion
1621
- //#region node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
1622
- var fi = /* @__PURE__ */ r.createContext(void 0);
1623
- process.env.NODE_ENV !== "production" && (fi.displayName = "CSPContext");
1624
- var pi = { disableStyleElements: !1 };
1625
- function mi() {
1626
- return r.useContext(fi) ?? pi;
1627
- }
1628
- //#endregion
1629
- //#region node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
1630
- var hi = /* @__PURE__ */ function(e) {
1631
- return e[e.None = 0] = "None", e[e.GuessFromOrder = 1] = "GuessFromOrder", e;
1632
- }({});
1633
- function gi(e = {}) {
1634
- let { label: t, metadata: n, textRef: i, indexGuessBehavior: a, index: o } = e, { register: s, unregister: c, subscribeMapChange: l, elementsRef: u, labelsRef: d, nextIndexRef: f } = Rr(), p = r.useRef(-1), [m, h] = r.useState(o ?? (a === hi.GuessFromOrder ? () => {
1635
- if (p.current === -1) {
1636
- let e = f.current;
1637
- f.current += 1, p.current = e;
1638
- }
1639
- return p.current;
1640
- } : -1)), g = r.useRef(null), _ = r.useCallback((e) => {
1641
- if (g.current = e, m !== -1 && e !== null && (u.current[m] = e, d)) {
1642
- let n = t !== void 0;
1643
- d.current[m] = n ? t : i?.current?.textContent ?? e.textContent;
1644
- }
1645
- }, [
1646
- m,
1647
- u,
1648
- d,
1649
- t,
1650
- i
1651
- ]);
1652
- return V(() => {
1653
- if (o != null) return;
1654
- let e = g.current;
1655
- if (e) return s(e, n), () => {
1656
- c(e);
1657
- };
1658
- }, [
1659
- o,
1660
- s,
1661
- c,
1662
- n
1663
- ]), V(() => {
1664
- if (o == null) return l((e) => {
1665
- let t = g.current ? e.get(g.current)?.index : null;
1666
- t != null && h(t);
1667
- });
1668
- }, [
1669
- o,
1670
- l,
1671
- h
1672
- ]), {
1673
- ref: _,
1674
- index: m
1675
- };
1676
- }
1677
- //#endregion
1678
- //#region node_modules/@base-ui/react/slider/utils/asc.mjs
1679
- function _i(e, t) {
1680
- return e - t;
1681
- }
1682
- //#endregion
1683
- //#region node_modules/@base-ui/react/slider/utils/replaceArrayItemAtIndex.mjs
1684
- function vi(e, t, n) {
1685
- let r = e.slice();
1686
- return r[t] = n, r.sort(_i);
1687
- }
1688
- //#endregion
1689
- //#region node_modules/@base-ui/react/slider/utils/getSliderValue.mjs
1690
- function yi(e, t, n, r, i, a) {
1691
- let o = e;
1692
- return o = Nr(o, n, r), i && (o = vi(a, t, Nr(o, a[t - 1] ?? -Infinity, a[t + 1] ?? Infinity))), o;
1693
- }
1694
- //#endregion
1695
- //#region node_modules/@base-ui/react/slider/utils/validateMinimumDistance.mjs
1696
- function bi(e, t, n) {
1697
- if (!Array.isArray(e)) return !0;
1698
- let r = e.reduce((e, t, n, r) => (n === r.length - 1 || e.push(Math.abs(t - r[n + 1])), e), []);
1699
- return Math.min(...r) >= t * n;
1700
- }
1701
- //#endregion
1702
- //#region node_modules/@base-ui/react/slider/root/stateAttributesMapping.mjs
1703
- var xi = {
1704
- activeThumbIndex: () => null,
1705
- max: () => null,
1706
- min: () => null,
1707
- minStepsBetweenValues: () => null,
1708
- step: () => null,
1709
- values: () => null,
1710
- ...$e
1711
- }, Si = /* @__PURE__ */ r.createContext(void 0);
1712
- process.env.NODE_ENV !== "production" && (Si.displayName = "SliderRootContext");
1713
- function Ci() {
1714
- let e = r.useContext(Si);
1715
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? J(62) : "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
1716
- return e;
1717
- }
1718
- //#endregion
1719
- //#region node_modules/@base-ui/react/slider/root/SliderRoot.mjs
1720
- function wi(e) {
1721
- return "key" in e ? kt : wt;
1722
- }
1723
- function Ti(e, t) {
1724
- return typeof e == "number" && typeof t == "number" ? e === t : Array.isArray(e) && Array.isArray(t) ? Mr(e, t) : !1;
1725
- }
1726
- var Ei = /* @__PURE__ */ r.forwardRef(function(e, t) {
1727
- let { "aria-labelledby": n, className: i, defaultValue: a, disabled: s = !1, id: c, format: l, largeStep: u = 10, locale: d, render: f, max: p = 100, min: m = 0, minStepsBetweenValues: h = 0, form: g, name: _, onValueChange: v, onValueCommitted: y, orientation: b = "horizontal", step: x = 1, thumbCollisionBehavior: S = "push", thumbAlignment: C = "center", value: w, style: T, ...E } = e, D = it(c), O = Pr(D), k = L(v), A = L(y), { clearErrors: j } = ut(), { state: M, disabled: ee, name: N, setTouched: P, setDirty: F, validityData: te, validation: I } = st(), { labelId: R } = ft(), [ne, z] = r.useState(), B = n ?? Fr(R, ne), H = ee || s, re = N ?? _, [U, ie] = Ue({
1728
- controlled: w,
1729
- default: a ?? m,
1730
- name: "Slider"
1731
- }), ae = r.useRef(null), W = r.useRef(null), oe = r.useRef([]), se = r.useRef(null), ce = r.useRef(null), G = r.useRef(-1), K = r.useRef(null), le = r.useRef("none"), ue = Cr(l), [q, de] = r.useState(-1), [fe, pe] = r.useState(-1), [J, me] = r.useState(!1), [he, ge] = r.useState(() => /* @__PURE__ */ new Map()), [_e, ve] = r.useState([void 0, void 0]), ye = L((e) => {
1732
- de(e), e !== -1 && pe(e);
1733
- });
1734
- ct(I.inputRef, D, U, void 0, !H, _), zt(U, () => {
1735
- j(re), I.change(U);
1736
- let e = te.initialValue, t;
1737
- t = Array.isArray(U) && Array.isArray(e) ? !Mr(U, e) : U !== e, F(t);
1738
- });
1739
- let be = L((e) => {
1740
- e && (W.current = e);
1741
- }), xe = Array.isArray(U), Se = r.useMemo(() => xe ? U.slice().sort(_i) : [Nr(U, m, p)], [
1742
- p,
1743
- m,
1744
- xe,
1745
- U
1746
- ]), Ce = L((e, t) => {
1747
- if (Number.isNaN(e) || Ti(e, U)) return !1;
1748
- let n = t ?? Lt("none", void 0, void 0, { activeThumbIndex: -1 }), r = n.event, i = new (r.constructor ?? Event)(r.type, r);
1749
- return Object.defineProperty(i, "target", {
1750
- writable: !0,
1751
- value: {
1752
- value: e,
1753
- name: re
1754
- }
1755
- }), n.event = i, k(e, n), n.isCanceled ? !1 : (le.current = n.reason, ie(e), !0);
1756
- }), Y = L((e, t, n) => {
1757
- let r = yi(e, t, m, p, xe, Se);
1758
- if (bi(r, x, h)) {
1759
- let e = wi(n), i = Ce(r, Lt(e, n.nativeEvent, void 0, { activeThumbIndex: t }));
1760
- P(!0), i && A(r, Rt(e, n.nativeEvent));
1761
- }
1762
- });
1763
- process.env.NODE_ENV !== "production" && m >= p && ke("Slider `max` must be greater than `min`."), V(() => {
1764
- let e = xn(Je(ae.current));
1765
- H && Sn(ae.current, e) && e.blur();
1766
- }, [H]), H && q !== -1 && ye(-1);
1767
- let we = r.useMemo(() => ({
1768
- ...M,
1769
- activeThumbIndex: q,
1770
- disabled: H,
1771
- dragging: J,
1772
- orientation: b,
1773
- max: p,
1774
- min: m,
1775
- minStepsBetweenValues: h,
1776
- step: x,
1777
- values: Se
1778
- }), [
1779
- M,
1780
- q,
1781
- H,
1782
- J,
1783
- p,
1784
- m,
1785
- h,
1786
- b,
1787
- x,
1788
- Se
1789
- ]), Te = r.useMemo(() => ({
1790
- active: q,
1791
- controlRef: W,
1792
- disabled: H,
1793
- dragging: J,
1794
- validation: I,
1795
- formatOptionsRef: ue,
1796
- handleInputChange: Y,
1797
- indicatorPosition: _e,
1798
- inset: C !== "center",
1799
- labelId: B,
1800
- rootLabelId: O,
1801
- largeStep: u,
1802
- lastUsedThumbIndex: fe,
1803
- lastChangeReasonRef: le,
1804
- form: g,
1805
- locale: d,
1806
- max: p,
1807
- min: m,
1808
- minStepsBetweenValues: h,
1809
- name: re,
1810
- onValueCommitted: A,
1811
- orientation: b,
1812
- pressedInputRef: se,
1813
- pressedThumbCenterOffsetRef: ce,
1814
- pressedThumbIndexRef: G,
1815
- pressedValuesRef: K,
1816
- registerFieldControlRef: be,
1817
- renderBeforeHydration: C === "edge",
1818
- setActive: ye,
1819
- setDragging: me,
1820
- setIndicatorPosition: ve,
1821
- setLabelId: z,
1822
- setValue: Ce,
1823
- state: we,
1824
- step: x,
1825
- thumbCollisionBehavior: S,
1826
- thumbMap: he,
1827
- thumbRefs: oe,
1828
- values: Se
1829
- }), [
1830
- q,
1831
- W,
1832
- B,
1833
- O,
1834
- H,
1835
- J,
1836
- I,
1837
- ue,
1838
- Y,
1839
- _e,
1840
- u,
1841
- fe,
1842
- le,
1843
- g,
1844
- d,
1845
- p,
1846
- m,
1847
- h,
1848
- re,
1849
- A,
1850
- b,
1851
- se,
1852
- ce,
1853
- G,
1854
- K,
1855
- be,
1856
- ye,
1857
- me,
1858
- ve,
1859
- z,
1860
- Ce,
1861
- we,
1862
- x,
1863
- S,
1864
- C,
1865
- he,
1866
- oe,
1867
- Se
1868
- ]), Ee = Z("div", e, {
1869
- state: we,
1870
- ref: [t, ae],
1871
- props: [
1872
- {
1873
- "aria-labelledby": B,
1874
- id: D,
1875
- role: "group"
1876
- },
1877
- E,
1878
- (e) => I.getValidationProps(H, e)
1879
- ],
1880
- stateAttributesMapping: xi
1881
- });
1882
- return /* @__PURE__ */ o(Si.Provider, {
1883
- value: Te,
1884
- children: /* @__PURE__ */ o(zr, {
1885
- elementsRef: oe,
1886
- onMapChange: ge,
1887
- children: Ee
1888
- })
1889
- });
1890
- });
1891
- process.env.NODE_ENV !== "production" && (Ei.displayName = "SliderRoot");
1892
- //#endregion
1893
- //#region node_modules/@base-ui/react/slider/label/SliderLabel.mjs
1894
- var Di = /* @__PURE__ */ r.forwardRef(function(e, t) {
1895
- let { render: n, className: r, style: i, ...a } = e, o = a;
1896
- delete o.id;
1897
- let { state: s, setLabelId: c, controlRef: l, rootLabelId: u } = Ci();
1898
- function d(e, t) {
1899
- if (t) {
1900
- let n = Je(e.currentTarget).getElementById(t);
1901
- if (h(n)) {
1902
- xr(n);
1903
- return;
1904
- }
1905
- }
1906
- let n = l.current?.querySelectorAll("input[type=\"range\"]"), r = n?.length === 1 ? n[0] : null;
1907
- h(r) && xr(r);
1908
- }
1909
- return Z("div", e, {
1910
- ref: t,
1911
- state: s,
1912
- props: [br({
1913
- id: u,
1914
- setLabelId: c,
1915
- focusControl: d
1916
- }), a],
1917
- stateAttributesMapping: xi
1918
- });
1919
- });
1920
- process.env.NODE_ENV !== "production" && (Di.displayName = "SliderLabel");
1921
- //#endregion
1922
- //#region node_modules/@base-ui/react/utils/stringifyLocale.mjs
1923
- function Oi(e) {
1924
- return Array.isArray(e) ? e.map((e) => Oi(e)).join(",") : e == null ? "" : String(e);
1925
- }
1926
- //#endregion
1927
- //#region node_modules/@base-ui/react/utils/formatNumber.mjs
1928
- var ki = /* @__PURE__ */ new Map();
1929
- function Ai(e, t) {
1930
- let n = JSON.stringify({
1931
- locale: Oi(e),
1932
- options: t
1933
- }), r = ki.get(n);
1934
- if (r) return r;
1935
- let i = new Intl.NumberFormat(e, t);
1936
- return ki.set(n, i), i;
1937
- }
1938
- function ji(e, t, n) {
1939
- return e == null ? "" : Ai(t, n).format(e);
1940
- }
1941
- //#endregion
1942
- //#region node_modules/@base-ui/react/slider/value/SliderValue.mjs
1943
- var Mi = /* @__PURE__ */ r.forwardRef(function(e, t) {
1944
- let { "aria-live": n = "off", render: i, className: a, children: o, style: s, ...c } = e, { thumbMap: l, state: u, values: d, formatOptionsRef: f, locale: p } = Ci(), m = "";
1945
- for (let e of l.values()) e?.inputId && (m += `${e.inputId} `);
1946
- let h = m.trim() === "" ? void 0 : m.trim(), g = r.useMemo(() => {
1947
- let e = [];
1948
- for (let t = 0; t < d.length; t += 1) e.push(ji(d[t], p, f.current ?? void 0));
1949
- return e;
1950
- }, [
1951
- f,
1952
- p,
1953
- d
1954
- ]), _ = d.map((e, t) => g[t] || e).join(" – ");
1955
- return Z("output", e, {
1956
- state: u,
1957
- ref: t,
1958
- props: [{
1959
- "aria-live": n,
1960
- children: typeof o == "function" ? o(g, d) : _,
1961
- htmlFor: h
1962
- }, c],
1963
- stateAttributesMapping: xi
1964
- });
1965
- });
1966
- process.env.NODE_ENV !== "production" && (Mi.displayName = "SliderValue");
1967
- //#endregion
1968
- //#region node_modules/@base-ui/react/slider/utils/getMidpoint.mjs
1969
- function Ni(e) {
1970
- let t = e.getBoundingClientRect();
1971
- return {
1972
- x: (t.left + t.right) / 2,
1973
- y: (t.top + t.bottom) / 2
1974
- };
1975
- }
1976
- //#endregion
1977
- //#region node_modules/@base-ui/react/slider/utils/roundValueToStep.mjs
1978
- function Pi(e) {
1979
- if (e === 0) return 0;
1980
- if (Math.abs(e) < 1) {
1981
- let t = e.toExponential().split("e-"), n = t[0].split(".")[1];
1982
- return (n ? n.length : 0) + parseInt(t[1], 10);
1983
- }
1984
- let t = e.toString().split(".")[1];
1985
- return t ? t.length : 0;
1986
- }
1987
- function Fi(e, t, n) {
1988
- let r = Math.round((e - n) / t) * t + n;
1989
- return Number(r.toFixed(Math.max(Pi(t), Pi(n))));
1990
- }
1991
- //#endregion
1992
- //#region node_modules/@base-ui/react/slider/utils/getPushedThumbValues.mjs
1993
- function Ii({ values: e, index: t, nextValue: n, min: r, max: i, step: a, minStepsBetweenValues: o, initialValues: s }) {
1994
- if (e.length === 0) return [];
1995
- let c = e.slice(), l = a * o, u = c.length - 1, d = s ?? e;
1996
- c[t] = Nr(n, r + t * l, i - (u - t) * l);
1997
- for (let e = t + 1; e <= u; e += 1) {
1998
- let t = c[e - 1] + l, n = i - (u - e) * l, r = d[e] ?? c[e], a = Math.max(c[e], t);
1999
- r < a && (a = Math.max(r, t)), c[e] = Nr(a, t, n);
2000
- }
2001
- for (let e = t - 1; e >= 0; --e) {
2002
- let t = c[e + 1] - l, n = r + e * l, i = d[e] ?? c[e], a = Math.min(c[e], t);
2003
- i > a && (a = Math.min(i, t)), c[e] = Nr(a, n, t);
2004
- }
2005
- for (let e = 0; e <= u; e += 1) c[e] = Number(c[e].toFixed(12));
2006
- return c;
2007
- }
2008
- //#endregion
2009
- //#region node_modules/@base-ui/react/slider/utils/resolveThumbCollision.mjs
2010
- function Li({ behavior: e, values: t, currentValues: n, initialValues: r, pressedIndex: i, nextValue: a, min: o, max: s, step: c, minStepsBetweenValues: l }) {
2011
- let u = n ?? t, d = r ?? t;
2012
- if (!(u.length > 1)) return {
2013
- value: a,
2014
- thumbIndex: 0,
2015
- didSwap: !1
2016
- };
2017
- let f = c * l;
2018
- switch (e) {
2019
- case "swap": {
2020
- let e = u[i], t = 1e-7, n = u.slice(), r = n[i - 1], p = n[i + 1], m = Nr(a, r == null ? o : r + f, p == null ? s : p - f), h = Number(m.toFixed(12));
2021
- n[i] = h;
2022
- let g = a > e, _ = a < e, v = g && p != null && a >= p - t, y = _ && r != null && a <= r + t;
2023
- if (!v && !y) return {
2024
- value: n,
2025
- thumbIndex: i,
2026
- didSwap: !1
2027
- };
2028
- let b = v ? i + 1 : i - 1, x = n.map((e, t) => t === i ? h : d[t] ?? u[t]), S = a;
2029
- S = v ? Math.max(a, n[b]) : Math.min(a, n[b]);
2030
- let C = Ii({
2031
- values: n,
2032
- index: b,
2033
- nextValue: S,
2034
- min: o,
2035
- max: s,
2036
- step: c,
2037
- minStepsBetweenValues: l,
2038
- initialValues: x
2039
- }), w = v ? b - 1 : b + 1;
2040
- if (w >= 0 && w < C.length) {
2041
- let e = C[w - 1], t = C[w + 1], n = e == null ? o : e + f;
2042
- n = Math.max(n, o + w * f);
2043
- let r = t == null ? s : t - f;
2044
- r = Math.min(r, s - (C.length - 1 - w) * f);
2045
- let i = Nr(h, n, r);
2046
- C[w] = Number(i.toFixed(12));
2047
- }
2048
- return {
2049
- value: C,
2050
- thumbIndex: b,
2051
- didSwap: !0
2052
- };
2053
- }
2054
- case "push": return {
2055
- value: Ii({
2056
- values: u,
2057
- index: i,
2058
- nextValue: a,
2059
- min: o,
2060
- max: s,
2061
- step: c,
2062
- minStepsBetweenValues: l
2063
- }),
2064
- thumbIndex: i,
2065
- didSwap: !1
2066
- };
2067
- default: {
2068
- let e = u.slice(), t = e[i - 1], n = e[i + 1], r = Nr(a, t == null ? o : t + f, n == null ? s : n - f);
2069
- return e[i] = Number(r.toFixed(12)), {
2070
- value: e,
2071
- thumbIndex: i,
2072
- didSwap: !1
2073
- };
2074
- }
2075
- }
2076
- }
2077
- //#endregion
2078
- //#region node_modules/@base-ui/react/slider/control/SliderControl.mjs
2079
- var Ri = 2;
2080
- function zi(e, t) {
2081
- if (!e) return {
2082
- start: 0,
2083
- end: 0
2084
- };
2085
- function n(e) {
2086
- let t = e == null ? 0 : parseFloat(e);
2087
- return Number.isNaN(t) ? 0 : t;
2088
- }
2089
- let r = t ? "Top" : "InlineStart", i = t ? "Bottom" : "InlineEnd";
2090
- return {
2091
- start: n(e[`border${r}Width`]) + n(e[`padding${r}`]),
2092
- end: n(e[`border${i}Width`]) + n(e[`padding${i}`])
2093
- };
2094
- }
2095
- function Bi(e, t) {
2096
- if (t.current != null && e.changedTouches) {
2097
- let n = e;
2098
- for (let e = 0; e < n.changedTouches.length; e += 1) {
2099
- let r = n.changedTouches[e];
2100
- if (r.identifier === t.current) return {
2101
- x: r.clientX,
2102
- y: r.clientY
2103
- };
2104
- }
2105
- return null;
2106
- }
2107
- return {
2108
- x: e.clientX,
2109
- y: e.clientY
2110
- };
2111
- }
2112
- var Vi = /* @__PURE__ */ r.forwardRef(function(e, t) {
2113
- let { render: n, className: i, style: a, ...o } = e, { disabled: s, dragging: c, inset: l, lastChangeReasonRef: u, max: f, min: p, minStepsBetweenValues: h, onValueCommitted: g, orientation: _, pressedInputRef: v, pressedThumbCenterOffsetRef: y, pressedThumbIndexRef: b, pressedValuesRef: x, registerFieldControlRef: S, renderBeforeHydration: C, setActive: w, setDragging: T, setValue: E, state: D, step: O, thumbCollisionBehavior: k, thumbRefs: A, values: j } = Ci(), M = Wr(), ee = j.length > 1, N = _ === "vertical", P = r.useRef(null), F = r.useRef(null), te = L((e) => {
2114
- e && F.current == null && (F.current = d(e).getComputedStyle(e));
2115
- }), I = r.useRef(null), R = r.useRef(0), ne = r.useRef(0), z = r.useRef(null), B = Cr(j);
2116
- function V(e) {
2117
- b.current !== e && (b.current = e);
2118
- let t = A.current[e];
2119
- if (!t) {
2120
- y.current = null, v.current = null;
2121
- return;
2122
- }
2123
- v.current = t.querySelector("input[type=\"range\"]");
2124
- }
2125
- function H() {
2126
- b.current = -1, y.current = null, v.current = null;
2127
- }
2128
- function re(e) {
2129
- return m(e) ? A.current.some((t) => !m(t) || !Sn(t, e) ? !1 : t.querySelector("input[type=\"range\"]")?.disabled === !0) : !1;
2130
- }
2131
- function U(e) {
2132
- let t = P.current, n = b.current;
2133
- if (!t || !ee && (n < 0 || n >= j.length)) return null;
2134
- let { width: r, height: i, bottom: a, left: o, right: s } = t.getBoundingClientRect(), c = zi(F.current, N), l = ne.current, u = (N ? i : r) - c.start - c.end - l * 2, d = y.current ?? 0, m = e.x - d, g = e.y - d, _ = Nr(((N ? a - g - c.end : (M === "rtl" ? s - m : m - o) - c.start) - l) / u, 0, 1), v = (f - p) * _ + p;
2135
- return v = Fi(v, O, p), v = Nr(v, p, f), ee ? n < 0 ? null : Li({
2136
- behavior: k,
2137
- values: j,
2138
- currentValues: B.current ?? j,
2139
- initialValues: x.current,
2140
- pressedIndex: n,
2141
- nextValue: v,
2142
- min: p,
2143
- max: f,
2144
- step: O,
2145
- minStepsBetweenValues: h
2146
- }) : {
2147
- value: v,
2148
- thumbIndex: n,
2149
- didSwap: !1
2150
- };
2151
- }
2152
- function ie(e) {
2153
- x.current = ee ? j.slice() : null, z.current = null, B.current = j;
2154
- let t = b.current, n = t;
2155
- if (t > -1 && t < j.length) {
2156
- if (j[t] === f) {
2157
- let e = t;
2158
- for (; e > 0 && j[e - 1] === f;) --e;
2159
- n = e;
2160
- }
2161
- } else {
2162
- let t = N ? "y" : "x", r;
2163
- n = -1;
2164
- for (let i = 0; i < A.current.length; i += 1) {
2165
- let a = A.current[i];
2166
- if (m(a) && !a.querySelector("input[type=\"range\"]")?.disabled) {
2167
- let o = Ni(a), s = Math.abs(e[t] - o[t]);
2168
- (r === void 0 || s <= r) && (n = i, r = s);
2169
- }
2170
- }
2171
- }
2172
- if (n > -1 && n !== t && V(n), l) {
2173
- let e = A.current[n];
2174
- m(e) && (ne.current = e.getBoundingClientRect()[N ? "height" : "width"] / 2);
2175
- }
2176
- }
2177
- function ae(e) {
2178
- let t = A.current?.[e]?.querySelector("input[type=\"range\"]");
2179
- t && t.focus({
2180
- preventScroll: !0,
2181
- focusVisible: !1
2182
- });
2183
- }
2184
- function W(e, t, n) {
2185
- let r = E(e.value, Lt(t, n, void 0, { activeThumbIndex: e.thumbIndex }));
2186
- return r && (z.current = e.value, B.current = Array.isArray(e.value) ? e.value : [e.value], e.didSwap && V(e.thumbIndex)), r;
2187
- }
2188
- let oe = L((e) => {
2189
- let t = Bi(e, I);
2190
- if (t == null) return;
2191
- if (R.current += 1, e.type === "pointermove" && e.buttons === 0) {
2192
- se(e);
2193
- return;
2194
- }
2195
- let n = U(t);
2196
- n != null && bi(n.value, O, h) && (!c && R.current > Ri && T(!0), W(n, "drag", e) && n.didSwap && ae(n.thumbIndex));
2197
- }), se = L((e) => {
2198
- if (w(-1), T(!1), v.current = null, y.current = null, z.current != null) {
2199
- let t = u.current;
2200
- g(z.current, Rt(t, e));
2201
- }
2202
- "pointerType" in e && P.current?.hasPointerCapture(e.pointerId) && P.current?.releasePointerCapture(e.pointerId), b.current = -1, I.current = null, x.current = null, z.current = null, G();
2203
- }), ce = L((e) => {
2204
- if (s) return;
2205
- if (re(Cn(e))) {
2206
- H();
2207
- return;
2208
- }
2209
- let t = e.changedTouches[0];
2210
- t != null && (I.current = t.identifier);
2211
- let n = Bi(e, I);
2212
- if (n != null) {
2213
- ie(n);
2214
- let t = U(n);
2215
- if (t == null) return;
2216
- ae(t.thumbIndex), W(t, "track-press", e) && t.didSwap && ae(t.thumbIndex);
2217
- }
2218
- R.current = 0;
2219
- let r = Je(P.current);
2220
- r.addEventListener("touchmove", oe, { passive: !0 }), r.addEventListener("touchend", se, { passive: !0 });
2221
- }), G = L(() => {
2222
- let e = Je(P.current);
2223
- e.removeEventListener("pointermove", oe), e.removeEventListener("pointerup", se), e.removeEventListener("touchmove", oe), e.removeEventListener("touchend", se), x.current = null, z.current = null;
2224
- }), K = Kt();
2225
- return r.useEffect(() => {
2226
- let e = P.current;
2227
- if (!e) return () => G();
2228
- let t = kr(e, "touchstart", ce, { passive: !0 });
2229
- return () => {
2230
- t(), K.cancel(), G();
2231
- };
2232
- }, [
2233
- G,
2234
- ce,
2235
- P,
2236
- K
2237
- ]), r.useEffect(() => {
2238
- s && G();
2239
- }, [s, G]), Z("div", e, {
2240
- state: D,
2241
- ref: [
2242
- t,
2243
- S,
2244
- P,
2245
- te
2246
- ],
2247
- props: [{
2248
- "data-base-ui-slider-control": C ? "" : void 0,
2249
- onPointerDown(e) {
2250
- let t = P.current, n = Cn(e.nativeEvent);
2251
- if (!t || s || e.defaultPrevented || !m(n) || e.button !== 0) return;
2252
- if (re(n)) {
2253
- H();
2254
- return;
2255
- }
2256
- let r = Bi(e, I);
2257
- if (r != null) {
2258
- ie(r);
2259
- let n = U(r);
2260
- if (n == null) return;
2261
- Sn(A.current[n.thumbIndex], xn(Je(t))) ? e.preventDefault() : K.request(() => {
2262
- ae(n.thumbIndex);
2263
- }), T(!0), y.current == null && W(n, "track-press", e.nativeEvent) && n.didSwap && ae(n.thumbIndex);
2264
- }
2265
- e.nativeEvent.pointerId && t.setPointerCapture(e.nativeEvent.pointerId), R.current = 0;
2266
- let i = Je(P.current);
2267
- i.addEventListener("pointermove", oe, { passive: !0 }), i.addEventListener("pointerup", se, { once: !0 });
2268
- }
2269
- }, o],
2270
- stateAttributesMapping: xi
2271
- });
2272
- });
2273
- process.env.NODE_ENV !== "production" && (Vi.displayName = "SliderControl");
2274
- //#endregion
2275
- //#region node_modules/@base-ui/react/slider/track/SliderTrack.mjs
2276
- var Hi = /* @__PURE__ */ r.forwardRef(function(e, t) {
2277
- let { render: n, className: r, style: i, ...a } = e, { state: o } = Ci();
2278
- return Z("div", e, {
2279
- state: o,
2280
- ref: t,
2281
- props: [{ style: { position: "relative" } }, a],
2282
- stateAttributesMapping: xi
2283
- });
2284
- });
2285
- process.env.NODE_ENV !== "production" && (Hi.displayName = "SliderTrack");
2286
- //#endregion
2287
- //#region node_modules/@base-ui/react/utils/useIsHydrating.mjs
2288
- function Ui() {
2289
- return X;
2290
- }
2291
- function Wi() {
2292
- return !1;
2293
- }
2294
- function Gi() {
2295
- return !0;
2296
- }
2297
- function Ki() {
2298
- return (0, Ar.useSyncExternalStore)(Ui, Wi, Gi);
2299
- }
2300
- //#endregion
2301
- //#region node_modules/@base-ui/react/utils/valueToPercent.mjs
2302
- function qi(e, t, n) {
2303
- return (e - t) * 100 / (n - t);
2304
- }
2305
- //#endregion
2306
- //#region node_modules/@base-ui/react/slider/thumb/SliderThumbDataAttributes.mjs
2307
- var Ji = /* @__PURE__ */ function(e) {
2308
- return e.index = "data-index", e.dragging = "data-dragging", e.orientation = "data-orientation", e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.focused = "data-focused", e;
2309
- }({}), Yi = new Set([
2310
- ...ai,
2311
- Qr,
2312
- $r
2313
- ]);
2314
- function Xi(e, t, n, r) {
2315
- if (!(t < 0)) return e.length === 2 ? t === 0 ? `${ji(e[t], r, n)} start range` : `${ji(e[t], r, n)} end range` : n ? ji(e[t], r, n) : void 0;
2316
- }
2317
- function Zi(e, t, n, r, i) {
2318
- let a = n === 1 ? e + t : e - t;
2319
- return Nr(Number(a.toFixed(Math.max(Pi(e), Pi(t), Pi(r)))), r, i);
2320
- }
2321
- var Qi = /* @__PURE__ */ r.forwardRef(function(e, t) {
2322
- let { render: n, children: i, className: a, "aria-describedby": c, "aria-label": l, "aria-labelledby": u, "aria-valuetext": f, disabled: p = !1, getAriaLabel: m, getAriaValueText: h, id: g, index: _, inputRef: v, onBlur: y, onFocus: b, onKeyDown: x, tabIndex: S, style: C, ...w } = e, { nonce: T } = mi(), E = it(g), { active: D, lastUsedThumbIndex: O, controlRef: k, disabled: A, validation: j, formatOptionsRef: M, handleInputChange: ee, inset: N, labelId: P, largeStep: F, locale: te, max: I, min: R, minStepsBetweenValues: ne, form: z, name: B, orientation: H, pressedInputRef: re, pressedThumbCenterOffsetRef: ie, pressedThumbIndexRef: ae, renderBeforeHydration: W, setActive: oe, setIndicatorPosition: se, state: ce, step: G, values: K } = Ci(), le = Wr(), ue = p || A, q = K.length > 1, de = H === "vertical", fe = le === "rtl", { setTouched: pe, setFocused: J, validationMode: me } = st(), he = r.useRef(null), ge = r.useRef(null), _e = r.useRef(!1), ve = it(), ye = tn(), xe = q ? ve : ye, { ref: Se, index: Ce } = gi({ metadata: r.useMemo(() => ({ inputId: xe }), [xe]) }), Y = q ? _ ?? Ce : 0, we = Y === K.length - 1, Te = K[Y], Ee = qi(Te, R, I), [De, Oe] = r.useState(), ke = Ki(), X = O >= 0 && O < K.length ? O : -1, Ae = L(() => {
2323
- let e = k.current, t = he.current;
2324
- if (!e || !t) return;
2325
- let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = de ? "height" : "width", a = r[i] - n[i], o = (n[i] / 2 + a * Ee / 100) / r[i] * 100, s = Number.isFinite(o) ? o : void 0;
2326
- Oe(s), Y === 0 ? se((e) => [s, e[1]]) : we && se((e) => [e[0], s]);
2327
- });
2328
- V(() => {
2329
- N && queueMicrotask(Ae);
2330
- }, [Ae, N]), V(() => {
2331
- N && Ae();
2332
- }, [
2333
- Ae,
2334
- N,
2335
- Ee
2336
- ]), V(() => {
2337
- if (!N) return;
2338
- let e = k.current, t = he.current;
2339
- if (!e || !t) return;
2340
- let n = d(e).ResizeObserver;
2341
- if (typeof n != "function") return;
2342
- let r = new n(Ae);
2343
- return r.observe(e), r.observe(t), () => {
2344
- r.disconnect();
2345
- };
2346
- }, [
2347
- k,
2348
- Ae,
2349
- N
2350
- ]);
2351
- let je = de ? "bottom" : "insetInlineStart", Me = de ? "left" : "top", Ne;
2352
- q ? D === Y ? Ne = 2 : X === Y && (Ne = 1) : D === Y && (Ne = 1);
2353
- let Pe;
2354
- Pe = N ? {
2355
- "--position": `${De ?? 0}%`,
2356
- visibility: W && ke || De === void 0 ? "hidden" : void 0,
2357
- position: "absolute",
2358
- [je]: "var(--position)",
2359
- [Me]: "50%",
2360
- translate: `${(de || !fe ? -1 : 1) * 50}% ${(de ? 1 : -1) * 50}%`,
2361
- zIndex: Ne
2362
- } : Number.isFinite(Ee) ? {
2363
- position: "absolute",
2364
- [je]: `${Ee}%`,
2365
- [Me]: "50%",
2366
- translate: `${(de || !fe ? -1 : 1) * 50}% ${(de ? 1 : -1) * 50}%`,
2367
- zIndex: Ne
2368
- } : Ke;
2369
- let Fe;
2370
- H === "vertical" && (Fe = fe ? "vertical-rl" : "vertical-lr");
2371
- let Ie = typeof m == "function" ? m(Y) : l, Le = U({
2372
- "aria-label": Ie,
2373
- "aria-labelledby": u ?? (Ie == null ? P : void 0),
2374
- "aria-describedby": c,
2375
- "aria-orientation": H,
2376
- "aria-valuenow": Te,
2377
- "aria-valuetext": typeof h == "function" ? h(ji(Te, te, M.current ?? void 0), Te, Y) : f ?? Xi(K, Y, M.current ?? void 0, te),
2378
- disabled: ue,
2379
- form: z,
2380
- id: xe,
2381
- max: I,
2382
- min: R,
2383
- name: B,
2384
- onChange(e) {
2385
- ee(e.currentTarget.valueAsNumber, Y, e);
2386
- },
2387
- onFocus(e) {
2388
- let t = _e.current;
2389
- _e.current = !1, oe(Y), J(!0), t && e.stopPropagation();
2390
- },
2391
- onBlur(e) {
2392
- if (_e.current) {
2393
- e.stopPropagation();
2394
- return;
2395
- }
2396
- he.current && (oe(-1), pe(!0), J(!1), me === "onBlur" && j.commit(yi(Te, Y, R, I, q, K)));
2397
- },
2398
- onKeyDown(e) {
2399
- if (e.defaultPrevented || !Yi.has(e.key)) return;
2400
- ai.has(e.key) && e.stopPropagation();
2401
- let t = null, n = Fi(Te, G, R);
2402
- switch (e.key) {
2403
- case qr:
2404
- t = Zi(n, e.shiftKey ? F : G, 1, R, I);
2405
- break;
2406
- case Xr:
2407
- t = Zi(n, e.shiftKey ? F : G, fe ? -1 : 1, R, I);
2408
- break;
2409
- case Jr:
2410
- t = Zi(n, e.shiftKey ? F : G, -1, R, I);
2411
- break;
2412
- case Yr:
2413
- t = Zi(n, e.shiftKey ? F : G, fe ? 1 : -1, R, I);
2414
- break;
2415
- case Qr:
2416
- t = Zi(n, F, 1, R, I);
2417
- break;
2418
- case $r:
2419
- t = Zi(n, F, -1, R, I);
2420
- break;
2421
- case "End":
2422
- t = I, q && (t = Number.isFinite(K[Y + 1]) ? K[Y + 1] - G * ne : I);
2423
- break;
2424
- case Zr:
2425
- t = R, q && (t = Number.isFinite(K[Y - 1]) ? K[Y - 1] + G * ne : R);
2426
- break;
2427
- default: break;
2428
- }
2429
- if (t !== null) {
2430
- let n = e.currentTarget;
2431
- An(n) || (_e.current = !0, n.blur(), n.focus({
2432
- preventScroll: !0,
2433
- focusVisible: !0
2434
- })), ee(t, Y, e), e.preventDefault();
2435
- }
2436
- },
2437
- step: G,
2438
- style: {
2439
- ...Ke,
2440
- width: "100%",
2441
- height: "100%",
2442
- writingMode: Fe
2443
- },
2444
- tabIndex: S ?? void 0,
2445
- type: "range",
2446
- value: Te ?? ""
2447
- }, (e) => j.getValidationProps(ue, e), { onKeyDown: x }), Re = be(ge, j.inputRef, v);
2448
- return Z("div", e, {
2449
- state: ce,
2450
- ref: [
2451
- t,
2452
- Se,
2453
- he
2454
- ],
2455
- props: [{
2456
- [Ji.index]: Y,
2457
- children: /* @__PURE__ */ s(r.Fragment, { children: [
2458
- i,
2459
- /* @__PURE__ */ o("input", {
2460
- ref: Re,
2461
- ...Le,
2462
- suppressHydrationWarning: !0
2463
- }),
2464
- N && ke && W && we && /* @__PURE__ */ o("script", {
2465
- nonce: T,
2466
- dangerouslySetInnerHTML: { __html: "!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest(\"[data-base-ui-slider-control]\");if(!e)return;const r=e.querySelector(\"[data-base-ui-slider-indicator]\"),i=e.getBoundingClientRect(),n=\"vertical\"===e.getAttribute(\"data-orientation\")?\"height\":\"width\",o=e.querySelectorAll('input[type=\"range\"]'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute(\"value\")??\"\");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute(\"max\")??\"100\"),g=parseFloat(e.getAttribute(\"min\")??\"0\"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty(\"--position\",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty(\"visibility\"),r&&(0===t?(a=v,r.style.setProperty(\"--start-position\",`${v}%`),l||r.style.removeProperty(\"visibility\")):t===s&&(u=v-(a??0),r.style.setProperty(\"--end-position\",`${v}%`),r.style.setProperty(\"--relative-size\",`${u}%`),r.style.removeProperty(\"visibility\"))))}}();" },
2467
- suppressHydrationWarning: !0
2468
- })
2469
- ] }),
2470
- id: E,
2471
- onBlur: y,
2472
- onFocus: b,
2473
- onPointerDown(e) {
2474
- if (!ue) {
2475
- if (ae.current = Y, he.current != null) {
2476
- let t = H === "horizontal" ? "x" : "y", n = Ni(he.current);
2477
- ie.current = (H === "horizontal" ? e.clientX : e.clientY) - n[t];
2478
- }
2479
- ge.current != null && re.current !== ge.current && (re.current = ge.current);
2480
- }
2481
- },
2482
- style: Pe,
2483
- suppressHydrationWarning: W || void 0
2484
- }, w],
2485
- stateAttributesMapping: xi
2486
- });
2487
- });
2488
- process.env.NODE_ENV !== "production" && (Qi.displayName = "SliderThumb");
2489
- //#endregion
2490
- //#region node_modules/@base-ui/react/slider/indicator/SliderIndicator.mjs
2491
- function $i(e, t, n, r, i, a) {
2492
- let o = n === void 0 || t && r === void 0 ? "hidden" : void 0, s = e ? "bottom" : "insetInlineStart", c = e ? "height" : "width", l = {
2493
- visibility: i && a ? "hidden" : o,
2494
- position: e ? "absolute" : "relative",
2495
- [e ? "width" : "height"]: "inherit"
2496
- };
2497
- return l["--start-position"] = `${n ?? 0}%`, t ? (l["--relative-size"] = `${(r ?? 0) - (n ?? 0)}%`, l[s] = "var(--start-position)", l[c] = "var(--relative-size)", l) : (l[s] = 0, l[c] = "var(--start-position)", l);
2498
- }
2499
- function ea(e, t, n, r) {
2500
- let i = e ? "bottom" : "insetInlineStart", a = e ? "height" : "width", o = {
2501
- position: e ? "absolute" : "relative",
2502
- [e ? "width" : "height"]: "inherit"
2503
- };
2504
- if (!t) return o[i] = 0, o[a] = `${n}%`, o;
2505
- let s = r - n;
2506
- return o[i] = `${n}%`, o[a] = `${s}%`, o;
2507
- }
2508
- var ta = /* @__PURE__ */ r.forwardRef(function(e, t) {
2509
- let { render: n, className: r, style: i, ...a } = e, { indicatorPosition: o, inset: s, max: c, min: l, orientation: u, renderBeforeHydration: d, state: f, values: p } = Ci(), m = Ki(), h = u === "vertical", g = p.length > 1, _ = s ? $i(h, g, o[0], o[1], d, m) : ea(h, g, qi(p[0], l, c), qi(p[p.length - 1], l, c));
2510
- return Z("div", e, {
2511
- state: f,
2512
- ref: t,
2513
- props: [{
2514
- "data-base-ui-slider-indicator": d ? "" : void 0,
2515
- style: _,
2516
- suppressHydrationWarning: d || void 0
2517
- }, a],
2518
- stateAttributesMapping: xi
2519
- });
2520
- });
2521
- process.env.NODE_ENV !== "production" && (ta.displayName = "SliderIndicator");
2522
- var na = {
2523
- control: "imf-ui-slider-module-control",
2524
- indicator: "imf-ui-slider-module-indicator",
2525
- label: "imf-ui-slider-module-label",
2526
- root: "imf-ui-slider-module-root",
2527
- thumb: "imf-ui-slider-module-thumb",
2528
- track: "imf-ui-slider-module-track",
2529
- value: "imf-ui-slider-module-value"
2530
- }, ra = /* @__PURE__ */ e({
2531
- Control: () => ma,
2532
- Indicator: () => ga,
2533
- Label: () => fa,
2534
- Root: () => da,
2535
- Thumb: () => _a,
2536
- Track: () => ha,
2537
- Value: () => pa
2538
- }), ia = n(na.root), aa = n(na.label), oa = n(na.value), sa = n(na.control), ca = n(na.track), la = n(na.indicator), ua = n(na.thumb);
2539
- function da({ value: e, defaultValue: t, onValueChange: n, onValueCommitted: r, min: i = 0, max: a = 100, step: s = 1, largeStep: c = 10, minStepsBetweenValues: l = 0, disabled: u = !1, orientation: d = "horizontal", name: f, form: p, locale: m, thumbAlignment: h = "edge", thumbCollisionBehavior: g = "push", format: _, className: v, ...y }) {
2540
- return /* @__PURE__ */ o(Ei, {
2541
- ...y,
2542
- "data-imf-ui-component": "Slider.Root",
2543
- "data-orientation": d,
2544
- className: (e) => ia({ className: typeof v == "function" ? v(e) : v }),
2545
- value: e,
2546
- defaultValue: t,
2547
- onValueChange: n,
2548
- onValueCommitted: r,
2549
- min: i,
2550
- max: a,
2551
- step: s,
2552
- largeStep: c,
2553
- minStepsBetweenValues: l,
2554
- disabled: u,
2555
- orientation: d,
2556
- name: f,
2557
- form: p,
2558
- locale: m,
2559
- thumbAlignment: h,
2560
- thumbCollisionBehavior: g,
2561
- format: _,
2562
- children: y.children
2563
- });
2564
- }
2565
- da.displayName = "Slider.Root";
2566
- function fa({ className: e, ...t }) {
2567
- return /* @__PURE__ */ o(Di, {
2568
- ...t,
2569
- "data-imf-ui-component": "Slider.Label",
2570
- className: (t) => aa({ className: typeof e == "function" ? e(t) : e }),
2571
- children: t.children
2572
- });
2573
- }
2574
- fa.displayName = "Slider.Label";
2575
- function pa({ className: e, children: t, ...n }) {
2576
- return /* @__PURE__ */ o(Mi, {
2577
- ...n,
2578
- "data-imf-ui-component": "Slider.Value",
2579
- className: (t) => oa({ className: typeof e == "function" ? e(t) : e }),
2580
- children: t
2581
- });
2582
- }
2583
- pa.displayName = "Slider.Value";
2584
- function ma({ className: e, ...t }) {
2585
- return /* @__PURE__ */ o(Vi, {
2586
- ...t,
2587
- "data-imf-ui-component": "Slider.Control",
2588
- className: (t) => sa({ className: typeof e == "function" ? e(t) : e }),
2589
- children: t.children
2590
- });
2591
- }
2592
- ma.displayName = "Slider.Control";
2593
- function ha({ className: e, ...t }) {
2594
- return /* @__PURE__ */ o(Hi, {
2595
- ...t,
2596
- "data-imf-ui-component": "Slider.Track",
2597
- className: (t) => ca({ className: typeof e == "function" ? e(t) : e }),
2598
- children: t.children
2599
- });
2600
- }
2601
- ha.displayName = "Slider.Track";
2602
- function ga({ className: e, ...t }) {
2603
- return /* @__PURE__ */ o(ta, {
2604
- ...t,
2605
- "data-imf-ui-component": "Slider.Indicator",
2606
- className: (t) => la({ className: typeof e == "function" ? e(t) : e })
2607
- });
2608
- }
2609
- ga.displayName = "Slider.Indicator";
2610
- function _a({ index: e, className: t, ...n }) {
2611
- return /* @__PURE__ */ o(Qi, {
2612
- ...n,
2613
- "data-imf-ui-component": "Slider.Thumb",
2614
- className: (e) => ua({ className: typeof t == "function" ? t(e) : t }),
2615
- index: e
2616
- });
2617
- }
2618
- _a.displayName = "Slider.Thumb";
2619
- //#endregion
2620
- //#region node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs
2621
- var va = /* @__PURE__ */ r.createContext(void 0);
2622
- process.env.NODE_ENV !== "production" && (va.displayName = "SwitchRootContext");
2623
- function ya() {
2624
- let e = r.useContext(va);
2625
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? J(63) : "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.");
2626
- return e;
2627
- }
2628
- //#endregion
2629
- //#region node_modules/@base-ui/react/switch/root/SwitchRootDataAttributes.mjs
2630
- var ba = /* @__PURE__ */ function(e) {
2631
- return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
2632
- }({}), xa = {
2633
- ...$e,
2634
- checked(e) {
2635
- return e ? { [ba.checked]: "" } : { [ba.unchecked]: "" };
2636
- }
2637
- }, Sa = /* @__PURE__ */ r.forwardRef(function(e, t) {
2638
- let { checked: n, className: i, defaultChecked: a, "aria-labelledby": c, form: l, id: u, inputRef: f, name: p, nativeButton: m = !1, onCheckedChange: h, readOnly: g = !1, required: _ = !1, disabled: v = !1, render: y, uncheckedValue: b, value: x, style: S, ...C } = e, { clearErrors: w } = ut(), { state: T, setTouched: E, setDirty: D, validityData: O, setFilled: k, setFocused: A, validationMode: j, disabled: M, name: ee, validation: N } = st(), { labelId: P } = ft(), F = M || v, te = ee ?? p, I = r.useRef(null), L = be(I, f, N.inputRef), R = r.useRef(null), ne = it(), z = tn({
2639
- id: u,
2640
- implicit: !1,
2641
- controlRef: R
2642
- }), B = m ? void 0 : z, [H, re] = Ue({
2643
- controlled: n,
2644
- default: !!a,
2645
- name: "Switch",
2646
- state: "checked"
2647
- });
2648
- ct(R, ne, H, void 0, !F, p), V(() => {
2649
- I.current && k(I.current.checked);
2650
- }, [I, k]), zt(H, () => {
2651
- w(te), D(H !== O.initialValue), k(H), N.change(H);
2652
- });
2653
- let { getButtonProps: ie, buttonRef: ae } = _e({
2654
- disabled: F,
2655
- native: m
2656
- }), W = pt(c, P, I, !m, B), oe = {
2657
- id: m ? z : ne,
2658
- role: "switch",
2659
- "aria-checked": H,
2660
- "aria-readonly": g || void 0,
2661
- "aria-required": _ || void 0,
2662
- "aria-labelledby": W,
2663
- onFocus() {
2664
- F || A(!0);
2665
- },
2666
- onBlur() {
2667
- let e = I.current;
2668
- !e || F || (E(!0), A(!1), j === "onBlur" && N.commit(e.checked));
2669
- },
2670
- onClick(e) {
2671
- if (g || F) return;
2672
- e.preventDefault();
2673
- let t = I.current;
2674
- t && t.dispatchEvent(new (d(t)).PointerEvent("click", {
2675
- bubbles: !0,
2676
- shiftKey: e.shiftKey,
2677
- ctrlKey: e.ctrlKey,
2678
- altKey: e.altKey,
2679
- metaKey: e.metaKey
2680
- }));
2681
- }
2682
- }, se = U({
2683
- checked: H,
2684
- disabled: F,
2685
- form: l,
2686
- id: B,
2687
- name: te,
2688
- required: _,
2689
- style: te ? qe : Ke,
2690
- tabIndex: -1,
2691
- type: "checkbox",
2692
- "aria-hidden": !0,
2693
- ref: L,
2694
- onChange(e) {
2695
- if (e.nativeEvent.defaultPrevented) return;
2696
- if (g) {
2697
- e.preventDefault();
2698
- return;
2699
- }
2700
- let t = e.currentTarget.checked, n = Lt(gt, e.nativeEvent);
2701
- h?.(t, n), !n.isCanceled && re(t);
2702
- },
2703
- onFocus() {
2704
- R.current?.focus();
2705
- }
2706
- }, (e) => N.getValidationProps(F, e), x === void 0 ? je : { value: x }), ce = r.useMemo(() => ({
2707
- ...T,
2708
- checked: H,
2709
- disabled: F,
2710
- readOnly: g,
2711
- required: _
2712
- }), [
2713
- T,
2714
- H,
2715
- F,
2716
- g,
2717
- _
2718
- ]), G = Z("span", e, {
2719
- state: ce,
2720
- ref: [
2721
- t,
2722
- R,
2723
- ae
2724
- ],
2725
- props: [
2726
- oe,
2727
- C,
2728
- ie,
2729
- (e) => N.getValidationProps(F, e)
2730
- ],
2731
- stateAttributesMapping: xa
2732
- });
2733
- return /* @__PURE__ */ s(va.Provider, {
2734
- value: ce,
2735
- children: [
2736
- G,
2737
- !H && te && b !== void 0 && /* @__PURE__ */ o("input", {
2738
- type: "hidden",
2739
- form: l,
2740
- name: te,
2741
- value: b,
2742
- disabled: F
2743
- }),
2744
- /* @__PURE__ */ o("input", {
2745
- ...se,
2746
- suppressHydrationWarning: !0
2747
- })
2748
- ]
2749
- });
2750
- });
2751
- process.env.NODE_ENV !== "production" && (Sa.displayName = "SwitchRoot");
2752
- //#endregion
2753
- //#region node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs
2754
- var Ca = /* @__PURE__ */ r.forwardRef(function(e, t) {
2755
- let { render: n, className: r, style: i, ...a } = e;
2756
- return Z("span", e, {
2757
- state: ya(),
2758
- ref: t,
2759
- stateAttributesMapping: xa,
2760
- props: a
2761
- });
2762
- });
2763
- process.env.NODE_ENV !== "production" && (Ca.displayName = "SwitchThumb");
2764
- var wa = {
2765
- root: "imf-ui-switch-module-root",
2766
- thumb: "imf-ui-switch-module-thumb"
2767
- }, Ta = /* @__PURE__ */ e({
2768
- Root: () => Oa,
2769
- Thumb: () => ka
2770
- }), Ea = n(wa.root), Da = n(wa.thumb);
2771
- function Oa({ className: e, ...t }) {
2772
- return /* @__PURE__ */ o(Sa, {
2773
- ...t,
2774
- "data-imf-ui-component": "Switch.Root",
2775
- className: (t) => Ea({ className: typeof e == "function" ? e(t) : e }),
2776
- children: t.children
2777
- });
2778
- }
2779
- Oa.displayName = "Switch.Root";
2780
- function ka({ className: e, ...t }) {
2781
- return /* @__PURE__ */ o(Ca, {
2782
- ...t,
2783
- "data-imf-ui-component": "Switch.Thumb",
2784
- className: (t) => Da({ className: typeof e == "function" ? e(t) : e })
2785
- });
2786
- }
2787
- ka.displayName = "Switch.Thumb";
2788
- //#endregion
2789
- //#region node_modules/@base-ui/react/toggle-group/ToggleGroupContext.mjs
2790
- var Aa = /* @__PURE__ */ r.createContext(void 0);
2791
- process.env.NODE_ENV !== "production" && (Aa.displayName = "ToggleGroupContext");
2792
- function ja(e = !0) {
2793
- let t = r.useContext(Aa);
2794
- if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? J(7) : "Base UI: ToggleGroupContext is missing. ToggleGroup parts must be placed within <ToggleGroup>.");
2795
- return t;
2796
- }
2797
- //#endregion
2798
- //#region node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
2799
- function Ma(e = {}) {
2800
- let { highlightItemOnHover: t, highlightedIndex: n, onHighlightedIndexChange: i } = he(), { ref: a, index: o } = gi(e), s = n === o, c = r.useRef(null), l = be(a, c);
2801
- return {
2802
- compositeProps: {
2803
- tabIndex: s ? 0 : -1,
2804
- onFocus() {
2805
- i(o);
2806
- },
2807
- onMouseMove() {
2808
- let e = c.current;
2809
- if (!t || !e) return;
2810
- let n = e.hasAttribute("disabled") || e.ariaDisabled === "true";
2811
- !s && !n && e.focus();
2812
- }
2813
- },
2814
- compositeRef: l,
2815
- index: o
2816
- };
2817
- }
2818
- //#endregion
2819
- //#region node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
2820
- function Na(e) {
2821
- let { render: t, className: n, style: r, state: i = je, props: a = Ae, refs: o = Ae, metadata: s, stateAttributesMapping: c, tag: l = "div", ...u } = e, { compositeProps: d, compositeRef: f } = Ma({ metadata: s });
2822
- return Z(l, e, {
2823
- state: i,
2824
- ref: [...o, f],
2825
- props: [
2826
- d,
2827
- ...a,
2828
- u
2829
- ],
2830
- stateAttributesMapping: c
2831
- });
2832
- }
2833
- //#endregion
2834
- //#region node_modules/@base-ui/react/toggle/Toggle.mjs
2835
- var Pa = /* @__PURE__ */ r.forwardRef(function(e, t) {
2836
- let { className: n, defaultPressed: i = !1, disabled: a = !1, form: s, onPressedChange: c, pressed: l, render: u, type: d, value: f, nativeButton: p = !0, style: m, ...h } = e, g = it(f || void 0), _ = ja(), v = _?.value ?? [], y = _ ? void 0 : i, b = (a || _?.disabled) ?? !1;
2837
- process.env.NODE_ENV !== "production" && V(() => {
2838
- _ && f === void 0 && _.isValueInitialized && B("A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.", "This will cause issues between the Toggle Group and Toggle values.", "Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.");
2839
- }, [
2840
- _,
2841
- f,
2842
- _?.isValueInitialized
2843
- ]);
2844
- let [x, S] = Ue({
2845
- controlled: _ ? g !== void 0 && v.indexOf(g) > -1 : l,
2846
- default: y,
2847
- name: "Toggle",
2848
- state: "pressed"
2849
- }), { getButtonProps: C, buttonRef: w } = _e({
2850
- disabled: b,
2851
- native: p
2852
- }), T = {
2853
- disabled: b,
2854
- pressed: x
2855
- }, E = [w, t], D = [
2856
- {
2857
- "aria-pressed": x,
2858
- onClick(e) {
2859
- let t = !x, n = Lt(gt, e.nativeEvent);
2860
- c?.(t, n), !n.isCanceled && (g && _?.setGroupValue?.(g, t, n), !n.isCanceled && S(t));
2861
- }
2862
- },
2863
- h,
2864
- C
2865
- ], O = Z("button", e, {
2866
- enabled: !_,
2867
- state: T,
2868
- ref: E,
2869
- props: D
2870
- }), k = r.useMemo(() => ({
2871
- disabled: b,
2872
- focusableWhenDisabled: !1
2873
- }), [b]);
2874
- return _ ? /* @__PURE__ */ o(Na, {
2875
- tag: "button",
2876
- render: u,
2877
- className: n,
2878
- style: m,
2879
- metadata: k,
2880
- state: T,
2881
- refs: E,
2882
- props: D
2883
- }) : O;
2884
- });
2885
- process.env.NODE_ENV !== "production" && (Pa.displayName = "Toggle");
2886
- //#endregion
2887
- //#region src/components/toggle/toggle.tsx
2888
- var Fa = n({ root: "imf-ui-toggle-module-root" }.root), Ia = 2;
2889
- function La(e) {
2890
- let t = 0;
2891
- return i.forEach(e, (e) => {
2892
- typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += Ia);
2893
- }), t;
2894
- }
2895
- function Ra({ className: e, style: t, children: n, ...r }) {
2896
- let i = {
2897
- "--glyph-count": La(n),
2898
- "--max-glyphs": Ia
2899
- };
2900
- return /* @__PURE__ */ o(Pa, {
2901
- ...r,
2902
- "data-imf-ui-component": "Toggle",
2903
- style: (e) => ({
2904
- ...i,
2905
- ...typeof t == "function" ? t(e) : t
2906
- }),
2907
- className: (t) => Fa({ className: typeof e == "function" ? e(t) : e }),
2908
- children: n
2909
- });
2910
- }
2911
- //#endregion
2912
- //#region node_modules/@base-ui/react/internals/composite/constants.mjs
2913
- var za = "data-composite-item-active", Ba = [];
2914
- function Va(e) {
2915
- let { loopFocus: t = !0, orientation: n = "both", grid: i, onLoop: a, direction: o, highlightedIndex: s, onHighlightedIndexChange: c, rootRef: l, enableHomeAndEndKeys: u = !1, stopEventPropagation: d = !1, disabledIndices: f, modifierKeys: p = Ba } = e, [m, h] = r.useState(0), g = i != null, _ = r.useRef(null), v = be(_, l), y = r.useRef([]), b = r.useRef(!1), x = s ?? m, S = L((e, t = !1) => {
2916
- if ((c ?? h)(e), t) {
2917
- let t = y.current[e];
2918
- li(_.current, t, o, n);
2919
- }
2920
- }), C = L((e) => {
2921
- if (e.size === 0 || b.current) return;
2922
- b.current = !0;
2923
- let t = Array.from(e.keys()), r = t.find((e) => e?.hasAttribute("data-composite-item-active")) ?? null, i = r ? t.indexOf(r) : -1;
2924
- if (i !== -1) S(i);
2925
- else if (gr(t, x, f)) {
2926
- let e = hr(t, { disabledIndices: f });
2927
- fr(t, e) || S(e);
2928
- }
2929
- li(_.current, r, o, n);
2930
- });
2931
- V(() => {
2932
- if (f == null || s != null || !b.current) return;
2933
- let e = y.current;
2934
- if (gr(e, x, f)) {
2935
- let t = hr(e, { disabledIndices: f });
2936
- fr(e, t) || S(t);
2937
- }
2938
- }, [
2939
- f,
2940
- s,
2941
- x,
2942
- y,
2943
- S
2944
- ]);
2945
- let w = L((e, t, n) => a ? a(e, t, n, y) : n), T = L((e) => {
2946
- let r = u ? ai : ii;
2947
- if (!r.has(e.key) || Ha(e, p) || !_.current) return;
2948
- let s = o === "rtl", c = s ? Yr : Xr, l = {
2949
- horizontal: c,
2950
- vertical: Jr,
2951
- both: c
2952
- }[n], m = s ? Xr : Yr, h = {
2953
- horizontal: m,
2954
- vertical: qr,
2955
- both: m
2956
- }[n], v = Cn(e.nativeEvent);
2957
- if (v != null && ci(v) && !Sr(v)) {
2958
- let t = v.selectionStart, n = v.selectionEnd, r = v.value ?? "";
2959
- if (t == null || e.shiftKey || t !== n || e.key !== h && t < r.length || e.key !== l && t > 0) return;
2960
- }
2961
- let b = x, C = pr(y, f), T = mr(y, f);
2962
- i != null && (b = i({
2963
- disabledIndices: f,
2964
- elementsRef: y,
2965
- event: e,
2966
- highlightedIndex: x,
2967
- loopFocus: t,
2968
- maxIndex: T,
2969
- minIndex: C,
2970
- onLoop: w,
2971
- orientation: n,
2972
- rtl: s
2973
- }));
2974
- let E = {
2975
- horizontal: [c],
2976
- vertical: [Jr],
2977
- both: [c, Jr]
2978
- }[n], D = {
2979
- horizontal: [m],
2980
- vertical: [qr],
2981
- both: [m, qr]
2982
- }[n], O = g ? r : {
2983
- horizontal: u ? ti : ei,
2984
- vertical: u ? ri : ni,
2985
- both: r
2986
- }[n];
2987
- u && (e.key === "Home" ? b = C : e.key === "End" && (b = T)), b === x && (E.includes(e.key) || D.includes(e.key)) && (t && b === T && E.includes(e.key) ? (b = C, a && (b = a(e, x, b, y))) : t && b === C && D.includes(e.key) ? (b = T, a && (b = a(e, x, b, y))) : b = hr(y.current, {
2988
- startingIndex: b,
2989
- decrement: D.includes(e.key),
2990
- disabledIndices: f
2991
- })), b !== x && !fr(y.current, b) && (d && e.stopPropagation(), O.has(e.key) && e.preventDefault(), S(b, !0), queueMicrotask(() => {
2992
- y.current[b]?.focus();
2993
- }));
2994
- });
2995
- return {
2996
- props: {
2997
- ref: v,
2998
- onFocus(e) {
2999
- let t = _.current, n = Cn(e.nativeEvent);
3000
- !t || n == null || !ci(n) || n.setSelectionRange(0, n.value.length ?? 0);
3001
- },
3002
- onKeyDown: T
3003
- },
3004
- highlightedIndex: x,
3005
- onHighlightedIndexChange: S,
3006
- elementsRef: y,
3007
- disabledIndices: f,
3008
- onMapChange: C,
3009
- relayKeyboardEvent: T
3010
- };
3011
- }
3012
- function Ha(e, t) {
3013
- for (let n of oi.values()) if (!t.includes(n) && e.getModifierState(n)) return !0;
3014
- return !1;
3015
- }
3016
- //#endregion
3017
- //#region node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
3018
- function Ua(e) {
3019
- let { render: t, className: n, style: i, refs: a = Ae, props: s = Ae, state: c = je, stateAttributesMapping: l, highlightedIndex: u, onHighlightedIndexChange: d, orientation: f, grid: p, loopFocus: m, onLoop: h, enableHomeAndEndKeys: g, onMapChange: _, stopEventPropagation: v = !0, rootRef: y, disabledIndices: b, modifierKeys: x, highlightItemOnHover: S = !1, tag: C = "div", ...w } = e, { props: T, highlightedIndex: E, onHighlightedIndexChange: D, elementsRef: O, onMapChange: k, relayKeyboardEvent: A } = Va({
3020
- grid: p,
3021
- loopFocus: m,
3022
- onLoop: h,
3023
- orientation: f,
3024
- highlightedIndex: u,
3025
- onHighlightedIndexChange: d,
3026
- rootRef: y,
3027
- stopEventPropagation: v,
3028
- enableHomeAndEndKeys: g,
3029
- direction: Wr(),
3030
- disabledIndices: b,
3031
- modifierKeys: x
3032
- }), j = Z(C, e, {
3033
- state: c,
3034
- ref: a,
3035
- props: [
3036
- T,
3037
- ...s,
3038
- w
3039
- ],
3040
- stateAttributesMapping: l
3041
- }), M = r.useMemo(() => ({
3042
- highlightedIndex: E,
3043
- onHighlightedIndexChange: D,
3044
- highlightItemOnHover: S,
3045
- relayKeyboardEvent: A
3046
- }), [
3047
- E,
3048
- D,
3049
- S,
3050
- A
3051
- ]);
3052
- return /* @__PURE__ */ o(me.Provider, {
3053
- value: M,
3054
- children: /* @__PURE__ */ o(zr, {
3055
- elementsRef: O,
3056
- onMapChange: (e) => {
3057
- _?.(e), k(e);
3058
- },
3059
- children: j
3060
- })
3061
- });
3062
- }
3063
- //#endregion
3064
- //#region node_modules/@base-ui/react/toolbar/group/ToolbarGroupContext.mjs
3065
- var Wa = /* @__PURE__ */ r.createContext(void 0);
3066
- process.env.NODE_ENV !== "production" && (Wa.displayName = "ToolbarGroupContext");
3067
- function Ga(e) {
3068
- let t = r.useContext(Wa);
3069
- if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? J(68) : "Base UI: ToolbarGroupContext is missing. ToolbarGroup parts must be placed within <Toolbar.Group>.");
3070
- return t;
3071
- }
3072
- //#endregion
3073
- //#region node_modules/@base-ui/react/toggle-group/ToggleGroupDataAttributes.mjs
3074
- var Ka = /* @__PURE__ */ function(e) {
3075
- return e.disabled = "data-disabled", e.orientation = "data-orientation", e.multiple = "data-multiple", e;
3076
- }({}), qa = { multiple(e) {
3077
- return e ? { [Ka.multiple]: "" } : null;
3078
- } }, Ja = /* @__PURE__ */ r.forwardRef(function(e, t) {
3079
- let { defaultValue: n, disabled: i = !1, loopFocus: a = !0, onValueChange: s, orientation: c = "horizontal", multiple: l = !1, value: u, className: d, render: f, style: p, ...m } = e, h = Kr(!0), g = Ga(!0), _ = r.useMemo(() => u !== void 0 || n !== void 0, [u, n]), v = (h?.disabled ?? !1) || (g?.disabled ?? !1) || i, [y, b] = Ue({
3080
- controlled: u,
3081
- default: u === void 0 ? n ?? Ae : void 0,
3082
- name: "ToggleGroup",
3083
- state: "value"
3084
- }), x = L((e, t, n) => {
3085
- let r;
3086
- l ? (r = y.slice(), t ? r.push(e) : r.splice(y.indexOf(e), 1)) : r = t ? [e] : [], s?.(r, n), !n.isCanceled && b(r);
3087
- }), S = {
3088
- disabled: v,
3089
- multiple: l,
3090
- orientation: c
3091
- }, C = r.useMemo(() => ({
3092
- disabled: v,
3093
- orientation: c,
3094
- setGroupValue: x,
3095
- value: y,
3096
- isValueInitialized: _
3097
- }), [
3098
- v,
3099
- c,
3100
- x,
3101
- y,
3102
- _
3103
- ]), w = { role: "group" }, T = Z("div", e, {
3104
- enabled: !!h,
3105
- state: S,
3106
- ref: t,
3107
- props: [w, m],
3108
- stateAttributesMapping: qa
3109
- });
3110
- return /* @__PURE__ */ o(Aa.Provider, {
3111
- value: C,
3112
- children: h ? T : /* @__PURE__ */ o(Ua, {
3113
- render: f,
3114
- className: d,
3115
- style: p,
3116
- state: S,
3117
- refs: [t],
3118
- props: [w, m],
3119
- stateAttributesMapping: qa,
3120
- loopFocus: a,
3121
- enableHomeAndEndKeys: !0,
3122
- orientation: c
3123
- })
3124
- });
3125
- });
3126
- process.env.NODE_ENV !== "production" && (Ja.displayName = "ToggleGroup");
3127
- //#endregion
3128
- //#region src/components/toggle-group/toggle-group.tsx
3129
- var Ya = n({ root: "imf-ui-toggle-group-module-root" }.root);
3130
- function Xa({ className: e, ...t }) {
3131
- return /* @__PURE__ */ o(Ja, {
3132
- ...t,
3133
- "data-imf-ui-component": "ToggleGroup",
3134
- className: (t) => Ya({ className: typeof e == "function" ? e(t) : e })
3135
- });
3136
- }
3137
- //#endregion
3138
- //#region node_modules/@base-ui/react/utils/getCssDimensions.mjs
3139
- function Za(e) {
3140
- let t = O(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = h(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r;
3141
- return (Vn(n) !== a || Vn(r) !== o) && (n = a, r = o), {
3142
- width: n,
3143
- height: r
3144
- };
3145
- }
3146
- var Q = {
3147
- alignCenter: "imf-ui-row-module-alignCenter",
3148
- alignEnd: "imf-ui-row-module-alignEnd",
3149
- alignStart: "imf-ui-row-module-alignStart",
3150
- alignStretch: "imf-ui-row-module-alignStretch",
3151
- gap1: "imf-ui-row-module-gap1",
3152
- gap10: "imf-ui-row-module-gap10",
3153
- gap2: "imf-ui-row-module-gap2",
3154
- gap3: "imf-ui-row-module-gap3",
3155
- gap4: "imf-ui-row-module-gap4",
3156
- gap5: "imf-ui-row-module-gap5",
3157
- gap6: "imf-ui-row-module-gap6",
3158
- gap7: "imf-ui-row-module-gap7",
3159
- gap8: "imf-ui-row-module-gap8",
3160
- gap9: "imf-ui-row-module-gap9",
3161
- justifyAround: "imf-ui-row-module-justifyAround",
3162
- justifyBetween: "imf-ui-row-module-justifyBetween",
3163
- justifyCenter: "imf-ui-row-module-justifyCenter",
3164
- justifyEnd: "imf-ui-row-module-justifyEnd",
3165
- justifyEvenly: "imf-ui-row-module-justifyEvenly",
3166
- justifyStart: "imf-ui-row-module-justifyStart",
3167
- root: "imf-ui-row-module-root",
3168
- wrap: "imf-ui-row-module-wrap"
3169
- }, Qa = n(Q.root, { variants: {
3170
- gap: {
3171
- 1: Q.gap1,
3172
- 2: Q.gap2,
3173
- 3: Q.gap3,
3174
- 4: Q.gap4,
3175
- 5: Q.gap5,
3176
- 6: Q.gap6,
3177
- 7: Q.gap7,
3178
- 8: Q.gap8,
3179
- 9: Q.gap9,
3180
- 10: Q.gap10
3181
- },
3182
- align: {
3183
- start: Q.alignStart,
3184
- center: Q.alignCenter,
3185
- end: Q.alignEnd,
3186
- stretch: Q.alignStretch
3187
- },
3188
- justify: {
3189
- start: Q.justifyStart,
3190
- center: Q.justifyCenter,
3191
- end: Q.justifyEnd,
3192
- between: Q.justifyBetween,
3193
- around: Q.justifyAround,
3194
- evenly: Q.justifyEvenly
3195
- },
3196
- wrap: {
3197
- true: Q.wrap,
3198
- false: null
3199
- }
3200
- } });
3201
- function $a({ gap: e = "2", align: t = "stretch", justify: n = "start", wrap: r = !1, className: i, ...a }) {
3202
- return /* @__PURE__ */ o("div", {
3203
- ...a,
3204
- "data-imf-ui-component": "Row",
3205
- className: Qa({
3206
- gap: e,
3207
- align: t,
3208
- justify: n,
3209
- wrap: r,
3210
- className: i
3211
- }),
3212
- children: a.children
3213
- });
3214
- }
3215
- var $ = {
3216
- alignCenter: "imf-ui-stack-module-alignCenter",
3217
- alignEnd: "imf-ui-stack-module-alignEnd",
3218
- alignStart: "imf-ui-stack-module-alignStart",
3219
- alignStretch: "imf-ui-stack-module-alignStretch",
3220
- gap1: "imf-ui-stack-module-gap1",
3221
- gap10: "imf-ui-stack-module-gap10",
3222
- gap2: "imf-ui-stack-module-gap2",
3223
- gap3: "imf-ui-stack-module-gap3",
3224
- gap4: "imf-ui-stack-module-gap4",
3225
- gap5: "imf-ui-stack-module-gap5",
3226
- gap6: "imf-ui-stack-module-gap6",
3227
- gap7: "imf-ui-stack-module-gap7",
3228
- gap8: "imf-ui-stack-module-gap8",
3229
- gap9: "imf-ui-stack-module-gap9",
3230
- justifyAround: "imf-ui-stack-module-justifyAround",
3231
- justifyBetween: "imf-ui-stack-module-justifyBetween",
3232
- justifyCenter: "imf-ui-stack-module-justifyCenter",
3233
- justifyEnd: "imf-ui-stack-module-justifyEnd",
3234
- justifyEvenly: "imf-ui-stack-module-justifyEvenly",
3235
- justifyStart: "imf-ui-stack-module-justifyStart",
3236
- root: "imf-ui-stack-module-root"
3237
- }, eo = n($.root, { variants: {
3238
- gap: {
3239
- 1: $.gap1,
3240
- 2: $.gap2,
3241
- 3: $.gap3,
3242
- 4: $.gap4,
3243
- 5: $.gap5,
3244
- 6: $.gap6,
3245
- 7: $.gap7,
3246
- 8: $.gap8,
3247
- 9: $.gap9,
3248
- 10: $.gap10
3249
- },
3250
- align: {
3251
- start: $.alignStart,
3252
- center: $.alignCenter,
3253
- end: $.alignEnd,
3254
- stretch: $.alignStretch
3255
- },
3256
- justify: {
3257
- start: $.justifyStart,
3258
- center: $.justifyCenter,
3259
- end: $.justifyEnd,
3260
- between: $.justifyBetween,
3261
- around: $.justifyAround,
3262
- evenly: $.justifyEvenly
3263
- }
3264
- } });
3265
- function to({ gap: e = "4", align: t = "stretch", justify: n = "start", className: r, ...i }) {
3266
- return /* @__PURE__ */ o("div", {
3267
- ...i,
3268
- "data-imf-ui-component": "Stack",
3269
- className: eo({
3270
- gap: e,
3271
- align: t,
3272
- justify: n,
3273
- className: r
3274
- }),
3275
- children: i.children
3276
- });
3277
- }
3278
- //#endregion
3279
- //#region node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
3280
- var no = /* @__PURE__ */ r.createContext(void 0);
3281
- process.env.NODE_ENV !== "production" && (no.displayName = "TabsRootContext");
3282
- function ro() {
3283
- let e = r.useContext(no);
3284
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? J(64) : "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.");
3285
- return e;
3286
- }
3287
- //#endregion
3288
- //#region node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
3289
- var io = /* @__PURE__ */ function(e) {
3290
- return e.activationDirection = "data-activation-direction", e.orientation = "data-orientation", e;
3291
- }({}), ao = { tabActivationDirection: (e) => ({ [io.activationDirection]: e }) }, oo = /* @__PURE__ */ r.forwardRef(function(e, t) {
3292
- let { className: n, defaultValue: i = 0, onValueChange: a, orientation: s = "horizontal", render: c, value: l, style: u, ...d } = e, f = e.defaultValue !== void 0, p = r.useRef([]), [m, h] = r.useState(() => /* @__PURE__ */ new Map()), [g, _] = Ue({
3293
- controlled: l,
3294
- default: i,
3295
- name: "Tabs",
3296
- state: "value"
3297
- }), v = l !== void 0, [y, b] = r.useState(() => /* @__PURE__ */ new Map()), x = r.useRef(void 0), S = r.useCallback((e) => {
3298
- if (e === void 0) return null;
3299
- for (let [t, n] of y.entries()) if (n != null && e === (n.value ?? n.index)) return t;
3300
- return null;
3301
- }, [y]), [C, w] = r.useState(() => ({
3302
- previousValue: g,
3303
- tabActivationDirection: "none"
3304
- })), { previousValue: T, tabActivationDirection: E } = C, D = E, O = !1;
3305
- T !== g && (D = so(T, g, s, y), O = T != null && g != null && S(g) == null);
3306
- let k = O ? T : g, A = T !== k || E !== D;
3307
- V(() => {
3308
- A && w({
3309
- previousValue: k,
3310
- tabActivationDirection: D
3311
- });
3312
- }, [
3313
- k,
3314
- A,
3315
- D
3316
- ]);
3317
- let j = L((e, t) => {
3318
- t.activationDirection = so(g, e, s, y), a?.(e, t), !t.isCanceled && _(e);
3319
- }), M = L((e, t) => {
3320
- a?.(e, Lt(t, void 0, void 0, { activationDirection: "none" }));
3321
- }), ee = L((e, t) => {
3322
- h((n) => {
3323
- if (n.get(e) === t) return n;
3324
- let r = new Map(n);
3325
- return r.set(e, t), r;
3326
- });
3327
- }), N = L((e, t) => {
3328
- h((n) => {
3329
- if (!n.has(e) || n.get(e) !== t) return n;
3330
- let r = new Map(n);
3331
- return r.delete(e), r;
3332
- });
3333
- }), P = r.useCallback((e) => m.get(e), [m]), F = r.useCallback((e) => {
3334
- for (let t of y.values()) if (e === t?.value) return t?.id;
3335
- }, [y]), te = r.useMemo(() => ({
3336
- getTabElementBySelectedValue: S,
3337
- getTabIdByPanelValue: F,
3338
- getTabPanelIdByValue: P,
3339
- onValueChange: j,
3340
- orientation: s,
3341
- registerMountedTabPanel: ee,
3342
- setTabMap: b,
3343
- unregisterMountedTabPanel: N,
3344
- tabActivationDirection: D,
3345
- value: g
3346
- }), [
3347
- S,
3348
- F,
3349
- P,
3350
- j,
3351
- s,
3352
- ee,
3353
- b,
3354
- N,
3355
- D,
3356
- g
3357
- ]), I = r.useMemo(() => {
3358
- for (let e of y.values()) if (e != null && e.value === g) return e;
3359
- }, [y, g]), R = r.useMemo(() => {
3360
- for (let e of y.values()) if (e != null && !e.disabled) return e.value;
3361
- }, [y]), ne = r.useRef(!f), z = r.useRef(i), B = r.useRef(f), H = r.useRef(!1);
3362
- V(() => {
3363
- if (v) return;
3364
- function e(e, t) {
3365
- _(e), w((t) => t.previousValue === e && t.tabActivationDirection === "none" ? t : {
3366
- previousValue: e,
3367
- tabActivationDirection: "none"
3368
- }), M(e, t), ne.current = !1;
3369
- }
3370
- if (y.size === 0) {
3371
- H.current && g !== null && !x.current?.isConnected && e(null, Mt);
3372
- return;
3373
- }
3374
- H.current = !0, x.current = y.keys().next().value;
3375
- let t = I?.disabled, n = I == null && g !== null;
3376
- if (!t && g === z.current && (B.current = !1), B.current && t && g === z.current) return;
3377
- let r = ne.current;
3378
- if (t || n) {
3379
- let n = R ?? null;
3380
- if (g === n) {
3381
- ne.current = !1;
3382
- return;
3383
- }
3384
- let i = Mt;
3385
- r ? i = Nt : t && (i = jt), e(n, i);
3386
- return;
3387
- }
3388
- r && I != null && (M(g, Nt), ne.current = !1);
3389
- }, [
3390
- R,
3391
- v,
3392
- M,
3393
- I,
3394
- _,
3395
- y,
3396
- g
3397
- ]);
3398
- let re = Z("div", e, {
3399
- state: {
3400
- orientation: s,
3401
- tabActivationDirection: D
3402
- },
3403
- ref: t,
3404
- props: d,
3405
- stateAttributesMapping: ao
3406
- });
3407
- return /* @__PURE__ */ o(no.Provider, {
3408
- value: te,
3409
- children: /* @__PURE__ */ o(zr, {
3410
- elementsRef: p,
3411
- children: re
3412
- })
3413
- });
3414
- });
3415
- process.env.NODE_ENV !== "production" && (oo.displayName = "TabsRoot");
3416
- function so(e, t, n, r) {
3417
- if (e == null || t == null) return "none";
3418
- let i = null, a = null;
3419
- for (let [n, o] of r.entries()) {
3420
- if (o == null) continue;
3421
- let r = o.value ?? o.index;
3422
- if (e === r && (i = n), t === r && (a = n), i != null && a != null) break;
3423
- }
3424
- if (i == null || a == null) return i !== a && (typeof e == "number" || typeof e == "string") && typeof e == typeof t ? n === "horizontal" ? t > e ? "right" : "left" : t > e ? "down" : "up" : "none";
3425
- let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
3426
- if (n === "horizontal") {
3427
- if (s.left < o.left) return "left";
3428
- if (s.left > o.left) return "right";
3429
- } else {
3430
- if (s.top < o.top) return "up";
3431
- if (s.top > o.top) return "down";
3432
- }
3433
- return "none";
3434
- }
3435
- //#endregion
3436
- //#region node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
3437
- var co = /* @__PURE__ */ r.createContext(void 0);
3438
- process.env.NODE_ENV !== "production" && (co.displayName = "TabsListContext");
3439
- function lo() {
3440
- let e = r.useContext(co);
3441
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? J(65) : "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.");
3442
- return e;
3443
- }
3444
- //#endregion
3445
- //#region node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
3446
- var uo = /* @__PURE__ */ r.forwardRef(function(e, t) {
3447
- let { className: n, disabled: i = !1, render: a, value: o, id: s, nativeButton: c = !0, style: l, ...u } = e, { value: d, getTabPanelIdByValue: f, orientation: p, tabActivationDirection: m } = ro(), { activateOnFocus: h, highlightedTabIndex: g, onTabActivation: _, registerTabResizeObserverElement: v, setHighlightedTabIndex: y, tabsListElement: b } = lo(), x = it(s), { compositeProps: S, compositeRef: C, index: w } = Ma({ metadata: r.useMemo(() => ({
3448
- disabled: i,
3449
- id: x,
3450
- value: o
3451
- }), [
3452
- i,
3453
- x,
3454
- o
3455
- ]) }), T = o === d, E = r.useRef(!1), D = r.useRef(null);
3456
- V(() => {
3457
- let e = D.current;
3458
- if (e) return v(e);
3459
- }, [v]), V(() => {
3460
- if (E.current) {
3461
- E.current = !1;
3462
- return;
3463
- }
3464
- if (!(T && w > -1 && g !== w)) return;
3465
- let e = b;
3466
- if (e != null) {
3467
- let t = xn(Je(e));
3468
- if (t && Sn(e, t)) return;
3469
- }
3470
- i || y(w);
3471
- }, [
3472
- T,
3473
- w,
3474
- g,
3475
- y,
3476
- i,
3477
- b
3478
- ]);
3479
- let { getButtonProps: O, buttonRef: k } = _e({
3480
- disabled: i,
3481
- native: c,
3482
- focusableWhenDisabled: !0
3483
- }), A = f(o), j = r.useRef(!1), M = r.useRef(!1);
3484
- function ee(e) {
3485
- T || i || _(o, Lt(gt, e.nativeEvent, void 0, { activationDirection: "none" }));
3486
- }
3487
- function N(e) {
3488
- T || (w > -1 && !i && y(w), !i && h && (!j.current || j.current && M.current) && _(o, Lt(gt, e.nativeEvent, void 0, { activationDirection: "none" })));
3489
- }
3490
- function P(e) {
3491
- if (T || i) return;
3492
- j.current = !0;
3493
- function t() {
3494
- j.current = !1, M.current = !1;
3495
- }
3496
- (!e.button || e.button === 0) && (M.current = !0, Je(e.currentTarget).addEventListener("pointerup", t, { once: !0 }));
3497
- }
3498
- return Z("button", e, {
3499
- state: {
3500
- disabled: i,
3501
- active: T,
3502
- orientation: p,
3503
- tabActivationDirection: m
3504
- },
3505
- ref: [
3506
- t,
3507
- k,
3508
- C,
3509
- D
3510
- ],
3511
- props: [
3512
- S,
3513
- {
3514
- role: "tab",
3515
- "aria-controls": A,
3516
- "aria-selected": T,
3517
- id: x,
3518
- onClick: ee,
3519
- onFocus: N,
3520
- onPointerDown: P,
3521
- [za]: T ? "" : void 0,
3522
- onKeyDownCapture() {
3523
- E.current = !0;
3524
- }
3525
- },
3526
- u,
3527
- O
3528
- ],
3529
- stateAttributesMapping: ao
3530
- });
3531
- });
3532
- process.env.NODE_ENV !== "production" && (uo.displayName = "TabsTab");
3533
- //#endregion
3534
- //#region node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
3535
- var fo = /* @__PURE__ */ function(e) {
3536
- return e.activeTabLeft = "--active-tab-left", e.activeTabRight = "--active-tab-right", e.activeTabTop = "--active-tab-top", e.activeTabBottom = "--active-tab-bottom", e.activeTabWidth = "--active-tab-width", e.activeTabHeight = "--active-tab-height", e;
3537
- }({}), po = {
3538
- ...ao,
3539
- activeTabPosition: () => null,
3540
- activeTabSize: () => null
3541
- }, mo = /* @__PURE__ */ r.forwardRef(function(e, t) {
3542
- let { className: n, render: i, renderBeforeHydration: a = !1, style: c, ...l } = e, { nonce: u } = mi(), { getTabElementBySelectedValue: d, orientation: f, tabActivationDirection: p, value: m } = ro(), { tabsListElement: h, registerIndicatorUpdateListener: g } = lo(), _ = Ki(), v = jr();
3543
- r.useEffect(() => g(v), [g, v]);
3544
- let y = 0, b = 0, x = 0, S = 0, C = 0, w = 0, T = !1;
3545
- if (m != null && h != null) {
3546
- let e = d(m);
3547
- if (e != null) {
3548
- T = !0;
3549
- let { width: t, height: n } = Za(e), { width: r, height: i } = Za(h), a = e.getBoundingClientRect(), o = h.getBoundingClientRect(), s = r > 0 ? o.width / r : 1, c = i > 0 ? o.height / i : 1;
3550
- if (Math.abs(s) > 2 ** -52 && Math.abs(c) > 2 ** -52) {
3551
- let e = a.left - o.left, t = a.top - o.top;
3552
- y = e / s + h.scrollLeft - h.clientLeft, x = t / c + h.scrollTop - h.clientTop;
3553
- } else y = e.offsetLeft, x = e.offsetTop;
3554
- C = t, w = n, b = h.scrollWidth - y - C, S = h.scrollHeight - x - w;
3555
- }
3556
- }
3557
- let E = T ? {
3558
- left: y,
3559
- right: b,
3560
- top: x,
3561
- bottom: S
3562
- } : null, D = T ? {
3563
- width: C,
3564
- height: w
3565
- } : null, O = T ? {
3566
- [fo.activeTabLeft]: `${y}px`,
3567
- [fo.activeTabRight]: `${b}px`,
3568
- [fo.activeTabTop]: `${x}px`,
3569
- [fo.activeTabBottom]: `${S}px`,
3570
- [fo.activeTabWidth]: `${C}px`,
3571
- [fo.activeTabHeight]: `${w}px`
3572
- } : void 0, k = Z("span", e, {
3573
- state: {
3574
- orientation: f,
3575
- activeTabPosition: E,
3576
- activeTabSize: D,
3577
- tabActivationDirection: p
3578
- },
3579
- ref: t,
3580
- props: [
3581
- {
3582
- role: "presentation",
3583
- style: O,
3584
- hidden: !(T && C > 0 && w > 0)
3585
- },
3586
- l,
3587
- { suppressHydrationWarning: !0 }
3588
- ],
3589
- stateAttributesMapping: po
3590
- });
3591
- return m == null ? null : /* @__PURE__ */ s(r.Fragment, { children: [k, _ && a && /* @__PURE__ */ o("script", {
3592
- nonce: u,
3593
- dangerouslySetInnerHTML: { __html: "!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest('[role=\"tablist\"]');if(!e)return;const i=e.querySelector(\"[data-active]\");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c(\"left\",o),c(\"right\",n),c(\"top\",h),c(\"bottom\",l),c(\"width\",r),c(\"height\",f),r>0&&f>0&&t.removeAttribute(\"hidden\")}();" },
3594
- suppressHydrationWarning: !0
3595
- })] });
3596
- });
3597
- process.env.NODE_ENV !== "production" && (mo.displayName = "TabsIndicator");
3598
- //#endregion
3599
- //#region node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
3600
- var ho = function(e) {
3601
- return e.index = "data-index", e.activationDirection = "data-activation-direction", e.orientation = "data-orientation", e.hidden = "data-hidden", e[e.startingStyle = Jt.startingStyle] = "startingStyle", e[e.endingStyle = Jt.endingStyle] = "endingStyle", e;
3602
- }({}), go = {
3603
- ...ao,
3604
- ...Zt
3605
- }, _o = /* @__PURE__ */ r.forwardRef(function(e, t) {
3606
- let { className: n, value: i, render: a, keepMounted: o = !1, style: s, ...c } = e, { value: l, getTabIdByPanelValue: u, orientation: d, tabActivationDirection: f, registerMountedTabPanel: p, unregisterMountedTabPanel: m } = ro(), h = it(), { ref: g, index: _ } = gi({ metadata: r.useMemo(() => ({
3607
- id: h,
3608
- value: i
3609
- }), [h, i]) }), v = i === l, { mounted: y, transitionStatus: b, setMounted: x } = en(v), S = !y, C = u(i), w = {
3610
- hidden: S,
3611
- orientation: d,
3612
- tabActivationDirection: f,
3613
- transitionStatus: b
3614
- }, T = r.useRef(null), E = Z("div", e, {
3615
- state: w,
3616
- ref: [
3617
- t,
3618
- g,
3619
- T
3620
- ],
3621
- props: [{
3622
- "aria-labelledby": C,
3623
- hidden: S,
3624
- id: h,
3625
- role: "tabpanel",
3626
- tabIndex: v ? 0 : -1,
3627
- inert: Ir(!v),
3628
- [ho.index]: _
3629
- }, c],
3630
- stateAttributesMapping: go
3631
- });
3632
- return $t({
3633
- open: v,
3634
- ref: T,
3635
- onComplete() {
3636
- v || x(!1);
3637
- }
3638
- }), V(() => {
3639
- if (!(S && !o) && h != null) return p(i, h), () => {
3640
- m(i, h);
3641
- };
3642
- }, [
3643
- S,
3644
- o,
3645
- i,
3646
- h,
3647
- p,
3648
- m
3649
- ]), o || y ? E : null;
3650
- });
3651
- process.env.NODE_ENV !== "production" && (_o.displayName = "TabsPanel");
3652
- //#endregion
3653
- //#region node_modules/@base-ui/react/tabs/list/TabsList.mjs
3654
- var vo = /* @__PURE__ */ r.forwardRef(function(e, t) {
3655
- let { activateOnFocus: n = !1, className: i, loopFocus: a = !0, render: s, style: c, ...l } = e, { onValueChange: u, orientation: d, value: f, setTabMap: p, tabActivationDirection: m } = ro(), [h, g] = r.useState(0), [_, v] = r.useState(null), y = r.useRef(/* @__PURE__ */ new Set()), b = r.useRef(/* @__PURE__ */ new Set()), x = r.useRef(null);
3656
- V(() => {
3657
- if (typeof ResizeObserver > "u") return;
3658
- let e = new ResizeObserver(() => {
3659
- y.current.forEach((e) => {
3660
- e();
3661
- });
3662
- });
3663
- return x.current = e, _ && e.observe(_), b.current.forEach((t) => {
3664
- e.observe(t);
3665
- }), () => {
3666
- e.disconnect(), x.current = null;
3667
- };
3668
- }, [_]);
3669
- let S = L((e) => (y.current.add(e), () => {
3670
- y.current.delete(e);
3671
- })), C = L((e) => (b.current.add(e), x.current?.observe(e), () => {
3672
- b.current.delete(e), x.current?.unobserve(e);
3673
- })), w = L((e, t) => {
3674
- e !== f && u(e, t);
3675
- }), T = {
3676
- orientation: d,
3677
- tabActivationDirection: m
3678
- }, E = {
3679
- "aria-orientation": d === "vertical" ? "vertical" : void 0,
3680
- role: "tablist"
3681
- }, D = r.useMemo(() => ({
3682
- activateOnFocus: n,
3683
- highlightedTabIndex: h,
3684
- registerIndicatorUpdateListener: S,
3685
- registerTabResizeObserverElement: C,
3686
- onTabActivation: w,
3687
- setHighlightedTabIndex: g,
3688
- tabsListElement: _
3689
- }), [
3690
- n,
3691
- h,
3692
- S,
3693
- C,
3694
- w,
3695
- g,
3696
- _
3697
- ]);
3698
- return /* @__PURE__ */ o(co.Provider, {
3699
- value: D,
3700
- children: /* @__PURE__ */ o(Ua, {
3701
- render: s,
3702
- className: i,
3703
- style: c,
3704
- state: T,
3705
- refs: [t, v],
3706
- props: [E, l],
3707
- stateAttributesMapping: ao,
3708
- highlightedIndex: h,
3709
- enableHomeAndEndKeys: !0,
3710
- loopFocus: a,
3711
- orientation: d,
3712
- onHighlightedIndexChange: g,
3713
- onMapChange: p,
3714
- disabledIndices: Ae
3715
- })
3716
- });
3717
- });
3718
- process.env.NODE_ENV !== "production" && (vo.displayName = "TabsList");
3719
- var yo = {
3720
- indicator: "imf-ui-tabs-module-indicator",
3721
- list: "imf-ui-tabs-module-list",
3722
- listFill: "imf-ui-tabs-module-listFill",
3723
- panel: "imf-ui-tabs-module-panel",
3724
- panelViewport: "imf-ui-tabs-module-panelViewport",
3725
- root: "imf-ui-tabs-module-root",
3726
- tab: "imf-ui-tabs-module-tab"
3727
- }, bo = /* @__PURE__ */ e({
3728
- Indicator: () => Ao,
3729
- List: () => Oo,
3730
- Panel: () => Mo,
3731
- PanelViewport: () => jo,
3732
- Root: () => Do,
3733
- Tab: () => ko
3734
- }), xo = n(yo.list, { variants: { fill: {
3735
- true: yo.listFill,
3736
- false: null
3737
- } } }), So = n(yo.root), Co = n(yo.tab), wo = n(yo.indicator), To = n(yo.panelViewport), Eo = n(yo.panel);
3738
- function Do({ className: e, ...t }) {
3739
- return /* @__PURE__ */ o(oo, {
3740
- ...t,
3741
- "data-imf-ui-component": "Tabs.Root",
3742
- className: (t) => So({ className: typeof e == "function" ? e(t) : e })
3743
- });
3744
- }
3745
- Do.displayName = "Tabs.Root";
3746
- function Oo({ fill: e = !1, className: t, ...n }) {
3747
- return /* @__PURE__ */ o(vo, {
3748
- ...n,
3749
- "data-imf-ui-component": "Tabs.List",
3750
- className: (n) => xo({
3751
- fill: e,
3752
- className: typeof t == "function" ? t(n) : t
3753
- })
3754
- });
3755
- }
3756
- Oo.displayName = "Tabs.List";
3757
- function ko({ className: e, ...t }) {
3758
- return /* @__PURE__ */ o(uo, {
3759
- ...t,
3760
- "data-imf-ui-component": "Tabs.Tab",
3761
- className: (t) => Co({ className: typeof e == "function" ? e(t) : e })
3762
- });
3763
- }
3764
- ko.displayName = "Tabs.Tab";
3765
- function Ao({ className: e, ...t }) {
3766
- return /* @__PURE__ */ o(mo, {
3767
- ...t,
3768
- "data-imf-ui-component": "Tabs.Indicator",
3769
- className: (t) => wo({ className: typeof e == "function" ? e(t) : e })
3770
- });
3771
- }
3772
- Ao.displayName = "Tabs.Indicator";
3773
- function jo({ className: e, ...t }) {
3774
- return /* @__PURE__ */ o("div", {
3775
- ...t,
3776
- "data-imf-ui-component": "Tabs.PanelViewport",
3777
- className: To({ className: e })
3778
- });
3779
- }
3780
- jo.displayName = "Tabs.PanelViewport";
3781
- function Mo({ className: e, ...t }) {
3782
- return /* @__PURE__ */ o(_o, {
3783
- ...t,
3784
- "data-imf-ui-component": "Tabs.Panel",
3785
- className: (t) => Eo({ className: typeof e == "function" ? e(t) : e })
3786
- });
3787
- }
3788
- Mo.displayName = "Tabs.Panel";
3789
- //#endregion
3790
- export { Hn as $, ee as $n, Vt as $t, Kr as A, Je as An, xn as At, Tr as B, Ee as Bn, pn as Bt, ha as C, ct as Cn, Tn as Ct, gi as D, rt as Dn, kn as Dt, hi as E, it as En, wn as Et, Fr as F, Pe as Fn, vn as Ft, mr as G, V as Gn, en as Gt, Sr as H, _e as Hn, fn as Ht, Nr as I, Ae as In, yn as It, fr as J, F as Jn, Jt, pr as K, B as Kn, $t as Kt, Mr as L, je as Ln, hn as Lt, zr as M, qe as Mn, Cn as Mt, Ir as N, Ue as Nn, bn as Nt, mi as O, Xe as On, Dn as Ot, Pr as P, Z as Pn, _n as Pt, Kn as Q, f as Qn, Kt as Qt, kr as R, X as Rn, mn as Rt, _a as S, ut as Sn, jn as St, ra as T, st as Tn, En as Tt, br as U, J as Un, sn as Ut, Cr as V, be as Vn, ln as Vt, hr as W, U as Wn, tn as Wt, Gn as X, O as Xn, qt as Xt, gr as Y, N as Yn, Zt as Yt, Un as Z, T as Zn, Gt as Zt, Ta as _, _t as _n, In as _t, Do as a, jt as an, w as ar, Yn as at, fa as b, dt as bn, Fn as bt, to as c, Pt as cn, D as cr, ur as ct, Xa as d, Ot as dn, g as dr, Bn as dt, zt as en, u as er, Jn as et, Ua as f, gt as fn, v as fr, zn as ft, ka as g, vt as gn, Ln as gt, Oa as h, yt as hn, Rn as ht, jo as i, Dt as in, d as ir, er as it, Wr as j, Ke as jn, Sn as jt, ai as k, $e as kn, An as kt, $a as l, xt as ln, p as lr, qn as lt, Na as m, Ft as mn, E as mr, Vn as mt, Oo as n, At as nn, M as nr, $n as nt, ko as o, Et as on, m as or, sr as ot, Ra as p, bt as pn, y as pr, dr as pt, vr as q, L as qn, Qt as qt, Mo as r, St as rn, A as rr, Xn as rt, bo as s, Tt as sn, h as sr, cr as st, Ao as t, Lt as tn, k as tr, Qn as tt, Za as u, Ct as un, _ as ur, Zn as ut, ma as v, It as vn, Nn as vt, pa as w, ot as wn, On as wt, da as x, ft as xn, Mn as xt, ga as y, pt as yn, Pn as yt, Or as z, ke as zn, dn as zt };