pptx-react-viewer 4.13.0 → 4.14.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{AiChatPanel-VXQUQNZ6.js → AiChatPanel-PULXQTFJ.js} +27 -27
  3. package/dist/AiChatPanel-PULXQTFJ.js.br +0 -0
  4. package/dist/AiChatPanel-PULXQTFJ.js.gz +0 -0
  5. package/dist/{AiChatPanel-AQDB2BLO.mjs → AiChatPanel-WQUOEVQB.mjs} +3 -3
  6. package/dist/AiChatPanel-WQUOEVQB.mjs.br +0 -0
  7. package/dist/AiChatPanel-WQUOEVQB.mjs.gz +0 -0
  8. package/dist/{Model3DScene-I6OVMXEE.js → Model3DScene-6MYHPE5N.js} +2 -2
  9. package/dist/Model3DScene-6MYHPE5N.js.br +0 -0
  10. package/dist/Model3DScene-6MYHPE5N.js.gz +0 -0
  11. package/dist/{Model3DScene-UHHKYZSK.mjs → Model3DScene-HZG33BWN.mjs} +1 -1
  12. package/dist/Model3DScene-HZG33BWN.mjs.br +0 -0
  13. package/dist/Model3DScene-HZG33BWN.mjs.gz +0 -0
  14. package/dist/{chunk-UOS5HJLG.js → chunk-6ZR27XTL.js} +166 -110
  15. package/dist/chunk-6ZR27XTL.js.br +0 -0
  16. package/dist/chunk-6ZR27XTL.js.gz +0 -0
  17. package/dist/{chunk-5DQNWKOF.mjs → chunk-AJTFPTSN.mjs} +1 -1
  18. package/dist/chunk-AJTFPTSN.mjs.br +0 -0
  19. package/dist/chunk-AJTFPTSN.mjs.gz +0 -0
  20. package/dist/{chunk-5YW6N5KJ.js → chunk-DI4YTG3J.js} +187 -187
  21. package/dist/chunk-DI4YTG3J.js.br +0 -0
  22. package/dist/chunk-DI4YTG3J.js.gz +0 -0
  23. package/dist/{chunk-57RBEPPQ.js → chunk-E6VYR3GM.js} +806 -806
  24. package/dist/chunk-E6VYR3GM.js.br +0 -0
  25. package/dist/chunk-E6VYR3GM.js.gz +0 -0
  26. package/dist/{chunk-SLMDLVFV.mjs → chunk-ECKXYCP3.mjs} +1 -1
  27. package/dist/chunk-ECKXYCP3.mjs.br +0 -0
  28. package/dist/chunk-ECKXYCP3.mjs.gz +0 -0
  29. package/dist/{chunk-HJBTQ234.mjs → chunk-EPMT65EN.mjs} +3 -3
  30. package/dist/chunk-EPMT65EN.mjs.br +0 -0
  31. package/dist/chunk-EPMT65EN.mjs.gz +0 -0
  32. package/dist/{chunk-KA24ZRTJ.js → chunk-RK5UV5HL.js} +1187 -1187
  33. package/dist/chunk-RK5UV5HL.js.br +0 -0
  34. package/dist/chunk-RK5UV5HL.js.gz +0 -0
  35. package/dist/{chunk-JUUI5DHB.mjs → chunk-UWVRB4Z5.mjs} +166 -110
  36. package/dist/chunk-UWVRB4Z5.mjs.br +0 -0
  37. package/dist/chunk-UWVRB4Z5.mjs.gz +0 -0
  38. package/dist/{chunk-C5ZJGQ2F.mjs → chunk-WSYKEPW6.mjs} +6 -6
  39. package/dist/chunk-WSYKEPW6.mjs.br +0 -0
  40. package/dist/chunk-WSYKEPW6.mjs.gz +0 -0
  41. package/dist/{chunk-MXH7RMTF.js → chunk-XWO367ZG.js} +5 -5
  42. package/dist/chunk-XWO367ZG.js.br +0 -0
  43. package/dist/chunk-XWO367ZG.js.gz +0 -0
  44. package/dist/index.js +61 -61
  45. package/dist/index.js.br +0 -0
  46. package/dist/index.js.gz +0 -0
  47. package/dist/index.mjs +5 -5
  48. package/dist/index.mjs.br +0 -0
  49. package/dist/index.mjs.gz +0 -0
  50. package/dist/internals.js +104 -104
  51. package/dist/internals.js.br +0 -0
  52. package/dist/internals.js.gz +0 -0
  53. package/dist/internals.mjs +3 -3
  54. package/dist/internals.mjs.br +0 -0
  55. package/dist/internals.mjs.gz +0 -0
  56. package/dist/viewer/index.js +26 -26
  57. package/dist/viewer/index.js.br +0 -0
  58. package/dist/viewer/index.js.gz +0 -0
  59. package/dist/viewer/index.mjs +5 -5
  60. package/dist/viewer/index.mjs.br +0 -0
  61. package/dist/viewer/index.mjs.gz +0 -0
  62. package/package.json +1 -1
  63. package/dist/AiChatPanel-AQDB2BLO.mjs.br +0 -0
  64. package/dist/AiChatPanel-AQDB2BLO.mjs.gz +0 -0
  65. package/dist/AiChatPanel-VXQUQNZ6.js.br +0 -0
  66. package/dist/AiChatPanel-VXQUQNZ6.js.gz +0 -0
  67. package/dist/Model3DScene-I6OVMXEE.js.br +0 -0
  68. package/dist/Model3DScene-I6OVMXEE.js.gz +0 -0
  69. package/dist/Model3DScene-UHHKYZSK.mjs.br +0 -0
  70. package/dist/Model3DScene-UHHKYZSK.mjs.gz +0 -0
  71. package/dist/chunk-57RBEPPQ.js.br +0 -0
  72. package/dist/chunk-57RBEPPQ.js.gz +0 -0
  73. package/dist/chunk-5DQNWKOF.mjs.br +0 -0
  74. package/dist/chunk-5DQNWKOF.mjs.gz +0 -0
  75. package/dist/chunk-5YW6N5KJ.js.br +0 -0
  76. package/dist/chunk-5YW6N5KJ.js.gz +0 -0
  77. package/dist/chunk-C5ZJGQ2F.mjs.br +0 -0
  78. package/dist/chunk-C5ZJGQ2F.mjs.gz +0 -0
  79. package/dist/chunk-HJBTQ234.mjs.br +0 -0
  80. package/dist/chunk-HJBTQ234.mjs.gz +0 -0
  81. package/dist/chunk-JUUI5DHB.mjs.br +0 -0
  82. package/dist/chunk-JUUI5DHB.mjs.gz +0 -0
  83. package/dist/chunk-KA24ZRTJ.js.br +0 -0
  84. package/dist/chunk-KA24ZRTJ.js.gz +0 -0
  85. package/dist/chunk-MXH7RMTF.js.br +0 -0
  86. package/dist/chunk-MXH7RMTF.js.gz +0 -0
  87. package/dist/chunk-SLMDLVFV.mjs.br +0 -0
  88. package/dist/chunk-SLMDLVFV.mjs.gz +0 -0
  89. package/dist/chunk-UOS5HJLG.js.br +0 -0
  90. 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.2.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole2-parser-read.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-helpers.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-serialize.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole2-parser-write.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole2-stream-edit.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-excel-cfb.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-grid.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-excel-biff8-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fib.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cfb.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fkp.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cp1252.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-pieces.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ole-document-doc-editor.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/utils/png-encoder.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/utils/ooxml-crypto-primitives.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/utils/digests/bit-ops.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/utils/digests/md4.js"() {
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;
@@ -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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/byte-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-ppt-record-types.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/record-types.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/current-user-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/blip-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/fopt-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/bstore-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/font-collection-writer.js"() {
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
- w.bytes(drawingGroup).bytes(buildSlideListWithText([input.masterPersistAtom], 1));
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/document-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/hyperlink-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/media-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/ole-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/ex-obj-list-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/anchor-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/colors.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/text-exception-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/text-atom-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-placeholders-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-style-fonts.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-text-styles-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-props-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/group-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/shape-id-allocator.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/drawing-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/notes-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-ppt-record-stream.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/record-stream.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/color-scheme.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/color-scheme-writer.js"() {
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, _masterIdRef, notesIdRef, fonts, drawingId, hyperlinks, oleEmbeds, mediaEmbeds) {
111752
- const data = new ByteWriter().bytes(buildSlideAtom(SLIDE_MASTER_ID_SENTINEL, notesIdRef, Boolean(slide.backgroundRgb))).bytes(buildDrawing(slideRect, slide.shapes, slide.backgroundRgb, fonts, drawingId, hyperlinks, oleEmbeds, mediaEmbeds)).bytes(buildColorSchemeAtom()).toBytes();
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/slide-writer.js"() {
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 = deck.master?.themeFonts?.minor;
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(deck.masterStyles)
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 slideIds = deck.slides.map((_, i2) => 3 + i2);
111820
- let nextId2 = 3 + deck.slides.length;
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 masterDrawingId = 1;
111823
- const slideDrawingIds = deck.slides.map((_, i2) => 2 + i2);
111824
- let nextDrawingId = 2 + deck.slides.length;
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
- // master: patriarch + its placeholders
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, MASTER_ID, notesIds[i2], fonts, slideDrawingIds[i2], hyperlinks, oleEmbeds, mediaEmbeds));
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 masterContainer = buildMainMasterContainer(slideRect, masterDrawingId, hyperlinks, oleEmbeds, mediaEmbeds, deck.masterStyles, fonts, deck.master);
111841
- const masterPersistAtom = buildSlidePersistAtom(MASTER_ID, MASTER_SLIDE_ID_SENTINEL);
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
- masterPersistAtom,
111873
+ masterPersistAtoms,
111855
111874
  slidePersistAtoms,
