@automattic/charts 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1533,7 +1533,7 @@ var _group = require('@visx/group');
1533
1533
  var _legend = require('@visx/legend');
1534
1534
 
1535
1535
 
1536
- // ../../../node_modules/.pnpm/@wordpress+element@6.44.0/node_modules/@wordpress/element/build-module/react.mjs
1536
+ // ../../../node_modules/.pnpm/@wordpress+element@6.46.0/node_modules/@wordpress/element/build-module/react.mjs
1537
1537
 
1538
1538
 
1539
1539
 
@@ -4203,8 +4203,44 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4203
4203
  chartRef,
4204
4204
  totalPoints: _optionalChain([dataSorted, 'access', _222 => _222[0], 'optionalAccess', _223 => _223.data, 'access', _224 => _224.length]) || 0
4205
4205
  });
4206
+ const fixedYDomain = _react.useMemo.call(void 0, () => {
4207
+ if (!legendInteractive || !dataSorted.length || !dataSorted[0].data.length || stacked && stackOffset !== "none") {
4208
+ return void 0;
4209
+ }
4210
+ if (stacked) {
4211
+ const numPoints = Math.max(...dataSorted.map((s) => s.data.length));
4212
+ let posMax = 0;
4213
+ let negMin = 0;
4214
+ for (let i = 0; i < numPoints; i++) {
4215
+ let posSum = 0;
4216
+ let negSum = 0;
4217
+ for (const series of dataSorted) {
4218
+ const v = Number(_optionalChain([series, 'access', _225 => _225.data, 'access', _226 => _226[i], 'optionalAccess', _227 => _227.value]));
4219
+ if (Number.isNaN(v)) continue;
4220
+ if (v >= 0) posSum += v;
4221
+ else negSum += v;
4222
+ }
4223
+ if (posSum > posMax) posMax = posSum;
4224
+ if (negSum < negMin) negMin = negSum;
4225
+ }
4226
+ return [negMin, posMax];
4227
+ }
4228
+ let max = -Infinity;
4229
+ let min = Infinity;
4230
+ for (const series of dataSorted) {
4231
+ for (const point of series.data) {
4232
+ const v = Number(_optionalChain([point, 'optionalAccess', _228 => _228.value]));
4233
+ if (!Number.isNaN(v)) {
4234
+ if (v > max) max = v;
4235
+ if (v < min) min = v;
4236
+ }
4237
+ }
4238
+ }
4239
+ if (max === -Infinity) return void 0;
4240
+ return [Math.min(0, min), max];
4241
+ }, [dataSorted, stacked, stackOffset, legendInteractive]);
4206
4242
  const chartOptions = _react.useMemo.call(void 0, () => {
4207
- const formatter = _optionalChain([options, 'optionalAccess', _225 => _225.axis, 'optionalAccess', _226 => _226.x, 'optionalAccess', _227 => _227.tickFormat]) || getFormatter(dataSorted);
4243
+ const formatter = _optionalChain([options, 'optionalAccess', _229 => _229.axis, 'optionalAccess', _230 => _230.x, 'optionalAccess', _231 => _231.tickFormat]) || getFormatter(dataSorted);
4208
4244
  return {
4209
4245
  axis: {
4210
4246
  x: {
@@ -4212,29 +4248,32 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4212
4248
  numTicks: guessOptimalNumTicks(dataSorted, width, formatter),
4213
4249
  tickFormat: formatter,
4214
4250
  display: true,
4215
- ..._optionalChain([options, 'optionalAccess', _228 => _228.axis, 'optionalAccess', _229 => _229.x])
4251
+ ..._optionalChain([options, 'optionalAccess', _232 => _232.axis, 'optionalAccess', _233 => _233.x])
4216
4252
  },
4217
4253
  y: {
4218
4254
  orientation: "left",
4219
4255
  numTicks: 4,
4220
4256
  tickFormat: _numberformatters.formatNumberCompact,
4221
4257
  display: true,
4222
- ..._optionalChain([options, 'optionalAccess', _230 => _230.axis, 'optionalAccess', _231 => _231.y])
4258
+ ..._optionalChain([options, 'optionalAccess', _234 => _234.axis, 'optionalAccess', _235 => _235.y])
4223
4259
  }
4224
4260
  },
4225
4261
  xScale: {
4226
4262
  type: "time",
4227
- ..._optionalChain([options, 'optionalAccess', _232 => _232.xScale])
4263
+ ..._optionalChain([options, 'optionalAccess', _236 => _236.xScale])
4228
4264
  },
4229
4265
  yScale: {
4230
4266
  type: "linear",
4231
4267
  nice: true,
4232
4268
  // Stacked areas should always include zero so the baseline is meaningful.
4233
4269
  zero: stacked,
4234
- ..._optionalChain([options, 'optionalAccess', _233 => _233.yScale])
4270
+ ...fixedYDomain ? {
4271
+ domain: fixedYDomain
4272
+ } : {},
4273
+ ..._optionalChain([options, 'optionalAccess', _237 => _237.yScale])
4235
4274
  }
4236
4275
  };
4237
- }, [options, dataSorted, width, stacked]);
4276
+ }, [options, dataSorted, width, stacked, fixedYDomain]);
4238
4277
  const defaultMargin = useChartMargin(height, chartOptions, dataSorted, theme);
4239
4278
  const error = validateData2(dataSorted);
