@automattic/charts 4.9.0 → 4.11.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/TOKENS.md +7 -3
  3. package/dist/index.cjs +496 -774
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +66 -3
  6. package/dist/index.d.cts +65 -60
  7. package/dist/index.d.ts +65 -60
  8. package/dist/index.js +467 -726
  9. package/dist/index.js.map +1 -1
  10. package/dist/visx/group/index.js +1 -2
  11. package/dist/visx/legend/index.js +1 -2
  12. package/dist/visx/text/index.js +1 -2
  13. package/package.json +13 -12
  14. package/src/charts/area-chart/area-chart.tsx +2 -1
  15. package/src/charts/area-chart/test/area-chart.test.tsx +0 -8
  16. package/src/charts/area-chart/types.ts +0 -2
  17. package/src/charts/bar-chart/bar-chart.tsx +7 -2
  18. package/src/charts/bar-chart/test/bar-chart.test.tsx +0 -8
  19. package/src/charts/bar-chart/types.ts +0 -2
  20. package/src/charts/bar-list-chart/bar-list-chart.tsx +3 -0
  21. package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +5 -0
  22. package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +23 -7
  23. package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +22 -0
  24. package/src/charts/conversion-funnel-chart/types.ts +1 -1
  25. package/src/charts/geo-chart/geo-chart.module.scss +27 -0
  26. package/src/charts/geo-chart/geo-chart.tsx +85 -45
  27. package/src/charts/geo-chart/private/use-tooltip-position.ts +106 -0
  28. package/src/charts/geo-chart/test/geo-chart.test.tsx +77 -46
  29. package/src/charts/geo-chart/test/use-tooltip-position.test.ts +43 -0
  30. package/src/charts/geo-chart/types.ts +1 -1
  31. package/src/charts/heatmap-chart/heatmap-chart.module.scss +3 -3
  32. package/src/charts/heatmap-chart/private/heatmap-scale.ts +48 -43
  33. package/src/charts/heatmap-chart/test/heatmap-chart.test.tsx +5 -11
  34. package/src/charts/heatmap-chart/test/heatmap-scale.test.ts +55 -27
  35. package/src/charts/heatmap-chart/types.ts +1 -3
  36. package/src/charts/leaderboard-chart/hooks/use-fitted-row-count.ts +2 -2
  37. package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +6 -0
  38. package/src/charts/leaderboard-chart/leaderboard-chart.tsx +34 -19
  39. package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +35 -6
  40. package/src/charts/leaderboard-chart/types.ts +1 -0
  41. package/src/charts/line-chart/line-chart.tsx +3 -0
  42. package/src/charts/line-chart/test/line-chart.test.tsx +0 -8
  43. package/src/charts/line-chart/types.ts +0 -2
  44. package/src/charts/pie-chart/pie-chart.module.scss +3 -0
  45. package/src/charts/pie-chart/pie-chart.tsx +0 -5
  46. package/src/charts/pie-chart/test/pie-chart.test.tsx +4 -8
  47. package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +3 -0
  48. package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +0 -5
  49. package/src/charts/private/pie-keyboard-navigation/pie-tooltip.tsx +8 -3
  50. package/src/charts/test/accessible-name.test.tsx +181 -0
  51. package/src/components/legend/hooks/test/use-chart-legend-items.test.tsx +63 -3
  52. package/src/components/legend/hooks/use-chart-legend-items.ts +63 -1
  53. package/src/components/legend/private/base-legend.module.scss +5 -0
  54. package/src/components/legend/private/base-legend.tsx +35 -17
  55. package/src/components/legend/test/legend.test.tsx +42 -0
  56. package/src/components/legend/types.ts +2 -0
  57. package/src/components/tooltip/_surface.scss +19 -0
  58. package/src/components/tooltip/private/bounded-tooltip.tsx +2 -2
  59. package/src/components/tooltip/tooltip-box.module.scss +3 -17
  60. package/src/hooks/test/use-xychart-theme.test.tsx +22 -0
  61. package/src/hooks/use-xychart-theme.ts +33 -2
  62. package/src/index.ts +1 -0
  63. package/src/styles/chart-scope.scss +6 -4
  64. package/src/styles/test/chart-scope.test.ts +6 -2
  65. package/src/types.ts +19 -1
  66. package/src/utils/resolve-font-size.ts +9 -10
  67. package/src/utils/test/resolve-font-size.test.ts +11 -2
package/dist/index.js CHANGED
@@ -28,7 +28,6 @@ import { Chart } from "react-google-charts";
28
28
  import DOMPurify from "dompurify";
29
29
  import { __assign } from "tslib";
30
30
  import "@babel/runtime/helpers/esm/extends";
31
- import "@babel/runtime/helpers/extends";
32
31
  import { Icon, chevronRight } from "@wordpress/icons";
33
32
  import { arc, pie } from "@visx/shape";
34
33
  //#region \0rolldown/runtime.js
@@ -38,7 +37,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
38
37
  var __getOwnPropNames = Object.getOwnPropertyNames;
39
38
  var __getProtoOf = Object.getPrototypeOf;
40
39
  var __hasOwnProp = Object.prototype.hasOwnProperty;
41
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
40
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
42
41
  var __copyProps = (to, from, except, desc) => {
43
42
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
44
43
  key = keys[i];
@@ -669,16 +668,17 @@ function readCustomProperty(varName, styles) {
669
668
  }
670
669
  //#endregion
671
670
  //#region src/utils/resolve-font-size.ts
671
+ const toFontSize = (size) => Number.isFinite(size) && size >= 0 ? size : void 0;
672
672
  /**
673
673
  * Resolve a theme `fontSize` value into a plain number suitable for
674
674
  * canvas-based measurement (e.g. `getStringWidth`).
675
675
  *
676
676
  * Accepts:
677
- * - A number — returned as-is
677
+ * - A finite, non-negative number — returned as-is
678
678
  * - A pixel string like `"12px"` — parsed and returned as a number
679
679
  *
680
- * Returns `undefined` for any other input (missing value, NaN, or
681
- * relative units like `rem`/`em`/`%`/`vh`) so callers can fall back to
680
+ * Returns `undefined` for any other input (missing value, a non-finite or
681
+ * negative size, or relative units like `rem`/`em`/`%`/`vh`) so callers can fall back to
682
682
  * their own default. Relative units are intentionally rejected because
683
683
  * we cannot resolve them to absolute pixels here without a parent
684
684
  * computed style, and silently returning the unitless prefix
@@ -688,12 +688,10 @@ function readCustomProperty(varName, styles) {
688
688
  * @return Parsed numeric font size in pixels, or `undefined` when unresolvable
689
689
  */
690
690
  const resolveFontSize = (val) => {
691
- if (typeof val === "number") return isNaN(val) ? void 0 : val;
691
+ if (typeof val === "number") return toFontSize(val);
692
692
  if (typeof val === "string") {
693
- const match = val.trim().match(/^(-?\d+\.?\d*|-?\.\d+)(px)?$/);
694
- if (!match) return;
695
- const parsed = parseFloat(match[1]);
696
- return isNaN(parsed) ? void 0 : parsed;
693
+ const match = val.trim().match(/^\+?((?:\d*\.)?\d+)(px)?$/);
694
+ return match ? toFontSize(parseFloat(match[1])) : void 0;
697
695
  }
698
696
  };
699
697
  //#endregion
@@ -1572,6 +1570,20 @@ const useChartScopeElement = () => useContext(ChartScopeContext);
1572
1570
  const useStandaloneScopeClass = () => useContext(GlobalChartsContext) ? void 0 : CHART_SCOPE_CLASS;
1573
1571
  //#endregion
1574
1572
  //#region src/hooks/use-xychart-theme.ts
1573
+ const STARTS_LIKE_A_NUMBER = /^[+-]?[\d.]/;
1574
+ const NON_NEGATIVE_CSS_NUMBER = /^\+?(?:\d*\.)?\d+(?:e[+-]?\d+)?(?:[a-z]+|%)?$/i;
1575
+ const isRenderableFontSize = (fontSize) => {
1576
+ if (typeof fontSize === "number") return resolveFontSize(fontSize) !== void 0;
1577
+ const value = fontSize.trim();
1578
+ if (!STARTS_LIKE_A_NUMBER.test(value)) return true;
1579
+ return NON_NEGATIVE_CSS_NUMBER.test(value) && Number.isFinite(parseFloat(value));
1580
+ };
1581
+ const withRenderableFontSize = (style) => {
1582
+ if (style?.fontSize === void 0 || isRenderableFontSize(style.fontSize)) return style;
1583
+ const rest = { ...style };
1584
+ delete rest.fontSize;
1585
+ return rest;
1586
+ };
1575
1587
  const useXYChartTheme = (data) => {
1576
1588
  const theme = useGlobalChartsTheme();
1577
1589
  const scopeElement = useChartScopeElement();
@@ -1602,9 +1614,10 @@ const useXYChartTheme = (data) => {
1602
1614
  yAxisLineStyles: { stroke: CATALOG_POINTERS.axisY },
1603
1615
  yTickLineStyles: { stroke: CATALOG_POINTERS.tickY },
1604
1616
  svgLabelSmall: {
1605
- ...theme.svgLabelSmall,
1617
+ ...withRenderableFontSize(theme.svgLabelSmall),
1606
1618
  fill: CATALOG_POINTERS.labelAxis
1607
- }
1619
+ },
1620
+ svgLabelBig: withRenderableFontSize(theme.svgLabelBig)
1608
1621
  });
