@sheetxl/utils-mui 0.7.6 → 0.7.8

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,2865 +0,0 @@
1
- import Q, { memo as ie, forwardRef as ce, version as Mo, useLayoutEffect as Cr, useEffect as ke, useState as te, useMemo as ee, useRef as me, useImperativeHandle as To, useCallback as Re, createContext as Po, Suspense as Ro, Fragment as No, useContext as Fo, useReducer as _o } from "react";
2
- import { jsx as k, jsxs as Z, Fragment as qe } from "react/jsx-runtime";
3
- import { alpha as he, darken as Ao, lighten as Io } from "@mui/system";
4
- import { IconButton as Qe, Divider as Er, Box as X, Typography as Ce, Paper as Ot, Chip as Vo, Popper as Lo, Grow as Bo, Tooltip as jo, ListItemIcon as $o, MenuItem as Mr, Fade as zo, Backdrop as Wo, DialogTitle as Ho, Button as Uo, DialogContent as Yo, DialogActions as Ko, Input as Xo, Toolbar as Go } from "@mui/material";
5
- import { CommonUtils as Pe } from "@sheetxl/utils";
6
- import { defaultCreateScrollEdgeButton as qo, ScrollbarOrientation as ot, DynamicIcon as ve, useCallbackRef as se, useFullscreenPortal as sn, KeyCodes as Ee, KeyModifiers as Et, ReactUtils as Qo, useImperativeElement as Tr, useCommand as ln, CommandButtonType as Ne, useCommands as cn } from "@sheetxl/utils-react";
7
- import { useTheme as un, styled as Jo, createTheme as On, useThemeProps as Zo } from "@mui/material/styles";
8
- import { deepmerge as Pr } from "@mui/utils";
9
- import Rr, { createPortal as ei } from "react-dom";
10
- /**
11
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.6
12
- *
13
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
14
- * License: The license can be found at https://www.sheetxl.com/license.
15
- */
16
- function Nr(e) {
17
- var r, n, t = "";
18
- if (typeof e == "string" || typeof e == "number") t += e;
19
- else if (typeof e == "object") if (Array.isArray(e)) {
20
- var a = e.length;
21
- for (r = 0; r < a; r++) e[r] && (n = Nr(e[r])) && (t && (t += " "), t += n);
22
- } else for (n in e) e[n] && (t && (t += " "), t += n);
23
- return t;
24
- }
25
- function De() {
26
- for (var e, r, n = 0, t = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (r = Nr(e)) && (t && (t += " "), t += r);
27
- return t;
28
- }
29
- const ts = (e) => {
30
- const r = { style: { cursor: "pointer" }, ...e };
31
- return qo(r);
32
- }, Fr = (e, r, n, t) => {
33
- const { style: a, ...s } = e, i = k(Qe, { component: "div", ...s, style: { ...a, padding: "0px" }, sx: { padding: "0" }, color: e.disabled ? void 0 : "primary", "aria-label": n, size: "small", children: r });
34
- return k(ct, { title: e.disabled ? n : t, enterDelay: 800, enterNextDelay: 1600, children: e.disabled ? k("div", { style: { display: "flex" }, children: i }) : i });
35
- }, ns = (e) => Fr(e, ot.Horizontal ? k(ve, { iconKey: "ArrowLeft", size: "small" }) : k(ve, { iconKey: "ArrowUpward", size: "small" }), "Scroll " + (e.orientation === ot.Horizontal ? "Left" : "Up"), `Scroll ${e.orientation === ot.Horizontal ? "left" : "up"}, 'Ctrl+Click' to scroll to the beginning`), rs = (e) => Fr(e, ot.Horizontal ? k(ve, { iconKey: "ArrowRight", size: "small" }) : k(ve, { iconKey: "ArrowDownward", size: "small" }), "Scroll " + (e.orientation === ot.Horizontal ? "Right" : "Down"), `Scroll ${e.orientation === ot.Horizontal ? "right" : "down"}, 'Ctrl+Click' to scroll to the end`), ti = ie(ce((e, r) => {
36
- const { orientation: n = "vertical", sx: t, ...a } = e, s = n === "vertical";
37
- return k(Er, { ref: r, sx: { marginLeft: s ? "1px" : void 0, marginRight: s ? "1px" : void 0, backgroundColor: "transparent !important", borderColor: (i) => i.palette.divider, ...t }, orientation: n, variant: "middle", flexItem: !0, ...a });
38
- }));
39
- function Kt(e, r) {
40
- if (typeof e == "function") return e(r);
41
- e && (e.current = r);
42
- }
43
- var At = parseInt(Mo.split(".")[0], 10) >= 19 ? function(e) {
44
- return (r) => {
45
- const n = [];
46
- for (const t of e) {
47
- const a = Kt(t, r), s = typeof a == "function";
48
- n.push(s ? a : () => Kt(t, null));
49
- }
50
- return () => {
51
- for (const t of n) t();
52
- };
53
- };
54
- } : function(e) {
55
- return (r) => {
56
- for (const n of e) Kt(n, r);
57
- };
58
- }, ni = function() {
59
- }, _r = typeof window < "u";
60
- function Ar(e) {
61
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
62
- }
63
- function Ir(e) {
64
- if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
65
- var r = e.default;
66
- if (typeof r == "function") {
67
- var n = function t() {
68
- var a = !1;
69
- try {
70
- a = this instanceof t;
71
- } catch {
72
- }
73
- return a ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
74
- };
75
- n.prototype = r.prototype;
76
- } else n = {};
77
- return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(t) {
78
- var a = Object.getOwnPropertyDescriptor(e, t);
79
- Object.defineProperty(n, t, a.get ? a : { enumerable: !0, get: function() {
80
- return e[t];
81
- } });
82
- }), n;
83
- }
84
- var Vr = _r ? Cr : ke, Cn = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
85
- const En = _r && window.ResizeObserver !== void 0 ? function() {
86
- var e = te(null), r = e[0], n = e[1], t = te(Cn), a = t[0], s = t[1], i = ee(function() {
87
- return new window.ResizeObserver(function(l) {
88
- if (l[0]) {
89
- var o = l[0].contentRect, c = o.x, p = o.y, x = o.width, m = o.height, b = o.top, v = o.left, y = o.bottom, f = o.right;
90
- s({ x: c, y: p, width: x, height: m, top: b, left: v, bottom: y, right: f });
91
- }
92
- });
93
- }, []);
94
- return Vr(function() {
95
- if (r) return i.observe(r), function() {
96
- i.disconnect();
97
- };
98
- }, [r]), [n, a];
99
- } : function() {
100
- return [ni, Cn];
101
- }, ri = "_traverse-ellipsis_14l1h_1", os = ie((e) => {
102
- const { sx: r, speed: n = 2, size: t = 70, ...a } = e;
103
- return k(X, { sx: { width: `${t}px`, height: `${t}px`, zIndex: 1, "& .primary": { stroke: (s) => s.palette.grey[600], fill: "none" }, ...r }, ...a, children: Z("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [k("circle", { className: "primary", strokeWidth: "4", cx: "50", cy: "50", r: "48" }), k("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "85", y2: "50.5", children: k("animateTransform", { attributeName: "transform", dur: `${n}s`, type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) }), k("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "49.5", y2: "74", children: k("animateTransform", { attributeName: "transform", dur: 7.5 * n + "s", type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) })] }) });
104
- }), oi = ie((e) => {
105
- const { sx: r, speed: n = 1.5, size: t = 70, ...a } = e;
106
- return k(X, { sx: { width: `${t}px`, height: `${t}px`, zIndex: 1, "& .primary": { fill: (s) => s.palette.grey[600] }, "& .secondary": { stroke: (s) => s.palette.grey[600], fill: "none", opacity: 0.5 }, ...r }, ...a, children: Z("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [k("circle", { className: "secondary", strokeWidth: "4", cx: "50", cy: "50", r: "21" }), k("path", { className: "primary", d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50", children: k("animateTransform", { attributeName: "transform", type: "rotate", dur: 1 * n + "s", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) })] }) });
107
- }), is = ie((e) => {
108
- const { sx: r, speed: n = 1, size: t = 70, ...a } = e;
109
- return k(X, { sx: { width: `${t}px`, height: `${t}px`, zIndex: 1, ...r }, ...a, children: Z("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [k("circle", { className: "primary", cx: "6", cy: "50", r: "6", children: k("animate", { attributeName: "opacity", dur: `${n}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.1" }) }), k("circle", { className: "primary", cx: "26", cy: "50", r: "6", children: k("animate", { attributeName: "opacity", dur: `${n}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.2" }) }), k("circle", { className: "primary", cx: "46", cy: "50", r: "6", children: k("animate", { attributeName: "opacity", dur: `${n}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.3" }) })] }) });
110
- }), as = ie((e) => {
111
- const { sx: r, speed: n = 1, size: t = 70, ...a } = e;
112
- return k(X, { sx: { width: `${t}px`, height: `${t}px`, zIndex: 1, "& .primary": { fill: (s) => s.palette.grey[600], stroke: "none" }, ...r }, ...a, children: Z("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [k("circle", { className: "primary", cx: "6", cy: "50", r: "6", children: k("animateTransform", { attributeName: "transform", dur: `${n}s`, type: "translate", values: "0 15 ; 0 -15; 0 15", repeatCount: "indefinite", begin: "0.1" }) }), k("circle", { className: "primary", cx: "30", cy: "50", r: "6", children: k("animateTransform", { attributeName: "transform", dur: `${n}s`, type: "translate", values: "0 10 ; 0 -10; 0 10", repeatCount: "indefinite", begin: "0.2" }) }), k("circle", { className: "primary", cx: "54", cy: "50", r: "6", children: k("animateTransform", { attributeName: "transform", dur: `${n}s`, type: "translate", values: "0 5 ; 0 -5; 0 5", repeatCount: "indefinite", begin: "0.3" }) })] }) });
113
- }), ss = ie((e) => {
114
- const { sx: r, speed: n = 2, size: t = 70, ...a } = e;
115
- return k(X, { sx: { width: `${t}px`, height: `${t}px`, zIndex: 1, "& .primary": { stroke: (s) => s.palette.grey[600], opacity: 0.5, fill: "none" }, "& .secondary": { fillOpacity: (s) => s.palette.grey[600], opacity: 0.8, stroke: (s) => s.palette.background.paper }, ...r }, ...a, children: Z("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [k("circle", { className: "primary", strokeWidth: "4", cx: "50", cy: "50", r: "44" }), k("circle", { className: "secondary", strokeWidth: "3", cx: "8", cy: "54", r: "6", children: k("animateTransform", { attributeName: "transform", dur: `${n}s`, type: "rotate", from: "0 50 48", to: "360 50 52", repeatCount: "indefinite" }) })] }) });
116
- }), ls = ie((e) => {
117
- const { sx: r, speed: n = 1, size: t = 13, width: a = 64, height: s = 17, ...i } = e;
118
- return Z(X, { sx: { width: `${a}px`, height: `${s}px`, "& .primary": { backgroundColor: (l) => l.palette.grey[600], top: `${(s - t) / 2}px`, width: () => `${t}px`, height: () => `${t}px` }, ...r }, className: De(ri, "animated-icon"), ...i, children: [k("div", { className: "primary" }), k("div", { className: "primary" }), k("div", { className: "primary" }), k("div", { className: "primary" })] });
119
- }), ii = k(oi, {}), ai = ie(ce((e, r) => {
120
- const { sx: n, style: t, onMount: a, onUnmount: s, transitionDelay: i = "1200ms", panel: l = !1, transparentBackground: o = !0, icon: c = ii, label: p, ...x } = e, m = ee(() => typeof p == "string" ? k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em" }, children: p }) : p, [p]), b = me(null), v = ee(() => {
121
- let h = Z(X, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "8px" }, children: [m, c] });
122
- return l === !0 && (h = k(Ot, { elevation: 0, sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", alignSelf: "center", marginBottom: "5%", backgroundColor: (u) => u.palette.info.light, color: (u) => u.palette.info.contrastText, paddingLeft: (u) => u.spacing(2), paddingRight: (u) => u.spacing(2), paddingTop: (u) => u.spacing(2), paddingBottom: (u) => u.spacing(1), rowGap: (u) => u.spacing(1), borderRadius: (u) => `${u.shape.borderRadius}px`, boxShadow: (u) => u.shadows[2], "& .primary": { background: (u) => `${he(u.palette.info.contrastText, 0.9)} !important`, boxShadow: (u) => `0 0 0 1px ${u.palette.mode === "dark" ? u.palette.text.secondary : u.palette.divider}`, boxSizing: "content-box", border: "solid transparent" }, zIndex: 1 }, children: h })), k(X, { ref: At([b, r]), className: "animatable", sx: { cursor: "wait", boxSizing: "border-box", alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "column", willChange: "opacity", opacity: o ? 1e-3 : 1, transitionProperty: "opacity", transitionDelay: i, transitionDuration: "320ms", transitionTimingFunction: "ease-in", overflow: "hidden", outline: "none", width: "100%", height: "100%", minWidth: 0, minHeight: 0, zIndex: 99999, "&.animating": { opacity: 1 }, "&.animating-exit": { opacity: 0, transition: "opacity 210ms" }, ...n, ...t }, ...x, children: Z(X, { className: "center", sx: { display: "flex", flex: "1 1 100%", height: "100%", width: "100%", alignItems: "center", justifyContent: "center", boxSizing: "border-box", position: "relative" }, children: [k(X, { className: "backdrop", sx: { opacity: (u) => o ? 1.5 * u.palette.action.disabledOpacity : void 0, background: (u) => o ? void 0 : u.palette.background.paper, backdropFilter: "blur(4px)", borderRadius: (u) => `${u.shape.borderRadius}px`, zIndex: -1, position: "absolute", width: "100%", height: "100%", boxSizing: "border-box" } }), h] }) });
123
- }, [n, l]), y = me(!1), f = me(!1);
124
- return Vr(() => {
125
- if (b.current && !y.current && !f.current) {
126
- if (f.current = !0, b.current.classList.contains("animatable") && !b.current.classList.contains("animating")) {
127
- let h = !1;
128
- const u = () => {
129
- f.current && (y.current = !0, f.current = !1, h = !0, a?.());
130
- };
131
- b.current && b.current.addEventListener("transitionrun", u, { once: !0, capture: !0, passive: !0 }), f.current && b.current && (window.getComputedStyle(b.current, null).opacity, b.current.classList.add("animating")), setTimeout(() => {
132
- !h && f.current && b.current && (b.current?.removeEventListener("transitionrun", u), u());
133
- }, 100);
134
- } else y.current = !0, f.current = !1, a?.();
135
- return () => {
136
- };
137
- }
138
- }, [b.current]), ke(() => () => {
139
- y.current && (b.current?.classList.remove("animating"), y.current = !1, f.current = !1, s?.());
140
- }, []), v;
141
- }));
142
- ai.displayName = "LoadingPanel";
143
- const si = /^\s*at\s+(?:(async|new|await)\s+)?(.+?)\s+\((.+?):(\d+):(\d+)\)$/, li = /^\s*at\s+(?:(async|new|await)\s+)?(.+?):(\d+):(\d+)\s*$/, Mn = (e) => {
144
- if (!e) return "";
145
- try {
146
- e = new URL(e).pathname;
147
- } catch {
148
- }
149
- return e = (e = e.replace(/^\/+/, "")).replace(/^@?fs[\\/]/, "");
150
- }, Lr = ie(({ error: e, maxLines: r = Number.MAX_SAFE_INTEGER, hideLineNumbers: n = !1 }) => {
151
- const [t, a] = te(null);
152
- if (!e?.stack) return null;
153
- const s = ((c) => {
154
- const p = [], x = (m, b = 0) => {
155
- m && (p.push({ error: m, depth: b }), m.cause && m.cause instanceof Error && x(m.cause, b + 1));
156
- };
157
- return x(c), p.reverse();
158
- })(e).reverse(), i = [];
159
- s.forEach(({ error: c }, p) => {
160
- const x = (c.stack || "").split(`
161
- `).filter(Boolean).map((m) => {
162
- let b = m.match(si);
163
- if (b) {
164
- const [, v = "", y, f, h, u] = b;
165
- return { line: `at ${v ? v + " " : ""}${y}`, location: `${Mn(f).split(/[\\/]/).pop()}:${h}:${u}` };
166
- }
167
- if (b = m.match(li), b) {
168
- const [, v = "", y, f, h] = b, u = Mn(y), w = `${u.split(/[\\/]/).pop()}:${f}:${h}`;
169
- return { line: `at ${v ? v + " " : ""}${w}`, location: u !== w ? `${u}:${f}:${h}` : void 0 };
170
- }
171
- return { line: m.trim() };
172
- });
173
- x.length && (i.push({ line: p ? `Caused by: ${x[0].line}` : x[0].line, isBoundary: !0 }), i.push(...x.slice(1)));
174
- });
175
- const l = r ? i.slice(0, r) : i, o = r && i.length > r;
176
- return Z(X, { sx: { width: "100%", mt: 1 }, children: [Z(X, { sx: { display: "flex", alignItems: "center", gap: 1, borderRadius: 1, px: 1, py: 0.5 }, children: [Z(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", opacity: 0.8 }, children: ["Stack Trace(", s.length > 1 ? ` (${s.length} frames)` : "", ")"] }), k(X, { sx: { flex: 1 } }), t && k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.8 }, children: t }), k(Qe, { size: "small", onClick: async () => {
177
- try {
178
- let c = 0;
179
- const p = i.map((x) => {
180
- if (x.isBoundary) return c = 0, x.line;
181
- c++;
182
- let m = x.location && x.line !== x.location ? `${x.line} (${x.location})` : x.line;
183
- return c >= 1 && (m = ` ${m}`), m;
184
- }).join(`
185
- `);
186
- await navigator.clipboard.writeText(p), a("Copied!"), setTimeout(() => a(null), 2e3);
187
- } catch (c) {
188
- a("Can't copy!"), console.warn("Failed to copy stack trace:", c);
189
- }
190
- }, sx: { color: "inherit", opacity: 0.7, "&:hover": { opacity: 1 } }, title: "Copy stack trace", children: k(ve, { iconKey: "ContentCopy", style: { fontSize: "0.875rem" } }) }), k(Qe, { size: "small", onClick: () => {
191
- a("Logged!"), setTimeout(() => a(null), 2e3), console.log(e);
192
- }, sx: { color: "inherit", opacity: 0.7, "&:hover": { opacity: 1 } }, title: "Log error to console", children: k(ve, { iconKey: "BugReport", style: { fontSize: "0.875rem" } }) })] }), Z(X, { sx: { mt: 1, backgroundColor: "rgba(0, 0, 0, 0.2)", borderRadius: 1, p: 1, maxHeight: "300px", overflow: "auto", fontFamily: "monospace", fontSize: "0.75rem", lineHeight: 1.4 }, children: [l.map((c, p) => c.isBoundary ? k(X, { sx: { py: 1, mt: p > 0 ? 1 : 0, mb: 0.5, borderTop: p > 0 ? "1px solid rgba(255, 255, 255, 0.1)" : "none" }, children: k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", fontWeight: "bold", color: (x) => c.isBoundary ? x.palette.text.primary : x.palette.text.secondary, display: "block" }, children: c.line }) }, `error-${p}`) : Z(X, { sx: { display: "flex", alignItems: "flex-start", gap: 1, py: 0.25, pl: 1, "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.05)" } }, children: [!n && k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.5, minWidth: "20px", textAlign: "right", userSelect: "none" }, children: p + 1 }), Z(X, { sx: { flex: 1, overflow: "hidden" }, children: [k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", color: "inherit" }, children: c.line }), c.location && c.line !== c.location && k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic" }, children: c.location })] })] }, `stack-${p}`)), o && Z(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic", textAlign: "center", display: "block", mt: 1 }, children: ["... and ", i.length - r, " more frames"] })] })] });
193
- });
194
- Lr.displayName = "StackTrace";
195
- const ci = (e, r = !1, n = !1) => {
196
- if (Q.isValidElement(e)) return e;
197
- if (e instanceof Error) return Z(X, { sx: { display: "flex", flexDirection: "column", maxWidth: "500px", width: "100%" }, children: [k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, mb: 1 }, children: e.message }), e.cause ? Z(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", mb: 1, opacity: 0.8 }, children: ["Caused by: ", e.cause instanceof Error ? e.cause.message : String(e.cause)] }) : null, !r && k(Lr, { error: e, hideLineNumbers: !0 })] });
198
- const t = e === "string" ? e : `Unknown Error: ${String(e)}`;
199
- return k(Ce, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em" }, children: t });
200
- }, ui = ie(ce((e, r) => {
201
- const { sx: n, icon: t = k(ve, { iconKey: "Error", style: { fontSize: 48 } }), error: a, hideStackTrace: s = !1, stackTraceExpanded: i = !1, ...l } = e, o = ee(() => ci(a, s, i), [a, s, i]);
202
- return ee(() => k(X, { ref: r, sx: { boxSizing: "border-box", alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "row", overflow: "hidden", width: "100%", height: "100%", ...n }, ...l, children: Z(X, { sx: { display: "flex", flex: "1 1 100%", height: "100%", alignItems: "center", justifyContent: "center", boxSizing: "border-box", position: "relative" }, children: [k(X, { className: "backdrop", sx: { backdropFilter: "blur(4px)", borderRadius: (c) => `${c.shape.borderRadius}px`, zIndex: -1, position: "absolute", width: "100%", height: "100%", boxSizing: "border-box" } }), k(Ot, { elevation: 0, sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", rowGap: "8px", alignSelf: "center", marginBottom: "5%", backgroundColor: (c) => c.palette.error.light, color: (c) => c.palette.error.contrastText, paddingLeft: (c) => c.spacing(2), paddingRight: (c) => c.spacing(2), paddingTop: (c) => c.spacing(2), paddingBottom: (c) => c.spacing(2), borderRadius: (c) => `${c.shape.borderRadius}px`, boxShadow: (c) => c.shadows[2], "& .primary": { background: (c) => `${c.palette.error.contrastText} !important`, border: "solid transparent" }, zIndex: 1 }, children: k(X, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: (c) => c.spacing(2), width: "100%", maxWidth: "600px" }, children: Z(X, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-start", gap: (c) => c.spacing(2) }, children: [t, o] }) }) })] }) }), [n]);
203
- }));
204
- ui.displayName = "ErrorPanel";
205
- const Br = ie(ce((e, r) => {
206
- const { chips: n, sx: t, ...a } = e, s = Q.useMemo(() => {
207
- if (!n) return null;
208
- let i = null;
209
- i = Array.isArray(n) ? n : [n];
210
- const l = [];
211
- for (let o = 0; o < i.length; o++) {
212
- const c = i[o];
213
- let p = null;
214
- typeof c == "string" ? p = k(Vo, { label: c, color: "primary", size: "small", sx: { scale: "0.8" } }, "chip-" + o) : Q.cloneElement(c, { key: "chip-" + o }), l.push(p);
215
- }
216
- return l;
217
- }, [n]);
218
- return k(X, { ref: r, sx: { display: "flex", flexDirection: "row", marginLeft: "4px", gap: "2px", ...t }, ...a, children: s });
219
- }));
220
- var Zt = "top", Rt = "bottom", en = "right", jr = "left", di = [Zt, Rt, en, jr], $r = "viewport", dt = "popper";
221
- function tt(e) {
222
- return e ? (e.nodeName || "").toLowerCase() : null;
223
- }
224
- function ze(e) {
225
- if (e == null) return window;
226
- if (e.toString() !== "[object Window]") {
227
- var r = e.ownerDocument;
228
- return r && r.defaultView || window;
229
- }
230
- return e;
231
- }
232
- function at(e) {
233
- return e instanceof ze(e).Element || e instanceof Element;
234
- }
235
- function st(e) {
236
- return e instanceof ze(e).HTMLElement || e instanceof HTMLElement;
237
- }
238
- function dn(e) {
239
- return typeof ShadowRoot < "u" && (e instanceof ze(e).ShadowRoot || e instanceof ShadowRoot);
240
- }
241
- var vt = Math.max, Tn = Math.min, Pn = Math.round;
242
- function tn() {
243
- var e = navigator.userAgentData;
244
- return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(r) {
245
- return r.brand + "/" + r.version;
246
- }).join(" ") : navigator.userAgent;
247
- }
248
- function zr() {
249
- return !/^((?!chrome|android).)*safari/i.test(tn());
250
- }
251
- function pn(e, r, n) {
252
- r === void 0 && (r = !1), n === void 0 && (n = !1);
253
- var t = e.getBoundingClientRect(), a = 1, s = 1;
254
- r && st(e) && (a = e.offsetWidth > 0 && Pn(t.width) / e.offsetWidth || 1, s = e.offsetHeight > 0 && Pn(t.height) / e.offsetHeight || 1);
255
- var i = (at(e) ? ze(e) : window).visualViewport, l = !zr() && n, o = (t.left + (l && i ? i.offsetLeft : 0)) / a, c = (t.top + (l && i ? i.offsetTop : 0)) / s, p = t.width / a, x = t.height / s;
256
- return { width: p, height: x, top: c, right: o + p, bottom: c + x, left: o, x: o, y: c };
257
- }
258
- function Ge(e) {
259
- return ze(e).getComputedStyle(e);
260
- }
261
- function pi(e) {
262
- return ["table", "td", "th"].indexOf(tt(e)) >= 0;
263
- }
264
- function it(e) {
265
- return ((at(e) ? e.ownerDocument : e.document) || window.document).documentElement;
266
- }
267
- function zt(e) {
268
- return tt(e) === "html" ? e : e.assignedSlot || e.parentNode || (dn(e) ? e.host : null) || it(e);
269
- }
270
- function Rn(e) {
271
- return st(e) && Ge(e).position !== "fixed" ? e.offsetParent : null;
272
- }
273
- function fi(e) {
274
- for (var r = ze(e), n = Rn(e); n && pi(n) && Ge(n).position === "static"; ) n = Rn(n);
275
- return n && (tt(n) === "html" || tt(n) === "body" && Ge(n).position === "static") ? r : n || (function(t) {
276
- var a = /firefox/i.test(tn());
277
- if (/Trident/i.test(tn()) && st(t) && Ge(t).position === "fixed") return null;
278
- var s = zt(t);
279
- for (dn(s) && (s = s.host); st(s) && ["html", "body"].indexOf(tt(s)) < 0; ) {
280
- var i = Ge(s);
281
- if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || a && i.willChange === "filter" || a && i.filter && i.filter !== "none") return s;
282
- s = s.parentNode;
283
- }
284
- return null;
285
- })(e) || r;
286
- }
287
- function Wr(e) {
288
- var r = ze(e);
289
- return { scrollLeft: r.pageXOffset, scrollTop: r.pageYOffset };
290
- }
291
- function Nn(e) {
292
- return pn(it(e)).left + Wr(e).scrollLeft;
293
- }
294
- function Hr(e) {
295
- var r = Ge(e), n = r.overflow, t = r.overflowX, a = r.overflowY;
296
- return /auto|scroll|overlay|hidden/.test(n + a + t);
297
- }
298
- function Ur(e) {
299
- return ["html", "body", "#document"].indexOf(tt(e)) >= 0 ? e.ownerDocument.body : st(e) && Hr(e) ? e : Ur(zt(e));
300
- }
301
- function Yr(e, r) {
302
- var n;
303
- r === void 0 && (r = []);
304
- var t = Ur(e), a = t === ((n = e.ownerDocument) == null ? void 0 : n.body), s = ze(t), i = a ? [s].concat(s.visualViewport || [], Hr(t) ? t : []) : t, l = r.concat(i);
305
- return a ? l : l.concat(Yr(zt(i)));
306
- }
307
- function nn(e) {
308
- return Object.assign({}, e, { left: e.x, top: e.y, right: e.x + e.width, bottom: e.y + e.height });
309
- }
310
- function Fn(e, r, n) {
311
- return r === $r ? nn((function(t, a) {
312
- var s = ze(t), i = it(t), l = s.visualViewport, o = i.clientWidth, c = i.clientHeight, p = 0, x = 0;
313
- if (l) {
314
- o = l.width, c = l.height;
315
- var m = zr();
316
- (m || !m && a === "fixed") && (p = l.offsetLeft, x = l.offsetTop);
317
- }
318
- return { width: o, height: c, x: p + Nn(t), y: x };
319
- })(e, n)) : at(r) ? (function(t, a) {
320
- var s = pn(t, !1, a === "fixed");
321
- return s.top = s.top + t.clientTop, s.left = s.left + t.clientLeft, s.bottom = s.top + t.clientHeight, s.right = s.left + t.clientWidth, s.width = t.clientWidth, s.height = t.clientHeight, s.x = s.left, s.y = s.top, s;
322
- })(r, n) : nn((function(t) {
323
- var a, s = it(t), i = Wr(t), l = (a = t.ownerDocument) == null ? void 0 : a.body, o = vt(s.scrollWidth, s.clientWidth, l ? l.scrollWidth : 0, l ? l.clientWidth : 0), c = vt(s.scrollHeight, s.clientHeight, l ? l.scrollHeight : 0, l ? l.clientHeight : 0), p = -i.scrollLeft + Nn(t), x = -i.scrollTop;
324
- return Ge(l || s).direction === "rtl" && (p += vt(s.clientWidth, l ? l.clientWidth : 0) - o), { width: o, height: c, x: p, y: x };
325
- })(it(e)));
326
- }
327
- function hi(e) {
328
- var r = Yr(zt(e)), n = ["absolute", "fixed"].indexOf(Ge(e).position) >= 0 && st(e) ? fi(e) : e;
329
- return at(n) ? r.filter(function(t) {
330
- return at(t) && (function(a, s) {
331
- var i = s.getRootNode && s.getRootNode();
332
- if (a.contains(s)) return !0;
333
- if (i && dn(i)) {
334
- var l = s;
335
- do {
336
- if (l && a.isSameNode(l)) return !0;
337
- l = l.parentNode || l.host;
338
- } while (l);
339
- }
340
- return !1;
341
- })(t, n) && tt(t) !== "body";
342
- }) : [];
343
- }
344
- function mi(e, r) {
345
- r === void 0 && (r = {});
346
- var n, t = r, a = t.placement, s = a === void 0 ? e.placement : a, i = t.strategy, l = i === void 0 ? e.strategy : i, o = t.boundary, c = o === void 0 ? "clippingParents" : o, p = t.rootBoundary, x = p === void 0 ? $r : p, m = t.elementContext, b = m === void 0 ? dt : m, v = t.altBoundary, y = v !== void 0 && v, f = t.padding, h = f === void 0 ? 0 : f, u = (function(A) {
347
- return Object.assign({}, { top: 0, right: 0, bottom: 0, left: 0 }, A);
348
- })(typeof h != "number" ? h : (n = h, di.reduce(function(A, L) {
349
- return A[L] = n, A;
350
- }, {}))), w = b === dt ? "reference" : dt, E = e.rects.popper, T = e.elements[y ? w : b], B = (function(A, L, j, z) {
351
- var ne = L === "clippingParents" ? hi(A) : [].concat(L), K = [].concat(ne, [j]), q = K[0], ae = K.reduce(function(re, J) {
352
- var le = Fn(A, J, z);
353
- return re.top = vt(le.top, re.top), re.right = Tn(le.right, re.right), re.bottom = Tn(le.bottom, re.bottom), re.left = vt(le.left, re.left), re;
354
- }, Fn(A, q, z));
355
- return ae.width = ae.right - ae.left, ae.height = ae.bottom - ae.top, ae.x = ae.left, ae.y = ae.top, ae;
356
- })(at(T) ? T : T.contextElement || it(e.elements.popper), c, x, l), O = pn(e.elements.reference), R = (function(A) {
357
- var L, j = A.reference, z = A.element, ne = A.placement, K = ne ? (function(fe) {
358
- return fe.split("-")[0];
359
- })(ne) : null, q = ne ? (function(fe) {
360
- return fe.split("-")[1];
361
- })(ne) : null, ae = j.x + j.width / 2 - z.width / 2, re = j.y + j.height / 2 - z.height / 2;
362
- switch (K) {
363
- case Zt:
364
- L = { x: ae, y: j.y - z.height };
365
- break;
366
- case Rt:
367
- L = { x: ae, y: j.y + j.height };
368
- break;
369
- case en:
370
- L = { x: j.x + j.width, y: re };
371
- break;
372
- case jr:
373
- L = { x: j.x - z.width, y: re };
374
- break;
375
- default:
376
- L = { x: j.x, y: j.y };
377
- }
378
- var J = K ? (function(fe) {
379
- return ["top", "bottom"].indexOf(fe) >= 0 ? "x" : "y";
380
- })(K) : null;
381
- if (J != null) {
382
- var le = J === "y" ? "height" : "width";
383
- switch (q) {
384
- case "start":
385
- L[J] = L[J] - (j[le] / 2 - z[le] / 2);
386
- break;
387
- case "end":
388
- L[J] = L[J] + (j[le] / 2 - z[le] / 2);
389
- }
390
- }
391
- return L;
392
- })({ reference: O, element: E, placement: s }), S = nn(Object.assign({}, E, R)), D = b === dt ? S : O, P = { top: B.top - D.top + u.top, bottom: D.bottom - B.bottom + u.bottom, left: B.left - D.left + u.left, right: D.right - B.right + u.right }, M = e.modifiersData.offset;
393
- if (b === dt && M) {
394
- var I = M[s];
395
- Object.keys(P).forEach(function(A) {
396
- var L = [en, Rt].indexOf(A) >= 0 ? 1 : -1, j = [Zt, Rt].indexOf(A) >= 0 ? "y" : "x";
397
- P[A] += I[j] * L;
398
- });
399
- }
400
- return P;
401
- }
402
- const gi = { name: "maxSize", enabled: !0, phase: "main", requiresIfExists: ["offset", "preventOverflow", "flip"], fn: function(e) {
403
- var r = e.state, n = e.name, t = mi(r, e.options), a = r.modifiersData.preventOverflow || { x: 0, y: 0 }, s = a.x, i = a.y;
404
- let l = r.rects.popper, o = l.width, c = l.height, p = r.placement.split("-")[0], x = p === "left" ? "left" : "right", m = p === "top" ? "top" : "bottom";
405
- r.modifiersData[n] = { width: o - t[x] - s, height: c - t[m] - i };
406
- } }, yi = [0, 2], Kr = ie(ce((e, r) => {
407
- const { sx: n, open: t, children: a, label: s, offsets: i = yi, anchorEl: l, anchorPosition: o, onMount: c, onOpening: p, onOpen: x, onClosing: m, onClose: b, resizeOnOverflow: v = !0, ...y } = e;
408
- if (Array.isArray(a)) throw new Error("children can not be an array");
409
- const f = un(), h = { name: "applyMaxSize", enabled: !0, phase: "beforeWrite", requires: ["maxSize"], fn({ state: K }) {
410
- const { height: q } = K.modifiersData.maxSize;
411
- K.styles.popper.maxHeight = q - 10 + "px";
412
- } }, u = ee(() => {
413
- const K = [{ name: "offset", options: { offset: i } }, { name: "flip", enabled: !0, options: { rootBoundary: "document" } }];
414
- return v && K.unshift(gi, h), K;
415
- }, [v, i]), [w, E] = te(!1), T = Q.useRef(null), B = se(() => {
416
- c?.(I.current, T.current);
417
- }, [p]), O = se(p, [p]), R = se(x, [x]), S = se(m, [m]), D = se(() => {
418
- E(!1), b?.();
419
- }, [b]), [P, M] = te(!1), I = Q.useRef(null), A = Q.useRef(!0), L = ee(() => ({ onFirstUpdate: () => {
420
- A.current && (M(!0), B?.(), A.current = !1);
421
- } }), [t, w]);
422
- ke(() => {
423
- t && P ? O?.() : !t && w && S?.(), t && E(t);
424
- }, [t, P]);
425
- const j = ee(() => ({ getBoundingClientRect: () => o ? new DOMRect(o?.left || 0, o?.top || 0, 0, 0) : l.getBoundingClientRect() }), [o, l]);
426
- To(r, () => ({ instance: () => T.current, element: () => I.current }), []);
427
- const { getPortalContainer: z } = sn(), ne = ee(() => ({ zIndex: t ? "1300" : "1299", display: "flex", pointerEvents: w && t ? void 0 : "none", maxWidth: "100%", maxHeight: "100%", ...n }), [n, t, w]);
428
- return k(Lo, { ref: I, popperRef: T, container: z, anchorEl: j, open: w, role: void 0, popperOptions: L, transition: !0, sx: ne, placement: "bottom-start", modifiers: u, ...y, children: ({ TransitionProps: K, placement: q, ...ae }) => {
429
- const { in: re, onEnter: J, onExited: le, ...fe } = K ?? {};
430
- return k(Bo, { ...fe, in: t, onEnter: () => {
431
- J?.(), R();
432
- }, onExited: () => {
433
- le?.(), D();
434
- }, timeout: { enter: f.transitions.duration.shorter, exit: 0 }, style: { transformOrigin: q === "bottom-start" ? "left top" : "center bottom" }, children: typeof a == "function" ? a({ TransitionProps: K, placement: q, ...ae }) : a || {} });
435
- } });
436
- }));
437
- Kr.displayName = "ExhibitPopper";
438
- const cs = (e) => {
439
- if (e.palette.mode === "dark")
440
- return `drop-shadow(0px 0px 1px ${e.palette.mode === "dark" ? e.palette.text.primary : e.palette.divider})`;
441
- }, us = (e = 1) => (r) => {
442
- if (r.palette.mode !== "dark") return;
443
- const n = r.palette.mode === "dark" ? r.palette.text.primary : r.palette.divider;
444
- return `drop-shadow(0px 0px ${e}px ${n})`;
445
- }, Xr = (e) => k(ve, { ...e, iconKey: "ArrowDownOutline" }), bi = (e) => k(ve, { ...e, iconKey: "ArrowRightOutline" }), ds = Jo(ie(ce((e, r) => {
446
- const { sx: n, size: t = "small", activeColor: a, children: s, className: i, ...l } = e;
447
- let o = "1rem", c = "1rem";
448
- return t === "medium" ? (o = "1.25rem", c = "1.25rem") : t === "large" && (o = "1.5rem", c = "1.5rem"), k(X, { ref: r, className: De("icon", i), sx: { width: o, height: c, ...n }, ...l, children: s });
449
- })))(({ theme: e }) => ({ fill: "currentColor", "& .activeColor": { fill: e.palette.primary.main }, "& .styled.high_contrast": { fill: e.palette.primary.main }, "& .styled.background": { fill: e.palette.background.paper }, "& .styled.current_color": { fill: "currentColor" }, "& .styled.secondary": { fill: e.palette.secondary.main }, "& .styled.secondary_dark": { fill: e.palette.secondary.dark }, "& .styled.secondary_light": { fill: e.palette.secondary.light }, "& .styled.info": { fill: e.palette.info.main }, "& .styled.info.stroked": { stroke: e.palette.info.main }, "& .styled.info_dark": { fill: e.palette.info.dark }, "& .styled.info_light": { fill: e.palette.info.light }, "& .styled.warning": { fill: e.palette.warning.main }, "& .styled.warning.stroked": { stroke: e.palette.warning.main }, "& .styled.warning_dark": { fill: e.palette.warning.dark }, "& .styled.warning_light": { fill: e.palette.warning.light }, "& .styled.error.info": { fill: e.palette.error.main }, "& .styled.error.stroked": { stroke: e.palette.error.main }, "& .styled.error_dark": { fill: e.palette.error.dark }, "& .styled.error_light": { fill: e.palette.error.light }, "& .styled.success": { fill: e.palette.success.main }, "& .styled.success_dark": { fill: e.palette.success.dark }, "& .styled.success_light": { fill: e.palette.success.light }, "& .styled.grey": { fill: e.palette.text.icon ?? e.palette.action.active } })), vi = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, xi = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, wi = function(e, r = null) {
450
- if (!e) return e;
451
- e = e.replace(vi, function(t, a, s, i) {
452
- return a + a + s + s + i + i;
453
- });
454
- let n = xi.exec(e);
455
- return n ? r === null ? `rgb(${parseInt(n[1], 16)}, ${parseInt(n[2], 16)}, ${parseInt(n[3], 16)})` : `rgb(${parseInt(n[1], 16)} ${parseInt(n[2], 16)} ${parseInt(n[3], 16)} / ${100 * r}%)` : e;
456
- }, _n = function(e, r = 0.2, n = "light") {
457
- if (!e) return e;
458
- let t = n !== "dark";
459
- return r < 0 && (t = !t, r *= -1), e = wi(e), t ? Ao(e, Math.max(0, Math.min(1, 1 * r))) : Io(e, Math.max(0, Math.min(1, 1.5 * r)));
460
- }, ps = function(e) {
461
- let r = 0;
462
- return r = e < 1 ? 5.11916 * e ** 2 : 4.5 * Math.log(e + 1) + 2, (r / 100).toFixed(2);
463
- }, fs = (e, r) => {
464
- let n = On({ palette: { mode: e ? "dark" : "light" } });
465
- const t = { "--icon-primary": n.palette.primary.main, "--icon-secondary": n.palette.secondary.main, "--icon-secondary-light": n.palette.secondary.light, "--icon-success": n.palette.success.main, "--icon-success-light": n.palette.success.light, "--icon-info": n.palette.info.main, "--icon-warn": n.palette.warning.main, "--icon-error": n.palette.error.main, "--icon-error-light": n.palette.error.light, "--icon-grey": n.palette.text.icon ?? n.palette.action.active, "--icon-shadow": e ? n.palette.text.primary : n.palette.divider, "--icon-size": "1.25rem", "@media (pointer: coarse)": { "--icon-size": "1.75rem" } };
466
- let a = { typography: {}, palette: { mode: e ? "dark" : "light", text: { secondary: e ? n.palette.text.secondary : he(n.palette.text.secondary, 0.75), icon: e ? he(n.palette.text.secondary, 0.7) : he(n.palette.text.primary, 0.75) } }, components: { MuiDialogTitle: { styleOverrides: { root: { fontWeight: "normal" } } }, MuiSelect: { defaultProps: { IconComponent: Xr, MenuProps: { container: () => document.fullscreenElement ?? void 0 } }, styleOverrides: { iconOutlined: { top: "unset" } } }, MuiListItemIcon: { styleOverrides: { root: { minWidth: "0px !important", overflow: "hidden", marginLeft: "0px", marginRight: "6px", padding: "1px 1px", border: "solid transparent 1px", color: "unset" } } }, MuiMenuItem: { styleOverrides: { root: { paddingTop: "2px", paddingBottom: "2px", marginLeft: "4px", marginRight: "4px", paddingLeft: "6px", paddingRight: "18px", borderRadius: "4px", fontSize: "0.875em", "@media (pointer: coarse)": { fontSize: "1em" }, "&.Mui-selected": {} } } }, MuiMenu: { defaultProps: { container: () => document.fullscreenElement ?? void 0 }, styleOverrides: { root: { paddingTop: "2px", paddingBottom: "2px", marginLeft: "4px", marginRight: "4px", paddingLeft: "6px", paddingRight: "18px", borderRadius: "4px", fontSize: "0.875em", "@media (pointer: coarse)": { fontSize: "1em" }, "&.Mui-selected": {} } } }, MuiToolbar: { styleOverrides: { root: { paddingTop: "4px", paddingBottom: "4px", "@media (min-width: 600px)": { paddingTop: "4px", paddingBottom: "4px" } } } }, MuiDivider: { styleOverrides: { root: { marginTop: "4px !important", marginBottom: "4px !important", marginLeft: "0px", marginRight: "0px" } } }, MuiInputBase: { styleOverrides: { root: {} } }, MuiPaper: { styleOverrides: { root: { ...t } } }, MuiPopper: { styleOverrides: { root: { "& .menu": { marginTop: "4px", marginBottom: "4px", borderRadius: "4px" } } } }, SmartInputField: { styleOverrides: { automatic: { transition: "opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms", color: function() {
467
- return n.palette.text.secondary;
468
- } }, dirty: { fontStyle: "italic", color: function() {
469
- return n.palette.text.secondary;
470
- } } } } } }, s = a;
471
- return r && (s = Pr(a, r)), On(s);
472
- };
473
- function Gr(e, r) {
474
- r = Pr({ track: _n(e.palette.background.paper, 0.05, e?.palette.mode), thumb: _n(e.palette.background.paper, 0.3, e?.palette.mode), active: e.palette.primary.main, corner: e.palette.background.paper, outline: !1 }, r || {});
475
- const n = { "&::-webkit-scrollbar, & *::-webkit-scrollbar": { backgroundColor: he(r.track, 0.2), width: "13px", height: "13px" }, "&::-webkit-scrollbar-button": { display: "none" }, "& .scrollbar-button": { fill: r.thumb, backgroundColor: "transparent", transition: "fill opacity 260ms ease", width: "13px", height: "13px" }, "& .scrollbar-button:hover:not([disabled])": { fill: r.active }, "& .scrollbar-button:disabled": { opacity: 0.8 }, "&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {}, "&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {}, "&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": { borderRadius: 8, backgroundColor: r.thumb, minHeight: "24px", minWidth: "24px", border: `2px solid ${r.track}` }, "&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus": { backgroundColor: r.active, border: r.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active": { backgroundColor: r.active, border: r.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": { backgroundColor: r.active, border: r.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": { backgroundColor: r.corner || r.thumb } };
476
- return Pe.getOS() === Pe.OSType.Firefox && (n["* .pseudo-scrollbar"] = { scrollbarColor: `${r.thumb} transparent` }, n["* .pseudo-scrollbar:hover:not([disabled])"] = { scrollbarColor: `${r.active} transparent` }), n;
477
- }
478
- const hs = { Light: "light", Dark: "dark" };
479
- function ms(e) {
480
- const { mode: r } = e || {}, [n, t] = te(() => {
481
- if (r === "light" || r === "dark") return { themeMode: r, source: "prop" };
482
- if (typeof document < "u") {
483
- const a = An();
484
- if (a) return { themeMode: a, source: "class" };
485
- }
486
- return { themeMode: In(), source: "media" };
487
- });
488
- return ke(() => {
489
- const a = () => {
490
- if (r) return void (r === n.themeMode && n.source === "prop" || t((c) => ({ ...c, themeMode: r, source: "prop" })));
491
- const o = An();
492
- if (o) t({ themeMode: o, source: "class" });
493
- else {
494
- const c = In();
495
- t({ themeMode: c, source: "media" });
496
- }
497
- }, s = new MutationObserver(a), i = [document.documentElement, document.body].filter(Boolean);
498
- for (const o of i) s.observe(o, { attributes: !0, attributeFilter: ["class"] });
499
- const l = window.matchMedia("(prefers-color-scheme: dark)");
500
- return l.addEventListener("change", a), a(), () => {
501
- s.disconnect(), l.removeEventListener("change", a);
502
- };
503
- }, [r]), n;
504
- }
505
- function An() {
506
- if (typeof document > "u") return null;
507
- const e = [...Array.from(document.body.classList), ...document.documentElement ? Array.from(document.documentElement.classList) : []];
508
- return e.includes("dark") ? "dark" : e.includes("light") ? "light" : null;
509
- }
510
- function In() {
511
- return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
512
- }
513
- const gs = { Popup: "popup", Anchor: "anchor" }, ys = { ByPopup: "popupDone", Cancel: "popupCancel", ClickAway: "clickAway" }, ki = { Toolbar: "toolbar", Menuitem: "menuitem" }, fn = (e) => {
514
- const { closeFloat: r, closeFloatAll: n, floatReference: t, popupContainer: a, children: s, className: i, sx: l, ...o } = e;
515
- return k(X, { className: De("menu", i), sx: { display: "flex", flexDirection: "column", ...l }, ...o, children: s });
516
- }, Vn = (e, r, n) => {
517
- let t;
518
- return n && (t = (t ? t + " " : "") + "rotate(180deg)"), k(Xr, { style: { marginLeft: e ? void 0 : r ? "-0.25rem" : "-3px", marginRight: e ? void 0 : r ? "-0.25rem" : "-6px", transform: t }, color: "inherit" });
519
- }, qr = ie(ce((e, r) => {
520
- const { open: n, anchorEl: t, anchorPosition: a, label: s, floatReference: i, createPopupPanel: l = fn, popperProps: o, onMount: c, onClosing: p, onClose: x, onOpening: m, onOpen: b, children: v, sx: y, ...f } = e, h = se(p, [p]), u = se(x, [x]), w = se(m, [m]), E = se(b, [b]), [T, B] = te(), O = me(null), R = se((D, P) => {
521
- B(D), c?.(O.current, P);
522
- }, [c]), S = ee(() => {
523
- const D = { popupContainer: T, floatReference: i, children: v, ...f }, P = l(D);
524
- return k(Ot, { elevation: 8, ref: O, sx: { display: "flex", overflow: "auto", outline: "none", "&.MuiPaper-root": (M) => Gr(M) }, tabIndex: 0, children: P });
525
- }, [l, v, T, i]);
526
- return k(Kr, { ref: r, anchorEl: t, anchorPosition: a, label: s, open: n, onMount: R, onOpening: w, onOpen: E, onClosing: h, onClose: u, ...o, children: S });
527
- }));
528
- qr.displayName = "ExhibitFloatPanel";
529
- const Ue = /* @__PURE__ */ new Map();
530
- let Xt = null;
531
- const Ye = /* @__PURE__ */ new Map();
532
- let $e = null;
533
- const Gt = (e = null, r, n, t) => ($e && ($e.fn.clear(), $e = null), e === 0 ? r : (e === null && (e = 120), $e = { fn: Pe.debounce(() => r(), e), setReferences: n, isClose: t }, $e.fn)), Qr = (e, r) => {
534
- if (r === null) return;
535
- e.add(r);
536
- const n = Ue.get(r.key);
537
- if (!n) return;
538
- const t = Ye.get(n);
539
- t && Qr(e, t);
540
- }, Ln = (e) => {
541
- const r = /* @__PURE__ */ new Set();
542
- return Qr(r, e), r;
543
- }, Wt = (e) => {
544
- const { anchor: r, label: n = null, parentFloat: t = null, onOpen: a, onClose: s, popperProps: i, createPopupPanel: l = fn } = e ?? {}, o = se(a, [a]), c = se(s, [s]), [p, x] = te(null), [m, b] = te(!1), [v, y] = te(!1), f = ee(() => t === null ? (Xt === null && (Xt = { key: { label: "root" }, isRoot: !0, parent: null, open: () => null, close: (g) => null, closeChild: (g) => null, onChildVisible: () => {
545
- }, onChildHidden: () => {
546
- }, closeAll: () => j(0), floatElement: () => null, anchorElement: () => null }), Xt) : t, []), h = ee(() => ({ label: n }), []), u = Q.useRef(null), w = Q.useRef(r);
547
- ke(() => {
548
- w.current = r;
549
- }, [r]);
550
- const E = (g) => {
551
- const C = Ue.get(g);
552
- let N = null;
553
- return C && (N = Ye.get(C)?.close(0)), N;
554
- }, T = () => E(K.key), [B, O] = te(), R = () => {
555
- if (!p) return void M();
556
- const g = new Promise((C, N) => {
557
- O((_) => ({ resolve: C, reject: N }));
558
- });
559
- return T(), Ue.delete(f.key), x(!1), g;
560
- };
561
- ke(() => {
562
- B && (B.resolve(), O(null));
563
- }, [m, v, B]);
564
- const S = Re(() => {
565
- let g = f;
566
- for (; g.parent; ) g = g.parent;
567
- return E(g.key);
568
- }, []), D = () => {
569
- if (p) return void M();
570
- f && Ye.get(f.key)?.open(0);
571
- const g = Ue.get(f.key);
572
- g && g !== h && Ye.get(g)?.close(0), requestAnimationFrame(() => {
573
- Ue.set(f.key, K.key), x(!0);
574
- });
575
- }, [P, M] = Q.useReducer((g) => g + 1, 0), I = Re((g) => l === null ? null : l({ closeFloat: j, closeFloatAll: ne, ...g }), [l]), A = l === null, L = se((g = 120) => Gt(g, D, /* @__PURE__ */ new Set([K]), !1)(), [D]), j = se((g = 60) => Gt(g, R, Ln(K), !0)(), [R]), z = se((g = 360) => Gt(g, T, Ln(((C) => {
576
- const N = Ue.get(C.key);
577
- return N && Ye.get(N) || null;
578
- })(K)), !0)(), [T]), ne = se(S, [S]), K = ee(() => ({ key: h, isRoot: !1, label: n, parent: f, onChildVisible: () => {
579
- y(!0);
580
- }, onChildHidden: () => {
581
- y(!1);
582
- }, open: L, close: j, closeChild: z, closeAll: ne, floatElement: () => u.current, anchorElement: () => w.current }), []);
583
- ke(() => {
584
- Ye.set(h, K);
585
- }, [K]), ke(() => () => {
586
- Ye.delete(h), j(0);
587
- }, []), ke(() => {
588
- p && !A && (b(!0), f.onChildVisible());
589
- }, [p, A]);
590
- const q = Re((g) => {
591
- g.which === Ee.Escape && (g.preventDefault(), g.stopPropagation(), j(0));
592
- }, []), ae = Q.useRef(null), re = Re(() => {
593
- const g = ae.current, C = u.current;
594
- g && C && (requestAnimationFrame(() => {
595
- (C.contains(document.activeElement) || document.activeElement === document.body) && g.focus();
596
- }), ae.current = null), c?.();
597
- }, []), J = Re((g) => {
598
- u.current = g, g.addEventListener("focus", (N) => {
599
- ae.current = N.relatedTarget;
600
- }, { once: !0, passive: !0 });
601
- const C = document.activeElement;
602
- requestAnimationFrame(() => {
603
- C === document.activeElement && g.focus();
604
- });
605
- }, []), [le, fe] = te();
606
- ke(() => {
607
- A && (p ? o?.() : p === !1 && c?.()), fe(m ? k(qr, { floatReference: K, open: p, label: n, anchorEl: r, onOpening: () => {
608
- o?.(), f.onChildVisible();
609
- }, onClosing: re, onClose: () => {
610
- b(!1), f.onChildHidden();
611
- }, onMount: J, popperProps: { onKeyDown: q, onMouseEnter: (g) => {
612
- p && $e?.isClose && $e.setReferences.has(K) && ($e.fn.clear(), $e = null, K.closeChild());
613
- }, ...i }, createPopupPanel: I }) : null);
614
- }, [m, p, n, A, i, I, P]);
615
- const d = se((g) => {
616
- if (Ue.size === 0) return;
617
- let C = !1;
618
- Ue.forEach((N) => {
619
- const _ = Ye.get(N);
620
- if (C || !_) return;
621
- _.floatElement()?.contains?.(g.target) && (C = !0), _.anchorElement()?.contains?.(g.target) && (C = !0);
622
- }), C || S();
623
- }, [S]);
624
- return ke(() => {
625
- if (!p || !f.isRoot) return;
626
- const g = (C) => {
627
- d(C);
628
- };
629
- return document.addEventListener("mousedown", g), document.addEventListener("touchstart", g), document.addEventListener("focus", g), () => {
630
- document.removeEventListener("mousedown", g), document.removeEventListener("touchstart", g), document.removeEventListener("focus", g);
631
- };
632
- }, [p, f]), { component: le, reference: K };
633
- }, Si = ie(ce((e, r) => {
634
- const { nestedChildren: n, variant: t, disabled: a = !1, createPopupPanel: s, ...i } = e, l = { disabled: a, createPopupPanel: se((o) => {
635
- if (!n || n.length === 0) return null;
636
- const { popupContainer: c, floatReference: p, ref: x, ...m } = o, b = [];
637
- for (let v = 0; v < n.length; v++) {
638
- const y = n[v];
639
- y && b.push(k(Si, { parentFloat: p, ...m, ...y }, v));
640
- }
641
- return Z(X, { ref: r, sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: ["Children here", b, k(St, { parentFloat: p, children: "Close other children" })] });
642
- }, [n]), ...i };
643
- return k(t === ki.Toolbar ? hn : Zr, { ...l });
644
- })), Di = { placement: "right-start" }, bs = ie(ce((e, r) => {
645
- const { children: n, sx: t, parentFloat: a, createPopupPanel: s, popperProps: i = Di, label: l, ...o } = e;
646
- (function(f) {
647
- if (!f) throw new Error("Invariant failed");
648
- })(Q.isValidElement(n));
649
- const c = n, p = ee(() => ({ ...c?.props, ...o, onContextMenu: (f) => {
650
- c?.props?.onContextMenu?.(f), f.isDefaultPrevented() || (o?.onContextMenu?.(f), f.isDefaultPrevented() || (b(f), f.preventDefault()));
651
- } }), [o, c?.props]), x = se(s, [s]), [m, b] = Q.useState(null), { reference: v, component: y } = Wt({ label: l ?? "contextMenu", popperProps: i, parentFloat: a, anchor: { getBoundingClientRect: () => new DOMRect(m?.clientX || 0, m?.clientY || 0) }, onClose: () => b(null), createPopupPanel: x });
652
- return ke(() => {
653
- m ? v.open(0) : v.close(0);
654
- }, [m]), Z(qe, { children: [Q.cloneElement(n, p), y] });
655
- })), ct = ce((e, r) => {
656
- const { slotProps: n, ...t } = e, { getPortalContainer: a } = sn();
657
- return k(jo, { ref: r, slotProps: { ...n, popper: { container: a, ...n?.popper || {} } }, ...t });
658
- });
659
- ct.displayName = "SimpleTooltip";
660
- const pt = ie((e) => {
661
- const { modifier: r, sx: n, ...t } = e;
662
- return k(X, { sx: { marginLeft: "1px", marginRight: "1px", borderRadius: "4px", borderStyle: "solid", borderTopWidth: "1px", borderLeftWidth: "1px", borderRightWidth: "1px", borderBottomWidth: "2px", borderTopColor: (a) => he(a.palette.background.paper, a.palette.action.disabledOpacity), borderLeftColor: (a) => he(a.palette.background.paper, a.palette.action.disabledOpacity), borderRightColor: (a) => he(a.palette.background.paper, a.palette.action.disabledOpacity), borderBottomColor: (a) => he(a.palette.background.paper, 1 - a.palette.action.disabledOpacity), backgroundColor: (a) => he(a.palette.action.hover, a.palette.action.disabledOpacity), paddingLeft: "4px", paddingRight: "4px", minHeight: "1.6em", display: "flex", justifyContent: "center", alignItems: "center", boxSizing: "content-box", overflow: "hidden", ...n }, ...t, children: k(X, { sx: { display: "flex", alignItems: "center", justifyContent: "center", textAlign: "center", "& *": { fontWeight: "500" } }, children: r }) });
663
- }), Oi = Pe.getOS() === Pe.OSType.MacOS || Pe.getOS() === Pe.OSType.IOS ? "Cmd" : "Ctrl", Jr = (e, r = !1, n = null) => {
664
- if (Array.isArray(e)) {
665
- let s = [], i = e;
666
- for (let l = 0; l < i.length; l++) s.push(Jr(i[l], r, n ?? "" + l));
667
- return k(X, { sx: { display: "flex", alignItems: "center", flexDirection: "column" }, children: s }, n);
668
- }
669
- if (!e?.key) return null;
670
- const t = {};
671
- for (let s = 0; e.modifiers && s < e.modifiers.length; s++) t[e.modifiers[s]] = !0;
672
- const a = [];
673
- return t?.[Et.Ctrl] && (a.push(k(pt, { modifier: r ? "^" : k("div", { style: { paddingRight: "1px" }, children: Oi }) }, "ctrl")), a.push("+")), t?.[Et.Alt] && (a.push(k(pt, { modifier: r ? "⌥" : "Alt" }, "alt")), a.push("+")), t?.[Et.Shift] && (a.push(k(pt, { modifier: r ? "⇧" : k("div", { style: { paddingRight: "1px" }, children: "Shift" }) }, "shift")), a.push("+")), t?.[Et.Meta] && (a.push(k(pt, { modifier: r ? k("div", { style: { paddingTop: "1px" }, children: "⌘" }) : "Meta" }, "meta")), a.push("+")), a.push(k(pt, { modifier: Qo.toPrettyKeyCode(e.key) }, "character")), k(X, { sx: { display: "flex", alignItems: "center" }, children: a }, n);
674
- }, ut = ie(ce((e, r) => {
675
- const { disabled: n = !1, label: t, shortcut: a, chips: s, description: i, maxWidth: l = 280, useModifierSymbols: o = !1, children: c, simple: p, componentDisabled: x = !1, sx: m, ...b } = e;
676
- let v = null;
677
- a && (v = Jr(a, o));
678
- const [y, f] = te(null);
679
- return ke(() => {
680
- Promise.resolve(t).then((h) => {
681
- f(h);
682
- });
683
- }, [t]), k(ct, { slotProps: { popper: { sx: { "& .MuiTooltip-tooltip": { marginTop: "0px !important" }, ...m }, modifiers: [{ name: "offset", options: { offset: [0, 14] } }] } }, className: "tooltip-wrapper", tabIndex: -1, title: !n && y ? Z(X, { sx: { maxWidth: `${l}px` }, ref: r, children: [Z(X, { sx: { display: "flex", flexDirection: "row", marginBottom: i ? "4px" : "0px" }, children: [k(Ce, { variant: "subtitle1", component: "div", flex: "1 1 100%", children: y }), s ? k(Br, { chips: s }) : null, v ? k(X, { sx: { marginLeft: "8px" } }, "leadingSpace") : k(qe, {}), v] }), i ? k(Ce, { variant: "caption", sx: { whiteSpace: "pre-line", lineHeight: "1.4" }, children: i }) : k(qe, {})] }) : "", enterDelay: 260, enterNextDelay: 130, leaveDelay: 230, disableInteractive: !0, ...b, children: k("div", { style: { display: "flex", alignItems: "stretch", justifyContent: "stretch" }, children: c }) });
684
- })), Ci = k(ve, {}), Ei = k(ve, { iconKey: "Check" }), Ht = ie(ce((e, r) => {
685
- const { dense: n = !0, outlined: t = !1, disableHover: a = !1, parentFloat: s, selected: i, icon: l, tooltipProps: o, children: c, primary: p, sx: x, disabled: m, className: b, onFocus: v, onBlur: y, ...f } = e, [h, u] = te(!1), w = { marginRight: "0px", padding: n ? "2px" : "7px", borderRadius: (R) => `${R.shape.borderRadius}px`, color: (R) => p ? void 0 : R.palette.text.icon ?? R.palette.action.active, border: (R) => `solid ${t ? R.palette.divider : "transparent"} 1px`, "& .MuiTouchRipple-child": { borderRadius: (R) => `${R.shape.borderRadius}px !important` }, "&.Mui-selected": { backgroundColor: (R) => he(R.palette.text.primary, R.palette.action.selectedOpacity), border: (R) => `solid ${t ? R.palette.text?.primary : R.palette.divider} 1px` }, "&.Mui-disabled": { border: (R) => `solid ${t ? R.palette.divider : "transparent"} 1px` }, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)", opacity: ".8" }, "&.Mui-focusVisible": { outline: "solid transparent 1px", border: "1px solid transparent" }, ...x }, E = { "&:hover:not(.Mui-disabled, [disabled])": { color: (R) => R.palette.text.primary, border: (R) => `solid ${t ? R.palette.text?.primary : R.palette.divider} 1px`, "&.Mui-selected": { backgroundColor: (R) => he(R.palette.text.primary, R.palette.action.selectedOpacity + R.palette.action.hoverOpacity) }, "> .outline-hover": { outline: (R) => `solid ${t ? R.palette.text?.primary : R.palette.divider} 1px` }, backgroundColor: null }, "&.Mui-focusVisible": { outline: (R) => `solid ${R.palette.primary.main} 1px`, border: (R) => `1px solid ${R.palette?.primary?.main}`, zIndex: 1 } };
686
- let T = w;
687
- a || (T = Pe.mergeContentful(w, E));
688
- const B = ee(() => {
689
- let R = typeof l == "function" ? l() : l;
690
- return R === null ? R : R || (i === void 0 ? Ci : Ei);
691
- }, [l, i]);
692
- let O = Z(Qe, { component: "div", ref: r, className: De({ "Mui-focusVisible": h, "Mui-selected": i, "Mui-disabled": m }, b), onFocus: (R) => {
693
- u(!0), v?.(R);
694
- }, onBlur: (R) => {
695
- u(!1), y?.(R);
696
- }, size: "small", TouchRippleProps: { center: !1 }, sx: T, edge: "end", ...f, disabled: m || !1, children: [B, c] });
697
- if (o) if (o.simple && o.label && !o.disabled) {
698
- const { label: R, description: S, maxWidth: D, shortcut: P, useModifierSymbols: M, componentDisabled: I, simple: A, chips: L, ref: j, ...z } = o;
699
- O = k(ct, { disableInteractive: !0, title: R ?? "", ...z, children: k(X, { sx: { display: "flex" }, children: O }) });
700
- } else O = k(ut, { children: O, ...o });
701
- return O;
702
- })), Mi = k(ve, {}), Ti = (e) => e.icon, St = ie(ce((e, r) => {
703
- const { icon: n = Mi, renderIcon: t = Ti, parentFloat: a, className: s, onFocus: i, selected: l, onBlur: o, onMouseOver: c, onMouseOut: p, onMouseEnter: x, disabled: m, children: b, sx: v, tooltipProps: y, chips: f, primary: h, ...u } = e, [w, E] = te(!1), [T, B] = te(!1), O = ee(() => {
704
- const S = t?.({ icon: n, disabled: m, selected: l });
705
- return S ? k($o, { className: De({ "Mui-focusVisible": w, "Mui-hovered": T }), sx: { "& .MuiSvgIcon-root": { color: (D) => h ? void 0 : D.palette.text.icon ?? D.palette.action.active }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { "& .MuiSvgIcon-root": { color: (D) => D.palette.text.primary } } }, children: S }) : null;
706
- }, [t, m, n, w, T, h, l]);
707
- let R = Z(Mr, { ref: r, disabled: m, onMouseOver: (S) => {
708
- c?.(S), S.isDefaultPrevented() || B(!0);
709
- }, onMouseOut: (S) => {
710
- p?.(S), S.isDefaultPrevented() || B(!1);
711
- }, onMouseEnter: (S) => {
712
- x?.(S), S.isDefaultPrevented() || a?.closeChild();
713
- }, TouchRippleProps: { center: !1 }, className: De({ "Mui-focusVisible": w, "Mui-hovered": T }, s), onFocus: (S) => {
714
- i?.(S), E(!0);
715
- }, onBlur: (S) => {
716
- o?.(S), E(!1);
717
- }, sx: { flex: "1 1 100%", "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, "&.Mui-selected": { color: (S) => S.palette.text.primary }, color: (S) => S.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (S) => S.palette.text.primary }, ...v }, ...u, children: [O, b, f ? k(Br, { chips: f }) : null] });
718
- return y && (R = k(ut, { children: R, placement: "right-start", ...y })), R;
719
- })), vs = ie(ce((e, r) => {
720
- const { children: n, sx: t, primary: a = !1, variant: s = "subtitle1", ...i } = e;
721
- return k(qe, { children: k(Ce, { ref: r, variant: s, component: "div", sx: { userSelect: "none", fontWeight: "500", paddingLeft: "8px", paddingTop: s === "subtitle1" ? "2px" : void 0, paddingBottom: s === "subtitle1" ? "2px" : void 0, color: (l) => a ? void 0 : l.palette.text.secondary, ...t }, ...i, children: n }) });
722
- })), hn = ie(ce((e, r) => {
723
- const { dense: n = !0, outlined: t = !1, label: a, selected: s = !1, onQuickClick: i, parentFloat: l, createPopupPanel: o, popupProps: c, onPopupOpen: p, onPopupClose: x, quickButtonProps: m, createQuickButton: b, tooltip: v = "", createTooltip: y, icon: f, disabled: h, buttonProps: u = Pe.EmptyObject, disableHover: w, touchRippleRef: E, primary: T, children: B, sx: O, className: R, ...S } = e, D = un(), P = ee(() => {
724
- const G = (oe, ue, ge, Ae = ge) => {
725
- const V = typeof t == "boolean" ? null : t[oe];
726
- return typeof V == "function" ? V(ue) : V || (t ? ge : Ae);
727
- };
728
- return { outline: { color: (oe) => G("color", oe, oe.palette.divider, "transparent"), hoverColor: (oe) => G("hoverColor", oe, oe.palette.text?.primary, oe.palette.divider), focusColor: (oe) => G("focusColor", oe, oe.palette?.primary?.main) }, active: D.palette.mode === "dark" ? D.palette.text.secondary : D.palette.text.primary, text: D.palette.text.icon ?? D.palette.action.active };
729
- }, [t, D]), [M, I] = te(!1), [A, L] = te(!1), [j, z] = te(!1), ne = me(null), K = me(null), q = Wt({ anchor: ne.current, label: a, createPopupPanel: o, parentFloat: l, popperProps: c?.popperProps, onClose: () => {
730
- I(!1), x?.();
731
- }, onOpen: () => {
732
- I(!0), p?.();
733
- } }), ae = se((G) => {
734
- i?.(G), q.reference.close(0);
735
- }, [i, q]), re = se(() => {
736
- M ? q.reference.close(0) : q.reference.open(0);
737
- }, [M, q, l, a]), J = ee(() => {
738
- const G = { "&.bordered": { borderWidth: "1px", borderRadius: "0px", borderTopStyle: "solid", borderBottomStyle: "solid", borderColor: (W) => P.outline.color(W), "&.Mui-focusVisible": { border: (W) => `1px solid ${P.outline.focusColor(W)} !important` }, "&:hover:not(.Mui-disabled, [disabled])": { borderColor: () => w ? "transparent" : void 0, backgroundColor: () => w ? "transparent" : void 0 }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { borderColor: (W) => P.outline.hoverColor(W) }, "&.Mui-selected:not(.Mui-disabled, [disabled])": { borderColor: (W) => P.outline.hoverColor(W) }, "&.left": { borderTopLeftRadius: (W) => `${W.shape.borderRadius}px`, borderBottomLeftRadius: (W) => `${W.shape.borderRadius}px`, borderLeftStyle: "solid" }, "&.hard-right": { borderRightStyle: "solid", borderRightWidth: "1px", borderRightColor: (W) => P.outline.color(W) }, "&.right": { borderTopRightRadius: (W) => `${W.shape.borderRadius}px`, borderBottomRightRadius: (W) => `${W.shape.borderRadius}px`, borderRightStyle: "solid" }, "&.divider": { borderLeftWidth: "0px !important" } }, "& .MuiTouchRipple-child": { borderRadius: (W) => `${W.shape.borderRadius}px !important` } }, oe = { "&.Mui-selected": { backgroundColor: (W) => he(W.palette.primary.main, W.palette.action.selectedOpacity), "&:hover:not(.Mui-disabled)": { backgroundColor: (W) => he(W.palette.primary.main, W.palette.action.selectedOpacity + W.palette.action.hoverOpacity), "@media (hover: none)": { backgroundColor: (W) => he(W.palette.primary.main, W.palette.action.selectedOpacity) } } } }, ue = { maxHeight: "100%", "&.Mui-selected": { backgroundColor: (W) => he(W.palette.text.icon ?? W.palette.action.active, W.palette.action.selectedOpacity), "&:hover:not(.Mui-disabled)": { backgroundColor: (W) => he(W.palette.text.icon ?? W.palette.action.active, W.palette.action.selectedOpacity + W.palette.action.hoverOpacity), "@media (hover: none)": { backgroundColor: (W) => he(W.palette.text.icon ?? W.palette.action.active, W.palette.action.selectedOpacity) } } }, "&:hover:not(.Mui-disabled, [disabled])": { color: (W) => W.palette.text.primary }, backgroundColor: () => w ? "transparent" : void 0, color: (W) => W.palette.text.icon, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)", opacity: ".8" }, padding: () => n ? "2px 3px" : "7px", marginRight: "0" }, ge = Pe.mergeContentful(ue, G), Ae = Pe.mergeContentful(ge, oe), V = Pe.mergeContentful(ue, G);
739
- return { quickButtonStyling: ge, openQuickButtonStyling: Ae, compoundStyling: V, openCompoundStyling: Pe.mergeContentful(V, oe) };
740
- }, [P, w]), le = se((G) => {
741
- const { children: oe, ref: ue, ...ge } = G;
742
- return k(ct, { ref: ue, ...ge, disableInteractive: !0, children: oe });
743
- }, []), fe = i || b, d = fe && (m?.tooltip || m?.createTooltip), g = (G) => {
744
- const { tooltip: oe, createTooltip: ue, sx: ge, ...Ae } = G;
745
- let V = k(Qe, { sx: { ...ge }, component: "div", ...Ae });
746
- return d && (V = (ue ?? le)({ title: M ? "" : oe ?? v, children: k("div", { children: V }) }, M)), V;
747
- }, C = { onKeyDown: (G) => {
748
- G.keyCode === Ee.Space ? re() : G.keyCode === Ee.F4 || G.keyCode === Ee.Down ? q.reference.open(0) : G.keyCode === Ee.Up && q.reference.close(0);
749
- } };
750
- let N = k(qe, {});
751
- const _ = ee(() => typeof f == "function" ? f() : f, [f]);
752
- if (fe) {
753
- let G = M ? J.openQuickButtonStyling : J.quickButtonStyling;
754
- const oe = (b || g)({ tabIndex: -1, disabled: h, size: "small", edge: "end", onMouseEnter: () => {
755
- q.reference.parent.closeChild();
756
- }, onMouseDown: (ge) => {
757
- ge.button === 0 && (ge.preventDefault(), ae(ge));
758
- }, touchRippleRef: E, children: _, ...m, className: De({ "Mui-focusVisible": A || M, "Mui-selected": s, "Mui-hovered": j || M, "Mui-disabled": h, bordered: !0, left: !0, "hard-right": !0 }, m?.className), sx: { ...J.quickButtonStyling, height: "100%", ...m?.sx } });
759
- let ue = Vn(!0, n, M);
760
- d && (ue = (y ?? le)({ title: M ? "" : v, children: ue }, M)), N = Z(qe, { children: [oe, k(Qe, { ref: K, component: "div", className: De({ "Mui-selected": M, "Mui-hovered": j || M, "Mui-disabled": h, "Mui-focusVisible": A || M, bordered: !0, right: !0, divider: !0 }), sx: { paddingLeft: (n ? 0 : 2) + "px", paddingRight: (n ? 0 : 2) + "px", width: () => "calc(var(--icon-size, 1.25em) * 0.8)", ...J.quickButtonStyling, ...G }, TouchRippleProps: { center: !1 }, tabIndex: -1, disabled: h, size: "small", edge: "end", onMouseDown: (ge) => {
761
- ge.button === 0 && (ge.preventDefault(), re());
762
- }, children: ue })] });
763
- } else {
764
- let G = M ? J.openCompoundStyling : J.compoundStyling;
765
- N = k(Ht, { ref: K, tabIndex: -1, disabled: h, size: "small", icon: _, className: De({ "Mui-selected": M || s, "Mui-hovered": j, "Mui-disabled": h, "Mui-focusVisible": A || M, bordered: !0, left: !0, right: !0 }), sx: { ...J.quickButtonStyling, ...G }, onMouseDown: (oe) => {
766
- oe.button === 0 && (oe.preventDefault(), re());
767
- }, children: Vn(!1, n, M) });
768
- }
769
- const { className: F, sx: $, ...U } = u;
770
- let Y = k(X, { onFocus: () => L(!0), onBlur: () => L(!1), onMouseOver: () => z(!0), onMouseOut: () => z(!1), ...C, "aria-label": "split button", ref: ne, tabIndex: h ? void 0 : 0, className: De(F, "split-button-root", { "Mui-focusVisible": A || M, "Mui-selected": M || s, "Mui-hovered": j, "Mui-disabled": h }), sx: { display: "flex", flex: "1 1 100%", alignItems: "stretch", width: "fit-content", "&:not(.Mui-disabled)": { cursor: "pointer" }, marginLeft: t ? "1px" : "0px", marginRight: t ? "1px" : "0px", borderRadius: (G) => `${G.shape.borderRadius}px`, "&.Mui-focusVisible": { outline: (G) => `solid ${G.palette.primary.main} 1px`, zIndex: 2 }, ...$ }, ...U, children: N });
771
- return d || (Y = (y ?? le)({ title: M ? "" : v, children: Y }, M)), Z(X, { className: De(R, "popupIconButton"), ref: r, ...S, sx: { zIndex: A || M ? 2 : void 0, display: "flex", alignItems: "center", ...O }, children: [Y, q.component] });
772
- }));
773
- hn.displayName = "ExhibitPopupIconButton";
774
- const Pi = {}, Zr = ie(ce((e, r) => {
775
- const { selected: n = !1, label: t, onQuickClick: a, parentFloat: s, createPopupPanel: i, popupProps: l = Pi, onPopupOpen: o, onPopupClose: c, quickButtonProps: p, createQuickButton: x, tooltip: m = "", createTooltip: b, icon: v, disabled: y, touchRippleRef: f, primary: h, children: u, sx: w, ...E } = e, [T, B] = te(!1), [O, R] = te(!1), [S, D] = te(!1), [P, M] = te(!1), I = me(null), A = me(null), L = ee(() => {
776
- if (!l) return;
777
- const { popperProps: d } = l;
778
- return { placement: "right-start", offsets: [-4, -2], ...d };
779
- }, [l]), j = Wt({ anchor: I.current, label: t, createPopupPanel: i, parentFloat: s, popperProps: L, onClose: () => {
780
- B(!1), c?.();
781
- }, onOpen: () => {
782
- B(!0), o?.();
783
- } }), z = se((d) => {
784
- d.button === 0 && (a?.(d), j.reference.close(0));
785
- }, [a]), ne = k(bi, {}), K = { "&.Mui-selected": { color: (d) => d.palette.text.primary, "& svg * ": { color: (d) => d.palette.text.primary } } }, q = Re((d) => {
786
- const { children: g, ref: C, ...N } = d;
787
- return k(ct, { ref: C, ...N, disableInteractive: !0, children: g });
788
- }, []), ae = a || x, re = (d) => {
789
- const { tooltip: g, createTooltip: C, ...N } = d;
790
- return k(St, { icon: v, className: De({ "Mui-hovered": S }), sx: { flex: "1 1 100%", ...K }, ...N, children: t });
791
- }, J = { onFocus: () => {
792
- R(!0);
793
- }, onBlur: () => R(!1), onMouseOver: () => {
794
- D(!0);
795
- }, onMouseLeave: () => {
796
- D(!1);
797
- }, onMouseEnter: () => {
798
- j.reference.open();
799
- }, onMouseDown: (d) => {
800
- d.button === 0 && d.preventDefault();
801
- } };
802
- let le = k(qe, {});
803
- if (ae) {
804
- const d = (x || re)({ tabIndex: -1, disabled: y, onMouseEnter: () => {
805
- j.reference.parent.closeChild();
806
- }, onMouseDown: (g) => {
807
- g.button === 0 && (g.preventDefault(), z(g));
808
- }, className: De("quick-left", {}, p?.className), ...p });
809
- le = Z(qe, { children: [d, k(Er, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: !0 }), k(Mr, { ref: A, className: De({ "Mui-selected": T, "Mui-hovered": S }), sx: { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px", paddingLeft: "0px", paddingRight: "0px", marginLeft: "0px", color: (g) => h ? void 0 : g.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (g) => g.palette.text.primary }, ...K }, tabIndex: -1, disabled: y, ...J, children: k(X, { className: "expand-icon", sx: { flex: "none", display: "flex", border: "1px solid transparent", paddingTop: "1px", paddingBottom: "1px", color: (g) => h ? void 0 : g.palette.text.icon ?? g.palette.action.active }, onMouseOver: (g) => {
810
- g.preventDefault(), M(!0);
811
- }, onMouseLeave: () => {
812
- M(!1);
813
- }, onClick: (g) => {
814
- g.preventDefault(), T ? j.reference.close() : j.reference.open();
815
- }, children: ne }) })] });
816
- } else le = Z(St, { ref: A, tabIndex: -1, disabled: y, icon: v, className: De({ "Mui-selected": T || n, "Mui-hovered": S }), sx: { flex: "1 1 100%", paddingRight: "0px", ...K }, onClick: (d) => {
817
- d.preventDefault(), T ? j.reference.close() : j.reference.open();
818
- }, ...J, children: [k("div", { style: { flex: "1 1 100%" }, children: t }), k(X, { className: "expand-icon", sx: { flex: "none", display: "flex", color: (d) => h ? void 0 : d.palette.text.icon ?? d.palette.action.active }, children: ne })] });
819
- let fe = k(X, { "aria-label": "split button", ref: I, tabIndex: y ? void 0 : 0, className: De({ "Mui-disabled": y, "Mui-selected": T, "Mui-focusVisible": O || T, "Mui-hovered": S }), sx: { display: "flex", flex: "1 1 100%", alignItems: "center", width: "fit-content", "& .quick-left": { borderTopRightRadius: "0px", borderBottomRightRadius: "0px", marginRight: "-1px" }, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, ...w }, ...E, children: le });
820
- return ae && !P && (p?.tooltip || p?.createTooltip) && (fe = (p?.createTooltip ?? q)({ title: T ? "" : fe ?? p?.tooltip, children: fe }, T)), Z(X, { ref: r, sx: { zIndex: O || T ? 2 : void 0, display: "flex", " .tooltip-wrapper": { display: "flex", flex: "1 1 100%" } }, children: [fe, j.component] });
821
- })), xs = ie(ce((e, r) => {
822
- const { onSelectToggle: n, selected: t = !1, label: a, shortcut: s, tabIndex: i = 0, preventFocus: l = !1, ...o } = e;
823
- return k(ut, { label: a, shortcut: s, children: k(Ht, { ref: r, outlined: !1, tabIndex: i, selected: t, onMouseDown: (c) => {
824
- l && c.preventDefault();
825
- }, onClick: () => {
826
- n?.(!t);
827
- }, ...o }) });
828
- })), Ri = k(ve, {}), Ni = k(ve, { iconKey: "Check" }), Fi = ie(ce((e, r) => {
829
- const { children: n, selected: t = !0, outlined: a = !0, sx: s, ...i } = e;
830
- let l = n;
831
- return l === null && (l = Ri), l || (l = Ni), k(X, { ref: r, sx: { display: "flex", border: (o) => t ? `solid ${a ? o.palette.divider : "transparent"} 1px` : "solid transparent 1px", borderRadius: (o) => `${o.shape.borderRadius}px`, backgroundColor: (o) => {
832
- if (t) return he(o.palette.text.icon ?? o.palette.action.active, o.palette.action.selectedOpacity);
833
- }, ...s }, ...i, children: l });
834
- }));
835
- function Oe() {
836
- return Oe = Object.assign ? Object.assign.bind() : function(e) {
837
- for (var r = 1; r < arguments.length; r++) {
838
- var n = arguments[r];
839
- for (var t in n) ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
840
- }
841
- return e;
842
- }, Oe.apply(null, arguments);
843
- }
844
- function eo(e, r) {
845
- if (e == null) return {};
846
- var n = {};
847
- for (var t in e) if ({}.hasOwnProperty.call(e, t)) {
848
- if (r.indexOf(t) !== -1) continue;
849
- n[t] = e[t];
850
- }
851
- return n;
852
- }
853
- var Fe, _i = { state: {}, updateModal: function() {
854
- }, hideModal: function() {
855
- }, destroyModal: function() {
856
- }, destroyModalsByRootId: function() {
857
- }, showModal: function() {
858
- return { id: "id", hide: function() {
859
- }, destroy: function() {
860
- }, update: function() {
861
- } };
862
- } }, to = Po(void 0);
863
- (function(e) {
864
- e.SHOW = "SHOW", e.HIDE = "HIDE", e.UPDATE = "UPDATE", e.DESTROY = "DESTROY", e.DESTROY_BY_ROOT_ID = "DESTROY_BY_ROOT_ID", e.UNKNOWN = "UNKNOWN";
865
- })(Fe || (Fe = {}));
866
- var Ai = {};
867
- function Ii(e, r) {
868
- switch (r.type) {
869
- case Fe.SHOW:
870
- var n, t = r.payload, a = t.id, s = t.component, i = t.props, l = t.options;
871
- return Oe({}, e, ((n = {})[a] = { component: s, props: Oe({}, i, { open: !0 }), options: l }, n));
872
- case Fe.HIDE:
873
- var o, c = r.payload.id;
874
- return e[c] ? Oe({}, e, ((o = {})[c] = Oe({}, e[c], { props: Oe({}, e[c].props, { open: !1 }) }), o)) : e;
875
- case Fe.UPDATE:
876
- var p, x = r.payload, m = x.id, b = x.props;
877
- return e[m] ? Oe({}, e, ((p = {})[m] = Oe({}, e[m], { props: Oe({}, e[m].props, b) }), p)) : e;
878
- case Fe.DESTROY:
879
- var v = r.payload.id, y = Oe({}, e);
880
- return delete y[v], y;
881
- case Fe.DESTROY_BY_ROOT_ID:
882
- var f = r.payload.rootId;
883
- return Object.keys(e).filter(function(h) {
884
- return h.split(".")[0] !== f;
885
- }).reduce(function(h, u) {
886
- var w;
887
- return Oe({}, h, ((w = {})[u] = e[u], w));
888
- }, {});
889
- default:
890
- throw new Error("Unexpected action");
891
- }
892
- }
893
- var qt = "[ERROR]: Modal ID is missing", no = function(e) {
894
- e === void 0 && (e = 8);
895
- for (var r = [], n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", t = 0; t < e; t++) r[t] = n.charAt(Math.floor(62 * Math.random()));
896
- return r.join("");
897
- }, Vi = ["open"];
898
- function ws(e) {
899
- var r = e.children, n = e.legacy, t = n !== void 0 && n, a = e.suspense, s = a === void 0 || a, i = e.fallback, l = i === void 0 ? null : i, o = Q.useReducer(Ii, Ai), c = o[0], p = o[1], x = Q.useCallback(function(h, u) {
900
- var w = eo(u, Vi);
901
- h ? p({ type: Fe.UPDATE, payload: { id: h, props: w } }) : console.error(qt);
902
- }, [p]), m = Q.useCallback(function(h) {
903
- h ? p({ type: Fe.HIDE, payload: { id: h } }) : console.error(qt);
904
- }, [p]), b = Q.useCallback(function(h) {
905
- h ? p({ type: Fe.DESTROY, payload: { id: h } }) : console.error(qt);
906
- }, [p]), v = Q.useCallback(function(h) {
907
- h ? p({ type: Fe.DESTROY_BY_ROOT_ID, payload: { rootId: h } }) : console.error("[ERROR]: Modal root ID is missing");
908
- }, [p]), y = Q.useCallback(function(h, u, w) {
909
- var E = no(8);
910
- return w && w.rootId && (E = w.rootId + "." + E), p({ type: Fe.SHOW, payload: { id: E, component: h, props: u, options: w } }), { id: E, hide: function() {
911
- return m(E);
912
- }, destroy: function() {
913
- return b(E);
914
- }, update: function(T) {
915
- return x(E, T);
916
- } };
917
- }, [p, m, b, x]), f = s ? Ro : No;
918
- return Q.createElement(to.Provider, { value: { state: c, updateModal: x, hideModal: m, destroyModal: b, showModal: y, destroyModalsByRootId: v } }, r, Q.createElement(f, Object.assign({}, s && { fallback: l }), Object.keys(c).map(function(h) {
919
- var u = c[h], w = u.component, E = u.props, T = u.options, B = function() {
920
- var R, S;
921
- E != null && E.onExited && E.onExited.apply(E, arguments), E != null && (R = E.TransitionProps) != null && R.onExited && (S = E.TransitionProps).onExited.apply(S, arguments), b(h);
922
- }, O = {};
923
- return O = t ? { onExited: B } : { TransitionProps: Oe({}, E?.TransitionProps, { onExited: B }) }, Q.createElement(w, Object.assign({}, E, { key: h, onClose: function() {
924
- T && T.hideOnClose && m(h), T && T.destroyOnClose && T.hideOnClose && b(h), E && E.onClose && E.onClose.apply(E, arguments);
925
- } }, T && !T.destroyOnClose && O));
926
- })));
927
- }
928
- var ro = { enforceProvider: !1 };
929
- function ks(e) {
930
- Object.assign(ro, e);
931
- }
932
- function Li() {
933
- return ro;
934
- }
935
- var Bi = ["showModal", "destroyModalsByRootId"], Bn = { disableAutoDestroy: !1 };
936
- function mn(e) {
937
- e === void 0 && (e = Bn);
938
- var r = Oe({}, Bn, e).disableAutoDestroy, n = (function() {
939
- var l = Fo(to);
940
- if (Li().enforceProvider && l === void 0) throw new Error("useModalContext must be used within a ModalProvider");
941
- return l || _i;
942
- })(), t = n.showModal, a = n.destroyModalsByRootId, s = eo(n, Bi), i = me(no(6));
943
- return ke(function() {
944
- return function() {
945
- !r && a && a(i.current);
946
- };
947
- }, [r, a]), Oe({ showModal: Re(function(l, o, c) {
948
- return t(l, o, Oe({ rootId: i.current, hideOnClose: !0 }, c));
949
- }, [t]), destroyModalsByRootId: a }, s);
950
- }
951
- function Ss(e) {
952
- const [r, n] = te(() => /* @__PURE__ */ new Map()), { showModal: t, updateModal: a, destroyModal: s, hideModal: i } = mn({ disableAutoDestroy: !0 });
953
- return (l, o, c, p) => new Promise((x, m) => {
954
- const b = { ...e, ...c, onHide: () => {
955
- const h = r.get(l);
956
- c?.onHide?.(), n((u) => (u.delete(l), u)), i(h.id);
957
- }, onDone: (h) => {
958
- const u = r.get(l);
959
- n((w) => (w.delete(l), w)), c?.onDone?.(h), u && u.id && !p?.disableAutoDestroy && s(u.id);
960
- }, onShown: (h) => {
961
- n((u) => {
962
- const w = u.get(l);
963
- return u.set(l, { ...w, element: h }), u;
964
- }), x(h);
965
- }, open: !0 }, v = r.get(l);
966
- if (v) return a(v.id, b), void x(v.element);
967
- if (!o) return void m("invalid function");
968
- const y = Q.lazy(o), f = t(y, b, { destroyOnClose: !p?.disableAutoDestroy });
969
- n((h) => (h.set(l, { id: f.id, element: null }), h));
970
- });
971
- }
972
- var jn, $n, zn, Wn, Hn, Un = { exports: {} };
973
- function ji() {
974
- return $n ? jn : ($n = 1, jn = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
975
- }
976
- function $i() {
977
- if (Wn) return zn;
978
- Wn = 1;
979
- var e = ji();
980
- function r() {
981
- }
982
- function n() {
983
- }
984
- return n.resetWarningCache = r, zn = function() {
985
- function t(i, l, o, c, p, x) {
986
- if (x !== e) {
987
- var m = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
988
- throw m.name = "Invariant Violation", m;
989
- }
990
- }
991
- function a() {
992
- return t;
993
- }
994
- t.isRequired = t;
995
- var s = { array: t, bigint: t, bool: t, func: t, number: t, object: t, string: t, symbol: t, any: t, arrayOf: a, element: t, elementType: t, instanceOf: a, node: t, objectOf: a, oneOf: a, oneOfType: a, shape: a, exact: a, checkPropTypes: n, resetWarningCache: r };
996
- return s.PropTypes = s, s;
997
- };
998
- }
999
- function gn() {
1000
- return Hn || (Hn = 1, Un.exports = $i()()), Un.exports;
1001
- }
1002
- var oo = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], It = oo.join(","), io = typeof Element > "u", nt = io ? function() {
1003
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Nt = !io && Element.prototype.getRootNode ? function(e) {
1004
- var r;
1005
- return e == null || (r = e.getRootNode) === null || r === void 0 ? void 0 : r.call(e);
1006
- } : function(e) {
1007
- return e?.ownerDocument;
1008
- }, Vt = function e(r, n) {
1009
- var t;
1010
- n === void 0 && (n = !0);
1011
- var a = r == null || (t = r.getAttribute) === null || t === void 0 ? void 0 : t.call(r, "inert");
1012
- return a === "" || a === "true" || n && r && e(r.parentNode);
1013
- }, ao = function(e, r, n) {
1014
- if (Vt(e)) return [];
1015
- var t = Array.prototype.slice.apply(e.querySelectorAll(It));
1016
- return r && nt.call(e, It) && t.unshift(e), t = t.filter(n);
1017
- }, so = function e(r, n, t) {
1018
- for (var a = [], s = Array.from(r); s.length; ) {
1019
- var i = s.shift();
1020
- if (!Vt(i, !1)) if (i.tagName === "SLOT") {
1021
- var l = i.assignedElements(), o = e(l.length ? l : i.children, !0, t);
1022
- t.flatten ? a.push.apply(a, o) : a.push({ scopeParent: i, candidates: o });
1023
- } else {
1024
- nt.call(i, It) && t.filter(i) && (n || !r.includes(i)) && a.push(i);
1025
- var c = i.shadowRoot || typeof t.getShadowRoot == "function" && t.getShadowRoot(i), p = !Vt(c, !1) && (!t.shadowRootFilter || t.shadowRootFilter(i));
1026
- if (c && p) {
1027
- var x = e(c === !0 ? i.children : c.children, !0, t);
1028
- t.flatten ? a.push.apply(a, x) : a.push({ scopeParent: i, candidates: x });
1029
- } else s.unshift.apply(s, i.children);
1030
- }
1031
- }
1032
- return a;
1033
- }, lo = function(e) {
1034
- return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
1035
- }, Ke = function(e) {
1036
- if (!e) throw new Error("No node provided");
1037
- return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || (function(r) {
1038
- var n, t = r == null || (n = r.getAttribute) === null || n === void 0 ? void 0 : n.call(r, "contenteditable");
1039
- return t === "" || t === "true";
1040
- })(e)) && !lo(e) ? 0 : e.tabIndex;
1041
- }, zi = function(e, r) {
1042
- return e.tabIndex === r.tabIndex ? e.documentOrder - r.documentOrder : e.tabIndex - r.tabIndex;
1043
- }, co = function(e) {
1044
- return e.tagName === "INPUT";
1045
- }, Wi = function(e) {
1046
- return (function(r) {
1047
- return co(r) && r.type === "radio";
1048
- })(e) && !(function(r) {
1049
- if (!r.name) return !0;
1050
- var n, t = r.form || Nt(r), a = function(i) {
1051
- return t.querySelectorAll('input[type="radio"][name="' + i + '"]');
1052
- };
1053
- if (typeof window < "u" && window.CSS !== void 0 && typeof window.CSS.escape == "function") n = a(window.CSS.escape(r.name));
1054
- else try {
1055
- n = a(r.name);
1056
- } catch (i) {
1057
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", i.message), !1;
1058
- }
1059
- var s = (function(i, l) {
1060
- for (var o = 0; o < i.length; o++) if (i[o].checked && i[o].form === l) return i[o];
1061
- })(n, r.form);
1062
- return !s || s === r;
1063
- })(e);
1064
- }, Yn = function(e) {
1065
- var r = e.getBoundingClientRect(), n = r.width, t = r.height;
1066
- return n === 0 && t === 0;
1067
- }, Hi = function(e, r) {
1068
- var n = r.displayCheck, t = r.getShadowRoot;
1069
- if (getComputedStyle(e).visibility === "hidden") return !0;
1070
- var a = nt.call(e, "details>summary:first-of-type") ? e.parentElement : e;
1071
- if (nt.call(a, "details:not([open]) *")) return !0;
1072
- if (n && n !== "full" && n !== "legacy-full") {
1073
- if (n === "non-zero-area") return Yn(e);
1074
- } else {
1075
- if (typeof t == "function") {
1076
- for (var s = e; e; ) {
1077
- var i = e.parentElement, l = Nt(e);
1078
- if (i && !i.shadowRoot && t(i) === !0) return Yn(e);
1079
- e = e.assignedSlot ? e.assignedSlot : i || l === e.ownerDocument ? i : l.host;
1080
- }
1081
- e = s;
1082
- }
1083
- if ((function(o) {
1084
- var c, p, x, m, b = o && Nt(o), v = (c = b) === null || c === void 0 ? void 0 : c.host, y = !1;
1085
- if (b && b !== o) for (y = !!((p = v) !== null && p !== void 0 && (x = p.ownerDocument) !== null && x !== void 0 && x.contains(v) || o != null && (m = o.ownerDocument) !== null && m !== void 0 && m.contains(o)); !y && v; ) {
1086
- var f, h, u;
1087
- y = !((h = v = (f = b = Nt(v)) === null || f === void 0 ? void 0 : f.host) === null || h === void 0 || (u = h.ownerDocument) === null || u === void 0 || !u.contains(v));
1088
- }
1089
- return y;
1090
- })(e)) return !e.getClientRects().length;
1091
- if (n !== "legacy-full") return !0;
1092
- }
1093
- return !1;
1094
- }, Lt = function(e, r) {
1095
- return !(r.disabled || Vt(r) || (function(n) {
1096
- return co(n) && n.type === "hidden";
1097
- })(r) || Hi(r, e) || (function(n) {
1098
- return n.tagName === "DETAILS" && Array.prototype.slice.apply(n.children).some(function(t) {
1099
- return t.tagName === "SUMMARY";
1100
- });
1101
- })(r) || (function(n) {
1102
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName)) for (var t = n.parentElement; t; ) {
1103
- if (t.tagName === "FIELDSET" && t.disabled) {
1104
- for (var a = 0; a < t.children.length; a++) {
1105
- var s = t.children.item(a);
1106
- if (s.tagName === "LEGEND") return !!nt.call(t, "fieldset[disabled] *") || !s.contains(n);
1107
- }
1108
- return !0;
1109
- }
1110
- t = t.parentElement;
1111
- }
1112
- return !1;
1113
- })(r));
1114
- }, rn = function(e, r) {
1115
- return !(Wi(r) || Ke(r) < 0 || !Lt(e, r));
1116
- }, Ui = function(e) {
1117
- var r = parseInt(e.getAttribute("tabindex"), 10);
1118
- return !!(isNaN(r) || r >= 0);
1119
- }, Yi = function e(r) {
1120
- var n = [], t = [];
1121
- return r.forEach(function(a, s) {
1122
- var i = !!a.scopeParent, l = i ? a.scopeParent : a, o = (function(p, x) {
1123
- var m = Ke(p);
1124
- return m < 0 && x && !lo(p) ? 0 : m;
1125
- })(l, i), c = i ? e(a.candidates) : l;
1126
- o === 0 ? i ? n.push.apply(n, c) : n.push(l) : t.push({ documentOrder: s, tabIndex: o, item: a, isScope: i, content: c });
1127
- }), t.sort(zi).reduce(function(a, s) {
1128
- return s.isScope ? a.push.apply(a, s.content) : a.push(s.content), a;
1129
- }, []).concat(n);
1130
- }, uo = function(e, r) {
1131
- var n;
1132
- return n = (r = r || {}).getShadowRoot ? so([e], r.includeContainer, { filter: rn.bind(null, r), flatten: !1, getShadowRoot: r.getShadowRoot, shadowRootFilter: Ui }) : ao(e, r.includeContainer, rn.bind(null, r)), Yi(n);
1133
- }, po = function(e, r) {
1134
- return (r = r || {}).getShadowRoot ? so([e], r.includeContainer, { filter: Lt.bind(null, r), flatten: !0, getShadowRoot: r.getShadowRoot }) : ao(e, r.includeContainer, Lt.bind(null, r));
1135
- }, Ze = function(e, r) {
1136
- if (r = r || {}, !e) throw new Error("No node provided");
1137
- return nt.call(e, It) !== !1 && rn(r, e);
1138
- }, Ki = oo.concat("iframe").join(","), Ft = function(e, r) {
1139
- if (r = r || {}, !e) throw new Error("No node provided");
1140
- return nt.call(e, Ki) !== !1 && Lt(r, e);
1141
- };
1142
- const Xi = Object.freeze(Object.defineProperty({ __proto__: null, focusable: po, getTabIndex: Ke, isFocusable: Ft, isTabbable: Ze, tabbable: uo }, Symbol.toStringTag, { value: "Module" }));
1143
- function Qt(e, r) {
1144
- (r == null || r > e.length) && (r = e.length);
1145
- for (var n = 0, t = Array(r); n < r; n++) t[n] = e[n];
1146
- return t;
1147
- }
1148
- function Gi(e, r, n) {
1149
- return (r = (function(t) {
1150
- var a = (function(s, i) {
1151
- if (typeof s != "object" || !s) return s;
1152
- var l = s[Symbol.toPrimitive];
1153
- if (l !== void 0) {
1154
- var o = l.call(s, i);
1155
- if (typeof o != "object") return o;
1156
- throw new TypeError("@@toPrimitive must return a primitive value.");
1157
- }
1158
- return (i === "string" ? String : Number)(s);
1159
- })(t, "string");
1160
- return typeof a == "symbol" ? a : a + "";
1161
- })(r)) in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
1162
- }
1163
- function Kn(e, r) {
1164
- var n = Object.keys(e);
1165
- if (Object.getOwnPropertySymbols) {
1166
- var t = Object.getOwnPropertySymbols(e);
1167
- r && (t = t.filter(function(a) {
1168
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
1169
- })), n.push.apply(n, t);
1170
- }
1171
- return n;
1172
- }
1173
- function Xn(e) {
1174
- for (var r = 1; r < arguments.length; r++) {
1175
- var n = arguments[r] != null ? arguments[r] : {};
1176
- r % 2 ? Kn(Object(n), !0).forEach(function(t) {
1177
- Gi(e, t, n[t]);
1178
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Kn(Object(n)).forEach(function(t) {
1179
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
1180
- });
1181
- }
1182
- return e;
1183
- }
1184
- function qi(e) {
1185
- return (function(r) {
1186
- if (Array.isArray(r)) return Qt(r);
1187
- })(e) || (function(r) {
1188
- if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
1189
- })(e) || (function(r, n) {
1190
- if (r) {
1191
- if (typeof r == "string") return Qt(r, n);
1192
- var t = {}.toString.call(r).slice(8, -1);
1193
- return t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set" ? Array.from(r) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Qt(r, n) : void 0;
1194
- }
1195
- })(e) || (function() {
1196
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
1197
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1198
- })();
1199
- }
1200
- var Qi = function(e, r) {
1201
- if (e.length > 0) {
1202
- var n = e[e.length - 1];
1203
- n !== r && n._setPausedState(!0);
1204
- }
1205
- var t = e.indexOf(r);
1206
- t === -1 || e.splice(t, 1), e.push(r);
1207
- }, Ji = function(e, r) {
1208
- var n = e.indexOf(r);
1209
- n !== -1 && e.splice(n, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
1210
- }, xt = function(e) {
1211
- return e?.key === "Tab" || e?.keyCode === 9;
1212
- }, Zi = function(e) {
1213
- return xt(e) && !e.shiftKey;
1214
- }, ea = function(e) {
1215
- return xt(e) && e.shiftKey;
1216
- }, Gn = function(e) {
1217
- return setTimeout(e, 0);
1218
- }, ft = function(e) {
1219
- for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), t = 1; t < r; t++) n[t - 1] = arguments[t];
1220
- return typeof e == "function" ? e.apply(void 0, n) : e;
1221
- }, Mt = function(e) {
1222
- return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
1223
- }, ta = [];
1224
- const na = Object.freeze(Object.defineProperty({ __proto__: null, createFocusTrap: function(e, r) {
1225
- var n, t = r?.document || document, a = r?.trapStack || ta, s = Xn({ returnFocusOnDeactivate: !0, escapeDeactivates: !0, delayInitialFocus: !0, isKeyForward: Zi, isKeyBackward: ea }, r), i = { containers: [], containerGroups: [], tabbableGroups: [], nodeFocusedBeforeActivation: null, mostRecentlyFocusedNode: null, active: !1, paused: !1, manuallyPaused: !1, delayInitialFocusTimer: void 0, recentNavEvent: void 0 }, l = function(S, D, P) {
1226
- return S && S[D] !== void 0 ? S[D] : s[P || D];
1227
- }, o = function(S, D) {
1228
- var P = typeof D?.composedPath == "function" ? D.composedPath() : void 0;
1229
- return i.containerGroups.findIndex(function(M) {
1230
- var I = M.container, A = M.tabbableNodes;
1231
- return I.contains(S) || P?.includes(I) || A.find(function(L) {
1232
- return L === S;
1233
- });
1234
- });
1235
- }, c = function(S) {
1236
- var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, P = D.hasFallback, M = P !== void 0 && P, I = D.params, A = I === void 0 ? [] : I, L = s[S];
1237
- if (typeof L == "function" && (L = L.apply(void 0, qi(A))), L === !0 && (L = void 0), !L) {
1238
- if (L === void 0 || L === !1) return L;
1239
- throw new Error("`".concat(S, "` was specified but was not a node, or did not return a node"));
1240
- }
1241
- var j = L;
1242
- if (typeof L == "string") {
1243
- try {
1244
- j = t.querySelector(L);
1245
- } catch (z) {
1246
- throw new Error("`".concat(S, '` appears to be an invalid selector; error="').concat(z.message, '"'));
1247
- }
1248
- if (!j && !M) throw new Error("`".concat(S, "` as selector refers to no known node"));
1249
- }
1250
- return j;
1251
- }, p = function() {
1252
- var S = c("initialFocus", { hasFallback: !0 });
1253
- if (S === !1) return !1;
1254
- if (S === void 0 || S && !Ft(S, s.tabbableOptions)) if (o(t.activeElement) >= 0) S = t.activeElement;
1255
- else {
1256
- var D = i.tabbableGroups[0];
1257
- S = D && D.firstTabbableNode || c("fallbackFocus");
1258
- }
1259
- else S === null && (S = c("fallbackFocus"));
1260
- if (!S) throw new Error("Your focus-trap needs to have at least one focusable element");
1261
- return S;
1262
- }, x = function() {
1263
- if (i.containerGroups = i.containers.map(function(S) {
1264
- var D = uo(S, s.tabbableOptions), P = po(S, s.tabbableOptions), M = D.length > 0 ? D[0] : void 0, I = D.length > 0 ? D[D.length - 1] : void 0, A = P.find(function(z) {
1265
- return Ze(z);
1266
- }), L = P.slice().reverse().find(function(z) {
1267
- return Ze(z);
1268
- }), j = !!D.find(function(z) {
1269
- return Ke(z) > 0;
1270
- });
1271
- return { container: S, tabbableNodes: D, focusableNodes: P, posTabIndexesFound: j, firstTabbableNode: M, lastTabbableNode: I, firstDomTabbableNode: A, lastDomTabbableNode: L, nextTabbableNode: function(z) {
1272
- var ne = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], K = D.indexOf(z);
1273
- return K < 0 ? ne ? P.slice(P.indexOf(z) + 1).find(function(q) {
1274
- return Ze(q);
1275
- }) : P.slice(0, P.indexOf(z)).reverse().find(function(q) {
1276
- return Ze(q);
1277
- }) : D[K + (ne ? 1 : -1)];
1278
- } };
1279
- }), i.tabbableGroups = i.containerGroups.filter(function(S) {
1280
- return S.tabbableNodes.length > 0;
1281
- }), i.tabbableGroups.length <= 0 && !c("fallbackFocus")) throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
1282
- if (i.containerGroups.find(function(S) {
1283
- return S.posTabIndexesFound;
1284
- }) && i.containerGroups.length > 1) throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
1285
- }, m = function(S) {
1286
- var D = S.activeElement;
1287
- if (D) return D.shadowRoot && D.shadowRoot.activeElement !== null ? m(D.shadowRoot) : D;
1288
- }, b = function(S) {
1289
- S !== !1 && S !== m(document) && (S && S.focus ? (S.focus({ preventScroll: !!s.preventScroll }), i.mostRecentlyFocusedNode = S, (function(D) {
1290
- return D.tagName && D.tagName.toLowerCase() === "input" && typeof D.select == "function";
1291
- })(S) && S.select()) : b(p()));
1292
- }, v = function(S) {
1293
- var D = c("setReturnFocus", { params: [S] });
1294
- return D || D !== !1 && S;
1295
- }, y = function(S) {
1296
- var D = S.target, P = S.event, M = S.isBackward, I = M !== void 0 && M;
1297
- D = D || Mt(P), x();
1298
- var A = null;
1299
- if (i.tabbableGroups.length > 0) {
1300
- var L = o(D, P), j = L >= 0 ? i.containerGroups[L] : void 0;
1301
- if (L < 0) A = I ? i.tabbableGroups[i.tabbableGroups.length - 1].lastTabbableNode : i.tabbableGroups[0].firstTabbableNode;
1302
- else if (I) {
1303
- var z = i.tabbableGroups.findIndex(function(J) {
1304
- var le = J.firstTabbableNode;
1305
- return D === le;
1306
- });
1307
- if (z < 0 && (j.container === D || Ft(D, s.tabbableOptions) && !Ze(D, s.tabbableOptions) && !j.nextTabbableNode(D, !1)) && (z = L), z >= 0) {
1308
- var ne = z === 0 ? i.tabbableGroups.length - 1 : z - 1, K = i.tabbableGroups[ne];
1309
- A = Ke(D) >= 0 ? K.lastTabbableNode : K.lastDomTabbableNode;
1310
- } else xt(P) || (A = j.nextTabbableNode(D, !1));
1311
- } else {
1312
- var q = i.tabbableGroups.findIndex(function(J) {
1313
- var le = J.lastTabbableNode;
1314
- return D === le;
1315
- });
1316
- if (q < 0 && (j.container === D || Ft(D, s.tabbableOptions) && !Ze(D, s.tabbableOptions) && !j.nextTabbableNode(D)) && (q = L), q >= 0) {
1317
- var ae = q === i.tabbableGroups.length - 1 ? 0 : q + 1, re = i.tabbableGroups[ae];
1318
- A = Ke(D) >= 0 ? re.firstTabbableNode : re.firstDomTabbableNode;
1319
- } else xt(P) || (A = j.nextTabbableNode(D));
1320
- }
1321
- } else A = c("fallbackFocus");
1322
- return A;
1323
- }, f = function(S) {
1324
- var D = Mt(S);
1325
- o(D, S) >= 0 || (ft(s.clickOutsideDeactivates, S) ? n.deactivate({ returnFocus: s.returnFocusOnDeactivate }) : ft(s.allowOutsideClick, S) || S.preventDefault());
1326
- }, h = function(S) {
1327
- var D = Mt(S), P = o(D, S) >= 0;
1328
- if (P || D instanceof Document) P && (i.mostRecentlyFocusedNode = D);
1329
- else {
1330
- var M;
1331
- S.stopImmediatePropagation();
1332
- var I = !0;
1333
- if (i.mostRecentlyFocusedNode) if (Ke(i.mostRecentlyFocusedNode) > 0) {
1334
- var A = o(i.mostRecentlyFocusedNode), L = i.containerGroups[A].tabbableNodes;
1335
- if (L.length > 0) {
1336
- var j = L.findIndex(function(z) {
1337
- return z === i.mostRecentlyFocusedNode;
1338
- });
1339
- j >= 0 && (s.isKeyForward(i.recentNavEvent) ? j + 1 < L.length && (M = L[j + 1], I = !1) : j - 1 >= 0 && (M = L[j - 1], I = !1));
1340
- }
1341
- } else i.containerGroups.some(function(z) {
1342
- return z.tabbableNodes.some(function(ne) {
1343
- return Ke(ne) > 0;
1344
- });
1345
- }) || (I = !1);
1346
- else I = !1;
1347
- I && (M = y({ target: i.mostRecentlyFocusedNode, isBackward: s.isKeyBackward(i.recentNavEvent) })), b(M || i.mostRecentlyFocusedNode || p());
1348
- }
1349
- i.recentNavEvent = void 0;
1350
- }, u = function(S) {
1351
- (s.isKeyForward(S) || s.isKeyBackward(S)) && (function(D) {
1352
- var P = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
1353
- i.recentNavEvent = D;
1354
- var M = y({ event: D, isBackward: P });
1355
- M && (xt(D) && D.preventDefault(), b(M));
1356
- })(S, s.isKeyBackward(S));
1357
- }, w = function(S) {
1358
- var D;
1359
- ((D = S) == null ? void 0 : D.key) !== "Escape" && D?.key !== "Esc" && D?.keyCode !== 27 || ft(s.escapeDeactivates, S) === !1 || (S.preventDefault(), n.deactivate());
1360
- }, E = function(S) {
1361
- var D = Mt(S);
1362
- o(D, S) >= 0 || ft(s.clickOutsideDeactivates, S) || ft(s.allowOutsideClick, S) || (S.preventDefault(), S.stopImmediatePropagation());
1363
- }, T = function() {
1364
- if (i.active) return Qi(a, n), i.delayInitialFocusTimer = s.delayInitialFocus ? Gn(function() {
1365
- b(p());
1366
- }) : b(p()), t.addEventListener("focusin", h, !0), t.addEventListener("mousedown", f, { capture: !0, passive: !1 }), t.addEventListener("touchstart", f, { capture: !0, passive: !1 }), t.addEventListener("click", E, { capture: !0, passive: !1 }), t.addEventListener("keydown", u, { capture: !0, passive: !1 }), t.addEventListener("keydown", w), n;
1367
- }, B = function() {
1368
- if (i.active) return t.removeEventListener("focusin", h, !0), t.removeEventListener("mousedown", f, !0), t.removeEventListener("touchstart", f, !0), t.removeEventListener("click", E, !0), t.removeEventListener("keydown", u, !0), t.removeEventListener("keydown", w), n;
1369
- }, O = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(function(S) {
1370
- S.some(function(D) {
1371
- return Array.from(D.removedNodes).some(function(P) {
1372
- return P === i.mostRecentlyFocusedNode;
1373
- });
1374
- }) && b(p());
1375
- }) : void 0, R = function() {
1376
- O && (O.disconnect(), i.active && !i.paused && i.containers.map(function(S) {
1377
- O.observe(S, { subtree: !0, childList: !0 });
1378
- }));
1379
- };
1380
- return n = { get active() {
1381
- return i.active;
1382
- }, get paused() {
1383
- return i.paused;
1384
- }, activate: function(S) {
1385
- if (i.active) return this;
1386
- var D = l(S, "onActivate"), P = l(S, "onPostActivate"), M = l(S, "checkCanFocusTrap");
1387
- M || x(), i.active = !0, i.paused = !1, i.nodeFocusedBeforeActivation = m(t), D?.();
1388
- var I = function() {
1389
- M && x(), T(), R(), P?.();
1390
- };
1391
- return M ? (M(i.containers.concat()).then(I, I), this) : (I(), this);
1392
- }, deactivate: function(S) {
1393
- if (!i.active) return this;
1394
- var D = Xn({ onDeactivate: s.onDeactivate, onPostDeactivate: s.onPostDeactivate, checkCanReturnFocus: s.checkCanReturnFocus }, S);
1395
- clearTimeout(i.delayInitialFocusTimer), i.delayInitialFocusTimer = void 0, B(), i.active = !1, i.paused = !1, R(), Ji(a, n);
1396
- var P = l(D, "onDeactivate"), M = l(D, "onPostDeactivate"), I = l(D, "checkCanReturnFocus"), A = l(D, "returnFocus", "returnFocusOnDeactivate");
1397
- P?.();
1398
- var L = function() {
1399
- Gn(function() {
1400
- A && b(v(i.nodeFocusedBeforeActivation)), M?.();
1401
- });
1402
- };
1403
- return A && I ? (I(v(i.nodeFocusedBeforeActivation)).then(L, L), this) : (L(), this);
1404
- }, pause: function(S) {
1405
- return i.active ? (i.manuallyPaused = !0, this._setPausedState(!0, S)) : this;
1406
- }, unpause: function(S) {
1407
- return i.active ? (i.manuallyPaused = !1, a[a.length - 1] !== this ? this : this._setPausedState(!1, S)) : this;
1408
- }, updateContainerElements: function(S) {
1409
- var D = [].concat(S).filter(Boolean);
1410
- return i.containers = D.map(function(P) {
1411
- return typeof P == "string" ? t.querySelector(P) : P;
1412
- }), i.active && x(), R(), this;
1413
- } }, Object.defineProperties(n, { _isManuallyPaused: { value: function() {
1414
- return i.manuallyPaused;
1415
- } }, _setPausedState: { value: function(S, D) {
1416
- if (i.paused === S) return this;
1417
- if (i.paused = S, S) {
1418
- var P = l(D, "onPause"), M = l(D, "onPostPause");
1419
- P?.(), B(), R(), M?.();
1420
- } else {
1421
- var I = l(D, "onUnpause"), A = l(D, "onPostUnpause");
1422
- I?.(), x(), T(), R(), A?.();
1423
- }
1424
- return this;
1425
- } } }), n.updateContainerElements(e), n;
1426
- } }, Symbol.toStringTag, { value: "Module" })), ra = Ir(na), oa = Ir(Xi);
1427
- var qn, Qn, ia = (function() {
1428
- if (Qn) return qn;
1429
- function e(b) {
1430
- return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
1431
- return typeof v;
1432
- } : function(v) {
1433
- return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
1434
- }, e(b);
1435
- }
1436
- function r(b, v, y) {
1437
- return v && (function(f, h) {
1438
- for (var u = 0; u < h.length; u++) {
1439
- var w = h[u];
1440
- w.enumerable = w.enumerable || !1, w.configurable = !0, "value" in w && (w.writable = !0), Object.defineProperty(f, i(w.key), w);
1441
- }
1442
- })(b.prototype, v), Object.defineProperty(b, "prototype", { writable: !1 }), b;
1443
- }
1444
- function n(b, v, y) {
1445
- return v = a(v), (function(f, h) {
1446
- if (h && (e(h) == "object" || typeof h == "function")) return h;
1447
- if (h !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
1448
- return (function(u) {
1449
- if (u === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1450
- return u;
1451
- })(f);
1452
- })(b, t() ? Reflect.construct(v, y || [], a(b).constructor) : v.apply(b, y));
1453
- }
1454
- function t() {
1455
- try {
1456
- var b = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1457
- }));
1458
- } catch {
1459
- }
1460
- return (t = function() {
1461
- return !!b;
1462
- })();
1463
- }
1464
- function a(b) {
1465
- return a = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(v) {
1466
- return v.__proto__ || Object.getPrototypeOf(v);
1467
- }, a(b);
1468
- }
1469
- function s(b, v) {
1470
- return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(y, f) {
1471
- return y.__proto__ = f, y;
1472
- }, s(b, v);
1473
- }
1474
- function i(b) {
1475
- var v = (function(y, f) {
1476
- if (e(y) != "object" || !y) return y;
1477
- var h = y[Symbol.toPrimitive];
1478
- if (h !== void 0) {
1479
- var u = h.call(y, f);
1480
- if (e(u) != "object") return u;
1481
- throw new TypeError("@@toPrimitive must return a primitive value.");
1482
- }
1483
- return (f === "string" ? String : Number)(y);
1484
- })(b, "string");
1485
- return e(v) == "symbol" ? v : v + "";
1486
- }
1487
- Qn = 1;
1488
- var l = Q, o = gn(), c = ra.createFocusTrap, p = oa.isFocusable, x = (function(b) {
1489
- function v(y) {
1490
- var f;
1491
- (function(w, E) {
1492
- if (!(w instanceof E)) throw new TypeError("Cannot call a class as a function");
1493
- })(this, v), (function(w, E, T) {
1494
- (E = i(E)) in w ? Object.defineProperty(w, E, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : w[E] = T;
1495
- })(f = n(this, v, [y]), "getNodeForOption", function(w) {
1496
- var E, T = (E = this.internalOptions[w]) !== null && E !== void 0 ? E : this.originalOptions[w];
1497
- if (typeof T == "function") {
1498
- for (var B = arguments.length, O = new Array(B > 1 ? B - 1 : 0), R = 1; R < B; R++) O[R - 1] = arguments[R];
1499
- T = T.apply(void 0, O);
1500
- }
1501
- if (T === !0 && (T = void 0), !T) {
1502
- if (T === void 0 || T === !1) return T;
1503
- throw new Error("`".concat(w, "` was specified but was not a node, or did not return a node"));
1504
- }
1505
- var S, D = T;
1506
- if (typeof T == "string" && !(D = (S = this.getDocument()) === null || S === void 0 ? void 0 : S.querySelector(T))) throw new Error("`".concat(w, "` as selector refers to no known node"));
1507
- return D;
1508
- }), f.handleDeactivate = f.handleDeactivate.bind(f), f.handlePostDeactivate = f.handlePostDeactivate.bind(f), f.handleClickOutsideDeactivates = f.handleClickOutsideDeactivates.bind(f), f.internalOptions = { returnFocusOnDeactivate: !1, checkCanReturnFocus: null, onDeactivate: f.handleDeactivate, onPostDeactivate: f.handlePostDeactivate, clickOutsideDeactivates: f.handleClickOutsideDeactivates }, f.originalOptions = { returnFocusOnDeactivate: !0, onDeactivate: null, onPostDeactivate: null, checkCanReturnFocus: null, clickOutsideDeactivates: !1 };
1509
- var h = y.focusTrapOptions;
1510
- for (var u in h) Object.prototype.hasOwnProperty.call(h, u) && (u !== "returnFocusOnDeactivate" && u !== "onDeactivate" && u !== "onPostDeactivate" && u !== "checkCanReturnFocus" && u !== "clickOutsideDeactivates" ? f.internalOptions[u] = h[u] : f.originalOptions[u] = h[u]);
1511
- return f.outsideClick = null, f.focusTrapElements = y.containerElements || [], f.updatePreviousElement(), f;
1512
- }
1513
- return (function(y, f) {
1514
- if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
1515
- y.prototype = Object.create(f && f.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), Object.defineProperty(y, "prototype", { writable: !1 }), f && s(y, f);
1516
- })(v, b), r(v, [{ key: "getDocument", value: function() {
1517
- return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
1518
- } }, { key: "getReturnFocusNode", value: function() {
1519
- var y = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
1520
- return y || y !== !1 && this.previouslyFocusedElement;
1521
- } }, { key: "updatePreviousElement", value: function() {
1522
- var y = this.getDocument();
1523
- y && (this.previouslyFocusedElement = y.activeElement);
1524
- } }, { key: "deactivateTrap", value: function() {
1525
- this.focusTrap && this.focusTrap.active && this.focusTrap.deactivate({ returnFocus: !1, checkCanReturnFocus: null, onDeactivate: this.originalOptions.onDeactivate });
1526
- } }, { key: "handleClickOutsideDeactivates", value: function(y) {
1527
- var f = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, y) : this.originalOptions.clickOutsideDeactivates;
1528
- return f && (this.outsideClick = { target: y.target, allowDeactivation: f }), f;
1529
- } }, { key: "handleDeactivate", value: function() {
1530
- this.originalOptions.onDeactivate && this.originalOptions.onDeactivate.call(null), this.deactivateTrap();
1531
- } }, { key: "handlePostDeactivate", value: function() {
1532
- var y = this, f = function() {
1533
- var h = y.getReturnFocusNode(), u = !(!y.originalOptions.returnFocusOnDeactivate || h == null || !h.focus || y.outsideClick && (!y.outsideClick.allowDeactivation || p(y.outsideClick.target, y.internalOptions.tabbableOptions))), w = y.internalOptions.preventScroll, E = w !== void 0 && w;
1534
- u && h.focus({ preventScroll: E }), y.originalOptions.onPostDeactivate && y.originalOptions.onPostDeactivate.call(null), y.outsideClick = null;
1535
- };
1536
- this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(f, f) : f();
1537
- } }, { key: "setupFocusTrap", value: function() {
1538
- this.focusTrap ? this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause()) : this.focusTrapElements.some(Boolean) && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1539
- } }, { key: "componentDidMount", value: function() {
1540
- this.props.active && this.setupFocusTrap();
1541
- } }, { key: "componentDidUpdate", value: function(y) {
1542
- if (this.focusTrap) {
1543
- y.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
1544
- var f = !y.active && this.props.active, h = y.active && !this.props.active, u = !y.paused && this.props.paused, w = y.paused && !this.props.paused;
1545
- if (f && (this.updatePreviousElement(), this.focusTrap.activate()), h) return void this.deactivateTrap();
1546
- u && this.focusTrap.pause(), w && this.focusTrap.unpause();
1547
- } else y.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
1548
- } }, { key: "componentWillUnmount", value: function() {
1549
- this.deactivateTrap();
1550
- } }, { key: "render", value: function() {
1551
- var y = this, f = this.props.children ? l.Children.only(this.props.children) : void 0;
1552
- if (f) {
1553
- if (f.type && f.type === l.Fragment) throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
1554
- return l.cloneElement(f, { ref: function(h) {
1555
- var u = y.props.containerElements;
1556
- f && (typeof f.ref == "function" ? f.ref(h) : f.ref && (f.ref.current = h)), y.focusTrapElements = u || [h];
1557
- } });
1558
- }
1559
- return null;
1560
- } }]);
1561
- })(l.Component), m = typeof Element > "u" ? Function : Element;
1562
- return x.propTypes = { active: o.bool, paused: o.bool, focusTrapOptions: o.shape({ document: o.object, onActivate: o.func, onPostActivate: o.func, checkCanFocusTrap: o.func, onPause: o.func, onPostPause: o.func, onUnpause: o.func, onPostUnpause: o.func, onDeactivate: o.func, onPostDeactivate: o.func, checkCanReturnFocus: o.func, initialFocus: o.oneOfType([o.instanceOf(m), o.string, o.bool, o.func]), fallbackFocus: o.oneOfType([o.instanceOf(m), o.string, o.func]), escapeDeactivates: o.oneOfType([o.bool, o.func]), clickOutsideDeactivates: o.oneOfType([o.bool, o.func]), returnFocusOnDeactivate: o.bool, setReturnFocus: o.oneOfType([o.instanceOf(m), o.string, o.bool, o.func]), allowOutsideClick: o.oneOfType([o.bool, o.func]), preventScroll: o.bool, tabbableOptions: o.shape({ displayCheck: o.oneOf(["full", "legacy-full", "non-zero-area", "none"]), getShadowRoot: o.oneOfType([o.bool, o.func]) }), trapStack: o.array, isKeyForward: o.func, isKeyBackward: o.func }), containerElements: o.arrayOf(o.instanceOf(m)), children: o.oneOfType([o.element, o.instanceOf(m)]) }, x.defaultProps = { active: !0, paused: !1, focusTrapOptions: {}, _createFocusTrap: c }, qn = x;
1563
- })();
1564
- const aa = Ar(ia);
1565
- var Jn, ht = { exports: {} }, Zn = {}, Tt = { exports: {} }, er, ye = {}, We = {};
1566
- function Ut() {
1567
- return er || (er = 1, Object.defineProperty(We, "__esModule", { value: !0 }), We.dontSetMe = function(e, r, n) {
1568
- if (e[r]) return new Error(`Invalid prop ${r} passed to ${n} - do not set this, set it on the child.`);
1569
- }, We.findInArray = function(e, r) {
1570
- for (let n = 0, t = e.length; n < t; n++) if (r.apply(r, [e[n], n, e])) return e[n];
1571
- }, We.int = function(e) {
1572
- return parseInt(e, 10);
1573
- }, We.isFunction = function(e) {
1574
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
1575
- }, We.isNum = function(e) {
1576
- return typeof e == "number" && !isNaN(e);
1577
- }), We;
1578
- }
1579
- var tr, nr, He = {};
1580
- function yn() {
1581
- if (nr) return ye;
1582
- nr = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.addClassName = i, ye.addEvent = function(o, c, p, x) {
1583
- if (!o) return;
1584
- const m = { capture: !0, ...x };
1585
- o.addEventListener ? o.addEventListener(c, p, m) : o.attachEvent ? o.attachEvent("on" + c, p) : o["on" + c] = p;
1586
- }, ye.addUserSelectStyles = function(o) {
1587
- if (!o) return;
1588
- let c = o.getElementById("react-draggable-style-el");
1589
- c || (c = o.createElement("style"), c.type = "text/css", c.id = "react-draggable-style-el", c.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1590
- `, c.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
1591
- `, o.getElementsByTagName("head")[0].appendChild(c)), o.body && i(o.body, "react-draggable-transparent-selection");
1592
- }, ye.createCSSTransform = function(o, c) {
1593
- const p = a(o, c, "px");
1594
- return { [(0, r.browserPrefixToKey)("transform", r.default)]: p };
1595
- }, ye.createSVGTransform = function(o, c) {
1596
- return a(o, c, "");
1597
- }, ye.getTouch = function(o, c) {
1598
- return o.targetTouches && (0, e.findInArray)(o.targetTouches, (p) => c === p.identifier) || o.changedTouches && (0, e.findInArray)(o.changedTouches, (p) => c === p.identifier);
1599
- }, ye.getTouchIdentifier = function(o) {
1600
- if (o.targetTouches && o.targetTouches[0]) return o.targetTouches[0].identifier;
1601
- if (o.changedTouches && o.changedTouches[0]) return o.changedTouches[0].identifier;
1602
- }, ye.getTranslation = a, ye.innerHeight = function(o) {
1603
- let c = o.clientHeight;
1604
- const p = o.ownerDocument.defaultView.getComputedStyle(o);
1605
- return c -= (0, e.int)(p.paddingTop), c -= (0, e.int)(p.paddingBottom), c;
1606
- }, ye.innerWidth = function(o) {
1607
- let c = o.clientWidth;
1608
- const p = o.ownerDocument.defaultView.getComputedStyle(o);
1609
- return c -= (0, e.int)(p.paddingLeft), c -= (0, e.int)(p.paddingRight), c;
1610
- }, ye.matchesSelector = t, ye.matchesSelectorAndParentsTo = function(o, c, p) {
1611
- let x = o;
1612
- do {
1613
- if (t(x, c)) return !0;
1614
- if (x === p) return !1;
1615
- x = x.parentNode;
1616
- } while (x);
1617
- return !1;
1618
- }, ye.offsetXYFromParent = function(o, c, p) {
1619
- const x = c === c.ownerDocument.body ? { left: 0, top: 0 } : c.getBoundingClientRect(), m = (o.clientX + c.scrollLeft - x.left) / p, b = (o.clientY + c.scrollTop - x.top) / p;
1620
- return { x: m, y: b };
1621
- }, ye.outerHeight = function(o) {
1622
- let c = o.clientHeight;
1623
- const p = o.ownerDocument.defaultView.getComputedStyle(o);
1624
- return c += (0, e.int)(p.borderTopWidth), c += (0, e.int)(p.borderBottomWidth), c;
1625
- }, ye.outerWidth = function(o) {
1626
- let c = o.clientWidth;
1627
- const p = o.ownerDocument.defaultView.getComputedStyle(o);
1628
- return c += (0, e.int)(p.borderLeftWidth), c += (0, e.int)(p.borderRightWidth), c;
1629
- }, ye.removeClassName = l, ye.removeEvent = function(o, c, p, x) {
1630
- if (!o) return;
1631
- const m = { capture: !0, ...x };
1632
- o.removeEventListener ? o.removeEventListener(c, p, m) : o.detachEvent ? o.detachEvent("on" + c, p) : o["on" + c] = null;
1633
- }, ye.scheduleRemoveUserSelectStyles = function(o) {
1634
- window.requestAnimationFrame ? window.requestAnimationFrame(() => {
1635
- s(o);
1636
- }) : s(o);
1637
- };
1638
- var e = Ut(), r = (function(o, c) {
1639
- if (typeof WeakMap == "function") var p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
1640
- return (function(m, b) {
1641
- if (!b && m && m.__esModule) return m;
1642
- var v, y, f = { __proto__: null, default: m };
1643
- if (m === null || typeof m != "object" && typeof m != "function") return f;
1644
- if (v = b ? x : p) {
1645
- if (v.has(m)) return v.get(m);
1646
- v.set(m, f);
1647
- }
1648
- for (const h in m) h !== "default" && {}.hasOwnProperty.call(m, h) && ((y = (v = Object.defineProperty) && Object.getOwnPropertyDescriptor(m, h)) && (y.get || y.set) ? v(f, h, y) : f[h] = m[h]);
1649
- return f;
1650
- })(o, c);
1651
- })((function() {
1652
- if (tr) return He;
1653
- tr = 1, Object.defineProperty(He, "__esModule", { value: !0 }), He.browserPrefixToKey = p, He.browserPrefixToStyle = function(x, m) {
1654
- return m ? `-${m.toLowerCase()}-${x}` : x;
1655
- }, He.default = void 0, He.getPrefix = c;
1656
- const o = ["Moz", "Webkit", "O", "ms"];
1657
- function c() {
1658
- let x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
1659
- if (typeof window > "u") return "";
1660
- const m = window.document?.documentElement?.style;
1661
- if (!m || x in m) return "";
1662
- for (let b = 0; b < o.length; b++) if (p(x, o[b]) in m) return o[b];
1663
- return "";
1664
- }
1665
- function p(x, m) {
1666
- return m ? `${m}${(function(b) {
1667
- let v = "", y = !0;
1668
- for (let f = 0; f < b.length; f++) y ? (v += b[f].toUpperCase(), y = !1) : b[f] === "-" ? y = !0 : v += b[f];
1669
- return v;
1670
- })(x)}` : x;
1671
- }
1672
- return He.default = c(), He;
1673
- })());
1674
- let n = "";
1675
- function t(o, c) {
1676
- return n || (n = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(p) {
1677
- return (0, e.isFunction)(o[p]);
1678
- })), !!(0, e.isFunction)(o[n]) && o[n](c);
1679
- }
1680
- function a(o, c, p) {
1681
- let { x, y: m } = o, b = `translate(${x}${p},${m}${p})`;
1682
- return c && (b = `translate(${`${typeof c.x == "string" ? c.x : c.x + p}`}, ${`${typeof c.y == "string" ? c.y : c.y + p}`})` + b), b;
1683
- }
1684
- function s(o) {
1685
- if (o) try {
1686
- if (o.body && l(o.body, "react-draggable-transparent-selection"), o.selection) o.selection.empty();
1687
- else {
1688
- const c = (o.defaultView || window).getSelection();
1689
- c && c.type !== "Caret" && c.removeAllRanges();
1690
- }
1691
- } catch {
1692
- }
1693
- }
1694
- function i(o, c) {
1695
- o.classList ? o.classList.add(c) : o.className.match(new RegExp(`(?:^|\\s)${c}(?!\\S)`)) || (o.className += ` ${c}`);
1696
- }
1697
- function l(o, c) {
1698
- o.classList ? o.classList.remove(c) : o.className = o.className.replace(new RegExp(`(?:^|\\s)${c}(?!\\S)`, "g"), "");
1699
- }
1700
- return ye;
1701
- }
1702
- var rr, Le = {};
1703
- function fo() {
1704
- if (rr) return Le;
1705
- rr = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.canDragX = function(t) {
1706
- return t.props.axis === "both" || t.props.axis === "x";
1707
- }, Le.canDragY = function(t) {
1708
- return t.props.axis === "both" || t.props.axis === "y";
1709
- }, Le.createCoreData = function(t, a, s) {
1710
- const i = !(0, e.isNum)(t.lastX), l = n(t);
1711
- return i ? { node: l, deltaX: 0, deltaY: 0, lastX: a, lastY: s, x: a, y: s } : { node: l, deltaX: a - t.lastX, deltaY: s - t.lastY, lastX: t.lastX, lastY: t.lastY, x: a, y: s };
1712
- }, Le.createDraggableData = function(t, a) {
1713
- const s = t.props.scale;
1714
- return { node: a.node, x: t.state.x + a.deltaX / s, y: t.state.y + a.deltaY / s, deltaX: a.deltaX / s, deltaY: a.deltaY / s, lastX: t.state.x, lastY: t.state.y };
1715
- }, Le.getBoundPosition = function(t, a, s) {
1716
- if (!t.props.bounds) return [a, s];
1717
- let { bounds: i } = t.props;
1718
- i = typeof i == "string" ? i : (function(o) {
1719
- return { left: o.left, top: o.top, right: o.right, bottom: o.bottom };
1720
- })(i);
1721
- const l = n(t);
1722
- if (typeof i == "string") {
1723
- const { ownerDocument: o } = l, c = o.defaultView;
1724
- let p;
1725
- if (i === "parent" ? p = l.parentNode : p = l.getRootNode().querySelector(i), !(p instanceof c.HTMLElement)) throw new Error('Bounds selector "' + i + '" could not find an element.');
1726
- const x = p, m = c.getComputedStyle(l), b = c.getComputedStyle(x);
1727
- i = { left: -l.offsetLeft + (0, e.int)(b.paddingLeft) + (0, e.int)(m.marginLeft), top: -l.offsetTop + (0, e.int)(b.paddingTop) + (0, e.int)(m.marginTop), right: (0, r.innerWidth)(x) - (0, r.outerWidth)(l) - l.offsetLeft + (0, e.int)(b.paddingRight) - (0, e.int)(m.marginRight), bottom: (0, r.innerHeight)(x) - (0, r.outerHeight)(l) - l.offsetTop + (0, e.int)(b.paddingBottom) - (0, e.int)(m.marginBottom) };
1728
- }
1729
- return (0, e.isNum)(i.right) && (a = Math.min(a, i.right)), (0, e.isNum)(i.bottom) && (s = Math.min(s, i.bottom)), (0, e.isNum)(i.left) && (a = Math.max(a, i.left)), (0, e.isNum)(i.top) && (s = Math.max(s, i.top)), [a, s];
1730
- }, Le.getControlPosition = function(t, a, s) {
1731
- const i = typeof a == "number" ? (0, r.getTouch)(t, a) : null;
1732
- if (typeof a == "number" && !i) return null;
1733
- const l = n(s), o = s.props.offsetParent || l.offsetParent || l.ownerDocument.body;
1734
- return (0, r.offsetXYFromParent)(i || t, o, s.props.scale);
1735
- }, Le.snapToGrid = function(t, a, s) {
1736
- const i = Math.round(a / t[0]) * t[0], l = Math.round(s / t[1]) * t[1];
1737
- return [i, l];
1738
- };
1739
- var e = Ut(), r = yn();
1740
- function n(t) {
1741
- const a = t.findDOMNode();
1742
- if (!a) throw new Error("<DraggableCore>: Unmounted during event!");
1743
- return a;
1744
- }
1745
- return Le;
1746
- }
1747
- var or, ir, ar, sr, mt = {}, Pt = {};
1748
- function ho() {
1749
- return or || (or = 1, Object.defineProperty(Pt, "__esModule", { value: !0 }), Pt.default = function() {
1750
- }), Pt;
1751
- }
1752
- function sa() {
1753
- if (ir) return mt;
1754
- ir = 1, Object.defineProperty(mt, "__esModule", { value: !0 }), mt.default = void 0;
1755
- var e = (function(b, v) {
1756
- if (typeof WeakMap == "function") var y = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap();
1757
- return (function(h, u) {
1758
- if (!u && h && h.__esModule) return h;
1759
- var w, E, T = { __proto__: null, default: h };
1760
- if (h === null || typeof h != "object" && typeof h != "function") return T;
1761
- if (w = u ? f : y) {
1762
- if (w.has(h)) return w.get(h);
1763
- w.set(h, T);
1764
- }
1765
- for (const B in h) B !== "default" && {}.hasOwnProperty.call(h, B) && ((E = (w = Object.defineProperty) && Object.getOwnPropertyDescriptor(h, B)) && (E.get || E.set) ? w(T, B, E) : T[B] = h[B]);
1766
- return T;
1767
- })(b, v);
1768
- })(Q), r = l(gn()), n = l(Rr), t = yn(), a = fo(), s = Ut(), i = l(ho());
1769
- function l(b) {
1770
- return b && b.__esModule ? b : { default: b };
1771
- }
1772
- function o(b, v, y) {
1773
- return (v = (function(f) {
1774
- var h = (function(u, w) {
1775
- if (typeof u != "object" || !u) return u;
1776
- var E = u[Symbol.toPrimitive];
1777
- if (E !== void 0) {
1778
- var T = E.call(u, w);
1779
- if (typeof T != "object") return T;
1780
- throw new TypeError("@@toPrimitive must return a primitive value.");
1781
- }
1782
- return (w === "string" ? String : Number)(u);
1783
- })(f, "string");
1784
- return typeof h == "symbol" ? h : h + "";
1785
- })(v)) in b ? Object.defineProperty(b, v, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : b[v] = y, b;
1786
- }
1787
- const c = { start: "touchstart", move: "touchmove", stop: "touchend" }, p = { start: "mousedown", move: "mousemove", stop: "mouseup" };
1788
- let x = p, m = class extends e.Component {
1789
- constructor() {
1790
- super(...arguments), o(this, "dragging", !1), o(this, "lastX", NaN), o(this, "lastY", NaN), o(this, "touchIdentifier", null), o(this, "mounted", !1), o(this, "handleDragStart", (b) => {
1791
- if (this.props.onMouseDown(b), !this.props.allowAnyClick && typeof b.button == "number" && b.button !== 0) return !1;
1792
- const v = this.findDOMNode();
1793
- if (!v || !v.ownerDocument || !v.ownerDocument.body) throw new Error("<DraggableCore> not mounted on DragStart!");
1794
- const { ownerDocument: y } = v;
1795
- if (this.props.disabled || !(b.target instanceof y.defaultView.Node) || this.props.handle && !(0, t.matchesSelectorAndParentsTo)(b.target, this.props.handle, v) || this.props.cancel && (0, t.matchesSelectorAndParentsTo)(b.target, this.props.cancel, v)) return;
1796
- b.type !== "touchstart" || this.props.allowMobileScroll || b.preventDefault();
1797
- const f = (0, t.getTouchIdentifier)(b);
1798
- this.touchIdentifier = f;
1799
- const h = (0, a.getControlPosition)(b, f, this);
1800
- if (h == null) return;
1801
- const { x: u, y: w } = h, E = (0, a.createCoreData)(this, u, w);
1802
- (0, i.default)("DraggableCore: handleDragStart: %j", E), (0, i.default)("calling", this.props.onStart), this.props.onStart(b, E) !== !1 && this.mounted !== !1 && (this.props.enableUserSelectHack && (0, t.addUserSelectStyles)(y), this.dragging = !0, this.lastX = u, this.lastY = w, (0, t.addEvent)(y, x.move, this.handleDrag), (0, t.addEvent)(y, x.stop, this.handleDragStop));
1803
- }), o(this, "handleDrag", (b) => {
1804
- const v = (0, a.getControlPosition)(b, this.touchIdentifier, this);
1805
- if (v == null) return;
1806
- let { x: y, y: f } = v;
1807
- if (Array.isArray(this.props.grid)) {
1808
- let u = y - this.lastX, w = f - this.lastY;
1809
- if ([u, w] = (0, a.snapToGrid)(this.props.grid, u, w), !u && !w) return;
1810
- y = this.lastX + u, f = this.lastY + w;
1811
- }
1812
- const h = (0, a.createCoreData)(this, y, f);
1813
- if ((0, i.default)("DraggableCore: handleDrag: %j", h), this.props.onDrag(b, h) !== !1 && this.mounted !== !1) this.lastX = y, this.lastY = f;
1814
- else try {
1815
- this.handleDragStop(new MouseEvent("mouseup"));
1816
- } catch {
1817
- const w = document.createEvent("MouseEvents");
1818
- w.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(w);
1819
- }
1820
- }), o(this, "handleDragStop", (b) => {
1821
- if (!this.dragging) return;
1822
- const v = (0, a.getControlPosition)(b, this.touchIdentifier, this);
1823
- if (v == null) return;
1824
- let { x: y, y: f } = v;
1825
- if (Array.isArray(this.props.grid)) {
1826
- let w = y - this.lastX || 0, E = f - this.lastY || 0;
1827
- [w, E] = (0, a.snapToGrid)(this.props.grid, w, E), y = this.lastX + w, f = this.lastY + E;
1828
- }
1829
- const h = (0, a.createCoreData)(this, y, f);
1830
- if (this.props.onStop(b, h) === !1 || this.mounted === !1) return !1;
1831
- const u = this.findDOMNode();
1832
- u && this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(u.ownerDocument), (0, i.default)("DraggableCore: handleDragStop: %j", h), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, u && ((0, i.default)("DraggableCore: Removing handlers"), (0, t.removeEvent)(u.ownerDocument, x.move, this.handleDrag), (0, t.removeEvent)(u.ownerDocument, x.stop, this.handleDragStop));
1833
- }), o(this, "onMouseDown", (b) => (x = p, this.handleDragStart(b))), o(this, "onMouseUp", (b) => (x = p, this.handleDragStop(b))), o(this, "onTouchStart", (b) => (x = c, this.handleDragStart(b))), o(this, "onTouchEnd", (b) => (x = c, this.handleDragStop(b)));
1834
- }
1835
- componentDidMount() {
1836
- this.mounted = !0;
1837
- const b = this.findDOMNode();
1838
- b && (0, t.addEvent)(b, c.start, this.onTouchStart, { passive: !1 });
1839
- }
1840
- componentWillUnmount() {
1841
- this.mounted = !1;
1842
- const b = this.findDOMNode();
1843
- if (b) {
1844
- const { ownerDocument: v } = b;
1845
- (0, t.removeEvent)(v, p.move, this.handleDrag), (0, t.removeEvent)(v, c.move, this.handleDrag), (0, t.removeEvent)(v, p.stop, this.handleDragStop), (0, t.removeEvent)(v, c.stop, this.handleDragStop), (0, t.removeEvent)(b, c.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && (0, t.scheduleRemoveUserSelectStyles)(v);
1846
- }
1847
- }
1848
- findDOMNode() {
1849
- return this.props?.nodeRef ? this.props?.nodeRef?.current : n.default.findDOMNode(this);
1850
- }
1851
- render() {
1852
- return e.cloneElement(e.Children.only(this.props.children), { onMouseDown: this.onMouseDown, onMouseUp: this.onMouseUp, onTouchEnd: this.onTouchEnd });
1853
- }
1854
- };
1855
- return mt.default = m, o(m, "displayName", "DraggableCore"), o(m, "propTypes", { allowAnyClick: r.default.bool, allowMobileScroll: r.default.bool, children: r.default.node.isRequired, disabled: r.default.bool, enableUserSelectHack: r.default.bool, offsetParent: function(b, v) {
1856
- if (b[v] && b[v].nodeType !== 1) throw new Error("Draggable's offsetParent must be a DOM Node.");
1857
- }, grid: r.default.arrayOf(r.default.number), handle: r.default.string, cancel: r.default.string, nodeRef: r.default.object, onStart: r.default.func, onDrag: r.default.func, onStop: r.default.func, onMouseDown: r.default.func, scale: r.default.number, className: s.dontSetMe, style: s.dontSetMe, transform: s.dontSetMe }), o(m, "defaultProps", { allowAnyClick: !1, allowMobileScroll: !1, disabled: !1, enableUserSelectHack: !0, onStart: function() {
1858
- }, onDrag: function() {
1859
- }, onStop: function() {
1860
- }, onMouseDown: function() {
1861
- }, scale: 1 }), mt;
1862
- }
1863
- function la() {
1864
- return ar || (ar = 1, (function(e) {
1865
- Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "DraggableCore", { enumerable: !0, get: function() {
1866
- return o.default;
1867
- } }), e.default = void 0;
1868
- var r = (function(v, y) {
1869
- if (typeof WeakMap == "function") var f = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
1870
- return (function(u, w) {
1871
- if (!w && u && u.__esModule) return u;
1872
- var E, T, B = { __proto__: null, default: u };
1873
- if (u === null || typeof u != "object" && typeof u != "function") return B;
1874
- if (E = w ? h : f) {
1875
- if (E.has(u)) return E.get(u);
1876
- E.set(u, B);
1877
- }
1878
- for (const O in u) O !== "default" && {}.hasOwnProperty.call(u, O) && ((T = (E = Object.defineProperty) && Object.getOwnPropertyDescriptor(u, O)) && (T.get || T.set) ? E(B, O, T) : B[O] = u[O]);
1879
- return B;
1880
- })(v, y);
1881
- })(Q), n = p(gn()), t = p(Rr), a = (function() {
1882
- if (Jn) return Tt.exports;
1883
- function v(f) {
1884
- var h, u, w = "";
1885
- if (typeof f == "string" || typeof f == "number") w += f;
1886
- else if (typeof f == "object") if (Array.isArray(f)) {
1887
- var E = f.length;
1888
- for (h = 0; h < E; h++) f[h] && (u = v(f[h])) && (w && (w += " "), w += u);
1889
- } else for (u in f) f[u] && (w && (w += " "), w += u);
1890
- return w;
1891
- }
1892
- function y() {
1893
- for (var f, h, u = 0, w = "", E = arguments.length; u < E; u++) (f = arguments[u]) && (h = v(f)) && (w && (w += " "), w += h);
1894
- return w;
1895
- }
1896
- return Jn = 1, Tt.exports = y, Tt.exports.clsx = y, Tt.exports;
1897
- })(), s = yn(), i = fo(), l = Ut(), o = p(sa()), c = p(ho());
1898
- function p(v) {
1899
- return v && v.__esModule ? v : { default: v };
1900
- }
1901
- function x() {
1902
- return x = Object.assign ? Object.assign.bind() : function(v) {
1903
- for (var y = 1; y < arguments.length; y++) {
1904
- var f = arguments[y];
1905
- for (var h in f) ({}).hasOwnProperty.call(f, h) && (v[h] = f[h]);
1906
- }
1907
- return v;
1908
- }, x.apply(null, arguments);
1909
- }
1910
- function m(v, y, f) {
1911
- return (y = (function(h) {
1912
- var u = (function(w, E) {
1913
- if (typeof w != "object" || !w) return w;
1914
- var T = w[Symbol.toPrimitive];
1915
- if (T !== void 0) {
1916
- var B = T.call(w, E);
1917
- if (typeof B != "object") return B;
1918
- throw new TypeError("@@toPrimitive must return a primitive value.");
1919
- }
1920
- return (E === "string" ? String : Number)(w);
1921
- })(h, "string");
1922
- return typeof u == "symbol" ? u : u + "";
1923
- })(y)) in v ? Object.defineProperty(v, y, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : v[y] = f, v;
1924
- }
1925
- class b extends r.Component {
1926
- static getDerivedStateFromProps(y, f) {
1927
- let { position: h } = y, { prevPropsPosition: u } = f;
1928
- return !h || u && h.x === u.x && h.y === u.y ? null : ((0, c.default)("Draggable: getDerivedStateFromProps %j", { position: h, prevPropsPosition: u }), { x: h.x, y: h.y, prevPropsPosition: { ...h } });
1929
- }
1930
- constructor(y) {
1931
- super(y), m(this, "onDragStart", (f, h) => {
1932
- if ((0, c.default)("Draggable: onDragStart: %j", h), this.props.onStart(f, (0, i.createDraggableData)(this, h)) === !1) return !1;
1933
- this.setState({ dragging: !0, dragged: !0 });
1934
- }), m(this, "onDrag", (f, h) => {
1935
- if (!this.state.dragging) return !1;
1936
- (0, c.default)("Draggable: onDrag: %j", h);
1937
- const u = (0, i.createDraggableData)(this, h), w = { x: u.x, y: u.y, slackX: 0, slackY: 0 };
1938
- if (this.props.bounds) {
1939
- const { x: E, y: T } = w;
1940
- w.x += this.state.slackX, w.y += this.state.slackY;
1941
- const [B, O] = (0, i.getBoundPosition)(this, w.x, w.y);
1942
- w.x = B, w.y = O, w.slackX = this.state.slackX + (E - w.x), w.slackY = this.state.slackY + (T - w.y), u.x = w.x, u.y = w.y, u.deltaX = w.x - this.state.x, u.deltaY = w.y - this.state.y;
1943
- }
1944
- if (this.props.onDrag(f, u) === !1) return !1;
1945
- this.setState(w);
1946
- }), m(this, "onDragStop", (f, h) => {
1947
- if (!this.state.dragging || this.props.onStop(f, (0, i.createDraggableData)(this, h)) === !1) return !1;
1948
- (0, c.default)("Draggable: onDragStop: %j", h);
1949
- const u = { dragging: !1, slackX: 0, slackY: 0 };
1950
- if (this.props.position) {
1951
- const { x: w, y: E } = this.props.position;
1952
- u.x = w, u.y = E;
1953
- }
1954
- this.setState(u);
1955
- }), this.state = { dragging: !1, dragged: !1, x: y.position ? y.position.x : y.defaultPosition.x, y: y.position ? y.position.y : y.defaultPosition.y, prevPropsPosition: { ...y.position }, slackX: 0, slackY: 0, isElementSVG: !1 }, !y.position || y.onDrag || y.onStop || console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
1956
- }
1957
- componentDidMount() {
1958
- window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
1959
- }
1960
- componentWillUnmount() {
1961
- this.state.dragging && this.setState({ dragging: !1 });
1962
- }
1963
- findDOMNode() {
1964
- return this.props?.nodeRef?.current ?? t.default.findDOMNode(this);
1965
- }
1966
- render() {
1967
- const { axis: y, bounds: f, children: h, defaultPosition: u, defaultClassName: w, defaultClassNameDragging: E, defaultClassNameDragged: T, position: B, positionOffset: O, scale: R, ...S } = this.props;
1968
- let D = {}, P = null;
1969
- const M = !B || this.state.dragging, I = B || u, A = { x: (0, i.canDragX)(this) && M ? this.state.x : I.x, y: (0, i.canDragY)(this) && M ? this.state.y : I.y };
1970
- this.state.isElementSVG ? P = (0, s.createSVGTransform)(A, O) : D = (0, s.createCSSTransform)(A, O);
1971
- const L = (0, a.clsx)(h.props.className || "", w, { [E]: this.state.dragging, [T]: this.state.dragged });
1972
- return r.createElement(o.default, x({}, S, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), r.cloneElement(r.Children.only(h), { className: L, style: { ...h.props.style, ...D }, transform: P }));
1973
- }
1974
- }
1975
- e.default = b, m(b, "displayName", "Draggable"), m(b, "propTypes", { ...o.default.propTypes, axis: n.default.oneOf(["both", "x", "y", "none"]), bounds: n.default.oneOfType([n.default.shape({ left: n.default.number, right: n.default.number, top: n.default.number, bottom: n.default.number }), n.default.string, n.default.oneOf([!1])]), defaultClassName: n.default.string, defaultClassNameDragging: n.default.string, defaultClassNameDragged: n.default.string, defaultPosition: n.default.shape({ x: n.default.number, y: n.default.number }), positionOffset: n.default.shape({ x: n.default.oneOfType([n.default.number, n.default.string]), y: n.default.oneOfType([n.default.number, n.default.string]) }), position: n.default.shape({ x: n.default.number, y: n.default.number }), className: l.dontSetMe, style: l.dontSetMe, transform: l.dontSetMe }), m(b, "defaultProps", { ...o.default.defaultProps, axis: "both", bounds: !1, defaultClassName: "react-draggable", defaultClassNameDragging: "react-draggable-dragging", defaultClassNameDragged: "react-draggable-dragged", defaultPosition: { x: 0, y: 0 }, scale: 1 });
1976
- })(Zn)), Zn;
1977
- }
1978
- var ca = (function() {
1979
- if (sr) return ht.exports;
1980
- sr = 1;
1981
- const { default: e, DraggableCore: r } = la();
1982
- return ht.exports = e, ht.exports.default = e, ht.exports.DraggableCore = r, ht.exports;
1983
- })();
1984
- const ua = Ar(ca), lr = { x: 0, y: 0 }, da = ie(ce((e, r) => {
1985
- const { defaultPosition: n = lr, PaperComponent: t = Ot, onDragStop: a, rootSel: s = ".MuiModal-root", handleSel: i = ".draggable-title", titleSize: l, rootSize: o, ...c } = e, p = me(null), x = ee(() => l && o ? { left: 0, top: 0, right: o.width - l.width, bottom: o.height - l.height } : null, [l, o]), [m, b] = te(null), [v, y] = te(null), [f, h] = te(null);
1986
- return Cr(() => {
1987
- !m && n && b(n ?? lr);
1988
- }, [n]), ke(() => {
1989
- x && m && y({ x: Math.max(0, Math.min(m.x, x.right)), y: Math.max(0, Math.min(m.y, x.bottom)) });
1990
- }, [m, x]), k(ua, { nodeRef: p, handle: i, cancel: '[class*="MuiDialogContent-root"]', position: v, bounds: x ?? ".MuiModal-root", onStop: a, onStart: (u, w) => {
1991
- const E = u;
1992
- h({ x: (E.clientX ?? E.touches?.[0]?.clientX) - w.x, y: (E.clientY ?? E.touches?.[0]?.clientY) - w.y });
1993
- }, onDrag: (u, w) => {
1994
- const E = u, T = E.clientX ?? E.touches?.[0]?.clientX, B = E.clientY ?? E.touches?.[0]?.clientY;
1995
- b({ x: T - f.x, y: B - f.y });
1996
- }, children: k(t, { ref: At([p, r]), ...c }) });
1997
- })), pa = { x: "50", y: "50" }, fa = ie(ce((e, r) => {
1998
- const n = Zo({ props: e, name: "MuiDialog" }), t = un(), a = { enter: 0.66 * t.transitions.duration.enteringScreen, exit: 0.66 * t.transitions.duration.leavingScreen }, { title: s = "SheetXL", key: i = "draggable-window", onCancel: l, onDone: o, onShow: c, onShown: p, onHide: x, open: m, autoFocusSel: b, children: v, TransitionComponent: y = zo, TransitionProps: f, transitionDuration: h = a, BackdropComponent: u = Wo, BackdropProps: w, PaperComponent: E = Ot, PaperProps: T, onBackdropClick: B, sx: O, className: R, onMouseDown: S, initialPosition: D = pa, isModal: P = !1, ...M } = n, I = me(null), [A, L] = te(null), [j, z] = te(!1), [ne, K] = te(!1), q = me(null), [ae, re] = En(), J = me(null), [le, fe] = En(), d = me(null);
1999
- ke(() => {
2000
- A && z(m);
2001
- }, [m, A]);
2002
- const g = se(() => {
2003
- l?.(), z(!1);
2004
- }, [l]);
2005
- ke(() => {
2006
- if (re.width === 0 && re.height === 0 || A) return;
2007
- const V = d.current?.getBoundingClientRect(), W = re.height - V.height, de = re.width - V.width;
2008
- let Je = 0.5 * de, Ve = 0.5 * W;
2009
- typeof D?.x == "number" ? Je = D.x : typeof D?.x == "string" && (Je = de * (parseFloat(D.x) / 100)), typeof D?.y == "number" ? Ve = D.y : typeof D?.y == "string" && (Ve = W * (parseFloat(D.y) / 100)), L({ x: Je, y: Ve });
2010
- }, [re, fe]);
2011
- const [C, N] = te(!1), [_, F] = te(null), [$, U] = te(null), Y = se((V) => {
2012
- if (_) return _.focus(V), !0;
2013
- if (b) {
2014
- const W = J.current?.querySelectorAll?.(b);
2015
- if (W && W.length > 0) return W[0]?.focus?.(V), !0;
2016
- }
2017
- return J.current?.focus?.(V), !1;
2018
- }, [_, b]), G = Tr(r, () => ({ focus: (V) => {
2019
- Y(V);
2020
- } }), []), oe = { ...f, onExited: (V) => {
2021
- o?.(null), f?.onExited?.(V);
2022
- }, onExit: (V) => {
2023
- const W = $;
2024
- W && requestAnimationFrame(() => {
2025
- G.current?.contains(document.activeElement) && W.focus();
2026
- }), x?.(), K(!1), f?.onExit?.(V);
2027
- }, onEntered: (V, W) => {
2028
- c?.(), f?.onEntered?.(V, W);
2029
- }, onEntering: (V, W) => {
2030
- K(!0), p?.(G.current);
2031
- } };
2032
- ke(() => {
2033
- ne && Y();
2034
- }, [ne]);
2035
- let ue = k(aa, { focusTrapOptions: { escapeDeactivates: !1, allowOutsideClick: !0, initialFocus: !1 }, ref: I, active: ne, children: k(y, { in: j, timeout: h, role: "presentation", ...oe, children: k(X, { className: "MuiDialog-container", ref: J, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: (V) => {
2036
- V.which === Ee.Escape && (g(), q.current?.start(V, { center: !1 }), setTimeout(() => q.current?.stop(V), 180)), V.stopPropagation();
2037
- }, children: Z(da, { ref: At([d, r]), className: De({ "Mui-focusVisible": C }, R, "draggable"), sx: { "& *": (V) => Gr(V), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (V) => `solid ${he(V.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (V) => `solid ${he(V.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...O }, defaultPosition: A, titleSize: fe, rootSize: re, PaperComponent: E, ...M, ...T, children: [s ? k(Ho, { className: De({ "Mui-selected": C }, "draggable-title"), sx: { cursor: "move", display: "flex", color: (V) => V.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (V) => `${V.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (V) => V.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (V) => he(V.palette.action.hover, 0.03) }, ref: le, children: Z(X, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (V) => V.spacing(1), marginLeft: (V) => V.spacing(1), marginRight: (V) => V.spacing(1) }, children: [k(X, { sx: { flex: "1 1 100%", paddingLeft: (V) => V.spacing(1) }, children: s }), k(ut, { label: "Close", children: k(Qe, { "aria-label": "close", sx: { color: (V) => V.palette.text.icon ?? V.palette.action.active }, touchRippleRef: q, onPointerDown: (V) => {
2038
- q.current?.start(V, { center: !1 }), V.stopPropagation(), V.preventDefault();
2039
- }, onPointerUp: g, children: k(ve, { iconKey: "Close" }) }) })] }) }) : null, v] }) }) }) }), ge = null;
2040
- P && (ge = k(u, { ...w, open: j, onMouseDown: (V) => {
2041
- g(), w?.onMouseDown?.(V);
2042
- }, onClick: (V) => {
2043
- B?.(V), w?.onClick?.(V);
2044
- }, sx: { pointerEvents: "auto", ...w?.sx } }));
2045
- const { getPortalContainer: Ae } = sn();
2046
- return ei(Z(X, { className: "MuiModal-root", sx: { position: "fixed", zIndex: "1300", right: "0", bottom: "0", top: "0", left: "0", outline: "0", display: "block", pointerEvents: "none" }, ref: At([G, ae]), onPointerDown: (V) => {
2047
- C && (V.target === J.current || V.target.tabIndex < 0) && J.current?.contains(document.activeElement);
2048
- }, onContextMenu: (V) => {
2049
- V.isPropagationStopped() || V.preventDefault();
2050
- }, onFocus: (V) => {
2051
- !C && (V.target === J.current || V.target.tabIndex < 0) && setTimeout(() => {
2052
- Y();
2053
- }, 100), I.current?.focusTrap?.unpause(), N(!0), J.current?.contains(V.target) && V.target !== J.current && F(V.target), V.relatedTarget && !$ && U(V.relatedTarget);
2054
- }, onBlur: (V) => {
2055
- G?.current?.contains(V.relatedTarget) || (U(null), I.current?.focusTrap?.pause(), N(!1));
2056
- }, children: [ge, ue] }), Ae(), i + "");
2057
- }));
2058
- var _e = typeof window < "u" ? window : { screen: {}, navigator: {} }, lt = (_e.matchMedia || function() {
2059
- return { matches: !1 };
2060
- }).bind(_e), ha = { get passive() {
2061
- return !0;
2062
- } }, cr = function() {
2063
- };
2064
- _e.addEventListener && _e.addEventListener("p", cr, ha), _e.removeEventListener && _e.removeEventListener("p", cr, !1);
2065
- var bn = "ontouchstart" in _e, ma = bn || "TouchEvent" in _e && lt("(any-pointer: coarse)").matches, ur = (_e.navigator.maxTouchPoints || 0) > 0 || ma, mo = _e.navigator.userAgent || "", ga = lt("(pointer: coarse)").matches && /iPad|Macintosh/.test(mo) && Math.min(_e.screen.width || 0, _e.screen.height || 0) >= 768, go = (lt("(pointer: coarse)").matches || !lt("(pointer: fine)").matches && bn) && !/Windows.*Firefox/.test(mo), ya = lt("(any-pointer: fine)").matches || lt("(any-hover: hover)").matches || ga || !bn, dr = !ur || !ya && go ? ur ? "touchOnly" : "mouseOnly" : "hybrid", ba = dr === "mouseOnly" ? "mouse" : dr === "touchOnly" || go ? "touch" : "mouse", wt = (e) => e.type === "checkbox", et = (e) => e instanceof Date, Me = (e) => e == null;
2066
- const yo = (e) => typeof e == "object";
2067
- var be = (e) => !Me(e) && !Array.isArray(e) && yo(e) && !et(e), vn = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
2068
- function Se(e) {
2069
- let r;
2070
- const n = Array.isArray(e), t = typeof FileList < "u" && e instanceof FileList;
2071
- if (e instanceof Date) r = new Date(e);
2072
- else {
2073
- if (vn && (e instanceof Blob || t) || !n && !be(e)) return e;
2074
- if (r = n ? [] : Object.create(Object.getPrototypeOf(e)), n || ((a) => {
2075
- const s = a.constructor && a.constructor.prototype;
2076
- return be(s) && s.hasOwnProperty("isPrototypeOf");
2077
- })(e)) for (const a in e) e.hasOwnProperty(a) && (r[a] = Se(e[a]));
2078
- else r = e;
2079
- }
2080
- return r;
2081
- }
2082
- var Yt = (e) => /^\w*$/.test(e), we = (e) => e === void 0, on = (e) => Array.isArray(e) ? e.filter(Boolean) : [], xn = (e) => on(e.replace(/["|']|\]/g, "").split(/\.|\[/)), H = (e, r, n) => {
2083
- if (!r || !be(e)) return n;
2084
- const t = (Yt(r) ? [r] : xn(r)).reduce((a, s) => Me(a) ? a : a[s], e);
2085
- return we(t) || t === e ? we(e[r]) ? n : e[r] : t;
2086
- }, Be = (e) => typeof e == "boolean", pe = (e, r, n) => {
2087
- let t = -1;
2088
- const a = Yt(r) ? [r] : xn(r), s = a.length, i = s - 1;
2089
- for (; ++t < s; ) {
2090
- const l = a[t];
2091
- let o = n;
2092
- if (t !== i) {
2093
- const c = e[l];
2094
- o = be(c) || Array.isArray(c) ? c : isNaN(+a[t + 1]) ? {} : [];
2095
- }
2096
- if (l === "__proto__" || l === "constructor" || l === "prototype") return;
2097
- e[l] = o, e = e[l];
2098
- }
2099
- };
2100
- const va = "blur", xa = "focusout", wa = "onBlur", bo = "onChange", vo = "onSubmit", ka = "onTouched", Dt = "all", Sa = "max", Da = "min", Oa = "maxLength", Ca = "minLength", pr = "pattern", fr = "required", Ea = "validate", xo = Q.createContext(null);
2101
- xo.displayName = "HookFormContext";
2102
- const Ma = (e) => {
2103
- const { children: r, ...n } = e;
2104
- return Q.createElement(xo.Provider, { value: n }, r);
2105
- }, Ta = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
2106
- var je = (e) => typeof e == "string", an = (e) => Me(e) || !yo(e);
2107
- function Xe(e, r, n = /* @__PURE__ */ new WeakSet()) {
2108
- if (an(e) || an(r)) return e === r;
2109
- if (et(e) && et(r)) return e.getTime() === r.getTime();
2110
- const t = Object.keys(e), a = Object.keys(r);
2111
- if (t.length !== a.length) return !1;
2112
- if (n.has(e) || n.has(r)) return !0;
2113
- n.add(e), n.add(r);
2114
- for (const s of t) {
2115
- const i = e[s];
2116
- if (!a.includes(s)) return !1;
2117
- if (s !== "ref") {
2118
- const l = r[s];
2119
- if (et(i) && et(l) || be(i) && be(l) || Array.isArray(i) && Array.isArray(l) ? !Xe(i, l, n) : i !== l) return !1;
2120
- }
2121
- }
2122
- return !0;
2123
- }
2124
- var Pa = (e, r, n, t, a) => r ? { ...n[e], types: { ...n[e] && n[e].types ? n[e].types : {}, [t]: a || !0 } } : {}, bt = (e) => Array.isArray(e) ? e : [e], hr = () => {
2125
- let e = [];
2126
- return { get observers() {
2127
- return e;
2128
- }, next: (r) => {
2129
- for (const n of e) n.next && n.next(r);
2130
- }, subscribe: (r) => (e.push(r), { unsubscribe: () => {
2131
- e = e.filter((n) => n !== r);
2132
- } }), unsubscribe: () => {
2133
- e = [];
2134
- } };
2135
- }, Te = (e) => be(e) && !Object.keys(e).length, wn = (e) => e.type === "file", Ie = (e) => typeof e == "function", Bt = (e) => {
2136
- if (!vn) return !1;
2137
- const r = e ? e.ownerDocument : 0;
2138
- return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2139
- }, wo = (e) => e.type === "select-multiple", kn = (e) => e.type === "radio", Jt = (e) => Bt(e) && e.isConnected;
2140
- function xe(e, r) {
2141
- const n = Array.isArray(r) ? r : Yt(r) ? [r] : xn(r), t = n.length === 1 ? e : (function(i, l) {
2142
- const o = l.slice(0, -1).length;
2143
- let c = 0;
2144
- for (; c < o; ) i = we(i) ? c++ : i[l[c++]];
2145
- return i;
2146
- })(e, n), a = n.length - 1, s = n[a];
2147
- return t && delete t[s], a !== 0 && (be(t) && Te(t) || Array.isArray(t) && (function(i) {
2148
- for (const l in i) if (i.hasOwnProperty(l) && !we(i[l])) return !1;
2149
- return !0;
2150
- })(t)) && xe(e, n.slice(0, -1)), e;
2151
- }
2152
- var ko = (e) => {
2153
- for (const r in e) if (Ie(e[r])) return !0;
2154
- return !1;
2155
- };
2156
- function jt(e, r = {}) {
2157
- const n = Array.isArray(e);
2158
- if (be(e) || n) for (const t in e) Array.isArray(e[t]) || be(e[t]) && !ko(e[t]) ? (r[t] = Array.isArray(e[t]) ? [] : {}, jt(e[t], r[t])) : Me(e[t]) || (r[t] = !0);
2159
- return r;
2160
- }
2161
- function So(e, r, n) {
2162
- const t = Array.isArray(e);
2163
- if (be(e) || t) for (const a in e) Array.isArray(e[a]) || be(e[a]) && !ko(e[a]) ? we(r) || an(n[a]) ? n[a] = Array.isArray(e[a]) ? jt(e[a], []) : { ...jt(e[a]) } : So(e[a], Me(r) ? {} : r[a], n[a]) : n[a] = !Xe(e[a], r[a]);
2164
- return n;
2165
- }
2166
- var gt = (e, r) => So(e, r, jt(r));
2167
- const mr = { value: !1, isValid: !1 }, gr = { value: !0, isValid: !0 };
2168
- var Do = (e) => {
2169
- if (Array.isArray(e)) {
2170
- if (e.length > 1) {
2171
- const r = e.filter((n) => n && n.checked && !n.disabled).map((n) => n.value);
2172
- return { value: r, isValid: !!r.length };
2173
- }
2174
- return e[0].checked && !e[0].disabled ? e[0].attributes && !we(e[0].attributes.value) ? we(e[0].value) || e[0].value === "" ? gr : { value: e[0].value, isValid: !0 } : gr : mr;
2175
- }
2176
- return mr;
2177
- }, Oo = (e, { valueAsNumber: r, valueAsDate: n, setValueAs: t }) => we(e) ? e : r ? e === "" ? NaN : e && +e : n && je(e) ? new Date(e) : t ? t(e) : e;
2178
- const yr = { isValid: !1, value: null };
2179
- var Co = (e) => Array.isArray(e) ? e.reduce((r, n) => n && n.checked && !n.disabled ? { isValid: !0, value: n.value } : r, yr) : yr;
2180
- function br(e) {
2181
- const r = e.ref;
2182
- return wn(r) ? r.files : kn(r) ? Co(e.refs).value : wo(r) ? [...r.selectedOptions].map(({ value: n }) => n) : wt(r) ? Do(e.refs).value : Oo(we(r.value) ? e.ref.value : r.value, e);
2183
- }
2184
- var $t = (e) => e instanceof RegExp, yt = (e) => we(e) ? e : $t(e) ? e.source : be(e) ? $t(e.value) ? e.value.source : e.value : e, vr = (e) => ({ isOnSubmit: !e || e === vo, isOnBlur: e === wa, isOnChange: e === bo, isOnAll: e === Dt, isOnTouch: e === ka });
2185
- const xr = "AsyncFunction";
2186
- var Ra = (e) => !!e && !!e.validate && !!(Ie(e.validate) && e.validate.constructor.name === xr || be(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === xr)), wr = (e, r, n) => !n && (r.watchAll || r.watch.has(e) || [...r.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length))));
2187
- const kt = (e, r, n, t) => {
2188
- for (const a of n || Object.keys(e)) {
2189
- const s = H(e, a);
2190
- if (s) {
2191
- const { _f: i, ...l } = s;
2192
- if (i) {
2193
- if (i.refs && i.refs[0] && r(i.refs[0], a) && !t || i.ref && r(i.ref, i.name) && !t) return !0;
2194
- if (kt(l, r)) break;
2195
- } else if (be(l) && kt(l, r)) break;
2196
- }
2197
- }
2198
- };
2199
- function kr(e, r, n) {
2200
- const t = H(e, n);
2201
- if (t || Yt(n)) return { error: t, name: n };
2202
- const a = n.split(".");
2203
- for (; a.length; ) {
2204
- const s = a.join("."), i = H(r, s), l = H(e, s);
2205
- if (i && !Array.isArray(i) && n !== s) return { name: n };
2206
- if (l && l.type) return { name: s, error: l };
2207
- if (l && l.root && l.root.type) return { name: `${s}.root`, error: l.root };
2208
- a.pop();
2209
- }
2210
- return { name: n };
2211
- }
2212
- var Na = (e, r, n) => {
2213
- const t = bt(H(e, n));
2214
- return pe(t, "root", r[n]), pe(e, n, t), e;
2215
- }, _t = (e) => je(e);
2216
- function Sr(e, r, n = "validate") {
2217
- if (_t(e) || Array.isArray(e) && e.every(_t) || Be(e) && !e) return { type: n, message: _t(e) ? e : "", ref: r };
2218
- }
2219
- var rt = (e) => be(e) && !$t(e) ? e : { value: e, message: "" }, Dr = async (e, r, n, t, a, s) => {
2220
- const { ref: i, refs: l, required: o, maxLength: c, minLength: p, min: x, max: m, pattern: b, validate: v, name: y, valueAsNumber: f, mount: h } = e._f, u = H(n, y);
2221
- if (!h || r.has(y)) return {};
2222
- const w = l ? l[0] : i, E = (M) => {
2223
- a && w.reportValidity && (w.setCustomValidity(Be(M) ? "" : M || ""), w.reportValidity());
2224
- }, T = {}, B = kn(i), O = wt(i), R = B || O, S = (f || wn(i)) && we(i.value) && we(u) || Bt(i) && i.value === "" || u === "" || Array.isArray(u) && !u.length, D = Pa.bind(null, y, t, T), P = (M, I, A, L = Oa, j = Ca) => {
2225
- const z = M ? I : A;
2226
- T[y] = { type: M ? L : j, message: z, ref: i, ...D(M ? L : j, z) };
2227
- };
2228
- if (s ? !Array.isArray(u) || !u.length : o && (!R && (S || Me(u)) || Be(u) && !u || O && !Do(l).isValid || B && !Co(l).isValid)) {
2229
- const { value: M, message: I } = _t(o) ? { value: !!o, message: o } : rt(o);
2230
- if (M && (T[y] = { type: fr, message: I, ref: w, ...D(fr, I) }, !t)) return E(I), T;
2231
- }
2232
- if (!(S || Me(x) && Me(m))) {
2233
- let M, I;
2234
- const A = rt(m), L = rt(x);
2235
- if (Me(u) || isNaN(u)) {
2236
- const j = i.valueAsDate || new Date(u), z = (q) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + q), ne = i.type == "time", K = i.type == "week";
2237
- je(A.value) && u && (M = ne ? z(u) > z(A.value) : K ? u > A.value : j > new Date(A.value)), je(L.value) && u && (I = ne ? z(u) < z(L.value) : K ? u < L.value : j < new Date(L.value));
2238
- } else {
2239
- const j = i.valueAsNumber || u && +u;
2240
- Me(A.value) || (M = j > A.value), Me(L.value) || (I = j < L.value);
2241
- }
2242
- if ((M || I) && (P(!!M, A.message, L.message, Sa, Da), !t)) return E(T[y].message), T;
2243
- }
2244
- if ((c || p) && !S && (je(u) || s && Array.isArray(u))) {
2245
- const M = rt(c), I = rt(p), A = !Me(M.value) && u.length > +M.value, L = !Me(I.value) && u.length < +I.value;
2246
- if ((A || L) && (P(A, M.message, I.message), !t)) return E(T[y].message), T;
2247
- }
2248
- if (b && !S && je(u)) {
2249
- const { value: M, message: I } = rt(b);
2250
- if ($t(M) && !u.match(M) && (T[y] = { type: pr, message: I, ref: i, ...D(pr, I) }, !t)) return E(I), T;
2251
- }
2252
- if (v) {
2253
- if (Ie(v)) {
2254
- const M = Sr(await v(u, n), w);
2255
- if (M && (T[y] = { ...M, ...D(Ea, M.message) }, !t)) return E(M.message), T;
2256
- } else if (be(v)) {
2257
- let M = {};
2258
- for (const I in v) {
2259
- if (!Te(M) && !t) break;
2260
- const A = Sr(await v[I](u, n), w, I);
2261
- A && (M = { ...A, ...D(I, A.message) }, E(A.message), t && (T[y] = M));
2262
- }
2263
- if (!Te(M) && (T[y] = { ref: w, ...M }, !t)) return T;
2264
- }
2265
- }
2266
- return E(!0), T;
2267
- };
2268
- const Fa = { mode: vo, reValidateMode: bo, shouldFocusError: !0 };
2269
- function _a(e = {}) {
2270
- let r, n = { ...Fa, ...e }, t = { submitCount: 0, isDirty: !1, isReady: !1, isLoading: Ie(n.defaultValues), isValidating: !1, isSubmitted: !1, isSubmitting: !1, isSubmitSuccessful: !1, isValid: !1, touchedFields: {}, dirtyFields: {}, validatingFields: {}, errors: n.errors || {}, disabled: n.disabled || !1 }, a = {}, s = (be(n.defaultValues) || be(n.values)) && Se(n.defaultValues || n.values) || {}, i = n.shouldUnregister ? {} : Se(s), l = { action: !1, mount: !1, watch: !1 }, o = { mount: /* @__PURE__ */ new Set(), disabled: /* @__PURE__ */ new Set(), unMount: /* @__PURE__ */ new Set(), array: /* @__PURE__ */ new Set(), watch: /* @__PURE__ */ new Set() }, c = 0;
2271
- const p = { isDirty: !1, dirtyFields: !1, validatingFields: !1, touchedFields: !1, isValidating: !1, isValid: !1, errors: !1 };
2272
- let x = { ...p };
2273
- const m = { array: hr(), state: hr() }, b = n.criteriaMode === Dt, v = async (d) => {
2274
- if (!n.disabled && (p.isValid || x.isValid || d)) {
2275
- const g = n.resolver ? Te((await w()).errors) : await E(a, !0);
2276
- g !== t.isValid && m.state.next({ isValid: g });
2277
- }
2278
- }, y = (d, g) => {
2279
- !n.disabled && (p.isValidating || p.validatingFields || x.isValidating || x.validatingFields) && ((d || Array.from(o.mount)).forEach((C) => {
2280
- C && (g ? pe(t.validatingFields, C, g) : xe(t.validatingFields, C));
2281
- }), m.state.next({ validatingFields: t.validatingFields, isValidating: !Te(t.validatingFields) }));
2282
- }, f = (d, g, C, N) => {
2283
- const _ = H(a, d);
2284
- if (_) {
2285
- const F = H(i, d, we(C) ? H(s, d) : C);
2286
- we(F) || N && N.defaultChecked || g ? pe(i, d, g ? F : br(_._f)) : O(d, F), l.mount && v();
2287
- }
2288
- }, h = (d, g, C, N, _) => {
2289
- let F = !1, $ = !1;
2290
- const U = { name: d };
2291
- if (!n.disabled) {
2292
- if (!C || N) {
2293
- (p.isDirty || x.isDirty) && ($ = t.isDirty, t.isDirty = U.isDirty = T(), F = $ !== U.isDirty);
2294
- const Y = Xe(H(s, d), g);
2295
- $ = !!H(t.dirtyFields, d), Y ? xe(t.dirtyFields, d) : pe(t.dirtyFields, d, !0), U.dirtyFields = t.dirtyFields, F = F || (p.dirtyFields || x.dirtyFields) && $ !== !Y;
2296
- }
2297
- if (C) {
2298
- const Y = H(t.touchedFields, d);
2299
- Y || (pe(t.touchedFields, d, C), U.touchedFields = t.touchedFields, F = F || (p.touchedFields || x.touchedFields) && Y !== C);
2300
- }
2301
- F && _ && m.state.next(U);
2302
- }
2303
- return F ? U : {};
2304
- }, u = (d, g, C, N) => {
2305
- const _ = H(t.errors, d), F = (p.isValid || x.isValid) && Be(g) && t.isValid !== g;
2306
- var $;
2307
- if (n.delayError && C ? ($ = () => ((U, Y) => {
2308
- pe(t.errors, U, Y), m.state.next({ errors: t.errors });
2309
- })(d, C), r = (U) => {
2310
- clearTimeout(c), c = setTimeout($, U);
2311
- }, r(n.delayError)) : (clearTimeout(c), r = null, C ? pe(t.errors, d, C) : xe(t.errors, d)), (C ? !Xe(_, C) : _) || !Te(N) || F) {
2312
- const U = { ...N, ...F && Be(g) ? { isValid: g } : {}, errors: t.errors, name: d };
2313
- t = { ...t, ...U }, m.state.next(U);
2314
- }
2315
- }, w = async (d) => {
2316
- y(d, !0);
2317
- const g = await n.resolver(i, n.context, ((C, N, _, F) => {
2318
- const $ = {};
2319
- for (const U of C) {
2320
- const Y = H(N, U);
2321
- Y && pe($, U, Y._f);
2322
- }
2323
- return { criteriaMode: _, names: [...C], fields: $, shouldUseNativeValidation: F };
2324
- })(d || o.mount, a, n.criteriaMode, n.shouldUseNativeValidation));
2325
- return y(d), g;
2326
- }, E = async (d, g, C = { valid: !0 }) => {
2327
- for (const N in d) {
2328
- const _ = d[N];
2329
- if (_) {
2330
- const { _f: F, ...$ } = _;
2331
- if (F) {
2332
- const U = o.array.has(F.name), Y = _._f && Ra(_._f);
2333
- Y && p.validatingFields && y([N], !0);
2334
- const G = await Dr(_, o.disabled, i, b, n.shouldUseNativeValidation && !g, U);
2335
- if (Y && p.validatingFields && y([N]), G[F.name] && (C.valid = !1, g)) break;
2336
- !g && (H(G, F.name) ? U ? Na(t.errors, G, F.name) : pe(t.errors, F.name, G[F.name]) : xe(t.errors, F.name));
2337
- }
2338
- !Te($) && await E($, g, C);
2339
- }
2340
- }
2341
- return C.valid;
2342
- }, T = (d, g) => !n.disabled && (d && g && pe(i, d, g), !Xe(I(), s)), B = (d, g, C) => ((N, _, F, $, U) => je(N) ? ($ && _.watch.add(N), H(F, N, U)) : Array.isArray(N) ? N.map((Y) => ($ && _.watch.add(Y), H(F, Y))) : ($ && (_.watchAll = !0), F))(d, o, { ...l.mount ? i : we(g) ? s : je(d) ? { [d]: g } : g }, C, g), O = (d, g, C = {}) => {
2343
- const N = H(a, d);
2344
- let _ = g;
2345
- if (N) {
2346
- const F = N._f;
2347
- F && (!F.disabled && pe(i, d, Oo(g, F)), _ = Bt(F.ref) && Me(g) ? "" : g, wo(F.ref) ? [...F.ref.options].forEach(($) => $.selected = _.includes($.value)) : F.refs ? wt(F.ref) ? F.refs.forEach(($) => {
2348
- $.defaultChecked && $.disabled || (Array.isArray(_) ? $.checked = !!_.find((U) => U === $.value) : $.checked = _ === $.value || !!_);
2349
- }) : F.refs.forEach(($) => $.checked = $.value === _) : wn(F.ref) ? F.ref.value = "" : (F.ref.value = _, F.ref.type || m.state.next({ name: d, values: Se(i) })));
2350
- }
2351
- (C.shouldDirty || C.shouldTouch) && h(d, _, C.shouldTouch, C.shouldDirty, !0), C.shouldValidate && M(d);
2352
- }, R = (d, g, C) => {
2353
- for (const N in g) {
2354
- if (!g.hasOwnProperty(N)) return;
2355
- const _ = g[N], F = d + "." + N, $ = H(a, F);
2356
- (o.array.has(d) || be(_) || $ && !$._f) && !et(_) ? R(F, _, C) : O(F, _, C);
2357
- }
2358
- }, S = (d, g, C = {}) => {
2359
- const N = H(a, d), _ = o.array.has(d), F = Se(g);
2360
- pe(i, d, F), _ ? (m.array.next({ name: d, values: Se(i) }), (p.isDirty || p.dirtyFields || x.isDirty || x.dirtyFields) && C.shouldDirty && m.state.next({ name: d, dirtyFields: gt(s, i), isDirty: T(d, F) })) : !N || N._f || Me(F) ? O(d, F, C) : R(d, F, C), wr(d, o) && m.state.next({ ...t, name: d }), m.state.next({ name: l.mount ? d : void 0, values: Se(i) });
2361
- }, D = async (d) => {
2362
- l.mount = !0;
2363
- const g = d.target;
2364
- let C = g.name, N = !0;
2365
- const _ = H(a, C), F = (Y) => {
2366
- N = Number.isNaN(Y) || et(Y) && isNaN(Y.getTime()) || Xe(Y, H(i, C, Y));
2367
- }, $ = vr(n.mode), U = vr(n.reValidateMode);
2368
- if (_) {
2369
- let Y, G;
2370
- const oe = g.type ? br(_._f) : ((de) => be(de) && de.target ? wt(de.target) ? de.target.checked : de.target.value : de)(d), ue = d.type === va || d.type === xa, ge = !((de) => de.mount && (de.required || de.min || de.max || de.maxLength || de.minLength || de.pattern || de.validate))(_._f) && !n.resolver && !H(t.errors, C) && !_._f.deps || ((de, Je, Ve, Dn, Ct) => !Ct.isOnAll && (!Ve && Ct.isOnTouch ? !(Je || de) : (Ve ? Dn.isOnBlur : Ct.isOnBlur) ? !de : !(Ve ? Dn.isOnChange : Ct.isOnChange) || de))(ue, H(t.touchedFields, C), t.isSubmitted, U, $), Ae = wr(C, o, ue);
2371
- pe(i, C, oe), ue ? g && g.readOnly || (_._f.onBlur && _._f.onBlur(d), r && r(0)) : _._f.onChange && _._f.onChange(d);
2372
- const V = h(C, oe, ue), W = !Te(V) || Ae;
2373
- if (!ue && m.state.next({ name: C, type: d.type, values: Se(i) }), ge) return (p.isValid || x.isValid) && (n.mode === "onBlur" ? ue && v() : ue || v()), W && m.state.next({ name: C, ...Ae ? {} : V });
2374
- if (!ue && Ae && m.state.next({ ...t }), n.resolver) {
2375
- const { errors: de } = await w([C]);
2376
- if (F(oe), N) {
2377
- const Je = kr(t.errors, a, C), Ve = kr(de, a, Je.name || C);
2378
- Y = Ve.error, C = Ve.name, G = Te(de);
2379
- }
2380
- } else y([C], !0), Y = (await Dr(_, o.disabled, i, b, n.shouldUseNativeValidation))[C], y([C]), F(oe), N && (Y ? G = !1 : (p.isValid || x.isValid) && (G = await E(a, !0)));
2381
- N && (_._f.deps && M(_._f.deps), u(C, G, Y, V));
2382
- }
2383
- }, P = (d, g) => {
2384
- if (H(t.errors, g) && d.focus) return d.focus(), 1;
2385
- }, M = async (d, g = {}) => {
2386
- let C, N;
2387
- const _ = bt(d);
2388
- if (n.resolver) {
2389
- const F = await (async ($) => {
2390
- const { errors: U } = await w($);
2391
- if ($) for (const Y of $) {
2392
- const G = H(U, Y);
2393
- G ? pe(t.errors, Y, G) : xe(t.errors, Y);
2394
- }
2395
- else t.errors = U;
2396
- return U;
2397
- })(we(d) ? d : _);
2398
- C = Te(F), N = d ? !_.some(($) => H(F, $)) : C;
2399
- } else d ? (N = (await Promise.all(_.map(async (F) => {
2400
- const $ = H(a, F);
2401
- return await E($ && $._f ? { [F]: $ } : $);
2402
- }))).every(Boolean), (N || t.isValid) && v()) : N = C = await E(a);
2403
- return m.state.next({ ...!je(d) || (p.isValid || x.isValid) && C !== t.isValid ? {} : { name: d }, ...n.resolver || !d ? { isValid: C } : {}, errors: t.errors }), g.shouldFocus && !N && kt(a, P, d ? _ : o.mount), N;
2404
- }, I = (d) => {
2405
- const g = { ...l.mount ? i : s };
2406
- return we(d) ? g : je(d) ? H(g, d) : d.map((C) => H(g, C));
2407
- }, A = (d, g) => ({ invalid: !!H((g || t).errors, d), isDirty: !!H((g || t).dirtyFields, d), error: H((g || t).errors, d), isValidating: !!H(t.validatingFields, d), isTouched: !!H((g || t).touchedFields, d) }), L = (d, g, C) => {
2408
- const N = (H(a, d, { _f: {} })._f || {}).ref, _ = H(t.errors, d) || {}, { ref: F, message: $, type: U, ...Y } = _;
2409
- pe(t.errors, d, { ...Y, ...g, ref: N }), m.state.next({ name: d, errors: t.errors, isValid: !1 }), C && C.shouldFocus && N && N.focus && N.focus();
2410
- }, j = (d) => m.state.subscribe({ next: (g) => {
2411
- var C, N, _;
2412
- C = d.name, N = g.name, _ = d.exact, C && N && C !== N && !bt(C).some((F) => F && (_ ? F === N : F.startsWith(N) || N.startsWith(F))) || !((F, $, U, Y) => {
2413
- U(F);
2414
- const { name: G, ...oe } = F;
2415
- return Te(oe) || Object.keys(oe).length >= Object.keys($).length || Object.keys(oe).find((ue) => $[ue] === (!Y || Dt));
2416
- })(g, d.formState || p, le, d.reRenderRoot) || d.callback({ values: { ...i }, ...t, ...g, defaultValues: s });
2417
- } }).unsubscribe, z = (d, g = {}) => {
2418
- for (const C of d ? bt(d) : o.mount) o.mount.delete(C), o.array.delete(C), g.keepValue || (xe(a, C), xe(i, C)), !g.keepError && xe(t.errors, C), !g.keepDirty && xe(t.dirtyFields, C), !g.keepTouched && xe(t.touchedFields, C), !g.keepIsValidating && xe(t.validatingFields, C), !n.shouldUnregister && !g.keepDefaultValue && xe(s, C);
2419
- m.state.next({ values: Se(i) }), m.state.next({ ...t, ...g.keepDirty ? { isDirty: T() } : {} }), !g.keepIsValid && v();
2420
- }, ne = ({ disabled: d, name: g }) => {
2421
- (Be(d) && l.mount || d || o.disabled.has(g)) && (d ? o.disabled.add(g) : o.disabled.delete(g));
2422
- }, K = (d, g = {}) => {
2423
- let C = H(a, d);
2424
- const N = Be(g.disabled) || Be(n.disabled);
2425
- return pe(a, d, { ...C || {}, _f: { ...C && C._f ? C._f : { ref: { name: d } }, name: d, mount: !0, ...g } }), o.mount.add(d), C ? ne({ disabled: Be(g.disabled) ? g.disabled : n.disabled, name: d }) : f(d, !0, g.value), { ...N ? { disabled: g.disabled || n.disabled } : {}, ...n.progressive ? { required: !!g.required, min: yt(g.min), max: yt(g.max), minLength: yt(g.minLength), maxLength: yt(g.maxLength), pattern: yt(g.pattern) } : {}, name: d, onChange: D, onBlur: D, ref: (_) => {
2426
- if (_) {
2427
- K(d, g), C = H(a, d);
2428
- const F = we(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, $ = ((Y) => kn(Y) || wt(Y))(F), U = C._f.refs || [];
2429
- if ($ ? U.find((Y) => Y === F) : F === C._f.ref) return;
2430
- pe(a, d, { _f: { ...C._f, ...$ ? { refs: [...U.filter(Jt), F, ...Array.isArray(H(s, d)) ? [{}] : []], ref: { type: F.type, name: d } } : { ref: F } } }), f(d, !1, void 0, F);
2431
- } else C = H(a, d, {}), C._f && (C._f.mount = !1), (n.shouldUnregister || g.shouldUnregister) && (!((F, $) => F.has(((U) => U.substring(0, U.search(/\.\d+(\.|$)/)) || U)($)))(o.array, d) || !l.action) && o.unMount.add(d);
2432
- } };
2433
- }, q = () => n.shouldFocusError && kt(a, P, o.mount), ae = (d, g) => async (C) => {
2434
- let N;
2435
- C && (C.preventDefault && C.preventDefault(), C.persist && C.persist());
2436
- let _ = Se(i);
2437
- if (m.state.next({ isSubmitting: !0 }), n.resolver) {
2438
- const { errors: F, values: $ } = await w();
2439
- t.errors = F, _ = Se($);
2440
- } else await E(a);
2441
- if (o.disabled.size) for (const F of o.disabled) xe(_, F);
2442
- if (xe(t.errors, "root"), Te(t.errors)) {
2443
- m.state.next({ errors: {} });
2444
- try {
2445
- await d(_, C);
2446
- } catch (F) {
2447
- N = F;
2448
- }
2449
- } else g && await g({ ...t.errors }, C), q(), setTimeout(q);
2450
- if (m.state.next({ isSubmitted: !0, isSubmitting: !1, isSubmitSuccessful: Te(t.errors) && !N, submitCount: t.submitCount + 1, errors: t.errors }), N) throw N;
2451
- }, re = (d, g = {}) => {
2452
- const C = d ? Se(d) : s, N = Se(C), _ = Te(d), F = _ ? s : N;
2453
- if (g.keepDefaultValues || (s = C), !g.keepValues) {
2454
- if (g.keepDirtyValues) {
2455
- const $ = /* @__PURE__ */ new Set([...o.mount, ...Object.keys(gt(s, i))]);
2456
- for (const U of Array.from($)) H(t.dirtyFields, U) ? pe(F, U, H(i, U)) : S(U, H(F, U));
2457
- } else {
2458
- if (vn && we(d)) for (const $ of o.mount) {
2459
- const U = H(a, $);
2460
- if (U && U._f) {
2461
- const Y = Array.isArray(U._f.refs) ? U._f.refs[0] : U._f.ref;
2462
- if (Bt(Y)) {
2463
- const G = Y.closest("form");
2464
- if (G) {
2465
- G.reset();
2466
- break;
2467
- }
2468
- }
2469
- }
2470
- }
2471
- if (g.keepFieldsRef) for (const $ of o.mount) S($, H(F, $));
2472
- else a = {};
2473
- }
2474
- i = n.shouldUnregister ? g.keepDefaultValues ? Se(s) : {} : Se(F), m.array.next({ values: { ...F } }), m.state.next({ values: { ...F } });
2475
- }
2476
- o = { mount: g.keepDirtyValues ? o.mount : /* @__PURE__ */ new Set(), unMount: /* @__PURE__ */ new Set(), array: /* @__PURE__ */ new Set(), disabled: /* @__PURE__ */ new Set(), watch: /* @__PURE__ */ new Set(), watchAll: !1, focus: "" }, l.mount = !p.isValid || !!g.keepIsValid || !!g.keepDirtyValues, l.watch = !!n.shouldUnregister, m.state.next({ submitCount: g.keepSubmitCount ? t.submitCount : 0, isDirty: !_ && (g.keepDirty ? t.isDirty : !(!g.keepDefaultValues || Xe(d, s))), isSubmitted: !!g.keepIsSubmitted && t.isSubmitted, dirtyFields: _ ? {} : g.keepDirtyValues ? g.keepDefaultValues && i ? gt(s, i) : t.dirtyFields : g.keepDefaultValues && d ? gt(s, d) : g.keepDirty ? t.dirtyFields : {}, touchedFields: g.keepTouched ? t.touchedFields : {}, errors: g.keepErrors ? t.errors : {}, isSubmitSuccessful: !!g.keepIsSubmitSuccessful && t.isSubmitSuccessful, isSubmitting: !1, defaultValues: s });
2477
- }, J = (d, g) => re(Ie(d) ? d(i) : d, g), le = (d) => {
2478
- t = { ...t, ...d };
2479
- }, fe = { control: { register: K, unregister: z, getFieldState: A, handleSubmit: ae, setError: L, _subscribe: j, _runSchema: w, _focusError: q, _getWatch: B, _getDirty: T, _setValid: v, _setFieldArray: (d, g = [], C, N, _ = !0, F = !0) => {
2480
- if (N && C && !n.disabled) {
2481
- if (l.action = !0, F && Array.isArray(H(a, d))) {
2482
- const $ = C(H(a, d), N.argA, N.argB);
2483
- _ && pe(a, d, $);
2484
- }
2485
- if (F && Array.isArray(H(t.errors, d))) {
2486
- const $ = C(H(t.errors, d), N.argA, N.argB);
2487
- _ && pe(t.errors, d, $), ((U, Y) => {
2488
- !on(H(U, Y)).length && xe(U, Y);
2489
- })(t.errors, d);
2490
- }
2491
- if ((p.touchedFields || x.touchedFields) && F && Array.isArray(H(t.touchedFields, d))) {
2492
- const $ = C(H(t.touchedFields, d), N.argA, N.argB);
2493
- _ && pe(t.touchedFields, d, $);
2494
- }
2495
- (p.dirtyFields || x.dirtyFields) && (t.dirtyFields = gt(s, i)), m.state.next({ name: d, isDirty: T(d, g), dirtyFields: t.dirtyFields, errors: t.errors, isValid: t.isValid });
2496
- } else pe(i, d, g);
2497
- }, _setDisabledField: ne, _setErrors: (d) => {
2498
- t.errors = d, m.state.next({ errors: t.errors, isValid: !1 });
2499
- }, _getFieldArray: (d) => on(H(l.mount ? i : s, d, n.shouldUnregister ? H(s, d, []) : [])), _reset: re, _resetDefaultValues: () => Ie(n.defaultValues) && n.defaultValues().then((d) => {
2500
- J(d, n.resetOptions), m.state.next({ isLoading: !1 });
2501
- }), _removeUnmounted: () => {
2502
- for (const d of o.unMount) {
2503
- const g = H(a, d);
2504
- g && (g._f.refs ? g._f.refs.every((C) => !Jt(C)) : !Jt(g._f.ref)) && z(d);
2505
- }
2506
- o.unMount = /* @__PURE__ */ new Set();
2507
- }, _disableForm: (d) => {
2508
- Be(d) && (m.state.next({ disabled: d }), kt(a, (g, C) => {
2509
- const N = H(a, C);
2510
- N && (g.disabled = N._f.disabled || d, Array.isArray(N._f.refs) && N._f.refs.forEach((_) => {
2511
- _.disabled = N._f.disabled || d;
2512
- }));
2513
- }, 0, !1));
2514
- }, _subjects: m, _proxyFormState: p, get _fields() {
2515
- return a;
2516
- }, get _formValues() {
2517
- return i;
2518
- }, get _state() {
2519
- return l;
2520
- }, set _state(d) {
2521
- l = d;
2522
- }, get _defaultValues() {
2523
- return s;
2524
- }, get _names() {
2525
- return o;
2526
- }, set _names(d) {
2527
- o = d;
2528
- }, get _formState() {
2529
- return t;
2530
- }, get _options() {
2531
- return n;
2532
- }, set _options(d) {
2533
- n = { ...n, ...d };
2534
- } }, subscribe: (d) => (l.mount = !0, x = { ...x, ...d.formState }, j({ ...d, formState: x })), trigger: M, register: K, handleSubmit: ae, watch: (d, g) => Ie(d) ? m.state.subscribe({ next: (C) => "values" in C && d(B(void 0, g), C) }) : B(d, g, !0), setValue: S, getValues: I, reset: J, resetField: (d, g = {}) => {
2535
- H(a, d) && (we(g.defaultValue) ? S(d, Se(H(s, d))) : (S(d, g.defaultValue), pe(s, d, Se(g.defaultValue))), g.keepTouched || xe(t.touchedFields, d), g.keepDirty || (xe(t.dirtyFields, d), t.isDirty = g.defaultValue ? T(d, Se(H(s, d))) : T()), g.keepError || (xe(t.errors, d), p.isValid && v()), m.state.next({ ...t }));
2536
- }, clearErrors: (d) => {
2537
- d && bt(d).forEach((g) => xe(t.errors, g)), m.state.next({ errors: d ? t.errors : {} });
2538
- }, unregister: z, setError: L, setFocus: (d, g = {}) => {
2539
- const C = H(a, d), N = C && C._f;
2540
- if (N) {
2541
- const _ = N.refs ? N.refs[0] : N.ref;
2542
- _.focus && (_.focus(), g.shouldSelect && Ie(_.select) && _.select());
2543
- }
2544
- }, getFieldState: A };
2545
- return { ...fe, formControl: fe };
2546
- }
2547
- function Aa(e = {}) {
2548
- const r = Q.useRef(void 0), n = Q.useRef(void 0), [t, a] = Q.useState({ isDirty: !1, isValidating: !1, isLoading: Ie(e.defaultValues), isSubmitted: !1, isSubmitting: !1, isSubmitSuccessful: !1, isValid: !1, submitCount: 0, dirtyFields: {}, touchedFields: {}, validatingFields: {}, errors: e.errors || {}, disabled: e.disabled || !1, isReady: !1, defaultValues: Ie(e.defaultValues) ? void 0 : e.defaultValues });
2549
- if (!r.current) if (e.formControl) r.current = { ...e.formControl, formState: t }, e.defaultValues && !Ie(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
2550
- else {
2551
- const { formControl: i, ...l } = _a(e);
2552
- r.current = { ...l, formState: t };
2553
- }
2554
- const s = r.current.control;
2555
- return s._options = e, Ta(() => {
2556
- const i = s._subscribe({ formState: s._proxyFormState, callback: () => a({ ...s._formState }), reRenderRoot: !0 });
2557
- return a((l) => ({ ...l, isReady: !0 })), s._formState.isReady = !0, i;
2558
- }, [s]), Q.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), Q.useEffect(() => {
2559
- e.mode && (s._options.mode = e.mode), e.reValidateMode && (s._options.reValidateMode = e.reValidateMode);
2560
- }, [s, e.mode, e.reValidateMode]), Q.useEffect(() => {
2561
- e.errors && (s._setErrors(e.errors), s._focusError());
2562
- }, [s, e.errors]), Q.useEffect(() => {
2563
- e.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
2564
- }, [s, e.shouldUnregister]), Q.useEffect(() => {
2565
- if (s._proxyFormState.isDirty) {
2566
- const i = s._getDirty();
2567
- i !== t.isDirty && s._subjects.state.next({ isDirty: i });
2568
- }
2569
- }, [s, t.isDirty]), Q.useEffect(() => {
2570
- e.values && !Xe(e.values, n.current) ? (s._reset(e.values, { keepFieldsRef: !0, ...s._options.resetOptions }), n.current = e.values, a((i) => ({ ...i }))) : s._resetDefaultValues();
2571
- }, [s, e.values]), Q.useEffect(() => {
2572
- s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
2573
- }), r.current.formState = ((i, l, o, c = !0) => {
2574
- const p = { defaultValues: l._defaultValues };
2575
- for (const x in i) Object.defineProperty(p, x, { get: () => {
2576
- const m = x;
2577
- return l._proxyFormState[m] !== Dt && (l._proxyFormState[m] = !c || Dt), i[m];
2578
- } });
2579
- return p;
2580
- })(t, s), r.current;
2581
- }
2582
- const Ia = ["Ok", "Cancel"], Or = ie(ce((e, r) => {
2583
- const { description: n, icon: t, onCancel: a, onOption: s, onDone: i, onValidateOption: l, createOptionsButton: o, options: c = Ia, autoFocusSel: p = ".defaultOption", defaultOption: x = c[0], cancelOption: m = "Cancel", children: b, ...v } = e, y = Aa({ shouldUseNativeValidation: !1 }), { handleSubmit: f, formState: h } = y, u = me(null), w = me(null), E = me(null), T = se(async (P) => {
2584
- let M;
2585
- try {
2586
- if (M = await Promise.resolve(l?.(P)) ?? !0, M !== !0) return;
2587
- await Promise.resolve(s?.(P, P === m, P === x)), i?.(P);
2588
- } catch {
2589
- }
2590
- }, [s, i, l, m, x]), B = se((P, M) => {
2591
- setTimeout(() => {
2592
- T(x);
2593
- }, 180);
2594
- }, [T]), O = se(() => {
2595
- s?.(m, !0, !1), a?.(), i?.(null);
2596
- }, [s, m, a, i]), R = h && (Object.keys(h.errors).length > 0 || h.disabled || h.isSubmitted), S = se((P, M) => {
2597
- const I = P === m, A = { className: M ? "defaultOption" : "action", type: M ? "submit" : "button", style: { minWidth: "75px" }, onClick: () => {
2598
- I ? O() : M || T(P);
2599
- } };
2600
- if (o) return o(P, A, M);
2601
- const L = { className: M ? "defaultOption" : "action", variant: M ? "contained" : "outlined", size: "small", disabled: !I && R, color: "primary", ...A };
2602
- if (M || I) {
2603
- const j = M ? u : w;
2604
- L.touchRippleRef = j, L.onPointerDown = (z) => {
2605
- j.current?.start(z, { center: !1 }), z.stopPropagation(), z.preventDefault();
2606
- };
2607
- }
2608
- return k(Uo, { ...L, children: k("div", { style: { paddingTop: "3px" }, children: P }) }, `action:${P}`);
2609
- }, [c, x, m, o, h]), D = ee(() => {
2610
- const P = [];
2611
- for (let M = 0; M < c.length; M++) {
2612
- const I = c[M], A = x ? I === x : M === 0;
2613
- P.push(S(I, A));
2614
- }
2615
- return P;
2616
- }, [c, x, h]);
2617
- return k(fa, { onCancel: O, initialPosition: { y: ba === "touch" ? "15" : "35" }, onDone: i, autoFocusSel: p, isModal: !0, ref: r, PaperProps: {}, ...v, children: k(Ma, { ...y, children: Z("form", { ref: E, onSubmit: f(B), children: [k(Yo, { dividers: !0, onKeyDown: (P) => {
2618
- if (P.isDefaultPrevented()) return;
2619
- P.stopPropagation();
2620
- let M = null, I = null;
2621
- const A = P.which === Ee.Escape && m;
2622
- if (A) M = m, I = w;
2623
- else {
2624
- if (R) return;
2625
- P.which === Ee.Enter && (M = x ?? c[0], I = u);
2626
- }
2627
- M && (I.current?.start(P, { center: !1 }), setTimeout(() => {
2628
- I.current?.stop(P), A && T(M);
2629
- }, 180));
2630
- }, children: Z(X, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (P) => P.spacing(t || n ? 1.5 : 0) }, children: [Z(X, { sx: { display: "flex", flexDirection: "column" }, children: [t, k(Ce, { children: n })] }), b] }) }), k(Ko, { sx: { paddingTop: (P) => P.spacing(1), paddingBottom: (P) => P.spacing(1), paddingLeft: (P) => P.spacing(1), paddingRight: (P) => P.spacing(1), backgroundColor: (P) => he(P.palette.action.hover, 0.03) }, children: D })] }) }) });
2631
- })), Va = Object.freeze(Object.defineProperty({ __proto__: null, OptionsDialog: Or, default: Or }, Symbol.toStringTag, { value: "Module" })), La = Q.lazy(() => Promise.resolve().then(() => Va)), Ds = (e) => {
2632
- const { showModal: r } = mn();
2633
- return (n) => new Promise((t) => {
2634
- const a = r(La, { ...e, ...n, onOption(s) {
2635
- n?.onOption?.(s, s === n.cancelOption, s === n.defaultOption), t(s);
2636
- }, onDone: () => {
2637
- n?.onDone?.(), a.hide();
2638
- } });
2639
- });
2640
- }, Ba = Q.lazy(() => import("./BTZ_PiSM7GBlYmi5.mjs")), Os = (e) => {
2641
- const { showModal: r } = mn();
2642
- return (n) => {
2643
- const { defaultOption: t = n.options?.[0], cancelOption: a = "Cancel", ...s } = n;
2644
- return new Promise((i) => {
2645
- const l = r(Ba, { ...e, defaultOption: t, cancelOption: a, ...s, onOption(o) {
2646
- s?.onOption?.(o, o === a, o === t), i({ input: "", option: o });
2647
- }, onInputOption(o, c) {
2648
- s?.onInputOption?.(o, c), i({ input: o, option: c });
2649
- }, onDone: () => {
2650
- s?.onDone?.(), l.hide();
2651
- } });
2652
- });
2653
- };
2654
- }, Sn = ie(ce((e, r) => {
2655
- const { command: n, disabled: t = !1, shortcut: a, children: s, ...i } = e;
2656
- return ln(n), k(ut, { ref: r, label: t !== void 0 ? n?.label() : "", shortcut: a !== void 0 ? a : Array.isArray(n?.shortcut()) ? n?.shortcut()[0] : n?.shortcut(), description: n?.description(), disabled: t, chips: n?.tags(), componentDisabled: n?.disabled(), ...i, children: k("div", { style: { display: "flex", flex: "1 1 0%" }, children: s }) });
2657
- })), ja = k(ve, {}), $a = ie(ce((e, r) => {
2658
- const { command: n, commandHook: t, scope: a, context: s, icon: i, label: l, disabled: o = !1, variant: c = Ne.Toolbar, shortcut: p, commandState: x, tooltipProps: m, ...b } = e, v = me(null), y = me(!1), f = ee(() => {
2659
- const R = { onExecute(S, D) {
2660
- t?.onExecute?.(S, D), y.current || (v.current?.start({ center: !1 }), setTimeout(() => v.current?.stop({}), 180)), y.current = !1;
2661
- }, onError(S, D, P) {
2662
- t?.onError(S, D, P);
2663
- } };
2664
- return t?.beforeExecute && (R.beforeExecute = t.beforeExecute), R;
2665
- }, [t]), h = ln(n, f), u = Re((R) => {
2666
- R.button === 0 && R.preventDefault();
2667
- }, []), w = Re((R) => {
2668
- R.button === 0 && n?.execute(x, t);
2669
- }, [h, t, x]), E = Re((R) => {
2670
- R.keyCode !== Ee.Enter && R.keyCode !== Ee.Space || n?.execute(x, t);
2671
- }, [h, t, x]), T = ee(() => {
2672
- if (i) return typeof i == "function" ? i(n) : i;
2673
- let R = n?.icon(s);
2674
- return R ? (typeof R == "string" && (R = k(ve, { iconKey: R })), R) : c === Ne.Toolbar || n?.state() ? void 0 : ja;
2675
- }, [h, i]), B = ee(() => ({ tabIndex: 0, ref: r, selected: n?.state(), icon: c === Ne.Toolbar ? T : k(Fi, { selected: n?.state() ?? !1, children: T }), touchRippleRef: v, disabled: o || !n || n.disabled(), onMouseDown: u, onMouseUp: w, onKeyDown: E }), [h, t, o, T]);
2676
- let O;
2677
- return O = c === Ne.Menuitem ? k(St, { ...b, chips: n?.tags(), ...B, children: l ?? n?.label(a, s) }) : k(Ht, { ...b, ...B }), (l || n?.label()) && ((n.disabled() || o) && (O = k("div", { children: O })), O = k(Sn, { command: n, placement: c === Ne.Toolbar ? "bottom-start" : "right-start", shortcut: p, ...m, children: O })), O;
2678
- })), za = k(ve, {}), Cs = ie(ce((e, r) => {
2679
- const { command: n, scope: t, icon: a = za, label: s, variant: i = Ne.Toolbar, disabled: l = !1, commandHook: o, ...c } = e, p = me(null), x = me(!1), m = ee(() => {
2680
- const O = { onExecute(R, S) {
2681
- o?.onExecute?.(R, S), x.current || (p.current?.start({ center: !1 }), setTimeout(() => p.current?.stop({}), 180)), x.current = !1;
2682
- }, onError(R, S, D) {
2683
- o?.onError(R, S, D);
2684
- } };
2685
- return o?.beforeExecute && (O.beforeExecute = o.beforeExecute), O;
2686
- }, [o]), b = ln(n, m), v = () => n?.state()?.toString() || "0", [y, f] = te(v), h = se(() => {
2687
- const O = parseFloat(y);
2688
- isNaN(O) ? f(v()) : parseFloat(v()) !== O && n.execute(O, o);
2689
- }, [v, n, y, o]);
2690
- ke(() => {
2691
- f(v());
2692
- }, [n?.state()]);
2693
- const u = ee(() => {
2694
- let O = typeof a == "function" ? a(n) : a;
2695
- return O && (O = n?.icon()), typeof O == "string" && (O = k(ve, { iconKey: O })), O;
2696
- }, [b, a, n?.icon]), w = ee(() => s === void 0 ? n?.label(t) : typeof s == "function" ? s() : s, [b]), E = ee(() => k(Qe, { ...c, sx: { paddingTop: "0px", paddingBottom: "0px" }, component: "div", disableRipple: !0, onClick: (O) => O.stopPropagation(), onMouseDown: (O) => {
2697
- O.button === 0 && O.stopPropagation();
2698
- }, onMouseUp: (O) => {
2699
- O.button === 0 && O.stopPropagation();
2700
- }, children: k(Xo, { inputMode: "numeric", disabled: l || !n || n.disabled(), inputProps: { tabIndex: 0, name: `input-${n.key()}`, autoComplete: "off", type: "number", maxLength: 4 }, sx: { paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (O) => `${Math.round(O.typography.fontSize)}px`, width: (O) => "3.2em", input: { padding: "0 0", textAlign: "center", MozAppearance: "textfield" }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" }, minHeight: "24px" }, value: y, onFocus: (O) => {
2701
- O.target?.select();
2702
- }, onKeyDown: (O) => {
2703
- if (O.which === Ee.Enter) v() !== y && (O.stopPropagation(), O.preventDefault(), h());
2704
- else if (O.which === Ee.Escape) v() !== y && (f(v()), setTimeout(() => {
2705
- O.target?.select();
2706
- }, 0), O.stopPropagation(), O.preventDefault());
2707
- else {
2708
- if (O.key.match("[-]") || O.key.match("[0-9.]") && (y + O.key).length > 4) return O.stopPropagation(), void O.preventDefault();
2709
- if (O.which === Ee.Space) return void O.preventDefault();
2710
- }
2711
- }, onBlur: () => {
2712
- h();
2713
- }, onChange: (O) => {
2714
- if (O.target.value.length > 4) return O.stopPropagation(), void O.preventDefault();
2715
- f(O.target.value);
2716
- } }) }), [y, l, n]), T = { tabIndex: 0, ref: r, icon: u, touchRippleRef: p, disabled: l || !n || n.disabled(), onMouseDown: (O) => {
2717
- O.button === 0 && O.preventDefault();
2718
- }, onMouseUp: (O) => {
2719
- O.button !== 0 || O.isPropagationStopped() || O.isDefaultPrevented() || O.isDefaultPrevented() || (O.preventDefault(), n?.execute(!n?.state?.(), m));
2720
- }, onKeyDown: (O) => {
2721
- O.keyCode !== Ee.Enter && O.keyCode !== Ee.Space || n?.execute(!n?.state?.(), m);
2722
- } };
2723
- let B;
2724
- return B = i === Ne.Menuitem ? Z(St, { ...c, chips: n?.tags(), ...T, children: [w, E] }) : k(Ht, { ...c, ...T }), n?.label() && ((n.disabled() || l) && (B = k("div", { children: B })), B = k(Sn, { command: n, placement: i === Ne.Toolbar ? "bottom-start" : "right-start", children: B })), B;
2725
- })), Eo = ie(ce((e, r) => {
2726
- const { variant: n = Ne.Toolbar, quickCommand: t, onQuickClick: a, commands: s, commandState: i, commandHook: l, disabled: o, label: c, icon: p, createPopupPanel: x, tooltip: m, selected: b, scope: v, ...y } = e, f = me(null), h = me(!1), u = ee(() => {
2727
- const D = { onExecute(P, M) {
2728
- l?.onExecute?.(P, M), h.current || (f.current?.start({ center: !1 }), setTimeout(() => f.current?.stop({}), 180)), h.current = !1;
2729
- }, onError(P, M, I) {
2730
- l?.onError(P, M, I);
2731
- } };
2732
- return l?.beforeExecute && (D.beforeExecute = l.beforeExecute), D;
2733
- }, [l]), w = cn(s, [t], null, [t]), E = w[0], { label: T, icon: B } = ee(() => {
2734
- let D = null;
2735
- c && (D = typeof c == "function" ? c(E) : c), D || (D = E?.label?.(v));
2736
- let P = p;
2737
- return P || (P = E?.icon?.()), typeof P == "string" ? P = k(ve, { iconKey: P }) : typeof P == "function" && (P = P(E)), { label: D, icon: P };
2738
- }, [w, c, p]), O = { disabled: o, scope: v, touchRippleRef: f, onQuickClick: a, tooltip: m, label: T, icon: B };
2739
- (T || m) && (O.createTooltip = ({ children: D }, P) => k(ut, { label: T, description: m, disabled: P, children: D }));
2740
- const R = se((D) => x?.(D, s), [x, w]), S = se((D) => E?.execute(i, u), [E]);
2741
- return E ? (O.quickButtonProps = {}, O.quickButtonProps.createTooltip = ({ children: D, placement: P }, M) => k(Sn, { command: E, placement: P ?? n === Ne.Toolbar ? "bottom-start" : "right-start", disabled: M, children: D }), O.disabled = O.disabled ?? E?.disabled(), a || (O.onQuickClick = S)) : t && (O.onQuickClick = () => {
2742
- }), O.selected = b ?? E?.state(), O.createPopupPanel = R, n === Ne.Toolbar ? k(hn, { ...y, ...O, ref: r }) : k(Zr, { ...y, ...O, ref: r });
2743
- }));
2744
- Eo.displayName = "CommandPopupButton";
2745
- const Wa = k(ve, { iconKey: "Check" }), Es = (e) => {
2746
- const { command: r, label: n, scope: t, icon: a = Wa, sx: s, ...i } = e;
2747
- return Z(X, { sx: { display: "flex", flexDirection: "row", textTransform: "none", alignItems: "center", fontSize: (l) => l.typography.subtitle2.fontSize, ...s }, ...i, children: [a, k(Ce, { component: "div", sx: { whiteSpace: "nowrap", lineHeight: "1", paddingLeft: (l) => l.spacing(0.25), paddingRight: (l) => l.spacing(0.25), fontSize: "inherit" }, children: r?.label(t) || n })] });
2748
- }, Ha = ie(ce((e, r) => {
2749
- const { sx: n, commands: t, commandButtonProps: a, parentFloat: s, createToolbarPalette: i, children: l, ...o } = e, c = Tr(r, () => ({}), []), [p, x] = te(null), { reference: m } = Wt({ label: "toolbar", anchor: c.current, parentFloat: s, createPopupPanel: null }), b = Re(() => {
2750
- const O = p;
2751
- O && requestAnimationFrame(() => {
2752
- c.current?.contains(document.activeElement) && O.focus();
2753
- });
2754
- }, []), v = ee(() => ({ dense: !0, outlined: !1 }), []), y = ee(() => {
2755
- const { commandHook: O, ...R } = a || {};
2756
- return { commandHook: { beforeExecute: (S, D) => O?.beforeExecute?.(S, D) !== !1 && m.closeAll(), onExecute(S, D) {
2757
- O?.onExecute?.(S, D), b();
2758
- }, onError(S, D, P) {
2759
- O?.onError?.(S, D, P);
2760
- } }, ...R };
2761
- }, [m, a]), f = ee(() => ({ ...v, ...y }), [v, y]), [h, u] = _o((O) => O + 1, 0);
2762
- cn(t, [], { onChange: () => {
2763
- u();
2764
- } });
2765
- const w = ee(() => ({ commands: t, parentFloat: m, ...y }), [h, f, m, a]);
2766
- let E = 0;
2767
- v.dense || (E += 2), v.outlined && E++;
2768
- let T = 2;
2769
- v.dense || (T = 4);
2770
- const B = ee(() => i({ commands: t, commandButtonProps: f, commandPopupProps: { commands: t, ...w, ...a } }), [h, f, w, i]);
2771
- return k(Go, { variant: "dense", sx: { minHeight: "unset", height: "unset", paddingTop: `${T}px`, paddingBottom: `${T}px`, paddingLeft: "6px !important", paddingRight: "6px !important", flex: "1 1 0%", alignItems: "center", userSelect: "none", flexGrow: 1, display: "flex", overflow: "hidden", ...n }, ref: c, onFocus: (O) => {
2772
- O.relatedTarget && !p && x(O.relatedTarget);
2773
- }, onBlur: (O) => {
2774
- p && !c?.current?.contains(O.relatedTarget) && x(null);
2775
- }, onKeyDown: (O) => {
2776
- p && O.which === Ee.Escape && p.focus();
2777
- }, ...o, children: k("div", { ref: c, style: { flex: "1 1 100%", display: "flex", flexWrap: "wrap", rowGap: `${T}px`, columnGap: `${E}px`, alignItems: "center", maxWidth: "100%" }, children: B }) });
2778
- }));
2779
- Ha.displayName = "CommandToolbar";
2780
- const Ua = (e) => {
2781
- const { key: r, ...n } = e;
2782
- return k($a, { ...n }, r);
2783
- }, Ms = ie(ce((e, r) => {
2784
- const { popupCommandKeys: n, renderCommandButton: t = Ua, scope: a, commands: s, quickCommand: i, popupScope: l = i, commandState: o, commandHook: c, disabled: p = !1, ...x } = e, m = cn(s, n ? [i, ...n] : [i]), b = Re((v, y) => {
2785
- const f = { variant: Ne.Menuitem, commandHook: c, commandState: o, scope: l, disabled: p }, h = [];
2786
- for (let u = 0; u < n?.length; u++) {
2787
- const w = n[u];
2788
- if (w === null || w === "-") {
2789
- h.push(k(ti, { orientation: "horizontal" }, `element-${h.length}`));
2790
- continue;
2791
- }
2792
- const E = y.getCommand(w), T = { key: `${w}-${h.length}`, command: E, ...f }, B = t(T);
2793
- B && h.push(B);
2794
- }
2795
- return fn({ ...v, children: h });
2796
- }, [p, c, o, l, n, t]);
2797
- return n ? k(Eo, { ref: r, commands: s, disabled: p, commandHook: c, commandState: o, scope: a, quickCommand: i, createPopupPanel: b, ...x }) : t({ ref: r, disabled: p, commandHook: c, commandState: o, scope: a, command: m[0], ...x });
2798
- }));
2799
- export {
2800
- ki as $,
2801
- Xr as A,
2802
- as as B,
2803
- ss as C,
2804
- ls as D,
2805
- Ht as E,
2806
- ci as F,
2807
- ui as G,
2808
- Lr as H,
2809
- Br as I,
2810
- bs as J,
2811
- ct as K,
2812
- ai as L,
2813
- ws as M,
2814
- Si as N,
2815
- Or as O,
2816
- Ss as P,
2817
- fa as Q,
2818
- Ds as R,
2819
- Fi as S,
2820
- ds as T,
2821
- Os as U,
2822
- Li as V,
2823
- ks as W,
2824
- mn as X,
2825
- Kr as Y,
2826
- gs as Z,
2827
- ys as _,
2828
- St as a,
2829
- fn as a0,
2830
- Vn as a1,
2831
- Wt as a2,
2832
- qr as a3,
2833
- $a as a4,
2834
- Cs as a5,
2835
- Eo as a6,
2836
- Sn as a7,
2837
- Es as a8,
2838
- Ha as a9,
2839
- Ms as aa,
2840
- vs as b,
2841
- De as c,
2842
- hn as d,
2843
- Zr as e,
2844
- xs as f,
2845
- ut as g,
2846
- wi as h,
2847
- _n as i,
2848
- fs as j,
2849
- cs as k,
2850
- us as l,
2851
- bi as m,
2852
- hs as n,
2853
- ps as o,
2854
- ts as p,
2855
- Fr as q,
2856
- ns as r,
2857
- Gr as s,
2858
- Jr as t,
2859
- ms as u,
2860
- rs as v,
2861
- ti as w,
2862
- os as x,
2863
- oi as y,
2864
- is as z
2865
- };