ooxml-core 1.26.1 → 1.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{PptxHandler-AILFLRH7.cjs → PptxHandler-NHOKKZ4S.cjs} +3 -3
  2. package/dist/{PptxHandler-64BZOBWX.mjs → PptxHandler-OIR3ZY4Q.mjs} +2 -2
  3. package/dist/PptxHandler-TZJNIXPX.mjs +4 -0
  4. package/dist/{PresentationBuilder-RBQP6A37.cjs → PresentationBuilder-EX6DAE5X.cjs} +5 -5
  5. package/dist/{PresentationBuilder-EJY2TYWL.mjs → PresentationBuilder-RFTSZUPR.mjs} +2 -2
  6. package/dist/{PresentationBuilder-HBCCO2CF.mjs → PresentationBuilder-X5WFSHLB.mjs} +2 -2
  7. package/dist/{chunk-MU3XSASV.cjs → chunk-36TR3PER.cjs} +270 -13
  8. package/dist/{chunk-FZBAMWCJ.mjs → chunk-5KJAQKZG.mjs} +62 -275
  9. package/dist/{chunk-R7RL7W43.mjs → chunk-5NJPYCGO.mjs} +271 -17
  10. package/dist/{chunk-OQPT5IC3.mjs → chunk-BXZF7H5G.mjs} +4 -4
  11. package/dist/{chunk-NXTHB2M3.cjs → chunk-DMJIDRJE.cjs} +1139 -1352
  12. package/dist/{chunk-OTXJVFMY.mjs → chunk-GZ4DIXZZ.mjs} +62 -275
  13. package/dist/{chunk-2XMK5SXU.mjs → chunk-I57SMSU6.mjs} +268 -14
  14. package/dist/{chunk-WRFMS5CL.mjs → chunk-QIMNQDON.mjs} +1 -1
  15. package/dist/{chunk-DHAZSMC7.mjs → chunk-ZWTXVWMY.mjs} +1 -1
  16. package/dist/pptx/automation/index.cjs +352 -311
  17. package/dist/pptx/automation/index.d.ts +1 -1
  18. package/dist/pptx/automation/index.mjs +5 -5
  19. package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +1 -1
  20. package/dist/pptx/chunks/{index-CbFowkp4.d.ts → index-GWpMAY-f.d.ts} +16 -3
  21. package/dist/pptx/chunks/index-GWpMAY-f.d.ts.map +1 -0
  22. package/dist/pptx/cli/index.cjs +352 -311
  23. package/dist/pptx/cli/index.mjs +4 -4
  24. package/dist/pptx/converter/index.mjs +2 -2
  25. package/dist/pptx/editor/render/find-replace.cjs +14 -14
  26. package/dist/pptx/editor/render/find-replace.d.ts +1 -1
  27. package/dist/pptx/editor/render/find-replace.mjs +1 -1
  28. package/dist/pptx/editor/render/slide-operations.cjs +8 -8
  29. package/dist/pptx/editor/render/slide-operations.mjs +2 -2
  30. package/dist/pptx/index.cjs +354 -311
  31. package/dist/pptx/index.d.ts +2 -2
  32. package/dist/pptx/index.mjs +5 -5
  33. package/package.json +1 -1
  34. package/dist/PptxHandler-PMLQGMFQ.mjs +0 -4
  35. package/dist/pptx/chunks/index-CbFowkp4.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, attr, childrenNamed, childNamed, parseCellAddress, readChartManualLayoutValues, worksheetData, formatCellAddress, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, escText, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, OOXML_PERCENT_UNITS, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, emu, formatSchemeKey, gradFill, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-R7RL7W43.mjs';
