pptx-react-viewer 2.12.1 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-UEFYTUJN.js → AiChatPanel-FXPGFU6H.js} +35 -27
- package/dist/AiChatPanel-FXPGFU6H.js.br +0 -0
- package/dist/AiChatPanel-FXPGFU6H.js.gz +0 -0
- package/dist/{AiChatPanel-CGGUPVQX.mjs → AiChatPanel-WMGS5TNX.mjs} +15 -7
- package/dist/AiChatPanel-WMGS5TNX.mjs.br +0 -0
- package/dist/AiChatPanel-WMGS5TNX.mjs.gz +0 -0
- package/dist/{Model3DScene-TU4NTHRM.mjs → Model3DScene-E2XRQAMR.mjs} +1 -1
- package/dist/Model3DScene-E2XRQAMR.mjs.br +0 -0
- package/dist/Model3DScene-E2XRQAMR.mjs.gz +0 -0
- package/dist/{Model3DScene-QYXJNALP.js → Model3DScene-K5FPZTRG.js} +2 -2
- package/dist/Model3DScene-K5FPZTRG.js.br +0 -0
- package/dist/Model3DScene-K5FPZTRG.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-VTJBKUQY.mjs → SurfaceChart3DScene-2W2IFPLE.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-VTJBKUQY.mjs.br → SurfaceChart3DScene-2W2IFPLE.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-2W2IFPLE.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-4VCO3DRP.js → SurfaceChart3DScene-JDCFTXYT.js} +2 -2
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.br +0 -0
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.gz +0 -0
- package/dist/{chunk-4SGXEGVL.mjs → chunk-3OV4FR6S.mjs} +26 -14
- package/dist/chunk-3OV4FR6S.mjs.br +0 -0
- package/dist/chunk-3OV4FR6S.mjs.gz +0 -0
- package/dist/{chunk-LE6YA5WB.js → chunk-66ZHD7Y4.js} +282 -299
- package/dist/chunk-66ZHD7Y4.js.br +0 -0
- package/dist/chunk-66ZHD7Y4.js.gz +0 -0
- package/dist/{chunk-N3NKU7SC.mjs → chunk-CQ2CKMG4.mjs} +1 -1
- package/dist/chunk-CQ2CKMG4.mjs.br +0 -0
- package/dist/chunk-CQ2CKMG4.mjs.gz +0 -0
- package/dist/{chunk-TDUDH7S4.js → chunk-DD2YRS6Z.js} +1328 -660
- package/dist/chunk-DD2YRS6Z.js.br +0 -0
- package/dist/chunk-DD2YRS6Z.js.gz +0 -0
- package/dist/{chunk-YIPR3GKG.mjs → chunk-GJEH27GD.mjs} +53 -69
- package/dist/chunk-GJEH27GD.mjs.br +0 -0
- package/dist/chunk-GJEH27GD.mjs.gz +0 -0
- package/dist/{chunk-4GYNTY2G.mjs → chunk-H5H57XMH.mjs} +16 -2
- package/dist/chunk-H5H57XMH.mjs.br +0 -0
- package/dist/chunk-H5H57XMH.mjs.gz +0 -0
- package/dist/{chunk-CABQXGPI.mjs → chunk-OWGPRVRK.mjs} +1322 -661
- package/dist/chunk-OWGPRVRK.mjs.br +0 -0
- package/dist/chunk-OWGPRVRK.mjs.gz +0 -0
- package/dist/{chunk-UIWY4XJT.js → chunk-PTFCMG3A.js} +3 -3
- package/dist/chunk-PTFCMG3A.js.br +0 -0
- package/dist/chunk-PTFCMG3A.js.gz +0 -0
- package/dist/{chunk-NUDH7TI2.js → chunk-QFNJCEMS.js} +340 -326
- package/dist/chunk-QFNJCEMS.js.br +0 -0
- package/dist/chunk-QFNJCEMS.js.gz +0 -0
- package/dist/{chunk-GBKIWNW6.js → chunk-ZMIFFURL.js} +1054 -1042
- package/dist/chunk-ZMIFFURL.js.br +0 -0
- package/dist/chunk-ZMIFFURL.js.gz +0 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +32 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +32 -0
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-CGGUPVQX.mjs.br +0 -0
- package/dist/AiChatPanel-CGGUPVQX.mjs.gz +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.br +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.gz +0 -0
- package/dist/Model3DScene-QYXJNALP.js.br +0 -0
- package/dist/Model3DScene-QYXJNALP.js.gz +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.br +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.br +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.gz +0 -0
- package/dist/SurfaceChart3DScene-VTJBKUQY.mjs.gz +0 -0
- package/dist/chunk-4GYNTY2G.mjs.br +0 -0
- package/dist/chunk-4GYNTY2G.mjs.gz +0 -0
- package/dist/chunk-4SGXEGVL.mjs.br +0 -0
- package/dist/chunk-4SGXEGVL.mjs.gz +0 -0
- package/dist/chunk-CABQXGPI.mjs.br +0 -0
- package/dist/chunk-CABQXGPI.mjs.gz +0 -0
- package/dist/chunk-GBKIWNW6.js.br +0 -0
- package/dist/chunk-GBKIWNW6.js.gz +0 -0
- package/dist/chunk-LE6YA5WB.js.br +0 -0
- package/dist/chunk-LE6YA5WB.js.gz +0 -0
- package/dist/chunk-N3NKU7SC.mjs.br +0 -0
- package/dist/chunk-N3NKU7SC.mjs.gz +0 -0
- package/dist/chunk-NUDH7TI2.js.br +0 -0
- package/dist/chunk-NUDH7TI2.js.gz +0 -0
- package/dist/chunk-TDUDH7S4.js.br +0 -0
- package/dist/chunk-TDUDH7S4.js.gz +0 -0
- package/dist/chunk-UIWY4XJT.js.br +0 -0
- package/dist/chunk-UIWY4XJT.js.gz +0 -0
- package/dist/chunk-YIPR3GKG.mjs.br +0 -0
- package/dist/chunk-YIPR3GKG.mjs.gz +0 -0
|
@@ -2159,9 +2159,9 @@ function getStockObject(index) {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
2161
|
async function blobToDataUrl(blob) {
|
|
2162
|
-
return new Promise((
|
|
2162
|
+
return new Promise((resolve2, reject) => {
|
|
2163
2163
|
const reader = new FileReader();
|
|
2164
|
-
reader.onload = () =>
|
|
2164
|
+
reader.onload = () => resolve2(reader.result);
|
|
2165
2165
|
reader.onerror = () => reject(reader.error);
|
|
2166
2166
|
reader.readAsDataURL(blob);
|
|
2167
2167
|
});
|
|
@@ -9764,12 +9764,12 @@ function updateSection(section) {
|
|
|
9764
9764
|
}
|
|
9765
9765
|
return node;
|
|
9766
9766
|
}
|
|
9767
|
-
function applySections(presentation,
|
|
9768
|
-
if (
|
|
9767
|
+
function applySections(presentation, sections2, lookup, remap) {
|
|
9768
|
+
if (sections2 === void 0) {
|
|
9769
9769
|
return;
|
|
9770
9770
|
}
|
|
9771
9771
|
let location = findSectionList(presentation, lookup);
|
|
9772
|
-
if (
|
|
9772
|
+
if (sections2.length === 0) {
|
|
9773
9773
|
if (location) {
|
|
9774
9774
|
delete location.parent[location.key];
|
|
9775
9775
|
}
|
|
@@ -9786,14 +9786,14 @@ function applySections(presentation, sections, lookup, remap) {
|
|
|
9786
9786
|
location = { parent: ext, key: "p14:sectionLst", list: ext["p14:sectionLst"] };
|
|
9787
9787
|
}
|
|
9788
9788
|
const list = cloneXmlObject(location.list) ?? {};
|
|
9789
|
-
const effectiveSections = remap && remap.changed ?
|
|
9789
|
+
const effectiveSections = remap && remap.changed ? sections2.map((section) => ({
|
|
9790
9790
|
...section,
|
|
9791
9791
|
slideIds: remapReferenceList(
|
|
9792
9792
|
section.slideIds,
|
|
9793
9793
|
remap.sldIdByOldSldId,
|
|
9794
9794
|
remap.removedSldIds
|
|
9795
9795
|
)
|
|
9796
|
-
})) :
|
|
9796
|
+
})) : sections2;
|
|
9797
9797
|
replaceChildren(list, "section", effectiveSections.map(updateSection), "p14:section");
|
|
9798
9798
|
location.parent[location.key] = list;
|
|
9799
9799
|
}
|
|
@@ -13837,10 +13837,11 @@ var PptxShapeStyleExtractor = class {
|
|
|
13837
13837
|
this.context.resolveThemeFillRef(styleNode["a:fillRef"], style);
|
|
13838
13838
|
}
|
|
13839
13839
|
const lineNode = shapeProps["a:ln"];
|
|
13840
|
+
if (styleNode?.["a:lnRef"]) {
|
|
13841
|
+
this.context.resolveThemeLineRef(styleNode["a:lnRef"], style);
|
|
13842
|
+
}
|
|
13840
13843
|
if (lineNode) {
|
|
13841
13844
|
applyLineProperties(lineNode, style, this.context);
|
|
13842
|
-
} else if (styleNode?.["a:lnRef"]) {
|
|
13843
|
-
this.context.resolveThemeLineRef(styleNode["a:lnRef"], style);
|
|
13844
13845
|
}
|
|
13845
13846
|
Object.assign(style, this.context.extractShadowStyle(shapeProps));
|
|
13846
13847
|
Object.assign(style, this.context.extractInnerShadowStyle(shapeProps));
|
|
@@ -15166,7 +15167,10 @@ var PptxConnectorParser = class {
|
|
|
15166
15167
|
const skewY = transform["@_skewY"] ? parseInt(String(transform["@_skewY"]), 10) / 6e4 : void 0;
|
|
15167
15168
|
const { flipHorizontal, flipVertical } = this.context.readFlipState(transform);
|
|
15168
15169
|
const cNvConnectionShapeProperties = connector2?.["p:nvCxnSpPr"]?.["p:cNvCxnSpPr"];
|
|
15169
|
-
const shapeStyle = this.context.extractShapeStyle(
|
|
15170
|
+
const shapeStyle = this.context.extractShapeStyle(
|
|
15171
|
+
shapeProperties,
|
|
15172
|
+
connector2["p:style"]
|
|
15173
|
+
);
|
|
15170
15174
|
const startConnectionNode = cNvConnectionShapeProperties?.["a:stCxn"];
|
|
15171
15175
|
if (startConnectionNode) {
|
|
15172
15176
|
const startConnection = {};
|
|
@@ -15316,8 +15320,8 @@ var PptxLoadDataBuilder = class {
|
|
|
15316
15320
|
this.customShows = customShows;
|
|
15317
15321
|
return this;
|
|
15318
15322
|
}
|
|
15319
|
-
withSections(
|
|
15320
|
-
this.sections =
|
|
15323
|
+
withSections(sections2) {
|
|
15324
|
+
this.sections = sections2;
|
|
15321
15325
|
return this;
|
|
15322
15326
|
}
|
|
15323
15327
|
withWarnings(warnings) {
|
|
@@ -15899,30 +15903,133 @@ var PptxCommentXmlFactoryProvider = class {
|
|
|
15899
15903
|
return new PptxCommentAuthorsXmlFactory();
|
|
15900
15904
|
}
|
|
15901
15905
|
};
|
|
15906
|
+
var P14_TRANSITION_TYPES = /* @__PURE__ */ new Set([
|
|
15907
|
+
"conveyor",
|
|
15908
|
+
"doors",
|
|
15909
|
+
"ferris",
|
|
15910
|
+
"flash",
|
|
15911
|
+
"flythrough",
|
|
15912
|
+
"gallery",
|
|
15913
|
+
"glitter",
|
|
15914
|
+
"honeycomb",
|
|
15915
|
+
"pan",
|
|
15916
|
+
"prism",
|
|
15917
|
+
"reveal",
|
|
15918
|
+
"ripple",
|
|
15919
|
+
"shred",
|
|
15920
|
+
"switch",
|
|
15921
|
+
"vortex",
|
|
15922
|
+
"warp",
|
|
15923
|
+
"wheelReverse",
|
|
15924
|
+
"window",
|
|
15925
|
+
"cube",
|
|
15926
|
+
"flip",
|
|
15927
|
+
"rotate",
|
|
15928
|
+
"orbit"
|
|
15929
|
+
]);
|
|
15930
|
+
function readP14Details(localName22, value) {
|
|
15931
|
+
const type = localName22;
|
|
15932
|
+
let direction;
|
|
15933
|
+
let orient;
|
|
15934
|
+
let pattern;
|
|
15935
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
15936
|
+
const detail = value;
|
|
15937
|
+
const rawDir = String(detail["@_dir"] || "").trim();
|
|
15938
|
+
if (rawDir.length > 0) {
|
|
15939
|
+
direction = rawDir;
|
|
15940
|
+
}
|
|
15941
|
+
const rawOrient = String(detail["@_orient"] || "").trim();
|
|
15942
|
+
if (rawOrient === "horz" || rawOrient === "vert") {
|
|
15943
|
+
orient = rawOrient;
|
|
15944
|
+
}
|
|
15945
|
+
const rawPattern = String(detail["@_pattern"] || "").trim();
|
|
15946
|
+
if (rawPattern.length > 0) {
|
|
15947
|
+
pattern = rawPattern;
|
|
15948
|
+
}
|
|
15949
|
+
}
|
|
15950
|
+
return { type, direction, orient, pattern };
|
|
15951
|
+
}
|
|
15952
|
+
function parseP14DirectChild(transitionNode, getXmlLocalName) {
|
|
15953
|
+
for (const [key, value] of Object.entries(transitionNode)) {
|
|
15954
|
+
if (key.startsWith("@_")) {
|
|
15955
|
+
continue;
|
|
15956
|
+
}
|
|
15957
|
+
const localName22 = getXmlLocalName(key);
|
|
15958
|
+
if (P14_TRANSITION_TYPES.has(localName22)) {
|
|
15959
|
+
return readP14Details(localName22, value);
|
|
15960
|
+
}
|
|
15961
|
+
}
|
|
15962
|
+
return void 0;
|
|
15963
|
+
}
|
|
15964
|
+
function parseP14FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
15965
|
+
const extEntries = xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
|
|
15966
|
+
for (const ext of extEntries) {
|
|
15967
|
+
if (!ext) {
|
|
15968
|
+
continue;
|
|
15969
|
+
}
|
|
15970
|
+
for (const [key, value] of Object.entries(ext)) {
|
|
15971
|
+
if (key.startsWith("@_")) {
|
|
15972
|
+
continue;
|
|
15973
|
+
}
|
|
15974
|
+
const localName22 = getXmlLocalName(key);
|
|
15975
|
+
if (!P14_TRANSITION_TYPES.has(localName22)) {
|
|
15976
|
+
continue;
|
|
15977
|
+
}
|
|
15978
|
+
return readP14Details(localName22, value);
|
|
15979
|
+
}
|
|
15980
|
+
}
|
|
15981
|
+
return void 0;
|
|
15982
|
+
}
|
|
15983
|
+
function buildP14ExtLst(transitionType, direction, orient, pattern, rawExtLst, xmlLookupService, getXmlLocalName) {
|
|
15984
|
+
const p14Child = {};
|
|
15985
|
+
const dir = String(direction || "").trim();
|
|
15986
|
+
if (dir.length > 0) {
|
|
15987
|
+
p14Child["@_dir"] = dir;
|
|
15988
|
+
}
|
|
15989
|
+
if (orient) {
|
|
15990
|
+
p14Child["@_orient"] = orient;
|
|
15991
|
+
}
|
|
15992
|
+
if (pattern) {
|
|
15993
|
+
p14Child["@_pattern"] = pattern;
|
|
15994
|
+
}
|
|
15995
|
+
const transitionExt = {
|
|
15996
|
+
"@_uri": "{CE6CE671-F284-4235-B8B7-4F3F06D5A82C}",
|
|
15997
|
+
[`p14:${transitionType}`]: p14Child
|
|
15998
|
+
};
|
|
15999
|
+
if (rawExtLst) {
|
|
16000
|
+
const existing = xmlLookupService.getChildrenArrayByLocalName(rawExtLst, "ext");
|
|
16001
|
+
const otherExts = existing.filter((ext) => {
|
|
16002
|
+
if (!ext) {
|
|
16003
|
+
return false;
|
|
16004
|
+
}
|
|
16005
|
+
for (const key of Object.keys(ext)) {
|
|
16006
|
+
if (key.startsWith("@_")) {
|
|
16007
|
+
continue;
|
|
16008
|
+
}
|
|
16009
|
+
const localName22 = getXmlLocalName(key);
|
|
16010
|
+
if (P14_TRANSITION_TYPES.has(localName22)) {
|
|
16011
|
+
return false;
|
|
16012
|
+
}
|
|
16013
|
+
}
|
|
16014
|
+
return true;
|
|
16015
|
+
});
|
|
16016
|
+
const allExts = [transitionExt, ...otherExts];
|
|
16017
|
+
return { "p:ext": allExts.length === 1 ? allExts[0] : allExts };
|
|
16018
|
+
}
|
|
16019
|
+
return { "p:ext": transitionExt };
|
|
16020
|
+
}
|
|
15902
16021
|
var MC_NAMESPACE_CAPABILITIES = {
|
|
16022
|
+
// Office 2010 (p14) transitions are shared with the parser's canonical
|
|
16023
|
+
// list (`P14_TRANSITION_TYPES`) so the two can never drift apart again:
|
|
16024
|
+
// this set used to be a hand-copied subset that was missing `reveal` and
|
|
16025
|
+
// `ripple`, so every `mc:Choice Requires="p14"` carrying one of them
|
|
16026
|
+
// reported `UNSUPPORTED_ALTERNATE_CONTENT_CHOICE` and silently used the
|
|
16027
|
+
// fallback fade even though the parser handles both. The extra names are
|
|
16028
|
+
// the non-transition p14 features we also parse.
|
|
15903
16029
|
p14: /* @__PURE__ */ new Set([
|
|
16030
|
+
...P14_TRANSITION_TYPES,
|
|
15904
16031
|
"transition",
|
|
15905
|
-
"conveyor",
|
|
15906
|
-
"pan",
|
|
15907
|
-
"glitter",
|
|
15908
|
-
"prism",
|
|
15909
|
-
"vortex",
|
|
15910
|
-
"switch",
|
|
15911
|
-
"flip",
|
|
15912
|
-
"gallery",
|
|
15913
|
-
"honeycomb",
|
|
15914
|
-
"flash",
|
|
15915
|
-
"shred",
|
|
15916
|
-
"warp",
|
|
15917
|
-
"flythrough",
|
|
15918
|
-
"doors",
|
|
15919
|
-
"window",
|
|
15920
|
-
"ferris",
|
|
15921
16032
|
"newsflash",
|
|
15922
|
-
"wheelReverse",
|
|
15923
|
-
"rotate",
|
|
15924
|
-
"orbit",
|
|
15925
|
-
"cube",
|
|
15926
16033
|
"media",
|
|
15927
16034
|
"trim",
|
|
15928
16035
|
"fade",
|
|
@@ -15931,6 +16038,17 @@ var MC_NAMESPACE_CAPABILITIES = {
|
|
|
15931
16038
|
"hiddenFill",
|
|
15932
16039
|
"hiddenLine"
|
|
15933
16040
|
]),
|
|
16041
|
+
// PowerPoint 2013+ writes its preset transitions (Origami, Fracture, Peel
|
|
16042
|
+
// Off, Page Curl, ...) as `<p15:prstTrans prst="...">`, either inside an
|
|
16043
|
+
// `mc:Choice Requires="p15"` or in a `p:transition/p:extLst` extension.
|
|
16044
|
+
// Both forms are parsed (see `PptxSlideTransitionService`), so the choice
|
|
16045
|
+
// IS supported: without this entry every p15 slide reported
|
|
16046
|
+
// `UNSUPPORTED_ALTERNATE_CONTENT_CHOICE`, which reads as "the transition
|
|
16047
|
+
// was dropped and the fallback fade was used" when in fact the preset
|
|
16048
|
+
// plays. `prstTrans` alone is listed on purpose: any OTHER `p15:*`
|
|
16049
|
+
// element still makes the choice unsupported and falls back, which is
|
|
16050
|
+
// the honest answer.
|
|
16051
|
+
p15: /* @__PURE__ */ new Set(["prstTrans"]),
|
|
15934
16052
|
// PowerPoint 2016+ writes the Morph transition as `<p159:morph @option>`,
|
|
15935
16053
|
// either inside an `mc:Choice Requires="p159"` or in a `p:transition/p:extLst`
|
|
15936
16054
|
// extension. Both forms are parsed (see `PptxSlideTransitionService`), so the
|
|
@@ -18979,7 +19097,7 @@ function remapEditorAnimationsToShapeIds(elements2, animations, reservedMaxId =
|
|
|
18979
19097
|
byId.set(el.id, el);
|
|
18980
19098
|
}
|
|
18981
19099
|
let nextId2 = Math.max(maxShapeId(flat), reservedMaxId) + 1;
|
|
18982
|
-
const
|
|
19100
|
+
const resolve2 = (elementId) => {
|
|
18983
19101
|
const el = byId.get(elementId);
|
|
18984
19102
|
if (!el) {
|
|
18985
19103
|
return void 0;
|
|
@@ -18991,8 +19109,8 @@ function remapEditorAnimationsToShapeIds(elements2, animations, reservedMaxId =
|
|
|
18991
19109
|
return el.shapeId;
|
|
18992
19110
|
};
|
|
18993
19111
|
return animations.map((anim) => {
|
|
18994
|
-
const resolvedElement =
|
|
18995
|
-
const resolvedTrigger = anim.triggerShapeId !== void 0 ?
|
|
19112
|
+
const resolvedElement = resolve2(anim.elementId);
|
|
19113
|
+
const resolvedTrigger = anim.triggerShapeId !== void 0 ? resolve2(anim.triggerShapeId) : void 0;
|
|
18996
19114
|
if (resolvedElement === void 0 && resolvedTrigger === void 0) {
|
|
18997
19115
|
return anim;
|
|
18998
19116
|
}
|
|
@@ -19907,6 +20025,74 @@ function extractChildBehaviourDurationMs(cTn, toArray2) {
|
|
|
19907
20025
|
}
|
|
19908
20026
|
return longest;
|
|
19909
20027
|
}
|
|
20028
|
+
var defaultLookup = new PptxXmlLookupService();
|
|
20029
|
+
function resolveSlideTimingNode(slideRoot) {
|
|
20030
|
+
const direct = slideRoot?.["p:timing"];
|
|
20031
|
+
if (direct && typeof direct === "object" && !Array.isArray(direct)) {
|
|
20032
|
+
return direct;
|
|
20033
|
+
}
|
|
20034
|
+
return findEnvelopeChildByLocalName(slideRoot, "timing", defaultLookup);
|
|
20035
|
+
}
|
|
20036
|
+
function findTransitionInAlternateContent(slideRoot, lookup) {
|
|
20037
|
+
return findEnvelopeChildByLocalName(slideRoot, "transition", lookup);
|
|
20038
|
+
}
|
|
20039
|
+
function findEnvelopeChildByLocalName(slideRoot, localName22, lookup) {
|
|
20040
|
+
for (const envelope of lookup.getChildrenArrayByLocalName(slideRoot, "AlternateContent")) {
|
|
20041
|
+
let unsupportedChoiceNode;
|
|
20042
|
+
for (const choice of lookup.getChildrenArrayByLocalName(envelope, "Choice")) {
|
|
20043
|
+
const node = lookup.getChildByLocalName(choice, localName22);
|
|
20044
|
+
if (!node) {
|
|
20045
|
+
continue;
|
|
20046
|
+
}
|
|
20047
|
+
if (isAlternateContentChoiceSupported(choice)) {
|
|
20048
|
+
return node;
|
|
20049
|
+
}
|
|
20050
|
+
unsupportedChoiceNode ??= node;
|
|
20051
|
+
}
|
|
20052
|
+
const fallbackNode = lookup.getChildByLocalName(
|
|
20053
|
+
lookup.getChildByLocalName(envelope, "Fallback"),
|
|
20054
|
+
localName22
|
|
20055
|
+
);
|
|
20056
|
+
const found = fallbackNode ?? unsupportedChoiceNode;
|
|
20057
|
+
if (found) {
|
|
20058
|
+
return found;
|
|
20059
|
+
}
|
|
20060
|
+
}
|
|
20061
|
+
return void 0;
|
|
20062
|
+
}
|
|
20063
|
+
function preservedP14ChildKey(node, transitionType, getXmlLocalName) {
|
|
20064
|
+
for (const key of Object.keys(node)) {
|
|
20065
|
+
if (!key.startsWith("@_") && getXmlLocalName(key) === transitionType) {
|
|
20066
|
+
return key;
|
|
20067
|
+
}
|
|
20068
|
+
}
|
|
20069
|
+
return void 0;
|
|
20070
|
+
}
|
|
20071
|
+
function preservedP15ChildKey(node, transitionType, getXmlLocalName) {
|
|
20072
|
+
for (const [key, value] of Object.entries(node)) {
|
|
20073
|
+
if (key.startsWith("@_") || getXmlLocalName(key) !== "prstTrans") {
|
|
20074
|
+
continue;
|
|
20075
|
+
}
|
|
20076
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
20077
|
+
continue;
|
|
20078
|
+
}
|
|
20079
|
+
if (String(value["@_prst"] || "").trim() === transitionType) {
|
|
20080
|
+
return key;
|
|
20081
|
+
}
|
|
20082
|
+
}
|
|
20083
|
+
return void 0;
|
|
20084
|
+
}
|
|
20085
|
+
function pruneDirectExtensionChildren(node, getXmlLocalName, keepKey) {
|
|
20086
|
+
for (const key of Object.keys(node)) {
|
|
20087
|
+
if (key === keepKey || key.startsWith("@_")) {
|
|
20088
|
+
continue;
|
|
20089
|
+
}
|
|
20090
|
+
const localName22 = getXmlLocalName(key);
|
|
20091
|
+
if (P14_TRANSITION_TYPES.has(localName22) || localName22 === "prstTrans") {
|
|
20092
|
+
delete node[key];
|
|
20093
|
+
}
|
|
20094
|
+
}
|
|
20095
|
+
}
|
|
19910
20096
|
function isInteractiveSequence(seq) {
|
|
19911
20097
|
const cTn = seq["p:cTn"];
|
|
19912
20098
|
if (!cTn || String(cTn["@_nodeType"] || "") === "mainSeq") {
|
|
@@ -19928,7 +20114,7 @@ var PptxNativeAnimationService = class {
|
|
|
19928
20114
|
*/
|
|
19929
20115
|
parseNativeAnimations(slideXml2) {
|
|
19930
20116
|
try {
|
|
19931
|
-
const timing = slideXml2?.["p:sld"]
|
|
20117
|
+
const timing = resolveSlideTimingNode(slideXml2?.["p:sld"]);
|
|
19932
20118
|
if (!timing || typeof timing !== "object") {
|
|
19933
20119
|
return void 0;
|
|
19934
20120
|
}
|
|
@@ -19994,7 +20180,7 @@ var PptxNativeAnimationService = class {
|
|
|
19994
20180
|
* parent node. See `animation-group-context` for why the flat list
|
|
19995
20181
|
* needs it.
|
|
19996
20182
|
*/
|
|
19997
|
-
walkTimingTree(node, animations, currentTrigger,
|
|
20183
|
+
walkTimingTree(node, animations, currentTrigger, group2 = createGroupContext()) {
|
|
19998
20184
|
if (!node) {
|
|
19999
20185
|
return;
|
|
20000
20186
|
}
|
|
@@ -20093,8 +20279,8 @@ var PptxNativeAnimationService = class {
|
|
|
20093
20279
|
textTarget: textTarget ?? void 0,
|
|
20094
20280
|
cTnAttributes: roundTripAttrs,
|
|
20095
20281
|
afterEffect: afterEffectFlag,
|
|
20096
|
-
groupAutoStart:
|
|
20097
|
-
parGroupIndex:
|
|
20282
|
+
groupAutoStart: group2.groupAutoStart,
|
|
20283
|
+
parGroupIndex: group2.parGroupIndex
|
|
20098
20284
|
});
|
|
20099
20285
|
}
|
|
20100
20286
|
const childTnList = cTn["p:childTnLst"];
|
|
@@ -20108,7 +20294,7 @@ var PptxNativeAnimationService = class {
|
|
|
20108
20294
|
parallel,
|
|
20109
20295
|
animations,
|
|
20110
20296
|
trigger,
|
|
20111
|
-
childGroupContext(
|
|
20297
|
+
childGroupContext(group2, parallel["p:cTn"], {
|
|
20112
20298
|
isClickLevelGroup: isClickLevel
|
|
20113
20299
|
})
|
|
20114
20300
|
);
|
|
@@ -20117,11 +20303,11 @@ var PptxNativeAnimationService = class {
|
|
|
20117
20303
|
if (isInteractiveSequence(sequence)) {
|
|
20118
20304
|
continue;
|
|
20119
20305
|
}
|
|
20120
|
-
this.walkTimingTree(sequence, animations, trigger,
|
|
20306
|
+
this.walkTimingTree(sequence, animations, trigger, group2);
|
|
20121
20307
|
}
|
|
20122
20308
|
for (const excl of exclusives) {
|
|
20123
20309
|
const exclAnims = [];
|
|
20124
|
-
this.walkTimingTree(excl, exclAnims, trigger,
|
|
20310
|
+
this.walkTimingTree(excl, exclAnims, trigger, group2);
|
|
20125
20311
|
for (const a of exclAnims) {
|
|
20126
20312
|
a.exclusive = true;
|
|
20127
20313
|
animations.push(a);
|
|
@@ -20136,7 +20322,7 @@ var PptxNativeAnimationService = class {
|
|
|
20136
20322
|
parallel,
|
|
20137
20323
|
animations,
|
|
20138
20324
|
currentTrigger,
|
|
20139
|
-
childGroupContext(
|
|
20325
|
+
childGroupContext(group2, parallel["p:cTn"], {
|
|
20140
20326
|
isClickLevelGroup: false
|
|
20141
20327
|
})
|
|
20142
20328
|
);
|
|
@@ -20145,7 +20331,7 @@ var PptxNativeAnimationService = class {
|
|
|
20145
20331
|
if (isInteractiveSequence(sequence)) {
|
|
20146
20332
|
continue;
|
|
20147
20333
|
}
|
|
20148
|
-
this.walkTimingTree(sequence, animations, currentTrigger,
|
|
20334
|
+
this.walkTimingTree(sequence, animations, currentTrigger, group2);
|
|
20149
20335
|
}
|
|
20150
20336
|
}
|
|
20151
20337
|
/**
|
|
@@ -20306,106 +20492,6 @@ var PptxNativeAnimationService = class {
|
|
|
20306
20492
|
}
|
|
20307
20493
|
}
|
|
20308
20494
|
};
|
|
20309
|
-
var P14_TRANSITION_TYPES = /* @__PURE__ */ new Set([
|
|
20310
|
-
"conveyor",
|
|
20311
|
-
"doors",
|
|
20312
|
-
"ferris",
|
|
20313
|
-
"flash",
|
|
20314
|
-
"flythrough",
|
|
20315
|
-
"gallery",
|
|
20316
|
-
"glitter",
|
|
20317
|
-
"honeycomb",
|
|
20318
|
-
"pan",
|
|
20319
|
-
"prism",
|
|
20320
|
-
"reveal",
|
|
20321
|
-
"ripple",
|
|
20322
|
-
"shred",
|
|
20323
|
-
"switch",
|
|
20324
|
-
"vortex",
|
|
20325
|
-
"warp",
|
|
20326
|
-
"wheelReverse",
|
|
20327
|
-
"window",
|
|
20328
|
-
"cube",
|
|
20329
|
-
"flip",
|
|
20330
|
-
"rotate",
|
|
20331
|
-
"orbit"
|
|
20332
|
-
]);
|
|
20333
|
-
function parseP14FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
20334
|
-
const extEntries = xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
|
|
20335
|
-
for (const ext of extEntries) {
|
|
20336
|
-
if (!ext) {
|
|
20337
|
-
continue;
|
|
20338
|
-
}
|
|
20339
|
-
for (const [key, value] of Object.entries(ext)) {
|
|
20340
|
-
if (key.startsWith("@_")) {
|
|
20341
|
-
continue;
|
|
20342
|
-
}
|
|
20343
|
-
const localName22 = getXmlLocalName(key);
|
|
20344
|
-
if (!P14_TRANSITION_TYPES.has(localName22)) {
|
|
20345
|
-
continue;
|
|
20346
|
-
}
|
|
20347
|
-
const type = localName22;
|
|
20348
|
-
let direction;
|
|
20349
|
-
let orient;
|
|
20350
|
-
let pattern;
|
|
20351
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
20352
|
-
const detail = value;
|
|
20353
|
-
const rawDir = String(detail["@_dir"] || "").trim();
|
|
20354
|
-
if (rawDir.length > 0) {
|
|
20355
|
-
direction = rawDir;
|
|
20356
|
-
}
|
|
20357
|
-
const rawOrient = String(detail["@_orient"] || "").trim();
|
|
20358
|
-
if (rawOrient === "horz" || rawOrient === "vert") {
|
|
20359
|
-
orient = rawOrient;
|
|
20360
|
-
}
|
|
20361
|
-
const rawPattern = String(detail["@_pattern"] || "").trim();
|
|
20362
|
-
if (rawPattern.length > 0) {
|
|
20363
|
-
pattern = rawPattern;
|
|
20364
|
-
}
|
|
20365
|
-
}
|
|
20366
|
-
return { type, direction, orient, pattern };
|
|
20367
|
-
}
|
|
20368
|
-
}
|
|
20369
|
-
return void 0;
|
|
20370
|
-
}
|
|
20371
|
-
function buildP14ExtLst(transitionType, direction, orient, pattern, rawExtLst, xmlLookupService, getXmlLocalName) {
|
|
20372
|
-
const p14Child = {};
|
|
20373
|
-
const dir = String(direction || "").trim();
|
|
20374
|
-
if (dir.length > 0) {
|
|
20375
|
-
p14Child["@_dir"] = dir;
|
|
20376
|
-
}
|
|
20377
|
-
if (orient) {
|
|
20378
|
-
p14Child["@_orient"] = orient;
|
|
20379
|
-
}
|
|
20380
|
-
if (pattern) {
|
|
20381
|
-
p14Child["@_pattern"] = pattern;
|
|
20382
|
-
}
|
|
20383
|
-
const transitionExt = {
|
|
20384
|
-
"@_uri": "{CE6CE671-F284-4235-B8B7-4F3F06D5A82C}",
|
|
20385
|
-
[`p14:${transitionType}`]: p14Child
|
|
20386
|
-
};
|
|
20387
|
-
if (rawExtLst) {
|
|
20388
|
-
const existing = xmlLookupService.getChildrenArrayByLocalName(rawExtLst, "ext");
|
|
20389
|
-
const otherExts = existing.filter((ext) => {
|
|
20390
|
-
if (!ext) {
|
|
20391
|
-
return false;
|
|
20392
|
-
}
|
|
20393
|
-
for (const key of Object.keys(ext)) {
|
|
20394
|
-
if (key.startsWith("@_")) {
|
|
20395
|
-
continue;
|
|
20396
|
-
}
|
|
20397
|
-
const localName22 = getXmlLocalName(key);
|
|
20398
|
-
if (P14_TRANSITION_TYPES.has(localName22)) {
|
|
20399
|
-
return false;
|
|
20400
|
-
}
|
|
20401
|
-
}
|
|
20402
|
-
return true;
|
|
20403
|
-
});
|
|
20404
|
-
const allExts = [transitionExt, ...otherExts];
|
|
20405
|
-
return { "p:ext": allExts.length === 1 ? allExts[0] : allExts };
|
|
20406
|
-
}
|
|
20407
|
-
return { "p:ext": transitionExt };
|
|
20408
|
-
}
|
|
20409
20495
|
var P15_TRANSITION_PRESETS = /* @__PURE__ */ new Set([
|
|
20410
20496
|
"fallOver",
|
|
20411
20497
|
"drape",
|
|
@@ -20431,6 +20517,36 @@ function optionalBoolean(value) {
|
|
|
20431
20517
|
}
|
|
20432
20518
|
return void 0;
|
|
20433
20519
|
}
|
|
20520
|
+
function readPrstTrans(value) {
|
|
20521
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
20522
|
+
return void 0;
|
|
20523
|
+
}
|
|
20524
|
+
const detail = value;
|
|
20525
|
+
const prst = String(detail["@_prst"] || "").trim();
|
|
20526
|
+
if (!P15_TRANSITION_PRESETS.has(prst)) {
|
|
20527
|
+
return void 0;
|
|
20528
|
+
}
|
|
20529
|
+
return {
|
|
20530
|
+
type: prst,
|
|
20531
|
+
invX: optionalBoolean(detail["@_invX"]),
|
|
20532
|
+
invY: optionalBoolean(detail["@_invY"])
|
|
20533
|
+
};
|
|
20534
|
+
}
|
|
20535
|
+
function parseP15DirectChild(transitionNode, getXmlLocalName) {
|
|
20536
|
+
for (const [key, value] of Object.entries(transitionNode)) {
|
|
20537
|
+
if (key.startsWith("@_")) {
|
|
20538
|
+
continue;
|
|
20539
|
+
}
|
|
20540
|
+
if (getXmlLocalName(key) !== "prstTrans") {
|
|
20541
|
+
continue;
|
|
20542
|
+
}
|
|
20543
|
+
const result = readPrstTrans(value);
|
|
20544
|
+
if (result) {
|
|
20545
|
+
return result;
|
|
20546
|
+
}
|
|
20547
|
+
}
|
|
20548
|
+
return void 0;
|
|
20549
|
+
}
|
|
20434
20550
|
function parseP15FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
20435
20551
|
const extEntries = xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
|
|
20436
20552
|
for (const ext of extEntries) {
|
|
@@ -20444,19 +20560,10 @@ function parseP15FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
|
20444
20560
|
if (getXmlLocalName(key) !== "prstTrans") {
|
|
20445
20561
|
continue;
|
|
20446
20562
|
}
|
|
20447
|
-
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
const detail = value;
|
|
20451
|
-
const prst = String(detail["@_prst"] || "").trim();
|
|
20452
|
-
if (!P15_TRANSITION_PRESETS.has(prst)) {
|
|
20453
|
-
continue;
|
|
20563
|
+
const result = readPrstTrans(value);
|
|
20564
|
+
if (result) {
|
|
20565
|
+
return result;
|
|
20454
20566
|
}
|
|
20455
|
-
return {
|
|
20456
|
-
type: prst,
|
|
20457
|
-
invX: optionalBoolean(detail["@_invX"]),
|
|
20458
|
-
invY: optionalBoolean(detail["@_invY"])
|
|
20459
|
-
};
|
|
20460
20567
|
}
|
|
20461
20568
|
}
|
|
20462
20569
|
return void 0;
|
|
@@ -20705,6 +20812,69 @@ function validUnsignedInteger(value, min = 0) {
|
|
|
20705
20812
|
return Number.isInteger(value) && Number(value) >= min && Number(value) <= UINT_MAX;
|
|
20706
20813
|
}
|
|
20707
20814
|
var MORPH_EXT_URI = "{C7C9D14B-FE2A-4D35-B620-AB07D5B017F4}";
|
|
20815
|
+
function parseMorphFromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
20816
|
+
const extEntries = xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
|
|
20817
|
+
for (const ext of extEntries) {
|
|
20818
|
+
if (!ext) {
|
|
20819
|
+
continue;
|
|
20820
|
+
}
|
|
20821
|
+
for (const [key, value] of Object.entries(ext)) {
|
|
20822
|
+
if (key.startsWith("@_")) {
|
|
20823
|
+
continue;
|
|
20824
|
+
}
|
|
20825
|
+
if (getXmlLocalName(key) === "morph") {
|
|
20826
|
+
return {
|
|
20827
|
+
morphOption: normalizeMorphOption(value?.["@_option"])
|
|
20828
|
+
};
|
|
20829
|
+
}
|
|
20830
|
+
}
|
|
20831
|
+
}
|
|
20832
|
+
return void 0;
|
|
20833
|
+
}
|
|
20834
|
+
function hasDirectMorphChild(node, getXmlLocalName) {
|
|
20835
|
+
for (const key of Object.keys(node)) {
|
|
20836
|
+
if (!key.startsWith("@_") && getXmlLocalName(key) === "morph") {
|
|
20837
|
+
return true;
|
|
20838
|
+
}
|
|
20839
|
+
}
|
|
20840
|
+
return false;
|
|
20841
|
+
}
|
|
20842
|
+
function buildMorphExtLst(rawExtLst, morphOption, xmlLookupService, getXmlLocalName) {
|
|
20843
|
+
const morphNode = {
|
|
20844
|
+
"@_xmlns:p159": "http://schemas.microsoft.com/office/powerpoint/2015/09/main"
|
|
20845
|
+
};
|
|
20846
|
+
if (morphOption) {
|
|
20847
|
+
morphNode["@_option"] = morphOption;
|
|
20848
|
+
}
|
|
20849
|
+
const morphExt = {
|
|
20850
|
+
"@_uri": MORPH_EXT_URI,
|
|
20851
|
+
"p159:morph": morphNode
|
|
20852
|
+
};
|
|
20853
|
+
if (!rawExtLst) {
|
|
20854
|
+
return { "p:ext": morphExt };
|
|
20855
|
+
}
|
|
20856
|
+
const existing = xmlLookupService.getChildrenArrayByLocalName(rawExtLst, "ext");
|
|
20857
|
+
const otherExts = existing.filter((ext) => {
|
|
20858
|
+
if (!ext) {
|
|
20859
|
+
return false;
|
|
20860
|
+
}
|
|
20861
|
+
const uri = String(ext["@_uri"] || "").trim();
|
|
20862
|
+
if (uri.toUpperCase() === MORPH_EXT_URI.toUpperCase()) {
|
|
20863
|
+
return false;
|
|
20864
|
+
}
|
|
20865
|
+
for (const key of Object.keys(ext)) {
|
|
20866
|
+
if (key.startsWith("@_")) {
|
|
20867
|
+
continue;
|
|
20868
|
+
}
|
|
20869
|
+
if (getXmlLocalName(key) === "morph") {
|
|
20870
|
+
return false;
|
|
20871
|
+
}
|
|
20872
|
+
}
|
|
20873
|
+
return true;
|
|
20874
|
+
});
|
|
20875
|
+
const allExts = [morphExt, ...otherExts];
|
|
20876
|
+
return { "p:ext": allExts.length === 1 ? allExts[0] : allExts };
|
|
20877
|
+
}
|
|
20708
20878
|
var PptxSlideTransitionService = class {
|
|
20709
20879
|
xmlLookupService;
|
|
20710
20880
|
getXmlLocalName;
|
|
@@ -20714,7 +20884,7 @@ var PptxSlideTransitionService = class {
|
|
|
20714
20884
|
}
|
|
20715
20885
|
parseSlideTransition(slideXml2) {
|
|
20716
20886
|
const slideRoot = this.xmlLookupService.getChildByLocalName(slideXml2, "sld");
|
|
20717
|
-
const transitionNode = this.xmlLookupService.getChildByLocalName(slideRoot, "transition") ||
|
|
20887
|
+
const transitionNode = this.xmlLookupService.getChildByLocalName(slideRoot, "transition") || findTransitionInAlternateContent(slideRoot, this.xmlLookupService);
|
|
20718
20888
|
if (!transitionNode) {
|
|
20719
20889
|
return void 0;
|
|
20720
20890
|
}
|
|
@@ -20723,6 +20893,18 @@ var PptxSlideTransitionService = class {
|
|
|
20723
20893
|
let { direction, orient, pattern } = details;
|
|
20724
20894
|
const { spokes, thruBlk, rawSoundAction, rawExtLst } = details;
|
|
20725
20895
|
let { morphOption } = details;
|
|
20896
|
+
if (transitionType === "cut") {
|
|
20897
|
+
const p14Direct = parseP14DirectChild(transitionNode, this.getXmlLocalName);
|
|
20898
|
+
const p15Direct = p14Direct ? void 0 : parseP15DirectChild(transitionNode, this.getXmlLocalName);
|
|
20899
|
+
if (p14Direct) {
|
|
20900
|
+
transitionType = p14Direct.type;
|
|
20901
|
+
direction = p14Direct.direction ?? direction;
|
|
20902
|
+
orient = p14Direct.orient ?? orient;
|
|
20903
|
+
pattern = p14Direct.pattern ?? pattern;
|
|
20904
|
+
} else if (p15Direct) {
|
|
20905
|
+
transitionType = p15Direct.type;
|
|
20906
|
+
}
|
|
20907
|
+
}
|
|
20726
20908
|
if (rawExtLst && transitionType === "cut") {
|
|
20727
20909
|
const p14Result = parseP14FromExtLst(rawExtLst, this.xmlLookupService, this.getXmlLocalName);
|
|
20728
20910
|
const p15Result = p14Result ? void 0 : parseP15FromExtLst(rawExtLst, this.xmlLookupService, this.getXmlLocalName);
|
|
@@ -20740,7 +20922,11 @@ var PptxSlideTransitionService = class {
|
|
|
20740
20922
|
} else if (p15Result) {
|
|
20741
20923
|
transitionType = p15Result.type;
|
|
20742
20924
|
} else {
|
|
20743
|
-
const morphResult =
|
|
20925
|
+
const morphResult = parseMorphFromExtLst(
|
|
20926
|
+
rawExtLst,
|
|
20927
|
+
this.xmlLookupService,
|
|
20928
|
+
this.getXmlLocalName
|
|
20929
|
+
);
|
|
20744
20930
|
if (morphResult) {
|
|
20745
20931
|
transitionType = "morph";
|
|
20746
20932
|
morphOption = morphResult.morphOption;
|
|
@@ -20764,58 +20950,6 @@ var PptxSlideTransitionService = class {
|
|
|
20764
20950
|
rawTransition: transitionNode
|
|
20765
20951
|
};
|
|
20766
20952
|
}
|
|
20767
|
-
/**
|
|
20768
|
-
* Locate a `<p:transition>` wrapped in a slide-root `mc:AlternateContent`
|
|
20769
|
-
* envelope.
|
|
20770
|
-
*
|
|
20771
|
-
* Real PowerPoint (verified via COM-authored fixtures) wraps the
|
|
20772
|
-
* transition in `mc:AlternateContent` whenever it carries an Office
|
|
20773
|
-
* 2010+ attribute such as `p14:dur` (sub-second transition duration):
|
|
20774
|
-
* an `mc:Choice Requires="p14"` branch carries the richer transition,
|
|
20775
|
-
* and `mc:Fallback` carries a plain one for older readers. Without this
|
|
20776
|
-
* unwrap, `p:sld`'s direct-child lookup for `transition` finds nothing
|
|
20777
|
-
* and the whole transition (including plain ones falling back with no
|
|
20778
|
-
* p14 data) is silently dropped, even though `mc:Choice` is otherwise a
|
|
20779
|
-
* complete, directly usable `p:transition` node.
|
|
20780
|
-
*/
|
|
20781
|
-
findTransitionInAlternateContent(slideRoot) {
|
|
20782
|
-
const altContent = this.xmlLookupService.getChildByLocalName(slideRoot, "AlternateContent");
|
|
20783
|
-
if (!altContent) {
|
|
20784
|
-
return void 0;
|
|
20785
|
-
}
|
|
20786
|
-
const choices2 = this.xmlLookupService.getChildrenArrayByLocalName(altContent, "Choice");
|
|
20787
|
-
for (const choice of choices2) {
|
|
20788
|
-
const transitionNode = this.xmlLookupService.getChildByLocalName(choice, "transition");
|
|
20789
|
-
if (transitionNode) {
|
|
20790
|
-
return transitionNode;
|
|
20791
|
-
}
|
|
20792
|
-
}
|
|
20793
|
-
const fallback = this.xmlLookupService.getChildByLocalName(altContent, "Fallback");
|
|
20794
|
-
return this.xmlLookupService.getChildByLocalName(fallback, "transition");
|
|
20795
|
-
}
|
|
20796
|
-
/**
|
|
20797
|
-
* Detects the PowerPoint 2016+ `morph` transition stored as a p159 extension
|
|
20798
|
-
* inside the transition's extLst.
|
|
20799
|
-
*/
|
|
20800
|
-
parseMorphFromExtLst(extLstNode) {
|
|
20801
|
-
const extEntries = this.xmlLookupService.getChildrenArrayByLocalName(extLstNode, "ext");
|
|
20802
|
-
for (const ext of extEntries) {
|
|
20803
|
-
if (!ext) {
|
|
20804
|
-
continue;
|
|
20805
|
-
}
|
|
20806
|
-
for (const [key, value] of Object.entries(ext)) {
|
|
20807
|
-
if (key.startsWith("@_")) {
|
|
20808
|
-
continue;
|
|
20809
|
-
}
|
|
20810
|
-
if (this.getXmlLocalName(key) === "morph") {
|
|
20811
|
-
return {
|
|
20812
|
-
morphOption: normalizeMorphOption(value?.["@_option"])
|
|
20813
|
-
};
|
|
20814
|
-
}
|
|
20815
|
-
}
|
|
20816
|
-
}
|
|
20817
|
-
return void 0;
|
|
20818
|
-
}
|
|
20819
20953
|
buildSlideTransitionXml(transition) {
|
|
20820
20954
|
if (!transition || transition.type === "none") {
|
|
20821
20955
|
return void 0;
|
|
@@ -20825,21 +20959,33 @@ var PptxSlideTransitionService = class {
|
|
|
20825
20959
|
const isP15Type = P15_TRANSITION_PRESETS.has(transitionType);
|
|
20826
20960
|
const isMorphType = transitionType === "morph";
|
|
20827
20961
|
const node = createPreservedTransitionNode(transition.rawTransition, this.getXmlLocalName);
|
|
20962
|
+
const p14ChildKey = isP14Type ? preservedP14ChildKey(node, transitionType, this.getXmlLocalName) : void 0;
|
|
20963
|
+
const p15ChildKey = isP15Type ? preservedP15ChildKey(node, transitionType, this.getXmlLocalName) : void 0;
|
|
20964
|
+
pruneDirectExtensionChildren(node, this.getXmlLocalName, p14ChildKey ?? p15ChildKey);
|
|
20828
20965
|
if (isP14Type) {
|
|
20829
|
-
|
|
20830
|
-
|
|
20831
|
-
|
|
20832
|
-
|
|
20833
|
-
|
|
20834
|
-
|
|
20835
|
-
|
|
20836
|
-
|
|
20837
|
-
|
|
20966
|
+
if (!p14ChildKey) {
|
|
20967
|
+
node["p:extLst"] = buildP14ExtLst(
|
|
20968
|
+
transitionType,
|
|
20969
|
+
transition.direction,
|
|
20970
|
+
transition.orient,
|
|
20971
|
+
transition.pattern,
|
|
20972
|
+
transition.rawExtLst,
|
|
20973
|
+
this.xmlLookupService,
|
|
20974
|
+
this.getXmlLocalName
|
|
20975
|
+
);
|
|
20976
|
+
}
|
|
20838
20977
|
} else if (isP15Type) {
|
|
20839
|
-
|
|
20978
|
+
if (!p15ChildKey) {
|
|
20979
|
+
node["p:extLst"] = transition.rawExtLst ?? buildP15ExtLst(transitionType);
|
|
20980
|
+
}
|
|
20840
20981
|
} else if (isMorphType) {
|
|
20841
|
-
if (!
|
|
20842
|
-
node["p:extLst"] =
|
|
20982
|
+
if (!hasDirectMorphChild(node, this.getXmlLocalName)) {
|
|
20983
|
+
node["p:extLst"] = buildMorphExtLst(
|
|
20984
|
+
transition.rawExtLst,
|
|
20985
|
+
transition.morphOption,
|
|
20986
|
+
this.xmlLookupService,
|
|
20987
|
+
this.getXmlLocalName
|
|
20988
|
+
);
|
|
20843
20989
|
}
|
|
20844
20990
|
} else {
|
|
20845
20991
|
node[`p:${transitionType}`] = buildStandardTransitionChild(transition);
|
|
@@ -20854,58 +21000,6 @@ var PptxSlideTransitionService = class {
|
|
|
20854
21000
|
}
|
|
20855
21001
|
return node;
|
|
20856
21002
|
}
|
|
20857
|
-
/**
|
|
20858
|
-
* True when the (preserved) transition node already carries a `morph`
|
|
20859
|
-
* element as a direct child, in any namespace prefix.
|
|
20860
|
-
*/
|
|
20861
|
-
hasDirectMorphChild(node) {
|
|
20862
|
-
for (const key of Object.keys(node)) {
|
|
20863
|
-
if (!key.startsWith("@_") && this.getXmlLocalName(key) === "morph") {
|
|
20864
|
-
return true;
|
|
20865
|
-
}
|
|
20866
|
-
}
|
|
20867
|
-
return false;
|
|
20868
|
-
}
|
|
20869
|
-
/**
|
|
20870
|
-
* Build the extLst XML node for a morph (p159) transition, preserving any
|
|
20871
|
-
* non-morph extensions from rawExtLst.
|
|
20872
|
-
*/
|
|
20873
|
-
buildMorphExtLst(rawExtLst, morphOption) {
|
|
20874
|
-
const morphNode = {
|
|
20875
|
-
"@_xmlns:p159": "http://schemas.microsoft.com/office/powerpoint/2015/09/main"
|
|
20876
|
-
};
|
|
20877
|
-
if (morphOption) {
|
|
20878
|
-
morphNode["@_option"] = morphOption;
|
|
20879
|
-
}
|
|
20880
|
-
const morphExt = {
|
|
20881
|
-
"@_uri": MORPH_EXT_URI,
|
|
20882
|
-
"p159:morph": morphNode
|
|
20883
|
-
};
|
|
20884
|
-
if (!rawExtLst) {
|
|
20885
|
-
return { "p:ext": morphExt };
|
|
20886
|
-
}
|
|
20887
|
-
const existing = this.xmlLookupService.getChildrenArrayByLocalName(rawExtLst, "ext");
|
|
20888
|
-
const otherExts = existing.filter((ext) => {
|
|
20889
|
-
if (!ext) {
|
|
20890
|
-
return false;
|
|
20891
|
-
}
|
|
20892
|
-
const uri = String(ext["@_uri"] || "").trim();
|
|
20893
|
-
if (uri.toUpperCase() === MORPH_EXT_URI.toUpperCase()) {
|
|
20894
|
-
return false;
|
|
20895
|
-
}
|
|
20896
|
-
for (const key of Object.keys(ext)) {
|
|
20897
|
-
if (key.startsWith("@_")) {
|
|
20898
|
-
continue;
|
|
20899
|
-
}
|
|
20900
|
-
if (this.getXmlLocalName(key) === "morph") {
|
|
20901
|
-
return false;
|
|
20902
|
-
}
|
|
20903
|
-
}
|
|
20904
|
-
return true;
|
|
20905
|
-
});
|
|
20906
|
-
const allExts = [morphExt, ...otherExts];
|
|
20907
|
-
return { "p:ext": allExts.length === 1 ? allExts[0] : allExts };
|
|
20908
|
-
}
|
|
20909
21003
|
};
|
|
20910
21004
|
var PRESET_TO_OOXML = {
|
|
20911
21005
|
// ---- Entrance effects (typed `PptxAnimationPreset` names) ----
|
|
@@ -22048,7 +22142,7 @@ var PptxAnimationWriteService = class {
|
|
|
22048
22142
|
if (currentGroup.length > 0) {
|
|
22049
22143
|
clickGroups.push(currentGroup);
|
|
22050
22144
|
}
|
|
22051
|
-
const nodes = clickGroups.map((
|
|
22145
|
+
const nodes = clickGroups.map((group2) => {
|
|
22052
22146
|
const groupId = this.allocateId();
|
|
22053
22147
|
return {
|
|
22054
22148
|
"p:cTn": {
|
|
@@ -22060,7 +22154,7 @@ var PptxAnimationWriteService = class {
|
|
|
22060
22154
|
}
|
|
22061
22155
|
},
|
|
22062
22156
|
"p:childTnLst": {
|
|
22063
|
-
"p:par":
|
|
22157
|
+
"p:par": group2.length === 1 ? group2[0] : group2
|
|
22064
22158
|
}
|
|
22065
22159
|
}
|
|
22066
22160
|
};
|
|
@@ -23851,17 +23945,20 @@ var stripedRightArrow = {
|
|
|
23851
23945
|
name: "stripedRightArrow",
|
|
23852
23946
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
23853
23947
|
gdLst: [
|
|
23948
|
+
// Head length runs off `ss`, the short side, not `w`. See the note on
|
|
23949
|
+
// `rightArrow` in `preset-shape-definitions-table.ts`.
|
|
23950
|
+
gd3("maxAdj2", "*/ 84375 w ss"),
|
|
23854
23951
|
gd3("a1", "pin 0 adj1 100000"),
|
|
23855
|
-
gd3("a2", "pin 0 adj2
|
|
23952
|
+
gd3("a2", "pin 0 adj2 maxAdj2"),
|
|
23856
23953
|
gd3("y1", "*/ hd2 a1 100000"),
|
|
23857
23954
|
gd3("y2", "+- vc 0 y1"),
|
|
23858
23955
|
gd3("y3", "+- vc y1 0"),
|
|
23859
23956
|
gd3("x2", "*/ ss 1 32"),
|
|
23860
23957
|
gd3("x3", "*/ ss 2 32"),
|
|
23861
23958
|
gd3("x4", "*/ ss 5 32"),
|
|
23862
|
-
gd3("x5", "*/
|
|
23959
|
+
gd3("x5", "*/ ss a2 100000"),
|
|
23863
23960
|
gd3("x6", "+- r 0 x5"),
|
|
23864
|
-
gd3("dx", "*/
|
|
23961
|
+
gd3("dx", "*/ y1 x5 hd2"),
|
|
23865
23962
|
gd3("x7", "+- x6 dx 0")
|
|
23866
23963
|
],
|
|
23867
23964
|
rect: { l: "x4", t: "y2", r: "x7", b: "y3" },
|
|
@@ -23896,14 +23993,17 @@ var notchedRightArrow = {
|
|
|
23896
23993
|
name: "notchedRightArrow",
|
|
23897
23994
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
23898
23995
|
gdLst: [
|
|
23996
|
+
// Head length runs off `ss`, the short side, not `w`. See the note on
|
|
23997
|
+
// `rightArrow` in `preset-shape-definitions-table.ts`.
|
|
23998
|
+
gd3("maxAdj2", "*/ 100000 w ss"),
|
|
23899
23999
|
gd3("a1", "pin 0 adj1 100000"),
|
|
23900
|
-
gd3("a2", "pin 0 adj2
|
|
24000
|
+
gd3("a2", "pin 0 adj2 maxAdj2"),
|
|
23901
24001
|
gd3("y1", "*/ hd2 a1 100000"),
|
|
23902
24002
|
gd3("y2", "+- vc 0 y1"),
|
|
23903
24003
|
gd3("y3", "+- vc y1 0"),
|
|
23904
|
-
gd3("x2", "*/
|
|
24004
|
+
gd3("x2", "*/ ss a2 100000"),
|
|
23905
24005
|
gd3("x1", "+- r 0 x2"),
|
|
23906
|
-
gd3("dx2", "*/
|
|
24006
|
+
gd3("dx2", "*/ y1 x2 hd2"),
|
|
23907
24007
|
gd3("x3", "+- x1 dx2 0"),
|
|
23908
24008
|
gd3("nx", "*/ y1 1 1")
|
|
23909
24009
|
],
|
|
@@ -23927,7 +24027,12 @@ var notchedRightArrow = {
|
|
|
23927
24027
|
var homePlate = {
|
|
23928
24028
|
name: "homePlate",
|
|
23929
24029
|
avLst: { adj: 5e4 },
|
|
23930
|
-
gdLst: [
|
|
24030
|
+
gdLst: [
|
|
24031
|
+
gd3("maxAdj", "*/ 100000 w ss"),
|
|
24032
|
+
gd3("a", "pin 0 adj maxAdj"),
|
|
24033
|
+
gd3("dx1", "*/ ss a 100000"),
|
|
24034
|
+
gd3("x1", "+- r 0 dx1")
|
|
24035
|
+
],
|
|
23931
24036
|
rect: { l: "l", t: "t", r: "x1", b: "b" },
|
|
23932
24037
|
pathLst: [
|
|
23933
24038
|
{
|
|
@@ -23945,8 +24050,13 @@ var homePlate = {
|
|
|
23945
24050
|
var chevron = {
|
|
23946
24051
|
name: "chevron",
|
|
23947
24052
|
avLst: { adj: 5e4 },
|
|
23948
|
-
gdLst: [
|
|
23949
|
-
|
|
24053
|
+
gdLst: [
|
|
24054
|
+
gd3("maxAdj", "*/ 100000 w ss"),
|
|
24055
|
+
gd3("a", "pin 0 adj maxAdj"),
|
|
24056
|
+
gd3("x1", "*/ ss a 100000"),
|
|
24057
|
+
gd3("x2", "+- r 0 x1")
|
|
24058
|
+
],
|
|
24059
|
+
rect: { l: "x1", t: "t", r: "x2", b: "b" },
|
|
23950
24060
|
pathLst: [
|
|
23951
24061
|
{
|
|
23952
24062
|
commands: [
|
|
@@ -29032,27 +29142,28 @@ var rightArrow = {
|
|
|
29032
29142
|
name: "rightArrow",
|
|
29033
29143
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
29034
29144
|
gdLst: [
|
|
29145
|
+
gd13("maxAdj2", "*/ 100000 w ss"),
|
|
29035
29146
|
gd13("a1", "pin 0 adj1 100000"),
|
|
29036
|
-
gd13("a2", "pin 0 adj2
|
|
29037
|
-
gd13("
|
|
29038
|
-
gd13("
|
|
29039
|
-
gd13("
|
|
29040
|
-
gd13("
|
|
29041
|
-
gd13("
|
|
29042
|
-
gd13("dx2", "*/
|
|
29043
|
-
gd13("
|
|
29147
|
+
gd13("a2", "pin 0 adj2 maxAdj2"),
|
|
29148
|
+
gd13("dx1", "*/ ss a2 100000"),
|
|
29149
|
+
gd13("x1", "+- r 0 dx1"),
|
|
29150
|
+
gd13("dy1", "*/ h a1 200000"),
|
|
29151
|
+
gd13("y1", "+- vc 0 dy1"),
|
|
29152
|
+
gd13("y2", "+- vc dy1 0"),
|
|
29153
|
+
gd13("dx2", "*/ y1 dx1 hd2"),
|
|
29154
|
+
gd13("x2", "+- x1 dx2 0")
|
|
29044
29155
|
],
|
|
29045
|
-
rect: { l: "l", t: "
|
|
29156
|
+
rect: { l: "l", t: "y1", r: "x2", b: "y2" },
|
|
29046
29157
|
pathLst: [
|
|
29047
29158
|
{
|
|
29048
29159
|
commands: [
|
|
29049
|
-
{ kind: "moveTo", x: "l", y: "
|
|
29050
|
-
{ kind: "lnTo", x: "x1", y: "
|
|
29160
|
+
{ kind: "moveTo", x: "l", y: "y1" },
|
|
29161
|
+
{ kind: "lnTo", x: "x1", y: "y1" },
|
|
29051
29162
|
{ kind: "lnTo", x: "x1", y: "t" },
|
|
29052
29163
|
{ kind: "lnTo", x: "r", y: "vc" },
|
|
29053
29164
|
{ kind: "lnTo", x: "x1", y: "b" },
|
|
29054
|
-
{ kind: "lnTo", x: "x1", y: "
|
|
29055
|
-
{ kind: "lnTo", x: "l", y: "
|
|
29165
|
+
{ kind: "lnTo", x: "x1", y: "y2" },
|
|
29166
|
+
{ kind: "lnTo", x: "l", y: "y2" },
|
|
29056
29167
|
{ kind: "close" }
|
|
29057
29168
|
]
|
|
29058
29169
|
}
|
|
@@ -29062,26 +29173,28 @@ var leftArrow = {
|
|
|
29062
29173
|
name: "leftArrow",
|
|
29063
29174
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
29064
29175
|
gdLst: [
|
|
29176
|
+
gd13("maxAdj2", "*/ 100000 w ss"),
|
|
29065
29177
|
gd13("a1", "pin 0 adj1 100000"),
|
|
29066
|
-
gd13("a2", "pin 0 adj2
|
|
29067
|
-
gd13("
|
|
29068
|
-
gd13("
|
|
29069
|
-
gd13("
|
|
29070
|
-
gd13("
|
|
29071
|
-
gd13("
|
|
29072
|
-
gd13("
|
|
29178
|
+
gd13("a2", "pin 0 adj2 maxAdj2"),
|
|
29179
|
+
gd13("dx2", "*/ ss a2 100000"),
|
|
29180
|
+
gd13("x2", "+- l dx2 0"),
|
|
29181
|
+
gd13("dy1", "*/ h a1 200000"),
|
|
29182
|
+
gd13("y1", "+- vc 0 dy1"),
|
|
29183
|
+
gd13("y2", "+- vc dy1 0"),
|
|
29184
|
+
gd13("dx1", "*/ y1 dx2 hd2"),
|
|
29185
|
+
gd13("x1", "+- dx2 0 dx1")
|
|
29073
29186
|
],
|
|
29074
|
-
rect: { l: "
|
|
29187
|
+
rect: { l: "x1", t: "y1", r: "r", b: "y2" },
|
|
29075
29188
|
pathLst: [
|
|
29076
29189
|
{
|
|
29077
29190
|
commands: [
|
|
29078
29191
|
{ kind: "moveTo", x: "l", y: "vc" },
|
|
29079
|
-
{ kind: "lnTo", x: "
|
|
29080
|
-
{ kind: "lnTo", x: "
|
|
29192
|
+
{ kind: "lnTo", x: "x2", y: "t" },
|
|
29193
|
+
{ kind: "lnTo", x: "x2", y: "y1" },
|
|
29194
|
+
{ kind: "lnTo", x: "r", y: "y1" },
|
|
29081
29195
|
{ kind: "lnTo", x: "r", y: "y2" },
|
|
29082
|
-
{ kind: "lnTo", x: "
|
|
29083
|
-
{ kind: "lnTo", x: "
|
|
29084
|
-
{ kind: "lnTo", x: "x1", y: "b" },
|
|
29196
|
+
{ kind: "lnTo", x: "x2", y: "y2" },
|
|
29197
|
+
{ kind: "lnTo", x: "x2", y: "b" },
|
|
29085
29198
|
{ kind: "close" }
|
|
29086
29199
|
]
|
|
29087
29200
|
}
|
|
@@ -29091,26 +29204,28 @@ var upArrow = {
|
|
|
29091
29204
|
name: "upArrow",
|
|
29092
29205
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
29093
29206
|
gdLst: [
|
|
29207
|
+
gd13("maxAdj2", "*/ 100000 h ss"),
|
|
29094
29208
|
gd13("a1", "pin 0 adj1 100000"),
|
|
29095
|
-
gd13("a2", "pin 0 adj2
|
|
29096
|
-
gd13("
|
|
29097
|
-
gd13("
|
|
29098
|
-
gd13("
|
|
29099
|
-
gd13("
|
|
29100
|
-
gd13("
|
|
29101
|
-
gd13("
|
|
29209
|
+
gd13("a2", "pin 0 adj2 maxAdj2"),
|
|
29210
|
+
gd13("dy2", "*/ ss a2 100000"),
|
|
29211
|
+
gd13("y2", "+- t dy2 0"),
|
|
29212
|
+
gd13("dx1", "*/ w a1 200000"),
|
|
29213
|
+
gd13("x1", "+- hc 0 dx1"),
|
|
29214
|
+
gd13("x2", "+- hc dx1 0"),
|
|
29215
|
+
gd13("dy1", "*/ x1 dy2 wd2"),
|
|
29216
|
+
gd13("y1", "+- y2 0 dy1")
|
|
29102
29217
|
],
|
|
29103
|
-
rect: { l: "
|
|
29218
|
+
rect: { l: "x1", t: "y1", r: "x2", b: "b" },
|
|
29104
29219
|
pathLst: [
|
|
29105
29220
|
{
|
|
29106
29221
|
commands: [
|
|
29107
|
-
{ kind: "moveTo", x: "
|
|
29222
|
+
{ kind: "moveTo", x: "l", y: "y2" },
|
|
29223
|
+
{ kind: "lnTo", x: "hc", y: "t" },
|
|
29108
29224
|
{ kind: "lnTo", x: "r", y: "y2" },
|
|
29109
|
-
{ kind: "lnTo", x: "x3", y: "y2" },
|
|
29110
|
-
{ kind: "lnTo", x: "x3", y: "b" },
|
|
29111
|
-
{ kind: "lnTo", x: "x2", y: "b" },
|
|
29112
29225
|
{ kind: "lnTo", x: "x2", y: "y2" },
|
|
29113
|
-
{ kind: "lnTo", x: "
|
|
29226
|
+
{ kind: "lnTo", x: "x2", y: "b" },
|
|
29227
|
+
{ kind: "lnTo", x: "x1", y: "b" },
|
|
29228
|
+
{ kind: "lnTo", x: "x1", y: "y2" },
|
|
29114
29229
|
{ kind: "close" }
|
|
29115
29230
|
]
|
|
29116
29231
|
}
|
|
@@ -29120,26 +29235,27 @@ var downArrow = {
|
|
|
29120
29235
|
name: "downArrow",
|
|
29121
29236
|
avLst: { adj1: 5e4, adj2: 5e4 },
|
|
29122
29237
|
gdLst: [
|
|
29238
|
+
gd13("maxAdj2", "*/ 100000 h ss"),
|
|
29123
29239
|
gd13("a1", "pin 0 adj1 100000"),
|
|
29124
|
-
gd13("a2", "pin 0 adj2
|
|
29125
|
-
gd13("
|
|
29126
|
-
gd13("
|
|
29127
|
-
gd13("
|
|
29128
|
-
gd13("
|
|
29129
|
-
gd13("
|
|
29130
|
-
gd13("dy2", "*/
|
|
29131
|
-
gd13("
|
|
29240
|
+
gd13("a2", "pin 0 adj2 maxAdj2"),
|
|
29241
|
+
gd13("dy1", "*/ ss a2 100000"),
|
|
29242
|
+
gd13("y1", "+- b 0 dy1"),
|
|
29243
|
+
gd13("dx1", "*/ w a1 200000"),
|
|
29244
|
+
gd13("x1", "+- hc 0 dx1"),
|
|
29245
|
+
gd13("x2", "+- hc dx1 0"),
|
|
29246
|
+
gd13("dy2", "*/ x1 dy1 wd2"),
|
|
29247
|
+
gd13("y2", "+- b 0 dy2")
|
|
29132
29248
|
],
|
|
29133
|
-
rect: { l: "
|
|
29249
|
+
rect: { l: "x1", t: "t", r: "x2", b: "y2" },
|
|
29134
29250
|
pathLst: [
|
|
29135
29251
|
{
|
|
29136
29252
|
commands: [
|
|
29137
|
-
{ kind: "moveTo", x: "l", y: "
|
|
29138
|
-
{ kind: "lnTo", x: "
|
|
29253
|
+
{ kind: "moveTo", x: "l", y: "y1" },
|
|
29254
|
+
{ kind: "lnTo", x: "x1", y: "y1" },
|
|
29255
|
+
{ kind: "lnTo", x: "x1", y: "t" },
|
|
29139
29256
|
{ kind: "lnTo", x: "x2", y: "t" },
|
|
29140
|
-
{ kind: "lnTo", x: "
|
|
29141
|
-
{ kind: "lnTo", x: "
|
|
29142
|
-
{ kind: "lnTo", x: "r", y: "y2" },
|
|
29257
|
+
{ kind: "lnTo", x: "x2", y: "y1" },
|
|
29258
|
+
{ kind: "lnTo", x: "r", y: "y1" },
|
|
29143
29259
|
{ kind: "lnTo", x: "hc", y: "b" },
|
|
29144
29260
|
{ kind: "close" }
|
|
29145
29261
|
]
|
|
@@ -32319,8 +32435,8 @@ function extractSectionMap(presentationData, lookup) {
|
|
|
32319
32435
|
const orderedSections = [];
|
|
32320
32436
|
const presentation = presentationData ? lookup.getChildByLocalName(presentationData, "presentation") : void 0;
|
|
32321
32437
|
const sectionList = findSectionList2(presentation, lookup);
|
|
32322
|
-
const
|
|
32323
|
-
|
|
32438
|
+
const sections2 = lookup.getChildrenArrayByLocalName(sectionList, "section");
|
|
32439
|
+
sections2.forEach((section, index) => {
|
|
32324
32440
|
const sectionId = String(section["@_id"] || `section-${index + 1}`);
|
|
32325
32441
|
const rawName = String(section["@_name"] || "").trim();
|
|
32326
32442
|
const sectionName = rawName || `Section ${index + 1}`;
|
|
@@ -32795,8 +32911,8 @@ function scalar(parent, name, xmlLookup) {
|
|
|
32795
32911
|
return node?.["#text"] === void 0 ? void 0 : String(node["#text"]);
|
|
32796
32912
|
}
|
|
32797
32913
|
function parseSeriesDataLabels(seriesNode, xmlLookup) {
|
|
32798
|
-
const
|
|
32799
|
-
const nodes =
|
|
32914
|
+
const group2 = xmlLookup.getChildByLocalName(seriesNode, "dLbls");
|
|
32915
|
+
const nodes = group2 ? xmlLookup.getChildrenArrayByLocalName(group2, "dLbl") : xmlLookup.getChildrenArrayByLocalName(seriesNode, "dLbl");
|
|
32800
32916
|
return nodes.flatMap((node) => {
|
|
32801
32917
|
const idx = uint32(xmlLookup.getChildByLocalName(node, "idx")?.["@_val"]);
|
|
32802
32918
|
if (idx === void 0) {
|
|
@@ -32841,7 +32957,7 @@ function parseSeriesDataLabels(seriesNode, xmlLookup) {
|
|
|
32841
32957
|
return [result];
|
|
32842
32958
|
});
|
|
32843
32959
|
}
|
|
32844
|
-
function parseChartDataLabelOptions(
|
|
32960
|
+
function parseChartDataLabelOptions(group2, xmlLookup) {
|
|
32845
32961
|
const result = {};
|
|
32846
32962
|
const fields = [
|
|
32847
32963
|
["showVal", "showValue"],
|
|
@@ -32853,16 +32969,16 @@ function parseChartDataLabelOptions(group, xmlLookup) {
|
|
|
32853
32969
|
["showLeaderLines", "showLeaderLines"]
|
|
32854
32970
|
];
|
|
32855
32971
|
for (const [xmlName, property] of fields) {
|
|
32856
|
-
const value = bool(xmlLookup.getChildByLocalName(
|
|
32972
|
+
const value = bool(xmlLookup.getChildByLocalName(group2, xmlName));
|
|
32857
32973
|
if (value !== void 0) {
|
|
32858
32974
|
result[property] = value;
|
|
32859
32975
|
}
|
|
32860
32976
|
}
|
|
32861
|
-
const pos2 = position(xmlLookup.getChildByLocalName(
|
|
32977
|
+
const pos2 = position(xmlLookup.getChildByLocalName(group2, "dLblPos"));
|
|
32862
32978
|
if (pos2) {
|
|
32863
32979
|
result.position = pos2;
|
|
32864
32980
|
}
|
|
32865
|
-
const separator = scalar(
|
|
32981
|
+
const separator = scalar(group2, "separator", xmlLookup);
|
|
32866
32982
|
if (separator !== void 0) {
|
|
32867
32983
|
result.separator = separator;
|
|
32868
32984
|
}
|
|
@@ -38182,12 +38298,12 @@ function layoutGroupedList(nodes, bounds, themeColorMap) {
|
|
|
38182
38298
|
const usableW = bounds.width - padding * 2;
|
|
38183
38299
|
const groupW = (usableW - gap * (groups.length - 1)) / groups.length;
|
|
38184
38300
|
const usableH = bounds.height - padding * 2;
|
|
38185
|
-
groups.forEach((
|
|
38301
|
+
groups.forEach((group2, gi) => {
|
|
38186
38302
|
const fill = accentColor(gi, themeColorMap);
|
|
38187
38303
|
const gx = bounds.x + padding + gi * (groupW + gap);
|
|
38188
38304
|
const headerH = usableH * 0.2;
|
|
38189
38305
|
const subItemGap = 3;
|
|
38190
|
-
const subItemH = (usableH - headerH - 4 - subItemGap * (
|
|
38306
|
+
const subItemH = (usableH - headerH - 4 - subItemGap * (group2.length - 1)) / group2.length;
|
|
38191
38307
|
elements2.push(
|
|
38192
38308
|
makeShapeElement(
|
|
38193
38309
|
nextId("sa-grp-header"),
|
|
@@ -38205,7 +38321,7 @@ function layoutGroupedList(nodes, bounds, themeColorMap) {
|
|
|
38205
38321
|
}
|
|
38206
38322
|
)
|
|
38207
38323
|
);
|
|
38208
|
-
|
|
38324
|
+
group2.forEach((node, si) => {
|
|
38209
38325
|
const sy = bounds.y + padding + headerH + 4 + si * (subItemH + subItemGap);
|
|
38210
38326
|
elements2.push(
|
|
38211
38327
|
makeShapeElement(
|
|
@@ -41486,6 +41602,23 @@ var GENERIC_FAMILY_CONCRETE_FONTS = {
|
|
|
41486
41602
|
cursive: ["Comic Sans MS", "cursive"],
|
|
41487
41603
|
fantasy: ["Impact", "fantasy"]
|
|
41488
41604
|
};
|
|
41605
|
+
function parsePanoseString(panoseStr) {
|
|
41606
|
+
if (!panoseStr) {
|
|
41607
|
+
return void 0;
|
|
41608
|
+
}
|
|
41609
|
+
const cleaned = panoseStr.trim();
|
|
41610
|
+
if (cleaned.length !== 20) {
|
|
41611
|
+
return void 0;
|
|
41612
|
+
}
|
|
41613
|
+
if (!/^[0-9a-fA-F]{20}$/.test(cleaned)) {
|
|
41614
|
+
return void 0;
|
|
41615
|
+
}
|
|
41616
|
+
const bytes = [];
|
|
41617
|
+
for (let i = 0; i < 20; i += 2) {
|
|
41618
|
+
bytes.push(parseInt(cleaned.substring(i, i + 2), 16));
|
|
41619
|
+
}
|
|
41620
|
+
return bytes;
|
|
41621
|
+
}
|
|
41489
41622
|
function classifyPanose(panose) {
|
|
41490
41623
|
if (!panose || panose.length < 4) {
|
|
41491
41624
|
return "sans-serif";
|
|
@@ -47145,6 +47278,16 @@ function parseCtnMediaTiming(cTn, mediaTag) {
|
|
|
47145
47278
|
}
|
|
47146
47279
|
return { trimStartMs, trimEndMs, loop, autoPlay, playAcrossSlides };
|
|
47147
47280
|
}
|
|
47281
|
+
function resolvePlayAcrossSlides(cMediaNode, ctnPlayAcrossSlides, mediaTag) {
|
|
47282
|
+
if (ctnPlayAcrossSlides) {
|
|
47283
|
+
return true;
|
|
47284
|
+
}
|
|
47285
|
+
if (mediaTag !== "p:audio") {
|
|
47286
|
+
return false;
|
|
47287
|
+
}
|
|
47288
|
+
const numSld = Number.parseInt(String(cMediaNode["@_numSld"] ?? ""), 10);
|
|
47289
|
+
return Number.isFinite(numSld) && numSld > 1;
|
|
47290
|
+
}
|
|
47148
47291
|
function parseMediaExtensionData(mediaNode, cMediaNode, shapeId, ensureArray17) {
|
|
47149
47292
|
let fadeInDuration;
|
|
47150
47293
|
let fadeOutDuration;
|
|
@@ -48605,6 +48748,11 @@ var PptxHandlerRuntime6 = class extends PptxHandlerRuntime5 {
|
|
|
48605
48748
|
}
|
|
48606
48749
|
}
|
|
48607
48750
|
const hideWhenNotPlaying = cMediaNode["@_showWhenStopped"] === "0";
|
|
48751
|
+
const playAcrossSlides = resolvePlayAcrossSlides(
|
|
48752
|
+
cMediaNode,
|
|
48753
|
+
timing.playAcrossSlides,
|
|
48754
|
+
mediaTag
|
|
48755
|
+
);
|
|
48608
48756
|
let posterFramePath;
|
|
48609
48757
|
const posterRId = cMediaNode["@_posterFrame"];
|
|
48610
48758
|
if (posterRId) {
|
|
@@ -48629,7 +48777,7 @@ var PptxHandlerRuntime6 = class extends PptxHandlerRuntime5 {
|
|
|
48629
48777
|
fadeInDuration: extData.fadeInDuration,
|
|
48630
48778
|
fadeOutDuration: extData.fadeOutDuration,
|
|
48631
48779
|
autoPlay: timing.autoPlay || void 0,
|
|
48632
|
-
playAcrossSlides:
|
|
48780
|
+
playAcrossSlides: playAcrossSlides || void 0,
|
|
48633
48781
|
hideWhenNotPlaying: hideWhenNotPlaying || void 0,
|
|
48634
48782
|
bookmarks: extData.bookmarks.length > 0 ? extData.bookmarks : void 0,
|
|
48635
48783
|
playbackSpeed: extData.playbackSpeed,
|
|
@@ -48666,7 +48814,7 @@ var PptxHandlerRuntime6 = class extends PptxHandlerRuntime5 {
|
|
|
48666
48814
|
extractMediaTimingMap(slideXml2, slidePath) {
|
|
48667
48815
|
const result = /* @__PURE__ */ new Map();
|
|
48668
48816
|
try {
|
|
48669
|
-
const timing = slideXml2?.["p:sld"]
|
|
48817
|
+
const timing = resolveSlideTimingNode(slideXml2?.["p:sld"]);
|
|
48670
48818
|
if (!timing) {
|
|
48671
48819
|
return result;
|
|
48672
48820
|
}
|
|
@@ -49653,6 +49801,29 @@ var PptxHandlerRuntime10 = class extends PptxHandlerRuntime9 {
|
|
|
49653
49801
|
return void 0;
|
|
49654
49802
|
}
|
|
49655
49803
|
}
|
|
49804
|
+
/**
|
|
49805
|
+
* Resolve the `c:spPr` fill of a chart container (`c:chartSpace` or
|
|
49806
|
+
* `c:plotArea`) to a colour string, or the literal `'none'` for
|
|
49807
|
+
* `<a:noFill/>`. Returns `undefined` when the container declares no fill at
|
|
49808
|
+
* all, which leaves the choice to the renderer.
|
|
49809
|
+
*
|
|
49810
|
+
* `<a:noFill/>` parses to the empty STRING, so presence - not truthiness -
|
|
49811
|
+
* has to decide.
|
|
49812
|
+
*/
|
|
49813
|
+
parseChartContainerFill(container) {
|
|
49814
|
+
const shapeProperties = this.xmlLookupService.getChildByLocalName(container, "spPr");
|
|
49815
|
+
if (!shapeProperties) {
|
|
49816
|
+
return void 0;
|
|
49817
|
+
}
|
|
49818
|
+
const hasNoFill = Object.keys(shapeProperties).some(
|
|
49819
|
+
(key) => this.compatibilityService.getXmlLocalName(key) === "noFill"
|
|
49820
|
+
);
|
|
49821
|
+
if (hasNoFill) {
|
|
49822
|
+
return "none";
|
|
49823
|
+
}
|
|
49824
|
+
const solidFill2 = this.xmlLookupService.getChildByLocalName(shapeProperties, "solidFill");
|
|
49825
|
+
return solidFill2 ? this.parseColor(solidFill2) : void 0;
|
|
49826
|
+
}
|
|
49656
49827
|
/**
|
|
49657
49828
|
* Extract chart style metadata from chart XML.
|
|
49658
49829
|
*/
|
|
@@ -49667,6 +49838,11 @@ var PptxHandlerRuntime10 = class extends PptxHandlerRuntime9 {
|
|
|
49667
49838
|
style.styleId = parseInt(String(styleNode["@_val"]));
|
|
49668
49839
|
hasStyle = true;
|
|
49669
49840
|
}
|
|
49841
|
+
const chartAreaFill2 = this.parseChartContainerFill(chartSpace);
|
|
49842
|
+
if (chartAreaFill2) {
|
|
49843
|
+
style.chartAreaFill = chartAreaFill2;
|
|
49844
|
+
hasStyle = true;
|
|
49845
|
+
}
|
|
49670
49846
|
if (chartRoot) {
|
|
49671
49847
|
const legend = this.xmlLookupService.getChildByLocalName(chartRoot, "legend");
|
|
49672
49848
|
if (legend) {
|
|
@@ -49692,6 +49868,11 @@ var PptxHandlerRuntime10 = class extends PptxHandlerRuntime9 {
|
|
|
49692
49868
|
}
|
|
49693
49869
|
const plotArea = this.xmlLookupService.getChildByLocalName(chartRoot, "plotArea");
|
|
49694
49870
|
if (plotArea) {
|
|
49871
|
+
const plotAreaFill2 = this.parseChartContainerFill(plotArea);
|
|
49872
|
+
if (plotAreaFill2) {
|
|
49873
|
+
style.plotAreaFill = plotAreaFill2;
|
|
49874
|
+
hasStyle = true;
|
|
49875
|
+
}
|
|
49695
49876
|
const valAx = this.xmlLookupService.getChildByLocalName(plotArea, "valAx");
|
|
49696
49877
|
if (valAx) {
|
|
49697
49878
|
const majorGridlines = this.xmlLookupService.getChildByLocalName(valAx, "majorGridlines");
|
|
@@ -51025,32 +51206,32 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime3 extends PptxHandlerRuntime
|
|
|
51025
51206
|
* Build a p:grpSp XML object from a GroupPptxElement.
|
|
51026
51207
|
* Children are stored with coordinates relative to the group origin.
|
|
51027
51208
|
*/
|
|
51028
|
-
buildGroupShapeXml(
|
|
51029
|
-
if (
|
|
51030
|
-
return
|
|
51209
|
+
buildGroupShapeXml(group2) {
|
|
51210
|
+
if (group2.rawXml && group2.children.length === 0) {
|
|
51211
|
+
return group2.rawXml;
|
|
51031
51212
|
}
|
|
51032
51213
|
const EMU = _PptxHandlerRuntime3.EMU_PER_PX;
|
|
51033
|
-
const offX = Math.round(
|
|
51034
|
-
const offY = Math.round(
|
|
51035
|
-
const extCx = Math.round(
|
|
51036
|
-
const extCy = Math.round(
|
|
51214
|
+
const offX = Math.round(group2.x * EMU);
|
|
51215
|
+
const offY = Math.round(group2.y * EMU);
|
|
51216
|
+
const extCx = Math.round(group2.width * EMU);
|
|
51217
|
+
const extCy = Math.round(group2.height * EMU);
|
|
51037
51218
|
const chOffX = 0;
|
|
51038
51219
|
const chOffY = 0;
|
|
51039
51220
|
const chExtCx = extCx;
|
|
51040
51221
|
const chExtCy = extCy;
|
|
51041
51222
|
const xfrmAttrs = {};
|
|
51042
|
-
if (typeof
|
|
51043
|
-
xfrmAttrs["@_rot"] = String(Math.round(
|
|
51223
|
+
if (typeof group2.rotation === "number" && group2.rotation !== 0) {
|
|
51224
|
+
xfrmAttrs["@_rot"] = String(Math.round(group2.rotation * 6e4));
|
|
51044
51225
|
}
|
|
51045
|
-
if (
|
|
51226
|
+
if (group2.flipHorizontal) {
|
|
51046
51227
|
xfrmAttrs["@_flipH"] = "1";
|
|
51047
51228
|
}
|
|
51048
|
-
if (
|
|
51229
|
+
if (group2.flipVertical) {
|
|
51049
51230
|
xfrmAttrs["@_flipV"] = "1";
|
|
51050
51231
|
}
|
|
51051
51232
|
const grpXml = {
|
|
51052
51233
|
"p:nvGrpSpPr": {
|
|
51053
|
-
"p:cNvPr": { "@_id": "0", "@_name":
|
|
51234
|
+
"p:cNvPr": { "@_id": "0", "@_name": group2.id },
|
|
51054
51235
|
"p:cNvGrpSpPr": {},
|
|
51055
51236
|
"p:nvPr": {}
|
|
51056
51237
|
},
|
|
@@ -51079,7 +51260,7 @@ var PptxHandlerRuntime15 = class _PptxHandlerRuntime3 extends PptxHandlerRuntime
|
|
|
51079
51260
|
const childShapes = [];
|
|
51080
51261
|
const childPics = [];
|
|
51081
51262
|
const childConnectors = [];
|
|
51082
|
-
for (const child202 of
|
|
51263
|
+
for (const child202 of group2.children) {
|
|
51083
51264
|
let xml = child202.rawXml;
|
|
51084
51265
|
if (!xml && (child202.type === "text" || child202.type === "shape")) {
|
|
51085
51266
|
xml = this.createElementXml(child202);
|
|
@@ -58601,12 +58782,12 @@ var PptxHandlerRuntime37 = class _PptxHandlerRuntime13 extends PptxHandlerRuntim
|
|
|
58601
58782
|
updateSummaryFallback(shape, el, targets, relationships) {
|
|
58602
58783
|
const block = this.alternateContentBlockByRawXml.get(shape);
|
|
58603
58784
|
const fallback = block?.rawAc["mc:Fallback"];
|
|
58604
|
-
const
|
|
58605
|
-
if (!
|
|
58785
|
+
const group2 = fallback?.["p:grpSp"];
|
|
58786
|
+
if (!group2) {
|
|
58606
58787
|
return;
|
|
58607
58788
|
}
|
|
58608
|
-
const existing = this.ensureArray(
|
|
58609
|
-
|
|
58789
|
+
const existing = this.ensureArray(group2["p:pic"]);
|
|
58790
|
+
group2["p:pic"] = targets.map((target, index) => {
|
|
58610
58791
|
const tile = this.summaryTileElement(el, target, index);
|
|
58611
58792
|
const picture = existing[index] ?? this.buildZoomFallbackPicture(tile, relationships[index]);
|
|
58612
58793
|
this.applyZoomTransform(picture["p:spPr"] ??= {}, tile);
|
|
@@ -59992,7 +60173,7 @@ var PptxHandlerRuntime42 = class extends PptxHandlerRuntime41 {
|
|
|
59992
60173
|
*/
|
|
59993
60174
|
buildFontSchemeObject(schemeName, fontMap, majorScripts, minorScripts) {
|
|
59994
60175
|
const buildFontGroup = (latinKey, eaKey, csKey, scripts) => {
|
|
59995
|
-
const
|
|
60176
|
+
const group2 = {
|
|
59996
60177
|
"a:latin": { "@_typeface": fontMap[latinKey] || "Calibri" },
|
|
59997
60178
|
"a:ea": { "@_typeface": fontMap[eaKey] || "" },
|
|
59998
60179
|
"a:cs": { "@_typeface": fontMap[csKey] || "" }
|
|
@@ -60003,9 +60184,9 @@ var PptxHandlerRuntime42 = class extends PptxHandlerRuntime41 {
|
|
|
60003
60184
|
"@_script": script,
|
|
60004
60185
|
"@_typeface": scripts[script]
|
|
60005
60186
|
}));
|
|
60006
|
-
|
|
60187
|
+
group2["a:font"] = fontEntries.length === 1 ? fontEntries[0] : fontEntries;
|
|
60007
60188
|
}
|
|
60008
|
-
return
|
|
60189
|
+
return group2;
|
|
60009
60190
|
};
|
|
60010
60191
|
return {
|
|
60011
60192
|
"@_name": schemeName,
|
|
@@ -62194,31 +62375,35 @@ var PptxHandlerRuntime57 = class _PptxHandlerRuntime23 extends PptxHandlerRuntim
|
|
|
62194
62375
|
return normalized;
|
|
62195
62376
|
}
|
|
62196
62377
|
readImageCropFromBlipFill(blipFill) {
|
|
62378
|
+
const result = {};
|
|
62197
62379
|
const sourceRect = blipFill?.["a:srcRect"];
|
|
62198
62380
|
if (sourceRect) {
|
|
62199
|
-
|
|
62200
|
-
|
|
62201
|
-
|
|
62202
|
-
|
|
62203
|
-
return { cropLeft, cropTop, cropRight, cropBottom };
|
|
62381
|
+
result.cropLeft = this.parseCropFraction(sourceRect["@_l"]);
|
|
62382
|
+
result.cropTop = this.parseCropFraction(sourceRect["@_t"]);
|
|
62383
|
+
result.cropRight = this.parseCropFraction(sourceRect["@_r"]);
|
|
62384
|
+
result.cropBottom = this.parseCropFraction(sourceRect["@_b"]);
|
|
62204
62385
|
}
|
|
62205
62386
|
const stretchNode = blipFill?.["a:stretch"];
|
|
62206
62387
|
const fillRect = stretchNode?.["a:fillRect"];
|
|
62207
62388
|
if (fillRect) {
|
|
62208
|
-
|
|
62209
|
-
|
|
62210
|
-
|
|
62211
|
-
|
|
62212
|
-
if (l !== void 0 || t !== void 0 || r !== void 0 || b !== void 0) {
|
|
62213
|
-
return {
|
|
62214
|
-
cropLeft: l,
|
|
62215
|
-
cropTop: t,
|
|
62216
|
-
cropRight: r,
|
|
62217
|
-
cropBottom: b
|
|
62218
|
-
};
|
|
62219
|
-
}
|
|
62389
|
+
result.fillRectLeft = this.parseSignedRectFraction(fillRect["@_l"]);
|
|
62390
|
+
result.fillRectTop = this.parseSignedRectFraction(fillRect["@_t"]);
|
|
62391
|
+
result.fillRectRight = this.parseSignedRectFraction(fillRect["@_r"]);
|
|
62392
|
+
result.fillRectBottom = this.parseSignedRectFraction(fillRect["@_b"]);
|
|
62220
62393
|
}
|
|
62221
|
-
return
|
|
62394
|
+
return result;
|
|
62395
|
+
}
|
|
62396
|
+
/**
|
|
62397
|
+
* Parse a signed ST_Percentage rect offset (thousandths of a percent) to a
|
|
62398
|
+
* fraction. Unlike {@link parseCropFraction} the sign is preserved; the
|
|
62399
|
+
* magnitude is capped at 10x the frame to bound hostile input.
|
|
62400
|
+
*/
|
|
62401
|
+
parseSignedRectFraction(value) {
|
|
62402
|
+
const raw = Number.parseInt(String(value ?? ""), 10);
|
|
62403
|
+
if (!Number.isFinite(raw)) {
|
|
62404
|
+
return void 0;
|
|
62405
|
+
}
|
|
62406
|
+
return Math.max(-1e6, Math.min(1e6, raw)) / 1e5;
|
|
62222
62407
|
}
|
|
62223
62408
|
extractShapeStyle(spPr, styleNode) {
|
|
62224
62409
|
return this.shapeStyleExtractor.extractShapeStyle(spPr, styleNode);
|
|
@@ -63057,6 +63242,19 @@ var PptxHandlerRuntime61 = class _PptxHandlerRuntime25 extends PptxHandlerRuntim
|
|
|
63057
63242
|
}
|
|
63058
63243
|
};
|
|
63059
63244
|
var PptxHandlerRuntime62 = class _PptxHandlerRuntime26 extends PptxHandlerRuntime61 {
|
|
63245
|
+
/**
|
|
63246
|
+
* A copy of an `a:lstStyle` level entry without its `a:defRPr`: run
|
|
63247
|
+
* defaults follow their own precedence chain, so only the paragraph-level
|
|
63248
|
+
* keys (algn, lnSpc, spacing, margins, tabs) may join the pPr merge.
|
|
63249
|
+
*/
|
|
63250
|
+
withoutDefaultRunProperties(node) {
|
|
63251
|
+
if (!node || typeof node !== "object") {
|
|
63252
|
+
return void 0;
|
|
63253
|
+
}
|
|
63254
|
+
const copy2 = { ...node };
|
|
63255
|
+
delete copy2["a:defRPr"];
|
|
63256
|
+
return copy2;
|
|
63257
|
+
}
|
|
63060
63258
|
/**
|
|
63061
63259
|
* Extract a paragraph's OWN `a:pPr` geometry (align, spacing, margins,
|
|
63062
63260
|
* indent, tabs, rtl) as a partial {@link TextStyle} so per-paragraph
|
|
@@ -63120,10 +63318,26 @@ var PptxHandlerRuntime62 = class _PptxHandlerRuntime26 extends PptxHandlerRuntim
|
|
|
63120
63318
|
*/
|
|
63121
63319
|
resolveShapeParagraphStyle(p, textStyle, ctx) {
|
|
63122
63320
|
const inheritedParagraph = this.ensureArray(ctx.inheritedTxBody?.["a:p"])[0];
|
|
63123
|
-
const
|
|
63321
|
+
const directPPr = this.mergeXmlObjects(
|
|
63124
63322
|
inheritedParagraph?.["a:pPr"],
|
|
63125
63323
|
p["a:pPr"]
|
|
63126
63324
|
);
|
|
63325
|
+
const parsedLevel = Number.parseInt(String(directPPr?.["@_lvl"] ?? "0"), 10);
|
|
63326
|
+
const level = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
|
|
63327
|
+
const levelKey = `a:lvl${level + 1}pPr`;
|
|
63328
|
+
const ownLstStyle = ctx.txBody?.["a:lstStyle"];
|
|
63329
|
+
const inheritedLstStyle = ctx.inheritedTxBody?.["a:lstStyle"];
|
|
63330
|
+
const lstStyleParagraphDefaults = this.mergeXmlObjects(
|
|
63331
|
+
this.mergeXmlObjects(
|
|
63332
|
+
this.withoutDefaultRunProperties(inheritedLstStyle?.["a:defPPr"]),
|
|
63333
|
+
this.withoutDefaultRunProperties(inheritedLstStyle?.[levelKey])
|
|
63334
|
+
),
|
|
63335
|
+
this.mergeXmlObjects(
|
|
63336
|
+
this.withoutDefaultRunProperties(ownLstStyle?.["a:defPPr"]),
|
|
63337
|
+
this.withoutDefaultRunProperties(ownLstStyle?.[levelKey])
|
|
63338
|
+
)
|
|
63339
|
+
);
|
|
63340
|
+
const pPr = this.mergeXmlObjects(lstStyleParagraphDefaults, directPPr);
|
|
63127
63341
|
const paragraphRtl = this.parseOptionalBooleanAttr(pPr?.["@_rtl"]);
|
|
63128
63342
|
if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
|
|
63129
63343
|
textStyle.rtl = paragraphRtl;
|
|
@@ -63247,8 +63461,6 @@ var PptxHandlerRuntime62 = class _PptxHandlerRuntime26 extends PptxHandlerRuntim
|
|
|
63247
63461
|
ctx.slideRelationshipMap,
|
|
63248
63462
|
false
|
|
63249
63463
|
);
|
|
63250
|
-
const level = pPr?.["@_lvl"] === void 0 ? -1 : Number.parseInt(String(pPr["@_lvl"]), 10);
|
|
63251
|
-
const levelKey = level === -1 ? "a:defPPr" : `a:lvl${Number.isFinite(level) ? Math.min(Math.max(level + 1, 1), 9) : 1}pPr`;
|
|
63252
63464
|
const inheritedLevelStyle = this.extractTextRunStyle(
|
|
63253
63465
|
ctx.inheritedTxBody?.["a:lstStyle"]?.[levelKey]?.["a:defRPr"],
|
|
63254
63466
|
paraAlign,
|
|
@@ -63281,12 +63493,16 @@ var PptxHandlerRuntime62 = class _PptxHandlerRuntime26 extends PptxHandlerRuntim
|
|
|
63281
63493
|
mergedDefaultRunStyle.fontFamily = ctx.styleFontRefTypeface;
|
|
63282
63494
|
}
|
|
63283
63495
|
if (ctx.effectiveLevelStyles) {
|
|
63284
|
-
const
|
|
63285
|
-
const
|
|
63496
|
+
const phLevel = ctx.effectiveLevelStyles[level];
|
|
63497
|
+
const phBase = ctx.effectiveLevelStyles[-1];
|
|
63286
63498
|
if (phLevel) {
|
|
63287
63499
|
this.applyPlaceholderLevelDefaults(mergedDefaultRunStyle, phLevel);
|
|
63288
63500
|
this.applyPlaceholderLevelDefaults(textStyle, phLevel);
|
|
63289
63501
|
}
|
|
63502
|
+
if (phBase) {
|
|
63503
|
+
this.applyPlaceholderLevelDefaults(mergedDefaultRunStyle, phBase);
|
|
63504
|
+
this.applyPlaceholderLevelDefaults(textStyle, phBase);
|
|
63505
|
+
}
|
|
63290
63506
|
}
|
|
63291
63507
|
if (pPr?.["@_algn"] === void 0 && textStyle.align !== void 0) {
|
|
63292
63508
|
paraAlign = textStyle.align;
|
|
@@ -63296,15 +63512,13 @@ var PptxHandlerRuntime62 = class _PptxHandlerRuntime26 extends PptxHandlerRuntim
|
|
|
63296
63512
|
let effectiveMarginLeft = parMarginLeft;
|
|
63297
63513
|
let effectiveIndent = parIndent;
|
|
63298
63514
|
if (ctx.effectiveLevelStyles) {
|
|
63299
|
-
const
|
|
63300
|
-
const
|
|
63301
|
-
if (
|
|
63302
|
-
|
|
63303
|
-
|
|
63304
|
-
|
|
63305
|
-
|
|
63306
|
-
effectiveIndent = phLevel.indent;
|
|
63307
|
-
}
|
|
63515
|
+
const phLevel = ctx.effectiveLevelStyles[level];
|
|
63516
|
+
const phBase = ctx.effectiveLevelStyles[-1];
|
|
63517
|
+
if (effectiveMarginLeft === void 0) {
|
|
63518
|
+
effectiveMarginLeft = phLevel?.marginLeft ?? phBase?.marginLeft;
|
|
63519
|
+
}
|
|
63520
|
+
if (effectiveIndent === void 0) {
|
|
63521
|
+
effectiveIndent = phLevel?.indent ?? phBase?.indent;
|
|
63308
63522
|
}
|
|
63309
63523
|
}
|
|
63310
63524
|
return {
|
|
@@ -64638,7 +64852,7 @@ function parseEmuInt2(value) {
|
|
|
64638
64852
|
return parsed;
|
|
64639
64853
|
}
|
|
64640
64854
|
var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntime66 {
|
|
64641
|
-
async parseGroupShape(
|
|
64855
|
+
async parseGroupShape(group2, baseId, slidePath, rawXmlStr, depth = 0) {
|
|
64642
64856
|
if (depth > MAX_GROUP_DEPTH) {
|
|
64643
64857
|
this.compatibilityService.reportWarning({
|
|
64644
64858
|
code: "group-depth-exceeded",
|
|
@@ -64650,7 +64864,7 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64650
64864
|
});
|
|
64651
64865
|
return [];
|
|
64652
64866
|
}
|
|
64653
|
-
const grpSpPr =
|
|
64867
|
+
const grpSpPr = group2["p:grpSpPr"];
|
|
64654
64868
|
const xfrm = grpSpPr?.["a:xfrm"];
|
|
64655
64869
|
const EMU_PX = _PptxHandlerRuntime30.EMU_PER_PX;
|
|
64656
64870
|
let parentX = 0, parentY = 0, parentW = 0, parentH = 0;
|
|
@@ -64715,16 +64929,16 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64715
64929
|
}
|
|
64716
64930
|
return el;
|
|
64717
64931
|
};
|
|
64718
|
-
this.unwrapAlternateContent(
|
|
64932
|
+
this.unwrapAlternateContent(group2);
|
|
64719
64933
|
const childOrder3 = this.extractSpTreeChildOrder(
|
|
64720
64934
|
void 0,
|
|
64721
|
-
|
|
64935
|
+
group2,
|
|
64722
64936
|
"p:grpSp"
|
|
64723
64937
|
);
|
|
64724
64938
|
const elements2 = [];
|
|
64725
64939
|
for (const entry2 of childOrder3) {
|
|
64726
64940
|
if (entry2.tag === "p:grpSp") {
|
|
64727
|
-
const subArr = this.ensureArray(
|
|
64941
|
+
const subArr = this.ensureArray(group2["p:grpSp"]);
|
|
64728
64942
|
const subGroup = subArr[entry2.indexInType];
|
|
64729
64943
|
if (!subGroup) {
|
|
64730
64944
|
continue;
|
|
@@ -64742,12 +64956,12 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64742
64956
|
const element = await this.parseSpTreeChild(
|
|
64743
64957
|
entry2.tag,
|
|
64744
64958
|
entry2.indexInType,
|
|
64745
|
-
|
|
64959
|
+
group2,
|
|
64746
64960
|
slidePath,
|
|
64747
64961
|
`${baseId}-`
|
|
64748
64962
|
);
|
|
64749
64963
|
if (element) {
|
|
64750
|
-
const childNode2 = this.ensureArray(
|
|
64964
|
+
const childNode2 = this.ensureArray(group2[entry2.tag])[entry2.indexInType];
|
|
64751
64965
|
applyRawChildGeometry(element, childNode2);
|
|
64752
64966
|
transformElement(element);
|
|
64753
64967
|
elements2.push(element);
|
|
@@ -64760,8 +64974,8 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64760
64974
|
* Parse a p:grpSp element into a GroupPptxElement with children.
|
|
64761
64975
|
* Children have coordinates relative to the group's position.
|
|
64762
64976
|
*/
|
|
64763
|
-
async parseGroupShapeAsGroup(
|
|
64764
|
-
const grpSpPr =
|
|
64977
|
+
async parseGroupShapeAsGroup(group2, baseId, slidePath, rawXmlStr) {
|
|
64978
|
+
const grpSpPr = group2["p:grpSpPr"];
|
|
64765
64979
|
const xfrm = grpSpPr?.["a:xfrm"];
|
|
64766
64980
|
let parentX = 0, parentY = 0, parentW = 0, parentH = 0;
|
|
64767
64981
|
let groupRotation;
|
|
@@ -64787,7 +65001,7 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64787
65001
|
}
|
|
64788
65002
|
const grpFillStyle = grpSpPr ? this.extractShapeStyle(grpSpPr) : void 0;
|
|
64789
65003
|
const hasGroupFill = grpFillStyle && grpFillStyle.fillMode && grpFillStyle.fillMode !== "none";
|
|
64790
|
-
const children10 = await this.parseGroupShape(
|
|
65004
|
+
const children10 = await this.parseGroupShape(group2, baseId, slidePath, rawXmlStr);
|
|
64791
65005
|
if (children10.length === 0) {
|
|
64792
65006
|
return null;
|
|
64793
65007
|
}
|
|
@@ -64813,7 +65027,7 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64813
65027
|
child202.x -= parentX;
|
|
64814
65028
|
child202.y -= parentY;
|
|
64815
65029
|
}
|
|
64816
|
-
const grpCNvPr =
|
|
65030
|
+
const grpCNvPr = group2?.["p:nvGrpSpPr"]?.["p:cNvPr"];
|
|
64817
65031
|
const grpSlideRels = this.slideRelsMap.get(slidePath);
|
|
64818
65032
|
const { actionClick: grpActionClick, actionHover: grpActionHover } = this.parseElementActions(
|
|
64819
65033
|
grpCNvPr,
|
|
@@ -64833,7 +65047,7 @@ var PptxHandlerRuntime67 = class _PptxHandlerRuntime30 extends PptxHandlerRuntim
|
|
|
64833
65047
|
flipHorizontal: flipHorizontal || void 0,
|
|
64834
65048
|
flipVertical: flipVertical || void 0,
|
|
64835
65049
|
children: children10,
|
|
64836
|
-
rawXml:
|
|
65050
|
+
rawXml: group2,
|
|
64837
65051
|
actionClick: grpActionClick,
|
|
64838
65052
|
actionHover: grpActionHover,
|
|
64839
65053
|
groupFill: hasGroupFill ? grpFillStyle : void 0
|
|
@@ -66300,12 +66514,12 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
|
66300
66514
|
}
|
|
66301
66515
|
} else if (entry2.tag === "p:grpSp") {
|
|
66302
66516
|
const groups = this.ensureArray(spTree["p:grpSp"]);
|
|
66303
|
-
const
|
|
66304
|
-
if (!
|
|
66517
|
+
const group2 = groups[entry2.indexInType];
|
|
66518
|
+
if (!group2) {
|
|
66305
66519
|
continue;
|
|
66306
66520
|
}
|
|
66307
66521
|
const element = await this.parseGroupShapeAsGroup(
|
|
66308
|
-
|
|
66522
|
+
group2,
|
|
66309
66523
|
`master-group-${masterToken}-${entry2.indexInType}`,
|
|
66310
66524
|
masterPath
|
|
66311
66525
|
);
|
|
@@ -66522,12 +66736,12 @@ var PptxHandlerRuntime76 = class extends PptxHandlerRuntime75 {
|
|
|
66522
66736
|
}
|
|
66523
66737
|
} else if (entry2.tag === "p:grpSp") {
|
|
66524
66738
|
const groups = this.ensureArray(spTree["p:grpSp"]);
|
|
66525
|
-
const
|
|
66526
|
-
if (!
|
|
66739
|
+
const group2 = groups[entry2.indexInType];
|
|
66740
|
+
if (!group2) {
|
|
66527
66741
|
continue;
|
|
66528
66742
|
}
|
|
66529
66743
|
const element = await this.parseGroupShapeAsGroup(
|
|
66530
|
-
|
|
66744
|
+
group2,
|
|
66531
66745
|
`layout-group-${layoutToken}-${entry2.indexInType}`,
|
|
66532
66746
|
layoutPath
|
|
66533
66747
|
);
|
|
@@ -68404,16 +68618,16 @@ function extractDrawingShapeTextStyle(txBody, deps) {
|
|
|
68404
68618
|
}
|
|
68405
68619
|
return { fontSize, fontColor };
|
|
68406
68620
|
}
|
|
68407
|
-
function resolveSmartArtTextStyles(paragraphs,
|
|
68621
|
+
function resolveSmartArtTextStyles(paragraphs, resolve2) {
|
|
68408
68622
|
for (const paragraph of paragraphs ?? []) {
|
|
68409
68623
|
if (paragraph.endParaRPr) {
|
|
68410
|
-
paragraph.endParaStyle =
|
|
68624
|
+
paragraph.endParaStyle = resolve2(paragraph.endParaRPr);
|
|
68411
68625
|
}
|
|
68412
68626
|
for (const item of paragraph.items) {
|
|
68413
68627
|
if (item.kind === "run" && item.run.rPr) {
|
|
68414
|
-
item.run.style =
|
|
68628
|
+
item.run.style = resolve2(item.run.rPr);
|
|
68415
68629
|
} else if ((item.kind === "field" || item.kind === "break") && item.rPr) {
|
|
68416
|
-
item.style =
|
|
68630
|
+
item.style = resolve2(item.rPr);
|
|
68417
68631
|
}
|
|
68418
68632
|
}
|
|
68419
68633
|
}
|
|
@@ -69922,6 +70136,20 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
|
|
|
69922
70136
|
const hasBlanks = expanded.some((value) => value === null);
|
|
69923
70137
|
const values = hasBlanks ? expanded.map((value) => value ?? 0) : this.extractChartPointValues(valNode, true).map((value) => Number.parseFloat(value)).filter((value) => Number.isFinite(value));
|
|
69924
70138
|
const blanks = hasBlanks ? expanded.map((value) => value === null) : void 0;
|
|
70139
|
+
const seriesNumberFormat = String(
|
|
70140
|
+
this.xmlLookupService.getChildByLocalName(
|
|
70141
|
+
this.xmlLookupService.getChildByLocalName(seriesNode, "dLbls"),
|
|
70142
|
+
"numFmt"
|
|
70143
|
+
)?.["@_formatCode"] ?? ""
|
|
70144
|
+
).trim() || String(
|
|
70145
|
+
this.xmlLookupService.getScalarChildByLocalName(
|
|
70146
|
+
this.xmlLookupService.getChildByLocalName(
|
|
70147
|
+
this.xmlLookupService.getChildByLocalName(valNode, "numRef") ?? valNode,
|
|
70148
|
+
"numCache"
|
|
70149
|
+
),
|
|
70150
|
+
"formatCode"
|
|
70151
|
+
) ?? ""
|
|
70152
|
+
).trim();
|
|
69925
70153
|
const seriesShapeProperties = this.xmlLookupService.getChildByLocalName(seriesNode, "spPr");
|
|
69926
70154
|
const seriesColor23 = this.parseColor(
|
|
69927
70155
|
this.xmlLookupService.getChildByLocalName(seriesShapeProperties, "solidFill")
|
|
@@ -69953,6 +70181,7 @@ var PptxHandlerRuntime90 = class extends PptxHandlerRuntime89 {
|
|
|
69953
70181
|
name: seriesName.trim().length > 0 ? seriesName : `Series ${seriesIndex + 1}`,
|
|
69954
70182
|
values: fallbackValues,
|
|
69955
70183
|
...blanks ? { blanks } : {},
|
|
70184
|
+
...seriesNumberFormat ? { numberFormat: seriesNumberFormat } : {},
|
|
69956
70185
|
color: seriesColor23,
|
|
69957
70186
|
...trendlines.length > 0 ? { trendlines } : {},
|
|
69958
70187
|
...errBars.length > 0 ? { errBars } : {},
|
|
@@ -79979,9 +80208,9 @@ var SlideMetadataRenderer = class {
|
|
|
79979
80208
|
const clickGroups = this.groupByClickSequence(items);
|
|
79980
80209
|
const lines = ["### Animations"];
|
|
79981
80210
|
for (let gi = 0; gi < clickGroups.length; gi += 1) {
|
|
79982
|
-
const
|
|
80211
|
+
const group2 = clickGroups[gi];
|
|
79983
80212
|
lines.push(`- **Click ${gi + 1}:**`);
|
|
79984
|
-
for (const anim of
|
|
80213
|
+
for (const anim of group2) {
|
|
79985
80214
|
lines.push(` - ${this.summariseAnimation(anim)}`);
|
|
79986
80215
|
}
|
|
79987
80216
|
}
|
|
@@ -80877,7 +81106,7 @@ var TextSegmentRenderer = class {
|
|
|
80877
81106
|
return "";
|
|
80878
81107
|
}
|
|
80879
81108
|
const paragraphs = this.groupParagraphs(segments);
|
|
80880
|
-
const renderedParagraphs = paragraphs.map((
|
|
81109
|
+
const renderedParagraphs = paragraphs.map((group2) => this.renderParagraph(group2, options)).filter((paragraph) => paragraph.text.length > 0);
|
|
80881
81110
|
if (renderedParagraphs.length === 0) {
|
|
80882
81111
|
return "";
|
|
80883
81112
|
}
|
|
@@ -80909,7 +81138,7 @@ var TextSegmentRenderer = class {
|
|
|
80909
81138
|
plainText(segments, options = {}) {
|
|
80910
81139
|
const paragraphs = this.groupParagraphs(segments);
|
|
80911
81140
|
const rendered = paragraphs.map(
|
|
80912
|
-
(
|
|
81141
|
+
(group2) => group2.segments.map((segment) => {
|
|
80913
81142
|
const base = this.resolvePlainSegmentText(segment, options);
|
|
80914
81143
|
if (segment.rubyText) {
|
|
80915
81144
|
return `${base}(${segment.rubyText})`;
|
|
@@ -80939,8 +81168,8 @@ var TextSegmentRenderer = class {
|
|
|
80939
81168
|
}
|
|
80940
81169
|
return groups;
|
|
80941
81170
|
}
|
|
80942
|
-
renderParagraph(
|
|
80943
|
-
let rawText =
|
|
81171
|
+
renderParagraph(group2, options) {
|
|
81172
|
+
let rawText = group2.segments.map((segment) => this.renderSegment(segment, options)).join("");
|
|
80944
81173
|
if (options.htmlFormatting) {
|
|
80945
81174
|
rawText = rawText.replace(/<\/strong><strong>/g, "").replace(/<\/em><em>/g, "").replace(/<\/s><s>/g, "");
|
|
80946
81175
|
} else {
|
|
@@ -80954,10 +81183,10 @@ var TextSegmentRenderer = class {
|
|
|
80954
81183
|
return { text: "", isListItem: false };
|
|
80955
81184
|
}
|
|
80956
81185
|
if (!options.disableLists && !options.inlineMode) {
|
|
80957
|
-
const bullet =
|
|
81186
|
+
const bullet = group2.segments.find((segment) => Boolean(segment.bulletInfo))?.bulletInfo;
|
|
80958
81187
|
if (bullet && !bullet.none) {
|
|
80959
|
-
const level = resolveListLevel(bullet,
|
|
80960
|
-
const marker = resolveListMarker(bullet,
|
|
81188
|
+
const level = resolveListLevel(bullet, group2.index, options.paragraphIndents);
|
|
81189
|
+
const marker = resolveListMarker(bullet, group2.index);
|
|
80961
81190
|
const alreadyNumbered = bullet.autoNumType && /^\d+[.)]\s/.test(rawText);
|
|
80962
81191
|
const prefix = alreadyNumbered ? "" : `${marker} `;
|
|
80963
81192
|
if (options.htmlFormatting) {
|
|
@@ -80973,7 +81202,7 @@ var TextSegmentRenderer = class {
|
|
|
80973
81202
|
};
|
|
80974
81203
|
}
|
|
80975
81204
|
}
|
|
80976
|
-
const align =
|
|
81205
|
+
const align = group2.segments[0]?.style.align;
|
|
80977
81206
|
if (!options.disableAlignment && !options.inlineMode && align && align !== "left") {
|
|
80978
81207
|
return {
|
|
80979
81208
|
text: `<p align="${align}">${rawText}</p>`,
|
|
@@ -83822,8 +84051,8 @@ function buildStrokeOutline(element) {
|
|
|
83822
84051
|
function suppressesCssBorder(element) {
|
|
83823
84052
|
return buildStrokeOutline(element) !== void 0;
|
|
83824
84053
|
}
|
|
83825
|
-
function getGroupChildParentFill(
|
|
83826
|
-
return
|
|
84054
|
+
function getGroupChildParentFill(group2) {
|
|
84055
|
+
return group2.type === "group" ? group2.groupFill : void 0;
|
|
83827
84056
|
}
|
|
83828
84057
|
function resolveGroupChildFill(child22, parentGroupFill) {
|
|
83829
84058
|
if (!parentGroupFill || !hasShapeProperties(child22) || child22.shapeStyle?.fillMode !== "group") {
|
|
@@ -86295,11 +86524,11 @@ var LatexParser = class {
|
|
|
86295
86524
|
return tryParseScripts(this, base);
|
|
86296
86525
|
}
|
|
86297
86526
|
if (tok.type === "group_start") {
|
|
86298
|
-
const
|
|
86299
|
-
if (
|
|
86527
|
+
const group2 = this.parseGroup();
|
|
86528
|
+
if (group2.length === 0) {
|
|
86300
86529
|
return null;
|
|
86301
86530
|
}
|
|
86302
|
-
const base =
|
|
86531
|
+
const base = group2.length === 1 ? group2[0] : this.wrapE(group2);
|
|
86303
86532
|
return tryParseScripts(this, base);
|
|
86304
86533
|
}
|
|
86305
86534
|
if (tok.type === "command") {
|
|
@@ -86707,6 +86936,273 @@ function latexToMathMl(source) {
|
|
|
86707
86936
|
function compileEquationTemplateMathMl() {
|
|
86708
86937
|
return EQUATION_TEMPLATES.map((tmpl) => latexToMathMl(tmpl.latex));
|
|
86709
86938
|
}
|
|
86939
|
+
var NICE_STEPS = [1, 2, 2.5, 5, 10];
|
|
86940
|
+
var HEADROOM = 0.05;
|
|
86941
|
+
var ZERO_ANCHOR_RATIO = 5 / 6;
|
|
86942
|
+
function niceAxisStep(value) {
|
|
86943
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
86944
|
+
return 1;
|
|
86945
|
+
}
|
|
86946
|
+
const exponent = Math.floor(Math.log10(value));
|
|
86947
|
+
const power = 10 ** exponent;
|
|
86948
|
+
const mantissa = value / power;
|
|
86949
|
+
const step = NICE_STEPS.find((candidate) => mantissa <= candidate + 1e-12) ?? 10;
|
|
86950
|
+
return step * power;
|
|
86951
|
+
}
|
|
86952
|
+
function snap(value, unit, direction) {
|
|
86953
|
+
const scaled = value / unit;
|
|
86954
|
+
const rounded = direction === "up" ? Math.ceil(scaled - 1e-9) : Math.floor(scaled + 1e-9);
|
|
86955
|
+
return rounded * unit;
|
|
86956
|
+
}
|
|
86957
|
+
function niceValueAxisBounds(dataMin, dataMax, targetIntervals = 4) {
|
|
86958
|
+
if (!Number.isFinite(dataMin) || !Number.isFinite(dataMax)) {
|
|
86959
|
+
return { min: 0, max: 1, majorUnit: 0.5 };
|
|
86960
|
+
}
|
|
86961
|
+
const low = Math.min(dataMin, dataMax);
|
|
86962
|
+
const high = Math.max(dataMin, dataMax);
|
|
86963
|
+
const intervals = Math.max(1, Math.round(targetIntervals));
|
|
86964
|
+
if (low === high) {
|
|
86965
|
+
if (low === 0) {
|
|
86966
|
+
return { min: 0, max: 1, majorUnit: 1 / intervals };
|
|
86967
|
+
}
|
|
86968
|
+
const unit2 = niceAxisStep(Math.abs(low) / intervals);
|
|
86969
|
+
return low > 0 ? { min: 0, max: snap(low, unit2, "up") || unit2, majorUnit: unit2 } : { min: snap(low, unit2, "down"), max: 0, majorUnit: unit2 };
|
|
86970
|
+
}
|
|
86971
|
+
const dataSpan = high - low;
|
|
86972
|
+
const padding = dataSpan * HEADROOM;
|
|
86973
|
+
let paddedMin;
|
|
86974
|
+
let paddedMax;
|
|
86975
|
+
if (low >= 0) {
|
|
86976
|
+
paddedMin = low < high * ZERO_ANCHOR_RATIO ? 0 : low - padding;
|
|
86977
|
+
paddedMax = high + padding;
|
|
86978
|
+
} else if (high <= 0) {
|
|
86979
|
+
paddedMax = high > low * ZERO_ANCHOR_RATIO ? 0 : high + padding;
|
|
86980
|
+
paddedMin = low - padding;
|
|
86981
|
+
} else {
|
|
86982
|
+
paddedMin = low - padding;
|
|
86983
|
+
paddedMax = high + padding;
|
|
86984
|
+
}
|
|
86985
|
+
const unit = niceAxisStep((paddedMax - paddedMin) / intervals);
|
|
86986
|
+
const min = paddedMin === 0 ? 0 : snap(paddedMin, unit, "down");
|
|
86987
|
+
let max = paddedMax === 0 ? 0 : snap(paddedMax, unit, "up");
|
|
86988
|
+
if (max <= min) {
|
|
86989
|
+
max = min + unit;
|
|
86990
|
+
}
|
|
86991
|
+
return { min, max, majorUnit: unit };
|
|
86992
|
+
}
|
|
86993
|
+
var GENERAL = /* @__PURE__ */ new Set(["", "general", "@"]);
|
|
86994
|
+
function sections(code) {
|
|
86995
|
+
const out = [];
|
|
86996
|
+
let current = "";
|
|
86997
|
+
let inQuotes = false;
|
|
86998
|
+
for (let i = 0; i < code.length; i += 1) {
|
|
86999
|
+
const ch = code[i];
|
|
87000
|
+
if (ch === '"') {
|
|
87001
|
+
inQuotes = !inQuotes;
|
|
87002
|
+
current += ch;
|
|
87003
|
+
continue;
|
|
87004
|
+
}
|
|
87005
|
+
if (ch === "\\") {
|
|
87006
|
+
current += ch + (code[i + 1] ?? "");
|
|
87007
|
+
i += 1;
|
|
87008
|
+
continue;
|
|
87009
|
+
}
|
|
87010
|
+
if (ch === ";" && !inQuotes) {
|
|
87011
|
+
out.push(current);
|
|
87012
|
+
current = "";
|
|
87013
|
+
continue;
|
|
87014
|
+
}
|
|
87015
|
+
current += ch;
|
|
87016
|
+
}
|
|
87017
|
+
out.push(current);
|
|
87018
|
+
return out;
|
|
87019
|
+
}
|
|
87020
|
+
function sectionFor(value, parts) {
|
|
87021
|
+
if (parts.length === 1) {
|
|
87022
|
+
return { code: parts[0], forcePositive: false };
|
|
87023
|
+
}
|
|
87024
|
+
if (value < 0 && parts[1] !== void 0) {
|
|
87025
|
+
return { code: parts[1], forcePositive: true };
|
|
87026
|
+
}
|
|
87027
|
+
if (value === 0 && parts[2] !== void 0) {
|
|
87028
|
+
return { code: parts[2], forcePositive: false };
|
|
87029
|
+
}
|
|
87030
|
+
return { code: parts[0], forcePositive: false };
|
|
87031
|
+
}
|
|
87032
|
+
var PLACEHOLDER = /[0#?]/u;
|
|
87033
|
+
function parsePattern(code) {
|
|
87034
|
+
let scale = 1;
|
|
87035
|
+
let scientific = false;
|
|
87036
|
+
const chars = [];
|
|
87037
|
+
let inQuotes = false;
|
|
87038
|
+
for (let i = 0; i < code.length; i += 1) {
|
|
87039
|
+
const ch = code[i];
|
|
87040
|
+
if (ch === '"') {
|
|
87041
|
+
inQuotes = !inQuotes;
|
|
87042
|
+
continue;
|
|
87043
|
+
}
|
|
87044
|
+
if (inQuotes) {
|
|
87045
|
+
chars.push({ ch, literal: true });
|
|
87046
|
+
continue;
|
|
87047
|
+
}
|
|
87048
|
+
if (ch === "\\" || ch === "*" || ch === "_") {
|
|
87049
|
+
const next = code[i + 1];
|
|
87050
|
+
i += 1;
|
|
87051
|
+
if (ch === "\\" && next !== void 0) {
|
|
87052
|
+
chars.push({ ch: next, literal: true });
|
|
87053
|
+
}
|
|
87054
|
+
continue;
|
|
87055
|
+
}
|
|
87056
|
+
if (ch === "%") {
|
|
87057
|
+
scale *= 100;
|
|
87058
|
+
chars.push({ ch, literal: true });
|
|
87059
|
+
continue;
|
|
87060
|
+
}
|
|
87061
|
+
if (ch === "E" && (code[i + 1] === "+" || code[i + 1] === "-")) {
|
|
87062
|
+
scientific = true;
|
|
87063
|
+
chars.push({ ch: "E", literal: false });
|
|
87064
|
+
i += 1;
|
|
87065
|
+
continue;
|
|
87066
|
+
}
|
|
87067
|
+
if (ch === "[") {
|
|
87068
|
+
const close = code.indexOf("]", i);
|
|
87069
|
+
i = close === -1 ? code.length : close;
|
|
87070
|
+
continue;
|
|
87071
|
+
}
|
|
87072
|
+
chars.push({ ch, literal: false });
|
|
87073
|
+
}
|
|
87074
|
+
const firstDigit = chars.findIndex((c) => !c.literal && PLACEHOLDER.test(c.ch));
|
|
87075
|
+
if (firstDigit === -1) {
|
|
87076
|
+
return void 0;
|
|
87077
|
+
}
|
|
87078
|
+
let lastDigit = firstDigit;
|
|
87079
|
+
for (let i = chars.length - 1; i >= firstDigit; i -= 1) {
|
|
87080
|
+
const c = chars[i];
|
|
87081
|
+
if (!c.literal && (PLACEHOLDER.test(c.ch) || c.ch === "." || c.ch === "," || c.ch === "E")) {
|
|
87082
|
+
lastDigit = i;
|
|
87083
|
+
break;
|
|
87084
|
+
}
|
|
87085
|
+
}
|
|
87086
|
+
const numeric = chars.slice(firstDigit, lastDigit + 1);
|
|
87087
|
+
const prefix = chars.slice(0, firstDigit).map((c) => c.ch).join("");
|
|
87088
|
+
const suffix = chars.slice(lastDigit + 1).map((c) => c.ch).join("");
|
|
87089
|
+
let grouped = false;
|
|
87090
|
+
let intDigits = 0;
|
|
87091
|
+
let required = 0;
|
|
87092
|
+
let optional = 0;
|
|
87093
|
+
let afterPoint = false;
|
|
87094
|
+
let inExponent = false;
|
|
87095
|
+
for (let i = 0; i < numeric.length; i += 1) {
|
|
87096
|
+
const { ch, literal } = numeric[i];
|
|
87097
|
+
if (literal) {
|
|
87098
|
+
continue;
|
|
87099
|
+
}
|
|
87100
|
+
if (ch === "E") {
|
|
87101
|
+
inExponent = true;
|
|
87102
|
+
continue;
|
|
87103
|
+
}
|
|
87104
|
+
if (inExponent) {
|
|
87105
|
+
continue;
|
|
87106
|
+
}
|
|
87107
|
+
if (ch === ".") {
|
|
87108
|
+
afterPoint = true;
|
|
87109
|
+
continue;
|
|
87110
|
+
}
|
|
87111
|
+
if (ch === ",") {
|
|
87112
|
+
const next = numeric.slice(i + 1).find((c) => !c.literal);
|
|
87113
|
+
if (!next || next.ch === "." || !PLACEHOLDER.test(next.ch)) {
|
|
87114
|
+
scale /= 1e3;
|
|
87115
|
+
} else {
|
|
87116
|
+
grouped = true;
|
|
87117
|
+
}
|
|
87118
|
+
continue;
|
|
87119
|
+
}
|
|
87120
|
+
if (!PLACEHOLDER.test(ch)) {
|
|
87121
|
+
continue;
|
|
87122
|
+
}
|
|
87123
|
+
if (afterPoint) {
|
|
87124
|
+
if (ch === "0") {
|
|
87125
|
+
required += 1;
|
|
87126
|
+
} else {
|
|
87127
|
+
optional += 1;
|
|
87128
|
+
}
|
|
87129
|
+
} else if (ch === "0") {
|
|
87130
|
+
intDigits += 1;
|
|
87131
|
+
}
|
|
87132
|
+
}
|
|
87133
|
+
return {
|
|
87134
|
+
prefix,
|
|
87135
|
+
suffix,
|
|
87136
|
+
intDigits,
|
|
87137
|
+
decimals: { required, optional },
|
|
87138
|
+
grouped,
|
|
87139
|
+
scale,
|
|
87140
|
+
scientific
|
|
87141
|
+
};
|
|
87142
|
+
}
|
|
87143
|
+
function group(intPart) {
|
|
87144
|
+
return intPart.replace(/\B(?=(\d{3})+(?!\d))/gu, ",");
|
|
87145
|
+
}
|
|
87146
|
+
function applyPattern(value, pattern, forcePositive) {
|
|
87147
|
+
const scaled = value * pattern.scale;
|
|
87148
|
+
const magnitude = forcePositive ? Math.abs(scaled) : scaled;
|
|
87149
|
+
if (pattern.scientific) {
|
|
87150
|
+
const digits = pattern.decimals.required + pattern.decimals.optional;
|
|
87151
|
+
const exponential = magnitude.toExponential(digits);
|
|
87152
|
+
const [mantissa, exponent] = exponential.split("e");
|
|
87153
|
+
const sign = exponent.startsWith("-") ? "-" : "+";
|
|
87154
|
+
const power = Math.abs(Number(exponent)).toString().padStart(2, "0");
|
|
87155
|
+
return `${pattern.prefix}${mantissa}E${sign}${power}${pattern.suffix}`;
|
|
87156
|
+
}
|
|
87157
|
+
const maxDecimals = pattern.decimals.required + pattern.decimals.optional;
|
|
87158
|
+
let body = magnitude.toFixed(maxDecimals);
|
|
87159
|
+
if (pattern.decimals.optional > 0) {
|
|
87160
|
+
body = body.replace(/(\.\d*?)0+$/u, "$1").replace(/\.$/u, "");
|
|
87161
|
+
const [, frac = ""] = body.split(".");
|
|
87162
|
+
if (frac.length < pattern.decimals.required) {
|
|
87163
|
+
body = Number(body).toFixed(pattern.decimals.required);
|
|
87164
|
+
}
|
|
87165
|
+
}
|
|
87166
|
+
const [rawIntPart, fracPart] = body.split(".");
|
|
87167
|
+
let intPart = rawIntPart;
|
|
87168
|
+
const negative = intPart.startsWith("-");
|
|
87169
|
+
if (negative) {
|
|
87170
|
+
intPart = intPart.slice(1);
|
|
87171
|
+
}
|
|
87172
|
+
if (intPart.length < pattern.intDigits) {
|
|
87173
|
+
intPart = intPart.padStart(pattern.intDigits, "0");
|
|
87174
|
+
}
|
|
87175
|
+
if (pattern.intDigits === 0 && intPart === "0" && fracPart !== void 0) {
|
|
87176
|
+
intPart = "";
|
|
87177
|
+
}
|
|
87178
|
+
if (pattern.grouped) {
|
|
87179
|
+
intPart = group(intPart);
|
|
87180
|
+
}
|
|
87181
|
+
const number = fracPart === void 0 ? intPart : `${intPart}.${fracPart}`;
|
|
87182
|
+
return `${negative ? "-" : ""}${pattern.prefix}${number}${pattern.suffix}`;
|
|
87183
|
+
}
|
|
87184
|
+
function formatChartNumber(value, formatCode) {
|
|
87185
|
+
if (!Number.isFinite(value)) {
|
|
87186
|
+
return void 0;
|
|
87187
|
+
}
|
|
87188
|
+
const code = (formatCode ?? "").trim();
|
|
87189
|
+
if (GENERAL.has(code.toLowerCase())) {
|
|
87190
|
+
return void 0;
|
|
87191
|
+
}
|
|
87192
|
+
if (/(?:^|[^\\"])(?:yy|mm?m|dd?|hh|ss)/iu.test(code) && !/[0#?]/u.test(code)) {
|
|
87193
|
+
return void 0;
|
|
87194
|
+
}
|
|
87195
|
+
const { code: section, forcePositive } = sectionFor(value, sections(code));
|
|
87196
|
+
const pattern = parsePattern(section);
|
|
87197
|
+
if (!pattern) {
|
|
87198
|
+
return void 0;
|
|
87199
|
+
}
|
|
87200
|
+
try {
|
|
87201
|
+
return applyPattern(value, pattern, forcePositive);
|
|
87202
|
+
} catch {
|
|
87203
|
+
return void 0;
|
|
87204
|
+
}
|
|
87205
|
+
}
|
|
86710
87206
|
var ACCENT1 = "#4472C4";
|
|
86711
87207
|
var ACCENT2 = "#ED7D31";
|
|
86712
87208
|
var ACCENT3 = "#A5A5A5";
|
|
@@ -86837,12 +87333,11 @@ function computeValueRange(series) {
|
|
|
86837
87333
|
if (allValues.length === 0) {
|
|
86838
87334
|
return { min: 0, max: 1, span: 1 };
|
|
86839
87335
|
}
|
|
86840
|
-
const
|
|
86841
|
-
|
|
86842
|
-
|
|
86843
|
-
|
|
86844
|
-
|
|
86845
|
-
return { min, max, span };
|
|
87336
|
+
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
87337
|
+
Math.min(...allValues),
|
|
87338
|
+
Math.max(...allValues)
|
|
87339
|
+
);
|
|
87340
|
+
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
86846
87341
|
}
|
|
86847
87342
|
function valueToY(val2, range, topY, bottomY) {
|
|
86848
87343
|
const usable = bottomY - topY;
|
|
@@ -86858,7 +87353,11 @@ function valueToY(val2, range, topY, bottomY) {
|
|
|
86858
87353
|
}
|
|
86859
87354
|
return range.reverseOrder ? topY + ratio * usable : bottomY - ratio * usable;
|
|
86860
87355
|
}
|
|
86861
|
-
function formatAxisValue(val2) {
|
|
87356
|
+
function formatAxisValue(val2, formatCode) {
|
|
87357
|
+
const formatted = formatChartNumber(val2, formatCode);
|
|
87358
|
+
if (formatted !== void 0) {
|
|
87359
|
+
return formatted;
|
|
87360
|
+
}
|
|
86862
87361
|
if (Math.abs(val2) >= 1e6) {
|
|
86863
87362
|
return `${(val2 / 1e6).toFixed(1)}M`;
|
|
86864
87363
|
}
|
|
@@ -86914,6 +87413,19 @@ function computeLayout(elementWidth, elementHeight, style, hasAxes, legendPos, o
|
|
|
86914
87413
|
svgHeight
|
|
86915
87414
|
};
|
|
86916
87415
|
}
|
|
87416
|
+
var DEFAULT_CHART_AREA_FILL = "#0f172a11";
|
|
87417
|
+
function resolve(fill, fallback) {
|
|
87418
|
+
if (fill === "none") {
|
|
87419
|
+
return void 0;
|
|
87420
|
+
}
|
|
87421
|
+
return fill ?? fallback;
|
|
87422
|
+
}
|
|
87423
|
+
function chartAreaFill(chartData) {
|
|
87424
|
+
return resolve(chartData?.style?.chartAreaFill, DEFAULT_CHART_AREA_FILL);
|
|
87425
|
+
}
|
|
87426
|
+
function plotAreaFill(chartData) {
|
|
87427
|
+
return resolve(chartData?.style?.plotAreaFill, void 0);
|
|
87428
|
+
}
|
|
86917
87429
|
var LOG_EXPONENT_TOLERANCE = 1e-12;
|
|
86918
87430
|
function computeLogValueRange(series, logBase) {
|
|
86919
87431
|
const allValues = series.flatMap((item) => item.values).filter((value) => value > 0);
|
|
@@ -86942,6 +87454,7 @@ function computeValueRangeForAxis(series, axis) {
|
|
|
86942
87454
|
const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
|
|
86943
87455
|
const min = validMin ?? automatic.min;
|
|
86944
87456
|
let max = validMax ?? automatic.max;
|
|
87457
|
+
const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
|
|
86945
87458
|
if (max <= min) {
|
|
86946
87459
|
max = logBase ? min * logBase : min + 1;
|
|
86947
87460
|
}
|
|
@@ -86950,6 +87463,7 @@ function computeValueRangeForAxis(series, axis) {
|
|
|
86950
87463
|
min,
|
|
86951
87464
|
max,
|
|
86952
87465
|
span: Math.max(span, Number.EPSILON),
|
|
87466
|
+
...majorUnit !== void 0 ? { majorUnit } : {},
|
|
86953
87467
|
...logBase ? { logScale: true, logBase } : {},
|
|
86954
87468
|
...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
86955
87469
|
};
|
|
@@ -86989,6 +87503,10 @@ function generateAxisTicks(range, axis, defaultIntervals) {
|
|
|
86989
87503
|
if (explicit.length > 0) {
|
|
86990
87504
|
return explicit;
|
|
86991
87505
|
}
|
|
87506
|
+
const automatic = generateIntervalTicks(range, range.majorUnit ?? 0);
|
|
87507
|
+
if (automatic.length > 0) {
|
|
87508
|
+
return automatic;
|
|
87509
|
+
}
|
|
86992
87510
|
return Array.from(
|
|
86993
87511
|
{ length: defaultIntervals + 1 },
|
|
86994
87512
|
(_, index) => range.min + range.span / defaultIntervals * index
|
|
@@ -87557,7 +88075,7 @@ function formatTick(val2, axis) {
|
|
|
87557
88075
|
if (axis?.displayUnits) {
|
|
87558
88076
|
return formatAxisValueWithUnits(val2, axis);
|
|
87559
88077
|
}
|
|
87560
|
-
return formatAxisValue2(val2);
|
|
88078
|
+
return formatAxisValue2(val2, axis?.numFmt?.formatCode);
|
|
87561
88079
|
}
|
|
87562
88080
|
function buildPrimaryAxis(range, layout, axis, axisX = layout.plotLeft) {
|
|
87563
88081
|
const gridlines = [];
|
|
@@ -87754,7 +88272,11 @@ function hasRicherAxisFeatures(chartData) {
|
|
|
87754
88272
|
return Boolean(
|
|
87755
88273
|
chartData.dataTable || chartData.axes?.some(
|
|
87756
88274
|
(axis) => axis.crosses !== void 0 || axis.crossesAt !== void 0 || axis.crossBetween !== void 0 || axis.axisType === "valAx" && Boolean(
|
|
87757
|
-
axis.logScale || axis.displayUnits ||
|
|
88275
|
+
axis.logScale || axis.displayUnits || // A `c:numFmt` is only honoured on the `buildPrimaryAxis`
|
|
88276
|
+
// path; the fast path has no axis to read it from. The two
|
|
88277
|
+
// agree tick-for-tick when no log scale or display unit is
|
|
88278
|
+
// in play, so routing a formatted axis here costs nothing.
|
|
88279
|
+
axis.numFmt?.formatCode || axis.axPos === "r" || axis.orientation === "maxMin" || axis.majorUnit !== void 0 || axis.minorUnit !== void 0 || axis.minorGridlines || axis.majorTickMark !== void 0 || axis.minorTickMark !== void 0 || axis.tickLblPos !== void 0
|
|
87758
88280
|
)
|
|
87759
88281
|
)
|
|
87760
88282
|
);
|
|
@@ -87864,7 +88386,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
|
|
|
87864
88386
|
kind: "text",
|
|
87865
88387
|
x: x + singleBarWidth / 2,
|
|
87866
88388
|
y: val2 >= 0 ? y - 4 : y + h + 10,
|
|
87867
|
-
text: formatAxisValue2(val2),
|
|
88389
|
+
text: formatAxisValue2(val2, series[si].numberFormat),
|
|
87868
88390
|
fontSize: 7,
|
|
87869
88391
|
fill: "#334155",
|
|
87870
88392
|
textAnchor: "middle"
|
|
@@ -87969,7 +88491,7 @@ function pushClusteredStackedLabels(series, sourceIndices2, catCount, layout, ra
|
|
|
87969
88491
|
kind: "text",
|
|
87970
88492
|
x,
|
|
87971
88493
|
y: labelY,
|
|
87972
|
-
text: formatAxisValue2(val2),
|
|
88494
|
+
text: formatAxisValue2(val2, series[si].numberFormat),
|
|
87973
88495
|
fontSize: 7,
|
|
87974
88496
|
fill: "#334155",
|
|
87975
88497
|
textAnchor: "middle"
|
|
@@ -88255,7 +88777,7 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
|
|
|
88255
88777
|
kind: "text",
|
|
88256
88778
|
x: pt.x,
|
|
88257
88779
|
y: pt.y - 7,
|
|
88258
|
-
text: formatAxisValue2(val2),
|
|
88780
|
+
text: formatAxisValue2(val2, series.numberFormat),
|
|
88259
88781
|
fontSize: 7,
|
|
88260
88782
|
fill: "#334155",
|
|
88261
88783
|
textAnchor: "middle"
|
|
@@ -88327,7 +88849,7 @@ function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositio
|
|
|
88327
88849
|
kind: "text",
|
|
88328
88850
|
x: pt.x,
|
|
88329
88851
|
y: pt.y - 6,
|
|
88330
|
-
text: formatAxisValue2(val2),
|
|
88852
|
+
text: formatAxisValue2(val2, series.numberFormat),
|
|
88331
88853
|
fontSize: 7,
|
|
88332
88854
|
fill: "#334155",
|
|
88333
88855
|
textAnchor: "middle"
|
|
@@ -88372,7 +88894,7 @@ function buildScatter(chartData, layout, range) {
|
|
|
88372
88894
|
kind: "text",
|
|
88373
88895
|
x: dot.cx,
|
|
88374
88896
|
y: dot.cy - 6,
|
|
88375
|
-
text: formatAxisValue2(val2),
|
|
88897
|
+
text: formatAxisValue2(val2, series.numberFormat),
|
|
88376
88898
|
fontSize: 7,
|
|
88377
88899
|
fill: "#334155",
|
|
88378
88900
|
textAnchor: "middle"
|
|
@@ -88419,7 +88941,7 @@ function buildBubbles(chartData, layout, range) {
|
|
|
88419
88941
|
kind: "text",
|
|
88420
88942
|
x: dot.cx,
|
|
88421
88943
|
y: dot.cy - 10,
|
|
88422
|
-
text: formatAxisValue2(val2),
|
|
88944
|
+
text: formatAxisValue2(val2, series.numberFormat),
|
|
88423
88945
|
fontSize: 7,
|
|
88424
88946
|
fill: "#334155",
|
|
88425
88947
|
textAnchor: "middle"
|
|
@@ -88573,18 +89095,18 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
|
|
|
88573
89095
|
const bandHeight = Math.max(axis?.fontSize ?? 8, 8) + 4;
|
|
88574
89096
|
return levels.flatMap((level, levelIndex) => {
|
|
88575
89097
|
const values = sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "");
|
|
88576
|
-
return groupedLabels(values).flatMap((
|
|
88577
|
-
if (!
|
|
89098
|
+
return groupedLabels(values).flatMap((group2) => {
|
|
89099
|
+
if (!group2.text || group2.start % skip !== 0) {
|
|
88578
89100
|
return [];
|
|
88579
89101
|
}
|
|
88580
|
-
const startX = categoryX2(
|
|
88581
|
-
const endX = categoryX2(
|
|
89102
|
+
const startX = categoryX2(group2.start, sourceIndices2.length, layout, spacing);
|
|
89103
|
+
const endX = categoryX2(group2.end, sourceIndices2.length, layout, spacing);
|
|
88582
89104
|
return [
|
|
88583
89105
|
{
|
|
88584
89106
|
kind: "text",
|
|
88585
89107
|
x: (startX + endX) / 2,
|
|
88586
89108
|
y: labelY + direction * (offset + levelIndex * bandHeight),
|
|
88587
|
-
text:
|
|
89109
|
+
text: group2.text,
|
|
88588
89110
|
textAnchor,
|
|
88589
89111
|
...chartAxisTextStyle(axis)
|
|
88590
89112
|
}
|
|
@@ -89829,7 +90351,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
|
|
|
89829
90351
|
kind: "text",
|
|
89830
90352
|
x: point.x,
|
|
89831
90353
|
y: point.y - 7,
|
|
89832
|
-
text: formatAxisValue2(point.value),
|
|
90354
|
+
text: formatAxisValue2(point.value, series.numberFormat),
|
|
89833
90355
|
fontSize: 7,
|
|
89834
90356
|
fill: "#334155",
|
|
89835
90357
|
textAnchor: "middle"
|
|
@@ -89884,7 +90406,7 @@ function appendBarLabels(series, chartData, layout, catCount, range, sourceIndic
|
|
|
89884
90406
|
kind: "text",
|
|
89885
90407
|
x: xPositions?.[displayIndex] ?? layout.plotLeft + groupWidth * displayIndex + offset + barWidth / 2,
|
|
89886
90408
|
y: value >= 0 ? Math.min(zeroY, valueY) - 4 : Math.max(zeroY, valueY) + 10,
|
|
89887
|
-
text: formatAxisValue2(value),
|
|
90409
|
+
text: formatAxisValue2(value, series.numberFormat),
|
|
89888
90410
|
fontSize: 7,
|
|
89889
90411
|
fill: "#334155",
|
|
89890
90412
|
textAnchor: "middle"
|
|
@@ -90921,7 +91443,7 @@ function isOutsidePosition(position2) {
|
|
|
90921
91443
|
return position2 === "outEnd" || position2 === "bestFit";
|
|
90922
91444
|
}
|
|
90923
91445
|
function buildPieDataLabels(params) {
|
|
90924
|
-
const { slices, values, cx, cy, outerR, position: position2, showLeaderLines } = params;
|
|
91446
|
+
const { slices, values, cx, cy, outerR, position: position2, showLeaderLines, numberFormat } = params;
|
|
90925
91447
|
const outside = isOutsidePosition(position2);
|
|
90926
91448
|
const labels = [];
|
|
90927
91449
|
const leaderLines = [];
|
|
@@ -90935,7 +91457,7 @@ function buildPieDataLabels(params) {
|
|
|
90935
91457
|
kind: "text",
|
|
90936
91458
|
x: slice.labelX,
|
|
90937
91459
|
y: slice.labelY,
|
|
90938
|
-
text: formatAxisValue2(val2),
|
|
91460
|
+
text: formatAxisValue2(val2, numberFormat),
|
|
90939
91461
|
fontSize: 8,
|
|
90940
91462
|
fill: "#ffffff",
|
|
90941
91463
|
textAnchor: "middle",
|
|
@@ -90955,7 +91477,7 @@ function buildPieDataLabels(params) {
|
|
|
90955
91477
|
kind: "text",
|
|
90956
91478
|
x: labelX + (cos >= 0 ? 2 : -2),
|
|
90957
91479
|
y: labelY,
|
|
90958
|
-
text: formatAxisValue2(val2),
|
|
91480
|
+
text: formatAxisValue2(val2, numberFormat),
|
|
90959
91481
|
fontSize: 8,
|
|
90960
91482
|
fill: "#334155",
|
|
90961
91483
|
textAnchor: anchor,
|
|
@@ -92224,10 +92746,8 @@ function computeValueRange2(series) {
|
|
|
92224
92746
|
if (dataMin === Number.POSITIVE_INFINITY) {
|
|
92225
92747
|
return { min: 0, max: 1, span: 1 };
|
|
92226
92748
|
}
|
|
92227
|
-
const min =
|
|
92228
|
-
|
|
92229
|
-
const span = Math.max(max - min, 1);
|
|
92230
|
-
return { min, max, span };
|
|
92749
|
+
const { min, max, majorUnit } = niceValueAxisBounds(dataMin, dataMax);
|
|
92750
|
+
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
92231
92751
|
}
|
|
92232
92752
|
function computeStackedValueRange(series, catCount) {
|
|
92233
92753
|
let maxSum = 0;
|
|
@@ -92246,10 +92766,8 @@ function computeStackedValueRange(series, catCount) {
|
|
|
92246
92766
|
maxSum = Math.max(maxSum, pos2);
|
|
92247
92767
|
minSum = Math.min(minSum, neg);
|
|
92248
92768
|
}
|
|
92249
|
-
const min = Math.min(minSum, 0);
|
|
92250
|
-
|
|
92251
|
-
const span = Math.max(max - min, 1);
|
|
92252
|
-
return { min, max, span };
|
|
92769
|
+
const { min, max, majorUnit } = niceValueAxisBounds(Math.min(minSum, 0), Math.max(maxSum, 0));
|
|
92770
|
+
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
92253
92771
|
}
|
|
92254
92772
|
function valueToY2(val2, range, topY, bottomY) {
|
|
92255
92773
|
const usable = bottomY - topY;
|
|
@@ -92265,7 +92783,11 @@ function valueToY2(val2, range, topY, bottomY) {
|
|
|
92265
92783
|
}
|
|
92266
92784
|
return range.reverseOrder ? topY + ratio * usable : bottomY - ratio * usable;
|
|
92267
92785
|
}
|
|
92268
|
-
function formatAxisValue2(val2) {
|
|
92786
|
+
function formatAxisValue2(val2, formatCode) {
|
|
92787
|
+
const formatted = formatChartNumber(val2, formatCode);
|
|
92788
|
+
if (formatted !== void 0) {
|
|
92789
|
+
return formatted;
|
|
92790
|
+
}
|
|
92269
92791
|
if (Math.abs(val2) >= 1e6) {
|
|
92270
92792
|
return `${(val2 / 1e6).toFixed(1)}M`;
|
|
92271
92793
|
}
|
|
@@ -92327,11 +92849,23 @@ var GRIDLINE_COLOR2 = "#e2e8f0";
|
|
|
92327
92849
|
var AXIS_LABEL_COLOR = "#64748b";
|
|
92328
92850
|
var ZERO_LINE_COLOR = "#94a3b8";
|
|
92329
92851
|
var TICK_COUNT2 = 5;
|
|
92852
|
+
function axisTickValues(range) {
|
|
92853
|
+
const unit = range.majorUnit;
|
|
92854
|
+
if (unit !== void 0 && Number.isFinite(unit) && unit > 0 && !range.logScale) {
|
|
92855
|
+
const steps = Math.round((range.max - range.min) / unit);
|
|
92856
|
+
if (steps >= 1 && steps <= 100) {
|
|
92857
|
+
return Array.from({ length: steps + 1 }, (_unused, index) => range.min + unit * index);
|
|
92858
|
+
}
|
|
92859
|
+
}
|
|
92860
|
+
return Array.from(
|
|
92861
|
+
{ length: TICK_COUNT2 + 1 },
|
|
92862
|
+
(_unused, index) => range.min + range.span / TICK_COUNT2 * index
|
|
92863
|
+
);
|
|
92864
|
+
}
|
|
92330
92865
|
function buildGridlinesAndLabels(range, layout) {
|
|
92331
92866
|
const gridlines = [];
|
|
92332
92867
|
const axisLabels = [];
|
|
92333
|
-
for (
|
|
92334
|
-
const val2 = range.min + range.span / TICK_COUNT2 * i;
|
|
92868
|
+
for (const val2 of axisTickValues(range)) {
|
|
92335
92869
|
const y = valueToY2(val2, range, layout.plotTop, layout.plotBottom);
|
|
92336
92870
|
gridlines.push({
|
|
92337
92871
|
kind: "line",
|
|
@@ -92649,13 +93183,26 @@ function buildChartViewModel(element) {
|
|
|
92649
93183
|
const longestLen = chartData.series.reduce((m, s) => Math.max(m, s.values.length), 0);
|
|
92650
93184
|
const categoryLabels = chartData.categories.length > 0 ? chartData.categories : Array.from({ length: longestLen }, (_, i) => String(i + 1));
|
|
92651
93185
|
if (chartType === "ofPie") {
|
|
92652
|
-
return
|
|
93186
|
+
return withChartAreaFill(
|
|
93187
|
+
withUserShapeOverlay(buildOfPieViewModel(element, chartData, categoryLabels), chartData),
|
|
93188
|
+
chartData
|
|
93189
|
+
);
|
|
92653
93190
|
}
|
|
92654
93191
|
const flat = buildFlatViewModel(element, chartData, categoryLabels, kind);
|
|
92655
93192
|
if (is3DChartType(chartType)) {
|
|
92656
|
-
return
|
|
93193
|
+
return withChartAreaFill(
|
|
93194
|
+
withUserShapeOverlay(applyChart3DDepth(flat, chartType, chartData.view3D), chartData),
|
|
93195
|
+
chartData
|
|
93196
|
+
);
|
|
92657
93197
|
}
|
|
92658
|
-
return withUserShapeOverlay(flat, chartData);
|
|
93198
|
+
return withChartAreaFill(withUserShapeOverlay(flat, chartData), chartData);
|
|
93199
|
+
}
|
|
93200
|
+
function withChartAreaFill(vm, chartData) {
|
|
93201
|
+
return {
|
|
93202
|
+
...vm,
|
|
93203
|
+
areaFill: chartAreaFill(chartData),
|
|
93204
|
+
plotFill: plotAreaFill(chartData)
|
|
93205
|
+
};
|
|
92659
93206
|
}
|
|
92660
93207
|
function withUserShapeOverlay(vm, chartData) {
|
|
92661
93208
|
const overlay = buildChartUserShapeOverlay(chartData.userShapes, vm.svgWidth, vm.svgHeight);
|
|
@@ -92716,6 +93263,8 @@ function buildFallbackViewModel(width, height, label) {
|
|
|
92716
93263
|
return {
|
|
92717
93264
|
svgWidth,
|
|
92718
93265
|
svgHeight,
|
|
93266
|
+
// No chart data to read a fill from, so the historical wash stands.
|
|
93267
|
+
areaFill: DEFAULT_CHART_AREA_FILL,
|
|
92719
93268
|
title: void 0,
|
|
92720
93269
|
titleX: svgWidth / 2,
|
|
92721
93270
|
titleY: 14,
|
|
@@ -92787,7 +93336,8 @@ function buildPieViewModel(element, chartData, categoryLabels, isDoughnut) {
|
|
|
92787
93336
|
cy,
|
|
92788
93337
|
outerR,
|
|
92789
93338
|
position: chartData.style.dataLabels?.position,
|
|
92790
|
-
showLeaderLines: chartData.style.dataLabels?.showLeaderLines
|
|
93339
|
+
showLeaderLines: chartData.style.dataLabels?.showLeaderLines,
|
|
93340
|
+
numberFormat: chartData.series[0]?.numberFormat
|
|
92791
93341
|
});
|
|
92792
93342
|
dataLabels.push(...labelResult.labels);
|
|
92793
93343
|
primitives.push(...labelResult.leaderLines);
|
|
@@ -92906,7 +93456,7 @@ function buildRadarViewModel(element, chartData, categoryLabels) {
|
|
|
92906
93456
|
kind: "text",
|
|
92907
93457
|
x: p.x,
|
|
92908
93458
|
y: p.y - 8,
|
|
92909
|
-
text: formatAxisValue2(val2),
|
|
93459
|
+
text: formatAxisValue2(val2, series.numberFormat),
|
|
92910
93460
|
fontSize: 7,
|
|
92911
93461
|
fill: "#334155",
|
|
92912
93462
|
textAnchor: "middle"
|
|
@@ -93956,8 +94506,8 @@ function finalizeClickGroup(steps, options) {
|
|
|
93956
94506
|
maxEnd = end;
|
|
93957
94507
|
}
|
|
93958
94508
|
}
|
|
93959
|
-
const
|
|
93960
|
-
return
|
|
94509
|
+
const group2 = { steps, totalDurationMs: maxEnd };
|
|
94510
|
+
return group2;
|
|
93961
94511
|
}
|
|
93962
94512
|
var CLICK_EVENTS = /* @__PURE__ */ new Set(["onClick", "onNext"]);
|
|
93963
94513
|
var HOVER_EVENTS = /* @__PURE__ */ new Set(["onMouseOver"]);
|
|
@@ -94531,11 +95081,11 @@ function buildTimeline(nativeAnimations) {
|
|
|
94531
95081
|
const isFirstAnimation = clickGroups.length === 0 && currentGroup.length === 0;
|
|
94532
95082
|
if (isOnClick || isFirstAnimation) {
|
|
94533
95083
|
if (currentGroup.length > 0) {
|
|
94534
|
-
const
|
|
95084
|
+
const group2 = finalizeClickGroup(currentGroup);
|
|
94535
95085
|
if (currentGroupAutoStart || !currentGroupIsClick && clickGroups.length > 0) {
|
|
94536
|
-
|
|
95086
|
+
group2.autoAdvance = true;
|
|
94537
95087
|
}
|
|
94538
|
-
clickGroups.push(
|
|
95088
|
+
clickGroups.push(group2);
|
|
94539
95089
|
}
|
|
94540
95090
|
currentGroup = [];
|
|
94541
95091
|
currentGroupIsClick = isOnClick || isFirstAnimation;
|
|
@@ -94579,15 +95129,15 @@ function buildTimeline(nativeAnimations) {
|
|
|
94579
95129
|
}
|
|
94580
95130
|
}
|
|
94581
95131
|
if (currentGroup.length > 0) {
|
|
94582
|
-
const
|
|
95132
|
+
const group2 = finalizeClickGroup(currentGroup);
|
|
94583
95133
|
if (currentGroupAutoStart || !currentGroupIsClick && clickGroups.length > 0) {
|
|
94584
|
-
|
|
95134
|
+
group2.autoAdvance = true;
|
|
94585
95135
|
}
|
|
94586
|
-
clickGroups.push(
|
|
95136
|
+
clickGroups.push(group2);
|
|
94587
95137
|
}
|
|
94588
|
-
for (const
|
|
94589
|
-
if (
|
|
94590
|
-
|
|
95138
|
+
for (const group2 of clickGroups) {
|
|
95139
|
+
if (group2.autoAdvance) {
|
|
95140
|
+
group2.autoAdvanceDelayMs = 0;
|
|
94591
95141
|
}
|
|
94592
95142
|
}
|
|
94593
95143
|
const interactiveSequences = buildSequenceGroups(
|
|
@@ -94815,9 +95365,9 @@ var TimelineEngine = class _TimelineEngine {
|
|
|
94815
95365
|
return null;
|
|
94816
95366
|
}
|
|
94817
95367
|
this.currentGroupIndex++;
|
|
94818
|
-
const
|
|
94819
|
-
this.applyGroupSteps(
|
|
94820
|
-
return
|
|
95368
|
+
const group2 = this.timeline.clickGroups[this.currentGroupIndex];
|
|
95369
|
+
this.applyGroupSteps(group2);
|
|
95370
|
+
return group2;
|
|
94821
95371
|
}
|
|
94822
95372
|
/**
|
|
94823
95373
|
* Peek at the next click-group without advancing.
|
|
@@ -94929,9 +95479,9 @@ var TimelineEngine = class _TimelineEngine {
|
|
|
94929
95479
|
return null;
|
|
94930
95480
|
}
|
|
94931
95481
|
this.interactiveGroupIndexes.set(triggerShapeId, nextIdx);
|
|
94932
|
-
const
|
|
94933
|
-
this.applyGroupSteps(
|
|
94934
|
-
return
|
|
95482
|
+
const group2 = groups[nextIdx];
|
|
95483
|
+
this.applyGroupSteps(group2);
|
|
95484
|
+
return group2;
|
|
94935
95485
|
}
|
|
94936
95486
|
/**
|
|
94937
95487
|
* Advance the hover sequence for a given trigger shape.
|
|
@@ -94948,9 +95498,9 @@ var TimelineEngine = class _TimelineEngine {
|
|
|
94948
95498
|
return null;
|
|
94949
95499
|
}
|
|
94950
95500
|
this.hoverGroupIndexes.set(triggerShapeId, nextIdx);
|
|
94951
|
-
const
|
|
94952
|
-
this.applyGroupSteps(
|
|
94953
|
-
return
|
|
95501
|
+
const group2 = groups[nextIdx];
|
|
95502
|
+
this.applyGroupSteps(group2);
|
|
95503
|
+
return group2;
|
|
94954
95504
|
}
|
|
94955
95505
|
/**
|
|
94956
95506
|
* Reset the hover sequence for a given trigger shape so it can replay
|
|
@@ -94972,8 +95522,8 @@ var TimelineEngine = class _TimelineEngine {
|
|
|
94972
95522
|
*/
|
|
94973
95523
|
completeAll() {
|
|
94974
95524
|
this.reset();
|
|
94975
|
-
for (const
|
|
94976
|
-
for (const step of
|
|
95525
|
+
for (const group2 of this.timeline.clickGroups) {
|
|
95526
|
+
for (const step of group2.steps) {
|
|
94977
95527
|
if (step.build || step.colorTargets) {
|
|
94978
95528
|
this.activeSteps.set(step.elementId, step);
|
|
94979
95529
|
}
|
|
@@ -95002,8 +95552,8 @@ var TimelineEngine = class _TimelineEngine {
|
|
|
95002
95552
|
/**
|
|
95003
95553
|
* Apply a group's steps to the internal tracking state.
|
|
95004
95554
|
*/
|
|
95005
|
-
applyGroupSteps(
|
|
95006
|
-
for (const step of
|
|
95555
|
+
applyGroupSteps(group2) {
|
|
95556
|
+
for (const step of group2.steps) {
|
|
95007
95557
|
this.activeAnimations.set(step.elementId, step.cssAnimation);
|
|
95008
95558
|
if (step.build || step.colorTargets) {
|
|
95009
95559
|
this.activeSteps.set(step.elementId, step);
|
|
@@ -95576,9 +96126,9 @@ var PresentationAnimationController = class _PresentationAnimationController {
|
|
|
95576
96126
|
* binding the group needs a requestAnimationFrame reveal loop; an empty result
|
|
95577
96127
|
* means ordinary discrete click-advance is enough.
|
|
95578
96128
|
*/
|
|
95579
|
-
static collectBuildStepIds(
|
|
96129
|
+
static collectBuildStepIds(group2) {
|
|
95580
96130
|
const ids = [];
|
|
95581
|
-
for (const step of
|
|
96131
|
+
for (const step of group2.steps) {
|
|
95582
96132
|
if (step.build) {
|
|
95583
96133
|
ids.push(step.elementId);
|
|
95584
96134
|
}
|
|
@@ -95645,8 +96195,8 @@ function findMediaElementByElementId(targetId, root) {
|
|
|
95645
96195
|
}
|
|
95646
96196
|
return void 0;
|
|
95647
96197
|
}
|
|
95648
|
-
function runMediaCommand(command,
|
|
95649
|
-
const el =
|
|
96198
|
+
function runMediaCommand(command, resolve2) {
|
|
96199
|
+
const el = resolve2(command.targetId);
|
|
95650
96200
|
if (!el) {
|
|
95651
96201
|
return false;
|
|
95652
96202
|
}
|
|
@@ -96449,10 +96999,10 @@ function collectSections(entry2, tableData, pos2) {
|
|
|
96449
96999
|
const isBottom = rowIndex === rowCount - 1;
|
|
96450
97000
|
const isLeft = cellIndex === 0;
|
|
96451
97001
|
const isRight = cellIndex === columnCount - 1;
|
|
96452
|
-
const
|
|
97002
|
+
const sections2 = [];
|
|
96453
97003
|
const push2 = (borders, regionTop, regionBottom, regionLeft, regionRight) => {
|
|
96454
97004
|
if (borders) {
|
|
96455
|
-
|
|
97005
|
+
sections2.push({ borders, regionTop, regionBottom, regionLeft, regionRight });
|
|
96456
97006
|
}
|
|
96457
97007
|
};
|
|
96458
97008
|
push2(entry2.wholeTblBorders, isTop, isBottom, isLeft, isRight);
|
|
@@ -96492,19 +97042,19 @@ function collectSections(entry2, tableData, pos2) {
|
|
|
96492
97042
|
if (tableData.lastCol && isRight) {
|
|
96493
97043
|
push2(entry2.lastColBorders, isTop, isBottom, true, true);
|
|
96494
97044
|
}
|
|
96495
|
-
return
|
|
97045
|
+
return sections2;
|
|
96496
97046
|
}
|
|
96497
|
-
function resolveStyleDiagonalBorders(entry2, tableData, pos2,
|
|
97047
|
+
function resolveStyleDiagonalBorders(entry2, tableData, pos2, resolve2) {
|
|
96498
97048
|
if (!entry2) {
|
|
96499
97049
|
return void 0;
|
|
96500
97050
|
}
|
|
96501
|
-
const
|
|
96502
|
-
if (
|
|
97051
|
+
const sections2 = collectSections(entry2, tableData, pos2);
|
|
97052
|
+
if (sections2.length === 0) {
|
|
96503
97053
|
return void 0;
|
|
96504
97054
|
}
|
|
96505
97055
|
let tl2br;
|
|
96506
97056
|
let bl2tr;
|
|
96507
|
-
for (const section of
|
|
97057
|
+
for (const section of sections2) {
|
|
96508
97058
|
if (section.borders.tl2br) {
|
|
96509
97059
|
tl2br = section.borders.tl2br;
|
|
96510
97060
|
}
|
|
@@ -96515,12 +97065,12 @@ function resolveStyleDiagonalBorders(entry2, tableData, pos2, resolve) {
|
|
|
96515
97065
|
const info = {};
|
|
96516
97066
|
let applied = false;
|
|
96517
97067
|
if (tl2br && !tl2br.noFill) {
|
|
96518
|
-
info.diagDownColor = tl2br.color ??
|
|
97068
|
+
info.diagDownColor = tl2br.color ?? resolve2(tl2br.fill) ?? "#000000";
|
|
96519
97069
|
info.diagDownWidth = tl2br.width ?? 1;
|
|
96520
97070
|
applied = true;
|
|
96521
97071
|
}
|
|
96522
97072
|
if (bl2tr && !bl2tr.noFill) {
|
|
96523
|
-
info.diagUpColor = bl2tr.color ??
|
|
97073
|
+
info.diagUpColor = bl2tr.color ?? resolve2(bl2tr.fill) ?? "#000000";
|
|
96524
97074
|
info.diagUpWidth = bl2tr.width ?? 1;
|
|
96525
97075
|
applied = true;
|
|
96526
97076
|
}
|
|
@@ -97851,25 +98401,39 @@ function getImageFitStyle(el) {
|
|
|
97851
98401
|
if (!isImageLikeElement(el)) {
|
|
97852
98402
|
return uncropped;
|
|
97853
98403
|
}
|
|
98404
|
+
const frLeft = el.fillRectLeft ?? 0;
|
|
98405
|
+
const frTop = el.fillRectTop ?? 0;
|
|
98406
|
+
const frRight = el.fillRectRight ?? 0;
|
|
98407
|
+
const frBottom = el.fillRectBottom ?? 0;
|
|
98408
|
+
const hasFillRect = Math.abs(frLeft) + Math.abs(frTop) + Math.abs(frRight) + Math.abs(frBottom) > 1e-4;
|
|
98409
|
+
const placementTransform = hasFillRect ? `translate(${round2(frLeft * 100)}%, ${round2(frTop * 100)}%) scale(${round6(
|
|
98410
|
+
Math.max(0.01, 1 - frLeft - frRight)
|
|
98411
|
+
)}, ${round6(Math.max(0.01, 1 - frTop - frBottom))})` : "";
|
|
97854
98412
|
const cropLeft = clampCropValue(el.cropLeft);
|
|
97855
98413
|
const cropTop = clampCropValue(el.cropTop);
|
|
97856
98414
|
const cropRight = clampCropValue(el.cropRight);
|
|
97857
98415
|
const cropBottom = clampCropValue(el.cropBottom);
|
|
97858
|
-
|
|
98416
|
+
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
98417
|
+
if (!hasCrop && !hasFillRect) {
|
|
97859
98418
|
return uncropped;
|
|
97860
98419
|
}
|
|
97861
|
-
|
|
97862
|
-
|
|
97863
|
-
|
|
97864
|
-
|
|
97865
|
-
|
|
97866
|
-
|
|
97867
|
-
|
|
97868
|
-
|
|
97869
|
-
|
|
97870
|
-
|
|
97871
|
-
|
|
97872
|
-
|
|
98420
|
+
let cropTransform = "";
|
|
98421
|
+
if (hasCrop) {
|
|
98422
|
+
const horizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
98423
|
+
const verticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
98424
|
+
const left = clampCropValue(cropLeft * horizontalScale);
|
|
98425
|
+
const right = clampCropValue(cropRight * horizontalScale);
|
|
98426
|
+
const top = clampCropValue(cropTop * verticalScale);
|
|
98427
|
+
const bottom = clampCropValue(cropBottom * verticalScale);
|
|
98428
|
+
const remainingWidth = Math.max(0.01, 1 - left - right);
|
|
98429
|
+
const remainingHeight = Math.max(0.01, 1 - top - bottom);
|
|
98430
|
+
const tx = Math.round(-left / remainingWidth * 1e4) / 100;
|
|
98431
|
+
const ty = Math.round(-top / remainingHeight * 1e4) / 100;
|
|
98432
|
+
const sx = Math.round(1 / remainingWidth * 1e6) / 1e6;
|
|
98433
|
+
const sy = Math.round(1 / remainingHeight * 1e6) / 1e6;
|
|
98434
|
+
cropTransform = `translate(${tx}%, ${ty}%) scale(${sx}, ${sy})`;
|
|
98435
|
+
}
|
|
98436
|
+
const transform = [placementTransform, cropTransform].filter(Boolean).join(" ");
|
|
97873
98437
|
return {
|
|
97874
98438
|
position: "absolute",
|
|
97875
98439
|
width: "100%",
|
|
@@ -97878,9 +98442,15 @@ function getImageFitStyle(el) {
|
|
|
97878
98442
|
maxHeight: "none",
|
|
97879
98443
|
objectFit: "fill",
|
|
97880
98444
|
transformOrigin: "top left",
|
|
97881
|
-
transform
|
|
98445
|
+
transform
|
|
97882
98446
|
};
|
|
97883
98447
|
}
|
|
98448
|
+
function round2(value) {
|
|
98449
|
+
return Math.round(value * 100) / 100;
|
|
98450
|
+
}
|
|
98451
|
+
function round6(value) {
|
|
98452
|
+
return Math.round(value * 1e6) / 1e6;
|
|
98453
|
+
}
|
|
97884
98454
|
function groupElements(elements, ids, groupId) {
|
|
97885
98455
|
const idSet = new Set(ids);
|
|
97886
98456
|
const gathered = [];
|
|
@@ -97927,7 +98497,7 @@ function groupElements(elements, ids, groupId) {
|
|
|
97927
98497
|
x: el.x - groupX,
|
|
97928
98498
|
y: el.y - groupY
|
|
97929
98499
|
}));
|
|
97930
|
-
const
|
|
98500
|
+
const group2 = {
|
|
97931
98501
|
type: "group",
|
|
97932
98502
|
id: groupId,
|
|
97933
98503
|
name: "Group",
|
|
@@ -97946,7 +98516,7 @@ function groupElements(elements, ids, groupId) {
|
|
|
97946
98516
|
}
|
|
97947
98517
|
const result = [
|
|
97948
98518
|
...remaining.slice(0, adjustedIndex),
|
|
97949
|
-
|
|
98519
|
+
group2,
|
|
97950
98520
|
...remaining.slice(adjustedIndex)
|
|
97951
98521
|
];
|
|
97952
98522
|
return { elements: result, groupId };
|
|
@@ -98178,38 +98748,38 @@ function resolveSlideId(slide, index) {
|
|
|
98178
98748
|
const cSld = rawXml?.["p:sld"];
|
|
98179
98749
|
return String(cSld?.["@_id"] || slide?.slideNumber || index + 1);
|
|
98180
98750
|
}
|
|
98181
|
-
function groupSlidesBySection(
|
|
98751
|
+
function groupSlidesBySection(sections2, slides) {
|
|
98182
98752
|
if (slides.length === 0) {
|
|
98183
98753
|
return [];
|
|
98184
98754
|
}
|
|
98185
|
-
if (
|
|
98755
|
+
if (sections2.length === 0) {
|
|
98186
98756
|
return [
|
|
98187
98757
|
{ section: void 0, slides: [...slides], slideIndexes: slides.map((_slide, i) => i) }
|
|
98188
98758
|
];
|
|
98189
98759
|
}
|
|
98190
|
-
const sectionById = new Map(
|
|
98760
|
+
const sectionById = new Map(sections2.map((section) => [section.id, section]));
|
|
98191
98761
|
const grouped = /* @__PURE__ */ new Map();
|
|
98192
98762
|
const ungrouped = {
|
|
98193
98763
|
section: void 0,
|
|
98194
98764
|
slides: [],
|
|
98195
98765
|
slideIndexes: []
|
|
98196
98766
|
};
|
|
98197
|
-
for (const section of
|
|
98767
|
+
for (const section of sections2) {
|
|
98198
98768
|
grouped.set(section.id, { section, slides: [], slideIndexes: [] });
|
|
98199
98769
|
}
|
|
98200
98770
|
slides.forEach((slide, index) => {
|
|
98201
|
-
const
|
|
98202
|
-
const target =
|
|
98771
|
+
const group2 = slide.sectionId ? grouped.get(slide.sectionId) : void 0;
|
|
98772
|
+
const target = group2 && sectionById.has(slide.sectionId ?? "") ? group2 : ungrouped;
|
|
98203
98773
|
target.slides.push(slide);
|
|
98204
98774
|
target.slideIndexes.push(index);
|
|
98205
98775
|
});
|
|
98206
|
-
const result =
|
|
98776
|
+
const result = sections2.map((section) => grouped.get(section.id)).filter((group2) => group2.slides.length > 0);
|
|
98207
98777
|
if (ungrouped.slides.length > 0) {
|
|
98208
98778
|
result.push(ungrouped);
|
|
98209
98779
|
}
|
|
98210
98780
|
return result;
|
|
98211
98781
|
}
|
|
98212
|
-
function addSection(
|
|
98782
|
+
function addSection(sections2, slides, name, afterSlideIndex, idGenerator = generateSectionId) {
|
|
98213
98783
|
const newId = idGenerator();
|
|
98214
98784
|
const slideAtIndex = slides[afterSlideIndex];
|
|
98215
98785
|
const currentSectionId = slideAtIndex?.sectionId;
|
|
@@ -98224,9 +98794,9 @@ function addSection(sections, slides, name, afterSlideIndex, idGenerator = gener
|
|
|
98224
98794
|
const nextSlides = slides.map(
|
|
98225
98795
|
(s, i) => claimedSlideIndexes.includes(i) ? { ...s, sectionId: newId, sectionName: name } : s
|
|
98226
98796
|
);
|
|
98227
|
-
const insertIndex = currentSectionId !== void 0 ?
|
|
98797
|
+
const insertIndex = currentSectionId !== void 0 ? sections2.findIndex((sec) => sec.id === currentSectionId) + 1 : sections2.length;
|
|
98228
98798
|
const newSectionSlideIds = claimedSlideIndexes.map((i) => resolveSlideId(slides[i], i));
|
|
98229
|
-
const updated =
|
|
98799
|
+
const updated = sections2.map(
|
|
98230
98800
|
(sec) => sec.id === currentSectionId ? { ...sec, slideIds: sec.slideIds.filter((sid) => !newSectionSlideIds.includes(sid)) } : sec
|
|
98231
98801
|
);
|
|
98232
98802
|
const newSection = { id: newId, name, slideIds: newSectionSlideIds };
|
|
@@ -98234,20 +98804,20 @@ function addSection(sections, slides, name, afterSlideIndex, idGenerator = gener
|
|
|
98234
98804
|
nextSections.splice(insertIndex, 0, newSection);
|
|
98235
98805
|
return { sections: nextSections, slides: nextSlides };
|
|
98236
98806
|
}
|
|
98237
|
-
function renameSection(
|
|
98807
|
+
function renameSection(sections2, slides, sectionId, newName) {
|
|
98238
98808
|
return {
|
|
98239
|
-
sections:
|
|
98809
|
+
sections: sections2.map((sec) => sec.id === sectionId ? { ...sec, name: newName } : sec),
|
|
98240
98810
|
slides: slides.map((s) => s.sectionId === sectionId ? { ...s, sectionName: newName } : s)
|
|
98241
98811
|
};
|
|
98242
98812
|
}
|
|
98243
|
-
function deleteSection(
|
|
98244
|
-
const idx =
|
|
98813
|
+
function deleteSection(sections2, slides, sectionId) {
|
|
98814
|
+
const idx = sections2.findIndex((sec) => sec.id === sectionId);
|
|
98245
98815
|
if (idx === -1) {
|
|
98246
|
-
return { sections, slides };
|
|
98816
|
+
return { sections: sections2, slides };
|
|
98247
98817
|
}
|
|
98248
|
-
const deletedSection =
|
|
98249
|
-
const prevSection = idx > 0 ?
|
|
98250
|
-
const filtered =
|
|
98818
|
+
const deletedSection = sections2[idx];
|
|
98819
|
+
const prevSection = idx > 0 ? sections2[idx - 1] : void 0;
|
|
98820
|
+
const filtered = sections2.filter((sec) => sec.id !== sectionId);
|
|
98251
98821
|
const nextSections = prevSection !== void 0 ? filtered.map(
|
|
98252
98822
|
(sec) => sec.id === prevSection.id ? { ...sec, slideIds: [...sec.slideIds, ...deletedSection.slideIds] } : sec
|
|
98253
98823
|
) : filtered;
|
|
@@ -98262,34 +98832,34 @@ function deleteSection(sections, slides, sectionId) {
|
|
|
98262
98832
|
});
|
|
98263
98833
|
return { sections: nextSections, slides: nextSlides };
|
|
98264
98834
|
}
|
|
98265
|
-
function moveSectionUp(
|
|
98266
|
-
const idx =
|
|
98835
|
+
function moveSectionUp(sections2, sectionId) {
|
|
98836
|
+
const idx = sections2.findIndex((sec) => sec.id === sectionId);
|
|
98267
98837
|
if (idx <= 0) {
|
|
98268
|
-
return
|
|
98838
|
+
return sections2;
|
|
98269
98839
|
}
|
|
98270
|
-
const next = [...
|
|
98840
|
+
const next = [...sections2];
|
|
98271
98841
|
[next[idx - 1], next[idx]] = [next[idx], next[idx - 1]];
|
|
98272
98842
|
return next;
|
|
98273
98843
|
}
|
|
98274
|
-
function moveSectionDown(
|
|
98275
|
-
const idx =
|
|
98276
|
-
if (idx === -1 || idx >=
|
|
98277
|
-
return
|
|
98844
|
+
function moveSectionDown(sections2, sectionId) {
|
|
98845
|
+
const idx = sections2.findIndex((sec) => sec.id === sectionId);
|
|
98846
|
+
if (idx === -1 || idx >= sections2.length - 1) {
|
|
98847
|
+
return sections2;
|
|
98278
98848
|
}
|
|
98279
|
-
const next = [...
|
|
98849
|
+
const next = [...sections2];
|
|
98280
98850
|
[next[idx], next[idx + 1]] = [next[idx + 1], next[idx]];
|
|
98281
98851
|
return next;
|
|
98282
98852
|
}
|
|
98283
|
-
function moveSlidesToSection(
|
|
98284
|
-
const targetSection =
|
|
98853
|
+
function moveSlidesToSection(sections2, slides, slideIndexes, targetSectionId) {
|
|
98854
|
+
const targetSection = sections2.find((sec) => sec.id === targetSectionId);
|
|
98285
98855
|
if (!targetSection) {
|
|
98286
|
-
return { sections, slides };
|
|
98856
|
+
return { sections: sections2, slides };
|
|
98287
98857
|
}
|
|
98288
98858
|
const nextSlides = slides.map(
|
|
98289
98859
|
(s, i) => slideIndexes.includes(i) ? { ...s, sectionId: targetSectionId, sectionName: targetSection.name } : s
|
|
98290
98860
|
);
|
|
98291
98861
|
const movedSlideIds = slideIndexes.map((i) => resolveSlideId(slides[i], i));
|
|
98292
|
-
const nextSections =
|
|
98862
|
+
const nextSections = sections2.map((sec) => {
|
|
98293
98863
|
if (sec.id === targetSectionId) {
|
|
98294
98864
|
return {
|
|
98295
98865
|
...sec,
|
|
@@ -98666,7 +99236,10 @@ function resolveLineHeight(textStyle, hasItalicRuns2) {
|
|
|
98666
99236
|
if (typeof textStyle?.lineSpacingExactPt === "number" && textStyle.lineSpacingExactPt > 0) {
|
|
98667
99237
|
return `${textStyle.lineSpacingExactPt}pt`;
|
|
98668
99238
|
}
|
|
98669
|
-
return textStyle?.lineSpacing
|
|
99239
|
+
return proportionalLineHeight(textStyle?.lineSpacing);
|
|
99240
|
+
}
|
|
99241
|
+
function proportionalLineHeight(lineSpacing) {
|
|
99242
|
+
return typeof lineSpacing === "number" && lineSpacing > 0 ? lineSpacing * DEFAULT_LINE_HEIGHT : DEFAULT_LINE_HEIGHT;
|
|
98670
99243
|
}
|
|
98671
99244
|
function toCssWritingMode(textDirection) {
|
|
98672
99245
|
switch (textDirection) {
|
|
@@ -98717,7 +99290,7 @@ function computeAutoFitTextStyle(input) {
|
|
|
98717
99290
|
result.fontSize = Math.max(6, Math.round(baseFontSize * ts.autoFitFontScale));
|
|
98718
99291
|
} else if (ts.autoFitMode !== "normal") {
|
|
98719
99292
|
const textLength = text2.length;
|
|
98720
|
-
const lineHeight = ts.lineSpacingExactPt ? ts.lineSpacingExactPt / baseFontSize : ts.lineSpacing
|
|
99293
|
+
const lineHeight = ts.lineSpacingExactPt ? ts.lineSpacingExactPt / baseFontSize : proportionalLineHeight(ts.lineSpacing);
|
|
98721
99294
|
const approxCharsPerLine = Math.max(1, Math.floor(width / (baseFontSize * 0.6)));
|
|
98722
99295
|
const estimatedLines = Math.max(1, Math.ceil(textLength / approxCharsPerLine));
|
|
98723
99296
|
const requiredHeight = estimatedLines * baseFontSize * lineHeight;
|
|
@@ -98728,8 +99301,7 @@ function computeAutoFitTextStyle(input) {
|
|
|
98728
99301
|
}
|
|
98729
99302
|
}
|
|
98730
99303
|
if (ts.autoFitLineSpacingReduction !== void 0 && ts.autoFitLineSpacingReduction > 0) {
|
|
98731
|
-
|
|
98732
|
-
result.lineHeight = baseLineHeight * (1 - ts.autoFitLineSpacingReduction);
|
|
99304
|
+
result.lineHeight = proportionalLineHeight(ts.lineSpacing) * (1 - ts.autoFitLineSpacingReduction);
|
|
98733
99305
|
}
|
|
98734
99306
|
return result;
|
|
98735
99307
|
}
|
|
@@ -98864,7 +99436,7 @@ function buildTextBlockStyle(element, options = {}) {
|
|
|
98864
99436
|
style.unicodeBidi = "plaintext";
|
|
98865
99437
|
}
|
|
98866
99438
|
style.fontSize = ts?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
98867
|
-
style.fontFamily = ts?.fontFamily
|
|
99439
|
+
style.fontFamily = ts?.fontFamily ? getSubstituteFontFamily(ts.fontFamily, parsePanoseString(ts.latinFontPanose)) : DEFAULT_FONT_FAMILY;
|
|
98868
99440
|
style.fontWeight = ts?.bold ? 700 : 400;
|
|
98869
99441
|
style.fontStyle = ts?.italic ? "italic" : "normal";
|
|
98870
99442
|
style.textDecorationLine = decorations.length > 0 ? decorations.join(" ") : "none";
|
|
@@ -99549,6 +100121,8 @@ function buildTextRunFilterChain(style) {
|
|
|
99549
100121
|
}
|
|
99550
100122
|
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
99551
100123
|
}
|
|
100124
|
+
var POWERPOINT_METRIC_TRACKING_EM = 3e-3;
|
|
100125
|
+
var POWERPOINT_METRIC_TRACKING = `${POWERPOINT_METRIC_TRACKING_EM}em`;
|
|
99552
100126
|
function resolveParagraphStrutFontSize(segments, bodyFontSize) {
|
|
99553
100127
|
let largest;
|
|
99554
100128
|
for (const segment of segments) {
|
|
@@ -99918,8 +100492,8 @@ function toAbsolute(child22, offsetX, offsetY) {
|
|
|
99918
100492
|
function sameBox(a, b) {
|
|
99919
100493
|
return Math.abs(a.x - b.x) <= 0.5 && Math.abs(a.y - b.y) <= 0.5 && Math.abs(a.width - b.width) <= 0.5 && Math.abs(a.height - b.height) <= 0.5;
|
|
99920
100494
|
}
|
|
99921
|
-
function correspondingGroup(
|
|
99922
|
-
const morphName = getElementMorphName(
|
|
100495
|
+
function correspondingGroup(group2, candidates) {
|
|
100496
|
+
const morphName = getElementMorphName(group2);
|
|
99923
100497
|
return candidates.find((candidate) => {
|
|
99924
100498
|
if (candidate.type !== "group") {
|
|
99925
100499
|
return false;
|
|
@@ -99927,10 +100501,10 @@ function correspondingGroup(group, candidates) {
|
|
|
99927
100501
|
if (morphName !== void 0 && getElementMorphName(candidate) === morphName) {
|
|
99928
100502
|
return true;
|
|
99929
100503
|
}
|
|
99930
|
-
if (
|
|
100504
|
+
if (group2.name && candidate.name === group2.name) {
|
|
99931
100505
|
return true;
|
|
99932
100506
|
}
|
|
99933
|
-
return sameBox(
|
|
100507
|
+
return sameBox(group2, candidate);
|
|
99934
100508
|
});
|
|
99935
100509
|
}
|
|
99936
100510
|
function flattenMorphElements(elements, counterpart, offsetX = 0, offsetY = 0) {
|
|
@@ -106322,8 +106896,8 @@ async function loadOrbitControlsCtor() {
|
|
|
106322
106896
|
}
|
|
106323
106897
|
}
|
|
106324
106898
|
function loadGltf(loader, url) {
|
|
106325
|
-
return new Promise((
|
|
106326
|
-
loader.load(url,
|
|
106899
|
+
return new Promise((resolve2, reject) => {
|
|
106900
|
+
loader.load(url, resolve2, void 0, reject);
|
|
106327
106901
|
});
|
|
106328
106902
|
}
|
|
106329
106903
|
function centerAndFit(three, root) {
|
|
@@ -106790,9 +107364,9 @@ function isExportAbortError(err) {
|
|
|
106790
107364
|
}
|
|
106791
107365
|
var PPTX_OPEN_ACCEPT = ".pptx,.ppsx,.pptm,.potx";
|
|
106792
107366
|
function openFilePicker(options = {}) {
|
|
106793
|
-
return new Promise((
|
|
107367
|
+
return new Promise((resolve2) => {
|
|
106794
107368
|
if (typeof document === "undefined") {
|
|
106795
|
-
|
|
107369
|
+
resolve2(null);
|
|
106796
107370
|
return;
|
|
106797
107371
|
}
|
|
106798
107372
|
const input = document.createElement("input");
|
|
@@ -106808,7 +107382,7 @@ function openFilePicker(options = {}) {
|
|
|
106808
107382
|
}
|
|
106809
107383
|
settled = true;
|
|
106810
107384
|
input.remove();
|
|
106811
|
-
|
|
107385
|
+
resolve2(file);
|
|
106812
107386
|
};
|
|
106813
107387
|
input.addEventListener("change", () => finish(input.files?.[0] ?? null));
|
|
106814
107388
|
input.addEventListener("cancel", () => finish(null));
|
|
@@ -107375,7 +107949,7 @@ async function swapPresentationWindows(presenter, audience) {
|
|
|
107375
107949
|
}
|
|
107376
107950
|
}
|
|
107377
107951
|
function openDeckDb() {
|
|
107378
|
-
return new Promise((
|
|
107952
|
+
return new Promise((resolve2, reject) => {
|
|
107379
107953
|
const request = indexedDB.open(DB_NAME, DB_VERSION);
|
|
107380
107954
|
request.onupgradeneeded = () => {
|
|
107381
107955
|
const db = request.result;
|
|
@@ -107383,13 +107957,13 @@ function openDeckDb() {
|
|
|
107383
107957
|
db.createObjectStore(STORE_NAME);
|
|
107384
107958
|
}
|
|
107385
107959
|
};
|
|
107386
|
-
request.onsuccess = () =>
|
|
107960
|
+
request.onsuccess = () => resolve2(request.result);
|
|
107387
107961
|
request.onerror = () => reject(request.error);
|
|
107388
107962
|
});
|
|
107389
107963
|
}
|
|
107390
107964
|
async function storePresentationDeck(sessionId, content) {
|
|
107391
107965
|
const db = await openDeckDb();
|
|
107392
|
-
return new Promise((
|
|
107966
|
+
return new Promise((resolve2, reject) => {
|
|
107393
107967
|
const tx = db.transaction(STORE_NAME, "readwrite");
|
|
107394
107968
|
const bytes = content instanceof Uint8Array ? content : new Uint8Array(content);
|
|
107395
107969
|
tx.objectStore(STORE_NAME).put(
|
|
@@ -107398,7 +107972,7 @@ async function storePresentationDeck(sessionId, content) {
|
|
|
107398
107972
|
);
|
|
107399
107973
|
tx.oncomplete = () => {
|
|
107400
107974
|
db.close();
|
|
107401
|
-
|
|
107975
|
+
resolve2();
|
|
107402
107976
|
};
|
|
107403
107977
|
tx.onerror = () => {
|
|
107404
107978
|
db.close();
|
|
@@ -107409,17 +107983,17 @@ async function storePresentationDeck(sessionId, content) {
|
|
|
107409
107983
|
async function loadPresentationDeck(sessionId) {
|
|
107410
107984
|
try {
|
|
107411
107985
|
const db = await openDeckDb();
|
|
107412
|
-
return await new Promise((
|
|
107986
|
+
return await new Promise((resolve2, reject) => {
|
|
107413
107987
|
const request = db.transaction(STORE_NAME, "readonly").objectStore(STORE_NAME).get(sessionId);
|
|
107414
107988
|
request.onsuccess = () => {
|
|
107415
107989
|
db.close();
|
|
107416
107990
|
const record = request.result;
|
|
107417
107991
|
if (!record || Date.now() - record.createdAt > MAX_DECK_AGE_MS) {
|
|
107418
|
-
|
|
107992
|
+
resolve2(null);
|
|
107419
107993
|
return;
|
|
107420
107994
|
}
|
|
107421
107995
|
const raw = record.bytes;
|
|
107422
|
-
|
|
107996
|
+
resolve2(
|
|
107423
107997
|
raw instanceof Uint8Array ? raw : raw instanceof ArrayBuffer ? new Uint8Array(raw) : null
|
|
107424
107998
|
);
|
|
107425
107999
|
};
|
|
@@ -107435,16 +108009,16 @@ async function loadPresentationDeck(sessionId) {
|
|
|
107435
108009
|
async function clearPresentationDeck(sessionId) {
|
|
107436
108010
|
try {
|
|
107437
108011
|
const db = await openDeckDb();
|
|
107438
|
-
await new Promise((
|
|
108012
|
+
await new Promise((resolve2) => {
|
|
107439
108013
|
const tx = db.transaction(STORE_NAME, "readwrite");
|
|
107440
108014
|
tx.objectStore(STORE_NAME).delete(sessionId);
|
|
107441
108015
|
tx.oncomplete = () => {
|
|
107442
108016
|
db.close();
|
|
107443
|
-
|
|
108017
|
+
resolve2();
|
|
107444
108018
|
};
|
|
107445
108019
|
tx.onerror = () => {
|
|
107446
108020
|
db.close();
|
|
107447
|
-
|
|
108021
|
+
resolve2();
|
|
107448
108022
|
};
|
|
107449
108023
|
});
|
|
107450
108024
|
} catch {
|
|
@@ -107456,7 +108030,7 @@ var STORE_NAME2 = "content";
|
|
|
107456
108030
|
var CONTENT_KEY = "pptx-bytes";
|
|
107457
108031
|
var MAX_CONTENT_AGE_MS = 5 * 60 * 1e3;
|
|
107458
108032
|
function openDb() {
|
|
107459
|
-
return new Promise((
|
|
108033
|
+
return new Promise((resolve2, reject) => {
|
|
107460
108034
|
const request = indexedDB.open(DB_NAME2, DB_VERSION2);
|
|
107461
108035
|
request.onupgradeneeded = () => {
|
|
107462
108036
|
const db = request.result;
|
|
@@ -107464,7 +108038,7 @@ function openDb() {
|
|
|
107464
108038
|
db.createObjectStore(STORE_NAME2);
|
|
107465
108039
|
}
|
|
107466
108040
|
};
|
|
107467
|
-
request.onsuccess = () =>
|
|
108041
|
+
request.onsuccess = () => resolve2(request.result);
|
|
107468
108042
|
request.onerror = () => reject(request.error);
|
|
107469
108043
|
});
|
|
107470
108044
|
}
|
|
@@ -107473,7 +108047,7 @@ async function storeAudienceContent(content, sessionId) {
|
|
|
107473
108047
|
return storePresentationDeck(sessionId, content);
|
|
107474
108048
|
}
|
|
107475
108049
|
const db = await openDb();
|
|
107476
|
-
return new Promise((
|
|
108050
|
+
return new Promise((resolve2, reject) => {
|
|
107477
108051
|
const tx = db.transaction(STORE_NAME2, "readwrite");
|
|
107478
108052
|
const store = tx.objectStore(STORE_NAME2);
|
|
107479
108053
|
const bytes = content instanceof Uint8Array ? content : new Uint8Array(content);
|
|
@@ -107481,7 +108055,7 @@ async function storeAudienceContent(content, sessionId) {
|
|
|
107481
108055
|
store.put(record, CONTENT_KEY);
|
|
107482
108056
|
tx.oncomplete = () => {
|
|
107483
108057
|
db.close();
|
|
107484
|
-
|
|
108058
|
+
resolve2();
|
|
107485
108059
|
};
|
|
107486
108060
|
tx.onerror = () => {
|
|
107487
108061
|
db.close();
|
|
@@ -107495,7 +108069,7 @@ async function loadAudienceContent(sessionId) {
|
|
|
107495
108069
|
}
|
|
107496
108070
|
try {
|
|
107497
108071
|
const db = await openDb();
|
|
107498
|
-
return new Promise((
|
|
108072
|
+
return new Promise((resolve2, reject) => {
|
|
107499
108073
|
const tx = db.transaction(STORE_NAME2, "readonly");
|
|
107500
108074
|
const store = tx.objectStore(STORE_NAME2);
|
|
107501
108075
|
const request = store.get(CONTENT_KEY);
|
|
@@ -107506,20 +108080,20 @@ async function loadAudienceContent(sessionId) {
|
|
|
107506
108080
|
const record = result;
|
|
107507
108081
|
const age = Date.now() - record.createdAt;
|
|
107508
108082
|
if (age > MAX_CONTENT_AGE_MS) {
|
|
107509
|
-
|
|
108083
|
+
resolve2(null);
|
|
107510
108084
|
return;
|
|
107511
108085
|
}
|
|
107512
108086
|
const raw = record.bytes;
|
|
107513
108087
|
if (raw instanceof Uint8Array) {
|
|
107514
|
-
|
|
108088
|
+
resolve2(raw);
|
|
107515
108089
|
} else if (raw instanceof ArrayBuffer) {
|
|
107516
|
-
|
|
108090
|
+
resolve2(new Uint8Array(raw));
|
|
107517
108091
|
} else {
|
|
107518
|
-
|
|
108092
|
+
resolve2(null);
|
|
107519
108093
|
}
|
|
107520
108094
|
return;
|
|
107521
108095
|
}
|
|
107522
|
-
|
|
108096
|
+
resolve2(null);
|
|
107523
108097
|
};
|
|
107524
108098
|
request.onerror = () => {
|
|
107525
108099
|
db.close();
|
|
@@ -107536,17 +108110,17 @@ async function clearAudienceContent(sessionId) {
|
|
|
107536
108110
|
}
|
|
107537
108111
|
try {
|
|
107538
108112
|
const db = await openDb();
|
|
107539
|
-
return new Promise((
|
|
108113
|
+
return new Promise((resolve2) => {
|
|
107540
108114
|
const tx = db.transaction(STORE_NAME2, "readwrite");
|
|
107541
108115
|
const store = tx.objectStore(STORE_NAME2);
|
|
107542
108116
|
store.delete(CONTENT_KEY);
|
|
107543
108117
|
tx.oncomplete = () => {
|
|
107544
108118
|
db.close();
|
|
107545
|
-
|
|
108119
|
+
resolve2();
|
|
107546
108120
|
};
|
|
107547
108121
|
tx.onerror = () => {
|
|
107548
108122
|
db.close();
|
|
107549
|
-
|
|
108123
|
+
resolve2();
|
|
107550
108124
|
};
|
|
107551
108125
|
});
|
|
107552
108126
|
} catch {
|
|
@@ -108101,19 +108675,19 @@ function groupElementParagraphs(element) {
|
|
|
108101
108675
|
}
|
|
108102
108676
|
return groups;
|
|
108103
108677
|
}
|
|
108104
|
-
function paragraphGroupText(
|
|
108105
|
-
return
|
|
108678
|
+
function paragraphGroupText(group2) {
|
|
108679
|
+
return group2.content.map((segment) => segment.isLineBreak ? " " : segment.text).join("");
|
|
108106
108680
|
}
|
|
108107
|
-
function paragraphGroupLevel(
|
|
108108
|
-
const first =
|
|
108681
|
+
function paragraphGroupLevel(group2) {
|
|
108682
|
+
const first = group2.marker ?? group2.content[0];
|
|
108109
108683
|
const level = first?.paragraphLevel;
|
|
108110
108684
|
return typeof level === "number" && level > 0 ? Math.min(level, MAX_PARAGRAPH_LEVEL) : 0;
|
|
108111
108685
|
}
|
|
108112
108686
|
function readElementParagraphs(element) {
|
|
108113
108687
|
const groups = groupElementParagraphs(element);
|
|
108114
|
-
const paragraphs = groups.map((
|
|
108115
|
-
text: paragraphGroupText(
|
|
108116
|
-
level: paragraphGroupLevel(
|
|
108688
|
+
const paragraphs = groups.map((group2) => ({
|
|
108689
|
+
text: paragraphGroupText(group2),
|
|
108690
|
+
level: paragraphGroupLevel(group2)
|
|
108117
108691
|
}));
|
|
108118
108692
|
let last = paragraphs.length - 1;
|
|
108119
108693
|
while (last >= 0 && paragraphs[last].text.length === 0) {
|
|
@@ -108228,11 +108802,11 @@ function withLevel(segments, level) {
|
|
|
108228
108802
|
return next;
|
|
108229
108803
|
});
|
|
108230
108804
|
}
|
|
108231
|
-
function rebuildParagraph(
|
|
108232
|
-
if (
|
|
108233
|
-
return [...
|
|
108805
|
+
function rebuildParagraph(group2, donor, text2, elementStyle) {
|
|
108806
|
+
if (group2 && paragraphGroupText(group2) === text2) {
|
|
108807
|
+
return [...group2.marker ? [group2.marker] : [], ...group2.content];
|
|
108234
108808
|
}
|
|
108235
|
-
const source =
|
|
108809
|
+
const source = group2 ?? donor;
|
|
108236
108810
|
const marker = source?.marker ? [source.marker] : [];
|
|
108237
108811
|
const content = remapTextToSegments(text2, source?.content, elementStyle);
|
|
108238
108812
|
return [...marker, ...content];
|
|
@@ -109015,7 +109589,7 @@ function replacePixels(data, fromColor, toColor, threshold, toTransparent) {
|
|
|
109015
109589
|
}
|
|
109016
109590
|
var DEFAULT_COLOR_CHANGE_TOLERANCE = 12;
|
|
109017
109591
|
function applyColorChange(imageDataUrl, fromHex, toHex22, tolerancePct = DEFAULT_COLOR_CHANGE_TOLERANCE, toTransparent = false) {
|
|
109018
|
-
return new Promise((
|
|
109592
|
+
return new Promise((resolve2, reject) => {
|
|
109019
109593
|
const fromColor = parseHexToRgb(fromHex);
|
|
109020
109594
|
const toColor = parseHexToRgb(toHex22);
|
|
109021
109595
|
if (!fromColor || !toColor) {
|
|
@@ -109043,7 +109617,7 @@ function applyColorChange(imageDataUrl, fromHex, toHex22, tolerancePct = DEFAULT
|
|
|
109043
109617
|
const threshold = toleranceToThreshold(tolerancePct);
|
|
109044
109618
|
replacePixels(imageData.data, fromColor, toColor, threshold, toTransparent);
|
|
109045
109619
|
ctx.putImageData(imageData, 0, 0);
|
|
109046
|
-
|
|
109620
|
+
resolve2({
|
|
109047
109621
|
dataUrl: canvas.toDataURL("image/png"),
|
|
109048
109622
|
width: w,
|
|
109049
109623
|
height: h
|
|
@@ -109094,7 +109668,7 @@ function mapDuotonePixels(data, shadow, highlight) {
|
|
|
109094
109668
|
}
|
|
109095
109669
|
}
|
|
109096
109670
|
function applyDuotone(imageDataUrl, shadowHex, highlightHex) {
|
|
109097
|
-
return new Promise((
|
|
109671
|
+
return new Promise((resolve2, reject) => {
|
|
109098
109672
|
const shadow = parseHexToRgb(shadowHex);
|
|
109099
109673
|
const highlight = parseHexToRgb(highlightHex);
|
|
109100
109674
|
if (!shadow || !highlight) {
|
|
@@ -109121,7 +109695,7 @@ function applyDuotone(imageDataUrl, shadowHex, highlightHex) {
|
|
|
109121
109695
|
const imageData = ctx.getImageData(0, 0, w, h);
|
|
109122
109696
|
mapDuotonePixels(imageData.data, shadow, highlight);
|
|
109123
109697
|
ctx.putImageData(imageData, 0, 0);
|
|
109124
|
-
|
|
109698
|
+
resolve2({
|
|
109125
109699
|
dataUrl: canvas.toDataURL("image/png"),
|
|
109126
109700
|
width: w,
|
|
109127
109701
|
height: h
|
|
@@ -110119,6 +110693,93 @@ function mediaTransportVisible(surface) {
|
|
|
110119
110693
|
}
|
|
110120
110694
|
return surface.canvasTransport;
|
|
110121
110695
|
}
|
|
110696
|
+
var persistentAudioMap = /* @__PURE__ */ new Map();
|
|
110697
|
+
function registerPersistentAudio(elementId, dataUrl, mimetype, loop, volume, trimStartSec) {
|
|
110698
|
+
if (persistentAudioMap.has(elementId) || typeof document === "undefined") {
|
|
110699
|
+
return;
|
|
110700
|
+
}
|
|
110701
|
+
const audio = document.createElement("audio");
|
|
110702
|
+
audio.src = dataUrl;
|
|
110703
|
+
if (mimetype) {
|
|
110704
|
+
const source = document.createElement("source");
|
|
110705
|
+
source.src = dataUrl;
|
|
110706
|
+
source.type = mimetype;
|
|
110707
|
+
audio.appendChild(source);
|
|
110708
|
+
}
|
|
110709
|
+
audio.loop = loop;
|
|
110710
|
+
audio.volume = Math.max(0, Math.min(1, volume));
|
|
110711
|
+
if (trimStartSec > 0) {
|
|
110712
|
+
try {
|
|
110713
|
+
audio.currentTime = trimStartSec;
|
|
110714
|
+
} catch {
|
|
110715
|
+
}
|
|
110716
|
+
}
|
|
110717
|
+
audio.style.display = "none";
|
|
110718
|
+
audio.setAttribute("data-pptx-persistent-audio", elementId);
|
|
110719
|
+
document.body.appendChild(audio);
|
|
110720
|
+
persistentAudioMap.set(elementId, { elementId, audio, loop, pausedByVisibility: false });
|
|
110721
|
+
void audio.play().catch(() => {
|
|
110722
|
+
});
|
|
110723
|
+
}
|
|
110724
|
+
function stopAllPersistentAudio() {
|
|
110725
|
+
for (const entry2 of persistentAudioMap.values()) {
|
|
110726
|
+
entry2.audio.pause();
|
|
110727
|
+
entry2.audio.remove();
|
|
110728
|
+
}
|
|
110729
|
+
persistentAudioMap.clear();
|
|
110730
|
+
}
|
|
110731
|
+
function pauseAllPersistentAudio() {
|
|
110732
|
+
for (const entry2 of persistentAudioMap.values()) {
|
|
110733
|
+
if (!entry2.audio.paused) {
|
|
110734
|
+
entry2.pausedByVisibility = true;
|
|
110735
|
+
entry2.audio.pause();
|
|
110736
|
+
}
|
|
110737
|
+
}
|
|
110738
|
+
}
|
|
110739
|
+
function resumeAllPersistentAudio() {
|
|
110740
|
+
for (const entry2 of persistentAudioMap.values()) {
|
|
110741
|
+
if (entry2.pausedByVisibility) {
|
|
110742
|
+
entry2.pausedByVisibility = false;
|
|
110743
|
+
void entry2.audio.play().catch(() => {
|
|
110744
|
+
});
|
|
110745
|
+
}
|
|
110746
|
+
}
|
|
110747
|
+
}
|
|
110748
|
+
function attachPresentationVisibilityPause(options = {}) {
|
|
110749
|
+
if (typeof document === "undefined") {
|
|
110750
|
+
return () => {
|
|
110751
|
+
};
|
|
110752
|
+
}
|
|
110753
|
+
const root = options.root ?? document;
|
|
110754
|
+
let pausedMedia = [];
|
|
110755
|
+
const onVisibilityChange = () => {
|
|
110756
|
+
if (document.visibilityState === "hidden") {
|
|
110757
|
+
pausedMedia = [];
|
|
110758
|
+
for (const media of root.querySelectorAll("audio, video")) {
|
|
110759
|
+
if (!media.paused && !media.ended) {
|
|
110760
|
+
pausedMedia.push(media);
|
|
110761
|
+
media.pause();
|
|
110762
|
+
}
|
|
110763
|
+
}
|
|
110764
|
+
pauseAllPersistentAudio();
|
|
110765
|
+
options.onHidden?.();
|
|
110766
|
+
return;
|
|
110767
|
+
}
|
|
110768
|
+
for (const media of pausedMedia) {
|
|
110769
|
+
if (media.isConnected) {
|
|
110770
|
+
void media.play().catch(() => {
|
|
110771
|
+
});
|
|
110772
|
+
}
|
|
110773
|
+
}
|
|
110774
|
+
pausedMedia = [];
|
|
110775
|
+
resumeAllPersistentAudio();
|
|
110776
|
+
options.onVisible?.();
|
|
110777
|
+
};
|
|
110778
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
110779
|
+
return () => {
|
|
110780
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
110781
|
+
};
|
|
110782
|
+
}
|
|
110122
110783
|
function buildSummaryZoomView(element, lookup) {
|
|
110123
110784
|
if (element.zoomType !== "summary" || !element.summaryTargets?.length) {
|
|
110124
110785
|
return void 0;
|
|
@@ -111210,7 +111871,7 @@ var AUTOSAVE_DB_NAME = "pptx-viewer-autosave";
|
|
|
111210
111871
|
var AUTOSAVE_DB_VERSION = 1;
|
|
111211
111872
|
var AUTOSAVE_STORE_NAME = "recoveryVersions";
|
|
111212
111873
|
function openAutosaveDb() {
|
|
111213
|
-
return new Promise((
|
|
111874
|
+
return new Promise((resolve2, reject) => {
|
|
111214
111875
|
const req = indexedDB.open(AUTOSAVE_DB_NAME, AUTOSAVE_DB_VERSION);
|
|
111215
111876
|
req.onupgradeneeded = () => {
|
|
111216
111877
|
const db = req.result;
|
|
@@ -111218,13 +111879,13 @@ function openAutosaveDb() {
|
|
|
111218
111879
|
db.createObjectStore(AUTOSAVE_STORE_NAME, { keyPath: "key" });
|
|
111219
111880
|
}
|
|
111220
111881
|
};
|
|
111221
|
-
req.onsuccess = () =>
|
|
111882
|
+
req.onsuccess = () => resolve2(req.result);
|
|
111222
111883
|
req.onerror = () => reject(req.error);
|
|
111223
111884
|
});
|
|
111224
111885
|
}
|
|
111225
111886
|
async function deleteOldestAutosaveEntry() {
|
|
111226
111887
|
const db = await openAutosaveDb();
|
|
111227
|
-
return new Promise((
|
|
111888
|
+
return new Promise((resolve2) => {
|
|
111228
111889
|
try {
|
|
111229
111890
|
const tx = db.transaction(AUTOSAVE_STORE_NAME, "readwrite");
|
|
111230
111891
|
const store = tx.objectStore(AUTOSAVE_STORE_NAME);
|
|
@@ -111246,24 +111907,24 @@ async function deleteOldestAutosaveEntry() {
|
|
|
111246
111907
|
};
|
|
111247
111908
|
tx.oncomplete = () => {
|
|
111248
111909
|
db.close();
|
|
111249
|
-
|
|
111910
|
+
resolve2(oldestKey !== null);
|
|
111250
111911
|
};
|
|
111251
111912
|
tx.onerror = () => {
|
|
111252
111913
|
db.close();
|
|
111253
|
-
|
|
111914
|
+
resolve2(false);
|
|
111254
111915
|
};
|
|
111255
111916
|
} catch {
|
|
111256
111917
|
try {
|
|
111257
111918
|
db.close();
|
|
111258
111919
|
} catch {
|
|
111259
111920
|
}
|
|
111260
|
-
|
|
111921
|
+
resolve2(false);
|
|
111261
111922
|
}
|
|
111262
111923
|
});
|
|
111263
111924
|
}
|
|
111264
111925
|
function putAutosaveRecord(filePath, data) {
|
|
111265
111926
|
return openAutosaveDb().then(
|
|
111266
|
-
(db) => new Promise((
|
|
111927
|
+
(db) => new Promise((resolve2, reject) => {
|
|
111267
111928
|
const tx = db.transaction(AUTOSAVE_STORE_NAME, "readwrite");
|
|
111268
111929
|
const store = tx.objectStore(AUTOSAVE_STORE_NAME);
|
|
111269
111930
|
store.put({
|
|
@@ -111274,7 +111935,7 @@ function putAutosaveRecord(filePath, data) {
|
|
|
111274
111935
|
});
|
|
111275
111936
|
tx.oncomplete = () => {
|
|
111276
111937
|
db.close();
|
|
111277
|
-
|
|
111938
|
+
resolve2(true);
|
|
111278
111939
|
};
|
|
111279
111940
|
tx.onerror = () => {
|
|
111280
111941
|
db.close();
|
|
@@ -111285,23 +111946,23 @@ function putAutosaveRecord(filePath, data) {
|
|
|
111285
111946
|
}
|
|
111286
111947
|
async function getAutosaveSnapshot(filePath) {
|
|
111287
111948
|
const db = await openAutosaveDb();
|
|
111288
|
-
return new Promise((
|
|
111949
|
+
return new Promise((resolve2) => {
|
|
111289
111950
|
const tx = db.transaction(AUTOSAVE_STORE_NAME, "readonly");
|
|
111290
111951
|
const store = tx.objectStore(AUTOSAVE_STORE_NAME);
|
|
111291
111952
|
const req = store.get(filePath);
|
|
111292
111953
|
req.onsuccess = () => {
|
|
111293
111954
|
db.close();
|
|
111294
|
-
|
|
111955
|
+
resolve2(req.result);
|
|
111295
111956
|
};
|
|
111296
111957
|
req.onerror = () => {
|
|
111297
111958
|
db.close();
|
|
111298
|
-
|
|
111959
|
+
resolve2(void 0);
|
|
111299
111960
|
};
|
|
111300
111961
|
});
|
|
111301
111962
|
}
|
|
111302
111963
|
async function listAutosaveSnapshots() {
|
|
111303
111964
|
const db = await openAutosaveDb();
|
|
111304
|
-
return new Promise((
|
|
111965
|
+
return new Promise((resolve2) => {
|
|
111305
111966
|
const results = [];
|
|
111306
111967
|
try {
|
|
111307
111968
|
const tx = db.transaction(AUTOSAVE_STORE_NAME, "readonly");
|
|
@@ -111317,42 +111978,42 @@ async function listAutosaveSnapshots() {
|
|
|
111317
111978
|
};
|
|
111318
111979
|
tx.oncomplete = () => {
|
|
111319
111980
|
db.close();
|
|
111320
|
-
|
|
111981
|
+
resolve2(results);
|
|
111321
111982
|
};
|
|
111322
111983
|
tx.onerror = () => {
|
|
111323
111984
|
db.close();
|
|
111324
|
-
|
|
111985
|
+
resolve2([]);
|
|
111325
111986
|
};
|
|
111326
111987
|
} catch {
|
|
111327
111988
|
try {
|
|
111328
111989
|
db.close();
|
|
111329
111990
|
} catch {
|
|
111330
111991
|
}
|
|
111331
|
-
|
|
111992
|
+
resolve2([]);
|
|
111332
111993
|
}
|
|
111333
111994
|
});
|
|
111334
111995
|
}
|
|
111335
111996
|
async function deleteAutosaveSnapshot(filePath) {
|
|
111336
111997
|
const db = await openAutosaveDb();
|
|
111337
|
-
return new Promise((
|
|
111998
|
+
return new Promise((resolve2) => {
|
|
111338
111999
|
try {
|
|
111339
112000
|
const tx = db.transaction(AUTOSAVE_STORE_NAME, "readwrite");
|
|
111340
112001
|
const store = tx.objectStore(AUTOSAVE_STORE_NAME);
|
|
111341
112002
|
store.delete(filePath);
|
|
111342
112003
|
tx.oncomplete = () => {
|
|
111343
112004
|
db.close();
|
|
111344
|
-
|
|
112005
|
+
resolve2(true);
|
|
111345
112006
|
};
|
|
111346
112007
|
tx.onerror = () => {
|
|
111347
112008
|
db.close();
|
|
111348
|
-
|
|
112009
|
+
resolve2(false);
|
|
111349
112010
|
};
|
|
111350
112011
|
} catch {
|
|
111351
112012
|
try {
|
|
111352
112013
|
db.close();
|
|
111353
112014
|
} catch {
|
|
111354
112015
|
}
|
|
111355
|
-
|
|
112016
|
+
resolve2(false);
|
|
111356
112017
|
}
|
|
111357
112018
|
});
|
|
111358
112019
|
}
|
|
@@ -112185,17 +112846,17 @@ function shouldConfirmExternalHyperlink(options, href) {
|
|
|
112185
112846
|
}
|
|
112186
112847
|
return /^https?:/i.test(href);
|
|
112187
112848
|
}
|
|
112188
|
-
function toggle(
|
|
112189
|
-
return { kind: "toggle", group, key, labelKey, ...extra };
|
|
112849
|
+
function toggle(group2, key, labelKey, extra) {
|
|
112850
|
+
return { kind: "toggle", group: group2, key, labelKey, ...extra };
|
|
112190
112851
|
}
|
|
112191
|
-
function select(
|
|
112192
|
-
return { kind: "select", group, key, labelKey, choices: choiceList };
|
|
112852
|
+
function select(group2, key, labelKey, choiceList) {
|
|
112853
|
+
return { kind: "select", group: group2, key, labelKey, choices: choiceList };
|
|
112193
112854
|
}
|
|
112194
|
-
function numberControl(
|
|
112195
|
-
return { kind: "number", group, key, labelKey, min, max, unitKey };
|
|
112855
|
+
function numberControl(group2, key, labelKey, min, max, unitKey) {
|
|
112856
|
+
return { kind: "number", group: group2, key, labelKey, min, max, unitKey };
|
|
112196
112857
|
}
|
|
112197
|
-
function textControl(
|
|
112198
|
-
return { kind: "text", group, key, labelKey, maxLength: 64 };
|
|
112858
|
+
function textControl(group2, key, labelKey) {
|
|
112859
|
+
return { kind: "text", group: group2, key, labelKey, maxLength: 64 };
|
|
112199
112860
|
}
|
|
112200
112861
|
function choices(prefix, values) {
|
|
112201
112862
|
return values.map((value) => ({ value, labelKey: `${prefix}.${value}` }));
|
|
@@ -112677,17 +113338,17 @@ function createViewerOptionsStore(init) {
|
|
|
112677
113338
|
return {
|
|
112678
113339
|
getOptions: () => options,
|
|
112679
113340
|
setOptions: (next) => commit(cloneOptions(next)),
|
|
112680
|
-
setValue: (
|
|
112681
|
-
const defaults = DEFAULT_VIEWER_OPTIONS[
|
|
113341
|
+
setValue: (group2, key, value) => {
|
|
113342
|
+
const defaults = DEFAULT_VIEWER_OPTIONS[group2];
|
|
112682
113343
|
if (!(key in defaults) || typeof defaults[key] !== typeof value) {
|
|
112683
113344
|
return;
|
|
112684
113345
|
}
|
|
112685
113346
|
const next = cloneOptions(options);
|
|
112686
|
-
next[
|
|
113347
|
+
next[group2][key] = value;
|
|
112687
113348
|
commit(next);
|
|
112688
113349
|
},
|
|
112689
|
-
getValue: (
|
|
112690
|
-
const record = options[
|
|
113350
|
+
getValue: (group2, key) => {
|
|
113351
|
+
const record = options[group2];
|
|
112691
113352
|
const value = record[key];
|
|
112692
113353
|
return typeof value === "boolean" || typeof value === "number" || typeof value === "string" ? value : void 0;
|
|
112693
113354
|
},
|
|
@@ -112709,14 +113370,14 @@ function createViewerOptionsStore(init) {
|
|
|
112709
113370
|
next.quickAccess.commandIds = [...commandIds];
|
|
112710
113371
|
commit(next);
|
|
112711
113372
|
},
|
|
112712
|
-
reset: (
|
|
112713
|
-
if (!
|
|
113373
|
+
reset: (group2) => {
|
|
113374
|
+
if (!group2) {
|
|
112714
113375
|
commit(cloneOptions(DEFAULT_VIEWER_OPTIONS));
|
|
112715
113376
|
return;
|
|
112716
113377
|
}
|
|
112717
113378
|
const next = cloneOptions(options);
|
|
112718
113379
|
const defaults = cloneOptions(DEFAULT_VIEWER_OPTIONS);
|
|
112719
|
-
next[
|
|
113380
|
+
next[group2] = defaults[group2];
|
|
112720
113381
|
commit(next);
|
|
112721
113382
|
},
|
|
112722
113383
|
subscribe: (listener) => {
|
|
@@ -113666,7 +114327,7 @@ var VAR_DEPENDENT_PROPERTIES = [
|
|
|
113666
114327
|
function resolveCustomProperties(root) {
|
|
113667
114328
|
const elements = root.querySelectorAll("*");
|
|
113668
114329
|
const view = root.ownerDocument?.defaultView ?? window;
|
|
113669
|
-
const
|
|
114330
|
+
const resolve2 = (el) => {
|
|
113670
114331
|
const htmlEl = el;
|
|
113671
114332
|
if (!htmlEl.style) {
|
|
113672
114333
|
return;
|
|
@@ -113682,8 +114343,8 @@ function resolveCustomProperties(root) {
|
|
|
113682
114343
|
}
|
|
113683
114344
|
}
|
|
113684
114345
|
};
|
|
113685
|
-
|
|
113686
|
-
elements.forEach(
|
|
114346
|
+
resolve2(root);
|
|
114347
|
+
elements.forEach(resolve2);
|
|
113687
114348
|
}
|
|
113688
114349
|
function preprocessCssForCapture(root, options = {}) {
|
|
113689
114350
|
const {
|
|
@@ -113721,9 +114382,9 @@ async function blobUrlToDataUrl(blobUrl) {
|
|
|
113721
114382
|
try {
|
|
113722
114383
|
const response = await fetch(blobUrl);
|
|
113723
114384
|
const blob = await response.blob();
|
|
113724
|
-
return await new Promise((
|
|
114385
|
+
return await new Promise((resolve2, reject) => {
|
|
113725
114386
|
const reader = new FileReader();
|
|
113726
|
-
reader.onloadend = () =>
|
|
114387
|
+
reader.onloadend = () => resolve2(reader.result);
|
|
113727
114388
|
reader.onerror = reject;
|
|
113728
114389
|
reader.readAsDataURL(blob);
|
|
113729
114390
|
});
|
|
@@ -113842,7 +114503,7 @@ var COMPLEX_COLOR_PROPERTIES = [
|
|
|
113842
114503
|
];
|
|
113843
114504
|
function resolveUnsupportedColours(root) {
|
|
113844
114505
|
const elements = root.querySelectorAll("*");
|
|
113845
|
-
const
|
|
114506
|
+
const resolve2 = (el) => {
|
|
113846
114507
|
const htmlEl = el;
|
|
113847
114508
|
if (!htmlEl.style) {
|
|
113848
114509
|
return;
|
|
@@ -113872,8 +114533,8 @@ function resolveUnsupportedColours(root) {
|
|
|
113872
114533
|
}
|
|
113873
114534
|
}
|
|
113874
114535
|
};
|
|
113875
|
-
|
|
113876
|
-
elements.forEach(
|
|
114536
|
+
resolve2(root);
|
|
114537
|
+
elements.forEach(resolve2);
|
|
113877
114538
|
}
|
|
113878
114539
|
function resolveRootCustomProperties(doc) {
|
|
113879
114540
|
const targets = [doc.documentElement, doc.body];
|
|
@@ -114454,6 +115115,7 @@ exports.OUTLINE_SLIDE_ATTR = OUTLINE_SLIDE_ATTR;
|
|
|
114454
115115
|
exports.OUTLINE_VIEW_ATTR = OUTLINE_VIEW_ATTR;
|
|
114455
115116
|
exports.PATTERN_OPTIONS = PATTERN_OPTIONS;
|
|
114456
115117
|
exports.PEN_COLORS = PEN_COLORS;
|
|
115118
|
+
exports.POWERPOINT_METRIC_TRACKING = POWERPOINT_METRIC_TRACKING;
|
|
114457
115119
|
exports.PRESENTATION_CHANNEL_NAME = PRESENTATION_CHANNEL_NAME;
|
|
114458
115120
|
exports.PRESENTATION_HASH = PRESENTATION_HASH;
|
|
114459
115121
|
exports.PRESENTATION_MESSAGE_ORIGIN = PRESENTATION_MESSAGE_ORIGIN;
|
|
@@ -114540,6 +115202,7 @@ exports.applyResize = applyResize;
|
|
|
114540
115202
|
exports.applyStyleToSelectedSegments = applyStyleToSelectedSegments;
|
|
114541
115203
|
exports.applyThemeOverrideToSlide = applyThemeOverrideToSlide;
|
|
114542
115204
|
exports.applyThemeToData = applyThemeToData;
|
|
115205
|
+
exports.attachPresentationVisibilityPause = attachPresentationVisibilityPause;
|
|
114543
115206
|
exports.availableQuickAccessCommands = availableQuickAccessCommands;
|
|
114544
115207
|
exports.backstageCardsFor = backstageCardsFor;
|
|
114545
115208
|
exports.bringForward = bringForward;
|
|
@@ -114601,6 +115264,7 @@ exports.canGoNext = canGoNext;
|
|
|
114601
115264
|
exports.canGoPrevious = canGoPrevious;
|
|
114602
115265
|
exports.canvasToJpegData = canvasToJpegData;
|
|
114603
115266
|
exports.cell3DBevelCss = cell3DBevelCss;
|
|
115267
|
+
exports.chartAreaFill = chartAreaFill;
|
|
114604
115268
|
exports.chartDataChangeType = chartDataChangeType;
|
|
114605
115269
|
exports.chartPartToAttrs = chartPartToAttrs;
|
|
114606
115270
|
exports.clampCropValue = clampCropValue;
|
|
@@ -114865,6 +115529,7 @@ exports.openUrlInNewTab = openUrlInNewTab;
|
|
|
114865
115529
|
exports.paletteColor = paletteColor;
|
|
114866
115530
|
exports.parseDrawingColor = parseDrawingColor;
|
|
114867
115531
|
exports.parseDrawingColorOpacity = parseDrawingColorOpacity;
|
|
115532
|
+
exports.parsePanoseString = parsePanoseString;
|
|
114868
115533
|
exports.parsePpactionUrl = parsePpactionUrl;
|
|
114869
115534
|
exports.pickSupportedMimeType = pickSupportedMimeType;
|
|
114870
115535
|
exports.placeAudienceWindow = placeAudienceWindow;
|
|
@@ -114882,6 +115547,7 @@ exports.previousShowSlideIndex = previousShowSlideIndex;
|
|
|
114882
115547
|
exports.printPropertiesFrameSlides = printPropertiesFrameSlides;
|
|
114883
115548
|
exports.printPropertiesSlidesPerPage = printPropertiesSlidesPerPage;
|
|
114884
115549
|
exports.promoteSmartArtNode = promoteSmartArtNode;
|
|
115550
|
+
exports.proportionalLineHeight = proportionalLineHeight;
|
|
114885
115551
|
exports.publishLiveGeometry = publishLiveGeometry;
|
|
114886
115552
|
exports.publishLiveInlineText = publishLiveInlineText;
|
|
114887
115553
|
exports.quickStyleSwatchCss = quickStyleSwatchCss;
|
|
@@ -114897,6 +115563,7 @@ exports.reconcileSlidesInYDoc = reconcileSlidesInYDoc;
|
|
|
114897
115563
|
exports.recordProgressPercent = recordProgressPercent;
|
|
114898
115564
|
exports.rectToCells = rectToCells;
|
|
114899
115565
|
exports.registerCollaborationTeardown = registerCollaborationTeardown;
|
|
115566
|
+
exports.registerPersistentAudio = registerPersistentAudio;
|
|
114900
115567
|
exports.remapTextToSegments = remapTextToSegments;
|
|
114901
115568
|
exports.removeChartCategory = removeChartCategory;
|
|
114902
115569
|
exports.removeChartSeries = removeChartSeries;
|
|
@@ -114987,6 +115654,7 @@ exports.snapBoxToGrid = snapBoxToGrid;
|
|
|
114987
115654
|
exports.splitCell = splitCell;
|
|
114988
115655
|
exports.splitSeriesByAxis = splitSeriesByAxis;
|
|
114989
115656
|
exports.stepPresenterZoom = stepPresenterZoom;
|
|
115657
|
+
exports.stopAllPersistentAudio = stopAllPersistentAudio;
|
|
114990
115658
|
exports.storeAudienceContent = storeAudienceContent;
|
|
114991
115659
|
exports.substituteFieldText = substituteFieldText;
|
|
114992
115660
|
exports.suppressesCssBorder = suppressesCssBorder;
|