pptx-react-viewer 2.21.0 → 2.21.1

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 (92) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{AiChatPanel-XMRQE2GY.mjs → AiChatPanel-E4NQEMEI.mjs} +3 -3
  3. package/dist/AiChatPanel-E4NQEMEI.mjs.br +0 -0
  4. package/dist/AiChatPanel-E4NQEMEI.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-BD6NR2AU.js → AiChatPanel-VKR2IFFC.js} +23 -23
  6. package/dist/AiChatPanel-VKR2IFFC.js.br +0 -0
  7. package/dist/AiChatPanel-VKR2IFFC.js.gz +0 -0
  8. package/dist/{Model3DScene-HAJKICLT.mjs → Model3DScene-65J6IE5Q.mjs} +1 -1
  9. package/dist/Model3DScene-65J6IE5Q.mjs.br +0 -0
  10. package/dist/Model3DScene-65J6IE5Q.mjs.gz +0 -0
  11. package/dist/{Model3DScene-UXWNLRNQ.js → Model3DScene-JZKLB5YT.js} +2 -2
  12. package/dist/Model3DScene-JZKLB5YT.js.br +0 -0
  13. package/dist/Model3DScene-JZKLB5YT.js.gz +0 -0
  14. package/dist/{chunk-6PRFUWZA.mjs → chunk-2SNHVHHB.mjs} +2 -2
  15. package/dist/chunk-2SNHVHHB.mjs.br +0 -0
  16. package/dist/chunk-2SNHVHHB.mjs.gz +0 -0
  17. package/dist/{chunk-3ILDZ7MD.js → chunk-C3JR7RMW.js} +3 -3
  18. package/dist/chunk-C3JR7RMW.js.br +0 -0
  19. package/dist/{chunk-3ILDZ7MD.js.gz → chunk-C3JR7RMW.js.gz} +0 -0
  20. package/dist/{chunk-Y67QVETX.mjs → chunk-CBGTLSY7.mjs} +7 -7
  21. package/dist/chunk-CBGTLSY7.mjs.br +0 -0
  22. package/dist/chunk-CBGTLSY7.mjs.gz +0 -0
  23. package/dist/{chunk-SUNSC3Z5.js → chunk-DA6DF3EU.js} +147 -147
  24. package/dist/chunk-DA6DF3EU.js.br +0 -0
  25. package/dist/chunk-DA6DF3EU.js.gz +0 -0
  26. package/dist/{chunk-HLUJOKES.js → chunk-GJHO6HPF.js} +385 -385
  27. package/dist/chunk-GJHO6HPF.js.br +0 -0
  28. package/dist/chunk-GJHO6HPF.js.gz +0 -0
  29. package/dist/{chunk-F7SX4EUT.js → chunk-HYUJVSQJ.js} +490 -209
  30. package/dist/chunk-HYUJVSQJ.js.br +0 -0
  31. package/dist/chunk-HYUJVSQJ.js.gz +0 -0
  32. package/dist/{chunk-W3Y3X4AT.js → chunk-OSPNGQF3.js} +1044 -1044
  33. package/dist/chunk-OSPNGQF3.js.br +0 -0
  34. package/dist/chunk-OSPNGQF3.js.gz +0 -0
  35. package/dist/{chunk-5W2W46LY.mjs → chunk-VWCUKKR3.mjs} +490 -209
  36. package/dist/chunk-VWCUKKR3.mjs.br +0 -0
  37. package/dist/chunk-VWCUKKR3.mjs.gz +0 -0
  38. package/dist/{chunk-II5SCD5L.mjs → chunk-WRJ76D5S.mjs} +1 -1
  39. package/dist/chunk-WRJ76D5S.mjs.br +0 -0
  40. package/dist/chunk-WRJ76D5S.mjs.gz +0 -0
  41. package/dist/{chunk-GNY4FD3V.mjs → chunk-WX3HQHR5.mjs} +1 -1
  42. package/dist/chunk-WX3HQHR5.mjs.br +0 -0
  43. package/dist/chunk-WX3HQHR5.mjs.gz +0 -0
  44. package/dist/index.d.ts +9 -0
  45. package/dist/index.js +45 -45
  46. package/dist/index.js.br +0 -0
  47. package/dist/index.js.gz +0 -0
  48. package/dist/index.mjs +5 -5
  49. package/dist/index.mjs.br +0 -0
  50. package/dist/index.mjs.gz +0 -0
  51. package/dist/internals.d.ts +9 -0
  52. package/dist/internals.js +78 -78
  53. package/dist/internals.js.br +0 -0
  54. package/dist/internals.js.gz +0 -0
  55. package/dist/internals.mjs +3 -3
  56. package/dist/internals.mjs.br +0 -0
  57. package/dist/internals.mjs.gz +0 -0
  58. package/dist/viewer/index.d.ts +9 -0
  59. package/dist/viewer/index.js +26 -26
  60. package/dist/viewer/index.js.br +0 -0
  61. package/dist/viewer/index.js.gz +0 -0
  62. package/dist/viewer/index.mjs +5 -5
  63. package/dist/viewer/index.mjs.br +0 -0
  64. package/dist/viewer/index.mjs.gz +0 -0
  65. package/package.json +1 -1
  66. package/dist/AiChatPanel-BD6NR2AU.js.br +0 -0
  67. package/dist/AiChatPanel-BD6NR2AU.js.gz +0 -0
  68. package/dist/AiChatPanel-XMRQE2GY.mjs.br +0 -0
  69. package/dist/AiChatPanel-XMRQE2GY.mjs.gz +0 -0
  70. package/dist/Model3DScene-HAJKICLT.mjs.br +0 -0
  71. package/dist/Model3DScene-HAJKICLT.mjs.gz +0 -0
  72. package/dist/Model3DScene-UXWNLRNQ.js.br +0 -0
  73. package/dist/Model3DScene-UXWNLRNQ.js.gz +0 -0
  74. package/dist/chunk-3ILDZ7MD.js.br +0 -0
  75. package/dist/chunk-5W2W46LY.mjs.br +0 -0
  76. package/dist/chunk-5W2W46LY.mjs.gz +0 -0
  77. package/dist/chunk-6PRFUWZA.mjs.br +0 -0
  78. package/dist/chunk-6PRFUWZA.mjs.gz +0 -0
  79. package/dist/chunk-F7SX4EUT.js.br +0 -0
  80. package/dist/chunk-F7SX4EUT.js.gz +0 -0
  81. package/dist/chunk-GNY4FD3V.mjs.br +0 -0
  82. package/dist/chunk-GNY4FD3V.mjs.gz +0 -0
  83. package/dist/chunk-HLUJOKES.js.br +0 -0
  84. package/dist/chunk-HLUJOKES.js.gz +0 -0
  85. package/dist/chunk-II5SCD5L.mjs.br +0 -0
  86. package/dist/chunk-II5SCD5L.mjs.gz +0 -0
  87. package/dist/chunk-SUNSC3Z5.js.br +0 -0
  88. package/dist/chunk-SUNSC3Z5.js.gz +0 -0
  89. package/dist/chunk-W3Y3X4AT.js.br +0 -0
  90. package/dist/chunk-W3Y3X4AT.js.gz +0 -0
  91. package/dist/chunk-Y67QVETX.mjs.br +0 -0
  92. package/dist/chunk-Y67QVETX.mjs.gz +0 -0
@@ -32809,6 +32809,110 @@ function unwrapAlternateContent(container) {
32809
32809
  delete container["mc:AlternateContent"];
32810
32810
  return blocks;
32811
32811
  }