1
+ import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, formatAutoNumberMarker, parseParagraphSpacingPx, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseStructuredCustomGeometry, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, evaluateGeometryPaths, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, orderedXmlKey, safeResolveZipPath, parseXml, elements, parseDataUrlToBytes, base64Decode, EMU_PER_PX, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, hasShapeProperties, ensureXmlChild, hasTextProperties, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, readCommentMentions, rebaseCommentMentions, applyCommentMentions, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, applyChartManualLayout, chartTrendlineType, buildTrendlineLabel, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, applyDiagramRelationshipIds, buildSaveTimeCustomGeometryXml, applyCustomGeometryGuideOverrides, avLstForPreset, filterValidShapeAdjustmentEntries, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, writeShapeEffects, SHAPE_STYLE_ORDER, roundCoordinate, scaleVectorToIntegers, EMU_PER_PIXEL, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, getSignaturePathsToStrip, mergeSmartArtPointXml, mergeSmartArtConnectionXml, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseChartUserShapesDrawing, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, ensureXmlChildren, TC_PR_BORDERS_ORDER, relAttr, buildXml, writeChartColorChoice, first, stripParentDirSegments, children, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, parseChartFormulaRange, expandRangeAddresses, applyCellWritesToWorksheet, attr, childrenNamed, childNamed, parseCellAddress, readChartManualLayoutValues, worksheetData, formatCellAddress, buildEffectDagTreeFromXml, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, blobUrlToDataUrl, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, SvgExporter, detectStrictConformance, normalizeStrictXml, normalizeStShapeType, applyCustomShows, applySections, reorderObjectKeysByLocalName, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, deriveSlideTitles, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, encodeXmlAttributeValue, encodeXmlTextValue, stripXmlOrderMarkers, CHART_ERROR_VALUE_TYPES, CHART_ERROR_BAR_TYPES, CHART_ERROR_BAR_DIRECTIONS, MIN_ELEMENT_SIZE, createDrawingObjectId, DEFAULT_TEXT_FONT_SIZE, EncryptedFileError, decodePptxJsonText, deserializePptxFromJson, applyImportedPptxData, DEFAULT_CHART_GRADIENT_ANGLE, supportsChartGradientFill, svgToCustomGeometryPaths, escAttr, MIN_TABLE_DIMENSION, MAX_TABLE_DIMENSION, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, effectChild, mergeEffectNode, mergeAttributeEffectNode, estimateMediaDurationMs, parseVmlElements, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, IncorrectPasswordError, applyThemeToData, detectFileFormat, parseOle2, decryptPptx, encryptPptx, escText, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, PML_XMLNS, solidFill, esc, OOXML_PERCENT_UNITS, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, emu, formatSchemeKey, gradFill, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, extractGuidFromPartName, deobfuscateFont, detectFontFormat, parseKinsoku, parseLineStyle, parseChartUpDownBars, parseDataTable, parseChart3DSurfaces, parseChartAxes, parseBubbleChartOptions, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, parseSeriesDataPoints, parseMarker, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, EMU_PER_POINT, chartTrendlineKind, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtPresLayoutVars, parseSmartArtConnection, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, parseSmartArtQuickStyleLabels, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, getElementOrientationMatrix, isTextOrientationMatrix, TEXT_ORIENTATION_IDENTITY, multiplyTextOrientationMatrices } from './chunk-5NJPYCGO.mjs';
2
2
  import { openPptxZip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, openZip, DEFAULT_MAX_UNCOMPRESSED_BYTES, guardZip, ZipBombError, MAX_ZIP_ENTRY_COUNT } from './chunk-JJ37PCNR.mjs';
3
3
  import { resolveSmartArtLayoutCategory } from './chunk-3GXV5MPC.mjs';
4
4
  import { cloneXmlObject, applySmartArtLayoutDefinition, cloneSlide, parseSmartArtLayoutDefinition } from './chunk-54S5A5PZ.mjs';
@@ -38,10 +38,10 @@ var COLOR_ELEMENTS = {
38
38
  hslClr: "hsl"
39
39
  };
40
40
  function colorValue(kind, element) {
41
- const attribute3 = (name) => element.getAttribute(name) ?? "";
42
- if (kind === "scrgb") return `${attribute3("r")},${attribute3("g")},${attribute3("b")}`;
43
- if (kind === "hsl") return `${attribute3("hue")},${attribute3("sat")},${attribute3("lum")}`;
44
- return attribute3("val");
41
+ const attribute2 = (name) => element.getAttribute(name) ?? "";
42
+ if (kind === "scrgb") return `${attribute2("r")},${attribute2("g")},${attribute2("b")}`;
43
+ if (kind === "hsl") return `${attribute2("hue")},${attribute2("sat")},${attribute2("lum")}`;
44
+ return attribute2("val");
45
45
  }
