pptx-react-viewer 2.16.9 → 2.17.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 (127) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-EPMBL6EA.js → AiChatPanel-HCHCVQN2.js} +24 -24
  3. package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
  4. package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
  5. package/dist/{AiChatPanel-XHKYPYPH.mjs → AiChatPanel-RZ4A7P4H.mjs} +4 -4
  6. package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
  7. package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
  8. package/dist/{Model3DScene-YMIAGRPG.mjs → Model3DScene-I7FR74AD.mjs} +1 -1
  9. package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
  10. package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
  11. package/dist/{Model3DScene-DUJOZA2B.js → Model3DScene-LK7LSQNH.js} +2 -2
  12. package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
  13. package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
  14. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +1 -1
  15. package/dist/{SurfaceChart3DScene-Q47OEJXS.mjs → SurfaceChart3DScene-DEQP5O3U.mjs} +1 -1
  16. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
  17. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
  18. package/dist/{SurfaceChart3DScene-TNCHWQAK.js → SurfaceChart3DScene-ODQY77SZ.js} +2 -2
  19. package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
  20. package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
  21. package/dist/{chunk-3KIKPDAJ.mjs → chunk-422DF424.mjs} +742 -2294
  22. package/dist/chunk-422DF424.mjs.br +0 -0
  23. package/dist/chunk-422DF424.mjs.gz +0 -0
  24. package/dist/{chunk-WK22Z7PK.js → chunk-5BXATG54.js} +520 -868
  25. package/dist/chunk-5BXATG54.js.br +0 -0
  26. package/dist/chunk-5BXATG54.js.gz +0 -0
  27. package/dist/{chunk-Y2KIB3QH.js → chunk-7JPLVECA.js} +44829 -39322
  28. package/dist/chunk-7JPLVECA.js.br +0 -0
  29. package/dist/chunk-7JPLVECA.js.gz +0 -0
  30. package/dist/{chunk-DVZF4ARG.js → chunk-AONFHTTJ.js} +22 -0
  31. package/dist/chunk-AONFHTTJ.js.br +0 -0
  32. package/dist/chunk-AONFHTTJ.js.gz +0 -0
  33. package/dist/{chunk-PI5SFTDC.js → chunk-ATOUVRRQ.js} +3 -3
  34. package/dist/chunk-ATOUVRRQ.js.br +0 -0
  35. package/dist/chunk-ATOUVRRQ.js.gz +0 -0
  36. package/dist/{chunk-EL2YF26P.mjs → chunk-FXJOTEPO.mjs} +1 -1
  37. package/dist/chunk-FXJOTEPO.mjs.br +0 -0
  38. package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
  39. package/dist/{chunk-YWKUIUQX.mjs → chunk-K2QU73KB.mjs} +44784 -39286
  40. package/dist/chunk-K2QU73KB.mjs.br +0 -0
  41. package/dist/chunk-K2QU73KB.mjs.gz +0 -0
  42. package/dist/{chunk-VHME5BE6.mjs → chunk-MQHC5TXI.mjs} +318 -665
  43. package/dist/chunk-MQHC5TXI.mjs.br +0 -0
  44. package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
  45. package/dist/{chunk-VL7ZT3ID.js → chunk-NQJPPIVH.js} +1681 -3233
  46. package/dist/chunk-NQJPPIVH.js.br +0 -0
  47. package/dist/chunk-NQJPPIVH.js.gz +0 -0
  48. package/dist/{chunk-5IUEPQTK.mjs → chunk-S64T7C4V.mjs} +22 -0
  49. package/dist/chunk-S64T7C4V.mjs.br +0 -0
  50. package/dist/chunk-S64T7C4V.mjs.gz +0 -0
  51. package/dist/{chunk-FSVE6WUY.js → chunk-TCGXGD6E.js} +550 -463
  52. package/dist/chunk-TCGXGD6E.js.br +0 -0
  53. package/dist/chunk-TCGXGD6E.js.gz +0 -0
  54. package/dist/{chunk-J7EFC3GS.mjs → chunk-ZA5JONCW.mjs} +210 -123
  55. package/dist/chunk-ZA5JONCW.mjs.br +0 -0
  56. package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
  57. package/dist/i18n.js +4 -4
  58. package/dist/i18n.js.br +0 -0
  59. package/dist/i18n.js.gz +0 -0
  60. package/dist/i18n.mjs +1 -1
  61. package/dist/i18n.mjs.br +0 -0
  62. package/dist/i18n.mjs.gz +0 -0
  63. package/dist/index.d.ts +205 -21
  64. package/dist/index.js +41 -41
  65. package/dist/index.js.br +0 -0
  66. package/dist/index.js.gz +0 -0
  67. package/dist/index.mjs +6 -6
  68. package/dist/index.mjs.br +0 -0
  69. package/dist/index.mjs.gz +0 -0
  70. package/dist/internals.d.ts +380 -22
  71. package/dist/internals.d.ts.map +1 -1
  72. package/dist/internals.js +79 -79
  73. package/dist/internals.js.br +0 -0
  74. package/dist/internals.js.gz +0 -0
  75. package/dist/internals.mjs +4 -4
  76. package/dist/internals.mjs.br +0 -0
  77. package/dist/internals.mjs.gz +0 -0
  78. package/dist/pptx-viewer.css +1 -1
  79. package/dist/pptx-viewer.css.br +0 -0
  80. package/dist/pptx-viewer.css.gz +0 -0
  81. package/dist/{useViewerBuildingBlocks-Xddn6SFj.d.ts → useViewerBuildingBlocks-C9-prKYB.d.ts} +32 -6
  82. package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +1 -0
  83. package/dist/viewer/index.d.ts +166 -17
  84. package/dist/viewer/index.js +27 -27
  85. package/dist/viewer/index.js.br +0 -0
  86. package/dist/viewer/index.js.gz +0 -0
  87. package/dist/viewer/index.mjs +6 -6
  88. package/dist/viewer/index.mjs.br +0 -0
  89. package/dist/viewer/index.mjs.gz +0 -0
  90. package/package.json +1 -1
  91. package/dist/AiChatPanel-EPMBL6EA.js.br +0 -0
  92. package/dist/AiChatPanel-EPMBL6EA.js.gz +0 -0
  93. package/dist/AiChatPanel-XHKYPYPH.mjs.br +0 -0
  94. package/dist/AiChatPanel-XHKYPYPH.mjs.gz +0 -0
  95. package/dist/Model3DScene-DUJOZA2B.js.br +0 -0
  96. package/dist/Model3DScene-DUJOZA2B.js.gz +0 -0
  97. package/dist/Model3DScene-YMIAGRPG.mjs.br +0 -0
  98. package/dist/Model3DScene-YMIAGRPG.mjs.gz +0 -0
  99. package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.br +0 -0
  100. package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.gz +0 -0
  101. package/dist/SurfaceChart3DScene-TNCHWQAK.js.br +0 -0
  102. package/dist/SurfaceChart3DScene-TNCHWQAK.js.gz +0 -0
  103. package/dist/chunk-3KIKPDAJ.mjs.br +0 -0
  104. package/dist/chunk-3KIKPDAJ.mjs.gz +0 -0
  105. package/dist/chunk-5IUEPQTK.mjs.br +0 -0
  106. package/dist/chunk-5IUEPQTK.mjs.gz +0 -0
  107. package/dist/chunk-DVZF4ARG.js.br +0 -0
  108. package/dist/chunk-DVZF4ARG.js.gz +0 -0
  109. package/dist/chunk-EL2YF26P.mjs.br +0 -0
  110. package/dist/chunk-EL2YF26P.mjs.gz +0 -0
  111. package/dist/chunk-FSVE6WUY.js.br +0 -0
  112. package/dist/chunk-FSVE6WUY.js.gz +0 -0
  113. package/dist/chunk-J7EFC3GS.mjs.br +0 -0
  114. package/dist/chunk-J7EFC3GS.mjs.gz +0 -0
  115. package/dist/chunk-PI5SFTDC.js.br +0 -0
  116. package/dist/chunk-PI5SFTDC.js.gz +0 -0
  117. package/dist/chunk-VHME5BE6.mjs.br +0 -0
  118. package/dist/chunk-VHME5BE6.mjs.gz +0 -0
  119. package/dist/chunk-VL7ZT3ID.js.br +0 -0
  120. package/dist/chunk-VL7ZT3ID.js.gz +0 -0
  121. package/dist/chunk-WK22Z7PK.js.br +0 -0
  122. package/dist/chunk-WK22Z7PK.js.gz +0 -0
  123. package/dist/chunk-Y2KIB3QH.js.br +0 -0
  124. package/dist/chunk-Y2KIB3QH.js.gz +0 -0
  125. package/dist/chunk-YWKUIUQX.mjs.br +0 -0
  126. package/dist/chunk-YWKUIUQX.mjs.gz +0 -0
  127. package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkWK22Z7PK_js = require('./chunk-WK22Z7PK.js');
4
- var chunkDVZF4ARG_js = require('./chunk-DVZF4ARG.js');
5
- var chunkY2KIB3QH_js = require('./chunk-Y2KIB3QH.js');
3
+ var chunk5BXATG54_js = require('./chunk-5BXATG54.js');
4
+ var chunkAONFHTTJ_js = require('./chunk-AONFHTTJ.js');
5
+ var chunk7JPLVECA_js = require('./chunk-7JPLVECA.js');
6
6
  var react = require('react');
7
7
  var JSZip = require('jszip');
8
8
  var reactI18next = require('react-i18next');
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
14
14
  function useVirtualizedSlides({
15
15
  totalItems,
16
16
  itemHeight,
17
- overscan = chunkY2KIB3QH_js.DEFAULT_VIRTUAL_OVERSCAN
17
+ overscan = chunk7JPLVECA_js.DEFAULT_VIRTUAL_OVERSCAN
18
18
  }) {
19
19
  const scrollContainerRef = react.useRef(null);
20
20
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
44
44
  resizeObserver?.disconnect();
45
45
  };
46
46
  }, []);
47
- const range = chunkY2KIB3QH_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
47
+ const range = chunk7JPLVECA_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
48
48
  const safeItemHeight = Math.max(itemHeight, 1);
