@omnitron-dev/prism 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/THIRD-PARTY-NOTICES.txt +26 -0
- package/dist/accessibility/index.js +2 -0
- package/dist/accessibility/index.js.map +1 -1
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/blocks/auth-block/guards.d.ts +3 -2
- package/dist/blocks/auth-block/guards.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/dashboard-block.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/types.d.ts +4 -2
- package/dist/blocks/dashboard-block/types.d.ts.map +1 -1
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts +2 -2
- package/dist/blocks/dashboard-block/use-dashboard-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/data-grid-block.d.ts.map +1 -1
- package/dist/blocks/data-grid-block/types.d.ts +3 -0
- package/dist/blocks/data-grid-block/types.d.ts.map +1 -1
- package/dist/blocks/index.js +80 -255
- package/dist/blocks/index.js.map +1 -1
- package/dist/chunk-2AB7VGPW.js +447 -0
- package/dist/chunk-2AB7VGPW.js.map +1 -0
- package/dist/{chunk-LOY2NPCO.js → chunk-2E67PQ4T.js} +3 -3
- package/dist/{chunk-LOY2NPCO.js.map → chunk-2E67PQ4T.js.map} +1 -1
- package/dist/chunk-2KG2NI73.js +84 -0
- package/dist/chunk-2KG2NI73.js.map +1 -0
- package/dist/chunk-2UYRW6X3.js +44 -0
- package/dist/chunk-2UYRW6X3.js.map +1 -0
- package/dist/chunk-36C5H56C.js +208 -0
- package/dist/chunk-36C5H56C.js.map +1 -0
- package/dist/chunk-36FOXX25.js +73 -0
- package/dist/chunk-36FOXX25.js.map +1 -0
- package/dist/{chunk-52PQL67Q.js → chunk-3VSM7NZG.js} +18 -15
- package/dist/chunk-3VSM7NZG.js.map +1 -0
- package/dist/{chunk-GUGTDURV.js → chunk-4B2LTPK2.js} +2 -2
- package/dist/{chunk-GUGTDURV.js.map → chunk-4B2LTPK2.js.map} +1 -1
- package/dist/chunk-4HUGZJKU.js +108 -0
- package/dist/chunk-4HUGZJKU.js.map +1 -0
- package/dist/{chunk-PXXPLHIY.js → chunk-4Q5L7LDG.js} +3 -3
- package/dist/{chunk-PXXPLHIY.js.map → chunk-4Q5L7LDG.js.map} +1 -1
- package/dist/{chunk-BRDWQVRT.js → chunk-4R7EZ7GQ.js} +3 -2
- package/dist/chunk-4R7EZ7GQ.js.map +1 -0
- package/dist/chunk-6IANOSMD.js +185 -0
- package/dist/chunk-6IANOSMD.js.map +1 -0
- package/dist/{chunk-YHE7HXSG.js → chunk-7ATBURW2.js} +3 -3
- package/dist/{chunk-YHE7HXSG.js.map → chunk-7ATBURW2.js.map} +1 -1
- package/dist/{chunk-7G5D5PTC.js → chunk-AATAOOSF.js} +4 -4
- package/dist/{chunk-7G5D5PTC.js.map → chunk-AATAOOSF.js.map} +1 -1
- package/dist/chunk-AKLRKCYH.js +128 -0
- package/dist/chunk-AKLRKCYH.js.map +1 -0
- package/dist/chunk-CT46KJOR.js +133 -0
- package/dist/chunk-CT46KJOR.js.map +1 -0
- package/dist/{chunk-LSPFFEJT.js → chunk-D4GFAJAZ.js} +298 -3900
- package/dist/chunk-D4GFAJAZ.js.map +1 -0
- package/dist/{chunk-BJE2AKD4.js → chunk-D5J3KW6Q.js} +3 -2
- package/dist/chunk-D5J3KW6Q.js.map +1 -0
- package/dist/chunk-DEPJRTVT.js +3 -0
- package/dist/{chunk-FU52GL2E.js.map → chunk-DEPJRTVT.js.map} +1 -1
- package/dist/{chunk-472SOF76.js → chunk-DHTYHUYI.js} +85 -107
- package/dist/chunk-DHTYHUYI.js.map +1 -0
- package/dist/{chunk-FF5RF32O.js → chunk-E7WM2RXA.js} +3 -2
- package/dist/chunk-E7WM2RXA.js.map +1 -0
- package/dist/chunk-F6RZ7LW6.js +1271 -0
- package/dist/chunk-F6RZ7LW6.js.map +1 -0
- package/dist/chunk-FOGY3HA4.js +217 -0
- package/dist/chunk-FOGY3HA4.js.map +1 -0
- package/dist/chunk-G2GANYMW.js +139 -0
- package/dist/chunk-G2GANYMW.js.map +1 -0
- package/dist/chunk-I6DILPFE.js +293 -0
- package/dist/chunk-I6DILPFE.js.map +1 -0
- package/dist/{chunk-HOXFSQUV.js → chunk-IRYU3NTG.js} +2 -2
- package/dist/{chunk-HOXFSQUV.js.map → chunk-IRYU3NTG.js.map} +1 -1
- package/dist/chunk-JTIUGPW5.js +284 -0
- package/dist/chunk-JTIUGPW5.js.map +1 -0
- package/dist/{chunk-GUFHFEPZ.js → chunk-JZBSPDED.js} +2 -2
- package/dist/{chunk-GUFHFEPZ.js.map → chunk-JZBSPDED.js.map} +1 -1
- package/dist/{chunk-PFT2BNYO.js → chunk-KPY7TA4D.js} +5 -5
- package/dist/{chunk-PFT2BNYO.js.map → chunk-KPY7TA4D.js.map} +1 -1
- package/dist/{chunk-GMIE6III.js → chunk-LFWKGNCX.js} +50 -623
- package/dist/chunk-LFWKGNCX.js.map +1 -0
- package/dist/chunk-LH4ZZZYB.js +37 -0
- package/dist/chunk-LH4ZZZYB.js.map +1 -0
- package/dist/chunk-NFJ7CPG3.js +13 -0
- package/dist/chunk-NFJ7CPG3.js.map +1 -0
- package/dist/chunk-NFPOIHD4.js +3 -0
- package/dist/{chunk-JSQTYDPG.js.map → chunk-NFPOIHD4.js.map} +1 -1
- package/dist/{chunk-XIXSSI3B.js → chunk-NJM5AVBM.js} +3 -2
- package/dist/chunk-NJM5AVBM.js.map +1 -0
- package/dist/{chunk-4Z5DE5GK.js → chunk-NSNM53WI.js} +133 -115
- package/dist/chunk-NSNM53WI.js.map +1 -0
- package/dist/chunk-NTREGTG7.js +31 -0
- package/dist/chunk-NTREGTG7.js.map +1 -0
- package/dist/{chunk-ADG4HZEP.js → chunk-OKJA6SJM.js} +4 -4
- package/dist/chunk-OKJA6SJM.js.map +1 -0
- package/dist/{chunk-SU3LVQ7N.js → chunk-Q6JDNFSG.js} +11 -226
- package/dist/chunk-Q6JDNFSG.js.map +1 -0
- package/dist/chunk-RPOGINR5.js +115 -0
- package/dist/chunk-RPOGINR5.js.map +1 -0
- package/dist/{chunk-KQ67XB6T.js → chunk-RSWVYIXK.js} +151 -114
- package/dist/chunk-RSWVYIXK.js.map +1 -0
- package/dist/chunk-SSEHL5VP.js +110 -0
- package/dist/chunk-SSEHL5VP.js.map +1 -0
- package/dist/chunk-TEIGUOWN.js +523 -0
- package/dist/chunk-TEIGUOWN.js.map +1 -0
- package/dist/{chunk-AYYFMTMI.js → chunk-TJ7DHXUX.js} +2 -2
- package/dist/{chunk-AYYFMTMI.js.map → chunk-TJ7DHXUX.js.map} +1 -1
- package/dist/{chunk-75FQ5IW3.js → chunk-TZHWYT34.js} +3 -3
- package/dist/{chunk-75FQ5IW3.js.map → chunk-TZHWYT34.js.map} +1 -1
- package/dist/chunk-TZWHELY4.js +45 -0
- package/dist/chunk-TZWHELY4.js.map +1 -0
- package/dist/{chunk-OKTLA23Q.js → chunk-UEINJFLS.js} +6 -6
- package/dist/chunk-UEINJFLS.js.map +1 -0
- package/dist/chunk-URFQX3I6.js +129 -0
- package/dist/chunk-URFQX3I6.js.map +1 -0
- package/dist/chunk-VG6FOMOH.js +187 -0
- package/dist/chunk-VG6FOMOH.js.map +1 -0
- package/dist/{chunk-PGHEP4JD.js → chunk-VQVVHMPG.js} +3 -3
- package/dist/{chunk-PGHEP4JD.js.map → chunk-VQVVHMPG.js.map} +1 -1
- package/dist/{chunk-DRFNMZLG.js → chunk-VUKOT432.js} +3 -2
- package/dist/chunk-VUKOT432.js.map +1 -0
- package/dist/chunk-WD4N72DL.js +315 -0
- package/dist/chunk-WD4N72DL.js.map +1 -0
- package/dist/chunk-XBYMG4QK.js +119 -0
- package/dist/chunk-XBYMG4QK.js.map +1 -0
- package/dist/chunk-YHM6GIHV.js +3 -0
- package/dist/chunk-YHM6GIHV.js.map +1 -0
- package/dist/{chunk-SNZK5X6F.js → chunk-Z2AN43YU.js} +4 -2
- package/dist/chunk-Z2AN43YU.js.map +1 -0
- package/dist/chunk-ZNWHMQRM.js +171 -0
- package/dist/chunk-ZNWHMQRM.js.map +1 -0
- package/dist/{chunk-YSIG2XYH.js → chunk-ZRJYQN6Y.js} +2 -2
- package/dist/{chunk-YSIG2XYH.js.map → chunk-ZRJYQN6Y.js.map} +1 -1
- package/dist/{chunk-AD4W7HYC.js → chunk-ZYI3MHLE.js} +3 -2
- package/dist/chunk-ZYI3MHLE.js.map +1 -0
- package/dist/cli/index.js +59 -421
- package/dist/cli/index.js.map +1 -1
- package/dist/components/admin-filters/admin-data-table.d.ts +7 -1
- package/dist/components/admin-filters/admin-data-table.d.ts.map +1 -1
- package/dist/components/admin-filters/filter-toolbar.d.ts.map +1 -1
- package/dist/components/admin-filters/index.js +8 -0
- package/dist/components/admin-filters/index.js.map +1 -0
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +5 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/animate/index.js +5 -0
- package/dist/components/animate/index.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/index.js +4 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.css +52 -0
- package/dist/components/chart/index.css.map +1 -0
- package/dist/components/chart/index.js +5 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/chart/types.d.ts +3 -1
- package/dist/components/chart/types.d.ts.map +1 -1
- package/dist/components/chart/use-chart.d.ts.map +1 -1
- package/dist/components/command-palette/command-palette.d.ts +3 -1
- package/dist/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/components/command-palette/index.js +4 -0
- package/dist/components/command-palette/index.js.map +1 -0
- package/dist/components/confirm-dialog/index.js +4 -0
- package/dist/components/confirm-dialog/index.js.map +1 -0
- package/dist/components/date-input/date-input.d.ts +1 -0
- package/dist/components/date-input/date-input.d.ts.map +1 -1
- package/dist/components/date-input/index.d.ts +0 -1
- package/dist/components/date-input/index.d.ts.map +1 -1
- package/dist/components/doc-layout/index.js +5 -4
- package/dist/components/doc-layout/index.js.map +1 -1
- package/dist/components/editor/index.js +4 -3
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/emoji-picker/index.js +2 -1
- package/dist/components/emoji-picker/index.js.map +1 -1
- package/dist/components/empty-content/empty-content.d.ts.map +1 -1
- package/dist/components/empty-content/index.js +4 -0
- package/dist/components/empty-content/index.js.map +1 -0
- package/dist/components/error-boundary/index.js +6 -0
- package/dist/components/error-boundary/index.js.map +1 -0
- package/dist/components/index.css +13 -10
- package/dist/components/index.css.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +47 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/knowledge-graph/edge-labels.d.ts.map +1 -1
- package/dist/components/knowledge-graph/index.js +18 -16
- package/dist/components/knowledge-graph/index.js.map +1 -1
- package/dist/components/label/index.js +5 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/label/label.d.ts.map +1 -1
- package/dist/components/loading-screen/index.js +4 -0
- package/dist/components/loading-screen/index.js.map +1 -0
- package/dist/components/map/MapPointPicker.d.ts.map +1 -1
- package/dist/components/map/index.js +2 -1
- package/dist/components/map/index.js.map +1 -1
- package/dist/components/navigation-progress/index.js +4 -0
- package/dist/components/navigation-progress/index.js.map +1 -0
- package/dist/components/page-content/index.js +4 -0
- package/dist/components/page-content/index.js.map +1 -0
- package/dist/components/popover/index.js +4 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/research/diagram.d.ts.map +1 -1
- package/dist/components/research/index.js +6 -4
- package/dist/components/research/index.js.map +1 -1
- package/dist/components/research-editor/extensions.d.ts +1 -1
- package/dist/components/research-editor/index.js +11 -10
- package/dist/components/research-editor/index.js.map +1 -1
- package/dist/components/research-editor/math-navigation.d.ts +2 -2
- package/dist/components/research-editor/math-navigation.d.ts.map +1 -1
- package/dist/components/scroll-to-top/index.js +4 -0
- package/dist/components/scroll-to-top/index.js.map +1 -0
- package/dist/components/search-input/index.js +7 -0
- package/dist/components/search-input/index.js.map +1 -0
- package/dist/components/search-input/search-input.d.ts +3 -1
- package/dist/components/search-input/search-input.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/snackbar/index.js +6 -0
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/components/stepper/index.js +4 -0
- package/dist/components/stepper/index.js.map +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.js +5 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table-viewport.d.ts +13 -0
- package/dist/components/table/table-viewport.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +12 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/core/index.js +12 -10
- package/dist/core/index.js.map +1 -1
- package/dist/forms/index.js +2 -0
- package/dist/forms/index.js.map +1 -1
- package/dist/hooks/index.js +14 -12
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-config-from-query.d.ts +2 -0
- package/dist/hooks/use-config-from-query.d.ts.map +1 -1
- package/dist/hooks/use-image-dimensions.d.ts.map +1 -1
- package/dist/hooks/use-keyboard-shortcut.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-window-size.d.ts.map +1 -1
- package/dist/icons/context.d.ts.map +1 -1
- package/dist/icons/index.js +3 -2
- package/dist/icons/index.js.map +1 -1
- package/dist/index.css +13 -10
- package/dist/index.css.map +1 -1
- package/dist/index.js +57 -31
- package/dist/index.js.map +1 -1
- package/dist/internal/research-parser.js +3 -0
- package/dist/internal/research-parser.js.map +1 -0
- package/dist/layouts/core/header-section.d.ts +1 -0
- package/dist/layouts/core/header-section.d.ts.map +1 -1
- package/dist/layouts/dashboard/layout.d.ts +3 -1
- package/dist/layouts/dashboard/layout.d.ts.map +1 -1
- package/dist/layouts/dashboard/sidenav.d.ts.map +1 -1
- package/dist/layouts/index.js +9 -8
- package/dist/layouts/index.js.map +1 -1
- package/dist/netron/index.js +2 -1
- package/dist/netron/index.js.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/state/create-store.d.ts.map +1 -1
- package/dist/state/index.js +3 -2
- package/dist/state/index.js.map +1 -1
- package/dist/state/settings-version.d.ts.map +1 -1
- package/dist/theme/components/Chip.d.ts.map +1 -1
- package/dist/theme/components/Dialog.d.ts.map +1 -1
- package/dist/theme/components/TextField.d.ts.map +1 -1
- package/dist/theme/components/index.d.ts.map +1 -1
- package/dist/theme/components/theme-utils.d.ts +2 -2
- package/dist/theme/components/theme-utils.d.ts.map +1 -1
- package/dist/theme/index.js +8 -6
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/overrides.d.ts +1 -0
- package/dist/theme/palette/overrides.d.ts.map +1 -1
- package/dist/theme/semantic-surface.d.ts +8 -0
- package/dist/theme/semantic-surface.d.ts.map +1 -0
- package/dist/types/index.js +2 -2
- package/dist/ui/index.js +6 -5
- package/dist/ui/index.js.map +1 -1
- package/dist/utils/async-lock.d.ts.map +1 -1
- package/package.json +143 -37
- package/dist/chunk-472SOF76.js.map +0 -1
- package/dist/chunk-4Z5DE5GK.js.map +0 -1
- package/dist/chunk-52PQL67Q.js.map +0 -1
- package/dist/chunk-AD4W7HYC.js.map +0 -1
- package/dist/chunk-ADG4HZEP.js.map +0 -1
- package/dist/chunk-BJE2AKD4.js.map +0 -1
- package/dist/chunk-BRDWQVRT.js.map +0 -1
- package/dist/chunk-DRFNMZLG.js.map +0 -1
- package/dist/chunk-FF5RF32O.js.map +0 -1
- package/dist/chunk-FU52GL2E.js +0 -3
- package/dist/chunk-GMIE6III.js.map +0 -1
- package/dist/chunk-JSQTYDPG.js +0 -3
- package/dist/chunk-KQ67XB6T.js.map +0 -1
- package/dist/chunk-LSPFFEJT.js.map +0 -1
- package/dist/chunk-OKTLA23Q.js.map +0 -1
- package/dist/chunk-SNZK5X6F.js.map +0 -1
- package/dist/chunk-SU3LVQ7N.js.map +0 -1
- package/dist/chunk-XIXSSI3B.js.map +0 -1
|
@@ -1,91 +1,57 @@
|
|
|
1
|
-
import { contentClasses, ContentRoot, TipTapRenderer } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import Chip from '@mui/material/Chip';
|
|
11
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
12
|
-
import Box19 from '@mui/material/Box';
|
|
13
|
-
import Button from '@mui/material/Button';
|
|
14
|
-
import Typography5 from '@mui/material/Typography';
|
|
15
|
-
import Badge from '@mui/material/Badge';
|
|
16
|
-
import { styled, alpha, useTheme } from '@mui/material/styles';
|
|
1
|
+
import { contentClasses, ContentRoot, TipTapRenderer } from './chunk-4B2LTPK2.js';
|
|
2
|
+
import { Label } from './chunk-URFQX3I6.js';
|
|
3
|
+
import { cn } from './chunk-2AB7VGPW.js';
|
|
4
|
+
import { createClasses, createComponentClasses } from './chunk-LH4ZZZYB.js';
|
|
5
|
+
import { PRESET_NAMES, PRESET_DISPLAY_NAMES } from './chunk-RSWVYIXK.js';
|
|
6
|
+
import { useSettingsStore } from './chunk-NJM5AVBM.js';
|
|
7
|
+
import { useBoolean } from './chunk-4R7EZ7GQ.js';
|
|
8
|
+
import { ChevronDownIcon, ChevronRightIcon, ZoomOutIcon, ZoomInIcon, FullscreenExitIcon, FullscreenIcon, DownloadIcon, ShareIcon, CloseIcon, ChevronLeftIcon, PlayIcon, ChevronUpIcon } from './chunk-VQVVHMPG.js';
|
|
9
|
+
import { createContext, useState, useCallback, useMemo, useEffect, useRef, Children, useContext, useId } from 'react';
|
|
17
10
|
import dayjs from 'dayjs';
|
|
11
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
12
|
+
import TextField from '@mui/material/TextField';
|
|
18
13
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
23
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
24
|
-
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
25
|
-
import FormHelperText from '@mui/material/FormHelperText';
|
|
26
|
-
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
27
|
-
import { DateCalendar, dateCalendarClasses } from '@mui/x-date-pickers/DateCalendar';
|
|
14
|
+
import Box9 from '@mui/material/Box';
|
|
15
|
+
import Typography5 from '@mui/material/Typography';
|
|
16
|
+
import { styled, alpha, useTheme } from '@mui/material/styles';
|
|
28
17
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
29
|
-
import MuiTable from '@mui/material/Table';
|
|
30
|
-
import TableBody from '@mui/material/TableBody';
|
|
31
|
-
import TableCell from '@mui/material/TableCell';
|
|
32
|
-
import TableContainer from '@mui/material/TableContainer';
|
|
33
|
-
import TableHead from '@mui/material/TableHead';
|
|
34
|
-
import TableRow from '@mui/material/TableRow';
|
|
35
|
-
import TableSortLabel from '@mui/material/TableSortLabel';
|
|
36
|
-
import TablePagination from '@mui/material/TablePagination';
|
|
37
|
-
import Paper from '@mui/material/Paper';
|
|
38
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
39
|
-
import Skeleton3 from '@mui/material/Skeleton';
|
|
40
|
-
import Autocomplete from '@mui/material/Autocomplete';
|
|
41
|
-
import { LazyMotion, domMax, useMotionValue, useAnimationFrame, useTransform, useMotionTemplate, m } from 'framer-motion';
|
|
42
18
|
import MuiAvatar from '@mui/material/Avatar';
|
|
43
19
|
import AvatarGroup from '@mui/material/AvatarGroup';
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import CardContent from '@mui/material/CardContent';
|
|
47
|
-
import CardActions from '@mui/material/CardActions';
|
|
48
|
-
import DialogContentText from '@mui/material/DialogContentText';
|
|
20
|
+
import MuiBadge from '@mui/material/Badge';
|
|
21
|
+
import Card from '@mui/material/Card';
|
|
49
22
|
import CardActionArea from '@mui/material/CardActionArea';
|
|
23
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
50
24
|
import Tooltip2 from '@mui/material/Tooltip';
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
25
|
+
import IconButton2 from '@mui/material/IconButton';
|
|
26
|
+
import Chip2 from '@mui/material/Chip';
|
|
27
|
+
import Stack2 from '@mui/material/Stack';
|
|
55
28
|
import List from '@mui/material/List';
|
|
56
29
|
import ListItemButton from '@mui/material/ListItemButton';
|
|
57
30
|
import ListItemText from '@mui/material/ListItemText';
|
|
58
|
-
import
|
|
59
|
-
import
|
|
31
|
+
import MuiLinearProgress from '@mui/material/LinearProgress';
|
|
32
|
+
import MuiCircularProgress from '@mui/material/CircularProgress';
|
|
60
33
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
61
|
-
import Divider3 from '@mui/material/Divider';
|
|
62
|
-
import MuiTabs from '@mui/material/Tabs';
|
|
63
|
-
import MuiTab from '@mui/material/Tab';
|
|
64
34
|
import MuiAccordion from '@mui/material/Accordion';
|
|
65
35
|
import MuiAccordionSummary from '@mui/material/AccordionSummary';
|
|
66
36
|
import MuiAccordionDetails from '@mui/material/AccordionDetails';
|
|
67
37
|
import MuiMenu from '@mui/material/Menu';
|
|
38
|
+
import MenuItem2 from '@mui/material/MenuItem';
|
|
68
39
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
69
|
-
import
|
|
40
|
+
import Divider2 from '@mui/material/Divider';
|
|
70
41
|
import Drawer from '@mui/material/Drawer';
|
|
42
|
+
import Button from '@mui/material/Button';
|
|
71
43
|
import Switch from '@mui/material/Switch';
|
|
72
44
|
import Slider from '@mui/material/Slider';
|
|
73
45
|
import ToggleButton from '@mui/material/ToggleButton';
|
|
74
46
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
75
47
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
|
|
79
|
-
import Link from '@mui/material/Link';
|
|
80
|
-
import SvgIcon from '@mui/material/SvgIcon';
|
|
81
|
-
import MuiStepper from '@mui/material/Stepper';
|
|
82
|
-
import Step from '@mui/material/Step';
|
|
83
|
-
import StepLabel from '@mui/material/StepLabel';
|
|
84
|
-
import StepContent from '@mui/material/StepContent';
|
|
85
|
-
import { clsx } from 'clsx';
|
|
48
|
+
import CardContent from '@mui/material/CardContent';
|
|
49
|
+
import Dialog from '@mui/material/Dialog';
|
|
86
50
|
import ButtonBase from '@mui/material/ButtonBase';
|
|
87
51
|
import Collapse from '@mui/material/Collapse';
|
|
88
52
|
import Popover from '@mui/material/Popover';
|
|
53
|
+
import Paper from '@mui/material/Paper';
|
|
54
|
+
import Link from '@mui/material/Link';
|
|
89
55
|
import ReactMarkdown from 'react-markdown';
|
|
90
56
|
import rehypeRaw from 'rehype-raw';
|
|
91
57
|
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
@@ -94,1196 +60,6 @@ import remarkGfm from 'remark-gfm';
|
|
|
94
60
|
import TurndownService from 'turndown';
|
|
95
61
|
import Select from '@mui/material/Select';
|
|
96
62
|
|
|
97
|
-
function DateRangePicker({
|
|
98
|
-
open,
|
|
99
|
-
error,
|
|
100
|
-
onClose,
|
|
101
|
-
onSubmit,
|
|
102
|
-
startDate,
|
|
103
|
-
endDate,
|
|
104
|
-
onChangeStartDate,
|
|
105
|
-
onChangeEndDate,
|
|
106
|
-
slotProps,
|
|
107
|
-
variant = "input",
|
|
108
|
-
title,
|
|
109
|
-
translations,
|
|
110
|
-
// Exclude hook props that shouldn't go to Dialog
|
|
111
|
-
selected: _selected,
|
|
112
|
-
label: _label,
|
|
113
|
-
shortLabel: _shortLabel,
|
|
114
|
-
onOpen: _onOpen,
|
|
115
|
-
onReset: _onReset,
|
|
116
|
-
setStartDate: _setStartDate,
|
|
117
|
-
setEndDate: _setEndDate,
|
|
118
|
-
...other
|
|
119
|
-
}) {
|
|
120
|
-
const txTitle = translations?.title ?? title ?? "Select date range";
|
|
121
|
-
const txStart = translations?.startDate ?? "Start date";
|
|
122
|
-
const txEnd = translations?.endDate ?? "End date";
|
|
123
|
-
const txErrorRange = translations?.errorRange ?? "End date cannot be earlier than start date";
|
|
124
|
-
const txCancel = translations?.cancel ?? "Cancel";
|
|
125
|
-
const txApply = translations?.apply ?? "Apply";
|
|
126
|
-
const mdUp = useMediaQuery((theme) => theme.breakpoints.up("md"));
|
|
127
|
-
const isCalendarView = mdUp && variant === "calendar";
|
|
128
|
-
const handleSubmit = useCallback(() => {
|
|
129
|
-
onClose({}, "backdropClick");
|
|
130
|
-
onSubmit?.();
|
|
131
|
-
}, [onClose, onSubmit]);
|
|
132
|
-
const handleClose = useCallback(() => {
|
|
133
|
-
onClose({}, "backdropClick");
|
|
134
|
-
}, [onClose]);
|
|
135
|
-
const dialogPaperSx = slotProps?.paper?.sx;
|
|
136
|
-
return /* @__PURE__ */ jsxs(
|
|
137
|
-
Dialog,
|
|
138
|
-
{
|
|
139
|
-
fullWidth: true,
|
|
140
|
-
open,
|
|
141
|
-
onClose,
|
|
142
|
-
maxWidth: isCalendarView ? false : "xs",
|
|
143
|
-
slotProps: {
|
|
144
|
-
...slotProps,
|
|
145
|
-
paper: {
|
|
146
|
-
...slotProps?.paper,
|
|
147
|
-
sx: [
|
|
148
|
-
{ ...isCalendarView && { maxWidth: 720 } },
|
|
149
|
-
...Array.isArray(dialogPaperSx) ? dialogPaperSx : dialogPaperSx ? [dialogPaperSx] : []
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
...other,
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: txTitle }),
|
|
156
|
-
/* @__PURE__ */ jsxs(
|
|
157
|
-
DialogContent,
|
|
158
|
-
{
|
|
159
|
-
sx: [
|
|
160
|
-
(theme) => ({
|
|
161
|
-
gap: 3,
|
|
162
|
-
display: "flex",
|
|
163
|
-
overflow: "unset",
|
|
164
|
-
flexDirection: isCalendarView ? "row" : "column",
|
|
165
|
-
[`& .${dateCalendarClasses.root}`]: {
|
|
166
|
-
borderRadius: 2,
|
|
167
|
-
border: `dashed 1px ${theme.palette.divider}`
|
|
168
|
-
}
|
|
169
|
-
})
|
|
170
|
-
],
|
|
171
|
-
children: [
|
|
172
|
-
isCalendarView ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
173
|
-
/* @__PURE__ */ jsx(DateCalendar, { value: startDate, onChange: onChangeStartDate }),
|
|
174
|
-
/* @__PURE__ */ jsx(DateCalendar, { value: endDate, onChange: onChangeEndDate })
|
|
175
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
176
|
-
/* @__PURE__ */ jsx(DatePicker, { label: txStart, value: startDate, onChange: onChangeStartDate }),
|
|
177
|
-
/* @__PURE__ */ jsx(DatePicker, { label: txEnd, value: endDate, onChange: onChangeEndDate })
|
|
178
|
-
] }),
|
|
179
|
-
error && /* @__PURE__ */ jsx(FormHelperText, { error: true, sx: { px: 2 }, children: txErrorRange })
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
184
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "inherit", onClick: handleClose, children: txCancel }),
|
|
185
|
-
/* @__PURE__ */ jsx(Button, { disabled: error, variant: "contained", onClick: handleSubmit, children: txApply })
|
|
186
|
-
] })
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
function CalendarIcon() {
|
|
192
|
-
return /* @__PURE__ */ jsxs(
|
|
193
|
-
"svg",
|
|
194
|
-
{
|
|
195
|
-
width: "18",
|
|
196
|
-
height: "18",
|
|
197
|
-
viewBox: "0 0 24 24",
|
|
198
|
-
fill: "none",
|
|
199
|
-
stroke: "currentColor",
|
|
200
|
-
strokeWidth: "1.5",
|
|
201
|
-
strokeLinecap: "round",
|
|
202
|
-
strokeLinejoin: "round",
|
|
203
|
-
children: [
|
|
204
|
-
/* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
205
|
-
/* @__PURE__ */ jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
206
|
-
/* @__PURE__ */ jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
207
|
-
/* @__PURE__ */ jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
function ClearIcon() {
|
|
213
|
-
return /* @__PURE__ */ jsxs(
|
|
214
|
-
"svg",
|
|
215
|
-
{
|
|
216
|
-
width: "14",
|
|
217
|
-
height: "14",
|
|
218
|
-
viewBox: "0 0 24 24",
|
|
219
|
-
fill: "none",
|
|
220
|
-
stroke: "currentColor",
|
|
221
|
-
strokeWidth: "2",
|
|
222
|
-
strokeLinecap: "round",
|
|
223
|
-
strokeLinejoin: "round",
|
|
224
|
-
children: [
|
|
225
|
-
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
226
|
-
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
function toDayjs(value) {
|
|
232
|
-
if (!value) return null;
|
|
233
|
-
const d = dayjs(value);
|
|
234
|
-
return d.isValid() ? d : null;
|
|
235
|
-
}
|
|
236
|
-
function toIso(value) {
|
|
237
|
-
if (!value || !value.isValid()) return "";
|
|
238
|
-
return value.format("YYYY-MM-DD");
|
|
239
|
-
}
|
|
240
|
-
function formatLabel(start, end, fromPrefix, toPrefix) {
|
|
241
|
-
if (!start && !end) return "";
|
|
242
|
-
const s = toDayjs(start);
|
|
243
|
-
const e = toDayjs(end);
|
|
244
|
-
if (s && e) {
|
|
245
|
-
if (s.isSame(e, "day")) return e.format("DD MMM YYYY");
|
|
246
|
-
if (s.isSame(e, "month")) return `${s.format("DD")} \u2013 ${e.format("DD MMM YYYY")}`;
|
|
247
|
-
if (s.isSame(e, "year")) return `${s.format("DD MMM")} \u2013 ${e.format("DD MMM YYYY")}`;
|
|
248
|
-
return `${s.format("DD MMM YYYY")} \u2013 ${e.format("DD MMM YYYY")}`;
|
|
249
|
-
}
|
|
250
|
-
if (s) return `${fromPrefix} ${s.format("DD MMM YYYY")}`;
|
|
251
|
-
if (e) return `${toPrefix} ${e.format("DD MMM YYYY")}`;
|
|
252
|
-
return "";
|
|
253
|
-
}
|
|
254
|
-
function DateRangeInput({
|
|
255
|
-
label = "Date range",
|
|
256
|
-
startDate,
|
|
257
|
-
endDate,
|
|
258
|
-
onChange,
|
|
259
|
-
width = 220,
|
|
260
|
-
variant = "input",
|
|
261
|
-
size = "small",
|
|
262
|
-
translations,
|
|
263
|
-
pickerTranslations
|
|
264
|
-
}) {
|
|
265
|
-
const [open, setOpen] = useState(false);
|
|
266
|
-
const [tempStart, setTempStart] = useState(toDayjs(startDate));
|
|
267
|
-
const [tempEnd, setTempEnd] = useState(toDayjs(endDate));
|
|
268
|
-
const txPlaceholder = translations?.placeholder ?? "Select dates...";
|
|
269
|
-
const txFrom = translations?.from ?? "From";
|
|
270
|
-
const txTo = translations?.to ?? "To";
|
|
271
|
-
const txClear = translations?.clear ?? "Clear date range";
|
|
272
|
-
const displayLabel = useMemo(
|
|
273
|
-
() => formatLabel(startDate, endDate, txFrom, txTo),
|
|
274
|
-
[startDate, endDate, txFrom, txTo]
|
|
275
|
-
);
|
|
276
|
-
const hasValue = !!startDate || !!endDate;
|
|
277
|
-
const handleOpen = useCallback(() => {
|
|
278
|
-
setTempStart(toDayjs(startDate));
|
|
279
|
-
setTempEnd(toDayjs(endDate));
|
|
280
|
-
setOpen(true);
|
|
281
|
-
}, [startDate, endDate]);
|
|
282
|
-
const handleClose = useCallback(() => {
|
|
283
|
-
setOpen(false);
|
|
284
|
-
}, []);
|
|
285
|
-
const handleSubmit = useCallback(() => {
|
|
286
|
-
onChange(toIso(tempStart), toIso(tempEnd));
|
|
287
|
-
setOpen(false);
|
|
288
|
-
}, [tempStart, tempEnd, onChange]);
|
|
289
|
-
const handleClear = useCallback(
|
|
290
|
-
(e) => {
|
|
291
|
-
e.stopPropagation();
|
|
292
|
-
onChange("", "");
|
|
293
|
-
},
|
|
294
|
-
[onChange]
|
|
295
|
-
);
|
|
296
|
-
const error = !!(tempStart && tempEnd && tempStart.isAfter(tempEnd));
|
|
297
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
298
|
-
/* @__PURE__ */ jsx(
|
|
299
|
-
TextField2,
|
|
300
|
-
{
|
|
301
|
-
size,
|
|
302
|
-
label,
|
|
303
|
-
value: displayLabel,
|
|
304
|
-
placeholder: txPlaceholder,
|
|
305
|
-
onClick: handleOpen,
|
|
306
|
-
slotProps: {
|
|
307
|
-
input: {
|
|
308
|
-
readOnly: true,
|
|
309
|
-
sx: { cursor: "pointer" },
|
|
310
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { color: "text.disabled" }, children: /* @__PURE__ */ jsx(CalendarIcon, {}) }),
|
|
311
|
-
...hasValue && {
|
|
312
|
-
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconButton4, { size: "small", onClick: handleClear, "aria-label": txClear, sx: { p: 0.25 }, children: /* @__PURE__ */ jsx(ClearIcon, {}) }) })
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
inputLabel: { shrink: true }
|
|
316
|
-
},
|
|
317
|
-
sx: {
|
|
318
|
-
minWidth: width,
|
|
319
|
-
"& .MuiOutlinedInput-root": { borderRadius: 1 },
|
|
320
|
-
"& .MuiInputBase-input": { cursor: "pointer" }
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
),
|
|
324
|
-
/* @__PURE__ */ jsx(
|
|
325
|
-
DateRangePicker,
|
|
326
|
-
{
|
|
327
|
-
open,
|
|
328
|
-
error,
|
|
329
|
-
onClose: handleClose,
|
|
330
|
-
onSubmit: handleSubmit,
|
|
331
|
-
startDate: tempStart,
|
|
332
|
-
endDate: tempEnd,
|
|
333
|
-
onChangeStartDate: setTempStart,
|
|
334
|
-
onChangeEndDate: setTempEnd,
|
|
335
|
-
variant,
|
|
336
|
-
translations: pickerTranslations,
|
|
337
|
-
selected: !!(tempStart && tempEnd),
|
|
338
|
-
label: "",
|
|
339
|
-
shortLabel: "",
|
|
340
|
-
onOpen: handleOpen,
|
|
341
|
-
onReset: () => {
|
|
342
|
-
setTempStart(null);
|
|
343
|
-
setTempEnd(null);
|
|
344
|
-
},
|
|
345
|
-
setStartDate: setTempStart,
|
|
346
|
-
setEndDate: setTempEnd
|
|
347
|
-
}
|
|
348
|
-
)
|
|
349
|
-
] });
|
|
350
|
-
}
|
|
351
|
-
function useDebounce(value, delay) {
|
|
352
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
353
|
-
useEffect(() => {
|
|
354
|
-
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
355
|
-
return () => clearTimeout(timer);
|
|
356
|
-
}, [value, delay]);
|
|
357
|
-
return debouncedValue;
|
|
358
|
-
}
|
|
359
|
-
function isFilterActive(config, value) {
|
|
360
|
-
if (value === void 0 || value === null || value === "") return false;
|
|
361
|
-
if (Array.isArray(value) && value.length === 0) return false;
|
|
362
|
-
if (config.type === "boolean" && value === false) return false;
|
|
363
|
-
if (config.type === "select" && value === "") return false;
|
|
364
|
-
return true;
|
|
365
|
-
}
|
|
366
|
-
function FilterToolbar({
|
|
367
|
-
filters,
|
|
368
|
-
values,
|
|
369
|
-
onChange,
|
|
370
|
-
onReset,
|
|
371
|
-
total,
|
|
372
|
-
searchDebounce = 300,
|
|
373
|
-
compact = false,
|
|
374
|
-
sx,
|
|
375
|
-
resetLabel = "Reset",
|
|
376
|
-
resultsLabel
|
|
377
|
-
}) {
|
|
378
|
-
const [, startTransition] = useTransition();
|
|
379
|
-
const searchFilter = filters.find((f) => f.type === "search");
|
|
380
|
-
const [localSearch, setLocalSearch] = useState(values[searchFilter?.key ?? "search"] ?? "");
|
|
381
|
-
const debouncedSearch = useDebounce(localSearch, searchDebounce);
|
|
382
|
-
const prevDebouncedRef = useRef(debouncedSearch);
|
|
383
|
-
useEffect(() => {
|
|
384
|
-
if (debouncedSearch !== prevDebouncedRef.current) {
|
|
385
|
-
prevDebouncedRef.current = debouncedSearch;
|
|
386
|
-
const key = searchFilter?.key ?? "search";
|
|
387
|
-
startTransition(() => {
|
|
388
|
-
onChange({ ...values, [key]: debouncedSearch });
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}, [debouncedSearch, searchFilter?.key, onChange, values]);
|
|
392
|
-
const searchValue = values[searchFilter?.key ?? "search"] ?? "";
|
|
393
|
-
useEffect(() => {
|
|
394
|
-
if (searchValue === prevDebouncedRef.current) return;
|
|
395
|
-
prevDebouncedRef.current = searchValue;
|
|
396
|
-
setLocalSearch(searchValue);
|
|
397
|
-
}, [searchValue]);
|
|
398
|
-
const activeCount = useMemo(
|
|
399
|
-
() => filters.filter((f) => f.type !== "search" && isFilterActive(f, values[f.key])).length,
|
|
400
|
-
[filters, values]
|
|
401
|
-
);
|
|
402
|
-
const hasAnyActive = useMemo(
|
|
403
|
-
() => filters.some((f) => isFilterActive(f, f.type === "search" ? localSearch : values[f.key])),
|
|
404
|
-
[filters, values, localSearch]
|
|
405
|
-
);
|
|
406
|
-
const handleChange = useCallback(
|
|
407
|
-
(key, value) => {
|
|
408
|
-
startTransition(() => {
|
|
409
|
-
onChange({ ...values, [key]: value });
|
|
410
|
-
});
|
|
411
|
-
},
|
|
412
|
-
[onChange, values]
|
|
413
|
-
);
|
|
414
|
-
const handleReset = useCallback(() => {
|
|
415
|
-
setLocalSearch("");
|
|
416
|
-
if (onReset) {
|
|
417
|
-
onReset();
|
|
418
|
-
} else {
|
|
419
|
-
const resetValues = {};
|
|
420
|
-
for (const f of filters) {
|
|
421
|
-
if (f.type === "search") resetValues[f.key] = "";
|
|
422
|
-
else if (f.type === "multi-select") resetValues[f.key] = [];
|
|
423
|
-
else if (f.type === "boolean") resetValues[f.key] = false;
|
|
424
|
-
else if (f.type === "date-range") {
|
|
425
|
-
resetValues[`${f.key}From`] = "";
|
|
426
|
-
resetValues[`${f.key}To`] = "";
|
|
427
|
-
} else if (f.type === "number-range") {
|
|
428
|
-
resetValues[`${f.key}Min`] = "";
|
|
429
|
-
resetValues[`${f.key}Max`] = "";
|
|
430
|
-
} else {
|
|
431
|
-
resetValues[f.key] = "";
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
onChange(resetValues);
|
|
435
|
-
}
|
|
436
|
-
}, [onReset, onChange, filters]);
|
|
437
|
-
const renderFilter = useCallback(
|
|
438
|
-
(config) => {
|
|
439
|
-
const { key, type, label, placeholder, options, width } = config;
|
|
440
|
-
switch (type) {
|
|
441
|
-
case "search":
|
|
442
|
-
return /* @__PURE__ */ jsx(
|
|
443
|
-
SearchInput,
|
|
444
|
-
{
|
|
445
|
-
value: localSearch,
|
|
446
|
-
onChange: setLocalSearch,
|
|
447
|
-
placeholder: placeholder ?? "Search...",
|
|
448
|
-
fullWidth: false,
|
|
449
|
-
minWidth: width ?? 220
|
|
450
|
-
},
|
|
451
|
-
key
|
|
452
|
-
);
|
|
453
|
-
case "select":
|
|
454
|
-
return /* @__PURE__ */ jsxs(
|
|
455
|
-
TextField2,
|
|
456
|
-
{
|
|
457
|
-
select: true,
|
|
458
|
-
size: "small",
|
|
459
|
-
value: values[key] ?? "",
|
|
460
|
-
onChange: (e) => handleChange(key, e.target.value),
|
|
461
|
-
slotProps: { select: { displayEmpty: true, "aria-label": label } },
|
|
462
|
-
sx: {
|
|
463
|
-
minWidth: width ?? 150,
|
|
464
|
-
"& .MuiOutlinedInput-root": { borderRadius: 1 },
|
|
465
|
-
"& .MuiOutlinedInput-notchedOutline legend": { width: 0 }
|
|
466
|
-
},
|
|
467
|
-
children: [
|
|
468
|
-
/* @__PURE__ */ jsx(MenuItem, { value: "", children: /* @__PURE__ */ jsx(
|
|
469
|
-
Typography5,
|
|
470
|
-
{
|
|
471
|
-
variant: "body2",
|
|
472
|
-
sx: {
|
|
473
|
-
color: "text.secondary"
|
|
474
|
-
},
|
|
475
|
-
children: label
|
|
476
|
-
}
|
|
477
|
-
) }),
|
|
478
|
-
options?.map((opt) => /* @__PURE__ */ jsx(MenuItem, { value: opt.value, children: opt.label }, opt.value))
|
|
479
|
-
]
|
|
480
|
-
},
|
|
481
|
-
key
|
|
482
|
-
);
|
|
483
|
-
case "multi-select": {
|
|
484
|
-
const selectedValues = values[key] ?? [];
|
|
485
|
-
return /* @__PURE__ */ jsx(
|
|
486
|
-
TextField2,
|
|
487
|
-
{
|
|
488
|
-
select: true,
|
|
489
|
-
size: "small",
|
|
490
|
-
value: selectedValues,
|
|
491
|
-
onChange: (e) => handleChange(key, e.target.value),
|
|
492
|
-
slotProps: {
|
|
493
|
-
select: {
|
|
494
|
-
multiple: true,
|
|
495
|
-
displayEmpty: true,
|
|
496
|
-
// Same reason as the single select above: the label lives in
|
|
497
|
-
// `renderValue` as placeholder text, leaving the control
|
|
498
|
-
// without an accessible name.
|
|
499
|
-
"aria-label": label,
|
|
500
|
-
renderValue: (selected) => {
|
|
501
|
-
const sel = selected;
|
|
502
|
-
if (sel.length === 0) {
|
|
503
|
-
return /* @__PURE__ */ jsx(
|
|
504
|
-
Typography5,
|
|
505
|
-
{
|
|
506
|
-
variant: "body2",
|
|
507
|
-
sx: {
|
|
508
|
-
color: "text.secondary"
|
|
509
|
-
},
|
|
510
|
-
children: label
|
|
511
|
-
}
|
|
512
|
-
);
|
|
513
|
-
}
|
|
514
|
-
return /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 0.5, sx: { overflow: "hidden" }, children: sel.map((val) => {
|
|
515
|
-
const opt = options?.find((o) => o.value === val);
|
|
516
|
-
return /* @__PURE__ */ jsx(
|
|
517
|
-
Chip,
|
|
518
|
-
{
|
|
519
|
-
label: opt?.label ?? val,
|
|
520
|
-
size: "small",
|
|
521
|
-
sx: { height: 20, fontSize: "0.75rem" }
|
|
522
|
-
},
|
|
523
|
-
val
|
|
524
|
-
);
|
|
525
|
-
}) });
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
|
-
sx: {
|
|
530
|
-
minWidth: width ?? 180,
|
|
531
|
-
"& .MuiOutlinedInput-root": { borderRadius: 1 },
|
|
532
|
-
"& .MuiOutlinedInput-notchedOutline legend": { width: 0 }
|
|
533
|
-
},
|
|
534
|
-
children: options?.map((opt) => /* @__PURE__ */ jsx(MenuItem, { value: opt.value, children: opt.label }, opt.value))
|
|
535
|
-
},
|
|
536
|
-
key
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
case "date-range":
|
|
540
|
-
return /* @__PURE__ */ jsx(
|
|
541
|
-
DateRangeInput,
|
|
542
|
-
{
|
|
543
|
-
label,
|
|
544
|
-
startDate: values[`${key}From`] ?? "",
|
|
545
|
-
endDate: values[`${key}To`] ?? "",
|
|
546
|
-
onChange: (from, to) => {
|
|
547
|
-
handleChange(`${key}From`, from);
|
|
548
|
-
handleChange(`${key}To`, to);
|
|
549
|
-
},
|
|
550
|
-
width: width ?? 220,
|
|
551
|
-
size: "small"
|
|
552
|
-
},
|
|
553
|
-
key
|
|
554
|
-
);
|
|
555
|
-
case "boolean":
|
|
556
|
-
return /* @__PURE__ */ jsx(
|
|
557
|
-
Chip,
|
|
558
|
-
{
|
|
559
|
-
label,
|
|
560
|
-
variant: values[key] ? "filled" : "outlined",
|
|
561
|
-
color: values[key] ? "primary" : "default",
|
|
562
|
-
onClick: () => handleChange(key, !values[key]),
|
|
563
|
-
size: "small",
|
|
564
|
-
sx: {
|
|
565
|
-
borderRadius: 1,
|
|
566
|
-
fontWeight: 500,
|
|
567
|
-
height: 32,
|
|
568
|
-
cursor: "pointer",
|
|
569
|
-
transition: (theme) => theme.transitions.create(["background-color", "color", "border-color"], {
|
|
570
|
-
duration: theme.transitions.duration.shorter
|
|
571
|
-
})
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
key
|
|
575
|
-
);
|
|
576
|
-
case "number-range":
|
|
577
|
-
return /* @__PURE__ */ jsxs(
|
|
578
|
-
Stack,
|
|
579
|
-
{
|
|
580
|
-
direction: "row",
|
|
581
|
-
spacing: 1,
|
|
582
|
-
sx: {
|
|
583
|
-
alignItems: "center"
|
|
584
|
-
},
|
|
585
|
-
children: [
|
|
586
|
-
/* @__PURE__ */ jsx(
|
|
587
|
-
TextField2,
|
|
588
|
-
{
|
|
589
|
-
type: "number",
|
|
590
|
-
size: "small",
|
|
591
|
-
label: `${label} min`,
|
|
592
|
-
value: values[`${key}Min`] ?? "",
|
|
593
|
-
onChange: (e) => handleChange(`${key}Min`, e.target.value),
|
|
594
|
-
sx: { minWidth: width ?? 100 }
|
|
595
|
-
}
|
|
596
|
-
),
|
|
597
|
-
/* @__PURE__ */ jsx(
|
|
598
|
-
Typography5,
|
|
599
|
-
{
|
|
600
|
-
variant: "body2",
|
|
601
|
-
sx: {
|
|
602
|
-
color: "text.disabled",
|
|
603
|
-
px: 0.5
|
|
604
|
-
},
|
|
605
|
-
children: "\u2014"
|
|
606
|
-
}
|
|
607
|
-
),
|
|
608
|
-
/* @__PURE__ */ jsx(
|
|
609
|
-
TextField2,
|
|
610
|
-
{
|
|
611
|
-
type: "number",
|
|
612
|
-
size: "small",
|
|
613
|
-
label: `${label} max`,
|
|
614
|
-
value: values[`${key}Max`] ?? "",
|
|
615
|
-
onChange: (e) => handleChange(`${key}Max`, e.target.value),
|
|
616
|
-
sx: { minWidth: width ?? 100 }
|
|
617
|
-
}
|
|
618
|
-
)
|
|
619
|
-
]
|
|
620
|
-
},
|
|
621
|
-
key
|
|
622
|
-
);
|
|
623
|
-
default:
|
|
624
|
-
return null;
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
|
-
[localSearch, values, handleChange]
|
|
628
|
-
);
|
|
629
|
-
return /* @__PURE__ */ jsxs(
|
|
630
|
-
Stack,
|
|
631
|
-
{
|
|
632
|
-
spacing: compact ? 0 : 1.5,
|
|
633
|
-
sx: {
|
|
634
|
-
p: 2,
|
|
635
|
-
borderRadius: 1,
|
|
636
|
-
border: (theme) => `1px solid ${theme.palette.divider}`,
|
|
637
|
-
bgcolor: (theme) => alpha(theme.palette.background.default, 0.5),
|
|
638
|
-
...sx
|
|
639
|
-
},
|
|
640
|
-
children: [
|
|
641
|
-
/* @__PURE__ */ jsxs(
|
|
642
|
-
Stack,
|
|
643
|
-
{
|
|
644
|
-
direction: "row",
|
|
645
|
-
sx: {
|
|
646
|
-
alignItems: "center",
|
|
647
|
-
flexWrap: "wrap",
|
|
648
|
-
gap: 1.5
|
|
649
|
-
},
|
|
650
|
-
children: [
|
|
651
|
-
filters.map(renderFilter),
|
|
652
|
-
/* @__PURE__ */ jsxs(
|
|
653
|
-
Stack,
|
|
654
|
-
{
|
|
655
|
-
direction: "row",
|
|
656
|
-
spacing: 1,
|
|
657
|
-
sx: {
|
|
658
|
-
alignItems: "center",
|
|
659
|
-
ml: "auto"
|
|
660
|
-
},
|
|
661
|
-
children: [
|
|
662
|
-
activeCount > 0 && /* @__PURE__ */ jsx(Badge, { badgeContent: activeCount, color: "primary", sx: { "& .MuiBadge-badge": { fontSize: "0.65rem" } }, children: /* @__PURE__ */ jsx(Box19, { sx: { color: "text.secondary", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(FilterIcon, {}) }) }),
|
|
663
|
-
hasAnyActive && /* @__PURE__ */ jsx(
|
|
664
|
-
Button,
|
|
665
|
-
{
|
|
666
|
-
size: "small",
|
|
667
|
-
onClick: handleReset,
|
|
668
|
-
sx: {
|
|
669
|
-
minWidth: 0,
|
|
670
|
-
px: 1.5,
|
|
671
|
-
fontSize: "0.75rem",
|
|
672
|
-
fontWeight: 500,
|
|
673
|
-
color: "text.secondary",
|
|
674
|
-
"&:hover": { color: "text.primary" }
|
|
675
|
-
},
|
|
676
|
-
children: resetLabel
|
|
677
|
-
}
|
|
678
|
-
)
|
|
679
|
-
]
|
|
680
|
-
}
|
|
681
|
-
)
|
|
682
|
-
]
|
|
683
|
-
}
|
|
684
|
-
),
|
|
685
|
-
total !== void 0 && !compact && /* @__PURE__ */ jsx(
|
|
686
|
-
Typography5,
|
|
687
|
-
{
|
|
688
|
-
variant: "caption",
|
|
689
|
-
sx: {
|
|
690
|
-
color: "text.disabled",
|
|
691
|
-
mt: 0.5
|
|
692
|
-
},
|
|
693
|
-
children: resultsLabel ? resultsLabel(total) : `${total.toLocaleString()} result${total !== 1 ? "s" : ""}`
|
|
694
|
-
}
|
|
695
|
-
)
|
|
696
|
-
]
|
|
697
|
-
}
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
var StyledTableContainer = styled(Paper)(({ theme }) => ({
|
|
701
|
-
borderRadius: theme.shape.borderRadius,
|
|
702
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
703
|
-
overflow: "auto"
|
|
704
|
-
}));
|
|
705
|
-
var StyledTableHead = styled(TableHead)(({ theme }) => ({
|
|
706
|
-
backgroundColor: alpha(theme.palette.grey[500], 0.08),
|
|
707
|
-
"& .MuiTableCell-head": {
|
|
708
|
-
fontWeight: 600,
|
|
709
|
-
fontSize: theme.typography.pxToRem(13),
|
|
710
|
-
color: theme.palette.text.secondary,
|
|
711
|
-
backgroundColor: "transparent",
|
|
712
|
-
whiteSpace: "nowrap",
|
|
713
|
-
borderBottom: `1px solid ${theme.palette.divider}`
|
|
714
|
-
}
|
|
715
|
-
}));
|
|
716
|
-
var StyledTableRow = styled(TableRow)(({ theme }) => ({
|
|
717
|
-
transition: theme.transitions.create("background-color", {
|
|
718
|
-
duration: theme.transitions.duration.shortest
|
|
719
|
-
}),
|
|
720
|
-
// `:nth-child(even)` for zebra-striping — table rows are homogeneous
|
|
721
|
-
// siblings, so child-position is equivalent to of-type but doesn't
|
|
722
|
-
// assume the rendered tag never changes (e.g. a row replaced by a
|
|
723
|
-
// skeleton placeholder still alternates correctly).
|
|
724
|
-
"&:nth-child(even)": {
|
|
725
|
-
backgroundColor: alpha(theme.palette.grey[500], 0.02)
|
|
726
|
-
},
|
|
727
|
-
"&:hover": {
|
|
728
|
-
backgroundColor: alpha(theme.palette.primary.main, 0.04)
|
|
729
|
-
},
|
|
730
|
-
"& .MuiTableCell-body": {
|
|
731
|
-
borderBottom: `1px solid ${alpha(theme.palette.divider, 0.6)}`
|
|
732
|
-
}
|
|
733
|
-
}));
|
|
734
|
-
var EMPTY_SELECTION = /* @__PURE__ */ new Set();
|
|
735
|
-
function AdminDataTable({
|
|
736
|
-
columns,
|
|
737
|
-
data,
|
|
738
|
-
total,
|
|
739
|
-
loading = false,
|
|
740
|
-
loadingRows = 5,
|
|
741
|
-
page,
|
|
742
|
-
pageSize,
|
|
743
|
-
onPageChange,
|
|
744
|
-
onPageSizeChange,
|
|
745
|
-
sortBy,
|
|
746
|
-
sortOrder = "asc",
|
|
747
|
-
onSort,
|
|
748
|
-
emptyMessage = "No data found",
|
|
749
|
-
loadError = null,
|
|
750
|
-
loadErrorLabels,
|
|
751
|
-
rowKey,
|
|
752
|
-
onRowClick,
|
|
753
|
-
rowSx,
|
|
754
|
-
renderExpanded,
|
|
755
|
-
pageSizeOptions = [10, 25, 50, 100],
|
|
756
|
-
stickyHeader = false,
|
|
757
|
-
dense = false,
|
|
758
|
-
maxHeight,
|
|
759
|
-
paginationLabels,
|
|
760
|
-
sx,
|
|
761
|
-
selectable = false,
|
|
762
|
-
selectedKeys,
|
|
763
|
-
onSelectionChange,
|
|
764
|
-
bulkActions
|
|
765
|
-
}) {
|
|
766
|
-
const getRowKey = useCallback(
|
|
767
|
-
(row, index) => {
|
|
768
|
-
if (rowKey) return rowKey(row);
|
|
769
|
-
const record = row;
|
|
770
|
-
if (record["id"] !== void 0) return String(record["id"]);
|
|
771
|
-
if (selectable && process.env["NODE_ENV"] !== "production") {
|
|
772
|
-
console.error(
|
|
773
|
-
"[AdminDataTable] `selectable` is on but rows have no stable key: pass `rowKey`, or give each row an `id`. Index-based keys make the selection positional, so sorting or paging silently re-targets it."
|
|
774
|
-
);
|
|
775
|
-
}
|
|
776
|
-
return String(index);
|
|
777
|
-
},
|
|
778
|
-
[rowKey, selectable]
|
|
779
|
-
);
|
|
780
|
-
const selection = selectedKeys ?? EMPTY_SELECTION;
|
|
781
|
-
const pageRowKeys = useMemo(
|
|
782
|
-
() => selectable ? data.map((row, index) => getRowKey(row, index)) : [],
|
|
783
|
-
[selectable, data, getRowKey]
|
|
784
|
-
);
|
|
785
|
-
const allPageSelected = pageRowKeys.length > 0 && pageRowKeys.every((k) => selection.has(k));
|
|
786
|
-
const somePageSelected = !allPageSelected && pageRowKeys.some((k) => selection.has(k));
|
|
787
|
-
const toggleAllOnPage = useCallback(() => {
|
|
788
|
-
if (!onSelectionChange) return;
|
|
789
|
-
const next = new Set(selection);
|
|
790
|
-
if (allPageSelected) {
|
|
791
|
-
pageRowKeys.forEach((k) => next.delete(k));
|
|
792
|
-
} else {
|
|
793
|
-
pageRowKeys.forEach((k) => next.add(k));
|
|
794
|
-
}
|
|
795
|
-
onSelectionChange(next);
|
|
796
|
-
}, [onSelectionChange, selection, allPageSelected, pageRowKeys]);
|
|
797
|
-
const toggleRow = useCallback(
|
|
798
|
-
(key) => {
|
|
799
|
-
if (!onSelectionChange) return;
|
|
800
|
-
const next = new Set(selection);
|
|
801
|
-
if (next.has(key)) next.delete(key);
|
|
802
|
-
else next.add(key);
|
|
803
|
-
onSelectionChange(next);
|
|
804
|
-
},
|
|
805
|
-
[onSelectionChange, selection]
|
|
806
|
-
);
|
|
807
|
-
const handleSort = useCallback(
|
|
808
|
-
(columnKey) => {
|
|
809
|
-
onSort?.(columnKey);
|
|
810
|
-
},
|
|
811
|
-
[onSort]
|
|
812
|
-
);
|
|
813
|
-
const handlePageChange = useCallback(
|
|
814
|
-
(_, newPage) => {
|
|
815
|
-
onPageChange(newPage);
|
|
816
|
-
},
|
|
817
|
-
[onPageChange]
|
|
818
|
-
);
|
|
819
|
-
const handlePageSizeChange = useCallback(
|
|
820
|
-
(event) => {
|
|
821
|
-
onPageSizeChange?.(parseInt(event.target.value, 10));
|
|
822
|
-
onPageChange(0);
|
|
823
|
-
},
|
|
824
|
-
[onPageSizeChange, onPageChange]
|
|
825
|
-
);
|
|
826
|
-
const skeletonRowCount = Math.max(1, Math.min(pageSize, loadingRows));
|
|
827
|
-
const skeletonRows = useMemo(
|
|
828
|
-
() => Array.from({ length: skeletonRowCount }, (_, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
829
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(Skeleton3, { variant: "rectangular", width: 18, height: 18, sx: { borderRadius: 0.5 } }) }),
|
|
830
|
-
columns.map((col) => /* @__PURE__ */ jsx(TableCell, { align: col.align ?? "left", children: /* @__PURE__ */ jsx(
|
|
831
|
-
Skeleton3,
|
|
832
|
-
{
|
|
833
|
-
variant: "text",
|
|
834
|
-
width: col.align === "right" ? "60%" : "80%",
|
|
835
|
-
sx: {
|
|
836
|
-
ml: col.align === "right" ? "auto" : 0,
|
|
837
|
-
borderRadius: 0.5
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
) }, col.key))
|
|
841
|
-
] }, `skeleton-${i}`)),
|
|
842
|
-
[skeletonRowCount, columns, selectable]
|
|
843
|
-
);
|
|
844
|
-
const showBulkBar = selectable && selection.size > 0 && !!bulkActions;
|
|
845
|
-
if (!loading && data.length === 0) {
|
|
846
|
-
return /* @__PURE__ */ jsxs(StyledTableContainer, { sx, children: [
|
|
847
|
-
/* @__PURE__ */ jsx(MuiTable, { size: dense ? "small" : "medium", stickyHeader, children: /* @__PURE__ */ jsx(StyledTableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
848
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox" }),
|
|
849
|
-
columns.map((col) => /* @__PURE__ */ jsx(TableCell, { align: col.align ?? "left", style: { width: col.width }, children: col.header }, col.key))
|
|
850
|
-
] }) }) }),
|
|
851
|
-
/* @__PURE__ */ jsxs(
|
|
852
|
-
Box19,
|
|
853
|
-
{
|
|
854
|
-
sx: {
|
|
855
|
-
py: 6,
|
|
856
|
-
display: "flex",
|
|
857
|
-
flexDirection: "column",
|
|
858
|
-
alignItems: "center",
|
|
859
|
-
gap: 1.5
|
|
860
|
-
},
|
|
861
|
-
children: [
|
|
862
|
-
/* @__PURE__ */ jsx(EmptyIcon, {}),
|
|
863
|
-
/* @__PURE__ */ jsx(
|
|
864
|
-
Typography5,
|
|
865
|
-
{
|
|
866
|
-
variant: "body2",
|
|
867
|
-
sx: { color: loadError ? "text.secondary" : "text.disabled" },
|
|
868
|
-
children: loadError ? loadErrorLabels?.empty ?? "Could not load this data" : emptyMessage
|
|
869
|
-
}
|
|
870
|
-
),
|
|
871
|
-
loadError && /* @__PURE__ */ jsx(Typography5, { variant: "caption", sx: { color: "text.disabled", maxWidth: 420, textAlign: "center" }, children: loadError })
|
|
872
|
-
]
|
|
873
|
-
}
|
|
874
|
-
)
|
|
875
|
-
] });
|
|
876
|
-
}
|
|
877
|
-
return /* @__PURE__ */ jsxs(StyledTableContainer, { sx: { maxHeight, ...sx }, children: [
|
|
878
|
-
loadError && /* @__PURE__ */ jsxs(
|
|
879
|
-
Box19,
|
|
880
|
-
{
|
|
881
|
-
role: "status",
|
|
882
|
-
sx: {
|
|
883
|
-
display: "flex",
|
|
884
|
-
alignItems: "center",
|
|
885
|
-
gap: 1,
|
|
886
|
-
px: 2,
|
|
887
|
-
py: 1,
|
|
888
|
-
borderBottom: 1,
|
|
889
|
-
borderColor: "divider",
|
|
890
|
-
bgcolor: (theme) => alpha(theme.palette.warning.main, 0.12)
|
|
891
|
-
},
|
|
892
|
-
children: [
|
|
893
|
-
/* @__PURE__ */ jsx(Typography5, { variant: "body2", sx: { color: "warning.dark", fontWeight: 600 }, children: loadErrorLabels?.partial ?? "Some of this data could not be loaded" }),
|
|
894
|
-
/* @__PURE__ */ jsx(Typography5, { variant: "caption", sx: { color: "text.secondary" }, children: loadError })
|
|
895
|
-
]
|
|
896
|
-
}
|
|
897
|
-
),
|
|
898
|
-
showBulkBar && /* @__PURE__ */ jsxs(
|
|
899
|
-
Stack,
|
|
900
|
-
{
|
|
901
|
-
direction: "row",
|
|
902
|
-
spacing: 2,
|
|
903
|
-
sx: {
|
|
904
|
-
alignItems: "center",
|
|
905
|
-
px: 2,
|
|
906
|
-
py: 1,
|
|
907
|
-
borderBottom: (theme) => `1px solid ${theme.palette.divider}`,
|
|
908
|
-
bgcolor: (theme) => alpha(theme.palette.primary.main, 0.06)
|
|
909
|
-
},
|
|
910
|
-
children: [
|
|
911
|
-
/* @__PURE__ */ jsxs(
|
|
912
|
-
Typography5,
|
|
913
|
-
{
|
|
914
|
-
variant: "body2",
|
|
915
|
-
sx: {
|
|
916
|
-
fontWeight: 600
|
|
917
|
-
},
|
|
918
|
-
children: [
|
|
919
|
-
selection.size,
|
|
920
|
-
" selected"
|
|
921
|
-
]
|
|
922
|
-
}
|
|
923
|
-
),
|
|
924
|
-
/* @__PURE__ */ jsx(Box19, { sx: { flex: 1 } }),
|
|
925
|
-
bulkActions(selection)
|
|
926
|
-
]
|
|
927
|
-
}
|
|
928
|
-
),
|
|
929
|
-
/* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(MuiTable, { size: dense ? "small" : "medium", stickyHeader, children: [
|
|
930
|
-
/* @__PURE__ */ jsx(StyledTableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
931
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(
|
|
932
|
-
Checkbox,
|
|
933
|
-
{
|
|
934
|
-
size: "small",
|
|
935
|
-
indeterminate: somePageSelected,
|
|
936
|
-
checked: allPageSelected,
|
|
937
|
-
disabled: loading || pageRowKeys.length === 0,
|
|
938
|
-
onChange: toggleAllOnPage,
|
|
939
|
-
slotProps: {
|
|
940
|
-
input: { "aria-label": "select all rows on page" }
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
) }),
|
|
944
|
-
columns.map((col) => /* @__PURE__ */ jsx(
|
|
945
|
-
TableCell,
|
|
946
|
-
{
|
|
947
|
-
align: col.align ?? "left",
|
|
948
|
-
style: { width: col.width },
|
|
949
|
-
sortDirection: sortBy === col.key ? sortOrder : false,
|
|
950
|
-
children: col.sortable && onSort ? /* @__PURE__ */ jsx(
|
|
951
|
-
TableSortLabel,
|
|
952
|
-
{
|
|
953
|
-
active: sortBy === col.key,
|
|
954
|
-
direction: sortBy === col.key ? sortOrder : "asc",
|
|
955
|
-
onClick: () => handleSort(col.key),
|
|
956
|
-
children: col.header
|
|
957
|
-
}
|
|
958
|
-
) : col.header
|
|
959
|
-
},
|
|
960
|
-
col.key
|
|
961
|
-
))
|
|
962
|
-
] }) }),
|
|
963
|
-
/* @__PURE__ */ jsx(TableBody, { children: loading ? skeletonRows : data.map((row, index) => {
|
|
964
|
-
const key = getRowKey(row, index);
|
|
965
|
-
const isSelected = selectable && selection.has(key);
|
|
966
|
-
const body = /* @__PURE__ */ jsxs(
|
|
967
|
-
StyledTableRow,
|
|
968
|
-
{
|
|
969
|
-
hover: true,
|
|
970
|
-
selected: isSelected,
|
|
971
|
-
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
972
|
-
sx: {
|
|
973
|
-
cursor: onRowClick ? "pointer" : "default",
|
|
974
|
-
...rowSx?.(row, index)
|
|
975
|
-
},
|
|
976
|
-
children: [
|
|
977
|
-
selectable && /* @__PURE__ */ jsx(
|
|
978
|
-
TableCell,
|
|
979
|
-
{
|
|
980
|
-
padding: "checkbox",
|
|
981
|
-
onClick: (e) => e.stopPropagation(),
|
|
982
|
-
children: /* @__PURE__ */ jsx(
|
|
983
|
-
Checkbox,
|
|
984
|
-
{
|
|
985
|
-
size: "small",
|
|
986
|
-
checked: isSelected,
|
|
987
|
-
onChange: () => toggleRow(key),
|
|
988
|
-
slotProps: {
|
|
989
|
-
input: { "aria-label": "select row" }
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
)
|
|
993
|
-
}
|
|
994
|
-
),
|
|
995
|
-
columns.map((col) => /* @__PURE__ */ jsx(TableCell, { align: col.align ?? "left", children: col.render(row, index) }, col.key))
|
|
996
|
-
]
|
|
997
|
-
},
|
|
998
|
-
key
|
|
999
|
-
);
|
|
1000
|
-
const detail = renderExpanded?.(row, index);
|
|
1001
|
-
if (detail == null) return body;
|
|
1002
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1003
|
-
body,
|
|
1004
|
-
/* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length + (selectable ? 1 : 0), sx: { py: 0, borderBottom: 0 }, children: detail }) })
|
|
1005
|
-
] }, `${key}-group`);
|
|
1006
|
-
}) })
|
|
1007
|
-
] }) }),
|
|
1008
|
-
/* @__PURE__ */ jsx(
|
|
1009
|
-
TablePagination,
|
|
1010
|
-
{
|
|
1011
|
-
component: "div",
|
|
1012
|
-
count: total,
|
|
1013
|
-
page,
|
|
1014
|
-
rowsPerPage: pageSize,
|
|
1015
|
-
rowsPerPageOptions: pageSizeOptions,
|
|
1016
|
-
onPageChange: handlePageChange,
|
|
1017
|
-
onRowsPerPageChange: handlePageSizeChange,
|
|
1018
|
-
...paginationLabels?.rowsPerPage != null && { labelRowsPerPage: paginationLabels.rowsPerPage },
|
|
1019
|
-
...paginationLabels?.displayedRows != null && { labelDisplayedRows: paginationLabels.displayedRows },
|
|
1020
|
-
sx: {
|
|
1021
|
-
borderTop: (theme) => `1px solid ${theme.palette.divider}`,
|
|
1022
|
-
"& .MuiTablePagination-displayedRows": {
|
|
1023
|
-
fontSize: "0.8rem"
|
|
1024
|
-
},
|
|
1025
|
-
"& .MuiTablePagination-selectLabel": {
|
|
1026
|
-
fontSize: "0.8rem"
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
)
|
|
1031
|
-
] });
|
|
1032
|
-
}
|
|
1033
|
-
var DEFAULT_COLOR_MAP = {
|
|
1034
|
-
active: "success",
|
|
1035
|
-
completed: "success",
|
|
1036
|
-
confirmed: "success",
|
|
1037
|
-
approved: "success",
|
|
1038
|
-
enabled: "success",
|
|
1039
|
-
online: "success",
|
|
1040
|
-
paid: "success",
|
|
1041
|
-
resolved: "success",
|
|
1042
|
-
success: "success",
|
|
1043
|
-
pending: "warning",
|
|
1044
|
-
processing: "warning",
|
|
1045
|
-
waiting: "warning",
|
|
1046
|
-
review: "warning",
|
|
1047
|
-
draft: "warning",
|
|
1048
|
-
failed: "error",
|
|
1049
|
-
error: "error",
|
|
1050
|
-
rejected: "error",
|
|
1051
|
-
blocked: "error",
|
|
1052
|
-
banned: "error",
|
|
1053
|
-
disabled: "error",
|
|
1054
|
-
cancelled: "error",
|
|
1055
|
-
expired: "error",
|
|
1056
|
-
suspended: "error",
|
|
1057
|
-
offline: "error",
|
|
1058
|
-
info: "info",
|
|
1059
|
-
new: "info",
|
|
1060
|
-
open: "info"
|
|
1061
|
-
};
|
|
1062
|
-
function StatusChip({ status, label, colorMap, size = "small", sx, ref, ...other }) {
|
|
1063
|
-
const normalizedStatus = status.toLowerCase();
|
|
1064
|
-
const mergedMap = colorMap ? { ...DEFAULT_COLOR_MAP, ...colorMap } : DEFAULT_COLOR_MAP;
|
|
1065
|
-
const mapped = Object.hasOwn(mergedMap, normalizedStatus) ? mergedMap[normalizedStatus] : void 0;
|
|
1066
|
-
const color = mapped ?? "default";
|
|
1067
|
-
const displayLabel = label ?? status.charAt(0).toUpperCase() + status.slice(1).toLowerCase();
|
|
1068
|
-
return /* @__PURE__ */ jsx(
|
|
1069
|
-
Chip,
|
|
1070
|
-
{
|
|
1071
|
-
ref,
|
|
1072
|
-
...other,
|
|
1073
|
-
label: displayLabel,
|
|
1074
|
-
size,
|
|
1075
|
-
sx: [
|
|
1076
|
-
{
|
|
1077
|
-
height: size === "small" ? 22 : 28,
|
|
1078
|
-
fontSize: size === "small" ? "0.7rem" : "0.775rem",
|
|
1079
|
-
fontWeight: 600,
|
|
1080
|
-
borderRadius: 0.75,
|
|
1081
|
-
letterSpacing: "0.01em",
|
|
1082
|
-
...color !== "default" && {
|
|
1083
|
-
color: (theme) => theme.palette[color].main,
|
|
1084
|
-
bgcolor: (theme) => alpha(theme.palette[color].main, 0.1),
|
|
1085
|
-
border: (theme) => `1px solid ${alpha(theme.palette[color].main, 0.2)}`
|
|
1086
|
-
},
|
|
1087
|
-
...color === "default" && {
|
|
1088
|
-
color: "text.secondary",
|
|
1089
|
-
bgcolor: (theme) => alpha(theme.palette.grey[500], 0.08),
|
|
1090
|
-
border: (theme) => `1px solid ${alpha(theme.palette.grey[500], 0.16)}`
|
|
1091
|
-
}
|
|
1092
|
-
},
|
|
1093
|
-
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
1094
|
-
]
|
|
1095
|
-
}
|
|
1096
|
-
);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
// src/utils/format-crypto.ts
|
|
1100
|
-
var COIN_DISPLAY_DECIMALS = Object.freeze(
|
|
1101
|
-
// Prototype-free: a plain literal answers `COIN_DISPLAY_DECIMALS['constructor']`
|
|
1102
|
-
// with a function, which `?? FALLBACK_DECIMALS` accepts as a precision. That
|
|
1103
|
-
// produced `toFixed(NaN)` — silently formatting with zero decimals instead
|
|
1104
|
-
// of eight, for any coin code that collides with an Object.prototype key.
|
|
1105
|
-
Object.assign(/* @__PURE__ */ Object.create(null), { btc: 8, xmr: 8 })
|
|
1106
|
-
);
|
|
1107
|
-
var COIN_WIRE_DECIMALS = Object.freeze(
|
|
1108
|
-
Object.assign(/* @__PURE__ */ Object.create(null), { btc: 8, xmr: 12 })
|
|
1109
|
-
);
|
|
1110
|
-
var FALLBACK_DECIMALS = 8;
|
|
1111
|
-
var FALLBACK_WIRE_DECIMALS = 12;
|
|
1112
|
-
var DECIMAL = /^([+-]?)(\d*)(?:\.(\d*))?$/;
|
|
1113
|
-
function getCoinDecimals(coin) {
|
|
1114
|
-
const decimals = COIN_DISPLAY_DECIMALS[coin.toLowerCase()];
|
|
1115
|
-
return typeof decimals === "number" ? decimals : FALLBACK_DECIMALS;
|
|
1116
|
-
}
|
|
1117
|
-
function getCoinWireDecimals(coin) {
|
|
1118
|
-
const decimals = COIN_WIRE_DECIMALS[coin.toLowerCase()];
|
|
1119
|
-
return typeof decimals === "number" ? decimals : FALLBACK_WIRE_DECIMALS;
|
|
1120
|
-
}
|
|
1121
|
-
function formatDecimalString(raw, decimals, rounding = "down") {
|
|
1122
|
-
const scaled = toScaledInteger(raw, decimals, rounding);
|
|
1123
|
-
return scaled === null ? null : fromScaledInteger(scaled, decimals);
|
|
1124
|
-
}
|
|
1125
|
-
function toScaledInteger(raw, decimals, rounding = "half-up") {
|
|
1126
|
-
const match = DECIMAL.exec(raw.trim());
|
|
1127
|
-
if (!match) return null;
|
|
1128
|
-
const [, sign = "", intPart = "", fracPart = ""] = match;
|
|
1129
|
-
if (intPart === "" && fracPart === "") return null;
|
|
1130
|
-
const digits = `${intPart || "0"}${fracPart.slice(0, decimals).padEnd(decimals, "0")}`;
|
|
1131
|
-
const roundUp = rounding === "half-up" && (fracPart[decimals] ?? "0") >= "5";
|
|
1132
|
-
const magnitude = BigInt(digits) + (roundUp ? 1n : 0n);
|
|
1133
|
-
return sign === "-" ? -magnitude : magnitude;
|
|
1134
|
-
}
|
|
1135
|
-
function fromScaledInteger(scaled, decimals) {
|
|
1136
|
-
const negative = scaled < 0n;
|
|
1137
|
-
const asString = (negative ? -scaled : scaled).toString().padStart(decimals + 1, "0");
|
|
1138
|
-
const whole = asString.slice(0, asString.length - decimals) || "0";
|
|
1139
|
-
const fraction = decimals > 0 ? asString.slice(asString.length - decimals) : "";
|
|
1140
|
-
const magnitude = decimals > 0 ? `${whole}.${fraction}` : whole;
|
|
1141
|
-
return `${negative && scaled !== 0n ? "-" : ""}${magnitude}`;
|
|
1142
|
-
}
|
|
1143
|
-
function isNonZeroDecimal(raw) {
|
|
1144
|
-
const match = DECIMAL.exec(raw.trim());
|
|
1145
|
-
if (!match) return false;
|
|
1146
|
-
const [, , intPart = "", fracPart = ""] = match;
|
|
1147
|
-
if (intPart === "" && fracPart === "") return false;
|
|
1148
|
-
return /[1-9]/.test(intPart) || /[1-9]/.test(fracPart);
|
|
1149
|
-
}
|
|
1150
|
-
function sumDecimalStrings(values, decimals, options) {
|
|
1151
|
-
const rounding = options?.rounding ?? "half-up";
|
|
1152
|
-
let total = 0n;
|
|
1153
|
-
for (const value of values) {
|
|
1154
|
-
if (value === null || value === void 0 || value === "") continue;
|
|
1155
|
-
const scaled = toScaledInteger(
|
|
1156
|
-
typeof value === "number" ? String(value) : value,
|
|
1157
|
-
decimals,
|
|
1158
|
-
rounding
|
|
1159
|
-
);
|
|
1160
|
-
if (scaled !== null) total += scaled;
|
|
1161
|
-
}
|
|
1162
|
-
return fromScaledInteger(total, decimals);
|
|
1163
|
-
}
|
|
1164
|
-
function subtractDecimalStrings(minuend, subtrahends, decimals, options) {
|
|
1165
|
-
if (minuend === null || minuend === void 0 || minuend === "") return null;
|
|
1166
|
-
const rounding = options?.rounding ?? "half-up";
|
|
1167
|
-
let total = toScaledInteger(
|
|
1168
|
-
typeof minuend === "number" ? String(minuend) : minuend,
|
|
1169
|
-
decimals,
|
|
1170
|
-
rounding
|
|
1171
|
-
);
|
|
1172
|
-
if (total === null) return null;
|
|
1173
|
-
for (const value of subtrahends) {
|
|
1174
|
-
if (value === null || value === void 0 || value === "") continue;
|
|
1175
|
-
const scaled = toScaledInteger(
|
|
1176
|
-
typeof value === "number" ? String(value) : value,
|
|
1177
|
-
decimals,
|
|
1178
|
-
rounding
|
|
1179
|
-
);
|
|
1180
|
-
if (scaled !== null) total -= scaled;
|
|
1181
|
-
}
|
|
1182
|
-
if (options?.clampAtZero && total < 0n) total = 0n;
|
|
1183
|
-
return fromScaledInteger(total, decimals);
|
|
1184
|
-
}
|
|
1185
|
-
function formatCoinAmount(value, coin, options) {
|
|
1186
|
-
const code = coin.toLowerCase();
|
|
1187
|
-
const symbol = options?.symbol ?? coin.toUpperCase();
|
|
1188
|
-
const withSymbol = options?.withSymbol !== false;
|
|
1189
|
-
const decimals = Math.max(0, options?.precision ?? getCoinDecimals(code));
|
|
1190
|
-
const trim = options?.trim === true;
|
|
1191
|
-
const rounding = options?.rounding ?? "down";
|
|
1192
|
-
const markDust = options?.markDust !== false;
|
|
1193
|
-
const raw = typeof value === "string" ? value.trim() : typeof value === "number" && Number.isFinite(value) ? String(Object.is(value, -0) ? 0 : value) : "";
|
|
1194
|
-
let formatted = raw === "" ? null : formatDecimalString(raw, decimals, rounding);
|
|
1195
|
-
const exact = formatted !== null;
|
|
1196
|
-
if (formatted === null) {
|
|
1197
|
-
let n = typeof value === "number" ? value : Number(raw);
|
|
1198
|
-
if (!Number.isFinite(n)) n = 0;
|
|
1199
|
-
if (Object.is(n, -0)) n = 0;
|
|
1200
|
-
formatted = n.toFixed(decimals);
|
|
1201
|
-
}
|
|
1202
|
-
if (markDust && exact && !/[1-9]/.test(formatted) && isNonZeroDecimal(raw)) {
|
|
1203
|
-
const epsilon = fromScaledInteger(1n, decimals);
|
|
1204
|
-
const below = raw.startsWith("-");
|
|
1205
|
-
return withSymbol ? `${below ? ">" : "<"} ${below ? "-" : ""}${epsilon} ${symbol}` : `${below ? ">" : "<"} ${below ? "-" : ""}${epsilon}`;
|
|
1206
|
-
}
|
|
1207
|
-
if (trim && formatted.includes(".")) {
|
|
1208
|
-
formatted = formatted.replace(/\.?0+$/, "");
|
|
1209
|
-
if (formatted === "" || formatted === "-") formatted = "0";
|
|
1210
|
-
}
|
|
1211
|
-
return withSymbol ? `${formatted} ${symbol}` : formatted;
|
|
1212
|
-
}
|
|
1213
|
-
function formatCoinAmountList(totals, options) {
|
|
1214
|
-
const sep = options?.separator ?? " \xB7 ";
|
|
1215
|
-
return Object.keys(totals).sort().map((coin) => formatCoinAmount(totals[coin], coin, options)).join(sep);
|
|
1216
|
-
}
|
|
1217
|
-
function formatAmount(amount, decimals) {
|
|
1218
|
-
const num = parseFloat(amount);
|
|
1219
|
-
if (Number.isNaN(num)) return amount;
|
|
1220
|
-
const scaled = decimals !== void 0 ? formatDecimalString(amount, decimals) : null;
|
|
1221
|
-
const fixed = scaled ?? (decimals !== void 0 ? num.toFixed(decimals) : amount);
|
|
1222
|
-
const [intPart, decPart] = fixed.split(".");
|
|
1223
|
-
const absInt = intPart.replace("-", "");
|
|
1224
|
-
const formatted = absInt.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1225
|
-
const prefix = num < 0 ? "-" : "";
|
|
1226
|
-
return decPart !== void 0 ? `${prefix}${formatted}.${decPart}` : `${prefix}${formatted}`;
|
|
1227
|
-
}
|
|
1228
|
-
function AmountCell({
|
|
1229
|
-
amount,
|
|
1230
|
-
currency,
|
|
1231
|
-
decimals,
|
|
1232
|
-
showSign = false,
|
|
1233
|
-
color = false,
|
|
1234
|
-
sx
|
|
1235
|
-
}) {
|
|
1236
|
-
const num = parseFloat(amount);
|
|
1237
|
-
const isNegative = num < 0;
|
|
1238
|
-
const isPositive = num > 0;
|
|
1239
|
-
const formatted = useMemo(() => formatAmount(amount, decimals), [amount, decimals]);
|
|
1240
|
-
const signPrefix = useMemo(() => {
|
|
1241
|
-
if (!showSign) return "";
|
|
1242
|
-
if (isPositive) return "+";
|
|
1243
|
-
return "";
|
|
1244
|
-
}, [showSign, isPositive]);
|
|
1245
|
-
const textColor = useMemo(() => {
|
|
1246
|
-
if (!color) return void 0;
|
|
1247
|
-
if (isPositive) return "success.main";
|
|
1248
|
-
if (isNegative) return "error.main";
|
|
1249
|
-
return "text.secondary";
|
|
1250
|
-
}, [color, isPositive, isNegative]);
|
|
1251
|
-
return /* @__PURE__ */ jsxs(
|
|
1252
|
-
Typography5,
|
|
1253
|
-
{
|
|
1254
|
-
variant: "body2",
|
|
1255
|
-
color: textColor,
|
|
1256
|
-
sx: {
|
|
1257
|
-
fontFamily: '"JetBrains Mono", "Fira Code", "SF Mono", "Consolas", monospace',
|
|
1258
|
-
fontVariantNumeric: "tabular-nums",
|
|
1259
|
-
fontSize: "0.8rem",
|
|
1260
|
-
fontWeight: 500,
|
|
1261
|
-
whiteSpace: "nowrap",
|
|
1262
|
-
textAlign: "right",
|
|
1263
|
-
...sx
|
|
1264
|
-
},
|
|
1265
|
-
children: [
|
|
1266
|
-
signPrefix,
|
|
1267
|
-
formatted,
|
|
1268
|
-
currency && /* @__PURE__ */ jsx(
|
|
1269
|
-
Typography5,
|
|
1270
|
-
{
|
|
1271
|
-
component: "span",
|
|
1272
|
-
variant: "caption",
|
|
1273
|
-
sx: {
|
|
1274
|
-
color: "text.disabled",
|
|
1275
|
-
ml: 0.5,
|
|
1276
|
-
fontFamily: "inherit",
|
|
1277
|
-
fontSize: "0.7rem",
|
|
1278
|
-
fontWeight: 400
|
|
1279
|
-
},
|
|
1280
|
-
children: currency
|
|
1281
|
-
}
|
|
1282
|
-
)
|
|
1283
|
-
]
|
|
1284
|
-
}
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
63
|
function isAfter(start, end) {
|
|
1288
64
|
if (!start || !end) return false;
|
|
1289
65
|
return start.isAfter(end);
|
|
@@ -1499,7 +275,7 @@ function CountrySelect({
|
|
|
1499
275
|
const isWorldRow = worldwideValue !== void 0 && option.iso2 === worldwideValue;
|
|
1500
276
|
const src = isWorldRow ? null : getFlagSrc?.(option.iso2.toLowerCase()) ?? null;
|
|
1501
277
|
return /* @__PURE__ */ jsxs(
|
|
1502
|
-
|
|
278
|
+
Box9,
|
|
1503
279
|
{
|
|
1504
280
|
component: "li",
|
|
1505
281
|
...rest,
|
|
@@ -1543,281 +319,50 @@ function CountrySelect({
|
|
|
1543
319
|
},
|
|
1544
320
|
key
|
|
1545
321
|
);
|
|
1546
|
-
},
|
|
1547
|
-
renderInput: (params) => {
|
|
1548
|
-
const src = !isWorld && selected && getFlagSrc ? getFlagSrc(selected.iso2.toLowerCase()) ?? null : null;
|
|
1549
|
-
const startAdornment = selected ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { ml: 0.75, mr: -0.5 }, children: /* @__PURE__ */ jsx(
|
|
1550
|
-
FlagIcon,
|
|
1551
|
-
{
|
|
1552
|
-
src,
|
|
1553
|
-
alt: selected ? label_(selected) : "",
|
|
1554
|
-
code: isWorld ? void 0 : selected?.iso2
|
|
1555
|
-
}
|
|
1556
|
-
) }) : null;
|
|
1557
|
-
return /* @__PURE__ */ jsx(
|
|
1558
|
-
TextField2,
|
|
1559
|
-
{
|
|
1560
|
-
...params,
|
|
1561
|
-
label,
|
|
1562
|
-
placeholder,
|
|
1563
|
-
helperText,
|
|
1564
|
-
error,
|
|
1565
|
-
...textFieldProps,
|
|
1566
|
-
slotProps: {
|
|
1567
|
-
...textFieldProps?.slotProps ?? {},
|
|
1568
|
-
// MUI v9 renamed Autocomplete renderInput's
|
|
1569
|
-
// `InputProps` / `inputProps` to `slotProps.{input,
|
|
1570
|
-
// htmlInput}`. Merge our flag adornment on top of the
|
|
1571
|
-
// input slot while keeping the chevron+clear adornments
|
|
1572
|
-
// that Autocomplete itself injects.
|
|
1573
|
-
input: {
|
|
1574
|
-
...params.slotProps.input,
|
|
1575
|
-
...textFieldProps?.slotProps?.input ?? {},
|
|
1576
|
-
startAdornment: startAdornment ?? params.slotProps.input.startAdornment
|
|
1577
|
-
},
|
|
1578
|
-
htmlInput: {
|
|
1579
|
-
...params.slotProps.htmlInput,
|
|
1580
|
-
autoComplete: "off"
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
);
|
|
1585
|
-
},
|
|
1586
|
-
...autocompleteProps
|
|
1587
|
-
}
|
|
1588
|
-
);
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
// src/utils/create-classes.ts
|
|
1592
|
-
var DEFAULT_CLASS_PREFIX = "prism";
|
|
1593
|
-
var classPrefix = DEFAULT_CLASS_PREFIX;
|
|
1594
|
-
function setClassPrefix(prefix) {
|
|
1595
|
-
classPrefix = prefix;
|
|
1596
|
-
}
|
|
1597
|
-
function getClassPrefix() {
|
|
1598
|
-
return classPrefix;
|
|
1599
|
-
}
|
|
1600
|
-
function createClasses(className) {
|
|
1601
|
-
return `${classPrefix}__${className}`;
|
|
1602
|
-
}
|
|
1603
|
-
function createClassesObject(classNames) {
|
|
1604
|
-
return classNames.reduce(
|
|
1605
|
-
(acc, name) => {
|
|
1606
|
-
acc[name] = createClasses(name);
|
|
1607
|
-
return acc;
|
|
1608
|
-
},
|
|
1609
|
-
{}
|
|
1610
|
-
);
|
|
1611
|
-
}
|
|
1612
|
-
function createComponentClasses(componentName, suffixes) {
|
|
1613
|
-
if (suffixes) {
|
|
1614
|
-
return suffixes.reduce(
|
|
1615
|
-
(acc, suffix) => {
|
|
1616
|
-
acc[suffix] = createClasses(`${componentName}__${suffix}`);
|
|
1617
|
-
return acc;
|
|
1618
|
-
},
|
|
1619
|
-
{}
|
|
1620
|
-
);
|
|
1621
|
-
}
|
|
1622
|
-
return (suffix) => createClasses(`${componentName}__${suffix}`);
|
|
1623
|
-
}
|
|
1624
|
-
var animateBorderClasses = {
|
|
1625
|
-
root: createClasses("animate__border__root"),
|
|
1626
|
-
primaryBorder: createClasses("animate__border__primary"),
|
|
1627
|
-
secondaryBorder: createClasses("animate__border__secondary"),
|
|
1628
|
-
svgWrapper: createClasses("animate__border__svg__wrapper"),
|
|
1629
|
-
movingShape: createClasses("animate__border__moving__shape")
|
|
1630
|
-
};
|
|
1631
|
-
function borderGradient(props) {
|
|
1632
|
-
const { color, padding = "2px" } = props ?? {};
|
|
1633
|
-
return {
|
|
1634
|
-
padding,
|
|
1635
|
-
inset: 0,
|
|
1636
|
-
width: "100%",
|
|
1637
|
-
content: '""',
|
|
1638
|
-
height: "100%",
|
|
1639
|
-
margin: "auto",
|
|
1640
|
-
position: "absolute",
|
|
1641
|
-
borderRadius: "inherit",
|
|
1642
|
-
mask: "linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0)",
|
|
1643
|
-
WebkitMask: "linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0)",
|
|
1644
|
-
maskComposite: "exclude",
|
|
1645
|
-
WebkitMaskComposite: "xor",
|
|
1646
|
-
...color && { background: color }
|
|
1647
|
-
};
|
|
1648
|
-
}
|
|
1649
|
-
function AnimateBorder({ sx, children, duration, slotProps, className, ...other }) {
|
|
1650
|
-
const theme = useTheme();
|
|
1651
|
-
const rootRef = useRef(null);
|
|
1652
|
-
const primaryBorderRef = useRef(null);
|
|
1653
|
-
const [isHidden, setIsHidden] = useState(false);
|
|
1654
|
-
const secondaryBorderStyles = useComputedElementStyles(theme, primaryBorderRef);
|
|
1655
|
-
useEffect(() => {
|
|
1656
|
-
const handleVisibility = () => {
|
|
1657
|
-
if (rootRef.current) {
|
|
1658
|
-
const displayStyle = getComputedStyle(rootRef.current).display;
|
|
1659
|
-
setIsHidden(displayStyle === "none");
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
handleVisibility();
|
|
1663
|
-
window.addEventListener("resize", handleVisibility);
|
|
1664
|
-
return () => {
|
|
1665
|
-
window.removeEventListener("resize", handleVisibility);
|
|
1666
|
-
};
|
|
1667
|
-
}, []);
|
|
1668
|
-
const outlineColor = typeof slotProps?.outlineColor === "function" ? slotProps?.outlineColor(theme) : slotProps?.outlineColor;
|
|
1669
|
-
const borderProps = {
|
|
1670
|
-
duration,
|
|
1671
|
-
isHidden,
|
|
1672
|
-
rx: slotProps?.svgSettings?.rx,
|
|
1673
|
-
ry: slotProps?.svgSettings?.ry
|
|
1674
|
-
};
|
|
1675
|
-
const renderPrimaryBorder = () => /* @__PURE__ */ jsx(
|
|
1676
|
-
MovingBorder,
|
|
1677
|
-
{
|
|
1678
|
-
...borderProps,
|
|
1679
|
-
ref: primaryBorderRef,
|
|
1680
|
-
size: slotProps?.primaryBorder?.size,
|
|
1681
|
-
sx: [
|
|
1682
|
-
{
|
|
1683
|
-
...borderGradient({ padding: slotProps?.primaryBorder?.width })
|
|
1684
|
-
},
|
|
1685
|
-
...Array.isArray(slotProps?.primaryBorder?.sx) ? slotProps.primaryBorder.sx : [slotProps?.primaryBorder?.sx]
|
|
1686
|
-
]
|
|
1687
|
-
}
|
|
1688
|
-
);
|
|
1689
|
-
const renderSecondaryBorder = () => slotProps?.secondaryBorder && /* @__PURE__ */ jsx(
|
|
1690
|
-
MovingBorder,
|
|
1691
|
-
{
|
|
1692
|
-
...borderProps,
|
|
1693
|
-
size: slotProps?.secondaryBorder?.size ?? slotProps?.primaryBorder?.size,
|
|
1694
|
-
sx: [
|
|
1695
|
-
{
|
|
1696
|
-
...borderGradient({
|
|
1697
|
-
padding: slotProps?.secondaryBorder?.width ?? secondaryBorderStyles.padding
|
|
1698
|
-
}),
|
|
1699
|
-
borderRadius: secondaryBorderStyles.borderRadius,
|
|
1700
|
-
transform: "scale(-1, -1)"
|
|
1701
|
-
},
|
|
1702
|
-
...Array.isArray(slotProps?.secondaryBorder?.sx) ? slotProps.secondaryBorder.sx : [slotProps?.secondaryBorder?.sx]
|
|
1703
|
-
]
|
|
1704
|
-
}
|
|
1705
|
-
);
|
|
1706
|
-
return /* @__PURE__ */ jsxs(
|
|
1707
|
-
Box19,
|
|
1708
|
-
{
|
|
1709
|
-
dir: "ltr",
|
|
1710
|
-
ref: rootRef,
|
|
1711
|
-
className: [animateBorderClasses.root, className].filter(Boolean).join(" "),
|
|
1712
|
-
sx: [
|
|
1713
|
-
{
|
|
1714
|
-
minWidth: 40,
|
|
1715
|
-
minHeight: 40,
|
|
1716
|
-
overflow: "hidden",
|
|
1717
|
-
position: "relative",
|
|
1718
|
-
width: "fit-content",
|
|
1719
|
-
"&::before": borderGradient({
|
|
1720
|
-
color: outlineColor,
|
|
1721
|
-
padding: slotProps?.primaryBorder?.width
|
|
1722
|
-
}),
|
|
1723
|
-
...!!children && {
|
|
1724
|
-
minWidth: "unset",
|
|
1725
|
-
minHeight: "unset"
|
|
322
|
+
},
|
|
323
|
+
renderInput: (params) => {
|
|
324
|
+
const src = !isWorld && selected && getFlagSrc ? getFlagSrc(selected.iso2.toLowerCase()) ?? null : null;
|
|
325
|
+
const startAdornment = selected ? /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { ml: 0.75, mr: -0.5 }, children: /* @__PURE__ */ jsx(
|
|
326
|
+
FlagIcon,
|
|
327
|
+
{
|
|
328
|
+
src,
|
|
329
|
+
alt: selected ? label_(selected) : "",
|
|
330
|
+
code: isWorld ? void 0 : selected?.iso2
|
|
1726
331
|
}
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
332
|
+
) }) : null;
|
|
333
|
+
return /* @__PURE__ */ jsx(
|
|
334
|
+
TextField,
|
|
335
|
+
{
|
|
336
|
+
...params,
|
|
337
|
+
label,
|
|
338
|
+
placeholder,
|
|
339
|
+
helperText,
|
|
340
|
+
error,
|
|
341
|
+
...textFieldProps,
|
|
342
|
+
slotProps: {
|
|
343
|
+
...textFieldProps?.slotProps ?? {},
|
|
344
|
+
// MUI v9 renamed Autocomplete renderInput's
|
|
345
|
+
// `InputProps` / `inputProps` to `slotProps.{input,
|
|
346
|
+
// htmlInput}`. Merge our flag adornment on top of the
|
|
347
|
+
// input slot while keeping the chevron+clear adornments
|
|
348
|
+
// that Autocomplete itself injects.
|
|
349
|
+
input: {
|
|
350
|
+
...params.slotProps.input,
|
|
351
|
+
...textFieldProps?.slotProps?.input ?? {},
|
|
352
|
+
startAdornment: startAdornment ?? params.slotProps.input.startAdornment
|
|
353
|
+
},
|
|
354
|
+
htmlInput: {
|
|
355
|
+
...params.slotProps.htmlInput,
|
|
356
|
+
autoComplete: "off"
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
},
|
|
362
|
+
...autocompleteProps
|
|
1736
363
|
}
|
|
1737
364
|
);
|
|
1738
365
|
}
|
|
1739
|
-
function MovingBorder({ sx, size, isHidden, rx = "30%", ry = "30%", duration = 8, ...other }) {
|
|
1740
|
-
const svgRectRef = useRef(null);
|
|
1741
|
-
const progress = useMotionValue(0);
|
|
1742
|
-
const updateAnimationFrame = (time) => {
|
|
1743
|
-
if (!svgRectRef.current) return;
|
|
1744
|
-
try {
|
|
1745
|
-
const pathLength = svgRectRef.current.getTotalLength();
|
|
1746
|
-
const pixelsPerMs = pathLength / (duration * 1e3);
|
|
1747
|
-
progress.set(time * pixelsPerMs % pathLength);
|
|
1748
|
-
} catch {
|
|
1749
|
-
return;
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
const calculateTransform = (val) => {
|
|
1753
|
-
if (!svgRectRef.current) return { x: 0, y: 0 };
|
|
1754
|
-
try {
|
|
1755
|
-
const point = svgRectRef.current.getPointAtLength(val);
|
|
1756
|
-
return point ? { x: point.x, y: point.y } : { x: 0, y: 0 };
|
|
1757
|
-
} catch {
|
|
1758
|
-
return { x: 0, y: 0 };
|
|
1759
|
-
}
|
|
1760
|
-
};
|
|
1761
|
-
useAnimationFrame((time) => !isHidden ? updateAnimationFrame(time) : void 0);
|
|
1762
|
-
const x = useTransform(progress, (val) => calculateTransform(val).x);
|
|
1763
|
-
const y = useTransform(progress, (val) => calculateTransform(val).y);
|
|
1764
|
-
const transform = useMotionTemplate`translateX(${x}px) translateY(${y}px) translateX(-50%) translateY(-50%)`;
|
|
1765
|
-
return /* @__PURE__ */ jsxs(Box19, { component: "span", sx: [{ textAlign: "initial" }, ...Array.isArray(sx) ? sx : [sx]], ...other, children: [
|
|
1766
|
-
/* @__PURE__ */ jsx(
|
|
1767
|
-
"svg",
|
|
1768
|
-
{
|
|
1769
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1770
|
-
preserveAspectRatio: "none",
|
|
1771
|
-
width: "100%",
|
|
1772
|
-
height: "100%",
|
|
1773
|
-
className: animateBorderClasses.svgWrapper,
|
|
1774
|
-
style: { position: "absolute" },
|
|
1775
|
-
children: /* @__PURE__ */ jsx("rect", { ref: svgRectRef, fill: "none", width: "100%", height: "100%", rx, ry })
|
|
1776
|
-
}
|
|
1777
|
-
),
|
|
1778
|
-
/* @__PURE__ */ jsx(
|
|
1779
|
-
Box19,
|
|
1780
|
-
{
|
|
1781
|
-
component: m.span,
|
|
1782
|
-
style: { transform },
|
|
1783
|
-
className: animateBorderClasses.movingShape,
|
|
1784
|
-
sx: {
|
|
1785
|
-
width: size,
|
|
1786
|
-
height: size,
|
|
1787
|
-
filter: "blur(8px)",
|
|
1788
|
-
position: "absolute",
|
|
1789
|
-
background: "radial-gradient(currentColor 40%, transparent 80%)"
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
)
|
|
1793
|
-
] });
|
|
1794
|
-
}
|
|
1795
|
-
function useComputedElementStyles(theme, ref) {
|
|
1796
|
-
const [computedStyles, setComputedStyles] = useState(null);
|
|
1797
|
-
const isRtl = theme.direction === "rtl";
|
|
1798
|
-
useEffect(() => {
|
|
1799
|
-
if (ref.current) {
|
|
1800
|
-
const style = getComputedStyle(ref.current);
|
|
1801
|
-
setComputedStyles({
|
|
1802
|
-
paddingTop: style.paddingBottom,
|
|
1803
|
-
paddingBottom: style.paddingTop,
|
|
1804
|
-
paddingLeft: isRtl ? style.paddingLeft : style.paddingRight,
|
|
1805
|
-
paddingRight: isRtl ? style.paddingRight : style.paddingLeft,
|
|
1806
|
-
borderTopLeftRadius: isRtl ? style.borderBottomLeftRadius : style.borderBottomRightRadius,
|
|
1807
|
-
borderTopRightRadius: isRtl ? style.borderBottomRightRadius : style.borderBottomLeftRadius,
|
|
1808
|
-
borderBottomLeftRadius: isRtl ? style.borderTopLeftRadius : style.borderTopRightRadius,
|
|
1809
|
-
borderBottomRightRadius: isRtl ? style.borderTopRightRadius : style.borderTopLeftRadius
|
|
1810
|
-
});
|
|
1811
|
-
}
|
|
1812
|
-
}, [ref, isRtl]);
|
|
1813
|
-
return {
|
|
1814
|
-
padding: `${computedStyles?.paddingTop} ${computedStyles?.paddingRight} ${computedStyles?.paddingBottom} ${computedStyles?.paddingLeft}`,
|
|
1815
|
-
borderRadius: `${computedStyles?.borderTopLeftRadius} ${computedStyles?.borderTopRightRadius} ${computedStyles?.borderBottomRightRadius} ${computedStyles?.borderBottomLeftRadius}`
|
|
1816
|
-
};
|
|
1817
|
-
}
|
|
1818
|
-
function MotionLazy({ children }) {
|
|
1819
|
-
return /* @__PURE__ */ jsx(LazyMotion, { strict: true, features: domMax, children });
|
|
1820
|
-
}
|
|
1821
366
|
var SIZES = {
|
|
1822
367
|
xs: 24,
|
|
1823
368
|
sm: 32,
|
|
@@ -1966,7 +511,7 @@ function Avatar({ size = "md", shape = "circular", name, src, alt, online, offli
|
|
|
1966
511
|
function CustomAvatarGroup({ avatars, size = "sm", max = 4, sx, ...other }) {
|
|
1967
512
|
return /* @__PURE__ */ jsx(AvatarGroup, { max, sx, ...other, children: avatars.map((avatar, index) => /* @__PURE__ */ jsx(Avatar, { name: avatar.name, src: avatar.src, alt: avatar.alt || avatar.name, size }, index)) });
|
|
1968
513
|
}
|
|
1969
|
-
var StyledBadge = styled(
|
|
514
|
+
var StyledBadge = styled(MuiBadge, {
|
|
1970
515
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
1971
516
|
})(({ theme, ownerState }) => {
|
|
1972
517
|
const { variant, color, size } = ownerState;
|
|
@@ -2032,7 +577,7 @@ var StyledBadge = styled(Badge, {
|
|
|
2032
577
|
}
|
|
2033
578
|
};
|
|
2034
579
|
});
|
|
2035
|
-
function
|
|
580
|
+
function Badge({ variant = "standard", color = "error", size = "medium", badgeContent, children, sx, ref, ...other }) {
|
|
2036
581
|
const ownerState = { variant, color, size };
|
|
2037
582
|
const isStatusVariant = variant === "online" || variant === "offline" || variant === "busy";
|
|
2038
583
|
const isDotVariant = variant === "dot" || isStatusVariant;
|
|
@@ -2080,7 +625,7 @@ function CountBadge({
|
|
|
2080
625
|
};
|
|
2081
626
|
const bgColor = colorMap[color];
|
|
2082
627
|
return /* @__PURE__ */ jsx(
|
|
2083
|
-
|
|
628
|
+
Box9,
|
|
2084
629
|
{
|
|
2085
630
|
component: "span",
|
|
2086
631
|
ref,
|
|
@@ -2114,7 +659,7 @@ function StatusDot({ status, size = 8, pulse = true, sx, ref, ...other }) {
|
|
|
2114
659
|
};
|
|
2115
660
|
const color = statusColors[status];
|
|
2116
661
|
return /* @__PURE__ */ jsx(
|
|
2117
|
-
|
|
662
|
+
Box9,
|
|
2118
663
|
{
|
|
2119
664
|
component: "span",
|
|
2120
665
|
ref,
|
|
@@ -2135,221 +680,6 @@ function StatusDot({ status, size = 8, pulse = true, sx, ref, ...other }) {
|
|
|
2135
680
|
}
|
|
2136
681
|
);
|
|
2137
682
|
}
|
|
2138
|
-
var StyledCard = styled(Card2, {
|
|
2139
|
-
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
2140
|
-
})(({ theme, ownerState }) => {
|
|
2141
|
-
const { variant } = ownerState;
|
|
2142
|
-
const borderRadius = typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius : 4;
|
|
2143
|
-
const softStyles = {
|
|
2144
|
-
border: "none",
|
|
2145
|
-
boxShadow: "none",
|
|
2146
|
-
backgroundColor: alpha(theme.palette.grey[500], 0.08)
|
|
2147
|
-
};
|
|
2148
|
-
return {
|
|
2149
|
-
position: "relative",
|
|
2150
|
-
borderRadius: borderRadius * 2,
|
|
2151
|
-
...variant === "soft" && softStyles,
|
|
2152
|
-
...variant === "outlined" && {
|
|
2153
|
-
boxShadow: "none"
|
|
2154
|
-
}
|
|
2155
|
-
};
|
|
2156
|
-
});
|
|
2157
|
-
function Card({
|
|
2158
|
-
variant = "elevation",
|
|
2159
|
-
title,
|
|
2160
|
-
subheader,
|
|
2161
|
-
headerAction,
|
|
2162
|
-
headerSx,
|
|
2163
|
-
contentSx,
|
|
2164
|
-
actions,
|
|
2165
|
-
actionsSx,
|
|
2166
|
-
disablePadding,
|
|
2167
|
-
children,
|
|
2168
|
-
sx,
|
|
2169
|
-
ref,
|
|
2170
|
-
...other
|
|
2171
|
-
}) {
|
|
2172
|
-
const ownerState = { variant };
|
|
2173
|
-
const hasHeader = title || subheader || headerAction;
|
|
2174
|
-
return /* @__PURE__ */ jsxs(
|
|
2175
|
-
StyledCard,
|
|
2176
|
-
{
|
|
2177
|
-
ref,
|
|
2178
|
-
ownerState,
|
|
2179
|
-
variant: variant === "outlined" ? "outlined" : "elevation",
|
|
2180
|
-
sx,
|
|
2181
|
-
...other,
|
|
2182
|
-
children: [
|
|
2183
|
-
hasHeader && /* @__PURE__ */ jsx(CardHeader, { title, subheader, action: headerAction, sx: headerSx }),
|
|
2184
|
-
children && /* @__PURE__ */ jsx(
|
|
2185
|
-
CardContent,
|
|
2186
|
-
{
|
|
2187
|
-
sx: {
|
|
2188
|
-
...disablePadding && { p: 0, "&:last-child": { pb: 0 } },
|
|
2189
|
-
...contentSx
|
|
2190
|
-
},
|
|
2191
|
-
children
|
|
2192
|
-
}
|
|
2193
|
-
),
|
|
2194
|
-
actions && /* @__PURE__ */ jsx(CardActions, { sx: actionsSx, children: actions })
|
|
2195
|
-
]
|
|
2196
|
-
}
|
|
2197
|
-
);
|
|
2198
|
-
}
|
|
2199
|
-
function CardSection({ title, description, children, sx }) {
|
|
2200
|
-
return /* @__PURE__ */ jsxs(Box19, { sx: { mb: 3, ...sx }, children: [
|
|
2201
|
-
title && /* @__PURE__ */ jsx(
|
|
2202
|
-
Typography5,
|
|
2203
|
-
{
|
|
2204
|
-
variant: "subtitle1",
|
|
2205
|
-
sx: {
|
|
2206
|
-
fontWeight: 600,
|
|
2207
|
-
mb: 1
|
|
2208
|
-
},
|
|
2209
|
-
children: title
|
|
2210
|
-
}
|
|
2211
|
-
),
|
|
2212
|
-
description && /* @__PURE__ */ jsx(
|
|
2213
|
-
Typography5,
|
|
2214
|
-
{
|
|
2215
|
-
variant: "body2",
|
|
2216
|
-
sx: {
|
|
2217
|
-
color: "text.secondary",
|
|
2218
|
-
mb: 2
|
|
2219
|
-
},
|
|
2220
|
-
children: description
|
|
2221
|
-
}
|
|
2222
|
-
),
|
|
2223
|
-
children
|
|
2224
|
-
] });
|
|
2225
|
-
}
|
|
2226
|
-
function StatCard({
|
|
2227
|
-
label,
|
|
2228
|
-
value,
|
|
2229
|
-
change,
|
|
2230
|
-
icon,
|
|
2231
|
-
color = "primary",
|
|
2232
|
-
loading,
|
|
2233
|
-
subtitle,
|
|
2234
|
-
variant = "outlined",
|
|
2235
|
-
sx,
|
|
2236
|
-
...other
|
|
2237
|
-
}) {
|
|
2238
|
-
const isPositive = change && change > 0;
|
|
2239
|
-
const isNegative = change && change < 0;
|
|
2240
|
-
return /* @__PURE__ */ jsx(Card, { variant, contentSx: { p: 2, "&:last-child": { pb: 2 } }, sx, ...other, children: /* @__PURE__ */ jsxs(Box19, { sx: { display: "flex", justifyContent: "space-between", alignItems: "flex-start" }, children: [
|
|
2241
|
-
/* @__PURE__ */ jsx(Box19, { children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2242
|
-
/* @__PURE__ */ jsx(Skeleton3, { width: 80, height: 16 }),
|
|
2243
|
-
/* @__PURE__ */ jsx(Skeleton3, { width: 50, height: 32, sx: { mt: 0.5 } })
|
|
2244
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2245
|
-
/* @__PURE__ */ jsx(
|
|
2246
|
-
Typography5,
|
|
2247
|
-
{
|
|
2248
|
-
variant: "caption",
|
|
2249
|
-
sx: {
|
|
2250
|
-
fontWeight: 600,
|
|
2251
|
-
color: "text.secondary",
|
|
2252
|
-
textTransform: "uppercase",
|
|
2253
|
-
letterSpacing: 0.5
|
|
2254
|
-
},
|
|
2255
|
-
children: label
|
|
2256
|
-
}
|
|
2257
|
-
),
|
|
2258
|
-
/* @__PURE__ */ jsx(
|
|
2259
|
-
Typography5,
|
|
2260
|
-
{
|
|
2261
|
-
variant: "h4",
|
|
2262
|
-
sx: {
|
|
2263
|
-
fontWeight: 700,
|
|
2264
|
-
color: `${color}.main`,
|
|
2265
|
-
mt: 0.5
|
|
2266
|
-
},
|
|
2267
|
-
children: value
|
|
2268
|
-
}
|
|
2269
|
-
),
|
|
2270
|
-
change !== void 0 && /* @__PURE__ */ jsxs(
|
|
2271
|
-
Typography5,
|
|
2272
|
-
{
|
|
2273
|
-
variant: "caption",
|
|
2274
|
-
color: isPositive ? "success.main" : isNegative ? "error.main" : "text.secondary",
|
|
2275
|
-
sx: {
|
|
2276
|
-
fontWeight: 500,
|
|
2277
|
-
mt: 0.5,
|
|
2278
|
-
display: "block"
|
|
2279
|
-
},
|
|
2280
|
-
children: [
|
|
2281
|
-
isPositive ? "+" : "",
|
|
2282
|
-
change,
|
|
2283
|
-
"%"
|
|
2284
|
-
]
|
|
2285
|
-
}
|
|
2286
|
-
),
|
|
2287
|
-
subtitle && /* @__PURE__ */ jsx(Typography5, { variant: "caption", sx: {
|
|
2288
|
-
color: "text.secondary"
|
|
2289
|
-
}, children: subtitle })
|
|
2290
|
-
] }) }),
|
|
2291
|
-
icon && !loading && /* @__PURE__ */ jsx(Box19, { sx: { color: `${color}.main` }, children: icon })
|
|
2292
|
-
] }) });
|
|
2293
|
-
}
|
|
2294
|
-
function ConfirmDialog({
|
|
2295
|
-
open,
|
|
2296
|
-
onClose,
|
|
2297
|
-
onConfirm,
|
|
2298
|
-
title = "Confirm",
|
|
2299
|
-
content,
|
|
2300
|
-
confirmLabel = "Confirm",
|
|
2301
|
-
cancelLabel = "Cancel",
|
|
2302
|
-
confirmColor = "primary",
|
|
2303
|
-
loading = false,
|
|
2304
|
-
disabled = false,
|
|
2305
|
-
maxWidth = "xs",
|
|
2306
|
-
sx
|
|
2307
|
-
}) {
|
|
2308
|
-
const titleId = useId();
|
|
2309
|
-
const descriptionId = useId();
|
|
2310
|
-
const [confirming, setConfirming] = useState(false);
|
|
2311
|
-
const busy = loading || confirming;
|
|
2312
|
-
const handleConfirm = () => {
|
|
2313
|
-
if (busy) return;
|
|
2314
|
-
const result = onConfirm();
|
|
2315
|
-
if (!(result instanceof Promise)) return;
|
|
2316
|
-
setConfirming(true);
|
|
2317
|
-
result.catch(() => {
|
|
2318
|
-
}).finally(() => setConfirming(false));
|
|
2319
|
-
};
|
|
2320
|
-
return /* @__PURE__ */ jsxs(
|
|
2321
|
-
Dialog,
|
|
2322
|
-
{
|
|
2323
|
-
open,
|
|
2324
|
-
onClose: busy ? void 0 : onClose,
|
|
2325
|
-
maxWidth,
|
|
2326
|
-
fullWidth: true,
|
|
2327
|
-
"aria-labelledby": titleId,
|
|
2328
|
-
"aria-describedby": content ? descriptionId : void 0,
|
|
2329
|
-
sx,
|
|
2330
|
-
children: [
|
|
2331
|
-
/* @__PURE__ */ jsx(DialogTitle, { id: titleId, children: title }),
|
|
2332
|
-
content && /* @__PURE__ */ jsx(DialogContent, { children: typeof content === "string" ? /* @__PURE__ */ jsx(DialogContentText, { id: descriptionId, children: content }) : /* @__PURE__ */ jsx("div", { id: descriptionId, children: content }) }),
|
|
2333
|
-
/* @__PURE__ */ jsxs(DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
2334
|
-
/* @__PURE__ */ jsx(Button, { onClick: onClose, color: "inherit", disabled: busy, variant: "outlined", children: cancelLabel }),
|
|
2335
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, color: confirmColor, variant: "contained", loading: busy, disabled, children: confirmLabel })
|
|
2336
|
-
] })
|
|
2337
|
-
]
|
|
2338
|
-
}
|
|
2339
|
-
);
|
|
2340
|
-
}
|
|
2341
|
-
function DeleteDialog({ itemName, content, ...props }) {
|
|
2342
|
-
return /* @__PURE__ */ jsx(
|
|
2343
|
-
ConfirmDialog,
|
|
2344
|
-
{
|
|
2345
|
-
title: itemName ? `Delete "${itemName}"?` : "Delete item?",
|
|
2346
|
-
content: content ?? "This action cannot be undone. Are you sure you want to proceed?",
|
|
2347
|
-
confirmLabel: "Delete",
|
|
2348
|
-
confirmColor: "error",
|
|
2349
|
-
...props
|
|
2350
|
-
}
|
|
2351
|
-
);
|
|
2352
|
-
}
|
|
2353
683
|
|
|
2354
684
|
// src/components/sponsored-slot/types.ts
|
|
2355
685
|
var DEFAULT_SPONSORED_SLOT_LABELS = {
|
|
@@ -2372,16 +702,16 @@ function SponsoredSlot({
|
|
|
2372
702
|
const imageBox = banner ? BANNER_IMAGE : TILE_IMAGE;
|
|
2373
703
|
if (!content) {
|
|
2374
704
|
if (!loading) return null;
|
|
2375
|
-
return /* @__PURE__ */ jsx(
|
|
2376
|
-
/* @__PURE__ */ jsx(
|
|
2377
|
-
/* @__PURE__ */ jsxs(
|
|
2378
|
-
/* @__PURE__ */ jsx(
|
|
2379
|
-
/* @__PURE__ */ jsx(
|
|
705
|
+
return /* @__PURE__ */ jsx(Card, { variant: "outlined", sx: { height: "100%" }, "data-sponsored-pending": "", children: /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", flexDirection: banner ? "row" : "column", height: "100%" }, children: [
|
|
706
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", sx: { ...imageBox, height: banner ? void 0 : "auto" } }),
|
|
707
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { p: 1.5, flex: 1 }, children: [
|
|
708
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "40%" }),
|
|
709
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "80%" })
|
|
2380
710
|
] })
|
|
2381
711
|
] }) });
|
|
2382
712
|
}
|
|
2383
713
|
const mark = /* @__PURE__ */ jsxs(
|
|
2384
|
-
|
|
714
|
+
Box9,
|
|
2385
715
|
{
|
|
2386
716
|
component: "span",
|
|
2387
717
|
sx: { display: "inline-flex", alignItems: "center", gap: 0.5, color: "text.secondary", typography: "caption" },
|
|
@@ -2391,9 +721,9 @@ function SponsoredSlot({
|
|
|
2391
721
|
]
|
|
2392
722
|
}
|
|
2393
723
|
);
|
|
2394
|
-
const body = /* @__PURE__ */ jsxs(
|
|
724
|
+
const body = /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", flexDirection: banner ? "row" : "column", height: "100%" }, children: [
|
|
2395
725
|
content.image && /* @__PURE__ */ jsx(
|
|
2396
|
-
|
|
726
|
+
Box9,
|
|
2397
727
|
{
|
|
2398
728
|
component: "img",
|
|
2399
729
|
src: content.image,
|
|
@@ -2409,50 +739,16 @@ function SponsoredSlot({
|
|
|
2409
739
|
}
|
|
2410
740
|
}
|
|
2411
741
|
),
|
|
2412
|
-
/* @__PURE__ */ jsxs(
|
|
742
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { p: 1.5, display: "flex", flexDirection: "column", gap: 0.5, minWidth: 0 }, children: [
|
|
2413
743
|
content.because ? /* @__PURE__ */ jsx(Tooltip2, { title: content.because, children: mark }) : mark,
|
|
2414
744
|
/* @__PURE__ */ jsx(Typography5, { variant: "subtitle2", sx: { fontWeight: 600 }, noWrap: !banner, children: content.title }),
|
|
2415
745
|
content.body && /* @__PURE__ */ jsx(Typography5, { variant: "body2", sx: { color: "text.secondary" }, children: content.body }),
|
|
2416
746
|
link && content.cta && /* @__PURE__ */ jsx(Typography5, { variant: "caption", sx: { color: "primary.main", fontWeight: 600, mt: "auto" }, children: content.cta })
|
|
2417
747
|
] })
|
|
2418
748
|
] });
|
|
2419
|
-
return /* @__PURE__ */ jsx(
|
|
2420
|
-
}
|
|
2421
|
-
var PAGE_GAP = 3;
|
|
2422
|
-
var GRID_GAP = 3;
|
|
2423
|
-
function PageContent({
|
|
2424
|
-
children,
|
|
2425
|
-
gap = PAGE_GAP,
|
|
2426
|
-
fill,
|
|
2427
|
-
sx,
|
|
2428
|
-
ref,
|
|
2429
|
-
...rest
|
|
2430
|
-
}) {
|
|
2431
|
-
return /* @__PURE__ */ jsx(
|
|
2432
|
-
Stack,
|
|
2433
|
-
{
|
|
2434
|
-
ref,
|
|
2435
|
-
spacing: gap,
|
|
2436
|
-
sx: { ...fill && { flex: 1 }, ...sx },
|
|
2437
|
-
...rest,
|
|
2438
|
-
children
|
|
2439
|
-
}
|
|
2440
|
-
);
|
|
2441
|
-
}
|
|
2442
|
-
var COLUMN_SIZE = {
|
|
2443
|
-
1: { xs: 12, md: 12 },
|
|
2444
|
-
2: { xs: 12, md: 6 },
|
|
2445
|
-
3: { xs: 12, sm: 6, md: 4 },
|
|
2446
|
-
4: { xs: 12, sm: 6, md: 3 }
|
|
2447
|
-
};
|
|
2448
|
-
function CardGrid({ children, columns = 2, gap = GRID_GAP, sx }) {
|
|
2449
|
-
const size = COLUMN_SIZE[columns] ?? COLUMN_SIZE[2];
|
|
2450
|
-
return /* @__PURE__ */ jsx(Grid, { container: true, spacing: gap, sx, children: Children.map(
|
|
2451
|
-
children,
|
|
2452
|
-
(child) => child != null ? /* @__PURE__ */ jsx(Grid, { size, sx: { display: "flex" }, children: child }) : null
|
|
2453
|
-
) });
|
|
749
|
+
return /* @__PURE__ */ jsx(Card, { variant: "outlined", sx: { height: "100%" }, ...id !== void 0 && { "data-sponsored": id }, children: link ? /* @__PURE__ */ jsx(CardActionArea, { component: link.component, ...link.props, onClick: onOpen, sx: { height: "100%" }, children: body }) : body });
|
|
2454
750
|
}
|
|
2455
|
-
var ImageRoot = styled(
|
|
751
|
+
var ImageRoot = styled(Box9, {
|
|
2456
752
|
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
2457
753
|
})(({ theme, ownerState }) => {
|
|
2458
754
|
const { ratio, hasError } = ownerState;
|
|
@@ -2493,7 +789,7 @@ var StyledImg = styled("img")(() => ({
|
|
|
2493
789
|
objectFit: "cover",
|
|
2494
790
|
display: "block"
|
|
2495
791
|
}));
|
|
2496
|
-
var PlaceholderBox = styled(
|
|
792
|
+
var PlaceholderBox = styled(Box9)(({ theme }) => ({
|
|
2497
793
|
position: "absolute",
|
|
2498
794
|
top: 0,
|
|
2499
795
|
left: 0,
|
|
@@ -2518,7 +814,7 @@ var PlaceholderBox = styled(Box19)(({ theme }) => ({
|
|
|
2518
814
|
}
|
|
2519
815
|
}
|
|
2520
816
|
}));
|
|
2521
|
-
var OverlayBox = styled(
|
|
817
|
+
var OverlayBox = styled(Box9)(() => ({
|
|
2522
818
|
position: "absolute",
|
|
2523
819
|
top: 0,
|
|
2524
820
|
left: 0,
|
|
@@ -2528,7 +824,7 @@ var OverlayBox = styled(Box19)(() => ({
|
|
|
2528
824
|
alignItems: "center",
|
|
2529
825
|
justifyContent: "center"
|
|
2530
826
|
}));
|
|
2531
|
-
var FallbackBox = styled(
|
|
827
|
+
var FallbackBox = styled(Box9)(({ theme }) => ({
|
|
2532
828
|
width: "100%",
|
|
2533
829
|
height: "100%",
|
|
2534
830
|
minHeight: 100,
|
|
@@ -2600,134 +896,17 @@ function Image({
|
|
|
2600
896
|
overlay && /* @__PURE__ */ jsx(OverlayBox, { children: overlay })
|
|
2601
897
|
] });
|
|
2602
898
|
}
|
|
2603
|
-
function DefaultImageIcon() {
|
|
2604
|
-
return /* @__PURE__ */ jsx(
|
|
2605
|
-
"path",
|
|
2606
|
-
{
|
|
2607
|
-
fill: "currentColor",
|
|
2608
|
-
d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"
|
|
2609
|
-
}
|
|
2610
|
-
) });
|
|
2611
|
-
}
|
|
2612
|
-
function ImageWithDefault(props) {
|
|
2613
|
-
return /* @__PURE__ */ jsx(Image, { fallback: /* @__PURE__ */ jsx(DefaultImageIcon, {}), ...props });
|
|
2614
|
-
}
|
|
2615
|
-
var StyledLabel = styled("span", {
|
|
2616
|
-
shouldForwardProp: (prop) => prop !== "ownerState"
|
|
2617
|
-
})(({ theme, ownerState }) => {
|
|
2618
|
-
const isLight = theme.palette.mode === "light";
|
|
2619
|
-
const { color, variant, disabled } = ownerState;
|
|
2620
|
-
const paletteColor = color !== "default" ? theme.palette[color] : null;
|
|
2621
|
-
const safePalette = paletteColor ?? {
|
|
2622
|
-
main: theme.palette.grey[500],
|
|
2623
|
-
light: theme.palette.grey[300],
|
|
2624
|
-
dark: theme.palette.grey[700],
|
|
2625
|
-
contrastText: theme.palette.common.white
|
|
2626
|
-
};
|
|
2627
|
-
const borderRadius = typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius : 4;
|
|
2628
|
-
const baseStyles = {
|
|
2629
|
-
height: 24,
|
|
2630
|
-
minWidth: 24,
|
|
2631
|
-
lineHeight: 0,
|
|
2632
|
-
cursor: "default",
|
|
2633
|
-
borderRadius: borderRadius * 0.75,
|
|
2634
|
-
alignItems: "center",
|
|
2635
|
-
whiteSpace: "nowrap",
|
|
2636
|
-
display: "inline-flex",
|
|
2637
|
-
justifyContent: "center",
|
|
2638
|
-
textTransform: "capitalize",
|
|
2639
|
-
padding: theme.spacing(0, 0.75),
|
|
2640
|
-
fontSize: theme.typography.pxToRem(12),
|
|
2641
|
-
fontWeight: theme.typography.fontWeightBold,
|
|
2642
|
-
transition: theme.transitions.create(["all"], {
|
|
2643
|
-
duration: theme.transitions.duration.shorter
|
|
2644
|
-
}),
|
|
2645
|
-
...disabled && {
|
|
2646
|
-
opacity: 0.48,
|
|
2647
|
-
pointerEvents: "none"
|
|
2648
|
-
}
|
|
2649
|
-
};
|
|
2650
|
-
const filledStyles = {
|
|
2651
|
-
color: color === "default" ? isLight ? theme.palette.common.white : theme.palette.grey[800] : safePalette.contrastText,
|
|
2652
|
-
backgroundColor: color === "default" ? theme.palette.text.primary : safePalette.main
|
|
2653
|
-
};
|
|
2654
|
-
const outlinedStyles = {
|
|
2655
|
-
color: color === "default" ? theme.palette.text.primary : safePalette.main,
|
|
2656
|
-
backgroundColor: "transparent",
|
|
2657
|
-
border: `2px solid ${color === "default" ? alpha(theme.palette.grey[500], 0.32) : alpha(safePalette.main, 0.48)}`
|
|
2658
|
-
};
|
|
2659
|
-
const softStyles = {
|
|
2660
|
-
color: color === "default" ? theme.palette.text.secondary : isLight ? safePalette.dark : safePalette.light,
|
|
2661
|
-
backgroundColor: color === "default" ? alpha(theme.palette.grey[500], 0.16) : alpha(safePalette.main, 0.16)
|
|
2662
|
-
};
|
|
2663
|
-
const invertedStyles = {
|
|
2664
|
-
color: color === "default" ? theme.palette.text.primary : safePalette.dark,
|
|
2665
|
-
backgroundColor: theme.palette.common.white,
|
|
2666
|
-
border: `1px solid ${alpha(theme.palette.grey[500], 0.16)}`,
|
|
2667
|
-
...paletteColor && {
|
|
2668
|
-
boxShadow: `inset 0 0 0 1px ${alpha(paletteColor.main, 0.24)}`
|
|
2669
|
-
}
|
|
2670
|
-
};
|
|
2671
|
-
const variantStyles = {
|
|
2672
|
-
filled: filledStyles,
|
|
2673
|
-
outlined: outlinedStyles,
|
|
2674
|
-
soft: softStyles,
|
|
2675
|
-
inverted: invertedStyles
|
|
2676
|
-
};
|
|
2677
|
-
return {
|
|
2678
|
-
...baseStyles,
|
|
2679
|
-
...variantStyles[variant]
|
|
2680
|
-
};
|
|
2681
|
-
});
|
|
2682
|
-
function Label({
|
|
2683
|
-
children,
|
|
2684
|
-
color = "default",
|
|
2685
|
-
variant = "soft",
|
|
2686
|
-
startIcon,
|
|
2687
|
-
endIcon,
|
|
2688
|
-
sx,
|
|
2689
|
-
disabled,
|
|
2690
|
-
ref,
|
|
2691
|
-
...other
|
|
2692
|
-
}) {
|
|
2693
|
-
const ownerState = {
|
|
2694
|
-
color,
|
|
2695
|
-
variant,
|
|
2696
|
-
disabled
|
|
2697
|
-
};
|
|
2698
|
-
const iconStyles = {
|
|
2699
|
-
width: 16,
|
|
2700
|
-
height: 16,
|
|
2701
|
-
flexShrink: 0,
|
|
2702
|
-
"& svg, & img": { width: "100%", height: "100%" }
|
|
2703
|
-
};
|
|
2704
|
-
return /* @__PURE__ */ jsxs(StyledLabel, { ref, ownerState, sx, ...other, children: [
|
|
2705
|
-
startIcon && /* @__PURE__ */ jsx(Box19, { sx: { mr: 0.5, ...iconStyles }, children: startIcon }),
|
|
2706
|
-
children,
|
|
2707
|
-
endIcon && /* @__PURE__ */ jsx(Box19, { sx: { ml: 0.5, ...iconStyles }, children: endIcon })
|
|
2708
|
-
] });
|
|
2709
|
-
}
|
|
2710
|
-
function StatusLabel({
|
|
2711
|
-
status,
|
|
2712
|
-
...props
|
|
2713
|
-
}) {
|
|
2714
|
-
const statusConfig = {
|
|
2715
|
-
active: { color: "success", label: "Active" },
|
|
2716
|
-
inactive: { color: "default", label: "Inactive" },
|
|
2717
|
-
pending: { color: "warning", label: "Pending" },
|
|
2718
|
-
banned: { color: "error", label: "Banned" },
|
|
2719
|
-
rejected: { color: "error", label: "Rejected" }
|
|
2720
|
-
};
|
|
2721
|
-
const config = statusConfig[status];
|
|
2722
|
-
return /* @__PURE__ */ jsx(Label, { color: config.color, ...props, children: config.label });
|
|
899
|
+
function DefaultImageIcon() {
|
|
900
|
+
return /* @__PURE__ */ jsx(Box9, { component: "svg", viewBox: "0 0 24 24", sx: { width: 48, height: 48, opacity: 0.5 }, children: /* @__PURE__ */ jsx(
|
|
901
|
+
"path",
|
|
902
|
+
{
|
|
903
|
+
fill: "currentColor",
|
|
904
|
+
d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"
|
|
905
|
+
}
|
|
906
|
+
) });
|
|
2723
907
|
}
|
|
2724
|
-
function
|
|
2725
|
-
|
|
2726
|
-
trueText = "Yes",
|
|
2727
|
-
falseText = "No",
|
|
2728
|
-
...props
|
|
2729
|
-
}) {
|
|
2730
|
-
return /* @__PURE__ */ jsx(Label, { color: value ? "success" : "error", ...props, children: value ? trueText : falseText });
|
|
908
|
+
function ImageWithDefault(props) {
|
|
909
|
+
return /* @__PURE__ */ jsx(Image, { fallback: /* @__PURE__ */ jsx(DefaultImageIcon, {}), ...props });
|
|
2731
910
|
}
|
|
2732
911
|
var MINUTE = 6e4;
|
|
2733
912
|
var HOUR = 60 * MINUTE;
|
|
@@ -2817,7 +996,7 @@ function Rail({
|
|
|
2817
996
|
if (el) el.scrollBy({ left: direction * el.clientWidth * 0.9, behavior: "smooth" });
|
|
2818
997
|
};
|
|
2819
998
|
const arrow = (direction, show, label) => show ? /* @__PURE__ */ jsx(
|
|
2820
|
-
|
|
999
|
+
IconButton2,
|
|
2821
1000
|
{
|
|
2822
1001
|
size: "small",
|
|
2823
1002
|
"aria-label": label,
|
|
@@ -2837,7 +1016,7 @@ function Rail({
|
|
|
2837
1016
|
}
|
|
2838
1017
|
) : null;
|
|
2839
1018
|
return /* @__PURE__ */ jsxs(
|
|
2840
|
-
|
|
1019
|
+
Box9,
|
|
2841
1020
|
{
|
|
2842
1021
|
component: "section",
|
|
2843
1022
|
"aria-label": ariaLabel,
|
|
@@ -2846,7 +1025,7 @@ function Rail({
|
|
|
2846
1025
|
children: [
|
|
2847
1026
|
arrow(-1, reach.back, labels?.previous ?? "Previous"),
|
|
2848
1027
|
/* @__PURE__ */ jsx(
|
|
2849
|
-
|
|
1028
|
+
Box9,
|
|
2850
1029
|
{
|
|
2851
1030
|
component: "ul",
|
|
2852
1031
|
ref: track,
|
|
@@ -2869,7 +1048,7 @@ function Rail({
|
|
|
2869
1048
|
},
|
|
2870
1049
|
children: Children.map(
|
|
2871
1050
|
children,
|
|
2872
|
-
(child) => child == null || child === false ? null : /* @__PURE__ */ jsx(
|
|
1051
|
+
(child) => child == null || child === false ? null : /* @__PURE__ */ jsx(Box9, { component: "li", sx: { scrollSnapAlign: "start", minWidth: 0 }, children: child })
|
|
2873
1052
|
)
|
|
2874
1053
|
}
|
|
2875
1054
|
),
|
|
@@ -2878,120 +1057,6 @@ function Rail({
|
|
|
2878
1057
|
}
|
|
2879
1058
|
);
|
|
2880
1059
|
}
|
|
2881
|
-
var LoadingContent = styled("div")(({ theme }) => ({
|
|
2882
|
-
flexGrow: 1,
|
|
2883
|
-
width: "100%",
|
|
2884
|
-
display: "flex",
|
|
2885
|
-
minHeight: "100%",
|
|
2886
|
-
alignItems: "center",
|
|
2887
|
-
justifyContent: "center",
|
|
2888
|
-
paddingLeft: theme.spacing(5),
|
|
2889
|
-
paddingRight: theme.spacing(5)
|
|
2890
|
-
}));
|
|
2891
|
-
function LoadingScreen({ portal, slots, slotProps, sx, ...other }) {
|
|
2892
|
-
const Wrapper = portal ? Portal : Fragment$1;
|
|
2893
|
-
return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(LoadingContent, { sx, ...other, children: slots?.progress ?? /* @__PURE__ */ jsx(
|
|
2894
|
-
MuiLinearProgress,
|
|
2895
|
-
{
|
|
2896
|
-
color: "inherit",
|
|
2897
|
-
sx: [
|
|
2898
|
-
{ width: 1, maxWidth: 360 },
|
|
2899
|
-
...Array.isArray(slotProps?.progress?.sx) ? slotProps.progress.sx : [slotProps?.progress?.sx]
|
|
2900
|
-
],
|
|
2901
|
-
...slotProps?.progress
|
|
2902
|
-
}
|
|
2903
|
-
) }) });
|
|
2904
|
-
}
|
|
2905
|
-
var SplashContainer = styled(Box19, {
|
|
2906
|
-
shouldForwardProp: (prop) => prop !== "fullScreen"
|
|
2907
|
-
})(({ theme, fullScreen }) => ({
|
|
2908
|
-
display: "flex",
|
|
2909
|
-
flexDirection: "column",
|
|
2910
|
-
alignItems: "center",
|
|
2911
|
-
justifyContent: "center",
|
|
2912
|
-
gap: theme.spacing(2),
|
|
2913
|
-
padding: theme.spacing(3),
|
|
2914
|
-
...fullScreen ? {
|
|
2915
|
-
position: "fixed",
|
|
2916
|
-
top: 0,
|
|
2917
|
-
left: 0,
|
|
2918
|
-
right: 0,
|
|
2919
|
-
bottom: 0,
|
|
2920
|
-
zIndex: theme.zIndex.modal + 1,
|
|
2921
|
-
backgroundColor: theme.palette.background.default
|
|
2922
|
-
} : {
|
|
2923
|
-
flexGrow: 1,
|
|
2924
|
-
width: "100%",
|
|
2925
|
-
minHeight: 200
|
|
2926
|
-
}
|
|
2927
|
-
}));
|
|
2928
|
-
function SplashScreen({
|
|
2929
|
-
variant = "circular",
|
|
2930
|
-
message,
|
|
2931
|
-
indicator,
|
|
2932
|
-
portal = false,
|
|
2933
|
-
size = 48,
|
|
2934
|
-
progress,
|
|
2935
|
-
fullScreen = false,
|
|
2936
|
-
sx
|
|
2937
|
-
}) {
|
|
2938
|
-
const Wrapper = portal ? Portal : Fragment$1;
|
|
2939
|
-
const isDeterminate = progress !== void 0;
|
|
2940
|
-
const renderIndicator = () => {
|
|
2941
|
-
if (indicator) return indicator;
|
|
2942
|
-
if (variant === "linear") {
|
|
2943
|
-
return /* @__PURE__ */ jsx(
|
|
2944
|
-
MuiLinearProgress,
|
|
2945
|
-
{
|
|
2946
|
-
variant: isDeterminate ? "determinate" : "indeterminate",
|
|
2947
|
-
value: progress,
|
|
2948
|
-
color: "primary",
|
|
2949
|
-
sx: { width: "100%", maxWidth: 360, borderRadius: 1 }
|
|
2950
|
-
}
|
|
2951
|
-
);
|
|
2952
|
-
}
|
|
2953
|
-
return /* @__PURE__ */ jsx(
|
|
2954
|
-
CircularProgress,
|
|
2955
|
-
{
|
|
2956
|
-
variant: isDeterminate ? "determinate" : "indeterminate",
|
|
2957
|
-
value: progress,
|
|
2958
|
-
size,
|
|
2959
|
-
thickness: 3,
|
|
2960
|
-
color: "primary"
|
|
2961
|
-
}
|
|
2962
|
-
);
|
|
2963
|
-
};
|
|
2964
|
-
return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(SplashContainer, { fullScreen, sx, children: [
|
|
2965
|
-
renderIndicator(),
|
|
2966
|
-
message && /* @__PURE__ */ jsx(
|
|
2967
|
-
Typography5,
|
|
2968
|
-
{
|
|
2969
|
-
variant: "body2",
|
|
2970
|
-
sx: {
|
|
2971
|
-
color: "text.secondary",
|
|
2972
|
-
mt: 1,
|
|
2973
|
-
textAlign: "center"
|
|
2974
|
-
},
|
|
2975
|
-
children: message
|
|
2976
|
-
}
|
|
2977
|
-
),
|
|
2978
|
-
isDeterminate && /* @__PURE__ */ jsxs(Typography5, { variant: "caption", sx: {
|
|
2979
|
-
color: "text.disabled"
|
|
2980
|
-
}, children: [
|
|
2981
|
-
Math.round(progress),
|
|
2982
|
-
"%"
|
|
2983
|
-
] })
|
|
2984
|
-
] }) });
|
|
2985
|
-
}
|
|
2986
|
-
var sizeMap = {
|
|
2987
|
-
small: 20,
|
|
2988
|
-
medium: 32,
|
|
2989
|
-
large: 48
|
|
2990
|
-
};
|
|
2991
|
-
function Spinner({ size = "medium", color = "primary", sx }) {
|
|
2992
|
-
const computedSize = typeof size === "number" ? size : sizeMap[size];
|
|
2993
|
-
return /* @__PURE__ */ jsx(CircularProgress, { size: computedSize, color, thickness: 3.5, sx });
|
|
2994
|
-
}
|
|
2995
1060
|
function computeSize(count, min, max) {
|
|
2996
1061
|
if (max === min) return 1;
|
|
2997
1062
|
const t = (count - min) / (max - min);
|
|
@@ -3029,10 +1094,10 @@ function TagCloud({
|
|
|
3029
1094
|
/* @__PURE__ */ jsx(
|
|
3030
1095
|
ListItemText,
|
|
3031
1096
|
{
|
|
3032
|
-
primary: /* @__PURE__ */ jsxs(
|
|
1097
|
+
primary: /* @__PURE__ */ jsxs(Box9, { component: "span", sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: [
|
|
3033
1098
|
/* @__PURE__ */ jsx("span", { children: `#${tag.name}` }),
|
|
3034
1099
|
tag.trending && /* @__PURE__ */ jsx(
|
|
3035
|
-
|
|
1100
|
+
Box9,
|
|
3036
1101
|
{
|
|
3037
1102
|
component: "span",
|
|
3038
1103
|
sx: {
|
|
@@ -3083,7 +1148,7 @@ function TagCloud({
|
|
|
3083
1148
|
const min = counts.length > 0 ? Math.min(...counts) : 0;
|
|
3084
1149
|
const max = counts.length > 0 ? Math.max(...counts) : 0;
|
|
3085
1150
|
return /* @__PURE__ */ jsx(
|
|
3086
|
-
|
|
1151
|
+
Stack2,
|
|
3087
1152
|
{
|
|
3088
1153
|
direction: "row",
|
|
3089
1154
|
useFlexGap: true,
|
|
@@ -3096,9 +1161,9 @@ function TagCloud({
|
|
|
3096
1161
|
const size = computeSize(tag.postCount, min, max);
|
|
3097
1162
|
const isFeatured = tag.status === "featured";
|
|
3098
1163
|
return /* @__PURE__ */ jsx(
|
|
3099
|
-
|
|
1164
|
+
Chip2,
|
|
3100
1165
|
{
|
|
3101
|
-
label: /* @__PURE__ */ jsxs(
|
|
1166
|
+
label: /* @__PURE__ */ jsxs(Box9, { component: "span", sx: { display: "inline-flex", alignItems: "center", gap: 0.5 }, children: [
|
|
3102
1167
|
/* @__PURE__ */ jsx("span", { children: `#${tag.name}` }),
|
|
3103
1168
|
renderAdornment?.(tag)
|
|
3104
1169
|
] }),
|
|
@@ -3127,134 +1192,6 @@ function TagCloud({
|
|
|
3127
1192
|
}
|
|
3128
1193
|
);
|
|
3129
1194
|
}
|
|
3130
|
-
var SnackbarContext = createContext(null);
|
|
3131
|
-
function useSnackbar() {
|
|
3132
|
-
const context = useContext(SnackbarContext);
|
|
3133
|
-
if (!context) {
|
|
3134
|
-
throw new Error("useSnackbar must be used within a SnackbarProvider");
|
|
3135
|
-
}
|
|
3136
|
-
return context;
|
|
3137
|
-
}
|
|
3138
|
-
var defaultState = {
|
|
3139
|
-
open: false,
|
|
3140
|
-
message: "",
|
|
3141
|
-
severity: "info",
|
|
3142
|
-
duration: 5e3,
|
|
3143
|
-
position: { vertical: "bottom", horizontal: "left" },
|
|
3144
|
-
key: 0
|
|
3145
|
-
};
|
|
3146
|
-
function SnackbarProvider({
|
|
3147
|
-
children,
|
|
3148
|
-
defaultDuration = 5e3,
|
|
3149
|
-
defaultPosition = { vertical: "bottom", horizontal: "left" },
|
|
3150
|
-
sx
|
|
3151
|
-
}) {
|
|
3152
|
-
const [state, setState] = useState({
|
|
3153
|
-
...defaultState,
|
|
3154
|
-
duration: defaultDuration,
|
|
3155
|
-
position: defaultPosition
|
|
3156
|
-
});
|
|
3157
|
-
const show = useCallback(
|
|
3158
|
-
(options) => {
|
|
3159
|
-
const opts = typeof options === "string" ? { message: options } : options;
|
|
3160
|
-
setState((prev) => ({
|
|
3161
|
-
open: true,
|
|
3162
|
-
message: opts.message,
|
|
3163
|
-
severity: opts.severity ?? "info",
|
|
3164
|
-
duration: opts.duration ?? defaultDuration,
|
|
3165
|
-
position: opts.position ?? defaultPosition,
|
|
3166
|
-
action: opts.action,
|
|
3167
|
-
key: opts.key ?? Date.now()
|
|
3168
|
-
}));
|
|
3169
|
-
},
|
|
3170
|
-
[defaultDuration, defaultPosition]
|
|
3171
|
-
);
|
|
3172
|
-
const success = useCallback(
|
|
3173
|
-
(message, options) => {
|
|
3174
|
-
show({ message, severity: "success", ...options });
|
|
3175
|
-
},
|
|
3176
|
-
[show]
|
|
3177
|
-
);
|
|
3178
|
-
const error = useCallback(
|
|
3179
|
-
(message, options) => {
|
|
3180
|
-
show({ message, severity: "error", ...options });
|
|
3181
|
-
},
|
|
3182
|
-
[show]
|
|
3183
|
-
);
|
|
3184
|
-
const warning = useCallback(
|
|
3185
|
-
(message, options) => {
|
|
3186
|
-
show({ message, severity: "warning", ...options });
|
|
3187
|
-
},
|
|
3188
|
-
[show]
|
|
3189
|
-
);
|
|
3190
|
-
const info = useCallback(
|
|
3191
|
-
(message, options) => {
|
|
3192
|
-
show({ message, severity: "info", ...options });
|
|
3193
|
-
},
|
|
3194
|
-
[show]
|
|
3195
|
-
);
|
|
3196
|
-
const close = useCallback(() => {
|
|
3197
|
-
setState((prev) => ({ ...prev, open: false }));
|
|
3198
|
-
}, []);
|
|
3199
|
-
const handleClose = useCallback(
|
|
3200
|
-
(_event, reason) => {
|
|
3201
|
-
if (reason === "clickaway") return;
|
|
3202
|
-
close();
|
|
3203
|
-
},
|
|
3204
|
-
[close]
|
|
3205
|
-
);
|
|
3206
|
-
const value = useMemo(
|
|
3207
|
-
() => ({
|
|
3208
|
-
show,
|
|
3209
|
-
success,
|
|
3210
|
-
error,
|
|
3211
|
-
warning,
|
|
3212
|
-
info,
|
|
3213
|
-
close
|
|
3214
|
-
}),
|
|
3215
|
-
[show, success, error, warning, info, close]
|
|
3216
|
-
);
|
|
3217
|
-
return /* @__PURE__ */ jsxs(SnackbarContext.Provider, { value, children: [
|
|
3218
|
-
children,
|
|
3219
|
-
/* @__PURE__ */ jsx(
|
|
3220
|
-
Snackbar,
|
|
3221
|
-
{
|
|
3222
|
-
open: state.open,
|
|
3223
|
-
autoHideDuration: state.duration,
|
|
3224
|
-
onClose: handleClose,
|
|
3225
|
-
anchorOrigin: state.position,
|
|
3226
|
-
sx,
|
|
3227
|
-
children: /* @__PURE__ */ jsx(
|
|
3228
|
-
MuiAlert,
|
|
3229
|
-
{
|
|
3230
|
-
severity: state.severity,
|
|
3231
|
-
variant: "filled",
|
|
3232
|
-
onClose: handleClose,
|
|
3233
|
-
action: state.action || /* @__PURE__ */ jsx(IconButton4, { size: "small", "aria-label": "close", color: "inherit", onClick: close, children: /* @__PURE__ */ jsx(CloseIcon, { fontSize: "small" }) }),
|
|
3234
|
-
sx: { width: "100%", alignItems: "center" },
|
|
3235
|
-
children: state.message
|
|
3236
|
-
}
|
|
3237
|
-
)
|
|
3238
|
-
},
|
|
3239
|
-
state.key
|
|
3240
|
-
)
|
|
3241
|
-
] });
|
|
3242
|
-
}
|
|
3243
|
-
function SimpleSnackbar({
|
|
3244
|
-
open,
|
|
3245
|
-
onClose,
|
|
3246
|
-
message,
|
|
3247
|
-
severity = "info",
|
|
3248
|
-
duration = 5e3,
|
|
3249
|
-
position = { vertical: "bottom", horizontal: "left" },
|
|
3250
|
-
sx
|
|
3251
|
-
}) {
|
|
3252
|
-
const handleClose = (_event, reason) => {
|
|
3253
|
-
if (reason === "clickaway") return;
|
|
3254
|
-
onClose();
|
|
3255
|
-
};
|
|
3256
|
-
return /* @__PURE__ */ jsx(Snackbar, { open, autoHideDuration: duration, onClose: handleClose, anchorOrigin: position, sx, children: /* @__PURE__ */ jsx(MuiAlert, { severity, variant: "filled", onClose: handleClose, sx: { width: "100%" }, children: message }) });
|
|
3257
|
-
}
|
|
3258
1195
|
var SvgRoot = styled("span")(() => ({
|
|
3259
1196
|
flexShrink: 0,
|
|
3260
1197
|
display: "inline-flex",
|
|
@@ -3287,300 +1224,22 @@ function createIconComponent(basePath) {
|
|
|
3287
1224
|
}
|
|
3288
1225
|
return Icon;
|
|
3289
1226
|
}
|
|
3290
|
-
|
|
3291
|
-
borderRadius: theme.shape.borderRadius,
|
|
3292
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
3293
|
-
overflow: "auto"
|
|
3294
|
-
}));
|
|
3295
|
-
var StyledTableHead2 = styled(TableHead)(({ theme }) => ({
|
|
3296
|
-
backgroundColor: alpha(theme.palette.grey[500], 0.08),
|
|
3297
|
-
"& .MuiTableCell-head": {
|
|
3298
|
-
fontWeight: 600,
|
|
3299
|
-
backgroundColor: "transparent"
|
|
3300
|
-
}
|
|
3301
|
-
}));
|
|
3302
|
-
var StyledTableRow2 = styled(TableRow)(({ theme }) => ({
|
|
3303
|
-
"&:hover": {
|
|
3304
|
-
backgroundColor: alpha(theme.palette.primary.main, 0.04)
|
|
3305
|
-
},
|
|
3306
|
-
"&.Mui-selected": {
|
|
3307
|
-
backgroundColor: alpha(theme.palette.primary.main, 0.08),
|
|
3308
|
-
"&:hover": {
|
|
3309
|
-
backgroundColor: alpha(theme.palette.primary.main, 0.12)
|
|
3310
|
-
}
|
|
3311
|
-
}
|
|
3312
|
-
}));
|
|
3313
|
-
function Table({
|
|
3314
|
-
columns,
|
|
3315
|
-
data,
|
|
3316
|
-
rowKey = "id",
|
|
3317
|
-
selectable = false,
|
|
3318
|
-
selected = [],
|
|
3319
|
-
onSelectChange,
|
|
3320
|
-
sortable = false,
|
|
3321
|
-
sortBy,
|
|
3322
|
-
sortOrder = "asc",
|
|
3323
|
-
onSortChange,
|
|
3324
|
-
paginated = false,
|
|
3325
|
-
page = 0,
|
|
3326
|
-
rowsPerPage = 10,
|
|
3327
|
-
totalRows,
|
|
3328
|
-
onPageChange,
|
|
3329
|
-
onRowsPerPageChange,
|
|
3330
|
-
rowsPerPageOptions = [5, 10, 25, 50],
|
|
3331
|
-
emptyContent,
|
|
3332
|
-
loading = false,
|
|
3333
|
-
loadingRows = 5,
|
|
3334
|
-
dense = false,
|
|
3335
|
-
stickyHeader = false,
|
|
3336
|
-
maxHeight,
|
|
3337
|
-
onRowClick,
|
|
3338
|
-
containerSx,
|
|
3339
|
-
sx,
|
|
3340
|
-
ref,
|
|
3341
|
-
...other
|
|
3342
|
-
}) {
|
|
3343
|
-
const getRowKey = useCallback(
|
|
3344
|
-
(row, index) => {
|
|
3345
|
-
if (typeof rowKey === "function") {
|
|
3346
|
-
return rowKey(row);
|
|
3347
|
-
}
|
|
3348
|
-
const keyValue = row[rowKey];
|
|
3349
|
-
return keyValue !== void 0 ? String(keyValue) : index;
|
|
3350
|
-
},
|
|
3351
|
-
[rowKey]
|
|
3352
|
-
);
|
|
3353
|
-
const isAllSelected = useMemo(
|
|
3354
|
-
() => data.length > 0 && selected.length === data.length,
|
|
3355
|
-
[data.length, selected.length]
|
|
3356
|
-
);
|
|
3357
|
-
const isIndeterminate = useMemo(
|
|
3358
|
-
() => selected.length > 0 && selected.length < data.length,
|
|
3359
|
-
[data.length, selected.length]
|
|
3360
|
-
);
|
|
3361
|
-
const handleSelectAll = useCallback(
|
|
3362
|
-
(event) => {
|
|
3363
|
-
if (event.target.checked) {
|
|
3364
|
-
const allKeys = data.map((row, index) => getRowKey(row, index));
|
|
3365
|
-
onSelectChange?.(allKeys);
|
|
3366
|
-
} else {
|
|
3367
|
-
onSelectChange?.([]);
|
|
3368
|
-
}
|
|
3369
|
-
},
|
|
3370
|
-
[data, getRowKey, onSelectChange]
|
|
3371
|
-
);
|
|
3372
|
-
const handleSelectRow = useCallback(
|
|
3373
|
-
(key) => {
|
|
3374
|
-
const newSelected = selected.includes(key) ? selected.filter((k) => k !== key) : [...selected, key];
|
|
3375
|
-
onSelectChange?.(newSelected);
|
|
3376
|
-
},
|
|
3377
|
-
[selected, onSelectChange]
|
|
3378
|
-
);
|
|
3379
|
-
const handleSort = useCallback(
|
|
3380
|
-
(columnId) => {
|
|
3381
|
-
const isAsc = sortBy === columnId && sortOrder === "asc";
|
|
3382
|
-
onSortChange?.(columnId, isAsc ? "desc" : "asc");
|
|
3383
|
-
},
|
|
3384
|
-
[sortBy, sortOrder, onSortChange]
|
|
3385
|
-
);
|
|
3386
|
-
const handlePageChange = useCallback(
|
|
3387
|
-
(_, newPage) => {
|
|
3388
|
-
onPageChange?.(newPage);
|
|
3389
|
-
},
|
|
3390
|
-
[onPageChange]
|
|
3391
|
-
);
|
|
3392
|
-
const handleRowsPerPageChange = useCallback(
|
|
3393
|
-
(event) => {
|
|
3394
|
-
onRowsPerPageChange?.(parseInt(event.target.value, 10));
|
|
3395
|
-
onPageChange?.(0);
|
|
3396
|
-
},
|
|
3397
|
-
[onRowsPerPageChange, onPageChange]
|
|
3398
|
-
);
|
|
3399
|
-
const total = totalRows ?? data.length;
|
|
3400
|
-
const displayData = useMemo(() => {
|
|
3401
|
-
if (paginated && !totalRows) {
|
|
3402
|
-
return data.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage);
|
|
3403
|
-
}
|
|
3404
|
-
return data;
|
|
3405
|
-
}, [data, paginated, page, rowsPerPage, totalRows]);
|
|
3406
|
-
if (!loading && data.length === 0) {
|
|
3407
|
-
return /* @__PURE__ */ jsx(StyledTableContainer2, { sx: containerSx, children: /* @__PURE__ */ jsx(Box19, { sx: { p: 4, textAlign: "center" }, children: emptyContent || /* @__PURE__ */ jsx(Typography5, { sx: {
|
|
3408
|
-
color: "text.secondary"
|
|
3409
|
-
}, children: "No data available" }) }) });
|
|
3410
|
-
}
|
|
3411
|
-
return /* @__PURE__ */ jsxs(
|
|
3412
|
-
StyledTableContainer2,
|
|
3413
|
-
{
|
|
3414
|
-
sx: {
|
|
3415
|
-
maxHeight,
|
|
3416
|
-
...containerSx
|
|
3417
|
-
},
|
|
3418
|
-
children: [
|
|
3419
|
-
/* @__PURE__ */ jsxs(MuiTable, { ref, stickyHeader, size: dense ? "small" : "medium", sx, ...other, children: [
|
|
3420
|
-
/* @__PURE__ */ jsx(StyledTableHead2, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
3421
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(Checkbox, { indeterminate: isIndeterminate, checked: isAllSelected, onChange: handleSelectAll }) }),
|
|
3422
|
-
columns.map((column) => /* @__PURE__ */ jsx(
|
|
3423
|
-
TableCell,
|
|
3424
|
-
{
|
|
3425
|
-
align: column.align || "left",
|
|
3426
|
-
style: { width: column.width, minWidth: column.minWidth },
|
|
3427
|
-
sortDirection: sortBy === column.id ? sortOrder : false,
|
|
3428
|
-
children: sortable && column.sortable !== false ? /* @__PURE__ */ jsx(
|
|
3429
|
-
TableSortLabel,
|
|
3430
|
-
{
|
|
3431
|
-
active: sortBy === column.id,
|
|
3432
|
-
direction: sortBy === column.id ? sortOrder : "asc",
|
|
3433
|
-
onClick: () => handleSort(String(column.id)),
|
|
3434
|
-
children: column.label
|
|
3435
|
-
}
|
|
3436
|
-
) : column.label
|
|
3437
|
-
},
|
|
3438
|
-
String(column.id)
|
|
3439
|
-
))
|
|
3440
|
-
] }) }),
|
|
3441
|
-
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
3442
|
-
loading && Array.from({ length: Math.max(1, loadingRows) }, (_, rowIndex) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
3443
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(Skeleton3, { variant: "rectangular", width: 18, height: 18 }) }),
|
|
3444
|
-
columns.map((column) => /* @__PURE__ */ jsx(TableCell, { align: column.align || "left", children: /* @__PURE__ */ jsx(Skeleton3, { variant: "text", width: column.width ?? "80%" }) }, String(column.id)))
|
|
3445
|
-
] }, `loading-${rowIndex}`)),
|
|
3446
|
-
!loading && displayData.map((row, index) => {
|
|
3447
|
-
const key = getRowKey(row, index);
|
|
3448
|
-
const isSelected = selected.includes(key);
|
|
3449
|
-
return /* @__PURE__ */ jsxs(
|
|
3450
|
-
StyledTableRow2,
|
|
3451
|
-
{
|
|
3452
|
-
hover: true,
|
|
3453
|
-
selected: isSelected,
|
|
3454
|
-
onClick: () => onRowClick?.(row, index),
|
|
3455
|
-
sx: { cursor: onRowClick ? "pointer" : "default" },
|
|
3456
|
-
children: [
|
|
3457
|
-
selectable && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(
|
|
3458
|
-
Checkbox,
|
|
3459
|
-
{
|
|
3460
|
-
checked: isSelected,
|
|
3461
|
-
onClick: (e) => e.stopPropagation(),
|
|
3462
|
-
onChange: () => handleSelectRow(key)
|
|
3463
|
-
}
|
|
3464
|
-
) }),
|
|
3465
|
-
columns.map((column) => {
|
|
3466
|
-
const value = row[column.id];
|
|
3467
|
-
return /* @__PURE__ */ jsx(TableCell, { align: column.align || "left", children: column.render ? column.render(row, index) : column.format ? column.format(value) : String(value ?? "") }, String(column.id));
|
|
3468
|
-
})
|
|
3469
|
-
]
|
|
3470
|
-
},
|
|
3471
|
-
key
|
|
3472
|
-
);
|
|
3473
|
-
})
|
|
3474
|
-
] })
|
|
3475
|
-
] }),
|
|
3476
|
-
paginated && /* @__PURE__ */ jsx(
|
|
3477
|
-
TablePagination,
|
|
3478
|
-
{
|
|
3479
|
-
component: "div",
|
|
3480
|
-
count: total,
|
|
3481
|
-
page,
|
|
3482
|
-
rowsPerPage,
|
|
3483
|
-
rowsPerPageOptions,
|
|
3484
|
-
onPageChange: handlePageChange,
|
|
3485
|
-
onRowsPerPageChange: handleRowsPerPageChange
|
|
3486
|
-
}
|
|
3487
|
-
)
|
|
3488
|
-
]
|
|
3489
|
-
}
|
|
3490
|
-
);
|
|
3491
|
-
}
|
|
3492
|
-
function useTable({
|
|
3493
|
-
data,
|
|
3494
|
-
defaultPage = 0,
|
|
3495
|
-
defaultRowsPerPage = 10,
|
|
3496
|
-
defaultSortBy,
|
|
3497
|
-
defaultSortOrder = "asc"
|
|
3498
|
-
}) {
|
|
3499
|
-
const [page, setPage] = useState(defaultPage);
|
|
3500
|
-
const [rowsPerPage, setRowsPerPage] = useState(defaultRowsPerPage);
|
|
3501
|
-
const [sortBy, setSortBy] = useState(defaultSortBy);
|
|
3502
|
-
const [sortOrder, setSortOrder] = useState(defaultSortOrder);
|
|
3503
|
-
const [selected, setSelected] = useState([]);
|
|
3504
|
-
const handleSort = useCallback((column, order) => {
|
|
3505
|
-
setSortBy(column);
|
|
3506
|
-
setSortOrder(order);
|
|
3507
|
-
}, []);
|
|
3508
|
-
const sortedData = useMemo(() => {
|
|
3509
|
-
if (!sortBy) return data;
|
|
3510
|
-
return [...data].sort((a, b) => {
|
|
3511
|
-
const aValue = a[sortBy];
|
|
3512
|
-
const bValue = b[sortBy];
|
|
3513
|
-
if (aValue === bValue) return 0;
|
|
3514
|
-
if (aValue === null || aValue === void 0) return 1;
|
|
3515
|
-
if (bValue === null || bValue === void 0) return -1;
|
|
3516
|
-
const comparison = aValue < bValue ? -1 : 1;
|
|
3517
|
-
return sortOrder === "asc" ? comparison : -comparison;
|
|
3518
|
-
});
|
|
3519
|
-
}, [data, sortBy, sortOrder]);
|
|
3520
|
-
const displayData = useMemo(() => {
|
|
3521
|
-
const start = page * rowsPerPage;
|
|
3522
|
-
return sortedData.slice(start, start + rowsPerPage);
|
|
3523
|
-
}, [sortedData, page, rowsPerPage]);
|
|
3524
|
-
const reset = useCallback(() => {
|
|
3525
|
-
setPage(defaultPage);
|
|
3526
|
-
setRowsPerPage(defaultRowsPerPage);
|
|
3527
|
-
setSortBy(defaultSortBy);
|
|
3528
|
-
setSortOrder(defaultSortOrder);
|
|
3529
|
-
setSelected([]);
|
|
3530
|
-
}, [defaultPage, defaultRowsPerPage, defaultSortBy, defaultSortOrder]);
|
|
3531
|
-
return {
|
|
3532
|
-
page,
|
|
3533
|
-
setPage,
|
|
3534
|
-
rowsPerPage,
|
|
3535
|
-
setRowsPerPage,
|
|
3536
|
-
sortBy,
|
|
3537
|
-
sortOrder,
|
|
3538
|
-
handleSort,
|
|
3539
|
-
selected,
|
|
3540
|
-
setSelected,
|
|
3541
|
-
displayData,
|
|
3542
|
-
totalRows: data.length,
|
|
3543
|
-
reset
|
|
3544
|
-
};
|
|
3545
|
-
}
|
|
3546
|
-
function Skeleton5({ variant = "text", ...props }) {
|
|
3547
|
-
return /* @__PURE__ */ jsx(Skeleton3, { variant, ...props });
|
|
3548
|
-
}
|
|
3549
|
-
function CardSkeleton({ hasAvatar = true, lines = 2, width = "100%" }) {
|
|
3550
|
-
return /* @__PURE__ */ jsxs(Box19, { sx: { width, p: 2 }, children: [
|
|
3551
|
-
hasAvatar && /* @__PURE__ */ jsxs(Box19, { sx: { display: "flex", alignItems: "center", mb: 2 }, children: [
|
|
3552
|
-
/* @__PURE__ */ jsx(Skeleton5, { variant: "circular", width: 40, height: 40 }),
|
|
3553
|
-
/* @__PURE__ */ jsxs(Box19, { sx: { ml: 1, flex: 1 }, children: [
|
|
3554
|
-
/* @__PURE__ */ jsx(Skeleton5, { variant: "text", width: "60%" }),
|
|
3555
|
-
/* @__PURE__ */ jsx(Skeleton5, { variant: "text", width: "40%" })
|
|
3556
|
-
] })
|
|
3557
|
-
] }),
|
|
3558
|
-
/* @__PURE__ */ jsx(Skeleton5, { variant: "rectangular", width: "100%", height: 118, sx: { borderRadius: 1 } }),
|
|
3559
|
-
/* @__PURE__ */ jsx(Box19, { sx: { mt: 1 }, children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx(Skeleton5, { variant: "text", width: i === lines - 1 ? "80%" : "100%" }, i)) })
|
|
3560
|
-
] });
|
|
3561
|
-
}
|
|
3562
|
-
function TableSkeleton({ rows = 5, columns = 4, hasHeader = true }) {
|
|
3563
|
-
return /* @__PURE__ */ jsxs(Box19, { sx: { width: "100%" }, children: [
|
|
3564
|
-
hasHeader && /* @__PURE__ */ jsx(Box19, { sx: { display: "flex", gap: 2, mb: 1, pb: 1, borderBottom: 1, borderColor: "divider" }, children: Array.from({ length: columns }, (_, i) => /* @__PURE__ */ jsx(Skeleton5, { variant: "text", sx: { flex: 1 }, height: 24 }, i)) }),
|
|
3565
|
-
Array.from({ length: rows }, (_row, rowIndex) => /* @__PURE__ */ jsx(Box19, { sx: { display: "flex", gap: 2, py: 1 }, children: Array.from({ length: columns }, (_col, colIndex) => /* @__PURE__ */ jsx(Skeleton5, { variant: "text", sx: { flex: 1 } }, colIndex)) }, rowIndex))
|
|
3566
|
-
] });
|
|
3567
|
-
}
|
|
3568
|
-
function LinearProgress3({
|
|
1227
|
+
function LinearProgress({
|
|
3569
1228
|
color = "primary",
|
|
3570
1229
|
showLabel = false,
|
|
3571
1230
|
labelPosition = "end",
|
|
3572
|
-
formatLabel
|
|
1231
|
+
formatLabel,
|
|
3573
1232
|
value,
|
|
3574
1233
|
variant = value !== void 0 ? "determinate" : "indeterminate",
|
|
3575
1234
|
sx,
|
|
3576
1235
|
...props
|
|
3577
1236
|
}) {
|
|
3578
|
-
const label =
|
|
1237
|
+
const label = formatLabel ? formatLabel(value ?? 0) : `${Math.round(value ?? 0)}%`;
|
|
3579
1238
|
if (!showLabel) {
|
|
3580
1239
|
return /* @__PURE__ */ jsx(MuiLinearProgress, { variant, value, color, sx: { borderRadius: 1, ...sx }, ...props });
|
|
3581
1240
|
}
|
|
3582
1241
|
if (labelPosition === "below") {
|
|
3583
|
-
return /* @__PURE__ */ jsxs(
|
|
1242
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { width: "100%" }, children: [
|
|
3584
1243
|
/* @__PURE__ */ jsx(MuiLinearProgress, { variant, value, color, sx: { borderRadius: 1, ...sx }, ...props }),
|
|
3585
1244
|
/* @__PURE__ */ jsx(
|
|
3586
1245
|
Typography5,
|
|
@@ -3597,8 +1256,8 @@ function LinearProgress3({
|
|
|
3597
1256
|
)
|
|
3598
1257
|
] });
|
|
3599
1258
|
}
|
|
3600
|
-
return /* @__PURE__ */ jsxs(
|
|
3601
|
-
/* @__PURE__ */ jsx(
|
|
1259
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
1260
|
+
/* @__PURE__ */ jsx(Box9, { sx: { flex: 1 }, children: /* @__PURE__ */ jsx(MuiLinearProgress, { variant, value, color, sx: { borderRadius: 1, ...sx }, ...props }) }),
|
|
3602
1261
|
/* @__PURE__ */ jsx(
|
|
3603
1262
|
Typography5,
|
|
3604
1263
|
{
|
|
@@ -3612,23 +1271,23 @@ function LinearProgress3({
|
|
|
3612
1271
|
)
|
|
3613
1272
|
] });
|
|
3614
1273
|
}
|
|
3615
|
-
function
|
|
1274
|
+
function CircularProgress({
|
|
3616
1275
|
color = "primary",
|
|
3617
1276
|
showLabel = false,
|
|
3618
|
-
formatLabel
|
|
1277
|
+
formatLabel,
|
|
3619
1278
|
value,
|
|
3620
1279
|
variant = value !== void 0 ? "determinate" : "indeterminate",
|
|
3621
1280
|
size = 40,
|
|
3622
1281
|
...props
|
|
3623
1282
|
}) {
|
|
3624
1283
|
if (!showLabel || variant === "indeterminate") {
|
|
3625
|
-
return /* @__PURE__ */ jsx(
|
|
1284
|
+
return /* @__PURE__ */ jsx(MuiCircularProgress, { variant, value, color, size, ...props });
|
|
3626
1285
|
}
|
|
3627
|
-
const label =
|
|
3628
|
-
return /* @__PURE__ */ jsxs(
|
|
3629
|
-
/* @__PURE__ */ jsx(
|
|
1286
|
+
const label = formatLabel ? formatLabel(value ?? 0) : `${Math.round(value ?? 0)}%`;
|
|
1287
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { position: "relative", display: "inline-flex" }, children: [
|
|
1288
|
+
/* @__PURE__ */ jsx(MuiCircularProgress, { variant, value, color, size, ...props }),
|
|
3630
1289
|
/* @__PURE__ */ jsx(
|
|
3631
|
-
|
|
1290
|
+
Box9,
|
|
3632
1291
|
{
|
|
3633
1292
|
sx: {
|
|
3634
1293
|
position: "absolute",
|
|
@@ -3665,9 +1324,9 @@ function ProgressBar({ segments, height = 8, showLabels = false }) {
|
|
|
3665
1324
|
info: "info.main",
|
|
3666
1325
|
inherit: "text.primary"
|
|
3667
1326
|
};
|
|
3668
|
-
return /* @__PURE__ */ jsxs(
|
|
1327
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { width: "100%" }, children: [
|
|
3669
1328
|
/* @__PURE__ */ jsx(
|
|
3670
|
-
|
|
1329
|
+
Box9,
|
|
3671
1330
|
{
|
|
3672
1331
|
sx: {
|
|
3673
1332
|
display: "flex",
|
|
@@ -3677,7 +1336,7 @@ function ProgressBar({ segments, height = 8, showLabels = false }) {
|
|
|
3677
1336
|
bgcolor: "action.hover"
|
|
3678
1337
|
},
|
|
3679
1338
|
children: segments.map((segment, index) => /* @__PURE__ */ jsx(
|
|
3680
|
-
|
|
1339
|
+
Box9,
|
|
3681
1340
|
{
|
|
3682
1341
|
sx: {
|
|
3683
1342
|
width: `${segment.value}%`,
|
|
@@ -3689,9 +1348,9 @@ function ProgressBar({ segments, height = 8, showLabels = false }) {
|
|
|
3689
1348
|
))
|
|
3690
1349
|
}
|
|
3691
1350
|
),
|
|
3692
|
-
showLabels && /* @__PURE__ */ jsx(
|
|
1351
|
+
showLabels && /* @__PURE__ */ jsx(Box9, { sx: { display: "flex", gap: 2, mt: 1 }, children: segments.map((segment, index) => /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
3693
1352
|
/* @__PURE__ */ jsx(
|
|
3694
|
-
|
|
1353
|
+
Box9,
|
|
3695
1354
|
{
|
|
3696
1355
|
sx: {
|
|
3697
1356
|
width: 8,
|
|
@@ -3717,7 +1376,7 @@ function CountdownRing({
|
|
|
3717
1376
|
warningThresholdMs = 1e4,
|
|
3718
1377
|
tickIntervalMs = 250,
|
|
3719
1378
|
onExpire,
|
|
3720
|
-
formatLabel
|
|
1379
|
+
formatLabel,
|
|
3721
1380
|
expiredLabel = "Expired"
|
|
3722
1381
|
}) {
|
|
3723
1382
|
const target = parseDeadline(deadline);
|
|
@@ -3735,9 +1394,9 @@ function CountdownRing({
|
|
|
3735
1394
|
const denom = totalMs && totalMs > 0 ? totalMs : remainingMs > 0 ? remainingMs : 1;
|
|
3736
1395
|
const value = expired ? 0 : Math.min(100, remainingMs / denom * 100);
|
|
3737
1396
|
const activeColor = expired ? expiredColor : remainingMs <= warningThresholdMs ? warningColor : color;
|
|
3738
|
-
const label =
|
|
1397
|
+
const label = formatLabel ? formatLabel(remainingMs, expired) : expired ? expiredLabel : `${Math.ceil(remainingMs / 1e3)}s`;
|
|
3739
1398
|
return /* @__PURE__ */ jsx(
|
|
3740
|
-
|
|
1399
|
+
CircularProgress,
|
|
3741
1400
|
{
|
|
3742
1401
|
value,
|
|
3743
1402
|
size,
|
|
@@ -3791,7 +1450,7 @@ function VirtualList({
|
|
|
3791
1450
|
}
|
|
3792
1451
|
}, [lastItem, virtualizer, items.length, loadMoreThreshold, onEndReached]);
|
|
3793
1452
|
return /* @__PURE__ */ jsx(
|
|
3794
|
-
|
|
1453
|
+
Box9,
|
|
3795
1454
|
{
|
|
3796
1455
|
ref: parentRef,
|
|
3797
1456
|
sx: {
|
|
@@ -3802,7 +1461,7 @@ function VirtualList({
|
|
|
3802
1461
|
...sx
|
|
3803
1462
|
},
|
|
3804
1463
|
children: /* @__PURE__ */ jsx(
|
|
3805
|
-
|
|
1464
|
+
Box9,
|
|
3806
1465
|
{
|
|
3807
1466
|
sx: {
|
|
3808
1467
|
height: virtualizer.getTotalSize() + paddingY * 2,
|
|
@@ -3813,7 +1472,7 @@ function VirtualList({
|
|
|
3813
1472
|
const item = items[virtualRow.index];
|
|
3814
1473
|
if (item === void 0) return null;
|
|
3815
1474
|
return /* @__PURE__ */ jsx(
|
|
3816
|
-
|
|
1475
|
+
Box9,
|
|
3817
1476
|
{
|
|
3818
1477
|
"data-index": virtualRow.index,
|
|
3819
1478
|
ref: virtualizer.measureElement,
|
|
@@ -3826,379 +1485,12 @@ function VirtualList({
|
|
|
3826
1485
|
},
|
|
3827
1486
|
children: children(item, virtualRow.index)
|
|
3828
1487
|
},
|
|
3829
|
-
virtualRow.key
|
|
3830
|
-
);
|
|
3831
|
-
})
|
|
3832
|
-
}
|
|
3833
|
-
)
|
|
3834
|
-
}
|
|
3835
|
-
);
|
|
3836
|
-
}
|
|
3837
|
-
function CommandPalette({
|
|
3838
|
-
actions,
|
|
3839
|
-
open: controlledOpen,
|
|
3840
|
-
onOpenChange,
|
|
3841
|
-
triggerKey = "k",
|
|
3842
|
-
disableShortcut = false,
|
|
3843
|
-
placeholder = "Type a command or search\u2026",
|
|
3844
|
-
emptyMessage = "No matching commands"
|
|
3845
|
-
}) {
|
|
3846
|
-
const [internalOpen, setInternalOpen] = useState(false);
|
|
3847
|
-
const open = controlledOpen ?? internalOpen;
|
|
3848
|
-
const setOpen = useCallback(
|
|
3849
|
-
(next) => {
|
|
3850
|
-
if (controlledOpen === void 0) setInternalOpen(next);
|
|
3851
|
-
onOpenChange?.(next);
|
|
3852
|
-
},
|
|
3853
|
-
[controlledOpen, onOpenChange]
|
|
3854
|
-
);
|
|
3855
|
-
const [query, setQuery] = useState("");
|
|
3856
|
-
const [highlight, setHighlight] = useState(0);
|
|
3857
|
-
const inputRef = useRef(null);
|
|
3858
|
-
useEffect(() => {
|
|
3859
|
-
if (disableShortcut) return void 0;
|
|
3860
|
-
const onKey = (e) => {
|
|
3861
|
-
const meta = e.metaKey || e.ctrlKey;
|
|
3862
|
-
if (meta && e.key.toLowerCase() === triggerKey.toLowerCase() && !e.altKey && !e.shiftKey) {
|
|
3863
|
-
e.preventDefault();
|
|
3864
|
-
setOpen(!open);
|
|
3865
|
-
}
|
|
3866
|
-
};
|
|
3867
|
-
window.addEventListener("keydown", onKey);
|
|
3868
|
-
return () => window.removeEventListener("keydown", onKey);
|
|
3869
|
-
}, [triggerKey, disableShortcut, open, setOpen]);
|
|
3870
|
-
useEffect(() => {
|
|
3871
|
-
if (open) {
|
|
3872
|
-
setQuery("");
|
|
3873
|
-
setHighlight(0);
|
|
3874
|
-
const id = requestAnimationFrame(() => inputRef.current?.focus());
|
|
3875
|
-
return () => cancelAnimationFrame(id);
|
|
3876
|
-
}
|
|
3877
|
-
return void 0;
|
|
3878
|
-
}, [open]);
|
|
3879
|
-
const filtered = useMemo(() => filterActions(actions, query), [actions, query]);
|
|
3880
|
-
useEffect(() => {
|
|
3881
|
-
if (highlight >= filtered.length) setHighlight(0);
|
|
3882
|
-
}, [filtered.length, highlight]);
|
|
3883
|
-
const runAction = useCallback(
|
|
3884
|
-
async (action) => {
|
|
3885
|
-
if (action.disabled) return;
|
|
3886
|
-
setOpen(false);
|
|
3887
|
-
try {
|
|
3888
|
-
await action.onSelect();
|
|
3889
|
-
} catch {
|
|
3890
|
-
}
|
|
3891
|
-
},
|
|
3892
|
-
[setOpen]
|
|
3893
|
-
);
|
|
3894
|
-
const onKeyDown = useCallback(
|
|
3895
|
-
(e) => {
|
|
3896
|
-
if (e.key === "ArrowDown") {
|
|
3897
|
-
e.preventDefault();
|
|
3898
|
-
setHighlight((h) => filtered.length === 0 ? 0 : (h + 1) % filtered.length);
|
|
3899
|
-
} else if (e.key === "ArrowUp") {
|
|
3900
|
-
e.preventDefault();
|
|
3901
|
-
setHighlight((h) => filtered.length === 0 ? 0 : (h - 1 + filtered.length) % filtered.length);
|
|
3902
|
-
} else if (e.key === "Enter") {
|
|
3903
|
-
e.preventDefault();
|
|
3904
|
-
const target = filtered[highlight];
|
|
3905
|
-
if (target) void runAction(target);
|
|
3906
|
-
} else if (e.key === "Escape") {
|
|
3907
|
-
e.preventDefault();
|
|
3908
|
-
setOpen(false);
|
|
3909
|
-
}
|
|
3910
|
-
},
|
|
3911
|
-
[filtered, highlight, runAction, setOpen]
|
|
3912
|
-
);
|
|
3913
|
-
const grouped = useMemo(() => groupActions(filtered), [filtered]);
|
|
3914
|
-
return /* @__PURE__ */ jsx(
|
|
3915
|
-
Dialog,
|
|
3916
|
-
{
|
|
3917
|
-
open,
|
|
3918
|
-
onClose: () => setOpen(false),
|
|
3919
|
-
fullWidth: true,
|
|
3920
|
-
maxWidth: "sm",
|
|
3921
|
-
slotProps: {
|
|
3922
|
-
paper: {
|
|
3923
|
-
sx: { borderRadius: 2, mt: "10vh", alignSelf: "flex-start" }
|
|
3924
|
-
}
|
|
3925
|
-
},
|
|
3926
|
-
children: /* @__PURE__ */ jsxs(DialogContent, { sx: { p: 0 }, children: [
|
|
3927
|
-
/* @__PURE__ */ jsx(Box19, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx(
|
|
3928
|
-
TextField2,
|
|
3929
|
-
{
|
|
3930
|
-
inputRef,
|
|
3931
|
-
fullWidth: true,
|
|
3932
|
-
variant: "standard",
|
|
3933
|
-
value: query,
|
|
3934
|
-
onChange: (e) => {
|
|
3935
|
-
setQuery(e.target.value);
|
|
3936
|
-
setHighlight(0);
|
|
3937
|
-
},
|
|
3938
|
-
onKeyDown,
|
|
3939
|
-
placeholder,
|
|
3940
|
-
slotProps: {
|
|
3941
|
-
input: {
|
|
3942
|
-
disableUnderline: true,
|
|
3943
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { ml: 0.5, mr: 1 }, children: /* @__PURE__ */ jsx(Box19, { component: "span", sx: { fontSize: 18, opacity: 0.6 }, children: "\u2318" }) })
|
|
3944
|
-
}
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
) }),
|
|
3948
|
-
/* @__PURE__ */ jsx(Divider3, {}),
|
|
3949
|
-
/* @__PURE__ */ jsx(
|
|
3950
|
-
Box19,
|
|
3951
|
-
{
|
|
3952
|
-
sx: {
|
|
3953
|
-
maxHeight: 360,
|
|
3954
|
-
overflowY: "auto",
|
|
3955
|
-
py: 0.5
|
|
3956
|
-
},
|
|
3957
|
-
children: filtered.length === 0 ? /* @__PURE__ */ jsx(Box19, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx(Typography5, { variant: "body2", sx: {
|
|
3958
|
-
color: "text.secondary"
|
|
3959
|
-
}, children: emptyMessage }) }) : grouped.map((g) => /* @__PURE__ */ jsxs(Box19, { children: [
|
|
3960
|
-
g.label ? /* @__PURE__ */ jsx(
|
|
3961
|
-
Typography5,
|
|
3962
|
-
{
|
|
3963
|
-
variant: "caption",
|
|
3964
|
-
sx: {
|
|
3965
|
-
color: "text.secondary",
|
|
3966
|
-
px: 2,
|
|
3967
|
-
py: 0.75,
|
|
3968
|
-
display: "block",
|
|
3969
|
-
textTransform: "uppercase",
|
|
3970
|
-
letterSpacing: 0.5
|
|
3971
|
-
},
|
|
3972
|
-
children: g.label
|
|
3973
|
-
}
|
|
3974
|
-
) : null,
|
|
3975
|
-
g.items.map((entry) => /* @__PURE__ */ jsx(
|
|
3976
|
-
Row,
|
|
3977
|
-
{
|
|
3978
|
-
action: entry.action,
|
|
3979
|
-
selected: entry.flatIndex === highlight,
|
|
3980
|
-
onSelect: () => void runAction(entry.action),
|
|
3981
|
-
onHover: () => setHighlight(entry.flatIndex)
|
|
3982
|
-
},
|
|
3983
|
-
entry.action.id
|
|
3984
|
-
))
|
|
3985
|
-
] }, g.label ?? "__none__"))
|
|
3986
|
-
}
|
|
3987
|
-
)
|
|
3988
|
-
] })
|
|
3989
|
-
}
|
|
3990
|
-
);
|
|
3991
|
-
}
|
|
3992
|
-
function Row({
|
|
3993
|
-
action,
|
|
3994
|
-
selected,
|
|
3995
|
-
onSelect,
|
|
3996
|
-
onHover
|
|
3997
|
-
}) {
|
|
3998
|
-
const ref = useRef(null);
|
|
3999
|
-
useEffect(() => {
|
|
4000
|
-
if (selected && ref.current) {
|
|
4001
|
-
ref.current.scrollIntoView({ block: "nearest" });
|
|
4002
|
-
}
|
|
4003
|
-
}, [selected]);
|
|
4004
|
-
return /* @__PURE__ */ jsxs(
|
|
4005
|
-
Box19,
|
|
4006
|
-
{
|
|
4007
|
-
ref,
|
|
4008
|
-
onMouseEnter: onHover,
|
|
4009
|
-
onClick: onSelect,
|
|
4010
|
-
sx: (theme) => ({
|
|
4011
|
-
px: 2,
|
|
4012
|
-
py: 1.25,
|
|
4013
|
-
display: "flex",
|
|
4014
|
-
alignItems: "center",
|
|
4015
|
-
gap: 1.5,
|
|
4016
|
-
cursor: action.disabled ? "not-allowed" : "pointer",
|
|
4017
|
-
opacity: action.disabled ? 0.5 : 1,
|
|
4018
|
-
bgcolor: selected ? alpha(theme.palette.primary.main, 0.12) : "transparent",
|
|
4019
|
-
"&:hover": {
|
|
4020
|
-
bgcolor: selected ? alpha(theme.palette.primary.main, 0.16) : alpha(theme.palette.action.hover, 1)
|
|
1488
|
+
virtualRow.key
|
|
1489
|
+
);
|
|
1490
|
+
})
|
|
4021
1491
|
}
|
|
4022
|
-
|
|
4023
|
-
children: [
|
|
4024
|
-
action.icon ? /* @__PURE__ */ jsx(Box19, { sx: { display: "flex", alignItems: "center", width: 20, opacity: 0.8 }, children: action.icon }) : null,
|
|
4025
|
-
/* @__PURE__ */ jsx(Box19, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: {
|
|
4026
|
-
alignItems: "baseline"
|
|
4027
|
-
}, children: [
|
|
4028
|
-
/* @__PURE__ */ jsx(Typography5, { variant: "body2", sx: { fontWeight: 500 }, noWrap: true, children: action.title }),
|
|
4029
|
-
action.subtitle ? /* @__PURE__ */ jsx(Typography5, { variant: "caption", noWrap: true, sx: {
|
|
4030
|
-
color: "text.secondary"
|
|
4031
|
-
}, children: action.subtitle }) : null
|
|
4032
|
-
] }) }),
|
|
4033
|
-
action.shortcut?.length ? /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 0.5, children: action.shortcut.map((k, i) => /* @__PURE__ */ jsx(
|
|
4034
|
-
Chip,
|
|
4035
|
-
{
|
|
4036
|
-
size: "small",
|
|
4037
|
-
label: k,
|
|
4038
|
-
variant: "outlined",
|
|
4039
|
-
sx: { height: 20, fontSize: 10, fontFamily: "monospace" }
|
|
4040
|
-
},
|
|
4041
|
-
i
|
|
4042
|
-
)) }) : null
|
|
4043
|
-
]
|
|
4044
|
-
}
|
|
4045
|
-
);
|
|
4046
|
-
}
|
|
4047
|
-
function filterActions(actions, query) {
|
|
4048
|
-
const q = query.trim().toLowerCase();
|
|
4049
|
-
if (!q) return actions;
|
|
4050
|
-
const scored = [];
|
|
4051
|
-
for (const action of actions) {
|
|
4052
|
-
const haystacks = [action.title.toLowerCase()];
|
|
4053
|
-
if (action.subtitle) haystacks.push(action.subtitle.toLowerCase());
|
|
4054
|
-
if (action.keywords?.length) {
|
|
4055
|
-
for (const k of action.keywords) haystacks.push(k.toLowerCase());
|
|
4056
|
-
}
|
|
4057
|
-
let bestScore = -1;
|
|
4058
|
-
for (const h of haystacks) {
|
|
4059
|
-
const idx = h.indexOf(q);
|
|
4060
|
-
if (idx === -1) continue;
|
|
4061
|
-
const score = idx === 0 ? 1e3 - h.length : 100 - idx;
|
|
4062
|
-
if (score > bestScore) bestScore = score;
|
|
4063
|
-
}
|
|
4064
|
-
if (bestScore >= 0) scored.push({ action, score: bestScore });
|
|
4065
|
-
}
|
|
4066
|
-
scored.sort((a, b) => b.score - a.score);
|
|
4067
|
-
return scored.map((s) => s.action);
|
|
4068
|
-
}
|
|
4069
|
-
function groupActions(actions) {
|
|
4070
|
-
const out = /* @__PURE__ */ new Map();
|
|
4071
|
-
let flatIndex = 0;
|
|
4072
|
-
for (const action of actions) {
|
|
4073
|
-
const label = action.group;
|
|
4074
|
-
const key = label ?? "__none__";
|
|
4075
|
-
let bucket = out.get(key);
|
|
4076
|
-
if (!bucket) {
|
|
4077
|
-
bucket = { label, items: [] };
|
|
4078
|
-
out.set(key, bucket);
|
|
1492
|
+
)
|
|
4079
1493
|
}
|
|
4080
|
-
bucket.items.push({ action, flatIndex });
|
|
4081
|
-
flatIndex += 1;
|
|
4082
|
-
}
|
|
4083
|
-
return [...out.values()];
|
|
4084
|
-
}
|
|
4085
|
-
function Tabs({
|
|
4086
|
-
tabs,
|
|
4087
|
-
value: controlledValue,
|
|
4088
|
-
defaultValue,
|
|
4089
|
-
onChange,
|
|
4090
|
-
children,
|
|
4091
|
-
keepMounted = false,
|
|
4092
|
-
action,
|
|
4093
|
-
...muiProps
|
|
4094
|
-
}) {
|
|
4095
|
-
const [internalValue, setInternalValue] = useState(defaultValue ?? tabs?.[0]?.value ?? "");
|
|
4096
|
-
const value = controlledValue ?? internalValue;
|
|
4097
|
-
const handleChange = useCallback(
|
|
4098
|
-
(_event, newValue) => {
|
|
4099
|
-
if (controlledValue === void 0) {
|
|
4100
|
-
setInternalValue(newValue);
|
|
4101
|
-
}
|
|
4102
|
-
onChange?.(newValue);
|
|
4103
|
-
},
|
|
4104
|
-
[controlledValue, onChange]
|
|
4105
|
-
);
|
|
4106
|
-
const tabItems = useMemo(() => {
|
|
4107
|
-
if (tabs) return tabs;
|
|
4108
|
-
const items = [];
|
|
4109
|
-
Children.forEach(children, (child) => {
|
|
4110
|
-
if (isValidElement(child) && child.type === TabPanel) {
|
|
4111
|
-
const props = child.props;
|
|
4112
|
-
items.push({
|
|
4113
|
-
value: props.value,
|
|
4114
|
-
label: props.label ?? props.value,
|
|
4115
|
-
icon: props.icon,
|
|
4116
|
-
content: props.children,
|
|
4117
|
-
disabled: props.disabled
|
|
4118
|
-
});
|
|
4119
|
-
}
|
|
4120
|
-
});
|
|
4121
|
-
return items;
|
|
4122
|
-
}, [tabs, children]);
|
|
4123
|
-
const hasAction = action !== void 0 && action !== null && action !== false;
|
|
4124
|
-
return /* @__PURE__ */ jsxs(Box19, { sx: { width: "100%" }, children: [
|
|
4125
|
-
/* @__PURE__ */ jsxs(
|
|
4126
|
-
Box19,
|
|
4127
|
-
{
|
|
4128
|
-
sx: {
|
|
4129
|
-
display: "flex",
|
|
4130
|
-
alignItems: "center",
|
|
4131
|
-
justifyContent: "space-between",
|
|
4132
|
-
gap: 2
|
|
4133
|
-
},
|
|
4134
|
-
children: [
|
|
4135
|
-
/* @__PURE__ */ jsx(MuiTabs, { value, onChange: handleChange, ...muiProps, children: tabItems.map((tab) => /* @__PURE__ */ jsx(
|
|
4136
|
-
MuiTab,
|
|
4137
|
-
{
|
|
4138
|
-
value: tab.value,
|
|
4139
|
-
label: tab.label,
|
|
4140
|
-
icon: tab.icon,
|
|
4141
|
-
iconPosition: "start",
|
|
4142
|
-
disabled: tab.disabled
|
|
4143
|
-
},
|
|
4144
|
-
tab.value
|
|
4145
|
-
)) }),
|
|
4146
|
-
hasAction && /* @__PURE__ */ jsx(
|
|
4147
|
-
Box19,
|
|
4148
|
-
{
|
|
4149
|
-
sx: {
|
|
4150
|
-
display: "flex",
|
|
4151
|
-
alignItems: "center",
|
|
4152
|
-
gap: 1,
|
|
4153
|
-
flexShrink: 0
|
|
4154
|
-
},
|
|
4155
|
-
children: action
|
|
4156
|
-
}
|
|
4157
|
-
)
|
|
4158
|
-
]
|
|
4159
|
-
}
|
|
4160
|
-
),
|
|
4161
|
-
tabItems.map((tab) => {
|
|
4162
|
-
const isActive = tab.value === value;
|
|
4163
|
-
if (!isActive && !keepMounted) return null;
|
|
4164
|
-
if (tab.content === void 0) return null;
|
|
4165
|
-
return /* @__PURE__ */ jsx(
|
|
4166
|
-
Box19,
|
|
4167
|
-
{
|
|
4168
|
-
role: "tabpanel",
|
|
4169
|
-
hidden: !isActive,
|
|
4170
|
-
id: `tabpanel-${tab.value}`,
|
|
4171
|
-
"aria-labelledby": `tab-${tab.value}`,
|
|
4172
|
-
sx: { pt: 2 },
|
|
4173
|
-
children: tab.content
|
|
4174
|
-
},
|
|
4175
|
-
tab.value
|
|
4176
|
-
);
|
|
4177
|
-
})
|
|
4178
|
-
] });
|
|
4179
|
-
}
|
|
4180
|
-
function TabPanel({ children }) {
|
|
4181
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
4182
|
-
}
|
|
4183
|
-
function useTabs({ defaultValue = "", onChange } = {}) {
|
|
4184
|
-
const [value, setValueInternal] = useState(defaultValue);
|
|
4185
|
-
const setValue = useCallback(
|
|
4186
|
-
(newValue) => {
|
|
4187
|
-
setValueInternal(newValue);
|
|
4188
|
-
onChange?.(newValue);
|
|
4189
|
-
},
|
|
4190
|
-
[onChange]
|
|
4191
|
-
);
|
|
4192
|
-
return useMemo(
|
|
4193
|
-
() => ({
|
|
4194
|
-
value,
|
|
4195
|
-
setValue,
|
|
4196
|
-
tabsProps: {
|
|
4197
|
-
value,
|
|
4198
|
-
onChange: setValue
|
|
4199
|
-
}
|
|
4200
|
-
}),
|
|
4201
|
-
[value, setValue]
|
|
4202
1494
|
);
|
|
4203
1495
|
}
|
|
4204
1496
|
function Accordion({
|
|
@@ -4214,7 +1506,7 @@ function Accordion({
|
|
|
4214
1506
|
if (defaultExpanded === void 0) return [];
|
|
4215
1507
|
return Array.isArray(defaultExpanded) ? defaultExpanded : [defaultExpanded];
|
|
4216
1508
|
});
|
|
4217
|
-
const expanded = controlledExpanded !== void 0 ? Array.isArray(controlledExpanded) ? controlledExpanded : [controlledExpanded] : internalExpanded;
|
|
1509
|
+
const expanded = useMemo(() => controlledExpanded !== void 0 ? Array.isArray(controlledExpanded) ? controlledExpanded : [controlledExpanded] : internalExpanded, [controlledExpanded, internalExpanded]);
|
|
4218
1510
|
const handleChange = useCallback(
|
|
4219
1511
|
(panelId) => (_event, isExpanded) => {
|
|
4220
1512
|
let newExpanded;
|
|
@@ -4385,7 +1677,7 @@ function useAccordion({
|
|
|
4385
1677
|
function renderMenuItems(items, onItemClick) {
|
|
4386
1678
|
return items.map((item, index) => {
|
|
4387
1679
|
if (item.type === "divider") {
|
|
4388
|
-
return /* @__PURE__ */ jsx(
|
|
1680
|
+
return /* @__PURE__ */ jsx(Divider2, { sx: { my: 0.5 } }, `divider-${index}`);
|
|
4389
1681
|
}
|
|
4390
1682
|
if (item.type === "header") {
|
|
4391
1683
|
return /* @__PURE__ */ jsx(
|
|
@@ -4399,7 +1691,7 @@ function renderMenuItems(items, onItemClick) {
|
|
|
4399
1691
|
);
|
|
4400
1692
|
}
|
|
4401
1693
|
return /* @__PURE__ */ jsxs(
|
|
4402
|
-
|
|
1694
|
+
MenuItem2,
|
|
4403
1695
|
{
|
|
4404
1696
|
onClick: () => onItemClick(item),
|
|
4405
1697
|
disabled: item.disabled,
|
|
@@ -4523,113 +1815,6 @@ function ContextMenu({ items, children, ...menuProps }) {
|
|
|
4523
1815
|
)
|
|
4524
1816
|
] });
|
|
4525
1817
|
}
|
|
4526
|
-
var PRIMARY = "var(--prism-palette-primary-main, var(--palette-primary-main, #1976d2))";
|
|
4527
|
-
var STYLES = `
|
|
4528
|
-
#nprogress {
|
|
4529
|
-
top: 0;
|
|
4530
|
-
left: 0;
|
|
4531
|
-
width: 100%;
|
|
4532
|
-
height: 2.5px;
|
|
4533
|
-
z-index: 9999;
|
|
4534
|
-
position: fixed;
|
|
4535
|
-
pointer-events: none;
|
|
4536
|
-
}
|
|
4537
|
-
#nprogress .bar {
|
|
4538
|
-
height: 100%;
|
|
4539
|
-
background-color: ${PRIMARY};
|
|
4540
|
-
box-shadow: 0 0 2.5px ${PRIMARY};
|
|
4541
|
-
}
|
|
4542
|
-
#nprogress .peg {
|
|
4543
|
-
right: 0;
|
|
4544
|
-
opacity: 1;
|
|
4545
|
-
width: 100px;
|
|
4546
|
-
height: 100%;
|
|
4547
|
-
display: block;
|
|
4548
|
-
position: absolute;
|
|
4549
|
-
transform: rotate(3deg) translate(0px, -4px);
|
|
4550
|
-
box-shadow:
|
|
4551
|
-
0 0 10px ${PRIMARY},
|
|
4552
|
-
0 0 5px ${PRIMARY};
|
|
4553
|
-
}
|
|
4554
|
-
`;
|
|
4555
|
-
function isValidAnchor(element) {
|
|
4556
|
-
const href = element.getAttribute("href")?.trim() ?? "";
|
|
4557
|
-
const target = element.getAttribute("target");
|
|
4558
|
-
return href.startsWith("/") && target !== "_blank";
|
|
4559
|
-
}
|
|
4560
|
-
function isSamePath(a, b) {
|
|
4561
|
-
try {
|
|
4562
|
-
const urlA = new URL(a, window.location.origin);
|
|
4563
|
-
const urlB = new URL(b, window.location.origin);
|
|
4564
|
-
return urlA.pathname === urlB.pathname && urlA.search === urlB.search;
|
|
4565
|
-
} catch {
|
|
4566
|
-
return a === b;
|
|
4567
|
-
}
|
|
4568
|
-
}
|
|
4569
|
-
function useProgressBar(pathname, search, delay) {
|
|
4570
|
-
const currentUrlRef = useRef("");
|
|
4571
|
-
useEffect(() => {
|
|
4572
|
-
currentUrlRef.current = window.location.href;
|
|
4573
|
-
}, []);
|
|
4574
|
-
useEffect(() => {
|
|
4575
|
-
const handleNavigation = (newUrl) => {
|
|
4576
|
-
if (newUrl && !isSamePath(newUrl, currentUrlRef.current)) {
|
|
4577
|
-
currentUrlRef.current = newUrl;
|
|
4578
|
-
NProgress.start();
|
|
4579
|
-
}
|
|
4580
|
-
};
|
|
4581
|
-
const handleClick = (event) => {
|
|
4582
|
-
const target = event.target;
|
|
4583
|
-
const anchor = target.closest("a[href]");
|
|
4584
|
-
if (anchor && isValidAnchor(anchor)) {
|
|
4585
|
-
handleNavigation(anchor.href);
|
|
4586
|
-
}
|
|
4587
|
-
};
|
|
4588
|
-
const handlePopState = () => {
|
|
4589
|
-
handleNavigation(window.location.href);
|
|
4590
|
-
};
|
|
4591
|
-
const patchHistory = (method) => {
|
|
4592
|
-
const original = window.history[method];
|
|
4593
|
-
window.history[method] = new Proxy(original, {
|
|
4594
|
-
apply: (target, thisArg, args) => {
|
|
4595
|
-
const newUrl = args[2];
|
|
4596
|
-
if (typeof newUrl === "string") {
|
|
4597
|
-
handleNavigation(new URL(newUrl, window.location.origin).href);
|
|
4598
|
-
}
|
|
4599
|
-
return target.apply(thisArg, args);
|
|
4600
|
-
}
|
|
4601
|
-
});
|
|
4602
|
-
};
|
|
4603
|
-
patchHistory("pushState");
|
|
4604
|
-
patchHistory("replaceState");
|
|
4605
|
-
document.addEventListener("click", handleClick);
|
|
4606
|
-
window.addEventListener("popstate", handlePopState);
|
|
4607
|
-
return () => {
|
|
4608
|
-
document.removeEventListener("click", handleClick);
|
|
4609
|
-
window.removeEventListener("popstate", handlePopState);
|
|
4610
|
-
};
|
|
4611
|
-
}, []);
|
|
4612
|
-
useEffect(() => {
|
|
4613
|
-
const timeout = setTimeout(() => NProgress.done(), delay);
|
|
4614
|
-
return () => clearTimeout(timeout);
|
|
4615
|
-
}, [pathname, search, delay]);
|
|
4616
|
-
}
|
|
4617
|
-
function NavigationProgress({ pathname, search = "", delay = 100 }) {
|
|
4618
|
-
useEffect(() => {
|
|
4619
|
-
NProgress.configure({ showSpinner: false });
|
|
4620
|
-
return () => {
|
|
4621
|
-
NProgress.done();
|
|
4622
|
-
};
|
|
4623
|
-
}, []);
|
|
4624
|
-
useProgressBar(pathname, search, delay);
|
|
4625
|
-
return /* @__PURE__ */ jsx("style", { children: STYLES });
|
|
4626
|
-
}
|
|
4627
|
-
function ScrollToTop({ pathname }) {
|
|
4628
|
-
useEffect(() => {
|
|
4629
|
-
window.scrollTo(0, 0);
|
|
4630
|
-
}, [pathname]);
|
|
4631
|
-
return null;
|
|
4632
|
-
}
|
|
4633
1818
|
var SettingsContext = createContext(null);
|
|
4634
1819
|
function SettingsProvider({ children, defaultOpen = false }) {
|
|
4635
1820
|
const [open, setOpen] = useState(defaultOpen);
|
|
@@ -4746,7 +1931,7 @@ var PRESET_COLORS = {
|
|
|
4746
1931
|
minimal: "#64748B"
|
|
4747
1932
|
};
|
|
4748
1933
|
function Section({ title, children }) {
|
|
4749
|
-
return /* @__PURE__ */ jsxs(
|
|
1934
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { mb: 3 }, children: [
|
|
4750
1935
|
/* @__PURE__ */ jsx(
|
|
4751
1936
|
Typography5,
|
|
4752
1937
|
{
|
|
@@ -4890,7 +2075,7 @@ function PresetsSection() {
|
|
|
4890
2075
|
const { settings, actions } = useSettings();
|
|
4891
2076
|
const theme = useTheme();
|
|
4892
2077
|
return /* @__PURE__ */ jsx(Section, { title: "Presets", children: /* @__PURE__ */ jsx(
|
|
4893
|
-
|
|
2078
|
+
Box9,
|
|
4894
2079
|
{
|
|
4895
2080
|
sx: {
|
|
4896
2081
|
display: "grid",
|
|
@@ -4901,7 +2086,7 @@ function PresetsSection() {
|
|
|
4901
2086
|
const isSelected = settings.preset === preset;
|
|
4902
2087
|
const color = PRESET_COLORS[preset] || "#666";
|
|
4903
2088
|
return /* @__PURE__ */ jsx(Tooltip2, { title: PRESET_DISPLAY_NAMES[preset], placement: "top", children: /* @__PURE__ */ jsx(
|
|
4904
|
-
|
|
2089
|
+
Box9,
|
|
4905
2090
|
{
|
|
4906
2091
|
onClick: () => actions.setPreset(preset),
|
|
4907
2092
|
sx: {
|
|
@@ -4921,7 +2106,7 @@ function PresetsSection() {
|
|
|
4921
2106
|
}
|
|
4922
2107
|
},
|
|
4923
2108
|
children: isSelected && /* @__PURE__ */ jsx(
|
|
4924
|
-
|
|
2109
|
+
Box9,
|
|
4925
2110
|
{
|
|
4926
2111
|
sx: {
|
|
4927
2112
|
width: 8,
|
|
@@ -4950,11 +2135,11 @@ var COLOR_OPTIONS = [
|
|
|
4950
2135
|
function PrimaryColorSection() {
|
|
4951
2136
|
const { settings, actions } = useSettings();
|
|
4952
2137
|
const theme = useTheme();
|
|
4953
|
-
return /* @__PURE__ */ jsx(Section, { title: "Primary Color", children: /* @__PURE__ */ jsxs(
|
|
2138
|
+
return /* @__PURE__ */ jsx(Section, { title: "Primary Color", children: /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: [
|
|
4954
2139
|
COLOR_OPTIONS.map((option) => {
|
|
4955
2140
|
const isSelected = settings.primaryColor === option.value;
|
|
4956
2141
|
return /* @__PURE__ */ jsx(Tooltip2, { title: option.label, placement: "top", children: /* @__PURE__ */ jsx(
|
|
4957
|
-
|
|
2142
|
+
Box9,
|
|
4958
2143
|
{
|
|
4959
2144
|
onClick: () => actions.setPrimaryColor(option.value),
|
|
4960
2145
|
sx: {
|
|
@@ -4973,7 +2158,7 @@ function PrimaryColorSection() {
|
|
|
4973
2158
|
}
|
|
4974
2159
|
},
|
|
4975
2160
|
children: isSelected && /* @__PURE__ */ jsx(
|
|
4976
|
-
|
|
2161
|
+
Box9,
|
|
4977
2162
|
{
|
|
4978
2163
|
sx: {
|
|
4979
2164
|
width: 6,
|
|
@@ -4987,7 +2172,7 @@ function PrimaryColorSection() {
|
|
|
4987
2172
|
) }, option.value);
|
|
4988
2173
|
}),
|
|
4989
2174
|
settings.primaryColor && /* @__PURE__ */ jsx(Tooltip2, { title: "Reset to default", placement: "top", children: /* @__PURE__ */ jsx(
|
|
4990
|
-
|
|
2175
|
+
Box9,
|
|
4991
2176
|
{
|
|
4992
2177
|
onClick: () => actions.setPrimaryColor(null),
|
|
4993
2178
|
sx: {
|
|
@@ -5012,7 +2197,7 @@ function PrimaryColorSection() {
|
|
|
5012
2197
|
}
|
|
5013
2198
|
function FontSizeSection() {
|
|
5014
2199
|
const { settings, actions } = useSettings();
|
|
5015
|
-
return /* @__PURE__ */ jsx(Section, { title: "Font Size", children: /* @__PURE__ */ jsxs(
|
|
2200
|
+
return /* @__PURE__ */ jsx(Section, { title: "Font Size", children: /* @__PURE__ */ jsxs(Stack2, { direction: "row", spacing: 2, sx: {
|
|
5016
2201
|
alignItems: "center"
|
|
5017
2202
|
}, children: [
|
|
5018
2203
|
/* @__PURE__ */ jsx(Typography5, { variant: "body2", sx: { minWidth: 24, color: "text.secondary" }, children: "A" }),
|
|
@@ -5077,10 +2262,10 @@ function NavLayoutSection() {
|
|
|
5077
2262
|
{ value: "horizontal", label: "Horizontal", icon: "\u25AC" },
|
|
5078
2263
|
{ value: "mini", label: "Mini", icon: "\u2502" }
|
|
5079
2264
|
];
|
|
5080
|
-
return /* @__PURE__ */ jsx(Section, { title: "Navigation Layout", children: /* @__PURE__ */ jsx(
|
|
2265
|
+
return /* @__PURE__ */ jsx(Section, { title: "Navigation Layout", children: /* @__PURE__ */ jsx(Box9, { sx: { display: "flex", gap: 1.5 }, children: layoutOptions.map((option) => {
|
|
5081
2266
|
const isSelected = settings.navLayout === option.value;
|
|
5082
2267
|
return /* @__PURE__ */ jsxs(
|
|
5083
|
-
|
|
2268
|
+
Box9,
|
|
5084
2269
|
{
|
|
5085
2270
|
onClick: () => actions.setNavLayout(option.value),
|
|
5086
2271
|
sx: {
|
|
@@ -5114,375 +2299,96 @@ function StretchSection() {
|
|
|
5114
2299
|
control: /* @__PURE__ */ jsx(Switch, { checked: settings.stretch, onChange: (e) => actions.setStretch(e.target.checked) }),
|
|
5115
2300
|
label: "Stretch to full width",
|
|
5116
2301
|
sx: { ml: 0 }
|
|
5117
|
-
}
|
|
5118
|
-
) });
|
|
5119
|
-
}
|
|
5120
|
-
var SECTION_COMPONENTS = {
|
|
5121
|
-
mode: ModeSection,
|
|
5122
|
-
contrast: ContrastSection,
|
|
5123
|
-
direction: DirectionSection,
|
|
5124
|
-
presets: PresetsSection,
|
|
5125
|
-
primaryColor: PrimaryColorSection,
|
|
5126
|
-
fontSize: FontSizeSection,
|
|
5127
|
-
density: DensitySection,
|
|
5128
|
-
navLayout: NavLayoutSection,
|
|
5129
|
-
stretch: StretchSection
|
|
5130
|
-
};
|
|
5131
|
-
var DEFAULT_SECTIONS = ["mode", "presets", "primaryColor", "density", "navLayout", "stretch"];
|
|
5132
|
-
function SettingsDrawer({ width = 300, sections = DEFAULT_SECTIONS }) {
|
|
5133
|
-
const { drawer, canReset, actions } = useSettings();
|
|
5134
|
-
const theme = useTheme();
|
|
5135
|
-
return /* @__PURE__ */ jsxs(
|
|
5136
|
-
Drawer,
|
|
5137
|
-
{
|
|
5138
|
-
anchor: "right",
|
|
5139
|
-
open: drawer.open,
|
|
5140
|
-
onClose: drawer.onClose,
|
|
5141
|
-
slotProps: {
|
|
5142
|
-
paper: {
|
|
5143
|
-
sx: {
|
|
5144
|
-
width,
|
|
5145
|
-
backgroundImage: "none"
|
|
5146
|
-
}
|
|
5147
|
-
}
|
|
5148
|
-
},
|
|
5149
|
-
children: [
|
|
5150
|
-
/* @__PURE__ */ jsxs(
|
|
5151
|
-
Box19,
|
|
5152
|
-
{
|
|
5153
|
-
sx: {
|
|
5154
|
-
display: "flex",
|
|
5155
|
-
alignItems: "center",
|
|
5156
|
-
justifyContent: "space-between",
|
|
5157
|
-
p: 2,
|
|
5158
|
-
borderBottom: `1px solid ${theme.palette.divider}`
|
|
5159
|
-
},
|
|
5160
|
-
children: [
|
|
5161
|
-
/* @__PURE__ */ jsx(Typography5, { variant: "h6", sx: { fontWeight: 600 }, children: "Settings" }),
|
|
5162
|
-
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5, children: [
|
|
5163
|
-
canReset && /* @__PURE__ */ jsx(Tooltip2, { title: "Reset to defaults", children: /* @__PURE__ */ jsx(IconButton4, { size: "small", onClick: actions.reset, "aria-label": "Reset settings to defaults", children: /* @__PURE__ */ jsx(RefreshIcon, {}) }) }),
|
|
5164
|
-
/* @__PURE__ */ jsx(IconButton4, { size: "small", onClick: drawer.onClose, "aria-label": "Close settings", children: /* @__PURE__ */ jsx(CloseIcon2, {}) })
|
|
5165
|
-
] })
|
|
5166
|
-
]
|
|
5167
|
-
}
|
|
5168
|
-
),
|
|
5169
|
-
/* @__PURE__ */ jsx(Box19, { sx: { p: 2.5, flex: 1, overflowY: "auto" }, children: sections.map((section) => {
|
|
5170
|
-
const SectionComponent = SECTION_COMPONENTS[section];
|
|
5171
|
-
return SectionComponent ? /* @__PURE__ */ jsx(SectionComponent, {}, section) : null;
|
|
5172
|
-
}) }),
|
|
5173
|
-
/* @__PURE__ */ jsx(Box19, { sx: { p: 2, borderTop: `1px solid ${theme.palette.divider}` }, children: /* @__PURE__ */ jsx(Button, { fullWidth: true, variant: "soft", color: "primary", onClick: drawer.onClose, children: "Close" }) })
|
|
5174
|
-
]
|
|
5175
|
-
}
|
|
5176
|
-
);
|
|
5177
|
-
}
|
|
5178
|
-
function Tooltip3({
|
|
5179
|
-
title,
|
|
5180
|
-
children,
|
|
5181
|
-
arrow = true,
|
|
5182
|
-
placement = "top",
|
|
5183
|
-
maxWidth = 300,
|
|
5184
|
-
...other
|
|
5185
|
-
}) {
|
|
5186
|
-
if (!title) {
|
|
5187
|
-
return children;
|
|
5188
|
-
}
|
|
5189
|
-
return /* @__PURE__ */ jsx(
|
|
5190
|
-
Tooltip2,
|
|
5191
|
-
{
|
|
5192
|
-
title,
|
|
5193
|
-
arrow,
|
|
5194
|
-
placement,
|
|
5195
|
-
slotProps: {
|
|
5196
|
-
tooltip: {
|
|
5197
|
-
sx: {
|
|
5198
|
-
maxWidth
|
|
5199
|
-
}
|
|
5200
|
-
},
|
|
5201
|
-
...other.slotProps
|
|
5202
|
-
},
|
|
5203
|
-
...other,
|
|
5204
|
-
children
|
|
5205
|
-
}
|
|
5206
|
-
);
|
|
5207
|
-
}
|
|
5208
|
-
function mergeSx(own, sx) {
|
|
5209
|
-
return [own, ...Array.isArray(sx) ? sx : sx ? [sx] : []];
|
|
5210
|
-
}
|
|
5211
|
-
function Alert2({
|
|
5212
|
-
severity = "info",
|
|
5213
|
-
variant = "standard",
|
|
5214
|
-
title,
|
|
5215
|
-
children,
|
|
5216
|
-
onClose,
|
|
5217
|
-
closable = false,
|
|
5218
|
-
icon,
|
|
5219
|
-
action,
|
|
5220
|
-
sx,
|
|
5221
|
-
ref,
|
|
5222
|
-
...other
|
|
5223
|
-
}) {
|
|
5224
|
-
const muiVariant = variant === "soft" ? "standard" : variant;
|
|
5225
|
-
return /* @__PURE__ */ jsxs(
|
|
5226
|
-
MuiAlert,
|
|
5227
|
-
{
|
|
5228
|
-
ref,
|
|
5229
|
-
...other,
|
|
5230
|
-
severity,
|
|
5231
|
-
variant: muiVariant,
|
|
5232
|
-
onClose: closable ? onClose : void 0,
|
|
5233
|
-
icon,
|
|
5234
|
-
action,
|
|
5235
|
-
sx: mergeSx(
|
|
5236
|
-
variant === "soft" ? {
|
|
5237
|
-
backgroundColor: (theme) => alpha(theme.palette[severity].main, theme.palette.mode === "light" ? 0.12 : 0.16),
|
|
5238
|
-
color: (theme) => theme.palette.mode === "light" ? theme.palette[severity].dark : theme.palette[severity].light,
|
|
5239
|
-
"& .MuiAlert-icon": {
|
|
5240
|
-
color: "inherit"
|
|
5241
|
-
}
|
|
5242
|
-
} : {},
|
|
5243
|
-
sx
|
|
5244
|
-
),
|
|
5245
|
-
children: [
|
|
5246
|
-
title && /* @__PURE__ */ jsx(AlertTitle, { children: title }),
|
|
5247
|
-
children
|
|
5248
|
-
]
|
|
5249
|
-
}
|
|
5250
|
-
);
|
|
5251
|
-
}
|
|
5252
|
-
function InlineAlert({ severity = "info", message, icon, sx, ref, ...other }) {
|
|
5253
|
-
return /* @__PURE__ */ jsx(
|
|
5254
|
-
MuiAlert,
|
|
5255
|
-
{
|
|
5256
|
-
ref,
|
|
5257
|
-
...other,
|
|
5258
|
-
severity,
|
|
5259
|
-
icon,
|
|
5260
|
-
sx: mergeSx(
|
|
5261
|
-
{
|
|
5262
|
-
py: 0,
|
|
5263
|
-
px: 1,
|
|
5264
|
-
"& .MuiAlert-message": {
|
|
5265
|
-
py: 0.5
|
|
5266
|
-
}
|
|
5267
|
-
},
|
|
5268
|
-
sx
|
|
5269
|
-
),
|
|
5270
|
-
children: message
|
|
5271
|
-
}
|
|
5272
|
-
);
|
|
5273
|
-
}
|
|
5274
|
-
function FormAlert({
|
|
5275
|
-
severity = "error",
|
|
5276
|
-
title,
|
|
5277
|
-
children,
|
|
5278
|
-
onClose,
|
|
5279
|
-
autoScroll = true,
|
|
5280
|
-
sx,
|
|
5281
|
-
ref: outerRef,
|
|
5282
|
-
...other
|
|
5283
|
-
}) {
|
|
5284
|
-
const ref = useRef(null);
|
|
5285
|
-
const handleRef = useForkRef(ref, outerRef);
|
|
5286
|
-
useEffect(() => {
|
|
5287
|
-
if (!autoScroll) return void 0;
|
|
5288
|
-
const id = requestAnimationFrame(() => {
|
|
5289
|
-
ref.current?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
5290
|
-
});
|
|
5291
|
-
return () => cancelAnimationFrame(id);
|
|
5292
|
-
}, [autoScroll]);
|
|
5293
|
-
return /* @__PURE__ */ jsxs(
|
|
5294
|
-
MuiAlert,
|
|
5295
|
-
{
|
|
5296
|
-
ref: handleRef,
|
|
5297
|
-
...other,
|
|
5298
|
-
severity,
|
|
5299
|
-
onClose,
|
|
5300
|
-
role: "alert",
|
|
5301
|
-
"aria-live": "assertive",
|
|
5302
|
-
"aria-atomic": "true",
|
|
5303
|
-
sx: mergeSx(
|
|
5304
|
-
{
|
|
5305
|
-
alignItems: "flex-start",
|
|
5306
|
-
mb: 2
|
|
5307
|
-
},
|
|
5308
|
-
sx
|
|
5309
|
-
),
|
|
5310
|
-
children: [
|
|
5311
|
-
title && /* @__PURE__ */ jsx(AlertTitle, { sx: { mb: 0.5 }, children: title }),
|
|
5312
|
-
children
|
|
5313
|
-
]
|
|
5314
|
-
}
|
|
5315
|
-
);
|
|
5316
|
-
}
|
|
5317
|
-
var BreadcrumbsRoot = styled("div")(({ theme }) => ({
|
|
5318
|
-
display: "flex",
|
|
5319
|
-
flexDirection: "column",
|
|
5320
|
-
gap: theme.spacing(2)
|
|
5321
|
-
}));
|
|
5322
|
-
var BreadcrumbsHeading = styled("h6")(({ theme }) => ({
|
|
5323
|
-
...theme.typography.h4,
|
|
5324
|
-
margin: 0,
|
|
5325
|
-
padding: 0,
|
|
5326
|
-
display: "inline-flex"
|
|
5327
|
-
}));
|
|
5328
|
-
var BreadcrumbsContainer = styled("div")(({ theme }) => ({
|
|
5329
|
-
display: "flex",
|
|
5330
|
-
flexWrap: "wrap",
|
|
5331
|
-
gap: theme.spacing(2),
|
|
5332
|
-
alignItems: "flex-start",
|
|
5333
|
-
justifyContent: "flex-end"
|
|
5334
|
-
}));
|
|
5335
|
-
var BreadcrumbsContent = styled("div")(({ theme }) => ({
|
|
5336
|
-
display: "flex",
|
|
5337
|
-
flex: "1 1 auto",
|
|
5338
|
-
gap: theme.spacing(2),
|
|
5339
|
-
flexDirection: "column"
|
|
5340
|
-
}));
|
|
5341
|
-
var BreadcrumbsSeparator = styled("span")(({ theme }) => ({
|
|
5342
|
-
width: 4,
|
|
5343
|
-
height: 4,
|
|
5344
|
-
borderRadius: "50%",
|
|
5345
|
-
backgroundColor: theme.palette.text.disabled
|
|
5346
|
-
}));
|
|
5347
|
-
var ItemRoot = styled("div", {
|
|
5348
|
-
shouldForwardProp: (prop) => prop !== "disabled"
|
|
5349
|
-
})(({ disabled, theme }) => ({
|
|
5350
|
-
...theme.typography.body2,
|
|
5351
|
-
alignItems: "center",
|
|
5352
|
-
gap: theme.spacing(0.5),
|
|
5353
|
-
display: "inline-flex",
|
|
5354
|
-
color: theme.palette.text.secondary,
|
|
5355
|
-
...disabled && {
|
|
5356
|
-
cursor: "default",
|
|
5357
|
-
pointerEvents: "none",
|
|
5358
|
-
color: theme.palette.text.primary,
|
|
5359
|
-
fontWeight: 600
|
|
5360
|
-
}
|
|
5361
|
-
}));
|
|
5362
|
-
var ItemIcon = styled("span")({
|
|
5363
|
-
display: "inherit",
|
|
5364
|
-
// Constrain the icon (first real child) to 20×20. The previous
|
|
5365
|
-
// selector chain `:first-of-type:not(style):not(:first-of-type ~ *)`
|
|
5366
|
-
// was an obscure way to say "the first child that isn't a <style>
|
|
5367
|
-
// tag" — replaced with the modern `:first-child:not(style)` for
|
|
5368
|
-
// both readability and v9 lint compliance.
|
|
5369
|
-
"& > :first-child:not(style)": {
|
|
5370
|
-
width: 20,
|
|
5371
|
-
height: 20
|
|
5372
|
-
}
|
|
5373
|
-
});
|
|
5374
|
-
var MoreLinksRoot = styled("ul")({
|
|
5375
|
-
display: "flex",
|
|
5376
|
-
flexDirection: "column",
|
|
5377
|
-
"& > li": { display: "flex" }
|
|
5378
|
-
});
|
|
5379
|
-
function ArrowBackIcon() {
|
|
5380
|
-
return /* @__PURE__ */ jsx(SvgIcon, { sx: { fontSize: 18 }, children: /* @__PURE__ */ jsx("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) });
|
|
2302
|
+
}
|
|
2303
|
+
) });
|
|
5381
2304
|
}
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
2305
|
+
var SECTION_COMPONENTS = {
|
|
2306
|
+
mode: ModeSection,
|
|
2307
|
+
contrast: ContrastSection,
|
|
2308
|
+
direction: DirectionSection,
|
|
2309
|
+
presets: PresetsSection,
|
|
2310
|
+
primaryColor: PrimaryColorSection,
|
|
2311
|
+
fontSize: FontSizeSection,
|
|
2312
|
+
density: DensitySection,
|
|
2313
|
+
navLayout: NavLayoutSection,
|
|
2314
|
+
stretch: StretchSection
|
|
2315
|
+
};
|
|
2316
|
+
var DEFAULT_SECTIONS = ["mode", "presets", "primaryColor", "density", "navLayout", "stretch"];
|
|
2317
|
+
function SettingsDrawer({ width = 300, sections = DEFAULT_SECTIONS }) {
|
|
2318
|
+
const { drawer, canReset, actions } = useSettings();
|
|
2319
|
+
const theme = useTheme();
|
|
5389
2320
|
return /* @__PURE__ */ jsxs(
|
|
5390
|
-
|
|
2321
|
+
Drawer,
|
|
5391
2322
|
{
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
transition: theme.transitions.create("opacity", {
|
|
5404
|
-
duration: theme.transitions.duration.shorter
|
|
5405
|
-
})
|
|
5406
|
-
},
|
|
5407
|
-
"&:hover .PrismBackLinkIcon": { opacity: 0.48 }
|
|
5408
|
-
}),
|
|
5409
|
-
...Array.isArray(sx) ? sx : [sx]
|
|
5410
|
-
],
|
|
5411
|
-
...linkProps,
|
|
2323
|
+
anchor: "right",
|
|
2324
|
+
open: drawer.open,
|
|
2325
|
+
onClose: drawer.onClose,
|
|
2326
|
+
slotProps: {
|
|
2327
|
+
paper: {
|
|
2328
|
+
sx: {
|
|
2329
|
+
width,
|
|
2330
|
+
backgroundImage: "none"
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
},
|
|
5412
2334
|
children: [
|
|
5413
|
-
/* @__PURE__ */
|
|
5414
|
-
|
|
2335
|
+
/* @__PURE__ */ jsxs(
|
|
2336
|
+
Box9,
|
|
2337
|
+
{
|
|
2338
|
+
sx: {
|
|
2339
|
+
display: "flex",
|
|
2340
|
+
alignItems: "center",
|
|
2341
|
+
justifyContent: "space-between",
|
|
2342
|
+
p: 2,
|
|
2343
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
2344
|
+
},
|
|
2345
|
+
children: [
|
|
2346
|
+
/* @__PURE__ */ jsx(Typography5, { variant: "h6", sx: { fontWeight: 600 }, children: "Settings" }),
|
|
2347
|
+
/* @__PURE__ */ jsxs(Stack2, { direction: "row", spacing: 0.5, children: [
|
|
2348
|
+
canReset && /* @__PURE__ */ jsx(Tooltip2, { title: "Reset to defaults", children: /* @__PURE__ */ jsx(IconButton2, { size: "small", onClick: actions.reset, "aria-label": "Reset settings to defaults", children: /* @__PURE__ */ jsx(RefreshIcon, {}) }) }),
|
|
2349
|
+
/* @__PURE__ */ jsx(IconButton2, { size: "small", onClick: drawer.onClose, "aria-label": "Close settings", children: /* @__PURE__ */ jsx(CloseIcon2, {}) })
|
|
2350
|
+
] })
|
|
2351
|
+
]
|
|
2352
|
+
}
|
|
2353
|
+
),
|
|
2354
|
+
/* @__PURE__ */ jsx(Box9, { sx: { p: 2.5, flex: 1, overflowY: "auto" }, children: sections.map((section) => {
|
|
2355
|
+
const SectionComponent = SECTION_COMPONENTS[section];
|
|
2356
|
+
return SectionComponent ? /* @__PURE__ */ jsx(SectionComponent, {}, section) : null;
|
|
2357
|
+
}) }),
|
|
2358
|
+
/* @__PURE__ */ jsx(Box9, { sx: { p: 2, borderTop: `1px solid ${theme.palette.divider}` }, children: /* @__PURE__ */ jsx(Button, { fullWidth: true, variant: "soft", color: "primary", onClick: drawer.onClose, children: "Close" }) })
|
|
5415
2359
|
]
|
|
5416
2360
|
}
|
|
5417
2361
|
);
|
|
5418
2362
|
}
|
|
5419
|
-
function
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
}) {
|
|
5426
|
-
const content = /* @__PURE__ */ jsxs(ItemRoot, { disabled, children: [
|
|
5427
|
-
icon && /* @__PURE__ */ jsx(ItemIcon, { children: icon }),
|
|
5428
|
-
name
|
|
5429
|
-
] });
|
|
5430
|
-
if (href && !disabled) {
|
|
5431
|
-
const linkProps = linkComponent ? { component: linkComponent, to: href } : { href };
|
|
5432
|
-
return /* @__PURE__ */ jsx(Link, { color: "inherit", sx: { display: "inline-flex" }, ...linkProps, children: content });
|
|
5433
|
-
}
|
|
5434
|
-
return content;
|
|
5435
|
-
}
|
|
5436
|
-
var SAFE_LINK_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
5437
|
-
function isSafeExternalLink(href) {
|
|
5438
|
-
const trimmed = href.trim();
|
|
5439
|
-
if (trimmed.startsWith("/") || trimmed.startsWith("#")) return true;
|
|
5440
|
-
try {
|
|
5441
|
-
return SAFE_LINK_SCHEMES.has(new URL(trimmed, "https://placeholder.invalid").protocol);
|
|
5442
|
-
} catch {
|
|
5443
|
-
return false;
|
|
5444
|
-
}
|
|
5445
|
-
}
|
|
5446
|
-
function MoreLinks({ links, sx, ...other }) {
|
|
5447
|
-
return /* @__PURE__ */ jsx(MoreLinksRoot, { sx, ...other, children: links?.filter(isSafeExternalLink).map((href) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href, variant: "body2", target: "_blank", rel: "noopener noreferrer", children: href }) }, href)) });
|
|
5448
|
-
}
|
|
5449
|
-
function Breadcrumbs({
|
|
5450
|
-
sx,
|
|
5451
|
-
action,
|
|
5452
|
-
backHref,
|
|
5453
|
-
heading,
|
|
5454
|
-
slots = {},
|
|
5455
|
-
links = [],
|
|
5456
|
-
moreLinks = [],
|
|
5457
|
-
slotProps = {},
|
|
5458
|
-
activeLast = false,
|
|
5459
|
-
linkComponent,
|
|
2363
|
+
function Tooltip3({
|
|
2364
|
+
title,
|
|
2365
|
+
children,
|
|
2366
|
+
arrow = true,
|
|
2367
|
+
placement = "top",
|
|
2368
|
+
maxWidth = 300,
|
|
5460
2369
|
...other
|
|
5461
2370
|
}) {
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
2371
|
+
if (!title) {
|
|
2372
|
+
return children;
|
|
2373
|
+
}
|
|
2374
|
+
return /* @__PURE__ */ jsx(
|
|
2375
|
+
Tooltip2,
|
|
5466
2376
|
{
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
action
|
|
5483
|
-
] }),
|
|
5484
|
-
!!moreLinks?.length && renderMoreLinks()
|
|
5485
|
-
] });
|
|
2377
|
+
title,
|
|
2378
|
+
arrow,
|
|
2379
|
+
placement,
|
|
2380
|
+
slotProps: {
|
|
2381
|
+
tooltip: {
|
|
2382
|
+
sx: {
|
|
2383
|
+
maxWidth
|
|
2384
|
+
}
|
|
2385
|
+
},
|
|
2386
|
+
...other.slotProps
|
|
2387
|
+
},
|
|
2388
|
+
...other,
|
|
2389
|
+
children
|
|
2390
|
+
}
|
|
2391
|
+
);
|
|
5486
2392
|
}
|
|
5487
2393
|
function NavCard({
|
|
5488
2394
|
title,
|
|
@@ -5506,7 +2412,7 @@ function NavCard({
|
|
|
5506
2412
|
const label = ariaLabel ?? (typeof title === "string" && typeof description === "string" ? `${title} \u2014 ${description}` : void 0);
|
|
5507
2413
|
const isVertical = orientation === "vertical";
|
|
5508
2414
|
return /* @__PURE__ */ jsx(
|
|
5509
|
-
|
|
2415
|
+
Card,
|
|
5510
2416
|
{
|
|
5511
2417
|
variant: "outlined",
|
|
5512
2418
|
...linkProps,
|
|
@@ -5576,7 +2482,7 @@ function NavCard({
|
|
|
5576
2482
|
// arrow into a narrow tile just steals text space).
|
|
5577
2483
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5578
2484
|
icon && /* @__PURE__ */ jsx(
|
|
5579
|
-
|
|
2485
|
+
Box9,
|
|
5580
2486
|
{
|
|
5581
2487
|
sx: {
|
|
5582
2488
|
width: 40,
|
|
@@ -5592,7 +2498,7 @@ function NavCard({
|
|
|
5592
2498
|
children: icon
|
|
5593
2499
|
}
|
|
5594
2500
|
),
|
|
5595
|
-
/* @__PURE__ */ jsxs(
|
|
2501
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
5596
2502
|
/* @__PURE__ */ jsx(
|
|
5597
2503
|
Typography5,
|
|
5598
2504
|
{
|
|
@@ -5605,7 +2511,7 @@ function NavCard({
|
|
|
5605
2511
|
}
|
|
5606
2512
|
),
|
|
5607
2513
|
showBadge && /* @__PURE__ */ jsx(
|
|
5608
|
-
|
|
2514
|
+
Chip2,
|
|
5609
2515
|
{
|
|
5610
2516
|
size: "small",
|
|
5611
2517
|
label: badge,
|
|
@@ -5632,10 +2538,10 @@ function NavCard({
|
|
|
5632
2538
|
}
|
|
5633
2539
|
)
|
|
5634
2540
|
] })
|
|
5635
|
-
) : /* @__PURE__ */ jsxs(
|
|
5636
|
-
/* @__PURE__ */ jsxs(
|
|
2541
|
+
) : /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", gap: 1 }, children: [
|
|
2542
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 2, minWidth: 0 }, children: [
|
|
5637
2543
|
icon && /* @__PURE__ */ jsx(
|
|
5638
|
-
|
|
2544
|
+
Box9,
|
|
5639
2545
|
{
|
|
5640
2546
|
sx: {
|
|
5641
2547
|
width: iconSize,
|
|
@@ -5651,8 +2557,8 @@ function NavCard({
|
|
|
5651
2557
|
children: icon
|
|
5652
2558
|
}
|
|
5653
2559
|
),
|
|
5654
|
-
/* @__PURE__ */ jsxs(
|
|
5655
|
-
/* @__PURE__ */ jsxs(
|
|
2560
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
2561
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
5656
2562
|
/* @__PURE__ */ jsx(
|
|
5657
2563
|
Typography5,
|
|
5658
2564
|
{
|
|
@@ -5665,7 +2571,7 @@ function NavCard({
|
|
|
5665
2571
|
}
|
|
5666
2572
|
),
|
|
5667
2573
|
showBadge && /* @__PURE__ */ jsx(
|
|
5668
|
-
|
|
2574
|
+
Chip2,
|
|
5669
2575
|
{
|
|
5670
2576
|
size: "small",
|
|
5671
2577
|
label: badge,
|
|
@@ -5687,7 +2593,7 @@ function NavCard({
|
|
|
5687
2593
|
)
|
|
5688
2594
|
] })
|
|
5689
2595
|
] }),
|
|
5690
|
-
arrow !== false && /* @__PURE__ */ jsx(
|
|
2596
|
+
arrow !== false && /* @__PURE__ */ jsx(Box9, { sx: { display: "flex", alignItems: "center", flexShrink: 0, color: "text.secondary" }, children: arrow === true ? /* @__PURE__ */ jsx(ChevronRightIcon, {}) : arrow })
|
|
5691
2597
|
] })
|
|
5692
2598
|
}
|
|
5693
2599
|
)
|
|
@@ -5701,7 +2607,7 @@ function NavCardGrid({
|
|
|
5701
2607
|
sx
|
|
5702
2608
|
}) {
|
|
5703
2609
|
return /* @__PURE__ */ jsx(
|
|
5704
|
-
|
|
2610
|
+
Box9,
|
|
5705
2611
|
{
|
|
5706
2612
|
sx: {
|
|
5707
2613
|
display: "grid",
|
|
@@ -5763,7 +2669,7 @@ function Drawer2({
|
|
|
5763
2669
|
children: [
|
|
5764
2670
|
(title || showCloseButton || headerActions) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5765
2671
|
/* @__PURE__ */ jsxs(
|
|
5766
|
-
|
|
2672
|
+
Box9,
|
|
5767
2673
|
{
|
|
5768
2674
|
sx: {
|
|
5769
2675
|
display: "flex",
|
|
@@ -5774,17 +2680,17 @@ function Drawer2({
|
|
|
5774
2680
|
},
|
|
5775
2681
|
children: [
|
|
5776
2682
|
title && /* @__PURE__ */ jsx(Typography5, { variant: "h6", component: "div", children: title }),
|
|
5777
|
-
/* @__PURE__ */ jsxs(
|
|
2683
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 1, ml: "auto" }, children: [
|
|
5778
2684
|
headerActions,
|
|
5779
|
-
showCloseButton && onClose && /* @__PURE__ */ jsx(
|
|
2685
|
+
showCloseButton && onClose && /* @__PURE__ */ jsx(IconButton2, { onClick: onClose, edge: "end", size: "small", "aria-label": "Close drawer", children: closeIcon ?? /* @__PURE__ */ jsx(DefaultCloseIcon, {}) })
|
|
5780
2686
|
] })
|
|
5781
2687
|
]
|
|
5782
2688
|
}
|
|
5783
2689
|
),
|
|
5784
|
-
/* @__PURE__ */ jsx(
|
|
2690
|
+
/* @__PURE__ */ jsx(Divider2, {})
|
|
5785
2691
|
] }),
|
|
5786
2692
|
/* @__PURE__ */ jsx(
|
|
5787
|
-
|
|
2693
|
+
Box9,
|
|
5788
2694
|
{
|
|
5789
2695
|
sx: {
|
|
5790
2696
|
flex: 1,
|
|
@@ -5795,521 +2701,13 @@ function Drawer2({
|
|
|
5795
2701
|
}
|
|
5796
2702
|
),
|
|
5797
2703
|
footer && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5798
|
-
/* @__PURE__ */ jsx(
|
|
5799
|
-
/* @__PURE__ */ jsx(
|
|
2704
|
+
/* @__PURE__ */ jsx(Divider2, {}),
|
|
2705
|
+
/* @__PURE__ */ jsx(Box9, { sx: { p: 2 }, children: footer })
|
|
5800
2706
|
] })
|
|
5801
2707
|
]
|
|
5802
2708
|
}
|
|
5803
2709
|
);
|
|
5804
2710
|
}
|
|
5805
|
-
function Stepper({
|
|
5806
|
-
steps,
|
|
5807
|
-
activeStep = 0,
|
|
5808
|
-
onStepChange,
|
|
5809
|
-
orientation = "horizontal",
|
|
5810
|
-
nonLinear = false,
|
|
5811
|
-
alternativeLabel = false,
|
|
5812
|
-
showContent = false,
|
|
5813
|
-
...other
|
|
5814
|
-
}) {
|
|
5815
|
-
const handleStepClick = (index) => {
|
|
5816
|
-
if (nonLinear && onStepChange) {
|
|
5817
|
-
onStepChange(index);
|
|
5818
|
-
}
|
|
5819
|
-
};
|
|
5820
|
-
return /* @__PURE__ */ jsx(
|
|
5821
|
-
MuiStepper,
|
|
5822
|
-
{
|
|
5823
|
-
activeStep,
|
|
5824
|
-
orientation,
|
|
5825
|
-
nonLinear,
|
|
5826
|
-
alternativeLabel,
|
|
5827
|
-
...other,
|
|
5828
|
-
children: steps.map((step, index) => /* @__PURE__ */ jsxs(Step, { completed: step.completed ?? index < activeStep, children: [
|
|
5829
|
-
/* @__PURE__ */ jsx(
|
|
5830
|
-
StepLabel,
|
|
5831
|
-
{
|
|
5832
|
-
optional: step.optional ? /* @__PURE__ */ jsx("span", { style: { fontSize: "0.75rem", color: "text.secondary" }, children: "Optional" }) : step.description ? /* @__PURE__ */ jsx("span", { style: { fontSize: "0.75rem", color: "text.secondary" }, children: step.description }) : void 0,
|
|
5833
|
-
error: step.error,
|
|
5834
|
-
icon: step.icon,
|
|
5835
|
-
sx: {
|
|
5836
|
-
cursor: nonLinear ? "pointer" : "default"
|
|
5837
|
-
},
|
|
5838
|
-
onClick: () => handleStepClick(index),
|
|
5839
|
-
children: step.label
|
|
5840
|
-
}
|
|
5841
|
-
),
|
|
5842
|
-
orientation === "vertical" && showContent && step.content && /* @__PURE__ */ jsx(StepContent, { children: step.content })
|
|
5843
|
-
] }, index))
|
|
5844
|
-
}
|
|
5845
|
-
);
|
|
5846
|
-
}
|
|
5847
|
-
function useStepper({
|
|
5848
|
-
initialStep = 0,
|
|
5849
|
-
totalSteps,
|
|
5850
|
-
onStepChange,
|
|
5851
|
-
onComplete
|
|
5852
|
-
}) {
|
|
5853
|
-
const [activeStep, setActiveStep] = useState(initialStep);
|
|
5854
|
-
const [isCompleted, setIsCompleted] = useState(false);
|
|
5855
|
-
const goToStep = useCallback(
|
|
5856
|
-
(step) => {
|
|
5857
|
-
if (step >= 0 && step < totalSteps) {
|
|
5858
|
-
setActiveStep(step);
|
|
5859
|
-
onStepChange?.(step);
|
|
5860
|
-
}
|
|
5861
|
-
},
|
|
5862
|
-
[totalSteps, onStepChange]
|
|
5863
|
-
);
|
|
5864
|
-
const nextStep = useCallback(() => {
|
|
5865
|
-
if (activeStep === totalSteps - 1) {
|
|
5866
|
-
setIsCompleted(true);
|
|
5867
|
-
onComplete?.();
|
|
5868
|
-
} else {
|
|
5869
|
-
goToStep(activeStep + 1);
|
|
5870
|
-
}
|
|
5871
|
-
}, [activeStep, totalSteps, goToStep, onComplete]);
|
|
5872
|
-
const prevStep = useCallback(() => {
|
|
5873
|
-
goToStep(activeStep - 1);
|
|
5874
|
-
}, [activeStep, goToStep]);
|
|
5875
|
-
const reset = useCallback(() => {
|
|
5876
|
-
setActiveStep(0);
|
|
5877
|
-
setIsCompleted(false);
|
|
5878
|
-
onStepChange?.(0);
|
|
5879
|
-
}, [onStepChange]);
|
|
5880
|
-
return {
|
|
5881
|
-
activeStep,
|
|
5882
|
-
nextStep,
|
|
5883
|
-
prevStep,
|
|
5884
|
-
goToStep,
|
|
5885
|
-
reset,
|
|
5886
|
-
isFirstStep: activeStep === 0,
|
|
5887
|
-
isLastStep: activeStep === totalSteps - 1,
|
|
5888
|
-
isCompleted
|
|
5889
|
-
};
|
|
5890
|
-
}
|
|
5891
|
-
function StepperActions({
|
|
5892
|
-
stepper,
|
|
5893
|
-
backLabel = "Back",
|
|
5894
|
-
nextLabel = "Next",
|
|
5895
|
-
finishLabel = "Finish",
|
|
5896
|
-
disableNext = false,
|
|
5897
|
-
actions
|
|
5898
|
-
}) {
|
|
5899
|
-
return /* @__PURE__ */ jsxs(Box19, { sx: { display: "flex", gap: 2, mt: 3 }, children: [
|
|
5900
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", onClick: stepper.prevStep, disabled: stepper.isFirstStep, children: backLabel }),
|
|
5901
|
-
/* @__PURE__ */ jsx(Box19, { sx: { flex: 1 } }),
|
|
5902
|
-
actions,
|
|
5903
|
-
/* @__PURE__ */ jsx(Button, { variant: "contained", onClick: stepper.nextStep, disabled: disableNext, children: stepper.isLastStep ? finishLabel : nextLabel })
|
|
5904
|
-
] });
|
|
5905
|
-
}
|
|
5906
|
-
function cn(...inputs) {
|
|
5907
|
-
return clsx(inputs);
|
|
5908
|
-
}
|
|
5909
|
-
function mergeClasses(className, state) {
|
|
5910
|
-
const classList = className ? Array.isArray(className) ? className.filter(Boolean) : [className] : [];
|
|
5911
|
-
if (!state) {
|
|
5912
|
-
return classList.join(" ");
|
|
5913
|
-
}
|
|
5914
|
-
const stateClasses = Object.entries(state).filter(([, value]) => value !== void 0 && value !== false).map(([key, value]) => {
|
|
5915
|
-
if (Array.isArray(value)) {
|
|
5916
|
-
return value[0] ? value[1] : "";
|
|
5917
|
-
}
|
|
5918
|
-
return value ? key : "";
|
|
5919
|
-
}).filter(Boolean);
|
|
5920
|
-
return [...classList, ...stateClasses].join(" ");
|
|
5921
|
-
}
|
|
5922
|
-
|
|
5923
|
-
// src/components/chart/classes.ts
|
|
5924
|
-
var chartClasses = {
|
|
5925
|
-
root: createClasses("chart__root"),
|
|
5926
|
-
loading: createClasses("chart__loading"),
|
|
5927
|
-
legends: {
|
|
5928
|
-
root: createClasses("chart__legends__root"),
|
|
5929
|
-
item: {
|
|
5930
|
-
wrap: createClasses("chart__legends__item__wrap"),
|
|
5931
|
-
root: createClasses("chart__legends__item__root"),
|
|
5932
|
-
dot: createClasses("chart__legends__item__dot"),
|
|
5933
|
-
icon: createClasses("chart__legends__item__icon"),
|
|
5934
|
-
label: createClasses("chart__legends__item__label"),
|
|
5935
|
-
value: createClasses("chart__legends__item__value")
|
|
5936
|
-
}
|
|
5937
|
-
}
|
|
5938
|
-
};
|
|
5939
|
-
var CIRCULAR_TYPES = ["donut", "radialBar", "pie", "polarArea"];
|
|
5940
|
-
function ChartLoading({ sx, className, type, ...other }) {
|
|
5941
|
-
const isCircular = type && CIRCULAR_TYPES.includes(type);
|
|
5942
|
-
return /* @__PURE__ */ jsx(
|
|
5943
|
-
Box19,
|
|
5944
|
-
{
|
|
5945
|
-
className: cn(chartClasses.loading, className),
|
|
5946
|
-
sx: [
|
|
5947
|
-
{
|
|
5948
|
-
top: 0,
|
|
5949
|
-
left: 0,
|
|
5950
|
-
width: 1,
|
|
5951
|
-
zIndex: 9,
|
|
5952
|
-
height: 1,
|
|
5953
|
-
p: "inherit",
|
|
5954
|
-
overflow: "hidden",
|
|
5955
|
-
alignItems: "center",
|
|
5956
|
-
position: "absolute",
|
|
5957
|
-
borderRadius: "inherit",
|
|
5958
|
-
justifyContent: "center",
|
|
5959
|
-
display: "flex"
|
|
5960
|
-
},
|
|
5961
|
-
...Array.isArray(sx) ? sx : [sx]
|
|
5962
|
-
],
|
|
5963
|
-
...other,
|
|
5964
|
-
children: /* @__PURE__ */ jsx(
|
|
5965
|
-
Skeleton3,
|
|
5966
|
-
{
|
|
5967
|
-
variant: "circular",
|
|
5968
|
-
sx: {
|
|
5969
|
-
width: 1,
|
|
5970
|
-
height: 1,
|
|
5971
|
-
borderRadius: "inherit",
|
|
5972
|
-
...isCircular && { borderRadius: "50%" }
|
|
5973
|
-
}
|
|
5974
|
-
}
|
|
5975
|
-
)
|
|
5976
|
-
}
|
|
5977
|
-
);
|
|
5978
|
-
}
|
|
5979
|
-
function ChartLegends({
|
|
5980
|
-
sx,
|
|
5981
|
-
className,
|
|
5982
|
-
slotProps,
|
|
5983
|
-
icons = [],
|
|
5984
|
-
values = [],
|
|
5985
|
-
labels = [],
|
|
5986
|
-
colors = [],
|
|
5987
|
-
sublabels = [],
|
|
5988
|
-
...other
|
|
5989
|
-
}) {
|
|
5990
|
-
return /* @__PURE__ */ jsx(ListRoot, { className: cn(chartClasses.legends.root, className), sx, ...other, children: labels.map((series, index) => /* @__PURE__ */ jsxs(
|
|
5991
|
-
ItemWrap,
|
|
5992
|
-
{
|
|
5993
|
-
className: chartClasses.legends.item.wrap,
|
|
5994
|
-
sx: [
|
|
5995
|
-
{
|
|
5996
|
-
"--icon-color": colors[index]
|
|
5997
|
-
},
|
|
5998
|
-
...Array.isArray(slotProps?.wrapper?.sx) ? slotProps.wrapper.sx : [slotProps?.wrapper?.sx]
|
|
5999
|
-
],
|
|
6000
|
-
...slotProps?.wrapper,
|
|
6001
|
-
children: [
|
|
6002
|
-
/* @__PURE__ */ jsxs(ItemRoot2, { className: chartClasses.legends.item.root, ...slotProps?.root, children: [
|
|
6003
|
-
icons.length ? /* @__PURE__ */ jsx(ItemIcon2, { className: chartClasses.legends.item.icon, ...slotProps?.icon, children: icons[index] }) : /* @__PURE__ */ jsx(ItemDot, { className: chartClasses.legends.item.dot, ...slotProps?.dot }),
|
|
6004
|
-
/* @__PURE__ */ jsxs(ItemLabel, { className: chartClasses.legends.item.label, ...slotProps?.label, children: [
|
|
6005
|
-
series,
|
|
6006
|
-
!!sublabels.length && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6007
|
-
" ",
|
|
6008
|
-
` (${sublabels[index]})`
|
|
6009
|
-
] })
|
|
6010
|
-
] })
|
|
6011
|
-
] }),
|
|
6012
|
-
values.length > 0 && /* @__PURE__ */ jsx(ItemValue, { className: chartClasses.legends.item.value, ...slotProps?.value, children: values[index] })
|
|
6013
|
-
]
|
|
6014
|
-
},
|
|
6015
|
-
series
|
|
6016
|
-
)) });
|
|
6017
|
-
}
|
|
6018
|
-
var ListRoot = styled("ul")(({ theme }) => ({
|
|
6019
|
-
display: "flex",
|
|
6020
|
-
flexWrap: "wrap",
|
|
6021
|
-
gap: theme.spacing(2),
|
|
6022
|
-
margin: 0,
|
|
6023
|
-
padding: 0,
|
|
6024
|
-
listStyle: "none"
|
|
6025
|
-
}));
|
|
6026
|
-
var ItemWrap = styled("li")({
|
|
6027
|
-
display: "inline-flex",
|
|
6028
|
-
flexDirection: "column"
|
|
6029
|
-
});
|
|
6030
|
-
var ItemRoot2 = styled("div")(({ theme }) => ({
|
|
6031
|
-
gap: 6,
|
|
6032
|
-
alignItems: "center",
|
|
6033
|
-
display: "inline-flex",
|
|
6034
|
-
justifyContent: "flex-start",
|
|
6035
|
-
fontSize: theme.typography.pxToRem(13),
|
|
6036
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
6037
|
-
}));
|
|
6038
|
-
var ItemIcon2 = styled("span")({
|
|
6039
|
-
display: "inline-flex",
|
|
6040
|
-
color: "var(--icon-color)",
|
|
6041
|
-
"& > svg": {
|
|
6042
|
-
width: 20,
|
|
6043
|
-
height: 20
|
|
6044
|
-
}
|
|
6045
|
-
});
|
|
6046
|
-
var ItemDot = styled("span")({
|
|
6047
|
-
width: 12,
|
|
6048
|
-
height: 12,
|
|
6049
|
-
flexShrink: 0,
|
|
6050
|
-
display: "flex",
|
|
6051
|
-
borderRadius: "50%",
|
|
6052
|
-
position: "relative",
|
|
6053
|
-
alignItems: "center",
|
|
6054
|
-
justifyContent: "center",
|
|
6055
|
-
color: "var(--icon-color)",
|
|
6056
|
-
backgroundColor: "currentColor"
|
|
6057
|
-
});
|
|
6058
|
-
var ItemLabel = styled("span")({
|
|
6059
|
-
flexShrink: 0
|
|
6060
|
-
});
|
|
6061
|
-
var ItemValue = styled("span")(({ theme }) => ({
|
|
6062
|
-
...theme.typography.h6,
|
|
6063
|
-
marginTop: theme.spacing(1)
|
|
6064
|
-
}));
|
|
6065
|
-
var LazyApexChart = lazy(
|
|
6066
|
-
() => import('react-apexcharts').then((module) => ({
|
|
6067
|
-
default: module.default
|
|
6068
|
-
}))
|
|
6069
|
-
);
|
|
6070
|
-
function Chart({
|
|
6071
|
-
type,
|
|
6072
|
-
series,
|
|
6073
|
-
options,
|
|
6074
|
-
width = "100%",
|
|
6075
|
-
height = "100%",
|
|
6076
|
-
slotProps,
|
|
6077
|
-
className,
|
|
6078
|
-
sx,
|
|
6079
|
-
...other
|
|
6080
|
-
}) {
|
|
6081
|
-
const [isClient, setIsClient] = useState(false);
|
|
6082
|
-
useEffect(() => {
|
|
6083
|
-
setIsClient(true);
|
|
6084
|
-
}, []);
|
|
6085
|
-
const renderFallback = () => /* @__PURE__ */ jsx(ChartLoading, { type, sx: slotProps?.loading });
|
|
6086
|
-
return /* @__PURE__ */ jsx(ChartRoot, { dir: "ltr", className: cn(chartClasses.root, className), sx, ...other, children: isClient ? /* @__PURE__ */ jsx(Suspense, { fallback: renderFallback(), children: /* @__PURE__ */ jsx(LazyApexChart, { type, series, options, width, height }) }) : renderFallback() });
|
|
6087
|
-
}
|
|
6088
|
-
var ChartRoot = styled("div")(({ theme }) => ({
|
|
6089
|
-
width: "100%",
|
|
6090
|
-
flexShrink: 0,
|
|
6091
|
-
position: "relative",
|
|
6092
|
-
borderRadius: Number(theme.shape.borderRadius) * 1.5
|
|
6093
|
-
}));
|
|
6094
|
-
function useChart(updatedOptions) {
|
|
6095
|
-
const theme = useTheme();
|
|
6096
|
-
const baseOptions = baseChartOptions(theme) ?? {};
|
|
6097
|
-
return deepMerge(baseOptions, updatedOptions ?? {});
|
|
6098
|
-
}
|
|
6099
|
-
function baseChartOptions(theme) {
|
|
6100
|
-
const vars = theme.vars?.palette;
|
|
6101
|
-
const palette = theme.palette;
|
|
6102
|
-
const LABEL_TOTAL = {
|
|
6103
|
-
show: true,
|
|
6104
|
-
label: "Total",
|
|
6105
|
-
color: vars?.text.secondary ?? palette.text.secondary,
|
|
6106
|
-
fontSize: theme.typography.subtitle2.fontSize,
|
|
6107
|
-
fontWeight: theme.typography.subtitle2.fontWeight
|
|
6108
|
-
};
|
|
6109
|
-
const LABEL_VALUE = {
|
|
6110
|
-
offsetY: 8,
|
|
6111
|
-
color: vars?.text.primary ?? palette.text.primary,
|
|
6112
|
-
fontSize: theme.typography.h4.fontSize,
|
|
6113
|
-
fontWeight: theme.typography.h4.fontWeight
|
|
6114
|
-
};
|
|
6115
|
-
const greyChannel = getColorChannel(theme, "grey", "500");
|
|
6116
|
-
const dividerColor = vars?.divider ?? palette.divider;
|
|
6117
|
-
const paperColor = vars?.background.paper ?? palette.background.paper;
|
|
6118
|
-
return {
|
|
6119
|
-
// =========================================================================
|
|
6120
|
-
// Chart
|
|
6121
|
-
// https://apexcharts.com/docs/options/chart/animations/
|
|
6122
|
-
// =========================================================================
|
|
6123
|
-
chart: {
|
|
6124
|
-
toolbar: { show: false },
|
|
6125
|
-
zoom: { enabled: false },
|
|
6126
|
-
parentHeightOffset: 0,
|
|
6127
|
-
fontFamily: theme.typography.fontFamily,
|
|
6128
|
-
foreColor: vars?.text.disabled ?? palette.text.disabled,
|
|
6129
|
-
animations: {
|
|
6130
|
-
enabled: true,
|
|
6131
|
-
speed: 360,
|
|
6132
|
-
animateGradually: { enabled: true, delay: 120 },
|
|
6133
|
-
dynamicAnimation: { enabled: true, speed: 360 }
|
|
6134
|
-
}
|
|
6135
|
-
},
|
|
6136
|
-
// =========================================================================
|
|
6137
|
-
// Colors
|
|
6138
|
-
// https://apexcharts.com/docs/options/colors/
|
|
6139
|
-
// =========================================================================
|
|
6140
|
-
colors: [
|
|
6141
|
-
palette.primary.main,
|
|
6142
|
-
palette.warning.main,
|
|
6143
|
-
palette.info.main,
|
|
6144
|
-
palette.error.main,
|
|
6145
|
-
palette.success.main,
|
|
6146
|
-
palette.warning.dark,
|
|
6147
|
-
palette.success.dark,
|
|
6148
|
-
palette.info.dark,
|
|
6149
|
-
palette.primary.dark
|
|
6150
|
-
],
|
|
6151
|
-
// =========================================================================
|
|
6152
|
-
// States
|
|
6153
|
-
// https://apexcharts.com/docs/options/states/
|
|
6154
|
-
// =========================================================================
|
|
6155
|
-
states: {
|
|
6156
|
-
hover: { filter: { type: "darken" } },
|
|
6157
|
-
active: { filter: { type: "darken" } }
|
|
6158
|
-
},
|
|
6159
|
-
// =========================================================================
|
|
6160
|
-
// Fill
|
|
6161
|
-
// https://apexcharts.com/docs/options/fill/
|
|
6162
|
-
// =========================================================================
|
|
6163
|
-
fill: {
|
|
6164
|
-
opacity: 1,
|
|
6165
|
-
gradient: {
|
|
6166
|
-
type: "vertical",
|
|
6167
|
-
shadeIntensity: 0,
|
|
6168
|
-
opacityFrom: 0.4,
|
|
6169
|
-
opacityTo: 0,
|
|
6170
|
-
stops: [0, 100]
|
|
6171
|
-
}
|
|
6172
|
-
},
|
|
6173
|
-
// =========================================================================
|
|
6174
|
-
// Data Labels
|
|
6175
|
-
// https://apexcharts.com/docs/options/datalabels/
|
|
6176
|
-
// =========================================================================
|
|
6177
|
-
dataLabels: { enabled: false },
|
|
6178
|
-
// =========================================================================
|
|
6179
|
-
// Stroke
|
|
6180
|
-
// https://apexcharts.com/docs/options/stroke/
|
|
6181
|
-
// =========================================================================
|
|
6182
|
-
stroke: { width: 2.5, curve: "smooth", lineCap: "round" },
|
|
6183
|
-
// =========================================================================
|
|
6184
|
-
// Grid
|
|
6185
|
-
// https://apexcharts.com/docs/options/grid/
|
|
6186
|
-
// =========================================================================
|
|
6187
|
-
grid: {
|
|
6188
|
-
strokeDashArray: 3,
|
|
6189
|
-
borderColor: dividerColor,
|
|
6190
|
-
padding: { top: 0, right: 0, bottom: 0 },
|
|
6191
|
-
xaxis: { lines: { show: false } }
|
|
6192
|
-
},
|
|
6193
|
-
// =========================================================================
|
|
6194
|
-
// Axis
|
|
6195
|
-
// https://apexcharts.com/docs/options/xaxis/
|
|
6196
|
-
// https://apexcharts.com/docs/options/yaxis/
|
|
6197
|
-
// =========================================================================
|
|
6198
|
-
xaxis: { axisBorder: { show: false }, axisTicks: { show: false } },
|
|
6199
|
-
yaxis: { tickAmount: 5 },
|
|
6200
|
-
// =========================================================================
|
|
6201
|
-
// Markers
|
|
6202
|
-
// https://apexcharts.com/docs/options/markers/
|
|
6203
|
-
// =========================================================================
|
|
6204
|
-
markers: {
|
|
6205
|
-
size: 0,
|
|
6206
|
-
strokeColors: paperColor
|
|
6207
|
-
},
|
|
6208
|
-
// =========================================================================
|
|
6209
|
-
// Tooltip
|
|
6210
|
-
// =========================================================================
|
|
6211
|
-
tooltip: { theme: "false", fillSeriesColor: false, x: { show: true } },
|
|
6212
|
-
// =========================================================================
|
|
6213
|
-
// Legend
|
|
6214
|
-
// https://apexcharts.com/docs/options/legend/
|
|
6215
|
-
// =========================================================================
|
|
6216
|
-
legend: {
|
|
6217
|
-
show: false,
|
|
6218
|
-
position: "top",
|
|
6219
|
-
fontWeight: 500,
|
|
6220
|
-
fontSize: "13px",
|
|
6221
|
-
horizontalAlign: "right",
|
|
6222
|
-
markers: { shape: "circle" },
|
|
6223
|
-
labels: { colors: vars?.text.primary ?? palette.text.primary },
|
|
6224
|
-
itemMargin: { horizontal: 8, vertical: 8 }
|
|
6225
|
-
},
|
|
6226
|
-
// =========================================================================
|
|
6227
|
-
// Plot Options
|
|
6228
|
-
// =========================================================================
|
|
6229
|
-
plotOptions: {
|
|
6230
|
-
// Bar charts
|
|
6231
|
-
// https://apexcharts.com/docs/options/plotoptions/bar/
|
|
6232
|
-
bar: { borderRadius: 4, columnWidth: "48%", borderRadiusApplication: "end" },
|
|
6233
|
-
// Pie & Donut charts
|
|
6234
|
-
// https://apexcharts.com/docs/options/plotoptions/pie/
|
|
6235
|
-
pie: {
|
|
6236
|
-
donut: {
|
|
6237
|
-
labels: {
|
|
6238
|
-
show: true,
|
|
6239
|
-
value: { ...LABEL_VALUE },
|
|
6240
|
-
total: { ...LABEL_TOTAL }
|
|
6241
|
-
}
|
|
6242
|
-
}
|
|
6243
|
-
},
|
|
6244
|
-
// RadialBar charts
|
|
6245
|
-
// https://apexcharts.com/docs/options/plotoptions/radialbar/
|
|
6246
|
-
radialBar: {
|
|
6247
|
-
hollow: { margin: -8, size: "100%" },
|
|
6248
|
-
track: {
|
|
6249
|
-
margin: -8,
|
|
6250
|
-
strokeWidth: "50%",
|
|
6251
|
-
background: `rgba(${greyChannel} / 0.16)`
|
|
6252
|
-
},
|
|
6253
|
-
dataLabels: { value: { ...LABEL_VALUE }, total: { ...LABEL_TOTAL } }
|
|
6254
|
-
},
|
|
6255
|
-
// Radar charts
|
|
6256
|
-
// https://apexcharts.com/docs/options/plotoptions/radar/
|
|
6257
|
-
radar: {
|
|
6258
|
-
polygons: {
|
|
6259
|
-
fill: { colors: ["transparent"] },
|
|
6260
|
-
strokeColors: dividerColor,
|
|
6261
|
-
connectorColors: dividerColor
|
|
6262
|
-
}
|
|
6263
|
-
},
|
|
6264
|
-
// Polar Area charts
|
|
6265
|
-
// https://apexcharts.com/docs/options/plotoptions/polararea/
|
|
6266
|
-
polarArea: {
|
|
6267
|
-
rings: { strokeColor: dividerColor },
|
|
6268
|
-
spokes: { connectorColors: dividerColor }
|
|
6269
|
-
},
|
|
6270
|
-
// Heatmap charts
|
|
6271
|
-
// https://apexcharts.com/docs/options/plotoptions/heatmap/
|
|
6272
|
-
heatmap: { distributed: true }
|
|
6273
|
-
},
|
|
6274
|
-
// =========================================================================
|
|
6275
|
-
// Responsive
|
|
6276
|
-
// https://apexcharts.com/docs/options/responsive/
|
|
6277
|
-
// =========================================================================
|
|
6278
|
-
responsive: [
|
|
6279
|
-
{
|
|
6280
|
-
breakpoint: theme.breakpoints.values.sm,
|
|
6281
|
-
options: { plotOptions: { bar: { borderRadius: 3, columnWidth: "80%" } } }
|
|
6282
|
-
},
|
|
6283
|
-
{
|
|
6284
|
-
breakpoint: theme.breakpoints.values.md,
|
|
6285
|
-
options: { plotOptions: { bar: { columnWidth: "60%" } } }
|
|
6286
|
-
}
|
|
6287
|
-
]
|
|
6288
|
-
};
|
|
6289
|
-
}
|
|
6290
|
-
function getColorChannel(theme, color, shade) {
|
|
6291
|
-
const channelKey = `${shade}Channel` ;
|
|
6292
|
-
const vars = theme.vars?.palette[color];
|
|
6293
|
-
const fallbacks = {
|
|
6294
|
-
"500Channel": "145 158 171",
|
|
6295
|
-
"900Channel": "0 0 0",
|
|
6296
|
-
mainChannel: "51 133 240"
|
|
6297
|
-
};
|
|
6298
|
-
return vars?.[channelKey] ?? fallbacks[channelKey] ?? "145 158 171";
|
|
6299
|
-
}
|
|
6300
|
-
function deepMerge(target, source) {
|
|
6301
|
-
const output = { ...target };
|
|
6302
|
-
for (const key of Object.keys(source)) {
|
|
6303
|
-
const sourceValue = source[key];
|
|
6304
|
-
const targetValue = target[key];
|
|
6305
|
-
if (sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue !== null && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
6306
|
-
output[key] = deepMerge(targetValue, sourceValue);
|
|
6307
|
-
} else if (sourceValue !== void 0) {
|
|
6308
|
-
output[key] = sourceValue;
|
|
6309
|
-
}
|
|
6310
|
-
}
|
|
6311
|
-
return output;
|
|
6312
|
-
}
|
|
6313
2711
|
|
|
6314
2712
|
// src/components/lightbox/types.ts
|
|
6315
2713
|
var DEFAULT_LIGHTBOX_LABELS = {
|
|
@@ -6653,8 +3051,8 @@ function Lightbox({
|
|
|
6653
3051
|
/* @__PURE__ */ jsx(Typography5, { component: "span", sx: { mx: 0.5, opacity: 0.5 }, children: "/" }),
|
|
6654
3052
|
totalSlides
|
|
6655
3053
|
] }),
|
|
6656
|
-
/* @__PURE__ */ jsx(
|
|
6657
|
-
zoom && /* @__PURE__ */ jsxs(
|
|
3054
|
+
/* @__PURE__ */ jsx(Box9, { sx: { flex: 1 } }),
|
|
3055
|
+
zoom && /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.25 }, children: [
|
|
6658
3056
|
/* @__PURE__ */ jsx(
|
|
6659
3057
|
GlassButton,
|
|
6660
3058
|
{
|
|
@@ -6794,7 +3192,7 @@ function Lightbox({
|
|
|
6794
3192
|
},
|
|
6795
3193
|
children: [
|
|
6796
3194
|
isLoading && !isVideo && /* @__PURE__ */ jsx(LoadingOverlay, { className: lightboxClasses.loading, children: /* @__PURE__ */ jsx(
|
|
6797
|
-
|
|
3195
|
+
MuiCircularProgress,
|
|
6798
3196
|
{
|
|
6799
3197
|
size: 40,
|
|
6800
3198
|
thickness: 2.5,
|
|
@@ -6885,7 +3283,7 @@ function Lightbox({
|
|
|
6885
3283
|
}
|
|
6886
3284
|
),
|
|
6887
3285
|
isThumbVideo && /* @__PURE__ */ jsx(
|
|
6888
|
-
|
|
3286
|
+
Box9,
|
|
6889
3287
|
{
|
|
6890
3288
|
sx: {
|
|
6891
3289
|
position: "absolute",
|
|
@@ -6915,7 +3313,7 @@ function Lightbox({
|
|
|
6915
3313
|
/* @__PURE__ */ jsx(Typography5, { component: "span", sx: { mx: 0.5, opacity: 0.5 }, children: "/" }),
|
|
6916
3314
|
totalSlides
|
|
6917
3315
|
] }),
|
|
6918
|
-
/* @__PURE__ */ jsx(
|
|
3316
|
+
/* @__PURE__ */ jsx(Box9, { sx: { flex: 1 } }),
|
|
6919
3317
|
/* @__PURE__ */ jsx(GlassButton, { onClick: onClose, "aria-label": labels.close, size: "small", children: /* @__PURE__ */ jsx(CloseIcon, { fontSize: "small" }) })
|
|
6920
3318
|
]
|
|
6921
3319
|
}
|
|
@@ -6938,7 +3336,7 @@ var StyledDialog = styled(Dialog)(({ theme }) => ({
|
|
|
6938
3336
|
backdropFilter: "blur(8px)"
|
|
6939
3337
|
}
|
|
6940
3338
|
}));
|
|
6941
|
-
var LightboxContainer = styled(
|
|
3339
|
+
var LightboxContainer = styled(Box9)({
|
|
6942
3340
|
display: "flex",
|
|
6943
3341
|
flexDirection: "column",
|
|
6944
3342
|
width: "100vw",
|
|
@@ -6947,7 +3345,7 @@ var LightboxContainer = styled(Box19)({
|
|
|
6947
3345
|
overflow: "hidden",
|
|
6948
3346
|
userSelect: "none"
|
|
6949
3347
|
});
|
|
6950
|
-
var GlassToolbar = styled(
|
|
3348
|
+
var GlassToolbar = styled(Box9)(({ theme, placement }) => ({
|
|
6951
3349
|
display: "flex",
|
|
6952
3350
|
alignItems: "center",
|
|
6953
3351
|
gap: theme.spacing(0.5),
|
|
@@ -6961,7 +3359,7 @@ var GlassToolbar = styled(Box19)(({ theme, placement }) => ({
|
|
|
6961
3359
|
background: `linear-gradient(${placement === "top" ? "to bottom" : "to top"}, ${alpha(theme.palette.common.black, 0.55)} 0%, ${alpha(theme.palette.common.black, 0.2)} 60%, transparent 100%)`,
|
|
6962
3360
|
transition: "opacity 0.3s ease"
|
|
6963
3361
|
}));
|
|
6964
|
-
var GlassButton = styled(
|
|
3362
|
+
var GlassButton = styled(IconButton2)(({ theme }) => ({
|
|
6965
3363
|
color: alpha(theme.palette.common.white, 0.85),
|
|
6966
3364
|
borderRadius: Number(theme.shape.borderRadius) * 1.5,
|
|
6967
3365
|
padding: 6,
|
|
@@ -6994,7 +3392,7 @@ var CounterChip = styled(Typography5)(({ theme }) => ({
|
|
|
6994
3392
|
alignItems: "center",
|
|
6995
3393
|
letterSpacing: "0.02em"
|
|
6996
3394
|
}));
|
|
6997
|
-
var SlideContainer = styled(
|
|
3395
|
+
var SlideContainer = styled(Box9)({
|
|
6998
3396
|
flex: 1,
|
|
6999
3397
|
display: "flex",
|
|
7000
3398
|
alignItems: "center",
|
|
@@ -7002,7 +3400,7 @@ var SlideContainer = styled(Box19)({
|
|
|
7002
3400
|
position: "relative",
|
|
7003
3401
|
overflow: "hidden"
|
|
7004
3402
|
});
|
|
7005
|
-
var SlideLayer = styled(
|
|
3403
|
+
var SlideLayer = styled(Box9)({
|
|
7006
3404
|
position: "absolute",
|
|
7007
3405
|
inset: 0,
|
|
7008
3406
|
display: "flex",
|
|
@@ -7010,7 +3408,7 @@ var SlideLayer = styled(Box19)({
|
|
|
7010
3408
|
justifyContent: "center",
|
|
7011
3409
|
willChange: "opacity, transform"
|
|
7012
3410
|
});
|
|
7013
|
-
var LoadingOverlay = styled(
|
|
3411
|
+
var LoadingOverlay = styled(Box9)({
|
|
7014
3412
|
position: "absolute",
|
|
7015
3413
|
top: "50%",
|
|
7016
3414
|
left: "50%",
|
|
@@ -7024,7 +3422,7 @@ var StyledImage = styled("img")({
|
|
|
7024
3422
|
willChange: "transform, opacity",
|
|
7025
3423
|
borderRadius: 2
|
|
7026
3424
|
});
|
|
7027
|
-
var VideoWrapper = styled(
|
|
3425
|
+
var VideoWrapper = styled(Box9)({
|
|
7028
3426
|
position: "relative",
|
|
7029
3427
|
display: "flex",
|
|
7030
3428
|
alignItems: "center",
|
|
@@ -7048,7 +3446,7 @@ var StyledVideo = styled("video")(({ theme }) => ({
|
|
|
7048
3446
|
fontSize: 12
|
|
7049
3447
|
}
|
|
7050
3448
|
}));
|
|
7051
|
-
var GlassCaption = styled(
|
|
3449
|
+
var GlassCaption = styled(Box9)(({ theme }) => ({
|
|
7052
3450
|
position: "absolute",
|
|
7053
3451
|
bottom: theme.spacing(2.5),
|
|
7054
3452
|
left: "50%",
|
|
@@ -7068,7 +3466,7 @@ var GlassCaption = styled(Box19)(({ theme }) => ({
|
|
|
7068
3466
|
to: { opacity: 1, transform: "translateX(-50%) translateY(0)" }
|
|
7069
3467
|
}
|
|
7070
3468
|
}));
|
|
7071
|
-
var NavArrow = styled(
|
|
3469
|
+
var NavArrow = styled(IconButton2)(({ theme, side }) => ({
|
|
7072
3470
|
position: "absolute",
|
|
7073
3471
|
top: "50%",
|
|
7074
3472
|
transform: "translateY(-50%)",
|
|
@@ -7095,7 +3493,7 @@ var NavArrow = styled(IconButton4)(({ theme, side }) => ({
|
|
|
7095
3493
|
transform: "translateY(-50%) scale(0.95)"
|
|
7096
3494
|
}
|
|
7097
3495
|
}));
|
|
7098
|
-
var ThumbnailStrip = styled(
|
|
3496
|
+
var ThumbnailStrip = styled(Box9)(({ theme }) => ({
|
|
7099
3497
|
display: "flex",
|
|
7100
3498
|
gap: theme.spacing(0.75),
|
|
7101
3499
|
padding: theme.spacing(1, 2),
|
|
@@ -7110,7 +3508,7 @@ var ThumbnailStrip = styled(Box19)(({ theme }) => ({
|
|
|
7110
3508
|
display: "none"
|
|
7111
3509
|
}
|
|
7112
3510
|
}));
|
|
7113
|
-
var ThumbItem = styled(
|
|
3511
|
+
var ThumbItem = styled(Box9)(({ theme, active }) => ({
|
|
7114
3512
|
flexShrink: 0,
|
|
7115
3513
|
width: 56,
|
|
7116
3514
|
height: 56,
|
|
@@ -7560,31 +3958,31 @@ function Carousel({
|
|
|
7560
3958
|
}
|
|
7561
3959
|
);
|
|
7562
3960
|
}
|
|
7563
|
-
var CarouselRoot = styled(
|
|
3961
|
+
var CarouselRoot = styled(Box9)({
|
|
7564
3962
|
position: "relative",
|
|
7565
3963
|
width: "100%",
|
|
7566
3964
|
overflow: "hidden",
|
|
7567
3965
|
outline: "none"
|
|
7568
3966
|
});
|
|
7569
|
-
var CarouselContainer = styled(
|
|
3967
|
+
var CarouselContainer = styled(Box9)({
|
|
7570
3968
|
position: "relative",
|
|
7571
3969
|
width: "100%",
|
|
7572
3970
|
overflow: "hidden"
|
|
7573
3971
|
});
|
|
7574
|
-
var CarouselTrack = styled(
|
|
3972
|
+
var CarouselTrack = styled(Box9)({
|
|
7575
3973
|
display: "flex",
|
|
7576
3974
|
width: "100%",
|
|
7577
3975
|
willChange: "transform",
|
|
7578
3976
|
userSelect: "none"
|
|
7579
3977
|
});
|
|
7580
|
-
var CarouselSlide = styled(
|
|
3978
|
+
var CarouselSlide = styled(Box9)({
|
|
7581
3979
|
flexShrink: 0,
|
|
7582
3980
|
"& > *": {
|
|
7583
3981
|
width: "100%",
|
|
7584
3982
|
height: "100%"
|
|
7585
3983
|
}
|
|
7586
3984
|
});
|
|
7587
|
-
var ArrowButton = styled(
|
|
3985
|
+
var ArrowButton = styled(IconButton2)(
|
|
7588
3986
|
({ theme, isHorizontal, direction }) => ({
|
|
7589
3987
|
position: "absolute",
|
|
7590
3988
|
zIndex: 10,
|
|
@@ -7607,7 +4005,7 @@ var ArrowButton = styled(IconButton4)(
|
|
|
7607
4005
|
}
|
|
7608
4006
|
})
|
|
7609
4007
|
);
|
|
7610
|
-
var DotsContainer = styled(
|
|
4008
|
+
var DotsContainer = styled(Box9)(({ theme, dotsPosition }) => ({
|
|
7611
4009
|
display: "flex",
|
|
7612
4010
|
gap: theme.spacing(1),
|
|
7613
4011
|
position: "absolute",
|
|
@@ -7892,7 +4290,7 @@ function getNavCssVars(theme, variant) {
|
|
|
7892
4290
|
}
|
|
7893
4291
|
function Nav({ className, sx, ref, ...other }) {
|
|
7894
4292
|
return /* @__PURE__ */ jsx(
|
|
7895
|
-
|
|
4293
|
+
Box9,
|
|
7896
4294
|
{
|
|
7897
4295
|
component: "nav",
|
|
7898
4296
|
ref,
|
|
@@ -7911,7 +4309,7 @@ function Nav({ className, sx, ref, ...other }) {
|
|
|
7911
4309
|
}
|
|
7912
4310
|
function NavUl({ className, sx, ref, ...other }) {
|
|
7913
4311
|
return /* @__PURE__ */ jsx(
|
|
7914
|
-
|
|
4312
|
+
Box9,
|
|
7915
4313
|
{
|
|
7916
4314
|
component: "ul",
|
|
7917
4315
|
ref,
|
|
@@ -7932,7 +4330,7 @@ function NavUl({ className, sx, ref, ...other }) {
|
|
|
7932
4330
|
}
|
|
7933
4331
|
function NavLi({ className, ref, ...other }) {
|
|
7934
4332
|
return /* @__PURE__ */ jsx(
|
|
7935
|
-
|
|
4333
|
+
Box9,
|
|
7936
4334
|
{
|
|
7937
4335
|
component: "li",
|
|
7938
4336
|
ref,
|
|
@@ -8292,7 +4690,7 @@ function resolveInfo(info, render) {
|
|
|
8292
4690
|
if (!info) return void 0;
|
|
8293
4691
|
if (Array.isArray(info) && render?.navInfo) {
|
|
8294
4692
|
const infoComponents = info.map((key) => render.navInfo?.(key));
|
|
8295
|
-
return /* @__PURE__ */ jsx(Fragment, { children: infoComponents.map((comp, idx) => /* @__PURE__ */ jsx(
|
|
4693
|
+
return /* @__PURE__ */ jsx(Fragment, { children: infoComponents.map((comp, idx) => /* @__PURE__ */ jsx(Box9, { component: "span", children: comp && Object.values(comp)[0] }, idx)) });
|
|
8296
4694
|
}
|
|
8297
4695
|
return info;
|
|
8298
4696
|
}
|
|
@@ -8306,7 +4704,7 @@ function NavItem(props) {
|
|
|
8306
4704
|
info,
|
|
8307
4705
|
caption,
|
|
8308
4706
|
disabled,
|
|
8309
|
-
children,
|
|
4707
|
+
children: _children,
|
|
8310
4708
|
// State props
|
|
8311
4709
|
open,
|
|
8312
4710
|
active,
|
|
@@ -9087,7 +5485,7 @@ var SubItemLink = styled(Link, {
|
|
|
9087
5485
|
color: theme.palette.text.primary
|
|
9088
5486
|
}
|
|
9089
5487
|
}));
|
|
9090
|
-
var TagsContainer = styled(
|
|
5488
|
+
var TagsContainer = styled(Box9)(({ theme }) => ({
|
|
9091
5489
|
display: "flex",
|
|
9092
5490
|
flexWrap: "wrap",
|
|
9093
5491
|
gap: 8,
|
|
@@ -9204,7 +5602,7 @@ function MegaMenuList({ data, render, slotProps, slots, enabledRootRedirect }) {
|
|
|
9204
5602
|
slots?.topArea,
|
|
9205
5603
|
/* @__PURE__ */ jsx(DropdownContent, { elevation: 0, className: megaMenuClasses.dropdown, children: data.children?.map((section, idx) => /* @__PURE__ */ jsxs(SectionColumn, { children: [
|
|
9206
5604
|
section.subheader && /* @__PURE__ */ jsx(SectionHeader, { className: megaMenuClasses.subheader, children: section.subheader }),
|
|
9207
|
-
/* @__PURE__ */ jsx(
|
|
5605
|
+
/* @__PURE__ */ jsx(Stack2, { spacing: 0.5, children: section.items.map((item) => {
|
|
9208
5606
|
const itemActive = isActiveLink(pathname, item.path);
|
|
9209
5607
|
const isExternal = isExternalLink(item.path);
|
|
9210
5608
|
return /* @__PURE__ */ jsx(
|
|
@@ -9221,9 +5619,9 @@ function MegaMenuList({ data, render, slotProps, slots, enabledRootRedirect }) {
|
|
|
9221
5619
|
item.title
|
|
9222
5620
|
);
|
|
9223
5621
|
}) }),
|
|
9224
|
-
idx === 0 && data.moreLink && /* @__PURE__ */ jsx(
|
|
5622
|
+
idx === 0 && data.moreLink && /* @__PURE__ */ jsx(Box9, { sx: { mt: 2 }, children: /* @__PURE__ */ jsx(MoreLink, { href: data.moreLink.path, className: megaMenuClasses.moreLink, sx: slotProps?.moreLink, children: data.moreLink.title }) })
|
|
9225
5623
|
] }, section.subheader ?? idx)) }),
|
|
9226
|
-
data.tags && data.tags.length > 0 && /* @__PURE__ */ jsx(
|
|
5624
|
+
data.tags && data.tags.length > 0 && /* @__PURE__ */ jsx(Box9, { sx: { px: "var(--nav-dropdown-padding)", pb: "var(--nav-dropdown-padding)" }, children: /* @__PURE__ */ jsx(TagsContainer, { className: megaMenuClasses.tags, sx: slotProps?.tags, children: data.tags.map((tag) => /* @__PURE__ */ jsx(Tag, { href: tag.path, children: tag.title }, tag.title)) }) }),
|
|
9227
5625
|
slots?.bottomArea
|
|
9228
5626
|
]
|
|
9229
5627
|
}
|
|
@@ -9456,9 +5854,9 @@ function MegaMenuList2({ data, render, slotProps, slots, enabledRootRedirect })
|
|
|
9456
5854
|
disableRestoreFocus: true,
|
|
9457
5855
|
children: [
|
|
9458
5856
|
slots?.topArea,
|
|
9459
|
-
/* @__PURE__ */ jsx(DropdownContent2, { elevation: 0, className: megaMenuClasses.dropdown, children: data.children?.map((section, idx) => /* @__PURE__ */ jsxs(
|
|
5857
|
+
/* @__PURE__ */ jsx(DropdownContent2, { elevation: 0, className: megaMenuClasses.dropdown, children: data.children?.map((section, idx) => /* @__PURE__ */ jsxs(Box9, { children: [
|
|
9460
5858
|
section.subheader && /* @__PURE__ */ jsx(SectionHeader2, { className: megaMenuClasses.subheader, children: section.subheader }),
|
|
9461
|
-
/* @__PURE__ */ jsx(
|
|
5859
|
+
/* @__PURE__ */ jsx(Stack2, { spacing: 0.5, children: section.items.map((item) => {
|
|
9462
5860
|
const itemActive = isActiveLink(pathname, item.path);
|
|
9463
5861
|
const isExternal = isExternalLink(item.path);
|
|
9464
5862
|
return /* @__PURE__ */ jsx(
|
|
@@ -9598,7 +5996,7 @@ var ArrowIcon4 = styled("span")(({ open }) => ({
|
|
|
9598
5996
|
transform: "rotate(-45deg)"
|
|
9599
5997
|
}
|
|
9600
5998
|
}));
|
|
9601
|
-
var CollapseContent = styled(
|
|
5999
|
+
var CollapseContent = styled(Box9)(({ theme }) => ({
|
|
9602
6000
|
padding: "8px 0",
|
|
9603
6001
|
paddingLeft: 40,
|
|
9604
6002
|
backgroundColor: theme.palette.background.neutral
|
|
@@ -9681,9 +6079,9 @@ function MegaMenuList3({ data, render, slotProps, enabledRootRedirect }) {
|
|
|
9681
6079
|
]
|
|
9682
6080
|
}
|
|
9683
6081
|
),
|
|
9684
|
-
/* @__PURE__ */ jsx(Collapse, { in: open, unmountOnExit: true, children: /* @__PURE__ */ jsx(CollapseContent, { children: data.children?.map((section, idx) => /* @__PURE__ */ jsxs(
|
|
6082
|
+
/* @__PURE__ */ jsx(Collapse, { in: open, unmountOnExit: true, children: /* @__PURE__ */ jsx(CollapseContent, { children: data.children?.map((section, idx) => /* @__PURE__ */ jsxs(Box9, { children: [
|
|
9685
6083
|
section.subheader && /* @__PURE__ */ jsx(SectionHeader3, { className: megaMenuClasses.subheader, children: section.subheader }),
|
|
9686
|
-
/* @__PURE__ */ jsx(
|
|
6084
|
+
/* @__PURE__ */ jsx(Stack2, { children: section.items.map((item) => {
|
|
9687
6085
|
const itemActive = isActiveLink(pathname, item.path);
|
|
9688
6086
|
const isExternal = isExternalLink(item.path);
|
|
9689
6087
|
return /* @__PURE__ */ jsx(
|
|
@@ -10220,7 +6618,7 @@ function DurationPicker({ value, onChange, size = "small", disabled = false, lab
|
|
|
10220
6618
|
}
|
|
10221
6619
|
}
|
|
10222
6620
|
};
|
|
10223
|
-
return /* @__PURE__ */ jsxs(
|
|
6621
|
+
return /* @__PURE__ */ jsxs(Box9, { children: [
|
|
10224
6622
|
/* @__PURE__ */ jsx(
|
|
10225
6623
|
Typography5,
|
|
10226
6624
|
{
|
|
@@ -10271,7 +6669,7 @@ function DurationPicker({ value, onChange, size = "small", disabled = false, lab
|
|
|
10271
6669
|
}
|
|
10272
6670
|
),
|
|
10273
6671
|
isCustom && /* @__PURE__ */ jsxs(
|
|
10274
|
-
|
|
6672
|
+
Box9,
|
|
10275
6673
|
{
|
|
10276
6674
|
sx: {
|
|
10277
6675
|
mt: 1.25,
|
|
@@ -10281,7 +6679,7 @@ function DurationPicker({ value, onChange, size = "small", disabled = false, lab
|
|
|
10281
6679
|
},
|
|
10282
6680
|
children: [
|
|
10283
6681
|
/* @__PURE__ */ jsx(
|
|
10284
|
-
|
|
6682
|
+
TextField,
|
|
10285
6683
|
{
|
|
10286
6684
|
type: "number",
|
|
10287
6685
|
value: customText,
|
|
@@ -10304,9 +6702,9 @@ function DurationPicker({ value, onChange, size = "small", disabled = false, lab
|
|
|
10304
6702
|
size,
|
|
10305
6703
|
sx: { minWidth: 100 },
|
|
10306
6704
|
children: [
|
|
10307
|
-
/* @__PURE__ */ jsx(
|
|
10308
|
-
/* @__PURE__ */ jsx(
|
|
10309
|
-
/* @__PURE__ */ jsx(
|
|
6705
|
+
/* @__PURE__ */ jsx(MenuItem2, { value: "hours", children: labels?.hours ?? "hours" }),
|
|
6706
|
+
/* @__PURE__ */ jsx(MenuItem2, { value: "days", children: labels?.days ?? "days" }),
|
|
6707
|
+
/* @__PURE__ */ jsx(MenuItem2, { value: "weeks", children: labels?.weeks ?? "weeks" })
|
|
10310
6708
|
]
|
|
10311
6709
|
}
|
|
10312
6710
|
)
|
|
@@ -10317,7 +6715,7 @@ function DurationPicker({ value, onChange, size = "small", disabled = false, lab
|
|
|
10317
6715
|
}
|
|
10318
6716
|
function ChangelogTimeline({ children, sx }) {
|
|
10319
6717
|
return /* @__PURE__ */ jsx(
|
|
10320
|
-
|
|
6718
|
+
Box9,
|
|
10321
6719
|
{
|
|
10322
6720
|
sx: {
|
|
10323
6721
|
position: "relative",
|
|
@@ -10337,9 +6735,9 @@ function ChangelogTimeline({ children, sx }) {
|
|
|
10337
6735
|
);
|
|
10338
6736
|
}
|
|
10339
6737
|
function ChangelogEntry({ version, date, badge, children }) {
|
|
10340
|
-
return /* @__PURE__ */ jsxs(
|
|
6738
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { position: "relative", pl: { xs: 5, sm: 7 }, pb: 4 }, children: [
|
|
10341
6739
|
/* @__PURE__ */ jsx(
|
|
10342
|
-
|
|
6740
|
+
Box9,
|
|
10343
6741
|
{
|
|
10344
6742
|
sx: {
|
|
10345
6743
|
position: "absolute",
|
|
@@ -10355,9 +6753,9 @@ function ChangelogEntry({ version, date, badge, children }) {
|
|
|
10355
6753
|
}
|
|
10356
6754
|
}
|
|
10357
6755
|
),
|
|
10358
|
-
/* @__PURE__ */ jsxs(
|
|
6756
|
+
/* @__PURE__ */ jsxs(Card, { variant: "outlined", sx: { p: 3 }, children: [
|
|
10359
6757
|
/* @__PURE__ */ jsxs(
|
|
10360
|
-
|
|
6758
|
+
Stack2,
|
|
10361
6759
|
{
|
|
10362
6760
|
direction: "row",
|
|
10363
6761
|
spacing: 1.5,
|
|
@@ -10369,7 +6767,7 @@ function ChangelogEntry({ version, date, badge, children }) {
|
|
|
10369
6767
|
/* @__PURE__ */ jsx(Typography5, { variant: "h6", sx: {
|
|
10370
6768
|
fontWeight: 700
|
|
10371
6769
|
}, children: version }),
|
|
10372
|
-
badge && /* @__PURE__ */ jsx(
|
|
6770
|
+
badge && /* @__PURE__ */ jsx(Chip2, { label: badge, size: "small", color: "primary", variant: "soft" }),
|
|
10373
6771
|
/* @__PURE__ */ jsx(
|
|
10374
6772
|
Typography5,
|
|
10375
6773
|
{
|
|
@@ -10389,6 +6787,6 @@ function ChangelogEntry({ version, date, badge, children }) {
|
|
|
10389
6787
|
] });
|
|
10390
6788
|
}
|
|
10391
6789
|
|
|
10392
|
-
export { Accordion,
|
|
10393
|
-
//# sourceMappingURL=chunk-
|
|
10394
|
-
//# sourceMappingURL=chunk-
|
|
6790
|
+
export { Accordion, Avatar, Badge, Carousel, ChangelogEntry, ChangelogTimeline, CircularProgress, ContentRenderer, ContextMenu, CountBadge, CountdownRing, CountrySelect, CustomAvatarGroup, DEFAULT_LIGHTBOX_LABELS, DEFAULT_SPONSORED_SLOT_LABELS, DeadlineChip, Drawer2 as Drawer, DurationPicker, FlagIcon, Image, ImageWithDefault, Lightbox, LinearProgress, Markdown, MegaMenuHorizontal, MegaMenuMobile, MegaMenuVertical, Menu, Nav, NavArrow2 as NavArrow, NavCard, NavCardGrid, NavIcon, NavInfo, NavItem, NavItemBase, NavLi, NavList, NavSectionHorizontal, NavSectionMini, NavSectionVertical, NavSubList, NavSubheader, NavTexts, NavUl, ProgressBar, Rail, SettingsDrawer, SettingsProvider, SimpleAccordion, SponsoredSlot, StatusDot, SvgColor, TagCloud, Tooltip3 as Tooltip, VirtualList, buildUrl, carouselClasses, createIconComponent, deadlineUrgency, formatDateString, getNavCssVars, getQueryParam, hasParams, htmlToMarkdown, isActiveLink, isEqualPath, isExternalLink, isExternalUrl, isMarkdownContent, lightboxClasses, megaMenuClasses, megaMenuCssVars, navSectionClasses, navSectionCssVars, parseDateString, parseQueryParams, relativeTimeLeft, removeLastSlash, removeParams, safeReturnUrl, useAccordion, useCarousel, useDateRangePicker, useLightbox, useMenu, useSettings, useSettingsDrawer };
|
|
6791
|
+
//# sourceMappingURL=chunk-D4GFAJAZ.js.map
|
|
6792
|
+
//# sourceMappingURL=chunk-D4GFAJAZ.js.map
|