apexcharts 7.2.0 → 7.4.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 (172) hide show
  1. package/LICENSE +30 -11
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +545 -463
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.esm.js +1149 -801
  6. package/dist/apexcharts.js +684 -254
  7. package/dist/apexcharts.min.js +2 -2
  8. package/dist/apexcharts.ssr.common.js +2 -2
  9. package/dist/apexcharts.ssr.esm.js +684 -254
  10. package/dist/area.common.js +1 -1
  11. package/dist/area.esm.js +1 -1
  12. package/dist/bar.common.js +2 -2
  13. package/dist/bar.esm.js +20 -10
  14. package/dist/bar.js +2 -2
  15. package/dist/boxPlot.common.js +2 -2
  16. package/dist/boxPlot.esm.js +20 -10
  17. package/dist/bubble.common.js +1 -1
  18. package/dist/bubble.esm.js +1 -1
  19. package/dist/candlestick.common.js +2 -2
  20. package/dist/candlestick.esm.js +20 -10
  21. package/dist/candlestick.js +2 -2
  22. package/dist/column.common.js +2 -2
  23. package/dist/column.esm.js +20 -10
  24. package/dist/core.common.js +2 -2
  25. package/dist/core.esm.js +545 -463
  26. package/dist/donut.common.js +1 -1
  27. package/dist/donut.esm.js +1 -1
  28. package/dist/dumbbell.common.js +2 -2
  29. package/dist/dumbbell.esm.js +20 -10
  30. package/dist/features/all.common.js +2 -2
  31. package/dist/features/all.esm.js +364 -26
  32. package/dist/features/annotations.common.js +1 -1
  33. package/dist/features/annotations.esm.js +1 -1
  34. package/dist/features/annotations.js +1 -1
  35. package/dist/features/context-menu.common.js +1 -1
  36. package/dist/features/context-menu.esm.js +1 -1
  37. package/dist/features/context-menu.js +1 -1
  38. package/dist/features/drilldown.common.js +1 -1
  39. package/dist/features/drilldown.esm.js +1 -1
  40. package/dist/features/drilldown.js +1 -1
  41. package/dist/features/dumbbell.common.js +1 -1
  42. package/dist/features/dumbbell.esm.js +1 -1
  43. package/dist/features/dumbbell.js +1 -1
  44. package/dist/features/exports.common.js +2 -2
  45. package/dist/features/exports.esm.js +12 -14
  46. package/dist/features/exports.js +2 -2
  47. package/dist/features/facet.common.js +1 -1
  48. package/dist/features/facet.esm.js +1 -1
  49. package/dist/features/facet.js +1 -1
  50. package/dist/features/history.common.js +1 -1
  51. package/dist/features/history.esm.js +1 -1
  52. package/dist/features/history.js +1 -1
  53. package/dist/features/ink.common.js +1 -1
  54. package/dist/features/ink.esm.js +1 -1
  55. package/dist/features/ink.js +1 -1
  56. package/dist/features/keyboard.common.js +2 -2
  57. package/dist/features/keyboard.esm.js +14 -1
  58. package/dist/features/keyboard.js +2 -2
  59. package/dist/features/legend.common.js +1 -1
  60. package/dist/features/legend.esm.js +1 -1
  61. package/dist/features/legend.js +1 -1
  62. package/dist/features/link.common.js +1 -1
  63. package/dist/features/link.esm.js +38 -38
  64. package/dist/features/link.js +1 -1
  65. package/dist/features/marks.common.js +1 -1
  66. package/dist/features/marks.esm.js +1 -1
  67. package/dist/features/marks.js +1 -1
  68. package/dist/features/measure.common.js +1 -1
  69. package/dist/features/measure.esm.js +1 -1
  70. package/dist/features/measure.js +1 -1
  71. package/dist/features/morph.common.js +1 -1
  72. package/dist/features/morph.esm.js +1 -1
  73. package/dist/features/morph.js +1 -1
  74. package/dist/features/perspectives.common.js +1 -1
  75. package/dist/features/perspectives.esm.js +11 -11
  76. package/dist/features/perspectives.js +1 -1
  77. package/dist/features/raincloud.common.js +1 -1
  78. package/dist/features/raincloud.esm.js +1 -1
  79. package/dist/features/raincloud.js +1 -1
  80. package/dist/features/renderer-canvas.common.js +1 -1
  81. package/dist/features/renderer-canvas.esm.js +1 -1
  82. package/dist/features/renderer-canvas.js +1 -1
  83. package/dist/features/stats.common.js +1 -1
  84. package/dist/features/stats.esm.js +1 -1
  85. package/dist/features/stats.js +1 -1
  86. package/dist/features/storyboard.common.js +1 -1
  87. package/dist/features/storyboard.esm.js +11 -11
  88. package/dist/features/storyboard.js +1 -1
  89. package/dist/features/streamgraph.common.js +1 -1
  90. package/dist/features/streamgraph.esm.js +1 -1
  91. package/dist/features/streamgraph.js +1 -1
  92. package/dist/features/toolbar.common.js +2 -2
  93. package/dist/features/toolbar.esm.js +172 -25
  94. package/dist/features/toolbar.js +2 -2
  95. package/dist/features/trellis.common.js +1 -1
  96. package/dist/features/trellis.esm.js +1 -1
  97. package/dist/features/trellis.js +1 -1
  98. package/dist/features/waterfall.common.js +1 -1
  99. package/dist/features/waterfall.esm.js +1 -1
  100. package/dist/features/waterfall.js +1 -1
  101. package/dist/features/weave.common.js +2 -2
  102. package/dist/features/weave.esm.js +180 -2
  103. package/dist/features/weave.js +2 -2
  104. package/dist/heatmap.common.js +1 -1
  105. package/dist/heatmap.esm.js +1 -1
  106. package/dist/heatmap.js +1 -1
  107. package/dist/histogram.common.js +2 -2
  108. package/dist/histogram.esm.js +20 -10
  109. package/dist/line.common.js +1 -1
  110. package/dist/line.esm.js +1 -1
  111. package/dist/line.js +1 -1
  112. package/dist/pictograms.common.js +1 -1
  113. package/dist/pictograms.esm.js +1 -1
  114. package/dist/pictograms.js +1 -1
  115. package/dist/pie.common.js +1 -1
  116. package/dist/pie.esm.js +1 -1
  117. package/dist/pie.js +1 -1
  118. package/dist/polarArea.common.js +1 -1
  119. package/dist/polarArea.esm.js +1 -1
  120. package/dist/radar.common.js +1 -1
  121. package/dist/radar.esm.js +1 -1
  122. package/dist/radar.js +1 -1
  123. package/dist/radialBar.common.js +1 -1
  124. package/dist/radialBar.esm.js +1 -1
  125. package/dist/radialBar.js +1 -1
  126. package/dist/raincloud.common.js +2 -2
  127. package/dist/raincloud.esm.js +20 -10
  128. package/dist/rangeArea.common.js +1 -1
  129. package/dist/rangeArea.esm.js +1 -1
  130. package/dist/rangeBar.common.js +2 -2
  131. package/dist/rangeBar.esm.js +20 -10
  132. package/dist/scatter.common.js +1 -1
  133. package/dist/scatter.esm.js +1 -1
  134. package/dist/streamgraph.common.js +1 -1
  135. package/dist/streamgraph.esm.js +1 -1
  136. package/dist/sunburst.common.js +1 -1
  137. package/dist/sunburst.esm.js +1 -1
  138. package/dist/sunburst.js +1 -1
  139. package/dist/treemap.common.js +1 -1
  140. package/dist/treemap.esm.js +1 -1
  141. package/dist/treemap.js +1 -1
  142. package/dist/unit-shapes.common.js +1 -1
  143. package/dist/unit-shapes.esm.js +1 -1
  144. package/dist/unit-shapes.js +1 -1
  145. package/dist/unit.common.js +1 -1
  146. package/dist/unit.esm.js +79 -79
  147. package/dist/unit.js +1 -1
  148. package/dist/violin.common.js +2 -2
  149. package/dist/violin.esm.js +20 -10
  150. package/dist/violin.js +2 -2
  151. package/dist/waterfall.common.js +2 -2
  152. package/dist/waterfall.esm.js +20 -10
  153. package/package.json +2 -2
  154. package/src/apexcharts.js +39 -15
  155. package/src/charts/common/bar/Helpers.js +31 -12
  156. package/src/modules/Data.js +8 -2
  157. package/src/modules/Exports.js +14 -12
  158. package/src/modules/Formatters.js +24 -1
  159. package/src/modules/Range.js +28 -1
  160. package/src/modules/Toolbar.js +112 -2
  161. package/src/modules/ZoomPanSelection.js +85 -7
  162. package/src/modules/accessibility/KeyboardNavigation.js +14 -0
  163. package/src/modules/axes/YAxis.js +12 -15
  164. package/src/modules/helpers/UpdateHelpers.js +25 -8
  165. package/src/modules/settings/Globals.js +5 -10
  166. package/src/modules/settings/Options.js +15 -0
  167. package/src/modules/weave/PluginAPI.js +57 -1
  168. package/src/modules/weave/WeaveHost.js +148 -0
  169. package/src/ssr/DOMShim.js +50 -0
  170. package/src/types/internal.d.ts +1 -1
  171. package/src/utils/Utils.js +6 -9
  172. package/types/apexcharts.d.ts +17 -0
@@ -42,7 +42,7 @@ var __async = (__this, __arguments, generator) => {
42
42
  });
43
43
  };
44
44
  /*!
45
- * ApexCharts v7.2.0
45
+ * ApexCharts v7.4.0
46
46
  * (c) 2018-2026 ApexCharts
47
47
  */
48
48
 
@@ -82,6 +82,11 @@ var __async = (__this, __arguments, generator) => {
82
82
  return {};
83
83
  }
84
84
  }
85
+ const CHAR_WIDTH_EM = 0.55;
86
+ const ASCENT_EM = 0.917;
87
+ const DESCENT_EM = 0.25;
88
+ const LINE_HEIGHT_EM = 1.1;
89
+ const DEFAULT_FONT_SIZE = 11;
85
90
  class SSRElement {
86
91
  /**
87
92
  * @param {string} nodeName
@@ -202,6 +207,43 @@ var __async = (__this, __arguments, generator) => {
202
207
  y: 0
203
208
  };
204
209
  }
210
+ getBBox() {
211
+ if (this.nodeName !== "text" && this.nodeName !== "tspan") {
212
+ return { x: 0, y: 0, width: 0, height: 0 };
213
+ }
214
+ const lines = this._textLines();
215
+ const longest = lines.reduce((acc, line) => Math.max(acc, line.length), 0);
216
+ if (!longest) {
217
+ return { x: 0, y: 0, width: 0, height: 0 };
218
+ }
219
+ const fontSize = parseFloat(this.attributes.get("font-size")) || DEFAULT_FONT_SIZE;
220
+ const width = longest * fontSize * CHAR_WIDTH_EM;
221
+ const height = fontSize * (ASCENT_EM + DESCENT_EM) + (lines.length - 1) * fontSize * LINE_HEIGHT_EM;
222
+ const anchor = this.attributes.get("text-anchor");
223
+ const x = parseFloat(this.attributes.get("x")) || 0;
224
+ const y = parseFloat(this.attributes.get("y")) || 0;
225
+ return {
226
+ x: anchor === "middle" ? x - width / 2 : anchor === "end" ? x - width : x,
227
+ y: y - fontSize * ASCENT_EM,
228
+ width,
229
+ height
230
+ };
231
+ }
232
+ /**
233
+ * Text of this element, one entry per rendered line
234
+ * @returns {string[]}
235
+ */
236
+ _textLines() {
237
+ var _a;
238
+ const tspans = this.children.filter((child) => child.nodeName === "tspan");
239
+ if (tspans.length) {
240
+ return tspans.map((tspan) => {
241
+ var _a2;
242
+ return String((_a2 = tspan.textContent) != null ? _a2 : "");
243
+ });
244
+ }
245
+ return [String((_a = this.textContent) != null ? _a : "")];
246
+ }
205
247
  getRootNode() {
206
248
  let root = this;
207
249
  while (root.parentNode) {
@@ -691,15 +733,12 @@ var __async = (__this, __arguments, generator) => {
691
733
  return output;
692
734
  }
693
735
  // A per-series shallow copy: the series OBJECTS are copied, their data arrays
694
- // are shared. Almost every internal "mutation" of a series' data is a
695
- // property REPLACEMENT (`series[i].data = []` on legend collapse,
696
- // `series[i] = 0` for non-axis charts), and those cannot reach a copy made
697
- // this way because the series object was copied at capture time. The
698
- // exception is appendData(), whose push loop grows the shared data array in
699
- // place, so a copy taken before it does see the appended points; see the
700
- // note above defineLazyInitialSeries(). This is the same cheap shape
701
- // `globals.initialSeries` captures, so snapshotting a config stays O(n)
702
- // instead of deep-cloning every point.
736
+ // are shared. Every internal "mutation" of a series' data is a property
737
+ // REPLACEMENT (`series[i].data = []` on legend collapse, `series[i] = 0` for
738
+ // non-axis charts, appendData's concat), and those cannot reach a copy made
739
+ // this way because the series object was copied at capture time. This is the
740
+ // same cheap shape `globals.initialSeries` captures, so snapshotting a config
741
+ // stays O(n) instead of deep-cloning every point.
703
742
  /**
704
743
  * @param {any} series
705
744
  */
@@ -1042,16 +1081,16 @@ var __async = (__this, __arguments, generator) => {
1042
1081
  * @param {string} color
1043
1082
  */
1044
1083
  shadeRGBColor(percent, color) {
1045
- const f = color.split(","), t2 = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent, R2 = parseInt(f[0].slice(4), 10), G = parseInt(f[1], 10), B = parseInt(f[2], 10);
1046
- return "rgb(" + (Math.round((t2 - R2) * p) + R2) + "," + (Math.round((t2 - G) * p) + G) + "," + (Math.round((t2 - B) * p) + B) + ")";
1084
+ const f = color.split(","), t2 = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent, R = parseInt(f[0].slice(4), 10), G = parseInt(f[1], 10), B = parseInt(f[2], 10);
1085
+ return "rgb(" + (Math.round((t2 - R) * p) + R) + "," + (Math.round((t2 - G) * p) + G) + "," + (Math.round((t2 - B) * p) + B) + ")";
1047
1086
  }
1048
1087
  /**
1049
1088
  * @param {number} percent
1050
1089
  * @param {string} color
1051
1090
  */
1052
1091
  shadeHexColor(percent, color) {
1053
- const f = parseInt(color.slice(1), 16), t2 = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent, R2 = f >> 16, G = f >> 8 & 255, B = f & 255;
1054
- return "#" + (16777216 + (Math.round((t2 - R2) * p) + R2) * 65536 + (Math.round((t2 - G) * p) + G) * 256 + (Math.round((t2 - B) * p) + B)).toString(16).slice(1);
1092
+ const f = parseInt(color.slice(1), 16), t2 = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent, R = f >> 16, G = f >> 8 & 255, B = f & 255;
1093
+ return "#" + (16777216 + (Math.round((t2 - R) * p) + R) * 65536 + (Math.round((t2 - G) * p) + G) * 256 + (Math.round((t2 - B) * p) + B)).toString(16).slice(1);
1055
1094
  }
1056
1095
  // beautiful color shading blending code
1057
1096
  // http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color-or-rgb-and-blend-colors
@@ -1355,11 +1394,11 @@ var __async = (__this, __arguments, generator) => {
1355
1394
  format = format.replace(/(^|[^\\])yyyy+/g, "$1" + y);
1356
1395
  format = format.replace(/(^|[^\\])yy/g, "$1" + y.toString().substr(2, 2));
1357
1396
  format = format.replace(/(^|[^\\])y/g, "$1" + y);
1358
- const M2 = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1397
+ const M = (utc ? date.getUTCMonth() : date.getMonth()) + 1;
1359
1398
  format = format.replace(/(^|[^\\])MMMM+/g, "$1" + MMMM[0]);
1360
1399
  format = format.replace(/(^|[^\\])MMM/g, "$1" + MMM[0]);
1361
- format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M2));
1362
- format = format.replace(/(^|[^\\])M/g, "$1" + M2);
1400
+ format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M));
1401
+ format = format.replace(/(^|[^\\])M/g, "$1" + M);
1363
1402
  const d = utc ? date.getUTCDate() : date.getDate();
1364
1403
  format = format.replace(/(^|[^\\])dddd+/g, "$1" + dddd[0]);
1365
1404
  format = format.replace(/(^|[^\\])ddd/g, "$1" + ddd[0]);
@@ -1383,26 +1422,26 @@ var __async = (__this, __arguments, generator) => {
1383
1422
  format = format.replace(/(^|[^\\])ff/g, "$1" + ii(f));
1384
1423
  f = Math.round(f / 10);
1385
1424
  format = format.replace(/(^|[^\\])f/g, "$1" + f);
1386
- const T2 = H < 12 ? "AM" : "PM";
1387
- format = format.replace(/(^|[^\\])TT+/g, "$1" + T2);
1388
- format = format.replace(/(^|[^\\])T/g, "$1" + T2.charAt(0));
1389
- const t2 = T2.toLowerCase();
1425
+ const T = H < 12 ? "AM" : "PM";
1426
+ format = format.replace(/(^|[^\\])TT+/g, "$1" + T);
1427
+ format = format.replace(/(^|[^\\])T/g, "$1" + T.charAt(0));
1428
+ const t2 = T.toLowerCase();
1390
1429
  format = format.replace(/(^|[^\\])tt+/g, "$1" + t2);
1391
1430
  format = format.replace(/(^|[^\\])t/g, "$1" + t2.charAt(0));
1392
1431
  let tz = -date.getTimezoneOffset();
1393
- let K = utc || !tz ? "Z" : tz > 0 ? "+" : "-";
1432
+ let K2 = utc || !tz ? "Z" : tz > 0 ? "+" : "-";
1394
1433
  if (!utc) {
1395
1434
  tz = Math.abs(tz);
1396
1435
  const tzHrs = Math.floor(tz / 60);
1397
1436
  const tzMin = tz % 60;
1398
- K += ii(tzHrs) + ":" + ii(tzMin);
1437
+ K2 += ii(tzHrs) + ":" + ii(tzMin);
1399
1438
  }
1400
- format = format.replace(/(^|[^\\])K/g, "$1" + K);
1439
+ format = format.replace(/(^|[^\\])K/g, "$1" + K2);
1401
1440
  const day = (utc ? date.getUTCDay() : date.getDay()) + 1;
1402
1441
  format = format.replace(new RegExp(dddd[0], "g"), dddd[day]);
1403
1442
  format = format.replace(new RegExp(ddd[0], "g"), ddd[day]);
1404
- format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M2]);
1405
- format = format.replace(new RegExp(MMM[0], "g"), MMM[M2]);
1443
+ format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M]);
1444
+ format = format.replace(new RegExp(MMM[0], "g"), MMM[M]);
1406
1445
  format = format.replace(/\\(.)/g, "$1");