32812
+ function reapplyAlternateContentToTree(container, blockByNode) {
32813
+ let working = container;
32814
+ const groups = ensureArray3(working["p:grpSp"]);
32815
+ if (groups.length > 0) {
32816
+ let groupsChanged = false;
32817
+ const nextGroups = groups.map((group2) => {
32818
+ const next2 = reapplyAlternateContentToTree(group2, blockByNode);
32819
+ if (next2 !== group2) {
32820
+ groupsChanged = true;
32821
+ }
32822
+ return next2;
32823
+ });
32824
+ if (groupsChanged) {
32825
+ working = { ...working, "p:grpSp": nextGroups };
32826
+ }
32827
+ }
32828
+ const blockGroups = /* @__PURE__ */ new Map();
32829
+ for (const tag of SHAPE_TREE_ELEMENT_TAGS) {
32830
+ for (const node of ensureArray3(working[tag])) {
32831
+ const block = blockByNode.get(node);
32832
+ if (!block) {
32833
+ continue;
32834
+ }
32835
+ let entries = blockGroups.get(block);
32836
+ if (!entries) {
32837
+ entries = [];
32838
+ blockGroups.set(block, entries);
32839
+ }
32840
+ entries.push({ tag, node });
32841
+ }
32842
+ }
32843
+ if (blockGroups.size === 0) {
32844
+ return working;
32845
+ }
32846
+ const nextArrays = /* @__PURE__ */ new Map();
32847
+ const arrayFor = (tag) => {
32848
+ let arr = nextArrays.get(tag);
32849
+ if (!arr) {
32850
+ arr = [...ensureArray3(working[tag])];
32851
+ nextArrays.set(tag, arr);
32852
+ }
32853
+ return arr;
32854
+ };
32855
+ const envelopes = [...ensureArray3(working["mc:AlternateContent"])];
32856
+ for (const [block, entries] of blockGroups) {
32857
+ for (const entry2 of entries) {
32858
+ const arr = arrayFor(entry2.tag);
32859
+ const idx = arr.indexOf(entry2.node);
32860
+ if (idx !== -1) {
32861
+ arr.splice(idx, 1);
32862
+ }
32863
+ }
32864
+ const liveByTag = /* @__PURE__ */ new Map();
32865
+ for (const entry2 of entries) {
32866
+ let nodes = liveByTag.get(entry2.tag);
32867
+ if (!nodes) {
32868
+ nodes = [];
32869
+ liveByTag.set(entry2.tag, nodes);
32870
+ }
32871
+ nodes.push(entry2.node);
32872
+ }
32873
+ const clonedAc = { ...block.rawAc };
32874
+ if (block.selectedBranch === "choice") {
32875
+ const choices2 = ensureArray3(clonedAc["mc:Choice"]);
32876
+ const targetIdx = block.choiceIndex ?? 0;
32877
+ const original = choices2[targetIdx];
32878
+ if (original) {
32879
+ const rebuilt = { ...original };
32880
+ for (const tag of SHAPE_TREE_ELEMENT_TAGS) {
32881
+ delete rebuilt[tag];
32882
+ }
32883
+ for (const [tag, nodes] of liveByTag) {
32884
+ rebuilt[tag] = nodes.length === 1 ? nodes[0] : nodes;
32885
+ }
32886
+ const nextChoices = [...choices2];
32887
+ nextChoices[targetIdx] = rebuilt;
32888
+ clonedAc["mc:Choice"] = nextChoices.length === 1 ? nextChoices[0] : nextChoices;
32889
+ }
32890
+ } else {
32891
+ const fallback = clonedAc["mc:Fallback"];
32892
+ if (fallback) {
32893
+ const rebuilt = { ...fallback };
32894
+ for (const tag of SHAPE_TREE_ELEMENT_TAGS) {
32895
+ delete rebuilt[tag];
32896
+ }
32897
+ for (const [tag, nodes] of liveByTag) {
32898
+ rebuilt[tag] = nodes.length === 1 ? nodes[0] : nodes;
32899
+ }
32900
+ clonedAc["mc:Fallback"] = rebuilt;
32901
+ }
32902
+ }
32903
+ envelopes.push(clonedAc);
32904
+ }
32905
+ const next = { ...working };
32906
+ for (const [tag, arr] of nextArrays) {
32907
+ if (arr.length > 0) {
32908
+ next[tag] = arr;
32909
+ } else {
32910
+ delete next[tag];
32911
+ }
32912
+ }
32913
+ next["mc:AlternateContent"] = envelopes.length === 1 ? envelopes[0] : envelopes;
32914
+ return next;
32915
+ }
32812
32916
  function ensureArray3(val2) {
32813
32917
  if (!val2) {
32814
32918
  return [];
@@ -36074,6 +36178,37 @@ var STYLE_MATRIX_LINE_KEYS = [
36074
36178
  "lineCap",
36075
36179
  "compoundLine"
36076
36180
  ];
36181
+ var STYLE_MATRIX_EFFECT_KEYS = [
36182
+ "shadowColor",
36183
+ "shadowBlur",
36184
+ "shadowOffsetX",
36185
+ "shadowOffsetY",
36186
+ "shadowOpacity",
36187
+ "innerShadowColor",
36188
+ "innerShadowBlur",
36189
+ "innerShadowOffsetX",
36190
+ "innerShadowOffsetY",
36191
+ "innerShadowOpacity",
36192
+ "glowColor",
36193
+ "glowRadius",
36194
+ "glowOpacity",
36195
+ "softEdgeRadius",
36196
+ "reflectionBlurRadius",
36197
+ "reflectionStartOpacity",
36198
+ "reflectionEndOpacity",
36199
+ "reflectionEndPosition",
36200
+ "reflectionDirection",
36201
+ "reflectionRotation",
36202
+ "reflectionDistance",
36203
+ "scene3d",
36204
+ "shape3d"
36205
+ ];
36206
+ var EFFECT_AUTHORED_ONLY_KEYS = [
36207
+ "blurRadius",
36208
+ "presetShadowName",
36209
+ "effectDagXml",
36210
+ "effectDagTree"
36211
+ ];
36077
36212
  function captureStyleBaseline(style, keys) {
36078
36213
  const baseline = {};
36079
36214
  for (const key2 of keys) {
@@ -36098,6 +36233,16 @@ function createLineStyleGate(style) {
36098
36233
  }
36099
36234
  return (...keys) => keys.some((key2) => style[key2] !== baseline[key2]);
36100
36235
  }
36236
+ function effectIsPurelyStyleMatrix(style) {
36237
+ const baseline = style.inheritedEffectStyle;
36238
+ if (baseline === void 0) {
36239
+ return false;
36240
+ }
36241
+ if (!matchesBaseline(style, baseline, STYLE_MATRIX_EFFECT_KEYS)) {
36242
+ return false;
36243
+ }
36244
+ return EFFECT_AUTHORED_ONLY_KEYS.every((key2) => style[key2] === void 0);
36245
+ }
36101
36246
  function applyScene3dStyle(shapeProps, style) {
36102
36247
  const scene3dNode = shapeProps["a:scene3d"];
36103
36248
  if (!scene3dNode) {
@@ -36416,14 +36561,17 @@ var PptxShapeStyleExtractor = class {
36416
36561
  Object.assign(style, this.context.extractEffectDagStyle(shapeProps));
36417
36562
  if (styleNode?.["a:effectRef"]) {
36418
36563
  const suppressInherited = hasEmptyDrawingChild(shapeProps, "effectLst");
36419
- const authored = suppressInherited ? new Set(Object.keys(style)) : void 0;
36564
+ const authoredBefore = new Set(Object.keys(style));
36420
36565
  this.context.resolveThemeEffectRef(styleNode["a:effectRef"], style);
36421
- if (authored) {
36566
+ if (suppressInherited) {
36422
36567
  for (const key2 of Object.keys(style)) {
36423
- if (!authored.has(key2) && key2 !== "effectRefIdx" && key2 !== "effectRefColorXml") {
36568
+ if (!authoredBefore.has(key2) && key2 !== "effectRefIdx" && key2 !== "effectRefColorXml") {
36424
36569
  delete style[key2];
36425
36570
  }
36426
36571
  }
36572
+ } else {
36573
+ const inheritedKeys = STYLE_MATRIX_EFFECT_KEYS.filter((key2) => !authoredBefore.has(key2));
36574
+ style.inheritedEffectStyle = captureStyleBaseline(style, inheritedKeys);
36427
36575
  }
36428
36576
  }
36429
36577
  const fontRef = styleNode?.["a:fontRef"];
@@ -45396,6 +45544,16 @@ var CONTAINER_LOCAL_NAME_TO_TYPE = {
45396
45544
  function chartContainerLocalNameToType(localName25) {
45397
45545
  return CONTAINER_LOCAL_NAME_TO_TYPE[localName25];
45398
45546
  }
45547
+ var LINE_DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
45548
+ "line",
45549
+ "line3D",
45550
+ "scatter",
45551
+ "radar",
45552
+ "stock"
45553
+ ]);
45554
+ function isLineDrawnChartType(type) {
45555
+ return type !== void 0 && LINE_DRAWN_CHART_TYPES.has(type);
45556
+ }
45399
45557
  function parseChartDateCategories(seriesNode, xmlLookup) {
45400
45558
  const cat = xmlLookup.getChildByLocalName(seriesNode, "cat");
45401
45559
  const numeric = xmlLookup.getChildByLocalName(cat, "numRef") || xmlLookup.getChildByLocalName(cat, "numLit");
@@ -51294,6 +51452,77 @@ function applyChartLegendToXml(chartRoot, style, getLocalName2, resolveColor2) {
51294
51452
  }
51295
51453
  applyLegendEntries(legendNode, style.legendEntries, getLocalName2, resolveColor2);
51296
51454
  }
51455
+ function findKey18(obj, local, getLocalName2) {
51456
+ return Object.keys(obj).find((k) => getLocalName2(k) === local);
51457
+ }
51458
+ function insertBeforeLn(obj, key2, value, getLocalName2) {
51459
+ const keys = Object.keys(obj);
51460
+ const lnIdx = keys.findIndex((k) => getLocalName2(k) === "ln");
51461
+ const entries = keys.map((k) => [k, obj[k]]);
51462
+ const at = lnIdx === -1 ? entries.length : lnIdx;
51463
+ entries.splice(at, 0, [key2, value]);
51464
+ for (const k of keys) {
51465
+ delete obj[k];
51466
+ }
51467
+ for (const [k, v] of entries) {
51468
+ obj[k] = v;
51469
+ }
51470
+ }
51471
+ function insertFirst(obj, key2, value) {
51472
+ const keys = Object.keys(obj);
51473
+ const entries = keys.map((k) => [k, obj[k]]);
51474
+ for (const k of keys) {
51475
+ delete obj[k];
51476
+ }
51477
+ obj[key2] = value;
51478
+ for (const [k, v] of entries) {
51479
+ obj[k] = v;
51480
+ }
51481
+ }
51482
+ function writeSeriesColorToSpPr(spPr, hex4, isLineFamily, getLocalName2, resolveColor2) {
51483
+ const normalizedHex = hex4.replace(/^#/u, "");
51484
+ if (isLineFamily) {
51485
+ const lnKey = findKey18(spPr, "ln", getLocalName2) ?? "a:ln";
51486
+ const ln = spPr[lnKey] ?? {};
51487
+ const hadLn = Boolean(spPr[lnKey]);
51488
+ const noFillKey2 = findKey18(ln, "noFill", getLocalName2);
51489
+ if (noFillKey2) {
51490
+ delete ln[noFillKey2];
51491
+ }
51492
+ const lnFillKey = findKey18(ln, "solidFill", getLocalName2) ?? "a:solidFill";
51493
+ const authoredFill2 = ln[lnFillKey];
51494
+ const fillNode2 = serializeColorChoice(
51495
+ authoredFill2,
51496
+ authoredFill2 ? resolveColor2(authoredFill2) : void 0,
51497
+ normalizedHex
51498
+ );
51499
+ if (authoredFill2) {
51500
+ ln[lnFillKey] = fillNode2;
51501
+ } else {
51502
+ insertFirst(ln, lnFillKey, fillNode2);
51503
+ }
51504
+ if (!hadLn) {
51505
+ spPr[lnKey] = ln;
51506
+ }
51507
+ return;
51508
+ }
51509
+ const noFillKey = findKey18(spPr, "noFill", getLocalName2);
51510
+ if (noFillKey) {
51511
+ delete spPr[noFillKey];
51512
+ }
51513
+ const fillKey = findKey18(spPr, "solidFill", getLocalName2) ?? "a:solidFill";
51514
+ const authoredFill = spPr[fillKey];
51515
+ const fillNode = serializeColorChoice(
51516
+ authoredFill,
51517
+ authoredFill ? resolveColor2(authoredFill) : void 0,
51518
+ normalizedHex
51519
+ );
51520
+ if (authoredFill) {
51521
+ spPr[fillKey] = fillNode;
51522
+ } else {
51523
+ insertBeforeLn(spPr, fillKey, fillNode, getLocalName2);
51524
+ }
51525
+ }
51297
51526
  var TITLE_ROLE = /* @__PURE__ */ new Set(["title", "ctrtitle"]);
51298
51527
  var CONTENT_ROLE = /* @__PURE__ */ new Set([
51299
51528
  "body",
@@ -60456,26 +60685,24 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
60456
60685
  this.updateChartCacheValues(valNode, true, seriesData.values.map(String));
60457
60686
  }
60458
60687
  if (seriesData.color) {
60459
- const hex4 = seriesData.color.replace("#", "");
60460
- const spPr = this.xmlLookupService.getChildByLocalName(seriesNode, "spPr");
60461
- if (spPr) {
60462
- const solidFillKey = Object.keys(spPr).find(
60463
- (k) => this.compatibilityService.getXmlLocalName(k) === "solidFill"
60464
- ) ?? "a:solidFill";
60465
- const authoredFill = spPr[solidFillKey];
60466
- spPr[solidFillKey] = serializeColorChoice(
60467
- authoredFill,
60468
- authoredFill ? this.parseColor(authoredFill) : void 0,
60469
- hex4
60470
- );
60471
- } else {
60472
- const spPrKey = Object.keys(seriesNode).find(
60473
- (k) => this.compatibilityService.getXmlLocalName(k) === "spPr"
60474
- ) ?? "c:spPr";
60475
- seriesNode[spPrKey] = {
60476
- "a:solidFill": { "a:srgbClr": { "@_val": hex4 } }
60477
- };
60688
+ const isLineFamily = isLineDrawnChartType(
60689
+ seriesData.seriesChartType ?? chartData.chartType
60690
+ );
60691
+ const spPrKey = Object.keys(seriesNode).find(
60692
+ (k) => this.compatibilityService.getXmlLocalName(k) === "spPr"
60693
+ ) ?? "c:spPr";
60694
+ let spPr = seriesNode[spPrKey];
60695
+ if (!spPr) {
60696
+ spPr = {};
60697
+ seriesNode[spPrKey] = spPr;
60478
60698
  }
60699
+ writeSeriesColorToSpPr(
60700
+ spPr,
60701
+ seriesData.color,
60702
+ isLineFamily,
60703
+ (key2) => this.compatibilityService.getXmlLocalName(key2),
60704
+ (node) => this.parseColor(node)
60705
+ );
60479
60706
  }
60480
60707
  if (seriesData.trendlines !== void 0) {
60481
60708
  applySeriesTrendlinesToXml(
@@ -60527,7 +60754,8 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
60527
60754
  seriesData,
60528
60755
  chartData.categories,
60529
60756
  templateSeries,
60530
- chartData.dateCategories
60757
+ chartData.dateCategories,
60758
+ isLineDrawnChartType(seriesData.seriesChartType ?? chartData.chartType)
60531
60759
  );
60532
60760
  newSeriesXmlNodes.push(newNode);
60533
60761
  }
@@ -60963,8 +61191,12 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
60963
61191
  * If a `templateSeries` is provided, it is deep-cloned and its data is
60964
61192
  * replaced with the new series data. Otherwise, a minimal structure is
60965
61193
  * built from scratch.
61194
+ *
61195
+ * @param isLineFamily - Whether the target chart family reads/writes its
61196
+ * series colour from `a:ln/a:solidFill` (line/line3D/scatter/radar/stock)
61197
+ * rather than a direct `a:solidFill`. See `isLineDrawnChartType`.
60966
61198
  */
60967
- buildNewSeriesXml(seriesIndex, seriesData, categories, templateSeries, dateCategories) {
61199
+ buildNewSeriesXml(seriesIndex, seriesData, categories, templateSeries, dateCategories, isLineFamily = false) {
60968
61200
  if (templateSeries) {
60969
61201
  const clone3 = JSON.parse(JSON.stringify(templateSeries));
60970
61202
  const idxNode = this.xmlLookupService.getChildByLocalName(clone3, "idx");
@@ -60991,22 +61223,13 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
60991
61223
  if (seriesData.color) {
60992
61224
  const spPr = this.xmlLookupService.getChildByLocalName(clone3, "spPr");
60993
61225
  if (spPr) {
60994
- const solidFillKey = Object.keys(spPr).find(
60995
- (k) => this.compatibilityService.getXmlLocalName(k) === "solidFill"
61226
+ writeSeriesColorToSpPr(
61227
+ spPr,
61228
+ seriesData.color,
61229
+ isLineFamily,
61230
+ (key2) => this.compatibilityService.getXmlLocalName(key2),
61231
+ (node) => this.parseColor(node)
60996
61232
  );
60997
- if (solidFillKey) {
60998
- spPr[solidFillKey] = {
60999
- "a:srgbClr": {
61000
- "@_val": seriesData.color.replace("#", "")
61001
- }
61002
- };
61003
- } else {
61004
- spPr["a:solidFill"] = {
61005
- "a:srgbClr": {
61006
- "@_val": seriesData.color.replace("#", "")
61007
- }
61008
- };
61009
- }
61010
61233
  }
61011
61234
  }
61012
61235
  return clone3;
@@ -61023,11 +61246,7 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
61023
61246
  }
61024
61247
  }
61025
61248
  },
61026
- "c:spPr": {
61027
- "a:solidFill": {
61028
- "a:srgbClr": { "@_val": colorHex }
61029
- }
61030
- },
61249
+ "c:spPr": isLineFamily ? { "a:ln": { "a:solidFill": { "a:srgbClr": { "@_val": colorHex } } } } : { "a:solidFill": { "a:srgbClr": { "@_val": colorHex } } },
61031
61250
  "c:cat": dateCategories ? {
61032
61251
  "c:numRef": {
61033
61252
  "c:numCache": {
@@ -61057,7 +61276,7 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
61057
61276
  return ser;
61058
61277
  }
61059
61278
  };
61060
- function findKey18(node, name, localName25) {
61279
+ function findKey19(node, name, localName25) {
61061
61280
  return Object.keys(node).find((key2) => localName25(key2) === name);
61062
61281
  }
61063
61282
  function prefixFor2(node) {
@@ -61076,7 +61295,7 @@ function setChildren(node, name, values, localName25) {
61076
61295
  if (values === void 0) {
61077
61296
  return false;
61078
61297
  }
61079
- const existing = findKey18(node, name, localName25);
61298
+ const existing = findKey19(node, name, localName25);
61080
61299
  if (values.length === 0) {
61081
61300
  if (existing) {
61082
61301
  delete node[existing];
@@ -61103,7 +61322,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName25) {
61103
61322
  changed = setChildren(node, "title", textNodes(metadata.titles), localName25) || changed;
61104
61323
  changed = setChildren(node, "desc", textNodes(metadata.descriptions), localName25) || changed;
61105
61324
  if (metadata.categories !== void 0) {
61106
- const key2 = findKey18(node, "catLst", localName25);
61325
+ const key2 = findKey19(node, "catLst", localName25);
61107
61326
  if (metadata.categories.length === 0) {
61108
61327
  if (key2) {
61109
61328
  delete node[key2];
@@ -61127,7 +61346,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName25) {
61127
61346
  return changed;
61128
61347
  }
61129
61348
  function ensureLabels(node, localName25) {
61130
- const key2 = findKey18(node, "styleLbl", localName25) ?? `${prefixFor2(node)}styleLbl`;
61349
+ const key2 = findKey19(node, "styleLbl", localName25) ?? `${prefixFor2(node)}styleLbl`;
61131
61350
  return { key: key2, labels: objects2(node[key2]) };
61132
61351
  }
61133
61352
  function applySmartArtQuickStyleLabels(node, labels, localName25) {
@@ -61150,7 +61369,7 @@ var COLOR_LISTS = [
61150
61369
  ["textEffect", "txEffectClrLst"]
61151
61370
  ];
61152
61371
  function applyColorList(label, name, metadata, localName25) {
61153
- const key2 = findKey18(label, name, localName25) ?? `${prefixFor2(label)}${name}`;
61372
+ const key2 = findKey19(label, name, localName25) ?? `${prefixFor2(label)}${name}`;
61154
61373
  const list = objects2(label[key2])[0] ?? {};
61155
61374
  if (metadata.method !== void 0) {
61156
61375
  list["@_meth"] = metadata.method;
@@ -61188,7 +61407,7 @@ function toArray3(value) {
61188
61407
  const obj = asObject(value);
61189
61408
  return obj ? [obj] : [];
61190
61409
  }
61191
- function findKey19(obj, name, getLocalName2) {
61410
+ function findKey20(obj, name, getLocalName2) {
61192
61411
  return Object.keys(obj).find((k) => getLocalName2(k) === name);
61193
61412
  }
61194
61413
  function hex3(value) {
@@ -61230,7 +61449,7 @@ function applySmartArtColorTransform(colorsDef, transform, getLocalName2, resolv
61230
61449
  let mutated = false;
61231
61450
  mutated = applySmartArtDefinitionMetadata(colorsDef, transform, getLocalName2) || mutated;
61232
61451
  mutated = applySmartArtColorStyleLabels(colorsDef, transform.labels, getLocalName2) || mutated;
61233
- const styleLblKey = findKey19(colorsDef, "styleLbl", getLocalName2);
61452
+ const styleLblKey = findKey20(colorsDef, "styleLbl", getLocalName2);
61234
61453
  if (!styleLblKey) {
61235
61454
  return mutated;
61236
61455
  }
@@ -61241,7 +61460,7 @@ function applySmartArtColorTransform(colorsDef, transform, getLocalName2, resolv
61241
61460
  let fillIndex = 0;
61242
61461
  let lineIndex = 0;
61243
61462
  for (const label of labels) {
61244
- const fillKey = findKey19(label, "fillClrLst", getLocalName2);
61463
+ const fillKey = findKey20(label, "fillClrLst", getLocalName2);
61245
61464
  if (fillKey) {
61246
61465
  const value = transform.fillColors[fillIndex++];
61247
61466
  const list = asObject(label[fillKey]);
@@ -61250,7 +61469,7 @@ function applySmartArtColorTransform(colorsDef, transform, getLocalName2, resolv
61250
61469
  mutated = true;
61251
61470
  }
61252
61471
  }
61253
- const lineKey = findKey19(label, "linClrLst", getLocalName2);
61472
+ const lineKey = findKey20(label, "linClrLst", getLocalName2);
61254
61473
  if (lineKey) {
61255
61474
  const value = transform.lineColors[lineIndex++];
61256
61475
  const list = asObject(label[lineKey]);
@@ -61266,11 +61485,11 @@ function localName23(key2) {
61266
61485
  const idx = key2.indexOf(":");
61267
61486
  return idx >= 0 ? key2.slice(idx + 1) : key2;
61268
61487
  }
61269
- function findKey20(obj, local) {
61488
+ function findKey21(obj, local) {
61270
61489
  return Object.keys(obj).find((k) => localName23(k) === local);
61271
61490
  }
61272
61491
  function ensureChild(obj, local, prefixedFallback) {
61273
- const key2 = findKey20(obj, local) ?? prefixedFallback;
61492
+ const key2 = findKey21(obj, local) ?? prefixedFallback;
61274
61493
  const existing = obj[key2];
61275
61494
  if (existing && typeof existing === "object" && !Array.isArray(existing)) {
61276
61495
  return existing;
@@ -61286,7 +61505,7 @@ function solidFill2(color2) {
61286
61505
  return { "a:srgbClr": { "@_val": hexValue(color2) } };
61287
61506
  }
61288
61507
  function setSolidFill(parent, color2) {
61289
- const key2 = findKey20(parent, "solidFill") ?? "a:solidFill";
61508
+ const key2 = findKey21(parent, "solidFill") ?? "a:solidFill";
61290
61509
  parent[key2] = solidFill2(color2);
61291
61510
  }
61292
61511
  function applyShapeStyle(pt2, style) {
@@ -61303,7 +61522,7 @@ function applyShapeStyle(pt2, style) {
61303
61522
  }
61304
61523
  }
61305
61524
  function ensureFirstRunRPr(pt2) {
61306
- const tKey = findKey20(pt2, "t");
61525
+ const tKey = findKey21(pt2, "t");
61307
61526
  if (!tKey) {
61308
61527
  return void 0;
61309
61528
  }
@@ -61311,7 +61530,7 @@ function ensureFirstRunRPr(pt2) {
61311
61530
  if (!body || typeof body !== "object" || Array.isArray(body)) {
61312
61531
  return void 0;
61313
61532
  }
61314
- const pKey = findKey20(body, "p");
61533
+ const pKey = findKey21(body, "p");
61315
61534
  if (!pKey) {
61316
61535
  return void 0;
61317
61536
  }
@@ -61320,7 +61539,7 @@ function ensureFirstRunRPr(pt2) {
61320
61539
  if (!firstP || typeof firstP !== "object") {
61321
61540
  return void 0;
61322
61541
  }
61323
- const rKey = findKey20(firstP, "r");
61542
+ const rKey = findKey21(firstP, "r");
61324
61543
  if (!rKey) {
61325
61544
  return void 0;
61326
61545
  }
@@ -62244,27 +62463,27 @@ function applySmartArtChrome(dataModel, chrome, getLocalName2) {
62244
62463
  if (!chrome || !chrome.backgroundColor && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
62245
62464
  return;
62246
62465
  }
62247
- const findKey21 = (obj, name) => Object.keys(obj).find((k) => getLocalName2(k) === name);
62466
+ const findKey22 = (obj, name) => Object.keys(obj).find((k) => getLocalName2(k) === name);
62248
62467
  if (chrome.backgroundColor) {
62249
62468
  const hex4 = chrome.backgroundColor.replace("#", "");
62250
- const bgKey = findKey21(dataModel, "bg") ?? "dgm:bg";
62469
+ const bgKey = findKey22(dataModel, "bg") ?? "dgm:bg";
62251
62470
  const bg = asObject2(dataModel[bgKey]);
62252
- const fillKey = findKey21(bg, "solidFill") ?? "a:solidFill";
62471
+ const fillKey = findKey22(bg, "solidFill") ?? "a:solidFill";
62253
62472
  bg[fillKey] = { "a:srgbClr": { "@_val": hex4 } };
62254
62473
  dataModel[bgKey] = bg;
62255
62474
  }
62256
62475
  const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
62257
62476
  if (chrome.outlineColor || hasOutlineWidth) {
62258
- const wholeKey = findKey21(dataModel, "whole") ?? "dgm:whole";
62477
+ const wholeKey = findKey22(dataModel, "whole") ?? "dgm:whole";
62259
62478
  const whole = asObject2(dataModel[wholeKey]);
62260
- const lnKey = findKey21(whole, "ln") ?? "a:ln";
62479
+ const lnKey = findKey22(whole, "ln") ?? "a:ln";
62261
62480
  const ln = asObject2(whole[lnKey]);
62262
62481
  if (hasOutlineWidth) {
62263
62482
  ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
62264
62483
  }
62265
62484
  if (chrome.outlineColor) {
62266
62485
  const hex4 = chrome.outlineColor.replace("#", "");
62267
- const fillKey = findKey21(ln, "solidFill") ?? "a:solidFill";
62486
+ const fillKey = findKey22(ln, "solidFill") ?? "a:solidFill";
62268
62487
  ln[fillKey] = { "a:srgbClr": { "@_val": hex4 } };
62269
62488
  }
62270
62489
  whole[lnKey] = ln;
@@ -63971,155 +64190,87 @@ var PptxHandlerRuntime28 = class _PptxHandlerRuntime9 extends PptxHandlerRuntime
63971
64190
  }
63972
64191
  }
63973
64192
  };
63974
- var PptxHandlerRuntime29 = class extends PptxHandlerRuntime28 {
63975
- /**
63976
- * Serialize visual effects (shadow, glow, reflection, blur, soft edge),
63977
- * effectDag, 3D scene, and 3D shape properties to the given spPr XML object.
63978
- */
63979
- applyEffectsAndThreeD(spPr, shapeStyle) {
63980
- const presetShadowXml = shapeStyle.presetShadowName ? this.buildPresetShadowXml(shapeStyle) : void 0;
63981
- const outerShadowXml = presetShadowXml ? void 0 : this.buildOuterShadowXml(shapeStyle);
63982
- const innerShadowXml = this.buildInnerShadowXml(shapeStyle);
63983
- const glowXml = this.buildGlowXml(shapeStyle);
63984
- const softEdgeXml = this.buildSoftEdgeXml(shapeStyle);
63985
- const reflectionXml = this.buildReflectionXml(shapeStyle);
63986
- const blurXml = this.buildBlurXml(shapeStyle);
63987
- const hasAnyEffect = outerShadowXml || presetShadowXml || innerShadowXml || glowXml || softEdgeXml || reflectionXml || blurXml;
63988
- if (hasAnyEffect || shapeStyle.effectListXml) {
63989
- const effectList = createEffectList(shapeStyle, spPr);
63990
- if (presetShadowXml) {
63991
- setEffectChild(effectList, "prstShdw", presetShadowXml);
64193
+ function writeShapeEffects(spPr, shapeStyle, ctx) {
64194
+ if (effectIsPurelyStyleMatrix(shapeStyle)) {
64195
+ return;
64196
+ }
64197
+ writeEffectList(spPr, shapeStyle, ctx);
64198
+ writeEffectDag(spPr, shapeStyle);
64199
+ writeScene3d(spPr, shapeStyle);
64200
+ writeShape3d(spPr, shapeStyle);
64201
+ }
64202
+ function writeEffectList(spPr, shapeStyle, ctx) {
64203
+ const {
64204
+ outerShadowXml,
64205
+ presetShadowXml,
64206
+ innerShadowXml,
64207
+ glowXml,
64208
+ softEdgeXml,
64209
+ reflectionXml,
64210
+ blurXml
64211
+ } = ctx;
64212
+ const hasAnyEffect = outerShadowXml || presetShadowXml || innerShadowXml || glowXml || softEdgeXml || reflectionXml || blurXml;
64213
+ if (hasAnyEffect || shapeStyle.effectListXml) {
64214
+ const effectList = createEffectList(shapeStyle, spPr);
64215
+ if (presetShadowXml) {
64216
+ setEffectChild(effectList, "prstShdw", presetShadowXml);
64217
+ setEffectChild(effectList, "outerShdw", void 0);
64218
+ } else if (outerShadowXml) {
64219
+ setEffectChild(effectList, "outerShdw", outerShadowXml);
64220
+ setEffectChild(effectList, "prstShdw", void 0);
64221
+ }
64222
+ if (innerShadowXml) {
64223
+ setEffectChild(effectList, "innerShdw", innerShadowXml);
64224
+ }
64225
+ if (glowXml) {
64226
+ setEffectChild(effectList, "glow", glowXml);
64227
+ }
64228
+ if (softEdgeXml) {
64229
+ setEffectChild(effectList, "softEdge", softEdgeXml);
64230
+ }
64231
+ if (reflectionXml) {
64232
+ setEffectChild(effectList, "reflection", reflectionXml);
64233
+ }
64234
+ if (blurXml) {
64235
+ setEffectChild(effectList, "blur", blurXml);
64236
+ }
64237
+ setEffectChild(spPr, "effectLst", reorderObjectKeys(effectList, EFFECT_LST_ORDER));
64238
+ } else {
64239
+ const effectList = effectChild(spPr, "effectLst");
64240
+ if (effectList) {
64241
+ if (shapeStyle.shadowColor !== void 0 && !outerShadowXml && !presetShadowXml) {
63992
64242
  setEffectChild(effectList, "outerShdw", void 0);
63993
- } else if (outerShadowXml) {
63994
- setEffectChild(effectList, "outerShdw", outerShadowXml);
63995
64243
  setEffectChild(effectList, "prstShdw", void 0);
63996
64244
  }
63997
- if (innerShadowXml) {
63998
- setEffectChild(effectList, "innerShdw", innerShadowXml);
64245
+ if (shapeStyle.innerShadowColor !== void 0 && !innerShadowXml) {
64246
+ setEffectChild(effectList, "innerShdw", void 0);
63999
64247
  }
64000
- if (glowXml) {
64001
- setEffectChild(effectList, "glow", glowXml);
64248
+ if (shapeStyle.glowColor !== void 0 && !glowXml) {
64249
+ setEffectChild(effectList, "glow", void 0);
64002
64250
  }
64003
- if (softEdgeXml) {
64004
- setEffectChild(effectList, "softEdge", softEdgeXml);
64251
+ if (shapeStyle.softEdgeRadius !== void 0 && !softEdgeXml) {
64252
+ setEffectChild(effectList, "softEdge", void 0);
64005
64253
  }
64006
- if (reflectionXml) {
64007
- setEffectChild(effectList, "reflection", reflectionXml);
64254
+ if (shapeStyle.reflectionBlurRadius !== void 0 && !reflectionXml) {
64255
+ setEffectChild(effectList, "reflection", void 0);
64008
64256
  }
64009
- if (blurXml) {
64010
- setEffectChild(effectList, "blur", blurXml);
64257
+ if (shapeStyle.blurRadius !== void 0 && !blurXml) {
64258
+ setEffectChild(effectList, "blur", void 0);
64011
64259
  }
64012
- setEffectChild(spPr, "effectLst", reorderObjectKeys(effectList, EFFECT_LST_ORDER));
64013
- } else {
64014
- const effectList = effectChild(spPr, "effectLst");
64015
- if (effectList) {
64016
- if (shapeStyle.shadowColor !== void 0 && !outerShadowXml && !presetShadowXml) {
64017
- setEffectChild(effectList, "outerShdw", void 0);
64018
- setEffectChild(effectList, "prstShdw", void 0);
64019
- }
64020
- if (shapeStyle.innerShadowColor !== void 0 && !innerShadowXml) {
64021
- setEffectChild(effectList, "innerShdw", void 0);
64022
- }
64023
- if (shapeStyle.glowColor !== void 0 && !glowXml) {
64024
- setEffectChild(effectList, "glow", void 0);
64025
- }
64026
- if (shapeStyle.softEdgeRadius !== void 0 && !softEdgeXml) {
64027
- setEffectChild(effectList, "softEdge", void 0);
64028
- }
64029
- if (shapeStyle.reflectionBlurRadius !== void 0 && !reflectionXml) {
64030
- setEffectChild(effectList, "reflection", void 0);
64031
- }
64032
- if (shapeStyle.blurRadius !== void 0 && !blurXml) {
64033
- setEffectChild(effectList, "blur", void 0);
64034
- }
64035
- if (Object.keys(effectList).length === 0) {
64036
- setEffectChild(spPr, "effectLst", void 0);
64037
- } else {
64038
- setEffectChild(spPr, "effectLst", reorderObjectKeys(effectList, EFFECT_LST_ORDER));
64039
- }
64040
- }
64041
- }
64042
- const effectDagXml = shapeStyle.effectDagTree ? serializeEffectDagContainer(shapeStyle.effectDagTree) : shapeStyle.effectDagXml;
64043
- if (effectDagXml) {
64044
- setEffectChild(spPr, "effectDag", effectDagXml);
64045
- }
64046
- if (shapeStyle.scene3d) {
64047
- const s3d = shapeStyle.scene3d;
64048
- const hasData = s3d.cameraPreset || s3d.lightRigType;
64049
- if (hasData) {
64050
- const source = spPr["a:scene3d"] ?? {};
64051
- const scene3dXml = { ...source };
64052
- scene3dXml["a:camera"] = buildScene3dCamera(s3d, source);
64053
- const lightRig = buildScene3dLightRig(s3d, source);
64054
- if (lightRig) {
64055
- scene3dXml["a:lightRig"] = lightRig;
64056
- }
64057
- const backdrop = buildScene3dBackdrop(s3d);
64058
- if (backdrop) {
64059
- scene3dXml["a:backdrop"] = backdrop;
64060
- } else {
64061
- delete scene3dXml["a:backdrop"];
64062
- }
64063
- spPr["a:scene3d"] = scene3dXml;
64064
- } else {
64065
- delete spPr["a:scene3d"];
64066
- }
64067
- } else if (shapeStyle.scene3d === void 0) {
64068
- delete spPr["a:scene3d"];
64069
- }
64070
- if (shapeStyle.shape3d) {
64071
- const sh3d = shapeStyle.shape3d;
64072
- const hasData = sh3d.extrusionHeight !== void 0 || sh3d.contourWidth !== void 0 || sh3d.presetMaterial || sh3d.bevelTopType || sh3d.bevelBottomType || sh3d.extrusionColor || sh3d.contourColor;
64073
- if (hasData) {
64074
- const sp3dXml = {};
64075
- if (sh3d.extrusionHeight !== void 0) {
64076
- sp3dXml["@_extrusionH"] = String(sh3d.extrusionHeight);
64077
- }
64078
- if (sh3d.contourWidth !== void 0) {
64079
- sp3dXml["@_contourW"] = String(sh3d.contourWidth);
64080
- }
64081
- if (sh3d.presetMaterial) {
64082
- sp3dXml["@_prstMaterial"] = sh3d.presetMaterial;
64083
- }
64084
- if (sh3d.bevelTopType) {
64085
- const bevelT = { "@_prst": sh3d.bevelTopType };
64086
- if (sh3d.bevelTopWidth !== void 0) {
64087
- bevelT["@_w"] = String(sh3d.bevelTopWidth);
64088
- }
64089
- if (sh3d.bevelTopHeight !== void 0) {
64090
- bevelT["@_h"] = String(sh3d.bevelTopHeight);
64091
- }
64092
- sp3dXml["a:bevelT"] = bevelT;
64093
- }
64094
- if (sh3d.bevelBottomType) {
64095
- const bevelB = { "@_prst": sh3d.bevelBottomType };
64096
- if (sh3d.bevelBottomWidth !== void 0) {
64097
- bevelB["@_w"] = String(sh3d.bevelBottomWidth);
64098
- }
64099
- if (sh3d.bevelBottomHeight !== void 0) {
64100
- bevelB["@_h"] = String(sh3d.bevelBottomHeight);
64101
- }
64102
- sp3dXml["a:bevelB"] = bevelB;
64103
- }
64104
- if (sh3d.extrusionColor) {
64105
- sp3dXml["a:extrusionClr"] = {
64106
- "a:srgbClr": { "@_val": sh3d.extrusionColor.replace("#", "") }
64107
- };
64108
- }
64109
- if (sh3d.contourColor) {
64110
- sp3dXml["a:contourClr"] = {
64111
- "a:srgbClr": { "@_val": sh3d.contourColor.replace("#", "") }
64112
- };
64113
- }
64114
- spPr["a:sp3d"] = sp3dXml;
64260
+ if (Object.keys(effectList).length === 0) {
64261
+ setEffectChild(spPr, "effectLst", void 0);
64115
64262
  } else {
64116
- delete spPr["a:sp3d"];
64263
+ setEffectChild(spPr, "effectLst", reorderObjectKeys(effectList, EFFECT_LST_ORDER));
64117
64264
  }
64118
- } else if (shapeStyle.shape3d === void 0) {
64119
- delete spPr["a:sp3d"];
64120
64265
  }
64121
64266
  }
64122
- };
64267
+ }
64268
+ function writeEffectDag(spPr, shapeStyle) {
64269
+ const effectDagXml = shapeStyle.effectDagTree ? serializeEffectDagContainer(shapeStyle.effectDagTree) : shapeStyle.effectDagXml;
64270
+ if (effectDagXml) {
64271
+ setEffectChild(spPr, "effectDag", effectDagXml);
64272
+ }
64273
+ }
64123
64274
  function buildSphereRot(lat, lon, rev) {
64124
64275
  if (lat === void 0 && lon === void 0 && rev === void 0) {
64125
64276
  return void 0;
@@ -64191,6 +64342,109 @@ function buildScene3dBackdrop(s3d) {
64191
64342
  }
64192
64343
  };
64193
64344
  }
64345
+ function writeScene3d(spPr, shapeStyle) {
64346
+ if (shapeStyle.scene3d) {
64347
+ const s3d = shapeStyle.scene3d;
64348
+ const hasData = s3d.cameraPreset || s3d.lightRigType;
64349
+ if (hasData) {
64350
+ const source = spPr["a:scene3d"] ?? {};
64351
+ const scene3dXml = { ...source };
64352
+ scene3dXml["a:camera"] = buildScene3dCamera(s3d, source);
64353
+ const lightRig = buildScene3dLightRig(s3d, source);
64354
+ if (lightRig) {
64355
+ scene3dXml["a:lightRig"] = lightRig;
64356
+ }
64357
+ const backdrop = buildScene3dBackdrop(s3d);
64358
+ if (backdrop) {
64359
+ scene3dXml["a:backdrop"] = backdrop;
64360
+ } else {
64361
+ delete scene3dXml["a:backdrop"];
64362
+ }
64363
+ spPr["a:scene3d"] = scene3dXml;
64364
+ } else {
64365
+ delete spPr["a:scene3d"];
64366
+ }
64367
+ } else if (shapeStyle.scene3d === void 0) {
64368
+ delete spPr["a:scene3d"];
64369
+ }
64370
+ }
64371
+ function writeShape3d(spPr, shapeStyle) {
64372
+ if (shapeStyle.shape3d) {
64373
+ const sh3d = shapeStyle.shape3d;
64374
+ const hasData = sh3d.extrusionHeight !== void 0 || sh3d.contourWidth !== void 0 || sh3d.presetMaterial || sh3d.bevelTopType || sh3d.bevelBottomType || sh3d.extrusionColor || sh3d.contourColor;
64375
+ if (hasData) {
64376
+ const sp3dXml = {};
64377
+ if (sh3d.extrusionHeight !== void 0) {
64378
+ sp3dXml["@_extrusionH"] = String(sh3d.extrusionHeight);
64379
+ }
64380
+ if (sh3d.contourWidth !== void 0) {
64381
+ sp3dXml["@_contourW"] = String(sh3d.contourWidth);
64382
+ }
64383
+ if (sh3d.presetMaterial) {
64384
+ sp3dXml["@_prstMaterial"] = sh3d.presetMaterial;
64385
+ }
64386
+ if (sh3d.bevelTopType) {
64387
+ const bevelT = { "@_prst": sh3d.bevelTopType };
64388
+ if (sh3d.bevelTopWidth !== void 0) {
64389
+ bevelT["@_w"] = String(sh3d.bevelTopWidth);
64390
+ }
64391
+ if (sh3d.bevelTopHeight !== void 0) {
64392
+ bevelT["@_h"] = String(sh3d.bevelTopHeight);
64393
+ }
64394
+ sp3dXml["a:bevelT"] = bevelT;
64395
+ }
64396
+ if (sh3d.bevelBottomType) {
64397
+ const bevelB = { "@_prst": sh3d.bevelBottomType };
64398
+ if (sh3d.bevelBottomWidth !== void 0) {
64399
+ bevelB["@_w"] = String(sh3d.bevelBottomWidth);
64400
+ }
64401
+ if (sh3d.bevelBottomHeight !== void 0) {
64402
+ bevelB["@_h"] = String(sh3d.bevelBottomHeight);
64403
+ }
64404
+ sp3dXml["a:bevelB"] = bevelB;
64405
+ }
64406
+ if (sh3d.extrusionColor) {
64407
+ sp3dXml["a:extrusionClr"] = {
64408
+ "a:srgbClr": { "@_val": sh3d.extrusionColor.replace("#", "") }
64409
+ };
64410
+ }
64411
+ if (sh3d.contourColor) {
64412
+ sp3dXml["a:contourClr"] = {
64413
+ "a:srgbClr": { "@_val": sh3d.contourColor.replace("#", "") }
64414
+ };
64415
+ }
64416
+ spPr["a:sp3d"] = sp3dXml;
64417
+ } else {
64418
+ delete spPr["a:sp3d"];
64419
+ }
64420
+ } else if (shapeStyle.shape3d === void 0) {
64421
+ delete spPr["a:sp3d"];
64422
+ }
64423
+ }
64424
+ var PptxHandlerRuntime29 = class extends PptxHandlerRuntime28 {
64425
+ /**
64426
+ * Serialize visual effects (shadow, glow, reflection, blur, soft edge),
64427
+ * effectDag, 3D scene, and 3D shape properties to the given spPr XML object.
64428
+ *
64429
+ * The whole body lives in {@link writeShapeEffects} as a free function so
64430
+ * the colocated unit test can import and drive the REAL logic (it used to
64431
+ * keep a private copy - "its mixin chain crashes on load" - which meant it
64432
+ * could not fail when production drifted). This method only supplies the
64433
+ * runtime-bound effect builders.
64434
+ */
64435
+ applyEffectsAndThreeD(spPr, shapeStyle) {
64436
+ const presetShadowXml = shapeStyle.presetShadowName ? this.buildPresetShadowXml(shapeStyle) : void 0;
64437
+ writeShapeEffects(spPr, shapeStyle, {
64438
+ outerShadowXml: presetShadowXml ? void 0 : this.buildOuterShadowXml(shapeStyle),
64439
+ presetShadowXml,
64440
+ innerShadowXml: this.buildInnerShadowXml(shapeStyle),
64441
+ glowXml: this.buildGlowXml(shapeStyle),
64442
+ softEdgeXml: this.buildSoftEdgeXml(shapeStyle),
64443
+ reflectionXml: this.buildReflectionXml(shapeStyle),
64444
+ blurXml: this.buildBlurXml(shapeStyle)
64445
+ });
64446
+ }
64447
+ };
64194
64448
  var PptxHandlerRuntime30 = class _PptxHandlerRuntime10 extends PptxHandlerRuntime29 {
64195
64449
  /**
64196
64450
  * Build and write the text body (`p:txBody`) for shapes, text boxes,
@@ -67864,7 +68118,15 @@ function orderContainer(container, plan, getLocalName2) {
67864
68118
  return orderShapeTreeChildren(working, (node) => positions.get(node), getLocalName2);
67865
68119
  }
67866
68120
  function orderedTemplatePartXml(options) {
67867
- const { runtime, partPath, xmlObj, rootTag: rootTag2, sourceXml, getLocalName: getLocalName2 } = options;
68121
+ const {
68122
+ runtime,
68123
+ partPath,
68124
+ xmlObj,
68125
+ rootTag: rootTag2,
68126
+ sourceXml,
68127
+ getLocalName: getLocalName2,
68128
+ alternateContentBlockByRawXml
68129
+ } = options;
67868
68130
  const root = xmlObj[rootTag2];
67869
68131
  if (!isXmlObject8(root)) {
67870
68132
  return xmlObj;
@@ -67877,8 +68139,9 @@ function orderedTemplatePartXml(options) {
67877
68139
  if (!isXmlObject8(spTree)) {
67878
68140
  return xmlObj;
67879
68141
  }
68142
+ const rewrapped = reapplyAlternateContentToTree(spTree, alternateContentBlockByRawXml);
67880
68143
  const rebuilt = positionsByRuntime.get(runtime)?.get(partPath);
67881
- const ordered32 = rebuilt ? orderShapeTreeChildren(spTree, (node) => rebuilt.get(node), getLocalName2) : orderContainer(spTree, sourceXml ? scanSpTreeDocumentOrder(sourceXml) : [], getLocalName2);
68144
+ const ordered32 = rebuilt ? orderShapeTreeChildren(rewrapped, (node) => rebuilt.get(node), getLocalName2) : orderContainer(rewrapped, sourceXml ? scanSpTreeDocumentOrder(sourceXml) : [], getLocalName2);
67882
68145
  if (ordered32 === spTree) {
67883
68146
  return xmlObj;
67884
68147
  }
@@ -68018,7 +68281,8 @@ var PptxHandlerRuntime45 = class extends PptxHandlerRuntime44 {
68018
68281
  xmlObj,
68019
68282
  rootTag: rootTag2,
68020
68283
  sourceXml: sourceXml ?? await this.zip.file(partPath)?.async("string"),
68021
- getLocalName: (key2) => this.compatibilityService.getXmlLocalName(key2)
68284
+ getLocalName: (key2) => this.compatibilityService.getXmlLocalName(key2),
68285
+ alternateContentBlockByRawXml: this.alternateContentBlockByRawXml
68022
68286
  });
68023
68287
  }
68024
68288
  getAuxiliaryMasterRelsPath(partPath) {
@@ -78048,9 +78312,20 @@ var PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
78048
78312
  false
78049
78313
  );
78050
78314
  }
78051
- const containerType = isCombo ? chartContainerLocalNameToType(this.compatibilityService.getXmlLocalName(containerKey)) : void 0;
78315
+ const resolvedContainerType = chartContainerLocalNameToType(
78316
+ this.compatibilityService.getXmlLocalName(containerKey)
78317
+ );
78318
+ const containerType = isCombo ? resolvedContainerType : void 0;
78052
78319
  const axisId = resolveChartContainerValueAxisId(container, axes ?? [], this.xmlLookupService);
78053
- series.push(...this.buildChartSeries(seriesList, categories, containerType, axisId));
78320
+ series.push(
78321
+ ...this.buildChartSeries(
78322
+ seriesList,
78323
+ categories,
78324
+ containerType,
78325
+ axisId,
78326
+ resolvedContainerType
78327
+ )
78328
+ );
78054
78329
  }
78055
78330
  return { categories, series };
78056
78331
  }
@@ -78094,9 +78369,15 @@ var PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
78094
78369
  * @param categories - Pre-parsed category labels (used for fallback values).
78095
78370
  * @param seriesChartType - When set (combo charts), tags every series in this
78096
78371
  * container with its source chart type for round-trip.
78372
+ * @param axisId - The container's resolved value-axis id, if any.
78373
+ * @param containerChartType - The container's actual chart type, always
78374
+ * resolved (unlike `seriesChartType`, which is combo-only). Used to decide
78375
+ * whether this container's series read their colour from a direct fill or
78376
+ * from the outline (`a:ln/a:solidFill`), so a plain (non-combo)
78377
+ * line/scatter/radar/stock chart's authored colour is not dropped.
78097
78378
  * @returns The series array matching `PptxChartData["series"]`.
78098
78379
  */
78099
- buildChartSeries(seriesList, categories, seriesChartType, axisId) {
78380
+ buildChartSeries(seriesList, categories, seriesChartType, axisId, containerChartType) {
78100
78381
  return seriesList.map((seriesNode, seriesIndex) => {
78101
78382
  const seriesName = this.extractChartSeriesName(seriesNode);
78102
78383
  const valNode = this.xmlLookupService.getChildByLocalName(seriesNode, "val") || this.xmlLookupService.getChildByLocalName(seriesNode, "yVal");
@@ -78119,7 +78400,7 @@ var PptxHandlerRuntime91 = class extends PptxHandlerRuntime90 {
78119
78400
  ) ?? ""
78120
78401
  ).trim();
78121
78402
  const seriesShapeProperties = this.xmlLookupService.getChildByLocalName(seriesNode, "spPr");
78122
- const readsLineColor = seriesChartType === "line" || seriesChartType === "line3D" || seriesChartType === "scatter" || seriesChartType === "radar" || seriesChartType === "stock";
78403
+ const readsLineColor = isLineDrawnChartType(containerChartType);
78123
78404
  const seriesColor22 = this.parseColor(
78124
78405
  this.xmlLookupService.getChildByLocalName(seriesShapeProperties, "solidFill")
78125
78406
  ) ?? (readsLineColor ? this.parseColor(