46
46
  function parseDrawingColorIn(container) {
47
47
  if (!container) return void 0;
@@ -448,10 +448,10 @@ var PartPatch = class {
448
448
  if (kids.length !== children6.length) throw new Error("Property part markup is not supported");
449
449
  kids.forEach((kid, index) => this.spans.set(kid, children6[index]));
450
450
  this.root = root;
451
- for (const attribute3 of Array.from(rootElement.attributes)) {
452
- if (attribute3.name === "xmlns") this.defaultNs = attribute3.value;
453
- else if (attribute3.namespaceURI === XMLNS || attribute3.name.startsWith("xmlns:"))
454
- this.prefixes.set(attribute3.value, attribute3.localName);
451
+ for (const attribute2 of Array.from(rootElement.attributes)) {
452
+ if (attribute2.name === "xmlns") this.defaultNs = attribute2.value;
453
+ else if (attribute2.namespaceURI === XMLNS || attribute2.name.startsWith("xmlns:"))
454
+ this.prefixes.set(attribute2.value, attribute2.localName);
455
455
  }
456
456
  }
457
457
  xml;
@@ -494,10 +494,10 @@ var PartPatch = class {
494
494
  else this.add(span.openEnd, span.closeStart, content2);
495
495
  }
496
496
  /** Adds ` name="value"` text to the element's start tag. */
497
- addAttribute(element, attribute3) {
497
+ addAttribute(element, attribute2) {
498
498
  const span = this.span(element);
499
499
  const at = span.openEnd - (span.selfClosing ? 2 : 1);
500
- this.add(at, at, attribute3);
500
+ this.add(at, at, attribute2);
501
501
  }
502
502
  remove(element) {
503
503
  const span = this.span(element);
@@ -718,9 +718,9 @@ function writeAppProperties(props, sourceXml) {
718
718
  }
719
719
 
720
720
  // opc/properties/custom.ts
721
- var escape = (text, attribute3 = false) => {
721
+ var escape = (text, attribute2 = false) => {
722
722
  const out = text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
723
- return attribute3 ? out.replace(/"/g, "&quot;") : out;
723
+ return attribute2 ? out.replace(/"/g, "&quot;") : out;
724
724
  };
725
725
  var isVt = (element) => element.namespaceURI === NS.vt || element.prefix === "vt";
726
726
  function allocateCustomPropertyIds(properties) {
@@ -951,13 +951,13 @@ function parseDrawingTextBody(body) {
951
951
  const anchor = properties?.getAttribute("anchor");
952
952
  if (anchor) result.anchor = anchor;
953
953
  const insets = {};
954
- for (const [key2, attribute3] of [
954
+ for (const [key2, attribute2] of [
955
955
  ["left", "lIns"],
956
956
  ["top", "tIns"],
957
957
  ["right", "rIns"],
958
958
  ["bottom", "bIns"]
959
959
  ]) {
960
- const value = Number.parseInt(properties?.getAttribute(attribute3) ?? "", 10);
960
+ const value = Number.parseInt(properties?.getAttribute(attribute2) ?? "", 10);
961
961
  if (Number.isFinite(value)) insets[key2] = value;
962
962
  }
963
963
  if (Object.keys(insets).length > 0) result.insetsEmu = insets;
@@ -35776,7 +35776,10 @@ async function resolveBulletImage(imageRelId, slidePath, resolver) {
35776
35776
  if (!target) {
35777
35777
  return void 0;
35778
35778
  }
35779
- if (target.startsWith("http://") || target.startsWith("https://") || target.startsWith("data:")) {
35779
+ if (target.startsWith("http://") || target.startsWith("https://")) {
35780
+ return resolver.allowExternalImages ? target : void 0;
35781
+ }
35782
+ if (target.startsWith("data:")) {
35780
35783
  return target;
35781
35784
  }
35782
35785
  const imagePath = resolver.resolveImagePath(slidePath, target);
@@ -35962,8 +35965,8 @@ function readPlaceholderFieldType(sp) {
35962
35965
  function readHeaderFooterFromMaster(masterRoot) {
35963
35966
  const result = {};
35964
35967
  const hf = child2(masterRoot, "p:hf");
35965
- const flag = (attribute3, placeholder) => {
35966
- const raw2 = hf?.[attribute3];
35968
+ const flag = (attribute2, placeholder) => {
35969
+ const raw2 = hf?.[attribute2];
35967
35970
  if (raw2 !== void 0) {
35968
35971
  return String(raw2) !== "0" && String(raw2) !== "false";
35969
35972
  }
@@ -38067,11 +38070,11 @@ function readChartAppearance(text, properties) {
38067
38070
  const out = {};
38068
38071
  const size = Number(text?.getAttribute("sz") ?? NaN);
38069
38072
  if (Number.isFinite(size) && size > 0) out.fontSize = size / 100;
38070
- for (const [attribute3, key2] of [
38073
+ for (const [attribute2, key2] of [
38071
38074
  ["b", "bold"],
38072
38075
  ["i", "italic"]
38073
38076
  ]) {
38074
- const value = text?.getAttribute(attribute3);
38077
+ const value = text?.getAttribute(attribute2);
38075
38078
  if (value !== null && value !== void 0) out[key2] = value === "1" || value === "true";
38076
38079
  }
38077
38080
  const typeface = first(text, "latin", NS.a)?.getAttribute("typeface");
@@ -42558,9 +42561,9 @@ function parseChartStyleDefinition(styleRoot, xmlLookup, resolveSchemeColor, par
42558
42561
  return resolveChartStyleDefinition(style, (color) => {
42559
42562
  const element = parseXml(drawingColorXml(color)).documentElement;
42560
42563
  const raw2 = {};
42561
- for (const attribute3 of Array.from(element.attributes))
42562
- if (attribute3.localName !== "xmlns" && attribute3.prefix !== "xmlns")
42563
- raw2[`@_${attribute3.localName}`] = attribute3.value;
42564
+ for (const attribute2 of Array.from(element.attributes))
42565
+ if (attribute2.localName !== "xmlns" && attribute2.prefix !== "xmlns")
42566
+ raw2[`@_${attribute2.localName}`] = attribute2.value;
42564
42567
  for (const transform2 of elements(element))
42565
42568
  raw2[`a:${transform2.localName}`] = transform2.hasAttribute("val") ? { "@_val": transform2.getAttribute("val") ?? "" } : {};
42566
42569
  const fill = {};
@@ -43049,242 +43052,6 @@ function modernCommentStatus(comment, hasRaw, hasRawStatus) {
43049
43052
  return comment.status === "resolved" || comment.status === "closed" ? "active" : comment.status || "active";
43050
43053
  }
43051
43054
 
43052
- // pptx/core/utils/modern-comment-mention-read.ts
43053
- var mentionLocalName = (key2) => key2.split(":").pop() || key2;
43054
- var mentionNodesOf = (value) => {
43055
- if (Array.isArray(value)) {
43056
- return value.filter((entry2) => Boolean(entry2) && typeof entry2 === "object");
43057
- }
43058
- return value && typeof value === "object" ? [value] : [];
43059
- };
43060
- var mentionChildrenNamed = (node, name) => {
43061
- if (!node) {
43062
- return [];
43063
- }
43064
- const result = [];
43065
- for (const [key2, value] of Object.entries(node)) {
43066
- if (!key2.startsWith("@_") && mentionLocalName(key2) === name) {
43067
- result.push(...mentionNodesOf(value));
43068
- }
43069
- }
43070
- return result;
43071
- };
43072
- var MENTION_PERSON_KEYS = [
43073
- "@_mentionpersonId",
43074
- "@_mentionPersonId",
43075
- "@_personId",
43076
- "@_authorId"
43077
- ];
43078
- var MENTION_LENGTH_KEYS = ["@_length", "@_mentionCharCount", "@_len"];
43079
- var attribute2 = (node, keys) => {
43080
- for (const key2 of keys) {
43081
- const value = node[key2];
43082
- if (value !== void 0 && value !== null && String(value).length > 0) {
43083
- return String(value);
43084
- }
43085
- }
43086
- return void 0;
43087
- };
43088
- var integer2 = (value) => {
43089
- if (value === void 0) {
43090
- return void 0;
43091
- }
43092
- const parsed = Number.parseInt(value, 10);
43093
- return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
43094
- };
43095
- var readMention = (node, authorName, containerUri) => {
43096
- const personId = attribute2(node, MENTION_PERSON_KEYS);
43097
- const startIndex = integer2(attribute2(node, ["@_startIndex"]));
43098
- const length = integer2(attribute2(node, MENTION_LENGTH_KEYS));
43099
- if (!personId || startIndex === void 0 || length === void 0 || length === 0) {
43100
- return void 0;
43101
- }
43102
- return {
43103
- personId,
43104
- startIndex,
43105
- length,
43106
- id: attribute2(node, ["@_mentionId", "@_id"]),
43107
- authorName: authorName(personId),
43108
- containerUri,
43109
- rawXml: node
43110
- };
43111
- };
43112
- function readCommentMentions(node, authorName) {
43113
- if (!node) {
43114
- return void 0;
43115
- }
43116
- const found = [];
43117
- for (const list2 of mentionChildrenNamed(node, "mentionLst")) {
43118
- for (const entry2 of mentionChildrenNamed(list2, "mention")) {
43119
- const mention = readMention(entry2, authorName);
43120
- if (mention) {
43121
- found.push(mention);
43122
- }
43123
- }
43124
- }
43125
- for (const extension of mentionChildrenNamed(mentionChildrenNamed(node, "extLst")[0], "ext")) {
43126
- const uri = String(extension["@_uri"] || "");
43127
- for (const list2 of mentionChildrenNamed(extension, "mentionLst")) {
43128
- for (const entry2 of mentionChildrenNamed(list2, "mention")) {
43129
- const mention = readMention(entry2, authorName, uri);
43130
- if (mention) {
43131
- found.push(mention);
43132
- }
43133
- }
43134
- }
43135
- }
43136
- found.sort((a, b) => a.startIndex - b.startIndex);
43137
- return found.length > 0 ? found : void 0;
43138
- }
43139
-
43140
- // pptx/core/utils/modern-comment-mentions.ts
43141
- var commonPrefixLength = (a, b) => {
43142
- const max = Math.min(a.length, b.length);
43143
- let index = 0;
43144
- while (index < max && a[index] === b[index]) {
43145
- index += 1;
43146
- }
43147
- return index;
43148
- };
43149
- var commonSuffixLength = (a, b, limit) => {
43150
- let index = 0;
43151
- while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
43152
- index += 1;
43153
- }
43154
- return index;
43155
- };
43156
- var nearestOccurrence = (text, span, hint) => {
43157
- let best = -1;
43158
- let bestDistance = Number.POSITIVE_INFINITY;
43159
- let at = text.indexOf(span);
43160
- while (at !== -1) {
43161
- const distance = Math.abs(at - hint);
43162
- if (distance < bestDistance) {
43163
- best = at;
43164
- bestDistance = distance;
43165
- }
43166
- at = text.indexOf(span, at + 1);
43167
- }
43168
- return best;
43169
- };
43170
- function rebaseCommentMentions(mentions, oldText, newText) {
43171
- if (!mentions || mentions.length === 0) {
43172
- return void 0;
43173
- }
43174
- if (oldText === newText) {
43175
- return mentions;
43176
- }
43177
- const prefix = commonPrefixLength(oldText, newText);
43178
- const suffix = commonSuffixLength(
43179
- oldText,
43180
- newText,
43181
- Math.min(oldText.length, newText.length) - prefix
43182
- );
43183
- const changeEnd = oldText.length - suffix;
43184
- const delta = newText.length - oldText.length;
43185
- const result = [];
43186
- for (const mention of mentions) {
43187
- const start = mention.startIndex;
43188
- const end = start + mention.length;
43189
- const span = oldText.slice(start, end);
43190
- if (span.length !== mention.length) {
43191
- continue;
43192
- }
43193
- let next = -1;
43194
- if (end <= prefix) {
43195
- next = start;
43196
- } else if (start >= changeEnd) {
43197
- next = start + delta;
43198
- }
43199
- if (next >= 0 && newText.slice(next, next + mention.length) === span) {
43200
- result.push(next === start ? mention : { ...mention, startIndex: next });
43201
- continue;
43202
- }
43203
- const relocated = nearestOccurrence(newText, span, next >= 0 ? next : start);
43204
- if (relocated >= 0) {
43205
- result.push({ ...mention, startIndex: relocated });
43206
- }
43207
- }
43208
- return result.length > 0 ? result : void 0;
43209
- }
43210
- var buildMention = (mention) => {
43211
- const node = {};
43212
- for (const [key2, value] of Object.entries(mention.rawXml || {})) {
43213
- if (key2.startsWith("@_")) {
43214
- node[key2] = value;
43215
- }
43216
- }
43217
- const personKey = MENTION_PERSON_KEYS.find((key2) => node[key2] !== void 0) || "@_mentionpersonId";
43218
- const lengthKey = MENTION_LENGTH_KEYS.find((key2) => node[key2] !== void 0) || "@_length";
43219
- node[personKey] = mention.personId;
43220
- node[lengthKey] = String(mention.length);
43221
- node["@_startIndex"] = String(mention.startIndex);
43222
- if (mention.id) {
43223
- const idKey = node["@_id"] !== void 0 && node["@_mentionId"] === void 0 ? "@_id" : "@_mentionId";
43224
- node[idKey] = mention.id;
43225
- }
43226
- return node;
43227
- };
43228
- function buildMentionListNode(mentions) {
43229
- if (!mentions || mentions.length === 0) {
43230
- return void 0;
43231
- }
43232
- return { "p188:mention": mentions.map(buildMention) };
43233
- }
43234
- var stripMentionLists = (node) => {
43235
- const result = {};
43236
- for (const [key2, value] of Object.entries(node)) {
43237
- if (key2.startsWith("@_") || mentionLocalName(key2) !== "mentionLst") {
43238
- result[key2] = value;
43239
- }
43240
- }
43241
- return result;
43242
- };
43243
- var groupByContainer = (mentions) => {
43244
- const direct = [];
43245
- const byUri = /* @__PURE__ */ new Map();
43246
- for (const mention of mentions || []) {
43247
- if (!mention.containerUri) {
43248
- direct.push(mention);
43249
- continue;
43250
- }
43251
- const bucket = byUri.get(mention.containerUri);
43252
- if (bucket) {
43253
- bucket.push(mention);
43254
- } else {
43255
- byUri.set(mention.containerUri, [mention]);
43256
- }
43257
- }
43258
- return { direct, byUri };
43259
- };
43260
- function applyCommentMentions(node, mentions, extension, replace) {
43261
- if (!replace) {
43262
- return extension;
43263
- }
43264
- const { direct, byUri } = groupByContainer(mentions);
43265
- const directList = buildMentionListNode(direct);
43266
- if (directList) {
43267
- node["p188:mentionLst"] = directList;
43268
- }
43269
- if (!extension) {
43270
- return void 0;
43271
- }
43272
- const rebuilt = stripMentionLists(extension);
43273
- const extensionKey = Object.keys(rebuilt).find((key2) => mentionLocalName(key2) === "ext") || "p188:ext";
43274
- const entries = mentionNodesOf(rebuilt[extensionKey]).map((entry2) => {
43275
- const list2 = buildMentionListNode(byUri.get(String(entry2["@_uri"] || "")));
43276
- const next = stripMentionLists(entry2);
43277
- if (list2) {
43278
- next["p188:mentionLst"] = list2;
43279
- }
43280
- return next;
43281
- });
43282
- if (entries.length > 0) {
43283
- rebuilt[extensionKey] = entries.length === 1 ? entries[0] : entries;
43284
- }
43285
- return rebuilt;
43286
- }
43287
-
43288
43055
  // pptx/core/utils/modern-comment-text-body.ts
43289
43056
  var localName4 = (key2) => key2.split(":").pop() || key2;
43290
43057
  var keyOf8 = (node, name) => Object.keys(node).find((key2) => localName4(key2) === name);
@@ -43324,7 +43091,7 @@ function flattenBodyText(node) {
43324
43091
  };
43325
43092
  return (paragraphs.length > 0 ? paragraphs : [node]).map((paragraph2) => collect(paragraph2));
43326
43093
  }
43327
- var commonPrefixLength2 = (a, b) => {
43094
+ var commonPrefixLength = (a, b) => {
43328
43095
  const max = Math.min(a.length, b.length);
43329
43096
  let index = 0;
43330
43097
  while (index < max && a[index] === b[index]) {
@@ -43332,7 +43099,7 @@ var commonPrefixLength2 = (a, b) => {
43332
43099
  }
43333
43100
  return index;
43334
43101
  };
43335
- var commonSuffixLength2 = (a, b, limit) => {
43102
+ var commonSuffixLength = (a, b, limit) => {
43336
43103
  let index = 0;
43337
43104
  while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
43338
43105
  index += 1;
@@ -43366,8 +43133,8 @@ function spliceParagraph(paragraph2, line) {
43366
43133
  if (runs.length === 0) {
43367
43134
  return { ...paragraph2, "a:r": bareRun(void 0, line) };
43368
43135
  }
43369
- const prefix = commonPrefixLength2(original, line);
43370
- const suffix = commonSuffixLength2(
43136
+ const prefix = commonPrefixLength(original, line);
43137
+ const suffix = commonSuffixLength(
43371
43138
  original,
43372
43139
  line,
43373
43140
  Math.min(original.length, line.length) - prefix
@@ -43579,7 +43346,7 @@ var buildComment = (comment, resolveAuthorId, emuPerPx, isReply = false) => {
43579
43346
  "@_authorId": resolveAuthorId(comment),
43580
43347
  "@_created": modernCommentCreated(comment.createdAt, raw2?.["@_created"])
43581
43348
  };
43582
- for (const [attribute3, value] of [
43349
+ for (const [attribute2, value] of [
43583
43350
  ["status", modernCommentStatus(comment, raw2 !== void 0, raw2?.["@_status"] !== void 0)],
43584
43351
  ["tags", comment.tags?.join(" ")],
43585
43352
  ["likes", comment.likes?.join(" ")],
@@ -43591,9 +43358,9 @@ var buildComment = (comment, resolveAuthorId, emuPerPx, isReply = false) => {
43591
43358
  ["title", comment.title]
43592
43359
  ]) {
43593
43360
  if (value === void 0) {
43594
- delete node[`@_${attribute3}`];
43361
+ delete node[`@_${attribute2}`];
43595
43362
  } else {
43596
- node[`@_${attribute3}`] = String(value);
43363
+ node[`@_${attribute2}`] = String(value);
43597
43364
  }
43598
43365
  }
43599
43366
  const ownsMentions = (comment.mentions?.length ?? 0) > 0;
@@ -43635,7 +43402,13 @@ var buildComment = (comment, resolveAuthorId, emuPerPx, isReply = false) => {
43635
43402
  const originalBody = child8(raw2, "txBody");
43636
43403
  node["p188:txBody"] = applyModernCommentText(originalBody, comment.text);
43637
43404
  const originalText = originalBody ? flattenBodyText(originalBody).join("\n") : comment.text;
43638
- const mentions = rebaseCommentMentions(comment.mentions, originalText, comment.text);
43405
+ const loadedMentions = raw2 ? readCommentMentions(raw2, () => void 0) : void 0;
43406
+ const mentions = rebaseCommentMentions(
43407
+ comment.mentions,
43408
+ originalText,
43409
+ comment.text,
43410
+ loadedMentions ?? []
43411
+ );
43639
43412
  const extension = applyCommentMentions(node, mentions, child8(raw2, "extLst"), ownsMentions);
43640
43413
  if (extension) {
43641
43414
  node["p188:extLst"] = extension;
@@ -53001,8 +52774,8 @@ function applyChartColorMapOverride(chartSpace, value, localName15) {
53001
52774
  return;
53002
52775
  }
53003
52776
  const node = {};
53004
- for (const [attribute3, attrValue] of Object.entries(value)) {
53005
- node[`@_${attribute3}`] = attrValue;
52777
+ for (const [attribute2, attrValue] of Object.entries(value)) {
52778
+ node[`@_${attribute2}`] = attrValue;
53006
52779
  }
53007
52780
  if (existingKey) {
53008
52781
  chartSpace[existingKey] = node;
@@ -69951,15 +69724,15 @@ var PptxHandlerRuntime39 = class _PptxHandlerRuntime extends PptxHandlerRuntime3
69951
69724
  this.applyModel3DTransformFlags(transform2, el);
69952
69725
  }
69953
69726
  applyModel3DTransformFlags(transform2, el) {
69954
- for (const [attribute3, value] of [
69727
+ for (const [attribute2, value] of [
69955
69728
  ["@_rot", el.rotation],
69956
69729
  ["@_skewX", el.skewX],
69957
69730
  ["@_skewY", el.skewY]
69958
69731
  ]) {
69959
69732
  if (value === void 0) {
69960
- delete transform2[attribute3];
69733
+ delete transform2[attribute2];
69961
69734
  } else {
69962
- transform2[attribute3] = String(Math.round(value * 6e4));
69735
+ transform2[attribute2] = String(Math.round(value * 6e4));
69963
69736
  }
69964
69737
  }
69965
69738
  if (el.flipHorizontal) {
@@ -74692,7 +74465,13 @@ var PptxHandlerRuntime55 = class _PptxHandlerRuntime extends PptxHandlerRuntime5
74692
74465
  if (posterRId && relsMap) {
74693
74466
  const posterTarget = relsMap.get(posterRId);
74694
74467
  if (posterTarget) {
74695
- if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://") || posterTarget.startsWith("data:")) {
74468
+ if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")) {
74469
+ if (this.allowExternalImages === true) {
74470
+ posterImage = posterTarget;
74471
+ imagePath = posterTarget;
74472
+ imageData = posterTarget;
74473
+ }
74474
+ } else if (posterTarget.startsWith("data:")) {
74696
74475
  posterImage = posterTarget;
74697
74476
  imagePath = posterTarget;
74698
74477
  imageData = posterTarget;
@@ -75822,7 +75601,12 @@ var PptxHandlerRuntime61 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
75822
75601
  const slideRels = this.slideRelsMap.get(slidePath);
75823
75602
  const target = slideRels?.get(relId);
75824
75603
  if (target) {
75825
- if (target.startsWith("http://") || target.startsWith("https://") || target.startsWith("data:")) {
75604
+ if (target.startsWith("http://") || target.startsWith("https://")) {
75605
+ if (this.allowExternalImages === true) {
75606
+ imagePath = target;
75607
+ imageData = target;
75608
+ }
75609
+ } else if (target.startsWith("data:")) {
75826
75610
  imagePath = target;
75827
75611
  imageData = target;
75828
75612
  } else {
@@ -76276,7 +76060,9 @@ var PptxHandlerRuntime63 = class extends PptxHandlerRuntime62 {
76276
76060
  const target = slideRels?.get(imageRelId);
76277
76061
  let imageDataUrl;
76278
76062
  if (target) {
76279
- if (target.startsWith("http://") || target.startsWith("https://") || target.startsWith("data:")) {
76063
+ if (target.startsWith("http://") || target.startsWith("https://")) {
76064
+ imageDataUrl = this.allowExternalImages === true ? target : void 0;
76065
+ } else if (target.startsWith("data:")) {
76280
76066
  imageDataUrl = target;
76281
76067
  } else {
76282
76068
  const imagePath = this.resolveImagePath(slidePath, target);
@@ -85582,6 +85368,7 @@ var PptxHandlerRuntime100 = class _PptxHandlerRuntime extends PptxHandlerRuntime
85582
85368
  async enrichBulletPictureElementsWithEmbeddedData(elements2, slidePath) {
85583
85369
  await enrichBulletPictureImages(elements2, slidePath, {
85584
85370
  slideRelsMap: this.slideRelsMap,
85371
+ allowExternalImages: this.allowExternalImages === true,
85585
85372
  resolveImagePath: (path3, target) => this.resolveImagePath(path3, target),
85586
85373
  getImageData: (imagePath) => this.getImageData(imagePath)
85587
85374
  });