ooxml-core 1.45.0 → 1.47.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 (81) hide show
  1. package/dist/PptxHandler-JX62VKU4.cjs +14 -0
  2. package/dist/{PptxHandler-FXLXIOLT.mjs → PptxHandler-NXHZ6ITL.mjs} +2 -2
  3. package/dist/PptxHandler-SUGLNSZI.mjs +5 -0
  4. package/dist/{PresentationBuilder-CSKLG64K.cjs → PresentationBuilder-IK6NIK6T.cjs} +6 -6
  5. package/dist/{PresentationBuilder-DDYHRV26.mjs → PresentationBuilder-LHQ333UL.mjs} +3 -3
  6. package/dist/{PresentationBuilder-3FKFRSSV.mjs → PresentationBuilder-URSPID7L.mjs} +2 -2
  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-YBSNMVSN.cjs → chunk-4GPLQEEC.cjs} +1604 -1324
  22. package/dist/{chunk-U5BXJQZG.mjs → chunk-553WFEHD.mjs} +332 -53
  23. package/dist/{chunk-RVYGAYCP.mjs → chunk-5HNRZOBX.mjs} +1 -1
  24. package/dist/{chunk-VKFKEVHK.mjs → chunk-6MU4WKHS.mjs} +1 -1
  25. package/dist/{chunk-GXYK3H4O.mjs → chunk-7L6ZAA5Y.mjs} +82 -17
  26. package/dist/{chunk-3J6VIKLP.cjs → chunk-APCA7N6Q.cjs} +3 -3
  27. package/dist/{chunk-IPV3J3I5.mjs → chunk-DEDK2J57.mjs} +68 -1
  28. package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
  29. package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
  30. package/dist/{chunk-GGJUWJXB.mjs → chunk-QHR726W3.mjs} +1 -1
  31. package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
  32. package/dist/{chunk-QZPOPUI5.cjs → chunk-WFN6ZU7N.cjs} +69 -0
  33. package/dist/{chunk-LCXBTJXE.mjs → chunk-XVEJS7HN.mjs} +5 -5
  34. package/dist/{chunk-CVJX6NNO.mjs → chunk-Z734BYYR.mjs} +334 -54
  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 +2207 -1825
  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--HBUyILF.d.ts} +5 -5
  44. package/dist/pptx/chunks/{index-6Ot1b-4U.d.ts.map → index--HBUyILF.d.ts.map} +1 -1
  45. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts → index-BDVzSboe.d.ts} +71 -7
  46. package/dist/pptx/chunks/{index-DGKI80Hj.d.ts.map → index-BDVzSboe.d.ts.map} +1 -1
  47. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts → index-Dr3iIPt9.d.ts} +3 -3
  48. package/dist/pptx/chunks/{index-jdZUtLGB.d.ts.map → index-Dr3iIPt9.d.ts.map} +1 -1
  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 +608 -226
  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 +2605 -2226
  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
