@daisforge/ui 1.22.0 → 1.23.0
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/chunks/AiAgentPopup-CLGSjg5L.cjs +11 -0
- package/chunks/AiAgentPopup-CtMhai1X.mjs +797 -0
- package/chunks/AnalyticalWidget-Bvcm1qpU.cjs +43 -0
- package/chunks/AnalyticalWidget-CRfihris.mjs +352 -0
- package/chunks/ApprovalCenter-D7K7J-QB.cjs +1 -0
- package/chunks/{ApprovalCenter-DLKZP2AO.mjs → ApprovalCenter-dJpI91uN.mjs} +10 -10
- package/chunks/BlockTitle-CcYYHiOo.cjs +1 -0
- package/chunks/{BlockTitle-DsXxImR6.mjs → BlockTitle-DCmM-9AN.mjs} +2 -2
- package/chunks/{Container-DbZwlfIM.mjs → Container-C7PzvUwd.mjs} +1 -1
- package/chunks/{Container-DHnX1sHY.cjs → Container-bVqI3en9.cjs} +1 -1
- package/chunks/{EmptyState-DH1xawxg.cjs → EmptyState-D-bmtvmy.cjs} +1 -1
- package/chunks/{EmptyState-CUCseg9M.mjs → EmptyState-ZsOlvU4d.mjs} +1 -1
- package/chunks/{FiltersActions-BJ5gD6Nx.mjs → FiltersActions-CS27WxA6.mjs} +15 -15
- package/chunks/FiltersActions-Cie245Po.cjs +1 -0
- package/chunks/{FormSegmentGroup-BYQ6yMK1.cjs → FormSegmentGroup-CNIqOYfm.cjs} +1 -1
- package/chunks/{FormSegmentGroup-C9qYxYT9.mjs → FormSegmentGroup-DwTRM58f.mjs} +1 -1
- package/chunks/{GridDND-DK6SAO8q.cjs → GridDND-Bwmr7gla.cjs} +1 -1
- package/chunks/{GridDND-CqvpXgCY.mjs → GridDND-DC5VoxEY.mjs} +83 -83
- package/chunks/{LeftPanel-C5SsoRJS.mjs → LeftPanel-C10BLKIn.mjs} +1 -1
- package/chunks/{LeftPanel-AyuV7bGS.cjs → LeftPanel-upGFk7jM.cjs} +1 -1
- package/chunks/{ListOfFilters-CfV2bs_4.mjs → ListOfFilters-CEWrWotU.mjs} +3 -3
- package/chunks/{ListOfFilters-mqTsQbq_.cjs → ListOfFilters-DNi-z1cn.cjs} +1 -1
- package/chunks/MassActions-DJiKcC6r.cjs +1 -0
- package/chunks/{MassActions-C6LY-g9r.mjs → MassActions-NLCRjIHw.mjs} +46 -46
- package/chunks/PageTitle-Bg4PNEXS.cjs +9 -0
- package/chunks/{PageTitle-DkfAiZM4.mjs → PageTitle-CXtNgH-b.mjs} +7 -7
- package/chunks/{SplitView-BqS1Jbo4.mjs → SplitView-BzamJzNc.mjs} +17 -17
- package/chunks/{SplitView-DNmd4sJe.cjs → SplitView-DeJ3V-kq.cjs} +1 -1
- package/chunks/Stories-CNlL0Bcb.cjs +1 -0
- package/chunks/{Stories-BnHxMCEZ.mjs → Stories-UUV0GNEV.mjs} +33 -33
- package/chunks/{Table-vv1HTrxe.cjs → Table-CZludfzU.cjs} +6 -6
- package/chunks/{Table-tUWuA3Ri.mjs → Table-FrYs56BB.mjs} +1597 -1586
- package/chunks/{TableCanvas-BX5aciu7.mjs → TableCanvas-CasYPFSm.mjs} +5872 -5633
- package/chunks/TableCanvas-DFne0YHS.cjs +30 -0
- package/chunks/TableGlide-BKSjSgBn.mjs +9131 -0
- package/chunks/TableGlide-C2_HrWEA.cjs +1 -0
- package/chunks/{styles-CJ5y9FKW.mjs → styles-CJPkBVWK.mjs} +6 -6
- package/chunks/{styles-kUWPuNSD.cjs → styles-CpC_FuBg.cjs} +1 -1
- package/chunks/{utils-u1KJ37g3.mjs → utils-Hu77fGGe.mjs} +102 -102
- package/chunks/{utils-ChDQGRjv.cjs → utils-OQNruMpn.cjs} +5 -5
- package/components/AiAgentPopover/index.cjs +1 -1
- package/components/AiAgentPopover/index.mjs +1 -1
- package/components/AiAgentPopup/AiAgentInput.d.ts +3 -0
- package/components/AiAgentPopup/AiAgentLeftPanel.d.ts +6 -0
- package/components/AiAgentPopup/AiAgentPopup.constants.d.ts +32 -0
- package/components/AiAgentPopup/AiAgentPopup.d.ts +3 -0
- package/components/AiAgentPopup/AiAgentPopup.styled.d.ts +33 -0
- package/components/AiAgentPopup/AiAgentPopup.types.d.ts +83 -0
- package/components/AiAgentPopup/AiAgentPopup.utils.d.ts +12 -0
- package/components/AiAgentPopup/AiAgentSurface.d.ts +6 -0
- package/components/AiAgentPopup/hooks/useDrag.d.ts +18 -0
- package/components/AiAgentPopup/hooks/useIsDarkTheme.d.ts +1 -0
- package/components/AiAgentPopup/hooks/usePopupPosition.d.ts +20 -0
- package/components/AiAgentPopup/hooks/usePopupResize.d.ts +40 -0
- package/components/AiAgentPopup/hooks/useStateStorage.d.ts +6 -0
- package/components/AiAgentPopup/index.cjs +1 -0
- package/components/AiAgentPopup/index.d.ts +3 -0
- package/components/AiAgentPopup/index.mjs +5 -0
- package/components/AnalyticalWidget/AnalyticalWidget.d.ts +8 -24
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/AnalyticalWidgetIconButtonDots.d.ts +8 -24
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +2 -2
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.mjs +2 -2
- package/components/AnalyticalWidget/index.cjs +1 -1
- package/components/AnalyticalWidget/index.mjs +1 -1
- package/components/ApprovalCenter/components/index.cjs +1 -1
- package/components/ApprovalCenter/components/index.mjs +1 -1
- package/components/ApprovalCenter/index.cjs +1 -1
- package/components/ApprovalCenter/index.mjs +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +128 -128
- package/components/AutocompleteSearch/index.cjs +1 -1
- package/components/AutocompleteSearch/index.mjs +2 -2
- package/components/BlockGradientScroll/index.cjs +1 -1
- package/components/BlockGradientScroll/index.mjs +1 -1
- package/components/BlockTitle/index.cjs +1 -1
- package/components/BlockTitle/index.mjs +1 -1
- package/components/BlockTitle/utils/index.cjs +1 -1
- package/components/BlockTitle/utils/index.mjs +1 -1
- package/components/Collapse/index.cjs +1 -1
- package/components/Collapse/index.mjs +1 -1
- package/components/Combobox/index.cjs +1 -1
- package/components/Combobox/index.mjs +1 -1
- package/components/EmptyState/components/index.cjs +1 -1
- package/components/EmptyState/components/index.mjs +1 -1
- package/components/EmptyState/index.cjs +1 -1
- package/components/EmptyState/index.mjs +1 -1
- package/components/GridDND/index.cjs +1 -1
- package/components/GridDND/index.mjs +1 -1
- package/components/GridDND/utils/index.cjs +1 -1
- package/components/GridDND/utils/index.mjs +1 -1
- package/components/IconButton/index.cjs +1 -1
- package/components/IconButton/index.mjs +1 -1
- package/components/LeftPanel/components/index.cjs +1 -1
- package/components/LeftPanel/components/index.mjs +1 -1
- package/components/LeftPanel/hooks/index.cjs +1 -1
- package/components/LeftPanel/hooks/index.mjs +1 -1
- package/components/LeftPanel/index.cjs +1 -1
- package/components/LeftPanel/index.mjs +1 -1
- package/components/LeftPanel/utils/index.cjs +1 -1
- package/components/LeftPanel/utils/index.mjs +1 -1
- package/components/ListOfFilters/index.cjs +1 -1
- package/components/ListOfFilters/index.mjs +1 -1
- package/components/MassActions/hooks/index.cjs +1 -1
- package/components/MassActions/hooks/index.mjs +1 -1
- package/components/MassActions/index.cjs +1 -1
- package/components/MassActions/index.mjs +1 -1
- package/components/ModalDF/index.cjs +1 -1
- package/components/ModalDF/index.mjs +1 -1
- package/components/Notification/index.cjs +1 -1
- package/components/Notification/index.mjs +6 -6
- package/components/PageTitle/index.cjs +1 -1
- package/components/PageTitle/index.mjs +1 -1
- package/components/PageTitle/utils/index.cjs +1 -1
- package/components/PageTitle/utils/index.mjs +1 -1
- package/components/PopoverDF/index.cjs +1 -1
- package/components/PopoverDF/index.mjs +9 -9
- package/components/PopoverDF/styled.d.ts +1 -23
- package/components/PopupDF/index.cjs +1 -1
- package/components/PopupDF/index.mjs +118 -143
- package/components/SplitView/index.cjs +1 -1
- package/components/SplitView/index.mjs +1 -1
- package/components/SplitView/utils/index.cjs +1 -1
- package/components/SplitView/utils/index.mjs +1 -1
- package/components/Stories/components/StoriesBanner/index.cjs +1 -1
- package/components/Stories/components/StoriesBanner/index.mjs +1 -1
- package/components/Stories/components/StoriesContent/index.cjs +1 -1
- package/components/Stories/components/StoriesContent/index.mjs +1 -1
- package/components/Stories/components/StoriesPreview/index.cjs +1 -1
- package/components/Stories/components/StoriesPreview/index.mjs +1 -1
- package/components/Stories/components/StoriesProgress/index.cjs +1 -1
- package/components/Stories/components/StoriesProgress/index.mjs +1 -1
- package/components/Stories/components/StoriesViewer/index.cjs +1 -1
- package/components/Stories/components/StoriesViewer/index.mjs +1 -1
- package/components/Stories/index.cjs +1 -1
- package/components/Stories/index.mjs +1 -1
- package/components/Table/components/TableDropdown/index.cjs +1 -1
- package/components/Table/components/TableDropdown/index.mjs +1 -1
- package/components/Table/feature-collapse-table/index.cjs +1 -1
- package/components/Table/feature-collapse-table/index.mjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/Table/feature-column-control/index.cjs +1 -1
- package/components/Table/feature-column-control/index.mjs +1 -1
- package/components/Table/feature-columns-grouping/index.cjs +1 -1
- package/components/Table/feature-columns-grouping/index.mjs +1 -1
- package/components/Table/feature-context-menu/index.cjs +1 -1
- package/components/Table/feature-context-menu/index.mjs +1 -1
- package/components/Table/feature-edit/index.cjs +1 -1
- package/components/Table/feature-edit/index.mjs +1 -1
- package/components/Table/feature-filtering/combobox/index.cjs +1 -1
- package/components/Table/feature-filtering/combobox/index.mjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/Table/feature-filtering/index.cjs +1 -1
- package/components/Table/feature-filtering/index.mjs +1 -1
- package/components/Table/feature-filtering/popover.d.ts +1 -23
- package/components/Table/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/Table/feature-infinity-scroll/index.cjs +1 -1
- package/components/Table/feature-infinity-scroll/index.mjs +1 -1
- package/components/Table/feature-key-text/index.cjs +1 -1
- package/components/Table/feature-key-text/index.mjs +1 -1
- package/components/Table/feature-pagination/index.cjs +1 -1
- package/components/Table/feature-pagination/index.mjs +1 -1
- package/components/Table/feature-right-sidebar/index.cjs +1 -1
- package/components/Table/feature-right-sidebar/index.mjs +1 -1
- package/components/Table/feature-row-detail/index.cjs +1 -1
- package/components/Table/feature-row-detail/index.mjs +1 -1
- package/components/Table/feature-row-instruments/index.cjs +1 -1
- package/components/Table/feature-row-instruments/index.mjs +1 -1
- package/components/Table/feature-row-size/index.cjs +1 -1
- package/components/Table/feature-row-size/index.mjs +1 -1
- package/components/Table/feature-rows-grouping/index.cjs +1 -1
- package/components/Table/feature-rows-grouping/index.mjs +1 -1
- package/components/Table/feature-searching/index.cjs +1 -1
- package/components/Table/feature-searching/index.mjs +1 -1
- package/components/Table/feature-searching/styled.d.ts +128 -128
- package/components/Table/feature-select-row/index.cjs +1 -1
- package/components/Table/feature-select-row/index.mjs +1 -1
- package/components/Table/feature-sorting/index.cjs +1 -1
- package/components/Table/feature-sorting/index.mjs +1 -1
- package/components/Table/feature-table-settings/index.cjs +1 -1
- package/components/Table/feature-table-settings/index.mjs +1 -1
- package/components/Table/feature-tree/index.cjs +1 -1
- package/components/Table/feature-tree/index.mjs +1 -1
- package/components/Table/index.cjs +1 -1
- package/components/Table/index.mjs +1 -1
- package/components/Table/renders/formatCell/index.cjs +1 -1
- package/components/Table/renders/formatCell/index.mjs +1 -1
- package/components/Table/styles/index.cjs +1 -1
- package/components/Table/styles/index.mjs +1 -1
- package/components/Table/table-hooks/index.cjs +1 -1
- package/components/Table/table-hooks/index.mjs +1 -1
- package/components/Table/types/index.cjs +1 -1
- package/components/Table/types/index.mjs +1 -1
- package/components/Table/types/utils.type.d.ts +1 -1
- package/components/Table/utils/index.cjs +1 -1
- package/components/Table/utils/index.mjs +1 -1
- package/components/Table/widgets/control-block/index.cjs +1 -1
- package/components/Table/widgets/control-block/index.mjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.cjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.mjs +1 -1
- package/components/Table/widgets/index.cjs +1 -1
- package/components/Table/widgets/index.mjs +1 -1
- package/components/Table/widgets/mass-actions/index.cjs +1 -1
- package/components/Table/widgets/mass-actions/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/TableGlideInstance.d.ts +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.mjs +6 -6
- package/components/TableCanvas/TableGlideInstance/type.d.ts +3 -0
- package/components/TableCanvas/TableGlideInstance/utils/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/column/index.mjs +2 -2
- package/components/TableCanvas/TableGlideInstance/utils/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.mjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.cjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.mjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.cjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.mjs +1 -1
- package/components/TableCanvas/contexts.d.ts +8 -2
- package/components/TableCanvas/feature-cell-transfer/index.cjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.mjs +13 -13
- package/components/TableCanvas/feature-collapse-table/index.cjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.mjs +2 -2
- package/components/TableCanvas/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.mjs +2 -2
- package/components/TableCanvas/feature-column-control/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/index.mjs +4 -4
- package/components/TableCanvas/feature-columns-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.mjs +3 -3
- package/components/TableCanvas/feature-content-state/index.cjs +1 -1
- package/components/TableCanvas/feature-content-state/index.mjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.cjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.mjs +1 -1
- package/components/TableCanvas/feature-edit/index.cjs +1 -1
- package/components/TableCanvas/feature-edit/index.mjs +6 -6
- package/components/TableCanvas/feature-filtering/combobox/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.mjs +4 -4
- package/components/TableCanvas/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/index.mjs +3 -3
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.cjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.mjs +4 -4
- package/components/TableCanvas/feature-key-text/index.cjs +1 -1
- package/components/TableCanvas/feature-key-text/index.mjs +6 -6
- package/components/TableCanvas/feature-notifications/index.cjs +1 -1
- package/components/TableCanvas/feature-notifications/index.mjs +2 -2
- package/components/TableCanvas/feature-pagination/TablePagination.d.ts +2 -0
- package/components/TableCanvas/feature-pagination/index.cjs +1 -1
- package/components/TableCanvas/feature-pagination/index.mjs +3 -3
- package/components/TableCanvas/feature-popover-table/components/styled.d.ts +1 -23
- package/components/TableCanvas/feature-popover-table/context/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.mjs +3 -3
- package/components/TableCanvas/feature-popover-table/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/compatibility.d.ts +8 -0
- package/components/TableCanvas/feature-right-sidebar/index.cjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.d.ts +2 -3
- package/components/TableCanvas/feature-right-sidebar/index.mjs +3 -3
- package/components/TableCanvas/feature-row-detail/index.cjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.mjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.cjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.mjs +7 -7
- package/components/TableCanvas/feature-row-markers/index.cjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.mjs +1 -1
- package/components/TableCanvas/feature-row-size/index.cjs +1 -1
- package/components/TableCanvas/feature-row-size/index.mjs +4 -4
- package/components/TableCanvas/feature-rows-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.mjs +10 -10
- package/components/TableCanvas/feature-searching/index.cjs +1 -1
- package/components/TableCanvas/feature-searching/index.mjs +1 -1
- package/components/TableCanvas/feature-searching/styled.d.ts +128 -128
- package/components/TableCanvas/feature-select-row/index.cjs +1 -1
- package/components/TableCanvas/feature-select-row/index.mjs +1 -1
- package/components/TableCanvas/feature-sidebar/constants.d.ts +7 -0
- package/components/TableCanvas/feature-sidebar/getCustomSidebarTabs.d.ts +4 -0
- package/components/TableCanvas/feature-sidebar/index.cjs +1 -0
- package/components/TableCanvas/feature-sidebar/index.d.ts +1 -0
- package/components/TableCanvas/feature-sidebar/index.mjs +4 -0
- package/components/TableCanvas/feature-sidebar/ui/BottomSheet.d.ts +6 -0
- package/components/TableCanvas/feature-sidebar/ui/BottomSheet.styled.d.ts +6 -0
- package/components/TableCanvas/{feature-right-sidebar → feature-sidebar}/ui/SidebarContentLayout.d.ts +1 -0
- package/components/TableCanvas/{feature-right-sidebar → feature-sidebar}/ui/SidebarTabs.d.ts +2 -1
- package/components/TableCanvas/feature-sidebar/ui/TableSidebar.d.ts +16 -0
- package/components/TableCanvas/{feature-right-sidebar → feature-sidebar}/ui/styled.d.ts +5 -2
- package/components/TableCanvas/feature-sidebar/useSidebarTabsState.d.ts +14 -0
- package/components/TableCanvas/feature-sorting/index.cjs +1 -1
- package/components/TableCanvas/feature-sorting/index.mjs +1 -1
- package/components/TableCanvas/feature-sticky/index.cjs +1 -0
- package/components/TableCanvas/feature-sticky/index.d.ts +3 -0
- package/components/TableCanvas/feature-sticky/index.mjs +5 -0
- package/components/TableCanvas/feature-sticky/types.d.ts +2 -0
- package/components/TableCanvas/feature-sticky/useStickyColumnIndexes.d.ts +8 -0
- package/components/TableCanvas/feature-sticky/useStickyRowIndexes.d.ts +3 -0
- package/components/TableCanvas/feature-table-settings/index.cjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.mjs +2 -2
- package/components/TableCanvas/feature-tooltip/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.mjs +4 -4
- package/components/TableCanvas/feature-tree/index.cjs +1 -1
- package/components/TableCanvas/feature-tree/index.mjs +1 -1
- package/components/TableCanvas/index.cjs +1 -1
- package/components/TableCanvas/index.d.ts +2 -1
- package/components/TableCanvas/index.mjs +43 -41
- package/components/TableCanvas/renders/formatCell/index.cjs +1 -1
- package/components/TableCanvas/renders/formatCell/index.mjs +1 -1
- package/components/TableCanvas/styles/classNames.d.ts +1 -0
- package/components/TableCanvas/styles/getReservedTableHeight.d.ts +18 -0
- package/components/TableCanvas/styles/index.cjs +1 -1
- package/components/TableCanvas/styles/index.mjs +10 -10
- package/components/TableCanvas/styles/styles.constants.d.ts +1 -1
- package/components/TableCanvas/styles/styles.d.ts +2 -5
- package/components/TableCanvas/table-hooks/index.cjs +1 -1
- package/components/TableCanvas/table-hooks/index.mjs +4 -4
- package/components/TableCanvas/table-hooks/useInlineStyle.d.ts +2 -1
- package/components/TableCanvas/table-hooks/useLeftSidebarValues.d.ts +7 -0
- package/components/TableCanvas/table-hooks/useSidebarOpenState.d.ts +11 -0
- package/components/TableCanvas/table-hooks/useSidebarValues.d.ts +1 -0
- package/components/TableCanvas/types/index.cjs +1 -1
- package/components/TableCanvas/types/index.mjs +2 -2
- package/components/TableCanvas/types/table-config.type.d.ts +19 -1
- package/components/TableCanvas/utils/index.cjs +1 -1
- package/components/TableCanvas/utils/index.mjs +2 -2
- package/components/TableCanvas/widgets/control-block/compression/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/compression/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/control-block.constants.d.ts +6 -0
- package/components/TableCanvas/widgets/control-block/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.mjs +5 -5
- package/components/TableCanvas/widgets/control-block/right-side/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/types.d.ts +1 -0
- package/components/TableCanvas/widgets/index.cjs +1 -1
- package/components/TableCanvas/widgets/index.mjs +5 -5
- package/components/TableCanvas/widgets/mass-actions/MassActions.d.ts +2 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.mjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/useMassActionsCanvasWidth.d.ts +1 -0
- package/components/TableCanvas/widgets/mass-actions/hooks/useMassActionsCompression.d.ts +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/useMassActionsSidebar.d.ts +4 -1
- package/components/TableCanvas/widgets/mass-actions/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.mjs +1 -1
- package/components/TableCanvas/widgets/table-or-card-UI.d.ts +6 -3
- package/components/TableContract/index.cjs +1 -1
- package/components/TableContract/index.mjs +2 -2
- package/components/TableGlide/TableGlide.d.ts +1 -1
- package/components/TableGlide/constants.d.ts +3 -3
- package/components/TableGlide/content-tokens.generated.d.ts +612 -0
- package/components/TableGlide/hooks/selection/index.cjs +1 -1
- package/components/TableGlide/hooks/selection/index.mjs +1 -1
- package/components/TableGlide/hooks/selection/useBaseHighlightRegions.d.ts +2 -1
- package/components/TableGlide/hooks/selection/useColoringLayers.d.ts +2 -3
- package/components/TableGlide/hooks/selection/useColumnRowHighlightRegions.d.ts +1 -4
- package/components/TableGlide/hooks/selection/useSelectionGeometry.d.ts +3 -1
- package/components/TableGlide/hooks/useErrorCellRanges.d.ts +1 -2
- package/components/TableGlide/index.cjs +1 -1
- package/components/TableGlide/index.mjs +31 -31
- package/components/TableGlide/lib/canvas/cells/buttons/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.mjs +4 -4
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.mjs +13 -13
- package/components/TableGlide/lib/canvas/cells/renderer/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.mjs +4 -4
- package/components/TableGlide/lib/canvas/core/helpers/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/index.mjs +34 -34
- package/components/TableGlide/lib/canvas/miniflex/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/CanvasLink.d.ts +2 -2
- package/components/TableGlide/lib/canvas/primitives/CanvasText.d.ts +3 -1
- package/components/TableGlide/lib/canvas/primitives/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.mjs +5 -5
- package/components/TableGlide/lib/canvas/utils/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.mjs +2 -2
- package/components/TableGlide/theming/activeTheme.type.d.ts +3 -1
- package/components/TableGlide/theming/cell-fill-override.d.ts +31 -0
- package/components/TableGlide/theming/custom-colors.d.ts +46 -11
- package/components/TableGlide/theming/fill-states.d.ts +19 -0
- package/components/TableGlide/theming/glide-colors.d.ts +14 -14
- package/components/TableGlide/theming/index.cjs +1 -1
- package/components/TableGlide/theming/index.mjs +1 -1
- package/components/TableGlide/theming/size-tokens.d.ts +1 -1
- package/components/TableGlide/theming/table-colors.generated.d.ts +529 -0
- package/components/TableGlide/tokens.d.ts +1 -104
- package/components/TableGlide/types.d.ts +3 -5
- package/components/TableTabs/index.cjs +1 -1
- package/components/TableTabs/index.mjs +1 -1
- package/components/Tooltip/index.cjs +1 -1
- package/components/Tooltip/index.mjs +1 -1
- package/components/TourWidget/index.cjs +3 -3
- package/components/TourWidget/index.mjs +14 -14
- package/components/Typography/index.cjs +1 -1
- package/components/Typography/index.mjs +1 -1
- package/components/Widget/index.cjs +1 -1
- package/components/Widget/index.mjs +2 -2
- package/formComponents/FormCombobox/index.cjs +1 -1
- package/formComponents/FormCombobox/index.mjs +1 -1
- package/formComponents/FormRadioGroupBox/index.cjs +1 -1
- package/formComponents/FormRadioGroupBox/index.mjs +1 -1
- package/formComponents/FormSegments/index.cjs +1 -1
- package/formComponents/FormSegments/index.mjs +1 -1
- package/formComponents/FormSwitch/index.cjs +1 -1
- package/formComponents/FormSwitch/index.mjs +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +3 -1
- package/index.mjs +1864 -1859
- package/layouts/Container/index.cjs +1 -1
- package/layouts/Container/index.mjs +1 -1
- package/layouts/Container/lib/utils/index.cjs +1 -1
- package/layouts/Container/lib/utils/index.mjs +1 -1
- package/layouts/ErrorPage/index.cjs +1 -1
- package/layouts/ErrorPage/index.mjs +1 -1
- package/layouts/FiltersActions/hooks/index.cjs +1 -1
- package/layouts/FiltersActions/hooks/index.mjs +1 -1
- package/layouts/FiltersActions/index.cjs +1 -1
- package/layouts/FiltersActions/index.mjs +1 -1
- package/layouts/Layout/index.cjs +1 -1
- package/layouts/Layout/index.mjs +1 -1
- package/layouts/PageLayout/index.cjs +1 -1
- package/layouts/PageLayout/index.mjs +1 -1
- package/mcp-data/component-index.json +1158 -206
- package/mixins/index.cjs +4 -4
- package/mixins/index.mjs +61 -54
- package/package.json +6 -6
- package/shared/utils/resizable/index.cjs +1 -0
- package/shared/utils/resizable/index.d.ts +2 -0
- package/shared/utils/resizable/index.mjs +39 -0
- package/shared/utils/resizable/resizableConfig.d.ts +16 -0
- package/styles/index.cjs +1 -1
- package/styles/index.mjs +1 -1
- package/types/index.d.ts +1 -0
- package/types/utility.d.ts +1 -0
- package/utils/breakpoint/index.cjs +1 -1
- package/utils/breakpoint/index.mjs +2 -2
- package/utils/clickStream/index.cjs +1 -1
- package/utils/clickStream/index.mjs +1 -1
- package/utils/eventBus/index.cjs +1 -1
- package/utils/eventBus/index.mjs +1 -1
- package/utils/getActiveTheme.d.ts +1 -1
- package/utils/hooks/index.cjs +1 -1
- package/utils/hooks/index.mjs +1 -1
- package/utils/index.cjs +1 -1
- package/utils/index.mjs +8 -8
- package/utils/react/index.cjs +1 -1
- package/utils/react/index.mjs +1 -1
- package/utils/styles/index.cjs +1 -1
- package/utils/styles/index.mjs +1 -1
- package/chunks/AnalyticalWidget-BtyWKJuu.mjs +0 -537
- package/chunks/AnalyticalWidget-YytE3Rlw.cjs +0 -43
- package/chunks/ApprovalCenter-DdsLEipZ.cjs +0 -1
- package/chunks/BlockTitle-DC1McGof.cjs +0 -1
- package/chunks/FiltersActions-Bg5wvHFG.cjs +0 -1
- package/chunks/MassActions-BTrj9l-R.cjs +0 -1
- package/chunks/PageTitle-CrBeieoq.cjs +0 -9
- package/chunks/Stories-UYVANawW.cjs +0 -1
- package/chunks/TableCanvas-qnwh4c5g.cjs +0 -30
- package/chunks/TableGlide-BLbbkn4C.mjs +0 -8154
- package/chunks/TableGlide-CZ2mkokV.cjs +0 -1
- package/components/TableCanvas/feature-right-sidebar/constants.d.ts +0 -1
- package/components/TableCanvas/feature-right-sidebar/ui/TableSidebar.d.ts +0 -16
- /package/components/TableCanvas/{feature-right-sidebar → feature-sidebar}/ui/TableSidebar.classnames.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("@glideappsfinal/glide-data-grid"),xi=require("@salutejs/sdds-themes/tokens/sdds_finai"),la=require("canvas-hypertxt"),m=require("react"),ha=require("react-dom/server"),wt=require("react/jsx-runtime");require("@glideappsfinal/glide-data-grid/dist/index.css");const Qt=require("./utils-ChDQGRjv.cjs"),$e=require("react-dom"),ke=require("../components/TableCanvasSharedConstants/index.cjs"),Mr=require("styled-components"),tt={small:{rowHeight:20,cellVerticalPadding:4,cellHorizontalPadding:4,textfieldSize:"xs"},medium:{rowHeight:32,cellVerticalPadding:7,cellHorizontalPadding:6,textfieldSize:"s"},big:{rowHeight:48,cellVerticalPadding:12,cellHorizontalPadding:16,textfieldSize:"s"}},Ue=o=>tt[o].rowHeight,Si=o=>tt[o].textfieldSize,zr={small:tt.small.rowHeight,medium:tt.medium.rowHeight,big:tt.big.rowHeight},ua={kind:P.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0},Or={big:{cellVerticalPadding:tt.big.cellVerticalPadding,cellHorizontalPadding:tt.big.cellHorizontalPadding,textfieldSize:tt.big.textfieldSize},medium:{cellVerticalPadding:tt.medium.cellVerticalPadding,cellHorizontalPadding:tt.medium.cellHorizontalPadding,textfieldSize:tt.medium.textfieldSize},small:{cellVerticalPadding:tt.small.cellVerticalPadding,cellHorizontalPadding:tt.small.cellHorizontalPadding,textfieldSize:tt.small.textfieldSize}},Ai={"padding-block":"0px","padding-inline":"0px"},Vt=o=>`${o}px`,da={small:{rowHeight:Ue("small"),cell:{"padding-block":Vt(tt.small.cellVerticalPadding),"padding-inline":Vt(tt.small.cellHorizontalPadding)},editorCell:Ai,input:Si("small"),icon:"xs",combobox:"s",checkboxOfCombobox:"s",switch:"s",font:()=>xi.bodyXXS},medium:{rowHeight:Ue("medium"),cell:{"padding-block":Vt(tt.medium.cellVerticalPadding),"padding-inline":Vt(tt.medium.cellHorizontalPadding)},editorCell:Ai,input:Si("medium"),icon:"s",combobox:"m",checkboxOfCombobox:"m",switch:"s",font:()=>xi.bodyS},big:{rowHeight:Ue("big"),cell:{"padding-block":Vt(tt.big.cellVerticalPadding),"padding-inline":Vt(tt.big.cellHorizontalPadding)},editorCell:Ai,input:Si("big"),icon:"m",combobox:"l",checkboxOfCombobox:"l",switch:"l",font:()=>xi.bodyM}},qe=33,fa={bodyM:{"font-size":"1rem","font-weight":400,"line-height":"1.25rem","bold-font-size":"1rem","bold-font-weight":600,"bold-line-height":"1.25rem"},bodyS:{"font-size":"0.875rem","font-weight":400,"line-height":"1.125rem","bold-font-size":"0.875rem","bold-font-weight":600,"bold-line-height":"1.125rem"},bodyXS:{"font-size":"0.75rem","font-weight":400,"line-height":"0.875rem","bold-font-size":"0.75rem","bold-font-weight":600,"bold-line-height":"0.875rem"},bodyXXS:{"font-size":"0.625rem","font-weight":400,"line-height":"0.75rem","bold-font-size":"0.625rem","bold-font-weight":600,"bold-line-height":"0.75rem"}},ga=16;function er(o,t=ga){const e=parseFloat(o);return Number.isFinite(e)?o.endsWith("rem")?e*t:e:0}const Ca=(o,t=!1)=>{const e=t?o["bold-font-weight"]:o["font-weight"],i=t?o["bold-font-size"]:o["font-size"],r=t?o["bold-line-height"]:o["line-height"];return`${e} normal ${i}/${r}`},va=(o,t=!1)=>{const e=t?o["bold-font-size"]:o["font-size"],i=t?o["bold-line-height"]:o["line-height"];return{fontSize:er(e),lineHeightPx:er(i)}},Nr=o=>Object.entries(fa).reduce((t,[e,i])=>{const r=e;return t.push([r,o(i)],[`${r}Bold`,o(i,!0)]),t},[]),Ke=Object.fromEntries(Nr(Ca)),Wr=Object.fromEntries(Nr(va)),ma={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"},pa={top:0,right:0,bottom:0,left:0};class Gr{constructor(t=ma){this.size={width:0,height:0},this.position={x:0,y:0},this.style={flexGrow:t.flexGrow??0,flexShrink:t.flexShrink??1,flexBasis:t.flexBasis??0,alignSelf:t.alignSelf??"auto",width:t.width,height:t.height,crossAxisSizing:t.crossAxisSizing??"auto",id:t.id,metadata:t.metadata},this.id=t.id,this.metadata=t.metadata}}class $r extends Gr{build(){}}class At extends Gr{constructor(t,e,i={}){super({}),this.children=[],this.direction="row",this.wrap="nowrap",this.columnGap=0,this.rowGap=0,this.justifyContent="flex-start",this.alignItems="stretch",this.alignContent="stretch",this.padding={top:0,right:0,bottom:0,left:0},this.size.width=t,this.size.height=e,this.id=i.id,i.direction!==void 0&&(this.direction=i.direction),i.wrap!==void 0&&(this.wrap=i.wrap),i.columnGap!==void 0&&(this.columnGap=i.columnGap),i.rowGap!==void 0&&(this.rowGap=i.rowGap),i.justifyContent!==void 0&&(this.justifyContent=i.justifyContent),i.alignItems!==void 0&&(this.alignItems=i.alignItems),i.alignContent!==void 0&&(this.alignContent=i.alignContent),this.padding=Ur(i.padding)}addChild(t,e){if(t instanceof At){const r=t;if(e){const n=r.style;n.flexGrow=e.flexGrow??0,n.flexShrink=e.flexShrink??1,n.flexBasis=e.flexBasis??0,n.alignSelf=e.alignSelf??"auto",n.width=e.width,n.height=e.height,n.crossAxisSizing=e.crossAxisSizing??"auto"}return this.children.push(r),r}const i=new $r(t);return this.children.push(i),i}getContainerMetrics(){const t=this.direction==="row"||this.direction==="row-reverse",{left:e,right:i,top:r,bottom:n}=this.padding,{width:s,height:a}=this.size;return t?{main:s-e-i,cross:a-r-n,mainGap:this.columnGap,crossGap:this.rowGap}:{main:a-r-n,cross:s-e-i,mainGap:this.rowGap,crossGap:this.columnGap}}buildFlexLines(t,e){if(this.wrap==="nowrap")return[t];const i=[];let r=[],n=0;for(const s of t){const a=s.style.flexBasis,c=r.length>0?e.mainGap:0;r.length>0&&n+c+a>e.main&&(i.push(r),r=[],n=0),r.push(s),n+=(r.length>1?e.mainGap:0)+a}return r.length>0&&i.push(r),this.wrap==="wrap-reverse"&&i.reverse(),i}measureLineCrossSizes(t,e){const i=[];for(const r of t){let n=0;for(const s of r){if(this.isDeferredCrossAxisPercentChild(s,e))continue;const a=e?s.style.height:s.style.width,c=a!==void 0?a:e?s.size.height:s.size.width;c>n&&(n=c)}i.push(n)}return i}isDeferredCrossAxisPercentChild(t,e){const i=e?t.style.height:t.style.width;return(t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems)==="stretch"&&i===void 0&&t.style.crossAxisSizing==="deferred-percent-stretch"}resolveCrossAxisLayout(t,e){const i=t.length,r=t.reduce((u,h)=>u+h,0),n=e.crossGap*(i>1?i-1:0),s=e.cross-r-n;let a=0,c=e.crossGap;if(this.wrap==="nowrap"&&i===1)t[0]=e.cross;else if(this.wrap!=="nowrap"){const{crossStart:u,crossBetween:h}=this.calculateAlignContent(s,i,e.crossGap);if(a=u,c=h,this.alignContent==="stretch"&&s>0){const l=s/i;for(let d=0;d<i;d++)t[d]+=l}}return{crossStart:a,crossBetween:c}}calculateAlignContent(t,e,i){let r=0,n=i;switch(this.alignContent){case"flex-end":r=t;break;case"center":r=t/2;break;case"space-between":n=e>1?i+t/(e-1):0;break;case"space-around":n=i+t/e,r=n/2;break;case"space-evenly":n=i+t/(e+1),r=n;break}return{crossStart:r,crossBetween:n}}distributeMainAxisSizes(t,e,i){let r=0,n=0,s=0;for(const h of t){const l=h.style.flexBasis;r+=l,n+=h.style.flexGrow,s+=h.style.flexShrink*l}const a=t.length>1?e.mainGap*(t.length-1):0,c=e.main-r-a;let u=0;for(const h of t){const{style:l}=h;let d=l.flexBasis;c>0&&n>0?d+=c*l.flexGrow/n:c<0&&s>0&&(d+=c*l.flexShrink*d/s),d<0&&(d=0),i?h.size.width=d:h.size.height=d,u+=d}return{lineMainUsed:u,totalGrow:n}}calculateJustifySpacing(t,e,i,r){let n=0,s=i.mainGap;if(r===0){const a=t>1?i.mainGap*(t-1):0;let c=i.main-e-a;switch(c<0&&(c=0),this.justifyContent){case"flex-end":n=c;break;case"center":n=c/2;break;case"space-between":s=t>1?i.mainGap+c/(t-1):0;break;case"space-around":s=i.mainGap+c/t,n=s/2;break;case"space-evenly":s=i.mainGap+c/(t+1),n=s;break}}return{leading:n,between:s}}getFinalLineHeight(t,e,i){if(this.wrap!=="nowrap")return e;let r=e;for(const n of t){if(this.isDeferredCrossAxisPercentChild(n,i))continue;const s=i?n.style.height:n.style.width,a=s!==void 0?s:i?n.size.height:n.size.width;a>r&&(r=a)}return r}getCrossSize(t,e,i){const r=i?t.style.height:t.style.width,n=t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems;return r!==void 0?(i?t.size.height=r:t.size.width=r,r):n==="stretch"?(i?t.size.height=e:t.size.width=e,e):i?t.size.height:t.size.width}positionChildren(t,e,i,r,n,s,a,c,u){const h=this.direction==="row-reverse"||this.direction==="column-reverse",l=h?t.length-1:0,d=h?-1:t.length,f=h?-1:1;let g=n;for(let v=l;v!==d;v+=f){const C=t[v];if(C!==void 0){const y=C.style,p=C.size,F=C.position;if(i){const T=this.direction==="row"?g:e.main-g-p.width;F.x=a+T}else{const T=this.direction==="column"?g:e.main-g-p.height;F.y=c+T}const w=y.alignSelf!=="auto"?y.alignSelf:this.alignItems,S=this.getCrossSize(C,r,i);let b=0;w==="flex-end"?b=r-S:w==="center"&&(b=(r-S)*.5),i?(F.y=c+u+b,g+=p.width+s):(F.x=a+u+b,g+=p.height+s)}}}build(){const{children:t}=this;if(t.length===0)return;const e=this.direction==="row"||this.direction==="row-reverse",i=this.getContainerMetrics(),r=this.buildFlexLines(t,i);if(r.length===0)return;const n=this.measureLineCrossSizes(r,e),{crossStart:s,crossBetween:a}=this.resolveCrossAxisLayout(n,i),c=this.padding.left,u=this.padding.top;let h=s;for(let l=0;l<r.length;l++){const d=r[l];if(d===void 0||d.length===0)continue;const{lineMainUsed:f,totalGrow:g}=this.distributeMainAxisSizes(d,i,e),{leading:v,between:C}=this.calculateJustifySpacing(d.length,f,i,g),y=this.getFinalLineHeight(d,n[l],e);this.positionChildren(d,i,e,y,v,C,c,u,h),h+=y+a}for(const l of t)l instanceof At&&l.build()}}function Ur(o){return o===void 0?pa:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0}}class no extends At{constructor(t,e,i={}){super(t,e,i)}getLayout(){this.build();const t={};return this._collectLayout(this,t,{counter:0}),t}_collectLayout(t,e,i){for(const r of t.children){const n=r.id??`_$$${i.counter++}`;e[n]={position:r.position,size:r.size},r instanceof At&&this._collectLayout(r,e,i)}}}const ce={direction:"row",columnGap:0,rowGap:0,justifyContent:"flex-start",alignItems:"stretch"};function Xr(o){const t=o;return{id:o.id,direction:t.direction??ce.direction,columnGap:t.columnGap??ce.columnGap,rowGap:t.rowGap??ce.rowGap,justifyContent:t.justifyContent??ce.justifyContent,alignItems:t.alignItems??ce.alignItems}}function Vr(o,t){if(t!=null&&t.length)for(const e of t)if(e.children&&e.children.length>0){const i=new At(e.width??0,e.height??0,Xr(e));o.addChild(i,e),Vr(i,e.children)}else o.addChild(e)}const ya=o=>{const t=o.width??0,e=o.height??0,i=Xr(o),r=new no(t,e,i);return Vr(r,o.children),r.getLayout()},ii=class ii{constructor(t){this.debugColor="magenta",this.parent=null,this.children=[],this.rect={x:0,y:0,width:0,height:0},this.zIndex=0,this._intrinsicWidth=0,this._intrinsicHeight=0,this._layoutDirty=!0,this._measureDirty=!0,this._style={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto"},this._position="static",this.backgroundColor="transparent",this.borderColor="transparent",this.borderWidth=0,this.portalHoverEnabled=!1,this.id=t}get style(){return this._style}set style(t){this._style=t,this.markLayoutDirty()}get position(){return this._position}set position(t){this._position!==t&&(this._position=t,this.markLayoutDirty())}get left(){return this._left}set left(t){this._left!==t&&(this._left=t,this.markLayoutDirty())}get top(){return this._top}set top(t){this._top!==t&&(this._top=t,this.markLayoutDirty())}get right(){return this._right}set right(t){this._right!==t&&(this._right=t,this.markLayoutDirty())}get bottom(){return this._bottom}set bottom(t){this._bottom!==t&&(this._bottom=t,this.markLayoutDirty())}isAbsolute(){return this._position==="absolute"}isPositioningContext(){return this._position!=="static"}markLayoutDirty(){var t;this._layoutDirty||(this._layoutDirty=!0,(t=this.parent)==null||t.markLayoutDirty())}markMeasureDirty(){this._measureDirty||(this._measureDirty=!0,this.markLayoutDirty())}isLayoutDirty(){return this._layoutDirty}isMeasureDirty(){return this._measureDirty}clearLayoutDirty(){this._layoutDirty=!1}clearMeasureDirty(){this._measureDirty=!1}addChild(t){this.attachChild(t,(e,i)=>e.push(i))}addChildStart(t){this.attachChild(t,(e,i)=>e.unshift(i))}removeChild(t){const e=this.children.indexOf(t);e!==-1&&(this.children.splice(e,1),t.parent=null,this.markLayoutDirty())}getTooltip(){return this.tooltip}paint(t,e){const i=t.getZIndex();t.setZIndex(i+this.zIndex),this.onPaint(t,e),ii.DEBUG&&t.strokeRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.debugColor,1),t.setZIndex(i)}hitTest(t,e){const i=[];return this.collectHitCandidates(t,e,0,{value:0},i),i.sort((r,n)=>n.cumulativeZIndex-r.cumulativeZIndex||n.order-r.order),i.map(({node:r})=>r)}requestLayout(){this.parent&&this.parent.requestLayout()}requestPaint(){this.parent&&this.parent.requestPaint()}onClick(t){}onMouseDown(t){}onMouseUp(t){}onMouseEnter(t){}onMouseLeave(t){}onMouseMove(t){}onDoubleClick(t){}attachChild(t,e){t.parent=this,e(this.children,t),this.markLayoutDirty()}collectHitCandidates(t,e,i,r,n){if(!this.containsHitPoint(t,e))return;const s=i+this.zIndex;n.push({node:this,cumulativeZIndex:s,order:r.value}),r.value+=1;for(const a of this.children)a.collectHitCandidates(t,e,s,r,n)}containsHitPoint(t,e){return t>=this.rect.x&&t<=this.rect.x+this.rect.width&&e>=this.rect.y&&e<=this.rect.y+this.rect.height}};ii.DEBUG=!1;let Mt=ii;class Yr{constructor(){this.defaultFlexStyle={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"}}build(t,e,i){const r=i??t.children.filter(c=>!c.isAbsolute()),n=r.length,s=e.direction,a=s==="row"||s==="row-reverse";for(let c=0;c<n;c+=1){const u=r[c],h=u.style,l=this.extractChildFlexProperties(u,h);this.handlePercentageDimensions(l,h.width,h.height,a,u.rect),this.defaultFlexStyle.flexGrow=l.flexGrow,this.defaultFlexStyle.flexShrink=l.flexShrink,this.defaultFlexStyle.flexBasis=l.flexBasis,this.defaultFlexStyle.alignSelf=l.alignSelf,this.defaultFlexStyle.width=l.width,this.defaultFlexStyle.height=l.height,this.defaultFlexStyle.crossAxisSizing=l.crossAxisSizing,this.isContainer(u)?this.addContainerChild(u,e):this.addLeafChild(u,e)}}extractChildFlexProperties(t,e){const i=e.flexGrow??0,r=e.flexShrink??1,n=e.flexBasis??0;return{width:typeof e.width=="number"?e.width:void 0,height:typeof e.height=="number"?e.height:void 0,flexGrow:i,flexShrink:r,flexBasis:n,alignSelf:e.alignSelf??"auto",crossAxisSizing:"auto"}}handlePercentageDimensions(t,e,i,r,n){e==="100%"&&(r?(t.width=void 0,t.flexGrow===0&&(t.flexGrow=1)):(t.width=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch")),i==="100%"&&(r?(t.height=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch"):(t.height=void 0,t.flexGrow===0&&(t.flexGrow=1))),t.flexBasis===0&&(t.flexBasis=r?n.width:n.height)}isContainer(t){return"flexOptions"in t}addContainerChild(t,e){const i=new At(0,0,t.flexOptions);i.size.width=t.rect.width,i.size.height=t.rect.height,e.addChild(i,this.defaultFlexStyle),this.build(t,i)}addLeafChild(t,e){const i=e.addChild(this.defaultFlexStyle);i.size.width=t.rect.width,i.size.height=t.rect.height}}const Me=.5;class qr{constructor(t){this.positionResolver=t}reconcile(t,e,i,r,n,s=!1){let a=!1;const{parent:c}=e,u=c!==null?c.rect:n;a=this.updateNodePosition(e,i,u??e.rect);const h=r??e.children.filter(d=>!d.isAbsolute()),l=h.length>0;if(l&&i instanceof At){const d=this.reconcileChildLayouts(t,h,i,n);if(a=a||d,this.isContainer(e)&&!s){const f=this.updateContainerFromContent(e,i);a=a||f}}else if(!l){const d=this.remeasureAndUpdateLeaf(t,e,i);a=a||d}return this.positionNestedAbsoluteChildren(t,e),a}updateNodePosition(t,e,i){const r=t.rect,n=e.position,s=e.size;r.x=i.x+n.x,r.y=i.y+n.y;const a=r.width!==s.width,c=r.height!==s.height;return r.width=s.width,r.height=s.height,a||c}reconcileChildLayouts(t,e,i,r){let n=!1;const s=i.children,a=e.length;for(let c=0;c<a;c+=1){const u=this.reconcile(t,e[c],s[c],void 0,r);n=n||u}return n}updateContainerFromContent(t,e){const i=this.getContainerCachedIsRow(t),r=this.getContainerCachedPadding(t),n=e.children,s=n.length;let a=0;if(i){for(let d=0;d<s;d+=1){const f=n[d],g=f.position.y+f.size.height;g>a&&(a=g)}const c=a>0?a+r.bottom:0,u=t.style.height;if(u==="100%")return!1;const h=typeof u=="number"?u:0,l=c>h?c:h;if(l>t.rect.height+Me)return t.rect.height=l,this.syncFlexNodeSizeFromRect(t,e,!1,!0),!0}else{let c=0;for(let C=0;C<s;C+=1){const y=n[C],p=y.position.x+y.size.width,F=y.position.y+y.size.height;p>a&&(a=p),F>c&&(c=F)}const u=a>0?a+r.right:0,h=t.style.width;let l=!1,d=!1,f=!1;if(h!=="100%"){const C=typeof h=="number"?h:0,y=u>C?u:C;y>t.rect.width+Me&&(t.rect.width=y,l=!0,d=!0)}const g=c>0?c+r.bottom:0,v=t.style.height;if(v!=="100%"){const C=typeof v=="number"?v:0,y=g>C?g:C;y>t.rect.height+Me&&(t.rect.height=y,l=!0,f=!0)}return l&&this.syncFlexNodeSizeFromRect(t,e,d,f),l}return!1}syncFlexNodeSizeFromRect(t,e,i,r){i&&(e.size.width=t.rect.width),r&&(e.size.height=t.rect.height),this.syncAutoMainAxisFlexBasis(t,e,i,r)}syncAutoMainAxisFlexBasis(t,e,i,r){const n=t.parent;if(n===null||!this.isContainer(n)||t.style.flexBasis!==void 0&&t.style.flexBasis!==0)return;const s=this.getContainerCachedIsRow(n);s&&i?e.style.flexBasis=t.rect.width:!s&&r&&(e.style.flexBasis=t.rect.height)}remeasureAndUpdateLeaf(t,e,i){const r=e.rect.height,n=e.rect.width;e.measure(t),e.rect.width=n;const s=e.rect.height-r;return Math.abs(s)>Me?(this.syncFlexNodeSizeFromRect(e,i,!1,!0),!0):!1}positionNestedAbsoluteChildren(t,e){if(!this.isContainer(e)||!e.isPositioningContext())return;const i=e,n=i.children.filter(a=>a.isAbsolute());if(n.length===0)return;const s=this.getContainerCachedPadding(i);this.positionResolver.positionAbsoluteChildren(i.rect,s,n,a=>a.measure(t),a=>this.layoutAbsoluteChildSubtree(t,a))}layoutAbsoluteChildSubtree(t,e){if(!this.isContainer(e))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}isContainer(t){return"flexOptions"in t}getContainerCachedIsRow(t){return t.cachedIsRow??!0}getContainerCachedPadding(t){return t.cachedPadding??{top:0,right:0,bottom:0,left:0}}}class xt{static resolvePositionValue(t,e){if(t!==void 0){if(typeof t=="number")return t;if(typeof t=="string"&&t.endsWith("%"))return parseFloat(t)/100*e}}static applyAxisPositioning(t,e,i,r,n){const s=n?e.x:e.y,a=s+(n?e.width:e.height),c=n?e.width:e.height;if(i!==void 0&&r!==void 0){const u=Math.max(0,c-i-r);n?(t.x=s+i,t.width=u):(t.y=s+i,t.height=u)}else i!==void 0&&(n?t.x=s+i:t.y=s+i);r!==void 0&&i===void 0?n?t.x=a-t.width-r:t.y=a-t.height-r:r===void 0&&i===void 0&&(n?t.x=s:t.y=s)}applyAbsolutePositioning(t,e){const i=xt.resolvePositionValue(t.left,e.width),r=xt.resolvePositionValue(t.right,e.width),n=xt.resolvePositionValue(t.top,e.height),s=xt.resolvePositionValue(t.bottom,e.height),a=t.rect;xt.applyAxisPositioning(a,e,i,r,!0),xt.applyAxisPositioning(a,e,n,s,!1)}positionAbsoluteChildren(t,e,i,r,n){const s={x:t.x+e.left,y:t.y+e.top,width:t.width-e.left-e.right,height:t.height-e.top-e.bottom};for(const a of i)r(a),this.applyAbsolutePositioning(a,s),n==null||n(a)}}class oi{constructor(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}reset(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}accumulate(t,e){this.isRow=e,e?(this.width+=t.width,this.maxCrossSize=Math.max(this.maxCrossSize,t.height)):(this.height+=t.height,this.maxCrossSize=Math.max(this.maxCrossSize,t.width)),this.childCount+=1}addGap(t,e){if(this.childCount>1){const i=t*(this.childCount-1);e?this.width+=i:this.height+=i}}getSize(){return this.isRow?{width:this.width,height:this.maxCrossSize}:{width:this.maxCrossSize,height:this.height}}static computeIntrinsicSize(t,e,i){const r=new oi;for(const n of t)r.accumulate(n,e);return r.addGap(i,e),r.getSize()}}const Fa=3,Kr={top:0,right:0,bottom:0,left:0},ba=o=>o===void 0||o==="row"||o==="row-reverse",Zr=o=>o===void 0?Kr:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0};class dt extends Mt{constructor(t,e={},i="transparent"){super(t),this.cachedPadding=Kr,this.cachedIsRow=!0,this.cachedGap=0,this.optionsCacheValid=!1,this.flexOptionsValue=e,this.positionResolver=new xt,this.flexTreeBuilder=new Yr,this.layoutReconciler=new qr(this.positionResolver),this.invalidateOptionsCache(),this.backgroundColor=i}get flexOptions(){return this.flexOptionsValue}set flexOptions(t){this.flexOptionsValue=t,this.invalidateOptionsCache(),this.markLayoutDirty()}setFlexOptions(t){Object.assign(this.flexOptionsValue,t),this.invalidateOptionsCache(),this.markLayoutDirty()}invalidateOptionsCache(){this.optionsCacheValid=!1}ensureOptionsCache(){if(this.optionsCacheValid)return;const t=this.flexOptionsValue;this.cachedIsRow=ba(t.direction),this.cachedGap=this.cachedIsRow?t.columnGap??0:t.rowGap??0,this.cachedPadding=Zr(t.padding),this.optionsCacheValid=!0}measure(t){this.measureChildren(t),this.computeIntrinsicSize(),this.applySizeConstraints(),this.clearMeasureDirty()}measureChildren(t){const{children:e}=this;for(let i=0;i<e.length;i+=1)e[i].measure(t)}computeIntrinsicSize(){this.ensureOptionsCache();const{layoutChildren:t}=this.separateChildrenByLayoutMode(),e=t.map(s=>s.rect),{width:i,height:r}=oi.computeIntrinsicSize(e,this.cachedIsRow,this.cachedGap),n=this.cachedPadding;this._intrinsicWidth=i+n.left+n.right,this._intrinsicHeight=r+n.top+n.bottom}applySizeConstraints(){const{style:t}=this,e=this.resolveStyleDimension(t.width,"width"),i=this.resolveStyleDimension(t.height,"height");this.rect.width=e??this._intrinsicWidth,this.rect.height=i??this._intrinsicHeight,e===void 0&&this.clampWidthToParent()}resolveStyleDimension(t,e){if(typeof t=="number")return t;if(t!=="100%")return;const i=this.resolveParentContentSize(e);return i!==void 0?i:this.rect[e]>0?this.rect[e]:void 0}resolveParentContentSize(t){const{parent:e}=this;if(!(e instanceof dt))return e!=null&&e.rect[t]&&e.rect[t]>0?e.rect[t]:void 0;e.ensureOptionsCache();const i=e.cachedPadding,r=t==="width"?i.left+i.right:i.top+i.bottom,n=e.rect[t]-r;return n>0?n:void 0}performLayout(t,e=!1){if(e?(this.measureChildren(t),this.clearMeasureDirty()):this.measure(t),this.children.length===0){this.clearLayoutDirty();return}const{layoutChildren:i,absoluteChildren:r}=this.separateChildrenByLayoutMode();i.length>0&&this.layoutPhase1Flexbox(t,i,e),r.length>0&&this.isPositioningContext()&&this.layoutPhase2Absolute(t,r),this.clearLayoutDirty()}layoutPhase1Flexbox(t,e,i=!1){const r=new no(this.rect.width,this.rect.height,this.flexOptionsValue);this.flexTreeBuilder.build(this,r,e);let n=0,s;do r.build(),s=this.layoutReconciler.reconcile(t,this,r,e,this.rect,i),n+=1;while(s&&n<Fa)}layoutPhase2Absolute(t,e){this.ensureOptionsCache(),this.positionResolver.positionAbsoluteChildren(this.rect,this.cachedPadding,e,i=>i.measure(t),i=>this.layoutAbsoluteChildSubtree(t,i))}layoutAbsoluteChildSubtree(t,e){if(!(e instanceof dt))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}clampWidthToParent(){const{parent:t}=this;if(t===null||t.rect.width<=0)return;let e=t.rect.width;t instanceof dt&&(t.ensureOptionsCache(),e-=t.cachedPadding.left+t.cachedPadding.right),e=Math.max(0,e),this.rect.width>e&&(this.rect.width=e)}separateChildrenByLayoutMode(){const t=[],e=[];for(const i of this.children)i.isAbsolute()?e.push(i):t.push(i);return{layoutChildren:t,absoluteChildren:e}}onPaint(t,e){this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor);for(const i of this.children)i.paint(t,e)}}const wa={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},xa=(o,t)=>({minX:Math.min(o.minX,t.rect.x),minY:Math.min(o.minY,t.rect.y),maxX:Math.max(o.maxX,t.rect.x+t.rect.width),maxY:Math.max(o.maxY,t.rect.y+t.rect.height)}),Sa=o=>o.minX===1/0||o.maxX===-1/0;class Aa extends dt{performLayout(t){const e=this.layoutChildren(t);if(!e){this.clearLayoutDirty();return}this.expandToFitBounds(e),this.clearLayoutDirty()}layoutChildren(t){let e={...wa};return this.children.forEach(i=>{i instanceof dt?i.performLayout(t):i.measure(t),e=xa(e,i)}),Sa(e)?null:e}expandToFitBounds(t){const e=t.maxX-this.rect.x,i=t.maxY-this.rect.y;e>this.rect.width&&(this.rect.width=e),i>this.rect.height&&(this.rect.height=i)}onPaint(t,e){this.backgroundColor&&this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor),this.borderWidth>0&&this.borderColor&&this.borderColor!=="transparent"&&t.strokeRect(this.rect.x+this.borderWidth/2,this.rect.y+this.borderWidth/2,this.rect.width-this.borderWidth,this.rect.height-this.borderWidth,this.borderColor,this.borderWidth),super.onPaint(t,e)}}class so{constructor(t={}){this.options=t,this.hoveredNode=null,this.activePortalNode=null,this.currentCursor="default",this.bounds=null}setAbsoluteBounds(t){this.bounds=t?{...t}:null}handlePointerMove(t,e){this.transitionHover(t[0],e),this.updateCursor(t)}handlePointerLeave(){this.transitionHover(void 0,null),this.updateCursor([])}handlePortalReset(){this.activePortalNode&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:this.activePortalNode.id,source:this.options.portalSource}),this.activePortalNode=null}computeCursor(t,e,i){var n;const r=i.hitTest(t,e);for(const s of r){const a=(n=s.style)==null?void 0:n.cursor;if(a)return a}return"default"}getCurrentCursor(){return this.currentCursor}transitionHover(t,e){if(this.hoveredNode===t){this.updatePortalHover(t,e);return}this.hoveredNode&&this.hoveredNode.onMouseLeave(this.buildEvent("mouseleave",this.hoveredNode,e)),t&&t.onMouseEnter(this.buildEvent("mouseenter",t,e)),this.hoveredNode=t??null,this.updatePortalHover(t,e)}buildEvent(t,e,i){return i?{...i,type:t,target:e,currentTarget:e}:{type:t,x:0,y:0,originalEvent:{},stopPropagation:()=>{},preventDefault:()=>{},target:e,currentTarget:e}}updateCursor(t){var i,r,n;let e="default";for(const s of t){const a=(i=s.style)==null?void 0:i.cursor;if(a){e=a;break}}e!==this.currentCursor&&(this.currentCursor=e,(n=(r=this.options).onCursorChange)==null||n.call(r,e))}findPortalTarget(t){let e=t;for(;e;){if(e.portalHoverEnabled)return e;e=e.parent}return null}updatePortalHover(t,e=null){var a,c,u,h,l,d;const i=this.findPortalTarget(t),r=i?{...i.rect}:null,n=this.activePortalNode,s=i&&r?{id:i.id,rect:r}:null;if(i&&(n==null?void 0:n.id)===i.id){(c=(a=this.options).onPortalTargetChange)==null||c.call(a,i,e);return}if(this.activePortalNode=s,(h=(u=this.options).onPortalTargetChange)==null||h.call(u,i??null,e),!!this.options.portalHoverDispatch)if(i&&r&&this.bounds){const f=((d=(l=this.options).getTooltipContext)==null?void 0:d.call(l))??void 0;this.dispatchPortalHover({visible:!0,x:this.bounds.x+r.x,y:this.bounds.y+r.y,width:r.width,height:r.height,nodeId:i.id,originId:i.id,source:this.options.portalSource,tooltipContext:f,tooltipFromNode:i.getTooltip(),priority:1})}else n&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:n.id,source:this.options.portalSource})}dispatchPortalHover(t){var i,r,n,s;const e=((r=(i=this.options).getPortalEventTarget)==null?void 0:r.call(i))??null;(s=(n=this.options).portalHoverDispatch)==null||s.call(n,t,e)}}class vt extends Mt{addChild(){throw new Error("CanvasLeaf cannot have children")}}const ue={selection:"normal",cellClick:"normal",editor:"normal",contextMenu:"normal"};function Ea(o){return o.selection!==void 0||o.cellClick!==void 0||o.editor!==void 0||o.contextMenu!==void 0}function jr(o){if(!o||!Ea(o))return;const t={selection:o.selection??ue.selection,cellClick:o.cellClick??ue.cellClick,editor:o.editor??ue.editor,contextMenu:o.contextMenu??ue.contextMenu};return t.editor==="open-on-click"&&t.selection==="keep"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного selection. Editor не будет открыт, чтобы не менять выделение неожиданно.'),t.editor="normal"),t.editor==="open-on-click"&&t.cellClick==="stop"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного cellClick, потому что editor открывается через click pipeline таблицы. Editor не будет открыт.'),t.editor="normal"),t}function Jr(){return{...ue}}class Qr{constructor(){this.nodes=new Map,this.listeners=new Set}register(t,e){this.nodes.set(t,e),this.notify(t)}unregister(t){this.nodes.delete(t)}get(t){return this.nodes.get(t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(e=>e(t))}}class Ta{constructor(){this.isActive=!1,this.displayed=new Map,this.painted=new Set}beginFrame(t){var e,i,r;this.isActive=!0,(((e=this.resources)==null?void 0:e.loader)!==(t==null?void 0:t.loader)||((i=this.resources)==null?void 0:i.colIndex)!==(t==null?void 0:t.colIndex)||((r=this.resources)==null?void 0:r.rowIndex)!==(t==null?void 0:t.rowIndex))&&this.displayed.clear(),this.resources=t?{...t}:void 0,this.painted.clear()}getAvatarImage(t,e,i){const{resources:r}=this;if(!i||!r){this.displayed.delete(t);return}this.painted.add(t);const n=this.displayed.get(t);(n==null?void 0:n.name)!==e&&this.displayed.delete(t);const s=r.loader.loadOrGetImage(i,r.colIndex,r.rowIndex);if(s)return this.displayed.set(t,{name:e,url:i}),s;if(n&&n.name===e&&n.url!==i)return r.loader.loadOrGetImage(n.url,r.colIndex,r.rowIndex)}endFrame(){this.isActive=!1,this.displayed.forEach((t,e)=>{this.painted.has(e)||this.displayed.delete(e)}),this.painted.clear()}}function Ia(o,t){return o.zIndex!==t.zIndex?o.zIndex-t.zIndex:o.order-t.order}const ir=typeof Path2D<"u"&&typeof CanvasRenderingContext2D.prototype.roundRect=="function";class ri{constructor(){this.imageTransitions=new Ta,this.commands=[],this.orderCounter=0,this.currentZIndex=0}setAnimationContext(t){return this.animationContext=t,this}getAnimationContext(){return this.animationContext}setZIndex(t){return this.currentZIndex=t,this}getZIndex(){return this.currentZIndex}pushZIndex(t=1){return this.currentZIndex+=t,this}popZIndex(t=1){return this.currentZIndex-=t,this}fillRect(t,e,i,r,n){return this.commands.push({type:"fillRect",x:t,y:e,width:i,height:r,fillStyle:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}strokeRect(t,e,i,r,n,s=1){return this.commands.push({type:"strokeRect",x:t,y:e,width:i,height:r,strokeStyle:n,lineWidth:s,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillText(t,e,i,r,n,s="middle",a){return this.commands.push({type:"fillText",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:s,textAlign:a,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillTextClipped(t,e,i,r,n,s,a="middle",c){return this.commands.push({type:"fillTextClipped",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:a,textAlign:c,clipX:s.x,clipY:s.y,clipWidth:s.width,clipHeight:s.height,zIndex:this.currentZIndex,order:this.orderCounter++}),this}drawImage(t,e,i,r,n){return this.commands.push({type:"drawImage",image:t,x:e,y:i,width:r,height:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}roundedRect(t,e,i,r,n,s){return this.commands.push({type:"roundedRect",x:t,y:e,width:i,height:r,radius:n,fillStyle:s==null?void 0:s.fillStyle,strokeStyle:s==null?void 0:s.strokeStyle,lineWidth:s==null?void 0:s.lineWidth,zIndex:this.currentZIndex,order:this.orderCounter++}),this}linearGradientRect(t,e,i,r,n,s,a=90){return this.commands.push({type:"linearGradientRect",x:t,y:e,width:i,height:r,radius:n,gradientStops:s,angle:a,zIndex:this.currentZIndex,order:this.orderCounter++}),this}custom(t){return this.commands.push({type:"custom",fn:t,zIndex:this.currentZIndex,order:this.orderCounter++}),this}clear(){return this.commands.length=0,this.orderCounter=0,this.currentZIndex=0,this.animationContext=void 0,this}get commandCount(){return this.commands.length}flush(t){const{commands:e}=this,i=e.length;if(i===0)return;e.sort(Ia);let r="",n="",s=-1,a="",c="",u="";for(let h=0;h<i;h++){const l=e[h];if(l!==void 0)switch(l.type){case"fillRect":r!==l.fillStyle&&(t.fillStyle=l.fillStyle,r=l.fillStyle),t.fillRect(l.x,l.y,l.width,l.height);break;case"strokeRect":n!==l.strokeStyle&&(t.strokeStyle=l.strokeStyle,n=l.strokeStyle),s!==l.lineWidth&&(t.lineWidth=l.lineWidth,s=l.lineWidth),t.strokeRect(l.x,l.y,l.width,l.height);break;case"fillText":a!==l.font&&(t.font=l.font,a=l.font),r!==l.fillStyle&&(t.fillStyle=l.fillStyle,r=l.fillStyle),c!==l.textBaseline&&(t.textBaseline=l.textBaseline,c=l.textBaseline),l.textAlign&&u!==l.textAlign&&(t.textAlign=l.textAlign,u=l.textAlign),t.fillText(l.text,l.x,l.y);break;case"fillTextClipped":a!==l.font&&(t.font=l.font,a=l.font),r!==l.fillStyle&&(t.fillStyle=l.fillStyle,r=l.fillStyle),c!==l.textBaseline&&(t.textBaseline=l.textBaseline,c=l.textBaseline),l.textAlign&&u!==l.textAlign&&(t.textAlign=l.textAlign,u=l.textAlign),this.executeFillTextClipped(t,l);break;case"drawImage":t.drawImage(l.image,l.x,l.y,l.width,l.height);break;case"roundedRect":this.executeRoundedRect(t,l),l.fillStyle&&(r=l.fillStyle),l.strokeStyle&&(n=l.strokeStyle),l.lineWidth!==void 0&&(s=l.lineWidth);break;case"linearGradientRect":this.executeLinearGradientRect(t,l);break;case"custom":l.fn(t),r="",n="",s=-1,a="",c="",u="";break}}this.clear()}executeLinearGradientRect(t,e){const{x:i,y:r,width:n,height:s,radius:a,gradientStops:c,angle:u}=e,h=(u-90)*Math.PI/180,l=Math.cos(h),d=Math.sin(h),f=n/2,g=s/2,v=i+f,C=r+g,p=(Math.abs(l*n)+Math.abs(d*s))/2,F=v-l*p,w=C-d*p,S=v+l*p,b=C+d*p,T=t.createLinearGradient(F,w,S,b);for(const E of c)T.addColorStop(E.offset,E.color);if(t.fillStyle=T,a>0)if(ir)t.beginPath(),t.roundRect(i,r,n,s,a),t.fill();else{const E=a,I=i+n,B=r+s;t.beginPath(),t.moveTo(i+E,r),t.lineTo(I-E,r),t.quadraticCurveTo(I,r,I,r+E),t.lineTo(I,B-E),t.quadraticCurveTo(I,B,I-E,B),t.lineTo(i+E,B),t.quadraticCurveTo(i,B,i,B-E),t.lineTo(i,r+E),t.quadraticCurveTo(i,r,i+E,r),t.closePath(),t.fill()}else t.fillRect(i,r,n,s)}executeFillTextClipped(t,e){e.clipWidth<=0||e.clipHeight<=0||e.text.length===0||(t.save(),t.beginPath(),t.rect(e.clipX,e.clipY,e.clipWidth,e.clipHeight),t.clip(),t.fillText(e.text,e.x,e.y),t.restore())}executeRoundedRect(t,e){const{x:i,y:r,width:n,height:s,radius:a,fillStyle:c,strokeStyle:u,lineWidth:h}=e;if(ir)t.beginPath(),t.roundRect(i,r,n,s,a);else{const l=a,d=i+n,f=r+s;t.beginPath(),t.moveTo(i+l,r),t.lineTo(d-l,r),t.quadraticCurveTo(d,r,d,r+l),t.lineTo(d,f-l),t.quadraticCurveTo(d,f,d-l,f),t.lineTo(i+l,f),t.quadraticCurveTo(i,f,i,f-l),t.lineTo(i,r+l),t.quadraticCurveTo(i,r,i+l,r),t.closePath()}c&&(t.fillStyle=c,t.fill()),u&&(t.strokeStyle=u,h!==void 0&&(t.lineWidth=h),t.stroke())}}const Da=new ri;class Ha{constructor(t,e){this.eventHandlers=new Map,this.batcher=new ri,this.canvas=t,this.ctx=t.getContext("2d",{alpha:!1}),this.rootNode=e,this.hoverController=new so({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},onPortalTargetChange:(i,r)=>{var n;return(n=this.onPortalHoverTargetChange)==null?void 0:n.call(this,i,r)}}),this.setupEvents()}setupEvents(){["click","mousedown","mouseup","mousemove","dblclick"].forEach(e=>{const i=r=>this.dispatchPointerEvent(r,e);this.eventHandlers.set(e,i),this.canvas.addEventListener(e,i)})}destroy(){this.eventHandlers.forEach((t,e)=>{this.canvas.removeEventListener(e,t)}),this.eventHandlers.clear()}dispatchPointerEvent(t,e){const{x:i,y:r}=this.getEventCoords(t),n=this.rootNode.hitTest(i,r),s=n[0];let a=!1;const c={type:e,x:i,y:r,originalEvent:t,target:s,stopPropagation:()=>{a=!0},preventDefault:()=>t.preventDefault()};this.bubbleEvent(n,c,e,()=>a),e==="mousemove"&&(this.dispatchMouseMove(n,c,()=>a),this.hoverController.handlePointerMove(n,c))}getEventCoords(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}bubbleEvent(t,e,i,r){t.length!==0&&this.dispatchToNodes(t,e,(n,s)=>this.invokePointerHandler(n,i,s),r)}dispatchMouseMove(t,e,i){this.dispatchToNodes(t,e,(r,n)=>r.onMouseMove(n),i)}dispatchToNodes(t,e,i,r){for(const n of t){if(r())break;i(n,{...e,currentTarget:n})}}invokePointerHandler(t,e,i){switch(e){case"click":t.onClick(i);break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break}}render(){const t=window.devicePixelRatio||1,e=this.canvas.getBoundingClientRect();this.clearCanvas(),this.applyResolutionScale(t),this.updateRootRect(e),this.layoutRoot(),this.batcher.clear(),this.rootNode.paint(this.batcher,this.ctx),this.batcher.flush(this.ctx)}clearCanvas(){this.ctx.fillStyle="#ffffff",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}applyResolutionScale(t){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(t,t)}updateRootRect(t){this.rootNode.rect.width=t.width,this.rootNode.rect.height=t.height,this.rootNode.rect.x=0,this.rootNode.rect.y=0}layoutRoot(){this.rootNode instanceof dt?this.rootNode.performLayout(this.ctx):this.rootNode.measure(this.ctx)}}const ao={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#485056B0",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#707C847A",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#8A959D",textTertiaryVariant:"#657179",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0B7ECB",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0B7ECB33",textPositive:"#108E26",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#FA5F05",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#E31227",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#ECF6FCFF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#E8EEF2",surfaceAccent:"#118CDF",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#ADB9C238",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#8A959D47",surfaceTransparentDeep:"#30373CC6",surfaceClear:"#FFFFFF00",surfacePositive:"#1A9E32",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#FA5F05",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#F3A9128E",surfaceNegative:"#FF293E",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#118CDF1F",surfaceTransparentAccentActive:"#118CDF33",surfaceTransparentAccent12:"#118CDF1E",surfaceTransparentAccent20:"#118CDF33",surfaceTransparentPositive:"#1A9E321F",surfaceTransparentPositive12:"#1A9E321E",surfaceTransparentPositive20:"#1A9E3233",surfaceTransparentWarning:"#FA5F051F",surfaceTransparentWarning12:"#FA5F051E",surfaceTransparentWarning20:"#FA5F0533",surfaceTransparentNegative:"#FF293E1F",surfaceTransparentNegative12:"#FF293E1E",surfaceTransparentNegative20:"#FF293E33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373CC7",onDarkSurfaceSolidDefault:"#F7F9FB",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0B7ECB",outlineSolidPrimary:"#D5DFE6",outlineSolidPrimary26:"#D5DFE642",dataBlueMinor:"#CFECFF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#8BB2FC",dataAccentMinorHover:"#52BAFF",dataPositive:"#28D247",dataPositiveMinor:"#9EFAAF",dataNegative:"#FF8F9A",dataNegativeMinor:"#FFE0E3",dataWarning:"#FD9C68",dataWarningMinor:"#FEE2D2",dataOrange:"#F3A912",dataOrangeMinor:"#FFD37A",dataViolet:"#AD42F5",dataVioletMinor:"#DEB7F7",dataPink:"#FF8FBC",dataMagenta:"#F391E2",dataCyan:"#00DDE0",dataCyanDark:"#04C6C9",dataLime:"#93E006",dataTeal:"#14CC98"},La={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#03070CAF",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#000206A8",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#818C95",textTertiaryVariant:"#65717A",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0058A2",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0058A23F",textPositive:"#0F5E00",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#D95800",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#A50016",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#CFE5F2FF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#CFD9E0",surfaceAccent:"#0076D2",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#7D96A838",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#516E8347",surfaceTransparentDeep:"#30373DC6",surfaceClear:"#FFFFFF00",surfacePositive:"#198A00",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#D95800",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#D491008E",surfaceNegative:"#E7002F",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#0076D21F",surfaceTransparentAccentActive:"#00AD7C33",surfaceTransparentAccent12:"#0076D21E",surfaceTransparentAccent20:"#0076D233",surfaceTransparentPositive:"#198A001F",surfaceTransparentPositive12:"#198A003F",surfaceTransparentPositive20:"#198A0033",surfaceTransparentWarning:"#D958001F",surfaceTransparentWarning12:"#D958003F",surfaceTransparentWarning20:"#D9580033",surfaceTransparentNegative:"#E7002F1F",surfaceTransparentNegative12:"#E7002F3F",surfaceTransparentNegative20:"#E7002F33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373DC7",onDarkSurfaceSolidDefault:"#D6DFE7",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0058A2",outlineSolidPrimary:"#C4CFD7",outlineSolidPrimary26:"#AFC0CB42",dataBlueMinor:"#9CD5FF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#6096FF",dataAccentMinorHover:"#0077C1",dataPositive:"#168600",dataPositiveMinor:"#96DAA1",dataNegative:"#BA5161",dataNegativeMinor:"#F8BDC4",dataWarning:"#B35B10",dataWarningMinor:"#F7C29D",dataOrange:"#D49100",dataOrangeMinor:"#F3B400",dataViolet:"#9A29E0",dataVioletMinor:"#D48BFF",dataPink:"#FB5AA5",dataMagenta:"#EB60D7",dataCyan:"#00C1C3",dataCyanDark:"#00AAAD",dataLime:"#7FC400",dataTeal:"#00B082"},Pa={...ao,textPrimary:"#14191DF5",textPrimaryHover:"#151A1E93",textPrimaryActive:"#151A1EC4",textSecondary:"#475158B0",textSecondaryHover:"#465058FF",textSecondaryActive:"#465058D3",textTertiary:"#707F897A",textTertiaryHover:"#707F89FF",textTertiaryActive:"#707F8993",textParagraph:"#14191DCC",textParagraphHover:"#151A1E7A",textParagraphActive:"#151A1EA3",textAccent:"#0087CD",textAccentHover:"#00A3F5FF",textAccentActive:"#006DA3FF",textPositive:"#219532",textPositiveHover:"#28B83EFF",textPositiveActive:"#1A7527FF",textWarning:"#E15400",textWarningHover:"#FF640AFF",textWarningActive:"#B84300FF",textNegative:"#D60033",textNegativeHover:"#FF003BFF",textNegativeActive:"#AD0028FF",inverseTextPrimary:"#F3F7FAF5",onDarkTextPrimary:"#F3F7FAF5",onDarkTextPrimaryHover:"#F4F8FA93",onDarkTextPrimaryActive:"#F4F8FAC4",onLightTextPrimary:"#14191DF5",onLightTextPrimaryHover:"#151A1E93",onLightTextPrimaryActive:"#151A1EC4",surfaceAccentMinor:"#EFF8FF",surfaceSolidDefault:"#060A0D",surfaceSolidTertiary:"#CFDBE4",surfaceAccent:"#1F9EEB",surfaceAccentHover:"#3AA9EEFF",surfaceAccentActive:"#1492E1FF",surfaceTransparentSecondary:"#A8B6BF38",surfaceTransparentSecondaryHover:"#A7B5BE47",surfaceTransparentSecondaryActive:"#A7B5BE4D",surfaceTransparentTertiary:"#8B98A247",surfaceTransparentDeep:"#30383EC7",surfacePositive:"#21A038",surfacePositiveHover:"#24B23EFF",surfacePositiveActive:"#1D9032FF",surfaceWarning:"#E15400",surfaceWarningHover:"#F55A00FF",surfaceWarningActive:"#CC4B00FF",surfaceNegative:"#F81C42",surfaceNegativeHover:"#F94361FF",surfaceNegativeActive:"#F70830FF",surfaceTransparentAccent:"#0090DA1F",surfaceTransparentAccentActive:"#0092DB33",surfaceTransparentPositive:"#21A0381F",surfaceTransparentWarning:"#E154001F",surfaceTransparentNegative:"#F81C421F",onLightSurfaceSolidDefault:"#060A0D",onLightSurfaceTransparentDeep:"#30383EC7",onDarkSurfaceSolidDefault:"#F6F9FB",outlineAccent:"#0087CD",outlineSolidPrimary:"#CFDBE4",dataBlueMinor:"#D3EBFF",dataBlueMinorActive:"#C2E3FFFF",dataBlue:"#1F9EEB",dataOrange:"#F3621C",dataOrangeMinor:"#F79772",dataPink:"#FC8CA6"},Ba={...ao,surfaceTransparentAccentActive:"#118CDF24",textAccent:"#199AF0"},_a={light:{...ao,surfaceAccent20:"#199AF033"},dark:Ba,highContrastLight:La,betaCoreLight:Pa},tn=(o="light")=>_a[o],ki={step:.8,cutoutRadius:.58,rightCutoutCenter:1.3,leftCutoutCenter:-.3};function en(o,t){return o?t==null?void 0:t.loader.loadOrGetImage(o,t.colIndex,t.rowIndex):void 0}function Ra(o,t,e,i){if(o<=0||t<=0||e.width<=0||e.height<=0)return;const r={x:0,y:0,width:o,height:t},n={...e};if(i==="cover"){const s=Math.max(e.width/o,e.height/t);r.width=e.width/s,r.height=e.height/s,r.x=(o-r.width)/2,r.y=(t-r.height)/2}else if(i==="contain"){const s=Math.min(e.width/o,e.height/t);n.width=o*s,n.height=t*s,n.x+=(e.width-n.width)/2,n.y+=(e.height-n.height)/2}return{source:r,destination:n}}function on(o,t,e,i){const r="naturalWidth"in t?t.naturalWidth:t.width,n="naturalHeight"in t?t.naturalHeight:t.height,s=Ra(r,n,e,i);if(!s)return;const{source:a,destination:c}=s;o.drawImage(t,a.x,a.y,a.width,a.height,c.x,c.y,c.width,c.height)}const ka=600,Ma={s:{diameter:24,fontSize:8},m:{diameter:36,fontSize:14},l:{diameter:48,fontSize:20},xxl:{diameter:88,fontSize:32}};function za(o=""){return o.split(" ").slice(0,2).map(t=>t[0]??"").join("").toUpperCase()}class ve extends vt{constructor(t,e={}){super(t),this.options=e,this.cutLeft=!1,this.cutRight=!1;const{diameter:i}=this.metrics;this.style={width:i,height:i,flexShrink:0}}set style(t){super.style={...super.style,...t}}get style(){return super.style}get metrics(){return Ma[this.options.size??"s"]}measure(){this.rect.width=this.metrics.diameter,this.rect.height=this.metrics.diameter}onPaint(t){var v;const{diameter:e,fontSize:i}=this.metrics,r={x:this.rect.x,y:this.rect.y,width:e,height:e},n=this.options.customText?void 0:this.options.url,s=t.imageTransitions.isActive?t.imageTransitions.getAvatarImage(this.id,this.options.name,n):en(n,t.imageResources),a=this.options.customText||za(this.options.name),c=((v=this.options.theme)==null?void 0:v.tokens)??tn(),u=this.groupClip&&{...this.groupClip},{cutLeft:h,cutRight:l}=this,{cutoutRadius:d,leftCutoutCenter:f,rightCutoutCenter:g}=ki;t.custom(C=>{var y;C.save();try{u&&(C.beginPath(),C.rect(u.x,u.y,u.width,u.height),C.clip()),[h?f:void 0,l?g:void 0].forEach(p=>{p!==void 0&&(C.beginPath(),C.rect(r.x,r.y,e,e),C.moveTo(r.x+p*e+d*e,r.y+e/2),C.arc(r.x+p*e,r.y+e/2,d*e,0,Math.PI*2),C.clip("evenodd"))}),C.beginPath(),C.arc(r.x+e/2,r.y+e/2,e/2,0,Math.PI*2),C.clip(),C.fillStyle=c.surfaceAccent20??c.surfaceTransparentAccentActive,C.fillRect(r.x,r.y,e,e),s?on(C,s,r,"fill"):(C.font=`${ka} ${i}px ${((y=this.options.theme)==null?void 0:y.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'}`,C.textAlign="center",C.textBaseline="middle",C.fillStyle=c.textAccent,C.fillText(a,r.x+e/2,r.y+e/2))}finally{C.restore()}})}}function or(o,t){return o===void 0||!Number.isFinite(o)?t:Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,Math.floor(o)))}function Oa(o,t,e){const i=Math.min(o,or(t,3)),r=Math.max(o,or(e,o)),n=r-i;return{visible:i,total:r,hidden:n,slots:i+(n>0?1:0)}}class co extends dt{constructor(t,e){var a;super(t),this.options=e,this.activeIndex=-1,this.avatars=[];const i=Oa(e.items.length,e.visibleCount,e.totalCount),r=e.items.slice(0,i.visible);if(new Set(e.items.map(c=>c.id)).size!==e.items.length)throw new Error("Canvas.AvatarGroup items must have unique ids");if(r.forEach((c,u)=>{const h=new ve(`${t}:item:${c.id}`,{...c,size:e.size,theme:e.theme});h.tooltip=c.tooltip,h.onClick=l=>{var d;l.target===h&&((d=e.onItemClick)==null||d.call(e,{item:c,index:u,event:l}))},e.onItemClick&&(h.style.cursor="pointer"),this.appendAvatar(h)}),i.hidden>0){const c=new ve(`${t}:overflow`,{customText:`+${i.hidden}`,size:e.size,theme:e.theme});c.tooltip=e.overflowTooltip??`+${i.hidden}`,c.onClick=u=>{var h;u.target===c&&((h=e.onOverflowClick)==null||h.call(e,{hiddenCount:i.hidden,hiddenItems:e.items.slice(i.visible),totalCount:i.total,event:u}))},e.onOverflowClick&&(c.style.cursor="pointer"),this.appendAvatar(c)}const s=((a=this.avatars[0])==null?void 0:a.metrics.diameter)??0;this.position="relative",this.style={width:i.slots?s+(i.slots-1)*ki.step*s:0,height:s,flexShrink:0}}set style(t){super.style={...super.style,...t}}get style(){return super.style}appendAvatar(t){const e=this.avatars.length;t.position="absolute",t.left=e*ki.step*t.metrics.diameter,t.top=0,t.portalHoverEnabled=t.tooltip!==void 0,t.onMouseEnter=()=>{this.activeIndex=e},t.onMouseLeave=()=>{this.activeIndex===e&&(this.activeIndex=-1)},this.avatars.push(t),this.addChild(t)}onPaint(t,e){this.avatars.forEach((i,r)=>{i.groupClip=this.rect,i.cutRight=r<this.avatars.length-1&&r!==this.activeIndex,i.cutLeft=this.activeIndex>=0&&r===this.activeIndex+1,i.paint(t,e)})}}const at={xs:{height:24,fontSize:12,borderRadius:4,paddingX:8,iconSize:14},s:{height:32,fontSize:13,borderRadius:6,paddingX:12,iconSize:16},m:{height:40,fontSize:14,borderRadius:8,paddingX:16,iconSize:18},l:{height:48,fontSize:16,borderRadius:10,paddingX:20,iconSize:20}};function rn(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},primary:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},accent:{bgColor:o.surfaceAccent,bgColorHover:o.surfaceAccentHover,borderColor:o.surfaceAccent,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},secondary:{bgColor:o.surfaceTransparentSecondary,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},clear:{bgColor:o.surfaceClear,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},success:{bgColor:o.surfacePositive,bgColorHover:o.surfacePositiveHover,borderColor:o.surfacePositive,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},warning:{bgColor:o.surfaceWarning,bgColorHover:o.surfaceWarningHover,borderColor:o.surfaceWarning,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},critical:{bgColor:o.surfaceNegative,bgColorHover:o.surfaceNegativeHover,borderColor:o.surfaceNegative,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},dark:{bgColor:o.onLightSurfaceTransparentDeep,bgColorHover:o.onLightSurfaceTransparentDeep,borderColor:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},black:{bgColor:o.onLightSurfaceSolidDefault,bgColorHover:o.onLightSurfaceSolidDefault,borderColor:o.onLightSurfaceSolidDefault,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},white:{bgColor:o.onDarkSurfaceSolidDefault,bgColorHover:o.onDarkSurfaceSolidDefault,borderColor:o.onDarkSurfaceSolidDefault,textColor:o.onLightTextPrimary,iconColor:o.onLightTextPrimary}}}const rr={bgColor:"#060A0C",bgColorHover:"#13181B",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},ni={default:rr,primary:{bgColor:"#060A0C",bgColorHover:"#111C22",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},accent:{bgColor:"#118CDF",bgColorHover:"#1798EE",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},secondary:{bgColor:"#ADB9C238",bgColorHover:"#ADB9C247",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},clear:{bgColor:"transparent",bgColorHover:"rgba(6, 10, 12, 0.08)",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},success:{bgColor:"#1A9E32",bgColorHover:"#1EB83A",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},warning:{bgColor:"#FA5F05",bgColorHover:"#FB782D",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},critical:{bgColor:"#FF293E",bgColorHover:"#FF5263",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},dark:{bgColor:"#30373CC7",bgColorHover:"#30373CC7",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},black:rr,white:{bgColor:"#FFFFFF",bgColorHover:"#FFFFFF",borderColor:"transparent",textColor:"#060A0C",textColorHover:"#13181B93",iconColor:"#060A0C",iconColorHover:"#13181B93"}},oe=4,re=4,nn=16,lo=20,ho=4,Et=1,uo=6,Na=4,si="s",ai="default",fo="#d32f2f",me="#ffffff",sn="rgba(30, 136, 229, 0.08)",Mi="#ffffff",an="#E8EEF2",cn="#D5DFE6",zi="#8A959D",go="|",ln="#",hn=35,Co=15,Oi=new Map,Ni=new Map;function vo(o,t){if(o.charCodeAt(0)===hn){const e=parseInt(o.slice(1),16),i=Math.min(255,(e>>16&255)+t),r=Math.min(255,(e>>8&255)+t),n=Math.min(255,(e&255)+t);return`${ln}${(i<<16|r<<8|n).toString(16).padStart(6,"0")}`}return o}function nr(o,t){const e=Math.min(1,Math.max(0,t));if(o.charCodeAt(0)!==35)throw new Error("Only HEX color format is supported");let i=o.slice(1),r,n,s;if((i.length===3||i.length===4)&&(i=i.split("").map(a=>a+a).join("")),i.length===6)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else if(i.length===8)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else throw new Error(`Invalid HEX color format: ${o}`);return`rgba(${r}, ${n}, ${s}, ${e})`}function un(o,t){const e=`${o}${go}${t}`;let i=Oi.get(e);return i===void 0&&(i=vo(o,t),Oi.set(e,i)),i}function mo(o,t,e){const i=`${e}${go}${t}`;let r=Ni.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Ni.set(i,r)),r}function po(o,t,e,i,r,n){if(o!=="auto")return o;let s=0;return r&&(s+=e+i),n&&(s+=e+i),t+s+4}function yo(o,t,e,i,r){let n=o;return i&&(n+=t+e),r&&(n+=t+e),n}function Wa(){Oi.clear(),Ni.clear()}const Ga=vo(fo,Co);function Fo(o,t,e,i){if(e)return{bgColor:o.bgCell,borderColor:o.borderColor,textColor:o.textLight,iconColor:o.textLight};switch(t){case"primary":return Wi(o,i);case"secondary":return dn(o,i);case"danger":return fn(i);default:return Wi(o,i)}}function $a(o,t,e,i,r){const{accentColor:n}=o,s=o.accentFg||me,a=o.accentFg||me,c=.4;if(t||e){const d=r?nr(n,c):n;return{bgColor:d,borderColor:d,textColor:s,iconColor:a}}const u="#485056B0",h="white",l=r?nr(u,c):u;return{bgColor:h,borderColor:l,textColor:s,iconColor:a}}function Wi(o,t){const{accentColor:e}=o,i=t?un(e,Co):e;return{bgColor:i,borderColor:i,textColor:o.accentFg||me,iconColor:o.accentFg||me}}function dn(o,t){return{bgColor:t?o.accentLight||sn:o.bgCell,borderColor:o.accentColor,textColor:o.accentColor,iconColor:o.accentColor}}function fn(o){const t=o?Ga:fo;return{bgColor:t,borderColor:t,textColor:Mi,iconColor:Mi}}function bo(o,t,e){return t?{bgColor:an,borderColor:cn,textColor:zi,iconColor:zi}:{bgColor:e?o.bgColorHover:o.bgColor,borderColor:o.borderColor,textColor:e&&o.textColorHover?o.textColorHover:o.textColor,iconColor:e&&o.iconColorHover?o.iconColorHover:o.iconColor}}const Zt=-1,sr=0,gt={colIndex:Zt,rowIndex:Zt},it={x:sr,y:sr},Ua=2;function Xe(o){const{location:t}=o;if(Array.isArray(t)&&t.length>=Ua)return gt.colIndex=t[0]??Zt,gt.rowIndex=t[1]??Zt,gt;const{col:e}=o,{row:i}=o;if(typeof e=="number"&&typeof i=="number")return gt.colIndex=e,gt.rowIndex=i,gt;const{colIndex:r}=o,{rowIndex:n}=o;return typeof r=="number"&&typeof n=="number"?(gt.colIndex=r,gt.rowIndex=n,gt):(gt.colIndex=Zt,gt.rowIndex=Zt,gt)}const ze="-",ar=0;function te(o,t){const{colIndex:e,rowIndex:i}=o;return e>=ar&&i>=ar?`${e}${ze}${i}`:`${t.x}${ze}${t.y}${ze}${t.width}${ze}${t.height}`}function Gi(o){const{posX:t}=o,{posY:e}=o;if(typeof t=="number"&&typeof e=="number"&&t===t&&e===e)return it.x=t,it.y=e,it;const{x:i}=o,{y:r}=o;if(typeof i=="number"&&typeof r=="number"&&i===i&&r===r)return it.x=i,it.y=r,it;const{location:n}=o;if(Array.isArray(n)&&n.length>=2){const s=n[0],a=n[1];if(typeof s=="number"&&typeof a=="number")return it.x=s,it.y=a,it}return null}function $i(o,t){const e=o.x,i=o.y,r=t.x,n=t.y;return e>=r&&e<=r+t.width&&i>=n&&i<=n+t.height?(it.x=e-r,it.y=i-n,it):o}function gn(o,t,e){if(typeof o!="number"||typeof t!="number")return;const i=e.width,r=e.height,n=e.x,s=e.y;if(o>=-1&&o<=i+1&&t>=-1&&t<=r+1)return it.x=o,it.y=t,it;if(o>=n-1&&o<=n+i+1&&t>=s-1&&t<=s+r+1)return it.x=o-n,it.y=t-s,it}function wo(o,t,e){const i=e.x,r=e.y;return o>=i&&o<=i+e.width&&t>=r&&t<=r+e.height}function zt(o,t){if(typeof o=="object"&&o){const{hoverX:e}=o,{hoverY:i}=o,{rectX:r}=o,{rectY:n}=o;if(typeof e=="number"&&typeof i=="number"&&typeof r=="number"&&typeof n=="number"){const s=t.x-r,a=t.y-n;return e>=s&&e<=s+t.width&&i>=a&&i<=a+t.height}}return!!o}function Ve(){return typeof window<"u"?Math.ceil(window.devicePixelRatio):1}function Cn(o){let t=0;for(let e=0;e<o.length;e++)t=(t<<5)-t+o.charCodeAt(e),t|=0;return t.toString(36)}function Ui(o,t){let e=o;return t&&(e=e.replace(/currentColor/g,t),!e.includes("fill=")&&!e.includes("stroke=")&&(e=e.replace("<svg",`<svg fill="${t}"`))),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}class vn{constructor(){this.iconRegistry=new Map,this.svgDataUrlCache=new Map,this.spriteCache=new Map,this.pendingLoads=new Set,this.loadListeners=new Set,this.inFlightCount=0,this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0}}onLoad(t){return this.loadListeners.add(t),()=>this.loadListeners.delete(t)}register(t,e={}){const i=Array.isArray(t)?t:Object.entries(t).map(([r,n])=>({name:r,svg:n}));for(const{name:r,svg:n}of i)r&&n&&(e.overwrite||!this.iconRegistry.has(r))&&this.iconRegistry.set(r,n);return this}getSprite(t,e,i){const r=this.resolveKey(t,e,i);if(!r)return null;this.stats.requests++;const n=this.spriteCache.get(r.key);return n?(this.stats.hits++,n):(this.stats.misses++,this.loadSprite(r.key,r.url,e,!0),null)}preload(t,e){const i=Array.isArray(t)?t:[t];for(const r of i){const n=this.resolveKey(r,e.size,e.color);n&&this.loadSprite(n.key,n.url,e.size,!1)}return this}draw(t,e,i,r,n,s){const a=this.getSprite(e,n,s);if(a){const c=n*Ve();t.drawImage(a,0,0,c,c,i,r,n,n)}}getImageDirect(t){return t&&t instanceof HTMLImageElement&&t.complete&&t.naturalHeight!==0?t:null}getStats(){return{...this.stats}}reset(){return this.spriteCache.clear(),this.svgDataUrlCache.clear(),this.pendingLoads.clear(),this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0},this}clearSpriteCache(){return this.spriteCache.clear(),this.pendingLoads.clear(),this.stats.cacheSize=0,this}has(t){return this.iconRegistry.has(t)}getSvg(t){return this.iconRegistry.get(t)}resolveKey(t,e,i){if(!t||e<=0)return null;const r=e*Ve();if(typeof t=="string"){const{key:n,url:s}=this.resolveIconUrl(t,i);return{key:`${n}@${r}`,url:s}}return t instanceof HTMLImageElement?{key:`img:${t.src}:${i??""}@${r}`,url:t.src}:null}resolveIconUrl(t,e){const i=e??"",r=this.iconRegistry.get(t);if(r){const s=`r:${t}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Ui(r,e)),{key:s,url:this.svgDataUrlCache.get(s)}}const n=t.trimStart();if(n.startsWith("<svg")){const s=`s:${Cn(n)}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Ui(n,e)),{key:s,url:this.svgDataUrlCache.get(s)}}return{key:`u:${t}:${i}`,url:t}}loadSprite(t,e,i,r){var a;if(this.spriteCache.has(t)||this.pendingLoads.has(t))return;this.pendingLoads.add(t),this.inFlightCount++,this.stats.inFlight=this.inFlightCount;const n=new Image;n.src=e;const s=i*Ve();(a=n.decode)==null||a.call(n).then(()=>{const c=document.createElement("canvas");c.width=s,c.height=s;const u=c.getContext("2d");u&&(u.drawImage(n,0,0,s,s),this.spriteCache.set(t,c),this.stats.cacheSize=this.spriteCache.size),r&&this.notifyListeners()}).catch(()=>{}).finally(()=>{this.pendingLoads.delete(t),this.inFlightCount--,this.stats.inFlight=this.inFlightCount,!r&&this.inFlightCount===0&&this.notifyListeners()})}notifyListeners(){this.loadListeners.forEach(t=>t())}}const Tt=new vn;function mn(o){return Tt.onLoad(o)}function Xa(o,t={}){Tt.register(o,t)}function pn(o,t,e){return Tt.getSprite(o,t,e)}function yn(o,t){Tt.preload(o,t)}function Fn(o,t,e,i,r,n){Tt.draw(o,t,e,i,r,n)}function bn(o,t){return Tt.getImageDirect(o)}function Va(){return Tt.getStats()}function Ya(){Tt.clearSpriteCache()}const qa=Fn;function Ct(o,t,e,i,r,n){if(!t||r<=0)return;const s=pn(t,r,n);if(s){o.drawImage(s,e,i,r,r);return}const a=bn(t);a&&o.drawImage(a,e,i,r,r)}function wn(o,t,e,i,r,n,s,a="primary",c=!1,u=!1,h,l,d,f=uo){const g=oe,v=r-g*2,C=Math.min(v-re,nn),y=s.baseFontFull,p=d?mo(d,n,y):0,F=po(i,p,C,f,h,l),w=e+g,S=zt(u,{x:t,y:e,width:F,height:r}),b=Fo(s,a,c,S),T=t+F*.5,E=w+v*.5;o.roundedRect(t,w,F,v,ho,{fillStyle:b.bgColor,strokeStyle:b.borderColor,lineWidth:Et});const I=yo(p,C,f,h,l);let B=T-I*.5;if(h){const W=E-C*.5;Ct(o,h,B,W,C,b.textColor),B+=C+f}if(o.fillText(n,B,E,y,b.textColor,"middle","left"),l){const W=B+p+f,O=E-C*.5;Ct(o,l,W,O,C,b.textColor)}return{x:t,y:w,width:F,height:v,actualWidth:F}}function xn(o,t,e,i,r,n=ai,s=si,a=!1,c=!1,u,h,l,d=uo,f){const g=at[s],v=f?f[n]:ni[n],C=`${g.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,y=l?mo(l,r,C):0,p=po(i,y,g.iconSize,d,u,h),F=zt(c,{x:t,y:e,width:p,height:g.height}),w=bo(v,a,F),S=t+p*.5,b=e+g.height*.5;w.bgColor!=="transparent"?o.roundedRect(t,e,p,g.height,g.borderRadius,{fillStyle:w.bgColor,strokeStyle:w.borderColor!=="transparent"?w.borderColor:void 0,lineWidth:w.borderColor!=="transparent"?Et:0}):w.borderColor!=="transparent"&&o.roundedRect(t,e,p,g.height,g.borderRadius,{fillStyle:w.bgColor,strokeStyle:w.borderColor,lineWidth:Et});const T=yo(y,g.iconSize,d,u,h);let E=S-T*.5;if(u){const I=b-g.iconSize*.5;Ct(o,u,E,I,g.iconSize,w.textColor),E+=g.iconSize+d}if(o.fillText(r,E,b,C,w.textColor,"middle","left"),h){const I=E+y+d,B=b-g.iconSize*.5;Ct(o,h,I,B,g.iconSize,w.textColor)}return{x:t,y:e,width:p,height:g.height,actualWidth:p}}const Ka={100:"FF",90:"E6",80:"CC",75:"BF",70:"B3",60:"99",50:"80",40:"66",30:"4D",25:"40",20:"33",10:"1A",0:"00"},Za=(o,t)=>o.length!==6?o:o.slice(0,4)+Ka[t],Yt="transparent",ja=Object.fromEntries(Object.entries(ni).map(([o,t])=>o==="secondary"?[o,{bgColor:Yt,borderColor:Yt,textColor:"#485056B0",bgColorHover:Yt,iconColor:"#485056B0",iconColorHovered:"#485056FF"}]:[o,{bgColor:Yt,borderColor:Yt,textColor:t.bgColor,bgColorHover:Yt,iconColor:t.bgColor,iconColorHovered:t.bgColorHover}]));function Sn(o,t,e,i,r=ai,n=si,s=!1,a=!1,c){const u=at[n],h=ja[r],l=(c==null?void 0:c.overrideSquareSize)??u.height,d=(c==null?void 0:c.overrideIconSize)??u.iconSize,f=zt(a,{x:t,y:e,width:l,height:l}),g=h,v=t+l*.5,C=e+l*.5,y=v-d*.5,p=C-d*.5;g.bgColor!=="transparent"?o.roundedRect(t,e,l,l,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor!=="transparent"?g.borderColor:void 0,lineWidth:g.borderColor!=="transparent"?Et:0}):g.borderColor!=="transparent"&&o.roundedRect(t,e,l,l,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor,lineWidth:Et});const F=(c==null?void 0:c.iconColor)??g.iconColor,w=(c==null?void 0:c.iconColorHovered)??(c==null?void 0:c.iconColor)??g.iconColorHovered,S=s?Za(F,40):f?w:F;return Ct(o,i,y,p,d,S),{x:t,y:e,width:l,height:l}}function xo(o,t,e,i,r,n,s,a="primary",c=!1,u=!1){const h=oe,l=r-h*2,d=Math.min(l-re,lo),f=i==="auto"?d:i,g=e+h,v=zt(u,{x:t,y:e,width:f,height:r}),C=Fo(s,a,c,v),y=t+f*.5,p=g+l*.5,F=y-d*.5,w=p-d*.5;return o.roundedRect(t,g,f,l,ho,{fillStyle:C.bgColor,strokeStyle:C.borderColor,lineWidth:Et}),Ct(o,n,F,w,d,C.iconColor),{x:t,y:g,width:f,height:l}}function An(o,t,e,i,r=ai,n=si,s=!1,a=!1){const c=at[n],u=ni[r],h=c.height,l=zt(a,{x:t,y:e,width:h,height:h}),d=bo(u,s,l),f=t+h*.5,g=e+h*.5,v=f-c.iconSize*.5,C=g-c.iconSize*.5;return d.bgColor!=="transparent"?o.roundedRect(t,e,h,h,c.borderRadius,{fillStyle:d.bgColor,strokeStyle:d.borderColor!=="transparent"?d.borderColor:void 0,lineWidth:d.borderColor!=="transparent"?Et:0}):d.borderColor!=="transparent"&&o.roundedRect(t,e,h,h,c.borderRadius,{fillStyle:d.bgColor,strokeStyle:d.borderColor,lineWidth:Et}),Ct(o,i,v,C,c.iconSize,d.iconColor),{x:t,y:e,width:h,height:h}}const cr={xs:{height:16,fontSize:10,paddingX:4,borderRadius:4},s:{height:20,fontSize:11,paddingX:6,borderRadius:5},m:{height:24,fontSize:12,paddingX:8,borderRadius:6},l:{height:28,fontSize:13,paddingX:10,borderRadius:7}};function Ja(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorTransparent:o.surfaceTransparentSecondary,textColor:o.inverseTextPrimary,textColorOnTransparent:o.textPrimary},accent:{bgColor:o.surfaceAccent,bgColorTransparent:o.surfaceTransparentAccent,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textAccent},positive:{bgColor:o.surfacePositive,bgColorTransparent:o.surfaceTransparentPositive,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textPositive},warning:{bgColor:o.surfaceWarning,bgColorTransparent:o.surfaceTransparentWarning,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textWarning},negative:{bgColor:o.surfaceNegative,bgColorTransparent:o.surfaceTransparentNegative,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textNegative},dark:{bgColor:o.onLightSurfaceSolidDefault,bgColorTransparent:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.onLightTextPrimary},light:{bgColor:o.onDarkSurfaceSolidDefault,bgColorTransparent:o.onDarkSurfaceTransparentCard,textColor:o.onLightTextPrimary,textColorOnTransparent:o.onDarkTextPrimary}}}const Qa="|",Oe=6,lr=new Map,hr={xs:10,s:12,m:14,l:16};class En extends vt{constructor(t,e,i){var r;super(t),this.view="default",this.size="s",this.transparent=!1,this.clear=!1,this.pilled=!1,this.viewColors={},this.text=e,i&&(i.view!==void 0&&(this.view=i.view),i.size!==void 0&&(this.size=i.size),i.transparent!==void 0&&(this.transparent=i.transparent),i.clear!==void 0&&(this.clear=i.clear),i.pilled!==void 0&&(this.pilled=i.pilled),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,this.customColor=i.customColor,this.customBackgroundColor=i.customBackgroundColor,(r=i.theme)!=null&&r.tokens&&(this.viewColors=Ja(i.theme.tokens)))}measure(t){const e=cr[this.size],i=hr[this.size],r=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,n=ur(t,r,this.text),s=this.text.length>0;let a=0;this.leftIcon&&(a+=i+(s?Oe:0)),this.rightIcon&&(a+=i+(s?Oe:0)),this.rect.width=n+a+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,a=cr[this.size],c=hr[this.size],u=this.viewColors[this.view];if(!u)return;const h=`${a.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`;let l,d;if(this.clear?(l="transparent",d=this.customColor??u.textColorOnTransparent):this.transparent?(l=this.customBackgroundColor??u.bgColorTransparent,d=this.customColor??u.textColorOnTransparent):(l=this.customBackgroundColor??u.bgColor,d=this.customColor??u.textColor),!this.clear){const v=this.pilled?s/2:a.borderRadius;t.roundedRect(i,r,n,s,v,{fillStyle:l})}const f=r+s/2;let g=i+a.paddingX;if(this.leftIcon){const v=f-c/2;Ct(t,this.leftIcon,g,v,c,d),g+=c+Oe}if(t.fillText(this.text,g,f,h,d,"middle"),this.rightIcon){const v=ur(e,h,this.text),C=g+v+Oe,y=f-c/2;Ct(t,this.rightIcon,C,y,c,d)}}}function ur(o,t,e){const i=`${t}${Qa}${e}`;let r=lr.get(i);return r===void 0&&(o.font=t,r=o.measureText(e).width,lr.set(i,r)),r}const tc="default",ec="s",Ei="pointer",Ne=8,ic={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e",baseFontFull:"13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},dr=new Map;class Tn extends vt{constructor(t,e,i){var r;super(t),this.variant="primary",this.view=tc,this.size=ec,this.disabled=!1,this.isHovered=!1,this.useNewApi=!1,this.text=e,super.style={...super.style,cursor:Ei},i&&(i.view!==void 0?(this.view=i.view,this.useNewApi=!0):i.variant!==void 0&&(this.variant=i.variant),i.size!==void 0&&(this.size=i.size,this.useNewApi=!0),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,i.disabled!==void 0&&(this.disabled=i.disabled),i.onClick&&(this.onClick=i.onClick),(r=i.theme)!=null&&r.tokens&&(this.viewColors=rn(i.theme.tokens)))}set style(t){super.style={...super.style,cursor:Ei,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Ei),t}measure(t){const e=at[this.size],i=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,r=oc(t,this.text,i);let n=0;this.leftIcon&&(n+=e.iconSize+Ne),this.rightIcon&&(n+=e.iconSize+Ne),this.rect.width=r+n+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n}=this.rect;if(this.useNewApi)xn(t,i,r,n,this.text,this.view,this.size,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Ne,this.viewColors);else{const s=at[this.size];wn(t,i,r,n,s.height,this.text,ic,this.variant,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Ne)}}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function oc(o,t,e){const i=`${e}|${t}`;let r=dr.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,dr.set(i,r)),r}const fr=16,gr="black",Cr=0,rc=Math.PI/2,nc=1.8,qt={startX:-3.5,startY:-4.25,middleX:2.75,middleY:0,endX:-3.5,endY:4.25};class sc extends vt{constructor(t,e={}){super(t),this.rotation=Cr,this.color=gr,this.rotation=e.rotation??Cr,this.color=e.color??gr,this.rect.width=fr,this.rect.height=fr}measure(t){}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,a=i+n/2,c=r+s/2,u=this.rotation*rc;t.custom(h=>{h.save(),h.translate(a,c),h.rotate(u),h.strokeStyle=this.color,h.lineWidth=nc,h.lineCap="round",h.lineJoin="round",h.beginPath(),h.moveTo(qt.startX,qt.startY),h.lineTo(qt.middleX,qt.middleY),h.lineTo(qt.endX,qt.endY),h.stroke(),h.restore()})}}const ac=28,cc="default",lc="s",hc="pointer",uc=20,dc={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Xi extends vt{constructor(t,e,i){super(t),this.view=cc,this.buttonSize=lc,this.isHovered=!1,this.useNewApi=!1,this.getDisabled=()=>this.disabled?"default":hc,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:this.getDisabled()},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),(i==null?void 0:i.overrideSquareSize)!==void 0&&(this.overrideSquareSize=i.overrideSquareSize),(i==null?void 0:i.overrideIconSize)!==void 0&&(this.overrideIconSize=i.overrideIconSize),(i==null?void 0:i.overrideWidth)!==void 0&&(this.overrideWidth=i.overrideWidth),(i==null?void 0:i.iconColor)!==void 0&&(this.iconColor=i.iconColor),(i==null?void 0:i.iconColorHovered)!==void 0&&(this.iconColorHovered=i.iconColorHovered),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:this.getDisabled(),...t}}get style(){const t=super.style;return t.cursor||(t.cursor=this.getDisabled()),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize],i=this.overrideSquareSize??e.height;this.rect.height=i,this.rect.width=this.overrideWidth??i}else{const e=vr(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.useNewApi){const a=this.overrideSquareSize!==void 0||this.overrideIconSize!==void 0||this.iconColor!==void 0||this.iconColorHovered!==void 0?{overrideSquareSize:this.overrideSquareSize,overrideIconSize:this.overrideIconSize,iconColor:this.iconColor,iconColorHovered:this.iconColorHovered}:void 0;if(Sn(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered,a),Mt.DEBUG){const c=at[this.buttonSize],u=this.overrideSquareSize??c.height,h=this.overrideIconSize??c.iconSize,l=i+(u-h)*.5,d=r+(u-h)*.5;t.strokeRect(l,d,h,h,"cyan",1)}}else xo(t,i,r,n,s,this.icon,dc,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=at[this.buttonSize],s=this.overrideSquareSize??n.height,a={x:this.rect.x,y:this.rect.y,width:this.overrideWidth??s,height:s};return mr(t,e,a)}const i=vr(this.size,this.rect.height),r=fc(this.rect.x,this.rect.y,i);return mr(t,e,r)}}function vr(o,t){const e=typeof o=="number"?o:t??ac,i=0,r=oe,n=Math.min(e-r*2-re,uc),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function fc(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function mr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const gc=16,Cc="transparent";class In extends vt{constructor(t,e,i){super(t),this.icon=e,this.size=(i==null?void 0:i.size)??gc,this.color=i==null?void 0:i.color}measure(t){this.rect.width=this.size,this.rect.height=this.size}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.backgroundColor&&this.backgroundColor!==Cc&&t.fillRect(i,r,n,s,this.backgroundColor),Ct(t,this.icon,i,r,this.size,this.color)}}const vc=28,mc="default",pc="s",Ti="pointer",yc=20,Fc={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Dn extends vt{constructor(t,e,i){super(t),this.view=mc,this.buttonSize=pc,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:Ti},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:Ti,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Ti),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=pr(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.useNewApi?An(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered):xo(t,i,r,n,s,this.icon,Fc,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=at[this.buttonSize],s={x:this.rect.x,y:this.rect.y,width:n.height,height:n.height};return yr(t,e,s)}const i=pr(this.size,this.rect.height),r=bc(this.rect.x,this.rect.y,i);return yr(t,e,r)}}function pr(o,t){const e=typeof o=="number"?o:t??vc,i=0,r=oe,n=Math.min(e-r*2-re,yc),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function bc(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function yr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}class So extends vt{constructor(t,e){super(t),this.options=e,this.style={flexShrink:0}}set style(t){super.style={...super.style,...t}}get style(){return super.style}measure(){typeof this.style.width=="number"&&(this.rect.width=this.style.width),typeof this.style.height=="number"&&(this.rect.height=this.style.height)}onPaint(t){const e=en(this.options.src,t.imageResources);if(!e)return;const i={...this.rect};t.custom(r=>{r.save();try{r.beginPath(),r.rect(i.x,i.y,i.width,i.height),r.clip(),on(r,e,i,this.options.fit??"cover")}finally{r.restore()}})}}function wc(o,t){const e=o.replace("#","");let i,r,n,s=255;e.length===3||e.length===4?(i=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),e.length===4&&(s=parseInt(e[3]+e[3],16))):(i=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),e.length===8&&(s=parseInt(e.slice(6,8),16)));const a=Math.round(s*t),c=u=>u.toString(16).padStart(2,"0");return`#${c(i)}${c(r)}${c(n)}${c(a)}`}const Hn="|",xc=2,Sc=1e4,Vi=new Map,Yi=new Map;function Ln(o,t,e){o.size>=Sc&&o.clear(),o.set(t,e)}function Ac(o,t){return`${o}${Hn}${t}`}function Ec({text:o,font:t,maxWidth:e,textOverflow:i,ellipsis:r,forceEllipsis:n}){return[t,o,e.toFixed(xc),i,r,n?"force":"normal"].join(Hn)}function qi(o,t,e){const i=Ac(e,t);let r=Vi.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Ln(Vi,i,r)),r}function Tc(o){const t=typeof Intl<"u"?Intl.Segmenter:void 0;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(o),({segment:i})=>i)}return Array.from(o)}function Ic(o,t,e,i,r){const n=qi(o,r,e);if(n>i)return{text:"",didTruncate:!0,width:0};const s=Tc(t);let a=0,c=s.length,u=r,h=n;for(;a<=c;){const l=Math.floor((a+c)/2),d=`${s.slice(0,l).join("")}${r}`,f=qi(o,d,e);f<=i?(u=d,h=f,a=l+1):c=l-1}return{text:u,didTruncate:!0,width:h}}function Ki(o){const{ctx:t,text:e,font:i,maxWidth:r,textOverflow:n,ellipsis:s,forceEllipsis:a=!1}=o,c=Math.max(0,r);if(c<=0||e.length===0&&!(a&&n==="ellipsis"))return{text:"",didTruncate:e.length>0,width:0};const u=Ec({text:e,font:i,maxWidth:c,textOverflow:n,ellipsis:s,forceEllipsis:a}),h=Yi.get(u);if(h)return h;const l=qi(t,e,i);let d;return l<=c&&!a?d={text:e,didTruncate:!1,width:l}:n==="clip"?d={text:e,didTruncate:!0,width:l}:d=Ic(t,e,i,c,s),Ln(Yi,u,d),d}function Fr({ctx:o,lines:t,font:e,maxWidth:i,maxLines:r,textOverflow:n,ellipsis:s}){const a=Math.max(0,Math.floor(r)),c=Math.min(t.length,a),u=t.slice(0,c),h=t.length>c;if(n==="ellipsis"&&u.length>0){const l=u.length-1,d=u[l]??"";u[l]=Ki({ctx:o,text:d,font:e,maxWidth:i,textOverflow:n,ellipsis:s,forceEllipsis:h}).text}return{lines:u,didClamp:h}}function Dc(){Vi.clear(),Yi.clear()}const Hc="14px sans-serif",Lc="black",Pc=1,Bc=14,_c="visible",Rc="clip",kc="…",Mc=/(\d*\.?\d+)px/,yt="|",zc=30,Oc=`${yt}precise-wrap`,Nc=1e4,Wc=5e3,Gc=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F\u200D\uFE0E\uFE0F\u2600-\u27BF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/,Zi=new Map,ji=new Map,Ji=new Map;let Ii=null;function $c(){return Ii===null&&typeof document<"u"&&(Ii=document.createElement("canvas").getContext("2d")),Ii}function Pn(o,t,e,i){o.size>=i&&o.clear(),o.set(t,e)}function Uc(o,t,e,i){return`${o}${yt}${t}${yt}${e??""}${yt}${i??""}`}function Xc(o,t){return`${o}${yt}${t}`}function Vc(o,t,e){return`${o}${yt}${t}${yt}${e}`}function Bn(o,t,e,i){return`${o}${yt}${t}${yt}${e}${yt}${i}`}class Ao extends Mt{constructor(t,e,i){super(t),this.font=Hc,this.color=Lc,this.wordWrap=!1,this.lineHeight=Pc,this.overflow=_c,this.textOverflow=Rc,this.ellipsis=kc,this.lastMeasureKey="",this.cachedLines=null,this.cachedLinesKey="",this.lastPaintedTextWidth=0,this.text=e,i&&(i.font&&(this.font=i.font),i.fontSize!==void 0&&(this.fontSize=i.fontSize),i.lineHeightPx!==void 0&&(this.lineHeightPx=i.lineHeightPx),i.color&&(this.color=i.color),i.wordWrap!==void 0&&(this.wordWrap=i.wordWrap),i.lineHeight!==void 0&&(this.lineHeight=i.lineHeight,this.lineHeightPx=void 0),i.overflow!==void 0&&(this.overflow=i.overflow),i.textOverflow!==void 0&&(this.textOverflow=i.textOverflow),i.ellipsis!==void 0&&(this.ellipsis=i.ellipsis),i.maxLines!==void 0&&(this.maxLines=i.maxLines),i.autoTooltip!==void 0&&(this.autoTooltip=i.autoTooltip))}measure(t){const{font:e,text:i,wordWrap:r,lineHeight:n,rect:s,fontSize:a}=this,{lineHeightPx:c}=br(e,n,a,this.lineHeightPx);this.isSingleLineClampEnabled()?this.measureSingleLineClamp(t,e,i,c,s):r?this.measureWordWrap(t,e,i,c,s):this.measureSingleLine(t,e,i,c,s)}measureWordWrap(t,e,i,r,n){const s=wr(this.style.width,n.width);if(s>0){const a=this.getResolvedMaxLines(),u=!(this.overflow==="hidden"&&a!==void 0&&a>1&&qc(i)),h=Bn(e,i,s,u);(h!==this.cachedLinesKey||this.cachedLines===null)&&(this.cachedLines=Yc(t,i,e,s,u),this.cachedLinesKey=h),n.width=s;const l=a!==void 0&&this.overflow==="hidden"?Math.min(this.cachedLines.length,a):this.cachedLines.length;n.height=l*r}else n.width=We(t,i,e),n.height=r,this.cachedLines=null}measureSingleLineClamp(t,e,i,r,n){const s=wr(this.style.width,n.width);s>0?(n.width=s,n.height=r):(n.width=We(t,i,e),n.height=r),this.cachedLines=null}measureSingleLine(t,e,i,r,n){const s=Vc(e,i,r);s!==this.lastMeasureKey&&(this.lastMeasureKey=s,n.width=We(t,i,e),n.height=r),this.cachedLines=null}getLastPaintedTextWidth(){return this.lastPaintedTextWidth}getTooltip(){if(this.tooltip)return this.tooltip;const t=this.autoTooltip;if(!t)return;const e=typeof t=="object"?t:void 0;if(!(e?e.enabled!==!1:t===!0)||!this.computeIsTruncated())return;let r=this.text;if(e&&typeof e.text=="function"?r=e.text(this.text):e&&typeof e.text=="string"&&(r=e.text),r===null||r==="")return;if(!e)return r;const{enabled:n,text:s,...a}=e;return{...a,text:r}}computeIsTruncated(){if(this.overflow!=="hidden"||this.textOverflow!=="ellipsis")return!1;const t=$c();if(!t)return!1;const e=this.cachedLines;if(e!==null&&e.length>0){const i=this.getResolvedMaxLines();return i===void 0?!1:Fr({ctx:t,lines:e,font:this.font,maxWidth:this.rect.width,maxLines:i,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didClamp}return Ki({ctx:t,text:this.text,font:this.font,maxWidth:this.rect.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didTruncate}getResolvedMaxLines(){if(this.maxLines===void 0||!Number.isFinite(this.maxLines)||this.maxLines<=0)return;const t=Math.floor(this.maxLines);return t>0?t:void 0}isSingleLineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()===1}isMultilineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()!==void 0}onPaint(t,e){const{font:i,text:r,rect:n,color:s}=this,a=this.cachedLines;a!==null&&a.length>0?this.paintMultiline(t,e,i,s,a,n):this.paintSingleLine(t,e,r,i,s,n)}paintMultiline(t,e,i,r,n,s){const{lineHeightPx:a}=br(i,this.lineHeight,this.fontSize,this.lineHeightPx),c=this.getResolvedMaxLines(),u=this.isMultilineClampEnabled()&&c!==void 0?Fr({ctx:e,lines:n,font:i,maxWidth:s.width,maxLines:c,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).lines:n,h=u.length*a;let l=s.y+Math.max(0,(s.height-h)*.5);this.lastPaintedTextWidth=0;for(let d=0,f=u.length;d<f;d+=1){const g=u[d];if(g!==void 0){const v=l+a/2;this.overflow==="hidden"?t.fillTextClipped(g,s.x,v,i,r,s,"middle","left"):t.fillText(g,s.x,v,i,r,"middle"),l+=a}}}paintSingleLine(t,e,i,r,n,s){const a=s.y+s.height*.5;if(this.overflow==="hidden"){const c=Ki({ctx:e,text:i,font:r,maxWidth:s.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis});if(this.lastPaintedTextWidth=Math.min(c.width,Math.max(0,s.width)),c.text.length===0)return;t.fillTextClipped(c.text,s.x,a,r,n,s,"middle","left");return}this.lastPaintedTextWidth=We(e,i,r),t.fillText(i,s.x,a,r,n,"middle")}}function br(o,t,e,i){const r=Uc(o,t,e,i);let n=Zi.get(r);if(n===void 0){const s=Mc.exec(o),a=e??(s&&s[1]!==void 0?Number(s[1]):Bc);n={fontSize:a,lineHeightPx:i??a*t},Zi.set(r,n)}return n}function We(o,t,e){const i=Xc(e,t);let r=ji.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Pn(ji,i,r,Nc)),r}function Yc(o,t,e,i,r){o.font=e;const n=Math.max(i,zc),s=Bn(e,t,n,r);let a=Ji.get(s);if(!a){const c=r?e:`${e}${Oc}`;a=Kc(la.split(o,t,c,n,r)),Pn(Ji,s,a,Wc)}return a}function wr(o,t){return typeof o=="number"&&o>0?o:t>0?t:0}function qc(o){return Gc.test(o)}function Kc(o){if(Array.isArray(o))return o;const t=o;return t.lines&&Array.isArray(t.lines)?t.lines:[]}function Zc(){Zi.clear(),ji.clear(),Ji.clear(),Dc()}function jc(o){return{default:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive},accent:{color:o.textAccent,colorHover:o.textAccentHover,colorActive:o.textAccentActive},secondary:{color:o.textSecondary,colorHover:o.textSecondaryHover,colorActive:o.textSecondaryActive},tertiary:{color:o.textTertiary,colorHover:o.textTertiaryHover,colorActive:o.textTertiaryActive},paragraph:{color:o.textParagraph,colorHover:o.textParagraphHover,colorActive:o.textParagraphActive},positive:{color:o.textPositive,colorHover:o.textPositiveHover,colorActive:o.textPositiveActive},warning:{color:o.textWarning,colorHover:o.textWarningHover,colorActive:o.textWarningActive},negative:{color:o.textNegative,colorHover:o.textNegativeHover,colorActive:o.textNegativeActive},clear:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive}}}const Jc="default",Di="pointer",Qc=.4,tl=2,el=1;class _n extends Ao{constructor(t,e,i){var r;super(t,e,i),this.view=Jc,this.disabled=!1,this.isHovered=!1,this.isActive=!1,this.hasCustomColor=!1,super.style={...super.style,cursor:Di},i&&(this.href=i.href,this.target=i.target,this.rel=i.rel,i.view!==void 0&&(this.view=i.view),i.disabled!==void 0&&(this.disabled=i.disabled),this.hasCustomColor=i.color!==void 0,(r=i.theme)!=null&&r.tokens&&(this.viewColors=jc(i.theme.tokens))),!this.hasCustomColor&&this.viewColors&&(this.color=this.viewColors[this.view].color)}set style(t){super.style={...super.style,cursor:Di,...t}}get style(){const t=super.style;return t.cursor=this.disabled?"not-allowed":Di,t}setOnClick(t){this.customClickHandler=t}resolveColor(){let t;if(this.hasCustomColor||!this.viewColors)t=this.color;else{const e=this.viewColors[this.view];this.isActive?t=e.colorActive:this.isHovered?t=e.colorHover:t=e.color}return this.disabled&&(t=wc(t,Qc)),t}onPaint(t,e){const i=this.color;this.color=this.resolveColor(),super.onPaint(t,e);const{view:r,isHovered:n,wordWrap:s}=this,c=!s&&(r==="default"||r==="clear"||!this.disabled&&n),u=this.getLastPaintedTextWidth();c&&u>0&&this.paintUnderline(t,u),this.color=i}paintUnderline(t,e){const{x:i,y:r,height:n}=this.rect,s=r+n+tl,a=this.resolveColor();t.custom(c=>{c.beginPath(),c.moveTo(i,s),c.lineTo(i+e,s),c.strokeStyle=a,c.lineWidth=el,c.stroke()})}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1,this.isActive=!1}onMouseDown(){this.disabled||(this.isActive=!0)}onMouseUp(){this.isActive=!1}onClick(t){if(this.disabled)return;let e=!1;const i=t.preventDefault;t.preventDefault=()=>{e=!0,i.call(t)},!(this.customClickHandler&&(this.customClickHandler(t),e))&&this.navigate()}navigate(){if(!this.href)return;const t=this.target||"_self";if(t==="_self")window.location.href=this.href;else{const e=this.rel??(t==="_blank"?"noopener,noreferrer":void 0);window.open(this.href,t,e)}}}const le="transparent",il=0;class Rn extends vt{constructor(t,e=le){super(t),this.color=le,this.borderColor=le,this.borderWidth=il,this.color=e}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.color!==le&&t.fillRect(i,r,n,s,this.color),this.borderWidth>0&&this.borderColor!==le){const a=this.borderWidth/2;t.strokeRect(i+a,r+a,n-this.borderWidth,s-this.borderWidth,this.borderColor,this.borderWidth)}}}const de={250:15.625,32:2,28:1.75,24:1.5,20:1.25,18:1.125,16:1,14:.875,12:.75,8:.5,0:0},xr=16,he=16,kn=90,Sr="rgba(8, 8, 8, 0.08)",ol=4e3,rl=1920,nl="linear-gradient( 90deg, rgba(8, 8, 8, 0.09) 0%, rgba(8, 8, 8, 0.08) 6.25%, rgba(8, 8, 8, 0.05) 12.5%, rgba(8, 8, 8, 0.01) 25%, rgba(8, 8, 8, 0.05) 37.5%, rgba(8, 8, 8, 0.08) 43.75%, rgba(8, 8, 8, 0.09) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.05) 62.5%, rgba(8, 8, 8, 0.01) 75%, rgba(8, 8, 8, 0.05) 87.5%, rgba(8, 8, 8, 0.08) 93.75%, rgba(8, 8, 8, 0.09) 100% )",sl="linear-gradient( 90deg, rgba(8, 8, 8, 0.36) 0%, rgba(8, 8, 8, 0.32) 6.25%, rgba(8, 8, 8, 0.20) 12.5%, rgba(8, 8, 8, 0.04) 25%, rgba(8, 8, 8, 0.20) 37.5%, rgba(8, 8, 8, 0.32) 43.75%, rgba(8, 8, 8, 0.36) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.20) 62.5%, rgba(8, 8, 8, 0.04) 75%, rgba(8, 8, 8, 0.20) 87.5%, rgba(8, 8, 8, 0.32) 93.75%, rgba(8, 8, 8, 0.36) 100% )";let Ar=null;const al={right:90,left:270,top:0,bottom:180,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225,"top left":315,"left top":315};class Mn extends vt{constructor(t,e){super(t),this._gradientStops=null,this._gradientAngle=kn;const i=(e==null?void 0:e.customGradientColor)??(e!=null&&e.lighter?sl:nl),r=ul(i);r&&(this._gradientStops=r.stops,this._gradientAngle=r.angle),this.borderRadius=cl(e==null?void 0:e.roundness),this.animated=(e==null?void 0:e.animated)??!0,this.shimmerDuration=(e==null?void 0:e.shimmerDuration)??ol}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){var f;const{x:i,y:r,width:n,height:s}=this.rect;if(n<=0||s<=0)return;const{_gradientStops:a,borderRadius:c}=this;if(!a||a.length<2){c>0?t.roundedRect(i,r,n,s,c,{fillStyle:Sr}):t.fillRect(i,r,n,s,Sr);return}const u=t.getAnimationContext(),h=u==null?void 0:u.frameTime;if(!this.animated||h===void 0){t.linearGradientRect(i,r,n,s,c,a,this._gradientAngle);return}Ar??(Ar=h);const d=(h-Ar)%this.shimmerDuration/this.shimmerDuration;t.custom(g=>{g.save(),g.beginPath(),c>0?g.roundRect(i,r,n,s,c):g.rect(i,r,n,s),g.clip();const{startX:v,startY:C,endX:y,endY:p}=dl(i,r,s,d),F=g.createLinearGradient(v,C,y,p);for(const w of a)F.addColorStop(w.offset,w.color);g.fillStyle=F,g.fillRect(i,r,n,s),g.restore()}),(f=u==null?void 0:u.requestAnimationFrame)==null||f.call(u)}}function Er(o){return o in de}function cl(o){if(o===void 0)return de[xr]*he;if(typeof o=="number")return Er(o)?de[o]*he:o;const t=o.trim(),e=Number(t);if(!Number.isNaN(e))return Er(e)?de[e]*he:e;const i=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(i){const[,n]=i;return parseFloat(n)}const r=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(r){const[,n]=r;return parseFloat(n)*he}return de[xr]*he}function ll(o){var i;const t=o.trim(),e=t.match(/^var\s*\(\s*[^,]+,\s*([\s\S]+)\s*\)$/i);return((i=e==null?void 0:e[1])==null?void 0:i.trim())??t}function hl(o,t){switch(t.toLowerCase()){case"rad":return o*180/Math.PI;case"turn":return o*360;case"grad":return o*180/200;default:return o}}function ul(o){const e=ll(o).match(/^linear-gradient\s*\(([\s\S]+)\)$/i);if(!(e!=null&&e[1]))return null;const i=[];let r="",n=0;for(const d of e[1])d==="("&&n++,d===")"&&n--,d===","&&n===0?(i.push(r.trim()),r=""):r+=d;r.trim()&&i.push(r.trim());const[s]=i;if(i.length<2||!s)return null;let a=kn,c=0;const u=s.match(/^(-?\d+(?:\.\d+)?)(deg|rad|turn|grad)?$/i);if(u!=null&&u[1]){const[,d,f="deg"]=u;a=hl(parseFloat(d),f),c=1}else if(s.startsWith("to ")){const d=s.substring(3).trim().toLowerCase(),f=al[d];f!==void 0&&(a=f,c=1)}const h=[],l=i.slice(c);for(let d=0;d<l.length;d++){const f=l[d];if(!f)continue;const g=f.trim().match(/^(#[0-9a-fA-F]{3,8}|rgba?\s*\([^)]+\)|hsla?\s*\([^)]+\)|[a-zA-Z]+)(?:\s+(-?\d+(?:\.\d+)?)(%))?$/);if(!(g!=null&&g[1]))continue;const[,v,C,y]=g,p=y==="%"?parseFloat(C)/100:l.length>1?d/(l.length-1):0;h.push({offset:Math.max(0,Math.min(1,p)),color:v})}return h.length<2?null:{stops:h,angle:a}}function dl(o,t,e,i){const r=rl,n=i*r,s=o-r+n,a=o+r+n,c=t+e/2;return{startX:s,startY:c,endX:a,endY:c}}let fe=0;const Ze=new Set;function fl(){fe++,fe===1&&Ze.forEach(t=>t(!0));let o=!1;return()=>{o||(o=!0,fe--,fe===0&&Ze.forEach(t=>t(!1)))}}function gl(){return fe>0}function Cl(o){return Ze.add(o),()=>{Ze.delete(o)}}const je="basic-grid-canvas-portal-hover",vl=400;let ml=0;const Hi="__canvasPortalTargetId";function pl(o){var i;if(!o)return"window";const t=o;if((i=t.dataset)!=null&&i.portalTargetId)return t.dataset.portalTargetId;const e=o;return e[Hi]||(e[Hi]=++ml),String(e[Hi])}const ie=new Map;function yl(o,t){return`${o??"default"}:${t??"default"}`}function Qi(o,t){const e=new CustomEvent(je,{detail:o});t?t.dispatchEvent(e):window.dispatchEvent(e)}function Tr(o){const t=ie.get(o);t!==void 0&&(window.clearTimeout(t),ie.delete(o))}function Fl(o){const t=`${o}:`;for(const[e,i]of ie.entries())e.startsWith(t)&&(window.clearTimeout(i),ie.delete(e))}function bl(o,t,e){const i=window.setTimeout(()=>{ie.delete(o),Qi(t,e)},vl);ie.set(o,i)}function jt(o,t,e){if(typeof window>"u")return;const i=pl(t),r=`${i}:${yl(o.source,o.originId)}`;o.visible?(Fl(i),Qi(o,t)):e?(Tr(r),Qi(o,t)):(Tr(r),bl(r,o,t))}function wl(o,t){if(typeof window>"u")return()=>{};const e=t??window,i=r=>{const n=r;n.detail&&o(n.detail)};return e.addEventListener(je,i),()=>{e.removeEventListener(je,i)}}const xl="cell";class Ft{constructor(t,e){this.bounds=null,this.batcher=new ri,this.portalEventTarget=null,this.tooltipContext=void 0,this.rootNode=t,this.hoverController=new so({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},portalHoverDispatch:jt,getPortalEventTarget:()=>this.portalEventTarget,portalSource:xl,getTooltipContext:()=>this.tooltipContext})}setPortalEventTarget(t){this.portalEventTarget=t}setTooltipContext(t){this.tooltipContext=t}setRootNode(t){this.rootNode=t}setOriginId(t){}render(t,e,i,r,n,s){this.bounds={...r??e},this.hoverController.setAbsoluteBounds(this.bounds),t.save(),t.translate(e.x,e.y),this.prepareRootNode(t,e),i?this.dispatchPointerEvent("mousemove",i.x,i.y):this.handleMouseLeave(),this.batcher.clear(),this.batcher.setAnimationContext(n),this.batcher.imageResources=s,this.batcher.imageTransitions.beginFrame(s);try{this.rootNode.paint(this.batcher,t),this.batcher.flush(t)}finally{this.batcher.imageTransitions.endFrame()}t.restore()}dispatchPointerEvent(t,e,i,r){var h;if(!this.bounds)return{propagationStopped:!1,suppressGridDefault:!1};const n=this.rootNode.hitTest(e,i),s=(h=n.find(l=>l.interaction!==void 0))==null?void 0:h.interaction;let a=!1,c=!1;const u={type:t,x:e,y:i,originalEvent:r??{},target:n[0],stopPropagation:()=>{a=!0},preventDefault:()=>{c=!0,r==null||r.preventDefault()}};return n.length===0?(t==="mousemove"&&this.hoverController.handlePointerMove([],null),{propagationStopped:!1,suppressGridDefault:c,...s?{interaction:s}:{}}):(this.dispatchEventToNodes(n,u,t),t==="mousemove"&&this.hoverController.handlePointerMove(n,u),{propagationStopped:a,suppressGridDefault:c,...s?{interaction:s}:{}})}getInteractionAtPoint(t,e){var i;if(this.bounds)return(i=this.rootNode.hitTest(t,e).find(r=>r.interaction))==null?void 0:i.interaction}dispatchEventToNodes(t,e,i){let r=!1;const n={...e,stopPropagation:()=>{r=!0,e.stopPropagation()}};for(const s of t){if(r)break;const a={...n,currentTarget:s};this.invokeNodeHandler(s,i,a)}}invokeNodeHandler(t,e,i){switch(e){case"click":t.onClick({...i,cellBounds:this.bounds});break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break;case"mousemove":t.onMouseMove(i);break;case"mouseenter":t.onMouseEnter(i);break;case"mouseleave":t.onMouseLeave(i);break}}handleMouseLeave(){this.hoverController.handlePointerLeave()}prepareRootNode(t,e){this.rootNode.rect.x=0,this.rootNode.rect.y=0,this.rootNode.rect.width=e.width,this.rootNode.rect.height=e.height,this.rootNode instanceof dt?this.rootNode.performLayout(t):this.rootNode.measure(t)}computeCursor(t,e){return this.hoverController.computeCursor(t,e,this.rootNode)}getCurrentCursor(){return this.hoverController.getCurrentCursor()}forcePortalHide(){this.hoverController.handlePortalReset()}}const ci="canvas-cell";function zn(o,t,e,i){return{kind:P.GridCellKind.Custom,allowOverlay:!1,readonly:!0,copyData:e??"",data:{kind:ci,render:o,onClick:t},...i}}function Eo(o){var e;const t=o;return!!(t&&t.kind===P.GridCellKind.Custom&&((e=t.data)==null?void 0:e.kind)===ci)}const ge=5,On=[["hoverX","hoverY"],["mouseX","mouseY"],["pointerX","pointerY"],["posX","posY"],["x","y"]],Nn="default",Wn="pointer";function Gn(o,t){for(const[e,i]of On){const r=o[e],n=o[i];if(typeof r=="number"&&typeof n=="number"&&!Number.isNaN(r)&&!Number.isNaN(n)){if($n(r,n,t))return{x:r-t.x,y:n-t.y};if(Un(r,n,t))return{x:r,y:n}}}}function $n(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function Un(o,t,e){return o>=-ge&&o<=e.width+ge&&t>=-ge&&t<=e.height+ge}function Xn(o,t,e){if((o==null?void 0:o.canvasRoot)instanceof Ft){const i=e?"nativeEvent"in e?e.nativeEvent:e:void 0;return o.canvasRoot.dispatchPointerEvent("click",t.x,t.y,i)}return{propagationStopped:!1,suppressGridDefault:!1}}function Vn(o,t){if(o!=null&&o.clickHandlers&&Array.isArray(o.clickHandlers)){for(const{area:e,handler:i}of o.clickHandlers)if(wo(t.x,t.y,e))return i(),!0}return!1}function Yn(o,t,e,i,r,n){const{onClick:s}=o.data;return s?!!s(t.x,t.y,e,i,r,n??void 0):!1}const to=new WeakMap,qn=new Map;function Kn(o,t,e){const i={...e??{}};return delete i.hoveredAreas,qn.set(o,i),t.data.renderData=i,i}function ee(o,t){return t.data.renderData??qn.get(o)}function Zn(o,t){var i,r;(((i=to.get(o))==null?void 0:i.hovered)??!1)!==t&&(to.set(o,{hovered:t}),t?(r=o.onMouseEnter)==null||r.call(o):Sl(o))}function Sl(o){const{renderData:t}=o;(t==null?void 0:t.canvasRoot)instanceof Ft&&t.canvasRoot.forcePortalHide()}function jn(o){var t;return(t=to.get(o))==null?void 0:t.hovered}function Jn(o,t,e,i){var r;if(o instanceof Ft)if(t){if(e.event){const s="nativeEvent"in e.event?e.event.nativeEvent:e.event;o.dispatchPointerEvent("mousemove",t.x,t.y,s)}const n=o.computeCursor(t.x,t.y);n&&n!==Nn&&((r=i.overrideCursor)==null||r.call(i,n))}else o.handleMouseLeave(),o.forcePortalHide()}function Qn(o,t,e,i,r){var c;const n=!!(t&&e.some(u=>wo(t.x,t.y,u))),s=jn(o)??!1,a=!!t;a!==s&&Zn(o,a),n&&!i&&((c=r.overrideCursor)==null||c.call(r,Wn))}function To({cell:o,rect:t,relativePoint:e,renderData:i,rowData:r,rowIndex:n,event:s}){const a=Xn(i,e,s);return a.propagationStopped?{handled:!0,propagationStopped:!0,suppressGridDefault:a.suppressGridDefault}:Vn(i,e)?{handled:!0,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}:Yn(o,e,t,r,n,i)?{handled:!0,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}:{handled:!1,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}}function ts(o){const t=o.selection==="keep",e=o.cellClick==="stop",i=o.editor==="never",r=o.contextMenu==="keep-selection"?"manual-keep-selection":o.contextMenu==="none"?"none":"normal";return{suppressEarlyGridSelect:t,suppressExternalCellClick:e,suppressGridDefaultFor:{pointerdown:t,click:i,contextmenu:r!=="normal"},contextMenuMode:r,...o.editor==="open-on-click"?{editorRequest:{target:"self"}}:{}}}function Al({decision:o,propagationStopped:t,suppressGridDefault:e}){const i=o.suppressGridDefaultFor.click||e,r={suppressExternalCellClick:o.suppressExternalCellClick||t,suppressGridDefaultForClick:i};return!i&&o.editorRequest&&(r.editorRequest=o.editorRequest),r}function es({renderData:o,relativePoint:t}){const e=(o==null?void 0:o.canvasRoot)instanceof Ft?o.canvasRoot.getInteractionAtPoint(t.x,t.y):void 0;return e?{handled:!0,suppressEarlyGridSelect:ts(e).suppressEarlyGridSelect,interaction:e}:{handled:!1,suppressEarlyGridSelect:!1}}function Io(o={}){return{kind:P.GridCellKind.Custom,isMatch:t=>{var e;return((e=t.data)==null?void 0:e.kind)===ci},needsHover:!0,needsHoverPosition:!0,onSelect:t=>{var d;const e=t.cell,i=t.bounds,r=Gi(t);if(!r)return;const n=$i(r,i),s=Xe(t),a=te(s,i),c=ee(a,e),u=es({renderData:c,relativePoint:n}),h=t.location??[s.colIndex,s.rowIndex],l=u.interaction&&o.beginOrGetInteractionSession?o.beginOrGetInteractionSession({cell:h,relativePoint:n,interaction:u.interaction,source:"pointer",...t.button!==void 0?{button:t.button}:{}}):void 0;(l!=null&&l.decision.suppressEarlyGridSelect||u.suppressEarlyGridSelect)&&((d=t.preventDefault)==null||d.call(t))},onClick:t=>{var d,f;const e=t.cell,i=t.bounds,r=Gi(t);if(!r)return;const n=$i(r,i),s=Xe(t),a=te(s,i),c=ee(a,e),u=t.location??[s.colIndex,s.rowIndex],l=((d=o.consumeCanvasClickResult)==null?void 0:d.call(o,{cell:u,relativePoint:n,...t.button!==void 0?{button:t.button}:{}}))??To({cell:e,rect:i,relativePoint:n,renderData:c,rowData:t.row??t.rowData,rowIndex:s.rowIndex,event:t.event});l.suppressGridDefault&&((f=t.preventDefault)==null||f.call(t)),l.handled},draw:(t,e)=>{const{ctx:i,rect:r,theme:n}=t,{render:s}=e.data,a=t.cellFillColor!==void 0?{...n,bgCell:t.cellFillColor}:n,c=Xe(t),u=te(c,r),h={hoverX:t.hoverX,hoverY:t.hoverY,row:t.row,imageResources:t.imageLoader&&typeof t.col=="number"&&typeof t.row=="number"?{loader:t.imageLoader,colIndex:t.col,rowIndex:t.row}:void 0,rowData:t.rowData,event:t.event,frameTime:t.frameTime,requestAnimationFrame:t.requestAnimationFrame},l=gn(t.hoverX,t.hoverY,r)??Gn(h,r);i.save();const d=ee(u,e),f=s(i,r,a,l==null?void 0:l.x,l==null?void 0:l.y,{...h,canvasRoot:d==null?void 0:d.canvasRoot}),g=(f==null?void 0:f.hoveredAreas)??[];Kn(u,e,f);const v=(f==null?void 0:f.canvasRoot)??(d==null?void 0:d.canvasRoot);Jn(v,l,h,t),Qn(e.data,l,g,v,t),i.restore()},onPaste:()=>{}}}const El=Io(),Je=new Map;function is(o){const t=Tl(o),e=Je.get(t);if(e)return e;const r=ha.renderToString(o).match(/<svg[\s\S]*?<\/svg>/);if(!r)return console.warn("Could not extract SVG from React icon component:",o.type),"";const n=r[0];return Je.set(t,n),n}function Tl(o){const t=o.type,e=typeof t=="function"||typeof t=="object"?t.displayName||t.name||"Anonymous":String(t),{size:i,color:r,className:n}=o.props||{},s=JSON.stringify({size:i,color:r,className:n});return`${e}:${s}`}function St(o){return m.isValidElement(o)}function pt(o){return typeof o=="string"?o:St(o)?is(o):""}function Il(){Je.clear()}function Dl(){return Je.size}const eo=o=>{if(o===void 0)return;if(typeof o=="number")return o;const t=o.trim();if(t==="100%")return"100%";const e=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(e)return Number(e[1]);const i=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(i)return Number(i[1])*16;const r=Number(t);if(!Number.isNaN(r))return r},Ir={small:{radius:4,stroke:1.5},medium:{radius:4,stroke:1.5},big:{radius:6,stroke:2}};function Hl(o,t,e,i,r,n,s,a,c,u,h=!1,l=!1){const f=s-0,v=Math.min(f-0,lo),C=n==="auto"?v:n,y=e+0,p=(c==null?void 0:c.rowSize)||"medium",F=!i&&!r,w=zt(l,{x:t,y:e,width:C,height:s}),S=$a(c,i,r,w,h),b=t+C*.5,T=y+f*.5,E=b-v*.5,I=T-v*.5;return o.roundedRect(t,y,C,f,Ir[p].radius,{fillStyle:S.bgColor,strokeStyle:S.borderColor,lineWidth:F?Ir[p].stroke:void 0}),Ct(o,a,E,I,v,S.iconColor),{x:t,y,width:C,height:f}}const Ll=28,Pl="default",Bl="s",Dr="pointer",_l=20,io={indeterminateIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke-linecap="round" stroke-width="2" stroke="currentColor" d="m5.09449,9.0315l8,0"></path></svg>',checkedIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="currentColor" d="m5.70711,8.15582c-0.39053,-0.39052 -1.02369,-0.39052 -1.41422,0c-0.39052,0.39053 -0.39052,1.02369 0,1.41422l3.70666,3.70666l6.71095,-6.70248c0.3908,-0.39027 0.3912,-1.02344 0.0009,-1.41421c-0.3903,-0.39077 -1.02344,-0.39117 -1.41421,-0.00089l-5.29674,5.29004l-2.29334,-2.29334z"></path></svg>'},Rl=Object.values(io),kl={accentColor:"#1e88e5",accentFg:"#ffffff"};class Ml extends vt{constructor(t,e,i=!1,r=!1,n){super(t),this.view=Pl,this.buttonSize=Bl,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.checked=i,this.indeterminate=r,this.size=(n==null?void 0:n.size)??"auto",this.theme=n==null?void 0:n.theme,this.view=(n==null?void 0:n.view)??"primary",this.disabled=(n==null?void 0:n.disabled)??!1,super.style={...super.style,cursor:this.disabled?"auto":Dr},!this.disabled&&(n!=null&&n.onClick)&&(this.onClick=s=>{var a;return(a=n.onClick)==null?void 0:a.call(n,s)})}set style(t){super.style={...super.style,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Dr),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=zl(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;Hl(t,i,r,this.checked,this.indeterminate,n,s,this.icon,this.theme??kl,this.view,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function zl(o,t){const e=typeof o=="number"?o:Ll,i=0,r=oe,n=Math.min(e-r*2-re,_l),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}const Ol=({backgroundColor:o,__backgroundColorResolver:t},e)=>(t==null?void 0:t(e))??o,lt=o=>{const t=e=>null;return t.__canvasType=o,t},Nl=m.memo(({cellId:o,renderContent:t,nodeRegistry:e,onRegistryChange:i})=>{const r=t(),n=m.useRef(null);return m.useLayoutEffect(()=>{const s=e.current,a=n.current;a&&a!==o&&s.delete(a);const c=s.get(o),u=c!==void 0;s.set(o,r),u&&c!==r&&(i==null||i()),n.current=o},[o,r,e,i]),m.useLayoutEffect(()=>()=>{const s=e.current;n.current&&(s.delete(n.current),n.current=null)},[e]),null}),Wl=lt("Skeleton"),Gl=lt("Container"),$l=lt("Text"),Ul=lt("Icon"),Xl=lt("Button"),Vl=lt("IconButton"),Yl=lt("EmbedIconButton"),ql=lt("Rect"),Kl=lt("Badge"),Zl=lt("Checkbox"),jl=lt("Link"),Ce={Image:lt("Image"),Avatar:lt("Avatar"),AvatarGroup:lt("AvatarGroup"),Container:Gl,Text:$l,Icon:Ul,Button:Xl,IconButton:Vl,EmbedIconButton:Yl,Checkbox:Zl,Rect:ql,Badge:Kl,Skeleton:Wl,Link:jl,icon:pt};function ut(o,t){if(o)return function(e){o.call(this,e)}}function Qe({element:o,idPrefix:t="root",theme:e}){const i=[],r=os(o,t,0,i,e);if(i.length>0){const n=new Map;for(const{icon:s,size:a}of i){if(!s)continue;const c=n.get(a)??[];c.push(s),n.set(a,c)}n.forEach((s,a)=>{yn(s,{size:a})})}return r}function oo(o){return o==null?"":typeof o=="string"||typeof o=="number"?String(o):Array.isArray(o)?o.map(oo).join(""):""}function Hr(o,t,e){const i=o.fontMetrics,r=o.fonts;if(i===void 0||r===void 0)return{};const n=t??o.baseFontStyle,s=Object.keys(r).find(c=>r[c]===n);if(s===void 0)return{};const a=i[s];return a===void 0?{}:{fontSize:a.fontSize,...e===void 0?{lineHeightPx:a.lineHeightPx}:{}}}function os(o,t,e,i,r){if(!o||!m.isValidElement(o))throw new Error("Invalid element. Use Canvas.* components.");const n=o.type,s=n.__canvasType;if(!s)throw new Error(`Unknown canvas component. Use Canvas.* components. Got: ${(n==null?void 0:n.name)||n}`);const a=o.props,u=(o.key!=null?String(o.key):null)??e,h=a.id??`${t}-${s.toLowerCase()}-${u}`,l=g=>St(g)?pt(g):g;if(s==="Icon"&&a.icon)i.push({icon:l(a.icon),size:a.size??16});else if(s==="IconButton"&&a.icon){const g=a.buttonSize??"s",{iconSize:v}=at[g];i.push({icon:l(a.icon),size:v})}else if(s==="EmbedIconButton"&&a.icon){const g=a.buttonSize??"s",v=a.overrideIconSize??at[g].iconSize;i.push({icon:l(a.icon),size:v})}else if(s==="Checkbox")Rl.forEach(g=>{i.push({icon:l(g),size:20})});else if(s==="Button"){const g=a.size??"s",{iconSize:v}=at[g];a.leftIcon&&i.push({icon:l(a.leftIcon),size:v}),a.rightIcon&&i.push({icon:l(a.rightIcon),size:v})}else if(s==="Badge"){const g=a.size??"s",C={xs:10,s:12,m:14,l:16}[g]??12;a.leftIcon&&i.push({icon:l(a.leftIcon),size:C}),a.rightIcon&&i.push({icon:l(a.rightIcon),size:C})}const d=Jl(s,h,a,r);if(a.portalHoverEnabled&&(d.portalHoverEnabled=!0),a.tooltip!==void 0&&(d.tooltip=a.tooltip),a.autoTooltip!==void 0){const g=a.autoTooltip;(g===!0||typeof g=="object"&&g!==null&&g.enabled!==!1)&&(d.portalHoverEnabled=!0)}a.interaction!==void 0&&(d.interaction=jr(a.interaction)),typeof a.zIndex=="number"&&(d.zIndex=a.zIndex),a.style&&(d.style=a.style);const{children:f}=a;return f&&d instanceof dt&&m.Children.toArray(f).forEach((v,C)=>{if(m.isValidElement(v)){const y=os(v,h,C,i,r);d.addChild(y)}}),d}function Li(o,t,e){if(t.children!==void 0)throw new Error(`Canvas.${e} does not accept children`);t.position&&(o.position=t.position),t.left!==void 0&&(o.left=t.left),t.top!==void 0&&(o.top=t.top),t.right!==void 0&&(o.right=t.right),t.bottom!==void 0&&(o.bottom=t.bottom);for(const i of["onClick","onMouseEnter","onMouseLeave"]){const r=ut(t[i]);if(r){const n=o[i].bind(o);o[i]=s=>{n(s),r.call(o,s)}}}return t.tooltip!==void 0&&(o.portalHoverEnabled=!0),t.onClick&&(o.style={...o.style,cursor:"pointer"}),o}function Jl(o,t,e,i){switch(o){case"Image":return Li(new So(t,e),e,o);case"Avatar":return Li(new ve(t,{...e,theme:i}),e,o);case"AvatarGroup":return Li(new co(t,{...e,theme:i}),e,o);case"Container":{const r=e,{id:n,gap:s,columnGap:a,rowGap:c,position:u,left:h,top:l,right:d,bottom:f,zIndex:g,onClick:v,onMouseEnter:C,onMouseLeave:y,onMouseDown:p,backgroundColor:F,__backgroundColorResolver:w,portalHoverEnabled:S,...b}=r,T={...b,columnGap:a??s??0,rowGap:c??s??0},E=new dt(t,T,Ol(r,i));u&&(E.position=u),h!==void 0&&(E.left=h),l!==void 0&&(E.top=l),d!==void 0&&(E.right=d),f!==void 0&&(E.bottom=f);const I=ut(v),B=ut(C),W=ut(y),O=ut(p);return I&&(E.onClick=I),B&&(E.onMouseEnter=B),W&&(E.onMouseLeave=W),O&&(E.onMouseDown=O),E}case"Text":{const{children:r,font:n,color:s,wordWrap:a,lineHeight:c,overflow:u,textOverflow:h,ellipsis:l,maxLines:d,autoTooltip:f,position:g,left:v,top:C,right:y,bottom:p,portalHoverEnabled:F}=e,w=oo(r),S=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let b;n?b=/["']|sans-serif|serif|monospace/i.test(n)?n:`${n} ${S}`:b=i.baseFontStyle?`${i.baseFontStyle} ${S}`:`13px ${S}`;const T=Hr(i,n,c),E=new Ao(t,w,{font:b,...T,color:s,wordWrap:a,lineHeight:c,overflow:u,textOverflow:h,ellipsis:l,maxLines:d,autoTooltip:f});return g&&(E.position=g),v!==void 0&&(E.left=v),C!==void 0&&(E.top=C),y!==void 0&&(E.right=y),p!==void 0&&(E.bottom=p),E}case"Icon":{const{icon:r,size:n,color:s,backgroundColor:a,position:c,left:u,top:h,right:l,bottom:d,onClick:f,onMouseEnter:g,onMouseLeave:v,onMouseDown:C}=e,y=St(r)?pt(r):r,p=new In(t,y,{size:n,color:s});a&&(p.backgroundColor=a),c&&(p.position=c),u!==void 0&&(p.left=u),h!==void 0&&(p.top=h),l!==void 0&&(p.right=l),d!==void 0&&(p.bottom=d);const F=ut(f),w=ut(g),S=ut(v),b=ut(C);return F&&(p.onClick=F),w&&(p.onMouseEnter=w),S&&(p.onMouseLeave=S),b&&(p.onMouseDown=b),p}case"Button":{const{children:r,variant:n,view:s,size:a,leftIcon:c,rightIcon:u,disabled:h,position:l,left:d,top:f,right:g,bottom:v,onClick:C}=e,y=typeof r=="string"?r:"",p=St(c)?pt(c):c,F=St(u)?pt(u):u,w=new Tn(t,y,{variant:n,view:s,size:a,leftIcon:p,rightIcon:F,disabled:h,theme:i});if(l&&(w.position=l),d!==void 0&&(w.left=d),f!==void 0&&(w.top=f),g!==void 0&&(w.right=g),v!==void 0&&(w.bottom=v),!h){const S=ut(C);S&&(w.onClick=S)}return w}case"EmbedIconButton":case"IconButton":{const{icon:r,size:n,variant:s,view:a,buttonSize:c,overrideSquareSize:u,overrideIconSize:h,disabled:l,position:d,left:f,top:g,right:v,bottom:C,onClick:y}=e,p=St(r)?pt(r):r,F=o==="IconButton"?Dn:Xi,w=new F(t,p,{size:n,variant:s,view:a,buttonSize:c,overrideSquareSize:u,overrideIconSize:h,disabled:l});if(w instanceof Xi){const{iconColor:S,iconColorHovered:b,overrideWidth:T}=e;T!==void 0&&(w.overrideWidth=T),S!==void 0&&(w.iconColor=S),b!==void 0&&(w.iconColorHovered=b)}if(d&&(w.position=d),f!==void 0&&(w.left=f),g!==void 0&&(w.top=g),v!==void 0&&(w.right=v),C!==void 0&&(w.bottom=C),!l){const S=ut(y);S&&(w.onClick=S)}return w}case"Checkbox":{const{checked:r,indeterminate:n,size:s="auto",theme:a,view:c,buttonSize:u,disabled:h,position:l,left:d,top:f,right:g,bottom:v,onClick:C}=e,y=pt(r?io.checkedIcon:io.indeterminateIcon),p=new Ml(t,y,r,n,{size:s,theme:a??i,view:c,buttonSize:u,disabled:h});if(l&&(p.position=l),d!==void 0&&(p.left=d),f!==void 0&&(p.top=f),g!==void 0&&(p.right=g),v!==void 0&&(p.bottom=v),!h){const F=ut(C);F&&(p.onClick=F)}return p}case"Rect":{const{color:r,borderColor:n,borderWidth:s,position:a,left:c,top:u,right:h,bottom:l}=e,d=new Rn(t,r);return n&&(d.borderColor=n),s&&(d.borderWidth=s),a&&(d.position=a),c!==void 0&&(d.left=c),u!==void 0&&(d.top=u),h!==void 0&&(d.right=h),l!==void 0&&(d.bottom=l),d}case"Badge":{const{text:r,view:n,size:s,transparent:a,clear:c,leftIcon:u,rightIcon:h,customColor:l,customBackgroundColor:d,position:f,left:g,top:v,right:C,bottom:y,portalHoverEnabled:p,pilled:F}=e,w=St(u)?pt(u):u,S=St(h)?pt(h):h,b=new En(t,r,{view:n,size:s,transparent:a,clear:c,leftIcon:w,rightIcon:S,pilled:F,customColor:l,customBackgroundColor:d,theme:i});return f&&(b.position=f),g!==void 0&&(b.left=g),v!==void 0&&(b.top=v),C!==void 0&&(b.right=C),y!==void 0&&(b.bottom=y),b}case"Skeleton":{const{width:r,height:n,roundness:s,lighter:a,customGradientColor:c,animated:u,shimmerDuration:h,style:l,portalHoverEnabled:d}=e,f=eo(r),g=eo(n),v={...l,...f!==void 0?{width:f}:null,...g!==void 0?{height:g}:null},C=new Mn(t,{roundness:s,lighter:a,customGradientColor:c,shimmerDuration:h,animated:u});return C.style=v,C}case"Link":{const{children:r,href:n,target:s,view:a,disabled:c,font:u,color:h,wordWrap:l,lineHeight:d,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,position:y,left:p,top:F,right:w,bottom:S,onClick:b,portalHoverEnabled:T}=e,E=oo(r),I=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let B;u?B=/["']|sans-serif|serif|monospace/i.test(u)?u:`${u} ${I}`:B=i.baseFontStyle?`${i.baseFontStyle} ${I}`:`13px ${I}`;const W=Hr(i,u,d),O=new _n(t,E,{font:B,...W,color:h,wordWrap:l,lineHeight:d,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,href:n,target:s,view:a,disabled:c,theme:i});if(y&&(O.position=y),p!==void 0&&(O.left=p),F!==void 0&&(O.top=F),w!==void 0&&(O.right=w),S!==void 0&&(O.bottom=S),!c){const Z=ut(b);Z&&O.setOnClick(Z)}return O}default:throw new Error(`Unknown canvas component type: ${o}`)}}const Ql='400 normal 1rem/1.25rem "SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',th="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",eh=30,ih=50,oh=3;async function rs(){return typeof document>"u"||!document.fonts?Promise.resolve():document.fonts.ready.then(()=>{})}function ns(o={}){const{testFont:t=Ql,testText:e=th,maxChecks:i=eh,checkInterval:r=ih,stableThreshold:n=oh}=o;return new Promise(s=>{if(typeof document>"u"){s();return}const c=document.createElement("canvas").getContext("2d");if(!c){s();return}let u=-1,h=0,l=0;const d=()=>{c.font=t;const{width:f}=c.measureText(e);f!==u?(u=f,h=0):h+=1,l+=1,h>=n||l>=i?s():setTimeout(d,r)};d()})}function ss(o){return rs().then(()=>ns(o))}function Do({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){const r=o.current;if(!r)return;const n=Math.min(30,t),s=e,a=[];for(let c=0-i;c<n;c+=1)for(let u=0;u<s;u+=1)a.push({cell:[u,c]});a.length>0&&r.updateCells(a)}function Ho(o){let t=null;return()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,o()}))}}function rh(){const o=m.useRef(null),t=m.useCallback(()=>(o.current||(o.current=new Qr),o.current),[]);return{registry:t(),getRegistry:t}}function as({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useLayoutEffect(()=>{const r=Ho(()=>{Zc(),Do({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});ss().then(r)},[o,t,e,i])}function cs({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useEffect(()=>{const r=Ho(()=>{Do({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});return mn(r)},[o,t,e,i])}P.GridCellKind.Text;const ti=(o,t)=>({kind:P.GridCellKind.Text,data:o,displayData:o,allowOverlay:!0,readonly:!0,...t}),Jt=o=>{const{data:t,...e}=o??{};return{kind:P.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0,...e}};function ls(o){const t=o;return!!(t!=null&&t.kind)}function nh(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function Lo(o){return typeof o!="object"&&!Array.isArray(o)||o===null}function hs(o){return o==null||typeof o=="boolean"}const li=o=>{if(!o||!m.isValidElement(o))return!1;const t=o.type;return!!(t!=null&&t.__canvasType)},Po=o=>typeof o=="string",ro=o=>Po(o)?!0:li(o),sh=o=>Po(o)?!0:li(o),Lr=({jsxElement:o,canvasCellCache:t,cellInfo:e,options:i})=>{let r=null;if(ls(o))return{...o,...i};if(Lo(o))return hs(o)?Jt(i):ti(String(o),i);if(!li(o)){const y="передан НЕ CanvasEl";return ti(y,{...i,data:y})}const{colInd:n,rowInd:s,row:a,column:c}=e,{id:u}=c,{getPortalEventTarget:h}=i;let l=null;const d=`cell-${n}-${s}`,f=(y,p,F,w,S,b)=>{let T=(b==null?void 0:b.canvasRoot)instanceof Ft?b.canvasRoot:l;{if(!o)return{};let B=Qe({element:o,idPrefix:`cell-${n}-${s}-${u}`,theme:F});if(B instanceof So||B instanceof ve||B instanceof co){const W=new dt(`${B.id}:cell-root`);W.addChild(B),B=W}T?(T.setRootNode(B),T.setOriginId(d)):T=new Ft(B,d),l=T}if(!T)return{};const E=w!==void 0&&S!==void 0?{x:w,y:S}:void 0;T.rootNode.style={width:p.width,height:p.height},r||(r=y.canvas.getBoundingClientRect());const I={x:r.left+p.x,y:r.top+p.y,width:p.width,height:p.height};return T.setPortalEventTarget((h==null?void 0:h())??null),T.setTooltipContext({column:e.column,row:e.row,ctxs:e.ctxs,refTable:i.refTable}),T.render(y,p,E,I,{frameTime:b==null?void 0:b.frameTime,requestAnimationFrame:b==null?void 0:b.requestAnimationFrame},b==null?void 0:b.imageResources),l=T,{canvasRoot:T}},{data:g,...v}=i;let C=g;return c.copyData&&(C=typeof c.copyData=="function"?c.copyData(a):c.copyData),zn(f,void 0,C,v)},Bo=(o,t,e)=>o?t>=o.x&&t<o.x+o.width&&e>=o.y&&e<o.y+o.height:!1,ah=o=>{const t=o.findIndex(e=>!e.isServiceColumn);return t===-1?o.length:t},ch=(o,t)=>{if(!o)return;const e=Math.max(o.x,t),i=Math.max(0,o.x+o.width-e);if(!(i<=0||o.height<=0))return{x:e,y:o.y,width:i,height:o.height}};function lh({cellsSelectionMode:o,selection:t,baseTheme:e,serviceColumnsCount:i,activeDataRange:r,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:a,highlightRegionsExternal:c}){return m.useMemo(()=>{const u=[...c??[]],h=t.current,l=()=>{if(a!=null&&a.length)for(const C of a)u.push({color:e.errorOutlineColor,range:C,style:"solid-outline"})};if(!h||o==="disabled")return l(),u.length>0?u:void 0;const[,d]=h.cell,g=(s==null?void 0:s.has(d))??!1?e.selectionActiveCheckboxBg:e.selectionActiveBg,v=e.selectionServiceActiveBg;return r&&i>0&&u.push({color:v,range:{x:0,y:r.y,width:i,height:r.height},style:"no-outline"}),r&&o==="cell"&&r.width===1&&r.height===1&&u.push({color:g,range:r,style:"no-outline"}),n&&u.push({color:e.accentColor,range:n,style:"solid-outline"}),l(),u.length>0?u:void 0},[o,t,e.selectionActiveBg,e.selectionActiveCheckboxBg,e.selectionServiceActiveBg,e.errorOutlineColor,e.accentColor,i,r,n,s,a,c])}function hh({baseRegions:o,selectedColumnIndexes:t,headerSelectedRowIndexes:e,activeRow:i,activeRange:r,selectionRangeStack:n,checkboxAvailableRowIndexes:s,totalRows:a,firstDataCol:c,columnsCount:u,theme:h}){return m.useMemo(()=>{const l=t.length>0,d=e.length>0,f=i!==void 0,g=((n==null?void 0:n.length)??0)>0;if(!l&&!d&&!f&&!g)return o;const v=u-c,C=[...o??[]],y=(p,F)=>{const[w,...S]=[...p].sort((I,B)=>I-B);if(w===void 0)return;let b=w,T=w;const E=(I,B)=>{C.push({color:h.accentColor,range:F(I,B),style:"solid-outline"})};for(const I of S)I===T+1||(E(b,T),b=I),T=I;E(b,T)};if(l){c>0&&C.push({color:h.selectionServiceActiveBg,range:{x:0,y:0,width:c,height:a},style:"no-outline"});for(const p of t)C.push({color:h.selectionActiveBg,range:{x:p,y:0,width:1,height:a},style:"no-outline"});y(t,(p,F)=>({x:p,y:0,width:F-p+1,height:a}))}if(d&&v>0){if(c>0)for(const p of e)C.push({color:h.selectionServiceActiveBg,range:{x:0,y:p,width:c,height:1},style:"no-outline"});for(const p of e)C.push({color:h.selectionActiveBg,range:{x:c,y:p,width:v,height:1},style:"no-outline"});y(e,(p,F)=>({x:c,y:p,width:v,height:F-p+1}))}if(i!==void 0&&v>0){const p=s!=null&&s.has(i)?h.selectionActiveCheckboxBg:h.selectionCheckboxBg,F=(S,b)=>{b>0&&C.push({color:p,range:{x:S,y:i,width:b,height:1},style:"no-outline"})};if(!(r&&i>=r.y&&i<r.y+r.height))F(c,v);else{const S=Math.max(r.x,c),b=r.x+r.width;F(c,S-c),F(b,u-b)}}if(g&&n&&c>0){const p=new Set;for(const F of n){const w=Math.max(F.x,c);if(!(F.x+F.width-w<=0||F.height<=0))for(let b=F.y;b<F.y+F.height;b+=1)p.add(b)}for(const F of p)C.push({color:h.selectionServiceActiveBg,range:{x:0,y:F,width:c,height:1},style:"no-outline"})}return C},[o,t,e,i,r,n,s,a,c,u,h.selectionActiveBg,h.selectionActiveCheckboxBg,h.selectionCheckboxBg,h.selectionServiceActiveBg,h.accentColor])}function us({theme:o,cellsSelectionMode:t,selection:e,serviceColumnsCount:i,activeDataRange:r,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:a,highlightRegionsExternal:c,selectedColumnIndexes:u,headerSelectedRowIndexes:h,activeRow:l,checkboxVisibleRowIndexes:d,totalRows:f,columnsCount:g,isRowHoverEnabled:v,hoverRow:C,dataRowsCount:y}){var w,S;const p=lh({cellsSelectionMode:t,selection:e,baseTheme:o,serviceColumnsCount:i,activeDataRange:r,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:a,highlightRegionsExternal:c}),F=hh({baseRegions:p,selectedColumnIndexes:u,headerSelectedRowIndexes:h,activeRow:l,activeRange:(w=e.current)==null?void 0:w.range,selectionRangeStack:(S=e.current)==null?void 0:S.rangeStack,checkboxAvailableRowIndexes:d,totalRows:f,firstDataCol:i,columnsCount:g,theme:o});return m.useMemo(()=>!v||C===void 0||C>y-1||i===0?F:[{color:o.bgServiceRowHovered,range:{x:0,y:C,width:i,height:1},style:"no-outline"},...F??[]],[F,i,v,C,y,o.bgServiceRowHovered])}const Ge={columns:P.CompactSelection.empty(),rows:P.CompactSelection.empty(),current:void 0};function ds({cellsSelectionMode:o,gridSelection:t,onGridSelectionChange:e,onSelectionEmit:i}){const[r,n]=m.useState(Ge),s=t!==void 0,a=t??r,c=m.useCallback(l=>{s?e==null||e(l):n(l),i==null||i(l)},[s,e,i]),u=m.useCallback(()=>{s?e==null||e(Ge):n(Ge),i==null||i(Ge)},[s,e,i]),h=m.useMemo(()=>o==="range-cell"?"rect":o==="multi-range-cell"?"multi-rect":o==="disabled"?"none":"cell",[o]);return{selection:a,handleGridSelectionChange:c,handleSelectionCleared:u,rangeSelect:h}}const Kt=new Set,Pr=({start:o,length:t})=>{const e=new Set;for(let i=0;i<t;i+=1)e.add(o+i);return e};function fs({columns:o,selection:t,cellsSelectionMode:e,checkboxSelectedRowIndexes:i}){return m.useMemo(()=>{const r=t.current,n=ah(o);if(!(e!=="disabled"&&r!==void 0)||!r)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Kt,activeColumns:Kt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:d=>{var f;return!!((f=o[d])!=null&&f.isServiceColumn)},isActiveRow:d=>!1,isCheckboxSelectedRow:d=>(i==null?void 0:i.has(d))??!1,isActiveDataCell:(d,f)=>!1,isActiveHeaderColumn:d=>!1};const a=ch(r.range,n),c=a!==void 0,u=e==="cell"&&a!==void 0&&a.width===1&&a.height===1;if(!c)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Kt,activeColumns:Kt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:d=>{var f;return!!((f=o[d])!=null&&f.isServiceColumn)},isActiveRow:d=>!1,isCheckboxSelectedRow:d=>(i==null?void 0:i.has(d))??!1,isActiveDataCell:(d,f)=>!1,isActiveHeaderColumn:d=>!1};const h=a!=null&&a.height&&a.height>0?Pr({start:a.y,length:a.height}):Kt,l=a!=null&&a.width&&a.width>0?Pr({start:a.x,length:a.width}):Kt;return{hasAnyActiveSelection:c,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:h,activeColumns:l,activeDataRange:a,isSingleCellCustomHighlight:u,outlineRange:u?a:void 0,isServiceColumn:d=>{var f;return!!((f=o[d])!=null&&f.isServiceColumn)},isActiveRow:d=>h.has(d),isCheckboxSelectedRow:d=>(i==null?void 0:i.has(d))??!1,isActiveDataCell:(d,f)=>Bo(a,d,f),isActiveHeaderColumn:d=>o[d]?l.has(d):!1}},[o,e,i,t])}function uh({highlightActiveRow:o,onHighlightActiveRowChange:t,isHighlightActiveRowControlled:e}){const[i,r]=m.useState(void 0),n=e??t!==void 0,s=n?o:i,a=m.useCallback(c=>{n||r(c),t==null||t(c)},[n,t]);return{activeRow:s,commitActiveRow:a}}function dh({columns:o}){const[t,e]=m.useState(()=>P.CompactSelection.empty()),i=m.useMemo(()=>t.toArray().filter(u=>{var h;return!((h=o[u])!=null&&h.isServiceColumn)}),[t,o]),r=m.useMemo(()=>new Set(i),[i]),n=m.useRef(void 0),[s,a]=m.useState(!1),c=m.useCallback(()=>{e(P.CompactSelection.empty())},[]);return{selectedColumns:t,setSelectedColumns:e,selectedColumnIndexes:i,selectedColumnSet:r,lastSelectedColumnRef:n,isNativeColumnSelection:s,setIsNativeColumnSelection:a,clearColumnSelection:c}}function fh(){const[o,t]=m.useState(()=>P.CompactSelection.empty()),e=m.useMemo(()=>o.toArray(),[o]),i=m.useRef(o);i.current=o;const r=m.useRef(!1),n=m.useRef(P.CompactSelection.empty()),s=m.useRef(!1);m.useEffect(()=>{const c=h=>{r.current=h.ctrlKey||h.metaKey,n.current=i.current,s.current=!0},u=()=>{s.current=!1};return window.addEventListener("pointerdown",c,!0),window.addEventListener("pointerup",u,!0),()=>{window.removeEventListener("pointerdown",c,!0),window.removeEventListener("pointerup",u,!0)}},[]);const a=m.useCallback(()=>{t(P.CompactSelection.empty())},[]);return{selectedRows:o,setSelectedRows:t,headerSelectedRowIndexes:e,selectedRowsRef:i,ctrlGestureRef:r,ctrlBaseRowsRef:n,pointerGestureRef:s,clearRowSelection:a}}function gs({columns:o,selection:t,cellsSelectionMode:e,highlightActiveType:i,enableColumnSelection:r,enableRowSelection:n,enableSelectAll:s,leadingServiceColumnsCount:a,dataRowCount:c,handleGridSelectionChange:u,handleSelectionCleared:h,onSelectionEmit:l,highlightActiveRow:d,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}){const{selectedColumns:v,setSelectedColumns:C,selectedColumnIndexes:y,selectedColumnSet:p,lastSelectedColumnRef:F,isNativeColumnSelection:w,setIsNativeColumnSelection:S}=dh({columns:o}),{setSelectedRows:b,headerSelectedRowIndexes:T,ctrlGestureRef:E,ctrlBaseRowsRef:I,pointerGestureRef:B}=fh(),{activeRow:W,commitActiveRow:O}=uh({highlightActiveRow:d,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}),Z=m.useMemo(()=>o.findIndex(M=>M.isServiceColumn&&M.id==="row-markers"),[o]),It=m.useCallback(M=>{const{current:N}=M;if(!N)return M;const U=a,{range:K}=N;if(K.x>=U)return M;const $=K.x+K.width-U;return $<=0?{current:void 0,rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()}:{...M,current:{...N,cell:[Math.max(N.cell[0],U),N.cell[1]],range:{...K,x:U,width:$}}}},[a]),ne=m.useCallback(M=>{const N=M.current;if(n&&Z>=0&&N&&N.cell[0]===Z){const K=a,$=N.range.y,J=$+Math.max(N.range.height,1);if(E.current){const Q=J-$<=1;let et=I.current;if(et.length===0&&t.current&&t.current.cell[0]===Z){const bt=t.current.range;et=P.CompactSelection.empty().add([bt.y,bt.y+Math.max(bt.height,1)]),I.current=et}let rt;Q?rt=et.hasIndex($)?et.remove($):et.add($):rt=et.add([$,J]),C(P.CompactSelection.empty()),b(rt),O(void 0),S(!1),u({...M,current:{...N,range:{x:K,y:N.range.y,width:0,height:N.range.height}}}),l==null||l({current:void 0,rows:rt,columns:P.CompactSelection.empty()});return}const V=Math.max(o.length-K,0);C(P.CompactSelection.empty()),b(P.CompactSelection.empty()),O(void 0),S(!1),u({...M,current:{...N,range:{x:K,y:N.range.y,width:V,height:N.range.height}}});return}const U=It(M);(U.current!==void 0||U.rows.length>0)&&(C(P.CompactSelection.empty()),b(P.CompactSelection.empty())),S(!1),i==="row"?B.current&&U.current&&O(U.current.cell[1]):O(void 0),u(U)},[o,t,u,It,Z,n,a,i,l,O,E,I,B,C,b,S]),hi=m.useCallback(()=>{C(P.CompactSelection.empty()),b(P.CompactSelection.empty()),O(void 0),S(!1),h()},[h,O,C,b,S]),Ot=m.useRef([]),Pt=m.useMemo(()=>{var K;const M=new Set(y);if(w&&t.current){const{x:$,width:J}=t.current.range;for(let V=$;V<$+J;V+=1)(K=o[V])!=null&&K.isServiceColumn||M.add(V)}const N=Array.from(M).sort(($,J)=>$-J).map($=>{var J;return(J=o[$])==null?void 0:J.id}).filter($=>!!$),U=Ot.current;return U.length===N.length&&U.every(($,J)=>$===N[J])?U:(Ot.current=N,N)},[y,w,t,o]),ui=(e==="range-cell"||e==="multi-range-cell")&&!w&&!(t.current!==void 0&&t.current.cell[0]<a),pe=m.useCallback((M,N)=>{if(s&&Z>=0&&M===Z&&e!=="disabled"){const Q=a,et=Math.max(o.length-Q,0);if(et===0||c===0)return;C(P.CompactSelection.empty()),b(P.CompactSelection.empty()),O(void 0),S(!0),u({current:{cell:[Q,0],range:{x:Q,y:0,width:et,height:c},rangeStack:[]},rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()});return}if(!r)return;const U=o[M];if(!U||U.isServiceColumn)return;const K=N.shiftKey;if(N.ctrlKey||N.metaKey){let Q=v;if(Q.length===0&&w&&t.current){const rt=t.current.range;Q=Q.add([rt.x,rt.x+rt.width])}const et=Q.hasIndex(M)?Q.remove(M):Q.add(M);F.current=M,C(et),b(P.CompactSelection.empty()),O(void 0),S(!1),u({current:void 0,rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()}),l==null||l({current:void 0,rows:P.CompactSelection.empty(),columns:et});return}let J,V;K&&F.current!==void 0?(J=Math.min(F.current,M),V=Math.max(F.current,M)):(J=M,V=M,F.current=M),C(P.CompactSelection.empty()),b(P.CompactSelection.empty()),O(void 0),S(!0),u({current:{cell:[J,0],range:{x:J,y:0,width:V-J+1,height:c},rangeStack:[]},rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()})},[r,s,Z,e,a,o,t,w,v,c,u,l,O,F,C,b,S]),Nt=m.useCallback(M=>{const N=new Set(M),U=o.map((Q,et)=>!Q.isServiceColumn&&N.has(Q.id)?et:-1).filter(Q=>Q>=0);if(b(P.CompactSelection.empty()),O(void 0),U.length===0){C(P.CompactSelection.empty()),S(!1),u({current:void 0,rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()});return}const K=U[0],$=U[U.length-1];if(K===void 0||$===void 0)return;const J=$-K===U.length-1;if(F.current=$,J){C(P.CompactSelection.empty()),S(!0),u({current:{cell:[K,0],range:{x:K,y:0,width:$-K+1,height:c},rangeStack:[]},rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()});return}let V=P.CompactSelection.empty();U.forEach(Q=>{V=V.add(Q)}),C(V),S(!1),u({current:void 0,rows:P.CompactSelection.empty(),columns:P.CompactSelection.empty()})},[o,c,u,C,b,S,O,F]);return{selectedColumnIndexes:y,selectedColumnKeysAll:Pt,selectColumnsByKeys:Nt,selectedColumnSet:p,headerSelectedRowIndexes:T,activeRow:W,numberingColumnIndex:Z,drawFocusRing:ui,selectColumnFromHeader:pe,handleGridSelectionWithColumnReset:ne,handleSelectionClearedWithColumns:hi}}function gh(o,t,e,i){const r=performance.now();function n(s){const a=s-r,c=Math.min(a/i,1),u=t+(e-t)*c;o(Math.round(u)),c<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}const Ch=o=>{const t=typeof o=="number",[e,i]=m.useState(()=>t?o:56);return m.useEffect(()=>{t&&gh(i,e,o,300)},[o]),t?e:o};function vh({columns:o,rows:t,freezeColumns:e,selectedRange:i}){const[r,n]=m.useState(null),s=m.useRef(r);s.current=r;const a=m.useRef(null),c=m.useRef(0),u=m.useMemo(()=>o.some(v=>!v.isServiceColumn&&v.isErrorCell),[o]),h=m.useRef({cols:0,rows:0,freeze:0});h.current={cols:o.length,rows:t.length,freeze:e??0};const l=m.useCallback(()=>{c.current||(c.current=requestAnimationFrame(()=>{c.current=0;const v=a.current;if(!v)return;const{cols:C,rows:y,freeze:p}=h.current,F=Math.max(v.width,1),w=Math.max(v.height,1),S=s.current;if(S){const B=S.x+S.width,W=S.y+S.height,O=S.x>0&&v.x-S.x<F/2,Z=S.y>0&&v.y-S.y<w/2,It=B<C&&B-(v.x+v.width)<F/2,ne=W<y&&W-(v.y+v.height)<w/2;if(!O&&!Z&&!It&&!ne)return}const b=p>0?0:Math.max(0,v.x-F),T=Math.max(0,v.y-w),E=Math.min(C,v.x+v.width+F),I=Math.min(y,v.y+v.height+w);n({x:b,y:T,width:E-b,height:I-T})}))},[]);m.useEffect(()=>()=>{c.current&&cancelAnimationFrame(c.current)},[]),m.useEffect(()=>{u&&l()},[u,l]);const d=m.useCallback(v=>{a.current=v,l()},[l]),f=m.useMemo(()=>{const v=[];if(!u)return v;const C=r??{x:0,y:0,width:Math.min(o.length,60),height:Math.min(t.length,300)},y=Math.max(0,C.x),p=Math.min(o.length,C.x+C.width),F=Math.max(0,C.y),w=Math.min(t.length,C.y+C.height);for(let S=y;S<p;S+=1){const b=o[S],{isErrorCell:T}=b??{};if(!(!b||b.isServiceColumn||!T))for(let E=F;E<w;E+=1){const I=t[E];I!==void 0&&T(I)&&v.push({x:S,y:E,width:1,height:1})}}return v},[o,t,r,u]);return{errorCellRanges:m.useMemo(()=>!i||f.length===0?f:f.filter(v=>!Bo(i,v.x,v.y)),[f,i]),trackVisibleRegion:d}}function Cs({cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,mouseArgs:n}){const s=(i==null?void 0:i.canvasRoot)instanceof Ft?i.canvasRoot.getInteractionAtPoint(r.x,r.y):void 0;if(s)return{cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,interaction:s,...n?{mouseArgs:n}:{}}}function mh({dataEditor:o,getCellContent:t,clientX:e,clientY:i,nativeEvent:r}){const n=o==null?void 0:o.getMouseArgsForPosition(e,i,r);if(!n||n.kind!=="cell")return;const s=[n.location[0],n.location[1]],a=t(s);if(!Eo(a))return;const c=n.bounds,u=te({colIndex:s[0],rowIndex:s[1]},c),h=ee(u,a),l={x:n.localEventX,y:n.localEventY};return Cs({cell:s,mouseArgs:n,glideCell:a,rect:c,renderData:h,relativePoint:l})}function ph({eventTarget:o,dataEditorRef:t,getCellContent:e,interactionSessionStore:i,onCellContextMenuExternal:r}){m.useEffect(()=>{if(!o)return;const n=s=>{var g;if(!(s instanceof MouseEvent))return;const a=s;if(a.clientX===0&&a.clientY===0)return;const c=mh({dataEditor:t.current,getCellContent:e,clientX:a.clientX,clientY:a.clientY,nativeEvent:a});if(!c)return;const{cell:u,interaction:h,mouseArgs:l,relativePoint:d}=c,f=i.beginOrGet({cell:u,relativePoint:d,interaction:h,button:a.button,source:"contextmenu"});if(f.decision.contextMenuMode!=="normal"){if(i.consumePhase(f,"contextmenu-capture"),a.stopPropagation(),(g=a.stopImmediatePropagation)==null||g.call(a),f.decision.contextMenuMode==="none"){a.cancelable&&a.preventDefault();return}!l||!r||r(u,{...l,preventDefault:()=>{a.cancelable&&a.preventDefault()}})}};return o.addEventListener("contextmenu",n,!0),()=>{o.removeEventListener("contextmenu",n,!0)}},[t,o,e,i,r])}const yh=250;function Fh(o){return m.useCallback((t,e)=>{const i=o.consumeEditorRequest(t,yh);return!i||i.target!=="self"?e:{...e,activationBehaviorOverride:"single-click"}},[o])}const Ye=350;function Br(o){return Math.round(o)}function bh({cell:o,relativePoint:t,button:e}){return[o[0],o[1],e??"unknown",Br(t.x),Br(t.y)].join(":")}function ei(o,t){return o[0]===t[0]&&o[1]===t[1]}function vs(o,t){return Math.abs(o.x-t.x)<=1&&Math.abs(o.y-t.y)<=1}function wh(o,t){return!ei(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:vs(o.relativePoint,t.relativePoint)}function xh(o,t){return Date.now()-o.startedAt>(t.maxAgeMs??Ye)||!ei(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:vs(o.relativePoint,t.relativePoint)}function Sh(){let o,t=1;const e=i=>{if(!(!o||!xh(o,i)))return o};return{beginOrGet:i=>{const r=e(i);return r||(o={id:t++,key:bh(i),cell:i.cell,relativePoint:i.relativePoint,interaction:i.interaction,decision:ts(i.interaction),consumedPhases:new Set,startedAt:i.startedAt??Date.now(),source:i.source,...i.button!==void 0?{button:i.button}:{}},o)},findMatching:e,getCurrent:()=>o,storeClickResult:(i,r)=>{i.clickResult=r},consumeClickResult:i=>{const r=o;if(!(r!=null&&r.clickResult))return;if(!wh(r,i)){delete r.clickResult;return}const n=r.clickResult;return delete r.clickResult,r.consumedPhases.add("renderer-click"),n},consumePhase:(i,r)=>i.consumedPhases.has(r)?!1:(i.consumedPhases.add(r),!0),armEditorRequest:(i,r)=>{var n;(n=i.editorRequest)!=null&&n.consumed||(i.editorRequest={target:r.target,armedAt:Date.now()})},consumeEditorRequest:(i,r=Ye)=>{const n=o;if(!n)return;const s=n.editorRequest;if(!(s!=null&&s.consumed)&&s){if(Date.now()-s.armedAt>r){o=void 0;return}if(ei(n.cell,i))return s.consumed=!0,n.consumedPhases.add("editor-activation"),s}},isMatchingRecent:(i,r,n=Ye)=>{const s=o;return!s||!s.consumedPhases.has(i)?!1:Date.now()-s.startedAt<=n&&ei(s.cell,r)},clearStale:(i=Ye)=>{o&&Date.now()-o.startedAt>i&&(o=void 0)},clear:()=>{o=void 0}}}function Ah(){const o=m.useMemo(()=>Sh(),[]),t=m.useCallback(i=>o.beginOrGet(i),[o]),e=m.useCallback(i=>o.consumeClickResult(i),[o]);return{interactionSessionStore:o,beginOrGetInteractionSession:t,consumeCanvasClickResult:e}}function Eh(o={}){const t=m.useMemo(()=>!0,[]);return m.useMemo(()=>{const e=[];return t&&e.push(Io({beginOrGetInteractionSession:o.beginOrGetInteractionSession,consumeCanvasClickResult:o.consumeCanvasClickResult})),e.length>0?e:void 0},[t,o.beginOrGetInteractionSession,o.consumeCanvasClickResult])}const Pi={glideScroller:"dvn-scroller",glideTable:"gdg-table",glideUnderlay:"dvn-underlay"};function ms(o){const t=(o==null?void 0:o.querySelector(`.${Pi.glideTable}`))??null,e=(t==null?void 0:t.querySelector(`.${Pi.glideScroller}`))??null,i=(t==null?void 0:t.querySelector(`.${Pi.glideUnderlay}`))??null;return{container:t,scroller:e,underlay:i}}const _r="[useGlideElements]";function Th(o,t){const[e,i]=m.useState(null),[r,n]=m.useState(null),[s,a]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{const h=o==null?void 0:o.current;if(Qt.tableDebug(_r,"useEffect fired",{hasWrapper:!!h,fullScreened:t}),!h)return;const l=()=>{const{container:f,scroller:g,underlay:v}=ms(h);return Qt.tableDebug(_r,"tryFind",{containerFound:!!f,scrollerFound:!!g,underlayFound:!!v}),f?(i(C=>C===f?C:f),n(C=>C===g?C:g),a(C=>C===v?C:v),c.current&&(c.current.disconnect(),c.current=null),!0):!1},d=requestAnimationFrame(()=>{if(l())return;const f=new MutationObserver(()=>{l()});f.observe(h,{childList:!0,subtree:!0}),c.current=f});return()=>{cancelAnimationFrame(d),c.current&&(c.current.disconnect(),c.current=null),i(null),n(null),a(null)}},[o,t]);const u=m.useCallback(h=>e?$e.createPortal(h,e):null,[e]);return{glideContainer:e,glideScroller:r,glideUnderlay:s,isReady:!!e,renderInContainer:u}}function Ih({isRowHoverEnabled:o,dataEditorRef:t,columnsCount:e,rowsCount:i}){const r=m.useRef(null),n=m.useCallback((...h)=>{var g;const l=t.current;if(!l)return;const d=new Set;h.forEach(v=>{typeof v=="number"&&v>=0&&v<i&&d.add(v)});const f=[];d.forEach(v=>{for(let C=0;C<e;C+=1)f.push({cell:[C,v]})}),f.length>0&&((g=l.updateCells)==null||g.call(l,f))},[t,e,i]),s=m.useCallback(h=>{const l=r.current;(l==null?void 0:l.colInd)===(h==null?void 0:h.colInd)&&(l==null?void 0:l.rowInd)===(h==null?void 0:h.rowInd)||(r.current=h,n(l==null?void 0:l.rowInd,h==null?void 0:h.rowInd))},[n]),[a,c]=m.useState(void 0),u=m.useCallback(h=>{c(l=>l===h?l:h)},[]);return{hoveredCellRef:r,setHoveredCell:s,hoverRow:a,onHoverRowChange:o?u:void 0}}function Dh(o){const t=document.createElement("div");t.style.cssText="position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;visibility:hidden",o.appendChild(t);const e=t.getBoundingClientRect();return o.removeChild(t),{x:e.left,y:e.top}}function Hh(o,t){m.useEffect(()=>{if(!t)return;const e=o.current;if(!e)return;const i=Qt.throttleWithLastCall(()=>{const{x:r,y:n}=Dh(e);e.style.setProperty("--gdg-portal-offset-x",`${r}px`),e.style.setProperty("--gdg-portal-offset-y",`${n}px`)},100);return i(),window.addEventListener("resize",i),e.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),e.removeEventListener("resize",i)}},[o,t])}function Lh(o,t){const{columnsLast:e,rows:i,ctxs:r,refTable:n,theme:s,portalEventTargetRef:a,externalOnItemHovered:c,onHoverRowChange:u}=o,h=m.useRef(null),l=m.useCallback(g=>{const v=h.current;h.current=null,jt({visible:!1,x:0,y:0,width:0,height:0,source:"cell",originId:v??void 0,nodeId:v??void 0},g,!0)},[]),d=m.useCallback(g=>{var p,F,w,S,b;c==null||c(g),u==null||u(g.kind==="cell"?((p=g.rawLocation)==null?void 0:p[1])??g.location[1]:void 0);const v=(a==null?void 0:a.current)??null,C=(F=g.location)==null?void 0:F[0],y=C!=null?e[C]:void 0;if((g.kind==="header"||g.kind==="group-header")&&g.hiddenIndicatorCol!=null){const T=g.hiddenIndicatorCol;h.current===ke.HEADER_TOOLTIP_HIDDEN_COLS_ID||l(v);const I=e.length,B=Math.min(T,I-1),W=(w=t.current)==null?void 0:w.getBounds(B,-1);if(!W)return;const O=T>=I?W.x+W.width:W.x,Z=g.hiddenIndicatorAboveLeaf??0;h.current=ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,jt({visible:!0,x:O-2,y:W.y-Z,width:4,height:W.height+Z,source:"header",originId:ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,nodeId:ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,priority:1},v);return}if(g.kind==="header"){if(!(y!=null&&y.headerCellTooltip)){l(v);return}const T=`header-tooltip-${C}`;h.current===T||l(v);const I=(S=t.current)==null?void 0:S.getBounds(C,-1);if(!I)return;h.current=T,jt({visible:!0,x:I.x,y:I.y,width:I.width,height:I.height,source:"header",originId:T,nodeId:T,priority:0,tooltipContext:{column:y,ctxs:r,refTable:n,colInd:C,theme:s}},v);return}if(g.kind==="cell"){const T=g.location[1],E=i[T];if(!y||!E||!y.cellTooltip){l(v);return}const I=`col-tooltip-${C}-${T}`;h.current===I||l(v);const W=(b=t.current)==null?void 0:b.getBounds(C,T);if(!W)return;h.current=I,jt({visible:!0,x:W.x,y:W.y,width:W.width,height:W.height,source:"cell",originId:I,nodeId:I,priority:0,tooltipContext:{column:y,row:E,ctxs:r,refTable:n,colInd:C,rowInd:T,theme:s}},v);return}l(v)},[e,i,r,n,s,a,c,u,l,t]),f=m.useCallback(()=>{l((a==null?void 0:a.current)??null)},[l,a]);return{onItemHovered:d,hideTooltip:f}}function Ph({enabled:o,portalEventTargetRef:t,headerHeight:e,groupHeaderHeight:i,experimental:r}){const[n,s]=m.useState(0),a=m.useRef(null),c=m.useMemo(()=>{const d=e??qe;let f=typeof d=="number"?d:qe;return Array.isArray(i)?f+=i.reduce((g,v)=>g+v,0):typeof i=="number"&&(f+=i),f},[e,i]),u=m.useRef(c);u.current=c;const h=m.useCallback(d=>{var y;if((y=a.current)==null||y.call(a),a.current=null,!d)return;if(!o){s(0);return}const f=t==null?void 0:t.current;if(!f)return;const g=f.querySelector(".dvn-scroller"),v=f.querySelector(".dvn-underlay");if(!g||!v)return;const C=()=>{const p=g.scrollTop,F=Math.min(p,u.current);s(-1*F),v.style.overflowY="visible",v.style.transform=`translateY(-${F}px)`};g.addEventListener("scroll",C),a.current=()=>{g.removeEventListener("scroll",C),v.style.transform="",v.style.overflowY=""}},[o,t]),l=m.useMemo(()=>o?{...r,paddingBottom:n}:r,[o,n,r]);return{unstickyCallbackRef:h,mergedExperimental:l}}const Bi=Mr.div.withConfig({displayName:"styled__StyledOverlayPortal"})(["[id^='gdg-overlay-']{position:fixed;z-index:9001;margin-left:calc(-1 * var(--gdg-portal-offset-x,0px));margin-top:calc(-1 * var(--gdg-portal-offset-y,0px));}"]),Bh=Mr(P).withConfig({displayName:"styled__StyledGlideDataEditor"})([""]),mt={bgEditableCell:{light:"#FFF6E5",dark:"#211807",highContrastLight:"#F1DDB8",betaCoreLight:"#FFF6E5"},bgEditableCellHovered:{light:"#FFF4E0",dark:"#2A1F09",highContrastLight:"#E8D4AD",betaCoreLight:"#FFF4E0"},selectionCheckboxBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2",betaCoreLight:"#EFF8FF"},selectionActiveBg:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#BFDDF4",betaCoreLight:"#E2F1FB"},selectionActiveCheckboxBg:{light:"#D1E9F8",dark:"#D1E9F8",highContrastLight:"#9BCAEA",betaCoreLight:"#D1E9F8"},selectionServiceBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2",betaCoreLight:"#EFF8FF"},selectionServiceActiveBg:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7",betaCoreLight:"#D4E7F2"},errorOutlineColor:{light:"#FF3D51",dark:"#FF3D51",highContrastLight:"#E9203F",betaCoreLight:"#F81C42"},bgRowHovered:{light:"#F7F9FB",dark:"#F7F9FB",highContrastLight:"#E8EEF2",betaCoreLight:"#F7F9FB"},bgServiceRowHovered:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7",betaCoreLight:"#D4E7F2"},bgSelectedRowHovered:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7",betaCoreLight:"#D4E7F2"}},_h=o=>({tokens:tn(o),fonts:Ke,fontMetrics:Wr,bgEditableCell:mt.bgEditableCell[o],bgEditableCellHovered:mt.bgEditableCellHovered[o],selectionCheckboxBg:mt.selectionCheckboxBg[o],selectionActiveBg:mt.selectionActiveBg[o],selectionActiveCheckboxBg:mt.selectionActiveCheckboxBg[o],selectionServiceBg:mt.selectionServiceBg[o],selectionServiceActiveBg:mt.selectionServiceActiveBg[o],errorOutlineColor:mt.errorOutlineColor[o],bgRowHovered:mt.bgRowHovered[o],bgServiceRowHovered:mt.bgServiceRowHovered[o],bgSelectedRowHovered:mt.bgSelectedRowHovered[o]}),ct={accentColor:{light:"#0b7ecb",dark:"#0b7ecb",highContrastLight:"#0058A2",betaCoreLight:"#0087CD"},accentLight:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#DAE8F1",betaCoreLight:"#E2F1FB"},textDark:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textHeaderSelected:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textGroupHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},bgCell:{light:"#FFFFFF",dark:"#FFFFFF",highContrastLight:"#FFFFFF",betaCoreLight:"#FFFFFF"},bgHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF",betaCoreLight:"#EFF8FF"},bgHeaderHasFocus:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#B9D6E7",betaCoreLight:"#EFF8FF"},bgHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB",betaCoreLight:"#DEECF5"},borderColor:{light:"#D5DFE6",dark:"#D5DFE6",highContrastLight:"#C4CFD7",betaCoreLight:"#CFDBE4"},bgGroupHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF",betaCoreLight:"#EFF8FF"},bgGroupHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB",betaCoreLight:"#DEECF5"}},Rh=o=>({accentColor:ct.accentColor[o],accentLight:ct.accentLight[o],textDark:ct.textDark[o],textHeader:ct.textHeader[o],textHeaderSelected:ct.textHeaderSelected[o],textGroupHeader:ct.textGroupHeader[o],bgCell:ct.bgCell[o],bgHeader:ct.bgHeader[o],bgHeaderHasFocus:ct.bgHeaderHasFocus[o],bgHeaderHovered:ct.bgHeaderHovered[o],borderColor:ct.borderColor[o],bgGroupHeader:ct.bgGroupHeader[o],bgGroupHeaderHovered:ct.bgGroupHeaderHovered[o],hiddenColumnsIndicatorColor:ct.accentColor[o]}),Rr={small:"bodyXXS",medium:"bodyS",big:"bodyM"},kh=(o="big")=>{const t=Ke[Rr[o]],e=Wr[Rr[o]],i=`${e.fontSize}px`,r=e.lineHeightPx,n=Or[o],{cellHorizontalPadding:s,cellVerticalPadding:a}=n;return{headerFontStyle:Ke.bodyXSBold,baseFontStyle:t,fontFamily:'"SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',editorFontSize:i,lineHeight:r,cellHorizontalPadding:s,cellVerticalPadding:a,activeSizes:n}},_o=(o="big",t="light")=>({...Rh(t),...kh(o),..._h(t),rowSize:o}),Mh=_o(),ps=(o,t,e,i)=>{let r=o;for(let s=o;s>=0;s-=1){const a=e(s,t);if(a&&a[0]<=o&&a[1]>=o){r=a[0];break}}const n=i(r,t);return[r,n?n[0]:t]},_i=(o,t)=>{if(o==null)return null;const e=typeof o=="number"?o:o(t);return e<=0?null:[t.colInd,t.colInd+e]},kr=(o,t)=>o==null?null:o(t);function zh(...o){}const Oh={},Ri=o=>Array.isArray(o)?o.filter(t=>typeof t=="string"):typeof o=="string"?[o]:[],Nh=({columns:o,rows:t,bottomSummaryRows:e,rowHeight:i,width:r,rowSize:n="medium",ctxs:s=Oh,freezeColumns:a,onColumnResize:c,renderGroupHeader:u,groupAlignMap:h,refTable:l,onColumnsReorder:d,portalEventTargetRef:f,onItemHovered:g,unstickyHeader:v,resizableColumn:C=!0,minColumnWidth:y=56,maxColumnWidth:p,maxColumnAutoWidth:F,containerRef:w,containerClassName:S,containerStyle:b,renderOverlayFeatures:T,hideGrid:E,contentStateNode:I,fullScreened:B,editorOverlayPortal:W,highlightActiveType:O="disabled",cellsSelectionMode:Z="range-cell",enableColumnSelection:It=!0,enableRowSelection:ne=!0,enableSelectAll:hi=!0,enableLowDprHairline:Ot,gridSelection:Pt,onGridSelectionChange:ui,onSelectionEmit:pe,onColumnSelectionChange:Nt,pendingColumnSelectionKeys:M,onColumnSelectionApplied:N,highlightActiveRow:U,onHighlightActiveRowChange:K,highlightActiveRowControlled:$,highlightRegions:J,checkboxSelectedRowIndexes:V,checkboxVisibleRowIndexes:Q,hoverEffects:et,onCellClicked:rt,onCellContextMenu:bt,onGroupHeaderClicked:Bt,onMouseMove:ye,onVisibleRegionChanged:Fe,portalElementRef:Wh,...Wt})=>{var qo;const Ro=Qt.useActiveTheme(),G=m.useMemo(()=>_o(n,Ro),[n,Ro]),ys=m.useMemo(()=>{const x=typeof i=="number"?i:void 0;if(x)return x;const A=zr[n],D=typeof i=="function"?i:void 0;return D?H=>{const _=t[H];if(!_)return x??A;const R=D(_,{rowSizeName:n,rowSizeValue:A},H);return typeof R=="number"&&!Number.isNaN(R)?R:A}:A},[t,i,n]),Gt=(e==null?void 0:e.length)??0,Fs=Ch(ys),[be,bs]=m.useState(new Map),we=m.useRef(null),ws=m.useCallback((x,A,D,H)=>{var L;const _=x;_.id&&((L=we.current)==null||L.call(we),c==null||c(_,A,D,H),bs(R=>(R.set(_.id,A),new Map(R))))},[c]),_t=m.useMemo(()=>be.size===0?o:o.map(x=>be.has(x.id)?{...x,width:be.get(x.id),grow:0}:x),[o,be]),[ko,Gh]=m.useState(0),di=m.useMemo(()=>new WeakMap,[]),Dt=m.useRef(null);m.useEffect(()=>{var x;(Pt==null?void 0:Pt.current)!==void 0&&((x=Dt.current)==null||x.focus())},[Pt]);const{interactionSessionStore:ft,beginOrGetInteractionSession:xs,consumeCanvasClickResult:Ss}=Ah(),Mo=Fh(ft),{selection:Rt,handleGridSelectionChange:As,handleSelectionCleared:Es,rangeSelect:Ts}=ds({cellsSelectionMode:Z,gridSelection:Pt,onGridSelectionChange:ui,onSelectionEmit:pe}),ht=fs({columns:_t,selection:Rt,cellsSelectionMode:Z,checkboxSelectedRowIndexes:V}),Is=m.useMemo(()=>K?x=>K(x,x!==void 0?t[x]:void 0):void 0,[K,t]),{selectedColumnIndexes:Ds,selectedColumnKeysAll:zo,selectColumnsByKeys:xe,selectedColumnSet:Se,headerSelectedRowIndexes:Oo,activeRow:Hs,numberingColumnIndex:No,drawFocusRing:Ls,selectColumnFromHeader:Wo,handleGridSelectionWithColumnReset:Ps,handleSelectionClearedWithColumns:Bs}=gs({columns:_t,selection:Rt,cellsSelectionMode:Z,highlightActiveType:O,enableColumnSelection:It,enableRowSelection:ne,enableSelectAll:hi,leadingServiceColumnsCount:ht.leadingServiceColumnsCount,dataRowCount:t.length+Gt,handleGridSelectionChange:As,handleSelectionCleared:Es,onSelectionEmit:pe,highlightActiveRow:U,onHighlightActiveRowChange:Is,isHighlightActiveRowControlled:$});m.useEffect(()=>{Nt==null||Nt(zo)},[zo,Nt]),m.useEffect(()=>{if(!M)return;xe(M);const x=setTimeout(()=>N==null?void 0:N(),0);return()=>clearTimeout(x)},[M,_t,xe,N]);const Ae=Oo.length>0,Ee=m.useMemo(()=>{var D;const x=new Set,A=(D=Rt.current)==null?void 0:D.rangeStack;if(A){const H=ht.firstDataColumnIndex;for(const _ of A){const L=Math.max(_.x,H);for(let R=L;R<_.x+_.width;R+=1)x.add(R)}}return x},[Rt,ht.firstDataColumnIndex]),Y=m.useMemo(()=>_t.map((x,A)=>{const D={...x.themeOverride??{}};let H=Object.keys(D).length>0;return x.isServiceColumn&&(D.bgCell=G.selectionServiceBg,H=!0),A===No&&(D.accentLight="transparent",D.accentColor="transparent",H=!0),(ht.isActiveHeaderColumn(A)||Se.has(A)||Ee.has(A)||Ae&&!x.isServiceColumn)&&(D.bgHeader=G.selectionServiceActiveBg,D.bgHeaderHasFocus=G.selectionServiceActiveBg,H=!0),H?{...x,themeOverride:D}:x}),[_t,ht,Se,Ee,Ae,No,G.selectionServiceBg,G.selectionServiceActiveBg]),Te=!!(et!=null&&et.row),{hoveredCellRef:_s,setHoveredCell:Ie,hoverRow:fi,onHoverRowChange:Rs}=Ih({isRowHoverEnabled:Te,dataEditorRef:Dt,columnsCount:Y.length,rowsCount:t.length}),{errorCellRanges:ks,trackVisibleRegion:Go}=vh({columns:_t,rows:t,freezeColumns:a,selectedRange:(qo=Rt.current)==null?void 0:qo.range}),Ms=m.useCallback((x,A,D,H)=>{Go(x),Fe==null||Fe(x,A,D,H)},[Go,Fe]),se=m.useCallback(([x,A],D)=>{var _e,jo,Re,Jo;zh(ko);const H=(D==null?void 0:D.applyCanvasEditorActivation)!==!1,_=nt=>H?Mo([x,A],nt):nt,L=!!e&&A>t.length-1,R=t[A],k=Y[x];if(!k)return Jt();if(L){const nt=e[A-t.length],{renderSummaryCell:Lt,colSpan:st}=k,Qo={bgCell:G.bgHeader};if(!Lt||!nt)return Jt({themeOverride:Qo});const wi={row:nt,column:k,colInd:x,rowInd:A,ctxs:s,theme:G,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}},aa=Lt(wi),tr=_i(st,wi),ca={data:"",themeOverride:Qo,...tr&&{span:tr}};return _(Lr({jsxElement:aa,canvasCellCache:di,cellInfo:wi,options:{...ca,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))}if(!R)return Jt();const ot=(nt,Lt,st)=>({row:t[st],column:nt,colInd:Lt,rowInd:st,ctxs:s,theme:G,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}}),[q,j]=ps(x,A,(nt,Lt)=>{const st=Y[nt];return st!=null&&st.colSpan?_i(st.colSpan,ot(st,nt,Lt)):null},(nt,Lt)=>{const st=Y[nt];return st!=null&&st.rowSpan?kr(st.rowSpan,ot(st,nt,Lt)):null});if(q!==x||j!==A)return se([q,j],D);const X=_s.current,z={row:R,column:k,colInd:x,rowInd:A,ctxs:s,theme:G,hovered:{cellHover:(X==null?void 0:X.colInd)===x&&(X==null?void 0:X.rowInd)===A,rowHover:(X==null?void 0:X.rowInd)===A},active:{cellActive:ht.isActiveDataCell(x,A),rowActive:ht.isActiveRow(A)}},{renderCell:Xt,id:Ht,colSpan:mi,rowSpan:De,spanAlign:He,editable:Le,contentAlign:ra,columnThemeOverride:Ko}=k,na=((jo=(_e=R[Ht])==null?void 0:_e.toString)==null?void 0:jo.call(_e))??"NOT FOUND",Pe=_i(mi,z),Be=kr(De,z),pi=(Pe||Be)&&He?typeof He=="function"?He(z):He:void 0,Zo=Le?typeof Le=="boolean"?Le:Le(R):!1,yi=typeof Ko=="function"?Ko(z):void 0,Fi={data:((Jo=(Re=R[Ht])==null?void 0:Re.toString)==null?void 0:Jo.call(Re))??"NOT FOUND",...Zo?{readonly:!1,allowOverlay:!0}:{readonly:!0,...k.hasPreview===!0&&{allowOverlay:!0},...k.hasPreview==="none"&&{allowOverlay:!1}},themeOverride:{...yi,...Zo&&{bgCell:G.bgEditableCell}},contentAlign:ra,...Pe&&{span:Pe},...Be&&{spanRows:Be},...pi&&{spanAlign:pi}};if(!Xt){const nt=String(na);return Lo(nt)?_(ti(nt,Fi)):_(Jt(Fi))}const bi=yi?{...z,theme:{...G,...yi}}:z,sa=Xt(Pe||Be?{...bi,__mergedCell:{align:pi}}:bi);return _(Lr({jsxElement:sa,canvasCellCache:di,cellInfo:bi,options:{...Fi,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))},[ko,e,t,Y,s,G,ht,di,f,Mo]),zs=m.useCallback((x,A)=>{var z;const D=se(x,{applyCanvasEditorActivation:!1});if(!Eo(D)){rt==null||rt(x,A);return}let H=!1;const _=A.preventDefault;A.preventDefault=()=>{H=!0,_()};const L=te({colIndex:x[0],rowIndex:x[1]},A.bounds),R=ee(L,D),k={x:A.localEventX,y:A.localEventY},ot=Cs({cell:x,glideCell:D,rect:A.bounds,renderData:R,relativePoint:k}),q=ot?ft.beginOrGet({cell:x,relativePoint:k,interaction:ot.interaction,button:A.button,source:"click"}):ft.beginOrGet({cell:x,relativePoint:k,interaction:Jr(),button:A.button,source:"click"}),j=To({cell:D,rect:A.bounds,relativePoint:k,renderData:R,rowData:t[x[1]],rowIndex:x[1]}),X=q?Al({decision:q.decision,propagationStopped:j.propagationStopped,suppressGridDefault:j.suppressGridDefault}):{suppressExternalCellClick:j.propagationStopped,suppressGridDefaultForClick:j.suppressGridDefault};if(q&&(ft.consumePhase(q,"cell-click"),ft.storeClickResult(q,j)),A.button===0&&((z=X.editorRequest)==null?void 0:z.target)==="self"&&ft.armEditorRequest(q,X.editorRequest),X.suppressGridDefaultForClick&&(A.preventDefault(),q!=null&&q.decision.editorRequest&&ft.clear()),X.suppressExternalCellClick||rt==null||rt(x,A),H||A.button===1){ft.clear();return}},[se,ft,rt,t]),Os=m.useCallback((x,A)=>{ft.isMatchingRecent("contextmenu-capture",x)||bt==null||bt(x,A)},[ft,bt]),Ns=Eh({beginOrGetInteractionSession:xs,consumeCanvasClickResult:Ss}),$t=m.useRef(null),Ut=m.useRef(null),ae=m.useMemo(()=>new Map,[]),$o=m.useMemo(()=>new Map,[]),gi=m.useRef(null),kt=m.useRef(null),Ws=m.useMemo(()=>Qt.mergeRefs(kt,w),[w]),{drawHeader:Gs,onHeaderClicked:$s}=m.useMemo(()=>({drawHeader:(D,H)=>{var De;const{ctx:_,rect:L,columnIndex:R}=D,k=Y[R];if(!k||!k.renderHeaderCell)return H();const ot={column:k,drawArgs:D,ctxs:s,theme:G};let q=k.renderHeaderCell(ot);if(!ro(q))return H();typeof q=="string"&&(q=wt.jsx(Ce.Container,{style:{width:"100%"},alignItems:"center",children:wt.jsx(Ce.Text,{children:q})}));const j=`header-${k.id}-${R}`,X=Qe({element:q,idPrefix:j,theme:G});let z;ae.has(k.id)?(z=ae.get(k.id),z==null||z.setRootNode(X),z!=null&&z.rootNode&&(z.rootNode.style={width:L.width,height:L.height})):(z=new Ft(X,j),z.rootNode.style={width:L.width,height:L.height},ae.set(k.id,z)),z==null||z.setPortalEventTarget((f==null?void 0:f.current)??null),z==null||z.setTooltipContext({column:k,ctxs:s,refTable:l,theme:G});const Xt=((De=$t.current)==null?void 0:De.id)===k.id?$t.current:void 0,Ht=_.canvas.getBoundingClientRect(),mi={x:Ht.left+L.x,y:Ht.top+L.y,width:L.width,height:L.height};return z==null?void 0:z.render(_,L,Xt,mi)},onHeaderClicked:(D,H)=>{const _=Y[D];if(_){if(_.renderHeaderCell){const L=ae.get(_.id);if(L){const R=L.getInteractionAtPoint(H.localEventX,H.localEventY);if(L.dispatchPointerEvent("click",H.localEventX,H.localEventY),R)return}}Wo(D,H)}}}),[Y,s,G,ae,f,Dt,Wo]),Us=m.useCallback((x,A)=>{const D=Y[x];if(!It||!D){Bt==null||Bt(x,A);return}const H=Ri(D.group),_=Math.max(0,H.indexOf(A.group)),L=H.slice(0,_+1).join("\0"),R=j=>{const X=Y[j];return X!==void 0&&Ri(X.group).slice(0,_+1).join("\0")===L};let k=x,ot=x;for(;k-1>=0&&R(k-1);)k-=1;for(;ot+1<Y.length&&R(ot+1);)ot+=1;const q=[];for(let j=k;j<=ot;j+=1){const X=Y[j];X&&!X.isServiceColumn&&q.push(X.id)}q.length>0&&xe(q),Bt==null||Bt(x,A)},[It,Y,xe,Bt]),Uo=m.useMemo(()=>{const x=new Map;Y.forEach((D,H)=>{if(D.isServiceColumn)return;const _=ht.isActiveHeaderColumn(H)||Se.has(H)||Ee.has(H)||Ae;Ri(D.group).forEach(L=>{if(L==="")return;const R=x.get(L);x.set(L,(R??!0)&&_)})});const A=new Set;return x.forEach((D,H)=>{D&&A.add(H)}),A},[Y,ht,Se,Ee,Ae]),Xs=m.useCallback(x=>{const A=h==null?void 0:h.get(x),D={name:x,...A&&{spanAlign:A}};return Uo.has(x)?{...D,overrideTheme:{bgGroupHeader:G.selectionServiceActiveBg,bgGroupHeaderHovered:G.bgHeaderHovered}}:D},[h,Uo,G.selectionServiceActiveBg,G.bgHeaderHovered]),{glideContainer:Ci,isReady:Vs,renderInContainer:Ys}=Th(kt,B),Xo=W==="inside";Hh(kt,Xo),ph({eventTarget:Ci??kt.current,dataEditorRef:Dt,getCellContent:se,interactionSessionStore:ft,onCellContextMenuExternal:bt});const{unstickyCallbackRef:Vo,mergedExperimental:vi}=Ph({enabled:v,portalEventTargetRef:f,headerHeight:Wt.headerHeight,groupHeaderHeight:Wt.groupHeaderHeight,experimental:Wt.experimental}),qs=m.useMemo(()=>Qt.mergeRefs(Dt,l,Vo),[l,Vo]),Ks=m.useMemo(()=>Ot===void 0?vi:{...vi,enableLowDprHairline:Ot},[Ot,vi]),Zs=m.useCallback(x=>{ye==null||ye(x),x.kind==="cell"?(()=>{const D=x.location[0],H=x.location[1],_=t[H],L=Y[D];if(!_||!L||L.isServiceColumn){Ie(null);return}Ie({colInd:D,rowInd:H})})():Ie(null),x.kind==="group-header"?(()=>{if(typeof x.group!="string"){Ut.current=null;return}Ut.current={id:x.group,x:x.localEventX,y:x.localEventY}})():Ut.current=null,x.kind==="header"?(()=>{var L,R;const D=x.location[0],H=x.location[1],_=Y[D];if(!_||!(_!=null&&_.renderHeaderCell)){$t.current=null;return}$t.current={id:_.id,x:x.localEventX,y:x.localEventY},(R=(L=Dt.current)==null?void 0:L.updateCells)==null||R.call(L,[{cell:[D,H]}])})():$t.current=null,$t.current=null,Ut.current=null},[Y,ye,t,Ie]),Yo={dataEditorRef:Dt,rowCount:t.length,columnCount:Y.length,headerAndGroupHeaderRowsCount:1+(Wt.groupHeaderHeight??[]).length};cs(Yo),as(Yo);const js=m.useMemo(()=>d?(A,D)=>{var L,R;const H=(L=Y[A])==null?void 0:L.id,_=(R=Y[D])==null?void 0:R.id;typeof H!="string"||typeof _!="string"||d(H,_)}:void 0,[Y,d]),Js=m.useMemo(()=>{if(u)return(x,A)=>{var Ht;const D=u(x);if(D==="default")return A();if("defaultWithCustomGroupName"in D)return A(D.defaultWithCustomGroupName);const{groupName:_,rect:L,ctx:R}=x;let k=D;if(!ro(k))return A();typeof k=="string"&&(k=wt.jsx(Ce.Container,{style:{width:"100%"},alignItems:"center",children:wt.jsx(Ce.Text,{children:k})}));const ot=_,q=Qe({element:k,idPrefix:ot,theme:G}),j=new Ft(q,ot);j.rootNode.style={width:L.width,height:L.height},j.setPortalEventTarget((f==null?void 0:f.current)??null),$o.set(ot,j);const X=((Ht=Ut.current)==null?void 0:Ht.id)===ot?Ut.current:void 0,z=R.canvas.getBoundingClientRect(),Xt={x:z.left+L.x,y:z.top+L.y,width:L.width,height:L.height};return j.render(R,L,X,Xt)}},[$o,u,G,f]),Qs=m.useMemo(()=>{const x=!!(V!=null&&V.size),A=Te?fi:void 0;if(!Gt&&!x&&A===void 0)return;const D=G.bgRowHovered;return H=>V!=null&&V.has(H)?{bgCell:H===A?G.bgSelectedRowHovered:G.selectionCheckboxBg}:H===A?{bgCell:D}:{}},[Gt,G.selectionCheckboxBg,G.bgRowHovered,G.bgSelectedRowHovered,V,Te,fi]),{onItemHovered:ta,hideTooltip:ea}=Lh({columnsLast:Y,rows:t,ctxs:s,refTable:l,theme:G,portalEventTargetRef:f,externalOnItemHovered:g,onHoverRowChange:Rs},Dt);we.current=ea;const ia=us({theme:G,cellsSelectionMode:Z,selection:Rt,serviceColumnsCount:ht.leadingServiceColumnsCount,activeDataRange:ht.activeDataRange,outlineRange:ht.outlineRange,checkboxSelectedRowIndexes:V,errorCellRanges:ks,highlightRegionsExternal:J,selectedColumnIndexes:Ds,headerSelectedRowIndexes:Oo,activeRow:Hs,checkboxVisibleRowIndexes:Q,totalRows:t.length+Gt,columnsCount:_t.length,isRowHoverEnabled:Te,hoverRow:fi,dataRowsCount:t.length}),oa=m.useMemo(()=>{if(!(!b&&!I&&!E))return{...b,...I?{position:"relative"}:void 0,...E?{height:"100%",minHeight:0}:void 0}},[b,I,E]);return wt.jsxs("div",{ref:Ws,className:S,style:oa,children:[Xo?$e.createPortal(wt.jsx(Bi,{ref:gi,onAnimationEndCapture:x=>x.stopPropagation(),id:"portal"}),(kt==null?void 0:kt.current)??document.body):$e.createPortal(wt.jsx(Bi,{id:"portal",ref:gi}),document.body),$e.createPortal(wt.jsx(Bi,{id:"portal2"}),document.body),!E&&wt.jsx(Bh,{ref:qs,className:"gdg-table",portalElementRef:gi,theme:G,getRowThemeOverride:Qs,onHeaderClicked:$s,onGroupHeaderClicked:Us,onMouseMove:Zs,drawHeader:Gs,drawGroupHeader:Js,getGroupDetails:Xs,getCellContent:se,columns:Y,rows:t.length+Gt,freezeTrailingRows:Gt,freezeColumns:a,minColumnWidth:y,maxColumnAutoWidth:F,maxColumnWidth:p,columnSelect:"none",columnSelectionBlending:"exclusive",drawFocusRing:Ls,gridSelection:Rt,onGridSelectionChange:Ps,onSelectionCleared:Bs,width:r??"100%",onColumnMoved:js,onColumnResize:C?ws:void 0,customRenderers:Ns,rowHeight:Fs,highlightRegions:ia,rangeSelect:Ts,smoothScrollX:!0,smoothScrollY:!0,headerHeight:qe,onCellClicked:zs,onCellContextMenu:Os,onItemHovered:ta,onVisibleRegionChanged:Ms,...Wt,experimental:Ks,keybindings:{...Wt.keybindings,copy:!1,paste:!1},onPaste:!1}),I,Vs&&Ci&&(T==null?void 0:T({containerElement:Ci,renderInContainer:Ys}))]})};exports.BUTTON_PADDING_Y=oe;exports.CACHE_SEPARATOR=go;exports.CANVAS_CELL_KIND=ci;exports.CANVAS_PORTAL_EVENT=je;exports.Canvas=Ce;exports.CanvasAbsoluteContainer=Aa;exports.CanvasAvatar=ve;exports.CanvasAvatarGroup=co;exports.CanvasBadge=En;exports.CanvasButton=Tn;exports.CanvasChevron=sc;exports.CanvasContainer=dt;exports.CanvasEmbedIconButton=Xi;exports.CanvasHoverController=so;exports.CanvasIcon=In;exports.CanvasIconButton=Dn;exports.CanvasImage=So;exports.CanvasLeaf=vt;exports.CanvasLink=_n;exports.CanvasNode=Mt;exports.CanvasRect=Rn;exports.CanvasRegistry=Qr;exports.CanvasRoot=Ha;exports.CanvasSkeleton=Mn;exports.CanvasText=Ao;exports.CellCanvasRoot=Ft;exports.DANGER_COLOR=fo;exports.DANGER_TEXT_COLOR=Mi;exports.DEFAULT_ACCENT_FG=me;exports.DEFAULT_BORDER_WIDTH=Et;exports.DEFAULT_BUTTON_RADIUS=ho;exports.DEFAULT_CURSOR=Nn;exports.DEFAULT_HEADER_HEIGHT=qe;exports.DEFAULT_ICON_SIZE=nn;exports.DEFAULT_ICON_SPACING=uo;exports.DEFAULT_ROW_HEIGHT=zr;exports.DEFAULT_SECONDARY_HOVER=sn;exports.DEFAULT_SIZE=si;exports.DEFAULT_TEXT_PADDING=Na;exports.DEFAULT_VIEW=ai;exports.DISABLED_BG_COLOR=an;exports.DISABLED_BORDER_COLOR=cn;exports.DISABLED_TEXT_COLOR=zi;exports.DrawBatcher=ri;exports.EMPTY_CELL_OBJ=ua;exports.FlexBox=At;exports.FlexElement=$r;exports.FlexTreeBuilder=Yr;exports.HEX_COLOR_CHAR_CODE=hn;exports.HEX_COLOR_PREFIX=ln;exports.ICON_SIZE_ADJUSTMENT=re;exports.IconSpriteManager=vn;exports.LEGACY_HOVER_CURSOR=Wn;exports.LIGHTEN_AMOUNT=Co;exports.LayoutReconciler=qr;exports.MAX_ICON_SIZE=lo;exports.POINTER_CANDIDATE_KEYS=On;exports.PositionResolver=xt;exports.RELATIVE_COORD_TOLERANCE=ge;exports.RootBridge=Nl;exports.RootFlexBox=no;exports.SIZES=Or;exports.SIZE_CONFIG=at;exports.SizeAccumulator=oi;exports.TABLE_GLIDE_SIZES=da;exports.THEME=Mh;exports.TableGlide=Nh;exports.VIEW_COLORS=ni;exports.buildButtonViewColors=rn;exports.buildCanvasTree=Qe;exports.buildCellId=te;exports.calculateButtonWidth=po;exports.calculateContentWidth=yo;exports.canvasCellRenderer=El;exports.clearButtonCaches=Wa;exports.clearIconCache=Il;exports.createCanvasCell=zn;exports.createCanvasCellRenderer=Io;exports.createEmptyCellGlide=Jt;exports.createNormalCanvasInteraction=Jr;exports.createRafUpdate=Ho;exports.createSvgDataUrl=Ui;exports.createTextCellGlide=ti;exports.defaultBatcher=Da;exports.defaultIconManager=Tt;exports.dispatchCanvasPortalHover=jt;exports.drawButton=wn;exports.drawButtonWithView=xn;exports.drawEmbedIconButtonWithView=Sn;exports.drawIcon=Fn;exports.drawIcon$1=Ct;exports.drawIconButton=xo;exports.drawIconButtonWithView=An;exports.drawIconDirect=qa;exports.findBlockOrigin=ps;exports.flexBoxLayout=ya;exports.fontStyles=Ke;exports.getCachedTextWidth=mo;exports.getCellIndices=Xe;exports.getDpr=Ve;exports.getHoverState=jn;exports.getIconCacheSize=Dl;exports.getIconImageDirect=bn;exports.getIconSprite=pn;exports.getIconSpriteStats=Va;exports.getRelativePointerPosition=Gn;exports.getRowHeightBySize=Ue;exports.getTheme=_o;exports.handleCanvasRootClick=Xn;exports.handleCanvasRootHover=Jn;exports.handleCellClick=Yn;exports.handleClickHandlers=Vn;exports.hashString=Cn;exports.isAbsoluteCoords=$n;exports.isCanvasCell=Eo;exports.isCanvasContent=ro;exports.isCanvasEl=li;exports.isCanvasString=Po;exports.isGlideCellObj=sh;exports.isGlideGridCellObj=ls;exports.isHoveringBounds=zt;exports.isObject=nh;exports.isPointInArea=wo;exports.isPortalHoverLocked=gl;exports.isPrimitive=Lo;exports.isReactIcon=St;exports.isRelativeCoords=Un;exports.isValueEmpty=hs;exports.lightenColor=vo;exports.lightenColorCached=un;exports.lockPortalHover=fl;exports.normalizeCanvasInteraction=jr;exports.normalizeDimensionValue=eo;exports.normalizeHoverPoint=gn;exports.normalizeIcon=pt;exports.onAnyIconLoad=mn;exports.performCanvasClick=To;exports.performCanvasPointerDownIntent=es;exports.preloadIconSprites=yn;exports.queryGlideElements=ms;exports.reactIconToSvg=is;exports.rectContainsCell=Bo;exports.registerIconDefinitions=Xa;exports.resetIconSpriteCache=Ya;exports.resolveButtonColors=Fo;exports.resolveClickPoint=Gi;exports.resolveDangerColors=fn;exports.resolvePaddingBox=Ur;exports.resolvePaddingBox$1=Zr;exports.resolvePrimaryColors=Wi;exports.resolveSecondaryColors=dn;exports.resolveViewColors=bo;exports.retrieveRenderData=ee;exports.storeRenderData=Kn;exports.subscribeToCanvasPortalHover=wl;exports.subscribeToPortalHoverLock=Cl;exports.toRelativePoint=$i;exports.updateGridCells=Do;exports.updateHoverState=Zn;exports.updateHoverStateIfNeeded=Qn;exports.useCanvasRegistry=rh;exports.useColoringLayers=us;exports.useFontLoadRedraw=as;exports.useIconLoadRedraw=cs;exports.useNativeGridSelection=ds;exports.useSelectionGeometry=fs;exports.useTableSelectionSystem=gs;exports.waitForCanvasFonts=ns;exports.waitForDocumentFonts=rs;exports.waitForFonts=ss;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SIDEBAR_DURATION = 0.5;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SidebarTab } from '../../widgets/control-block/types';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
|
|
4
|
-
export declare const TableSidebar: React.FC<{
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
activeTabId: string | null;
|
|
7
|
-
$borderRightBottomRadiusRounded?: boolean | undefined;
|
|
8
|
-
$borderRightTopRadiusRounded?: boolean | undefined;
|
|
9
|
-
sidebarTabs: SidebarTab[];
|
|
10
|
-
defaultActiveTabId?: string;
|
|
11
|
-
activeTabState?: [
|
|
12
|
-
string | null,
|
|
13
|
-
React.Dispatch<React.SetStateAction<string | null>>
|
|
14
|
-
];
|
|
15
|
-
onActiveTabChange?: (tabId: string | null, tab?: SidebarTab) => void;
|
|
16
|
-
}>;
|
|
File without changes
|