ooxml-core 1.27.1 → 1.27.2
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/{PptxHandler-NHOKKZ4S.cjs → PptxHandler-FRQKHTCM.cjs} +2 -2
- package/dist/{PptxHandler-TZJNIXPX.mjs → PptxHandler-RETSKQ5E.mjs} +1 -1
- package/dist/{PptxHandler-OIR3ZY4Q.mjs → PptxHandler-WRJXTPGV.mjs} +2 -2
- package/dist/{PresentationBuilder-X5WFSHLB.mjs → PresentationBuilder-LWR5X3JA.mjs} +2 -2
- package/dist/{PresentationBuilder-RFTSZUPR.mjs → PresentationBuilder-POXKHTV7.mjs} +1 -1
- package/dist/{PresentationBuilder-EX6DAE5X.cjs → PresentationBuilder-YO5YOTA3.cjs} +4 -4
- package/dist/{chunk-BXZF7H5G.mjs → chunk-3VIPI6IA.mjs} +4 -4
- package/dist/{chunk-5KJAQKZG.mjs → chunk-6LCBTFNL.mjs} +213 -110
- package/dist/{chunk-5NJPYCGO.mjs → chunk-G67MARDL.mjs} +1 -1
- package/dist/{chunk-DMJIDRJE.cjs → chunk-K6DNX3YC.cjs} +212 -109
- package/dist/{chunk-GZ4DIXZZ.mjs → chunk-RNUYMB73.mjs} +212 -109
- package/dist/{chunk-QIMNQDON.mjs → chunk-TIQWSSGI.mjs} +1 -1
- package/dist/{chunk-ZWTXVWMY.mjs → chunk-XW4XB6P4.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +224 -109
- package/dist/pptx/automation/index.d.ts +3 -3
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts → index-CdRlUz-v.d.ts} +2 -2
- package/dist/pptx/chunks/{index-D4FnOx6x.d.ts.map → index-CdRlUz-v.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-D8DNpc1X.d.ts → index-D_d4NTVP.d.ts} +36 -3
- package/dist/pptx/chunks/index-D_d4NTVP.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts → index-lwMA6pP5.d.ts} +3 -3
- package/dist/pptx/chunks/{index-GWpMAY-f.d.ts.map → index-lwMA6pP5.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +224 -109
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +1 -1
- package/dist/pptx/index.cjs +224 -109
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +0 -1
package/dist/pptx/index.cjs
CHANGED
|
@@ -83695,6 +83695,96 @@ var init_background_fill_shapes = __esm({
|
|
|
83695
83695
|
}
|
|
83696
83696
|
});
|
|
83697
83697
|
|
|
83698
|
+
// pptx/core/core/runtime/load-part-reader.ts
|
|
83699
|
+
function parseText3(parser, text2) {
|
|
83700
|
+
return text2 ? parser.parse(text2) : void 0;
|
|
83701
|
+
}
|
|
83702
|
+
function readPartText(zip, path3) {
|
|
83703
|
+
const reader2 = openReaders.get(zip);
|
|
83704
|
+
if (reader2) {
|
|
83705
|
+
return reader2.readText(path3);
|
|
83706
|
+
}
|
|
83707
|
+
return zip.file(path3)?.async("string") ?? Promise.resolve(void 0);
|
|
83708
|
+
}
|
|
83709
|
+
async function readPartXml(zip, parser, path3) {
|
|
83710
|
+
const reader2 = openReaders.get(zip);
|
|
83711
|
+
if (reader2) {
|
|
83712
|
+
return reader2.readXml(parser, path3);
|
|
83713
|
+
}
|
|
83714
|
+
const text2 = await zip.file(path3)?.async("string");
|
|
83715
|
+
return text2 ? parseText3(parser, text2) : void 0;
|
|
83716
|
+
}
|
|
83717
|
+
var openReaders, LoadPartReader;
|
|
83718
|
+
var init_load_part_reader = __esm({
|
|
83719
|
+
"pptx/core/core/runtime/load-part-reader.ts"() {
|
|
83720
|
+
openReaders = /* @__PURE__ */ new WeakMap();
|
|
83721
|
+
LoadPartReader = class {
|
|
83722
|
+
constructor(zip) {
|
|
83723
|
+
this.zip = zip;
|
|
83724
|
+
openReaders.set(zip, this);
|
|
83725
|
+
}
|
|
83726
|
+
zip;
|
|
83727
|
+
parts = /* @__PURE__ */ new Map();
|
|
83728
|
+
closed = false;
|
|
83729
|
+
entry(path3) {
|
|
83730
|
+
const file = this.zip.file(path3);
|
|
83731
|
+
if (!file) {
|
|
83732
|
+
this.parts.delete(path3);
|
|
83733
|
+
return void 0;
|
|
83734
|
+
}
|
|
83735
|
+
const previous = this.parts.get(path3);
|
|
83736
|
+
if (previous?.file === file) {
|
|
83737
|
+
return previous;
|
|
83738
|
+
}
|
|
83739
|
+
const entry2 = { file, text: file.async("string"), relationships: /* @__PURE__ */ new Map() };
|
|
83740
|
+
this.parts.set(path3, entry2);
|
|
83741
|
+
entry2.text.catch(() => {
|
|
83742
|
+
if (this.parts.get(path3) === entry2) {
|
|
83743
|
+
this.parts.delete(path3);
|
|
83744
|
+
}
|
|
83745
|
+
});
|
|
83746
|
+
return entry2;
|
|
83747
|
+
}
|
|
83748
|
+
readText(path3) {
|
|
83749
|
+
return this.entry(path3)?.text ?? Promise.resolve(void 0);
|
|
83750
|
+
}
|
|
83751
|
+
async readXml(parser, path3) {
|
|
83752
|
+
const entry2 = this.entry(path3);
|
|
83753
|
+
if (!entry2) {
|
|
83754
|
+
return void 0;
|
|
83755
|
+
}
|
|
83756
|
+
if (!path3.endsWith(".rels")) {
|
|
83757
|
+
return parseText3(parser, await entry2.text);
|
|
83758
|
+
}
|
|
83759
|
+
let parsed = entry2.relationships.get(parser);
|
|
83760
|
+
if (!parsed) {
|
|
83761
|
+
const pending = entry2.text.then((text2) => parseText3(parser, text2));
|
|
83762
|
+
entry2.relationships.set(parser, pending);
|
|
83763
|
+
pending.catch(() => {
|
|
83764
|
+
if (entry2.relationships.get(parser) === pending) {
|
|
83765
|
+
entry2.relationships.delete(parser);
|
|
83766
|
+
}
|
|
83767
|
+
});
|
|
83768
|
+
parsed = pending;
|
|
83769
|
+
}
|
|
83770
|
+
return structuredClone(await parsed);
|
|
83771
|
+
}
|
|
83772
|
+
/** Whether this reader still serves reads for its package. */
|
|
83773
|
+
get isOpen() {
|
|
83774
|
+
return !this.closed;
|
|
83775
|
+
}
|
|
83776
|
+
/** Drops every cached read; later reads of the package go to the archive. */
|
|
83777
|
+
close() {
|
|
83778
|
+
this.closed = true;
|
|
83779
|
+
if (openReaders.get(this.zip) === this) {
|
|
83780
|
+
openReaders.delete(this.zip);
|
|
83781
|
+
}
|
|
83782
|
+
this.parts.clear();
|
|
83783
|
+
}
|
|
83784
|
+
};
|
|
83785
|
+
}
|
|
83786
|
+
});
|
|
83787
|
+
|
|
83698
83788
|
// pptx/core/core/builders/element-hidden-flag.ts
|
|
83699
83789
|
function findCNvPr(shape) {
|
|
83700
83790
|
if (!shape) {
|
|
@@ -83768,11 +83858,10 @@ var init_flatten_elements = __esm({
|
|
|
83768
83858
|
|
|
83769
83859
|
// pptx/core/utils/slide-synchronization.ts
|
|
83770
83860
|
async function loadSlideSynchronization(input) {
|
|
83771
|
-
const
|
|
83772
|
-
if (!
|
|
83861
|
+
const relsData = await readPartXml(input.zip, input.parser, input.relsPath);
|
|
83862
|
+
if (!relsData) {
|
|
83773
83863
|
return void 0;
|
|
83774
83864
|
}
|
|
83775
|
-
const relsData = input.parser.parse(relsXml);
|
|
83776
83865
|
const relationship2 = findSlideSyncRelationship(relsData);
|
|
83777
83866
|
if (!relationship2) {
|
|
83778
83867
|
return void 0;
|
|
@@ -83782,7 +83871,7 @@ async function loadSlideSynchronization(input) {
|
|
|
83782
83871
|
return void 0;
|
|
83783
83872
|
}
|
|
83784
83873
|
const partPath = resolvePartPath2(input.slidePath, target);
|
|
83785
|
-
const partXml = await input.zip
|
|
83874
|
+
const partXml = await readPartText(input.zip, partPath);
|
|
83786
83875
|
if (!partXml) {
|
|
83787
83876
|
return void 0;
|
|
83788
83877
|
}
|
|
@@ -83903,6 +83992,7 @@ function nextSlideSyncPath(files) {
|
|
|
83903
83992
|
var SLIDE_SYNC_CONTENT_TYPE;
|
|
83904
83993
|
var init_slide_synchronization = __esm({
|
|
83905
83994
|
"pptx/core/utils/slide-synchronization.ts"() {
|
|
83995
|
+
init_load_part_reader();
|
|
83906
83996
|
SLIDE_SYNC_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slideSyncData+xml";
|
|
83907
83997
|
}
|
|
83908
83998
|
});
|
|
@@ -83916,11 +84006,10 @@ function ensureArray9(value) {
|
|
|
83916
84006
|
}
|
|
83917
84007
|
async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
83918
84008
|
try {
|
|
83919
|
-
const
|
|
83920
|
-
if (!
|
|
84009
|
+
const relsData = await readPartXml(zip, parser, relsPath2);
|
|
84010
|
+
if (!relsData) {
|
|
83921
84011
|
return [];
|
|
83922
84012
|
}
|
|
83923
|
-
const relsData = parser.parse(relsXml);
|
|
83924
84013
|
const relationships3 = ensureArray9(
|
|
83925
84014
|
relsData["Relationships"]?.["Relationship"]
|
|
83926
84015
|
);
|
|
@@ -83943,7 +84032,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
83943
84032
|
if (!resolved) {
|
|
83944
84033
|
continue;
|
|
83945
84034
|
}
|
|
83946
|
-
const vmlXml = await zip
|
|
84035
|
+
const vmlXml = await readPartText(zip, resolved);
|
|
83947
84036
|
if (!vmlXml) {
|
|
83948
84037
|
continue;
|
|
83949
84038
|
}
|
|
@@ -83962,6 +84051,7 @@ async function loadLegacyVmlDrawings(zip, parser, slidePath, relsPath2) {
|
|
|
83962
84051
|
var VML_DRAWING_REL_SUFFIX;
|
|
83963
84052
|
var init_vml_drawing_loader = __esm({
|
|
83964
84053
|
"pptx/core/utils/vml-drawing-loader.ts"() {
|
|
84054
|
+
init_load_part_reader();
|
|
83965
84055
|
init_safe_path();
|
|
83966
84056
|
init_vml_parser();
|
|
83967
84057
|
VML_DRAWING_REL_SUFFIX = "/relationships/vmlDrawing";
|
|
@@ -86691,6 +86781,7 @@ exports.PptxSlideLoaderService = void 0;
|
|
|
86691
86781
|
var init_PptxSlideLoaderService = __esm({
|
|
86692
86782
|
"pptx/core/services/PptxSlideLoaderService.ts"() {
|
|
86693
86783
|
init_background_fill_shapes();
|
|
86784
|
+
init_load_part_reader();
|
|
86694
86785
|
init_element_hidden_flag();
|
|
86695
86786
|
init_background_style_ref();
|
|
86696
86787
|
init_flatten_elements();
|
|
@@ -86751,11 +86842,14 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
86751
86842
|
* @returns Map of relationship ID to target path string.
|
|
86752
86843
|
*/
|
|
86753
86844
|
async loadPresentationSlideRels(params) {
|
|
86754
|
-
const
|
|
86755
|
-
|
|
86845
|
+
const relsData = await readPartXml(
|
|
86846
|
+
params.zip,
|
|
86847
|
+
params.parser,
|
|
86848
|
+
"ppt/_rels/presentation.xml.rels"
|
|
86849
|
+
);
|
|
86850
|
+
if (!relsData) {
|
|
86756
86851
|
return /* @__PURE__ */ new Map();
|
|
86757
86852
|
}
|
|
86758
|
-
const relsData = params.parser.parse(relsXml);
|
|
86759
86853
|
const relationships3 = relsData["Relationships"]?.["Relationship"];
|
|
86760
86854
|
const relNodes = this.toXmlObjectArray(relationships3);
|
|
86761
86855
|
const relsMap = /* @__PURE__ */ new Map();
|
|
@@ -86795,7 +86889,7 @@ var init_PptxSlideLoaderService = __esm({
|
|
|
86795
86889
|
if (!params.zip.file(path3)) {
|
|
86796
86890
|
path3 = `ppt/${target}`;
|
|
86797
86891
|
}
|
|
86798
|
-
const slideXmlStr = await params.zip
|
|
86892
|
+
const slideXmlStr = await readPartText(params.zip, path3);
|
|
86799
86893
|
if (!slideXmlStr) {
|
|
86800
86894
|
return void 0;
|
|
86801
86895
|
}
|
|
@@ -111292,12 +111386,11 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
111292
111386
|
if (!external.targetPath || !external.embeddedWorkbookData) return false;
|
|
111293
111387
|
const target = resolve(chartPartPath, external.targetPath);
|
|
111294
111388
|
let references = 0;
|
|
111295
|
-
const parser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
111296
111389
|
try {
|
|
111297
111390
|
for (const path3 of Object.keys(zip.files)) {
|
|
111298
111391
|
if (!path3.endsWith(".rels") || !path3.includes("/_rels/")) continue;
|
|
111299
111392
|
const source = path3.replace("/_rels/", "/").slice(0, -5);
|
|
111300
|
-
const tree =
|
|
111393
|
+
const tree = await readPartXml(zip, relationshipParser, path3);
|
|
111301
111394
|
for (const rel of xmlChildren(xmlChild(tree, "Relationships"), "Relationship")) {
|
|
111302
111395
|
const relationshipTarget2 = xmlAttr(rel, "Target");
|
|
111303
111396
|
if (relationshipTarget2 && xmlAttr(rel, "TargetMode") !== "External" && resolve(source, relationshipTarget2) === target)
|
|
@@ -111314,11 +111407,14 @@ async function chartLabelsHaveEditableSources(xml, zip, chartSpace, seriesNodes,
|
|
|
111314
111407
|
return false;
|
|
111315
111408
|
}
|
|
111316
111409
|
}
|
|
111410
|
+
var relationshipParser;
|
|
111317
111411
|
var init_chart_label_source = __esm({
|
|
111318
111412
|
"pptx/core/utils/chart-label-source.ts"() {
|
|
111413
|
+
init_load_part_reader();
|
|
111319
111414
|
init_chart_xlsx_writer();
|
|
111320
111415
|
init_xml_access();
|
|
111321
111416
|
init_chart_xlsx_cellref();
|
|
111417
|
+
relationshipParser = new fastXmlParser.XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
111322
111418
|
}
|
|
111323
111419
|
});
|
|
111324
111420
|
|
|
@@ -113824,7 +113920,7 @@ function parseChartData(context, element) {
|
|
|
113824
113920
|
}
|
|
113825
113921
|
return out;
|
|
113826
113922
|
}
|
|
113827
|
-
function
|
|
113923
|
+
function parseText4(context, element) {
|
|
113828
113924
|
if (!element) return void 0;
|
|
113829
113925
|
reportUnmodelled2(context, element, /* @__PURE__ */ new Set(["txData", "rich"]));
|
|
113830
113926
|
const data = cxChild(element, "txData");
|
|
@@ -113844,7 +113940,7 @@ function parseTitle2(context, element) {
|
|
|
113844
113940
|
return assignDefined(
|
|
113845
113941
|
{},
|
|
113846
113942
|
{
|
|
113847
|
-
tx:
|
|
113943
|
+
tx: parseText4(context, cxChild(element, "tx")),
|
|
113848
113944
|
spPr: shapeProperties2(element),
|
|
113849
113945
|
txPr: textProperties2(element),
|
|
113850
113946
|
position: attribute6(element, "pos"),
|
|
@@ -114089,7 +114185,7 @@ function parseSeries2(context, element) {
|
|
|
114089
114185
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
114090
114186
|
uniqueId: attribute6(element, "uniqueId"),
|
|
114091
114187
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
114092
|
-
tx:
|
|
114188
|
+
tx: parseText4(context, cxChild(element, "tx")),
|
|
114093
114189
|
spPr: shapeProperties2(element),
|
|
114094
114190
|
txPr: textProperties2(element),
|
|
114095
114191
|
valueColorsXml: rawChild2(element, "valueColors"),
|
|
@@ -127709,8 +127805,8 @@ async function discoverTagCollections(zip, codec) {
|
|
|
127709
127805
|
if (!sourcePartPath) {
|
|
127710
127806
|
continue;
|
|
127711
127807
|
}
|
|
127712
|
-
const data =
|
|
127713
|
-
const root = data["Relationships"];
|
|
127808
|
+
const data = await readPartXml(zip, codec, relFile.name);
|
|
127809
|
+
const root = data?.["Relationships"];
|
|
127714
127810
|
for (const relationship2 of ensureArray17(root?.["Relationship"])) {
|
|
127715
127811
|
if (String(relationship2["@_Type"] ?? "") !== TAG_RELATIONSHIP_TYPE) {
|
|
127716
127812
|
continue;
|
|
@@ -127815,7 +127911,7 @@ async function removeTagContentTypeOverride(zip, codec, path3) {
|
|
|
127815
127911
|
zip.file("[Content_Types].xml", codec.build(data));
|
|
127816
127912
|
}
|
|
127817
127913
|
async function readTagCollection(zip, codec, path3) {
|
|
127818
|
-
const xml = await zip
|
|
127914
|
+
const xml = await readPartText(zip, path3);
|
|
127819
127915
|
if (!xml) {
|
|
127820
127916
|
return void 0;
|
|
127821
127917
|
}
|
|
@@ -127924,6 +128020,7 @@ function ensureArray17(value) {
|
|
|
127924
128020
|
var TAG_RELATIONSHIP_TYPE, TAG_CONTENT_TYPE;
|
|
127925
128021
|
var init_tag_package = __esm({
|
|
127926
128022
|
"pptx/core/utils/tag-package.ts"() {
|
|
128023
|
+
init_load_part_reader();
|
|
127927
128024
|
init_safe_path();
|
|
127928
128025
|
init_tag_package_owning_element();
|
|
127929
128026
|
TAG_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tags";
|
|
@@ -133257,10 +133354,35 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
133257
133354
|
"pptx/core/core/runtime/PptxHandlerRuntimeState.ts"() {
|
|
133258
133355
|
init_utils();
|
|
133259
133356
|
init_part_rels_path();
|
|
133357
|
+
init_load_part_reader();
|
|
133260
133358
|
init_template_element_baselines();
|
|
133261
133359
|
PptxHandlerRuntime = class {
|
|
133262
133360
|
/** The in-memory ZIP archive representing the OPC (.pptx) package. */
|
|
133263
133361
|
zip;
|
|
133362
|
+
/** Shares part reads within the load in progress; see {@link LoadPartReader}. */
|
|
133363
|
+
loadPartReader;
|
|
133364
|
+
/** Opens a part reader for the current package, closing any earlier one. */
|
|
133365
|
+
beginPartReads() {
|
|
133366
|
+
this.endPartReads();
|
|
133367
|
+
const reader2 = new LoadPartReader(this.zip);
|
|
133368
|
+
this.loadPartReader = reader2;
|
|
133369
|
+
return reader2;
|
|
133370
|
+
}
|
|
133371
|
+
/** Closes `reader` (by default the open one) and releases its cached reads. */
|
|
133372
|
+
endPartReads(reader2 = this.loadPartReader) {
|
|
133373
|
+
reader2?.close();
|
|
133374
|
+
if (reader2 && this.loadPartReader === reader2) {
|
|
133375
|
+
this.loadPartReader = void 0;
|
|
133376
|
+
}
|
|
133377
|
+
}
|
|
133378
|
+
/** The text of a package part, shared within a load. */
|
|
133379
|
+
readPartText(path3) {
|
|
133380
|
+
return readPartText(this.zip, path3);
|
|
133381
|
+
}
|
|
133382
|
+
/** A parsed package part; relationship parts are parsed once per load. */
|
|
133383
|
+
readPartXml(path3) {
|
|
133384
|
+
return readPartXml(this.zip, this.parser, path3);
|
|
133385
|
+
}
|
|
133264
133386
|
/** fast-xml-parser instance used to parse XML strings into JS objects. */
|
|
133265
133387
|
parser;
|
|
133266
133388
|
/** fast-xml-parser builder used to serialize JS objects back to XML strings. */
|
|
@@ -133679,11 +133801,11 @@ var init_PptxHandlerRuntimeState = __esm({
|
|
|
133679
133801
|
* @param relsPath - Path of the `.rels` part; derived from `partPath` when omitted.
|
|
133680
133802
|
*/
|
|
133681
133803
|
async loadPartRelationships(partPath, relsPath2) {
|
|
133682
|
-
const
|
|
133683
|
-
|
|
133804
|
+
const path3 = relsPath2 ?? partRelsPath(partPath);
|
|
133805
|
+
const relsData = await this.readPartXml(path3);
|
|
133806
|
+
if (!relsData) {
|
|
133684
133807
|
return;
|
|
133685
133808
|
}
|
|
133686
|
-
const relsData = this.parser.parse(relsXml);
|
|
133687
133809
|
const relationships3 = relsData?.["Relationships"];
|
|
133688
133810
|
const raw2 = relationships3?.["Relationship"];
|
|
133689
133811
|
const entries = Array.isArray(raw2) ? raw2 : raw2 ? [raw2] : [];
|
|
@@ -135212,10 +135334,6 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
135212
135334
|
this.zip.file(relsPath2, this.builder.build(relsData));
|
|
135213
135335
|
return true;
|
|
135214
135336
|
}
|
|
135215
|
-
/** The text of a package part, or `undefined` when the package has no such part. */
|
|
135216
|
-
async readPartText(path3) {
|
|
135217
|
-
return this.zip.file(path3)?.async("string");
|
|
135218
|
-
}
|
|
135219
135337
|
/**
|
|
135220
135338
|
* Parse extended (application) properties from `docProps/app.xml`.
|
|
135221
135339
|
*/
|
|
@@ -135276,8 +135394,10 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
135276
135394
|
if (!relsFile) {
|
|
135277
135395
|
return [];
|
|
135278
135396
|
}
|
|
135279
|
-
const
|
|
135280
|
-
|
|
135397
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
135398
|
+
if (!relsData) {
|
|
135399
|
+
return [];
|
|
135400
|
+
}
|
|
135281
135401
|
const relRoot = relsData["Relationships"] || {};
|
|
135282
135402
|
const relationships3 = this.ensureArray(relRoot["Relationship"]);
|
|
135283
135403
|
const relMap = /* @__PURE__ */ new Map();
|
|
@@ -135308,7 +135428,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
135308
135428
|
try {
|
|
135309
135429
|
const file = this.zip.file(resolvedPath);
|
|
135310
135430
|
if (file) {
|
|
135311
|
-
data = await
|
|
135431
|
+
data = await this.readPartText(resolvedPath);
|
|
135312
135432
|
}
|
|
135313
135433
|
} catch {
|
|
135314
135434
|
}
|
|
@@ -135388,9 +135508,7 @@ var init_PptxHandlerRuntimeDocProperties = __esm({
|
|
|
135388
135508
|
*/
|
|
135389
135509
|
async parseTags() {
|
|
135390
135510
|
try {
|
|
135391
|
-
return await discoverTagCollections(this.zip,
|
|
135392
|
-
parse: (xml) => this.parser.parse(xml)
|
|
135393
|
-
});
|
|
135511
|
+
return await discoverTagCollections(this.zip, this.parser);
|
|
135394
135512
|
} catch (e) {
|
|
135395
135513
|
console.warn("Failed to parse tags:", e);
|
|
135396
135514
|
return [];
|
|
@@ -135530,7 +135648,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135530
135648
|
}
|
|
135531
135649
|
for (const file of masterFiles) {
|
|
135532
135650
|
const path3 = file.name;
|
|
135533
|
-
const xml = await
|
|
135651
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
135534
135652
|
const data = this.parser.parse(xml);
|
|
135535
135653
|
const sldMaster = data?.["p:sldMaster"];
|
|
135536
135654
|
if (!sldMaster) {
|
|
@@ -135555,8 +135673,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135555
135673
|
);
|
|
135556
135674
|
const relsFile = this.zip.file(relsPath2);
|
|
135557
135675
|
if (relsFile) {
|
|
135558
|
-
const
|
|
135559
|
-
const relsData = this.parser.parse(relsXml);
|
|
135676
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
135560
135677
|
const rels = this.ensureArray(
|
|
135561
135678
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
135562
135679
|
);
|
|
@@ -135570,8 +135687,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135570
135687
|
}
|
|
135571
135688
|
const layoutPaths = [];
|
|
135572
135689
|
if (relsFile) {
|
|
135573
|
-
const
|
|
135574
|
-
const relsData = this.parser.parse(relsXml);
|
|
135690
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
135575
135691
|
const rels = this.ensureArray(
|
|
135576
135692
|
xmlChild(relsData, "Relationships")?.["Relationship"]
|
|
135577
135693
|
);
|
|
@@ -135615,7 +135731,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135615
135731
|
return void 0;
|
|
135616
135732
|
}
|
|
135617
135733
|
const path3 = files[0].name;
|
|
135618
|
-
const xml = await
|
|
135734
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
135619
135735
|
const data = this.parser.parse(xml);
|
|
135620
135736
|
const master = data?.["p:handoutMaster"];
|
|
135621
135737
|
if (!master) {
|
|
@@ -135647,7 +135763,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135647
135763
|
return void 0;
|
|
135648
135764
|
}
|
|
135649
135765
|
const path3 = files[0].name;
|
|
135650
|
-
const xml = await
|
|
135766
|
+
const xml = await this.readPartText(path3) ?? "";
|
|
135651
135767
|
const data = this.parser.parse(xml);
|
|
135652
135768
|
const master = data?.["p:notesMaster"];
|
|
135653
135769
|
if (!master) {
|
|
@@ -135678,7 +135794,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
135678
135794
|
if (!layoutFile) {
|
|
135679
135795
|
return void 0;
|
|
135680
135796
|
}
|
|
135681
|
-
const xml = await
|
|
135797
|
+
const xml = await this.readPartText(layoutPath) ?? "";
|
|
135682
135798
|
const data = this.parser.parse(xml);
|
|
135683
135799
|
const sldLayout = data?.["p:sldLayout"];
|
|
135684
135800
|
if (!sldLayout) {
|
|
@@ -135786,18 +135902,19 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
135786
135902
|
*/
|
|
135787
135903
|
async parsePresentationProperties() {
|
|
135788
135904
|
try {
|
|
135789
|
-
const
|
|
135790
|
-
if (!
|
|
135905
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
135906
|
+
if (!relsData) {
|
|
135791
135907
|
return void 0;
|
|
135792
135908
|
}
|
|
135793
|
-
const
|
|
135794
|
-
|
|
135909
|
+
const rels = this.ensureArray(
|
|
135910
|
+
relsData.Relationships?.Relationship
|
|
135911
|
+
);
|
|
135795
135912
|
const prRel = rels.find(
|
|
135796
135913
|
(r) => String(r?.["@_Type"] || "").includes("presProps") || String(r?.["@_Target"] || "").includes("presProps")
|
|
135797
135914
|
);
|
|
135798
135915
|
const prTarget = prRel ? String(prRel["@_Target"] || "") : "presProps.xml";
|
|
135799
135916
|
const prPath = prTarget.startsWith("/") ? prTarget.substring(1) : `ppt/${prTarget}`;
|
|
135800
|
-
const prXmlStr = await this.
|
|
135917
|
+
const prXmlStr = await this.readPartText(prPath);
|
|
135801
135918
|
if (!prXmlStr) {
|
|
135802
135919
|
return void 0;
|
|
135803
135920
|
}
|
|
@@ -135843,7 +135960,7 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
135843
135960
|
*/
|
|
135844
135961
|
async parseViewProperties() {
|
|
135845
135962
|
try {
|
|
135846
|
-
const viewPropsXml2 = await this.
|
|
135963
|
+
const viewPropsXml2 = await this.readPartText("ppt/viewProps.xml");
|
|
135847
135964
|
if (!viewPropsXml2) {
|
|
135848
135965
|
return void 0;
|
|
135849
135966
|
}
|
|
@@ -140345,7 +140462,7 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
140345
140462
|
if (existingRel?.target) {
|
|
140346
140463
|
drawingPath = this.resolveImagePath(chartPartPath, existingRel.target);
|
|
140347
140464
|
try {
|
|
140348
|
-
const xml = await this.
|
|
140465
|
+
const xml = await this.readPartText(drawingPath);
|
|
140349
140466
|
if (xml) {
|
|
140350
140467
|
const root = this.parser.parse(xml);
|
|
140351
140468
|
onDisk = parseChartUserShapesDrawing(root, this.xmlLookupService, {
|
|
@@ -140396,11 +140513,10 @@ var init_PptxHandlerRuntimeChartUserShapes = __esm({
|
|
|
140396
140513
|
const slash = chartPartPath.lastIndexOf("/");
|
|
140397
140514
|
const relsPath2 = `${chartPartPath.slice(0, slash + 1)}_rels/${chartPartPath.slice(slash + 1)}.rels`;
|
|
140398
140515
|
try {
|
|
140399
|
-
const
|
|
140400
|
-
if (!
|
|
140516
|
+
const tree = await this.readPartXml(relsPath2);
|
|
140517
|
+
if (!tree) {
|
|
140401
140518
|
return void 0;
|
|
140402
140519
|
}
|
|
140403
|
-
const tree = this.parser.parse(xml);
|
|
140404
140520
|
const root = tree["Relationships"];
|
|
140405
140521
|
const rels = root?.["Relationship"];
|
|
140406
140522
|
const list3 = rels === void 0 ? [] : Array.isArray(rels) ? rels : [rels];
|
|
@@ -156251,7 +156367,7 @@ var init_PptxHandlerRuntimeSlideParsing = __esm({
|
|
|
156251
156367
|
this.unwrapAlternateContent(spTree);
|
|
156252
156368
|
let rawXmlStr;
|
|
156253
156369
|
try {
|
|
156254
|
-
rawXmlStr = await this.
|
|
156370
|
+
rawXmlStr = await this.readPartText(slidePath);
|
|
156255
156371
|
} catch {
|
|
156256
156372
|
}
|
|
156257
156373
|
const slidePrefix = slidePath ? `${slidePath}-` : "";
|
|
@@ -156820,7 +156936,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
156820
156936
|
if (cached) {
|
|
156821
156937
|
return cached;
|
|
156822
156938
|
}
|
|
156823
|
-
const xml = await this.
|
|
156939
|
+
const xml = await this.readPartText(layoutPath);
|
|
156824
156940
|
if (!xml) {
|
|
156825
156941
|
return void 0;
|
|
156826
156942
|
}
|
|
@@ -156834,7 +156950,7 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
156834
156950
|
if (cached) {
|
|
156835
156951
|
return cached;
|
|
156836
156952
|
}
|
|
156837
|
-
const xml = await this.
|
|
156953
|
+
const xml = await this.readPartText(masterPath);
|
|
156838
156954
|
if (!xml) {
|
|
156839
156955
|
return void 0;
|
|
156840
156956
|
}
|
|
@@ -157294,7 +157410,7 @@ var init_PptxHandlerRuntimeSlideUtils = __esm({
|
|
|
157294
157410
|
if (!notesPath) {
|
|
157295
157411
|
return {};
|
|
157296
157412
|
}
|
|
157297
|
-
const notesXml = await this.
|
|
157413
|
+
const notesXml = await this.readPartText(notesPath);
|
|
157298
157414
|
if (!notesXml) {
|
|
157299
157415
|
return {};
|
|
157300
157416
|
}
|
|
@@ -157793,7 +157909,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
157793
157909
|
try {
|
|
157794
157910
|
let masterXmlObj = this.masterXmlMap.get(master.path);
|
|
157795
157911
|
if (!masterXmlObj) {
|
|
157796
|
-
const xmlStr = await this.
|
|
157912
|
+
const xmlStr = await this.readPartText(master.path);
|
|
157797
157913
|
if (!xmlStr) {
|
|
157798
157914
|
continue;
|
|
157799
157915
|
}
|
|
@@ -157866,7 +157982,7 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
157866
157982
|
}
|
|
157867
157983
|
const masterToken = masterPath.split("/").pop()?.replace(/\.xml$/u, "") ?? masterPath;
|
|
157868
157984
|
try {
|
|
157869
|
-
const masterXmlStr = await this.
|
|
157985
|
+
const masterXmlStr = await this.readPartText(masterPath);
|
|
157870
157986
|
if (!masterXmlStr) {
|
|
157871
157987
|
return [];
|
|
157872
157988
|
}
|
|
@@ -158028,7 +158144,7 @@ var init_PptxHandlerRuntimeAuxiliaryMasterElements = __esm({
|
|
|
158028
158144
|
}
|
|
158029
158145
|
const partPath = part.path;
|
|
158030
158146
|
rememberMasterPartBackground(this, partPath, part.backgroundColor);
|
|
158031
|
-
const xml = await this.
|
|
158147
|
+
const xml = await this.readPartText(partPath);
|
|
158032
158148
|
if (!xml) {
|
|
158033
158149
|
return;
|
|
158034
158150
|
}
|
|
@@ -158188,7 +158304,7 @@ var init_PptxHandlerRuntimeLayoutElements = __esm({
|
|
|
158188
158304
|
}
|
|
158189
158305
|
const layoutToken = layoutPath.split("/").pop()?.replace(/\.xml$/u, "") ?? layoutPath;
|
|
158190
158306
|
try {
|
|
158191
|
-
const layoutXmlStr = await this.
|
|
158307
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
158192
158308
|
if (!layoutXmlStr) {
|
|
158193
158309
|
return [];
|
|
158194
158310
|
}
|
|
@@ -158922,7 +159038,7 @@ var init_PptxHandlerRuntimeThemeOverrides = __esm({
|
|
|
158922
159038
|
return cached;
|
|
158923
159039
|
}
|
|
158924
159040
|
try {
|
|
158925
|
-
const overrideXml = await this.
|
|
159041
|
+
const overrideXml = await this.readPartText(overridePath);
|
|
158926
159042
|
if (!overrideXml) {
|
|
158927
159043
|
return null;
|
|
158928
159044
|
}
|
|
@@ -159551,10 +159667,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
159551
159667
|
if (!relsXml) {
|
|
159552
159668
|
return void 0;
|
|
159553
159669
|
}
|
|
159554
|
-
const relsData = this.
|
|
159555
|
-
// eslint-disable-next-line no-await-in-loop
|
|
159556
|
-
await relsXml.async("string")
|
|
159557
|
-
);
|
|
159670
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
159558
159671
|
const relNodes = this.ensureArray(
|
|
159559
159672
|
relsData?.Relationships?.Relationship
|
|
159560
159673
|
);
|
|
@@ -159580,7 +159693,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
159580
159693
|
const options = [];
|
|
159581
159694
|
for (const file of themeFiles) {
|
|
159582
159695
|
try {
|
|
159583
|
-
const xml = await file.
|
|
159696
|
+
const xml = await this.readPartText(file.name) ?? "";
|
|
159584
159697
|
const data = this.parser.parse(xml);
|
|
159585
159698
|
const root = data["a:theme"];
|
|
159586
159699
|
const name = String(root?.["@_name"] || "").trim();
|
|
@@ -159660,7 +159773,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
159660
159773
|
];
|
|
159661
159774
|
for (const file of masterFiles) {
|
|
159662
159775
|
try {
|
|
159663
|
-
const masterXml = await file.
|
|
159776
|
+
const masterXml = await this.readPartText(file.name) ?? "";
|
|
159664
159777
|
const masterData = this.parser.parse(masterXml);
|
|
159665
159778
|
const clrMap = masterData?.["p:sldMaster"]?.["p:clrMap"];
|
|
159666
159779
|
if (!clrMap) {
|
|
@@ -159693,7 +159806,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
159693
159806
|
if (!themeFile) {
|
|
159694
159807
|
return null;
|
|
159695
159808
|
}
|
|
159696
|
-
const themeXml3 = await
|
|
159809
|
+
const themeXml3 = await this.readPartText(themePath) ?? "";
|
|
159697
159810
|
const model = this.parseThemePartXml(themeXml3);
|
|
159698
159811
|
this.cacheThemePartModel(themePath, themeXml3, model);
|
|
159699
159812
|
return { colorMap: model.colorMap, fontMap: model.fontMap, formatScheme: model.formatScheme };
|
|
@@ -159728,7 +159841,7 @@ var init_PptxHandlerRuntimeThemeLoading = __esm({
|
|
|
159728
159841
|
if (!relsXml) {
|
|
159729
159842
|
return void 0;
|
|
159730
159843
|
}
|
|
159731
|
-
const relsData =
|
|
159844
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
159732
159845
|
const relNodes = this.ensureArray(
|
|
159733
159846
|
relsData?.Relationships?.Relationship
|
|
159734
159847
|
);
|
|
@@ -160057,11 +160170,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160057
160170
|
async extractModernSlideComments(slidePath) {
|
|
160058
160171
|
try {
|
|
160059
160172
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
160060
|
-
const
|
|
160061
|
-
if (!
|
|
160173
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
160174
|
+
if (!relsData) {
|
|
160062
160175
|
return [];
|
|
160063
160176
|
}
|
|
160064
|
-
const relsData = this.parser.parse(relsXml);
|
|
160065
160177
|
const rels = this.ensureArray(
|
|
160066
160178
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
160067
160179
|
);
|
|
@@ -160078,7 +160190,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160078
160190
|
continue;
|
|
160079
160191
|
}
|
|
160080
160192
|
const filePath = this.resolvePath(slidePath, target);
|
|
160081
|
-
const xml = await this.
|
|
160193
|
+
const xml = await this.readPartText(filePath);
|
|
160082
160194
|
if (!xml) {
|
|
160083
160195
|
continue;
|
|
160084
160196
|
}
|
|
@@ -160101,11 +160213,10 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160101
160213
|
return [];
|
|
160102
160214
|
}
|
|
160103
160215
|
async loadModernCommentAuthors() {
|
|
160104
|
-
const
|
|
160105
|
-
if (!
|
|
160216
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
160217
|
+
if (!relsData) {
|
|
160106
160218
|
return;
|
|
160107
160219
|
}
|
|
160108
|
-
const relsData = this.parser.parse(relsXml);
|
|
160109
160220
|
const relationships3 = this.ensureArray(
|
|
160110
160221
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
160111
160222
|
);
|
|
@@ -160117,7 +160228,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160117
160228
|
return;
|
|
160118
160229
|
}
|
|
160119
160230
|
const partPath = this.resolvePath("ppt/presentation.xml", target);
|
|
160120
|
-
const xml = await this.
|
|
160231
|
+
const xml = await this.readPartText(partPath);
|
|
160121
160232
|
if (!xml) {
|
|
160122
160233
|
return;
|
|
160123
160234
|
}
|
|
@@ -160143,12 +160254,12 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160143
160254
|
}
|
|
160144
160255
|
}
|
|
160145
160256
|
const relsPath2 = `${slidePath.replace("slides/", "slides/_rels/")}.rels`;
|
|
160146
|
-
const relsXml = await this.
|
|
160257
|
+
const relsXml = await this.readPartText(relsPath2);
|
|
160147
160258
|
if (!relsXml) {
|
|
160148
160259
|
return void 0;
|
|
160149
160260
|
}
|
|
160150
160261
|
try {
|
|
160151
|
-
const relsData = this.
|
|
160262
|
+
const relsData = await this.readPartXml(relsPath2);
|
|
160152
160263
|
const rels = this.ensureArray(
|
|
160153
160264
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
160154
160265
|
);
|
|
@@ -160187,7 +160298,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160187
160298
|
return [];
|
|
160188
160299
|
}
|
|
160189
160300
|
const commentsPath = this.resolveImagePath(slidePath, commentTarget);
|
|
160190
|
-
const commentsXml = await this.
|
|
160301
|
+
const commentsXml = await this.readPartText(commentsPath);
|
|
160191
160302
|
if (!commentsXml) {
|
|
160192
160303
|
return [];
|
|
160193
160304
|
}
|
|
@@ -160222,7 +160333,7 @@ var init_PptxHandlerRuntimeComments = __esm({
|
|
|
160222
160333
|
}
|
|
160223
160334
|
}
|
|
160224
160335
|
async loadCommentAuthors() {
|
|
160225
|
-
const commentAuthorsXml = await this.
|
|
160336
|
+
const commentAuthorsXml = await this.readPartText("ppt/commentAuthors.xml");
|
|
160226
160337
|
if (!commentAuthorsXml) {
|
|
160227
160338
|
return;
|
|
160228
160339
|
}
|
|
@@ -160294,7 +160405,7 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
160294
160405
|
return void 0;
|
|
160295
160406
|
}
|
|
160296
160407
|
const partPath = this.resolveImagePath(slidePath, target);
|
|
160297
|
-
const xmlString = await this.
|
|
160408
|
+
const xmlString = await this.readPartText(partPath);
|
|
160298
160409
|
if (!xmlString) {
|
|
160299
160410
|
return void 0;
|
|
160300
160411
|
}
|
|
@@ -162009,9 +162120,8 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
162009
162120
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
162010
162121
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
162011
162122
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
162012
|
-
const
|
|
162013
|
-
if (
|
|
162014
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
162123
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
162124
|
+
if (chartRelsData) {
|
|
162015
162125
|
const relsContainer = chartRelsData?.Relationships;
|
|
162016
162126
|
if (relsContainer?.Relationship) {
|
|
162017
162127
|
const rels = Array.isArray(relsContainer.Relationship) ? relsContainer.Relationship : [relsContainer.Relationship];
|
|
@@ -162093,7 +162203,7 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
162093
162203
|
if (drawingPath.length === 0) {
|
|
162094
162204
|
return void 0;
|
|
162095
162205
|
}
|
|
162096
|
-
const drawingXml = await this.
|
|
162206
|
+
const drawingXml = await this.readPartText(drawingPath);
|
|
162097
162207
|
if (!drawingXml) {
|
|
162098
162208
|
return void 0;
|
|
162099
162209
|
}
|
|
@@ -162114,11 +162224,10 @@ var init_PptxHandlerRuntimeChartExternalData = __esm({
|
|
|
162114
162224
|
const chartDir = chartPartPath.substring(0, chartPartPath.lastIndexOf("/") + 1);
|
|
162115
162225
|
const chartFileName = chartPartPath.substring(chartPartPath.lastIndexOf("/") + 1);
|
|
162116
162226
|
const chartRelsPath = `${chartDir}_rels/${chartFileName}.rels`;
|
|
162117
|
-
const
|
|
162118
|
-
if (!
|
|
162227
|
+
const chartRelsData = await this.readPartXml(chartRelsPath);
|
|
162228
|
+
if (!chartRelsData) {
|
|
162119
162229
|
return [];
|
|
162120
162230
|
}
|
|
162121
|
-
const chartRelsData = this.parser.parse(chartRelsXml);
|
|
162122
162231
|
const relsContainer = chartRelsData?.Relationships;
|
|
162123
162232
|
if (!relsContainer?.Relationship) {
|
|
162124
162233
|
return [];
|
|
@@ -163010,11 +163119,10 @@ var init_PptxHandlerRuntimeEmbeddedFonts = __esm({
|
|
|
163010
163119
|
async loadPresentationFontRels() {
|
|
163011
163120
|
const map = /* @__PURE__ */ new Map();
|
|
163012
163121
|
try {
|
|
163013
|
-
const
|
|
163014
|
-
if (!
|
|
163122
|
+
const relsData = await this.readPartXml("ppt/_rels/presentation.xml.rels");
|
|
163123
|
+
if (!relsData) {
|
|
163015
163124
|
return map;
|
|
163016
163125
|
}
|
|
163017
|
-
const relsData = this.parser.parse(relsXml);
|
|
163018
163126
|
const rels = this.ensureArray(
|
|
163019
163127
|
xmlChild(relsData, "Relationships")?.Relationship
|
|
163020
163128
|
);
|
|
@@ -163335,13 +163443,13 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
163335
163443
|
if (!file) {
|
|
163336
163444
|
continue;
|
|
163337
163445
|
}
|
|
163338
|
-
const data = await
|
|
163446
|
+
const data = await this.readPartText(entry2) ?? "";
|
|
163339
163447
|
const propsPath = `customXml/itemProps${itemId}.xml`;
|
|
163340
163448
|
const propsFile = this.zip.file(propsPath);
|
|
163341
163449
|
let properties;
|
|
163342
163450
|
let schemaUri;
|
|
163343
163451
|
if (propsFile) {
|
|
163344
|
-
properties = await
|
|
163452
|
+
properties = await this.readPartText(propsPath) ?? "";
|
|
163345
163453
|
try {
|
|
163346
163454
|
const propsData = this.parser.parse(properties);
|
|
163347
163455
|
const schemaRefs = propsData?.["ds:datastoreItem"]?.["ds:schemaRefs"]?.["ds:schemaRef"];
|
|
@@ -163361,14 +163469,14 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
163361
163469
|
const relsFile = this.zip.file(relsPath2);
|
|
163362
163470
|
let rels;
|
|
163363
163471
|
if (relsFile) {
|
|
163364
|
-
rels = await
|
|
163472
|
+
rels = await this.readPartText(relsPath2);
|
|
163365
163473
|
}
|
|
163366
163474
|
parts.push({ id: itemId, data, schemaUri, properties, rels });
|
|
163367
163475
|
}
|
|
163368
163476
|
this.customXmlParts = parts;
|
|
163369
163477
|
}
|
|
163370
163478
|
async loadPresentationState() {
|
|
163371
|
-
const presentationXml3 = await this.
|
|
163479
|
+
const presentationXml3 = await this.readPartText("ppt/presentation.xml");
|
|
163372
163480
|
if (!presentationXml3) {
|
|
163373
163481
|
throw new Error("Invalid PPTX: presentation.xml not found");
|
|
163374
163482
|
}
|
|
@@ -163720,6 +163828,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
163720
163828
|
* or resolve images. Create a new `PptxHandler` instance instead.
|
|
163721
163829
|
*/
|
|
163722
163830
|
dispose() {
|
|
163831
|
+
this.endPartReads();
|
|
163723
163832
|
this.revokeBlobUrls();
|
|
163724
163833
|
this.imageDataCache.clear();
|
|
163725
163834
|
this.slideMap.clear();
|
|
@@ -163753,18 +163862,24 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
163753
163862
|
this.zip = null;
|
|
163754
163863
|
}
|
|
163755
163864
|
async load(data, options = {}) {
|
|
163756
|
-
|
|
163757
|
-
|
|
163758
|
-
|
|
163759
|
-
|
|
163760
|
-
|
|
163761
|
-
|
|
163762
|
-
|
|
163763
|
-
|
|
163764
|
-
|
|
163765
|
-
|
|
163766
|
-
|
|
163767
|
-
|
|
163865
|
+
let reader2;
|
|
163866
|
+
try {
|
|
163867
|
+
await this.initializeLoadSession(data, options);
|
|
163868
|
+
reader2 = this.beginPartReads();
|
|
163869
|
+
await this.detectAndPreserveVbaProject();
|
|
163870
|
+
this.detectDigitalSignatureParts();
|
|
163871
|
+
await this.parseCustomXmlParts();
|
|
163872
|
+
const presentationState = await this.loadPresentationState();
|
|
163873
|
+
const slideMasters = await this.parseSlideMasters();
|
|
163874
|
+
await this.enrichSlideMastersWithTxStyles(slideMasters);
|
|
163875
|
+
const slides = await this.loadSlidesForPresentation(presentationState.sectionBySlideId);
|
|
163876
|
+
const slidesWithWarnings = this.attachSlideWarnings(slides);
|
|
163877
|
+
this.resetElementIdCounter(slides);
|
|
163878
|
+
recordSlideFingerprints(this.savedSlideFingerprints, slidesWithWarnings);
|
|
163879
|
+
return await this.buildLoadData(presentationState, slidesWithWarnings, slideMasters);
|
|
163880
|
+
} finally {
|
|
163881
|
+
this.endPartReads(reader2);
|
|
163882
|
+
}
|
|
163768
163883
|
}
|
|
163769
163884
|
/**
|
|
163770
163885
|
* Retrieve the current background colour for a layout or master.
|
|
@@ -163903,7 +164018,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
163903
164018
|
options.push(this.buildLayoutOption(lp, xmlObj));
|
|
163904
164019
|
} else {
|
|
163905
164020
|
try {
|
|
163906
|
-
const layoutXmlStr = await this.
|
|
164021
|
+
const layoutXmlStr = await this.readPartText(lp);
|
|
163907
164022
|
if (layoutXmlStr) {
|
|
163908
164023
|
const layoutXmlObj = this.parser.parse(layoutXmlStr);
|
|
163909
164024
|
this.layoutXmlMap.set(lp, layoutXmlObj);
|
|
@@ -163946,7 +164061,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
163946
164061
|
}
|
|
163947
164062
|
let layoutXml3 = this.layoutXmlMap.get(layoutPath);
|
|
163948
164063
|
if (!layoutXml3) {
|
|
163949
|
-
const layoutXmlStr = await this.
|
|
164064
|
+
const layoutXmlStr = await this.readPartText(layoutPath);
|
|
163950
164065
|
if (!layoutXmlStr) {
|
|
163951
164066
|
throw new Error(`Layout not found: ${layoutPath}`);
|
|
163952
164067
|
}
|