4240
4279
  const isDataValid = !error;
@@ -4257,10 +4296,33 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4257
4296
  metadata: chartMetadata
4258
4297
  });
4259
4298
  const prefersReducedMotion = usePrefersReducedMotion();
4299
+ const animationEnabled = !!animation && !prefersReducedMotion;
4260
4300
  const accessors = {
4261
- xAccessor: (d) => _optionalChain([d, 'optionalAccess', _234 => _234.date]),
4262
- yAccessor: (d) => _optionalChain([d, 'optionalAccess', _235 => _235.value])
4301
+ xAccessor: (d) => _optionalChain([d, 'optionalAccess', _238 => _238.date]),
4302
+ yAccessor: (d) => _optionalChain([d, 'optionalAccess', _239 => _239.value])
4263
4303
  };
4304
+ const zeroYAccessor = _react.useCallback.call(void 0, () => 0, []);
4305
+ const visibleLabels = _react.useMemo.call(void 0, () => new Set(seriesWithVisibility.filter((s) => s.isVisible).map((s) => s.series.label)), [seriesWithVisibility]);
4306
+ const filteredRenderTooltip = _react.useCallback.call(void 0, (params) => {
4307
+ if (!legendInteractive) return renderTooltip(params);
4308
+ const datumByKey = _optionalChain([params, 'optionalAccess', _240 => _240.tooltipData, 'optionalAccess', _241 => _241.datumByKey]);
4309
+ if (!datumByKey) return renderTooltip(params);
4310
+ const filtered = Object.fromEntries(Object.entries(datumByKey).filter(([key]) => visibleLabels.has(key)));
4311
+ if (Object.keys(filtered).length === 0) return null;
4312
+ const nearestDatum = _optionalChain([params, 'optionalAccess', _242 => _242.tooltipData, 'optionalAccess', _243 => _243.nearestDatum]);
4313
+ const nextNearest = nearestDatum && visibleLabels.has(nearestDatum.key) ? nearestDatum : {
4314
+ ...Object.values(filtered)[0],
4315
+ distance: _nullishCoalesce(_optionalChain([nearestDatum, 'optionalAccess', _244 => _244.distance]), () => ( 0))
4316
+ };
4317
+ return renderTooltip({
4318
+ ...params,
4319
+ tooltipData: {
4320
+ ...params.tooltipData,
4321
+ datumByKey: filtered,
4322
+ nearestDatum: nextNearest
4323
+ }
4324
+ });
4325
+ }, [renderTooltip, legendInteractive, visibleLabels]);
4264
4326
  const resolvedFillOpacity = _nullishCoalesce(fillOpacity, () => ( (stacked ? 0.85 : 0.4)));
4265
4327
  const resolvedWithStroke = _nullishCoalesce(withStroke, () => ( !stacked));
4266
4328
  if (error) {
@@ -4286,6 +4348,35 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4286
4348
  isVisible
4287
4349
  }) => isVisible);
4288
4350
  const curve = getCurveType(curveType, smoothing);