@@ -8011,12 +8011,12 @@ function readScene3DValues(node, read) {
8011
8011
  ["lightRig", light]
8012
8012
  ]) {
8013
8013
  const rot = read.child(source2, "rot");
8014
- for (const [axis, key] of [
8014
+ for (const [axis2, key] of [
8015
8015
  ["lat", "RotX"],
8016
8016
  ["lon", "RotY"],
8017
8017
  ["rev", "RotZ"]
8018
8018
  ]) {
8019
- const value = integer2(read.attribute(rot, axis));
8019
+ const value = integer2(read.attribute(rot, axis2));
8020
8020
  if (value !== void 0 && value >= 0 && value < 216e5) out[`${prefix2}${key}`] = value;
8021
8021
  }
8022
8022
  }
@@ -8029,12 +8029,12 @@ function readScene3DValues(node, read) {
8029
8029
  ["up", "backdropUp", "d"]
8030
8030
  ]) {
8031
8031
  const point = read.child(backdrop, name2);
8032
- for (const [axis, suffix] of [
8032
+ for (const [axis2, suffix] of [
8033
8033
  ["x", "X"],
8034
8034
  ["y", "Y"],
8035
8035
  ["z", "Z"]
8036
8036
  ]) {
8037
- const value = integer2(read.attribute(point, `${attr3}${axis}`));
8037
+ const value = integer2(read.attribute(point, `${attr3}${axis2}`));
8038
8038
  if (value !== void 0) out[`${prefix2}${suffix}`] = value;
8039
8039
  }
8040
8040
  }
@@ -8678,12 +8678,12 @@ function writeDrawingTextScene3D(doc, value) {
8678
8678
  throw new Error("A backdrop point needs three finite coordinates");
8679
8679
  const point = child2(backdrop, name2);
8680
8680
  const vector = attr3 === "d" ? scaleVectorToIntegers(values[0], values[1], values[2]) : { x: values[0], y: values[1], z: values[2] };
8681
- for (const [axis, suffix] of [
8681
+ for (const [axis2, suffix] of [
8682
8682
  ["x", "X"],
8683
8683
  ["y", "Y"],
8684
8684
  ["z", "Z"]
8685
8685
  ])
8686
- number(point, `${attr3}${axis}`, vector[axis], before[`${prefix2}${suffix}`]);
8686
+ number(point, `${attr3}${axis2}`, vector[axis2], before[`${prefix2}${suffix}`]);
8687
8687
  }
8688
8688
  }
8689
8689
  return node;
@@ -9057,17 +9057,17 @@ function exactDef(name2, avLst, gdLines, rect3, paths) {
9057
9057
  var Glyph = class {
9058
9058
  lines = [];
9059
9059
  names = /* @__PURE__ */ new Map();
9060
- coord(axis, value) {
9061
- const key = `${axis}${value}`;
9060
+ coord(axis2, value) {
9061
+ const key = `${axis2}${value}`;
9062
9062
  const known = this.names.get(key);
9063
9063
  if (known) {
9064
9064
  return known;
9065
9065
  }
9066
9066
  const id = this.names.size;
9067
- const name2 = `${axis}g${id}`;
9067
+ const name2 = `${axis2}g${id}`;
9068
9068
  this.lines.push(
9069
9069
  `k${id} */ ss ${Math.round(value * 1e3)} 90000`,
9070
- `${name2} +- ${axis === "x" ? "hc" : "vc"} k${id} 0`
9070
+ `${name2} +- ${axis2 === "x" ? "hc" : "vc"} k${id} 0`
9071
9071
  );
9072
9072
  this.names.set(key, name2);
9073
9073
  return name2;
@@ -20605,8 +20605,8 @@ function documentOrder(point) {
20605
20605
  descendants3(all[0], all);
20606
20606
  return all;
20607
20607
  }
20608
- function axisPoints(point, axis) {
20609
- switch (axis) {
20608
+ function axisPoints(point, axis2) {
20609
+ switch (axis2) {
20610
20610
  case "self":
20611
20611
  return [point];
20612
20612
  case "ch":
@@ -20625,7 +20625,7 @@ function axisPoints(point, axis) {
20625
20625
  return point.parent ? [point.parent] : [];
20626
20626
  case "ancst":
20627
20627
  case "ancstOrSelf": {
20628
- const out = axis === "ancstOrSelf" ? [point] : [];
20628
+ const out = axis2 === "ancstOrSelf" ? [point] : [];
20629
20629
  let current = point.parent;
20630
20630
  while (current) {
20631
20631
  out.push(current);
@@ -20640,13 +20640,13 @@ function axisPoints(point, axis) {
20640
20640
  if (index < 0) {
20641
20641
  return [];
20642
20642
  }
20643
- return axis === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index);
20643
+ return axis2 === "followSib" ? siblings.slice(index + 1) : siblings.slice(0, index);
20644
20644
  }
20645
20645
  case "follow":
20646
20646
  case "preced": {
20647
20647
  const all = documentOrder(point);
20648
20648
  const index = all.indexOf(point);
20649
- return axis === "follow" ? all.slice(index + 1) : all.slice(0, index);
20649
+ return axis2 === "follow" ? all.slice(index + 1) : all.slice(0, index);
20650
20650
  }
20651
20651
  case "root":
20652
20652
  return [rootOf2(point)];
@@ -20718,10 +20718,10 @@ function windowPoints(points3, st = 1, cnt = 0, step = 1) {
20718
20718
  return out;
20719
20719
  }
20720
20720
  function iterateStep(point, iterator, step) {
20721
- const axis = iterator.axis[step] ?? "none";
20721
+ const axis2 = iterator.axis[step] ?? "none";
20722
20722
  const ptType = iterator.ptType[step] ?? iterator.ptType[iterator.ptType.length - 1] ?? "all";
20723
- const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis);
20724
- let points3 = axisPoints(point, axis).filter((candidate) => matchesPointType(candidate, ptType));
20723
+ const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis2);
20724
+ let points3 = axisPoints(point, axis2).filter((candidate) => matchesPointType(candidate, ptType));
20725
20725
  if (hideLast) {
20726
20726
  points3 = points3.filter((candidate) => !isLastSiblingTransition(candidate));
20727
20727
  }
@@ -20986,8 +20986,8 @@ function valueOf(node, type) {
20986
20986
  if (direct !== void 0) {
20987
20987
  return boundedValue(node, type, direct);
20988
20988
  }
20989
- const axis = AXIS_LOOKUP[type];
20990
- return axis ? axisValue(node, axis[0], axis[1]) : void 0;
20989
+ const axis2 = AXIS_LOOKUP[type];
20990
+ return axis2 ? axisValue(node, axis2[0], axis2[1]) : void 0;
20991
20991
  }
20992
20992
  function boundedValue(node, type, value) {
20993
20993
  let out = value;
@@ -30817,8 +30817,8 @@ function parseGroup(context, element4) {
30817
30817
  element: element4.localName,
30818
30818
  is3D,
30819
30819
  series: children(element4, "ser", NS.c).map((ser) => parseSeries(context, ser)),
30820
- axisIds: children(element4, "axId", NS.c).flatMap((axis) => {
30821
- const raw2 = attribute(axis, "val")?.trim();
30820
+ axisIds: children(element4, "axId", NS.c).flatMap((axis2) => {
30821
+ const raw2 = attribute(axis2, "val")?.trim();
30822
30822
  const id = raw2 ? Number(raw2) : Number.NaN;
30823
30823
  return Number.isFinite(id) ? [id] : [];
30824
30824
  })
@@ -30967,9 +30967,9 @@ function parsePlotArea(context, element4) {
30967
30967
  plotArea.groups.push(parseGroup(context, child7));
30968
30968
  handled.add(child7.localName);
30969
30969
  }
30970
- const axis = AXIS_ELEMENTS[child7.localName];
30971
- if (axis) {
30972
- plotArea.axes.push(parseAxis(context, child7, axis));
30970
+ const axis2 = AXIS_ELEMENTS[child7.localName];
30971
+ if (axis2) {
30972
+ plotArea.axes.push(parseAxis(context, child7, axis2));
30973
30973
  handled.add(child7.localName);
30974
30974
  }
30975
30975
  }
@@ -31387,14 +31387,14 @@ var AXIS_ELEMENTS2 = {
31387
31387
  ser: "serAx"
31388
31388
  };
31389
31389
  var gridlinesXml = (context, local, present2, shape2) => present2 ? elementXml(local, shapePropertiesXml(context, shape2)) : "";
31390
- function axisXml(context, axis) {
31391
- const { scaling } = axis;
31390
+ function axisXml(context, axis2) {
31391
+ const { scaling } = axis2;
31392
31392
  return elementXml(
31393
- AXIS_ELEMENTS2[axis.kind],
31394
- valXml("axId", axis.id) + elementXml(
31393
+ AXIS_ELEMENTS2[axis2.kind],
31394
+ valXml("axId", axis2.id) + elementXml(
31395
31395
  "scaling",
31396
31396
  valXml("logBase", scaling.logBase) + valXml("orientation", scaling.orientation) + valXml("max", scaling.max) + valXml("min", scaling.min)
31397
- ) + 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)
31397
+ ) + 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)
31398
31398
  );
31399
31399
  }
31400
31400
 
@@ -31468,7 +31468,7 @@ function groupXml(context, group3) {
31468
31468
  function plotAreaXml(context, plotArea) {
31469
31469
  return elementXml(
31470
31470
  "plotArea",
31471
- layoutXml(context, plotArea.layout) + plotArea.groups.map((group3) => groupXml(context, group3)).join("") + plotArea.axes.map((axis) => axisXml(context, axis)).join("") + dataTableXml(context, plotArea.dataTable) + shapePropertiesXml(context, plotArea.spPr) + raw(context, plotArea.extLst)
31471
+ layoutXml(context, plotArea.layout) + plotArea.groups.map((group3) => groupXml(context, group3)).join("") + plotArea.axes.map((axis2) => axisXml(context, axis2)).join("") + dataTableXml(context, plotArea.dataTable) + shapePropertiesXml(context, plotArea.spPr) + raw(context, plotArea.extLst)
31472
31472
  );
31473
31473
  }
31474
31474
 
@@ -31821,14 +31821,14 @@ function parseLegend2(context, element4) {
31821
31821
  }
31822
31822
 
31823
31823
  // chart/ex/parse-axis.ts
31824
- function parseScaling(context, axis) {
31825
- const category = cxChild(axis, "catScaling");
31824
+ function parseScaling(context, axis2) {
31825
+ const category = cxChild(axis2, "catScaling");
31826
31826
  if (category)
31827
31827
  return assignDefined(
31828
31828
  { kind: "cat" },
31829
31829
  { gapWidth: autoNumberAttribute(context, category, "gapWidth") }
31830
31830
  );
31831
- const value = cxChild(axis, "valScaling");
31831
+ const value = cxChild(axis2, "valScaling");
31832
31832
  if (!value) return void 0;
31833
31833
  return assignDefined(
31834
31834
  { kind: "val" },
@@ -32039,9 +32039,9 @@ function parseSeries2(context, element4) {
32039
32039
  const labels = cxChild(element4, "dataLabels");
32040
32040
  const inline = cxChild(element4, "data");
32041
32041
  const layout2 = cxChild(element4, "layoutPr");
32042
- const axisIds = cxChildren(element4, "axisId").map((axis) => indexAttribute(context, axis, "val")).filter((id) => id !== void 0);
32042
+ const axisIds2 = cxChildren(element4, "axisId").map((axis2) => indexAttribute(context, axis2, "val")).filter((id) => id !== void 0);
32043
32043
  return assignDefined(
32044
- { layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds },
32044
+ { layoutId: attribute(element4, "layoutId") ?? "", dataPoints, axisIds: axisIds2 },
32045
32045
  {
32046
32046
  hidden: boolAttribute(context, element4, "hidden"),
32047
32047
  ownerIndex: numberAttribute(context, element4, "ownerIdx"),
@@ -32083,7 +32083,7 @@ function parsePlotArea2(context, element4) {
32083
32083
  const regionExtLst = extensionList2(region);
32084
32084
  if (regionExtLst) out.regionExtLst = regionExtLst;
32085
32085
  }
32086
- out.axes = cxChildren(element4, "axis").map((axis) => parseAxis2(context, axis));
32086
+ out.axes = cxChildren(element4, "axis").map((axis2) => parseAxis2(context, axis2));
32087
32087
  return assignDefined(out, { spPr: shapeProperties2(element4), extLst: extensionList2(element4) });
32088
32088
  }
32089
32089
  function namespaceDeclarations2(root) {
@@ -32334,19 +32334,19 @@ function scalingXml(scaling) {
32334
32334
  );
32335
32335
  }
32336
32336
  var tickMarksXml = (local, marks) => marks ? cxElement(local, "", attributes([["type", marks.type]])) : "";
32337
- function axisXml2(context, axis) {
32338
- const units2 = axis.units;
32337
+ function axisXml2(context, axis2) {
32338
+ const units2 = axis2.units;
32339
32339
  const gridlines = (local, value) => value ? cxElement(local, shapeXml(context, value.spPr)) : "";
32340
32340
  return cxElement(
32341
32341
  "axis",
32342
- scalingXml(axis.scaling) + titleXml2(context, axis.title) + (units2 ? cxElement(
32342
+ scalingXml(axis2.scaling) + titleXml2(context, axis2.title) + (units2 ? cxElement(
32343
32343
  "units",
32344
32344
  titleXml2(context, units2.label, "unitsLabel") + raw(context, units2.extLst),
32345
32345
  attributes([["unit", units2.unit]])
32346
- ) : "") + 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),
32346
+ ) : "") + 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),
32347
32347
  attributes([
32348
- ["id", axis.id],
32349
- ["hidden", axis.hidden]
32348
+ ["id", axis2.id],
32349
+ ["hidden", axis2.hidden]
32350
32350
  ])
32351
32351
  );
32352
32352
  }
@@ -32381,7 +32381,7 @@ function writeChartExSpace(space, options2 = {}) {
32381
32381
  );
32382
32382
  const plotArea = cxElement(
32383
32383
  "plotArea",
32384
- region + plot.axes.map((axis) => axisXml2(context, axis)).join("") + shapeXml(context, plot.spPr) + raw(context, plot.extLst)
32384
+ region + plot.axes.map((axis2) => axisXml2(context, axis2)).join("") + shapeXml(context, plot.spPr) + raw(context, plot.extLst)
32385
32385
  );
32386
32386
  const legend = space.legend;
32387
32387
  const legendXml2 = legend ? cxElement(
@@ -34016,8 +34016,8 @@ function chartSummarySeries(source2, chartType, groupLabels, groupSmooth) {
34016
34016
  Object.assign(out, summaryAnalysis(source2));
34017
34017
  return out;
34018
34018
  }
34019
- function valueAxisId(chartSpace, axisIds) {
34020
- return axisIds.find(
34019
+ function valueAxisId(chartSpace, axisIds2) {
34020
+ return axisIds2.find(
34021
34021
  (id) => chartSpace.plotArea.axes.some((a2) => a2.id === id && a2.kind === "val")
34022
34022
  );
34023
34023
  }
@@ -34508,35 +34508,35 @@ function chartExSummaryFromModel(space) {
34508
34508
  showLegend: legend !== void 0
34509
34509
  };
34510
34510
  if (chartType === "boxWhisker") {
34511
- summary.axes = space.plotArea.axes.flatMap((axis) => {
34512
- const scaling = axis.scaling;
34511
+ summary.axes = space.plotArea.axes.flatMap((axis2) => {
34512
+ const scaling = axis2.scaling;
34513
34513
  if (!scaling) return [];
34514
34514
  const value = scaling.kind === "val";
34515
34515
  return [
34516
34516
  {
34517
34517
  kind: value ? "val" : "cat",
34518
- ...axis.id === void 0 ? {} : { id: axis.id },
34518
+ ...axis2.id === void 0 ? {} : { id: axis2.id },
34519
34519
  position: value ? "l" : "b",
34520
- deleted: axis.hidden ?? false,
34520
+ deleted: axis2.hidden ?? false,
34521
34521
  scaling: {
34522
34522
  ...value && typeof scaling.min === "number" ? { min: scaling.min } : {},
34523
34523
  ...value && typeof scaling.max === "number" ? { max: scaling.max } : {}
34524
34524
  },
34525
- majorGridlines: !!axis.majorGridlines,
34526
- minorGridlines: !!axis.minorGridlines,
34527
- ...axis.majorGridlines?.spPr ? { majorGridlinesSpPr: axis.majorGridlines.spPr } : {},
34528
- ...axis.minorGridlines?.spPr ? { minorGridlinesSpPr: axis.minorGridlines.spPr } : {},
34525
+ majorGridlines: !!axis2.majorGridlines,
34526
+ minorGridlines: !!axis2.minorGridlines,
34527
+ ...axis2.majorGridlines?.spPr ? { majorGridlinesSpPr: axis2.majorGridlines.spPr } : {},
34528
+ ...axis2.minorGridlines?.spPr ? { minorGridlinesSpPr: axis2.minorGridlines.spPr } : {},
34529
34529
  ...value && typeof scaling.majorUnit === "number" ? { majorUnit: scaling.majorUnit } : {},
34530
34530
  ...value && typeof scaling.minorUnit === "number" ? { minorUnit: scaling.minorUnit } : {},
34531
- ...axis.spPr ? { spPr: axis.spPr } : {},
34532
- ...axis.numberFormat ? { numberFormat: axis.numberFormat } : {},
34533
- ...axis.tickLabels ? {} : { tickLabelPosition: "none" }
34531
+ ...axis2.spPr ? { spPr: axis2.spPr } : {},
34532
+ ...axis2.numberFormat ? { numberFormat: axis2.numberFormat } : {},
34533
+ ...axis2.tickLabels ? {} : { tickLabelPosition: "none" }
34534
34534
  }
34535
34535
  ];
34536
34536
  });
34537
34537
  }
34538
34538
  if (chartType === "funnel") {
34539
- const cat = space.plotArea.axes.find((axis) => axis.scaling?.kind === "cat")?.scaling;
34539
+ const cat = space.plotArea.axes.find((axis2) => axis2.scaling?.kind === "cat")?.scaling;
34540
34540
  if (cat?.kind === "cat" && typeof cat.gapWidth === "number")
34541
34541
  summary.funnelGapWidth = cat.gapWidth;
34542
34542
  }
@@ -35474,44 +35474,44 @@ function formatDate(date, unit, format) {
35474
35474
 
35475
35475
  // chart/render/chart-svg-date-axis.ts
35476
35476
  function chartDateAxis(model, plot, out) {
35477
- const axis = model.axes?.category?.source;
35477
+ const axis2 = model.axes?.category?.source;
35478
35478
  const values = model.dateCategories;
35479
- if (axis?.kind !== "date" || !values?.length) return void 0;
35479
+ if (axis2?.kind !== "date" || !values?.length) return void 0;
35480
35480
  const points3 = values.flatMap(
35481
35481
  (value, index) => value === null || !Number.isFinite(value) ? [] : [{ value, index }]
35482
35482
  ).sort((a2, b) => a2.value - b.value);
35483
35483
  if (!points3.length) return void 0;
35484
- const min = axis.scaling.min ?? points3[0].value;
35485
- const max = axis.scaling.max ?? points3.at(-1).value;
35484
+ const min = axis2.scaling.min ?? points3[0].value;
35485
+ const max = axis2.scaling.max ?? points3.at(-1).value;
35486
35486
  if (!Number.isFinite(min) || !Number.isFinite(max) || max < min) return void 0;
35487
35487
  const position2 = (value) => {
35488
35488
  const ratio = max === min ? 0.5 : (value - min) / (max - min);
35489
- const t = axis.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
35489
+ const t = axis2.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
35490
35490
  return model.horizontal ? plot.y + plot.h * (1 - t) : plot.x + plot.w * t;
35491
35491
  };
35492
35492
  const visible = points3.filter((p2) => p2.value >= min && p2.value <= max);
35493
35493
  const unitOf = (unit2) => unit2 === "months" || unit2 === "years" ? unit2 : "days";
35494
- const unit = unitOf(axis.majorTimeUnit ?? axis.baseTimeUnit);
35494
+ const unit = unitOf(axis2.majorTimeUnit ?? axis2.baseTimeUnit);
35495
35495
  const ticks = calendarTicks(
35496
35496
  min,
35497
35497
  max,
35498
35498
  model.date1904 ?? false,
35499
35499
  unit,
35500
- Math.max(1, axis.majorUnit ?? 1)
35500
+ Math.max(1, axis2.majorUnit ?? 1)
35501
35501
  );
35502
35502
  const attrs3 = chartTextAttributes(model, "categoryAxis");
35503
35503
  const size = attrs3.size ?? 10;
35504
- const y = axis.position === "t" ? plot.y : plot.y + plot.h;
35504
+ const y = axis2.position === "t" ? plot.y : plot.y + plot.h;
35505
35505
  const paint2 = model.axes?.category?.line;
35506
35506
  const stroke = { color: paint2?.color ?? "#BFBFBF", width: paint2?.width ?? 1 };
35507
35507
  const mark = (serial, placement, length) => {
35508
- if (!placement || placement === "none" || axis.deleted) return;
35509
- const inward = axis.position === "t" ? length : -length;
35508
+ if (!placement || placement === "none" || axis2.deleted) return;
35509
+ const inward = axis2.position === "t" ? length : -length;
35510
35510
  const start = placement === "cross" ? -length : 0;
35511
35511
  const end = placement === "cross" ? length : placement === "in" ? inward : -inward;
35512
35512
  if (model.horizontal) {
35513
- const x = axis.position === "r" ? plot.x + plot.w : plot.x;
35514
- const direction = axis.position === "r" ? -1 : 1;
35513
+ const x = axis2.position === "r" ? plot.x + plot.w : plot.x;
35514
+ const direction = axis2.position === "r" ? -1 : 1;
35515
35515
  const a2 = placement === "cross" ? -length : 0;
35516
35516
  const b = placement === "cross" ? length : placement === "in" ? direction * length : -direction * length;
35517
35517
  out.push(
@@ -35523,19 +35523,19 @@ function chartDateAxis(model, plot, out) {
35523
35523
  );
35524
35524
  };
35525
35525
  ticks.forEach((serial, index) => {
35526
- if (index % Math.max(1, axis.tickMarkSkip ?? 1) === 0) mark(serial, axis.majorTickMark, 4);
35527
- if (axis.deleted || model.dataTable || axis.tickLabelPosition === "none" || index % Math.max(1, axis.tickLabelSkip ?? 1))
35526
+ if (index % Math.max(1, axis2.tickMarkSkip ?? 1) === 0) mark(serial, axis2.majorTickMark, 4);
35527
+ if (axis2.deleted || model.dataTable || axis2.tickLabelPosition === "none" || index % Math.max(1, axis2.tickLabelSkip ?? 1))
35528
35528
  return;
35529
35529
  const label = formatDate(
35530
35530
  excelSerialToDate(serial, model.date1904),
35531
35531
  unit,
35532
- axis.numberFormat?.formatCode
35532
+ axis2.numberFormat?.formatCode
35533
35533
  );
35534
35534
  if (model.horizontal)
35535
35535
  out.push(text(plot.x - 4, position2(serial) + size * 0.3, label, { ...attrs3, anchor: "end" }));
35536
35536
  else {
35537
- const above = axis.tickLabelPosition === "high" || axis.tickLabelPosition !== "low" && axis.position === "t";
35538
- const baseline = axis.tickLabelPosition === "high" ? plot.y : axis.tickLabelPosition === "low" ? plot.y + plot.h : y;
35537
+ const above = axis2.tickLabelPosition === "high" || axis2.tickLabelPosition !== "low" && axis2.position === "t";
35538
+ const baseline = axis2.tickLabelPosition === "high" ? plot.y : axis2.tickLabelPosition === "low" ? plot.y + plot.h : y;
35539
35539
  out.push(
35540
35540
  text(position2(serial), baseline + (above ? -4 : size + 3), label, {
35541
35541
  ...attrs3,
@@ -35544,15 +35544,15 @@ function chartDateAxis(model, plot, out) {
35544
35544
  );
35545
35545
  }
35546
35546
  });
35547
- if (axis.minorTickMark && axis.minorTickMark !== "none")
35547
+ if (axis2.minorTickMark && axis2.minorTickMark !== "none")
35548
35548
  for (const serial of calendarTicks(
35549
35549
  min,
35550
35550
  max,
35551
35551
  model.date1904 ?? false,
35552
- unitOf(axis.minorTimeUnit ?? axis.baseTimeUnit ?? unit),
35553
- Math.max(1, axis.minorUnit ?? 1)
35552
+ unitOf(axis2.minorTimeUnit ?? axis2.baseTimeUnit ?? unit),
35553
+ Math.max(1, axis2.minorUnit ?? 1)
35554
35554
  ))
35555
- mark(serial, axis.minorTickMark, 2.5);
35555
+ mark(serial, axis2.minorTickMark, 2.5);
35556
35556
  return {
35557
35557
  order: visible.map((p2) => p2.index),
35558
35558
  band: (index) => position2(values[index] ?? min),
@@ -35673,12 +35673,12 @@ function chartLineDashArray(style, width) {
35673
35673
  }
35674
35674
 
35675
35675
  // chart/render/chart-svg-axes.ts
35676
- function axisTickText(value, axis, percent = false) {
35677
- return formatChartNumber(value, axis?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
35676
+ function axisTickText(value, axis2, percent = false) {
35677
+ return formatChartNumber(value, axis2?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
35678
35678
  }
35679
- function axisLine(model, axis, part, x1, y1, x2, y2) {
35680
- if (axis?.source.deleted) return "";
35681
- return styledAxisLine(x1, y1, x2, y2, axis?.line, chartStroke(model, part));
35679
+ function axisLine(model, axis2, part, x1, y1, x2, y2) {
35680
+ if (axis2?.source.deleted) return "";
35681
+ return styledAxisLine(x1, y1, x2, y2, axis2?.line, chartStroke(model, part));
35682
35682
  }
35683
35683
  function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
35684
35684
  const color = paint2?.color ?? fallback.color;
@@ -35690,7 +35690,7 @@ function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
35690
35690
  dash ? ` stroke-dasharray="${dash}"/>` : "/>"
35691
35691
  );
35692
35692
  }
35693
- function axisGridlines(model, axis, ticks, position2, plot, vertical) {
35693
+ function axisGridlines(model, axis2, ticks, position2, plot, vertical) {
35694
35694
  const draw2 = (values, paint2, minor2) => {
35695
35695
  const fallback = chartStroke(model, minor2 ? "gridlineMinor" : "gridlineMajor");
35696
35696
  return values.map((value) => {
@@ -35698,8 +35698,8 @@ function axisGridlines(model, axis, ticks, position2, plot, vertical) {
35698
35698
  return vertical ? styledAxisLine(p2, plot.y, p2, plot.y + plot.h, paint2, fallback) : styledAxisLine(plot.x, p2, plot.x + plot.w, p2, paint2, fallback);
35699
35699
  }).join("");
35700
35700
  };
35701
- const major = !axis || axis.source.majorGridlines ? draw2(ticks, axis?.majorGrid, false) : "";
35702
- const minor = axis?.source.minorGridlines ? draw2(axis.minorTicks, axis.minorGrid, true) : "";
35701
+ const major = !axis2 || axis2.source.majorGridlines ? draw2(ticks, axis2?.majorGrid, false) : "";
35702
+ const minor = axis2?.source.minorGridlines ? draw2(axis2.minorTicks, axis2.minorGrid, true) : "";
35703
35703
  return major + minor;
35704
35704
  }
35705
35705
 
@@ -35722,9 +35722,9 @@ function computeLogValueRange(series2, logBase) {
35722
35722
  logBase
35723
35723
  };
35724
35724
  }
35725
- function withAxisBounds(automatic, axis, logBase) {
35726
- const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
35727
- const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
35725
+ function withAxisBounds(automatic, axis2, logBase) {
35726
+ const validMin = typeof axis2?.min === "number" && Number.isFinite(axis2.min) && (!logBase || axis2.min > 0) ? axis2.min : void 0;
35727
+ const validMax = typeof axis2?.max === "number" && Number.isFinite(axis2.max) && (!logBase || axis2.max > 0) ? axis2.max : void 0;
35728
35728
  const min = validMin ?? automatic.min;
35729
35729
  let max = validMax ?? automatic.max;
35730
35730
  const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
@@ -35738,7 +35738,7 @@ function withAxisBounds(automatic, axis, logBase) {
35738
35738
  span: Math.max(span, Number.EPSILON),
35739
35739
  ...majorUnit !== void 0 ? { majorUnit } : {},
35740
35740
  ...logBase ? { logScale: true, logBase } : {},
35741
- ...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
35741
+ ...axis2?.orientation === "maxMin" ? { reverseOrder: true } : {}
35742
35742
  };
35743
35743
  }
35744
35744
 
@@ -35771,11 +35771,11 @@ function generateIntervalTicks(range2, unit) {
35771
35771
  const count = Math.min(Math.max(last - first3 + 1, 0), 2e3);
35772
35772
  return Array.from({ length: count }, (_, index) => (first3 + index) * unit);
35773
35773
  }
35774
- function generateAxisTicks(range2, axis, defaultIntervals) {
35774
+ function generateAxisTicks(range2, axis2, defaultIntervals) {
35775
35775
  if (range2.logScale && range2.logBase) {
35776
35776
  return generateLogTicks(range2);
35777
35777
  }
35778
- const explicit = generateIntervalTicks(range2, axis?.majorUnit ?? 0);
35778
+ const explicit = generateIntervalTicks(range2, axis2?.majorUnit ?? 0);
35779
35779
  if (explicit.length > 0) {
35780
35780
  return explicit;
35781
35781
  }
@@ -35788,12 +35788,12 @@ function generateAxisTicks(range2, axis, defaultIntervals) {
35788
35788
  (_, index) => range2.min + range2.span / defaultIntervals * index
35789
35789
  );
35790
35790
  }
35791
- function generateMinorAxisTicks(range2, axis) {
35792
- const minor = generateIntervalTicks(range2, axis?.minorUnit ?? 0);
35791
+ function generateMinorAxisTicks(range2, axis2) {
35792
+ const minor = generateIntervalTicks(range2, axis2?.minorUnit ?? 0);
35793
35793
  if (minor.length === 0) {
35794
35794
  return [];
35795
35795
  }
35796
- const majorUnit = axis?.majorUnit;
35796
+ const majorUnit = axis2?.majorUnit;
35797
35797
  if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
35798
35798
  return minor;
35799
35799
  }
@@ -35804,33 +35804,33 @@ function generateMinorAxisTicks(range2, axis) {
35804
35804
  }
35805
35805
 
35806
35806
  // chart/render/chart-view-axes.ts
35807
- function chartAxisRatio(value, scale, axis) {
35808
- const range2 = axis?.range;
35807
+ function chartAxisRatio(value, scale, axis2) {
35808
+ const range2 = axis2?.range;
35809
35809
  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);
35810
35810
  return range2?.reverseOrder ? 1 - ratio : ratio;
35811
35811
  }
35812
- function chartAxisLabels(axis) {
35813
- return axis?.source.deleted !== true && axis?.source.tickLabelPosition !== "none";
35812
+ function chartAxisLabels(axis2) {
35813
+ return axis2?.source.deleted !== true && axis2?.source.tickLabelPosition !== "none";
35814
35814
  }
35815
- function options(axis) {
35815
+ function options(axis2) {
35816
35816
  return {
35817
- ...axis.scaling,
35818
- ...axis.scaling.logBase === void 0 ? {} : { logScale: true },
35819
- ...axis.majorUnit === void 0 ? {} : { majorUnit: axis.majorUnit },
35820
- ...axis.minorUnit === void 0 ? {} : { minorUnit: axis.minorUnit }
35817
+ ...axis2.scaling,
35818
+ ...axis2.scaling.logBase === void 0 ? {} : { logScale: true },
35819
+ ...axis2.majorUnit === void 0 ? {} : { majorUnit: axis2.majorUnit },
35820
+ ...axis2.minorUnit === void 0 ? {} : { minorUnit: axis2.minorUnit }
35821
35821
  };
35822
35822
  }
35823
35823
  function applyChartAxes(model, chart, color) {
35824
35824
  if (!chart.axes?.length) return;
35825
35825
  const axes = chart.axes;
35826
- const linked = axes.filter((axis) => axis.id !== void 0 && chart.axisIds?.includes(axis.id));
35826
+ const linked = axes.filter((axis2) => axis2.id !== void 0 && chart.axisIds?.includes(axis2.id));
35827
35827
  const candidates = linked.length ? linked : axes;
35828
35828
  const xy = model.type === "scatter" || model.type === "bubble";
35829
- const value = candidates.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates.find((axis) => axis.kind === "val");
35829
+ const value = candidates.find((axis2) => axis2.kind === "val" && !["b", "t"].includes(axis2.position ?? "")) ?? candidates.find((axis2) => axis2.kind === "val");
35830
35830
  const category = candidates.find(
35831
- (axis) => xy ? axis.kind === "val" && axis !== value : axis.kind === "cat" || axis.kind === "date"
35831
+ (axis2) => xy ? axis2.kind === "val" && axis2 !== value : axis2.kind === "cat" || axis2.kind === "date"
35832
35832
  );
35833
- const secondary = axes.find((axis) => axis.kind === "val" && axis !== value && axis !== category);
35833
+ const secondary = axes.find((axis2) => axis2.kind === "val" && axis2 !== value && axis2 !== category);
35834
35834
  const paint2 = (shape2) => {
35835
35835
  const ln = shape2?.line;
35836
35836
  const fill = ln?.fill;
@@ -35841,8 +35841,8 @@ function applyChartAxes(model, chart, color) {
35841
35841
  ...ln?.dash === void 0 ? {} : { dash: ln.dash }
35842
35842
  };
35843
35843
  };
35844
- const bind = (axis, scale, values) => {
35845
- const opts = options(axis);
35844
+ const bind = (axis2, scale, values) => {
35845
+ const opts = options(axis2);
35846
35846
  const automatic = opts.logScale ? computeLogValueRange(
35847
35847
  [{ values: values ?? [] }],
35848
35848
  opts.logBase && Number.isFinite(opts.logBase) && opts.logBase > 1 ? opts.logBase : 10
@@ -35860,12 +35860,12 @@ function applyChartAxes(model, chart, color) {
35860
35860
  scale.ticks = generateAxisTicks(range2, opts, 5);
35861
35861
  }
35862
35862
  return {
35863
- source: axis,
35863
+ source: axis2,
35864
35864
  range: range2,
35865
35865
  minorTicks: generateMinorAxisTicks(range2, opts),
35866
- line: paint2(axis.spPr),
35867
- majorGrid: paint2(axis.majorGridlinesSpPr),
35868
- minorGrid: paint2(axis.minorGridlinesSpPr)
35866
+ line: paint2(axis2.spPr),
35867
+ majorGrid: paint2(axis2.majorGridlinesSpPr),
35868
+ minorGrid: paint2(axis2.minorGridlinesSpPr)
35869
35869
  };
35870
35870
  };
35871
35871
  const out = {};
@@ -38152,13 +38152,13 @@ function scatter(model, area, out, size) {
38152
38152
  s.values.forEach((_, i2) => {
38153
38153
  reach = Math.max(reach, radiusOf(s.sizes?.[i2] ?? void 0) ?? 0);
38154
38154
  });
38155
- const widen = (s, length, axis) => {
38156
- if (axis?.range.logScale) return s;
38155
+ const widen = (s, length, axis2) => {
38156
+ if (axis2?.range.logScale) return s;
38157
38157
  const pad4 = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
38158
38158
  return {
38159
38159
  ...s,
38160
- min: axis?.source.scaling.min === void 0 ? s.min - pad4 : s.min,
38161
- max: axis?.source.scaling.max === void 0 ? s.max + pad4 : s.max
38160
+ min: axis2?.source.scaling.min === void 0 ? s.min - pad4 : s.min,
38161
+ max: axis2?.source.scaling.max === void 0 ? s.max + pad4 : s.max
38162
38162
  };
38163
38163
  };
38164
38164
  const xView = widen(xs, plot.w, model.axes?.category);
@@ -39491,9 +39491,9 @@ var CATEGORY_ONLY = [
39491
39491
  "minorTimeUnit"
39492
39492
  ];
39493
39493
  var VALUE_ONLY = ["crossBetween", "displayUnits"];
39494
- function convertChartAxis(axis, kind) {
39495
- if (axis.kind === kind) return axis;
39496
- const next = structuredClone(axis);
39494
+ function convertChartAxis(axis2, kind) {
39495
+ if (axis2.kind === kind) return axis2;
39496
+ const next = structuredClone(axis2);
39497
39497
  next.kind = kind;
39498
39498
  if (kind === "val") {
39499
39499
  for (const key of CATEGORY_ONLY) delete next[key];
@@ -39526,7 +39526,7 @@ var SWITCHABLE = {
39526
39526
  stock: false,
39527
39527
  surface: true
39528
39528
  };
39529
- function elementFor(kind, is3D) {
39529
+ function chartGroupElement(kind, is3D) {
39530
39530
  const match = Object.entries(CHART_GROUP_ELEMENTS).find(
39531
39531
  ([, value]) => value.kind === kind && value.is3D === is3D
39532
39532
  );
@@ -39542,7 +39542,7 @@ function groupingFor(element4, grouping) {
39542
39542
  var horizontalBars = (group3) => group3.kind === "bar" && group3.barDirection === "bar";
39543
39543
  function newGroup(base, target, series2) {
39544
39544
  const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
39545
- const element4 = elementFor(target.kind, is3D);
39545
+ const element4 = chartGroupElement(target.kind, is3D);
39546
39546
  const group3 = { kind: target.kind, element: element4, is3D, series: series2, axisIds: [] };
39547
39547
  const allowed = GROUP_FIELDS[element4] ?? [];
39548
39548
  for (const key of allowed)
@@ -39568,11 +39568,11 @@ function newGroup(base, target, series2) {
39568
39568
  return group3;
39569
39569
  }
39570
39570
  function withSeriesAxis(space, group3, axes) {
39571
- if ((group3.element === "line3DChart" || group3.kind === "surface") && !axes.some((axis) => axis.kind === "ser")) {
39571
+ if ((group3.element === "line3DChart" || group3.kind === "surface") && !axes.some((axis2) => axis2.kind === "ser")) {
39572
39572
  const id = Math.max(
39573
39573
  0,
39574
39574
  ...[...space.plotArea.axes, ...axes].flatMap(
39575
- (axis) => axis.id === void 0 ? [] : [axis.id]
39575
+ (axis2) => axis2.id === void 0 ? [] : [axis2.id]
39576
39576
  )
39577
39577
  ) + 1;
39578
39578
  axes.push({
@@ -39592,11 +39592,11 @@ function withSeriesAxis(space, group3, axes) {
39592
39592
  function groupAxes(space, base, group3) {
39593
39593
  if (!groupHasAxes(group3.element)) return [];
39594
39594
  const xy = isXYChartKind(group3.kind);
39595
- const byId = (id) => space.plotArea.axes.find((axis) => axis.id === id);
39596
- const old = base.axisIds.map(byId).filter((axis) => axis !== void 0);
39595
+ const byId = (id) => space.plotArea.axes.find((axis2) => axis2.id === id);
39596
+ const old = base.axisIds.map(byId).filter((axis2) => axis2 !== void 0);
39597
39597
  if (old.length < 2) {
39598
39598
  const taken = new Set(
39599
- space.plotArea.axes.flatMap((axis) => axis.id === void 0 ? [] : [axis.id])
39599
+ space.plotArea.axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id])
39600
39600
  );
39601
39601
  const free = DEFAULT_CHART_AXIS_IDS.every((id) => !taken.has(id));
39602
39602
  const top = Math.max(0, ...taken);
@@ -39604,9 +39604,9 @@ function groupAxes(space, base, group3) {
39604
39604
  return withSeriesAxis(space, group3, defaultChartAxes(horizontalBars(group3), xy, ids));
39605
39605
  }
39606
39606
  const rotate2 = horizontalBars(base) !== horizontalBars(group3);
39607
- const axes = old.slice(0, group3.element === "line3DChart" || group3.is3D ? 3 : 2).map((axis, i2) => {
39608
- const kind = i2 === 0 ? xy ? "val" : axis.kind === "val" ? "cat" : axis.kind : axis.kind;
39609
- const next = convertChartAxis(axis, kind);
39607
+ const axes = old.slice(0, group3.element === "line3DChart" || group3.is3D ? 3 : 2).map((axis2, i2) => {
39608
+ const kind = i2 === 0 ? xy ? "val" : axis2.kind === "val" ? "cat" : axis2.kind : axis2.kind;
39609
+ const next = convertChartAxis(axis2, kind);
39610
39610
  if (rotate2) assignOrDelete(next, "position", rotatedAxisPosition(next.position));
39611
39611
  if (i2 === 1 && next.kind === "val" && xy !== isXYChartKind(base.kind))
39612
39612
  next.crossBetween = xy ? "midCat" : "between";
@@ -39631,7 +39631,7 @@ function setChartType(space, target) {
39631
39631
  if (group3.is3D && target.kind === "bar" && group3.grouping === "standard" && base.axisIds.length < 3)
39632
39632
  group3.grouping = "clustered";
39633
39633
  const axes = groupAxes(draft, base, group3);
39634
- group3.axisIds = axes.flatMap((axis) => axis.id === void 0 ? [] : [axis.id]);
39634
+ group3.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
39635
39635
  draft.plotArea.groups = [group3];
39636
39636
  draft.plotArea.axes = axes;
39637
39637
  if (!group3.is3D) {
@@ -39644,6 +39644,20 @@ function setChartType(space, target) {
39644
39644
  });
39645
39645
  }
39646
39646
 
39647
+ // chart/edit/group-options.ts
39648
+ var RANGES = {
39649
+ gapWidth: [0, 500],
39650
+ overlap: [-100, 100],
39651
+ firstSliceAngle: [0, 360],
39652
+ holeSize: [1, 90]
39653
+ };
39654
+ var isChartGroupOption = (key) => Object.hasOwn(RANGES, key);
39655
+ function assertChartGroupOption(key, value) {
39656
+ const [min, max] = RANGES[key];
39657
+ if (!Number.isInteger(value) || value < min || value > max)
39658
+ throw new RangeError(`Chart ${key} must be a whole number from ${min} to ${max}`);
39659
+ }
39660
+
39647
39661
  // chart/edit/data-sheet.ts
39648
39662
  function chartSpaceDataSheet(space) {
39649
39663
  const entries = chartSeriesEntries(space);
@@ -39722,6 +39736,58 @@ function applyChartSpaceDataSheetEdits(space, edits) {
39722
39736
  return editChartSpace(next, (draft) => applyStandardChartLayout(draft, layoutSheet, count));
39723
39737
  }
39724
39738
 
39739
+ // chart/edit/new-chart-minimal.ts
39740
+ var VARIED = /* @__PURE__ */ new Set(["pie", "doughnut", "ofPie"]);
39741
+ function schemaGrouping(element4, grouping) {
39742
+ const bar = element4 === "barChart" || element4 === "bar3DChart";
39743
+ if (bar) return grouping ?? "clustered";
39744
+ return grouping === void 0 || grouping === "clustered" ? "standard" : grouping;
39745
+ }
39746
+ function minimalChartGroup(target, series2) {
39747
+ const is3D = target.is3D ?? false;
39748
+ const element4 = chartGroupElement(target.kind, is3D);
39749
+ const allowed = GROUP_FIELDS[element4] ?? [];
39750
+ const own2 = isXYChartKind(target.kind) ? series2.map((item2) => stripSeriesForKind(item2, "bar", target.kind)) : series2;
39751
+ const group3 = { kind: target.kind, element: element4, is3D, series: own2, axisIds: [] };
39752
+ if (target.kind === "bar") group3.barDirection = target.barDirection ?? "col";
39753
+ if (allowed.includes("grouping")) group3.grouping = schemaGrouping(element4, target.grouping);
39754
+ if (allowed.includes("varyColors")) group3.varyColors = VARIED.has(target.kind);
39755
+ if (target.kind === "ofPie") group3.ofPieType = "pie";
39756
+ if (target.kind === "scatter") group3.scatterStyle = "lineMarker";
39757
+ if (target.kind === "radar") group3.radarStyle = "marker";
39758
+ return group3;
39759
+ }
39760
+ function axis(kind, id, crossAxisId, position2) {
39761
+ return {
39762
+ kind,
39763
+ id,
39764
+ crossAxisId,
39765
+ position: position2,
39766
+ scaling: { orientation: "minMax" },
39767
+ deleted: false,
39768
+ majorGridlines: false,
39769
+ minorGridlines: false
39770
+ };
39771
+ }
39772
+ function minimalChartAxes(group3, ids) {
39773
+ if (!groupHasAxes(group3.element)) return [];
39774
+ const [first3, second, third] = ids;
39775
+ const horizontal = group3.kind === "bar" && group3.barDirection === "bar";
39776
+ const axes = [
39777
+ axis(isXYChartKind(group3.kind) ? "val" : "cat", first3, second, horizontal ? "l" : "b"),
39778
+ axis("val", second, first3, horizontal ? "b" : "l")
39779
+ ];
39780
+ if (group3.element === "line3DChart" || group3.kind === "surface")
39781
+ axes.push(axis("ser", third, second, "b"));
39782
+ return axes;
39783
+ }
39784
+ function minimalChartTitle(text2) {
39785
+ const rich = chartTextBodyFromXml(
39786
+ `<a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${escapeText2(text2)}</a:t></a:r></a:p>`
39787
+ );
39788
+ return { tx: { rich, text: rich.text }, text: rich.text, overlay: false };
39789
+ }
39790
+
39725
39791
  // chart/edit/new-chart.ts
39726
39792
  var DEFAULT_CHART_DATA_SHEET = {
39727
39793
  categories: ["Category 1", "Category 2", "Category 3", "Category 4"],
@@ -39731,21 +39797,84 @@ var DEFAULT_CHART_DATA_SHEET = {
39731
39797
  { name: "Series 3", values: [2, 2, 3, 5] }
39732
39798
  ]
39733
39799
  };
39734
- function series(sheet, index, sheetName) {
39800
+ var CATEGORY_ONLY2 = [
39801
+ "labelAlign",
39802
+ "noMultiLevelLabels",
39803
+ "tickLabelSkip",
39804
+ "tickMarkSkip"
39805
+ ];
39806
+ function withDateAxis(space) {
39807
+ return editChartSpace(space, (draft) => {
39808
+ const axis2 = draft.plotArea.axes[0];
39809
+ if (axis2?.kind !== "cat") return;
39810
+ axis2.kind = "date";
39811
+ for (const key of CATEGORY_ONLY2) delete axis2[key];
39812
+ });
39813
+ }
39814
+ function series(sheet, index, options2, sheetName) {
39735
39815
  const entry2 = sheet.series[index];
39816
+ if (options2.data === "literal")
39817
+ return {
39818
+ index,
39819
+ order: index,
39820
+ tx: { value: entry2.name, text: entry2.name },
39821
+ ...options2.profile === "minimal" ? {} : { invertIfNegative: false },
39822
+ dataPoints: [],
39823
+ categories: categorySource(sheet.categories, void 0),
39824
+ values: numberSource(entry2.values, void 0)
39825
+ };
39736
39826
  const formulas = standardChartFormulas(sheetName, index, sheet.categories.length);
39737
39827
  return {
39738
39828
  index,
39739
39829
  order: index,
39740
39830
  tx: { reference: categorySource([entry2.name], void 0, formulas.name), text: entry2.name },
39741
- invertIfNegative: false,
39831
+ ...options2.profile === "minimal" ? {} : { invertIfNegative: false },
39742
39832
  dataPoints: [],
39743
39833
  categories: categorySource(sheet.categories, void 0, formulas.categories),
39744
39834
  values: numberSource(entry2.values, void 0, formulas.values)
39745
39835
  };
39746
39836
  }
39747
- function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {}) {
39748
- const sheetName = options2.sheetName ?? DEFAULT_CHART_SHEET_NAME;
39837
+ function axisIds(options2) {
39838
+ const ids = options2.axisIds ?? [];
39839
+ const [first3, second, third] = [
39840
+ ids[0] ?? DEFAULT_CHART_AXIS_IDS[0],
39841
+ ids[1] ?? DEFAULT_CHART_AXIS_IDS[1],
39842
+ ids[2] ?? DEFAULT_CHART_AXIS_IDS[1] + 1
39843
+ ];
39844
+ for (const id of [first3, second, third])
39845
+ if (!Number.isSafeInteger(id) || id < 0)
39846
+ throw new RangeError("Chart axis ids must be non-negative whole numbers");
39847
+ if ((/* @__PURE__ */ new Set([first3, second, third])).size !== 3)
39848
+ throw new RangeError("Chart axis ids must differ");
39849
+ return [first3, second, third];
39850
+ }
39851
+ function withAxisIds(space, ids) {
39852
+ return editChartSpace(space, (draft) => {
39853
+ const map = /* @__PURE__ */ new Map();
39854
+ draft.plotArea.axes.forEach((axis2, position2) => {
39855
+ if (axis2.id !== void 0 && ids[position2] !== void 0) map.set(axis2.id, ids[position2]);
39856
+ });
39857
+ const renumber = (id) => map.get(id) ?? id;
39858
+ for (const axis2 of draft.plotArea.axes) {
39859
+ if (axis2.id !== void 0) axis2.id = renumber(axis2.id);
39860
+ if (axis2.crossAxisId !== void 0) axis2.crossAxisId = renumber(axis2.crossAxisId);
39861
+ }
39862
+ for (const group3 of draft.plotArea.groups) group3.axisIds = group3.axisIds.map(renumber);
39863
+ });
39864
+ }
39865
+ function withGroupSettings(space, settings) {
39866
+ return editChartSpace(space, (draft) => {
39867
+ const group3 = draft.plotArea.groups[0];
39868
+ const allowed = GROUP_FIELDS[group3.element] ?? [];
39869
+ for (const [key, value] of Object.entries(settings)) {
39870
+ if (value === void 0) continue;
39871
+ if (!allowed.includes(key)) throw new RangeError(`A ${group3.element} has no ${key} setting`);
39872
+ if (isChartGroupOption(key)) assertChartGroupOption(key, value);
39873
+ Object.assign(group3, { [key]: structuredClone(value) });
39874
+ }
39875
+ });
39876
+ }
39877
+ function officeChartSpace(sheet, target, options2, sheetName) {
39749
39878
  const group3 = {
39750
39879
  kind: "bar",
39751
39880
  element: "barChart",
@@ -39755,10 +39884,10 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
39755
39884
  varyColors: false,
39756
39885
  gapWidth: 219,
39757
39886
  overlap: -27,
39758
- series: sheet.series.map((_, index) => series(sheet, index, sheetName)),
39887
+ series: sheet.series.map((_, index) => series(sheet, index, options2, sheetName)),
39759
39888
  axisIds: [...DEFAULT_CHART_AXIS_IDS]
39760
39889
  };
39761
- let space = {
39890
+ const space = {
39762
39891
  roundedCorners: false,
39763
39892
  autoTitleDeleted: options2.title === void 0,
39764
39893
  plotArea: { layout: {}, groups: [group3], axes: defaultChartAxes(false, false) },
@@ -39767,9 +39896,36 @@ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {})
39767
39896
  };
39768
39897
  const column = !target || target.kind === "bar" && (target.barDirection ?? "col") === "col";
39769
39898
  if (target && !(column && !target.is3D && (target.grouping ?? "clustered") === "clustered"))
39770
- space = setChartType(space, target);
39771
- if (options2.title !== void 0) space = setChartTitle(space, options2.title);
39772
- return setChartLegend(space, { position: "b" });
39899
+ return setChartType(space, target);
39900
+ return space;
39901
+ }
39902
+ function minimalChartSpace(sheet, target, options2, sheetName) {
39903
+ const group3 = minimalChartGroup(
39904
+ target ?? { kind: "bar" },
39905
+ sheet.series.map((_, index) => series(sheet, index, options2, sheetName))
39906
+ );
39907
+ if (group3.kind === "stock" && ![3, 4].includes(group3.series.length))
39908
+ throw new RangeError("A stock chart requires three or four price series");
39909
+ const axes = minimalChartAxes(group3, axisIds(options2));
39910
+ group3.axisIds = axes.flatMap((axis2) => axis2.id === void 0 ? [] : [axis2.id]);
39911
+ return {
39912
+ autoTitleDeleted: options2.title === void 0,
39913
+ plotArea: { layout: {}, groups: [group3], axes },
39914
+ plotVisibleOnly: true,
39915
+ displayBlanksAs: "gap"
39916
+ };
39917
+ }
39918
+ function newChartSpace(sheet = DEFAULT_CHART_DATA_SHEET, target, options2 = {}) {
39919
+ const sheetName = options2.sheetName ?? DEFAULT_CHART_SHEET_NAME;
39920
+ let space = options2.profile === "minimal" ? minimalChartSpace(sheet, target, options2, sheetName) : officeChartSpace(sheet, target, options2, sheetName);
39921
+ if (options2.profile !== "minimal" && options2.axisIds !== void 0)
39922
+ space = withAxisIds(space, axisIds(options2));
39923
+ if (options2.dateAxis) space = withDateAxis(space);
39924
+ if (options2.group) space = withGroupSettings(space, options2.group);
39925
+ if (options2.title !== void 0)
39926
+ space = options2.profile === "minimal" ? { ...space, title: minimalChartTitle(options2.title), autoTitleDeleted: false } : setChartTitle(space, options2.title);
39927
+ const legend = options2.legendPosition === void 0 ? "b" : options2.legendPosition;
39928
+ return legend === null ? space : setChartLegend(space, { position: legend });
39773
39929
  }
39774
39930
 
39775
39931
  // chart/workbook/package-save.ts
@@ -40419,8 +40575,8 @@ function wrapElement(doc, placement) {
40419
40575
  return el2(doc, WP_NS3, "wp:wrapNone");
40420
40576
  }
40421
40577
  }
40422
- function position(doc, axis, relativeFrom, align, offsetPx) {
40423
- const node = attrs2(el2(doc, WP_NS3, `wp:position${axis}`), { relativeFrom });
40578
+ function position(doc, axis2, relativeFrom, align, offsetPx) {
40579
+ const node = attrs2(el2(doc, WP_NS3, `wp:position${axis2}`), { relativeFrom });
40424
40580
  if (align) {
40425
40581
  const a2 = el2(doc, WP_NS3, "wp:align");
40426
40582
  a2.textContent = align;