111856
111875
  dggContainer,
111857
111876
  exObjList,
111858
111877
  soundCollection,
111859
- otherTextStyle: buildOtherTextStyle(deck.masterStyles, (name) => {
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 + masterContainer.length + slideContainers.reduce((sum, c) => sum + c.length, 0) + notesContainers.reduce((sum, c) => sum + c.length, 0) + oleStgRecords.reduce((sum, c) => sum + c.length, 0);
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(MASTER_ID, masterContainer);
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/document-stream-layout.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/crypto-constants.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/utils/rc4-cipher.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/rc4-cryptoapi-key.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/rc4-cryptoapi-streams.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/encrypt-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/master-relative-runs.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/persist-writer.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/ppt-clsid.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/ppt/writer/write-ppt.js"() {
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.2.0/node_modules/@christophervr/ole2/dist/legacy-ppt-writer.js"() {
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 firstSlideMasterPath(zip) {
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 slideRel = rels ? parseRels(rels).find((r) => r.id === firstSlideRid) : void 0;
112429
- const slide = slideRel ? resolveTarget2(presentation, slideRel.target) : void 0;
112430
- const layout = slide ? await followRel(zip, slide, "slideLayout") : void 0;
112431
- const master = layout ? await followRel(zip, layout, "slideMaster") : void 0;
112432
- return master && zip.file(master) ? master : FALLBACK_MASTER;
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
- const masterPath = await firstSlideMasterPath(zip);
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 buildMasterRoundTripFromPptx(pptxBytes) {
112596
- return buildMasterRoundTrip(await readMasterRoundTripSource(await JSZip3__default.default.loadAsync(pptxBytes)));
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;
@@ -138059,19 +138102,18 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
138059
138102
  return buildMetroBlobs(pptxBytes, slides);
138060
138103
  }
138061
138104
  /**
138062
- * The master text styles the `.ppt`'s single main master carries: those of
138063
- * the first slide's own master (a binary `.ppt` written here has one
138064
- * master), preferring an edited copy passed in `options.slideMasters` over
138065
- * the styles parsed at load.
138105
+ * The text styles of the master at `masterPath` (the first slide's master
138106
+ * when omitted), preferring an edited copy passed in `options.slideMasters`
138107
+ * over the styles parsed at load.
138066
138108
  */
138067
- legacyMasterTextStyles(slides, options) {
138109
+ legacyMasterTextStyles(slides, options, masterPath) {
138068
138110
  const layoutPath = slides[0]?.layoutPath;
138069
- const masterPath = (layoutPath ? this.resolveMasterPathForLayout(layoutPath) : void 0) ?? this.masterTxStylesCache.keys().next().value;
138070
- if (!masterPath) {
138111
+ const path = (masterPath && this.masterTxStylesCache.has(masterPath) ? masterPath : void 0) ?? (layoutPath ? this.resolveMasterPathForLayout(layoutPath) : void 0) ?? this.masterTxStylesCache.keys().next().value;
138112
+ if (!path) {
138071
138113
  return void 0;
138072
138114
  }
138073
- const edited = options?.slideMasters?.find((master) => master.path === masterPath)?.txStyles;
138074
- return edited ?? this.masterTxStylesCache.get(masterPath);
138115
+ const edited = options?.slideMasters?.find((master) => master.path === path)?.txStyles;
138116
+ return edited ?? this.masterTxStylesCache.get(path);
138075
138117
  }
138076
138118
  /**
138077
138119
  * Serialise `slides` to a legacy binary PowerPoint 97-2003 (`.ppt`) file.
@@ -138088,7 +138130,7 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
138088
138130
  async saveAsLegacyPpt(slides, options, saveAsPptx) {
138089
138131
  const pptxBytes = saveAsPptx ? await saveAsPptx() : void 0;
138090
138132
  const metroBlobs = await this.resolveMetroBlobs(slides, pptxBytes);
138091
- const master = pptxBytes ? await buildMasterRoundTripFromPptx(pptxBytes) : void 0;
138133
+ const deckMasters = pptxBytes ? await buildDeckMasterRoundTripsFromPptx(pptxBytes) : void 0;
138092
138134
  this.compatibilityService.resetWarnings();
138093
138135
  const resolvedMedia = await this.resolveAudioMediaBytes(slides);
138094
138136
  const resolvedPictures = await resolvePictureSources(
@@ -138105,11 +138147,25 @@ var init_PptxHandlerRuntimeSaveLegacyPpt = __esm({
138105
138147
  metroBlobs,
138106
138148
  resolvedPictures
138107
138149
  );
138108
- deck.masterStyles = convertMasterTextStyles(
138109
- this.legacyMasterTextStyles(slides, options),
138110
- master?.themeFonts
138111
- );
138112
- deck.master = master;
138150
+ if (deckMasters && deckMasters.masterPaths.length > 1) {
138151
+ deck.masters = deckMasters.masters.map((roundTrip, i2) => ({
138152
+ roundTrip,
138153
+ styles: convertMasterTextStyles(
138154
+ this.legacyMasterTextStyles(slides, options, deckMasters.masterPaths[i2]),
138155
+ roundTrip.themeFonts
138156
+ )
138157
+ }));
138158
+ deck.slides.forEach((slide, i2) => {
138159
+ slide.masterIndex = deckMasters.slideMasterIndex[i2];
138160
+ });
138161
+ } else {
138162
+ const master = deckMasters?.masters[0];
138163
+ deck.masterStyles = convertMasterTextStyles(
138164
+ this.legacyMasterTextStyles(slides, options, deckMasters?.masterPaths[0]),
138165
+ master?.themeFonts
138166
+ );
138167
+ deck.master = master;
138168
+ }
138113
138169
  return buildPptFile(deck, { password: options?.pptPassword });
138114
138170
  }
138115
138171
  };
@@ -151623,7 +151679,7 @@ function readPersistRecord(view, directory, persistId) {
151623
151679
  return readRecordOrThrow(view, offset);
151624
151680
  }
151625
151681
  var init_persist_directory = __esm({
151626
- "../../node_modules/.bun/@christophervr+ole2@0.2.0/node_modules/@christophervr/ole2/dist/ppt/persist-directory.js"() {
151682
+ "../../node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ppt/persist-directory.js"() {
151627
151683
  init_record_stream();
151628
151684
  init_record_types();
151629
151685
  }