pptx-viewer-core 1.6.9 → 1.6.10

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.mjs CHANGED
@@ -2589,6 +2589,7 @@ var TextShapeXmlFactory = class {
2589
2589
  createXmlElement(init) {
2590
2590
  const { element } = init;
2591
2591
  const isText = element.type === "text";
2592
+ const isTextBox = element.locks?.txBox ?? isText;
2592
2593
  const name = isText ? "TextBox" : "Rectangle";
2593
2594
  const geometry = this.context.normalizePresetGeometry(element.shapeType);
2594
2595
  const adjustmentEntries = Object.entries(element.shapeAdjustments || {}).filter(
@@ -2608,7 +2609,7 @@ var TextShapeXmlFactory = class {
2608
2609
  "@_name": `${name} ${elementId}`
2609
2610
  },
2610
2611
  "p:cNvSpPr": {
2611
- "@_txBox": isText ? "1" : "0"
2612
+ "@_txBox": isTextBox ? "1" : "0"
2612
2613
  },
2613
2614
  "p:nvPr": {}
2614
2615
  },
@@ -3234,6 +3235,21 @@ function cloneXmlObject(value) {
3234
3235
 
3235
3236
  // src/core/utils/presentation-collections.ts
3236
3237
  var SECTION_EXTENSION_URI = "{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";
3238
+ function remapReferenceList(references, mapping, removed) {
3239
+ const result = [];
3240
+ for (const reference of references) {
3241
+ const mapped = mapping.get(reference);
3242
+ if (mapped !== void 0) {
3243
+ result.push(mapped);
3244
+ continue;
3245
+ }
3246
+ if (removed.has(reference)) {
3247
+ continue;
3248
+ }
3249
+ result.push(reference);
3250
+ }
3251
+ return result;
3252
+ }
3237
3253
  function localName4(key) {
3238
3254
  return key.split(":").pop() ?? key;
3239
3255
  }
@@ -3300,7 +3316,7 @@ function updateCustomShow(show, existing) {
3300
3316
  replaceChildren(node, "sldLst", slideList, "p:sldLst");
3301
3317
  return node;
3302
3318
  }
3303
- function applyCustomShows(presentation, shows, lookup) {
3319
+ function applyCustomShows(presentation, shows, lookup, remap) {
3304
3320
  if (shows === void 0) {
3305
3321
  return;
3306
3322
  }
@@ -3314,14 +3330,18 @@ function applyCustomShows(presentation, shows, lookup) {
3314
3330
  const oldList = key ? presentation[key] : void 0;
3315
3331
  const list = cloneXmlObject(oldList) ?? {};
3316
3332
  const oldShows = lookup.getChildrenArrayByLocalName(oldList, "custShow");
3317
- const updated = shows.map(
3318
- (show) => updateCustomShow(
3319
- show,
3333
+ const updated = shows.map((show) => {
3334
+ const effective = remap && remap.changed ? {
3335
+ ...show,
3336
+ slideRIds: remapReferenceList(show.slideRIds, remap.rIdByOldRId, remap.removedRIds)
3337
+ } : show;
3338
+ return updateCustomShow(
3339
+ effective,
3320
3340
  oldShows.find(
3321
3341
  (node) => String(node[attributeKey(node, "id") ?? ""]) === show.id || String(node[attributeKey(node, "name") ?? ""]) === show.name
3322
3342
  )
3323
- )
3324
- );
3343
+ );
3344
+ });
3325
3345
  replaceChildren(list, "custShow", updated, "p:custShow");
3326
3346
  presentation[key ?? "p:custShowLst"] = list;
3327
3347
  }
@@ -3370,7 +3390,7 @@ function updateSection(section) {
3370
3390
  }
3371
3391
  return node;
3372
3392
  }
3373
- function applySections(presentation, sections, lookup) {
3393
+ function applySections(presentation, sections, lookup, remap) {
3374
3394
  if (sections === void 0) {
3375
3395
  return;
3376
3396
  }
@@ -3392,7 +3412,15 @@ function applySections(presentation, sections, lookup) {
3392
3412
  location = { parent: ext, key: "p14:sectionLst", list: ext["p14:sectionLst"] };
3393
3413
  }
3394
3414
  const list = cloneXmlObject(location.list) ?? {};
3395
- replaceChildren(list, "section", sections.map(updateSection), "p14:section");
3415
+ const effectiveSections = remap && remap.changed ? sections.map((section) => ({
3416
+ ...section,
3417
+ slideIds: remapReferenceList(
3418
+ section.slideIds,
3419
+ remap.sldIdByOldSldId,
3420
+ remap.removedSldIds
3421
+ )
3422
+ })) : sections;
3423
+ replaceChildren(list, "section", effectiveSections.map(updateSection), "p14:section");
3396
3424
  location.parent[location.key] = list;
3397
3425
  }
3398
3426
 
@@ -3413,8 +3441,18 @@ var PptxPresentationSaveBuilder = class {
3413
3441
  init.rawSlideHeightEmu,
3414
3442
  init.rawSlideSizeType
3415
3443
  );
3416
- applyCustomShows(presentation, init.options?.customShows, init.xmlLookupService);
3417
- applySections(presentation, init.options?.sections, init.xmlLookupService);
3444
+ applyCustomShows(
3445
+ presentation,
3446
+ init.options?.customShows,
3447
+ init.xmlLookupService,
3448
+ init.slideReferenceRemap
3449
+ );
3450
+ applySections(
3451
+ presentation,
3452
+ init.options?.sections,
3453
+ init.xmlLookupService,
3454
+ init.slideReferenceRemap
3455
+ );
3418
3456
  this.applyPhotoAlbum(presentation, init.options?.photoAlbum);
3419
3457
  presentation = this.applyKinsoku(presentation, init.options?.kinsoku);
3420
3458
  this.applyModifyVerifier(presentation, init.options?.modifyVerifier);
@@ -3509,6 +3547,53 @@ var PptxPresentationSaveBuilder = class {
3509
3547
  }
3510
3548
  };
3511
3549
 
3550
+ // src/core/core/builders/slide-reference-remap.ts
3551
+ function buildSlideReferenceRemap(init) {
3552
+ const pathToNewRId = /* @__PURE__ */ new Map();
3553
+ for (const slide of init.slides) {
3554
+ pathToNewRId.set(slide.id, slide.rId);
3555
+ }
3556
+ const newRIdToNumeric = /* @__PURE__ */ new Map();
3557
+ for (const entry of init.rebuiltSlideIds) {
3558
+ const relationshipId2 = String(entry?.["@_r:id"] ?? "");
3559
+ const numericSlideId = String(entry?.["@_id"] ?? "");
3560
+ if (relationshipId2.length > 0 && numericSlideId.length > 0) {
3561
+ newRIdToNumeric.set(relationshipId2, numericSlideId);
3562
+ }
3563
+ }
3564
+ const rIdByOldRId = /* @__PURE__ */ new Map();
3565
+ const removedRIds = /* @__PURE__ */ new Set();
3566
+ let changed = false;
3567
+ for (const [oldRId, path] of init.originalRIdToPath.entries()) {
3568
+ const newRId = pathToNewRId.get(path);
3569
+ if (newRId === void 0) {
3570
+ removedRIds.add(oldRId);
3571
+ changed = true;
3572
+ continue;
3573
+ }
3574
+ rIdByOldRId.set(oldRId, newRId);
3575
+ if (newRId !== oldRId) {
3576
+ changed = true;
3577
+ }
3578
+ }
3579
+ const sldIdByOldSldId = /* @__PURE__ */ new Map();
3580
+ const removedSldIds = /* @__PURE__ */ new Set();
3581
+ for (const [oldSldId, path] of init.originalSldIdToPath.entries()) {
3582
+ const newRId = pathToNewRId.get(path);
3583
+ const newSldId = newRId === void 0 ? void 0 : newRIdToNumeric.get(newRId);
3584
+ if (newSldId === void 0) {
3585
+ removedSldIds.add(oldSldId);
3586
+ changed = true;
3587
+ continue;
3588
+ }
3589
+ sldIdByOldSldId.set(oldSldId, newSldId);
3590
+ if (newSldId !== oldSldId) {
3591
+ changed = true;
3592
+ }
3593
+ }
3594
+ return { rIdByOldRId, sldIdByOldSldId, removedRIds, removedSldIds, changed };
3595
+ }
3596
+
3512
3597
  // src/core/core/builders/PptxPresentationSlidesReconciler.ts
3513
3598
  var PptxPresentationSlidesReconciler = class {
3514
3599
  async reconcile(input) {
@@ -3554,6 +3639,10 @@ var PptxPresentationSlidesReconciler = class {
3554
3639
  const existingSlideIds = slideIdList ? this.ensureArray(slideIdList["p:sldId"]) : [];
3555
3640
  const slideIdByRid = /* @__PURE__ */ new Map();
3556
3641
  let maxNumericSlideId = 255;
3642
+ const originalRIdToPath = /* @__PURE__ */ new Map();
3643
+ for (const [relationshipId2, target] of slideTargetByRid.entries()) {
3644
+ originalRIdToPath.set(relationshipId2, input.toSlidePathFromTarget(target));
3645
+ }
3557
3646
  for (const slideIdEntry of existingSlideIds) {
3558
3647
  const relationshipId2 = slideIdEntry?.["@_r:id"];
3559
3648
  if (typeof relationshipId2 === "string" && relationshipId2.length > 0) {
@@ -3564,6 +3653,15 @@ var PptxPresentationSlidesReconciler = class {
3564
3653
  maxNumericSlideId = Math.max(maxNumericSlideId, numericSlideId);
3565
3654
  }
3566
3655
  }
3656
+ const originalSldIdToPath = /* @__PURE__ */ new Map();
3657
+ for (const slideIdEntry of existingSlideIds) {
3658
+ const relationshipId2 = String(slideIdEntry?.["@_r:id"] ?? "");
3659
+ const numericSlideId = String(slideIdEntry?.["@_id"] ?? "");
3660
+ const slidePath = originalRIdToPath.get(relationshipId2);
3661
+ if (numericSlideId.length > 0 && slidePath !== void 0) {
3662
+ originalSldIdToPath.set(numericSlideId, slidePath);
3663
+ }
3664
+ }
3567
3665
  for (let index = 0; index < input.slides.length; index++) {
3568
3666
  const slide = input.slides[index];
3569
3667
  slide.slideNumber = index + 1;
@@ -3600,6 +3698,7 @@ var PptxPresentationSlidesReconciler = class {
3600
3698
  ];
3601
3699
  presentationRelsData["Relationships"] = relRoot;
3602
3700
  input.zip.file("ppt/_rels/presentation.xml.rels", input.xmlBuilder.build(presentationRelsData));
3701
+ const rebuiltSlideIds = [];
3603
3702
  if (presentation && slideIdList && input.presentationData) {
3604
3703
  slideIdList["p:sldId"] = input.slides.map((slide) => {
3605
3704
  const existing = slideIdByRid.get(slide.rId);
@@ -3612,11 +3711,18 @@ var PptxPresentationSlidesReconciler = class {
3612
3711
  "@_r:id": slide.rId
3613
3712
  };
3614
3713
  });
3714
+ rebuiltSlideIds.push(...slideIdList["p:sldId"]);
3615
3715
  input.presentationData["p:presentation"] = this.insertSlideIdListInOrder(
3616
3716
  presentation,
3617
3717
  slideIdList
3618
3718
  );
3619
3719
  }
3720
+ return buildSlideReferenceRemap({
3721
+ slides: input.slides,
3722
+ originalRIdToPath,
3723
+ originalSldIdToPath,
3724
+ rebuiltSlideIds
3725
+ });
3620
3726
  }
3621
3727
  /**
3622
3728
  * Return a new presentation XML object whose `p:sldIdLst` child sits in the
@@ -4278,7 +4384,7 @@ var SHAPE_STYLE_ORDER = [
4278
4384
 
4279
4385
  // src/core/core/builders/PptxSlideBackgroundBuilder.ts
4280
4386
  var PptxSlideBackgroundBuilder = class {
4281
- applyBackground(init) {
4387
+ async applyBackground(init) {
4282
4388
  const hasBackgroundColor = typeof init.slide.backgroundColor === "string" && init.slide.backgroundColor.length > 0 && init.slide.backgroundColor !== "transparent";
4283
4389
  const rawBackgroundImage = typeof init.slide.backgroundImage === "string" ? init.slide.backgroundImage : "";
4284
4390
  const hasBackgroundImage = rawBackgroundImage.length > 0;
@@ -4299,8 +4405,8 @@ var PptxSlideBackgroundBuilder = class {
4299
4405
  return;
4300
4406
  }
4301
4407
  const backgroundProperties = {};
4302
- if (hasDataUrlBackgroundImage) {
4303
- const parsedBackgroundImage = init.parseDataUrlToBytes(rawBackgroundImage);
4408
+ if (hasBackgroundImage) {
4409
+ const parsedBackgroundImage = await init.resolveImageToBytes(rawBackgroundImage);
4304
4410
  if (parsedBackgroundImage) {
4305
4411
  const backgroundImagePath = init.saveState.nextMediaPath(parsedBackgroundImage.extension);
4306
4412
  init.zip.file(backgroundImagePath, parsedBackgroundImage.bytes);
@@ -4318,8 +4424,11 @@ var PptxSlideBackgroundBuilder = class {
4318
4424
  },
4319
4425
  BLIP_FILL_ORDER
4320
4426
  );
4427
+ } else {
4428
+ init.reportUnsupportedBackground?.(rawBackgroundImage);
4321
4429
  }
4322
- } else if (hasBackgroundColor && init.slide.backgroundColor) {
4430
+ }
4431
+ if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
4323
4432
  backgroundProperties["a:solidFill"] = {
4324
4433
  "a:srgbClr": {
4325
4434
  "@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
@@ -4336,6 +4445,11 @@ var PptxSlideBackgroundBuilder = class {
4336
4445
  backgroundProperties["@_shadeToTitle"] = "0";
4337
4446
  }
4338
4447
  if (!hasFillChild) {
4448
+ if (existingBg !== void 0) {
4449
+ this.reorderCSldBgFirst(cSld, existingBg);
4450
+ init.slideNode["p:cSld"] = cSld;
4451
+ return;
4452
+ }
4339
4453
  delete cSld["p:bg"];
4340
4454
  init.slideNode["p:cSld"] = cSld;
4341
4455
  return;
@@ -4409,6 +4523,11 @@ function parseDrawingPercent(value) {
4409
4523
  }
4410
4524
  return clampUnitInterval(parsed / 1e5);
4411
4525
  }
4526
+ function scrgbLinearToSrgb8(linear) {
4527
+ const l = Math.min(1, Math.max(0, linear));
4528
+ const companded = l <= 31308e-7 ? 12.92 * l : 1.055 * l ** (1 / 2.4) - 0.055;
4529
+ return Math.min(255, Math.max(0, Math.round(companded * 255)));
4530
+ }
4412
4531
  function toHex(value) {
4413
4532
  return Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
4414
4533
  }
@@ -4962,11 +5081,15 @@ var PptxColorTransformCodec = class {
4962
5081
  }
4963
5082
  if (colorChoice["a:scrgbClr"]) {
4964
5083
  const scrgb = colorChoice["a:scrgbClr"];
4965
- const red = this.percentAttrToUnit(scrgb["@_r"]);
4966
- const green = this.percentAttrToUnit(scrgb["@_g"]);
4967
- const blue = this.percentAttrToUnit(scrgb["@_b"]);
5084
+ const red = parseDrawingFraction(scrgb["@_r"]);
5085
+ const green = parseDrawingFraction(scrgb["@_g"]);
5086
+ const blue = parseDrawingFraction(scrgb["@_b"]);
4968
5087
  if (red !== void 0 && green !== void 0 && blue !== void 0) {
4969
- const base = this.rgbToHex(red * 255, green * 255, blue * 255);
5088
+ const base = this.rgbToHex(
5089
+ scrgbLinearToSrgb8(red),
5090
+ scrgbLinearToSrgb8(green),
5091
+ scrgbLinearToSrgb8(blue)
5092
+ );
4970
5093
  return this.applyColorTransforms(base, scrgb);
4971
5094
  }
4972
5095
  }
@@ -5057,8 +5180,8 @@ var PptxColorTransformCodec = class {
5057
5180
  };
5058
5181
  }
5059
5182
  rgbToHex(r, g, b) {
5060
- const toHex3 = (channelValue) => this.clampColorChannel(channelValue).toString(16).padStart(2, "0").toUpperCase();
5061
- return `#${toHex3(r)}${toHex3(g)}${toHex3(b)}`;
5183
+ const toHex4 = (channelValue) => this.clampColorChannel(channelValue).toString(16).padStart(2, "0").toUpperCase();
5184
+ return `#${toHex4(r)}${toHex4(g)}${toHex4(b)}`;
5062
5185
  }
5063
5186
  applyColorTransforms(baseColor, colorNode) {
5064
5187
  return applyDrawingColorTransforms(baseColor, colorNode);
@@ -5146,6 +5269,22 @@ function mergeDrawingFillXml(original, generated, modeledChildren, childOrder2)
5146
5269
  }
5147
5270
 
5148
5271
  // src/core/core/builders/PptxGradientStyleCodec.ts
5272
+ function extractGradientTileRect(gradFill) {
5273
+ const tileRect = drawingChild(gradFill, "tileRect");
5274
+ if (!tileRect) {
5275
+ return void 0;
5276
+ }
5277
+ const toFraction = (raw) => {
5278
+ const parsed = Number.parseInt(String(raw ?? "0"), 10);
5279
+ return Number.isFinite(parsed) ? parsed / 1e5 : 0;
5280
+ };
5281
+ return {
5282
+ l: toFraction(tileRect["@_l"]),
5283
+ t: toFraction(tileRect["@_t"]),
5284
+ r: toFraction(tileRect["@_r"]),
5285
+ b: toFraction(tileRect["@_b"])
5286
+ };
5287
+ }
5149
5288
  var PptxGradientStyleCodec = class {
5150
5289
  context;
5151
5290
  constructor(context) {
@@ -5256,6 +5395,9 @@ var PptxGradientStyleCodec = class {
5256
5395
  b: Number.isFinite(b) ? this.context.clampUnitInterval(b / 1e5) : 0
5257
5396
  };
5258
5397
  }
5398
+ extractGradientTileRect(gradFill) {
5399
+ return extractGradientTileRect(gradFill);
5400
+ }
5259
5401
  extractGradientFlip(gradFill) {
5260
5402
  const flipRaw = String(gradFill["@_flip"] || "").trim().toLowerCase();
5261
5403
  if (flipRaw === "x" || flipRaw === "y" || flipRaw === "xy" || flipRaw === "none") {
@@ -5427,6 +5569,15 @@ var PptxGradientStyleCodec = class {
5427
5569
  }
5428
5570
  gradientXml["a:lin"] = linNode;
5429
5571
  }
5572
+ if (shapeStyle.fillGradientTileRect) {
5573
+ const tr = shapeStyle.fillGradientTileRect;
5574
+ gradientXml["a:tileRect"] = {
5575
+ "@_l": String(Math.round(tr.l * 1e5)),
5576
+ "@_t": String(Math.round(tr.t * 1e5)),
5577
+ "@_r": String(Math.round(tr.r * 1e5)),
5578
+ "@_b": String(Math.round(tr.b * 1e5))
5579
+ };
5580
+ }
5430
5581
  return mergeDrawingFillXml(
5431
5582
  shapeStyle.fillGradientXml,
5432
5583
  gradientXml,
@@ -6960,7 +7111,7 @@ var PptxColorStyleCodec = class {
6960
7111
  const alphaMod = this.percentAttrToUnit(
6961
7112
  choiceNode["a:alphaMod"]?.["@_val"]
6962
7113
  );
6963
- const alphaOff = this.percentAttrToUnit(
7114
+ const alphaOff = this.signedPercentToUnit(
6964
7115
  choiceNode["a:alphaOff"]?.["@_val"]
6965
7116
  );
6966
7117
  if (alpha === void 0 && alphaMod === void 0 && alphaOff === void 0) {
@@ -6975,6 +7126,18 @@ var PptxColorStyleCodec = class {
6975
7126
  }
6976
7127
  return this.clampUnitInterval(opacity2);
6977
7128
  }
7129
+ /**
7130
+ * Parse an OOXML percentage (thousandths, `100000` = 100%) into a fraction
7131
+ * WITHOUT clamping to [0, 1]. Used for additive offsets like `a:alphaOff`
7132
+ * that legitimately carry negative values.
7133
+ */
7134
+ signedPercentToUnit(value) {
7135
+ const parsed = Number.parseFloat(String(value ?? "").trim());
7136
+ if (!Number.isFinite(parsed)) {
7137
+ return void 0;
7138
+ }
7139
+ return parsed / 1e5;
7140
+ }
6978
7141
  colorWithOpacity(color2, opacity2) {
6979
7142
  if (opacity2 === void 0) {
6980
7143
  return color2;
@@ -7158,10 +7321,12 @@ function applyLineProperties(lineNode, shapeProps, style, context, resolveHidden
7158
7321
  }
7159
7322
  const hiddenLineFill = hiddenLineProps["a:solidFill"];
7160
7323
  if (hiddenLineFill) {
7324
+ style.strokeFillMode = "solid";
7161
7325
  style.strokeColor = context.parseColor(hiddenLineFill);
7162
7326
  style.strokeOpacity = context.extractColorOpacity(hiddenLineFill);
7163
7327
  }
7164
7328
  } else {
7329
+ style.strokeFillMode = "none";
7165
7330
  style.strokeWidth = 0;
7166
7331
  style.strokeColor = "transparent";
7167
7332
  }
@@ -7179,6 +7344,7 @@ function applyLineProperties(lineNode, shapeProps, style, context, resolveHidden
7179
7344
  }
7180
7345
  function applyStrokeColor(lineNode, style, context) {
7181
7346
  if (lineNode["a:solidFill"]) {
7347
+ style.strokeFillMode = "solid";
7182
7348
  const lineFill = lineNode["a:solidFill"];
7183
7349
  style.strokeColor = context.parseColor(lineFill);
7184
7350
  style.strokeOpacity = context.extractColorOpacity(lineFill);
@@ -7187,10 +7353,15 @@ function applyStrokeColor(lineNode, style, context) {
7187
7353
  style.strokeColorXml = strokeColorXml;
7188
7354
  }
7189
7355
  } else if (lineNode["a:gradFill"]) {
7190
- style.strokeColor = context.extractGradientFillColor(lineNode["a:gradFill"]);
7191
- style.strokeOpacity = context.extractGradientOpacity(lineNode["a:gradFill"]);
7356
+ style.strokeFillMode = "gradient";
7357
+ const lineGradFill = lineNode["a:gradFill"];
7358
+ style.strokeGradientXml = lineGradFill;
7359
+ style.strokeColor = context.extractGradientFillColor(lineGradFill);
7360
+ style.strokeOpacity = context.extractGradientOpacity(lineGradFill);
7192
7361
  } else if (lineNode["a:pattFill"]) {
7362
+ style.strokeFillMode = "pattern";
7193
7363
  const linePatternFill = lineNode["a:pattFill"];
7364
+ style.strokePatternXml = linePatternFill;
7194
7365
  style.strokeColor = context.parseColor(linePatternFill["a:fgClr"]) || context.parseColor(linePatternFill["a:bgClr"]);
7195
7366
  style.strokeOpacity = context.extractColorOpacity(linePatternFill["a:fgClr"]) || context.extractColorOpacity(linePatternFill["a:bgClr"]);
7196
7367
  }
@@ -7319,6 +7490,10 @@ var PptxShapeStyleExtractor = class {
7319
7490
  style.fillGradientPathType = this.context.extractGradientPathType(gradFill);
7320
7491
  style.fillGradientFocalPoint = this.context.extractGradientFocalPoint(gradFill);
7321
7492
  style.fillGradientFillToRect = this.context.extractGradientFillToRect(gradFill);
7493
+ const gradTileRect = extractGradientTileRect(gradFill);
7494
+ if (gradTileRect) {
7495
+ style.fillGradientTileRect = gradTileRect;
7496
+ }
7322
7497
  const gradFlip = this.context.extractGradientFlip(gradFill);
7323
7498
  if (gradFlip) {
7324
7499
  style.fillGradientFlip = gradFlip;
@@ -8771,6 +8946,7 @@ var PptxLoadDataBuilder = class {
8771
8946
  layoutOptions = [];
8772
8947
  headerFooter;
8773
8948
  presentationProperties;
8949
+ viewProperties;
8774
8950
  customShows;
8775
8951
  sections;
8776
8952
  warnings = [];
@@ -8830,6 +9006,10 @@ var PptxLoadDataBuilder = class {
8830
9006
  this.presentationProperties = presentationProperties;
8831
9007
  return this;
8832
9008
  }
9009
+ withViewProperties(viewProperties) {
9010
+ this.viewProperties = viewProperties;
9011
+ return this;
9012
+ }
8833
9013
  withCustomShows(customShows) {
8834
9014
  this.customShows = customShows;
8835
9015
  return this;
@@ -8967,6 +9147,7 @@ var PptxLoadDataBuilder = class {
8967
9147
  layoutOptions: this.layoutOptions,
8968
9148
  headerFooter: this.headerFooter,
8969
9149
  presentationProperties: this.presentationProperties,
9150
+ viewProperties: this.viewProperties,
8970
9151
  customShows: this.customShows,
8971
9152
  sections: this.sections,
8972
9153
  warnings: this.warnings,
@@ -9349,7 +9530,7 @@ var PptxSlideCommentsXmlFactory = class {
9349
9530
  const createdAtIso = this.resolveCreatedAt(comment.createdAt);
9350
9531
  const x = init.saveState.toEmu(comment.x, 0);
9351
9532
  const y = init.saveState.toEmu(comment.y, 0);
9352
- return {
9533
+ const node = {
9353
9534
  ...withoutChildrenByLocalName(comment.rawXml ?? {}, /* @__PURE__ */ new Set(["pos", "text"])),
9354
9535
  "@_authorId": authorId,
9355
9536
  "@_dt": createdAtIso,
@@ -9360,6 +9541,28 @@ var PptxSlideCommentsXmlFactory = class {
9360
9541
  },
9361
9542
  "p:text": String(comment.text || "")
9362
9543
  };
9544
+ this.applyResolvedState(node, comment);
9545
+ return node;
9546
+ }
9547
+ /**
9548
+ * Reflect the (possibly edited) `resolved` flag onto the legacy comment
9549
+ * node. PowerPoint's legacy comment schema has no standard resolved marker,
9550
+ * but the parser reads a non-standard `@_done` / `@_resolved` attribute, so
9551
+ * we re-emit the current state rather than leaving the stale value carried
9552
+ * over from `rawXml`. The original attribute name is preserved when present.
9553
+ */
9554
+ applyResolvedState(node, comment) {
9555
+ const raw = comment.rawXml;
9556
+ const hadResolvedAttr = raw?.["@_resolved"] !== void 0;
9557
+ const hadDoneAttr = raw?.["@_done"] !== void 0;
9558
+ const key = hadResolvedAttr && !hadDoneAttr ? "@_resolved" : "@_done";
9559
+ delete node["@_done"];
9560
+ delete node["@_resolved"];
9561
+ if (comment.resolved === true) {
9562
+ node[key] = "1";
9563
+ } else if (hadResolvedAttr || hadDoneAttr) {
9564
+ node[key] = "0";
9565
+ }
9363
9566
  }
9364
9567
  resolveCreatedAt(createdAt) {
9365
9568
  const candidate = String(createdAt || "").trim();
@@ -10672,6 +10875,226 @@ var PptxCompatibilityService = class {
10672
10875
  }
10673
10876
  };
10674
10877
 
10878
+ // src/core/utils/xml-access.ts
10879
+ var ATTR_PREFIX = "@_";
10880
+ var TEXT_KEY = "#text";
10881
+ function isXmlObject(value) {
10882
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10883
+ }
10884
+ function coerceString(value) {
10885
+ if (typeof value === "string") {
10886
+ return value;
10887
+ }
10888
+ if (typeof value === "number" || typeof value === "boolean") {
10889
+ return String(value);
10890
+ }
10891
+ return void 0;
10892
+ }
10893
+ function xmlChild(node, key) {
10894
+ if (!isXmlObject(node)) {
10895
+ return void 0;
10896
+ }
10897
+ const value = node[key];
10898
+ if (Array.isArray(value)) {
10899
+ const first = value[0];
10900
+ return isXmlObject(first) ? first : void 0;
10901
+ }
10902
+ return isXmlObject(value) ? value : void 0;
10903
+ }
10904
+ function xmlChildren(node, key) {
10905
+ if (!isXmlObject(node)) {
10906
+ return [];
10907
+ }
10908
+ const value = node[key];
10909
+ if (value === void 0 || value === null) {
10910
+ return [];
10911
+ }
10912
+ if (Array.isArray(value)) {
10913
+ return value.filter(isXmlObject);
10914
+ }
10915
+ return isXmlObject(value) ? [value] : [];
10916
+ }
10917
+ function xmlHasChild(node, key) {
10918
+ return isXmlObject(node) && Object.hasOwn(node, key);
10919
+ }
10920
+ function xmlAttr(node, name) {
10921
+ if (!isXmlObject(node)) {
10922
+ return void 0;
10923
+ }
10924
+ return coerceString(node[ATTR_PREFIX + name]);
10925
+ }
10926
+ function xmlAttrNumber(node, name) {
10927
+ const raw = xmlAttr(node, name);
10928
+ if (raw === void 0) {
10929
+ return void 0;
10930
+ }
10931
+ const parsed = Number(raw);
10932
+ return Number.isFinite(parsed) ? parsed : void 0;
10933
+ }
10934
+ function xmlAttrBool(node, name) {
10935
+ const raw = xmlAttr(node, name);
10936
+ if (raw === void 0) {
10937
+ return void 0;
10938
+ }
10939
+ const normalized = raw.trim().toLowerCase();
10940
+ if (normalized === "1" || normalized === "true") {
10941
+ return true;
10942
+ }
10943
+ if (normalized === "0" || normalized === "false") {
10944
+ return false;
10945
+ }
10946
+ return void 0;
10947
+ }
10948
+ function xmlText(node) {
10949
+ if (typeof node === "string") {
10950
+ return node;
10951
+ }
10952
+ if (!isXmlObject(node)) {
10953
+ return void 0;
10954
+ }
10955
+ return coerceString(node[TEXT_KEY]);
10956
+ }
10957
+ function xmlPath(node, ...keys) {
10958
+ let current = isXmlObject(node) ? node : void 0;
10959
+ for (const key of keys) {
10960
+ if (!current) {
10961
+ return void 0;
10962
+ }
10963
+ current = xmlChild(current, key);
10964
+ }
10965
+ return current;
10966
+ }
10967
+ function isXmlNode(value) {
10968
+ return isXmlObject(value);
10969
+ }
10970
+
10971
+ // src/core/utils/app-properties-titles.ts
10972
+ var SLIDE_TITLES_NAME = "Slide Titles";
10973
+ function coerceText(value) {
10974
+ if (typeof value === "string") {
10975
+ return value;
10976
+ }
10977
+ if (typeof value === "number" || typeof value === "boolean") {
10978
+ return String(value);
10979
+ }
10980
+ if (isXmlNode(value)) {
10981
+ const text2 = value["#text"];
10982
+ return text2 === void 0 || text2 === null ? "" : String(text2);
10983
+ }
10984
+ return "";
10985
+ }
10986
+ function coerceCount(value) {
10987
+ const parsed = Number.parseInt(coerceText(value), 10);
10988
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
10989
+ }
10990
+ function readLpstrList(vector) {
10991
+ if (!vector) {
10992
+ return [];
10993
+ }
10994
+ const raw = vector["vt:lpstr"];
10995
+ if (raw === void 0 || raw === null) {
10996
+ return [];
10997
+ }
10998
+ return (Array.isArray(raw) ? raw : [raw]).map(coerceText);
10999
+ }
11000
+ function isSlideTitlesCategory(name) {
11001
+ const normalized = name.trim().toLowerCase();
11002
+ return normalized === "slide titles" || normalized.includes("slide") && normalized.includes("title");
11003
+ }
11004
+ function readCategories(headingPairs, titlesOfParts) {
11005
+ const variants = xmlChildren(xmlChild(headingPairs, "vt:vector"), "vt:variant");
11006
+ const entries = readLpstrList(xmlChild(titlesOfParts, "vt:vector"));
11007
+ const categories = [];
11008
+ let offset = 0;
11009
+ for (let i = 0; i + 1 < variants.length; i += 2) {
11010
+ const name = coerceText(variants[i]["vt:lpstr"]);
11011
+ const count = coerceCount(variants[i + 1]["vt:i4"]);
11012
+ categories.push({ name, entries: entries.slice(offset, offset + count) });
11013
+ offset += count;
11014
+ }
11015
+ return categories;
11016
+ }
11017
+ function writeHeadingPairs(appProps, categories) {
11018
+ const variants = [];
11019
+ for (const category of categories) {
11020
+ variants.push({ "vt:lpstr": category.name });
11021
+ variants.push({ "vt:i4": String(category.entries.length) });
11022
+ }
11023
+ appProps["HeadingPairs"] = {
11024
+ "vt:vector": {
11025
+ "@_size": String(variants.length),
11026
+ "@_baseType": "variant",
11027
+ "vt:variant": variants
11028
+ }
11029
+ };
11030
+ }
11031
+ function writeTitlesOfParts(appProps, categories) {
11032
+ const allEntries = categories.flatMap((category) => category.entries);
11033
+ const lpstr = allEntries.map((entry) => ({ "#text": entry }));
11034
+ appProps["TitlesOfParts"] = {
11035
+ "vt:vector": {
11036
+ "@_size": String(allEntries.length),
11037
+ "@_baseType": "lpstr",
11038
+ "vt:lpstr": lpstr
11039
+ }
11040
+ };
11041
+ }
11042
+ function applySlideTitlesToAppProps(appProps, titles) {
11043
+ const headingPairs = xmlChild(appProps, "HeadingPairs");
11044
+ if (!headingPairs) {
11045
+ return;
11046
+ }
11047
+ const titlesOfParts = xmlChild(appProps, "TitlesOfParts");
11048
+ const categories = readCategories(headingPairs, titlesOfParts);
11049
+ const slideCategory = categories.find((category) => isSlideTitlesCategory(category.name));
11050
+ if (slideCategory) {
11051
+ slideCategory.entries = titles;
11052
+ } else {
11053
+ categories.push({ name: SLIDE_TITLES_NAME, entries: titles });
11054
+ }
11055
+ writeHeadingPairs(appProps, categories);
11056
+ writeTitlesOfParts(appProps, categories);
11057
+ }
11058
+
11059
+ // src/core/utils/slide-title.ts
11060
+ var TITLE_PLACEHOLDER_TYPES = /* @__PURE__ */ new Set(["title", "ctrtitle"]);
11061
+ function getElementPlaceholderType(element) {
11062
+ const explicit = element.placeholderType;
11063
+ if (typeof explicit === "string" && explicit.trim().length > 0) {
11064
+ return explicit.trim().toLowerCase();
11065
+ }
11066
+ const ph = xmlPath(element.rawXml, "p:nvSpPr", "p:nvPr", "p:ph");
11067
+ const type = xmlAttr(ph, "type");
11068
+ return type ? type.trim().toLowerCase() : void 0;
11069
+ }
11070
+ function getElementPlainText(element) {
11071
+ const maybe = element;
11072
+ if (typeof maybe.text === "string" && maybe.text.trim().length > 0) {
11073
+ return maybe.text.trim();
11074
+ }
11075
+ if (Array.isArray(maybe.textSegments)) {
11076
+ const joined = maybe.textSegments.map((segment) => typeof segment?.text === "string" ? segment.text : "").join("");
11077
+ return joined.trim();
11078
+ }
11079
+ return "";
11080
+ }
11081
+ function deriveSlideTitle(slide) {
11082
+ const elements2 = slide.elements ?? [];
11083
+ for (const element of elements2) {
11084
+ const phType = getElementPlaceholderType(element);
11085
+ if (phType && TITLE_PLACEHOLDER_TYPES.has(phType)) {
11086
+ const text2 = getElementPlainText(element);
11087
+ if (text2) {
11088
+ return text2;
11089
+ }
11090
+ }
11091
+ }
11092
+ return "";
11093
+ }
11094
+ function deriveSlideTitles(slides) {
11095
+ return slides.map((slide) => deriveSlideTitle(slide));
11096
+ }
11097
+
10675
11098
  // src/core/services/PptxDocumentPropertiesUpdater.ts
10676
11099
  var PptxDocumentPropertiesUpdater = class {
10677
11100
  context;
@@ -10735,6 +11158,7 @@ var PptxDocumentPropertiesUpdater = class {
10735
11158
  appProps["Slides"] = String(slides.length);
10736
11159
  appProps["HiddenSlides"] = String(hiddenSlidesCount);
10737
11160
  appProps["Notes"] = String(notesCount);
11161
+ this.updateSlideTitleProperties(appProps, slides);
10738
11162
  appData["Properties"] = appProps;
10739
11163
  this.context.zip.file("docProps/app.xml", this.context.builder.build(appData));
10740
11164
  } catch (error) {
@@ -10777,6 +11201,15 @@ var PptxDocumentPropertiesUpdater = class {
10777
11201
  }
10778
11202
  }
10779
11203
  }
11204
+ /**
11205
+ * Recompute `TitlesOfParts` / `HeadingPairs` from the current slide set so
11206
+ * the per-slide title list in `app.xml` stays consistent after slides are
11207
+ * added, removed, or retitled. Delegates the vector rebuild to a pure
11208
+ * helper; here we only derive the ordered titles.
11209
+ */
11210
+ updateSlideTitleProperties(appProps, slides) {
11211
+ applySlideTitlesToAppProps(appProps, deriveSlideTitles(slides));
11212
+ }
10780
11213
  applyAppPropertiesOverrides(appProps, overrides10) {
10781
11214
  if (!overrides10) {
10782
11215
  return;
@@ -12605,6 +13038,16 @@ function extractChildKeyframes(childTnList) {
12605
13038
  }
12606
13039
  return void 0;
12607
13040
  }
13041
+ function parseTimingPercentFraction(raw) {
13042
+ if (raw === void 0 || raw === null) {
13043
+ return void 0;
13044
+ }
13045
+ const parsed = Number.parseInt(String(raw), 10);
13046
+ if (!Number.isFinite(parsed) || parsed <= 0) {
13047
+ return void 0;
13048
+ }
13049
+ return Math.min(1, parsed / 1e5);
13050
+ }
12608
13051
  function extractRepeatInfo(cTn) {
12609
13052
  let repeatCount;
12610
13053
  let autoReverse;
@@ -12748,11 +13191,11 @@ function ensureArray4(value) {
12748
13191
  return [];
12749
13192
  }
12750
13193
  if (!Array.isArray(value)) {
12751
- return isXmlObject(value) ? [value] : [];
13194
+ return isXmlObject2(value) ? [value] : [];
12752
13195
  }
12753
- return value.filter((entry) => isXmlObject(entry));
13196
+ return value.filter((entry) => isXmlObject2(entry));
12754
13197
  }
12755
- function isXmlObject(value) {
13198
+ function isXmlObject2(value) {
12756
13199
  return typeof value === "object" && value !== null && !Array.isArray(value);
12757
13200
  }
12758
13201
  var VALID_CONDITION_EVENTS = /* @__PURE__ */ new Set([
@@ -13120,6 +13563,8 @@ var PptxNativeAnimationService = class {
13120
13563
  const presetSubtype = cTn["@_presetSubtype"] !== void 0 ? Number.parseInt(String(cTn["@_presetSubtype"]), 10) : void 0;
13121
13564
  const durationMs = cTn["@_dur"] ? Number.parseInt(String(cTn["@_dur"]), 10) : void 0;
13122
13565
  const delayMs = cTn["@_delay"] ? Number.parseInt(String(cTn["@_delay"]), 10) : void 0;
13566
+ const accel = parseTimingPercentFraction(cTn["@_accel"]);
13567
+ const decel = parseTimingPercentFraction(cTn["@_decel"]);
13123
13568
  let trigger = currentTrigger;
13124
13569
  if (nodeType === "afterPrevious" || nodeType === "afterPrev") {
13125
13570
  trigger = "afterPrevious";
@@ -13172,6 +13617,8 @@ var PptxNativeAnimationService = class {
13172
13617
  presetSubtype,
13173
13618
  durationMs,
13174
13619
  delayMs,
13620
+ accel,
13621
+ decel,
13175
13622
  triggerDelayMs: trigger === "afterDelay" ? delayMs : void 0,
13176
13623
  motionPath: childMotion.motionPath,
13177
13624
  motionOrigin: childMotion.motionOrigin,
@@ -14412,7 +14859,7 @@ function updateEffectNodeAttributes(cTn, anim, currentPresetClass) {
14412
14859
  if (stCondList && anim.delayMs !== void 0) {
14413
14860
  const conditions = ensureArray4(stCondList["p:cond"]);
14414
14861
  for (const cond of conditions) {
14415
- if (isXmlObject(cond)) {
14862
+ if (isXmlObject2(cond)) {
14416
14863
  cond["@_delay"] = String(anim.delayMs);
14417
14864
  }
14418
14865
  }
@@ -24503,7 +24950,7 @@ function getCalloutViewBoxBounds(width, height, geometry, padding = 2) {
24503
24950
  }
24504
24951
 
24505
24952
  // src/core/core/runtime/omml-sibling-order.ts
24506
- function isXmlObject2(value) {
24953
+ function isXmlObject3(value) {
24507
24954
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
24508
24955
  }
24509
24956
  function ensureItems(value) {
@@ -24606,7 +25053,7 @@ function collectParsedOmathNodes(root) {
24606
25053
  }
24607
25054
  if (localName9(key) === "oMath") {
24608
25055
  for (const item of ensureItems(value)) {
24609
- if (isXmlObject2(item)) {
25056
+ if (isXmlObject3(item)) {
24610
25057
  result.push(item);
24611
25058
  }
24612
25059
  }
@@ -24669,7 +25116,7 @@ function reorderContainer(node, rawInner) {
24669
25116
  occurrence.set(child20.tag, index + 1);
24670
25117
  const value = ensureItems(node[child20.tag])[index];
24671
25118
  resolved.push({ tag: child20.tag, value });
24672
- if (isXmlObject2(value) && child20.inner) {
25119
+ if (isXmlObject3(value) && child20.inner) {
24673
25120
  reorderContainer(value, child20.inner);
24674
25121
  }
24675
25122
  }
@@ -24713,7 +25160,7 @@ function localName10(name) {
24713
25160
  const colon = name.indexOf(":");
24714
25161
  return colon >= 0 ? name.slice(colon + 1) : name;
24715
25162
  }
24716
- function isXmlObject3(value) {
25163
+ function isXmlObject4(value) {
24717
25164
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
24718
25165
  }
24719
25166
  function collectParsedParagraphs(root) {
@@ -24738,7 +25185,7 @@ function collectParsedParagraphs(root) {
24738
25185
  continue;
24739
25186
  }
24740
25187
  paragraphs.push(
24741
- ...(Array.isArray(childValue) ? childValue : [childValue]).filter(isXmlObject3)
25188
+ ...(Array.isArray(childValue) ? childValue : [childValue]).filter(isXmlObject4)
24742
25189
  );
24743
25190
  }
24744
25191
  } else {
@@ -24785,7 +25232,7 @@ function directChildrenByLocalName(paragraphs, name) {
24785
25232
  return [];
24786
25233
  }
24787
25234
  const values = Array.isArray(value) ? value : [value];
24788
- return values.filter(isXmlObject3);
25235
+ return values.filter(isXmlObject4);
24789
25236
  })
24790
25237
  );
24791
25238
  }
@@ -26200,99 +26647,6 @@ function detectFontFormat(data) {
26200
26647
  return "truetype";
26201
26648
  }
26202
26649
 
26203
- // src/core/utils/xml-access.ts
26204
- var ATTR_PREFIX = "@_";
26205
- var TEXT_KEY = "#text";
26206
- function isXmlObject4(value) {
26207
- return typeof value === "object" && value !== null && !Array.isArray(value);
26208
- }
26209
- function coerceString(value) {
26210
- if (typeof value === "string") {
26211
- return value;
26212
- }
26213
- if (typeof value === "number" || typeof value === "boolean") {
26214
- return String(value);
26215
- }
26216
- return void 0;
26217
- }
26218
- function xmlChild(node, key) {
26219
- if (!isXmlObject4(node)) {
26220
- return void 0;
26221
- }
26222
- const value = node[key];
26223
- if (Array.isArray(value)) {
26224
- const first = value[0];
26225
- return isXmlObject4(first) ? first : void 0;
26226
- }
26227
- return isXmlObject4(value) ? value : void 0;
26228
- }
26229
- function xmlChildren(node, key) {
26230
- if (!isXmlObject4(node)) {
26231
- return [];
26232
- }
26233
- const value = node[key];
26234
- if (value === void 0 || value === null) {
26235
- return [];
26236
- }
26237
- if (Array.isArray(value)) {
26238
- return value.filter(isXmlObject4);
26239
- }
26240
- return isXmlObject4(value) ? [value] : [];
26241
- }
26242
- function xmlHasChild(node, key) {
26243
- return isXmlObject4(node) && Object.hasOwn(node, key);
26244
- }
26245
- function xmlAttr(node, name) {
26246
- if (!isXmlObject4(node)) {
26247
- return void 0;
26248
- }
26249
- return coerceString(node[ATTR_PREFIX + name]);
26250
- }
26251
- function xmlAttrNumber(node, name) {
26252
- const raw = xmlAttr(node, name);
26253
- if (raw === void 0) {
26254
- return void 0;
26255
- }
26256
- const parsed = Number(raw);
26257
- return Number.isFinite(parsed) ? parsed : void 0;
26258
- }
26259
- function xmlAttrBool(node, name) {
26260
- const raw = xmlAttr(node, name);
26261
- if (raw === void 0) {
26262
- return void 0;
26263
- }
26264
- const normalized = raw.trim().toLowerCase();
26265
- if (normalized === "1" || normalized === "true") {
26266
- return true;
26267
- }
26268
- if (normalized === "0" || normalized === "false") {
26269
- return false;
26270
- }
26271
- return void 0;
26272
- }
26273
- function xmlText(node) {
26274
- if (typeof node === "string") {
26275
- return node;
26276
- }
26277
- if (!isXmlObject4(node)) {
26278
- return void 0;
26279
- }
26280
- return coerceString(node[TEXT_KEY]);
26281
- }
26282
- function xmlPath(node, ...keys) {
26283
- let current = isXmlObject4(node) ? node : void 0;
26284
- for (const key of keys) {
26285
- if (!current) {
26286
- return void 0;
26287
- }
26288
- current = xmlChild(current, key);
26289
- }
26290
- return current;
26291
- }
26292
- function isXmlNode(value) {
26293
- return isXmlObject4(value);
26294
- }
26295
-
26296
26650
  // src/core/utils/presentation-section-parser.ts
26297
26651
  function findSectionList2(presentation, lookup) {
26298
26652
  const direct = lookup.getChildByLocalName(presentation, "sectionLst");
@@ -29628,6 +29982,7 @@ function getSvgStrokeDasharray(dashType, strokeWidth, customDashSegments) {
29628
29982
  // src/core/utils/element-xml-builders.ts
29629
29983
  function createTemplateShapeRawXml(element) {
29630
29984
  const isText = element.type === "text";
29985
+ const isTextBox = element.locks?.txBox ?? isText;
29631
29986
  const name = isText ? "TextBox" : "Rectangle";
29632
29987
  const geometry = element.shapeType === "cylinder" ? "can" : element.shapeType || "rect";
29633
29988
  const adjustmentEntries = Object.entries(element.shapeAdjustments || {}).filter(
@@ -29646,7 +30001,7 @@ function createTemplateShapeRawXml(element) {
29646
30001
  "@_name": `${name} ${Math.floor(Math.random() * 100)}`
29647
30002
  },
29648
30003
  "p:cNvSpPr": {
29649
- "@_txBox": isText ? "1" : "0"
30004
+ "@_txBox": isTextBox ? "1" : "0"
29650
30005
  },
29651
30006
  "p:nvPr": {}
29652
30007
  },
@@ -32837,6 +33192,122 @@ function applyNodeStylesToElements(elements2, nodes) {
32837
33192
  });
32838
33193
  }
32839
33194
 
33195
+ // src/core/utils/smartart-pres-layout-vars.ts
33196
+ var CONTAINER_LOCAL_NAMES = /* @__PURE__ */ new Set(["presLayoutVars", "varLst"]);
33197
+ function localNameOf2(key) {
33198
+ const idx = key.indexOf(":");
33199
+ return idx >= 0 ? key.slice(idx + 1) : key;
33200
+ }
33201
+ function findVarsContainer(node) {
33202
+ if (!node || typeof node !== "object") {
33203
+ return void 0;
33204
+ }
33205
+ if (Array.isArray(node)) {
33206
+ for (const entry of node) {
33207
+ const found = findVarsContainer(entry);
33208
+ if (found) {
33209
+ return found;
33210
+ }
33211
+ }
33212
+ return void 0;
33213
+ }
33214
+ for (const [key, value] of Object.entries(node)) {
33215
+ if (key.startsWith("@_")) {
33216
+ continue;
33217
+ }
33218
+ if (CONTAINER_LOCAL_NAMES.has(localNameOf2(key))) {
33219
+ const container = Array.isArray(value) ? value[0] : value;
33220
+ if (container && typeof container === "object") {
33221
+ return container;
33222
+ }
33223
+ }
33224
+ const nested = findVarsContainer(value);
33225
+ if (nested) {
33226
+ return nested;
33227
+ }
33228
+ }
33229
+ return void 0;
33230
+ }
33231
+ function varValue(container, name) {
33232
+ for (const [key, value] of Object.entries(container)) {
33233
+ if (key.startsWith("@_") || localNameOf2(key) !== name) {
33234
+ continue;
33235
+ }
33236
+ const node = Array.isArray(value) ? value[0] : value;
33237
+ if (node && typeof node === "object") {
33238
+ const raw = node["@_val"];
33239
+ const str = String(raw ?? "").trim();
33240
+ return str.length > 0 ? str : void 0;
33241
+ }
33242
+ }
33243
+ return void 0;
33244
+ }
33245
+ function boolValue2(container, name) {
33246
+ const raw = varValue(container, name);
33247
+ if (raw === void 0) {
33248
+ return void 0;
33249
+ }
33250
+ const lower = raw.toLowerCase();
33251
+ return lower === "1" || lower === "true" || lower === "on";
33252
+ }
33253
+ function intValue(container, name) {
33254
+ const raw = varValue(container, name);
33255
+ if (raw === void 0) {
33256
+ return void 0;
33257
+ }
33258
+ const parsed = Number.parseInt(raw, 10);
33259
+ return Number.isFinite(parsed) ? parsed : void 0;
33260
+ }
33261
+ var DIRECTIONS = /* @__PURE__ */ new Set(["norm", "rev"]);
33262
+ var HIER_BRANCHES = /* @__PURE__ */ new Set(["std", "init", "l", "r", "hang"]);
33263
+ function parseSmartArtPresLayoutVars(container) {
33264
+ if (!container) {
33265
+ return void 0;
33266
+ }
33267
+ const vars = findVarsContainer(container);
33268
+ if (!vars) {
33269
+ return void 0;
33270
+ }
33271
+ const result = {};
33272
+ const direction = varValue(vars, "dir");
33273
+ if (direction && DIRECTIONS.has(direction)) {
33274
+ result.direction = direction;
33275
+ }
33276
+ const hierBranch = varValue(vars, "hierBranch");
33277
+ if (hierBranch && HIER_BRANCHES.has(hierBranch)) {
33278
+ result.hierarchyBranch = hierBranch;
33279
+ }
33280
+ const orgChart = boolValue2(vars, "orgChart");
33281
+ if (orgChart !== void 0) {
33282
+ result.orgChart = orgChart;
33283
+ }
33284
+ const chMax = intValue(vars, "chMax");
33285
+ if (chMax !== void 0) {
33286
+ result.childMax = chMax;
33287
+ }
33288
+ const chPref = intValue(vars, "chPref");
33289
+ if (chPref !== void 0) {
33290
+ result.childPreferred = chPref;
33291
+ }
33292
+ const bulletEnabled = boolValue2(vars, "bulletEnabled");
33293
+ if (bulletEnabled !== void 0) {
33294
+ result.bulletEnabled = bulletEnabled;
33295
+ }
33296
+ const animLvl = varValue(vars, "animLvl");
33297
+ if (animLvl !== void 0) {
33298
+ result.animationLevel = animLvl;
33299
+ }
33300
+ const animOne = varValue(vars, "animOne");
33301
+ if (animOne !== void 0) {
33302
+ result.animateOne = animOne;
33303
+ }
33304
+ const resizeHandles = varValue(vars, "resizeHandles");
33305
+ if (resizeHandles !== void 0) {
33306
+ result.resizeHandles = resizeHandles;
33307
+ }
33308
+ return Object.keys(result).length > 0 ? result : void 0;
33309
+ }
33310
+
32840
33311
  // src/core/utils/smartart-decompose.ts
32841
33312
  function quickStyleStrokeScale(quickStyle) {
32842
33313
  if (!quickStyle?.effectIntensity) {
@@ -32942,15 +33413,27 @@ function decomposeSmartArt(smartArtData, containerBounds, themeColorMap, layoutD
32942
33413
  smartArtData.colorTransform?.fillColors
32943
33414
  );
32944
33415
  const layoutType = resolveEffectiveLayoutType(smartArtData);
33416
+ const layoutVars = smartArtData.presLayoutVars ?? parseSmartArtPresLayoutVars(smartArtData.layoutDefinition?.rawXml);
33417
+ const orderedNodes = layoutVars?.direction === "rev" ? [...nodes].reverse() : nodes;
32945
33418
  const namedLayout = smartArtData.layout;
32946
33419
  if (namedLayout) {
32947
- const namedResult = dispatchNamedLayout(namedLayout, nodes, containerBounds, effectiveThemeMap);
33420
+ const namedResult = dispatchNamedLayout(
33421
+ namedLayout,
33422
+ orderedNodes,
33423
+ containerBounds,
33424
+ effectiveThemeMap
33425
+ );
32948
33426
  if (namedResult) {
32949
- return applyNodeStylesToElements(namedResult, nodes);
33427
+ return applyNodeStylesToElements(namedResult, orderedNodes);
32950
33428
  }
32951
33429
  }
32952
- const algorithmic = dispatchLayoutByType(layoutType, nodes, containerBounds, effectiveThemeMap);
32953
- return algorithmic ? applyNodeStylesToElements(algorithmic, nodes) : algorithmic;
33430
+ const algorithmic = dispatchLayoutByType(
33431
+ layoutType,
33432
+ orderedNodes,
33433
+ containerBounds,
33434
+ effectiveThemeMap
33435
+ );
33436
+ return algorithmic ? applyNodeStylesToElements(algorithmic, orderedNodes) : algorithmic;
32954
33437
  }
32955
33438
  function dispatchLayoutByType(layoutType, nodes, containerBounds, effectiveThemeMap) {
32956
33439
  switch (layoutType) {
@@ -42729,6 +43212,128 @@ function applySmartArtConnectionAttributes(xml, connection, fallbackModelId) {
42729
43212
  applyNullableAttribute(xml, "@_presId", connection.presentationId);
42730
43213
  }
42731
43214
 
43215
+ // src/core/utils/smartart-color-lists.ts
43216
+ var COLOR_LOCAL_NAMES = /* @__PURE__ */ new Set([
43217
+ "srgbClr",
43218
+ "schemeClr",
43219
+ "scrgbClr",
43220
+ "sysClr",
43221
+ "prstClr",
43222
+ "hslClr"
43223
+ ]);
43224
+ var COLOR_METHODS2 = /* @__PURE__ */ new Set(["span", "cycle", "repeat"]);
43225
+ var HUE_DIRECTIONS2 = /* @__PURE__ */ new Set(["cw", "ccw"]);
43226
+ var PRIMARY_LABEL_PRIORITY = ["node0", "node1", "node2", "node3", "node4", "node"];
43227
+ function localNameOf3(key) {
43228
+ const idx = key.indexOf(":");
43229
+ return idx >= 0 ? key.slice(idx + 1) : key;
43230
+ }
43231
+ function parseSmartArtColorListHexes(list, deps) {
43232
+ if (!list) {
43233
+ return [];
43234
+ }
43235
+ const out = [];
43236
+ for (const [key, value] of Object.entries(list)) {
43237
+ if (key.startsWith("@_")) {
43238
+ continue;
43239
+ }
43240
+ const local = localNameOf3(key);
43241
+ if (!COLOR_LOCAL_NAMES.has(local)) {
43242
+ continue;
43243
+ }
43244
+ const nodes = Array.isArray(value) ? value : [value];
43245
+ for (const node of nodes) {
43246
+ if (!node || typeof node !== "object") {
43247
+ continue;
43248
+ }
43249
+ const wrapper = { [`a:${local}`]: node };
43250
+ const hex10 = deps.parseColorChoice(wrapper) ?? deps.resolveScheme(node);
43251
+ if (hex10) {
43252
+ out.push(hex10);
43253
+ }
43254
+ }
43255
+ }
43256
+ return out;
43257
+ }
43258
+ function listInterpolation(list) {
43259
+ if (!list) {
43260
+ return void 0;
43261
+ }
43262
+ const method = String(list["@_meth"] ?? "").trim();
43263
+ const hueDir = String(list["@_hueDir"] ?? "").trim();
43264
+ const meta = {};
43265
+ if (COLOR_METHODS2.has(method)) {
43266
+ meta.method = method;
43267
+ }
43268
+ if (HUE_DIRECTIONS2.has(hueDir)) {
43269
+ meta.hueDirection = hueDir;
43270
+ }
43271
+ return meta.method || meta.hueDirection ? meta : void 0;
43272
+ }
43273
+ function parseLabel(lbl, deps) {
43274
+ const fillList = deps.getChild(lbl, "fillClrLst");
43275
+ const lineList = deps.getChild(lbl, "linClrLst");
43276
+ return {
43277
+ name: String(lbl["@_name"] ?? "").trim(),
43278
+ fill: parseSmartArtColorListHexes(fillList, deps),
43279
+ line: parseSmartArtColorListHexes(lineList, deps),
43280
+ textFill: parseSmartArtColorListHexes(deps.getChild(lbl, "txFillClrLst"), deps),
43281
+ textLine: parseSmartArtColorListHexes(deps.getChild(lbl, "txLinClrLst"), deps),
43282
+ effect: parseSmartArtColorListHexes(deps.getChild(lbl, "effectClrLst"), deps),
43283
+ textEffect: parseSmartArtColorListHexes(deps.getChild(lbl, "txEffectClrLst"), deps),
43284
+ fillInterpolation: listInterpolation(fillList),
43285
+ lineInterpolation: listInterpolation(lineList)
43286
+ };
43287
+ }
43288
+ function selectPrimary(parsed) {
43289
+ const byName = new Map(parsed.map((p) => [p.name, p]));
43290
+ for (const name of PRIMARY_LABEL_PRIORITY) {
43291
+ const candidate = byName.get(name);
43292
+ if (candidate && candidate.fill.length > 0) {
43293
+ return candidate;
43294
+ }
43295
+ }
43296
+ for (const name of PRIMARY_LABEL_PRIORITY) {
43297
+ const candidate = byName.get(name);
43298
+ if (candidate && (candidate.line.length > 0 || candidate.fill.length > 0)) {
43299
+ return candidate;
43300
+ }
43301
+ }
43302
+ return parsed.find((p) => p.fill.length > 0) ?? parsed.find((p) => p.line.length > 0);
43303
+ }
43304
+ function buildSmartArtColorLists(styleLbls, deps) {
43305
+ const parsed = styleLbls.map((lbl) => parseLabel(lbl, deps));
43306
+ const primary = selectPrimary(parsed);
43307
+ let fillColors = primary?.fill ?? [];
43308
+ let lineColors = primary?.line ?? [];
43309
+ if (fillColors.length === 0) {
43310
+ fillColors = parsed.map((p) => p.fill[0]).filter((c) => Boolean(c));
43311
+ }
43312
+ if (lineColors.length === 0) {
43313
+ lineColors = parsed.map((p) => p.line[0]).filter((c) => Boolean(c));
43314
+ }
43315
+ const result = { fillColors, lineColors };
43316
+ if (primary?.textFill.length) {
43317
+ result.textFillColors = primary.textFill;
43318
+ }
43319
+ if (primary?.textLine.length) {
43320
+ result.textLineColors = primary.textLine;
43321
+ }
43322
+ if (primary?.effect.length) {
43323
+ result.effectColors = primary.effect;
43324
+ }
43325
+ if (primary?.textEffect.length) {
43326
+ result.textEffectColors = primary.textEffect;
43327
+ }
43328
+ if (primary?.fillInterpolation) {
43329
+ result.fillInterpolation = primary.fillInterpolation;
43330
+ }
43331
+ if (primary?.lineInterpolation) {
43332
+ result.lineInterpolation = primary.lineInterpolation;
43333
+ }
43334
+ return result;
43335
+ }
43336
+
42732
43337
  // src/core/utils/modern-comment-constants.ts
42733
43338
  var MODERN_COMMENT_NAMESPACE = "http://schemas.microsoft.com/office/powerpoint/2018/8/main";
42734
43339
  var MODERN_COMMENT_RELATIONSHIP = "http://schemas.microsoft.com/office/2018/10/relationships/comments";
@@ -45035,6 +45640,28 @@ function buildGeneratedChartAxis(axId, crossId, pos2, formatting) {
45035
45640
  return axis;
45036
45641
  }
45037
45642
 
45643
+ // src/core/utils/chart-xml-container-map.ts
45644
+ var CONTAINER_MAP = {
45645
+ pie: { tag: "c:pieChart", family: "pie" },
45646
+ pie3D: { tag: "c:pie3DChart", family: "pie" },
45647
+ ofPie: { tag: "c:ofPieChart", family: "ofPie" },
45648
+ doughnut: { tag: "c:doughnutChart", family: "doughnut" },
45649
+ scatter: { tag: "c:scatterChart", family: "scatter" },
45650
+ bubble: { tag: "c:bubbleChart", family: "bubble" },
45651
+ line: { tag: "c:lineChart", family: "line" },
45652
+ line3D: { tag: "c:line3DChart", family: "line" },
45653
+ area: { tag: "c:areaChart", family: "area" },
45654
+ area3D: { tag: "c:area3DChart", family: "area" },
45655
+ radar: { tag: "c:radarChart", family: "radar" },
45656
+ stock: { tag: "c:stockChart", family: "stock" },
45657
+ surface: { tag: "c:surfaceChart", family: "surface" },
45658
+ bar: { tag: "c:barChart", family: "bar" },
45659
+ bar3D: { tag: "c:bar3DChart", family: "bar" }
45660
+ };
45661
+ function resolveChartContainerType(type) {
45662
+ return CONTAINER_MAP[type] ?? { tag: "c:barChart", family: "bar" };
45663
+ }
45664
+
45038
45665
  // src/core/utils/chart-xml-generator.ts
45039
45666
  var NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
45040
45667
  var NS_A2 = "http://schemas.openxmlformats.org/drawingml/2006/main";
@@ -45065,29 +45692,6 @@ function strLit(values) {
45065
45692
  }
45066
45693
  };
45067
45694
  }
45068
- function resolveType(type) {
45069
- switch (type) {
45070
- case "pie":
45071
- case "pie3D":
45072
- return { tag: "c:pieChart", family: "pie" };
45073
- case "doughnut":
45074
- return { tag: "c:doughnutChart", family: "doughnut" };
45075
- case "scatter":
45076
- return { tag: "c:scatterChart", family: "scatter" };
45077
- case "bubble":
45078
- return { tag: "c:bubbleChart", family: "bubble" };
45079
- case "line":
45080
- case "line3D":
45081
- return { tag: "c:lineChart", family: "line" };
45082
- case "area":
45083
- case "area3D":
45084
- return { tag: "c:areaChart", family: "area" };
45085
- case "radar":
45086
- return { tag: "c:radarChart", family: "radar" };
45087
- default:
45088
- return { tag: "c:barChart", family: "bar" };
45089
- }
45090
- }
45091
45695
  function fillSpPr(color2, asLine) {
45092
45696
  const h = hex6(color2);
45093
45697
  if (!h) {
@@ -45155,7 +45759,10 @@ function buildChartTypeContainer(chartData, family) {
45155
45759
  } else if (family === "scatter") {
45156
45760
  container["c:scatterStyle"] = { "@_val": "lineMarker" };
45157
45761
  container["c:varyColors"] = { "@_val": "0" };
45158
- } else {
45762
+ } else if (family === "ofPie") {
45763
+ container["c:ofPieType"] = { "@_val": "pie" };
45764
+ container["c:varyColors"] = { "@_val": "1" };
45765
+ } else if (family === "stock" || family === "surface") ; else {
45159
45766
  container["c:varyColors"] = { "@_val": family === "bubble" ? "0" : "1" };
45160
45767
  }
45161
45768
  container["c:ser"] = chartData.series.map(
@@ -45167,12 +45774,13 @@ function buildChartTypeContainer(chartData, family) {
45167
45774
  if (family === "line" && chartData.upDownBars !== void 0) {
45168
45775
  applyChartUpDownBars(container, chartData.upDownBars, (key) => key.replace(/^.*:/u, ""));
45169
45776
  }
45170
- if (family === "bar") {
45777
+ if (family === "bar" || family === "ofPie") {
45171
45778
  container["c:gapWidth"] = { "@_val": "150" };
45172
- container["c:axId"] = [{ "@_val": String(CAT_AX_ID) }, { "@_val": String(VAL_AX_ID) }];
45173
- } else if (family === "line" || family === "area" || family === "radar") {
45174
- container["c:axId"] = [{ "@_val": String(CAT_AX_ID) }, { "@_val": String(VAL_AX_ID) }];
45175
- } else if (family === "scatter" || family === "bubble") {
45779
+ }
45780
+ if (family === "stock") {
45781
+ container["c:hiLowLines"] = {};
45782
+ }
45783
+ if (family === "bar" || family === "line" || family === "area" || family === "radar" || family === "scatter" || family === "bubble" || family === "stock" || family === "surface") {
45176
45784
  container["c:axId"] = [{ "@_val": String(CAT_AX_ID) }, { "@_val": String(VAL_AX_ID) }];
45177
45785
  } else if (family === "doughnut") {
45178
45786
  container["c:holeSize"] = { "@_val": "50" };
@@ -45185,7 +45793,8 @@ function buildPlotArea(chartData, tag, family) {
45185
45793
  if (chartData.style) {
45186
45794
  applyChartDataLabelsToXml(plotArea, chartData.style, (key) => key.replace(/^.*:/u, ""));
45187
45795
  }
45188
- if (family !== "pie" && family !== "doughnut" && SCATTER_LIKE.has(chartData.chartType)) {
45796
+ const hasAxes = family !== "pie" && family !== "doughnut" && family !== "ofPie";
45797
+ if (hasAxes && SCATTER_LIKE.has(chartData.chartType)) {
45189
45798
  plotArea["c:valAx"] = [
45190
45799
  buildGeneratedChartAxis(
45191
45800
  CAT_AX_ID,
@@ -45200,7 +45809,7 @@ function buildPlotArea(chartData, tag, family) {
45200
45809
  axisFormatting(chartData, "valAx", VAL_AX_ID, 1)
45201
45810
  )
45202
45811
  ];
45203
- } else if (family !== "pie" && family !== "doughnut") {
45812
+ } else if (hasAxes) {
45204
45813
  const dateAxis = chartData.dateCategories ? axisFormatting(chartData, "dateAx", CAT_AX_ID) : void 0;
45205
45814
  plotArea[dateAxis ? "c:dateAx" : "c:catAx"] = buildGeneratedChartAxis(
45206
45815
  CAT_AX_ID,
@@ -45219,7 +45828,7 @@ function buildPlotArea(chartData, tag, family) {
45219
45828
  return plotArea;
45220
45829
  }
45221
45830
  function buildChartSpaceXml(chartData) {
45222
- const { tag, family } = resolveType(chartData.chartType);
45831
+ const { tag, family } = resolveChartContainerType(chartData.chartType);
45223
45832
  const chart = {};
45224
45833
  if (chartData.title) {
45225
45834
  chart["c:title"] = {
@@ -47151,6 +47760,7 @@ function parseMediaExtensionData(mediaNode, cMediaNode, shapeId, ensureArray16)
47151
47760
  let playbackSpeed;
47152
47761
  let trimStartMs;
47153
47762
  let trimEndMs;
47763
+ let embedRId;
47154
47764
  const bookmarks = [];
47155
47765
  const extLst = mediaNode["p:extLst"] ?? cMediaNode["p:extLst"];
47156
47766
  if (extLst) {
@@ -47158,6 +47768,13 @@ function parseMediaExtensionData(mediaNode, cMediaNode, shapeId, ensureArray16)
47158
47768
  for (const ext of exts) {
47159
47769
  const p14Media = ext["p14:media"];
47160
47770
  if (p14Media) {
47771
+ if (embedRId === void 0) {
47772
+ const embedRaw = p14Media["@_r:embed"] ?? p14Media["@_embed"];
47773
+ const embedStr = embedRaw === void 0 ? "" : String(embedRaw).trim();
47774
+ if (embedStr.length > 0) {
47775
+ embedRId = embedStr;
47776
+ }
47777
+ }
47161
47778
  const p14Trim = p14Media["p14:trim"];
47162
47779
  if (p14Trim) {
47163
47780
  const st = p14Trim["@_st"];
@@ -47227,7 +47844,8 @@ function parseMediaExtensionData(mediaNode, cMediaNode, shapeId, ensureArray16)
47227
47844
  fadeInDuration,
47228
47845
  fadeOutDuration,
47229
47846
  playbackSpeed,
47230
- bookmarks
47847
+ bookmarks,
47848
+ embedRId
47231
47849
  };
47232
47850
  }
47233
47851
 
@@ -47457,6 +48075,12 @@ var PptxHandlerRuntime = class {
47457
48075
  loadedEmbeddedFonts = [];
47458
48076
  /** Typed source metadata for lossless embedded-font list round trips. */
47459
48077
  loadedEmbeddedFontList;
48078
+ /**
48079
+ * View properties parsed from `ppt/viewProps.xml` during load, preserved so
48080
+ * an unmodified load -> save round-trips the typed model and callers that do
48081
+ * not override `saveOptions.viewProperties` still persist the loaded state.
48082
+ */
48083
+ loadedViewProperties;
47460
48084
  /** Map of comment author IDs to display names (from `ppt/commentAuthors.xml`). */
47461
48085
  commentAuthorMap = /* @__PURE__ */ new Map();
47462
48086
  /** Full comment author details keyed by author ID, preserving initials/lastIdx/clrIdx for round-trip. */
@@ -47683,19 +48307,179 @@ function parseTableStyleBorders(tcStyle) {
47683
48307
  return has ? result : void 0;
47684
48308
  }
47685
48309
 
48310
+ // src/core/core/runtime/table-style-fill-parse.ts
48311
+ function toHex3(raw) {
48312
+ const hex10 = String(raw ?? "").trim();
48313
+ if (!hex10) {
48314
+ return void 0;
48315
+ }
48316
+ return hex10.startsWith("#") ? hex10 : `#${hex10}`;
48317
+ }
48318
+ function parseColorChoiceFill(node) {
48319
+ if (!node) {
48320
+ return void 0;
48321
+ }
48322
+ const scheme = parseSolidFillStyle(node);
48323
+ if (scheme) {
48324
+ return scheme;
48325
+ }
48326
+ const srgb = node["a:srgbClr"];
48327
+ const color2 = toHex3(srgb?.["@_val"]);
48328
+ if (!color2) {
48329
+ return void 0;
48330
+ }
48331
+ const fill = { schemeColor: "", color: color2 };
48332
+ const tintRaw = srgb?.["a:tint"];
48333
+ const tint = tintRaw ? parseInt(String(tintRaw["@_val"] || "0"), 10) || void 0 : void 0;
48334
+ if (tint !== void 0) {
48335
+ fill.tint = tint;
48336
+ }
48337
+ const shadeRaw = srgb?.["a:shade"];
48338
+ const shade = shadeRaw ? parseInt(String(shadeRaw["@_val"] || "0"), 10) || void 0 : void 0;
48339
+ if (shade !== void 0) {
48340
+ fill.shade = shade;
48341
+ }
48342
+ return fill;
48343
+ }
48344
+ function parseGradientFill(gradFill) {
48345
+ const gsLst = gradFill["a:gsLst"];
48346
+ const rawStops = gsLst?.["a:gs"];
48347
+ const gsNodes = Array.isArray(rawStops) ? rawStops : rawStops ? [rawStops] : [];
48348
+ const stops = [];
48349
+ for (const gs of gsNodes) {
48350
+ const fill = parseColorChoiceFill(gs);
48351
+ if (!fill) {
48352
+ continue;
48353
+ }
48354
+ const position2 = (parseInt(String(gs["@_pos"] || "0"), 10) || 0) / 1e3;
48355
+ stops.push({ position: position2, fill });
48356
+ }
48357
+ if (stops.length === 0) {
48358
+ return void 0;
48359
+ }
48360
+ const lin = gradFill["a:lin"];
48361
+ if (lin) {
48362
+ const angRaw = parseInt(String(lin["@_ang"] || "0"), 10) || 0;
48363
+ const angle = (angRaw / 6e4 % 360 + 360) % 360;
48364
+ return { stops, angle, type: "linear" };
48365
+ }
48366
+ if (gradFill["a:path"] !== void 0) {
48367
+ return { stops, type: "radial" };
48368
+ }
48369
+ return { stops, type: "linear" };
48370
+ }
48371
+ function parsePatternFill(pattFill) {
48372
+ const preset = String(pattFill["@_prst"] || "").trim();
48373
+ if (!preset) {
48374
+ return void 0;
48375
+ }
48376
+ const pattern = { preset };
48377
+ const foreground = parseColorChoiceFill(pattFill["a:fgClr"]);
48378
+ if (foreground) {
48379
+ pattern.foreground = foreground;
48380
+ }
48381
+ const background = parseColorChoiceFill(pattFill["a:bgClr"]);
48382
+ if (background) {
48383
+ pattern.background = background;
48384
+ }
48385
+ return pattern;
48386
+ }
48387
+ function parseTableStyleSectionFill(section) {
48388
+ if (!section) {
48389
+ return void 0;
48390
+ }
48391
+ const tcStyle = section["a:tcStyle"];
48392
+ const fillWrap = tcStyle?.["a:fill"];
48393
+ if (!fillWrap) {
48394
+ return void 0;
48395
+ }
48396
+ if (fillWrap["a:noFill"] !== void 0) {
48397
+ return { schemeColor: "", noFill: true };
48398
+ }
48399
+ const solid = fillWrap["a:solidFill"];
48400
+ if (solid) {
48401
+ return parseColorChoiceFill(solid);
48402
+ }
48403
+ const grad = fillWrap["a:gradFill"];
48404
+ if (grad) {
48405
+ const gradient = parseGradientFill(grad);
48406
+ if (gradient) {
48407
+ return { schemeColor: "", gradient };
48408
+ }
48409
+ }
48410
+ const patt = fillWrap["a:pattFill"];
48411
+ if (patt) {
48412
+ const pattern = parsePatternFill(patt);
48413
+ if (pattern) {
48414
+ return { schemeColor: "", pattern };
48415
+ }
48416
+ }
48417
+ return void 0;
48418
+ }
48419
+ function parseTableStyleSectionText(section) {
48420
+ const tcTxStyle = section?.["a:tcTxStyle"];
48421
+ if (!tcTxStyle) {
48422
+ return void 0;
48423
+ }
48424
+ const result = {};
48425
+ let hasProps = false;
48426
+ if (tcTxStyle["@_b"] === "on") {
48427
+ result.bold = true;
48428
+ hasProps = true;
48429
+ }
48430
+ if (tcTxStyle["@_i"] === "on") {
48431
+ result.italic = true;
48432
+ hasProps = true;
48433
+ }
48434
+ const underline = String(tcTxStyle["@_u"] || "").trim();
48435
+ if (underline && underline !== "none") {
48436
+ result.underline = true;
48437
+ hasProps = true;
48438
+ }
48439
+ const font = tcTxStyle["a:font"];
48440
+ const face = font ? String(font["@_typeface"] || "").trim() : "";
48441
+ if (face) {
48442
+ result.fontFace = face;
48443
+ hasProps = true;
48444
+ }
48445
+ const fontRef = tcTxStyle["a:fontRef"];
48446
+ const idx = fontRef ? String(fontRef["@_idx"] || "").trim() : "";
48447
+ if (idx) {
48448
+ result.fontRefIdx = idx;
48449
+ hasProps = true;
48450
+ }
48451
+ const schemeClr = fontRef?.["a:schemeClr"] ?? tcTxStyle["a:schemeClr"];
48452
+ if (schemeClr) {
48453
+ const val = String(schemeClr["@_val"] || "").trim();
48454
+ if (val) {
48455
+ result.fontSchemeColor = val;
48456
+ hasProps = true;
48457
+ const tintNode = schemeClr["a:tint"];
48458
+ if (tintNode) {
48459
+ result.fontTint = parseInt(String(tintNode["@_val"] || "0"), 10) || void 0;
48460
+ }
48461
+ const shadeNode = schemeClr["a:shade"];
48462
+ if (shadeNode) {
48463
+ result.fontShade = parseInt(String(shadeNode["@_val"] || "0"), 10) || void 0;
48464
+ }
48465
+ }
48466
+ } else {
48467
+ const srgb = fontRef?.["a:srgbClr"] ?? tcTxStyle["a:srgbClr"];
48468
+ const hex10 = toHex3(srgb?.["@_val"]);
48469
+ if (hex10) {
48470
+ result.fontColor = hex10;
48471
+ hasProps = true;
48472
+ }
48473
+ }
48474
+ return hasProps ? result : void 0;
48475
+ }
48476
+
47686
48477
  // src/core/core/runtime/PptxHandlerRuntimeTableStyles.ts
47687
48478
  var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
47688
48479
  /**
47689
- * Export slides to a raster/vector format.
47690
- *
47691
- * This is a stub that signals export intent. Actual rendering requires a
47692
- * platform-specific canvas or PDF library (e.g. Puppeteer, node-canvas,
47693
- * pdfkit). Host applications should override or extend this method with
47694
- * their own rendering pipeline.
47695
- *
47696
- * @param _slides The slides to export.
47697
- * @param _options Export options (format, DPI, slide indices, etc.).
47698
- * @returns A map of slide index → exported binary data.
48480
+ * Export slides to a raster/vector format. This is a stub that signals
48481
+ * export intent; actual rendering requires a platform-specific canvas or
48482
+ * PDF backend that host applications wire in by overriding this method.
47699
48483
  */
47700
48484
  async exportSlides(slides, options) {
47701
48485
  this.compatibilityService.reportWarning({
@@ -47760,15 +48544,11 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
47760
48544
  }
47761
48545
  /**
47762
48546
  * Extract fill information from a table style section element
47763
- * (e.g. `a:wholeTbl`, `a:band1H`, `a:firstRow`).
48547
+ * (e.g. `a:wholeTbl`, `a:band1H`, `a:firstRow`). Handles scheme + sRGB
48548
+ * solids, gradients, preset patterns, and `a:noFill` (issue #95).
47764
48549
  */
47765
48550
  extractTableStyleSectionFill(section) {
47766
- if (!section) {
47767
- return void 0;
47768
- }
47769
- const tcStyle = section["a:tcStyle"];
47770
- const fill = tcStyle?.["a:fill"];
47771
- return parseSolidFillStyle(fill?.["a:solidFill"]);
48551
+ return parseTableStyleSectionFill(section);
47772
48552
  }
47773
48553
  /**
47774
48554
  * Extract border styling from a table style section's
@@ -47778,44 +48558,12 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
47778
48558
  return parseTableStyleBorders(section?.["a:tcStyle"]);
47779
48559
  }
47780
48560
  /**
47781
- * Extract text properties from a:tcTxStyle in a table style section.
48561
+ * Extract text properties from `a:tcTxStyle` in a table style section.
48562
+ * Captures bold/italic/underline, typeface, font-collection index, and the
48563
+ * font colour (scheme or sRGB) (issue #95).
47782
48564
  */
47783
48565
  extractTableStyleSectionText(section) {
47784
- if (!section) {
47785
- return void 0;
47786
- }
47787
- const tcTxStyle = section["a:tcTxStyle"];
47788
- if (!tcTxStyle) {
47789
- return void 0;
47790
- }
47791
- const result = {};
47792
- let hasProps = false;
47793
- if (tcTxStyle["@_b"] === "on") {
47794
- result.bold = true;
47795
- hasProps = true;
47796
- }
47797
- if (tcTxStyle["@_i"] === "on") {
47798
- result.italic = true;
47799
- hasProps = true;
47800
- }
47801
- const fontClr = tcTxStyle["a:fontRef"];
47802
- const schemeClr = fontClr?.["a:schemeClr"] ?? tcTxStyle["a:schemeClr"];
47803
- if (schemeClr) {
47804
- const val = String(schemeClr["@_val"] || "").trim();
47805
- if (val) {
47806
- result.fontSchemeColor = val;
47807
- hasProps = true;
47808
- const tintNode = schemeClr["a:tint"];
47809
- if (tintNode) {
47810
- result.fontTint = parseInt(String(tintNode["@_val"] || "0"), 10) || void 0;
47811
- }
47812
- const shadeNode = schemeClr["a:shade"];
47813
- if (shadeNode) {
47814
- result.fontShade = parseInt(String(shadeNode["@_val"] || "0"), 10) || void 0;
47815
- }
47816
- }
47817
- }
47818
- return hasProps ? result : void 0;
48566
+ return parseTableStyleSectionText(section);
47819
48567
  }
47820
48568
  ensureArray(val) {
47821
48569
  if (!val) {
@@ -48495,6 +49243,7 @@ var PptxHandlerRuntime6 = class extends PptxHandlerRuntime5 {
48495
49243
  );
48496
49244
  const trimStartMs = timing.trimStartMs ?? extData.trimStartMs;
48497
49245
  const trimEndMs = timing.trimEndMs ?? extData.trimEndMs;
49246
+ const mediaEmbedPath = extData.embedRId ? this.resolveRelationshipTarget(slidePath, extData.embedRId) : void 0;
48498
49247
  result.set(shapeId, {
48499
49248
  trimStartMs: trimStartMs !== void 0 && !isNaN(trimStartMs) ? trimStartMs : void 0,
48500
49249
  trimEndMs: trimEndMs !== void 0 && !isNaN(trimEndMs) ? trimEndMs : void 0,
@@ -48508,7 +49257,8 @@ var PptxHandlerRuntime6 = class extends PptxHandlerRuntime5 {
48508
49257
  playAcrossSlides: timing.playAcrossSlides || void 0,
48509
49258
  hideWhenNotPlaying: hideWhenNotPlaying || void 0,
48510
49259
  bookmarks: extData.bookmarks.length > 0 ? extData.bookmarks : void 0,
48511
- playbackSpeed: extData.playbackSpeed
49260
+ playbackSpeed: extData.playbackSpeed,
49261
+ mediaEmbedPath
48512
49262
  });
48513
49263
  }
48514
49264
  }
@@ -48684,6 +49434,10 @@ var PptxHandlerRuntime7 = class extends PptxHandlerRuntime6 {
48684
49434
  if (!timing) {
48685
49435
  continue;
48686
49436
  }
49437
+ if (timing.mediaEmbedPath && (typeof el.mediaPath !== "string" || el.mediaPath.length === 0)) {
49438
+ el.mediaPath = timing.mediaEmbedPath;
49439
+ el.mediaMimeType = this.getImageMimeType(timing.mediaEmbedPath);
49440
+ }
48687
49441
  if (timing.trimStartMs !== void 0) {
48688
49442
  el.trimStartMs = timing.trimStartMs;
48689
49443
  }
@@ -49690,7 +50444,7 @@ var PptxHandlerRuntime11 = class extends PptxHandlerRuntime10 {
49690
50444
  }
49691
50445
  }
49692
50446
  async reconcilePresentationSlidesForSave(params) {
49693
- await this.presentationSlidesReconciler.reconcile({
50447
+ return await this.presentationSlidesReconciler.reconcile({
49694
50448
  ...params,
49695
50449
  zip: this.zip,
49696
50450
  parser: this.parser,
@@ -49983,6 +50737,31 @@ function applyFontMetadata(fontNode, panose, pitchFamily, charset) {
49983
50737
  }
49984
50738
  return fontNode;
49985
50739
  }
50740
+ function buildUnderlineLineXml(line2) {
50741
+ const uln = {};
50742
+ if (typeof line2.widthEmu === "number" && Number.isFinite(line2.widthEmu)) {
50743
+ uln["@_w"] = String(Math.round(line2.widthEmu));
50744
+ }
50745
+ if (line2.compound) {
50746
+ uln["@_cmpd"] = line2.compound;
50747
+ }
50748
+ if (line2.cap) {
50749
+ uln["@_cap"] = line2.cap;
50750
+ }
50751
+ if (line2.algn) {
50752
+ uln["@_algn"] = line2.algn;
50753
+ }
50754
+ if (line2.prstDash) {
50755
+ uln["a:prstDash"] = { "@_val": line2.prstDash };
50756
+ }
50757
+ if (line2.headEndXml) {
50758
+ uln["a:headEnd"] = line2.headEndXml;
50759
+ }
50760
+ if (line2.tailEndXml) {
50761
+ uln["a:tailEnd"] = line2.tailEndXml;
50762
+ }
50763
+ return uln;
50764
+ }
49986
50765
  var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime11 {
49987
50766
  createRunPropertiesFromTextStyle(style, resolveHyperlinkRelationshipId) {
49988
50767
  const runProps = {
@@ -50003,6 +50782,8 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50003
50782
  }
50004
50783
  if (style.underline) {
50005
50784
  runProps["@_u"] = style.underlineStyle || "sng";
50785
+ } else if (style.underlineExplicitNone) {
50786
+ runProps["@_u"] = "none";
50006
50787
  }
50007
50788
  if (style.strikethrough !== void 0) {
50008
50789
  runProps["@_strike"] = style.strikethrough ? style.strikeType || "sngStrike" : "noStrike";
@@ -50018,6 +50799,8 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50018
50799
  }
50019
50800
  if (style.textCaps && style.textCaps !== "none") {
50020
50801
  runProps["@_cap"] = style.textCaps;
50802
+ } else if (style.textCapsExplicitNone) {
50803
+ runProps["@_cap"] = "none";
50021
50804
  }
50022
50805
  if (style.kumimoji !== void 0) {
50023
50806
  runProps["@_kumimoji"] = style.kumimoji ? "1" : "0";
@@ -50126,13 +50909,21 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50126
50909
  runProps["a:effectDag"] = style.textEffectDagXml;
50127
50910
  }
50128
50911
  if (style.highlightColor) {
50129
- runProps["a:highlight"] = {
50130
- "a:srgbClr": {
50131
- "@_val": style.highlightColor.replace("#", "")
50132
- }
50133
- };
50912
+ const resolvedHighlight = style.highlightColorXml ? this.parseColor(style.highlightColorXml) : void 0;
50913
+ runProps["a:highlight"] = serializeColorChoice(
50914
+ style.highlightColorXml,
50915
+ resolvedHighlight,
50916
+ style.highlightColor
50917
+ );
50918
+ }
50919
+ if (style.underlineLineFollowsText) {
50920
+ runProps["a:uLnTx"] = {};
50921
+ } else if (style.underlineLine) {
50922
+ runProps["a:uLn"] = buildUnderlineLineXml(style.underlineLine);
50134
50923
  }
50135
- if (style.underline && style.underlineColor) {
50924
+ if (style.underlineFillFollowsText) {
50925
+ runProps["a:uFillTx"] = {};
50926
+ } else if (style.underline && style.underlineColor) {
50136
50927
  runProps["a:uFill"] = {
50137
50928
  "a:solidFill": {
50138
50929
  "a:srgbClr": {
@@ -50141,21 +50932,28 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50141
50932
  }
50142
50933
  };
50143
50934
  }
50144
- if (style.fontFamily) {
50935
+ const latinFace = style.latinFontThemeToken ?? style.fontFamily;
50936
+ if (latinFace) {
50145
50937
  runProps["a:latin"] = applyFontMetadata(
50146
- { "@_typeface": style.fontFamily },
50938
+ { "@_typeface": latinFace },
50147
50939
  style.latinFontPanose,
50148
50940
  style.latinFontPitchFamily,
50149
50941
  style.latinFontCharset
50150
50942
  );
50943
+ }
50944
+ const eastAsiaFace = style.eastAsiaFontThemeToken ?? style.eastAsiaFont;
50945
+ if (eastAsiaFace) {
50151
50946
  runProps["a:ea"] = applyFontMetadata(
50152
- { "@_typeface": style.eastAsiaFont || style.fontFamily },
50947
+ { "@_typeface": eastAsiaFace },
50153
50948
  style.eastAsiaFontPanose,
50154
50949
  style.eastAsiaFontPitchFamily,
50155
50950
  style.eastAsiaFontCharset
50156
50951
  );
50952
+ }
50953
+ const complexScriptFace = style.complexScriptFontThemeToken ?? style.complexScriptFont;
50954
+ if (complexScriptFace) {
50157
50955
  runProps["a:cs"] = applyFontMetadata(
50158
- { "@_typeface": style.complexScriptFont || style.fontFamily },
50956
+ { "@_typeface": complexScriptFace },
50159
50957
  style.complexScriptFontPanose,
50160
50958
  style.complexScriptFontPitchFamily,
50161
50959
  style.complexScriptFontCharset
@@ -50205,12 +51003,17 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50205
51003
  if (mouseOverTarget.length > 0) {
50206
51004
  const mouseOverRelId = resolveHyperlinkRelationshipId(mouseOverTarget);
50207
51005
  if (mouseOverRelId) {
50208
- runProps["a:hlinkMouseOver"] = {
50209
- "@_r:id": mouseOverRelId
50210
- };
51006
+ const mouseOverNode = { "@_r:id": mouseOverRelId };
51007
+ if (style.hyperlinkMouseOverSoundXml && typeof style.hyperlinkMouseOverSoundXml === "object") {
51008
+ mouseOverNode["a:snd"] = style.hyperlinkMouseOverSoundXml;
51009
+ }
51010
+ runProps["a:hlinkMouseOver"] = mouseOverNode;
50211
51011
  }
50212
51012
  }
50213
51013
  }
51014
+ if (style.runPropertiesExtLstXml && typeof style.runPropertiesExtLstXml === "object") {
51015
+ runProps["a:extLst"] = style.runPropertiesExtLstXml;
51016
+ }
50214
51017
  return runProps;
50215
51018
  }
50216
51019
  applyHyperlinkExtraAttrs(hlinkNode, style) {
@@ -50229,22 +51032,26 @@ var PptxHandlerRuntime12 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
50229
51032
  if (style.hyperlinkEndSound !== void 0) {
50230
51033
  hlinkNode["@_endSnd"] = style.hyperlinkEndSound ? "1" : "0";
50231
51034
  }
51035
+ if (style.hyperlinkSoundXml && typeof style.hyperlinkSoundXml === "object") {
51036
+ hlinkNode["a:snd"] = style.hyperlinkSoundXml;
51037
+ }
50232
51038
  }
50233
51039
  };
50234
51040
 
50235
51041
  // src/core/core/runtime/PptxHandlerRuntimeSaveParagraphs.ts
50236
51042
  var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50237
51043
  createParagraphsFromTextContent(text2, textStyle, textSegments, resolveHyperlinkRelationshipId) {
50238
- const paragraphAlign = this.textAlignToDrawingValue(textStyle?.align);
50239
- const spacing = {
50240
- spacingBefore: this.createParagraphSpacingXmlFromPx(textStyle?.paragraphSpacingBefore),
50241
- spacingAfter: this.createParagraphSpacingXmlFromPx(textStyle?.paragraphSpacingAfter),
50242
- lineSpacing: this.createLineSpacingXmlFromMultiplier(textStyle?.lineSpacing),
50243
- lineSpacingExactPt: textStyle?.lineSpacingExactPt
50244
- };
50245
- const createParagraph = (runs, bulletInfo, level, endParaRunProperties) => {
51044
+ const createParagraph = (runs, bulletInfo, level, endParaRunProperties, paragraphProperties2) => {
51045
+ const effectiveStyle = paragraphProperties2 ? { ...textStyle, ...paragraphProperties2 } : textStyle;
51046
+ const paragraphAlign = this.textAlignToDrawingValue(effectiveStyle?.align);
51047
+ const spacing = {
51048
+ spacingBefore: this.createParagraphSpacingXmlFromPx(effectiveStyle?.paragraphSpacingBefore),
51049
+ spacingAfter: this.createParagraphSpacingXmlFromPx(effectiveStyle?.paragraphSpacingAfter),
51050
+ lineSpacing: this.createLineSpacingXmlFromMultiplier(effectiveStyle?.lineSpacing),
51051
+ lineSpacingExactPt: effectiveStyle?.lineSpacingExactPt
51052
+ };
50246
51053
  const paragraphProps = buildParagraphPropertiesXml(
50247
- textStyle,
51054
+ effectiveStyle,
50248
51055
  paragraphAlign,
50249
51056
  bulletInfo,
50250
51057
  spacing,
@@ -50256,12 +51063,22 @@ var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50256
51063
  "a:rPr": this.createRunPropertiesFromTextStyle(style, resolveHyperlinkRelationshipId),
50257
51064
  "a:t": runText
50258
51065
  });
50259
- const createFieldRun = (runText, style, fieldType, fieldGuid) => ({
50260
- "@_type": fieldType,
50261
- ...fieldGuid ? { "@_id": fieldGuid } : {},
50262
- "a:rPr": this.createRunPropertiesFromTextStyle(style, resolveHyperlinkRelationshipId),
50263
- "a:t": runText
50264
- });
51066
+ const createFieldRun = (runText, style, fieldType, fieldGuid, fieldGuidAttr, fieldParagraphPropertiesXml) => {
51067
+ const fld = { "@_type": fieldType };
51068
+ if (fieldGuid) {
51069
+ if (fieldGuidAttr === "uuid") {
51070
+ fld["@_uuid"] = fieldGuid;
51071
+ } else {
51072
+ fld["@_id"] = fieldGuid;
51073
+ }
51074
+ }
51075
+ fld["a:rPr"] = this.createRunPropertiesFromTextStyle(style, resolveHyperlinkRelationshipId);
51076
+ if (fieldParagraphPropertiesXml && typeof fieldParagraphPropertiesXml === "object") {
51077
+ fld["a:pPr"] = fieldParagraphPropertiesXml;
51078
+ }
51079
+ fld["a:t"] = runText;
51080
+ return fld;
51081
+ };
50265
51082
  const createRubyRun = (segment, style) => {
50266
51083
  const rubyPr = {};
50267
51084
  if (segment.rubyAlignment) {
@@ -50300,17 +51117,27 @@ var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50300
51117
  let currentBulletInfo;
50301
51118
  let currentLevel;
50302
51119
  let currentEndParaRunProperties;
51120
+ let currentParagraphProperties;
51121
+ let capturedParagraphMeta = false;
50303
51122
  const pushParagraph = () => {
50304
51123
  if (currentRuns.length === 0) {
50305
51124
  currentRuns.push(createRun("", textStyle));
50306
51125
  }
50307
51126
  paragraphs.push(
50308
- createParagraph(currentRuns, currentBulletInfo, currentLevel, currentEndParaRunProperties)
51127
+ createParagraph(
51128
+ currentRuns,
51129
+ currentBulletInfo,
51130
+ currentLevel,
51131
+ currentEndParaRunProperties,
51132
+ currentParagraphProperties
51133
+ )
50309
51134
  );
50310
51135
  currentRuns = [];
50311
51136
  currentBulletInfo = void 0;
50312
51137
  currentLevel = void 0;
50313
51138
  currentEndParaRunProperties = void 0;
51139
+ currentParagraphProperties = void 0;
51140
+ capturedParagraphMeta = false;
50314
51141
  };
50315
51142
  if (textSegments && textSegments.length > 0) {
50316
51143
  const uniformSegmentOverrides = computeUniformSegmentOverrides(textStyle, textSegments);
@@ -50320,7 +51147,7 @@ var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50320
51147
  ...segment.style,
50321
51148
  ...uniformSegmentOverrides
50322
51149
  };
50323
- if (currentRuns.length === 0) {
51150
+ if (!capturedParagraphMeta) {
50324
51151
  if (segment.bulletInfo) {
50325
51152
  currentBulletInfo = segment.bulletInfo;
50326
51153
  }
@@ -50330,6 +51157,10 @@ var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50330
51157
  if (segment.endParaRunProperties) {
50331
51158
  currentEndParaRunProperties = segment.endParaRunProperties;
50332
51159
  }
51160
+ if (segment.paragraphProperties) {
51161
+ currentParagraphProperties = segment.paragraphProperties;
51162
+ }
51163
+ capturedParagraphMeta = true;
50333
51164
  }
50334
51165
  if (segment.isLineBreak) {
50335
51166
  const brNode = {};
@@ -50364,7 +51195,9 @@ var PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
50364
51195
  linePart,
50365
51196
  segmentStyle,
50366
51197
  segment.fieldType,
50367
- segment.fieldGuid
51198
+ segment.fieldGuid,
51199
+ segment.fieldGuidAttr,
51200
+ segment.fieldParagraphPropertiesXml
50368
51201
  );
50369
51202
  fieldRun.__isField = true;
50370
51203
  currentRuns.push(fieldRun);
@@ -51129,7 +51962,95 @@ var PptxHandlerRuntime16 = class extends PptxHandlerRuntime15 {
51129
51962
  };
51130
51963
 
51131
51964
  // src/core/core/runtime/PptxHandlerRuntimeTextStyleUtils.ts
51965
+ var SCRIPT_CANDIDATES = {
51966
+ cjk: ["Hans", "Hant", "Jpan", "Hang"],
51967
+ kana: ["Jpan", "Hans", "Hant"],
51968
+ hangul: ["Hang"],
51969
+ arabic: ["Arab"],
51970
+ hebrew: ["Hebr"],
51971
+ thai: ["Thai"]
51972
+ };
51973
+ function aggregateFontScriptOverrides(perPathMap) {
51974
+ const aggregate = {};
51975
+ for (const overrides10 of perPathMap.values()) {
51976
+ for (const [script, typeface] of Object.entries(overrides10)) {
51977
+ if (!(script in aggregate)) {
51978
+ aggregate[script] = typeface;
51979
+ }
51980
+ }
51981
+ }
51982
+ return aggregate;
51983
+ }
51984
+ function detectDominantScript(text2) {
51985
+ const counts = {};
51986
+ for (const ch of text2) {
51987
+ const code = ch.codePointAt(0) ?? 0;
51988
+ let cat;
51989
+ if (code >= 4352 && code <= 4607) {
51990
+ cat = "hangul";
51991
+ } else if (code >= 44032 && code <= 55215) {
51992
+ cat = "hangul";
51993
+ } else if (code >= 12352 && code <= 12543) {
51994
+ cat = "kana";
51995
+ } else if (code >= 19968 && code <= 40959 || code >= 13312 && code <= 19903 || code >= 63744 && code <= 64255) {
51996
+ cat = "cjk";
51997
+ } else if (code >= 1536 && code <= 1791) {
51998
+ cat = "arabic";
51999
+ } else if (code >= 1424 && code <= 1535) {
52000
+ cat = "hebrew";
52001
+ } else if (code >= 3584 && code <= 3711) {
52002
+ cat = "thai";
52003
+ }
52004
+ if (cat) {
52005
+ counts[cat] = (counts[cat] ?? 0) + 1;
52006
+ }
52007
+ }
52008
+ let best;
52009
+ let bestCount = 0;
52010
+ for (const [cat, count] of Object.entries(counts)) {
52011
+ if (count > bestCount) {
52012
+ best = cat;
52013
+ bestCount = count;
52014
+ }
52015
+ }
52016
+ return best;
52017
+ }
51132
52018
  var PptxHandlerRuntime17 = class extends PptxHandlerRuntime16 {
52019
+ /**
52020
+ * Resolve the automatic per-script fallback face for a run's text from the
52021
+ * theme's `<a:font script="...">` overrides (#83). Body (minor) fonts win
52022
+ * over heading (major) fonts. Returns `undefined` when the deck declares no
52023
+ * script overrides or the text needs no fallback.
52024
+ */
52025
+ resolveScriptFallbackFont(text2) {
52026
+ if (!text2) {
52027
+ return void 0;
52028
+ }
52029
+ if (this.masterThemeMinorFontScripts.size === 0 && this.masterThemeMajorFontScripts.size === 0) {
52030
+ return void 0;
52031
+ }
52032
+ const category = detectDominantScript(text2);
52033
+ if (!category) {
52034
+ return void 0;
52035
+ }
52036
+ const candidates = SCRIPT_CANDIDATES[category];
52037
+ if (!candidates) {
52038
+ return void 0;
52039
+ }
52040
+ const minor = aggregateFontScriptOverrides(this.masterThemeMinorFontScripts);
52041
+ for (const key of candidates) {
52042
+ if (minor[key]) {
52043
+ return minor[key];
52044
+ }
52045
+ }
52046
+ const major = aggregateFontScriptOverrides(this.masterThemeMajorFontScripts);
52047
+ for (const key of candidates) {
52048
+ if (major[key]) {
52049
+ return major[key];
52050
+ }
52051
+ }
52052
+ return void 0;
52053
+ }
51133
52054
  textStylesEqual(left, right) {
51134
52055
  const keys = [
51135
52056
  "fontFamily",
@@ -51290,6 +52211,10 @@ var PptxHandlerRuntime18 = class extends PptxHandlerRuntime17 {
51290
52211
  const esVal = String(endSnd).trim().toLowerCase();
51291
52212
  style.hyperlinkEndSound = esVal === "1" || esVal === "true";
51292
52213
  }
52214
+ const clickSnd = hyperlinkNode["a:snd"];
52215
+ if (clickSnd && typeof clickSnd === "object") {
52216
+ style.hyperlinkSoundXml = clickSnd;
52217
+ }
51293
52218
  }
51294
52219
  const actionStr = String(hyperlinkNode?.["@_action"] || "").trim();
51295
52220
  if (actionStr) {
@@ -51319,6 +52244,10 @@ var PptxHandlerRuntime18 = class extends PptxHandlerRuntime17 {
51319
52244
  } else {
51320
52245
  style.hyperlinkMouseOver = mouseOverRelId;
51321
52246
  }
52247
+ const mouseOverSnd = hlinkMouseOver["a:snd"];
52248
+ if (mouseOverSnd && typeof mouseOverSnd === "object") {
52249
+ style.hyperlinkMouseOverSoundXml = mouseOverSnd;
52250
+ }
51322
52251
  }
51323
52252
  }
51324
52253
  }
@@ -51545,6 +52474,8 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51545
52474
  if (rawU.length > 0 && rawU !== "none") {
51546
52475
  style.underlineStyle = rawU;
51547
52476
  }
52477
+ } else if (underlineToken === "none") {
52478
+ style.underlineExplicitNone = true;
51548
52479
  }
51549
52480
  }
51550
52481
  const uFill = runProperties2["a:uFill"];
@@ -51556,6 +52487,46 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51556
52487
  style.underlineColor = underlineColor;
51557
52488
  }
51558
52489
  }
52490
+ if (uLn) {
52491
+ const line2 = {};
52492
+ const widthEmu = Number.parseInt(String(uLn["@_w"] ?? ""), 10);
52493
+ if (Number.isFinite(widthEmu)) {
52494
+ line2.widthEmu = widthEmu;
52495
+ }
52496
+ const compound = String(uLn["@_cmpd"] ?? "").trim();
52497
+ if (compound) {
52498
+ line2.compound = compound;
52499
+ }
52500
+ const cap = String(uLn["@_cap"] ?? "").trim();
52501
+ if (cap) {
52502
+ line2.cap = cap;
52503
+ }
52504
+ const algn = String(uLn["@_algn"] ?? "").trim();
52505
+ if (algn) {
52506
+ line2.algn = algn;
52507
+ }
52508
+ const prstDash = String(uLn["a:prstDash"]?.["@_val"] ?? "").trim();
52509
+ if (prstDash) {
52510
+ line2.prstDash = prstDash;
52511
+ }
52512
+ const headEnd = uLn["a:headEnd"];
52513
+ if (headEnd && typeof headEnd === "object") {
52514
+ line2.headEndXml = headEnd;
52515
+ }
52516
+ const tailEnd = uLn["a:tailEnd"];
52517
+ if (tailEnd && typeof tailEnd === "object") {
52518
+ line2.tailEndXml = tailEnd;
52519
+ }
52520
+ if (Object.keys(line2).length > 0) {
52521
+ style.underlineLine = line2;
52522
+ }
52523
+ }
52524
+ if (runProperties2["a:uLnTx"] !== void 0) {
52525
+ style.underlineLineFollowsText = true;
52526
+ }
52527
+ if (runProperties2["a:uFillTx"] !== void 0) {
52528
+ style.underlineFillFollowsText = true;
52529
+ }
51559
52530
  if (runProperties2["@_strike"] !== void 0) {
51560
52531
  const strikeToken = String(runProperties2["@_strike"] || "").trim().toLowerCase();
51561
52532
  style.strikethrough = strikeToken.length > 0 && strikeToken !== "nostrike" && strikeToken !== "none" && strikeToken !== "0" && strikeToken !== "false";
@@ -51599,10 +52570,15 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51599
52570
  }
51600
52571
  }
51601
52572
  if (runProperties2["a:highlight"]) {
51602
- const highlightHex = this.parseColor(xmlChild(runProperties2, "a:highlight"));
52573
+ const highlightNode = xmlChild(runProperties2, "a:highlight");
52574
+ const highlightHex = this.parseColor(highlightNode);
51603
52575
  if (highlightHex) {
51604
52576
  style.highlightColor = highlightHex;
51605
52577
  }
52578
+ const highlightXml = extractColorChoiceXml(highlightNode);
52579
+ if (highlightXml) {
52580
+ style.highlightColorXml = highlightXml;
52581
+ }
51606
52582
  }
51607
52583
  const textFillVariants = this.extractTextFillVariants(runProperties2);
51608
52584
  if (textFillVariants.textFillGradient) {
@@ -51623,16 +52599,28 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51623
52599
  const latin = xmlChild(runProperties2, "a:latin");
51624
52600
  const eastAsian = xmlChild(runProperties2, "a:ea");
51625
52601
  const complexScript = xmlChild(runProperties2, "a:cs");
51626
- const chosenTypeface = xmlAttr(latin, "typeface") || xmlAttr(eastAsian, "typeface") || xmlAttr(complexScript, "typeface");
52602
+ const latinTypefaceToken = xmlAttr(latin, "typeface");
52603
+ const eaTypefaceToken = xmlAttr(eastAsian, "typeface");
52604
+ const csTypefaceToken = xmlAttr(complexScript, "typeface");
52605
+ const chosenTypeface = latinTypefaceToken || eaTypefaceToken || csTypefaceToken;
51627
52606
  const resolvedTypeface = this.resolveThemeTypeface(chosenTypeface);
51628
52607
  if (resolvedTypeface) {
51629
52608
  style.fontFamily = resolvedTypeface;
51630
52609
  }
51631
- const eaTypeface = this.resolveThemeTypeface(xmlAttr(eastAsian, "typeface"));
52610
+ if (latinTypefaceToken && latinTypefaceToken.startsWith("+")) {
52611
+ style.latinFontThemeToken = latinTypefaceToken;
52612
+ }
52613
+ if (eaTypefaceToken && eaTypefaceToken.startsWith("+")) {
52614
+ style.eastAsiaFontThemeToken = eaTypefaceToken;
52615
+ }
52616
+ if (csTypefaceToken && csTypefaceToken.startsWith("+")) {
52617
+ style.complexScriptFontThemeToken = csTypefaceToken;
52618
+ }
52619
+ const eaTypeface = this.resolveThemeTypeface(eaTypefaceToken);
51632
52620
  if (eaTypeface) {
51633
52621
  style.eastAsiaFont = eaTypeface;
51634
52622
  }
51635
- const csTypeface = this.resolveThemeTypeface(xmlAttr(complexScript, "typeface"));
52623
+ const csTypeface = this.resolveThemeTypeface(csTypefaceToken);
51636
52624
  if (csTypeface) {
51637
52625
  style.complexScriptFont = csTypeface;
51638
52626
  }
@@ -51648,6 +52636,9 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51648
52636
  const capAttr = String(runProperties2["@_cap"] || "").trim().toLowerCase();
51649
52637
  if (capAttr === "all" || capAttr === "small") {
51650
52638
  style.textCaps = capAttr;
52639
+ } else if (capAttr === "none") {
52640
+ style.textCaps = "none";
52641
+ style.textCapsExplicitNone = true;
51651
52642
  }
51652
52643
  const symNode = xmlChild(runProperties2, "a:sym");
51653
52644
  if (symNode) {
@@ -51707,6 +52698,12 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
51707
52698
  this.applyTextRunEffects(style, runEffectList);
51708
52699
  }
51709
52700
  this.applyTextRunEffectDag(style, runProperties2);
52701
+ if (includeDefaultAlignment) {
52702
+ const runExtLst = runProperties2["a:extLst"];
52703
+ if (runExtLst && typeof runExtLst === "object") {
52704
+ style.runPropertiesExtLstXml = runExtLst;
52705
+ }
52706
+ }
51710
52707
  return style;
51711
52708
  }
51712
52709
  /**
@@ -52378,12 +53375,63 @@ function writeCellTextFormatting(xmlCell, style, ensureArray16) {
52378
53375
  }
52379
53376
 
52380
53377
  // src/core/core/runtime/PptxHandlerRuntimeSaveTableStyles.ts
53378
+ function flattenCellTxBodyText(txBody, ensureArray16) {
53379
+ if (!txBody) {
53380
+ return "";
53381
+ }
53382
+ const paragraphs = ensureArray16(txBody["a:p"]);
53383
+ const lines = [];
53384
+ for (const paragraph of paragraphs) {
53385
+ const runs = ensureArray16(paragraph?.["a:r"]);
53386
+ const fields = ensureArray16(paragraph?.["a:fld"]);
53387
+ let lineText = "";
53388
+ for (const run of runs) {
53389
+ lineText += String(run?.["a:t"] ?? "");
53390
+ }
53391
+ for (const field of fields) {
53392
+ lineText += String(field?.["a:t"] ?? "");
53393
+ }
53394
+ lines.push(lineText);
53395
+ }
53396
+ return lines.join("\n");
53397
+ }
53398
+ function isRichCellTxBody(txBody, ensureArray16) {
53399
+ if (!txBody) {
53400
+ return false;
53401
+ }
53402
+ const paragraphs = ensureArray16(txBody["a:p"]);
53403
+ let totalRuns = 0;
53404
+ for (const paragraph of paragraphs) {
53405
+ const runs = ensureArray16(paragraph?.["a:r"]);
53406
+ totalRuns += runs.length;
53407
+ if (totalRuns > 1) {
53408
+ return true;
53409
+ }
53410
+ if (ensureArray16(paragraph?.["a:fld"]).length > 0) {
53411
+ return true;
53412
+ }
53413
+ for (const run of runs) {
53414
+ const rPr = run?.["a:rPr"];
53415
+ if (rPr?.["a:hlinkClick"] !== void 0) {
53416
+ return true;
53417
+ }
53418
+ }
53419
+ }
53420
+ return false;
53421
+ }
52381
53422
  var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime21 {
52382
53423
  /**
52383
53424
  * Write plain text into a table cell's txBody, preserving
52384
53425
  * existing run properties where possible.
52385
53426
  */
52386
53427
  writeTableCellText(xmlCell, text2) {
53428
+ const ensureArray16 = this.ensureArray.bind(this);
53429
+ const existingTxBody = xmlCell["a:txBody"];
53430
+ if (existingTxBody && ensureArray16(existingTxBody["a:p"]).length > 0) {
53431
+ if (flattenCellTxBodyText(existingTxBody, ensureArray16) === text2) {
53432
+ return;
53433
+ }
53434
+ }
52387
53435
  if (!xmlCell["a:txBody"]) {
52388
53436
  xmlCell["a:txBody"] = { "a:bodyPr": {}, "a:p": {} };
52389
53437
  }
@@ -52511,7 +53559,9 @@ var PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
52511
53559
  }
52512
53560
  delete tcPr["a:tcMar"];
52513
53561
  writeDiagonalBorders(tcPr, style, _PptxHandlerRuntime.EMU_PER_PX);
52514
- writeCellTextFormatting(xmlCell, style, this.ensureArray.bind(this));
53562
+ if (!isRichCellTxBody(xmlCell["a:txBody"], this.ensureArray.bind(this))) {
53563
+ writeCellTextFormatting(xmlCell, style, this.ensureArray.bind(this));
53564
+ }
52515
53565
  const reordered = reorderObjectKeys(tcPr, TC_PR_BORDERS_ORDER);
52516
53566
  for (const key of Object.keys(tcPr)) {
52517
53567
  delete tcPr[key];
@@ -54196,7 +55246,7 @@ function findKey19(obj, name, getLocalName2) {
54196
55246
  function hex9(value) {
54197
55247
  return value.replace("#", "");
54198
55248
  }
54199
- var COLOR_LOCAL_NAMES = /* @__PURE__ */ new Set([
55249
+ var COLOR_LOCAL_NAMES2 = /* @__PURE__ */ new Set([
54200
55250
  "srgbClr",
54201
55251
  "schemeClr",
54202
55252
  "sysClr",
@@ -54205,7 +55255,7 @@ var COLOR_LOCAL_NAMES = /* @__PURE__ */ new Set([
54205
55255
  "hslClr"
54206
55256
  ]);
54207
55257
  function applyColorToList(list, value, getLocalName2) {
54208
- const colorKey = Object.keys(list).find((k) => COLOR_LOCAL_NAMES.has(getLocalName2(k)));
55258
+ const colorKey = Object.keys(list).find((k) => COLOR_LOCAL_NAMES2.has(getLocalName2(k)));
54209
55259
  const srgb = { "@_val": hex9(value) };
54210
55260
  if (!colorKey) {
54211
55261
  list["a:srgbClr"] = srgb;
@@ -56697,6 +57747,33 @@ var PptxHandlerRuntime27 = class extends PptxHandlerRuntime26 {
56697
57747
  }
56698
57748
  };
56699
57749
 
57750
+ // src/core/core/runtime/save-line-fill.ts
57751
+ function writeLineFill(lineNode, shapeStyle, parseColor) {
57752
+ delete lineNode["a:noFill"];
57753
+ delete lineNode["a:solidFill"];
57754
+ delete lineNode["a:gradFill"];
57755
+ delete lineNode["a:pattFill"];
57756
+ if (shapeStyle.strokeColor === "transparent" || shapeStyle.strokeWidth === 0) {
57757
+ lineNode["a:noFill"] = {};
57758
+ return;
57759
+ }
57760
+ if (shapeStyle.strokeFillMode === "gradient" && shapeStyle.strokeGradientXml) {
57761
+ lineNode["a:gradFill"] = shapeStyle.strokeGradientXml;
57762
+ return;
57763
+ }
57764
+ if (shapeStyle.strokeFillMode === "pattern" && shapeStyle.strokePatternXml) {
57765
+ lineNode["a:pattFill"] = shapeStyle.strokePatternXml;
57766
+ return;
57767
+ }
57768
+ const resolvedStrokeOriginal = shapeStyle.strokeColorXml ? parseColor(shapeStyle.strokeColorXml) : void 0;
57769
+ lineNode["a:solidFill"] = serializeColorChoice(
57770
+ shapeStyle.strokeColorXml,
57771
+ resolvedStrokeOriginal,
57772
+ shapeStyle.strokeColor ?? "#000000",
57773
+ shapeStyle.strokeOpacity
57774
+ );
57775
+ }
57776
+
56700
57777
  // src/core/core/runtime/PptxHandlerRuntimeSaveShapeStyleWriter.ts
56701
57778
  var PptxHandlerRuntime28 = class _PptxHandlerRuntime extends PptxHandlerRuntime27 {
56702
57779
  /**
@@ -56767,26 +57844,14 @@ var PptxHandlerRuntime28 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
56767
57844
  );
56768
57845
  }
56769
57846
  }
56770
- if (shapeStyle.strokeColor !== void 0) {
57847
+ if (shapeStyle.strokeColor !== void 0 || shapeStyle.strokeFillMode === "gradient" || shapeStyle.strokeFillMode === "pattern") {
56771
57848
  if (!spPr["a:ln"]) {
56772
57849
  spPr["a:ln"] = {};
56773
57850
  }
56774
57851
  const lineNode = spPr["a:ln"];
56775
57852
  const w = Math.round((shapeStyle.strokeWidth || 1) * _PptxHandlerRuntime.EMU_PER_PX);
56776
57853
  lineNode["@_w"] = String(w);
56777
- if (shapeStyle.strokeColor === "transparent" || shapeStyle.strokeWidth === 0) {
56778
- lineNode["a:noFill"] = {};
56779
- delete lineNode["a:solidFill"];
56780
- } else {
56781
- delete lineNode["a:noFill"];
56782
- const resolvedStrokeOriginal = shapeStyle.strokeColorXml ? this.parseColor(shapeStyle.strokeColorXml) : void 0;
56783
- lineNode["a:solidFill"] = serializeColorChoice(
56784
- shapeStyle.strokeColorXml,
56785
- resolvedStrokeOriginal,
56786
- shapeStyle.strokeColor,
56787
- shapeStyle.strokeOpacity
56788
- );
56789
- }
57854
+ this.applyLineFill(lineNode, shapeStyle);
56790
57855
  }
56791
57856
  if (shapeStyle.strokeDash !== void 0) {
56792
57857
  if (!spPr["a:ln"]) {
@@ -56876,6 +57941,15 @@ var PptxHandlerRuntime28 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
56876
57941
  spPr["a:ln"]["a:effectLst"] = lineEffectListXml;
56877
57942
  }
56878
57943
  }
57944
+ /**
57945
+ * Emit the single fill child of an `<a:ln>` (CT_LineProperties allows at
57946
+ * most one of noFill/solidFill/gradFill/pattFill). Delegates to
57947
+ * {@link writeLineFill} so the logic stays unit-testable without the full
57948
+ * save runtime (issue #87).
57949
+ */
57950
+ applyLineFill(lineNode, shapeStyle) {
57951
+ writeLineFill(lineNode, shapeStyle, (colorNode) => this.parseColor(colorNode));
57952
+ }
56879
57953
  /**
56880
57954
  * Serialize the shape's `<p:style>` block (CT_ShapeStyle §20.1.2.2.36)
56881
57955
  * from the persisted ref indices/colour XML. Emits children in spec
@@ -59215,14 +60289,20 @@ var PptxHandlerRuntime41 = class _PptxHandlerRuntime extends PptxHandlerRuntime4
59215
60289
  relationshipType: constants.slideSyncRelationshipType,
59216
60290
  contentType: constants.slideSyncContentType
59217
60291
  });
59218
- this.slideBackgroundBuilder.applyBackground({
60292
+ await this.slideBackgroundBuilder.applyBackground({
59219
60293
  slideNode,
59220
60294
  slide,
59221
60295
  zip: this.zip,
59222
60296
  saveState: saveSession,
59223
60297
  relationshipRegistry: slideRelationshipRegistry,
59224
60298
  slideImageRelationshipType: constants.slideImageRelationshipType,
59225
- parseDataUrlToBytes: (dataUrl) => this.parseDataUrlToBytes(dataUrl)
60299
+ resolveImageToBytes: (url) => this.resolveMediaToBytes(url),
60300
+ reportUnsupportedBackground: (imageUrl) => this.compatibilityService.reportWarning({
60301
+ code: "SAVE_BACKGROUND_IMAGE_UNSUPPORTED",
60302
+ message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
60303
+ scope: "save",
60304
+ slideId: slide.id
60305
+ })
59226
60306
  });
59227
60307
  this.slideCommentPartWriter.writeComments({
59228
60308
  slide,
@@ -60727,7 +61807,7 @@ var PptxHandlerRuntime51 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
60727
61807
  } = saveConstants;
60728
61808
  this.compatibilityService.resetWarnings();
60729
61809
  const saveSession = new PptxSaveStateBuilder().withZip(this.zip).withCommentAuthorMap(this.commentAuthorMap).withCommentAuthorDetails(this.commentAuthorDetails).withCommentAuthorsRootXml(this.commentAuthorsRootXml).withEmuPerPx(_PptxHandlerRuntime.EMU_PER_PX).build();
60730
- await this.reconcilePresentationSlidesForSave({
61810
+ const slideReferenceRemap = await this.reconcilePresentationSlidesForSave({
60731
61811
  slides,
60732
61812
  saveSession,
60733
61813
  slideRelationshipType,
@@ -60822,7 +61902,8 @@ var PptxHandlerRuntime51 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
60822
61902
  rawSlideWidthEmu: this.rawSlideWidthEmu,
60823
61903
  rawSlideHeightEmu: this.rawSlideHeightEmu,
60824
61904
  rawSlideSizeType: this.rawSlideSizeType,
60825
- xmlLookupService: this.xmlLookupService
61905
+ xmlLookupService: this.xmlLookupService,
61906
+ slideReferenceRemap
60826
61907
  });
60827
61908
  this.deduplicateExtensionLists(this.presentationData);
60828
61909
  if (effectiveConformance === "transitional") {
@@ -60839,7 +61920,7 @@ var PptxHandlerRuntime51 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
60839
61920
  printSlidesPerPage: options.handoutMaster.slidesPerPage
60840
61921
  } : options?.presentationProperties;
60841
61922
  await this.applyPresentationPropertiesPart(presentationProperties);
60842
- await this.applyViewPropertiesPart(options?.viewProperties);
61923
+ await this.applyViewPropertiesPart(options?.viewProperties ?? this.loadedViewProperties);
60843
61924
  await this.applyTableStylesPart(options?.tableStyles);
60844
61925
  await this.documentPropertiesUpdater.updateOnSave(slides, {
60845
61926
  coreProperties: options?.coreProperties,
@@ -61127,26 +62208,16 @@ var PptxHandlerRuntime52 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
61127
62208
  return true;
61128
62209
  }
61129
62210
  const typesMatch = source.type === target.type || source.type === "ctrtitle" && target.type === "title" || source.type === "subtitle" && target.type === "body";
61130
- if (source.idx !== void 0 && target.idx !== void 0) {
61131
- if (source.idx !== target.idx) {
61132
- return false;
61133
- }
61134
- if (source.type && target.type && !typesMatch) {
61135
- return false;
61136
- }
61137
- return true;
61138
- }
61139
- if (source.idx !== void 0 && target.idx === void 0) {
61140
- const singletonTypes = /* @__PURE__ */ new Set(["title", "ctrtitle", "subtitle", "dt", "ftr", "sldnum"]);
61141
- if (source.type && singletonTypes.has(source.type)) {
61142
- return typesMatch;
61143
- }
62211
+ const sourceIdx = source.idx ?? "0";
62212
+ const targetIdx = target.idx ?? "0";
62213
+ if (sourceIdx !== targetIdx) {
61144
62214
  return false;
61145
62215
  }
61146
62216
  if (source.type && target.type && !typesMatch) {
61147
62217
  return false;
61148
62218
  }
61149
- if (source.type && !target.type) {
62219
+ const bothHaveExplicitIdx = source.idx !== void 0 && target.idx !== void 0;
62220
+ if (!bothHaveExplicitIdx && source.type && !target.type) {
61150
62221
  return false;
61151
62222
  }
61152
62223
  return true;
@@ -62592,6 +63663,19 @@ var PptxHandlerRuntime61 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
62592
63663
  });
62593
63664
  return hasAny ? locks : void 0;
62594
63665
  }
63666
+ /**
63667
+ * Parse the `@txBox` attribute from a `p:cNvSpPr` node. Returns `true` /
63668
+ * `false` when the attribute is present, or `undefined` when absent so
63669
+ * callers can distinguish "not a text box" from "unspecified".
63670
+ */
63671
+ parseTxBoxFlag(cNvSpPr) {
63672
+ const raw = cNvSpPr?.["@_txBox"];
63673
+ if (raw === void 0) {
63674
+ return void 0;
63675
+ }
63676
+ const val = String(raw).trim().toLowerCase();
63677
+ return val === "1" || val === "true";
63678
+ }
62595
63679
  /**
62596
63680
  * Extract body-level text properties from `a:bodyPr` and apply them to the
62597
63681
  * provided {@link TextStyle}. Returns linked-textbox info when present.
@@ -62774,6 +63858,62 @@ var PptxHandlerRuntime61 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
62774
63858
 
62775
63859
  // src/core/core/runtime/PptxHandlerRuntimeShapeTextParsing.ts
62776
63860
  var PptxHandlerRuntime62 = class _PptxHandlerRuntime extends PptxHandlerRuntime61 {
63861
+ /**
63862
+ * Extract a paragraph's OWN `a:pPr` geometry (align, spacing, margins,
63863
+ * indent, tabs, rtl) as a partial {@link TextStyle} so per-paragraph
63864
+ * formatting round-trips rather than collapsing to one shape-level pPr
63865
+ * (#69). Inherited layout/master values are not re-stamped.
63866
+ */
63867
+ extractParagraphOwnProperties(p, basisFontSize) {
63868
+ const pPr = p["a:pPr"];
63869
+ if (!pPr) {
63870
+ return void 0;
63871
+ }
63872
+ const pp = { ...parseParagraphMargins(pPr) };
63873
+ const align = pPr["@_algn"] !== void 0 ? parseAlignmentAttr2(String(pPr["@_algn"])) : void 0;
63874
+ if (align) {
63875
+ pp.align = align;
63876
+ }
63877
+ const rtl = parseParagraphRtl(pPr);
63878
+ if (rtl !== void 0) {
63879
+ pp.rtl = rtl;
63880
+ }
63881
+ const spcBef = this.parseParagraphSpacingPx(
63882
+ pPr["a:spcBef"],
63883
+ basisFontSize
63884
+ );
63885
+ if (spcBef !== void 0) {
63886
+ pp.paragraphSpacingBefore = spcBef;
63887
+ }
63888
+ const spcAft = this.parseParagraphSpacingPx(
63889
+ pPr["a:spcAft"],
63890
+ basisFontSize
63891
+ );
63892
+ if (spcAft !== void 0) {
63893
+ pp.paragraphSpacingAfter = spcAft;
63894
+ }
63895
+ const lnSpcNode = pPr["a:lnSpc"];
63896
+ const lineSpacing = this.parseLineSpacingMultiplier(lnSpcNode);
63897
+ const exactPt = lineSpacing === void 0 ? this.parseLineSpacingExactPt(lnSpcNode) : void 0;
63898
+ if (lineSpacing !== void 0) {
63899
+ pp.lineSpacing = lineSpacing;
63900
+ } else if (exactPt !== void 0) {
63901
+ pp.lineSpacingExactPt = exactPt;
63902
+ }
63903
+ const tabStops = parseTabStops(pPr);
63904
+ if (tabStops && tabStops.length > 0) {
63905
+ pp.tabStops = tabStops;
63906
+ }
63907
+ const defRPr = pPr["a:defRPr"];
63908
+ if (defRPr && typeof defRPr === "object") {
63909
+ pp.paragraphDefaultRunPropertiesXml = defRPr;
63910
+ }
63911
+ const pPrExtLst = pPr["a:extLst"];
63912
+ if (pPrExtLst && typeof pPrExtLst === "object") {
63913
+ pp.paragraphPropertiesExtLstXml = pPrExtLst;
63914
+ }
63915
+ return Object.keys(pp).length > 0 ? pp : void 0;
63916
+ }
62777
63917
  /**
62778
63918
  * Resolve paragraph-level styles (alignment, spacing, margins, tabs,
62779
63919
  * level styles) for a single paragraph. Modifies `textStyle` in place
@@ -63022,6 +64162,12 @@ var PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
63022
64162
  ...mergedDefaultRunStyle,
63023
64163
  ...this.extractTextRunStyle(runProps, paraAlign, ctx.slideRelationshipMap)
63024
64164
  };
64165
+ if (!runStyle2.scriptFallbackFont) {
64166
+ const fallback = this.resolveScriptFallbackFont(runText);
64167
+ if (fallback) {
64168
+ runStyle2.scriptFallbackFont = fallback;
64169
+ }
64170
+ }
63025
64171
  parts.push(runText);
63026
64172
  segments.push({ text: runText, style: runStyle2 });
63027
64173
  maybeSeed(runStyle2);
@@ -63063,14 +64209,25 @@ var PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
63063
64209
  )
63064
64210
  };
63065
64211
  const fldType = String(field["@_type"] || "").trim() || void 0;
63066
- const fldGuid = String(field["@_uuid"] || field["@_id"] || "").trim() || void 0;
64212
+ const uuidAttr = String(field["@_uuid"] || "").trim();
64213
+ const idAttr = String(field["@_id"] || "").trim();
64214
+ const fldGuid = uuidAttr || idAttr || void 0;
64215
+ const fldGuidAttr = uuidAttr ? "uuid" : idAttr ? "id" : void 0;
63067
64216
  parts.push(fieldText);
63068
- segments.push({
64217
+ const fieldSegment = {
63069
64218
  text: fieldText,
63070
64219
  style: fieldRunStyle,
63071
64220
  fieldType: fldType,
63072
64221
  fieldGuid: fldGuid
63073
- });
64222
+ };
64223
+ if (fldGuidAttr) {
64224
+ fieldSegment.fieldGuidAttr = fldGuidAttr;
64225
+ }
64226
+ const fieldPPr = field["a:pPr"];
64227
+ if (fieldPPr && typeof fieldPPr === "object") {
64228
+ fieldSegment.fieldParagraphPropertiesXml = fieldPPr;
64229
+ }
64230
+ segments.push(fieldSegment);
63074
64231
  maybeSeed(fieldRunStyle);
63075
64232
  };
63076
64233
  const processMathElement = (mathEl) => {
@@ -63197,6 +64354,11 @@ var PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
63197
64354
  ...endParaRPrRaw
63198
64355
  };
63199
64356
  }
64357
+ const basisFontSize = typeof mergedDefaultRunStyle.fontSize === "number" ? mergedDefaultRunStyle.fontSize : void 0;
64358
+ const paragraphOwnProps = this.extractParagraphOwnProperties(p, basisFontSize);
64359
+ if (paragraphOwnProps) {
64360
+ segments[firstSegmentIndex].paragraphProperties = paragraphOwnProps;
64361
+ }
63200
64362
  }
63201
64363
  return { parts, segments, seedStyle };
63202
64364
  }
@@ -63505,7 +64667,11 @@ var PptxHandlerRuntime64 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
63505
64667
  const inheritedCNvSpPr = xmlPath(inheritedPlaceholder?.shape, "p:nvSpPr", "p:cNvSpPr") ?? xmlPath(inheritedPlaceholder?.picture, "p:nvPicPr", "p:cNvPicPr");
63506
64668
  const inheritedLockNode = inheritedCNvSpPr?.["a:spLocks"] ?? inheritedCNvSpPr?.["a:picLocks"];
63507
64669
  const inheritedLocks = this.parseShapeLocks(inheritedLockNode);
63508
- const locks = inheritedLocks ? { ...inheritedLocks, ...slideLocks } : slideLocks;
64670
+ let locks = inheritedLocks ? { ...inheritedLocks, ...slideLocks } : slideLocks;
64671
+ const txBox = this.parseTxBoxFlag(cNvSpPr);
64672
+ if (txBox !== void 0) {
64673
+ locks = { ...locks ?? {}, txBox };
64674
+ }
63509
64675
  const promptText = !hasText && phDefaults?.promptText ? phDefaults.promptText : void 0;
63510
64676
  const opaqueExtLstXml = this.extractOpaqueSpPrExtLst(effectiveSpPr);
63511
64677
  const commonProps = {
@@ -67058,16 +68224,20 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
67058
68224
  }
67059
68225
  let fontScheme;
67060
68226
  if (hasFonts) {
68227
+ const majorByScript = this.aggregateFontScriptOverrides(this.masterThemeMajorFontScripts);
68228
+ const minorByScript = this.aggregateFontScriptOverrides(this.masterThemeMinorFontScripts);
67061
68229
  fontScheme = {
67062
68230
  majorFont: {
67063
68231
  latin: this.themeFontMap["mj-lt"],
67064
68232
  eastAsia: this.themeFontMap["mj-ea"],
67065
- complexScript: this.themeFontMap["mj-cs"]
68233
+ complexScript: this.themeFontMap["mj-cs"],
68234
+ ...Object.keys(majorByScript).length > 0 ? { byScript: majorByScript } : {}
67066
68235
  },
67067
68236
  minorFont: {
67068
68237
  latin: this.themeFontMap["mn-lt"],
67069
68238
  eastAsia: this.themeFontMap["mn-ea"],
67070
- complexScript: this.themeFontMap["mn-cs"]
68239
+ complexScript: this.themeFontMap["mn-cs"],
68240
+ ...Object.keys(minorByScript).length > 0 ? { byScript: minorByScript } : {}
67071
68241
  }
67072
68242
  };
67073
68243
  }
@@ -67275,6 +68445,23 @@ var PptxHandlerRuntime80 = class extends PptxHandlerRuntime79 {
67275
68445
  *
67276
68446
  * Phase 4 Stream A / M4.
67277
68447
  */
68448
+ /**
68449
+ * Flatten a per-theme-path script-override map (`themePath -> {script ->
68450
+ * typeface}`) into a single `{script -> typeface}` lookup for
68451
+ * {@link buildThemeObject}. Earlier entries win on collision, which matches
68452
+ * the primary-theme-first parse order. Phase 4 Stream A / M4 (#83).
68453
+ */
68454
+ aggregateFontScriptOverrides(perPathMap) {
68455
+ const aggregate = {};
68456
+ for (const overrides10 of perPathMap.values()) {
68457
+ for (const [script, typeface] of Object.entries(overrides10)) {
68458
+ if (!(script in aggregate)) {
68459
+ aggregate[script] = typeface;
68460
+ }
68461
+ }
68462
+ }
68463
+ return aggregate;
68464
+ }
67278
68465
  collectFontScriptOverrides(fontNode) {
67279
68466
  const overrides10 = {};
67280
68467
  if (!fontNode) {
@@ -67910,33 +69097,16 @@ var PptxHandlerRuntime83 = class extends PptxHandlerRuntime82 {
67910
69097
  const metadata = parseSmartArtDefinitionMetadata(colorsDef, localName22);
67911
69098
  const labels = parseSmartArtColorStyleLabels(colorsDef, localName22);
67912
69099
  const name = metadata.titles?.[0]?.value || String(colorsDef["@_title"] || colorsDef["@_uniqueId"] || "").trim() || void 0;
67913
- const fillColors = [];
67914
- const lineColors = [];
67915
69100
  const styleLbls = this.xmlLookupService.getChildrenArrayByLocalName(colorsDef, "styleLbl");
67916
- for (const lbl of styleLbls) {
67917
- const fillClrLst = this.xmlLookupService.getChildByLocalName(lbl, "fillClrLst");
67918
- const linClrLst = this.xmlLookupService.getChildByLocalName(lbl, "linClrLst");
67919
- if (fillClrLst) {
67920
- const color2 = this.parseColor(fillClrLst) ?? this.resolveSmartArtSchemeColor(
67921
- this.xmlLookupService.getChildByLocalName(fillClrLst, "schemeClr")
67922
- );
67923
- if (color2) {
67924
- fillColors.push(color2);
67925
- }
67926
- }
67927
- if (linClrLst) {
67928
- const color2 = this.parseColor(linClrLst) ?? this.resolveSmartArtSchemeColor(
67929
- this.xmlLookupService.getChildByLocalName(linClrLst, "schemeClr")
67930
- );
67931
- if (color2) {
67932
- lineColors.push(color2);
67933
- }
67934
- }
67935
- }
67936
- if (fillColors.length === 0 && lineColors.length === 0) {
69101
+ const colorLists = buildSmartArtColorLists(styleLbls, {
69102
+ getChild: (node, childName) => this.xmlLookupService.getChildByLocalName(node, childName),
69103
+ parseColorChoice: (colorChoice) => this.parseColor(colorChoice),
69104
+ resolveScheme: (colorNode) => this.resolveSmartArtSchemeColor(colorNode)
69105
+ });
69106
+ if (colorLists.fillColors.length === 0 && colorLists.lineColors.length === 0) {
67937
69107
  return void 0;
67938
69108
  }
67939
- return { ...metadata, name, fillColors, lineColors, labels };
69109
+ return { ...metadata, name, ...colorLists, labels };
67940
69110
  } catch {
67941
69111
  return void 0;
67942
69112
  }
@@ -68288,6 +69458,109 @@ var PptxHandlerRuntime84 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
68288
69458
  }
68289
69459
  };
68290
69460
 
69461
+ // src/core/core/runtime/smartart-drawing-blip.ts
69462
+ function collectDrawingShapeNodes(root, getChildren) {
69463
+ const out = [];
69464
+ const walk = (container) => {
69465
+ if (!container) {
69466
+ return;
69467
+ }
69468
+ for (const sp of getChildren(container, "sp")) {
69469
+ out.push({ node: sp, isPic: false });
69470
+ }
69471
+ for (const pic of getChildren(container, "pic")) {
69472
+ out.push({ node: pic, isPic: true });
69473
+ }
69474
+ for (const grp of getChildren(container, "grpSp")) {
69475
+ walk(grp);
69476
+ }
69477
+ };
69478
+ walk(root);
69479
+ return out;
69480
+ }
69481
+ function picBlipEmbedId(pic, getChild) {
69482
+ const blip = getChild(getChild(pic, "blipFill"), "blip");
69483
+ if (!blip) {
69484
+ return void 0;
69485
+ }
69486
+ const embed = String(blip["@_r:embed"] || blip["@_embed"] || blip["@_r:link"] || "").trim();
69487
+ return embed.length > 0 ? embed : void 0;
69488
+ }
69489
+ function parseDrawingRelTargets(relsXml, parse, ensureArray16) {
69490
+ const map = /* @__PURE__ */ new Map();
69491
+ try {
69492
+ const relsRoot = parse(relsXml)["Relationships"];
69493
+ if (!relsRoot) {
69494
+ return map;
69495
+ }
69496
+ for (const rel of ensureArray16(relsRoot["Relationship"])) {
69497
+ const id = String(rel?.["@_Id"] || "").trim();
69498
+ const target = String(rel?.["@_Target"] || "").trim();
69499
+ if (id.length > 0 && target.length > 0) {
69500
+ map.set(id, target);
69501
+ }
69502
+ }
69503
+ } catch {
69504
+ }
69505
+ return map;
69506
+ }
69507
+ async function resolveDrawingBlipFills(shapes, drawingPath, deps) {
69508
+ const pending = shapes.filter((shape) => shape.fillBlipEmbedId && !shape.fillImageUrl);
69509
+ if (pending.length === 0) {
69510
+ return;
69511
+ }
69512
+ const dir = drawingPath.replace(/\/[^/]+$/u, "");
69513
+ const file = drawingPath.split("/").pop() ?? "";
69514
+ const relsXml = await deps.readText(`${dir}/_rels/${file}.rels`);
69515
+ if (!relsXml) {
69516
+ return;
69517
+ }
69518
+ const targets = parseDrawingRelTargets(relsXml, deps.parse, deps.ensureArray);
69519
+ for (const shape of pending) {
69520
+ const target = targets.get(shape.fillBlipEmbedId ?? "");
69521
+ if (!target) {
69522
+ continue;
69523
+ }
69524
+ const source = /^(?:https?:|data:)/u.test(target) ? target : deps.resolveImagePath(drawingPath, target);
69525
+ const resolved = await deps.getImageData(source);
69526
+ if (resolved) {
69527
+ shape.fillImageUrl = resolved;
69528
+ }
69529
+ }
69530
+ }
69531
+ async function parseDrawingShapesFromPart(drawingPath, deps) {
69532
+ const xmlString = await deps.readText(drawingPath);
69533
+ if (!xmlString) {
69534
+ return [];
69535
+ }
69536
+ try {
69537
+ const xml = deps.parse(xmlString);
69538
+ const drawing = deps.getChild(xml, "drawing");
69539
+ const spTree = deps.getChild(drawing || xml, "spTree");
69540
+ if (!spTree) {
69541
+ return [];
69542
+ }
69543
+ const shapes = [];
69544
+ collectDrawingShapeNodes(spTree, deps.getChildren).forEach(({ node, isPic }, index) => {
69545
+ const shape = deps.parseDrawingShape(node, index, deps.emuPerPx);
69546
+ if (!shape) {
69547
+ return;
69548
+ }
69549
+ if (isPic && !shape.fillBlipEmbedId) {
69550
+ const embed = picBlipEmbedId(node, deps.getChild);
69551
+ if (embed) {
69552
+ shape.fillBlipEmbedId = embed;
69553
+ }
69554
+ }
69555
+ shapes.push(shape);
69556
+ });
69557
+ await resolveDrawingBlipFills(shapes, drawingPath, deps);
69558
+ return shapes;
69559
+ } catch {
69560
+ return [];
69561
+ }
69562
+ }
69563
+
68291
69564
  // src/core/core/runtime/smartart-layout-category.ts
68292
69565
  var CATEGORY_FAMILY = {
68293
69566
  list: "list",
@@ -68423,6 +69696,7 @@ var PptxHandlerRuntime85 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
68423
69696
  layoutDefinition,
68424
69697
  nodes,
68425
69698
  connections: parsedConnections.length > 0 ? parsedConnections : void 0,
69699
+ presLayoutVars: parseSmartArtPresLayoutVars(dataModel),
68426
69700
  drawingShapes: drawingShapes.length > 0 ? drawingShapes : void 0,
68427
69701
  chrome,
68428
69702
  colorTransform,
@@ -68501,30 +69775,28 @@ var PptxHandlerRuntime85 = class _PptxHandlerRuntime extends PptxHandlerRuntime8
68501
69775
  }
68502
69776
  }
68503
69777
  /**
68504
- * Parse SmartArt drawing shapes given an absolute part path.
69778
+ * Parse cached SmartArt drawing shapes from an absolute part path.
68505
69779
  *
68506
- * Wraps `parseSmartArtDrawingShapes` (which expects a slide-relative
68507
- * relationship id) with a path-based lookup so the resolution layer
68508
- * can pull the part from anywhere in the package.
69780
+ * Enumerates `dsp:sp` / bare `dsp:pic` (incl. nested `dsp:grpSp`) and
69781
+ * resolves picture (blip) fills to data URLs via the drawing part's own
69782
+ * relationships. Delegates to a pure helper with an injected dep bundle.
68509
69783
  */
68510
69784
  async parseSmartArtDrawingShapesFromPath(drawingPath) {
68511
- const xmlString = await this.zip.file(drawingPath)?.async("string");
68512
- if (!xmlString) {
68513
- return [];
68514
- }
68515
- try {
68516
- const xml = this.parser.parse(xmlString);
68517
- const drawing = this.xmlLookupService.getChildByLocalName(xml, "drawing");
68518
- const spTree = this.xmlLookupService.getChildByLocalName(drawing || xml, "spTree");
68519
- if (!spTree) {
68520
- return [];
68521
- }
68522
- const shapes = this.xmlLookupService.getChildrenArrayByLocalName(spTree, "sp");
68523
- const emuPerPx = _PptxHandlerRuntime.EMU_PER_PX;
68524
- return shapes.map((sp, index) => this.parseDrawingShape(sp, index, emuPerPx)).filter((entry) => entry !== null);
68525
- } catch {
68526
- return [];
68527
- }
69785
+ return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps());
69786
+ }
69787
+ /** Bind runtime zip / parser / lookup / image helpers for the drawing parser. */
69788
+ drawingBlipDeps() {
69789
+ return {
69790
+ readText: (path) => this.zip.file(path)?.async("string") ?? Promise.resolve(void 0),
69791
+ parse: (xml) => this.parser.parse(xml),
69792
+ getChild: (node, local) => this.xmlLookupService.getChildByLocalName(node, local),
69793
+ getChildren: (node, local) => this.xmlLookupService.getChildrenArrayByLocalName(node, local),
69794
+ parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(sp, index, emuPerPx),
69795
+ emuPerPx: _PptxHandlerRuntime.EMU_PER_PX,
69796
+ ensureArray: (value) => this.ensureArray(value),
69797
+ resolveImagePath: (base, target) => this.resolveImagePath(base, target),
69798
+ getImageData: (path) => this.getImageData(path)
69799
+ };
68528
69800
  }
68529
69801
  };
68530
69802
 
@@ -69222,6 +70494,11 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
69222
70494
  grouping = "clustered";
69223
70495
  }
69224
70496
  }
70497
+ const varyColors = this.parseChartBoolVal(seriesContainer, "varyColors");
70498
+ const firstSliceAngle = this.parseChartNumberVal(seriesContainer, "firstSliceAng");
70499
+ const doughnutHoleSize = this.parseChartNumberVal(seriesContainer, "holeSize");
70500
+ const barGapWidth = this.parseChartNumberVal(seriesContainer, "gapWidth");
70501
+ const barOverlap = this.parseChartNumberVal(seriesContainer, "overlap");
69225
70502
  const chartPartPath = chartPart.partPath;
69226
70503
  const dataTable = parseDataTable(plotArea, this.xmlLookupService);
69227
70504
  const dropLines = parseLineStyle(
@@ -69298,6 +70575,11 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
69298
70575
  title: titleTextValues[0],
69299
70576
  style: chartStyle,
69300
70577
  grouping,
70578
+ ...varyColors !== void 0 ? { varyColors } : {},
70579
+ ...firstSliceAngle !== void 0 ? { firstSliceAngle } : {},
70580
+ ...doughnutHoleSize !== void 0 ? { doughnutHoleSize } : {},
70581
+ ...barGapWidth !== void 0 ? { barGapWidth } : {},
70582
+ ...barOverlap !== void 0 ? { barOverlap } : {},
69301
70583
  chartPartPath,
69302
70584
  chartRelationshipId,
69303
70585
  ...dataTable ? { dataTable } : {},
@@ -69374,6 +70656,35 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
69374
70656
  }
69375
70657
  return { categories, series };
69376
70658
  }
70659
+ /**
70660
+ * Read a numeric `@val` from a named child of a chart-type container.
70661
+ * Returns `undefined` when the child or its `@val` is absent/non-finite.
70662
+ */
70663
+ parseChartNumberVal(container, localName22) {
70664
+ const node = this.xmlLookupService.getChildByLocalName(container, localName22);
70665
+ const raw = node?.["@_val"];
70666
+ if (raw === void 0 || raw === null || raw === "") {
70667
+ return void 0;
70668
+ }
70669
+ const num = Number.parseFloat(String(raw));
70670
+ return Number.isFinite(num) ? num : void 0;
70671
+ }
70672
+ /**
70673
+ * Read a boolean `@val` from a named child of a chart-type container.
70674
+ * A present element with no `@val` follows the OOXML `CT_Boolean` default
70675
+ * of `true`; `undefined` when the child is absent.
70676
+ */
70677
+ parseChartBoolVal(container, localName22) {
70678
+ const node = this.xmlLookupService.getChildByLocalName(container, localName22);
70679
+ if (!node) {
70680
+ return void 0;
70681
+ }
70682
+ const raw = node["@_val"];
70683
+ if (raw === void 0 || raw === null || raw === "") {
70684
+ return true;
70685
+ }
70686
+ return !(raw === "0" || raw === "false");
70687
+ }
69377
70688
  /**
69378
70689
  * Build the series array from raw OOXML `c:ser` nodes.
69379
70690
  *
@@ -69417,6 +70728,10 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
69417
70728
  );
69418
70729
  const dataLabels = parseSeriesDataLabels(seriesNode, this.xmlLookupService);
69419
70730
  const explosion = parseSeriesExplosion(seriesNode, this.xmlLookupService);
70731
+ const smoothNode = this.xmlLookupService.getChildByLocalName(seriesNode, "smooth");
70732
+ const smooth = smoothNode ? !(smoothNode["@_val"] === "0" || smoothNode["@_val"] === "false") : void 0;
70733
+ const invertNode = this.xmlLookupService.getChildByLocalName(seriesNode, "invertIfNegative");
70734
+ const invertIfNegative = invertNode ? !(invertNode["@_val"] === "0" || invertNode["@_val"] === "false") : void 0;
69420
70735
  return {
69421
70736
  name: seriesName.trim().length > 0 ? seriesName : `Series ${seriesIndex + 1}`,
69422
70737
  values: fallbackValues,
@@ -69427,6 +70742,8 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
69427
70742
  ...seriesMarker ? { marker: seriesMarker } : {},
69428
70743
  ...dataLabels.length > 0 ? { dataLabels } : {},
69429
70744
  ...explosion !== void 0 ? { explosion } : {},
70745
+ ...invertIfNegative !== void 0 ? { invertIfNegative } : {},
70746
+ ...smooth !== void 0 ? { smooth } : {},
69430
70747
  ...axisId !== void 0 ? { axisId } : {},
69431
70748
  ...seriesChartType ? { seriesChartType } : {}
69432
70749
  };
@@ -70253,6 +71570,8 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
70253
71570
  async buildLoadData(presentationState, slidesWithWarnings, slideMasters) {
70254
71571
  const headerFooter = this.extractHeaderFooter();
70255
71572
  const presentationProperties = await this.parsePresentationProperties();
71573
+ const viewProperties = await this.parseViewProperties();
71574
+ this.loadedViewProperties = viewProperties;
70256
71575
  const customShows = this.parseCustomShows();
70257
71576
  const tableStyleMap = await this.parseTableStyles();
70258
71577
  const embeddedFontList = parseEmbeddedFontList(this.presentationData);
@@ -70282,7 +71601,7 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
70282
71601
  presentationState.height,
70283
71602
  this.rawSlideWidthEmu,
70284
71603
  this.rawSlideHeightEmu
70285
- ).withNotesDimensions(presentationState.notesWidthEmu, presentationState.notesHeightEmu).withSlides(slidesWithWarnings).withLayoutOptions(this.getLayoutOptions()).withHeaderFooter(headerFooter).withPresentationProperties(presentationProperties).withCustomShows(customShows).withSections(
71604
+ ).withNotesDimensions(presentationState.notesWidthEmu, presentationState.notesHeightEmu).withSlides(slidesWithWarnings).withLayoutOptions(this.getLayoutOptions()).withHeaderFooter(headerFooter).withPresentationProperties(presentationProperties).withViewProperties(viewProperties).withCustomShows(customShows).withSections(
70286
71605
  presentationState.orderedSections.length > 0 ? presentationState.orderedSections : void 0
70287
71606
  ).withWarnings(this.compatibilityService.getWarnings()).withThemeColorMap({ ...this.themeColorMap }).withTheme(this.buildThemeObject()).withThemeOptions(themeOptions.length > 0 ? themeOptions : void 0).withTableStyleMap(tableStyleMap).withEmbeddedFonts(embeddedFonts.length > 0 ? embeddedFonts : void 0).withEmbeddedFontList(embeddedFontList).withMruColors(presentationProperties?.mruColors).withNotesMaster(notesMaster).withHandoutMaster(handoutMaster).withSlideMasters(slideMasters.length > 0 ? slideMasters : void 0).withTags(tags.length > 0 ? tags : void 0).withCustomProperties(customProperties.length > 0 ? customProperties : void 0).withCoreProperties(coreProperties).withAppProperties(appProperties).withHasMacros(this.vbaProjectBin !== null ? true : void 0).withHasDigitalSignatures(this.signatureDetection?.hasSignatures || void 0).withDigitalSignatureCount(
70288
71607
  this.signatureDetection?.signatureCount && this.signatureDetection.signatureCount > 0 ? this.signatureDetection.signatureCount : void 0
@@ -70413,6 +71732,7 @@ var PptxHandlerRuntime94 = class extends PptxHandlerRuntime93 {
70413
71732
  this.customXmlParts = [];
70414
71733
  this.loadedEmbeddedFonts = [];
70415
71734
  this.loadedEmbeddedFontList = void 0;
71735
+ this.loadedViewProperties = void 0;
70416
71736
  this.orderedSlidePaths = [];
70417
71737
  this.zip = null;
70418
71738
  }
@@ -71370,11 +72690,13 @@ function parseDrawingColorChoice(colorNode) {
71370
72690
  }
71371
72691
  if (colorNode["a:scrgbClr"]) {
71372
72692
  const scrgb = colorNode["a:scrgbClr"];
71373
- const red = parseDrawingPercent(scrgb["@_r"]);
71374
- const green = parseDrawingPercent(scrgb["@_g"]);
71375
- const blue = parseDrawingPercent(scrgb["@_b"]);
72693
+ const red = parseDrawingFraction(scrgb["@_r"]);
72694
+ const green = parseDrawingFraction(scrgb["@_g"]);
72695
+ const blue = parseDrawingFraction(scrgb["@_b"]);
71376
72696
  if (red !== void 0 && green !== void 0 && blue !== void 0) {
71377
- const base = `#${toHex(red * 255)}${toHex(green * 255)}${toHex(blue * 255)}`;
72697
+ const base = `#${toHex(scrgbLinearToSrgb8(red))}${toHex(scrgbLinearToSrgb8(green))}${toHex(
72698
+ scrgbLinearToSrgb8(blue)
72699
+ )}`;
71378
72700
  return applyDrawingColorTransforms(base, scrgb);
71379
72701
  }
71380
72702
  }
@@ -71459,7 +72781,7 @@ function parseDrawingColorOpacity(colorNode) {
71459
72781
  const alphaMod = parseDrawingPercent(
71460
72782
  colorChoice["a:alphaMod"]?.["@_val"]
71461
72783
  );
71462
- const alphaOff = parseDrawingPercent(
72784
+ const alphaOff = parseDrawingFraction(
71463
72785
  colorChoice["a:alphaOff"]?.["@_val"]
71464
72786
  );
71465
72787
  if (alpha === void 0 && alphaMod === void 0 && alphaOff === void 0) {
@@ -85532,4 +86854,4 @@ var SvgExporter = class _SvgExporter {
85532
86854
  * `<p:extLst>` (optional)
85533
86855
  */
85534
86856
 
85535
- export { ALL_ANIMATION_PRESETS, BLIP_FILL_ORDER, CLOUD_CALLOUT_TAIL_COUNT, CLOUD_LOBE_COUNT, COLOR_MAP_ALIAS_KEYS, CONNECTOR_ARROW_OPTIONS, CONNECTOR_GEOMETRY_OPTIONS, ChartBuilder, ConnectorBuilder, ConnectorXmlFactory, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_COLOR_MAP, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_SCHEME_COLOR_MAP, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, DataIntegrityError, DocumentConverter, EFFECT_LST_ORDER, ELEMENT_FIELD_KIND, EMPHASIS_PRESETS, EMU_PER_INCH, EMU_PER_PIXEL3 as EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_PX, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, ENTRANCE_PRESETS, EXIT_PRESETS, EncryptedFileError, FONT_SUBSTITUTION_MAP, FreeformPathBuilder, GroupBuilder, ImageBuilder, IncorrectPasswordError, MAX_TABLE_DIMENSION, MAX_ZIP_ENTRY_COUNT, MIN_ELEMENT_SIZE, MIN_TABLE_DIMENSION, MOTION_PATH_PRESETS, MediaBuilder, MediaContext, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, OPC_RELATIONSHIP_TRANSFORM, OPENXML_COVERAGE, OPENXML_SCHEMA_CONSTRUCT_IDS, OPENXML_STRICT_SCHEMA_CONSTRUCT_IDS, OPENXML_TRANSITIONAL_SCHEMA_CONSTRUCT_IDS, Ole2ParseError, P14_GUIDE_URI, P15_GUIDE_URI, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, POWERPOINT_PRESENCE_KEY, PPTX_VIEWER_MANIFEST_NS, PRESET_COLOR_MAP, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_SHAPE_GEOMETRY_TABLE, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime96 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMarkdownConverter, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState as PptxSaveSession, PptxSaveStateBuilder as PptxSaveSessionBuilder, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, Presentation, PresentationBuilder, SHAPE_TREE_ELEMENT_TAGS, SLIDE_FIELD_KIND, SMART_ART_DEFINITION_PARTS, SP_PR_ORDER, STROKE_DASH_OPTIONS, SUPPORTED_XML_CANON_TRANSFORMS, SWITCHABLE_LAYOUT_TYPES, SYSTEM_COLOR_MAP, ShapeBuilder, SlideBuilder, SlideProcessor, SlideSizes, SvgExporter, TC_PR_BORDERS_ORDER, THEME_COLOR_SCHEME_KEYS, THEME_PRESETS, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, TextShapeXmlFactory, ThemePresets, VML_SHAPE_TAGS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, ZipBombError, addChartCategory, addChartSeries, addSection, addSmartArtNode, addSmartArtNodeAsChild, applyBubbleChartOptions, applyChartLayouts, applyChartManualLayout, applyChartUpDownBars, applyCustomShows, applyDiagramRelationshipIds, applyDrawingColorTransforms, applyDrawingLineDash, applyDrawingMediaReference, applyKinsokuToXml, applySections, applySmartArtConstraintRules, applySmartArtLayoutDefinition, applyTableCellTextAndStyle, applyTemplate, applyThemeOverrideToSlide, applyThemeToData, areNamespacesSupported, buildCalloutLeaderLineSvgPath, buildClrMapOverrideXml, buildFontFamilyString, buildGuideListExtension, buildInkMlContent, buildLinkedTextBoxChains, buildOle2, buildSingleEffectNode, buildSrgbColorChoice, buildThemeColorMap, catmullRomToBezier, chartDataAddCategory, chartDataAddSeries, chartDataChangeType, chartDataRemoveCategory, chartDataRemoveSeries, chartDataUpdatePoint, checkBlankSlide, checkComplexTables, checkDuplicateTitles, checkLowContrast, checkMissingAltText, checkMissingSlideTitle, checkPresentation, clampUnitInterval, classifyPanose, cloneElement, cloneShapeStyle, cloneSlide, cloneTemplateElementsBySlideId, cloneTextStyle, cloneXmlObject, cm, cmToEmu, colorWithOpacity, colorsEqual, combineShapes, computeContrastRatio, computeCycleLayout, computeDetailStatus, computeDigestBase64 as computeDigestBase64WebCrypto, computeHierarchyLayout, computeLinearLayout, computeMatrixLayout, computePyramidLayout, computeSmartArtLayout, computeSnakeLayout, computeVerificationStatus, convertXmlToStrict, createArrayBufferCopy, createBuiltinVariables, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createEditorId, createFreeformElement, createGroupElement, createImageElement, createLayout, createLayouts, createMediaElement, createModifyVerifier, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTemplateConnectorRawXml, createTemplateShapeRawXml, createTextElement, createUniformTextSegments, dataUrlToMediaBytes, decodeOle10Native, decodeXmlEntities, decomposeSmartArt, decryptPptx, demoteSmartArtNode, deobfuscateFont, deriveOutputPath, detectDigitalSignatures, detectFileFormat, detectFontFormat, detectOleObjectType, detectStrictConformance, diffPresentations, diffSlides, distributeSegmentsAcrossChain, douglasPeucker, duplicateElement, duplicateSlide, elementActionToPptxAction, elementHasAction, emuToPixels, encryptPptx, ensureArrayValue, escapeXmlAttr, escapeXmlText, estimateTextBoxCapacity, evaluateGeometryPaths, evaluateGuides, evaluatePresetShape, extractAllTagText, extractColorChoiceXml, extractFirstTagText, extractGraphicBuilds, extractGuidFromPartName, extractModel3DTransform, extractStyleReferenceColorXml, extractTagAttribute, fetchUrlToBytes, findCustomShow, findLayoutByName, findLayoutByType, findOpenXmlCoverage, findPlaceholders, findText, formatCommentTimestamp, fragmentShapes, generateFontGuid, generateLayoutXml, generateMediaFilename, getAdjustmentAwareClipPath, getAdjustmentAwareShapeClipPath, getAnimationPresetInfo, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCloudCalloutClipPath, getCloudClipPath, getCloudPathForRendering, getCommentMarkerPosition, getConnectorAdjustment, getConnectorPathGeometry, getCssBorderDashStyle, getCustomShowNames, getCustomShowPositionLabel, getDirectory, getElementLabel, getElementTextContent, getElementTransform, getImageMaskStyle, getLinkedTextBoxSegments, getNativeAnimationPresetMetadata, getOleObjectTypeLabel, getPanoseWeight, getPresetShapeClipPath, getPresetsByCategory, getRoundRectRadiusPx, getSectionForSlide, getSectionSlideRange, getShapeClipPath, getShapeClipPathFromPreset, getShapeType, getSignaturePathsToStrip, getSubstituteFontFamily, getSubstituteFonts, getSupportedNamespaces, getSvgStrokeDasharray, getTextCompensationTransform, getThemePreset, getZoomElements, getZoomTargetSlideIndexes, guidToKey, guideEmuToPx, guidePxToEmu, hasDirectSubstitution, hasNonTrivialOverride, hasShapeProperties, hasTextProperties, hexToRgbChannels, hslToRgb, inches, inchesToEmu, inferOleExtensionFromTarget, interpolateShapeGeometry, intersectPolygons, intersectShapes, intersectSvgPaths, isAlternateContentChoiceSupported, isAlternateContentChoiceXmlSupported, isCalloutShape, isConnectorElement, isEditableTextElement, isImageLikeElement, isInkElement, isNamespaceSupported, isOle2CompoundFile, isShapeElement, isStrictNamespaceUri, isSummaryZoomSlide, isSwitchableLayoutType, isTemplateElement, isTextElement, isTransitionalNamespaceUri, isValidBase64, isXmlNode, isZoomElement, isZoomElement2 as isZoomElementUtil, layoutEngineShapesToDrawingShapes, listUnassessedOpenXmlCoverage, lookupPresetShape, mailMerge, mergePresentation, mergeShapes, mergeStyleParts, mergeThemeColorOverride, mimeTypeForOleFile, mm, moveSlidesToSection, navigateCustomShow, normalizeHexColor, normalizeNamespaceUri, normalizePartPath, normalizePath, normalizeStrictXml, normalizeStrokeDashType, obfuscateFont, oleBytesToDataUrl, ooxmlArcToSvg, ooxmlToPresetName, orderedXmlKey, parseActiveXControlsFromSlide, parseAdjustmentValues, parseBodyPrBooleanAttrs, parseBubbleChartOptions, parseChart3DSurfaces, parseChartAxes, parseChartLayouts, parseChartManualLayout, parseChartUpDownBars, parseCondition, parseConditionList, parseCustomShows, parseCxChartSeries, parseDataTable, parseDataUrlToBytes, parseDiagramRelationshipIds, parseDrawingColor, parseDrawingColorChoice, parseDrawingColorOpacity, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingLineDash, parseDrawingMediaReference, parseDrawingPercent, parseEmbeddedXlsx, parseGuideDefinitions, parseHexColor, parseInkMlContent, parseKinsoku, parseLayoutDefinition, parseLineStyle, parseMarker, parseOle2, parsePanoseBytes, parsePanoseString, parsePresentationDrawingGuides, parseSeriesDataLabels, parseSeriesDataPoints, parseSeriesErrBars, parseSeriesExplosion, parseSeriesTrendlines, parseShapeProps, parseSignatureXml, parseSlideDrawingGuides, parseSmartArtColorStyleLabels, parseSmartArtConstraintRules, parseSmartArtDefinitionHeaderList, parseSmartArtDefinitionMetadata, parseSmartArtLayoutDefinition, parseSmartArtQuickStyleLabels, parseStructuredCustomGeometry, parseSvgPath, parseTimeTargetElement, parseVmlElement, parseVmlElements, pixelsToEmu, polygonsToSvgPath, pptxActionToElementAction, promoteSmartArtNode, pt, reResolveSlideColors, readFileAsDataUrl, rebuildTableStructureInRawXml, reconcileAnimationTargets, reflowSmartArtLayout, relativeLuminance, relayoutSmartArt, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeSection, removeSmartArtNode, reorderObjectKeys, reorderSections, reorderSmartArtNode, reorderSmartArtNodeToIndex, repairPptx, replaceShapeGeometry, replaceText, replaceTextInSlide, replaceWithCustomGeometry, resetCloneIdCounter, resetDecomposeCounter, resetIdCounter, resetSectionIdCounter, resetSmartArtEditCounter, resolveCoordinate, resolveCustomShowSlideIndices, resolveLayoutDisplayName, resolveModel3DMimeType, resolveReferenceUriToPart, resolveTableCellStyle, rgbToHsl, selectAlternateContentBranch, serializeColorChoice, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeSmartArtDefinitionHeaderList, serializeSvgPath, serializeTimeTargetElement, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, setElementLocked, setSmartArtNodeStyle, shouldRenderFallbackLabel, shouldReturnToZoomSlide, stripParentDirSegments, stripXmlOrderSuffix, subtractPolygons, subtractShapes, subtractSvgPaths, summarizeOpenXmlCoverage, summarizeOpenXmlCoverageByVocabulary, svgPathToPolygons, switchSmartArtLayout, themeColorSchemesEqual, toHex, toStrictNamespaceUri, unionPolygons, unionShapes, unionSvgPaths, unwrapAlternateContent, unwrapOleEmbedding, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, updateSmartArtNodeText, validatePptx, validateSmartArtColorStyleLabels, validateSmartArtConstraintRules, validateSmartArtDefinitionHeaderList, validateSmartArtDefinitionMetadata, validateSmartArtLayoutDefinition, verifyModifyPassword, verifyPassword, verifySignatureDigests, withThemePlaceholderColor, writeBodyPrBooleanAttrs, xmlAttr, xmlAttrBool, xmlAttrNumber, xmlChild, xmlChildren, xmlPath, xmlText };
86857
+ export { ALL_ANIMATION_PRESETS, BLIP_FILL_ORDER, CLOUD_CALLOUT_TAIL_COUNT, CLOUD_LOBE_COUNT, COLOR_MAP_ALIAS_KEYS, CONNECTOR_ARROW_OPTIONS, CONNECTOR_GEOMETRY_OPTIONS, ChartBuilder, ConnectorBuilder, ConnectorXmlFactory, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_COLOR_MAP, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_MAX_UNCOMPRESSED_BYTES, DEFAULT_SCHEME_COLOR_MAP, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, DataIntegrityError, DocumentConverter, EFFECT_LST_ORDER, ELEMENT_FIELD_KIND, EMPHASIS_PRESETS, EMU_PER_INCH, EMU_PER_PIXEL3 as EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_PX, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, ENTRANCE_PRESETS, EXIT_PRESETS, EncryptedFileError, FONT_SUBSTITUTION_MAP, FreeformPathBuilder, GroupBuilder, ImageBuilder, IncorrectPasswordError, MAX_TABLE_DIMENSION, MAX_ZIP_ENTRY_COUNT, MIN_ELEMENT_SIZE, MIN_TABLE_DIMENSION, MOTION_PATH_PRESETS, MediaBuilder, MediaContext, MediaGraphicFrameXmlFactory, OOXML_TO_PRESET_EMPH, OOXML_TO_PRESET_ENTR, OOXML_TO_PRESET_EXIT, OPC_RELATIONSHIP_TRANSFORM, OPENXML_COVERAGE, OPENXML_SCHEMA_CONSTRUCT_IDS, OPENXML_STRICT_SCHEMA_CONSTRUCT_IDS, OPENXML_TRANSITIONAL_SCHEMA_CONSTRUCT_IDS, Ole2ParseError, P14_GUIDE_URI, P15_GUIDE_URI, PANOSE_FAMILY_MAP, PANOSE_MONOSPACE_PROPORTION, PANOSE_SANS_SERIF_STYLES, PANOSE_WEIGHT_MAP, POWERPOINT_PRESENCE_KEY, PPTX_VIEWER_MANIFEST_NS, PRESET_COLOR_MAP, PRESET_SHAPE_CATEGORY_LABELS, PRESET_SHAPE_CLIP_PATHS, PRESET_SHAPE_DEFINITIONS, PRESET_SHAPE_GEOMETRY_TABLE, PRESET_TO_OOXML, PictureXmlFactory, PptxAnimationWriteService, PptxColorStyleCodec, PptxCommentAuthorsXmlFactory, PptxCommentXmlFactoryProvider, PptxCompatibilityService, PptxConnectorParser, PptxContentTypesBuilder, PptxDocumentPropertiesUpdater, PptxEditorAnimationService, PptxElementTransformUpdater, PptxElementXmlBuilder, PptxGraphicFrameParser, PptxHandler, PptxHandlerRuntime96 as PptxHandlerRuntime, PptxHandlerRuntimeFactory, PptxLoadDataBuilder, PptxMarkdownConverter, PptxMediaDataParser, PptxNativeAnimationService, PptxPresentationSaveBuilder, PptxPresentationSlidesReconciler, PptxRuntimeDependencyFactory, PptxSaveConstantsFactory, PptxSaveState as PptxSaveSession, PptxSaveStateBuilder as PptxSaveSessionBuilder, PptxSaveState, PptxSaveStateBuilder, PptxShapeIdValidator, PptxShapeStyleExtractor, PptxSlideBackgroundBuilder, PptxSlideBuilder, PptxSlideCommentPartWriter, PptxSlideCommentsXmlFactory, PptxSlideElementsBuilder, PptxSlideLoaderService, PptxSlideMediaRelationshipBuilder, PptxSlideNotesBuilder, PptxSlideNotesPartUpdater, PptxSlideRelationshipRegistry, PptxSlideTransitionService, PptxTableDataParser, PptxTemplateBackgroundService, PptxXmlBuilder, PptxXmlFactoryProvider, PptxXmlLookupService, Presentation, PresentationBuilder, SHAPE_TREE_ELEMENT_TAGS, SLIDE_FIELD_KIND, SMART_ART_DEFINITION_PARTS, SP_PR_ORDER, STROKE_DASH_OPTIONS, SUPPORTED_XML_CANON_TRANSFORMS, SWITCHABLE_LAYOUT_TYPES, SYSTEM_COLOR_MAP, ShapeBuilder, SlideBuilder, SlideProcessor, SlideSizes, SvgExporter, TC_PR_BORDERS_ORDER, THEME_COLOR_SCHEME_KEYS, THEME_PRESETS, TRANSITION_VALID_DIRECTIONS, TableBuilder, TextBuilder, TextShapeXmlFactory, ThemePresets, VML_SHAPE_TAGS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, ZipBombError, addChartCategory, addChartSeries, addSection, addSmartArtNode, addSmartArtNodeAsChild, applyBubbleChartOptions, applyChartLayouts, applyChartManualLayout, applyChartUpDownBars, applyCustomShows, applyDiagramRelationshipIds, applyDrawingColorTransforms, applyDrawingLineDash, applyDrawingMediaReference, applyKinsokuToXml, applySections, applySmartArtConstraintRules, applySmartArtLayoutDefinition, applyTableCellTextAndStyle, applyTemplate, applyThemeOverrideToSlide, applyThemeToData, areNamespacesSupported, buildCalloutLeaderLineSvgPath, buildClrMapOverrideXml, buildFontFamilyString, buildGuideListExtension, buildInkMlContent, buildLinkedTextBoxChains, buildOle2, buildSingleEffectNode, buildSlideReferenceRemap, buildSrgbColorChoice, buildThemeColorMap, catmullRomToBezier, chartDataAddCategory, chartDataAddSeries, chartDataChangeType, chartDataRemoveCategory, chartDataRemoveSeries, chartDataUpdatePoint, checkBlankSlide, checkComplexTables, checkDuplicateTitles, checkLowContrast, checkMissingAltText, checkMissingSlideTitle, checkPresentation, clampUnitInterval, classifyPanose, cloneElement, cloneShapeStyle, cloneSlide, cloneTemplateElementsBySlideId, cloneTextStyle, cloneXmlObject, cm, cmToEmu, colorWithOpacity, colorsEqual, combineShapes, computeContrastRatio, computeCycleLayout, computeDetailStatus, computeDigestBase64 as computeDigestBase64WebCrypto, computeHierarchyLayout, computeLinearLayout, computeMatrixLayout, computePyramidLayout, computeSmartArtLayout, computeSnakeLayout, computeVerificationStatus, convertXmlToStrict, createArrayBufferCopy, createBuiltinVariables, createChartElement, createConnectorElement, createDefaultPptxHandlerRuntime, createEditorId, createFreeformElement, createGroupElement, createImageElement, createLayout, createLayouts, createMediaElement, createModifyVerifier, createPptxSaveConstants, createShapeElement, createTableCellXml, createTableElement, createTableGraphicFrameRawXml, createTemplateConnectorRawXml, createTemplateShapeRawXml, createTextElement, createUniformTextSegments, dataUrlToMediaBytes, decodeOle10Native, decodeXmlEntities, decomposeSmartArt, decryptPptx, demoteSmartArtNode, deobfuscateFont, deriveOutputPath, deriveSlideTitle, deriveSlideTitles, detectDigitalSignatures, detectFileFormat, detectFontFormat, detectOleObjectType, detectStrictConformance, diffPresentations, diffSlides, distributeSegmentsAcrossChain, douglasPeucker, duplicateElement, duplicateSlide, elementActionToPptxAction, elementHasAction, emuToPixels, encryptPptx, ensureArrayValue, escapeXmlAttr, escapeXmlText, estimateTextBoxCapacity, evaluateGeometryPaths, evaluateGuides, evaluatePresetShape, extractAllTagText, extractColorChoiceXml, extractFirstTagText, extractGraphicBuilds, extractGuidFromPartName, extractModel3DTransform, extractStyleReferenceColorXml, extractTagAttribute, fetchUrlToBytes, findCustomShow, findLayoutByName, findLayoutByType, findOpenXmlCoverage, findPlaceholders, findText, formatCommentTimestamp, fragmentShapes, generateFontGuid, generateLayoutXml, generateMediaFilename, getAdjustmentAwareClipPath, getAdjustmentAwareShapeClipPath, getAnimationPresetInfo, getCalloutLeaderLineGeometry, getCalloutTier, getCalloutViewBoxBounds, getCloudCalloutClipPath, getCloudClipPath, getCloudPathForRendering, getCommentMarkerPosition, getConnectorAdjustment, getConnectorPathGeometry, getCssBorderDashStyle, getCustomShowNames, getCustomShowPositionLabel, getDirectory, getElementLabel, getElementTextContent, getElementTransform, getImageMaskStyle, getLinkedTextBoxSegments, getNativeAnimationPresetMetadata, getOleObjectTypeLabel, getPanoseWeight, getPresetShapeClipPath, getPresetsByCategory, getRoundRectRadiusPx, getSectionForSlide, getSectionSlideRange, getShapeClipPath, getShapeClipPathFromPreset, getShapeType, getSignaturePathsToStrip, getSubstituteFontFamily, getSubstituteFonts, getSupportedNamespaces, getSvgStrokeDasharray, getTextCompensationTransform, getThemePreset, getZoomElements, getZoomTargetSlideIndexes, guidToKey, guideEmuToPx, guidePxToEmu, hasDirectSubstitution, hasNonTrivialOverride, hasShapeProperties, hasTextProperties, hexToRgbChannels, hslToRgb, inches, inchesToEmu, inferOleExtensionFromTarget, interpolateShapeGeometry, intersectPolygons, intersectShapes, intersectSvgPaths, isAlternateContentChoiceSupported, isAlternateContentChoiceXmlSupported, isCalloutShape, isConnectorElement, isEditableTextElement, isImageLikeElement, isInkElement, isNamespaceSupported, isOle2CompoundFile, isShapeElement, isStrictNamespaceUri, isSummaryZoomSlide, isSwitchableLayoutType, isTemplateElement, isTextElement, isTransitionalNamespaceUri, isValidBase64, isXmlNode, isZoomElement, isZoomElement2 as isZoomElementUtil, layoutEngineShapesToDrawingShapes, listUnassessedOpenXmlCoverage, lookupPresetShape, mailMerge, mergePresentation, mergeShapes, mergeStyleParts, mergeThemeColorOverride, mimeTypeForOleFile, mm, moveSlidesToSection, navigateCustomShow, normalizeHexColor, normalizeNamespaceUri, normalizePartPath, normalizePath, normalizeStrictXml, normalizeStrokeDashType, obfuscateFont, oleBytesToDataUrl, ooxmlArcToSvg, ooxmlToPresetName, orderedXmlKey, parseActiveXControlsFromSlide, parseAdjustmentValues, parseBodyPrBooleanAttrs, parseBubbleChartOptions, parseChart3DSurfaces, parseChartAxes, parseChartLayouts, parseChartManualLayout, parseChartUpDownBars, parseCondition, parseConditionList, parseCustomShows, parseCxChartSeries, parseDataTable, parseDataUrlToBytes, parseDiagramRelationshipIds, parseDrawingColor, parseDrawingColorChoice, parseDrawingColorOpacity, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingLineDash, parseDrawingMediaReference, parseDrawingPercent, parseEmbeddedXlsx, parseGuideDefinitions, parseHexColor, parseInkMlContent, parseKinsoku, parseLayoutDefinition, parseLineStyle, parseMarker, parseOle2, parsePanoseBytes, parsePanoseString, parsePresentationDrawingGuides, parseSeriesDataLabels, parseSeriesDataPoints, parseSeriesErrBars, parseSeriesExplosion, parseSeriesTrendlines, parseShapeProps, parseSignatureXml, parseSlideDrawingGuides, parseSmartArtColorStyleLabels, parseSmartArtConstraintRules, parseSmartArtDefinitionHeaderList, parseSmartArtDefinitionMetadata, parseSmartArtLayoutDefinition, parseSmartArtQuickStyleLabels, parseStructuredCustomGeometry, parseSvgPath, parseTimeTargetElement, parseVmlElement, parseVmlElements, pixelsToEmu, polygonsToSvgPath, pptxActionToElementAction, promoteSmartArtNode, pt, reResolveSlideColors, readFileAsDataUrl, rebuildTableStructureInRawXml, reconcileAnimationTargets, reflowSmartArtLayout, relativeLuminance, relayoutSmartArt, remapEditorAnimationsToShapeIds, removeChartCategory, removeChartSeries, removeSection, removeSmartArtNode, reorderObjectKeys, reorderSections, reorderSmartArtNode, reorderSmartArtNodeToIndex, repairPptx, replaceShapeGeometry, replaceText, replaceTextInSlide, replaceWithCustomGeometry, resetCloneIdCounter, resetDecomposeCounter, resetIdCounter, resetSectionIdCounter, resetSmartArtEditCounter, resolveCoordinate, resolveCustomShowSlideIndices, resolveLayoutDisplayName, resolveModel3DMimeType, resolveReferenceUriToPart, resolveTableCellStyle, rgbToHsl, selectAlternateContentBranch, serializeColorChoice, serializeCondition, serializeConditionList, serializeGraphicBuild, serializeSmartArtDefinitionHeaderList, serializeSvgPath, serializeTimeTargetElement, setChartAxis, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategories, setChartDataLabels, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartGrouping, setChartLegend, setChartSeriesChartType, setChartSeriesColor, setChartSeriesErrorBars, setChartSeriesMarker, setChartSeriesTrendline, setChartTitle, setChartType, setElementLocked, setSmartArtNodeStyle, shouldRenderFallbackLabel, shouldReturnToZoomSlide, stripParentDirSegments, stripXmlOrderSuffix, subtractPolygons, subtractShapes, subtractSvgPaths, summarizeOpenXmlCoverage, summarizeOpenXmlCoverageByVocabulary, svgPathToPolygons, switchSmartArtLayout, themeColorSchemesEqual, toHex, toStrictNamespaceUri, unionPolygons, unionShapes, unionSvgPaths, unwrapAlternateContent, unwrapOleEmbedding, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateChartDataPoint, updateChartSeriesValues, updateMergeAttrsInRawXml, updateSmartArtNodeText, validatePptx, validateSmartArtColorStyleLabels, validateSmartArtConstraintRules, validateSmartArtDefinitionHeaderList, validateSmartArtDefinitionMetadata, validateSmartArtLayoutDefinition, verifyModifyPassword, verifyPassword, verifySignatureDigests, withThemePlaceholderColor, writeBodyPrBooleanAttrs, xmlAttr, xmlAttrBool, xmlAttrNumber, xmlChild, xmlChildren, xmlPath, xmlText };