4351
+ const renderSeries = ({
4352
+ series: seriesData,
4353
+ index,
4354
+ isVisible
4355
+ }) => {
4356
+ const {
4357
+ color,
4358
+ lineStyles
4359
+ } = getElementStyles({
4360
+ data: seriesData,
4361
+ index
4362
+ });
4363
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.AnimatedAreaSeries, {
4364
+ dataKey: _optionalChain([seriesData, 'optionalAccess', _245 => _245.label]),
4365
+ data: seriesData.data,
4366
+ xAccessor: accessors.xAccessor,
4367
+ yAccessor: isVisible || !legendInteractive ? accessors.yAccessor : zeroYAccessor,
4368
+ fill: color,
4369
+ fillOpacity: resolvedFillOpacity,
4370
+ ...stacked ? {} : {
4371
+ renderLine: resolvedWithStroke,
4372
+ curve
4373
+ },
4374
+ lineProps: {
4375
+ stroke: color,
4376
+ ...lineStyles
4377
+ }
4378
+ }, _optionalChain([seriesData, 'optionalAccess', _246 => _246.label]) || index);
4379
+ };
4289
4380
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SingleChartContext.Provider, {
4290
4381
  value: {
4291
4382
  chartId,
@@ -4299,7 +4390,7 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4299
4390
  legendChildren,
4300
4391
  gap,
4301
4392
  className: _clsx2.default.call(void 0, "area-chart", area_chart_module_default["area-chart"], {
4302
- [area_chart_module_default["area-chart--animated"]]: animation && !prefersReducedMotion
4393
+ [area_chart_module_default["area-chart--animated"]]: animationEnabled
4303
4394
  }, className),
4304
4395
  style: {
4305
4396
  width,
@@ -4348,65 +4439,19 @@ var AreaChartInternal = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
4348
4439
  width,
4349
4440
  height: chartHeight,
4350
4441
  children: _i18n.__.call(void 0, "All series are hidden. Click legend items to show data.", "jetpack-charts")
4351
- }) : null, !allSeriesHidden && stacked && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.AreaStack, {
4442
+ }) : null, !allSeriesHidden && stacked && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.AnimatedAreaStack, {
4352
4443
  curve,
4353
4444
  offset: stackOffset,
4354
4445
  renderLine: resolvedWithStroke,
4355
- children: visibleSeries.map(({
4356
- series: seriesData,
4357
- index
4358
- }) => {
4359
- const {
4360
- color,
4361
- lineStyles
4362
- } = getElementStyles({
4363
- data: seriesData,
4364
- index
4365
- });
4366
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.AreaSeries, {
4367
- dataKey: _optionalChain([seriesData, 'optionalAccess', _236 => _236.label]),
4368
- data: seriesData.data,
4369
- ...accessors,
4370
- fill: color,
4371
- fillOpacity: resolvedFillOpacity,
4372
- lineProps: {
4373
- stroke: color,
4374
- ...lineStyles
4375
- }
4376
- }, _optionalChain([seriesData, 'optionalAccess', _237 => _237.label]) || index);
4377
- })
4378
- }), !allSeriesHidden && !stacked && visibleSeries.map(({
4379
- series: seriesData,
4380
- index
4381
- }) => {
4382
- const {
4383
- color,
4384
- lineStyles
4385
- } = getElementStyles({
4386
- data: seriesData,
4387
- index
4388
- });
4389
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.AreaSeries, {
4390
- dataKey: _optionalChain([seriesData, 'optionalAccess', _238 => _238.label]),
4391
- data: seriesData.data,
4392
- ...accessors,
4393
- fill: color,
4394
- fillOpacity: resolvedFillOpacity,
4395
- renderLine: resolvedWithStroke,
4396
- curve,
4397
- lineProps: {
4398
- stroke: color,
4399
- ...lineStyles
4400
- }
4401
- }, _optionalChain([seriesData, 'optionalAccess', _239 => _239.label]) || index);
4402
- }), withTooltips && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
4446
+ children: seriesWithVisibility.map(renderSeries)
4447
+ }), !allSeriesHidden && !stacked && seriesWithVisibility.map(renderSeries), withTooltips && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
4403
4448
  children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AccessibleTooltip, {
4404
4449
  detectBounds: true,
4405
4450
  snapTooltipToDatumX: true,
4406
4451
  snapTooltipToDatumY: !stacked,
4407
- renderTooltip,
4408
- showVerticalCrosshair: _optionalChain([withTooltipCrosshairs, 'optionalAccess', _240 => _240.showVertical]),
4409
- showHorizontalCrosshair: _optionalChain([withTooltipCrosshairs, 'optionalAccess', _241 => _241.showHorizontal]),
4452
+ renderTooltip: filteredRenderTooltip,
4453
+ showVerticalCrosshair: _optionalChain([withTooltipCrosshairs, 'optionalAccess', _247 => _247.showVertical]),
4454
+ showHorizontalCrosshair: _optionalChain([withTooltipCrosshairs, 'optionalAccess', _248 => _248.showHorizontal]),
4410
4455
  selectedIndex,
4411
4456
  tooltipRef,
4412
4457
  keyboardFocusedClassName: area_chart_module_default["area-chart__tooltip--keyboard-focused"],
@@ -4597,12 +4642,12 @@ function useBarChartOptions(data, horizontal, options = {}) {
4597
4642
  nice: true,
4598
4643
  zero: false
4599
4644
  };
4600
- const labelFormatter = _optionalChain([data, 'optionalAccess', _242 => _242[0], 'optionalAccess', _243 => _243.data, 'optionalAccess', _244 => _244[0], 'optionalAccess', _245 => _245.label]) ? (label) => label : formatDateTick2;
4645
+ const labelFormatter = _optionalChain([data, 'optionalAccess', _249 => _249[0], 'optionalAccess', _250 => _250.data, 'optionalAccess', _251 => _251[0], 'optionalAccess', _252 => _252.label]) ? (label) => label : formatDateTick2;
4601
4646
  const valueFormatter = _numberformatters.formatNumberCompact;
4602
- const labelAccessor = (d) => _optionalChain([d, 'optionalAccess', _246 => _246.label]) || _optionalChain([d, 'optionalAccess', _247 => _247.date]);
4647
+ const labelAccessor = (d) => _optionalChain([d, 'optionalAccess', _253 => _253.label]) || _optionalChain([d, 'optionalAccess', _254 => _254.date]);
4603
4648
  const valueAccessor = (d) => {
4604
4649
  const enhancedPoint = d;
4605
- return _optionalChain([enhancedPoint, 'optionalAccess', _248 => _248.visualValue]) !== void 0 ? enhancedPoint.visualValue : _optionalChain([d, 'optionalAccess', _249 => _249.value]);
4650
+ return _optionalChain([enhancedPoint, 'optionalAccess', _255 => _255.visualValue]) !== void 0 ? enhancedPoint.visualValue : _optionalChain([d, 'optionalAccess', _256 => _256.value]);
4606
4651
  };
4607
4652
  return {
4608
4653
  vertical: {
@@ -4641,9 +4686,9 @@ function useBarChartOptions(data, horizontal, options = {}) {
4641
4686
  } = defaultOptions[orientationKey];
4642
4687
  const xScale = { ...baseXScale, ...options.xScale || {} };
4643
4688
  const yScale = { ...baseYScale, ...options.yScale || {} };
4644
- const providedToolTipLabelFormatter = horizontal ? _optionalChain([options, 'access', _250 => _250.axis, 'optionalAccess', _251 => _251.y, 'optionalAccess', _252 => _252.tickFormat]) : _optionalChain([options, 'access', _253 => _253.axis, 'optionalAccess', _254 => _254.x, 'optionalAccess', _255 => _255.tickFormat]);
4645
- const { labelOverflow: xLabelOverflow, ...xAxisOptions } = _optionalChain([options, 'access', _256 => _256.axis, 'optionalAccess', _257 => _257.x]) || {};
4646
- const { labelOverflow: yLabelOverflow, ...yAxisOptions } = _optionalChain([options, 'access', _258 => _258.axis, 'optionalAccess', _259 => _259.y]) || {};
4689
+ const providedToolTipLabelFormatter = horizontal ? _optionalChain([options, 'access', _257 => _257.axis, 'optionalAccess', _258 => _258.y, 'optionalAccess', _259 => _259.tickFormat]) : _optionalChain([options, 'access', _260 => _260.axis, 'optionalAccess', _261 => _261.x, 'optionalAccess', _262 => _262.tickFormat]);
4690
+ const { labelOverflow: xLabelOverflow, ...xAxisOptions } = _optionalChain([options, 'access', _263 => _263.axis, 'optionalAccess', _264 => _264.x]) || {};
4691
+ const { labelOverflow: yLabelOverflow, ...yAxisOptions } = _optionalChain([options, 'access', _265 => _265.axis, 'optionalAccess', _266 => _266.y]) || {};
4647
4692
  return {
4648
4693
  gridVisibility,
4649
4694
  xScale,
@@ -4681,7 +4726,7 @@ function useBarChartOptions(data, horizontal, options = {}) {
4681
4726
  // src/charts/bar-chart/bar-chart.tsx
4682
4727
 
4683
4728
  var validateData3 = (data) => {
4684
- if (!_optionalChain([data, 'optionalAccess', _260 => _260.length])) return "No data available";
4729
+ if (!_optionalChain([data, 'optionalAccess', _267 => _267.length])) return "No data available";
4685
4730
  const hasInvalidData = data.some((series) => series.data.some((point) => isNaN(point.value) || point.value === null || point.value === void 0 || !point.label && (!("date" in point && point.date) || isNaN(point.date.getTime()))));
4686
4731
  if (hasInvalidData) return "Invalid data";
4687
4732
  return null;
@@ -4731,7 +4776,7 @@ var BarChartInternal = ({
4731
4776
  }, [height]);
4732
4777
  const [selectedIndex, setSelectedIndex] = _react.useState.call(void 0, void 0);
4733
4778
  const [isNavigating, setIsNavigating] = _react.useState.call(void 0, false);
4734
- const totalPoints = Math.max(0, ...data.map((series) => _optionalChain([series, 'access', _261 => _261.data, 'optionalAccess', _262 => _262.length]) || 0)) * data.length;
4779
+ const totalPoints = Math.max(0, ...data.map((series) => _optionalChain([series, 'access', _268 => _268.data, 'optionalAccess', _269 => _269.length]) || 0)) * data.length;
4735
4780
  const {
4736
4781
  tooltipRef,
4737
4782
  onChartFocus,
@@ -4775,13 +4820,13 @@ var BarChartInternal = ({
4775
4820
  const renderDefaultTooltip2 = _react.useCallback.call(void 0, ({
4776
4821
  tooltipData
4777
4822
  }) => {
4778
- const nearestDatum = _optionalChain([tooltipData, 'optionalAccess', _263 => _263.nearestDatum, 'optionalAccess', _264 => _264.datum]);
4823
+ const nearestDatum = _optionalChain([tooltipData, 'optionalAccess', _270 => _270.nearestDatum, 'optionalAccess', _271 => _271.datum]);
4779
4824
  if (!nearestDatum) return null;
4780
4825
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", {
4781
4826
  className: bar_chart_module_default["bar-chart__tooltip"],
4782
4827
  children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
4783
4828
  className: bar_chart_module_default["bar-chart__tooltip-header"],
4784
- children: _optionalChain([tooltipData, 'optionalAccess', _265 => _265.nearestDatum, 'optionalAccess', _266 => _266.key])
4829
+ children: _optionalChain([tooltipData, 'optionalAccess', _272 => _272.nearestDatum, 'optionalAccess', _273 => _273.key])
4785
4830
  }), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", {
4786
4831
  className: bar_chart_module_default["bar-chart__tooltip-row"],
4787
4832
  children: [/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", {
@@ -4980,12 +5025,12 @@ var BarChartInternal = ({
4980
5025
  return null;
4981
5026
  }
4982
5027
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.BarSeries, {
4983
- dataKey: _optionalChain([seriesData, 'optionalAccess', _267 => _267.label]),
5028
+ dataKey: _optionalChain([seriesData, 'optionalAccess', _274 => _274.label]),
4984
5029
  data: seriesData.data,
4985
5030
  yAccessor: chartOptions.accessors.yAccessor,
4986
5031
  xAccessor: chartOptions.accessors.xAccessor,
4987
5032
  colorAccessor: getBarBackground(index)
4988
- }, _optionalChain([seriesData, 'optionalAccess', _268 => _268.label]));
5033
+ }, _optionalChain([seriesData, 'optionalAccess', _275 => _275.label]));
4989
5034
  })
4990
5035
  }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xychart.Axis, {
4991
5036
  ...chartOptions.axis.x
@@ -5039,7 +5084,7 @@ var BarChartResponsive = attachSubComponents(withResponsive(BarChartWithProvider
5039
5084
 
5040
5085
  var getScaleBandwidth2 = (scale) => {
5041
5086
  const s = scale;
5042
- return s && "bandwidth" in s ? _nullishCoalesce(_optionalChain([s, 'optionalAccess', _269 => _269.bandwidth, 'call', _270 => _270()]), () => ( 0)) : 0;
5087
+ return s && "bandwidth" in s ? _nullishCoalesce(_optionalChain([s, 'optionalAccess', _276 => _276.bandwidth, 'call', _277 => _277()]), () => ( 0)) : 0;
5043
5088
  };
5044
5089
  var DefaultLabelComponent = ({
5045
5090
  textProps,
@@ -5100,7 +5145,7 @@ var AxisRenderer = ({
5100
5145
  delete textProps.dx;
5101
5146
  const sum = data.reduce((acc, {
5102
5147
  data: seriesData
5103
- }) => acc + (_nullishCoalesce(_optionalChain([seriesData, 'access', _271 => _271[index], 'optionalAccess', _272 => _272.value]), () => ( 0))), 0);
5148
+ }) => acc + (_nullishCoalesce(_optionalChain([seriesData, 'access', _278 => _278[index], 'optionalAccess', _279 => _279.value]), () => ( 0))), 0);
5104
5149
  const y = from2.y + yOffset;
5105
5150
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _group.Group, {
5106
5151
  children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, LabelComponent, {
@@ -5268,7 +5313,7 @@ var useFunnelSelection = (hideTooltip) => {
5268
5313
  (stepId) => {
5269
5314
  if (clickedStep === stepId) {
5270
5315
  setClickedStep(null);
5271
- _optionalChain([hideTooltip, 'optionalCall', _273 => _273()]);
5316
+ _optionalChain([hideTooltip, 'optionalCall', _280 => _280()]);
5272
5317
  } else {
5273
5318
  setClickedStep(stepId);
5274
5319
  }
@@ -5281,21 +5326,21 @@ var useFunnelSelection = (hideTooltip) => {
5281
5326
  event.preventDefault();
5282
5327
  if (clickedStep === stepId) {
5283
5328
  setClickedStep(null);
5284
- _optionalChain([hideTooltip, 'optionalCall', _274 => _274()]);
5329
+ _optionalChain([hideTooltip, 'optionalCall', _281 => _281()]);
5285
5330
  } else {
5286
5331
  setClickedStep(stepId);
5287
5332
  }
5288
5333
  } else if (event.key === "Escape") {
5289
5334
  event.preventDefault();
5290
5335
  setClickedStep(null);
5291
- _optionalChain([hideTooltip, 'optionalCall', _275 => _275()]);
5336
+ _optionalChain([hideTooltip, 'optionalCall', _282 => _282()]);
5292
5337
  }
5293
5338
  },
5294
5339
  [clickedStep, hideTooltip]
5295
5340
  );
5296
5341
  const clearSelection = _react.useCallback.call(void 0, () => {
5297
5342
  setClickedStep(null);
5298
- _optionalChain([hideTooltip, 'optionalCall', _276 => _276()]);
5343
+ _optionalChain([hideTooltip, 'optionalCall', _283 => _283()]);
5299
5344
  }, [hideTooltip]);
5300
5345
  const getStepState = _react.useCallback.call(void 0,
5301
5346
  (stepId) => ({
@@ -5457,7 +5502,7 @@ var ConversionFunnelChartInternal = ({
5457
5502
  document.removeEventListener("mousedown", handleDocumentClick);
5458
5503
  };
5459
5504
  }, [clearSelectionAndRef]);
5460
- const resolvedHeight = _nullishCoalesce(_nullishCoalesce(height, () => ( _optionalChain([style, 'optionalAccess', _277 => _277.height]))), () => ( "100%"));
5505
+ const resolvedHeight = _nullishCoalesce(_nullishCoalesce(height, () => ( _optionalChain([style, 'optionalAccess', _284 => _284.height]))), () => ( "100%"));
5461
5506
  const {
5462
5507
  primaryColor,
5463
5508
  backgroundColor,
@@ -5472,7 +5517,7 @@ var ConversionFunnelChartInternal = ({
5472
5517
  }) : {
5473
5518
  color: primaryColor || "#000000"
5474
5519
  };
5475
- const isPositiveChange = _optionalChain([changeIndicator, 'optionalAccess', _278 => _278.startsWith, 'call', _279 => _279("+")]);
5520
+ const isPositiveChange = _optionalChain([changeIndicator, 'optionalAccess', _285 => _285.startsWith, 'call', _286 => _286("+")]);
5476
5521
  const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;
5477
5522
  const barBackgroundColor = backgroundColor || hexToRgba(barColor, 0.08) || "rgba(0, 0, 0, 0.08)";
5478
5523
  const renderDefaultMainMetric = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
@@ -5503,8 +5548,8 @@ var ConversionFunnelChartInternal = ({
5503
5548
  const chartMetadata = _react.useMemo.call(void 0, () => ({
5504
5549
  mainRate,
5505
5550
  changeIndicator,
5506
- stepsCount: _optionalChain([steps, 'optionalAccess', _280 => _280.length]) || 0
5507
- }), [mainRate, changeIndicator, _optionalChain([steps, 'optionalAccess', _281 => _281.length])]);
5551
+ stepsCount: _optionalChain([steps, 'optionalAccess', _287 => _287.length]) || 0
5552
+ }), [mainRate, changeIndicator, _optionalChain([steps, 'optionalAccess', _288 => _288.length])]);
5508
5553
  useChartRegistration({
5509
5554
  chartId,
5510
5555
  legendItems: [],
@@ -5590,8 +5635,8 @@ var ConversionFunnelChartInternal = ({
5590
5635
  direction: "column",
5591
5636
  justify: "flex-end",
5592
5637
  className: conversion_funnel_chart_module_default["bar-container"],
5593
- onClick: _optionalChain([stepHandlers, 'access', _282 => _282.get, 'call', _283 => _283(step.id), 'optionalAccess', _284 => _284.onClick]),
5594
- onKeyDown: _optionalChain([stepHandlers, 'access', _285 => _285.get, 'call', _286 => _286(step.id), 'optionalAccess', _287 => _287.onKeyDown]),
5638
+ onClick: _optionalChain([stepHandlers, 'access', _289 => _289.get, 'call', _290 => _290(step.id), 'optionalAccess', _291 => _291.onClick]),
5639
+ onKeyDown: _optionalChain([stepHandlers, 'access', _292 => _292.get, 'call', _293 => _293(step.id), 'optionalAccess', _294 => _294.onKeyDown]),
5595
5640
  role: "button",
5596
5641
  tabIndex: isBlurred ? -1 : 0,
5597
5642
  "aria-label": step.label,
@@ -5823,7 +5868,7 @@ var GeoChartWithProvider = (props) => {
5823
5868
  GeoChartWithProvider.displayName = "GeoChart";
5824
5869
  var GeoChartResponsive = withResponsive(GeoChartWithProvider);
5825
5870
 
5826
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
5871
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.mjs
5827
5872
  function useUpdateEffect(effect, deps) {
5828
5873
  const mountedRef = _react.useRef.call(void 0, false);
5829
5874
  _react.useEffect.call(void 0, () => {
@@ -7277,7 +7322,7 @@ var css2 = _createEmotion.css;
7277
7322
  var sheet = _createEmotion.sheet;
7278
7323
  var cache = _createEmotion.cache;
7279
7324
 
7280
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
7325
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/hooks/use-cx.mjs
7281
7326
  var isSerializedStyles = (o) => typeof o !== "undefined" && o !== null && ["name", "styles"].every((p) => typeof o[p] !== "undefined");
7282
7327
  var useCx = () => {
7283
7328
  const cache2 = __unsafe_useEmotionCache();
@@ -7364,7 +7409,7 @@ function memize(fn, options) {
7364
7409
  return memoized;
7365
7410
  }
7366
7411
 
7367
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/colors-values.mjs
7412
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/colors-values.mjs
7368
7413
  var white = "#fff";
7369
7414
  var GRAY = {
7370
7415
  900: "#1e1e1e",
@@ -7445,7 +7490,7 @@ var COLORS = Object.freeze({
7445
7490
  ui: UI
7446
7491
  });
7447
7492
 
7448
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/config-values.mjs
7493
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/config-values.mjs
7449
7494
  var CONTROL_HEIGHT = "36px";
7450
7495
  var CONTROL_PROPS = {
7451
7496
  // These values should be shared with TextControl.
@@ -7505,6 +7550,9 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
7505
7550
  surfaceBorderSubtleColor: "rgba(0, 0, 0, 0.05)",
7506
7551
  surfaceBackgroundTertiaryColor: COLORS.white,
7507
7552
  surfaceColor: COLORS.white,
7553
+ // Modal exit animation: `use-modal-exit-animation` parses this for the
7554
+ // `animationend` timeout race; keep the numeric duration equal to
7555
+ // `--wpds-motion-duration-md` on `.components-modal__frame` in modal/style.scss.
7508
7556
  transitionDuration: "200ms",
7509
7557
  transitionDurationFast: "160ms",
7510
7558
  transitionDurationFaster: "120ms",
@@ -7513,14 +7561,14 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
7513
7561
  transitionTimingFunctionControl: "cubic-bezier(0.12, 0.8, 0.32, 1)"
7514
7562
  });
7515
7563
 
7516
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
7564
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
7517
7565
  var import_es6 = _chunkDZUJEN5Ncjs.__toESM.call(void 0, require_es6(), 1);
7518
7566
 
7519
7567
 
7520
- // ../../../node_modules/.pnpm/@wordpress+warning@3.45.0/node_modules/@wordpress/warning/build-module/utils.mjs
7568
+ // ../../../node_modules/.pnpm/@wordpress+warning@3.46.0/node_modules/@wordpress/warning/build-module/utils.mjs
7521
7569
  var logged = /* @__PURE__ */ new Set();
7522
7570
 
7523
- // ../../../node_modules/.pnpm/@wordpress+warning@3.45.0/node_modules/@wordpress/warning/build-module/index.mjs
7571
+ // ../../../node_modules/.pnpm/@wordpress+warning@3.46.0/node_modules/@wordpress/warning/build-module/index.mjs
7524
7572
  function isDev() {
7525
7573
  return globalThis.SCRIPT_DEBUG === true;
7526
7574
  }
@@ -7539,7 +7587,7 @@ function warning(message) {
7539
7587
  logged.add(message);
7540
7588
  }
7541
7589
 
7542
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
7590
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-system-provider.mjs
7543
7591
 
7544
7592
  var ComponentsContext = _react.createContext.call(void 0,
7545
7593
  /** @type {Record<string, any>} */
@@ -7582,26 +7630,26 @@ var BaseContextSystemProvider = ({
7582
7630
  };
7583
7631
  var ContextSystemProvider = _react.memo.call(void 0, BaseContextSystemProvider);
7584
7632
 
7585
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/constants.mjs
7633
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/constants.mjs
7586
7634
  var COMPONENT_NAMESPACE = "data-wp-component";
7587
7635
  var CONNECTED_NAMESPACE = "data-wp-c16t";
7588
7636
  var CONNECT_STATIC_NAMESPACE = "__contextSystemKey__";
7589
7637
 
7590
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
7638
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.mjs
7591
7639
  function getStyledClassName(namespace) {
7592
7640
  const kebab = paramCase(namespace);
7593
7641
  return `components-${kebab}`;
7594
7642
  }
7595
7643
  var getStyledClassNameFromKey = memize(getStyledClassName);
7596
7644
 
7597
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-connect.mjs
7645
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/context-connect.mjs
7598
7646
  function contextConnect(Component2, namespace) {
7599
7647
  return _contextConnect(Component2, namespace, {
7600
7648
  forwardsRef: true
7601
7649
  });
7602
7650
  }
7603
7651
  function _contextConnect(Component2, namespace, options) {
7604
- const WrappedComponent = _optionalChain([options, 'optionalAccess', _288 => _288.forwardsRef]) ? _react.forwardRef.call(void 0, Component2) : Component2;
7652
+ const WrappedComponent = _optionalChain([options, 'optionalAccess', _295 => _295.forwardsRef]) ? _react.forwardRef.call(void 0, Component2) : Component2;
7605
7653
  if (typeof namespace === "undefined") {
7606
7654
  globalThis.SCRIPT_DEBUG === true ? warning("contextConnect: Please provide a namespace") : void 0;
7607
7655
  }
@@ -7619,7 +7667,7 @@ function _contextConnect(Component2, namespace, options) {
7619
7667
  });
7620
7668
  }
7621
7669
 
7622
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/utils.mjs
7670
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/utils.mjs
7623
7671
  function getNamespace(componentName) {
7624
7672
  return {
7625
7673
  [COMPONENT_NAMESPACE]: componentName
@@ -7631,13 +7679,13 @@ function getConnectedNamespace() {
7631
7679
  };
7632
7680
  }
7633
7681
 
7634
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
7682
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/context/use-context-system.mjs
7635
7683
  function useContextSystem(props, namespace) {
7636
7684
  const contextSystemProps = useComponentsContext();
7637
7685
  if (typeof namespace === "undefined") {
7638
7686
  globalThis.SCRIPT_DEBUG === true ? warning("useContextSystem: Please provide a namespace") : void 0;
7639
7687
  }
7640
- const contextProps = _optionalChain([contextSystemProps, 'optionalAccess', _289 => _289[namespace]]) || {};
7688
+ const contextProps = _optionalChain([contextSystemProps, 'optionalAccess', _296 => _296[namespace]]) || {};
7641
7689
  const finalComponentProps = {
7642
7690
  ...getConnectedNamespace(),
7643
7691
  ...getNamespace(namespace)
@@ -7815,7 +7863,7 @@ var createStyled = function createStyled2(tag, options) {
7815
7863
  };
7816
7864
  };
7817
7865
 
7818
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/view/component.mjs
7866
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/view/component.mjs
7819
7867
 
7820
7868
  var PolymorphicDiv = /* @__PURE__ */ createStyled("div", process.env.NODE_ENV === "production" ? {
7821
7869
  target: "e19lxcc00"
@@ -7838,7 +7886,7 @@ var View = Object.assign(_react.forwardRef.call(void 0, UnforwardedView), {
7838
7886
  });
7839
7887
  var component_default = View;
7840
7888
 
7841
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
7889
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/utils/use-responsive-value.mjs
7842
7890
  var breakpoints = ["40em", "52em", "64em"];
7843
7891
  var useBreakpointIndex = (options = {}) => {
7844
7892
  const {
@@ -7881,7 +7929,7 @@ function useResponsiveValue(values, options = {}) {
7881
7929
  return array[index >= array.length ? array.length - 1 : index];
7882
7930
  }
7883
7931
 
7884
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/utils.mjs
7932
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/utils.mjs
7885
7933
  var ALIGNMENTS = {
7886
7934
  bottom: {
7887
7935
  alignItems: "flex-end",
@@ -7932,7 +7980,7 @@ function getAlignmentProps(alignment) {
7932
7980
  return alignmentProps;
7933
7981
  }
7934
7982
 
7935
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/hook.mjs
7983
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/hook.mjs
7936
7984
  function useGrid(props) {
7937
7985
  const {
7938
7986
  align,
@@ -7978,7 +8026,7 @@ function useGrid(props) {
7978
8026
  };
7979
8027
  }
7980
8028
 
7981
- // ../../../node_modules/.pnpm/@wordpress+components@32.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/component.mjs
8029
+ // ../../../node_modules/.pnpm/@wordpress+components@33.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/components/build-module/grid/component.mjs
7982
8030
 
7983
8031
  function UnconnectedGrid(props, forwardedRef) {
7984
8032
  const gridProps = useGrid(props);
@@ -8018,7 +8066,7 @@ function useLeaderboardLegendItems({
8018
8066
  overrideColor: primaryColor || leaderboardChartSettings.primaryColor
8019
8067
  });
8020
8068
  items.push({
8021
- label: _optionalChain([legendLabels, 'optionalAccess', _290 => _290.primary]) || _i18n.__.call(void 0, "Current period", "jetpack-charts"),
8069
+ label: _optionalChain([legendLabels, 'optionalAccess', _297 => _297.primary]) || _i18n.__.call(void 0, "Current period", "jetpack-charts"),
8022
8070
  color: resolvedPrimaryColor
8023
8071
  });
8024
8072
  if (withComparison && !withOverlayLabel) {
@@ -8027,7 +8075,7 @@ function useLeaderboardLegendItems({
8027
8075
  overrideColor: secondaryColor || leaderboardChartSettings.secondaryColor
8028
8076
  });
8029
8077
  items.push({
8030
- label: _optionalChain([legendLabels, 'optionalAccess', _291 => _291.comparison]) || _i18n.__.call(void 0, "Previous period", "jetpack-charts"),
8078
+ label: _optionalChain([legendLabels, 'optionalAccess', _298 => _298.comparison]) || _i18n.__.call(void 0, "Previous period", "jetpack-charts"),
8031
8079
  color: resolvedSecondaryColor
8032
8080
  });
8033
8081
  }
@@ -8686,11 +8734,11 @@ var PieChartInternal = ({
8686
8734
  groupProps.onMouseLeave = onMouseLeave;
8687
8735
  }
8688
8736
  const svgLabelSmall = providerTheme.svgLabelSmall;
8689
- const fontSize = _nullishCoalesce(resolveFontSize(_optionalChain([svgLabelSmall, 'optionalAccess', _292 => _292.fontSize])), () => ( 12));
8737
+ const fontSize = _nullishCoalesce(resolveFontSize(_optionalChain([svgLabelSmall, 'optionalAccess', _299 => _299.fontSize])), () => ( 12));
8690
8738
  const estimatedTextWidth = _chunk7OZEQ5HEcjs.getStringWidth.call(void 0, arc.data.label, {
8691
8739
  fontSize,
8692
- fontFamily: _optionalChain([svgLabelSmall, 'optionalAccess', _293 => _293.fontFamily]),
8693
- fontWeight: _optionalChain([svgLabelSmall, 'optionalAccess', _294 => _294.fontWeight])
8740
+ fontFamily: _optionalChain([svgLabelSmall, 'optionalAccess', _300 => _300.fontFamily]),
8741
+ fontWeight: _optionalChain([svgLabelSmall, 'optionalAccess', _301 => _301.fontWeight])
8694
8742
  });
8695
8743
  const labelPadding = 6;
8696
8744
  const backgroundWidth = estimatedTextWidth + labelPadding * 2;
@@ -9140,7 +9188,7 @@ var SparklineComponent = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
9140
9188
  animation
9141
9189
  }, ref) => {
9142
9190
  const theme = useGlobalChartsTheme();
9143
- const themeStrokeWidth = _nullishCoalesce(_optionalChain([theme, 'access', _295 => _295.sparkline, 'optionalAccess', _296 => _296.strokeWidth]), () => ( 1.5));
9191
+ const themeStrokeWidth = _nullishCoalesce(_optionalChain([theme, 'access', _302 => _302.sparkline, 'optionalAccess', _303 => _303.strokeWidth]), () => ( 1.5));
9144
9192
  const strokeWidth = _nullishCoalesce(strokeWidthProp, () => ( themeStrokeWidth));
9145
9193
  const seriesData = _react.useMemo.call(void 0, () => {
9146
9194
  if (!data || data.length === 0) {
@@ -9149,7 +9197,7 @@ var SparklineComponent = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
9149
9197
  return transformToSeriesData(data, color, strokeWidth);
9150
9198
  }, [data, color, strokeWidth]);
9151
9199
  const finalMargin = _react.useMemo.call(void 0, () => {
9152
- const themeMargin = _nullishCoalesce(_optionalChain([theme, 'access', _297 => _297.sparkline, 'optionalAccess', _298 => _298.margin]), () => ( {
9200
+ const themeMargin = _nullishCoalesce(_optionalChain([theme, 'access', _304 => _304.sparkline, 'optionalAccess', _305 => _305.margin]), () => ( {
9153
9201
  top: 2,
9154
9202
  right: 2,
9155
9203
  bottom: 2,
@@ -9160,7 +9208,7 @@ var SparklineComponent = /* @__PURE__ */ _react.forwardRef.call(void 0, ({
9160
9208
  ...themeMargin,
9161
9209
  ...margin
9162
9210
  };
9163
- }, [marginProp, _optionalChain([theme, 'access', _299 => _299.sparkline, 'optionalAccess', _300 => _300.margin])]);
9211
+ }, [marginProp, _optionalChain([theme, 'access', _306 => _306.sparkline, 'optionalAccess', _307 => _307.margin])]);
9164
9212
  const seriesWithGradient = _react.useMemo.call(void 0, () => {
9165
9213
  if (!gradient || seriesData.length === 0) {
9166
9214
  return seriesData;