ooxml-core 1.6.0 → 1.6.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-DDEJ6CKU.mjs → PptxHandler-BL4B7CZO.mjs} +2 -2
- package/dist/automation/index.cjs +1 -1
- package/dist/automation/index.mjs +1 -1
- package/dist/chart/gradient-definition.d.ts +2 -0
- package/dist/chart/gradient-definition.d.ts.map +1 -1
- package/dist/chart/index.cjs +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/{chunk-5L4DHJV3.mjs → chunk-GAGSCAR3.mjs} +46 -43
- package/dist/{chunk-QXZJOUW4.mjs → chunk-NIHPA63A.mjs} +1 -1
- package/dist/{chunk-UQQGC6O3.mjs → chunk-TTPZITQN.mjs} +841 -614
- package/dist/{chunk-Q52O7SXQ.mjs → chunk-Z7IQR4S4.mjs} +3 -3
- package/dist/{chunk-EPNLABIU.mjs → chunk-ZAP5WLEN.mjs} +1 -1
- package/dist/crypto/index.cjs +281 -109
- package/dist/crypto/index.mjs +281 -109
- package/dist/diagram/engine/text-measure.d.ts +1 -1
- package/dist/diagram/layout/smartart-font-table.d.ts +1 -1
- package/dist/diagram/layout/smartart-layout-interpreter-linear-content-size.d.ts +1 -1
- package/dist/diagram/layout/smartart-layout-item-font-size.d.ts +1 -1
- package/dist/diagram/layout/smartart-layout-item-font-tier-fit.d.ts +1 -1
- package/dist/diagram/layout/smartart-line-pitch.d.ts +1 -1
- package/dist/diagram/layout/smartart-text-wrap-fit.d.ts +1 -1
- package/dist/docx/index.cjs +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/layout/index.cjs +1 -1
- package/dist/docx/layout/index.mjs +1 -1
- package/dist/docx/load/index.cjs +481 -254
- package/dist/docx/load/index.mjs +481 -254
- package/dist/docx/ui/index.cjs +1 -1
- package/dist/docx/ui/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pptx/automation/index.cjs +1391 -1154
- package/dist/pptx/automation/index.d.ts +3 -3
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{index-JNv7AJx5.d.ts → index-CKIUurnd.d.ts} +2 -2
- package/dist/pptx/chunks/{index-JNv7AJx5.d.ts.map → index-CKIUurnd.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-EZJZ7USt.d.ts → index-Cn-GzYGp.d.ts} +64 -15
- package/dist/pptx/chunks/{index-EZJZ7USt.d.ts.map → index-Cn-GzYGp.d.ts.map} +1 -1
- package/dist/pptx/chunks/{text-operations-DtCxXrMh.d.ts → text-operations-BHfAm5K9.d.ts} +8 -1
- package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +1270 -1088
- package/dist/pptx/cli/index.d.ts +1 -1
- 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/index.cjs +1411 -1174
- package/dist/pptx/index.d.ts +3 -3
- package/dist/pptx/index.mjs +5 -5
- package/dist/text/font-metrics/font-advance-widths-aptos-display.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-aptos.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-arial.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-calibri-light.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-calibri.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-segoe-ui.generated.d.ts +1 -1
- package/dist/text/font-metrics/font-advance-widths-times-new-roman.generated.d.ts +1 -1
- package/dist/visio/index.cjs +482 -232
- package/dist/visio/index.mjs +482 -232
- package/dist/visio/ui/data-graphic-rules.d.ts +2 -2
- package/dist/xlsx/formula/test-helpers.d.ts +9 -9
- package/dist/xlsx/index.cjs +1 -1
- package/dist/xlsx/index.mjs +1 -1
- package/dist/xlsx/load/index.cjs +415 -188
- package/dist/xlsx/load/index.mjs +415 -188
- package/package.json +5 -5
- package/dist/pptx/chunks/text-operations-DtCxXrMh.d.ts.map +0 -1
|
@@ -15985,12 +15985,12 @@ function reassignDescendantIds(element, mintId) {
|
|
|
15985
15985
|
if (element.type !== "group") {
|
|
15986
15986
|
return;
|
|
15987
15987
|
}
|
|
15988
|
-
for (const
|
|
15989
|
-
const next = mintId(
|
|
15988
|
+
for (const child13 of element.children) {
|
|
15989
|
+
const next = mintId(child13);
|
|
15990
15990
|
if (next !== void 0) {
|
|
15991
|
-
|
|
15991
|
+
child13.id = next;
|
|
15992
15992
|
}
|
|
15993
|
-
reassignDescendantIds(
|
|
15993
|
+
reassignDescendantIds(child13, mintId);
|
|
15994
15994
|
}
|
|
15995
15995
|
}
|
|
15996
15996
|
function groupElements(elements2, ids, groupId) {
|
|
@@ -16031,10 +16031,10 @@ function groupElements(elements2, ids, groupId) {
|
|
|
16031
16031
|
}
|
|
16032
16032
|
}
|
|
16033
16033
|
const children5 = gathered.map((el) => {
|
|
16034
|
-
const
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
return
|
|
16034
|
+
const child13 = cloneElement(el);
|
|
16035
|
+
child13.x = el.x - minX;
|
|
16036
|
+
child13.y = el.y - minY;
|
|
16037
|
+
return child13;
|
|
16038
16038
|
});
|
|
16039
16039
|
const group = {
|
|
16040
16040
|
type: "group",
|
|
@@ -16069,13 +16069,13 @@ function ungroupElements(elements2, groupId, childIds, options = {}) {
|
|
|
16069
16069
|
}
|
|
16070
16070
|
const intoTemplate = options.intoTemplate ?? isTemplateElementId(group.id);
|
|
16071
16071
|
const usedChildIds = [];
|
|
16072
|
-
const expanded = group.children.map((
|
|
16073
|
-
const newChildId = childIds[index] ??
|
|
16072
|
+
const expanded = group.children.map((child13, index) => {
|
|
16073
|
+
const newChildId = childIds[index] ?? child13.id;
|
|
16074
16074
|
usedChildIds.push(newChildId);
|
|
16075
|
-
const promoted = cloneElement(
|
|
16075
|
+
const promoted = cloneElement(child13);
|
|
16076
16076
|
promoted.id = newChildId;
|
|
16077
|
-
promoted.x =
|
|
16078
|
-
promoted.y =
|
|
16077
|
+
promoted.x = child13.x + group.x;
|
|
16078
|
+
promoted.y = child13.y + group.y;
|
|
16079
16079
|
reassignDescendantIds(
|
|
16080
16080
|
promoted,
|
|
16081
16081
|
(descendant) => isTemplateElementId(descendant.id) === intoTemplate ? void 0 : makeStoreAwareId(intoTemplate, newChildId)
|
|
@@ -17310,11 +17310,11 @@ function findFirstByLocalName(node, localName15) {
|
|
|
17310
17310
|
if (key.startsWith("@_") || key === "#text") {
|
|
17311
17311
|
continue;
|
|
17312
17312
|
}
|
|
17313
|
-
for (const
|
|
17314
|
-
if (typeof
|
|
17313
|
+
for (const child13 of ensureArray(node[key])) {
|
|
17314
|
+
if (typeof child13 !== "object") {
|
|
17315
17315
|
continue;
|
|
17316
17316
|
}
|
|
17317
|
-
const found = findFirstByLocalName(
|
|
17317
|
+
const found = findFirstByLocalName(child13, localName15);
|
|
17318
17318
|
if (found) {
|
|
17319
17319
|
return found;
|
|
17320
17320
|
}
|
|
@@ -17600,7 +17600,7 @@ function getOleObjectTypeLabel(oleObjectType) {
|
|
|
17600
17600
|
}
|
|
17601
17601
|
}
|
|
17602
17602
|
|
|
17603
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
17603
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js
|
|
17604
17604
|
var OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
|
|
17605
17605
|
var ENDOFCHAIN = 4294967294;
|
|
17606
17606
|
var FREESECT = 4294967295;
|
|
@@ -17608,7 +17608,9 @@ var FATSECT = 4294967293;
|
|
|
17608
17608
|
var DIFSECT = 4294967292;
|
|
17609
17609
|
var MAXREGSECT = 4294967290;
|
|
17610
17610
|
var ENTRY_TYPE_EMPTY = 0;
|
|
17611
|
+
var ENTRY_TYPE_STORAGE = 1;
|
|
17611
17612
|
var ENTRY_TYPE_STREAM = 2;
|
|
17613
|
+
var NOSTREAM = 4294967295;
|
|
17612
17614
|
var ENTRY_TYPE_ROOT = 5;
|
|
17613
17615
|
var DIR_ENTRY_SIZE = 128;
|
|
17614
17616
|
var Ole2ParseError = class extends Error {
|
|
@@ -17618,10 +17620,174 @@ var Ole2ParseError = class extends Error {
|
|
|
17618
17620
|
}
|
|
17619
17621
|
};
|
|
17620
17622
|
|
|
17621
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
const
|
|
17623
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-directory.js
|
|
17624
|
+
var FILETIME_UNIX_EPOCH = 116444736000000000n;
|
|
17625
|
+
function readFileTime(view, offset) {
|
|
17626
|
+
const ticks = view.getBigUint64(offset, true);
|
|
17627
|
+
if (ticks === 0n)
|
|
17628
|
+
return void 0;
|
|
17629
|
+
const ms = Number((ticks - FILETIME_UNIX_EPOCH) / 10000n);
|
|
17630
|
+
const date = new Date(ms);
|
|
17631
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
17632
|
+
}
|
|
17633
|
+
function decodeSlot(dir, id, majorVersion, warnings) {
|
|
17634
|
+
const view = new DataView(dir.buffer, dir.byteOffset + id * DIR_ENTRY_SIZE, DIR_ENTRY_SIZE);
|
|
17635
|
+
const nameLen = view.getUint16(64, true);
|
|
17636
|
+
const type = view.getUint8(66);
|
|
17637
|
+
const nameValid = nameLen >= 2 && nameLen <= 64 && nameLen % 2 === 0 && view.getUint16(nameLen - 2, true) === 0;
|
|
17638
|
+
let name = "";
|
|
17639
|
+
if (nameValid)
|
|
17640
|
+
for (let j = 0; j < nameLen - 2; j += 2)
|
|
17641
|
+
name += String.fromCharCode(view.getUint16(j, true));
|
|
17642
|
+
const link = (offset) => {
|
|
17643
|
+
const value = view.getUint32(offset, true);
|
|
17644
|
+
return value === NOSTREAM ? -1 : value;
|
|
17645
|
+
};
|
|
17646
|
+
const sizeLow = view.getUint32(120, true);
|
|
17647
|
+
const sizeHigh = view.getUint32(124, true);
|
|
17648
|
+
let size = sizeLow;
|
|
17649
|
+
if (majorVersion === 4)
|
|
17650
|
+
size = sizeLow + sizeHigh * 4294967296;
|
|
17651
|
+
else if (sizeHigh !== 0 && type !== ENTRY_TYPE_EMPTY) {
|
|
17652
|
+
warnings.push({ code: "size-high-bits", message: `Ignored v3 stream-size high bits on directory entry ${id}` });
|
|
17653
|
+
}
|
|
17654
|
+
return {
|
|
17655
|
+
id,
|
|
17656
|
+
type,
|
|
17657
|
+
nameValid,
|
|
17658
|
+
entry: {
|
|
17659
|
+
id,
|
|
17660
|
+
name,
|
|
17661
|
+
type,
|
|
17662
|
+
color: view.getUint8(67),
|
|
17663
|
+
leftSiblingId: link(68),
|
|
17664
|
+
rightSiblingId: link(72),
|
|
17665
|
+
childId: link(76),
|
|
17666
|
+
clsid: new Uint8Array(view.buffer.slice(view.byteOffset + 80, view.byteOffset + 96)),
|
|
17667
|
+
stateBits: view.getUint32(96, true),
|
|
17668
|
+
created: readFileTime(view, 100),
|
|
17669
|
+
modified: readFileTime(view, 108),
|
|
17670
|
+
startSector: view.getUint32(116, true),
|
|
17671
|
+
size,
|
|
17672
|
+
parentId: -1
|
|
17673
|
+
}
|
|
17674
|
+
};
|
|
17675
|
+
}
|
|
17676
|
+
function readDirectory(dir, majorVersion, strict, warnings) {
|
|
17677
|
+
const count = Math.floor(dir.length / DIR_ENTRY_SIZE);
|
|
17678
|
+
const slots = [];
|
|
17679
|
+
for (let id = 0; id < count; id++)
|
|
17680
|
+
slots.push(decodeSlot(dir, id, majorVersion, warnings));
|
|
17681
|
+
const roots = slots.filter((slot) => slot.type === ENTRY_TYPE_ROOT);
|
|
17682
|
+
if (roots.length !== 1 || !roots[0].nameValid)
|
|
17683
|
+
throw new Ole2ParseError("Invalid root directory entry");
|
|
17684
|
+
const root = roots[0];
|
|
17685
|
+
root.entry.path = [];
|
|
17686
|
+
const reached = /* @__PURE__ */ new Set([root.id]);
|
|
17687
|
+
const fail2 = (message) => {
|
|
17688
|
+
if (strict)
|
|
17689
|
+
throw new Ole2ParseError(message);
|
|
17690
|
+
warnings.push({ code: "directory-link", message });
|
|
17691
|
+
};
|
|
17692
|
+
const pending = [];
|
|
17693
|
+
const push2 = (id, parent, from) => {
|
|
17694
|
+
if (id === -1)
|
|
17695
|
+
return;
|
|
17696
|
+
const target = slots[id];
|
|
17697
|
+
if (!target || target.type === ENTRY_TYPE_EMPTY || target.type === ENTRY_TYPE_ROOT) {
|
|
17698
|
+
fail2(`Directory entry ${from} links to invalid entry ${id}`);
|
|
17699
|
+
return;
|
|
17700
|
+
}
|
|
17701
|
+
if (reached.has(id)) {
|
|
17702
|
+
fail2(`Cyclic directory tree at entry ${id}`);
|
|
17703
|
+
return;
|
|
17704
|
+
}
|
|
17705
|
+
reached.add(id);
|
|
17706
|
+
pending.push({ id, parent });
|
|
17707
|
+
};
|
|
17708
|
+
push2(root.entry.childId, root, root.id);
|
|
17709
|
+
while (pending.length) {
|
|
17710
|
+
const { id, parent } = pending.pop();
|
|
17711
|
+
const slot = slots[id];
|
|
17712
|
+
if (!slot.nameValid)
|
|
17713
|
+
throw new Ole2ParseError("Invalid directory entry name");
|
|
17714
|
+
slot.entry.parentId = parent.id;
|
|
17715
|
+
slot.entry.path = [...parent.entry.path, slot.entry.name];
|
|
17716
|
+
push2(slot.entry.leftSiblingId, parent, id);
|
|
17717
|
+
push2(slot.entry.rightSiblingId, parent, id);
|
|
17718
|
+
if (slot.type === ENTRY_TYPE_STORAGE)
|
|
17719
|
+
push2(slot.entry.childId, slot, id);
|
|
17720
|
+
}
|
|
17721
|
+
const entries = [];
|
|
17722
|
+
for (const slot of slots) {
|
|
17723
|
+
if (slot.type === ENTRY_TYPE_EMPTY)
|
|
17724
|
+
continue;
|
|
17725
|
+
if (!reached.has(slot.id)) {
|
|
17726
|
+
if (!slot.nameValid) {
|
|
17727
|
+
if (strict)
|
|
17728
|
+
throw new Ole2ParseError("Invalid directory entry name");
|
|
17729
|
+
warnings.push({ code: "invalid-unreachable-entry", message: `Skipped undecodable stale directory entry ${slot.id}` });
|
|
17730
|
+
continue;
|
|
17731
|
+
}
|
|
17732
|
+
if (strict)
|
|
17733
|
+
throw new Ole2ParseError(`Directory entry ${slot.id} is not reachable from the root`);
|
|
17734
|
+
warnings.push({ code: "unreachable-entry", message: `Directory entry ${slot.id} (${slot.entry.name}) is not reachable from the root` });
|
|
17735
|
+
}
|
|
17736
|
+
entries.push(slot.entry);
|
|
17737
|
+
}
|
|
17738
|
+
return entries;
|
|
17739
|
+
}
|
|
17740
|
+
function sameName(a, b) {
|
|
17741
|
+
return a.length === b.length && a.toUpperCase() === b.toUpperCase();
|
|
17742
|
+
}
|
|
17743
|
+
function bareName(name) {
|
|
17744
|
+
return name.replace(/^[\u0001-\u0006]/, "");
|
|
17745
|
+
}
|
|
17746
|
+
function normalizePath(path, rootName) {
|
|
17747
|
+
const parts = typeof path === "string" ? path.split("/").filter((part) => part !== "") : [...path];
|
|
17748
|
+
if (parts.length && sameName(parts[0], rootName) && typeof path === "string")
|
|
17749
|
+
parts.shift();
|
|
17750
|
+
return parts;
|
|
17751
|
+
}
|
|
17752
|
+
function child2(entries, parentId, name) {
|
|
17753
|
+
const children5 = entries.filter((entry) => entry.parentId === parentId && entry.path !== void 0);
|
|
17754
|
+
const pick = (matches) => matches.length === 1 ? matches[0] : void 0;
|
|
17755
|
+
const exact = children5.filter((entry) => entry.name === name);
|
|
17756
|
+
if (exact.length)
|
|
17757
|
+
return pick(exact);
|
|
17758
|
+
const folded = children5.filter((entry) => sameName(entry.name, name));
|
|
17759
|
+
if (folded.length)
|
|
17760
|
+
return pick(folded);
|
|
17761
|
+
return pick(children5.filter((entry) => sameName(bareName(entry.name), bareName(name))));
|
|
17762
|
+
}
|
|
17763
|
+
function findDirectoryEntry(entries, path) {
|
|
17764
|
+
const root = entries.find((entry) => entry.type === ENTRY_TYPE_ROOT);
|
|
17765
|
+
if (!root)
|
|
17766
|
+
return void 0;
|
|
17767
|
+
let current = root;
|
|
17768
|
+
for (const name of normalizePath(path, root.name)) {
|
|
17769
|
+
if (current.type !== ENTRY_TYPE_ROOT && current.type !== ENTRY_TYPE_STORAGE)
|
|
17770
|
+
return void 0;
|
|
17771
|
+
current = child2(entries, current.id, name);
|
|
17772
|
+
if (!current)
|
|
17773
|
+
return void 0;
|
|
17774
|
+
}
|
|
17775
|
+
return current;
|
|
17776
|
+
}
|
|
17777
|
+
function findStreamByName(entries, name, isReadable) {
|
|
17778
|
+
const root = entries.find((entry) => entry.type === ENTRY_TYPE_ROOT);
|
|
17779
|
+
if (root && root.name === name)
|
|
17780
|
+
return root;
|
|
17781
|
+
const top = entries.filter((entry) => entry.parentId === root?.id && isReadable(entry));
|
|
17782
|
+
return top.find((entry) => entry.name === name) ?? top.find((entry) => sameName(entry.name, name)) ?? entries.find((entry) => entry.name === name && isReadable(entry));
|
|
17783
|
+
}
|
|
17784
|
+
|
|
17785
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-read.js
|
|
17786
|
+
function parseOle2(buffer, options = {}) {
|
|
17787
|
+
const strict = options.strict === true;
|
|
17788
|
+
const data = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
17789
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
17790
|
+
const warnings = [];
|
|
17625
17791
|
if (data.length < 512) {
|
|
17626
17792
|
throw new Ole2ParseError("Truncated OLE2 compound file header");
|
|
17627
17793
|
}
|
|
@@ -17630,11 +17796,12 @@ function parseOle2(buffer) {
|
|
|
17630
17796
|
throw new Ole2ParseError("Not a valid OLE2 compound file");
|
|
17631
17797
|
}
|
|
17632
17798
|
}
|
|
17633
|
-
view.getUint16(24, true);
|
|
17634
17799
|
const majorVersion = view.getUint16(26, true);
|
|
17635
17800
|
const byteOrder = view.getUint16(28, true);
|
|
17636
17801
|
if (byteOrder !== 65534) {
|
|
17637
|
-
|
|
17802
|
+
if (strict)
|
|
17803
|
+
throw new Ole2ParseError("Invalid byte order mark");
|
|
17804
|
+
warnings.push({ code: "byte-order", message: `Ignored byte order mark 0x${byteOrder.toString(16)}` });
|
|
17638
17805
|
}
|
|
17639
17806
|
const sectorSizePower = view.getUint16(30, true);
|
|
17640
17807
|
const miniSectorSizePower = view.getUint16(32, true);
|
|
@@ -17643,10 +17810,14 @@ function parseOle2(buffer) {
|
|
|
17643
17810
|
}
|
|
17644
17811
|
const sectorSize = 1 << sectorSizePower;
|
|
17645
17812
|
const miniSectorSize = 1 << miniSectorSizePower;
|
|
17646
|
-
if (data.length < sectorSize
|
|
17813
|
+
if (data.length < sectorSize)
|
|
17647
17814
|
throw new Ole2ParseError("Truncated OLE2 sector");
|
|
17815
|
+
if (data.length % sectorSize !== 0) {
|
|
17816
|
+
if (strict)
|
|
17817
|
+
throw new Ole2ParseError("Truncated OLE2 sector");
|
|
17818
|
+
warnings.push({ code: "unaligned-length", message: `File length ${data.length} is not a multiple of ${sectorSize}` });
|
|
17648
17819
|
}
|
|
17649
|
-
const sectorCount = data.length / sectorSize - 1;
|
|
17820
|
+
const sectorCount = Math.ceil(data.length / sectorSize) - 1;
|
|
17650
17821
|
const totalFATSectors = view.getUint32(44, true);
|
|
17651
17822
|
const firstDirectorySector = view.getUint32(48, true);
|
|
17652
17823
|
const miniStreamCutoff = view.getUint32(56, true);
|
|
@@ -17667,6 +17838,13 @@ function parseOle2(buffer) {
|
|
|
17667
17838
|
}
|
|
17668
17839
|
return data.subarray(offset, offset + sectorSize);
|
|
17669
17840
|
}
|
|
17841
|
+
function copySector(sector, target, at2, want) {
|
|
17842
|
+
const offset = sectorOffset(sector);
|
|
17843
|
+
if (sector >= sectorCount || offset + want > data.length) {
|
|
17844
|
+
throw new Ole2ParseError(`Sector ${sector} at offset ${offset} exceeds file size ${data.length}`);
|
|
17845
|
+
}
|
|
17846
|
+
target.set(data.subarray(offset, offset + want), at2);
|
|
17847
|
+
}
|
|
17670
17848
|
const fatSectors = [];
|
|
17671
17849
|
for (let i2 = 0; i2 < 109 && fatSectors.length < totalFATSectors; i2++) {
|
|
17672
17850
|
const sector = view.getUint32(76 + i2 * 4, true);
|
|
@@ -17702,29 +17880,36 @@ function parseOle2(buffer) {
|
|
|
17702
17880
|
fatEntries.push(fatView.getUint32(i2 * 4, true));
|
|
17703
17881
|
}
|
|
17704
17882
|
}
|
|
17705
|
-
function
|
|
17706
|
-
const
|
|
17707
|
-
let current = startSector;
|
|
17883
|
+
function followChain(table, start, label, needed) {
|
|
17884
|
+
const ids = [];
|
|
17708
17885
|
const visited = /* @__PURE__ */ new Set();
|
|
17886
|
+
let current = start;
|
|
17709
17887
|
while (current <= MAXREGSECT) {
|
|
17888
|
+
if (!strict && needed !== void 0 && ids.length >= needed)
|
|
17889
|
+
return ids;
|
|
17710
17890
|
if (visited.has(current)) {
|
|
17711
|
-
throw new Ole2ParseError(`Circular reference in
|
|
17891
|
+
throw new Ole2ParseError(`Circular reference in ${label} chain at sector ${current}`);
|
|
17712
17892
|
}
|
|
17713
17893
|
visited.add(current);
|
|
17714
|
-
|
|
17715
|
-
if (
|
|
17716
|
-
throw new Ole2ParseError(
|
|
17717
|
-
current =
|
|
17718
|
-
}
|
|
17719
|
-
if (current !== ENDOFCHAIN)
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
for (const sector of sectors) {
|
|
17725
|
-
result.set(sector, offset);
|
|
17726
|
-
offset += sectorSize;
|
|
17894
|
+
ids.push(current);
|
|
17895
|
+
if (table[current] === void 0)
|
|
17896
|
+
throw new Ole2ParseError(`Missing ${label} chain entry`);
|
|
17897
|
+
current = table[current];
|
|
17898
|
+
}
|
|
17899
|
+
if (current !== ENDOFCHAIN) {
|
|
17900
|
+
if (strict || needed === void 0 || ids.length < needed) {
|
|
17901
|
+
throw new Ole2ParseError(`Invalid ${label} chain terminator`);
|
|
17902
|
+
}
|
|
17903
|
+
warnings.push({ code: "chain-terminator", message: `Accepted ${label} chain ending in 0x${current.toString(16)}` });
|
|
17727
17904
|
}
|
|
17905
|
+
return ids;
|
|
17906
|
+
}
|
|
17907
|
+
function readMetadataChain(startSector, label) {
|
|
17908
|
+
if (startSector > MAXREGSECT)
|
|
17909
|
+
return new Uint8Array(0);
|
|
17910
|
+
const ids = followChain(fatEntries, startSector, label === "directory" ? "FAT" : label);
|
|
17911
|
+
const result = new Uint8Array(ids.length * sectorSize);
|
|
17912
|
+
ids.forEach((id, i2) => result.set(readSector(id), i2 * sectorSize));
|
|
17728
17913
|
return result;
|
|
17729
17914
|
}
|
|
17730
17915
|
function readStream(startSector, size) {
|
|
@@ -17732,68 +17917,44 @@ function parseOle2(buffer) {
|
|
|
17732
17917
|
return new Uint8Array(0);
|
|
17733
17918
|
if (size > sectorCount * sectorSize)
|
|
17734
17919
|
throw new Ole2ParseError("Stream size exceeds file size");
|
|
17735
|
-
const
|
|
17736
|
-
|
|
17920
|
+
const needed = Math.ceil(size / sectorSize);
|
|
17921
|
+
const ids = followChain(fatEntries, startSector, "FAT", needed);
|
|
17922
|
+
if (ids.length < needed)
|
|
17737
17923
|
throw new Ole2ParseError("Truncated stream sector chain");
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
const numEntries = Math.floor(dirRaw.length / DIR_ENTRY_SIZE);
|
|
17742
|
-
const entries = [];
|
|
17743
|
-
for (let i2 = 0; i2 < numEntries; i2++) {
|
|
17744
|
-
const entryOffset = i2 * DIR_ENTRY_SIZE;
|
|
17745
|
-
const entryView = new DataView(dirRaw.buffer, dirRaw.byteOffset + entryOffset, DIR_ENTRY_SIZE);
|
|
17746
|
-
const nameLen = entryView.getUint16(64, true);
|
|
17747
|
-
const objectType = entryView.getUint8(66);
|
|
17748
|
-
if (objectType === ENTRY_TYPE_EMPTY) {
|
|
17749
|
-
continue;
|
|
17924
|
+
const result = new Uint8Array(size);
|
|
17925
|
+
for (let i2 = 0; i2 < needed; i2++) {
|
|
17926
|
+
copySector(ids[i2], result, i2 * sectorSize, Math.min(sectorSize, size - i2 * sectorSize));
|
|
17750
17927
|
}
|
|
17751
|
-
|
|
17752
|
-
|
|
17928
|
+
return result;
|
|
17929
|
+
}
|
|
17930
|
+
if (firstDirectorySector > MAXREGSECT)
|
|
17931
|
+
throw new Ole2ParseError("Missing directory chain");
|
|
17932
|
+
const entries = readDirectory(readMetadataChain(firstDirectorySector, "directory"), majorVersion, strict, warnings);
|
|
17933
|
+
for (const entry of entries) {
|
|
17934
|
+
if (majorVersion === 4 && (!Number.isSafeInteger(entry.size) || entry.size > sectorCount * sectorSize)) {
|
|
17935
|
+
throw new Ole2ParseError("Stream size exceeds supported file bounds");
|
|
17753
17936
|
}
|
|
17754
|
-
const nameBytes = Math.max(0, nameLen - 2);
|
|
17755
|
-
let name = "";
|
|
17756
|
-
for (let j = 0; j < nameBytes; j += 2) {
|
|
17757
|
-
name += String.fromCharCode(entryView.getUint16(j, true));
|
|
17758
|
-
}
|
|
17759
|
-
const leftSiblingId = entryView.getUint32(68, true);
|
|
17760
|
-
const rightSiblingId = entryView.getUint32(72, true);
|
|
17761
|
-
const childId = entryView.getUint32(76, true);
|
|
17762
|
-
const clsid = new Uint8Array(entryView.buffer.slice(entryView.byteOffset + 80, entryView.byteOffset + 96));
|
|
17763
|
-
const startSector = entryView.getUint32(116, true);
|
|
17764
|
-
const sizeLow = entryView.getUint32(120, true);
|
|
17765
|
-
let size = sizeLow;
|
|
17766
|
-
if (majorVersion === 4) {
|
|
17767
|
-
const sizeHigh = entryView.getUint32(124, true);
|
|
17768
|
-
size = sizeLow + sizeHigh * 4294967296;
|
|
17769
|
-
if (!Number.isSafeInteger(size) || size > sectorCount * sectorSize) {
|
|
17770
|
-
throw new Ole2ParseError("Stream size exceeds supported file bounds");
|
|
17771
|
-
}
|
|
17772
|
-
}
|
|
17773
|
-
entries.push({
|
|
17774
|
-
name,
|
|
17775
|
-
type: objectType,
|
|
17776
|
-
startSector,
|
|
17777
|
-
size,
|
|
17778
|
-
childId: childId === 4294967295 ? -1 : childId,
|
|
17779
|
-
leftSiblingId: leftSiblingId === 4294967295 ? -1 : leftSiblingId,
|
|
17780
|
-
rightSiblingId: rightSiblingId === 4294967295 ? -1 : rightSiblingId,
|
|
17781
|
-
clsid
|
|
17782
|
-
});
|
|
17783
17937
|
}
|
|
17784
17938
|
const rootEntry = entries.find((e) => e.type === ENTRY_TYPE_ROOT);
|
|
17785
|
-
if (!rootEntry || entries.filter((e) => e.type === ENTRY_TYPE_ROOT).length !== 1) {
|
|
17786
|
-
throw new Ole2ParseError("Invalid root directory entry");
|
|
17787
|
-
}
|
|
17788
17939
|
let miniStreamData;
|
|
17789
|
-
if (rootEntry
|
|
17940
|
+
if (rootEntry.startSector <= MAXREGSECT) {
|
|
17790
17941
|
miniStreamData = readStream(rootEntry.startSector, rootEntry.size);
|
|
17791
17942
|
}
|
|
17792
17943
|
const miniFatEntries = [];
|
|
17793
|
-
if (firstMiniFATSector
|
|
17794
|
-
|
|
17795
|
-
if (miniFatRaw.length !== totalMiniFATSectors * sectorSize) {
|
|
17944
|
+
if (firstMiniFATSector > MAXREGSECT && totalMiniFATSectors > 0) {
|
|
17945
|
+
if (strict)
|
|
17796
17946
|
throw new Ole2ParseError("Unexpected mini FAT chain length");
|
|
17947
|
+
warnings.push({ code: "mini-fat-count", message: `Header lists ${totalMiniFATSectors} mini FAT sectors but no chain` });
|
|
17948
|
+
}
|
|
17949
|
+
if (firstMiniFATSector <= MAXREGSECT && (totalMiniFATSectors > 0 || !strict)) {
|
|
17950
|
+
const miniFatRaw = readMetadataChain(firstMiniFATSector, "mini FAT");
|
|
17951
|
+
if (miniFatRaw.length !== totalMiniFATSectors * sectorSize) {
|
|
17952
|
+
if (strict)
|
|
17953
|
+
throw new Ole2ParseError("Unexpected mini FAT chain length");
|
|
17954
|
+
warnings.push({
|
|
17955
|
+
code: "mini-fat-count",
|
|
17956
|
+
message: `Header lists ${totalMiniFATSectors} mini FAT sectors; chain has ${miniFatRaw.length / sectorSize}`
|
|
17957
|
+
});
|
|
17797
17958
|
}
|
|
17798
17959
|
const miniFatView = new DataView(miniFatRaw.buffer, miniFatRaw.byteOffset, miniFatRaw.byteLength);
|
|
17799
17960
|
const miniCapacity = Math.floor((miniStreamData?.length ?? 0) / miniSectorSize);
|
|
@@ -17807,45 +17968,56 @@ function parseOle2(buffer) {
|
|
|
17807
17968
|
if (!miniStreamData) {
|
|
17808
17969
|
throw new Ole2ParseError("Mini stream container not found");
|
|
17809
17970
|
}
|
|
17810
|
-
const
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17971
|
+
const needed = Math.ceil(size / miniSectorSize);
|
|
17972
|
+
const capacity = miniStreamData.length / miniSectorSize;
|
|
17973
|
+
let ids;
|
|
17974
|
+
try {
|
|
17975
|
+
ids = followChain(miniFatEntries, startSector, "mini FAT", needed);
|
|
17976
|
+
} catch (error) {
|
|
17977
|
+
if (error instanceof Ole2ParseError && /Missing mini FAT/.test(error.message)) {
|
|
17978
|
+
throw new Ole2ParseError("Mini stream sector exceeds allocation bounds");
|
|
17816
17979
|
}
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
|
|
17980
|
+
throw error;
|
|
17981
|
+
}
|
|
17982
|
+
const result = new Uint8Array(size);
|
|
17983
|
+
for (let i2 = 0; i2 < ids.length && i2 < needed; i2++) {
|
|
17984
|
+
const id = ids[i2];
|
|
17985
|
+
if (id >= capacity || (id + 1) * miniSectorSize > miniStreamData.length) {
|
|
17820
17986
|
throw new Ole2ParseError("Mini stream sector exceeds allocation bounds");
|
|
17821
17987
|
}
|
|
17822
|
-
|
|
17823
|
-
|
|
17988
|
+
const want = Math.min(miniSectorSize, size - i2 * miniSectorSize);
|
|
17989
|
+
result.set(miniStreamData.subarray(id * miniSectorSize, id * miniSectorSize + want), i2 * miniSectorSize);
|
|
17824
17990
|
}
|
|
17825
|
-
if (
|
|
17826
|
-
throw new Ole2ParseError("Invalid mini FAT chain terminator");
|
|
17827
|
-
const totalLength = sectors.length * miniSectorSize;
|
|
17828
|
-
if (totalLength < size)
|
|
17991
|
+
if (ids.length < needed)
|
|
17829
17992
|
throw new Ole2ParseError("Truncated mini stream sector chain");
|
|
17830
|
-
|
|
17831
|
-
let offset = 0;
|
|
17832
|
-
for (const sector of sectors) {
|
|
17833
|
-
result.set(sector, offset);
|
|
17834
|
-
offset += miniSectorSize;
|
|
17835
|
-
}
|
|
17836
|
-
return result.subarray(0, size);
|
|
17993
|
+
return result;
|
|
17837
17994
|
}
|
|
17838
|
-
function
|
|
17839
|
-
const entry = entries.find((e) => (e.type === ENTRY_TYPE_STREAM || e.type === ENTRY_TYPE_ROOT) && e.name === name);
|
|
17840
|
-
if (!entry) {
|
|
17841
|
-
return void 0;
|
|
17842
|
-
}
|
|
17995
|
+
function readEntry(entry) {
|
|
17843
17996
|
if (entry.size < miniStreamCutoff && entry.type !== ENTRY_TYPE_ROOT) {
|
|
17844
17997
|
return readMiniStream(entry.startSector, entry.size);
|
|
17845
17998
|
}
|
|
17846
17999
|
return readStream(entry.startSector, entry.size);
|
|
17847
18000
|
}
|
|
17848
|
-
|
|
18001
|
+
const readable = (entry) => entry.type === ENTRY_TYPE_STREAM || entry.type === ENTRY_TYPE_ROOT;
|
|
18002
|
+
return {
|
|
18003
|
+
entries,
|
|
18004
|
+
warnings,
|
|
18005
|
+
getStream(name) {
|
|
18006
|
+
const entry = findStreamByName(entries, name, readable);
|
|
18007
|
+
return entry ? readEntry(entry) : void 0;
|
|
18008
|
+
},
|
|
18009
|
+
getStreamByPath(path) {
|
|
18010
|
+
const entry = findDirectoryEntry(entries, path);
|
|
18011
|
+
return entry && entry.type === ENTRY_TYPE_STREAM ? readEntry(entry) : void 0;
|
|
18012
|
+
},
|
|
18013
|
+
getStreamById(id) {
|
|
18014
|
+
const entry = entries.find((candidate) => candidate.id === id);
|
|
18015
|
+
return entry && readable(entry) ? readEntry(entry) : void 0;
|
|
18016
|
+
},
|
|
18017
|
+
findEntry(path) {
|
|
18018
|
+
return findDirectoryEntry(entries, path);
|
|
18019
|
+
}
|
|
18020
|
+
};
|
|
17849
18021
|
}
|
|
17850
18022
|
|
|
17851
18023
|
// pptx/core/utils/ole-embedded-extract.ts
|
|
@@ -17962,7 +18134,7 @@ function unwrapOleEmbedding(bytes) {
|
|
|
17962
18134
|
return { data: bytes };
|
|
17963
18135
|
}
|
|
17964
18136
|
|
|
17965
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
18137
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-helpers.js
|
|
17966
18138
|
function compareDirEntryNames(a, b) {
|
|
17967
18139
|
const ua = a.toUpperCase();
|
|
17968
18140
|
const ub = b.toUpperCase();
|
|
@@ -18029,7 +18201,7 @@ function writeInt32Sectors(outBytes, int32Data, firstSector, numSectors, sectorS
|
|
|
18029
18201
|
}
|
|
18030
18202
|
}
|
|
18031
18203
|
|
|
18032
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
18204
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-serialize.js
|
|
18033
18205
|
function writeHeader(outView, outBytes, params) {
|
|
18034
18206
|
outBytes.set(OLE_MAGIC, 0);
|
|
18035
18207
|
outView.setUint16(24, 62, true);
|
|
@@ -18122,7 +18294,7 @@ function writeStreamSectors(outBytes, streamData, chain2, sectorSize) {
|
|
|
18122
18294
|
}
|
|
18123
18295
|
}
|
|
18124
18296
|
|
|
18125
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
18297
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-parser-write.js
|
|
18126
18298
|
function buildOle2(streams2, rootClsid, miniStreamCutoff = 4096) {
|
|
18127
18299
|
const sectorSize = 512;
|
|
18128
18300
|
const miniSectorSize = 64;
|
|
@@ -18963,7 +19135,7 @@ async function writeOleSheetCellEdit(xlsxBytes, edit) {
|
|
|
18963
19135
|
}
|
|
18964
19136
|
}
|
|
18965
19137
|
|
|
18966
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
19138
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-stream-edit.js
|
|
18967
19139
|
var END = 4294967294;
|
|
18968
19140
|
var MAX = 4294967290;
|
|
18969
19141
|
var NIL = 4294967295;
|
|
@@ -18998,6 +19170,58 @@ function chainToEnd(table, start, max) {
|
|
|
18998
19170
|
}
|
|
18999
19171
|
return out;
|
|
19000
19172
|
}
|
|
19173
|
+
function chainPrefix(table, start, needed) {
|
|
19174
|
+
const out = [], seen = /* @__PURE__ */ new Set();
|
|
19175
|
+
let id = start;
|
|
19176
|
+
while (out.length < needed) {
|
|
19177
|
+
if (id > MAX || id >= table.length || seen.has(id))
|
|
19178
|
+
throw new Error("Invalid CFB chain");
|
|
19179
|
+
seen.add(id);
|
|
19180
|
+
out.push(id);
|
|
19181
|
+
id = table[id];
|
|
19182
|
+
}
|
|
19183
|
+
return out;
|
|
19184
|
+
}
|
|
19185
|
+
function readTarget(input, target, root, fat, sector, sectorCount, sectorSize, miniSize, read32) {
|
|
19186
|
+
const size = target.size;
|
|
19187
|
+
if (size === 0)
|
|
19188
|
+
return new Uint8Array(0);
|
|
19189
|
+
const out = new Uint8Array(size);
|
|
19190
|
+
const copyPhysical = (at2, want, into) => {
|
|
19191
|
+
if (at2 + want > input.length)
|
|
19192
|
+
throw new Error("Stream data exceeds file size");
|
|
19193
|
+
out.set(input.subarray(at2, at2 + want), into);
|
|
19194
|
+
};
|
|
19195
|
+
if (size >= read32(56)) {
|
|
19196
|
+
if (size > sectorCount * sectorSize)
|
|
19197
|
+
throw new Error("Stream size exceeds file size");
|
|
19198
|
+
chainPrefix(fat, target.start, Math.ceil(size / sectorSize)).forEach((id, i2) => {
|
|
19199
|
+
if (id >= sectorCount)
|
|
19200
|
+
throw new Error("Invalid sector");
|
|
19201
|
+
copyPhysical((id + 1) * sectorSize, Math.min(sectorSize, size - i2 * sectorSize), i2 * sectorSize);
|
|
19202
|
+
});
|
|
19203
|
+
return out;
|
|
19204
|
+
}
|
|
19205
|
+
const miniFatSectors = chainToEnd(fat, read32(60), sectorCount);
|
|
19206
|
+
const miniCapacity = Math.floor(Math.min(root.size, sectorCount * sectorSize) / miniSize);
|
|
19207
|
+
const miniFat = [];
|
|
19208
|
+
for (const id of miniFatSectors) {
|
|
19209
|
+
const bytes = sector(id), dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
19210
|
+
for (let j = 0; j < sectorSize / 4 && miniFat.length < miniCapacity; j++)
|
|
19211
|
+
miniFat.push(dv.getUint32(j * 4, true));
|
|
19212
|
+
}
|
|
19213
|
+
const rootSectors = chainPrefix(fat, root.start, Math.ceil(root.size / sectorSize));
|
|
19214
|
+
chainPrefix(miniFat, target.start, Math.ceil(size / miniSize)).forEach((id, i2) => {
|
|
19215
|
+
const start = id * miniSize, want = Math.min(miniSize, size - i2 * miniSize);
|
|
19216
|
+
if (start + want > root.size)
|
|
19217
|
+
throw new Error("Mini stream out of bounds");
|
|
19218
|
+
const rootSector = rootSectors[Math.floor(start / sectorSize)];
|
|
19219
|
+
if (rootSector >= sectorCount)
|
|
19220
|
+
throw new Error("Invalid sector");
|
|
19221
|
+
copyPhysical((rootSector + 1) * sectorSize + start % sectorSize, want, i2 * miniSize);
|
|
19222
|
+
});
|
|
19223
|
+
return out;
|
|
19224
|
+
}
|
|
19001
19225
|
function processCompoundFileStream(input, path, replacement) {
|
|
19002
19226
|
const reject = () => replacement ? input : void 0;
|
|
19003
19227
|
try {
|
|
@@ -19005,18 +19229,19 @@ function processCompoundFileStream(input, path, replacement) {
|
|
|
19005
19229
|
return reject();
|
|
19006
19230
|
const view = new DataView(input.buffer, input.byteOffset, input.byteLength);
|
|
19007
19231
|
const read32 = (offset2) => view.getUint32(offset2, true);
|
|
19008
|
-
if (input[0] !== 208 || input[1] !== 207 || input[2] !== 17 || input[3] !== 224 || input[4] !== 161 || input[5] !== 177 || input[6] !== 26 || input[7] !== 225 ||
|
|
19232
|
+
if (input[0] !== 208 || input[1] !== 207 || input[2] !== 17 || input[3] !== 224 || input[4] !== 161 || input[5] !== 177 || input[6] !== 26 || input[7] !== 225 || // Readers tolerate a non-canonical byte-order mark; edits do not.
|
|
19233
|
+
replacement && view.getUint16(28, true) !== 65534)
|
|
19009
19234
|
return reject();
|
|
19010
19235
|
const major = view.getUint16(26, true), shift = view.getUint16(30, true), miniShift = view.getUint16(32, true);
|
|
19011
19236
|
if (major !== 3 && major !== 4 || shift !== (major === 3 ? 9 : 12) || miniShift !== 6)
|
|
19012
19237
|
return reject();
|
|
19013
19238
|
const sectorSize = 1 << shift, miniSize = 1 << miniShift;
|
|
19014
|
-
if (input.length % sectorSize !== 0)
|
|
19239
|
+
if (input.length < sectorSize || replacement && input.length % sectorSize !== 0)
|
|
19015
19240
|
return reject();
|
|
19016
|
-
const sectorCount = input.length / sectorSize - 1;
|
|
19241
|
+
const sectorCount = Math.ceil(input.length / sectorSize) - 1;
|
|
19017
19242
|
const offset = (id) => (id + 1) * sectorSize;
|
|
19018
19243
|
const sector = (id) => {
|
|
19019
|
-
if (id > MAX || id >= sectorCount)
|
|
19244
|
+
if (id > MAX || id >= sectorCount || offset(id) + sectorSize > input.length)
|
|
19020
19245
|
throw new Error("Invalid sector");
|
|
19021
19246
|
return input.subarray(offset(id), offset(id) + sectorSize);
|
|
19022
19247
|
};
|
|
@@ -19066,7 +19291,7 @@ function processCompoundFileStream(input, path, replacement) {
|
|
|
19066
19291
|
for (let i2 = 0; i2 < nameLength - 2; i2 += 2)
|
|
19067
19292
|
name += String.fromCharCode(dvDir.getUint16(p + i2, true));
|
|
19068
19293
|
const sizeLow = dvDir.getUint32(p + 120, true), sizeHigh = dvDir.getUint32(p + 124, true);
|
|
19069
|
-
if (sizeHigh !== 0)
|
|
19294
|
+
if (sizeHigh !== 0 && (replacement || major === 4))
|
|
19070
19295
|
return reject();
|
|
19071
19296
|
entries.push({
|
|
19072
19297
|
id,
|
|
@@ -19113,6 +19338,8 @@ function processCompoundFileStream(input, path, replacement) {
|
|
|
19113
19338
|
}
|
|
19114
19339
|
if (!target)
|
|
19115
19340
|
return reject();
|
|
19341
|
+
if (!replacement)
|
|
19342
|
+
return readTarget(input, target, root, fat, sector, sectorCount, sectorSize, miniSize, read32);
|
|
19116
19343
|
const names = entries.map((e) => e.name.toLowerCase());
|
|
19117
19344
|
if (replacement && (names.includes("encryptioninfo") || names.includes("encryptedpackage")))
|
|
19118
19345
|
return reject();
|
|
@@ -19236,7 +19463,7 @@ function replaceCompoundFileStream(input, path, replacement) {
|
|
|
19236
19463
|
return processCompoundFileStream(input, path, replacement) ?? input;
|
|
19237
19464
|
}
|
|
19238
19465
|
|
|
19239
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
19466
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/legacy-excel-cfb.js
|
|
19240
19467
|
var WORKBOOK_STREAM_NAMES = ["workbook", "book"];
|
|
19241
19468
|
function unwrapXlsBytes(bytes) {
|
|
19242
19469
|
if (!isCfb(bytes)) {
|
|
@@ -19303,7 +19530,7 @@ function isCfb(bytes) {
|
|
|
19303
19530
|
return OLE_MAGIC.every((value, index) => bytes[index] === value);
|
|
19304
19531
|
}
|
|
19305
19532
|
|
|
19306
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
19533
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-edit.js
|
|
19307
19534
|
function encodeRkExact(value) {
|
|
19308
19535
|
if (!Number.isFinite(value))
|
|
19309
19536
|
return void 0;
|
|
@@ -19468,7 +19695,7 @@ function editXlsNumericCell(input, edit) {
|
|
|
19468
19695
|
}
|
|
19469
19696
|
}
|
|
19470
19697
|
|
|
19471
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
19698
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8.js
|
|
19472
19699
|
var OPCODE_BOF = 2057;
|
|
19473
19700
|
var OPCODE_EOF = 10;
|
|
19474
19701
|
var OPCODE_FILEPASS = 47;
|
|
@@ -19655,7 +19882,7 @@ function writeOleXlsNumericCellEdit(inputBytes, edit) {
|
|
|
19655
19882
|
return editXlsNumericCell(inputBytes, edit).bytes;
|
|
19656
19883
|
}
|
|
19657
19884
|
|
|
19658
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
19885
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-grid.js
|
|
19659
19886
|
function biffRecord(opcode, data) {
|
|
19660
19887
|
return [
|
|
19661
19888
|
opcode & 255,
|
|
@@ -19780,7 +20007,7 @@ function buildXlsRowCellRegion(grid) {
|
|
|
19780
20007
|
return Uint8Array.from(bytesOut);
|
|
19781
20008
|
}
|
|
19782
20009
|
|
|
19783
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20010
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-writer.js
|
|
19784
20011
|
function resolveSstIndex(sharedStrings, value, bytes) {
|
|
19785
20012
|
const existing = sharedStrings.indexOf(value);
|
|
19786
20013
|
if (existing !== -1)
|
|
@@ -20028,7 +20255,7 @@ async function writeOleDocumentParagraphEdit(docxBytes, paragraphIndex, text) {
|
|
|
20028
20255
|
}
|
|
20029
20256
|
}
|
|
20030
20257
|
|
|
20031
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20258
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fib.js
|
|
20032
20259
|
var FC_LCB_INDEX = {
|
|
20033
20260
|
plcfbteChpx: 12,
|
|
20034
20261
|
plcfbtePapx: 13,
|
|
@@ -20124,7 +20351,7 @@ function patchDocFib(wordDoc, fib, patch) {
|
|
|
20124
20351
|
view.setUint32(papxOff + 4, patch.plcfbtePapx.lcb, true);
|
|
20125
20352
|
}
|
|
20126
20353
|
|
|
20127
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20354
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-stream-resize-v4.js
|
|
20128
20355
|
var END2 = 4294967294;
|
|
20129
20356
|
var FREE = 4294967295;
|
|
20130
20357
|
var FAT = 4294967293;
|
|
@@ -20312,7 +20539,7 @@ function resizeCompoundFileStreamV4(input, path, replacement) {
|
|
|
20312
20539
|
}
|
|
20313
20540
|
}
|
|
20314
20541
|
|
|
20315
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20542
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-stream-resize-allocation.js
|
|
20316
20543
|
function appendCompoundAllocations(input, existingFatIds, payloads, sectorSize = 512) {
|
|
20317
20544
|
const sectorCount = input.length / sectorSize - 1;
|
|
20318
20545
|
const entriesPerFat = sectorSize / 4;
|
|
@@ -20359,7 +20586,7 @@ function followCompoundAllocation(table, start) {
|
|
|
20359
20586
|
return ids;
|
|
20360
20587
|
}
|
|
20361
20588
|
|
|
20362
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20589
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-stream-resize-mini.js
|
|
20363
20590
|
var END3 = 4294967294;
|
|
20364
20591
|
var FREE2 = 4294967295;
|
|
20365
20592
|
var SECTOR = 512;
|
|
@@ -20431,7 +20658,7 @@ function resizeMiniCompoundStream(input, fat, fatIds, root, target, replacement,
|
|
|
20431
20658
|
return output.bytes;
|
|
20432
20659
|
}
|
|
20433
20660
|
|
|
20434
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20661
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole2-stream-resize.js
|
|
20435
20662
|
var END4 = 4294967294;
|
|
20436
20663
|
var FREE3 = 4294967295;
|
|
20437
20664
|
var FAT2 = 4294967293;
|
|
@@ -20596,7 +20823,7 @@ function resizeCompoundFileStream(input, path, replacement) {
|
|
|
20596
20823
|
}
|
|
20597
20824
|
}
|
|
20598
20825
|
|
|
20599
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20826
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cfb.js
|
|
20600
20827
|
var DocCfbRewriteError = class extends Error {
|
|
20601
20828
|
constructor(message) {
|
|
20602
20829
|
super(message);
|
|
@@ -20651,7 +20878,7 @@ function unwrapDocBytes(bytes) {
|
|
|
20651
20878
|
}
|
|
20652
20879
|
}
|
|
20653
20880
|
|
|
20654
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
20881
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fkp.js
|
|
20655
20882
|
var PAGE_SIZE = 512;
|
|
20656
20883
|
function parseBteTable(tableStream, at2) {
|
|
20657
20884
|
const view = new DataView(tableStream.buffer, tableStream.byteOffset, tableStream.byteLength);
|
|
@@ -20792,7 +21019,7 @@ function buildSingleRunChpxPage(fcStart, fcEnd, blob) {
|
|
|
20792
21019
|
return page;
|
|
20793
21020
|
}
|
|
20794
21021
|
|
|
20795
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
21022
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cp1252.js
|
|
20796
21023
|
var CP1252_HIGH_BLOCK = [
|
|
20797
21024
|
8364,
|
|
20798
21025
|
129,
|
|
@@ -20860,7 +21087,7 @@ function encodeCp1252(text) {
|
|
|
20860
21087
|
return Uint8Array.from(bytes);
|
|
20861
21088
|
}
|
|
20862
21089
|
|
|
20863
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
21090
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-pieces.js
|
|
20864
21091
|
var CLXT_PRC = 1;
|
|
20865
21092
|
var CLXT_PCDT = 2;
|
|
20866
21093
|
var DocResourceLimitError = class extends Error {
|
|
@@ -21072,7 +21299,7 @@ function buildClxBytes(pieces, prcBytes = new Uint8Array()) {
|
|
|
21072
21299
|
return result;
|
|
21073
21300
|
}
|
|
21074
21301
|
|
|
21075
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
21302
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fields.js
|
|
21076
21303
|
var UnsupportedDocFieldEditError = class extends Error {
|
|
21077
21304
|
constructor(message) {
|
|
21078
21305
|
super(message);
|
|
@@ -21156,7 +21383,7 @@ function shiftDocMainFieldCps(table, at2, body, editStart, editEnd, delta2, maxF
|
|
|
21156
21383
|
return result;
|
|
21157
21384
|
}
|
|
21158
21385
|
|
|
21159
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
21386
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/ole-document-doc-editor.js
|
|
21160
21387
|
var RISKY_PLCF_INDICES = [2, 3, 4, 5, 17, 18, 19, 20, 40, 41, 42, 43, 46, 47, 48, 54, 55, 56, 57, 58, 59, 75, 76, 89, 90];
|
|
21161
21388
|
var RISKY_STTB_INDICES = [21, 22, 23];
|
|
21162
21389
|
var SAFE_EXTENDED_FC_LCB_INDICES = /* @__PURE__ */ new Set([93, 94, 113, 181, 182]);
|
|
@@ -21460,7 +21687,7 @@ function findTextBearingElementById(elements2, elementId) {
|
|
|
21460
21687
|
}
|
|
21461
21688
|
async function loadNestedDeck(pptxBytes) {
|
|
21462
21689
|
try {
|
|
21463
|
-
const { PptxHandler } = await import('./PptxHandler-
|
|
21690
|
+
const { PptxHandler } = await import('./PptxHandler-BL4B7CZO.mjs');
|
|
21464
21691
|
const handler = new PptxHandler();
|
|
21465
21692
|
const data = await handler.load(pptxBytes.buffer.slice(0));
|
|
21466
21693
|
return { handler, slides: data.slides };
|
|
@@ -21507,7 +21734,7 @@ async function writeOleNestedDeckElementText(pptxBytes, slideIndex, elementId, t
|
|
|
21507
21734
|
}
|
|
21508
21735
|
}
|
|
21509
21736
|
|
|
21510
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
21737
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/utils/png-encoder.js
|
|
21511
21738
|
var CRC_TABLE = (() => {
|
|
21512
21739
|
const table = new Uint32Array(256);
|
|
21513
21740
|
for (let n = 0; n < 256; n++) {
|
|
@@ -22989,7 +23216,7 @@ function localName5(name) {
|
|
|
22989
23216
|
function keyFor(node, name) {
|
|
22990
23217
|
return Object.keys(node).find((key) => localName5(key) === name);
|
|
22991
23218
|
}
|
|
22992
|
-
function
|
|
23219
|
+
function child3(node, name) {
|
|
22993
23220
|
const key = keyFor(node, name);
|
|
22994
23221
|
const value = key ? node[key] : void 0;
|
|
22995
23222
|
if (key && (value === "" || value === void 0)) {
|
|
@@ -23017,14 +23244,14 @@ function parseItem(key, rawValue) {
|
|
|
23017
23244
|
rawXml: clone(raw),
|
|
23018
23245
|
childOrder: smartArtChildOrder(raw)
|
|
23019
23246
|
};
|
|
23020
|
-
const rPr =
|
|
23247
|
+
const rPr = child3(raw, "rPr");
|
|
23021
23248
|
if (rPr) {
|
|
23022
23249
|
run.rPr = clone(rPr);
|
|
23023
23250
|
}
|
|
23024
23251
|
return { kind: "run", run };
|
|
23025
23252
|
}
|
|
23026
23253
|
if (name === "br") {
|
|
23027
|
-
const rPr =
|
|
23254
|
+
const rPr = child3(raw, "rPr");
|
|
23028
23255
|
return {
|
|
23029
23256
|
kind: "break",
|
|
23030
23257
|
...rPr ? { rPr: clone(rPr) } : {},
|
|
@@ -23033,8 +23260,8 @@ function parseItem(key, rawValue) {
|
|
|
23033
23260
|
};
|
|
23034
23261
|
}
|
|
23035
23262
|
if (name === "fld") {
|
|
23036
|
-
const rPr =
|
|
23037
|
-
const pPr =
|
|
23263
|
+
const rPr = child3(raw, "rPr");
|
|
23264
|
+
const pPr = child3(raw, "pPr");
|
|
23038
23265
|
return {
|
|
23039
23266
|
kind: "field",
|
|
23040
23267
|
...raw["@_id"] ? { id: String(raw["@_id"]) } : {},
|
|
@@ -23052,7 +23279,7 @@ function parseItem(key, rawValue) {
|
|
|
23052
23279
|
return { kind: "raw", name: key, value: clone(rawValue) };
|
|
23053
23280
|
}
|
|
23054
23281
|
function parseSmartArtTextParagraphs(point2) {
|
|
23055
|
-
const body =
|
|
23282
|
+
const body = child3(point2, "t");
|
|
23056
23283
|
if (!body) {
|
|
23057
23284
|
return void 0;
|
|
23058
23285
|
}
|
|
@@ -23063,8 +23290,8 @@ function parseSmartArtTextParagraphs(point2) {
|
|
|
23063
23290
|
return void 0;
|
|
23064
23291
|
}
|
|
23065
23292
|
return paragraphNodes.map((paragraph) => {
|
|
23066
|
-
const pPr =
|
|
23067
|
-
const endParaRPr =
|
|
23293
|
+
const pPr = child3(paragraph, "pPr");
|
|
23294
|
+
const endParaRPr = child3(paragraph, "endParaRPr");
|
|
23068
23295
|
return {
|
|
23069
23296
|
...pPr ? { pPr: clone(pPr) } : {},
|
|
23070
23297
|
items: orderedSmartArtTextEntries(paragraph).flatMap(
|
|
@@ -23898,7 +24125,7 @@ function parseRunSolidFillColorXml(rPr) {
|
|
|
23898
24125
|
}
|
|
23899
24126
|
|
|
23900
24127
|
// pptx/core/utils/smartart-node-text-projection.ts
|
|
23901
|
-
function
|
|
24128
|
+
function child4(node, name) {
|
|
23902
24129
|
if (!node) {
|
|
23903
24130
|
return void 0;
|
|
23904
24131
|
}
|
|
@@ -23909,7 +24136,7 @@ function child3(node, name) {
|
|
|
23909
24136
|
function runStyle(rPr, fallback) {
|
|
23910
24137
|
const xml = rPr;
|
|
23911
24138
|
const color2 = parseRunSolidFillColor(xml);
|
|
23912
|
-
const extLst =
|
|
24139
|
+
const extLst = child4(rPr, "extLst");
|
|
23913
24140
|
return {
|
|
23914
24141
|
...fallback,
|
|
23915
24142
|
...parseRunPropertyAttributes(xml),
|
|
@@ -23932,7 +24159,7 @@ function paragraphStyle(paragraph, fallback) {
|
|
|
23932
24159
|
const align = parseAlignmentAttr(pPr?.["@_algn"]);
|
|
23933
24160
|
const rtl = parseParagraphRtl(pPr);
|
|
23934
24161
|
const tabStops = parseTabStops(pPr);
|
|
23935
|
-
const extLst =
|
|
24162
|
+
const extLst = child4(paragraph.pPr, "extLst");
|
|
23936
24163
|
return {
|
|
23937
24164
|
...fallback,
|
|
23938
24165
|
...align ? { align } : {},
|
|
@@ -23940,12 +24167,12 @@ function paragraphStyle(paragraph, fallback) {
|
|
|
23940
24167
|
...parseParagraphExtraAttributes(pPr),
|
|
23941
24168
|
...rtl !== void 0 ? { rtl } : {},
|
|
23942
24169
|
...tabStops ? { tabStops } : {},
|
|
23943
|
-
...parseParagraphSpacingPx(
|
|
23944
|
-
...parseParagraphSpacingPx(
|
|
23945
|
-
...parseLineSpacingMultiplier(
|
|
23946
|
-
...parseLineSpacingExactPt(
|
|
24170
|
+
...parseParagraphSpacingPx(child4(paragraph.pPr, "spcBef")) !== void 0 ? { paragraphSpacingBefore: parseParagraphSpacingPx(child4(paragraph.pPr, "spcBef")) } : {},
|
|
24171
|
+
...parseParagraphSpacingPx(child4(paragraph.pPr, "spcAft")) !== void 0 ? { paragraphSpacingAfter: parseParagraphSpacingPx(child4(paragraph.pPr, "spcAft")) } : {},
|
|
24172
|
+
...parseLineSpacingMultiplier(child4(paragraph.pPr, "lnSpc")) !== void 0 ? { lineSpacing: parseLineSpacingMultiplier(child4(paragraph.pPr, "lnSpc")) } : {},
|
|
24173
|
+
...parseLineSpacingExactPt(child4(paragraph.pPr, "lnSpc")) !== void 0 ? { lineSpacingExactPt: parseLineSpacingExactPt(child4(paragraph.pPr, "lnSpc")) } : {},
|
|
23947
24174
|
...extLst ? { paragraphPropertiesExtLstXml: extLst } : {},
|
|
23948
|
-
...
|
|
24175
|
+
...child4(paragraph.pPr, "defRPr") ? { paragraphDefaultRunPropertiesXml: child4(paragraph.pPr, "defRPr") } : {}
|
|
23949
24176
|
};
|
|
23950
24177
|
}
|
|
23951
24178
|
var AUTO_BULLET_CHAR = "\u2022";
|
|
@@ -24018,12 +24245,12 @@ function projectSmartArtNodeText(node, fallbackStyle = {}, options = {}) {
|
|
|
24018
24245
|
function collectFoldedDescendants(node, renderedIds, childrenOf) {
|
|
24019
24246
|
const out = [];
|
|
24020
24247
|
const walk3 = (current) => {
|
|
24021
|
-
for (const
|
|
24022
|
-
if (renderedIds.has(
|
|
24248
|
+
for (const child13 of childrenOf.get(current.id) ?? []) {
|
|
24249
|
+
if (renderedIds.has(child13.id)) {
|
|
24023
24250
|
continue;
|
|
24024
24251
|
}
|
|
24025
|
-
out.push(
|
|
24026
|
-
walk3(
|
|
24252
|
+
out.push(child13);
|
|
24253
|
+
walk3(child13);
|
|
24027
24254
|
}
|
|
24028
24255
|
};
|
|
24029
24256
|
walk3(node);
|
|
@@ -24100,9 +24327,9 @@ function topLevelSmartArtNodes(nodes) {
|
|
|
24100
24327
|
function smartArtDescendantsWithText(node, childrenOf) {
|
|
24101
24328
|
const out = [];
|
|
24102
24329
|
const walk3 = (current) => {
|
|
24103
|
-
for (const
|
|
24104
|
-
out.push(
|
|
24105
|
-
walk3(
|
|
24330
|
+
for (const child13 of childrenOf.get(current.id) ?? []) {
|
|
24331
|
+
out.push(child13);
|
|
24332
|
+
walk3(child13);
|
|
24106
24333
|
}
|
|
24107
24334
|
};
|
|
24108
24335
|
walk3(node);
|
|
@@ -24133,7 +24360,7 @@ function smartArtChildrenOf(nodes, connections) {
|
|
|
24133
24360
|
const childOrder2 = connections ? buildChildOrder(connections) : void 0;
|
|
24134
24361
|
if (childOrder2) {
|
|
24135
24362
|
for (const [parentId, list2] of map) {
|
|
24136
|
-
if (list2.length > 1 && list2.some((
|
|
24363
|
+
if (list2.length > 1 && list2.some((child13) => childOrder2.has(child13.id))) {
|
|
24137
24364
|
map.set(
|
|
24138
24365
|
parentId,
|
|
24139
24366
|
list2.map((node, originalIndex) => ({ node, originalIndex })).sort(
|
|
@@ -24702,8 +24929,8 @@ function buildConstraintIndex(definition, nodeCount, context) {
|
|
|
24702
24929
|
entries.set(entryKey(role, constraint.type), [entry]);
|
|
24703
24930
|
}
|
|
24704
24931
|
}
|
|
24705
|
-
for (const
|
|
24706
|
-
walk3(
|
|
24932
|
+
for (const child13 of node.children ?? []) {
|
|
24933
|
+
walk3(child13);
|
|
24707
24934
|
}
|
|
24708
24935
|
};
|
|
24709
24936
|
walk3(definition.rootNode);
|
|
@@ -24850,8 +25077,8 @@ function resolveIteratorIndices(iter, length) {
|
|
|
24850
25077
|
}
|
|
24851
25078
|
function collectFollowSibNodeCounts(node) {
|
|
24852
25079
|
const counts = [];
|
|
24853
|
-
for (const
|
|
24854
|
-
const origin =
|
|
25080
|
+
for (const child13 of node.children ?? []) {
|
|
25081
|
+
const origin = child13.forEachOrigin;
|
|
24855
25082
|
if (origin?.axis?.includes("followSib") && origin.pointTypes?.some((type) => NODE_POINT_TYPES.has(type))) {
|
|
24856
25083
|
counts.push(firstNumber(origin.count) ?? 1);
|
|
24857
25084
|
}
|
|
@@ -25116,12 +25343,12 @@ function groupedChildren(element) {
|
|
|
25116
25343
|
return cached;
|
|
25117
25344
|
}
|
|
25118
25345
|
const groups = /* @__PURE__ */ new Map();
|
|
25119
|
-
for (const
|
|
25120
|
-
const group = groups.get(
|
|
25346
|
+
for (const child13 of element.children) {
|
|
25347
|
+
const group = groups.get(child13.name);
|
|
25121
25348
|
if (group) {
|
|
25122
|
-
group.push(
|
|
25349
|
+
group.push(child13);
|
|
25123
25350
|
} else {
|
|
25124
|
-
groups.set(
|
|
25351
|
+
groups.set(child13.name, [child13]);
|
|
25125
25352
|
}
|
|
25126
25353
|
}
|
|
25127
25354
|
const result = [...groups.values()].flat();
|
|
@@ -25129,10 +25356,10 @@ function groupedChildren(element) {
|
|
|
25129
25356
|
return result;
|
|
25130
25357
|
}
|
|
25131
25358
|
function childrenNamed(element, name) {
|
|
25132
|
-
return element ? element.children.filter((
|
|
25359
|
+
return element ? element.children.filter((child13) => child13.name === name) : [];
|
|
25133
25360
|
}
|
|
25134
25361
|
function firstChildNamed(element, name) {
|
|
25135
|
-
return element?.children.find((
|
|
25362
|
+
return element?.children.find((child13) => child13.name === name);
|
|
25136
25363
|
}
|
|
25137
25364
|
function algorithmParameters(alg) {
|
|
25138
25365
|
const params = [];
|
|
@@ -25159,11 +25386,11 @@ function activeBranch(choose, nodeCount, context) {
|
|
|
25159
25386
|
return choose.otherwise?.rawXml ?? void 0;
|
|
25160
25387
|
}
|
|
25161
25388
|
function nestedChooseBranch(choose, nodeCount, context) {
|
|
25162
|
-
for (const
|
|
25163
|
-
if (
|
|
25389
|
+
for (const child13 of groupedChildren(choose)) {
|
|
25390
|
+
if (child13.name !== "if") {
|
|
25164
25391
|
continue;
|
|
25165
25392
|
}
|
|
25166
|
-
const when = parseOrderedWhen(
|
|
25393
|
+
const when = parseOrderedWhen(child13);
|
|
25167
25394
|
if (!when) {
|
|
25168
25395
|
continue;
|
|
25169
25396
|
}
|
|
@@ -25172,7 +25399,7 @@ function nestedChooseBranch(choose, nodeCount, context) {
|
|
|
25172
25399
|
return void 0;
|
|
25173
25400
|
}
|
|
25174
25401
|
if (result) {
|
|
25175
|
-
return
|
|
25402
|
+
return child13;
|
|
25176
25403
|
}
|
|
25177
25404
|
}
|
|
25178
25405
|
return firstChildNamed(choose, "else");
|
|
@@ -25210,15 +25437,15 @@ function isContinuationForEach(node) {
|
|
|
25210
25437
|
}
|
|
25211
25438
|
function hasStructuralDescendant(node) {
|
|
25212
25439
|
return (node.children ?? []).some(
|
|
25213
|
-
(
|
|
25440
|
+
(child13) => STRUCTURAL_ALG_TYPES.has(child13.algorithm?.type ?? "") && !isContinuationForEach(child13) || hasStructuralDescendant(child13)
|
|
25214
25441
|
);
|
|
25215
25442
|
}
|
|
25216
25443
|
function hasRepeatedTemplateStructuralDescendant(node) {
|
|
25217
|
-
return (node.children ?? []).some((
|
|
25218
|
-
if (STRUCTURAL_ALG_TYPES.has(
|
|
25444
|
+
return (node.children ?? []).some((child13) => {
|
|
25445
|
+
if (STRUCTURAL_ALG_TYPES.has(child13.algorithm?.type ?? "") && !isContinuationForEach(child13) && child13.forEachOrigin?.axis?.includes("ch") && child13.forEachOrigin?.pointTypes?.includes("node")) {
|
|
25219
25446
|
return true;
|
|
25220
25447
|
}
|
|
25221
|
-
return hasRepeatedTemplateStructuralDescendant(
|
|
25448
|
+
return hasRepeatedTemplateStructuralDescendant(child13);
|
|
25222
25449
|
});
|
|
25223
25450
|
}
|
|
25224
25451
|
function distinctMappedSlotCount(node) {
|
|
@@ -25238,7 +25465,7 @@ function mapsSlots(node) {
|
|
|
25238
25465
|
return true;
|
|
25239
25466
|
}
|
|
25240
25467
|
return (node.children ?? []).some(
|
|
25241
|
-
(
|
|
25468
|
+
(child13) => (child13.constraints ?? []).some((constraint) => SLOT_CONSTRAINTS.has(constraint.type))
|
|
25242
25469
|
);
|
|
25243
25470
|
}
|
|
25244
25471
|
function itemTemplateNodes(node, out) {
|
|
@@ -25249,15 +25476,15 @@ function itemTemplateNodes(node, out) {
|
|
|
25249
25476
|
if (drivesPoints && item) {
|
|
25250
25477
|
out.add(item);
|
|
25251
25478
|
}
|
|
25252
|
-
for (const
|
|
25253
|
-
itemTemplateNodes(
|
|
25479
|
+
for (const child13 of node.children ?? []) {
|
|
25480
|
+
itemTemplateNodes(child13, out);
|
|
25254
25481
|
}
|
|
25255
25482
|
}
|
|
25256
25483
|
function isLayoutNodeOrDescendantOf(ancestor, node) {
|
|
25257
25484
|
if (ancestor === node) {
|
|
25258
25485
|
return true;
|
|
25259
25486
|
}
|
|
25260
|
-
return (ancestor.children ?? []).some((
|
|
25487
|
+
return (ancestor.children ?? []).some((child13) => isLayoutNodeOrDescendantOf(child13, node));
|
|
25261
25488
|
}
|
|
25262
25489
|
|
|
25263
25490
|
// diagram/layout/smartart-layout-interpreter-choose-depth.ts
|
|
@@ -25270,26 +25497,26 @@ var STRUCTURAL_CHOOSE_ALG_TYPES = /* @__PURE__ */ new Set([
|
|
|
25270
25497
|
"hierRoot"
|
|
25271
25498
|
]);
|
|
25272
25499
|
function findStructuralAlgDepth(element, crossedNames, nodeCount, context) {
|
|
25273
|
-
for (const
|
|
25500
|
+
for (const child13 of groupedChildren(element)) {
|
|
25274
25501
|
let found;
|
|
25275
|
-
if (
|
|
25276
|
-
if (STRUCTURAL_CHOOSE_ALG_TYPES.has(
|
|
25502
|
+
if (child13.name === "alg") {
|
|
25503
|
+
if (STRUCTURAL_CHOOSE_ALG_TYPES.has(child13.attrs["type"] ?? "")) {
|
|
25277
25504
|
return { depth: crossedNames.length, crossedNames: [...crossedNames] };
|
|
25278
25505
|
}
|
|
25279
|
-
} else if (
|
|
25506
|
+
} else if (child13.name === "layoutNode") {
|
|
25280
25507
|
found = findStructuralAlgDepth(
|
|
25281
|
-
|
|
25282
|
-
[...crossedNames,
|
|
25508
|
+
child13,
|
|
25509
|
+
[...crossedNames, child13.attrs["name"] ?? ""],
|
|
25283
25510
|
nodeCount,
|
|
25284
25511
|
context
|
|
25285
25512
|
);
|
|
25286
|
-
} else if (
|
|
25287
|
-
const winningBranch = nestedChooseBranch(
|
|
25513
|
+
} else if (child13.name === "choose") {
|
|
25514
|
+
const winningBranch = nestedChooseBranch(child13, nodeCount, context);
|
|
25288
25515
|
if (winningBranch) {
|
|
25289
25516
|
found = findStructuralAlgDepth(winningBranch, crossedNames, nodeCount, context);
|
|
25290
25517
|
}
|
|
25291
25518
|
} else {
|
|
25292
|
-
found = findStructuralAlgDepth(
|
|
25519
|
+
found = findStructuralAlgDepth(child13, crossedNames, nodeCount, context);
|
|
25293
25520
|
}
|
|
25294
25521
|
if (found) {
|
|
25295
25522
|
return found;
|
|
@@ -25338,25 +25565,25 @@ function boundedCompositeAlg(raw, nodeCount, context) {
|
|
|
25338
25565
|
}
|
|
25339
25566
|
let found;
|
|
25340
25567
|
const visit = (element) => {
|
|
25341
|
-
for (const
|
|
25568
|
+
for (const child13 of groupedChildren(element)) {
|
|
25342
25569
|
if (found !== void 0) {
|
|
25343
25570
|
return;
|
|
25344
25571
|
}
|
|
25345
|
-
if (
|
|
25572
|
+
if (child13.name === "layoutNode") {
|
|
25346
25573
|
continue;
|
|
25347
25574
|
}
|
|
25348
|
-
if (
|
|
25349
|
-
if (
|
|
25350
|
-
found = { type: "composite", raw:
|
|
25575
|
+
if (child13.name === "alg") {
|
|
25576
|
+
if (child13.attrs["type"] === "composite") {
|
|
25577
|
+
found = { type: "composite", raw: child13 };
|
|
25351
25578
|
return;
|
|
25352
25579
|
}
|
|
25353
|
-
} else if (
|
|
25354
|
-
const winningBranch = nestedChooseBranch(
|
|
25580
|
+
} else if (child13.name === "choose") {
|
|
25581
|
+
const winningBranch = nestedChooseBranch(child13, nodeCount, context);
|
|
25355
25582
|
if (winningBranch) {
|
|
25356
25583
|
visit(winningBranch);
|
|
25357
25584
|
}
|
|
25358
25585
|
} else {
|
|
25359
|
-
visit(
|
|
25586
|
+
visit(child13);
|
|
25360
25587
|
}
|
|
25361
25588
|
}
|
|
25362
25589
|
};
|
|
@@ -25372,23 +25599,23 @@ function branchAlg(raw, nodeCount, context, allowedTypes = CHOOSE_ALG_TYPES) {
|
|
|
25372
25599
|
}
|
|
25373
25600
|
let found;
|
|
25374
25601
|
const visit = (element) => {
|
|
25375
|
-
for (const
|
|
25602
|
+
for (const child13 of groupedChildren(element)) {
|
|
25376
25603
|
if (found !== void 0) {
|
|
25377
25604
|
return;
|
|
25378
25605
|
}
|
|
25379
|
-
if (
|
|
25380
|
-
const type =
|
|
25606
|
+
if (child13.name === "alg") {
|
|
25607
|
+
const type = child13.attrs["type"] ?? "";
|
|
25381
25608
|
if (allowedTypes.has(type)) {
|
|
25382
|
-
found = { type, raw:
|
|
25609
|
+
found = { type, raw: child13 };
|
|
25383
25610
|
return;
|
|
25384
25611
|
}
|
|
25385
|
-
} else if (
|
|
25386
|
-
const winningBranch = nestedChooseBranch(
|
|
25612
|
+
} else if (child13.name === "choose") {
|
|
25613
|
+
const winningBranch = nestedChooseBranch(child13, nodeCount, context);
|
|
25387
25614
|
if (winningBranch) {
|
|
25388
25615
|
visit(winningBranch);
|
|
25389
25616
|
}
|
|
25390
25617
|
} else {
|
|
25391
|
-
visit(
|
|
25618
|
+
visit(child13);
|
|
25392
25619
|
}
|
|
25393
25620
|
}
|
|
25394
25621
|
};
|
|
@@ -25445,12 +25672,12 @@ function chooseAlgorithmOfType(view, node, nodeCount, allowedTypes, context = {}
|
|
|
25445
25672
|
// diagram/layout/smartart-layout-interpreter-hierarchy-descendant.ts
|
|
25446
25673
|
var HIERARCHY_ALG_TYPES = /* @__PURE__ */ new Set(["hierRoot", "hierChild"]);
|
|
25447
25674
|
function hasHierarchyDescendant(view, node, nodeCount, context) {
|
|
25448
|
-
return (node.children ?? []).some((
|
|
25449
|
-
const type =
|
|
25675
|
+
return (node.children ?? []).some((child13) => {
|
|
25676
|
+
const type = child13.algorithm?.type ?? chooseAlgType(view, child13, nodeCount, context);
|
|
25450
25677
|
if (type && HIERARCHY_ALG_TYPES.has(type)) {
|
|
25451
25678
|
return true;
|
|
25452
25679
|
}
|
|
25453
|
-
return hasHierarchyDescendant(view,
|
|
25680
|
+
return hasHierarchyDescendant(view, child13, nodeCount, context);
|
|
25454
25681
|
});
|
|
25455
25682
|
}
|
|
25456
25683
|
|
|
@@ -25465,7 +25692,7 @@ function resolveNonHierarchyChoose(view, node, resolvedAlg, nodeCount, whenConte
|
|
|
25465
25692
|
const withResolvedAlg = resolvedAlg ? { ...node, algorithm: resolvedAlg } : node;
|
|
25466
25693
|
const kind = type ? PRIMARY_ALG[type] : void 0;
|
|
25467
25694
|
const rawArranger = node.children?.find(
|
|
25468
|
-
(
|
|
25695
|
+
(child13) => child13.algorithm?.type === type && !isTransitionOnlyChild(child13) && !isContinuationForEach(child13)
|
|
25469
25696
|
);
|
|
25470
25697
|
const arranger = rawArranger && !hasPositionGuard(rawArranger) ? rawArranger : withResolvedAlg;
|
|
25471
25698
|
const tunnelledPastOwnSlot = tunnelsPastOwnCompositeSlot(
|
|
@@ -25490,8 +25717,8 @@ function resolveNonHierarchyChoose(view, node, resolvedAlg, nodeCount, whenConte
|
|
|
25490
25717
|
function walkWithTreeLocation(node, visit, location = { position: 1, total: 1, depth: 0 }) {
|
|
25491
25718
|
visit(node, location);
|
|
25492
25719
|
const children5 = node.children ?? [];
|
|
25493
|
-
children5.forEach((
|
|
25494
|
-
walkWithTreeLocation(
|
|
25720
|
+
children5.forEach((child13, i2) => {
|
|
25721
|
+
walkWithTreeLocation(child13, visit, {
|
|
25495
25722
|
position: i2 + 1,
|
|
25496
25723
|
total: children5.length,
|
|
25497
25724
|
depth: location.depth + 1
|
|
@@ -25503,7 +25730,7 @@ function treeMaxDepth(node, depth = 0) {
|
|
|
25503
25730
|
if (children5.length === 0) {
|
|
25504
25731
|
return depth;
|
|
25505
25732
|
}
|
|
25506
|
-
return Math.max(...children5.map((
|
|
25733
|
+
return Math.max(...children5.map((child13) => treeMaxDepth(child13, depth + 1)));
|
|
25507
25734
|
}
|
|
25508
25735
|
|
|
25509
25736
|
// diagram/layout/smartart-layout-interpreter-model.ts
|
|
@@ -25530,7 +25757,7 @@ function discoverArrangement(view, definition, nodeCount, presLayoutVars, flatNo
|
|
|
25530
25757
|
const resolvedAlg = chooseAlgorithm(view, node, nodeCount, whenContext);
|
|
25531
25758
|
const type2 = resolvedAlg?.type;
|
|
25532
25759
|
if (type2 === "hierRoot" || type2 === "hierChild") {
|
|
25533
|
-
hierarchy = node.children?.find((
|
|
25760
|
+
hierarchy = node.children?.find((child13) => child13.algorithm?.type === type2) ?? node;
|
|
25534
25761
|
} else {
|
|
25535
25762
|
const resolution = resolveNonHierarchyChoose(
|
|
25536
25763
|
view,
|
|
@@ -25699,12 +25926,12 @@ function findCompositeItemShape(item) {
|
|
|
25699
25926
|
}
|
|
25700
25927
|
anyShape ??= node.shape;
|
|
25701
25928
|
}
|
|
25702
|
-
for (const
|
|
25703
|
-
walk3(
|
|
25929
|
+
for (const child13 of node.children ?? []) {
|
|
25930
|
+
walk3(child13);
|
|
25704
25931
|
}
|
|
25705
25932
|
};
|
|
25706
|
-
for (const
|
|
25707
|
-
walk3(
|
|
25933
|
+
for (const child13 of item.children ?? []) {
|
|
25934
|
+
walk3(child13);
|
|
25708
25935
|
}
|
|
25709
25936
|
return textRoleShape ?? hiddenTextRoleShape ?? decorativeShape ?? anyShape;
|
|
25710
25937
|
}
|
|
@@ -26042,12 +26269,12 @@ function resolveRingItemNode(constraintNode, arrangerConstraints) {
|
|
|
26042
26269
|
const sibSpName = (arrangerConstraints ?? []).find(
|
|
26043
26270
|
(c) => c.type === "sibSp" && typeof c.referenceForName === "string"
|
|
26044
26271
|
)?.referenceForName;
|
|
26045
|
-
const named = sibSpName ? (constraintNode.children ?? []).find((
|
|
26272
|
+
const named = sibSpName ? (constraintNode.children ?? []).find((child13) => child13.name === sibSpName) : void 0;
|
|
26046
26273
|
if (named?.forEachOrigin) {
|
|
26047
26274
|
return named;
|
|
26048
26275
|
}
|
|
26049
26276
|
const children5 = constraintNode.children ?? [];
|
|
26050
|
-
const repeating = children5.find((
|
|
26277
|
+
const repeating = children5.find((child13) => child13.forEachOrigin && child13.algorithm?.type !== "conn") ?? children5.find((child13) => child13.forEachOrigin);
|
|
26051
26278
|
return repeating ?? named ?? itemNode(constraintNode);
|
|
26052
26279
|
}
|
|
26053
26280
|
|
|
@@ -26059,8 +26286,8 @@ function findCurveSiblingConnector(node) {
|
|
|
26059
26286
|
if (node.algorithm?.type === "conn" && node.algorithm.parameters?.some((p) => p.type === "connRout" && p.value === "curve") && node.algorithm.parameters?.some((p) => p.type === "begPts" && p.value === "ctr") && node.algorithm.parameters?.some((p) => p.type === "endPts" && p.value === "ctr")) {
|
|
26060
26287
|
return node;
|
|
26061
26288
|
}
|
|
26062
|
-
for (const
|
|
26063
|
-
const found = findCurveSiblingConnector(
|
|
26289
|
+
for (const child13 of node.children ?? []) {
|
|
26290
|
+
const found = findCurveSiblingConnector(child13);
|
|
26064
26291
|
if (found) {
|
|
26065
26292
|
return found;
|
|
26066
26293
|
}
|
|
@@ -26091,9 +26318,9 @@ function resolveCycleConstraintNode(arrangerNode) {
|
|
|
26091
26318
|
if (arrangerNode.name === "cycle") {
|
|
26092
26319
|
return arrangerNode;
|
|
26093
26320
|
}
|
|
26094
|
-
for (const
|
|
26095
|
-
if (
|
|
26096
|
-
return
|
|
26321
|
+
for (const child13 of arrangerNode.children ?? []) {
|
|
26322
|
+
if (child13.name === "cycle") {
|
|
26323
|
+
return child13;
|
|
26097
26324
|
}
|
|
26098
26325
|
}
|
|
26099
26326
|
return arrangerNode;
|
|
@@ -26175,7 +26402,7 @@ function buildCycleRingExtensions(parentCentre, parentNode, context, path) {
|
|
|
26175
26402
|
const spanRad = context.fanSpanDeg * DEG_TO_RAD;
|
|
26176
26403
|
const nodes = [];
|
|
26177
26404
|
const connectors2 = [];
|
|
26178
|
-
children5.forEach((
|
|
26405
|
+
children5.forEach((child13, i2) => {
|
|
26179
26406
|
const angle = count === 1 ? baseAngleRad : baseAngleRad - spanRad / 2 + spanRad * i2 / (count - 1);
|
|
26180
26407
|
const cx = parentCentre.x + Math.cos(angle) * radius;
|
|
26181
26408
|
const cy = parentCentre.y + Math.sin(angle) * radius;
|
|
@@ -26187,7 +26414,7 @@ function buildCycleRingExtensions(parentCentre, parentNode, context, path) {
|
|
|
26187
26414
|
y: cy - context.itemHeight / 2,
|
|
26188
26415
|
width: context.itemWidth,
|
|
26189
26416
|
height: context.itemHeight,
|
|
26190
|
-
node:
|
|
26417
|
+
node: child13,
|
|
26191
26418
|
index: i2,
|
|
26192
26419
|
total: count,
|
|
26193
26420
|
palette: context.palette,
|
|
@@ -26204,7 +26431,7 @@ function buildCycleRingExtensions(parentCentre, parentNode, context, path) {
|
|
|
26204
26431
|
key: `${key}-conn`,
|
|
26205
26432
|
d: `M${parentCentre.x},${parentCentre.y} L${cx},${cy}`
|
|
26206
26433
|
});
|
|
26207
|
-
const nested = buildCycleRingExtensions({ x: cx, y: cy },
|
|
26434
|
+
const nested = buildCycleRingExtensions({ x: cx, y: cy }, child13, context, `${path}-${i2}`);
|
|
26208
26435
|
nodes.push(...nested.nodes);
|
|
26209
26436
|
connectors2.push(...nested.connectors);
|
|
26210
26437
|
});
|
|
@@ -26266,8 +26493,8 @@ function findFontRoleNode(item) {
|
|
|
26266
26493
|
if (isTextRole3(item)) {
|
|
26267
26494
|
return item;
|
|
26268
26495
|
}
|
|
26269
|
-
for (const
|
|
26270
|
-
const found = findFontRoleNode(
|
|
26496
|
+
for (const child13 of item.children ?? []) {
|
|
26497
|
+
const found = findFontRoleNode(child13);
|
|
26271
26498
|
if (found) {
|
|
26272
26499
|
return found;
|
|
26273
26500
|
}
|
|
@@ -28273,13 +28500,13 @@ function compoundChildIds(role, node, childrenOf) {
|
|
|
28273
28500
|
const positions = positionRange(start, count, 1, children5.length);
|
|
28274
28501
|
const ids = [];
|
|
28275
28502
|
for (const position2 of positions) {
|
|
28276
|
-
const
|
|
28277
|
-
if (!
|
|
28503
|
+
const child13 = children5[position2 - 1];
|
|
28504
|
+
if (!child13 || child13.text.trim().length === 0) {
|
|
28278
28505
|
continue;
|
|
28279
28506
|
}
|
|
28280
28507
|
ids.push(
|
|
28281
|
-
|
|
28282
|
-
...smartArtDescendantsWithText(
|
|
28508
|
+
child13.id,
|
|
28509
|
+
...smartArtDescendantsWithText(child13, childrenOf).map((descendant) => descendant.id)
|
|
28283
28510
|
);
|
|
28284
28511
|
}
|
|
28285
28512
|
return ids;
|
|
@@ -28300,8 +28527,8 @@ function isTextRole(node) {
|
|
|
28300
28527
|
}
|
|
28301
28528
|
function hasAmbiguousTopLevelRoles(topLevelChildren) {
|
|
28302
28529
|
const textRoles = topLevelChildren.filter(isTextRole);
|
|
28303
|
-
const descendantAxisRoles = textRoles.filter((
|
|
28304
|
-
const axis =
|
|
28530
|
+
const descendantAxisRoles = textRoles.filter((child13) => {
|
|
28531
|
+
const axis = child13.presentationOf?.axis?.[0];
|
|
28305
28532
|
return axis === "ch" || axis === "des" || axis === "desOrSelf";
|
|
28306
28533
|
});
|
|
28307
28534
|
if (descendantAxisRoles.length >= 2) {
|
|
@@ -28336,7 +28563,7 @@ function contentIds(role, node, childrenOf) {
|
|
|
28336
28563
|
return [node.id];
|
|
28337
28564
|
}
|
|
28338
28565
|
if (axis === "ch") {
|
|
28339
|
-
return (childrenOf.get(node.id) ?? []).filter((
|
|
28566
|
+
return (childrenOf.get(node.id) ?? []).filter((child13) => child13.text.trim().length > 0).map((child13) => child13.id);
|
|
28340
28567
|
}
|
|
28341
28568
|
if (axis === "des") {
|
|
28342
28569
|
return descendantIds(node, childrenOf);
|
|
@@ -28365,11 +28592,11 @@ function unwrapTextRoles(node) {
|
|
|
28365
28592
|
return [];
|
|
28366
28593
|
}
|
|
28367
28594
|
const out = [];
|
|
28368
|
-
for (const
|
|
28369
|
-
if (isTextRole(
|
|
28370
|
-
out.push(
|
|
28595
|
+
for (const child13 of node.children ?? []) {
|
|
28596
|
+
if (isTextRole(child13)) {
|
|
28597
|
+
out.push(child13);
|
|
28371
28598
|
} else {
|
|
28372
|
-
out.push(...unwrapTextRoles(
|
|
28599
|
+
out.push(...unwrapTextRoles(child13));
|
|
28373
28600
|
}
|
|
28374
28601
|
}
|
|
28375
28602
|
return out;
|
|
@@ -28396,13 +28623,13 @@ function findRoleWrapper(node, roles, depth) {
|
|
|
28396
28623
|
if (depth > MAX_WRAPPER_DEPTH) {
|
|
28397
28624
|
return void 0;
|
|
28398
28625
|
}
|
|
28399
|
-
for (const
|
|
28400
|
-
if (roles.includes(
|
|
28626
|
+
for (const child13 of node.children ?? []) {
|
|
28627
|
+
if (roles.includes(child13)) {
|
|
28401
28628
|
continue;
|
|
28402
28629
|
}
|
|
28403
|
-
const unwrapped = unwrapTextRoles(
|
|
28630
|
+
const unwrapped = unwrapTextRoles(child13);
|
|
28404
28631
|
if (unwrapped.length > 0 && roles.every((role) => unwrapped.includes(role))) {
|
|
28405
|
-
return findRoleWrapper(
|
|
28632
|
+
return findRoleWrapper(child13, roles, depth + 1) ?? child13;
|
|
28406
28633
|
}
|
|
28407
28634
|
}
|
|
28408
28635
|
return void 0;
|
|
@@ -28420,7 +28647,7 @@ function isExplicitHorizontalLin(view, node, nodeCount, presLayoutVars) {
|
|
|
28420
28647
|
}
|
|
28421
28648
|
function rawShapeAttributes(branch) {
|
|
28422
28649
|
const shapeXml2 = branch?.children.find(
|
|
28423
|
-
(
|
|
28650
|
+
(child13) => child13.name === "shape" && (Object.keys(child13.attrs).length > 0 || child13.children.length > 0)
|
|
28424
28651
|
);
|
|
28425
28652
|
if (!shapeXml2) {
|
|
28426
28653
|
return void 0;
|
|
@@ -28543,14 +28770,14 @@ function algTypeOf(view, node, nodeCount, presLayoutVars) {
|
|
|
28543
28770
|
return node.algorithm?.type ?? chooseAlgType(view, node, nodeCount, { presLayoutVars: presLayoutVars ?? {} });
|
|
28544
28771
|
}
|
|
28545
28772
|
function findRowChild(view, node, presLayoutVars) {
|
|
28546
|
-
return (node.children ?? []).find((
|
|
28547
|
-
if (
|
|
28773
|
+
return (node.children ?? []).find((child13) => {
|
|
28774
|
+
if (child13.algorithm?.type === "sp") {
|
|
28548
28775
|
return false;
|
|
28549
28776
|
}
|
|
28550
|
-
if (algTypeOf(view,
|
|
28777
|
+
if (algTypeOf(view, child13, 2, presLayoutVars) !== "lin") {
|
|
28551
28778
|
return false;
|
|
28552
28779
|
}
|
|
28553
|
-
return (
|
|
28780
|
+
return (child13.children ?? []).some(
|
|
28554
28781
|
(grandchild) => grandchild.forEachOrigin?.axis?.includes("ch") && grandchild.forEachOrigin?.pointTypes?.includes("node")
|
|
28555
28782
|
);
|
|
28556
28783
|
});
|
|
@@ -28563,7 +28790,7 @@ function isRecursiveTableItemTemplate(view, node, presLayoutVars) {
|
|
|
28563
28790
|
return false;
|
|
28564
28791
|
}
|
|
28565
28792
|
const hasLabel = (node.children ?? []).some(
|
|
28566
|
-
(
|
|
28793
|
+
(child13) => child13.algorithm?.type === "tx" && child13.presentationOf?.axis?.includes("self")
|
|
28567
28794
|
);
|
|
28568
28795
|
return hasLabel && findRowChild(view, node, presLayoutVars) !== void 0;
|
|
28569
28796
|
}
|
|
@@ -28626,8 +28853,8 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
28626
28853
|
const place = (node, x, width) => {
|
|
28627
28854
|
placed.push({ node, x, width });
|
|
28628
28855
|
const kids = childrenIn(node);
|
|
28629
|
-
for (const [
|
|
28630
|
-
place(
|
|
28856
|
+
for (const [child13, childX, childWidth] of splitAcross(kids, x, width)) {
|
|
28857
|
+
place(child13, childX, childWidth);
|
|
28631
28858
|
}
|
|
28632
28859
|
};
|
|
28633
28860
|
for (const [root, rootX, rootWidth] of splitAcross(roots, 0, w)) {
|
|
@@ -28884,8 +29111,8 @@ function findNamedNode(node, name) {
|
|
|
28884
29111
|
if (node.name === name) {
|
|
28885
29112
|
return node;
|
|
28886
29113
|
}
|
|
28887
|
-
for (const
|
|
28888
|
-
const found = findNamedNode(
|
|
29114
|
+
for (const child13 of node.children ?? []) {
|
|
29115
|
+
const found = findNamedNode(child13, name);
|
|
28889
29116
|
if (found) {
|
|
28890
29117
|
return found;
|
|
28891
29118
|
}
|
|
@@ -29266,12 +29493,12 @@ function winningOrdinalFor(guardsByOrdinal, nodeCount, flat) {
|
|
|
29266
29493
|
return void 0;
|
|
29267
29494
|
}
|
|
29268
29495
|
function selectFirstMatchChildren(children5, flat) {
|
|
29269
|
-
if (children5.every((
|
|
29496
|
+
if (children5.every((child13) => (child13.chooseGroups?.length ?? 0) === 0)) {
|
|
29270
29497
|
return children5;
|
|
29271
29498
|
}
|
|
29272
29499
|
const guardsByGroup = /* @__PURE__ */ new Map();
|
|
29273
|
-
for (const
|
|
29274
|
-
for (const entry of
|
|
29500
|
+
for (const child13 of children5) {
|
|
29501
|
+
for (const entry of child13.chooseGroups ?? []) {
|
|
29275
29502
|
let byOrdinal = guardsByGroup.get(entry.id);
|
|
29276
29503
|
if (!byOrdinal) {
|
|
29277
29504
|
byOrdinal = /* @__PURE__ */ new Map();
|
|
@@ -29288,7 +29515,7 @@ function selectFirstMatchChildren(children5, flat) {
|
|
|
29288
29515
|
winningOrdinal.set(groupId, winningOrdinalFor(guardsByOrdinal, nodeCount, flat));
|
|
29289
29516
|
}
|
|
29290
29517
|
return children5.filter(
|
|
29291
|
-
(
|
|
29518
|
+
(child13) => (child13.chooseGroups ?? []).every((entry) => {
|
|
29292
29519
|
const winner = winningOrdinal.get(entry.id);
|
|
29293
29520
|
return winner === void 0 || winner === entry.ordinal;
|
|
29294
29521
|
})
|
|
@@ -29362,8 +29589,8 @@ function collectRawCandidates(node, flat, declaringRole, out = [], inheritedOrig
|
|
|
29362
29589
|
const nextAncestorChain = nextRole === declaringRole ? ancestorChain : [declaringRole, ...ancestorChain];
|
|
29363
29590
|
const ownTemplateOrigin = node.algorithm?.type && STRUCTURAL_ALG_TYPES.has(node.algorithm.type) && node.forEachOrigin?.axis?.includes("ch") && node.forEachOrigin?.pointTypes?.includes("node") ? node.forEachOrigin : void 0;
|
|
29364
29591
|
const effectiveOrigin = ownTemplateOrigin ?? inheritedOrigin;
|
|
29365
|
-
for (const
|
|
29366
|
-
collectRawCandidates(
|
|
29592
|
+
for (const child13 of selectFirstMatchChildren(node.children ?? [], flat)) {
|
|
29593
|
+
collectRawCandidates(child13, flat, nextRole, out, effectiveOrigin, nextAncestorChain);
|
|
29367
29594
|
}
|
|
29368
29595
|
return out;
|
|
29369
29596
|
}
|
|
@@ -29497,9 +29724,9 @@ function isPositioned(dims) {
|
|
|
29497
29724
|
}
|
|
29498
29725
|
function readSlots(children5, box, index, declaringRole, sizeBox = box) {
|
|
29499
29726
|
const slots = [];
|
|
29500
|
-
for (const
|
|
29501
|
-
const c =
|
|
29502
|
-
const role = roleOf(
|
|
29727
|
+
for (const child13 of children5) {
|
|
29728
|
+
const c = child13.constraints;
|
|
29729
|
+
const role = roleOf(child13);
|
|
29503
29730
|
const hubSizeBox = isUserSizeHubRole(role, index) ? sizeBox : box;
|
|
29504
29731
|
const dims = {
|
|
29505
29732
|
l: dimOf(c, "l", box, index, role, declaringRole),
|
|
@@ -29510,7 +29737,7 @@ function readSlots(children5, box, index, declaringRole, sizeBox = box) {
|
|
|
29510
29737
|
ctrY: dimOf(c, "ctrY", box, index, role, declaringRole)
|
|
29511
29738
|
};
|
|
29512
29739
|
if (isPositioned(dims)) {
|
|
29513
|
-
slots.push({ node:
|
|
29740
|
+
slots.push({ node: child13, dims });
|
|
29514
29741
|
}
|
|
29515
29742
|
}
|
|
29516
29743
|
return slots;
|
|
@@ -29884,9 +30111,9 @@ function collectChildRepeaterItems(wrapper, anchorChildren) {
|
|
|
29884
30111
|
continue;
|
|
29885
30112
|
}
|
|
29886
30113
|
for (const position2 of spec.positions) {
|
|
29887
|
-
const
|
|
29888
|
-
if (
|
|
29889
|
-
items.push({ child:
|
|
30114
|
+
const child13 = anchorChildren[position2 - 1];
|
|
30115
|
+
if (child13) {
|
|
30116
|
+
items.push({ child: child13, position: position2, fold: spec.fold });
|
|
29890
30117
|
}
|
|
29891
30118
|
}
|
|
29892
30119
|
}
|
|
@@ -30089,7 +30316,7 @@ function sameForEachRing(a, b) {
|
|
|
30089
30316
|
}
|
|
30090
30317
|
function findRingDesSibling(allChildren, selfNode) {
|
|
30091
30318
|
return allChildren.find(
|
|
30092
|
-
(
|
|
30319
|
+
(child13) => child13.presentationOf?.axis?.[0] === "des" && sameForEachRing(child13.forEachOrigin, selfNode.forEachOrigin)
|
|
30093
30320
|
);
|
|
30094
30321
|
}
|
|
30095
30322
|
function ringFoldRect(selfRect) {
|
|
@@ -30384,8 +30611,8 @@ function collectTxShapeNodes(node, out, seen) {
|
|
|
30384
30611
|
out.push(node);
|
|
30385
30612
|
}
|
|
30386
30613
|
}
|
|
30387
|
-
for (const
|
|
30388
|
-
collectTxShapeNodes(
|
|
30614
|
+
for (const child13 of node.children ?? []) {
|
|
30615
|
+
collectTxShapeNodes(child13, out, seen);
|
|
30389
30616
|
}
|
|
30390
30617
|
}
|
|
30391
30618
|
function crossReferencesAnotherCandidate(candidate, otherNames, constraints) {
|
|
@@ -30575,8 +30802,8 @@ function findNestedChildAlgorithm(view, algorithmNode, nodeCount, presLayoutVars
|
|
|
30575
30802
|
if (!root) {
|
|
30576
30803
|
return void 0;
|
|
30577
30804
|
}
|
|
30578
|
-
for (const
|
|
30579
|
-
const found = findFirst(view,
|
|
30805
|
+
for (const child13 of root.node.children ?? []) {
|
|
30806
|
+
const found = findFirst(view, child13, "hierChild", nodeCount, presLayoutVars, /* @__PURE__ */ new Set());
|
|
30580
30807
|
if (found) {
|
|
30581
30808
|
return found;
|
|
30582
30809
|
}
|
|
@@ -30613,8 +30840,8 @@ function findFirst(view, node, type, nodeCount, presLayoutVars, visited) {
|
|
|
30613
30840
|
if (algorithm?.type === type) {
|
|
30614
30841
|
return { node, algorithm };
|
|
30615
30842
|
}
|
|
30616
|
-
for (const
|
|
30617
|
-
const found = findFirst(view,
|
|
30843
|
+
for (const child13 of node.children ?? []) {
|
|
30844
|
+
const found = findFirst(view, child13, type, nodeCount, presLayoutVars, visited);
|
|
30618
30845
|
if (found) {
|
|
30619
30846
|
return found;
|
|
30620
30847
|
}
|
|
@@ -30633,8 +30860,8 @@ function collectScoped(view, node, crossedHierChild, out, nodeCount, presLayoutV
|
|
|
30633
30860
|
out.push({ node, descendantScope: crossedHierChild });
|
|
30634
30861
|
}
|
|
30635
30862
|
const nextCrossed = crossedHierChild || node.algorithm?.type === "hierChild";
|
|
30636
|
-
for (const
|
|
30637
|
-
collectScoped(view,
|
|
30863
|
+
for (const child13 of node.children ?? []) {
|
|
30864
|
+
collectScoped(view, child13, nextCrossed, out, nodeCount, presLayoutVars);
|
|
30638
30865
|
}
|
|
30639
30866
|
}
|
|
30640
30867
|
function resolvedSize(index, name) {
|
|
@@ -30651,8 +30878,8 @@ function resolveHierarchyGenerationTemplates(view, algorithmNode, index, nodeCou
|
|
|
30651
30878
|
}
|
|
30652
30879
|
const fallbackNode = resolveHierarchyItemNode(algorithmNode);
|
|
30653
30880
|
const scoped = [];
|
|
30654
|
-
for (const
|
|
30655
|
-
collectScoped(view,
|
|
30881
|
+
for (const child13 of algorithmNode.children ?? []) {
|
|
30882
|
+
collectScoped(view, child13, false, scoped, nodeCount, presLayoutVars);
|
|
30656
30883
|
}
|
|
30657
30884
|
const rootScoped = scoped.filter((c) => !c.descendantScope);
|
|
30658
30885
|
const descendantScoped = scoped.filter((c) => c.descendantScope);
|
|
@@ -30720,8 +30947,8 @@ function partitionChildren(t, orgChart) {
|
|
|
30720
30947
|
}
|
|
30721
30948
|
const assistants = [];
|
|
30722
30949
|
const normal = [];
|
|
30723
|
-
for (const
|
|
30724
|
-
(isAssistant(
|
|
30950
|
+
for (const child13 of t.children) {
|
|
30951
|
+
(isAssistant(child13.node) ? assistants : normal).push(child13);
|
|
30725
30952
|
}
|
|
30726
30953
|
return { assistants, normal };
|
|
30727
30954
|
}
|
|
@@ -30731,8 +30958,8 @@ function effectiveWidth(t, orgChart) {
|
|
|
30731
30958
|
return 1;
|
|
30732
30959
|
}
|
|
30733
30960
|
let sum = 0;
|
|
30734
|
-
for (const
|
|
30735
|
-
sum += effectiveWidth(
|
|
30961
|
+
for (const child13 of normal) {
|
|
30962
|
+
sum += effectiveWidth(child13, orgChart);
|
|
30736
30963
|
}
|
|
30737
30964
|
return sum;
|
|
30738
30965
|
}
|
|
@@ -30762,8 +30989,8 @@ function flattenOrgChartGroupWrappers(nodes, orgChart) {
|
|
|
30762
30989
|
function countDescendants(t, orgChart) {
|
|
30763
30990
|
const { normal } = partitionChildren(t, orgChart);
|
|
30764
30991
|
let count = normal.length;
|
|
30765
|
-
for (const
|
|
30766
|
-
count += countDescendants(
|
|
30992
|
+
for (const child13 of normal) {
|
|
30993
|
+
count += countDescendants(child13, orgChart);
|
|
30767
30994
|
}
|
|
30768
30995
|
return count;
|
|
30769
30996
|
}
|
|
@@ -30783,8 +31010,8 @@ function walk(t, level2, perRow, orgChart, siblingCount) {
|
|
|
30783
31010
|
let maxHang = 0;
|
|
30784
31011
|
let maxRows = 0;
|
|
30785
31012
|
let hangingColumns = 0;
|
|
30786
|
-
for (const
|
|
30787
|
-
const r = walk(
|
|
31013
|
+
for (const child13 of normal) {
|
|
31014
|
+
const r = walk(child13, level2 + 1, perRow, orgChart, normal.length);
|
|
30788
31015
|
deepestFan = Math.max(deepestFan, r.deepestFanLevel);
|
|
30789
31016
|
maxHang = Math.max(maxHang, r.maxHangDepth);
|
|
30790
31017
|
maxRows = Math.max(maxRows, r.maxHangRows);
|
|
@@ -30802,8 +31029,8 @@ function walk(t, level2, perRow, orgChart, siblingCount) {
|
|
|
30802
31029
|
let maxHang = 0;
|
|
30803
31030
|
let maxRows = 0;
|
|
30804
31031
|
let hangingColumns = 0;
|
|
30805
|
-
for (const
|
|
30806
|
-
const r = walk(
|
|
31032
|
+
for (const child13 of normal) {
|
|
31033
|
+
const r = walk(child13, level2 + 1, perRow, orgChart, void 0);
|
|
30807
31034
|
deepestFan = Math.max(deepestFan, r.deepestFanLevel);
|
|
30808
31035
|
maxHang = Math.max(maxHang, r.maxHangDepth);
|
|
30809
31036
|
maxRows = Math.max(maxRows, r.maxHangRows);
|
|
@@ -30829,12 +31056,12 @@ function allChildrenHangForRoot(root, orgChart, perRow) {
|
|
|
30829
31056
|
return false;
|
|
30830
31057
|
}
|
|
30831
31058
|
const childLevel = 1;
|
|
30832
|
-
return normal.every((
|
|
30833
|
-
const childNormalCount = partitionChildren(
|
|
31059
|
+
return normal.every((child13) => {
|
|
31060
|
+
const childNormalCount = partitionChildren(child13, orgChart).normal.length;
|
|
30834
31061
|
if (childNormalCount === 0) {
|
|
30835
31062
|
return false;
|
|
30836
31063
|
}
|
|
30837
|
-
const r = walk(
|
|
31064
|
+
const r = walk(child13, childLevel, perRow, orgChart, normal.length);
|
|
30838
31065
|
return r.deepestFanLevel === childLevel;
|
|
30839
31066
|
});
|
|
30840
31067
|
}
|
|
@@ -30863,13 +31090,13 @@ function widthWalk(t, level2, perRow, orgChart, siblingCount, map) {
|
|
|
30863
31090
|
width = 1;
|
|
30864
31091
|
} else if (level2 === 0) {
|
|
30865
31092
|
width = 0;
|
|
30866
|
-
for (const
|
|
30867
|
-
width += widthWalk(
|
|
31093
|
+
for (const child13 of normal) {
|
|
31094
|
+
width += widthWalk(child13, level2 + 1, perRow, orgChart, normal.length, map);
|
|
30868
31095
|
}
|
|
30869
31096
|
} else if (fanContinues(t, perRow, orgChart, siblingCount, normal.length)) {
|
|
30870
31097
|
width = 0;
|
|
30871
|
-
for (const
|
|
30872
|
-
width += widthWalk(
|
|
31098
|
+
for (const child13 of normal) {
|
|
31099
|
+
width += widthWalk(child13, level2 + 1, perRow, orgChart, void 0, map);
|
|
30873
31100
|
}
|
|
30874
31101
|
} else {
|
|
30875
31102
|
width = 1;
|
|
@@ -30909,7 +31136,7 @@ function hierarchyLeafFoldsDescendants(node) {
|
|
|
30909
31136
|
if (endsInUnboundedDescendantHop(node.presentationOf?.axis, node.presentationOf?.count)) {
|
|
30910
31137
|
return true;
|
|
30911
31138
|
}
|
|
30912
|
-
return (node.children ?? []).some((
|
|
31139
|
+
return (node.children ?? []).some((child13) => hierarchyLeafFoldsDescendants(child13));
|
|
30913
31140
|
}
|
|
30914
31141
|
|
|
30915
31142
|
// diagram/hierarchy/smartart-hierarchy-fanned-hang-geometry.ts
|
|
@@ -31001,10 +31228,10 @@ function placeDescendantColumn(hc, node, edgeX, side, y, descW, descH, stackGapP
|
|
|
31001
31228
|
pushNode(hc, node.node, x, y, descW, descH);
|
|
31002
31229
|
elbowConnector(hc, parentId, parentCenterX, parentBottom, x + descW / 2, y, node.node.id);
|
|
31003
31230
|
let nextY = y + descH + stackGapPx;
|
|
31004
|
-
for (const
|
|
31231
|
+
for (const child13 of node.children) {
|
|
31005
31232
|
nextY = placeDescendantColumn(
|
|
31006
31233
|
hc,
|
|
31007
|
-
|
|
31234
|
+
child13,
|
|
31008
31235
|
edgeX,
|
|
31009
31236
|
side,
|
|
31010
31237
|
nextY,
|
|
@@ -31054,10 +31281,10 @@ function arrangeFannedHangingForest(view, nodes, box, palette, style, elementId,
|
|
|
31054
31281
|
pushNode(hc, root.node, branchX, 0, rootW, rootH);
|
|
31055
31282
|
const edgeX = side === "right" ? branchX + rootW : branchX;
|
|
31056
31283
|
let y = rootH + rootChildGap;
|
|
31057
|
-
for (const
|
|
31284
|
+
for (const child13 of root.children) {
|
|
31058
31285
|
y = placeDescendantColumn(
|
|
31059
31286
|
hc,
|
|
31060
|
-
|
|
31287
|
+
child13,
|
|
31061
31288
|
edgeX,
|
|
31062
31289
|
side,
|
|
31063
31290
|
y,
|
|
@@ -31107,7 +31334,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level2 = 0) {
|
|
|
31107
31334
|
return;
|
|
31108
31335
|
}
|
|
31109
31336
|
const childX = align ? placeX : options.direction === "left" ? x - options.indent : x + options.indent;
|
|
31110
|
-
for (const
|
|
31337
|
+
for (const child13 of normal) {
|
|
31111
31338
|
const childY = cursor.y;
|
|
31112
31339
|
elbowConnector(
|
|
31113
31340
|
hc,
|
|
@@ -31116,9 +31343,9 @@ function placeHangingTree(hc, t, x, options, cursor, size, level2 = 0) {
|
|
|
31116
31343
|
y + boxH,
|
|
31117
31344
|
childX + hc.boxH / 2,
|
|
31118
31345
|
childY,
|
|
31119
|
-
|
|
31346
|
+
child13.node.id
|
|
31120
31347
|
);
|
|
31121
|
-
placeHangingTree(hc,
|
|
31348
|
+
placeHangingTree(hc, child13, childX, options, cursor, void 0, level2 + 1);
|
|
31122
31349
|
}
|
|
31123
31350
|
}
|
|
31124
31351
|
function placeHangingForest(hc, roots, startX, startY, options, rootSize) {
|
|
@@ -31200,8 +31427,8 @@ function countRows(t, level2, orgChart, fold) {
|
|
|
31200
31427
|
if (fold && level2 >= 1) {
|
|
31201
31428
|
return count;
|
|
31202
31429
|
}
|
|
31203
|
-
for (const
|
|
31204
|
-
count += countRows(
|
|
31430
|
+
for (const child13 of normal) {
|
|
31431
|
+
count += countRows(child13, level2 + 1, orgChart, fold);
|
|
31205
31432
|
}
|
|
31206
31433
|
return count;
|
|
31207
31434
|
}
|
|
@@ -31310,8 +31537,8 @@ function findCompositeDescendant(node) {
|
|
|
31310
31537
|
if (node.algorithm?.type === "composite") {
|
|
31311
31538
|
return node;
|
|
31312
31539
|
}
|
|
31313
|
-
for (const
|
|
31314
|
-
const found = findCompositeDescendant(
|
|
31540
|
+
for (const child13 of node.children ?? []) {
|
|
31541
|
+
const found = findCompositeDescendant(child13);
|
|
31315
31542
|
if (found) {
|
|
31316
31543
|
return found;
|
|
31317
31544
|
}
|
|
@@ -31320,7 +31547,7 @@ function findCompositeDescendant(node) {
|
|
|
31320
31547
|
}
|
|
31321
31548
|
function findTextBearingChild(compositeNode) {
|
|
31322
31549
|
return (compositeNode.children ?? []).find(
|
|
31323
|
-
(
|
|
31550
|
+
(child13) => (child13.presentationOf?.axis ?? []).includes("self")
|
|
31324
31551
|
);
|
|
31325
31552
|
}
|
|
31326
31553
|
function resolveCompositeChildGeometry(algorithmNode, wrapperAspect, allowOmittedWidthFactor = false) {
|
|
@@ -31328,13 +31555,13 @@ function resolveCompositeChildGeometry(algorithmNode, wrapperAspect, allowOmitte
|
|
|
31328
31555
|
if (!compositeNode) {
|
|
31329
31556
|
return void 0;
|
|
31330
31557
|
}
|
|
31331
|
-
const
|
|
31332
|
-
if (!
|
|
31558
|
+
const child13 = findTextBearingChild(compositeNode);
|
|
31559
|
+
if (!child13?.name) {
|
|
31333
31560
|
return void 0;
|
|
31334
31561
|
}
|
|
31335
31562
|
const constraints = compositeNode.allConstraints ?? compositeNode.constraints ?? [];
|
|
31336
31563
|
const widthConstr = constraints.find(
|
|
31337
|
-
(c) => c.type === "w" && c.for === "ch" && c.forName ===
|
|
31564
|
+
(c) => c.type === "w" && c.for === "ch" && c.forName === child13.name && c.referenceType === "w" && c.referenceForName === void 0 && (typeof c.factor === "number" || allowOmittedWidthFactor && c.factor === void 0)
|
|
31338
31565
|
);
|
|
31339
31566
|
if (!widthConstr) {
|
|
31340
31567
|
return void 0;
|
|
@@ -31344,10 +31571,10 @@ function resolveCompositeChildGeometry(algorithmNode, wrapperAspect, allowOmitte
|
|
|
31344
31571
|
return void 0;
|
|
31345
31572
|
}
|
|
31346
31573
|
const selfHeightConstr = constraints.find(
|
|
31347
|
-
(c) => c.type === "h" && c.for === "ch" && c.forName ===
|
|
31574
|
+
(c) => c.type === "h" && c.for === "ch" && c.forName === child13.name && c.referenceType === "w" && c.referenceFor === "ch" && c.referenceForName === child13.name && typeof c.factor === "number"
|
|
31348
31575
|
);
|
|
31349
31576
|
const leftConstr = constraints.find(
|
|
31350
|
-
(c) => c.type === "l" && c.for === "ch" && c.forName ===
|
|
31577
|
+
(c) => c.type === "l" && c.for === "ch" && c.forName === child13.name && c.referenceType === "w" && c.referenceForName === void 0 && typeof c.factor === "number"
|
|
31351
31578
|
);
|
|
31352
31579
|
const offsetXRatio = leftConstr?.factor ?? 0;
|
|
31353
31580
|
if (selfHeightConstr) {
|
|
@@ -31358,10 +31585,10 @@ function resolveCompositeChildGeometry(algorithmNode, wrapperAspect, allowOmitte
|
|
|
31358
31585
|
};
|
|
31359
31586
|
}
|
|
31360
31587
|
const parentRelativeHeightConstr = constraints.find(
|
|
31361
|
-
(c) => c.type === "h" && c.for === "ch" && c.forName ===
|
|
31588
|
+
(c) => c.type === "h" && c.for === "ch" && c.forName === child13.name && c.referenceType === "h" && c.referenceFor === void 0 && c.referenceForName === void 0 && typeof c.factor === "number"
|
|
31362
31589
|
);
|
|
31363
31590
|
const hasCompoundTextRole = constraints.some(
|
|
31364
|
-
(c) => c.type === "primFontSz" && c.referenceForName ===
|
|
31591
|
+
(c) => c.type === "primFontSz" && c.referenceForName === child13.name
|
|
31365
31592
|
);
|
|
31366
31593
|
if (parentRelativeHeightConstr && !hasCompoundTextRole && typeof wrapperAspect === "number" && wrapperAspect > 0 && typeof parentRelativeHeightConstr.factor === "number") {
|
|
31367
31594
|
return {
|
|
@@ -31378,12 +31605,12 @@ function compositeDeclaresCompoundTextRole(algorithmNode) {
|
|
|
31378
31605
|
if (!compositeNode) {
|
|
31379
31606
|
return false;
|
|
31380
31607
|
}
|
|
31381
|
-
const
|
|
31382
|
-
if (!
|
|
31608
|
+
const child13 = findTextBearingChild(compositeNode);
|
|
31609
|
+
if (!child13?.name) {
|
|
31383
31610
|
return false;
|
|
31384
31611
|
}
|
|
31385
31612
|
const constraints = compositeNode.allConstraints ?? compositeNode.constraints ?? [];
|
|
31386
|
-
return constraints.some((c) => c.type === "primFontSz" && c.referenceForName ===
|
|
31613
|
+
return constraints.some((c) => c.type === "primFontSz" && c.referenceForName === child13.name);
|
|
31387
31614
|
}
|
|
31388
31615
|
|
|
31389
31616
|
// diagram/hierarchy/smartart-hierarchy-constraint-lookup.ts
|
|
@@ -31470,14 +31697,14 @@ function findAlgParamValue(element, paramType) {
|
|
|
31470
31697
|
if (!element) {
|
|
31471
31698
|
return void 0;
|
|
31472
31699
|
}
|
|
31473
|
-
for (const
|
|
31474
|
-
if (
|
|
31475
|
-
if (
|
|
31476
|
-
return
|
|
31700
|
+
for (const child13 of groupedChildren(element)) {
|
|
31701
|
+
if (child13.name === "param") {
|
|
31702
|
+
if (child13.attrs["type"] === paramType) {
|
|
31703
|
+
return child13.attrs["val"];
|
|
31477
31704
|
}
|
|
31478
31705
|
continue;
|
|
31479
31706
|
}
|
|
31480
|
-
const found = findAlgParamValue(
|
|
31707
|
+
const found = findAlgParamValue(child13, paramType);
|
|
31481
31708
|
if (found !== void 0) {
|
|
31482
31709
|
return found;
|
|
31483
31710
|
}
|
|
@@ -31762,7 +31989,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, optio
|
|
|
31762
31989
|
const fanCy = (level2 + 1) * cellH + cellH / 2;
|
|
31763
31990
|
const fanned = normal.slice(0, plan.columns.length);
|
|
31764
31991
|
for (let i2 = 0; i2 < fanned.length; i2++) {
|
|
31765
|
-
const
|
|
31992
|
+
const child13 = fanned[i2];
|
|
31766
31993
|
const childCx = plan.columns[i2];
|
|
31767
31994
|
elbowConnector(
|
|
31768
31995
|
hc,
|
|
@@ -31771,9 +31998,9 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, optio
|
|
|
31771
31998
|
cy + hc.boxH / 2,
|
|
31772
31999
|
childCx,
|
|
31773
32000
|
fanCy - hc.boxH / 2,
|
|
31774
|
-
|
|
32001
|
+
child13.node.id
|
|
31775
32002
|
);
|
|
31776
|
-
placeAtFn(hc,
|
|
32003
|
+
placeAtFn(hc, child13, childCx, fanCy, 0, 1, level2 + 1, cellW, cellH, options);
|
|
31777
32004
|
}
|
|
31778
32005
|
if (plan.overflow <= 0 || !options.hangingPlacer) {
|
|
31779
32006
|
return;
|
|
@@ -31782,7 +32009,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, optio
|
|
|
31782
32009
|
const columnOffset = hc.boxW * HIER_TAIL_OFFSET_RATIO;
|
|
31783
32010
|
const anchorX = plan.columns[0] - hc.boxW / 2 + columnOffset;
|
|
31784
32011
|
const anchorY = (level2 + 2) * cellH;
|
|
31785
|
-
for (const
|
|
32012
|
+
for (const child13 of remainder) {
|
|
31786
32013
|
elbowConnector(
|
|
31787
32014
|
hc,
|
|
31788
32015
|
t.node.id,
|
|
@@ -31790,7 +32017,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, optio
|
|
|
31790
32017
|
cy + hc.boxH / 2,
|
|
31791
32018
|
anchorX + hc.boxH / 2,
|
|
31792
32019
|
anchorY,
|
|
31793
|
-
|
|
32020
|
+
child13.node.id
|
|
31794
32021
|
);
|
|
31795
32022
|
}
|
|
31796
32023
|
options.hangingPlacer(hc, remainder, anchorX, anchorY);
|
|
@@ -31822,16 +32049,16 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level2, cellW,
|
|
|
31822
32049
|
const siblingCxs = [];
|
|
31823
32050
|
{
|
|
31824
32051
|
let offset = xOffset;
|
|
31825
|
-
for (const
|
|
31826
|
-
const childW = spanOf(
|
|
32052
|
+
for (const child13 of normal) {
|
|
32053
|
+
const childW = spanOf(child13, options);
|
|
31827
32054
|
siblingCxs.push((offset + childW / 2) * cellW);
|
|
31828
32055
|
offset += childW;
|
|
31829
32056
|
}
|
|
31830
32057
|
}
|
|
31831
32058
|
const cascadeShift = options.cascadeOffsetX && level2 + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
|
|
31832
32059
|
let childOffset = xOffset;
|
|
31833
|
-
for (const
|
|
31834
|
-
const childW = spanOf(
|
|
32060
|
+
for (const child13 of normal) {
|
|
32061
|
+
const childW = spanOf(child13, options);
|
|
31835
32062
|
const childCx = (childOffset + childW / 2) * cellW + cascadeShift;
|
|
31836
32063
|
const childCy = (level2 + 1) * cellH + cellH / 2;
|
|
31837
32064
|
elbowConnector(
|
|
@@ -31841,11 +32068,11 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level2, cellW,
|
|
|
31841
32068
|
cy + hc.boxH / 2,
|
|
31842
32069
|
childCx,
|
|
31843
32070
|
childCy - hc.boxH / 2,
|
|
31844
|
-
|
|
32071
|
+
child13.node.id
|
|
31845
32072
|
);
|
|
31846
32073
|
placeChild(
|
|
31847
32074
|
hc,
|
|
31848
|
-
|
|
32075
|
+
child13,
|
|
31849
32076
|
childCx,
|
|
31850
32077
|
childCy,
|
|
31851
32078
|
childOffset,
|
|
@@ -31920,12 +32147,12 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
|
|
|
31920
32147
|
}
|
|
31921
32148
|
function placeRowFanGroup(hc, parentId, group, cx, cy, leftX, unitW, slot, rowCy, level2, cellW, cellH, options, placeAtFn) {
|
|
31922
32149
|
let cursor = slot;
|
|
31923
|
-
for (const
|
|
31924
|
-
const childW = effectiveWidth(
|
|
32150
|
+
for (const child13 of group.members) {
|
|
32151
|
+
const childW = effectiveWidth(child13, options.orgChart);
|
|
31925
32152
|
const childCx = leftX + unitW * (cursor + childW / 2);
|
|
31926
|
-
elbowConnector(hc, parentId, cx, cy + hc.boxH / 2, childCx, rowCy - hc.boxH / 2,
|
|
32153
|
+
elbowConnector(hc, parentId, cx, cy + hc.boxH / 2, childCx, rowCy - hc.boxH / 2, child13.node.id);
|
|
31927
32154
|
const virtualOffset = childCx / cellW - childW / 2;
|
|
31928
|
-
placeAtFn(hc,
|
|
32155
|
+
placeAtFn(hc, child13, childCx, rowCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
|
|
31929
32156
|
cursor += childW;
|
|
31930
32157
|
}
|
|
31931
32158
|
return cursor;
|
|
@@ -31937,13 +32164,13 @@ function placeColumnGroup(hc, parentId, group, cx, cy, leftX, unitW, slot, rowCy
|
|
|
31937
32164
|
let fromX = cx;
|
|
31938
32165
|
let fromY = cy + hc.boxH / 2;
|
|
31939
32166
|
for (let i2 = 0; i2 < group.members.length; i2++) {
|
|
31940
|
-
const
|
|
32167
|
+
const child13 = group.members[i2];
|
|
31941
32168
|
const childCy = rowCy + subRowH * i2;
|
|
31942
|
-
elbowConnector(hc, fromId, fromX, fromY, groupCx, childCy - hc.boxH / 2,
|
|
31943
|
-
const childW = effectiveWidth(
|
|
32169
|
+
elbowConnector(hc, fromId, fromX, fromY, groupCx, childCy - hc.boxH / 2, child13.node.id);
|
|
32170
|
+
const childW = effectiveWidth(child13, options.orgChart);
|
|
31944
32171
|
const virtualOffset = groupCx / cellW - childW / 2;
|
|
31945
|
-
placeAtFn(hc,
|
|
31946
|
-
fromId =
|
|
32172
|
+
placeAtFn(hc, child13, groupCx, childCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
|
|
32173
|
+
fromId = child13.node.id;
|
|
31947
32174
|
fromX = groupCx;
|
|
31948
32175
|
fromY = childCy + hc.boxH / 2;
|
|
31949
32176
|
}
|
|
@@ -32005,7 +32232,7 @@ function placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options, s
|
|
|
32005
32232
|
}
|
|
32006
32233
|
const anchorY = cy + hc.boxH / 2 + (options.hangHeightRatio ?? HANG_HEIGHT_RATIO) * hc.boxH;
|
|
32007
32234
|
const columnOffset = hc.boxW * HIER_TAIL_OFFSET_RATIO;
|
|
32008
|
-
for (const
|
|
32235
|
+
for (const child13 of normal) {
|
|
32009
32236
|
elbowConnector(
|
|
32010
32237
|
hc,
|
|
32011
32238
|
t.node.id,
|
|
@@ -32013,7 +32240,7 @@ function placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options, s
|
|
|
32013
32240
|
cy + hc.boxH / 2,
|
|
32014
32241
|
cx + columnOffset,
|
|
32015
32242
|
anchorY,
|
|
32016
|
-
|
|
32243
|
+
child13.node.id
|
|
32017
32244
|
);
|
|
32018
32245
|
}
|
|
32019
32246
|
options.hangingPlacer(hc, normal, cx - hc.boxW / 2 + columnOffset, anchorY);
|
|
@@ -32472,7 +32699,7 @@ function hasRecursiveItemTemplate(arranger) {
|
|
|
32472
32699
|
if (hasAmbiguousTopLevelRoles(arranger.children ?? [])) {
|
|
32473
32700
|
return false;
|
|
32474
32701
|
}
|
|
32475
|
-
const hasChAxisBelow = (node) => (node.children ?? []).some((
|
|
32702
|
+
const hasChAxisBelow = (node) => (node.children ?? []).some((child13) => isChAxisOrigin(child13) || hasChAxisBelow(child13));
|
|
32476
32703
|
return (arranger.children ?? []).some(hasChAxisBelow);
|
|
32477
32704
|
}
|
|
32478
32705
|
function visitOne(node, contextNode, childrenOf, connections, used, out) {
|
|
@@ -32490,8 +32717,8 @@ function visitOne(node, contextNode, childrenOf, connections, used, out) {
|
|
|
32490
32717
|
function collectRecursive(templateNodes, contextNode, childrenOf, connections, used, out) {
|
|
32491
32718
|
for (const templateNode of templateNodes) {
|
|
32492
32719
|
if (isChAxisOrigin(templateNode)) {
|
|
32493
|
-
for (const
|
|
32494
|
-
visitOne(templateNode,
|
|
32720
|
+
for (const child13 of childrenOf.get(contextNode.id) ?? []) {
|
|
32721
|
+
visitOne(templateNode, child13, childrenOf, connections, used, out);
|
|
32495
32722
|
}
|
|
32496
32723
|
} else {
|
|
32497
32724
|
visitOne(templateNode, contextNode, childrenOf, connections, used, out);
|
|
@@ -32501,8 +32728,8 @@ function collectRecursive(templateNodes, contextNode, childrenOf, connections, u
|
|
|
32501
32728
|
function resolveRecursiveItemRoleContent(arranger, node, childrenOf, connections) {
|
|
32502
32729
|
const out = [];
|
|
32503
32730
|
const used = /* @__PURE__ */ new Set();
|
|
32504
|
-
for (const
|
|
32505
|
-
visitOne(
|
|
32731
|
+
for (const child13 of arranger.children ?? []) {
|
|
32732
|
+
visitOne(child13, node, childrenOf, connections, used, out);
|
|
32506
32733
|
}
|
|
32507
32734
|
return out;
|
|
32508
32735
|
}
|
|
@@ -32521,7 +32748,7 @@ function expandRecursiveItemRoles(arranger, arrangerRole, original, node, childr
|
|
|
32521
32748
|
function resolveItemTextRoles(arranger) {
|
|
32522
32749
|
const flatChildren = arranger.children ?? [];
|
|
32523
32750
|
const contributingWrappers = flatChildren.filter(
|
|
32524
|
-
(
|
|
32751
|
+
(child13) => !isTextRole(child13) && unwrapTextRoles(child13).length > 0
|
|
32525
32752
|
);
|
|
32526
32753
|
if (contributingWrappers.length >= 2 && contributingWrappers.some(isPartialForEachOrigin)) {
|
|
32527
32754
|
return resolvePartialForEachRoles(contributingWrappers);
|
|
@@ -32529,7 +32756,7 @@ function resolveItemTextRoles(arranger) {
|
|
|
32529
32756
|
if (hasAmbiguousTopLevelRoles(flatChildren)) {
|
|
32530
32757
|
return void 0;
|
|
32531
32758
|
}
|
|
32532
|
-
const unwrapped = flatChildren.flatMap((
|
|
32759
|
+
const unwrapped = flatChildren.flatMap((child13) => unwrapTextRoles(child13));
|
|
32533
32760
|
const roles = [...flatChildren, ...unwrapped].filter(isTextRole);
|
|
32534
32761
|
return roles.length > 1 ? roles : void 0;
|
|
32535
32762
|
}
|
|
@@ -32614,8 +32841,8 @@ function collectNamedRules(definition) {
|
|
|
32614
32841
|
if (node.rules) {
|
|
32615
32842
|
out.push(...node.rules);
|
|
32616
32843
|
}
|
|
32617
|
-
for (const
|
|
32618
|
-
walk3(
|
|
32844
|
+
for (const child13 of node.children ?? []) {
|
|
32845
|
+
walk3(child13);
|
|
32619
32846
|
}
|
|
32620
32847
|
};
|
|
32621
32848
|
walk3(definition.rootNode);
|
|
@@ -32901,9 +33128,9 @@ function convert(value, name) {
|
|
|
32901
33128
|
continue;
|
|
32902
33129
|
}
|
|
32903
33130
|
const childName = localName6(key);
|
|
32904
|
-
for (const
|
|
33131
|
+
for (const child13 of Array.isArray(entry) ? entry : [entry]) {
|
|
32905
33132
|
element.children.push(
|
|
32906
|
-
|
|
33133
|
+
child13 && typeof child13 === "object" ? convert(child13, childName) : { name: childName, attrs: {}, children: [] }
|
|
32907
33134
|
);
|
|
32908
33135
|
}
|
|
32909
33136
|
}
|
|
@@ -33280,9 +33507,9 @@ function isColumn(row) {
|
|
|
33280
33507
|
|
|
33281
33508
|
// diagram/engine/axis.ts
|
|
33282
33509
|
function descendants(point2, out) {
|
|
33283
|
-
for (const
|
|
33284
|
-
out.push(
|
|
33285
|
-
descendants(
|
|
33510
|
+
for (const child13 of point2.children) {
|
|
33511
|
+
out.push(child13);
|
|
33512
|
+
descendants(child13, out);
|
|
33286
33513
|
}
|
|
33287
33514
|
}
|
|
33288
33515
|
function rootOf(point2) {
|
|
@@ -33611,11 +33838,11 @@ function relatedNodes(node, relation2, name, ptType) {
|
|
|
33611
33838
|
}
|
|
33612
33839
|
const out = [];
|
|
33613
33840
|
const visit = (current) => {
|
|
33614
|
-
for (const
|
|
33615
|
-
if (matches(
|
|
33616
|
-
out.push(
|
|
33841
|
+
for (const child13 of current.children) {
|
|
33842
|
+
if (matches(child13)) {
|
|
33843
|
+
out.push(child13);
|
|
33617
33844
|
}
|
|
33618
|
-
visit(
|
|
33845
|
+
visit(child13);
|
|
33619
33846
|
}
|
|
33620
33847
|
};
|
|
33621
33848
|
visit(node);
|
|
@@ -33778,8 +34005,8 @@ function toEngineTree(node) {
|
|
|
33778
34005
|
engine.deferred = [];
|
|
33779
34006
|
engine.groups = [];
|
|
33780
34007
|
engine.rotation = 0;
|
|
33781
|
-
for (const
|
|
33782
|
-
toEngineTree(
|
|
34008
|
+
for (const child13 of node.children) {
|
|
34009
|
+
toEngineTree(child13);
|
|
33783
34010
|
}
|
|
33784
34011
|
return engine;
|
|
33785
34012
|
}
|
|
@@ -34196,8 +34423,8 @@ function fillChildren(node) {
|
|
|
34196
34423
|
if (!box) {
|
|
34197
34424
|
return;
|
|
34198
34425
|
}
|
|
34199
|
-
for (const
|
|
34200
|
-
|
|
34426
|
+
for (const child13 of node.children) {
|
|
34427
|
+
child13.box = { ...box };
|
|
34201
34428
|
}
|
|
34202
34429
|
}
|
|
34203
34430
|
function layoutSubtree(node, registry) {
|
|
@@ -34221,11 +34448,11 @@ function layoutSubtreeOnce(node, registry) {
|
|
|
34221
34448
|
return;
|
|
34222
34449
|
}
|
|
34223
34450
|
registry.resolve(node.alg.type)(node);
|
|
34224
|
-
for (const
|
|
34225
|
-
if (!
|
|
34226
|
-
|
|
34451
|
+
for (const child13 of node.children) {
|
|
34452
|
+
if (!child13.box) {
|
|
34453
|
+
child13.box = { x: box.x, y: box.y, w: 0, h: 0 };
|
|
34227
34454
|
}
|
|
34228
|
-
layoutSubtree(
|
|
34455
|
+
layoutSubtree(child13, registry);
|
|
34229
34456
|
}
|
|
34230
34457
|
const post = registry.resolvePost?.(node.alg.type);
|
|
34231
34458
|
if (post) {
|
|
@@ -34236,8 +34463,8 @@ function connectors(node, out) {
|
|
|
34236
34463
|
if (node.alg.type === "conn") {
|
|
34237
34464
|
out.push(node);
|
|
34238
34465
|
}
|
|
34239
|
-
for (const
|
|
34240
|
-
connectors(
|
|
34466
|
+
for (const child13 of node.children) {
|
|
34467
|
+
connectors(child13, out);
|
|
34241
34468
|
}
|
|
34242
34469
|
return out;
|
|
34243
34470
|
}
|
|
@@ -34246,8 +34473,8 @@ function layoutTree(root, frame2, registry) {
|
|
|
34246
34473
|
layoutSubtree(root, registry);
|
|
34247
34474
|
for (const connector of connectors(root, [])) {
|
|
34248
34475
|
registry.resolve("conn")(connector);
|
|
34249
|
-
for (const
|
|
34250
|
-
layoutSubtree(
|
|
34476
|
+
for (const child13 of connector.children) {
|
|
34477
|
+
layoutSubtree(child13, registry);
|
|
34251
34478
|
}
|
|
34252
34479
|
}
|
|
34253
34480
|
}
|
|
@@ -34258,15 +34485,15 @@ function isSelfSizeConstraint(node, index) {
|
|
|
34258
34485
|
const constraint = node.constraints[index];
|
|
34259
34486
|
return constraint.for === "self" && SIZE_TYPES.has(constraint.type);
|
|
34260
34487
|
}
|
|
34261
|
-
function preferredSize(
|
|
34262
|
-
applySelfSizeConstraints(
|
|
34263
|
-
const w =
|
|
34264
|
-
const h2 =
|
|
34265
|
-
const grown = grownSize(
|
|
34266
|
-
w: clamp2(
|
|
34267
|
-
h: clamp2(
|
|
34488
|
+
function preferredSize(child13, fallback) {
|
|
34489
|
+
applySelfSizeConstraints(child13);
|
|
34490
|
+
const w = child13.values.get("w");
|
|
34491
|
+
const h2 = child13.values.get("h");
|
|
34492
|
+
const grown = grownSize(child13, {
|
|
34493
|
+
w: clamp2(child13, "w", w ?? fallback.w),
|
|
34494
|
+
h: clamp2(child13, "h", h2 ?? fallback.h)
|
|
34268
34495
|
});
|
|
34269
|
-
return { w: clamp2(
|
|
34496
|
+
return { w: clamp2(child13, "w", grown.w), h: clamp2(child13, "h", grown.h) };
|
|
34270
34497
|
}
|
|
34271
34498
|
function applySelfSizeConstraints(node) {
|
|
34272
34499
|
for (let i2 = 0; i2 < node.constraints.length; i2++) {
|
|
@@ -34329,16 +34556,16 @@ function resolveSize(values, preferred, hasOwn, near, far, center) {
|
|
|
34329
34556
|
return preferred;
|
|
34330
34557
|
}
|
|
34331
34558
|
function compositeChildBoxes(node, box) {
|
|
34332
|
-
for (const
|
|
34333
|
-
const hasW =
|
|
34334
|
-
const hasH =
|
|
34335
|
-
const preferred = preferredSize(
|
|
34336
|
-
const values =
|
|
34559
|
+
for (const child13 of node.children) {
|
|
34560
|
+
const hasW = child13.values.has("w");
|
|
34561
|
+
const hasH = child13.values.has("h");
|
|
34562
|
+
const preferred = preferredSize(child13, { w: box.w, h: box.h });
|
|
34563
|
+
const values = child13.values;
|
|
34337
34564
|
const w = resolveSize(values, preferred.w, hasW || values.has("w"), "l", "r", "ctrX") + (values.get("wOff") ?? 0);
|
|
34338
34565
|
const h2 = resolveSize(values, preferred.h, hasH || values.has("h"), "t", "b", "ctrY") + (values.get("hOff") ?? 0);
|
|
34339
34566
|
const l = resolveAxis(values, w, "l", "r", "ctrX") + (values.get("lOff") ?? 0) + (values.get("ctrXOff") ?? 0);
|
|
34340
34567
|
const t = resolveAxis(values, h2, "t", "b", "ctrY") + (values.get("tOff") ?? 0) + (values.get("ctrYOff") ?? 0);
|
|
34341
|
-
|
|
34568
|
+
child13.box = { x: box.x + l, y: box.y + t, w, h: h2 };
|
|
34342
34569
|
}
|
|
34343
34570
|
}
|
|
34344
34571
|
function alignStart(free, align, start, end) {
|
|
@@ -34377,7 +34604,7 @@ function arrangeComposite2(node) {
|
|
|
34377
34604
|
alignChildren(node, frame2);
|
|
34378
34605
|
}
|
|
34379
34606
|
function alignChildren(node, frame2) {
|
|
34380
|
-
const boxes = node.children.map((
|
|
34607
|
+
const boxes = node.children.map((child13) => child13.box).filter((b) => Boolean(b));
|
|
34381
34608
|
if (boxes.length === 0) {
|
|
34382
34609
|
return;
|
|
34383
34610
|
}
|
|
@@ -34417,8 +34644,8 @@ function nodeSize(parts) {
|
|
|
34417
34644
|
part.box = { x: 0, y: 0, w: partW, h: partH };
|
|
34418
34645
|
evaluateWithReference(part, partW, partH);
|
|
34419
34646
|
arrangeComposite2(part);
|
|
34420
|
-
for (const
|
|
34421
|
-
const b =
|
|
34647
|
+
for (const child13 of part.children) {
|
|
34648
|
+
const b = child13.box;
|
|
34422
34649
|
if (!b || !(b.w > 0) || !(b.h > 0)) {
|
|
34423
34650
|
continue;
|
|
34424
34651
|
}
|
|
@@ -34433,16 +34660,16 @@ function nodeSize(parts) {
|
|
|
34433
34660
|
|
|
34434
34661
|
// diagram/engine/hier-measure.ts
|
|
34435
34662
|
function itemsOf(node) {
|
|
34436
|
-
return node.children.filter((
|
|
34663
|
+
return node.children.filter((child13) => child13.alg.type === "hierRoot");
|
|
34437
34664
|
}
|
|
34438
34665
|
function rowsOf(root) {
|
|
34439
34666
|
return root.children.filter(
|
|
34440
|
-
(
|
|
34667
|
+
(child13) => child13.alg.type === "hierChild" && itemsOf(child13).length > 0
|
|
34441
34668
|
);
|
|
34442
34669
|
}
|
|
34443
34670
|
function partsOf(root) {
|
|
34444
34671
|
return root.children.filter(
|
|
34445
|
-
(
|
|
34672
|
+
(child13) => child13.alg.type !== "hierChild" && child13.alg.type !== "conn"
|
|
34446
34673
|
);
|
|
34447
34674
|
}
|
|
34448
34675
|
function pack(shapes, vertical, gap, end) {
|
|
@@ -34581,8 +34808,8 @@ function hasHierAncestor(node) {
|
|
|
34581
34808
|
}
|
|
34582
34809
|
function fitContainers(node) {
|
|
34583
34810
|
const boxes = [];
|
|
34584
|
-
for (const
|
|
34585
|
-
const inner = HIER_ALGS.has(
|
|
34811
|
+
for (const child13 of node.children) {
|
|
34812
|
+
const inner = HIER_ALGS.has(child13.alg.type) ? fitContainers(child13) : child13.box;
|
|
34586
34813
|
if (inner && inner.w > 0 && inner.h > 0) {
|
|
34587
34814
|
boxes.push(inner);
|
|
34588
34815
|
}
|
|
@@ -34967,11 +35194,11 @@ function findOrderedDescendant(element, name) {
|
|
|
34967
35194
|
if (!element) {
|
|
34968
35195
|
return void 0;
|
|
34969
35196
|
}
|
|
34970
|
-
for (const
|
|
34971
|
-
if (
|
|
34972
|
-
return
|
|
35197
|
+
for (const child13 of element.children) {
|
|
35198
|
+
if (child13.name === name) {
|
|
35199
|
+
return child13;
|
|
34973
35200
|
}
|
|
34974
|
-
const nested = findOrderedDescendant(
|
|
35201
|
+
const nested = findOrderedDescendant(child13, name);
|
|
34975
35202
|
if (nested) {
|
|
34976
35203
|
return nested;
|
|
34977
35204
|
}
|
|
@@ -35026,16 +35253,16 @@ function parseIterator(attrs2) {
|
|
|
35026
35253
|
}
|
|
35027
35254
|
function parseAlgorithm(element) {
|
|
35028
35255
|
const params = {};
|
|
35029
|
-
for (const
|
|
35030
|
-
if (
|
|
35031
|
-
params[
|
|
35256
|
+
for (const child13 of element.children) {
|
|
35257
|
+
if (child13.name === "param" && child13.attrs.type) {
|
|
35258
|
+
params[child13.attrs.type] = child13.attrs.val ?? "";
|
|
35032
35259
|
}
|
|
35033
35260
|
}
|
|
35034
35261
|
return { type: element.attrs.type ?? "sp", params };
|
|
35035
35262
|
}
|
|
35036
35263
|
function parseShape(element) {
|
|
35037
35264
|
const adj = {};
|
|
35038
|
-
const adjList = element.children.find((
|
|
35265
|
+
const adjList = element.children.find((child13) => child13.name === "adjLst");
|
|
35039
35266
|
for (const entry of adjList?.children ?? []) {
|
|
35040
35267
|
if (entry.name === "adj") {
|
|
35041
35268
|
adj[Number(entry.attrs.idx)] = Number(entry.attrs.val);
|
|
@@ -35091,8 +35318,8 @@ function parseCondition(attrs2) {
|
|
|
35091
35318
|
}
|
|
35092
35319
|
function parseBody(element, state) {
|
|
35093
35320
|
const body = [];
|
|
35094
|
-
for (const
|
|
35095
|
-
const statement = parseStatement(
|
|
35321
|
+
for (const child13 of element.children) {
|
|
35322
|
+
const statement = parseStatement(child13, state);
|
|
35096
35323
|
if (statement) {
|
|
35097
35324
|
body.push(statement);
|
|
35098
35325
|
}
|
|
@@ -35110,9 +35337,9 @@ function parseLayoutNode(element, state) {
|
|
|
35110
35337
|
};
|
|
35111
35338
|
}
|
|
35112
35339
|
function parseChoose(element, state) {
|
|
35113
|
-
const branches = element.children.filter((
|
|
35114
|
-
condition:
|
|
35115
|
-
body: parseBody(
|
|
35340
|
+
const branches = element.children.filter((child13) => child13.name === "if" || child13.name === "else").map((child13) => ({
|
|
35341
|
+
condition: child13.name === "if" ? parseCondition(child13.attrs) : void 0,
|
|
35342
|
+
body: parseBody(child13, state)
|
|
35116
35343
|
}));
|
|
35117
35344
|
return { kind: "choose", branches };
|
|
35118
35345
|
}
|
|
@@ -35165,7 +35392,7 @@ function parseStatement(element, state) {
|
|
|
35165
35392
|
function parseLayoutDefinitionXml(xml) {
|
|
35166
35393
|
const document = parseOrderedXml(xml);
|
|
35167
35394
|
const layoutDef = document?.name === "layoutDef" ? document : findOrderedDescendant(document, "layoutDef");
|
|
35168
|
-
const rootElement = layoutDef?.children.find((
|
|
35395
|
+
const rootElement = layoutDef?.children.find((child13) => child13.name === "layoutNode");
|
|
35169
35396
|
if (!layoutDef || !rootElement) {
|
|
35170
35397
|
return void 0;
|
|
35171
35398
|
}
|
|
@@ -35339,9 +35566,9 @@ function walk2(statements, point2, node, state) {
|
|
|
35339
35566
|
for (const statement of statements) {
|
|
35340
35567
|
switch (statement.kind) {
|
|
35341
35568
|
case "layoutNode": {
|
|
35342
|
-
const
|
|
35343
|
-
if (
|
|
35344
|
-
node.children.push(
|
|
35569
|
+
const child13 = buildNode(statement, point2, node, state);
|
|
35570
|
+
if (child13) {
|
|
35571
|
+
node.children.push(child13);
|
|
35345
35572
|
}
|
|
35346
35573
|
break;
|
|
35347
35574
|
}
|
|
@@ -35565,9 +35792,9 @@ function arrangeConnector(node) {
|
|
|
35565
35792
|
node.rotation = normaliseAngle2(Math.atan2(dy, dx) * 180 / Math.PI);
|
|
35566
35793
|
}
|
|
35567
35794
|
}
|
|
35568
|
-
for (const
|
|
35569
|
-
|
|
35570
|
-
|
|
35795
|
+
for (const child13 of node.children) {
|
|
35796
|
+
child13.box = { ...node.box ?? box };
|
|
35797
|
+
child13.rotation = node.rotation;
|
|
35571
35798
|
}
|
|
35572
35799
|
}
|
|
35573
35800
|
function normaliseAngle2(degrees) {
|
|
@@ -35581,17 +35808,17 @@ var DEFAULT_GAP_RATIO3 = 0.5;
|
|
|
35581
35808
|
function groupContentChildren(node) {
|
|
35582
35809
|
const groups = [];
|
|
35583
35810
|
const byPoint = /* @__PURE__ */ new Map();
|
|
35584
|
-
for (const
|
|
35585
|
-
if (
|
|
35811
|
+
for (const child13 of node.children) {
|
|
35812
|
+
if (child13.point.type !== "node" && child13.point.type !== "asst") {
|
|
35586
35813
|
continue;
|
|
35587
35814
|
}
|
|
35588
|
-
let group = byPoint.get(
|
|
35815
|
+
let group = byPoint.get(child13.point);
|
|
35589
35816
|
if (!group) {
|
|
35590
35817
|
group = [];
|
|
35591
|
-
byPoint.set(
|
|
35818
|
+
byPoint.set(child13.point, group);
|
|
35592
35819
|
groups.push(group);
|
|
35593
35820
|
}
|
|
35594
|
-
group.push(
|
|
35821
|
+
group.push(child13);
|
|
35595
35822
|
}
|
|
35596
35823
|
return groups;
|
|
35597
35824
|
}
|
|
@@ -35643,14 +35870,14 @@ function setRotation(group, degrees) {
|
|
|
35643
35870
|
}
|
|
35644
35871
|
}
|
|
35645
35872
|
function placeTransitionChildren(node, centre, fallback) {
|
|
35646
|
-
for (const
|
|
35647
|
-
if (
|
|
35873
|
+
for (const child13 of node.children) {
|
|
35874
|
+
if (child13.point.type === "node" || child13.point.type === "asst") {
|
|
35648
35875
|
continue;
|
|
35649
35876
|
}
|
|
35650
|
-
const size = preferredSize(
|
|
35877
|
+
const size = preferredSize(child13, fallback);
|
|
35651
35878
|
const w = Math.max(1, size.w);
|
|
35652
35879
|
const h2 = Math.max(1, size.h);
|
|
35653
|
-
|
|
35880
|
+
child13.box = { x: centre.x - w / 2, y: centre.y - h2 / 2, w, h: h2 };
|
|
35654
35881
|
}
|
|
35655
35882
|
}
|
|
35656
35883
|
function arrangeCycle2(node) {
|
|
@@ -35742,9 +35969,9 @@ function measure(node, box, horizontal, scale, uniform = false) {
|
|
|
35742
35969
|
const refH = !horizontal || uniform ? box.h * scale : box.h;
|
|
35743
35970
|
evaluateWithReference(node, refW, refH);
|
|
35744
35971
|
const sizes = node.children.map(
|
|
35745
|
-
(
|
|
35746
|
-
|
|
35747
|
-
preferredSize(
|
|
35972
|
+
(child13) => boundedSize(
|
|
35973
|
+
child13,
|
|
35974
|
+
preferredSize(child13, horizontal ? { w: 0, h: refH } : { w: refW, h: 0 }),
|
|
35748
35975
|
horizontal
|
|
35749
35976
|
)
|
|
35750
35977
|
);
|
|
@@ -35757,16 +35984,16 @@ function measure(node, box, horizontal, scale, uniform = false) {
|
|
|
35757
35984
|
}
|
|
35758
35985
|
return { sizes, total, cross, spacing };
|
|
35759
35986
|
}
|
|
35760
|
-
function boundedSize(
|
|
35761
|
-
const nested =
|
|
35762
|
-
const unsizedAlong = nested && !
|
|
35763
|
-
const unsizedAcross = nested &&
|
|
35987
|
+
function boundedSize(child13, size, horizontal) {
|
|
35988
|
+
const nested = child13.children.length > 0 && (child13.alg.type === "lin" || child13.alg.type === "composite");
|
|
35989
|
+
const unsizedAlong = nested && !child13.values.has(horizontal ? "w" : "h");
|
|
35990
|
+
const unsizedAcross = nested && child13.alg.type === "lin" && !isAssigned(child13, horizontal ? "h" : "w");
|
|
35764
35991
|
if (Number.isFinite(size.w) && Number.isFinite(size.h) && !unsizedAlong && !unsizedAcross) {
|
|
35765
35992
|
return size;
|
|
35766
35993
|
}
|
|
35767
35994
|
const unsizedW = horizontal ? unsizedAlong : unsizedAcross;
|
|
35768
35995
|
const unsizedH = horizontal ? unsizedAcross : unsizedAlong;
|
|
35769
|
-
const extent = (alongW) => unsizedAlong || unsizedAcross ? measuredExtent(
|
|
35996
|
+
const extent = (alongW) => unsizedAlong || unsizedAcross ? measuredExtent(child13, size, alongW) : contentExtent(child13, alongW);
|
|
35770
35997
|
return {
|
|
35771
35998
|
w: Number.isFinite(size.w) && !unsizedW ? size.w : extent(true),
|
|
35772
35999
|
h: Number.isFinite(size.h) && !unsizedH ? size.h : extent(false)
|
|
@@ -35786,8 +36013,8 @@ function measuredExtent(node, size, horizontal) {
|
|
|
35786
36013
|
function contentExtent(node, horizontal) {
|
|
35787
36014
|
const dir = node.alg.params.linDir ?? "fromL";
|
|
35788
36015
|
const flowsHorizontally = dir === "fromL" || dir === "fromR";
|
|
35789
|
-
const sizes = node.children.map((
|
|
35790
|
-
const size = preferredSize(
|
|
36016
|
+
const sizes = node.children.map((child13) => {
|
|
36017
|
+
const size = preferredSize(child13, { w: 0, h: 0 });
|
|
35791
36018
|
const value = horizontal ? size.w : size.h;
|
|
35792
36019
|
return Number.isFinite(value) ? value : 0;
|
|
35793
36020
|
});
|
|
@@ -35898,13 +36125,13 @@ function arrangeLinear2(node) {
|
|
|
35898
36125
|
const band = Math.min(across, fitted.cross);
|
|
35899
36126
|
const bandOffset = horizontal ? alignOffset(across - band, params.vertAlign, "t", "b") : alignOffset(across - band, params.horzAlign, "l", "r");
|
|
35900
36127
|
let cursor = groupOffset;
|
|
35901
|
-
node.children.forEach((
|
|
36128
|
+
node.children.forEach((child13, index) => {
|
|
35902
36129
|
const size = fitted.sizes[index];
|
|
35903
36130
|
const length = horizontal ? size.w : size.h;
|
|
35904
36131
|
const thickness = horizontal ? size.h : size.w;
|
|
35905
36132
|
const crossOffset = bandOffset + (horizontal ? alignOffset(band - thickness, params.nodeVertAlign, "t", "b") : alignOffset(band - thickness, params.nodeHorzAlign, "l", "r"));
|
|
35906
36133
|
const start = reverse ? along - cursor - length : cursor;
|
|
35907
|
-
|
|
36134
|
+
child13.box = horizontal ? { x: box.x + start, y: box.y + crossOffset, w: size.w, h: size.h } : { x: box.x + crossOffset, y: box.y + start, w: size.w, h: size.h };
|
|
35908
36135
|
cursor += length + fitted.spacing;
|
|
35909
36136
|
});
|
|
35910
36137
|
}
|
|
@@ -35912,15 +36139,15 @@ function arrangeLinear2(node) {
|
|
|
35912
36139
|
// diagram/engine/alg-pyra.ts
|
|
35913
36140
|
function contentChildren(node) {
|
|
35914
36141
|
return node.children.filter(
|
|
35915
|
-
(
|
|
36142
|
+
(child13) => child13.point.type === "node" || child13.point.type === "asst"
|
|
35916
36143
|
);
|
|
35917
36144
|
}
|
|
35918
36145
|
function findNamedDescendant(node, name) {
|
|
35919
|
-
for (const
|
|
35920
|
-
if (
|
|
35921
|
-
return
|
|
36146
|
+
for (const child13 of node.children) {
|
|
36147
|
+
if (child13.name === name) {
|
|
36148
|
+
return child13;
|
|
35922
36149
|
}
|
|
35923
|
-
const found = findNamedDescendant(
|
|
36150
|
+
const found = findNamedDescendant(child13, name);
|
|
35924
36151
|
if (found) {
|
|
35925
36152
|
return found;
|
|
35926
36153
|
}
|
|
@@ -35950,11 +36177,11 @@ function arrangePyra(node) {
|
|
|
35950
36177
|
const gap = Math.max(0, node.values.get("sibSp") ?? node.values.get("sp") ?? 0);
|
|
35951
36178
|
const bandH = Math.max(0, (box.h - gap * (n - 1)) / n);
|
|
35952
36179
|
const bandCx = box.x + box.w / 2;
|
|
35953
|
-
children5.forEach((
|
|
36180
|
+
children5.forEach((child13, i2) => {
|
|
35954
36181
|
const top = box.y + i2 * (bandH + gap);
|
|
35955
36182
|
const effectiveI = inverted ? n - 1 - i2 : i2;
|
|
35956
36183
|
const halfWide = box.w * (effectiveI + 1) / n / 2;
|
|
35957
|
-
|
|
36184
|
+
child13.box = { x: bandCx - halfWide, y: top, w: halfWide * 2, h: bandH };
|
|
35958
36185
|
});
|
|
35959
36186
|
}
|
|
35960
36187
|
function scaleFromAnchor(x, anchorX, scale) {
|
|
@@ -36047,8 +36274,8 @@ function contentHeight(cell, w, h2) {
|
|
|
36047
36274
|
evaluateWithReference(cell, w, h2);
|
|
36048
36275
|
compositeChildBoxes(cell, frame2);
|
|
36049
36276
|
let bottom = h2;
|
|
36050
|
-
for (const
|
|
36051
|
-
const b =
|
|
36277
|
+
for (const child13 of cell.children) {
|
|
36278
|
+
const b = child13.box;
|
|
36052
36279
|
if (b && b.w > 0 && b.h > 0) {
|
|
36053
36280
|
bottom = Math.max(bottom, b.y + b.h);
|
|
36054
36281
|
}
|
|
@@ -36114,8 +36341,8 @@ function fitSnakeByRule(node, box, cells, spacers, row) {
|
|
|
36114
36341
|
}
|
|
36115
36342
|
|
|
36116
36343
|
// diagram/engine/alg-snake.ts
|
|
36117
|
-
function isSpacer(
|
|
36118
|
-
return
|
|
36344
|
+
function isSpacer(child13) {
|
|
36345
|
+
return child13.point.type === "sibTrans" || child13.point.type === "parTrans";
|
|
36119
36346
|
}
|
|
36120
36347
|
function cellSize(cell, box) {
|
|
36121
36348
|
const assigned = new Set(["w", "h"].filter((type) => cell.values.has(type)));
|
|
@@ -37463,8 +37690,8 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
|
|
|
37463
37690
|
)
|
|
37464
37691
|
);
|
|
37465
37692
|
let childOffset = xOffset;
|
|
37466
|
-
for (const
|
|
37467
|
-
const childW = treeWidth(
|
|
37693
|
+
for (const child13 of t.children) {
|
|
37694
|
+
const childW = treeWidth(child13);
|
|
37468
37695
|
const childCx = bounds.x + padding + (childOffset + childW / 2) * cellW;
|
|
37469
37696
|
const childCy = bounds.y + padding + (level2 + 1) * cellH + cellH / 2;
|
|
37470
37697
|
elements2.push(
|
|
@@ -37477,7 +37704,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
|
|
|
37477
37704
|
lighten(fill, 0.5)
|
|
37478
37705
|
)
|
|
37479
37706
|
);
|
|
37480
|
-
walk3(
|
|
37707
|
+
walk3(child13, childOffset, level2 + 1);
|
|
37481
37708
|
childOffset += childW;
|
|
37482
37709
|
}
|
|
37483
37710
|
return w;
|
|
@@ -38496,7 +38723,7 @@ function parseSmartArtPointCustomLayout(prSet) {
|
|
|
38496
38723
|
}
|
|
38497
38724
|
|
|
38498
38725
|
// pptx/core/utils/smartart-node-style-role.ts
|
|
38499
|
-
function
|
|
38726
|
+
function child5(node, name, localName15) {
|
|
38500
38727
|
if (!node) {
|
|
38501
38728
|
return void 0;
|
|
38502
38729
|
}
|
|
@@ -38505,7 +38732,7 @@ function child4(node, name, localName15) {
|
|
|
38505
38732
|
return Array.isArray(value) ? value[0] : value;
|
|
38506
38733
|
}
|
|
38507
38734
|
function presPointRole(pt, localName15) {
|
|
38508
|
-
const prSet =
|
|
38735
|
+
const prSet = child5(pt, "prSet", localName15);
|
|
38509
38736
|
const styleRole = String(prSet?.["@_presStyleLbl"] ?? "").trim();
|
|
38510
38737
|
if (!styleRole) {
|
|
38511
38738
|
return void 0;
|
|
@@ -38575,7 +38802,7 @@ function resolveSmartArtNodeCoherent3DOff(points, connections, localName15) {
|
|
|
38575
38802
|
if (!presPoint) {
|
|
38576
38803
|
continue;
|
|
38577
38804
|
}
|
|
38578
|
-
const prSet =
|
|
38805
|
+
const prSet = child5(presPoint, "prSet", localName15);
|
|
38579
38806
|
const raw = String(prSet?.["@_coherent3DOff"] ?? "").trim().toLowerCase();
|
|
38580
38807
|
if (raw === "1" || raw === "true") {
|
|
38581
38808
|
nodeIds.add(connection.sourceId);
|
|
@@ -38585,7 +38812,7 @@ function resolveSmartArtNodeCoherent3DOff(points, connections, localName15) {
|
|
|
38585
38812
|
}
|
|
38586
38813
|
|
|
38587
38814
|
// pptx/core/utils/smartart-effect-intensity.ts
|
|
38588
|
-
function
|
|
38815
|
+
function child6(node, name, localName15) {
|
|
38589
38816
|
if (!node) {
|
|
38590
38817
|
return void 0;
|
|
38591
38818
|
}
|
|
@@ -38594,13 +38821,13 @@ function child5(node, name, localName15) {
|
|
|
38594
38821
|
return Array.isArray(value) ? value[0] : value;
|
|
38595
38822
|
}
|
|
38596
38823
|
function refIndex(styleLbl, refName, localName15) {
|
|
38597
|
-
const style =
|
|
38598
|
-
const ref =
|
|
38824
|
+
const style = child6(styleLbl, "style", localName15);
|
|
38825
|
+
const ref = child6(style, refName, localName15);
|
|
38599
38826
|
const parsed = Number.parseInt(String(ref?.["@_idx"] ?? ""), 10);
|
|
38600
38827
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
38601
38828
|
}
|
|
38602
38829
|
function hasBevelGeometry(styleLbl, localName15) {
|
|
38603
|
-
const sp3d =
|
|
38830
|
+
const sp3d = child6(styleLbl, "sp3d", localName15);
|
|
38604
38831
|
if (!sp3d) {
|
|
38605
38832
|
return false;
|
|
38606
38833
|
}
|
|
@@ -39724,9 +39951,9 @@ function reflowHierarchy(nodes, bounds) {
|
|
|
39724
39951
|
fontSize: Math.max(7, Math.min(10, boxW / 14))
|
|
39725
39952
|
});
|
|
39726
39953
|
let childOffset = xOffset;
|
|
39727
|
-
for (const
|
|
39728
|
-
walkTree(
|
|
39729
|
-
childOffset += treeWidth(
|
|
39954
|
+
for (const child13 of t.children) {
|
|
39955
|
+
walkTree(child13, childOffset, level2 + 1);
|
|
39956
|
+
childOffset += treeWidth(child13);
|
|
39730
39957
|
}
|
|
39731
39958
|
return w;
|
|
39732
39959
|
}
|
|
@@ -39961,7 +40188,7 @@ function createOfficeGuid() {
|
|
|
39961
40188
|
return `{${uuid.toUpperCase()}}`;
|
|
39962
40189
|
}
|
|
39963
40190
|
|
|
39964
|
-
// ../../node_modules/.bun/@christophervr+ole2@0.
|
|
40191
|
+
// ../../node_modules/.bun/@christophervr+ole2@0.13.0/node_modules/@christophervr/ole2/dist/utils/ooxml-crypto-primitives.js
|
|
39965
40192
|
function getSubtle() {
|
|
39966
40193
|
if (typeof globalThis.crypto !== "undefined" && globalThis.crypto.subtle) {
|
|
39967
40194
|
return globalThis.crypto.subtle;
|
|
@@ -42560,7 +42787,7 @@ function readChartManualLayoutValues(value) {
|
|
|
42560
42787
|
}
|
|
42561
42788
|
|
|
42562
42789
|
// pptx/core/utils/chart-layout.ts
|
|
42563
|
-
var
|
|
42790
|
+
var child7 = (node, name, localName15) => {
|
|
42564
42791
|
if (!node) {
|
|
42565
42792
|
return void 0;
|
|
42566
42793
|
}
|
|
@@ -42568,12 +42795,12 @@ var child6 = (node, name, localName15) => {
|
|
|
42568
42795
|
return key ? node[key] : void 0;
|
|
42569
42796
|
};
|
|
42570
42797
|
function parseChartManualLayout(parent, localName15) {
|
|
42571
|
-
const manual =
|
|
42798
|
+
const manual = child7(child7(parent, "layout", localName15), "manualLayout", localName15);
|
|
42572
42799
|
if (!manual) {
|
|
42573
42800
|
return void 0;
|
|
42574
42801
|
}
|
|
42575
|
-
const result = readChartManualLayoutValues((name) =>
|
|
42576
|
-
const ext =
|
|
42802
|
+
const result = readChartManualLayoutValues((name) => child7(manual, name, localName15)?.["@_val"]) ?? {};
|
|
42803
|
+
const ext = child7(manual, "extLst", localName15);
|
|
42577
42804
|
if (ext !== void 0) {
|
|
42578
42805
|
result.ext = ext;
|
|
42579
42806
|
}
|
|
@@ -42589,9 +42816,9 @@ function parseChartLayouts(chartRoot, localName15) {
|
|
|
42589
42816
|
return void 0;
|
|
42590
42817
|
}
|
|
42591
42818
|
const layouts = {
|
|
42592
|
-
title: parseChartManualLayout(
|
|
42593
|
-
plotArea: parseChartManualLayout(
|
|
42594
|
-
legend: parseChartManualLayout(
|
|
42819
|
+
title: parseChartManualLayout(child7(chartRoot, "title", localName15), localName15),
|
|
42820
|
+
plotArea: parseChartManualLayout(child7(chartRoot, "plotArea", localName15), localName15),
|
|
42821
|
+
legend: parseChartManualLayout(child7(chartRoot, "legend", localName15), localName15)
|
|
42595
42822
|
};
|
|
42596
42823
|
for (const key of Object.keys(layouts)) {
|
|
42597
42824
|
if (layouts[key] === void 0) {
|
|
@@ -42669,16 +42896,16 @@ function applyChartManualLayout(parent, layout, localName15) {
|
|
|
42669
42896
|
replaceKeyAt(parent, "c:layout", { "c:manualLayout": manual }, layoutIndex(parent, localName15));
|
|
42670
42897
|
}
|
|
42671
42898
|
function applyChartLayouts(chartRoot, layouts, localName15) {
|
|
42672
|
-
applyChartManualLayout(
|
|
42673
|
-
applyChartManualLayout(
|
|
42674
|
-
applyChartManualLayout(
|
|
42899
|
+
applyChartManualLayout(child7(chartRoot, "title", localName15), layouts.title, localName15);
|
|
42900
|
+
applyChartManualLayout(child7(chartRoot, "plotArea", localName15), layouts.plotArea, localName15);
|
|
42901
|
+
applyChartManualLayout(child7(chartRoot, "legend", localName15), layouts.legend, localName15);
|
|
42675
42902
|
}
|
|
42676
42903
|
|
|
42677
42904
|
// pptx/core/utils/chart-trendline-label.ts
|
|
42678
42905
|
function keyOf(node, name, localName15) {
|
|
42679
42906
|
return node ? Object.keys(node).find((key) => localName15(key) === name) : void 0;
|
|
42680
42907
|
}
|
|
42681
|
-
function
|
|
42908
|
+
function child8(node, name, localName15) {
|
|
42682
42909
|
const key = keyOf(node, name, localName15);
|
|
42683
42910
|
return key ? node?.[key] : void 0;
|
|
42684
42911
|
}
|
|
@@ -42698,7 +42925,7 @@ function parseTrendlineLabel(node, localName15) {
|
|
|
42698
42925
|
if (layout) {
|
|
42699
42926
|
result.layout = layout;
|
|
42700
42927
|
}
|
|
42701
|
-
const numFmt =
|
|
42928
|
+
const numFmt = child8(node, "numFmt", localName15);
|
|
42702
42929
|
if (typeof numFmt?.["@_formatCode"] === "string") {
|
|
42703
42930
|
result.numberFormatCode = numFmt["@_formatCode"];
|
|
42704
42931
|
}
|
|
@@ -43297,8 +43524,8 @@ function setDrawingChild(node, name, value, order, localName15) {
|
|
|
43297
43524
|
for (const candidate of Object.keys(node)) {
|
|
43298
43525
|
delete node[candidate];
|
|
43299
43526
|
}
|
|
43300
|
-
for (const [candidate,
|
|
43301
|
-
node[candidate] =
|
|
43527
|
+
for (const [candidate, child13] of entries) {
|
|
43528
|
+
node[candidate] = child13;
|
|
43302
43529
|
}
|
|
43303
43530
|
}
|
|
43304
43531
|
function writeChartShapeProps(existing, style, localName15, resolveColor) {
|
|
@@ -43984,11 +44211,11 @@ function findChart15Ext(group, xmlLookup) {
|
|
|
43984
44211
|
return xmlLookup.getChildrenArrayByLocalName(extLst, "ext").find((ext) => ext["@_uri"] === CHART15_EXT_URI);
|
|
43985
44212
|
}
|
|
43986
44213
|
function collectByLocalName2(node, target, out) {
|
|
43987
|
-
for (const [key,
|
|
44214
|
+
for (const [key, child13] of Object.entries(node)) {
|
|
43988
44215
|
if (key.startsWith("@_") || key === "#text") {
|
|
43989
44216
|
continue;
|
|
43990
44217
|
}
|
|
43991
|
-
const items = Array.isArray(
|
|
44218
|
+
const items = Array.isArray(child13) ? child13 : [child13];
|
|
43992
44219
|
for (const item of items) {
|
|
43993
44220
|
if (item && typeof item === "object") {
|
|
43994
44221
|
if (localNameOf7(key) === target) {
|
|
@@ -44260,19 +44487,19 @@ function collectAllText(node, getLocalName, out) {
|
|
|
44260
44487
|
const value = node[key];
|
|
44261
44488
|
const children5 = Array.isArray(value) ? value : [value];
|
|
44262
44489
|
if (getLocalName(key) === "t") {
|
|
44263
|
-
for (const
|
|
44264
|
-
if (
|
|
44490
|
+
for (const child13 of children5) {
|
|
44491
|
+
if (child13 === void 0 || child13 === null) {
|
|
44265
44492
|
continue;
|
|
44266
44493
|
}
|
|
44267
44494
|
out.push(
|
|
44268
|
-
typeof
|
|
44495
|
+
typeof child13 === "object" ? String(child13["#text"] ?? "") : String(child13)
|
|
44269
44496
|
);
|
|
44270
44497
|
}
|
|
44271
44498
|
continue;
|
|
44272
44499
|
}
|
|
44273
|
-
for (const
|
|
44274
|
-
if (
|
|
44275
|
-
collectAllText(
|
|
44500
|
+
for (const child13 of children5) {
|
|
44501
|
+
if (child13 && typeof child13 === "object") {
|
|
44502
|
+
collectAllText(child13, getLocalName, out);
|
|
44276
44503
|
}
|
|
44277
44504
|
}
|
|
44278
44505
|
}
|
|
@@ -44289,8 +44516,8 @@ function replaceFirstText(node, text, getLocalName) {
|
|
|
44289
44516
|
}
|
|
44290
44517
|
const value = node[key];
|
|
44291
44518
|
const children5 = Array.isArray(value) ? value : [value];
|
|
44292
|
-
for (const
|
|
44293
|
-
if (
|
|
44519
|
+
for (const child13 of children5) {
|
|
44520
|
+
if (child13 && typeof child13 === "object" && replaceFirstText(child13, text, getLocalName)) {
|
|
44294
44521
|
return true;
|
|
44295
44522
|
}
|
|
44296
44523
|
}
|
|
@@ -44532,8 +44759,8 @@ function setOrdered(node, name, value, order, localName15) {
|
|
|
44532
44759
|
for (const key of Object.keys(node)) {
|
|
44533
44760
|
delete node[key];
|
|
44534
44761
|
}
|
|
44535
|
-
for (const [key,
|
|
44536
|
-
node[key] =
|
|
44762
|
+
for (const [key, child13] of entries) {
|
|
44763
|
+
node[key] = child13;
|
|
44537
44764
|
}
|
|
44538
44765
|
}
|
|
44539
44766
|
function collectText(node, result) {
|
|
@@ -44541,9 +44768,9 @@ function collectText(node, result) {
|
|
|
44541
44768
|
if (key.replace(/^.*:/u, "") === "t") {
|
|
44542
44769
|
result.push(String(value));
|
|
44543
44770
|
} else if (Array.isArray(value)) {
|
|
44544
|
-
for (const
|
|
44545
|
-
if (
|
|
44546
|
-
collectText(
|
|
44771
|
+
for (const child13 of value) {
|
|
44772
|
+
if (child13 && typeof child13 === "object") {
|
|
44773
|
+
collectText(child13, result);
|
|
44547
44774
|
}
|
|
44548
44775
|
}
|
|
44549
44776
|
} else if (value && typeof value === "object") {
|
|
@@ -44754,7 +44981,7 @@ var LABEL_OFFSET_RANGE = { name: "labelOffset", min: 0, max: 1e3 };
|
|
|
44754
44981
|
function findKey8(node, name, localName15) {
|
|
44755
44982
|
return Object.keys(node).find((key) => localName15(key) === name);
|
|
44756
44983
|
}
|
|
44757
|
-
function
|
|
44984
|
+
function child9(node, name, localName15) {
|
|
44758
44985
|
const key = findKey8(node, name, localName15);
|
|
44759
44986
|
const value = key ? node[key] : void 0;
|
|
44760
44987
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -44782,32 +45009,32 @@ function parseChartAxisLabelFormatting(node, axisType, localName15) {
|
|
|
44782
45009
|
["majorTickMark", "majorTickMark"],
|
|
44783
45010
|
["minorTickMark", "minorTickMark"]
|
|
44784
45011
|
]) {
|
|
44785
|
-
const value = String(
|
|
45012
|
+
const value = String(child9(node, name, localName15)?.["@_val"] ?? "");
|
|
44786
45013
|
if (TICK_MARKS.has(value)) {
|
|
44787
45014
|
result[property] = value;
|
|
44788
45015
|
}
|
|
44789
45016
|
}
|
|
44790
|
-
const tickLabelPosition = String(
|
|
45017
|
+
const tickLabelPosition = String(child9(node, "tickLblPos", localName15)?.["@_val"] ?? "");
|
|
44791
45018
|
if (TICK_LABEL_POSITIONS.has(tickLabelPosition)) {
|
|
44792
45019
|
result.tickLblPos = tickLabelPosition;
|
|
44793
45020
|
}
|
|
44794
|
-
const crosses = String(
|
|
45021
|
+
const crosses = String(child9(node, "crosses", localName15)?.["@_val"] ?? "");
|
|
44795
45022
|
if (CROSSING_MODES.has(crosses)) {
|
|
44796
45023
|
result.crosses = crosses;
|
|
44797
45024
|
}
|
|
44798
|
-
const crossesAt = Number.parseFloat(String(
|
|
45025
|
+
const crossesAt = Number.parseFloat(String(child9(node, "crossesAt", localName15)?.["@_val"] ?? ""));
|
|
44799
45026
|
if (Number.isFinite(crossesAt)) {
|
|
44800
45027
|
result.crossesAt = crossesAt;
|
|
44801
45028
|
}
|
|
44802
45029
|
if (axisType === "valAx") {
|
|
44803
|
-
const crossBetween = String(
|
|
45030
|
+
const crossBetween = String(child9(node, "crossBetween", localName15)?.["@_val"] ?? "");
|
|
44804
45031
|
if (CROSS_BETWEEN_MODES.has(crossBetween)) {
|
|
44805
45032
|
result.crossBetween = crossBetween;
|
|
44806
45033
|
}
|
|
44807
45034
|
}
|
|
44808
45035
|
if (axisType === "catAx" || axisType === "dateAx") {
|
|
44809
|
-
result.auto = parseBoolean(
|
|
44810
|
-
const rawOffset =
|
|
45036
|
+
result.auto = parseBoolean(child9(node, "auto", localName15));
|
|
45037
|
+
const rawOffset = child9(node, "lblOffset", localName15)?.["@_val"];
|
|
44811
45038
|
if (rawOffset !== void 0) {
|
|
44812
45039
|
const offset = Number.parseFloat(String(rawOffset).replace(/%$/u, ""));
|
|
44813
45040
|
if (Number.isFinite(offset) && offset >= 0 && offset <= 1e3) {
|
|
@@ -44816,15 +45043,15 @@ function parseChartAxisLabelFormatting(node, axisType, localName15) {
|
|
|
44816
45043
|
}
|
|
44817
45044
|
}
|
|
44818
45045
|
if (axisType === "catAx" || axisType === "serAx") {
|
|
44819
|
-
result.tickLabelSkip = parsePositiveInteger(
|
|
44820
|
-
result.tickMarkSkip = parsePositiveInteger(
|
|
45046
|
+
result.tickLabelSkip = parsePositiveInteger(child9(node, "tickLblSkip", localName15));
|
|
45047
|
+
result.tickMarkSkip = parsePositiveInteger(child9(node, "tickMarkSkip", localName15));
|
|
44821
45048
|
}
|
|
44822
45049
|
if (axisType === "catAx") {
|
|
44823
|
-
const alignment = String(
|
|
45050
|
+
const alignment = String(child9(node, "lblAlgn", localName15)?.["@_val"] ?? "");
|
|
44824
45051
|
if (LABEL_ALIGNMENTS.has(alignment)) {
|
|
44825
45052
|
result.labelAlignment = alignment;
|
|
44826
45053
|
}
|
|
44827
|
-
result.noMultiLevelLabels = parseBoolean(
|
|
45054
|
+
result.noMultiLevelLabels = parseBoolean(child9(node, "noMultiLvlLbl", localName15));
|
|
44828
45055
|
}
|
|
44829
45056
|
return Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0));
|
|
44830
45057
|
}
|
|
@@ -45068,8 +45295,8 @@ function upsertOrdered2(axisNode, name, value, localName15) {
|
|
|
45068
45295
|
for (const key of Object.keys(axisNode)) {
|
|
45069
45296
|
delete axisNode[key];
|
|
45070
45297
|
}
|
|
45071
|
-
for (const [key,
|
|
45072
|
-
axisNode[key] =
|
|
45298
|
+
for (const [key, child13] of entries) {
|
|
45299
|
+
axisNode[key] = child13;
|
|
45073
45300
|
}
|
|
45074
45301
|
}
|
|
45075
45302
|
function applyChartDateAxisUnits(axisNode, axis, localName15) {
|
|
@@ -46148,8 +46375,8 @@ function buildNestedGroupChild(group, xml, colors) {
|
|
|
46148
46375
|
function parseGroupChildren(group, xml, colors) {
|
|
46149
46376
|
const children5 = [];
|
|
46150
46377
|
for (const kind of DIRECT_KINDS) {
|
|
46151
|
-
for (const
|
|
46152
|
-
children5.push(buildGroupChild(
|
|
46378
|
+
for (const child13 of xml.getChildrenArrayByLocalName(group, kind)) {
|
|
46379
|
+
children5.push(buildGroupChild(child13, kind, xml, colors));
|
|
46153
46380
|
}
|
|
46154
46381
|
}
|
|
46155
46382
|
for (const nested of xml.getChildrenArrayByLocalName(group, "grpSp")) {
|
|
@@ -46285,15 +46512,15 @@ function flattenChartUserShapes(shapes, chartBox) {
|
|
|
46285
46512
|
return [];
|
|
46286
46513
|
}
|
|
46287
46514
|
function resolveGroupLeaves(children5, chOff, chExt) {
|
|
46288
|
-
return children5.flatMap((
|
|
46289
|
-
const frac = childFraction(
|
|
46290
|
-
if (
|
|
46291
|
-
const childTransform =
|
|
46292
|
-
if (!childTransform || !
|
|
46515
|
+
return children5.flatMap((child13) => {
|
|
46516
|
+
const frac = childFraction(child13.off, child13.ext, chOff, chExt);
|
|
46517
|
+
if (child13.kind === "grpSp") {
|
|
46518
|
+
const childTransform = child13.transform;
|
|
46519
|
+
if (!childTransform || !child13.children) {
|
|
46293
46520
|
return [];
|
|
46294
46521
|
}
|
|
46295
46522
|
const nested = resolveGroupLeaves(
|
|
46296
|
-
|
|
46523
|
+
child13.children,
|
|
46297
46524
|
childTransform.chOff,
|
|
46298
46525
|
childTransform.chExt
|
|
46299
46526
|
);
|
|
@@ -46326,10 +46553,10 @@ function flattenChartUserShapes(shapes, chartBox) {
|
|
|
46326
46553
|
return [
|
|
46327
46554
|
{
|
|
46328
46555
|
box: frac,
|
|
46329
|
-
rotation: normalizeRotationDeg(
|
|
46330
|
-
flipH: Boolean(
|
|
46331
|
-
flipV: Boolean(
|
|
46332
|
-
child:
|
|
46556
|
+
rotation: normalizeRotationDeg(child13.rotation ?? 0),
|
|
46557
|
+
flipH: Boolean(child13.flipH),
|
|
46558
|
+
flipV: Boolean(child13.flipV),
|
|
46559
|
+
child: child13
|
|
46333
46560
|
}
|
|
46334
46561
|
];
|
|
46335
46562
|
});
|
|
@@ -46367,7 +46594,7 @@ function flattenChartUserShapes(shapes, chartBox) {
|
|
|
46367
46594
|
flipV: entry.flipV !== topFlipV,
|
|
46368
46595
|
child: entry.child
|
|
46369
46596
|
}));
|
|
46370
|
-
return leaves.map(({ box, rotation, flipH, flipV, child:
|
|
46597
|
+
return leaves.map(({ box, rotation, flipH, flipV, child: child13 }) => {
|
|
46371
46598
|
const {
|
|
46372
46599
|
kind,
|
|
46373
46600
|
off: _off,
|
|
@@ -46379,7 +46606,7 @@ function flattenChartUserShapes(shapes, chartBox) {
|
|
|
46379
46606
|
flipH: _childFlipH,
|
|
46380
46607
|
flipV: _childFlipV,
|
|
46381
46608
|
...visuals
|
|
46382
|
-
} =
|
|
46609
|
+
} = child13;
|
|
46383
46610
|
const rotFlip = {
|
|
46384
46611
|
...rotation !== 0 ? { rotation } : {},
|
|
46385
46612
|
...flipH ? { flipH } : {},
|
|
@@ -46517,28 +46744,28 @@ function findByLocalName2(obj, localName15) {
|
|
|
46517
46744
|
return void 0;
|
|
46518
46745
|
}
|
|
46519
46746
|
function getChildArray(parent, localName15) {
|
|
46520
|
-
const
|
|
46521
|
-
if (!
|
|
46747
|
+
const child13 = findByLocalName2(parent, localName15);
|
|
46748
|
+
if (!child13) {
|
|
46522
46749
|
return [];
|
|
46523
46750
|
}
|
|
46524
|
-
if (Array.isArray(
|
|
46525
|
-
return
|
|
46751
|
+
if (Array.isArray(child13)) {
|
|
46752
|
+
return child13;
|
|
46526
46753
|
}
|
|
46527
|
-
if (typeof
|
|
46528
|
-
return [
|
|
46754
|
+
if (typeof child13 === "object" && child13 !== null) {
|
|
46755
|
+
return [child13];
|
|
46529
46756
|
}
|
|
46530
46757
|
return [];
|
|
46531
46758
|
}
|
|
46532
46759
|
function getTextValue(parent, localName15) {
|
|
46533
|
-
const
|
|
46534
|
-
if (
|
|
46760
|
+
const child13 = findByLocalName2(parent, localName15);
|
|
46761
|
+
if (child13 === void 0 || child13 === null) {
|
|
46535
46762
|
return void 0;
|
|
46536
46763
|
}
|
|
46537
|
-
if (typeof
|
|
46538
|
-
return
|
|
46764
|
+
if (typeof child13 === "string" || typeof child13 === "number") {
|
|
46765
|
+
return child13;
|
|
46539
46766
|
}
|
|
46540
|
-
if (typeof
|
|
46541
|
-
const textObj =
|
|
46767
|
+
if (typeof child13 === "object" && child13 !== null) {
|
|
46768
|
+
const textObj = child13;
|
|
46542
46769
|
if ("#text" in textObj) {
|
|
46543
46770
|
const text = textObj["#text"];
|
|
46544
46771
|
if (typeof text === "string" || typeof text === "number") {
|
|
@@ -47770,8 +47997,8 @@ function extractTextFromXmlNode(node) {
|
|
|
47770
47997
|
const children5 = node[tag];
|
|
47771
47998
|
if (children5) {
|
|
47772
47999
|
const arr = Array.isArray(children5) ? children5 : [children5];
|
|
47773
|
-
for (const
|
|
47774
|
-
const childText = extractTextFromXmlNode(
|
|
48000
|
+
for (const child13 of arr) {
|
|
48001
|
+
const childText = extractTextFromXmlNode(child13);
|
|
47775
48002
|
if (childText.length > 0) {
|
|
47776
48003
|
parts.push(childText);
|
|
47777
48004
|
}
|
|
@@ -47956,13 +48183,13 @@ function parseVmlGroup(node, idPrefix, index) {
|
|
|
47956
48183
|
}
|
|
47957
48184
|
const arr = Array.isArray(childNodes) ? childNodes : [childNodes];
|
|
47958
48185
|
for (let ci = 0; ci < arr.length; ci++) {
|
|
47959
|
-
const
|
|
47960
|
-
if (
|
|
47961
|
-
|
|
47962
|
-
|
|
47963
|
-
|
|
47964
|
-
|
|
47965
|
-
children5.push(
|
|
48186
|
+
const child13 = parseVmlElement(childTag, arr[ci], `${id}-`, ci);
|
|
48187
|
+
if (child13) {
|
|
48188
|
+
child13.x = (child13.x - originX) * childScaleX;
|
|
48189
|
+
child13.y = (child13.y - originY) * childScaleY;
|
|
48190
|
+
child13.width *= childScaleX;
|
|
48191
|
+
child13.height *= childScaleY;
|
|
48192
|
+
children5.push(child13);
|
|
47966
48193
|
}
|
|
47967
48194
|
}
|
|
47968
48195
|
}
|
|
@@ -48103,8 +48330,8 @@ function unwrapAlternateContent(container2) {
|
|
|
48103
48330
|
const children5 = ensureArray3(branch[tag]);
|
|
48104
48331
|
if (children5.length > 0) {
|
|
48105
48332
|
container2[tag] = [...ensureArray3(container2[tag]), ...children5];
|
|
48106
|
-
for (const
|
|
48107
|
-
block.childRefs.push({ tag, node:
|
|
48333
|
+
for (const child13 of children5) {
|
|
48334
|
+
block.childRefs.push({ tag, node: child13 });
|
|
48108
48335
|
}
|
|
48109
48336
|
}
|
|
48110
48337
|
}
|
|
@@ -48229,7 +48456,7 @@ function ensureArray3(val) {
|
|
|
48229
48456
|
|
|
48230
48457
|
// pptx/core/utils/model3d-scene-parser.ts
|
|
48231
48458
|
var ANGLE_UNIT = 6e4;
|
|
48232
|
-
function
|
|
48459
|
+
function child10(node, ...names) {
|
|
48233
48460
|
if (!node) {
|
|
48234
48461
|
return void 0;
|
|
48235
48462
|
}
|
|
@@ -48260,7 +48487,7 @@ function num2(node, attr) {
|
|
|
48260
48487
|
return Number.isFinite(value) ? value : void 0;
|
|
48261
48488
|
}
|
|
48262
48489
|
function am(node, name) {
|
|
48263
|
-
return
|
|
48490
|
+
return child10(node, `am3d:${name}`, name);
|
|
48264
48491
|
}
|
|
48265
48492
|
function vec(node, keys) {
|
|
48266
48493
|
if (!node) {
|
|
@@ -48284,12 +48511,12 @@ function ratio(node) {
|
|
|
48284
48511
|
}
|
|
48285
48512
|
function colour2(node) {
|
|
48286
48513
|
const clr = am(node, "clr");
|
|
48287
|
-
const srgb =
|
|
48514
|
+
const srgb = child10(clr, "a:srgbClr");
|
|
48288
48515
|
const val = srgb?.["@_val"];
|
|
48289
48516
|
if (typeof val === "string" && /^[0-9a-f]{6}$/iu.test(val)) {
|
|
48290
48517
|
return `#${val.toLowerCase()}`;
|
|
48291
48518
|
}
|
|
48292
|
-
const scrgb =
|
|
48519
|
+
const scrgb = child10(clr, "a:scrgbClr");
|
|
48293
48520
|
if (scrgb) {
|
|
48294
48521
|
const chan = (a) => {
|
|
48295
48522
|
const pct = Math.min(1e5, Math.max(0, num2(scrgb, a) ?? 0)) / 1e5;
|
|
@@ -48653,11 +48880,11 @@ function isStrictNamespaceUri(uri) {
|
|
|
48653
48880
|
}
|
|
48654
48881
|
function detectStrictConformance(xmlObj) {
|
|
48655
48882
|
for (const key of Object.keys(xmlObj)) {
|
|
48656
|
-
const
|
|
48657
|
-
if (typeof
|
|
48883
|
+
const child13 = xmlObj[key];
|
|
48884
|
+
if (typeof child13 !== "object" || child13 === null || Array.isArray(child13)) {
|
|
48658
48885
|
continue;
|
|
48659
48886
|
}
|
|
48660
|
-
const node =
|
|
48887
|
+
const node = child13;
|
|
48661
48888
|
for (const attrKey of Object.keys(node)) {
|
|
48662
48889
|
if (!attrKey.startsWith("@_xmlns")) {
|
|
48663
48890
|
continue;
|
|
@@ -49002,9 +49229,9 @@ function visitXmlObjects(value, visit, tag = "") {
|
|
|
49002
49229
|
} else if (value && typeof value === "object") {
|
|
49003
49230
|
const node = value;
|
|
49004
49231
|
visit(node, tag);
|
|
49005
|
-
for (const [key,
|
|
49232
|
+
for (const [key, child13] of Object.entries(node)) {
|
|
49006
49233
|
if (!key.startsWith("@_")) {
|
|
49007
|
-
visitXmlObjects(
|
|
49234
|
+
visitXmlObjects(child13, visit, key);
|
|
49008
49235
|
}
|
|
49009
49236
|
}
|
|
49010
49237
|
}
|
|
@@ -50082,8 +50309,8 @@ function issue(issues, path, code, message, severity = "error") {
|
|
|
50082
50309
|
}
|
|
50083
50310
|
function validateOrder(xml, allowed, path, context, issues) {
|
|
50084
50311
|
let last = -1;
|
|
50085
|
-
for (const
|
|
50086
|
-
const index = allowed.indexOf(
|
|
50312
|
+
for (const child13 of directChildren(xml)) {
|
|
50313
|
+
const index = allowed.indexOf(child13);
|
|
50087
50314
|
if (index < 0) {
|
|
50088
50315
|
continue;
|
|
50089
50316
|
}
|
|
@@ -50092,7 +50319,7 @@ function validateOrder(xml, allowed, path, context, issues) {
|
|
|
50092
50319
|
issues,
|
|
50093
50320
|
path,
|
|
50094
50321
|
"INVALID_CONTENT_ORDER",
|
|
50095
|
-
`${context} child <${
|
|
50322
|
+
`${context} child <${child13}> is out of ECMA-376 sequence order`
|
|
50096
50323
|
);
|
|
50097
50324
|
return;
|
|
50098
50325
|
}
|
|
@@ -50763,7 +50990,7 @@ function validateSlideTransitions(xml, path, issues) {
|
|
|
50763
50990
|
}
|
|
50764
50991
|
validateAttributes(transition.attributes, path, issues);
|
|
50765
50992
|
const children5 = directChildren(`<root>${transition.body}</root>`);
|
|
50766
|
-
const effects = children5.filter((
|
|
50993
|
+
const effects = children5.filter((child13) => EFFECTS.has(child13));
|
|
50767
50994
|
if (effects.length > 1) {
|
|
50768
50995
|
add3(issues, path, "TRANSITION_INVALID_CHOICE", "A slide transition may contain one effect");
|
|
50769
50996
|
}
|
|
@@ -52363,7 +52590,7 @@ function remapElementColors(element, remap, newColorMap) {
|
|
|
52363
52590
|
}
|
|
52364
52591
|
if (element.type === "group" && element.children) {
|
|
52365
52592
|
patched.children = element.children.map(
|
|
52366
|
-
(
|
|
52593
|
+
(child13) => remapElementColors(child13, remap, newColorMap)
|
|
52367
52594
|
);
|
|
52368
52595
|
if (element.groupFill) {
|
|
52369
52596
|
patched.groupFill = remapShapeStyleColors(element.groupFill, remap, newColorMap);
|
|
@@ -52493,7 +52720,7 @@ function children3(node, name, localName15) {
|
|
|
52493
52720
|
}
|
|
52494
52721
|
return value && typeof value === "object" ? [value] : [];
|
|
52495
52722
|
}
|
|
52496
|
-
function
|
|
52723
|
+
function child11(node, name, localName15) {
|
|
52497
52724
|
return children3(node, name, localName15)[0];
|
|
52498
52725
|
}
|
|
52499
52726
|
function parseText(node, name, localName15) {
|
|
@@ -52504,7 +52731,7 @@ function parseText(node, name, localName15) {
|
|
|
52504
52731
|
return values.length > 0 ? values : void 0;
|
|
52505
52732
|
}
|
|
52506
52733
|
function parseSmartArtDefinitionMetadata(node, localName15) {
|
|
52507
|
-
const categoryList =
|
|
52734
|
+
const categoryList = child11(node, "catLst", localName15);
|
|
52508
52735
|
const categories = children3(categoryList, "cat", localName15).map((item) => ({
|
|
52509
52736
|
type: String(item["@_type"] ?? ""),
|
|
52510
52737
|
priority: Number(item["@_pri"] ?? 0)
|
|
@@ -52524,14 +52751,14 @@ function parseSmartArtQuickStyleLabels(node, localName15) {
|
|
|
52524
52751
|
return labels.length > 0 ? labels : void 0;
|
|
52525
52752
|
}
|
|
52526
52753
|
function parseSmartArtStyleLabelRefs(styleLbl, localName15) {
|
|
52527
|
-
const style =
|
|
52754
|
+
const style = child11(styleLbl, "style", localName15);
|
|
52528
52755
|
if (!style) {
|
|
52529
52756
|
return void 0;
|
|
52530
52757
|
}
|
|
52531
|
-
const lnRef =
|
|
52532
|
-
const fillRef =
|
|
52533
|
-
const effectRef =
|
|
52534
|
-
const fontRef =
|
|
52758
|
+
const lnRef = child11(style, "lnRef", localName15);
|
|
52759
|
+
const fillRef = child11(style, "fillRef", localName15);
|
|
52760
|
+
const effectRef = child11(style, "effectRef", localName15);
|
|
52761
|
+
const fontRef = child11(style, "fontRef", localName15);
|
|
52535
52762
|
if (!lnRef && !fillRef && !effectRef && !fontRef) {
|
|
52536
52763
|
return void 0;
|
|
52537
52764
|
}
|
|
@@ -52543,7 +52770,7 @@ function parseSmartArtStyleLabelRefs(styleLbl, localName15) {
|
|
|
52543
52770
|
};
|
|
52544
52771
|
}
|
|
52545
52772
|
function parseColorList(node, name, localName15) {
|
|
52546
|
-
const list2 =
|
|
52773
|
+
const list2 = child11(node, name, localName15);
|
|
52547
52774
|
if (!list2) {
|
|
52548
52775
|
return void 0;
|
|
52549
52776
|
}
|
|
@@ -54472,31 +54699,31 @@ function serializeEffectDagContainerNode(container2) {
|
|
|
54472
54699
|
if (container2.name) {
|
|
54473
54700
|
xml["@_name"] = container2.name;
|
|
54474
54701
|
}
|
|
54475
|
-
for (const
|
|
54476
|
-
appendChild2(xml,
|
|
54702
|
+
for (const child13 of container2.children) {
|
|
54703
|
+
appendChild2(xml, child13);
|
|
54477
54704
|
}
|
|
54478
54705
|
return xml;
|
|
54479
54706
|
}
|
|
54480
|
-
function appendChild2(parent,
|
|
54481
|
-
if (
|
|
54482
|
-
push(parent, "a:cont", serializeEffectDagContainerNode(
|
|
54483
|
-
} else if (
|
|
54707
|
+
function appendChild2(parent, child13) {
|
|
54708
|
+
if (child13.kind === "cont") {
|
|
54709
|
+
push(parent, "a:cont", serializeEffectDagContainerNode(child13));
|
|
54710
|
+
} else if (child13.kind === "blend") {
|
|
54484
54711
|
push(parent, "a:blend", {
|
|
54485
|
-
"@_blend":
|
|
54486
|
-
"a:cont": serializeEffectDagContainerNode(
|
|
54712
|
+
"@_blend": child13.mode,
|
|
54713
|
+
"a:cont": serializeEffectDagContainerNode(child13.container)
|
|
54487
54714
|
});
|
|
54488
|
-
} else if (
|
|
54489
|
-
push(parent, "a:xfrmEffect", numericAttributes(
|
|
54490
|
-
} else if (
|
|
54491
|
-
push(parent, "a:relOff", numericAttributes(
|
|
54492
|
-
} else if (
|
|
54493
|
-
push(parent, "a:blur", serializeEffectDagBlur(
|
|
54494
|
-
} else if (
|
|
54495
|
-
push(parent, "a:alphaOutset", serializeEffectDagAlphaOutset(
|
|
54496
|
-
} else if (
|
|
54497
|
-
push(parent, "a:prstShdw", serializeEffectDagPresetShadow(
|
|
54715
|
+
} else if (child13.kind === "xfrmEffect") {
|
|
54716
|
+
push(parent, "a:xfrmEffect", numericAttributes(child13, ["sx", "sy", "kx", "ky", "tx", "ty"]));
|
|
54717
|
+
} else if (child13.kind === "relOff") {
|
|
54718
|
+
push(parent, "a:relOff", numericAttributes(child13, ["tx", "ty"]));
|
|
54719
|
+
} else if (child13.kind === "blur") {
|
|
54720
|
+
push(parent, "a:blur", serializeEffectDagBlur(child13));
|
|
54721
|
+
} else if (child13.kind === "alphaOutset") {
|
|
54722
|
+
push(parent, "a:alphaOutset", serializeEffectDagAlphaOutset(child13));
|
|
54723
|
+
} else if (child13.kind === "prstShdw") {
|
|
54724
|
+
push(parent, "a:prstShdw", serializeEffectDagPresetShadow(child13));
|
|
54498
54725
|
} else {
|
|
54499
|
-
push(parent, `a:${localName9(
|
|
54726
|
+
push(parent, `a:${localName9(child13.tag)}`, child13.xml);
|
|
54500
54727
|
}
|
|
54501
54728
|
}
|
|
54502
54729
|
function numericAttributes(source, names) {
|
|
@@ -54572,9 +54799,9 @@ function parseChildren(xml) {
|
|
|
54572
54799
|
}
|
|
54573
54800
|
const values = ensureArray7(rawValue);
|
|
54574
54801
|
for (const value of values) {
|
|
54575
|
-
const
|
|
54576
|
-
if (
|
|
54577
|
-
children5.push(
|
|
54802
|
+
const child13 = parseChild(key, value);
|
|
54803
|
+
if (child13) {
|
|
54804
|
+
children5.push(child13);
|
|
54578
54805
|
}
|
|
54579
54806
|
}
|
|
54580
54807
|
}
|
|
@@ -56179,8 +56406,8 @@ function insertOrdered2(container2, name, value, localName15) {
|
|
|
56179
56406
|
for (const key of Object.keys(container2)) {
|
|
56180
56407
|
delete container2[key];
|
|
56181
56408
|
}
|
|
56182
|
-
for (const [key,
|
|
56183
|
-
container2[key] =
|
|
56409
|
+
for (const [key, child13] of entries) {
|
|
56410
|
+
container2[key] = child13;
|
|
56184
56411
|
}
|
|
56185
56412
|
}
|
|
56186
56413
|
function applyBubbleChartOptions(container2, options, localName15) {
|
|
@@ -56499,8 +56726,8 @@ function setOrdered2(node, name, value, order, localName15) {
|
|
|
56499
56726
|
for (const candidate of Object.keys(node)) {
|
|
56500
56727
|
delete node[candidate];
|
|
56501
56728
|
}
|
|
56502
|
-
for (const [candidate,
|
|
56503
|
-
node[candidate] =
|
|
56729
|
+
for (const [candidate, child13] of entries) {
|
|
56730
|
+
node[candidate] = child13;
|
|
56504
56731
|
}
|
|
56505
56732
|
}
|
|
56506
56733
|
function applyChartUpDownBars(chartContainer, options, localName15, resolveColor) {
|
|
@@ -56558,7 +56785,7 @@ function parseDrawingMediaReference(container2, externalRelIds) {
|
|
|
56558
56785
|
return void 0;
|
|
56559
56786
|
}
|
|
56560
56787
|
for (const kind of MEDIA_REFERENCE_NAMES) {
|
|
56561
|
-
const node =
|
|
56788
|
+
const node = child12(container2, kind);
|
|
56562
56789
|
if (!node) {
|
|
56563
56790
|
continue;
|
|
56564
56791
|
}
|
|
@@ -56575,8 +56802,8 @@ function parseDrawingMediaReference(container2, externalRelIds) {
|
|
|
56575
56802
|
isLinked: linkId !== void 0 && externalRelIds?.has(linkId) === true,
|
|
56576
56803
|
name: kind === "wavAudioFile" ? String(attribute4(node, "name") ?? "") || void 0 : void 0,
|
|
56577
56804
|
contentType: kind === "audioFile" ? String(attribute4(node, "contentType") ?? "") || void 0 : void 0,
|
|
56578
|
-
audioCdStart: kind === "audioCd" ? parseAudioCdPosition(
|
|
56579
|
-
audioCdEnd: kind === "audioCd" ? parseAudioCdPosition(
|
|
56805
|
+
audioCdStart: kind === "audioCd" ? parseAudioCdPosition(child12(node, "st")) : void 0,
|
|
56806
|
+
audioCdEnd: kind === "audioCd" ? parseAudioCdPosition(child12(node, "end")) : void 0,
|
|
56580
56807
|
rawXml: node
|
|
56581
56808
|
};
|
|
56582
56809
|
}
|
|
@@ -56658,7 +56885,7 @@ function buildAudioCdPosition(value) {
|
|
|
56658
56885
|
return node;
|
|
56659
56886
|
}
|
|
56660
56887
|
var localName14 = (key) => key.replace(/^@_/u, "").split(":").at(-1) ?? key;
|
|
56661
|
-
function
|
|
56888
|
+
function child12(parent, name) {
|
|
56662
56889
|
const key = Object.keys(parent).find((candidate) => localName14(candidate) === name);
|
|
56663
56890
|
const value = key ? parent[key] : void 0;
|
|
56664
56891
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -56708,9 +56935,9 @@ function extractStyleReferenceColorXml(refNode) {
|
|
|
56708
56935
|
return void 0;
|
|
56709
56936
|
}
|
|
56710
56937
|
for (const key of COLOR_CHOICE_KEYS) {
|
|
56711
|
-
const
|
|
56712
|
-
if (
|
|
56713
|
-
return { [key]:
|
|
56938
|
+
const child13 = refNode[key];
|
|
56939
|
+
if (child13 !== void 0) {
|
|
56940
|
+
return { [key]: child13 };
|
|
56714
56941
|
}
|
|
56715
56942
|
}
|
|
56716
56943
|
return void 0;
|
|
@@ -61336,8 +61563,8 @@ function renderGroup(el, defaults, ctx) {
|
|
|
61336
61563
|
return "";
|
|
61337
61564
|
}
|
|
61338
61565
|
const parts = [];
|
|
61339
|
-
for (const
|
|
61340
|
-
parts.push(renderElement(
|
|
61566
|
+
for (const child13 of el.children) {
|
|
61567
|
+
parts.push(renderElement(child13, defaults, ctx));
|
|
61341
61568
|
}
|
|
61342
61569
|
return parts.join("");
|
|
61343
61570
|
}
|