1407
1446
  return format;
1408
1447
  }
@@ -1870,6 +1909,7 @@ var __async = (__this, __arguments, generator) => {
1870
1909
  setLabelFormatters() {
1871
1910
  const w = this.w;
1872
1911
  const fmt = w.formatters;
1912
+ const inferredNumericX = w.axisFlags.isXNumeric && w.axisFlags.dataFormatXNumeric && w.config.xaxis.type !== "datetime" && !w.config.xaxis.convertedCatToNumeric && !w.globals.isBarHorizontal;
1873
1913
  fmt.xaxisTooltipFormatter = (val) => {
1874
1914
  return this.defaultGeneralFormatter(val);
1875
1915
  };
@@ -1886,8 +1926,13 @@ var __async = (__this, __arguments, generator) => {
1886
1926
  fmt.xLabelFormatter = w.config.xaxis.labels.formatter;
1887
1927
  } else {
1888
1928
  fmt.xLabelFormatter = (val) => {
1929
+ var _a;
1889
1930
  if (Utils$1.isNumber(val)) {
1890
- if (!w.config.xaxis.convertedCatToNumeric && w.config.xaxis.type === "numeric") {
1931
+ if (!w.config.xaxis.convertedCatToNumeric && (w.config.xaxis.type === "numeric" || inferredNumericX)) {
1932
+ const ticks = (_a = w.globals.xAxisScale) == null ? void 0 : _a.result;
1933
+ if (inferredNumericX && Array.isArray(ticks) && ticks.every(Number.isInteger)) {
1934
+ return val.toFixed(0);
1935
+ }
1891
1936
  if (Utils$1.isNumber(w.config.xaxis.decimalsInFloat)) {
1892
1937
  return val.toFixed(w.config.xaxis.decimalsInFloat);
1893
1938
  } else {
@@ -1913,6 +1958,12 @@ var __async = (__this, __arguments, generator) => {
1913
1958
  }
1914
1959
  if (typeof w.config.tooltip.x.formatter === "function") {
1915
1960
  fmt.ttKeyFormatter = w.config.tooltip.x.formatter;
1961
+ } else if (w.config.xaxis.labels.formatter === void 0 && inferredNumericX) {
1962
+ const xLabelFormatter = (
1963
+ /** @type {(val: any) => any} */
1964
+ fmt.xLabelFormatter
1965
+ );
1966
+ fmt.ttKeyFormatter = (val) => Number.isInteger(val) ? val.toFixed(0) : xLabelFormatter(val);
1916
1967
  } else {
1917
1968
  fmt.ttKeyFormatter = fmt.xLabelFormatter;
1918
1969
  }
@@ -2771,6 +2822,17 @@ var __async = (__this, __arguments, generator) => {
2771
2822
  // around the pinch centroid (matching the x-only wheel/toolbar zoom),
2772
2823
  // frame-by-frame rather than the 400ms wheel throttle.
2773
2824
  pinch: "auto",
2825
+ // Drag-to-zoom is deliberate, so it is not gated the way those two
2826
+ // are: it stays on with the toolbar hidden. The reset button that
2827
+ // undoes it does not, which leaves the viewer in a window with no
2828
+ // exit. So while the chart IS zoomed and nothing else on screen can
2829
+ // reset it, one reset control is drawn where the toolbar would have
2830
+ // been, and it goes when the range does. A chart nobody zooms is
2831
+ // untouched. Set false for a page that supplies its own reset (which
2832
+ // also turns off the Escape shortcut), or true to force the control
2833
+ // on whenever the chart is zoomed, even where `toolbar.tools.reset`
2834
+ // is off.
2835
+ resetControl: "auto",
2774
2836
  zoomedArea: {
2775
2837
  fill: {
2776
2838
  color: "#90CAF9",
@@ -2837,6 +2899,11 @@ var __async = (__this, __arguments, generator) => {
2837
2899
  borderRadius: 0,
2838
2900
  borderRadiusApplication: "around",
2839
2901
  // [around, end]
2902
+ // Which segments of a stack round. 'all' caps both ends of the
2903
+ // stack (baseline and far end); 'last' caps only the far end, so
2904
+ // the stack sits square on the baseline. Stacked charts only.
2905
+ borderRadiusWhenStacked: "all",
2906
+ // [all, last]
2840
2907
  rangeBarOverlap: true,
2841
2908
  rangeBarGroupRows: false,
2842
2909
  hideZeroBarsWhenGrouped: false,
@@ -7625,16 +7692,11 @@ var __async = (__this, __arguments, generator) => {
7625
7692
  * which cannot reach the captured copies because each series object was
7626
7693
  * copied at capture time.
7627
7694
  *
7628
- * The one in-place mutator is appendData(), whose push loop grows the shared
7629
- * data array. Re-capturing after it does not undo that: the pushed points
7630
- * are already in the array both snapshots point at, so a snapshot taken
7631
- * before the append reads back as appended. That is the documented
7632
- * behaviour of appendData(overwriteInitialSeries = true), and the `false`
7633
- * case is not honoured for a separate, older reason: Data.parseData()
7634
- * re-captures initialSeries unconditionally on the re-render appendData
7635
- * triggers. Detaching would mean copying the data arrays, which is exactly
7636
- * the per-point cost this snapshot exists to avoid. The same exception
7637
- * applies to `initialConfig.series`, which is captured with the same shape.
7695
+ * appendData() used to be the exception, growing the shared data array in
7696
+ * place. It now replaces the array instead (`data = data.concat(newData)`):
7697
+ * one array copy per call, against the per-point cost this snapshot exists
7698
+ * to avoid. With that, no internal edit can reach a captured copy. The same
7699
+ * holds for `initialConfig.series`, which is captured with the same shape.
7638
7700
  *
7639
7701
  * @param {Record<string, any>} globals
7640
7702
  */
@@ -8211,7 +8273,7 @@ var __async = (__this, __arguments, generator) => {
8211
8273
  includedIndexes.push(si);
8212
8274
  }
8213
8275
  });
8214
- const excludedIndices = w.seriesData.series.map((_, fi) => includedIndexes.indexOf(fi) === -1 ? fi : -1).filter((f) => f !== -1);
8276
+ const excludedIndices = w.seriesData.series.map((_2, fi) => includedIndexes.indexOf(fi) === -1 ? fi : -1).filter((f) => f !== -1);
8215
8277
  total.push(this.getStackedSeriesTotals(excludedIndices));
8216
8278
  });
8217
8279
  return total;
@@ -8616,7 +8678,7 @@ var __async = (__this, __arguments, generator) => {
8616
8678
  _gl.yLogRatio = yRatio.slice();
8617
8679
  _gl.logYRange = /** @type {any[]} */
8618
8680
  gl.yRange.map(
8619
- (_, i2) => {
8681
+ (_2, i2) => {
8620
8682
  const yAxisIndex = w.globals.seriesYAxisReverseMap[i2];
8621
8683
  if (w.config.yaxis[yAxisIndex] && this.w.config.yaxis[yAxisIndex].logarithmic) {
8622
8684
  const range = 1;
@@ -8982,11 +9044,11 @@ var __async = (__this, __arguments, generator) => {
8982
9044
  return false;
8983
9045
  }
8984
9046
  function arcToBezier(pos, val) {
8985
- var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A2 = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O2, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
8986
- if (rx === 0 || ry === 0 || A2.x === B.x && A2.y === B.y) {
8987
- return [["C", A2.x, A2.y, B.x, B.y, B.x, B.y]];
9047
+ var rx = Math.abs(val[1]), ry = Math.abs(val[2]), xAxisRotation = val[3] % 360, largeArcFlag = val[4], sweepFlag = val[5], x = val[6], y = val[7], A = new Point(pos[0], pos[1]), B = new Point(x, y), primedCoord, lambda, mat, k, c, cSquare, t2, O2, OA, OB, tetaStart, tetaEnd, deltaTeta, nbSectors, f, arcSegPoints, angle, sinAngle, cosAngle, pt, i2, il, retVal = [], x1, y1, x2, y2;
9048
+ if (rx === 0 || ry === 0 || A.x === B.x && A.y === B.y) {
9049
+ return [["C", A.x, A.y, B.x, B.y, B.x, B.y]];
8988
9050
  }
8989
- primedCoord = new Point((A2.x - B.x) / 2, (A2.y - B.y) / 2).transform(
9051
+ primedCoord = new Point((A.x - B.x) / 2, (A.y - B.y) / 2).transform(
8990
9052
  // Start with the identity matrix (no args → Matrix defaults a=d=1, others 0).
8991
9053
  // Passing all-zero args here would produce a degenerate zero matrix, since
8992
9054
  // `0 ?? 1` is `0`, not `1` — every subsequent transform then yields (0,0)
@@ -9002,9 +9064,9 @@ var __async = (__this, __arguments, generator) => {
9002
9064
  }
9003
9065
  mat = /** @type {any} */
9004
9066
  new Matrix().rotate(xAxisRotation).scale(1 / rx, 1 / ry).rotate(-xAxisRotation);
9005
- A2 = A2.transform(mat);
9067
+ A = A.transform(mat);
9006
9068
  B = B.transform(mat);
9007
- k = [B.x - A2.x, B.y - A2.y];
9069
+ k = [B.x - A.x, B.y - A.y];
9008
9070
  cSquare = k[0] * k[0] + k[1] * k[1];
9009
9071
  c = Math.sqrt(cSquare);
9010
9072
  k[0] /= c;
@@ -9013,8 +9075,8 @@ var __async = (__this, __arguments, generator) => {
9013
9075
  if (largeArcFlag === sweepFlag) {
9014
9076
  t2 *= -1;
9015
9077
  }
9016
- O2 = new Point((B.x + A2.x) / 2 + t2 * -k[1], (B.y + A2.y) / 2 + t2 * k[0]);
9017
- OA = new Point(A2.x - O2.x, A2.y - O2.y);
9078
+ O2 = new Point((B.x + A.x) / 2 + t2 * -k[1], (B.y + A.y) / 2 + t2 * k[0]);
9079
+ OA = new Point(A.x - O2.x, A.y - O2.y);
9018
9080
  OB = new Point(B.x - O2.x, B.y - O2.y);
9019
9081
  tetaStart = Math.acos(OA.x / Math.sqrt(OA.x * OA.x + OA.y * OA.y));
9020
9082
  if (OA.y < 0) tetaStart *= -1;
@@ -9645,7 +9707,7 @@ var __async = (__this, __arguments, generator) => {
9645
9707
  _reducedMotionMql = window.matchMedia("(prefers-reduced-motion: reduce)");
9646
9708
  }
9647
9709
  return !!_reducedMotionMql.matches;
9648
- } catch (_) {
9710
+ } catch (_2) {
9649
9711
  return false;
9650
9712
  }
9651
9713
  }
@@ -10008,7 +10070,7 @@ var __async = (__this, __arguments, generator) => {
10008
10070
  if (typeof node.getTotalLength === "function") {
10009
10071
  len = node.getTotalLength();
10010
10072
  }
10011
- } catch (_) {
10073
+ } catch (_2) {
10012
10074
  len = 0;
10013
10075
  }
10014
10076
  if (!len) {
@@ -15531,7 +15593,17 @@ var __async = (__this, __arguments, generator) => {
15531
15593
  let ticks = 10;
15532
15594
  if (cnf.xaxis.tickAmount === void 0) {
15533
15595
  ticks = Math.round(gl.svgWidth / 150);
15534
- if (cnf.xaxis.type === "numeric" && gl.dataPoints < 30) {
15596
+ const inferredNumericX = this.w.axisFlags.isXNumeric && this.w.axisFlags.dataFormatXNumeric && cnf.xaxis.type !== "datetime" && !cnf.xaxis.convertedCatToNumeric && !gl.isBarHorizontal;
15597
+ const fontSize = parseFloat(cnf.xaxis.labels.style.fontSize) || 12;
15598
+ const widestLabelLength = this.w.labelData.labels.reduce(
15599
+ (widest, seriesLabels) => Array.isArray(seriesLabels) ? seriesLabels.reduce(
15600
+ (seriesWidest, label) => Math.max(seriesWidest, String(label).length),
15601
+ widest
15602
+ ) : widest,
15603
+ 0
15604
+ );
15605
+ const allPointLabelsFit = gl.dataPoints * widestLabelLength * fontSize * 0.6 <= gl.svgWidth;
15606
+ if ((cnf.xaxis.type === "numeric" || inferredNumericX && allPointLabelsFit) && gl.dataPoints < 30) {
15535
15607
  ticks = gl.dataPoints - 1;
15536
15608
  }
15537
15609
  if (ticks > gl.dataPoints && gl.dataPoints !== 0) {
@@ -15755,7 +15827,7 @@ var __async = (__this, __arguments, generator) => {
15755
15827
  });
15756
15828
  Object.entries(stackedPoss).forEach(([key]) => {
15757
15829
  stackedPoss[key].forEach(
15758
- (_, stgi) => {
15830
+ (_2, stgi) => {
15759
15831
  gl.maxY = Math.max(gl.maxY, stackedPoss[key][stgi]);
15760
15832
  gl.minY = Math.min(gl.minY, stackedNegs[key][stgi]);
15761
15833
  }
@@ -16226,42 +16298,30 @@ var __async = (__this, __arguments, generator) => {
16226
16298
  }
16227
16299
  setYAxisTextAlignments() {
16228
16300
  const w = this.w;
16229
- const yaxis = Array.from(
16230
- w.dom.baseEl.getElementsByClassName("apexcharts-yaxis")
16231
- );
16232
- yaxis.forEach((y, index) => {
16233
- const yaxe = w.config.yaxis[index];
16301
+ w.config.yaxis.forEach((yaxe, index) => {
16234
16302
  if (yaxe && !yaxe.floating && yaxe.labels.align !== void 0) {
16235
16303
  const yAxisInner = w.dom.baseEl.querySelector(
16236
16304
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-texts-g`
16237
16305
  );
16306
+ if (!yAxisInner) return;
16238
16307
  const yAxisTexts = Array.from(
16239
16308
  w.dom.baseEl.querySelectorAll(
16240
16309
  `.apexcharts-yaxis[rel='${index}'] .apexcharts-yaxis-label`
16241
16310
  )
16242
16311
  );
16243
- const rect = (
16244
- /** @type {Element} */
16245
- yAxisInner.getBoundingClientRect()
16246
- );
16312
+ const rect = yAxisInner.getBoundingClientRect();
16247
16313
  yAxisTexts.forEach((label) => {
16248
16314
  label.setAttribute("text-anchor", yaxe.labels.align);
16249
16315
  });
16250
16316
  if (yaxe.labels.align === "left" && !yaxe.opposite) {
16251
- yAxisInner.setAttribute(
16252
- "transform",
16253
- `translate(-${rect.width}, 0)`
16254
- );
16317
+ yAxisInner.setAttribute("transform", `translate(-${rect.width}, 0)`);
16255
16318
  } else if (yaxe.labels.align === "center") {
16256
16319
  yAxisInner.setAttribute(
16257
16320
  "transform",
16258
16321
  `translate(${rect.width / 2 * (!yaxe.opposite ? -1 : 1)}, 0)`
16259
16322
  );
16260
16323
  } else if (yaxe.labels.align === "right" && yaxe.opposite) {
16261
- yAxisInner.setAttribute(
16262
- "transform",
16263
- `translate(${rect.width}, 0)`
16264
- );
16324
+ yAxisInner.setAttribute("transform", `translate(${rect.width}, 0)`);
16265
16325
  }
16266
16326
  }
16267
16327
  });
@@ -17121,9 +17181,9 @@ var __async = (__this, __arguments, generator) => {
17121
17181
  if (!Array.isArray(oldY) || !Array.isArray(newY)) return null;
17122
17182
  if (!oldY.length || !newY.length) return null;
17123
17183
  const oldKeys = uniquifyKeys(
17124
- oldY.map((_, j2) => frameDatumKey(frame, realIndex, j2))
17184
+ oldY.map((_2, j2) => frameDatumKey(frame, realIndex, j2))
17125
17185
  );
17126
- const newKeys = uniquifyKeys(newY.map((_, j2) => datumKey(w, realIndex, j2)));
17186
+ const newKeys = uniquifyKeys(newY.map((_2, j2) => datumKey(w, realIndex, j2)));
17127
17187
  const join = joinKeys(oldKeys, newKeys);
17128
17188
  if (!join.ordered && !allowReorder) return null;
17129
17189
  if (!join.changed && !includeIdentity) return null;
@@ -17313,7 +17373,7 @@ var __async = (__this, __arguments, generator) => {
17313
17373
  origin = Math.abs(start.y - (bb.y + bb.height)) <= Math.abs(start.y - bb.y) ? "center bottom" : "center top";
17314
17374
  }
17315
17375
  }
17316
- } catch (_) {
17376
+ } catch (_2) {
17317
17377
  }
17318
17378
  const style = node.style;
17319
17379
  style.transformBox = "fill-box";
@@ -17430,7 +17490,7 @@ var __async = (__this, __arguments, generator) => {
17430
17490
  xScale: currentXScale(w),
17431
17491
  yAnchors: currentYAnchors(w, yLabels)
17432
17492
  };
17433
- } catch (_) {
17493
+ } catch (_2) {
17434
17494
  gl.prevChromeFrame = null;
17435
17495
  }
17436
17496
  }
@@ -17622,7 +17682,7 @@ var __async = (__this, __arguments, generator) => {
17622
17682
  if (!chrome || !gl.axisCharts || !Environment.isBrowser()) return;
17623
17683
  if (!lengthTransitionEnabled(w)) return;
17624
17684
  const anyMotion = (w.seriesData.series || []).some(
17625
- (_, i2) => seriesJoin(w, i2, true, true) !== null
17685
+ (_2, i2) => seriesJoin(w, i2, true, true) !== null
17626
17686
  );
17627
17687
  if (!anyMotion) return;
17628
17688
  const root = w.dom.baseEl;
@@ -17663,7 +17723,7 @@ var __async = (__this, __arguments, generator) => {
17663
17723
  ease,
17664
17724
  project: projY
17665
17725
  });
17666
- } catch (_) {
17726
+ } catch (_2) {
17667
17727
  }
17668
17728
  }
17669
17729
  const DL_GROUP_SEL = ".apexcharts-data-labels[data\\:dlKey]";
@@ -17723,7 +17783,7 @@ var __async = (__this, __arguments, generator) => {
17723
17783
  });
17724
17784
  });
17725
17785
  gl.prevDataLabels = map.size ? map : null;
17726
- } catch (_) {
17786
+ } catch (_2) {
17727
17787
  gl.prevDataLabels = null;
17728
17788
  }
17729
17789
  }
@@ -17786,7 +17846,7 @@ var __async = (__this, __arguments, generator) => {
17786
17846
  if (typeof formatter === "function") {
17787
17847
  try {
17788
17848
  out = formatter(rounded, fmtOpts);
17789
- } catch (_) {
17849
+ } catch (_2) {
17790
17850
  out = rounded;
17791
17851
  }
17792
17852
  }
@@ -17900,7 +17960,7 @@ var __async = (__this, __arguments, generator) => {
17900
17960
  });
17901
17961
  }
17902
17962
  });
17903
- } catch (_) {
17963
+ } catch (_2) {
17904
17964
  }
17905
17965
  }
17906
17966
  class Series {
@@ -21929,7 +21989,7 @@ var __async = (__this, __arguments, generator) => {
21929
21989
  const point = data[j2];
21930
21990
  const x = point[0];
21931
21991
  const y = point[1];
21932
- const z = point[2];
21992
+ const z2 = point[2];
21933
21993
  if (typeof y !== "undefined") {
21934
21994
  if (Array.isArray(y) && y.length === 4 && !isBoxPlot) {
21935
21995
  this.twoDSeries.push(Utils$1.parseNumber(y[3]));
@@ -21946,8 +22006,8 @@ var __async = (__this, __arguments, generator) => {
21946
22006
  } else {
21947
22007
  this.twoDSeriesX.push(x);
21948
22008
  }
21949
- if (typeof z !== "undefined") {
21950
- this.threeDSeries.push(z);
22009
+ if (typeof z2 !== "undefined") {
22010
+ this.threeDSeries.push(z2);
21951
22011
  this.w.axisFlags.isDataXYZ = true;
21952
22012
  }
21953
22013
  }
@@ -22829,7 +22889,7 @@ var __async = (__this, __arguments, generator) => {
22829
22889
  }
22830
22890
  const x = this.getNestedValue(item, effectiveParsing.x);
22831
22891
  let y;
22832
- let z = void 0;
22892
+ let z2 = void 0;
22833
22893
  if (Array.isArray(effectiveParsing.y)) {
22834
22894
  const yValues = effectiveParsing.y.map(
22835
22895
  (fieldName) => this.getNestedValue(item, fieldName)
@@ -22848,7 +22908,7 @@ var __async = (__this, __arguments, generator) => {
22848
22908
  y = this.getNestedValue(item, effectiveParsing.y);
22849
22909
  }
22850
22910
  if (effectiveParsing.z) {
22851
- z = this.getNestedValue(item, effectiveParsing.z);
22911
+ z2 = this.getNestedValue(item, effectiveParsing.z);
22852
22912
  }
22853
22913
  if (x === void 0) {
22854
22914
  console.warn(
@@ -22867,8 +22927,8 @@ var __async = (__this, __arguments, generator) => {
22867
22927
  result.z = zValue;
22868
22928
  }
22869
22929
  }
22870
- if (z !== void 0) {
22871
- result.z = z;
22930
+ if (z2 !== void 0) {
22931
+ result.z = z2;
22872
22932
  }
22873
22933
  return result;
22874
22934
  }
@@ -23140,8 +23200,11 @@ var __async = (__this, __arguments, generator) => {
23140
23200
  // Segregate user provided data into appropriate vars
23141
23201
  /**
23142
23202
  * @param {any[]} ser
23203
+ * @param {boolean} [overwriteInitialSeries=true] false when the caller hands
23204
+ * back the series the chart already has (an internal re-render), so the
23205
+ * baseline resetSeries() restores must not move.
23143
23206
  */
23144
- parseData(ser) {
23207
+ parseData(ser, overwriteInitialSeries = true) {
23145
23208
  var _a, _b, _c, _d, _e, _f, _g;
23146
23209
  const w = this.w;
23147
23210
  const cnf = w.config;
@@ -23174,7 +23237,8 @@ var __async = (__this, __arguments, generator) => {
23174
23237
  ser = ser.map((s2) => __spreadValues({}, s2));
23175
23238
  }
23176
23239
  cnf.series = ser;
23177
- if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
23240
+ if (!overwriteInitialSeries) ;
23241
+ else if (gl.dataReducerRawSeries && ((_g = cnf.chart.dataReducer) == null ? void 0 : _g.enabled)) {
23178
23242
  const stash = gl.dataReducerRawSeries;
23179
23243
  gl.initialSeries = ser.map((s2, i2) => {
23180
23244
  var _a2, _b2, _c2;
@@ -23614,7 +23678,9 @@ var __async = (__this, __arguments, generator) => {
23614
23678
  );
23615
23679
  initialConfig.series = !options2.series && prevInitialSeries ? prevInitialSeries : Utils$1.copySeriesShallow(w.config.series);
23616
23680
  w.globals.initialConfig = initialConfig;
23617
- w.globals.initialSeries = w.config.series;
23681
+ if (options2.series) {
23682
+ w.globals.initialSeries = w.config.series;
23683
+ }
23618
23684
  }
23619
23685
  if (options2.series && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
23620
23686
  ch.series.reconcileCollapsedByName();
@@ -23663,14 +23729,20 @@ var __async = (__this, __arguments, generator) => {
23663
23729
  w.globals.streamgraphRawSeries = null;
23664
23730
  w.globals.treemapRawSeries = null;
23665
23731
  }
23732
+ const definedSeries = newSeries;
23733
+ let reconciledCollapses = false;
23666
23734
  if (w.globals.axisCharts && (w.globals.collapsedSeriesIndices.length > 0 || w.globals.ancillaryCollapsedSeriesIndices.length > 0)) {
23667
23735
  newSeries = newSeries.map(
23668
23736
  (s2) => s2 && typeof s2 === "object" ? __spreadValues({}, s2) : s2
23669
23737
  );
23670
23738
  this.ctx.series.reconcileCollapsedByName(newSeries);
23739
+ reconciledCollapses = true;
23671
23740
  }
23672
23741
  this.ctx.data.resetParsingFlags();
23673
- const parsedState = this.ctx.data.parseData(newSeries);
23742
+ const parsedState = this.ctx.data.parseData(
23743
+ newSeries,
23744
+ overwriteInitialSeries
23745
+ );
23674
23746
  this.ctx._writeParsedSeriesData(parsedState.seriesData);
23675
23747
  this.ctx._writeParsedRangeData(parsedState.rangeData);
23676
23748
  this.ctx._writeParsedCandleData(parsedState.candleData);
@@ -23679,10 +23751,12 @@ var __async = (__this, __arguments, generator) => {
23679
23751
  if (overwriteInitialSeries) {
23680
23752
  if (w.globals.initialConfig) {
23681
23753
  w.globals.initialConfig.series = Utils$1.copySeriesShallow(
23682
- w.config.series
23754
+ reconciledCollapses ? definedSeries : w.config.series
23683
23755
  );
23684
23756
  }
23685
- w.globals.initialSeries = w.config.series;
23757
+ if (reconciledCollapses) {
23758
+ w.globals.initialSeries = definedSeries;
23759
+ }
23686
23760
  }
23687
23761
  if (this._canUseFastPath(newSeries, prevSeriesCount, prevDataLengths, w)) {
23688
23762
  return this.ctx.fastUpdate(animate, prevAxisScaleSig).then(() => {
@@ -29323,14 +29397,14 @@ var __async = (__this, __arguments, generator) => {
29323
29397
  const t2 = __spreadProps(__spreadValues({}, n2), { signatureVerified: true });
29324
29398
  return void (this.licenseKey === e2 ? this.publish(t2) : this.notify(t2));
29325
29399
  }
29326
- const h = "Invalid license key. The license signature does not verify.", d = { data: i2.data, expired: false, message: h, signatureVerified: true, valid: false };
29327
- this.licenseKey === e2 ? this.publish(d) : this.notify(d), t(`[Apex] ${h}`);
29400
+ const u = "Invalid license key. The license signature does not verify.", h = { data: i2.data, expired: false, message: u, signatureVerified: true, valid: false };
29401
+ this.licenseKey === e2 ? this.publish(h) : this.notify(h), t(`[Apex] ${u}`);
29328
29402
  });
29329
29403
  }
29330
29404
  };
29331
29405
  l.publicKeysSpki = ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="], l.verdicts = /* @__PURE__ */ new Map(), l.verifying = /* @__PURE__ */ new Set(), l.warnedUnverifiable = false, l.epoch = 0;
29332
29406
  let o = l;
29333
- const A = class {
29407
+ const j = class {
29334
29408
  static applyStyles(e2) {
29335
29409
  Object.assign(e2.style, this.CRITICAL_STYLES, { backgroundImage: this.createWatermarkPattern(), backgroundRepeat: "repeat" });
29336
29410
  }
@@ -29388,34 +29462,34 @@ var __async = (__this, __arguments, generator) => {
29388
29462
  })));
29389
29463
  }
29390
29464
  };
29391
- A.WATERMARK_ATTR = "data-apexcharts-watermark", A.WATERMARK_TEXT = "APEXCHARTS", A.ATTR = "data-apexcharts-watermark", A.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, A.managed = /* @__PURE__ */ new Set(), A.subscribed = false;
29392
- let M = A;
29393
- const L = 0.05, T = 0.05, j = 1 / 45;
29394
- function E(e2, t2, s2, i2) {
29465
+ j.WATERMARK_ATTR = "data-apexcharts-watermark", j.WATERMARK_TEXT = "APEXCHARTS", j.ATTR = "data-apexcharts-watermark", j.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, j.managed = /* @__PURE__ */ new Set(), j.subscribed = false;
29466
+ let C = j;
29467
+ const D = 0.05, K = 0.05, O = 1 / 45;
29468
+ function $(e2, t2, s2, i2) {
29395
29469
  const n2 = { value: e2, velocity: 0, target: e2, stiffness: t2, damping: s2 };
29396
29470
  return n2;
29397
29471
  }
29398
- function R(e2, t2) {
29399
- if (t2 <= 0) return O(e2);
29472
+ function q(e2, t2) {
29473
+ if (t2 <= 0) return W(e2);
29400
29474
  let s2 = t2;
29401
29475
  for (; s2 > 0; ) {
29402
- const t3 = Math.min(s2, j), i2 = -e2.stiffness * (e2.value - e2.target) - e2.damping * e2.velocity;
29476
+ const t3 = Math.min(s2, O), i2 = -e2.stiffness * (e2.value - e2.target) - e2.damping * e2.velocity;
29403
29477
  e2.velocity += i2 * t3, e2.value += e2.velocity * t3, s2 -= t3;
29404
29478
  }
29405
- return !!O(e2) && (e2.value = e2.target, e2.velocity = 0, true);
29479
+ return !!W(e2) && (e2.value = e2.target, e2.velocity = 0, true);
29406
29480
  }
29407
- function D(e2, t2) {
29481
+ function _(e2, t2) {
29408
29482
  e2.target = t2;
29409
29483
  }
29410
- function O(e2) {
29484
+ function W(e2) {
29411
29485
  var _a, _b;
29412
- const t2 = (_a = e2.restVelocity) != null ? _a : L, s2 = (_b = e2.restDisplacement) != null ? _b : T;
29486
+ const t2 = (_a = e2.restVelocity) != null ? _a : D, s2 = (_b = e2.restDisplacement) != null ? _b : K;
29413
29487
  return Math.abs(e2.velocity) < t2 && Math.abs(e2.value - e2.target) < s2;
29414
29488
  }
29415
- const $ = { crisp: [210, 26], gentle: [120, 20], snappy: [320, 30] };
29416
- function q(e2) {
29489
+ const V = { crisp: [210, 26], gentle: [120, 20], snappy: [320, 30] };
29490
+ function z(e2) {
29417
29491
  var _a;
29418
- return (_a = $[e2 != null ? e2 : "crisp"]) != null ? _a : $.crisp;
29492
+ return (_a = V[e2 != null ? e2 : "crisp"]) != null ? _a : V.crisp;
29419
29493
  }
29420
29494
  const PRICING_URL = "https://apexcharts.com/pricing";
29421
29495
  let _perspectivesTokenDecoded = false;
@@ -29469,15 +29543,15 @@ var __async = (__this, __arguments, generator) => {
29469
29543
  return typeof plan === "string" && PREMIUM_PLANS.has(plan.toLowerCase());
29470
29544
  }
29471
29545
  function reinstateWatermark(ctx, elWrap) {
29472
- const node = M.add(elWrap, { manage: false });
29546
+ const node = C.add(elWrap, { manage: false });
29473
29547
  if (!node || typeof MutationObserver === "undefined") return;
29474
29548
  if (ctx._wmNodeObserver && ctx._wmObservedNode === node) return;
29475
29549
  if (ctx._wmNodeObserver) ctx._wmNodeObserver.disconnect();
29476
29550
  const nodeObs = new MutationObserver(() => {
29477
- const n2 = M.node(elWrap);
29551
+ const n2 = C.node(elWrap);
29478
29552
  if (!n2) return;
29479
29553
  nodeObs.disconnect();
29480
- M.applyStyles(n2);
29554
+ C.applyStyles(n2);
29481
29555
  nodeObs.takeRecords();
29482
29556
  nodeObs.observe(n2, { attributes: true, attributeFilter: ["style"] });
29483
29557
  });
@@ -29489,7 +29563,7 @@ var __async = (__this, __arguments, generator) => {
29489
29563
  reinstateWatermark(ctx, elWrap);
29490
29564
  if (typeof MutationObserver === "undefined" || ctx._wmWrapObserver) return;
29491
29565
  const wrapObs = new MutationObserver(() => {
29492
- if (!M.node(elWrap)) reinstateWatermark(ctx, elWrap);
29566
+ if (!C.node(elWrap)) reinstateWatermark(ctx, elWrap);
29493
29567
  });
29494
29568
  wrapObs.observe(elWrap, { childList: true });
29495
29569
  ctx._wmWrapObserver = wrapObs;
@@ -29505,7 +29579,7 @@ var __async = (__this, __arguments, generator) => {
29505
29579
  }
29506
29580
  ctx._wmObservedNode = null;
29507
29581
  const wrap = elWrap || ctx.w && ctx.w.dom && ctx.w.dom.elWrap;
29508
- if (wrap) M.remove(wrap, { manage: false });
29582
+ if (wrap) C.remove(wrap, { manage: false });
29509
29583
  }
29510
29584
  function notifyTrial(ctx, key, features) {
29511
29585
  if (ctx._premiumLicenseNotified) return;
@@ -29882,8 +29956,9 @@ var __async = (__this, __arguments, generator) => {
29882
29956
  /**
29883
29957
  * @param {any[]} ser
29884
29958
  * @param {object} opts
29959
+ * @param {boolean} [overwriteInitialSeries=true]
29885
29960
  */
29886
- create(ser, opts) {
29961
+ create(ser, opts, overwriteInitialSeries = true) {
29887
29962
  var _a, _b, _c, _d, _e, _f;
29888
29963
  const w = this.w;
29889
29964
  if (!this.core) {
@@ -29930,7 +30005,7 @@ var __async = (__this, __arguments, generator) => {
29930
30005
  if (Environment.isBrowser()) {
29931
30006
  this.events.setupEventHandlers();
29932
30007
  }
29933
- const parsedState = this.data.parseData(series);
30008
+ const parsedState = this.data.parseData(series, overwriteInitialSeries);
29934
30009
  this._writeParsedSeriesData(parsedState.seriesData);
29935
30010
  this._writeParsedRangeData(parsedState.rangeData);
29936
30011
  this._writeParsedCandleData(parsedState.candleData);
@@ -29997,7 +30072,7 @@ var __async = (__this, __arguments, generator) => {
29997
30072
  const me = this;
29998
30073
  const w = me.w;
29999
30074
  return new Promise((resolve, reject) => {
30000
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
30075
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
30001
30076
  if (me.el === null) {
30002
30077
  return reject(
30003
30078
  new Error("Not enough data to display or target element not found")
@@ -30095,9 +30170,11 @@ var __async = (__this, __arguments, generator) => {
30095
30170
  }
30096
30171
  if (w.config.chart.toolbar.show && !w.globals.allSeriesCollapsed) {
30097
30172
  (_k = me.toolbar) == null ? void 0 : _k.createToolbar();
30173
+ } else if (!w.globals.allSeriesCollapsed && ((_l = me.toolbar) == null ? void 0 : _l.resetControlDue())) {
30174
+ me.toolbar.createToolbar({ resetOnly: true });
30098
30175
  }
30099
30176
  }
30100
- (_l = me.weave) == null ? void 0 : _l.dispatch("draw", {
30177
+ (_m = me.weave) == null ? void 0 : _m.dispatch("draw", {
30101
30178
  pass: "full",
30102
30179
  xyRatios: graphData == null ? void 0 : graphData.xyRatios
30103
30180
  });
@@ -30286,6 +30363,7 @@ var __async = (__this, __arguments, generator) => {
30286
30363
  * @returns {Promise<ApexCharts>} Resolves with the chart instance after re-render.
30287
30364
  */
30288
30365
  appendData(newData, overwriteInitialSeries = true) {
30366
+ var _a;
30289
30367
  const me = this;
30290
30368
  me.data.resetParsingFlags();
30291
30369
  me.w.globals.dataChanged = true;
@@ -30300,14 +30378,13 @@ var __async = (__this, __arguments, generator) => {
30300
30378
  newData[i2]
30301
30379
  );
30302
30380
  if (src && Array.isArray(src.data) && Array.isArray(derivedRaw[i2].data)) {
30303
- for (let j2 = 0; j2 < src.data.length; j2++) {
30304
- derivedRaw[i2].data.push(src.data[j2]);
30305
- }
30381
+ derivedRaw[i2].data = derivedRaw[i2].data.concat(src.data);
30306
30382
  }
30307
30383
  }
30308
- return this.update();
30384
+ return this.update(void 0, overwriteInitialSeries);
30309
30385
  }
30310
30386
  const newSeries = me.w.config.series.slice();
30387
+ const reducerRaw = me.w.globals.dataReducerRawSeries;
30311
30388
  for (let i2 = 0; i2 < newSeries.length; i2++) {
30312
30389
  if (newData[i2] !== null && typeof newData[i2] !== "undefined") {
30313
30390
  const srcSerie = (
@@ -30318,17 +30395,15 @@ var __async = (__this, __arguments, generator) => {
30318
30395
  /** @type {any} */
30319
30396
  newSeries[i2]
30320
30397
  );
30321
- for (let j2 = 0; j2 < srcSerie.data.length; j2++) {
30322
- dstSerie.data.push(srcSerie.data[j2]);
30398
+ dstSerie.data = dstSerie.data.concat(srcSerie.data);
30399
+ if (reducerRaw && Array.isArray((_a = reducerRaw[i2]) == null ? void 0 : _a.data)) {
30400
+ reducerRaw[i2].data = reducerRaw[i2].data.concat(srcSerie.data);
30323
30401
  }
30324
30402
  }
30325
30403
  }
30326
30404
  trimStreamingSeries(newSeries, me.w);
30327
30405
  me.w.config.series = newSeries;
30328
- if (overwriteInitialSeries) {
30329
- me.w.globals.initialSeries = me.w.config.series;
30330
- }
30331
- return this.update();
30406
+ return this.update(void 0, overwriteInitialSeries);
30332
30407
  }
30333
30408
  /**
30334
30409
  * True when an options object carries enough series data that a
@@ -30350,15 +30425,22 @@ var __async = (__this, __arguments, generator) => {
30350
30425
  }
30351
30426
  /**
30352
30427
  * @param {object} [options]
30428
+ * @param {boolean} [overwriteInitialSeries=false] true only when the caller
30429
+ * redefined the series before triggering this re-render, so the parse it
30430
+ * runs is the one that captures the new baseline.
30353
30431
  */
30354
- update(options2) {
30432
+ update(options2, overwriteInitialSeries = false) {
30355
30433
  return new Promise((resolve, reject) => {
30356
30434
  if (options2 && this.lastUpdateOptions && !_ApexCharts._optionsTooBigToCompare(options2) && Utils$1.stringifyForCompare(this.lastUpdateOptions) === Utils$1.stringifyForCompare(options2)) {
30357
30435
  return resolve(this);
30358
30436
  }
30359
30437
  this.lastUpdateOptions = options2 && !_ApexCharts._optionsTooBigToCompare(options2) ? Utils$1.clone(options2) : null;
30360
30438
  new Destroy(this.ctx).clear({ isUpdating: true });
30361
- const graphData = this.create(this.w.config.series, options2 != null ? options2 : {});
30439
+ const graphData = this.create(
30440
+ this.w.config.series,
30441
+ options2 != null ? options2 : {},
30442
+ overwriteInitialSeries
30443
+ );
30362
30444
  if (!graphData) return resolve(this);
30363
30445
  this.mount(graphData).then(() => {
30364
30446
  var _a;
@@ -32668,8 +32750,7 @@ var __async = (__this, __arguments, generator) => {
32668
32750
  }
32669
32751
  };
32670
32752
  const handleUnequalXValues = () => {
32671
- const categories = /* @__PURE__ */ new Set();
32672
- const data = {};
32753
+ const byCategory = /* @__PURE__ */ new Map();
32673
32754
  series.forEach((s2, sI) => {
32674
32755
  s2 == null ? void 0 : s2.data.forEach((dataItem) => {
32675
32756
  let cat, value;
@@ -32682,23 +32763,22 @@ var __async = (__this, __arguments, generator) => {
32682
32763
  } else {
32683
32764
  return;
32684
32765
  }
32685
- if (!/** @type {Record<string,any>} */
32686
- data[cat]) {
32687
- data[cat] = Array(
32688
- series.length
32689
- ).fill("");
32766
+ const key = String(cat);
32767
+ let row = byCategory.get(key);
32768
+ if (!row) {
32769
+ row = { cat, values: Array(series.length).fill("") };
32770
+ byCategory.set(key, row);
32690
32771
  }
32691
- data[cat][sI] = getFormattedValue(value);
32692
- categories.add(cat);
32772
+ row.values[sI] = getFormattedValue(value);
32693
32773
  });
32694
32774
  });
32695
32775
  if (columns.length) {
32696
32776
  rows.push(columns.join(columnDelimiter));
32697
32777
  }
32698
- Array.from(categories).sort().forEach((cat) => {
32699
- const values = (
32700
- /** @type {Record<string,any>} */
32701
- data[cat]
32778
+ Array.from(byCategory.keys()).sort().forEach((key) => {
32779
+ const { cat, values } = (
32780
+ /** @type {{cat: any, values: string[]}} */
32781
+ byCategory.get(key)
32702
32782
  );
32703
32783
  rows.push([getFormattedCategory(cat), ...values].join(columnDelimiter));
32704
32784
  });
@@ -33714,7 +33794,7 @@ var __async = (__this, __arguments, generator) => {
33714
33794
  "dataPointMouseLeave",
33715
33795
  this._onCellLeave
33716
33796
  );
33717
- } catch (_) {
33797
+ } catch (_2) {
33718
33798
  }
33719
33799
  }
33720
33800
  /** Wire mousemove/mouseout on each per-band hit-region (ranges mode). */
@@ -34133,7 +34213,7 @@ var __async = (__this, __arguments, generator) => {
34133
34213
  const isLegendInversed = w.config.legend.inverseOrder;
34134
34214
  const legendGroups = [];
34135
34215
  if (w.labelData.seriesGroups.length > 1 && w.config.legend.clusterGroupedSeries) {
34136
- w.labelData.seriesGroups.forEach((_, gi) => {
34216
+ w.labelData.seriesGroups.forEach((_2, gi) => {
34137
34217
  legendGroups[gi] = BrowserAPIs.createElement("div");
34138
34218
  legendGroups[gi].classList.add(
34139
34219
  "apexcharts-legend-group",
@@ -34458,10 +34538,49 @@ var __async = (__this, __arguments, generator) => {
34458
34538
  this.elMenu = null;
34459
34539
  this.elMenuItems = [];
34460
34540
  this.t = null;
34541
+ this._drawnForZoom = null;
34461
34542
  }
34462
- createToolbar() {
34463
- var _a, _b;
34543
+ /**
34544
+ * Whether this chart's built-in ways back out of a zoom are switched on.
34545
+ *
34546
+ * The gate `chart.zoom.resetControl` opens, and the one the Escape shortcut
34547
+ * reads too, so a page that says it supplies its own reset gets neither.
34548
+ * 'auto' means "supply one when nothing else on screen can": a toolbar
34549
+ * showing its reset tool is a way back, and anything else is not.
34550
+ *
34551
+ * @returns {boolean}
34552
+ */
34553
+ resetControlAllowed() {
34554
+ const c = this.w.config.chart;
34555
+ if (!c.zoom || !c.zoom.enabled) return false;
34556
+ const setting = c.zoom.resetControl === void 0 ? "auto" : c.zoom.resetControl;
34557
+ if (setting !== "auto") return !!setting;
34558
+ const onScreen = c.toolbar && c.toolbar.show && c.toolbar.tools && c.toolbar.tools.reset;
34559
+ return !onScreen;
34560
+ }
34561
+ /**
34562
+ * Whether a reset control has to be drawn for the state the chart is in now.
34563
+ *
34564
+ * Only while the chart is actually zoomed, which is the whole idea: the
34565
+ * control appears at the moment the viewer changed the view, where they are
34566
+ * already looking, and goes again when the range does. A page that never
34567
+ * zooms never sees it, so `toolbar: { show: false }` still means an empty
34568
+ * chart for everyone who does not zoom.
34569
+ *
34570
+ * @returns {boolean}
34571
+ */
34572
+ resetControlDue() {
34573
+ return !!this.w.interact.zoomed && this.resetControlAllowed();
34574
+ }
34575
+ /**
34576
+ * @param {{ resetOnly?: boolean }} [opts] `resetOnly` draws the on-demand
34577
+ * reset control and nothing else, for a chart whose page asked for no
34578
+ * toolbar at all. See {@link Toolbar#resetControlDue}.
34579
+ */
34580
+ createToolbar(opts = {}) {
34581
+ var _a, _b, _c;
34464
34582
  const w = this.w;
34583
+ const resetOnly = !!opts.resetOnly;
34465
34584
  const createDiv = () => {
34466
34585
  return BrowserAPIs.createElementNS("http://www.w3.org/1999/xhtml", "div");
34467
34586
  };
@@ -34489,6 +34608,24 @@ var __async = (__this, __arguments, generator) => {
34489
34608
  this.elMenu = createDiv();
34490
34609
  this.elCustomIcons = [];
34491
34610
  this.t = w.config.chart.toolbar.tools;
34611
+ this._drawnForZoom = null;
34612
+ if (resetOnly) {
34613
+ this.t = {
34614
+ zoom: false,
34615
+ zoomin: false,
34616
+ zoomout: false,
34617
+ selection: false,
34618
+ pan: false,
34619
+ measure: false,
34620
+ download: false,
34621
+ customIcons: [],
34622
+ reset: true
34623
+ };
34624
+ this._drawnForZoom = "wrap";
34625
+ } else if (!this.t.reset && this.resetControlDue()) {
34626
+ this.t = __spreadProps(__spreadValues({}, this.t), { reset: true });
34627
+ this._drawnForZoom = "control";
34628
+ }
34492
34629
  if (Array.isArray(this.t.customIcons)) {
34493
34630
  for (let i2 = 0; i2 < this.t.customIcons.length; i2++) {
34494
34631
  this.elCustomIcons.push(createBtn());
@@ -34511,16 +34648,16 @@ var __async = (__this, __arguments, generator) => {
34511
34648
  };
34512
34649
  appendZoomControl("zoomIn", this.elZoomIn, icoZoomIn);
34513
34650
  appendZoomControl("zoomOut", this.elZoomOut, icoZoomOut);
34514
- const zoomSelectionCtrls = (z) => {
34515
- if (this.t[z] && w.config.chart[z].enabled) {
34651
+ const zoomSelectionCtrls = (z2) => {
34652
+ if (this.t[z2] && w.config.chart[z2].enabled) {
34516
34653
  toolbarControls.push({
34517
- el: z === "zoom" ? this.elZoom : this.elSelection,
34518
- icon: typeof this.t[z] === "string" ? this.t[z] : z === "zoom" ? icoZoom : icoSelect,
34654
+ el: z2 === "zoom" ? this.elZoom : this.elSelection,
34655
+ icon: typeof this.t[z2] === "string" ? this.t[z2] : z2 === "zoom" ? icoZoom : icoSelect,
34519
34656
  title: (
34520
34657
  /** @type {any} */
34521
- this.localeValues[z === "zoom" ? "selectionZoom" : "selection"]
34658
+ this.localeValues[z2 === "zoom" ? "selectionZoom" : "selection"]
34522
34659
  ),
34523
- class: `apexcharts-${z}-icon`
34660
+ class: `apexcharts-${z2}-icon`
34524
34661
  });
34525
34662
  }
34526
34663
  };
@@ -34599,7 +34736,14 @@ var __async = (__this, __arguments, generator) => {
34599
34736
  this.elMenuIcon.setAttribute("aria-haspopup", "true");
34600
34737
  this.elMenuIcon.setAttribute("aria-expanded", "false");
34601
34738
  }
34602
- this._createHamburgerMenu(elToolbarWrap);
34739
+ if (!resetOnly) this._createHamburgerMenu(elToolbarWrap);
34740
+ if (resetOnly) {
34741
+ (_a = this.elZoomReset) == null ? void 0 : _a.addEventListener(
34742
+ "click",
34743
+ this.handleZoomReset.bind(this)
34744
+ );
34745
+ return;
34746
+ }
34603
34747
  if (w.interact.zoomEnabled) {
34604
34748
  this.elZoom.classList.add(this.selectedClass);
34605
34749
  } else if (w.interact.panEnabled) {
@@ -34608,7 +34752,7 @@ var __async = (__this, __arguments, generator) => {
34608
34752
  this.elSelection.classList.add(this.selectedClass);
34609
34753
  } else if (w.interact.measureEnabled && this.elMeasure) {
34610
34754
  this.elMeasure.classList.add(this.selectedClass);
34611
- (_b = (_a = this.ctx.measure) == null ? void 0 : _a.startMeasure) == null ? void 0 : _b.call(_a);
34755
+ (_c = (_b = this.ctx.measure) == null ? void 0 : _b.startMeasure) == null ? void 0 : _c.call(_b);
34612
34756
  }
34613
34757
  this.addToolbarEventListeners();
34614
34758
  }
@@ -35014,9 +35158,28 @@ var __async = (__this, __arguments, generator) => {
35014
35158
  break;
35015
35159
  }
35016
35160
  }
35161
+ /**
35162
+ * Take down whatever the zoom alone put on screen.
35163
+ *
35164
+ * By hand, and not left to the next render, because of the order in
35165
+ * {@link Toolbar#handleZoomReset}: the re-render happens while
35166
+ * `interact.zoomed` is still true, so the control is drawn once more and then
35167
+ * the flag clears with no further pass to notice. Reversing that order would
35168
+ * change what every listener downstream of the update sees, which is a much
35169
+ * larger promise than this control is worth.
35170
+ */
35171
+ clearZoomAffordance() {
35172
+ const drawn = this._drawnForZoom;
35173
+ this._drawnForZoom = null;
35174
+ if (!drawn || !this.elZoomReset) return;
35175
+ const parent = this.elZoomReset.parentNode;
35176
+ const gone = drawn === "wrap" ? parent : this.elZoomReset;
35177
+ if (gone && gone.parentNode) gone.parentNode.removeChild(gone);
35178
+ }
35017
35179
  handleZoomReset() {
35018
35180
  const charts = this.ctx.getSyncedCharts();
35019
35181
  charts.forEach((ch) => {
35182
+ var _a;
35020
35183
  const w = ch.w;
35021
35184
  if (!w.interact.zoomed) return;
35022
35185
  w.globals.lastXAxis.min = w.globals.initialConfig.xaxis.min;
@@ -35042,6 +35205,7 @@ var __async = (__this, __arguments, generator) => {
35042
35205
  w.config.chart.animations.dynamicAnimation.enabled
35043
35206
  );
35044
35207
  w.interact.zoomed = false;
35208
+ (_a = ch.ctx.toolbar) == null ? void 0 : _a.clearZoomAffordance();
35045
35209
  });
35046
35210
  }
35047
35211
  destroy() {
@@ -35141,6 +35305,10 @@ var __async = (__this, __arguments, generator) => {
35141
35305
  passive: false
35142
35306
  });
35143
35307
  }
35308
+ this.hoverArea.addEventListener("keydown", me.escapeResetEvent.bind(me), {
35309
+ capture: false,
35310
+ passive: true
35311
+ });
35144
35312
  if (this._momentumEnabled()) {
35145
35313
  ["touchstart", "touchmove", "touchend", "touchcancel"].forEach(
35146
35314
  (event) => {
@@ -35273,12 +35441,16 @@ var __async = (__this, __arguments, generator) => {
35273
35441
  /**
35274
35442
  * A wheel or pinch zoom is an incidental gesture: the viewer can land in a
35275
35443
  * zoomed window without meaning to (a page scroll over the chart, a two-finger
35276
- * swipe), so it is only offered when there is a way back out of it. The only
35277
- * built-in way back is the toolbar's reset button, hence 'auto' (the default
35278
- * for both allowMouseWheelZoom and pinch) resolves against that button being
35279
- * present. A page that builds its own reset control sets the option to true
35280
- * and gets the gesture with no toolbar. Drag-to-zoom is deliberate, so it is
35281
- * not gated this way.
35444
+ * swipe), so it is only offered when there is a way back out of it. 'auto'
35445
+ * (the default for both allowMouseWheelZoom and pinch) resolves against a
35446
+ * reset button that is already on screen. A page that builds its own reset
35447
+ * control sets the option to true and gets the gesture with no toolbar.
35448
+ * Drag-to-zoom is deliberate, so it is not gated this way.
35449
+ *
35450
+ * `chart.zoom.resetControl` supplies a reset of its own once a chart IS
35451
+ * zoomed, and deliberately does NOT open this gate. It arrives after the
35452
+ * fact, and what an incidental wheel zoom takes from the viewer first is the
35453
+ * page scroll it swallowed, which no button hands back.
35282
35454
  *
35283
35455
  * @param {boolean|'auto'} setting
35284
35456
  */
@@ -35293,6 +35465,58 @@ var __async = (__this, __arguments, generator) => {
35293
35465
  const { zoom } = this.w.config.chart;
35294
35466
  return this._incidentalZoomEnabled(zoom && zoom.allowMouseWheelZoom);
35295
35467
  }
35468
+ /**
35469
+ * Put keyboard focus on the chart, where the chart is focusable at all.
35470
+ *
35471
+ * A drag is swallowed by the zoom handlers before the browser can move focus,
35472
+ * so a viewer who has just zoomed by hand leaves nothing focused, and every
35473
+ * key the chart offers is out of reach: Escape to reset (see
35474
+ * {@link ZoomPanSelection#escapeResetEvent}) and the +, - and 0 the keyboard
35475
+ * module already binds. Focusing what they just acted on puts those in reach.
35476
+ *
35477
+ * Pointer-driven focus, which keyboard navigation expects and does not read
35478
+ * as a request to start navigating, and which the stylesheet draws no ring
35479
+ * around (`svg:focus:not(:focus-visible)`).
35480
+ *
35481
+ * Only where the accessibility module has made the SVG focusable, which is
35482
+ * the default: a page that turned keyboard support off is not handed a tab
35483
+ * stop it never asked for, and still has the reset control as its way back.
35484
+ */
35485
+ _focusForKeyboard() {
35486
+ var _a, _b;
35487
+ const node = this.w.dom.Paper && this.w.dom.Paper.node;
35488
+ if (!node || typeof node.focus !== "function") return;
35489
+ if (node.getAttribute("tabindex") === null) return;
35490
+ (_b = (_a = this.ctx.keyboardNavigation) == null ? void 0 : _a.notePointerFocus) == null ? void 0 : _b.call(_a);
35491
+ try {
35492
+ node.focus({ preventScroll: true });
35493
+ } catch (e2) {
35494
+ node.focus();
35495
+ }
35496
+ }
35497
+ /**
35498
+ * Escape, on a zoomed chart, puts the range back.
35499
+ *
35500
+ * The quiet half of the same answer the on-demand reset control gives, and
35501
+ * gated on it, so a page that says it supplies its own way back gets neither.
35502
+ *
35503
+ * It defers to keyboard navigation, whose Escape dismisses the tooltip and
35504
+ * which offers `0` for this, so the key means one thing at a time. It does
35505
+ * not stop the event either, so a page listening for Escape still hears it.
35506
+ *
35507
+ * Reachable because a completed drag-zoom puts focus on the chart; see
35508
+ * {@link ZoomPanSelection#_focusForKeyboard}.
35509
+ *
35510
+ * @param {any} e
35511
+ */
35512
+ escapeResetEvent(e2) {
35513
+ if (e2.key !== "Escape" && e2.key !== "Esc") return;
35514
+ if (!this.w.interact.zoomed) return;
35515
+ const nav = this.ctx.keyboardNavigation;
35516
+ if (nav && nav.active) return;
35517
+ if (!this.resetControlAllowed()) return;
35518
+ this.handleZoomReset();
35519
+ }
35296
35520
  /** Lazily-created, re-render-surviving wheel-gesture state. */
35297
35521
  _wheel() {
35298
35522
  const it = this.w.interact;
@@ -35775,11 +35999,16 @@ var __async = (__this, __arguments, generator) => {
35775
35999
  if (!w.config.chart.group) {
35776
36000
  options2.yaxis = yaxis;
35777
36001
  }
35778
- me.ctx.updateHelpers._updateOptions(
36002
+ const applied = me.ctx.updateHelpers._updateOptions(
35779
36003
  options2,
35780
36004
  false,
35781
36005
  me.w.config.chart.animations.dynamicAnimation.enabled
35782
36006
  );
36007
+ if (applied && typeof applied.then === "function") {
36008
+ applied.then(() => me._focusForKeyboard());
36009
+ } else {
36010
+ me._focusForKeyboard();
36011
+ }
35783
36012
  if (typeof w.config.chart.events.zoomed === "function") {
35784
36013
  toolbar.zoomCallback(xaxis, yaxis);
35785
36014
  }
@@ -37532,6 +37761,19 @@ var __async = (__this, __arguments, generator) => {
37532
37761
  _onPointerDown() {
37533
37762
  this._lastPointerDownAt = Date.now();
37534
37763
  }
37764
+ /**
37765
+ * Note that a pointer gesture is about to move focus into the chart.
37766
+ *
37767
+ * The 100 ms window above catches the browser's own click-to-focus, which
37768
+ * lands immediately. A drag-zoom moves focus deliberately, and only once its
37769
+ * re-render is done (ZoomPanSelection#_focusForKeyboard), which is far
37770
+ * outside that window. Without this it reads as a viewer asking to navigate
37771
+ * by keyboard, which activates nav and flashes a tooltip at the first visible
37772
+ * point after every zoom.
37773
+ */
37774
+ notePointerFocus() {
37775
+ this._lastPointerDownAt = Date.now();
37776
+ }
37535
37777
  /**
37536
37778
  * Called from Events.js keydown handler. Navigation keys are already handled
37537
37779
  * by the direct SVG listener (which can call preventDefault). This entry
@@ -41076,7 +41318,7 @@ var __async = (__this, __arguments, generator) => {
41076
41318
  }
41077
41319
  }
41078
41320
  ApexCharts.registerFeatures({ drilldown: Drilldown });
41079
- const WEAVE_API_VERSION = 3;
41321
+ const WEAVE_API_VERSION = 5;
41080
41322
  const PLUGIN_CHART_METHODS = [
41081
41323
  "updateOptions",
41082
41324
  "updateSeries",
@@ -41307,6 +41549,19 @@ var __async = (__this, __arguments, generator) => {
41307
41549
  enabledOnSeries: Array.isArray(
41308
41550
  w.config.dataLabels && w.config.dataLabels.enabledOnSeries
41309
41551
  ) ? w.config.dataLabels.enabledOnSeries.slice() : null
41552
+ }),
41553
+ // The caller's own dashing, reported for the same reason and against
41554
+ // the same trap (v5). `stroke.dashArray` is indexed by series position
41555
+ // with no per-series escape hatch, so a plugin that wants ITS OWN
41556
+ // computed series dashed has to write the whole array, and writing one
41557
+ // without knowing what was there discards the caller's dashed lines
41558
+ // with nothing to restore them from.
41559
+ //
41560
+ // A scalar applies to every series and an array is per series. There is
41561
+ // no "unset" to report: the option defaults to 0, and 0 already means
41562
+ // no dashing, so restoring it restores exactly what was there.
41563
+ stroke: Object.freeze({
41564
+ dashArray: Array.isArray(w.config.stroke && w.config.stroke.dashArray) ? w.config.stroke.dashArray.slice() : w.config.stroke && w.config.stroke.dashArray || 0
41310
41565
  })
41311
41566
  });
41312
41567
  },
@@ -41374,6 +41629,36 @@ var __async = (__this, __arguments, generator) => {
41374
41629
  host._reserve(record.def.name, box);
41375
41630
  return api;
41376
41631
  },
41632
+ /**
41633
+ * Subscribe to the data point a viewer is pointing at.
41634
+ *
41635
+ * The chart already knows this: it resolves the series and point under the
41636
+ * pointer for its own tooltip and fires `dataPointMouseEnter`,
41637
+ * `dataPointMouseLeave` and `dataPointSelection` for the caller. This
41638
+ * forwards the same three, so a plugin gets the host's answer rather than
41639
+ * hit-testing the SVG itself and disagreeing with the tooltip.
41640
+ *
41641
+ * The payload is normalised rather than the chart's own argument list,
41642
+ * which passes `w`. A plugin must not receive `w`, and the three things a
41643
+ * plugin actually wants (which series, which point, what the point is
41644
+ * called) are exactly what the chart has already resolved.
41645
+ *
41646
+ * `category` is the resolved display label, the same string `api.categories`
41647
+ * carries, because a plugin coordinating two charts keys on the label
41648
+ * rather than on an index that means something different on each chart.
41649
+ *
41650
+ * Nothing here gives a plugin the ability to intercept or cancel: the
41651
+ * chart's own tooltip, selection state and caller events are unaffected,
41652
+ * and a handler that throws is contained rather than allowed to break the
41653
+ * interaction it was watching.
41654
+ *
41655
+ * @param {(e: {type: 'enter'|'leave'|'select', seriesIndex: number, dataPointIndex: number, category: string|undefined, seriesName: string|undefined, selected: boolean|undefined}) => void} fn
41656
+ * @returns {() => void} unsubscribe
41657
+ * @since Weave v4
41658
+ */
41659
+ pointer(fn) {
41660
+ return host._onPointer(record.def.name, fn);
41661
+ },
41377
41662
  // ── custom events out to the host app ──
41378
41663
  /**
41379
41664
  * Fires as `plugin:<pluginName>:<name>` on the chart's event bus. The
@@ -41411,6 +41696,8 @@ var __async = (__this, __arguments, generator) => {
41411
41696
  this._derived = null;
41412
41697
  this._reserved = null;
41413
41698
  this._reserveTimer = null;
41699
+ this._pointerSubs = null;
41700
+ this._pointerWired = null;
41414
41701
  this._onUpdated = this._onUpdated.bind(this);
41415
41702
  this._init();
41416
41703
  }
@@ -41538,7 +41825,7 @@ var __async = (__this, __arguments, generator) => {
41538
41825
  _setScales(xyRatios) {
41539
41826
  const w = this.w;
41540
41827
  const gl = w.globals;
41541
- const L2 = w.layout;
41828
+ const L = w.layout;
41542
41829
  if (!xyRatios || !gl.axisCharts) {
41543
41830
  this._currentScales = null;
41544
41831
  return;
@@ -41549,7 +41836,7 @@ var __async = (__this, __arguments, generator) => {
41549
41836
  const maxY = (axis) => gl.maxYArr[axis] != null ? gl.maxYArr[axis] : gl.maxY;
41550
41837
  const minY = (axis) => gl.minYArr[axis] != null ? gl.minYArr[axis] : gl.minY;
41551
41838
  const banded = !w.axisFlags.isXNumeric && !gl.isBarHorizontal && gl.dataPoints > 0;
41552
- const band = banded ? L2.gridWidth / gl.dataPoints : 0;
41839
+ const band = banded ? L.gridWidth / gl.dataPoints : 0;
41553
41840
  this._currentScales = {
41554
41841
  x: banded ? (v) => band * (v + 0.5) : (v) => (v - gl.minX) / xRatio,
41555
41842
  /**
@@ -41560,8 +41847,8 @@ var __async = (__this, __arguments, generator) => {
41560
41847
  domainX: banded ? [-0.5, gl.dataPoints - 0.5] : [gl.minX, gl.maxX],
41561
41848
  /** @param {number} [axis] */
41562
41849
  domainY: (axis = 0) => [minY(axis), maxY(axis)],
41563
- gridWidth: L2.gridWidth,
41564
- gridHeight: L2.gridHeight,
41850
+ gridWidth: L.gridWidth,
41851
+ gridHeight: L.gridHeight,
41565
41852
  ratios: xyRatios
41566
41853
  };
41567
41854
  }
@@ -41653,6 +41940,132 @@ var __async = (__this, __arguments, generator) => {
41653
41940
  }
41654
41941
  this._repairInitialSeries();
41655
41942
  }
41943
+ /**
41944
+ * Subscribe a plugin to the data point the viewer is pointing at.
41945
+ *
41946
+ * Wired lazily: a chart whose plugins never ask pays nothing, and the chart
41947
+ * fires these three events whether or not anyone is listening, so there is no
41948
+ * cost to the chart either way.
41949
+ *
41950
+ * The chart's own handler signature is `(e, ctx, {seriesIndex,
41951
+ * dataPointIndex, w})`. `w` stops here: what reaches a plugin is the
41952
+ * normalised payload documented on `api.pointer`.
41953
+ *
41954
+ * @param {string} pluginName
41955
+ * @param {Function} fn
41956
+ * @returns {() => void} unsubscribe
41957
+ */
41958
+ _onPointer(pluginName, fn) {
41959
+ if (typeof fn !== "function") return () => {
41960
+ };
41961
+ if (!this._pointerSubs) this._pointerSubs = /* @__PURE__ */ new Map();
41962
+ const list = this._pointerSubs.get(pluginName) || [];
41963
+ list.push(fn);
41964
+ this._pointerSubs.set(pluginName, list);
41965
+ this._wirePointer();
41966
+ return () => {
41967
+ const current = this._pointerSubs && this._pointerSubs.get(pluginName);
41968
+ if (!current) return;
41969
+ const i2 = current.indexOf(fn);
41970
+ if (i2 > -1) current.splice(i2, 1);
41971
+ };
41972
+ }
41973
+ /** Attach to the chart's own data point events, once. */
41974
+ _wirePointer() {
41975
+ if (this._pointerWired) return;
41976
+ if (!this.ctx || typeof this.ctx.addEventListener !== "function") return;
41977
+ const map = [
41978
+ ["enter", "dataPointMouseEnter"],
41979
+ ["leave", "dataPointMouseLeave"],
41980
+ ["select", "dataPointSelection"]
41981
+ ];
41982
+ this._pointerWired = [];
41983
+ for (const [type, name2] of map) {
41984
+ const handler = (_e, _ctx, opts) => {
41985
+ this._emitPointer(type, opts);
41986
+ };
41987
+ this.ctx.addEventListener(name2, handler);
41988
+ this._pointerWired.push([name2, handler]);
41989
+ }
41990
+ }
41991
+ /**
41992
+ * Hand one pointer event to every subscribed plugin.
41993
+ *
41994
+ * A handler that throws is contained per plugin, on the same terms as every
41995
+ * other plugin callback here: this runs inside the viewer's own hover, and a
41996
+ * plugin breaking the chart's interaction would be the worst failure mode
41997
+ * this facade has.
41998
+ *
41999
+ * @param {'enter'|'leave'|'select'} type
42000
+ * @param {any} opts
42001
+ */
42002
+ _emitPointer(type, opts) {
42003
+ if (!this._pointerSubs || !this._pointerSubs.size) return;
42004
+ const seriesIndex = opts && typeof opts.seriesIndex === "number" ? opts.seriesIndex : -1;
42005
+ const dataPointIndex = opts && typeof opts.dataPointIndex === "number" ? opts.dataPointIndex : -1;
42006
+ const labels = this._categories() || [];
42007
+ const w = this.w;
42008
+ const config = w && w.config && w.config.series || [];
42009
+ const payload = {
42010
+ type,
42011
+ seriesIndex,
42012
+ dataPointIndex,
42013
+ category: dataPointIndex > -1 ? labels[dataPointIndex] : void 0,
42014
+ // A pie/donut carries bare numbers in `series`, so there is no name to
42015
+ // read: undefined rather than a guess, on the same terms as `category`.
42016
+ seriesName: _WeaveHost._seriesName(config, seriesIndex),
42017
+ // Only meaningful on a select: the chart hands back its whole selection
42018
+ // set, and what a plugin wants to know is whether THIS point is now in
42019
+ // it, so a second click reads as a deselect rather than another select.
42020
+ selected: type === "select" ? _WeaveHost._isSelected(opts, seriesIndex, dataPointIndex) : void 0
42021
+ };
42022
+ for (const [name2, handlers] of this._pointerSubs) {
42023
+ for (const fn of handlers.slice()) {
42024
+ try {
42025
+ fn(payload);
42026
+ } catch (e2) {
42027
+ console.warn(
42028
+ '[apexcharts] plugin "' + name2 + '" threw in a pointer handler',
42029
+ e2
42030
+ );
42031
+ }
42032
+ }
42033
+ }
42034
+ }
42035
+ /**
42036
+ * The configured name of series `i`, where there is one.
42037
+ *
42038
+ * @param {any[]} config
42039
+ * @param {number} i
42040
+ * @returns {string|undefined}
42041
+ */
42042
+ static _seriesName(config, i2) {
42043
+ if (i2 < 0) return void 0;
42044
+ const entry = config[i2];
42045
+ if (!entry || typeof entry !== "object") return void 0;
42046
+ return typeof entry.name === "string" ? entry.name : void 0;
42047
+ }
42048
+ /**
42049
+ * Whether the chart now counts this point as selected.
42050
+ *
42051
+ * `selectedDataPoints` is an array per series of the indexes selected in it.
42052
+ * Absent on a chart type that does not carry point selection, in which case
42053
+ * the answer is undefined rather than false: "not selected" and "selection
42054
+ * does not apply here" are different, and a plugin keying on it should be
42055
+ * able to tell.
42056
+ *
42057
+ * @param {any} opts
42058
+ * @param {number} seriesIndex
42059
+ * @param {number} dataPointIndex
42060
+ * @returns {boolean|undefined}
42061
+ */
42062
+ static _isSelected(opts, seriesIndex, dataPointIndex) {
42063
+ const all = opts && opts.selectedDataPoints;
42064
+ if (!Array.isArray(all) || seriesIndex < 0) return void 0;
42065
+ const mine = all[seriesIndex];
42066
+ if (!Array.isArray(mine)) return false;
42067
+ return mine.indexOf(dataPointIndex) > -1;
42068
+ }
41656
42069
  /**
41657
42070
  * Record a plugin's container reservation and re-render if it changed.
41658
42071
  *
@@ -41800,14 +42213,14 @@ var __async = (__this, __arguments, generator) => {
41800
42213
  * @param {string} name
41801
42214
  * @param {{ z?: 'front'|'behind', className?: string }} opts
41802
42215
  */
41803
- _layer(name2, { z = "front", className = "" } = {}) {
42216
+ _layer(name2, { z: z2 = "front", className = "" } = {}) {
41804
42217
  let g = this._layers.get(name2);
41805
42218
  if (!g) {
41806
42219
  g = this.ctx.graphics.group({
41807
42220
  class: `apexcharts-plugin-${name2} ${className}`.trim()
41808
42221
  });
41809
42222
  const parent = this.w.dom.elGraphical.node;
41810
- if (z === "behind") parent.insertBefore(g.node, parent.firstChild);
42223
+ if (z2 === "behind") parent.insertBefore(g.node, parent.firstChild);
41811
42224
  else parent.appendChild(g.node);
41812
42225
  g.node.setAttribute("aria-hidden", "true");
41813
42226
  this._layers.set(name2, g);
@@ -41877,6 +42290,13 @@ var __async = (__this, __arguments, generator) => {
41877
42290
  this.active = [];
41878
42291
  this._derived = null;
41879
42292
  this._reserved = null;
42293
+ this._pointerSubs = null;
42294
+ if (this._pointerWired) {
42295
+ for (const [name2, handler] of this._pointerWired) {
42296
+ this.ctx.removeEventListener && this.ctx.removeEventListener(name2, handler);
42297
+ }
42298
+ this._pointerWired = null;
42299
+ }
41880
42300
  if (this._reserveTimer != null) {
41881
42301
  clearTimeout(this._reserveTimer);
41882
42302
  this._reserveTimer = null;
@@ -42444,8 +42864,8 @@ var __async = (__this, __arguments, generator) => {
42444
42864
  const x = lo + g * step;
42445
42865
  let sum = 0;
42446
42866
  for (let i2 = 0; i2 < n2; i2++) {
42447
- const z = (x - sorted[i2]) / h;
42448
- sum += Math.exp(-0.5 * z * z);
42867
+ const z2 = (x - sorted[i2]) / h;
42868
+ sum += Math.exp(-0.5 * z2 * z2);
42449
42869
  }
42450
42870
  density.push([x, sum * norm]);
42451
42871
  }
@@ -43103,7 +43523,7 @@ var __async = (__this, __arguments, generator) => {
43103
43523
  values,
43104
43524
  order,
43105
43525
  carrier: visible.length ? visible[0] : 0,
43106
- hidden: raw.map((_, k) => k).filter((k) => collapsed.indexOf(k) !== -1)
43526
+ hidden: raw.map((_2, k) => k).filter((k) => collapsed.indexOf(k) !== -1)
43107
43527
  };
43108
43528
  const carrier = w.dumbbellData.carrier;
43109
43529
  return raw.map((s2, k) => __spreadProps(__spreadValues({}, s2), {
@@ -43908,7 +44328,7 @@ var __async = (__this, __arguments, generator) => {
43908
44328
  highs,
43909
44329
  order: bandOrder,
43910
44330
  offset,
43911
- hidden: raw.map((_, k) => k).filter((k) => collapsed.indexOf(k) !== -1)
44331
+ hidden: raw.map((_2, k) => k).filter((k) => collapsed.indexOf(k) !== -1)
43912
44332
  };
43913
44333
  return raw.map((s2, k) => {
43914
44334
  const lo = lows[k];
@@ -44657,7 +45077,7 @@ var __async = (__this, __arguments, generator) => {
44657
45077
  /**
44658
45078
  * @param {any} _
44659
45079
  */
44660
- brArr.map((_) => "none")
45080
+ brArr.map((_2) => "none")
44661
45081
  )
44662
45082
  );
44663
45083
  }
@@ -44998,7 +45418,7 @@ var __async = (__this, __arguments, generator) => {
44998
45418
  ) : null;
44999
45419
  const isBar = (i2) => !barIndices || barIndices.has(i2);
45000
45420
  if (!groups || groups.length < 2) {
45001
- const bucket = Array.from({ length: numSeries }, (_, i2) => i2).filter(isBar);
45421
+ const bucket = Array.from({ length: numSeries }, (_2, i2) => i2).filter(isBar);
45002
45422
  return bucket.length ? [bucket] : [];
45003
45423
  }
45004
45424
  const buckets = Array.from({ length: groups.length }, () => []);
@@ -45029,6 +45449,14 @@ var __async = (__this, __arguments, generator) => {
45029
45449
  * second at the top, and nothing else touched. Stacked totals already resolve
45030
45450
  * per group (see drawsStackedTotal, #4173); corners never got the same fix.
45031
45451
  *
45452
+ * plotOptions.bar.borderRadiusWhenStacked picks which ends round: 'all'
45453
+ * caps both the baseline and the far end, 'last' only the far end (#4845).
45454
+ *
45455
+ * A single-data-point chart used to hand its baseline segment 'top' (and a
45456
+ * solo segment 'top' instead of 'both'), which on a horizontal stack rounded
45457
+ * the first segment on its INNER edge and left a pill in the middle of the
45458
+ * bar (#4845). One data point is resolved like any other now.
45459
+ *
45032
45460
  * @param {any[]} series
45033
45461
  * @returns {string[][]}
45034
45462
  */
@@ -45043,9 +45471,11 @@ var __async = (__this, __arguments, generator) => {
45043
45471
  () => Array(numColumns).fill(alwaysApplyRadius ? "top" : "none")
45044
45472
  );
45045
45473
  if (alwaysApplyRadius) return output;
45046
- const isSoloHorizontal = this.w.config.chart.type === "bar" && numColumns === 1;
45047
- const soloCorner = isSoloHorizontal ? "top" : "both";
45048
- const baseCorner = isSoloHorizontal ? "top" : "bottom";
45474
+ const lastOnly = w.config.plotOptions.bar.borderRadiusWhenStacked === "last";
45475
+ const soloPositive = lastOnly ? "top" : "both";
45476
+ const soloNegative = lastOnly ? "bottom" : "both";
45477
+ const positiveBase = lastOnly ? "none" : "bottom";
45478
+ const negativeBase = lastOnly ? "none" : "top";
45049
45479
  for (const stack of this.getStackedSeriesIndices(numSeries)) {
45050
45480
  for (let j2 = 0; j2 < numColumns; j2++) {
45051
45481
  const positiveIndices = [];
@@ -45057,22 +45487,22 @@ var __async = (__this, __arguments, generator) => {
45057
45487
  }
45058
45488
  if (positiveIndices.length > 0 && negativeIndices.length === 0) {
45059
45489
  if (positiveIndices.length === 1) {
45060
- output[positiveIndices[0]][j2] = soloCorner;
45490
+ output[positiveIndices[0]][j2] = soloPositive;
45061
45491
  } else {
45062
45492
  const first = positiveIndices[0];
45063
45493
  const last = positiveIndices[positiveIndices.length - 1];
45064
45494
  for (const i2 of positiveIndices) {
45065
- output[i2][j2] = i2 === first ? baseCorner : i2 === last ? "top" : "none";
45495
+ output[i2][j2] = i2 === first ? positiveBase : i2 === last ? "top" : "none";
45066
45496
  }
45067
45497
  }
45068
45498
  } else if (negativeIndices.length > 0 && positiveIndices.length === 0) {
45069
45499
  if (negativeIndices.length === 1) {
45070
- output[negativeIndices[0]][j2] = "both";
45500
+ output[negativeIndices[0]][j2] = soloNegative;
45071
45501
  } else {
45072
- const highest = Math.max(...negativeIndices);
45073
- const lowest = Math.min(...negativeIndices);
45502
+ const nearest = Math.min(...negativeIndices);
45503
+ const farthest = Math.max(...negativeIndices);
45074
45504
  for (const i2 of negativeIndices) {
45075
- output[i2][j2] = i2 === highest ? "bottom" : i2 === lowest ? "top" : "none";
45505
+ output[i2][j2] = i2 === nearest ? negativeBase : i2 === farthest ? "bottom" : "none";
45076
45506
  }
45077
45507
  }
45078
45508
  } else if (positiveIndices.length > 0 && negativeIndices.length > 0) {
@@ -45708,7 +46138,7 @@ var __async = (__this, __arguments, generator) => {
45708
46138
  const w = this.w;
45709
46139
  let nonZeroColumns = 0;
45710
46140
  let zeroEncounters = 0;
45711
- const seriesIndices = w.config.plotOptions.bar.horizontal ? w.seriesData.series.map((_, _i) => _i) : ((_a = w.globals.columnSeries) == null ? void 0 : _a.i.map((_i) => _i)) || [];
46141
+ const seriesIndices = w.config.plotOptions.bar.horizontal ? w.seriesData.series.map((_2, _i) => _i) : ((_a = w.globals.columnSeries) == null ? void 0 : _a.i.map((_i) => _i)) || [];
45712
46142
  seriesIndices.forEach((_si) => {
45713
46143
  const val = w.globals.seriesPercent[_si][j2];
45714
46144
  if (val) {
@@ -46795,7 +47225,7 @@ var __async = (__this, __arguments, generator) => {
46795
47225
  series = w.globals.comboCharts ? (
46796
47226
  /** @type {any} */
46797
47227
  seriesIndex.map(
46798
- (_) => w.globals.seriesPercent[_]
47228
+ (_2) => w.globals.seriesPercent[_2]
46799
47229
  )
46800
47230
  ) : w.globals.seriesPercent.slice();
46801
47231
  }
@@ -47594,17 +48024,17 @@ var __async = (__this, __arguments, generator) => {
47594
48024
  if (this.isHorizontal) {
47595
48025
  const yRatio = this.invertedYRatio;
47596
48026
  const bh = barHeight != null ? barHeight : 0;
47597
- const z = zeroW != null ? zeroW : 0;
48027
+ const z2 = zeroW != null ? zeroW : 0;
47598
48028
  center = paths.barYPosition + bh / 2;
47599
48029
  halfExtent = bh / 2;
47600
- alongFn = (v) => z + logVal(v) / yRatio;
48030
+ alongFn = (v) => z2 + logVal(v) / yRatio;
47601
48031
  } else {
47602
48032
  const yRatio = this.yRatio[translationsIndex];
47603
48033
  const bw = barWidth != null ? barWidth : 0;
47604
- const z = zeroH != null ? zeroH : 0;
48034
+ const z2 = zeroH != null ? zeroH : 0;
47605
48035
  center = paths.barXPosition + bw / 2;
47606
48036
  halfExtent = bw / 2;
47607
- alongFn = (v) => z - logVal(v) / yRatio;
48037
+ alongFn = (v) => z2 - logVal(v) / yRatio;
47608
48038
  }
47609
48039
  const groups = buildJitterGroups({
47610
48040
  w,
@@ -48338,7 +48768,7 @@ var __async = (__this, __arguments, generator) => {
48338
48768
  return { nodes: [], maxWeight: 0 };
48339
48769
  }
48340
48770
  const order = d.values.map(
48341
- (_, k) => k
48771
+ (_2, k) => k
48342
48772
  );
48343
48773
  order.sort(
48344
48774
  (a2, b) => d.values[a2] - d.values[b]
@@ -50301,15 +50731,15 @@ var __async = (__this, __arguments, generator) => {
50301
50731
  case "monotoneCubic": {
50302
50732
  const yAj = isRangeStart ? yArrj : y2Arrj;
50303
50733
  const getSmoothInputs = (xArr, yArr) => {
50304
- return xArr.map((_, i3) => {
50305
- return [_, yArr[i3]];
50306
- }).filter((_) => _[1] !== null);
50734
+ return xArr.map((_2, i3) => {
50735
+ return [_2, yArr[i3]];
50736
+ }).filter((_2) => _2[1] !== null);
50307
50737
  };
50308
50738
  const getSegmentLengths = (yArr) => {
50309
50739
  const segLens = [];
50310
50740
  let count = 0;
50311
- yArr.forEach((_) => {
50312
- if (_ !== null) {
50741
+ yArr.forEach((_2) => {
50742
+ if (_2 !== null) {
50313
50743
  count++;
50314
50744
  } else if (count > 0) {
50315
50745
  segLens.push(count);
@@ -50356,11 +50786,11 @@ var __async = (__this, __arguments, generator) => {
50356
50786
  }
50357
50787
  let segmentCount = 0;
50358
50788
  let smoothInputsIndex = 0;
50359
- getSegments(_yAj, points).forEach((_) => {
50789
+ getSegments(_yAj, points).forEach((_2) => {
50360
50790
  segmentCount++;
50361
- const svgPoints = svgPath(_);
50791
+ const svgPoints = svgPath(_2);
50362
50792
  const _start = smoothInputsIndex;
50363
- smoothInputsIndex += _.length;
50793
+ smoothInputsIndex += _2.length;
50364
50794
  const _end = smoothInputsIndex - 1;
50365
50795
  if (isLowerRangeAreaPath) {
50366
50796
  linePath = graphics.move(
@@ -50843,13 +51273,13 @@ var __async = (__this, __arguments, generator) => {
50843
51273
  function sharpDonutSegmentPath({ cx, cy, rIn, rOut, a0, a1, spanDeg }) {
50844
51274
  const ptAt = (radius, deg) => arcPoint(cx, cy, radius, deg);
50845
51275
  const largeArc = spanDeg > 180 ? 1 : 0;
50846
- const A2 = ptAt(rOut, a0);
51276
+ const A = ptAt(rOut, a0);
50847
51277
  const B = ptAt(rOut, a1);
50848
- const C = ptAt(rIn, a1);
51278
+ const C2 = ptAt(rIn, a1);
50849
51279
  const Din = ptAt(rIn, a0);
50850
51280
  return [
50851
51281
  "M",
50852
- xy(A2),
51282
+ xy(A),
50853
51283
  "A",
50854
51284
  rOut,
50855
51285
  rOut,
@@ -50858,7 +51288,7 @@ var __async = (__this, __arguments, generator) => {
50858
51288
  1,
50859
51289
  xy(B),
50860
51290
  "L",
50861
- xy(C),
51291
+ xy(C2),
50862
51292
  "A",
50863
51293
  rIn,
50864
51294
  rIn,
@@ -50978,7 +51408,7 @@ var __async = (__this, __arguments, generator) => {
50978
51408
  const w = this.w;
50979
51409
  const helpers = new CircularChartsHelpers(w);
50980
51410
  const lineSets = (w.seriesData.seriesNames || []).map(
50981
- (_, i2) => this.getExternalLabelLines(i2)
51411
+ (_2, i2) => this.getExternalLabelLines(i2)
50982
51412
  );
50983
51413
  const maxLabelWidth = helpers.getMaxLabelWidth(lineSets.flat(), {
50984
51414
  fontSize: this.externalLabelStyle.fontSize,
@@ -53671,7 +54101,7 @@ var __async = (__this, __arguments, generator) => {
53671
54101
  (_d = (_c = w.config.series[i2].data) == null ? void 0 : _c[j2]) == null ? void 0 : _d.x
53672
54102
  );
53673
54103
  const labelX = Array.isArray(x) ? x.join(" ") : x;
53674
- const rowIndex = w.labelData.labels.map((_) => Array.isArray(_) ? _.join(" ") : _).indexOf(labelX);
54104
+ const rowIndex = w.labelData.labels.map((_2) => Array.isArray(_2) ? _2.join(" ") : _2).indexOf(labelX);
53675
54105
  const overlappedIndex = w.rangeData.seriesRange[i2].findIndex(
53676
54106
  (tx) => {
53677
54107
  var _a2;
@@ -54869,8 +55299,8 @@ var __async = (__this, __arguments, generator) => {
54869
55299
  */
54870
55300
  _zoomEnabled() {
54871
55301
  const w = this.w;
54872
- const z = w.config.plotOptions.treemap.zoom;
54873
- if (!z || !z.enabled || !this.showParents) return false;
55302
+ const z2 = w.config.plotOptions.treemap.zoom;
55303
+ if (!z2 || !z2.enabled || !this.showParents) return false;
54874
55304
  const dd = w.config.drilldown;
54875
55305
  if (dd && dd.enabled && Array.isArray(dd.series) && dd.series.length) {
54876
55306
  if (!this._warnedZoomConflict) {
@@ -54962,8 +55392,8 @@ var __async = (__this, __arguments, generator) => {
54962
55392
  }
54963
55393
  /** The breadcrumb config: a treemap-local override on the shared block. */
54964
55394
  _breadcrumbCfg() {
54965
- const z = this.w.config.plotOptions.treemap.zoom;
54966
- return breadcrumbConfig(this.w, z && z.breadcrumb);
55395
+ const z2 = this.w.config.plotOptions.treemap.zoom;
55396
+ return breadcrumbConfig(this.w, z2 && z2.breadcrumb);
54967
55397
  }
54968
55398
  /**
54969
55399
  * Breadcrumb back out of a zoom. Markup, config and accessible semantics are
@@ -55162,7 +55592,7 @@ var __async = (__this, __arguments, generator) => {
55162
55592
  if (typeof fmt === "function") {
55163
55593
  try {
55164
55594
  return String(fmt(v, { seriesIndex: 0, dataPointIndex: 0, w }));
55165
- } catch (_) {
55595
+ } catch (_2) {
55166
55596
  }
55167
55597
  }
55168
55598
  return String(v);
@@ -55407,7 +55837,7 @@ var __async = (__this, __arguments, generator) => {
55407
55837
  const PK_CORNER = 1;
55408
55838
  const PK_GLYPH = 2;
55409
55839
  function springParams(preset, speed) {
55410
- const [stiffness, damping] = q(
55840
+ const [stiffness, damping] = z(
55411
55841
  /** @type {import('apex-commons').SpringPreset|undefined} */
55412
55842
  preset
55413
55843
  );
@@ -55651,7 +56081,7 @@ var __async = (__this, __arguments, generator) => {
55651
56081
  r: typeof p.r === "number" && p.r > 0 ? p.r : void 0
55652
56082
  });
55653
56083
  });
55654
- const clusters = counts.map((_, i2) => ({
56084
+ const clusters = counts.map((_2, i2) => ({
55655
56085
  i: i2,
55656
56086
  cx: gw / 2,
55657
56087
  cy: gh / 2,
@@ -55758,7 +56188,7 @@ var __async = (__this, __arguments, generator) => {
55758
56188
  const gw = w.layout.gridWidth;
55759
56189
  const gh = w.layout.gridHeight;
55760
56190
  const labelSpace = opts.clusterLabels && opts.clusterLabels.show ? 30 : 6;
55761
- const visible = counts.map((_, i2) => i2).filter((i2) => counts[i2] > 0);
56191
+ const visible = counts.map((_2, i2) => i2).filter((i2) => counts[i2] > 0);
55762
56192
  const Kv = Math.max(1, visible.length);
55763
56193
  const slotOf = new Array(counts.length).fill(-1);
55764
56194
  visible.forEach((i2, s2) => slotOf[i2] = s2);
@@ -55773,7 +56203,7 @@ var __async = (__this, __arguments, generator) => {
55773
56203
  const cy = labelSpace + availH / 2;
55774
56204
  const outerRs = counts.map((n2) => step * Math.sqrt(Math.max(1, n2)) + dotR);
55775
56205
  const cellCentre = (i2) => slotOf[i2] >= 0 ? cellW * (slotOf[i2] + 0.5) : gw / 2;
55776
- let centers = counts.map((_, i2) => cellCentre(i2));
56206
+ let centers = counts.map((_2, i2) => cellCentre(i2));
55777
56207
  const visOuter = visible.map((i2) => outerRs[i2]);
55778
56208
  let overlap = false;
55779
56209
  for (let s2 = 1; s2 < Kv; s2++) {
@@ -55798,10 +56228,10 @@ var __async = (__this, __arguments, generator) => {
55798
56228
  } else {
55799
56229
  const lo = visOuter[0];
55800
56230
  const hi = gw - visOuter[Kv - 1];
55801
- visCenters = visOuter.map((_, s2) => lo + (hi - lo) * s2 / (Kv - 1));
56231
+ visCenters = visOuter.map((_2, s2) => lo + (hi - lo) * s2 / (Kv - 1));
55802
56232
  }
55803
56233
  centers = counts.map(
55804
- (_, i2) => slotOf[i2] >= 0 ? visCenters[slotOf[i2]] : gw / 2
56234
+ (_2, i2) => slotOf[i2] >= 0 ? visCenters[slotOf[i2]] : gw / 2
55805
56235
  );
55806
56236
  }
55807
56237
  return counts.map((n2, i2) => ({
@@ -55833,11 +56263,11 @@ var __async = (__this, __arguments, generator) => {
55833
56263
  this._lastDotR = this._dotRadiusFromStep(step, opts);
55834
56264
  const cx = gw / 2;
55835
56265
  const cy = labelSpace + (gh - labelSpace) / 2;
55836
- const order = counts.map((_, i2) => i2);
56266
+ const order = counts.map((_2, i2) => i2);
55837
56267
  if (opts.sortByGroup !== false) {
55838
56268
  order.sort((a2, b) => counts[a2] - counts[b]);
55839
56269
  }
55840
- const clusters = counts.map((_, i2) => ({
56270
+ const clusters = counts.map((_2, i2) => ({
55841
56271
  i: i2,
55842
56272
  cx,
55843
56273
  cy,
@@ -55909,7 +56339,7 @@ var __async = (__this, __arguments, generator) => {
55909
56339
  }
55910
56340
  }
55911
56341
  seats.sort((s1, s2) => s1.a - s2.a);
55912
- const clusters = counts.map((_, i2) => ({
56342
+ const clusters = counts.map((_2, i2) => ({
55913
56343
  i: i2,
55914
56344
  cx,
55915
56345
  cy,
@@ -55970,11 +56400,11 @@ var __async = (__this, __arguments, generator) => {
55970
56400
  const spacing = opts.spacing > 0 ? opts.spacing : 1.05;
55971
56401
  const absSpan = Math.abs(span) || Math.PI;
55972
56402
  const fixed = this._fixedRadius(opts);
55973
- const evalR = (R2) => {
55974
- R2 = Math.max(1, Math.round(R2));
56403
+ const evalR = (R) => {
56404
+ R = Math.max(1, Math.round(R));
55975
56405
  const radii = [];
55976
- for (let r2 = 0; r2 < R2; r2++) {
55977
- radii.push(R2 === 1 ? (r0 + r1) / 2 : r0 + (r1 - r0) * (r2 / (R2 - 1)));
56406
+ for (let r2 = 0; r2 < R; r2++) {
56407
+ radii.push(R === 1 ? (r0 + r1) / 2 : r0 + (r1 - r0) * (r2 / (R - 1)));
55978
56408
  }
55979
56409
  const weightSum = radii.reduce((a2, x) => a2 + x, 0) || 1;
55980
56410
  const raw = radii.map((rho) => total * rho / weightSum);
@@ -55987,19 +56417,19 @@ var __async = (__this, __arguments, generator) => {
55987
56417
  }
55988
56418
  });
55989
56419
  while (left > 0) {
55990
- seatsPerRow[R2 - 1]++;
56420
+ seatsPerRow[R - 1]++;
55991
56421
  left--;
55992
56422
  }
55993
- const radialPitch = R2 === 1 ? r1 - r0 || r1 : (r1 - r0) / (R2 - 1);
56423
+ const radialPitch = R === 1 ? r1 - r0 || r1 : (r1 - r0) / (R - 1);
55994
56424
  let minArcPitch = Infinity;
55995
- for (let r2 = 0; r2 < R2; r2++) {
56425
+ for (let r2 = 0; r2 < R; r2++) {
55996
56426
  const n2 = seatsPerRow[r2];
55997
56427
  if (n2 <= 0) continue;
55998
56428
  const arcPitch = radii[r2] * absSpan / n2;
55999
56429
  if (arcPitch < minArcPitch) minArcPitch = arcPitch;
56000
56430
  }
56001
56431
  const pitch = Math.min(radialPitch, minArcPitch);
56002
- return { R: R2, radii, seatsPerRow, dotR: Math.max(1, pitch / (2 * spacing)) };
56432
+ return { R, radii, seatsPerRow, dotR: Math.max(1, pitch / (2 * spacing)) };
56003
56433
  };
56004
56434
  const arcRows = opts.arc && opts.arc.rows;
56005
56435
  let res;
@@ -56011,8 +56441,8 @@ var __async = (__this, __arguments, generator) => {
56011
56441
  } else {
56012
56442
  const maxR = Math.max(1, Math.min(40, Math.ceil(Math.sqrt(total)) + 6));
56013
56443
  res = evalR(1);
56014
- for (let R2 = 2; R2 <= maxR; R2++) {
56015
- const cand = evalR(R2);
56444
+ for (let R = 2; R <= maxR; R++) {
56445
+ const cand = evalR(R);
56016
56446
  if (cand.dotR > res.dotR) res = cand;
56017
56447
  }
56018
56448
  }
@@ -56036,7 +56466,7 @@ var __async = (__this, __arguments, generator) => {
56036
56466
  const labelsOn = !!(opts.clusterLabels && opts.clusterLabels.show);
56037
56467
  const labelsBelow = labelsOn && opts.clusterLabels.position === "bottom";
56038
56468
  const topPad = labelsOn && !labelsBelow ? 30 : 6;
56039
- const visible = counts.map((_, i2) => i2).filter((i2) => counts[i2] > 0);
56469
+ const visible = counts.map((_2, i2) => i2).filter((i2) => counts[i2] > 0);
56040
56470
  const Kv = Math.max(1, visible.length);
56041
56471
  const slotOf = new Array(counts.length).fill(-1);
56042
56472
  visible.forEach((i2, s2) => slotOf[i2] = s2);
@@ -56151,7 +56581,7 @@ var __async = (__this, __arguments, generator) => {
56151
56581
  const originX = (gw - blockW) / 2 + pitch / 2;
56152
56582
  const topY = labelSpace + (availH - blockH) / 2;
56153
56583
  const rowY = (rowIdx) => fillFrom === "bottom" ? topY + blockH - pitch / 2 - rowIdx * pitch : topY + pitch / 2 + rowIdx * pitch;
56154
- const clusters = counts.map((_, i2) => ({
56584
+ const clusters = counts.map((_2, i2) => ({
56155
56585
  i: i2,
56156
56586
  cx: gw / 2,
56157
56587
  cy: labelSpace + availH / 2,
@@ -56197,14 +56627,14 @@ var __async = (__this, __arguments, generator) => {
56197
56627
  const fillFrom = gcfg.fillFrom === "top" ? "top" : "bottom";
56198
56628
  const cellsPerTile = Math.max(1, Math.round(gcfg.total > 0 ? gcfg.total : 100));
56199
56629
  const rowsPerTile = Math.max(1, Math.ceil(cellsPerTile / cols));
56200
- const visible = counts.map((_, i2) => i2).filter((i2) => counts[i2] > 0);
56201
- const K = Math.max(1, visible.length);
56630
+ const visible = counts.map((_2, i2) => i2).filter((i2) => counts[i2] > 0);
56631
+ const K2 = Math.max(1, visible.length);
56202
56632
  const denom = gcfg.max > 0 ? gcfg.max : Math.max(1, ...counts);
56203
56633
  const tileCols = Math.max(
56204
56634
  1,
56205
- Math.round(gcfg.tileColumns > 0 ? gcfg.tileColumns : Math.ceil(Math.sqrt(K)))
56635
+ Math.round(gcfg.tileColumns > 0 ? gcfg.tileColumns : Math.ceil(Math.sqrt(K2)))
56206
56636
  );
56207
- const tileRows = Math.max(1, Math.ceil(K / tileCols));
56637
+ const tileRows = Math.max(1, Math.ceil(K2 / tileCols));
56208
56638
  const labelsOn = !(opts.clusterLabels && opts.clusterLabels.show === false);
56209
56639
  const labelsBelow = labelsOn && opts.clusterLabels && opts.clusterLabels.position === "bottom";
56210
56640
  const topBand = labelsOn && !labelsBelow ? 22 : 4;
@@ -56324,7 +56754,7 @@ var __async = (__this, __arguments, generator) => {
56324
56754
  (cat) => Array.isArray(cat) ? cat.map(valueOf) : []
56325
56755
  );
56326
56756
  const isNum = (v) => v != null && isFinite(v);
56327
- const visible = catVals.map((_, i2) => i2).filter((i2) => catVals[i2].some(isNum));
56757
+ const visible = catVals.map((_2, i2) => i2).filter((i2) => catVals[i2].some(isNum));
56328
56758
  const Kv = Math.max(1, visible.length);
56329
56759
  let vmin = Infinity;
56330
56760
  let vmax = -Infinity;
@@ -56443,7 +56873,7 @@ var __async = (__this, __arguments, generator) => {
56443
56873
  (cat) => Array.isArray(cat) ? cat.map(valueOf) : []
56444
56874
  );
56445
56875
  const isNum = (v) => v != null && isFinite(v);
56446
- const visible = catVals.map((_, i2) => i2).filter((i2) => catVals[i2].some(isNum));
56876
+ const visible = catVals.map((_2, i2) => i2).filter((i2) => catVals[i2].some(isNum));
56447
56877
  const Kv = Math.max(1, visible.length);
56448
56878
  let vmin = Infinity;
56449
56879
  let vmax = -Infinity;
@@ -56560,7 +56990,7 @@ var __async = (__this, __arguments, generator) => {
56560
56990
  const isNum = (v) => typeof v === "number" && isFinite(v);
56561
56991
  const xOf = (d) => d && typeof d === "object" ? d.x : null;
56562
56992
  const yOf = (d) => d && typeof d === "object" ? d.y != null ? d.y : d.value : null;
56563
- const visible = unitData.map((_, i2) => i2).filter(
56993
+ const visible = unitData.map((_2, i2) => i2).filter(
56564
56994
  (i2) => (unitData[i2] || []).some((d) => isNum(xOf(d)) && isNum(yOf(d)))
56565
56995
  );
56566
56996
  let xmn = Infinity;
@@ -56698,10 +57128,10 @@ var __async = (__this, __arguments, generator) => {
56698
57128
  let zmax = -Infinity;
56699
57129
  unitData.forEach(
56700
57130
  (cat) => (cat || []).forEach((d) => {
56701
- const z = d && typeof d === "object" ? d[field] : null;
56702
- if (typeof z === "number" && isFinite(z)) {
56703
- if (z < zmin) zmin = z;
56704
- if (z > zmax) zmax = z;
57131
+ const z2 = d && typeof d === "object" ? d[field] : null;
57132
+ if (typeof z2 === "number" && isFinite(z2)) {
57133
+ if (z2 < zmin) zmin = z2;
57134
+ if (z2 > zmax) zmax = z2;
56705
57135
  }
56706
57136
  })
56707
57137
  );
@@ -56718,9 +57148,9 @@ var __async = (__this, __arguments, generator) => {
56718
57148
  */
56719
57149
  _scatterRadius(d, st, fallback) {
56720
57150
  if (!st) return fallback;
56721
- const z = d && typeof d === "object" ? d[st.field] : null;
56722
- if (typeof z !== "number" || !isFinite(z)) return st.rMin;
56723
- const t2 = st.zmax > st.zmin ? (z - st.zmin) / (st.zmax - st.zmin) : 1;
57151
+ const z2 = d && typeof d === "object" ? d[st.field] : null;
57152
+ if (typeof z2 !== "number" || !isFinite(z2)) return st.rMin;
57153
+ const t2 = st.zmax > st.zmin ? (z2 - st.zmin) / (st.zmax - st.zmin) : 1;
56724
57154
  const tc = Math.max(0, Math.min(1, t2));
56725
57155
  const aMin = st.rMin * st.rMin;
56726
57156
  const aMax = st.rMax * st.rMax;
@@ -57516,8 +57946,8 @@ var __async = (__this, __arguments, generator) => {
57516
57946
  for (let k = 0; k < dots.length; k++) {
57517
57947
  const d = dots[k];
57518
57948
  const carried = live && !d.isEnter && d.key != null ? live.get(d.key) : null;
57519
- const sx = carried ? carried.x : E(d.cx0, stiffness, damping);
57520
- const sy = carried ? carried.y : E(d.cy0, stiffness, damping);
57949
+ const sx = carried ? carried.x : $(d.cx0, stiffness, damping);
57950
+ const sy = carried ? carried.y : $(d.cy0, stiffness, damping);
57521
57951
  if (carried) {
57522
57952
  sx.stiffness = stiffness;
57523
57953
  sy.stiffness = stiffness;
@@ -57601,12 +58031,12 @@ var __async = (__this, __arguments, generator) => {
57601
58031
  let cx, cy;
57602
58032
  if (d.sx && d.sy) {
57603
58033
  if (elapsed >= 0 && !d.released) {
57604
- D(d.sx, d.x);
57605
- D(d.sy, d.y);
58034
+ _(d.sx, d.x);
58035
+ _(d.sy, d.y);
57606
58036
  d.released = true;
57607
58037
  }
57608
- const restX = R(d.sx, dt);
57609
- const restY = R(d.sy, dt);
58038
+ const restX = q(d.sx, dt);
58039
+ const restY = q(d.sy, dt);
57610
58040
  if (!d.released || !restX || !restY) done = false;
57611
58041
  cx = d.sx.value;
57612
58042
  cy = d.sy.value;
@@ -57938,14 +58368,14 @@ ${percent.toFixed(1)}%`;
57938
58368
  textEl.setAttribute("font-weight", String(cfg.fontWeight || 600));
57939
58369
  textEl.setAttribute("fill", cfg.color || color);
57940
58370
  const bottom = cfg.position === "bottom";
57941
- const R2 = cluster.outerR + fontSize * 0.6 + 3 + (cfg.offsetY || 0);
58371
+ const R = cluster.outerR + fontSize * 0.6 + 3 + (cfg.offsetY || 0);
57942
58372
  const estWidth = str.length * fontSize * 0.55;
57943
- const curved = !bottom && !cluster.flat && cfg.curved !== false && estWidth <= Math.PI * R2 * 0.95;
58373
+ const curved = !bottom && !cluster.flat && cfg.curved !== false && estWidth <= Math.PI * R * 0.95;
57944
58374
  if (curved) {
57945
58375
  const yMid = cluster.cy;
57946
- const x1 = cluster.cx - R2;
57947
- const x2 = cluster.cx + R2;
57948
- const d = `M ${x1} ${yMid} A ${R2} ${R2} 0 0 1 ${x2} ${yMid}`;
58376
+ const x1 = cluster.cx - R;
58377
+ const x2 = cluster.cx + R;
58378
+ const d = `M ${x1} ${yMid} A ${R} ${R} 0 0 1 ${x2} ${yMid}`;
57949
58379
  const arcId = `apexcharts-unit-label-${w.globals.chartID}-${cluster.i}`;
57950
58380
  const pathEl = BrowserAPIs.createElementNS(NS, "path");
57951
58381
  pathEl.setAttribute("id", arcId);