1609
1622
  }, [
1610
1623
  theme,
@@ -2079,6 +2092,7 @@ function valueOrIdentityString(_) {
2079
2092
  //#region src/components/legend/private/base-legend.module.scss
2080
2093
  var base_legend_module_default = {
2081
2094
  "legend": "a8ccharts-04TogW-legend",
2095
+ "legend--horizontal": "a8ccharts-04TogW-legend--horizontal",
2082
2096
  "legend-item": "a8ccharts-04TogW-legend-item",
2083
2097
  "legend-item--inactive": "a8ccharts-04TogW-legend-item--inactive",
2084
2098
  "legend-item--interactive": "a8ccharts-04TogW-legend-item--interactive",
@@ -2117,7 +2131,7 @@ const getLegendItemAriaLabel = (text, value, visible, interactive) => {
2117
2131
  if (visible) return;
2118
2132
  return sprintf(_x("%s: hidden", "hidden non-interactive legend item", "jetpack-charts"), accessibleText);
2119
2133
  };
2120
- const BaseLegend = forwardRef(({ items, className, orientation = "horizontal", alignment = "center", shape = "rect", fill = valueOrIdentityString, size = valueOrIdentityString, labelFormat = valueOrIdentity, labelTransform, itemStyles, itemClassName, labelStyles, labelClassName, shapeStyles, render, interactive = false, chartId }, ref) => {
2134
+ const BaseLegend = forwardRef(({ items: allItems, className, orientation = "horizontal", alignment = "center", shape = "rect", fill = valueOrIdentityString, size = valueOrIdentityString, labelFormat = valueOrIdentity, labelTransform, itemStyles, itemClassName, labelStyles, labelClassName, shapeStyles, render, interactive = false, chartId }, ref) => {
2121
2135
  const { margin: itemMargin = "0", flexDirection: itemDirection = "row" } = itemStyles ?? {};
2122
2136
  const { justifyContent: labelJustifyContent = "flex-start", flex: labelFlex = "0 0 auto", margin: labelMargin = "0 4px", maxWidth, textOverflow = "wrap" } = labelStyles ?? {};
2123
2137
  const { width: shapeWidth = 16, height: shapeHeight = 16, margin: shapeMargin = "2px 4px 2px 0" } = shapeStyles ?? {};
@@ -2125,6 +2139,16 @@ const BaseLegend = forwardRef(({ items, className, orientation = "horizontal", a
2125
2139
  const context = useContext(GlobalChartsContext);
2126
2140
  const chartInstanceContext = useContext(ChartInstanceContext);
2127
2141
  const standaloneScopeClass = useStandaloneScopeClass();
2142
+ const isSeriesVisible = useCallback((seriesLabel) => {
2143
+ if (chartInstanceContext?.isSeriesVisible) return chartInstanceContext.isSeriesVisible(seriesLabel);
2144
+ if (!chartId || !context) return true;
2145
+ return context.isSeriesVisible(chartId, seriesLabel);
2146
+ }, [
2147
+ chartId,
2148
+ chartInstanceContext,
2149
+ context
2150
+ ]);
2151
+ const items = useMemo(() => allItems.filter((item) => item.interactive !== false || !item.describesSeries || isSeriesVisible(item.describesSeries)), [allItems, isSeriesVisible]);
2128
2152
  const domain = items.map((item) => item.label);
2129
2153
  const legendScale = scaleOrdinal({
2130
2154
  domain,
@@ -2147,15 +2171,6 @@ const BaseLegend = forwardRef(({ items, className, orientation = "horizontal", a
2147
2171
  chartId,
2148
2172
  context
2149
2173
  ]);
2150
- const isSeriesVisible = useCallback((seriesLabel) => {
2151
- if (chartInstanceContext?.isSeriesVisible) return chartInstanceContext.isSeriesVisible(seriesLabel);
2152
- if (!chartId || !context) return true;
2153
- return context.isSeriesVisible(chartId, seriesLabel);
2154
- }, [
2155
- chartId,
2156
- chartInstanceContext,
2157
- context
2158
- ]);
2159
2174
  const createClickHandler = useCallback((seriesLabels, itemInteractive) => {
2160
2175
  if (!itemInteractive) return;
2161
2176
  return () => handleLegendClick(seriesLabels);
@@ -2179,12 +2194,12 @@ const BaseLegend = forwardRef(({ items, className, orientation = "horizontal", a
2179
2194
  children: (labels) => /* @__PURE__ */ jsx(Stack, {
2180
2195
  ref,
2181
2196
  direction: orientation === "vertical" ? "column" : "row",
2182
- gap: orientation === "vertical" ? "sm" : "lg",
2197
+ gap: orientation === "vertical" ? "sm" : void 0,
2183
2198
  align: orientation === "vertical" ? flexAlignment : void 0,
2184
2199
  justify: orientation === "horizontal" ? flexAlignment : void 0,
2185
2200
  wrap: orientation === "horizontal" ? "wrap" : void 0,
2186
2201
  role: interactive ? void 0 : "list",
2187
- className: clsx(standaloneScopeClass, base_legend_module_default.legend, className),
2202
+ className: clsx(standaloneScopeClass, base_legend_module_default.legend, orientation === "horizontal" && base_legend_module_default["legend--horizontal"], className),
2188
2203
  style: theme.legend?.containerStyles,
2189
2204
  children: labels.map((label, i) => {
2190
2205
  const matchedItem = items[i];
@@ -2430,6 +2445,34 @@ function buildComparisonLegendItem(seriesData, items, label, getElementStyles, l
2430
2445
  };
2431
2446
  }
2432
2447
  /**
2448
+ * Builds one static item per comparison series folded into another series' item, named after
2449
+ * that item and styled like the comparison series itself.
2450
+ * @param seriesData - The series data to search for comparison series
2451
+ * @param items - The legend items already built from the series
2452
+ * @param formatLabel - Names an item after the label of the item it was folded into
2453
+ * @param getElementStyles - Function to get element styles
2454
+ * @param legendShape - The shape type for legend items (string literal or React component)
2455
+ * @return The legend items, in series order
2456
+ */
2457
+ function buildPerSeriesComparisonItems(seriesData, items, formatLabel, getElementStyles, legendShape) {
2458
+ return seriesData.flatMap((series, index) => {
2459
+ const owner = items.find((item) => item.seriesLabels?.includes(series.label));
2460
+ if (series.options?.type !== "comparison" || !owner || owner.seriesLabels?.[0] === series.label) return [];
2461
+ const { color, shapeStyles } = getElementStyles({
2462
+ data: series,
2463
+ index,
2464
+ legendShape
2465
+ });
2466
+ return [{
2467
+ label: formatLabel(owner.label),
2468
+ color,
2469
+ shapeStyle: shapeStyles,
2470
+ interactive: false,
2471
+ describesSeries: series.label
2472
+ }];
2473
+ });
2474
+ }
2475
+ /**
2433
2476
  * Processes point data into legend items
2434
2477
  * @param pointData - The point data to process
2435
2478
  * @param getElementStyles - Function to get element styles
@@ -2465,13 +2508,14 @@ function processPointData(pointData, getElementStyles, showValues, legendValueDi
2465
2508
  * @return Array of legend items ready for display
2466
2509
  */
2467
2510
  function useChartLegendItems(data, options = {}, legendShape) {
2468
- const { showValues = false, legendValueDisplay = "percentage", withGlyph = false, glyphSize = 8, collapseGroups = false, comparisonItem = false, renderGlyph } = options;
2511
+ const { showValues = false, legendValueDisplay = "percentage", withGlyph = false, glyphSize = 8, collapseGroups = false, comparisonItem = false, comparisonSeriesItems, renderGlyph } = options;
2469
2512
  const { getElementStyles } = useGlobalChartsContext();
2470
2513
  return useMemo(() => {
2471
2514
  if (!data || !Array.isArray(data) || data.length === 0) return [];
2472
2515
  if ("data" in data[0]) {
2473
2516
  const seriesData = data;
2474
2517
  const items = processSeriesData(seriesData, getElementStyles, showValues, withGlyph, glyphSize, collapseGroups, renderGlyph, legendShape);
2518
+ if (comparisonSeriesItems) return [...items, ...buildPerSeriesComparisonItems(seriesData, items, comparisonSeriesItems, getElementStyles, legendShape)];
2475
2519
  const comparison = comparisonItem ? buildComparisonLegendItem(seriesData, items, typeof comparisonItem === "string" ? comparisonItem : __("Comparison period", "jetpack-charts"), getElementStyles, legendShape) : null;
2476
2520
  return comparison ? [...items, comparison] : items;
2477
2521
  }
@@ -2485,6 +2529,7 @@ function useChartLegendItems(data, options = {}, legendShape) {
2485
2529
  glyphSize,
2486
2530
  collapseGroups,
2487
2531
  comparisonItem,
2532
+ comparisonSeriesItems,
2488
2533
  renderGlyph,
2489
2534
  legendShape
2490
2535
  ]);
@@ -2579,9 +2624,6 @@ const BaseTooltip = ({ data, top, left, component: Component = LabelValueContent
2579
2624
  children: content
2580
2625
  });
2581
2626
  };
2582
- //#endregion
2583
- //#region src/components/tooltip/private/bounded-tooltip.tsx
2584
- const DEFAULT_OFFSET = 10;
2585
2627
  const POINTER_HEIGHT = 6;
2586
2628
  const clamp = (position, min, max, size) => Math.min(Math.max(position, min), Math.max(min, max - size));
2587
2629
  const isClipping = (element) => {
@@ -2678,7 +2720,7 @@ const getBoundedPosition = ({ left, top, offsetLeft, offsetTop, box, wrapper, bo
2678
2720
  * @param props.placement - Below-axis, beside without vertical flipping, or automatic flipping.
2679
2721
  * @return The tooltip box.
2680
2722
  */
2681
- const BoundedTooltip = ({ left = 0, top = 0, offsetLeft = DEFAULT_OFFSET, offsetTop = DEFAULT_OFFSET, style, unstyled = false, className, children, placement = "auto", ...rest }) => {
2723
+ const BoundedTooltip = ({ left = 0, top = 0, offsetLeft = 10, offsetTop = 10, style, unstyled = false, className, children, placement = "auto", ...rest }) => {
2682
2724
  const nodeRef = useRef(null);
2683
2725
  const clipRef = useRef(null);
2684
2726
  const [position, setPosition] = useState(null);
@@ -4726,6 +4768,7 @@ const LineChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
4726
4768
  const legendInteractive = legend.interactive ?? false;
4727
4769
  const legendCollapseGroups = legend.collapseGroups ?? false;
4728
4770
  const legendComparisonItem = legend.comparisonItem ?? false;
4771
+ const legendComparisonSeriesItems = legend.comparisonSeriesItems;
4729
4772
  const legendShape = legend.shape ?? "line";
4730
4773
  const legendPosition = legend.position ?? "bottom";
4731
4774
  const formatting = useChartFormatting();
@@ -4910,12 +4953,14 @@ const LineChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
4910
4953
  glyphSize: Math.max(0, toNumber(glyphStyle?.radius) ?? 4),
4911
4954
  collapseGroups: legendCollapseGroups,
4912
4955
  comparisonItem: legendComparisonItem,
4956
+ comparisonSeriesItems: legendComparisonSeriesItems,
4913
4957
  renderGlyph
4914
4958
  }), [
4915
4959
  withLegendGlyph,
4916
4960
  glyphStyle?.radius,
4917
4961
  legendCollapseGroups,
4918
4962
  legendComparisonItem,
4963
+ legendComparisonSeriesItems,
4919
4964
  renderGlyph
4920
4965
  ]), legendShape);
4921
4966
  const chartMetadata = useMemo(() => ({
@@ -5384,8 +5429,13 @@ const AreaChartInternal = forwardRef(({ data, ariaLabel, chartId: providedChartI
5384
5429
  withGlyph: false,
5385
5430
  glyphSize: 0,
5386
5431
  collapseGroups: legend.collapseGroups ?? false,
5387
- comparisonItem: legend.comparisonItem ?? false
5388
- }), [legend.collapseGroups, legend.comparisonItem]), legendShape);
5432
+ comparisonItem: legend.comparisonItem ?? false,
5433
+ comparisonSeriesItems: legend.comparisonSeriesItems
5434
+ }), [
5435
+ legend.collapseGroups,
5436
+ legend.comparisonItem,
5437
+ legend.comparisonSeriesItems
5438
+ ]), legendShape);
5389
5439
  const chartMetadata = useMemo(() => ({
5390
5440
  stacked,
5391
5441
  stackOffset,
@@ -6378,6 +6428,7 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
6378
6428
  const legendInteractive = legend.interactive ?? false;
6379
6429
  const legendCollapseGroups = legend.collapseGroups ?? false;
6380
6430
  const legendComparisonItem = legend.comparisonItem ?? false;
6431
+ const legendComparisonSeriesItems = legend.comparisonSeriesItems;
6381
6432
  const horizontal = orientation === "horizontal";
6382
6433
  const chartId = useChartId(providedChartId);
6383
6434
  const hiddenSeries = useDefaultHiddenSeries(chartId, defaultHiddenSeries);
@@ -6390,8 +6441,13 @@ const BarChartInternal = ({ data, ariaLabel, chartId: providedChartId, width, he
6390
6441
  });
6391
6442
  const legendItems = useChartLegendItems(dataSorted, useMemo(() => ({
6392
6443
  collapseGroups: legendCollapseGroups,
6393
- comparisonItem: legendComparisonItem
6394
- }), [legendCollapseGroups, legendComparisonItem]));
6444
+ comparisonItem: legendComparisonItem,
6445
+ comparisonSeriesItems: legendComparisonSeriesItems
6446
+ }), [
6447
+ legendCollapseGroups,
6448
+ legendComparisonItem,
6449
+ legendComparisonSeriesItems
6450
+ ]));
6395
6451
  const { getElementStyles } = useGlobalChartsContext();
6396
6452
  const isSeriesRendered = useCallback((series) => isSeriesVisible(series.label), [isSeriesVisible]);
6397
6453
  const hasWholeNumberValues = useMemo(() => hasOnlyWholeNumbers(dataSorted.filter(isSeriesRendered)), [dataSorted, isSeriesRendered]);
@@ -6902,7 +6958,7 @@ const BarListChartInternal = ({ data, width, height, options = {}, margin = {
6902
6958
  right: 20,
6903
6959
  bottom: 0,
6904
6960
  top: 0
6905
- }, className, ...rest }) => {
6961
+ }, className, ariaLabel, ...rest }) => {
6906
6962
  const { getElementStyles } = useGlobalChartsContext();
6907
6963
  const tintedData = useMemo(() => {
6908
6964
  if (data.length > 1) return data;
@@ -6977,6 +7033,7 @@ const BarListChartInternal = ({ data, width, height, options = {}, margin = {
6977
7033
  xScale: chartOptions.xScale,
6978
7034
  yScale: chartOptions.yScale
6979
7035
  },
7036
+ ariaLabel: ariaLabel ?? __("Bar list chart", "jetpack-charts"),
6980
7037
  ...rest
6981
7038
  });
6982
7039
  };
@@ -7052,6 +7109,8 @@ const useFunnelSelection = (hideTooltip) => {
7052
7109
  };
7053
7110
  //#endregion
7054
7111
  //#region src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
7112
+ /** Chart height (px) below which the funnel tightens its gaps so the bars keep their room. */
7113
+ const SHORT_CHART_HEIGHT = 180;
7055
7114
  /**
7056
7115
  * Internal ConversionFunnelChart component with chart registration
7057
7116
  *
@@ -7063,6 +7122,7 @@ const useFunnelSelection = (hideTooltip) => {
7063
7122
  * @param props.loading - Whether the chart is in loading state
7064
7123
  * @param props.animation - Whether to show chart animation on initial render or not
7065
7124
  * @param props.className - Additional CSS class name
7125
+ * @param props.ariaLabel - Accessible name for the chart group
7066
7126
  * @param props.height - Height of the chart container. Falls back to style.height if set, otherwise defaults to "100%".
7067
7127
  * @param props.style - Custom styling
7068
7128
  * @param props.renderStepLabel - Custom render function for step labels
@@ -7072,7 +7132,7 @@ const useFunnelSelection = (hideTooltip) => {
7072
7132
  * @param props.tooltipStyle - Inline styles merged over the tooltip box defaults
7073
7133
  * @return JSX element representing the conversion funnel chart
7074
7134
  */
7075
- const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loading = false, animation, className, chartId: providedChartId, height, style, renderStepLabel, renderStepRate, renderMainMetric, renderTooltip, tooltipStyle }) => {
7135
+ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loading = false, animation, className, ariaLabel, chartId: providedChartId, height, style, renderStepLabel, renderStepRate, renderMainMetric, renderTooltip, tooltipStyle }) => {
7076
7136
  const chartId = useChartId(providedChartId);
7077
7137
  const { getElementStyles, isColorPaletteResolved } = useGlobalChartsContext();
7078
7138
  const chartRef = useRef(null);
@@ -7081,10 +7141,13 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
7081
7141
  const { tooltipData, tooltipLeft, tooltipTop, tooltipOpen, showTooltip, hideTooltip } = useTooltip();
7082
7142
  const { handleBarClick, handleBarKeyDown, clearSelection, getStepState } = useFunnelSelection(hideTooltip);
7083
7143
  const standaloneScopeClass = useStandaloneScopeClass();
7144
+ const [measureChartRef, , chartHeight] = useElementSize();
7145
+ const gap = chartHeight > 0 && chartHeight < SHORT_CHART_HEIGHT ? "sm" : "xl";
7084
7146
  const setChartRef = useCallback((node) => {
7085
7147
  chartRef.current = node;
7086
7148
  setScopeNode(node);
7087
- }, []);
7149
+ measureChartRef(node);
7150
+ }, [measureChartRef]);
7088
7151
  const clearSelectionAndRef = useCallback(() => {
7089
7152
  clearSelection();
7090
7153
  selectedBarRef.current = null;
@@ -7232,7 +7295,9 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
7232
7295
  const maxRate = Math.max(...steps.map((step) => step.rate));
7233
7296
  return /* @__PURE__ */ jsxs(Stack, {
7234
7297
  direction: "column",
7235
- gap: "xl",
7298
+ gap,
7299
+ role: "group",
7300
+ "aria-label": ariaLabel ?? __("Conversion funnel chart", "jetpack-charts"),
7236
7301
  ref: setChartRef,
7237
7302
  className: clsx("conversion-funnel-chart", conversion_funnel_chart_module_default["conversion-funnel-chart"], loading && conversion_funnel_chart_module_default["conversion-funnel-chart--loading"], className),
7238
7303
  style: {
@@ -7263,7 +7328,7 @@ const ConversionFunnelChartInternal = ({ mainRate, changeIndicator, steps, loadi
7263
7328
  return /* @__PURE__ */ jsxs(Stack, {
7264
7329
  direction: "column",
7265
7330
  className: clsx(conversion_funnel_chart_module_default["funnel-step"], isColorPaletteResolved && conversion_funnel_chart_module_default["funnel-step--animated"], isBlurred && conversion_funnel_chart_module_default["funnel-step--blurred"]),
7266
- gap: "xl",
7331
+ gap,
7267
7332
  children: [/* @__PURE__ */ jsxs(Stack, {
7268
7333
  direction: "column",
7269
7334
  gap: "xs",
@@ -7387,6 +7452,91 @@ function sanitizeHtml(html) {
7387
7452
  //#region src/charts/geo-chart/geo-chart.module.scss
7388
7453
  var geo_chart_module_default = { "container": "a8ccharts-8hS2IW-container" };
7389
7454
  //#endregion
7455
+ //#region src/charts/geo-chart/private/use-tooltip-position.ts
7456
+ const TOOLTIP_CLASS = "google-visualization-tooltip";
7457
+ const isTooltip = (node) => node instanceof HTMLElement && node.classList.contains(TOOLTIP_CLASS);
7458
+ /**
7459
+ * Moves Google's HTML tooltip to where the other chart tooltips sit, just off the cursor. Google places it about 30px away and has no option for it.
7460
+ *
7461
+ * @param containerRef - The element Google draws the chart into.
7462
+ */
7463
+ function useTooltipPosition(containerRef) {
7464
+ useEffect(() => {
7465
+ const container = containerRef.current;
7466
+ if (!container || typeof MutationObserver === "undefined") return;
7467
+ let pointer = null;
7468
+ let clip = null;
7469
+ const ownStyles = /* @__PURE__ */ new WeakMap();
7470
+ const place = (tooltip) => {
7471
+ const parent = tooltip.offsetParent;
7472
+ if (!pointer || !parent) return;
7473
+ if (clip?.parent !== parent) clip = {
7474
+ parent,
7475
+ element: findClippingAncestor(parent)
7476
+ };
7477
+ const parentRect = parent.getBoundingClientRect();
7478
+ const clipRect = clip.element?.getBoundingClientRect() ?? {
7479
+ left: 0,
7480
+ top: 0,
7481
+ right: window.innerWidth,
7482
+ bottom: window.innerHeight
7483
+ };
7484
+ const { x, y } = getBoundedPosition({
7485
+ left: pointer.x - parentRect.left,
7486
+ top: pointer.y - parentRect.top,
7487
+ offsetLeft: 10,
7488
+ offsetTop: 10,
7489
+ box: {
7490
+ width: tooltip.offsetWidth,
7491
+ height: tooltip.offsetHeight
7492
+ },
7493
+ wrapper: {
7494
+ left: 0,
7495
+ top: 0,
7496
+ right: parentRect.width,
7497
+ bottom: parentRect.height
7498
+ },
7499
+ bounds: {
7500
+ left: clipRect.left - parentRect.left,
7501
+ top: clipRect.top - parentRect.top,
7502
+ right: clipRect.right - parentRect.left,
7503
+ bottom: clipRect.bottom - parentRect.top
7504
+ }
7505
+ });
7506
+ tooltip.style.left = `${x}px`;
7507
+ tooltip.style.top = `${y}px`;
7508
+ ownStyles.set(tooltip, tooltip.style.cssText);
7509
+ };
7510
+ const trackPointer = (event) => {
7511
+ pointer = {
7512
+ x: event.clientX,
7513
+ y: event.clientY
7514
+ };
7515
+ };
7516
+ const observer = new MutationObserver((records) => {
7517
+ const tooltips = /* @__PURE__ */ new Set();
7518
+ for (const record of records) {
7519
+ if (isTooltip(record.target)) tooltips.add(record.target);
7520
+ record.addedNodes.forEach((node) => isTooltip(node) && tooltips.add(node));
7521
+ }
7522
+ for (const tooltip of tooltips) if (ownStyles.get(tooltip) !== tooltip.style.cssText) place(tooltip);
7523
+ });
7524
+ container.addEventListener("mouseover", trackPointer, true);
7525
+ container.addEventListener("mousemove", trackPointer, true);
7526
+ observer.observe(container, {
7527
+ childList: true,
7528
+ subtree: true,
7529
+ attributes: true,
7530
+ attributeFilter: ["style"]
7531
+ });
7532
+ return () => {
7533
+ container.removeEventListener("mouseover", trackPointer, true);
7534
+ container.removeEventListener("mousemove", trackPointer, true);
7535
+ observer.disconnect();
7536
+ };
7537
+ }, [containerRef]);
7538
+ }
7539
+ //#endregion
7390
7540
  //#region src/charts/geo-chart/geo-chart.tsx
7391
7541
  /**
7392
7542
  * External dependencies
@@ -7429,6 +7579,23 @@ function involvesGeoChartErrorElement(node) {
7429
7579
  if (!(node instanceof HTMLElement)) return false;
7430
7580
  return node.id.startsWith(GOOGLE_CHARTS_ERROR_ID_PREFIX) || node.querySelector(`[id^="${GOOGLE_CHARTS_ERROR_ID_PREFIX}"]`) !== null;
7431
7581
  }
7582
+ const isTooltipColumn = (column) => typeof column === "object" && column !== null && "role" in column && column.role === "tooltip";
7583
+ const hasHtmlFlag = (columnOrCell) => typeof columnOrCell === "object" && columnOrCell !== null && "p" in columnOrCell && typeof columnOrCell.p === "object" && columnOrCell.p !== null && "html" in columnOrCell.p && !!columnOrCell.p.html;
7584
+ const sanitizeIfString = (value) => typeof value === "string" ? sanitizeHtml(value) : value;
7585
+ /**
7586
+ * Sanitizes a tooltip cell Google will render as markup, whether a string or a `{ v, f, p }` object.
7587
+ *
7588
+ * @param cell - The tooltip cell.
7589
+ * @return The cell with its markup sanitized.
7590
+ */
7591
+ function sanitizeTooltipCell(cell) {
7592
+ if (typeof cell !== "object" || cell === null) return sanitizeIfString(cell);
7593
+ return {
7594
+ ...cell,
7595
+ ..."v" in cell && { v: sanitizeIfString(cell.v) },
7596
+ ..."f" in cell && { f: sanitizeIfString(cell.f) }
7597
+ };
7598
+ }
7432
7599
  /**
7433
7600
  * Normalizes the raw Google Charts error event into the GeoChart error shape.
7434
7601
  *
@@ -7457,6 +7624,7 @@ function normalizeGeoChartError(eventArgs) {
7457
7624
  *
7458
7625
  * @param props - The props for the GeoChart component
7459
7626
  * @param props.data - Data in Google Charts format (array of arrays with headers)
7627
+ * @param props.ariaLabel - Accessible name of the chart
7460
7628
  * @param props.width - Width of the chart in pixels
7461
7629
  * @param props.height - Height of the chart in pixels
7462
7630
  * @param props.region - Region to display ('world', 'US', or ISO 3166-1 alpha-2 code)
@@ -7468,11 +7636,12 @@ function normalizeGeoChartError(eventArgs) {
7468
7636
  * @param props.renderPlaceholder - Optional render function for the loading placeholder
7469
7637
  * @return A React component displaying an interactive map with data visualization
7470
7638
  */
7471
- const GeoChartInternal = ({ className, data, width, height, region = "world", resolution = "countries", displayMode = "regions", domain, onError, renderPlaceholder }) => {
7639
+ const GeoChartInternal = ({ className, data, ariaLabel, width, height, region = "world", resolution = "countries", displayMode = "regions", domain, onError, renderPlaceholder }) => {
7472
7640
  const { getElementStyles } = useGlobalChartsContext();
7473
7641
  const scopeElement = useChartScopeElement();
7474
7642
  const containerRef = useRef(null);
7475
7643
  const reportedErrorIdsRef = useRef(/* @__PURE__ */ new Set());
7644
+ const [isLoaded, setIsLoaded] = useState(false);
7476
7645
  useEffect(() => {
7477
7646
  const container = containerRef.current;
7478
7647
  if (!onError || !container || typeof MutationObserver === "undefined") return;
@@ -7493,6 +7662,8 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7493
7662
  reportRenderedErrors();
7494
7663
  return () => observer.disconnect();
7495
7664
  }, [onError]);
7665
+ useTooltipPosition(containerRef);
7666
+ const handleLoad = useCallback(() => setIsLoaded(true), []);
7496
7667
  const loadingPlaceholder = /* @__PURE__ */ jsx(Center, {
7497
7668
  className: clsx("geo-chart", geo_chart_module_default.container, className),
7498
7669
  style: {
@@ -7506,28 +7677,18 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7506
7677
  const backgroundColorHex = normalizeColorToHex(CATALOG_POINTERS.background, scopeElement, resolveCssVariable) || DEFAULT_BACKGROUND_COLOR;
7507
7678
  const defaultFillColorHex = normalizeColorToHex(CATALOG_POINTERS.surfaceSecondary, scopeElement, resolveCssVariable) || DEFAULT_FEATURE_FILL_COLOR;
7508
7679
  const sanitizedData = useMemo(() => {
7509
- if (data.length === 0) return {
7510
- data,
7511
- hasHtmlTooltips: false
7512
- };
7513
- const htmlTooltipIndices = [];
7514
- for (let i = 0; i < data[0].length; i++) {
7515
- const col = data[0][i];
7516
- if (typeof col === "object" && col !== null && "role" in col && col.role === "tooltip" && "p" in col && typeof col.p === "object" && col.p !== null && "html" in col.p && col.p.html === true) htmlTooltipIndices.push(i);
7517
- }
7518
- if (htmlTooltipIndices.length === 0) return {
7519
- data,
7520
- hasHtmlTooltips: false
7521
- };
7680
+ if (data.length === 0) return data;
7681
+ const tooltipColumns = data[0].flatMap((column, index) => isTooltipColumn(column) ? [{
7682
+ index,
7683
+ isHtml: hasHtmlFlag(column)
7684
+ }] : []);
7685
+ if (tooltipColumns.length === 0) return data;
7522
7686
  const sanitizedRows = data.slice(1).map((row) => {
7523
7687
  const newRow = [...row];
7524
- for (const colIndex of htmlTooltipIndices) if (typeof newRow[colIndex] === "string") newRow[colIndex] = sanitizeHtml(newRow[colIndex]);
7688
+ for (const { index, isHtml } of tooltipColumns) if (isHtml || hasHtmlFlag(newRow[index])) newRow[index] = sanitizeTooltipCell(newRow[index]);
7525
7689
  return newRow;
7526
7690
  });
7527
- return {
7528
- data: [data[0], ...sanitizedRows],
7529
- hasHtmlTooltips: true
7530
- };
7691
+ return [data[0], ...sanitizedRows];
7531
7692
  }, [data]);
7532
7693
  const options = useMemo(() => ({
7533
7694
  ...region !== "world" && { region },
@@ -7540,7 +7701,7 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7540
7701
  defaultColor: defaultFillColorHex,
7541
7702
  tooltip: {
7542
7703
  trigger: "focus",
7543
- isHtml: sanitizedData.hasHtmlTooltips
7704
+ isHtml: true
7544
7705
  },
7545
7706
  legend: "none",
7546
7707
  keepAspectRatio: true
@@ -7552,35 +7713,42 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7552
7713
  lightColorHex,
7553
7714
  fullColorHex,
7554
7715
  backgroundColorHex,
7555
- defaultFillColorHex,
7556
- sanitizedData.hasHtmlTooltips
7716
+ defaultFillColorHex
7557
7717
  ]);
7558
7718
  const chartEvents = useMemo(() => {
7559
- if (!onError) return;
7560
- return [{
7719
+ const readyEvent = {
7720
+ eventName: "ready",
7721
+ callback: () => {
7722
+ containerRef.current?.querySelectorAll("svg").forEach((svg) => svg.setAttribute("aria-hidden", "true"));
7723
+ }
7724
+ };
7725
+ if (!onError) return [readyEvent];
7726
+ return [readyEvent, {
7561
7727
  eventName: "error",
7562
7728
  callback: ({ eventArgs }) => {
7563
7729
  onError(normalizeGeoChartError(eventArgs));
7564
7730
  }
7565
7731
  }];
7566
7732
  }, [onError]);
7567
- return /* @__PURE__ */ jsx(Center, {
7733
+ return /* @__PURE__ */ jsxs(Center, {
7568
7734
  ref: containerRef,
7735
+ role: "group",
7736
+ "aria-label": ariaLabel ?? __("Geo chart", "jetpack-charts"),
7569
7737
  className: clsx("geo-chart", geo_chart_module_default.container, className),
7570
7738
  style: {
7571
7739
  width,
7572
7740
  height
7573
7741
  },
7574
- children: /* @__PURE__ */ jsx(Chart, {
7742
+ children: [!isLoaded && loadingPlaceholder, /* @__PURE__ */ jsx(TooltipTheme, { children: /* @__PURE__ */ jsx(Chart, {
7575
7743
  chartType: "GeoChart",
7576
7744
  chartPackages: GEO_CHART_PACKAGES,
7577
7745
  width,
7578
7746
  height,
7579
- data: sanitizedData.data,
7747
+ data: sanitizedData,
7580
7748
  options,
7581
7749
  chartEvents,
7582
- loader: loadingPlaceholder
7583
- })
7750
+ onLoad: handleLoad
7751
+ }) })]
7584
7752
  });
7585
7753
  };
7586
7754
  const GeoChartWithProvider = (props) => {
@@ -7755,16 +7923,10 @@ const getNormalizedValue = (value, extent) => {
7755
7923
  return Math.min(1, Math.max(0, (value - min) / (max - min)));
7756
7924
  };
7757
7925
  const STEPS = 200;
7758
- const firstMeeting = (from, to, meets) => {
7759
- for (let step = 0; step <= STEPS; step++) {
7760
- const color = mixHexColors(from, to, step / STEPS);
7761
- if (meets(color)) return color;
7762
- }
7763
- return null;
7764
- };
7926
+ const ramp = (from, to) => Array.from({ length: 201 }, (_, step) => mixHexColors(from, to, step / STEPS));
7765
7927
  /**
7766
- * The two ends of the heatmap fill scale: 3:1 against the background and the empty cell at the
7767
- * low end, toward 9:1 against the background at the high end.
7928
+ * The two ends of the heatmap fill scale: toward 2.5:1 against the background and the empty cell at
7929
+ * the low end, never under 2:1 against the background or the high end, and toward 6:1 at the high end.
7768
7930
  *
7769
7931
  * @param primary - The resolved primary color, as six-digit hex.
7770
7932
  * @param background - The resolved chart background, as six-digit hex.
@@ -7772,16 +7934,19 @@ const firstMeeting = (from, to, meets) => {
7772
7934
  * @return The scale ends, as six-digit hex.
7773
7935
  */
7774
7936
  const getHeatmapScale = (primary, background, emptyCell) => {
7775
- const primaryStandsOut = contrastRatio(primary, background) >= 3;
7776
- const extreme = (primaryStandsOut ? relativeLuminance(primary) > relativeLuminance(background) : contrastRatio("#ffffff", background) > contrastRatio("#000000", background)) ? "#ffffff" : "#000000";
7777
- const lowAgainst = (references) => {
7778
- const meets = (color) => references.every((reference) => contrastRatio(color, reference) >= 3);
7779
- return (primaryStandsOut ? firstMeeting(background, primary, meets) : null) ?? firstMeeting(primary, extreme, meets);
7780
- };
7781
- const high = firstMeeting(primary, extreme, (color) => contrastRatio(color, background) >= 9) ?? extreme;
7782
- const againstEmptyCell = emptyCell ? lowAgainst([background, emptyCell]) : null;
7937
+ const backgroundLuminance = relativeLuminance(background);
7938
+ const ownSide = relativeLuminance(primary) > backgroundLuminance ? "#ffffff" : "#000000";
7939
+ const otherSide = ownSide === "#ffffff" ? "#000000" : "#ffffff";
7940
+ const extreme = contrastRatio(ownSide, background) >= 6 || contrastRatio(ownSide, background) >= contrastRatio(otherSide, background) ? ownSide : otherSide;
7941
+ const onExtremeSide = (color) => extreme === "#ffffff" ? relativeLuminance(color) > backgroundLuminance : relativeLuminance(color) < backgroundLuminance;
7942
+ const deepening = ramp(primary, extreme);
7943
+ const high = deepening.find((color) => contrastRatio(color, background) >= 6) ?? extreme;
7944
+ const path = [...ramp(background, primary), ...deepening];
7945
+ const spread = path.slice(0, path.indexOf(high) + 1).filter((color) => onExtremeSide(color) && contrastRatio(color, background) >= 2 && contrastRatio(color, high) >= 2);
7946
+ const surroundings = emptyCell ? [background, emptyCell] : [background];
7947
+ const weakest = (color) => Math.min(...surroundings.map((other) => contrastRatio(color, other)));
7783
7948
  return {
7784
- low: (againstEmptyCell && contrastRatio(againstEmptyCell, background) <= contrastRatio(high, background) ? againstEmptyCell : lowAgainst([background])) ?? extreme,
7949
+ low: spread.find((color) => weakest(color) >= 2.5) ?? spread.find((color) => weakest(color) >= 2) ?? spread.reduce((best, color) => weakest(color) > weakest(best) ? color : best),
7785
7950
  high
7786
7951
  };
7787
7952
  };
@@ -8120,7 +8285,7 @@ const CELL_VALUE_MODIFIER = {
8120
8285
  white: heatmap_chart_module_default["heatmap-chart__cell-value--white"]
8121
8286
  };
8122
8287
  const NO_ROW_LABELS = [];
8123
- const TOOLTIP_BOX_STYLE = { zIndex: 3 };
8288
+ const TOOLTIP_BOX_STYLE$1 = { zIndex: 3 };
8124
8289
  const largest = (root, selector, size) => Math.max(0, ...Array.from(root.querySelectorAll(selector), (el) => el[size]));
8125
8290
  const gridBox = (chart, grid) => {
8126
8291
  let height = chart.clientHeight;
@@ -8143,9 +8308,9 @@ const cellName = (info) => info.cellLabel || [
8143
8308
  const HeatmapChartInternal = ({ data, chartId: providedChartId, width = 0, height = 0, className, compact = false, fitCells = false, showValues, maxCellWidth, maxCellHeight, minCellWidth, minCellHeight, rowLabels = NO_ROW_LABELS, columnGroups, keyboardNavigation = "grid", ariaLabel, primaryColor, gap = "md", withTooltips = false, renderTooltip, tooltipStyle, children }) => {
8144
8309
  const chartId = useChartId(providedChartId);
8145
8310
  const tooltipBoxStyle = tooltipStyle ? {
8146
- ...TOOLTIP_BOX_STYLE,
8311
+ ...TOOLTIP_BOX_STYLE$1,
8147
8312
  ...tooltipStyle
8148
- } : TOOLTIP_BOX_STYLE;
8313
+ } : TOOLTIP_BOX_STYLE$1;
8149
8314
  const { getElementStyles, theme } = useGlobalChartsContext();
8150
8315
  const scopeElement = useChartScopeElement();
8151
8316
  const { heatmapChart: heatmapChartSettings } = theme;
@@ -9037,10 +9202,10 @@ function paramCase(input, options) {
9037
9202
  return dotCase(input, __assign({ delimiter: "-" }, options));
9038
9203
  }
9039
9204
  //#endregion
9040
- //#region ../../../node_modules/.pnpm/@wordpress+warning@3.55.0/node_modules/@wordpress/warning/build-module/utils.mjs
9205
+ //#region ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/utils.mjs
9041
9206
  var logged = /* @__PURE__ */ new Set();
9042
9207
  //#endregion
9043
- //#region ../../../node_modules/.pnpm/@wordpress+warning@3.55.0/node_modules/@wordpress/warning/build-module/index.mjs
9208
+ //#region ../../../node_modules/.pnpm/@wordpress+warning@3.57.0/node_modules/@wordpress/warning/build-module/index.mjs
9044
9209
  function isDev() {
9045
9210
  return globalThis.SCRIPT_DEBUG === true;
9046
9211
  }
@@ -9054,7 +9219,7 @@ function warning(message) {
9054
9219
  logged.add(message);
9055
9220
  }
9056
9221
  //#endregion
9057
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
9222
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
9058
9223
  function useUpdateEffect(effect, deps) {
9059
9224
  const mountedRef = useRef$1(false);
9060
9225
  useEffect$1(() => {
@@ -9878,356 +10043,6 @@ var createCache = function createCache(options) {
9878
10043
  return cache;
9879
10044
  };
9880
10045
  //#endregion
9881
- //#region ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
9882
- /** @license React v16.13.1
9883
- * react-is.production.min.js
9884
- *
9885
- * Copyright (c) Facebook, Inc. and its affiliates.
9886
- *
9887
- * This source code is licensed under the MIT license found in the
9888
- * LICENSE file in the root directory of this source tree.
9889
- */
9890
- var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((exports) => {
9891
- var b = "function" === typeof Symbol && Symbol.for;
9892
- var c = b ? Symbol.for("react.element") : 60103;
9893
- var d = b ? Symbol.for("react.portal") : 60106;
9894
- var e = b ? Symbol.for("react.fragment") : 60107;
9895
- var f = b ? Symbol.for("react.strict_mode") : 60108;
9896
- var g = b ? Symbol.for("react.profiler") : 60114;
9897
- var h = b ? Symbol.for("react.provider") : 60109;
9898
- var k = b ? Symbol.for("react.context") : 60110;
9899
- var l = b ? Symbol.for("react.async_mode") : 60111;
9900
- var m = b ? Symbol.for("react.concurrent_mode") : 60111;
9901
- var n = b ? Symbol.for("react.forward_ref") : 60112;
9902
- var p = b ? Symbol.for("react.suspense") : 60113;
9903
- var q = b ? Symbol.for("react.suspense_list") : 60120;
9904
- var r = b ? Symbol.for("react.memo") : 60115;
9905
- var t = b ? Symbol.for("react.lazy") : 60116;
9906
- var v = b ? Symbol.for("react.block") : 60121;
9907
- var w = b ? Symbol.for("react.fundamental") : 60117;
9908
- var x = b ? Symbol.for("react.responder") : 60118;
9909
- var y = b ? Symbol.for("react.scope") : 60119;
9910
- function z(a) {
9911
- if ("object" === typeof a && null !== a) {
9912
- var u = a.$$typeof;
9913
- switch (u) {
9914
- case c: switch (a = a.type, a) {
9915
- case l:
9916
- case m:
9917
- case e:
9918
- case g:
9919
- case f:
9920
- case p: return a;
9921
- default: switch (a = a && a.$$typeof, a) {
9922
- case k:
9923
- case n:
9924
- case t:
9925
- case r:
9926
- case h: return a;
9927
- default: return u;
9928
- }
9929
- }
9930
- case d: return u;
9931
- }
9932
- }
9933
- }
9934
- function A(a) {
9935
- return z(a) === m;
9936
- }
9937
- exports.AsyncMode = l;
9938
- exports.ConcurrentMode = m;
9939
- exports.ContextConsumer = k;
9940
- exports.ContextProvider = h;
9941
- exports.Element = c;
9942
- exports.ForwardRef = n;
9943
- exports.Fragment = e;
9944
- exports.Lazy = t;
9945
- exports.Memo = r;
9946
- exports.Portal = d;
9947
- exports.Profiler = g;
9948
- exports.StrictMode = f;
9949
- exports.Suspense = p;
9950
- exports.isAsyncMode = function(a) {
9951
- return A(a) || z(a) === l;
9952
- };
9953
- exports.isConcurrentMode = A;
9954
- exports.isContextConsumer = function(a) {
9955
- return z(a) === k;
9956
- };
9957
- exports.isContextProvider = function(a) {
9958
- return z(a) === h;
9959
- };
9960
- exports.isElement = function(a) {
9961
- return "object" === typeof a && null !== a && a.$$typeof === c;
9962
- };
9963
- exports.isForwardRef = function(a) {
9964
- return z(a) === n;
9965
- };
9966
- exports.isFragment = function(a) {
9967
- return z(a) === e;
9968
- };
9969
- exports.isLazy = function(a) {
9970
- return z(a) === t;
9971
- };
9972
- exports.isMemo = function(a) {
9973
- return z(a) === r;
9974
- };
9975
- exports.isPortal = function(a) {
9976
- return z(a) === d;
9977
- };
9978
- exports.isProfiler = function(a) {
9979
- return z(a) === g;
9980
- };
9981
- exports.isStrictMode = function(a) {
9982
- return z(a) === f;
9983
- };
9984
- exports.isSuspense = function(a) {
9985
- return z(a) === p;
9986
- };
9987
- exports.isValidElementType = function(a) {
9988
- return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
9989
- };
9990
- exports.typeOf = z;
9991
- }));
9992
- //#endregion
9993
- //#region ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js
9994
- /** @license React v16.13.1
9995
- * react-is.development.js
9996
- *
9997
- * Copyright (c) Facebook, Inc. and its affiliates.
9998
- *
9999
- * This source code is licensed under the MIT license found in the
10000
- * LICENSE file in the root directory of this source tree.
10001
- */
10002
- var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => {
10003
- if (process.env.NODE_ENV !== "production") (function() {
10004
- "use strict";
10005
- var hasSymbol = typeof Symbol === "function" && Symbol.for;
10006
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
10007
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
10008
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
10009
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
10010
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
10011
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
10012
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
10013
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
10014
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
10015
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
10016
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
10017
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
10018
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
10019
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
10020
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
10021
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
10022
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
10023
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
10024
- function isValidElementType(type) {
10025
- return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
10026
- }
10027
- function typeOf(object) {
10028
- if (typeof object === "object" && object !== null) {
10029
- var $$typeof = object.$$typeof;
10030
- switch ($$typeof) {
10031
- case REACT_ELEMENT_TYPE:
10032
- var type = object.type;
10033
- switch (type) {
10034
- case REACT_ASYNC_MODE_TYPE:
10035
- case REACT_CONCURRENT_MODE_TYPE:
10036
- case REACT_FRAGMENT_TYPE:
10037
- case REACT_PROFILER_TYPE:
10038
- case REACT_STRICT_MODE_TYPE:
10039
- case REACT_SUSPENSE_TYPE: return type;
10040
- default:
10041
- var $$typeofType = type && type.$$typeof;
10042
- switch ($$typeofType) {
10043
- case REACT_CONTEXT_TYPE:
10044
- case REACT_FORWARD_REF_TYPE:
10045
- case REACT_LAZY_TYPE:
10046
- case REACT_MEMO_TYPE:
10047
- case REACT_PROVIDER_TYPE: return $$typeofType;
10048
- default: return $$typeof;
10049
- }
10050
- }
10051
- case REACT_PORTAL_TYPE: return $$typeof;
10052
- }
10053
- }
10054
- }
10055
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
10056
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
10057
- var ContextConsumer = REACT_CONTEXT_TYPE;
10058
- var ContextProvider = REACT_PROVIDER_TYPE;
10059
- var Element = REACT_ELEMENT_TYPE;
10060
- var ForwardRef = REACT_FORWARD_REF_TYPE;
10061
- var Fragment = REACT_FRAGMENT_TYPE;
10062
- var Lazy = REACT_LAZY_TYPE;
10063
- var Memo = REACT_MEMO_TYPE;
10064
- var Portal = REACT_PORTAL_TYPE;
10065
- var Profiler = REACT_PROFILER_TYPE;
10066
- var StrictMode = REACT_STRICT_MODE_TYPE;
10067
- var Suspense = REACT_SUSPENSE_TYPE;
10068
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
10069
- function isAsyncMode(object) {
10070
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
10071
- hasWarnedAboutDeprecatedIsAsyncMode = true;
10072
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
10073
- }
10074
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
10075
- }
10076
- function isConcurrentMode(object) {
10077
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
10078
- }
10079
- function isContextConsumer(object) {
10080
- return typeOf(object) === REACT_CONTEXT_TYPE;
10081
- }
10082
- function isContextProvider(object) {
10083
- return typeOf(object) === REACT_PROVIDER_TYPE;
10084
- }
10085
- function isElement(object) {
10086
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10087
- }
10088
- function isForwardRef(object) {
10089
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
10090
- }
10091
- function isFragment(object) {
10092
- return typeOf(object) === REACT_FRAGMENT_TYPE;
10093
- }
10094
- function isLazy(object) {
10095
- return typeOf(object) === REACT_LAZY_TYPE;
10096
- }
10097
- function isMemo(object) {
10098
- return typeOf(object) === REACT_MEMO_TYPE;
10099
- }
10100
- function isPortal(object) {
10101
- return typeOf(object) === REACT_PORTAL_TYPE;
10102
- }
10103
- function isProfiler(object) {
10104
- return typeOf(object) === REACT_PROFILER_TYPE;
10105
- }
10106
- function isStrictMode(object) {
10107
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
10108
- }
10109
- function isSuspense(object) {
10110
- return typeOf(object) === REACT_SUSPENSE_TYPE;
10111
- }
10112
- exports.AsyncMode = AsyncMode;
10113
- exports.ConcurrentMode = ConcurrentMode;
10114
- exports.ContextConsumer = ContextConsumer;
10115
- exports.ContextProvider = ContextProvider;
10116
- exports.Element = Element;
10117
- exports.ForwardRef = ForwardRef;
10118
- exports.Fragment = Fragment;
10119
- exports.Lazy = Lazy;
10120
- exports.Memo = Memo;
10121
- exports.Portal = Portal;
10122
- exports.Profiler = Profiler;
10123
- exports.StrictMode = StrictMode;
10124
- exports.Suspense = Suspense;
10125
- exports.isAsyncMode = isAsyncMode;
10126
- exports.isConcurrentMode = isConcurrentMode;
10127
- exports.isContextConsumer = isContextConsumer;
10128
- exports.isContextProvider = isContextProvider;
10129
- exports.isElement = isElement;
10130
- exports.isForwardRef = isForwardRef;
10131
- exports.isFragment = isFragment;
10132
- exports.isLazy = isLazy;
10133
- exports.isMemo = isMemo;
10134
- exports.isPortal = isPortal;
10135
- exports.isProfiler = isProfiler;
10136
- exports.isStrictMode = isStrictMode;
10137
- exports.isSuspense = isSuspense;
10138
- exports.isValidElementType = isValidElementType;
10139
- exports.typeOf = typeOf;
10140
- })();
10141
- }));
10142
- //#endregion
10143
- //#region ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js
10144
- var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10145
- if (process.env.NODE_ENV === "production") module.exports = require_react_is_production_min();
10146
- else module.exports = require_react_is_development();
10147
- }));
10148
- //#endregion
10149
- //#region ../../../node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
10150
- var require_hoist_non_react_statics_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10151
- var reactIs = require_react_is();
10152
- /**
10153
- * Copyright 2015, Yahoo! Inc.
10154
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
10155
- */
10156
- var REACT_STATICS = {
10157
- childContextTypes: true,
10158
- contextType: true,
10159
- contextTypes: true,
10160
- defaultProps: true,
10161
- displayName: true,
10162
- getDefaultProps: true,
10163
- getDerivedStateFromError: true,
10164
- getDerivedStateFromProps: true,
10165
- mixins: true,
10166
- propTypes: true,
10167
- type: true
10168
- };
10169
- var KNOWN_STATICS = {
10170
- name: true,
10171
- length: true,
10172
- prototype: true,
10173
- caller: true,
10174
- callee: true,
10175
- arguments: true,
10176
- arity: true
10177
- };
10178
- var FORWARD_REF_STATICS = {
10179
- "$$typeof": true,
10180
- render: true,
10181
- defaultProps: true,
10182
- displayName: true,
10183
- propTypes: true
10184
- };
10185
- var MEMO_STATICS = {
10186
- "$$typeof": true,
10187
- compare: true,
10188
- defaultProps: true,
10189
- displayName: true,
10190
- propTypes: true,
10191
- type: true
10192
- };
10193
- var TYPE_STATICS = {};
10194
- TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
10195
- TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
10196
- function getStatics(component) {
10197
- if (reactIs.isMemo(component)) return MEMO_STATICS;
10198
- return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
10199
- }
10200
- var defineProperty = Object.defineProperty;
10201
- var getOwnPropertyNames = Object.getOwnPropertyNames;
10202
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
10203
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
10204
- var getPrototypeOf = Object.getPrototypeOf;
10205
- var objectPrototype = Object.prototype;
10206
- function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
10207
- if (typeof sourceComponent !== "string") {
10208
- if (objectPrototype) {
10209
- var inheritedComponent = getPrototypeOf(sourceComponent);
10210
- if (inheritedComponent && inheritedComponent !== objectPrototype) hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
10211
- }
10212
- var keys = getOwnPropertyNames(sourceComponent);
10213
- if (getOwnPropertySymbols) keys = keys.concat(getOwnPropertySymbols(sourceComponent));
10214
- var targetStatics = getStatics(targetComponent);
10215
- var sourceStatics = getStatics(sourceComponent);
10216
- for (var i = 0; i < keys.length; ++i) {
10217
- var key = keys[i];
10218
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
10219
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
10220
- try {
10221
- defineProperty(targetComponent, key, descriptor);
10222
- } catch (e) {}
10223
- }
10224
- }
10225
- }
10226
- return targetComponent;
10227
- }
10228
- module.exports = hoistNonReactStatics;
10229
- }));
10230
- //#endregion
10231
10046
  //#region ../../../node_modules/.pnpm/@emotion+utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
10232
10047
  function getRegisteredStyles$1(registered, registeredStyles, classNames) {
10233
10048
  var rawClassName = "";
@@ -10327,7 +10142,7 @@ var unitlessKeys = {
10327
10142
  };
10328
10143
  //#endregion
10329
10144
  //#region ../../../node_modules/.pnpm/@emotion+serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
10330
- var isDevelopment$1 = false;
10145
+ var isDevelopment = false;
10331
10146
  var hyphenateRegex = /[A-Z]|^ms/g;
10332
10147
  var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
10333
10148
  var isCustomProperty = function isCustomProperty(property) {
@@ -10407,7 +10222,7 @@ function createStringFromObject(mergedProps, registered, obj) {
10407
10222
  if (registered != null && registered[asString] !== void 0) string += key + "{" + registered[asString] + "}";
10408
10223
  else if (isProcessableValue(asString)) string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
10409
10224
  } else {
10410
- if (key === "NO_COMPONENT_SELECTOR" && isDevelopment$1) throw new Error(noComponentSelectorMessage);
10225
+ if (key === "NO_COMPONENT_SELECTOR" && isDevelopment) throw new Error(noComponentSelectorMessage);
10411
10226
  if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
10412
10227
  for (var _i = 0; _i < value.length; _i++) if (isProcessableValue(value[_i])) string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
10413
10228
  } else {
@@ -10450,80 +10265,15 @@ function serializeStyles(args, registered, mergedProps) {
10450
10265
  next: cursor
10451
10266
  };
10452
10267
  }
10268
+ React["useInsertionEffect"] && React["useInsertionEffect"] || React.useLayoutEffect;
10453
10269
  //#endregion
10454
- //#region ../../../node_modules/.pnpm/@emotion+use-insertion-effect-with-fallbacks@1.2.0_react@18.3.1/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
10455
- var syncFallback = function syncFallback(create) {
10456
- return create();
10457
- };
10458
- var useInsertionEffect = React["useInsertionEffect"] ? React["useInsertionEffect"] : false;
10459
- var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
10460
- useInsertionEffect || React.useLayoutEffect;
10270
+ //#region ../../../node_modules/.pnpm/@emotion+react@11.14.0_@types+react@18.3.31_react@18.3.1/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js
10461
10271
  var EmotionCacheContext = /* #__PURE__ */ React.createContext(typeof HTMLElement !== "undefined" ? /* #__PURE__ */ createCache({ key: "css" }) : null);
10462
10272
  EmotionCacheContext.Provider;
10463
10273
  var __unsafe_useEmotionCache = function useEmotionCache() {
10464
10274
  return useContext(EmotionCacheContext);
10465
10275
  };
10466
- var withEmotionCache = function withEmotionCache(func) {
10467
- return /*#__PURE__*/ forwardRef(function(props, ref) {
10468
- return func(props, useContext(EmotionCacheContext), ref);
10469
- });
10470
- };
10471
- var ThemeContext = /* #__PURE__ */ React.createContext({});
10472
- var hasOwn = {}.hasOwnProperty;
10473
- var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
10474
- var createEmotionProps = function createEmotionProps(type, props) {
10475
- var newProps = {};
10476
- for (var _key in props) if (hasOwn.call(props, _key)) newProps[_key] = props[_key];
10477
- newProps[typePropName] = type;
10478
- return newProps;
10479
- };
10480
- var Insertion = function Insertion(_ref) {
10481
- var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag;
10482
- registerStyles(cache, serialized, isStringTag);
10483
- useInsertionEffectAlwaysWithSyncFallback(function() {
10484
- return insertStyles(cache, serialized, isStringTag);
10485
- });
10486
- return null;
10487
- };
10488
- var Emotion$1 = /* @__PURE__ */ withEmotionCache(function(props, cache, ref) {
10489
- var cssProp = props.css;
10490
- if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) cssProp = cache.registered[cssProp];
10491
- var WrappedComponent = props[typePropName];
10492
- var registeredStyles = [cssProp];
10493
- var className = "";
10494
- if (typeof props.className === "string") className = getRegisteredStyles$1(cache.registered, registeredStyles, props.className);
10495
- else if (props.className != null) className = props.className + " ";
10496
- var serialized = serializeStyles(registeredStyles, void 0, React.useContext(ThemeContext));
10497
- className += cache.key + "-" + serialized.name;
10498
- var newProps = {};
10499
- for (var _key2 in props) if (hasOwn.call(props, _key2) && _key2 !== "css" && _key2 !== typePropName && true) newProps[_key2] = props[_key2];
10500
- newProps.className = className;
10501
- if (ref) newProps.ref = ref;
10502
- return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Insertion, {
10503
- cache,
10504
- serialized,
10505
- isStringTag: typeof WrappedComponent === "string"
10506
- }), /*#__PURE__*/ React.createElement(WrappedComponent, newProps));
10507
- });
10508
- require_hoist_non_react_statics_cjs();
10509
- var jsx$1 = function jsx(type, props) {
10510
- var args = arguments;
10511
- if (props == null || !hasOwn.call(props, "css")) return React.createElement.apply(void 0, args);
10512
- var argsLength = args.length;
10513
- var createElementArgArray = new Array(argsLength);
10514
- createElementArgArray[0] = Emotion$1;
10515
- createElementArgArray[1] = createEmotionProps(type, props);
10516
- for (var i = 2; i < argsLength; i++) createElementArgArray[i] = args[i];
10517
- return React.createElement.apply(null, createElementArgArray);
10518
- };
10519
- (function(_jsx) {
10520
- var JSX;
10521
- JSX || (JSX = _jsx.JSX || (_jsx.JSX = {}));
10522
- })(jsx$1 || (jsx$1 = {}));
10523
- function css$1() {
10524
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
10525
- return serializeStyles(args);
10526
- }
10276
+ ({}).hasOwnProperty;
10527
10277
  //#endregion
10528
10278
  //#region ../../../node_modules/.pnpm/@emotion+css@11.13.5/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
10529
10279
  function insertWithoutScoping(cache, serialized) {
@@ -10624,7 +10374,7 @@ _createEmotion.css;
10624
10374
  _createEmotion.sheet;
10625
10375
  _createEmotion.cache;
10626
10376
  //#endregion
10627
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
10377
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
10628
10378
  var isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
10629
10379
  var useCx = () => {
10630
10380
  const cache = __unsafe_useEmotionCache();
@@ -10731,140 +10481,7 @@ function memize(fn, options) {
10731
10481
  return memoized;
10732
10482
  }
10733
10483
  //#endregion
10734
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/colors-values.mjs
10735
- var white = "#fff";
10736
- var GRAY = {
10737
- 900: "#1e1e1e",
10738
- 800: "#2f2f2f",
10739
- /** Meets 4.6:1 text contrast against white. */
10740
- 700: "#757575",
10741
- /** Meets 3:1 UI or large text contrast against white. */
10742
- 600: "#949494",
10743
- 400: "#ccc",
10744
- /** Used for most borders. */
10745
- 300: "#ddd",
10746
- /** Used sparingly for light borders. */
10747
- 200: "#e0e0e0",
10748
- /** Used for light gray backgrounds. */
10749
- 100: "#f0f0f0"
10750
- };
10751
- var ALERT = {
10752
- yellow: "#f0b849",
10753
- red: "#d94f4f",
10754
- green: "#4ab866"
10755
- };
10756
- var THEME = {
10757
- accent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,
10758
- accentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,
10759
- accentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,
10760
- /** Used when placing text on the accent color. */
10761
- accentInverted: `var(--wp-components-color-accent-inverted, var(--wpds-color-foreground-interactive-brand-strong, #fff))`,
10762
- background: `var(--wp-components-color-background, var(--wpds-color-background-surface-neutral-strong, #fff))`,
10763
- foreground: `var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
10764
- /** Used when placing text on the foreground color. */
10765
- foregroundInverted: `var(--wp-components-color-foreground-inverted, var(--wpds-color-background-surface-neutral, #fcfcfc))`,
10766
- gray: {
10767
- /** @deprecated Use `COLORS.theme.foreground` instead. */
10768
- 900: `var(--wp-components-color-foreground, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
10769
- 800: `var(--wp-components-color-gray-800, var(--wpds-color-foreground-content-neutral, #1e1e1e))`,
10770
- 700: `var(--wp-components-color-gray-700, var(--wpds-color-foreground-content-neutral-weak, #707070))`,
10771
- 600: `var(--wp-components-color-gray-600, var(--wpds-color-stroke-interactive-neutral, #8d8d8d))`,
10772
- 400: `var(--wp-components-color-gray-400, var(--wpds-color-stroke-interactive-neutral, #8d8d8d))`,
10773
- 300: `var(--wp-components-color-gray-300, var(--wpds-color-stroke-surface-neutral, #dbdbdb))`,
10774
- 200: `var(--wp-components-color-gray-200, var(--wpds-color-stroke-surface-neutral, #dbdbdb))`,
10775
- 100: `var(--wp-components-color-gray-100, var(--wpds-color-background-surface-neutral, #fcfcfc))`
10776
- }
10777
- };
10778
- var UI = {
10779
- background: THEME.background,
10780
- backgroundDisabled: THEME.gray[100],
10781
- border: THEME.gray[600],
10782
- borderHover: THEME.gray[700],
10783
- borderFocus: THEME.accent,
10784
- borderDisabled: `var(--wpds-color-stroke-interactive-neutral-disabled, #dbdbdb)`,
10785
- textDisabled: `var(--wpds-color-foreground-interactive-neutral-disabled, #8d8d8d)`,
10786
- darkGrayPlaceholder: `color-mix(in srgb, ${THEME.foreground}, transparent 38%)`,
10787
- lightGrayPlaceholder: `color-mix(in srgb, ${THEME.background}, transparent 35%)`
10788
- };
10789
- var COLORS = Object.freeze({
10790
- /**
10791
- * The main gray color object.
10792
- *
10793
- * @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`.
10794
- */
10795
- gray: GRAY,
10796
- /**
10797
- * @deprecated Prefer theme-ready variables in `COLORS.theme`.
10798
- */
10799
- white,
10800
- alert: ALERT,
10801
- /**
10802
- * Theme-ready variables with fallbacks.
10803
- *
10804
- * Prefer semantic aliases in `COLORS.ui` when applicable.
10805
- */
10806
- theme: THEME,
10807
- /**
10808
- * Semantic aliases (prefer these over raw variables when applicable).
10809
- */
10810
- ui: UI
10811
- });
10812
- //#endregion
10813
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/config-values.mjs
10814
- var CONTROL_HEIGHT = "36px";
10815
- var CONTROL_PROPS = {
10816
- controlPaddingX: 12,
10817
- controlPaddingXSmall: 8,
10818
- controlPaddingXLarge: 12 * 1.3334,
10819
- controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,
10820
- controlHeight: CONTROL_HEIGHT,
10821
- controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,
10822
- controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,
10823
- controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,
10824
- controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`
10825
- };
10826
- var config_values_default = Object.assign({}, CONTROL_PROPS, {
10827
- colorDivider: "rgba(0, 0, 0, 0.1)",
10828
- elevationIntensity: 1,
10829
- radiusXSmall: "1px",
10830
- radiusSmall: "2px",
10831
- radiusMedium: "4px",
10832
- radiusLarge: "8px",
10833
- radiusFull: "9999px",
10834
- radiusRound: "50%",
10835
- borderWidth: "1px",
10836
- borderWidthFocus: "1.5px",
10837
- borderWidthTab: "4px",
10838
- fontSize: "13px",
10839
- fontSizeH1: "calc(2.44 * 13px)",
10840
- fontSizeH2: "calc(1.95 * 13px)",
10841
- fontSizeH3: "calc(1.56 * 13px)",
10842
- fontSizeH4: "calc(1.25 * 13px)",
10843
- fontSizeH5: "13px",
10844
- fontSizeH6: "calc(0.8 * 13px)",
10845
- fontSizeInputMobile: "16px",
10846
- fontSizeMobile: "15px",
10847
- fontSizeSmall: "calc(0.92 * 13px)",
10848
- fontSizeXSmall: "calc(0.75 * 13px)",
10849
- fontLineHeightBase: "1.4",
10850
- fontWeight: "normal",
10851
- fontWeightEmphasis: "600",
10852
- gridBase: "4px",
10853
- elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,
10854
- elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
10855
- elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,
10856
- elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,
10857
- surfaceBorderColor: "rgba(0, 0, 0, 0.1)",
10858
- surfaceColor: COLORS.white,
10859
- transitionDuration: "200ms",
10860
- transitionDurationFast: "160ms",
10861
- transitionDurationFaster: "120ms",
10862
- transitionDurationFastest: "100ms",
10863
- transitionTimingFunction: "cubic-bezier(0.08, 0.52, 0.52, 1)",
10864
- transitionTimingFunctionControl: "cubic-bezier(0.12, 0.8, 0.32, 1)"
10865
- });
10866
- //#endregion
10867
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
10484
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
10868
10485
  var import_es6 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
10869
10486
  module.exports = function equal(a, b) {
10870
10487
  if (a === b) return true;
@@ -10932,18 +10549,18 @@ var BaseContextSystemProvider = ({ children, value }) => {
10932
10549
  };
10933
10550
  memo(BaseContextSystemProvider);
10934
10551
  //#endregion
10935
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/constants.mjs
10552
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/constants.mjs
10936
10553
  var COMPONENT_NAMESPACE = "data-wp-component";
10937
10554
  var CONNECTED_NAMESPACE = "data-wp-c16t";
10938
10555
  var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
10939
10556
  //#endregion
10940
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
10557
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
10941
10558
  function getStyledClassName(namespace) {
10942
10559
  return `components-${paramCase(namespace)}`;
10943
10560
  }
10944
10561
  var getStyledClassNameFromKey = memize(getStyledClassName);
10945
10562
  //#endregion
10946
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/context-connect.mjs
10563
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/context-connect.mjs
10947
10564
  function contextConnect(Component, namespace) {
10948
10565
  return _contextConnect(Component, namespace, { forwardsRef: true });
10949
10566
  }
@@ -10960,7 +10577,7 @@ function _contextConnect(Component, namespace, options) {
10960
10577
  });
10961
10578
  }
10962
10579
  //#endregion
10963
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/utils.mjs
10580
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/utils.mjs
10964
10581
  function getNamespace(componentName) {
10965
10582
  return { [COMPONENT_NAMESPACE]: componentName };
10966
10583
  }
@@ -10968,7 +10585,7 @@ function getConnectedNamespace() {
10968
10585
  return { [CONNECTED_NAMESPACE]: true };
10969
10586
  }
10970
10587
  //#endregion
10971
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
10588
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
10972
10589
  function useContextSystem(props, namespace) {
10973
10590
  const contextSystemProps = useComponentsContext();
10974
10591
  if (typeof namespace === "undefined") globalThis.SCRIPT_DEBUG === true && warning("useContextSystem: Please provide a namespace");
@@ -10990,7 +10607,7 @@ function useContextSystem(props, namespace) {
10990
10607
  return finalComponentProps;
10991
10608
  }
10992
10609
  //#endregion
10993
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
10610
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/visually-hidden/styles.mjs
10994
10611
  var visuallyHidden = {
10995
10612
  border: 0,
10996
10613
  clip: "rect(1px, 1px, 1px, 1px)",
@@ -11006,7 +10623,7 @@ var visuallyHidden = {
11006
10623
  wordBreak: "normal"
11007
10624
  };
11008
10625
  //#endregion
11009
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
10626
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/utils/polymorphic-element.mjs
11010
10627
  var customAttributeRegExp = /^(data|aria|x)-/i;
11011
10628
  var eventHandlerRegExp = /^on[A-Z]/;
11012
10629
  var svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse
@@ -11096,7 +10713,7 @@ function UnforwardedPolymorphicElement({ as, ...props }, ref) {
11096
10713
  }
11097
10714
  var PolymorphicElement = forwardRef$1(UnforwardedPolymorphicElement);
11098
10715
  //#endregion
11099
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/view/component.mjs
10716
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/view/component.mjs
11100
10717
  function UnforwardedView({ css, ...restProps }, ref) {
11101
10718
  return /* @__PURE__ */ jsx(PolymorphicElement, {
11102
10719
  ref,
@@ -11105,7 +10722,7 @@ function UnforwardedView({ css, ...restProps }, ref) {
11105
10722
  }
11106
10723
  var component_default$2 = Object.assign(forwardRef$1(UnforwardedView), { selector: ".components-view" });
11107
10724
  //#endregion
11108
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
10725
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/visually-hidden/component.mjs
11109
10726
  function UnconnectedVisuallyHidden(props, forwardedRef) {
11110
10727
  const { style: styleProp, ...contextProps } = useContextSystem(props, "VisuallyHidden");
11111
10728
  return /* @__PURE__ */ jsx(component_default$2, {
@@ -11120,18 +10737,19 @@ function UnconnectedVisuallyHidden(props, forwardedRef) {
11120
10737
  }
11121
10738
  var component_default$1 = contextConnect(UnconnectedVisuallyHidden, "VisuallyHidden");
11122
10739
  //#endregion
11123
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
10740
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
11124
10741
  var breakpoints = [
11125
10742
  "40em",
11126
10743
  "52em",
11127
10744
  "64em"
11128
10745
  ];
11129
10746
  var useBreakpointIndex = (options = {}) => {
11130
- const { defaultIndex = 0 } = options;
10747
+ const { defaultIndex = 0, enabled = true } = options;
11131
10748
  if (typeof defaultIndex !== "number") throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
11132
10749
  else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
11133
10750
  const [value, setValue] = useState$1(defaultIndex);
11134
10751
  useEffect$1(() => {
10752
+ if (!enabled) return;
11135
10753
  const getIndex = () => breakpoints.filter((bp) => {
11136
10754
  return typeof window !== "undefined" ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
11137
10755
  }).length;
@@ -11144,17 +10762,21 @@ var useBreakpointIndex = (options = {}) => {
11144
10762
  return () => {
11145
10763
  if (typeof window !== "undefined") window.removeEventListener("resize", onResize);
11146
10764
  };
11147
- }, [value]);
10765
+ }, [value, enabled]);
11148
10766
  return value;
11149
10767
  };
11150
10768
  function useResponsiveValue(values, options = {}) {
11151
- const index = useBreakpointIndex(options);
10769
+ const isResponsive = Array.isArray(values) && values.length > 1;
10770
+ const index = useBreakpointIndex({
10771
+ ...options,
10772
+ enabled: isResponsive
10773
+ });
11152
10774
  if (!Array.isArray(values) && typeof values !== "function") return values;
11153
10775
  const array = values || [];
11154
10776
  return array[index >= array.length ? array.length - 1 : index];
11155
10777
  }
11156
10778
  //#endregion
11157
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/grid/utils.mjs
10779
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/grid/utils.mjs
11158
10780
  var ALIGNMENTS = {
11159
10781
  bottom: {
11160
10782
  alignItems: "flex-end",
@@ -11199,52 +10821,155 @@ var ALIGNMENTS = {
11199
10821
  }
11200
10822
  };
11201
10823
  function getAlignmentProps(alignment) {
11202
- return alignment ? ALIGNMENTS[alignment] : {};
10824
+ return alignment ? ALIGNMENTS[alignment] ?? {} : {};
11203
10825
  }
11204
10826
  //#endregion
11205
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/grid/hook.mjs
10827
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/grid/hook.mjs
10828
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
10829
+ function getRuntime() {
10830
+ const globalScope = globalThis;
10831
+ if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
10832
+ globalScope.__wpStyleRuntime = {
10833
+ documents: /* @__PURE__ */ new Map(),
10834
+ styles: /* @__PURE__ */ new Map(),
10835
+ injectedStyles: /* @__PURE__ */ new WeakMap()
10836
+ };
10837
+ if (typeof document !== "undefined") registerDocument(document);
10838
+ return globalScope.__wpStyleRuntime;
10839
+ }
10840
+ function documentContainsStyleHash(targetDocument, hash) {
10841
+ if (!targetDocument.head) return false;
10842
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) return true;
10843
+ return false;
10844
+ }
10845
+ function injectStyle(targetDocument, hash, css) {
10846
+ if (!targetDocument.head) return;
10847
+ const runtime = getRuntime();
10848
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
10849
+ if (!injectedStyles) {
10850
+ injectedStyles = /* @__PURE__ */ new Set();
10851
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
10852
+ }
10853
+ if (injectedStyles.has(hash)) return;
10854
+ if (documentContainsStyleHash(targetDocument, hash)) {
10855
+ injectedStyles.add(hash);
10856
+ return;
10857
+ }
10858
+ const style = targetDocument.createElement("style");
10859
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
10860
+ style.appendChild(targetDocument.createTextNode(css));
10861
+ targetDocument.head.appendChild(style);
10862
+ injectedStyles.add(hash);
10863
+ }
10864
+ function registerDocument(targetDocument) {
10865
+ const runtime = getRuntime();
10866
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
10867
+ for (const [hash, css] of runtime.styles) injectStyle(targetDocument, hash, css);
10868
+ return () => {
10869
+ const count = runtime.documents.get(targetDocument);
10870
+ if (count === void 0) return;
10871
+ if (count <= 1) {
10872
+ runtime.documents.delete(targetDocument);
10873
+ return;
10874
+ }
10875
+ runtime.documents.set(targetDocument, count - 1);
10876
+ };
10877
+ }
10878
+ function registerStyle(hash, css) {
10879
+ const runtime = getRuntime();
10880
+ runtime.styles.set(hash, css);
10881
+ for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
10882
+ }
10883
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("79bac25858", "._631b7063b4047c89__grid{--wp-components-grid-align:initial;--wp-components-grid-justify:initial;--wp-components-grid-gap:initial;--wp-components-grid-template-columns:initial;--wp-components-grid-template-rows:initial;--wp-components-grid-row-gap:initial;--wp-components-grid-column-gap:initial;display:grid}._631b7063b4047c89__grid:not(:where(._51fa5e5688d538e7__row-gap-inherit,._3940112538797bb2__row-gap-initial,._9dc0e80dad95eb11__row-gap-unset,._964ec4132d3d0776__row-gap-revert,._9219888d7c4749d5__row-gap-revert-layer)){row-gap:var(--wp-components-grid-row-gap,calc(4px*var(--wp-components-grid-gap)))}._631b7063b4047c89__grid:not(:where(._149fd947497e8690__column-gap-inherit,.a018e74b0f04c517__column-gap-initial,.b1e45f9587eb70e5__column-gap-unset,._4da312511f64af94__column-gap-revert,.b51ead67217c210a__column-gap-revert-layer)){column-gap:var(--wp-components-grid-column-gap,calc(4px*var(--wp-components-grid-gap)))}._4cae76607d36422b__has-align:not(:where(._2c693b642b24e0d9__align-inherit,.fd4c5676ad7e83d4__align-initial,.c4c0cde44ab0ed21__align-unset,._8c23efb61db2f04e__align-revert,.c3adc4c41efa56d1__align-revert-layer)){align-items:var(--wp-components-grid-align)}._9bcd99517d001b4b__has-justify:not(:where(.a72d35ee0eda5e6b__justify-inherit,.d386403fd02ebc45__justify-initial,._7d60510a69e8ddf9__justify-unset,._857dfb6521d0cae3__justify-revert,._1537fff8402f1ca1__justify-revert-layer)){justify-content:var(--wp-components-grid-justify)}._983f7df07cd35a72__has-template-columns:not(:where(.df2216db1a717825__template-columns-inherit,._9016934ed273a0b8__template-columns-initial,._74966333f352d829__template-columns-unset,.b3ce45d005011688__template-columns-revert,._9ff0250b9bed5764__template-columns-revert-layer)){grid-template-columns:var(--wp-components-grid-template-columns)}._7e0fa0c081c20f6e__has-template-rows:not(:where(._10cfd24f62672d27__template-rows-inherit,.da1333be6b2af8c3__template-rows-initial,._919938d55c0cf234__template-rows-unset,.db40efe5796b7ffb__template-rows-revert,._1080cc5b99823c58__template-rows-revert-layer)){grid-template-rows:var(--wp-components-grid-template-rows)}.f4729d54fca65af1__is-inline{display:inline-grid;vertical-align:middle}._2c693b642b24e0d9__align-inherit{align-items:inherit}.fd4c5676ad7e83d4__align-initial{align-items:normal}.c4c0cde44ab0ed21__align-unset{align-items:unset}._8c23efb61db2f04e__align-revert{align-items:revert}.c3adc4c41efa56d1__align-revert-layer{align-items:revert-layer}.a72d35ee0eda5e6b__justify-inherit{justify-content:inherit}.d386403fd02ebc45__justify-initial{justify-content:normal}._7d60510a69e8ddf9__justify-unset{justify-content:unset}._857dfb6521d0cae3__justify-revert{justify-content:revert}._1537fff8402f1ca1__justify-revert-layer{justify-content:revert-layer}.df2216db1a717825__template-columns-inherit{grid-template-columns:inherit}._9016934ed273a0b8__template-columns-initial{grid-template-columns:none}._74966333f352d829__template-columns-unset{grid-template-columns:unset}.b3ce45d005011688__template-columns-revert{grid-template-columns:revert}._9ff0250b9bed5764__template-columns-revert-layer{grid-template-columns:revert-layer}._10cfd24f62672d27__template-rows-inherit{grid-template-rows:inherit}.da1333be6b2af8c3__template-rows-initial{grid-template-rows:none}._919938d55c0cf234__template-rows-unset{grid-template-rows:unset}.db40efe5796b7ffb__template-rows-revert{grid-template-rows:revert}._1080cc5b99823c58__template-rows-revert-layer{grid-template-rows:revert-layer}._51fa5e5688d538e7__row-gap-inherit{row-gap:inherit}._3940112538797bb2__row-gap-initial{row-gap:normal}._9dc0e80dad95eb11__row-gap-unset{row-gap:unset}._964ec4132d3d0776__row-gap-revert{row-gap:revert}._9219888d7c4749d5__row-gap-revert-layer{row-gap:revert-layer}._149fd947497e8690__column-gap-inherit{column-gap:inherit}.a018e74b0f04c517__column-gap-initial{column-gap:normal}.b1e45f9587eb70e5__column-gap-unset{column-gap:unset}._4da312511f64af94__column-gap-revert{column-gap:revert}.b51ead67217c210a__column-gap-revert-layer{column-gap:revert-layer}");
10884
+ var style_module_default = {
10885
+ "grid": "_631b7063b4047c89__grid",
10886
+ "row-gap-inherit": "_51fa5e5688d538e7__row-gap-inherit",
10887
+ "row-gap-initial": "_3940112538797bb2__row-gap-initial",
10888
+ "row-gap-unset": "_9dc0e80dad95eb11__row-gap-unset",
10889
+ "row-gap-revert": "_964ec4132d3d0776__row-gap-revert",
10890
+ "row-gap-revert-layer": "_9219888d7c4749d5__row-gap-revert-layer",
10891
+ "column-gap-inherit": "_149fd947497e8690__column-gap-inherit",
10892
+ "column-gap-initial": "a018e74b0f04c517__column-gap-initial",
10893
+ "column-gap-unset": "b1e45f9587eb70e5__column-gap-unset",
10894
+ "column-gap-revert": "_4da312511f64af94__column-gap-revert",
10895
+ "column-gap-revert-layer": "b51ead67217c210a__column-gap-revert-layer",
10896
+ "has-align": "_4cae76607d36422b__has-align",
10897
+ "align-inherit": "_2c693b642b24e0d9__align-inherit",
10898
+ "align-initial": "fd4c5676ad7e83d4__align-initial",
10899
+ "align-unset": "c4c0cde44ab0ed21__align-unset",
10900
+ "align-revert": "_8c23efb61db2f04e__align-revert",
10901
+ "align-revert-layer": "c3adc4c41efa56d1__align-revert-layer",
10902
+ "has-justify": "_9bcd99517d001b4b__has-justify",
10903
+ "justify-inherit": "a72d35ee0eda5e6b__justify-inherit",
10904
+ "justify-initial": "d386403fd02ebc45__justify-initial",
10905
+ "justify-unset": "_7d60510a69e8ddf9__justify-unset",
10906
+ "justify-revert": "_857dfb6521d0cae3__justify-revert",
10907
+ "justify-revert-layer": "_1537fff8402f1ca1__justify-revert-layer",
10908
+ "has-template-columns": "_983f7df07cd35a72__has-template-columns",
10909
+ "template-columns-inherit": "df2216db1a717825__template-columns-inherit",
10910
+ "template-columns-initial": "_9016934ed273a0b8__template-columns-initial",
10911
+ "template-columns-unset": "_74966333f352d829__template-columns-unset",
10912
+ "template-columns-revert": "b3ce45d005011688__template-columns-revert",
10913
+ "template-columns-revert-layer": "_9ff0250b9bed5764__template-columns-revert-layer",
10914
+ "has-template-rows": "_7e0fa0c081c20f6e__has-template-rows",
10915
+ "template-rows-inherit": "_10cfd24f62672d27__template-rows-inherit",
10916
+ "template-rows-initial": "da1333be6b2af8c3__template-rows-initial",
10917
+ "template-rows-unset": "_919938d55c0cf234__template-rows-unset",
10918
+ "template-rows-revert": "db40efe5796b7ffb__template-rows-revert",
10919
+ "template-rows-revert-layer": "_1080cc5b99823c58__template-rows-revert-layer",
10920
+ "is-inline": "f4729d54fca65af1__is-inline"
10921
+ };
10922
+ var CSS_WIDE_KEYWORDS = /* @__PURE__ */ new Set([
10923
+ "inherit",
10924
+ "initial",
10925
+ "unset",
10926
+ "revert",
10927
+ "revert-layer"
10928
+ ]);
10929
+ function toCSSValue(value) {
10930
+ return typeof value === "number" ? `${value}px` : value?.trim() || void 0;
10931
+ }
11206
10932
  function useGrid(props) {
11207
- const { align, alignment, className, columnGap, columns = 2, gap = 3, isInline = false, justify, rowGap, rows, templateColumns, templateRows, ...otherProps } = useContextSystem(props, "Grid");
10933
+ const { align, alignment, className, columnGap, columns = 2, gap = 3, isInline = false, justify, rowGap, rows, style, templateColumns, templateRows, ...otherProps } = useContextSystem(props, "Grid");
11208
10934
  const column = useResponsiveValue(Array.isArray(columns) ? columns : [columns]);
11209
10935
  const row = useResponsiveValue(Array.isArray(rows) ? rows : [rows]);
11210
- const gridTemplateColumns = templateColumns || !!columns && `repeat( ${column}, 1fr )`;
11211
- const gridTemplateRows = templateRows || !!rows && `repeat( ${row}, 1fr )`;
11212
- const cx = useCx();
11213
- const classes = useMemo$1(() => {
11214
- const alignmentProps = getAlignmentProps(alignment);
11215
- const gridClasses = /* @__PURE__ */ css$1({
11216
- alignItems: align,
11217
- display: isInline ? "inline-grid" : "grid",
11218
- gap: `calc( ${config_values_default.gridBase} * ${gap} )`,
11219
- gridTemplateColumns: gridTemplateColumns || void 0,
11220
- gridTemplateRows: gridTemplateRows || void 0,
11221
- gridRowGap: rowGap,
11222
- gridColumnGap: columnGap,
11223
- justifyContent: justify,
11224
- verticalAlign: isInline ? "middle" : void 0,
11225
- ...alignmentProps
11226
- }, process.env.NODE_ENV === "production" ? "" : ";label:gridClasses;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNENzQiIsImZpbGUiOiJob29rLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5pbXBvcnQgdHlwZSB7IFdvcmRQcmVzc0NvbXBvbmVudFByb3BzIH0gZnJvbSAnLi4vY29udGV4dCc7XG5pbXBvcnQgeyB1c2VDb250ZXh0U3lzdGVtIH0gZnJvbSAnLi4vY29udGV4dCc7XG5pbXBvcnQgeyBnZXRBbGlnbm1lbnRQcm9wcyB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IHsgdXNlUmVzcG9uc2l2ZVZhbHVlIH0gZnJvbSAnLi4vdXRpbHMvdXNlLXJlc3BvbnNpdmUtdmFsdWUnO1xuaW1wb3J0IENPTkZJRyBmcm9tICcuLi91dGlscy9jb25maWctdmFsdWVzJztcbmltcG9ydCB7IHVzZUN4IH0gZnJvbSAnLi4vdXRpbHMvaG9va3MvdXNlLWN4JztcbmltcG9ydCB0eXBlIHsgR3JpZFByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHVzZUdyaWQoXG5cdHByb3BzOiBXb3JkUHJlc3NDb21wb25lbnRQcm9wczwgR3JpZFByb3BzLCAnZGl2JyA+XG4pIHtcblx0Y29uc3Qge1xuXHRcdGFsaWduLFxuXHRcdGFsaWdubWVudCxcblx0XHRjbGFzc05hbWUsXG5cdFx0Y29sdW1uR2FwLFxuXHRcdGNvbHVtbnMgPSAyLFxuXHRcdGdhcCA9IDMsXG5cdFx0aXNJbmxpbmUgPSBmYWxzZSxcblx0XHRqdXN0aWZ5LFxuXHRcdHJvd0dhcCxcblx0XHRyb3dzLFxuXHRcdHRlbXBsYXRlQ29sdW1ucyxcblx0XHR0ZW1wbGF0ZVJvd3MsXG5cdFx0Li4ub3RoZXJQcm9wc1xuXHR9ID0gdXNlQ29udGV4dFN5c3RlbSggcHJvcHMsICdHcmlkJyApO1xuXG5cdGNvbnN0IGNvbHVtbnNBc0FycmF5ID0gQXJyYXkuaXNBcnJheSggY29sdW1ucyApID8gY29sdW1ucyA6IFsgY29sdW1ucyBdO1xuXHRjb25zdCBjb2x1bW4gPSB1c2VSZXNwb25zaXZlVmFsdWUoIGNvbHVtbnNBc0FycmF5ICk7XG5cdGNvbnN0IHJvd3NBc0FycmF5ID0gQXJyYXkuaXNBcnJheSggcm93cyApID8gcm93cyA6IFsgcm93cyBdO1xuXHRjb25zdCByb3cgPSB1c2VSZXNwb25zaXZlVmFsdWUoIHJvd3NBc0FycmF5ICk7XG5cblx0Y29uc3QgZ3JpZFRlbXBsYXRlQ29sdW1ucyA9XG5cdFx0dGVtcGxhdGVDb2x1bW5zIHx8ICggISEgY29sdW1ucyAmJiBgcmVwZWF0KCAkeyBjb2x1bW4gfSwgMWZyIClgICk7XG5cdGNvbnN0IGdyaWRUZW1wbGF0ZVJvd3MgPVxuXHRcdHRlbXBsYXRlUm93cyB8fCAoICEhIHJvd3MgJiYgYHJlcGVhdCggJHsgcm93IH0sIDFmciApYCApO1xuXG5cdGNvbnN0IGN4ID0gdXNlQ3goKTtcblxuXHRjb25zdCBjbGFzc2VzID0gdXNlTWVtbyggKCkgPT4ge1xuXHRcdGNvbnN0IGFsaWdubWVudFByb3BzID0gZ2V0QWxpZ25tZW50UHJvcHMoIGFsaWdubWVudCApO1xuXG5cdFx0Y29uc3QgZ3JpZENsYXNzZXMgPSBjc3MoIHtcblx0XHRcdGFsaWduSXRlbXM6IGFsaWduLFxuXHRcdFx0ZGlzcGxheTogaXNJbmxpbmUgPyAnaW5saW5lLWdyaWQnIDogJ2dyaWQnLFxuXHRcdFx0Z2FwOiBgY2FsYyggJHsgQ09ORklHLmdyaWRCYXNlIH0gKiAkeyBnYXAgfSApYCxcblx0XHRcdGdyaWRUZW1wbGF0ZUNvbHVtbnM6IGdyaWRUZW1wbGF0ZUNvbHVtbnMgfHwgdW5kZWZpbmVkLFxuXHRcdFx0Z3JpZFRlbXBsYXRlUm93czogZ3JpZFRlbXBsYXRlUm93cyB8fCB1bmRlZmluZWQsXG5cdFx0XHRncmlkUm93R2FwOiByb3dHYXAsXG5cdFx0XHRncmlkQ29sdW1uR2FwOiBjb2x1bW5HYXAsXG5cdFx0XHRqdXN0aWZ5Q29udGVudDoganVzdGlmeSxcblx0XHRcdHZlcnRpY2FsQWxpZ246IGlzSW5saW5lID8gJ21pZGRsZScgOiB1bmRlZmluZWQsXG5cdFx0XHQuLi5hbGlnbm1lbnRQcm9wcyxcblx0XHR9ICk7XG5cblx0XHRyZXR1cm4gY3goIGdyaWRDbGFzc2VzLCBjbGFzc05hbWUgKTtcblx0fSwgW1xuXHRcdGFsaWduLFxuXHRcdGFsaWdubWVudCxcblx0XHRjbGFzc05hbWUsXG5cdFx0Y29sdW1uR2FwLFxuXHRcdGN4LFxuXHRcdGdhcCxcblx0XHRncmlkVGVtcGxhdGVDb2x1bW5zLFxuXHRcdGdyaWRUZW1wbGF0ZVJvd3MsXG5cdFx0aXNJbmxpbmUsXG5cdFx0anVzdGlmeSxcblx0XHRyb3dHYXAsXG5cdF0gKTtcblxuXHRyZXR1cm4geyAuLi5vdGhlclByb3BzLCBjbGFzc05hbWU6IGNsYXNzZXMgfTtcbn1cbiJdfQ== */");
11227
- return cx(gridClasses, className);
11228
- }, [
11229
- align,
11230
- alignment,
11231
- className,
11232
- columnGap,
11233
- cx,
11234
- gap,
11235
- gridTemplateColumns,
11236
- gridTemplateRows,
11237
- isInline,
11238
- justify,
11239
- rowGap
11240
- ]);
10936
+ const gridTemplateColumns = templateColumns || !!column && `repeat( ${column}, 1fr )`;
10937
+ const gridTemplateRows = templateRows || !!row && `repeat( ${row}, 1fr )`;
10938
+ const alignmentProps = getAlignmentProps(alignment);
10939
+ const values = {
10940
+ align: alignmentProps.alignItems ?? align,
10941
+ justify: alignmentProps.justifyContent ?? justify,
10942
+ "template-columns": gridTemplateColumns || void 0,
10943
+ "template-rows": gridTemplateRows || void 0,
10944
+ "row-gap": rowGap,
10945
+ "column-gap": columnGap
10946
+ };
11241
10947
  return {
11242
10948
  ...otherProps,
11243
- className: classes
10949
+ className: clsx(style_module_default.grid, {
10950
+ [style_module_default["is-inline"]]: isInline,
10951
+ [style_module_default["has-align"]]: !!values.align?.trim(),
10952
+ [style_module_default["has-justify"]]: !!values.justify?.trim(),
10953
+ [style_module_default["has-template-columns"]]: !!toCSSValue(values["template-columns"]),
10954
+ [style_module_default["has-template-rows"]]: !!toCSSValue(values["template-rows"])
10955
+ }, Object.entries(values).map(([property, value]) => {
10956
+ const keyword = typeof value === "string" ? value.trim().toLowerCase() : "";
10957
+ return CSS_WIDE_KEYWORDS.has(keyword) && style_module_default[`${property}-${keyword}`];
10958
+ }), className),
10959
+ style: {
10960
+ "--wp-components-grid-align": values.align,
10961
+ "--wp-components-grid-justify": values.justify,
10962
+ "--wp-components-grid-gap": gap,
10963
+ "--wp-components-grid-template-columns": toCSSValue(values["template-columns"]),
10964
+ "--wp-components-grid-template-rows": toCSSValue(values["template-rows"]),
10965
+ "--wp-components-grid-row-gap": toCSSValue(rowGap),
10966
+ "--wp-components-grid-column-gap": toCSSValue(columnGap),
10967
+ ...style
10968
+ }
11244
10969
  };
11245
10970
  }
11246
10971
  //#endregion
11247
- //#region ../../../node_modules/.pnpm/@wordpress+components@40.1.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_c300d25e93ed6b8d3659e83df7c1508a/node_modules/@wordpress/components/build-module/grid/component.mjs
10972
+ //#region ../../../node_modules/.pnpm/@wordpress+components@42.0.0_@date-fns+tz@1.5.0_@types+react-dom@18.3.7_@types+react@18_5beefdda355715e908adfea668830e1f/node_modules/@wordpress/components/build-module/grid/component.mjs
11248
10973
  function UnconnectedGrid(props, forwardedRef) {
11249
10974
  const gridProps = useGrid(props);
11250
10975
  return /* @__PURE__ */ jsx(component_default$2, {
@@ -11270,8 +10995,8 @@ const SUBPIXEL_TOLERANCE = .5;
11270
10995
  * depends on `--a8c-charts-dimension-leaderboard-row-gap`, label wrapping, and
11271
10996
  * whatever a caller renders as a label, so any restated number would drift.
11272
10997
  *
11273
- * Every row is a direct grid child marked with `data-row-index`; interactive rows
11274
- * use a button wrapper and non-interactive rows use a div wrapper.
10998
+ * Every row is a `listitem` div, a direct grid child marked with `data-row-index`;
10999
+ * interactive rows hold a button inside it.
11275
11000
  *
11276
11001
  * @param enabled - Whether to measure at all. When false every row fits.
11277
11002
  * @param rowCount - Total number of rows rendered.
@@ -11413,6 +11138,7 @@ var leaderboard_chart_module_default = {
11413
11138
  "overlayLabel": "a8ccharts-GovfoW-overlayLabel",
11414
11139
  "row": "a8ccharts-GovfoW-row",
11415
11140
  "rowButton": "a8ccharts-GovfoW-rowButton",
11141
+ "rowItem": "a8ccharts-GovfoW-rowItem",
11416
11142
  "stretch": "a8ccharts-GovfoW-stretch",
11417
11143
  "valueContainer": "a8ccharts-GovfoW-valueContainer"
11418
11144
  };
@@ -11525,9 +11251,10 @@ const BarWithLabel = ({ entry, withComparison, withOverlayLabel, primaryColor, s
11525
11251
  * @param props.children - Child components for composition API
11526
11252
  * @param props.className - Additional CSS class name
11527
11253
  * @param props.style - Custom styling for the chart container
11254
+ * @param props.ariaLabel - Accessible name for the list, defaulting to "Leaderboard chart"
11528
11255
  * @return JSX element representing the leaderboard chart
11529
11256
  */
11530
- const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", className, style, children }) => {
11257
+ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propWidth, height: propHeight, withComparison = false, withOverlayLabel = false, primaryColor, secondaryColor, valueFormatter = defaultValueFormatter, deltaFormatter = defaultDeltaFormatter, animation, loading = false, fitRows = false, showLegend = false, legend = {}, legendLabels, gap = "md", ariaLabel, className, style, children }) => {
11531
11258
  const legendInteractive = legend.interactive ?? false;
11532
11259
  const legendPosition = legend.position ?? "bottom";
11533
11260
  const chartId = useChartId(providedChartId);
@@ -11658,6 +11385,8 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
11658
11385
  className: leaderboard_chart_module_default.emptyState,
11659
11386
  children: getAllHiddenMessage(legendInteractive, "series")
11660
11387
  }) : /* @__PURE__ */ jsx(component_default, {
11388
+ role: "list",
11389
+ "aria-label": ariaLabel ?? __("Leaderboard chart", "jetpack-charts"),
11661
11390
  templateColumns: "minmax(0, 1fr) auto",
11662
11391
  rowGap: ROW_GAP,
11663
11392
  columnGap: COLUMN_GAP,
@@ -11705,40 +11434,49 @@ const LeaderboardChartInternal = ({ data, chartId: providedChartId, width: propW
11705
11434
  })
11706
11435
  ]
11707
11436
  })] });
11708
- if (entry.onClick && entry.hasInteractiveLabel) return /* @__PURE__ */ jsxs("div", {
11437
+ if (entry.onClick && entry.hasInteractiveLabel) return /* @__PURE__ */ jsx("div", {
11438
+ role: "listitem",
11709
11439
  "data-row-index": rowIndex,
11710
11440
  style: rowStyle,
11711
- className: clsx(leaderboard_chart_module_default.row, leaderboard_chart_module_default.interactiveRow, leaderboard_chart_module_default.layeredRow),
11712
- onClick: forwardCellClickToRowButton,
11713
- children: [
11714
- rowCells,
11715
- /* @__PURE__ */ jsx("button", {
11716
- type: "button",
11717
- className: leaderboard_chart_module_default.rowButton,
11718
- onClick: entry.onClick,
11719
- "aria-label": entry.ariaLabel
11720
- }),
11721
- /* @__PURE__ */ jsx(Icon, {
11722
- className: leaderboard_chart_module_default.chevron,
11723
- icon: chevronRight,
11724
- size: 24
11725
- })
11726
- ]
11441
+ className: leaderboard_chart_module_default.rowItem,
11442
+ children: /* @__PURE__ */ jsxs("div", {
11443
+ className: clsx(leaderboard_chart_module_default.row, leaderboard_chart_module_default.interactiveRow, leaderboard_chart_module_default.layeredRow),
11444
+ onClick: forwardCellClickToRowButton,
11445
+ children: [
11446
+ rowCells,
11447
+ /* @__PURE__ */ jsx("button", {
11448
+ type: "button",
11449
+ className: leaderboard_chart_module_default.rowButton,
11450
+ onClick: entry.onClick,
11451
+ "aria-label": entry.ariaLabel
11452
+ }),
11453
+ /* @__PURE__ */ jsx(Icon, {
11454
+ className: leaderboard_chart_module_default.chevron,
11455
+ icon: chevronRight,
11456
+ size: 24
11457
+ })
11458
+ ]
11459
+ })
11727
11460
  }, entry.id);
11728
- if (entry.onClick) return /* @__PURE__ */ jsxs("button", {
11729
- type: "button",
11461
+ if (entry.onClick) return /* @__PURE__ */ jsx("div", {
11462
+ role: "listitem",
11730
11463
  "data-row-index": rowIndex,
11731
11464
  style: rowStyle,
11732
- className: clsx(leaderboard_chart_module_default.row, leaderboard_chart_module_default.interactiveRow),
11733
- onClick: entry.onClick,
11734
- "aria-label": entry.ariaLabel,
11735
- children: [rowCells, /* @__PURE__ */ jsx(Icon, {
11736
- className: leaderboard_chart_module_default.chevron,
11737
- icon: chevronRight,
11738
- size: 24
11739
- })]
11465
+ className: leaderboard_chart_module_default.rowItem,
11466
+ children: /* @__PURE__ */ jsxs("button", {
11467
+ type: "button",
11468
+ className: clsx(leaderboard_chart_module_default.row, leaderboard_chart_module_default.interactiveRow),
11469
+ onClick: entry.onClick,
11470
+ "aria-label": entry.ariaLabel,
11471
+ children: [rowCells, /* @__PURE__ */ jsx(Icon, {
11472
+ className: leaderboard_chart_module_default.chevron,
11473
+ icon: chevronRight,
11474
+ size: 24
11475
+ })]
11476
+ })
11740
11477
  }, entry.id);
11741
11478
  return /* @__PURE__ */ jsx("div", {
11479
+ role: "listitem",
11742
11480
  "data-row-index": rowIndex,
11743
11481
  style: rowStyle,
11744
11482
  className: leaderboard_chart_module_default.row,
@@ -11775,11 +11513,13 @@ const PieSelectionAnnouncement = ({ data }) => /* @__PURE__ */ jsx(VisuallyHidde
11775
11513
  });
11776
11514
  //#endregion
11777
11515
  //#region src/charts/private/pie-keyboard-navigation/pie-tooltip.tsx
11516
+ const TOOLTIP_BOX_STYLE = { zIndex: 3 };
11778
11517
  const PieTooltip = ({ top, left, selectedIndex, tooltipRef, children }) => {
11779
11518
  const standaloneScopeClass = useStandaloneScopeClass();
11780
11519
  return /* @__PURE__ */ jsx(BoundedTooltip, {
11781
11520
  top,
11782
11521
  left,
11522
+ style: TOOLTIP_BOX_STYLE,
11783
11523
  children: selectedIndex === void 0 ? /* @__PURE__ */ jsx("div", {
11784
11524
  className: standaloneScopeClass,
11785
11525
  role: "tooltip",
@@ -12002,6 +11742,7 @@ function RadialWipeAnimation({ id, radius, innerRadius = 0, durationMs = 1e3, wi
12002
11742
  //#endregion
12003
11743
  //#region src/charts/pie-chart/pie-chart.module.scss
12004
11744
  var pie_chart_module_default = {
11745
+ "pie-chart": "a8ccharts-gnszbG-pie-chart",
12005
11746
  "pie-chart__label-plate": "a8ccharts-gnszbG-pie-chart__label-plate",
12006
11747
  "pie-chart__label-text": "a8ccharts-gnszbG-pie-chart__label-text",
12007
11748
  "pie-chart__label-text--black": "a8ccharts-gnszbG-pie-chart__label-text--black",