@carto/meridian-ds 0.1.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/CHANGELOG.md +1 -0
- package/LICENSE +29 -0
- package/README.md +38 -0
- package/dist/Alert-Dd9Op7y8.js +4754 -0
- package/dist/Alert-l8e3Fw5e.cjs +4 -0
- package/dist/arrow-drop-icon-BGl72Unt.cjs +1 -0
- package/dist/arrow-drop-icon-CHxPlPIN.js +16 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.js +1249 -0
- package/dist/createSvgIcon-BhsoeSAN.cjs +68 -0
- package/dist/createSvgIcon-CcKa-Sbo.js +3929 -0
- package/dist/custom-icons/index.cjs +1 -0
- package/dist/custom-icons/index.js +60 -0
- package/dist/jsx-runtime-B6kdoens.js +634 -0
- package/dist/jsx-runtime-Cek9Ww4S.cjs +30 -0
- package/dist/paletteUtils-B489IFFw.js +320 -0
- package/dist/paletteUtils-DELR0VRh.cjs +3 -0
- package/dist/search-icon-DHF2JDWR.cjs +1 -0
- package/dist/search-icon-FnUa1LqH.js +38 -0
- package/dist/theme/index.cjs +76 -0
- package/dist/theme/index.js +3863 -0
- package/dist/types/components/atoms/Button.d.ts +7 -0
- package/dist/types/components/atoms/Button.d.ts.map +1 -0
- package/dist/types/components/atoms/LabelWithIndicator.d.ts +8 -0
- package/dist/types/components/atoms/LabelWithIndicator.d.ts.map +1 -0
- package/dist/types/components/atoms/PasswordField.d.ts +4 -0
- package/dist/types/components/atoms/PasswordField.d.ts.map +1 -0
- package/dist/types/components/atoms/SelectField.d.ts +15 -0
- package/dist/types/components/atoms/SelectField.d.ts.map +1 -0
- package/dist/types/components/atoms/ToggleButtonGroup.d.ts +7 -0
- package/dist/types/components/atoms/ToggleButtonGroup.d.ts.map +1 -0
- package/dist/types/components/atoms/Typography.d.ts +14 -0
- package/dist/types/components/atoms/Typography.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +13 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +7 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/molecules/AccordionGroup.d.ts +12 -0
- package/dist/types/components/molecules/AccordionGroup.d.ts.map +1 -0
- package/dist/types/components/molecules/Alert.d.ts +18 -0
- package/dist/types/components/molecules/Alert.d.ts.map +1 -0
- package/dist/types/components/molecules/Autocomplete.d.ts +19 -0
- package/dist/types/components/molecules/Autocomplete.d.ts.map +1 -0
- package/dist/types/components/molecules/Avatar.d.ts +6 -0
- package/dist/types/components/molecules/Avatar.d.ts.map +1 -0
- package/dist/types/components/molecules/Menu/Menu.d.ts +8 -0
- package/dist/types/components/molecules/Menu/Menu.d.ts.map +1 -0
- package/dist/types/components/molecules/Menu/MenuItem.d.ts +10 -0
- package/dist/types/components/molecules/Menu/MenuItem.d.ts.map +1 -0
- package/dist/types/components/molecules/Menu/MenuList.d.ts +8 -0
- package/dist/types/components/molecules/Menu/MenuList.d.ts.map +1 -0
- package/dist/types/components/molecules/Menu/index.d.ts +7 -0
- package/dist/types/components/molecules/Menu/index.d.ts.map +1 -0
- package/dist/types/components/molecules/MultipleSelectField/Filters.d.ts +9 -0
- package/dist/types/components/molecules/MultipleSelectField/Filters.d.ts.map +1 -0
- package/dist/types/components/molecules/MultipleSelectField/MultipleSelectField.d.ts +31 -0
- package/dist/types/components/molecules/MultipleSelectField/MultipleSelectField.d.ts.map +1 -0
- package/dist/types/components/molecules/MultipleSelectField/index.d.ts +3 -0
- package/dist/types/components/molecules/MultipleSelectField/index.d.ts.map +1 -0
- package/dist/types/components/molecules/MultipleSelectField/useMultipleSelectField.d.ts +11 -0
- package/dist/types/components/molecules/MultipleSelectField/useMultipleSelectField.d.ts.map +1 -0
- package/dist/types/components/molecules/Table/TablePaginationActions.d.ts +9 -0
- package/dist/types/components/molecules/Table/TablePaginationActions.d.ts.map +1 -0
- package/dist/types/components/molecules/Table/index.d.ts +3 -0
- package/dist/types/components/molecules/Table/index.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/FilesAction.d.ts +13 -0
- package/dist/types/components/molecules/UploadField/FilesAction.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/StyledUploadField.d.ts +8 -0
- package/dist/types/components/molecules/UploadField/StyledUploadField.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/UploadField.d.ts +15 -0
- package/dist/types/components/molecules/UploadField/UploadField.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/UploadFieldBase.d.ts +17 -0
- package/dist/types/components/molecules/UploadField/UploadFieldBase.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/index.d.ts +5 -0
- package/dist/types/components/molecules/UploadField/index.d.ts.map +1 -0
- package/dist/types/components/molecules/UploadField/useFileUpload.d.ts +19 -0
- package/dist/types/components/molecules/UploadField/useFileUpload.d.ts.map +1 -0
- package/dist/types/components/molecules/index.d.ts +17 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/AppBar.d.ts +11 -0
- package/dist/types/components/organisms/AppBar/AppBar.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/BrandLogo.d.ts +4 -0
- package/dist/types/components/organisms/AppBar/BrandLogo.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/BrandText.d.ts +4 -0
- package/dist/types/components/organisms/AppBar/BrandText.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/BurgerMenu.d.ts +4 -0
- package/dist/types/components/organisms/AppBar/BurgerMenu.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/SecondaryText.d.ts +4 -0
- package/dist/types/components/organisms/AppBar/SecondaryText.d.ts.map +1 -0
- package/dist/types/components/organisms/AppBar/index.d.ts +3 -0
- package/dist/types/components/organisms/AppBar/index.d.ts.map +1 -0
- package/dist/types/components/organisms/TooltipData.d.ts +12 -0
- package/dist/types/components/organisms/TooltipData.d.ts.map +1 -0
- package/dist/types/components/organisms/index.d.ts +5 -0
- package/dist/types/components/organisms/index.d.ts.map +1 -0
- package/dist/types/custom-icons/arrow-drop-icon.d.ts +3 -0
- package/dist/types/custom-icons/arrow-drop-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/circle-icon.d.ts +3 -0
- package/dist/types/custom-icons/circle-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/cursor-icon.d.ts +3 -0
- package/dist/types/custom-icons/cursor-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/graph-line-icon.d.ts +3 -0
- package/dist/types/custom-icons/graph-line-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/index.d.ts +12 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -0
- package/dist/types/custom-icons/lasso-icon.d.ts +3 -0
- package/dist/types/custom-icons/lasso-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/layer-icon.d.ts +3 -0
- package/dist/types/custom-icons/layer-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/opacity-icon.d.ts +3 -0
- package/dist/types/custom-icons/opacity-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/polygon-icon.d.ts +3 -0
- package/dist/types/custom-icons/polygon-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/rectangle-icon.d.ts +3 -0
- package/dist/types/custom-icons/rectangle-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/search-icon.d.ts +3 -0
- package/dist/types/custom-icons/search-icon.d.ts.map +1 -0
- package/dist/types/custom-icons/upload-icon.d.ts +3 -0
- package/dist/types/custom-icons/upload-icon.d.ts.map +1 -0
- package/dist/types/hooks/useImperativeIntl.d.ts +3 -0
- package/dist/types/hooks/useImperativeIntl.d.ts.map +1 -0
- package/dist/types/hooks/usePrevious.d.ts +2 -0
- package/dist/types/hooks/usePrevious.d.ts.map +1 -0
- package/dist/types/hooks/useSkeleton.d.ts +5 -0
- package/dist/types/hooks/useSkeleton.d.ts.map +1 -0
- package/dist/types/localization/en.d.ts +120 -0
- package/dist/types/localization/en.d.ts.map +1 -0
- package/dist/types/localization/es.d.ts +118 -0
- package/dist/types/localization/es.d.ts.map +1 -0
- package/dist/types/localization/id.d.ts +120 -0
- package/dist/types/localization/id.d.ts.map +1 -0
- package/dist/types/localization/index.d.ts +355 -0
- package/dist/types/localization/index.d.ts.map +1 -0
- package/dist/types/theme/carto-theme.d.ts +4077 -0
- package/dist/types/theme/carto-theme.d.ts.map +1 -0
- package/dist/types/theme/index.d.ts +5 -0
- package/dist/types/theme/index.d.ts.map +1 -0
- package/dist/types/theme/sections/components/buttons.d.ts +3 -0
- package/dist/types/theme/sections/components/buttons.d.ts.map +1 -0
- package/dist/types/theme/sections/components/data-display.d.ts +4 -0
- package/dist/types/theme/sections/components/data-display.d.ts.map +1 -0
- package/dist/types/theme/sections/components/feedback.d.ts +3 -0
- package/dist/types/theme/sections/components/feedback.d.ts.map +1 -0
- package/dist/types/theme/sections/components/forms.d.ts +3 -0
- package/dist/types/theme/sections/components/forms.d.ts.map +1 -0
- package/dist/types/theme/sections/components/navigation.d.ts +3 -0
- package/dist/types/theme/sections/components/navigation.d.ts.map +1 -0
- package/dist/types/theme/sections/components/surfaces.d.ts +3 -0
- package/dist/types/theme/sections/components/surfaces.d.ts.map +1 -0
- package/dist/types/theme/sections/css-baseline.d.ts +905 -0
- package/dist/types/theme/sections/css-baseline.d.ts.map +1 -0
- package/dist/types/theme/sections/palette.d.ts +4 -0
- package/dist/types/theme/sections/palette.d.ts.map +1 -0
- package/dist/types/theme/sections/shadows.d.ts +3 -0
- package/dist/types/theme/sections/shadows.d.ts.map +1 -0
- package/dist/types/theme/sections/typography.d.ts +1706 -0
- package/dist/types/theme/sections/typography.d.ts.map +1 -0
- package/dist/types/theme/theme-constants.d.ts +14 -0
- package/dist/types/theme/theme-constants.d.ts.map +1 -0
- package/dist/types/theme/theme-utils.d.ts +2 -0
- package/dist/types/theme/theme-utils.d.ts.map +1 -0
- package/dist/types/theme/types.d.ts +99 -0
- package/dist/types/theme/types.d.ts.map +1 -0
- package/dist/types/utils/animationUtils.d.ts +30 -0
- package/dist/types/utils/animationUtils.d.ts.map +1 -0
- package/dist/types/utils/chartConstants.d.ts +7 -0
- package/dist/types/utils/chartConstants.d.ts.map +1 -0
- package/dist/types/utils/detectTouchScreen.d.ts +2 -0
- package/dist/types/utils/detectTouchScreen.d.ts.map +1 -0
- package/dist/types/utils/formatterUtils.d.ts +18 -0
- package/dist/types/utils/formatterUtils.d.ts.map +1 -0
- package/dist/types/utils/legendUtils.d.ts +99 -0
- package/dist/types/utils/legendUtils.d.ts.map +1 -0
- package/dist/types/utils/localeUtils.d.ts +7 -0
- package/dist/types/utils/localeUtils.d.ts.map +1 -0
- package/dist/types/utils/paletteUtils.d.ts +25 -0
- package/dist/types/utils/paletteUtils.d.ts.map +1 -0
- package/dist/types/utils/uniqueId.d.ts +19 -0
- package/dist/types/utils/uniqueId.d.ts.map +1 -0
- package/dist/types/widgets/BarWidgetUI/BarSkeleton.d.ts +4 -0
- package/dist/types/widgets/BarWidgetUI/BarSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/BarWidgetUI/BarWidgetUI.d.ts +33 -0
- package/dist/types/widgets/BarWidgetUI/BarWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/BarWidgetUI/useProcessedProps.d.ts +22 -0
- package/dist/types/widgets/BarWidgetUI/useProcessedProps.d.ts.map +1 -0
- package/dist/types/widgets/CategoryWidgetUI/CategorySkeleton.d.ts +3 -0
- package/dist/types/widgets/CategoryWidgetUI/CategorySkeleton.d.ts.map +1 -0
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts +25 -0
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts +37 -0
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts.map +1 -0
- package/dist/types/widgets/ChartLegend.d.ts +10 -0
- package/dist/types/widgets/ChartLegend.d.ts.map +1 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIDropdown.d.ts +18 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIDropdown.d.ts.map +1 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIGeometryChips.d.ts +17 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIGeometryChips.d.ts.map +1 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIToggleButton.d.ts +15 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionUIToggleButton.d.ts.map +1 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionWidgetUI.d.ts +27 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/FeatureSelectionWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/index.d.ts +9 -0
- package/dist/types/widgets/FeatureSelectionWidgetUI/index.d.ts.map +1 -0
- package/dist/types/widgets/FormulaWidgetUI/FormulaSkeleton.d.ts +3 -0
- package/dist/types/widgets/FormulaWidgetUI/FormulaSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/FormulaWidgetUI/FormulaWidgetUI.d.ts +16 -0
- package/dist/types/widgets/FormulaWidgetUI/FormulaWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/HistogramWidgetUI/HistogramSkeleton.d.ts +6 -0
- package/dist/types/widgets/HistogramWidgetUI/HistogramSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/HistogramWidgetUI/HistogramWidgetUI.d.ts +27 -0
- package/dist/types/widgets/HistogramWidgetUI/HistogramWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/HistogramWidgetUI/useHistogramInteractivity.d.ts +20 -0
- package/dist/types/widgets/HistogramWidgetUI/useHistogramInteractivity.d.ts.map +1 -0
- package/dist/types/widgets/NoDataAlert.d.ts +6 -0
- package/dist/types/widgets/NoDataAlert.d.ts.map +1 -0
- package/dist/types/widgets/PieWidgetUI/PieCentralText.d.ts +11 -0
- package/dist/types/widgets/PieWidgetUI/PieCentralText.d.ts.map +1 -0
- package/dist/types/widgets/PieWidgetUI/PieSkeleton.d.ts +4 -0
- package/dist/types/widgets/PieWidgetUI/PieSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts +31 -0
- package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts +16 -0
- package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts.map +1 -0
- package/dist/types/widgets/RangeWidgetUI/RangeSkeleton.d.ts +2 -0
- package/dist/types/widgets/RangeWidgetUI/RangeSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/RangeWidgetUI/RangeWidgetUI.d.ts +16 -0
- package/dist/types/widgets/RangeWidgetUI/RangeWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/ReactEcharts.d.ts +8 -0
- package/dist/types/widgets/ReactEcharts.d.ts.map +1 -0
- package/dist/types/widgets/ScatterPlotWidgetUI/ScatterPlotSkeleton.d.ts +4 -0
- package/dist/types/widgets/ScatterPlotWidgetUI/ScatterPlotSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/ScatterPlotWidgetUI/ScatterPlotWidgetUI.d.ts +16 -0
- package/dist/types/widgets/ScatterPlotWidgetUI/ScatterPlotWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/SkeletonWidgets.d.ts +20 -0
- package/dist/types/widgets/SkeletonWidgets.d.ts.map +1 -0
- package/dist/types/widgets/TableWidgetUI/TableSkeleton.d.ts +7 -0
- package/dist/types/widgets/TableWidgetUI/TableSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/TableWidgetUI/TableSkeletonRow.d.ts +6 -0
- package/dist/types/widgets/TableWidgetUI/TableSkeletonRow.d.ts.map +1 -0
- package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts +30 -0
- package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesContext.d.ts +21 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesContext.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.d.ts +4 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/TimeSeriesWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts +14 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesChart.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesControls.d.ts +3 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesControls.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesLayout.d.ts +8 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesLayout.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesSkeleton.d.ts +4 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/components/TimeSeriesSkeleton.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/index.d.ts +9 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/index.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/timeSeriesUtils.d.ts +99 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/timeSeriesUtils.d.ts.map +1 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/useTimeSeriesInteractivity.d.ts +43 -0
- package/dist/types/widgets/TimeSeriesWidgetUI/useTimeSeriesInteractivity.d.ts.map +1 -0
- package/dist/types/widgets/WrapperWidgetUI.d.ts +36 -0
- package/dist/types/widgets/WrapperWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/comparative/AnimatedNumber/AnimatedNumber.d.ts +9 -0
- package/dist/types/widgets/comparative/AnimatedNumber/AnimatedNumber.d.ts.map +1 -0
- package/dist/types/widgets/comparative/AnimatedNumber/useAnimatedNumber.d.ts +11 -0
- package/dist/types/widgets/comparative/AnimatedNumber/useAnimatedNumber.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryItem.d.ts +17 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryItem.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts +23 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.styled.d.ts +45 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.styled.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts +20 -0
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/ComparativeFormulaWidgetUI.d.ts +21 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/ComparativeFormulaWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/FormulaLabel.d.ts +5 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/FormulaLabel.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/FormulaValue.d.ts +10 -0
- package/dist/types/widgets/comparative/ComparativeFormulaWidgetUI/FormulaValue.d.ts.map +1 -0
- package/dist/types/widgets/comparative/ComparativePieWidgetUI.d.ts +22 -0
- package/dist/types/widgets/comparative/ComparativePieWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/index.d.ts +33 -0
- package/dist/types/widgets/index.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendLayer.d.ts +37 -0
- package/dist/types/widgets/legend/LegendLayer.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendLayerTitle.d.ts +8 -0
- package/dist/types/widgets/legend/LegendLayerTitle.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendLayerVariable.d.ts +9 -0
- package/dist/types/widgets/legend/LegendLayerVariable.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendOpacityControl.d.ts +14 -0
- package/dist/types/widgets/legend/LegendOpacityControl.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendWidgetUI.d.ts +48 -0
- package/dist/types/widgets/legend/LegendWidgetUI.d.ts.map +1 -0
- package/dist/types/widgets/legend/LegendWidgetUI.styles.d.ts +31 -0
- package/dist/types/widgets/legend/LegendWidgetUI.styles.d.ts.map +1 -0
- package/dist/types/widgets/legend/index.d.ts +7 -0
- package/dist/types/widgets/legend/index.d.ts.map +1 -0
- package/dist/types/widgets/legend/legend-types/LegendCategories.d.ts +6 -0
- package/dist/types/widgets/legend/legend-types/LegendCategories.d.ts.map +1 -0
- package/dist/types/widgets/legend/legend-types/LegendIcon.d.ts +6 -0
- package/dist/types/widgets/legend/legend-types/LegendIcon.d.ts.map +1 -0
- package/dist/types/widgets/legend/legend-types/LegendProportion.d.ts +9 -0
- package/dist/types/widgets/legend/legend-types/LegendProportion.d.ts.map +1 -0
- package/dist/types/widgets/legend/legend-types/LegendRamp.d.ts +7 -0
- package/dist/types/widgets/legend/legend-types/LegendRamp.d.ts.map +1 -0
- package/dist/types/widgets/legend/legend-types/index.d.ts +9 -0
- package/dist/types/widgets/legend/legend-types/index.d.ts.map +1 -0
- package/dist/widgets/index.cjs +33 -0
- package/dist/widgets/index.js +5865 -0
- package/package.json +156 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { CustomLegendComponent, LegendLayerData } from '../../utils/legendUtils';
|
|
3
|
+
export type LegendWidgetUIProps = {
|
|
4
|
+
/** Allows to customize default legend types that can be rendered. */
|
|
5
|
+
customLegendTypes?: Record<string, CustomLegendComponent>;
|
|
6
|
+
/** Array of layer objects from redux store. */
|
|
7
|
+
layers: LegendLayerData[];
|
|
8
|
+
/** Collapsed state for whole legend widget */
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
/** Callback function for collapsed state change for whole widget. */
|
|
11
|
+
onChangeCollapsed?: (collapsed: boolean) => void;
|
|
12
|
+
/** Callback function for layer visibility change. */
|
|
13
|
+
onChangeLegendRowCollapsed?: ({ id, collapsed, }: {
|
|
14
|
+
id: string;
|
|
15
|
+
collapsed: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
/** Callback function for layer opacity change. */
|
|
18
|
+
onChangeOpacity?: ({ id, opacity }: {
|
|
19
|
+
id: string;
|
|
20
|
+
opacity: number;
|
|
21
|
+
}) => void;
|
|
22
|
+
/** Callback function for layer collapsed state change. */
|
|
23
|
+
onChangeVisibility?: ({ id, collapsed, visible, }: {
|
|
24
|
+
id: string;
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
visible: boolean;
|
|
27
|
+
}) => void;
|
|
28
|
+
/** Callback function for layer variable selection change. */
|
|
29
|
+
onChangeSelection?: ({ id, index, selection, }: {
|
|
30
|
+
id: string;
|
|
31
|
+
index: number;
|
|
32
|
+
selection: unknown;
|
|
33
|
+
}) => void;
|
|
34
|
+
/** Title of the bottom toggle button when widget is open. */
|
|
35
|
+
title?: string;
|
|
36
|
+
/** Global maximum zoom level for the map. */
|
|
37
|
+
maxZoom?: number;
|
|
38
|
+
/** Global minimum zoom level for the map. */
|
|
39
|
+
minZoom?: number;
|
|
40
|
+
/** Current zoom level for the map. */
|
|
41
|
+
currentZoom?: number;
|
|
42
|
+
/** Flag to indicate if the widget is being rendered on a mobile (small screen) device. */
|
|
43
|
+
isMobile?: boolean;
|
|
44
|
+
/** MUI Custom styles object for the root element. */
|
|
45
|
+
sx?: SxProps<Theme>;
|
|
46
|
+
};
|
|
47
|
+
export default function LegendWidgetUI({ customLegendTypes, layers, collapsed, onChangeCollapsed, onChangeVisibility, onChangeOpacity, onChangeLegendRowCollapsed, onChangeSelection, title, maxZoom, minZoom, currentZoom, isMobile, sx, }: LegendWidgetUIProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=LegendWidgetUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendWidgetUI.d.ts","sourceRoot":"","sources":["../../../../src/widgets/legend/LegendWidgetUI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,OAAO,EACP,KAAK,EAEN,MAAM,eAAe,CAAA;AAMtB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAY5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;IACzD,+CAA+C;IAC/C,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD,qDAAqD;IACrD,0BAA0B,CAAC,EAAE,CAAC,EAC5B,EAAE,EACF,SAAS,GACV,EAAE;QACD,EAAE,EAAE,MAAM,CAAA;QACV,SAAS,EAAE,OAAO,CAAA;KACnB,KAAK,IAAI,CAAA;IACV,kDAAkD;IAClD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC5E,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,CAAC,EACpB,EAAE,EACF,SAAS,EACT,OAAO,GACR,EAAE;QACD,EAAE,EAAE,MAAM,CAAA;QACV,SAAS,EAAE,OAAO,CAAA;QAClB,OAAO,EAAE,OAAO,CAAA;KACjB,KAAK,IAAI,CAAA;IACV,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,CAAC,EACnB,EAAE,EACF,KAAK,EACL,SAAS,GACV,EAAE;QACD,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,OAAO,CAAA;KACnB,KAAK,IAAI,CAAA;IACV,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,iBAA6B,EAC7B,MAAkB,EAClB,SAAiB,EACjB,iBAA4B,EAC5B,kBAA6B,EAC7B,eAA0B,EAC1B,0BAAqC,EACrC,iBAA4B,EAC5B,KAAgB,EAChB,OAAY,EACZ,OAAW,EACX,WAAW,EACX,QAAQ,EACR,EAAE,GACH,EAAE,mBAAmB,2CAkFrB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const LEGEND_WIDTH = 240;
|
|
2
|
+
export declare const LegendRoot: import('@emotion/styled').StyledComponent<import('@mui/material').PaperOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "variant" | "square" | "elevation"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
|
|
5
|
+
component?: import('react').ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
collapsed: boolean;
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
export declare const LegendToggleHeader: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
|
|
10
|
+
collapsed: boolean;
|
|
11
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
12
|
+
export declare const LegendItemHeader: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
13
|
+
export declare const StyledOpacityControl: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const OpacityTextField: import('@emotion/styled').StyledComponent<{
|
|
15
|
+
variant?: import('@mui/material').TextFieldVariants | undefined;
|
|
16
|
+
} & Omit<import('@mui/material').FilledTextFieldProps | import('@mui/material').OutlinedTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
17
|
+
export declare const LayerVariablesList: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
|
|
18
|
+
opacity: number;
|
|
19
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
20
|
+
export declare const LegendVariableList: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
21
|
+
export declare const LegendIconWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
22
|
+
export declare const LegendIconImageWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
23
|
+
export declare const LegendContent: import('@emotion/styled').StyledComponent<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
25
|
+
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
|
|
26
|
+
width?: number;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export declare const LegendLayerWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
29
|
+
export declare const LegendLayerTitleWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
30
|
+
export declare const styles: {};
|
|
31
|
+
//# sourceMappingURL=LegendWidgetUI.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendWidgetUI.styles.d.ts","sourceRoot":"","sources":["../../../../src/widgets/legend/LegendWidgetUI.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,MAAM,CAAA;AAE/B,eAAO,MAAM,UAAU;;;;;eAEM,OAAO;UAMjC,CAAA;AAEH,eAAO,MAAM,kBAAkB;eAEf,OAAO;mGAOpB,CAAA;AAEH,eAAO,MAAM,gBAAgB,uNAU1B,CAAA;AAEH,eAAO,MAAM,oBAAoB,6NAM9B,CAAA;AAEH,eAAO,MAAM,gBAAgB;;wPAS1B,CAAA;AAEH,eAAO,MAAM,kBAAkB;aAEjB,MAAM;6GAOjB,CAAA;AAEH,eAAO,MAAM,kBAAkB,iOAM5B,CAAA;AAEH,eAAO,MAAM,iBAAiB,6NAG3B,CAAA;AAEH,eAAO,MAAM,sBAAsB,6NAQhC,CAAA;AAEH,eAAO,MAAM,aAAa;;;YAEb,MAAM;UAIhB,CAAA;AAEH,eAAO,MAAM,kBAAkB,uNAI5B,CAAA;AAEH,eAAO,MAAM,uBAAuB,6NAIjC,CAAA;AAEH,eAAO,MAAM,MAAM,IAAK,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as LegendWidgetUI } from './LegendWidgetUI';
|
|
2
|
+
export * from './legend-types';
|
|
3
|
+
export { LEGEND_TYPES } from '../../utils/legendUtils';
|
|
4
|
+
export type * from './LegendWidgetUI';
|
|
5
|
+
export type * from './legend-types';
|
|
6
|
+
export type * from '../../utils/legendUtils';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/widgets/legend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LegendCategoriesData, LegendLayerVariableBase } from '../../../utils/legendUtils';
|
|
2
|
+
declare function LegendCategories({ legend, }: {
|
|
3
|
+
legend: Omit<LegendLayerVariableBase, 'type'> & LegendCategoriesData;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default LegendCategories;
|
|
6
|
+
//# sourceMappingURL=LegendCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendCategories.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/legend/legend-types/LegendCategories.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,qBAAqB,CAAA;AAI5B,iBAAS,gBAAgB,CAAC,EACxB,MAAM,GACP,EAAE;IACD,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,GAAG,oBAAoB,CAAA;CACrE,2CAmDA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LegendIconsData, LegendLayerVariableBase } from '../../../utils/legendUtils';
|
|
2
|
+
declare function LegendIcon({ legend, }: {
|
|
3
|
+
legend: Omit<LegendLayerVariableBase, 'type'> & LegendIconsData;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default LegendIcon;
|
|
6
|
+
//# sourceMappingURL=LegendIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendIcon.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/legend/legend-types/LegendIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAG9E,iBAAS,UAAU,CAAC,EAClB,MAAM,GACP,EAAE;IACD,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,GAAG,eAAe,CAAA;CAChE,2CAuBA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LegendLayerVariableBase, LegendProportionData } from '../../../utils/legendUtils';
|
|
2
|
+
declare function LegendProportion({ legend, }: {
|
|
3
|
+
legend: Omit<LegendLayerVariableBase, 'type'> & LegendProportionData;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default LegendProportion;
|
|
6
|
+
export declare function getMinMax({ labels }: {
|
|
7
|
+
labels: number[];
|
|
8
|
+
}): (number | undefined)[];
|
|
9
|
+
//# sourceMappingURL=LegendProportion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendProportion.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/legend/legend-types/LegendProportion.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAyD5B,iBAAS,gBAAgB,CAAC,EACxB,MAAM,GACP,EAAE;IACD,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,GAAG,oBAAoB,CAAA;CACrE,2CA2DA;AAED,eAAe,gBAAgB,CAAA;AAG/B,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,0BAazD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LegendLayerVariableBase, LegendRampData } from '../../../utils/legendUtils';
|
|
2
|
+
declare function LegendRamp({ isContinuous, legend, }: {
|
|
3
|
+
legend: Omit<LegendLayerVariableBase, 'type'> & LegendRampData;
|
|
4
|
+
isContinuous?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default LegendRamp;
|
|
7
|
+
//# sourceMappingURL=LegendRamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendRamp.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/legend/legend-types/LegendRamp.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAU7E,iBAAS,UAAU,CAAC,EAClB,YAAoB,EACpB,MAAM,GACP,EAAE;IACD,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,GAAG,cAAc,CAAA;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,2CAiEA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as LegendCategories } from './LegendCategories';
|
|
2
|
+
export { default as LegendIcon } from './LegendIcon';
|
|
3
|
+
export { default as LegendProportion } from './LegendProportion';
|
|
4
|
+
export { default as LegendRamp } from './LegendRamp';
|
|
5
|
+
export type * from './LegendCategories';
|
|
6
|
+
export type * from './LegendIcon';
|
|
7
|
+
export type * from './LegendProportion';
|
|
8
|
+
export type * from './LegendRamp';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/widgets/legend/legend-types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AAEpD,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,cAAc,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-Cek9Ww4S.cjs"),p=require("react"),s=require("@mui/material"),J=require("react-intl"),B=require("../Alert-l8e3Fw5e.cjs"),Bn=require("echarts-for-react"),A=require("../createSvgIcon-BhsoeSAN.cjs"),$e=require("../search-icon-DHF2JDWR.cjs"),fe=require("@mui/icons-material"),je=require("../paletteUtils-DELR0VRh.cjs");function Wt(){let e=!1;return window.PointerEvent&&"maxTouchPoints"in navigator?navigator.maxTouchPoints>0&&(e=!0):(window.matchMedia&&window.matchMedia("(any-pointer:coarse)").matches||window.TouchEvent||"ontouchstart"in window)&&(e=!0),e}function ne(e){return!e||typeof e!="object"?e:`${e.prefix??""}${e.value}${e.suffix??""}`}const Pn=[],Ln={},gt=e=>e;function Dn(e,n){if(!e||Array.isArray(e)&&e.length===0)return null;const o=Array.isArray(e)?e:[e];let r="";return r+=String(o[0].axisValueLabel),r+=o.map(({seriesName:i,value:a,data:l,marker:x})=>{const c=i?i+": ":"",d=ne(n(Number(a))),m=l,u=`<div style="margin-left: 8px; display: inline">
|
|
2
|
+
${c}${d}${String((m==null?void 0:m.unit)||"")}
|
|
3
|
+
</div>`;return`<div style="margin-top: 4px">${String(x)}${u}</div>`}).join(" "),r}function $n({height:e,labels:n=Ln,yAxisData:o,selectedBars:r=Pn,series:i,colors:a,tooltip:l=!0,tooltipFormatter:x=Dn,xAxisFormatter:c=gt,yAxisFormatter:d=gt,onSelectedBarsChange:m,animation:u=!0,filterable:y=!0,stacked:g=!0,...h}){const j=s.useTheme(),f=p.useMemo(()=>(i??[]).map(w=>n[w]??w),[i,n]),v=p.useMemo(()=>Array.isArray(o[0])?o:[o],[o]),R=p.useMemo(()=>typeof a=="string"?[a]:Array.isArray(a)&&a.length?a:v.length<=1||f.length===1?[j.palette.secondary.main]:v.length===2||f.length===2?[j.palette.secondary.light,j.palette.secondary.dark]:Object.values(j.palette.qualitative.bold||{}),[a,j,v,f]);return{...h,tooltip:l,tooltipFormatter:x,xAxisFormatter:c,yAxisFormatter:d,onSelectedBarsChange:m,animation:u,filterable:y,stacked:g,labels:n,height:e??parseInt(j.spacing(22)),selectedBars:On(r),yAxisData:v,colors:R,series:f}}function On(e){return(e??[]).length?e.map(n=>Array.isArray(n)&&n.length===2?n:Array.isArray(n)?[...Array(2)].map((r,i)=>n[i]??0):[n,0]):[]}var Nn=function e(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var r,i,a;if(Array.isArray(n)){if(r=n.length,r!=o.length)return!1;for(i=r;i--!==0;)if(!e(n[i],o[i]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(a=Object.keys(n),r=a.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(o,a[i]))return!1;for(i=r;i--!==0;){var l=a[i];if(!e(n[l],o[l]))return!1}return!0}return n!==n&&o!==o};const he=A.getDefaultExportFromCjs(Nn);class Ee extends Bn{componentDidUpdate(n){const{shouldSetOption:o}=this.props;if(typeof o=="function"&&!o(n,this.props))return;if(!he(n.theme,this.props.theme)||!he(n.opts,this.props.opts)){this.dispose(),this.renderNewEcharts();return}const r=this.getEchartsInstance();he(n.onEvents,this.props.onEvents)||(this.offEvents(r,n.onEvents),this.bindEvents(r,this.props.onEvents));const i=["option","notMerge","lazyUpdate","showLoading","loadingOption"];he(ft(this.props,i),ft(n,i))||this.updateEChartsOption(),(!he(n.style,this.props.style)||!he(n.className,this.props.className))&&this.resize()}updateEChartsOption(){const n=this.props.option,o=this.props.loadingOption||null,{lazyUpdate:r,showLoading:i}=this.props,a=this.getEchartsInstance();return a.setOption(n,{replaceMerge:["series"],lazyUpdate:r}),i?a.showLoading(o):a.hideLoading(),a}offEvents(n,o){if(o)for(const r in o)typeof r=="string"&&n.off(r)}}function ft(e,n){const o={};return n.forEach(r=>{o[r]=e[r]}),o}const ze=240,_t=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"flex-end",justifyContent:"space-between",position:"relative",padding:e.spacing(0,2),"&::before":{content:'""',position:"absolute",top:0,right:0,left:0,bottom:0,backgroundSize:e.spacing(4,4),backgroundImage:`linear-gradient(to bottom, ${e.palette.grey[50]} 1px, transparent 1px)`,transform:"scaleY(-1)"}})),Gt=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"flex-end",justifyContent:"space-between",backgroundImage:`linear-gradient(${e.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${e.palette.grey[50]} calc(100% - 0.5px)), linear-gradient(90deg, ${e.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${e.palette.grey[50]} calc(100% - 0.5px))`,backgroundSize:"8.33% 20%",border:`0.5px solid ${e.palette.grey[50]}`})),ve=s.styled(s.Skeleton)(({theme:e})=>({flex:1,maxWidth:e.spacing(12),"& + &":{marginLeft:e.spacing(1)}})),se=s.styled(s.Skeleton)(({theme:e})=>({flex:1,maxWidth:e.spacing(8),"& + &":{marginLeft:"1px"}})),Fn=s.styled(s.Skeleton)(({theme:e})=>({backgroundColor:e.palette.common.white})),ht=s.styled(s.Skeleton)(({theme:e})=>({backgroundColor:e.palette.grey[100]}));function Wn({height:e}){return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Box,{mb:2,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})}),t.jsxRuntimeExports.jsxs(_t,{style:{height:e||ze},children:[t.jsxRuntimeExports.jsx(ve,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(ve,{variant:"rectangular",height:"40%"}),t.jsxRuntimeExports.jsx(ve,{variant:"rectangular",height:"60%"}),t.jsxRuntimeExports.jsx(ve,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(ve,{variant:"rectangular",height:"80%"})]})]})}function ue(e){const[n,o]=p.useState(!1),[r,i]=p.useState(!1);return p.useEffect(()=>{e&&!r&&(o(!0),i(!0)),e||o(!1)},[e,r]),{showSkeleton:n}}const _n=Wt(),Gn=s.styled(s.Grid)(({theme:e})=>({marginBottom:e.spacing(2),flexDirection:"row",justifyContent:"space-between",alignItems:"center","& .MuiTypography-caption":{color:e.palette.text.secondary}})),zn=s.styled(s.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer"}));function Hn(e){const{yAxisData:n,xAxisData:o,series:r,selectedBars:i,onSelectedBarsChange:a,tooltip:l,tooltipFormatter:x,labels:c,colors:d,xAxisFormatter:m,yAxisFormatter:u,stacked:y,height:g,filterable:h,animation:j,isLoading:f}=$n(e),v=r.length>1,R=s.useTheme(),w=J.useIntl(),b=B.useImperativeIntl(w),{showSkeleton:E}=ue(!!f),k=p.useMemo(()=>({show:l,trigger:"axis",padding:[parseInt(R.spacing(.5)),parseInt(R.spacing(1))],borderWidth:0,textStyle:{...R.typography.caption,fontSize:11,color:R.palette.common.white},backgroundColor:R.palette.black[90],position:function(I,O,H,F,Y){const q={top:0};return Y.contentSize[0]<Y.viewSize[0]-I[0]?q.left=I[0]:q.right=Y.viewSize[0]-I[0],q},formatter:I=>x(I,u)}),[R,l,x,u]),M=p.useMemo(()=>o.map(I=>ne(m(c[I]??String(I)))),[o,c,m]),D=p.useMemo(()=>({type:"category",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{...R.typography.overlineDelicate,padding:[parseInt(R.spacing(.5)),0,0,0]},data:M}),[R,M]),C=p.useMemo(()=>{let I=[];return y?I=n.reduce((O,H)=>(H.forEach((F,Y)=>O[Y]=(O[Y]??0)+(F??Number.MIN_SAFE_INTEGER)),O),[]):I=n.flat().map(O=>O??Number.MIN_SAFE_INTEGER),Math.max(...I)},[n,y]),P=p.useMemo(()=>({type:"value",axisLabel:{margin:0,verticalAlign:"bottom",padding:[0,0,parseInt(R.spacing(1.25)),0],show:!0,showMaxLabel:!0,showMinLabel:!1,inside:!0,color:I=>I>=C?R.palette.black[60]:"transparent",...R.typography.overlineDelicate,formatter:I=>ne(u(I))},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!0,onZero:!1,lineStyle:{color:R.palette.black[4]}}}),[R,C,u]),L=p.useMemo(()=>n.map((I,O)=>({type:"bar",name:r[O]??"",animation:j,barMaxWidth:100,data:I.map((H,F)=>{const Y=i.some(([W,V=0])=>W===F&&V===O),q=!!i.length&&!Y;return{value:H,...q&&{itemStyle:{color:R.palette.black[25]},disabled:!0}}}),...y&&{stack:"total"},...!_n&&{emphasis:{focus:"series",itemStyle:{color:s.darken(d[O]??"#000",.25)}}}})),[j,d,r,n,i,y,R]),$=p.useMemo(()=>({grid:{left:M.length>=4?jt(String(M[0]),M.length):0,top:parseInt(R.spacing(2)),right:M.length>=4?jt(String(M[M.length-1]),M.length):0,bottom:0,containLabel:!0},axisPointer:{lineStyle:{color:R.palette.black[40]}},color:d,tooltip:k,xAxis:D,yAxis:P,series:L}),[M,R,d,k,D,P,L]),z=()=>{a&&a([],[])},G=I=>{I.key==="Enter"&&z()},S=p.useCallback(I=>{if(a){const O=[...i],{dataIndex:H,componentIndex:F}=I,Y=O.findIndex(([W,V=0])=>H===W&&F===V);Y===-1?O.push([H,F]):O.splice(Y,1);const q=O.map(([W,V=0])=>({xAxis:o[W],serie:r[V],yAxis:n[V][W]}));a(v?O:O.map(W=>W[0]),q)}},[n,a,i,o,r,v]),N=p.useMemo(()=>h?{click:S}:{},[h,S]);return E?t.jsxRuntimeExports.jsx(Wn,{height:g}):t.jsxRuntimeExports.jsxs("div",{children:[a&&t.jsxRuntimeExports.jsxs(Gn,{container:!0,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",children:i.length>0?b.formatMessage({id:"c4r.widgets.bar.selectedItems"},{items:i.length}):b.formatMessage({id:"c4r.widgets.bar.all"})}),i&&i.length>0&&t.jsxRuntimeExports.jsx(zn,{onClick:()=>z(),onKeyDown:G,underline:"hover",tabIndex:0,children:b.formatMessage({id:"c4r.widgets.bar.clear"})})]}),!!$&&t.jsxRuntimeExports.jsx(Ee,{option:$,lazyUpdate:!0,notMerge:!0,onEvents:N,style:{height:g}})]})}function jt(e="",n=0){return n<=15&&e.length<=8?0:e.length*8.5/6}const xe="__rest__",ye="Others";var de=(e=>(e.RANKING="ranking",e.FIXED="fixed",e))(de||{});const zt=s.styled(s.Grid)(({theme:e})=>({maxHeight:e.spacing(40),overflow:"auto",padding:0})),Ht=s.styled(s.Grid,{shouldForwardProp:e=>e!=="selectable"&&e!=="name"&&e!=="unselected"})(({theme:e,selectable:n,name:o,unselected:r})=>({flexDirection:"row",maxWidth:"100%",padding:e.spacing(.5,.25),margin:0,"> .MuiGrid-item":{paddingTop:0,paddingLeft:0},"&:focus-visible":{outline:"none !important",boxShadow:`inset 0 0 0 2px ${e.palette.primary.main} !important`},...r&&{color:e.palette.text.disabled,".progressbar div":{backgroundColor:e.palette.text.disabled}},...o!==xe&&n&&{cursor:"pointer",flexWrap:"nowrap","&:hover .progressbar div":{backgroundColor:e.palette.secondary.dark}},...o===xe&&{cursor:"default",".progressbar div":{backgroundColor:e.palette.text.disabled}}})),yt=s.styled(s.Grid)(({theme:{spacing:e,palette:n}})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:e(1.5),paddingRight:e(1),"& .MuiTypography-caption":{color:n.text.secondary}})),Yn=s.styled(s.Grid)(({theme:e})=>({height:e.spacing(.5),width:"100%",margin:e.spacing(.5,0,.25,0),borderRadius:e.spacing(.5),backgroundColor:e.palette.action.disabledBackground,"& div":{width:0,height:"100%",borderRadius:e.spacing(.5),backgroundColor:e.palette.secondary.main,transition:`background-color ${e.transitions.easing.sharp} ${e.transitions.duration.shortest}ms,
|
|
4
|
+
width ${e.transitions.easing.sharp} ${e.transitions.duration.complex}ms`}})),Vn=s.styled(s.Grid,{shouldForwardProp:e=>e!=="isSelectable"})(({theme:e,isSelectable:n})=>({...n&&{width:`calc(100% - ${e.spacing(4)})`}})),Un=s.styled(B.Typography)(({theme:e})=>({fontWeight:e.typography.fontWeightBold,marginRight:e.spacing(2)})),Te=s.styled(s.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer","& + hr":{margin:e.spacing(0,1)}})),qn=s.styled(s.Box)(({theme:e})=>({...e.typography.body2})),Et=s.styled(s.Button)(({theme:e})=>({position:"absolute",left:"-999px",top:"-1px",width:"1px",height:"1px",display:"inline-flex","&:focus-visible":{position:"static",width:"auto",height:"auto",marginTop:e.spacing(2)}})),Kn=s.styled(s.Skeleton)(({theme:e})=>({marginTop:e.spacing(1.25),marginBottom:e.spacing(1.75)})),Zn=e=>e%2===1,Yt=()=>t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8}),t.jsxRuntimeExports.jsx(zt,{container:!0,mt:3,children:[...Array(6)].map((e,n)=>t.jsxRuntimeExports.jsxs(Ht,{container:!0,spacing:1,children:[t.jsxRuntimeExports.jsxs(s.Grid,{container:!0,item:!0,direction:"row",justifyContent:"space-between",children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:Zn(n)?72:48,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})]}),t.jsxRuntimeExports.jsx(Kn,{height:4,width:"100%"})]},n))})]});function Vt(e){const n=p.useRef();return p.useEffect(()=>{n.current=e}),n.current}function Xe({start:e,end:n,duration:o,drawFrame:r,requestRef:i}){if(e===n&&!(e===0&&n===0))return;const l=n-e;let x=e;const c=l/(o/1e3*60),d=()=>{x+=c,r(Math.floor(x)),c>0&&x<n||c<0&&x>n?i.current=requestAnimationFrame(d):r(n)};i.current=requestAnimationFrame(d)}function Xn({start:e,end:n,duration:o,drawFrame:r,requestRef:i}){if(e.length===n.length&&e.every((g,h)=>g.value===n[h].value))return;let l=n.map((g,h)=>e[h]&&e[h].name===g.name?{...g,value:e[h].value}:g),x=0;const c=l.map((g,h)=>n[h].value-g.value);if(c.every(g=>g===0)){r(n);return}const m=o/1e3*60,u=c.map(g=>g/m),y=()=>{x<m?(l=l.map((g,h)=>{const j=Math.floor(g.value+u[h]),f=h>0&&Math.floor(g.value+u[h-1]);return{...g,value:j===f?n[h].value:j}}),r(l),x++,i.current=requestAnimationFrame(y)):r(n)};i.current=requestAnimationFrame(y)}const Jn=[],Qn={},es=e=>e,qe=()=>{};function ts({data:e,formatter:n=es,labels:o=Qn,maxItems:r=5,order:i=de.RANKING,selectedCategories:a=Jn,onSelectedCategoriesChange:l=qe,animation:x=!0,filterable:c=!0,searchable:d=!0,isLoading:m}){const[u,y]=p.useState([]),[g,h]=p.useState(1),[j,f]=p.useState(!1),[v,R]=p.useState(""),[w,b]=p.useState([]),[E,k]=p.useState([]),[M,D]=p.useState([]),C=p.useRef(null),P=p.useRef(),L=Vt(M),$=p.useRef([]),{showSkeleton:z}=ue(!!m),G=J.useIntl(),S=B.useImperativeIntl(G);function N(T){return u.reduce((U,Z)=>(T.includes(Z.name)&&U.push(Z.name),U),[])}function I(T){if(T!==xe){let U;a.includes(T)?U=a.filter(Z=>Z!==T):U=[...a,T],l&&l(U)}}const O=()=>l([]),H=T=>{T.key==="Enter"&&O()},F=()=>{l([]),b([])},Y=T=>{T.key==="Enter"&&F()},q=()=>{b(N(a))},W=T=>{T.key==="Enter"&&q()},V=()=>{const T=N(E);l([...T]),b([...T]),k([]),f(!1),R("")},ee=T=>{T.key==="Enter"&&V()},pe=()=>{R(""),f(!1)},re=T=>{if(T!==xe){let U;E.includes(T)?U=E.filter(Z=>Z!==T):U=[...E,T],k(U)}},_=T=>{T.currentTarget.scrollIntoView()},K=T=>{R(T.currentTarget.value)},X=()=>{f(!0),k([...a])},Q=p.useCallback(T=>{if(j)return v?T.filter(U=>{var te;if(!U.name)return!1;const Z=String(U.name);return!!(Z.toLowerCase().includes(v.toLowerCase())||(te=o[Z])!=null&&te.toLowerCase().includes(v.toLowerCase()))}):T;if(w.length)return w.reduce((Z,te)=>{const me=T.find(ae=>ae.name===te);return Z.push({name:te,value:me?me.value:null}),Z},[]);{const U=T.slice(0,r);if(U.length<T.length){const Z=T.slice(r).reduce((te,me)=>(me.value!==null&&te.value!==null&&(te.value+=me.value),te),{name:xe,value:0});return[...U,Z]}else return U}},[w,o,r,v,j]),ie=p.useCallback(()=>{const T=w.length;return T?e.length-T:e.length-r},[e,r,w]),Me=p.useCallback(T=>T===xe?`Others ${d?"":`(${ie()})`}`:o[String(T)]??String(T),[ie,o,d]),Re=p.useCallback(T=>T>=g?T!=null?"100%":0:`${(T||0)*100/g}%`,[g]);p.useEffect(()=>{a.length===0&&b([])},[a]),p.useEffect(()=>{if(e){if(i===de.RANKING){const T=[...e].sort((Z,te)=>(te.value??0)-(Z.value??0)),U=Q(T);U.length>0?h(U[0].value??0):h(1),y(U)}else if(i===de.FIXED){h(Math.max(...e.map(U=>U.value??0)));const T=Q(e);y(T)}}},[w,Q,e,o,r,i,v,j]),p.useEffect(()=>{L&&($.current=L)},[L]),p.useEffect(()=>{if(x)return Xn({start:($.current||[]).map(T=>({...T,value:T.value??0})),end:u.map(T=>({...T,value:T.value??0})),duration:500,drawFrame:T=>D(T),requestRef:C}),()=>{C.current&&cancelAnimationFrame(C.current)};D(u)},[x,u]),p.useEffect(()=>{j&&P.current&&P.current.focus()},[j,P]);function Tn({data:T,onCategoryClick:U}){const Z=n(T.value??0),[te,me]=p.useState(!1),ae=p.useRef(null),Ve=()=>{var dt,mt;const Ue=(((dt=ae==null?void 0:ae.current)==null?void 0:dt.scrollWidth)??0)>(((mt=ae==null?void 0:ae.current)==null?void 0:mt.clientWidth)??0);me(Ue)};p.useEffect(()=>(Ve(),window.addEventListener("resize",Ve),()=>{window.removeEventListener("resize",Ve)}),[]);const Cn=Ue=>{Ue.key==="Enter"&&U()},An=!j&&a.length>0&&!a.includes(T.name);return t.jsxRuntimeExports.jsxs(Ht,{container:!0,direction:"row",spacing:1,onClick:c?U:qe,onKeyDown:c?Cn:qe,selectable:c,unselected:An,name:T.name===xe?xe:"",tabIndex:c?0:-1,children:[c&&j&&t.jsxRuntimeExports.jsx(s.Grid,{item:!0,mr:1,children:t.jsxRuntimeExports.jsx(s.Checkbox,{checked:E.includes(T.name),tabIndex:-1})}),t.jsxRuntimeExports.jsxs(Vn,{container:!0,item:!0,xs:!0,isSelectable:j,children:[t.jsxRuntimeExports.jsxs(s.Grid,{container:!0,item:!0,direction:"row",justifyContent:"space-between",wrap:"nowrap",children:[t.jsxRuntimeExports.jsx(s.Tooltip,{title:Me(T.name),disableHoverListener:!te,children:t.jsxRuntimeExports.jsx(Un,{variant:"body2",noWrap:!0,ref:ae,children:Me(T.name)})}),typeof Z=="object"&&Z!==null?t.jsxRuntimeExports.jsxs("span",{children:[Z.prefix,Z.value,Z.suffix]}):t.jsxRuntimeExports.jsx("span",{children:Z})]}),t.jsxRuntimeExports.jsx(Yn,{className:"progressbar",item:!0,children:t.jsxRuntimeExports.jsx("div",{style:{width:Re(T.value??0)}})})]})]})}return(e==null?void 0:e.length)===0||z?t.jsxRuntimeExports.jsx(Yt,{}):t.jsxRuntimeExports.jsxs(qn,{children:[c&&u.length>0&&t.jsxRuntimeExports.jsxs(yt,{container:!0,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",children:a.length>0?S.formatMessage({id:"c4r.widgets.category.selectedItems"},{items:a.length}):S.formatMessage({id:"c4r.widgets.category.all"})}),j?t.jsxRuntimeExports.jsx(Te,{onClick:V,onKeyDown:ee,underline:"hover",tabIndex:0,"data-testid":"primaryApplyButton",children:S.formatMessage({id:"c4r.widgets.category.apply"})}):w.length>0?t.jsxRuntimeExports.jsx(Te,{onClick:F,onKeyDown:Y,underline:"hover",tabIndex:0,children:S.formatMessage({id:"c4r.widgets.category.unlock"})}):a.length>0&&t.jsxRuntimeExports.jsxs(s.Grid,{container:!0,direction:"row",justifyContent:"flex-end",item:!0,xs:!0,children:[t.jsxRuntimeExports.jsx(Te,{onClick:q,onKeyDown:W,underline:"hover",tabIndex:0,children:S.formatMessage({id:"c4r.widgets.category.lock"})}),t.jsxRuntimeExports.jsx(s.Divider,{orientation:"vertical",flexItem:!0}),t.jsxRuntimeExports.jsx(Te,{onClick:O,onKeyDown:H,underline:"hover",tabIndex:0,children:S.formatMessage({id:"c4r.widgets.category.clear"})})]})]}),e.length>r&&j&&t.jsxRuntimeExports.jsxs(yt,{container:!0,children:[t.jsxRuntimeExports.jsx(s.TextField,{size:"small",sx:{mt:-.5},placeholder:S.formatMessage({id:"c4r.widgets.category.search"}),onChange:K,onFocus:_,InputProps:{startAdornment:t.jsxRuntimeExports.jsx(s.InputAdornment,{position:"start",children:t.jsxRuntimeExports.jsx($e.SearchIcon,{})})},inputProps:{tabIndex:0,ref:P}}),t.jsxRuntimeExports.jsx(Et,{size:"small",onClick:pe,children:S.formatMessage({id:"c4r.widgets.category.cancel"})})]}),t.jsxRuntimeExports.jsx(zt,{container:!0,item:!0,children:M.length?M.map((T,U)=>t.jsxRuntimeExports.jsx(Tn,{data:T,onCategoryClick:()=>j?re(T.name):I(T.name)},U)):t.jsxRuntimeExports.jsxs(s.Box,{children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"body2",children:S.formatMessage({id:"c4r.widgets.category.noResults"})}),t.jsxRuntimeExports.jsx(B.Typography,{component:"p",variant:"caption",mb:2,children:S.formatMessage({id:"c4r.widgets.category.noResultsMessage"},{searchValue:v})})]})}),j&&t.jsxRuntimeExports.jsx(Et,{size:"small",onClick:V,children:S.formatMessage({id:"c4r.widgets.category.apply"})}),e.length>r&&d?j?t.jsxRuntimeExports.jsx(s.Box,{mt:1.5,children:t.jsxRuntimeExports.jsx(s.Button,{size:"small",color:"primary",onClick:pe,"data-testid":"primaryCancelButton",children:S.formatMessage({id:"c4r.widgets.category.cancel"})})}):t.jsxRuntimeExports.jsx(s.Box,{mt:1.5,children:t.jsxRuntimeExports.jsx(s.Button,{size:"small",color:"primary",startIcon:t.jsxRuntimeExports.jsx($e.SearchIcon,{}),onClick:X,children:S.formatMessage({id:"c4r.widgets.category.searchInfo"},{elements:ie()})})}):null]})}const Ut=()=>t.jsxRuntimeExports.jsx(s.Box,{pt:.5,children:t.jsxRuntimeExports.jsx(s.Skeleton,{height:24,width:120})}),ns=s.styled("span")(()=>({marginRight:"2px"})),ss=s.styled("span")(()=>({marginLeft:"2px"})),Ce="-",os=e=>e;function rs({data:e=Ce,formatter:n=os,animation:o=!0,isLoading:r=!1}){const[i,a]=p.useState(Ce),l=p.useRef(null),x=Vt(i),c=p.useRef(x),{showSkeleton:d}=ue(!!r);p.useEffect(()=>(typeof e=="number"&&o?Xe({start:c.current||0,end:e,duration:500,drawFrame:g=>a(g),requestRef:l}):typeof e=="object"&&o&&e&&c.current&&e.value!==null&&e.value!==void 0?Xe({start:Number(c.current.value),end:Number(e.value),duration:1e3,drawFrame:g=>a({value:g,prefix:e.prefix,suffix:e.suffix}),requestRef:l}):a(e??Ce),()=>{l.current&&cancelAnimationFrame(l.current)}),[o,e,a]);const m=n(i),u=typeof m=="object"&&m!==null,y=m===Ce;return d?t.jsxRuntimeExports.jsx(Ut,{}):u?t.jsxRuntimeExports.jsxs(B.Typography,{variant:"h5",component:"div",weight:"medium",children:[t.jsxRuntimeExports.jsx(ns,{children:m.prefix}),m.value,t.jsxRuntimeExports.jsx(ss,{children:m.suffix})]}):t.jsxRuntimeExports.jsx(B.Typography,{variant:"h5",component:"div",weight:"medium",color:y?"text.disabled":"default",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:m})}const Rt={};let we=null;function is({data:e,filterable:n,selectedBars:o,onSelectedBarsChange:r,echartsInstance:i}){const a=s.useTheme(),[l,x]=p.useState([]),c=p.useMemo(()=>i==null?void 0:i.getZr(),[i]);p.useEffect(()=>{function m(y){if(i){const[g]=i.convertFromPixel({seriesIndex:0},[y.offsetX,y.offsetY]);we=g??null}}function u(y){if(i&&we!==null){const[g]=i.convertFromPixel({seriesIndex:0},[y.offsetX,y.offsetY]);x(we===g?[]:[we,g].sort((h,j)=>h-j))}}if(i&&n){const y=Ke(c,"mousedown",m),g=Ke(c,"mousemove",u);return()=>{y==null||y(),g==null||g()}}},[c,i,n]),p.useEffect(()=>{function m(){if(l.length===2&&r){const u=e.reduce((y,g,h)=>((l[0]>=g[0]&&l[0]<=g[1]||l[1]>=g[0]&&l[1]<=g[1]||l[0]<=g[0]&&l[1]>=g[1])&&y.push(h),y),[]);r(e.length===u.length?[]:u)}x([]),we=null}if(i&&n)return Ke(c,"mouseup",m)},[c,i,l,e,r,n]);const d=p.useCallback(m=>{if(r){const u=new Set(o);u.has(m.dataIndex)?u.delete(m.dataIndex):u.add(m.dataIndex),r(u.size===e.length?[]:Array.from(u))}},[r,o,e.length]);return{markAreaOptions:l.length===2&&{data:[[{coord:[l[0]]},{coord:[l[1]]}]],itemStyle:{color:a.palette.primary.main,opacity:.2}},onEvents:n?{click:d}:{}}}function Ke(e,n,o){if(e!=null&&e.handler)return Rt[n]=o,e.on(n,o),()=>{Rt[n]&&(e!=null&&e.handler)&&e.off(n,o)}}function as({height:e}){return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Box,{mb:2,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})}),t.jsxRuntimeExports.jsxs(Gt,{style:{height:e??ze},children:[t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"40%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"60%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"80%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"50%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"40%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"60%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"20%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"80%"}),t.jsxRuntimeExports.jsx(se,{variant:"rectangular",height:"50%"})]})]})}const ls=Wt(),cs=s.styled(s.Grid)(({theme:e})=>({marginBottom:e.spacing(2),flexDirection:"row",justifyContent:"space-between",alignItems:"center","& .MuiTypography-caption":{color:e.palette.text.secondary}})),us=s.styled(s.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer"})),ps=[],xs=()=>{},Oe=e=>e;function ds(e,n=Oe,o=Oe){if(!e)return null;if(Array.isArray(e)&&e.length===0)return;const r=Array.isArray(e)?e[0].marker:e.marker,i=Array.isArray(e)?e[0].data:e.data;if((i==null?void 0:i.value)===void 0)return;const[a,l,x]=i.value,c=ne(n(a)),d=ne(n(l)),m=ne(o(x)),u=`${c} <span style="vertical-align: 1px;">—</span> ${d}`,y=`<div style="margin-left: 8px; display: inline">${m}</div>`;return`${u} <div style="margin-top: 4px">${String(r)}${y}</div>`}function ms({data:e,ticks:n,min:o,max:r,xAxisFormatter:i=Oe,yAxisFormatter:a=Oe,yAxisType:l="dense",selectedBars:x=ps,onSelectedBarsChange:c=xs,tooltip:d=!0,tooltipFormatter:m=ds,animation:u=!0,filterable:y=!0,height:g=200,isLoading:h}){const j=J.useIntl(),f=s.useTheme(),v=B.useImperativeIntl(j),{showSkeleton:R}=ue(!!h),w=!!y&&!!c,[b,E]=p.useState(),k=I=>E(I),M=p.useMemo(()=>hs(e,n,o,r),[e,n,o,r]),{onEvents:D,markAreaOptions:C}=is({data:M,filterable:w,selectedBars:x,onSelectedBarsChange:c,echartsInstance:b}),P=p.useMemo(()=>({show:d,trigger:"item",padding:[A.SPACING*.5,A.SPACING],borderWidth:0,textStyle:{...f.typography.caption,fontSize:11,color:f.palette.common.white},backgroundColor:f.palette.black[90],confine:!0,position:"top",formatter(I){return m(I,i,a)}}),[f,d,m,i,a]),L=p.useMemo(()=>({min:o,max:r,interval:(r-o)/M.length,axisLine:{show:!1},splitLine:{show:!0,lineStyle:{color:f.palette.black[4]}},axisTick:{show:!1},axisLabel:{showMinLabel:!0,showMaxLabel:!0,...f.typography.overlineDelicate,hideOverlap:!0,padding:[A.SPACING*.5,A.SPACING*.5,0,A.SPACING*.5],formatter:I=>{const O=ne(i(I));return I===o?gs(O):I===r?fs(O):O},color:f.palette.black[60]}}),[o,r,M.length,f,i]),$=p.useMemo(()=>{const I={margin:0,verticalAlign:"bottom",padding:[0,0,A.SPACING*1.25,0],inside:!0,color:F=>{const Y=Math.max(...e.map(W=>W??Number.MIN_SAFE_INTEGER))||1;let q="transparent";return F>=Y&&(q=f.palette.black[60]),q},...f.typography.overlineDelicate,formatter:F=>ne(a(F))},O={verticalAlign:"middle",padding:[0,0,0,A.SPACING*.5],color:f.palette.black[60]},H=l==="dense"?I:O;return{type:"value",axisLine:{show:!1},splitLine:{show:!0,lineStyle:{color:f.palette.black[4]}},axisTick:{show:!1},axisLabel:{show:!0,showMaxLabel:!0,showMinLabel:!1,...H,...f.typography.overlineDelicate,formatter:F=>ne(a(F))}}},[f.palette.black,f.typography.overlineDelicate,e,a,l]),z=p.useMemo(()=>{const I=o===r&&M.filter(F=>F[2]!==0).length===1,H=(I?[M[0],M[M.length-1]]:M).map((F,Y)=>{const W=x.length&&!x.includes(Y)?f.palette.black[25]:f.palette.secondary.main;return{value:F,itemStyle:{color:W}}});return{type:"custom",cursor:"pointer",markArea:C,renderItem:function(F,Y){const q=F.dataIndex===M.length-1,W=F.dataIndex===0,V=H[F.dataIndex].itemStyle.color,ee=Y.value(0),pe=Y.value(1),re=Y.value(2),[_,K]=Y.coord([ee,re]),[X,Q]=Y.size([pe-ee,re]);return{type:"rect",shape:{x:I?_/10:_+(W?0:1),y:K,width:I?_-_/10:X-(q?0:1),height:Q},style:{fill:V},...!ls&&{emphasis:{style:{fill:s.darken(V,.25)}}}}},encode:{x:[0,1],y:2,tooltip:[0,1,2]},data:H,animation:u}},[o,r,M,C,f.palette.black,f.palette.secondary.main,x,u]),G=p.useMemo(()=>({grid:{left:A.SPACING*.1,right:A.SPACING*.1,top:A.SPACING*2,bottom:A.SPACING*.5,containLabel:!0},tooltip:P,xAxis:L,yAxis:$,series:[z]}),[P,L,$,z]),S=x.reduce((I,O)=>I+=e[O]??0,0),N=I=>{I.key==="Enter"&&c([])};return R?t.jsxRuntimeExports.jsx(as,{height:g}):t.jsxRuntimeExports.jsxs("div",{children:[w&&t.jsxRuntimeExports.jsxs(cs,{container:!0,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",weight:"strong",children:x.length>0?v.formatMessage({id:"c4r.widgets.histogram.selectedItems"},{items:ne(a(S))}):v.formatMessage({id:"c4r.widgets.histogram.all"})}),x.length>0&&t.jsxRuntimeExports.jsx(us,{onClick:()=>c([]),onKeyDown:N,underline:"hover",tabIndex:0,children:v.formatMessage({id:"c4r.widgets.histogram.clear"})})]}),t.jsxRuntimeExports.jsx(Ee,{option:G,onEvents:D,lazyUpdate:!0,onChartReady:k,style:{maxHeight:g}})]})}function gs(e){return`${Array(String(e).length).fill(" ").join("")}${e}`}function fs(e){const n=Array(String(e).length).fill(" ").join("");return`${e}${n}`}function hs(e,n,o,r){return e.map((i,a)=>[a===0?o:n[a-1],a===e.length-1?r:n[a],i])}function js(e,n,o,r){const i=s.useTheme(),a=p.useMemo(()=>n===de.RANKING?e.slice().sort((c,d)=>(d.value??0)-(c.value??0)):e,[e,n]),l=p.useMemo(()=>{const c=[];let d=0;for(const m of a)c.length<o?c.push({...m}):d+=m.value??0;return d>0&&c.push({name:ye,value:d,emphasis:{scale:!1}}),c},[o,a]);return p.useMemo(()=>{const c=i.palette.common.white;return l.map((d,m)=>{let u=c;if(r.length){const g=r[m%r.length];g&&(u=g)}else{const h=i.palette.qualitative.bold[m];h&&(u=h)}const y=d;return y.color=u,y})},[l,r,i])}const ys=s.styled(s.Box)(({theme:e})=>({zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",paddingBottom:e.spacing(1)})),Es=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),maxWidth:"140px",textTransform:"uppercase"})),Rs=s.styled(s.Box)(({theme:e})=>({display:"inline-block",borderRadius:e.spacing(.5),width:e.spacing(1),minWidth:e.spacing(1),height:e.spacing(1)}));function vs({data:e,selectedCategories:n,formatter:o}){const[r,i]=p.useState(),a=p.useMemo(()=>{if(!e||e.length===0)return null;let d;n.length>0?d=e.filter(h=>n.includes(h.name)):d=e;const m=ws(d),u=d.find(h=>h===m);if(!u)return null;let y=0;for(const h of e)y+=h.value??0;const g=bs(u.value??0,y,o);return{...u,percentage:g}},[e,n,o]);p.useEffect(()=>{a&&i(a)},[a,i]);const{name:l,percentage:x,color:c}=r??{};return r?t.jsxRuntimeExports.jsxs(ys,{children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"h5",children:x}),t.jsxRuntimeExports.jsxs(Es,{children:[t.jsxRuntimeExports.jsx(Rs,{bgcolor:c,component:"span"}),t.jsxRuntimeExports.jsx(B.Typography,{component:"span",variant:"body2",noWrap:!0,children:l})]})]}):null}function ws(e){const n=e.filter(o=>o.name!==ye);return n.length===0?e[0]:n.reduce((o,r)=>(r.value??0)>(o.value??0)?r:o)}function bs(e,n,o){let r=0;return n!==0&&(r=e/n*100),o?o(r):`${r}%`}const vt=32,Ss=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",marginTop:e.spacing(.5)})),Is=s.styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",position:"relative"})),ks=s.styled(Fn)(()=>({position:"absolute",zIndex:1})),Ms=s.styled("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",gap:e.spacing(1),position:"absolute",zIndex:2})),Ts=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(2),height:e.spacing(5)})),Cs=s.styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1.5)}));function qt({height:e}){const n=parseInt(String(e),10)||ze,o=n-vt,r=o-vt;return t.jsxRuntimeExports.jsxs(s.Box,{mt:.5,children:[t.jsxRuntimeExports.jsx(s.Skeleton,{height:8,width:64}),t.jsxRuntimeExports.jsx(Ss,{height:n,children:t.jsxRuntimeExports.jsxs(Is,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{variant:"circular",width:o,height:o}),t.jsxRuntimeExports.jsx(ks,{variant:"circular",width:r,height:r}),t.jsxRuntimeExports.jsxs(Ms,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{height:24,width:72}),t.jsxRuntimeExports.jsx(s.Skeleton,{height:8,width:48})]})]})}),t.jsxRuntimeExports.jsx(Ts,{children:[...Array(2)].map((i,a)=>t.jsxRuntimeExports.jsxs(Cs,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{variant:"circular",width:8,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})]},a))})]})}const As=s.styled(s.Box)(({theme:e})=>({position:"relative",padding:e.spacing(1.25,1,0,1),width:"100%"})),Bs=s.styled(s.Box)(({theme:e})=>({position:"relative",display:"flex",flexDirection:"row",overflowX:"hidden",gap:e.spacing(2),padding:e.spacing(.5),margin:e.spacing(-.5)})),Ps=s.styled(s.Box)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1),alignItems:"center",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"})),Ls=s.styled(s.Box)(({theme:e})=>({display:"inline-block",position:"absolute",left:e.spacing(-2),top:e.spacing(1),bottom:e.spacing(1),zIndex:1,width:e.spacing(2.5),background:`linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, ${e.palette.background.paper} 100%)`})),Ds=s.styled(s.Box)(({theme:e})=>({position:"absolute",padding:e.spacing(.25,1),top:e.spacing(0),right:0,background:e.palette.background.paper})),$s=s.styled(s.Box,{shouldForwardProp:e=>e!=="color"})(({theme:e,color:n})=>{const o=e.spacing(1);return{backgroundColor:n,borderRadius:"50%",width:o,height:o}});function Kt({series:e,selectedCategories:n,onCategoryClick:o}){var w,b;const r=s.useTheme(),[i,a]=p.useState(!1),[l,x]=p.useState(0),[c,d]=p.useState(void 0),m=p.useRef(null),u=p.useRef(null),y=p.useRef(null),g=J.useIntl(),h=B.useImperativeIntl(g);function j(){x(l+1)}function f(){x(Math.max(l-1))}function v(E,k){E.key==="Enter"&&(o==null||o(k))}const R=p.useCallback(()=>{var k,M,D;const E=!!u.current&&u.current.scrollWidth>u.current.clientWidth;a(E),d(E&&u.current?(((k=m.current)==null?void 0:k.clientWidth)??0)-(((M=y.current)==null?void 0:M.clientWidth)??70):(((D=m.current)==null?void 0:D.clientWidth)??0)-12||500)},[m,u,y]);return p.useEffect(()=>{R()},[u,(w=u.current)==null?void 0:w.scrollWidth,(b=u.current)==null?void 0:b.clientWidth,R,l]),p.useEffect(()=>{if(typeof ResizeObserver>"u")return;let E;return m.current&&(E=new ResizeObserver(()=>{R()}),E.observe(m.current)),()=>{E==null||E.disconnect()}},[m,R]),t.jsxRuntimeExports.jsxs(As,{ref:m,children:[t.jsxRuntimeExports.jsx(Bs,{ref:u,style:{maxWidth:`${c}px`},children:e.map((E,k)=>{if(k<l)return null;const M=n.length===0||n.includes(E.name);return t.jsxRuntimeExports.jsxs(Ps,{tabIndex:0,onClick:o?()=>o(E.name):void 0,onKeyDown:o?D=>v(D,E.name):void 0,style:{pointerEvents:!o||E.name==="Others"?"none":void 0},children:[t.jsxRuntimeExports.jsx($s,{color:M?E.color:r.palette.text.disabled}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",color:M?void 0:"text.disabled",children:E.name})]},k)})}),(i||l>0)&&t.jsxRuntimeExports.jsxs(Ds,{ref:y,children:[t.jsxRuntimeExports.jsx(Ls,{}),t.jsxRuntimeExports.jsx(s.Tooltip,{title:h.formatMessage({id:"c4r.widgets.chartLegend.next"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",disabled:l===0,onClick:f,children:t.jsxRuntimeExports.jsx(fe.ChevronLeft,{})})}),t.jsxRuntimeExports.jsx(s.Tooltip,{title:h.formatMessage({id:"c4r.widgets.chartLegend.prev"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",disabled:!i,onClick:j,children:t.jsxRuntimeExports.jsx(fe.ChevronRight,{})})})]})]})}const Je="232px",Os=s.styled(s.Grid)(({theme:e})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(.5)})),Ns=s.styled(s.Box,{shouldForwardProp:e=>e!=="height"&&e!=="width"})(({height:e,width:n})=>({position:"relative",margin:"0 auto",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:n||"100%",height:e||"100%"})),Fs=s.styled(Ee)(()=>({position:"absolute",top:0,right:0,left:0,bottom:0})),wt=[],Ws={},_s=e=>e;function Gs({name:e,data:n,formatter:o=_s,tooltipFormatter:r=zs,percentFormatter:i,height:a=Je,width:l=Je,labels:x=Ws,colors:c=wt,animation:d=!0,filterable:m=!0,selectedCategories:u=wt,onSelectedCategoriesChange:y,isLoading:g,maxItems:h=11,order:j=de.RANKING}){const f=s.useTheme(),v=js(n,j,h,c),{showSkeleton:R}=ue(!!g),w=J.useIntl(),b=B.useImperativeIntl(w),E=p.useMemo(()=>i||(G=>`${w.formatNumber(G,{maximumFractionDigits:2,minimumFractionDigits:2})}%`),[w,i]),k=p.useMemo(()=>{let G;return r&&(G=S=>r(S,o,E)),{padding:[A.SPACING*.5,A.SPACING],backgroundColor:f.palette.black[90],borderColor:"transparent",textStyle:{color:f.palette.common.white},confine:!0,formatter:G}},[f.palette.black,f.palette.common.white,r,o,E]),M=p.useMemo(()=>[{type:"pie",name:e,animation:d,data:v.map(G=>{const S={...G},N=(u==null?void 0:u.length)&&!u.includes(S.name);return x!=null&&x[S.name]&&(S.name=x[S.name]),N?{...S,disabled:!0,itemStyle:{color:f.palette.black[25]}}:{...S,itemStyle:{color:S.color}}}),radius:["74%","90%"],selectedOffset:0,bottom:A.SPACING*1.5,label:{show:!1},emphasis:{focus:"series",scaleSize:5},itemStyle:{borderColor:f.palette.background.paper,borderWidth:1}}],[e,d,v,x,u,f]),D=p.useMemo(()=>({grid:{left:0,top:0,right:0,bottom:0},tooltip:k,legend:{show:!1},series:M}),[k,M]),C=p.useCallback(G=>{if(y){const S=[...u],{name:N}=v[G.dataIndex];if(N===ye)return;const I=S.indexOf(N);I===-1?S.push(N):S.splice(I,1),y(S)}},[v,y,u]),P=p.useCallback(G=>{if(y){const S=[...u],N=S.indexOf(G);N===-1?S.push(G):S.splice(N,1),y(S)}},[y,u]),L={...m&&{click:C}},$=()=>{y==null||y([])},z=G=>{G.key==="Enter"&&$()};return R?t.jsxRuntimeExports.jsx(qt,{height:a}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[m&&t.jsxRuntimeExports.jsxs(Os,{container:!0,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"textSecondary",children:u.length?b.formatMessage({id:"c4r.widgets.pie.selectedItems"},{items:u.length}):b.formatMessage({id:"c4r.widgets.pie.allSelected"})}),u.length>0&&t.jsxRuntimeExports.jsx(s.Link,{variant:"caption",onClick:$,onKeyDown:z,tabIndex:0,children:b.formatMessage({id:"c4r.widgets.pie.clear"})})]}),t.jsxRuntimeExports.jsxs(Ns,{height:a,width:l,children:[t.jsxRuntimeExports.jsx(vs,{data:v,selectedCategories:u,formatter:E}),t.jsxRuntimeExports.jsx(Fs,{option:D,onEvents:L,lazyUpdate:!0,style:{height:a,width:l}})]}),v.length>0&&t.jsxRuntimeExports.jsx(Kt,{series:v,selectedCategories:u,onCategoryClick:y&&P})]})}function zs(e,n,o){var c;const r=Array.isArray(e)?e[0]:e;if(!r)return null;const i=ne(n(r.value)),a=o(r.percent)||`${r.percent}%`,x=`display:inline-block;border-radius:4px;width:8px;height:8px;background-color:${((c=r.data)==null?void 0:c.color)||r.textStyle.color}`;return`
|
|
5
|
+
<div style="white-space:normal;"><p style="max-width:${Je};font-size:11px;font-weight:500;line-height:1.454;text-transform:uppercase;margin:0 0 4px 0;">${r.name}</p>
|
|
6
|
+
<p style="display:flex;align-items:center;font-size: 11px;font-weight:500;line-height:1.454;margin:0;"><span style="${x}"></span> <span style="margin:0 4px;font-weight:400;">${i}</span> (${a})</p></div>
|
|
7
|
+
`.trim()}const Hs=s.styled(s.Grid)(({theme:e})=>({position:"relative",alignItems:"center",height:e.spacing(4)})),Ys=s.styled(s.Grid)(({theme:e})=>({position:"absolute",zIndex:1,padding:e.spacing(0,3)}));function Vs(){return t.jsxRuntimeExports.jsxs(s.Grid,{container:!0,children:[t.jsxRuntimeExports.jsxs(Hs,{container:!0,item:!0,children:[t.jsxRuntimeExports.jsxs(Ys,{container:!0,item:!0,justifyContent:"space-between",children:[t.jsxRuntimeExports.jsx(ht,{variant:"circular",width:12,height:12}),t.jsxRuntimeExports.jsx(ht,{variant:"circular",width:12,height:12})]}),t.jsxRuntimeExports.jsx(s.Skeleton,{height:2,width:"100%"})]}),t.jsxRuntimeExports.jsxs(s.Grid,{container:!0,item:!0,justifyContent:"space-between",children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:56,height:32}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:56,height:32})]})]})}const Us=s.styled(s.Box)(()=>({position:"relative"})),qs=s.styled(s.Box)(({theme:{spacing:e}})=>({display:"flex",flexDirection:"row-reverse",height:e(1.5)})),Ks=s.styled(s.Link)(()=>({cursor:"pointer"})),bt=s.styled(s.TextField)(({theme:{spacing:e}})=>({maxWidth:e(9),margin:0,"& fieldset":{borderWidth:1},"& input":{"&[type=number]":{appearance:"textfield"},"&::-webkit-outer-spin-button":{appearance:"none",margin:0},"&::-webkit-inner-spin-button":{appearance:"none",margin:0}}})),Zs=s.styled(s.Slider)(({theme:{palette:e}})=>({"& .MuiSlider-rail":{color:e.text.hint}})),Xs=s.styled(s.Slider)(({theme:{palette:e,spacing:n}})=>({pointerEvents:"none",position:"absolute",zIndex:1,left:0,right:0,"& .MuiSlider-rail":{display:"none"},"& .MuiSlider-thumb":{display:"none"},"& .MuiSlider-track":{color:e.primary.main,opacity:.38},"& .MuiSlider-mark, & .MuiSlider-markActive":{backgroundColor:e.primary.main,opacity:.38,height:n(1),width:n(.25),top:"50%",transform:"translateY(-50%)"}}));function Js({data:e,min:n,max:o,limits:r,onSelectedRangeChange:i,isLoading:a}){const[l,x]=p.useState([n,o]),[c,d]=p.useState([n,o]),m=J.useIntl(),u=B.useImperativeIntl(m),{showSkeleton:y}=ue(!!a),g=p.useMemo(()=>{if(!r||r.length!==2)return;if(r[0]===r[1])return[{value:r[0]}];const E=[{value:Math.max(r[0],n)},{value:Math.min(r[1],o)}];if(!(E[0].value>E[1].value))return E},[r,o,n]),h=p.useMemo(()=>i?s.debounce(i,250):null,[i]),j=E=>{d([...E]),x([...E]),h&&h([...E])};function f(E,k){const M=E.target.value===""?"":Number(E.target.value);k===0&&d([M,c[1]]),k===1&&d([c[0],M])}const v=n!==c[0]||o!==c[1];p.useEffect(()=>{e&&(d([...e]),x([...e]))},[e]);function R(E){let k=c[E];k===""&&(k=l[E]),k>o&&(k=o),k<n&&(k=n);const M=E===0?[k,c[1]]:[c[0],k];j(M.sort((D,C)=>D-C))}const w=()=>{j([n,o])};function b(E){E.key==="Enter"&&w()}return y?t.jsxRuntimeExports.jsx(Vs,{}):t.jsxRuntimeExports.jsxs(Us,{children:[t.jsxRuntimeExports.jsx(qs,{children:v&&t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"primary",children:t.jsxRuntimeExports.jsx(Ks,{onClick:w,onKeyDown:b,tabIndex:0,component:"button",underline:"hover",children:u.formatMessage({id:"c4r.widgets.range.clear"})})})}),t.jsxRuntimeExports.jsxs(s.Box,{children:[t.jsxRuntimeExports.jsx(Zs,{getAriaLabel:E=>E===0?u.formatMessage({id:"c4r.widgets.range.minValue"}):u.formatMessage({id:"c4r.widgets.range.maxValue"}),value:l,min:n,max:o,onChange:(E,k)=>j(k)}),r&&r.length===2&&t.jsxRuntimeExports.jsx(Xs,{getAriaLabel:E=>E===0?u.formatMessage({id:"c4r.widgets.range.minLimit"}):u.formatMessage({id:"c4r.widgets.range.maxLimit"}),value:r,min:n,max:o,marks:g})]}),t.jsxRuntimeExports.jsxs(s.Box,{display:"flex",justifyContent:"space-between",mb:1,children:[t.jsxRuntimeExports.jsx(bt,{value:c[0],size:"small",onChange:E=>f(E,0),onBlur:()=>R(0),inputProps:{min:n,max:o,type:"number","aria-label":u.formatMessage({id:"c4r.widgets.range.minValue"})}}),t.jsxRuntimeExports.jsx(bt,{value:c[1],size:"small",onChange:E=>f(E,1),onBlur:()=>R(1),inputProps:{min:n,max:o,type:"number","aria-label":u.formatMessage({id:"c4r.widgets.range.maxValue"})}})]})]})}const Qs=s.styled(Gt)(({theme:e})=>({flexDirection:"column",alignItems:"center",justifyContent:"center",marginLeft:e.spacing(4),containerType:"inline-size",[`@container (max-width: ${A.BREAKPOINTS.XS}px)`]:{" > div":{maxWidth:"75%"}}})),eo=s.styled(s.Box)(()=>({position:"relative",display:"flex",justifyContent:"space-between",width:"80%",maxWidth:"50%"}));function to({height:e}){function n(){return Math.floor(Math.random()*5)}return t.jsxRuntimeExports.jsxs(s.Box,{height:e??ze,children:[t.jsxRuntimeExports.jsx(s.Box,{mb:4,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})}),t.jsxRuntimeExports.jsx(Qs,{height:"80%",children:[...Array(3)].map((o,r)=>t.jsxRuntimeExports.jsx(eo,{ml:r*3,children:[...Array(4)].map((i,a)=>t.jsxRuntimeExports.jsx(s.Box,{mt:n(),ml:n(),children:t.jsxRuntimeExports.jsx(s.Skeleton,{variant:"circular",width:12,height:12})},a))},r))})]})}function no(e,n){var c;const o=Array.isArray(e.tooltip)?e.tooltip[0]:e.tooltip,r=Array.isArray(n.tooltip)?n.tooltip[0]:n.tooltip,i=o==null?void 0:o.formatter,a=r==null?void 0:r.formatter,l=(c=e.series[0])==null?void 0:c.data,x=n.series[0].data;return i!==a?!1:l&&x&&l.length===x.length?!x.some(({value:d},m)=>{var u;return d!==((u=l[m])==null?void 0:u.value)}):!1}function so({tooltipFormatter:e,xAxisFormatter:n=Ne,yAxisFormatter:o=Ne},r){return{grid:{top:10,left:5,bottom:10,right:15,containLabel:!0},tooltip:{padding:[A.SPACING*.5,A.SPACING],textStyle:{...r.typography.caption,fontSize:11,color:r.palette.common.white},backgroundColor:r.palette.black[90],...e?{formatter:e}:{}},color:[r.palette.secondary.main],xAxis:{axisLabel:{...r.typography.overlineDelicate,padding:[A.SPACING*.5,0,0,0],formatter:i=>ne(n(i))}},yAxis:{axisLabel:{...r.typography.overlineDelicate,formatter:i=>ne(o(i))}}}}function oo({name:e,data:n,animation:o}){return[{type:"scatter",name:e,data:n,animation:o}]}const ro=p.memo(Ee,(e,n)=>no(e.option,n.option)),St=225,io=[],Ne=e=>e;function ao({name:e=null,data:n=io,animation:o=!0,xAxisFormatter:r=Ne,yAxisFormatter:i=Ne,tooltipFormatter:a=lo,isLoading:l}){const x=s.useTheme(),c=p.useRef(),[d,m]=p.useState({series:[]}),{showSkeleton:u}=ue(!!l);return p.useEffect(()=>{const y=so({xAxisFormatter:r,yAxisFormatter:i,tooltipFormatter:a},x),g=oo({name:e,data:n||[],animation:o});m({...y,series:g})},[n,e,o,x,r,i,a]),u?t.jsxRuntimeExports.jsx(to,{height:St}):t.jsxRuntimeExports.jsx(ro,{ref:c,option:d,lazyUpdate:!0,style:{height:St}})}function lo(e){const n=Array.isArray(e)?e[0]:e,o=(n==null?void 0:n.value)||[];return`[${o[0]}, ${o[1]})`}function Ae({width:e,rows:n=4,index:o=0}){function r(i){const a=[72,48,96,32,64],l=i%a.length;return a[l]}return[...Array(n)].map((i,a)=>t.jsxRuntimeExports.jsx(s.TableCell,{children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:e??r(o),height:8})},a))}const co=s.styled(s.Box)(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.spacing(2),margin:0,padding:e.spacing(2,1)})),uo=s.styled(s.TableContainer)(()=>({overflow:"hidden"}));function po({style:e,dense:n,pagination:o,rowsPerPage:r}){return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(uo,{style:e,children:t.jsxRuntimeExports.jsxs(s.Table,{"aria-label":"skeleton table",size:n?"small":"medium",children:[t.jsxRuntimeExports.jsx(s.TableHead,{children:t.jsxRuntimeExports.jsxs(s.TableRow,{children:[t.jsxRuntimeExports.jsx(Ae,{rows:1,width:8}),t.jsxRuntimeExports.jsx(Ae,{width:56})]})}),t.jsxRuntimeExports.jsx(s.TableBody,{children:[...Array(Math.min(10,r??10))].map((i,a)=>t.jsxRuntimeExports.jsxs(s.TableRow,{children:[t.jsxRuntimeExports.jsx(Ae,{rows:1,width:8}),t.jsxRuntimeExports.jsx(Ae,{index:a})]},a))})]})}),o&&t.jsxRuntimeExports.jsxs(co,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:56,height:8}),t.jsxRuntimeExports.jsx(s.Box,{mr:1,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:52,height:16})}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:60,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:16,height:16}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:16,height:16})]})]})}const xo=s.styled(s.TableSortLabel)(({theme:e})=>({...e.typography.caption,color:e.palette.text.secondary})),mo=s.styled(s.TableRow)(({theme:e})=>({maxHeight:e.spacing(6.5),transition:"background-color 0.25s ease","&.MuiTableRow-hover:hover":{cursor:"pointer",backgroundColor:e.palette.background.default}})),go=s.styled(s.TableCell)(()=>({overflow:"hidden","& p":{maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),fo=s.styled(s.TablePagination)(({theme:e})=>({height:e.spacing(6),overflowX:"auto",overflowY:"hidden"})),ho=10,jo=[5,10,25],be=()=>{};function yo({columns:e,rows:n,sorting:o=!1,sortBy:r,sortDirection:i="asc",onSetSortBy:a=be,onSetSortDirection:l=be,pagination:x=!1,totalCount:c,page:d,onSetPage:m=be,rowsPerPage:u=ho,rowsPerPageOptions:y=jo,onSetRowsPerPage:g=be,onRowClick:h=be,height:j,dense:f=!1,isLoading:v,lastPageTooltip:R}){var $;const w=p.useRef(null),b=J.useIntl(),E=B.useImperativeIntl(b),{showSkeleton:k}=ue(!!v);function M({from:z,to:G,count:S}){return E.formatMessage({id:"c4r.widgets.table.of"},{from:z,to:G,count:S})}function D(z){l(r===z&&i==="asc"?"desc":"asc"),a(z)}function C(z,G){m(G)}function P(z){g(parseInt(z.target.value,10)),m(0)}const L={height:void 0};if(j){const z=Math.max((($=w==null?void 0:w.current)==null?void 0:$.clientHeight)??0,x?A.SPACING*6:0);L.height=`calc(${j} - ${z}px)`}return k?t.jsxRuntimeExports.jsx(po,{rowsPerPage:u,style:L,dense:f,pagination:x}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.TableContainer,{style:L,children:t.jsxRuntimeExports.jsxs(s.Table,{stickyHeader:!0,size:f?"small":"medium",children:[t.jsxRuntimeExports.jsx(Eo,{columns:e,sorting:o,sortBy:r,sortDirection:i,onSort:D}),t.jsxRuntimeExports.jsx(vo,{columns:e,rows:n,onRowClick:h})]})}),x&&t.jsxRuntimeExports.jsx(fo,{ref:w,rowsPerPageOptions:y,labelRowsPerPage:E.formatMessage({id:"c4r.widgets.table.rowsPerPage"}),labelDisplayedRows:M,component:"div",count:c,rowsPerPage:u,page:d,onPageChange:C,onRowsPerPageChange:P,ActionsComponent:()=>t.jsxRuntimeExports.jsx(B.TablePaginationActions,{count:c,rowsPerPage:u,page:d,onPageChange:C,lastPageTooltip:R})})]})}function Eo({columns:e,sorting:n,sortBy:o,sortDirection:r,onSort:i}){return t.jsxRuntimeExports.jsx(s.TableHead,{children:t.jsxRuntimeExports.jsx(s.TableRow,{children:e.map(({field:a,headerName:l,align:x})=>t.jsxRuntimeExports.jsx(s.TableCell,{align:x??"left",children:n?t.jsxRuntimeExports.jsx(xo,{active:o===a,direction:o===a?r:"asc",onClick:()=>i(a),children:l??a}):l??a},a))})})}function Ro(e,n){var r;const o=(r=Object.entries(e).find(([i])=>i.toUpperCase()===n.toUpperCase()))==null?void 0:r[1];return typeof o=="bigint"?o.toString():Array.isArray(o)?`[${o.map(a=>typeof a=="string"?`"${a}"`:String(a)).join(", ")}]`:typeof o=="object"&&o!==null?JSON.stringify(o):o}function vo({columns:e,rows:n,onRowClick:o}){return t.jsxRuntimeExports.jsx(s.TableBody,{children:n.map((r,i)=>{const a=String(r.cartodb_id||r.id||i);return t.jsxRuntimeExports.jsx(mo,{hover:!!o,onClick:()=>o&&o(r),children:e.map(({field:l,headerName:x,align:c,component:d})=>{const m=Ro(r,l);return(x??l)&&t.jsxRuntimeExports.jsx(go,{scope:"row",align:c??"left",children:d?d(m):m},`${a}_${l}`)})},a)})})}function Zt(e,n,o,r,i){const a=Array.isArray(e)?e:[e],[l]=a[0].data,x=new Date(l);return`<div style='minWidth: 160px;'>
|
|
8
|
+
<p style='font-weight: 600; line-height: 1; margin: 4px 0;'>${Jt({date:x,stepMultiplier:r,stepSize:n})}</p>
|
|
9
|
+
${a.reduce((d,m)=>{if(m.value!==void 0&&m.value!==null){const u=`<div style='display: flex; flex-direction: row; align-items: center; justify-content: spread; height: 20px; gap: 8px;'>
|
|
10
|
+
<div style='display: flex; flex-direction: row; align-items: center; margin: 4px 0;'>
|
|
11
|
+
<div style='width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; border: 2px solid ${String(m.color)}'></div>
|
|
12
|
+
</div>
|
|
13
|
+
<p style='line-height: 1; flex: 1; margin-left: 0.5em; min-width: 20px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; align-self: left;'>
|
|
14
|
+
${i&&m.seriesName?`${m.seriesName}</p>`:""}
|
|
15
|
+
</p>
|
|
16
|
+
<p style='line-height: 1; justify-self: flex-end;'>${o(m.data[1])}</p>
|
|
17
|
+
</div>`;d.push(u)}return d},[]).join("")}
|
|
18
|
+
</div>`}var He=(e=>(e.LINE="line",e.BAR="bar",e))(He||{});function It(e){if(typeof e=="object"&&typeof(e==null?void 0:e.getTime)=="function")return e.getTime();const n=new Date(e).getTime();if(isFinite(n))return n}function Xt(e){return typeof e=="object"&&typeof(e==null?void 0:e.getTime)=="function"?e:new Date(e)}function Fe(e,n){var o,r;for(let i=0;i<n.length;i++){const a=n[i].name,l=i<n.length?(o=n[i+1])==null?void 0:o.name:a,x=i>0?(r=n[i-1])==null?void 0:r.name:a,c=Math.abs(a-l),d=Math.abs(a-x),m=a-d*.5,u=a+c*.5;if(isFinite(m)&&isFinite(u)){if(e>=m&&e<=u)return i}else if(isFinite(m)){if(e>=m)return i}else if(isFinite(u)&&e<=u)return i}}function wo(e){let n,o=0;for(const{name:r}of e)r!==n&&(n=r,o++);return o}function bo(e){const n=new Date(e),o=n.getDay(),r=n.getDate()-o+(o?1:-6);return n.setDate(r),n.setHours(0,0,0,0),n.getTime()}var le=(e=>(e.YEARS="year",e.MONTHS="month",e.WEEKS="week",e.DAYS="day",e.HOURS="hour",e.MINUTES="minute",e.SECONDS="second",e))(le||{});const nt={year:ge,month:ge,week:ge,day:ge,hour:Mo,minute:kt,second:kt},So={year:$o,month:Do,week:Lo,day:Po,hour:Bo,minute:Ao,second:Co};function Io({date:e,stepSize:n}){const o=nt[n];if(!o)throw new Error("formatTime: invalid stepSize");return o(e)}function We({start:e,end:n,stepSize:o}){if(e>n)return We({start:n,end:e,stepSize:o});const r=nt[o];if(!r)throw new Error("formatTimeRange: missing formatter or invalid stepSize");const i=r(e),a=r(n);return`${i} - ${a}`}function Jt({date:e,stepSize:n,stepMultiplier:o}){if(!nt[n])throw new Error("formatBucketRange: missing formatter or invalid stepSize");const{start:i,end:a}=To({date:e,stepSize:n,stepMultiplier:o});if(o===1){if(n==="day")return Io({date:i,stepSize:n});if(n==="second")return`${ge(i)} ${Qe(i)} - ${Qe(a)}`}return We({start:i,end:a,stepSize:n})}const st=e=>1e3*e,ot=e=>st(60*e),ko=e=>ot(60*e);function ge(e){return e.toLocaleDateString()}function Mo(e){return ge(e)+" "+e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",hour12:!0})}function Qe(e){return e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!0,second:"2-digit"})}function kt(e){return ge(e)+" "+Qe(e)}function To({date:e,stepSize:n,stepMultiplier:o=1}){const r=So[n];if(!r)throw new Error("getBucketInterval: invalid bucket size");return r({date:e,stepMultiplier:o})}function Co({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),0),r=new Date(o.getTime()+st(n-1)+999);return{start:o,end:r}}function Ao({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),0,0),r=new Date(o.getTime()+ot(n-1)+st(59));return{start:o,end:r}}function Bo({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),0,0,0),r=new Date(o.getTime()+ko(n-1)+ot(59));return{start:o,end:r}}function Po({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+n-1);return{start:o,end:r}}function Lo({date:e,stepMultiplier:n=1}){const o=new Date(bo(e)),r=new Date(o.getFullYear(),o.getMonth(),o.getDate()+6+7*(n-1));return{start:o,end:r}}function Do({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),e.getMonth(),1),r=new Date(e.getFullYear(),e.getMonth()+n,0);return{start:o,end:r}}function $o({date:e,stepMultiplier:n=1}){const o=new Date(e.getFullYear(),0,1),r=new Date(e.getFullYear()+(n-1),11,31);return{start:o,end:r}}const oe=()=>{},Qt=p.createContext({isPlaying:!1,setIsPlaying:oe,isPaused:!1,setIsPaused:oe,timeWindow:[],setTimeWindow:oe,onTimeWindowUpdate:oe,togglePlay:oe,stop:oe,intl:{}});function Ye(){return p.useContext(Qt)}function en({children:e,isPlaying:n,isPaused:o,onPlay:r=oe,onPause:i=oe,onStop:a=oe,timeWindow:l,onTimeWindowUpdate:x=oe,intl:c}){const[d,m]=p.useState(n),[u,y]=p.useState(o),[g,h]=p.useState([]),j=B.useImperativeIntl(c);p.useEffect(()=>{const w=g.sort((b,E)=>b<E?-1:1).map(Xt);x==null||x(w)},[g,x]);const f=p.useCallback(()=>{d&&(i&&i(),y(!0)),d||(r&&r(),y(!1)),m(w=>!w)},[d,i,r]),v=p.useCallback(()=>{m(!1),y(!1),h([])},[]),R=p.useCallback(()=>{v(),setTimeout(a)},[a,v]);return p.useEffect(()=>{n!==d&&m(n)},[n]),p.useEffect(()=>{o!==u&&y(o)},[o]),p.useEffect(()=>{if(!l)return;const w=l.map(It),b=g.map(It);(w[0]!==b[0]||w[1]!==b[1])&&h(w)},l),t.jsxRuntimeExports.jsx(Qt.Provider,{value:{isPlaying:!!d,setIsPlaying:m,isPaused:!!u,setIsPaused:y,timeWindow:g,setTimeWindow:h,onTimeWindowUpdate:x,togglePlay:f,stop:R,intl:j},children:e})}const Mt={};let Be=null;const Se={seriesId:"0"};function tn({echartsInstance:e,data:n,canSelectLines:o,filterable:r}){const i=s.useTheme(),{isPlaying:a,isPaused:l,setIsPaused:x,timeWindow:c,setTimeWindow:d,stop:m}=Ye(),[u,y]=p.useState(!1),[g,h]=p.useState(!1),[j,f]=p.useState(!1),[v,R]=p.useState(0),w=p.useMemo(()=>e==null?void 0:e.getZr(),[e]),b=p.useCallback(D=>w==null?void 0:w.setCursorStyle(D),[w]),E=p.useCallback(D=>{if(e){const[C]=e.convertFromPixel(Se,[D.offsetX,D.offsetY]),P=Fe(C,n);d(P!==void 0?[n[P].name]:[])}},[n,e,d]);p.useEffect(()=>{function D(C){r&&(o&&C.target||(c.length||(E(C),!l&&!a&&x(!0)),c.length===2&&(d([]),m())))}return Pe(w,"click",D)},[w,l,a,x,d,m,c.length,E,o,r]),p.useEffect(()=>{function D(C){var P;if(r){if(((P=C.target)==null?void 0:P.type)==="ec-line"){y(!0),b("grabbing");return}if(c.length===2){const[L]=e.convertFromPixel(Se,[C.offsetX,C.offsetY]);if(L>=c[0]&&L<=c[1]){f(!0);const $=L-c[0];R($);return}}if(e){h(!0);const[L]=e.convertFromPixel(Se,[C.offsetX,C.offsetY]);Be=L;return}}}return Pe(w,"mousedown",D)},[w,e,c,b,r]),p.useEffect(()=>{function D(C){var P;if(((P=C==null?void 0:C.target)==null?void 0:P.type)==="polygon"&&b("move"),u&&e&&(E(C),b("grabbing")),g&&e){const[L]=e.convertFromPixel(Se,[C.offsetX,C.offsetY]);d(Be===L?[]:[Be,L])}}return Pe(w,"mousemove",D)},[w,e,g,u,d,b,E]),p.useEffect(()=>{function D(C){if(u&&(y(!1),b("default")),g&&(h(!1),Be=null,c.length===1&&d([])),j&&e){const[P]=e.convertFromPixel(Se,[C.offsetX,C.offsetY]),L=P-c[0];if(v){const $=L-v;d([c[0]+$,c[1]+$])}f(!1)}}return Pe(w,"mouseup",D)},[w,e,j,g,u,v,d,c,b]),p.useEffect(()=>{!r&&c.length&&d([])},[r,d,c.length]);const k=p.useMemo(()=>{var L;if(c.length!==1)return;const D=c[0],C=Fe(D,n);if(C===void 0)return;const P=(L=n[C])==null?void 0:L.name;return P!==void 0&&{symbol:["none","none"],animationDuration:100,animationDurationUpdate:150,animationEasingUpdate:"linear",data:l||a?[{label:{show:!1},emphasis:{label:{show:!1}},xAxis:P,lineStyle:{type:"solid",color:i.palette.primary.main,width:1.5,shadowColor:i.palette.primary.light,shadowBlur:3}}]:[]}},[n,l,a,i,c]),M=p.useMemo(()=>c.length===2&&{data:[[{coord:[c[0]]},{coord:[c[1]]}]],itemStyle:{color:i.palette.primary.main,opacity:.2}},[i,c]);return{timelineOptions:k,timeWindowOptions:M}}function Pe(e,n,o){if(e!=null&&e.handler)return Mt[n]=o,e.on(n,o),()=>{Mt[n]&&(e!=null&&e.handler)&&e.off(n,o)}}const nn=A.SPACING*22,sn="100%",Oo=5,No=3,Fo=A.SPACING*20;function Wo({chartType:e,formatter:n,timeAxisSplitNumber:o,tooltip:r,tooltipFormatter:i,data:a,series:l,categories:x,height:c,fitHeight:d,animation:m,filterable:u,selectedCategories:y,onCategoryClick:g,yAxisType:h}){const j=s.useTheme(),[f,v]=p.useState(),R=S=>v(S),[w,b]=p.useState(),E=p.useMemo(()=>l.reduce((S,{data:N})=>N.reduce((I,O)=>O[1]>I?O[1]:I,S),Number.MIN_VALUE),[l]),k=p.useMemo(()=>({show:r,trigger:"axis",appendToBody:!0,padding:[A.SPACING*.5,A.SPACING],textStyle:{...j.typography.caption,fontSize:11,color:j.palette.common.white},borderWidth:0,backgroundColor:j.palette.black[90],position:(S,N,I,O,H)=>{const F={top:0};return H.contentSize[0]<H.viewSize[0]-S[0]?F.left=S[0]+A.SPACING*1.5:F.right=H.viewSize[0]-S[0]+A.SPACING*1.5,F},...i?{formatter:i}:{}}),[j,r,i]),M=p.useMemo(()=>{const S={margin:0,verticalAlign:"bottom",padding:[0,0,A.SPACING*1.25,0],inside:!0,color:O=>{let H="transparent";return O>=E&&(H=j.palette.black[60]),H}},N={margin:0,verticalAlign:"middle",padding:[0,A.SPACING*.75,0,0],color:j.palette.black[60]},I=h==="dense"?S:N;return{axisPointer:{lineStyle:{color:j.palette.black[40]}},xAxis:{type:"time",axisLine:{show:!0,lineStyle:{color:j.palette.grey[900],opacity:.2}},axisLabel:{fontWeight:j.typography.fontWeightRegular,fontSize:j.typography.caption.fontSize,fontFamily:j.typography.caption.fontFamily,lineHeight:j.typography.caption.lineHeight*8,letterSpacing:j.typography.caption.letterSpacing,formatter:{year:"{yearStyle|{yyyy}}"},rich:{yearStyle:{fontWeight:j.typography.fontWeightMedium,fontSize:j.typography.caption.fontSize,fontFamily:j.typography.caption.fontFamily,letterSpacing:j.typography.caption.letterSpacing,lineHeight:j.typography.caption.lineHeight*8}}},axisTick:{show:!1},splitNumber:o??(w!==void 0?Math.min(No,Math.ceil(w/Fo)):Oo)},yAxis:{type:"value",axisLabel:{show:!0,showMaxLabel:!0,showMinLabel:!1,...I,...n?{formatter:O=>n(O)}:{},fontWeight:j.typography.fontWeightRegular,fontSize:j.typography.overlineDelicate.fontSize,fontFamily:j.typography.overlineDelicate.fontFamily,lineHeight:j.typography.overlineDelicate.lineHeight*8,letterSpacing:j.typography.overlineDelicate.letterSpacing},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!0,onZero:!1,lineStyle:{color:j.palette.black[4]}},max:E}}},[j,E,n,w,o,h]),{timelineOptions:D,timeWindowOptions:C}=tn({echartsInstance:f,data:a,canSelectLines:!!g,filterable:u}),P=p.useMemo(()=>l.map(({data:S,color:N,name:I},O)=>{const H=y&&y.length>0,F=H&&y.includes(I),Y=!H||F?N:j.palette.action.disabledBackground;return{id:String(O),name:I,markLine:O===0?D:void 0,markArea:O===0?C:void 0,animation:m,data:S,type:e,smooth:!0,color:Y,z:H&&F?10:0,lineStyle:{width:2},showSymbol:!1,emphasis:{scale:2,lineStyle:{width:2,color:Y}}}}),[l,D,C,m,e,y,j]),L=p.useMemo(()=>({grid:{left:A.SPACING*(h==="dense"?2:3.5),top:A.SPACING*4,right:A.SPACING*2,bottom:A.SPACING*3},color:[j.palette.secondary.main],tooltip:k,...M,series:P}),[M,P,h,j.palette.secondary.main,k]),z={click:p.useCallback(S=>{if(x&&g&&S.componentType==="series"){const N=x[S.seriesIndex];g(N)}},[x,g])};p.useEffect(()=>{var I;if(typeof ResizeObserver>"u"||!f)return;const S=(I=f==null?void 0:f.getDom())==null?void 0:I.parentElement;if(!S)return;const N=new ResizeObserver(()=>{b(S.clientWidth),f.resize()});return N.observe(S),()=>{N.disconnect()}},[f]);const G=d?sn:c??nn;return p.useLayoutEffect(()=>{var N;const S=(N=f==null?void 0:f.getDom())==null?void 0:N.parentElement;S&&b(S.clientWidth),f==null||f.resize()},[G,d,f]),t.jsxRuntimeExports.jsx(Ee,{option:L,onEvents:z,onChartReady:R,style:{height:G}})}const _o={[le.YEARS]:60*60*24*7,[le.MONTHS]:60*60*24,[le.WEEKS]:60*60*24,[le.DAYS]:60*60*12,[le.HOURS]:60*60,[le.MINUTES]:60*15,[le.SECONDS]:1},Go=[.5,1,2,3];function zo({data:e,stepSize:n}){const[o,r]=p.useState(null),[i,a]=p.useState(1),l=p.useRef({animationFrameId:null,timeoutId:null}),{isPlaying:x,isPaused:c,timeWindow:d,setTimeWindow:m,stop:u,togglePlay:y,intl:g}=Ye();qo(()=>(x||c)&&u(),[e]);const h=()=>{const{animationFrameId:b,timeoutId:E}=l.current;b&&window.cancelAnimationFrame(b),E&&clearTimeout(E)},j=p.useCallback(()=>{h(),u()},[u]),f=()=>{h(),y()};p.useEffect(()=>{if(x&&d.length===2&&e.length){const E=_o[n]*1e3;return Ko({data:e,timeWindow:d,msTimeWindowStep:E*i,drawFrame:k=>{m(k)},onEnd:()=>{setTimeout(j,250)},animationRef:l}),()=>h()}},[e,x,n,m,j,i]),p.useEffect(()=>{if(x&&d.length===1&&e.length)return Xo({speed:i,timelinePosition:d[0],data:e,drawFrame:b=>{m([b])},onEnd:()=>{setTimeout(j,250)},animationRef:l}),()=>h();x&&d.length===0&&m([e[0].name])},[e,x,i,d.length,j]);const v=b=>{b!=null&&b.currentTarget&&r(b.currentTarget)},R=()=>{r(null)},w=b=>{a(b),R()};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",color:"default",onClick:v,"data-testid":"clock",children:t.jsxRuntimeExports.jsx(Ho,{})}),t.jsxRuntimeExports.jsxs(s.Menu,{anchorEl:o,keepMounted:!0,open:!!o,onClose:R,children:[t.jsxRuntimeExports.jsx(s.MenuItem,{disabled:!0,children:t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"textSecondary",children:g.formatMessage({id:"c4r.widgets.timeSeries.speed"})})}),Go.map(b=>t.jsxRuntimeExports.jsxs(s.MenuItem,{selected:b===i,onClick:()=>w(b),children:[b,"x"]},b))]}),t.jsxRuntimeExports.jsx(s.Box,{mt:2,children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",color:"primary",disabled:!(c||x),onClick:j,"data-testid":"stop",children:t.jsxRuntimeExports.jsx(Vo,{})})}),t.jsxRuntimeExports.jsx(s.Box,{mt:.75,children:t.jsxRuntimeExports.jsx(s.IconButton,{"data-testid":"play-pause",size:"small",color:"primary",onClick:f,children:x?t.jsxRuntimeExports.jsx(Uo,{}):t.jsxRuntimeExports.jsx(Yo,{})})})]})}function Ho(){return t.jsxRuntimeExports.jsx(s.SvgIcon,{viewBox:"0 0 20 20",children:t.jsxRuntimeExports.jsx("path",{d:"M12.5 1.254h-5v1.667h5V1.254zM9.167 12.088h1.666v-5H9.167v5zm6.691-5.517 1.184-1.183a9.207 9.207 0 0 0-1.175-1.175l-1.184 1.183A7.468 7.468 0 0 0 10 3.746a7.5 7.5 0 0 0-7.5 7.5c0 4.141 3.35 7.5 7.5 7.5s7.5-3.358 7.5-7.5a7.504 7.504 0 0 0-1.642-4.675zM10 17.088a5.83 5.83 0 0 1-5.833-5.834A5.83 5.83 0 0 1 10 5.421a5.83 5.83 0 0 1 5.833 5.833A5.83 5.83 0 0 1 10 17.087z",id:"-↳Color",fill:"inherit"})})}function Yo(){return t.jsxRuntimeExports.jsx(s.SvgIcon,{"data-testid":"play-icon",children:t.jsxRuntimeExports.jsx("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",id:"-↳Color",fill:"inherit"})})}function Vo(){return t.jsxRuntimeExports.jsx(s.SvgIcon,{children:t.jsxRuntimeExports.jsx("path",{d:"M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2zm0 2c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8zm4 4v8H8V8h8zm-2 2h-4v4h4v-4z",id:"-↳Color",fill:"inherit"})})}function Uo(){return t.jsxRuntimeExports.jsx(s.SvgIcon,{"data-testid":"pause-icon",children:t.jsxRuntimeExports.jsx("path",{d:"M9,16 L11,16 L11,8 L9,8 L9,16 Z M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z M12,20 C7.59,20 4,16.41 4,12 C4,7.59 7.59,4 12,4 C16.41,4 20,7.59 20,12 C20,16.41 16.41,20 12,20 Z M13,16 L15,16 L15,8 L13,8 L13,16 Z",id:"-↳Color",fill:"inherit"})})}function qo(e,n=[]){const o=p.useRef(!1);p.useEffect(()=>{o.current?e():o.current=!0},n)}function Ko({msTimeWindowStep:e,timeWindow:n,data:o,drawFrame:r,onEnd:i,animationRef:a}){let l=n;const x=()=>{a.current.animationFrameId=window.requestAnimationFrame(c)},c=()=>{l=[l[0]+e,l[1]+e],l[1]>o[o.length-1].name?i():(r(l),x())};x()}const Zo=2;function Xo({speed:e,timelinePosition:n,data:o,drawFrame:r,onEnd:i,animationRef:a}){let l=Fe(n,o)??0,x=o[l].name;const c=wo(o),d=Math.max(Math.round(Math.sqrt(c)/2),Zo)*e,m=()=>{a.current.timeoutId=setTimeout(()=>{a.current.animationFrameId=window.requestAnimationFrame(u)},1e3/d)},u=()=>{for(;l<o.length;l++){const y=o[l].name;if(y!==x){x=y;break}}l===o.length?i():(r(x),m())};m()}const Jo=s.styled(s.Box)(()=>({containerType:"inline-size",display:"flex",flexDirection:"column"})),Qo=s.styled(s.Box)(()=>({display:"flex",flexDirection:"column"})),on=s.styled(s.Box)(()=>({display:"flex",flexDirection:"row"})),er=s.styled(on)(()=>({alignItems:"center",justifyContent:"space-between"})),tr=s.styled(s.Box)(({theme:e})=>({flexShrink:0,marginLeft:0,paddingLeft:e.spacing(1),[`@container (max-width: ${A.BREAKPOINTS.XS}px)`]:{paddingLeft:0},paddingBottom:e.spacing(1.5),alignSelf:"flex-end"})),nr=s.styled(s.Box)(({theme:e})=>({alignSelf:"normal",minWidth:0,paddingLeft:e.spacing(5),paddingBottom:e.spacing(1.5),[`@container (max-width: ${A.BREAKPOINTS.XS}px)`]:{paddingLeft:e.spacing(1)}}));function rn({fitHeight:e,header:n,controls:o,chart:r,legend:i}){const a=i&&t.jsxRuntimeExports.jsx(s.Box,{flex:0,mt:2,children:i});return t.jsxRuntimeExports.jsxs(Jo,{style:{flex:e?"1":void 0},children:[t.jsxRuntimeExports.jsx(er,{flex:0,children:n}),o?t.jsxRuntimeExports.jsxs(Qo,{flex:1,children:[t.jsxRuntimeExports.jsxs(on,{flex:1,children:[t.jsxRuntimeExports.jsx(tr,{flex:0,children:o}),t.jsxRuntimeExports.jsx(nr,{flex:1,children:r})]}),a]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Box,{pb:1.5,flex:1,children:r}),a]})]})}const sr=s.styled(s.Box)(()=>({display:"flex",flexDirection:"column",justifyContent:"flex-end"})),or=s.styled(s.Box)(()=>({position:"relative",height:"100%",alignSelf:"normal",display:"flex",flexDirection:"column",justifyContent:"flex-end"})),rr=s.styled(s.Box)(({theme:e})=>({padding:e.spacing(2.25,0,.5,2)})),ir=s.styled(_t)(({theme:e})=>({flexDirection:"column",flex:1,height:"100%",overflow:"hidden",svg:{height:"100%",width:"100%",fontSize:"initial",fill:"none",path:{stroke:e.palette.black[8]}}})),ar=s.styled(s.Box)(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",padding:e.spacing(1.25,.5,.75,.5)})),lr=s.styled(s.Box)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(2),margin:0,padding:e.spacing(1.5,1,.25,1)})),Tt=s.styled(s.Box)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1)})),cr=({fitHeight:e,height:n,showControls:o,showLegend:r})=>{const i=t.jsxRuntimeExports.jsx(s.Box,{pt:1.25,pb:.75,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})}),a=o&&t.jsxRuntimeExports.jsxs(sr,{children:[t.jsxRuntimeExports.jsx(s.Box,{p:.5,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:16,height:16})}),t.jsxRuntimeExports.jsx(s.Box,{mt:2,p:.5,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:16,height:16})}),t.jsxRuntimeExports.jsx(s.Box,{mt:1,p:.5,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:16,height:16})})]}),l=e?sn:n??nn,x=t.jsxRuntimeExports.jsxs(or,{style:{height:l},children:[t.jsxRuntimeExports.jsx(rr,{flex:0,children:t.jsxRuntimeExports.jsx(s.Skeleton,{width:24,height:8})}),t.jsxRuntimeExports.jsx(ir,{flex:1,children:t.jsxRuntimeExports.jsx($e.GraphLineIcon,{preserveAspectRatio:"none"})}),t.jsxRuntimeExports.jsxs(ar,{flex:0,children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:32,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:32,height:8})]})]}),c=r&&t.jsxRuntimeExports.jsxs(lr,{children:[t.jsxRuntimeExports.jsxs(Tt,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:8,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})]}),t.jsxRuntimeExports.jsxs(Tt,{children:[t.jsxRuntimeExports.jsx(s.Skeleton,{width:8,height:8}),t.jsxRuntimeExports.jsx(s.Skeleton,{width:48,height:8})]})]});return t.jsxRuntimeExports.jsx(rn,{fitHeight:!!e,header:i,controls:a,chart:x,legend:r&&c})},an=e=>e,_e=[];function ur({data:e=_e,categories:n=_e,stepSize:o,stepMultiplier:r=1,chartType:i=He.LINE,timeAxisSplitNumber:a,tooltip:l=!0,tooltipFormatter:x=Zt,formatter:c=an,height:d,fitHeight:m=!1,showControls:u=!0,animation:y=!0,filterable:g=!0,onTimelineUpdate:h,timeWindow:j,timelinePosition:f,onTimeWindowUpdate:v,selectedCategories:R,onSelectedCategoriesChange:w,isPlaying:b=!1,onPlay:E,isPaused:k=!1,onPause:M,onStop:D,isLoading:C=!1,palette:P=Object.values(je.commonPalette.qualitative.bold),showLegend:L=!0,yAxisType:$="dense"}){const z=p.useRef([]),G=J.useIntl(),{showSkeleton:S}=ue(!!C),N=p.useCallback(I=>{var O,H;if(I.length===2){((O=z.current)==null?void 0:O.length)===1&&(h==null||h(void 0));const F=I.sort((Y,q)=>Y<q?-1:1).map(Xt);v==null||v(F)}if(I.length===1){((H=z.current)==null?void 0:H.length)===2&&(v==null||v([]));const F=Fe(Number(I[0]),e);h==null||h(F)}z.current=I},[v,h,e]);return S?t.jsxRuntimeExports.jsx(cr,{fitHeight:m,height:d,showControls:u,showLegend:L}):t.jsxRuntimeExports.jsx(en,{isPlaying:b,onPlay:E,isPaused:k,onPause:M,onStop:D,timeWindow:j,onTimeWindowUpdate:N,intl:G,children:t.jsxRuntimeExports.jsx(pr,{data:e,categories:n,stepSize:o,stepMultiplier:r,chartType:i,timeAxisSplitNumber:a,tooltip:l,tooltipFormatter:x,formatter:c,height:d,fitHeight:m,showControls:u,animation:y,filterable:g,palette:P,showLegend:L,selectedCategories:R,timelinePosition:f,onSelectedCategoriesChange:w,yAxisType:$})})}function pr({data:e=_e,categories:n=_e,stepSize:o,stepMultiplier:r=1,chartType:i=He.LINE,timeAxisSplitNumber:a,tooltip:l=!0,tooltipFormatter:x=Zt,formatter:c=an,height:d,fitHeight:m=!1,showControls:u=!0,animation:y=!0,filterable:g=!0,palette:h=Object.values(je.commonPalette.qualitative.bold),selectedCategories:j=[],onSelectedCategoriesChange:f,showLegend:v=!0,timelinePosition:R,yAxisType:w="dense"}){const b=s.useTheme(),E=b.palette.secondary.main,{isPlaying:k,isPaused:M,timeWindow:D,stop:C,setTimeWindow:P,intl:L}=Ye();p.useEffect(()=>{if(R!==void 0){if(R<0||R>=e.length)return;const W=e[R].name;P([W])}},[R,e]),p.useEffect(()=>{if(!e.length)return;const W=e[0].name,V=e[e.length-1].name;(D[0]<W||D[1]>V||D[1]<W||D[1]>V)&&P([])},[e]);const $=p.useMemo(()=>{const W={},V=n?n.map(ee=>({name:ee,data:[],color:je.getColorByCategory(ee,{palette:h,fallbackColor:E,colorMapping:W})})):[{name:"",data:[],color:b.palette.secondary.main}];for(const{name:ee,value:pe,category:re,categoryIndex:_}of e){const K=_??(n&&re?n.indexOf(re):0);K===-1||n&&K>=n.length||!Number.isFinite(K)||V[K].data.push([ee,pe])}return V},[n,e,h,E,b.palette.secondary.main]),z=p.useMemo(()=>{if(!e.length)return"";if(D.length===2){const[W,V]=D.map(ee=>new Date(ee));return We({start:W,end:V,stepSize:o})}if(!k&&!M){const W=new Date(e[0].name),V=new Date(e[e.length-1].name);return We({start:W,end:V,stepSize:o})}if(D.length===1){const W=new Date(D[0]);return Jt({date:W,stepSize:o,stepMultiplier:r})}},[e,D,k,M,o,r]),G=p.useMemo(()=>k||M||D.length>0||(j==null?void 0:j.length)>0,[M,k,j==null?void 0:j.length,D.length]),S=()=>{C(),P([]),f==null||f([])},N=W=>{W.key==="Enter"&&S()},I=p.useCallback(W=>{if(f){const V=[...j],ee=V.indexOf(W);ee===-1?V.push(W):V.splice(ee,1),f(V)}},[f,j]),O=!!(v??$.length>1),H=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Box,{children:t.jsxRuntimeExports.jsx(B.Typography,{color:"textSecondary",variant:"caption",children:z??"-"})}),g&&G&&t.jsxRuntimeExports.jsx(s.Link,{variant:"caption",style:{cursor:"pointer"},onClick:S,onKeyDown:N,tabIndex:0,underline:"hover",children:L.formatMessage({id:"c4r.widgets.timeSeries.clear"})})]}),F=g&&u&&t.jsxRuntimeExports.jsx(zo,{data:e,stepSize:o}),Y=t.jsxRuntimeExports.jsx(Wo,{chartType:i,timeAxisSplitNumber:a,data:e,series:$,categories:n,tooltip:l,formatter:c,tooltipFormatter:W=>x(W,o,c,r,O),height:d,fitHeight:m,animation:y,filterable:g,selectedCategories:j,onCategoryClick:f&&I,yAxisType:w}),q=O&&t.jsxRuntimeExports.jsx(Kt,{series:$,selectedCategories:j,onCategoryClick:f&&I});return t.jsxRuntimeExports.jsx(rn,{fitHeight:m,header:H,controls:F,chart:Y,legend:q})}const xr=s.styled("div")(({theme:e})=>({padding:e.spacing(2,0),...e.typography.body2})),dr=s.styled(s.Box)(({theme:e})=>({overflow:"auto",maxHeight:e.spacing(40),paddingRight:e.spacing(1),margin:e.spacing(.5,0)})),mr=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"wrap",gap:e.spacing(1.5),padding:e.spacing(2,0)})),ln=s.styled(s.Box)(({theme:e,alignItems:n="center"})=>({display:"flex",alignItems:n,gap:e.spacing(.75)})),cn=s.styled("div",{shouldForwardProp:e=>e!=="color"})(({theme:e,color:n})=>({flexShrink:0,width:e.spacing(1),height:e.spacing(1),borderRadius:e.spacing(1),backgroundColor:n})),gr=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(2)})),fr=s.styled("div")(({theme:e})=>({height:e.spacing(.5),width:"100%",borderRadius:e.spacing(.5),backgroundColor:e.palette.action.disabledBackground,"& div":{width:0,height:"100%",borderRadius:e.spacing(.5),transition:`background-color ${e.transitions.easing.sharp} ${e.transitions.duration.shortest}ms,
|
|
19
|
+
width ${e.transitions.easing.sharp} ${e.transitions.duration.complex}ms`}})),Ct=s.styled(s.Box,{shouldForwardProp:e=>e!=="center"})(({theme:e,center:n=!1})=>({marginBottom:e.spacing(2),paddingRight:e.spacing(1),...n&&{display:"flex",justifyContent:"space-between",alignItems:"center"},"& .MuiTypography-caption":{color:e.palette.text.secondary},"& .MuiButton-label":{...e.typography.caption},"& a":{cursor:"pointer"}})),hr=s.styled(s.Tooltip)(({theme:e})=>({".MuiTooltip-tooltip":{color:e.palette.common.white,maxWidth:260,marginBottom:0,overflow:"hidden"}})),jr=s.styled(s.TextField)(({theme:e})=>({marginTop:e.spacing(-.5)}));s.styled(s.Box)(()=>({display:"flex",flexWrap:"nowrap",justifyContent:"space-between"}));const yr=s.styled("div",{shouldForwardProp:e=>e!=="filterable"})(({filterable:e})=>({"& .progressbar div":{backgroundColor:"var(--color)"},...e&&{cursor:"pointer","& .MuiBox-root:hover .progressbar div":{backgroundColor:"var(--hover-color)"}}})),Er=s.styled(s.Box)(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"nowrap",overflow:"hidden",gap:e.spacing(1)})),Rr=s.styled(s.Box)(({theme:e})=>({padding:e.spacing(.5,0),flexGrow:"1",maxWidth:"100%",minWidth:0})),vr=s.styled(s.Box,{shouldForwardProp:e=>e!=="backgroundColor"})(({theme:e,backgroundColor:n})=>({marginLeft:e.spacing(1),padding:e.spacing(0,1),backgroundColor:n,color:"white",borderRadius:e.spacing(2)}));function wr(e,n,o,r,i){const l=(e[0]??[]).map((x,c)=>{const d=String(x.name),m=r.length>0&&!r.includes(d),u=o[c]??d,y=e.map((g,h)=>{var j;return{color:m?je.lighten(n[h],.8):n[h],value:((j=g[c])==null?void 0:j.value)??0}});return{label:u,key:d,data:y}});return i===de.RANKING&&l.sort((x,c)=>{const d=Math.max(...x.data.map(u=>u.value));return Math.max(...c.data.map(u=>u.value))-d}),l}const br=500;function Sr(e,n={}){const{disabled:o,duration:r,animateOnMount:i,initialValue:a=0}=n,l=p.useRef(null),[x,c]=p.useState(()=>i?a:e);return p.useEffect(()=>(o?c(e):Xe({start:x,end:e,duration:r??br,drawFrame:d=>c(d),requestRef:l}),()=>{l.current&&cancelAnimationFrame(l.current)}),[e,o,r]),x}const Ir={};function un({enabled:e=!0,value:n=0,options:o=Ir,formatter:r}){const a=Sr(n||0,{...{animateOnMount:!0,disabled:e===!1||n===null||n===void 0},...o});return t.jsxRuntimeExports.jsx("span",{children:r?r(a):a})}const et=e=>e,kr=()=>{},Mr=[];function Tr({item:e,index:n=0,names:o=Mr,formatter:r=et}){const i=s.useTheme(),a=e.data[0],l=e.data[n],x=o[n],c=(l.value-a.value)/(a.value||1)*100,d=Math.sign(c)===-1?"-":"+",m=Math.sign(c)===-1?i.palette.error.main:i.palette.success.main,u=e.key===ye?i.palette.text.disabled:m;return t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx(s.Typography,{color:"inherit",variant:"caption",noWrap:!0,children:e.label}),t.jsxRuntimeExports.jsx(s.Box,{pt:1,pb:.5,children:t.jsxRuntimeExports.jsxs(ln,{alignItems:"baseline",children:[t.jsxRuntimeExports.jsx(cn,{color:e.key===ye?i.palette.background.default:l.color}),t.jsxRuntimeExports.jsx(s.Typography,{color:"inherit",variant:"caption",children:x}),t.jsxRuntimeExports.jsx(s.Box,{style:{flexGrow:1}}),t.jsxRuntimeExports.jsx(vr,{backgroundColor:u,children:t.jsxRuntimeExports.jsxs(s.Typography,{color:"inherit",variant:"caption",children:[d,r(Math.abs(c))]})})]})})]})}function Cr({item:e,animation:n=!0,animationOptions:o,maxValue:r,showCheckbox:i,checkboxChecked:a,formatter:l=et,tooltipFormatter:x=et,onClick:c=kr,names:d,tooltip:m}){function u(g){return`${Math.min(100,(g||0)/r*100)}%`}const y=g=>t.jsxRuntimeExports.jsx(Tr,{item:e,names:d,formatter:x,index:g});return t.jsxRuntimeExports.jsxs(Er,{onClick:()=>c(e.key),children:[i?t.jsxRuntimeExports.jsx(s.Checkbox,{checked:a}):null,t.jsxRuntimeExports.jsxs(Rr,{children:[t.jsxRuntimeExports.jsx(s.Typography,{variant:"body2",noWrap:!0,children:e.label}),e.data.map((g,h)=>t.jsxRuntimeExports.jsx(hr,{title:y(h),placement:"top-start",arrow:!1,disableHoverListener:!m,children:t.jsxRuntimeExports.jsxs(gr,{children:[t.jsxRuntimeExports.jsx(fr,{className:"progressbar",children:t.jsxRuntimeExports.jsx("div",{style:{"--hover-color":s.darken(g.color,.2),"--color":g.color,width:u(g.value)}})}),t.jsxRuntimeExports.jsx(s.Typography,{variant:h===0?"body2":"caption",color:h===0?"textPrimary":"textSecondary",children:t.jsxRuntimeExports.jsx(un,{value:g.value,enabled:n,options:o,formatter:l})})]})},`${e.key}_${h}`))]})]})}const At=e=>e,Ar=()=>{},Ie=[];function Bt(){return t.jsxRuntimeExports.jsx(s.SvgIcon,{children:t.jsxRuntimeExports.jsx("path",{d:"M11,4 C14.8659932,4 18,7.13400675 18,11 C18,12.7003211 17.3937669,14.2590489 16.3856562,15.4718279 L19.4748737,18.5606602 L18.0606602,19.9748737 L14.8998887,16.8138615 C13.7854137,17.5629194 12.4437497,18 11,18 C7.13400675,18 4,14.8659932 4,11 C4,7.13400675 7.13400675,4 11,4 Z M11,6 C8.23857625,6 6,8.23857625 6,11 C6,13.7614237 8.23857625,16 11,16 C13.7614237,16 16,13.7614237 16,11 C16,8.23857625 13.7614237,6 11,6 Z",id:"Color",fill:"inherit"})})}function Br({names:e=Ie,data:n=Ie,labels:o=Ie,colors:r=Ie,maxItems:i=5,order:a=de.FIXED,animation:l=!0,animationOptions:x,searchable:c=!0,filterable:d=!0,selectedCategories:m=Ie,onSelectedCategoriesChange:u=Ar,formatter:y=At,tooltipFormatter:g=At,tooltip:h=!0,isLoading:j=!1}){const f=s.useTheme(),[v,R]=p.useState(!1),[w,b]=p.useState(!1),[E,k]=p.useState(m),[M,D]=p.useState(""),C=J.useIntl(),P=B.useImperativeIntl(C),L=p.useMemo(()=>{const _=r.length?r:[f.palette.secondary.main,f.palette.primary.main,f.palette.info.main];return wr(n,_,o,m,a)},[n,r,o,f,m,a]),$=p.useMemo(()=>Math.max(...n.map(_=>_.map(K=>K.value??0)).flat()),[n]),z=p.useMemo(()=>{if(i>=L.length)return L;const _=L.slice(0,i),K=L.slice(i),X=[];for(const ie of K)ie.data.forEach((Me,Re)=>{X[Re]=X[Re]??0,X[Re]+=Me.value});const Q={key:ye,label:c?"Others":`Others (${L.length-i})`,data:X.map(ie=>({value:ie,color:f.palette.divider}))};return[..._,Q]},[L,c,i,f.palette.divider]),G=p.useMemo(()=>L.filter(_=>m.includes(_.key)),[L,m]),S=p.useMemo(()=>M?L.filter(_=>{const K=(_.key||"").toLowerCase(),X=(_.label||"").toLowerCase(),Q=K==null?void 0:K.includes(M.toLowerCase()),ie=X==null?void 0:X.includes(M.toLowerCase());return Q||ie}):L,[L,M]),N=L.length-z.length+1,I=c&&!v&&i<L.length;if(L.length===0||j)return t.jsxRuntimeExports.jsx(Yt,{});const O=v?S:w?G:z;function H(){b(!0),u([...E]),V()}function F(){b(!1)}function Y(){u([])}function q(){b(!0)}function W(){R(!0),k([...m])}function V(){R(!1),k([])}function ee(_){const K=m.includes(_),X=new Set(m);K?X.delete(_):X.add(_);let Q=Array.from(X);Q.length===L.length&&(Q=[]),u(Q)}function pe(_){const K=E.includes(_),X=new Set(E);K?X.delete(_):X.add(_);let Q=Array.from(X);Q.length===L.length&&(Q=[]),k(Q)}const re=d?v?pe:ee:void 0;return t.jsxRuntimeExports.jsxs(xr,{children:[d?t.jsxRuntimeExports.jsxs(Ct,{center:!0,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",children:m.length>0?P.formatMessage({id:"c4r.widgets.category.selectedItems"},{items:m.length}):P.formatMessage({id:"c4r.widgets.category.all"})}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",children:v?t.jsxRuntimeExports.jsx(s.Link,{onClick:H,children:P.formatMessage({id:"c4r.widgets.category.apply"})}):w?t.jsxRuntimeExports.jsx(s.Link,{onClick:F,children:P.formatMessage({id:"c4r.widgets.category.unlock"})}):m.length?t.jsxRuntimeExports.jsxs(s.Box,{style:{display:"flex",justifyContent:"flex-end",gap:f.spacing(1)},children:[t.jsxRuntimeExports.jsx(s.Link,{onClick:q,children:P.formatMessage({id:"c4r.widgets.category.lock"})}),t.jsxRuntimeExports.jsx(s.Divider,{orientation:"vertical",flexItem:!0}),t.jsxRuntimeExports.jsx(s.Link,{onClick:Y,children:P.formatMessage({id:"c4r.widgets.category.clear"})})]}):null})]}):null,v?t.jsxRuntimeExports.jsx(Ct,{children:t.jsxRuntimeExports.jsx(jr,{size:"small",placeholder:P.formatMessage({id:"c4r.widgets.category.search"}),onChange:_=>D(_.currentTarget.value),onFocus:_=>_.currentTarget.scrollIntoView(),InputProps:{startAdornment:t.jsxRuntimeExports.jsx(s.InputAdornment,{position:"start",children:t.jsxRuntimeExports.jsx(Bt,{})})}})}):null,t.jsxRuntimeExports.jsxs(dr,{children:[O.length===0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"body2",children:P.formatMessage({id:"c4r.widgets.category.noResults"})}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",children:P.formatMessage({id:"c4r.widgets.category.noResultsMessage"},{searchValue:M})})]}):null,O.map(_=>t.jsxRuntimeExports.jsx(yr,{children:t.jsxRuntimeExports.jsx(Cr,{item:_,animation:l,animationOptions:x,maxValue:$,showCheckbox:d&&v,checkboxChecked:E.includes(_.key),formatter:y,tooltipFormatter:g,tooltip:h,onClick:re,names:e})},_.key))]}),I?t.jsxRuntimeExports.jsx(s.Button,{size:"small",color:"primary",startIcon:t.jsxRuntimeExports.jsx(Bt,{}),onClick:W,children:P.formatMessage({id:"c4r.widgets.category.searchInfo"},{elements:N})}):null,v?t.jsxRuntimeExports.jsx(s.Button,{size:"small",color:"primary",onClick:V,children:P.formatMessage({id:"c4r.widgets.category.cancel"})}):null,t.jsxRuntimeExports.jsx(mr,{children:e.map((_,K)=>t.jsxRuntimeExports.jsxs(ln,{children:[t.jsxRuntimeExports.jsx(cn,{color:(r==null?void 0:r[K])??f.palette.background.default}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",children:_})]},e[K]))})]})}const Pr=A.styled(B.Typography)(({theme:e})=>({display:"inline-block",marginTop:e.spacing(.5)}));function Lr({row:e}){const n=s.useTheme();return e.label?t.jsxRuntimeExports.jsx(s.Box,{color:e.color??n.palette.text.secondary,children:t.jsxRuntimeExports.jsx(Pr,{color:"inherit",variant:"caption",children:e.label})}):null}const Dr=s.styled("div")(({theme:e})=>({margin:0,...e.typography.h5,fontWeight:Number(e.typography.fontWeightMedium),color:e.palette.text.primary,display:"flex"})),$r=s.styled(B.Typography)(({theme:e})=>({marginRight:e.spacing(.5)})),Or=s.styled(B.Typography)(({theme:e})=>({marginLeft:e.spacing(.5)}));function Nr({row:e,animated:n,animationOptions:o,formatter:r}){const i=s.useTheme(),{prefix:a,value:l,suffix:x,shouldBeHighlighted:c}=e;return t.jsxRuntimeExports.jsxs(Dr,{children:[a?t.jsxRuntimeExports.jsx(s.Box,{color:i.palette.text.secondary,children:t.jsxRuntimeExports.jsx($r,{color:"inherit",component:"span",variant:"subtitle2",children:a})}):null,t.jsxRuntimeExports.jsx(s.Box,{fontWeight:c?"bold":"",children:t.jsxRuntimeExports.jsx(un,{value:l,enabled:n,options:o,formatter:r})}),x?t.jsxRuntimeExports.jsx(s.Box,{color:i.palette.text.secondary,children:t.jsxRuntimeExports.jsx(Or,{color:"inherit",component:"span",variant:"subtitle2",children:x})}):null]})}const Fr=e=>e,Pt=[],Wr=s.styled("div")(({theme:e})=>({"&:nth-of-type(n+2)":{marginTop:e.spacing(2)}}));function _r({data:e=Pt,colors:n=Pt,animated:o=!0,animationOptions:r,formatter:i=Fr,isLoading:a=!1}){const l=Gr(e,n);return a?t.jsxRuntimeExports.jsx(Ut,{}):t.jsxRuntimeExports.jsx("div",{children:l.map((x,c)=>t.jsxRuntimeExports.jsxs(Wr,{children:[t.jsxRuntimeExports.jsx(Nr,{row:x,animated:o,animationOptions:r,formatter:i}),t.jsxRuntimeExports.jsx(Lr,{row:x})]},c))})}function Gr(e,n){const o=e.map((i,a)=>({...i,color:n[a],shouldBeHighlighted:!1})).filter(i=>i.value!==void 0);return o&&o.length>1&&(o[0].shouldBeHighlighted=!0),o}function zr(e,n=[],o=[],r,i=[]){return e.map((a,l)=>{const x=i.length>0&&!i.includes(a.name),d=(n!=null&&n.length?n:r.palette.qualitative.bold)[l];return{...a,key:a.name,color:x?s.lighten(d,.8):d,name:o[l]??a.name}})}function Hr(e,n,o){const r=`
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
line-height: 1.33;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
margin: 4px 0 4px 0;
|
|
24
|
+
`,i=`
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 1.33;
|
|
27
|
+
font-weight: normal;
|
|
28
|
+
margin: 0 0 4px 0;
|
|
29
|
+
`,a=Array.isArray(e)?e[0]:e;if(!a)return null;const l=a.data,x=n(l.value),c=o?a.seriesName:x,d=n(a.percent);return`
|
|
30
|
+
<p style="${r}">${l.name}</p>
|
|
31
|
+
<p style="${i}">${String(a.marker)} ${c} (${d} %)</p>
|
|
32
|
+
`.trim()}const Yr=e=>e,Vr=()=>{},Le=[],Ur="260px";function qr({names:e=Le,data:n=Le,labels:o=Le,colors:r=Le,height:i=Ur,animation:a=!0,formatter:l=Yr,tooltipFormatter:x=Hr,selectedCategories:c=[],onCategorySelected:d=Vr,isLoading:m=!1}){const u=s.useTheme(),y=p.useRef(),g=p.useMemo(()=>n.map((v,R)=>zr(v,r[R],o[R],u,c)),[n,r,o,u,c]),h=p.useMemo(()=>{const v=g.length>1;let R;x&&(R=C=>x(C,l,v));const w={trigger:"item",show:!0,backgroundColor:u.palette.black[90],textStyle:{color:u.palette.common.white},confine:!0,borderWidth:0,formatter:R},E={data:v?g.map((C,P)=>e[P]):(g[0]??[]).map(C=>C.name),selectedMode:!1,type:"scroll",left:A.SPACING,bottom:A.SPACING*-.5,itemGap:A.SPACING*3,icon:"circle",itemWidth:A.SPACING,itemHeight:A.SPACING,textStyle:{...u.typography.overline,color:u.palette.text.primary,fontWeight:400,lineHeight:1,verticalAlign:"bottom",padding:[0,0,0,A.SPACING*.5]},inactiveColor:u.palette.text.disabled,pageIcons:{horizontal:["path://M15.41 7.41 14 6 8 12 14 18 15.41 16.59 10.83 12z","path://M9 16.59 13.3265857 12 9 7.41 10.3319838 6 16 12 10.3319838 18z"]},pageIconSize:A.SPACING*1.5,pageIconColor:u.palette.text.secondary,pageIconInactiveColor:u.palette.text.disabled,pageTextStyle:{fontFamily:u.typography.overline.fontFamily,fontSize:A.SPACING*1.5,lineHeight:A.SPACING*1.75,fontWeight:400,color:u.palette.text.primary}},k={formatter:({name:C,percent:P})=>`{per|${l(P)}%}
|
|
33
|
+
{b|${C}}`,position:"center",rich:{b:{fontFamily:u.typography.overline.fontFamily,fontSize:A.SPACING*1.75,lineHeight:A.SPACING*1.75,fontWeight:400,color:u.palette.text.primary},per:{...u.typography.overline,fontSize:A.SPACING*3,lineHeight:A.SPACING*4.5,fontWeight:600,color:u.palette.text.primary}}},M=g.map((C,P)=>{var L;return{type:"pie",name:e[P],itemStyle:{color:(L=C[0])==null?void 0:L.color},animation:a,data:C.map($=>({...$,itemStyle:{color:$.color}})),radius:P===0?["75%","90%"]:["56%","72%"],selectedOffset:0,hoverOffset:5,bottom:A.SPACING*2.5,avoidLabelOverlap:!0,label:{show:!1,...k},emphasis:{label:{show:!0,formatter:k.formatter,rich:k.rich}}}});return{grid:{left:0,top:0,right:0,bottom:0},tooltip:w,legend:E,series:M}},[u,e,a,g,l,x]),j={mouseover:(v,R)=>{g.length===1&&(v.seriesIndex!==0||v.dataIndex!==0)&&R.dispatchAction({type:"downplay",seriesIndex:0,dataIndex:0})},mouseout:(v,R)=>{g.length===1&&R.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:0})},click:v=>{const w=g[v.seriesIndex][v.dataIndex].key,b=c.includes(w),E=new Set(c);b?E.delete(w):E.add(w);const k=g[0].length;let M=Array.from(E);M.length===k&&(M=[]),d(M)}};p.useEffect(()=>{y.current&&y.current.dispatchAction({type:g.length===1?"highlight":"downplay",seriesIndex:0,dataIndex:0})},[g]);function f(v){y.current=v}return g.length?m?t.jsxRuntimeExports.jsx(qt,{height:i}):t.jsxRuntimeExports.jsx(Ee,{onChartReady:f,notMerge:!0,option:h,onEvents:j,style:{maxHeight:i,width:"100%"}}):null}const Kr=()=>{};function pn({icon:e,hoverTooltip:n,clickTooltip:o,enabled:r,onEnabledChange:i=Kr,tooltipPlacement:a="bottom"}){const[l,x]=p.useState(!1),[c,d]=p.useState(r);p.useEffect(()=>{d(r)},[r]),p.useEffect(()=>{if(r){const u=y=>{y.key==="Escape"&&i&&i(!1)};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}}},[r,i]);const m=c?o:n;return t.jsxRuntimeExports.jsx(s.ClickAwayListener,{onClickAway:()=>d(!1),children:t.jsxRuntimeExports.jsx(s.Tooltip,{title:m,placement:a,open:l,onOpen:()=>x(!0),onClose:()=>{c||x(!1)},children:t.jsxRuntimeExports.jsx(s.ToggleButton,{value:"selectedMode",selected:r,onClick:()=>i&&i(!r),children:e})})})}var rt={},Zr=A.interopRequireDefaultExports;Object.defineProperty(rt,"__esModule",{value:!0});var xn=rt.default=void 0,Xr=Zr(A.requireCreateSvgIcon()),Jr=t.jsxRuntimeExports;xn=rt.default=(0,Xr.default)((0,Jr.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const Qr=s.styled(s.IconButton,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:n})=>({color:n.palette.text.secondary,width:n.spacing(3),transform:`rotate(${e?"180":"0"}deg)`,backgroundColor:e?n.palette.action.hover:void 0})),ei=s.styled(s.MenuItem,{shouldForwardProp:e=>e!=="disabled"})(({disabled:e,theme:n})=>({...e&&{pointerEvents:"none",color:n.palette.text.disabled}})),ti=s.styled(s.MenuItem)(()=>({"&.Mui-disabled":{opacity:1}})),ni=()=>{};function dn({selectionModes:e,editModes:n,selectedMode:o,onSelectMode:r=ni,enabled:i,tooltipPlacement:a="bottom",tooltipText:l="",menuHeaderText:x="",editDisabled:c}){const d=s.useTheme(),[m,u]=p.useState(null),y=!!m,g=w=>u(w.currentTarget),h=()=>u(null),j=w=>{r&&r(w),h()},f=!!e.length&&!!n.length,v=w=>n.some(b=>b.id===w.id);function R(w){return t.jsxRuntimeExports.jsx(ei,{selected:i&&o===w.id,onClick:()=>j(w.id),disabled:c&&v(w),children:t.jsxRuntimeExports.jsxs(s.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[w.icon,t.jsxRuntimeExports.jsx(s.Box,{ml:2,children:t.jsxRuntimeExports.jsx(B.Typography,{variant:"body2",color:"inherit",children:s.capitalize(w.label)})})]})},w.id)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Tooltip,{title:l,placement:a,children:t.jsxRuntimeExports.jsx(Qr,{id:"feature-selection-menu-button","aria-controls":"feature-selection-menu","aria-haspopup":"true","aria-expanded":y?"true":void 0,onClick:g,isOpen:y,children:t.jsxRuntimeExports.jsx(xn,{})})}),t.jsxRuntimeExports.jsxs(s.Menu,{id:"feature-selection-menu",style:{zIndex:d.zIndex.tooltip+1},anchorEl:m,open:y,onClose:h,MenuListProps:{"aria-labelledby":"feature-selection-menu-button"},children:[x&&t.jsxRuntimeExports.jsx(ti,{disabled:!0,children:t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"textSecondary",children:x})}),!!e.length&&e.map(R),f&&t.jsxRuntimeExports.jsx(s.Divider,{sx:{margin:({spacing:w})=>w(1,0)}}),!!n.length&&n.map(R)]})]})}const si=s.styled(s.List)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(1.5),padding:e.spacing(.5),overflowX:"auto",maxWidth:"100%",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}})),oi=()=>{};function mn({features:e,onSelectGeometry:n=oi,onDeleteGeometry:o,chipTooltip:r,disabledChipTooltip:i,size:a="medium",tooltipPlacement:l="bottom",chipLabel:x}){const c=J.useIntl(),d=B.useImperativeIntl(c);function m(h){return h==="MultiPoint"?d.formatMessage({id:"c4r.widgets.featureSelection.point"}):h==="MultiLineString"?d.formatMessage({id:"c4r.widgets.featureSelection.lineString"}):h==="MultiPolygon"||h==="Polygon"||h==="GeometryCollection"?d.formatMessage({id:"c4r.widgets.featureSelection.polygon"}):h}function u(h,j){var v;const f=m(h.geometry.type);return x||((v=h.properties)==null?void 0:v.name)||`${f} ${j+1}`}const[y,g]=p.useState(!1);return t.jsxRuntimeExports.jsx(s.Box,{sx:{overflowX:"auto"},children:t.jsxRuntimeExports.jsx(si,{sx:{gap:a==="small"?.5:1},children:e.map((h,j)=>{var b,E;const f=(b=h.properties)==null?void 0:b.disabled,v=(E=h.properties)==null?void 0:E.invalid;let R=r;f&&(R=i||r),v&&(R=d.formatMessage({id:"c4r.widgets.featureSelection.invalid"})),y&&(R=d.formatMessage({id:"c4r.widgets.featureSelection.remove"}));let w="secondary";return f&&(w="default"),v&&(w="error"),t.jsxRuntimeExports.jsx(s.ListItem,{disablePadding:!0,children:t.jsxRuntimeExports.jsx(s.Tooltip,{disableHoverListener:f?!i:!r,title:R,placement:l,children:t.jsxRuntimeExports.jsx(s.Chip,{size:a,label:u(h,j),color:w,onClick:()=>n(h),onDelete:o?()=>o(h):void 0,icon:v?t.jsxRuntimeExports.jsx(fe.ErrorOutline,{color:"error"}):void 0,deleteIcon:t.jsxRuntimeExports.jsx(fe.Cancel,{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1)})})})},j)})})})}const ri=s.styled(s.Paper)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",maxHeight:e.spacing(5),padding:e.spacing(.5)})),ii=[];function ai({selectionModes:e,editModes:n=ii,selectedMode:o,onSelectMode:r,enabled:i=!1,onEnabledChange:a,geometry:l,onSelectGeometry:x,onDeleteGeometry:c,tooltipPlacement:d="bottom",size:m="medium",chipLabel:u}){const y=J.useIntl(),g=B.useImperativeIntl(y),h=p.useMemo(()=>e.map(b=>({...b,label:g.formatMessage({id:`c4r.widgets.featureSelection.${Lt(b.id)}`})})),[e,g]),j=p.useMemo(()=>n.map(b=>({...b,label:g.formatMessage({id:`c4r.widgets.featureSelection.${Lt(b.id)}`})})),[n,g]),f=p.useMemo(()=>{const E=[...h.map(k=>({...k,isEdit:!1})),...j.map(k=>({...k,isEdit:!0}))].find(k=>k.id===o);if(!E)throw new Error(`Selected mode "${o}" not supported`);return E},[j,h,o]),v=s.capitalize((f==null?void 0:f.label)||""),R=f!=null&&f.isEdit?v:g.formatMessage({id:"c4r.widgets.featureSelection.selectTool"},{label:v}),w=f!=null&&f.isEdit?g.formatMessage({id:"c4r.widgets.featureSelection.clickToEdit"}):g.formatMessage({id:"c4r.widgets.featureSelection.clickToCreate"});return t.jsxRuntimeExports.jsxs(ri,{children:[t.jsxRuntimeExports.jsx(pn,{icon:f==null?void 0:f.icon,hoverTooltip:R,clickTooltip:w,enabled:i,onEnabledChange:a,tooltipPlacement:d}),t.jsxRuntimeExports.jsx(dn,{selectionModes:h,editModes:j,selectedMode:o,onSelectMode:r,enabled:i,tooltipPlacement:d,tooltipText:g.formatMessage({id:"c4r.widgets.featureSelection.selectMode"}),menuHeaderText:g.formatMessage({id:"c4r.widgets.featureSelection.chooseSelectionMode"}),editDisabled:!l}),!!l&&t.jsxRuntimeExports.jsx(mn,{features:[l],onSelectGeometry:x,onDeleteGeometry:c,disabledChipTooltip:g.formatMessage({id:"c4r.widgets.featureSelection.applyMask"}),chipTooltip:g.formatMessage({id:"c4r.widgets.featureSelection.clearMask"}),tooltipPlacement:d,size:m,chipLabel:u})]})}function Lt(e){return e.charAt(0).toLowerCase()+e.slice(1)}var it={},li=A.interopRequireDefaultExports;Object.defineProperty(it,"__esModule",{value:!0});var gn=it.default=void 0,ci=li(A.requireCreateSvgIcon()),ui=t.jsxRuntimeExports;gn=it.default=(0,ci.default)((0,ui.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var at={},pi=A.interopRequireDefaultExports;Object.defineProperty(at,"__esModule",{value:!0});var fn=at.default=void 0,xi=pi(A.requireCreateSvgIcon()),di=t.jsxRuntimeExports;fn=at.default=(0,xi.default)((0,di.jsx)("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27zm0-11.47L17.74 9 12 13.47 6.26 9z"}),"LayersOutlined");var lt={},mi=A.interopRequireDefaultExports;Object.defineProperty(lt,"__esModule",{value:!0});var hn=lt.default=void 0,gi=mi(A.requireCreateSvgIcon()),fi=t.jsxRuntimeExports;hn=lt.default=(0,gi.default)((0,fi.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}),"VisibilityOutlined");var ct={},hi=A.interopRequireDefaultExports;Object.defineProperty(ct,"__esModule",{value:!0});var jn=ct.default=void 0,ji=hi(A.requireCreateSvgIcon()),yi=t.jsxRuntimeExports;jn=ct.default=(0,ji.default)((0,yi.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6m-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14M2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13m-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53"}),"VisibilityOffOutlined");var ut={},Ei=A.interopRequireDefaultExports;Object.defineProperty(ut,"__esModule",{value:!0});var yn=ut.default=void 0,Ri=Ei(A.requireCreateSvgIcon()),vi=t.jsxRuntimeExports;yn=ut.default=(0,Ri.default)((0,vi.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var pt={},wi=A.interopRequireDefaultExports;Object.defineProperty(pt,"__esModule",{value:!0});var En=pt.default=void 0,bi=wi(A.requireCreateSvgIcon()),Si=t.jsxRuntimeExports;En=pt.default=(0,bi.default)((0,Si.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const Rn=240,Ii=s.styled(s.Paper,{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({width:n?"min-content":Rn,background:e.palette.background.paper,maxHeight:"calc(100% - 120px)",display:"flex",flexDirection:"column"})),ki=s.styled("header",{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(1),paddingLeft:e.spacing(2),borderBottom:n?void 0:`1px solid ${e.palette.divider}`})),Mi=s.styled("header")(({theme:e})=>({padding:e.spacing(1.5),paddingRight:e.spacing(2),gap:e.spacing(.5),display:"flex",justifyContent:"space-between",position:"sticky",zIndex:2,top:0,background:e.palette.background.paper})),Ti=s.styled("div")(({theme:e})=>({display:"flex",gap:e.spacing(2),alignItems:"center",padding:e.spacing(1),minWidth:`calc(${Rn}px - ${e.spacing(4)})`})),Ci=s.styled(s.TextField)(({theme:e})=>({display:"flex",width:e.spacing(7.5),flexShrink:0,"input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0}})),Ai=s.styled("ul",{shouldForwardProp:e=>e!=="opacity"})(({theme:e,opacity:n})=>({opacity:n,margin:0,padding:0,display:"flex",flexDirection:"column",gap:e.spacing(1)})),vn=s.styled("ul")(({theme:e})=>({margin:0,padding:0,paddingBottom:e.spacing(1),display:"flex",flexDirection:"column"})),Bi=s.styled("li")(()=>({display:"flex",alignItems:"center"})),Pi=s.styled("div")(({theme:e})=>({marginRight:e.spacing(1.5),width:A.ICON_SIZE_MEDIUM,height:A.ICON_SIZE_MEDIUM,"& img":{margin:"auto",display:"block"}})),Dt=s.styled(s.Box,{shouldForwardProp:e=>e!=="width"})(({width:e,theme:n})=>({width:e,overflow:"auto",maxHeight:`calc(100% - ${n.spacing(1.5)})`})),Li=s.styled("section")(({theme:e})=>({"&:not(:first-of-type)":{borderTop:`1px solid ${e.palette.divider}`}})),Di=s.styled("div")(()=>({flexGrow:1,flexShrink:1,minWidth:0}));function $i({menuRef:e,open:n,toggleOpen:o,opacity:r,onChange:i}){const a=J.useIntl(),l=B.useImperativeIntl(a);function x(c){const d=parseInt(c.target.value||"0"),m=Math.min(Math.max(d,0),100);i(m/100)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Tooltip,{title:l.formatMessage({id:"c4r.widgets.legend.opacity"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",color:n?"primary":"default",onClick:()=>o(!n),children:t.jsxRuntimeExports.jsx($e.OpacityIcon,{})})}),t.jsxRuntimeExports.jsx(s.Popover,{open:n,onClose:()=>o(!1),anchorEl:e.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{root:{sx:{transform:"translate(-12px, 36px)"}}},children:t.jsxRuntimeExports.jsxs(Ti,{children:[t.jsxRuntimeExports.jsx(s.Slider,{value:r*100,onChange:(c,d)=>i(d/100),min:0,max:100,step:1}),t.jsxRuntimeExports.jsx(Ci,{size:"small",type:"number",value:Math.round(r*100),onChange:x,inputProps:{step:1,min:0,max:100,style:{appearance:"textfield"},"data-testid":"opacity-slider"},InputProps:{endAdornment:t.jsxRuntimeExports.jsxs(s.InputAdornment,{position:"end",sx:{margin:0},children:[" ","%"]})}})]})})]})}function xt({title:e,visible:n,typographyProps:o}){const r=p.useRef(null),[i,a]=p.useState(!1);p.useLayoutEffect(()=>{if(n&&r.current){const{offsetWidth:x,scrollWidth:c}=r.current;a(x<c)}},[e,n]);const l=t.jsxRuntimeExports.jsx(B.Typography,{ref:r,color:n?"textPrimary":"textSecondary",variant:"button",weight:"medium",component:"p",noWrap:!0,my:.25,...o,children:e});return i?t.jsxRuntimeExports.jsx(s.Tooltip,{title:e,children:l}):l}var ce=(e=>(e.CATEGORY="category",e.ICON="icon",e.CONTINUOUS_RAMP="continuous_ramp",e.BINS="bins",e.PROPORTION="proportion",e))(ce||{});const Ze=20;function wn({legend:e}){const{labels:n=[],colors:o=[],isStrokeColor:r=!1,customMarkers:i,maskedMarkers:a=!0}=e,l=je.getPalette(o,n.length),x=n.length>Ze,c=J.useIntl(),d=B.useImperativeIntl(c);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(vn,{"data-testid":"categories-legend",children:n.slice(0,Ze).map((m,u)=>t.jsxRuntimeExports.jsx(Wi,{label:String(m),color:l[u%l.length],icon:i&&Array.isArray(i)?i[u]:i,maskedIcon:a,isStrokeColor:r},`${m}${u}`))}),x&&t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"textSecondary",component:"div",py:2,children:d.formatMessage({id:"c4r.widgets.legend.maxCategories"},{n:Ze})})]})}const Oi=({isMax:e,color:n,isStrokeColor:o,theme:r})=>({border:"2px solid transparent","&::after":{position:"absolute",display:e?"block":"none",content:'""',width:r.spacing(2),height:r.spacing(2),border:`2px solid ${r.palette.grey[900]}`,transform:"translate(-30%, -30%)",borderRadius:"50%",boxSizing:"content-box"},...o?{borderColor:n}:{backgroundColor:n}}),Ni=({icon:e,color:n,maskedIcon:o})=>({maskRepeat:"no-repeat",maskSize:"cover",backgroundRepeat:"no-repeat",backgroundSize:"cover",...o?{backgroundColor:n,maskImage:`url(${e})`,WebkitMaskImage:`url(${e})`}:{backgroundColor:"rgba(0,0,0,0)",backgroundImage:`url(${e})`}}),Fi=s.styled(s.Box,{shouldForwardProp:e=>e!=="icon"&&e!=="maskedIcon"&&e!=="color"&&e!=="isStrokeColor"})(({icon:e,maskedIcon:n,color:o,isStrokeColor:r,theme:i})=>({whiteSpace:"nowrap",display:"block",width:i.spacing(1.5),height:i.spacing(1.5),flexShrink:"0",borderRadius:"50%",position:"relative",border:"2px solid transparent",...e?Ni({icon:e,color:o,maskedIcon:n}):Oi({color:o,isStrokeColor:r,theme:i})}));function Wi({label:e,isStrokeColor:n,color:o="#000",icon:r,maskedIcon:i}){return t.jsxRuntimeExports.jsxs(s.Box,{component:"li",sx:{display:"flex",alignItems:"center"},children:[t.jsxRuntimeExports.jsx(Fi,{className:"marker",mr:1.5,component:"span",icon:r,maskedIcon:i,isStrokeColor:n,color:o}),t.jsxRuntimeExports.jsx(xt,{title:e,visible:!0,typographyProps:{variant:"overline",my:.75}})]})}const De=6,Ge={0:12,1:9,2:6,3:3},_i=s.styled(s.Box,{shouldForwardProp:e=>e!=="index"})(({index:e=0,theme:n})=>{const o=n.spacing(Ge[e]),r=n.spacing(Ge[e]);return{border:`solid 1px ${n.palette.divider}`,backgroundColor:n.palette.background.default,borderRadius:"50%",position:"absolute",right:0,bottom:0,width:o,height:r}}),Gi=s.styled(s.Box)(({theme:{spacing:e}})=>({display:"flex",justifyContent:"flex-end",flexShrink:0,position:"relative",width:e(Ge[0]),height:e(Ge[0])})),zi=s.styled(s.Box)(({theme:{spacing:e}})=>({display:"flex",gap:e(1),alignItems:"stretch",justifyContent:"stretch",padding:e(2,0)})),Hi=s.styled(s.Box)(()=>({display:"flex",flexDirection:"column",justifyContent:"space-around",gap:1,flexGrow:1,flexShrink:1}));function bn({legend:e}){const n=J.useIntl(),o=B.useImperativeIntl(n),r=e.showMinMax??!0,{min:i,max:a,error:l}=Yi(e),[x,c]=l?[0,0]:Vi(i,a);return t.jsxRuntimeExports.jsxs(zi,{"data-testid":"proportion-legend",children:[t.jsxRuntimeExports.jsx(Gi,{children:[...Array(4)].map((d,m)=>t.jsxRuntimeExports.jsx(_i,{index:m,component:"span"},m))}),t.jsxRuntimeExports.jsx(Hi,{children:l?t.jsxRuntimeExports.jsx(s.Box,{maxWidth:240,children:t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(B.Typography,{variant:"overline",color:"textSecondary",children:[r&&o.formatMessage({id:"c4r.widgets.legend.max"})+": ",n.formatNumber(a,{maximumSignificantDigits:De})]}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(c,{maximumSignificantDigits:De})}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(x,{maximumSignificantDigits:De})}),t.jsxRuntimeExports.jsxs(B.Typography,{variant:"overline",color:"textSecondary",children:[r&&o.formatMessage({id:"c4r.widgets.legend.min"})+": ",n.formatNumber(i,{maximumSignificantDigits:De})]})]})})]})}function Sn({labels:e}){let n=e==null?void 0:e[e.length-1],o=e==null?void 0:e[0];return Number.isFinite(o)||(o=parseInt(String(o),10)),Number.isFinite(n)||(n=parseInt(String(n),10)),[o,n]}function Yi(e){let n=!1;const[o,r]=Sn(e);return(Number.isNaN(o)||Number.isNaN(r))&&(n=!0),{min:o,max:r,error:n}}function Vi(e,n){const o=(n-e)/3;return[e+o,n-o]}function In({legend:e}){const{labels:n=[],icons:o=[]}=e;return t.jsxRuntimeExports.jsx(vn,{"data-testid":"icon-legend",children:n.map((r,i)=>t.jsxRuntimeExports.jsxs(Bi,{children:[t.jsxRuntimeExports.jsx(Pi,{children:t.jsxRuntimeExports.jsx("img",{src:o[i],alt:r,width:"auto",height:A.ICON_SIZE_MEDIUM})}),t.jsxRuntimeExports.jsx(xt,{visible:!0,title:r,typographyProps:{variant:"overline",my:.75}})]},r))})}function Ui(e){return typeof e[0]=="object"&&"label"in e[0]}function tt({isContinuous:e=!1,legend:n}){const{labels:o=[],colors:r=[],showMinMax:i=!0}=n,a=je.getPalette(r,!o.length||e?2:o.length+1),l=Ui(o),x=l?o.map(({value:h})=>h):o,c=l?o.map(({label:h})=>h):o,[d,m]=Sn({labels:x}),u=Number.isNaN(d)||Number.isNaN(m);let y=c[c.length-1],g=c[0];return!e&&i&&(g="< "+g,y="≥ "+y),t.jsxRuntimeExports.jsx(s.Box,{py:2,"data-testid":"ramp-legend",children:u?t.jsxRuntimeExports.jsx(s.Box,{maxWidth:240,children:t.jsxRuntimeExports.jsx(B.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(s.Box,{display:"flex",pb:1,children:e?t.jsxRuntimeExports.jsx(qi,{"data-testid":"step-continuous",palette:a}):t.jsxRuntimeExports.jsx(Zi,{palette:a,labels:c,max:y,min:g})}),t.jsxRuntimeExports.jsxs(s.Box,{display:"flex",justifyContent:"space-between",children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"overlineDelicate",color:"textSecondary",children:g}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"overlineDelicate",color:"textSecondary",children:y})]})]})})}const qi=s.styled(s.Box,{shouldForwardProp:e=>e!=="palette"})(({palette:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),borderRadius:n.spacing(.5),background:`linear-gradient(to right, ${e.join()})`})),Ki=s.styled(s.Box,{shouldForwardProp:e=>e!=="color"})(({color:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),backgroundColor:e,"&:first-of-type":{borderRadius:n.spacing(.5,0,0,.5)},"&:last-of-type":{borderRadius:n.spacing(0,.5,.5,0)}}));function Zi({labels:e=[],palette:n=[],max:o,min:r}){const i=e.length?[r,...e]:[r,o];return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:i.map((a,l)=>{const x=l===0?r:l===i.length-1?o:`${a} - ${i[l+1]}`;return t.jsxRuntimeExports.jsx(s.Tooltip,{title:x,children:t.jsxRuntimeExports.jsx(Ki,{"data-testid":"step-discontinuous",color:n[l]})},l)})})}const Xi={[ce.CATEGORY]:wn,[ce.PROPORTION]:bn,[ce.ICON]:In,[ce.BINS]:e=>t.jsxRuntimeExports.jsx(tt,{...e,isContinuous:!1}),[ce.CONTINUOUS_RAMP]:e=>t.jsxRuntimeExports.jsx(tt,{...e,isContinuous:!0})};function Ji({legend:e}){const n=J.useIntl(),o=B.useImperativeIntl(n);return e.select||!e.type?null:t.jsxRuntimeExports.jsxs(B.Typography,{variant:"body2",color:"textSecondary",component:"p",children:[e.type," ",o.formatMessage({id:"c4r.widgets.legend.notSupported"}),"."]})}function Qi(e){return e.type===ce.PROPORTION?"c4r.widgets.legend.subtitles.proportion":e.type===ce.ICON||e.customMarkers?"c4r.widgets.legend.subtitles.icon":e.isStrokeColor?"c4r.widgets.legend.subtitles.strokeColor":"c4r.widgets.legend.subtitles.color"}function ea({layer:e,legend:n,customLegendTypes:o,onChangeSelection:r}){var m;const i=J.useIntl(),a=B.useImperativeIntl(i),l=n.type,c=Xi[l]??o[l]??Ji,d=((m=n.select)==null?void 0:m.options)??[];return t.jsxRuntimeExports.jsxs(s.Box,{component:"li","data-testid":"legend-layer-variable",px:2,children:[n.attr?t.jsxRuntimeExports.jsxs(s.Box,{pb:1,children:[t.jsxRuntimeExports.jsx(B.Typography,{gutterBottom:!0,variant:"overlineDelicate",color:"textSecondary",component:"p",children:a.formatMessage({id:Qi(n)})}),t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",component:"p",children:n.attr})]}):null,n.select?t.jsxRuntimeExports.jsxs(s.Box,{pb:1,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",weight:"medium",component:"p",children:n.select.label}),t.jsxRuntimeExports.jsx(s.Select,{"data-testid":"legend-layer-variable-select",name:"legend-select",value:n.select.value,renderValue:u=>{var y;return((y=d.find(g=>g.value===u))==null?void 0:y.label)??u},onChange:u=>r(u.target.value),MenuProps:{transformOrigin:{vertical:"bottom",horizontal:"left"},anchorOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{maxHeight:240}}},children:d.map(u=>t.jsxRuntimeExports.jsx(s.MenuItem,{value:u.value,children:t.jsxRuntimeExports.jsx(s.ListItemText,{primary:u.label})},u.value))})]}):null,t.jsxRuntimeExports.jsx(c,{layer:e,legend:n})]})}const ta={};function kn(e){return e?Array.isArray(e)?e.every(n=>kn(n)):!e.select&&!e.type:!0}function $t({customLegendTypes:e=ta,layer:n,onChangeCollapsed:o,onChangeOpacity:r,onChangeVisibility:i,onChangeSelection:a,maxZoom:l=21,minZoom:x=0,currentZoom:c=0}){const d=J.useIntl(),m=B.useImperativeIntl(d),u=p.useRef(null),[y,g]=p.useState(!1),h=n.id,j=n.title,f=n.visible??!0,v=n.switchable??!0,R=n.collapsed??!1,w=(n.collapsible??!0)&&!kn(n.legend),b=n.opacity??1,E=n.showOpacityControl??!0,k=f&&!R,M=k?t.jsxRuntimeExports.jsx(En,{}):t.jsxRuntimeExports.jsx(yn,{}),D=(n==null?void 0:n.minZoom)!==void 0||(n==null?void 0:n.maxZoom)!==void 0,C=n.minZoom??x,P=n.maxZoom??l,L=D&&(C>x||P<l),$=c<C||c>P,z=na({intl:m,minZoom:x,maxZoom:l,layerMinZoom:C,layerMaxZoom:P}),G=n.helperText??(L?z:""),S=p.useMemo(()=>n.legend?Array.isArray(n.legend)?n.legend:[n.legend]:[],[n.legend]);return n.legend?t.jsxRuntimeExports.jsxs(Li,{"data-testid":"legend-layer","aria-label":j,children:[t.jsxRuntimeExports.jsxs(Mi,{ref:u,children:[w&&t.jsxRuntimeExports.jsx(s.IconButton,{size:"small","aria-label":m.formatMessage({id:R?"c4r.widgets.legend.expand":"c4r.widgets.legend.collapse"}),disabled:!f,onClick:()=>o({id:h,collapsed:!R}),children:M}),t.jsxRuntimeExports.jsxs(Di,{children:[t.jsxRuntimeExports.jsx(xt,{visible:f,title:j??""}),L&&t.jsxRuntimeExports.jsx(s.Tooltip,{title:m.formatMessage({id:"c4r.widgets.legend.zoomLevelTooltip"}),children:t.jsxRuntimeExports.jsxs(B.Typography,{color:f?"textPrimary":"textSecondary",variant:"caption",component:"p",children:[m.formatMessage({id:"c4r.widgets.legend.zoomLevel"})," ",n.minZoom," - ",n.maxZoom]})})]}),E&&f&&!R&&t.jsxRuntimeExports.jsx($i,{menuRef:u,open:y,toggleOpen:g,opacity:b,onChange:N=>r({id:h,opacity:N})}),v&&t.jsxRuntimeExports.jsx(s.Tooltip,{title:m.formatMessage({id:f?"c4r.widgets.legend.hideLayer":"c4r.widgets.legend.showLayer"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",onClick:()=>i({id:h,collapsed:f?R:!1,visible:!f}),children:f?t.jsxRuntimeExports.jsx(hn,{}):t.jsxRuntimeExports.jsx(jn,{})})})]}),t.jsxRuntimeExports.jsxs(s.Collapse,{unmountOnExit:!0,timeout:100,in:k,children:[t.jsxRuntimeExports.jsx(Ai,{"data-testid":"legend-layer-variable-list",opacity:$?.5:1,children:S.map((N,I)=>t.jsxRuntimeExports.jsx(ea,{legend:N,layer:n,customLegendTypes:e,onChangeSelection:O=>a({id:h,index:I,selection:O})},`${N.type}-${I}`))}),G&&t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",color:"textSecondary",component:"div",p:2,children:t.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:G}})})]})]}):null}function na({intl:e,minZoom:n,maxZoom:o,layerMinZoom:r,layerMaxZoom:i}){const a=e.formatMessage({id:"c4r.widgets.legend.and"}),l=e.formatMessage({id:"c4r.widgets.legend.lowerThan"}),x=e.formatMessage({id:"c4r.widgets.legend.greaterThan"}),c=e.formatMessage({id:"c4r.widgets.legend.zoomNote"}),d=i<o?`${l} ${i}`:"",m=r>n?`${x} ${r}`:"",u=[d,m].filter(Boolean).join(` ${a} `);return u?`${c} ${u}`:""}const sa={},ke=()=>{},oa=[];function ra({customLegendTypes:e=sa,layers:n=oa,collapsed:o=!1,onChangeCollapsed:r=ke,onChangeVisibility:i=ke,onChangeOpacity:a=ke,onChangeLegendRowCollapsed:l=ke,onChangeSelection:x=ke,title:c="Layers",maxZoom:d=20,minZoom:m=0,currentZoom:u,isMobile:y,sx:g}){const h=J.useIntl(),j=B.useImperativeIntl(h),f=t.jsxRuntimeExports.jsxs(ki,{collapsed:o,children:[t.jsxRuntimeExports.jsx(B.Typography,{variant:"caption",flexGrow:1,children:c}),t.jsxRuntimeExports.jsx(s.Tooltip,{title:j.formatMessage({id:"c4r.widgets.legend.close"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{size:"small",onClick:()=>r(!0),children:t.jsxRuntimeExports.jsx(gn,{})})})]}),v=t.jsxRuntimeExports.jsx(s.Tooltip,{title:j.formatMessage({id:"c4r.widgets.legend.open"}),children:t.jsxRuntimeExports.jsx(s.IconButton,{"aria-label":c,onClick:()=>r(!1),children:t.jsxRuntimeExports.jsx(fn,{})})});return t.jsxRuntimeExports.jsx(Ii,{sx:g,elevation:3,collapsed:o||!!y,children:y?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[v,t.jsxRuntimeExports.jsxs(s.Drawer,{anchor:"bottom",open:!o,onClose:()=>r(!0),children:[f,t.jsxRuntimeExports.jsx(Dt,{children:n.map(R=>t.jsxRuntimeExports.jsx($t,{layer:R,onChangeCollapsed:l,onChangeOpacity:a,onChangeVisibility:i,onChangeSelection:x,maxZoom:d,minZoom:m,currentZoom:u,customLegendTypes:e},R.id))})]})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o?v:f,t.jsxRuntimeExports.jsx(Dt,{width:o?0:void 0,children:t.jsxRuntimeExports.jsx(s.Collapse,{unmountOnExit:!0,in:!o,timeout:500,children:n.map(R=>t.jsxRuntimeExports.jsx($t,{layer:R,onChangeCollapsed:l,onChangeOpacity:a,onChangeVisibility:i,onChangeSelection:x,maxZoom:d,minZoom:m,currentZoom:u,customLegendTypes:e},R.id))})})]})})}function Ot({color:e=void 0,children:n}){return n?t.jsxRuntimeExports.jsx(s.Box,{mt:.5,children:t.jsxRuntimeExports.jsx(B.Typography,{component:"div",variant:"caption",color:e??"inherit",style:{fontWeight:"normal"},children:n})}):t.jsxRuntimeExports.jsx(s.Box,{mt:-1})}function ia({title:e="No data available",body:n="There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust the Map View.",severity:o=void 0,...r}){return o?t.jsxRuntimeExports.jsx(B.Alert,{title:e,severity:o,...r,children:t.jsxRuntimeExports.jsx(Ot,{children:n})}):t.jsxRuntimeExports.jsxs(s.Box,{...r,children:[e&&t.jsxRuntimeExports.jsx(B.Typography,{variant:"body2",children:e}),t.jsxRuntimeExports.jsx(Ot,{color:"textSecondary",children:n})]})}const aa=s.styled(s.Box,{shouldForwardProp:e=>e!=="margin"})(({theme:e,margin:n})=>({margin:0,position:"relative",maxWidth:"100%",padding:n??e.spacing(2,2.5)})),la=s.styled(s.LinearProgress)(({theme:e})=>({position:"absolute",top:0,left:0,width:"100%",height:e.spacing(.25)})),ca=s.styled(s.Grid,{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:n=!0})=>({display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",width:"100%",...n?{minHeight:e.spacing(3)}:{height:e.spacing(3)},padding:0})),ua=s.styled(s.Button,{shouldForwardProp:e=>e!=="expandable"})(({theme:e,expandable:n=!0})=>({flex:1,padding:0,alignItems:"flex-start",justifyContent:"flex-start",height:"auto",minHeight:"auto",marginBottom:e.spacing(1),cursor:n?"pointer":"default","& .MuiButton-startIcon":{marginTop:"3px",marginRight:e.spacing(1)},"&:hover":{background:"none"}})),Mn=({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:e.spacing(3),height:e.spacing(3),color:e.palette.text.secondary}),pa=s.styled(fe.ExpandLess)(({theme:e})=>Mn({theme:e})),xa=s.styled(fe.ExpandMore)(({theme:e})=>Mn({theme:e})),da=s.styled(s.Typography,{shouldForwardProp:e=>e!=="expanded"})(({expanded:e=!0})=>({wordBreak:"break-word",overflow:"hidden",...e&&{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},...!e&&{whiteSpace:"nowrap",textOverflow:"ellipsis"}})),ma=s.styled(s.Grid)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),marginRight:e.spacing(-.5),marginLeft:e.spacing(1)})),Nt=s.styled(s.IconButton)(({theme:e})=>({color:e.palette.text.secondary})),ga=s.styled(s.Menu)(({theme:e})=>({".MuiPaper-root":{marginTop:e.spacing(5),maxHeight:e.spacing(21),minWidth:e.spacing(16)}})),Ft=[],fa=t.jsxRuntimeExports.jsx(fe.MoreVert,{});function ha({title:e,actions:n=Ft,options:o=Ft,optionsIcon:r=fa,children:i,contentProps:a,disabled:l=!1,expandable:x=!0,expanded:c=!0,onExpandedChange:d,footer:m,headerItems:u,isLoading:y=!1,margin:g}){const h=p.createRef(),[j,f]=p.useState(!0),v=c!==void 0&&d!==void 0,R=x!==!1?v?c:j:!0,w=v?d:f,[b,E]=p.useState(null),k=!!b,M=()=>{x&&w(!R)},D=$=>E($.currentTarget),C=()=>E(null);function P($){$&&$(),C()}const L=$=>t.jsxRuntimeExports.jsx(Nt,{"aria-label":$.label,onClick:$.action,size:"small",children:$.icon},$.id);return l?i:t.jsxRuntimeExports.jsxs(aa,{margin:g,component:"section","aria-label":e,children:[y?t.jsxRuntimeExports.jsx(la,{}):null,t.jsxRuntimeExports.jsxs(ca,{container:!0,expanded:c,children:[t.jsxRuntimeExports.jsx(ua,{expandable:x,startIcon:x&&t.jsxRuntimeExports.jsx(s.Icon,{children:R?t.jsxRuntimeExports.jsx(pa,{}):t.jsxRuntimeExports.jsx(xa,{})}),onClick:M,tabIndex:x?0:-1,children:t.jsxRuntimeExports.jsx(s.Tooltip,{title:e,children:t.jsxRuntimeExports.jsx(da,{expanded:c,align:"left",variant:"subtitle1",children:e})})}),t.jsxRuntimeExports.jsxs(ma,{item:!0,children:[u,n.length>0&&n.map($=>$.tooltip?t.jsxRuntimeExports.jsx(s.Tooltip,{title:$.tooltip.text,placement:$.tooltip.placement??"top",children:L($)},$.id):L($)),o.length>0&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Nt,{"aria-label":"options","aria-controls":"options-menu","aria-haspopup":"true",onClick:D,size:"small",children:r}),t.jsxRuntimeExports.jsx(ga,{id:"options-menu",elevation:8,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:b,keepMounted:!0,open:k,onClose:C,children:o.map($=>t.jsxRuntimeExports.jsx(s.MenuItem,{selected:$.selected,onClick:()=>P($.action),children:$.name},$.id))})]})]})]}),t.jsxRuntimeExports.jsx(s.Collapse,{ref:h,in:R,timeout:"auto",unmountOnExit:!0,children:t.jsxRuntimeExports.jsxs(s.Box,{...a,children:[t.jsxRuntimeExports.jsx(s.Box,{pt:1,children:i}),m??t.jsxRuntimeExports.jsx(s.Box,{children:m})]})})]})}exports.BarWidgetUI=Hn;exports.CategoryWidgetUI=ts;exports.ComparativeCategoryWidgetUI=Br;exports.ComparativeFormulaWidgetUI=_r;exports.ComparativePieWidgetUI=qr;exports.FeatureSelectionUIDropdown=dn;exports.FeatureSelectionUIGeometryChips=mn;exports.FeatureSelectionUIToggleButton=pn;exports.FeatureSelectionWidgetUI=ai;exports.FormulaWidgetUI=rs;exports.GroupDateTypes=le;exports.HistogramWidgetUI=ms;exports.LEGEND_TYPES=ce;exports.LegendCategories=wn;exports.LegendIcon=In;exports.LegendProportion=bn;exports.LegendRamp=tt;exports.LegendWidgetUI=ra;exports.NoDataAlert=ia;exports.PieWidgetUI=Gs;exports.RangeWidgetUI=Js;exports.ScatterPlotWidgetUI=ao;exports.TIME_SERIES_CHART_TYPES=He;exports.TableWidgetUI=yo;exports.TimeSeriesProvider=en;exports.TimeSeriesWidgetUI=ur;exports.WrapperWidgetUI=ha;exports.useTimeSeriesContext=Ye;exports.useTimeSeriesInteractivity=tn;
|