pptx-react-viewer 4.13.0 → 4.15.0
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 +36 -0
- package/dist/{AiChatPanel-AQDB2BLO.mjs → AiChatPanel-7OVUGUKW.mjs} +4 -4
- package/dist/AiChatPanel-7OVUGUKW.mjs.br +0 -0
- package/dist/AiChatPanel-7OVUGUKW.mjs.gz +0 -0
- package/dist/{AiChatPanel-VXQUQNZ6.js → AiChatPanel-CDQWJTWL.js} +28 -28
- package/dist/AiChatPanel-CDQWJTWL.js.br +0 -0
- package/dist/AiChatPanel-CDQWJTWL.js.gz +0 -0
- package/dist/{Model3DScene-UHHKYZSK.mjs → Model3DScene-A3CPMFAO.mjs} +1 -1
- package/dist/Model3DScene-A3CPMFAO.mjs.br +0 -0
- package/dist/Model3DScene-A3CPMFAO.mjs.gz +0 -0
- package/dist/{Model3DScene-I6OVMXEE.js → Model3DScene-OLGB7Z7Q.js} +2 -2
- package/dist/{Model3DScene-I6OVMXEE.js.br → Model3DScene-OLGB7Z7Q.js.br} +0 -0
- package/dist/Model3DScene-OLGB7Z7Q.js.gz +0 -0
- package/dist/{chunk-UOS5HJLG.js → chunk-2CSRCH4H.js} +2487 -1321
- package/dist/chunk-2CSRCH4H.js.br +0 -0
- package/dist/chunk-2CSRCH4H.js.gz +0 -0
- package/dist/{chunk-KA24ZRTJ.js → chunk-6ZPXMS64.js} +1517 -1526
- package/dist/chunk-6ZPXMS64.js.br +0 -0
- package/dist/chunk-6ZPXMS64.js.gz +0 -0
- package/dist/{chunk-SLMDLVFV.mjs → chunk-AHJ4ND7Q.mjs} +1 -1
- package/dist/chunk-AHJ4ND7Q.mjs.br +0 -0
- package/dist/chunk-AHJ4ND7Q.mjs.gz +0 -0
- package/dist/{chunk-JUUI5DHB.mjs → chunk-AIWEM7VE.mjs} +2478 -1320
- package/dist/chunk-AIWEM7VE.mjs.br +0 -0
- package/dist/chunk-AIWEM7VE.mjs.gz +0 -0
- package/dist/{chunk-55OLQ7HS.mjs → chunk-CJSIEITL.mjs} +3 -0
- package/dist/chunk-CJSIEITL.mjs.br +0 -0
- package/dist/chunk-CJSIEITL.mjs.gz +0 -0
- package/dist/{chunk-5YW6N5KJ.js → chunk-CNXVOFUW.js} +197 -197
- package/dist/chunk-CNXVOFUW.js.br +0 -0
- package/dist/chunk-CNXVOFUW.js.gz +0 -0
- package/dist/{chunk-HJBTQ234.mjs → chunk-DNWIW75I.mjs} +6 -5
- package/dist/chunk-DNWIW75I.mjs.br +0 -0
- package/dist/chunk-DNWIW75I.mjs.gz +0 -0
- package/dist/{chunk-57RBEPPQ.js → chunk-HGO243GV.js} +818 -816
- package/dist/chunk-HGO243GV.js.br +0 -0
- package/dist/chunk-HGO243GV.js.gz +0 -0
- package/dist/{chunk-5DQNWKOF.mjs → chunk-Q5VQ53R3.mjs} +2 -2
- package/dist/chunk-Q5VQ53R3.mjs.br +0 -0
- package/dist/chunk-Q5VQ53R3.mjs.gz +0 -0
- package/dist/{chunk-C5ZJGQ2F.mjs → chunk-RQCAXUVQ.mjs} +342 -351
- package/dist/chunk-RQCAXUVQ.mjs.br +0 -0
- package/dist/chunk-RQCAXUVQ.mjs.gz +0 -0
- package/dist/{chunk-MXH7RMTF.js → chunk-UP6PJEHM.js} +5 -5
- package/dist/chunk-UP6PJEHM.js.br +0 -0
- package/dist/chunk-UP6PJEHM.js.gz +0 -0
- package/dist/{chunk-HIYK7HPX.js → chunk-XEYB25ZT.js} +3 -0
- package/dist/chunk-XEYB25ZT.js.br +0 -0
- package/dist/chunk-XEYB25ZT.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +293 -268
- package/dist/index.js +63 -63
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +600 -575
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +161 -136
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-AQDB2BLO.mjs.br +0 -0
- package/dist/AiChatPanel-AQDB2BLO.mjs.gz +0 -0
- package/dist/AiChatPanel-VXQUQNZ6.js.br +0 -0
- package/dist/AiChatPanel-VXQUQNZ6.js.gz +0 -0
- package/dist/Model3DScene-I6OVMXEE.js.gz +0 -0
- package/dist/Model3DScene-UHHKYZSK.mjs.br +0 -0
- package/dist/Model3DScene-UHHKYZSK.mjs.gz +0 -0
- package/dist/chunk-55OLQ7HS.mjs.br +0 -0
- package/dist/chunk-55OLQ7HS.mjs.gz +0 -0
- package/dist/chunk-57RBEPPQ.js.br +0 -0
- package/dist/chunk-57RBEPPQ.js.gz +0 -0
- package/dist/chunk-5DQNWKOF.mjs.br +0 -0
- package/dist/chunk-5DQNWKOF.mjs.gz +0 -0
- package/dist/chunk-5YW6N5KJ.js.br +0 -0
- package/dist/chunk-5YW6N5KJ.js.gz +0 -0
- package/dist/chunk-C5ZJGQ2F.mjs.br +0 -0
- package/dist/chunk-C5ZJGQ2F.mjs.gz +0 -0
- package/dist/chunk-HIYK7HPX.js.br +0 -0
- package/dist/chunk-HIYK7HPX.js.gz +0 -0
- package/dist/chunk-HJBTQ234.mjs.br +0 -0
- package/dist/chunk-HJBTQ234.mjs.gz +0 -0
- package/dist/chunk-JUUI5DHB.mjs.br +0 -0
- package/dist/chunk-JUUI5DHB.mjs.gz +0 -0
- package/dist/chunk-KA24ZRTJ.js.br +0 -0
- package/dist/chunk-KA24ZRTJ.js.gz +0 -0
- package/dist/chunk-MXH7RMTF.js.br +0 -0
- package/dist/chunk-MXH7RMTF.js.gz +0 -0
- package/dist/chunk-SLMDLVFV.mjs.br +0 -0
- package/dist/chunk-SLMDLVFV.mjs.gz +0 -0
- package/dist/chunk-UOS5HJLG.js.br +0 -0
- package/dist/chunk-UOS5HJLG.js.gz +0 -0
|
@@ -28742,7 +28742,7 @@ var ENTRY_TYPE_ROOT;
|
|
|
28742
28742
|
var DIR_ENTRY_SIZE;
|
|
28743
28743
|
var Ole2ParseError;
|
|
28744
28744
|
var init_ole2_parser_types = __esm({
|
|
28745
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
28745
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js"() {
|
|
28746
28746
|
OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
|
|
28747
28747
|
ENDOFCHAIN = 4294967294;
|
|
28748
28748
|
FREESECT = 4294967295;
|
|
@@ -28938,7 +28938,7 @@ function parseOle2(buffer) {
|
|
|
28938
28938
|
return { entries: entries2, getStream };
|
|
28939
28939
|
}
|
|
28940
28940
|
var init_ole2_parser_read = __esm({
|
|
28941
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
28941
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-read.js"() {
|
|
28942
28942
|
init_ole2_parser_types();
|
|
28943
28943
|
}
|
|
28944
28944
|
});
|
|
@@ -29117,7 +29117,7 @@ function writeInt32Sectors(outBytes, int32Data, firstSector, numSectors, sectorS
|
|
|
29117
29117
|
}
|
|
29118
29118
|
}
|
|
29119
29119
|
var init_ole2_parser_write_helpers = __esm({
|
|
29120
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
29120
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-helpers.js"() {
|
|
29121
29121
|
init_ole2_parser_types();
|
|
29122
29122
|
}
|
|
29123
29123
|
});
|
|
@@ -29212,7 +29212,7 @@ function writeStreamSectors(outBytes, streamData, chain2, sectorSize) {
|
|
|
29212
29212
|
}
|
|
29213
29213
|
var HEADER_DIFAT_ENTRIES;
|
|
29214
29214
|
var init_ole2_parser_write_serialize = __esm({
|
|
29215
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
29215
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-serialize.js"() {
|
|
29216
29216
|
init_ole2_parser_types();
|
|
29217
29217
|
init_ole2_parser_write_helpers();
|
|
29218
29218
|
HEADER_DIFAT_ENTRIES = 109;
|
|
@@ -29383,7 +29383,7 @@ function buildOle2(streams, rootClsid, miniStreamCutoff = 4096) {
|
|
|
29383
29383
|
return output;
|
|
29384
29384
|
}
|
|
29385
29385
|
var init_ole2_parser_write = __esm({
|
|
29386
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
29386
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write.js"() {
|
|
29387
29387
|
init_ole2_parser_types();
|
|
29388
29388
|
init_ole2_parser_write_helpers();
|
|
29389
29389
|
init_ole2_parser_write_serialize();
|
|
@@ -30347,7 +30347,7 @@ var MAX;
|
|
|
30347
30347
|
var NIL;
|
|
30348
30348
|
var SIZE;
|
|
30349
30349
|
var init_ole2_stream_edit = __esm({
|
|
30350
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
30350
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-stream-edit.js"() {
|
|
30351
30351
|
END = 4294967294;
|
|
30352
30352
|
MAX = 4294967290;
|
|
30353
30353
|
NIL = 4294967295;
|
|
@@ -30420,7 +30420,7 @@ function isCfb(bytes) {
|
|
|
30420
30420
|
}
|
|
30421
30421
|
var WORKBOOK_STREAM_NAMES;
|
|
30422
30422
|
var init_legacy_excel_cfb = __esm({
|
|
30423
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
30423
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-excel-cfb.js"() {
|
|
30424
30424
|
init_ole2_parser_read();
|
|
30425
30425
|
init_ole2_parser_types();
|
|
30426
30426
|
init_ole2_parser_write();
|
|
@@ -30647,7 +30647,7 @@ var WORKSHEET_DT;
|
|
|
30647
30647
|
var DEFAULT_MAX_ROWS2;
|
|
30648
30648
|
var DEFAULT_MAX_COLS2;
|
|
30649
30649
|
var init_legacy_excel_biff8 = __esm({
|
|
30650
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
30650
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8.js"() {
|
|
30651
30651
|
init_legacy_excel_cfb();
|
|
30652
30652
|
OPCODE_BOF = 2057;
|
|
30653
30653
|
OPCODE_EOF = 10;
|
|
@@ -30793,7 +30793,7 @@ function buildXlsRowCellRegion(grid) {
|
|
|
30793
30793
|
return Uint8Array.from(bytesOut);
|
|
30794
30794
|
}
|
|
30795
30795
|
var init_legacy_excel_biff8_grid = __esm({
|
|
30796
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
30796
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-grid.js"() {
|
|
30797
30797
|
init_legacy_excel_biff8();
|
|
30798
30798
|
}
|
|
30799
30799
|
});
|
|
@@ -30914,7 +30914,7 @@ function writeOleXlsStringCellEdit(inputBytes, edit) {
|
|
|
30914
30914
|
}
|
|
30915
30915
|
}
|
|
30916
30916
|
var init_legacy_excel_biff8_writer = __esm({
|
|
30917
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
30917
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-writer.js"() {
|
|
30918
30918
|
init_legacy_excel_biff8();
|
|
30919
30919
|
init_legacy_excel_biff8_grid();
|
|
30920
30920
|
init_legacy_excel_cfb();
|
|
@@ -31080,7 +31080,7 @@ function patchDocFib(wordDoc, fib, patch) {
|
|
|
31080
31080
|
var FC_LCB_INDEX;
|
|
31081
31081
|
var F_COMPLEX_BIT;
|
|
31082
31082
|
var init_ole_document_doc_fib = __esm({
|
|
31083
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31083
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fib.js"() {
|
|
31084
31084
|
FC_LCB_INDEX = {
|
|
31085
31085
|
plcfbteChpx: 12,
|
|
31086
31086
|
plcfbtePapx: 13,
|
|
@@ -31130,7 +31130,7 @@ function unwrapDocBytes(bytes) {
|
|
|
31130
31130
|
}
|
|
31131
31131
|
}
|
|
31132
31132
|
var init_ole_document_doc_cfb = __esm({
|
|
31133
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31133
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cfb.js"() {
|
|
31134
31134
|
init_ole_document_doc_fib();
|
|
31135
31135
|
init_ole2_parser_read();
|
|
31136
31136
|
init_ole2_parser_types();
|
|
@@ -31244,7 +31244,7 @@ function buildSingleRunChpxPage(fcStart, fcEnd, blob) {
|
|
|
31244
31244
|
}
|
|
31245
31245
|
var PAGE_SIZE;
|
|
31246
31246
|
var init_ole_document_doc_fkp = __esm({
|
|
31247
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31247
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fkp.js"() {
|
|
31248
31248
|
PAGE_SIZE = 512;
|
|
31249
31249
|
}
|
|
31250
31250
|
});
|
|
@@ -31282,7 +31282,7 @@ function encodeCp1252(text22) {
|
|
|
31282
31282
|
var CP1252_HIGH_BLOCK;
|
|
31283
31283
|
var CP1252_HIGH_BLOCK_REVERSE;
|
|
31284
31284
|
var init_ole_document_doc_cp1252 = __esm({
|
|
31285
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31285
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cp1252.js"() {
|
|
31286
31286
|
CP1252_HIGH_BLOCK = [
|
|
31287
31287
|
8364,
|
|
31288
31288
|
129,
|
|
@@ -31481,7 +31481,7 @@ function buildClxBytes(pieces) {
|
|
|
31481
31481
|
var CLXT_PRC;
|
|
31482
31482
|
var CLXT_PCDT;
|
|
31483
31483
|
var init_ole_document_doc_pieces = __esm({
|
|
31484
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31484
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-pieces.js"() {
|
|
31485
31485
|
init_ole_document_doc_cp1252();
|
|
31486
31486
|
CLXT_PRC = 1;
|
|
31487
31487
|
CLXT_PCDT = 2;
|
|
@@ -31641,7 +31641,7 @@ function writeOleDocParagraphEdit(docBytes, paragraphIndex, text22) {
|
|
|
31641
31641
|
var RISKY_PLCF_INDICES;
|
|
31642
31642
|
var RISKY_STTB_INDICES;
|
|
31643
31643
|
var init_ole_document_doc_editor = __esm({
|
|
31644
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31644
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-editor.js"() {
|
|
31645
31645
|
init_ole_document_doc_cfb();
|
|
31646
31646
|
init_ole_document_doc_fib();
|
|
31647
31647
|
init_ole_document_doc_fkp();
|
|
@@ -31832,7 +31832,7 @@ function encodePng(width, height, rgba) {
|
|
|
31832
31832
|
var CRC_TABLE;
|
|
31833
31833
|
var PNG_SIGNATURE;
|
|
31834
31834
|
var init_png_encoder = __esm({
|
|
31835
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
31835
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/utils/png-encoder.js"() {
|
|
31836
31836
|
CRC_TABLE = (() => {
|
|
31837
31837
|
const table2 = new Uint32Array(256);
|
|
31838
31838
|
for (let n = 0; n < 256; n++) {
|
|
@@ -50740,7 +50740,7 @@ async function hmac(algorithm, key2, data) {
|
|
|
50740
50740
|
return new Uint8Array(result);
|
|
50741
50741
|
}
|
|
50742
50742
|
var init_ooxml_crypto_primitives = __esm({
|
|
50743
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
50743
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/utils/ooxml-crypto-primitives.js"() {
|
|
50744
50744
|
}
|
|
50745
50745
|
});
|
|
50746
50746
|
var init_ooxml_crypto_primitives2 = __esm({
|
|
@@ -51855,7 +51855,7 @@ function mdStyleDigest(message, initialState, transform6) {
|
|
|
51855
51855
|
return out;
|
|
51856
51856
|
}
|
|
51857
51857
|
var init_bit_ops = __esm({
|
|
51858
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
51858
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/utils/digests/bit-ops.js"() {
|
|
51859
51859
|
}
|
|
51860
51860
|
});
|
|
51861
51861
|
function f1(x, y, z) {
|
|
@@ -51886,7 +51886,7 @@ var ROUND1;
|
|
|
51886
51886
|
var ROUND2;
|
|
51887
51887
|
var ROUND3;
|
|
51888
51888
|
var init_md4 = __esm({
|
|
51889
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
51889
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/utils/digests/md4.js"() {
|
|
51890
51890
|
init_bit_ops();
|
|
51891
51891
|
INITIAL_STATE = [1732584193, 4023233417, 2562383102, 271733878];
|
|
51892
51892
|
K2 = 1518500249;
|
|
@@ -59243,9 +59243,9 @@ function ensureArray4(val2) {
|
|
|
59243
59243
|
}
|
|
59244
59244
|
return Array.isArray(val2) ? val2 : [val2];
|
|
59245
59245
|
}
|
|
59246
|
-
function collectControlNodes(
|
|
59247
|
-
const nodes = [...ensureArray4(
|
|
59248
|
-
const altContents = ensureArray4(
|
|
59246
|
+
function collectControlNodes(controls2) {
|
|
59247
|
+
const nodes = [...ensureArray4(controls2["p:control"])];
|
|
59248
|
+
const altContents = ensureArray4(controls2["mc:AlternateContent"]);
|
|
59249
59249
|
for (const alt of altContents) {
|
|
59250
59250
|
const fallback = alt["mc:Fallback"];
|
|
59251
59251
|
const fallbackControls = fallback ? ensureArray4(fallback["p:control"]) : [];
|
|
@@ -59302,11 +59302,11 @@ function parseActiveXControlsFromSlide(slideXml3) {
|
|
|
59302
59302
|
if (!cSld) {
|
|
59303
59303
|
return [];
|
|
59304
59304
|
}
|
|
59305
|
-
const
|
|
59306
|
-
if (!
|
|
59305
|
+
const controls2 = cSld["p:controls"];
|
|
59306
|
+
if (!controls2) {
|
|
59307
59307
|
return [];
|
|
59308
59308
|
}
|
|
59309
|
-
const controlEntries = collectControlNodes(
|
|
59309
|
+
const controlEntries = collectControlNodes(controls2);
|
|
59310
59310
|
if (controlEntries.length === 0) {
|
|
59311
59311
|
return [];
|
|
59312
59312
|
}
|
|
@@ -59397,17 +59397,17 @@ function buildActiveXControlNode(control) {
|
|
|
59397
59397
|
}
|
|
59398
59398
|
return node;
|
|
59399
59399
|
}
|
|
59400
|
-
function applyActiveXControlsToSlide(slideXml3,
|
|
59400
|
+
function applyActiveXControlsToSlide(slideXml3, controls2) {
|
|
59401
59401
|
const sld = slideXml3["p:sld"];
|
|
59402
59402
|
const cSld = sld?.["p:cSld"];
|
|
59403
59403
|
if (!cSld) {
|
|
59404
59404
|
return;
|
|
59405
59405
|
}
|
|
59406
|
-
if (!
|
|
59406
|
+
if (!controls2 || controls2.length === 0) {
|
|
59407
59407
|
delete cSld["p:controls"];
|
|
59408
59408
|
return;
|
|
59409
59409
|
}
|
|
59410
|
-
const nodes =
|
|
59410
|
+
const nodes = controls2.map(buildActiveXControlNode);
|
|
59411
59411
|
const container = cSld["p:controls"] ?? {};
|
|
59412
59412
|
const isNewContainer = cSld["p:controls"] === void 0;
|
|
59413
59413
|
container["p:control"] = nodes.length === 1 ? nodes[0] : nodes;
|
|
@@ -109797,7 +109797,7 @@ function record(recType, data, recInstance = 0, isContainer2 = false, recVer = 0
|
|
|
109797
109797
|
}
|
|
109798
109798
|
var ByteWriter;
|
|
109799
109799
|
var init_byte_writer = __esm({
|
|
109800
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
109800
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/byte-writer.js"() {
|
|
109801
109801
|
ByteWriter = class {
|
|
109802
109802
|
chunks = [];
|
|
109803
109803
|
length = 0;
|
|
@@ -109889,7 +109889,7 @@ var HEADER_TOKEN_PLAIN;
|
|
|
109889
109889
|
var HEADER_TOKEN_ENCRYPTED;
|
|
109890
109890
|
var EMU_PER_MASTER;
|
|
109891
109891
|
var init_legacy_ppt_record_types = __esm({
|
|
109892
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
109892
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-ppt-record-types.js"() {
|
|
109893
109893
|
RT = {
|
|
109894
109894
|
Document: 1e3,
|
|
109895
109895
|
DocumentAtom: 1001,
|
|
@@ -110018,7 +110018,7 @@ var init_legacy_ppt_record_types = __esm({
|
|
|
110018
110018
|
}
|
|
110019
110019
|
});
|
|
110020
110020
|
var init_record_types = __esm({
|
|
110021
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110021
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/record-types.js"() {
|
|
110022
110022
|
init_legacy_ppt_record_types();
|
|
110023
110023
|
}
|
|
110024
110024
|
});
|
|
@@ -110036,7 +110036,7 @@ function buildCurrentUserStream(offsetToCurrentEdit, encrypted) {
|
|
|
110036
110036
|
var USER_NAME;
|
|
110037
110037
|
var CURRENT_USER_STREAM_SIZE;
|
|
110038
110038
|
var init_current_user_writer = __esm({
|
|
110039
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110039
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/current-user-writer.js"() {
|
|
110040
110040
|
init_record_types();
|
|
110041
110041
|
init_byte_writer();
|
|
110042
110042
|
USER_NAME = "pptx-viewer";
|
|
@@ -110066,7 +110066,7 @@ function buildFbse(picture, uid, foDelay, size) {
|
|
|
110066
110066
|
var MSOBLIP_PICT;
|
|
110067
110067
|
var BLIP_INFO;
|
|
110068
110068
|
var init_blip_writer = __esm({
|
|
110069
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110069
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/blip-writer.js"() {
|
|
110070
110070
|
init_md4();
|
|
110071
110071
|
init_png_encoder();
|
|
110072
110072
|
init_record_types();
|
|
@@ -110118,7 +110118,7 @@ var OPT;
|
|
|
110118
110118
|
var FBID_FLAG;
|
|
110119
110119
|
var METRO_BLOB_OPID;
|
|
110120
110120
|
var init_fopt_writer = __esm({
|
|
110121
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110121
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/fopt-writer.js"() {
|
|
110122
110122
|
init_record_types();
|
|
110123
110123
|
init_byte_writer();
|
|
110124
110124
|
OPT = {
|
|
@@ -110202,7 +110202,7 @@ function buildPictureStore(pictures, shapesPerDrawing) {
|
|
|
110202
110202
|
}
|
|
110203
110203
|
var SHAPE_ID_CLUSTER_SIZE;
|
|
110204
110204
|
var init_bstore_writer = __esm({
|
|
110205
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110205
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/bstore-writer.js"() {
|
|
110206
110206
|
init_record_types();
|
|
110207
110207
|
init_blip_writer();
|
|
110208
110208
|
init_byte_writer();
|
|
@@ -110237,7 +110237,7 @@ function buildEnvironment(fonts, otherTextStyle) {
|
|
|
110237
110237
|
}
|
|
110238
110238
|
var LF_FACE_NAME_BYTES;
|
|
110239
110239
|
var init_font_collection_writer = __esm({
|
|
110240
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110240
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/font-collection-writer.js"() {
|
|
110241
110241
|
init_record_types();
|
|
110242
110242
|
init_byte_writer();
|
|
110243
110243
|
LF_FACE_NAME_BYTES = 64;
|
|
@@ -110288,7 +110288,8 @@ function buildDocumentContainer(input) {
|
|
|
110288
110288
|
if (input.soundCollection) {
|
|
110289
110289
|
w.bytes(input.soundCollection);
|
|
110290
110290
|
}
|
|
110291
|
-
|
|
110291
|
+
const masterAtoms = input.masterPersistAtoms ?? (input.masterPersistAtom ? [input.masterPersistAtom] : []);
|
|
110292
|
+
w.bytes(drawingGroup).bytes(buildSlideListWithText(masterAtoms, 1));
|
|
110292
110293
|
if (input.paddingBytes) {
|
|
110293
110294
|
w.bytes(buildPaddingTag(input.paddingBytes));
|
|
110294
110295
|
}
|
|
@@ -110299,7 +110300,7 @@ var MASTER_SLIDE_ID_SENTINEL;
|
|
|
110299
110300
|
var RT_CSTRING;
|
|
110300
110301
|
var RT_BINARY_TAG_DATA_BLOB;
|
|
110301
110302
|
var init_document_writer = __esm({
|
|
110302
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110303
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/document-writer.js"() {
|
|
110303
110304
|
init_record_types();
|
|
110304
110305
|
init_byte_writer();
|
|
110305
110306
|
init_font_collection_writer();
|
|
@@ -110447,7 +110448,7 @@ var LT;
|
|
|
110447
110448
|
var FLAG_CUSTOM_SHOW_RETURN;
|
|
110448
110449
|
var HyperlinkCollector;
|
|
110449
110450
|
var init_hyperlink_writer = __esm({
|
|
110450
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110451
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/hyperlink-writer.js"() {
|
|
110451
110452
|
init_record_types();
|
|
110452
110453
|
init_byte_writer();
|
|
110453
110454
|
II_ACTION = {
|
|
@@ -110546,7 +110547,7 @@ var MediaCollector;
|
|
|
110546
110547
|
var SOUND_EXTENSION_WAV;
|
|
110547
110548
|
var SOUND_LENGTH_UNKNOWN;
|
|
110548
110549
|
var init_media_writer = __esm({
|
|
110549
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110550
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/media-writer.js"() {
|
|
110550
110551
|
init_record_types();
|
|
110551
110552
|
init_byte_writer();
|
|
110552
110553
|
MediaCollector = class {
|
|
@@ -110648,7 +110649,7 @@ var EX_OLE_SUB_DEFAULT;
|
|
|
110648
110649
|
var PACKAGER_MENU_NAME;
|
|
110649
110650
|
var OleCollector;
|
|
110650
110651
|
var init_ole_writer = __esm({
|
|
110651
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110652
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/ole-writer.js"() {
|
|
110652
110653
|
init_ole2_parser_write();
|
|
110653
110654
|
init_record_types();
|
|
110654
110655
|
init_byte_writer();
|
|
@@ -110733,7 +110734,7 @@ function buildExObjList(hyperlinks, ole, media) {
|
|
|
110733
110734
|
return record(RT.ExternalObjectList, w.toBytes(), 0, true);
|
|
110734
110735
|
}
|
|
110735
110736
|
var init_ex_obj_list_writer = __esm({
|
|
110736
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110737
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/ex-obj-list-writer.js"() {
|
|
110737
110738
|
init_record_types();
|
|
110738
110739
|
init_byte_writer();
|
|
110739
110740
|
init_hyperlink_writer();
|
|
@@ -110786,7 +110787,7 @@ function buildChildAnchor(rect22) {
|
|
|
110786
110787
|
var INT16_MIN2;
|
|
110787
110788
|
var INT16_MAX2;
|
|
110788
110789
|
var init_anchor_writer = __esm({
|
|
110789
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110790
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/anchor-writer.js"() {
|
|
110790
110791
|
init_record_types();
|
|
110791
110792
|
init_byte_writer();
|
|
110792
110793
|
INT16_MIN2 = -32768;
|
|
@@ -110814,7 +110815,7 @@ function encodeColorIndex(rgb2) {
|
|
|
110814
110815
|
}
|
|
110815
110816
|
var DEFAULT_RGB;
|
|
110816
110817
|
var init_colors = __esm({
|
|
110817
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110818
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/colors.js"() {
|
|
110818
110819
|
DEFAULT_RGB = "000000";
|
|
110819
110820
|
}
|
|
110820
110821
|
});
|
|
@@ -110908,7 +110909,7 @@ function writeCfException(w, run, fontIndex) {
|
|
|
110908
110909
|
var ALIGN_CODE;
|
|
110909
110910
|
var EMU_PER_MASTER_UNIT;
|
|
110910
110911
|
var init_text_exception_writer = __esm({
|
|
110911
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110912
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/text-exception-writer.js"() {
|
|
110912
110913
|
init_colors();
|
|
110913
110914
|
ALIGN_CODE = {
|
|
110914
110915
|
l: 0,
|
|
@@ -110979,7 +110980,7 @@ function buildTextAtoms(body, fonts, hyperlinks) {
|
|
|
110979
110980
|
return new ByteWriter().bytes(buildTextHeaderAtom(body.textType)).bytes(buildTextCharsAtom(text22)).bytes(buildStyleTextPropAtom(body, fontIndex)).bytes(buildRunHyperlinks(body, hyperlinks)).toBytes();
|
|
110980
110981
|
}
|
|
110981
110982
|
var init_text_atom_writer = __esm({
|
|
110982
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
110983
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/text-atom-writer.js"() {
|
|
110983
110984
|
init_record_types();
|
|
110984
110985
|
init_byte_writer();
|
|
110985
110986
|
init_hyperlink_writer();
|
|
@@ -111091,7 +111092,7 @@ var TITLE_PROMPT;
|
|
|
111091
111092
|
var BODY_PROMPT;
|
|
111092
111093
|
var DEFAULT_FRAMES;
|
|
111093
111094
|
var init_master_placeholders_writer = __esm({
|
|
111094
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111095
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-placeholders-writer.js"() {
|
|
111095
111096
|
init_record_types();
|
|
111096
111097
|
init_anchor_writer();
|
|
111097
111098
|
init_byte_writer();
|
|
@@ -111163,7 +111164,7 @@ function masterStyleFonts(styles) {
|
|
|
111163
111164
|
return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level2) => level2.run.fontName).filter((name) => Boolean(name));
|
|
111164
111165
|
}
|
|
111165
111166
|
var init_master_style_fonts = __esm({
|
|
111166
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111167
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-style-fonts.js"() {
|
|
111167
111168
|
}
|
|
111168
111169
|
});
|
|
111169
111170
|
function buildMasterStyleAtom(recInstance, levels, fontIndex) {
|
|
@@ -111197,7 +111198,7 @@ function buildMasterTextStyles(styles, fontIndex) {
|
|
|
111197
111198
|
var EMPTY_LEVELS;
|
|
111198
111199
|
var FIXED_INSTANCE_DATA;
|
|
111199
111200
|
var init_master_text_styles_writer = __esm({
|
|
111200
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111201
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-text-styles-writer.js"() {
|
|
111201
111202
|
init_record_types();
|
|
111202
111203
|
init_byte_writer();
|
|
111203
111204
|
init_text_exception_writer();
|
|
@@ -111266,7 +111267,7 @@ function buildShapeFoptProps(input) {
|
|
|
111266
111267
|
}
|
|
111267
111268
|
var DASH_CODE;
|
|
111268
111269
|
var init_shape_props_writer = __esm({
|
|
111269
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111270
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-props-writer.js"() {
|
|
111270
111271
|
init_colors();
|
|
111271
111272
|
init_fopt_writer();
|
|
111272
111273
|
DASH_CODE = {
|
|
@@ -111385,7 +111386,7 @@ var FSP_FLAG_OLE_SHAPE;
|
|
|
111385
111386
|
var FSP_FLAG_CHILD;
|
|
111386
111387
|
var PLACEHOLDER_ID;
|
|
111387
111388
|
var init_shape_writer = __esm({
|
|
111388
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111389
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-writer.js"() {
|
|
111389
111390
|
init_record_types();
|
|
111390
111391
|
init_anchor_writer();
|
|
111391
111392
|
init_byte_writer();
|
|
@@ -111449,7 +111450,7 @@ var FSP_FLAG_PATRIARCH;
|
|
|
111449
111450
|
var FSP_FLAG_HAVE_ANCHOR;
|
|
111450
111451
|
var ZERO_RECT;
|
|
111451
111452
|
var init_group_writer = __esm({
|
|
111452
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111453
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/group-writer.js"() {
|
|
111453
111454
|
init_record_types();
|
|
111454
111455
|
init_anchor_writer();
|
|
111455
111456
|
init_byte_writer();
|
|
@@ -111462,7 +111463,7 @@ var init_group_writer = __esm({
|
|
|
111462
111463
|
});
|
|
111463
111464
|
var ShapeIdAllocator2;
|
|
111464
111465
|
var init_shape_id_allocator = __esm({
|
|
111465
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111466
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-id-allocator.js"() {
|
|
111466
111467
|
ShapeIdAllocator2 = class {
|
|
111467
111468
|
current;
|
|
111468
111469
|
constructor(drawingId, clusterSize) {
|
|
@@ -111519,7 +111520,7 @@ var FSP_FLAG_BACKGROUND;
|
|
|
111519
111520
|
var BACKGROUND_RECT_SPT;
|
|
111520
111521
|
var SHAPE_ID_CLUSTER_SIZE2;
|
|
111521
111522
|
var init_drawing_writer = __esm({
|
|
111522
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111523
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/drawing-writer.js"() {
|
|
111523
111524
|
init_record_types();
|
|
111524
111525
|
init_byte_writer();
|
|
111525
111526
|
init_colors();
|
|
@@ -111548,7 +111549,7 @@ function buildNotesContainer(paragraphs2, notesRect, slidePersistIdRef, fonts, d
|
|
|
111548
111549
|
return record(RT.Notes, data, 0, true);
|
|
111549
111550
|
}
|
|
111550
111551
|
var init_notes_writer = __esm({
|
|
111551
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111552
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/notes-writer.js"() {
|
|
111552
111553
|
init_record_types();
|
|
111553
111554
|
init_byte_writer();
|
|
111554
111555
|
init_drawing_writer();
|
|
@@ -111628,7 +111629,7 @@ function recordBytes(data, rec) {
|
|
|
111628
111629
|
var PptParseError;
|
|
111629
111630
|
var RECORD_HEADER_SIZE;
|
|
111630
111631
|
var init_legacy_ppt_record_stream = __esm({
|
|
111631
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111632
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-ppt-record-stream.js"() {
|
|
111632
111633
|
PptParseError = class extends Error {
|
|
111633
111634
|
constructor(message) {
|
|
111634
111635
|
super(message);
|
|
@@ -111639,7 +111640,7 @@ var init_legacy_ppt_record_stream = __esm({
|
|
|
111639
111640
|
}
|
|
111640
111641
|
});
|
|
111641
111642
|
var init_record_stream = __esm({
|
|
111642
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111643
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/record-stream.js"() {
|
|
111643
111644
|
init_legacy_ppt_record_stream();
|
|
111644
111645
|
}
|
|
111645
111646
|
});
|
|
@@ -111694,7 +111695,7 @@ function resolveEscherColor(colorRef, scheme) {
|
|
|
111694
111695
|
var SCHEME;
|
|
111695
111696
|
var DEFAULT_SCHEME;
|
|
111696
111697
|
var init_color_scheme = __esm({
|
|
111697
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111698
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/color-scheme.js"() {
|
|
111698
111699
|
init_record_stream();
|
|
111699
111700
|
init_record_types();
|
|
111700
111701
|
SCHEME = {
|
|
@@ -111727,7 +111728,7 @@ function buildColorSchemeAtom(recInstance = 1, colors) {
|
|
|
111727
111728
|
return record(RT.ColorSchemeAtom, w.toBytes(), recInstance, false, 0);
|
|
111728
111729
|
}
|
|
111729
111730
|
var init_color_scheme_writer = __esm({
|
|
111730
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111731
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/color-scheme-writer.js"() {
|
|
111731
111732
|
init_color_scheme();
|
|
111732
111733
|
init_record_types();
|
|
111733
111734
|
init_byte_writer();
|
|
@@ -111748,8 +111749,14 @@ function buildSlideAtom(masterIdRef, notesIdRef, hasOwnBackground) {
|
|
|
111748
111749
|
function buildMasterSlideAtom() {
|
|
111749
111750
|
return buildSlideAtomRaw(0, 0, 0, SLIDE_FLAG_MASTER_SCHEME);
|
|
111750
111751
|
}
|
|
111751
|
-
function buildSlideContainer(slide, slideRect,
|
|
111752
|
-
const data = new ByteWriter().bytes(buildSlideAtom(
|
|
111752
|
+
function buildSlideContainer(slide, slideRect, masterIdRef, notesIdRef, fonts, drawingId, hyperlinks, oleEmbeds, mediaEmbeds) {
|
|
111753
|
+
const data = new ByteWriter().bytes(buildSlideAtom(
|
|
111754
|
+
// A master is named by its slide id (>= 0x80000000), never by a
|
|
111755
|
+
// persist id; anything smaller falls back to the first master.
|
|
111756
|
+
masterIdRef >= SLIDE_MASTER_ID_SENTINEL ? masterIdRef : SLIDE_MASTER_ID_SENTINEL,
|
|
111757
|
+
notesIdRef,
|
|
111758
|
+
Boolean(slide.backgroundRgb)
|
|
111759
|
+
)).bytes(buildDrawing(slideRect, slide.shapes, slide.backgroundRgb, fonts, drawingId, hyperlinks, oleEmbeds, mediaEmbeds)).bytes(buildColorSchemeAtom()).toBytes();
|
|
111753
111760
|
return record(RT.Slide, data, 0, true);
|
|
111754
111761
|
}
|
|
111755
111762
|
function buildMainMasterContainer(slideRect, drawingId, hyperlinks, oleEmbeds, mediaEmbeds, masterStyles, fonts, master) {
|
|
@@ -111768,7 +111775,7 @@ var SLIDE_FLAG_MASTER_BACKGROUND;
|
|
|
111768
111775
|
var SLIDE_MASTER_ID_SENTINEL;
|
|
111769
111776
|
var MASTER_FIRST_COLOR_SCHEME_INSTANCE;
|
|
111770
111777
|
var init_slide_writer = __esm({
|
|
111771
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111778
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/slide-writer.js"() {
|
|
111772
111779
|
init_record_types();
|
|
111773
111780
|
init_byte_writer();
|
|
111774
111781
|
init_color_scheme_writer();
|
|
@@ -111782,6 +111789,15 @@ var init_slide_writer = __esm({
|
|
|
111782
111789
|
MASTER_FIRST_COLOR_SCHEME_INSTANCE = 6;
|
|
111783
111790
|
}
|
|
111784
111791
|
});
|
|
111792
|
+
function masterSlideId(index) {
|
|
111793
|
+
return MASTER_SLIDE_ID_SENTINEL + index;
|
|
111794
|
+
}
|
|
111795
|
+
function resolveDeckMasters(deck) {
|
|
111796
|
+
return deck.masters && deck.masters.length > 0 ? deck.masters : [{ styles: deck.masterStyles, roundTrip: deck.master }];
|
|
111797
|
+
}
|
|
111798
|
+
function slideMasterIndex(masterIndex, masterCount) {
|
|
111799
|
+
return masterIndex !== void 0 && Number.isInteger(masterIndex) && masterIndex >= 0 && masterIndex < masterCount ? masterIndex : 0;
|
|
111800
|
+
}
|
|
111785
111801
|
function countDrawingShapes(shapes) {
|
|
111786
111802
|
let count = 1;
|
|
111787
111803
|
const walk3 = (list2) => {
|
|
@@ -111795,7 +111811,7 @@ function countDrawingShapes(shapes) {
|
|
|
111795
111811
|
walk3(shapes);
|
|
111796
111812
|
return count;
|
|
111797
111813
|
}
|
|
111798
|
-
function collectFonts(deck) {
|
|
111814
|
+
function collectFonts(deck, masters) {
|
|
111799
111815
|
const collect2 = (shape) => {
|
|
111800
111816
|
if (shape.kind === "group") {
|
|
111801
111817
|
return shape.children.flatMap(collect2);
|
|
@@ -111805,40 +111821,43 @@ function collectFonts(deck) {
|
|
|
111805
111821
|
}
|
|
111806
111822
|
return shape.text.paragraphs.flatMap((p) => p.runs.map((r) => r.fontName).filter((n) => Boolean(n)));
|
|
111807
111823
|
};
|
|
111808
|
-
const themeMinor =
|
|
111824
|
+
const themeMinor = masters[0]?.roundTrip?.themeFonts?.minor;
|
|
111809
111825
|
const fonts = Array.from(/* @__PURE__ */ new Set([
|
|
111810
111826
|
...themeMinor ? [themeMinor] : [],
|
|
111811
111827
|
...deck.slides.flatMap((slide) => slide.shapes.flatMap(collect2)),
|
|
111812
|
-
...masterStyleFonts(
|
|
111828
|
+
...masters.flatMap((master) => masterStyleFonts(master.styles))
|
|
111813
111829
|
]));
|
|
111814
111830
|
return fonts.length > 0 ? fonts : ["Calibri"];
|
|
111815
111831
|
}
|
|
111816
111832
|
function layoutDocumentStream(deck) {
|
|
111817
111833
|
const slideRect = { w: deck.widthEmu, h: deck.heightEmu };
|
|
111818
111834
|
const notesRect = { x: 0, y: 0, w: deck.heightEmu, h: deck.widthEmu };
|
|
111819
|
-
const
|
|
111820
|
-
|
|
111835
|
+
const masters = resolveDeckMasters(deck);
|
|
111836
|
+
const masterIds = masters.map((_, i2) => MASTER_ID + i2);
|
|
111837
|
+
const firstSlideId = MASTER_ID + masters.length;
|
|
111838
|
+
const slideIds = deck.slides.map((_, i2) => firstSlideId + i2);
|
|
111839
|
+
let nextId2 = firstSlideId + deck.slides.length;
|
|
111821
111840
|
const notesIds = deck.slides.map((slide) => slide.notesParagraphs?.length ? nextId2++ : 0);
|
|
111822
|
-
const
|
|
111823
|
-
const slideDrawingIds = deck.slides.map((_, i2) =>
|
|
111824
|
-
let nextDrawingId =
|
|
111841
|
+
const masterDrawingIds = masters.map((_, i2) => 1 + i2);
|
|
111842
|
+
const slideDrawingIds = deck.slides.map((_, i2) => 1 + masters.length + i2);
|
|
111843
|
+
let nextDrawingId = 1 + masters.length + deck.slides.length;
|
|
111825
111844
|
const notesDrawingIds = deck.slides.map((slide) => slide.notesParagraphs?.length ? nextDrawingId++ : 0);
|
|
111826
111845
|
const shapesPerDrawing = [
|
|
111827
|
-
1 + MASTER_PLACEHOLDER_ORDER.length,
|
|
111828
|
-
//
|
|
111846
|
+
...masters.map(() => 1 + MASTER_PLACEHOLDER_ORDER.length),
|
|
111847
|
+
// patriarch + placeholders
|
|
111829
111848
|
...deck.slides.map((slide) => countDrawingShapes(slide.shapes)),
|
|
111830
111849
|
...deck.slides.filter((s) => s.notesParagraphs?.length).map(() => 2)
|
|
111831
111850
|
// patriarch + body placeholder
|
|
111832
111851
|
];
|
|
111833
|
-
const fonts = collectFonts(deck);
|
|
111852
|
+
const fonts = collectFonts(deck, masters);
|
|
111834
111853
|
const { dggContainer, picturesStream } = buildPictureStore(deck.pictures, shapesPerDrawing);
|
|
111835
111854
|
const hyperlinks = new HyperlinkCollector();
|
|
111836
111855
|
const oleEmbeds = new OleCollector(hyperlinks);
|
|
111837
111856
|
const mediaEmbeds = new MediaCollector(hyperlinks);
|
|
111838
|
-
const slideContainers = deck.slides.map((slide, i2) => buildSlideContainer(slide, slideRect,
|
|
111857
|
+
const slideContainers = deck.slides.map((slide, i2) => buildSlideContainer(slide, slideRect, masterSlideId(slideMasterIndex(slide.masterIndex, masters.length)), notesIds[i2], fonts, slideDrawingIds[i2], hyperlinks, oleEmbeds, mediaEmbeds));
|
|
111839
111858
|
const notesContainers = deck.slides.map((slide, i2) => notesIds[i2] ? buildNotesContainer(slide.notesParagraphs, notesRect, slideIds[i2], fonts, notesDrawingIds[i2], hyperlinks, oleEmbeds, mediaEmbeds) : void 0).filter((c) => c !== void 0);
|
|
111840
|
-
const
|
|
111841
|
-
const
|
|
111859
|
+
const masterContainers = masters.map((master, i2) => buildMainMasterContainer(slideRect, masterDrawingIds[i2], hyperlinks, oleEmbeds, mediaEmbeds, master.styles, fonts, master.roundTrip));
|
|
111860
|
+
const masterPersistAtoms = masterIds.map((id, i2) => buildSlidePersistAtom(id, masterSlideId(i2)));
|
|
111842
111861
|
const slidePersistAtoms = slideIds.map((id, i2) => buildSlidePersistAtom(id, 256 + i2, 4));
|
|
111843
111862
|
const oleStgIds = oleEmbeds.all.map(() => nextId2++);
|
|
111844
111863
|
oleEmbeds.all.forEach((entry5, i2) => {
|
|
@@ -111851,18 +111870,18 @@ function layoutDocumentStream(deck) {
|
|
|
111851
111870
|
widthEmu: deck.widthEmu,
|
|
111852
111871
|
heightEmu: deck.heightEmu,
|
|
111853
111872
|
fonts,
|
|
111854
|
-
|
|
111873
|
+
masterPersistAtoms,
|
|
111855
111874
|
slidePersistAtoms,
|
|
111856
111875
|
dggContainer,
|
|
111857
111876
|
exObjList,
|
|
111858
111877
|
soundCollection,
|
|
111859
|
-
otherTextStyle: buildOtherTextStyle(
|
|
111878
|
+
otherTextStyle: buildOtherTextStyle(masters[0]?.styles, (name) => {
|
|
111860
111879
|
const idx = name ? fonts.indexOf(name) : -1;
|
|
111861
111880
|
return idx >= 0 ? idx : void 0;
|
|
111862
111881
|
})
|
|
111863
111882
|
};
|
|
111864
111883
|
const maxPersistId = nextId2 - 1;
|
|
111865
|
-
const contentSizeWithoutPadding = buildDocumentContainer(documentInput).length +
|
|
111884
|
+
const contentSizeWithoutPadding = buildDocumentContainer(documentInput).length + masterContainers.reduce((sum, c) => sum + c.length, 0) + slideContainers.reduce((sum, c) => sum + c.length, 0) + notesContainers.reduce((sum, c) => sum + c.length, 0) + oleStgRecords.reduce((sum, c) => sum + c.length, 0);
|
|
111866
111885
|
const paddingBytes = ensureMinimumDocumentStreamSize(contentSizeWithoutPadding, maxPersistId);
|
|
111867
111886
|
const documentContainer = buildDocumentContainer({ ...documentInput, paddingBytes });
|
|
111868
111887
|
const layout = new ByteWriter();
|
|
@@ -111872,7 +111891,7 @@ function layoutDocumentStream(deck) {
|
|
|
111872
111891
|
layout.bytes(bytes);
|
|
111873
111892
|
};
|
|
111874
111893
|
place(DOC_ID, documentContainer);
|
|
111875
|
-
place(
|
|
111894
|
+
masterIds.forEach((id, i2) => place(id, masterContainers[i2]));
|
|
111876
111895
|
slideIds.forEach((id, i2) => place(id, slideContainers[i2]));
|
|
111877
111896
|
let notesCursor = 0;
|
|
111878
111897
|
notesIds.forEach((id) => {
|
|
@@ -111894,7 +111913,7 @@ function ensureMinimumDocumentStreamSize(contentSizeWithoutPadding, maxPersistId
|
|
|
111894
111913
|
var DOC_ID;
|
|
111895
111914
|
var MASTER_ID;
|
|
111896
111915
|
var init_document_stream_layout = __esm({
|
|
111897
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111916
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/document-stream-layout.js"() {
|
|
111898
111917
|
init_bstore_writer();
|
|
111899
111918
|
init_byte_writer();
|
|
111900
111919
|
init_document_writer();
|
|
@@ -111913,7 +111932,7 @@ var init_document_stream_layout = __esm({
|
|
|
111913
111932
|
});
|
|
111914
111933
|
var RC4_ALG_ID2;
|
|
111915
111934
|
var init_crypto_constants = __esm({
|
|
111916
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111935
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/crypto-constants.js"() {
|
|
111917
111936
|
RC4_ALG_ID2 = 26625;
|
|
111918
111937
|
}
|
|
111919
111938
|
});
|
|
@@ -111947,7 +111966,7 @@ function rc4Cipher(key2, data) {
|
|
|
111947
111966
|
return out;
|
|
111948
111967
|
}
|
|
111949
111968
|
var init_rc4_cipher = __esm({
|
|
111950
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
111969
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/utils/rc4-cipher.js"() {
|
|
111951
111970
|
}
|
|
111952
111971
|
});
|
|
111953
111972
|
async function rc4CryptoApiKeyBase(password, salt) {
|
|
@@ -111990,7 +112009,7 @@ async function rc4CryptoApiEncryptVerifier(key0, verifier) {
|
|
|
111990
112009
|
}
|
|
111991
112010
|
var PADDED_40_BIT_KEY_BYTES;
|
|
111992
112011
|
var init_rc4_cryptoapi_key = __esm({
|
|
111993
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112012
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/rc4-cryptoapi-key.js"() {
|
|
111994
112013
|
init_ooxml_crypto_primitives();
|
|
111995
112014
|
init_rc4_cipher();
|
|
111996
112015
|
PADDED_40_BIT_KEY_BYTES = 16;
|
|
@@ -112068,7 +112087,7 @@ var BITMAP_TAG_SIZE;
|
|
|
112068
112087
|
var METAFILE_BLIPS;
|
|
112069
112088
|
var BITMAP_BLIPS;
|
|
112070
112089
|
var init_rc4_cryptoapi_streams = __esm({
|
|
112071
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112090
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/rc4-cryptoapi-streams.js"() {
|
|
112072
112091
|
init_rc4_cipher();
|
|
112073
112092
|
init_record_stream();
|
|
112074
112093
|
UID_SIZE = 16;
|
|
@@ -112110,7 +112129,7 @@ var VERIFIER_SIZE;
|
|
|
112110
112129
|
var VERIFIER_HASH_SIZE;
|
|
112111
112130
|
var ENCRYPTION_FLAGS;
|
|
112112
112131
|
var init_encrypt_writer = __esm({
|
|
112113
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112132
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/encrypt-writer.js"() {
|
|
112114
112133
|
init_crypto_constants();
|
|
112115
112134
|
init_rc4_cryptoapi_key();
|
|
112116
112135
|
init_rc4_cryptoapi_streams();
|
|
@@ -112189,7 +112208,7 @@ function withMasterRelativeRunStyles(deck) {
|
|
|
112189
112208
|
}
|
|
112190
112209
|
var STYLE_KEYS;
|
|
112191
112210
|
var init_master_relative_runs = __esm({
|
|
112192
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112211
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-relative-runs.js"() {
|
|
112193
112212
|
STYLE_KEYS = ["bold", "italic", "underline"];
|
|
112194
112213
|
}
|
|
112195
112214
|
});
|
|
@@ -112222,7 +112241,7 @@ function buildEncryptedUserEditAtom(input) {
|
|
|
112222
112241
|
}
|
|
112223
112242
|
var MAX_RUN;
|
|
112224
112243
|
var init_persist_writer = __esm({
|
|
112225
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112244
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/persist-writer.js"() {
|
|
112226
112245
|
init_record_types();
|
|
112227
112246
|
init_byte_writer();
|
|
112228
112247
|
MAX_RUN = 4095;
|
|
@@ -112230,7 +112249,7 @@ var init_persist_writer = __esm({
|
|
|
112230
112249
|
});
|
|
112231
112250
|
var PPT_STORAGE_CLSID;
|
|
112232
112251
|
var init_ppt_clsid = __esm({
|
|
112233
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112252
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/ppt-clsid.js"() {
|
|
112234
112253
|
PPT_STORAGE_CLSID = new Uint8Array([
|
|
112235
112254
|
16,
|
|
112236
112255
|
141,
|
|
@@ -112304,7 +112323,7 @@ async function buildPptFile(deck, options = {}) {
|
|
|
112304
112323
|
return new Uint8Array(buildOle2(streams, PPT_STORAGE_CLSID, 0));
|
|
112305
112324
|
}
|
|
112306
112325
|
var init_write_ppt = __esm({
|
|
112307
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112326
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/writer/write-ppt.js"() {
|
|
112308
112327
|
init_ole2_parser_write();
|
|
112309
112328
|
init_byte_writer();
|
|
112310
112329
|
init_current_user_writer();
|
|
@@ -112316,7 +112335,7 @@ var init_write_ppt = __esm({
|
|
|
112316
112335
|
}
|
|
112317
112336
|
});
|
|
112318
112337
|
var init_legacy_ppt_writer = __esm({
|
|
112319
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
112338
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/legacy-ppt-writer.js"() {
|
|
112320
112339
|
init_write_ppt();
|
|
112321
112340
|
init_master_style_fonts();
|
|
112322
112341
|
}
|
|
@@ -112420,16 +112439,21 @@ async function followRel(zip, from, type) {
|
|
|
112420
112439
|
const rel = rels ? parseRels(rels).find((r) => r.type === `${REL}/${type}`) : void 0;
|
|
112421
112440
|
return rel && !rel.external ? resolveTarget2(from, rel.target) : void 0;
|
|
112422
112441
|
}
|
|
112423
|
-
async function
|
|
112442
|
+
async function readSlideMasterPaths(zip) {
|
|
112424
112443
|
const presentation = "ppt/presentation.xml";
|
|
112425
112444
|
const xml = await readText(zip, presentation);
|
|
112426
|
-
const firstSlideRid = xml ? /<p:sldId\b[^>]*\br:id="([^"]+)"/u.exec(xml)?.[1] : void 0;
|
|
112427
112445
|
const rels = await readText(zip, relsPath(presentation));
|
|
112428
|
-
const
|
|
112429
|
-
const
|
|
112430
|
-
const
|
|
112431
|
-
const
|
|
112432
|
-
|
|
112446
|
+
const presentationRels = rels ? parseRels(rels) : [];
|
|
112447
|
+
const slideRids = xml ? [...xml.matchAll(/<p:sldId\b[^>]*\br:id="([^"]+)"/gu)].map((m) => m[1]) : [];
|
|
112448
|
+
const paths = [];
|
|
112449
|
+
for (const rid of slideRids) {
|
|
112450
|
+
const slideRel = presentationRels.find((r) => r.id === rid);
|
|
112451
|
+
const slide = slideRel ? resolveTarget2(presentation, slideRel.target) : void 0;
|
|
112452
|
+
const layout = slide ? await followRel(zip, slide, "slideLayout") : void 0;
|
|
112453
|
+
const master = layout ? await followRel(zip, layout, "slideMaster") : void 0;
|
|
112454
|
+
paths.push(master && zip.file(master) ? master : FALLBACK_MASTER);
|
|
112455
|
+
}
|
|
112456
|
+
return paths;
|
|
112433
112457
|
}
|
|
112434
112458
|
function num3(xml, pattern) {
|
|
112435
112459
|
const value = pattern.exec(xml)?.[1];
|
|
@@ -112493,8 +112517,8 @@ function latinFace(themeXml3, scheme) {
|
|
|
112493
112517
|
const body = close < 0 ? void 0 : themeXml3.slice(open, close);
|
|
112494
112518
|
return body && /<a:latin [^>]*typeface="([^"]+)"/u.exec(body)?.[1] || void 0;
|
|
112495
112519
|
}
|
|
112496
|
-
async function readMasterRoundTripSource(zip) {
|
|
112497
|
-
|
|
112520
|
+
async function readMasterRoundTripSource(zip, masterPath) {
|
|
112521
|
+
masterPath ??= (await readSlideMasterPaths(zip))[0] ?? FALLBACK_MASTER;
|
|
112498
112522
|
const masterXml = await readText(zip, masterPath);
|
|
112499
112523
|
if (!masterXml) {
|
|
112500
112524
|
return { placeholders: [], themeFonts: {} };
|
|
@@ -112592,8 +112616,27 @@ async function buildMasterRoundTrip(source) {
|
|
|
112592
112616
|
colorMapping: source.clrMapAttributes ? buildColorMapping(source.clrMapAttributes) : void 0
|
|
112593
112617
|
};
|
|
112594
112618
|
}
|
|
112595
|
-
async function
|
|
112596
|
-
|
|
112619
|
+
async function buildDeckMasterRoundTripsFromPptx(pptxBytes) {
|
|
112620
|
+
const zip = await JSZip3__default.default.loadAsync(pptxBytes);
|
|
112621
|
+
const slidePaths = await readSlideMasterPaths(zip);
|
|
112622
|
+
const masterPaths = [...new Set(slidePaths)];
|
|
112623
|
+
if (masterPaths.length === 0) {
|
|
112624
|
+
return {
|
|
112625
|
+
masterPaths: [],
|
|
112626
|
+
masters: [await buildMasterRoundTrip(await readMasterRoundTripSource(zip))],
|
|
112627
|
+
slideMasterIndex: []
|
|
112628
|
+
};
|
|
112629
|
+
}
|
|
112630
|
+
const masters = await Promise.all(
|
|
112631
|
+
masterPaths.map(
|
|
112632
|
+
async (path) => buildMasterRoundTrip(await readMasterRoundTripSource(zip, path))
|
|
112633
|
+
)
|
|
112634
|
+
);
|
|
112635
|
+
return {
|
|
112636
|
+
masterPaths,
|
|
112637
|
+
masters,
|
|
112638
|
+
slideMasterIndex: slidePaths.map((path) => masterPaths.indexOf(path))
|
|
112639
|
+
};
|
|
112597
112640
|
}
|
|
112598
112641
|
var XML_DECL2;
|
|
112599
112642
|
var CT_NS2;
|
|
@@ -135036,6 +135079,28 @@ var init_slide_fingerprint = __esm({
|
|
|
135036
135079
|
UNHASHABLE_COUNTER = 0;
|
|
135037
135080
|
}
|
|
135038
135081
|
});
|
|
135082
|
+
function updateSlideLayoutRelationship(relationships2, layoutPath, relationshipType) {
|
|
135083
|
+
if (!layoutPath) {
|
|
135084
|
+
return;
|
|
135085
|
+
}
|
|
135086
|
+
const target = `../${layoutPath.replace(/^\/?ppt\//, "")}`;
|
|
135087
|
+
const existing = relationships2.find((rel) => String(rel["@_Type"]).endsWith("/slideLayout"));
|
|
135088
|
+
if (existing) {
|
|
135089
|
+
existing["@_Target"] = target;
|
|
135090
|
+
delete existing["@_TargetMode"];
|
|
135091
|
+
return;
|
|
135092
|
+
}
|
|
135093
|
+
const ids = new Set(relationships2.map((rel) => String(rel["@_Id"])));
|
|
135094
|
+
let id = 1;
|
|
135095
|
+
while (ids.has(`rId${id}`)) {
|
|
135096
|
+
id++;
|
|
135097
|
+
}
|
|
135098
|
+
relationships2.push({ "@_Id": `rId${id}`, "@_Type": relationshipType, "@_Target": target });
|
|
135099
|
+
}
|
|
135100
|
+
var init_slide_layout_relationship = __esm({
|
|
135101
|
+
"src/core/core/runtime/slide-layout-relationship.ts"() {
|
|
135102
|
+
}
|
|
135103
|
+
});
|
|
135039
135104
|
function isXmlObject7(value) {
|
|
135040
135105
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
135041
135106
|
}
|
|
@@ -135688,6 +135753,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
135688
135753
|
init_PptxHandlerRuntimeSaveElementWriter();
|
|
135689
135754
|
init_save_structural_id_gate();
|
|
135690
135755
|
init_slide_fingerprint();
|
|
135756
|
+
init_slide_layout_relationship();
|
|
135691
135757
|
init_slide_save_xml_order();
|
|
135692
135758
|
init_slide_timing_reconcile();
|
|
135693
135759
|
init_slide_transition_reconcile();
|
|
@@ -135855,9 +135921,15 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
135855
135921
|
slideRelsRoot["@_xmlns"] = constants.relationshipsNamespace;
|
|
135856
135922
|
}
|
|
135857
135923
|
const slideRelationships = this.ensureArray(slideRelsRoot["Relationship"]);
|
|
135924
|
+
updateSlideLayoutRelationship(
|
|
135925
|
+
slideRelationships,
|
|
135926
|
+
slide.layoutPath,
|
|
135927
|
+
constants.slideLayoutRelationshipType
|
|
135928
|
+
);
|
|
135858
135929
|
const slideRelationshipRegistry = new PptxSlideRelationshipRegistry({
|
|
135859
135930
|
relationships: slideRelationships
|
|
135860
135931
|
});
|
|
135932
|
+
this.slideRelsMap.set(slide.id, slideRelationshipRegistry.toRelationshipMap());
|
|
135861
135933
|
const existingCommentRelationship = slideRelationshipRegistry.removeCommentRelationships(
|
|
135862
135934
|
constants.slideCommentRelationshipType
|
|
135863
135935
|
);
|
|
@@ -136876,12 +136948,12 @@ function orderedTemplatePartXml(options) {
|
|
|
136876
136948
|
const rebuilt = positionsByRuntime.get(runtime)?.get(partPath);
|
|
136877
136949
|
const ordered4 = rebuilt ? orderShapeTreeChildren(rewrapped, (node) => rebuilt.get(node), getLocalName2) : orderContainer(rewrapped, sourceXml ? scanSpTreeDocumentOrder(sourceXml) : [], getLocalName2);
|
|
136878
136950
|
if (ordered4 === spTree) {
|
|
136879
|
-
return withOrderedTableParagraphs(xmlObj);
|
|
136951
|
+
return withOrderedTableParagraphs(xmlObj, true);
|
|
136880
136952
|
}
|
|
136881
136953
|
const nextRoot = { ...root, "p:cSld": { ...commonSlideData, "p:spTree": ordered4 } };
|
|
136882
136954
|
const nextPart = { ...xmlObj };
|
|
136883
136955
|
setOwnXmlProperty(nextPart, rootTag2, nextRoot);
|
|
136884
|
-
return withOrderedTableParagraphs(nextPart);
|
|
136956
|
+
return withOrderedTableParagraphs(nextPart, true);
|
|
136885
136957
|
}
|
|
136886
136958
|
var ALTERNATE_CONTENT_TAG3;
|
|
136887
136959
|
var positionsByRuntime;
|
|
@@ -138059,19 +138131,18 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
|
|
|
138059
138131
|
return buildMetroBlobs(pptxBytes, slides);
|
|
138060
138132
|
}
|
|
138061
138133
|
/**
|
|
138062
|
-
* The
|
|
138063
|
-
*
|
|
138064
|
-
*
|
|
138065
|
-
* the styles parsed at load.
|
|
138134
|
+
* The text styles of the master at `masterPath` (the first slide's master
|
|
138135
|
+
* when omitted), preferring an edited copy passed in `options.slideMasters`
|
|
138136
|
+
* over the styles parsed at load.
|
|
138066
138137
|
*/
|
|
138067
|
-
legacyMasterTextStyles(slides, options) {
|
|
138138
|
+
legacyMasterTextStyles(slides, options, masterPath) {
|
|
138068
138139
|
const layoutPath = slides[0]?.layoutPath;
|
|
138069
|
-
const
|
|
138070
|
-
if (!
|
|
138140
|
+
const path = (masterPath && this.masterTxStylesCache.has(masterPath) ? masterPath : void 0) ?? (layoutPath ? this.resolveMasterPathForLayout(layoutPath) : void 0) ?? this.masterTxStylesCache.keys().next().value;
|
|
138141
|
+
if (!path) {
|
|
138071
138142
|
return void 0;
|
|
138072
138143
|
}
|
|
138073
|
-
const edited = options?.slideMasters?.find((master) => master.path ===
|
|
138074
|
-
return edited ?? this.masterTxStylesCache.get(
|
|
138144
|
+
const edited = options?.slideMasters?.find((master) => master.path === path)?.txStyles;
|
|
138145
|
+
return edited ?? this.masterTxStylesCache.get(path);
|
|
138075
138146
|
}
|
|
138076
138147
|
/**
|
|
138077
138148
|
* Serialise `slides` to a legacy binary PowerPoint 97-2003 (`.ppt`) file.
|
|
@@ -138088,7 +138159,7 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
|
|
|
138088
138159
|
async saveAsLegacyPpt(slides, options, saveAsPptx) {
|
|
138089
138160
|
const pptxBytes = saveAsPptx ? await saveAsPptx() : void 0;
|
|
138090
138161
|
const metroBlobs = await this.resolveMetroBlobs(slides, pptxBytes);
|
|
138091
|
-
const
|
|
138162
|
+
const deckMasters = pptxBytes ? await buildDeckMasterRoundTripsFromPptx(pptxBytes) : void 0;
|
|
138092
138163
|
this.compatibilityService.resetWarnings();
|
|
138093
138164
|
const resolvedMedia = await this.resolveAudioMediaBytes(slides);
|
|
138094
138165
|
const resolvedPictures = await resolvePictureSources(
|
|
@@ -138105,11 +138176,25 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
|
|
|
138105
138176
|
metroBlobs,
|
|
138106
138177
|
resolvedPictures
|
|
138107
138178
|
);
|
|
138108
|
-
|
|
138109
|
-
|
|
138110
|
-
|
|
138111
|
-
|
|
138112
|
-
|
|
138179
|
+
if (deckMasters && deckMasters.masterPaths.length > 1) {
|
|
138180
|
+
deck.masters = deckMasters.masters.map((roundTrip, i2) => ({
|
|
138181
|
+
roundTrip,
|
|
138182
|
+
styles: convertMasterTextStyles(
|
|
138183
|
+
this.legacyMasterTextStyles(slides, options, deckMasters.masterPaths[i2]),
|
|
138184
|
+
roundTrip.themeFonts
|
|
138185
|
+
)
|
|
138186
|
+
}));
|
|
138187
|
+
deck.slides.forEach((slide, i2) => {
|
|
138188
|
+
slide.masterIndex = deckMasters.slideMasterIndex[i2];
|
|
138189
|
+
});
|
|
138190
|
+
} else {
|
|
138191
|
+
const master = deckMasters?.masters[0];
|
|
138192
|
+
deck.masterStyles = convertMasterTextStyles(
|
|
138193
|
+
this.legacyMasterTextStyles(slides, options, deckMasters?.masterPaths[0]),
|
|
138194
|
+
master?.themeFonts
|
|
138195
|
+
);
|
|
138196
|
+
deck.master = master;
|
|
138197
|
+
}
|
|
138113
138198
|
return buildPptFile(deck, { password: options?.pptPassword });
|
|
138114
138199
|
}
|
|
138115
138200
|
};
|
|
@@ -151623,7 +151708,7 @@ function readPersistRecord(view, directory, persistId) {
|
|
|
151623
151708
|
return readRecordOrThrow(view, offset);
|
|
151624
151709
|
}
|
|
151625
151710
|
var init_persist_directory = __esm({
|
|
151626
|
-
"../../node_modules/.bun/@christophervr+ole2@0.
|
|
151711
|
+
"../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/persist-directory.js"() {
|
|
151627
151712
|
init_record_stream();
|
|
151628
151713
|
init_record_types();
|
|
151629
151714
|
}
|
|
@@ -185539,6 +185624,250 @@ pptx-ui-checkbox[checked] { border-color: var(--pptx-primary, #6366f1); }
|
|
|
185539
185624
|
}
|
|
185540
185625
|
}
|
|
185541
185626
|
`;
|
|
185627
|
+
var CONTRACT_REVISION = 1;
|
|
185628
|
+
var CONTRACT_KEY = /* @__PURE__ */ Symbol.for("pptx-viewer.web-control-contract");
|
|
185629
|
+
function assertWebControlContract(registry, names) {
|
|
185630
|
+
for (const name of names) {
|
|
185631
|
+
const ctor = registry.get(name);
|
|
185632
|
+
const revision = ctor?.[CONTRACT_KEY];
|
|
185633
|
+
if (revision !== void 0 && revision !== CONTRACT_REVISION) {
|
|
185634
|
+
throw new Error(
|
|
185635
|
+
`Incompatible ${name} contract (${revision}; expected ${CONTRACT_REVISION}). Use matching viewer bindings in this window.`
|
|
185636
|
+
);
|
|
185637
|
+
}
|
|
185638
|
+
}
|
|
185639
|
+
}
|
|
185640
|
+
function markWebControlContract(ctor) {
|
|
185641
|
+
Object.defineProperty(ctor, CONTRACT_KEY, { value: CONTRACT_REVISION });
|
|
185642
|
+
}
|
|
185643
|
+
var RIBBON_COMMAND_STYLES = `
|
|
185644
|
+
:host { display: inline-flex; flex: none; }
|
|
185645
|
+
button {
|
|
185646
|
+
box-sizing: border-box; display: inline-flex; flex-direction: column; align-items: center;
|
|
185647
|
+
justify-content: flex-start; gap: 2px; min-width: 54px; max-width: 78px; height: 58px;
|
|
185648
|
+
padding: 4px; border: 0; border-radius: 4px; background: transparent;
|
|
185649
|
+
color: var(--pptx-foreground, #f9fafb); cursor: pointer; font: inherit;
|
|
185650
|
+
font-size: 9px; line-height: 11px; text-align: center;
|
|
185651
|
+
}
|
|
185652
|
+
svg { width: 24px; height: 24px; flex: none; color: var(--pptx-primary, #6366f1);
|
|
185653
|
+
fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
|
|
185654
|
+
:host([compact]) button { flex-direction: row; align-items: center; justify-content: flex-start;
|
|
185655
|
+
gap: 6px; min-width: 88px; max-width: none; height: 26px; padding: 0 4px; font-size: 10px; text-align: left; }
|
|
185656
|
+
:host([compact]) svg { width: 16px; height: 16px; }
|
|
185657
|
+
button:hover:not(:disabled) { background: var(--pptx-accent, #33334d); }
|
|
185658
|
+
:host([active]) button { background: color-mix(in srgb, var(--pptx-primary, #6366f1) 15%, transparent); color: var(--pptx-primary, #6366f1); }
|
|
185659
|
+
button:disabled { opacity: .35; cursor: not-allowed; }
|
|
185660
|
+
button:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 2px; }
|
|
185661
|
+
@media (pointer: coarse), (max-width: 767px) { :host([compact]) button { min-height: 44px; } }
|
|
185662
|
+
@media (forced-colors: active) {
|
|
185663
|
+
button { color: ButtonText; } svg { color: ButtonText; }
|
|
185664
|
+
button:disabled { color: GrayText; opacity: 1; }
|
|
185665
|
+
button:focus-visible { outline-color: Highlight; }
|
|
185666
|
+
:host([active]) button { border: 1px solid Highlight; }
|
|
185667
|
+
}
|
|
185668
|
+
`;
|
|
185669
|
+
var RIBBON_ICON_PATHS = {
|
|
185670
|
+
camera: "M2 6h4l2-3h4l2 3h4v11H2ZM7 11a3 3 0 1 0 6 0 3 3 0 1 0-6 0",
|
|
185671
|
+
eraser: "M3 12l8-8 6 6-7 7H7ZM3 17h14M7 8l6 6",
|
|
185672
|
+
reset: "M4 10a6 6 0 1 1 1.8 4.2M4 6v4h4",
|
|
185673
|
+
help: "M3 10a7 7 0 1 0 14 0 7 7 0 1 0-14 0M8 7a2 2 0 1 1 3 1.8c-.7.3-1 .8-1 1.7M10 14v.1",
|
|
185674
|
+
"play-start": "M4 3 15 10 4 17ZM17 3v14",
|
|
185675
|
+
play: "M5 3 16 10 5 17Z",
|
|
185676
|
+
presentation: "M2 3h16v11H2ZM7 18h6M10 14v4",
|
|
185677
|
+
list: "M4 4h12v12H4ZM7 8h6M7 11h6",
|
|
185678
|
+
broadcast: "M7 7a4.2 4.2 0 0 0 0 6M13 7a4.2 4.2 0 0 1 0 6M4.5 4.5a7.8 7.8 0 0 0 0 11M15.5 4.5a7.8 7.8 0 0 1 0 11M8.5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0",
|
|
185679
|
+
video: "M2 5h11v10H2ZM13 10l5-3v6Z",
|
|
185680
|
+
settings: "M3 5h14M6 10h8M8 15h4M6 3v4M12 8v4M10 13v4",
|
|
185681
|
+
"eye-off": "M2.5 10S5.5 5 10 5s7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5ZM4 4l12 12",
|
|
185682
|
+
clock: "M3 10a7 7 0 1 0 14 0 7 7 0 1 0-14 0M10 6v4l3 2",
|
|
185683
|
+
record: "M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0",
|
|
185684
|
+
captions: "M2 4h16v12H2ZM5 9h4M11 9h4M5 12h3M10 12h5",
|
|
185685
|
+
keyboard: "M2 5h16v10H2ZM5 8h1M9 8h1M13 8h1M5 11h1M9 11h5",
|
|
185686
|
+
accessibility: "M8 3a2 2 0 1 0 4 0 2 2 0 1 0-4 0M3 7l7 2 7-2M10 9v4M10 13l-4 5M10 13l4 5"
|
|
185687
|
+
};
|
|
185688
|
+
function definePptxRibbonCommand(registry) {
|
|
185689
|
+
if (registry.get("pptx-ui-ribbon-command")) {
|
|
185690
|
+
return;
|
|
185691
|
+
}
|
|
185692
|
+
class RibbonCommand extends HTMLElement {
|
|
185693
|
+
static observedAttributes = [
|
|
185694
|
+
"label",
|
|
185695
|
+
"icon",
|
|
185696
|
+
"disabled",
|
|
185697
|
+
"active",
|
|
185698
|
+
"compact",
|
|
185699
|
+
"pressed",
|
|
185700
|
+
"expanded",
|
|
185701
|
+
"title",
|
|
185702
|
+
"data-ribbon-control"
|
|
185703
|
+
];
|
|
185704
|
+
button;
|
|
185705
|
+
text;
|
|
185706
|
+
path;
|
|
185707
|
+
constructor() {
|
|
185708
|
+
super();
|
|
185709
|
+
const root = this.attachShadow({ mode: "open" });
|
|
185710
|
+
attachControlStyles(root, RIBBON_COMMAND_STYLES);
|
|
185711
|
+
this.button = document.createElement("button");
|
|
185712
|
+
this.button.type = "button";
|
|
185713
|
+
this.button.setAttribute("part", "button");
|
|
185714
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
185715
|
+
svg.setAttribute("viewBox", "0 0 20 20");
|
|
185716
|
+
svg.setAttribute("aria-hidden", "true");
|
|
185717
|
+
this.path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
185718
|
+
svg.append(this.path);
|
|
185719
|
+
this.text = document.createElement("span");
|
|
185720
|
+
this.button.append(svg, this.text);
|
|
185721
|
+
root.append(this.button);
|
|
185722
|
+
this.button.addEventListener("keydown", (event) => {
|
|
185723
|
+
if ((event.key === " " || event.key === "Enter") && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
185724
|
+
event.stopPropagation();
|
|
185725
|
+
}
|
|
185726
|
+
});
|
|
185727
|
+
this.button.addEventListener("click", () => {
|
|
185728
|
+
const id = this.getAttribute("data-ribbon-control");
|
|
185729
|
+
if (!this.button.disabled && id) {
|
|
185730
|
+
this.dispatchEvent(
|
|
185731
|
+
new CustomEvent("command-request", { detail: { id }, bubbles: true, composed: true })
|
|
185732
|
+
);
|
|
185733
|
+
}
|
|
185734
|
+
});
|
|
185735
|
+
}
|
|
185736
|
+
connectedCallback() {
|
|
185737
|
+
this.sync();
|
|
185738
|
+
}
|
|
185739
|
+
attributeChangedCallback() {
|
|
185740
|
+
this.sync();
|
|
185741
|
+
}
|
|
185742
|
+
sync() {
|
|
185743
|
+
this.text.textContent = this.getAttribute("label") ?? "";
|
|
185744
|
+
this.button.title = this.getAttribute("title") ?? this.text.textContent;
|
|
185745
|
+
this.button.disabled = this.hasAttribute("disabled");
|
|
185746
|
+
this.path.setAttribute("d", RIBBON_ICON_PATHS[this.getAttribute("icon") ?? ""] ?? "");
|
|
185747
|
+
for (const attr22 of ["pressed", "expanded"]) {
|
|
185748
|
+
const value = this.getAttribute(attr22);
|
|
185749
|
+
if (value === null) {
|
|
185750
|
+
this.button.removeAttribute(`aria-${attr22}`);
|
|
185751
|
+
} else {
|
|
185752
|
+
this.button.setAttribute(`aria-${attr22}`, value);
|
|
185753
|
+
}
|
|
185754
|
+
}
|
|
185755
|
+
}
|
|
185756
|
+
}
|
|
185757
|
+
registry.define("pptx-ui-ribbon-command", RibbonCommand);
|
|
185758
|
+
}
|
|
185759
|
+
var STYLES = `
|
|
185760
|
+
:host { display: inline-flex; flex: none; align-self: stretch; }
|
|
185761
|
+
.group { box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
|
|
185762
|
+
min-height: 78px; padding: 4px 8px 2px; border-right: 1px solid color-mix(in srgb, var(--pptx-border, #33334d) 60%, transparent); }
|
|
185763
|
+
:host(:last-child) .group { border-right: 0; }
|
|
185764
|
+
.row { display: flex; align-items: flex-start; gap: 4px; }
|
|
185765
|
+
::slotted(*) { flex-shrink: 0; }
|
|
185766
|
+
.caption { padding-top: 2px; color: var(--pptx-muted-foreground, #94a3b8); font: inherit;
|
|
185767
|
+
font-size: 9px; line-height: 12px; text-align: center; white-space: nowrap; }
|
|
185768
|
+
`;
|
|
185769
|
+
function definePptxRibbonGroup(registry) {
|
|
185770
|
+
if (registry.get("pptx-ui-ribbon-group")) {
|
|
185771
|
+
return;
|
|
185772
|
+
}
|
|
185773
|
+
class RibbonGroup extends HTMLElement {
|
|
185774
|
+
static observedAttributes = ["label"];
|
|
185775
|
+
caption;
|
|
185776
|
+
constructor() {
|
|
185777
|
+
super();
|
|
185778
|
+
const root = this.attachShadow({ mode: "open" });
|
|
185779
|
+
attachControlStyles(root, STYLES);
|
|
185780
|
+
const group2 = document.createElement("div");
|
|
185781
|
+
group2.className = "group";
|
|
185782
|
+
const row = document.createElement("div");
|
|
185783
|
+
row.className = "row";
|
|
185784
|
+
row.append(document.createElement("slot"));
|
|
185785
|
+
this.caption = document.createElement("span");
|
|
185786
|
+
this.caption.className = "caption";
|
|
185787
|
+
group2.append(row, this.caption);
|
|
185788
|
+
root.append(group2);
|
|
185789
|
+
}
|
|
185790
|
+
connectedCallback() {
|
|
185791
|
+
this.setAttribute("role", "group");
|
|
185792
|
+
this.sync();
|
|
185793
|
+
}
|
|
185794
|
+
attributeChangedCallback() {
|
|
185795
|
+
this.sync();
|
|
185796
|
+
}
|
|
185797
|
+
sync() {
|
|
185798
|
+
const label = this.getAttribute("label") ?? "";
|
|
185799
|
+
this.caption.textContent = label;
|
|
185800
|
+
this.setAttribute("aria-label", label);
|
|
185801
|
+
}
|
|
185802
|
+
}
|
|
185803
|
+
registry.define("pptx-ui-ribbon-group", RibbonGroup);
|
|
185804
|
+
}
|
|
185805
|
+
function definePptxRibbonToggle(registry) {
|
|
185806
|
+
if (registry.get("pptx-ui-ribbon-toggle")) {
|
|
185807
|
+
return;
|
|
185808
|
+
}
|
|
185809
|
+
class RibbonToggle extends HTMLElement {
|
|
185810
|
+
static observedAttributes = ["label", "checked", "disabled", "title"];
|
|
185811
|
+
checkbox;
|
|
185812
|
+
text;
|
|
185813
|
+
constructor() {
|
|
185814
|
+
super();
|
|
185815
|
+
const root = this.attachShadow({ mode: "open" });
|
|
185816
|
+
attachControlStyles(
|
|
185817
|
+
root,
|
|
185818
|
+
`
|
|
185819
|
+
:host { display: block; }
|
|
185820
|
+
label { display: flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 4px;
|
|
185821
|
+
color: var(--pptx-foreground, #f9fafb); font: inherit; font-size: 10px; white-space: nowrap; cursor: pointer; }
|
|
185822
|
+
:host([disabled]) label { color: var(--pptx-muted-foreground, #9ca3af); cursor: not-allowed; }
|
|
185823
|
+
@media (pointer: coarse), (max-width: 767px) { label { min-height: 44px; font-size: 12px; } }
|
|
185824
|
+
`
|
|
185825
|
+
);
|
|
185826
|
+
const label = document.createElement("label");
|
|
185827
|
+
this.checkbox = document.createElement("pptx-ui-checkbox");
|
|
185828
|
+
this.text = document.createTextNode("");
|
|
185829
|
+
label.append(this.checkbox, this.text);
|
|
185830
|
+
label.addEventListener("click", (event) => {
|
|
185831
|
+
event.preventDefault();
|
|
185832
|
+
if (event.target !== this.checkbox) {
|
|
185833
|
+
this.checkbox.click();
|
|
185834
|
+
}
|
|
185835
|
+
});
|
|
185836
|
+
this.checkbox.addEventListener("input", (event) => event.stopPropagation());
|
|
185837
|
+
this.checkbox.addEventListener("change", (event) => {
|
|
185838
|
+
event.stopPropagation();
|
|
185839
|
+
const checked = this.checkbox.checked;
|
|
185840
|
+
this.sync();
|
|
185841
|
+
const id = this.getAttribute("data-ribbon-control");
|
|
185842
|
+
if (!this.hasAttribute("disabled") && id) {
|
|
185843
|
+
this.dispatchEvent(
|
|
185844
|
+
new CustomEvent("toggle-request", {
|
|
185845
|
+
detail: { id, checked },
|
|
185846
|
+
bubbles: true,
|
|
185847
|
+
composed: true
|
|
185848
|
+
})
|
|
185849
|
+
);
|
|
185850
|
+
}
|
|
185851
|
+
});
|
|
185852
|
+
root.append(label);
|
|
185853
|
+
}
|
|
185854
|
+
connectedCallback() {
|
|
185855
|
+
this.sync();
|
|
185856
|
+
}
|
|
185857
|
+
attributeChangedCallback() {
|
|
185858
|
+
this.sync();
|
|
185859
|
+
}
|
|
185860
|
+
sync() {
|
|
185861
|
+
const label = this.getAttribute("label") ?? "";
|
|
185862
|
+
this.text.textContent = label;
|
|
185863
|
+
this.checkbox.setAttribute("aria-label", label);
|
|
185864
|
+
this.checkbox.title = this.getAttribute("title") ?? label;
|
|
185865
|
+
this.checkbox.checked = this.hasAttribute("checked");
|
|
185866
|
+
this.checkbox.disabled = this.hasAttribute("disabled");
|
|
185867
|
+
}
|
|
185868
|
+
}
|
|
185869
|
+
registry.define("pptx-ui-ribbon-toggle", RibbonToggle);
|
|
185870
|
+
}
|
|
185542
185871
|
var SEARCH_STYLES = `
|
|
185543
185872
|
:host {
|
|
185544
185873
|
display: flex;
|
|
@@ -185978,6 +186307,9 @@ function definePptxSelect(registry) {
|
|
|
185978
186307
|
}
|
|
185979
186308
|
disconnectedCallback() {
|
|
185980
186309
|
this.close();
|
|
186310
|
+
window.clearTimeout(this.searchTimer);
|
|
186311
|
+
this.searchTimer = 0;
|
|
186312
|
+
this.search = "";
|
|
185981
186313
|
this.observer.disconnect();
|
|
185982
186314
|
cancelAnimationFrame(this.refreshFrame);
|
|
185983
186315
|
this.refreshFrame = 0;
|
|
@@ -186149,796 +186481,6 @@ function definePptxSelect(registry) {
|
|
|
186149
186481
|
}
|
|
186150
186482
|
registry.define("pptx-ui-select", PptxSelect);
|
|
186151
186483
|
}
|
|
186152
|
-
function registerPptxWebControls() {
|
|
186153
|
-
if (typeof window === "undefined" || !window.customElements) {
|
|
186154
|
-
return;
|
|
186155
|
-
}
|
|
186156
|
-
if (!document.getElementById("pptx-ui-control-hosts")) {
|
|
186157
|
-
const style = document.createElement("style");
|
|
186158
|
-
style.id = "pptx-ui-control-hosts";
|
|
186159
|
-
style.textContent = HOST_STYLES;
|
|
186160
|
-
document.head.append(style);
|
|
186161
|
-
}
|
|
186162
|
-
definePptxSearchField(window.customElements);
|
|
186163
|
-
definePptxCheckbox(window.customElements);
|
|
186164
|
-
definePptxSelect(window.customElements);
|
|
186165
|
-
}
|
|
186166
|
-
var defaultThemeColors = {
|
|
186167
|
-
background: "#030712",
|
|
186168
|
-
// gray-950
|
|
186169
|
-
foreground: "#f3f4f6",
|
|
186170
|
-
// gray-100
|
|
186171
|
-
card: "#111827",
|
|
186172
|
-
// gray-900
|
|
186173
|
-
cardForeground: "#f3f4f6",
|
|
186174
|
-
// gray-100
|
|
186175
|
-
popover: "#111827",
|
|
186176
|
-
// gray-900
|
|
186177
|
-
popoverForeground: "#f3f4f6",
|
|
186178
|
-
// gray-100
|
|
186179
|
-
primary: "#6366f1",
|
|
186180
|
-
// indigo-500
|
|
186181
|
-
primaryForeground: "#ffffff",
|
|
186182
|
-
// white
|
|
186183
|
-
secondary: "#1f2937",
|
|
186184
|
-
// gray-800
|
|
186185
|
-
secondaryForeground: "#f3f4f6",
|
|
186186
|
-
// gray-100
|
|
186187
|
-
muted: "#1f2937",
|
|
186188
|
-
// gray-800
|
|
186189
|
-
mutedForeground: "#9ca3af",
|
|
186190
|
-
// gray-400
|
|
186191
|
-
accent: "#1f2937",
|
|
186192
|
-
// gray-800
|
|
186193
|
-
accentForeground: "#f3f4f6",
|
|
186194
|
-
// gray-100
|
|
186195
|
-
destructive: "#ef4444",
|
|
186196
|
-
// red-500
|
|
186197
|
-
destructiveForeground: "#ffffff",
|
|
186198
|
-
// white
|
|
186199
|
-
border: "#374151",
|
|
186200
|
-
// gray-700
|
|
186201
|
-
input: "#374151",
|
|
186202
|
-
// gray-700
|
|
186203
|
-
ring: "#6366f1"
|
|
186204
|
-
// indigo-500
|
|
186205
|
-
};
|
|
186206
|
-
var defaultRadius = "0.5rem";
|
|
186207
|
-
var lightThemeColors = {
|
|
186208
|
-
background: "#f8fafc",
|
|
186209
|
-
// slate-50
|
|
186210
|
-
foreground: "#0f172a",
|
|
186211
|
-
// slate-900
|
|
186212
|
-
card: "#ffffff",
|
|
186213
|
-
cardForeground: "#0f172a",
|
|
186214
|
-
// slate-900
|
|
186215
|
-
popover: "#ffffff",
|
|
186216
|
-
popoverForeground: "#0f172a",
|
|
186217
|
-
// slate-900
|
|
186218
|
-
primary: "#4f46e5",
|
|
186219
|
-
// indigo-600
|
|
186220
|
-
primaryForeground: "#ffffff",
|
|
186221
|
-
secondary: "#f1f5f9",
|
|
186222
|
-
// slate-100
|
|
186223
|
-
secondaryForeground: "#0f172a",
|
|
186224
|
-
// slate-900
|
|
186225
|
-
muted: "#f1f5f9",
|
|
186226
|
-
// slate-100
|
|
186227
|
-
mutedForeground: "#64748b",
|
|
186228
|
-
// slate-500
|
|
186229
|
-
accent: "#f1f5f9",
|
|
186230
|
-
// slate-100
|
|
186231
|
-
accentForeground: "#0f172a",
|
|
186232
|
-
// slate-900
|
|
186233
|
-
destructive: "#dc2626",
|
|
186234
|
-
// red-600
|
|
186235
|
-
destructiveForeground: "#ffffff",
|
|
186236
|
-
border: "#e2e8f0",
|
|
186237
|
-
// slate-200
|
|
186238
|
-
input: "#e2e8f0",
|
|
186239
|
-
// slate-200
|
|
186240
|
-
ring: "#4f46e5"
|
|
186241
|
-
// indigo-600
|
|
186242
|
-
};
|
|
186243
|
-
var lightTheme = {
|
|
186244
|
-
colors: lightThemeColors
|
|
186245
|
-
};
|
|
186246
|
-
var COLOR_KEY_TO_CSS = {
|
|
186247
|
-
background: "background",
|
|
186248
|
-
foreground: "foreground",
|
|
186249
|
-
card: "card",
|
|
186250
|
-
cardForeground: "card-foreground",
|
|
186251
|
-
popover: "popover",
|
|
186252
|
-
popoverForeground: "popover-foreground",
|
|
186253
|
-
primary: "primary",
|
|
186254
|
-
primaryForeground: "primary-foreground",
|
|
186255
|
-
secondary: "secondary",
|
|
186256
|
-
secondaryForeground: "secondary-foreground",
|
|
186257
|
-
muted: "muted",
|
|
186258
|
-
mutedForeground: "muted-foreground",
|
|
186259
|
-
accent: "accent",
|
|
186260
|
-
accentForeground: "accent-foreground",
|
|
186261
|
-
destructive: "destructive",
|
|
186262
|
-
destructiveForeground: "destructive-foreground",
|
|
186263
|
-
border: "border",
|
|
186264
|
-
input: "input",
|
|
186265
|
-
ring: "ring"
|
|
186266
|
-
};
|
|
186267
|
-
var DERIVED_COLOR_TOKENS = [
|
|
186268
|
-
{ source: "primary", cssSuffix: "inspector-active" },
|
|
186269
|
-
{ source: "border", cssSuffix: "inspector-border" }
|
|
186270
|
-
];
|
|
186271
|
-
function themeToCssVars(theme, omitDefaults = false) {
|
|
186272
|
-
const vars = {};
|
|
186273
|
-
if (!theme) {
|
|
186274
|
-
return vars;
|
|
186275
|
-
}
|
|
186276
|
-
const colors = theme.colors;
|
|
186277
|
-
if (colors) {
|
|
186278
|
-
for (const [key2, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
|
|
186279
|
-
const value = colors[key2];
|
|
186280
|
-
if (value === void 0) {
|
|
186281
|
-
continue;
|
|
186282
|
-
}
|
|
186283
|
-
if (omitDefaults && value === defaultThemeColors[key2]) {
|
|
186284
|
-
continue;
|
|
186285
|
-
}
|
|
186286
|
-
vars[`--pptx-${cssSuffix}`] = value;
|
|
186287
|
-
vars[`--color-${cssSuffix}`] = value;
|
|
186288
|
-
}
|
|
186289
|
-
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
186290
|
-
const value = colors[source];
|
|
186291
|
-
if (value === void 0) {
|
|
186292
|
-
continue;
|
|
186293
|
-
}
|
|
186294
|
-
if (omitDefaults && value === defaultThemeColors[source]) {
|
|
186295
|
-
continue;
|
|
186296
|
-
}
|
|
186297
|
-
vars[`--pptx-${cssSuffix}`] = value;
|
|
186298
|
-
}
|
|
186299
|
-
}
|
|
186300
|
-
if (theme.radius !== void 0) {
|
|
186301
|
-
if (!omitDefaults || theme.radius !== defaultRadius) {
|
|
186302
|
-
vars["--pptx-radius"] = theme.radius;
|
|
186303
|
-
const r = theme.radius;
|
|
186304
|
-
vars["--radius-sm"] = `calc(${r} - 4px)`;
|
|
186305
|
-
vars["--radius-md"] = `calc(${r} - 2px)`;
|
|
186306
|
-
vars["--radius-lg"] = r;
|
|
186307
|
-
vars["--radius-xl"] = `calc(${r} + 4px)`;
|
|
186308
|
-
}
|
|
186309
|
-
}
|
|
186310
|
-
if (theme.cssVars) {
|
|
186311
|
-
for (const [key2, value] of Object.entries(theme.cssVars)) {
|
|
186312
|
-
vars[key2] = value;
|
|
186313
|
-
}
|
|
186314
|
-
}
|
|
186315
|
-
return vars;
|
|
186316
|
-
}
|
|
186317
|
-
function defaultCssVars() {
|
|
186318
|
-
const vars = {};
|
|
186319
|
-
for (const [key2, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
|
|
186320
|
-
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[key2];
|
|
186321
|
-
}
|
|
186322
|
-
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
186323
|
-
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[source];
|
|
186324
|
-
}
|
|
186325
|
-
vars["--pptx-radius"] = defaultRadius;
|
|
186326
|
-
return vars;
|
|
186327
|
-
}
|
|
186328
|
-
var vermilionLightColors = {
|
|
186329
|
-
background: "#fbfaf7",
|
|
186330
|
-
foreground: "#1a1d21",
|
|
186331
|
-
card: "#ffffff",
|
|
186332
|
-
cardForeground: "#1a1d21",
|
|
186333
|
-
popover: "#ffffff",
|
|
186334
|
-
popoverForeground: "#1a1d21",
|
|
186335
|
-
primary: "#c2431f",
|
|
186336
|
-
primaryForeground: "#ffffff",
|
|
186337
|
-
secondary: "#f2efe8",
|
|
186338
|
-
secondaryForeground: "#1a1d21",
|
|
186339
|
-
muted: "#f2efe8",
|
|
186340
|
-
mutedForeground: "#5a626e",
|
|
186341
|
-
accent: "rgba(194, 67, 31, 0.08)",
|
|
186342
|
-
accentForeground: "#1a1d21",
|
|
186343
|
-
destructive: "#dc2626",
|
|
186344
|
-
destructiveForeground: "#ffffff",
|
|
186345
|
-
border: "#e6e2d9",
|
|
186346
|
-
input: "#e6e2d9",
|
|
186347
|
-
ring: "#c2431f"
|
|
186348
|
-
};
|
|
186349
|
-
var vermilionDarkColors = {
|
|
186350
|
-
background: "#0f1113",
|
|
186351
|
-
foreground: "#f0efec",
|
|
186352
|
-
card: "#171a1e",
|
|
186353
|
-
cardForeground: "#f0efec",
|
|
186354
|
-
popover: "#171a1e",
|
|
186355
|
-
popoverForeground: "#f0efec",
|
|
186356
|
-
primary: "#e86a40",
|
|
186357
|
-
primaryForeground: "#ffffff",
|
|
186358
|
-
secondary: "#1f242b",
|
|
186359
|
-
secondaryForeground: "#f0efec",
|
|
186360
|
-
muted: "#1f242b",
|
|
186361
|
-
mutedForeground: "#9aa1ab",
|
|
186362
|
-
accent: "rgba(232, 106, 64, 0.1)",
|
|
186363
|
-
accentForeground: "#f0efec",
|
|
186364
|
-
destructive: "#ef4444",
|
|
186365
|
-
destructiveForeground: "#ffffff",
|
|
186366
|
-
border: "#272c33",
|
|
186367
|
-
input: "#272c33",
|
|
186368
|
-
ring: "#e86a40"
|
|
186369
|
-
};
|
|
186370
|
-
var vermilionRadius = "0.375rem";
|
|
186371
|
-
var vermilionLightTheme = {
|
|
186372
|
-
colors: vermilionLightColors,
|
|
186373
|
-
radius: vermilionRadius
|
|
186374
|
-
};
|
|
186375
|
-
var vermilionDarkTheme = {
|
|
186376
|
-
colors: vermilionDarkColors,
|
|
186377
|
-
radius: vermilionRadius
|
|
186378
|
-
};
|
|
186379
|
-
var THEME_CATALOG = [
|
|
186380
|
-
{ key: "default", labelKey: "pptx.settings.theme.default", theme: void 0 },
|
|
186381
|
-
{ key: "light", labelKey: "pptx.settings.theme.light", theme: lightTheme },
|
|
186382
|
-
{
|
|
186383
|
-
key: "vermilionLight",
|
|
186384
|
-
labelKey: "pptx.settings.theme.vermilionLight",
|
|
186385
|
-
theme: vermilionLightTheme
|
|
186386
|
-
},
|
|
186387
|
-
{
|
|
186388
|
-
key: "vermilionDark",
|
|
186389
|
-
labelKey: "pptx.settings.theme.vermilionDark",
|
|
186390
|
-
theme: vermilionDarkTheme
|
|
186391
|
-
}
|
|
186392
|
-
];
|
|
186393
|
-
function resolveThemeCatalogEntry(key2, catalog = THEME_CATALOG) {
|
|
186394
|
-
return catalog.find((entry5) => entry5.key === key2)?.theme;
|
|
186395
|
-
}
|
|
186396
|
-
function corePreset(id) {
|
|
186397
|
-
const preset22 = exports.THEME_PRESETS.find((p) => p.id === id);
|
|
186398
|
-
if (!preset22) {
|
|
186399
|
-
throw new Error(`theme-gallery-presets: core THEME_PRESETS is missing "${id}"`);
|
|
186400
|
-
}
|
|
186401
|
-
return preset22;
|
|
186402
|
-
}
|
|
186403
|
-
var WISP_PRESET = {
|
|
186404
|
-
id: "wisp",
|
|
186405
|
-
name: "Wisp",
|
|
186406
|
-
colorScheme: {
|
|
186407
|
-
dk1: "#000000",
|
|
186408
|
-
lt1: "#FFFFFF",
|
|
186409
|
-
dk2: "#46393B",
|
|
186410
|
-
lt2: "#E8DCD8",
|
|
186411
|
-
accent1: "#A53010",
|
|
186412
|
-
accent2: "#DE7E18",
|
|
186413
|
-
accent3: "#9F8351",
|
|
186414
|
-
accent4: "#728653",
|
|
186415
|
-
accent5: "#92AA4C",
|
|
186416
|
-
accent6: "#6AAC91",
|
|
186417
|
-
hlink: "#FB4F14",
|
|
186418
|
-
folHlink: "#E25839"
|
|
186419
|
-
},
|
|
186420
|
-
fontScheme: {
|
|
186421
|
-
majorFont: { latin: "Century Gothic" },
|
|
186422
|
-
minorFont: { latin: "Century Gothic" }
|
|
186423
|
-
}
|
|
186424
|
-
};
|
|
186425
|
-
var BERLIN_PRESET = {
|
|
186426
|
-
id: "berlin",
|
|
186427
|
-
name: "Berlin",
|
|
186428
|
-
colorScheme: {
|
|
186429
|
-
dk1: "#000000",
|
|
186430
|
-
lt1: "#FFFFFF",
|
|
186431
|
-
dk2: "#3E5C61",
|
|
186432
|
-
lt2: "#D5E0D0",
|
|
186433
|
-
accent1: "#F09415",
|
|
186434
|
-
accent2: "#C1B56B",
|
|
186435
|
-
accent3: "#89C2A3",
|
|
186436
|
-
accent4: "#729BBE",
|
|
186437
|
-
accent5: "#9A90C2",
|
|
186438
|
-
accent6: "#BE8DBE",
|
|
186439
|
-
hlink: "#25A0DA",
|
|
186440
|
-
folHlink: "#FF7F00"
|
|
186441
|
-
},
|
|
186442
|
-
fontScheme: {
|
|
186443
|
-
majorFont: { latin: "Trebuchet MS" },
|
|
186444
|
-
minorFont: { latin: "Trebuchet MS" }
|
|
186445
|
-
}
|
|
186446
|
-
};
|
|
186447
|
-
var SLICE_PRESET = {
|
|
186448
|
-
id: "slice",
|
|
186449
|
-
name: "Slice",
|
|
186450
|
-
colorScheme: {
|
|
186451
|
-
dk1: "#000000",
|
|
186452
|
-
lt1: "#FFFFFF",
|
|
186453
|
-
dk2: "#2E3B4C",
|
|
186454
|
-
lt2: "#C7CDD3",
|
|
186455
|
-
accent1: "#E2751D",
|
|
186456
|
-
accent2: "#C53B23",
|
|
186457
|
-
accent3: "#A13D69",
|
|
186458
|
-
accent4: "#58599E",
|
|
186459
|
-
accent5: "#36749D",
|
|
186460
|
-
accent6: "#4EA39A",
|
|
186461
|
-
hlink: "#FD6B32",
|
|
186462
|
-
folHlink: "#D14D0F"
|
|
186463
|
-
},
|
|
186464
|
-
fontScheme: {
|
|
186465
|
-
majorFont: { latin: "Century Gothic" },
|
|
186466
|
-
minorFont: { latin: "Century Gothic" }
|
|
186467
|
-
}
|
|
186468
|
-
};
|
|
186469
|
-
var DIVIDEND_PRESET = {
|
|
186470
|
-
id: "dividend",
|
|
186471
|
-
name: "Dividend",
|
|
186472
|
-
colorScheme: {
|
|
186473
|
-
dk1: "#000000",
|
|
186474
|
-
lt1: "#FFFFFF",
|
|
186475
|
-
dk2: "#3D3D3D",
|
|
186476
|
-
lt2: "#E1E1E1",
|
|
186477
|
-
accent1: "#4D1434",
|
|
186478
|
-
accent2: "#903163",
|
|
186479
|
-
accent3: "#B2324B",
|
|
186480
|
-
accent4: "#D34817",
|
|
186481
|
-
accent5: "#E8971C",
|
|
186482
|
-
accent6: "#FDCB00",
|
|
186483
|
-
hlink: "#A03068",
|
|
186484
|
-
folHlink: "#C34882"
|
|
186485
|
-
},
|
|
186486
|
-
fontScheme: {
|
|
186487
|
-
majorFont: { latin: "Gill Sans MT" },
|
|
186488
|
-
minorFont: { latin: "Gill Sans MT" }
|
|
186489
|
-
}
|
|
186490
|
-
};
|
|
186491
|
-
[
|
|
186492
|
-
corePreset("office"),
|
|
186493
|
-
corePreset("facet"),
|
|
186494
|
-
corePreset("integral"),
|
|
186495
|
-
corePreset("ion"),
|
|
186496
|
-
corePreset("retrospect"),
|
|
186497
|
-
corePreset("organic"),
|
|
186498
|
-
WISP_PRESET,
|
|
186499
|
-
BERLIN_PRESET,
|
|
186500
|
-
SLICE_PRESET,
|
|
186501
|
-
DIVIDEND_PRESET
|
|
186502
|
-
];
|
|
186503
|
-
function createPresentationLoadResources(handler) {
|
|
186504
|
-
const blobUrls = [];
|
|
186505
|
-
let committed = false;
|
|
186506
|
-
let released = false;
|
|
186507
|
-
return {
|
|
186508
|
-
blobUrls,
|
|
186509
|
-
/** The live viewer now owns the handler and media URLs. */
|
|
186510
|
-
commit() {
|
|
186511
|
-
committed = true;
|
|
186512
|
-
},
|
|
186513
|
-
/** Call in finally, after pending asset reads have settled. */
|
|
186514
|
-
releaseIfUncommitted() {
|
|
186515
|
-
if (committed || released) {
|
|
186516
|
-
return;
|
|
186517
|
-
}
|
|
186518
|
-
released = true;
|
|
186519
|
-
handler.dispose();
|
|
186520
|
-
for (const url of blobUrls) {
|
|
186521
|
-
if (url.startsWith("blob:")) {
|
|
186522
|
-
URL.revokeObjectURL(url);
|
|
186523
|
-
}
|
|
186524
|
-
}
|
|
186525
|
-
}
|
|
186526
|
-
};
|
|
186527
|
-
}
|
|
186528
|
-
function walkAndPatchElements(elements, patch) {
|
|
186529
|
-
let mutated = false;
|
|
186530
|
-
const next = elements.map((el) => {
|
|
186531
|
-
let updated = patch(el);
|
|
186532
|
-
if (updated.type === "group" && updated.children?.length) {
|
|
186533
|
-
const newChildren = walkAndPatchElements(updated.children, patch);
|
|
186534
|
-
if (newChildren !== updated.children) {
|
|
186535
|
-
updated = { ...updated, children: newChildren };
|
|
186536
|
-
}
|
|
186537
|
-
}
|
|
186538
|
-
if (updated !== el) {
|
|
186539
|
-
mutated = true;
|
|
186540
|
-
}
|
|
186541
|
-
return updated;
|
|
186542
|
-
});
|
|
186543
|
-
return mutated ? next : elements;
|
|
186544
|
-
}
|
|
186545
|
-
function applyImagePathPatches(elements, resolvedMap, refs) {
|
|
186546
|
-
const elementPatches = /* @__PURE__ */ new Map();
|
|
186547
|
-
for (const ref of refs) {
|
|
186548
|
-
const url = resolvedMap.get(ref.path);
|
|
186549
|
-
if (!url) {
|
|
186550
|
-
continue;
|
|
186551
|
-
}
|
|
186552
|
-
const existing = elementPatches.get(ref.element.id) ?? {};
|
|
186553
|
-
existing[ref.field] = url;
|
|
186554
|
-
elementPatches.set(ref.element.id, existing);
|
|
186555
|
-
}
|
|
186556
|
-
if (elementPatches.size === 0) {
|
|
186557
|
-
return elements;
|
|
186558
|
-
}
|
|
186559
|
-
return walkAndPatchElements(elements, (el) => {
|
|
186560
|
-
const patch = elementPatches.get(el.id);
|
|
186561
|
-
return patch ? { ...el, ...patch } : el;
|
|
186562
|
-
});
|
|
186563
|
-
}
|
|
186564
|
-
function isExternalUrl(path) {
|
|
186565
|
-
return path.startsWith("http://") || path.startsWith("https://") || path.startsWith("data:") || path.startsWith("blob:");
|
|
186566
|
-
}
|
|
186567
|
-
function collectMediaElements(elements, collector) {
|
|
186568
|
-
for (const element of elements) {
|
|
186569
|
-
if (element.type === "media") {
|
|
186570
|
-
collector.push(element);
|
|
186571
|
-
continue;
|
|
186572
|
-
}
|
|
186573
|
-
if (element.type === "group" && element.children?.length) {
|
|
186574
|
-
collectMediaElements(element.children, collector);
|
|
186575
|
-
}
|
|
186576
|
-
}
|
|
186577
|
-
}
|
|
186578
|
-
function collectImagePaths(slides) {
|
|
186579
|
-
const paths = /* @__PURE__ */ new Set();
|
|
186580
|
-
const refs = [];
|
|
186581
|
-
const walkElements = (elements) => {
|
|
186582
|
-
for (const el of elements) {
|
|
186583
|
-
if (el.type === "picture" || el.type === "image") {
|
|
186584
|
-
const pic = el;
|
|
186585
|
-
if (pic.imagePath && !pic.imageData && !isExternalUrl(pic.imagePath)) {
|
|
186586
|
-
paths.add(pic.imagePath);
|
|
186587
|
-
refs.push({ element: el, field: "imageData", path: pic.imagePath });
|
|
186588
|
-
}
|
|
186589
|
-
if (pic.svgPath && !pic.svgData && !isExternalUrl(pic.svgPath)) {
|
|
186590
|
-
paths.add(pic.svgPath);
|
|
186591
|
-
refs.push({ element: el, field: "svgData", path: pic.svgPath });
|
|
186592
|
-
}
|
|
186593
|
-
}
|
|
186594
|
-
if (el.type === "media") {
|
|
186595
|
-
const media = el;
|
|
186596
|
-
if (media.posterFramePath && !media.posterFrameData && !isExternalUrl(media.posterFramePath)) {
|
|
186597
|
-
paths.add(media.posterFramePath);
|
|
186598
|
-
refs.push({
|
|
186599
|
-
element: el,
|
|
186600
|
-
field: "posterFrameData",
|
|
186601
|
-
path: media.posterFramePath
|
|
186602
|
-
});
|
|
186603
|
-
}
|
|
186604
|
-
}
|
|
186605
|
-
if (el.type === "model3d") {
|
|
186606
|
-
const model = el;
|
|
186607
|
-
if (model.modelPath && !model.modelData && !isExternalUrl(model.modelPath)) {
|
|
186608
|
-
paths.add(model.modelPath);
|
|
186609
|
-
refs.push({ element: el, field: "modelData", path: model.modelPath });
|
|
186610
|
-
}
|
|
186611
|
-
const posterNeedsResolution = model.posterImage ? !isExternalUrl(model.posterImage) : !model.imageData;
|
|
186612
|
-
if (model.imagePath && posterNeedsResolution && !isExternalUrl(model.imagePath)) {
|
|
186613
|
-
paths.add(model.imagePath);
|
|
186614
|
-
refs.push({ element: el, field: "posterImage", path: model.imagePath });
|
|
186615
|
-
}
|
|
186616
|
-
}
|
|
186617
|
-
if (el.type === "group" && el.children?.length) {
|
|
186618
|
-
walkElements(el.children);
|
|
186619
|
-
}
|
|
186620
|
-
}
|
|
186621
|
-
};
|
|
186622
|
-
for (const slide of slides) {
|
|
186623
|
-
walkElements(slide.elements);
|
|
186624
|
-
}
|
|
186625
|
-
return { paths, refs };
|
|
186626
|
-
}
|
|
186627
|
-
function collectTableCellImagePaths(slides) {
|
|
186628
|
-
const paths = /* @__PURE__ */ new Set();
|
|
186629
|
-
const refs = [];
|
|
186630
|
-
const walkElements = (elements) => {
|
|
186631
|
-
for (const el of elements) {
|
|
186632
|
-
if (el.type === "table") {
|
|
186633
|
-
const rows = el.tableData?.rows ?? [];
|
|
186634
|
-
rows.forEach((row, rowIndex) => {
|
|
186635
|
-
row.cells.forEach((cell, cellIndex) => {
|
|
186636
|
-
const path = cell.style?.backgroundImageFillPath;
|
|
186637
|
-
if (path && !cell.style?.backgroundImageFillData && !isExternalUrl(path)) {
|
|
186638
|
-
paths.add(path);
|
|
186639
|
-
refs.push({ element: el, rowIndex, cellIndex, path });
|
|
186640
|
-
}
|
|
186641
|
-
});
|
|
186642
|
-
});
|
|
186643
|
-
}
|
|
186644
|
-
if (el.type === "group" && el.children?.length) {
|
|
186645
|
-
walkElements(el.children);
|
|
186646
|
-
}
|
|
186647
|
-
}
|
|
186648
|
-
};
|
|
186649
|
-
for (const slide of slides) {
|
|
186650
|
-
walkElements(slide.elements);
|
|
186651
|
-
}
|
|
186652
|
-
return { paths, refs };
|
|
186653
|
-
}
|
|
186654
|
-
function applyTableCellImagePatches(elements, resolvedMap, refs) {
|
|
186655
|
-
const patchesByElementId = /* @__PURE__ */ new Map();
|
|
186656
|
-
for (const ref of refs) {
|
|
186657
|
-
const url = resolvedMap.get(ref.path);
|
|
186658
|
-
if (!url) {
|
|
186659
|
-
continue;
|
|
186660
|
-
}
|
|
186661
|
-
const list2 = patchesByElementId.get(ref.element.id) ?? [];
|
|
186662
|
-
list2.push({ rowIndex: ref.rowIndex, cellIndex: ref.cellIndex, url });
|
|
186663
|
-
patchesByElementId.set(ref.element.id, list2);
|
|
186664
|
-
}
|
|
186665
|
-
if (patchesByElementId.size === 0) {
|
|
186666
|
-
return elements;
|
|
186667
|
-
}
|
|
186668
|
-
return walkAndPatchElements(elements, (el) => {
|
|
186669
|
-
const cellPatches = patchesByElementId.get(el.id);
|
|
186670
|
-
if (!cellPatches || el.type !== "table") {
|
|
186671
|
-
return el;
|
|
186672
|
-
}
|
|
186673
|
-
const table2 = el;
|
|
186674
|
-
const tableData = table2.tableData;
|
|
186675
|
-
if (!tableData) {
|
|
186676
|
-
return el;
|
|
186677
|
-
}
|
|
186678
|
-
const newRows = tableData.rows.map((row, rowIndex) => {
|
|
186679
|
-
const rowPatches = cellPatches.filter((p) => p.rowIndex === rowIndex);
|
|
186680
|
-
if (rowPatches.length === 0) {
|
|
186681
|
-
return row;
|
|
186682
|
-
}
|
|
186683
|
-
const newCells = row.cells.map((cell, cellIndex) => {
|
|
186684
|
-
const patch = rowPatches.find((p) => p.cellIndex === cellIndex);
|
|
186685
|
-
if (!patch || !cell.style) {
|
|
186686
|
-
return cell;
|
|
186687
|
-
}
|
|
186688
|
-
return {
|
|
186689
|
-
...cell,
|
|
186690
|
-
style: { ...cell.style, backgroundImageFillData: patch.url }
|
|
186691
|
-
};
|
|
186692
|
-
});
|
|
186693
|
-
return { ...row, cells: newCells };
|
|
186694
|
-
});
|
|
186695
|
-
return { ...table2, tableData: { ...tableData, rows: newRows } };
|
|
186696
|
-
});
|
|
186697
|
-
}
|
|
186698
|
-
function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
186699
|
-
const guides = [];
|
|
186700
|
-
if (presentationGuides) {
|
|
186701
|
-
for (const g2 of presentationGuides) {
|
|
186702
|
-
guides.push({
|
|
186703
|
-
id: g2.id,
|
|
186704
|
-
axis: g2.orientation === "horz" ? "h" : "v",
|
|
186705
|
-
position: guideEmuToPx(g2.positionEmu)
|
|
186706
|
-
});
|
|
186707
|
-
}
|
|
186708
|
-
}
|
|
186709
|
-
if (firstSlideGuides) {
|
|
186710
|
-
for (const g2 of firstSlideGuides) {
|
|
186711
|
-
guides.push({
|
|
186712
|
-
id: g2.id,
|
|
186713
|
-
axis: g2.orientation === "horz" ? "h" : "v",
|
|
186714
|
-
position: guideEmuToPx(g2.positionEmu)
|
|
186715
|
-
});
|
|
186716
|
-
}
|
|
186717
|
-
}
|
|
186718
|
-
return guides;
|
|
186719
|
-
}
|
|
186720
|
-
async function resolveMediaElementSource(mediaElement, handler) {
|
|
186721
|
-
const mediaPath = mediaElement.mediaPath;
|
|
186722
|
-
if (!mediaPath) {
|
|
186723
|
-
return { mediaPath: void 0, url: void 0, isBlobUrl: false, missing: true };
|
|
186724
|
-
}
|
|
186725
|
-
if (isExternalUrl(mediaPath)) {
|
|
186726
|
-
return { mediaPath, url: mediaPath, isBlobUrl: false, missing: false };
|
|
186727
|
-
}
|
|
186728
|
-
try {
|
|
186729
|
-
const isAudioVideo = mediaElement.mediaType === "audio" || mediaElement.mediaType === "video";
|
|
186730
|
-
if (isAudioVideo) {
|
|
186731
|
-
const arrayBuffer = await handler.getMediaArrayBuffer(mediaPath);
|
|
186732
|
-
if (!arrayBuffer) {
|
|
186733
|
-
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
186734
|
-
}
|
|
186735
|
-
const mimeType = mediaElement.mediaMimeType || "application/octet-stream";
|
|
186736
|
-
const blobUrl = URL.createObjectURL(new Blob([arrayBuffer], { type: mimeType }));
|
|
186737
|
-
return { mediaPath, url: blobUrl, isBlobUrl: true, missing: false };
|
|
186738
|
-
}
|
|
186739
|
-
const dataUrl = await handler.getImageData(mediaPath);
|
|
186740
|
-
if (!dataUrl) {
|
|
186741
|
-
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
186742
|
-
}
|
|
186743
|
-
return { mediaPath, url: dataUrl, isBlobUrl: false, missing: false };
|
|
186744
|
-
} catch {
|
|
186745
|
-
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
186746
|
-
}
|
|
186747
|
-
}
|
|
186748
|
-
var TABLE_STYLE_FILL_KEYS = [
|
|
186749
|
-
"wholeTblFill",
|
|
186750
|
-
"band1HFill",
|
|
186751
|
-
"band2HFill",
|
|
186752
|
-
"band1VFill",
|
|
186753
|
-
"band2VFill",
|
|
186754
|
-
"lastColFill",
|
|
186755
|
-
"firstColFill",
|
|
186756
|
-
"lastRowFill",
|
|
186757
|
-
"seCellFill",
|
|
186758
|
-
"swCellFill",
|
|
186759
|
-
"firstRowFill",
|
|
186760
|
-
"neCellFill",
|
|
186761
|
-
"nwCellFill"
|
|
186762
|
-
];
|
|
186763
|
-
function isExternalUrl2(path) {
|
|
186764
|
-
return path.startsWith("http://") || path.startsWith("https://") || path.startsWith("data:") || path.startsWith("blob:");
|
|
186765
|
-
}
|
|
186766
|
-
function collectTableStyleImagePaths(tableStyleMap) {
|
|
186767
|
-
const paths = /* @__PURE__ */ new Set();
|
|
186768
|
-
const refs = [];
|
|
186769
|
-
if (!tableStyleMap) {
|
|
186770
|
-
return { paths, refs };
|
|
186771
|
-
}
|
|
186772
|
-
for (const [styleId, entry5] of Object.entries(tableStyleMap)) {
|
|
186773
|
-
for (const fillKey of TABLE_STYLE_FILL_KEYS) {
|
|
186774
|
-
const fill = entry5[fillKey];
|
|
186775
|
-
const path = fill?.image?.path;
|
|
186776
|
-
if (path && !fill?.image?.data && !isExternalUrl2(path)) {
|
|
186777
|
-
paths.add(path);
|
|
186778
|
-
refs.push({ styleId, fillKey, path });
|
|
186779
|
-
}
|
|
186780
|
-
}
|
|
186781
|
-
}
|
|
186782
|
-
return { paths, refs };
|
|
186783
|
-
}
|
|
186784
|
-
function applyTableStyleImagePatches(tableStyleMap, resolvedMap, refs) {
|
|
186785
|
-
const patchesByStyleId = /* @__PURE__ */ new Map();
|
|
186786
|
-
for (const ref of refs) {
|
|
186787
|
-
const url = resolvedMap.get(ref.path);
|
|
186788
|
-
if (!url) {
|
|
186789
|
-
continue;
|
|
186790
|
-
}
|
|
186791
|
-
const list2 = patchesByStyleId.get(ref.styleId) ?? [];
|
|
186792
|
-
list2.push({ fillKey: ref.fillKey, url });
|
|
186793
|
-
patchesByStyleId.set(ref.styleId, list2);
|
|
186794
|
-
}
|
|
186795
|
-
if (patchesByStyleId.size === 0) {
|
|
186796
|
-
return tableStyleMap;
|
|
186797
|
-
}
|
|
186798
|
-
const next = { ...tableStyleMap };
|
|
186799
|
-
for (const [styleId, patches] of patchesByStyleId) {
|
|
186800
|
-
const entry5 = next[styleId];
|
|
186801
|
-
if (!entry5) {
|
|
186802
|
-
continue;
|
|
186803
|
-
}
|
|
186804
|
-
const patchedEntry = { ...entry5 };
|
|
186805
|
-
for (const { fillKey, url } of patches) {
|
|
186806
|
-
const fill = patchedEntry[fillKey];
|
|
186807
|
-
if (!fill?.image) {
|
|
186808
|
-
continue;
|
|
186809
|
-
}
|
|
186810
|
-
patchedEntry[fillKey] = { ...fill, image: { ...fill.image, data: url } };
|
|
186811
|
-
}
|
|
186812
|
-
next[styleId] = patchedEntry;
|
|
186813
|
-
}
|
|
186814
|
-
return next;
|
|
186815
|
-
}
|
|
186816
|
-
function collectTextFillBlipPaths(slides) {
|
|
186817
|
-
const paths = /* @__PURE__ */ new Set();
|
|
186818
|
-
const refs = [];
|
|
186819
|
-
const walkElements = (elements) => {
|
|
186820
|
-
for (const el of elements) {
|
|
186821
|
-
if (hasTextProperties(el) && el.textSegments) {
|
|
186822
|
-
el.textSegments.forEach((segment, segmentIndex) => {
|
|
186823
|
-
const path = segment.style?.textFillBlipUrl;
|
|
186824
|
-
if (path && !isExternalUrl(path)) {
|
|
186825
|
-
paths.add(path);
|
|
186826
|
-
refs.push({ element: el, segmentIndex, path });
|
|
186827
|
-
}
|
|
186828
|
-
});
|
|
186829
|
-
}
|
|
186830
|
-
if (el.type === "group" && el.children?.length) {
|
|
186831
|
-
walkElements(el.children);
|
|
186832
|
-
}
|
|
186833
|
-
}
|
|
186834
|
-
};
|
|
186835
|
-
for (const slide of slides) {
|
|
186836
|
-
walkElements(slide.elements);
|
|
186837
|
-
}
|
|
186838
|
-
return { paths, refs };
|
|
186839
|
-
}
|
|
186840
|
-
function applyTextFillBlipPatches(elements, resolvedMap, refs) {
|
|
186841
|
-
const patchesByElementId = /* @__PURE__ */ new Map();
|
|
186842
|
-
for (const ref of refs) {
|
|
186843
|
-
const url = resolvedMap.get(ref.path);
|
|
186844
|
-
if (!url) {
|
|
186845
|
-
continue;
|
|
186846
|
-
}
|
|
186847
|
-
const list2 = patchesByElementId.get(ref.element.id) ?? [];
|
|
186848
|
-
list2.push({ segmentIndex: ref.segmentIndex, url });
|
|
186849
|
-
patchesByElementId.set(ref.element.id, list2);
|
|
186850
|
-
}
|
|
186851
|
-
if (patchesByElementId.size === 0) {
|
|
186852
|
-
return elements;
|
|
186853
|
-
}
|
|
186854
|
-
return walkAndPatchElements(elements, (el) => {
|
|
186855
|
-
const segmentPatches = patchesByElementId.get(el.id);
|
|
186856
|
-
if (!segmentPatches || !hasTextProperties(el) || !el.textSegments) {
|
|
186857
|
-
return el;
|
|
186858
|
-
}
|
|
186859
|
-
const newSegments = el.textSegments.map((segment, segmentIndex) => {
|
|
186860
|
-
const patch = segmentPatches.find((p) => p.segmentIndex === segmentIndex);
|
|
186861
|
-
if (!patch || !segment.style) {
|
|
186862
|
-
return segment;
|
|
186863
|
-
}
|
|
186864
|
-
return { ...segment, style: { ...segment.style, textFillBlipUrl: patch.url } };
|
|
186865
|
-
});
|
|
186866
|
-
return { ...el, textSegments: newSegments };
|
|
186867
|
-
});
|
|
186868
|
-
}
|
|
186869
|
-
async function resolveTableCellImageUrls(slides, getImageData) {
|
|
186870
|
-
const { paths, refs } = collectTableCellImagePaths(slides);
|
|
186871
|
-
if (paths.size === 0) {
|
|
186872
|
-
return slides;
|
|
186873
|
-
}
|
|
186874
|
-
const resolvedMap = /* @__PURE__ */ new Map();
|
|
186875
|
-
await Promise.all(
|
|
186876
|
-
Array.from(paths).map(async (path) => {
|
|
186877
|
-
try {
|
|
186878
|
-
const url = await getImageData(path);
|
|
186879
|
-
if (url) {
|
|
186880
|
-
resolvedMap.set(path, url);
|
|
186881
|
-
}
|
|
186882
|
-
} catch {
|
|
186883
|
-
}
|
|
186884
|
-
})
|
|
186885
|
-
);
|
|
186886
|
-
if (resolvedMap.size === 0) {
|
|
186887
|
-
return slides;
|
|
186888
|
-
}
|
|
186889
|
-
return slides.map((slide) => {
|
|
186890
|
-
const newElements = applyTableCellImagePatches(slide.elements, resolvedMap, refs);
|
|
186891
|
-
return newElements === slide.elements ? slide : { ...slide, elements: newElements };
|
|
186892
|
-
});
|
|
186893
|
-
}
|
|
186894
|
-
async function resolveTableStyleImageUrls(tableStyleMap, getImageData) {
|
|
186895
|
-
const { paths, refs } = collectTableStyleImagePaths(tableStyleMap);
|
|
186896
|
-
if (paths.size === 0 || !tableStyleMap) {
|
|
186897
|
-
return tableStyleMap;
|
|
186898
|
-
}
|
|
186899
|
-
const resolvedMap = /* @__PURE__ */ new Map();
|
|
186900
|
-
await Promise.all(
|
|
186901
|
-
Array.from(paths).map(async (path) => {
|
|
186902
|
-
try {
|
|
186903
|
-
const url = await getImageData(path);
|
|
186904
|
-
if (url) {
|
|
186905
|
-
resolvedMap.set(path, url);
|
|
186906
|
-
}
|
|
186907
|
-
} catch {
|
|
186908
|
-
}
|
|
186909
|
-
})
|
|
186910
|
-
);
|
|
186911
|
-
if (resolvedMap.size === 0) {
|
|
186912
|
-
return tableStyleMap;
|
|
186913
|
-
}
|
|
186914
|
-
return applyTableStyleImagePatches(tableStyleMap, resolvedMap, refs);
|
|
186915
|
-
}
|
|
186916
|
-
async function resolveTextFillBlipUrls(slides, getImageData) {
|
|
186917
|
-
const { paths, refs } = collectTextFillBlipPaths(slides);
|
|
186918
|
-
if (paths.size === 0) {
|
|
186919
|
-
return slides;
|
|
186920
|
-
}
|
|
186921
|
-
const resolvedMap = /* @__PURE__ */ new Map();
|
|
186922
|
-
await Promise.all(
|
|
186923
|
-
Array.from(paths).map(async (path) => {
|
|
186924
|
-
try {
|
|
186925
|
-
const url = await getImageData(path);
|
|
186926
|
-
if (url) {
|
|
186927
|
-
resolvedMap.set(path, url);
|
|
186928
|
-
}
|
|
186929
|
-
} catch {
|
|
186930
|
-
}
|
|
186931
|
-
})
|
|
186932
|
-
);
|
|
186933
|
-
if (resolvedMap.size === 0) {
|
|
186934
|
-
return slides;
|
|
186935
|
-
}
|
|
186936
|
-
return slides.map((slide) => {
|
|
186937
|
-
const newElements = applyTextFillBlipPatches(slide.elements, resolvedMap, refs);
|
|
186938
|
-
return newElements === slide.elements ? slide : { ...slide, elements: newElements };
|
|
186939
|
-
});
|
|
186940
|
-
}
|
|
186941
|
-
init_constants2();
|
|
186942
186484
|
function resolveLiveCustomGeometryPath(element) {
|
|
186943
186485
|
const el = element;
|
|
186944
186486
|
if (!el.pathData || !el.pathWidth || !el.pathHeight) {
|
|
@@ -196841,7 +196383,7 @@ function resolveAutoAdvanceDelayMs(slide, options) {
|
|
|
196841
196383
|
}
|
|
196842
196384
|
return advanceAfterMs;
|
|
196843
196385
|
}
|
|
196844
|
-
var PRESENTATION_INERT_CLICK_SELECTOR = 'a, button, input, select, textarea, video, audio, [data-pptx-action], [role="dialog"]';
|
|
196386
|
+
var PRESENTATION_INERT_CLICK_SELECTOR = 'a, button, input, select, textarea, video, audio, [data-pptx-action], [data-pptx-anim-trigger], [role="dialog"]';
|
|
196845
196387
|
function isInertMedia(node) {
|
|
196846
196388
|
return (node.tagName === "VIDEO" || node.tagName === "AUDIO") && !node.controls;
|
|
196847
196389
|
}
|
|
@@ -200005,6 +199547,269 @@ function collectDiagramBuildInfo(timeline) {
|
|
|
200005
199547
|
}
|
|
200006
199548
|
return info;
|
|
200007
199549
|
}
|
|
199550
|
+
var CLICK_EVENTS = /* @__PURE__ */ new Set(["onClick", "onNext"]);
|
|
199551
|
+
var TIMENODE_EVENTS = /* @__PURE__ */ new Set([
|
|
199552
|
+
"onBegin",
|
|
199553
|
+
"onEnd",
|
|
199554
|
+
"begin",
|
|
199555
|
+
"end",
|
|
199556
|
+
"onStopAudio"
|
|
199557
|
+
]);
|
|
199558
|
+
function normalizeDelay(delay) {
|
|
199559
|
+
if (delay === void 0) {
|
|
199560
|
+
return { ms: 0, indefinite: false };
|
|
199561
|
+
}
|
|
199562
|
+
if (delay < 0) {
|
|
199563
|
+
return { ms: 0, indefinite: true };
|
|
199564
|
+
}
|
|
199565
|
+
return { ms: delay, indefinite: false };
|
|
199566
|
+
}
|
|
199567
|
+
function resolveEffectiveEndCondition(conditions) {
|
|
199568
|
+
if (!conditions || conditions.length === 0) {
|
|
199569
|
+
return void 0;
|
|
199570
|
+
}
|
|
199571
|
+
const result = {
|
|
199572
|
+
endsOnMouseOut: false,
|
|
199573
|
+
endsOnClick: false,
|
|
199574
|
+
indefinite: false
|
|
199575
|
+
};
|
|
199576
|
+
for (const cond of conditions) {
|
|
199577
|
+
const evt = cond.event;
|
|
199578
|
+
if (evt === "onMouseOut") {
|
|
199579
|
+
result.endsOnMouseOut = true;
|
|
199580
|
+
} else if (evt && CLICK_EVENTS.has(evt)) {
|
|
199581
|
+
result.endsOnClick = true;
|
|
199582
|
+
if (cond.targetShapeId) {
|
|
199583
|
+
result.clickTargetShapeId = cond.targetShapeId;
|
|
199584
|
+
}
|
|
199585
|
+
} else if (evt && TIMENODE_EVENTS.has(evt) && cond.targetTimeNodeId !== void 0) {
|
|
199586
|
+
result.endsWithTimeNodeId = cond.targetTimeNodeId;
|
|
199587
|
+
}
|
|
199588
|
+
const { ms, indefinite } = normalizeDelay(cond.delay);
|
|
199589
|
+
if (indefinite) {
|
|
199590
|
+
result.indefinite = true;
|
|
199591
|
+
} else if (ms > 0 && result.delayMs === void 0) {
|
|
199592
|
+
result.delayMs = ms;
|
|
199593
|
+
}
|
|
199594
|
+
}
|
|
199595
|
+
return result;
|
|
199596
|
+
}
|
|
199597
|
+
function resolveAnimationEnd(anim) {
|
|
199598
|
+
return resolveEffectiveEndCondition(anim.endConditions);
|
|
199599
|
+
}
|
|
199600
|
+
var HOVER_EVENTS = /* @__PURE__ */ new Set(["onMouseOver"]);
|
|
199601
|
+
function isInteractiveTrigger(trigger) {
|
|
199602
|
+
return trigger === "onClick" || trigger === "onShapeClick" || trigger === "onHover";
|
|
199603
|
+
}
|
|
199604
|
+
function classifyCondition(cond) {
|
|
199605
|
+
const evt = cond.event;
|
|
199606
|
+
if (evt && CLICK_EVENTS.has(evt)) {
|
|
199607
|
+
return "click";
|
|
199608
|
+
}
|
|
199609
|
+
if (evt && HOVER_EVENTS.has(evt)) {
|
|
199610
|
+
return "hover";
|
|
199611
|
+
}
|
|
199612
|
+
if (evt === "onMediaBookmark" && cond.bookmarkTarget) {
|
|
199613
|
+
return "bookmark";
|
|
199614
|
+
}
|
|
199615
|
+
if (evt && TIMENODE_EVENTS.has(evt)) {
|
|
199616
|
+
if (cond.targetTimeNodeId !== void 0) {
|
|
199617
|
+
return "timenode";
|
|
199618
|
+
}
|
|
199619
|
+
if (evt === "onStopAudio" && cond.targetShapeId !== void 0) {
|
|
199620
|
+
return "timenode";
|
|
199621
|
+
}
|
|
199622
|
+
}
|
|
199623
|
+
return "delay";
|
|
199624
|
+
}
|
|
199625
|
+
function resolveEffectiveStartCondition(conditions, fallbackTrigger) {
|
|
199626
|
+
const base = {
|
|
199627
|
+
trigger: fallbackTrigger,
|
|
199628
|
+
delayMs: 0,
|
|
199629
|
+
hasClickAlternative: false,
|
|
199630
|
+
hasHoverAlternative: false,
|
|
199631
|
+
indefinite: false,
|
|
199632
|
+
requiresInteraction: isInteractiveTrigger(fallbackTrigger)
|
|
199633
|
+
};
|
|
199634
|
+
if (!conditions || conditions.length === 0) {
|
|
199635
|
+
return base;
|
|
199636
|
+
}
|
|
199637
|
+
let timenode;
|
|
199638
|
+
let bookmarkCond;
|
|
199639
|
+
let delayCond;
|
|
199640
|
+
let clickCond;
|
|
199641
|
+
let hoverCond;
|
|
199642
|
+
for (const cond of conditions) {
|
|
199643
|
+
switch (classifyCondition(cond)) {
|
|
199644
|
+
case "timenode":
|
|
199645
|
+
if (!timenode) {
|
|
199646
|
+
timenode = cond;
|
|
199647
|
+
} else if (cond.targetTimeNodeId !== void 0) {
|
|
199648
|
+
if (timenode.targetTimeNodeId === void 0 || cond.targetTimeNodeId < timenode.targetTimeNodeId) {
|
|
199649
|
+
timenode = cond;
|
|
199650
|
+
}
|
|
199651
|
+
}
|
|
199652
|
+
break;
|
|
199653
|
+
case "bookmark":
|
|
199654
|
+
if (!bookmarkCond) {
|
|
199655
|
+
bookmarkCond = cond;
|
|
199656
|
+
}
|
|
199657
|
+
break;
|
|
199658
|
+
case "delay":
|
|
199659
|
+
if (!delayCond || (cond.delay ?? 0) < (delayCond.delay ?? 0)) {
|
|
199660
|
+
delayCond = cond;
|
|
199661
|
+
}
|
|
199662
|
+
break;
|
|
199663
|
+
case "click":
|
|
199664
|
+
if (!clickCond) {
|
|
199665
|
+
clickCond = cond;
|
|
199666
|
+
}
|
|
199667
|
+
break;
|
|
199668
|
+
case "hover":
|
|
199669
|
+
if (!hoverCond) {
|
|
199670
|
+
hoverCond = cond;
|
|
199671
|
+
}
|
|
199672
|
+
break;
|
|
199673
|
+
}
|
|
199674
|
+
}
|
|
199675
|
+
base.hasClickAlternative = clickCond !== void 0;
|
|
199676
|
+
base.hasHoverAlternative = hoverCond !== void 0;
|
|
199677
|
+
if (clickCond?.targetShapeId) {
|
|
199678
|
+
base.clickTargetShapeId = clickCond.targetShapeId;
|
|
199679
|
+
}
|
|
199680
|
+
if (timenode) {
|
|
199681
|
+
const { ms, indefinite } = normalizeDelay(timenode.delay);
|
|
199682
|
+
base.trigger = timenode.event === "onBegin" || timenode.event === "begin" ? "withPrevious" : "afterPrevious";
|
|
199683
|
+
base.delayMs = ms;
|
|
199684
|
+
base.indefinite = indefinite;
|
|
199685
|
+
base.dependsOnTimeNodeId = timenode.targetTimeNodeId;
|
|
199686
|
+
base.dependsOnShapeId = timenode.targetTimeNodeId === void 0 ? timenode.targetShapeId : void 0;
|
|
199687
|
+
base.dependsOnEvent = timenode.event;
|
|
199688
|
+
base.requiresInteraction = false;
|
|
199689
|
+
return base;
|
|
199690
|
+
}
|
|
199691
|
+
if (bookmarkCond?.bookmarkTarget) {
|
|
199692
|
+
base.trigger = "afterPrevious";
|
|
199693
|
+
base.delayMs = 0;
|
|
199694
|
+
base.dependsOnShapeId = bookmarkCond.bookmarkTarget.shapeId;
|
|
199695
|
+
base.dependsOnEvent = "onMediaBookmark";
|
|
199696
|
+
base.dependsOnBookmarkName = bookmarkCond.bookmarkTarget.bookmarkName;
|
|
199697
|
+
base.requiresInteraction = false;
|
|
199698
|
+
return base;
|
|
199699
|
+
}
|
|
199700
|
+
if (delayCond && (delayCond.delay ?? 0) !== 0) {
|
|
199701
|
+
const { ms, indefinite } = normalizeDelay(delayCond.delay);
|
|
199702
|
+
base.trigger = clickCond ? "onClick" : "afterDelay";
|
|
199703
|
+
base.delayMs = ms;
|
|
199704
|
+
base.indefinite = indefinite;
|
|
199705
|
+
base.requiresInteraction = indefinite;
|
|
199706
|
+
return base;
|
|
199707
|
+
}
|
|
199708
|
+
if (clickCond) {
|
|
199709
|
+
base.trigger = clickCond.targetShapeId ? "onShapeClick" : "onClick";
|
|
199710
|
+
base.requiresInteraction = true;
|
|
199711
|
+
return base;
|
|
199712
|
+
}
|
|
199713
|
+
if (hoverCond) {
|
|
199714
|
+
base.trigger = "onHover";
|
|
199715
|
+
base.requiresInteraction = true;
|
|
199716
|
+
return base;
|
|
199717
|
+
}
|
|
199718
|
+
if (delayCond) {
|
|
199719
|
+
base.trigger = fallbackTrigger;
|
|
199720
|
+
base.delayMs = 0;
|
|
199721
|
+
base.requiresInteraction = false;
|
|
199722
|
+
}
|
|
199723
|
+
return base;
|
|
199724
|
+
}
|
|
199725
|
+
function resolveAnimationStart(anim) {
|
|
199726
|
+
return resolveEffectiveStartCondition(anim.startConditions, anim.trigger ?? "onClick");
|
|
199727
|
+
}
|
|
199728
|
+
var BEZIER_SAMPLES = 8;
|
|
199729
|
+
function cubicAt(p0, c1, c2, p3, t) {
|
|
199730
|
+
const mt = 1 - t;
|
|
199731
|
+
return mt * mt * mt * p0 + 3 * mt * mt * t * c1 + 3 * mt * t * t * c2 + t * t * t * p3;
|
|
199732
|
+
}
|
|
199733
|
+
function allFinite(values) {
|
|
199734
|
+
return values.every((v) => Number.isFinite(v));
|
|
199735
|
+
}
|
|
199736
|
+
function parseMotionPathPoints(motionPath) {
|
|
199737
|
+
const tokens = motionPath.match(/[MLCZmlcz]|-?\d*\.?\d+(?:[eE][-+]?\d+)?/gu);
|
|
199738
|
+
if (!tokens) {
|
|
199739
|
+
return [];
|
|
199740
|
+
}
|
|
199741
|
+
const points4 = [];
|
|
199742
|
+
let curX = 0;
|
|
199743
|
+
let curY = 0;
|
|
199744
|
+
let startX = 0;
|
|
199745
|
+
let startY = 0;
|
|
199746
|
+
let i2 = 0;
|
|
199747
|
+
let cmd = "";
|
|
199748
|
+
const nextNum = () => Number(tokens[i2++]);
|
|
199749
|
+
const push2 = (x, y) => {
|
|
199750
|
+
points4.push({ x: x * 100, y: y * 100 });
|
|
199751
|
+
};
|
|
199752
|
+
while (i2 < tokens.length) {
|
|
199753
|
+
const tok = tokens[i2];
|
|
199754
|
+
if (/^[MLCZmlcz]$/u.test(tok)) {
|
|
199755
|
+
cmd = tok;
|
|
199756
|
+
i2++;
|
|
199757
|
+
if (cmd === "Z" || cmd === "z") {
|
|
199758
|
+
curX = startX;
|
|
199759
|
+
curY = startY;
|
|
199760
|
+
}
|
|
199761
|
+
continue;
|
|
199762
|
+
}
|
|
199763
|
+
const rel = cmd === cmd.toLowerCase();
|
|
199764
|
+
const upper = cmd.toUpperCase();
|
|
199765
|
+
if (upper === "M" || upper === "L") {
|
|
199766
|
+
let x = nextNum();
|
|
199767
|
+
let y = nextNum();
|
|
199768
|
+
if (!allFinite([x, y])) {
|
|
199769
|
+
break;
|
|
199770
|
+
}
|
|
199771
|
+
if (rel) {
|
|
199772
|
+
x += curX;
|
|
199773
|
+
y += curY;
|
|
199774
|
+
}
|
|
199775
|
+
curX = x;
|
|
199776
|
+
curY = y;
|
|
199777
|
+
if (upper === "M") {
|
|
199778
|
+
startX = x;
|
|
199779
|
+
startY = y;
|
|
199780
|
+
cmd = rel ? "l" : "L";
|
|
199781
|
+
}
|
|
199782
|
+
push2(x, y);
|
|
199783
|
+
} else if (upper === "C") {
|
|
199784
|
+
let c1x = nextNum();
|
|
199785
|
+
let c1y = nextNum();
|
|
199786
|
+
let c2x = nextNum();
|
|
199787
|
+
let c2y = nextNum();
|
|
199788
|
+
let ex = nextNum();
|
|
199789
|
+
let ey = nextNum();
|
|
199790
|
+
if (!allFinite([c1x, c1y, c2x, c2y, ex, ey])) {
|
|
199791
|
+
break;
|
|
199792
|
+
}
|
|
199793
|
+
if (rel) {
|
|
199794
|
+
c1x += curX;
|
|
199795
|
+
c1y += curY;
|
|
199796
|
+
c2x += curX;
|
|
199797
|
+
c2y += curY;
|
|
199798
|
+
ex += curX;
|
|
199799
|
+
ey += curY;
|
|
199800
|
+
}
|
|
199801
|
+
for (let s = 1; s <= BEZIER_SAMPLES; s++) {
|
|
199802
|
+
const t = s / BEZIER_SAMPLES;
|
|
199803
|
+
push2(cubicAt(curX, c1x, c2x, ex, t), cubicAt(curY, c1y, c2y, ey, t));
|
|
199804
|
+
}
|
|
199805
|
+
curX = ex;
|
|
199806
|
+
curY = ey;
|
|
199807
|
+
} else {
|
|
199808
|
+
i2++;
|
|
199809
|
+
}
|
|
199810
|
+
}
|
|
199811
|
+
return points4;
|
|
199812
|
+
}
|
|
200008
199813
|
var BACKGROUND_ANIMATION_ID_SUFFIX = "::pptx-bg";
|
|
200009
199814
|
function resolveAnimationTargetId(animation) {
|
|
200010
199815
|
const targetId = (animation.target?.type === "shape" ? animation.target.subShapeId : void 0) ?? animation.targetId ?? "";
|
|
@@ -200013,6 +199818,42 @@ function resolveAnimationTargetId(animation) {
|
|
|
200013
199818
|
}
|
|
200014
199819
|
return targetId;
|
|
200015
199820
|
}
|
|
199821
|
+
var DEFAULT_SLIDE_ASPECT = 16 / 9;
|
|
199822
|
+
function pacedFractions(points4, aspect = DEFAULT_SLIDE_ASPECT) {
|
|
199823
|
+
const lengths = [0];
|
|
199824
|
+
let total = 0;
|
|
199825
|
+
for (let i2 = 1; i2 < points4.length; i2++) {
|
|
199826
|
+
const dx = (points4[i2].x - points4[i2 - 1].x) * aspect;
|
|
199827
|
+
const dy = points4[i2].y - points4[i2 - 1].y;
|
|
199828
|
+
total += Math.hypot(dx, dy);
|
|
199829
|
+
lengths.push(total);
|
|
199830
|
+
}
|
|
199831
|
+
if (total <= 0) {
|
|
199832
|
+
return points4.map((_, i2) => points4.length > 1 ? i2 / (points4.length - 1) : 0);
|
|
199833
|
+
}
|
|
199834
|
+
return lengths.map((length) => length / total);
|
|
199835
|
+
}
|
|
199836
|
+
function pacedPointAt(points4, fractions, progress) {
|
|
199837
|
+
if (points4.length === 0) {
|
|
199838
|
+
return { x: 0, y: 0 };
|
|
199839
|
+
}
|
|
199840
|
+
if (points4.length === 1 || progress <= 0) {
|
|
199841
|
+
return points4[0];
|
|
199842
|
+
}
|
|
199843
|
+
if (progress >= 1) {
|
|
199844
|
+
return points4[points4.length - 1];
|
|
199845
|
+
}
|
|
199846
|
+
let i2 = 1;
|
|
199847
|
+
while (i2 < points4.length - 1 && fractions[i2] < progress) {
|
|
199848
|
+
i2++;
|
|
199849
|
+
}
|
|
199850
|
+
const span = fractions[i2] - fractions[i2 - 1];
|
|
199851
|
+
const ratio2 = span > 0 ? (progress - fractions[i2 - 1]) / span : 1;
|
|
199852
|
+
return {
|
|
199853
|
+
x: points4[i2 - 1].x + (points4[i2].x - points4[i2 - 1].x) * ratio2,
|
|
199854
|
+
y: points4[i2 - 1].y + (points4[i2].y - points4[i2 - 1].y) * ratio2
|
|
199855
|
+
};
|
|
199856
|
+
}
|
|
200016
199857
|
var IDENT_RE = /^[#a-zA-Z_$][a-zA-Z0-9_]*/u;
|
|
200017
199858
|
var NUMBER_RE = /^\d+(\.\d+)?|^\.\d+/u;
|
|
200018
199859
|
function tokenize2(formula) {
|
|
@@ -200547,127 +200388,6 @@ function createAttributeTransformModel(anim, box) {
|
|
|
200547
200388
|
}
|
|
200548
200389
|
};
|
|
200549
200390
|
}
|
|
200550
|
-
var BEZIER_SAMPLES = 8;
|
|
200551
|
-
function cubicAt(p0, c1, c2, p3, t) {
|
|
200552
|
-
const mt = 1 - t;
|
|
200553
|
-
return mt * mt * mt * p0 + 3 * mt * mt * t * c1 + 3 * mt * t * t * c2 + t * t * t * p3;
|
|
200554
|
-
}
|
|
200555
|
-
function allFinite(values) {
|
|
200556
|
-
return values.every((v) => Number.isFinite(v));
|
|
200557
|
-
}
|
|
200558
|
-
function parseMotionPathPoints(motionPath) {
|
|
200559
|
-
const tokens = motionPath.match(/[MLCZmlcz]|-?\d*\.?\d+(?:[eE][-+]?\d+)?/gu);
|
|
200560
|
-
if (!tokens) {
|
|
200561
|
-
return [];
|
|
200562
|
-
}
|
|
200563
|
-
const points4 = [];
|
|
200564
|
-
let curX = 0;
|
|
200565
|
-
let curY = 0;
|
|
200566
|
-
let startX = 0;
|
|
200567
|
-
let startY = 0;
|
|
200568
|
-
let i2 = 0;
|
|
200569
|
-
let cmd = "";
|
|
200570
|
-
const nextNum = () => Number(tokens[i2++]);
|
|
200571
|
-
const push2 = (x, y) => {
|
|
200572
|
-
points4.push({ x: x * 100, y: y * 100 });
|
|
200573
|
-
};
|
|
200574
|
-
while (i2 < tokens.length) {
|
|
200575
|
-
const tok = tokens[i2];
|
|
200576
|
-
if (/^[MLCZmlcz]$/u.test(tok)) {
|
|
200577
|
-
cmd = tok;
|
|
200578
|
-
i2++;
|
|
200579
|
-
if (cmd === "Z" || cmd === "z") {
|
|
200580
|
-
curX = startX;
|
|
200581
|
-
curY = startY;
|
|
200582
|
-
}
|
|
200583
|
-
continue;
|
|
200584
|
-
}
|
|
200585
|
-
const rel = cmd === cmd.toLowerCase();
|
|
200586
|
-
const upper = cmd.toUpperCase();
|
|
200587
|
-
if (upper === "M" || upper === "L") {
|
|
200588
|
-
let x = nextNum();
|
|
200589
|
-
let y = nextNum();
|
|
200590
|
-
if (!allFinite([x, y])) {
|
|
200591
|
-
break;
|
|
200592
|
-
}
|
|
200593
|
-
if (rel) {
|
|
200594
|
-
x += curX;
|
|
200595
|
-
y += curY;
|
|
200596
|
-
}
|
|
200597
|
-
curX = x;
|
|
200598
|
-
curY = y;
|
|
200599
|
-
if (upper === "M") {
|
|
200600
|
-
startX = x;
|
|
200601
|
-
startY = y;
|
|
200602
|
-
cmd = rel ? "l" : "L";
|
|
200603
|
-
}
|
|
200604
|
-
push2(x, y);
|
|
200605
|
-
} else if (upper === "C") {
|
|
200606
|
-
let c1x = nextNum();
|
|
200607
|
-
let c1y = nextNum();
|
|
200608
|
-
let c2x = nextNum();
|
|
200609
|
-
let c2y = nextNum();
|
|
200610
|
-
let ex = nextNum();
|
|
200611
|
-
let ey = nextNum();
|
|
200612
|
-
if (!allFinite([c1x, c1y, c2x, c2y, ex, ey])) {
|
|
200613
|
-
break;
|
|
200614
|
-
}
|
|
200615
|
-
if (rel) {
|
|
200616
|
-
c1x += curX;
|
|
200617
|
-
c1y += curY;
|
|
200618
|
-
c2x += curX;
|
|
200619
|
-
c2y += curY;
|
|
200620
|
-
ex += curX;
|
|
200621
|
-
ey += curY;
|
|
200622
|
-
}
|
|
200623
|
-
for (let s = 1; s <= BEZIER_SAMPLES; s++) {
|
|
200624
|
-
const t = s / BEZIER_SAMPLES;
|
|
200625
|
-
push2(cubicAt(curX, c1x, c2x, ex, t), cubicAt(curY, c1y, c2y, ey, t));
|
|
200626
|
-
}
|
|
200627
|
-
curX = ex;
|
|
200628
|
-
curY = ey;
|
|
200629
|
-
} else {
|
|
200630
|
-
i2++;
|
|
200631
|
-
}
|
|
200632
|
-
}
|
|
200633
|
-
return points4;
|
|
200634
|
-
}
|
|
200635
|
-
var DEFAULT_SLIDE_ASPECT = 16 / 9;
|
|
200636
|
-
function pacedFractions(points4, aspect = DEFAULT_SLIDE_ASPECT) {
|
|
200637
|
-
const lengths = [0];
|
|
200638
|
-
let total = 0;
|
|
200639
|
-
for (let i2 = 1; i2 < points4.length; i2++) {
|
|
200640
|
-
const dx = (points4[i2].x - points4[i2 - 1].x) * aspect;
|
|
200641
|
-
const dy = points4[i2].y - points4[i2 - 1].y;
|
|
200642
|
-
total += Math.hypot(dx, dy);
|
|
200643
|
-
lengths.push(total);
|
|
200644
|
-
}
|
|
200645
|
-
if (total <= 0) {
|
|
200646
|
-
return points4.map((_, i2) => points4.length > 1 ? i2 / (points4.length - 1) : 0);
|
|
200647
|
-
}
|
|
200648
|
-
return lengths.map((length) => length / total);
|
|
200649
|
-
}
|
|
200650
|
-
function pacedPointAt(points4, fractions, progress) {
|
|
200651
|
-
if (points4.length === 0) {
|
|
200652
|
-
return { x: 0, y: 0 };
|
|
200653
|
-
}
|
|
200654
|
-
if (points4.length === 1 || progress <= 0) {
|
|
200655
|
-
return points4[0];
|
|
200656
|
-
}
|
|
200657
|
-
if (progress >= 1) {
|
|
200658
|
-
return points4[points4.length - 1];
|
|
200659
|
-
}
|
|
200660
|
-
let i2 = 1;
|
|
200661
|
-
while (i2 < points4.length - 1 && fractions[i2] < progress) {
|
|
200662
|
-
i2++;
|
|
200663
|
-
}
|
|
200664
|
-
const span = fractions[i2] - fractions[i2 - 1];
|
|
200665
|
-
const ratio2 = span > 0 ? (progress - fractions[i2 - 1]) / span : 1;
|
|
200666
|
-
return {
|
|
200667
|
-
x: points4[i2 - 1].x + (points4[i2].x - points4[i2 - 1].x) * ratio2,
|
|
200668
|
-
y: points4[i2 - 1].y + (points4[i2].y - points4[i2 - 1].y) * ratio2
|
|
200669
|
-
};
|
|
200670
|
-
}
|
|
200671
200391
|
function slideOffset(percent4, axis, origin) {
|
|
200672
200392
|
const fallback = axis === "w" ? "1280px" : "720px";
|
|
200673
200393
|
const varName = origin === "parent" ? `--pptx-parent-${axis}` : `--pptx-slide-${axis}`;
|
|
@@ -200814,6 +200534,217 @@ function buildTransformKeyframes(anim, uid, prefixes, box) {
|
|
|
200814
200534
|
${lines.join("\n")}
|
|
200815
200535
|
}` };
|
|
200816
200536
|
}
|
|
200537
|
+
function buildChainedMotionKeyframes(anim, uid, prefixes, box) {
|
|
200538
|
+
const chain2 = anim.motionChain;
|
|
200539
|
+
if (!chain2 || chain2.length < 2) {
|
|
200540
|
+
return void 0;
|
|
200541
|
+
}
|
|
200542
|
+
const totalMs = anim.durationMs ?? chain2.reduce((sum, segment) => sum + segment.durationMs, 0);
|
|
200543
|
+
if (totalMs <= 0) {
|
|
200544
|
+
return void 0;
|
|
200545
|
+
}
|
|
200546
|
+
const keyframes = [];
|
|
200547
|
+
for (const segment of chain2) {
|
|
200548
|
+
const fractions = pacedFractions(segment.points, box?.slideAspect);
|
|
200549
|
+
const segStartPct = segment.startMs / totalMs * 100;
|
|
200550
|
+
const segSpanPct = segment.durationMs / totalMs * 100;
|
|
200551
|
+
for (let j = 0; j < segment.points.length; j++) {
|
|
200552
|
+
const fraction = fractions[j];
|
|
200553
|
+
const point2 = pacedPointAt(segment.points, fractions, fraction);
|
|
200554
|
+
const progress = Number((segStartPct + fraction * segSpanPct).toFixed(4));
|
|
200555
|
+
const transform6 = `transform: translate(${slideOffset(point2.x, "w", anim.motionOrigin)}, ${slideOffset(point2.y, "h", anim.motionOrigin)})`;
|
|
200556
|
+
const easing = j === 0 ? segment.easing : void 0;
|
|
200557
|
+
const previous = keyframes[keyframes.length - 1];
|
|
200558
|
+
if (previous && previous.progress === progress) {
|
|
200559
|
+
previous.transform = transform6;
|
|
200560
|
+
previous.easing = easing ?? previous.easing;
|
|
200561
|
+
continue;
|
|
200562
|
+
}
|
|
200563
|
+
keyframes.push({ progress, transform: transform6, easing });
|
|
200564
|
+
}
|
|
200565
|
+
}
|
|
200566
|
+
const hideUntilStart = anim.motionChainHideUntilStart === true;
|
|
200567
|
+
if (hideUntilStart && keyframes.length > 0) {
|
|
200568
|
+
keyframes.splice(1, 0, { ...keyframes[0], progress: 0.01 });
|
|
200569
|
+
}
|
|
200570
|
+
const lines = keyframes.map((keyframe, index) => {
|
|
200571
|
+
const easing = keyframe.easing ? `animation-timing-function: ${keyframe.easing}; ` : "";
|
|
200572
|
+
const opacity2 = hideUntilStart && index === 0 ? "opacity: 0; " : hideUntilStart && index === 1 ? "opacity: 1; " : "";
|
|
200573
|
+
return ` ${formatNumber(keyframe.progress, 2)}% { ${easing}${opacity2}${keyframe.transform}; }`;
|
|
200574
|
+
});
|
|
200575
|
+
const name = `${prefixes.transform}-${uid}${hideUntilStart ? "-visibility" : ""}`;
|
|
200576
|
+
return {
|
|
200577
|
+
keyframeName: name,
|
|
200578
|
+
css: `@keyframes ${name} {
|
|
200579
|
+
${lines.join("\n")}
|
|
200580
|
+
}`
|
|
200581
|
+
};
|
|
200582
|
+
}
|
|
200583
|
+
function isChainedMotionAnimation(anim) {
|
|
200584
|
+
return anim.motionChain !== void 0;
|
|
200585
|
+
}
|
|
200586
|
+
function isChainedMotionSwallowed(anim) {
|
|
200587
|
+
return anim.motionChainSwallowed === true;
|
|
200588
|
+
}
|
|
200589
|
+
function hasChainBlockingExtras(anim) {
|
|
200590
|
+
return Boolean(
|
|
200591
|
+
anim.rotationBy !== void 0 || anim.rotationFrom !== void 0 || anim.rotationTo !== void 0 || anim.scaleByX !== void 0 || anim.scaleByY !== void 0 || anim.scaleFromX !== void 0 || anim.scaleFromY !== void 0 || anim.scaleToX !== void 0 || anim.scaleToY !== void 0 || anim.colorAnimation || anim.attributeAnimations?.length || anim.setAnimations?.length || anim.repeatCount !== void 0 || anim.repeatDurMs !== void 0 || anim.autoReverse || anim.graphicBuildProperties || anim.iterate || anim.speedPct !== void 0 || anim.afterAnimationAction || anim.startConditions?.some(
|
|
200592
|
+
(condition) => condition.targetTimeNodeId !== void 0 || condition.event !== void 0 && condition.event !== "onClick" && condition.event !== "onMouseOver"
|
|
200593
|
+
)
|
|
200594
|
+
);
|
|
200595
|
+
}
|
|
200596
|
+
function authoredStartMs(anim) {
|
|
200597
|
+
return (anim.parGroupDelayMs ?? 0) + Math.max(anim.delayMs ?? 0, anim.triggerDelayMs ?? 0);
|
|
200598
|
+
}
|
|
200599
|
+
function mergeChainedMotionPathAnims(anims) {
|
|
200600
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
200601
|
+
let clickGroup = 0;
|
|
200602
|
+
const clickGroups = [];
|
|
200603
|
+
for (let index = 0; index < anims.length; index++) {
|
|
200604
|
+
const anim = anims[index];
|
|
200605
|
+
if (resolveAnimationStart(anim).trigger === "onClick") {
|
|
200606
|
+
clickGroup++;
|
|
200607
|
+
}
|
|
200608
|
+
clickGroups[index] = clickGroup;
|
|
200609
|
+
if (anim.presetClass !== "path" || !anim.motionPath || anim.parGroupIndex === void 0 || !Number.isFinite(anim.parGroupDelayMs) || !Number.isFinite(anim.durationMs) || (anim.durationMs ?? 0) <= 0) {
|
|
200610
|
+
continue;
|
|
200611
|
+
}
|
|
200612
|
+
if (hasChainBlockingExtras(anim)) {
|
|
200613
|
+
continue;
|
|
200614
|
+
}
|
|
200615
|
+
const targetId = resolveAnimationTargetId(anim);
|
|
200616
|
+
if (!targetId) {
|
|
200617
|
+
continue;
|
|
200618
|
+
}
|
|
200619
|
+
const startMs = authoredStartMs(anim);
|
|
200620
|
+
const candidateKey = JSON.stringify([
|
|
200621
|
+
clickGroup,
|
|
200622
|
+
anim.triggerShapeId,
|
|
200623
|
+
targetId,
|
|
200624
|
+
anim.motionOrigin
|
|
200625
|
+
]);
|
|
200626
|
+
const run = candidates.get(candidateKey) ?? [];
|
|
200627
|
+
run.push({ index, anim, startMs, endMs: startMs + (anim.durationMs ?? 0) });
|
|
200628
|
+
candidates.set(candidateKey, run);
|
|
200629
|
+
}
|
|
200630
|
+
const swallowedIndices = /* @__PURE__ */ new Set();
|
|
200631
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
200632
|
+
for (const [, run] of candidates) {
|
|
200633
|
+
if (run.length < 2) {
|
|
200634
|
+
continue;
|
|
200635
|
+
}
|
|
200636
|
+
const ordered4 = [...run].sort((left, right) => left.startMs - right.startMs);
|
|
200637
|
+
if (ordered4.slice(1).some((member) => member.anim.trigger === "onClick")) {
|
|
200638
|
+
continue;
|
|
200639
|
+
}
|
|
200640
|
+
if (ordered4.some((member, i2) => i2 > 0 && member.startMs < ordered4[i2 - 1].endMs)) {
|
|
200641
|
+
continue;
|
|
200642
|
+
}
|
|
200643
|
+
const segments = [];
|
|
200644
|
+
const points4 = [];
|
|
200645
|
+
const windowStartMs = ordered4[0].startMs;
|
|
200646
|
+
let windowEndMs = ordered4[0].endMs;
|
|
200647
|
+
let viable = true;
|
|
200648
|
+
for (const member of ordered4) {
|
|
200649
|
+
const segmentPoints = parseMotionPathPoints(member.anim.motionPath ?? "");
|
|
200650
|
+
if (segmentPoints.length < 2) {
|
|
200651
|
+
viable = false;
|
|
200652
|
+
break;
|
|
200653
|
+
}
|
|
200654
|
+
points4.push(...segmentPoints);
|
|
200655
|
+
segments.push({
|
|
200656
|
+
points: segmentPoints,
|
|
200657
|
+
startMs: member.startMs - windowStartMs,
|
|
200658
|
+
durationMs: member.anim.durationMs ?? 0,
|
|
200659
|
+
easing: cssEasingForAccelDecel(member.anim.accel, member.anim.decel)
|
|
200660
|
+
});
|
|
200661
|
+
windowEndMs = Math.max(windowEndMs, member.endMs);
|
|
200662
|
+
}
|
|
200663
|
+
if (!viable) {
|
|
200664
|
+
continue;
|
|
200665
|
+
}
|
|
200666
|
+
const head = ordered4[0];
|
|
200667
|
+
const windowStartMsAbs = windowStartMs;
|
|
200668
|
+
const hasPreChainExit = anims.some(
|
|
200669
|
+
(other, index) => index < head.index && clickGroups[index] === clickGroups[head.index] && other !== head.anim && other.presetClass === "exit" && resolveAnimationTargetId(other) === resolveAnimationTargetId(head.anim) && authoredStartMs(other) + (other.durationMs ?? 0) <= windowStartMsAbs
|
|
200670
|
+
);
|
|
200671
|
+
const synthetic = {
|
|
200672
|
+
...head.anim,
|
|
200673
|
+
motionPath: pointsToPathString(points4),
|
|
200674
|
+
// The window includes any authored gaps between segments.
|
|
200675
|
+
durationMs: Math.max(1, windowEndMs - windowStartMs),
|
|
200676
|
+
motionChain: segments,
|
|
200677
|
+
motionChainHideUntilStart: hasPreChainExit
|
|
200678
|
+
};
|
|
200679
|
+
replacements.set(head.index, synthetic);
|
|
200680
|
+
for (const member of ordered4.slice(1)) {
|
|
200681
|
+
swallowedIndices.add(member.index);
|
|
200682
|
+
}
|
|
200683
|
+
}
|
|
200684
|
+
if (replacements.size === 0) {
|
|
200685
|
+
return [...anims];
|
|
200686
|
+
}
|
|
200687
|
+
return anims.map((anim, index) => {
|
|
200688
|
+
if (swallowedIndices.has(index)) {
|
|
200689
|
+
return { ...anim, motionChainSwallowed: true };
|
|
200690
|
+
}
|
|
200691
|
+
return replacements.get(index) ?? anim;
|
|
200692
|
+
});
|
|
200693
|
+
}
|
|
200694
|
+
function pointsToPathString(points4) {
|
|
200695
|
+
return points4.map((point2, index) => `${index === 0 ? "M" : "L"} ${point2.x / 100} ${point2.y / 100} `).join("");
|
|
200696
|
+
}
|
|
200697
|
+
function cssKeyframeName(effect) {
|
|
200698
|
+
return `pptx-${effect}`;
|
|
200699
|
+
}
|
|
200700
|
+
function defaultDuration(presetClass) {
|
|
200701
|
+
switch (presetClass) {
|
|
200702
|
+
case "entr":
|
|
200703
|
+
return 500;
|
|
200704
|
+
case "exit":
|
|
200705
|
+
return 500;
|
|
200706
|
+
case "emph":
|
|
200707
|
+
return 800;
|
|
200708
|
+
case "path":
|
|
200709
|
+
return 1e3;
|
|
200710
|
+
default:
|
|
200711
|
+
return 500;
|
|
200712
|
+
}
|
|
200713
|
+
}
|
|
200714
|
+
function fillModeForClass(presetClass) {
|
|
200715
|
+
switch (presetClass) {
|
|
200716
|
+
case "entr":
|
|
200717
|
+
return "both";
|
|
200718
|
+
case "exit":
|
|
200719
|
+
return "forwards";
|
|
200720
|
+
case "emph":
|
|
200721
|
+
return "both";
|
|
200722
|
+
default:
|
|
200723
|
+
return "both";
|
|
200724
|
+
}
|
|
200725
|
+
}
|
|
200726
|
+
function finalizeClickGroup(steps, options) {
|
|
200727
|
+
let maxEnd = 0;
|
|
200728
|
+
for (const step of steps) {
|
|
200729
|
+
const end = step.delayMs + step.durationMs;
|
|
200730
|
+
if (end > maxEnd) {
|
|
200731
|
+
maxEnd = end;
|
|
200732
|
+
}
|
|
200733
|
+
}
|
|
200734
|
+
const group2 = { steps, totalDurationMs: maxEnd };
|
|
200735
|
+
for (const step of steps) {
|
|
200736
|
+
if (group2.seqConcurrent === void 0 && step.seqConcurrent !== void 0) {
|
|
200737
|
+
group2.seqConcurrent = step.seqConcurrent;
|
|
200738
|
+
}
|
|
200739
|
+
if (group2.seqNextAction === void 0 && step.seqNextAction !== void 0) {
|
|
200740
|
+
group2.seqNextAction = step.seqNextAction;
|
|
200741
|
+
}
|
|
200742
|
+
if (group2.seqPrevAction === void 0 && step.seqPrevAction !== void 0) {
|
|
200743
|
+
group2.seqPrevAction = step.seqPrevAction;
|
|
200744
|
+
}
|
|
200745
|
+
}
|
|
200746
|
+
return group2;
|
|
200747
|
+
}
|
|
200817
200748
|
function resolveEffect(anim, pixelateMosaic) {
|
|
200818
200749
|
const cls = anim.presetClass;
|
|
200819
200750
|
const id = anim.presetId;
|
|
@@ -200883,6 +200814,15 @@ function boxForAnimation(anim, renderContext) {
|
|
|
200883
200814
|
return targetId ? renderContext.getElementBox(targetId) : void 0;
|
|
200884
200815
|
}
|
|
200885
200816
|
function buildDynamicKeyframe(anim, uid, renderContext) {
|
|
200817
|
+
const chained = isChainedMotionAnimation(anim) ? buildChainedMotionKeyframes(
|
|
200818
|
+
anim,
|
|
200819
|
+
uid,
|
|
200820
|
+
TIMELINE_TRANSFORM_PREFIXES,
|
|
200821
|
+
boxForAnimation(anim, renderContext)
|
|
200822
|
+
) : void 0;
|
|
200823
|
+
if (chained) {
|
|
200824
|
+
return chained;
|
|
200825
|
+
}
|
|
200886
200826
|
const transform6 = buildTransformKeyframes(
|
|
200887
200827
|
anim,
|
|
200888
200828
|
uid,
|
|
@@ -200913,57 +200853,6 @@ function buildDynamicKeyframe(anim, uid, renderContext) {
|
|
|
200913
200853
|
}
|
|
200914
200854
|
return void 0;
|
|
200915
200855
|
}
|
|
200916
|
-
function cssKeyframeName(effect) {
|
|
200917
|
-
return `pptx-${effect}`;
|
|
200918
|
-
}
|
|
200919
|
-
function defaultDuration(presetClass) {
|
|
200920
|
-
switch (presetClass) {
|
|
200921
|
-
case "entr":
|
|
200922
|
-
return 500;
|
|
200923
|
-
case "exit":
|
|
200924
|
-
return 500;
|
|
200925
|
-
case "emph":
|
|
200926
|
-
return 800;
|
|
200927
|
-
case "path":
|
|
200928
|
-
return 1e3;
|
|
200929
|
-
default:
|
|
200930
|
-
return 500;
|
|
200931
|
-
}
|
|
200932
|
-
}
|
|
200933
|
-
function fillModeForClass(presetClass) {
|
|
200934
|
-
switch (presetClass) {
|
|
200935
|
-
case "entr":
|
|
200936
|
-
return "both";
|
|
200937
|
-
case "exit":
|
|
200938
|
-
return "forwards";
|
|
200939
|
-
case "emph":
|
|
200940
|
-
return "both";
|
|
200941
|
-
default:
|
|
200942
|
-
return "both";
|
|
200943
|
-
}
|
|
200944
|
-
}
|
|
200945
|
-
function finalizeClickGroup(steps, options) {
|
|
200946
|
-
let maxEnd = 0;
|
|
200947
|
-
for (const step of steps) {
|
|
200948
|
-
const end = step.delayMs + step.durationMs;
|
|
200949
|
-
if (end > maxEnd) {
|
|
200950
|
-
maxEnd = end;
|
|
200951
|
-
}
|
|
200952
|
-
}
|
|
200953
|
-
const group2 = { steps, totalDurationMs: maxEnd };
|
|
200954
|
-
for (const step of steps) {
|
|
200955
|
-
if (group2.seqConcurrent === void 0 && step.seqConcurrent !== void 0) {
|
|
200956
|
-
group2.seqConcurrent = step.seqConcurrent;
|
|
200957
|
-
}
|
|
200958
|
-
if (group2.seqNextAction === void 0 && step.seqNextAction !== void 0) {
|
|
200959
|
-
group2.seqNextAction = step.seqNextAction;
|
|
200960
|
-
}
|
|
200961
|
-
if (group2.seqPrevAction === void 0 && step.seqPrevAction !== void 0) {
|
|
200962
|
-
group2.seqPrevAction = step.seqPrevAction;
|
|
200963
|
-
}
|
|
200964
|
-
}
|
|
200965
|
-
return group2;
|
|
200966
|
-
}
|
|
200967
200856
|
function clamp015(value) {
|
|
200968
200857
|
return Math.max(0, Math.min(1, value));
|
|
200969
200858
|
}
|
|
@@ -201100,184 +200989,6 @@ function resolveEffectTiming(anim, baseDurationMs) {
|
|
|
201100
200989
|
holdEndState: shouldHoldEndState(anim)
|
|
201101
200990
|
};
|
|
201102
200991
|
}
|
|
201103
|
-
var CLICK_EVENTS = /* @__PURE__ */ new Set(["onClick", "onNext"]);
|
|
201104
|
-
var TIMENODE_EVENTS = /* @__PURE__ */ new Set([
|
|
201105
|
-
"onBegin",
|
|
201106
|
-
"onEnd",
|
|
201107
|
-
"begin",
|
|
201108
|
-
"end",
|
|
201109
|
-
"onStopAudio"
|
|
201110
|
-
]);
|
|
201111
|
-
function normalizeDelay(delay) {
|
|
201112
|
-
if (delay === void 0) {
|
|
201113
|
-
return { ms: 0, indefinite: false };
|
|
201114
|
-
}
|
|
201115
|
-
if (delay < 0) {
|
|
201116
|
-
return { ms: 0, indefinite: true };
|
|
201117
|
-
}
|
|
201118
|
-
return { ms: delay, indefinite: false };
|
|
201119
|
-
}
|
|
201120
|
-
function resolveEffectiveEndCondition(conditions) {
|
|
201121
|
-
if (!conditions || conditions.length === 0) {
|
|
201122
|
-
return void 0;
|
|
201123
|
-
}
|
|
201124
|
-
const result = {
|
|
201125
|
-
endsOnMouseOut: false,
|
|
201126
|
-
endsOnClick: false,
|
|
201127
|
-
indefinite: false
|
|
201128
|
-
};
|
|
201129
|
-
for (const cond of conditions) {
|
|
201130
|
-
const evt = cond.event;
|
|
201131
|
-
if (evt === "onMouseOut") {
|
|
201132
|
-
result.endsOnMouseOut = true;
|
|
201133
|
-
} else if (evt && CLICK_EVENTS.has(evt)) {
|
|
201134
|
-
result.endsOnClick = true;
|
|
201135
|
-
if (cond.targetShapeId) {
|
|
201136
|
-
result.clickTargetShapeId = cond.targetShapeId;
|
|
201137
|
-
}
|
|
201138
|
-
} else if (evt && TIMENODE_EVENTS.has(evt) && cond.targetTimeNodeId !== void 0) {
|
|
201139
|
-
result.endsWithTimeNodeId = cond.targetTimeNodeId;
|
|
201140
|
-
}
|
|
201141
|
-
const { ms, indefinite } = normalizeDelay(cond.delay);
|
|
201142
|
-
if (indefinite) {
|
|
201143
|
-
result.indefinite = true;
|
|
201144
|
-
} else if (ms > 0 && result.delayMs === void 0) {
|
|
201145
|
-
result.delayMs = ms;
|
|
201146
|
-
}
|
|
201147
|
-
}
|
|
201148
|
-
return result;
|
|
201149
|
-
}
|
|
201150
|
-
function resolveAnimationEnd(anim) {
|
|
201151
|
-
return resolveEffectiveEndCondition(anim.endConditions);
|
|
201152
|
-
}
|
|
201153
|
-
var HOVER_EVENTS = /* @__PURE__ */ new Set(["onMouseOver"]);
|
|
201154
|
-
function isInteractiveTrigger(trigger) {
|
|
201155
|
-
return trigger === "onClick" || trigger === "onShapeClick" || trigger === "onHover";
|
|
201156
|
-
}
|
|
201157
|
-
function classifyCondition(cond) {
|
|
201158
|
-
const evt = cond.event;
|
|
201159
|
-
if (evt && CLICK_EVENTS.has(evt)) {
|
|
201160
|
-
return "click";
|
|
201161
|
-
}
|
|
201162
|
-
if (evt && HOVER_EVENTS.has(evt)) {
|
|
201163
|
-
return "hover";
|
|
201164
|
-
}
|
|
201165
|
-
if (evt === "onMediaBookmark" && cond.bookmarkTarget) {
|
|
201166
|
-
return "bookmark";
|
|
201167
|
-
}
|
|
201168
|
-
if (evt && TIMENODE_EVENTS.has(evt)) {
|
|
201169
|
-
if (cond.targetTimeNodeId !== void 0) {
|
|
201170
|
-
return "timenode";
|
|
201171
|
-
}
|
|
201172
|
-
if (evt === "onStopAudio" && cond.targetShapeId !== void 0) {
|
|
201173
|
-
return "timenode";
|
|
201174
|
-
}
|
|
201175
|
-
}
|
|
201176
|
-
return "delay";
|
|
201177
|
-
}
|
|
201178
|
-
function resolveEffectiveStartCondition(conditions, fallbackTrigger) {
|
|
201179
|
-
const base = {
|
|
201180
|
-
trigger: fallbackTrigger,
|
|
201181
|
-
delayMs: 0,
|
|
201182
|
-
hasClickAlternative: false,
|
|
201183
|
-
hasHoverAlternative: false,
|
|
201184
|
-
indefinite: false,
|
|
201185
|
-
requiresInteraction: isInteractiveTrigger(fallbackTrigger)
|
|
201186
|
-
};
|
|
201187
|
-
if (!conditions || conditions.length === 0) {
|
|
201188
|
-
return base;
|
|
201189
|
-
}
|
|
201190
|
-
let timenode;
|
|
201191
|
-
let bookmarkCond;
|
|
201192
|
-
let delayCond;
|
|
201193
|
-
let clickCond;
|
|
201194
|
-
let hoverCond;
|
|
201195
|
-
for (const cond of conditions) {
|
|
201196
|
-
switch (classifyCondition(cond)) {
|
|
201197
|
-
case "timenode":
|
|
201198
|
-
if (!timenode) {
|
|
201199
|
-
timenode = cond;
|
|
201200
|
-
} else if (cond.targetTimeNodeId !== void 0) {
|
|
201201
|
-
if (timenode.targetTimeNodeId === void 0 || cond.targetTimeNodeId < timenode.targetTimeNodeId) {
|
|
201202
|
-
timenode = cond;
|
|
201203
|
-
}
|
|
201204
|
-
}
|
|
201205
|
-
break;
|
|
201206
|
-
case "bookmark":
|
|
201207
|
-
if (!bookmarkCond) {
|
|
201208
|
-
bookmarkCond = cond;
|
|
201209
|
-
}
|
|
201210
|
-
break;
|
|
201211
|
-
case "delay":
|
|
201212
|
-
if (!delayCond || (cond.delay ?? 0) < (delayCond.delay ?? 0)) {
|
|
201213
|
-
delayCond = cond;
|
|
201214
|
-
}
|
|
201215
|
-
break;
|
|
201216
|
-
case "click":
|
|
201217
|
-
if (!clickCond) {
|
|
201218
|
-
clickCond = cond;
|
|
201219
|
-
}
|
|
201220
|
-
break;
|
|
201221
|
-
case "hover":
|
|
201222
|
-
if (!hoverCond) {
|
|
201223
|
-
hoverCond = cond;
|
|
201224
|
-
}
|
|
201225
|
-
break;
|
|
201226
|
-
}
|
|
201227
|
-
}
|
|
201228
|
-
base.hasClickAlternative = clickCond !== void 0;
|
|
201229
|
-
base.hasHoverAlternative = hoverCond !== void 0;
|
|
201230
|
-
if (clickCond?.targetShapeId) {
|
|
201231
|
-
base.clickTargetShapeId = clickCond.targetShapeId;
|
|
201232
|
-
}
|
|
201233
|
-
if (timenode) {
|
|
201234
|
-
const { ms, indefinite } = normalizeDelay(timenode.delay);
|
|
201235
|
-
base.trigger = timenode.event === "onBegin" || timenode.event === "begin" ? "withPrevious" : "afterPrevious";
|
|
201236
|
-
base.delayMs = ms;
|
|
201237
|
-
base.indefinite = indefinite;
|
|
201238
|
-
base.dependsOnTimeNodeId = timenode.targetTimeNodeId;
|
|
201239
|
-
base.dependsOnShapeId = timenode.targetTimeNodeId === void 0 ? timenode.targetShapeId : void 0;
|
|
201240
|
-
base.dependsOnEvent = timenode.event;
|
|
201241
|
-
base.requiresInteraction = false;
|
|
201242
|
-
return base;
|
|
201243
|
-
}
|
|
201244
|
-
if (bookmarkCond?.bookmarkTarget) {
|
|
201245
|
-
base.trigger = "afterPrevious";
|
|
201246
|
-
base.delayMs = 0;
|
|
201247
|
-
base.dependsOnShapeId = bookmarkCond.bookmarkTarget.shapeId;
|
|
201248
|
-
base.dependsOnEvent = "onMediaBookmark";
|
|
201249
|
-
base.dependsOnBookmarkName = bookmarkCond.bookmarkTarget.bookmarkName;
|
|
201250
|
-
base.requiresInteraction = false;
|
|
201251
|
-
return base;
|
|
201252
|
-
}
|
|
201253
|
-
if (delayCond && (delayCond.delay ?? 0) !== 0) {
|
|
201254
|
-
const { ms, indefinite } = normalizeDelay(delayCond.delay);
|
|
201255
|
-
base.trigger = clickCond ? "onClick" : "afterDelay";
|
|
201256
|
-
base.delayMs = ms;
|
|
201257
|
-
base.indefinite = indefinite;
|
|
201258
|
-
base.requiresInteraction = indefinite;
|
|
201259
|
-
return base;
|
|
201260
|
-
}
|
|
201261
|
-
if (clickCond) {
|
|
201262
|
-
base.trigger = clickCond.targetShapeId ? "onShapeClick" : "onClick";
|
|
201263
|
-
base.requiresInteraction = true;
|
|
201264
|
-
return base;
|
|
201265
|
-
}
|
|
201266
|
-
if (hoverCond) {
|
|
201267
|
-
base.trigger = "onHover";
|
|
201268
|
-
base.requiresInteraction = true;
|
|
201269
|
-
return base;
|
|
201270
|
-
}
|
|
201271
|
-
if (delayCond) {
|
|
201272
|
-
base.trigger = fallbackTrigger;
|
|
201273
|
-
base.delayMs = 0;
|
|
201274
|
-
base.requiresInteraction = false;
|
|
201275
|
-
}
|
|
201276
|
-
return base;
|
|
201277
|
-
}
|
|
201278
|
-
function resolveAnimationStart(anim) {
|
|
201279
|
-
return resolveEffectiveStartCondition(anim.startConditions, anim.trigger ?? "onClick");
|
|
201280
|
-
}
|
|
201281
200992
|
function isMediaCommandAnimation(anim) {
|
|
201282
200993
|
return typeof anim.commandString === "string" && anim.commandString.trim().length > 0;
|
|
201283
200994
|
}
|
|
@@ -202271,6 +201982,49 @@ function composeParallelSteps(left, right) {
|
|
|
202271
201982
|
colorTargets: colorTargets.length > 0 ? colorTargets : void 0
|
|
202272
201983
|
};
|
|
202273
201984
|
}
|
|
201985
|
+
var TRANSFORM_KEYFRAME_NAME = /^pptx-(?:tl-)?(?:motion|rotate(?:Abs)?|scale(?:Abs)?|transform)-/u;
|
|
201986
|
+
var COLOR_KEYFRAME_NAME = /^pptx-(?:tl-)?(?:color|tavclr)-/u;
|
|
201987
|
+
var FILTER_KEYFRAME_NAME = /^pptx-(?:tl-)?emph-/u;
|
|
201988
|
+
var animatedPropertyCache = /* @__PURE__ */ new Map();
|
|
201989
|
+
function keyframeAnimatedProperties(keyframeName2) {
|
|
201990
|
+
let props = animatedPropertyCache.get(keyframeName2);
|
|
201991
|
+
if (props) {
|
|
201992
|
+
return props;
|
|
201993
|
+
}
|
|
201994
|
+
props = /* @__PURE__ */ new Set();
|
|
201995
|
+
if (TRANSFORM_KEYFRAME_NAME.test(keyframeName2)) {
|
|
201996
|
+
props.add("transform");
|
|
201997
|
+
if (keyframeName2.endsWith("-visibility")) {
|
|
201998
|
+
props.add("opacity");
|
|
201999
|
+
}
|
|
202000
|
+
} else if (COLOR_KEYFRAME_NAME.test(keyframeName2)) {
|
|
202001
|
+
props.add("color");
|
|
202002
|
+
} else if (FILTER_KEYFRAME_NAME.test(keyframeName2)) {
|
|
202003
|
+
props.add("filter");
|
|
202004
|
+
} else {
|
|
202005
|
+
const css = getEffectKeyframes(keyframeName2.replace(/^pptx-/u, ""));
|
|
202006
|
+
if (css) {
|
|
202007
|
+
if (/(?:^|[^-])\btransform\s*:/u.test(css)) {
|
|
202008
|
+
props.add("transform");
|
|
202009
|
+
}
|
|
202010
|
+
if (/(?:^|[^-])\bopacity\s*:/u.test(css)) {
|
|
202011
|
+
props.add("opacity");
|
|
202012
|
+
}
|
|
202013
|
+
if (/(?:^|[^-])\bfilter\s*:/u.test(css)) {
|
|
202014
|
+
props.add("filter");
|
|
202015
|
+
}
|
|
202016
|
+
if (/(?:^|[^-])\b(?:color|fill|stroke)\s*:/u.test(css)) {
|
|
202017
|
+
props.add("color");
|
|
202018
|
+
}
|
|
202019
|
+
} else {
|
|
202020
|
+
props.add("unknown");
|
|
202021
|
+
}
|
|
202022
|
+
}
|
|
202023
|
+
if (!/^pptx-(?:tl-)?(?:motion|rotate|scale|transform|color|tavclr|emph)-/u.test(keyframeName2)) {
|
|
202024
|
+
animatedPropertyCache.set(keyframeName2, props);
|
|
202025
|
+
}
|
|
202026
|
+
return props;
|
|
202027
|
+
}
|
|
202274
202028
|
function parseTmFilter(raw) {
|
|
202275
202029
|
if (!raw) {
|
|
202276
202030
|
return void 0;
|
|
@@ -202972,6 +202726,23 @@ function expandIterateAnimation(anim) {
|
|
|
202972
202726
|
function processRegularAnimation(state, anim, renderContext, pixelateMosaic) {
|
|
202973
202727
|
const expandedSteps = expandIterateAnimation(anim);
|
|
202974
202728
|
for (const singleAnim of expandedSteps) {
|
|
202729
|
+
if (isChainedMotionSwallowed(singleAnim)) {
|
|
202730
|
+
if (singleAnim.soundPath || singleAnim.stopSound) {
|
|
202731
|
+
state.currentGroup.push({
|
|
202732
|
+
elementId: "",
|
|
202733
|
+
cssAnimation: "",
|
|
202734
|
+
keyframeName: "",
|
|
202735
|
+
trigger: singleAnim.trigger ?? "onClick",
|
|
202736
|
+
delayMs: (singleAnim.parGroupDelayMs ?? 0) + Math.max(singleAnim.delayMs ?? 0, singleAnim.triggerDelayMs ?? 0),
|
|
202737
|
+
durationMs: singleAnim.durationMs ?? 0,
|
|
202738
|
+
fillMode: "forwards",
|
|
202739
|
+
presetClass: "emph",
|
|
202740
|
+
soundPath: singleAnim.soundPath,
|
|
202741
|
+
stopSound: singleAnim.stopSound
|
|
202742
|
+
});
|
|
202743
|
+
}
|
|
202744
|
+
continue;
|
|
202745
|
+
}
|
|
202975
202746
|
const resolved = resolveStepEffect(
|
|
202976
202747
|
singleAnim,
|
|
202977
202748
|
renderContext,
|
|
@@ -203082,6 +202853,9 @@ function countDynamicUids(interactiveAnims) {
|
|
|
203082
202853
|
let count = 0;
|
|
203083
202854
|
for (const [, anims] of interactiveAnims) {
|
|
203084
202855
|
for (const anim of anims) {
|
|
202856
|
+
if (isChainedMotionSwallowed(anim)) {
|
|
202857
|
+
continue;
|
|
202858
|
+
}
|
|
203085
202859
|
const effect = resolveEffect(anim);
|
|
203086
202860
|
if (!effect) {
|
|
203087
202861
|
count++;
|
|
@@ -203100,6 +202874,23 @@ function buildSequenceGroups(animsByKey, entranceIds, neededKeyframes, dynamicBl
|
|
|
203100
202874
|
let subGroupIndex;
|
|
203101
202875
|
let subGroupStartMs = 0;
|
|
203102
202876
|
for (const anim of anims) {
|
|
202877
|
+
if (isChainedMotionSwallowed(anim)) {
|
|
202878
|
+
if (anim.soundPath || anim.stopSound) {
|
|
202879
|
+
seqGroup.push({
|
|
202880
|
+
elementId: "",
|
|
202881
|
+
cssAnimation: "",
|
|
202882
|
+
keyframeName: "",
|
|
202883
|
+
trigger: anim.trigger ?? "onShapeClick",
|
|
202884
|
+
delayMs: (anim.parGroupDelayMs ?? 0) + Math.max(anim.delayMs ?? 0, anim.triggerDelayMs ?? 0),
|
|
202885
|
+
durationMs: anim.durationMs ?? 0,
|
|
202886
|
+
fillMode: "forwards",
|
|
202887
|
+
presetClass: "emph",
|
|
202888
|
+
soundPath: anim.soundPath,
|
|
202889
|
+
stopSound: anim.stopSound
|
|
202890
|
+
});
|
|
202891
|
+
}
|
|
202892
|
+
continue;
|
|
202893
|
+
}
|
|
203103
202894
|
const resolved = resolveStepEffect(anim, renderContext, dynamicUid, false, pixelateMosaic);
|
|
203104
202895
|
dynamicUid = resolved.nextDynamicUid;
|
|
203105
202896
|
if (resolved.skip) {
|
|
@@ -203290,7 +203081,12 @@ function buildTimeline(nativeAnimations, renderContext, pixelateMosaic) {
|
|
|
203290
203081
|
regularAnims.push(anim);
|
|
203291
203082
|
}
|
|
203292
203083
|
}
|
|
203293
|
-
const
|
|
203084
|
+
const mergedRegularAnims = mergeChainedMotionPathAnims(regularAnims);
|
|
203085
|
+
for (const [shapeId, anims] of interactiveAnims) {
|
|
203086
|
+
interactiveAnims.set(shapeId, mergeChainedMotionPathAnims(anims));
|
|
203087
|
+
}
|
|
203088
|
+
const mergedHoverAnims = mergeChainedMotionPathAnims(hoverAnims);
|
|
203089
|
+
const { clickGroups, entranceIds, neededKeyframes, dynamicBlocks, dynamicUid } = buildRegularClickGroups(mergedRegularAnims, renderContext, pixelateMosaic);
|
|
203294
203090
|
const interactiveSequences = buildSequenceGroups(
|
|
203295
203091
|
interactiveAnims,
|
|
203296
203092
|
entranceIds,
|
|
@@ -203301,7 +203097,7 @@ function buildTimeline(nativeAnimations, renderContext, pixelateMosaic) {
|
|
|
203301
203097
|
pixelateMosaic
|
|
203302
203098
|
);
|
|
203303
203099
|
const { hoverSequences } = buildHoverSequences(
|
|
203304
|
-
|
|
203100
|
+
mergedHoverAnims,
|
|
203305
203101
|
entranceIds,
|
|
203306
203102
|
neededKeyframes,
|
|
203307
203103
|
dynamicBlocks,
|
|
@@ -208721,17 +208517,17 @@ function attachRotateHandlePlacement(button, options = {}) {
|
|
|
208721
208517
|
for (const node of ancestors) {
|
|
208722
208518
|
mutations.observe(node, { attributes: true, attributeFilter: ["style", "class", "hidden"] });
|
|
208723
208519
|
}
|
|
208724
|
-
const
|
|
208725
|
-
if (
|
|
208726
|
-
mutations.observe(
|
|
208520
|
+
const controls2 = options.getObstacleRoot ? options.getObstacleRoot() : button.parentElement;
|
|
208521
|
+
if (controls2) {
|
|
208522
|
+
mutations.observe(controls2, {
|
|
208727
208523
|
attributes: true,
|
|
208728
208524
|
attributeFilter: ["style", "class", "hidden"],
|
|
208729
208525
|
childList: true
|
|
208730
208526
|
});
|
|
208731
|
-
observed.add(
|
|
208527
|
+
observed.add(controls2);
|
|
208732
208528
|
for (const control of [
|
|
208733
208529
|
button,
|
|
208734
|
-
...
|
|
208530
|
+
...controls2.querySelectorAll("[data-pptx-handle-kind]")
|
|
208735
208531
|
]) {
|
|
208736
208532
|
observeControl(control);
|
|
208737
208533
|
}
|
|
@@ -211436,6 +211232,9 @@ var translationsEn = {
|
|
|
211436
211232
|
// Live captions
|
|
211437
211233
|
"pptx.subtitles.listening": "Listening\u2026",
|
|
211438
211234
|
"pptx.subtitles.notSupported": "Subtitles are not supported in this browser.",
|
|
211235
|
+
"pptx.subtitles.spokenLanguage": "Spoken language",
|
|
211236
|
+
"pptx.subtitles.browserLanguage": "Browser language",
|
|
211237
|
+
"pptx.subtitles.settingsDescription": "Choose the language you will speak. Captions use browser speech recognition; translation is not available.",
|
|
211439
211238
|
// Table (additions)
|
|
211440
211239
|
"pptx.table.background": "Background",
|
|
211441
211240
|
"pptx.table.bandColCycle": "Column band size",
|
|
@@ -229153,6 +228952,89 @@ function slideShowOptionChange(id, checked) {
|
|
|
229153
228952
|
return null;
|
|
229154
228953
|
}
|
|
229155
228954
|
}
|
|
228955
|
+
var SLIDE_SHOW_COMMAND_GROUPS = [
|
|
228956
|
+
{
|
|
228957
|
+
id: "slideShow.startSlideShow",
|
|
228958
|
+
labelKey: "pptx.slideShow.start",
|
|
228959
|
+
commands: [
|
|
228960
|
+
{
|
|
228961
|
+
id: "slideShow.startSlideShow.fromBeginning",
|
|
228962
|
+
labelKey: "pptx.slideShow.fromBeginning",
|
|
228963
|
+
icon: "play-start",
|
|
228964
|
+
tooltipKey: "pptx.slideShow.fromBeginningTooltip"
|
|
228965
|
+
},
|
|
228966
|
+
{
|
|
228967
|
+
id: "slideShow.startSlideShow.fromCurrent",
|
|
228968
|
+
labelKey: "pptx.slideShow.fromCurrent",
|
|
228969
|
+
icon: "play",
|
|
228970
|
+
tooltipKey: "pptx.slideShow.fromCurrentTooltip"
|
|
228971
|
+
}
|
|
228972
|
+
]
|
|
228973
|
+
},
|
|
228974
|
+
{
|
|
228975
|
+
id: "slideShow.present",
|
|
228976
|
+
labelKey: "pptx.slideShow.present",
|
|
228977
|
+
commands: [
|
|
228978
|
+
{
|
|
228979
|
+
id: "slideShow.present.presenterView",
|
|
228980
|
+
labelKey: "pptx.slideShow.presenterView",
|
|
228981
|
+
icon: "presentation",
|
|
228982
|
+
tooltipKey: "pptx.slideShow.presenterViewTooltip"
|
|
228983
|
+
},
|
|
228984
|
+
{
|
|
228985
|
+
id: "slideShow.startSlideShow.customShow",
|
|
228986
|
+
labelKey: "pptx.slideShow.customShow",
|
|
228987
|
+
icon: "list",
|
|
228988
|
+
tooltipKey: "pptx.customShows.customShowTooltip"
|
|
228989
|
+
},
|
|
228990
|
+
{
|
|
228991
|
+
id: "slideShow.present.broadcast",
|
|
228992
|
+
labelKey: "pptx.slideShow.broadcast",
|
|
228993
|
+
icon: "broadcast",
|
|
228994
|
+
tooltipKey: "pptx.slideShow.broadcastTooltip"
|
|
228995
|
+
}
|
|
228996
|
+
]
|
|
228997
|
+
},
|
|
228998
|
+
{
|
|
228999
|
+
id: "slideShow.setUp",
|
|
229000
|
+
labelKey: "pptx.slideShow.setUpGroup",
|
|
229001
|
+
commands: [
|
|
229002
|
+
{
|
|
229003
|
+
id: "slideShow.setUp.rehearseWithCoach",
|
|
229004
|
+
labelKey: "pptx.slideShow.rehearseCoach",
|
|
229005
|
+
icon: "video",
|
|
229006
|
+
unsupported: true
|
|
229007
|
+
},
|
|
229008
|
+
{
|
|
229009
|
+
id: "slideShow.setUp.setUpSlideShow",
|
|
229010
|
+
labelKey: "pptx.slideShow.setUp",
|
|
229011
|
+
icon: "settings",
|
|
229012
|
+
tooltipKey: "pptx.slideShow.setUpTooltip"
|
|
229013
|
+
},
|
|
229014
|
+
{ id: "slideShow.setUp.hideSlide", labelKey: "pptx.slideShow.hideSlide", icon: "eye-off" },
|
|
229015
|
+
{
|
|
229016
|
+
id: "slideShow.setUp.rehearseTimings",
|
|
229017
|
+
labelKey: "pptx.slideShow.rehearseTimings",
|
|
229018
|
+
icon: "clock",
|
|
229019
|
+
tooltipKey: "pptx.slideShow.rehearseTimingsTooltip"
|
|
229020
|
+
},
|
|
229021
|
+
{ id: "slideShow.setUp.record", labelKey: "pptx.titleBar.record", icon: "record" }
|
|
229022
|
+
]
|
|
229023
|
+
}
|
|
229024
|
+
];
|
|
229025
|
+
var HELP_RIBBON_COMMANDS = [
|
|
229026
|
+
{ id: "help.help.options", labelKey: "pptx.settings.title", icon: "settings" },
|
|
229027
|
+
{
|
|
229028
|
+
id: "help.help.keyboardShortcuts",
|
|
229029
|
+
labelKey: "pptx.settings.keyboardShortcuts",
|
|
229030
|
+
icon: "keyboard"
|
|
229031
|
+
},
|
|
229032
|
+
{
|
|
229033
|
+
id: "help.help.accessibility",
|
|
229034
|
+
labelKey: "pptx.ribbon.accessibilityCheck",
|
|
229035
|
+
icon: "accessibility"
|
|
229036
|
+
}
|
|
229037
|
+
];
|
|
229156
229038
|
function resetSlideLayoutPath(slide) {
|
|
229157
229039
|
const path = slide?.layoutPath;
|
|
229158
229040
|
return typeof path === "string" && path !== "" ? path : void 0;
|
|
@@ -232384,20 +232266,20 @@ async function mountModel3D(container, modelUrl, options) {
|
|
|
232384
232266
|
scene.add(light);
|
|
232385
232267
|
}
|
|
232386
232268
|
scene.add(rig.placeModel(model));
|
|
232387
|
-
let
|
|
232269
|
+
let controls2 = null;
|
|
232388
232270
|
const OrbitCtrlCtor = await loadOrbitControlsCtor();
|
|
232389
232271
|
const enableControls = (on) => {
|
|
232390
|
-
if (on && !
|
|
232391
|
-
|
|
232392
|
-
|
|
232393
|
-
|
|
232394
|
-
|
|
232395
|
-
|
|
232396
|
-
|
|
232397
|
-
|
|
232398
|
-
} else if (!on &&
|
|
232399
|
-
|
|
232400
|
-
|
|
232272
|
+
if (on && !controls2 && OrbitCtrlCtor) {
|
|
232273
|
+
controls2 = new OrbitCtrlCtor(camera, canvas);
|
|
232274
|
+
controls2.enablePan = false;
|
|
232275
|
+
controls2.enableZoom = true;
|
|
232276
|
+
controls2.enableRotate = true;
|
|
232277
|
+
controls2.minDistance = descriptor.authored ? rig.distance * 0.2 : 2;
|
|
232278
|
+
controls2.maxDistance = descriptor.authored ? rig.distance * 4 : 20;
|
|
232279
|
+
controls2.update();
|
|
232280
|
+
} else if (!on && controls2) {
|
|
232281
|
+
controls2.dispose();
|
|
232282
|
+
controls2 = null;
|
|
232401
232283
|
}
|
|
232402
232284
|
};
|
|
232403
232285
|
enableControls(options.interactive ?? true);
|
|
@@ -232408,7 +232290,7 @@ async function mountModel3D(container, modelUrl, options) {
|
|
|
232408
232290
|
return;
|
|
232409
232291
|
}
|
|
232410
232292
|
frame2 = requestAnimationFrame(renderLoop);
|
|
232411
|
-
|
|
232293
|
+
controls2?.update();
|
|
232412
232294
|
renderer.render(scene, camera);
|
|
232413
232295
|
};
|
|
232414
232296
|
frame2 = requestAnimationFrame(renderLoop);
|
|
@@ -232445,7 +232327,7 @@ async function mountModel3D(container, modelUrl, options) {
|
|
|
232445
232327
|
}
|
|
232446
232328
|
disposed = true;
|
|
232447
232329
|
cancelAnimationFrame(frame2);
|
|
232448
|
-
|
|
232330
|
+
controls2?.dispose();
|
|
232449
232331
|
disposeModel();
|
|
232450
232332
|
scene.clear();
|
|
232451
232333
|
renderer.dispose();
|
|
@@ -237355,11 +237237,13 @@ function resolveElementAriaAttributes(element, options) {
|
|
|
237355
237237
|
};
|
|
237356
237238
|
}
|
|
237357
237239
|
var PRESENTATION_STAGE_ATTRIBUTE = "data-pptx-presenting";
|
|
237240
|
+
var PRESENTATION_ANIM_TRIGGER_ATTRIBUTE = "data-pptx-anim-trigger";
|
|
237358
237241
|
var PRESENTATION_HIT_TEST_CSS = `
|
|
237359
237242
|
[${PRESENTATION_STAGE_ATTRIBUTE}] [data-element-id] {
|
|
237360
237243
|
pointer-events: none;
|
|
237361
237244
|
}
|
|
237362
237245
|
[${PRESENTATION_STAGE_ATTRIBUTE}] [data-pptx-action],
|
|
237246
|
+
[${PRESENTATION_STAGE_ATTRIBUTE}] [${PRESENTATION_ANIM_TRIGGER_ATTRIBUTE}],
|
|
237363
237247
|
[${PRESENTATION_STAGE_ATTRIBUTE}] [data-element-id] a[href],
|
|
237364
237248
|
[${PRESENTATION_STAGE_ATTRIBUTE}] [data-element-id] video[controls],
|
|
237365
237249
|
[${PRESENTATION_STAGE_ATTRIBUTE}] [data-element-id] audio[controls] {
|
|
@@ -237444,7 +237328,11 @@ function focusableElements(panel2) {
|
|
|
237444
237328
|
}
|
|
237445
237329
|
function activateModalFocus(panel2, options = {}) {
|
|
237446
237330
|
const doc = panel2.ownerDocument;
|
|
237447
|
-
|
|
237331
|
+
let activeElement = doc.activeElement;
|
|
237332
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
237333
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
237334
|
+
}
|
|
237335
|
+
const opener = activeElement instanceof HTMLElement ? activeElement : null;
|
|
237448
237336
|
const restoreFocus = options.restoreFocus ?? true;
|
|
237449
237337
|
function focusInitial() {
|
|
237450
237338
|
const candidate = options.initialFocus ?? focusableElements(panel2)[0] ?? panel2;
|
|
@@ -241790,6 +241678,73 @@ function hiddenSlideCue(hidden, surface, slideIndex) {
|
|
|
241790
241678
|
}
|
|
241791
241679
|
return { hidden: true, labelId: hiddenSlideLabelId(surface, slideIndex), marker: "true" };
|
|
241792
241680
|
}
|
|
241681
|
+
function mergeCaptionResults(resultIndex, results) {
|
|
241682
|
+
let finalText = "";
|
|
241683
|
+
let interimText = "";
|
|
241684
|
+
for (let index = resultIndex; index < results.length; index++) {
|
|
241685
|
+
const result = results[index];
|
|
241686
|
+
const fragment = result?.[0]?.transcript ?? "";
|
|
241687
|
+
if (result?.isFinal) {
|
|
241688
|
+
finalText += fragment;
|
|
241689
|
+
} else {
|
|
241690
|
+
interimText += fragment;
|
|
241691
|
+
}
|
|
241692
|
+
}
|
|
241693
|
+
return `${finalText} ${interimText}`.trim();
|
|
241694
|
+
}
|
|
241695
|
+
function getSpeechRecognitionCtor() {
|
|
241696
|
+
const source = globalThis;
|
|
241697
|
+
return source["SpeechRecognition"] ?? source["webkitSpeechRecognition"] ?? null;
|
|
241698
|
+
}
|
|
241699
|
+
var SUBTITLE_LANGUAGES = [
|
|
241700
|
+
"auto",
|
|
241701
|
+
"en-US",
|
|
241702
|
+
"en-GB",
|
|
241703
|
+
"fr-FR",
|
|
241704
|
+
"de-DE",
|
|
241705
|
+
"es-ES",
|
|
241706
|
+
"pt-BR",
|
|
241707
|
+
"it-IT",
|
|
241708
|
+
"ja-JP",
|
|
241709
|
+
"ko-KR",
|
|
241710
|
+
"zh-CN"
|
|
241711
|
+
];
|
|
241712
|
+
function subtitleLanguageLabel(language) {
|
|
241713
|
+
try {
|
|
241714
|
+
return new Intl.DisplayNames(void 0, { type: "language" }).of(language) ?? language;
|
|
241715
|
+
} catch {
|
|
241716
|
+
return language;
|
|
241717
|
+
}
|
|
241718
|
+
}
|
|
241719
|
+
function normalizeSubtitleSettings(settings) {
|
|
241720
|
+
const spokenLanguage = settings?.spokenLanguage ?? "auto";
|
|
241721
|
+
return {
|
|
241722
|
+
spokenLanguage: SUBTITLE_LANGUAGES.includes(spokenLanguage) ? spokenLanguage : "auto"
|
|
241723
|
+
};
|
|
241724
|
+
}
|
|
241725
|
+
function subtitleSettingsFromOptions(options) {
|
|
241726
|
+
return normalizeSubtitleSettings({ spokenLanguage: options?.accessibility.subtitleLanguage });
|
|
241727
|
+
}
|
|
241728
|
+
function updateSubtitleSettings(store, settings) {
|
|
241729
|
+
store.setValue(
|
|
241730
|
+
"accessibility",
|
|
241731
|
+
"subtitleLanguage",
|
|
241732
|
+
normalizeSubtitleSettings(settings).spokenLanguage
|
|
241733
|
+
);
|
|
241734
|
+
}
|
|
241735
|
+
function subtitleRecognitionLanguage(settings, browserLanguage = "en-US") {
|
|
241736
|
+
return settings.spokenLanguage === "auto" ? browserLanguage || "en-US" : settings.spokenLanguage;
|
|
241737
|
+
}
|
|
241738
|
+
function subtitleSettingsLabels(t) {
|
|
241739
|
+
return {
|
|
241740
|
+
title: t("pptx.slideShow.subtitleSettings"),
|
|
241741
|
+
language: t("pptx.subtitles.spokenLanguage"),
|
|
241742
|
+
browserLanguage: t("pptx.subtitles.browserLanguage"),
|
|
241743
|
+
description: t("pptx.subtitles.settingsDescription"),
|
|
241744
|
+
apply: t("pptx.common.apply"),
|
|
241745
|
+
cancel: t("pptx.common.cancel")
|
|
241746
|
+
};
|
|
241747
|
+
}
|
|
241793
241748
|
var VIEWER_PREFS_STORAGE_KEY = "pptx-viewer-prefs";
|
|
241794
241749
|
function hasLocalStorage() {
|
|
241795
241750
|
return typeof localStorage !== "undefined";
|
|
@@ -242154,6 +242109,7 @@ var DEFAULT_VIEWER_OPTIONS = {
|
|
|
242154
242109
|
clearCacheOnClose: false
|
|
242155
242110
|
},
|
|
242156
242111
|
accessibility: {
|
|
242112
|
+
subtitleLanguage: "auto",
|
|
242157
242113
|
showAccessibilityStatus: true,
|
|
242158
242114
|
feedbackWithSound: false,
|
|
242159
242115
|
soundScheme: "modern",
|
|
@@ -243793,7 +243749,7 @@ function resolveRibbonCustomization(ribbon3) {
|
|
|
243793
243749
|
const actions = /* @__PURE__ */ new Set();
|
|
243794
243750
|
const contextualTabs = /* @__PURE__ */ new Set();
|
|
243795
243751
|
const groups = /* @__PURE__ */ new Set();
|
|
243796
|
-
const
|
|
243752
|
+
const controls2 = /* @__PURE__ */ new Set();
|
|
243797
243753
|
for (const tab of ribbon3?.hiddenTabs ?? []) {
|
|
243798
243754
|
if (CONTEXTUAL_TAB_IDS.has(tab)) {
|
|
243799
243755
|
contextualTabs.add(tab);
|
|
@@ -243808,19 +243764,19 @@ function resolveRibbonCustomization(ribbon3) {
|
|
|
243808
243764
|
}
|
|
243809
243765
|
for (const button of ribbon3?.hiddenButtons ?? []) {
|
|
243810
243766
|
if (isRibbonControlId(button)) {
|
|
243811
|
-
|
|
243767
|
+
controls2.add(button);
|
|
243812
243768
|
} else {
|
|
243813
243769
|
actions.add(button);
|
|
243814
243770
|
}
|
|
243815
243771
|
}
|
|
243816
243772
|
for (const [action, control] of BUTTON_CONTROL_ALIASES) {
|
|
243817
243773
|
if (actions.has(action)) {
|
|
243818
|
-
|
|
243819
|
-
} else if (
|
|
243774
|
+
controls2.add(control);
|
|
243775
|
+
} else if (controls2.has(control)) {
|
|
243820
243776
|
actions.add(action);
|
|
243821
243777
|
}
|
|
243822
243778
|
}
|
|
243823
|
-
return { actions, contextualTabs, groups, controls };
|
|
243779
|
+
return { actions, contextualTabs, groups, controls: controls2 };
|
|
243824
243780
|
}
|
|
243825
243781
|
var DIALOG_ENTRY_POINTS = {
|
|
243826
243782
|
options: { actions: [], pages: ["options"], cards: [] },
|
|
@@ -244023,13 +243979,13 @@ function customizeSection(tabId, section, resolved) {
|
|
|
244023
243979
|
if (resolved.hiddenOptionsSections.has(`${tabId}.${section.id}`)) {
|
|
244024
243980
|
return null;
|
|
244025
243981
|
}
|
|
244026
|
-
const
|
|
243982
|
+
const controls2 = section.controls.filter((control) => isSettingVisible(resolved, optionsSettingIdOf(control))).map(
|
|
244027
243983
|
(control) => isSettingLocked(resolved, optionsSettingIdOf(control)) ? { ...control, readOnly: true } : control
|
|
244028
243984
|
);
|
|
244029
|
-
if (
|
|
243985
|
+
if (controls2.length === 0 && section.controls.length > 0 && !section.special) {
|
|
244030
243986
|
return null;
|
|
244031
243987
|
}
|
|
244032
|
-
return { ...section, controls };
|
|
243988
|
+
return { ...section, controls: controls2 };
|
|
244033
243989
|
}
|
|
244034
243990
|
function customizeOptionsTabs(tabs, resolved) {
|
|
244035
243991
|
if (resolved.hiddenOptionsPages.size === 0 && resolved.hiddenOptionsSections.size === 0 && resolved.hiddenSettings.size === 0 && Object.keys(resolved.lockedSettings).length === 0) {
|
|
@@ -248934,28 +248890,19 @@ function cursorForTool(tool) {
|
|
|
248934
248890
|
return "default";
|
|
248935
248891
|
}
|
|
248936
248892
|
}
|
|
248937
|
-
|
|
248938
|
-
if (!state) {
|
|
248939
|
-
return {};
|
|
248940
|
-
}
|
|
248941
|
-
const carried = {};
|
|
248942
|
-
if (state.build) {
|
|
248943
|
-
carried.build = state.build;
|
|
248944
|
-
}
|
|
248945
|
-
if (state.chartReveal) {
|
|
248946
|
-
carried.chartReveal = state.chartReveal;
|
|
248947
|
-
}
|
|
248948
|
-
if (state.diagramReveal) {
|
|
248949
|
-
carried.diagramReveal = state.diagramReveal;
|
|
248950
|
-
}
|
|
248951
|
-
if (state.textStyle) {
|
|
248952
|
-
carried.textStyle = state.textStyle;
|
|
248953
|
-
}
|
|
248954
|
-
return carried;
|
|
248955
|
-
}
|
|
248893
|
+
var playbackOwners = /* @__PURE__ */ new WeakMap();
|
|
248956
248894
|
function applyAnimationGroupSteps(group2, ctx) {
|
|
248957
248895
|
wireMediaEndedSteps(group2, ctx);
|
|
248958
248896
|
wireMediaBookmarkSteps(group2, ctx);
|
|
248897
|
+
const ownedAnimations = /* @__PURE__ */ new Map();
|
|
248898
|
+
const owner = /* @__PURE__ */ Symbol("animation group");
|
|
248899
|
+
const owners = playbackOwners.get(ctx.setStates) ?? /* @__PURE__ */ new Map();
|
|
248900
|
+
playbackOwners.set(ctx.setStates, owners);
|
|
248901
|
+
for (const step of group2.steps) {
|
|
248902
|
+
if (step.elementId && !step.command) {
|
|
248903
|
+
owners.set(step.elementId, owner);
|
|
248904
|
+
}
|
|
248905
|
+
}
|
|
248959
248906
|
for (const step of group2.steps) {
|
|
248960
248907
|
if (step.command) {
|
|
248961
248908
|
const command = step.command;
|
|
@@ -248969,46 +248916,101 @@ function applyAnimationGroupSteps(group2, ctx) {
|
|
|
248969
248916
|
continue;
|
|
248970
248917
|
}
|
|
248971
248918
|
if (step.stopSound) {
|
|
248972
|
-
|
|
248919
|
+
if (step.delayMs > 0) {
|
|
248920
|
+
const stopTimer = window.setTimeout(() => {
|
|
248921
|
+
ctx.stopSound();
|
|
248922
|
+
}, step.delayMs);
|
|
248923
|
+
ctx.timers.push(stopTimer);
|
|
248924
|
+
} else {
|
|
248925
|
+
ctx.stopSound();
|
|
248926
|
+
}
|
|
248973
248927
|
} else if (step.soundPath) {
|
|
248974
|
-
|
|
248928
|
+
const soundPath = step.soundPath;
|
|
248929
|
+
if (step.delayMs > 0) {
|
|
248930
|
+
const soundTimer = window.setTimeout(() => {
|
|
248931
|
+
(ctx.onPlayActionSound ?? ctx.playSound)(soundPath);
|
|
248932
|
+
}, step.delayMs);
|
|
248933
|
+
ctx.timers.push(soundTimer);
|
|
248934
|
+
} else {
|
|
248935
|
+
(ctx.onPlayActionSound ?? ctx.playSound)(soundPath);
|
|
248936
|
+
}
|
|
248975
248937
|
}
|
|
248976
248938
|
}
|
|
248977
248939
|
ctx.setStates((previous) => {
|
|
248978
248940
|
const next = new Map(previous);
|
|
248941
|
+
const componentsByElement = /* @__PURE__ */ new Map();
|
|
248979
248942
|
for (const step of group2.steps) {
|
|
248980
|
-
if (step.command) {
|
|
248943
|
+
if (step.command || !step.elementId) {
|
|
248981
248944
|
continue;
|
|
248982
248945
|
}
|
|
248983
248946
|
const current = next.get(step.elementId);
|
|
248984
248947
|
const shouldBeVisible = step.presetClass === "exit" ? current?.visible ?? true : true;
|
|
248985
248948
|
const carried = carryBuildState(current);
|
|
248949
|
+
let components = componentsByElement.get(step.elementId);
|
|
248950
|
+
if (!components) {
|
|
248951
|
+
components = [];
|
|
248952
|
+
componentsByElement.set(step.elementId, components);
|
|
248953
|
+
}
|
|
248954
|
+
if (step.cssAnimation) {
|
|
248955
|
+
const names = [...step.cssAnimation.matchAll(/(?:^|,\s*)([\w-]+)\s+[\d.]+m?s\b/gu)].map(
|
|
248956
|
+
(match) => match[1]
|
|
248957
|
+
);
|
|
248958
|
+
const stepProperties = new Set(
|
|
248959
|
+
(names.length ? names : [step.keyframeName]).flatMap((name) => [
|
|
248960
|
+
...keyframeAnimatedProperties(name)
|
|
248961
|
+
])
|
|
248962
|
+
);
|
|
248963
|
+
const takesOverEverything = stepProperties.has("unknown");
|
|
248964
|
+
for (let index = components.length - 1; index >= 0; index--) {
|
|
248965
|
+
const component2 = components[index];
|
|
248966
|
+
const collides = takesOverEverything || component2.properties.has("unknown") || [...stepProperties].some((property) => component2.properties.has(property));
|
|
248967
|
+
if (collides) {
|
|
248968
|
+
components.splice(index, 1);
|
|
248969
|
+
}
|
|
248970
|
+
}
|
|
248971
|
+
components.push({
|
|
248972
|
+
animation: step.cssAnimation,
|
|
248973
|
+
properties: stepProperties,
|
|
248974
|
+
colorTargets: step.colorTargets
|
|
248975
|
+
});
|
|
248976
|
+
ownedAnimations.set(
|
|
248977
|
+
step.elementId,
|
|
248978
|
+
components.map((component2) => component2.animation)
|
|
248979
|
+
);
|
|
248980
|
+
}
|
|
248986
248981
|
next.set(step.elementId, {
|
|
248987
248982
|
...carried,
|
|
248988
248983
|
visible: shouldBeVisible,
|
|
248989
|
-
cssAnimation:
|
|
248990
|
-
animatesFill:
|
|
248991
|
-
animatesStroke:
|
|
248984
|
+
cssAnimation: components.map((component2) => component2.animation).join(", ") || void 0,
|
|
248985
|
+
animatesFill: components.some((component2) => component2.colorTargets?.includes("fill")) || void 0,
|
|
248986
|
+
animatesStroke: components.some((component2) => component2.colorTargets?.includes("stroke")) || void 0,
|
|
248992
248987
|
textStyle: mergeTextStyleOnStart(carried.textStyle, step.textStyle)
|
|
248993
248988
|
});
|
|
248994
248989
|
}
|
|
248995
248990
|
return next;
|
|
248996
248991
|
});
|
|
248997
248992
|
for (const step of group2.steps) {
|
|
248998
|
-
if (step.command) {
|
|
248993
|
+
if (step.command || !step.elementId) {
|
|
248999
248994
|
continue;
|
|
249000
248995
|
}
|
|
249001
248996
|
const timer = window.setTimeout(
|
|
249002
248997
|
() => {
|
|
248998
|
+
const components = ownedAnimations.get(step.elementId) ?? [];
|
|
248999
|
+
const remaining = step.holdEndState ? components : components.filter((animation) => animation !== step.cssAnimation);
|
|
249003
249000
|
ctx.setStates((previous) => {
|
|
249004
249001
|
const next = new Map(previous);
|
|
249005
249002
|
const current = next.get(step.elementId);
|
|
249003
|
+
if (owners.get(step.elementId) !== owner || current?.cssAnimation !== (components.join(", ") || void 0) || step.cssAnimation && !components.includes(step.cssAnimation)) {
|
|
249004
|
+
return next;
|
|
249005
|
+
}
|
|
249006
249006
|
const visibleAfter = step.presetClass === "exit" || step.hideAfterEffect ? false : current?.visible ?? true;
|
|
249007
249007
|
const carried = carryBuildState(current);
|
|
249008
249008
|
next.set(step.elementId, {
|
|
249009
249009
|
...carried,
|
|
249010
249010
|
visible: visibleAfter,
|
|
249011
|
-
cssAnimation:
|
|
249011
|
+
cssAnimation: remaining.join(", ") || void 0,
|
|
249012
|
+
animatesFill: step.colorTargets ? void 0 : current?.animatesFill,
|
|
249013
|
+
animatesStroke: step.colorTargets ? void 0 : current?.animatesStroke,
|
|
249012
249014
|
textStyle: resolveTextStyleOnCleanup(
|
|
249013
249015
|
carried.textStyle,
|
|
249014
249016
|
step.textStyle,
|
|
@@ -249017,12 +249019,32 @@ function applyAnimationGroupSteps(group2, ctx) {
|
|
|
249017
249019
|
});
|
|
249018
249020
|
return next;
|
|
249019
249021
|
});
|
|
249022
|
+
ownedAnimations.set(step.elementId, remaining);
|
|
249020
249023
|
},
|
|
249021
249024
|
Math.max(0, step.delayMs + step.durationMs + 8)
|
|
249022
249025
|
);
|
|
249023
249026
|
ctx.timers.push(timer);
|
|
249024
249027
|
}
|
|
249025
249028
|
}
|
|
249029
|
+
function carryBuildState(state) {
|
|
249030
|
+
if (!state) {
|
|
249031
|
+
return {};
|
|
249032
|
+
}
|
|
249033
|
+
const carried = {};
|
|
249034
|
+
if (state.build) {
|
|
249035
|
+
carried.build = state.build;
|
|
249036
|
+
}
|
|
249037
|
+
if (state.chartReveal) {
|
|
249038
|
+
carried.chartReveal = state.chartReveal;
|
|
249039
|
+
}
|
|
249040
|
+
if (state.diagramReveal) {
|
|
249041
|
+
carried.diagramReveal = state.diagramReveal;
|
|
249042
|
+
}
|
|
249043
|
+
if (state.textStyle) {
|
|
249044
|
+
carried.textStyle = state.textStyle;
|
|
249045
|
+
}
|
|
249046
|
+
return carried;
|
|
249047
|
+
}
|
|
249026
249048
|
function cancelBuildReveal(handle) {
|
|
249027
249049
|
if (handle.current !== null && typeof cancelAnimationFrame === "function") {
|
|
249028
249050
|
cancelAnimationFrame(handle.current);
|
|
@@ -253308,6 +253330,1142 @@ function prepareElementUpdateBatch(slides, updates) {
|
|
|
253308
253330
|
});
|
|
253309
253331
|
return changed ? next : null;
|
|
253310
253332
|
}
|
|
253333
|
+
var RECORD_COMMAND_GROUPS = [
|
|
253334
|
+
{
|
|
253335
|
+
id: "record.camera",
|
|
253336
|
+
labelKey: "pptx.record.camera",
|
|
253337
|
+
commands: [
|
|
253338
|
+
{
|
|
253339
|
+
id: "record.camera.cameo",
|
|
253340
|
+
labelKey: "pptx.record.cameo",
|
|
253341
|
+
icon: "camera",
|
|
253342
|
+
unsupported: true
|
|
253343
|
+
}
|
|
253344
|
+
]
|
|
253345
|
+
},
|
|
253346
|
+
{
|
|
253347
|
+
id: "record.record",
|
|
253348
|
+
labelKey: "pptx.ribbon.tab.record",
|
|
253349
|
+
commands: [
|
|
253350
|
+
{
|
|
253351
|
+
id: "record.record.fromBeginning",
|
|
253352
|
+
labelKey: "pptx.slideShow.fromBeginning",
|
|
253353
|
+
icon: "video"
|
|
253354
|
+
},
|
|
253355
|
+
{ id: "record.record.fromCurrent", labelKey: "pptx.slideShow.fromCurrent", icon: "play" }
|
|
253356
|
+
]
|
|
253357
|
+
},
|
|
253358
|
+
{
|
|
253359
|
+
id: "record.manage",
|
|
253360
|
+
labelKey: "pptx.record.manage",
|
|
253361
|
+
commands: [
|
|
253362
|
+
{
|
|
253363
|
+
id: "record.manage.clear",
|
|
253364
|
+
labelKey: "pptx.record.clear",
|
|
253365
|
+
icon: "eraser",
|
|
253366
|
+
unsupported: true
|
|
253367
|
+
},
|
|
253368
|
+
{
|
|
253369
|
+
id: "record.manage.reset",
|
|
253370
|
+
labelKey: "pptx.record.resetToCameo",
|
|
253371
|
+
icon: "reset",
|
|
253372
|
+
unsupported: true
|
|
253373
|
+
}
|
|
253374
|
+
]
|
|
253375
|
+
},
|
|
253376
|
+
{
|
|
253377
|
+
id: "record.help",
|
|
253378
|
+
labelKey: "pptx.ribbon.tab.help",
|
|
253379
|
+
commands: [
|
|
253380
|
+
{
|
|
253381
|
+
id: "record.help.learnMore",
|
|
253382
|
+
labelKey: "pptx.record.learnMore",
|
|
253383
|
+
icon: "help",
|
|
253384
|
+
unsupported: true
|
|
253385
|
+
}
|
|
253386
|
+
]
|
|
253387
|
+
}
|
|
253388
|
+
];
|
|
253389
|
+
var SLIDE_SHOW_OPTIONS_STYLES = `
|
|
253390
|
+
:host {
|
|
253391
|
+
display: inline-flex;
|
|
253392
|
+
flex: none;
|
|
253393
|
+
align-items: flex-start;
|
|
253394
|
+
gap: 8px;
|
|
253395
|
+
color: var(--pptx-foreground, #f9fafb);
|
|
253396
|
+
font: inherit;
|
|
253397
|
+
}
|
|
253398
|
+
.column { display: flex; flex-direction: column; gap: 2px; }
|
|
253399
|
+
label {
|
|
253400
|
+
display: flex;
|
|
253401
|
+
align-items: center;
|
|
253402
|
+
gap: 4px;
|
|
253403
|
+
min-height: 22px;
|
|
253404
|
+
padding: 0 4px;
|
|
253405
|
+
font-size: 10px;
|
|
253406
|
+
white-space: nowrap;
|
|
253407
|
+
cursor: pointer;
|
|
253408
|
+
}
|
|
253409
|
+
label:has([disabled]) { color: var(--pptx-muted-foreground, #9ca3af); cursor: not-allowed; }
|
|
253410
|
+
@media (pointer: coarse), (max-width: 767px) {
|
|
253411
|
+
label { min-height: 44px; font-size: 12px; }
|
|
253412
|
+
}
|
|
253413
|
+
`;
|
|
253414
|
+
function definePptxSlideShowOptions(registry) {
|
|
253415
|
+
if (registry.get("pptx-ui-slide-show-options")) {
|
|
253416
|
+
return;
|
|
253417
|
+
}
|
|
253418
|
+
class SlideShowOptions extends HTMLElement {
|
|
253419
|
+
static observedAttributes = ["disabled"];
|
|
253420
|
+
properties;
|
|
253421
|
+
optionLabels = {};
|
|
253422
|
+
rows = /* @__PURE__ */ new Map();
|
|
253423
|
+
constructor() {
|
|
253424
|
+
super();
|
|
253425
|
+
const root = this.attachShadow({ mode: "open" });
|
|
253426
|
+
attachControlStyles(root, SLIDE_SHOW_OPTIONS_STYLES);
|
|
253427
|
+
const columns = [document.createElement("div"), document.createElement("div")];
|
|
253428
|
+
for (const column of columns) {
|
|
253429
|
+
column.className = "column";
|
|
253430
|
+
}
|
|
253431
|
+
SLIDE_SHOW_OPTIONS.forEach((option, index) => {
|
|
253432
|
+
const label = document.createElement("label");
|
|
253433
|
+
const checkbox = document.createElement("pptx-ui-checkbox");
|
|
253434
|
+
const text22 = document.createTextNode("");
|
|
253435
|
+
label.append(checkbox, text22);
|
|
253436
|
+
label.addEventListener("click", (event) => {
|
|
253437
|
+
event.preventDefault();
|
|
253438
|
+
if (event.target !== checkbox) {
|
|
253439
|
+
checkbox.click();
|
|
253440
|
+
}
|
|
253441
|
+
});
|
|
253442
|
+
columns[index < 3 ? 0 : 1].append(label);
|
|
253443
|
+
this.rows.set(option.id, { checkbox, text: text22 });
|
|
253444
|
+
checkbox.addEventListener("change", (event) => {
|
|
253445
|
+
event.stopPropagation();
|
|
253446
|
+
const change = slideShowOptionChange(option.id, checkbox.checked);
|
|
253447
|
+
this.sync();
|
|
253448
|
+
if (!this.disabled && !option.unsupported && change) {
|
|
253449
|
+
this.dispatchEvent(
|
|
253450
|
+
new CustomEvent("show-options-change", {
|
|
253451
|
+
detail: change,
|
|
253452
|
+
bubbles: true,
|
|
253453
|
+
composed: true
|
|
253454
|
+
})
|
|
253455
|
+
);
|
|
253456
|
+
}
|
|
253457
|
+
});
|
|
253458
|
+
checkbox.addEventListener("input", (event) => event.stopPropagation());
|
|
253459
|
+
});
|
|
253460
|
+
columns[1].append(document.createElement("slot"));
|
|
253461
|
+
root.append(...columns);
|
|
253462
|
+
}
|
|
253463
|
+
connectedCallback() {
|
|
253464
|
+
this.sync();
|
|
253465
|
+
}
|
|
253466
|
+
attributeChangedCallback() {
|
|
253467
|
+
this.sync();
|
|
253468
|
+
}
|
|
253469
|
+
get presentationProperties() {
|
|
253470
|
+
return this.properties;
|
|
253471
|
+
}
|
|
253472
|
+
set presentationProperties(value) {
|
|
253473
|
+
this.properties = value;
|
|
253474
|
+
this.sync();
|
|
253475
|
+
}
|
|
253476
|
+
get labels() {
|
|
253477
|
+
return this.optionLabels;
|
|
253478
|
+
}
|
|
253479
|
+
set labels(value) {
|
|
253480
|
+
this.optionLabels = value ?? {};
|
|
253481
|
+
this.sync();
|
|
253482
|
+
}
|
|
253483
|
+
get disabled() {
|
|
253484
|
+
return this.hasAttribute("disabled");
|
|
253485
|
+
}
|
|
253486
|
+
set disabled(value) {
|
|
253487
|
+
this.toggleAttribute("disabled", Boolean(value));
|
|
253488
|
+
}
|
|
253489
|
+
sync() {
|
|
253490
|
+
for (const option of SLIDE_SHOW_OPTIONS) {
|
|
253491
|
+
const row = this.rows.get(option.id);
|
|
253492
|
+
const label = this.optionLabels[option.id] ?? option.labelKey;
|
|
253493
|
+
row.text.textContent = label;
|
|
253494
|
+
row.checkbox.setAttribute("aria-label", label);
|
|
253495
|
+
row.checkbox.checked = readSlideShowOption(this.properties, option.id);
|
|
253496
|
+
row.checkbox.disabled = this.disabled || option.unsupported;
|
|
253497
|
+
}
|
|
253498
|
+
}
|
|
253499
|
+
}
|
|
253500
|
+
registry.define("pptx-ui-slide-show-options", SlideShowOptions);
|
|
253501
|
+
}
|
|
253502
|
+
var SUBTITLE_SETTINGS_STYLES = `
|
|
253503
|
+
:host { display: inline-flex; }
|
|
253504
|
+
dialog { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
|
|
253505
|
+
margin: auto; padding: 24px; border: 1px solid var(--pptx-border, #374151); border-radius: 10px;
|
|
253506
|
+
background: var(--pptx-background, #181b20); color: var(--pptx-foreground, #f9fafb); font: 14px/1.5 system-ui; }
|
|
253507
|
+
dialog::backdrop { background: #0008; }
|
|
253508
|
+
h2 { margin: 0 0 12px; font-size: 18px; } p { margin: 0 0 20px; }
|
|
253509
|
+
label { display: block; margin-bottom: 8px; }
|
|
253510
|
+
pptx-ui-select { display: block; width: 100%; }
|
|
253511
|
+
footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
|
|
253512
|
+
footer button { padding: 8px 16px; min-height: 44px; border: 1px solid var(--pptx-border, #374151);
|
|
253513
|
+
border-radius: 6px; background: var(--pptx-secondary, #252830); color: inherit; font: inherit; cursor: pointer; }
|
|
253514
|
+
footer button:last-child { background: var(--pptx-primary, #6366f1); color: var(--pptx-primary-foreground, #fff); }
|
|
253515
|
+
footer button:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 2px; }
|
|
253516
|
+
@media (forced-colors: active) { dialog { background: Canvas; color: CanvasText; } footer button { color: ButtonText; } }
|
|
253517
|
+
`;
|
|
253518
|
+
function definePptxSubtitleSettings(registry) {
|
|
253519
|
+
if (registry.get("pptx-ui-subtitle-settings")) {
|
|
253520
|
+
return;
|
|
253521
|
+
}
|
|
253522
|
+
class SubtitleSettingsElement extends HTMLElement {
|
|
253523
|
+
current = normalizeSubtitleSettings();
|
|
253524
|
+
text = {
|
|
253525
|
+
title: "Subtitle Settings",
|
|
253526
|
+
language: "Spoken language",
|
|
253527
|
+
browserLanguage: "Browser language",
|
|
253528
|
+
description: "",
|
|
253529
|
+
apply: "Apply",
|
|
253530
|
+
cancel: "Cancel"
|
|
253531
|
+
};
|
|
253532
|
+
command;
|
|
253533
|
+
dialog;
|
|
253534
|
+
heading;
|
|
253535
|
+
description;
|
|
253536
|
+
languageLabel;
|
|
253537
|
+
language;
|
|
253538
|
+
apply;
|
|
253539
|
+
cancel;
|
|
253540
|
+
constructor() {
|
|
253541
|
+
super();
|
|
253542
|
+
const root = this.attachShadow({ mode: "open" });
|
|
253543
|
+
attachControlStyles(root, SUBTITLE_SETTINGS_STYLES);
|
|
253544
|
+
this.command = document.createElement("pptx-ui-ribbon-command");
|
|
253545
|
+
this.command.setAttribute("data-ribbon-control", "slideShow.captions.subtitleSettings");
|
|
253546
|
+
this.command.setAttribute("icon", "captions");
|
|
253547
|
+
this.command.setAttribute("compact", "");
|
|
253548
|
+
this.dialog = document.createElement("dialog");
|
|
253549
|
+
this.heading = document.createElement("h2");
|
|
253550
|
+
this.description = document.createElement("p");
|
|
253551
|
+
this.languageLabel = document.createElement("label");
|
|
253552
|
+
this.language = document.createElement("pptx-ui-select");
|
|
253553
|
+
this.language.id = "spoken-language";
|
|
253554
|
+
this.languageLabel.htmlFor = this.language.id;
|
|
253555
|
+
const footer = document.createElement("footer");
|
|
253556
|
+
this.cancel = document.createElement("button");
|
|
253557
|
+
this.cancel.type = "button";
|
|
253558
|
+
this.apply = document.createElement("button");
|
|
253559
|
+
this.apply.type = "button";
|
|
253560
|
+
footer.append(this.cancel, this.apply);
|
|
253561
|
+
this.dialog.append(this.heading, this.description, this.languageLabel, this.language, footer);
|
|
253562
|
+
root.append(this.command, this.dialog);
|
|
253563
|
+
this.command.addEventListener("command-request", () => this.open());
|
|
253564
|
+
this.cancel.addEventListener("click", () => this.close());
|
|
253565
|
+
this.dialog.addEventListener("cancel", (event) => {
|
|
253566
|
+
event.preventDefault();
|
|
253567
|
+
this.close();
|
|
253568
|
+
});
|
|
253569
|
+
this.dialog.addEventListener("keydown", (event) => {
|
|
253570
|
+
event.stopPropagation();
|
|
253571
|
+
if (event.key === "Tab") {
|
|
253572
|
+
const picker = this.language.shadowRoot?.querySelector("button");
|
|
253573
|
+
const controls2 = [
|
|
253574
|
+
...picker && !picker.disabled ? [picker] : [],
|
|
253575
|
+
this.cancel,
|
|
253576
|
+
this.apply
|
|
253577
|
+
];
|
|
253578
|
+
const active2 = event.composedPath()[0];
|
|
253579
|
+
const index = controls2.findIndex((control) => control === active2);
|
|
253580
|
+
event.preventDefault();
|
|
253581
|
+
controls2[(index + (event.shiftKey ? controls2.length - 1 : 1)) % controls2.length].focus();
|
|
253582
|
+
}
|
|
253583
|
+
if (event.key === "Escape") {
|
|
253584
|
+
event.preventDefault();
|
|
253585
|
+
this.close();
|
|
253586
|
+
}
|
|
253587
|
+
});
|
|
253588
|
+
this.apply.addEventListener("click", () => {
|
|
253589
|
+
const settings = normalizeSubtitleSettings({ spokenLanguage: this.language.value });
|
|
253590
|
+
this.dispatchEvent(
|
|
253591
|
+
new CustomEvent("subtitle-settings-change", {
|
|
253592
|
+
detail: settings,
|
|
253593
|
+
bubbles: true,
|
|
253594
|
+
composed: true
|
|
253595
|
+
})
|
|
253596
|
+
);
|
|
253597
|
+
this.close();
|
|
253598
|
+
});
|
|
253599
|
+
}
|
|
253600
|
+
get settings() {
|
|
253601
|
+
return { ...this.current };
|
|
253602
|
+
}
|
|
253603
|
+
set settings(value) {
|
|
253604
|
+
this.current = normalizeSubtitleSettings(value);
|
|
253605
|
+
}
|
|
253606
|
+
get labels() {
|
|
253607
|
+
return this.text;
|
|
253608
|
+
}
|
|
253609
|
+
set labels(value) {
|
|
253610
|
+
this.text = { ...this.text, ...value };
|
|
253611
|
+
this.sync();
|
|
253612
|
+
}
|
|
253613
|
+
get languageDisabled() {
|
|
253614
|
+
return this.language.disabled;
|
|
253615
|
+
}
|
|
253616
|
+
set languageDisabled(value) {
|
|
253617
|
+
this.language.disabled = value;
|
|
253618
|
+
}
|
|
253619
|
+
connectedCallback() {
|
|
253620
|
+
this.sync();
|
|
253621
|
+
}
|
|
253622
|
+
disconnectedCallback() {
|
|
253623
|
+
if (this.dialog.open) {
|
|
253624
|
+
this.dialog.close();
|
|
253625
|
+
}
|
|
253626
|
+
}
|
|
253627
|
+
open() {
|
|
253628
|
+
if (this.dialog.open) {
|
|
253629
|
+
return;
|
|
253630
|
+
}
|
|
253631
|
+
this.sync();
|
|
253632
|
+
this.language.value = this.current.spokenLanguage;
|
|
253633
|
+
this.dialog.showModal();
|
|
253634
|
+
this.language.shadowRoot?.querySelector("button")?.focus();
|
|
253635
|
+
}
|
|
253636
|
+
close() {
|
|
253637
|
+
this.dialog.close();
|
|
253638
|
+
this.command.shadowRoot?.querySelector("button")?.focus();
|
|
253639
|
+
}
|
|
253640
|
+
sync() {
|
|
253641
|
+
this.command.setAttribute("label", this.text.title);
|
|
253642
|
+
this.dialog.setAttribute("aria-label", this.text.title);
|
|
253643
|
+
this.heading.textContent = this.text.title;
|
|
253644
|
+
this.description.textContent = this.text.description;
|
|
253645
|
+
this.languageLabel.textContent = this.text.language;
|
|
253646
|
+
this.language.setAttribute("aria-label", this.text.language);
|
|
253647
|
+
this.cancel.textContent = this.text.cancel;
|
|
253648
|
+
this.apply.textContent = this.text.apply;
|
|
253649
|
+
this.language.replaceChildren(
|
|
253650
|
+
...SUBTITLE_LANGUAGES.map((value) => {
|
|
253651
|
+
const option = document.createElement("option");
|
|
253652
|
+
option.value = value;
|
|
253653
|
+
option.textContent = value === "auto" ? this.text.browserLanguage : subtitleLanguageLabel(value);
|
|
253654
|
+
return option;
|
|
253655
|
+
})
|
|
253656
|
+
);
|
|
253657
|
+
}
|
|
253658
|
+
}
|
|
253659
|
+
registry.define("pptx-ui-subtitle-settings", SubtitleSettingsElement);
|
|
253660
|
+
}
|
|
253661
|
+
var controls = [
|
|
253662
|
+
["pptx-ui-search", definePptxSearchField],
|
|
253663
|
+
["pptx-ui-checkbox", definePptxCheckbox],
|
|
253664
|
+
["pptx-ui-select", definePptxSelect],
|
|
253665
|
+
["pptx-ui-slide-show-options", definePptxSlideShowOptions],
|
|
253666
|
+
["pptx-ui-ribbon-command", definePptxRibbonCommand],
|
|
253667
|
+
["pptx-ui-ribbon-group", definePptxRibbonGroup],
|
|
253668
|
+
["pptx-ui-ribbon-toggle", definePptxRibbonToggle],
|
|
253669
|
+
["pptx-ui-subtitle-settings", definePptxSubtitleSettings]
|
|
253670
|
+
];
|
|
253671
|
+
function registerPptxWebControls() {
|
|
253672
|
+
if (typeof window === "undefined" || !window.customElements) {
|
|
253673
|
+
return;
|
|
253674
|
+
}
|
|
253675
|
+
const registry = window.customElements;
|
|
253676
|
+
assertWebControlContract(
|
|
253677
|
+
registry,
|
|
253678
|
+
controls.map(([name]) => name)
|
|
253679
|
+
);
|
|
253680
|
+
if (!document.getElementById("pptx-ui-control-hosts")) {
|
|
253681
|
+
const style = document.createElement("style");
|
|
253682
|
+
style.id = "pptx-ui-control-hosts";
|
|
253683
|
+
style.textContent = HOST_STYLES;
|
|
253684
|
+
document.head.append(style);
|
|
253685
|
+
}
|
|
253686
|
+
for (const [name, define] of controls) {
|
|
253687
|
+
if (!registry.get(name)) {
|
|
253688
|
+
define(registry);
|
|
253689
|
+
markWebControlContract(registry.get(name));
|
|
253690
|
+
}
|
|
253691
|
+
}
|
|
253692
|
+
}
|
|
253693
|
+
var defaultThemeColors = {
|
|
253694
|
+
background: "#030712",
|
|
253695
|
+
// gray-950
|
|
253696
|
+
foreground: "#f3f4f6",
|
|
253697
|
+
// gray-100
|
|
253698
|
+
card: "#111827",
|
|
253699
|
+
// gray-900
|
|
253700
|
+
cardForeground: "#f3f4f6",
|
|
253701
|
+
// gray-100
|
|
253702
|
+
popover: "#111827",
|
|
253703
|
+
// gray-900
|
|
253704
|
+
popoverForeground: "#f3f4f6",
|
|
253705
|
+
// gray-100
|
|
253706
|
+
primary: "#6366f1",
|
|
253707
|
+
// indigo-500
|
|
253708
|
+
primaryForeground: "#ffffff",
|
|
253709
|
+
// white
|
|
253710
|
+
secondary: "#1f2937",
|
|
253711
|
+
// gray-800
|
|
253712
|
+
secondaryForeground: "#f3f4f6",
|
|
253713
|
+
// gray-100
|
|
253714
|
+
muted: "#1f2937",
|
|
253715
|
+
// gray-800
|
|
253716
|
+
mutedForeground: "#9ca3af",
|
|
253717
|
+
// gray-400
|
|
253718
|
+
accent: "#1f2937",
|
|
253719
|
+
// gray-800
|
|
253720
|
+
accentForeground: "#f3f4f6",
|
|
253721
|
+
// gray-100
|
|
253722
|
+
destructive: "#ef4444",
|
|
253723
|
+
// red-500
|
|
253724
|
+
destructiveForeground: "#ffffff",
|
|
253725
|
+
// white
|
|
253726
|
+
border: "#374151",
|
|
253727
|
+
// gray-700
|
|
253728
|
+
input: "#374151",
|
|
253729
|
+
// gray-700
|
|
253730
|
+
ring: "#6366f1"
|
|
253731
|
+
// indigo-500
|
|
253732
|
+
};
|
|
253733
|
+
var defaultRadius = "0.5rem";
|
|
253734
|
+
var lightThemeColors = {
|
|
253735
|
+
background: "#f8fafc",
|
|
253736
|
+
// slate-50
|
|
253737
|
+
foreground: "#0f172a",
|
|
253738
|
+
// slate-900
|
|
253739
|
+
card: "#ffffff",
|
|
253740
|
+
cardForeground: "#0f172a",
|
|
253741
|
+
// slate-900
|
|
253742
|
+
popover: "#ffffff",
|
|
253743
|
+
popoverForeground: "#0f172a",
|
|
253744
|
+
// slate-900
|
|
253745
|
+
primary: "#4f46e5",
|
|
253746
|
+
// indigo-600
|
|
253747
|
+
primaryForeground: "#ffffff",
|
|
253748
|
+
secondary: "#f1f5f9",
|
|
253749
|
+
// slate-100
|
|
253750
|
+
secondaryForeground: "#0f172a",
|
|
253751
|
+
// slate-900
|
|
253752
|
+
muted: "#f1f5f9",
|
|
253753
|
+
// slate-100
|
|
253754
|
+
mutedForeground: "#64748b",
|
|
253755
|
+
// slate-500
|
|
253756
|
+
accent: "#f1f5f9",
|
|
253757
|
+
// slate-100
|
|
253758
|
+
accentForeground: "#0f172a",
|
|
253759
|
+
// slate-900
|
|
253760
|
+
destructive: "#dc2626",
|
|
253761
|
+
// red-600
|
|
253762
|
+
destructiveForeground: "#ffffff",
|
|
253763
|
+
border: "#e2e8f0",
|
|
253764
|
+
// slate-200
|
|
253765
|
+
input: "#e2e8f0",
|
|
253766
|
+
// slate-200
|
|
253767
|
+
ring: "#4f46e5"
|
|
253768
|
+
// indigo-600
|
|
253769
|
+
};
|
|
253770
|
+
var lightTheme = {
|
|
253771
|
+
colors: lightThemeColors
|
|
253772
|
+
};
|
|
253773
|
+
var COLOR_KEY_TO_CSS = {
|
|
253774
|
+
background: "background",
|
|
253775
|
+
foreground: "foreground",
|
|
253776
|
+
card: "card",
|
|
253777
|
+
cardForeground: "card-foreground",
|
|
253778
|
+
popover: "popover",
|
|
253779
|
+
popoverForeground: "popover-foreground",
|
|
253780
|
+
primary: "primary",
|
|
253781
|
+
primaryForeground: "primary-foreground",
|
|
253782
|
+
secondary: "secondary",
|
|
253783
|
+
secondaryForeground: "secondary-foreground",
|
|
253784
|
+
muted: "muted",
|
|
253785
|
+
mutedForeground: "muted-foreground",
|
|
253786
|
+
accent: "accent",
|
|
253787
|
+
accentForeground: "accent-foreground",
|
|
253788
|
+
destructive: "destructive",
|
|
253789
|
+
destructiveForeground: "destructive-foreground",
|
|
253790
|
+
border: "border",
|
|
253791
|
+
input: "input",
|
|
253792
|
+
ring: "ring"
|
|
253793
|
+
};
|
|
253794
|
+
var DERIVED_COLOR_TOKENS = [
|
|
253795
|
+
{ source: "primary", cssSuffix: "inspector-active" },
|
|
253796
|
+
{ source: "border", cssSuffix: "inspector-border" }
|
|
253797
|
+
];
|
|
253798
|
+
function themeToCssVars(theme, omitDefaults = false) {
|
|
253799
|
+
const vars = {};
|
|
253800
|
+
if (!theme) {
|
|
253801
|
+
return vars;
|
|
253802
|
+
}
|
|
253803
|
+
const colors = theme.colors;
|
|
253804
|
+
if (colors) {
|
|
253805
|
+
for (const [key2, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
|
|
253806
|
+
const value = colors[key2];
|
|
253807
|
+
if (value === void 0) {
|
|
253808
|
+
continue;
|
|
253809
|
+
}
|
|
253810
|
+
if (omitDefaults && value === defaultThemeColors[key2]) {
|
|
253811
|
+
continue;
|
|
253812
|
+
}
|
|
253813
|
+
vars[`--pptx-${cssSuffix}`] = value;
|
|
253814
|
+
vars[`--color-${cssSuffix}`] = value;
|
|
253815
|
+
}
|
|
253816
|
+
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
253817
|
+
const value = colors[source];
|
|
253818
|
+
if (value === void 0) {
|
|
253819
|
+
continue;
|
|
253820
|
+
}
|
|
253821
|
+
if (omitDefaults && value === defaultThemeColors[source]) {
|
|
253822
|
+
continue;
|
|
253823
|
+
}
|
|
253824
|
+
vars[`--pptx-${cssSuffix}`] = value;
|
|
253825
|
+
}
|
|
253826
|
+
}
|
|
253827
|
+
if (theme.radius !== void 0) {
|
|
253828
|
+
if (!omitDefaults || theme.radius !== defaultRadius) {
|
|
253829
|
+
vars["--pptx-radius"] = theme.radius;
|
|
253830
|
+
const r = theme.radius;
|
|
253831
|
+
vars["--radius-sm"] = `calc(${r} - 4px)`;
|
|
253832
|
+
vars["--radius-md"] = `calc(${r} - 2px)`;
|
|
253833
|
+
vars["--radius-lg"] = r;
|
|
253834
|
+
vars["--radius-xl"] = `calc(${r} + 4px)`;
|
|
253835
|
+
}
|
|
253836
|
+
}
|
|
253837
|
+
if (theme.cssVars) {
|
|
253838
|
+
for (const [key2, value] of Object.entries(theme.cssVars)) {
|
|
253839
|
+
vars[key2] = value;
|
|
253840
|
+
}
|
|
253841
|
+
}
|
|
253842
|
+
return vars;
|
|
253843
|
+
}
|
|
253844
|
+
function defaultCssVars() {
|
|
253845
|
+
const vars = {};
|
|
253846
|
+
for (const [key2, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
|
|
253847
|
+
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[key2];
|
|
253848
|
+
}
|
|
253849
|
+
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
253850
|
+
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[source];
|
|
253851
|
+
}
|
|
253852
|
+
vars["--pptx-radius"] = defaultRadius;
|
|
253853
|
+
return vars;
|
|
253854
|
+
}
|
|
253855
|
+
var vermilionLightColors = {
|
|
253856
|
+
background: "#fbfaf7",
|
|
253857
|
+
foreground: "#1a1d21",
|
|
253858
|
+
card: "#ffffff",
|
|
253859
|
+
cardForeground: "#1a1d21",
|
|
253860
|
+
popover: "#ffffff",
|
|
253861
|
+
popoverForeground: "#1a1d21",
|
|
253862
|
+
primary: "#c2431f",
|
|
253863
|
+
primaryForeground: "#ffffff",
|
|
253864
|
+
secondary: "#f2efe8",
|
|
253865
|
+
secondaryForeground: "#1a1d21",
|
|
253866
|
+
muted: "#f2efe8",
|
|
253867
|
+
mutedForeground: "#5a626e",
|
|
253868
|
+
accent: "rgba(194, 67, 31, 0.08)",
|
|
253869
|
+
accentForeground: "#1a1d21",
|
|
253870
|
+
destructive: "#dc2626",
|
|
253871
|
+
destructiveForeground: "#ffffff",
|
|
253872
|
+
border: "#e6e2d9",
|
|
253873
|
+
input: "#e6e2d9",
|
|
253874
|
+
ring: "#c2431f"
|
|
253875
|
+
};
|
|
253876
|
+
var vermilionDarkColors = {
|
|
253877
|
+
background: "#0f1113",
|
|
253878
|
+
foreground: "#f0efec",
|
|
253879
|
+
card: "#171a1e",
|
|
253880
|
+
cardForeground: "#f0efec",
|
|
253881
|
+
popover: "#171a1e",
|
|
253882
|
+
popoverForeground: "#f0efec",
|
|
253883
|
+
primary: "#e86a40",
|
|
253884
|
+
primaryForeground: "#ffffff",
|
|
253885
|
+
secondary: "#1f242b",
|
|
253886
|
+
secondaryForeground: "#f0efec",
|
|
253887
|
+
muted: "#1f242b",
|
|
253888
|
+
mutedForeground: "#9aa1ab",
|
|
253889
|
+
accent: "rgba(232, 106, 64, 0.1)",
|
|
253890
|
+
accentForeground: "#f0efec",
|
|
253891
|
+
destructive: "#ef4444",
|
|
253892
|
+
destructiveForeground: "#ffffff",
|
|
253893
|
+
border: "#272c33",
|
|
253894
|
+
input: "#272c33",
|
|
253895
|
+
ring: "#e86a40"
|
|
253896
|
+
};
|
|
253897
|
+
var vermilionRadius = "0.375rem";
|
|
253898
|
+
var vermilionLightTheme = {
|
|
253899
|
+
colors: vermilionLightColors,
|
|
253900
|
+
radius: vermilionRadius
|
|
253901
|
+
};
|
|
253902
|
+
var vermilionDarkTheme = {
|
|
253903
|
+
colors: vermilionDarkColors,
|
|
253904
|
+
radius: vermilionRadius
|
|
253905
|
+
};
|
|
253906
|
+
var THEME_CATALOG = [
|
|
253907
|
+
{ key: "default", labelKey: "pptx.settings.theme.default", theme: void 0 },
|
|
253908
|
+
{ key: "light", labelKey: "pptx.settings.theme.light", theme: lightTheme },
|
|
253909
|
+
{
|
|
253910
|
+
key: "vermilionLight",
|
|
253911
|
+
labelKey: "pptx.settings.theme.vermilionLight",
|
|
253912
|
+
theme: vermilionLightTheme
|
|
253913
|
+
},
|
|
253914
|
+
{
|
|
253915
|
+
key: "vermilionDark",
|
|
253916
|
+
labelKey: "pptx.settings.theme.vermilionDark",
|
|
253917
|
+
theme: vermilionDarkTheme
|
|
253918
|
+
}
|
|
253919
|
+
];
|
|
253920
|
+
function resolveThemeCatalogEntry(key2, catalog = THEME_CATALOG) {
|
|
253921
|
+
return catalog.find((entry5) => entry5.key === key2)?.theme;
|
|
253922
|
+
}
|
|
253923
|
+
function corePreset(id) {
|
|
253924
|
+
const preset22 = exports.THEME_PRESETS.find((p) => p.id === id);
|
|
253925
|
+
if (!preset22) {
|
|
253926
|
+
throw new Error(`theme-gallery-presets: core THEME_PRESETS is missing "${id}"`);
|
|
253927
|
+
}
|
|
253928
|
+
return preset22;
|
|
253929
|
+
}
|
|
253930
|
+
var WISP_PRESET = {
|
|
253931
|
+
id: "wisp",
|
|
253932
|
+
name: "Wisp",
|
|
253933
|
+
colorScheme: {
|
|
253934
|
+
dk1: "#000000",
|
|
253935
|
+
lt1: "#FFFFFF",
|
|
253936
|
+
dk2: "#46393B",
|
|
253937
|
+
lt2: "#E8DCD8",
|
|
253938
|
+
accent1: "#A53010",
|
|
253939
|
+
accent2: "#DE7E18",
|
|
253940
|
+
accent3: "#9F8351",
|
|
253941
|
+
accent4: "#728653",
|
|
253942
|
+
accent5: "#92AA4C",
|
|
253943
|
+
accent6: "#6AAC91",
|
|
253944
|
+
hlink: "#FB4F14",
|
|
253945
|
+
folHlink: "#E25839"
|
|
253946
|
+
},
|
|
253947
|
+
fontScheme: {
|
|
253948
|
+
majorFont: { latin: "Century Gothic" },
|
|
253949
|
+
minorFont: { latin: "Century Gothic" }
|
|
253950
|
+
}
|
|
253951
|
+
};
|
|
253952
|
+
var BERLIN_PRESET = {
|
|
253953
|
+
id: "berlin",
|
|
253954
|
+
name: "Berlin",
|
|
253955
|
+
colorScheme: {
|
|
253956
|
+
dk1: "#000000",
|
|
253957
|
+
lt1: "#FFFFFF",
|
|
253958
|
+
dk2: "#3E5C61",
|
|
253959
|
+
lt2: "#D5E0D0",
|
|
253960
|
+
accent1: "#F09415",
|
|
253961
|
+
accent2: "#C1B56B",
|
|
253962
|
+
accent3: "#89C2A3",
|
|
253963
|
+
accent4: "#729BBE",
|
|
253964
|
+
accent5: "#9A90C2",
|
|
253965
|
+
accent6: "#BE8DBE",
|
|
253966
|
+
hlink: "#25A0DA",
|
|
253967
|
+
folHlink: "#FF7F00"
|
|
253968
|
+
},
|
|
253969
|
+
fontScheme: {
|
|
253970
|
+
majorFont: { latin: "Trebuchet MS" },
|
|
253971
|
+
minorFont: { latin: "Trebuchet MS" }
|
|
253972
|
+
}
|
|
253973
|
+
};
|
|
253974
|
+
var SLICE_PRESET = {
|
|
253975
|
+
id: "slice",
|
|
253976
|
+
name: "Slice",
|
|
253977
|
+
colorScheme: {
|
|
253978
|
+
dk1: "#000000",
|
|
253979
|
+
lt1: "#FFFFFF",
|
|
253980
|
+
dk2: "#2E3B4C",
|
|
253981
|
+
lt2: "#C7CDD3",
|
|
253982
|
+
accent1: "#E2751D",
|
|
253983
|
+
accent2: "#C53B23",
|
|
253984
|
+
accent3: "#A13D69",
|
|
253985
|
+
accent4: "#58599E",
|
|
253986
|
+
accent5: "#36749D",
|
|
253987
|
+
accent6: "#4EA39A",
|
|
253988
|
+
hlink: "#FD6B32",
|
|
253989
|
+
folHlink: "#D14D0F"
|
|
253990
|
+
},
|
|
253991
|
+
fontScheme: {
|
|
253992
|
+
majorFont: { latin: "Century Gothic" },
|
|
253993
|
+
minorFont: { latin: "Century Gothic" }
|
|
253994
|
+
}
|
|
253995
|
+
};
|
|
253996
|
+
var DIVIDEND_PRESET = {
|
|
253997
|
+
id: "dividend",
|
|
253998
|
+
name: "Dividend",
|
|
253999
|
+
colorScheme: {
|
|
254000
|
+
dk1: "#000000",
|
|
254001
|
+
lt1: "#FFFFFF",
|
|
254002
|
+
dk2: "#3D3D3D",
|
|
254003
|
+
lt2: "#E1E1E1",
|
|
254004
|
+
accent1: "#4D1434",
|
|
254005
|
+
accent2: "#903163",
|
|
254006
|
+
accent3: "#B2324B",
|
|
254007
|
+
accent4: "#D34817",
|
|
254008
|
+
accent5: "#E8971C",
|
|
254009
|
+
accent6: "#FDCB00",
|
|
254010
|
+
hlink: "#A03068",
|
|
254011
|
+
folHlink: "#C34882"
|
|
254012
|
+
},
|
|
254013
|
+
fontScheme: {
|
|
254014
|
+
majorFont: { latin: "Gill Sans MT" },
|
|
254015
|
+
minorFont: { latin: "Gill Sans MT" }
|
|
254016
|
+
}
|
|
254017
|
+
};
|
|
254018
|
+
[
|
|
254019
|
+
corePreset("office"),
|
|
254020
|
+
corePreset("facet"),
|
|
254021
|
+
corePreset("integral"),
|
|
254022
|
+
corePreset("ion"),
|
|
254023
|
+
corePreset("retrospect"),
|
|
254024
|
+
corePreset("organic"),
|
|
254025
|
+
WISP_PRESET,
|
|
254026
|
+
BERLIN_PRESET,
|
|
254027
|
+
SLICE_PRESET,
|
|
254028
|
+
DIVIDEND_PRESET
|
|
254029
|
+
];
|
|
254030
|
+
function createPresentationLoadResources(handler) {
|
|
254031
|
+
const blobUrls = [];
|
|
254032
|
+
let committed = false;
|
|
254033
|
+
let released = false;
|
|
254034
|
+
return {
|
|
254035
|
+
blobUrls,
|
|
254036
|
+
/** The live viewer now owns the handler and media URLs. */
|
|
254037
|
+
commit() {
|
|
254038
|
+
committed = true;
|
|
254039
|
+
},
|
|
254040
|
+
/** Call in finally, after pending asset reads have settled. */
|
|
254041
|
+
releaseIfUncommitted() {
|
|
254042
|
+
if (committed || released) {
|
|
254043
|
+
return;
|
|
254044
|
+
}
|
|
254045
|
+
released = true;
|
|
254046
|
+
handler.dispose();
|
|
254047
|
+
for (const url of blobUrls) {
|
|
254048
|
+
if (url.startsWith("blob:")) {
|
|
254049
|
+
URL.revokeObjectURL(url);
|
|
254050
|
+
}
|
|
254051
|
+
}
|
|
254052
|
+
}
|
|
254053
|
+
};
|
|
254054
|
+
}
|
|
254055
|
+
function walkAndPatchElements(elements, patch) {
|
|
254056
|
+
let mutated = false;
|
|
254057
|
+
const next = elements.map((el) => {
|
|
254058
|
+
let updated = patch(el);
|
|
254059
|
+
if (updated.type === "group" && updated.children?.length) {
|
|
254060
|
+
const newChildren = walkAndPatchElements(updated.children, patch);
|
|
254061
|
+
if (newChildren !== updated.children) {
|
|
254062
|
+
updated = { ...updated, children: newChildren };
|
|
254063
|
+
}
|
|
254064
|
+
}
|
|
254065
|
+
if (updated !== el) {
|
|
254066
|
+
mutated = true;
|
|
254067
|
+
}
|
|
254068
|
+
return updated;
|
|
254069
|
+
});
|
|
254070
|
+
return mutated ? next : elements;
|
|
254071
|
+
}
|
|
254072
|
+
function applyImagePathPatches(elements, resolvedMap, refs) {
|
|
254073
|
+
const elementPatches = /* @__PURE__ */ new Map();
|
|
254074
|
+
for (const ref of refs) {
|
|
254075
|
+
const url = resolvedMap.get(ref.path);
|
|
254076
|
+
if (!url) {
|
|
254077
|
+
continue;
|
|
254078
|
+
}
|
|
254079
|
+
const existing = elementPatches.get(ref.element.id) ?? {};
|
|
254080
|
+
existing[ref.field] = url;
|
|
254081
|
+
elementPatches.set(ref.element.id, existing);
|
|
254082
|
+
}
|
|
254083
|
+
if (elementPatches.size === 0) {
|
|
254084
|
+
return elements;
|
|
254085
|
+
}
|
|
254086
|
+
return walkAndPatchElements(elements, (el) => {
|
|
254087
|
+
const patch = elementPatches.get(el.id);
|
|
254088
|
+
return patch ? { ...el, ...patch } : el;
|
|
254089
|
+
});
|
|
254090
|
+
}
|
|
254091
|
+
function isExternalUrl(path) {
|
|
254092
|
+
return path.startsWith("http://") || path.startsWith("https://") || path.startsWith("data:") || path.startsWith("blob:");
|
|
254093
|
+
}
|
|
254094
|
+
function collectMediaElements(elements, collector) {
|
|
254095
|
+
for (const element of elements) {
|
|
254096
|
+
if (element.type === "media") {
|
|
254097
|
+
collector.push(element);
|
|
254098
|
+
continue;
|
|
254099
|
+
}
|
|
254100
|
+
if (element.type === "group" && element.children?.length) {
|
|
254101
|
+
collectMediaElements(element.children, collector);
|
|
254102
|
+
}
|
|
254103
|
+
}
|
|
254104
|
+
}
|
|
254105
|
+
function collectImagePaths(slides) {
|
|
254106
|
+
const paths = /* @__PURE__ */ new Set();
|
|
254107
|
+
const refs = [];
|
|
254108
|
+
const walkElements = (elements) => {
|
|
254109
|
+
for (const el of elements) {
|
|
254110
|
+
if (el.type === "picture" || el.type === "image") {
|
|
254111
|
+
const pic = el;
|
|
254112
|
+
if (pic.imagePath && !pic.imageData && !isExternalUrl(pic.imagePath)) {
|
|
254113
|
+
paths.add(pic.imagePath);
|
|
254114
|
+
refs.push({ element: el, field: "imageData", path: pic.imagePath });
|
|
254115
|
+
}
|
|
254116
|
+
if (pic.svgPath && !pic.svgData && !isExternalUrl(pic.svgPath)) {
|
|
254117
|
+
paths.add(pic.svgPath);
|
|
254118
|
+
refs.push({ element: el, field: "svgData", path: pic.svgPath });
|
|
254119
|
+
}
|
|
254120
|
+
}
|
|
254121
|
+
if (el.type === "media") {
|
|
254122
|
+
const media = el;
|
|
254123
|
+
if (media.posterFramePath && !media.posterFrameData && !isExternalUrl(media.posterFramePath)) {
|
|
254124
|
+
paths.add(media.posterFramePath);
|
|
254125
|
+
refs.push({
|
|
254126
|
+
element: el,
|
|
254127
|
+
field: "posterFrameData",
|
|
254128
|
+
path: media.posterFramePath
|
|
254129
|
+
});
|
|
254130
|
+
}
|
|
254131
|
+
}
|
|
254132
|
+
if (el.type === "model3d") {
|
|
254133
|
+
const model = el;
|
|
254134
|
+
if (model.modelPath && !model.modelData && !isExternalUrl(model.modelPath)) {
|
|
254135
|
+
paths.add(model.modelPath);
|
|
254136
|
+
refs.push({ element: el, field: "modelData", path: model.modelPath });
|
|
254137
|
+
}
|
|
254138
|
+
const posterNeedsResolution = model.posterImage ? !isExternalUrl(model.posterImage) : !model.imageData;
|
|
254139
|
+
if (model.imagePath && posterNeedsResolution && !isExternalUrl(model.imagePath)) {
|
|
254140
|
+
paths.add(model.imagePath);
|
|
254141
|
+
refs.push({ element: el, field: "posterImage", path: model.imagePath });
|
|
254142
|
+
}
|
|
254143
|
+
}
|
|
254144
|
+
if (el.type === "group" && el.children?.length) {
|
|
254145
|
+
walkElements(el.children);
|
|
254146
|
+
}
|
|
254147
|
+
}
|
|
254148
|
+
};
|
|
254149
|
+
for (const slide of slides) {
|
|
254150
|
+
walkElements(slide.elements);
|
|
254151
|
+
}
|
|
254152
|
+
return { paths, refs };
|
|
254153
|
+
}
|
|
254154
|
+
function collectTableCellImagePaths(slides) {
|
|
254155
|
+
const paths = /* @__PURE__ */ new Set();
|
|
254156
|
+
const refs = [];
|
|
254157
|
+
const walkElements = (elements) => {
|
|
254158
|
+
for (const el of elements) {
|
|
254159
|
+
if (el.type === "table") {
|
|
254160
|
+
const rows = el.tableData?.rows ?? [];
|
|
254161
|
+
rows.forEach((row, rowIndex) => {
|
|
254162
|
+
row.cells.forEach((cell, cellIndex) => {
|
|
254163
|
+
const path = cell.style?.backgroundImageFillPath;
|
|
254164
|
+
if (path && !cell.style?.backgroundImageFillData && !isExternalUrl(path)) {
|
|
254165
|
+
paths.add(path);
|
|
254166
|
+
refs.push({ element: el, rowIndex, cellIndex, path });
|
|
254167
|
+
}
|
|
254168
|
+
});
|
|
254169
|
+
});
|
|
254170
|
+
}
|
|
254171
|
+
if (el.type === "group" && el.children?.length) {
|
|
254172
|
+
walkElements(el.children);
|
|
254173
|
+
}
|
|
254174
|
+
}
|
|
254175
|
+
};
|
|
254176
|
+
for (const slide of slides) {
|
|
254177
|
+
walkElements(slide.elements);
|
|
254178
|
+
}
|
|
254179
|
+
return { paths, refs };
|
|
254180
|
+
}
|
|
254181
|
+
function applyTableCellImagePatches(elements, resolvedMap, refs) {
|
|
254182
|
+
const patchesByElementId = /* @__PURE__ */ new Map();
|
|
254183
|
+
for (const ref of refs) {
|
|
254184
|
+
const url = resolvedMap.get(ref.path);
|
|
254185
|
+
if (!url) {
|
|
254186
|
+
continue;
|
|
254187
|
+
}
|
|
254188
|
+
const list2 = patchesByElementId.get(ref.element.id) ?? [];
|
|
254189
|
+
list2.push({ rowIndex: ref.rowIndex, cellIndex: ref.cellIndex, url });
|
|
254190
|
+
patchesByElementId.set(ref.element.id, list2);
|
|
254191
|
+
}
|
|
254192
|
+
if (patchesByElementId.size === 0) {
|
|
254193
|
+
return elements;
|
|
254194
|
+
}
|
|
254195
|
+
return walkAndPatchElements(elements, (el) => {
|
|
254196
|
+
const cellPatches = patchesByElementId.get(el.id);
|
|
254197
|
+
if (!cellPatches || el.type !== "table") {
|
|
254198
|
+
return el;
|
|
254199
|
+
}
|
|
254200
|
+
const table2 = el;
|
|
254201
|
+
const tableData = table2.tableData;
|
|
254202
|
+
if (!tableData) {
|
|
254203
|
+
return el;
|
|
254204
|
+
}
|
|
254205
|
+
const newRows = tableData.rows.map((row, rowIndex) => {
|
|
254206
|
+
const rowPatches = cellPatches.filter((p) => p.rowIndex === rowIndex);
|
|
254207
|
+
if (rowPatches.length === 0) {
|
|
254208
|
+
return row;
|
|
254209
|
+
}
|
|
254210
|
+
const newCells = row.cells.map((cell, cellIndex) => {
|
|
254211
|
+
const patch = rowPatches.find((p) => p.cellIndex === cellIndex);
|
|
254212
|
+
if (!patch || !cell.style) {
|
|
254213
|
+
return cell;
|
|
254214
|
+
}
|
|
254215
|
+
return {
|
|
254216
|
+
...cell,
|
|
254217
|
+
style: { ...cell.style, backgroundImageFillData: patch.url }
|
|
254218
|
+
};
|
|
254219
|
+
});
|
|
254220
|
+
return { ...row, cells: newCells };
|
|
254221
|
+
});
|
|
254222
|
+
return { ...table2, tableData: { ...tableData, rows: newRows } };
|
|
254223
|
+
});
|
|
254224
|
+
}
|
|
254225
|
+
function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
254226
|
+
const guides = [];
|
|
254227
|
+
if (presentationGuides) {
|
|
254228
|
+
for (const g2 of presentationGuides) {
|
|
254229
|
+
guides.push({
|
|
254230
|
+
id: g2.id,
|
|
254231
|
+
axis: g2.orientation === "horz" ? "h" : "v",
|
|
254232
|
+
position: guideEmuToPx(g2.positionEmu)
|
|
254233
|
+
});
|
|
254234
|
+
}
|
|
254235
|
+
}
|
|
254236
|
+
if (firstSlideGuides) {
|
|
254237
|
+
for (const g2 of firstSlideGuides) {
|
|
254238
|
+
guides.push({
|
|
254239
|
+
id: g2.id,
|
|
254240
|
+
axis: g2.orientation === "horz" ? "h" : "v",
|
|
254241
|
+
position: guideEmuToPx(g2.positionEmu)
|
|
254242
|
+
});
|
|
254243
|
+
}
|
|
254244
|
+
}
|
|
254245
|
+
return guides;
|
|
254246
|
+
}
|
|
254247
|
+
async function resolveMediaElementSource(mediaElement, handler) {
|
|
254248
|
+
const mediaPath = mediaElement.mediaPath;
|
|
254249
|
+
if (!mediaPath) {
|
|
254250
|
+
return { mediaPath: void 0, url: void 0, isBlobUrl: false, missing: true };
|
|
254251
|
+
}
|
|
254252
|
+
if (isExternalUrl(mediaPath)) {
|
|
254253
|
+
return { mediaPath, url: mediaPath, isBlobUrl: false, missing: false };
|
|
254254
|
+
}
|
|
254255
|
+
try {
|
|
254256
|
+
const isAudioVideo = mediaElement.mediaType === "audio" || mediaElement.mediaType === "video";
|
|
254257
|
+
if (isAudioVideo) {
|
|
254258
|
+
const arrayBuffer = await handler.getMediaArrayBuffer(mediaPath);
|
|
254259
|
+
if (!arrayBuffer) {
|
|
254260
|
+
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
254261
|
+
}
|
|
254262
|
+
const mimeType = mediaElement.mediaMimeType || "application/octet-stream";
|
|
254263
|
+
const blobUrl = URL.createObjectURL(new Blob([arrayBuffer], { type: mimeType }));
|
|
254264
|
+
return { mediaPath, url: blobUrl, isBlobUrl: true, missing: false };
|
|
254265
|
+
}
|
|
254266
|
+
const dataUrl = await handler.getImageData(mediaPath);
|
|
254267
|
+
if (!dataUrl) {
|
|
254268
|
+
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
254269
|
+
}
|
|
254270
|
+
return { mediaPath, url: dataUrl, isBlobUrl: false, missing: false };
|
|
254271
|
+
} catch {
|
|
254272
|
+
return { mediaPath, url: void 0, isBlobUrl: false, missing: true };
|
|
254273
|
+
}
|
|
254274
|
+
}
|
|
254275
|
+
var TABLE_STYLE_FILL_KEYS = [
|
|
254276
|
+
"wholeTblFill",
|
|
254277
|
+
"band1HFill",
|
|
254278
|
+
"band2HFill",
|
|
254279
|
+
"band1VFill",
|
|
254280
|
+
"band2VFill",
|
|
254281
|
+
"lastColFill",
|
|
254282
|
+
"firstColFill",
|
|
254283
|
+
"lastRowFill",
|
|
254284
|
+
"seCellFill",
|
|
254285
|
+
"swCellFill",
|
|
254286
|
+
"firstRowFill",
|
|
254287
|
+
"neCellFill",
|
|
254288
|
+
"nwCellFill"
|
|
254289
|
+
];
|
|
254290
|
+
function isExternalUrl2(path) {
|
|
254291
|
+
return path.startsWith("http://") || path.startsWith("https://") || path.startsWith("data:") || path.startsWith("blob:");
|
|
254292
|
+
}
|
|
254293
|
+
function collectTableStyleImagePaths(tableStyleMap) {
|
|
254294
|
+
const paths = /* @__PURE__ */ new Set();
|
|
254295
|
+
const refs = [];
|
|
254296
|
+
if (!tableStyleMap) {
|
|
254297
|
+
return { paths, refs };
|
|
254298
|
+
}
|
|
254299
|
+
for (const [styleId, entry5] of Object.entries(tableStyleMap)) {
|
|
254300
|
+
for (const fillKey of TABLE_STYLE_FILL_KEYS) {
|
|
254301
|
+
const fill = entry5[fillKey];
|
|
254302
|
+
const path = fill?.image?.path;
|
|
254303
|
+
if (path && !fill?.image?.data && !isExternalUrl2(path)) {
|
|
254304
|
+
paths.add(path);
|
|
254305
|
+
refs.push({ styleId, fillKey, path });
|
|
254306
|
+
}
|
|
254307
|
+
}
|
|
254308
|
+
}
|
|
254309
|
+
return { paths, refs };
|
|
254310
|
+
}
|
|
254311
|
+
function applyTableStyleImagePatches(tableStyleMap, resolvedMap, refs) {
|
|
254312
|
+
const patchesByStyleId = /* @__PURE__ */ new Map();
|
|
254313
|
+
for (const ref of refs) {
|
|
254314
|
+
const url = resolvedMap.get(ref.path);
|
|
254315
|
+
if (!url) {
|
|
254316
|
+
continue;
|
|
254317
|
+
}
|
|
254318
|
+
const list2 = patchesByStyleId.get(ref.styleId) ?? [];
|
|
254319
|
+
list2.push({ fillKey: ref.fillKey, url });
|
|
254320
|
+
patchesByStyleId.set(ref.styleId, list2);
|
|
254321
|
+
}
|
|
254322
|
+
if (patchesByStyleId.size === 0) {
|
|
254323
|
+
return tableStyleMap;
|
|
254324
|
+
}
|
|
254325
|
+
const next = { ...tableStyleMap };
|
|
254326
|
+
for (const [styleId, patches] of patchesByStyleId) {
|
|
254327
|
+
const entry5 = next[styleId];
|
|
254328
|
+
if (!entry5) {
|
|
254329
|
+
continue;
|
|
254330
|
+
}
|
|
254331
|
+
const patchedEntry = { ...entry5 };
|
|
254332
|
+
for (const { fillKey, url } of patches) {
|
|
254333
|
+
const fill = patchedEntry[fillKey];
|
|
254334
|
+
if (!fill?.image) {
|
|
254335
|
+
continue;
|
|
254336
|
+
}
|
|
254337
|
+
patchedEntry[fillKey] = { ...fill, image: { ...fill.image, data: url } };
|
|
254338
|
+
}
|
|
254339
|
+
next[styleId] = patchedEntry;
|
|
254340
|
+
}
|
|
254341
|
+
return next;
|
|
254342
|
+
}
|
|
254343
|
+
function collectTextFillBlipPaths(slides) {
|
|
254344
|
+
const paths = /* @__PURE__ */ new Set();
|
|
254345
|
+
const refs = [];
|
|
254346
|
+
const walkElements = (elements) => {
|
|
254347
|
+
for (const el of elements) {
|
|
254348
|
+
if (hasTextProperties(el) && el.textSegments) {
|
|
254349
|
+
el.textSegments.forEach((segment, segmentIndex) => {
|
|
254350
|
+
const path = segment.style?.textFillBlipUrl;
|
|
254351
|
+
if (path && !isExternalUrl(path)) {
|
|
254352
|
+
paths.add(path);
|
|
254353
|
+
refs.push({ element: el, segmentIndex, path });
|
|
254354
|
+
}
|
|
254355
|
+
});
|
|
254356
|
+
}
|
|
254357
|
+
if (el.type === "group" && el.children?.length) {
|
|
254358
|
+
walkElements(el.children);
|
|
254359
|
+
}
|
|
254360
|
+
}
|
|
254361
|
+
};
|
|
254362
|
+
for (const slide of slides) {
|
|
254363
|
+
walkElements(slide.elements);
|
|
254364
|
+
}
|
|
254365
|
+
return { paths, refs };
|
|
254366
|
+
}
|
|
254367
|
+
function applyTextFillBlipPatches(elements, resolvedMap, refs) {
|
|
254368
|
+
const patchesByElementId = /* @__PURE__ */ new Map();
|
|
254369
|
+
for (const ref of refs) {
|
|
254370
|
+
const url = resolvedMap.get(ref.path);
|
|
254371
|
+
if (!url) {
|
|
254372
|
+
continue;
|
|
254373
|
+
}
|
|
254374
|
+
const list2 = patchesByElementId.get(ref.element.id) ?? [];
|
|
254375
|
+
list2.push({ segmentIndex: ref.segmentIndex, url });
|
|
254376
|
+
patchesByElementId.set(ref.element.id, list2);
|
|
254377
|
+
}
|
|
254378
|
+
if (patchesByElementId.size === 0) {
|
|
254379
|
+
return elements;
|
|
254380
|
+
}
|
|
254381
|
+
return walkAndPatchElements(elements, (el) => {
|
|
254382
|
+
const segmentPatches = patchesByElementId.get(el.id);
|
|
254383
|
+
if (!segmentPatches || !hasTextProperties(el) || !el.textSegments) {
|
|
254384
|
+
return el;
|
|
254385
|
+
}
|
|
254386
|
+
const newSegments = el.textSegments.map((segment, segmentIndex) => {
|
|
254387
|
+
const patch = segmentPatches.find((p) => p.segmentIndex === segmentIndex);
|
|
254388
|
+
if (!patch || !segment.style) {
|
|
254389
|
+
return segment;
|
|
254390
|
+
}
|
|
254391
|
+
return { ...segment, style: { ...segment.style, textFillBlipUrl: patch.url } };
|
|
254392
|
+
});
|
|
254393
|
+
return { ...el, textSegments: newSegments };
|
|
254394
|
+
});
|
|
254395
|
+
}
|
|
254396
|
+
async function resolveTableCellImageUrls(slides, getImageData) {
|
|
254397
|
+
const { paths, refs } = collectTableCellImagePaths(slides);
|
|
254398
|
+
if (paths.size === 0) {
|
|
254399
|
+
return slides;
|
|
254400
|
+
}
|
|
254401
|
+
const resolvedMap = /* @__PURE__ */ new Map();
|
|
254402
|
+
await Promise.all(
|
|
254403
|
+
Array.from(paths).map(async (path) => {
|
|
254404
|
+
try {
|
|
254405
|
+
const url = await getImageData(path);
|
|
254406
|
+
if (url) {
|
|
254407
|
+
resolvedMap.set(path, url);
|
|
254408
|
+
}
|
|
254409
|
+
} catch {
|
|
254410
|
+
}
|
|
254411
|
+
})
|
|
254412
|
+
);
|
|
254413
|
+
if (resolvedMap.size === 0) {
|
|
254414
|
+
return slides;
|
|
254415
|
+
}
|
|
254416
|
+
return slides.map((slide) => {
|
|
254417
|
+
const newElements = applyTableCellImagePatches(slide.elements, resolvedMap, refs);
|
|
254418
|
+
return newElements === slide.elements ? slide : { ...slide, elements: newElements };
|
|
254419
|
+
});
|
|
254420
|
+
}
|
|
254421
|
+
async function resolveTableStyleImageUrls(tableStyleMap, getImageData) {
|
|
254422
|
+
const { paths, refs } = collectTableStyleImagePaths(tableStyleMap);
|
|
254423
|
+
if (paths.size === 0 || !tableStyleMap) {
|
|
254424
|
+
return tableStyleMap;
|
|
254425
|
+
}
|
|
254426
|
+
const resolvedMap = /* @__PURE__ */ new Map();
|
|
254427
|
+
await Promise.all(
|
|
254428
|
+
Array.from(paths).map(async (path) => {
|
|
254429
|
+
try {
|
|
254430
|
+
const url = await getImageData(path);
|
|
254431
|
+
if (url) {
|
|
254432
|
+
resolvedMap.set(path, url);
|
|
254433
|
+
}
|
|
254434
|
+
} catch {
|
|
254435
|
+
}
|
|
254436
|
+
})
|
|
254437
|
+
);
|
|
254438
|
+
if (resolvedMap.size === 0) {
|
|
254439
|
+
return tableStyleMap;
|
|
254440
|
+
}
|
|
254441
|
+
return applyTableStyleImagePatches(tableStyleMap, resolvedMap, refs);
|
|
254442
|
+
}
|
|
254443
|
+
async function resolveTextFillBlipUrls(slides, getImageData) {
|
|
254444
|
+
const { paths, refs } = collectTextFillBlipPaths(slides);
|
|
254445
|
+
if (paths.size === 0) {
|
|
254446
|
+
return slides;
|
|
254447
|
+
}
|
|
254448
|
+
const resolvedMap = /* @__PURE__ */ new Map();
|
|
254449
|
+
await Promise.all(
|
|
254450
|
+
Array.from(paths).map(async (path) => {
|
|
254451
|
+
try {
|
|
254452
|
+
const url = await getImageData(path);
|
|
254453
|
+
if (url) {
|
|
254454
|
+
resolvedMap.set(path, url);
|
|
254455
|
+
}
|
|
254456
|
+
} catch {
|
|
254457
|
+
}
|
|
254458
|
+
})
|
|
254459
|
+
);
|
|
254460
|
+
if (resolvedMap.size === 0) {
|
|
254461
|
+
return slides;
|
|
254462
|
+
}
|
|
254463
|
+
return slides.map((slide) => {
|
|
254464
|
+
const newElements = applyTextFillBlipPatches(slide.elements, resolvedMap, refs);
|
|
254465
|
+
return newElements === slide.elements ? slide : { ...slide, elements: newElements };
|
|
254466
|
+
});
|
|
254467
|
+
}
|
|
254468
|
+
init_constants2();
|
|
253311
254469
|
function isChart3DViewEnabled(flags, chartType) {
|
|
253312
254470
|
if (!flags || !chartType) {
|
|
253313
254471
|
return false;
|
|
@@ -255915,6 +257073,7 @@ exports.GIF_POST_CAPTURE_MAX_SIDE = GIF_POST_CAPTURE_MAX_SIDE;
|
|
|
255915
257073
|
exports.GRADIENT_TYPE_OPTIONS = GRADIENT_TYPE_OPTIONS;
|
|
255916
257074
|
exports.GlyphOutlineFontCache = GlyphOutlineFontCache;
|
|
255917
257075
|
exports.HANDOUT_OPTIONS = HANDOUT_OPTIONS;
|
|
257076
|
+
exports.HELP_RIBBON_COMMANDS = HELP_RIBBON_COMMANDS;
|
|
255918
257077
|
exports.HIDDEN_SLIDE_LABEL_KEY = HIDDEN_SLIDE_LABEL_KEY;
|
|
255919
257078
|
exports.HIDDEN_SLIDE_SLASH_GRADIENT = HIDDEN_SLIDE_SLASH_GRADIENT;
|
|
255920
257079
|
exports.HIGHLIGHTER_COLORS = HIGHLIGHTER_COLORS;
|
|
@@ -255970,6 +257129,7 @@ exports.PDF_SLIDES_PAGE_HEIGHT_PT = PDF_SLIDES_PAGE_HEIGHT_PT;
|
|
|
255970
257129
|
exports.PDF_SLIDES_PAGE_WIDTH_PT = PDF_SLIDES_PAGE_WIDTH_PT;
|
|
255971
257130
|
exports.PEN_COLORS = PEN_COLORS;
|
|
255972
257131
|
exports.PPTX_OPEN_ACCEPT = PPTX_OPEN_ACCEPT;
|
|
257132
|
+
exports.PRESENTATION_ANIM_TRIGGER_ATTRIBUTE = PRESENTATION_ANIM_TRIGGER_ATTRIBUTE;
|
|
255973
257133
|
exports.PRESENTATION_CHANNEL_NAME = PRESENTATION_CHANNEL_NAME;
|
|
255974
257134
|
exports.PRESENTATION_HASH = PRESENTATION_HASH;
|
|
255975
257135
|
exports.PRESENTATION_HIT_TEST_CSS = PRESENTATION_HIT_TEST_CSS;
|
|
@@ -255991,6 +257151,7 @@ exports.RANDOM_ELIGIBLE_TYPES = RANDOM_ELIGIBLE_TYPES;
|
|
|
255991
257151
|
exports.READING_VIEW_ATTR = READING_VIEW_ATTR;
|
|
255992
257152
|
exports.READING_VIEW_COUNTER_ATTR = READING_VIEW_COUNTER_ATTR;
|
|
255993
257153
|
exports.READING_VIEW_STAGE_ATTR = READING_VIEW_STAGE_ATTR;
|
|
257154
|
+
exports.RECORD_COMMAND_GROUPS = RECORD_COMMAND_GROUPS;
|
|
255994
257155
|
exports.RIBBON_CONTEXTUAL_TAB_ATTR = RIBBON_CONTEXTUAL_TAB_ATTR;
|
|
255995
257156
|
exports.RIBBON_CONTROL_ATTR = RIBBON_CONTROL_ATTR;
|
|
255996
257157
|
exports.RIBBON_GALLERY_ATTR = RIBBON_GALLERY_ATTR;
|
|
@@ -256008,6 +257169,7 @@ exports.SEL = SEL;
|
|
|
256008
257169
|
exports.SHAPE_PRESET_DEFS = SHAPE_PRESET_DEFS;
|
|
256009
257170
|
exports.SHAPE_QUICK_STYLES = SHAPE_QUICK_STYLES;
|
|
256010
257171
|
exports.SHORTCUT_REFERENCE_ITEMS = SHORTCUT_REFERENCE_ITEMS;
|
|
257172
|
+
exports.SLIDE_SHOW_COMMAND_GROUPS = SLIDE_SHOW_COMMAND_GROUPS;
|
|
256011
257173
|
exports.SLIDE_SHOW_OPTIONS = SLIDE_SHOW_OPTIONS;
|
|
256012
257174
|
exports.SLIDE_SIZE_PRESETS = SLIDE_SIZE_PRESETS;
|
|
256013
257175
|
exports.SLIDE_TEMPLATES = SLIDE_TEMPLATES;
|
|
@@ -256525,6 +257687,7 @@ exports.getShapeConnectionSites = getShapeConnectionSites;
|
|
|
256525
257687
|
exports.getSlideBackgroundStyle = getSlideBackgroundStyle;
|
|
256526
257688
|
exports.getSlideTransitionAnimations = getSlideTransitionAnimations;
|
|
256527
257689
|
exports.getSoftEdgeSvgFilter = getSoftEdgeSvgFilter;
|
|
257690
|
+
exports.getSpeechRecognitionCtor = getSpeechRecognitionCtor;
|
|
256528
257691
|
exports.getSubstituteFontFamily = getSubstituteFontFamily;
|
|
256529
257692
|
exports.getSvgStrokeDasharray = getSvgStrokeDasharray;
|
|
256530
257693
|
exports.getTableCellBandStyle = getTableCellBandStyle;
|
|
@@ -256634,6 +257797,7 @@ exports.mediaTrimEndMsFromAbsoluteMs = mediaTrimEndMsFromAbsoluteMs;
|
|
|
256634
257797
|
exports.mediaTrimEndMsFromSeconds = mediaTrimEndMsFromSeconds;
|
|
256635
257798
|
exports.mediaTrimEndSeconds = mediaTrimEndSeconds;
|
|
256636
257799
|
exports.mergeAdditiveSelection = mergeAdditiveSelection;
|
|
257800
|
+
exports.mergeCaptionResults = mergeCaptionResults;
|
|
256637
257801
|
exports.mergeCells = mergeCells;
|
|
256638
257802
|
exports.mergePresentationSnapshot = mergePresentationSnapshot;
|
|
256639
257803
|
exports.mergeSlideTransition = mergeSlideTransition;
|
|
@@ -256736,7 +257900,6 @@ exports.readEditableText = readEditableText;
|
|
|
256736
257900
|
exports.readListActivationSelection = readListActivationSelection;
|
|
256737
257901
|
exports.readOnlyRecommendation = readOnlyRecommendation;
|
|
256738
257902
|
exports.readRibbonTransitionDraft = readRibbonTransitionDraft;
|
|
256739
|
-
exports.readSlideShowOption = readSlideShowOption;
|
|
256740
257903
|
exports.readSlidesFromYDoc = readSlidesFromYDoc;
|
|
256741
257904
|
exports.readSoundFileAsDataUrl = readSoundFileAsDataUrl;
|
|
256742
257905
|
exports.readStoredViewerPrefs = readStoredViewerPrefs;
|
|
@@ -256933,7 +258096,6 @@ exports.shouldWriteAutosaveSnapshot = shouldWriteAutosaveSnapshot;
|
|
|
256933
258096
|
exports.siblingCount = siblingCount;
|
|
256934
258097
|
exports.siblingIndex = siblingIndex;
|
|
256935
258098
|
exports.slideProgressPercent = slideProgressPercent;
|
|
256936
|
-
exports.slideShowOptionChange = slideShowOptionChange;
|
|
256937
258099
|
exports.slideSizeFromPreset = slideSizeFromPreset;
|
|
256938
258100
|
exports.slideSizeToCanvasPx = slideSizeToCanvasPx;
|
|
256939
258101
|
exports.slideStatusLabel = slideStatusLabel;
|
|
@@ -256956,6 +258118,9 @@ exports.strokeWidthOf = strokeWidthOf;
|
|
|
256956
258118
|
exports.styleShadowFilter = styleShadowFilter;
|
|
256957
258119
|
exports.subscribeBarFacePicturePixelSamples = subscribeBarFacePicturePixelSamples;
|
|
256958
258120
|
exports.substituteFieldText = substituteFieldText;
|
|
258121
|
+
exports.subtitleRecognitionLanguage = subtitleRecognitionLanguage;
|
|
258122
|
+
exports.subtitleSettingsFromOptions = subtitleSettingsFromOptions;
|
|
258123
|
+
exports.subtitleSettingsLabels = subtitleSettingsLabels;
|
|
256959
258124
|
exports.surfaceWireframePatch = surfaceWireframePatch;
|
|
256960
258125
|
exports.svgGradientFillRef = svgGradientFillRef;
|
|
256961
258126
|
exports.svgLineCap = svgLineCap;
|
|
@@ -257001,6 +258166,7 @@ exports.updateElement = updateElement;
|
|
|
257001
258166
|
exports.updateMasterViewElement = updateMasterViewElement;
|
|
257002
258167
|
exports.updateMergeAttrsInRawXml = updateMergeAttrsInRawXml;
|
|
257003
258168
|
exports.updateSmartArtNodeText = updateSmartArtNodeText;
|
|
258169
|
+
exports.updateSubtitleSettings = updateSubtitleSettings;
|
|
257004
258170
|
exports.updateTagInCollections = updateTagInCollections;
|
|
257005
258171
|
exports.validateMediaTrimRange = validateMediaTrimRange;
|
|
257006
258172
|
exports.validateRoomId = validateRoomId;
|