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.
- package/dist/{PptxHandler-AILFLRH7.cjs → PptxHandler-NHOKKZ4S.cjs} +3 -3
- package/dist/{PptxHandler-64BZOBWX.mjs → PptxHandler-OIR3ZY4Q.mjs} +2 -2
- package/dist/PptxHandler-TZJNIXPX.mjs +4 -0
- package/dist/{PresentationBuilder-RBQP6A37.cjs → PresentationBuilder-EX6DAE5X.cjs} +5 -5
- package/dist/{PresentationBuilder-EJY2TYWL.mjs → PresentationBuilder-RFTSZUPR.mjs} +2 -2
- package/dist/{PresentationBuilder-HBCCO2CF.mjs → PresentationBuilder-X5WFSHLB.mjs} +2 -2
- package/dist/{chunk-MU3XSASV.cjs → chunk-36TR3PER.cjs} +270 -13
- package/dist/{chunk-FZBAMWCJ.mjs → chunk-5KJAQKZG.mjs} +62 -275
- package/dist/{chunk-R7RL7W43.mjs → chunk-5NJPYCGO.mjs} +271 -17
- package/dist/{chunk-OQPT5IC3.mjs → chunk-BXZF7H5G.mjs} +4 -4
- package/dist/{chunk-NXTHB2M3.cjs → chunk-DMJIDRJE.cjs} +1139 -1352
- package/dist/{chunk-OTXJVFMY.mjs → chunk-GZ4DIXZZ.mjs} +62 -275
- package/dist/{chunk-2XMK5SXU.mjs → chunk-I57SMSU6.mjs} +268 -14
- package/dist/{chunk-WRFMS5CL.mjs → chunk-QIMNQDON.mjs} +1 -1
- package/dist/{chunk-DHAZSMC7.mjs → chunk-ZWTXVWMY.mjs} +1 -1
- package/dist/pptx/automation/index.cjs +352 -311
- package/dist/pptx/automation/index.d.ts +1 -1
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/index-D8DNpc1X.d.ts.map +1 -1
- package/dist/pptx/chunks/{index-CbFowkp4.d.ts → index-GWpMAY-f.d.ts} +16 -3
- package/dist/pptx/chunks/index-GWpMAY-f.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +352 -311
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/index.cjs +354 -311
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +5 -5
- package/package.json +1 -1
- package/dist/PptxHandler-PMLQGMFQ.mjs +0 -4
- package/dist/pptx/chunks/index-CbFowkp4.d.ts.map +0 -1
package/dist/pptx/cli/index.cjs
CHANGED
|
@@ -51029,6 +51029,272 @@ var init_chart_data_sheet = __esm({
|
|
|
51029
51029
|
}
|
|
51030
51030
|
});
|
|
51031
51031
|
|
|
51032
|
+
// pptx/core/utils/modern-comment-mention-read.ts
|
|
51033
|
+
function readCommentMentions(node, authorName) {
|
|
51034
|
+
if (!node) {
|
|
51035
|
+
return void 0;
|
|
51036
|
+
}
|
|
51037
|
+
const found = [];
|
|
51038
|
+
for (const list3 of mentionChildrenNamed(node, "mentionLst")) {
|
|
51039
|
+
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
51040
|
+
const mention = readMention(entry2, authorName);
|
|
51041
|
+
if (mention) {
|
|
51042
|
+
found.push(mention);
|
|
51043
|
+
}
|
|
51044
|
+
}
|
|
51045
|
+
}
|
|
51046
|
+
for (const extension of mentionChildrenNamed(mentionChildrenNamed(node, "extLst")[0], "ext")) {
|
|
51047
|
+
const uri = String(extension["@_uri"] || "");
|
|
51048
|
+
for (const list3 of mentionChildrenNamed(extension, "mentionLst")) {
|
|
51049
|
+
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
51050
|
+
const mention = readMention(entry2, authorName, uri);
|
|
51051
|
+
if (mention) {
|
|
51052
|
+
found.push(mention);
|
|
51053
|
+
}
|
|
51054
|
+
}
|
|
51055
|
+
}
|
|
51056
|
+
}
|
|
51057
|
+
found.sort((a, b) => a.startIndex - b.startIndex);
|
|
51058
|
+
return found.length > 0 ? found : void 0;
|
|
51059
|
+
}
|
|
51060
|
+
var mentionLocalName, mentionNodesOf, mentionChildrenNamed, MENTION_PERSON_KEYS, MENTION_LENGTH_KEYS, attribute3, integer2, readMention;
|
|
51061
|
+
var init_modern_comment_mention_read = __esm({
|
|
51062
|
+
"pptx/core/utils/modern-comment-mention-read.ts"() {
|
|
51063
|
+
mentionLocalName = (key2) => key2.split(":").pop() || key2;
|
|
51064
|
+
mentionNodesOf = (value) => {
|
|
51065
|
+
if (Array.isArray(value)) {
|
|
51066
|
+
return value.filter((entry2) => Boolean(entry2) && typeof entry2 === "object");
|
|
51067
|
+
}
|
|
51068
|
+
return value && typeof value === "object" ? [value] : [];
|
|
51069
|
+
};
|
|
51070
|
+
mentionChildrenNamed = (node, name) => {
|
|
51071
|
+
if (!node) {
|
|
51072
|
+
return [];
|
|
51073
|
+
}
|
|
51074
|
+
const result = [];
|
|
51075
|
+
for (const [key2, value] of Object.entries(node)) {
|
|
51076
|
+
if (!key2.startsWith("@_") && mentionLocalName(key2) === name) {
|
|
51077
|
+
result.push(...mentionNodesOf(value));
|
|
51078
|
+
}
|
|
51079
|
+
}
|
|
51080
|
+
return result;
|
|
51081
|
+
};
|
|
51082
|
+
MENTION_PERSON_KEYS = [
|
|
51083
|
+
"@_mentionpersonId",
|
|
51084
|
+
"@_mentionPersonId",
|
|
51085
|
+
"@_personId",
|
|
51086
|
+
"@_authorId"
|
|
51087
|
+
];
|
|
51088
|
+
MENTION_LENGTH_KEYS = ["@_length", "@_mentionCharCount", "@_len"];
|
|
51089
|
+
attribute3 = (node, keys) => {
|
|
51090
|
+
for (const key2 of keys) {
|
|
51091
|
+
const value = node[key2];
|
|
51092
|
+
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
51093
|
+
return String(value);
|
|
51094
|
+
}
|
|
51095
|
+
}
|
|
51096
|
+
return void 0;
|
|
51097
|
+
};
|
|
51098
|
+
integer2 = (value) => {
|
|
51099
|
+
if (value === void 0) {
|
|
51100
|
+
return void 0;
|
|
51101
|
+
}
|
|
51102
|
+
const parsed = Number.parseInt(value, 10);
|
|
51103
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
|
|
51104
|
+
};
|
|
51105
|
+
readMention = (node, authorName, containerUri) => {
|
|
51106
|
+
const personId = attribute3(node, MENTION_PERSON_KEYS);
|
|
51107
|
+
const startIndex = integer2(attribute3(node, ["@_startIndex"]));
|
|
51108
|
+
const length = integer2(attribute3(node, MENTION_LENGTH_KEYS));
|
|
51109
|
+
if (!personId || startIndex === void 0 || length === void 0 || length === 0) {
|
|
51110
|
+
return void 0;
|
|
51111
|
+
}
|
|
51112
|
+
return {
|
|
51113
|
+
personId,
|
|
51114
|
+
startIndex,
|
|
51115
|
+
length,
|
|
51116
|
+
id: attribute3(node, ["@_mentionId", "@_id"]),
|
|
51117
|
+
authorName: authorName(personId),
|
|
51118
|
+
containerUri,
|
|
51119
|
+
rawXml: node
|
|
51120
|
+
};
|
|
51121
|
+
};
|
|
51122
|
+
}
|
|
51123
|
+
});
|
|
51124
|
+
|
|
51125
|
+
// pptx/core/utils/modern-comment-mentions.ts
|
|
51126
|
+
function rebaseCommentMentions(mentions, oldText, newText, loaded) {
|
|
51127
|
+
if (!mentions || mentions.length === 0) {
|
|
51128
|
+
return void 0;
|
|
51129
|
+
}
|
|
51130
|
+
if (oldText === newText) {
|
|
51131
|
+
return mentions;
|
|
51132
|
+
}
|
|
51133
|
+
const prefix = commonPrefixLength(oldText, newText);
|
|
51134
|
+
const suffix = commonSuffixLength(
|
|
51135
|
+
oldText,
|
|
51136
|
+
newText,
|
|
51137
|
+
Math.min(oldText.length, newText.length) - prefix
|
|
51138
|
+
);
|
|
51139
|
+
const changeEnd = oldText.length - suffix;
|
|
51140
|
+
const delta2 = newText.length - oldText.length;
|
|
51141
|
+
const result = [];
|
|
51142
|
+
for (const mention of mentions) {
|
|
51143
|
+
const start = mention.startIndex;
|
|
51144
|
+
const end = start + mention.length;
|
|
51145
|
+
const coverage = loaded ? loadedCoverage(mention, loaded, oldText) : [];
|
|
51146
|
+
if (coverage === void 0 || coverage.includes(newText.slice(start, end))) {
|
|
51147
|
+
if (start >= 0 && mention.length > 0 && end <= newText.length) {
|
|
51148
|
+
result.push(mention);
|
|
51149
|
+
}
|
|
51150
|
+
continue;
|
|
51151
|
+
}
|
|
51152
|
+
const span = oldText.slice(start, end);
|
|
51153
|
+
if (span.length !== mention.length) {
|
|
51154
|
+
continue;
|
|
51155
|
+
}
|
|
51156
|
+
let next = -1;
|
|
51157
|
+
if (end <= prefix) {
|
|
51158
|
+
next = start;
|
|
51159
|
+
} else if (start >= changeEnd) {
|
|
51160
|
+
next = start + delta2;
|
|
51161
|
+
}
|
|
51162
|
+
if (next >= 0 && newText.slice(next, next + mention.length) === span) {
|
|
51163
|
+
result.push(next === start ? mention : { ...mention, startIndex: next });
|
|
51164
|
+
continue;
|
|
51165
|
+
}
|
|
51166
|
+
const relocated = nearestOccurrence(newText, span, next >= 0 ? next : start);
|
|
51167
|
+
if (relocated >= 0) {
|
|
51168
|
+
result.push({ ...mention, startIndex: relocated });
|
|
51169
|
+
}
|
|
51170
|
+
}
|
|
51171
|
+
return result.length > 0 ? result : void 0;
|
|
51172
|
+
}
|
|
51173
|
+
function buildMentionListNode(mentions) {
|
|
51174
|
+
if (!mentions || mentions.length === 0) {
|
|
51175
|
+
return void 0;
|
|
51176
|
+
}
|
|
51177
|
+
return { "p188:mention": mentions.map(buildMention) };
|
|
51178
|
+
}
|
|
51179
|
+
function applyCommentMentions(node, mentions, extension, replace) {
|
|
51180
|
+
if (!replace) {
|
|
51181
|
+
return extension;
|
|
51182
|
+
}
|
|
51183
|
+
const { direct, byUri } = groupByContainer(mentions);
|
|
51184
|
+
const directList = buildMentionListNode(direct);
|
|
51185
|
+
if (directList) {
|
|
51186
|
+
node["p188:mentionLst"] = directList;
|
|
51187
|
+
}
|
|
51188
|
+
if (!extension) {
|
|
51189
|
+
return void 0;
|
|
51190
|
+
}
|
|
51191
|
+
const rebuilt = stripMentionLists(extension);
|
|
51192
|
+
const extensionKey = Object.keys(rebuilt).find((key2) => mentionLocalName(key2) === "ext") || "p188:ext";
|
|
51193
|
+
const entries = mentionNodesOf(rebuilt[extensionKey]).map((entry2) => {
|
|
51194
|
+
const list3 = buildMentionListNode(byUri.get(String(entry2["@_uri"] || "")));
|
|
51195
|
+
const next = stripMentionLists(entry2);
|
|
51196
|
+
if (list3) {
|
|
51197
|
+
next["p188:mentionLst"] = list3;
|
|
51198
|
+
}
|
|
51199
|
+
return next;
|
|
51200
|
+
});
|
|
51201
|
+
if (entries.length > 0) {
|
|
51202
|
+
rebuilt[extensionKey] = entries.length === 1 ? entries[0] : entries;
|
|
51203
|
+
}
|
|
51204
|
+
return rebuilt;
|
|
51205
|
+
}
|
|
51206
|
+
var commonPrefixLength, commonSuffixLength, nearestOccurrence, loadedCoverage, buildMention, stripMentionLists, groupByContainer;
|
|
51207
|
+
var init_modern_comment_mentions = __esm({
|
|
51208
|
+
"pptx/core/utils/modern-comment-mentions.ts"() {
|
|
51209
|
+
init_modern_comment_mention_read();
|
|
51210
|
+
init_modern_comment_mention_read();
|
|
51211
|
+
commonPrefixLength = (a, b) => {
|
|
51212
|
+
const max = Math.min(a.length, b.length);
|
|
51213
|
+
let index = 0;
|
|
51214
|
+
while (index < max && a[index] === b[index]) {
|
|
51215
|
+
index += 1;
|
|
51216
|
+
}
|
|
51217
|
+
return index;
|
|
51218
|
+
};
|
|
51219
|
+
commonSuffixLength = (a, b, limit) => {
|
|
51220
|
+
let index = 0;
|
|
51221
|
+
while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
|
|
51222
|
+
index += 1;
|
|
51223
|
+
}
|
|
51224
|
+
return index;
|
|
51225
|
+
};
|
|
51226
|
+
nearestOccurrence = (text2, span, hint) => {
|
|
51227
|
+
let best = -1;
|
|
51228
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
51229
|
+
let at2 = text2.indexOf(span);
|
|
51230
|
+
while (at2 !== -1) {
|
|
51231
|
+
const distance = Math.abs(at2 - hint);
|
|
51232
|
+
if (distance < bestDistance) {
|
|
51233
|
+
best = at2;
|
|
51234
|
+
bestDistance = distance;
|
|
51235
|
+
}
|
|
51236
|
+
at2 = text2.indexOf(span, at2 + 1);
|
|
51237
|
+
}
|
|
51238
|
+
return best;
|
|
51239
|
+
};
|
|
51240
|
+
loadedCoverage = (mention, loaded, oldText) => {
|
|
51241
|
+
const records = loaded.filter(
|
|
51242
|
+
(record2) => mention.id ? record2.id === mention.id : !record2.id && record2.personId === mention.personId && record2.length === mention.length
|
|
51243
|
+
);
|
|
51244
|
+
if (records.length === 0) {
|
|
51245
|
+
return void 0;
|
|
51246
|
+
}
|
|
51247
|
+
return records.map(
|
|
51248
|
+
(record2) => oldText.slice(record2.startIndex, record2.startIndex + record2.length)
|
|
51249
|
+
);
|
|
51250
|
+
};
|
|
51251
|
+
buildMention = (mention) => {
|
|
51252
|
+
const node = {};
|
|
51253
|
+
for (const [key2, value] of Object.entries(mention.rawXml || {})) {
|
|
51254
|
+
if (key2.startsWith("@_")) {
|
|
51255
|
+
node[key2] = value;
|
|
51256
|
+
}
|
|
51257
|
+
}
|
|
51258
|
+
const personKey = MENTION_PERSON_KEYS.find((key2) => node[key2] !== void 0) || "@_mentionpersonId";
|
|
51259
|
+
const lengthKey = MENTION_LENGTH_KEYS.find((key2) => node[key2] !== void 0) || "@_length";
|
|
51260
|
+
node[personKey] = mention.personId;
|
|
51261
|
+
node[lengthKey] = String(mention.length);
|
|
51262
|
+
node["@_startIndex"] = String(mention.startIndex);
|
|
51263
|
+
if (mention.id) {
|
|
51264
|
+
const idKey = node["@_id"] !== void 0 && node["@_mentionId"] === void 0 ? "@_id" : "@_mentionId";
|
|
51265
|
+
node[idKey] = mention.id;
|
|
51266
|
+
}
|
|
51267
|
+
return node;
|
|
51268
|
+
};
|
|
51269
|
+
stripMentionLists = (node) => {
|
|
51270
|
+
const result = {};
|
|
51271
|
+
for (const [key2, value] of Object.entries(node)) {
|
|
51272
|
+
if (key2.startsWith("@_") || mentionLocalName(key2) !== "mentionLst") {
|
|
51273
|
+
result[key2] = value;
|
|
51274
|
+
}
|
|
51275
|
+
}
|
|
51276
|
+
return result;
|
|
51277
|
+
};
|
|
51278
|
+
groupByContainer = (mentions) => {
|
|
51279
|
+
const direct = [];
|
|
51280
|
+
const byUri = /* @__PURE__ */ new Map();
|
|
51281
|
+
for (const mention of mentions || []) {
|
|
51282
|
+
if (!mention.containerUri) {
|
|
51283
|
+
direct.push(mention);
|
|
51284
|
+
continue;
|
|
51285
|
+
}
|
|
51286
|
+
const bucket = byUri.get(mention.containerUri);
|
|
51287
|
+
if (bucket) {
|
|
51288
|
+
bucket.push(mention);
|
|
51289
|
+
} else {
|
|
51290
|
+
byUri.set(mention.containerUri, [mention]);
|
|
51291
|
+
}
|
|
51292
|
+
}
|
|
51293
|
+
return { direct, byUri };
|
|
51294
|
+
};
|
|
51295
|
+
}
|
|
51296
|
+
});
|
|
51297
|
+
|
|
51032
51298
|
// pptx/core/utils/index.ts
|
|
51033
51299
|
var init_utils = __esm({
|
|
51034
51300
|
"pptx/core/utils/index.ts"() {
|
|
@@ -58758,7 +59024,7 @@ var init_effect_style_extractor_fill_overlay = __esm({
|
|
|
58758
59024
|
});
|
|
58759
59025
|
|
|
58760
59026
|
// pptx/core/core/builders/effect-style-extractor-reflection.ts
|
|
58761
|
-
function
|
|
59027
|
+
function integer3(value) {
|
|
58762
59028
|
if (value === void 0 || value === null || value === "") {
|
|
58763
59029
|
return void 0;
|
|
58764
59030
|
}
|
|
@@ -58775,19 +59041,19 @@ function boolean2(value) {
|
|
|
58775
59041
|
return void 0;
|
|
58776
59042
|
}
|
|
58777
59043
|
function fixedFraction(value) {
|
|
58778
|
-
const parsed =
|
|
59044
|
+
const parsed = integer3(value);
|
|
58779
59045
|
return parsed !== void 0 && parsed >= 0 && parsed <= 1e5 ? parsed / 1e5 : void 0;
|
|
58780
59046
|
}
|
|
58781
59047
|
function extractReflectionAttributes(node, emuPerPx) {
|
|
58782
|
-
const blur =
|
|
58783
|
-
const distance =
|
|
58784
|
-
const startOpacity =
|
|
58785
|
-
const endOpacity =
|
|
58786
|
-
const startPosition =
|
|
58787
|
-
const endPosition =
|
|
58788
|
-
const direction =
|
|
58789
|
-
const rotation =
|
|
58790
|
-
const fadeDirection =
|
|
59048
|
+
const blur = integer3(node["@_blurRad"]);
|
|
59049
|
+
const distance = integer3(node["@_dist"]);
|
|
59050
|
+
const startOpacity = integer3(node["@_stA"]);
|
|
59051
|
+
const endOpacity = integer3(node["@_endA"]);
|
|
59052
|
+
const startPosition = integer3(node["@_stPos"]);
|
|
59053
|
+
const endPosition = integer3(node["@_endPos"]);
|
|
59054
|
+
const direction = integer3(node["@_dir"]);
|
|
59055
|
+
const rotation = integer3(node["@_rot"]);
|
|
59056
|
+
const fadeDirection = integer3(node["@_fadeDir"]);
|
|
58791
59057
|
const alignment = String(node["@_algn"] ?? "").trim();
|
|
58792
59058
|
return {
|
|
58793
59059
|
reflectionBlurRadius: blur !== void 0 && blur >= 0 ? blur / emuPerPx : void 0,
|
|
@@ -58799,10 +59065,10 @@ function extractReflectionAttributes(node, emuPerPx) {
|
|
|
58799
59065
|
reflectionRotation: rotation !== void 0 ? rotation / 6e4 : void 0,
|
|
58800
59066
|
reflectionDistance: distance !== void 0 && distance >= 0 ? distance / emuPerPx : void 0,
|
|
58801
59067
|
reflectionFadeDirection: fadeDirection !== void 0 ? fadeDirection / 6e4 : void 0,
|
|
58802
|
-
reflectionScaleX:
|
|
58803
|
-
reflectionScaleY:
|
|
58804
|
-
reflectionSkewX:
|
|
58805
|
-
reflectionSkewY:
|
|
59068
|
+
reflectionScaleX: integer3(node["@_sx"]),
|
|
59069
|
+
reflectionScaleY: integer3(node["@_sy"]),
|
|
59070
|
+
reflectionSkewX: integer3(node["@_kx"]),
|
|
59071
|
+
reflectionSkewY: integer3(node["@_ky"]),
|
|
58806
59072
|
reflectionAlignment: VALID_ALIGNMENTS.has(alignment) ? alignment : void 0,
|
|
58807
59073
|
reflectionRotateWithShape: boolean2(node["@_rotWithShape"])
|
|
58808
59074
|
};
|
|
@@ -90124,7 +90390,10 @@ async function resolveBulletImage(imageRelId, slidePath, resolver) {
|
|
|
90124
90390
|
if (!target) {
|
|
90125
90391
|
return void 0;
|
|
90126
90392
|
}
|
|
90127
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
90393
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
90394
|
+
return resolver.allowExternalImages ? target : void 0;
|
|
90395
|
+
}
|
|
90396
|
+
if (target.startsWith("data:")) {
|
|
90128
90397
|
return target;
|
|
90129
90398
|
}
|
|
90130
90399
|
const imagePath = resolver.resolveImagePath(slidePath, target);
|
|
@@ -92865,7 +93134,7 @@ function malformed(context, element, value) {
|
|
|
92865
93134
|
function cBool(context, parent, local) {
|
|
92866
93135
|
const element = cChild(parent, local);
|
|
92867
93136
|
if (!element) return void 0;
|
|
92868
|
-
const raw2 =
|
|
93137
|
+
const raw2 = attribute4(element, "val");
|
|
92869
93138
|
if (raw2 === void 0) return true;
|
|
92870
93139
|
const value = raw2.trim().toLowerCase();
|
|
92871
93140
|
if (value === "1" || value === "true") return true;
|
|
@@ -92875,7 +93144,7 @@ function cBool(context, parent, local) {
|
|
|
92875
93144
|
}
|
|
92876
93145
|
function cNumber(context, parent, local) {
|
|
92877
93146
|
const element = cChild(parent, local);
|
|
92878
|
-
const raw2 =
|
|
93147
|
+
const raw2 = attribute4(element, "val");
|
|
92879
93148
|
if (!element || raw2 === void 0) return void 0;
|
|
92880
93149
|
const value = raw2.trim() ? Number(raw2) : Number.NaN;
|
|
92881
93150
|
if (Number.isFinite(value)) return value;
|
|
@@ -92884,7 +93153,7 @@ function cNumber(context, parent, local) {
|
|
|
92884
93153
|
}
|
|
92885
93154
|
function cEnum(context, parent, local, allowed) {
|
|
92886
93155
|
const element = cChild(parent, local);
|
|
92887
|
-
const raw2 =
|
|
93156
|
+
const raw2 = attribute4(element, "val");
|
|
92888
93157
|
if (!element || raw2 === void 0) return void 0;
|
|
92889
93158
|
if (allowed.includes(raw2)) return raw2;
|
|
92890
93159
|
malformed(context, element, raw2);
|
|
@@ -92941,9 +93210,9 @@ function chartLines(parent, local) {
|
|
|
92941
93210
|
}
|
|
92942
93211
|
function numberFormat(parent) {
|
|
92943
93212
|
const element = cChild(parent, "numFmt");
|
|
92944
|
-
const formatCode2 =
|
|
93213
|
+
const formatCode2 = attribute4(element, "formatCode");
|
|
92945
93214
|
if (formatCode2 === void 0) return void 0;
|
|
92946
|
-
const linked =
|
|
93215
|
+
const linked = attribute4(element, "sourceLinked");
|
|
92947
93216
|
return {
|
|
92948
93217
|
formatCode: formatCode2,
|
|
92949
93218
|
...linked === "1" || linked === "true" ? { sourceLinked: true } : {},
|
|
@@ -92967,7 +93236,7 @@ function assignDefined(target, values) {
|
|
|
92967
93236
|
if (value !== void 0) target[key2] = value;
|
|
92968
93237
|
return target;
|
|
92969
93238
|
}
|
|
92970
|
-
var cChild,
|
|
93239
|
+
var cChild, attribute4, cVal, path, textProperties;
|
|
92971
93240
|
var init_parse_util = __esm({
|
|
92972
93241
|
"chart/parse-util.ts"() {
|
|
92973
93242
|
init_xml2();
|
|
@@ -92976,8 +93245,8 @@ var init_parse_util = __esm({
|
|
|
92976
93245
|
init_manual_layout();
|
|
92977
93246
|
init_xml_fragment();
|
|
92978
93247
|
cChild = (parent, local) => first(parent, local, NS.c);
|
|
92979
|
-
|
|
92980
|
-
cVal = (parent, local) =>
|
|
93248
|
+
attribute4 = (element, name) => element?.hasAttribute(name) ? element.getAttribute(name) ?? void 0 : void 0;
|
|
93249
|
+
cVal = (parent, local) => attribute4(cChild(parent, local), "val");
|
|
92981
93250
|
path = (element) => `c:${element.parentNode?.localName ?? ""}/c:${element.localName}`;
|
|
92982
93251
|
textProperties = (parent) => chartTextBody(cChild(parent, "txPr"));
|
|
92983
93252
|
}
|
|
@@ -92989,9 +93258,9 @@ function parseCache(node) {
|
|
|
92989
93258
|
type: node.localName === "numCache" || node.localName === "numLit" ? "number" : "string",
|
|
92990
93259
|
points: children2(node, "pt", NS.c).map((pt2) => {
|
|
92991
93260
|
const point2 = { value: cChild(pt2, "v")?.textContent ?? "" };
|
|
92992
|
-
const index = Number(
|
|
93261
|
+
const index = Number(attribute4(pt2, "idx") ?? Number.NaN);
|
|
92993
93262
|
if (Number.isInteger(index) && index >= 0) point2.index = index;
|
|
92994
|
-
const formatCode3 =
|
|
93263
|
+
const formatCode3 = attribute4(pt2, "formatCode");
|
|
92995
93264
|
if (formatCode3 !== void 0) point2.formatCode = formatCode3;
|
|
92996
93265
|
return point2;
|
|
92997
93266
|
})
|
|
@@ -93194,10 +93463,10 @@ function readDisplayNaAsBlank(chartExtLst) {
|
|
|
93194
93463
|
return void 0;
|
|
93195
93464
|
}
|
|
93196
93465
|
for (const ext of elements(root)) {
|
|
93197
|
-
if (ext.localName !== "ext" ||
|
|
93466
|
+
if (ext.localName !== "ext" || attribute4(ext, "uri") !== DATA_DISPLAY_OPTIONS_URI) continue;
|
|
93198
93467
|
const flag2 = first(first(ext, "dataDisplayOptions16", C16R3), "dispNaAsBlank", C16R3);
|
|
93199
93468
|
if (!flag2) continue;
|
|
93200
|
-
const raw2 =
|
|
93469
|
+
const raw2 = attribute4(flag2, "val")?.trim().toLowerCase();
|
|
93201
93470
|
return raw2 === void 0 || raw2 === "1" || raw2 === "true";
|
|
93202
93471
|
}
|
|
93203
93472
|
return void 0;
|
|
@@ -93442,7 +93711,7 @@ function customSplit(context, element) {
|
|
|
93442
93711
|
if (!element) return void 0;
|
|
93443
93712
|
reportUnmodelled(context, element, /* @__PURE__ */ new Set(["secondPiePt"]));
|
|
93444
93713
|
return children2(element, "secondPiePt", NS.c).flatMap((point2) => {
|
|
93445
|
-
const raw2 =
|
|
93714
|
+
const raw2 = attribute4(point2, "val")?.trim();
|
|
93446
93715
|
const index = raw2 ? Number(raw2) : Number.NaN;
|
|
93447
93716
|
return Number.isInteger(index) && index >= 0 ? [index] : [];
|
|
93448
93717
|
});
|
|
@@ -93463,7 +93732,7 @@ function parseGroup(context, element) {
|
|
|
93463
93732
|
is3D,
|
|
93464
93733
|
series: children2(element, "ser", NS.c).map((ser) => parseSeries(context, ser)),
|
|
93465
93734
|
axisIds: children2(element, "axId", NS.c).flatMap((axis) => {
|
|
93466
|
-
const raw2 =
|
|
93735
|
+
const raw2 = attribute4(axis, "val")?.trim();
|
|
93467
93736
|
const id = raw2 ? Number(raw2) : Number.NaN;
|
|
93468
93737
|
return Number.isFinite(id) ? [id] : [];
|
|
93469
93738
|
})
|
|
@@ -93745,7 +94014,7 @@ function chartStyle(context, space) {
|
|
|
93745
94014
|
}
|
|
93746
94015
|
function c14Style(space) {
|
|
93747
94016
|
for (const alternate of children2(space, "AlternateContent", NS.mc)) {
|
|
93748
|
-
const raw2 =
|
|
94017
|
+
const raw2 = attribute4(first(first(alternate, "Choice", NS.mc), "style", NS.c14, false), "val");
|
|
93749
94018
|
const value = raw2?.trim() ? Number(raw2) : Number.NaN;
|
|
93750
94019
|
if (Number.isFinite(value)) return value;
|
|
93751
94020
|
}
|
|
@@ -94434,7 +94703,7 @@ function malformed2(context, where, value) {
|
|
|
94434
94703
|
});
|
|
94435
94704
|
}
|
|
94436
94705
|
function boolAttribute(context, element, name) {
|
|
94437
|
-
const raw2 =
|
|
94706
|
+
const raw2 = attribute4(element, name);
|
|
94438
94707
|
if (!element || raw2 === void 0) return void 0;
|
|
94439
94708
|
const value = raw2.trim().toLowerCase();
|
|
94440
94709
|
if (value === "1" || value === "true") return true;
|
|
@@ -94443,7 +94712,7 @@ function boolAttribute(context, element, name) {
|
|
|
94443
94712
|
return void 0;
|
|
94444
94713
|
}
|
|
94445
94714
|
function numberAttribute(context, element, name) {
|
|
94446
|
-
const raw2 =
|
|
94715
|
+
const raw2 = attribute4(element, name);
|
|
94447
94716
|
if (!element || raw2 === void 0) return void 0;
|
|
94448
94717
|
const value = raw2.trim() ? Number(raw2) : Number.NaN;
|
|
94449
94718
|
if (Number.isFinite(value)) return value;
|
|
@@ -94453,11 +94722,11 @@ function numberAttribute(context, element, name) {
|
|
|
94453
94722
|
function indexAttribute(context, element, name) {
|
|
94454
94723
|
const value = numberAttribute(context, element, name);
|
|
94455
94724
|
if (value === void 0 || Number.isInteger(value) && value >= 0) return value;
|
|
94456
|
-
malformed2(context, path2(element, name),
|
|
94725
|
+
malformed2(context, path2(element, name), attribute4(element, name) ?? "");
|
|
94457
94726
|
return void 0;
|
|
94458
94727
|
}
|
|
94459
94728
|
function autoNumberAttribute(context, element, name) {
|
|
94460
|
-
return
|
|
94729
|
+
return attribute4(element, name)?.trim() === "auto" ? "auto" : numberAttribute(context, element, name);
|
|
94461
94730
|
}
|
|
94462
94731
|
function reportUnmodelled2(context, element, handled) {
|
|
94463
94732
|
for (const child31 of elements(element)) {
|
|
@@ -94488,9 +94757,9 @@ function lines(parent, local) {
|
|
|
94488
94757
|
}
|
|
94489
94758
|
function numberFormat2(parent) {
|
|
94490
94759
|
const element = cxChild(parent, "numFmt");
|
|
94491
|
-
const formatCode2 =
|
|
94760
|
+
const formatCode2 = attribute4(element, "formatCode");
|
|
94492
94761
|
if (formatCode2 === void 0) return void 0;
|
|
94493
|
-
const linked =
|
|
94762
|
+
const linked = attribute4(element, "sourceLinked");
|
|
94494
94763
|
return {
|
|
94495
94764
|
formatCode: formatCode2,
|
|
94496
94765
|
...linked === "1" || linked === "true" ? { sourceLinked: true } : {},
|
|
@@ -94501,7 +94770,7 @@ function formula(parent, local) {
|
|
|
94501
94770
|
const element = cxChild(parent, local);
|
|
94502
94771
|
if (!element) return void 0;
|
|
94503
94772
|
const out = { formula: element.textContent ?? "" };
|
|
94504
|
-
const direction =
|
|
94773
|
+
const direction = attribute4(element, "dir");
|
|
94505
94774
|
if (direction !== void 0) out.direction = direction;
|
|
94506
94775
|
return out;
|
|
94507
94776
|
}
|
|
@@ -94535,8 +94804,8 @@ function parseLevel(context, element) {
|
|
|
94535
94804
|
{ points: points7 },
|
|
94536
94805
|
{
|
|
94537
94806
|
pointCount: indexAttribute(context, element, "ptCount"),
|
|
94538
|
-
formatCode:
|
|
94539
|
-
name:
|
|
94807
|
+
formatCode: attribute4(element, "formatCode"),
|
|
94808
|
+
name: attribute4(element, "name"),
|
|
94540
94809
|
extLst: extensionList2(element)
|
|
94541
94810
|
}
|
|
94542
94811
|
);
|
|
@@ -94549,7 +94818,7 @@ function parseDimension(context, element) {
|
|
|
94549
94818
|
levels: cxChildren(element, "lvl").map((level2) => parseLevel(context, level2))
|
|
94550
94819
|
},
|
|
94551
94820
|
{
|
|
94552
|
-
type:
|
|
94821
|
+
type: attribute4(element, "type"),
|
|
94553
94822
|
formula: formula(element, "f"),
|
|
94554
94823
|
nameFormula: formula(element, "nf"),
|
|
94555
94824
|
extLst: extensionList2(element)
|
|
@@ -94606,8 +94875,8 @@ function parseTitle2(context, element) {
|
|
|
94606
94875
|
tx: parseText2(context, cxChild(element, "tx")),
|
|
94607
94876
|
spPr: shapeProperties2(element),
|
|
94608
94877
|
txPr: textProperties2(element),
|
|
94609
|
-
position:
|
|
94610
|
-
align:
|
|
94878
|
+
position: attribute4(element, "pos"),
|
|
94879
|
+
align: attribute4(element, "align"),
|
|
94611
94880
|
overlay: boolAttribute(context, element, "overlay"),
|
|
94612
94881
|
extLst: extensionList2(element)
|
|
94613
94882
|
}
|
|
@@ -94618,8 +94887,8 @@ function parseLegend2(context, element) {
|
|
|
94618
94887
|
return assignDefined(
|
|
94619
94888
|
{},
|
|
94620
94889
|
{
|
|
94621
|
-
position:
|
|
94622
|
-
align:
|
|
94890
|
+
position: attribute4(element, "pos"),
|
|
94891
|
+
align: attribute4(element, "align"),
|
|
94623
94892
|
overlay: boolAttribute(context, element, "overlay"),
|
|
94624
94893
|
spPr: shapeProperties2(element),
|
|
94625
94894
|
txPr: textProperties2(element),
|
|
@@ -94668,7 +94937,7 @@ function parseUnits(context, element) {
|
|
|
94668
94937
|
return assignDefined(
|
|
94669
94938
|
{},
|
|
94670
94939
|
{
|
|
94671
|
-
unit:
|
|
94940
|
+
unit: attribute4(element, "unit"),
|
|
94672
94941
|
label: label ? parseTitle2(context, label) : void 0,
|
|
94673
94942
|
extLst: extensionList2(element)
|
|
94674
94943
|
}
|
|
@@ -94719,7 +94988,7 @@ var init_parse_axis = __esm({
|
|
|
94719
94988
|
"txPr",
|
|
94720
94989
|
"extLst"
|
|
94721
94990
|
]);
|
|
94722
|
-
tickMarks = (element) => element ? assignDefined({}, { type:
|
|
94991
|
+
tickMarks = (element) => element ? assignDefined({}, { type: attribute4(element, "type") }) : void 0;
|
|
94723
94992
|
}
|
|
94724
94993
|
});
|
|
94725
94994
|
|
|
@@ -94738,7 +95007,7 @@ function labelVisibility(context, element) {
|
|
|
94738
95007
|
function labelOptions2(context, element) {
|
|
94739
95008
|
const separator = cxChild(element, "separator");
|
|
94740
95009
|
return {
|
|
94741
|
-
position:
|
|
95010
|
+
position: attribute4(element, "pos"),
|
|
94742
95011
|
numberFormat: numberFormat2(element),
|
|
94743
95012
|
spPr: shapeProperties2(element),
|
|
94744
95013
|
txPr: textProperties2(element),
|
|
@@ -94771,7 +95040,7 @@ function parseBinning(context, element) {
|
|
|
94771
95040
|
return assignDefined(
|
|
94772
95041
|
{},
|
|
94773
95042
|
{
|
|
94774
|
-
intervalClosed:
|
|
95043
|
+
intervalClosed: attribute4(element, "intervalClosed"),
|
|
94775
95044
|
underflow: autoNumberAttribute(context, element, "underflow"),
|
|
94776
95045
|
overflow: autoNumberAttribute(context, element, "overflow"),
|
|
94777
95046
|
binSize: scalar4("binSize"),
|
|
@@ -94784,11 +95053,11 @@ function parseGeography(context, element) {
|
|
|
94784
95053
|
return assignDefined(
|
|
94785
95054
|
{},
|
|
94786
95055
|
{
|
|
94787
|
-
projectionType:
|
|
94788
|
-
viewedRegionType:
|
|
94789
|
-
cultureLanguage:
|
|
94790
|
-
cultureRegion:
|
|
94791
|
-
attribution:
|
|
95056
|
+
projectionType: attribute4(element, "projectionType"),
|
|
95057
|
+
viewedRegionType: attribute4(element, "viewedRegionType"),
|
|
95058
|
+
cultureLanguage: attribute4(element, "cultureLanguage"),
|
|
95059
|
+
cultureRegion: attribute4(element, "cultureRegion"),
|
|
95060
|
+
attribution: attribute4(element, "attribution"),
|
|
94792
95061
|
geoCacheXml: rawChild2(element, "geoCache"),
|
|
94793
95062
|
extLst: extensionList2(element)
|
|
94794
95063
|
}
|
|
@@ -94804,8 +95073,8 @@ function parseLayout(context, element) {
|
|
|
94804
95073
|
return assignDefined(
|
|
94805
95074
|
{},
|
|
94806
95075
|
{
|
|
94807
|
-
parentLabelLayout:
|
|
94808
|
-
regionLabelLayout:
|
|
95076
|
+
parentLabelLayout: attribute4(cxChild(element, "parentLabelLayout"), "val"),
|
|
95077
|
+
regionLabelLayout: attribute4(cxChild(element, "regionLabelLayout"), "val"),
|
|
94809
95078
|
visibility: visibility ? assignDefined(
|
|
94810
95079
|
{},
|
|
94811
95080
|
Object.fromEntries(
|
|
@@ -94817,7 +95086,7 @@ function parseLayout(context, element) {
|
|
|
94817
95086
|
geography: geography ? parseGeography(context, geography) : void 0,
|
|
94818
95087
|
statistics: statistics ? assignDefined(
|
|
94819
95088
|
{},
|
|
94820
|
-
{ quartileMethod:
|
|
95089
|
+
{ quartileMethod: attribute4(statistics, "quartileMethod") }
|
|
94821
95090
|
) : void 0,
|
|
94822
95091
|
subtotals: subtotals ? cxChildren(subtotals, "idx").map((idx) => indexAttribute(context, idx, "val")).filter((index) => index !== void 0) : void 0,
|
|
94823
95092
|
extLst: extensionList2(element)
|
|
@@ -94842,11 +95111,11 @@ function parseSeries2(context, element) {
|
|
|
94842
95111
|
const layout = cxChild(element, "layoutPr");
|
|
94843
95112
|
const axisIds = cxChildren(element, "axisId").map((axis) => indexAttribute(context, axis, "val")).filter((id) => id !== void 0);
|
|
94844
95113
|
return assignDefined(
|
|
94845
|
-
{ layoutId:
|
|
95114
|
+
{ layoutId: attribute4(element, "layoutId") ?? "", dataPoints, axisIds },
|
|
94846
95115
|
{
|
|
94847
95116
|
hidden: boolAttribute(context, element, "hidden"),
|
|
94848
95117
|
ownerIndex: numberAttribute(context, element, "ownerIdx"),
|
|
94849
|
-
uniqueId:
|
|
95118
|
+
uniqueId: attribute4(element, "uniqueId"),
|
|
94850
95119
|
formatIndex: numberAttribute(context, element, "formatIdx"),
|
|
94851
95120
|
tx: parseText2(context, cxChild(element, "tx")),
|
|
94852
95121
|
spPr: shapeProperties2(element),
|
|
@@ -98507,254 +98776,6 @@ var init_modern_comment_fields = __esm({
|
|
|
98507
98776
|
}
|
|
98508
98777
|
});
|
|
98509
98778
|
|
|
98510
|
-
// pptx/core/utils/modern-comment-mention-read.ts
|
|
98511
|
-
function readCommentMentions(node, authorName) {
|
|
98512
|
-
if (!node) {
|
|
98513
|
-
return void 0;
|
|
98514
|
-
}
|
|
98515
|
-
const found = [];
|
|
98516
|
-
for (const list3 of mentionChildrenNamed(node, "mentionLst")) {
|
|
98517
|
-
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
98518
|
-
const mention = readMention(entry2, authorName);
|
|
98519
|
-
if (mention) {
|
|
98520
|
-
found.push(mention);
|
|
98521
|
-
}
|
|
98522
|
-
}
|
|
98523
|
-
}
|
|
98524
|
-
for (const extension of mentionChildrenNamed(mentionChildrenNamed(node, "extLst")[0], "ext")) {
|
|
98525
|
-
const uri = String(extension["@_uri"] || "");
|
|
98526
|
-
for (const list3 of mentionChildrenNamed(extension, "mentionLst")) {
|
|
98527
|
-
for (const entry2 of mentionChildrenNamed(list3, "mention")) {
|
|
98528
|
-
const mention = readMention(entry2, authorName, uri);
|
|
98529
|
-
if (mention) {
|
|
98530
|
-
found.push(mention);
|
|
98531
|
-
}
|
|
98532
|
-
}
|
|
98533
|
-
}
|
|
98534
|
-
}
|
|
98535
|
-
found.sort((a, b) => a.startIndex - b.startIndex);
|
|
98536
|
-
return found.length > 0 ? found : void 0;
|
|
98537
|
-
}
|
|
98538
|
-
var mentionLocalName, mentionNodesOf, mentionChildrenNamed, MENTION_PERSON_KEYS, MENTION_LENGTH_KEYS, attribute4, integer3, readMention;
|
|
98539
|
-
var init_modern_comment_mention_read = __esm({
|
|
98540
|
-
"pptx/core/utils/modern-comment-mention-read.ts"() {
|
|
98541
|
-
mentionLocalName = (key2) => key2.split(":").pop() || key2;
|
|
98542
|
-
mentionNodesOf = (value) => {
|
|
98543
|
-
if (Array.isArray(value)) {
|
|
98544
|
-
return value.filter((entry2) => Boolean(entry2) && typeof entry2 === "object");
|
|
98545
|
-
}
|
|
98546
|
-
return value && typeof value === "object" ? [value] : [];
|
|
98547
|
-
};
|
|
98548
|
-
mentionChildrenNamed = (node, name) => {
|
|
98549
|
-
if (!node) {
|
|
98550
|
-
return [];
|
|
98551
|
-
}
|
|
98552
|
-
const result = [];
|
|
98553
|
-
for (const [key2, value] of Object.entries(node)) {
|
|
98554
|
-
if (!key2.startsWith("@_") && mentionLocalName(key2) === name) {
|
|
98555
|
-
result.push(...mentionNodesOf(value));
|
|
98556
|
-
}
|
|
98557
|
-
}
|
|
98558
|
-
return result;
|
|
98559
|
-
};
|
|
98560
|
-
MENTION_PERSON_KEYS = [
|
|
98561
|
-
"@_mentionpersonId",
|
|
98562
|
-
"@_mentionPersonId",
|
|
98563
|
-
"@_personId",
|
|
98564
|
-
"@_authorId"
|
|
98565
|
-
];
|
|
98566
|
-
MENTION_LENGTH_KEYS = ["@_length", "@_mentionCharCount", "@_len"];
|
|
98567
|
-
attribute4 = (node, keys) => {
|
|
98568
|
-
for (const key2 of keys) {
|
|
98569
|
-
const value = node[key2];
|
|
98570
|
-
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
98571
|
-
return String(value);
|
|
98572
|
-
}
|
|
98573
|
-
}
|
|
98574
|
-
return void 0;
|
|
98575
|
-
};
|
|
98576
|
-
integer3 = (value) => {
|
|
98577
|
-
if (value === void 0) {
|
|
98578
|
-
return void 0;
|
|
98579
|
-
}
|
|
98580
|
-
const parsed = Number.parseInt(value, 10);
|
|
98581
|
-
return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
|
|
98582
|
-
};
|
|
98583
|
-
readMention = (node, authorName, containerUri) => {
|
|
98584
|
-
const personId = attribute4(node, MENTION_PERSON_KEYS);
|
|
98585
|
-
const startIndex = integer3(attribute4(node, ["@_startIndex"]));
|
|
98586
|
-
const length = integer3(attribute4(node, MENTION_LENGTH_KEYS));
|
|
98587
|
-
if (!personId || startIndex === void 0 || length === void 0 || length === 0) {
|
|
98588
|
-
return void 0;
|
|
98589
|
-
}
|
|
98590
|
-
return {
|
|
98591
|
-
personId,
|
|
98592
|
-
startIndex,
|
|
98593
|
-
length,
|
|
98594
|
-
id: attribute4(node, ["@_mentionId", "@_id"]),
|
|
98595
|
-
authorName: authorName(personId),
|
|
98596
|
-
containerUri,
|
|
98597
|
-
rawXml: node
|
|
98598
|
-
};
|
|
98599
|
-
};
|
|
98600
|
-
}
|
|
98601
|
-
});
|
|
98602
|
-
|
|
98603
|
-
// pptx/core/utils/modern-comment-mentions.ts
|
|
98604
|
-
function rebaseCommentMentions(mentions, oldText, newText) {
|
|
98605
|
-
if (!mentions || mentions.length === 0) {
|
|
98606
|
-
return void 0;
|
|
98607
|
-
}
|
|
98608
|
-
if (oldText === newText) {
|
|
98609
|
-
return mentions;
|
|
98610
|
-
}
|
|
98611
|
-
const prefix = commonPrefixLength(oldText, newText);
|
|
98612
|
-
const suffix = commonSuffixLength(
|
|
98613
|
-
oldText,
|
|
98614
|
-
newText,
|
|
98615
|
-
Math.min(oldText.length, newText.length) - prefix
|
|
98616
|
-
);
|
|
98617
|
-
const changeEnd = oldText.length - suffix;
|
|
98618
|
-
const delta2 = newText.length - oldText.length;
|
|
98619
|
-
const result = [];
|
|
98620
|
-
for (const mention of mentions) {
|
|
98621
|
-
const start = mention.startIndex;
|
|
98622
|
-
const end = start + mention.length;
|
|
98623
|
-
const span = oldText.slice(start, end);
|
|
98624
|
-
if (span.length !== mention.length) {
|
|
98625
|
-
continue;
|
|
98626
|
-
}
|
|
98627
|
-
let next = -1;
|
|
98628
|
-
if (end <= prefix) {
|
|
98629
|
-
next = start;
|
|
98630
|
-
} else if (start >= changeEnd) {
|
|
98631
|
-
next = start + delta2;
|
|
98632
|
-
}
|
|
98633
|
-
if (next >= 0 && newText.slice(next, next + mention.length) === span) {
|
|
98634
|
-
result.push(next === start ? mention : { ...mention, startIndex: next });
|
|
98635
|
-
continue;
|
|
98636
|
-
}
|
|
98637
|
-
const relocated = nearestOccurrence(newText, span, next >= 0 ? next : start);
|
|
98638
|
-
if (relocated >= 0) {
|
|
98639
|
-
result.push({ ...mention, startIndex: relocated });
|
|
98640
|
-
}
|
|
98641
|
-
}
|
|
98642
|
-
return result.length > 0 ? result : void 0;
|
|
98643
|
-
}
|
|
98644
|
-
function buildMentionListNode(mentions) {
|
|
98645
|
-
if (!mentions || mentions.length === 0) {
|
|
98646
|
-
return void 0;
|
|
98647
|
-
}
|
|
98648
|
-
return { "p188:mention": mentions.map(buildMention) };
|
|
98649
|
-
}
|
|
98650
|
-
function applyCommentMentions(node, mentions, extension, replace) {
|
|
98651
|
-
if (!replace) {
|
|
98652
|
-
return extension;
|
|
98653
|
-
}
|
|
98654
|
-
const { direct, byUri } = groupByContainer(mentions);
|
|
98655
|
-
const directList = buildMentionListNode(direct);
|
|
98656
|
-
if (directList) {
|
|
98657
|
-
node["p188:mentionLst"] = directList;
|
|
98658
|
-
}
|
|
98659
|
-
if (!extension) {
|
|
98660
|
-
return void 0;
|
|
98661
|
-
}
|
|
98662
|
-
const rebuilt = stripMentionLists(extension);
|
|
98663
|
-
const extensionKey = Object.keys(rebuilt).find((key2) => mentionLocalName(key2) === "ext") || "p188:ext";
|
|
98664
|
-
const entries = mentionNodesOf(rebuilt[extensionKey]).map((entry2) => {
|
|
98665
|
-
const list3 = buildMentionListNode(byUri.get(String(entry2["@_uri"] || "")));
|
|
98666
|
-
const next = stripMentionLists(entry2);
|
|
98667
|
-
if (list3) {
|
|
98668
|
-
next["p188:mentionLst"] = list3;
|
|
98669
|
-
}
|
|
98670
|
-
return next;
|
|
98671
|
-
});
|
|
98672
|
-
if (entries.length > 0) {
|
|
98673
|
-
rebuilt[extensionKey] = entries.length === 1 ? entries[0] : entries;
|
|
98674
|
-
}
|
|
98675
|
-
return rebuilt;
|
|
98676
|
-
}
|
|
98677
|
-
var commonPrefixLength, commonSuffixLength, nearestOccurrence, buildMention, stripMentionLists, groupByContainer;
|
|
98678
|
-
var init_modern_comment_mentions = __esm({
|
|
98679
|
-
"pptx/core/utils/modern-comment-mentions.ts"() {
|
|
98680
|
-
init_modern_comment_mention_read();
|
|
98681
|
-
init_modern_comment_mention_read();
|
|
98682
|
-
commonPrefixLength = (a, b) => {
|
|
98683
|
-
const max = Math.min(a.length, b.length);
|
|
98684
|
-
let index = 0;
|
|
98685
|
-
while (index < max && a[index] === b[index]) {
|
|
98686
|
-
index += 1;
|
|
98687
|
-
}
|
|
98688
|
-
return index;
|
|
98689
|
-
};
|
|
98690
|
-
commonSuffixLength = (a, b, limit) => {
|
|
98691
|
-
let index = 0;
|
|
98692
|
-
while (index < limit && a[a.length - 1 - index] === b[b.length - 1 - index]) {
|
|
98693
|
-
index += 1;
|
|
98694
|
-
}
|
|
98695
|
-
return index;
|
|
98696
|
-
};
|
|
98697
|
-
nearestOccurrence = (text2, span, hint) => {
|
|
98698
|
-
let best = -1;
|
|
98699
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
98700
|
-
let at2 = text2.indexOf(span);
|
|
98701
|
-
while (at2 !== -1) {
|
|
98702
|
-
const distance = Math.abs(at2 - hint);
|
|
98703
|
-
if (distance < bestDistance) {
|
|
98704
|
-
best = at2;
|
|
98705
|
-
bestDistance = distance;
|
|
98706
|
-
}
|
|
98707
|
-
at2 = text2.indexOf(span, at2 + 1);
|
|
98708
|
-
}
|
|
98709
|
-
return best;
|
|
98710
|
-
};
|
|
98711
|
-
buildMention = (mention) => {
|
|
98712
|
-
const node = {};
|
|
98713
|
-
for (const [key2, value] of Object.entries(mention.rawXml || {})) {
|
|
98714
|
-
if (key2.startsWith("@_")) {
|
|
98715
|
-
node[key2] = value;
|
|
98716
|
-
}
|
|
98717
|
-
}
|
|
98718
|
-
const personKey = MENTION_PERSON_KEYS.find((key2) => node[key2] !== void 0) || "@_mentionpersonId";
|
|
98719
|
-
const lengthKey = MENTION_LENGTH_KEYS.find((key2) => node[key2] !== void 0) || "@_length";
|
|
98720
|
-
node[personKey] = mention.personId;
|
|
98721
|
-
node[lengthKey] = String(mention.length);
|
|
98722
|
-
node["@_startIndex"] = String(mention.startIndex);
|
|
98723
|
-
if (mention.id) {
|
|
98724
|
-
const idKey = node["@_id"] !== void 0 && node["@_mentionId"] === void 0 ? "@_id" : "@_mentionId";
|
|
98725
|
-
node[idKey] = mention.id;
|
|
98726
|
-
}
|
|
98727
|
-
return node;
|
|
98728
|
-
};
|
|
98729
|
-
stripMentionLists = (node) => {
|
|
98730
|
-
const result = {};
|
|
98731
|
-
for (const [key2, value] of Object.entries(node)) {
|
|
98732
|
-
if (key2.startsWith("@_") || mentionLocalName(key2) !== "mentionLst") {
|
|
98733
|
-
result[key2] = value;
|
|
98734
|
-
}
|
|
98735
|
-
}
|
|
98736
|
-
return result;
|
|
98737
|
-
};
|
|
98738
|
-
groupByContainer = (mentions) => {
|
|
98739
|
-
const direct = [];
|
|
98740
|
-
const byUri = /* @__PURE__ */ new Map();
|
|
98741
|
-
for (const mention of mentions || []) {
|
|
98742
|
-
if (!mention.containerUri) {
|
|
98743
|
-
direct.push(mention);
|
|
98744
|
-
continue;
|
|
98745
|
-
}
|
|
98746
|
-
const bucket = byUri.get(mention.containerUri);
|
|
98747
|
-
if (bucket) {
|
|
98748
|
-
bucket.push(mention);
|
|
98749
|
-
} else {
|
|
98750
|
-
byUri.set(mention.containerUri, [mention]);
|
|
98751
|
-
}
|
|
98752
|
-
}
|
|
98753
|
-
return { direct, byUri };
|
|
98754
|
-
};
|
|
98755
|
-
}
|
|
98756
|
-
});
|
|
98757
|
-
|
|
98758
98779
|
// pptx/core/utils/modern-comment-text-body.ts
|
|
98759
98780
|
function flattenBodyText(node) {
|
|
98760
98781
|
if (!node) {
|
|
@@ -99148,7 +99169,13 @@ var init_modern_comment_xml = __esm({
|
|
|
99148
99169
|
const originalBody = child23(raw2, "txBody");
|
|
99149
99170
|
node["p188:txBody"] = applyModernCommentText(originalBody, comment.text);
|
|
99150
99171
|
const originalText = originalBody ? flattenBodyText(originalBody).join("\n") : comment.text;
|
|
99151
|
-
const
|
|
99172
|
+
const loadedMentions = raw2 ? readCommentMentions(raw2, () => void 0) : void 0;
|
|
99173
|
+
const mentions = rebaseCommentMentions(
|
|
99174
|
+
comment.mentions,
|
|
99175
|
+
originalText,
|
|
99176
|
+
comment.text,
|
|
99177
|
+
loadedMentions ?? []
|
|
99178
|
+
);
|
|
99152
99179
|
const extension = applyCommentMentions(node, mentions, child23(raw2, "extLst"), ownsMentions);
|
|
99153
99180
|
if (extension) {
|
|
99154
99181
|
node["p188:extLst"] = extension;
|
|
@@ -131524,7 +131551,13 @@ var init_PptxHandlerRuntimeElementParsing = __esm({
|
|
|
131524
131551
|
if (posterRId && relsMap) {
|
|
131525
131552
|
const posterTarget = relsMap.get(posterRId);
|
|
131526
131553
|
if (posterTarget) {
|
|
131527
|
-
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")
|
|
131554
|
+
if (posterTarget.startsWith("http://") || posterTarget.startsWith("https://")) {
|
|
131555
|
+
if (this.allowExternalImages === true) {
|
|
131556
|
+
posterImage = posterTarget;
|
|
131557
|
+
imagePath = posterTarget;
|
|
131558
|
+
imageData = posterTarget;
|
|
131559
|
+
}
|
|
131560
|
+
} else if (posterTarget.startsWith("data:")) {
|
|
131528
131561
|
posterImage = posterTarget;
|
|
131529
131562
|
imagePath = posterTarget;
|
|
131530
131563
|
imageData = posterTarget;
|
|
@@ -132710,7 +132743,12 @@ var init_PptxHandlerRuntimeShapeImageFill = __esm({
|
|
|
132710
132743
|
const slideRels = this.slideRelsMap.get(slidePath);
|
|
132711
132744
|
const target = slideRels?.get(relId);
|
|
132712
132745
|
if (target) {
|
|
132713
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
132746
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
132747
|
+
if (this.allowExternalImages === true) {
|
|
132748
|
+
imagePath = target;
|
|
132749
|
+
imageData = target;
|
|
132750
|
+
}
|
|
132751
|
+
} else if (target.startsWith("data:")) {
|
|
132714
132752
|
imagePath = target;
|
|
132715
132753
|
imageData = target;
|
|
132716
132754
|
} else {
|
|
@@ -133183,7 +133221,9 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
|
133183
133221
|
const target = slideRels?.get(imageRelId);
|
|
133184
133222
|
let imageDataUrl;
|
|
133185
133223
|
if (target) {
|
|
133186
|
-
if (target.startsWith("http://") || target.startsWith("https://")
|
|
133224
|
+
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
133225
|
+
imageDataUrl = this.allowExternalImages === true ? target : void 0;
|
|
133226
|
+
} else if (target.startsWith("data:")) {
|
|
133187
133227
|
imageDataUrl = target;
|
|
133188
133228
|
} else {
|
|
133189
133229
|
const imagePath = this.resolveImagePath(slidePath, target);
|
|
@@ -142913,6 +142953,7 @@ var init_PptxHandlerRuntimeLoadSession = __esm({
|
|
|
142913
142953
|
async enrichBulletPictureElementsWithEmbeddedData(elements2, slidePath) {
|
|
142914
142954
|
await enrichBulletPictureImages(elements2, slidePath, {
|
|
142915
142955
|
slideRelsMap: this.slideRelsMap,
|
|
142956
|
+
allowExternalImages: this.allowExternalImages === true,
|
|
142916
142957
|
resolveImagePath: (path4, target) => this.resolveImagePath(path4, target),
|
|
142917
142958
|
getImageData: (imagePath) => this.getImageData(imagePath)
|
|
142918
142959
|
});
|