ooxml-core 1.45.0 → 1.46.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 (82) hide show
  1. package/dist/PptxHandler-FZ43IJFP.mjs +5 -0
  2. package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-HWEOIHEA.mjs} +2 -2
  3. package/dist/PptxHandler-XAUKKK36.cjs +14 -0
  4. package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-2BCCMZW7.cjs} +6 -6
  5. package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-66RV4F45.mjs} +2 -2
  6. package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-AFD72LIG.mjs} +3 -3
  7. package/dist/automation/index.cjs +12 -7
  8. package/dist/automation/index.mjs +12 -7
  9. package/dist/chart/edit/group-options.d.ts +4 -0
  10. package/dist/chart/edit/group-options.d.ts.map +1 -1
  11. package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
  12. package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
  13. package/dist/chart/edit/new-chart.d.ts +34 -1
  14. package/dist/chart/edit/new-chart.d.ts.map +1 -1
  15. package/dist/chart/edit/secondary-axis.d.ts +8 -1
  16. package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
  17. package/dist/chart/edit/type.d.ts +2 -0
  18. package/dist/chart/edit/type.d.ts.map +1 -1
  19. package/dist/chart/index.cjs +414 -263
  20. package/dist/chart/index.mjs +412 -264
  21. package/dist/{chunk-3J6VIKLP.cjs → chunk-5TOVSCVT.cjs} +3 -3
  22. package/dist/{chunk-U5BXJQZG.mjs → chunk-E2TTMUKU.mjs} +225 -38
  23. package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
  24. package/dist/{chunk-VKFKEVHK.mjs → chunk-EI6555OK.mjs} +1 -1
  25. package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
  26. package/dist/{chunk-GGJUWJXB.mjs → chunk-G6LEU3Y5.mjs} +1 -1
  27. package/dist/{chunk-RVYGAYCP.mjs → chunk-H43QQVJU.mjs} +1 -1
  28. package/dist/{chunk-CVJX6NNO.mjs → chunk-HH3AYM63.mjs} +227 -39
  29. package/dist/{chunk-YBSNMVSN.cjs → chunk-IBRV3AK3.cjs} +1497 -1309
  30. package/dist/{chunk-LCXBTJXE.mjs → chunk-L6MJGE3Q.mjs} +4 -4
  31. package/dist/{chunk-IPV3J3I5.mjs → chunk-LXVE2VKR.mjs} +4 -1
  32. package/dist/{chunk-QZPOPUI5.cjs → chunk-QUAFASFC.cjs} +4 -0
  33. package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
  34. package/dist/{chunk-GXYK3H4O.mjs → chunk-X2DC7XRL.mjs} +17 -16
  35. package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
  36. package/dist/docx/index.cjs +300 -144
  37. package/dist/docx/index.mjs +300 -144
  38. package/dist/index.cjs +484 -333
  39. package/dist/index.mjs +484 -333
  40. package/dist/pptx/automation/index.cjs +350 -143
  41. package/dist/pptx/automation/index.d.ts +4 -4
  42. package/dist/pptx/automation/index.mjs +5 -5
  43. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts → index-BPGaFlm5.d.ts} +4 -4
  44. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index-BPGaFlm5.d.ts.map} +1 -1
  45. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-D4-WJQ1r.d.ts} +3 -3
  46. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-D4-WJQ1r.d.ts.map} +1 -1
  47. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-DtFoPmk7.d.ts} +49 -6
  48. package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +1 -0
  49. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts → text-operations-CVHXOSit.d.ts} +18 -3
  50. package/dist/pptx/chunks/{text-operations-Mek86RBL.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
  51. package/dist/pptx/cli/index.cjs +307 -100
  52. package/dist/pptx/cli/index.d.ts +1 -1
  53. package/dist/pptx/cli/index.mjs +4 -4
  54. package/dist/pptx/converter/index.cjs +1 -0
  55. package/dist/pptx/converter/index.d.ts +1 -1
  56. package/dist/pptx/converter/index.mjs +2 -2
  57. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
  58. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
  59. package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
  60. package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
  61. package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
  62. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  63. package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
  64. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  65. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  66. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  67. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  68. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  69. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  70. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  71. package/dist/pptx/index.cjs +351 -147
  72. package/dist/pptx/index.d.ts +5 -5
  73. package/dist/pptx/index.mjs +5 -5
  74. package/dist/pptx/node/index.d.ts +1 -1
  75. package/dist/xlsx/index.cjs +12 -7
  76. package/dist/xlsx/index.mjs +12 -7
  77. package/dist/xlsx/ui/index.cjs +12 -7
  78. package/dist/xlsx/ui/index.mjs +12 -7
  79. package/package.json +1 -1
  80. package/dist/PptxHandler-3RDVJFQV.cjs +0 -14
  81. package/dist/PptxHandler-EI6DMHPM.mjs +0 -5
  82. package/dist/pptx/chunks/index-DGKI80Hj.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -771,6 +771,7 @@ __export(chart_exports, {
771
771
  applyLabelManualLayout: () => applyLabelManualLayout,
772
772
  applyStandardChartLayout: () => applyStandardChartLayout,
773
773
  assertBarClusterOptions: () => assertBarClusterOptions,
774
+ assertChartGroupOption: () => assertChartGroupOption,
774
775
  assertChartPercent: () => assertChartPercent,
775
776
  assignOrDelete: () => assignOrDelete,
776
777
  autoSeriesColor: () => autoSeriesColor,
@@ -826,6 +827,7 @@ __export(chart_exports, {
826
827
  chartFormatTargetKey: () => chartFormatTargetKey,
827
828
  chartGradientMarkup: () => chartGradientMarkup,
828
829
  chartGradientStopTransparency: () => chartGradientStopTransparency,
830
+ chartGroupElement: () => chartGroupElement,
829
831
  chartGroupHasAxes: () => groupHasAxes,
830
832
  chartGroupPaintsLine: () => chartGroupPaintsLine,
831
833
  chartIssuesLostOnWrite: () => chartIssuesLostOnWrite,
@@ -948,6 +950,7 @@ __export(chart_exports, {
948
950
  hydrateChartExSpace: () => hydrateChartExSpace,
949
951
  impliesAutoTitle: () => impliesAutoTitle,
950
952
  isChartExRoot: () => isChartExRoot,
953
+ isChartGroupOption: () => isChartGroupOption,
951
954
  isChartexOnlyType: () => isChartexOnlyType,
952
955
  isEmbeddedXlsxPart: () => isEmbeddedXlsxPart,
953
956
  isXYChartKind: () => isXYChartKind,
@@ -4964,9 +4967,9 @@ function writeChartAxisFormatting(root, formatting) {
4964
4967
  const previous = readChartFormatting(root);
4965
4968
  let changed = false;
4966
4969
  for (const part of ["categoryAxis", "valueAxis"]) {
4967
- const axis = nodes[part];
4970
+ const axis2 = nodes[part];
4968
4971
  const entry3 = formatting.entries[part];
4969
- if (!axis || !entry3) continue;
4972
+ if (!axis2 || !entry3) continue;
4970
4973
  for (const [name2, flag, value, successors] of [
4971
4974
  [
4972
4975
  "delete",
@@ -5014,17 +5017,17 @@ function writeChartAxisFormatting(root, formatting) {
5014
5017
  const key = name2 === "delete" ? "axisVisible" : "labelsVisible";
5015
5018
  const revealingAxis = name2 === "tickLblPos" && entry3.axisVisible === true && previous?.entries[part]?.axisVisible === false;
5016
5019
  if (flag === previous?.entries[part]?.[key] && !revealingAxis) continue;
5017
- let node = first(axis, name2, NS.c);
5020
+ let node = first(axis2, name2, NS.c);
5018
5021
  const old = node?.getAttribute("val");
5019
5022
  if (name2 === "delete" && old !== void 0 && old !== null && (flag && (old === "0" || old === "false") || !flag && (old === "1" || old === "true")))
5020
5023
  continue;
5021
5024
  if (name2 === "tickLblPos" && node && (flag ? old !== "none" : old === "none")) continue;
5022
5025
  if (!node) {
5023
5026
  node = root.ownerDocument.createElementNS(NS.c, "c:" + name2);
5024
- const before = elements(axis).find(
5027
+ const before = elements(axis2).find(
5025
5028
  (child6) => child6.namespaceURI === NS.c && successors.includes(child6.localName)
5026
5029
  );
5027
- axis.insertBefore(node, before ?? null);
5030
+ axis2.insertBefore(node, before ?? null);
5028
5031
  }
5029
5032
  node.setAttribute("val", value);
5030
5033
  changed = true;
@@ -6443,8 +6446,8 @@ function parseGroup(context, element4) {
6443
6446
  element: element4.localName,
6444
6447
  is3D,
6445
6448
  series: children(element4, "ser", NS.c).map((ser) => parseSeries(context, ser)),
6446
- axisIds: children(element4, "axId", NS.c).flatMap((axis) => {
6447
- const raw2 = attribute(axis, "val")?.trim();
6449
+ axisIds: children(element4, "axId", NS.c).flatMap((axis2) => {
6450
+ const raw2 = attribute(axis2, "val")?.trim();
6448
6451
  const id = raw2 ? Number(raw2) : Number.NaN;
6449
6452
  return Number.isFinite(id) ? [id] : [];
6450
6453
  })
@@ -6593,9 +6596,9 @@ function parsePlotArea(context, element4) {
6593
6596
  plotArea.groups.push(parseGroup(context, child6));
6594
6597
  handled.add(child6.localName);
6595
6598
  }
6596
- const axis = AXIS_ELEMENTS[child6.localName];
6597
- if (axis) {
6598
- plotArea.axes.push(parseAxis(context, child6, axis));
6599
+ const axis2 = AXIS_ELEMENTS[child6.localName];
6600
+ if (axis2) {
6601
+ plotArea.axes.push(parseAxis(context, child6, axis2));
6599
6602
  handled.add(child6.localName);
6600
6603
  }
6601
6604
  }
@@ -7149,14 +7152,14 @@ var AXIS_ELEMENTS2 = {
7149
7152
  ser: "serAx"
7150
7153
  };
7151
7154
  var gridlinesXml = (context, local, present2, shape) => present2 ? elementXml(local, shapePropertiesXml(context, shape)) : "";
7152
- function axisXml(context, axis) {
7153
- const { scaling } = axis;
7155
+ function axisXml(context, axis2) {
7156
+ const { scaling } = axis2;
7154
7157
  return elementXml(
7155
- AXIS_ELEMENTS2[axis.kind],
7156
- valXml("axId", axis.id) + elementXml(
7158
+ AXIS_ELEMENTS2[axis2.kind],
7159
+ valXml("axId", axis2.id) + elementXml(
7157
7160
  "scaling",
7158
7161
  valXml("logBase", scaling.logBase) + valXml("orientation", scaling.orientation) + valXml("max", scaling.max) + valXml("min", scaling.min)
7159
- ) + valXml("delete", axis.deleted) + valXml("axPos", axis.position) + gridlinesXml(context, "majorGridlines", axis.majorGridlines, axis.majorGridlinesSpPr) + gridlinesXml(context, "minorGridlines", axis.minorGridlines, axis.minorGridlinesSpPr) + titleXml(context, axis.title) + numberFormatXml(axis.numberFormat) + valXml("majorTickMark", axis.majorTickMark) + valXml("minorTickMark", axis.minorTickMark) + valXml("tickLblPos", axis.tickLabelPosition) + shapePropertiesXml(context, axis.spPr) + textBodyXml(context, axis.txPr) + valXml("crossAx", axis.crossAxisId) + valXml("crosses", axis.crosses) + valXml("crossesAt", axis.crossesAt) + valXml("crossBetween", axis.crossBetween) + valXml("auto", axis.auto) + valXml("lblAlgn", axis.labelAlign) + valXml("lblOffset", axis.labelOffset) + valXml("baseTimeUnit", axis.baseTimeUnit) + valXml("majorUnit", axis.majorUnit) + valXml("majorTimeUnit", axis.majorTimeUnit) + valXml("minorUnit", axis.minorUnit) + valXml("minorTimeUnit", axis.minorTimeUnit) + displayUnitsXml(context, axis.displayUnits) + valXml("tickLblSkip", axis.tickLabelSkip) + valXml("tickMarkSkip", axis.tickMarkSkip) + valXml("noMultiLvlLbl", axis.noMultiLevelLabels) + raw(context, axis.extLst)
7162
+ ) + valXml("delete", axis2.deleted) + valXml("axPos", axis2.position) + gridlinesXml(context, "majorGridlines", axis2.majorGridlines, axis2.majorGridlinesSpPr) + gridlinesXml(context, "minorGridlines", axis2.minorGridlines, axis2.minorGridlinesSpPr) + titleXml(context, axis2.title) + numberFormatXml(axis2.numberFormat) + valXml("majorTickMark", axis2.majorTickMark) + valXml("minorTickMark", axis2.minorTickMark) + valXml("tickLblPos", axis2.tickLabelPosition) + shapePropertiesXml(context, axis2.spPr) + textBodyXml(context, axis2.txPr) + valXml("crossAx", axis2.crossAxisId) + valXml("crosses", axis2.crosses) + valXml("crossesAt", axis2.crossesAt) + valXml("crossBetween", axis2.crossBetween) + valXml("auto", axis2.auto) + valXml("lblAlgn", axis2.labelAlign) + valXml("lblOffset", axis2.labelOffset) + valXml("baseTimeUnit", axis2.baseTimeUnit) + valXml("majorUnit", axis2.majorUnit) + valXml("majorTimeUnit", axis2.majorTimeUnit) + valXml("minorUnit", axis2.minorUnit) + valXml("minorTimeUnit", axis2.minorTimeUnit) + displayUnitsXml(context, axis2.displayUnits) + valXml("tickLblSkip", axis2.tickLabelSkip) + valXml("tickMarkSkip", axis2.tickMarkSkip) + valXml("noMultiLvlLbl", axis2.noMultiLevelLabels) + raw(context, axis2.extLst)
7160
7163
  );
7161
7164
  }
7162
7165
 
@@ -7230,7 +7233,7 @@ function groupXml(context, group2) {
7230
7233
  function plotAreaXml(context, plotArea) {
7231
7234
  return elementXml(
7232
7235
  "plotArea",
7233
- layoutXml(context, plotArea.layout) + plotArea.groups.map((group2) => groupXml(context, group2)).join("") + plotArea.axes.map((axis) => axisXml(context, axis)).join("") + dataTableXml(context, plotArea.dataTable) + shapePropertiesXml(context, plotArea.spPr) + raw(context, plotArea.extLst)
7236
+ layoutXml(context, plotArea.layout) + plotArea.groups.map((group2) => groupXml(context, group2)).join("") + plotArea.axes.map((axis2) => axisXml(context, axis2)).join("") + dataTableXml(context, plotArea.dataTable) + shapePropertiesXml(context, plotArea.spPr) + raw(context, plotArea.extLst)
7234
7237
  );
7235
7238
  }
7236
7239
 
@@ -7639,14 +7642,14 @@ function parseLegend2(context, element4) {
7639
7642
  }
7640
7643
 
7641
7644
  // chart/ex/parse-axis.ts
7642
- function parseScaling(context, axis) {
7643
- const category = cxChild(axis, "catScaling");
7645
+ function parseScaling(context, axis2) {
7646
+ const category = cxChild(axis2, "catScaling");
7644
7647
  if (category)
7645
7648
  return assignDefined(
7646
7649
  { kind: "cat" },
7647
7650
  { gapWidth: autoNumberAttribute(context, category, "gapWidth") }
7648
7651
  );
7649
- const value = cxChild(axis, "valScaling");
7652
+ const value = cxChild(axis2, "valScaling");
7650
7653
  if (!value) return void 0;
7651
7654
  return assignDefined(
7652
7655
  { kind: "val" },
@@ -7857,9 +7860,9 @@ function parseSeries2(context, element4) {
7857
7860
  const labels2 = cxChild(element4, "dataLabels");
7858
7861
  const inline = cxChild(element4, "data");
7859
7862
  const layout = cxChild(element4, "layoutPr");
7860
- const axisIds = cxChildren(element4, "axisId").map((axis) => indexAttribute(context, axis, "val")).filter((id) => id !== void 0);
7863
+ const axisIds2 = cxChildren(element4, "axisId").map((axis2) => indexAttribute(context, axis2, "val")).filter((id) => id !== void 0);
7861
7864
  return assignDefined(
7862
- { layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds },
7865
+ { layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds: axisIds2 },
7863
7866
  {
7864
7867
  hidden: boolAttribute(context, element4, "hidden"),
7865
7868
  ownerIndex: numberAttribute(context, element4, "ownerIdx"),
@@ -7901,7 +7904,7 @@ function parsePlotArea2(context, element4) {
7901
7904
  const regionExtLst = extensionList2(region);
7902
7905
  if (regionExtLst) out.regionExtLst = regionExtLst;
7903
7906
  }
7904
- out.axes = cxChildren(element4, "axis").map((axis) => parseAxis2(context, axis));
7907
+ out.axes = cxChildren(element4, "axis").map((axis2) => parseAxis2(context, axis2));
7905
7908
  return assignDefined(out, { spPr: shapeProperties2(element4), extLst: extensionList2(element4) });
7906
7909
  }
7907
7910
  function namespaceDeclarations2(root) {
@@ -8152,19 +8155,19 @@ function scalingXml(scaling) {
8152
8155
  );
8153
8156
  }
8154
8157
  var tickMarksXml = (local, marks) => marks ? cxElement(local, "", attributes([["type", marks.type]])) : "";
8155
- function axisXml2(context, axis) {
8156
- const units2 = axis.units;
8158
+ function axisXml2(context, axis2) {
8159
+ const units2 = axis2.units;
8157
8160
  const gridlines = (local, value) => value ? cxElement(local, shapeXml(context, value.spPr)) : "";
8158
8161
  return cxElement(
8159
8162
  "axis",
8160
- scalingXml(axis.scaling) + titleXml2(context, axis.title) + (units2 ? cxElement(
8163
+ scalingXml(axis2.scaling) + titleXml2(context, axis2.title) + (units2 ? cxElement(
8161
8164
  "units",
8162
8165
  titleXml2(context, units2.label, "unitsLabel") + raw(context, units2.extLst),
8163
8166
  attributes([["unit", units2.unit]])
8164
- ) : "") + gridlines("majorGridlines", axis.majorGridlines) + gridlines("minorGridlines", axis.minorGridlines) + tickMarksXml("majorTickMarks", axis.majorTickMarks) + tickMarksXml("minorTickMarks", axis.minorTickMarks) + (axis.tickLabels ? cxElement("tickLabels", raw(context, axis.tickLabels.extLst)) : "") + numberFormatXml2(axis.numberFormat) + shapeXml(context, axis.spPr) + textBodyXml2(context, axis.txPr) + raw(context, axis.extLst),
8167
+ ) : "") + gridlines("majorGridlines", axis2.majorGridlines) + gridlines("minorGridlines", axis2.minorGridlines) + tickMarksXml("majorTickMarks", axis2.majorTickMarks) + tickMarksXml("minorTickMarks", axis2.minorTickMarks) + (axis2.tickLabels ? cxElement("tickLabels", raw(context, axis2.tickLabels.extLst)) : "") + numberFormatXml2(axis2.numberFormat) + shapeXml(context, axis2.spPr) + textBodyXml2(context, axis2.txPr) + raw(context, axis2.extLst),
8165
8168
  attributes([
8166
- ["id", axis.id],
8167
- ["hidden", axis.hidden]
8169
+ ["id", axis2.id],
8170
+ ["hidden", axis2.hidden]
8168
8171
  ])
8169
8172
  );
8170
8173
  }
@@ -8199,7 +8202,7 @@ function writeChartExSpace(space3, options2 = {}) {
8199
8202
  );
8200
8203
  const plotArea = cxElement(
8201
8204
  "plotArea",
8202
- region + plot.axes.map((axis) => axisXml2(context, axis)).join("") + shapeXml(context, plot.spPr) + raw(context, plot.extLst)
8205
+ region + plot.axes.map((axis2) => axisXml2(context, axis2)).join("") + shapeXml(context, plot.spPr) + raw(context, plot.extLst)
8203
8206
  );
8204
8207
  const legend = space3.legend;
8205
8208
  const legendXml2 = legend ? cxElement(
@@ -8539,9 +8542,9 @@ function chartExSeriesAt(space3, index) {
8539
8542
  return series2;
8540
8543
  }
8541
8544
  function chartExAxisAt(space3, index) {
8542
- const axis = typeof index === "number" && Number.isSafeInteger(index) ? space3.plotArea.axes.find((_, position) => position === index) : void 0;
8543
- if (!axis) throw new RangeError(`No chart axis at index ${String(index)}`);
8544
- return axis;
8545
+ const axis2 = typeof index === "number" && Number.isSafeInteger(index) ? space3.plotArea.axes.find((_, position) => position === index) : void 0;
8546
+ if (!axis2) throw new RangeError(`No chart axis at index ${String(index)}`);
8547
+ return axis2;
8545
8548
  }
8546
8549
  function setChartExTitle(space3, text3) {
8547
8550
  return editChartExSpace(space3, (draft) => {
@@ -8819,7 +8822,7 @@ function setChartExLayout(space3, layout) {
8819
8822
  ];
8820
8823
  for (const series2 of draft.plotArea.series)
8821
8824
  series2.axisIds = draft.plotArea.axes.flatMap(
8822
- (axis) => axis.id === void 0 ? [] : [axis.id]
8825
+ (axis2) => axis2.id === void 0 ? [] : [axis2.id]
8823
8826
  );
8824
8827
  } else {
8825
8828
  draft.plotArea.axes = [];
@@ -10482,8 +10485,8 @@ function chartSummarySeries(source2, chartType, groupLabels, groupSmooth) {
10482
10485
  Object.assign(out, summaryAnalysis(source2));
10483
10486
  return out;
10484
10487
  }
10485
- function valueAxisId(chartSpace, axisIds) {
10486
- return axisIds.find(
10488
+ function valueAxisId(chartSpace, axisIds2) {
10489
+ return axisIds2.find(
10487
10490
  (id) => chartSpace.plotArea.axes.some((a2) => a2.id === id && a2.kind === "val")
10488
10491
  );
10489
10492
  }
@@ -11190,35 +11193,35 @@ function chartExSummaryFromModel(space3) {
11190
11193
  showLegend: legend !== void 0
11191
11194
  };
11192
11195
  if (chartType === "boxWhisker") {
11193
- summary.axes = space3.plotArea.axes.flatMap((axis) => {
11194
- const scaling = axis.scaling;
11196
+ summary.axes = space3.plotArea.axes.flatMap((axis2) => {
11197
+ const scaling = axis2.scaling;
11195
11198
  if (!scaling) return [];
11196
11199
  const value = scaling.kind === "val";
11197
11200
  return [
11198
11201
  {
11199
11202
  kind: value ? "val" : "cat",
11200
- ...axis.id === void 0 ? {} : { id: axis.id },
11203
+ ...axis2.id === void 0 ? {} : { id: axis2.id },
11201
11204
  position: value ? "l" : "b",
11202
- deleted: axis.hidden ?? false,
11205
+ deleted: axis2.hidden ?? false,
11203
11206
  scaling: {
11204
11207
  ...value && typeof scaling.min === "number" ? { min: scaling.min } : {},
11205
11208
  ...value && typeof scaling.max === "number" ? { max: scaling.max } : {}
11206
11209
  },
11207
- majorGridlines: !!axis.majorGridlines,
11208
- minorGridlines: !!axis.minorGridlines,
11209
- ...axis.majorGridlines?.spPr ? { majorGridlinesSpPr: axis.majorGridlines.spPr } : {},
11210
- ...axis.minorGridlines?.spPr ? { minorGridlinesSpPr: axis.minorGridlines.spPr } : {},
11210
+ majorGridlines: !!axis2.majorGridlines,
11211
+ minorGridlines: !!axis2.minorGridlines,
11212
+ ...axis2.majorGridlines?.spPr ? { majorGridlinesSpPr: axis2.majorGridlines.spPr } : {},
11213
+ ...axis2.minorGridlines?.spPr ? { minorGridlinesSpPr: axis2.minorGridlines.spPr } : {},
11211
11214
  ...value && typeof scaling.majorUnit === "number" ? { majorUnit: scaling.majorUnit } : {},
11212
11215
  ...value && typeof scaling.minorUnit === "number" ? { minorUnit: scaling.minorUnit } : {},
11213
- ...axis.spPr ? { spPr: axis.spPr } : {},
11214
- ...axis.numberFormat ? { numberFormat: axis.numberFormat } : {},
11215
- ...axis.tickLabels ? {} : { tickLabelPosition: "none" }
11216
+ ...axis2.spPr ? { spPr: axis2.spPr } : {},
11217
+ ...axis2.numberFormat ? { numberFormat: axis2.numberFormat } : {},
11218
+ ...axis2.tickLabels ? {} : { tickLabelPosition: "none" }
11216
11219
  }
11217
11220
  ];
11218
11221
  });
11219
11222
  }
11220
11223
  if (chartType === "funnel") {
11221
- const cat = space3.plotArea.axes.find((axis) => axis.scaling?.kind === "cat")?.scaling;
11224
+ const cat = space3.plotArea.axes.find((axis2) => axis2.scaling?.kind === "cat")?.scaling;
11222
11225
  if (cat?.kind === "cat" && typeof cat.gapWidth === "number")
11223
11226
  summary.funnelGapWidth = cat.gapWidth;
11224
11227
  }
@@ -12448,44 +12451,44 @@ function formatDate(date, unit, format) {
12448
12451
 
12449
12452
  // chart/render/chart-svg-date-axis.ts
12450
12453
  function chartDateAxis(model, plot, out) {
12451
- const axis = model.axes?.category?.source;
12454
+ const axis2 = model.axes?.category?.source;
12452
12455
  const values = model.dateCategories;
12453
- if (axis?.kind !== "date" || !values?.length) return void 0;
12456
+ if (axis2?.kind !== "date" || !values?.length) return void 0;
12454
12457
  const points2 = values.flatMap(
12455
12458
  (value, index) => value === null || !Number.isFinite(value) ? [] : [{ value, index }]
12456
12459
  ).sort((a2, b) => a2.value - b.value);
12457
12460
  if (!points2.length) return void 0;
12458
- const min = axis.scaling.min ?? points2[0].value;
12459
- const max = axis.scaling.max ?? points2.at(-1).value;
12461
+ const min = axis2.scaling.min ?? points2[0].value;
12462
+ const max = axis2.scaling.max ?? points2.at(-1).value;
12460
12463
  if (!Number.isFinite(min) || !Number.isFinite(max) || max < min) return void 0;
12461
12464
  const position = (value) => {
12462
12465
  const ratio = max === min ? 0.5 : (value - min) / (max - min);
12463
- const t = axis.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
12466
+ const t = axis2.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
12464
12467
  return model.horizontal ? plot.y + plot.h * (1 - t) : plot.x + plot.w * t;
12465
12468
  };
12466
12469
  const visible = points2.filter((p2) => p2.value >= min && p2.value <= max);
12467
12470
  const unitOf = (unit2) => unit2 === "months" || unit2 === "years" ? unit2 : "days";
12468
- const unit = unitOf(axis.majorTimeUnit ?? axis.baseTimeUnit);
12471
+ const unit = unitOf(axis2.majorTimeUnit ?? axis2.baseTimeUnit);
12469
12472
  const ticks = calendarTicks(
12470
12473
  min,
12471
12474
  max,
12472
12475
  model.date1904 ?? false,
12473
12476
  unit,
12474
- Math.max(1, axis.majorUnit ?? 1)
12477
+ Math.max(1, axis2.majorUnit ?? 1)
12475
12478
  );
12476
12479
  const attrs2 = chartTextAttributes(model, "categoryAxis");
12477
12480
  const size = attrs2.size ?? 10;
12478
- const y = axis.position === "t" ? plot.y : plot.y + plot.h;
12481
+ const y = axis2.position === "t" ? plot.y : plot.y + plot.h;
12479
12482
  const paint2 = model.axes?.category?.line;
12480
12483
  const stroke = { color: paint2?.color ?? "#BFBFBF", width: paint2?.width ?? 1 };
12481
12484
  const mark = (serial, placement, length) => {
12482
- if (!placement || placement === "none" || axis.deleted) return;
12483
- const inward = axis.position === "t" ? length : -length;
12485
+ if (!placement || placement === "none" || axis2.deleted) return;
12486
+ const inward = axis2.position === "t" ? length : -length;
12484
12487
  const start = placement === "cross" ? -length : 0;
12485
12488
  const end = placement === "cross" ? length : placement === "in" ? inward : -inward;
12486
12489
  if (model.horizontal) {
12487
- const x = axis.position === "r" ? plot.x + plot.w : plot.x;
12488
- const direction = axis.position === "r" ? -1 : 1;
12490
+ const x = axis2.position === "r" ? plot.x + plot.w : plot.x;
12491
+ const direction = axis2.position === "r" ? -1 : 1;
12489
12492
  const a2 = placement === "cross" ? -length : 0;
12490
12493
  const b = placement === "cross" ? length : placement === "in" ? direction * length : -direction * length;
12491
12494
  out.push(
@@ -12497,19 +12500,19 @@ function chartDateAxis(model, plot, out) {
12497
12500
  );
12498
12501
  };
12499
12502
  ticks.forEach((serial, index) => {
12500
- if (index % Math.max(1, axis.tickMarkSkip ?? 1) === 0) mark(serial, axis.majorTickMark, 4);
12501
- if (axis.deleted || model.dataTable || axis.tickLabelPosition === "none" || index % Math.max(1, axis.tickLabelSkip ?? 1))
12503
+ if (index % Math.max(1, axis2.tickMarkSkip ?? 1) === 0) mark(serial, axis2.majorTickMark, 4);
12504
+ if (axis2.deleted || model.dataTable || axis2.tickLabelPosition === "none" || index % Math.max(1, axis2.tickLabelSkip ?? 1))
12502
12505
  return;
12503
12506
  const label = formatDate(
12504
12507
  excelSerialToDate(serial, model.date1904),
12505
12508
  unit,
12506
- axis.numberFormat?.formatCode
12509
+ axis2.numberFormat?.formatCode
12507
12510
  );
12508
12511
  if (model.horizontal)
12509
12512
  out.push(text(plot.x - 4, position(serial) + size * 0.3, label, { ...attrs2, anchor: "end" }));
12510
12513
  else {
12511
- const above2 = axis.tickLabelPosition === "high" || axis.tickLabelPosition !== "low" && axis.position === "t";
12512
- const baseline = axis.tickLabelPosition === "high" ? plot.y : axis.tickLabelPosition === "low" ? plot.y + plot.h : y;
12514
+ const above2 = axis2.tickLabelPosition === "high" || axis2.tickLabelPosition !== "low" && axis2.position === "t";
12515
+ const baseline = axis2.tickLabelPosition === "high" ? plot.y : axis2.tickLabelPosition === "low" ? plot.y + plot.h : y;
12513
12516
  out.push(
12514
12517
  text(position(serial), baseline + (above2 ? -4 : size + 3), label, {
12515
12518
  ...attrs2,
@@ -12518,15 +12521,15 @@ function chartDateAxis(model, plot, out) {
12518
12521
  );
12519
12522
  }
12520
12523
  });
12521
- if (axis.minorTickMark && axis.minorTickMark !== "none")
12524
+ if (axis2.minorTickMark && axis2.minorTickMark !== "none")
12522
12525
  for (const serial of calendarTicks(
12523
12526
  min,
12524
12527
  max,
12525
12528
  model.date1904 ?? false,
12526
- unitOf(axis.minorTimeUnit ?? axis.baseTimeUnit ?? unit),
12527
- Math.max(1, axis.minorUnit ?? 1)
12529
+ unitOf(axis2.minorTimeUnit ?? axis2.baseTimeUnit ?? unit),
12530
+ Math.max(1, axis2.minorUnit ?? 1)
12528
12531
  ))
12529
- mark(serial, axis.minorTickMark, 2.5);
12532
+ mark(serial, axis2.minorTickMark, 2.5);
12530
12533
  return {
12531
12534
  order: visible.map((p2) => p2.index),
12532
12535
  band: (index) => position(values[index] ?? min),
@@ -12671,12 +12674,12 @@ function chartLineDashArray(style, width) {
12671
12674
  }
12672
12675
 
12673
12676
  // chart/render/chart-svg-axes.ts
12674
- function axisTickText(value, axis, percent = false) {
12675
- return formatChartNumber(value, axis?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
12677
+ function axisTickText(value, axis2, percent = false) {
12678
+ return formatChartNumber(value, axis2?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
12676
12679
  }
12677
- function axisLine(model, axis, part, x1, y1, x2, y2) {
12678
- if (axis?.source.deleted) return "";
12679
- return styledAxisLine(x1, y1, x2, y2, axis?.line, chartStroke(model, part));
12680
+ function axisLine(model, axis2, part, x1, y1, x2, y2) {
12681
+ if (axis2?.source.deleted) return "";
12682
+ return styledAxisLine(x1, y1, x2, y2, axis2?.line, chartStroke(model, part));
12680
12683
  }
12681
12684
  function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
12682
12685
  const color2 = paint2?.color ?? fallback.color;
@@ -12688,7 +12691,7 @@ function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
12688
12691
  dash ? ` stroke-dasharray="${dash}"/>` : "/>"
12689
12692
  );
12690
12693
  }
12691
- function axisGridlines(model, axis, ticks, position, plot, vertical) {
12694
+ function axisGridlines(model, axis2, ticks, position, plot, vertical) {
12692
12695
  const draw2 = (values, paint2, minor2) => {
12693
12696
  const fallback = chartStroke(model, minor2 ? "gridlineMinor" : "gridlineMajor");
12694
12697
  return values.map((value) => {
@@ -12696,8 +12699,8 @@ function axisGridlines(model, axis, ticks, position, plot, vertical) {
12696
12699
  return vertical ? styledAxisLine(p2, plot.y, p2, plot.y + plot.h, paint2, fallback) : styledAxisLine(plot.x, p2, plot.x + plot.w, p2, paint2, fallback);
12697
12700
  }).join("");
12698
12701
  };
12699
- const major = !axis || axis.source.majorGridlines ? draw2(ticks, axis?.majorGrid, false) : "";
12700
- const minor = axis?.source.minorGridlines ? draw2(axis.minorTicks, axis.minorGrid, true) : "";
12702
+ const major = !axis2 || axis2.source.majorGridlines ? draw2(ticks, axis2?.majorGrid, false) : "";
12703
+ const minor = axis2?.source.minorGridlines ? draw2(axis2.minorTicks, axis2.minorGrid, true) : "";
12701
12704
  return major + minor;
12702
12705
  }
12703
12706
 
@@ -12766,20 +12769,20 @@ function computeLogValueRange(series2, logBase) {
12766
12769
  logBase
12767
12770
  };
12768
12771
  }
12769
- function computeValueRangeForAxis(series2, axis, plotHeightPx) {
12770
- const requestedLogBase = axis?.logBase ?? 10;
12771
- const logBase = axis?.logScale && Number.isFinite(requestedLogBase) && requestedLogBase > 1 ? requestedLogBase : axis?.logScale ? 10 : void 0;
12772
+ function computeValueRangeForAxis(series2, axis2, plotHeightPx) {
12773
+ const requestedLogBase = axis2?.logBase ?? 10;
12774
+ const logBase = axis2?.logScale && Number.isFinite(requestedLogBase) && requestedLogBase > 1 ? requestedLogBase : axis2?.logScale ? 10 : void 0;
12772
12775
  const automatic = logBase ? computeLogValueRange(series2, logBase) : computeAxisValueRange(series2, plotHeightPx);
12773
- return withAxisBounds(automatic, axis, logBase);
12776
+ return withAxisBounds(automatic, axis2, logBase);
12774
12777
  }
12775
- function computeStackedValueRangeForAxis(series2, catCount, axis, isPercent, plotSizePx) {
12778
+ function computeStackedValueRangeForAxis(series2, catCount, axis2, isPercent, plotSizePx) {
12776
12779
  if (isPercent) {
12777
12780
  return {
12778
12781
  ...percentStackedRange(series2, catCount, plotSizePx),
12779
- ...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
12782
+ ...axis2?.orientation === "maxMin" ? { reverseOrder: true } : {}
12780
12783
  };
12781
12784
  }
12782
- return withAxisBounds(computeAxisStackedValueRange(series2, catCount, plotSizePx), axis);
12785
+ return withAxisBounds(computeAxisStackedValueRange(series2, catCount, plotSizePx), axis2);
12783
12786
  }
12784
12787
  function percentStackedRange(series2, catCount, plotSizePx) {
12785
12788
  const shares = series2.map((entry3) => ({
@@ -12802,9 +12805,9 @@ function percentStackedRange(series2, catCount, plotSizePx) {
12802
12805
  ...unit !== void 0 && 100 % unit === 0 && min % unit === 0 ? { majorUnit: unit } : {}
12803
12806
  };
12804
12807
  }
12805
- function withAxisBounds(automatic, axis, logBase) {
12806
- const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
12807
- const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
12808
+ function withAxisBounds(automatic, axis2, logBase) {
12809
+ const validMin = typeof axis2?.min === "number" && Number.isFinite(axis2.min) && (!logBase || axis2.min > 0) ? axis2.min : void 0;
12810
+ const validMax = typeof axis2?.max === "number" && Number.isFinite(axis2.max) && (!logBase || axis2.max > 0) ? axis2.max : void 0;
12808
12811
  const min = validMin ?? automatic.min;
12809
12812
  let max = validMax ?? automatic.max;
12810
12813
  const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
@@ -12818,7 +12821,7 @@ function withAxisBounds(automatic, axis, logBase) {
12818
12821
  span: Math.max(span, Number.EPSILON),
12819
12822
  ...majorUnit !== void 0 ? { majorUnit } : {},
12820
12823
  ...logBase ? { logScale: true, logBase } : {},
12821
- ...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
12824
+ ...axis2?.orientation === "maxMin" ? { reverseOrder: true } : {}
12822
12825
  };
12823
12826
  }
12824
12827
  function valueToYLog(val2, range2, topY, bottomY) {
@@ -12829,10 +12832,10 @@ function valueToYLog(val2, range2, topY, bottomY) {
12829
12832
  return range2.reverseOrder ? topY + ratio * (bottomY - topY) : bottomY - ratio * (bottomY - topY);
12830
12833
  }
12831
12834
  function findLogAxis(axes) {
12832
- return axes?.find((axis) => axis.axisType === "valAx" && axis.logScale);
12835
+ return axes?.find((axis2) => axis2.axisType === "valAx" && axis2.logScale);
12833
12836
  }
12834
12837
  function computeValueRangeForChart(series2, axes, plotHeightPx) {
12835
- const primaryAxis = axes?.find((axis) => axis.axisType === "valAx" && axis.axPos === "l") ?? axes?.find((axis) => axis.axisType === "valAx" && axis.axPos !== "r");
12838
+ const primaryAxis = axes?.find((axis2) => axis2.axisType === "valAx" && axis2.axPos === "l") ?? axes?.find((axis2) => axis2.axisType === "valAx" && axis2.axPos !== "r");
12836
12839
  return computeValueRangeForAxis(series2, primaryAxis, plotHeightPx);
12837
12840
  }
12838
12841
 
@@ -12865,11 +12868,11 @@ function generateIntervalTicks(range2, unit) {
12865
12868
  const count = Math.min(Math.max(last - first2 + 1, 0), 2e3);
12866
12869
  return Array.from({ length: count }, (_, index) => (first2 + index) * unit);
12867
12870
  }
12868
- function generateAxisTicks(range2, axis, defaultIntervals) {
12871
+ function generateAxisTicks(range2, axis2, defaultIntervals) {
12869
12872
  if (range2.logScale && range2.logBase) {
12870
12873
  return generateLogTicks(range2);
12871
12874
  }
12872
- const explicit = generateIntervalTicks(range2, axis?.majorUnit ?? 0);
12875
+ const explicit = generateIntervalTicks(range2, axis2?.majorUnit ?? 0);
12873
12876
  if (explicit.length > 0) {
12874
12877
  return explicit;
12875
12878
  }
@@ -12882,12 +12885,12 @@ function generateAxisTicks(range2, axis, defaultIntervals) {
12882
12885
  (_, index) => range2.min + range2.span / defaultIntervals * index
12883
12886
  );
12884
12887
  }
12885
- function generateMinorAxisTicks(range2, axis) {
12886
- const minor = generateIntervalTicks(range2, axis?.minorUnit ?? 0);
12888
+ function generateMinorAxisTicks(range2, axis2) {
12889
+ const minor = generateIntervalTicks(range2, axis2?.minorUnit ?? 0);
12887
12890
  if (minor.length === 0) {
12888
12891
  return [];
12889
12892
  }
12890
- const majorUnit = axis?.majorUnit;
12893
+ const majorUnit = axis2?.majorUnit;
12891
12894
  if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
12892
12895
  return minor;
12893
12896
  }
@@ -12898,33 +12901,33 @@ function generateMinorAxisTicks(range2, axis) {
12898
12901
  }
12899
12902
 
12900
12903
  // chart/render/chart-view-axes.ts
12901
- function chartAxisRatio(value, scale, axis) {
12902
- const range2 = axis?.range;
12904
+ function chartAxisRatio(value, scale, axis2) {
12905
+ const range2 = axis2?.range;
12903
12906
  const ratio = range2?.logScale ? Math.log(Math.max(value, range2.min) / range2.min) / Math.log(range2.max / range2.min) : (value - scale.min) / (scale.max - scale.min || 1);
12904
12907
  return range2?.reverseOrder ? 1 - ratio : ratio;
12905
12908
  }
12906
- function chartAxisLabels(axis) {
12907
- return axis?.source.deleted !== true && axis?.source.tickLabelPosition !== "none";
12909
+ function chartAxisLabels(axis2) {
12910
+ return axis2?.source.deleted !== true && axis2?.source.tickLabelPosition !== "none";
12908
12911
  }
12909
- function options(axis) {
12912
+ function options(axis2) {
12910
12913
  return {
12911
- ...axis.scaling,
12912
- ...axis.scaling.logBase === void 0 ? {} : { logScale: true },
12913
- ...axis.majorUnit === void 0 ? {} : { majorUnit: axis.majorUnit },
12914
- ...axis.minorUnit === void 0 ? {} : { minorUnit: axis.minorUnit }
12914
+ ...axis2.scaling,
12915
+ ...axis2.scaling.logBase === void 0 ? {} : { logScale: true },
12916
+ ...axis2.majorUnit === void 0 ? {} : { majorUnit: axis2.majorUnit },
12917
+ ...axis2.minorUnit === void 0 ? {} : { minorUnit: axis2.minorUnit }
12915
12918
  };
12916
12919
  }
12917
12920
  function applyChartAxes(model, chart, color2) {
12918
12921
  if (!chart.axes?.length) return;
12919
12922
  const axes = chart.axes;
12920
- const linked = axes.filter((axis) => axis.id !== void 0 && chart.axisIds?.includes(axis.id));
12923
+ const linked = axes.filter((axis2) => axis2.id !== void 0 && chart.axisIds?.includes(axis2.id));
12921
12924
  const candidates = linked.length ? linked : axes;
12922
12925
  const xy = model.type === "scatter" || model.type === "bubble";
12923
- const value = candidates.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates.find((axis) => axis.kind === "val");
12926
+ const value = candidates.find((axis2) => axis2.kind === "val" && !["b", "t"].includes(axis2.position ?? "")) ?? candidates.find((axis2) => axis2.kind === "val");
12924
12927
  const category = candidates.find(
12925
- (axis) => xy ? axis.kind === "val" && axis !== value : axis.kind === "cat" || axis.kind === "date"
12928
+ (axis2) => xy ? axis2.kind === "val" && axis2 !== value : axis2.kind === "cat" || axis2.kind === "date"
12926
12929
  );
12927
- const secondary = axes.find((axis) => axis.kind === "val" && axis !== value && axis !== category);
12930
+ const secondary = axes.find((axis2) => axis2.kind === "val" && axis2 !== value && axis2 !== category);
12928
12931
  const paint2 = (shape) => {
12929
12932
  const ln = shape?.line;
12930
12933
  const fill = ln?.fill;
@@ -12935,8 +12938,8 @@ function applyChartAxes(model, chart, color2) {
12935
12938
  ...ln?.dash === void 0 ? {} : { dash: ln.dash }
12936
12939
  };
12937
12940
  };
12938
- const bind = (axis, scale, values) => {
12939
- const opts = options(axis);
12941
+ const bind = (axis2, scale, values) => {
12942
+ const opts = options(axis2);
12940
12943
  const automatic = opts.logScale ? computeLogValueRange(
12941
12944
  [{ values: values ?? [] }],
12942
12945
  opts.logBase && Number.isFinite(opts.logBase) && opts.logBase > 1 ? opts.logBase : 10
@@ -12954,12 +12957,12 @@ function applyChartAxes(model, chart, color2) {
12954
12957
  scale.ticks = generateAxisTicks(range2, opts, 5);
12955
12958
  }
12956
12959
  return {
12957
- source: axis,
12960
+ source: axis2,
12958
12961
  range: range2,
12959
12962
  minorTicks: generateMinorAxisTicks(range2, opts),
12960
- line: paint2(axis.spPr),
12961
- majorGrid: paint2(axis.majorGridlinesSpPr),
12962
- minorGrid: paint2(axis.minorGridlinesSpPr)
12963
+ line: paint2(axis2.spPr),
12964
+ majorGrid: paint2(axis2.majorGridlinesSpPr),
12965
+ minorGrid: paint2(axis2.minorGridlinesSpPr)
12963
12966
  };
12964
12967
  };
12965
12968
  const out = {};
@@ -14465,12 +14468,12 @@ function readScene3DValues(node, read) {
14465
14468
  ["lightRig", light]
14466
14469
  ]) {
14467
14470
  const rot = read.child(source2, "rot");
14468
- for (const [axis, key] of [
14471
+ for (const [axis2, key] of [
14469
14472
  ["lat", "RotX"],
14470
14473
  ["lon", "RotY"],
14471
14474
  ["rev", "RotZ"]
14472
14475
  ]) {
14473
- const value = integer(read.attribute(rot, axis));
14476
+ const value = integer(read.attribute(rot, axis2));
14474
14477
  if (value !== void 0 && value >= 0 && value < 216e5) out[`${prefix}${key}`] = value;
14475
14478
  }
14476
14479
  }
@@ -14483,12 +14486,12 @@ function readScene3DValues(node, read) {
14483
14486
  ["up", "backdropUp", "d"]
14484
14487
  ]) {
14485
14488
  const point = read.child(backdrop, name2);
14486
- for (const [axis, suffix] of [
14489
+ for (const [axis2, suffix] of [
14487
14490
  ["x", "X"],
14488
14491
  ["y", "Y"],
14489
14492
  ["z", "Z"]
14490
14493
  ]) {
14491
- const value = integer(read.attribute(point, `${attr4}${axis}`));
14494
+ const value = integer(read.attribute(point, `${attr4}${axis2}`));
14492
14495
  if (value !== void 0) out[`${prefix}${suffix}`] = value;
14493
14496
  }
14494
14497
  }
@@ -15145,12 +15148,12 @@ function writeDrawingTextScene3D(doc, value) {
15145
15148
  throw new Error("A backdrop point needs three finite coordinates");
15146
15149
  const point = child2(backdrop, name2);
15147
15150
  const vector = attr4 === "d" ? scaleVectorToIntegers(values[0], values[1], values[2]) : { x: values[0], y: values[1], z: values[2] };
15148
- for (const [axis, suffix] of [
15151
+ for (const [axis2, suffix] of [
15149
15152
  ["x", "X"],
15150
15153
  ["y", "Y"],
15151
15154
  ["z", "Z"]
15152
15155
  ])
15153
- number(point, `${attr4}${axis}`, vector[axis], before[`${prefix}${suffix}`]);
15156
+ number(point, `${attr4}${axis2}`, vector[axis2], before[`${prefix}${suffix}`]);
15154
15157
  }
15155
15158
  }
15156
15159
  return node;
@@ -17980,13 +17983,13 @@ function scatter(model, area, out, size) {
17980
17983
  s2.values.forEach((_, i2) => {
17981
17984
  reach = Math.max(reach, radiusOf(s2.sizes?.[i2] ?? void 0) ?? 0);
17982
17985
  });
17983
- const widen = (s2, length, axis) => {
17984
- if (axis?.range.logScale) return s2;
17986
+ const widen = (s2, length, axis2) => {
17987
+ if (axis2?.range.logScale) return s2;
17985
17988
  const pad5 = reach * (s2.max - s2.min || 1) / Math.max(1, length - 2 * reach);
17986
17989
  return {
17987
17990
  ...s2,
17988
- min: axis?.source.scaling.min === void 0 ? s2.min - pad5 : s2.min,
17989
- max: axis?.source.scaling.max === void 0 ? s2.max + pad5 : s2.max
17991
+ min: axis2?.source.scaling.min === void 0 ? s2.min - pad5 : s2.min,
17992
+ max: axis2?.source.scaling.max === void 0 ? s2.max + pad5 : s2.max
17990
17993
  };
17991
17994
  };
17992
17995
  const xView = widen(xs, plot.w, model.axes?.category);
@@ -19123,124 +19126,124 @@ function editChartGradientFill(old, edit, defaultColor, toColor = identity) {
19123
19126
 
19124
19127
  // chart/edit/axes.ts
19125
19128
  function chartAxisAt(space3, target) {
19126
- const axis = space3.plotArea.axes.find(
19129
+ const axis2 = space3.plotArea.axes.find(
19127
19130
  (item2, position) => typeof target === "string" ? item2.kind === target : "index" in target ? position === target.index : item2.id === target.id
19128
19131
  );
19129
- if (!axis) throw new RangeError(`No chart axis ${JSON.stringify(target)}`);
19130
- return axis;
19132
+ if (!axis2) throw new RangeError(`No chart axis ${JSON.stringify(target)}`);
19133
+ return axis2;
19131
19134
  }
19132
- function setNumber(axis, key, value) {
19135
+ function setNumber(axis2, key, value) {
19133
19136
  if (value === void 0) return;
19134
19137
  if (value !== null && !(Number.isFinite(value) && value > 0))
19135
19138
  throw new RangeError(`Chart axis ${key} must be a positive number`);
19136
- assignOrDelete(axis, key, value ?? void 0);
19139
+ assignOrDelete(axis2, key, value ?? void 0);
19137
19140
  }
19138
- function applyAxis(axis, edit) {
19139
- if (edit.position !== void 0) assignOrDelete(axis, "position", edit.position ?? void 0);
19141
+ function applyAxis(axis2, edit) {
19142
+ if (edit.position !== void 0) assignOrDelete(axis2, "position", edit.position ?? void 0);
19140
19143
  if (edit.crossBetween !== void 0)
19141
- assignOrDelete(axis, "crossBetween", edit.crossBetween ?? void 0);
19142
- if (edit.crossAxisId !== void 0) axis.crossAxisId = edit.crossAxisId;
19143
- if (edit.visible !== void 0) axis.deleted = !edit.visible;
19144
+ assignOrDelete(axis2, "crossBetween", edit.crossBetween ?? void 0);
19145
+ if (edit.crossAxisId !== void 0) axis2.crossAxisId = edit.crossAxisId;
19146
+ if (edit.visible !== void 0) axis2.deleted = !edit.visible;
19144
19147
  if (edit.title !== void 0)
19145
19148
  assignOrDelete(
19146
- axis,
19149
+ axis2,
19147
19150
  "title",
19148
- edit.title ? chartTitleWithText(axis.title, edit.title) : void 0
19151
+ edit.title ? chartTitleWithText(axis2.title, edit.title) : void 0
19149
19152
  );
19150
19153
  for (const key of ["min", "max"]) {
19151
19154
  const value = edit[key];
19152
19155
  if (value === void 0) continue;
19153
19156
  if (value !== null && !Number.isFinite(value))
19154
19157
  throw new RangeError(`Chart axis ${key} must be a finite number`);
19155
- assignOrDelete(axis.scaling, key, value ?? void 0);
19158
+ assignOrDelete(axis2.scaling, key, value ?? void 0);
19156
19159
  }
19157
- const { min, max } = axis.scaling;
19160
+ const { min, max } = axis2.scaling;
19158
19161
  if (min !== void 0 && max !== void 0 && min >= max)
19159
19162
  throw new RangeError("Chart axis minimum must be less than its maximum");
19160
- setNumber(axis, "majorUnit", edit.majorUnit);
19161
- setNumber(axis, "minorUnit", edit.minorUnit);
19163
+ setNumber(axis2, "majorUnit", edit.majorUnit);
19164
+ setNumber(axis2, "minorUnit", edit.minorUnit);
19162
19165
  if (edit.majorTimeUnit !== void 0)
19163
- assignOrDelete(axis, "majorTimeUnit", edit.majorTimeUnit ?? void 0);
19166
+ assignOrDelete(axis2, "majorTimeUnit", edit.majorTimeUnit ?? void 0);
19164
19167
  if (edit.minorTimeUnit !== void 0)
19165
- assignOrDelete(axis, "minorTimeUnit", edit.minorTimeUnit ?? void 0);
19168
+ assignOrDelete(axis2, "minorTimeUnit", edit.minorTimeUnit ?? void 0);
19166
19169
  if (edit.baseTimeUnit !== void 0)
19167
- assignOrDelete(axis, "baseTimeUnit", edit.baseTimeUnit ?? void 0);
19170
+ assignOrDelete(axis2, "baseTimeUnit", edit.baseTimeUnit ?? void 0);
19168
19171
  if (edit.logBase !== void 0) {
19169
19172
  if (edit.logBase !== null && !(edit.logBase >= 2 && edit.logBase <= 1e3))
19170
19173
  throw new RangeError("Chart axis log base must be from 2 to 1000");
19171
- assignOrDelete(axis.scaling, "logBase", edit.logBase ?? void 0);
19174
+ assignOrDelete(axis2.scaling, "logBase", edit.logBase ?? void 0);
19172
19175
  }
19173
- if (edit.reverse !== void 0) axis.scaling.orientation = edit.reverse ? "maxMin" : "minMax";
19176
+ if (edit.reverse !== void 0) axis2.scaling.orientation = edit.reverse ? "maxMin" : "minMax";
19174
19177
  if (edit.numberFormat !== void 0)
19175
19178
  assignOrDelete(
19176
- axis,
19179
+ axis2,
19177
19180
  "numberFormat",
19178
19181
  edit.numberFormat ? { formatCode: edit.numberFormat, sourceLinked: edit.numberFormatSourceLinked ?? false } : void 0
19179
19182
  );
19180
- else if (edit.numberFormatSourceLinked !== void 0 && axis.numberFormat)
19181
- axis.numberFormat.sourceLinked = edit.numberFormatSourceLinked;
19183
+ else if (edit.numberFormatSourceLinked !== void 0 && axis2.numberFormat)
19184
+ axis2.numberFormat.sourceLinked = edit.numberFormatSourceLinked;
19182
19185
  for (const key of ["auto", "noMultiLevelLabels"])
19183
- if (edit[key] !== void 0) axis[key] = edit[key];
19186
+ if (edit[key] !== void 0) axis2[key] = edit[key];
19184
19187
  if (edit.labelAlign !== void 0)
19185
- assignOrDelete(axis, "labelAlign", edit.labelAlign ?? void 0);
19188
+ assignOrDelete(axis2, "labelAlign", edit.labelAlign ?? void 0);
19186
19189
  for (const key of ["labelOffset", "tickLabelSkip", "tickMarkSkip"]) {
19187
19190
  const value = edit[key];
19188
19191
  if (value === void 0) continue;
19189
19192
  if (value !== null && (!Number.isInteger(value) || value < (key === "labelOffset" ? 0 : 1) || value > (key === "labelOffset" ? 1e3 : 2147483647)))
19190
19193
  throw new RangeError(`Invalid chart axis ${key}`);
19191
- assignOrDelete(axis, key, value ?? void 0);
19194
+ assignOrDelete(axis2, key, value ?? void 0);
19192
19195
  }
19193
- if (edit.majorTickMark !== void 0) axis.majorTickMark = edit.majorTickMark;
19194
- if (edit.minorTickMark !== void 0) axis.minorTickMark = edit.minorTickMark;
19195
- if (edit.tickLabelPosition !== void 0) axis.tickLabelPosition = edit.tickLabelPosition;
19196
+ if (edit.majorTickMark !== void 0) axis2.majorTickMark = edit.majorTickMark;
19197
+ if (edit.minorTickMark !== void 0) axis2.minorTickMark = edit.minorTickMark;
19198
+ if (edit.tickLabelPosition !== void 0) axis2.tickLabelPosition = edit.tickLabelPosition;
19196
19199
  if (edit.crosses !== void 0) {
19197
19200
  if (typeof edit.crosses === "number") {
19198
- delete axis.crosses;
19199
- axis.crossesAt = edit.crosses;
19201
+ delete axis2.crosses;
19202
+ axis2.crossesAt = edit.crosses;
19200
19203
  } else {
19201
- delete axis.crossesAt;
19202
- axis.crosses = edit.crosses;
19204
+ delete axis2.crossesAt;
19205
+ axis2.crosses = edit.crosses;
19203
19206
  }
19204
19207
  }
19205
19208
  if (edit.majorGridlines !== void 0) {
19206
- axis.majorGridlines = edit.majorGridlines;
19207
- if (!edit.majorGridlines) delete axis.majorGridlinesSpPr;
19209
+ axis2.majorGridlines = edit.majorGridlines;
19210
+ if (!edit.majorGridlines) delete axis2.majorGridlinesSpPr;
19208
19211
  }
19209
19212
  if (edit.minorGridlines !== void 0) {
19210
- axis.minorGridlines = edit.minorGridlines;
19211
- if (!edit.minorGridlines) delete axis.minorGridlinesSpPr;
19213
+ axis2.minorGridlines = edit.minorGridlines;
19214
+ if (!edit.minorGridlines) delete axis2.minorGridlinesSpPr;
19212
19215
  }
19213
19216
  if (edit.displayUnits !== void 0) {
19214
- if (axis.kind !== "val") throw new RangeError("Only a value axis has display units");
19217
+ if (axis2.kind !== "val") throw new RangeError("Only a value axis has display units");
19215
19218
  const units2 = edit.displayUnits;
19216
19219
  if (typeof units2 === "number" && (!Number.isFinite(units2) || units2 <= 0))
19217
19220
  throw new RangeError("Custom chart display units must be a positive finite number");
19218
- const { builtInUnit: _builtIn, customUnit: _custom, ...kept } = axis.displayUnits ?? {};
19221
+ const { builtInUnit: _builtIn, customUnit: _custom, ...kept } = axis2.displayUnits ?? {};
19219
19222
  assignOrDelete(
19220
- axis,
19223
+ axis2,
19221
19224
  "displayUnits",
19222
19225
  units2 === null ? void 0 : typeof units2 === "number" ? { ...kept, customUnit: units2 } : { ...kept, builtInUnit: units2 }
19223
19226
  );
19224
19227
  }
19225
19228
  }
19226
19229
  function setChartAxis(space3, target, edit) {
19227
- if (edit.crossAxisId !== void 0 && !space3.plotArea.axes.some((axis) => axis.id === edit.crossAxisId))
19230
+ if (edit.crossAxisId !== void 0 && !space3.plotArea.axes.some((axis2) => axis2.id === edit.crossAxisId))
19228
19231
  throw new RangeError("The crossing axis does not exist");
19229
19232
  return editChartSpace(space3, (draft) => applyAxis(chartAxisAt(draft, target), edit));
19230
19233
  }
19231
19234
  function setChartGridlineShape(space3, target, which, shape) {
19232
19235
  return editChartSpace(space3, (draft) => {
19233
- const axis = chartAxisAt(draft, target);
19236
+ const axis2 = chartAxisAt(draft, target);
19234
19237
  const key = which === "major" ? "majorGridlinesSpPr" : "minorGridlinesSpPr";
19235
19238
  if (shape === null) {
19236
- delete axis[key];
19239
+ delete axis2[key];
19237
19240
  return;
19238
19241
  }
19239
- const next = { ...axis[key] };
19242
+ const next = { ...axis2[key] };
19240
19243
  if (shape.line !== void 0) next.line = structuredClone(shape.line);
19241
19244
  if (shape.fill !== void 0) next.fill = structuredClone(shape.fill);
19242
- axis[key] = next;
19243
- axis[which === "major" ? "majorGridlines" : "minorGridlines"] = true;
19245
+ axis2[key] = next;
19246
+ axis2[which === "major" ? "majorGridlines" : "minorGridlines"] = true;
19244
19247
  });
19245
19248
  }
19246
19249
 
@@ -19448,10 +19451,10 @@ function chartTargetDraftShapes(draft, target) {
19448
19451
  return [chartAxisAt(draft, { index: target.axisIndex }).spPr ??= {}];
19449
19452
  case "majorGridlines":
19450
19453
  case "minorGridlines": {
19451
- const axis = chartAxisAt(draft, { index: target.axisIndex });
19454
+ const axis2 = chartAxisAt(draft, { index: target.axisIndex });
19452
19455
  const major = target.kind === "majorGridlines";
19453
- axis[major ? "majorGridlines" : "minorGridlines"] = true;
19454
- return [axis[major ? "majorGridlinesSpPr" : "minorGridlinesSpPr"] ??= {}];
19456
+ axis2[major ? "majorGridlines" : "minorGridlines"] = true;
19457
+ return [axis2[major ? "majorGridlinesSpPr" : "minorGridlinesSpPr"] ??= {}];
19455
19458
  }
19456
19459
  case "dataLabels": {
19457
19460
  if (target.seriesIndex === void 0) {
@@ -20781,9 +20784,9 @@ var CATEGORY_ONLY = [
20781
20784
  "minorTimeUnit"
20782
20785
  ];
20783
20786
  var VALUE_ONLY = ["crossBetween", "displayUnits"];
20784
- function convertChartAxis(axis, kind) {
20785
- if (axis.kind === kind) return axis;
20786
- const next = structuredClone(axis);
20787
+ function convertChartAxis(axis2, kind) {
20788
+ if (axis2.kind === kind) return axis2;
20789
+ const next = structuredClone(axis2);
20787
20790
  next.kind = kind;
20788
20791
  if (kind === "val") {
20789
20792
  for (const key of CATEGORY_ONLY) delete next[key];
@@ -20816,7 +20819,7 @@ var SWITCHABLE = {
20816
20819
  stock: false,
20817
20820
  surface: true
20818
20821
  };
20819
- function elementFor(kind, is3D) {
20822
+ function chartGroupElement(kind, is3D) {
20820
20823
  const match = Object.entries(CHART_GROUP_ELEMENTS).find(
20821
20824
  ([, value]) => value.kind === kind && value.is3D === is3D
20822
20825
  );
@@ -20832,7 +20835,7 @@ function groupingFor(element4, grouping) {
20832
20835
  var horizontalBars = (group2) => group2.kind === "bar" && group2.barDirection === "bar";
20833
20836
  function newGroup(base, target, series2) {
20834
20837
  const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
20835
- const element4 = elementFor(target.kind, is3D);
20838
+ const element4 = chartGroupElement(target.kind, is3D);
20836
20839
  const group2 = { kind: target.kind, element: element4, is3D, series: series2, axisIds: [] };
20837
20840
  const allowed = GROUP_FIELDS[element4] ?? [];
20838
20841
  for (const key of allowed)
@@ -20858,11 +20861,11 @@ function newGroup(base, target, series2) {
20858
20861
  return group2;
20859
20862
  }
20860
20863
  function withSeriesAxis(space3, group2, axes) {
20861
- if ((group2.element === "line3DChart" || group2.kind === "surface") && !axes.some((axis) => axis.kind === "ser")) {
20864
+ if ((group2.element === "line3DChart" || group2.kind === "surface") && !axes.some((axis2) => axis2.kind === "ser")) {
20862
20865
  const id = Math.max(
20863
20866
  0,
20864
20867
  ...[...space3.plotArea.axes, ...axes].flatMap(
20865
- (axis) => axis.id === void 0 ? [] : [axis.id]
20868
+ (axis2) => axis2.id === void 0 ? [] : [axis2.id]
20866
20869
  )
20867
20870
  ) + 1;
20868
20871
  axes.push({
@@ -20882,11 +20885,11 @@ function withSeriesAxis(space3, group2, axes) {
20882
20885
  function groupAxes(space3, base, group2) {
20883
20886
  if (!groupHasAxes(group2.element)) return [];
20884
20887
  const xy = isXYChartKind(group2.kind);
20885
- const byId = (id) => space3.plotArea.axes.find((axis) => axis.id === id);
20886
- const old = base.axisIds.map(byId).filter((axis) => axis !== void 0);
20888
+ const byId = (id) => space3.plotArea.axes.find((axis2) => axis2.id === id);
20889
+ const old = base.axisIds.map(byId).filter((axis2) => axis2 !== void 0);
20887
20890
  if (old.length < 2) {
20888
20891
  const taken = new Set(
20889
- space3.plotArea.axes.flatMap((axis) => axis.id === void 0 ? [] : [axis.id])
20892
+ space3.plotArea.axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id])
20890
20893
  );
20891
20894
  const free = DEFAULT_CHART_AXIS_IDS.every((id) => !taken.has(id));
20892
20895
  const top = Math.max(0, ...taken);
@@ -20894,9 +20897,9 @@ function groupAxes(space3, base, group2) {
20894
20897
  return withSeriesAxis(space3, group2, defaultChartAxes(horizontalBars(group2), xy, ids));
20895
20898
  }
20896
20899
  const rotate = horizontalBars(base) !== horizontalBars(group2);
20897
- const axes = old.slice(0, group2.element === "line3DChart" || group2.is3D ? 3 : 2).map((axis, i2) => {
20898
- const kind = i2 === 0 ? xy ? "val" : axis.kind === "val" ? "cat" : axis.kind : axis.kind;
20899
- const next = convertChartAxis(axis, kind);
20900
+ const axes = old.slice(0, group2.element === "line3DChart" || group2.is3D ? 3 : 2).map((axis2, i2) => {
20901
+ const kind = i2 === 0 ? xy ? "val" : axis2.kind === "val" ? "cat" : axis2.kind : axis2.kind;
20902
+ const next = convertChartAxis(axis2, kind);
20900
20903
  if (rotate) assignOrDelete(next, "position", rotatedAxisPosition(next.position));
20901
20904
  if (i2 === 1 && next.kind === "val" && xy !== isXYChartKind(base.kind))
20902
20905
  next.crossBetween = xy ? "midCat" : "between";
@@ -20921,7 +20924,7 @@ function setChartType(space3, target) {
20921
20924
  if (group2.is3D && target.kind === "bar" && group2.grouping === "standard" && base.axisIds.length < 3)
20922
20925
  group2.grouping = "clustered";
20923
20926
  const axes = groupAxes(draft, base, group2);
20924
- group2.axisIds = axes.flatMap((axis) => axis.id === void 0 ? [] : [axis.id]);
20927
+ group2.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
20925
20928
  draft.plotArea.groups = [group2];
20926
20929
  draft.plotArea.axes = axes;
20927
20930
  if (!group2.is3D) {
@@ -21057,15 +21060,15 @@ function chartSupportsQuickLayout(space3) {
21057
21060
  return !!group2 && CHART_QUICK_LAYOUT_KINDS.has(group2.kind);
21058
21061
  }
21059
21062
  function applyAxes(draft, layout) {
21060
- for (const axis of draft.plotArea.axes) {
21061
- const value = axis.kind === "val";
21062
- if (!value && axis.kind !== "cat" && axis.kind !== "date") continue;
21063
+ for (const axis2 of draft.plotArea.axes) {
21064
+ const value = axis2.kind === "val";
21065
+ if (!value && axis2.kind !== "cat" && axis2.kind !== "date") continue;
21063
21066
  const titled = value ? layout.valAxisTitle : layout.catAxisTitle;
21064
- if (!titled) delete axis.title;
21065
- else axis.title ??= newChartTitle(CHART_QUICK_LAYOUT_AXIS_TITLE);
21066
- axis.majorGridlines = value && layout.majorGridlines;
21067
- axis.minorGridlines = value && layout.minorGridlines;
21068
- axis.deleted = value ? !layout.valueAxis : false;
21067
+ if (!titled) delete axis2.title;
21068
+ else axis2.title ??= newChartTitle(CHART_QUICK_LAYOUT_AXIS_TITLE);
21069
+ axis2.majorGridlines = value && layout.majorGridlines;
21070
+ axis2.minorGridlines = value && layout.minorGridlines;
21071
+ axis2.deleted = value ? !layout.valueAxis : false;
21069
21072
  }
21070
21073
  }
21071
21074
  function applyDataTable(draft, layout) {
@@ -21116,8 +21119,8 @@ function applyChartQuickLayout(space3, n3, only = ALL_PARTS) {
21116
21119
  }
21117
21120
  function matches(space3, layout) {
21118
21121
  const axes = space3.plotArea.axes;
21119
- const val2 = axes.find((axis) => axis.kind === "val");
21120
- const cat = axes.find((axis) => axis.kind === "cat" || axis.kind === "date");
21122
+ const val2 = axes.find((axis2) => axis2.kind === "val");
21123
+ const cat = axes.find((axis2) => axis2.kind === "cat" || axis2.kind === "date");
21121
21124
  const bar = space3.plotArea.groups.find((group2) => group2.kind === "bar");
21122
21125
  const labels2 = space3.plotArea.groups.some(
21123
21126
  (group2) => group2.dataLabels && group2.dataLabels.deleted !== true && group2.dataLabels.showValue
@@ -21175,6 +21178,12 @@ var RANGES = {
21175
21178
  firstSliceAngle: [0, 360],
21176
21179
  holeSize: [1, 90]
21177
21180
  };
21181
+ var isChartGroupOption = (key) => Object.hasOwn(RANGES, key);
21182
+ function assertChartGroupOption(key, value) {
21183
+ const [min, max] = RANGES[key];
21184
+ if (!Number.isInteger(value) || value < min || value > max)
21185
+ throw new RangeError(`Chart ${key} must be a whole number from ${min} to ${max}`);
21186
+ }
21178
21187
  function setChartGroupOptions(space3, seriesIndex, edit) {
21179
21188
  return editChartSpace(space3, (draft) => {
21180
21189
  const { group: group2 } = chartSeriesEntryAt(draft, seriesIndex);
@@ -21187,9 +21196,7 @@ function setChartGroupOptions(space3, seriesIndex, edit) {
21187
21196
  delete group2[key];
21188
21197
  continue;
21189
21198
  }
21190
- const [min, max] = RANGES[key];
21191
- if (!Number.isInteger(value) || value < min || value > max)
21192
- throw new RangeError(`Chart ${key} must be a whole number from ${min} to ${max}`);
21199
+ assertChartGroupOption(key, value);
21193
21200
  group2[key] = value;
21194
21201
  }
21195
21202
  });
@@ -21522,9 +21529,9 @@ function setChartView3D(space3, edit) {
21522
21529
 
21523
21530
  // chart/edit/secondary-axis.ts
21524
21531
  function axisPair(space3, group2) {
21525
- if (group2.axisIds.length !== 2 || new Set(space3.plotArea.axes.map((axis) => axis.id)).size !== space3.plotArea.axes.length)
21532
+ if (group2.axisIds.length !== 2 || new Set(space3.plotArea.axes.map((axis2) => axis2.id)).size !== space3.plotArea.axes.length)
21526
21533
  return void 0;
21527
- const [x, y] = group2.axisIds.map((id) => space3.plotArea.axes.find((axis) => axis.id === id));
21534
+ const [x, y] = group2.axisIds.map((id) => space3.plotArea.axes.find((axis2) => axis2.id === id));
21528
21535
  return x && y && ["cat", "date"].includes(x.kind) && y.kind === "val" && x.crossAxisId === y.id && y.crossAxisId === x.id ? [x, y] : void 0;
21529
21536
  }
21530
21537
  function chartSeriesSecondaryAxisSupported(space3, seriesIndex) {
@@ -21553,7 +21560,7 @@ function isolateSeries(space3, index) {
21553
21560
  space3.plotArea.groups.splice(groupIndex, 1, ...segments);
21554
21561
  return chartSeriesEntryAt(space3, index).group;
21555
21562
  }
21556
- function setChartSeriesSecondaryAxis(space3, seriesIndex, secondary) {
21563
+ function setChartSeriesSecondaryAxis(space3, seriesIndex, secondary, options2 = {}) {
21557
21564
  if (!chartSeriesSecondaryAxisSupported(space3, seriesIndex))
21558
21565
  throw new RangeError(
21559
21566
  "Secondary-axis editing needs a later series in a supported vertical 2D chart"
@@ -21567,12 +21574,12 @@ function setChartSeriesSecondaryAxis(space3, seriesIndex, secondary) {
21567
21574
  return;
21568
21575
  }
21569
21576
  if (group2.axisIds[1] !== primary.axisIds[1]) return;
21570
- const existing = draft.plotArea.axes.filter((axis) => axis.kind === "cat" || axis.kind === "date").map((axis) => axisPair(draft, { ...primary, axisIds: [axis.id, axis.crossAxisId] })).find((pair) => pair && pair[1].id !== primary.axisIds[1]);
21577
+ const existing = draft.plotArea.axes.filter((axis2) => axis2.kind === "cat" || axis2.kind === "date").map((axis2) => axisPair(draft, { ...primary, axisIds: [axis2.id, axis2.crossAxisId] })).find((pair) => pair && pair[1].id !== primary.axisIds[1]);
21571
21578
  if (existing) {
21572
- group2.axisIds = existing.map((axis) => axis.id);
21579
+ group2.axisIds = existing.map((axis2) => axis2.id);
21573
21580
  return;
21574
21581
  }
21575
- const used = new Set(draft.plotArea.axes.map((axis) => axis.id));
21582
+ const used = new Set(draft.plotArea.axes.map((axis2) => axis2.id));
21576
21583
  const allocate = () => {
21577
21584
  let id = 500000003;
21578
21585
  while (used.has(id)) id++;
@@ -21580,7 +21587,9 @@ function setChartSeriesSecondaryAxis(space3, seriesIndex, secondary) {
21580
21587
  used.add(id);
21581
21588
  return id;
21582
21589
  };
21583
- const ids = [allocate(), allocate()];
21590
+ const ids = options2.axisIds ? [...options2.axisIds] : [allocate(), allocate()];
21591
+ if (options2.axisIds && (ids[0] === ids[1] || ids.some((id) => used.has(id) || !Number.isSafeInteger(id) || id < 0 || id > 4294967295)))
21592
+ throw new RangeError("Secondary axis ids must be two unused whole numbers");
21584
21593
  const horizontal = primary.barDirection === "bar";
21585
21594
  const axes = defaultChartAxes(horizontal, false, ids);
21586
21595
  axes[0] = { ...structuredClone(axisPair(draft, primary)[0]), id: ids[0], crossAxisId: ids[1] };
@@ -21726,6 +21735,58 @@ function applyChartSpaceDataSheetEdits(space3, edits) {
21726
21735
  return editChartSpace(next, (draft) => applyStandardChartLayout(draft, layoutSheet, count));
21727
21736
  }
21728
21737
 
21738
+ // chart/edit/new-chart-minimal.ts
21739
+ var VARIED = /* @__PURE__ */ new Set(["pie", "doughnut", "ofPie"]);
21740
+ function schemaGrouping(element4, grouping) {
21741
+ const bar = element4 === "barChart" || element4 === "bar3DChart";
21742
+ if (bar) return grouping ?? "clustered";
21743
+ return grouping === void 0 || grouping === "clustered" ? "standard" : grouping;
21744
+ }
21745
+ function minimalChartGroup(target, series2) {
21746
+ const is3D = target.is3D ?? false;
21747
+ const element4 = chartGroupElement(target.kind, is3D);
21748
+ const allowed = GROUP_FIELDS[element4] ?? [];
21749
+ const own = isXYChartKind(target.kind) ? series2.map((item2) => stripSeriesForKind(item2, "bar", target.kind)) : series2;
21750
+ const group2 = { kind: target.kind, element: element4, is3D, series: own, axisIds: [] };
21751
+ if (target.kind === "bar") group2.barDirection = target.barDirection ?? "col";
21752
+ if (allowed.includes("grouping")) group2.grouping = schemaGrouping(element4, target.grouping);
21753
+ if (allowed.includes("varyColors")) group2.varyColors = VARIED.has(target.kind);
21754
+ if (target.kind === "ofPie") group2.ofPieType = "pie";
21755
+ if (target.kind === "scatter") group2.scatterStyle = "lineMarker";
21756
+ if (target.kind === "radar") group2.radarStyle = "marker";
21757
+ return group2;
21758
+ }
21759
+ function axis(kind, id, crossAxisId, position) {
21760
+ return {
21761
+ kind,
21762
+ id,
21763
+ crossAxisId,
21764
+ position,
21765
+ scaling: { orientation: "minMax" },
21766
+ deleted: false,
21767
+ majorGridlines: false,
21768
+ minorGridlines: false
21769
+ };
21770
+ }
21771
+ function minimalChartAxes(group2, ids) {
21772
+ if (!groupHasAxes(group2.element)) return [];
21773
+ const [first2, second, third] = ids;
21774
+ const horizontal = group2.kind === "bar" && group2.barDirection === "bar";
21775
+ const axes = [
21776
+ axis(isXYChartKind(group2.kind) ? "val" : "cat", first2, second, horizontal ? "l" : "b"),
21777
+ axis("val", second, first2, horizontal ? "b" : "l")
21778
+ ];
21779
+ if (group2.element === "line3DChart" || group2.kind === "surface")
21780
+ axes.push(axis("ser", third, second, "b"));
21781
+ return axes;
21782
+ }
21783
+ function minimalChartTitle(text3) {
21784
+ const rich = chartTextBodyFromXml(
21785
+ `<a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${escapeText(text3)}</a:t></a:r></a:p>`
21786
+ );
21787
+ return { tx: { rich, text: rich.text }, text: rich.text, overlay: false };
21788
+ }
21789
+
21729
21790
  // chart/edit/new-chart.ts
21730
21791
  var DEFAULT_CHART_DATA_SHEET = {
21731
21792
  categories: ["Category 1", "Category 2", "Category 3", "Category 4"],
@@ -21735,21 +21796,84 @@ var DEFAULT_CHART_DATA_SHEET = {
21735
21796
  { name: "Series 3", values: [2, 2, 3, 5] }
21736
21797
  ]
21737
21798
  };
21738
- function series(sheet, index, sheetName) {
21799
+ var CATEGORY_ONLY2 = [
21800
+ "labelAlign",
21801
+ "noMultiLevelLabels",
21802
+ "tickLabelSkip",
21803
+ "tickMarkSkip"
21804
+ ];
21805
+ function withDateAxis(space3) {
21806
+ return editChartSpace(space3, (draft) => {
21807
+ const axis2 = draft.plotArea.axes[0];
21808
+ if (axis2?.kind !== "cat") return;
21809
+ axis2.kind = "date";
21810
+ for (const key of CATEGORY_ONLY2) delete axis2[key];
21811
+ });
21812
+ }
21813
+ function series(sheet, index, options2, sheetName) {
21739
21814
  const entry3 = sheet.series[index];
21815
+ if (options2.data === "literal")
21816
+ return {
21817
+ index,
21818
+ order: index,
21819
+ tx: { value: entry3.name, text: entry3.name },
21820
+ ...options2.profile === "minimal" ? {} : { invertIfNegative: false },
21821
+ dataPoints: [],
21822
+ categories: categorySource(sheet.categories, void 0),
21823
+ values: numberSource(entry3.values, void 0)
21824
+ };
21740
21825
  const formulas = standardChartFormulas(sheetName, index, sheet.categories.length);
21741
21826
  return {
21742
21827
  index,
21743
21828
  order: index,
21744
21829
  tx: { reference: categorySource([entry3.name], void 0, formulas.name), text: entry3.name },
21745
- invertIfNegative: false,
21830
+ ...options2.profile === "minimal" ? {} : { invertIfNegative: false },
21746
21831
  dataPoints: [],
21747
21832
  categories: categorySource(sheet.categories, void 0, formulas.categories),
21748
21833
  values: numberSource(entry3.values, void 0, formulas.values)
21749
21834
  };
21750
21835
  }
21751
- function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {}) {
21752
- const sheetName = options2.sheetName ?? DEFAULT_CHART_SHEET_NAME;
21836
+ function axisIds(options2) {
21837
+ const ids = options2.axisIds ?? [];
21838
+ const [first2, second, third] = [
21839
+ ids[0] ?? DEFAULT_CHART_AXIS_IDS[0],
21840
+ ids[1] ?? DEFAULT_CHART_AXIS_IDS[1],
21841
+ ids[2] ?? DEFAULT_CHART_AXIS_IDS[1] + 1
21842
+ ];
21843
+ for (const id of [first2, second, third])
21844
+ if (!Number.isSafeInteger(id) || id < 0)
21845
+ throw new RangeError("Chart axis ids must be non-negative whole numbers");
21846
+ if ((/* @__PURE__ */ new Set([first2, second, third])).size !== 3)
21847
+ throw new RangeError("Chart axis ids must differ");
21848
+ return [first2, second, third];
21849
+ }
21850
+ function withAxisIds(space3, ids) {
21851
+ return editChartSpace(space3, (draft) => {
21852
+ const map = /* @__PURE__ */ new Map();
21853
+ draft.plotArea.axes.forEach((axis2, position) => {
21854
+ if (axis2.id !== void 0 && ids[position] !== void 0) map.set(axis2.id, ids[position]);
21855
+ });
21856
+ const renumber = (id) => map.get(id) ?? id;
21857
+ for (const axis2 of draft.plotArea.axes) {
21858
+ if (axis2.id !== void 0) axis2.id = renumber(axis2.id);
21859
+ if (axis2.crossAxisId !== void 0) axis2.crossAxisId = renumber(axis2.crossAxisId);
21860
+ }
21861
+ for (const group2 of draft.plotArea.groups) group2.axisIds = group2.axisIds.map(renumber);
21862
+ });
21863
+ }
21864
+ function withGroupSettings(space3, settings) {
21865
+ return editChartSpace(space3, (draft) => {
21866
+ const group2 = draft.plotArea.groups[0];
21867
+ const allowed = GROUP_FIELDS[group2.element] ?? [];
21868
+ for (const [key, value] of Object.entries(settings)) {
21869
+ if (value === void 0) continue;
21870
+ if (!allowed.includes(key)) throw new RangeError(`A ${group2.element} has no ${key} setting`);
21871
+ if (isChartGroupOption(key)) assertChartGroupOption(key, value);
21872
+ Object.assign(group2, { [key]: structuredClone(value) });
21873
+ }
21874
+ });
21875
+ }
21876
+ function officeChartSpace(sheet, target, options2, sheetName) {
21753
21877
  const group2 = {
21754
21878
  kind: "bar",
21755
21879
  element: "barChart",
@@ -21759,10 +21883,10 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
21759
21883
  varyColors: false,
21760
21884
  gapWidth: 219,
21761
21885
  overlap: -27,
21762
- series: sheet.series.map((_, index) => series(sheet, index, sheetName)),
21886
+ series: sheet.series.map((_, index) => series(sheet, index, options2, sheetName)),
21763
21887
  axisIds: [...DEFAULT_CHART_AXIS_IDS]
21764
21888
  };
21765
- let space3 = {
21889
+ const space3 = {
21766
21890
  roundedCorners: false,
21767
21891
  autoTitleDeleted: options2.title === void 0,
21768
21892
  plotArea: { layout: {}, groups: [group2], axes: defaultChartAxes(false, false) },
@@ -21771,9 +21895,36 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
21771
21895
  };
21772
21896
  const column = !target || target.kind === "bar" && (target.barDirection ?? "col") === "col";
21773
21897
  if (target && !(column && !target.is3D && (target.grouping ?? "clustered") === "clustered"))
21774
- space3 = setChartType(space3, target);
21775
- if (options2.title !== void 0) space3 = setChartTitle(space3, options2.title);
21776
- return setChartLegend(space3, { position: "b" });
21898
+ return setChartType(space3, target);
21899
+ return space3;
21900
+ }
21901
+ function minimalChartSpace(sheet, target, options2, sheetName) {
21902
+ const group2 = minimalChartGroup(
21903
+ target ?? { kind: "bar" },
21904
+ sheet.series.map((_, index) => series(sheet, index, options2, sheetName))
21905
+ );
21906
+ if (group2.kind === "stock" && ![3, 4].includes(group2.series.length))
21907
+ throw new RangeError("A stock chart requires three or four price series");
21908
+ const axes = minimalChartAxes(group2, axisIds(options2));
21909
+ group2.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
21910
+ return {
21911
+ autoTitleDeleted: options2.title === void 0,
21912
+ plotArea: { layout: {}, groups: [group2], axes },
21913
+ plotVisibleOnly: true,
21914
+ displayBlanksAs: "gap"
21915
+ };
21916
+ }
21917
+ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {}) {
21918
+ const sheetName = options2.sheetName ?? DEFAULT_CHART_SHEET_NAME;
21919
+ let space3 = options2.profile === "minimal" ? minimalChartSpace(sheet, target, options2, sheetName) : officeChartSpace(sheet, target, options2, sheetName);
21920
+ if (options2.profile !== "minimal" && options2.axisIds !== void 0)
21921
+ space3 = withAxisIds(space3, axisIds(options2));
21922
+ if (options2.dateAxis) space3 = withDateAxis(space3);
21923
+ if (options2.group) space3 = withGroupSettings(space3, options2.group);
21924
+ if (options2.title !== void 0)
21925
+ space3 = options2.profile === "minimal" ? { ...space3, title: minimalChartTitle(options2.title), autoTitleDeleted: false } : setChartTitle(space3, options2.title);
21926
+ const legend = options2.legendPosition === void 0 ? "b" : options2.legendPosition;
21927
+ return legend === null ? space3 : setChartLegend(space3, { position: legend });
21777
21928
  }
21778
21929
 
21779
21930
  // chart/edit/apply-appearance.ts
@@ -21901,21 +22052,21 @@ function chartExStyleSpace(space3) {
21901
22052
  } : {},
21902
22053
  plotArea: {
21903
22054
  ...styles(space3.plotArea),
21904
- axes: space3.plotArea.axes.map((axis) => ({
21905
- kind: axis.scaling?.kind ?? "val",
22055
+ axes: space3.plotArea.axes.map((axis2) => ({
22056
+ kind: axis2.scaling?.kind ?? "val",
21906
22057
  scaling: {},
21907
- ...styles(axis),
21908
- ...axis.title ? {
22058
+ ...styles(axis2),
22059
+ ...axis2.title ? {
21909
22060
  title: {
21910
- ...styles(axis.title),
21911
- ...axis.title.tx?.rich ? { tx: { rich: axis.title.tx.rich, text: axis.title.tx.rich.text } } : {}
22061
+ ...styles(axis2.title),
22062
+ ...axis2.title.tx?.rich ? { tx: { rich: axis2.title.tx.rich, text: axis2.title.tx.rich.text } } : {}
21912
22063
  }
21913
22064
  } : {},
21914
- ...axis.id === void 0 ? {} : { id: axis.id },
21915
- majorGridlines: !!axis.majorGridlines,
21916
- minorGridlines: !!axis.minorGridlines,
21917
- ...axis.majorGridlines?.spPr ? { majorGridlinesSpPr: axis.majorGridlines.spPr } : {},
21918
- ...axis.minorGridlines?.spPr ? { minorGridlinesSpPr: axis.minorGridlines.spPr } : {}
22065
+ ...axis2.id === void 0 ? {} : { id: axis2.id },
22066
+ majorGridlines: !!axis2.majorGridlines,
22067
+ minorGridlines: !!axis2.minorGridlines,
22068
+ ...axis2.majorGridlines?.spPr ? { majorGridlinesSpPr: axis2.majorGridlines.spPr } : {},
22069
+ ...axis2.minorGridlines?.spPr ? { minorGridlinesSpPr: axis2.minorGridlines.spPr } : {}
21919
22070
  })),
21920
22071
  groups: space3.plotArea.series.map((series2) => ({
21921
22072
  kind: "bar",
@@ -21951,19 +22102,19 @@ function editChartExStyle(space3, operation) {
21951
22102
  if (after.title.tx?.rich) draft.title.tx = { ...draft.title.tx, rich: after.title.tx.rich };
21952
22103
  }
21953
22104
  if (draft.legend && after.legend) copyStyle(draft.legend, after.legend);
21954
- draft.plotArea.axes.forEach((axis, index) => {
22105
+ draft.plotArea.axes.forEach((axis2, index) => {
21955
22106
  const edited = after.plotArea.axes[index];
21956
22107
  if (!edited) return;
21957
- copyStyle(axis, edited);
21958
- if (axis.title && edited.title) {
21959
- copyStyle(axis.title, edited.title);
21960
- if (edited.title.tx?.rich) axis.title.tx = { ...axis.title.tx, rich: edited.title.tx.rich };
22108
+ copyStyle(axis2, edited);
22109
+ if (axis2.title && edited.title) {
22110
+ copyStyle(axis2.title, edited.title);
22111
+ if (edited.title.tx?.rich) axis2.title.tx = { ...axis2.title.tx, rich: edited.title.tx.rich };
21961
22112
  }
21962
22113
  for (const key of ["majorGridlines", "minorGridlines"]) {
21963
22114
  const shape = edited[key === "majorGridlines" ? "majorGridlinesSpPr" : "minorGridlinesSpPr"];
21964
22115
  if (shape) {
21965
- axis[key] ??= {};
21966
- axis[key].spPr = structuredClone(shape);
22116
+ axis2[key] ??= {};
22117
+ axis2[key].spPr = structuredClone(shape);
21967
22118
  }
21968
22119
  }
21969
22120
  });
@@ -22008,10 +22159,10 @@ function shapes(space3, target) {
22008
22159
  case "axis":
22009
22160
  case "majorGridlines":
22010
22161
  case "minorGridlines": {
22011
- const axis = space3.plotArea.axes[target.axisIndex];
22012
- if (!axis) throw new RangeError("No chart axis at index.");
22013
- if (target.kind === "axis") return [axis.spPr ??= {}];
22014
- return [(axis[target.kind] ??= {}).spPr ??= {}];
22162
+ const axis2 = space3.plotArea.axes[target.axisIndex];
22163
+ if (!axis2) throw new RangeError("No chart axis at index.");
22164
+ if (target.kind === "axis") return [axis2.spPr ??= {}];
22165
+ return [(axis2[target.kind] ??= {}).spPr ??= {}];
22015
22166
  }
22016
22167
  case "dataLabels": {
22017
22168
  const series2 = target.seriesIndex === void 0 ? space3.plotArea.series : [chartExSeriesAt(space3, target.seriesIndex)];
@@ -22101,25 +22252,25 @@ function editChartExAxis(space3, index, edit) {
22101
22252
  throw new RangeError("Invalid ChartEx axis scaling.");
22102
22253
  }
22103
22254
  return editChartExSpace(space3, (draft) => {
22104
- const axis = chartExAxisAt(draft, index);
22255
+ const axis2 = chartExAxisAt(draft, index);
22105
22256
  for (const key of ["min", "max", "majorUnit", "minorUnit"])
22106
22257
  if (edit[key] !== void 0) {
22107
- if (axis.scaling?.kind !== "val")
22258
+ if (axis2.scaling?.kind !== "val")
22108
22259
  throw new RangeError("Only a value axis supports numeric scaling.");
22109
- if (edit[key] === null) delete axis.scaling[key];
22110
- else axis.scaling[key] = edit[key];
22260
+ if (edit[key] === null) delete axis2.scaling[key];
22261
+ else axis2.scaling[key] = edit[key];
22111
22262
  }
22112
- if (axis.scaling?.kind === "val" && typeof axis.scaling.min === "number" && typeof axis.scaling.max === "number" && axis.scaling.min >= axis.scaling.max)
22263
+ if (axis2.scaling?.kind === "val" && typeof axis2.scaling.min === "number" && typeof axis2.scaling.max === "number" && axis2.scaling.min >= axis2.scaling.max)
22113
22264
  throw new RangeError("Axis maximum must exceed its minimum.");
22114
- if (edit.visible !== void 0) axis.hidden = !edit.visible;
22265
+ if (edit.visible !== void 0) axis2.hidden = !edit.visible;
22115
22266
  if (edit.tickLabels !== void 0) {
22116
- if (edit.tickLabels) axis.tickLabels ??= {};
22117
- else delete axis.tickLabels;
22267
+ if (edit.tickLabels) axis2.tickLabels ??= {};
22268
+ else delete axis2.tickLabels;
22118
22269
  }
22119
22270
  for (const key of ["majorGridlines", "minorGridlines"])
22120
22271
  if (edit[key] !== void 0) {
22121
- if (edit[key]) axis[key] ??= {};
22122
- else delete axis[key];
22272
+ if (edit[key]) axis2[key] ??= {};
22273
+ else delete axis2[key];
22123
22274
  }
22124
22275
  for (const [key, target] of [
22125
22276
  ["majorTickMark", "majorTickMarks"],
@@ -22127,28 +22278,28 @@ function editChartExAxis(space3, index, edit) {
22127
22278
  ])
22128
22279
  if (edit[key] !== void 0) {
22129
22280
  const value = edit[key];
22130
- if (value === null) delete axis[target];
22281
+ if (value === null) delete axis2[target];
22131
22282
  else {
22132
22283
  if (!["in", "out", "cross", "none"].includes(value))
22133
22284
  throw new RangeError("Invalid tick mark.");
22134
- axis[target] = { type: value };
22285
+ axis2[target] = { type: value };
22135
22286
  }
22136
22287
  }
22137
22288
  if (edit.title !== void 0) {
22138
22289
  const { title: _chartTitle, ...base } = draft;
22139
22290
  const title = setChartExTitle(
22140
- { ...base, ...axis.title ? { title: axis.title } : {} },
22291
+ { ...base, ...axis2.title ? { title: axis2.title } : {} },
22141
22292
  edit.title ?? void 0
22142
22293
  ).title;
22143
- if (title) axis.title = title;
22144
- else delete axis.title;
22294
+ if (title) axis2.title = title;
22295
+ else delete axis2.title;
22145
22296
  }
22146
22297
  if (edit.numberFormat !== void 0) {
22147
- if (edit.numberFormat === null) delete axis.numberFormat;
22148
- else axis.numberFormat = structuredClone(edit.numberFormat);
22298
+ if (edit.numberFormat === null) delete axis2.numberFormat;
22299
+ else axis2.numberFormat = structuredClone(edit.numberFormat);
22149
22300
  }
22150
22301
  if (edit.units !== void 0) {
22151
- if (edit.units === null) delete axis.units;
22302
+ if (edit.units === null) delete axis2.units;
22152
22303
  else {
22153
22304
  if (![
22154
22305
  "hundreds",
@@ -22163,7 +22314,7 @@ function editChartExAxis(space3, index, edit) {
22163
22314
  "percentage"
22164
22315
  ].includes(edit.units))
22165
22316
  throw new RangeError("Unsupported ChartEx display units.");
22166
- axis.units = { ...axis.units, unit: edit.units };
22317
+ axis2.units = { ...axis2.units, unit: edit.units };
22167
22318
  }
22168
22319
  }
22169
22320
  });
@@ -22259,9 +22410,9 @@ function applyChartExEditAction(space3, action) {
22259
22410
  return setChartExAxis(space3, action.axisIndex, action.edit);
22260
22411
  case "tickLabels":
22261
22412
  return editChartExSpace(space3, (draft) => {
22262
- const axis = chartExAxisAt(draft, action.axisIndex);
22263
- if (action.visible) axis.tickLabels ??= {};
22264
- else delete axis.tickLabels;
22413
+ const axis2 = chartExAxisAt(draft, action.axisIndex);
22414
+ if (action.visible) axis2.tickLabels ??= {};
22415
+ else delete axis2.tickLabels;
22265
22416
  });
22266
22417
  case "pointLabel":
22267
22418
  return setChartExPointLabel(space3, action.seriesIndex, action.pointIndex, action.label);
@@ -22558,15 +22709,15 @@ function setChartSeriesAxis(space3, seriesIndex, valueAxisId2) {
22558
22709
  const { group: group2 } = chartSeriesEntryAt(space3, seriesIndex);
22559
22710
  if (group2.is3D || !["bar", "line", "area", "scatter", "bubble"].includes(group2.kind))
22560
22711
  throw new RangeError("This chart family has no editable axis pair");
22561
- if (new Set(space3.plotArea.axes.map((axis) => axis.id)).size !== space3.plotArea.axes.length)
22712
+ if (new Set(space3.plotArea.axes.map((axis2) => axis2.id)).size !== space3.plotArea.axes.length)
22562
22713
  throw new RangeError("Ambiguous chart axis ids");
22563
22714
  const horizontal = group2.kind === "bar" && group2.barDirection === "bar";
22564
22715
  const candidates = space3.plotArea.axes.filter(
22565
- (axis) => axis.kind === "val" && (valueAxisId2 === null ? axis.position === (horizontal ? "b" : "l") : axis.id === valueAxisId2)
22716
+ (axis2) => axis2.kind === "val" && (valueAxisId2 === null ? axis2.position === (horizontal ? "b" : "l") : axis2.id === valueAxisId2)
22566
22717
  );
22567
22718
  if (candidates.length !== 1) throw new RangeError("No unique existing value axis");
22568
22719
  const value = candidates[0];
22569
- const category = space3.plotArea.axes.find((axis) => axis.id === value.crossAxisId);
22720
+ const category = space3.plotArea.axes.find((axis2) => axis2.id === value.crossAxisId);
22570
22721
  const xy = group2.kind === "scatter" || group2.kind === "bubble";
22571
22722
  if (value.id === void 0 || category?.id === void 0 || category.crossAxisId !== value.id || (xy ? category.kind !== "val" : !["cat", "date"].includes(category.kind)))
22572
22723
  throw new RangeError("Axis references do not form a coherent pair");
@@ -22599,7 +22750,7 @@ function setChartSeriesType(space3, index, target) {
22599
22750
  return structuredClone(space3);
22600
22751
  if (group2.is3D || target.is3D || !["bar", "line", "area"].includes(group2.kind) || !["bar", "line", "area"].includes(target.kind) || group2.barDirection === "bar" || target.barDirection === "bar")
22601
22752
  throw new RangeError("Series combo types need vertical 2D column, line or area families");
22602
- const pair = group2.axisIds.map((id) => space3.plotArea.axes.find((axis) => axis.id === id));
22753
+ const pair = group2.axisIds.map((id) => space3.plotArea.axes.find((axis2) => axis2.id === id));
22603
22754
  if (pair.length !== 2 || !pair[0] || !pair[1] || !["cat", "date"].includes(pair[0].kind) || pair[1].kind !== "val" || pair[0].crossAxisId !== pair[1].id || pair[1].crossAxisId !== pair[0].id)
22604
22755
  throw new RangeError("Combo types need a coherent category/value axis pair");
22605
22756
  if (group2.series.length > 1 && group2.extLst)
@@ -22670,14 +22821,14 @@ function setChartGroupDecorations(space3, edit) {
22670
22821
  // chart/edit/axis-label.ts
22671
22822
  function setChartDisplayUnitsLabel(space3, target, edit) {
22672
22823
  return editChartSpace(space3, (draft) => {
22673
- const axis = chartAxisAt(draft, target);
22674
- if (axis.kind !== "val") throw new RangeError("Only a value axis has a display-units label");
22824
+ const axis2 = chartAxisAt(draft, target);
22825
+ if (axis2.kind !== "val") throw new RangeError("Only a value axis has a display-units label");
22675
22826
  if (edit === null) {
22676
- if (axis.displayUnits) delete axis.displayUnits.label;
22827
+ if (axis2.displayUnits) delete axis2.displayUnits.label;
22677
22828
  return;
22678
22829
  }
22679
- axis.displayUnits ??= {};
22680
- const label = axis.displayUnits.label ??= {};
22830
+ axis2.displayUnits ??= {};
22831
+ const label = axis2.displayUnits.label ??= {};
22681
22832
  if (edit.text === null) delete label.tx;
22682
22833
  else if (edit.text !== void 0)
22683
22834
  assignOrDelete(
@@ -28179,8 +28330,8 @@ function documentOrder(point) {
28179
28330
  descendants3(all[0], all);
28180
28331
  return all;
28181
28332
  }
28182
- function axisPoints(point, axis) {
28183
- switch (axis) {
28333
+ function axisPoints(point, axis2) {
28334
+ switch (axis2) {
28184
28335
  case "self":
28185
28336
  return [point];
28186
28337
  case "ch":
@@ -28199,7 +28350,7 @@ function axisPoints(point, axis) {
28199
28350
  return point.parent ? [point.parent] : [];
28200
28351
  case "ancst":
28201
28352
  case "ancstOrSelf": {
28202
- const out = axis === "ancstOrSelf" ? [point] : [];
28353
+ const out = axis2 === "ancstOrSelf" ? [point] : [];
28203
28354
  let current = point.parent;
28204
28355
  while (current) {
28205
28356
  out.push(current);
@@ -28214,13 +28365,13 @@ function axisPoints(point, axis) {
28214
28365
  if (index < 0) {
28215
28366
  return [];
28216
28367
  }
28217
- return axis === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index);
28368
+ return axis2 === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index);
28218
28369
  }
28219
28370
  case "follow":
28220
28371
  case "preced": {
28221
28372
  const all = documentOrder(point);
28222
28373
  const index = all.indexOf(point);
28223
- return axis === "follow" ? all.slice(index + 1) : all.slice(0, index);
28374
+ return axis2 === "follow" ? all.slice(index + 1) : all.slice(0, index);
28224
28375
  }
28225
28376
  case "root":
28226
28377
  return [rootOf2(point)];
@@ -28292,10 +28443,10 @@ function windowPoints(points2, st = 1, cnt = 0, step = 1) {
28292
28443
  return out;
28293
28444
  }
28294
28445
  function iterateStep(point, iterator, step) {
28295
- const axis = iterator.axis[step] ?? "none";
28446
+ const axis2 = iterator.axis[step] ?? "none";
28296
28447
  const ptType = iterator.ptType[step] ?? iterator.ptType[iterator.ptType.length - 1] ?? "all";
28297
- const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis);
28298
- let points2 = axisPoints(point, axis).filter((candidate) => matchesPointType(candidate, ptType));
28448
+ const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis2);
28449
+ let points2 = axisPoints(point, axis2).filter((candidate) => matchesPointType(candidate, ptType));
28299
28450
  if (hideLast) {
28300
28451
  points2 = points2.filter((candidate) => !isLastSiblingTransition(candidate));
28301
28452
  }
@@ -28560,8 +28711,8 @@ function valueOf(node, type) {
28560
28711
  if (direct !== void 0) {
28561
28712
  return boundedValue(node, type, direct);
28562
28713
  }
28563
- const axis = AXIS_LOOKUP[type];
28564
- return axis ? axisValue(node, axis[0], axis[1]) : void 0;
28714
+ const axis2 = AXIS_LOOKUP[type];
28715
+ return axis2 ? axisValue(node, axis2[0], axis2[1]) : void 0;
28565
28716
  }
28566
28717
  function boundedValue(node, type, value) {
28567
28718
  let out = value;
@@ -28704,17 +28855,17 @@ function exactDef(name2, avLst, gdLines, rect3, paths) {
28704
28855
  var Glyph = class {
28705
28856
  lines = [];
28706
28857
  names = /* @__PURE__ */ new Map();
28707
- coord(axis, value) {
28708
- const key = `${axis}${value}`;
28858
+ coord(axis2, value) {
28859
+ const key = `${axis2}${value}`;
28709
28860
  const known = this.names.get(key);
28710
28861
  if (known) {
28711
28862
  return known;
28712
28863
  }
28713
28864
  const id = this.names.size;
28714
- const name2 = `${axis}g${id}`;
28865
+ const name2 = `${axis2}g${id}`;
28715
28866
  this.lines.push(
28716
28867
  `k${id} */ ss ${Math.round(value * 1e3)} 90000`,
28717
- `${name2} +- ${axis === "x" ? "hc" : "vc"} k${id} 0`
28868
+ `${name2} +- ${axis2 === "x" ? "hc" : "vc"} k${id} 0`
28718
28869
  );
28719
28870
  this.names.set(key, name2);
28720
28871
  return name2;
@@ -43867,7 +44018,7 @@ function siblingGroupOf(node, parentOf, childrenOf, roots2) {
43867
44018
  const parent = parentOf.get(node.id);
43868
44019
  return parent ? childrenOf.get(parent.id) ?? [] : roots2;
43869
44020
  }
43870
- function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
44021
+ function navigateAxisHop(current, axis2, nodes, childrenOf, parentOf, roots2) {
43871
44022
  const out = [];
43872
44023
  const seen = /* @__PURE__ */ new Set();
43873
44024
  const add3 = (node) => {
@@ -43882,7 +44033,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
43882
44033
  }
43883
44034
  };
43884
44035
  for (const node of current) {
43885
- switch (axis) {
44036
+ switch (axis2) {
43886
44037
  case "self":
43887
44038
  add3(node);
43888
44039
  break;
@@ -43914,7 +44065,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
43914
44065
  case "precedSib": {
43915
44066
  const siblings = siblingGroupOf(node, parentOf, childrenOf, roots2);
43916
44067
  const index = siblings.findIndex((sibling) => sibling.id === node.id);
43917
- addAll(axis === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index));
44068
+ addAll(axis2 === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index));
43918
44069
  break;
43919
44070
  }
43920
44071
  case "follow":
@@ -43924,11 +44075,11 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
43924
44075
  break;
43925
44076
  }
43926
44077
  const excluded = new Set(
43927
- (axis === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf)).map(
44078
+ (axis2 === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf)).map(
43928
44079
  (n3) => n3.id
43929
44080
  )
43930
44081
  );
43931
- const range2 = axis === "follow" ? nodes.slice(docIndex + 1) : nodes.slice(0, docIndex);
44082
+ const range2 = axis2 === "follow" ? nodes.slice(docIndex + 1) : nodes.slice(0, docIndex);
43932
44083
  addAll(range2.filter((n3) => !excluded.has(n3.id)));
43933
44084
  break;
43934
44085
  }
@@ -43964,15 +44115,15 @@ function applyPointTypeAndRange(nodes, pointType2, start, count) {
43964
44115
  const filtered = pointType2 ? nodes.filter((n3) => pointTypeMatches(n3, pointType2)) : nodes;
43965
44116
  return selectRange(filtered, start, count);
43966
44117
  }
43967
- function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
43968
- if (axis.length === 0) {
44118
+ function resolveAxisNodes(nodes, axis2, pointTypes, start, count, context) {
44119
+ if (axis2.length === 0) {
43969
44120
  return void 0;
43970
44121
  }
43971
44122
  const rootRelative = context === void 0;
43972
- if (rootRelative && axis[0] !== "ch" && axis[0] !== "self" && axis[0] !== "root") {
44123
+ if (rootRelative && axis2[0] !== "ch" && axis2[0] !== "self" && axis2[0] !== "root") {
43973
44124
  return void 0;
43974
44125
  }
43975
- if (axis[0] === "root" && axis.length > 1 && axis[1] !== "ch") {
44126
+ if (axis2[0] === "root" && axis2.length > 1 && axis2[1] !== "ch") {
43976
44127
  return void 0;
43977
44128
  }
43978
44129
  const byId = new Map(nodes.map((n3) => [n3.id, n3]));
@@ -43993,15 +44144,15 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
43993
44144
  const roots2 = nodes.filter((n3) => !n3.parentId || !byId.has(n3.parentId));
43994
44145
  let current;
43995
44146
  let nextHop;
43996
- if (axis[0] === "root" && axis.length > 1) {
44147
+ if (axis2[0] === "root" && axis2.length > 1) {
43997
44148
  current = applyPointTypeAndRange(roots2, pointTypes?.[1], start?.[1], count?.[1]);
43998
44149
  nextHop = 2;
43999
- } else if (axis[0] === "root") {
44150
+ } else if (axis2[0] === "root") {
44000
44151
  current = applyPointTypeAndRange(roots2, pointTypes?.[0], start?.[0], count?.[0]);
44001
44152
  nextHop = 1;
44002
44153
  } else if (context !== void 0) {
44003
44154
  current = applyPointTypeAndRange(
44004
- navigateAxisHop(context, axis[0], nodes, childrenOf, parentOf, roots2),
44155
+ navigateAxisHop(context, axis2[0], nodes, childrenOf, parentOf, roots2),
44005
44156
  pointTypes?.[0],
44006
44157
  start?.[0],
44007
44158
  count?.[0]
@@ -44011,9 +44162,9 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
44011
44162
  current = applyPointTypeAndRange(roots2, pointTypes?.[0], start?.[0], count?.[0]);
44012
44163
  nextHop = 1;
44013
44164
  }
44014
- for (let hop = nextHop; hop < axis.length; hop += 1) {
44165
+ for (let hop = nextHop; hop < axis2.length; hop += 1) {
44015
44166
  current = applyPointTypeAndRange(
44016
- navigateAxisHop(current, axis[hop], nodes, childrenOf, parentOf, roots2),
44167
+ navigateAxisHop(current, axis2[hop], nodes, childrenOf, parentOf, roots2),
44017
44168
  pointTypes?.[hop],
44018
44169
  start?.[hop],
44019
44170
  count?.[hop]
@@ -44021,8 +44172,8 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
44021
44172
  }
44022
44173
  return current;
44023
44174
  }
44024
- function resolveAxisCount(nodes, axis, pointTypes, start, count, context) {
44025
- return resolveAxisNodes(nodes, axis, pointTypes, start, count, context)?.length;
44175
+ function resolveAxisCount(nodes, axis2, pointTypes, start, count, context) {
44176
+ return resolveAxisNodes(nodes, axis2, pointTypes, start, count, context)?.length;
44026
44177
  }
44027
44178
 
44028
44179
  // diagram/layout/smartart-layout-interpreter-axis-depth.ts
@@ -44043,14 +44194,14 @@ function depthFromAnchor(node, anchorId, byId) {
44043
44194
  }
44044
44195
  return void 0;
44045
44196
  }
44046
- function resolveAxisMaxDepth(nodes, axis, pointTypes, start, count, anchor) {
44197
+ function resolveAxisMaxDepth(nodes, axis2, pointTypes, start, count, anchor) {
44047
44198
  if (anchor.length === 0) {
44048
44199
  return void 0;
44049
44200
  }
44050
44201
  const byId = new Map(nodes.map((n3) => [n3.id, n3]));
44051
44202
  let max = 0;
44052
44203
  for (const anchorPoint of anchor) {
44053
- const resolved = resolveAxisNodes(nodes, axis, pointTypes, start, count, [anchorPoint]);
44204
+ const resolved = resolveAxisNodes(nodes, axis2, pointTypes, start, count, [anchorPoint]);
44054
44205
  if (resolved === void 0) {
44055
44206
  return void 0;
44056
44207
  }
@@ -44150,11 +44301,11 @@ function evaluateWhen(when, nodeCount, context) {
44150
44301
  if (threshold === void 0) {
44151
44302
  return void 0;
44152
44303
  }
44153
- const axis = when.axis;
44154
- if (axis !== void 0 && context.nodes) {
44304
+ const axis2 = when.axis;
44305
+ if (axis2 !== void 0 && context.nodes) {
44155
44306
  const resolved = resolveAxisCount(
44156
44307
  context.nodes,
44157
- axis,
44308
+ axis2,
44158
44309
  when.pointTypes,
44159
44310
  when.start,
44160
44311
  when.count,
@@ -45161,7 +45312,7 @@ function qualifyingIterators(node) {
45161
45312
  return nodeIters;
45162
45313
  }
45163
45314
  const axisIter = list2.find(
45164
- (each) => each.axis?.some((axis) => axis === "ch" || axis === "des" || axis === "self")
45315
+ (each) => each.axis?.some((axis2) => axis2 === "ch" || axis2 === "des" || axis2 === "self")
45165
45316
  );
45166
45317
  return [axisIter ?? list2[0]];
45167
45318
  }
@@ -47209,8 +47360,8 @@ function positionRange(start, count, step, total) {
47209
47360
 
47210
47361
  // diagram/layout/smartart-layout-interpreter-item-role-compound.ts
47211
47362
  function compoundChildIds(role, node, childrenOf) {
47212
- const axis = role.presentationOf?.axis ?? [];
47213
- const chIndex = axis.indexOf("ch");
47363
+ const axis2 = role.presentationOf?.axis ?? [];
47364
+ const chIndex = axis2.indexOf("ch");
47214
47365
  if (chIndex < 0) {
47215
47366
  return [];
47216
47367
  }
@@ -47248,8 +47399,8 @@ function isTextRole(node) {
47248
47399
  function hasAmbiguousTopLevelRoles(topLevelChildren) {
47249
47400
  const textRoles = topLevelChildren.filter(isTextRole);
47250
47401
  const descendantAxisRoles = textRoles.filter((child6) => {
47251
- const axis = child6.presentationOf?.axis?.[0];
47252
- return axis === "ch" || axis === "des" || axis === "desOrSelf";
47402
+ const axis2 = child6.presentationOf?.axis?.[0];
47403
+ return axis2 === "ch" || axis2 === "des" || axis2 === "desOrSelf";
47253
47404
  });
47254
47405
  if (descendantAxisRoles.length >= 2) {
47255
47406
  return true;
@@ -47278,17 +47429,17 @@ function contentIds(role, node, childrenOf) {
47278
47429
  if (fullAxis && fullAxis.length > 1) {
47279
47430
  return fullAxis[0] === "ch" ? compoundChildIds(role, node, childrenOf) : [];
47280
47431
  }
47281
- const axis = fullAxis?.[0];
47282
- if (axis === "self") {
47432
+ const axis2 = fullAxis?.[0];
47433
+ if (axis2 === "self") {
47283
47434
  return [node.id];
47284
47435
  }
47285
- if (axis === "ch") {
47436
+ if (axis2 === "ch") {
47286
47437
  return (childrenOf.get(node.id) ?? []).filter((child6) => child6.text.trim().length > 0).map((child6) => child6.id);
47287
47438
  }
47288
- if (axis === "des") {
47439
+ if (axis2 === "des") {
47289
47440
  return descendantIds(node, childrenOf);
47290
47441
  }
47291
- if (axis === "desOrSelf") {
47442
+ if (axis2 === "desOrSelf") {
47292
47443
  const ids = descendantIds(node, childrenOf);
47293
47444
  return node.text.trim().length > 0 ? [node.id, ...ids] : ids;
47294
47445
  }
@@ -48464,9 +48615,9 @@ function arrangeByChooseAwareSlots(root, flat, box, index, ctx, fontCtx) {
48464
48615
  // diagram/layout/smartart-layout-interpreter-composite-foreach.ts
48465
48616
  function forEachBoundSlots(slotted) {
48466
48617
  return slotted.filter((slot2) => {
48467
- const axis = slot2.node.presentationOf?.axis;
48618
+ const axis2 = slot2.node.presentationOf?.axis;
48468
48619
  const origin = slot2.node.forEachOrigin?.axis;
48469
- return axis?.length === 1 && (origin?.length ?? 0) > 1 && origin?.[0] === "ch";
48620
+ return axis2?.length === 1 && (origin?.length ?? 0) > 1 && origin?.[0] === "ch";
48470
48621
  });
48471
48622
  }
48472
48623
  function resolveForEachBoundContent(node, flat, childrenOf) {
@@ -48630,12 +48781,12 @@ function resolveUserSizeItemBoxPx(wrapper, index, box, sizeBox, declaringRoleCha
48630
48781
  return void 0;
48631
48782
  }
48632
48783
  function childAxisSpec(template, childCount) {
48633
- const axis = template.presentationOf?.axis;
48634
- if (!axis || axis.length === 0) {
48784
+ const axis2 = template.presentationOf?.axis;
48785
+ if (!axis2 || axis2.length === 0) {
48635
48786
  return void 0;
48636
48787
  }
48637
- const fold = axis.includes("des") || axis.includes("desOrSelf");
48638
- const ownIndex = axis.indexOf("ch");
48788
+ const fold = axis2.includes("des") || axis2.includes("desOrSelf");
48789
+ const ownIndex = axis2.indexOf("ch");
48639
48790
  if (ownIndex >= 0) {
48640
48791
  const start = template.presentationOf?.start?.[ownIndex] ?? 1;
48641
48792
  const count = template.presentationOf?.count?.[ownIndex];
@@ -48945,8 +49096,8 @@ function renderAnchoredPair(node, index, total, selfSlot, selfLayoutNode, desSlo
48945
49096
  }
48946
49097
 
48947
49098
  // diagram/layout/smartart-layout-interpreter-composite.ts
48948
- function slotsWithAxis(slotted, axis) {
48949
- return slotted.filter((slot2) => slot2.node.presentationOf?.axis?.[0] === axis);
49099
+ function slotsWithAxis(slotted, axis2) {
49100
+ return slotted.filter((slot2) => slot2.node.presentationOf?.axis?.[0] === axis2);
48950
49101
  }
48951
49102
  function arrangeByPresentationOf(view, slotted, allChildren, nodes, flat, box, absX, absY, childrenOf, ctx, fontCtx, index, presLayoutVars, declaringRoleChain, sizeBox) {
48952
49103
  const selfSlots = slotsWithAxis(slotted, "self");
@@ -49764,12 +49915,12 @@ function resolveSpanWidth(map, t, orgChart) {
49764
49915
  }
49765
49916
 
49766
49917
  // diagram/hierarchy/smartart-hierarchy-fold-depth.ts
49767
- function endsInUnboundedDescendantHop(axis, count) {
49768
- if (!axis || axis.length === 0) {
49918
+ function endsInUnboundedDescendantHop(axis2, count) {
49919
+ if (!axis2 || axis2.length === 0) {
49769
49920
  return false;
49770
49921
  }
49771
- const lastIndex = axis.length - 1;
49772
- const lastAxis = axis[lastIndex];
49922
+ const lastIndex = axis2.length - 1;
49923
+ const lastAxis = axis2[lastIndex];
49773
49924
  if (lastAxis !== "des" && lastAxis !== "desOrSelf") {
49774
49925
  return false;
49775
49926
  }
@@ -66152,9 +66303,9 @@ function alignElements(elements3, edge, options2) {
66152
66303
  }
66153
66304
  return result;
66154
66305
  }
66155
- function distributeElements(elements3, axis, options2) {
66306
+ function distributeElements(elements3, axis2, options2) {
66156
66307
  const result = /* @__PURE__ */ new Map();
66157
- const horizontal = axis === "horizontal";
66308
+ const horizontal = axis2 === "horizontal";
66158
66309
  const start = (e) => horizontal ? e.x : e.y;
66159
66310
  const size = (e) => horizontal ? e.width : e.height;
66160
66311
  const sorted = [...elements3].sort((a2, b) => start(a2) - start(b));
@@ -68875,21 +69026,21 @@ function fraction(node, style, ctx) {
68875
69026
  return row([num2, slash, den]);
68876
69027
  }
68877
69028
  const gap = style.size * 0.15;
68878
- const axis = style.size * AXIS3;
69029
+ const axis2 = style.size * AXIS3;
68879
69030
  const width = Math.max(num2.width, den.width) + style.size * 0.2;
68880
69031
  const bar = type === "noBar" ? [] : [
68881
69032
  {
68882
69033
  kind: "line",
68883
69034
  x1: 0,
68884
69035
  x2: width,
68885
- y1: -axis,
68886
- y2: -axis,
69036
+ y1: -axis2,
69037
+ y2: -axis2,
68887
69038
  width: Math.max(0.8, style.size * 0.05)
68888
69039
  }
68889
69040
  ];
68890
69041
  const box = overlay([
68891
- { box: num2, x: (width - num2.width) / 2, y: -(axis + gap + num2.descent) },
68892
- { box: den, x: (width - den.width) / 2, y: -axis + gap + den.ascent }
69042
+ { box: num2, x: (width - num2.width) / 2, y: -(axis2 + gap + num2.descent) },
69043
+ { box: den, x: (width - den.width) / 2, y: -axis2 + gap + den.ascent }
68893
69044
  ]);
68894
69045
  box.width = width;
68895
69046
  box.prims.push(...bar);