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