49
49
  const scrollToIndex = react.useCallback(
50
50
  (index, behavior = "smooth") => {
@@ -85,7 +85,7 @@ function usePresenceTracking({
85
85
  }) {
86
86
  const [remoteUsers, setRemoteUsers] = react.useState([]);
87
87
  const projectorRef = react.useRef(null);
88
- projectorRef.current ??= chunkY2KIB3QH_js.createPresenceProjector();
88
+ projectorRef.current ??= chunk7JPLVECA_js.createPresenceProjector();
89
89
  const projector = projectorRef.current;
90
90
  const lastBroadcastRef = react.useRef(0);
91
91
  const pendingBroadcastRef = react.useRef(null);
@@ -110,7 +110,7 @@ function usePresenceTracking({
110
110
  awareness.setLocalStateField("presence", state);
111
111
  lastBroadcastRef.current = Date.now();
112
112
  };
113
- if (elapsed >= chunkY2KIB3QH_js.BROADCAST_THROTTLE_MS) {
113
+ if (elapsed >= chunk7JPLVECA_js.BROADCAST_THROTTLE_MS) {
114
114
  if (pendingBroadcastRef.current) {
115
115
  clearTimeout(pendingBroadcastRef.current);
116
116
  pendingBroadcastRef.current = null;
@@ -120,7 +120,7 @@ function usePresenceTracking({
120
120
  pendingBroadcastRef.current = setTimeout(() => {
121
121
  pendingBroadcastRef.current = null;
122
122
  flush();
123
- }, chunkY2KIB3QH_js.BROADCAST_THROTTLE_MS - elapsed);
123
+ }, chunk7JPLVECA_js.BROADCAST_THROTTLE_MS - elapsed);
124
124
  }
125
125
  },
126
126
  [awareness, userName, userColor, userAvatar, role]
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
200
200
  const departureRef = react.useRef(null);
201
201
  const gateRef = react.useRef(null);
202
202
  if (!gateRef.current) {
203
- gateRef.current = chunkY2KIB3QH_js.createSyncGate(() => setSynced(true));
203
+ gateRef.current = chunk7JPLVECA_js.createSyncGate(() => setSynced(true));
204
204
  }
205
205
  const teardown = react.useCallback(() => {
206
206
  if (timeoutRef.current) {
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
220
220
  const buildCleanup = react.useCallback(
221
221
  (provider, yDoc) => () => {
222
222
  announceDeparture();
223
- chunkY2KIB3QH_js.clearLocalAwareness(provider.awareness);
223
+ chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
224
224
  provider.destroy();
225
225
  yDoc.destroy();
226
226
  setDoc(null);
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
245
245
  if (config.authToken) {
246
246
  opts.password = config.authToken;
247
247
  }
248
- const roomId = chunkY2KIB3QH_js.validateRoomId(config.roomId);
248
+ const roomId = chunk7JPLVECA_js.validateRoomId(config.roomId);
249
249
  const provider = new WebrtcProvider(roomId, yDoc, opts);
250
- departureRef.current = chunkY2KIB3QH_js.createDepartureChannel(roomId, provider.awareness);
250
+ departureRef.current = chunk7JPLVECA_js.createDepartureChannel(roomId, provider.awareness);
251
251
  setDoc(yDoc);
252
252
  setAwareness(provider.awareness);
253
253
  setClientId(provider.awareness.clientID);
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
289
289
  if (!config) {
290
290
  return;
291
291
  }
292
- const roomId = chunkY2KIB3QH_js.validateRoomId(config.roomId);
293
- const transport = config.transport ?? chunkY2KIB3QH_js.resolveTransportForServerUrl(config.serverUrl);
292
+ const roomId = chunk7JPLVECA_js.validateRoomId(config.roomId);
293
+ const transport = config.transport ?? chunk7JPLVECA_js.resolveTransportForServerUrl(config.serverUrl);
294
294
  if (transport === "webrtc") {
295
295
  await initWebrtc();
296
296
  return;
297
297
  }
298
- if (chunkY2KIB3QH_js.isMixedContentBlocked(config.serverUrl)) {
298
+ if (chunk7JPLVECA_js.isMixedContentBlocked(config.serverUrl)) {
299
299
  console.warn(
300
300
  `[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
301
301
  );
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
309
309
  const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
310
310
  params: config.authToken ? { token: config.authToken } : void 0
311
311
  });
312
- departureRef.current = chunkY2KIB3QH_js.createDepartureChannel(roomId, provider.awareness);
312
+ departureRef.current = chunk7JPLVECA_js.createDepartureChannel(roomId, provider.awareness);
313
313
  let connected = false;
314
314
  const handleStatus = (event) => {
315
315
  if (event.status === "connected") {
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
349
349
  provider.off("status", handleStatus);
350
350
  provider.off("sync", handleSynced);
351
351
  announceDeparture();
352
- chunkY2KIB3QH_js.clearLocalAwareness(provider.awareness);
352
+ chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
353
353
  provider.destroy();
354
354
  yDoc.destroy();
355
355
  setDoc(null);
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
358
358
  cleanupRef.current = null;
359
359
  setStatus("error");
360
360
  }
361
- }, chunkY2KIB3QH_js.CONNECTION_TIMEOUT_MS);
361
+ }, chunk7JPLVECA_js.CONNECTION_TIMEOUT_MS);
362
362
  }
363
363
  setDoc(yDoc);
364
364
  setAwareness(provider.awareness);
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
367
367
  provider.off("status", handleStatus);
368
368
  provider.off("sync", handleSynced);
369
369
  announceDeparture();
370
- chunkY2KIB3QH_js.clearLocalAwareness(provider.awareness);
370
+ chunk7JPLVECA_js.clearLocalAwareness(provider.awareness);
371
371
  provider.destroy();
372
372
  yDoc.destroy();
373
373
  setDoc(null);
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
393
393
  ]);
394
394
  react.useEffect(() => {
395
395
  init();
396
- const disposeTeardown = chunkY2KIB3QH_js.registerCollaborationTeardown({
396
+ const disposeTeardown = chunk7JPLVECA_js.registerCollaborationTeardown({
397
397
  leave: teardown,
398
398
  rejoin: init
399
399
  });
@@ -414,7 +414,7 @@ function useCollaborativeState({
414
414
  canvasWidth,
415
415
  canvasHeight
416
416
  }) {
417
- const userColor = chunkY2KIB3QH_js.sanitizeColor(config?.userColor, "#6366f1");
417
+ const userColor = chunk7JPLVECA_js.sanitizeColor(config?.userColor, "#6366f1");
418
418
  const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
419
419
  const { remoteUsers, broadcastPresence } = usePresenceTracking({
420
420
  awareness,
@@ -490,6 +490,7 @@ function useEditorHistory(input) {
490
490
  maxHistoryEntries = DEFAULT_MAX_HISTORY_ENTRIES,
491
491
  hasActivePointerInteraction,
492
492
  pointerCommitNonce,
493
+ onDirty,
493
494
  setSlides,
494
495
  setCanvasSize,
495
496
  setActiveSlideIndex,
@@ -523,8 +524,8 @@ function useEditorHistory(input) {
523
524
  width: canvasSize.width,
524
525
  height: canvasSize.height,
525
526
  activeSlideIndex,
526
- slides: slides.map(chunkY2KIB3QH_js.cloneSlide),
527
- templateElementsBySlideId: chunkY2KIB3QH_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
527
+ slides: slides.map(chunk7JPLVECA_js.cloneSlide),
528
+ templateElementsBySlideId: chunk7JPLVECA_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
528
529
  ...actionLabel ? { actionLabel } : {}
529
530
  };
530
531
  },
@@ -537,9 +538,9 @@ function useEditorHistory(input) {
537
538
  width: snapshot.width,
538
539
  height: snapshot.height
539
540
  });
540
- setSlides(snapshot.slides.map(chunkY2KIB3QH_js.cloneSlide));
541
+ setSlides(snapshot.slides.map(chunk7JPLVECA_js.cloneSlide));
541
542
  setTemplateElementsBySlideId(
542
- chunkY2KIB3QH_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
543
+ chunk7JPLVECA_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
543
544
  );
544
545
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
545
546
  setSelectedElementIds([]);
@@ -562,8 +563,13 @@ function useEditorHistory(input) {
562
563
  isApplyingHistoryRef.current = false;
563
564
  }, 0);
564
565
  }, []);
566
+ const onDirtyRef = react.useRef(onDirty);
567
+ react.useEffect(() => {
568
+ onDirtyRef.current = onDirty;
569
+ }, [onDirty]);
565
570
  const markDirty = react.useCallback(() => {
566
571
  setEditCommitNonce((previous) => previous + 1);
572
+ onDirtyRef.current?.();
567
573
  }, []);
568
574
  const handleUndo = react.useCallback(() => {
569
575
  const previousSnapshot = historyPastRef.current.pop();
@@ -573,8 +579,8 @@ function useEditorHistory(input) {
573
579
  const currentSnapshot = buildHistorySnapshot();
574
580
  historyFutureRef.current.push(currentSnapshot);
575
581
  isApplyingHistoryRef.current = true;
576
- const nextSnapshot = chunkWK22Z7PK_js.cloneHistorySnapshot(previousSnapshot);
577
- lastHistorySnapshotRef.current = chunkWK22Z7PK_js.cloneHistorySnapshot(nextSnapshot);
582
+ const nextSnapshot = chunk5BXATG54_js.cloneHistorySnapshot(previousSnapshot);
583
+ lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(nextSnapshot);
578
584
  lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
579
585
  applyHistorySnapshot(nextSnapshot);
580
586
  updateHistoryAvailability();
@@ -595,8 +601,8 @@ function useEditorHistory(input) {
595
601
  const currentSnapshot = buildHistorySnapshot();
596
602
  historyPastRef.current.push(currentSnapshot);
597
603
  isApplyingHistoryRef.current = true;
598
- const targetSnapshot = chunkWK22Z7PK_js.cloneHistorySnapshot(nextSnapshot);
599
- lastHistorySnapshotRef.current = chunkWK22Z7PK_js.cloneHistorySnapshot(targetSnapshot);
604
+ const targetSnapshot = chunk5BXATG54_js.cloneHistorySnapshot(nextSnapshot);
605
+ lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(targetSnapshot);
600
606
  lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
601
607
  applyHistorySnapshot(targetSnapshot);
602
608
  updateHistoryAvailability();
@@ -614,7 +620,7 @@ function useEditorHistory(input) {
614
620
  historyPastRef.current = [];
615
621
  historyFutureRef.current = [];
616
622
  if (initialSnapshot) {
617
- const clonedInitial = chunkWK22Z7PK_js.cloneHistorySnapshot(initialSnapshot);
623
+ const clonedInitial = chunk5BXATG54_js.cloneHistorySnapshot(initialSnapshot);
618
624
  lastHistorySnapshotRef.current = clonedInitial;
619
625
  lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
620
626
  } else {
@@ -655,18 +661,19 @@ function useEditorHistory(input) {
655
661
  }
656
662
  const previousSnapshot = lastHistorySnapshotRef.current;
657
663
  if (!previousSnapshot) {
658
- lastHistorySnapshotRef.current = chunkWK22Z7PK_js.cloneHistorySnapshot(snapshot);
664
+ lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(snapshot);
659
665
  lastHistorySerializedRef.current = serialized;
660
666
  lastCheapHashRef.current = cheapHash;
661
667
  updateHistoryAvailability();
662
668
  return;
663
669
  }
664
- historyPastRef.current.push(chunkWK22Z7PK_js.cloneHistorySnapshot(previousSnapshot));
670
+ onDirtyRef.current?.();
671
+ historyPastRef.current.push(chunk5BXATG54_js.cloneHistorySnapshot(previousSnapshot));
665
672
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
666
673
  historyPastRef.current.shift();
667
674
  }
668
675
  historyFutureRef.current = [];
669
- lastHistorySnapshotRef.current = chunkWK22Z7PK_js.cloneHistorySnapshot(snapshot);
676
+ lastHistorySnapshotRef.current = chunk5BXATG54_js.cloneHistorySnapshot(snapshot);
670
677
  lastHistorySerializedRef.current = serialized;
671
678
  lastCheapHashRef.current = cheapHash;
672
679
  updateHistoryAvailability();
@@ -726,9 +733,9 @@ function useZoomViewport({
726
733
  const canvasStageRef = react.useRef(null);
727
734
  const canvasViewportRef = react.useRef(null);
728
735
  const renderScaleRef = react.useRef(1);
729
- const wheelBufferRef = react.useRef(chunkY2KIB3QH_js.createWheelStepBuffer());
736
+ const wheelBufferRef = react.useRef(chunk7JPLVECA_js.createWheelStepBuffer());
730
737
  const storeRef = react.useRef(null);
731
- storeRef.current ??= chunkY2KIB3QH_js.createViewerZoomStore();
738
+ storeRef.current ??= chunk7JPLVECA_js.createViewerZoomStore();
732
739
  const store = storeRef.current;
733
740
  const scale = useViewerStore(store, selectZoom);
734
741
  const setScale = react.useCallback(
@@ -789,7 +796,7 @@ function useZoomViewport({
789
796
  if (!wrapper || !canvasViewport) {
790
797
  return;
791
798
  }
792
- const boundedScale = chunkY2KIB3QH_js.clampZoomScale(nextScale);
799
+ const boundedScale = chunk7JPLVECA_js.clampZoomScale(nextScale);
793
800
  const nextEditorScale = fitScale * boundedScale;
794
801
  const centerX = (bounds.minX + bounds.maxX) / 2;
795
802
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -826,29 +833,29 @@ function useZoomViewport({
826
833
  selectedElements.forEach((element) => {
827
834
  minX = Math.min(minX, element.x);
828
835
  minY = Math.min(minY, element.y);
829
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE));
830
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE));
836
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE));
837
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE));
831
838
  });
832
839
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
833
840
  return;
834
841
  }
835
842
  const selectionBounds = { minX, minY, maxX, maxY };
836
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE);
837
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE);
843
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
844
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
838
845
  const availableWidth = Math.max(
839
- effectiveEditorDimensions.width - chunkWK22Z7PK_js.ZOOM_TO_SELECTION_PADDING,
840
- chunkWK22Z7PK_js.MIN_ELEMENT_SIZE
846
+ effectiveEditorDimensions.width - chunk5BXATG54_js.ZOOM_TO_SELECTION_PADDING,
847
+ chunk5BXATG54_js.MIN_ELEMENT_SIZE
841
848
  );
842
849
  const availableHeight = Math.max(
843
- effectiveEditorDimensions.height - chunkWK22Z7PK_js.ZOOM_TO_SELECTION_PADDING,
844
- chunkWK22Z7PK_js.MIN_ELEMENT_SIZE
850
+ effectiveEditorDimensions.height - chunk5BXATG54_js.ZOOM_TO_SELECTION_PADDING,
851
+ chunk5BXATG54_js.MIN_ELEMENT_SIZE
845
852
  );
846
853
  const targetEditorScale = Math.min(
847
854
  availableWidth / boundsWidth,
848
855
  availableHeight / boundsHeight
849
856
  );
850
857
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
851
- const nextScale = chunkY2KIB3QH_js.clampZoomScale(targetEditorScale / safeFitScale);
858
+ const nextScale = chunk7JPLVECA_js.clampZoomScale(targetEditorScale / safeFitScale);
852
859
  setScale(nextScale);
853
860
  window.requestAnimationFrame(() => {
854
861
  window.requestAnimationFrame(() => {
@@ -865,14 +872,14 @@ function useZoomViewport({
865
872
  ]);
866
873
  const handleWheel = react.useCallback(
867
874
  (event) => {
868
- const mapped = chunkY2KIB3QH_js.mapEditingWheel(event, wheelBufferRef.current, true);
875
+ const mapped = chunk7JPLVECA_js.mapEditingWheel(event, wheelBufferRef.current, true);
869
876
  if (mapped.intent !== "zoom") {
870
877
  return;
871
878
  }
872
879
  event.preventDefault();
873
880
  store.dispatch({
874
881
  type: "set-zoom",
875
- zoom: chunkY2KIB3QH_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
882
+ zoom: chunk7JPLVECA_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
876
883
  });
877
884
  },
878
885
  [store]
@@ -960,7 +967,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
960
967
  const command = step.command;
961
968
  const timer = window.setTimeout(
962
969
  () => {
963
- chunkWK22Z7PK_js.executeMediaCommand(command);
970
+ chunk5BXATG54_js.executeMediaCommand(command);
964
971
  },
965
972
  Math.max(0, step.delayMs)
966
973
  );
@@ -1097,7 +1104,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1097
1104
  }))
1098
1105
  );
1099
1106
  entranceAnimations.forEach((animation, animationIndex) => {
1100
- const delay = chunkY2KIB3QH_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1107
+ const delay = chunk7JPLVECA_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1101
1108
  const timer = window.setTimeout(() => {
1102
1109
  setPresentationAnimations(
1103
1110
  (previousAnimations) => previousAnimations.map(
@@ -1129,7 +1136,7 @@ function useAnimationPlayback(input) {
1129
1136
  (controller, group) => {
1130
1137
  driveBuildReveal(
1131
1138
  controller,
1132
- chunkY2KIB3QH_js.PresentationAnimationController.collectBuildStepIds(group),
1139
+ chunk7JPLVECA_js.PresentationAnimationController.collectBuildStepIds(group),
1133
1140
  setPresentationElementStates,
1134
1141
  buildRafRef
1135
1142
  );
@@ -1192,7 +1199,7 @@ function useAnimationPlayback(input) {
1192
1199
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1193
1200
  return;
1194
1201
  }
1195
- const controller = chunkY2KIB3QH_js.PresentationAnimationController.fromSlide(slide);
1202
+ const controller = chunk7JPLVECA_js.PresentationAnimationController.fromSlide(slide);
1196
1203
  controllerRef.current = controller;
1197
1204
  setPresentationKeyframesCss(controller.keyframesCss);
1198
1205
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1350,12 +1357,12 @@ function useAnimationPlayback(input) {
1350
1357
  presentationTimersRef
1351
1358
  };
1352
1359
  }
1353
- var PRESENTER_CHANNEL_NAME = chunkY2KIB3QH_js.PRESENTATION_CHANNEL_NAME;
1354
- var AUDIENCE_HASH = chunkY2KIB3QH_js.PRESENTATION_HASH;
1355
- var PRESENTER_MSG_ORIGIN = chunkY2KIB3QH_js.PRESENTATION_MESSAGE_ORIGIN;
1356
- var AUDIENCE_NONCE_KEY = chunkY2KIB3QH_js.PRESENTATION_NONCE_KEY;
1360
+ var PRESENTER_CHANNEL_NAME = chunk7JPLVECA_js.PRESENTATION_CHANNEL_NAME;
1361
+ var AUDIENCE_HASH = chunk7JPLVECA_js.PRESENTATION_HASH;
1362
+ var PRESENTER_MSG_ORIGIN = chunk7JPLVECA_js.PRESENTATION_MESSAGE_ORIGIN;
1363
+ var AUDIENCE_NONCE_KEY = chunk7JPLVECA_js.PRESENTATION_NONCE_KEY;
1357
1364
  function generateSessionId() {
1358
- return chunkY2KIB3QH_js.createPresentationSessionId();
1365
+ return chunk7JPLVECA_js.createPresentationSessionId();
1359
1366
  }
1360
1367
  function parseAudienceNonce() {
1361
1368
  const hash = window.location.hash;
@@ -1391,7 +1398,7 @@ function usePresenterWindow(input) {
1391
1398
  }, []);
1392
1399
  const swapDisplays = react.useCallback(async () => {
1393
1400
  const audience = audienceWindowRef.current;
1394
- return audience && !audience.closed ? chunkY2KIB3QH_js.swapPresentationWindows(window, audience) : false;
1401
+ return audience && !audience.closed ? chunk7JPLVECA_js.swapPresentationWindows(window, audience) : false;
1395
1402
  }, []);
1396
1403
  const syncSlideToAudience = react.useCallback(
1397
1404
  (slideIndex) => {
@@ -1455,7 +1462,7 @@ function usePresenterWindow(input) {
1455
1462
  pollTimerRef.current = null;
1456
1463
  }
1457
1464
  if (closingSessionId) {
1458
- void chunkY2KIB3QH_js.clearAudienceContent(closingSessionId);
1465
+ void chunk7JPLVECA_js.clearAudienceContent(closingSessionId);
1459
1466
  }
1460
1467
  }, [getChannel]);
1461
1468
  const openAudienceWindow = react.useCallback(() => {
@@ -1473,10 +1480,10 @@ function usePresenterWindow(input) {
1473
1480
  audienceWindowRef.current = blankWin;
1474
1481
  const sessionId = generateSessionId();
1475
1482
  sessionIdRef.current = sessionId;
1476
- const audienceUrl = chunkY2KIB3QH_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1477
- void chunkY2KIB3QH_js.resolveAudienceScreenPlacement(window).then((placement) => {
1483
+ const audienceUrl = chunk7JPLVECA_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1484
+ void chunk7JPLVECA_js.resolveAudienceScreenPlacement(window).then((placement) => {
1478
1485
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1479
- chunkY2KIB3QH_js.placeAudienceWindow(blankWin, placement);
1486
+ chunk7JPLVECA_js.placeAudienceWindow(blankWin, placement);
1480
1487
  }
1481
1488
  return void 0;
1482
1489
  });
@@ -1506,7 +1513,7 @@ function usePresenterWindow(input) {
1506
1513
  }
1507
1514
  };
1508
1515
  if (content) {
1509
- void chunkY2KIB3QH_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1516
+ void chunk7JPLVECA_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1510
1517
  } else {
1511
1518
  navigateOrClose(true);
1512
1519
  }
@@ -1532,7 +1539,7 @@ function usePresenterWindow(input) {
1532
1539
  }
1533
1540
  const handleMessage = (event) => {
1534
1541
  const message = event.data;
1535
- if (chunkY2KIB3QH_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1542
+ if (chunk7JPLVECA_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1536
1543
  syncStateToAudience(snapshotRef.current);
1537
1544
  }
1538
1545
  };
@@ -1561,7 +1568,7 @@ function usePresenterWindow(input) {
1561
1568
  react.useEffect(() => {
1562
1569
  const handleBeforeUnload = () => {
1563
1570
  if (sessionIdRef.current) {
1564
- void chunkY2KIB3QH_js.clearAudienceContent(sessionIdRef.current);
1571
+ void chunk7JPLVECA_js.clearAudienceContent(sessionIdRef.current);
1565
1572
  }
1566
1573
  };
1567
1574
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1623,7 +1630,7 @@ function useAudienceMode(input) {
1623
1630
  }
1624
1631
  channel.onmessage = (event) => {
1625
1632
  const data = event.data;
1626
- if (!chunkY2KIB3QH_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1633
+ if (!chunk7JPLVECA_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1627
1634
  return;
1628
1635
  }
1629
1636
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1639,16 +1646,16 @@ function useAudienceMode(input) {
1639
1646
  }
1640
1647
  if (data.type === "presenter-exit") {
1641
1648
  if (expectedSessionId) {
1642
- void chunkY2KIB3QH_js.clearAudienceContent(expectedSessionId);
1649
+ void chunk7JPLVECA_js.clearAudienceContent(expectedSessionId);
1643
1650
  }
1644
- if (chunkY2KIB3QH_js.endAudienceDisplay(window)) {
1651
+ if (chunk7JPLVECA_js.endAudienceDisplay(window)) {
1645
1652
  handlers.onPresenterEnded?.();
1646
1653
  }
1647
1654
  }
1648
1655
  };
1649
1656
  if (expectedSessionId) {
1650
1657
  channel.postMessage({
1651
- origin: chunkY2KIB3QH_js.PRESENTATION_MESSAGE_ORIGIN,
1658
+ origin: chunk7JPLVECA_js.PRESENTATION_MESSAGE_ORIGIN,
1652
1659
  type: "audience-ready",
1653
1660
  sessionId: expectedSessionId
1654
1661
  });
@@ -1662,7 +1669,7 @@ function useAudienceMode(input) {
1662
1669
  }, []);
1663
1670
  }
1664
1671
  function usePresentationKeyboard(input) {
1665
- const wheelBufferRef = react.useRef(chunkY2KIB3QH_js.createWheelStepBuffer());
1672
+ const wheelBufferRef = react.useRef(chunk7JPLVECA_js.createWheelStepBuffer());
1666
1673
  const {
1667
1674
  mode,
1668
1675
  movePresentationSlide,
@@ -1682,14 +1689,14 @@ function usePresentationKeyboard(input) {
1682
1689
  presentationSlideIndex,
1683
1690
  setShowRehearsalSummary
1684
1691
  } = input;
1685
- const keyBufferRef = react.useRef(chunkY2KIB3QH_js.createPresentationKeyBuffer());
1692
+ const keyBufferRef = react.useRef(chunk7JPLVECA_js.createPresentationKeyBuffer());
1686
1693
  react.useEffect(() => {
1687
- if (mode !== "present" || !chunkY2KIB3QH_js.acceptsPresentationInput()) {
1688
- keyBufferRef.current = chunkY2KIB3QH_js.createPresentationKeyBuffer();
1694
+ if (mode !== "present" || !chunk7JPLVECA_js.acceptsPresentationInput()) {
1695
+ keyBufferRef.current = chunk7JPLVECA_js.createPresentationKeyBuffer();
1689
1696
  return;
1690
1697
  }
1691
1698
  const handleKeyDown = (event) => {
1692
- const mapped = chunkY2KIB3QH_js.mapPresentationKey(event, keyBufferRef.current);
1699
+ const mapped = chunk7JPLVECA_js.mapPresentationKey(event, keyBufferRef.current);
1693
1700
  if (mapped.action === "none") {
1694
1701
  return;
1695
1702
  }
@@ -1709,12 +1716,12 @@ function usePresentationKeyboard(input) {
1709
1716
  movePresentationSlide(-1);
1710
1717
  return;
1711
1718
  case "first": {
1712
- const first = chunkY2KIB3QH_js.firstShowSlideIndex(showSlideIndexes);
1719
+ const first = chunk7JPLVECA_js.firstShowSlideIndex(showSlideIndexes);
1713
1720
  navigateToSlide(first ?? 0);
1714
1721
  return;
1715
1722
  }
1716
1723
  case "last": {
1717
- const last = chunkY2KIB3QH_js.lastShowSlideIndex(showSlideIndexes);
1724
+ const last = chunk7JPLVECA_js.lastShowSlideIndex(showSlideIndexes);
1718
1725
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1719
1726
  return;
1720
1727
  }
@@ -1749,10 +1756,10 @@ function usePresentationKeyboard(input) {
1749
1756
  }
1750
1757
  };
1751
1758
  const handleWheel = (event) => {
1752
- if (mode !== "present" || !chunkY2KIB3QH_js.acceptsPresentationInput()) {
1759
+ if (mode !== "present" || !chunk7JPLVECA_js.acceptsPresentationInput()) {
1753
1760
  return;
1754
1761
  }
1755
- const mapped = chunkY2KIB3QH_js.mapPresentationWheel(event, wheelBufferRef.current);
1762
+ const mapped = chunk7JPLVECA_js.mapPresentationWheel(event, wheelBufferRef.current);
1756
1763
  if (mapped.intent === "next-slide") {
1757
1764
  event.preventDefault();
1758
1765
  movePresentationSlide(1);
@@ -1884,7 +1891,7 @@ function useRehearsalTimings(input) {
1884
1891
 
1885
1892
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1886
1893
  function handlePresentationActionImpl(action, deps) {
1887
- chunkY2KIB3QH_js.runPresentationAction(
1894
+ chunk7JPLVECA_js.runPresentationAction(
1888
1895
  action,
1889
1896
  { slideCount: deps.slidesLength },
1890
1897
  {
@@ -1906,7 +1913,7 @@ function handlePresentationActionImpl(action, deps) {
1906
1913
  function executeSlideTransition(nextSlideIndex, deps) {
1907
1914
  const incomingSlide = deps.slides[nextSlideIndex];
1908
1915
  const transition = incomingSlide?.transition;
1909
- const durationMs = deps.playTransition ? chunkY2KIB3QH_js.resolveTransitionDurationMs(transition) : 0;
1916
+ const durationMs = deps.playTransition ? chunk7JPLVECA_js.resolveTransitionDurationMs(transition) : 0;
1910
1917
  deps.clearPresentationTimers();
1911
1918
  deps.setPresentationSlideIndex(nextSlideIndex);
1912
1919
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -1965,7 +1972,7 @@ function useSlideNavigation(input) {
1965
1972
  });
1966
1973
  const scheduleAutoAdvanceForSlide = react.useCallback(
1967
1974
  (slideIndex) => {
1968
- const delayMs = chunkY2KIB3QH_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1975
+ const delayMs = chunk7JPLVECA_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1969
1976
  if (delayMs === void 0) {
1970
1977
  return;
1971
1978
  }
@@ -1988,7 +1995,7 @@ function useSlideNavigation(input) {
1988
1995
  if (availableSlideIndexes.length === 0) {
1989
1996
  return;
1990
1997
  }
1991
- const pastLastSlide = direction === 1 && !chunkY2KIB3QH_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1998
+ const pastLastSlide = direction === 1 && !chunk7JPLVECA_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1992
1999
  if (rehearsing && pastLastSlide) {
1993
2000
  recordCurrentSlideTime(presentationSlideIndex);
1994
2001
  try {
@@ -2006,9 +2013,9 @@ function useSlideNavigation(input) {
2006
2013
  onAdvancePastLastSlide();
2007
2014
  return;
2008
2015
  }
2009
- const nextSlideIndex = direction === 1 ? chunkY2KIB3QH_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2016
+ const nextSlideIndex = direction === 1 ? chunk7JPLVECA_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2010
2017
  loop: Boolean(loopContinuously) && !rehearsing
2011
- }) : chunkY2KIB3QH_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2018
+ }) : chunk7JPLVECA_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2012
2019
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2013
2020
  return;
2014
2021
  }
@@ -2153,22 +2160,22 @@ function useZoomNavigation(input) {
2153
2160
  };
2154
2161
  }
2155
2162
  function usePresenterConsole(slideIndex, active) {
2156
- const timerRef = react.useRef(chunkY2KIB3QH_js.createPresenterTimer());
2157
- const [snapshot, setSnapshot] = react.useState(() => chunkY2KIB3QH_js.createInitialPresentationSnapshot(slideIndex));
2163
+ const timerRef = react.useRef(chunk7JPLVECA_js.createPresenterTimer());
2164
+ const [snapshot, setSnapshot] = react.useState(() => chunk7JPLVECA_js.createInitialPresentationSnapshot(slideIndex));
2158
2165
  const patch = react.useCallback((value) => {
2159
- setSnapshot((current) => chunkY2KIB3QH_js.mergePresentationSnapshot(current, value));
2166
+ setSnapshot((current) => chunk7JPLVECA_js.mergePresentationSnapshot(current, value));
2160
2167
  }, []);
2161
2168
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2162
2169
  react.useEffect(() => {
2163
2170
  if (!active) {
2164
2171
  return;
2165
2172
  }
2166
- timerRef.current = chunkY2KIB3QH_js.resetPresenterTimer();
2173
+ timerRef.current = chunk7JPLVECA_js.resetPresenterTimer();
2167
2174
  patch({ paused: false, elapsedMs: 0 });
2168
2175
  const timer = window.setInterval(() => {
2169
2176
  patch({
2170
2177
  paused: timerRef.current.paused,
2171
- elapsedMs: chunkY2KIB3QH_js.presenterElapsed(timerRef.current)
2178
+ elapsedMs: chunk7JPLVECA_js.presenterElapsed(timerRef.current)
2172
2179
  });
2173
2180
  }, 1e3);
2174
2181
  return () => window.clearInterval(timer);
@@ -2178,19 +2185,19 @@ function usePresenterConsole(slideIndex, active) {
2178
2185
  applyAudienceSnapshot: setSnapshot,
2179
2186
  setBlackout: (blackout) => patch({ blackout }),
2180
2187
  toggleTimer: () => {
2181
- timerRef.current = chunkY2KIB3QH_js.togglePresenterTimer(timerRef.current);
2188
+ timerRef.current = chunk7JPLVECA_js.togglePresenterTimer(timerRef.current);
2182
2189
  patch({
2183
2190
  paused: timerRef.current.paused,
2184
- elapsedMs: chunkY2KIB3QH_js.presenterElapsed(timerRef.current)
2191
+ elapsedMs: chunk7JPLVECA_js.presenterElapsed(timerRef.current)
2185
2192
  });
2186
2193
  },
2187
2194
  resetTimer: () => {
2188
- timerRef.current = chunkY2KIB3QH_js.resetPresenterTimer();
2195
+ timerRef.current = chunk7JPLVECA_js.resetPresenterTimer();
2189
2196
  patch({ paused: false, elapsedMs: 0 });
2190
2197
  },
2191
2198
  stepZoom: (direction) => setSnapshot(
2192
- (current) => chunkY2KIB3QH_js.mergePresentationSnapshot(current, {
2193
- zoom: chunkY2KIB3QH_js.stepPresenterZoom(
2199
+ (current) => chunk7JPLVECA_js.mergePresentationSnapshot(current, {
2200
+ zoom: chunk7JPLVECA_js.stepPresenterZoom(
2194
2201
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2195
2202
  direction
2196
2203
  )
@@ -2235,7 +2242,7 @@ function usePresentationMode(input) {
2235
2242
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2236
2243
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2237
2244
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2238
- const showGuard = react.useMemo(() => chunkY2KIB3QH_js.createPresenterShowGuard(), []);
2245
+ const showGuard = react.useMemo(() => chunk7JPLVECA_js.createPresenterShowGuard(), []);
2239
2246
  const {
2240
2247
  presentationAnimations,
2241
2248
  presentationElementStates,
@@ -2314,7 +2321,7 @@ function usePresentationMode(input) {
2314
2321
  });
2315
2322
  const movePresentationSlide = react.useCallback(
2316
2323
  (direction, trigger = "explicit") => {
2317
- if (!chunkY2KIB3QH_js.acceptsPresentationInput()) {
2324
+ if (!chunk7JPLVECA_js.acceptsPresentationInput()) {
2318
2325
  return;
2319
2326
  }
2320
2327
  if (endOfShowVisible) {
@@ -2451,7 +2458,7 @@ function usePresentationMode(input) {
2451
2458
  if (mode !== "present") {
2452
2459
  return;
2453
2460
  }
2454
- return chunkY2KIB3QH_js.attachPresentationVisibilityPause({
2461
+ return chunk7JPLVECA_js.attachPresentationVisibilityPause({
2455
2462
  root: containerRef.current ?? void 0,
2456
2463
  onHidden: () => clearPresentationTimersRef.current(),
2457
2464
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2531,11 +2538,11 @@ function usePresentationMode(input) {
2531
2538
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2532
2539
  return void 0;
2533
2540
  }
2534
- return chunkY2KIB3QH_js.buildMorphTransitionPlan(
2541
+ return chunk7JPLVECA_js.buildMorphTransitionPlan(
2535
2542
  slides[transitionOverlay.outgoingSlideIndex],
2536
2543
  slides[transitionOverlay.incomingSlideIndex],
2537
2544
  transitionOverlay.durationMs,
2538
- chunkY2KIB3QH_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2545
+ chunk7JPLVECA_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2539
2546
  );
2540
2547
  }, [transitionOverlay, slides]);
2541
2548
  const morphedElementStates = react.useMemo(() => {
@@ -2556,7 +2563,7 @@ function usePresentationMode(input) {
2556
2563
  if (!morphPlan) {
2557
2564
  return presentationKeyframesCss;
2558
2565
  }
2559
- const imageRules = chunkY2KIB3QH_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2566
+ const imageRules = chunk7JPLVECA_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2560
2567
  return `${presentationKeyframesCss ?? ""}
2561
2568
  ${morphPlan.keyframesCss}
2562
2569
  ${imageRules}`;
@@ -2852,7 +2859,7 @@ function useFindReplace({
2852
2859
  const [findResults, setFindResults] = react.useState([]);
2853
2860
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2854
2861
  const performFind = react.useCallback(() => {
2855
- const results = chunkY2KIB3QH_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2862
+ const results = chunk7JPLVECA_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2856
2863
  if (!findQuery) {
2857
2864
  setFindResults([]);
2858
2865
  setFindResultIndex(-1);
@@ -2886,7 +2893,7 @@ function useFindReplace({
2886
2893
  return;
2887
2894
  }
2888
2895
  onUpdateSlides(
2889
- (prevSlides) => chunkY2KIB3QH_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2896
+ (prevSlides) => chunk7JPLVECA_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2890
2897
  );
2891
2898
  onMarkDirty();
2892
2899
  },
@@ -3378,7 +3385,7 @@ function useDerivedElementState(input) {
3378
3385
  () => resolveActiveLayout(activeMaster, activeLayoutIndex),
3379
3386
  [activeMaster, activeLayoutIndex]
3380
3387
  );
3381
- const masterViewElements = react.useMemo(
3388
+ const masterViewElements2 = react.useMemo(
3382
3389
  () => computeMasterViewElements(activeMaster, activeLayout),
3383
3390
  [activeMaster, activeLayout]
3384
3391
  );
@@ -3394,7 +3401,7 @@ function useDerivedElementState(input) {
3394
3401
  selectedElements,
3395
3402
  activeMaster,
3396
3403
  activeLayout,
3397
- masterViewElements,
3404
+ masterViewElements: masterViewElements2,
3398
3405
  notesMasterElements,
3399
3406
  handoutMasterElements
3400
3407
  };
@@ -3410,7 +3417,7 @@ function useViewerCoreState(_input) {
3410
3417
  const marqueeStateRef = react.useRef(null);
3411
3418
  const isDrawingRef = react.useRef(false);
3412
3419
  const justInteractedRef = react.useRef(false);
3413
- const livePatcher = react.useMemo(() => chunkY2KIB3QH_js.createCollaborationLivePatcher(), []);
3420
+ const livePatcher = react.useMemo(() => chunk7JPLVECA_js.createCollaborationLivePatcher(), []);
3414
3421
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3415
3422
  const slidesRef = react.useRef([]);
3416
3423
  const [mode, setMode] = react.useState("edit");
@@ -3419,8 +3426,8 @@ function useViewerCoreState(_input) {
3419
3426
  const [slides, setSlides] = react.useState([]);
3420
3427
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3421
3428
  const [canvasSize, setCanvasSize] = react.useState({
3422
- width: chunkWK22Z7PK_js.DEFAULT_CANVAS_WIDTH,
3423
- height: chunkWK22Z7PK_js.DEFAULT_CANVAS_HEIGHT
3429
+ width: chunk5BXATG54_js.DEFAULT_CANVAS_WIDTH,
3430
+ height: chunk5BXATG54_js.DEFAULT_CANVAS_HEIGHT
3424
3431
  });
3425
3432
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
3426
3433
  const [selectedElementId, setSelectedElementId] = react.useState(null);
@@ -3440,7 +3447,7 @@ function useViewerCoreState(_input) {
3440
3447
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3441
3448
  inlineEditingTextRef.current = resolved;
3442
3449
  setInlineEditingTextBase(value);
3443
- chunkY2KIB3QH_js.publishLiveInlineText(
3450
+ chunk7JPLVECA_js.publishLiveInlineText(
3444
3451
  livePatcher,
3445
3452
  slidesRef.current[activeSlideIndexRef.current],
3446
3453
  inlineEditingElementIdRef.current,
@@ -3775,7 +3782,7 @@ function useLoadContent({
3775
3782
  );
3776
3783
  }
3777
3784
  const previousHandler = handlerRef.current;
3778
- const handler = new chunkY2KIB3QH_js.PptxHandler();
3785
+ const handler = new chunk7JPLVECA_js.PptxHandler();
3779
3786
  const parsed = await handler.load(buffer);
3780
3787
  if (cancelled || token !== renderTokenRef.current) {
3781
3788
  handler.dispose();
@@ -3787,7 +3794,7 @@ function useLoadContent({
3787
3794
  handlerRef.current = null;
3788
3795
  const mediaElements = [];
3789
3796
  for (const slide of parsed.slides) {
3790
- chunkY2KIB3QH_js.collectMediaElements(slide.elements, mediaElements);
3797
+ chunk7JPLVECA_js.collectMediaElements(slide.elements, mediaElements);
3791
3798
  }
3792
3799
  for (const url of mediaDataUrls.values()) {
3793
3800
  if (url.startsWith("blob:")) {
@@ -3828,7 +3835,7 @@ function useLoadContent({
3828
3835
  }
3829
3836
  })
3830
3837
  );
3831
- const { paths: imagePaths, refs: imageRefs } = chunkY2KIB3QH_js.collectImagePaths(parsed.slides);
3838
+ const { paths: imagePaths, refs: imageRefs } = chunk7JPLVECA_js.collectImagePaths(parsed.slides);
3832
3839
  let nextSlides = parsed.slides;
3833
3840
  if (imagePaths.size > 0) {
3834
3841
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3883,12 +3890,12 @@ function useLoadContent({
3883
3890
  }
3884
3891
  }
3885
3892
  handlerRef.current = handler;
3886
- const partition = chunkY2KIB3QH_js.partitionTemplateElements(nextSlides);
3893
+ const partition = chunk7JPLVECA_js.partitionTemplateElements(nextSlides);
3887
3894
  setSlides(partition.slides);
3888
3895
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
3889
3896
  setCanvasSize({
3890
- width: parsed.width ?? chunkWK22Z7PK_js.DEFAULT_CANVAS_WIDTH,
3891
- height: parsed.height ?? chunkWK22Z7PK_js.DEFAULT_CANVAS_HEIGHT
3897
+ width: parsed.width ?? chunk5BXATG54_js.DEFAULT_CANVAS_WIDTH,
3898
+ height: parsed.height ?? chunk5BXATG54_js.DEFAULT_CANVAS_HEIGHT
3892
3899
  });
3893
3900
  setHeaderFooter(parsed.headerFooter ?? {});
3894
3901
  setLayoutOptions(parsed.layoutOptions ?? []);
@@ -3917,7 +3924,7 @@ function useLoadContent({
3917
3924
  setHasMacros(parsed.hasMacros === true);
3918
3925
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
3919
3926
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
3920
- setGuides(chunkY2KIB3QH_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3927
+ setGuides(chunk7JPLVECA_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3921
3928
  setActiveSlideIndex(0);
3922
3929
  clearSelection();
3923
3930
  setIsDirty(false);
@@ -3925,7 +3932,7 @@ function useLoadContent({
3925
3932
  onContentApplied?.();
3926
3933
  } catch (err) {
3927
3934
  if (!cancelled && token === renderTokenRef.current) {
3928
- if (err instanceof chunkY2KIB3QH_js.EncryptedFileError) {
3935
+ if (err instanceof chunk7JPLVECA_js.EncryptedFileError) {
3929
3936
  setIsEncrypted(true);
3930
3937
  } else {
3931
3938
  setError(err instanceof Error ? err.message : String(err));
@@ -4002,7 +4009,7 @@ function useAutosave(input) {
4002
4009
  isSavingRef.current = false;
4003
4010
  return;
4004
4011
  }
4005
- await chunkY2KIB3QH_js.saveAutosaveSnapshot(filePathRef.current, data);
4012
+ await chunk7JPLVECA_js.saveAutosaveSnapshot(filePathRef.current, data);
4006
4013
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4007
4014
  } catch (err) {
4008
4015
  setAutosaveStatus({
@@ -4045,6 +4052,7 @@ function useElementOperations(input) {
4045
4052
  selectedElementId,
4046
4053
  editTemplateMode,
4047
4054
  templateElements,
4055
+ masterView,
4048
4056
  history,
4049
4057
  setSlides,
4050
4058
  setTemplateElementsBySlideId,
@@ -4065,9 +4073,34 @@ function useElementOperations(input) {
4065
4073
  setInlineEditingElementId(null);
4066
4074
  setContextMenuState(null);
4067
4075
  }, [applySelection, setInlineEditingElementId, setContextMenuState]);
4076
+ const applyMasterViewWrite = react.useCallback(
4077
+ (write) => {
4078
+ if (!write || !masterView) {
4079
+ return false;
4080
+ }
4081
+ if (write.slideMasters) {
4082
+ masterView.setSlideMasters(write.slideMasters);
4083
+ }
4084
+ if (write.notesMaster) {
4085
+ masterView.setNotesMaster(write.notesMaster);
4086
+ }
4087
+ if (write.handoutMaster) {
4088
+ masterView.setHandoutMaster(write.handoutMaster);
4089
+ }
4090
+ history.markDirty();
4091
+ return true;
4092
+ },
4093
+ [history, masterView]
4094
+ );
4068
4095
  const updateElementById = react.useCallback(
4069
4096
  (elementId, updates) => {
4070
- if (chunkY2KIB3QH_js.isTemplateElementId(elementId)) {
4097
+ if (masterView?.target) {
4098
+ applyMasterViewWrite(
4099
+ chunk7JPLVECA_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4100
+ );
4101
+ return;
4102
+ }
4103
+ if (chunk7JPLVECA_js.isTemplateElementId(elementId)) {
4071
4104
  const slideId = activeSlide?.id;
4072
4105
  if (slideId) {
4073
4106
  setTemplateElementsBySlideId((prev) => ({
@@ -4094,7 +4127,15 @@ function useElementOperations(input) {
4094
4127
  }
4095
4128
  history.markDirty();
4096
4129
  },
4097
- [activeSlide?.id, activeSlideIndex, history, setSlides, setTemplateElementsBySlideId]
4130
+ [
4131
+ activeSlide?.id,
4132
+ activeSlideIndex,
4133
+ applyMasterViewWrite,
4134
+ history,
4135
+ masterView,
4136
+ setSlides,
4137
+ setTemplateElementsBySlideId
4138
+ ]
4098
4139
  );
4099
4140
  const updateSelectedElement = react.useCallback(
4100
4141
  (updates) => {
@@ -4107,7 +4148,7 @@ function useElementOperations(input) {
4107
4148
  );
4108
4149
  const updateSelectedShapeStyle = react.useCallback(
4109
4150
  (updates) => {
4110
- if (!selectedElement || !chunkY2KIB3QH_js.hasShapeProperties(selectedElement)) {
4151
+ if (!selectedElement || !chunk7JPLVECA_js.hasShapeProperties(selectedElement)) {
4111
4152
  return;
4112
4153
  }
4113
4154
  updateSelectedElement({
@@ -4118,17 +4159,17 @@ function useElementOperations(input) {
4118
4159
  );
4119
4160
  const updateSelectedTextStyle = react.useCallback(
4120
4161
  (updates) => {
4121
- if (!selectedElement || !chunkY2KIB3QH_js.hasTextProperties(selectedElement)) {
4162
+ if (!selectedElement || !chunk7JPLVECA_js.hasTextProperties(selectedElement)) {
4122
4163
  return;
4123
4164
  }
4124
- const inlineSel = chunkY2KIB3QH_js.getInlineEditorSelection(selectedElement.textSegments);
4165
+ const inlineSel = chunk7JPLVECA_js.getInlineEditorSelection(selectedElement.textSegments);
4125
4166
  if (inlineSel && selectedElement.textSegments) {
4126
- const { newSegments: newSegments2, newSelection } = chunkY2KIB3QH_js.applyStyleToSelectedSegments(
4167
+ const { newSegments: newSegments2, newSelection } = chunk7JPLVECA_js.applyStyleToSelectedSegments(
4127
4168
  selectedElement.textSegments,
4128
4169
  inlineSel,
4129
4170
  updates
4130
4171
  );
4131
- chunkY2KIB3QH_js.setPendingSelectionRestore(newSelection);
4172
+ chunk7JPLVECA_js.setPendingSelectionRestore(newSelection);
4132
4173
  updateSelectedElement({
4133
4174
  textSegments: newSegments2
4134
4175
  });
@@ -4148,12 +4189,12 @@ function useElementOperations(input) {
4148
4189
  );
4149
4190
  const updateSelectedTextCase = react.useCallback(
4150
4191
  (mode) => {
4151
- if (!selectedElement || !chunkY2KIB3QH_js.hasTextProperties(selectedElement)) {
4192
+ if (!selectedElement || !chunk7JPLVECA_js.hasTextProperties(selectedElement)) {
4152
4193
  return;
4153
4194
  }
4154
- const inlineSel = chunkY2KIB3QH_js.getInlineEditorSelection(selectedElement.textSegments);
4195
+ const inlineSel = chunk7JPLVECA_js.getInlineEditorSelection(selectedElement.textSegments);
4155
4196
  if (inlineSel && selectedElement.textSegments) {
4156
- const newSegments = chunkY2KIB3QH_js.applyCaseTransformToSegments(
4197
+ const newSegments = chunk7JPLVECA_js.applyCaseTransformToSegments(
4157
4198
  selectedElement.textSegments,
4158
4199
  inlineSel,
4159
4200
  mode
@@ -4163,14 +4204,14 @@ function useElementOperations(input) {
4163
4204
  }
4164
4205
  const updates = {};
4165
4206
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4166
- updates.textSegments = chunkY2KIB3QH_js.applyCaseTransformToSegments(
4207
+ updates.textSegments = chunk7JPLVECA_js.applyCaseTransformToSegments(
4167
4208
  selectedElement.textSegments,
4168
4209
  null,
4169
4210
  mode
4170
4211
  );
4171
4212
  }
4172
4213
  if (typeof selectedElement.text === "string") {
4173
- updates.text = chunkY2KIB3QH_js.transformTextCase(selectedElement.text, mode);
4214
+ updates.text = chunk7JPLVECA_js.transformTextCase(selectedElement.text, mode);
4174
4215
  }
4175
4216
  updateSelectedElement(updates);
4176
4217
  },
@@ -4182,9 +4223,20 @@ function useElementOperations(input) {
4182
4223
  },
4183
4224
  [setSlides]
4184
4225
  );
4185
- const activeElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4226
+ const masterViewTarget = masterView?.target ?? null;
4227
+ const activeElements = masterViewTarget ? chunk7JPLVECA_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4186
4228
  const updateActiveElements = react.useCallback(
4187
4229
  (updater) => {
4230
+ if (masterView?.target) {
4231
+ applyMasterViewWrite(
4232
+ chunk7JPLVECA_js.replaceMasterViewElements(
4233
+ masterView,
4234
+ masterView.target,
4235
+ updater(chunk7JPLVECA_js.masterViewElements(masterView, masterView.target))
4236
+ )
4237
+ );
4238
+ return;
4239
+ }
4188
4240
  if (editTemplateMode) {
4189
4241
  const slideId = activeSlide?.id;
4190
4242
  if (!slideId) {
@@ -4202,7 +4254,15 @@ function useElementOperations(input) {
4202
4254
  );
4203
4255
  }
4204
4256
  },
4205
- [editTemplateMode, activeSlide?.id, activeSlideIndex, setSlides, setTemplateElementsBySlideId]
4257
+ [
4258
+ applyMasterViewWrite,
4259
+ editTemplateMode,
4260
+ masterView,
4261
+ activeSlide?.id,
4262
+ activeSlideIndex,
4263
+ setSlides,
4264
+ setTemplateElementsBySlideId
4265
+ ]
4206
4266
  );
4207
4267
  const serializeSlides = react.useCallback(async () => {
4208
4268
  return null;
@@ -4225,7 +4285,7 @@ function useSectionOperations(input) {
4225
4285
  const { sections, setSections, slides, setSlides, markDirty } = input;
4226
4286
  const addSection2 = react.useCallback(
4227
4287
  (name, afterSlideIndex) => {
4228
- const result = chunkY2KIB3QH_js.addSection(sections, slides, name, afterSlideIndex);
4288
+ const result = chunk7JPLVECA_js.addSection(sections, slides, name, afterSlideIndex);
4229
4289
  setSlides(result.slides);
4230
4290
  setSections(result.sections);
4231
4291
  markDirty();
@@ -4234,7 +4294,7 @@ function useSectionOperations(input) {
4234
4294
  );
4235
4295
  const renameSection2 = react.useCallback(
4236
4296
  (sectionId, newName) => {
4237
- const result = chunkY2KIB3QH_js.renameSection(sections, slides, sectionId, newName);
4297
+ const result = chunk7JPLVECA_js.renameSection(sections, slides, sectionId, newName);
4238
4298
  setSections(result.sections);
4239
4299
  setSlides(result.slides);
4240
4300
  markDirty();
@@ -4243,7 +4303,7 @@ function useSectionOperations(input) {
4243
4303
  );
4244
4304
  const deleteSection2 = react.useCallback(
4245
4305
  (sectionId) => {
4246
- const result = chunkY2KIB3QH_js.deleteSection(sections, slides, sectionId);
4306
+ const result = chunk7JPLVECA_js.deleteSection(sections, slides, sectionId);
4247
4307
  setSections(result.sections);
4248
4308
  setSlides(result.slides);
4249
4309
  markDirty();
@@ -4252,21 +4312,21 @@ function useSectionOperations(input) {
4252
4312
  );
4253
4313
  const moveSectionUp2 = react.useCallback(
4254
4314
  (sectionId) => {
4255
- setSections(chunkY2KIB3QH_js.moveSectionUp(sections, sectionId));
4315
+ setSections(chunk7JPLVECA_js.moveSectionUp(sections, sectionId));
4256
4316
  markDirty();
4257
4317
  },
4258
4318
  [sections, setSections, markDirty]
4259
4319
  );
4260
4320
  const moveSectionDown2 = react.useCallback(
4261
4321
  (sectionId) => {
4262
- setSections(chunkY2KIB3QH_js.moveSectionDown(sections, sectionId));
4322
+ setSections(chunk7JPLVECA_js.moveSectionDown(sections, sectionId));
4263
4323
  markDirty();
4264
4324
  },
4265
4325
  [sections, setSections, markDirty]
4266
4326
  );
4267
4327
  const moveSlidesToSection2 = react.useCallback(
4268
4328
  (slideIndexes, targetSectionId) => {
4269
- const result = chunkY2KIB3QH_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4329
+ const result = chunk7JPLVECA_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4270
4330
  setSlides(result.slides);
4271
4331
  setSections(result.sections);
4272
4332
  markDirty();
@@ -4285,24 +4345,19 @@ function useSectionOperations(input) {
4285
4345
 
4286
4346
  // src/viewer/hooks/pointer-move-handlers.ts
4287
4347
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4288
- const resized = chunkY2KIB3QH_js.applyResize(
4348
+ const resized = chunk7JPLVECA_js.applyResize(
4289
4349
  { x: startX, y: startY, width: startWidth, height: startHeight },
4290
4350
  handle,
4291
4351
  dx,
4292
4352
  dy,
4293
4353
  1,
4294
- { minSize: chunkWK22Z7PK_js.MIN_ELEMENT_SIZE }
4354
+ { minSize: chunk5BXATG54_js.MIN_ELEMENT_SIZE }
4295
4355
  );
4296
4356
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4297
4357
  if (!snapToGrid) {
4298
4358
  return box;
4299
4359
  }
4300
- return chunkY2KIB3QH_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE);
4301
- }
4302
- function computeAdjustmentValue(startAdjustment, dx, startWidth) {
4303
- const range = startWidth || 200;
4304
- const delta = dx / range;
4305
- return Math.max(0, Math.min(1, startAdjustment + delta));
4360
+ return chunk7JPLVECA_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk5BXATG54_js.MIN_ELEMENT_SIZE);
4306
4361
  }
4307
4362
  function resolveLiveTarget(input) {
4308
4363
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4415,7 +4470,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4415
4470
  width: el.width,
4416
4471
  height: el.height
4417
4472
  }));
4418
- const snapResult = chunkY2KIB3QH_js.computeSnapToShape(
4473
+ const snapResult = chunk7JPLVECA_js.computeSnapToShape(
4419
4474
  targetX,
4420
4475
  targetY,
4421
4476
  primaryEl.width,
@@ -4454,7 +4509,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4454
4509
  if (live) {
4455
4510
  for (const id of Object.keys(drag.startPositionsById)) {
4456
4511
  const start = drag.startPositionsById[id];
4457
- chunkY2KIB3QH_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4512
+ chunk7JPLVECA_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4458
4513
  x: start.x + appliedDx,
4459
4514
  y: start.y + appliedDy
4460
4515
  });
@@ -4488,21 +4543,21 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4488
4543
  if (rs.domEl) {
4489
4544
  rs.domEl.style.left = `${geo.x}px`;
4490
4545
  rs.domEl.style.top = `${geo.y}px`;
4491
- rs.domEl.style.width = `${Math.max(geo.width, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE)}px`;
4492
- rs.domEl.style.height = `${Math.max(geo.height, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE)}px`;
4546
+ rs.domEl.style.width = `${Math.max(geo.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE)}px`;
4547
+ rs.domEl.style.height = `${Math.max(geo.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE)}px`;
4493
4548
  }
4494
4549
  if (live) {
4495
- chunkY2KIB3QH_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4550
+ chunk7JPLVECA_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4496
4551
  x: geo.x,
4497
4552
  y: geo.y,
4498
- width: Math.max(geo.width, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE),
4499
- height: Math.max(geo.height, chunkWK22Z7PK_js.MIN_ELEMENT_SIZE)
4553
+ width: Math.max(geo.width, chunk5BXATG54_js.MIN_ELEMENT_SIZE),
4554
+ height: Math.max(geo.height, chunk5BXATG54_js.MIN_ELEMENT_SIZE)
4500
4555
  });
4501
4556
  }
4502
4557
  }
4503
4558
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4504
4559
  const dx = (e.clientX - adj.startClientX) / editorScale;
4505
- const newValue = computeAdjustmentValue(adj.startAdjustment, dx, adj.startWidth);
4560
+ const newValue = chunk7JPLVECA_js.getDraggedShapeAdjustmentValue(adj, dx);
4506
4561
  if (!adj.moved && Math.abs(dx) > 2) {
4507
4562
  adj.moved = true;
4508
4563
  }
@@ -4577,13 +4632,13 @@ function processPointerUp(input) {
4577
4632
  if (i !== activeSlideIndex) {
4578
4633
  return s;
4579
4634
  }
4580
- const rerouted = chunkY2KIB3QH_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4635
+ const rerouted = chunk7JPLVECA_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4581
4636
  if (rerouted.length === 0) {
4582
4637
  return s;
4583
4638
  }
4584
4639
  return {
4585
4640
  ...s,
4586
- elements: chunkY2KIB3QH_js.applyReroutedConnectors(s.elements, rerouted)
4641
+ elements: chunk7JPLVECA_js.applyReroutedConnectors(s.elements, rerouted)
4587
4642
  };
4588
4643
  })
4589
4644
  );
@@ -4608,9 +4663,9 @@ function processPointerUp(input) {
4608
4663
  }
4609
4664
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4610
4665
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4611
- const hitIds = chunkY2KIB3QH_js.computeMarqueeHitIds(marquee, sourceElements);
4666
+ const hitIds = chunk7JPLVECA_js.computeMarqueeHitIds(marquee, sourceElements);
4612
4667
  if (marquee.additive) {
4613
- const merged = chunkY2KIB3QH_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4668
+ const merged = chunk7JPLVECA_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4614
4669
  if (merged.length > 0) {
4615
4670
  applySelection(merged[0], merged);
4616
4671
  } else {
@@ -4633,8 +4688,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4633
4688
  }
4634
4689
  return { ...el, x: start.x + dx, y: start.y + dy };
4635
4690
  });
4636
- const rerouted = chunkY2KIB3QH_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4637
- return chunkY2KIB3QH_js.applyReroutedConnectors(movedElements, rerouted);
4691
+ const rerouted = chunk7JPLVECA_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4692
+ return chunk7JPLVECA_js.applyReroutedConnectors(movedElements, rerouted);
4638
4693
  };
4639
4694
  if (editTemplateMode) {
4640
4695
  const slideId = activeSlide?.id;
@@ -4791,9 +4846,9 @@ function useCanvasInteractions(input) {
4791
4846
  return;
4792
4847
  }
4793
4848
  const el = elementLookup.get(editId);
4794
- if (el && chunkY2KIB3QH_js.hasTextProperties(el)) {
4849
+ if (el && chunk7JPLVECA_js.hasTextProperties(el)) {
4795
4850
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
4796
- const newSegments = chunkY2KIB3QH_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4851
+ const newSegments = chunk7JPLVECA_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4797
4852
  ops.updateElementById(editId, {
4798
4853
  text: committedText,
4799
4854
  textSegments: newSegments
@@ -4804,7 +4859,7 @@ function useCanvasInteractions(input) {
4804
4859
  setInlineEditingText("");
4805
4860
  };
4806
4861
  const openEquationEditorForElement = (el) => {
4807
- if (!chunkY2KIB3QH_js.hasTextProperties(el)) {
4862
+ if (!chunk7JPLVECA_js.hasTextProperties(el)) {
4808
4863
  return false;
4809
4864
  }
4810
4865
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -4834,7 +4889,7 @@ function useCanvasInteractions(input) {
4834
4889
  justInteractedRef.current = false;
4835
4890
  } else {
4836
4891
  const el = elementLookup.get(elementId);
4837
- if (el && chunkY2KIB3QH_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
4892
+ if (el && chunk7JPLVECA_js.hasTextProperties(el) && chunk7JPLVECA_js.canInteractWithElement(el, "textEdit")) {
4838
4893
  if (!openEquationEditorForElement(el)) {
4839
4894
  setInlineEditingElementId(elementId);
4840
4895
  setInlineEditingText(el.text ?? "");
@@ -4853,7 +4908,7 @@ function useCanvasInteractions(input) {
4853
4908
  if (openEquationEditorForElement(el)) {
4854
4909
  return;
4855
4910
  }
4856
- if (chunkY2KIB3QH_js.hasTextProperties(el)) {
4911
+ if (chunk7JPLVECA_js.hasTextProperties(el) && chunk7JPLVECA_js.canInteractWithElement(el, "textEdit")) {
4857
4912
  setInlineEditingElementId(elementId);
4858
4913
  setInlineEditingText(el.text ?? "");
4859
4914
  }
@@ -4876,9 +4931,13 @@ function useCanvasInteractions(input) {
4876
4931
  justSelectedRef.current = false;
4877
4932
  }
4878
4933
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
4934
+ const movableIds = chunk7JPLVECA_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4935
+ if (movableIds.length === 0) {
4936
+ return;
4937
+ }
4879
4938
  const startPositions = {};
4880
4939
  const domEls = /* @__PURE__ */ new Map();
4881
- for (const id of ids) {
4940
+ for (const id of movableIds) {
4882
4941
  const el = elementLookup.get(id);
4883
4942
  if (el) {
4884
4943
  startPositions[id] = { x: el.x, y: el.y };
@@ -4942,7 +5001,7 @@ function useCanvasInteractions(input) {
4942
5001
  const handleResizePointerDown = (elementId, e, handle) => {
4943
5002
  e.stopPropagation();
4944
5003
  const el = elementLookup.get(elementId);
4945
- if (!el) {
5004
+ if (!el || !chunk7JPLVECA_js.canInteractWithElement(el, "resize")) {
4946
5005
  return;
4947
5006
  }
4948
5007
  resizeStateRef.current = {
@@ -4964,7 +5023,7 @@ function useCanvasInteractions(input) {
4964
5023
  };
4965
5024
  const handleRotate = (elementId, rotationDeg) => {
4966
5025
  const el = elementLookup.get(elementId);
4967
- if (!el || el.locks?.noRotation) {
5026
+ if (!el || !chunk7JPLVECA_js.canInteractWithElement(el, "rotate")) {
4968
5027
  return;
4969
5028
  }
4970
5029
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -4987,6 +5046,9 @@ function useCanvasInteractions(input) {
4987
5046
  if (!el || !("shapeType" in el) || !("shapeAdjustments" in el)) {
4988
5047
  return;
4989
5048
  }
5049
+ if (!chunk7JPLVECA_js.canInteractWithElement(el, "adjustHandle")) {
5050
+ return;
5051
+ }
4990
5052
  const adjEntries = Object.entries(
4991
5053
  el.shapeAdjustments ?? {}
4992
5054
  );
@@ -5046,7 +5108,7 @@ function createFileHandlers(deps) {
5046
5108
  h = Math.round(h * scale);
5047
5109
  }
5048
5110
  addElement({
5049
- id: chunkY2KIB3QH_js.generateElementId(),
5111
+ id: chunk7JPLVECA_js.generateElementId(),
5050
5112
  type: "image",
5051
5113
  x: Math.round((canvasSize.width - w) / 2),
5052
5114
  y: Math.round((canvasSize.height - h) / 2),
@@ -5057,7 +5119,7 @@ function createFileHandlers(deps) {
5057
5119
  };
5058
5120
  img.onerror = () => {
5059
5121
  addElement({
5060
- id: chunkY2KIB3QH_js.generateElementId(),
5122
+ id: chunk7JPLVECA_js.generateElementId(),
5061
5123
  type: "image",
5062
5124
  x: 100,
5063
5125
  y: 100,
@@ -5083,7 +5145,7 @@ function createFileHandlers(deps) {
5083
5145
  const elFilePath = file.path;
5084
5146
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5085
5147
  addElement({
5086
- id: chunkY2KIB3QH_js.generateElementId(),
5148
+ id: chunk7JPLVECA_js.generateElementId(),
5087
5149
  type: "media",
5088
5150
  mediaType,
5089
5151
  mediaMimeType: file.type || void 0,
@@ -5258,13 +5320,13 @@ function createStructuredElementHandlers(deps) {
5258
5320
  return;
5259
5321
  }
5260
5322
  addElement({
5261
- id: chunkY2KIB3QH_js.generateElementId(),
5323
+ id: chunk7JPLVECA_js.generateElementId(),
5262
5324
  type: "smartArt",
5263
5325
  x: 100,
5264
5326
  y: 120,
5265
5327
  width: 600,
5266
5328
  height: 340,
5267
- smartArtData: chunkY2KIB3QH_js.buildSmartArtPresetData(
5329
+ smartArtData: chunk7JPLVECA_js.buildSmartArtPresetData(
5268
5330
  layout,
5269
5331
  defaultItems,
5270
5332
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5276,7 +5338,7 @@ function createStructuredElementHandlers(deps) {
5276
5338
  return;
5277
5339
  }
5278
5340
  addElement({
5279
- id: chunkY2KIB3QH_js.generateElementId(),
5341
+ id: chunk7JPLVECA_js.generateElementId(),
5280
5342
  type: "shape",
5281
5343
  x: 120,
5282
5344
  y: 200,
@@ -5335,7 +5397,7 @@ function createStructuredElementHandlers(deps) {
5335
5397
  const displayText = value || fieldTexts[fieldType] || fieldType;
5336
5398
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5337
5399
  addElement({
5338
- id: chunkY2KIB3QH_js.generateElementId(),
5400
+ id: chunk7JPLVECA_js.generateElementId(),
5339
5401
  type: "shape",
5340
5402
  x: 120,
5341
5403
  y: 200,
@@ -5357,11 +5419,11 @@ function createStructuredElementHandlers(deps) {
5357
5419
  if (!activeSlide) {
5358
5420
  return;
5359
5421
  }
5360
- const preset = chunkY2KIB3QH_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5422
+ const preset = chunk7JPLVECA_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5361
5423
  if (!preset) {
5362
5424
  return;
5363
5425
  }
5364
- const defaultPptxAction = chunkY2KIB3QH_js.elementActionToPptxAction({
5426
+ const defaultPptxAction = chunk7JPLVECA_js.elementActionToPptxAction({
5365
5427
  trigger: "click",
5366
5428
  type: preset.defaultAction
5367
5429
  });
@@ -5370,7 +5432,7 @@ function createStructuredElementHandlers(deps) {
5370
5432
  defaultPptxAction.highlightClick = true;
5371
5433
  }
5372
5434
  addElement({
5373
- id: chunkY2KIB3QH_js.generateElementId(),
5435
+ id: chunk7JPLVECA_js.generateElementId(),
5374
5436
  type: "shape",
5375
5437
  x: 150,
5376
5438
  y: 150,
@@ -5437,14 +5499,14 @@ function useInsertElements(input) {
5437
5499
  return;
5438
5500
  }
5439
5501
  addElement({
5440
- id: chunkY2KIB3QH_js.generateElementId(),
5502
+ id: chunk7JPLVECA_js.generateElementId(),
5441
5503
  type: "text",
5442
5504
  x: 100,
5443
5505
  y: 100,
5444
5506
  width: 300,
5445
5507
  height: 60,
5446
5508
  text: "",
5447
- textStyle: { fontSize: chunkWK22Z7PK_js.DEFAULT_TEXT_FONT_SIZE }
5509
+ textStyle: { fontSize: chunk5BXATG54_js.DEFAULT_TEXT_FONT_SIZE }
5448
5510
  });
5449
5511
  };
5450
5512
  const handleAddShape = () => {
@@ -5452,7 +5514,7 @@ function useInsertElements(input) {
5452
5514
  return;
5453
5515
  }
5454
5516
  addElement({
5455
- id: chunkY2KIB3QH_js.generateElementId(),
5517
+ id: chunk7JPLVECA_js.generateElementId(),
5456
5518
  type: "shape",
5457
5519
  x: 150,
5458
5520
  y: 150,
@@ -5471,15 +5533,15 @@ function useInsertElements(input) {
5471
5533
  return;
5472
5534
  }
5473
5535
  addElement({
5474
- ...chunkY2KIB3QH_js.newTableElement(chunkWK22Z7PK_js.DEFAULT_TABLE_ROWS, chunkWK22Z7PK_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5475
- id: chunkY2KIB3QH_js.generateElementId()
5536
+ ...chunk7JPLVECA_js.newTableElement(chunk5BXATG54_js.DEFAULT_TABLE_ROWS, chunk5BXATG54_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5537
+ id: chunk7JPLVECA_js.generateElementId()
5476
5538
  });
5477
5539
  };
5478
5540
  const handleAddChart = (chartKind) => {
5479
5541
  if (!activeSlide) {
5480
5542
  return;
5481
5543
  }
5482
- addElement(chunkY2KIB3QH_js.createDefaultChartElement(chartKind));
5544
+ addElement(chunk7JPLVECA_js.createDefaultChartElement(chartKind));
5483
5545
  };
5484
5546
  const structured = createStructuredElementHandlers({
5485
5547
  activeSlide,
@@ -5549,7 +5611,7 @@ function useClipboardHandlers(input) {
5549
5611
  if (!selectedElement) {
5550
5612
  return;
5551
5613
  }
5552
- setClipboardPayload(chunkY2KIB3QH_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5614
+ setClipboardPayload(chunk7JPLVECA_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5553
5615
  };
5554
5616
  const handleDelete = () => {
5555
5617
  const idsToDelete = effectiveSelectedIds;
@@ -5566,7 +5628,7 @@ function useClipboardHandlers(input) {
5566
5628
  handleDelete();
5567
5629
  };
5568
5630
  const insertClone = (source) => {
5569
- const clone = chunkY2KIB3QH_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5631
+ const clone = chunk7JPLVECA_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5570
5632
  ops.updateActiveElements((els) => [...els, clone]);
5571
5633
  ops.applySelection(clone.id);
5572
5634
  history.markDirty();
@@ -5601,7 +5663,7 @@ function resolveShapePath(el) {
5601
5663
  return el.pathData;
5602
5664
  }
5603
5665
  if ("shapeType" in el && typeof el.shapeType === "string") {
5604
- const clipPath = chunkY2KIB3QH_js.getPresetShapeClipPath(el.shapeType);
5666
+ const clipPath = chunk7JPLVECA_js.getPresetShapeClipPath(el.shapeType);
5605
5667
  if (clipPath) {
5606
5668
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5607
5669
  if (svgPath) {
@@ -5652,7 +5714,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5652
5714
  return parts.join(" ");
5653
5715
  }
5654
5716
  function transformPathToGlobal(pathData, el) {
5655
- const polys = chunkY2KIB3QH_js.svgPathToPolygons(pathData);
5717
+ const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5656
5718
  if (polys.length === 0) {
5657
5719
  return pathData;
5658
5720
  }
@@ -5672,10 +5734,10 @@ function transformPathToGlobal(pathData, el) {
5672
5734
  y: pt.y * scaleY + el.y
5673
5735
  }))
5674
5736
  );
5675
- return chunkY2KIB3QH_js.polygonsToSvgPath(transformed);
5737
+ return chunk7JPLVECA_js.polygonsToSvgPath(transformed);
5676
5738
  }
5677
5739
  function transformPathToLocal(pathData, x, y, _width, _height) {
5678
- const polys = chunkY2KIB3QH_js.svgPathToPolygons(pathData);
5740
+ const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5679
5741
  if (polys.length === 0) {
5680
5742
  return pathData;
5681
5743
  }
@@ -5685,10 +5747,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5685
5747
  y: pt.y - y
5686
5748
  }))
5687
5749
  );
5688
- return chunkY2KIB3QH_js.polygonsToSvgPath(transformed);
5750
+ return chunk7JPLVECA_js.polygonsToSvgPath(transformed);
5689
5751
  }
5690
5752
  function pathBounds(pathData) {
5691
- const polys = chunkY2KIB3QH_js.svgPathToPolygons(pathData);
5753
+ const polys = chunk7JPLVECA_js.svgPathToPolygons(pathData);
5692
5754
  let minX = Infinity;
5693
5755
  let minY = Infinity;
5694
5756
  let maxX = -Infinity;
@@ -5747,7 +5809,7 @@ function useMergeShapesHandler(input) {
5747
5809
  let allFragments = [];
5748
5810
  let remaining = globalPaths[0];
5749
5811
  for (let i = 1; i < globalPaths.length; i++) {
5750
- const frags = chunkY2KIB3QH_js.mergeShapes("fragment", remaining, globalPaths[i]);
5812
+ const frags = chunk7JPLVECA_js.mergeShapes("fragment", remaining, globalPaths[i]);
5751
5813
  if (Array.isArray(frags)) {
5752
5814
  allFragments = frags;
5753
5815
  }
@@ -5776,7 +5838,7 @@ function useMergeShapesHandler(input) {
5776
5838
  bounds.height
5777
5839
  );
5778
5840
  const newEl = {
5779
- id: chunkY2KIB3QH_js.generateElementId(),
5841
+ id: chunk7JPLVECA_js.generateElementId(),
5780
5842
  type: "shape",
5781
5843
  x: bounds.x,
5782
5844
  y: bounds.y,
@@ -5814,7 +5876,7 @@ function useMergeShapesHandler(input) {
5814
5876
  } else {
5815
5877
  let resultPath = globalPaths[0];
5816
5878
  for (let i = 1; i < globalPaths.length; i++) {
5817
- const result = chunkY2KIB3QH_js.mergeShapes(operation, resultPath, globalPaths[i]);
5879
+ const result = chunk7JPLVECA_js.mergeShapes(operation, resultPath, globalPaths[i]);
5818
5880
  if (typeof result === "string") {
5819
5881
  resultPath = result;
5820
5882
  }
@@ -5835,7 +5897,7 @@ function useMergeShapesHandler(input) {
5835
5897
  );
5836
5898
  const primary = targets[0];
5837
5899
  const newEl = {
5838
- id: chunkY2KIB3QH_js.generateElementId(),
5900
+ id: chunk7JPLVECA_js.generateElementId(),
5839
5901
  type: "shape",
5840
5902
  x: bounds.x,
5841
5903
  y: bounds.y,
@@ -5898,7 +5960,7 @@ function useGroupAlignLayerHandlers(input) {
5898
5960
  if (ids.length < 2 || !activeSlide) {
5899
5961
  return;
5900
5962
  }
5901
- const { elements, groupId } = chunkY2KIB3QH_js.groupElements(ops.activeElements, ids, chunkY2KIB3QH_js.generateElementId());
5963
+ const { elements, groupId } = chunk7JPLVECA_js.groupElements(ops.activeElements, ids, chunk7JPLVECA_js.generateElementId());
5902
5964
  if (groupId === null) {
5903
5965
  return;
5904
5966
  }
@@ -5911,17 +5973,21 @@ function useGroupAlignLayerHandlers(input) {
5911
5973
  return;
5912
5974
  }
5913
5975
  const group = selectedElement;
5914
- const intoTemplate = chunkY2KIB3QH_js.isTemplateElementId(group.id);
5915
- const ungrouped = group.children.map((child) => ({
5916
- ...structuredClone(child),
5917
- // Keep child ids in the same store as the group so later edits route
5918
- // correctly: template groups yield template-prefixed child ids.
5919
- id: intoTemplate ? chunkY2KIB3QH_js.makeCloneId(true, child.id || group.id) : child.id || chunkY2KIB3QH_js.generateElementId(),
5920
- x: child.x + group.x,
5921
- y: child.y + group.y
5922
- }));
5923
- ops.updateActiveElements((els) => [...els.filter((el) => el.id !== group.id), ...ungrouped]);
5924
- setSelectedElementIds(ungrouped.map((el) => el.id));
5976
+ const intoTemplate = chunk7JPLVECA_js.isTemplateElementId(group.id);
5977
+ const childIds = group.children.map(
5978
+ (child) => intoTemplate ? chunk7JPLVECA_js.makeCloneId(true, child.id || group.id) : child.id || chunk7JPLVECA_js.generateElementId()
5979
+ );
5980
+ const { elements, childIds: usedIds } = chunk7JPLVECA_js.ungroupElements(
5981
+ ops.activeElements,
5982
+ group.id,
5983
+ childIds,
5984
+ { intoTemplate }
5985
+ );
5986
+ if (usedIds.length === 0) {
5987
+ return;
5988
+ }
5989
+ ops.updateActiveElements(() => elements);
5990
+ setSelectedElementIds(usedIds);
5925
5991
  history.markDirty();
5926
5992
  };
5927
5993
  const handleFlip = (direction) => {
@@ -5940,7 +6006,7 @@ function useGroupAlignLayerHandlers(input) {
5940
6006
  if (!edge) {
5941
6007
  return;
5942
6008
  }
5943
- const positions = chunkY2KIB3QH_js.alignElements(selectedElements, edge);
6009
+ const positions = chunk7JPLVECA_js.alignElements(selectedElements, edge);
5944
6010
  for (const [id, pos] of positions) {
5945
6011
  const el = elementLookup.get(id);
5946
6012
  if (!el) {
@@ -5958,7 +6024,7 @@ function useGroupAlignLayerHandlers(input) {
5958
6024
  if (!distAxis) {
5959
6025
  return;
5960
6026
  }
5961
- const positions = chunkY2KIB3QH_js.distributeElements(selectedElements, distAxis);
6027
+ const positions = chunk7JPLVECA_js.distributeElements(selectedElements, distAxis);
5962
6028
  for (const [id, pos] of positions) {
5963
6029
  const el = elementLookup.get(id);
5964
6030
  if (!el) {
@@ -5975,7 +6041,7 @@ function useGroupAlignLayerHandlers(input) {
5975
6041
  }
5976
6042
  const id = selectedElement.id;
5977
6043
  ops.updateActiveElements(
5978
- (els) => direction === "forward" ? chunkY2KIB3QH_js.bringForward(els, id) : direction === "backward" ? chunkY2KIB3QH_js.sendBackward(els, id) : els
6044
+ (els) => direction === "forward" ? chunk7JPLVECA_js.bringForward(els, id) : direction === "backward" ? chunk7JPLVECA_js.sendBackward(els, id) : els
5979
6045
  );
5980
6046
  history.markDirty();
5981
6047
  };
@@ -5985,7 +6051,7 @@ function useGroupAlignLayerHandlers(input) {
5985
6051
  }
5986
6052
  const id = selectedElement.id;
5987
6053
  ops.updateActiveElements(
5988
- (els) => direction === "front" ? chunkY2KIB3QH_js.bringToFront(els, id) : chunkY2KIB3QH_js.sendToBack(els, id)
6054
+ (els) => direction === "front" ? chunk7JPLVECA_js.bringToFront(els, id) : chunk7JPLVECA_js.sendToBack(els, id)
5989
6055
  );
5990
6056
  history.markDirty();
5991
6057
  };
@@ -6116,7 +6182,7 @@ function useSlideManagement(input) {
6116
6182
  theme
6117
6183
  } = input;
6118
6184
  const handleAddSlide = () => {
6119
- const newSlide = chunkY2KIB3QH_js.createBlankSlide(slides.length + 1);
6185
+ const newSlide = chunk7JPLVECA_js.createBlankSlide(slides.length + 1);
6120
6186
  ops.updateSlides((prev) => {
6121
6187
  const next = [...prev];
6122
6188
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6179,7 +6245,7 @@ function useSlideManagement(input) {
6179
6245
  }
6180
6246
  const clone = {
6181
6247
  ...src,
6182
- id: chunkY2KIB3QH_js.makeSlideId(),
6248
+ id: chunk7JPLVECA_js.makeSlideId(),
6183
6249
  elements: src.elements.map((el) => ({
6184
6250
  ...el,
6185
6251
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6211,7 +6277,7 @@ function useSlideManagement(input) {
6211
6277
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6212
6278
  const insertAt = activeSlideIndex + 1;
6213
6279
  const draft = {
6214
- ...chunkY2KIB3QH_js.createBlankSlide(slides.length + 1),
6280
+ ...chunk7JPLVECA_js.createBlankSlide(slides.length + 1),
6215
6281
  layoutPath,
6216
6282
  ...layoutName ? { layoutName } : {}
6217
6283
  };
@@ -6244,9 +6310,9 @@ function useSlideManagement(input) {
6244
6310
  };
6245
6311
  const handleInsertSlideFromTemplate = (templateId) => {
6246
6312
  const insertAt = activeSlideIndex + 1;
6247
- const draft = chunkY2KIB3QH_js.buildSlideTemplateSlide(templateId, chunkY2KIB3QH_js.makeSlideId(), slides.length + 1, {
6313
+ const draft = chunk7JPLVECA_js.buildSlideTemplateSlide(templateId, chunk7JPLVECA_js.makeSlideId(), slides.length + 1, {
6248
6314
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6249
- scheme: chunkY2KIB3QH_js.templateSchemeFromTheme(theme?.colorScheme)
6315
+ scheme: chunk7JPLVECA_js.templateSchemeFromTheme(theme?.colorScheme)
6250
6316
  });
6251
6317
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6252
6318
  setActiveSlideIndex(insertAt);
@@ -6283,7 +6349,7 @@ function createTableMergeHandlers(input) {
6283
6349
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6284
6350
  return;
6285
6351
  }
6286
- const newTableData = chunkY2KIB3QH_js.mergeCells(
6352
+ const newTableData = chunk7JPLVECA_js.mergeCells(
6287
6353
  [
6288
6354
  { row: rowIndex, col: columnIndex },
6289
6355
  { row: rowIndex, col: nextColIdx }
@@ -6291,7 +6357,7 @@ function createTableMergeHandlers(input) {
6291
6357
  td
6292
6358
  );
6293
6359
  const updates = { tableData: newTableData };
6294
- const newRawXml = chunkY2KIB3QH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6360
+ const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6295
6361
  if (newRawXml) {
6296
6362
  updates.rawXml = newRawXml;
6297
6363
  }
@@ -6317,7 +6383,7 @@ function createTableMergeHandlers(input) {
6317
6383
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6318
6384
  return;
6319
6385
  }
6320
- const newTableData = chunkY2KIB3QH_js.mergeCells(
6386
+ const newTableData = chunk7JPLVECA_js.mergeCells(
6321
6387
  [
6322
6388
  { row: rowIndex, col: columnIndex },
6323
6389
  { row: targetNextRowIdx, col: columnIndex }
@@ -6325,7 +6391,7 @@ function createTableMergeHandlers(input) {
6325
6391
  td
6326
6392
  );
6327
6393
  const updates = { tableData: newTableData };
6328
- const newRawXml = chunkY2KIB3QH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6394
+ const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6329
6395
  if (newRawXml) {
6330
6396
  updates.rawXml = newRawXml;
6331
6397
  }
@@ -6340,9 +6406,9 @@ function createTableMergeHandlers(input) {
6340
6406
  return;
6341
6407
  }
6342
6408
  const td = selectedElement.tableData;
6343
- const newTableData = chunkY2KIB3QH_js.mergeCells(ts.selectedCells, td);
6409
+ const newTableData = chunk7JPLVECA_js.mergeCells(ts.selectedCells, td);
6344
6410
  const updates = { tableData: newTableData };
6345
- const newRawXml = chunkY2KIB3QH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6411
+ const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6346
6412
  if (newRawXml) {
6347
6413
  updates.rawXml = newRawXml;
6348
6414
  }
@@ -6359,9 +6425,9 @@ function createTableMergeHandlers(input) {
6359
6425
  }
6360
6426
  const { rowIndex, columnIndex } = ts;
6361
6427
  const td = selectedElement.tableData;
6362
- const newTableData = chunkY2KIB3QH_js.splitCell(rowIndex, columnIndex, td);
6428
+ const newTableData = chunk7JPLVECA_js.splitCell(rowIndex, columnIndex, td);
6363
6429
  const updates = { tableData: newTableData };
6364
- const newRawXml = chunkY2KIB3QH_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6430
+ const newRawXml = chunk7JPLVECA_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6365
6431
  if (newRawXml) {
6366
6432
  updates.rawXml = newRawXml;
6367
6433
  }
@@ -6405,7 +6471,7 @@ function createTableStructHandlers(input) {
6405
6471
  updates.tableData = { ...el.tableData, rows: newRows };
6406
6472
  }
6407
6473
  if (el.rawXml) {
6408
- const newRawXml = chunkY2KIB3QH_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6474
+ const newRawXml = chunk7JPLVECA_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6409
6475
  if (newRawXml) {
6410
6476
  updates.rawXml = newRawXml;
6411
6477
  }
@@ -6429,7 +6495,7 @@ function createTableStructHandlers(input) {
6429
6495
  const { rowIndex, columnIndex: colIndex } = ts;
6430
6496
  const updates = {};
6431
6497
  if (selectedElement.rawXml) {
6432
- const newRawXml = chunkY2KIB3QH_js.updateCellTextStyleInRawXml(
6498
+ const newRawXml = chunk7JPLVECA_js.updateCellTextStyleInRawXml(
6433
6499
  selectedElement,
6434
6500
  rowIndex,
6435
6501
  colIndex,
@@ -6493,9 +6559,9 @@ function createTableStructHandlers(input) {
6493
6559
  return;
6494
6560
  }
6495
6561
  const rowIdx = ts?.rowIndex ?? 0;
6496
- const newTableData = chunkY2KIB3QH_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6562
+ const newTableData = chunk7JPLVECA_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6497
6563
  const updates = { tableData: newTableData };
6498
- const newRawXml = chunkY2KIB3QH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6564
+ const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6499
6565
  if (newRawXml) {
6500
6566
  updates.rawXml = newRawXml;
6501
6567
  }
@@ -6508,12 +6574,12 @@ function createTableStructHandlers(input) {
6508
6574
  }
6509
6575
  const td = selectedElement.tableData;
6510
6576
  const rowIdx = ts?.rowIndex ?? 0;
6511
- const newTableData = chunkY2KIB3QH_js.deleteTableRow(td, rowIdx);
6577
+ const newTableData = chunk7JPLVECA_js.deleteTableRow(td, rowIdx);
6512
6578
  if (newTableData === td) {
6513
6579
  return;
6514
6580
  }
6515
6581
  const updates = { tableData: newTableData };
6516
- const newRawXml = chunkY2KIB3QH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6582
+ const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6517
6583
  if (newRawXml) {
6518
6584
  updates.rawXml = newRawXml;
6519
6585
  }
@@ -6525,9 +6591,9 @@ function createTableStructHandlers(input) {
6525
6591
  return;
6526
6592
  }
6527
6593
  const colIdx = ts?.columnIndex ?? 0;
6528
- const newTableData = chunkY2KIB3QH_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6594
+ const newTableData = chunk7JPLVECA_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6529
6595
  const updates = { tableData: newTableData };
6530
- const newRawXml = chunkY2KIB3QH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6596
+ const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6531
6597
  if (newRawXml) {
6532
6598
  updates.rawXml = newRawXml;
6533
6599
  }
@@ -6540,12 +6606,12 @@ function createTableStructHandlers(input) {
6540
6606
  }
6541
6607
  const td = selectedElement.tableData;
6542
6608
  const colIdx = ts?.columnIndex ?? 0;
6543
- const newTableData = chunkY2KIB3QH_js.deleteTableColumn(td, colIdx);
6609
+ const newTableData = chunk7JPLVECA_js.deleteTableColumn(td, colIdx);
6544
6610
  if (newTableData === td) {
6545
6611
  return;
6546
6612
  }
6547
6613
  const updates = { tableData: newTableData };
6548
- const newRawXml = chunkY2KIB3QH_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6614
+ const newRawXml = chunk7JPLVECA_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6549
6615
  if (newRawXml) {
6550
6616
  updates.rawXml = newRawXml;
6551
6617
  }
@@ -6581,8 +6647,8 @@ async function renderToCanvas(element, options = {}) {
6581
6647
  return html2canvasPro(element, {
6582
6648
  ...options,
6583
6649
  onclone: async (doc, clonedEl) => {
6584
- await chunkY2KIB3QH_js.normalizeColorsForCapture(doc, clonedEl);
6585
- chunkY2KIB3QH_js.preprocessCssForCapture(clonedEl);
6650
+ await chunk7JPLVECA_js.normalizeColorsForCapture(doc, clonedEl);
6651
+ chunk7JPLVECA_js.preprocessCssForCapture(clonedEl);
6586
6652
  if (typeof userOnClone === "function") {
6587
6653
  userOnClone(doc, clonedEl);
6588
6654
  }
@@ -6638,7 +6704,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
6638
6704
  }
6639
6705
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
6640
6706
  const blob = await exportSlideToPngBlob(slideElement, options);
6641
- chunkY2KIB3QH_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6707
+ chunk7JPLVECA_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6642
6708
  }
6643
6709
  async function copySlideToClipboard(slideElement, options = {}) {
6644
6710
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -6660,15 +6726,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
6660
6726
  continue;
6661
6727
  }
6662
6728
  const canvas = await renderElementToCanvas(stageEl, scale);
6663
- images.push(chunkY2KIB3QH_js.canvasToJpegData(canvas));
6729
+ images.push(chunk7JPLVECA_js.canvasToJpegData(canvas));
6664
6730
  }
6665
6731
  onProgress?.(totalSlides, totalSlides);
6666
6732
  setActiveSlide(currentSlideIndex);
6667
6733
  if (images.length === 0) {
6668
- throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6734
+ throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6669
6735
  }
6670
- const pdfBlobUrl = chunkWK22Z7PK_js.buildPdfFromImageData(images);
6671
- chunkY2KIB3QH_js.downloadDataUrl(pdfBlobUrl, filename);
6736
+ const pdfBlobUrl = chunk5BXATG54_js.buildPdfFromImageData(images);
6737
+ chunk7JPLVECA_js.downloadDataUrl(pdfBlobUrl, filename);
6672
6738
  }
6673
6739
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
6674
6740
  const { scale = 2, onProgress } = options;
@@ -6714,10 +6780,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
6714
6780
  onProgress?.(totalSlides, totalSlides);
6715
6781
  setActiveSlide(currentSlideIndex);
6716
6782
  if (pages.length === 0) {
6717
- throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6783
+ throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6718
6784
  }
6719
- const pdfDataUrl = chunkWK22Z7PK_js.buildNotesPdf(pages);
6720
- chunkY2KIB3QH_js.downloadDataUrl(pdfDataUrl, filename);
6785
+ const pdfDataUrl = chunk5BXATG54_js.buildNotesPdf(pages);
6786
+ chunk7JPLVECA_js.downloadDataUrl(pdfDataUrl, filename);
6721
6787
  }
6722
6788
 
6723
6789
  // src/viewer/utils/export-video.ts
@@ -6748,7 +6814,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6748
6814
  }
6749
6815
  setActiveSlide(currentSlideIndex);
6750
6816
  if (slideCanvases.length === 0) {
6751
- throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6817
+ throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6752
6818
  }
6753
6819
  const firstCanvas = slideCanvases[0];
6754
6820
  const recordingCanvas = document.createElement("canvas");
@@ -6756,12 +6822,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6756
6822
  recordingCanvas.height = firstCanvas.height;
6757
6823
  const ctx = recordingCanvas.getContext("2d");
6758
6824
  if (!ctx) {
6759
- throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNo2dContext"]);
6825
+ throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNo2dContext"]);
6760
6826
  }
6761
6827
  const fps = 30;
6762
6828
  const stream = recordingCanvas.captureStream(fps);
6763
6829
  const recorder = new MediaRecorder(stream, {
6764
- mimeType: chunkY2KIB3QH_js.pickSupportedMimeType([...chunkY2KIB3QH_js.WEBM_MIME_CANDIDATES]),
6830
+ mimeType: chunk7JPLVECA_js.pickSupportedMimeType([...chunk7JPLVECA_js.WEBM_MIME_CANDIDATES]),
6765
6831
  videoBitsPerSecond: 5e6
6766
6832
  });
6767
6833
  const chunks = [];
@@ -6784,8 +6850,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6784
6850
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
6785
6851
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
6786
6852
  ctx.drawImage(slideCanvases[i], 0, 0);
6787
- const frameInterval = chunkY2KIB3QH_js.fpsToFrameIntervalMs(fps);
6788
- const framesNeeded = chunkY2KIB3QH_js.segmentFrameCount(duration, fps);
6853
+ const frameInterval = chunk7JPLVECA_js.fpsToFrameIntervalMs(fps);
6854
+ const framesNeeded = chunk7JPLVECA_js.segmentFrameCount(duration, fps);
6789
6855
  for (let f = 0; f < framesNeeded; f++) {
6790
6856
  if (signal?.aborted) {
6791
6857
  recorder.stop();
@@ -6832,9 +6898,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
6832
6898
  }
6833
6899
  setActiveSlide(currentSlideIndex);
6834
6900
  if (frames.length === 0) {
6835
- throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6901
+ throw new Error(chunkAONFHTTJ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6836
6902
  }
6837
- const gifBytes = chunkY2KIB3QH_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6903
+ const gifBytes = chunk7JPLVECA_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6838
6904
  onProgress?.(totalSlides, totalSlides);
6839
6905
  const buf = new ArrayBuffer(gifBytes.length);
6840
6906
  new Uint8Array(buf).set(gifBytes);
@@ -6888,7 +6954,7 @@ function exportAllSlidesToSvg(data, options = {}) {
6888
6954
  continue;
6889
6955
  }
6890
6956
  onProgress?.(processedCount, data.slides.length);
6891
- let svg = chunkY2KIB3QH_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6957
+ let svg = chunk7JPLVECA_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6892
6958
  if (embedFonts && fontFaces?.length) {
6893
6959
  svg = injectFontFaces(svg, fontFaces);
6894
6960
  }
@@ -6950,7 +7016,7 @@ function useExportSaveAs(input) {
6950
7016
  }
6951
7017
  setExportProgress(70);
6952
7018
  setExportStatusMessage("Writing README...");
6953
- const readme = chunkY2KIB3QH_js.generatePackageReadme(pptxFilename);
7019
+ const readme = chunk7JPLVECA_js.generatePackageReadme(pptxFilename);
6954
7020
  pkgFolder.file("README.txt", readme);
6955
7021
  if (abortCtrl.signal.aborted) {
6956
7022
  throw new DOMException("Export cancelled", "AbortError");
@@ -6961,7 +7027,7 @@ function useExportSaveAs(input) {
6961
7027
  setExportProgress(95);
6962
7028
  setExportStatusMessage("Downloading...");
6963
7029
  const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
6964
- chunkY2KIB3QH_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
7030
+ chunk7JPLVECA_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
6965
7031
  setExportProgress(100);
6966
7032
  } catch (err) {
6967
7033
  if (err.name !== "AbortError") {
@@ -6984,7 +7050,7 @@ function useExportSaveAs(input) {
6984
7050
  const blob = new Blob([data], {
6985
7051
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
6986
7052
  });
6987
- chunkY2KIB3QH_js.downloadBlob(blob, `${baseName}.${ext}`);
7053
+ chunk7JPLVECA_js.downloadBlob(blob, `${baseName}.${ext}`);
6988
7054
  } catch (err) {
6989
7055
  console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
6990
7056
  }
@@ -6997,14 +7063,14 @@ function useExportSaveAs(input) {
6997
7063
  const pptxGuides = guides.map((g) => ({
6998
7064
  id: g.id,
6999
7065
  orientation: g.axis === "h" ? "horz" : "vert",
7000
- positionEmu: chunkY2KIB3QH_js.guidePxToEmu(g.position)
7066
+ positionEmu: chunk7JPLVECA_js.guidePxToEmu(g.position)
7001
7067
  }));
7002
7068
  return {
7003
7069
  ...slide,
7004
7070
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
7005
7071
  };
7006
7072
  });
7007
- const slidesToSave = chunkY2KIB3QH_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7073
+ const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7008
7074
  const saveOptions = {
7009
7075
  headerFooter,
7010
7076
  presentationProperties,
@@ -7018,23 +7084,16 @@ function useExportSaveAs(input) {
7018
7084
  handoutMaster,
7019
7085
  outputFormat: format
7020
7086
  };
7021
- if (password) {
7022
- return handler.saveEncrypted(
7023
- slidesToSave,
7024
- password,
7025
- saveOptions
7026
- );
7027
- }
7028
- return handler.save(slidesToSave, saveOptions);
7087
+ return chunk7JPLVECA_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7029
7088
  };
7030
7089
  const handleExportJson = () => {
7031
7090
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7032
7091
  const data = {
7033
- slides: chunkY2KIB3QH_js.buildSaveSlides(slides, templateElementsBySlideId),
7092
+ slides: chunk7JPLVECA_js.buildSaveSlides(slides, templateElementsBySlideId),
7034
7093
  width: canvasSize.width,
7035
7094
  height: canvasSize.height,
7036
- widthEmu: chunkY2KIB3QH_js.guidePxToEmu(canvasSize.width),
7037
- heightEmu: chunkY2KIB3QH_js.guidePxToEmu(canvasSize.height),
7095
+ widthEmu: chunk7JPLVECA_js.guidePxToEmu(canvasSize.width),
7096
+ heightEmu: chunk7JPLVECA_js.guidePxToEmu(canvasSize.height),
7038
7097
  theme,
7039
7098
  headerFooter,
7040
7099
  presentationProperties,
@@ -7048,7 +7107,7 @@ function useExportSaveAs(input) {
7048
7107
  handoutMaster
7049
7108
  };
7050
7109
  try {
7051
- chunkY2KIB3QH_js.exportDeckJson(data, sourceName);
7110
+ chunk7JPLVECA_js.exportDeckJson(data, sourceName);
7052
7111
  } catch (err) {
7053
7112
  console.error("[PowerPointViewer] JSON export failed:", err);
7054
7113
  }
@@ -7088,7 +7147,7 @@ function safeConfirm(message) {
7088
7147
  }
7089
7148
  }
7090
7149
  function downloadBlob2(blob, filename) {
7091
- chunkY2KIB3QH_js.downloadBlob(blob, chunkY2KIB3QH_js.sanitizeDownloadFilename(filename));
7150
+ chunk7JPLVECA_js.downloadBlob(blob, chunk7JPLVECA_js.sanitizeDownloadFilename(filename));
7092
7151
  }
7093
7152
 
7094
7153
  // src/viewer/hooks/useExportHandlers.ts
@@ -7194,21 +7253,21 @@ function useExportHandlers(input) {
7194
7253
  {
7195
7254
  scale: 2,
7196
7255
  onProgress: (current, total) => {
7197
- setExportProgress(chunkY2KIB3QH_js.slideProgressPercent(current, total));
7198
- setExportStatusMessage(chunkY2KIB3QH_js.slideStatusLabel("Rendering", current, total));
7256
+ setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7257
+ setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Rendering", current, total));
7199
7258
  },
7200
7259
  signal: abortCtrl.signal
7201
7260
  }
7202
7261
  );
7203
- setExportProgress(chunkY2KIB3QH_js.EXPORT_ASSEMBLING_PERCENT);
7262
+ setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7204
7263
  setExportStatusMessage("Building PDF...");
7205
7264
  await new Promise((r) => {
7206
7265
  setTimeout(r, 100);
7207
7266
  });
7208
- setExportProgress(chunkY2KIB3QH_js.EXPORT_DONE_PERCENT);
7267
+ setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7209
7268
  setExportStatusMessage("Done!");
7210
7269
  } catch (err) {
7211
- if (!chunkY2KIB3QH_js.isExportAbortError(err)) {
7270
+ if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7212
7271
  console.error("[PowerPointViewer] PDF export failed:", err);
7213
7272
  }
7214
7273
  } finally {
@@ -7238,21 +7297,21 @@ function useExportHandlers(input) {
7238
7297
  {
7239
7298
  scale: 2,
7240
7299
  onProgress: (current, total) => {
7241
- setExportProgress(chunkY2KIB3QH_js.slideProgressPercent(current, total));
7242
- setExportStatusMessage(chunkY2KIB3QH_js.slideStatusLabel("Rendering", current, total));
7300
+ setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7301
+ setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Rendering", current, total));
7243
7302
  },
7244
7303
  signal: abortCtrl.signal
7245
7304
  }
7246
7305
  );
7247
- setExportProgress(chunkY2KIB3QH_js.EXPORT_ASSEMBLING_PERCENT);
7306
+ setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7248
7307
  setExportStatusMessage("Building PDF...");
7249
7308
  await new Promise((r) => {
7250
7309
  setTimeout(r, 100);
7251
7310
  });
7252
- setExportProgress(chunkY2KIB3QH_js.EXPORT_DONE_PERCENT);
7311
+ setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7253
7312
  setExportStatusMessage("Done!");
7254
7313
  } catch (err) {
7255
- if (!chunkY2KIB3QH_js.isExportAbortError(err)) {
7314
+ if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7256
7315
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7257
7316
  }
7258
7317
  } finally {
@@ -7293,22 +7352,22 @@ function useExportHandlers(input) {
7293
7352
  scale: 1,
7294
7353
  slideDurationMs: 3e3,
7295
7354
  onProgress: (current, total) => {
7296
- setExportProgress(chunkY2KIB3QH_js.slideProgressPercent(current, total, 45));
7297
- setExportStatusMessage(chunkY2KIB3QH_js.slideStatusLabel("Capturing", current, total));
7355
+ setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total, 45));
7356
+ setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Capturing", current, total));
7298
7357
  },
7299
7358
  onRecordProgress: (current, total) => {
7300
- setExportProgress(chunkY2KIB3QH_js.recordProgressPercent(current, total));
7301
- setExportStatusMessage(chunkY2KIB3QH_js.slideStatusLabel("Recording", current, total));
7359
+ setExportProgress(chunk7JPLVECA_js.recordProgressPercent(current, total));
7360
+ setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Recording", current, total));
7302
7361
  },
7303
7362
  signal: abortCtrl.signal
7304
7363
  }
7305
7364
  );
7306
- setExportProgress(chunkY2KIB3QH_js.EXPORT_ASSEMBLING_PERCENT);
7365
+ setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7307
7366
  setExportStatusMessage("Saving file...");
7308
7367
  downloadBlob2(blob, "presentation.webm");
7309
- setExportProgress(chunkY2KIB3QH_js.EXPORT_DONE_PERCENT);
7368
+ setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7310
7369
  } catch (err) {
7311
- if (!chunkY2KIB3QH_js.isExportAbortError(err)) {
7370
+ if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7312
7371
  console.error("[PowerPointViewer] Video export failed:", err);
7313
7372
  }
7314
7373
  } finally {
@@ -7336,18 +7395,18 @@ function useExportHandlers(input) {
7336
7395
  scale: 0.5,
7337
7396
  slideDurationMs: 2e3,
7338
7397
  onProgress: (current, total) => {
7339
- setExportProgress(chunkY2KIB3QH_js.slideProgressPercent(current, total));
7340
- setExportStatusMessage(chunkY2KIB3QH_js.slideStatusLabel("Encoding", current, total));
7398
+ setExportProgress(chunk7JPLVECA_js.slideProgressPercent(current, total));
7399
+ setExportStatusMessage(chunk7JPLVECA_js.slideStatusLabel("Encoding", current, total));
7341
7400
  },
7342
7401
  signal: abortCtrl.signal
7343
7402
  }
7344
7403
  );
7345
- setExportProgress(chunkY2KIB3QH_js.EXPORT_ASSEMBLING_PERCENT);
7404
+ setExportProgress(chunk7JPLVECA_js.EXPORT_ASSEMBLING_PERCENT);
7346
7405
  setExportStatusMessage("Saving file...");
7347
7406
  downloadBlob2(blob, "presentation.gif");
7348
- setExportProgress(chunkY2KIB3QH_js.EXPORT_DONE_PERCENT);
7407
+ setExportProgress(chunk7JPLVECA_js.EXPORT_DONE_PERCENT);
7349
7408
  } catch (err) {
7350
- if (!chunkY2KIB3QH_js.isExportAbortError(err)) {
7409
+ if (!chunk7JPLVECA_js.isExportAbortError(err)) {
7351
7410
  console.error("[PowerPointViewer] GIF export failed:", err);
7352
7411
  }
7353
7412
  } finally {
@@ -7388,7 +7447,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
7388
7447
  }
7389
7448
  printWindow.document.open();
7390
7449
  printWindow.document.write(
7391
- chunkY2KIB3QH_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7450
+ chunk7JPLVECA_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7392
7451
  );
7393
7452
  printWindow.document.close();
7394
7453
  printWindow.focus();
@@ -7449,7 +7508,7 @@ function usePrintHandlers(input) {
7449
7508
  if (svgs.length === 0) {
7450
7509
  return;
7451
7510
  }
7452
- const printDoc = chunkY2KIB3QH_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7511
+ const printDoc = chunk7JPLVECA_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7453
7512
  title: "Slides (Vector)",
7454
7513
  orientation: settings.orientation,
7455
7514
  colorFilter
@@ -7485,7 +7544,7 @@ function usePrintHandlers(input) {
7485
7544
  if (settings.printWhat === "outline") {
7486
7545
  openPrintWindow(
7487
7546
  "Outline",
7488
- `<div class="outline-page">${chunkY2KIB3QH_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7547
+ `<div class="outline-page">${chunk7JPLVECA_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7489
7548
  settings.orientation,
7490
7549
  colorFilter,
7491
7550
  settings.frameSlides
@@ -7510,7 +7569,7 @@ function usePrintHandlers(input) {
7510
7569
  if (settings.printWhat === "slides") {
7511
7570
  openPrintWindow(
7512
7571
  "Slides",
7513
- chunkY2KIB3QH_js.buildSlidesHtml(slideImages, slideIndices),
7572
+ chunk7JPLVECA_js.buildSlidesHtml(slideImages, slideIndices),
7514
7573
  settings.orientation,
7515
7574
  colorFilter,
7516
7575
  settings.frameSlides
@@ -7520,7 +7579,7 @@ function usePrintHandlers(input) {
7520
7579
  if (settings.printWhat === "notes") {
7521
7580
  openPrintWindow(
7522
7581
  "Notes Pages",
7523
- chunkY2KIB3QH_js.buildNotesHtml(slideImages, slideIndices, slides),
7582
+ chunk7JPLVECA_js.buildNotesHtml(slideImages, slideIndices, slides),
7524
7583
  "portrait",
7525
7584
  colorFilter,
7526
7585
  settings.frameSlides
@@ -7531,7 +7590,7 @@ function usePrintHandlers(input) {
7531
7590
  const spp = settings.slidesPerPage;
7532
7591
  openPrintWindow(
7533
7592
  `Handout ${spp} per page`,
7534
- chunkY2KIB3QH_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7593
+ chunk7JPLVECA_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7535
7594
  "portrait",
7536
7595
  colorFilter,
7537
7596
  settings.frameSlides
@@ -7595,8 +7654,8 @@ function useThemeHandlers(input) {
7595
7654
  return;
7596
7655
  }
7597
7656
  await handler.updateThemeColorScheme(colorScheme);
7598
- const previousMap = theme?.colorScheme ? chunkY2KIB3QH_js.buildThemeColorMap(theme.colorScheme) : {};
7599
- setSlides((prev) => chunkY2KIB3QH_js.reResolveSlideColors(prev, previousMap, colorScheme));
7657
+ const previousMap = theme?.colorScheme ? chunk7JPLVECA_js.buildThemeColorMap(theme.colorScheme) : {};
7658
+ setSlides((prev) => chunk7JPLVECA_js.reResolveSlideColors(prev, previousMap, colorScheme));
7600
7659
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7601
7660
  bumpHistory();
7602
7661
  history.markDirty();
@@ -7701,7 +7760,7 @@ function useThemeSwitching(input) {
7701
7760
  }
7702
7761
  try {
7703
7762
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7704
- const newData = chunkY2KIB3QH_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7763
+ const newData = chunk7JPLVECA_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7705
7764
  onDataChange(newData);
7706
7765
  onThemeChanged?.(preset);
7707
7766
  } catch (error) {
@@ -7718,7 +7777,7 @@ function useThemeSwitching(input) {
7718
7777
  }
7719
7778
  try {
7720
7779
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7721
- const newData = chunkY2KIB3QH_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7780
+ const newData = chunk7JPLVECA_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7722
7781
  onDataChange(newData);
7723
7782
  } catch (error) {
7724
7783
  console.error("Failed to switch to custom theme:", error);
@@ -7730,12 +7789,12 @@ function useThemeSwitching(input) {
7730
7789
  if (!data?.theme?.colorScheme) {
7731
7790
  return void 0;
7732
7791
  }
7733
- return chunkY2KIB3QH_js.THEME_PRESETS.find(
7734
- (p) => chunkY2KIB3QH_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7792
+ return chunk7JPLVECA_js.THEME_PRESETS.find(
7793
+ (p) => chunk7JPLVECA_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7735
7794
  );
7736
7795
  }, [data?.theme?.colorScheme]);
7737
7796
  return {
7738
- presets: chunkY2KIB3QH_js.THEME_PRESETS,
7797
+ presets: chunk7JPLVECA_js.THEME_PRESETS,
7739
7798
  switchToPreset,
7740
7799
  switchToCustom,
7741
7800
  currentPreset
@@ -7810,7 +7869,7 @@ function usePropertyHandlers(input) {
7810
7869
  }
7811
7870
  try {
7812
7871
  const ab = await file.arrayBuffer();
7813
- const h = new chunkY2KIB3QH_js.PptxHandler();
7872
+ const h = new chunk7JPLVECA_js.PptxHandler();
7814
7873
  const other = await h.load(ab);
7815
7874
  if (!other) {
7816
7875
  return;
@@ -7820,7 +7879,7 @@ function usePropertyHandlers(input) {
7820
7879
  width: canvasSize.width,
7821
7880
  height: canvasSize.height
7822
7881
  };
7823
- setCompareResult(chunkY2KIB3QH_js.comparePresentation(cur, other));
7882
+ setCompareResult(chunk7JPLVECA_js.comparePresentation(cur, other));
7824
7883
  setIsComparePanelOpen(true);
7825
7884
  } catch (err) {
7826
7885
  console.warn("Compare failed:", err);
@@ -7837,7 +7896,7 @@ function usePropertyHandlers(input) {
7837
7896
  if (!diff || diff.status === "unchanged") {
7838
7897
  return;
7839
7898
  }
7840
- setSlides((prev) => chunkY2KIB3QH_js.applyAcceptSlide(prev, diff));
7899
+ setSlides((prev) => chunk7JPLVECA_js.applyAcceptSlide(prev, diff));
7841
7900
  setIsDirty(true);
7842
7901
  },
7843
7902
  [compareResult, setSlides, setIsDirty]
@@ -7848,10 +7907,10 @@ function usePropertyHandlers(input) {
7848
7907
  if (!compareResult) {
7849
7908
  return;
7850
7909
  }
7851
- setSlides((prev) => chunkY2KIB3QH_js.applyAcceptAllSlides(prev, compareResult));
7910
+ setSlides((prev) => chunk7JPLVECA_js.applyAcceptAllSlides(prev, compareResult));
7852
7911
  setIsDirty(true);
7853
7912
  }, [compareResult, setSlides, setIsDirty]);
7854
- const usedFontFamilies = react.useMemo(() => chunkY2KIB3QH_js.collectUsedFonts(slides), [slides]);
7913
+ const usedFontFamilies = react.useMemo(() => chunk7JPLVECA_js.collectUsedFonts(slides), [slides]);
7855
7914
  return {
7856
7915
  handleUpdateNotes,
7857
7916
  handleUpdateSlide,
@@ -7970,7 +8029,7 @@ function useIsMobile(input) {
7970
8029
  const containerRef = input?.containerRef;
7971
8030
  const isTouchDevice = react.useSyncExternalStore(
7972
8031
  subscribeTouchCapability,
7973
- chunkY2KIB3QH_js.detectTouchDevice,
8032
+ chunk7JPLVECA_js.detectTouchDevice,
7974
8033
  () => false
7975
8034
  // server snapshot
7976
8035
  );
@@ -7986,7 +8045,7 @@ function useIsMobile(input) {
7986
8045
  }
7987
8046
  return containerRef?.current?.clientHeight ?? window.innerHeight;
7988
8047
  });
7989
- const [orientation, setOrientation] = react.useState(chunkY2KIB3QH_js.detectOrientation);
8048
+ const [orientation, setOrientation] = react.useState(chunk7JPLVECA_js.detectOrientation);
7990
8049
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
7991
8050
  const [initialViewportHeight] = react.useState(
7992
8051
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -8030,7 +8089,7 @@ function useIsMobile(input) {
8030
8089
  return;
8031
8090
  }
8032
8091
  const handleOrientationChange = () => {
8033
- setOrientation(chunkY2KIB3QH_js.detectOrientation());
8092
+ setOrientation(chunk7JPLVECA_js.detectOrientation());
8034
8093
  };
8035
8094
  if (screen.orientation) {
8036
8095
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -8060,9 +8119,9 @@ function useIsMobile(input) {
8060
8119
  window.addEventListener("resize", handleResize);
8061
8120
  return () => window.removeEventListener("resize", handleResize);
8062
8121
  }, [isTouchDevice, initialViewportHeight]);
8063
- const isMobile = chunkY2KIB3QH_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8064
- const isTablet = !isMobile && containerWidth >= chunkY2KIB3QH_js.MOBILE_BREAKPOINT && containerWidth < chunkY2KIB3QH_js.TABLET_BREAKPOINT;
8065
- const isDesktop = !isMobile && containerWidth >= chunkY2KIB3QH_js.TABLET_BREAKPOINT;
8122
+ const isMobile = chunk7JPLVECA_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8123
+ const isTablet = !isMobile && containerWidth >= chunk7JPLVECA_js.MOBILE_BREAKPOINT && containerWidth < chunk7JPLVECA_js.TABLET_BREAKPOINT;
8124
+ const isDesktop = !isMobile && containerWidth >= chunk7JPLVECA_js.TABLET_BREAKPOINT;
8066
8125
  return {
8067
8126
  isMobile,
8068
8127
  isTablet,
@@ -8103,7 +8162,8 @@ function useViewerDialogs(input) {
8103
8162
  preMasterMode,
8104
8163
  hasDigitalSignatures,
8105
8164
  isDirty,
8106
- history
8165
+ history,
8166
+ embeddedFontFamilies
8107
8167
  } = input;
8108
8168
  const [isSmartArtDialogOpen, setIsSmartArtDialogOpen] = react.useState(false);
8109
8169
  const [isEquationDialogOpen, setIsEquationDialogOpen] = react.useState(false);
@@ -8121,13 +8181,21 @@ function useViewerDialogs(input) {
8121
8181
  const [editingEquationOmml, setEditingEquationOmml] = react.useState(
8122
8182
  null
8123
8183
  );
8124
- const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
8184
+ const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8185
+ const fontEmbedding = react.useMemo(
8186
+ () => chunk7JPLVECA_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8187
+ [embeddedFontKey]
8188
+ );
8189
+ const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
8190
+ react.useEffect(() => {
8191
+ setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8192
+ }, [fontEmbedding]);
8125
8193
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8126
- () => typeof window !== "undefined" ? chunkY2KIB3QH_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8194
+ () => typeof window !== "undefined" ? chunk7JPLVECA_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8127
8195
  );
8128
8196
  react.useEffect(() => {
8129
8197
  const handleWindow = () => setIsNarrowViewport(
8130
- chunkY2KIB3QH_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8198
+ chunk7JPLVECA_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8131
8199
  );
8132
8200
  let observer = null;
8133
8201
  let raf = 0;
@@ -8141,12 +8209,12 @@ function useViewerDialogs(input) {
8141
8209
  const entry = entries[0];
8142
8210
  if (entry) {
8143
8211
  setIsNarrowViewport(
8144
- chunkY2KIB3QH_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8212
+ chunk7JPLVECA_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8145
8213
  );
8146
8214
  }
8147
8215
  });
8148
8216
  observer.observe(el);
8149
- setIsNarrowViewport(chunkY2KIB3QH_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8217
+ setIsNarrowViewport(chunk7JPLVECA_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8150
8218
  };
8151
8219
  attach();
8152
8220
  window.addEventListener("resize", handleWindow);
@@ -8288,6 +8356,7 @@ function useViewerDialogs(input) {
8288
8356
  setEditingEquationOmml,
8289
8357
  embedFontsEnabled,
8290
8358
  setEmbedFontsEnabled,
8359
+ fontEmbedding,
8291
8360
  isNarrowViewport,
8292
8361
  handleEnterMasterView,
8293
8362
  handleCloseMasterView,
@@ -8304,20 +8373,20 @@ function useViewerDialogs(input) {
8304
8373
  }
8305
8374
  function computeGridSpacingPx(presentationGridSpacing) {
8306
8375
  if (presentationGridSpacing) {
8307
- const px = Math.round(presentationGridSpacing.cx / chunkWK22Z7PK_js.EMU_PER_PX);
8376
+ const px = Math.round(presentationGridSpacing.cx / chunk5BXATG54_js.EMU_PER_PX);
8308
8377
  if (px > 0) {
8309
8378
  return px;
8310
8379
  }
8311
8380
  }
8312
- return chunkWK22Z7PK_js.GRID_SIZE;
8381
+ return chunk5BXATG54_js.GRID_SIZE;
8313
8382
  }
8314
8383
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8315
8384
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8316
- return chunkY2KIB3QH_js.resolveShowSlideIndexes(slides, activeShow);
8385
+ return chunk7JPLVECA_js.resolveShowSlideIndexes(slides, activeShow);
8317
8386
  }
8318
8387
  function computeSlideSectionGroups(slides, sections) {
8319
- return chunkY2KIB3QH_js.groupSlidesBySection(sections, slides).map((group) => ({
8320
- id: group.section?.id ?? (sections.length > 0 ? chunkWK22Z7PK_js.UNGROUPED_SECTION_ID : "default"),
8388
+ return chunk7JPLVECA_js.groupSlidesBySection(sections, slides).map((group) => ({
8389
+ id: group.section?.id ?? (sections.length > 0 ? chunk5BXATG54_js.UNGROUPED_SECTION_ID : "default"),
8321
8390
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8322
8391
  slideIndexes: group.slideIndexes,
8323
8392
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8325,30 +8394,15 @@ function computeSlideSectionGroups(slides, sections) {
8325
8394
  }));
8326
8395
  }
8327
8396
  function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8328
- if (mode !== "master") {
8397
+ if (mode !== "master" || !activeMaster) {
8329
8398
  return void 0;
8330
8399
  }
8331
- if (activeLayout) {
8332
- return {
8333
- id: activeLayout.path,
8334
- rId: "",
8335
- slideNumber: 0,
8336
- elements: activeLayout.elements ?? [],
8337
- backgroundColor: activeLayout.backgroundColor ?? activeMaster?.backgroundColor,
8338
- backgroundImage: activeLayout.backgroundImage ?? activeMaster?.backgroundImage
8339
- };
8340
- }
8341
- if (activeMaster) {
8342
- return {
8343
- id: activeMaster.path,
8344
- rId: "",
8345
- slideNumber: 0,
8346
- elements: activeMaster.elements ?? [],
8347
- backgroundColor: activeMaster.backgroundColor,
8348
- backgroundImage: activeMaster.backgroundImage
8349
- };
8350
- }
8351
- return void 0;
8400
+ const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8401
+ return chunk7JPLVECA_js.masterViewPseudoSlide(document2, {
8402
+ tab: "slides",
8403
+ masterIndex: 0,
8404
+ layoutIndex: activeLayout ? 0 : null
8405
+ });
8352
8406
  }
8353
8407
  function useDerivedSlideState(input) {
8354
8408
  const { t } = reactI18next.useTranslation();
@@ -8372,7 +8426,7 @@ function useDerivedSlideState(input) {
8372
8426
  );
8373
8427
  const slideSectionGroups = react.useMemo(
8374
8428
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8375
- if (group.id === chunkWK22Z7PK_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8429
+ if (group.id === chunk5BXATG54_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8376
8430
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8377
8431
  }
8378
8432
  if (group.id === "default" && group.label === "Slides") {
@@ -8475,13 +8529,13 @@ function useAnnotationHandlers(input) {
8475
8529
  }, [annotations, setMode, setSlides, history]);
8476
8530
  const handleSetMode = react.useCallback(
8477
8531
  (nextMode) => {
8478
- if (mode === "present" && nextMode !== "present" && !chunkY2KIB3QH_js.mayLeaveSlideShow()) {
8532
+ if (mode === "present" && nextMode !== "present" && !chunk7JPLVECA_js.mayLeaveSlideShow()) {
8479
8533
  return;
8480
8534
  }
8481
8535
  if (nextMode === "present") {
8482
8536
  presentation.enterPresentMode();
8483
8537
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8484
- chunkY2KIB3QH_js.stopAllPersistentAudio();
8538
+ chunk7JPLVECA_js.stopAllPersistentAudio();
8485
8539
  pendingModeAfterAnnotationsRef.current = nextMode;
8486
8540
  if (promptKeepInkAnnotations) {
8487
8541
  setShowKeepAnnotationsDialog(true);
@@ -8490,7 +8544,7 @@ function useAnnotationHandlers(input) {
8490
8544
  }
8491
8545
  } else {
8492
8546
  if (mode === "present") {
8493
- chunkY2KIB3QH_js.stopAllPersistentAudio();
8547
+ chunk7JPLVECA_js.stopAllPersistentAudio();
8494
8548
  }
8495
8549
  setMode(nextMode);
8496
8550
  }
@@ -8543,7 +8597,9 @@ function useSerialize(input) {
8543
8597
  handlerRef,
8544
8598
  inlineEditingElementIdRef,
8545
8599
  inlineEditingTextRef,
8546
- password
8600
+ password,
8601
+ embedFonts = true,
8602
+ purpose
8547
8603
  } = input;
8548
8604
  return react.useCallback(async () => {
8549
8605
  const handler = handlerRef.current;
@@ -8556,13 +8612,13 @@ function useSerialize(input) {
8556
8612
  let processedSlide = slide;
8557
8613
  if (pendingEditId) {
8558
8614
  const updatedElements = slide.elements.map((el) => {
8559
- if (el.id !== pendingEditId || !chunkY2KIB3QH_js.hasTextProperties(el)) {
8615
+ if (el.id !== pendingEditId || !chunk7JPLVECA_js.hasTextProperties(el)) {
8560
8616
  return el;
8561
8617
  }
8562
8618
  return {
8563
8619
  ...el,
8564
8620
  text: pendingEditText,
8565
- textSegments: chunkY2KIB3QH_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8621
+ textSegments: chunk7JPLVECA_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8566
8622
  };
8567
8623
  });
8568
8624
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8575,14 +8631,14 @@ function useSerialize(input) {
8575
8631
  const pptxGuides = guides.map((g) => ({
8576
8632
  id: g.id,
8577
8633
  orientation: g.axis === "h" ? "horz" : "vert",
8578
- positionEmu: chunkY2KIB3QH_js.guidePxToEmu(g.position)
8634
+ positionEmu: chunk7JPLVECA_js.guidePxToEmu(g.position)
8579
8635
  }));
8580
8636
  return {
8581
8637
  ...processedSlide,
8582
8638
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8583
8639
  };
8584
8640
  });
8585
- const slidesToSave = chunkY2KIB3QH_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8641
+ const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8586
8642
  const saveOptions = {
8587
8643
  headerFooter,
8588
8644
  presentationProperties,
@@ -8593,12 +8649,10 @@ function useSerialize(input) {
8593
8649
  customProperties: customProperties.length > 0 ? customProperties : void 0,
8594
8650
  tags: tagCollections.length > 0 ? tagCollections : void 0,
8595
8651
  notesMaster,
8596
- handoutMaster
8652
+ handoutMaster,
8653
+ ...chunk7JPLVECA_js.embeddedFontSaveOptions(embedFonts)
8597
8654
  };
8598
- if (password) {
8599
- return handler.saveEncrypted(slidesToSave, password, saveOptions);
8600
- }
8601
- return handler.save(slidesToSave, saveOptions);
8655
+ return chunk7JPLVECA_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8602
8656
  }, [
8603
8657
  slides,
8604
8658
  templateElementsBySlideId,
@@ -8617,7 +8671,9 @@ function useSerialize(input) {
8617
8671
  handlerRef,
8618
8672
  inlineEditingElementIdRef,
8619
8673
  inlineEditingTextRef,
8620
- password
8674
+ password,
8675
+ embedFonts,
8676
+ purpose
8621
8677
  ]);
8622
8678
  }
8623
8679
 
@@ -8751,7 +8807,7 @@ function usePresentationSetup(input) {
8751
8807
  containerRef,
8752
8808
  content,
8753
8809
  onSetMode: (nextMode) => {
8754
- if (mode === "present" && nextMode !== "present" && !chunkY2KIB3QH_js.mayLeaveSlideShow()) {
8810
+ if (mode === "present" && nextMode !== "present" && !chunk7JPLVECA_js.mayLeaveSlideShow()) {
8755
8811
  return;
8756
8812
  }
8757
8813
  if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
@@ -8759,7 +8815,7 @@ function usePresentationSetup(input) {
8759
8815
  setShowKeepAnnotationsDialog(true);
8760
8816
  } else {
8761
8817
  if (mode === "present" && nextMode !== "present") {
8762
- chunkY2KIB3QH_js.stopAllPersistentAudio();
8818
+ chunk7JPLVECA_js.stopAllPersistentAudio();
8763
8819
  stopAnimationSound();
8764
8820
  }
8765
8821
  setMode(nextMode);
@@ -8813,10 +8869,10 @@ function usePresentationSetup(input) {
8813
8869
  onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
8814
8870
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8815
8871
  onSaveRehearsalTimings: (timings) => {
8816
- setSlides((prev) => chunkY2KIB3QH_js.applyRehearsalTimings(prev, timings));
8872
+ setSlides((prev) => chunk7JPLVECA_js.applyRehearsalTimings(prev, timings));
8817
8873
  history.markDirty();
8818
8874
  },
8819
- loopContinuously: chunkY2KIB3QH_js.shouldLoopContinuously(presentationProperties),
8875
+ loopContinuously: chunk7JPLVECA_js.shouldLoopContinuously(presentationProperties),
8820
8876
  showWithAnimation: presentationProperties.showWithAnimation,
8821
8877
  useTimings: presentationProperties.advanceMode !== "manual",
8822
8878
  endWithBlackSlide
@@ -8843,6 +8899,33 @@ function useEditorOperations(input) {
8843
8899
  handlerRef,
8844
8900
  transformCommittedText
8845
8901
  } = input;
8902
+ const masterView = react.useMemo(
8903
+ () => ({
8904
+ target: mode === "master" ? {
8905
+ tab: state.masterViewTab,
8906
+ masterIndex: state.activeMasterIndex,
8907
+ layoutIndex: state.activeLayoutIndex
8908
+ } : null,
8909
+ slideMasters: state.slideMasters,
8910
+ notesMaster: state.notesMaster,
8911
+ handoutMaster: state.handoutMaster,
8912
+ setSlideMasters: state.setSlideMasters,
8913
+ setNotesMaster: state.setNotesMaster,
8914
+ setHandoutMaster: state.setHandoutMaster
8915
+ }),
8916
+ [
8917
+ mode,
8918
+ state.masterViewTab,
8919
+ state.activeMasterIndex,
8920
+ state.activeLayoutIndex,
8921
+ state.slideMasters,
8922
+ state.notesMaster,
8923
+ state.handoutMaster,
8924
+ state.setSlideMasters,
8925
+ state.setNotesMaster,
8926
+ state.setHandoutMaster
8927
+ ]
8928
+ );
8846
8929
  const ops = useElementOperations({
8847
8930
  activeSlide,
8848
8931
  activeSlideIndex,
@@ -8850,6 +8933,7 @@ function useEditorOperations(input) {
8850
8933
  selectedElementId,
8851
8934
  editTemplateMode: state.editTemplateMode,
8852
8935
  templateElements: state.templateElements,
8936
+ masterView,
8853
8937
  history,
8854
8938
  setSlides: state.setSlides,
8855
8939
  setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
@@ -8981,7 +9065,7 @@ function useEditorOperations(input) {
8981
9065
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
8982
9066
  react.useEffect(() => {
8983
9067
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
8984
- copiedFormatRef.current = chunkY2KIB3QH_js.copyFormatFromElement(selectedElement);
9068
+ copiedFormatRef.current = chunk7JPLVECA_js.copyFormatFromElement(selectedElement);
8985
9069
  } else if (!formatPainterActive) {
8986
9070
  copiedFormatRef.current = null;
8987
9071
  }
@@ -9007,12 +9091,12 @@ function useEditorOperations(input) {
9007
9091
  e.stopPropagation();
9008
9092
  const element = elementLookup.get(elementId);
9009
9093
  if (element) {
9010
- const updated = chunkY2KIB3QH_js.applyFormatToElement(element, copiedFormatRef.current);
9094
+ const updated = chunk7JPLVECA_js.applyFormatToElement(element, copiedFormatRef.current);
9011
9095
  const updates = {};
9012
- if (chunkY2KIB3QH_js.hasShapeProperties(updated)) {
9096
+ if (chunk7JPLVECA_js.hasShapeProperties(updated)) {
9013
9097
  updates.shapeStyle = updated.shapeStyle;
9014
9098
  }
9015
- if (chunkY2KIB3QH_js.hasTextProperties(updated)) {
9099
+ if (chunk7JPLVECA_js.hasTextProperties(updated)) {
9016
9100
  updates.textStyle = updated.textStyle;
9017
9101
  }
9018
9102
  ops.updateElementById(elementId, updates);
@@ -9060,6 +9144,7 @@ function useIOHandlers(input) {
9060
9144
  zoom,
9061
9145
  handlerRef,
9062
9146
  serializeSlides,
9147
+ serializeForRecovery,
9063
9148
  setContent,
9064
9149
  onContentChange,
9065
9150
  password
@@ -9098,7 +9183,9 @@ function useIOHandlers(input) {
9098
9183
  });
9099
9184
  const themeHandlers = useThemeHandlers({
9100
9185
  handlerRef,
9101
- serializeSlides,
9186
+ // Theme apply re-serialises and re-parses through `setContent`, so these
9187
+ // bytes go back into our own loader: plaintext, never the protected save.
9188
+ serializeSlides: serializeForRecovery,
9102
9189
  setContent,
9103
9190
  onContentChange,
9104
9191
  setTheme: state.setTheme,
@@ -9161,7 +9248,7 @@ function collectReferencedFontFamilies(slides) {
9161
9248
  const families = /* @__PURE__ */ new Set();
9162
9249
  for (const slide of slides) {
9163
9250
  for (const el of slide.elements) {
9164
- if (chunkY2KIB3QH_js.hasTextProperties(el) && el.textSegments) {
9251
+ if (chunk7JPLVECA_js.hasTextProperties(el) && el.textSegments) {
9165
9252
  for (const seg of el.textSegments) {
9166
9253
  if (seg.style.fontFamily) {
9167
9254
  families.add(seg.style.fontFamily);
@@ -9291,6 +9378,8 @@ function useContentLifecycle(input) {
9291
9378
  content,
9292
9379
  filePath,
9293
9380
  autosaveEnabled = true,
9381
+ autosaveIntervalSeconds,
9382
+ embedFonts = true,
9294
9383
  slides,
9295
9384
  state,
9296
9385
  history,
@@ -9340,7 +9429,7 @@ function useContentLifecycle(input) {
9340
9429
  actionSoundHandlerRef.current = handlerRef.current;
9341
9430
  }, [handlerRef, actionSoundHandlerRef, state.loading]);
9342
9431
  useFontInjection({ embeddedFonts: state.embeddedFonts, slides });
9343
- const serializeSlides = useSerialize({
9432
+ const serializeInput = {
9344
9433
  slides,
9345
9434
  templateElementsBySlideId: state.templateElementsBySlideId,
9346
9435
  activeSlideIndex: state.activeSlideIndex,
@@ -9358,28 +9447,32 @@ function useContentLifecycle(input) {
9358
9447
  handlerRef,
9359
9448
  inlineEditingElementIdRef: state.inlineEditingElementIdRef,
9360
9449
  inlineEditingTextRef: state.inlineEditingTextRef,
9361
- password
9362
- });
9450
+ password,
9451
+ embedFonts
9452
+ };
9453
+ const serializeSlides = useSerialize(serializeInput);
9454
+ const serializeForRecovery = useSerialize({ ...serializeInput, purpose: "recovery-snapshot" });
9363
9455
  const { autosaveStatus } = useAutosave({
9364
9456
  isDirty: state.isDirty,
9365
9457
  filePath,
9366
- serializeSlides,
9367
- enabled: autosaveEnabled
9458
+ serializeSlides: serializeForRecovery,
9459
+ enabled: autosaveEnabled,
9460
+ ...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds }
9368
9461
  });
9369
- return { handlerRef, serializeSlides, autosaveStatus };
9462
+ return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus };
9370
9463
  }
9371
9464
  function useKeyboardShortcuts(input) {
9372
9465
  const inputRef = react.useRef(input);
9373
9466
  inputRef.current = input;
9374
9467
  const handleKeyDown = react.useCallback((e) => {
9375
9468
  const current = inputRef.current;
9376
- const { action, dx, dy } = chunkY2KIB3QH_js.mapEditorKey(e, {
9469
+ const { action, dx, dy } = chunk7JPLVECA_js.mapEditorKey(e, {
9377
9470
  canEdit: current.canEdit,
9378
9471
  isPresenting: current.mode !== "edit",
9379
9472
  hasSelection: current.hasSelection,
9380
9473
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9381
9474
  isDrawing: current.activeTool !== "select",
9382
- isTextInputTarget: chunkY2KIB3QH_js.isEditorTextInputTarget(e.target)
9475
+ isTextInputTarget: chunk7JPLVECA_js.isEditorTextInputTarget(e.target)
9383
9476
  });
9384
9477
  if (action === null) {
9385
9478
  return;
@@ -9530,6 +9623,7 @@ function useViewerIntegration(input) {
9530
9623
  content,
9531
9624
  filePath,
9532
9625
  autosaveEnabled,
9626
+ autosaveIntervalSeconds,
9533
9627
  canEdit,
9534
9628
  mode,
9535
9629
  slides,
@@ -9580,19 +9674,24 @@ function useViewerIntegration(input) {
9580
9674
  });
9581
9675
  const [isEncryptedDialogOpen, setIsEncryptedDialogOpen] = react.useState(false);
9582
9676
  const [loadVersion, setLoadVersion] = react.useState(0);
9583
- const { handlerRef, serializeSlides, autosaveStatus } = useContentLifecycle({
9584
- content,
9585
- filePath,
9586
- autosaveEnabled,
9587
- slides,
9588
- state,
9589
- history,
9590
- ops: editorOps.ops,
9591
- actionSoundHandlerRef,
9592
- setIsEncryptedDialogOpen,
9593
- password: dialogs.presentationPassword ?? void 0,
9594
- onContentApplied: () => setLoadVersion((v) => v + 1)
9595
- });
9677
+ const { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus } = useContentLifecycle(
9678
+ {
9679
+ content,
9680
+ filePath,
9681
+ autosaveEnabled,
9682
+ autosaveIntervalSeconds,
9683
+ // The File > Fonts toggle, finally reaching a save call.
9684
+ embedFonts: dialogs.embedFontsEnabled,
9685
+ slides,
9686
+ state,
9687
+ history,
9688
+ ops: editorOps.ops,
9689
+ actionSoundHandlerRef,
9690
+ setIsEncryptedDialogOpen,
9691
+ password: dialogs.presentationPassword ?? void 0,
9692
+ onContentApplied: () => setLoadVersion((v) => v + 1)
9693
+ }
9694
+ );
9596
9695
  const { exportHandlers, printHandlers, themeHandlers, propertyHandlers } = useIOHandlers({
9597
9696
  state,
9598
9697
  slides,
@@ -9604,6 +9703,7 @@ function useViewerIntegration(input) {
9604
9703
  zoom,
9605
9704
  handlerRef,
9606
9705
  serializeSlides,
9706
+ serializeForRecovery,
9607
9707
  setContent,
9608
9708
  onContentChange,
9609
9709
  password: dialogs.presentationPassword ?? void 0
@@ -9673,7 +9773,7 @@ function useViewerIntegration(input) {
9673
9773
  return zoom.scale;
9674
9774
  },
9675
9775
  setZoom(level) {
9676
- zoom.setScale(chunkY2KIB3QH_js.clampZoomScale(level));
9776
+ zoom.setScale(chunk7JPLVECA_js.clampZoomScale(level));
9677
9777
  },
9678
9778
  zoomIn() {
9679
9779
  zoom.handleZoomIn();
@@ -9888,7 +9988,7 @@ function useReducedMotion() {
9888
9988
  }
9889
9989
  function useViewerOptions() {
9890
9990
  const storeRef = react.useRef(null);
9891
- storeRef.current ??= chunkY2KIB3QH_js.createViewerOptionsStore();
9991
+ storeRef.current ??= chunk7JPLVECA_js.createViewerOptionsStore();
9892
9992
  const store = storeRef.current;
9893
9993
  const options = react.useSyncExternalStore(
9894
9994
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -9897,9 +9997,9 @@ function useViewerOptions() {
9897
9997
  );
9898
9998
  return { optionsStore: store, options };
9899
9999
  }
9900
- var KNOWN_TAB_IDS = new Set(chunkY2KIB3QH_js.TOOLBAR_TABS.map((tab) => tab.id));
10000
+ var KNOWN_TAB_IDS = new Set(chunk7JPLVECA_js.TOOLBAR_TABS.map((tab) => tab.id));
9901
10001
  function computeToolbarVisibility(hiddenActions) {
9902
- const isHidden = (id) => chunkY2KIB3QH_js.isActionHidden(id, hiddenActions);
10002
+ const isHidden = (id) => chunk7JPLVECA_js.isActionHidden(id, hiddenActions);
9903
10003
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
9904
10004
  return { isHidden, isTabVisible };
9905
10005
  }
@@ -9984,12 +10084,12 @@ function useYjsDocumentSync({
9984
10084
  return;
9985
10085
  }
9986
10086
  try {
9987
- const handler = new chunkY2KIB3QH_js.PptxHandler();
10087
+ const handler = new chunk7JPLVECA_js.PptxHandler();
9988
10088
  await handler.load(sourceBytes.buffer);
9989
- const currentSlides = chunkY2KIB3QH_js.readSlidesFromYDoc(
10089
+ const currentSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
9990
10090
  doc
9991
10091
  );
9992
- const slidesToSave = chunkY2KIB3QH_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10092
+ const slidesToSave = chunk7JPLVECA_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
9993
10093
  const bytes = await handler.save(slidesToSave);
9994
10094
  config.onWriteBack(bytes);
9995
10095
  } catch {
@@ -10004,7 +10104,7 @@ function useYjsDocumentSync({
10004
10104
  if (!doc || !isConnected) {
10005
10105
  return;
10006
10106
  }
10007
- const docSlides = chunkY2KIB3QH_js.readSlidesFromYDoc(
10107
+ const docSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
10008
10108
  doc
10009
10109
  );
10010
10110
  if (docSlides.length === 0) {
@@ -10026,11 +10126,11 @@ function useYjsDocumentSync({
10026
10126
  lastSyncedRef.current = serialized;
10027
10127
  void (async () => {
10028
10128
  const factories = await getFactories();
10029
- chunkY2KIB3QH_js.reconcileSlidesInYDoc(
10129
+ chunk7JPLVECA_js.reconcileSlidesInYDoc(
10030
10130
  slides,
10031
10131
  doc,
10032
10132
  factories,
10033
- chunkY2KIB3QH_js.LOCAL_SYNC_ORIGIN
10133
+ chunk7JPLVECA_js.LOCAL_SYNC_ORIGIN
10034
10134
  );
10035
10135
  scheduleWriteBack();
10036
10136
  })();
@@ -10044,10 +10144,10 @@ function useYjsDocumentSync({
10044
10144
  return;
10045
10145
  }
10046
10146
  const handleChange = (_events, transaction) => {
10047
- if (transaction?.origin === chunkY2KIB3QH_js.LOCAL_SYNC_ORIGIN) {
10147
+ if (transaction?.origin === chunk7JPLVECA_js.LOCAL_SYNC_ORIGIN) {
10048
10148
  return;
10049
10149
  }
10050
- const remoteSlides = chunkY2KIB3QH_js.readSlidesFromYDoc(
10150
+ const remoteSlides = chunk7JPLVECA_js.readSlidesFromYDoc(
10051
10151
  doc
10052
10152
  );
10053
10153
  if (remoteSlides.length === 0) {
@@ -10063,7 +10163,7 @@ function useYjsDocumentSync({
10063
10163
  isApplyingRemoteRef.current = false;
10064
10164
  scheduleWriteBack();
10065
10165
  };
10066
- const unobserve = chunkY2KIB3QH_js.observeYDocSlides(
10166
+ const unobserve = chunk7JPLVECA_js.observeYDocSlides(
10067
10167
  doc,
10068
10168
  handleChange
10069
10169
  );
@@ -10101,7 +10201,7 @@ function useBroadcastFollower({
10101
10201
  if (!broadcaster) {
10102
10202
  return;
10103
10203
  }
10104
- if (!chunkY2KIB3QH_js.shouldAutoFollowBroadcaster({
10204
+ if (!chunk7JPLVECA_js.shouldAutoFollowBroadcaster({
10105
10205
  localRole: collab.config.role,
10106
10206
  broadcasterRole: broadcaster.role
10107
10207
  })) {
@@ -10242,11 +10342,16 @@ function useLayoutSwitching(input) {
10242
10342
  },
10243
10343
  [handler, activeSlideIndex, ops, history, onTemplateElementsChanged]
10244
10344
  );
10345
+ const loadLayoutPreviews = react.useCallback(
10346
+ async () => handler ? handler.getLayoutPreviews() : [],
10347
+ [handler]
10348
+ );
10245
10349
  return {
10246
10350
  availableLayouts,
10247
10351
  isLoading,
10248
10352
  loadAvailableLayouts,
10249
10353
  applyLayout,
10354
+ loadLayoutPreviews,
10250
10355
  currentLayoutPath
10251
10356
  };
10252
10357
  }
@@ -10267,10 +10372,10 @@ function useTouchGestures(input) {
10267
10372
  if (!el || !enabled) {
10268
10373
  return;
10269
10374
  }
10270
- const recognizer = chunkY2KIB3QH_js.createTouchGestureRecognizer({
10375
+ const recognizer = chunk7JPLVECA_js.createTouchGestureRecognizer({
10271
10376
  getScale: () => scaleRef.current,
10272
- minScale: chunkY2KIB3QH_js.MIN_ZOOM_SCALE,
10273
- maxScale: chunkY2KIB3QH_js.MAX_ZOOM_SCALE,
10377
+ minScale: chunk7JPLVECA_js.MIN_ZOOM_SCALE,
10378
+ maxScale: chunk7JPLVECA_js.MAX_ZOOM_SCALE,
10274
10379
  callbacks: {
10275
10380
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10276
10381
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10310,7 +10415,7 @@ function scrollFocusedIntoView(keyboardInset) {
10310
10415
  return;
10311
10416
  }
10312
10417
  const rect = active.getBoundingClientRect();
10313
- const delta = chunkY2KIB3QH_js.computeScrollDelta(
10418
+ const delta = chunk7JPLVECA_js.computeScrollDelta(
10314
10419
  { top: rect.top, bottom: rect.bottom },
10315
10420
  window.innerHeight,
10316
10421
  keyboardInset
@@ -10330,8 +10435,8 @@ function useKeyboardInsets(enabled = true) {
10330
10435
  return;
10331
10436
  }
10332
10437
  const update = () => {
10333
- const metrics = chunkY2KIB3QH_js.readViewportMetrics(window);
10334
- const inset = metrics ? chunkY2KIB3QH_js.computeKeyboardInset(metrics) : 0;
10438
+ const metrics = chunk7JPLVECA_js.readViewportMetrics(window);
10439
+ const inset = metrics ? chunk7JPLVECA_js.computeKeyboardInset(metrics) : 0;
10335
10440
  setKeyboardInset(inset);
10336
10441
  if (inset > 0) {
10337
10442
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10342,8 +10447,8 @@ function useKeyboardInsets(enabled = true) {
10342
10447
  vv.addEventListener("scroll", update);
10343
10448
  const onFocusIn = () => {
10344
10449
  window.requestAnimationFrame(() => {
10345
- const metrics = chunkY2KIB3QH_js.readViewportMetrics(window);
10346
- const inset = metrics ? chunkY2KIB3QH_js.computeKeyboardInset(metrics) : 0;
10450
+ const metrics = chunk7JPLVECA_js.readViewportMetrics(window);
10451
+ const inset = metrics ? chunk7JPLVECA_js.computeKeyboardInset(metrics) : 0;
10347
10452
  if (inset > 0) {
10348
10453
  scrollFocusedIntoView(inset);
10349
10454
  }
@@ -10356,7 +10461,7 @@ function useKeyboardInsets(enabled = true) {
10356
10461
  document.removeEventListener("focusin", onFocusIn);
10357
10462
  };
10358
10463
  }, [enabled]);
10359
- return { keyboardInset, isKeyboardOpen: chunkY2KIB3QH_js.isKeyboardOpen(keyboardInset) };
10464
+ return { keyboardInset, isKeyboardOpen: chunk7JPLVECA_js.isKeyboardOpen(keyboardInset) };
10360
10465
  }
10361
10466
 
10362
10467
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10383,7 +10488,7 @@ function buildCanvasProps(input) {
10383
10488
  } = input;
10384
10489
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10385
10490
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10386
- const fieldContext = chunkY2KIB3QH_js.buildFieldSubstitutionContext({
10491
+ const fieldContext = chunk7JPLVECA_js.buildFieldSubstitutionContext({
10387
10492
  headerFooter: s.headerFooter,
10388
10493
  customProperties: s.customProperties,
10389
10494
  slide: activeSlide
@@ -10393,13 +10498,13 @@ function buildCanvasProps(input) {
10393
10498
  if (mode === "present") {
10394
10499
  presentation.handlePresentationAction(action);
10395
10500
  } else if (action.url) {
10396
- chunkY2KIB3QH_js.safeOpenUrl(action.url);
10501
+ chunk7JPLVECA_js.safeOpenUrl(action.url);
10397
10502
  }
10398
10503
  };
10399
10504
  const handleHyperlinkClick = (url) => {
10400
- if (chunkY2KIB3QH_js.isPpactionUrl(url)) {
10505
+ if (chunk7JPLVECA_js.isPpactionUrl(url)) {
10401
10506
  if (mode === "present") {
10402
- const parsed = chunkY2KIB3QH_js.parsePpactionUrl(url);
10507
+ const parsed = chunk7JPLVECA_js.parsePpactionUrl(url);
10403
10508
  if (parsed) {
10404
10509
  presentation.handlePresentationAction({
10405
10510
  action: parsed.action,
@@ -10409,7 +10514,7 @@ function buildCanvasProps(input) {
10409
10514
  }
10410
10515
  return;
10411
10516
  }
10412
- chunkY2KIB3QH_js.safeOpenUrl(url);
10517
+ chunk7JPLVECA_js.safeOpenUrl(url);
10413
10518
  };
10414
10519
  return {
10415
10520
  activeSlide: effectiveSlide,
@@ -10505,41 +10610,7 @@ function buildCanvasProps(input) {
10505
10610
 
10506
10611
  // src/viewer/hooks/useScopedLayoutOptions.ts
10507
10612
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10508
- if (!activeSlide?.layoutPath) {
10509
- return options;
10510
- }
10511
- const hasAnyMasterInfo = options.some((o) => o.masterPath);
10512
- if (!hasAnyMasterInfo) {
10513
- return options;
10514
- }
10515
- const activeOption = options.find((o) => o.path === activeSlide.layoutPath);
10516
- const activeMaster = activeOption?.masterPath;
10517
- if (!activeMaster) {
10518
- return options;
10519
- }
10520
- const scoped = options.filter((o) => o.masterPath === activeMaster);
10521
- const seen = /* @__PURE__ */ new Map();
10522
- for (const opt of scoped) {
10523
- const isActive = opt.path === activeSlide.layoutPath;
10524
- const existing = seen.get(opt.name);
10525
- if (!existing || isActive) {
10526
- seen.set(opt.name, opt);
10527
- }
10528
- }
10529
- const chosen = new Set(Array.from(seen.values()).map((o) => o.path));
10530
- const result = [];
10531
- const usedNames = /* @__PURE__ */ new Set();
10532
- for (const opt of scoped) {
10533
- if (!chosen.has(opt.path)) {
10534
- continue;
10535
- }
10536
- if (usedNames.has(opt.name)) {
10537
- continue;
10538
- }
10539
- usedNames.add(opt.name);
10540
- result.push(opt);
10541
- }
10542
- return result;
10613
+ return chunk7JPLVECA_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10543
10614
  }
10544
10615
 
10545
10616
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10552,7 +10623,7 @@ function buildToolbarAnimationHandlers(input) {
10552
10623
  const current = activeSlide.animations ?? [];
10553
10624
  if (group === "motionPath") {
10554
10625
  propertyHandlers.handleUpdateSlide({
10555
- animations: chunkY2KIB3QH_js.applyMotionPathPreset(current, selectedElement.id, preset)
10626
+ animations: chunk7JPLVECA_js.applyMotionPathPreset(current, selectedElement.id, preset)
10556
10627
  });
10557
10628
  return;
10558
10629
  }
@@ -10747,7 +10818,7 @@ function buildToolbarProps(input) {
10747
10818
  onOpenFile,
10748
10819
  onOpenRecentFile,
10749
10820
  onCreatePresentation: (templateId) => {
10750
- s.setSlides(chunkY2KIB3QH_js.createBackstagePresentation(templateId));
10821
+ s.setSlides(chunk7JPLVECA_js.createBackstagePresentation(templateId));
10751
10822
  s.setActiveSlideIndex(0);
10752
10823
  s.setSelectedElementId(null);
10753
10824
  s.setSelectedElementIds([]);
@@ -10772,9 +10843,11 @@ function buildToolbarProps(input) {
10772
10843
  isOverflowMenuOpen: s.isOverflowMenuOpen,
10773
10844
  onSetOverflowMenuOpen: s.setIsOverflowMenuOpen,
10774
10845
  layoutOptions: scopedLayoutOptions,
10846
+ currentLayoutPath: activeSlide?.layoutPath,
10847
+ loadLayoutPreviews: input.loadLayoutPreviews,
10775
10848
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10776
10849
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10777
- templateScheme: chunkY2KIB3QH_js.templateSchemeFromTheme(s.theme?.colorScheme),
10850
+ templateScheme: chunk7JPLVECA_js.templateSchemeFromTheme(s.theme?.colorScheme),
10778
10851
  customShows: s.customShows,
10779
10852
  activeCustomShowId: s.activeCustomShowId,
10780
10853
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10806,7 +10879,7 @@ function buildToolbarProps(input) {
10806
10879
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10807
10880
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10808
10881
  formatPainterActive: s.formatPainterActive,
10809
- canActivateFormatPainter: chunkY2KIB3QH_js.hasCopyableFormat(selectedElement),
10882
+ canActivateFormatPainter: chunk7JPLVECA_js.hasCopyableFormat(selectedElement),
10810
10883
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10811
10884
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10812
10885
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -10823,6 +10896,20 @@ function buildToolbarProps(input) {
10823
10896
  activeSlide,
10824
10897
  onTransitionChange: handleTransitionChange,
10825
10898
  onApplyTransitionToAll: handleApplyTransitionToAll,
10899
+ // No `onResetSlide` here: this building-blocks surface supplies no
10900
+ // `onApplyLayout` either, so there is no layout to reset to. The mounted
10901
+ // viewer (`ViewerToolbarSection`) wires both.
10902
+ onSelectAll: () => {
10903
+ const allIds = activeSlide?.elements.map((element) => element.id) ?? [];
10904
+ if (allIds.length > 0) {
10905
+ ops.applySelection(allIds[0], allIds);
10906
+ }
10907
+ },
10908
+ presentationProperties: s.presentationProperties,
10909
+ onPresentationPropertiesChange: (updates) => {
10910
+ s.setPresentationProperties((prev) => ({ ...prev, ...updates }));
10911
+ history.markDirty();
10912
+ },
10826
10913
  hiddenActions
10827
10914
  };
10828
10915
  }
@@ -11075,7 +11162,7 @@ function useViewerBuildingBlocks(input) {
11075
11162
  }, [incomingContent]);
11076
11163
  const onOpenFile = react.useCallback(() => {
11077
11164
  void (async () => {
11078
- const picked = await chunkY2KIB3QH_js.openPptxFile();
11165
+ const picked = await chunk7JPLVECA_js.openPptxFile();
11079
11166
  if (picked) {
11080
11167
  setContent(picked.buffer);
11081
11168
  }
@@ -11083,7 +11170,7 @@ function useViewerBuildingBlocks(input) {
11083
11170
  }, []);
11084
11171
  const onOpenRecentFile = react.useCallback((key) => {
11085
11172
  void (async () => {
11086
- const bytes = await chunkY2KIB3QH_js.readBackstageRecentFile(key);
11173
+ const bytes = await chunk7JPLVECA_js.readBackstageRecentFile(key);
11087
11174
  if (bytes) {
11088
11175
  setContent(bytes);
11089
11176
  }