@sheetxl/utils-mui 0.7.22 → 0.7.23-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/browser/cjs/CMDyOaq_TZmhbR3R.cjs +1 -0
  2. package/browser/cjs/GeHQP4M_1ydWv9v4.cjs +3 -0
  3. package/browser/cjs/index.cjs +4 -7
  4. package/browser/esm/CNIMtMKGuDo4psnZ.mjs +96 -0
  5. package/browser/esm/D0mXROj4on9piZY1.mjs +2544 -0
  6. package/browser/esm/index.mjs +2688 -72
  7. package/licenses/dependencies.txt +60 -198
  8. package/node/esm/C2bOUbQGN6BujoBn.mjs +97 -0
  9. package/node/esm/index.mjs +3354 -981
  10. package/package.json +12 -14
  11. package/resources/contents.json +18 -0
  12. package/resources/locales/contents.json +16 -0
  13. package/resources/locales/de/ui.msg.json +22 -0
  14. package/resources/locales/en/ui.msg.json +22 -0
  15. package/types/index.d.ts +2 -1068
  16. package/types/src/button/ButtonContent.d.ts +17 -0
  17. package/types/src/button/ButtonContent.d.ts.map +1 -0
  18. package/types/src/button/ExhibitIconButton.d.ts +31 -0
  19. package/types/src/button/ExhibitIconButton.d.ts.map +1 -0
  20. package/types/src/button/ExhibitMenuHeader.d.ts +15 -0
  21. package/types/src/button/ExhibitMenuHeader.d.ts.map +1 -0
  22. package/types/src/button/ExhibitMenuItem.d.ts +24 -0
  23. package/types/src/button/ExhibitMenuItem.d.ts.map +1 -0
  24. package/types/src/button/ExhibitOptionButton.d.ts +16 -0
  25. package/types/src/button/ExhibitOptionButton.d.ts.map +1 -0
  26. package/types/src/button/ExhibitPopupIconButton.d.ts +18 -0
  27. package/types/src/button/ExhibitPopupIconButton.d.ts.map +1 -0
  28. package/types/src/button/ExhibitPopupMenuItem.d.ts +8 -0
  29. package/types/src/button/ExhibitPopupMenuItem.d.ts.map +1 -0
  30. package/types/src/button/ExhibitTooltip.d.ts +26 -0
  31. package/types/src/button/ExhibitTooltip.d.ts.map +1 -0
  32. package/types/src/button/OverflowPalette.d.ts +29 -0
  33. package/types/src/button/OverflowPalette.d.ts.map +1 -0
  34. package/types/src/button/SelectedIcon.d.ts +18 -0
  35. package/types/src/button/SelectedIcon.d.ts.map +1 -0
  36. package/types/src/button/index.d.ts +11 -0
  37. package/types/src/button/index.d.ts.map +1 -0
  38. package/types/src/command/CommandButton.d.ts +4 -0
  39. package/types/src/command/CommandButton.d.ts.map +1 -0
  40. package/types/src/command/CommandGroup.d.ts +71 -0
  41. package/types/src/command/CommandGroup.d.ts.map +1 -0
  42. package/types/src/command/CommandPopupButton.d.ts +34 -0
  43. package/types/src/command/CommandPopupButton.d.ts.map +1 -0
  44. package/types/src/command/CommandToolbar.d.ts +51 -0
  45. package/types/src/command/CommandToolbar.d.ts.map +1 -0
  46. package/types/src/command/CommandTooltip.d.ts +22 -0
  47. package/types/src/command/CommandTooltip.d.ts.map +1 -0
  48. package/types/src/command/InputCommandButton.d.ts +20 -0
  49. package/types/src/command/InputCommandButton.d.ts.map +1 -0
  50. package/types/src/command/ToggleGroupButton.d.ts +33 -0
  51. package/types/src/command/ToggleGroupButton.d.ts.map +1 -0
  52. package/types/src/command/index.d.ts +8 -0
  53. package/types/src/command/index.d.ts.map +1 -0
  54. package/types/src/command/useManagedRipple.d.ts +23 -0
  55. package/types/src/command/useManagedRipple.d.ts.map +1 -0
  56. package/types/src/components/AnimatedLoadingPanel.d.ts +45 -0
  57. package/types/src/components/AnimatedLoadingPanel.d.ts.map +1 -0
  58. package/types/src/components/ChipStrip.d.ts +9 -0
  59. package/types/src/components/ChipStrip.d.ts.map +1 -0
  60. package/types/src/components/ContextMenu.d.ts +32 -0
  61. package/types/src/components/ContextMenu.d.ts.map +1 -0
  62. package/types/src/components/ExhibitDivider.d.ts +6 -0
  63. package/types/src/components/ExhibitDivider.d.ts.map +1 -0
  64. package/types/src/components/NestingPopupButton.d.ts +11 -0
  65. package/types/src/components/NestingPopupButton.d.ts.map +1 -0
  66. package/types/src/components/ScrollButtons.d.ts +7 -0
  67. package/types/src/components/ScrollButtons.d.ts.map +1 -0
  68. package/types/src/components/SimpleTooltip.d.ts +15 -0
  69. package/types/src/components/SimpleTooltip.d.ts.map +1 -0
  70. package/types/src/components/StackTrace.d.ts +20 -0
  71. package/types/src/components/StackTrace.d.ts.map +1 -0
  72. package/types/src/components/StackTraceErrorPanel.d.ts +28 -0
  73. package/types/src/components/StackTraceErrorPanel.d.ts.map +1 -0
  74. package/types/src/components/index.d.ts +10 -0
  75. package/types/src/components/index.d.ts.map +1 -0
  76. package/types/src/dialog/InputDialog.d.ts +8 -0
  77. package/types/src/dialog/InputDialog.d.ts.map +1 -0
  78. package/types/src/dialog/InternalWindow.d.ts +142 -0
  79. package/types/src/dialog/InternalWindow.d.ts.map +1 -0
  80. package/types/src/dialog/OptionsDialog.d.ts +19 -0
  81. package/types/src/dialog/OptionsDialog.d.ts.map +1 -0
  82. package/types/src/dialog/index.d.ts +10 -0
  83. package/types/src/dialog/index.d.ts.map +1 -0
  84. package/types/src/dialog/useInputDialog.d.ts +6 -0
  85. package/types/src/dialog/useInputDialog.d.ts.map +1 -0
  86. package/types/src/dialog/useLazyWindow.d.ts +14 -0
  87. package/types/src/dialog/useLazyWindow.d.ts.map +1 -0
  88. package/types/src/dialog/useOptionsDialog.d.ts +8 -0
  89. package/types/src/dialog/useOptionsDialog.d.ts.map +1 -0
  90. package/types/src/float/ExhibitFloatPanel.d.ts +22 -0
  91. package/types/src/float/ExhibitFloatPanel.d.ts.map +1 -0
  92. package/types/src/float/ExhibitFloatProvider.d.ts +17 -0
  93. package/types/src/float/ExhibitFloatProvider.d.ts.map +1 -0
  94. package/types/src/float/ExhibitPopup.d.ts +97 -0
  95. package/types/src/float/ExhibitPopup.d.ts.map +1 -0
  96. package/types/src/float/index.d.ts +4 -0
  97. package/types/src/float/index.d.ts.map +1 -0
  98. package/types/src/index.d.ts +8 -0
  99. package/types/src/index.d.ts.map +1 -0
  100. package/types/src/locales/index.d.ts +3 -0
  101. package/types/src/locales/index.d.ts.map +1 -0
  102. package/types/src/theme/ExhibitTheme.d.ts +71 -0
  103. package/types/src/theme/ExhibitTheme.d.ts.map +1 -0
  104. package/types/src/theme/IconSupport.d.ts +11 -0
  105. package/types/src/theme/IconSupport.d.ts.map +1 -0
  106. package/types/src/theme/ScrollbarTheming.d.ts +12 -0
  107. package/types/src/theme/ScrollbarTheming.d.ts.map +1 -0
  108. package/types/src/theme/index.d.ts +4 -0
  109. package/types/src/theme/index.d.ts.map +1 -0
  110. package/browser/cjs/D1lQsAtkthIA1gmc.cjs +0 -11
  111. package/browser/cjs/ucpR4Be9i5BxBYwW.cjs +0 -6
  112. package/browser/esm/BuNquM-zy3ad2Jy2.mjs +0 -2891
  113. package/browser/esm/NQ1Ofksqlh69CQ9k.mjs +0 -44
  114. package/node/assets/style.css +0 -1
  115. package/node/esm/B5nodPb2Wtops82M.mjs +0 -45
