pptx-viewer-core 1.1.32 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1584,8 +1584,8 @@ var DEFAULT_COLORS = {
1584
1584
  };
1585
1585
  var DEFAULT_MAJOR_FONT = "Calibri Light";
1586
1586
  var DEFAULT_MINOR_FONT = "Calibri";
1587
- function hexToRgb(hex7) {
1588
- return hex7.replace(/^#/, "").toUpperCase();
1587
+ function hexToRgb(hex8) {
1588
+ return hex8.replace(/^#/, "").toUpperCase();
1589
1589
  }
1590
1590
  function isoNow() {
1591
1591
  return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d+Z$/, "Z");
@@ -4258,8 +4258,8 @@ var PptxColorTransformCodec = class {
4258
4258
  clampUnitInterval(value) {
4259
4259
  return Math.min(1, Math.max(0, value));
4260
4260
  }
4261
- hexToRgb(hex7) {
4262
- const normalized = hex7.replace("#", "");
4261
+ hexToRgb(hex8) {
4262
+ const normalized = hex8.replace("#", "");
4263
4263
  if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {
4264
4264
  return void 0;
4265
4265
  }
@@ -5769,7 +5769,7 @@ var PptxColorStyleCodec = class {
5769
5769
  parseColor: (colorNode, placeholderColor) => this.parseColor(colorNode, placeholderColor),
5770
5770
  extractColorOpacity: (colorNode) => this.extractColorOpacity(colorNode),
5771
5771
  clampUnitInterval: (value) => this.clampUnitInterval(value),
5772
- hexToRgb: (hex7) => this.hexToRgb(hex7),
5772
+ hexToRgb: (hex8) => this.hexToRgb(hex8),
5773
5773
  rgbToHex: (r, g, b) => this.rgbToHex(r, g, b)
5774
5774
  });
5775
5775
  this.shapeEffectXmlCodec = new PptxShapeEffectXmlCodec({
@@ -5792,8 +5792,8 @@ var PptxColorStyleCodec = class {
5792
5792
  clampUnitInterval(value) {
5793
5793
  return this.colorTransformCodec.clampUnitInterval(value);
5794
5794
  }
5795
- hexToRgb(hex7) {
5796
- return this.colorTransformCodec.hexToRgb(hex7);
5795
+ hexToRgb(hex8) {
5796
+ return this.colorTransformCodec.hexToRgb(hex8);
5797
5797
  }
5798
5798
  rgbToHex(r, g, b) {
5799
5799
  return this.colorTransformCodec.rgbToHex(r, g, b);
@@ -5964,9 +5964,9 @@ function normalizeHex(value) {
5964
5964
  if (raw.length === 0) {
5965
5965
  return "";
5966
5966
  }
5967
- const hex7 = raw.replace(/^#/, "");
5968
- if (/^[0-9a-fA-F]{6}$/.test(hex7)) {
5969
- return hex7.toUpperCase();
5967
+ const hex8 = raw.replace(/^#/, "");
5968
+ if (/^[0-9a-fA-F]{6}$/.test(hex8)) {
5969
+ return hex8.toUpperCase();
5970
5970
  }
5971
5971
  return raw.toLowerCase();
5972
5972
  }
@@ -5976,8 +5976,8 @@ function colorsEqual(left, right) {
5976
5976
  }
5977
5977
  return normalizeHex(left) === normalizeHex(right);
5978
5978
  }
5979
- function buildSrgbColorChoice(hex7, opacity) {
5980
- const normalized = String(hex7 || "").replace(/^#/, "");
5979
+ function buildSrgbColorChoice(hex8, opacity) {
5980
+ const normalized = String(hex8 || "").replace(/^#/, "");
5981
5981
  const srgb = { "@_val": normalized };
5982
5982
  if (typeof opacity === "number" && Number.isFinite(opacity) && opacity >= 0 && opacity < 1) {
5983
5983
  const alphaPct = Math.round(Math.max(0, Math.min(1, opacity)) * 1e5);
@@ -9489,9 +9489,9 @@ function decodeKeyframeValue(valNode) {
9489
9489
  if (strVal && strVal["@_val"] !== void 0) {
9490
9490
  return { value: String(strVal["@_val"]), valueType: "str" };
9491
9491
  }
9492
- const boolVal2 = valNode["p:boolVal"];
9493
- if (boolVal2 && boolVal2["@_val"] !== void 0) {
9494
- const raw = boolVal2["@_val"];
9492
+ const boolVal3 = valNode["p:boolVal"];
9493
+ if (boolVal3 && boolVal3["@_val"] !== void 0) {
9494
+ const raw = boolVal3["@_val"];
9495
9495
  const value = raw === "1" || raw === "true";
9496
9496
  return { value, valueType: "bool" };
9497
9497
  }
@@ -12737,13 +12737,13 @@ function generateFontGuid() {
12737
12737
  bytes[i] = Math.floor(Math.random() * 256);
12738
12738
  }
12739
12739
  }
12740
- const hex7 = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join("");
12740
+ const hex8 = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join("");
12741
12741
  return [
12742
- hex7.substring(0, 8),
12743
- hex7.substring(8, 12),
12744
- hex7.substring(12, 16),
12745
- hex7.substring(16, 20),
12746
- hex7.substring(20, 32)
12742
+ hex8.substring(0, 8),
12743
+ hex8.substring(8, 12),
12744
+ hex8.substring(12, 16),
12745
+ hex8.substring(16, 20),
12746
+ hex8.substring(20, 32)
12747
12747
  ].join("-");
12748
12748
  }
12749
12749
  function detectFontFormat(data) {
@@ -13064,7 +13064,8 @@ function parseSeriesDataPoints(seriesNode, xmlLookup, colorParser) {
13064
13064
  }).filter((dp) => dp !== void 0);
13065
13065
  }
13066
13066
  function parseSeriesDataLabels(seriesNode, xmlLookup) {
13067
- const dLblNodes = xmlLookup.getChildrenArrayByLocalName(seriesNode, "dLbl");
13067
+ const dLblsNode = xmlLookup.getChildByLocalName(seriesNode, "dLbls");
13068
+ const dLblNodes = dLblsNode ? xmlLookup.getChildrenArrayByLocalName(dLblsNode, "dLbl") : xmlLookup.getChildrenArrayByLocalName(seriesNode, "dLbl");
13068
13069
  if (dLblNodes.length === 0) {
13069
13070
  return [];
13070
13071
  }
@@ -13074,6 +13075,10 @@ function parseSeriesDataLabels(seriesNode, xmlLookup) {
13074
13075
  if (idx === void 0) {
13075
13076
  return void 0;
13076
13077
  }
13078
+ const deleteNode = xmlLookup.getChildByLocalName(node, "delete");
13079
+ if (deleteNode?.["@_val"] === "1" || deleteNode?.["@_val"] === "true") {
13080
+ return { idx };
13081
+ }
13077
13082
  const result = { idx };
13078
13083
  const boolFields = [
13079
13084
  ["showVal", "showVal"],
@@ -13421,6 +13426,29 @@ function collectAxisTextValues(node, results) {
13421
13426
  }
13422
13427
  }
13423
13428
 
13429
+ // src/core/utils/chart-container-type-map.ts
13430
+ var CONTAINER_LOCAL_NAME_TO_TYPE = {
13431
+ barChart: "bar",
13432
+ bar3DChart: "bar3D",
13433
+ lineChart: "line",
13434
+ line3DChart: "line3D",
13435
+ pieChart: "pie",
13436
+ pie3DChart: "pie3D",
13437
+ ofPieChart: "ofPie",
13438
+ doughnutChart: "doughnut",
13439
+ areaChart: "area",
13440
+ area3DChart: "area3D",
13441
+ scatterChart: "scatter",
13442
+ bubbleChart: "bubble",
13443
+ radarChart: "radar",
13444
+ stockChart: "stock",
13445
+ surfaceChart: "surface",
13446
+ surface3DChart: "surface"
13447
+ };
13448
+ function chartContainerLocalNameToType(localName) {
13449
+ return CONTAINER_LOCAL_NAME_TO_TYPE[localName];
13450
+ }
13451
+
13424
13452
  // src/core/utils/chart-cx-parser.ts
13425
13453
  function extractCxSeriesColor(ser, xmlLookup) {
13426
13454
  const spPr = xmlLookup.getChildByLocalName(ser, "spPr");
@@ -15176,10 +15204,10 @@ function applyBackgroundColorToCSld(cSld, backgroundColor) {
15176
15204
  delete cSld["p:bg"];
15177
15205
  return;
15178
15206
  }
15179
- const hex7 = backgroundColor.replace(/^#/, "").toUpperCase();
15207
+ const hex8 = backgroundColor.replace(/^#/, "").toUpperCase();
15180
15208
  cSld["p:bg"] = {
15181
15209
  "p:bgPr": {
15182
- "a:solidFill": { "a:srgbClr": { "@_val": hex7 } },
15210
+ "a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
15183
15211
  "a:effectLst": {}
15184
15212
  }
15185
15213
  };
@@ -15802,8 +15830,8 @@ function accentColor(index, themeColorMap) {
15802
15830
  }
15803
15831
  return DEFAULT_ACCENT_COLORS[index % DEFAULT_ACCENT_COLORS.length];
15804
15832
  }
15805
- function lighten(hex7, amount) {
15806
- const parsed = hex7.replace("#", "");
15833
+ function lighten(hex8, amount) {
15834
+ const parsed = hex8.replace("#", "");
15807
15835
  const r = parseInt(parsed.substring(0, 2), 16);
15808
15836
  const g = parseInt(parsed.substring(2, 4), 16);
15809
15837
  const b = parseInt(parsed.substring(4, 6), 16);
@@ -21418,11 +21446,11 @@ async function repairPptx(buffer) {
21418
21446
  }
21419
21447
 
21420
21448
  // src/core/utils/theme-switching.ts
21421
- function normalizeHex2(hex7) {
21422
- if (!hex7) {
21449
+ function normalizeHex2(hex8) {
21450
+ if (!hex8) {
21423
21451
  return "";
21424
21452
  }
21425
- return hex7.replace(/^#/, "").toUpperCase().slice(0, 6);
21453
+ return hex8.replace(/^#/, "").toUpperCase().slice(0, 6);
21426
21454
  }
21427
21455
  function buildColorRemapTable(oldColorMap, newColorMap) {
21428
21456
  const remap = /* @__PURE__ */ new Map();
@@ -21616,8 +21644,8 @@ function applyThemeToData(data, newColorScheme, newFontScheme, themeName) {
21616
21644
  }
21617
21645
 
21618
21646
  // src/core/utils/accessibility-checker.ts
21619
- function parseHexColor(hex7) {
21620
- const cleaned = hex7.replace(/^#/, "");
21647
+ function parseHexColor(hex8) {
21648
+ const cleaned = hex8.replace(/^#/, "");
21621
21649
  if (!/^[\da-fA-F]+$/.test(cleaned)) {
21622
21650
  return null;
21623
21651
  }
@@ -24917,6 +24945,37 @@ function ensureArray6(v) {
24917
24945
  }
24918
24946
  return Array.isArray(v) ? v : [v];
24919
24947
  }
24948
+ function consolidateComboContainersInXml(plotArea, getLocalName) {
24949
+ const containerKeys = Object.keys(plotArea).filter((k) => getLocalName(k).endsWith("Chart"));
24950
+ if (containerKeys.length === 0) {
24951
+ return void 0;
24952
+ }
24953
+ const primaryKey = containerKeys[0];
24954
+ if (containerKeys.length === 1) {
24955
+ return primaryKey;
24956
+ }
24957
+ const primary = plotArea[primaryKey];
24958
+ if (!primary) {
24959
+ return primaryKey;
24960
+ }
24961
+ const serKey = findKey4(primary, "ser", getLocalName) ?? "c:ser";
24962
+ const allSeries = [];
24963
+ for (const key of containerKeys) {
24964
+ const container = plotArea[key];
24965
+ if (!container) {
24966
+ continue;
24967
+ }
24968
+ const containerSerKey = findKey4(container, "ser", getLocalName);
24969
+ if (containerSerKey) {
24970
+ allSeries.push(...ensureArray6(container[containerSerKey]));
24971
+ }
24972
+ if (key !== primaryKey) {
24973
+ delete plotArea[key];
24974
+ }
24975
+ }
24976
+ primary[serKey] = allSeries.length === 1 ? allSeries[0] : allSeries;
24977
+ return primaryKey;
24978
+ }
24920
24979
  function effectiveContainers(series, chartLevelType) {
24921
24980
  return series.map((s) => {
24922
24981
  const t = s.seriesChartType ?? chartLevelType;
@@ -25368,6 +25427,146 @@ function applySeriesMarkerToXml(seriesNode, marker, getLocalName) {
25368
25427
  insertOrdered2(seriesNode, "c:marker", built, getLocalName);
25369
25428
  }
25370
25429
 
25430
+ // src/core/utils/chart-series-datalabel-serializer.ts
25431
+ function findKey9(obj, local, getLocalName) {
25432
+ return Object.keys(obj).find((k) => getLocalName(k) === local);
25433
+ }
25434
+ function boolVal2(on) {
25435
+ return { "@_val": on ? "1" : "0" };
25436
+ }
25437
+ var AFTER_DLBLS = /* @__PURE__ */ new Set(["cat", "val", "xVal", "yVal", "bubbleSize", "smooth", "extLst"]);
25438
+ var DLBLS_GROUP_ORDER = [
25439
+ "numFmt",
25440
+ "spPr",
25441
+ "txPr",
25442
+ "dLblPos",
25443
+ "showLegendKey",
25444
+ "showVal",
25445
+ "showCatName",
25446
+ "showSerName",
25447
+ "showPercent",
25448
+ "showBubbleSize",
25449
+ "separator",
25450
+ "showLeaderLines",
25451
+ "leaderLines"
25452
+ ];
25453
+ function buildDLbl(existing, label, getLocalName) {
25454
+ const node = {};
25455
+ node["c:idx"] = { "@_val": String(label.idx) };
25456
+ const hasShow = label.showVal !== void 0 || label.showCatName !== void 0 || label.showSerName !== void 0 || label.showPercent !== void 0 || label.showLegendKey !== void 0 || label.showBubbleSize !== void 0;
25457
+ const hasContent = hasShow || label.position !== void 0 || label.text !== void 0;
25458
+ if (!hasContent) {
25459
+ node["c:delete"] = { "@_val": "1" };
25460
+ return node;
25461
+ }
25462
+ if (existing) {
25463
+ const layoutKey = findKey9(existing, "layout", getLocalName);
25464
+ if (layoutKey) {
25465
+ node[layoutKey] = existing[layoutKey];
25466
+ }
25467
+ }
25468
+ if (label.text !== void 0) {
25469
+ node["c:tx"] = {
25470
+ "c:rich": {
25471
+ "a:bodyPr": {},
25472
+ "a:lstStyle": {},
25473
+ "a:p": { "a:r": { "a:t": label.text } }
25474
+ }
25475
+ };
25476
+ } else if (existing) {
25477
+ const txKey = findKey9(existing, "tx", getLocalName);
25478
+ if (txKey) {
25479
+ node[txKey] = existing[txKey];
25480
+ }
25481
+ }
25482
+ if (existing) {
25483
+ for (const local of ["numFmt", "spPr", "txPr"]) {
25484
+ const k = findKey9(existing, local, getLocalName);
25485
+ if (k) {
25486
+ node[k] = existing[k];
25487
+ }
25488
+ }
25489
+ }
25490
+ if (label.position !== void 0) {
25491
+ node["c:dLblPos"] = { "@_val": label.position };
25492
+ }
25493
+ if (label.showLegendKey !== void 0) {
25494
+ node["c:showLegendKey"] = boolVal2(label.showLegendKey);
25495
+ }
25496
+ if (label.showVal !== void 0) {
25497
+ node["c:showVal"] = boolVal2(label.showVal);
25498
+ }
25499
+ if (label.showCatName !== void 0) {
25500
+ node["c:showCatName"] = boolVal2(label.showCatName);
25501
+ }
25502
+ if (label.showSerName !== void 0) {
25503
+ node["c:showSerName"] = boolVal2(label.showSerName);
25504
+ }
25505
+ if (label.showPercent !== void 0) {
25506
+ node["c:showPercent"] = boolVal2(label.showPercent);
25507
+ }
25508
+ if (label.showBubbleSize !== void 0) {
25509
+ node["c:showBubbleSize"] = boolVal2(label.showBubbleSize);
25510
+ }
25511
+ return node;
25512
+ }
25513
+ function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName) {
25514
+ const dLblsKey = findKey9(seriesNode, "dLbls", getLocalName);
25515
+ const labels = dataLabels ?? [];
25516
+ const existingByIdx = /* @__PURE__ */ new Map();
25517
+ let groupChildren = [];
25518
+ if (dLblsKey) {
25519
+ const dLbls = seriesNode[dLblsKey];
25520
+ const dLblKey = findKey9(dLbls, "dLbl", getLocalName);
25521
+ if (dLblKey) {
25522
+ const nodes = Array.isArray(dLbls[dLblKey]) ? dLbls[dLblKey] : [dLbls[dLblKey]];
25523
+ for (const node of nodes) {
25524
+ const idxKey = findKey9(node, "idx", getLocalName);
25525
+ const idxNode = idxKey ? node[idxKey] : void 0;
25526
+ const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
25527
+ if (Number.isFinite(idx)) {
25528
+ existingByIdx.set(idx, node);
25529
+ }
25530
+ }
25531
+ }
25532
+ groupChildren = Object.keys(dLbls).filter((k) => getLocalName(k) !== "dLbl").map((k) => [k, dLbls[k]]);
25533
+ }
25534
+ if (labels.length === 0 && groupChildren.length === 0) {
25535
+ if (dLblsKey) {
25536
+ delete seriesNode[dLblsKey];
25537
+ }
25538
+ return;
25539
+ }
25540
+ const built = [...labels].sort((a, b) => a.idx - b.idx).map((label) => buildDLbl(existingByIdx.get(label.idx), label, getLocalName));
25541
+ const newDLbls = {};
25542
+ if (built.length > 0) {
25543
+ newDLbls["c:dLbl"] = built.length === 1 ? built[0] : built;
25544
+ }
25545
+ const ordered = [...groupChildren].sort((a, b) => {
25546
+ const ai = DLBLS_GROUP_ORDER.indexOf(getLocalName(a[0]));
25547
+ const bi = DLBLS_GROUP_ORDER.indexOf(getLocalName(b[0]));
25548
+ return (ai === -1 ? DLBLS_GROUP_ORDER.length : ai) - (bi === -1 ? DLBLS_GROUP_ORDER.length : bi);
25549
+ });
25550
+ for (const [k, v] of ordered) {
25551
+ newDLbls[k] = v;
25552
+ }
25553
+ if (dLblsKey) {
25554
+ seriesNode[dLblsKey] = newDLbls;
25555
+ return;
25556
+ }
25557
+ const keys = Object.keys(seriesNode);
25558
+ const beforeIdx = keys.findIndex((k) => AFTER_DLBLS.has(getLocalName(k)));
25559
+ const entries = keys.map((k) => [k, seriesNode[k]]);
25560
+ const at = beforeIdx === -1 ? entries.length : beforeIdx;
25561
+ entries.splice(at, 0, ["c:dLbls", newDLbls]);
25562
+ for (const k of keys) {
25563
+ delete seriesNode[k];
25564
+ }
25565
+ for (const [k, v] of entries) {
25566
+ seriesNode[k] = v;
25567
+ }
25568
+ }
25569
+
25371
25570
  // src/core/utils/chart-trendline-serializer.ts
25372
25571
  var TYPE_TO_OOXML = {
25373
25572
  linear: "linear",
@@ -25377,7 +25576,7 @@ var TYPE_TO_OOXML = {
25377
25576
  power: "power",
25378
25577
  movingAvg: "movingAvg"
25379
25578
  };
25380
- function findKey9(obj, local, getLocalName) {
25579
+ function findKey10(obj, local, getLocalName) {
25381
25580
  return Object.keys(obj).find((k) => getLocalName(k) === local);
25382
25581
  }
25383
25582
  function ensureArray9(v) {
@@ -25394,10 +25593,10 @@ function buildSpPr(existing, color, getLocalName) {
25394
25593
  return existing;
25395
25594
  }
25396
25595
  const spPr = existing ? { ...existing } : {};
25397
- const lnKey = findKey9(spPr, "ln", getLocalName) ?? "a:ln";
25596
+ const lnKey = findKey10(spPr, "ln", getLocalName) ?? "a:ln";
25398
25597
  const existingLn = spPr[lnKey] ?? {};
25399
- const fillKey = findKey9(existingLn, "solidFill", getLocalName) ?? "a:solidFill";
25400
- const noFillKey = findKey9(existingLn, "noFill", getLocalName);
25598
+ const fillKey = findKey10(existingLn, "solidFill", getLocalName) ?? "a:solidFill";
25599
+ const noFillKey = findKey10(existingLn, "noFill", getLocalName);
25401
25600
  const ln = { ...existingLn };
25402
25601
  if (noFillKey) {
25403
25602
  delete ln[noFillKey];
@@ -25409,13 +25608,13 @@ function buildSpPr(existing, color, getLocalName) {
25409
25608
  function buildTrendline(existing, t, getLocalName) {
25410
25609
  const node = {};
25411
25610
  if (existing) {
25412
- const nameKey = findKey9(existing, "name", getLocalName);
25611
+ const nameKey = findKey10(existing, "name", getLocalName);
25413
25612
  if (nameKey) {
25414
25613
  node["c:name"] = existing[nameKey];
25415
25614
  }
25416
25615
  }
25417
25616
  const spPr = buildSpPr(
25418
- existing ? existing[findKey9(existing, "spPr", getLocalName) ?? ""] : void 0,
25617
+ existing ? existing[findKey10(existing, "spPr", getLocalName) ?? ""] : void 0,
25419
25618
  t.color,
25420
25619
  getLocalName
25421
25620
  );
@@ -25445,7 +25644,7 @@ function buildTrendline(existing, t, getLocalName) {
25445
25644
  node["c:dispEq"] = { "@_val": "1" };
25446
25645
  }
25447
25646
  if (existing) {
25448
- const lblKey = findKey9(existing, "trendlineLbl", getLocalName);
25647
+ const lblKey = findKey10(existing, "trendlineLbl", getLocalName);
25449
25648
  if (lblKey) {
25450
25649
  node["c:trendlineLbl"] = existing[lblKey];
25451
25650
  }
@@ -25453,7 +25652,7 @@ function buildTrendline(existing, t, getLocalName) {
25453
25652
  return node;
25454
25653
  }
25455
25654
  function applySeriesTrendlinesToXml(seriesNode, trendlines, getLocalName) {
25456
- const existingKey = findKey9(seriesNode, "trendline", getLocalName);
25655
+ const existingKey = findKey10(seriesNode, "trendline", getLocalName);
25457
25656
  const existingNodes = existingKey ? ensureArray9(seriesNode[existingKey]) : [];
25458
25657
  const built = trendlines.map((t, i) => buildTrendline(existingNodes[i], t, getLocalName));
25459
25658
  if (existingKey) {
@@ -28663,8 +28862,8 @@ function buildTextRunEffectListXml(style) {
28663
28862
  }
28664
28863
  return effectLst;
28665
28864
  }
28666
- function buildShadowColorNode(hex7, opacity) {
28667
- const clr = hex7.replace("#", "");
28865
+ function buildShadowColorNode(hex8, opacity) {
28866
+ const clr = hex8.replace("#", "");
28668
28867
  const alpha = typeof opacity === "number" ? Math.round(opacity * 1e5) : void 0;
28669
28868
  return {
28670
28869
  "@_val": clr,
@@ -31907,8 +32106,8 @@ function updateCellTextStyleInRawXml(element, rowIndex, colIndex, styleUpdates)
31907
32106
  }
31908
32107
  }
31909
32108
  if ("color" in styleUpdates && typeof styleUpdates.color === "string") {
31910
- const hex7 = styleUpdates.color.replace("#", "");
31911
- rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex7 } };
32109
+ const hex8 = styleUpdates.color.replace("#", "");
32110
+ rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex8 } };
31912
32111
  }
31913
32112
  if ("align" in styleUpdates) {
31914
32113
  const pPr = paragraph["a:pPr"] ?? {};
@@ -31948,8 +32147,8 @@ function updateCellTextStyleInRawXml(element, rowIndex, colIndex, styleUpdates)
31948
32147
  }
31949
32148
  }
31950
32149
  if ("color" in styleUpdates && typeof styleUpdates.color === "string") {
31951
- const hex7 = styleUpdates.color.replace("#", "");
31952
- endRPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex7 } };
32150
+ const hex8 = styleUpdates.color.replace("#", "");
32151
+ endRPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex8 } };
31953
32152
  }
31954
32153
  }
31955
32154
  }
@@ -32228,6 +32427,10 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
32228
32427
  if (!plotArea) {
32229
32428
  continue;
32230
32429
  }
32430
+ consolidateComboContainersInXml(
32431
+ plotArea,
32432
+ (key) => this.compatibilityService.getXmlLocalName(key)
32433
+ );
32231
32434
  let chartTypeKey = Object.keys(plotArea).find(
32232
32435
  (key) => this.compatibilityService.getXmlLocalName(key).endsWith("Chart")
32233
32436
  );
@@ -32290,19 +32493,19 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
32290
32493
  this.updateChartCacheValues(valNode, true, seriesData.values.map(String));
32291
32494
  }
32292
32495
  if (seriesData.color) {
32293
- const hex7 = seriesData.color.replace("#", "");
32496
+ const hex8 = seriesData.color.replace("#", "");
32294
32497
  const spPr = this.xmlLookupService.getChildByLocalName(seriesNode, "spPr");
32295
32498
  if (spPr) {
32296
32499
  const solidFillKey = Object.keys(spPr).find(
32297
32500
  (k) => this.compatibilityService.getXmlLocalName(k) === "solidFill"
32298
32501
  ) ?? "a:solidFill";
32299
- spPr[solidFillKey] = { "a:srgbClr": { "@_val": hex7 } };
32502
+ spPr[solidFillKey] = { "a:srgbClr": { "@_val": hex8 } };
32300
32503
  } else {
32301
32504
  const spPrKey = Object.keys(seriesNode).find(
32302
32505
  (k) => this.compatibilityService.getXmlLocalName(k) === "spPr"
32303
32506
  ) ?? "c:spPr";
32304
32507
  seriesNode[spPrKey] = {
32305
- "a:solidFill": { "a:srgbClr": { "@_val": hex7 } }
32508
+ "a:solidFill": { "a:srgbClr": { "@_val": hex8 } }
32306
32509
  };
32307
32510
  }
32308
32511
  }
@@ -32334,6 +32537,13 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
32334
32537
  (key) => this.compatibilityService.getXmlLocalName(key)
32335
32538
  );
32336
32539
  }
32540
+ if (seriesData.dataLabels !== void 0) {
32541
+ applySeriesDataLabelsToXml(
32542
+ seriesNode,
32543
+ seriesData.dataLabels,
32544
+ (key) => this.compatibilityService.getXmlLocalName(key)
32545
+ );
32546
+ }
32337
32547
  }
32338
32548
  if (chartData.series.length > seriesNodes.length) {
32339
32549
  const templateSeries = seriesNodes.length > 0 ? seriesNodes[seriesNodes.length - 1] : void 0;
@@ -32863,36 +33073,131 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
32863
33073
  }
32864
33074
  };
32865
33075
 
32866
- // src/core/core/runtime/smartart-save-chrome.ts
33076
+ // src/core/core/runtime/smartart-colors-builder.ts
32867
33077
  function asObject(value) {
33078
+ return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
33079
+ }
33080
+ function toArray(value) {
33081
+ if (Array.isArray(value)) {
33082
+ return value.filter((entry) => Boolean(asObject(entry)));
33083
+ }
33084
+ const obj = asObject(value);
33085
+ return obj ? [obj] : [];
33086
+ }
33087
+ function findKey11(obj, name, getLocalName) {
33088
+ return Object.keys(obj).find((k) => getLocalName(k) === name);
33089
+ }
33090
+ function hex7(value) {
33091
+ return value.replace("#", "");
33092
+ }
33093
+ var COLOR_LOCAL_NAMES = /* @__PURE__ */ new Set([
33094
+ "srgbClr",
33095
+ "schemeClr",
33096
+ "sysClr",
33097
+ "prstClr",
33098
+ "scrgbClr",
33099
+ "hslClr"
33100
+ ]);
33101
+ function applyColorToList(list, value, getLocalName) {
33102
+ const colorKey = Object.keys(list).find((k) => COLOR_LOCAL_NAMES.has(getLocalName(k)));
33103
+ const srgb = { "@_val": hex7(value) };
33104
+ if (!colorKey) {
33105
+ list["a:srgbClr"] = srgb;
33106
+ return;
33107
+ }
33108
+ const existing = list[colorKey];
33109
+ const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(asObject(entry))) : [];
33110
+ if (colorKey !== "a:srgbClr") {
33111
+ delete list[colorKey];
33112
+ }
33113
+ list["a:srgbClr"] = rest.length > 0 ? [srgb, ...rest] : srgb;
33114
+ }
33115
+ function applySmartArtColorTransform(colorsDef, transform, getLocalName) {
33116
+ if (!transform) {
33117
+ return false;
33118
+ }
33119
+ let mutated = false;
33120
+ if (transform.name && transform.name.length > 0) {
33121
+ if (colorsDef["@_title"] !== transform.name) {
33122
+ colorsDef["@_title"] = transform.name;
33123
+ mutated = true;
33124
+ }
33125
+ }
33126
+ const styleLblKey = findKey11(colorsDef, "styleLbl", getLocalName);
33127
+ if (!styleLblKey) {
33128
+ return mutated;
33129
+ }
33130
+ const labels = toArray(colorsDef[styleLblKey]);
33131
+ if (labels.length === 0) {
33132
+ return mutated;
33133
+ }
33134
+ let fillIndex = 0;
33135
+ let lineIndex = 0;
33136
+ for (const label of labels) {
33137
+ const fillKey = findKey11(label, "fillClrLst", getLocalName);
33138
+ if (fillKey) {
33139
+ const value = transform.fillColors[fillIndex++];
33140
+ const list = asObject(label[fillKey]);
33141
+ if (list && value) {
33142
+ applyColorToList(list, value, getLocalName);
33143
+ mutated = true;
33144
+ }
33145
+ }
33146
+ const lineKey = findKey11(label, "linClrLst", getLocalName);
33147
+ if (lineKey) {
33148
+ const value = transform.lineColors[lineIndex++];
33149
+ const list = asObject(label[lineKey]);
33150
+ if (list && value) {
33151
+ applyColorToList(list, value, getLocalName);
33152
+ mutated = true;
33153
+ }
33154
+ }
33155
+ }
33156
+ return mutated;
33157
+ }
33158
+
33159
+ // src/core/core/runtime/smartart-quickstyle-builder.ts
33160
+ function applySmartArtQuickStyle(styleDef, quickStyle) {
33161
+ if (!quickStyle || !quickStyle.name || quickStyle.name.length === 0) {
33162
+ return false;
33163
+ }
33164
+ if (styleDef["@_title"] === quickStyle.name) {
33165
+ return false;
33166
+ }
33167
+ styleDef["@_title"] = quickStyle.name;
33168
+ return true;
33169
+ }
33170
+
33171
+ // src/core/core/runtime/smartart-save-chrome.ts
33172
+ function asObject2(value) {
32868
33173
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
32869
33174
  }
32870
33175
  function applySmartArtChrome(dataModel, chrome, getLocalName) {
32871
33176
  if (!chrome || !chrome.backgroundColor && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
32872
33177
  return;
32873
33178
  }
32874
- const findKey10 = (obj, name) => Object.keys(obj).find((k) => getLocalName(k) === name);
33179
+ const findKey12 = (obj, name) => Object.keys(obj).find((k) => getLocalName(k) === name);
32875
33180
  if (chrome.backgroundColor) {
32876
- const hex7 = chrome.backgroundColor.replace("#", "");
32877
- const bgKey = findKey10(dataModel, "bg") ?? "dgm:bg";
32878
- const bg = asObject(dataModel[bgKey]);
32879
- const fillKey = findKey10(bg, "solidFill") ?? "a:solidFill";
32880
- bg[fillKey] = { "a:srgbClr": { "@_val": hex7 } };
33181
+ const hex8 = chrome.backgroundColor.replace("#", "");
33182
+ const bgKey = findKey12(dataModel, "bg") ?? "dgm:bg";
33183
+ const bg = asObject2(dataModel[bgKey]);
33184
+ const fillKey = findKey12(bg, "solidFill") ?? "a:solidFill";
33185
+ bg[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
32881
33186
  dataModel[bgKey] = bg;
32882
33187
  }
32883
33188
  const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
32884
33189
  if (chrome.outlineColor || hasOutlineWidth) {
32885
- const wholeKey = findKey10(dataModel, "whole") ?? "dgm:whole";
32886
- const whole = asObject(dataModel[wholeKey]);
32887
- const lnKey = findKey10(whole, "ln") ?? "a:ln";
32888
- const ln = asObject(whole[lnKey]);
33190
+ const wholeKey = findKey12(dataModel, "whole") ?? "dgm:whole";
33191
+ const whole = asObject2(dataModel[wholeKey]);
33192
+ const lnKey = findKey12(whole, "ln") ?? "a:ln";
33193
+ const ln = asObject2(whole[lnKey]);
32889
33194
  if (hasOutlineWidth) {
32890
33195
  ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
32891
33196
  }
32892
33197
  if (chrome.outlineColor) {
32893
- const hex7 = chrome.outlineColor.replace("#", "");
32894
- const fillKey = findKey10(ln, "solidFill") ?? "a:solidFill";
32895
- ln[fillKey] = { "a:srgbClr": { "@_val": hex7 } };
33198
+ const hex8 = chrome.outlineColor.replace("#", "");
33199
+ const fillKey = findKey12(ln, "solidFill") ?? "a:solidFill";
33200
+ ln[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
32896
33201
  }
32897
33202
  whole[lnKey] = ln;
32898
33203
  dataModel[wholeKey] = whole;
@@ -32927,10 +33232,56 @@ function buildPointText(text) {
32927
33232
  }
32928
33233
  };
32929
33234
  }
32930
- function applyTextToExistingPoint(pt2, text) {
33235
+ function joinRunText(runs) {
33236
+ return (runs ?? []).map((run) => run.text).join("");
33237
+ }
33238
+ function buildMultiRunParagraph(runs) {
33239
+ const runObjects = runs.map((run) => {
33240
+ const rObj = {};
33241
+ rObj["a:rPr"] = run.rPr ?? { "@_lang": "en-US", "@_dirty": "0" };
33242
+ rObj["a:t"] = run.text;
33243
+ return rObj;
33244
+ });
33245
+ return { "a:r": runObjects.length === 1 ? runObjects[0] : runObjects };
33246
+ }
33247
+ function shouldRebuildFromRuns(node) {
33248
+ const runs = node.runs;
33249
+ if (!runs || runs.length === 0) {
33250
+ return false;
33251
+ }
33252
+ const hasRichRun = runs.length > 1 || Boolean(runs[0]?.rPr);
33253
+ if (!hasRichRun) {
33254
+ return false;
33255
+ }
33256
+ return joinRunText(runs) === node.text;
33257
+ }
33258
+ function buildPointFromRuns(runs) {
33259
+ return {
33260
+ "a:bodyPr": {},
33261
+ "a:lstStyle": {},
33262
+ "a:p": buildMultiRunParagraph(runs)
33263
+ };
33264
+ }
33265
+ function applyRunsToExistingBody(pt2, tKey, runs) {
33266
+ const body = pt2[tKey];
33267
+ if (!body || typeof body !== "object" || Array.isArray(body)) {
33268
+ pt2[tKey] = buildPointFromRuns(runs);
33269
+ return;
33270
+ }
33271
+ const bodyObj = body;
33272
+ const pKey = Object.keys(bodyObj).find((k) => stripPrefix(k) === "p");
33273
+ bodyObj[pKey ?? "a:p"] = buildMultiRunParagraph(runs);
33274
+ }
33275
+ function applyTextToExistingPoint(pt2, node) {
33276
+ const text = node.text;
33277
+ const rebuildFromRuns = shouldRebuildFromRuns(node);
32931
33278
  const tKey = Object.keys(pt2).find((k) => stripPrefix(k) === "t");
32932
33279
  if (!tKey) {
32933
- pt2["dgm:t"] = buildPointText(text);
33280
+ pt2["dgm:t"] = rebuildFromRuns ? buildPointFromRuns(node.runs) : buildPointText(text);
33281
+ return;
33282
+ }
33283
+ if (rebuildFromRuns) {
33284
+ applyRunsToExistingBody(pt2, tKey, node.runs);
32934
33285
  return;
32935
33286
  }
32936
33287
  const body = pt2[tKey];
@@ -32991,7 +33342,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
32991
33342
  if (!desired) {
32992
33343
  continue;
32993
33344
  }
32994
- applyTextToExistingPoint(pt2, desired.text);
33345
+ applyTextToExistingPoint(pt2, desired);
32995
33346
  seenContentIds.add(modelId);
32996
33347
  merged.push(pt2);
32997
33348
  }
@@ -33004,7 +33355,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
33004
33355
  if (node.nodeType && !NON_CONTENT_POINT_TYPES.has(node.nodeType)) {
33005
33356
  ptNode["@_type"] = node.nodeType;
33006
33357
  }
33007
- ptNode["dgm:t"] = buildPointText(node.text);
33358
+ ptNode["dgm:t"] = shouldRebuildFromRuns(node) ? buildPointFromRuns(node.runs) : buildPointText(node.text);
33008
33359
  merged.push(ptNode);
33009
33360
  }
33010
33361
  return merged;
@@ -33113,9 +33464,83 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
33113
33464
  } catch (e) {
33114
33465
  console.warn(`Failed to save SmartArt data at ${dataPartPath}:`, e);
33115
33466
  }
33467
+ await this.regenerateSmartArtColorPart(slidePath, smartArtData);
33468
+ await this.regenerateSmartArtQuickStylePart(slidePath, smartArtData);
33116
33469
  }
33117
33470
  this.pendingSmartArtUpdates = void 0;
33118
33471
  }
33472
+ /**
33473
+ * Merge the in-memory colour transform back into `ppt/diagrams/colors*.xml`.
33474
+ *
33475
+ * Resolves the part via the SmartArt `colorsRelId` relationship alongside
33476
+ * the data part, merges surgically (preserving unknown content), and skips
33477
+ * gracefully when the rel or part is absent. No-op when the in-memory data
33478
+ * carries no colour transform.
33479
+ */
33480
+ async regenerateSmartArtColorPart(slidePath, smartArtData) {
33481
+ const transform = smartArtData?.colorTransform;
33482
+ if (!smartArtData?.colorsRelId || !transform) {
33483
+ return;
33484
+ }
33485
+ await this.mergeSmartArtDiagramPart(
33486
+ slidePath,
33487
+ smartArtData.colorsRelId,
33488
+ "colorsDef",
33489
+ "colours",
33490
+ (colorsDef) => applySmartArtColorTransform(
33491
+ colorsDef,
33492
+ transform,
33493
+ (k) => this.compatibilityService.getXmlLocalName(k)
33494
+ )
33495
+ );
33496
+ }
33497
+ /**
33498
+ * Merge the in-memory quick style back into `ppt/diagrams/quickStyles*.xml`.
33499
+ *
33500
+ * Resolves the part via the SmartArt `styleRelId` relationship, merges
33501
+ * surgically, and skips gracefully when the rel or part is absent. No-op
33502
+ * when the in-memory data carries no quick style.
33503
+ */
33504
+ async regenerateSmartArtQuickStylePart(slidePath, smartArtData) {
33505
+ const quickStyle = smartArtData?.quickStyle;
33506
+ if (!smartArtData?.styleRelId || !quickStyle) {
33507
+ return;
33508
+ }
33509
+ await this.mergeSmartArtDiagramPart(
33510
+ slidePath,
33511
+ smartArtData.styleRelId,
33512
+ "styleDef",
33513
+ "quick style",
33514
+ (styleDef) => applySmartArtQuickStyle(styleDef, quickStyle)
33515
+ );
33516
+ }
33517
+ /**
33518
+ * Read a SmartArt diagram part by slide relationship id, locate its root
33519
+ * definition element by local name, apply a surgical merge callback, and
33520
+ * write the part back only when the callback reports a change. Skips
33521
+ * gracefully when the rel, part, or root element is absent.
33522
+ */
33523
+ async mergeSmartArtDiagramPart(slidePath, relId, defLocalName, label, merge) {
33524
+ const relationships = this.slideRelsMap.get(slidePath);
33525
+ const target = relationships?.get(relId);
33526
+ if (!target) {
33527
+ return;
33528
+ }
33529
+ const partPath = this.resolveImagePath(slidePath, target);
33530
+ const existingXml = await this.zip.file(partPath)?.async("string");
33531
+ if (!existingXml) {
33532
+ return;
33533
+ }
33534
+ try {
33535
+ const parsed = this.parser.parse(existingXml);
33536
+ const def = this.xmlLookupService.getChildByLocalName(parsed, defLocalName);
33537
+ if (def && merge(def)) {
33538
+ this.zip.file(partPath, this.builder.build(parsed));
33539
+ }
33540
+ } catch (e) {
33541
+ console.warn(`Failed to save SmartArt ${label} at ${partPath}:`, e);
33542
+ }
33543
+ }
33119
33544
  /**
33120
33545
  * Find the slide path for an element by scanning the slideMap.
33121
33546
  */
@@ -33147,10 +33572,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
33147
33572
  }
33148
33573
  const cSld = root["p:cSld"] || {};
33149
33574
  if (notesMaster.backgroundColor) {
33150
- const hex7 = notesMaster.backgroundColor.replace("#", "");
33575
+ const hex8 = notesMaster.backgroundColor.replace("#", "");
33151
33576
  cSld["p:bg"] = {
33152
33577
  "p:bgPr": {
33153
- "a:solidFill": { "a:srgbClr": { "@_val": hex7 } },
33578
+ "a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
33154
33579
  "a:effectLst": {}
33155
33580
  }
33156
33581
  };
@@ -33183,10 +33608,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
33183
33608
  }
33184
33609
  const cSld = root["p:cSld"] || {};
33185
33610
  if (handoutMaster.backgroundColor) {
33186
- const hex7 = handoutMaster.backgroundColor.replace("#", "");
33611
+ const hex8 = handoutMaster.backgroundColor.replace("#", "");
33187
33612
  cSld["p:bg"] = {
33188
33613
  "p:bgPr": {
33189
- "a:solidFill": { "a:srgbClr": { "@_val": hex7 } },
33614
+ "a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
33190
33615
  "a:effectLst": {}
33191
33616
  }
33192
33617
  };
@@ -35636,8 +36061,8 @@ var PptxHandlerRuntime34 = class extends PptxHandlerRuntime33 {
35636
36061
  */
35637
36062
  buildClrSchemeObject(schemeName, colorMap) {
35638
36063
  const slot = (key) => {
35639
- const hex7 = String(colorMap[key] || "").replace(/^#/, "");
35640
- const srgb = hex7.length === 6 ? hex7.toUpperCase() : "000000";
36064
+ const hex8 = String(colorMap[key] || "").replace(/^#/, "");
36065
+ const srgb = hex8.length === 6 ? hex8.toUpperCase() : "000000";
35641
36066
  return { "a:srgbClr": { "@_val": srgb } };
35642
36067
  };
35643
36068
  return {
@@ -42416,8 +42841,8 @@ var PptxHandlerRuntime66 = class extends PptxHandlerRuntime65 {
42416
42841
  /**
42417
42842
  * Build an OOXML colour node (`a:srgbClr`) from a hex string.
42418
42843
  */
42419
- buildSrgbClrNode(hex7) {
42420
- const clean = hex7.replace(/^#/, "").toUpperCase();
42844
+ buildSrgbClrNode(hex8) {
42845
+ const clean = hex8.replace(/^#/, "").toUpperCase();
42421
42846
  return { "a:srgbClr": { "@_val": clean } };
42422
42847
  }
42423
42848
  /**
@@ -42840,6 +43265,45 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
42840
43265
  }
42841
43266
  }
42842
43267
  }
43268
+ /**
43269
+ * Extract the per-run text + run-properties of a SmartArt content point's
43270
+ * first paragraph (`dgm:t/a:p/a:r`).
43271
+ *
43272
+ * Each `a:r` yields one {@link PptxSmartArtTextRun} carrying its joined
43273
+ * `a:t` text and a verbatim copy of its `a:rPr` properties (when present).
43274
+ * Only the first paragraph is captured: SmartArt content points are
43275
+ * single-paragraph in practice, and the round-trip save path rebuilds a
43276
+ * single paragraph from these runs. Returns undefined when there is fewer
43277
+ * than one run worth preserving (a single run is still returned so per-run
43278
+ * formatting like a bold sole run survives).
43279
+ */
43280
+ extractSmartArtNodeRuns(point) {
43281
+ const tBody = this.xmlLookupService.getChildByLocalName(point, "t");
43282
+ if (!tBody) {
43283
+ return void 0;
43284
+ }
43285
+ const paragraph = this.xmlLookupService.getChildrenArrayByLocalName(tBody, "p")[0];
43286
+ if (!paragraph) {
43287
+ return void 0;
43288
+ }
43289
+ const runNodes = this.xmlLookupService.getChildrenArrayByLocalName(paragraph, "r");
43290
+ if (runNodes.length === 0) {
43291
+ return void 0;
43292
+ }
43293
+ const runs = [];
43294
+ for (const run of runNodes) {
43295
+ const textValues = [];
43296
+ this.collectLocalTextValues(run, "t", textValues);
43297
+ const text = textValues.join("");
43298
+ const rPrNode = this.xmlLookupService.getChildByLocalName(run, "rPr");
43299
+ const entry = { text };
43300
+ if (rPrNode) {
43301
+ entry.rPr = JSON.parse(JSON.stringify(rPrNode));
43302
+ }
43303
+ runs.push(entry);
43304
+ }
43305
+ return runs.length > 0 ? runs : void 0;
43306
+ }
42843
43307
  /**
42844
43308
  * Parse background and outline chrome from `dgm:bg` and `dgm:whole`.
42845
43309
  */
@@ -43143,11 +43607,13 @@ var PptxHandlerRuntime70 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
43143
43607
  if (!resolvedText) {
43144
43608
  return null;
43145
43609
  }
43610
+ const runs = this.extractSmartArtNodeRuns(point);
43146
43611
  return {
43147
43612
  id: pointId,
43148
43613
  text: resolvedText.trim(),
43149
43614
  parentId: parentByNodeId.get(pointId),
43150
- nodeType
43615
+ nodeType,
43616
+ runs
43151
43617
  };
43152
43618
  }).filter((entry) => Boolean(entry)).slice(0, MAX_SMARTART_NODES);
43153
43619
  if (nodes.length === 0) {
@@ -43865,11 +44331,11 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
43865
44331
  } else if (localName === "srgbClr") {
43866
44332
  const items = Array.isArray(value) ? value : [value];
43867
44333
  for (const item of items) {
43868
- const hex7 = String(
44334
+ const hex8 = String(
43869
44335
  typeof item === "object" && item !== null ? item["@_val"] : item ?? ""
43870
44336
  ).trim();
43871
- if (hex7.length > 0) {
43872
- output.push(hex7.startsWith("#") ? hex7 : `#${hex7}`);
44337
+ if (hex8.length > 0) {
44338
+ output.push(hex8.startsWith("#") ? hex8 : `#${hex8}`);
43873
44339
  }
43874
44340
  }
43875
44341
  }
@@ -43937,9 +44403,10 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
43937
44403
  return void 0;
43938
44404
  }
43939
44405
  const chartType = this.detectChartType(plotArea);
43940
- const seriesContainerKey = Object.keys(plotArea).find(
44406
+ const chartContainerKeys = Object.keys(plotArea).filter(
43941
44407
  (key) => this.compatibilityService.getXmlLocalName(key).endsWith("Chart")
43942
44408
  );
44409
+ const seriesContainerKey = chartContainerKeys[0];
43943
44410
  if (!seriesContainerKey) {
43944
44411
  return this.parseCxChart(
43945
44412
  plotArea,
@@ -43951,19 +44418,14 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
43951
44418
  );
43952
44419
  }
43953
44420
  const seriesContainer = plotArea[seriesContainerKey];
43954
- const seriesList = this.xmlLookupService.getChildrenArrayByLocalName(seriesContainer, "ser");
43955
- if (seriesList.length === 0) {
44421
+ const { categories, series } = this.parseAllChartContainers(
44422
+ plotArea,
44423
+ chartContainerKeys,
44424
+ chartType
44425
+ );
44426
+ if (series.length === 0) {
43956
44427
  return void 0;
43957
44428
  }
43958
- const categoriesFromFirstSeries = this.extractChartPointValues(
43959
- this.xmlLookupService.getChildByLocalName(seriesList[0], "cat"),
43960
- false
43961
- );
43962
- const categories = categoriesFromFirstSeries.length ? categoriesFromFirstSeries : this.extractChartPointValues(
43963
- this.xmlLookupService.getChildByLocalName(seriesList[0], "xVal"),
43964
- false
43965
- );
43966
- const series = this.buildChartSeries(seriesList, categories);
43967
44429
  const titleNode = this.xmlLookupService.getChildByLocalName(chartRoot, "title");
43968
44430
  const titleTextValues = [];
43969
44431
  this.collectLocalTextValues(titleNode, "t", titleTextValues);
@@ -44062,6 +44524,49 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
44062
44524
  ...clrMapOvr ? { clrMapOvr } : {}
44063
44525
  };
44064
44526
  }
44527
+ /**
44528
+ * Parse every chart-type container in the plot area into a single flat
44529
+ * series list plus a shared category list.
44530
+ *
44531
+ * For a single-type chart this parses the one container exactly as before.
44532
+ * For a combo chart (multiple `c:*Chart` siblings) each container's series
44533
+ * are parsed and tagged with the container's chart type via
44534
+ * {@link PptxChartSeries.seriesChartType}, so the combo serializer can
44535
+ * re-emit each series under the correct container on save. Series keep the
44536
+ * document order of their containers.
44537
+ *
44538
+ * @param plotArea - The `c:plotArea` XML object.
44539
+ * @param containerKeys - All chart-type container keys, in document order.
44540
+ * @param chartLevelType - The detected chart-level type. When this is
44541
+ * `combo`, each series is tagged with its own container type; otherwise no
44542
+ * per-series type is set (the chart-level type applies to every series).
44543
+ * @returns The merged categories and series.
44544
+ */
44545
+ parseAllChartContainers(plotArea, containerKeys, chartLevelType) {
44546
+ const isCombo = chartLevelType === "combo";
44547
+ let categories = [];
44548
+ const series = [];
44549
+ for (const containerKey of containerKeys) {
44550
+ const container = plotArea[containerKey];
44551
+ const seriesList = this.xmlLookupService.getChildrenArrayByLocalName(container, "ser");
44552
+ if (seriesList.length === 0) {
44553
+ continue;
44554
+ }
44555
+ if (categories.length === 0) {
44556
+ const fromCat = this.extractChartPointValues(
44557
+ this.xmlLookupService.getChildByLocalName(seriesList[0], "cat"),
44558
+ false
44559
+ );
44560
+ categories = fromCat.length ? fromCat : this.extractChartPointValues(
44561
+ this.xmlLookupService.getChildByLocalName(seriesList[0], "xVal"),
44562
+ false
44563
+ );
44564
+ }
44565
+ const containerType = isCombo ? chartContainerLocalNameToType(this.compatibilityService.getXmlLocalName(containerKey)) : void 0;
44566
+ series.push(...this.buildChartSeries(seriesList, categories, containerType));
44567
+ }
44568
+ return { categories, series };
44569
+ }
44065
44570
  /**
44066
44571
  * Build the series array from raw OOXML `c:ser` nodes.
44067
44572
  *
@@ -44071,9 +44576,11 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
44071
44576
  *
44072
44577
  * @param seriesList - Array of `c:ser` XML objects from the chart container.
44073
44578
  * @param categories - Pre-parsed category labels (used for fallback values).
44579
+ * @param seriesChartType - When set (combo charts), tags every series in this
44580
+ * container with its source chart type for round-trip.
44074
44581
  * @returns The series array matching `PptxChartData["series"]`.
44075
44582
  */
44076
- buildChartSeries(seriesList, categories) {
44583
+ buildChartSeries(seriesList, categories, seriesChartType) {
44077
44584
  return seriesList.map((seriesNode, seriesIndex) => {
44078
44585
  const seriesName = this.extractChartSeriesName(seriesNode);
44079
44586
  const values = this.extractChartPointValues(
@@ -44111,7 +44618,8 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
44111
44618
  ...dataPoints.length > 0 ? { dataPoints } : {},
44112
44619
  ...seriesMarker ? { marker: seriesMarker } : {},
44113
44620
  ...dataLabels.length > 0 ? { dataLabels } : {},
44114
- ...explosion !== void 0 ? { explosion } : {}
44621
+ ...explosion !== void 0 ? { explosion } : {},
44622
+ ...seriesChartType ? { seriesChartType } : {}
44115
44623
  };
44116
44624
  });
44117
44625
  }
@@ -57098,6 +57606,51 @@ function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion)
57098
57606
  const dp = ensureDataPoint(series, pointIndex);
57099
57607
  dp.explosion = explosion;
57100
57608
  }
57609
+ function applyLabelEdit(label, edit) {
57610
+ if (edit.showValue !== void 0) {
57611
+ label.showVal = edit.showValue;
57612
+ }
57613
+ if (edit.showCategory !== void 0) {
57614
+ label.showCatName = edit.showCategory;
57615
+ }
57616
+ if (edit.showSeriesName !== void 0) {
57617
+ label.showSerName = edit.showSeriesName;
57618
+ }
57619
+ if (edit.showPercent !== void 0) {
57620
+ label.showPercent = edit.showPercent;
57621
+ }
57622
+ if (edit.showLegendKey !== void 0) {
57623
+ label.showLegendKey = edit.showLegendKey;
57624
+ }
57625
+ if (edit.position !== void 0) {
57626
+ label.position = edit.position;
57627
+ }
57628
+ if (edit.text !== void 0) {
57629
+ label.text = edit.text === "" ? void 0 : edit.text;
57630
+ }
57631
+ }
57632
+ function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
57633
+ validateSeriesIndex(element, seriesIndex);
57634
+ const series = element.chartData.series[seriesIndex];
57635
+ if (edit === null) {
57636
+ if (!series.dataLabels) {
57637
+ return;
57638
+ }
57639
+ series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
57640
+ if (series.dataLabels.length === 0) {
57641
+ series.dataLabels = void 0;
57642
+ }
57643
+ return;
57644
+ }
57645
+ const labels = series.dataLabels ??= [];
57646
+ let label = labels.find((l) => l.idx === pointIndex);
57647
+ if (!label) {
57648
+ label = { idx: pointIndex };
57649
+ labels.push(label);
57650
+ labels.sort((a, b) => a.idx - b.idx);
57651
+ }
57652
+ applyLabelEdit(label, edit);
57653
+ }
57101
57654
  function removeEmptyDataPoint(series, pointIndex) {
57102
57655
  if (!series.dataPoints) {
57103
57656
  return;
@@ -57147,8 +57700,8 @@ function generateLayoutXml(definition) {
57147
57700
  const phShapes = placeholders.map((ph, i) => placeholderSpXml(ph, i + 2)).join("\n");
57148
57701
  let bgXml = "";
57149
57702
  if (definition.backgroundColor) {
57150
- const hex7 = definition.backgroundColor.replace(/^#/, "").toUpperCase();
57151
- bgXml = ` <p:bg><p:bgPr><a:solidFill><a:srgbClr val="${hex7}"/></a:solidFill><a:effectLst/></p:bgPr></p:bg>
57703
+ const hex8 = definition.backgroundColor.replace(/^#/, "").toUpperCase();
57704
+ bgXml = ` <p:bg><p:bgPr><a:solidFill><a:srgbClr val="${hex8}"/></a:solidFill><a:effectLst/></p:bgPr></p:bg>
57152
57705
  `;
57153
57706
  }
57154
57707
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -57624,8 +58177,8 @@ var TextBuilder = class _TextBuilder {
57624
58177
  *
57625
58178
  * @param hex - Color as a hex string (e.g. "#FF0000").
57626
58179
  */
57627
- color(hex7) {
57628
- this._options.color = hex7;
58180
+ color(hex8) {
58181
+ this._options.color = hex8;
57629
58182
  return this;
57630
58183
  }
57631
58184
  /**
@@ -62401,8 +62954,8 @@ function stepTable10(t) {
62401
62954
  }
62402
62955
  return out.join(" ");
62403
62956
  }
62404
- function parseHexRgb(hex7) {
62405
- const m = /^#?([0-9a-f]{6})/i.exec(hex7.trim());
62957
+ function parseHexRgb(hex8) {
62958
+ const m = /^#?([0-9a-f]{6})/i.exec(hex8.trim());
62406
62959
  if (!m) {
62407
62960
  return { r: 0, g: 0, b: 0 };
62408
62961
  }
@@ -63378,6 +63931,7 @@ exports.setChartCategories = setChartCategories;
63378
63931
  exports.setChartDataLabels = setChartDataLabels;
63379
63932
  exports.setChartDataPointExplosion = setChartDataPointExplosion;
63380
63933
  exports.setChartDataPointFill = setChartDataPointFill;
63934
+ exports.setChartDataPointLabel = setChartDataPointLabel;
63381
63935
  exports.setChartGrouping = setChartGrouping;
63382
63936
  exports.setChartLegend = setChartLegend;
63383
63937
  exports.setChartSeriesChartType = setChartSeriesChartType;