@@ -1,998 +1,3371 @@
1
1
  /**
2
- * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.22
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { jsx as e, jsxs as t, Fragment as o } from "react/jsx-runtime";
8
- import n, { memo as r, forwardRef as i, useMemo as a, useRef as l, useEffect as s, useState as c, useImperativeHandle as d, useCallback as p, useLayoutEffect as u, useReducer as m } from "react";
9
- import h from "clsx";
10
- import { alpha as f, darken as x, lighten as g } from "@mui/system";
11
- import { IconButton as b, Divider as y, Box as v, Typography as k, Paper as w, Chip as C, Popper as M, Grow as S, Tooltip as R, ListItemIcon as P, MenuItem as D, Fade as E, Backdrop as T, DialogTitle as z, Button as $, DialogContent as O, DialogActions as I, Input as N, Toolbar as B } from "@mui/material";
12
- import { ErrorUtils as L, CommonUtils as F } from "@sheetxl/utils";
13
- import { defaultCreateScrollEdgeButton as A, ScrollbarOrientation as H, DynamicIcon as W, useCallbackRef as K, useFullscreenPortal as V, KeyCodes as j, KeyModifiers as _, ReactUtils as q, useImperativeElement as Q, useCommand as U, CommandButtonType as G, useCommands as X } from "@sheetxl/utils-react";
14
- import { useTheme as Y, styled as J, createTheme as Z, useThemeProps as ee } from "@mui/material/styles";
15
- import { deepmerge as te } from "@mui/utils";
16
- import { detectOverflow as oe } from "@popperjs/core";
17
- import { mergeRefs as ne } from "react-merge-refs";
18
- import { useIsomorphicLayoutEffect as re, useMeasure as ie } from "react-use";
19
- import ae from "tiny-invariant";
20
- import { useModal as le } from "mui-modal-provider";
2
+ * @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.23-beta.2
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { Backdrop as e, Box as t, Button as r, Chip as o, CircularProgress as n, DialogActions as i, DialogContent as a, DialogTitle as l, Divider as s, Fade as c, IconButton as d, Input as p, LinearProgress as u, ListItemButton as m, ListItemIcon as h, Paper as f, Toolbar as g, Tooltip as x, Typography as b, Unstable_TrapFocus as y, createTheme as v, useTheme as k, useThemeProps as w } from "@mui/material";
8
+ import { Fragment as C, jsx as M, jsxs as S } from "react/jsx-runtime";
9
+ import { Children as T, Fragment as P, cloneElement as R, forwardRef as D, isValidElement as $, lazy as I, memo as B, useCallback as z, useEffect as N, useId as L, useLayoutEffect as O, useMemo as E, useReducer as F, useRef as K, useState as A } from "react";
10
+ import W from "clsx";
11
+ import { alpha as H, darken as V, lighten as q } from "@mui/system";
12
+ import { CommonUtils as j, ErrorUtils as Q } from "@sheetxl/utils";
13
+ import { Command as U, CommandButtonType as G, CommandFocusProvider as X, DynamicIcon as Y, FloatPopper as _, FloatProvider as J, FloatStackProvider as Z, KeyCodes as ee, KeyModifiers as te, ReactUtils as re, ScrollbarOrientation as oe, defaultCreateScrollEdgeButton as ne, floatThemeScopeProps as ie, getScrollbarCssVariables as ae, useCallbackRef as le, useCommandButtonRegistry as se, useCommands as ce, useFloat as de, useFloatStack as pe, useFloatSurface as ue, useFullscreenPortal as me, useImperativeElement as he, useTranslator as fe } from "@sheetxl/utils-react";
14
+ import { mergeRefs as ge } from "react-merge-refs";
15
+ import { useIsomorphicLayoutEffect as xe, useMeasure as be } from "react-use";
16
+ import { deepmerge as ye } from "@mui/utils";
17
+ import ve from "tiny-invariant";
18
+ import ke, { useModal as we } from "mui-modal-provider";
19
+ import { createPortal as Ce } from "react-dom";
20
+ import Me from "react-draggable";
21
+ import { primaryInput as Se } from "detect-it";
22
+ import { FormProvider as Te, useForm as Pe } from "react-hook-form";
23
+ import Re from "@mui/material/ButtonBase/TouchRipple";
21
24
  export * from "mui-modal-provider";
22
- import { default as default2 } from "mui-modal-provider";
23
- import { createPortal as se } from "react-dom";
24
- import ce from "focus-trap-react";
25
- import de from "react-draggable";
26
- import { primaryInput as pe } from "detect-it";
27
- import { useForm as ue, FormProvider as me } from "react-hook-form";
28
- const he = (e2) => {
29
- const t2 = { style: { cursor: "pointer" }, ...e2 };
30
- return A(t2);
31
- }, fe = (t2, o2, n2, r2) => {
32
- const { style: i2, ...a2 } = t2, l2 = e(b, { component: "div", ...a2, style: { ...i2, padding: "0px" }, sx: { padding: "0" }, color: t2.disabled ? void 0 : "primary", "aria-label": n2, size: "small", children: o2 });
33
- return e(bt, { title: t2.disabled ? n2 : r2, enterDelay: 800, enterNextDelay: 1600, children: t2.disabled ? e("div", { style: { display: "flex" }, children: l2 }) : l2 });
34
- }, xe = (t2) => fe(t2, H.Horizontal ? e(W, { iconKey: "ArrowLeft", size: "small" }) : e(W, { iconKey: "ArrowUpward", size: "small" }), "Scroll " + (t2.orientation === H.Horizontal ? "Left" : "Up"), `Scroll ${t2.orientation === H.Horizontal ? "left" : "up"}, 'Ctrl+Click' to scroll to the beginning`), ge = (t2) => fe(t2, H.Horizontal ? e(W, { iconKey: "ArrowRight", size: "small" }) : e(W, { iconKey: "ArrowDownward", size: "small" }), "Scroll " + (t2.orientation === H.Horizontal ? "Right" : "Down"), `Scroll ${t2.orientation === H.Horizontal ? "right" : "down"}, 'Ctrl+Click' to scroll to the end`), be = r(i((t2, o2) => {
35
- const { orientation: n2 = "vertical", sx: r2, ...i2 } = t2, a2 = "vertical" === n2;
36
- return e(y, { ref: o2, sx: { marginLeft: a2 ? "2px" : void 0, marginRight: a2 ? "2px" : void 0, backgroundColor: "transparent !important", minHeight: a2 ? "1em" : void 0, minWidth: a2 ? void 0 : "1em", borderColor: (e2) => e2.palette.divider, ...r2 }, orientation: n2, variant: "middle", flexItem: true, ...i2 });
37
- })), ye = "_traverse-ellipsis_14l1h_1", ve = r((o2) => {
38
- const { sx: n2, speed: r2 = 2, size: i2 = 70, ...a2 } = o2;
39
- return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, "& .primary": { stroke: (e2) => e2.palette.grey[600], fill: "none" }, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "primary", strokeWidth: "4", cx: "50", cy: "50", r: "48" }), e("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "85", y2: "50.5", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) }), e("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "49.5", y2: "74", children: e("animateTransform", { attributeName: "transform", dur: 7.5 * r2 + "s", type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) })] }) });
40
- }), ke = r((o2) => {
41
- const { sx: n2, speed: r2 = 1.5, size: i2 = 70, ...a2 } = o2;
42
- return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, "& .primary": { fill: (e2) => e2.palette.grey[600] }, "& .secondary": { stroke: (e2) => e2.palette.grey[600], fill: "none", opacity: 0.5 }, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "secondary", strokeWidth: "4", cx: "50", cy: "50", r: "21" }), e("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: e("animateTransform", { attributeName: "transform", type: "rotate", dur: 1 * r2 + "s", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) })] }) });
43
- }), we = r((o2) => {
44
- const { sx: n2, speed: r2 = 1, size: i2 = 70, ...a2 } = o2;
45
- return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "primary", cx: "6", cy: "50", r: "6", children: e("animate", { attributeName: "opacity", dur: `${r2}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.1" }) }), e("circle", { className: "primary", cx: "26", cy: "50", r: "6", children: e("animate", { attributeName: "opacity", dur: `${r2}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.2" }) }), e("circle", { className: "primary", cx: "46", cy: "50", r: "6", children: e("animate", { attributeName: "opacity", dur: `${r2}s`, values: "0;1;0", repeatCount: "indefinite", begin: "0.3" }) })] }) });
46
- }), Ce = r((o2) => {
47
- const { sx: n2, speed: r2 = 1, size: i2 = 70, ...a2 } = o2;
48
- return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, "& .primary": { fill: (e2) => e2.palette.grey[600], stroke: "none" }, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "primary", cx: "6", cy: "50", r: "6", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "translate", values: "0 15 ; 0 -15; 0 15", repeatCount: "indefinite", begin: "0.1" }) }), e("circle", { className: "primary", cx: "30", cy: "50", r: "6", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "translate", values: "0 10 ; 0 -10; 0 10", repeatCount: "indefinite", begin: "0.2" }) }), e("circle", { className: "primary", cx: "54", cy: "50", r: "6", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "translate", values: "0 5 ; 0 -5; 0 5", repeatCount: "indefinite", begin: "0.3" }) })] }) });
49
- }), Me = r((o2) => {
50
- const { sx: n2, speed: r2 = 2, size: i2 = 70, ...a2 } = o2;
51
- return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, "& .primary": { stroke: (e2) => e2.palette.grey[600], opacity: 0.5, fill: "none" }, "& .secondary": { fillOpacity: (e2) => e2.palette.grey[600], opacity: 0.8, stroke: (e2) => e2.palette.background.paper }, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "primary", strokeWidth: "4", cx: "50", cy: "50", r: "44" }), e("circle", { className: "secondary", strokeWidth: "3", cx: "8", cy: "54", r: "6", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "rotate", from: "0 50 48", to: "360 50 52", repeatCount: "indefinite" }) })] }) });
52
- }), Se = r((o2) => {
53
- const { sx: n2, speed: r2 = 1, size: i2 = 13, width: a2 = 64, height: l2 = 17, ...s2 } = o2;
54
- return t(v, { sx: { width: `${a2}px`, height: `${l2}px`, "& .primary": { backgroundColor: (e2) => e2.palette.grey[600], top: `${(l2 - i2) / 2}px`, width: () => `${i2}px`, height: () => `${i2}px` }, ...n2 }, className: h(ye, "animated-icon"), ...s2, children: [e("div", { className: "primary" }), e("div", { className: "primary" }), e("div", { className: "primary" }), e("div", { className: "primary" })] });
55
- }), Re = e(ke, {}), Pe = r(i((o2, n2) => {
56
- const { sx: r2, style: i2, onMount: c2, onUnmount: d2, transitionDelay: p2 = "1200ms", panel: u2 = false, transparentBackground: m2 = true, icon: h2 = Re, label: x2, ...g2 } = o2, b2 = a(() => "string" == typeof x2 ? e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em" }, children: x2 }) : x2, [x2]), y2 = l(null), C2 = a(() => {
57
- let o3 = t(v, { sx: { display: "flex", flexDirection: "column", alignItems: "center", rowGap: "8px" }, children: [b2, h2] });
58
- return true === u2 && (o3 = e(w, { elevation: 0, sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", alignSelf: "center", marginBottom: "5%", backgroundColor: (e2) => e2.palette.info.light, color: (e2) => e2.palette.info.contrastText, paddingLeft: (e2) => e2.spacing(2), paddingRight: (e2) => e2.spacing(2), paddingTop: (e2) => e2.spacing(2), paddingBottom: (e2) => e2.spacing(1), rowGap: (e2) => e2.spacing(1), borderRadius: (e2) => `${e2.shape.borderRadius}px`, boxShadow: (e2) => e2.shadows[2], "& .primary": { background: (e2) => `${f(e2.palette.info.contrastText, 0.9)} !important`, boxShadow: (e2) => `0 0 0 1px ${"dark" === e2.palette.mode ? e2.palette.text.secondary : e2.palette.divider}`, boxSizing: "content-box", border: "solid transparent" }, zIndex: 1 }, children: o3 })), e(v, { ref: ne([y2, n2]), className: "animatable", sx: { cursor: "wait", boxSizing: "border-box", alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "column", willChange: "opacity", opacity: m2 ? 1e-3 : 1, transitionProperty: "opacity", transitionDelay: p2, 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" }, ...r2, ...i2 }, ...g2, children: t(v, { className: "center", sx: { display: "flex", flex: "1 1 100%", height: "100%", width: "100%", alignItems: "center", justifyContent: "center", boxSizing: "border-box", position: "relative" }, children: [e(v, { className: "backdrop", sx: { opacity: (e2) => m2 ? 1.5 * e2.palette.action.disabledOpacity : void 0, background: (e2) => m2 ? void 0 : e2.palette.background.paper, backdropFilter: "blur(4px)", borderRadius: (e2) => `${e2.shape.borderRadius}px`, zIndex: -1, position: "absolute", width: "100%", height: "100%", boxSizing: "border-box" } }), o3] }) });
59
- }, [r2, u2]), M2 = l(false), S2 = l(false);
60
- return re(() => {
61
- if (y2.current && !M2.current && !S2.current) {
62
- if (S2.current = true, y2.current.classList.contains("animatable") && !y2.current.classList.contains("animating")) {
63
- let e2 = false;
64
- const t2 = () => {
65
- S2.current && (M2.current = true, S2.current = false, e2 = true, c2?.());
66
- };
67
- y2.current && y2.current.addEventListener("transitionrun", t2, { once: true, capture: true, passive: true }), S2.current && y2.current && (window.getComputedStyle(y2.current, null).opacity, y2.current.classList.add("animating")), setTimeout(() => {
68
- !e2 && S2.current && y2.current && (y2.current?.removeEventListener("transitionrun", t2), t2());
69
- }, 100);
70
- } else M2.current = true, S2.current = false, c2?.();
71
- return () => {
72
- };
73
- }
74
- }, [y2.current]), s(() => () => {
75
- M2.current && (y2.current?.classList.remove("animating"), M2.current = false, S2.current = false, d2?.());
76
- }, []), C2;
25
+ var De = {
26
+ whiteSpace: "nowrap",
27
+ textTransform: "none",
28
+ lineHeight: 1,
29
+ fontSize: (e) => e.typography.subtitle2.fontSize,
30
+ paddingLeft: (e) => e.spacing(.25),
31
+ paddingRight: (e) => e.spacing(.25)
32
+ };
33
+ function $e(e, r) {
34
+ const o = null != r && !1 !== r && "" !== r ? M(b, {
35
+ component: "div",
36
+ sx: De,
37
+ children: r
38
+ }) : null;
39
+ return e && o ? S(t, {
40
+ sx: {
41
+ display: "flex",
42
+ alignItems: "center"
43
+ },
44
+ children: [e, o]
45
+ }) : e ?? o ?? void 0;
46
+ }
47
+ var Ie = ({ isHorizontal: e, isBefore: t }) => {
48
+ const r = fe();
49
+ return M(C, t ? { children: r(e ? "scroll.edgeLeft" : "scroll.edgeTop") } : { children: r(e ? "scroll.edgeRight" : "scroll.edgeBottom") });
50
+ }, Be = (e) => {
51
+ let t = ne({
52
+ style: { cursor: "pointer" },
53
+ ...e
54
+ });
55
+ if (void 0 !== e.isBefore && !e.disabled) t = M(St, {
56
+ title: M(Ie, {
57
+ isHorizontal: e.orientation === oe.Horizontal,
58
+ isBefore: e.isBefore
59
+ }),
60
+ enterDelay: 800,
61
+ enterNextDelay: 1600,
62
+ children: e.disabled ? M("div", {
63
+ style: { display: "flex" },
64
+ children: t
65
+ }) : t
66
+ });
67
+ return t;
68
+ }, ze = (e, t, r, o) => {
69
+ const { style: n, ...i } = e, a = M(d, {
70
+ component: "div",
71
+ ...i,
72
+ style: {
73
+ ...n,
74
+ padding: "0px"
75
+ },
76
+ sx: { padding: "0" },
77
+ color: e.disabled ? void 0 : "primary",
78
+ "aria-label": r,
79
+ size: "small",
80
+ children: t
81
+ });
82
+ return M(St, {
83
+ title: e.disabled ? r : o,
84
+ enterDelay: 800,
85
+ enterNextDelay: 1600,
86
+ children: e.disabled ? M("div", {
87
+ style: { display: "flex" },
88
+ children: a
89
+ }) : a
90
+ });
91
+ }, Ne = (e) => ze(e, oe.Horizontal ? M(Y, {
92
+ iconKey: "ArrowLeft",
93
+ size: "small"
94
+ }) : M(Y, {
95
+ iconKey: "ArrowUpward",
96
+ size: "small"
97
+ }), "Scroll " + (e.orientation === oe.Horizontal ? "Left" : "Up"), `Scroll ${e.orientation === oe.Horizontal ? "left" : "up"}, 'Ctrl+Click' to scroll to the beginning`), Le = (e) => ze(e, oe.Horizontal ? M(Y, {
98
+ iconKey: "ArrowRight",
99
+ size: "small"
100
+ }) : M(Y, {
101
+ iconKey: "ArrowDownward",
102
+ size: "small"
103
+ }), "Scroll " + (e.orientation === oe.Horizontal ? "Right" : "Down"), `Scroll ${e.orientation === oe.Horizontal ? "right" : "down"}, 'Ctrl+Click' to scroll to the end`), Oe = B(D((e, t) => {
104
+ const { orientation: r = "vertical", sx: o, ...n } = e, i = "vertical" === r;
105
+ return M(s, {
106
+ ref: t,
107
+ sx: {
108
+ marginLeft: i ? "2px" : void 0,
109
+ marginRight: i ? "2px" : void 0,
110
+ backgroundColor: "transparent !important",
111
+ minHeight: i ? "1em" : void 0,
112
+ minWidth: i ? void 0 : "1em",
113
+ borderColor: (e) => e.palette.divider,
114
+ ...o
115
+ },
116
+ orientation: r,
117
+ variant: "middle",
118
+ flexItem: !0,
119
+ ...n
120
+ });
121
+ })), Ee = "_traverse-ellipsis_14l1h_1", Fe = B((e) => {
122
+ const { sx: r, speed: o = 2, size: n = 70, ...i } = e;
123
+ return M(t, {
124
+ sx: {
125
+ width: `${n}px`,
126
+ height: `${n}px`,
127
+ zIndex: 1,
128
+ "& .primary": {
129
+ stroke: (e) => e.palette.grey[600],
130
+ fill: "none"
131
+ },
132
+ ...r
133
+ },
134
+ ...i,
135
+ children: S("svg", {
136
+ x: "0px",
137
+ y: "0px",
138
+ viewBox: "0 0 100 100",
139
+ children: [
140
+ M("circle", {
141
+ className: "primary",
142
+ strokeWidth: "4",
143
+ cx: "50",
144
+ cy: "50",
145
+ r: "48"
146
+ }),
147
+ M("line", {
148
+ className: "primary",
149
+ strokeLinecap: "round",
150
+ strokeWidth: "4",
151
+ x1: "50",
152
+ y1: "50",
153
+ x2: "85",
154
+ y2: "50.5",
155
+ children: M("animateTransform", {
156
+ attributeName: "transform",
157
+ dur: `${o}s`,
158
+ type: "rotate",
159
+ from: "0 50 50",
160
+ to: "360 50 50",
161
+ repeatCount: "indefinite"
162
+ })
163
+ }),
164
+ M("line", {
165
+ className: "primary",
166
+ strokeLinecap: "round",
167
+ strokeWidth: "4",
168
+ x1: "50",
169
+ y1: "50",
170
+ x2: "49.5",
171
+ y2: "74",
172
+ children: M("animateTransform", {
173
+ attributeName: "transform",
174
+ dur: 7.5 * o + "s",
175
+ type: "rotate",
176
+ from: "0 50 50",
177
+ to: "360 50 50",
178
+ repeatCount: "indefinite"
179
+ })
180
+ })
181
+ ]
182
+ })
183
+ });
184
+ }), Ke = B((e) => {
185
+ const { sx: r, speed: o = 1.5, size: n = 70, ...i } = e;
186
+ return M(t, {
187
+ sx: {
188
+ width: `${n}px`,
189
+ height: `${n}px`,
190
+ zIndex: 1,
191
+ "& .primary": { fill: (e) => e.palette.grey[600] },
192
+ "& .secondary": {
193
+ stroke: (e) => e.palette.grey[600],
194
+ fill: "none",
195
+ opacity: .5
196
+ },
197
+ ...r
198
+ },
199
+ ...i,
200
+ children: S("svg", {
201
+ x: "0px",
202
+ y: "0px",
203
+ viewBox: "0 0 100 100",
204
+ children: [M("circle", {
205
+ className: "secondary",
206
+ strokeWidth: "4",
207
+ cx: "50",
208
+ cy: "50",
209
+ r: "21"
210
+ }), M("path", {
211
+ className: "primary",
212
+ 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",
213
+ children: M("animateTransform", {
214
+ attributeName: "transform",
215
+ type: "rotate",
216
+ dur: 1 * o + "s",
217
+ from: "0 50 50",
218
+ to: "360 50 50",
219
+ repeatCount: "indefinite"
220
+ })
221
+ })]
222
+ })
223
+ });
224
+ }), Ae = B((e) => {
225
+ const { sx: r, speed: o = 1, size: n = 70, ...i } = e;
226
+ return M(t, {
227
+ sx: {
228
+ width: `${n}px`,
229
+ height: `${n}px`,
230
+ zIndex: 1,
231
+ ...r
232
+ },
233
+ ...i,
234
+ children: S("svg", {
235
+ x: "0px",
236
+ y: "0px",
237
+ viewBox: "0 0 100 100",
238
+ children: [
239
+ M("circle", {
240
+ className: "primary",
241
+ cx: "6",
242
+ cy: "50",
243
+ r: "6",
244
+ children: M("animate", {
245
+ attributeName: "opacity",
246
+ dur: `${o}s`,
247
+ values: "0;1;0",
248
+ repeatCount: "indefinite",
249
+ begin: "0.1"
250
+ })
251
+ }),
252
+ M("circle", {
253
+ className: "primary",
254
+ cx: "26",
255
+ cy: "50",
256
+ r: "6",
257
+ children: M("animate", {
258
+ attributeName: "opacity",
259
+ dur: `${o}s`,
260
+ values: "0;1;0",
261
+ repeatCount: "indefinite",
262
+ begin: "0.2"
263
+ })
264
+ }),
265
+ M("circle", {
266
+ className: "primary",
267
+ cx: "46",
268
+ cy: "50",
269
+ r: "6",
270
+ children: M("animate", {
271
+ attributeName: "opacity",
272
+ dur: `${o}s`,
273
+ values: "0;1;0",
274
+ repeatCount: "indefinite",
275
+ begin: "0.3"
276
+ })
277
+ })
278
+ ]
279
+ })
280
+ });
281
+ }), We = B((e) => {
282
+ const { sx: r, speed: o = 1, size: n = 70, ...i } = e;
283
+ return M(t, {
284
+ sx: {
285
+ width: `${n}px`,
286
+ height: `${n}px`,
287
+ zIndex: 1,
288
+ "& .primary": {
289
+ fill: (e) => e.palette.grey[600],
290
+ stroke: "none"
291
+ },
292
+ ...r
293
+ },
294
+ ...i,
295
+ children: S("svg", {
296
+ x: "0px",
297
+ y: "0px",
298
+ viewBox: "0 0 100 100",
299
+ children: [
300
+ M("circle", {
301
+ className: "primary",
302
+ cx: "6",
303
+ cy: "50",
304
+ r: "6",
305
+ children: M("animateTransform", {
306
+ attributeName: "transform",
307
+ dur: `${o}s`,
308
+ type: "translate",
309
+ values: "0 15 ; 0 -15; 0 15",
310
+ repeatCount: "indefinite",
311
+ begin: "0.1"
312
+ })
313
+ }),
314
+ M("circle", {
315
+ className: "primary",
316
+ cx: "30",
317
+ cy: "50",
318
+ r: "6",
319
+ children: M("animateTransform", {
320
+ attributeName: "transform",
321
+ dur: `${o}s`,
322
+ type: "translate",
323
+ values: "0 10 ; 0 -10; 0 10",
324
+ repeatCount: "indefinite",
325
+ begin: "0.2"
326
+ })
327
+ }),
328
+ M("circle", {
329
+ className: "primary",
330
+ cx: "54",
331
+ cy: "50",
332
+ r: "6",
333
+ children: M("animateTransform", {
334
+ attributeName: "transform",
335
+ dur: `${o}s`,
336
+ type: "translate",
337
+ values: "0 5 ; 0 -5; 0 5",
338
+ repeatCount: "indefinite",
339
+ begin: "0.3"
340
+ })
341
+ })
342
+ ]
343
+ })
344
+ });
345
+ }), He = B((e) => {
346
+ const { sx: r, speed: o = 2, size: n = 70, ...i } = e;
347
+ return M(t, {
348
+ sx: {
349
+ width: `${n}px`,
350
+ height: `${n}px`,
351
+ zIndex: 1,
352
+ "& .primary": {
353
+ stroke: (e) => e.palette.grey[600],
354
+ opacity: .5,
355
+ fill: "none"
356
+ },
357
+ "& .secondary": {
358
+ fillOpacity: (e) => e.palette.grey[600],
359
+ opacity: .8,
360
+ stroke: (e) => e.palette.background.paper
361
+ },
362
+ ...r
363
+ },
364
+ ...i,
365
+ children: S("svg", {
366
+ x: "0px",
367
+ y: "0px",
368
+ viewBox: "0 0 100 100",
369
+ children: [M("circle", {
370
+ className: "primary",
371
+ strokeWidth: "4",
372
+ cx: "50",
373
+ cy: "50",
374
+ r: "44"
375
+ }), M("circle", {
376
+ className: "secondary",
377
+ strokeWidth: "3",
378
+ cx: "8",
379
+ cy: "54",
380
+ r: "6",
381
+ children: M("animateTransform", {
382
+ attributeName: "transform",
383
+ dur: `${o}s`,
384
+ type: "rotate",
385
+ from: "0 50 48",
386
+ to: "360 50 52",
387
+ repeatCount: "indefinite"
388
+ })
389
+ })]
390
+ })
391
+ });
392
+ }), Ve = B((e) => {
393
+ const { sx: r, speed: o = 1, size: n = 13, width: i = 64, height: a = 17, ...l } = e;
394
+ return S(t, {
395
+ sx: {
396
+ width: `${i}px`,
397
+ height: `${a}px`,
398
+ "& .primary": {
399
+ backgroundColor: (e) => e.palette.grey[600],
400
+ top: `${(a - n) / 2}px`,
401
+ width: () => `${n}px`,
402
+ height: () => `${n}px`
403
+ },
404
+ ...r
405
+ },
406
+ className: W(Ee, "animated-icon"),
407
+ ...l,
408
+ children: [
409
+ M("div", { className: "primary" }),
410
+ M("div", { className: "primary" }),
411
+ M("div", { className: "primary" }),
412
+ M("div", { className: "primary" })
413
+ ]
414
+ });
415
+ }), qe = M(Ke, {}), je = B(D((e, r) => {
416
+ const { sx: o, style: n, onMount: i, onUnmount: a, transitionDelay: l = "1200ms", panel: s = !1, transparentBackground: c = !0, icon: d = qe, label: p, progress: m = null, ...h } = e, g = E(() => "string" == typeof p ? M(b, {
417
+ variant: "caption",
418
+ component: "div",
419
+ sx: {
420
+ fontSize: "0.875rem",
421
+ lineHeight: 1.43,
422
+ letterSpacing: "0.01071em"
423
+ },
424
+ children: p
425
+ }) : p, [p]), x = E(() => {
426
+ if ("number" != typeof m) return d;
427
+ const e = Math.max(0, Math.min(100, Math.round(100 * m)));
428
+ return M(t, {
429
+ sx: {
430
+ display: "flex",
431
+ alignItems: "center",
432
+ width: "180px"
433
+ },
434
+ children: M(u, {
435
+ variant: "determinate",
436
+ value: e,
437
+ color: "inherit",
438
+ sx: {
439
+ width: "100%",
440
+ borderRadius: "2px",
441
+ "@keyframes sxlProgressPulse": {
442
+ "0%, 100%": { opacity: 1 },
443
+ "50%": { opacity: .25 }
444
+ },
445
+ "& .MuiLinearProgress-bar": {
446
+ transition: "transform 0.5s linear",
447
+ ...e >= 100 && {
448
+ willChange: "opacity",
449
+ animation: "sxlProgressPulse 1s ease-in-out infinite"
450
+ }
451
+ }
452
+ }
453
+ })
454
+ });
455
+ }, [m, d]), y = K(null), v = E(() => {
456
+ let e = S(t, {
457
+ sx: {
458
+ display: "flex",
459
+ flexDirection: "column",
460
+ alignItems: "center",
461
+ rowGap: "8px"
462
+ },
463
+ children: [g, x]
464
+ });
465
+ return !0 === s && (e = M(f, {
466
+ elevation: 0,
467
+ sx: {
468
+ display: "flex",
469
+ flexDirection: "column",
470
+ justifyContent: "center",
471
+ alignItems: "center",
472
+ alignSelf: "center",
473
+ marginBottom: "5%",
474
+ backgroundColor: (e) => e.palette.info.light,
475
+ color: (e) => e.palette.info.contrastText,
476
+ paddingLeft: (e) => e.spacing(2),
477
+ paddingRight: (e) => e.spacing(2),
478
+ paddingTop: (e) => e.spacing(2),
479
+ paddingBottom: (e) => e.spacing(1),
480
+ rowGap: (e) => e.spacing(1),
481
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
482
+ boxShadow: (e) => e.shadows[2],
483
+ "& .primary": {
484
+ background: (e) => `${H(e.palette.info.contrastText, .9)} !important`,
485
+ boxShadow: (e) => `0 0 0 1px ${"dark" === e.palette.mode ? e.palette.text.secondary : e.palette.divider}`,
486
+ boxSizing: "content-box",
487
+ border: "solid transparent"
488
+ },
489
+ zIndex: 1
490
+ },
491
+ children: e
492
+ })), M(t, {
493
+ ...h,
494
+ ref: ge([y, r]),
495
+ className: "animatable",
496
+ sx: {
497
+ cursor: "wait",
498
+ boxSizing: "border-box",
499
+ alignItems: "center",
500
+ justifyContent: "center",
501
+ display: "flex",
502
+ flexDirection: "column",
503
+ willChange: "opacity",
504
+ opacity: c ? .001 : 1,
505
+ transitionProperty: "opacity",
506
+ transitionDelay: l,
507
+ transitionDuration: "320ms",
508
+ transitionTimingFunction: "ease-in",
509
+ overflow: "hidden",
510
+ outline: "none",
511
+ width: "100%",
512
+ height: "100%",
513
+ minWidth: 0,
514
+ minHeight: 0,
515
+ zIndex: 99999,
516
+ "&.animating": { opacity: 1 },
517
+ "&.animating-exit": {
518
+ opacity: 0,
519
+ transition: "opacity 210ms"
520
+ },
521
+ ...o,
522
+ ...n
523
+ },
524
+ children: S(t, {
525
+ className: "center",
526
+ sx: {
527
+ display: "flex",
528
+ flex: "1 1 100%",
529
+ height: "100%",
530
+ width: "100%",
531
+ alignItems: "center",
532
+ justifyContent: "center",
533
+ boxSizing: "border-box",
534
+ position: "relative"
535
+ },
536
+ children: [M(t, {
537
+ className: "backdrop",
538
+ sx: {
539
+ opacity: (e) => c ? 1.5 * e.palette.action.disabledOpacity : void 0,
540
+ background: (e) => c ? void 0 : e.palette.background.paper,
541
+ backdropFilter: "blur(4px)",
542
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
543
+ zIndex: -1,
544
+ position: "absolute",
545
+ width: "100%",
546
+ height: "100%",
547
+ boxSizing: "border-box"
548
+ }
549
+ }), e]
550
+ })
551
+ });
552
+ }, [
553
+ o,
554
+ s,
555
+ g,
556
+ x
557
+ ]), k = K(!1), w = K(!1);
558
+ return xe(() => {
559
+ if (y.current && !k.current && !w.current) {
560
+ if (w.current = !0, y.current.classList.contains("animatable") && !y.current.classList.contains("animating")) {
561
+ let e = !1;
562
+ const t = () => {
563
+ w.current && (k.current = !0, w.current = !1, e = !0, i?.());
564
+ };
565
+ y.current && y.current.addEventListener("transitionrun", t, {
566
+ once: !0,
567
+ capture: !0,
568
+ passive: !0
569
+ }), w.current && y.current && (window.getComputedStyle(y.current, null).opacity, y.current.classList.add("animating")), setTimeout(() => {
570
+ !e && w.current && y.current && (y.current?.removeEventListener("transitionrun", t), t());
571
+ }, 100);
572
+ } else k.current = !0, w.current = !1, i?.();
573
+ return () => {};
574
+ }
575
+ }, [y.current]), N(() => () => {
576
+ k.current && (y.current?.classList.remove("animating"), k.current = !1, w.current = !1, a?.());
577
+ }, []), v;
77
578
  }));
78
- Pe.displayName = "AnimatedLoadingPanel";
79
- const De = /^\s*at\s+(?:(async|new|await)\s+)?(.+?)\s+\((.+?):(\d+):(\d+)\)$/, Ee = /^\s*at\s+(?:(async|new|await)\s+)?(.+?):(\d+):(\d+)\s*$/, Te = (e2) => {
80
- if (!e2) return "";
81
- try {
82
- e2 = new URL(e2).pathname;
83
- } catch {
84
- }
85
- return e2 = (e2 = e2.replace(/^\/+/, "")).replace(/^@?fs[\\/]/, "");
86
- }, ze = r(({ error: o2, maxLines: n2 = Number.MAX_SAFE_INTEGER, hideLineNumbers: r2 = false }) => {
87
- const [i2, a2] = c(null);
88
- if (!o2?.stack) return null;
89
- const l2 = L.collectErrorChain(o2).reverse(), s2 = [];
90
- l2.forEach(({ error: e2 }, t2) => {
91
- const o3 = (e2.stack || "").split("\n").filter(Boolean).map((e3) => {
92
- let t3 = e3.match(De);
93
- if (t3) {
94
- const [, e4 = "", o4, n3, r3, i3] = t3;
95
- return { line: `at ${e4 ? e4 + " " : ""}${o4}`, location: `${Te(n3).split(/[\\/]/).pop()}:${r3}:${i3}` };
96
- }
97
- if (t3 = e3.match(Ee), t3) {
98
- const [, e4 = "", o4, n3, r3] = t3, i3 = Te(o4), a3 = `${i3.split(/[\\/]/).pop()}:${n3}:${r3}`;
99
- return { line: `at ${e4 ? e4 + " " : ""}${a3}`, location: i3 !== a3 ? `${i3}:${n3}:${r3}` : void 0 };
100
- }
101
- return { line: e3.trim() };
102
- });
103
- o3.length && (s2.push({ line: t2 ? `Caused by: ${o3[0].line}` : o3[0].line, isBoundary: true }), s2.push(...o3.slice(1)));
104
- });
105
- const d2 = n2 ? s2.slice(0, n2) : s2, p2 = n2 && s2.length > n2;
106
- return t(v, { sx: { width: "100%", mt: 1 }, children: [t(v, { sx: { display: "flex", alignItems: "center", gap: 1, borderRadius: 1, px: 1, py: 0.5 }, children: [t(k, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", opacity: 0.8 }, children: ["Stack Trace(", l2.length > 1 ? ` (${l2.length} frames)` : "", ")"] }), e(v, { sx: { flex: 1 } }), i2 && e(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.8 }, children: i2 }), e(b, { size: "small", onClick: async () => {
107
- try {
108
- let e2 = 0;
109
- const t2 = s2.map((t3) => {
110
- if (t3.isBoundary) return e2 = 0, t3.line;
111
- e2++;
112
- let o3 = t3.location && t3.line !== t3.location ? `${t3.line} (${t3.location})` : t3.line;
113
- return e2 >= 1 && (o3 = ` ${o3}`), o3;
114
- }).join("\n");
115
- await navigator.clipboard.writeText(t2), a2("Copied!"), setTimeout(() => a2(null), 2e3);
116
- } catch (e2) {
117
- a2("Can't copy!"), console.warn("Failed to copy stack trace:", e2);
118
- }
119
- }, sx: { color: "inherit", opacity: 0.7, "&:hover": { opacity: 1 } }, title: "Copy stack trace", children: e(W, { iconKey: "ContentCopy", style: { fontSize: "0.875rem" } }) }), e(b, { size: "small", onClick: () => {
120
- a2("Logged!"), setTimeout(() => a2(null), 2e3), console.log(o2);
121
- }, sx: { color: "inherit", opacity: 0.7, "&:hover": { opacity: 1 } }, title: "Log error to console", children: e(W, { iconKey: "BugReport", style: { fontSize: "0.875rem" } }) })] }), t(v, { 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: [d2.map((o3, n3) => o3.isBoundary ? e(v, { sx: { py: 1, mt: n3 > 0 ? 1 : 0, mb: 0.5, borderTop: n3 > 0 ? "1px solid rgba(255, 255, 255, 0.1)" : "none" }, children: e(k, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", fontWeight: "bold", color: (e2) => o3.isBoundary ? e2.palette.text.primary : e2.palette.text.secondary, display: "block" }, children: o3.line }) }, `error-${n3}`) : t(v, { sx: { display: "flex", alignItems: "flex-start", gap: 1, py: 0.25, pl: 1, "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.05)" } }, children: [!r2 && e(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.5, minWidth: "20px", textAlign: "right", userSelect: "none" }, children: n3 + 1 }), t(v, { sx: { flex: 1, overflow: "hidden" }, children: [e(k, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", color: "inherit" }, children: o3.line }), o3.location && o3.line !== o3.location && e(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic" }, children: o3.location })] })] }, `stack-${n3}`)), p2 && t(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic", textAlign: "center", display: "block", mt: 1 }, children: ["... and ", s2.length - n2, " more frames"] })] })] });
579
+ je.displayName = "AnimatedLoadingPanel";
580
+ var Qe = /^\s*at\s+(?:(async|new|await)\s+)?(.+?)\s+\((.+?):(\d+):(\d+)\)$/, Ue = /^\s*at\s+(?:(async|new|await)\s+)?(.+?):(\d+):(\d+)\s*$/, Ge = (e) => {
581
+ if (!e) return "";
582
+ try {
583
+ e = new URL(e).pathname;
584
+ } catch {}
585
+ return e = (e = e.replace(/^\/+/, "")).replace(/^@?fs[\\/]/, "");
586
+ }, Xe = B(({ error: e, maxLines: r = Number.MAX_SAFE_INTEGER, hideLineNumbers: o = !1 }) => {
587
+ const n = fe(), [i, a] = A(null);
588
+ if (!e?.stack) return null;
589
+ const l = Q.collectErrorChain(e).reverse(), s = [];
590
+ l.forEach(({ error: e }, t) => {
591
+ const r = (e.stack || "").split("\n").filter(Boolean).map((e) => {
592
+ let t = e.match(Qe);
593
+ if (t) {
594
+ const [, e = "", r, o, n, i] = t;
595
+ return {
596
+ line: `at ${e ? e + " " : ""}${r}`,
597
+ location: `${Ge(o).split(/[\\/]/).pop()}:${n}:${i}`
598
+ };
599
+ }
600
+ if (t = e.match(Ue), t) {
601
+ const [, e = "", r, o, n] = t, i = Ge(r), a = `${i.split(/[\\/]/).pop()}:${o}:${n}`;
602
+ return {
603
+ line: `at ${e ? e + " " : ""}${a}`,
604
+ location: i !== a ? `${i}:${o}:${n}` : void 0
605
+ };
606
+ }
607
+ return { line: e.trim() };
608
+ });
609
+ r.length && (s.push({
610
+ line: t ? `Caused by: ${r[0].line}` : r[0].line,
611
+ isBoundary: !0
612
+ }), s.push(...r.slice(1)));
613
+ });
614
+ const c = r ? s.slice(0, r) : s, p = r && s.length > r;
615
+ return S(t, {
616
+ sx: {
617
+ width: "100%",
618
+ mt: 1
619
+ },
620
+ children: [S(t, {
621
+ sx: {
622
+ display: "flex",
623
+ alignItems: "center",
624
+ gap: 1,
625
+ borderRadius: 1,
626
+ px: 1,
627
+ py: .5
628
+ },
629
+ children: [
630
+ M(b, {
631
+ variant: "caption",
632
+ component: "div",
633
+ sx: {
634
+ fontSize: "0.75rem",
635
+ opacity: .8
636
+ },
637
+ children: l.length > 1 ? n("stackTrace.headingFrames", { count: l.length }) : n("stackTrace.heading")
638
+ }),
639
+ M(t, { sx: { flex: 1 } }),
640
+ i && M(b, {
641
+ variant: "caption",
642
+ component: "div",
643
+ sx: {
644
+ fontSize: "0.625rem",
645
+ opacity: .8
646
+ },
647
+ children: i
648
+ }),
649
+ M(d, {
650
+ size: "small",
651
+ onClick: async () => {
652
+ try {
653
+ let e = 0;
654
+ const t = s.map((t) => {
655
+ if (t.isBoundary) return e = 0, t.line;
656
+ e++;
657
+ let r = t.location && t.line !== t.location ? `${t.line} (${t.location})` : t.line;
658
+ return e >= 1 && (r = ` ${r}`), r;
659
+ }).join("\n");
660
+ await navigator.clipboard.writeText(t), a("Copied!"), setTimeout(() => a(null), 2e3);
661
+ } catch (e) {
662
+ a("Can't copy!"), console.warn("Failed to copy stack trace:", e);
663
+ }
664
+ },
665
+ sx: {
666
+ color: "inherit",
667
+ opacity: .7,
668
+ "&:hover": { opacity: 1 }
669
+ },
670
+ title: n("stackTrace.copy"),
671
+ children: M(Y, {
672
+ iconKey: "ContentCopy",
673
+ style: { fontSize: "0.875rem" }
674
+ })
675
+ }),
676
+ M(d, {
677
+ size: "small",
678
+ onClick: () => {
679
+ a("Logged!"), setTimeout(() => a(null), 2e3), console.warn(e);
680
+ },
681
+ sx: {
682
+ color: "inherit",
683
+ opacity: .7,
684
+ "&:hover": { opacity: 1 }
685
+ },
686
+ title: n("stackTrace.log"),
687
+ children: M(Y, {
688
+ iconKey: "BugReport",
689
+ style: { fontSize: "0.875rem" }
690
+ })
691
+ })
692
+ ]
693
+ }), S(t, {
694
+ sx: {
695
+ mt: 1,
696
+ backgroundColor: "rgba(0, 0, 0, 0.2)",
697
+ borderRadius: 1,
698
+ p: 1,
699
+ maxHeight: "300px",
700
+ overflow: "auto",
701
+ fontFamily: "monospace",
702
+ fontSize: "0.75rem",
703
+ lineHeight: 1.4
704
+ },
705
+ children: [c.map((e, r) => e.isBoundary ? M(t, {
706
+ sx: {
707
+ py: 1,
708
+ mt: r > 0 ? 1 : 0,
709
+ mb: .5,
710
+ borderTop: r > 0 ? "1px solid rgba(255, 255, 255, 0.1)" : "none"
711
+ },
712
+ children: M(b, {
713
+ variant: "caption",
714
+ component: "div",
715
+ sx: {
716
+ fontSize: "0.75rem",
717
+ fontWeight: "bold",
718
+ color: (t) => e.isBoundary ? t.palette.text.primary : t.palette.text.secondary,
719
+ display: "block"
720
+ },
721
+ children: e.line
722
+ })
723
+ }, `error-${r}`) : S(t, {
724
+ sx: {
725
+ display: "flex",
726
+ alignItems: "flex-start",
727
+ gap: 1,
728
+ py: .25,
729
+ pl: 1,
730
+ "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.05)" }
731
+ },
732
+ children: [!o && M(b, {
733
+ variant: "caption",
734
+ component: "div",
735
+ sx: {
736
+ fontSize: "0.625rem",
737
+ opacity: .5,
738
+ minWidth: "20px",
739
+ textAlign: "right",
740
+ userSelect: "none"
741
+ },
742
+ children: r + 1
743
+ }), S(t, {
744
+ sx: {
745
+ flex: 1,
746
+ overflow: "hidden"
747
+ },
748
+ children: [M(b, {
749
+ variant: "caption",
750
+ component: "div",
751
+ sx: {
752
+ fontSize: "0.75rem",
753
+ whiteSpace: "nowrap",
754
+ overflow: "hidden",
755
+ textOverflow: "ellipsis",
756
+ color: "inherit"
757
+ },
758
+ children: e.line
759
+ }), e.location && e.line !== e.location && M(b, {
760
+ variant: "caption",
761
+ component: "div",
762
+ sx: {
763
+ fontSize: "0.625rem",
764
+ opacity: .6,
765
+ fontStyle: "italic"
766
+ },
767
+ children: e.location
768
+ })]
769
+ })]
770
+ }, `stack-${r}`)), p && M(b, {
771
+ variant: "caption",
772
+ component: "div",
773
+ sx: {
774
+ fontSize: "0.625rem",
775
+ opacity: .6,
776
+ fontStyle: "italic",
777
+ textAlign: "center",
778
+ display: "block",
779
+ mt: 1
780
+ },
781
+ children: n("stackTrace.moreFrames", { count: s.length - r })
782
+ })]
783
+ })]
784
+ });
122
785
  });
123
- ze.displayName = "StackTrace";
124
- const $e = r(i((o2, n2) => {
125
- const { sx: r2, icon: i2 = e(W, { iconKey: "Error", style: { fontSize: 48 } }), error: l2, hideStackTrace: s2 = false, stackTraceExpanded: c2 = false, fullscreen: d2 = false, ...p2 } = o2, u2 = a(() => Oe(l2, s2, c2, d2), [l2, s2, c2, d2]);
126
- return a(() => e(v, { ref: n2, sx: { boxSizing: "border-box", alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "row", overflow: "hidden", width: "100%", height: "100%", ...r2 }, ...p2, children: t(v, { sx: { display: "flex", flex: "1 1 100%", height: "100%", alignItems: "center", justifyContent: "center", boxSizing: "border-box", position: "relative" }, children: [e(v, { className: "backdrop", sx: { backdropFilter: "blur(4px)", borderRadius: (e2) => `${e2.shape.borderRadius}px`, zIndex: -1, position: "absolute", width: "100%", height: "100%", boxSizing: "border-box" } }), e(w, { elevation: 0, sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", rowGap: "8px", alignSelf: "center", marginBottom: "5%", backgroundColor: (e2) => e2.palette.error.light, color: (e2) => e2.palette.error.contrastText, paddingLeft: (e2) => e2.spacing(2), paddingRight: (e2) => e2.spacing(2), paddingTop: (e2) => e2.spacing(2), paddingBottom: (e2) => e2.spacing(2), borderRadius: (e2) => `${e2.shape.borderRadius}px`, boxShadow: (e2) => e2.shadows[2], "& .primary": { background: (e2) => `${e2.palette.error.contrastText} !important`, border: "solid transparent" }, zIndex: 1 }, children: e(v, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: (e2) => e2.spacing(2), width: "100%", maxWidth: d2 ? void 0 : "600px" }, children: t(v, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-start", gap: (e2) => e2.spacing(2) }, children: ["string" == typeof i2 ? e(W, { iconKey: i2, style: { fontSize: 48 } }) : i2, u2] }) }) })] }) }), [r2, i2]);
127
- }));
128
- $e.displayName = "StackTraceErrorPanel";
129
- const Oe = (o2, r2 = false, i2 = false, a2 = false) => {
130
- if (n.isValidElement(o2)) return o2;
131
- if (o2 instanceof Error) return t(v, { sx: { display: "flex", flexDirection: "column", minWidth: a2 ? "70vw" : "300px", maxWidth: a2 ? void 0 : "500px", width: "100%" }, children: [e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, mb: 1 }, children: o2.message }), o2.cause ? t(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", mb: 1, opacity: 0.8 }, children: ["Caused by: ", o2.cause instanceof Error ? o2.cause.message : String(o2.cause)] }) : null, !r2 && e(ze, { error: o2, hideLineNumbers: true })] });
132
- const l2 = "string" === o2 ? o2 : `Unknown Error: ${String(o2)}`;
133
- return e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em" }, children: l2 });
134
- }, Ie = r(i((t2, o2) => {
135
- const { chips: r2, sx: i2, ...a2 } = t2, l2 = n.useMemo(() => {
136
- if (!r2) return null;
137
- let t3 = null;
138
- t3 = Array.isArray(r2) ? r2 : [r2];
139
- const o3 = [], i3 = t3.length;
140
- for (let r3 = 0; r3 < i3; r3++) {
141
- const i4 = t3[r3];
142
- let a3 = null;
143
- "string" == typeof i4 ? a3 = e(C, { label: i4, color: "primary", size: "small", sx: { scale: "0.8" } }, "chip-" + r3) : n.cloneElement(i4, { key: "chip-" + r3 }), o3.push(a3);
144
- }
145
- return o3;
146
- }, [r2]);
147
- return e(v, { ref: o2, sx: { display: "flex", flexDirection: "row", marginLeft: "4px", gap: "2px", ...i2 }, ...a2, children: l2 });
148
- })), Ne = { name: "maxSize", enabled: true, phase: "main", requiresIfExists: ["offset", "preventOverflow", "flip"], fn: function(e2) {
149
- var t2 = e2.state, o2 = e2.name, n2 = e2.options, r2 = oe(t2, n2), i2 = t2.modifiersData.preventOverflow || { x: 0, y: 0 }, a2 = i2.x, l2 = i2.y;
150
- let s2 = t2.rects.popper, c2 = s2.width, d2 = s2.height, p2 = t2.placement.split("-")[0], u2 = "left" === p2 ? "left" : "right", m2 = "top" === p2 ? "top" : "bottom";
151
- t2.modifiersData[o2] = { width: c2 - r2[u2] - a2, height: d2 - r2[m2] - l2 };
152
- } }, Be = [0, 2], Le = r(i((t2, o2) => {
153
- const { sx: r2, open: i2, children: l2, label: p2, offsets: u2 = Be, anchorEl: m2, anchorPosition: h2, onMount: f2, onOpening: x2, onOpen: g2, onClosing: b2, onClose: y2, resizeOnOverflow: v2 = true, ...k2 } = t2;
154
- if (Array.isArray(l2)) throw new Error("children can not be an array");
155
- const w2 = Y(), C2 = { name: "applyMaxSize", enabled: true, phase: "beforeWrite", requires: ["maxSize"], fn({ state: e2 }) {
156
- const { height: t3 } = e2.modifiersData.maxSize;
157
- e2.styles.popper.maxHeight = t3 - 10 + "px";
158
- } }, R2 = a(() => {
159
- const e2 = [{ name: "offset", options: { offset: u2 } }, { name: "flip", enabled: true, options: { rootBoundary: "document" } }];
160
- return v2 && e2.unshift(Ne, C2), e2;
161
- }, [v2, u2]), [P2, D2] = c(false), E2 = n.useRef(null), T2 = K(() => {
162
- f2?.(L2.current, E2.current);
163
- }, [x2]), z2 = K(x2, [x2]), $2 = K(g2, [g2]), O2 = K(b2, [b2]), I2 = K(() => {
164
- D2(false), y2?.();
165
- }, [y2]), [N2, B2] = c(false), L2 = n.useRef(null), A2 = n.useRef(true), H2 = a(() => ({ onFirstUpdate: () => {
166
- A2.current && (B2(true), T2?.(), A2.current = false);
167
- } }), [i2, P2]);
168
- s(() => {
169
- i2 && N2 ? z2?.() : !i2 && P2 && O2?.(), i2 && D2(i2);
170
- }, [i2, N2]);
171
- const W2 = a(() => ({ getBoundingClientRect: () => h2 ? new DOMRect(h2?.left || 0, h2?.top || 0, 0, 0) : m2.getBoundingClientRect() }), [h2, m2]);
172
- d(o2, () => ({ instance: () => E2.current, element: () => L2.current }), []);
173
- const { getPortalContainer: j2 } = V(), _2 = a(() => ({ zIndex: i2 ? "1300" : "1299", display: "flex", pointerEvents: P2 && i2 ? void 0 : "none", maxWidth: "100%", maxHeight: "100%", ...r2 }), [r2, i2, P2]);
174
- return e(M, { ref: L2, popperRef: E2, container: j2, anchorEl: W2, open: P2, role: void 0, popperOptions: H2, transition: true, sx: _2, placement: "bottom-start", modifiers: R2, ...k2, children: ({ TransitionProps: t3, placement: o3, ...n2 }) => {
175
- const { in: r3, onEnter: a2, onExited: s2, ...c2 } = t3 ?? {};
176
- return e(S, { ...c2, in: i2, onEnter: () => {
177
- a2?.(), $2();
178
- }, onExited: () => {
179
- s2?.(), I2();
180
- }, timeout: { enter: w2.transitions.duration.shorter, exit: 0 }, style: { transformOrigin: "bottom-start" === o3 ? "left top" : "center bottom" }, children: "function" == typeof l2 ? l2({ TransitionProps: t3, placement: o3, ...n2 }) : l2 || F.EmptyArray });
181
- } });
786
+ Xe.displayName = "StackTrace";
787
+ var Ye = B(D((e, r) => {
788
+ const { sx: o, icon: n = M(Y, {
789
+ iconKey: "Error",
790
+ style: { fontSize: 48 }
791
+ }), error: i, hideStackTrace: a = !1, stackTraceExpanded: l = !1, fullscreen: s = !1, ...c } = e, d = fe(), p = E(() => _e(i, a, l, s, d), [
792
+ i,
793
+ a,
794
+ l,
795
+ s,
796
+ d
797
+ ]);
798
+ return E(() => M(t, {
799
+ ref: r,
800
+ sx: {
801
+ boxSizing: "border-box",
802
+ alignItems: "center",
803
+ justifyContent: "center",
804
+ display: "flex",
805
+ flexDirection: "row",
806
+ overflow: "hidden",
807
+ width: "100%",
808
+ height: "100%",
809
+ ...o
810
+ },
811
+ ...c,
812
+ children: S(t, {
813
+ sx: {
814
+ display: "flex",
815
+ flex: "1 1 100%",
816
+ height: "100%",
817
+ alignItems: "center",
818
+ justifyContent: "center",
819
+ boxSizing: "border-box",
820
+ position: "relative"
821
+ },
822
+ children: [M(t, {
823
+ className: "backdrop",
824
+ sx: {
825
+ backdropFilter: "blur(4px)",
826
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
827
+ zIndex: -1,
828
+ position: "absolute",
829
+ width: "100%",
830
+ height: "100%",
831
+ boxSizing: "border-box"
832
+ }
833
+ }), M(f, {
834
+ elevation: 0,
835
+ sx: {
836
+ display: "flex",
837
+ flexDirection: "column",
838
+ justifyContent: "center",
839
+ alignItems: "center",
840
+ rowGap: "8px",
841
+ alignSelf: "center",
842
+ marginBottom: "5%",
843
+ backgroundColor: (e) => e.palette.background.paper,
844
+ color: (e) => e.palette.text.primary,
845
+ border: (e) => `1px solid ${e.palette.divider}`,
846
+ padding: (e) => e.spacing(3),
847
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
848
+ boxShadow: (e) => e.shadows[3],
849
+ zIndex: 1
850
+ },
851
+ children: M(t, {
852
+ sx: {
853
+ display: "flex",
854
+ flexDirection: "column",
855
+ alignItems: "center",
856
+ gap: (e) => e.spacing(2),
857
+ width: "100%",
858
+ maxWidth: s ? void 0 : "600px"
859
+ },
860
+ children: S(t, {
861
+ sx: {
862
+ display: "flex",
863
+ flexDirection: "row",
864
+ alignItems: "flex-start",
865
+ gap: (e) => e.spacing(2)
866
+ },
867
+ children: [M(t, {
868
+ sx: {
869
+ display: "flex",
870
+ color: (e) => e.palette.error.main
871
+ },
872
+ children: "string" == typeof n ? M(Y, {
873
+ iconKey: n,
874
+ style: { fontSize: 48 }
875
+ }) : n
876
+ }), p]
877
+ })
878
+ })
879
+ })]
880
+ })
881
+ }), [
882
+ o,
883
+ n,
884
+ p
885
+ ]);
182
886
  }));
183
- Le.displayName = "ExhibitPopper";
184
- const Fe = (e2) => {
185
- if ("dark" !== e2.palette.mode) return;
186
- return `drop-shadow(0px 0px 1px ${"dark" === e2.palette.mode ? e2.palette.text.primary : e2.palette.divider})`;
187
- }, Ae = (e2 = 1) => (t2) => {
188
- if ("dark" !== t2.palette.mode) return;
189
- const o2 = "dark" === t2.palette.mode ? t2.palette.text.primary : t2.palette.divider;
190
- return `drop-shadow(0px 0px ${e2}px ${o2})`;
191
- }, He = (t2) => e(W, { ...t2, iconKey: "ArrowDownOutline" }), We = (t2) => e(W, { ...t2, iconKey: "ArrowRightOutline" }), Ke = J(r(i((t2, o2) => {
192
- const { sx: n2, size: r2 = "medium", activeColor: i2, children: a2, className: l2, ...s2 } = t2;
193
- let c2 = "var(--icon-size)";
194
- return "small" === r2 ? c2 = "calc(var(--icon-size-sm) * .875)" : "large" === r2 && (c2 = "calc(var(--icon-size-lg) * 1.5)"), e(v, { ref: o2, className: h("icon", l2), sx: { width: "var(--icon-size)", height: "var(--icon-size)", "--icon-size-adj": c2, ...n2 }, ...s2, children: a2 });
195
- })))(({ theme: e2 }) => ({ fontSize: "var(--icon-size-adj)", minWidth: "var(--icon-size-adj)", minHeight: "var(--icon-size-adj)", fill: "currentColor", "& .activeColor": { fill: e2.palette.primary.main }, "& .styled.high_contrast": { fill: e2.palette.primary.main }, "& .styled.background": { fill: e2.palette.background.paper }, "& .styled.current_color": { fill: "currentColor" }, "& .styled.secondary": { fill: e2.palette.secondary.main }, "& .styled.secondary_dark": { fill: e2.palette.secondary.dark }, "& .styled.secondary_light": { fill: e2.palette.secondary.light }, "& .styled.info": { fill: e2.palette.info.main }, "& .styled.info.stroked": { stroke: e2.palette.info.main }, "& .styled.info_dark": { fill: e2.palette.info.dark }, "& .styled.info_light": { fill: e2.palette.info.light }, "& .styled.warning": { fill: e2.palette.warning.main }, "& .styled.warning.stroked": { stroke: e2.palette.warning.main }, "& .styled.warning_dark": { fill: e2.palette.warning.dark }, "& .styled.warning_light": { fill: e2.palette.warning.light }, "& .styled.error.info": { fill: e2.palette.error.main }, "& .styled.error.stroked": { stroke: e2.palette.error.main }, "& .styled.error_dark": { fill: e2.palette.error.dark }, "& .styled.error_light": { fill: e2.palette.error.light }, "& .styled.success": { fill: e2.palette.success.main }, "& .styled.success_dark": { fill: e2.palette.success.dark }, "& .styled.success_light": { fill: e2.palette.success.light }, "& .styled.grey": { fill: e2.palette.text.icon ?? e2.palette.action.active } })), Ve = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, je = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, _e = function(e2, t2 = null) {
196
- if (!e2) return e2;
197
- e2 = e2.replace(Ve, function(e3, t3, o3, n2) {
198
- return t3 + t3 + o3 + o3 + n2 + n2;
199
- });
200
- let o2 = je.exec(e2);
201
- return o2 ? null === t2 ? `rgb(${parseInt(o2[1], 16)}, ${parseInt(o2[2], 16)}, ${parseInt(o2[3], 16)})` : `rgb(${parseInt(o2[1], 16)} ${parseInt(o2[2], 16)} ${parseInt(o2[3], 16)} / ${100 * t2}%)` : e2;
202
- }, qe = function(e2, t2 = 0.2, o2 = "light") {
203
- if (!e2) return e2;
204
- let n2 = "dark" !== o2;
205
- return t2 < 0 && (n2 = !n2, t2 *= -1), e2 = _e(e2), n2 ? x(e2, Math.max(0, Math.min(1, 1 * t2))) : g(e2, Math.max(0, Math.min(1, 1.5 * t2)));
206
- }, Qe = function(e2) {
207
- let t2 = 0;
208
- return t2 = e2 < 1 ? 5.11916 * e2 ** 2 : 4.5 * Math.log(e2 + 1) + 2, (t2 / 100).toFixed(2);
209
- }, Ue = (e2, t2) => {
210
- let o2 = Z({ palette: { mode: e2 ? "dark" : "light" } });
211
- const n2 = { "--icon-primary": o2.palette.primary.main, "--icon-secondary": o2.palette.secondary.main, "--icon-secondary-light": o2.palette.secondary.light, "--icon-success": o2.palette.success.main, "--icon-success-light": o2.palette.success.light, "--icon-info": o2.palette.info.main, "--icon-warn": o2.palette.warning.main, "--icon-error": o2.palette.error.main, "--icon-error-light": o2.palette.error.light, "--icon-grey": o2.palette.text.icon ?? o2.palette.action.active, "--icon-shadow": e2 ? o2.palette.text.primary : o2.palette.divider, "--icon-size": "1.25rem", "@media (pointer: coarse)": { "--icon-size": "1.75rem" } };
212
- let r2 = { typography: {}, palette: { mode: e2 ? "dark" : "light", text: { secondary: e2 ? o2.palette.text.secondary : f(o2.palette.text.secondary, 0.75), icon: e2 ? f(o2.palette.text.secondary, 0.7) : f(o2.palette.text.primary, 0.75) } }, components: { MuiDialogTitle: { styleOverrides: { root: { fontWeight: "normal" } } }, MuiSelect: { defaultProps: { IconComponent: He, 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: { ...n2 } } }, 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() {
213
- return o2.palette.text.secondary;
214
- } }, dirty: { fontStyle: "italic", color: function() {
215
- return o2.palette.text.secondary;
216
- } } } } } }, i2 = r2;
217
- t2 && (i2 = te(r2, t2));
218
- return Z(i2);
887
+ Ye.displayName = "StackTraceErrorPanel";
888
+ var _e = (e, r = !1, o = !1, n = !1, i = (e) => e) => $(e) ? e : e instanceof Error ? S(t, {
889
+ sx: {
890
+ display: "flex",
891
+ flexDirection: "column",
892
+ minWidth: n ? "70vw" : "300px",
893
+ maxWidth: n ? void 0 : "500px",
894
+ width: "100%"
895
+ },
896
+ children: [
897
+ M(b, {
898
+ variant: "caption",
899
+ component: "div",
900
+ sx: {
901
+ fontSize: "0.875rem",
902
+ lineHeight: 1.43,
903
+ mb: 1
904
+ },
905
+ children: e.message
906
+ }),
907
+ e.cause ? M(b, {
908
+ variant: "caption",
909
+ component: "div",
910
+ sx: {
911
+ fontSize: "0.875rem",
912
+ lineHeight: 1.43,
913
+ letterSpacing: "0.01071em",
914
+ mb: 1,
915
+ opacity: .8
916
+ },
917
+ children: i("stackTrace.causedBy", { cause: e.cause instanceof Error ? e.cause.message : String(e.cause) })
918
+ }) : null,
919
+ !r && M(Xe, {
920
+ error: e,
921
+ hideLineNumbers: !0
922
+ })
923
+ ]
924
+ }) : M(b, {
925
+ variant: "caption",
926
+ component: "div",
927
+ sx: {
928
+ fontSize: "0.875rem",
929
+ lineHeight: 1.43,
930
+ letterSpacing: "0.01071em"
931
+ },
932
+ children: "string" === e ? e : `Unknown Error: ${String(e)}`
933
+ }), Je = B(D((e, r) => {
934
+ const { chips: n, sx: i, ...a } = e, l = E(() => {
935
+ if (!n) return null;
936
+ const e = Array.isArray(n) ? n : [n], t = [], r = e.length;
937
+ for (let n = 0; n < r; n++) {
938
+ const r = e[n];
939
+ let i = null;
940
+ "string" == typeof r ? i = M(o, {
941
+ label: r,
942
+ color: "primary",
943
+ size: "small",
944
+ sx: { scale: "0.8" }
945
+ }, "chip-" + n) : R(r, { key: "chip-" + n }), t.push(i);
946
+ }
947
+ return t;
948
+ }, [n]);
949
+ return M(t, {
950
+ ref: r,
951
+ sx: {
952
+ display: "flex",
953
+ flexDirection: "row",
954
+ marginLeft: "4px",
955
+ gap: "2px",
956
+ ...i
957
+ },
958
+ ...a,
959
+ children: l
960
+ });
961
+ })), Ze = (e) => {
962
+ if ("dark" === e.palette.mode) return `drop-shadow(0px 0px 1px ${"dark" === e.palette.mode ? e.palette.text.primary : e.palette.divider})`;
963
+ }, et = (e = 1) => (t) => {
964
+ if ("dark" === t.palette.mode) return `drop-shadow(0px 0px ${e}px ${"dark" === t.palette.mode ? t.palette.text.primary : t.palette.divider})`;
965
+ }, tt = (e) => M(Y, {
966
+ ...e,
967
+ iconKey: "ArrowDownOutline"
968
+ }), rt = (e) => M(Y, {
969
+ ...e,
970
+ iconKey: "ArrowRightOutline"
971
+ }), ot = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, nt = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, it = function(e, t = null) {
972
+ if (!e) return e;
973
+ e = e.replace(ot, function(e, t, r, o) {
974
+ return t + t + r + r + o + o;
975
+ });
976
+ let r = nt.exec(e);
977
+ return r ? null === t ? `rgb(${parseInt(r[1], 16)}, ${parseInt(r[2], 16)}, ${parseInt(r[3], 16)})` : `rgb(${parseInt(r[1], 16)} ${parseInt(r[2], 16)} ${parseInt(r[3], 16)} / ${100 * t}%)` : e;
978
+ }, at = function(e, t = .2, r = "light") {
979
+ if (!e) return e;
980
+ let o = "dark" !== r;
981
+ t < 0 && (o = !o, t *= -1), e = it(e);
982
+ try {
983
+ return o ? V(e, Math.max(0, Math.min(1, 1 * t))) : q(e, Math.max(0, Math.min(1, 1.5 * t)));
984
+ } catch {
985
+ return e;
986
+ }
987
+ }, lt = function(e) {
988
+ let t = 0;
989
+ return t = e < 1 ? 5.11916 * e ** 2 : 4.5 * Math.log(e + 1) + 2, Number((t / 100).toFixed(2));
990
+ }, st = (e) => (t) => {
991
+ if ("dark" !== t.palette.mode) return "var(--sxl-surface-raised, none)";
992
+ const r = H("#fff", lt(e));
993
+ return `var(--sxl-surface-raised, linear-gradient(${r}, ${r}))`;
994
+ }, ct = st(2), dt = st(8), pt = (e, t) => {
995
+ let r = v({ palette: { mode: e ? "dark" : "light" } });
996
+ const o = {
997
+ "--icon-shadow": e ? r.palette.text.primary : r.palette.divider,
998
+ "--icon-size": "1.25rem",
999
+ "@media (pointer: coarse)": { "--icon-size": "1.75rem" }
1000
+ };
1001
+ let n = {
1002
+ typography: {},
1003
+ palette: {
1004
+ mode: e ? "dark" : "light",
1005
+ text: {
1006
+ secondary: e ? r.palette.text.secondary : H(r.palette.text.secondary, .75),
1007
+ icon: e ? H(r.palette.text.secondary, .7) : H(r.palette.text.primary, .75)
1008
+ }
1009
+ },
1010
+ components: {
1011
+ MuiDialogTitle: { styleOverrides: { root: { fontWeight: "normal" } } },
1012
+ MuiSelect: {
1013
+ defaultProps: {
1014
+ IconComponent: tt,
1015
+ MenuProps: { container: () => document.fullscreenElement }
1016
+ },
1017
+ styleOverrides: { icon: { top: "unset" } }
1018
+ },
1019
+ MuiListItemIcon: { styleOverrides: { root: {
1020
+ minWidth: "0px !important",
1021
+ overflow: "hidden",
1022
+ marginLeft: "0px",
1023
+ marginRight: "6px",
1024
+ padding: "1px 1px",
1025
+ border: "solid transparent 1px",
1026
+ color: "unset"
1027
+ } } },
1028
+ MuiMenuItem: { styleOverrides: { root: {
1029
+ paddingTop: "2px",
1030
+ paddingBottom: "2px",
1031
+ marginLeft: "4px",
1032
+ marginRight: "4px",
1033
+ paddingLeft: "6px",
1034
+ paddingRight: "18px",
1035
+ borderRadius: "4px",
1036
+ fontSize: "0.875em",
1037
+ "@media (pointer: coarse)": { fontSize: "1em" },
1038
+ "&.Mui-selected": {}
1039
+ } } },
1040
+ MuiMenu: {
1041
+ defaultProps: { container: () => document.fullscreenElement },
1042
+ styleOverrides: { root: {
1043
+ paddingTop: "2px",
1044
+ paddingBottom: "2px",
1045
+ marginLeft: "4px",
1046
+ marginRight: "4px",
1047
+ paddingLeft: "6px",
1048
+ paddingRight: "18px",
1049
+ borderRadius: "4px",
1050
+ fontSize: "0.875em",
1051
+ "@media (pointer: coarse)": { fontSize: "1em" },
1052
+ "&.Mui-selected": {}
1053
+ } }
1054
+ },
1055
+ MuiToolbar: { styleOverrides: { root: {
1056
+ paddingTop: "4px",
1057
+ paddingBottom: "4px",
1058
+ "@media (min-width: 600px)": {
1059
+ paddingTop: "4px",
1060
+ paddingBottom: "4px"
1061
+ }
1062
+ } } },
1063
+ MuiDivider: { styleOverrides: { root: {
1064
+ marginTop: "4px !important",
1065
+ marginBottom: "4px !important",
1066
+ marginLeft: "0px",
1067
+ marginRight: "0px"
1068
+ } } },
1069
+ MuiInputBase: { styleOverrides: { root: {} } },
1070
+ MuiPaper: { styleOverrides: { root: {
1071
+ ...o,
1072
+ backgroundImage: "var(--sxl-surface-raised, var(--Paper-overlay))"
1073
+ } } },
1074
+ MuiPopover: { styleOverrides: { paper: {
1075
+ backgroundColor: `var(--sxl-color-elevated, var(--sxl-color-base-100, ${r.palette.background.paper}))`,
1076
+ border: "1px solid var(--sxl-color-elevated-border, transparent)"
1077
+ } } },
1078
+ MuiPopper: { styleOverrides: { root: { "& .menu": {
1079
+ marginTop: "4px",
1080
+ marginBottom: "4px",
1081
+ borderRadius: "4px"
1082
+ } } } },
1083
+ SmartInputField: { styleOverrides: {
1084
+ automatic: {
1085
+ transition: "opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
1086
+ color: function() {
1087
+ return r.palette.text.secondary;
1088
+ }
1089
+ },
1090
+ dirty: {
1091
+ fontStyle: "italic",
1092
+ color: function() {
1093
+ return r.palette.text.secondary;
1094
+ }
1095
+ }
1096
+ } }
1097
+ }
1098
+ }, i = n;
1099
+ return t && (i = ye(n, t)), v(i);
219
1100
  };
220
- function Ge(e2, t2) {
221
- return t2 = te({ track: qe(e2.palette.background.paper, 0.05, e2?.palette.mode), thumb: qe(e2.palette.background.paper, 0.3, e2?.palette.mode), active: e2.palette.primary.main, corner: e2.palette.background.paper, outline: false }, t2 || {}), { "--scrollbar-track-color": f(t2.track, 0.2), "--scrollbar-thumb-color": t2.thumb, "--scrollbar-button-color": t2.button || t2.thumb, "--scrollbar-active-color": t2.active, "--scrollbar-corner-color": t2.corner || t2.thumb, "--scrollbar-border-color": t2.track, "--scrollbar-width": "13px", "--scrollbar-height": "13px", "--scrollbar-border-radius": "9999px", "--scrollbar-border-width": "2px", "--scrollbar-min-thumb-size": "24px" };
222
- }
223
- function Xe(e2, t2) {
224
- const o2 = Ge(e2, t2), n2 = { ...o2, "& .scrollbar, & .vsb-track, & .vsb-thumb": { ...o2 }, "&::-webkit-scrollbar, & *::-webkit-scrollbar": { backgroundColor: "var(--scrollbar-track-color)", width: "var(--scrollbar-width)", height: "var(--scrollbar-height)" }, "&::-webkit-scrollbar-button": { display: "none" }, "& .scrollbar-button": { fill: "var(--scrollbar-thumb-color)", backgroundColor: "transparent", transition: "fill opacity 260ms ease", width: "var(--scrollbar-width)", height: "var(--scrollbar-height)" }, "& .scrollbar-button:hover:not([disabled])": { fill: "var(--scrollbar-active-color)" }, "& .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: "var(--scrollbar-border-radius)", backgroundColor: "var(--scrollbar-thumb-color)", minHeight: "var(--scrollbar-min-thumb-size)", minWidth: "var(--scrollbar-min-thumb-size)", border: "var(--scrollbar-border-width) solid var(--scrollbar-border-color)" }, "&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus": { backgroundColor: "var(--scrollbar-active-color)", border: t2?.outline ? t2.outline : void 0 }, "&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active": { backgroundColor: "var(--scrollbar-active-color)", border: t2?.outline ? t2.outline : void 0 }, "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": { backgroundColor: "var(--scrollbar-active-color)", border: t2?.outline ? t2.outline : void 0 }, "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": { backgroundColor: "var(--scrollbar-corner-color)" } };
225
- return F.getOS() === F.OSType.Firefox && (n2["* .pseudo-scrollbar"] = { scrollbarColor: "var(--scrollbar-thumb-color) transparent" }, n2["* .pseudo-scrollbar:hover:not([disabled])"] = { scrollbarColor: "var(--scrollbar-active-color) transparent" }), n2;
226
- }
227
- const Ye = { Light: "light", Dark: "dark" };
228
- function Je(e2) {
229
- const { mode: t2 } = e2 || {}, [o2, n2] = c(() => {
230
- if ("light" === t2 || "dark" === t2) return { themeMode: t2, source: "prop" };
231
- if ("undefined" != typeof document) {
232
- const e3 = Ze();
233
- if (e3) return { themeMode: e3, source: "class" };
234
- }
235
- return { themeMode: et(), source: "media" };
236
- });
237
- return s(() => {
238
- const e3 = () => {
239
- if (t2) return void (t2 === o2.themeMode && "prop" === o2.source || n2((e5) => ({ ...e5, themeMode: t2, source: "prop" })));
240
- const e4 = Ze();
241
- if (e4) n2({ themeMode: e4, source: "class" });
242
- else {
243
- const e5 = et();
244
- n2({ themeMode: e5, source: "media" });
245
- }
246
- }, r2 = new MutationObserver(e3), i2 = [document.documentElement, document.body].filter(Boolean);
247
- for (const e4 of i2) r2.observe(e4, { attributes: true, attributeFilter: ["class"] });
248
- const a2 = window.matchMedia("(prefers-color-scheme: dark)");
249
- return a2.addEventListener("change", e3), e3(), () => {
250
- r2.disconnect(), a2.removeEventListener("change", e3);
251
- };
252
- }, [t2]), o2;
253
- }
254
- function Ze() {
255
- if ("undefined" == typeof document) return null;
256
- const e2 = [...Array.from(document.body.classList), ...document.documentElement ? Array.from(document.documentElement.classList) : []];
257
- return e2.includes("dark") ? "dark" : e2.includes("light") ? "light" : null;
1101
+ function ut(e, t) {
1102
+ return t = ye({
1103
+ track: at(e.palette.background.paper, .05, e?.palette.mode),
1104
+ thumb: at(e.palette.background.paper, .3, e?.palette.mode),
1105
+ active: e.palette.primary.main,
1106
+ corner: e.palette.background.paper,
1107
+ outline: !1
1108
+ }, t || {}), ae({
1109
+ track: H(t.track, .2),
1110
+ thumb: t.thumb,
1111
+ button: t.button,
1112
+ active: t.active,
1113
+ corner: t.corner || t.thumb,
1114
+ border: t.track
1115
+ });
258
1116
  }
259
- function et() {
260
- return "undefined" == typeof window ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1117
+ function mt(e, t) {
1118
+ const r = ut(e, t), o = {
1119
+ ...r,
1120
+ "& .scrollbar, & .vsb-track, & .vsb-thumb": { ...r },
1121
+ "&::-webkit-scrollbar, & *::-webkit-scrollbar": {
1122
+ backgroundColor: "var(--scrollbar-track-color)",
1123
+ width: "var(--scrollbar-width)",
1124
+ height: "var(--scrollbar-height)"
1125
+ },
1126
+ "&::-webkit-scrollbar-button": { display: "none" },
1127
+ "& .scrollbar-button": {
1128
+ fill: "var(--scrollbar-thumb-color)",
1129
+ backgroundColor: "transparent",
1130
+ transition: "fill opacity 260ms ease",
1131
+ width: "var(--scrollbar-width)",
1132
+ height: "var(--scrollbar-height)"
1133
+ },
1134
+ "& .scrollbar-button:hover:not([disabled])": { fill: "var(--scrollbar-active-color)" },
1135
+ "& .scrollbar-button:disabled": { opacity: .8 },
1136
+ "&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {},
1137
+ "&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {},
1138
+ "&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
1139
+ borderRadius: "var(--scrollbar-border-radius)",
1140
+ backgroundColor: "var(--scrollbar-thumb-color)",
1141
+ minHeight: "var(--scrollbar-min-thumb-size)",
1142
+ minWidth: "var(--scrollbar-min-thumb-size)",
1143
+ border: "var(--scrollbar-border-width) solid var(--scrollbar-border-color)"
1144
+ },
1145
+ "&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus": {
1146
+ backgroundColor: "var(--scrollbar-active-color)",
1147
+ border: t?.outline ? t.outline : void 0
1148
+ },
1149
+ "&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active": {
1150
+ backgroundColor: "var(--scrollbar-active-color)",
1151
+ border: t?.outline ? t.outline : void 0
1152
+ },
1153
+ "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": {
1154
+ backgroundColor: "var(--scrollbar-active-color)",
1155
+ border: t?.outline ? t.outline : void 0
1156
+ },
1157
+ "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": { backgroundColor: "var(--scrollbar-corner-color)" }
1158
+ };
1159
+ return j.getPlatform() === j.OSType.Firefox && (o["* .pseudo-scrollbar"] = { scrollbarColor: "var(--scrollbar-thumb-color) transparent" }, o["* .pseudo-scrollbar:hover:not([disabled])"] = { scrollbarColor: "var(--scrollbar-active-color) transparent" }), o;
261
1160
  }
262
- const tt = { Popup: "popup", Anchor: "anchor" }, ot = { ByPopup: "popupDone", Cancel: "popupCancel", ClickAway: "clickAway" }, nt = { Toolbar: "toolbar", Menuitem: "menuitem" }, rt = (t2) => {
263
- const { closeFloat: o2, closeFloatAll: n2, floatReference: r2, popupContainer: i2, children: a2, className: l2, sx: s2, ...c2 } = t2;
264
- return e(v, { className: h("menu", l2), sx: { display: "flex", flexDirection: "column", ...s2 }, ...c2, children: a2 });
265
- }, it = (t2, o2, n2) => {
266
- let r2;
267
- return n2 && (r2 = (r2 ? r2 + " " : "") + "rotate(180deg)"), e(He, { style: { marginLeft: t2 ? void 0 : o2 ? "-0.25rem" : "-3px", marginRight: t2 ? void 0 : o2 ? "-0.25rem" : "-6px", transform: r2 }, color: "inherit" });
268
- }, at = r(i((t2, o2) => {
269
- const { open: n2, anchorEl: r2, anchorPosition: i2, label: s2, floatReference: d2, createPopupPanel: p2 = rt, propsPopper: u2, onMount: m2, onClosing: h2, onClose: f2, onOpening: x2, onOpen: g2, children: b2, sx: y2, ...v2 } = t2, k2 = K(h2, [h2]), C2 = K(f2, [f2]), M2 = K(x2, [x2]), S2 = K(g2, [g2]), [R2, P2] = c(), D2 = l(null), E2 = K((e2, t3) => {
270
- P2(e2), m2?.(D2.current, t3);
271
- }, [m2]), T2 = a(() => {
272
- const t3 = { popupContainer: R2, floatReference: d2, children: b2, ...v2 }, o3 = p2(t3);
273
- return e(w, { elevation: 8, ref: D2, sx: { display: "flex", overflow: "auto", outline: "none", "&.MuiPaper-root": (e2) => Xe(e2) }, tabIndex: 0, children: o3 });
274
- }, [p2, b2, R2, d2]);
275
- return e(Le, { ref: o2, anchorEl: r2, anchorPosition: i2, label: s2, open: n2, onMount: E2, onOpening: M2, onOpen: S2, onClosing: k2, onClose: C2, ...u2, children: T2 });
1161
+ var ht = {
1162
+ Popup: "popup",
1163
+ Anchor: "anchor"
1164
+ }, ft = {
1165
+ ByPopup: "popupDone",
1166
+ Cancel: "popupCancel",
1167
+ ClickAway: "clickAway"
1168
+ }, gt = {
1169
+ Toolbar: "toolbar",
1170
+ Menuitem: "menuitem"
1171
+ }, xt = (e) => {
1172
+ const { closeFloat: r, closeFloatAll: o, floatReference: n, popupContainer: i, children: a, className: l, sx: s, ...c } = e;
1173
+ return M(t, {
1174
+ className: W("menu", l),
1175
+ sx: {
1176
+ display: "flex",
1177
+ flexDirection: "column",
1178
+ paddingTop: (e) => `${e.shape.borderRadius}px`,
1179
+ paddingBottom: (e) => `${e.shape.borderRadius}px`,
1180
+ ...s
1181
+ },
1182
+ ...c,
1183
+ children: a
1184
+ });
1185
+ }, bt = (e, t, r) => {
1186
+ let o = "";
1187
+ return r && (o = (o ? o + " " : "") + "rotate(180deg)"), M(tt, {
1188
+ style: {
1189
+ marginLeft: e ? void 0 : t ? "-0.25rem" : "-3px",
1190
+ marginRight: e ? void 0 : t ? "-0.25rem" : "-6px",
1191
+ transform: o
1192
+ },
1193
+ color: "inherit"
1194
+ });
1195
+ }, yt = B(D((e, t) => {
1196
+ const { open: r, anchorEl: o, anchorPosition: n, label: i, floatReference: a, createPopupPanel: l = xt, propsPopper: s, onMount: c, onClosing: d, onClose: p, onOpening: u, onOpen: m, children: h, sx: g, ...x } = e, b = le(d ?? (() => {}), [d]), y = le(p ?? (() => {}), [p]), v = le(u ?? (() => {}), [u]), k = le(m ?? (() => {}), [m]), [w, C] = A(), S = K(null), T = le((e, t) => {
1197
+ C(e), c?.(S.current, t);
1198
+ }, [c]), P = E(() => {
1199
+ const e = {
1200
+ popupContainer: w,
1201
+ floatReference: a,
1202
+ children: h,
1203
+ ...x
1204
+ }, t = l(e);
1205
+ return M(f, {
1206
+ elevation: 8,
1207
+ ref: S,
1208
+ sx: {
1209
+ display: "flex",
1210
+ overflowX: "hidden",
1211
+ overflowY: "auto",
1212
+ outline: "none",
1213
+ backgroundColor: "var(--sxl-color-elevated, var(--sxl-color-base-100, #fff))",
1214
+ border: "1px solid var(--sxl-color-elevated-border, transparent)",
1215
+ "&.MuiPaper-root": (e) => mt(e)
1216
+ },
1217
+ tabIndex: 0,
1218
+ children: t
1219
+ });
1220
+ }, [
1221
+ l,
1222
+ h,
1223
+ w,
1224
+ a
1225
+ ]);
1226
+ return M(_, {
1227
+ ref: t,
1228
+ anchorEl: o,
1229
+ anchorPosition: n,
1230
+ label: i,
1231
+ open: r,
1232
+ onMount: T,
1233
+ onOpening: v,
1234
+ onOpen: k,
1235
+ onClosing: b,
1236
+ onClose: y,
1237
+ ...s,
1238
+ children: P
1239
+ });
276
1240
  }));
277
- at.displayName = "ExhibitFloatPanel";
278
- const lt = /* @__PURE__ */ new Map();
279
- let st = null;
280
- const ct = /* @__PURE__ */ new Map();
281
- let dt = null;
282
- const pt = (e2 = null, t2, o2, n2) => {
283
- if (dt && (dt.fn.clear(), dt = null), 0 === e2) return t2;
284
- null === e2 && (e2 = 120);
285
- const r2 = F.debounce(() => t2(), e2);
286
- return dt = { fn: r2, setReferences: o2, isClose: n2 }, dt.fn;
287
- }, ut = (e2, t2) => {
288
- if (null === t2) return;
289
- e2.add(t2);
290
- const o2 = lt.get(t2.key);
291
- if (!o2) return;
292
- const n2 = ct.get(o2);
293
- n2 && ut(e2, n2);
294
- }, mt = (e2) => {
295
- const t2 = /* @__PURE__ */ new Set();
296
- return ut(t2, e2), t2;
297
- }, ht = (t2) => {
298
- const { anchor: o2, label: r2 = null, parentFloat: i2 = null, onOpen: l2, onClose: d2, propsPopper: u2, createPopupPanel: m2 = rt } = t2 ?? {}, h2 = K(l2, [l2]), f2 = K(d2, [d2]), [x2, g2] = c(null), [b2, y2] = c(false), [v2, k2] = c(false), w2 = a(() => null === i2 ? (null === st && (st = { key: { label: "root" }, isRoot: true, parent: null, open: () => null, close: (e2) => null, closeChild: (e2) => null, onChildVisible: () => {
299
- }, onChildHidden: () => {
300
- }, closeAll: () => F2(0), floatElement: () => null, anchorElement: () => null }), st) : i2, []), C2 = a(() => ({ label: r2 }), []), M2 = n.useRef(null), S2 = n.useRef(o2);
301
- s(() => {
302
- S2.current = o2;
303
- }, [o2]);
304
- const R2 = (e2) => {
305
- const t3 = lt.get(e2);
306
- let o3 = null;
307
- if (t3) {
308
- const e3 = ct.get(t3);
309
- o3 = e3?.close(0);
310
- }
311
- return o3;
312
- }, P2 = () => R2(W2.key), [D2, E2] = c(), T2 = () => {
313
- if (!x2) return void I2();
314
- const e2 = new Promise((e3, t3) => {
315
- E2((o3) => ({ resolve: e3, reject: t3 }));
316
- });
317
- return P2(), lt.delete(w2.key), g2(false), e2;
318
- };
319
- s(() => {
320
- D2 && (D2.resolve(), E2(null));
321
- }, [b2, v2, D2]);
322
- const z2 = p(() => {
323
- let e2 = w2;
324
- for (; e2.parent; ) e2 = e2.parent;
325
- return R2(e2.key);
326
- }, []), $2 = () => {
327
- if (x2) return void I2();
328
- if (w2) {
329
- const e3 = ct.get(w2.key);
330
- e3?.open(0);
331
- }
332
- const e2 = lt.get(w2.key);
333
- if (e2 && e2 !== C2) {
334
- const t3 = ct.get(e2);
335
- t3?.close(0);
336
- }
337
- requestAnimationFrame(() => {
338
- lt.set(w2.key, W2.key), g2(true);
339
- });
340
- }, [O2, I2] = n.useReducer((e2) => e2 + 1, 0), N2 = p((e2) => null === m2 ? null : m2({ closeFloat: F2, closeFloatAll: H2, ...e2 }), [m2]), B2 = null === m2, L2 = K((e2 = 120) => pt(e2, $2, /* @__PURE__ */ new Set([W2]), false)(), [$2]), F2 = K((e2 = 60) => pt(e2, T2, mt(W2), true)(), [T2]), A2 = K((e2 = 360) => pt(e2, P2, mt(((e3) => {
341
- const t3 = lt.get(e3.key);
342
- return t3 && ct.get(t3) || null;
343
- })(W2)), true)(), [P2]), H2 = K(z2, [z2]), W2 = a(() => ({ key: C2, isRoot: false, label: r2, parent: w2, onChildVisible: () => {
344
- k2(true);
345
- }, onChildHidden: () => {
346
- k2(false);
347
- }, open: L2, close: F2, closeChild: A2, closeAll: H2, floatElement: () => M2.current, anchorElement: () => S2.current }), []);
348
- s(() => {
349
- ct.set(C2, W2);
350
- }, [W2]), s(() => () => {
351
- ct.delete(C2), F2(0);
352
- }, []), s(() => {
353
- x2 && !B2 && (y2(true), w2.onChildVisible());
354
- }, [x2, B2]);
355
- const V2 = p((e2) => {
356
- e2.which === j.Escape && (e2.preventDefault(), e2.stopPropagation(), F2(0));
357
- }, []), _2 = n.useRef(null), q2 = p(() => {
358
- const e2 = _2.current, t3 = M2.current;
359
- e2 && t3 && (requestAnimationFrame(() => {
360
- (t3.contains(document.activeElement) || document.activeElement === document.body) && e2.focus();
361
- }), _2.current = null), f2?.();
362
- }, []), Q2 = p((e2) => {
363
- M2.current = e2;
364
- e2.addEventListener("focus", (e3) => {
365
- _2.current = e3.relatedTarget;
366
- }, { once: true, passive: true });
367
- const t3 = document.activeElement;
368
- requestAnimationFrame(() => {
369
- t3 === document.activeElement && e2.focus();
370
- });
371
- }, []), [U2, G2] = c();
372
- s(() => {
373
- B2 && (x2 ? h2?.() : false === x2 && f2?.()), G2(b2 ? e(at, { floatReference: W2, open: x2, label: r2, anchorEl: o2, onOpening: () => {
374
- h2?.(), w2.onChildVisible();
375
- }, onClosing: q2, onClose: () => {
376
- y2(false), w2.onChildHidden();
377
- }, onMount: Q2, propsPopper: { onKeyDown: V2, onMouseEnter: (e2) => {
378
- x2 && dt?.isClose && dt.setReferences.has(W2) && (dt.fn.clear(), dt = null, W2.closeChild());
379
- }, ...u2 }, createPopupPanel: N2 }) : null);
380
- }, [b2, x2, r2, B2, u2, N2, O2]);
381
- const X2 = K((e2) => {
382
- if (0 === lt.size) return;
383
- let t3 = false;
384
- lt.forEach((o3) => {
385
- const n2 = ct.get(o3);
386
- if (t3) return;
387
- if (!n2) return;
388
- const r3 = n2.floatElement();
389
- r3?.contains?.(e2.target) && (t3 = true);
390
- const i3 = n2.anchorElement();
391
- i3?.contains?.(e2.target) && (t3 = true);
392
- }), t3 || z2();
393
- }, [z2]);
394
- return s(() => {
395
- if (!x2 || !w2.isRoot) return;
396
- const e2 = (e3) => {
397
- X2(e3);
398
- };
399
- return document.addEventListener("mousedown", e2), document.addEventListener("touchstart", e2), document.addEventListener("focus", e2), () => {
400
- document.removeEventListener("mousedown", e2), document.removeEventListener("touchstart", e2), document.removeEventListener("focus", e2);
401
- };
402
- }, [x2, w2]), { component: U2, reference: W2 };
403
- }, ft = r(i((o2, n2) => {
404
- const { nestedChildren: r2, variant: i2, disabled: a2 = false, createPopupPanel: l2, ...s2 } = o2, c2 = { disabled: a2, createPopupPanel: K((o3) => {
405
- if (!r2 || 0 === r2.length) return null;
406
- const { popupContainer: i3, floatReference: a3, ref: l3, ...s3 } = o3, c3 = [];
407
- for (let t2 = 0; t2 < r2.length; t2++) {
408
- const o4 = r2[t2];
409
- o4 && c3.push(e(ft, { parentFloat: a3, ...s3, ...o4 }, t2));
410
- }
411
- return t(v, { ref: n2, sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: ["Children here", c3, e(Dt, { parentFloat: a3, children: "Close other children" })] });
412
- }, [r2]), ...s2 };
413
- return e(i2 === nt.Toolbar ? Tt : $t, { ...c2 });
414
- })), xt = { placement: "right-start" }, gt = r(i((e2, r2) => {
415
- const { children: i2, sx: l2, parentFloat: c2, createPopupPanel: d2, propsPopper: p2 = xt, label: u2, ...m2 } = e2;
416
- ae(n.isValidElement(i2), "Must supply a child component to enable a context menu.");
417
- const h2 = i2, f2 = a(() => ({ ...h2?.props, ...m2, onContextMenu: (e3) => {
418
- h2?.props?.onContextMenu?.(e3), e3.isDefaultPrevented() || (m2?.onContextMenu?.(e3), e3.isDefaultPrevented() || (b2(e3), e3.preventDefault()));
419
- } }), [m2, h2?.props]), x2 = K(d2, [d2]), [g2, b2] = n.useState(null), { reference: y2, component: v2 } = ht({ label: u2 ?? "contextMenu", propsPopper: p2, parentFloat: c2, anchor: { getBoundingClientRect: () => new DOMRect(g2?.clientX || 0, g2?.clientY || 0) }, onClose: () => b2(null), createPopupPanel: x2 });
420
- return s(() => {
421
- g2 ? y2.open(0) : y2.close(0);
422
- }, [g2]), t(o, { children: [n.cloneElement(i2, f2), v2] });
423
- })), bt = i((t2, o2) => {
424
- const { slotProps: n2, ...r2 } = t2, { getPortalContainer: i2 } = V();
425
- return e(R, { ref: o2, slotProps: { ...n2, popper: { container: i2, ...n2?.popper || {} } }, ...r2 });
1241
+ yt.displayName = "ExhibitFloatPanel";
1242
+ var vt = (e) => M(yt, { ...e }), kt = (e) => M(J, {
1243
+ renderFloatPanel: vt,
1244
+ createPopupPanel: xt,
1245
+ ...e
1246
+ }), wt = B(D((e, r) => {
1247
+ const { nestedChildren: o, variant: n, disabled: i, createPopupPanel: a, ...l } = e, s = {
1248
+ disabled: i,
1249
+ createPopupPanel: le((e) => {
1250
+ if (!o || 0 === o.length) return M(C, {});
1251
+ const { popupContainer: n, floatReference: i, ref: a, ...l } = e, s = [];
1252
+ for (let e = 0; e < o.length; e++) {
1253
+ const t = o[e];
1254
+ t && s.push(M(wt, {
1255
+ ...l,
1256
+ ...t
1257
+ }, e));
1258
+ }
1259
+ return S(t, {
1260
+ ref: r,
1261
+ sx: {
1262
+ display: "flex",
1263
+ flexDirection: "column",
1264
+ paddingTop: "4px",
1265
+ paddingBottom: "4px"
1266
+ },
1267
+ children: [
1268
+ "Children here",
1269
+ s,
1270
+ M(Nt, { children: "Close other children" })
1271
+ ]
1272
+ });
1273
+ }, [o]),
1274
+ ...l
1275
+ };
1276
+ return M(n === gt.Toolbar ? Ot : Kt, { ...s });
1277
+ })), Ct = { placement: "right-start" }, Mt = B(D((e, t) => {
1278
+ const { children: r, sx: o, parentFloat: n, createPopupPanel: i, propsPopper: a = Ct, label: l, ...s } = e;
1279
+ ve($(r), "Must supply a child component to enable a context menu.");
1280
+ const c = r, d = E(() => ({
1281
+ ...c?.props,
1282
+ ...s,
1283
+ onContextMenu: (e) => {
1284
+ c?.props?.onContextMenu?.(e), e.isDefaultPrevented() || (s?.onContextMenu?.(e), e.isDefaultPrevented() || (m(e), e.preventDefault()));
1285
+ }
1286
+ }), [s, c?.props]), p = le(i ?? (() => {}), [i]), [u, m] = A(null), { reference: h, component: f } = pe({
1287
+ label: l ?? "contextMenu",
1288
+ propsPopper: a,
1289
+ parentFloat: n,
1290
+ anchor: { getBoundingClientRect: () => new DOMRect(u?.clientX || 0, u?.clientY || 0) },
1291
+ onClose: () => m(null),
1292
+ createPopupPanel: p
1293
+ });
1294
+ return N(() => {
1295
+ u ? h.open(0) : h.close(0);
1296
+ }, [u]), S(C, { children: [R(r, d), f] });
1297
+ })), St = D((e, t) => {
1298
+ const { slotProps: r, ...o } = e, { getPortalContainer: n, isFullscreen: i } = me();
1299
+ return M(x, {
1300
+ ref: t,
1301
+ slotProps: {
1302
+ ...r,
1303
+ popper: {
1304
+ container: i ? n : void 0,
1305
+ ...r?.popper || {}
1306
+ }
1307
+ },
1308
+ ...o
1309
+ });
426
1310
  });
427
- bt.displayName = "SimpleTooltip";
428
- const yt = r((t2) => {
429
- const { modifier: o2, sx: n2, ...r2 } = t2;
430
- return e(v, { sx: { marginLeft: "1px", marginRight: "1px", borderRadius: "4px", borderStyle: "solid", borderTopWidth: "1px", borderLeftWidth: "1px", borderRightWidth: "1px", borderBottomWidth: "2px", borderTopColor: (e2) => f(e2.palette.background.paper, e2.palette.action.disabledOpacity), borderLeftColor: (e2) => f(e2.palette.background.paper, e2.palette.action.disabledOpacity), borderRightColor: (e2) => f(e2.palette.background.paper, e2.palette.action.disabledOpacity), borderBottomColor: (e2) => f(e2.palette.background.paper, 1 - e2.palette.action.disabledOpacity), backgroundColor: (e2) => f(e2.palette.action.hover, e2.palette.action.disabledOpacity), paddingLeft: "4px", paddingRight: "4px", minHeight: "1.6em", display: "flex", justifyContent: "center", alignItems: "center", boxSizing: "content-box", overflow: "hidden", ...n2 }, ...r2, children: e(v, { sx: { display: "flex", alignItems: "center", justifyContent: "center", textAlign: "center", "& *": { fontWeight: "500" } }, children: o2 }) });
431
- }), vt = F.getOS() === F.OSType.MacOS || F.getOS() === F.OSType.IOS ? "Cmd" : "Ctrl", kt = (t2, o2 = false, n2 = null) => {
432
- if (Array.isArray(t2)) {
433
- let r3 = [], i3 = t2;
434
- for (let e2 = 0; e2 < i3.length; e2++) r3.push(kt(i3[e2], o2, n2 ?? "" + e2));
435
- return e(v, { sx: { display: "flex", alignItems: "center", flexDirection: "column" }, children: r3 }, n2);
436
- }
437
- if (!t2?.key) return null;
438
- const r2 = {};
439
- for (let e2 = 0; t2.modifiers && e2 < t2.modifiers.length; e2++) r2[t2.modifiers[e2]] = true;
440
- const i2 = [];
441
- return r2?.[_.Ctrl] && (i2.push(e(yt, { modifier: o2 ? "^" : e("div", { style: { paddingRight: "1px" }, children: vt }) }, "ctrl")), i2.push("+")), r2?.[_.Alt] && (i2.push(e(yt, { modifier: o2 ? "⌥" : "Alt" }, "alt")), i2.push("+")), r2?.[_.Shift] && (i2.push(e(yt, { modifier: o2 ? "⇧" : e("div", { style: { paddingRight: "1px" }, children: "Shift" }) }, "shift")), i2.push("+")), r2?.[_.Meta] && (i2.push(e(yt, { modifier: o2 ? e("div", { style: { paddingTop: "1px" }, children: "⌘" }) : "Meta" }, "meta")), i2.push("+")), i2.push(e(yt, { modifier: q.toPrettyKeyCode(t2.key) }, "character")), e(v, { sx: { display: "flex", alignItems: "center" }, children: i2 }, n2);
442
- }, wt = r(i((n2, r2) => {
443
- const { disabled: i2 = false, label: a2, shortcut: l2, chips: d2, description: p2, maxWidth: u2 = 280, useModifierSymbols: m2 = false, children: h2, simple: f2, componentDisabled: x2 = false, sx: g2, ...b2 } = n2;
444
- let y2 = null;
445
- l2 && (y2 = kt(l2, m2));
446
- const [w2, C2] = c(null);
447
- s(() => {
448
- Promise.resolve(a2).then((e2) => {
449
- C2(e2);
450
- });
451
- }, [a2]);
452
- return e(bt, { slotProps: { popper: { sx: { "& .MuiTooltip-tooltip": { marginTop: "0px !important" }, ...g2 }, modifiers: [{ name: "offset", options: { offset: [0, 14] } }] } }, className: "tooltip-wrapper", tabIndex: -1, title: !i2 && w2 ? t(v, { sx: { maxWidth: `${u2}px` }, ref: r2, children: [t(v, { sx: { display: "flex", flexDirection: "row", marginBottom: p2 ? "4px" : "0px" }, children: [e(k, { variant: "subtitle1", component: "div", flex: "1 1 100%", children: w2 }), d2 ? e(Ie, { chips: d2 }) : null, y2 ? e(v, { sx: { marginLeft: "8px" } }, "leadingSpace") : e(o, {}), y2] }), p2 ? e(k, { variant: "caption", sx: { whiteSpace: "pre-line", lineHeight: "1.4" }, children: p2 }) : e(o, {})] }) : "", enterDelay: 260, enterNextDelay: 130, leaveDelay: 230, disableInteractive: true, ...b2, children: e("div", { style: { display: "flex", alignItems: "stretch", justifyContent: "stretch" }, children: h2 }) });
453
- })), Ct = e(W, {}), Mt = e(W, { iconKey: "Check" }), St = r(i((o2, n2) => {
454
- const { dense: r2 = true, outlined: i2 = false, disableHover: l2 = false, parentFloat: s2, selected: d2, icon: p2, propsTooltip: u2, children: m2, primary: x2, sx: g2, disabled: y2, className: k2, onFocus: w2, onBlur: C2, ...M2 } = o2, [S2, R2] = c(false), P2 = { marginRight: "0px", padding: r2 ? "2px" : "7px", borderRadius: (e2) => `${e2.shape.borderRadius}px`, color: (e2) => x2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active, border: (e2) => `solid ${i2 ? e2.palette.divider : "transparent"} 1px`, "& .MuiTouchRipple-child": { borderRadius: (e2) => `${e2.shape.borderRadius}px !important` }, "&.Mui-selected": { backgroundColor: (e2) => f(e2.palette.text.primary, e2.palette.action.selectedOpacity), border: (e2) => `solid ${i2 ? e2.palette.text?.primary : e2.palette.divider} 1px` }, "&.Mui-disabled": { border: (e2) => `solid ${i2 ? e2.palette.divider : "transparent"} 1px` }, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)", opacity: ".8" }, "&.Mui-focusVisible": { outline: "solid transparent 1px", border: "1px solid transparent" }, ...g2 }, D2 = { "&:hover:not(.Mui-disabled, [disabled])": { color: (e2) => e2.palette.text.primary, border: (e2) => `solid ${i2 ? e2.palette.text?.primary : e2.palette.divider} 1px`, "&.Mui-selected": { backgroundColor: (e2) => f(e2.palette.text.primary, e2.palette.action.selectedOpacity + e2.palette.action.hoverOpacity) }, "> .outline-hover": { outline: (e2) => `solid ${i2 ? e2.palette.text?.primary : e2.palette.divider} 1px` }, backgroundColor: null }, "&.Mui-focusVisible": { outline: (e2) => `solid ${e2.palette.primary.main} 1px`, border: (e2) => `1px solid ${e2.palette?.primary?.main}`, zIndex: 1 } };
455
- let E2 = P2;
456
- l2 || (E2 = F.mergeContentful(P2, D2));
457
- const T2 = a(() => {
458
- let e2 = "function" == typeof p2 ? p2() : p2;
459
- return null === e2 ? e2 : e2 || (void 0 === d2 ? Ct : Mt);
460
- }, [p2, d2]);
461
- let z2 = t(b, { component: "div", ref: n2, className: h({ "Mui-focusVisible": S2, "Mui-selected": d2, "Mui-disabled": y2 }, k2), onFocus: (e2) => {
462
- R2(true), w2?.(e2);
463
- }, onBlur: (e2) => {
464
- R2(false), C2?.(e2);
465
- }, size: "small", TouchRippleProps: { center: false }, sx: E2, edge: "end", ...M2, disabled: y2 || false, children: [T2, m2] });
466
- if (u2) if (u2.simple && u2.label && !u2.disabled) {
467
- const { label: t2, description: o3, maxWidth: n3, shortcut: r3, useModifierSymbols: i3, componentDisabled: a2, simple: l3, chips: s3, ref: c2, ...d3 } = u2;
468
- z2 = e(bt, { disableInteractive: true, title: t2 ?? "", ...d3, children: e(v, { sx: { display: "flex" }, children: z2 }) });
469
- } else z2 = e(wt, { children: z2, ...u2 });
470
- return z2;
471
- })), Rt = e(W, {}), Pt = (e2) => e2.icon, Dt = r(i((o2, n2) => {
472
- const { icon: r2 = Rt, renderIcon: i2 = Pt, parentFloat: l2, className: s2, onFocus: d2, selected: p2, onBlur: u2, onMouseOver: m2, onMouseOut: f2, onMouseEnter: x2, disabled: g2, children: b2, sx: y2, propsTooltip: v2, chips: k2, primary: w2, ...C2 } = o2, [M2, S2] = c(false), [R2, E2] = c(false), T2 = a(() => {
473
- const t2 = i2?.({ icon: r2, disabled: g2, selected: p2 });
474
- return t2 ? e(P, { className: h({ "Mui-focusVisible": M2, "Mui-hovered": R2 }), sx: { "& .MuiSvgIcon-root": { color: (e2) => w2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { "& .MuiSvgIcon-root": { color: (e2) => e2.palette.text.primary } } }, children: t2 }) : null;
475
- }, [i2, g2, r2, M2, R2, w2, p2]);
476
- let z2 = t(D, { ref: n2, disabled: g2, onMouseOver: (e2) => {
477
- m2?.(e2), e2.isDefaultPrevented() || E2(true);
478
- }, onMouseOut: (e2) => {
479
- f2?.(e2), e2.isDefaultPrevented() || E2(false);
480
- }, onMouseEnter: (e2) => {
481
- x2?.(e2), e2.isDefaultPrevented() || l2?.closeChild();
482
- }, TouchRippleProps: { center: false }, className: h({ "Mui-focusVisible": M2, "Mui-hovered": R2 }, s2), onFocus: (e2) => {
483
- d2?.(e2), S2(true);
484
- }, onBlur: (e2) => {
485
- u2?.(e2), S2(false);
486
- }, sx: { flex: "1 1 100%", "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, "&.Mui-selected": { color: (e2) => e2.palette.text.primary }, color: (e2) => e2.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e2) => e2.palette.text.primary }, ...y2 }, ...C2, children: [T2, b2, k2 ? e(Ie, { chips: k2 }) : null] });
487
- return v2 && (z2 = e(wt, { children: z2, placement: "right-start", ...v2 })), z2;
488
- })), Et = r(i((t2, n2) => {
489
- const { children: r2, sx: i2, primary: a2 = false, variant: l2 = "subtitle1", ...s2 } = t2;
490
- return e(o, { children: e(k, { ref: n2, variant: l2, component: "div", sx: { userSelect: "none", fontWeight: "500", paddingLeft: "8px", paddingTop: "subtitle1" === l2 ? "2px" : void 0, paddingBottom: "subtitle1" === l2 ? "2px" : void 0, color: (e2) => a2 ? void 0 : e2.palette.text.secondary, ...i2 }, ...s2, children: r2 }) });
491
- })), Tt = r(i((n2, r2) => {
492
- const { dense: i2 = true, outlined: s2 = false, label: d2, selected: p2 = false, onQuickClick: u2, parentFloat: m2, createPopupPanel: x2, propsPopup: g2, onPopupOpen: y2, onPopupClose: k2, propsQuickButton: w2, renderQuickButton: C2, tooltip: M2 = "", createTooltip: S2, icon: R2, disabled: P2, propsButton: D2 = F.EmptyObject, disableHover: E2, touchRippleRef: T2, primary: z2, children: $2, sx: O2, className: I2, ...N2 } = n2, B2 = Y(), L2 = a(() => {
493
- const e2 = (e3, t2, o2, n3 = o2) => {
494
- const r3 = "boolean" == typeof s2 ? null : s2[e3];
495
- return "function" == typeof r3 ? r3(t2) : r3 || (s2 ? o2 : n3);
496
- };
497
- return { outline: { color: (t2) => e2("color", t2, t2.palette.divider, "transparent"), hoverColor: (t2) => e2("hoverColor", t2, t2.palette.text?.primary, t2.palette.divider), focusColor: (t2) => e2("focusColor", t2, t2.palette?.primary?.main) }, active: "dark" === B2.palette.mode ? B2.palette.text.secondary : B2.palette.text.primary, text: B2.palette.text.icon ?? B2.palette.action.active };
498
- }, [s2, B2]), [A2, H2] = c(false), [W2, V2] = c(false), [_2, q2] = c(false), Q2 = l(null), U2 = l(null), G2 = ht({ anchor: Q2.current, label: d2, createPopupPanel: x2, parentFloat: m2, propsPopper: g2?.propsPopper, onClose: () => {
499
- H2(false), k2?.();
500
- }, onOpen: () => {
501
- H2(true), y2?.();
502
- } }), X2 = K((e2) => {
503
- u2?.(e2), G2.reference.close(0);
504
- }, [u2, G2]), J2 = K(() => {
505
- A2 ? G2.reference.close(0) : G2.reference.open(0);
506
- }, [A2, G2, m2, d2]), Z2 = a(() => {
507
- const e2 = { "&.bordered": { borderWidth: "1px", borderRadius: "0px", borderTopStyle: "solid", borderBottomStyle: "solid", borderColor: (e3) => L2.outline.color(e3), "&.Mui-focusVisible": { border: (e3) => `1px solid ${L2.outline.focusColor(e3)} !important` }, "&:hover:not(.Mui-disabled, [disabled])": { borderColor: () => E2 ? "transparent" : void 0, backgroundColor: () => E2 ? "transparent" : void 0 }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { borderColor: (e3) => L2.outline.hoverColor(e3) }, "&.Mui-selected:not(.Mui-disabled, [disabled])": { borderColor: (e3) => L2.outline.hoverColor(e3) }, "&.left": { borderTopLeftRadius: (e3) => `${e3.shape.borderRadius}px`, borderBottomLeftRadius: (e3) => `${e3.shape.borderRadius}px`, borderLeftStyle: "solid" }, "&.hard-right": { borderRightStyle: "solid", borderRightWidth: "1px", borderRightColor: (e3) => L2.outline.color(e3) }, "&.right": { borderTopRightRadius: (e3) => `${e3.shape.borderRadius}px`, borderBottomRightRadius: (e3) => `${e3.shape.borderRadius}px`, borderRightStyle: "solid" }, "&.divider": { borderLeftWidth: "0px !important" } }, "& .MuiTouchRipple-child": { borderRadius: (e3) => `${e3.shape.borderRadius}px !important` } }, t2 = { "&.Mui-selected": { backgroundColor: (e3) => f(e3.palette.primary.main, e3.palette.action.selectedOpacity), "&:hover:not(.Mui-disabled)": { backgroundColor: (e3) => f(e3.palette.primary.main, e3.palette.action.selectedOpacity + e3.palette.action.hoverOpacity), "@media (hover: none)": { backgroundColor: (e3) => f(e3.palette.primary.main, e3.palette.action.selectedOpacity) } } } }, o2 = { maxHeight: "100%", "&.Mui-selected": { backgroundColor: (e3) => f(e3.palette.text.icon ?? e3.palette.action.active, e3.palette.action.selectedOpacity), "&:hover:not(.Mui-disabled)": { backgroundColor: (e3) => f(e3.palette.text.icon ?? e3.palette.action.active, e3.palette.action.selectedOpacity + e3.palette.action.hoverOpacity), "@media (hover: none)": { backgroundColor: (e3) => f(e3.palette.text.icon ?? e3.palette.action.active, e3.palette.action.selectedOpacity) } } }, "&:hover:not(.Mui-disabled, [disabled])": { color: (e3) => e3.palette.text.primary }, backgroundColor: () => E2 ? "transparent" : void 0, color: (e3) => e3.palette.text.icon, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)", opacity: ".8" }, padding: () => i2 ? "2px 3px" : "7px", marginRight: "0" }, n3 = F.mergeContentful(o2, e2), r3 = F.mergeContentful(n3, t2), a2 = F.mergeContentful(o2, e2);
508
- return { quickButtonStyling: n3, openQuickButtonStyling: r3, compoundStyling: a2, openCompoundStyling: F.mergeContentful(a2, t2) };
509
- }, [L2, E2]), ee2 = K((t2) => {
510
- const { children: o2, ref: n3, ...r3 } = t2;
511
- return e(bt, { ref: n3, ...r3, disableInteractive: true, children: o2 });
512
- }, []), te2 = u2 || C2, oe2 = te2 && (w2?.tooltip || w2?.createTooltip), ne2 = (t2) => {
513
- const { tooltip: o2, createTooltip: n3, sx: r3, ...i3 } = t2;
514
- let a2 = e(b, { sx: { ...r3 }, component: "div", ...i3 });
515
- return oe2 ? (a2 = (n3 ?? ee2)({ title: A2 ? "" : o2 ?? M2, children: e("div", { children: a2 }) }, A2), a2) : a2;
516
- }, re2 = { onKeyDown: (e2) => {
517
- e2.keyCode === j.Space ? J2() : e2.keyCode === j.F4 || e2.keyCode === j.Down ? G2.reference.open(0) : e2.keyCode === j.Up && G2.reference.close(0);
518
- } };
519
- let ie2 = e(o, {});
520
- const ae2 = a(() => "function" == typeof R2 ? R2() : R2, [R2]);
521
- if (te2) {
522
- let n3 = A2 ? Z2.openQuickButtonStyling : Z2.quickButtonStyling;
523
- const r3 = (C2 || ne2)({ tabIndex: -1, disabled: P2, size: "small", edge: "end", onMouseEnter: () => {
524
- G2.reference.parent.closeChild();
525
- }, onMouseDown: (e2) => {
526
- 0 === e2.button && (e2.preventDefault(), X2(e2));
527
- }, touchRippleRef: T2, children: ae2, ...w2, className: h({ "Mui-focusVisible": W2 || A2, "Mui-selected": p2, "Mui-hovered": _2 || A2, "Mui-disabled": P2, bordered: true, left: true, "hard-right": true }, w2?.className), sx: { ...Z2.quickButtonStyling, height: "100%", ...w2?.sx } });
528
- let a2 = it(true, i2, A2);
529
- oe2 && (a2 = (S2 ?? ee2)({ title: A2 ? "" : M2, children: a2 }, A2)), ie2 = t(o, { children: [r3, e(b, { ref: U2, component: "div", className: h({ "Mui-selected": A2, "Mui-hovered": _2 || A2, "Mui-disabled": P2, "Mui-focusVisible": W2 || A2, bordered: true, right: true, divider: true }), sx: { paddingLeft: (i2 ? 0 : 2) + "px", paddingRight: (i2 ? 0 : 2) + "px", width: () => "calc(var(--icon-size, 1.25em) * 0.8)", ...Z2.quickButtonStyling, ...n3 }, TouchRippleProps: { center: false }, tabIndex: -1, disabled: P2, size: "small", edge: "end", onMouseDown: (e2) => {
530
- 0 === e2.button && (e2.preventDefault(), J2());
531
- }, children: a2 })] });
532
- } else {
533
- let t2 = A2 ? Z2.openCompoundStyling : Z2.compoundStyling;
534
- ie2 = e(St, { ref: U2, tabIndex: -1, disabled: P2, size: "small", icon: ae2, className: h({ "Mui-selected": A2 || p2, "Mui-hovered": _2, "Mui-disabled": P2, "Mui-focusVisible": W2 || A2, bordered: true, left: true, right: true }), sx: { ...Z2.quickButtonStyling, ...t2 }, onMouseDown: (e2) => {
535
- 0 === e2.button && (e2.preventDefault(), J2());
536
- }, children: it(false, i2, A2) });
537
- }
538
- const { className: le2, sx: se2, ...ce2 } = D2;
539
- let de2 = e(v, { onFocus: () => V2(true), onBlur: () => V2(false), onMouseOver: () => q2(true), onMouseOut: () => q2(false), ...re2, "aria-label": "split button", ref: Q2, tabIndex: P2 ? void 0 : 0, className: h(le2, "split-button-root", { "Mui-focusVisible": W2 || A2, "Mui-selected": A2 || p2, "Mui-hovered": _2, "Mui-disabled": P2 }), sx: { display: "flex", flex: "1 1 100%", alignItems: "stretch", width: "fit-content", "&:not(.Mui-disabled)": { cursor: "pointer" }, marginLeft: s2 ? "1px" : "0px", marginRight: s2 ? "1px" : "0px", borderRadius: (e2) => `${e2.shape.borderRadius}px`, "&.Mui-focusVisible": { outline: (e2) => `solid ${e2.palette.primary.main} 1px`, zIndex: 2 }, ...se2 }, ...ce2, children: ie2 });
540
- return oe2 || (de2 = (S2 ?? ee2)({ title: A2 ? "" : M2, children: de2 }, A2)), t(v, { className: h(I2, "popupIconButton"), ref: r2, ...N2, sx: { zIndex: W2 || A2 ? 2 : void 0, display: "flex", alignItems: "center", ...O2 }, children: [de2, G2.component] });
1311
+ St.displayName = "SimpleTooltip";
1312
+ var Tt = B((e) => {
1313
+ const { modifier: r, sx: o, ...n } = e;
1314
+ return M(t, {
1315
+ sx: {
1316
+ marginLeft: "1px",
1317
+ marginRight: "1px",
1318
+ borderRadius: "4px",
1319
+ borderStyle: "solid",
1320
+ borderTopWidth: "1px",
1321
+ borderLeftWidth: "1px",
1322
+ borderRightWidth: "1px",
1323
+ borderBottomWidth: "2px",
1324
+ borderTopColor: (e) => H(e.palette.background.paper, e.palette.action.disabledOpacity),
1325
+ borderLeftColor: (e) => H(e.palette.background.paper, e.palette.action.disabledOpacity),
1326
+ borderRightColor: (e) => H(e.palette.background.paper, e.palette.action.disabledOpacity),
1327
+ borderBottomColor: (e) => H(e.palette.background.paper, 1 - e.palette.action.disabledOpacity),
1328
+ backgroundColor: (e) => H(e.palette.action.hover, e.palette.action.disabledOpacity),
1329
+ paddingLeft: "4px",
1330
+ paddingRight: "4px",
1331
+ minHeight: "1.6em",
1332
+ display: "flex",
1333
+ justifyContent: "center",
1334
+ alignItems: "center",
1335
+ boxSizing: "content-box",
1336
+ overflow: "hidden",
1337
+ ...o
1338
+ },
1339
+ ...n,
1340
+ children: M(t, {
1341
+ sx: {
1342
+ display: "flex",
1343
+ alignItems: "center",
1344
+ justifyContent: "center",
1345
+ textAlign: "center",
1346
+ "& *": { fontWeight: "500" }
1347
+ },
1348
+ children: r
1349
+ })
1350
+ });
1351
+ }), Pt = (e, r, o = !1, n = null) => {
1352
+ if (Array.isArray(e)) {
1353
+ let i = [], a = e;
1354
+ for (let e = 0; e < a.length; e++) i.push(Pt(a[e], r, o, n ?? "" + e));
1355
+ return M(t, {
1356
+ sx: {
1357
+ display: "flex",
1358
+ alignItems: "center",
1359
+ flexDirection: "column"
1360
+ },
1361
+ children: i
1362
+ }, n);
1363
+ }
1364
+ if (!e?.key) return null;
1365
+ const i = {};
1366
+ for (let t = 0; e.modifiers && t < e.modifiers.length; t++) i[e.modifiers[t]] = !0;
1367
+ const a = [], l = j.getPlatform() === j.OSType.MacOS || j.getPlatform() === j.OSType.IOS ? r("shortcut.modifier.cmd") : r("shortcut.modifier.ctrl");
1368
+ return i?.[te.Ctrl] && (a.push(M(Tt, { modifier: o ? "^" : M("div", {
1369
+ style: { paddingRight: "1px" },
1370
+ children: l
1371
+ }) }, "ctrl")), a.push("+")), i?.[te.Alt] && (a.push(M(Tt, { modifier: o ? "⌥" : r("shortcut.modifier.alt") }, "alt")), a.push("+")), i?.[te.Shift] && (a.push(M(Tt, { modifier: o ? "⇧" : M("div", {
1372
+ style: { paddingRight: "1px" },
1373
+ children: r("shortcut.modifier.shift")
1374
+ }) }, "shift")), a.push("+")), i?.[te.Meta] && (a.push(M(Tt, { modifier: o ? M("div", {
1375
+ style: { paddingTop: "1px" },
1376
+ children: "⌘"
1377
+ }) : r("shortcut.modifier.meta") }, "meta")), a.push("+")), a.push(M(Tt, { modifier: re.toPrettyKeyCode(e.key) }, "character")), M(t, {
1378
+ sx: {
1379
+ display: "flex",
1380
+ alignItems: "center"
1381
+ },
1382
+ children: a
1383
+ }, n);
1384
+ }, Rt = B(D((e, r) => {
1385
+ const { disabled: o = !1, label: n, shortcut: i, chips: a, description: l, maxWidth: s = 280, useModifierSymbols: c = !1, children: d, simple: p, componentDisabled: u = !1, sx: m, ...h } = e, f = fe();
1386
+ let g = null;
1387
+ i && (g = Pt(i, f, c));
1388
+ const [x, y] = A(null);
1389
+ N(() => {
1390
+ Promise.resolve(n).then((e) => {
1391
+ y(e);
1392
+ });
1393
+ }, [n]);
1394
+ return M(St, {
1395
+ slotProps: { popper: {
1396
+ sx: {
1397
+ "& .MuiTooltip-tooltip": { marginTop: "0px !important" },
1398
+ ...m
1399
+ },
1400
+ modifiers: [{
1401
+ name: "offset",
1402
+ options: { offset: [0, 14] }
1403
+ }]
1404
+ } },
1405
+ className: "tooltip-wrapper",
1406
+ tabIndex: -1,
1407
+ title: !o && x ? S(t, {
1408
+ sx: { maxWidth: `${s}px` },
1409
+ ref: r,
1410
+ children: [S(t, {
1411
+ sx: {
1412
+ display: "flex",
1413
+ flexDirection: "row",
1414
+ marginBottom: l ? "4px" : "0px"
1415
+ },
1416
+ children: [
1417
+ M(b, {
1418
+ variant: "subtitle1",
1419
+ component: "div",
1420
+ sx: { flex: "1 1 100%" },
1421
+ children: x
1422
+ }),
1423
+ a ? M(Je, { chips: a }) : null,
1424
+ g ? M(t, { sx: { marginLeft: "8px" } }, "leadingSpace") : M(C, {}),
1425
+ g
1426
+ ]
1427
+ }), l ? M(b, {
1428
+ variant: "caption",
1429
+ sx: {
1430
+ whiteSpace: "pre-line",
1431
+ lineHeight: "1.4"
1432
+ },
1433
+ children: l
1434
+ }) : M(C, {})]
1435
+ }) : "",
1436
+ enterDelay: 260,
1437
+ enterNextDelay: 130,
1438
+ leaveDelay: 230,
1439
+ disableInteractive: !0,
1440
+ ...h,
1441
+ children: M("div", {
1442
+ style: {
1443
+ display: "flex",
1444
+ alignItems: "stretch",
1445
+ justifyContent: "stretch"
1446
+ },
1447
+ children: d
1448
+ })
1449
+ });
1450
+ })), Dt = M(Y, {}), $t = M(Y, { iconKey: "Check" }), It = B(D((e, r) => {
1451
+ const { dense: o = !0, outlined: n = !1, disableHover: i = !1, selected: a, icon: l, propsTooltip: s, children: c, primary: p, sx: u, disabled: m, className: h, onFocus: f, onBlur: g, ...x } = e, [b, y] = A(!1), v = {
1452
+ marginRight: "0px",
1453
+ padding: o ? "2px" : "7px",
1454
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
1455
+ color: (e) => p ? void 0 : e.palette.text.icon ?? e.palette.action.active,
1456
+ border: (e) => `solid ${n ? e.palette.divider : "transparent"} 1px`,
1457
+ "& .MuiTouchRipple-child": { borderRadius: (e) => `${e.shape.borderRadius}px !important` },
1458
+ "&.Mui-selected": {
1459
+ backgroundColor: (e) => H(e.palette.text.primary, e.palette.action.selectedOpacity),
1460
+ border: (e) => `solid ${n ? e.palette.text?.primary : e.palette.divider} 1px`
1461
+ },
1462
+ "&.Mui-disabled": { border: (e) => `solid ${n ? e.palette.divider : "transparent"} 1px` },
1463
+ "&.Mui-disabled > .icon path": {
1464
+ filter: "grayscale(65%)",
1465
+ opacity: ".8"
1466
+ },
1467
+ "&.Mui-focusVisible": {
1468
+ outline: "solid transparent 1px",
1469
+ border: "1px solid transparent"
1470
+ },
1471
+ ...u
1472
+ }, k = {
1473
+ "&:hover:not(.Mui-disabled, [disabled])": {
1474
+ color: (e) => e.palette.text.primary,
1475
+ border: (e) => `solid ${n ? e.palette.text?.primary : e.palette.divider} 1px`,
1476
+ "&.Mui-selected": { backgroundColor: (e) => H(e.palette.text.primary, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity) },
1477
+ "> .outline-hover": { outline: (e) => `solid ${n ? e.palette.text?.primary : e.palette.divider} 1px` },
1478
+ backgroundColor: null
1479
+ },
1480
+ "&.Mui-focusVisible": {
1481
+ outline: (e) => `solid ${e.palette.primary.main} 1px`,
1482
+ border: (e) => `1px solid ${e.palette?.primary?.main}`,
1483
+ zIndex: 1
1484
+ }
1485
+ };
1486
+ let w = v;
1487
+ i || (w = j.mergeContentful(v, k));
1488
+ const C = E(() => {
1489
+ let e = "function" == typeof l ? l() : l;
1490
+ return null === e ? e : e || (void 0 === a ? Dt : $t);
1491
+ }, [l, a]);
1492
+ let T = S(d, {
1493
+ component: "div",
1494
+ ref: r,
1495
+ className: W({
1496
+ "Mui-focusVisible": b,
1497
+ "Mui-selected": a,
1498
+ "Mui-disabled": m
1499
+ }, h),
1500
+ onFocus: (e) => {
1501
+ y(!0), f?.(e);
1502
+ },
1503
+ onBlur: (e) => {
1504
+ y(!1), g?.(e);
1505
+ },
1506
+ size: "small",
1507
+ TouchRippleProps: { center: !1 },
1508
+ sx: w,
1509
+ edge: "end",
1510
+ ...x,
1511
+ disabled: m || !1,
1512
+ children: [C, c]
1513
+ });
1514
+ if (s) if (s.simple && s.label && !s.disabled) {
1515
+ const { label: e, description: r, maxWidth: o, shortcut: n, useModifierSymbols: i, componentDisabled: a, simple: l, chips: c, ref: d, ...p } = s;
1516
+ T = M(St, {
1517
+ disableInteractive: !0,
1518
+ title: e ?? "",
1519
+ ...p,
1520
+ children: M(t, {
1521
+ sx: { display: "flex" },
1522
+ children: T
1523
+ })
1524
+ });
1525
+ } else T = M(Rt, {
1526
+ children: T,
1527
+ ...s
1528
+ });
1529
+ return T;
1530
+ })), Bt = M(Y, {}), zt = (e) => e.icon, Nt = B(D((e, t) => {
1531
+ const { icon: r = Bt, renderIcon: o = zt, className: n, onFocus: i, selected: a, onBlur: l, onMouseOver: s, onMouseOut: c, onMouseEnter: d, disabled: p, children: u, sx: f, propsTooltip: g, chips: x, primary: b, ...y } = e, v = de(), [k, w] = A(!1), [C, T] = A(!1), P = E(() => {
1532
+ const e = o?.({
1533
+ icon: r,
1534
+ disabled: p,
1535
+ selected: a
1536
+ });
1537
+ return e ? M(h, {
1538
+ className: W({
1539
+ "Mui-focusVisible": k,
1540
+ "Mui-hovered": C
1541
+ }),
1542
+ sx: {
1543
+ "& .MuiSvgIcon-root": { color: (e) => b ? void 0 : e.palette.text.icon ?? e.palette.action.active },
1544
+ "&.Mui-hovered:not(.Mui-disabled, [disabled])": { "& .MuiSvgIcon-root": { color: (e) => e.palette.text.primary } }
1545
+ },
1546
+ children: e
1547
+ }) : null;
1548
+ }, [
1549
+ o,
1550
+ p,
1551
+ r,
1552
+ k,
1553
+ C,
1554
+ b,
1555
+ a
1556
+ ]);
1557
+ let R = S(m, {
1558
+ ref: t,
1559
+ role: "menuitem",
1560
+ disabled: p,
1561
+ onMouseOver: (e) => {
1562
+ s?.(e), e.isDefaultPrevented() || T(!0);
1563
+ },
1564
+ onMouseOut: (e) => {
1565
+ c?.(e), e.isDefaultPrevented() || T(!1);
1566
+ },
1567
+ onMouseEnter: (e) => {
1568
+ d?.(e), e.isDefaultPrevented() || v?.closeChild();
1569
+ },
1570
+ TouchRippleProps: { center: !1 },
1571
+ className: W({
1572
+ "Mui-focusVisible": k,
1573
+ "Mui-hovered": C
1574
+ }, n),
1575
+ onFocus: (e) => {
1576
+ i?.(e), w(!0);
1577
+ },
1578
+ onBlur: (e) => {
1579
+ l?.(e), w(!1);
1580
+ },
1581
+ sx: {
1582
+ flex: "1 1 100%",
1583
+ fontFamily: (e) => e.typography.fontFamily,
1584
+ fontWeight: 400,
1585
+ lineHeight: 1.5,
1586
+ paddingTop: "2px",
1587
+ paddingBottom: "2px",
1588
+ marginLeft: "4px",
1589
+ marginRight: "4px",
1590
+ paddingLeft: "6px",
1591
+ paddingRight: "18px",
1592
+ borderRadius: "4px",
1593
+ fontSize: "0.875em",
1594
+ "@media (pointer: coarse)": { fontSize: "1em" },
1595
+ "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" },
1596
+ "&.Mui-selected": { color: (e) => e.palette.text.primary },
1597
+ color: (e) => e.palette.text.secondary,
1598
+ "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e) => e.palette.text.primary },
1599
+ ...f
1600
+ },
1601
+ ...y,
1602
+ children: [
1603
+ P,
1604
+ u,
1605
+ x ? M(Je, { chips: x }) : null
1606
+ ]
1607
+ });
1608
+ return g && (R = M(Rt, {
1609
+ children: R,
1610
+ placement: "right-start",
1611
+ ...g
1612
+ })), R;
1613
+ })), Lt = B(D((e, t) => {
1614
+ const { children: r, sx: o, primary: n = !1, variant: i = "subtitle1", ...a } = e;
1615
+ return M(C, { children: M(b, {
1616
+ ref: t,
1617
+ variant: i,
1618
+ component: "div",
1619
+ sx: {
1620
+ userSelect: "none",
1621
+ fontWeight: "500",
1622
+ paddingLeft: "8px",
1623
+ paddingTop: "subtitle1" === i ? "2px" : void 0,
1624
+ paddingBottom: "subtitle1" === i ? "2px" : void 0,
1625
+ color: (e) => n ? void 0 : e.palette.text.secondary,
1626
+ ...o
1627
+ },
1628
+ ...a,
1629
+ children: r
1630
+ }) });
1631
+ })), Ot = B(D((e, r) => {
1632
+ const { dense: o = !0, outlined: n = !1, label: i, showLabel: a = !1, selected: l = !1, onQuickClick: s, parentFloat: c, createPopupPanel: p, propsPopup: u, onPopupOpen: m, onPopupClose: h, propsQuickButton: f, renderQuickButton: g, tooltip: x = "", createTooltip: b, icon: y, disabled: v, propsButton: w = j.EmptyObject, disableHover: T, ripple: P, primary: R, children: D, sx: $, className: I, ...B } = e, z = k(), N = E(() => {
1633
+ const e = (e, t, r, o = r) => {
1634
+ const i = "boolean" == typeof n ? null : n[e];
1635
+ return "function" == typeof i ? i(t) : i || (n ? r : o);
1636
+ };
1637
+ return {
1638
+ outline: {
1639
+ color: (t) => e("color", t, t.palette.divider, "transparent"),
1640
+ hoverColor: (t) => e("hoverColor", t, t.palette.text?.primary, t.palette.divider),
1641
+ focusColor: (t) => e("focusColor", t, t.palette?.primary?.main)
1642
+ },
1643
+ active: "dark" === z.palette.mode ? z.palette.text.secondary : z.palette.text.primary,
1644
+ text: z.palette.text.icon ?? z.palette.action.active
1645
+ };
1646
+ }, [n, z]), [L, O] = A(!1), [F, V] = A(!1), [q, Q] = A(!1), U = K(null), G = K(null), X = pe({
1647
+ anchor: U.current,
1648
+ label: i,
1649
+ createPopupPanel: p,
1650
+ parentFloat: c,
1651
+ propsPopper: u?.propsPopper,
1652
+ onClose: () => {
1653
+ O(!1), h?.();
1654
+ },
1655
+ onOpen: () => {
1656
+ O(!0), m?.();
1657
+ }
1658
+ }), Y = le((e) => {
1659
+ s?.(e), X.reference.close(0);
1660
+ }, [s, X]), _ = le(() => {
1661
+ L ? X.reference.close(0) : X.reference.open(0);
1662
+ }, [
1663
+ L,
1664
+ X,
1665
+ c,
1666
+ i
1667
+ ]), J = E(() => {
1668
+ const e = {
1669
+ "&.bordered": {
1670
+ borderWidth: "1px",
1671
+ borderRadius: "0px",
1672
+ borderTopStyle: "solid",
1673
+ borderBottomStyle: "solid",
1674
+ borderColor: (e) => N.outline.color(e),
1675
+ "&.Mui-focusVisible": { border: (e) => `1px solid ${N.outline.focusColor(e)} !important` },
1676
+ "&:hover:not(.Mui-disabled, [disabled])": {
1677
+ borderColor: () => T ? "transparent" : void 0,
1678
+ backgroundColor: () => T ? "transparent" : void 0
1679
+ },
1680
+ "&.Mui-hovered:not(.Mui-disabled, [disabled])": { borderColor: (e) => N.outline.hoverColor(e) },
1681
+ "&.Mui-selected:not(.Mui-disabled, [disabled])": { borderColor: (e) => N.outline.hoverColor(e) },
1682
+ "&.left": {
1683
+ borderTopLeftRadius: (e) => `${e.shape.borderRadius}px`,
1684
+ borderBottomLeftRadius: (e) => `${e.shape.borderRadius}px`,
1685
+ borderLeftStyle: "solid"
1686
+ },
1687
+ "&.hard-right": {
1688
+ borderRightStyle: "solid",
1689
+ borderRightWidth: "1px",
1690
+ borderRightColor: (e) => N.outline.color(e)
1691
+ },
1692
+ "&.right": {
1693
+ borderTopRightRadius: (e) => `${e.shape.borderRadius}px`,
1694
+ borderBottomRightRadius: (e) => `${e.shape.borderRadius}px`,
1695
+ borderRightStyle: "solid"
1696
+ },
1697
+ "&.divider": { borderLeftWidth: "0px !important" }
1698
+ },
1699
+ "& .MuiTouchRipple-child": { borderRadius: (e) => `${e.shape.borderRadius}px !important` }
1700
+ }, t = { "&.Mui-selected": {
1701
+ backgroundColor: (e) => H(e.palette.primary.main, e.palette.action.selectedOpacity),
1702
+ "&:hover:not(.Mui-disabled)": {
1703
+ backgroundColor: (e) => H(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
1704
+ "@media (hover: none)": { backgroundColor: (e) => H(e.palette.primary.main, e.palette.action.selectedOpacity) }
1705
+ }
1706
+ } }, r = {
1707
+ maxHeight: "100%",
1708
+ "&.Mui-selected": {
1709
+ backgroundColor: (e) => H(e.palette.text.icon ?? e.palette.action.active, e.palette.action.selectedOpacity),
1710
+ "&:hover:not(.Mui-disabled)": {
1711
+ backgroundColor: (e) => H(e.palette.text.icon ?? e.palette.action.active, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
1712
+ "@media (hover: none)": { backgroundColor: (e) => H(e.palette.text.icon ?? e.palette.action.active, e.palette.action.selectedOpacity) }
1713
+ }
1714
+ },
1715
+ "&:hover:not(.Mui-disabled, [disabled])": { color: (e) => e.palette.text.primary },
1716
+ backgroundColor: () => T ? "transparent" : void 0,
1717
+ color: (e) => e.palette.text.icon,
1718
+ "&.Mui-disabled > .icon path": {
1719
+ filter: "grayscale(65%)",
1720
+ opacity: ".8"
1721
+ },
1722
+ padding: () => o ? "2px 3px" : "7px",
1723
+ marginRight: "0"
1724
+ }, n = j.mergeContentful(r, e), i = j.mergeContentful(n, t), a = j.mergeContentful(r, e);
1725
+ return {
1726
+ quickButtonStyling: n,
1727
+ openQuickButtonStyling: i,
1728
+ compoundStyling: a,
1729
+ openCompoundStyling: j.mergeContentful(a, t)
1730
+ };
1731
+ }, [N, T]), Z = le((e) => {
1732
+ const { children: t, ref: r, ...o } = e;
1733
+ return M(St, {
1734
+ ref: r,
1735
+ ...o,
1736
+ disableInteractive: !0,
1737
+ children: t
1738
+ });
1739
+ }, []), te = s || g, re = te && (f?.tooltip || f?.createTooltip), oe = (e) => {
1740
+ const { tooltip: t, createTooltip: r, sx: o, ...n } = e;
1741
+ let i = M(d, {
1742
+ sx: { ...o },
1743
+ component: "div",
1744
+ ...n
1745
+ });
1746
+ return re ? (i = (r ?? Z)({
1747
+ title: L ? "" : t ?? x,
1748
+ children: M("div", { children: i })
1749
+ }, L), i) : i;
1750
+ }, ne = { onKeyDown: (e) => {
1751
+ e.keyCode === ee.Space ? _() : e.keyCode === ee.F4 || e.keyCode === ee.Down ? X.reference.open(0) : e.keyCode === ee.Up && X.reference.close(0);
1752
+ } };
1753
+ let ie = M(C, {});
1754
+ const ae = E(() => $e(("function" == typeof y ? y() : y) ?? (te ? Et : null), a ? i : null), [
1755
+ y,
1756
+ i,
1757
+ a,
1758
+ te
1759
+ ]);
1760
+ if (te) {
1761
+ let e = L ? J.openQuickButtonStyling : J.quickButtonStyling;
1762
+ const t = (g || oe)({
1763
+ tabIndex: -1,
1764
+ disabled: v,
1765
+ size: "small",
1766
+ edge: "end",
1767
+ onMouseEnter: () => {
1768
+ X.reference.parent?.closeChild();
1769
+ },
1770
+ onMouseDown: (e) => {
1771
+ 0 === e.button && (e.preventDefault(), Y(e));
1772
+ },
1773
+ disableRipple: !!P,
1774
+ children: S(C, { children: [ae, P] }),
1775
+ ...f,
1776
+ className: W({
1777
+ "Mui-focusVisible": F || L,
1778
+ "Mui-selected": l,
1779
+ "Mui-hovered": q || L,
1780
+ "Mui-disabled": v,
1781
+ bordered: !0,
1782
+ left: !0,
1783
+ "hard-right": !0
1784
+ }, f?.className),
1785
+ sx: {
1786
+ ...J.quickButtonStyling,
1787
+ height: "100%",
1788
+ ...f?.sx
1789
+ }
1790
+ });
1791
+ let r = bt(!0, o, L);
1792
+ re && (r = (b ?? Z)({
1793
+ title: L ? "" : x,
1794
+ children: r
1795
+ }, L)), ie = S(C, { children: [t, M(d, {
1796
+ ref: G,
1797
+ component: "div",
1798
+ className: W({
1799
+ "Mui-selected": L,
1800
+ "Mui-hovered": q || L,
1801
+ "Mui-disabled": v,
1802
+ "Mui-focusVisible": F || L,
1803
+ bordered: !0,
1804
+ right: !0,
1805
+ divider: !0
1806
+ }),
1807
+ sx: {
1808
+ paddingLeft: (o ? 0 : 2) + "px",
1809
+ paddingRight: (o ? 0 : 2) + "px",
1810
+ width: () => "calc(var(--icon-size, 1.25em) * 0.8)",
1811
+ ...J.quickButtonStyling,
1812
+ ...e
1813
+ },
1814
+ TouchRippleProps: { center: !1 },
1815
+ tabIndex: -1,
1816
+ disabled: v,
1817
+ size: "small",
1818
+ edge: "end",
1819
+ onMouseDown: (e) => {
1820
+ 0 === e.button && (e.preventDefault(), _());
1821
+ },
1822
+ children: r
1823
+ })] });
1824
+ } else {
1825
+ let e = L ? J.openCompoundStyling : J.compoundStyling;
1826
+ ie = M(It, {
1827
+ ref: G,
1828
+ tabIndex: -1,
1829
+ disabled: v,
1830
+ size: "small",
1831
+ icon: ae,
1832
+ className: W({
1833
+ "Mui-selected": L || l,
1834
+ "Mui-hovered": q,
1835
+ "Mui-disabled": v,
1836
+ "Mui-focusVisible": F || L,
1837
+ bordered: !0,
1838
+ left: !0,
1839
+ right: !0
1840
+ }),
1841
+ sx: {
1842
+ ...J.quickButtonStyling,
1843
+ ...e
1844
+ },
1845
+ onMouseDown: (e) => {
1846
+ 0 === e.button && (e.preventDefault(), _());
1847
+ },
1848
+ children: bt(!1, o, L)
1849
+ });
1850
+ }
1851
+ const { className: se, sx: ce, ...de } = w;
1852
+ let ue = M(t, {
1853
+ onFocus: () => V(!0),
1854
+ onBlur: () => V(!1),
1855
+ onMouseOver: () => Q(!0),
1856
+ onMouseOut: () => Q(!1),
1857
+ ...ne,
1858
+ "aria-label": "split button",
1859
+ ref: U,
1860
+ tabIndex: v ? void 0 : 0,
1861
+ className: W(se, "split-button-root", {
1862
+ "Mui-focusVisible": F || L,
1863
+ "Mui-selected": L || l,
1864
+ "Mui-hovered": q,
1865
+ "Mui-disabled": v
1866
+ }),
1867
+ sx: {
1868
+ display: "flex",
1869
+ flex: "1 1 100%",
1870
+ alignItems: "stretch",
1871
+ width: "fit-content",
1872
+ "&:not(.Mui-disabled)": { cursor: "pointer" },
1873
+ marginLeft: n ? "1px" : "0px",
1874
+ marginRight: n ? "1px" : "0px",
1875
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
1876
+ "&.Mui-focusVisible": {
1877
+ outline: (e) => `solid ${e.palette.primary.main} 1px`,
1878
+ zIndex: 2
1879
+ },
1880
+ ...ce
1881
+ },
1882
+ ...de,
1883
+ children: ie
1884
+ });
1885
+ return re || (ue = (b ?? Z)({
1886
+ title: L ? "" : x,
1887
+ children: ue
1888
+ }, L)), S(t, {
1889
+ className: W(I, "popupIconButton"),
1890
+ ref: r,
1891
+ ...B,
1892
+ sx: {
1893
+ zIndex: F || L ? 2 : void 0,
1894
+ display: "flex",
1895
+ alignItems: "center",
1896
+ ...$
1897
+ },
1898
+ children: [ue, X.component]
1899
+ });
541
1900
  }));
542
- Tt.displayName = "ExhibitPopupIconButton";
543
- const zt = {}, $t = r(i((n2, r2) => {
544
- const { selected: i2 = false, label: s2, onQuickClick: d2, parentFloat: u2, createPopupPanel: m2, propsPopup: f2 = zt, onPopupOpen: x2, onPopupClose: g2, propsQuickButton: b2, renderQuickButton: k2, tooltip: w2 = "", createTooltip: C2, icon: M2, disabled: S2, touchRippleRef: R2, primary: P2, children: E2, sx: T2, ...z2 } = n2, [$2, O2] = c(false), [I2, N2] = c(false), [B2, L2] = c(false), [F2, A2] = c(false), H2 = l(null), W2 = l(null), V2 = a(() => {
545
- if (!f2) return;
546
- const { propsPopper: e2 } = f2;
547
- return { placement: "right-start", offsets: [-4, -2], ...e2 };
548
- }, [f2]), j2 = ht({ anchor: H2.current, label: s2, createPopupPanel: m2, parentFloat: u2, propsPopper: V2, onClose: () => {
549
- O2(false), g2?.();
550
- }, onOpen: () => {
551
- O2(true), x2?.();
552
- } }), _2 = K((e2) => {
553
- 0 === e2.button && (d2?.(e2), j2.reference.close(0));
554
- }, [d2]), q2 = e(We, {}), Q2 = { "&.Mui-selected": { color: (e2) => e2.palette.text.primary, "& svg * ": { color: (e2) => e2.palette.text.primary } } }, U2 = p((t2) => {
555
- const { children: o2, ref: n3, ...r3 } = t2;
556
- return e(bt, { ref: n3, ...r3, disableInteractive: true, children: o2 });
557
- }, []), G2 = d2 || k2, X2 = (t2) => {
558
- const { tooltip: o2, createTooltip: n3, ...r3 } = t2;
559
- return e(Dt, { icon: M2, className: h({ "Mui-hovered": B2 }), sx: { flex: "1 1 100%", ...Q2 }, ...r3, children: s2 });
560
- }, Y2 = { onFocus: () => {
561
- N2(true);
562
- }, onBlur: () => N2(false), onMouseOver: () => {
563
- L2(true);
564
- }, onMouseLeave: () => {
565
- L2(false);
566
- }, onMouseEnter: () => {
567
- j2.reference.open();
568
- }, onMouseDown: (e2) => {
569
- 0 === e2.button && e2.preventDefault();
570
- } };
571
- let J2 = e(o, {});
572
- if (G2) {
573
- const n3 = (k2 || X2)({ tabIndex: -1, disabled: S2, onMouseEnter: () => {
574
- j2.reference.parent.closeChild();
575
- }, onMouseDown: (e2) => {
576
- 0 === e2.button && (e2.preventDefault(), _2(e2));
577
- }, className: h("quick-left", {}, b2?.className), ...b2 });
578
- J2 = t(o, { children: [n3, e(y, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: true }), e(D, { ref: W2, className: h({ "Mui-selected": $2, "Mui-hovered": B2 }), sx: { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px", paddingLeft: "0px", paddingRight: "0px", marginLeft: "0px", color: (e2) => P2 ? void 0 : e2.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e2) => e2.palette.text.primary }, ...Q2 }, tabIndex: -1, disabled: S2, ...Y2, children: e(v, { className: "expand-icon", sx: { flex: "none", display: "flex", border: "1px solid transparent", paddingTop: "1px", paddingBottom: "1px", color: (e2) => P2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, onMouseOver: (e2) => {
579
- e2.preventDefault(), A2(true);
580
- }, onMouseLeave: () => {
581
- A2(false);
582
- }, onClick: (e2) => {
583
- e2.preventDefault(), $2 ? j2.reference.close() : j2.reference.open();
584
- }, children: q2 }) })] });
585
- } else J2 = t(Dt, { ref: W2, tabIndex: -1, disabled: S2, icon: M2, className: h({ "Mui-selected": $2 || i2, "Mui-hovered": B2 }), sx: { flex: "1 1 100%", paddingRight: "0px", ...Q2 }, onClick: (e2) => {
586
- e2.preventDefault(), $2 ? j2.reference.close() : j2.reference.open();
587
- }, ...Y2, children: [e("div", { style: { flex: "1 1 100%" }, children: s2 }), e(v, { className: "expand-icon", sx: { flex: "none", display: "flex", color: (e2) => P2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, children: q2 })] });
588
- let Z2 = e(v, { "aria-label": "split button", ref: H2, tabIndex: S2 ? void 0 : 0, className: h({ "Mui-disabled": S2, "Mui-selected": $2, "Mui-focusVisible": I2 || $2, "Mui-hovered": B2 }), 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%)" }, ...T2 }, ...z2, children: J2 });
589
- return G2 && !F2 && (b2?.tooltip || b2?.createTooltip) && (Z2 = (b2?.createTooltip ?? U2)({ title: $2 ? "" : Z2 ?? b2?.tooltip, children: Z2 }, $2)), t(v, { ref: r2, sx: { zIndex: I2 || $2 ? 2 : void 0, display: "flex", " .tooltip-wrapper": { display: "flex", flex: "1 1 100%" } }, children: [Z2, j2.component] });
590
- })), Ot = r(i((t2, o2) => {
591
- const { onSelectToggle: n2, selected: r2 = false, label: i2, shortcut: a2, tabIndex: l2 = 0, preventFocus: s2 = false, ...c2 } = t2;
592
- return e(wt, { label: i2, shortcut: a2, children: e(St, { ref: o2, outlined: false, tabIndex: l2, selected: r2, onMouseDown: (e2) => {
593
- s2 && e2.preventDefault();
594
- }, onClick: () => {
595
- n2?.(!r2);
596
- }, ...c2 }) });
597
- })), It = e(W, {}), Nt = e(W, { iconKey: "Check" }), Bt = r(i((t2, o2) => {
598
- const { children: n2, selected: r2 = true, outlined: i2 = true, sx: l2, ...s2 } = t2, c2 = a(() => ({ display: "flex", border: (e2) => r2 ? `solid ${i2 ? e2.palette.divider : "transparent"} 1px` : "solid transparent 1px", borderRadius: (e2) => `${e2.shape.borderRadius}px`, backgroundColor: (e2) => {
599
- if (r2) return f(e2.palette.text.icon ?? e2.palette.action.active, e2.palette.action.selectedOpacity);
600
- }, ...l2 }), [l2]);
601
- let d2 = n2;
602
- return null === d2 && (d2 = It), d2 || (d2 = Nt), e(v, { ref: o2, sx: c2, ...s2, children: d2 });
1901
+ Ot.displayName = "ExhibitPopupIconButton";
1902
+ var Et = M(Y, { iconKey: "Check" }), Ft = {}, Kt = B(D((e, r) => {
1903
+ const { selected: o = !1, label: n, showLabel: i, onQuickClick: a, parentFloat: l, createPopupPanel: c, propsPopup: d = Ft, onPopupOpen: p, onPopupClose: u, propsQuickButton: h, renderQuickButton: f, tooltip: g = "", createTooltip: x, icon: b, disabled: y, ripple: v, primary: k, children: w, sx: T, ...P } = e, [R, D] = A(!1), [$, I] = A(!1), [B, N] = A(!1), [L, O] = A(!1), F = K(null), H = K(null), V = E(() => {
1904
+ if (!d) return;
1905
+ const { propsPopper: e } = d;
1906
+ return {
1907
+ placement: "right-start",
1908
+ offsets: [-4, -2],
1909
+ ...e
1910
+ };
1911
+ }, [d]), q = pe({
1912
+ anchor: F.current,
1913
+ label: n,
1914
+ createPopupPanel: c,
1915
+ parentFloat: l,
1916
+ propsPopper: V,
1917
+ onClose: () => {
1918
+ D(!1), u?.();
1919
+ },
1920
+ onOpen: () => {
1921
+ D(!0), p?.();
1922
+ }
1923
+ }), j = le((e) => {
1924
+ 0 === e.button && (a?.(e), q.reference.close(0));
1925
+ }, [a]), Q = M(rt, {}), U = { "&.Mui-selected": {
1926
+ color: (e) => e.palette.text.primary,
1927
+ "& svg * ": { color: (e) => e.palette.text.primary }
1928
+ } }, G = z((e) => {
1929
+ const { children: t, ref: r, ...o } = e;
1930
+ return M(St, {
1931
+ ref: r,
1932
+ ...o,
1933
+ disableInteractive: !0,
1934
+ children: t
1935
+ });
1936
+ }, []), X = a || f, Y = (e) => {
1937
+ const { tooltip: t, createTooltip: r, ...o } = e;
1938
+ return S(Nt, {
1939
+ icon: b,
1940
+ disableRipple: !!v,
1941
+ className: W({ "Mui-hovered": B }),
1942
+ sx: {
1943
+ flex: "1 1 100%",
1944
+ ...U
1945
+ },
1946
+ ...o,
1947
+ children: [n, v]
1948
+ });
1949
+ }, _ = {
1950
+ onFocus: () => {
1951
+ I(!0);
1952
+ },
1953
+ onBlur: () => I(!1),
1954
+ onMouseOver: () => {
1955
+ N(!0);
1956
+ },
1957
+ onMouseLeave: () => {
1958
+ N(!1);
1959
+ },
1960
+ onMouseEnter: (e) => {
1961
+ e.preventDefault(), q.reference.open();
1962
+ },
1963
+ onMouseDown: (e) => {
1964
+ 0 === e.button && e.preventDefault();
1965
+ }
1966
+ };
1967
+ let J = M(C, {});
1968
+ if (X) {
1969
+ const e = {
1970
+ tabIndex: -1,
1971
+ disabled: y,
1972
+ onMouseEnter: () => {
1973
+ q.reference.parent?.closeChild();
1974
+ },
1975
+ onMouseDown: (e) => {
1976
+ 0 === e.button && (e.preventDefault(), j(e));
1977
+ },
1978
+ className: W("quick-left", {}, h?.className),
1979
+ ...h
1980
+ };
1981
+ J = S(C, { children: [
1982
+ (f || Y)(e),
1983
+ M(s, {
1984
+ sx: {
1985
+ ml: "0px",
1986
+ mr: "0px"
1987
+ },
1988
+ orientation: "vertical",
1989
+ variant: "middle",
1990
+ flexItem: !0
1991
+ }),
1992
+ M(m, {
1993
+ ref: H,
1994
+ className: W({
1995
+ "Mui-selected": R,
1996
+ "Mui-hovered": B
1997
+ }),
1998
+ sx: {
1999
+ borderTopLeftRadius: "0px",
2000
+ borderBottomLeftRadius: "0px",
2001
+ borderTopRightRadius: "4px",
2002
+ borderBottomRightRadius: "4px",
2003
+ padding: "0",
2004
+ paddingTop: "2px",
2005
+ paddingBottom: "2px",
2006
+ marginLeft: "0px",
2007
+ marginRight: "6px",
2008
+ color: (e) => k ? void 0 : e.palette.text.secondary,
2009
+ "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e) => e.palette.text.primary },
2010
+ ...U
2011
+ },
2012
+ tabIndex: -1,
2013
+ disabled: y,
2014
+ ..._,
2015
+ children: M(t, {
2016
+ className: "expand-icon",
2017
+ sx: {
2018
+ flex: "none",
2019
+ display: "flex",
2020
+ border: "1px solid transparent",
2021
+ paddingTop: "1px",
2022
+ paddingBottom: "1px",
2023
+ color: (e) => k ? void 0 : e.palette.text.icon ?? e.palette.action.active
2024
+ },
2025
+ onMouseOver: (e) => {
2026
+ e.preventDefault(), O(!0);
2027
+ },
2028
+ onMouseLeave: () => {
2029
+ O(!1);
2030
+ },
2031
+ onClick: (e) => {
2032
+ e.preventDefault(), R ? q.reference.close() : q.reference.open();
2033
+ },
2034
+ children: Q
2035
+ })
2036
+ })
2037
+ ] });
2038
+ } else J = S(Nt, {
2039
+ ref: H,
2040
+ tabIndex: -1,
2041
+ disabled: y,
2042
+ icon: b,
2043
+ className: W({
2044
+ "Mui-selected": R || o,
2045
+ "Mui-hovered": B
2046
+ }),
2047
+ sx: {
2048
+ flex: "1 1 100%",
2049
+ paddingRight: "0px",
2050
+ ...U
2051
+ },
2052
+ onClick: (e) => {
2053
+ e.preventDefault(), R ? q.reference.close() : q.reference.open();
2054
+ },
2055
+ ..._,
2056
+ children: [M("div", {
2057
+ style: { flex: "1 1 100%" },
2058
+ children: n
2059
+ }), M(t, {
2060
+ className: "expand-icon",
2061
+ sx: {
2062
+ flex: "none",
2063
+ display: "flex",
2064
+ color: (e) => k ? void 0 : e.palette.text.icon ?? e.palette.action.active
2065
+ },
2066
+ children: Q
2067
+ })]
2068
+ });
2069
+ let Z = M(t, {
2070
+ "aria-label": "split button",
2071
+ ref: F,
2072
+ tabIndex: y ? void 0 : 0,
2073
+ className: W({
2074
+ "Mui-disabled": y,
2075
+ "Mui-selected": R,
2076
+ "Mui-focusVisible": $ || R,
2077
+ "Mui-hovered": B
2078
+ }),
2079
+ sx: {
2080
+ display: "flex",
2081
+ flex: "1 1 100%",
2082
+ alignItems: "center",
2083
+ width: "fit-content",
2084
+ "& .quick-left": {
2085
+ borderTopRightRadius: "0px",
2086
+ borderBottomRightRadius: "0px",
2087
+ marginRight: "-1px"
2088
+ },
2089
+ "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" },
2090
+ ...T
2091
+ },
2092
+ ...P,
2093
+ children: J
2094
+ });
2095
+ return X && !L && (h?.tooltip || h?.createTooltip) && (Z = (h?.createTooltip ?? G)({
2096
+ title: R ? "" : Z ?? h?.tooltip,
2097
+ children: Z
2098
+ }, R)), S(t, {
2099
+ ref: r,
2100
+ sx: {
2101
+ zIndex: $ || R ? 2 : void 0,
2102
+ display: "flex",
2103
+ " .tooltip-wrapper": {
2104
+ display: "flex",
2105
+ flex: "1 1 100%"
2106
+ }
2107
+ },
2108
+ children: [Z, q.component]
2109
+ });
2110
+ })), At = B(D((e, t) => {
2111
+ const { onSelectToggle: r, selected: o = !1, label: n, shortcut: i, tabIndex: a = 0, preventFocus: l = !1, ...s } = e;
2112
+ return M(Rt, {
2113
+ label: n,
2114
+ shortcut: i,
2115
+ children: M(It, {
2116
+ ref: t,
2117
+ outlined: !1,
2118
+ tabIndex: a,
2119
+ selected: o,
2120
+ onMouseDown: (e) => {
2121
+ l && e.preventDefault();
2122
+ },
2123
+ onClick: () => {
2124
+ r?.(!o);
2125
+ },
2126
+ ...s
2127
+ })
2128
+ });
2129
+ })), Wt = M(Y, {}), Ht = M(Y, { iconKey: "Check" }), Vt = B(D((e, r) => {
2130
+ const { children: o, selected: n = !0, outlined: i = !0, sx: a, ...l } = e, s = E(() => ({
2131
+ display: "flex",
2132
+ border: (e) => n ? `solid ${i ? e.palette.divider : "transparent"} 1px` : "solid transparent 1px",
2133
+ borderRadius: (e) => `${e.shape.borderRadius}px`,
2134
+ backgroundColor: (e) => {
2135
+ if (n) return H(e.palette.text.icon ?? e.palette.action.active, e.palette.action.selectedOpacity);
2136
+ },
2137
+ ...a
2138
+ }), [a]);
2139
+ let c = o;
2140
+ return null === c && (c = Wt), c || (c = Ht), M(t, {
2141
+ ref: r,
2142
+ sx: s,
2143
+ ...l,
2144
+ children: c
2145
+ });
2146
+ })), qt = {
2147
+ "dialog.cancel": "Cancel",
2148
+ "dialog.ok": "Ok",
2149
+ "overflow.more": "More",
2150
+ "overflow.moreDescription": "More toolbar options…",
2151
+ "scroll.edgeBottom": " Bottom: ''Ctrl+Click'' to scroll to the end",
2152
+ "scroll.edgeLeft": " Left: ''Ctrl+Click'' to scroll to the beginning",
2153
+ "scroll.edgeRight": " Right: ''Ctrl+Click'' to scroll to the end",
2154
+ "scroll.edgeTop": " Top: ''Ctrl+Click'' to scroll to the beginning",
2155
+ "shortcut.modifier.alt": "Alt",
2156
+ "shortcut.modifier.cmd": "Cmd",
2157
+ "shortcut.modifier.ctrl": "Ctrl",
2158
+ "shortcut.modifier.meta": "Meta",
2159
+ "shortcut.modifier.shift": "Shift",
2160
+ "stackTrace.causedBy": "Caused by: {cause}",
2161
+ "stackTrace.copy": "Copy stack trace",
2162
+ "stackTrace.heading": "Stack Trace",
2163
+ "stackTrace.headingFrames": "Stack Trace ({count} frames)",
2164
+ "stackTrace.log": "Log error to console",
2165
+ "stackTrace.moreFrames": "... and {count} more frames",
2166
+ "window.close": "Close"
2167
+ }, { DefaultCommandCatalogService: jt } = U, Qt = !1;
2168
+ function Ut() {
2169
+ Qt || (Qt = !0, jt.registerFromManifest("@sheetxl/utils-mui", import.meta.url, { messages: qt }));
2170
+ }
2171
+ Ut();
2172
+ var Gt = B(D((e, r) => {
2173
+ const { children: o, sx: n, ...i } = e, a = fe(), l = he(r, () => ({}), []), [s, c] = be(), d = K(null), p = K(null), [u, m] = F((e) => e + 1, 0), [h, f] = A(null), [g, x] = A(null), [b, y] = A(null), v = K(null), k = K(/* @__PURE__ */ new Map()), w = z(() => {
2174
+ k.current.clear(), x(null), y(null), m();
2175
+ }, []);
2176
+ O(() => {
2177
+ p.current = { refs: [] };
2178
+ const e = [], r = T.toArray(o);
2179
+ let n = 0;
2180
+ r.forEach((o, i) => {
2181
+ e.push(M(t, {
2182
+ sx: { display: "flex" },
2183
+ ref: (e) => {
2184
+ n++, n === r.length && m();
2185
+ const t = { current: null };
2186
+ t.current = e, p.current.refs[i] = t;
2187
+ },
2188
+ children: o
2189
+ }, i));
2190
+ }), f(e);
2191
+ }, [o, c]), O(() => {
2192
+ if (!h) return;
2193
+ const e = p.current?.refs ?? [], t = e.length;
2194
+ if (!l.current || 0 === t) return x(null), void y(null);
2195
+ const r = l.current?.getBoundingClientRect(), o = [], n = [], i = () => {
2196
+ let r = v.current;
2197
+ r ? r.disconnect() : r = v.current = new ResizeObserver((e) => {
2198
+ for (let t = 0; t < e.length; t++) {
2199
+ const r = e[t].target;
2200
+ if (!r.isConnected) continue;
2201
+ const o = k.current.get(r);
2202
+ if (void 0 !== o && Math.abs(r.getBoundingClientRect().width - o) > .5) return void w();
2203
+ }
2204
+ }), k.current.clear();
2205
+ for (let o = 0; o < t; o++) {
2206
+ const t = e[o]?.current;
2207
+ t && (k.current.set(t, t.getBoundingClientRect().width), r.observe(t));
2208
+ }
2209
+ };
2210
+ let a = 0, s = !1;
2211
+ for (let o = 0; !s && o < t; o++) {
2212
+ const t = e[o];
2213
+ if (!t) continue;
2214
+ if (!t.current) {
2215
+ s = !0;
2216
+ continue;
2217
+ }
2218
+ const n = t.current.getBoundingClientRect();
2219
+ a += n?.width, a > r.width && (s = !0);
2220
+ }
2221
+ if (!s) return i(), x(null), void y([]);
2222
+ const c = d.current?.getBoundingClientRect();
2223
+ a = 0;
2224
+ for (let i = 0; i < t; i++) {
2225
+ const t = e[i];
2226
+ let l = !1;
2227
+ if (t.current) {
2228
+ const e = t.current.getBoundingClientRect();
2229
+ a += e?.width, a < r.width - (c?.width ?? 0) && (l = !0);
2230
+ }
2231
+ l ? o.push(h[i]) : n.push(h[i]);
2232
+ }
2233
+ i(), x(o.length > 0 ? o : null), y(n.length > 0 ? n : null);
2234
+ }, [
2235
+ o,
2236
+ h,
2237
+ c,
2238
+ u
2239
+ ]), O(() => () => {
2240
+ v.current?.disconnect(), v.current = null;
2241
+ }, []);
2242
+ const C = z((e) => {
2243
+ const r = [], o = b?.length ?? 0;
2244
+ for (let e = 0; e < o; e++) {
2245
+ const t = T.toArray(b[e])[0];
2246
+ T.toArray(t.props.children?.props?.children ?? t.props.children).forEach((t, o) => {
2247
+ const n = t, i = R(n, {
2248
+ ...n.props,
2249
+ key: `overflow-${e}-${o}${n.key ?? ""}`
2250
+ });
2251
+ r.push(i);
2252
+ });
2253
+ }
2254
+ return xt({
2255
+ ...e,
2256
+ children: M(t, {
2257
+ className: "overflow-palette-popup-panel",
2258
+ sx: {
2259
+ display: "flex",
2260
+ flexDirection: "row",
2261
+ flexWrap: "wrap",
2262
+ rowGap: (e) => e.spacing(.25),
2263
+ paddingTop: (e) => e.spacing(.5),
2264
+ paddingBottom: (e) => e.spacing(.5),
2265
+ paddingLeft: (e) => e.spacing(1),
2266
+ paddingRight: (e) => e.spacing(1),
2267
+ overflow: "hidden"
2268
+ },
2269
+ children: r
2270
+ })
2271
+ });
2272
+ }, [b]);
2273
+ return S(t, {
2274
+ className: "overflow-palette",
2275
+ sx: {
2276
+ display: "flex",
2277
+ flexDirection: "row",
2278
+ flex: "1 1 100%",
2279
+ width: "100%",
2280
+ maxWidth: "100%",
2281
+ ...n
2282
+ },
2283
+ ref: ge([
2284
+ l,
2285
+ s,
2286
+ r
2287
+ ]),
2288
+ ...i,
2289
+ children: [M(t, {
2290
+ sx: {
2291
+ flexDirection: "row",
2292
+ display: "flex",
2293
+ maxWidth: "100%",
2294
+ flex: "1 1 100%",
2295
+ alignItems: "center"
2296
+ },
2297
+ children: g ?? h
2298
+ }), M(t, {
2299
+ className: "overflow-palette-popup-button",
2300
+ sx: {
2301
+ display: null !== b && 0 === b.length ? "none" : "flex",
2302
+ flex: "1 1 0"
2303
+ },
2304
+ children: M(Ot, {
2305
+ createPopupPanel: C,
2306
+ ref: d,
2307
+ createTooltip: ({ children: e }, t) => M(Rt, {
2308
+ label: a("overflow.more"),
2309
+ description: a("overflow.moreDescription"),
2310
+ disabled: t,
2311
+ children: e
2312
+ }),
2313
+ icon: M(Y, { iconKey: "MoreHorizontal" })
2314
+ })
2315
+ })]
2316
+ });
603
2317
  }));
604
- function Lt(e2) {
605
- const [t2, o2] = c(() => /* @__PURE__ */ new Map()), { showModal: r2, updateModal: i2, destroyModal: a2, hideModal: l2 } = le({ disableAutoDestroy: true });
606
- return (s2, c2, d2, p2) => new Promise((u2, m2) => {
607
- let h2 = false;
608
- void 0 !== d2?.disableAutoDestroy && (h2 = d2.disableAutoDestroy, delete (d2 = { ...d2 }).disableAutoDestroy);
609
- const f2 = { ...e2, ...d2, ...p2, onHide: () => {
610
- const e3 = t2.get(s2);
611
- p2?.onHide?.(), o2((e4) => (e4.delete(s2), e4)), l2(e3.id);
612
- }, onDone: (e3) => {
613
- const n2 = t2.get(s2);
614
- o2((e4) => (e4.delete(s2), e4)), p2?.onDone?.(e3), n2 && n2.id && !h2 && a2(n2.id);
615
- }, onShown: (e3) => {
616
- o2((t3) => {
617
- const o3 = t3.get(s2);
618
- return t3.set(s2, { ...o3, element: e3 }), t3;
619
- }), u2(e3);
620
- }, open: true }, x2 = t2.get(s2);
621
- if (x2) return i2(x2.id, f2), u2(x2.element), void (f2.autoFocus && x2.element?.focus());
622
- if (!c2) return void m2(`Invalid function for window '${s2}'`);
623
- const g2 = n.lazy(c2), b2 = r2(g2, f2, { destroyOnClose: !h2 });
624
- o2((e3) => (e3.set(s2, { id: b2.id, element: null }), e3));
625
- });
2318
+ function Xt(e) {
2319
+ const [t, r] = A(() => /* @__PURE__ */ new Map()), o = K(null);
2320
+ null === o.current && (o.current = /* @__PURE__ */ new Map());
2321
+ const { showModal: n, updateModal: i, destroyModal: a, hideModal: l } = we({ disableAutoDestroy: !0 });
2322
+ return (s, c, d, p) => new Promise((u, m) => {
2323
+ let h = !1;
2324
+ void 0 !== d?.disableAutoDestroy && (h = d.disableAutoDestroy, delete (d = { ...d }).disableAutoDestroy);
2325
+ let f = !1;
2326
+ if (void 0 !== d?.prewarm && (f = d.prewarm, delete (d = { ...d }).prewarm, f && (h = !0)), f && t.get(s)) return void u(t.get(s).element);
2327
+ const g = {
2328
+ ...e,
2329
+ ...d,
2330
+ ...p,
2331
+ onHide: () => {
2332
+ if (p?.onHide?.(), h) return;
2333
+ const e = t.get(s);
2334
+ r((e) => (e.delete(s), e)), e?.id && l(e.id);
2335
+ },
2336
+ onDone: (e) => {
2337
+ if (p?.onDone?.(e), h) return;
2338
+ const o = t.get(s);
2339
+ r((e) => (e.delete(s), e)), o?.id && a(o.id);
2340
+ },
2341
+ onShown: (e) => {
2342
+ r((t) => {
2343
+ const r = t.get(s);
2344
+ return r && t.set(s, {
2345
+ ...r,
2346
+ element: e ?? r.element
2347
+ }), t;
2348
+ }), u(e);
2349
+ },
2350
+ disableAutoDestroy: h,
2351
+ revealToken: 0,
2352
+ startHidden: f,
2353
+ open: !0
2354
+ }, x = t.get(s);
2355
+ if (x) {
2356
+ const e = (x.revealToken ?? 0) + 1;
2357
+ i(x.id, {
2358
+ ...g,
2359
+ revealToken: e
2360
+ }), r((t) => {
2361
+ const r = t.get(s);
2362
+ return r && t.set(s, {
2363
+ ...r,
2364
+ revealToken: e
2365
+ }), t;
2366
+ }), u(x.element);
2367
+ return;
2368
+ }
2369
+ if (!c) return void m(`Invalid function for window '${s}'`);
2370
+ let b = o.current.get(s);
2371
+ b || (b = I(c), o.current.set(s, b));
2372
+ const y = n(b, g, { destroyOnClose: !h });
2373
+ r((e) => (e.set(s, {
2374
+ id: y.id,
2375
+ element: null,
2376
+ revealToken: 0
2377
+ }), e)), f && u(null);
2378
+ });
2379
+ }
2380
+ Ut();
2381
+ var Yt = {
2382
+ x: 0,
2383
+ y: 0
2384
+ }, _t = B(D((e, t) => {
2385
+ const { defaultPosition: r = Yt, PaperComponent: o = f, onDragStop: n, rootSel: i = ".MuiModal-root", handleSel: a = ".draggable-title", titleSize: l, rootSize: s, ...c } = e, d = K(null), p = E(() => l?.width && l?.height && s?.width && s?.height ? {
2386
+ left: 0,
2387
+ top: 0,
2388
+ right: s.width - l.width,
2389
+ bottom: s.height - l.height
2390
+ } : null, [l, s]), [u, m] = A(null), [h, g] = A(null), x = u ?? r ?? null;
2391
+ return M(Me, {
2392
+ nodeRef: d,
2393
+ handle: a,
2394
+ cancel: "[class*=\"MuiDialogContent-root\"]",
2395
+ position: E(() => x && p ? {
2396
+ x: Math.max(0, Math.min(x.x, p.right)),
2397
+ y: Math.max(0, Math.min(x.y, p.bottom))
2398
+ } : x, [x, p]) ?? void 0,
2399
+ bounds: p ?? ".MuiModal-root",
2400
+ enableUserSelectHack: !1,
2401
+ onStop: n,
2402
+ onStart: (e, t) => {
2403
+ const r = e;
2404
+ g({
2405
+ x: (r.clientX ?? r.touches?.[0]?.clientX) - t.x,
2406
+ y: (r.clientY ?? r.touches?.[0]?.clientY) - t.y
2407
+ });
2408
+ },
2409
+ onDrag: (e, t) => {
2410
+ const r = e;
2411
+ if (!h) return;
2412
+ const o = r.clientX ?? r.touches?.[0]?.clientX, n = r.clientY ?? r.touches?.[0]?.clientY;
2413
+ m({
2414
+ x: o - h.x,
2415
+ y: n - h.y
2416
+ });
2417
+ },
2418
+ children: M(o, {
2419
+ ref: ge([d, t]),
2420
+ ...c
2421
+ })
2422
+ });
2423
+ })), Jt = {
2424
+ x: "50",
2425
+ y: "50"
2426
+ }, Zt = B(D((r, o) => {
2427
+ const n = w({
2428
+ props: r,
2429
+ name: "MuiDialog"
2430
+ }), i = k(), a = fe(), s = {
2431
+ enter: .66 * i.transitions.duration.enteringScreen,
2432
+ exit: .66 * i.transitions.duration.leavingScreen
2433
+ }, { title: p = "SheetXL", onCancel: u, onDone: m, onShow: h, onShown: g, onHide: x, onClose: b, open: v, autoFocusSel: C, children: T, transitionDuration: P = s, TransitionProps: R, slots: D = j.EmptyArray, slotProps: $ = j.EmptyArray, sx: I, className: B, onMouseDown: z, initialPosition: E = Jt, isModal: F = !1, suspendModal: V = !1, restoreFocus: q = !0, disableAutoDestroy: Q = !1, revealToken: U, startHidden: G = !1, ...X } = n;
2434
+ let _ = D.transition ?? c;
2435
+ const J = D.backdrop ?? e, Z = D.paper ?? f;
2436
+ let te = $.transition;
2437
+ R && (te = {
2438
+ ...R,
2439
+ ...te
2440
+ });
2441
+ const re = $.backdrop, oe = $.paper, [ne, ae] = A(null), [se, ce] = A(!1), [de, pe] = A(!1), xe = K(null), [ye, ve] = be(), ke = K(null), we = K(null), [Me, Se] = be(), Te = K(null), Pe = L();
2442
+ O(() => {
2443
+ ne && !G && ce(!!v);
2444
+ }, [
2445
+ v,
2446
+ ne,
2447
+ G
2448
+ ]);
2449
+ const Re = le(() => {
2450
+ u?.(), ce(!1);
2451
+ }, [u]);
2452
+ O(() => {
2453
+ if (ne) return;
2454
+ const e = ke.current, t = Te.current;
2455
+ if (!e || !t) return;
2456
+ const r = e.getBoundingClientRect(), o = t.getBoundingClientRect();
2457
+ if (0 === r.width && 0 === r.height || 0 === o.width && 0 === o.height) return;
2458
+ const n = r.height - o.height, i = r.width - o.width;
2459
+ let a = .5 * i, l = .5 * n;
2460
+ "number" == typeof E?.x ? a = E.x : "string" == typeof E?.x && (a = i * (parseFloat(E.x) / 100)), "number" == typeof E?.y ? l = E.y : "string" == typeof E?.y && (l = n * (parseFloat(E.y) / 100)), ae({
2461
+ x: a,
2462
+ y: l
2463
+ });
2464
+ });
2465
+ const [De, $e] = A(!1), [Ie, Be] = A(null), [ze, Ne] = A(null), Le = le((e) => {
2466
+ if (Ie) return Ie.focus(e), !0;
2467
+ if (C) {
2468
+ const t = we.current?.querySelectorAll?.(C);
2469
+ if (t && t.length > 0) return t[0]?.focus?.(e), !0;
2470
+ }
2471
+ return we.current?.focus?.(e), !1;
2472
+ }, [Ie, C]), Oe = he(o, () => ({ focus: (e) => {
2473
+ Le(e);
2474
+ } }), []), Ee = K(U);
2475
+ N(() => {
2476
+ U !== Ee.current && (Ee.current = U, ce(!0));
2477
+ }, [U]);
2478
+ const Fe = {
2479
+ ...te,
2480
+ onExited: (e) => {
2481
+ m?.(null), Q || te?.onExited?.(e);
2482
+ },
2483
+ onExit: (e) => {
2484
+ const t = ze, r = "function" == typeof q ? q() : q;
2485
+ t && !1 !== r && requestAnimationFrame(() => {
2486
+ Oe.current?.contains(document.activeElement) && t.focus();
2487
+ }), x?.(), pe(!1), te?.onExit?.(e);
2488
+ },
2489
+ onEntered: (e, t) => {
2490
+ h?.(), te?.onEntered?.(e, t);
2491
+ },
2492
+ onEntering: (e, t) => {
2493
+ pe(!0), g?.(Oe.current);
2494
+ }
2495
+ };
2496
+ N(() => {
2497
+ de && Le();
2498
+ }, [de]);
2499
+ let Ke = M(y, {
2500
+ open: de,
2501
+ disableAutoFocus: !0,
2502
+ disableEnforceFocus: !De,
2503
+ disableRestoreFocus: !0 !== q,
2504
+ children: M(_, {
2505
+ in: se,
2506
+ timeout: P,
2507
+ role: "presentation",
2508
+ ...Fe,
2509
+ children: M(t, {
2510
+ className: "MuiDialog-container",
2511
+ ref: we,
2512
+ tabIndex: 0,
2513
+ sx: {
2514
+ outline: "none",
2515
+ position: "relative"
2516
+ },
2517
+ onKeyDown: (e) => {
2518
+ e.which === ee.Escape && (Re(), xe.current?.start(e, { center: !1 }), setTimeout(() => xe.current?.stop(e), 180)), e.stopPropagation();
2519
+ },
2520
+ children: S(_t, {
2521
+ ref: ge([Te, o]),
2522
+ className: W({ "Mui-focusVisible": De }, B, "draggable"),
2523
+ sx: {
2524
+ "& *": (e) => mt(e),
2525
+ pointerEvents: "auto",
2526
+ userSelect: "none",
2527
+ backgroundColor: "var(--sxl-color-elevated, var(--sxl-color-base-100))",
2528
+ border: "1px solid var(--sxl-color-elevated-border, transparent)",
2529
+ "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e) => `solid ${H(e.palette.text?.primary, .2)} 1px` },
2530
+ "&.Mui-focusVisible": { outline: (e) => `solid ${H(e.palette.text?.primary, .2)} 1px` },
2531
+ position: "absolute",
2532
+ maxWidth: "100%",
2533
+ ...I
2534
+ },
2535
+ defaultPosition: ne,
2536
+ titleSize: Se,
2537
+ rootSize: ve,
2538
+ PaperComponent: Z,
2539
+ ...X,
2540
+ ...oe,
2541
+ children: [p ? M(l, {
2542
+ className: W({ "Mui-selected": De }, "draggable-title"),
2543
+ sx: {
2544
+ cursor: "move",
2545
+ display: "flex",
2546
+ color: (e) => e.palette.text.secondary,
2547
+ boxSizing: "border-box",
2548
+ padding: "0 0",
2549
+ transitionProperty: "opacity",
2550
+ transitionDuration: (e) => `${e.transitions.duration.shortest}ms`,
2551
+ opacity: .7,
2552
+ "&.Mui-selected": {
2553
+ opacity: 1,
2554
+ transitionDuration: (e) => e.transitions.duration.shortest / 2 + "ms"
2555
+ },
2556
+ backgroundColor: (e) => H(e.palette.action.hover, .03)
2557
+ },
2558
+ ref: Me,
2559
+ children: S(t, {
2560
+ sx: {
2561
+ display: "flex",
2562
+ flex: "1 1 10%",
2563
+ flexDirection: "row",
2564
+ alignItems: "center",
2565
+ marginTop: (e) => e.spacing(1),
2566
+ marginLeft: (e) => e.spacing(1),
2567
+ marginRight: (e) => e.spacing(1)
2568
+ },
2569
+ children: [M(t, {
2570
+ sx: {
2571
+ flex: "1 1 100%",
2572
+ paddingLeft: (e) => e.spacing(1)
2573
+ },
2574
+ children: p
2575
+ }), M(Rt, {
2576
+ label: a("window.close"),
2577
+ children: M(d, {
2578
+ "aria-label": "close",
2579
+ sx: { color: (e) => e.palette.text.icon ?? e.palette.action.active },
2580
+ touchRippleRef: xe,
2581
+ onPointerDown: (e) => {
2582
+ xe.current?.start(e, { center: !1 }), e.stopPropagation(), e.preventDefault();
2583
+ },
2584
+ onPointerUp: Re,
2585
+ children: M(Y, { iconKey: "Close" })
2586
+ })
2587
+ })]
2588
+ })
2589
+ }) : null, T]
2590
+ })
2591
+ })
2592
+ })
2593
+ }), Ae = null;
2594
+ F && !V && (Ae = M(J, {
2595
+ ...re,
2596
+ open: se,
2597
+ onMouseDown: (e) => {
2598
+ Re(), re?.onMouseDown?.(e);
2599
+ },
2600
+ onClick: (e) => {
2601
+ b?.(e, "backdropClick"), re?.onClick?.(e);
2602
+ },
2603
+ sx: {
2604
+ pointerEvents: "auto",
2605
+ ...re?.sx
2606
+ }
2607
+ }));
2608
+ const { getPortalContainer: We } = me(), { className: He, attrs: Ve } = ie(ue()?.themeScope);
2609
+ return Ce(S(t, {
2610
+ className: W("MuiModal-root", He),
2611
+ ...Ve,
2612
+ sx: {
2613
+ position: "fixed",
2614
+ zIndex: "1300",
2615
+ right: "0",
2616
+ bottom: "0",
2617
+ top: "0",
2618
+ left: "0",
2619
+ outline: "0",
2620
+ display: "block",
2621
+ pointerEvents: "none"
2622
+ },
2623
+ ref: ge([
2624
+ Oe,
2625
+ ye,
2626
+ ke
2627
+ ]),
2628
+ onPointerDown: (e) => {
2629
+ De && (e.target === we.current || e.target.tabIndex < 0) && we.current?.contains(document.activeElement);
2630
+ },
2631
+ onContextMenu: (e) => {
2632
+ e.isPropagationStopped() || e.preventDefault();
2633
+ },
2634
+ onFocus: (e) => {
2635
+ !De && (e.target === we.current || e.target.tabIndex < 0) && setTimeout(() => {
2636
+ Le();
2637
+ }, 100), $e(!0), we.current?.contains(e.target) && e.target !== we.current && Be(e.target), e.relatedTarget && !ze && Ne(e.relatedTarget);
2638
+ },
2639
+ onBlur: (e) => {
2640
+ Oe?.current?.contains(e.relatedTarget) || (Ne(null), $e(!1));
2641
+ },
2642
+ children: [Ae, Ke]
2643
+ }), We(), Pe);
2644
+ })), er = ["Ok", "Cancel"], tr = (e) => "string" == typeof e ? e : e.id ?? e, rr = (e, t) => void 0 !== t && tr(e) === tr(t), or = (e) => "string" != typeof e && ("function" == typeof e.disabled ? e.disabled() : !0 === e.disabled), nr = B(D((e, o) => {
2645
+ const { description: l, icon: s, onCancel: c, onOption: d, onDone: p, onValidateOption: u, options: m = er, autoFocusSel: h = ".defaultOption", defaultOption: f = m[0], cancelOption: g = "Cancel", autoFocus: x, children: y, ...v } = e, k = Pe({ shouldUseNativeValidation: !1 }), { handleSubmit: w, formState: C } = k, T = K(null), R = K(null), D = fe(), $ = le((e) => "string" != typeof e ? "function" == typeof e.label ? e.label() : e.label : "Ok" === e ? D("dialog.ok") : "Cancel" === e ? D("dialog.cancel") : e, [D]), I = K(null), [B, z] = A(null), N = le(async (e) => {
2646
+ const t = tr(e);
2647
+ if (null !== B) return;
2648
+ if (or(e)) return;
2649
+ const r = rr(e, g);
2650
+ let o;
2651
+ try {
2652
+ if (z(t), o = !!r || (await Promise.resolve(u?.(t)) ?? !0), !0 !== o) return;
2653
+ await Promise.resolve(d?.(t, r, rr(e, f))), p?.(t);
2654
+ } catch (e) {} finally {
2655
+ z(null);
2656
+ }
2657
+ }, [
2658
+ d,
2659
+ p,
2660
+ u,
2661
+ g,
2662
+ f,
2663
+ B
2664
+ ]), L = le((e, t) => {
2665
+ setTimeout(() => {
2666
+ N(f);
2667
+ }, 180);
2668
+ }, [N, f]), O = le(() => {
2669
+ d?.(tr(g), !0, !1), c?.(), p?.(null);
2670
+ }, [
2671
+ d,
2672
+ g,
2673
+ c,
2674
+ p
2675
+ ]), F = C && (Object.keys(C.errors).length > 0 || C.disabled || C.isSubmitting), W = le((e, t, o) => {
2676
+ const i = rr(e, g), a = {
2677
+ className: t ? "defaultOption" : "action",
2678
+ type: t ? "submit" : "button",
2679
+ style: { minWidth: "75px" },
2680
+ onClick: () => {
2681
+ i ? O() : t || N(e);
2682
+ }
2683
+ }, l = "string" != typeof e ? e.renderButton : void 0;
2684
+ if (l) return M(P, { children: l(a, t) }, `action:${o}`);
2685
+ const s = null !== B && rr(e, B), c = {
2686
+ className: t ? "defaultOption" : "action",
2687
+ variant: t ? "contained" : "outlined",
2688
+ size: "small",
2689
+ disabled: !i && (F || or(e)) || null !== B && !s,
2690
+ color: "primary",
2691
+ ...a
2692
+ };
2693
+ if (t || i) {
2694
+ const e = t ? T : R;
2695
+ c.touchRippleRef = e, c.onPointerDown = (t) => {
2696
+ e.current?.start(t, { center: !1 }), t.stopPropagation(), t.preventDefault();
2697
+ };
2698
+ }
2699
+ return S(r, {
2700
+ ...c,
2701
+ children: [M("div", {
2702
+ style: { visibility: s ? "hidden" : void 0 },
2703
+ children: $(e)
2704
+ }), u && !i ? M(n, {
2705
+ size: 16,
2706
+ color: "inherit",
2707
+ style: { opacity: s ? 1 : 0 },
2708
+ sx: {
2709
+ position: "absolute",
2710
+ top: "calc(50% - 8px)",
2711
+ left: "calc(50% - 8px)",
2712
+ zIndex: 1,
2713
+ pointerEvents: "none",
2714
+ transition: "opacity 120ms"
2715
+ }
2716
+ }) : null]
2717
+ }, `action:${o}`);
2718
+ }, [
2719
+ m,
2720
+ f,
2721
+ g,
2722
+ C,
2723
+ $,
2724
+ B
2725
+ ]), V = E(() => {
2726
+ const e = [];
2727
+ for (let t = 0; t < m.length; t++) {
2728
+ const r = m[t], o = void 0 !== f ? rr(r, f) : 0 === t;
2729
+ e.push(W(r, o, t));
2730
+ }
2731
+ return e;
2732
+ }, [
2733
+ m,
2734
+ f,
2735
+ C,
2736
+ D,
2737
+ B
2738
+ ]);
2739
+ return M(Zt, {
2740
+ onCancel: O,
2741
+ initialPosition: { y: "touch" === Se ? "15" : "35" },
2742
+ onDone: p,
2743
+ autoFocusSel: h,
2744
+ isModal: !0,
2745
+ ref: o,
2746
+ ...v,
2747
+ children: M(Te, {
2748
+ ...k,
2749
+ children: S("form", {
2750
+ ref: I,
2751
+ onSubmit: w(L),
2752
+ children: [M(a, {
2753
+ dividers: !0,
2754
+ onKeyDown: (e) => {
2755
+ if (e.isDefaultPrevented()) return;
2756
+ e.stopPropagation();
2757
+ let t = null, r = null;
2758
+ const o = e.which === ee.Escape && g;
2759
+ if (o) {
2760
+ if (null !== B) return;
2761
+ t = g, r = R;
2762
+ } else {
2763
+ if (F || null !== B) return;
2764
+ e.which === ee.Enter && (t = f ?? m[0], r = T);
2765
+ }
2766
+ t && (r?.current?.start(e, { center: !1 }), setTimeout(() => {
2767
+ r?.current?.stop(e), o && O();
2768
+ }, 180));
2769
+ },
2770
+ children: S(t, {
2771
+ sx: {
2772
+ display: "flex",
2773
+ flexDirection: "column",
2774
+ whiteSpace: "pre-wrap",
2775
+ rowGap: (e) => e.spacing(s || l ? 1.5 : 0)
2776
+ },
2777
+ children: [S(t, {
2778
+ sx: {
2779
+ display: "flex",
2780
+ flexDirection: "column"
2781
+ },
2782
+ children: [s, M(b, { children: l })]
2783
+ }), y]
2784
+ })
2785
+ }), M(i, {
2786
+ sx: {
2787
+ paddingTop: (e) => e.spacing(1),
2788
+ paddingBottom: (e) => e.spacing(1),
2789
+ paddingLeft: (e) => e.spacing(1),
2790
+ paddingRight: (e) => e.spacing(1),
2791
+ backgroundColor: (e) => H(e.palette.action.hover, .03)
2792
+ },
2793
+ children: V
2794
+ })]
2795
+ })
2796
+ })
2797
+ });
2798
+ })), ir = (e) => {
2799
+ const { showModal: t } = we();
2800
+ return (r) => new Promise((o) => {
2801
+ const n = t(nr, {
2802
+ ...e,
2803
+ ...r,
2804
+ onOption(e, t, n) {
2805
+ r?.onOption?.(e, t, n), o(e);
2806
+ },
2807
+ onDone: () => {
2808
+ r?.onDone?.(), n.hide();
2809
+ }
2810
+ });
2811
+ });
2812
+ }, ar = I(() => import("./C2bOUbQGN6BujoBn.mjs")), lr = (e) => {
2813
+ const { showModal: t } = we();
2814
+ return (r) => {
2815
+ const { defaultOption: o = r.options?.[0], cancelOption: n = "Cancel", ...i } = r;
2816
+ return new Promise((r) => {
2817
+ const a = t(ar, {
2818
+ ...e,
2819
+ defaultOption: o,
2820
+ cancelOption: n,
2821
+ ...i,
2822
+ onOption(e, t, o) {
2823
+ i?.onOption?.(e, t, o), r({
2824
+ input: "",
2825
+ option: e
2826
+ });
2827
+ },
2828
+ onInput(e, t) {
2829
+ i?.onInput?.(e, t), r({
2830
+ input: e,
2831
+ option: t
2832
+ });
2833
+ },
2834
+ onDone: () => {
2835
+ i?.onDone?.(), a.hide();
2836
+ }
2837
+ });
2838
+ });
2839
+ };
2840
+ }, sr = B(D((e, t) => {
2841
+ const { commandKey: r, command: o, disabled: n, shortcut: i, children: a, ...l } = e, [s] = ce(r ?? []), c = o ?? s, d = c?.getShortcut();
2842
+ return M(Rt, {
2843
+ ref: t,
2844
+ label: void 0 !== n ? c?.getLabel() : "",
2845
+ shortcut: void 0 !== i ? i : Array.isArray(d) ? d[0] : d,
2846
+ description: c?.getDescription(),
2847
+ disabled: n,
2848
+ componentDisabled: c?.disabled(),
2849
+ ...l,
2850
+ children: M("div", {
2851
+ style: {
2852
+ display: "flex",
2853
+ flex: "1 1 0%"
2854
+ },
2855
+ children: a
2856
+ })
2857
+ });
2858
+ })), cr = Re;
2859
+ function dr() {
2860
+ const e = K(null);
2861
+ return {
2862
+ ripple: E(() => M(cr, {
2863
+ ref: e,
2864
+ center: !1
2865
+ }), []),
2866
+ trigger: z(() => {
2867
+ e.current?.start(void 0, { center: !0 }), setTimeout(() => e.current?.stop(), 180);
2868
+ }, [])
2869
+ };
626
2870
  }
627
- const Ft = { x: 0, y: 0 }, At = r(i((t2, o2) => {
628
- const { defaultPosition: n2 = Ft, PaperComponent: r2 = w, onDragStop: i2, rootSel: d2 = ".MuiModal-root", handleSel: p2 = ".draggable-title", titleSize: m2, rootSize: h2, ...f2 } = t2, x2 = l(null), g2 = a(() => m2 && h2 ? { left: 0, top: 0, right: h2.width - m2.width, bottom: h2.height - m2.height } : null, [m2, h2]), [b2, y2] = c(null), [v2, k2] = c(null), [C2, M2] = c(null);
629
- return u(() => {
630
- !b2 && n2 && y2(n2 ?? Ft);
631
- }, [n2]), s(() => {
632
- g2 && b2 && k2({ x: Math.max(0, Math.min(b2.x, g2.right)), y: Math.max(0, Math.min(b2.y, g2.bottom)) });
633
- }, [b2, g2]), e(de, { nodeRef: x2, handle: p2, cancel: '[class*="MuiDialogContent-root"]', position: v2, bounds: g2 ?? ".MuiModal-root", onStop: i2, onStart: (e2, t3) => {
634
- const o3 = e2;
635
- M2({ x: (o3.clientX ?? o3.touches?.[0]?.clientX) - t3.x, y: (o3.clientY ?? o3.touches?.[0]?.clientY) - t3.y });
636
- }, onDrag: (e2, t3) => {
637
- const o3 = e2, n3 = o3.clientX ?? o3.touches?.[0]?.clientX, r3 = o3.clientY ?? o3.touches?.[0]?.clientY;
638
- y2({ x: n3 - C2.x, y: r3 - C2.y });
639
- }, children: e(r2, { ref: ne([x2, o2]), ...f2 }) });
640
- })), Ht = { x: "50", y: "50" }, Wt = r(i((o2, n2) => {
641
- const r2 = ee({ props: o2, name: "MuiDialog" }), i2 = Y(), a2 = { enter: 0.66 * i2.transitions.duration.enteringScreen, exit: 0.66 * i2.transitions.duration.leavingScreen }, { title: d2 = "SheetXL", key: p2 = "draggable-window", onCancel: u2, onDone: m2, onShow: x2, onShown: g2, onHide: y2, onClose: k2, open: C2, autoFocusSel: M2, children: S2, transitionDuration: R2 = a2, TransitionProps: P2, slots: D2 = F.EmptyArray, slotProps: $2 = F.EmptyArray, sx: O2, className: I2, onMouseDown: N2, initialPosition: B2 = Ht, isModal: L2 = false, ...A2 } = r2;
642
- let H2 = D2.transition ?? E;
643
- const _2 = D2.backdrop ?? T, q2 = D2.paper ?? w;
644
- let U2 = $2.transition;
645
- P2 && (U2 = { ...P2, ...U2 });
646
- const G2 = $2.backdrop, X2 = $2.paper, J2 = l(null), [Z2, te2] = c(null), [oe2, re2] = c(false), [ae2, le2] = c(false), de2 = l(null), [pe2, ue2] = ie(), me2 = l(null), [he2, fe2] = ie(), xe2 = l(null);
647
- s(() => {
648
- Z2 && re2(C2);
649
- }, [C2, Z2]);
650
- const ge2 = K(() => {
651
- u2?.(), re2(false);
652
- }, [u2]);
653
- s(() => {
654
- if (0 === ue2.width && 0 === ue2.height || Z2) return;
655
- const e2 = xe2.current?.getBoundingClientRect(), t2 = ue2.height - e2.height, o3 = ue2.width - e2.width;
656
- let n3 = 0.5 * o3, r3 = 0.5 * t2;
657
- "number" == typeof B2?.x ? n3 = B2.x : "string" == typeof B2?.x && (n3 = o3 * (parseFloat(B2.x) / 100)), "number" == typeof B2?.y ? r3 = B2.y : "string" == typeof B2?.y && (r3 = t2 * (parseFloat(B2.y) / 100)), te2({ x: n3, y: r3 });
658
- }, [ue2, fe2]);
659
- const [be2, ye2] = c(false), [ve2, ke2] = c(null), [we2, Ce2] = c(null), Me2 = K((e2) => {
660
- if (ve2) return ve2.focus(e2), true;
661
- if (M2) {
662
- const t2 = me2.current?.querySelectorAll?.(M2);
663
- if (t2 && t2.length > 0) return t2[0]?.focus?.(e2), true;
664
- }
665
- return me2.current?.focus?.(e2), false;
666
- }, [ve2, M2]), Se2 = Q(n2, () => ({ focus: (e2) => {
667
- Me2(e2);
668
- } }), []), Re2 = { ...U2, onExited: (e2) => {
669
- m2?.(null), U2?.onExited?.(e2);
670
- }, onExit: (e2) => {
671
- const t2 = we2;
672
- t2 && requestAnimationFrame(() => {
673
- Se2.current?.contains(document.activeElement) && t2.focus();
674
- }), y2?.(), le2(false), U2?.onExit?.(e2);
675
- }, onEntered: (e2, t2) => {
676
- x2?.(), U2?.onEntered?.(e2, t2);
677
- }, onEntering: (e2, t2) => {
678
- le2(true), g2?.(Se2.current);
679
- } };
680
- s(() => {
681
- ae2 && Me2();
682
- }, [ae2]);
683
- let Pe2 = e(ce, { focusTrapOptions: { escapeDeactivates: false, allowOutsideClick: true, initialFocus: false }, ref: J2, active: ae2, children: e(H2, { in: oe2, timeout: R2, role: "presentation", ...Re2, children: e(v, { className: "MuiDialog-container", ref: me2, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: (e2) => {
684
- e2.which === j.Escape && (ge2(), de2.current?.start(e2, { center: false }), setTimeout(() => de2.current?.stop(e2), 180)), e2.stopPropagation();
685
- }, children: t(At, { ref: ne([xe2, n2]), className: h({ "Mui-focusVisible": be2 }, I2, "draggable"), sx: { "& *": (e2) => Xe(e2), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...O2 }, defaultPosition: Z2, titleSize: fe2, rootSize: ue2, PaperComponent: q2, ...A2, ...X2, children: [d2 ? e(z, { className: h({ "Mui-selected": be2 }, "draggable-title"), sx: { cursor: "move", display: "flex", color: (e2) => e2.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e2) => `${e2.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e2) => e2.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e2) => f(e2.palette.action.hover, 0.03) }, ref: he2, children: t(v, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(1), marginLeft: (e2) => e2.spacing(1), marginRight: (e2) => e2.spacing(1) }, children: [e(v, { sx: { flex: "1 1 100%", paddingLeft: (e2) => e2.spacing(1) }, children: d2 }), e(wt, { label: "Close", children: e(b, { "aria-label": "close", sx: { color: (e2) => e2.palette.text.icon ?? e2.palette.action.active }, touchRippleRef: de2, onPointerDown: (e2) => {
686
- de2.current?.start(e2, { center: false }), e2.stopPropagation(), e2.preventDefault();
687
- }, onPointerUp: ge2, children: e(W, { iconKey: "Close" }) }) })] }) }) : null, S2] }) }) }) }), De2 = null;
688
- L2 && (De2 = e(_2, { ...G2, open: oe2, onMouseDown: (e2) => {
689
- ge2(), G2?.onMouseDown?.(e2);
690
- }, onClick: (e2) => {
691
- k2?.(e2, "backdropClick"), G2?.onClick?.(e2);
692
- }, sx: { pointerEvents: "auto", ...G2?.sx } }));
693
- const { getPortalContainer: Ee2 } = V();
694
- return se(t(v, { className: "MuiModal-root", sx: { position: "fixed", zIndex: "1300", right: "0", bottom: "0", top: "0", left: "0", outline: "0", display: "block", pointerEvents: "none" }, ref: ne([Se2, pe2]), onPointerDown: (e2) => {
695
- be2 && (e2.target === me2.current || e2.target.tabIndex < 0) && me2.current?.contains(document.activeElement);
696
- }, onContextMenu: (e2) => {
697
- e2.isPropagationStopped() || e2.preventDefault();
698
- }, onFocus: (e2) => {
699
- !be2 && (e2.target === me2.current || e2.target.tabIndex < 0) && setTimeout(() => {
700
- Me2();
701
- }, 100), J2.current?.focusTrap?.unpause(), ye2(true), me2.current?.contains(e2.target) && e2.target !== me2.current && ke2(e2.target), e2.relatedTarget && !we2 && Ce2(e2.relatedTarget);
702
- }, onBlur: (e2) => {
703
- Se2?.current?.contains(e2.relatedTarget) || (Ce2(null), J2.current?.focusTrap?.pause(), ye2(false));
704
- }, children: [De2, Pe2] }), Ee2(), p2 + "");
705
- })), Kt = ["Ok", "Cancel"], Vt = r(i((o2, n2) => {
706
- const { description: r2, icon: i2, onCancel: s2, onOption: c2, onDone: d2, onValidateOption: p2, createOptionsButton: u2, options: m2 = Kt, autoFocusSel: h2 = ".defaultOption", defaultOption: x2 = m2[0], cancelOption: g2 = "Cancel", autoFocus: b2, children: y2, ...w2 } = o2, C2 = ue({ shouldUseNativeValidation: false }), { handleSubmit: M2, formState: S2 } = C2, R2 = l(null), P2 = l(null), D2 = l(null), E2 = K(async (e2) => {
707
- let t2;
708
- try {
709
- if (t2 = await Promise.resolve(p2?.(e2)) ?? true, true !== t2) return;
710
- await Promise.resolve(c2?.(e2, e2 === g2, e2 === x2)), d2?.(e2);
711
- } catch (e3) {
712
- }
713
- }, [c2, d2, p2, g2, x2]), T2 = K((e2, t2) => {
714
- setTimeout(() => {
715
- E2(x2);
716
- }, 180);
717
- }, [E2]), z2 = K(() => {
718
- c2?.(g2, true, false), s2?.(), d2?.(null);
719
- }, [c2, g2, s2, d2]), N2 = S2 && (Object.keys(S2.errors).length > 0 || S2.disabled || S2.isSubmitted), B2 = K((t2, o3) => {
720
- const n3 = t2 === g2, r3 = { className: o3 ? "defaultOption" : "action", type: o3 ? "submit" : "button", style: { minWidth: "75px" }, onClick: () => {
721
- n3 ? z2() : o3 || E2(t2);
722
- } };
723
- if (u2) return u2(t2, r3, o3);
724
- const i3 = { className: o3 ? "defaultOption" : "action", variant: o3 ? "contained" : "outlined", size: "small", disabled: !n3 && N2, color: "primary", ...r3 };
725
- if (o3 || n3) {
726
- const e2 = o3 ? R2 : P2;
727
- i3.touchRippleRef = e2, i3.onPointerDown = (t3) => {
728
- e2.current?.start(t3, { center: false }), t3.stopPropagation(), t3.preventDefault();
729
- };
730
- }
731
- return e($, { ...i3, children: e("div", { style: { paddingTop: "3px" }, children: t2 }) }, `action:${t2}`);
732
- }, [m2, x2, g2, u2, S2]), L2 = a(() => {
733
- const e2 = [];
734
- for (let t2 = 0; t2 < m2.length; t2++) {
735
- const o3 = m2[t2], n3 = x2 ? o3 === x2 : 0 === t2;
736
- e2.push(B2(o3, n3));
737
- }
738
- return e2;
739
- }, [m2, x2, S2]);
740
- return e(Wt, { onCancel: z2, initialPosition: { y: "touch" === pe ? "15" : "35" }, onDone: d2, autoFocusSel: h2, isModal: true, ref: n2, ...w2, children: e(me, { ...C2, children: t("form", { ref: D2, onSubmit: M2(T2), children: [e(O, { dividers: true, onKeyDown: (e2) => {
741
- if (e2.isDefaultPrevented()) return;
742
- e2.stopPropagation();
743
- let t2 = null, o3 = null;
744
- const n3 = e2.which === j.Escape && g2;
745
- if (n3) t2 = g2, o3 = P2;
746
- else {
747
- if (N2) return;
748
- e2.which === j.Enter && (t2 = x2 ?? m2[0], o3 = R2);
749
- }
750
- t2 && (o3.current?.start(e2, { center: false }), setTimeout(() => {
751
- o3.current?.stop(e2), n3 && E2(t2);
752
- }, 180));
753
- }, children: t(v, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (e2) => e2.spacing(i2 || r2 ? 1.5 : 0) }, children: [t(v, { sx: { display: "flex", flexDirection: "column" }, children: [i2, e(k, { children: r2 })] }), y2] }) }), e(I, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(1), paddingLeft: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1), backgroundColor: (e2) => f(e2.palette.action.hover, 0.03) }, children: L2 })] }) }) });
754
- })), jt = Object.freeze(Object.defineProperty({ __proto__: null, OptionsDialog: Vt, default: Vt }, Symbol.toStringTag, { value: "Module" })), _t = n.lazy(() => Promise.resolve().then(() => jt)), qt = (e2) => {
755
- const { showModal: t2 } = le();
756
- return (o2) => new Promise((n2) => {
757
- const r2 = t2(_t, { ...e2, ...o2, onOption(e3) {
758
- o2?.onOption?.(e3, e3 === o2.cancelOption, e3 === o2.defaultOption), n2(e3);
759
- }, onDone: () => {
760
- o2?.onDone?.(), r2.hide();
761
- } });
762
- });
763
- }, Qt = n.lazy(() => import("./B5nodPb2Wtops82M.mjs")), Ut = (e2) => {
764
- const { showModal: t2 } = le();
765
- return (o2) => {
766
- const { defaultOption: n2 = o2.options?.[0], cancelOption: r2 = "Cancel", ...i2 } = o2;
767
- return new Promise((o3) => {
768
- const a2 = t2(Qt, { ...e2, defaultOption: n2, cancelOption: r2, ...i2, onOption(e3) {
769
- i2?.onOption?.(e3, e3 === r2, e3 === n2), o3({ input: "", option: e3 });
770
- }, onInput(e3, t3) {
771
- i2?.onInput?.(e3, t3), o3({ input: e3, option: t3 });
772
- }, onDone: () => {
773
- i2?.onDone?.(), a2.hide();
774
- } });
775
- });
776
- };
777
- }, Gt = r(i((t2, o2) => {
778
- const { command: n2, disabled: r2 = false, shortcut: i2, children: a2, ...l2 } = t2;
779
- return U(n2), e(wt, { ref: o2, label: void 0 !== r2 ? n2?.getLabel() : "", shortcut: void 0 !== i2 ? i2 : Array.isArray(n2?.getShortcut()) ? n2?.getShortcut()[0] : n2?.getShortcut(), description: n2?.getDescription(), disabled: r2, chips: n2?.getTags(), componentDisabled: n2?.disabled(), ...l2, children: e("div", { style: { display: "flex", flex: "1 1 0%" }, children: a2 }) });
780
- })), Xt = e(W, {}), Yt = r(i((t2, o2) => {
781
- const { command: n2, commandHook: r2, scope: i2, context: s2, icon: c2, label: d2, disabled: u2 = false, variant: m2 = G.Toolbar, shortcut: h2, commandState: f2, propsTooltip: x2, ...g2 } = t2, b2 = l(null), y2 = l(false), v2 = a(() => {
782
- const e2 = { onExecute(e3, t3) {
783
- r2?.onExecute?.(e3, t3), y2.current || (b2.current?.start({ center: false }), setTimeout(() => b2.current?.stop({}), 180)), y2.current = false;
784
- }, onError(e3, t3, o3) {
785
- r2?.onError(e3, t3, o3);
786
- } };
787
- return r2?.beforeExecute && (e2.beforeExecute = r2.beforeExecute), e2;
788
- }, [r2]), k2 = U(n2, v2), w2 = p((e2) => {
789
- 0 === e2.button && e2.preventDefault();
790
- }, []), C2 = p((e2) => {
791
- 0 === e2.button && n2?.execute(f2, r2);
792
- }, [k2, r2, f2]), M2 = p((e2) => {
793
- e2.keyCode !== j.Enter && e2.keyCode !== j.Space || n2?.execute(f2, r2);
794
- }, [k2, r2, f2]), S2 = a(() => {
795
- if (c2) return "function" == typeof c2 ? c2(n2) : c2;
796
- let t3 = n2?.getIcon(s2);
797
- return t3 ? ("string" == typeof t3 && (t3 = e(W, { iconKey: t3 })), t3) : m2 === G.Toolbar || n2?.getState() ? void 0 : Xt;
798
- }, [k2, c2]), R2 = a(() => ({ tabIndex: 0, ref: o2, selected: n2?.getState(), icon: m2 === G.Toolbar ? S2 : e(Bt, { selected: n2?.getState() ?? false, children: S2 }), touchRippleRef: b2, disabled: u2 || !n2 || n2.disabled(), onMouseDown: w2, onMouseUp: C2, onKeyDown: M2 }), [k2, r2, u2, S2]);
799
- let P2;
800
- return P2 = m2 === G.Menuitem ? e(Dt, { ...g2, chips: n2?.getTags(), ...R2, children: d2 ?? n2?.getLabel(i2, s2) }) : e(St, { ...g2, ...R2 }), d2 || n2?.getLabel() ? ((n2.disabled() || u2) && (P2 = e("div", { children: P2 })), P2 = e(Gt, { command: n2, placement: m2 === G.Toolbar ? "bottom-start" : "right-start", shortcut: h2, ...x2, children: P2 }), P2) : P2;
2871
+ var pr = M(Y, {}), ur = B(D((e, t) => {
2872
+ const { commandKey: r, command: o, groupKey: n, icon: i, label: a, showLabel: l = !1, disabled: s, variant: c = G.Toolbar, shortcut: d, commandState: p, propsTooltip: u, ...m } = e, { ripple: h, trigger: f } = dr(), g = E(() => ({ onExecute() {
2873
+ f();
2874
+ } }), [f]), [x] = ce(r ?? [], g), b = o ?? x, y = z((e) => {
2875
+ 0 === e.button && e.preventDefault();
2876
+ }, []), v = z(async (e) => {
2877
+ 0 === e.button && b && await b.execute(p);
2878
+ }, [b, p]), k = z((e) => {
2879
+ e.keyCode !== ee.Enter && e.keyCode !== ee.Space || b?.execute(p);
2880
+ }, [b, p]), w = E(() => {
2881
+ if (null === i) return pr;
2882
+ let e;
2883
+ return e = "function" == typeof i ? b ? i(b) : void 0 : i, e || (e = b?.getIcon(n)), e ? ("string" == typeof e && (e = M(Y, { iconKey: e })), e) : c === G.Toolbar || b?.getState() ? void 0 : pr;
2884
+ }, [b?.getIcon(n), i]), C = s ?? (!b || b.disabled()), T = b?.getState(), P = {
2885
+ tabIndex: 0,
2886
+ ref: t,
2887
+ selected: !!T,
2888
+ icon: c === G.Toolbar ? l ? $e(w, a ?? b?.getLabel(n)) : w : M(Vt, {
2889
+ selected: T ?? !1,
2890
+ children: w
2891
+ }),
2892
+ disableRipple: !0,
2893
+ disabled: C,
2894
+ onMouseDown: y,
2895
+ onMouseUp: v,
2896
+ onKeyDown: k
2897
+ };
2898
+ let R;
2899
+ return R = c === G.Menuitem ? S(Nt, {
2900
+ ...m,
2901
+ ...P,
2902
+ children: [a ?? b?.getLabel(n), h]
2903
+ }) : M(It, {
2904
+ ...m,
2905
+ ...P,
2906
+ children: h
2907
+ }), a || b?.getLabel() ? (C && (R = M("div", { children: R })), R = M(sr, {
2908
+ commandKey: r,
2909
+ command: o,
2910
+ disabled: C,
2911
+ placement: c === G.Toolbar ? "bottom-start" : "right-start",
2912
+ shortcut: d,
2913
+ ...u,
2914
+ children: R
2915
+ }), R) : R;
801
2916
  }));
802
- Yt.displayName = "CommandButton";
803
- const Jt = e(W, {}), Zt = r(i((o2, n2) => {
804
- const { command: r2, scope: i2, icon: d2 = Jt, label: p2, variant: u2 = G.Toolbar, disabled: m2 = false, commandHook: h2, ...f2 } = o2, x2 = l(null), g2 = l(false), y2 = a(() => {
805
- const e2 = { onExecute(e3, t2) {
806
- h2?.onExecute?.(e3, t2), g2.current || (x2.current?.start({ center: false }), setTimeout(() => x2.current?.stop({}), 180)), g2.current = false;
807
- }, onError(e3, t2, o3) {
808
- h2?.onError(e3, t2, o3);
809
- } };
810
- return h2?.beforeExecute && (e2.beforeExecute = h2.beforeExecute), e2;
811
- }, [h2]), v2 = U(r2, y2), k2 = () => r2?.getState()?.toString() || "0", [w2, C2] = c(k2), M2 = K(() => {
812
- const e2 = parseFloat(w2);
813
- isNaN(e2) ? C2(k2()) : parseFloat(k2()) !== e2 && r2.execute(e2, h2);
814
- }, [k2, r2, w2, h2]);
815
- s(() => {
816
- C2(k2());
817
- }, [r2?.getState()]);
818
- const S2 = a(() => {
819
- let t2 = "function" == typeof d2 ? d2(r2) : d2;
820
- return t2 && (t2 = r2?.getIcon()), "string" == typeof t2 && (t2 = e(W, { iconKey: t2 })), t2;
821
- }, [v2, d2, r2?.getIcon]), R2 = a(() => void 0 === p2 ? r2?.getLabel(i2) : "function" == typeof p2 ? p2() : p2, [v2]), P2 = a(() => e(b, { ...f2, sx: { paddingTop: "0px", paddingBottom: "0px" }, component: "div", disableRipple: true, onClick: (e2) => e2.stopPropagation(), onMouseDown: (e2) => {
822
- 0 === e2.button && e2.stopPropagation();
823
- }, onMouseUp: (e2) => {
824
- 0 === e2.button && e2.stopPropagation();
825
- }, children: e(N, { inputMode: "numeric", disabled: m2 || !r2 || r2.disabled(), inputProps: { tabIndex: 0, name: `input-${r2.getKey()}`, autoComplete: "off", type: "number", maxLength: 4 }, sx: { paddingTop: "0px", paddingBottom: "0px", paddingLeft: "0px", paddingRight: "0px", fontSize: (e2) => `${Math.round(e2.typography.fontSize)}px`, width: (e2) => "3.2em", input: { padding: "0 0", textAlign: "center", MozAppearance: "textfield" }, "input::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: "0" }, minHeight: "24px" }, value: w2, onFocus: (e2) => {
826
- e2.target?.select();
827
- }, onKeyDown: (e2) => {
828
- if (e2.which === j.Enter) k2() !== w2 && (e2.stopPropagation(), e2.preventDefault(), M2());
829
- else if (e2.which === j.Escape) k2() !== w2 && (C2(k2()), setTimeout(() => {
830
- e2.target?.select();
831
- }, 0), e2.stopPropagation(), e2.preventDefault());
832
- else {
833
- if (e2.key.match("[-]")) return e2.stopPropagation(), void e2.preventDefault();
834
- if (e2.key.match("[0-9.]") && (w2 + e2.key).length > 4) return e2.stopPropagation(), void e2.preventDefault();
835
- if (e2.which === j.Space) return void e2.preventDefault();
836
- }
837
- }, onBlur: () => {
838
- M2();
839
- }, onChange: (e2) => {
840
- if (e2.target.value.length > 4) return e2.stopPropagation(), void e2.preventDefault();
841
- C2(e2.target.value);
842
- } }) }), [w2, m2, r2]), D2 = { tabIndex: 0, ref: n2, icon: S2, touchRippleRef: x2, disabled: m2 || !r2 || r2.disabled(), onMouseDown: (e2) => {
843
- 0 === e2.button && e2.preventDefault();
844
- }, onMouseUp: (e2) => {
845
- 0 !== e2.button || e2.isPropagationStopped() || e2.isDefaultPrevented() || e2.isDefaultPrevented() || (e2.preventDefault(), r2?.execute(!r2?.getState(), y2));
846
- }, onKeyDown: (e2) => {
847
- e2.keyCode !== j.Enter && e2.keyCode !== j.Space || r2?.execute(!r2?.getState(), y2);
848
- } };
849
- let E2;
850
- return E2 = u2 === G.Menuitem ? t(Dt, { ...f2, chips: r2?.getTags(), ...D2, children: [R2, P2] }) : e(St, { ...f2, ...D2 }), r2?.getLabel() ? ((r2.disabled() || m2) && (E2 = e("div", { children: E2 })), E2 = e(Gt, { command: r2, placement: u2 === G.Toolbar ? "bottom-start" : "right-start", children: E2 }), E2) : E2;
851
- })), eo = r(i((t2, o2) => {
852
- const { variant: n2 = G.Toolbar, quickCommand: r2, onQuickClick: i2, commands: s2, commandState: c2, commandHook: d2, disabled: p2, label: u2, icon: m2, createPopupPanel: h2, tooltip: f2, selected: x2, scope: g2, ...b2 } = t2, y2 = l(null), v2 = l(false), k2 = a(() => {
853
- const e2 = { onExecute(e3, t3) {
854
- d2?.onExecute?.(e3, t3), v2.current || (y2.current?.start({ center: false }), setTimeout(() => y2.current?.stop({}), 180)), v2.current = false;
855
- }, onError(e3, t3, o3) {
856
- d2?.onError(e3, t3, o3);
857
- } };
858
- return d2?.beforeExecute && (e2.beforeExecute = d2.beforeExecute), e2;
859
- }, [d2]), w2 = X(s2, [r2], null, [r2]), C2 = w2[0], { label: M2, icon: S2 } = a(() => {
860
- let t3 = null;
861
- u2 && (t3 = "function" == typeof u2 ? u2(C2) : u2), t3 || (t3 = C2?.getLabel?.(g2));
862
- let o3 = m2;
863
- return o3 || (o3 = C2?.getIcon?.()), "string" == typeof o3 ? o3 = e(W, { iconKey: o3 }) : "function" == typeof o3 && (o3 = o3(C2)), { label: t3, icon: o3 };
864
- }, [w2, u2, m2]), R2 = { disabled: p2, scope: g2, touchRippleRef: y2, onQuickClick: i2, tooltip: f2, label: M2, icon: S2 };
865
- (M2 || f2) && (R2.createTooltip = ({ children: t3 }, o3) => e(wt, { label: M2, description: f2, disabled: o3, children: t3 }));
866
- const P2 = K((e2) => h2?.(e2, s2), [h2, w2]), D2 = K((e2) => C2?.execute(c2, k2), [C2]);
867
- return C2 ? (R2.propsQuickButton = {}, R2.propsQuickButton.createTooltip = ({ children: t3, placement: o3 }, r3) => e(Gt, { command: C2, placement: o3 ?? n2 === G.Toolbar ? "bottom-start" : "right-start", disabled: r3, children: t3 }), R2.disabled = R2.disabled ?? C2?.disabled(), i2 || (R2.onQuickClick = D2)) : r2 && (R2.onQuickClick = () => {
868
- }), R2.selected = x2 ?? C2?.getState(), R2.createPopupPanel = P2, n2 === G.Toolbar ? e(Tt, { ...b2, ...R2, ref: o2 }) : e($t, { ...b2, ...R2, ref: o2 });
2917
+ ur.displayName = "CommandButton";
2918
+ var mr = M(Y, {}), hr = B(D((e, t) => {
2919
+ const { commandKey: r, groupKey: o, icon: n, commandState: i, label: a, variant: l = G.Toolbar, disabled: s, parseInput: c, inputProps: u, inputRef: m, ...h } = e, { ripple: f, trigger: g } = dr(), x = E(() => ({ onExecute() {
2920
+ g();
2921
+ } }), [g]), b = ce(r ?? [], x)[0], y = () => b?.getState()?.toString() || "", [v, k] = A(""), w = K(y()), C = le(() => {
2922
+ let e = v;
2923
+ if (c) try {
2924
+ e = c(v);
2925
+ } catch (e) {
2926
+ k(y());
2927
+ return;
2928
+ }
2929
+ w.current !== v ? (w.current = v, b?.execute(e)) : k(y());
2930
+ }, [
2931
+ y,
2932
+ b,
2933
+ v,
2934
+ c
2935
+ ]);
2936
+ N(() => {
2937
+ k(y());
2938
+ }, [b?.getState()]);
2939
+ const T = E(() => {
2940
+ if (null === n) return mr;
2941
+ let e;
2942
+ return e = "function" == typeof n ? b ? n(b) : void 0 : n, e || (e = b?.getIcon()), e ? ("string" == typeof e && (e = M(Y, { iconKey: e })), e) : l === G.Toolbar || b?.getState() ? void 0 : mr;
2943
+ }, [b?.getIcon(), n]), P = E(() => void 0 === a ? b?.getLabel(o) : "function" == typeof a ? a() : a, [a, b?.getLabel(o)]), R = s ?? (!b || b.disabled()), D = E(() => M(d, {
2944
+ ...h,
2945
+ sx: {
2946
+ paddingTop: "0px",
2947
+ paddingBottom: "0px"
2948
+ },
2949
+ component: "div",
2950
+ disableRipple: !0,
2951
+ onClick: (e) => e.stopPropagation(),
2952
+ onMouseDown: (e) => {
2953
+ 0 === e.button && e.stopPropagation();
2954
+ },
2955
+ onMouseUp: (e) => {
2956
+ 0 === e.button && e.stopPropagation();
2957
+ },
2958
+ children: M(p, {
2959
+ disabled: R,
2960
+ inputRef: m,
2961
+ inputProps: {
2962
+ tabIndex: 0,
2963
+ name: `input-${b?.getKey()}`,
2964
+ autoComplete: "off",
2965
+ ...u
2966
+ },
2967
+ sx: {
2968
+ paddingTop: "0px",
2969
+ paddingBottom: "0px",
2970
+ paddingLeft: "0px",
2971
+ paddingRight: "0px",
2972
+ fontSize: (e) => `${Math.round(e.typography.fontSize)}px`,
2973
+ width: (e) => "3.2em",
2974
+ input: {
2975
+ padding: "0 0",
2976
+ textAlign: "center",
2977
+ MozAppearance: "textfield"
2978
+ },
2979
+ "input::-webkit-inner-spin-button": {
2980
+ WebkitAppearance: "none",
2981
+ margin: "0"
2982
+ },
2983
+ minHeight: "24px"
2984
+ },
2985
+ value: v,
2986
+ onFocus: (e) => {
2987
+ e.target?.select();
2988
+ },
2989
+ onKeyDown: (e) => {
2990
+ if (e.which === ee.Enter) y() !== v && (e.stopPropagation(), e.preventDefault(), C());
2991
+ else if (e.which === ee.Escape) y() !== v && (k(y()), setTimeout(() => {
2992
+ e.target?.select();
2993
+ }, 0), e.stopPropagation(), e.preventDefault());
2994
+ else {
2995
+ if (e.key.match("[-]")) return e.stopPropagation(), void e.preventDefault();
2996
+ if (e.key.match("[0-9.]") && (v + e.key).length > 4) return e.stopPropagation(), void e.preventDefault();
2997
+ if (e.which === ee.Space) return void e.preventDefault();
2998
+ }
2999
+ },
3000
+ onBlur: () => {
3001
+ C();
3002
+ },
3003
+ onChange: (e) => {
3004
+ if (e.target.value.length > 4) return e.stopPropagation(), void e.preventDefault();
3005
+ k(e.target.value);
3006
+ }
3007
+ })
3008
+ }), [
3009
+ v,
3010
+ R,
3011
+ u,
3012
+ m
3013
+ ]), $ = {
3014
+ tabIndex: 0,
3015
+ ref: t,
3016
+ icon: T,
3017
+ disableRipple: !0,
3018
+ disabled: s || !b || b.disabled(),
3019
+ onMouseDown: (e) => {
3020
+ 0 === e.button && e.preventDefault();
3021
+ },
3022
+ onMouseUp: (e) => {
3023
+ 0 !== e.button || e.isPropagationStopped() || e.isDefaultPrevented() || e.isDefaultPrevented() || (e.preventDefault(), C());
3024
+ },
3025
+ onKeyDown: (e) => {
3026
+ e.keyCode !== ee.Enter && e.keyCode !== ee.Tab || C();
3027
+ }
3028
+ };
3029
+ let I;
3030
+ return I = l === G.Menuitem ? S(Nt, {
3031
+ ...h,
3032
+ ...$,
3033
+ children: [
3034
+ P,
3035
+ D,
3036
+ f
3037
+ ]
3038
+ }) : M(It, {
3039
+ ...h,
3040
+ ...$,
3041
+ children: f
3042
+ }), b?.getLabel() ? ((b.disabled() || s) && (I = M("div", { children: I })), I = M(sr, {
3043
+ commandKey: r,
3044
+ placement: l === G.Toolbar ? "bottom-start" : "right-start",
3045
+ children: I
3046
+ }), I) : I;
3047
+ })), fr = B(D((e, t) => {
3048
+ const { variant: r = G.Toolbar, quickCommand: o, onQuickClick: n, commandState: i, disabled: a, label: l, icon: s, createPopupPanel: c, tooltip: d, selected: p, groupKey: u, ...m } = e, { ripple: h, trigger: f } = dr(), g = E(() => ({ onExecute() {
3049
+ f();
3050
+ } }), [f]), [x] = ce(o ?? [], g), { label: b, icon: y } = E(() => {
3051
+ let e = null;
3052
+ l && (e = "function" == typeof l ? x ? l(x) : null : l), e || (e = x?.getLabel?.(u));
3053
+ let t = s;
3054
+ return t || (t = x?.getIcon?.(u)), "string" == typeof t ? t = M(Y, { iconKey: t }) : "function" == typeof t && (t = x ? t(x) : void 0), {
3055
+ label: e,
3056
+ icon: t
3057
+ };
3058
+ }, [
3059
+ x,
3060
+ l,
3061
+ s
3062
+ ]), v = {
3063
+ disabled: a || !(x || !o),
3064
+ ripple: h,
3065
+ onQuickClick: n,
3066
+ tooltip: d,
3067
+ label: b,
3068
+ icon: y
3069
+ };
3070
+ (b || d) && (v.createTooltip = ({ children: e }, t) => M(Rt, {
3071
+ label: b,
3072
+ description: d,
3073
+ disabled: t,
3074
+ children: e
3075
+ }));
3076
+ const k = le((e) => c?.(e), [c]), w = le((e) => x?.execute(i), [x]);
3077
+ return x ? (v.propsQuickButton = {}, v.propsQuickButton.createTooltip = ({ children: e, placement: t }, n) => M(sr, {
3078
+ commandKey: o,
3079
+ placement: t ?? r === G.Toolbar ? "bottom-start" : "right-start",
3080
+ disabled: n,
3081
+ children: e
3082
+ }), v.disabled = v.disabled ?? x?.disabled(), n || (v.onQuickClick = w)) : o && (v.onQuickClick = () => {}), v.selected = p ?? x?.getState(), v.createPopupPanel = k, r === G.Toolbar ? M(Ot, {
3083
+ ...m,
3084
+ ...v,
3085
+ ref: t
3086
+ }) : M(Kt, {
3087
+ ...m,
3088
+ ...v,
3089
+ ref: t
3090
+ });
869
3091
  }));
870
- eo.displayName = "CommandPopupButton";
871
- const to = e(W, { iconKey: "Check" }), oo = (o2) => {
872
- const { command: n2, label: r2, scope: i2, icon: a2 = to, sx: l2, ...s2 } = o2;
873
- return t(v, { sx: { display: "flex", flexDirection: "row", textTransform: "none", alignItems: "center", fontSize: (e2) => e2.typography.subtitle2.fontSize, ...l2 }, ...s2, children: [a2, e(k, { component: "div", sx: { whiteSpace: "nowrap", lineHeight: "1", paddingLeft: (e2) => e2.spacing(0.25), paddingRight: (e2) => e2.spacing(0.25), fontSize: "inherit" }, children: n2?.getLabel(i2) || r2 })] });
874
- }, no = r(i((t2, o2) => {
875
- const { sx: n2, commands: r2, propsCommandButton: i2, parentFloat: l2, renderToolbarPalette: s2, children: d2, ...u2 } = t2, h2 = Q(o2, () => ({}), []), [f2, x2] = c(null), { reference: g2 } = ht({ label: "toolbar", anchor: h2.current, parentFloat: l2, createPopupPanel: null }), b2 = p(() => {
876
- const e2 = f2;
877
- e2 && requestAnimationFrame(() => {
878
- h2.current?.contains(document.activeElement) && e2.focus();
879
- });
880
- }, []), y2 = a(() => ({ dense: true, outlined: false }), []), v2 = a(() => {
881
- const { commandHook: e2, ...t3 } = i2 || {};
882
- return { commandHook: { beforeExecute: (t4, o3) => {
883
- const n3 = e2?.beforeExecute?.(t4, o3);
884
- return false !== n3 && g2.closeAll();
885
- }, onExecute(t4, o3) {
886
- e2?.onExecute?.(t4, o3), b2();
887
- }, onError(t4, o3, n3) {
888
- e2?.onError?.(t4, o3, n3);
889
- } }, ...t3 };
890
- }, [g2, i2]), k2 = a(() => ({ ...y2, ...v2 }), [y2, v2]), [w2, C2] = m((e2) => e2 + 1, 0);
891
- X(r2, [], { onChange: () => {
892
- C2();
893
- } });
894
- const M2 = a(() => ({ commands: r2, parentFloat: g2, ...v2 }), [w2, k2, g2, i2]);
895
- let S2 = 0;
896
- y2.dense || (S2 += 2), y2.outlined && S2++;
897
- let R2 = 2;
898
- y2.dense || (R2 = 4);
899
- const P2 = a(() => s2({ commands: r2, propsCommandButton: k2, propsCommandPopup: { commands: r2, ...M2, ...i2 } }), [w2, k2, M2, s2]);
900
- return e(B, { variant: "dense", sx: { minHeight: "unset", height: "unset", paddingTop: `${R2}px`, paddingBottom: `${R2}px`, paddingLeft: "6px !important", paddingRight: "6px !important", flex: "1 1 0%", alignItems: "center", userSelect: "none", flexGrow: 1, display: "flex", overflow: "hidden", ...n2 }, ref: h2, onFocus: (e2) => {
901
- e2.relatedTarget && !f2 && x2(e2.relatedTarget);
902
- }, onBlur: (e2) => {
903
- f2 && !h2?.current?.contains(e2.relatedTarget) && x2(null);
904
- }, onKeyDown: (e2) => {
905
- f2 && e2.which === j.Escape && f2.focus();
906
- }, ...u2, children: e("div", { ref: h2, style: { flex: "1 1 100%", display: "flex", flexWrap: "wrap", rowGap: `${R2}px`, columnGap: `${S2}px`, alignItems: "center", maxWidth: "100%" }, children: P2 }) });
3092
+ function gr(e, t = {}) {
3093
+ const { variant: r, dividerOrientation: o = "vertical", groupKey: n, commandState: i, propsCommandButton: a, propsCommandPopup: l, registry: s } = t, c = { ...a };
3094
+ void 0 !== r && (c.variant = r);
3095
+ const d = { ...l };
3096
+ void 0 !== r && (d.variant = r);
3097
+ const p = (e, t, r) => {
3098
+ const o = {
3099
+ ...c,
3100
+ groupKey: n,
3101
+ commandKey: e,
3102
+ commandState: void 0 !== t ? t : i,
3103
+ label: r?.getLabel?.(n),
3104
+ icon: r?.getIcon?.(n),
3105
+ showLabel: r?.showLabel
3106
+ };
3107
+ return (r?.render ? r.render(o, n) : M(ur, { ...o })) ?? null;
3108
+ }, u = (e) => {
3109
+ const t = "string" == typeof e ? e : e.key, r = "string" == typeof e ? void 0 : e;
3110
+ if (!t) return ((e) => Array.isArray(e.members) ? e.render ? e.render({ ...d }, void 0) ?? null : M(xr, {
3111
+ ...d,
3112
+ members: e.members,
3113
+ icon: e.getIcon?.(),
3114
+ label: e.getLabel?.(),
3115
+ tooltip: e.getDescription?.()
3116
+ }) : (e.render ? e.render({ ...d }, n) : null) ?? null)(e);
3117
+ const o = s?.get(t) ?? null;
3118
+ return o ? ((e, t, r) => {
3119
+ if (Array.isArray(e.members)) return e.render ? e.render({ ...d }, t) ?? null : M(xr, {
3120
+ ...d,
3121
+ groupKey: t,
3122
+ icon: r?.getIcon?.(t),
3123
+ label: r?.getLabel?.(t),
3124
+ showLabel: r?.showLabel
3125
+ });
3126
+ if (e.render) return e.render({ ...d }, n) ?? null;
3127
+ const o = r ? {
3128
+ ...e,
3129
+ ...r
3130
+ } : e;
3131
+ return p(e.defaultKey ?? t, o.state, o);
3132
+ })(o, t, r) : p(t, r?.state, r);
3133
+ }, m = [];
3134
+ let h = 0, f = !1, g = !1;
3135
+ const x = e ?? [];
3136
+ for (let e = 0; e < x.length; e++) {
3137
+ const t = x[e];
3138
+ if (!t || "-" === t) {
3139
+ g && (f = !0);
3140
+ continue;
3141
+ }
3142
+ const r = u(t);
3143
+ r && (f && (m.push(M(Oe, { orientation: o }, "member-" + h++)), f = !1), m.push(R(r, { key: "member-" + h++ })), g = !0);
3144
+ }
3145
+ return m;
3146
+ }
3147
+ fr.displayName = "CommandPopupButton";
3148
+ var xr = B(D((e, t) => {
3149
+ const { groupKey: r, members: o, registry: n, quickCommand: i, icon: a, label: l, showLabel: s, tooltip: c, commandState: d, disabled: p, ...u } = e, m = se(), h = n ?? m, f = !o && r ? h.get(r) : null, g = f && Array.isArray(f.members) ? f : null, x = E(() => o ?? (r ? h.resolveMembers(r) : null) ?? null, [
3150
+ o,
3151
+ r,
3152
+ h
3153
+ ]), b = r, y = i ?? g?.defaultKey, v = a ?? g?.getIcon?.(b), k = l ?? g?.getLabel?.(b), w = s ?? g?.showLabel, C = c ?? g?.getDescription?.(b), S = E(() => {
3154
+ const e = [], t = x ?? [];
3155
+ for (let r = 0; r < t.length; r++) {
3156
+ const o = t[r];
3157
+ o && "-" !== o && ("string" == typeof o ? e.push(o) : o.key && e.push(o.key));
3158
+ }
3159
+ return e;
3160
+ }, [x]), T = ce(y ? [y, ...S] : S), P = E(() => {
3161
+ for (let e = 0; e < T.length; e++) {
3162
+ const t = T[e];
3163
+ if (t && !t.disabled()) return !1;
3164
+ }
3165
+ return !0;
3166
+ }, [T]), R = z((e) => {
3167
+ const t = {};
3168
+ void 0 !== p && (t.disabled = p);
3169
+ const r = gr(x, {
3170
+ variant: G.Menuitem,
3171
+ dividerOrientation: "horizontal",
3172
+ groupKey: b,
3173
+ commandState: d,
3174
+ propsCommandButton: t,
3175
+ propsCommandPopup: t,
3176
+ registry: h
3177
+ });
3178
+ return xt({
3179
+ ...e,
3180
+ children: r
3181
+ });
3182
+ }, [
3183
+ x,
3184
+ h,
3185
+ b,
3186
+ d,
3187
+ p
3188
+ ]);
3189
+ return x ? M(fr, {
3190
+ ref: t,
3191
+ quickCommand: y,
3192
+ icon: v,
3193
+ label: k,
3194
+ showLabel: w,
3195
+ tooltip: C,
3196
+ commandState: d,
3197
+ disabled: p ?? P,
3198
+ createPopupPanel: R,
3199
+ ...u
3200
+ }) : null;
907
3201
  }));
908
- no.displayName = "CommandToolbar";
909
- const ro = (t2) => {
910
- const { key: o2, ...n2 } = t2;
911
- return e(Yt, { ...n2 }, o2);
912
- }, io = r(i((t2, o2) => {
913
- const { popupCommandKeys: n2, renderCommandButton: r2 = ro, scope: i2, commands: l2, quickCommand: s2, popupScope: c2 = s2, commandState: d2, commandHook: u2, disabled: m2 = false, ...h2 } = t2, f2 = X(l2, n2 ? [s2, ...n2] : [s2]), { allDisabled: x2 } = a(() => {
914
- let e2 = 0;
915
- const t3 = f2.length;
916
- for (let o3 = 0; o3 < t3; o3++) {
917
- const t4 = f2[o3];
918
- t4 && !t4.disabled() && e2++;
919
- }
920
- return { allDisabled: 0 === e2 };
921
- }, [f2]), g2 = p((t3, o3) => {
922
- const a2 = { variant: G.Menuitem, commandHook: u2, commandState: d2, scope: c2 ?? i2, disabled: m2 }, l3 = [], s3 = n2 ? n2.length : 0;
923
- for (let t4 = 0; t4 < s3; t4++) {
924
- const i3 = n2[t4];
925
- if (null === i3 || "-" === i3) {
926
- l3.push(e(be, { orientation: "horizontal" }, `element-${l3.length}`));
927
- continue;
928
- }
929
- const s4 = o3.getCommand(i3), c3 = { key: `${i3}-${l3.length}`, command: s4, ...a2 }, d3 = r2(c3);
930
- d3 && l3.push(d3);
931
- }
932
- return rt({ ...t3, children: l3 });
933
- }, [m2, u2, d2, c2, n2, r2]);
934
- return n2 ? e(eo, { ref: o2, commands: l2, disabled: m2 || x2, commandHook: u2, commandState: d2, scope: i2, quickCommand: s2, createPopupPanel: g2, ...h2 }) : r2({ ref: o2, disabled: m2, commandHook: u2, commandState: d2, scope: i2, command: f2[0], ...h2 });
3202
+ xr.displayName = "CommandGroup";
3203
+ var br = M(Y, { iconKey: "Check" }), yr = (e) => {
3204
+ const { commandKey: r, label: o, groupKey: n, icon: i, sx: a, ...l } = e, [s] = ce(r ?? []), c = E(() => {
3205
+ if (void 0 !== i) return i;
3206
+ let e = s?.getIcon(n);
3207
+ return e ? ("string" == typeof e && (e = M(Y, { iconKey: e })), e) : br;
3208
+ }, [
3209
+ i,
3210
+ n,
3211
+ s
3212
+ ]);
3213
+ return S(t, {
3214
+ sx: {
3215
+ display: "flex",
3216
+ flexDirection: "row",
3217
+ textTransform: "none",
3218
+ alignItems: "center",
3219
+ fontSize: (e) => e.typography.subtitle2.fontSize,
3220
+ ...a
3221
+ },
3222
+ ...l,
3223
+ children: [c, M(b, {
3224
+ component: "div",
3225
+ sx: {
3226
+ whiteSpace: "nowrap",
3227
+ lineHeight: "1",
3228
+ paddingLeft: (e) => e.spacing(.25),
3229
+ paddingRight: (e) => e.spacing(.25),
3230
+ fontSize: "inherit"
3231
+ },
3232
+ children: o ?? s?.getLabel(n)
3233
+ })]
3234
+ });
3235
+ }, vr = B(D((e, t) => {
3236
+ const { sx: r, propsCommandButton: o, parentFloat: n, groupKey: i, members: a, registry: l, renderToolbarPalette: s, children: c, ...d } = e, p = se(), u = l ?? p, m = E(() => a ?? (i ? u.resolveMembers(i) : null) ?? null, [
3237
+ a,
3238
+ i,
3239
+ u,
3240
+ u.getVersion()
3241
+ ]), h = he(t, () => ({}), []), [f, x] = A(null), { reference: b } = pe({
3242
+ label: "toolbar",
3243
+ anchor: h.current,
3244
+ parentFloat: n,
3245
+ createPopupPanel: null
3246
+ }), y = le(() => {
3247
+ const e = f;
3248
+ e && requestAnimationFrame(() => {
3249
+ h.current?.contains(document.activeElement) && e.focus();
3250
+ });
3251
+ }, [f]), v = E(() => ({
3252
+ dense: !0,
3253
+ outlined: !1
3254
+ }), []), k = E(() => ({ ...o || {} }), [o]), w = E(() => ({
3255
+ ...v,
3256
+ ...k
3257
+ }), [v, k]), C = E(() => ({ ...k }), [w, o]);
3258
+ let S = 0;
3259
+ v.dense || (S += 2), v.outlined && S++;
3260
+ let T = 2;
3261
+ v.dense || (T = 4);
3262
+ const P = E(() => {
3263
+ const e = {
3264
+ propsCommandButton: w,
3265
+ propsCommandPopup: {
3266
+ ...C,
3267
+ ...o
3268
+ }
3269
+ };
3270
+ return s ? s(e) : m ? M(Gt, { children: gr(m, {
3271
+ dividerOrientation: "vertical",
3272
+ groupKey: i,
3273
+ propsCommandButton: e.propsCommandButton,
3274
+ propsCommandPopup: e.propsCommandPopup,
3275
+ registry: u
3276
+ }) }) : null;
3277
+ }, [
3278
+ w,
3279
+ C,
3280
+ o,
3281
+ s,
3282
+ m,
3283
+ i,
3284
+ u
3285
+ ]);
3286
+ return M(g, {
3287
+ variant: "dense",
3288
+ sx: {
3289
+ minHeight: "unset",
3290
+ height: "unset",
3291
+ paddingTop: `${T}px`,
3292
+ paddingBottom: `${T}px`,
3293
+ paddingLeft: "6px !important",
3294
+ paddingRight: "6px !important",
3295
+ flex: "1 1 0%",
3296
+ alignItems: "center",
3297
+ userSelect: "none",
3298
+ flexGrow: 1,
3299
+ display: "flex",
3300
+ overflow: "hidden",
3301
+ ...r
3302
+ },
3303
+ ref: h,
3304
+ onFocus: (e) => {
3305
+ e.relatedTarget && !f && x(e.relatedTarget);
3306
+ },
3307
+ onBlur: (e) => {
3308
+ f && !h?.current?.contains(e.relatedTarget) && x(null);
3309
+ },
3310
+ onKeyDown: (e) => {
3311
+ f && e.which === ee.Escape && f.focus();
3312
+ },
3313
+ ...d,
3314
+ children: M("div", {
3315
+ ref: h,
3316
+ style: {
3317
+ flex: "1 1 100%",
3318
+ display: "flex",
3319
+ flexWrap: "wrap",
3320
+ rowGap: `${T}px`,
3321
+ columnGap: `${S}px`,
3322
+ alignItems: "center",
3323
+ maxWidth: "100%"
3324
+ },
3325
+ children: M(Z, {
3326
+ value: b,
3327
+ children: M(X, {
3328
+ value: y,
3329
+ children: P
3330
+ })
3331
+ })
3332
+ })
3333
+ });
935
3334
  }));
936
- export {
937
- Ce as AnimatedBouncingEllipsisIcon,
938
- ke as AnimatedCircleIcon,
939
- ve as AnimatedClockIcon,
940
- we as AnimatedFadingEllipsisIcon,
941
- Pe as AnimatedLoadingPanel,
942
- Me as AnimatedOrbitIcon,
943
- Se as AnimatedTraversingEllipsisIcon,
944
- He as ArrowDownIcon,
945
- We as ArrowRightIcon,
946
- Ie as ChipStrip,
947
- ot as ClosingReason,
948
- Yt as CommandButton,
949
- eo as CommandPopupButton,
950
- no as CommandToolbar,
951
- Gt as CommandTooltip,
952
- gt as ContextMenu,
953
- be as ExhibitDivider,
954
- at as ExhibitFloatPanel,
955
- St as ExhibitIconButton,
956
- Et as ExhibitMenuHeader,
957
- Dt as ExhibitMenuItem,
958
- Ot as ExhibitOptionButton,
959
- Le as ExhibitPopper,
960
- Tt as ExhibitPopupIconButton,
961
- $t as ExhibitPopupMenuItem,
962
- wt as ExhibitTooltip,
963
- Zt as InputCommandButton,
964
- Wt as InternalWindow,
965
- oo as LabelIcon,
966
- default2 as ModalProvider,
967
- ft as NestingPopupButton,
968
- Vt as OptionsDialog,
969
- tt as PopupAutoFocus,
970
- nt as PopupButtonType,
971
- Bt as SelectedIcon,
972
- io as SimpleCommandPopupButton,
973
- bt as SimpleTooltip,
974
- ze as StackTrace,
975
- $e as StackTraceErrorPanel,
976
- Ye as ThemeMode,
977
- Ke as ThemedIcon,
978
- it as createDownArrow,
979
- Ue as createExhibitTheme,
980
- fe as createScrollButton,
981
- Ae as createStrokeShadowFilter,
982
- rt as defaultCreatePopupPanel,
983
- qe as elevateColor,
984
- Ge as getScrollbarCssVariables,
985
- _e as hexToRGB,
986
- Qe as overlayAlpha,
987
- he as renderScrollButtonEdge,
988
- ge as renderScrollButtonEnd,
989
- xe as renderScrollButtonStart,
990
- Xe as scrollbarTheming,
991
- Fe as strokeShadowFilter,
992
- kt as toShortcutElements,
993
- ht as useFloatStack,
994
- Ut as useInputDialog,
995
- Lt as useLazyWindow,
996
- qt as useOptionsDialog,
997
- Je as useResolvedThemeMode
998
- };
3335
+ vr.displayName = "CommandToolbar";
3336
+ var kr = B(D((e, t) => {
3337
+ const { groupKey: r, members: o, registry: n, projectAs: i = "quick", defaultIcon: a, ...l } = e, s = se(), c = n ?? s, d = E(() => o ?? (r ? c.resolveMembers(r) : null) ?? null, [
3338
+ o,
3339
+ r,
3340
+ c
3341
+ ]), p = E(() => {
3342
+ const e = [], t = d ?? [];
3343
+ for (let r = 0; r < t.length; r++) {
3344
+ const o = t[r];
3345
+ o && "-" !== o && ("string" == typeof o ? e.push(o) : o.key && e.push(o.key));
3346
+ }
3347
+ return e;
3348
+ }, [d]), u = ce(p);
3349
+ let m = null, h = null;
3350
+ for (let e = 0; !m && e < u.length; e++) {
3351
+ const t = u[e];
3352
+ t && !t.disabled() && t.getState() && (m = p[e], h = t.getIcon());
3353
+ }
3354
+ const f = "icon" === i ? {
3355
+ icon: h ?? a,
3356
+ quickCommand: void 0
3357
+ } : {
3358
+ quickCommand: m ?? p[0],
3359
+ icon: void 0
3360
+ };
3361
+ return M(xr, {
3362
+ ref: t,
3363
+ groupKey: r,
3364
+ members: o,
3365
+ registry: c,
3366
+ ...l,
3367
+ ...f
3368
+ });
3369
+ }));
3370
+ kr.displayName = "ToggleGroupButton";
3371
+ export { We as AnimatedBouncingEllipsisIcon, Ke as AnimatedCircleIcon, Fe as AnimatedClockIcon, Ae as AnimatedFadingEllipsisIcon, je as AnimatedLoadingPanel, He as AnimatedOrbitIcon, Ve as AnimatedTraversingEllipsisIcon, tt as ArrowDownIcon, rt as ArrowRightIcon, Je as ChipStrip, ft as ClosingReason, ur as CommandButton, xr as CommandGroup, fr as CommandPopupButton, vr as CommandToolbar, sr as CommandTooltip, Mt as ContextMenu, Oe as ExhibitDivider, yt as ExhibitFloatPanel, kt as ExhibitFloatProvider, It as ExhibitIconButton, Lt as ExhibitMenuHeader, Nt as ExhibitMenuItem, At as ExhibitOptionButton, Ot as ExhibitPopupIconButton, Kt as ExhibitPopupMenuItem, Rt as ExhibitTooltip, hr as InputCommandButton, Zt as InternalWindow, yr as LabelIcon, ke as ModalProvider, wt as NestingPopupButton, nr as OptionsDialog, Gt as OverflowPalette, ht as PopupAutoFocus, gt as PopupButtonType, Vt as SelectedIcon, St as SimpleTooltip, Xe as StackTrace, Ye as StackTraceErrorPanel, kr as ToggleGroupButton, De as buttonLabelSx, $e as composeButtonContent, bt as createDownArrow, pt as createExhibitTheme, ze as createScrollButton, et as createStrokeShadowFilter, xt as defaultCreatePopupPanel, at as elevateColor, dt as elevatedSurface, ut as getScrollbarCssVariables, it as hexToRGB, tr as optionIdentity, lt as overlayAlpha, ct as raisedSurface, st as raisedSurfaceAt, Ut as registerUtilsMuiLocales, gr as renderMembers, Be as renderScrollButtonEdge, Le as renderScrollButtonEnd, Ne as renderScrollButtonStart, mt as scrollbarTheming, Ze as strokeShadowFilter, Pt as toShortcutElements, lr as useInputDialog, Xt as useLazyWindow, ir as useOptionsDialog };