pptx-react-viewer 2.19.7 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +1 -1
  3. package/dist/{AiChatPanel-WVO66CKC.mjs → AiChatPanel-NRWACXJ7.mjs} +4 -4
  4. package/dist/AiChatPanel-NRWACXJ7.mjs.br +0 -0
  5. package/dist/AiChatPanel-NRWACXJ7.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-MAC2Z5SK.js → AiChatPanel-ZSVNVRM5.js} +24 -24
  7. package/dist/AiChatPanel-ZSVNVRM5.js.br +0 -0
  8. package/dist/AiChatPanel-ZSVNVRM5.js.gz +0 -0
  9. package/dist/{Model3DScene-CU4WGIMH.js → Model3DScene-3HGARMTA.js} +2 -2
  10. package/dist/Model3DScene-3HGARMTA.js.br +0 -0
  11. package/dist/Model3DScene-3HGARMTA.js.gz +0 -0
  12. package/dist/{Model3DScene-PTCZUGIT.mjs → Model3DScene-IFYFOD6F.mjs} +1 -1
  13. package/dist/{Model3DScene-PTCZUGIT.mjs.br → Model3DScene-IFYFOD6F.mjs.br} +0 -0
  14. package/dist/Model3DScene-IFYFOD6F.mjs.gz +0 -0
  15. package/dist/{chunk-ZPNLWBED.mjs → chunk-2MENHAYJ.mjs} +814 -449
  16. package/dist/chunk-2MENHAYJ.mjs.br +0 -0
  17. package/dist/chunk-2MENHAYJ.mjs.gz +0 -0
  18. package/dist/{chunk-GUGHIQ4P.js → chunk-4Z4HEIP5.js} +847 -456
  19. package/dist/chunk-4Z4HEIP5.js.br +0 -0
  20. package/dist/chunk-4Z4HEIP5.js.gz +0 -0
  21. package/dist/{chunk-MVKRI3CZ.js → chunk-6CPUGAK7.js} +2 -0
  22. package/dist/chunk-6CPUGAK7.js.br +0 -0
  23. package/dist/{chunk-MVKRI3CZ.js.gz → chunk-6CPUGAK7.js.gz} +0 -0
  24. package/dist/{chunk-XDF76VFA.js → chunk-GKOJO67G.js} +480 -507
  25. package/dist/chunk-GKOJO67G.js.br +0 -0
  26. package/dist/chunk-GKOJO67G.js.gz +0 -0
  27. package/dist/{chunk-5BG5BANR.mjs → chunk-HZ2PAL7P.mjs} +153 -338
  28. package/dist/chunk-HZ2PAL7P.mjs.br +0 -0
  29. package/dist/chunk-HZ2PAL7P.mjs.gz +0 -0
  30. package/dist/{chunk-V5PW4QCE.js → chunk-LLZ25OVR.js} +178 -172
  31. package/dist/chunk-LLZ25OVR.js.br +0 -0
  32. package/dist/chunk-LLZ25OVR.js.gz +0 -0
  33. package/dist/{chunk-SQJBFMEX.mjs → chunk-MZOZNBRO.mjs} +2 -0
  34. package/dist/chunk-MZOZNBRO.mjs.br +0 -0
  35. package/dist/{chunk-SQJBFMEX.mjs.gz → chunk-MZOZNBRO.mjs.gz} +0 -0
  36. package/dist/{chunk-QZV7XDQG.mjs → chunk-O5BR276S.mjs} +25 -19
  37. package/dist/chunk-O5BR276S.mjs.br +0 -0
  38. package/dist/chunk-O5BR276S.mjs.gz +0 -0
  39. package/dist/{chunk-EVM5OFAD.js → chunk-QJJX2E6I.js} +3 -3
  40. package/dist/chunk-QJJX2E6I.js.br +0 -0
  41. package/dist/chunk-QJJX2E6I.js.gz +0 -0
  42. package/dist/{chunk-DZHCLAH3.mjs → chunk-RJ26DQIM.mjs} +1 -1
  43. package/dist/chunk-RJ26DQIM.mjs.br +0 -0
  44. package/dist/chunk-RJ26DQIM.mjs.gz +0 -0
  45. package/dist/{chunk-LP3Y4NXE.mjs → chunk-SZJLZWEX.mjs} +104 -131
  46. package/dist/chunk-SZJLZWEX.mjs.br +0 -0
  47. package/dist/chunk-SZJLZWEX.mjs.gz +0 -0
  48. package/dist/{chunk-JENKEQZP.js → chunk-WCJ3HF4C.js} +1174 -1359
  49. package/dist/chunk-WCJ3HF4C.js.br +0 -0
  50. package/dist/chunk-WCJ3HF4C.js.gz +0 -0
  51. package/dist/i18n.js +4 -4
  52. package/dist/i18n.js.br +0 -0
  53. package/dist/i18n.js.gz +0 -0
  54. package/dist/i18n.mjs +1 -1
  55. package/dist/i18n.mjs.br +0 -0
  56. package/dist/i18n.mjs.gz +0 -0
  57. package/dist/index.js +47 -47
  58. package/dist/index.js.br +0 -0
  59. package/dist/index.js.gz +0 -0
  60. package/dist/index.mjs +6 -6
  61. package/dist/index.mjs.br +0 -0
  62. package/dist/index.mjs.gz +0 -0
  63. package/dist/internals.d.ts.map +1 -1
  64. package/dist/internals.js +79 -79
  65. package/dist/internals.js.br +0 -0
  66. package/dist/internals.js.gz +0 -0
  67. package/dist/internals.mjs +4 -4
  68. package/dist/internals.mjs.br +0 -0
  69. package/dist/internals.mjs.gz +0 -0
  70. package/dist/pptx-viewer.css +1 -1
  71. package/dist/pptx-viewer.css.br +0 -0
  72. package/dist/pptx-viewer.css.gz +0 -0
  73. package/dist/viewer/index.js +27 -27
  74. package/dist/viewer/index.js.br +0 -0
  75. package/dist/viewer/index.js.gz +0 -0
  76. package/dist/viewer/index.mjs +6 -6
  77. package/dist/viewer/index.mjs.br +0 -0
  78. package/dist/viewer/index.mjs.gz +0 -0
  79. package/package.json +1 -1
  80. package/dist/AiChatPanel-MAC2Z5SK.js.br +0 -0
  81. package/dist/AiChatPanel-MAC2Z5SK.js.gz +0 -0
  82. package/dist/AiChatPanel-WVO66CKC.mjs.br +0 -0
  83. package/dist/AiChatPanel-WVO66CKC.mjs.gz +0 -0
  84. package/dist/Model3DScene-CU4WGIMH.js.br +0 -0
  85. package/dist/Model3DScene-CU4WGIMH.js.gz +0 -0
  86. package/dist/Model3DScene-PTCZUGIT.mjs.gz +0 -0
  87. package/dist/chunk-5BG5BANR.mjs.br +0 -0
  88. package/dist/chunk-5BG5BANR.mjs.gz +0 -0
  89. package/dist/chunk-DZHCLAH3.mjs.br +0 -0
  90. package/dist/chunk-DZHCLAH3.mjs.gz +0 -0
  91. package/dist/chunk-EVM5OFAD.js.br +0 -0
  92. package/dist/chunk-EVM5OFAD.js.gz +0 -0
  93. package/dist/chunk-GUGHIQ4P.js.br +0 -0
  94. package/dist/chunk-GUGHIQ4P.js.gz +0 -0
  95. package/dist/chunk-JENKEQZP.js.br +0 -0
  96. package/dist/chunk-JENKEQZP.js.gz +0 -0
  97. package/dist/chunk-LP3Y4NXE.mjs.br +0 -0
  98. package/dist/chunk-LP3Y4NXE.mjs.gz +0 -0
  99. package/dist/chunk-MVKRI3CZ.js.br +0 -0
  100. package/dist/chunk-QZV7XDQG.mjs.br +0 -0
  101. package/dist/chunk-QZV7XDQG.mjs.gz +0 -0
  102. package/dist/chunk-SQJBFMEX.mjs.br +0 -0
  103. package/dist/chunk-V5PW4QCE.js.br +0 -0
  104. package/dist/chunk-V5PW4QCE.js.gz +0 -0
  105. package/dist/chunk-XDF76VFA.js.br +0 -0
  106. package/dist/chunk-XDF76VFA.js.gz +0 -0
  107. package/dist/chunk-ZPNLWBED.mjs.br +0 -0
  108. package/dist/chunk-ZPNLWBED.mjs.gz +0 -0
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkV5PW4QCE_js = require('./chunk-V5PW4QCE.js');
4
- var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
5
- var chunkGUGHIQ4P_js = require('./chunk-GUGHIQ4P.js');
3
+ var chunkLLZ25OVR_js = require('./chunk-LLZ25OVR.js');
4
+ var chunk6CPUGAK7_js = require('./chunk-6CPUGAK7.js');
5
+ var chunk4Z4HEIP5_js = require('./chunk-4Z4HEIP5.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 = chunkGUGHIQ4P_js.DEFAULT_VIRTUAL_OVERSCAN
17
+ overscan = chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
47
+ const range = chunk4Z4HEIP5_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 ??= chunkGUGHIQ4P_js.createPresenceProjector();
88
+ projectorRef.current ??= chunk4Z4HEIP5_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 >= chunkGUGHIQ4P_js.BROADCAST_THROTTLE_MS) {
113
+ if (elapsed >= chunk4Z4HEIP5_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
- }, chunkGUGHIQ4P_js.BROADCAST_THROTTLE_MS - elapsed);
123
+ }, chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.createSyncGate(() => setSynced(true));
203
+ gateRef.current = chunk4Z4HEIP5_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
- chunkGUGHIQ4P_js.clearLocalAwareness(provider.awareness);
223
+ chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.validateRoomId(config.roomId);
248
+ const roomId = chunk4Z4HEIP5_js.validateRoomId(config.roomId);
249
249
  const provider = new WebrtcProvider(roomId, yDoc, opts);
250
- departureRef.current = chunkGUGHIQ4P_js.createDepartureChannel(roomId, provider.awareness);
250
+ departureRef.current = chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.validateRoomId(config.roomId);
293
- const transport = config.transport ?? chunkGUGHIQ4P_js.resolveTransportForServerUrl(config.serverUrl);
292
+ const roomId = chunk4Z4HEIP5_js.validateRoomId(config.roomId);
293
+ const transport = config.transport ?? chunk4Z4HEIP5_js.resolveTransportForServerUrl(config.serverUrl);
294
294
  if (transport === "webrtc") {
295
295
  await initWebrtc();
296
296
  return;
297
297
  }
298
- if (chunkGUGHIQ4P_js.isMixedContentBlocked(config.serverUrl)) {
298
+ if (chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.createDepartureChannel(roomId, provider.awareness);
312
+ departureRef.current = chunk4Z4HEIP5_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
- chunkGUGHIQ4P_js.clearLocalAwareness(provider.awareness);
352
+ chunk4Z4HEIP5_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
- }, chunkGUGHIQ4P_js.CONNECTION_TIMEOUT_MS);
361
+ }, chunk4Z4HEIP5_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
- chunkGUGHIQ4P_js.clearLocalAwareness(provider.awareness);
370
+ chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.registerCollaborationTeardown({
396
+ const disposeTeardown = chunk4Z4HEIP5_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 = chunkGUGHIQ4P_js.sanitizeColor(config?.userColor, "#6366f1");
417
+ const userColor = chunk4Z4HEIP5_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,
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
532
532
  width: canvasSize.width,
533
533
  height: canvasSize.height,
534
534
  activeSlideIndex,
535
- slides: slides.map(chunkGUGHIQ4P_js.cloneSlide),
536
- templateElementsBySlideId: chunkGUGHIQ4P_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
535
+ slides: slides.map(chunk4Z4HEIP5_js.cloneSlide),
536
+ templateElementsBySlideId: chunk4Z4HEIP5_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
537
537
  ...actionLabel ? { actionLabel } : {}
538
538
  };
539
539
  },
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
546
546
  width: snapshot.width,
547
547
  height: snapshot.height
548
548
  });
549
- setSlides(snapshot.slides.map(chunkGUGHIQ4P_js.cloneSlide));
549
+ setSlides(snapshot.slides.map(chunk4Z4HEIP5_js.cloneSlide));
550
550
  setTemplateElementsBySlideId(
551
- chunkGUGHIQ4P_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
551
+ chunk4Z4HEIP5_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
552
552
  );
553
553
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
554
554
  setSelectedElementIds([]);
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
587
587
  const currentSnapshot = buildHistorySnapshot();
588
588
  historyFutureRef.current.push(currentSnapshot);
589
589
  isApplyingHistoryRef.current = true;
590
- const nextSnapshot = chunkV5PW4QCE_js.cloneHistorySnapshot(previousSnapshot);
591
- lastHistorySnapshotRef.current = chunkV5PW4QCE_js.cloneHistorySnapshot(nextSnapshot);
590
+ const nextSnapshot = chunkLLZ25OVR_js.cloneHistorySnapshot(previousSnapshot);
591
+ lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(nextSnapshot);
592
592
  lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
593
593
  applyHistorySnapshot(nextSnapshot);
594
594
  updateHistoryAvailability();
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
609
609
  const currentSnapshot = buildHistorySnapshot();
610
610
  historyPastRef.current.push(currentSnapshot);
611
611
  isApplyingHistoryRef.current = true;
612
- const targetSnapshot = chunkV5PW4QCE_js.cloneHistorySnapshot(nextSnapshot);
613
- lastHistorySnapshotRef.current = chunkV5PW4QCE_js.cloneHistorySnapshot(targetSnapshot);
612
+ const targetSnapshot = chunkLLZ25OVR_js.cloneHistorySnapshot(nextSnapshot);
613
+ lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(targetSnapshot);
614
614
  lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
615
615
  applyHistorySnapshot(targetSnapshot);
616
616
  updateHistoryAvailability();
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
628
628
  historyPastRef.current = [];
629
629
  historyFutureRef.current = [];
630
630
  if (initialSnapshot) {
631
- const clonedInitial = chunkV5PW4QCE_js.cloneHistorySnapshot(initialSnapshot);
631
+ const clonedInitial = chunkLLZ25OVR_js.cloneHistorySnapshot(initialSnapshot);
632
632
  lastHistorySnapshotRef.current = clonedInitial;
633
633
  lastHistorySerializedRef.current = serializeDocument(clonedInitial);
634
634
  } else {
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
676
676
  }
677
677
  const previousSnapshot = lastHistorySnapshotRef.current;
678
678
  if (!previousSnapshot) {
679
- lastHistorySnapshotRef.current = chunkV5PW4QCE_js.cloneHistorySnapshot(snapshot);
679
+ lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(snapshot);
680
680
  lastHistorySerializedRef.current = serialized;
681
681
  lastCheapHashRef.current = cheapHash;
682
682
  updateHistoryAvailability();
683
683
  return;
684
684
  }
685
685
  onDirtyRef.current?.();
686
- historyPastRef.current.push(chunkV5PW4QCE_js.cloneHistorySnapshot(previousSnapshot));
686
+ historyPastRef.current.push(chunkLLZ25OVR_js.cloneHistorySnapshot(previousSnapshot));
687
687
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
688
688
  historyPastRef.current.shift();
689
689
  }
690
690
  historyFutureRef.current = [];
691
- lastHistorySnapshotRef.current = chunkV5PW4QCE_js.cloneHistorySnapshot(snapshot);
691
+ lastHistorySnapshotRef.current = chunkLLZ25OVR_js.cloneHistorySnapshot(snapshot);
692
692
  lastHistorySerializedRef.current = serialized;
693
693
  lastCheapHashRef.current = cheapHash;
694
694
  updateHistoryAvailability();
@@ -748,9 +748,9 @@ function useZoomViewport({
748
748
  const canvasStageRef = react.useRef(null);
749
749
  const canvasViewportRef = react.useRef(null);
750
750
  const renderScaleRef = react.useRef(1);
751
- const wheelBufferRef = react.useRef(chunkGUGHIQ4P_js.createWheelStepBuffer());
751
+ const wheelBufferRef = react.useRef(chunk4Z4HEIP5_js.createWheelStepBuffer());
752
752
  const storeRef = react.useRef(null);
753
- storeRef.current ??= chunkGUGHIQ4P_js.createViewerZoomStore();
753
+ storeRef.current ??= chunk4Z4HEIP5_js.createViewerZoomStore();
754
754
  const store = storeRef.current;
755
755
  const scale = useViewerStore(store, selectZoom);
756
756
  const setScale = react.useCallback(
@@ -811,7 +811,7 @@ function useZoomViewport({
811
811
  if (!wrapper || !canvasViewport) {
812
812
  return;
813
813
  }
814
- const boundedScale = chunkGUGHIQ4P_js.clampZoomScale(nextScale);
814
+ const boundedScale = chunk4Z4HEIP5_js.clampZoomScale(nextScale);
815
815
  const nextEditorScale = fitScale * boundedScale;
816
816
  const centerX = (bounds.minX + bounds.maxX) / 2;
817
817
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -848,29 +848,29 @@ function useZoomViewport({
848
848
  selectedElements.forEach((element) => {
849
849
  minX = Math.min(minX, element.x);
850
850
  minY = Math.min(minY, element.y);
851
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE));
852
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE));
851
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE));
852
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE));
853
853
  });
854
854
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
855
855
  return;
856
856
  }
857
857
  const selectionBounds = { minX, minY, maxX, maxY };
858
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE);
859
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE);
858
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
859
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
860
860
  const availableWidth = Math.max(
861
- effectiveEditorDimensions.width - chunkV5PW4QCE_js.ZOOM_TO_SELECTION_PADDING,
862
- chunkV5PW4QCE_js.MIN_ELEMENT_SIZE
861
+ effectiveEditorDimensions.width - chunkLLZ25OVR_js.ZOOM_TO_SELECTION_PADDING,
862
+ chunkLLZ25OVR_js.MIN_ELEMENT_SIZE
863
863
  );
864
864
  const availableHeight = Math.max(
865
- effectiveEditorDimensions.height - chunkV5PW4QCE_js.ZOOM_TO_SELECTION_PADDING,
866
- chunkV5PW4QCE_js.MIN_ELEMENT_SIZE
865
+ effectiveEditorDimensions.height - chunkLLZ25OVR_js.ZOOM_TO_SELECTION_PADDING,
866
+ chunkLLZ25OVR_js.MIN_ELEMENT_SIZE
867
867
  );
868
868
  const targetEditorScale = Math.min(
869
869
  availableWidth / boundsWidth,
870
870
  availableHeight / boundsHeight
871
871
  );
872
872
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
873
- const nextScale = chunkGUGHIQ4P_js.clampZoomScale(targetEditorScale / safeFitScale);
873
+ const nextScale = chunk4Z4HEIP5_js.clampZoomScale(targetEditorScale / safeFitScale);
874
874
  setScale(nextScale);
875
875
  window.requestAnimationFrame(() => {
876
876
  window.requestAnimationFrame(() => {
@@ -887,14 +887,14 @@ function useZoomViewport({
887
887
  ]);
888
888
  const handleWheel = react.useCallback(
889
889
  (event) => {
890
- const mapped = chunkGUGHIQ4P_js.mapEditingWheel(event, wheelBufferRef.current, true);
890
+ const mapped = chunk4Z4HEIP5_js.mapEditingWheel(event, wheelBufferRef.current, true);
891
891
  if (mapped.intent !== "zoom") {
892
892
  return;
893
893
  }
894
894
  event.preventDefault();
895
895
  store.dispatch({
896
896
  type: "set-zoom",
897
- zoom: chunkGUGHIQ4P_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
897
+ zoom: chunk4Z4HEIP5_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
898
898
  });
899
899
  },
900
900
  [store]
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
982
982
  const command = step.command;
983
983
  const timer = window.setTimeout(
984
984
  () => {
985
- chunkV5PW4QCE_js.executeMediaCommand(command);
985
+ chunkLLZ25OVR_js.executeMediaCommand(command);
986
986
  },
987
987
  Math.max(0, step.delayMs)
988
988
  );
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1119
1119
  }))
1120
1120
  );
1121
1121
  entranceAnimations.forEach((animation, animationIndex) => {
1122
- const delay = chunkGUGHIQ4P_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1122
+ const delay = chunk4Z4HEIP5_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1123
1123
  const timer = window.setTimeout(() => {
1124
1124
  setPresentationAnimations(
1125
1125
  (previousAnimations) => previousAnimations.map(
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
1151
1151
  (controller, group) => {
1152
1152
  driveBuildReveal(
1153
1153
  controller,
1154
- chunkGUGHIQ4P_js.PresentationAnimationController.collectBuildStepIds(group),
1154
+ chunk4Z4HEIP5_js.PresentationAnimationController.collectBuildStepIds(group),
1155
1155
  setPresentationElementStates,
1156
1156
  buildRafRef
1157
1157
  );
@@ -1214,7 +1214,7 @@ function useAnimationPlayback(input) {
1214
1214
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1215
1215
  return;
1216
1216
  }
1217
- const controller = chunkGUGHIQ4P_js.PresentationAnimationController.fromSlide(slide);
1217
+ const controller = chunk4Z4HEIP5_js.PresentationAnimationController.fromSlide(slide);
1218
1218
  controllerRef.current = controller;
1219
1219
  setPresentationKeyframesCss(controller.keyframesCss);
1220
1220
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1372,12 +1372,12 @@ function useAnimationPlayback(input) {
1372
1372
  presentationTimersRef
1373
1373
  };
1374
1374
  }
1375
- var PRESENTER_CHANNEL_NAME = chunkGUGHIQ4P_js.PRESENTATION_CHANNEL_NAME;
1376
- var AUDIENCE_HASH = chunkGUGHIQ4P_js.PRESENTATION_HASH;
1377
- var PRESENTER_MSG_ORIGIN = chunkGUGHIQ4P_js.PRESENTATION_MESSAGE_ORIGIN;
1378
- var AUDIENCE_NONCE_KEY = chunkGUGHIQ4P_js.PRESENTATION_NONCE_KEY;
1375
+ var PRESENTER_CHANNEL_NAME = chunk4Z4HEIP5_js.PRESENTATION_CHANNEL_NAME;
1376
+ var AUDIENCE_HASH = chunk4Z4HEIP5_js.PRESENTATION_HASH;
1377
+ var PRESENTER_MSG_ORIGIN = chunk4Z4HEIP5_js.PRESENTATION_MESSAGE_ORIGIN;
1378
+ var AUDIENCE_NONCE_KEY = chunk4Z4HEIP5_js.PRESENTATION_NONCE_KEY;
1379
1379
  function generateSessionId() {
1380
- return chunkGUGHIQ4P_js.createPresentationSessionId();
1380
+ return chunk4Z4HEIP5_js.createPresentationSessionId();
1381
1381
  }
1382
1382
  function parseAudienceNonce() {
1383
1383
  const hash = window.location.hash;
@@ -1413,7 +1413,7 @@ function usePresenterWindow(input) {
1413
1413
  }, []);
1414
1414
  const swapDisplays = react.useCallback(async () => {
1415
1415
  const audience = audienceWindowRef.current;
1416
- return audience && !audience.closed ? chunkGUGHIQ4P_js.swapPresentationWindows(window, audience) : false;
1416
+ return audience && !audience.closed ? chunk4Z4HEIP5_js.swapPresentationWindows(window, audience) : false;
1417
1417
  }, []);
1418
1418
  const syncSlideToAudience = react.useCallback(
1419
1419
  (slideIndex) => {
@@ -1477,7 +1477,7 @@ function usePresenterWindow(input) {
1477
1477
  pollTimerRef.current = null;
1478
1478
  }
1479
1479
  if (closingSessionId) {
1480
- void chunkGUGHIQ4P_js.clearAudienceContent(closingSessionId);
1480
+ void chunk4Z4HEIP5_js.clearAudienceContent(closingSessionId);
1481
1481
  }
1482
1482
  }, [getChannel]);
1483
1483
  const openAudienceWindow = react.useCallback(() => {
@@ -1495,10 +1495,10 @@ function usePresenterWindow(input) {
1495
1495
  audienceWindowRef.current = blankWin;
1496
1496
  const sessionId = generateSessionId();
1497
1497
  sessionIdRef.current = sessionId;
1498
- const audienceUrl = chunkGUGHIQ4P_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1499
- void chunkGUGHIQ4P_js.resolveAudienceScreenPlacement(window).then((placement) => {
1498
+ const audienceUrl = chunk4Z4HEIP5_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1499
+ void chunk4Z4HEIP5_js.resolveAudienceScreenPlacement(window).then((placement) => {
1500
1500
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1501
- chunkGUGHIQ4P_js.placeAudienceWindow(blankWin, placement);
1501
+ chunk4Z4HEIP5_js.placeAudienceWindow(blankWin, placement);
1502
1502
  }
1503
1503
  return void 0;
1504
1504
  });
@@ -1528,7 +1528,7 @@ function usePresenterWindow(input) {
1528
1528
  }
1529
1529
  };
1530
1530
  if (content) {
1531
- void chunkGUGHIQ4P_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1531
+ void chunk4Z4HEIP5_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1532
1532
  } else {
1533
1533
  navigateOrClose(true);
1534
1534
  }
@@ -1554,7 +1554,7 @@ function usePresenterWindow(input) {
1554
1554
  }
1555
1555
  const handleMessage = (event) => {
1556
1556
  const message = event.data;
1557
- if (chunkGUGHIQ4P_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1557
+ if (chunk4Z4HEIP5_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1558
1558
  syncStateToAudience(snapshotRef.current);
1559
1559
  }
1560
1560
  };
@@ -1583,7 +1583,7 @@ function usePresenterWindow(input) {
1583
1583
  react.useEffect(() => {
1584
1584
  const handleBeforeUnload = () => {
1585
1585
  if (sessionIdRef.current) {
1586
- void chunkGUGHIQ4P_js.clearAudienceContent(sessionIdRef.current);
1586
+ void chunk4Z4HEIP5_js.clearAudienceContent(sessionIdRef.current);
1587
1587
  }
1588
1588
  };
1589
1589
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1645,7 +1645,7 @@ function useAudienceMode(input) {
1645
1645
  }
1646
1646
  channel.onmessage = (event) => {
1647
1647
  const data = event.data;
1648
- if (!chunkGUGHIQ4P_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1648
+ if (!chunk4Z4HEIP5_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1649
1649
  return;
1650
1650
  }
1651
1651
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1661,16 +1661,16 @@ function useAudienceMode(input) {
1661
1661
  }
1662
1662
  if (data.type === "presenter-exit") {
1663
1663
  if (expectedSessionId) {
1664
- void chunkGUGHIQ4P_js.clearAudienceContent(expectedSessionId);
1664
+ void chunk4Z4HEIP5_js.clearAudienceContent(expectedSessionId);
1665
1665
  }
1666
- if (chunkGUGHIQ4P_js.endAudienceDisplay(window)) {
1666
+ if (chunk4Z4HEIP5_js.endAudienceDisplay(window)) {
1667
1667
  handlers.onPresenterEnded?.();
1668
1668
  }
1669
1669
  }
1670
1670
  };
1671
1671
  if (expectedSessionId) {
1672
1672
  channel.postMessage({
1673
- origin: chunkGUGHIQ4P_js.PRESENTATION_MESSAGE_ORIGIN,
1673
+ origin: chunk4Z4HEIP5_js.PRESENTATION_MESSAGE_ORIGIN,
1674
1674
  type: "audience-ready",
1675
1675
  sessionId: expectedSessionId
1676
1676
  });
@@ -1684,7 +1684,7 @@ function useAudienceMode(input) {
1684
1684
  }, []);
1685
1685
  }
1686
1686
  function usePresentationKeyboard(input) {
1687
- const wheelBufferRef = react.useRef(chunkGUGHIQ4P_js.createWheelStepBuffer());
1687
+ const wheelBufferRef = react.useRef(chunk4Z4HEIP5_js.createWheelStepBuffer());
1688
1688
  const {
1689
1689
  mode,
1690
1690
  movePresentationSlide,
@@ -1705,14 +1705,14 @@ function usePresentationKeyboard(input) {
1705
1705
  presentationSlideIndex,
1706
1706
  setShowRehearsalSummary
1707
1707
  } = input;
1708
- const keyBufferRef = react.useRef(chunkGUGHIQ4P_js.createPresentationKeyBuffer());
1708
+ const keyBufferRef = react.useRef(chunk4Z4HEIP5_js.createPresentationKeyBuffer());
1709
1709
  react.useEffect(() => {
1710
- if (mode !== "present" || !chunkGUGHIQ4P_js.acceptsPresentationInput()) {
1711
- keyBufferRef.current = chunkGUGHIQ4P_js.createPresentationKeyBuffer();
1710
+ if (mode !== "present" || !chunk4Z4HEIP5_js.acceptsPresentationInput()) {
1711
+ keyBufferRef.current = chunk4Z4HEIP5_js.createPresentationKeyBuffer();
1712
1712
  return;
1713
1713
  }
1714
1714
  const handleKeyDown = (event) => {
1715
- const mapped = chunkGUGHIQ4P_js.mapPresentationKey(event, keyBufferRef.current);
1715
+ const mapped = chunk4Z4HEIP5_js.mapPresentationKey(event, keyBufferRef.current);
1716
1716
  if (mapped.action === "none") {
1717
1717
  return;
1718
1718
  }
@@ -1732,12 +1732,12 @@ function usePresentationKeyboard(input) {
1732
1732
  movePresentationSlide(-1);
1733
1733
  return;
1734
1734
  case "first": {
1735
- const first = chunkGUGHIQ4P_js.firstShowSlideIndex(showSlideIndexes);
1735
+ const first = chunk4Z4HEIP5_js.firstShowSlideIndex(showSlideIndexes);
1736
1736
  navigateToSlide(first ?? 0);
1737
1737
  return;
1738
1738
  }
1739
1739
  case "last": {
1740
- const last = chunkGUGHIQ4P_js.lastShowSlideIndex(showSlideIndexes);
1740
+ const last = chunk4Z4HEIP5_js.lastShowSlideIndex(showSlideIndexes);
1741
1741
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1742
1742
  return;
1743
1743
  }
@@ -1775,10 +1775,10 @@ function usePresentationKeyboard(input) {
1775
1775
  }
1776
1776
  };
1777
1777
  const handleWheel = (event) => {
1778
- if (mode !== "present" || !chunkGUGHIQ4P_js.acceptsPresentationInput()) {
1778
+ if (mode !== "present" || !chunk4Z4HEIP5_js.acceptsPresentationInput()) {
1779
1779
  return;
1780
1780
  }
1781
- const mapped = chunkGUGHIQ4P_js.mapPresentationWheel(event, wheelBufferRef.current);
1781
+ const mapped = chunk4Z4HEIP5_js.mapPresentationWheel(event, wheelBufferRef.current);
1782
1782
  if (mapped.intent === "next-slide") {
1783
1783
  event.preventDefault();
1784
1784
  movePresentationSlide(1);
@@ -1911,7 +1911,7 @@ function useRehearsalTimings(input) {
1911
1911
 
1912
1912
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
1913
1913
  function handlePresentationActionImpl(action, deps) {
1914
- chunkGUGHIQ4P_js.runPresentationAction(
1914
+ chunk4Z4HEIP5_js.runPresentationAction(
1915
1915
  action,
1916
1916
  { slideCount: deps.slidesLength },
1917
1917
  {
@@ -1933,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
1933
1933
  function executeSlideTransition(nextSlideIndex, deps) {
1934
1934
  const incomingSlide = deps.slides[nextSlideIndex];
1935
1935
  const transition = incomingSlide?.transition;
1936
- const durationMs = deps.playTransition ? chunkGUGHIQ4P_js.resolveTransitionDurationMs(transition) : 0;
1936
+ const durationMs = deps.playTransition ? chunk4Z4HEIP5_js.resolveTransitionDurationMs(transition) : 0;
1937
1937
  deps.clearPresentationTimers();
1938
1938
  deps.setPresentationSlideIndex(nextSlideIndex);
1939
1939
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -1992,7 +1992,7 @@ function useSlideNavigation(input) {
1992
1992
  });
1993
1993
  const scheduleAutoAdvanceForSlide = react.useCallback(
1994
1994
  (slideIndex) => {
1995
- const delayMs = chunkGUGHIQ4P_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1995
+ const delayMs = chunk4Z4HEIP5_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1996
1996
  if (delayMs === void 0) {
1997
1997
  return;
1998
1998
  }
@@ -2015,7 +2015,7 @@ function useSlideNavigation(input) {
2015
2015
  if (availableSlideIndexes.length === 0) {
2016
2016
  return;
2017
2017
  }
2018
- const pastLastSlide = direction === 1 && !chunkGUGHIQ4P_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2018
+ const pastLastSlide = direction === 1 && !chunk4Z4HEIP5_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2019
2019
  if (rehearsing && pastLastSlide) {
2020
2020
  recordCurrentSlideTime(presentationSlideIndex);
2021
2021
  try {
@@ -2033,9 +2033,9 @@ function useSlideNavigation(input) {
2033
2033
  onAdvancePastLastSlide();
2034
2034
  return;
2035
2035
  }
2036
- const nextSlideIndex = direction === 1 ? chunkGUGHIQ4P_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2036
+ const nextSlideIndex = direction === 1 ? chunk4Z4HEIP5_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2037
2037
  loop: Boolean(loopContinuously) && !rehearsing
2038
- }) : chunkGUGHIQ4P_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2038
+ }) : chunk4Z4HEIP5_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2039
2039
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2040
2040
  return;
2041
2041
  }
@@ -2180,22 +2180,22 @@ function useZoomNavigation(input) {
2180
2180
  };
2181
2181
  }
2182
2182
  function usePresenterConsole(slideIndex, active) {
2183
- const timerRef = react.useRef(chunkGUGHIQ4P_js.createPresenterTimer());
2184
- const [snapshot, setSnapshot] = react.useState(() => chunkGUGHIQ4P_js.createInitialPresentationSnapshot(slideIndex));
2183
+ const timerRef = react.useRef(chunk4Z4HEIP5_js.createPresenterTimer());
2184
+ const [snapshot, setSnapshot] = react.useState(() => chunk4Z4HEIP5_js.createInitialPresentationSnapshot(slideIndex));
2185
2185
  const patch = react.useCallback((value) => {
2186
- setSnapshot((current) => chunkGUGHIQ4P_js.mergePresentationSnapshot(current, value));
2186
+ setSnapshot((current) => chunk4Z4HEIP5_js.mergePresentationSnapshot(current, value));
2187
2187
  }, []);
2188
2188
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2189
2189
  react.useEffect(() => {
2190
2190
  if (!active) {
2191
2191
  return;
2192
2192
  }
2193
- timerRef.current = chunkGUGHIQ4P_js.resetPresenterTimer();
2193
+ timerRef.current = chunk4Z4HEIP5_js.resetPresenterTimer();
2194
2194
  patch({ paused: false, elapsedMs: 0 });
2195
2195
  const timer = window.setInterval(() => {
2196
2196
  patch({
2197
2197
  paused: timerRef.current.paused,
2198
- elapsedMs: chunkGUGHIQ4P_js.presenterElapsed(timerRef.current)
2198
+ elapsedMs: chunk4Z4HEIP5_js.presenterElapsed(timerRef.current)
2199
2199
  });
2200
2200
  }, 1e3);
2201
2201
  return () => window.clearInterval(timer);
@@ -2205,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
2205
2205
  applyAudienceSnapshot: setSnapshot,
2206
2206
  setBlackout: (blackout) => patch({ blackout }),
2207
2207
  toggleTimer: () => {
2208
- timerRef.current = chunkGUGHIQ4P_js.togglePresenterTimer(timerRef.current);
2208
+ timerRef.current = chunk4Z4HEIP5_js.togglePresenterTimer(timerRef.current);
2209
2209
  patch({
2210
2210
  paused: timerRef.current.paused,
2211
- elapsedMs: chunkGUGHIQ4P_js.presenterElapsed(timerRef.current)
2211
+ elapsedMs: chunk4Z4HEIP5_js.presenterElapsed(timerRef.current)
2212
2212
  });
2213
2213
  },
2214
2214
  resetTimer: () => {
2215
- timerRef.current = chunkGUGHIQ4P_js.resetPresenterTimer();
2215
+ timerRef.current = chunk4Z4HEIP5_js.resetPresenterTimer();
2216
2216
  patch({ paused: false, elapsedMs: 0 });
2217
2217
  },
2218
2218
  stepZoom: (direction) => setSnapshot(
2219
- (current) => chunkGUGHIQ4P_js.mergePresentationSnapshot(current, {
2220
- zoom: chunkGUGHIQ4P_js.stepPresenterZoom(
2219
+ (current) => chunk4Z4HEIP5_js.mergePresentationSnapshot(current, {
2220
+ zoom: chunk4Z4HEIP5_js.stepPresenterZoom(
2221
2221
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2222
2222
  direction
2223
2223
  )
@@ -2263,7 +2263,7 @@ function usePresentationMode(input) {
2263
2263
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2264
2264
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2265
2265
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2266
- const showGuard = react.useMemo(() => chunkGUGHIQ4P_js.createPresenterShowGuard(), []);
2266
+ const showGuard = react.useMemo(() => chunk4Z4HEIP5_js.createPresenterShowGuard(), []);
2267
2267
  const {
2268
2268
  presentationAnimations,
2269
2269
  presentationElementStates,
@@ -2342,7 +2342,7 @@ function usePresentationMode(input) {
2342
2342
  });
2343
2343
  const movePresentationSlide = react.useCallback(
2344
2344
  (direction, trigger = "explicit") => {
2345
- if (!chunkGUGHIQ4P_js.acceptsPresentationInput()) {
2345
+ if (!chunk4Z4HEIP5_js.acceptsPresentationInput()) {
2346
2346
  return;
2347
2347
  }
2348
2348
  if (endOfShowVisible) {
@@ -2480,7 +2480,7 @@ function usePresentationMode(input) {
2480
2480
  if (mode !== "present") {
2481
2481
  return;
2482
2482
  }
2483
- return chunkGUGHIQ4P_js.attachPresentationVisibilityPause({
2483
+ return chunk4Z4HEIP5_js.attachPresentationVisibilityPause({
2484
2484
  root: containerRef.current ?? void 0,
2485
2485
  onHidden: () => clearPresentationTimersRef.current(),
2486
2486
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2560,11 +2560,11 @@ function usePresentationMode(input) {
2560
2560
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2561
2561
  return void 0;
2562
2562
  }
2563
- return chunkGUGHIQ4P_js.buildMorphTransitionPlan(
2563
+ return chunk4Z4HEIP5_js.buildMorphTransitionPlan(
2564
2564
  slides[transitionOverlay.outgoingSlideIndex],
2565
2565
  slides[transitionOverlay.incomingSlideIndex],
2566
2566
  transitionOverlay.durationMs,
2567
- chunkGUGHIQ4P_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2567
+ chunk4Z4HEIP5_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2568
2568
  );
2569
2569
  }, [transitionOverlay, slides]);
2570
2570
  const morphedElementStates = react.useMemo(() => {
@@ -2585,7 +2585,7 @@ function usePresentationMode(input) {
2585
2585
  if (!morphPlan) {
2586
2586
  return presentationKeyframesCss;
2587
2587
  }
2588
- const imageRules = chunkGUGHIQ4P_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2588
+ const imageRules = chunk4Z4HEIP5_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2589
2589
  return `${presentationKeyframesCss ?? ""}
2590
2590
  ${morphPlan.keyframesCss}
2591
2591
  ${imageRules}`;
@@ -2881,7 +2881,7 @@ function useFindReplace({
2881
2881
  const [findResults, setFindResults] = react.useState([]);
2882
2882
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2883
2883
  const performFind = react.useCallback(() => {
2884
- const results = chunkGUGHIQ4P_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2884
+ const results = chunk4Z4HEIP5_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2885
2885
  if (!findQuery) {
2886
2886
  setFindResults([]);
2887
2887
  setFindResultIndex(-1);
@@ -2915,7 +2915,7 @@ function useFindReplace({
2915
2915
  return;
2916
2916
  }
2917
2917
  onUpdateSlides(
2918
- (prevSlides) => chunkGUGHIQ4P_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2918
+ (prevSlides) => chunk4Z4HEIP5_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2919
2919
  );
2920
2920
  onMarkDirty();
2921
2921
  },
@@ -2937,9 +2937,9 @@ function useFindReplace({
2937
2937
  }, [findResults, applyReplacements, performFind]);
2938
2938
  react.useEffect(() => {
2939
2939
  const handler = (event) => {
2940
- const { action } = chunkGUGHIQ4P_js.mapEditorKey(event, {
2940
+ const { action } = chunk4Z4HEIP5_js.mapEditorKey(event, {
2941
2941
  canEdit: mode === "edit",
2942
- isTextInputTarget: chunkGUGHIQ4P_js.isEditorTextInputTarget(event.target)
2942
+ isTextInputTarget: chunk4Z4HEIP5_js.isEditorTextInputTarget(event.target)
2943
2943
  });
2944
2944
  if (action !== "find") {
2945
2945
  return;
@@ -3008,65 +3008,72 @@ function useModalDismissDrag(onClose, threshold = 120) {
3008
3008
  }
3009
3009
 
3010
3010
  // src/viewer/hooks/useComments-helpers.ts
3011
- function generateCommentId() {
3012
- return `comment-${crypto.randomUUID()}`;
3013
- }
3014
- function addCommentToSlide(slides, slideIndex, comment) {
3011
+ function replaceCommentsOnSlide(slides, slideIndex, next) {
3015
3012
  return slides.map(
3016
- (entry, index) => index === slideIndex ? { ...entry, comments: [...entry.comments || [], comment] } : entry
3013
+ (entry, index) => index === slideIndex ? { ...entry, comments: next } : entry
3017
3014
  );
3018
3015
  }
3016
+ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
3017
+ const slide = slides[slideIndex];
3018
+ if (!slide) {
3019
+ return { slides, didAdd: false };
3020
+ }
3021
+ const next = chunk4Z4HEIP5_js.addCommentToList(
3022
+ slide.comments || [],
3023
+ text,
3024
+ authorName,
3025
+ void 0,
3026
+ void 0,
3027
+ elementId
3028
+ );
3029
+ if (!next) {
3030
+ return { slides, didAdd: false };
3031
+ }
3032
+ return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didAdd: true };
3033
+ }
3019
3034
  function removeCommentFromSlide(slides, slideIndex, commentId) {
3020
- let didDelete = false;
3021
- const updated = slides.map((entry, index) => {
3022
- if (index !== slideIndex) {
3023
- return entry;
3024
- }
3025
- const existing = entry.comments || [];
3026
- const next = existing.filter((c) => {
3027
- const keep = c.id !== commentId;
3028
- if (!keep) {
3029
- didDelete = true;
3030
- }
3031
- return keep;
3032
- });
3033
- return next.length === existing.length ? entry : { ...entry, comments: next };
3034
- });
3035
- return { slides: updated, didDelete };
3035
+ const slide = slides[slideIndex];
3036
+ if (!slide) {
3037
+ return { slides, didDelete: false };
3038
+ }
3039
+ const next = chunk4Z4HEIP5_js.removeCommentFromList(slide.comments || [], commentId);
3040
+ if (!next) {
3041
+ return { slides, didDelete: false };
3042
+ }
3043
+ return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didDelete: true };
3036
3044
  }
3037
3045
  function editCommentInSlide(slides, slideIndex, commentId, newText) {
3038
- let didUpdate = false;
3039
- const updated = slides.map((entry, index) => {
3040
- if (index !== slideIndex) {
3041
- return entry;
3042
- }
3043
- const next = (entry.comments || []).map((c) => {
3044
- if (c.id !== commentId) {
3045
- return c;
3046
- }
3047
- didUpdate = true;
3048
- return { ...c, text: newText };
3049
- });
3050
- return didUpdate ? { ...entry, comments: next } : entry;
3051
- });
3052
- return { slides: updated, didUpdate };
3046
+ const slide = slides[slideIndex];
3047
+ if (!slide) {
3048
+ return { slides, didUpdate: false };
3049
+ }
3050
+ const next = chunk4Z4HEIP5_js.editCommentInList(slide.comments || [], commentId, newText);
3051
+ if (!next) {
3052
+ return { slides, didUpdate: false };
3053
+ }
3054
+ return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didUpdate: true };
3053
3055
  }
3054
3056
  function toggleResolvedInSlide(slides, slideIndex, commentId) {
3055
- let didUpdate = false;
3056
- const updated = slides.map((entry, index) => {
3057
- if (index !== slideIndex) {
3058
- return entry;
3059
- }
3060
- const next = (entry.comments || []).map((c) => {
3061
- if (c.id !== commentId) {
3062
- return c;
3063
- }
3064
- didUpdate = true;
3065
- return { ...c, resolved: !c.resolved };
3066
- });
3067
- return didUpdate ? { ...entry, comments: next } : entry;
3068
- });
3069
- return { slides: updated, didUpdate };
3057
+ const slide = slides[slideIndex];
3058
+ if (!slide) {
3059
+ return { slides, didUpdate: false };
3060
+ }
3061
+ const next = chunk4Z4HEIP5_js.toggleCommentResolvedInList(slide.comments || [], commentId);
3062
+ if (!next) {
3063
+ return { slides, didUpdate: false };
3064
+ }
3065
+ return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didUpdate: true };
3066
+ }
3067
+ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
3068
+ const slide = slides[slideIndex];
3069
+ if (!slide) {
3070
+ return { slides, didAdd: false };
3071
+ }
3072
+ const next = chunk4Z4HEIP5_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
3073
+ if (!next) {
3074
+ return { slides, didAdd: false };
3075
+ }
3076
+ return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didAdd: true };
3070
3077
  }
3071
3078
  function pruneSlideDrafts(drafts, slideIds) {
3072
3079
  const next = {};
@@ -3117,14 +3124,21 @@ function useComments({
3117
3124
  if (draft.length === 0) {
3118
3125
  return;
3119
3126
  }
3120
- const newComment = {
3121
- id: generateCommentId(),
3122
- text: draft,
3123
- author: userName,
3124
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3125
- elementId: selectedElementId ?? void 0
3126
- };
3127
- onUpdateSlides((prev) => addCommentToSlide(prev, slideIndex, newComment));
3127
+ let didAdd = false;
3128
+ onUpdateSlides((prev) => {
3129
+ const result = addCommentToSlide(
3130
+ prev,
3131
+ slideIndex,
3132
+ draft,
3133
+ userName,
3134
+ selectedElementId ?? void 0
3135
+ );
3136
+ didAdd = result.didAdd;
3137
+ return result.slides;
3138
+ });
3139
+ if (!didAdd) {
3140
+ return;
3141
+ }
3128
3142
  setCommentDraftBySlideId((prev) => ({
3129
3143
  ...prev,
3130
3144
  [slide.id]: ""
@@ -3264,39 +3278,19 @@ function useComments({
3264
3278
  if (!slide) {
3265
3279
  return;
3266
3280
  }
3267
- const parentComment = (slide.comments || []).find((c) => c.id === commentId);
3268
- if (!parentComment) {
3269
- return;
3270
- }
3271
3281
  const replyText = String(replyDraftByCommentId[commentId] || "").trim();
3272
3282
  if (replyText.length === 0) {
3273
3283
  return;
3274
3284
  }
3275
- const replyComment = {
3276
- id: generateCommentId(),
3277
- text: replyText,
3278
- author: userName,
3279
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3280
- threadId: commentId,
3281
- elementId: parentComment.elementId
3282
- };
3283
- onUpdateSlides(
3284
- (prev) => prev.map((entry, index) => {
3285
- if (index !== slideIndex) {
3286
- return entry;
3287
- }
3288
- const updatedComments = (entry.comments || []).map((c) => {
3289
- if (c.id !== commentId) {
3290
- return c;
3291
- }
3292
- return {
3293
- ...c,
3294
- replies: [...c.replies || [], replyComment]
3295
- };
3296
- });
3297
- return { ...entry, comments: updatedComments };
3298
- })
3299
- );
3285
+ let didAdd = false;
3286
+ onUpdateSlides((prev) => {
3287
+ const result = addReplyToSlide(prev, slideIndex, commentId, replyText, userName);
3288
+ didAdd = result.didAdd;
3289
+ return result.slides;
3290
+ });
3291
+ if (!didAdd) {
3292
+ return;
3293
+ }
3300
3294
  setReplyingToCommentId(null);
3301
3295
  setReplyDraftByCommentId((prev) => {
3302
3296
  const next = { ...prev };
@@ -3449,7 +3443,7 @@ function useViewerCoreState(_input) {
3449
3443
  const marqueeStateRef = react.useRef(null);
3450
3444
  const isDrawingRef = react.useRef(false);
3451
3445
  const justInteractedRef = react.useRef(false);
3452
- const livePatcher = react.useMemo(() => chunkGUGHIQ4P_js.createCollaborationLivePatcher(), []);
3446
+ const livePatcher = react.useMemo(() => chunk4Z4HEIP5_js.createCollaborationLivePatcher(), []);
3453
3447
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3454
3448
  const slidesRef = react.useRef([]);
3455
3449
  const [mode, setMode] = react.useState("edit");
@@ -3458,8 +3452,8 @@ function useViewerCoreState(_input) {
3458
3452
  const [slides, setSlides] = react.useState([]);
3459
3453
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3460
3454
  const [canvasSize, setCanvasSize] = react.useState({
3461
- width: chunkV5PW4QCE_js.DEFAULT_CANVAS_WIDTH,
3462
- height: chunkV5PW4QCE_js.DEFAULT_CANVAS_HEIGHT
3455
+ width: chunkLLZ25OVR_js.DEFAULT_CANVAS_WIDTH,
3456
+ height: chunkLLZ25OVR_js.DEFAULT_CANVAS_HEIGHT
3463
3457
  });
3464
3458
  const [slideSizeEmu, setSlideSizeEmu] = react.useState();
3465
3459
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
@@ -3480,7 +3474,7 @@ function useViewerCoreState(_input) {
3480
3474
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3481
3475
  inlineEditingTextRef.current = resolved;
3482
3476
  setInlineEditingTextBase(value);
3483
- chunkGUGHIQ4P_js.publishLiveInlineText(
3477
+ chunk4Z4HEIP5_js.publishLiveInlineText(
3484
3478
  livePatcher,
3485
3479
  slidesRef.current[activeSlideIndexRef.current],
3486
3480
  inlineEditingElementIdRef.current,
@@ -3819,7 +3813,7 @@ function useLoadContent({
3819
3813
  );
3820
3814
  }
3821
3815
  const previousHandler = handlerRef.current;
3822
- const handler = new chunkGUGHIQ4P_js.PptxHandler();
3816
+ const handler = new chunk4Z4HEIP5_js.PptxHandler();
3823
3817
  const parsed = await handler.load(buffer);
3824
3818
  if (cancelled || token !== renderTokenRef.current) {
3825
3819
  handler.dispose();
@@ -3831,7 +3825,7 @@ function useLoadContent({
3831
3825
  handlerRef.current = null;
3832
3826
  const mediaElements = [];
3833
3827
  for (const slide of parsed.slides) {
3834
- chunkGUGHIQ4P_js.collectMediaElements(slide.elements, mediaElements);
3828
+ chunk4Z4HEIP5_js.collectMediaElements(slide.elements, mediaElements);
3835
3829
  }
3836
3830
  for (const url of mediaDataUrls.values()) {
3837
3831
  if (url.startsWith("blob:")) {
@@ -3872,7 +3866,7 @@ function useLoadContent({
3872
3866
  }
3873
3867
  })
3874
3868
  );
3875
- const { paths: imagePaths, refs: imageRefs } = chunkGUGHIQ4P_js.collectImagePaths(parsed.slides);
3869
+ const { paths: imagePaths, refs: imageRefs } = chunk4Z4HEIP5_js.collectImagePaths(parsed.slides);
3876
3870
  let nextSlides = parsed.slides;
3877
3871
  if (imagePaths.size > 0) {
3878
3872
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3927,12 +3921,12 @@ function useLoadContent({
3927
3921
  }
3928
3922
  }
3929
3923
  handlerRef.current = handler;
3930
- const partition = chunkGUGHIQ4P_js.partitionTemplateElements(nextSlides);
3924
+ const partition = chunk4Z4HEIP5_js.partitionTemplateElements(nextSlides);
3931
3925
  setSlides(partition.slides);
3932
3926
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
3933
3927
  setCanvasSize({
3934
- width: parsed.width ?? chunkV5PW4QCE_js.DEFAULT_CANVAS_WIDTH,
3935
- height: parsed.height ?? chunkV5PW4QCE_js.DEFAULT_CANVAS_HEIGHT
3928
+ width: parsed.width ?? chunkLLZ25OVR_js.DEFAULT_CANVAS_WIDTH,
3929
+ height: parsed.height ?? chunkLLZ25OVR_js.DEFAULT_CANVAS_HEIGHT
3936
3930
  });
3937
3931
  setSlideSizeEmu(
3938
3932
  typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
@@ -3949,7 +3943,7 @@ function useLoadContent({
3949
3943
  setThemeOptions(parsed.themeOptions ?? []);
3950
3944
  setCustomShows(parsed.customShows ?? []);
3951
3945
  setActiveCustomShowId(
3952
- chunkGUGHIQ4P_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3946
+ chunk4Z4HEIP5_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3953
3947
  );
3954
3948
  setSections(parsed.sections ?? []);
3955
3949
  setPresentationProperties(parsed.presentationProperties ?? {});
@@ -3971,7 +3965,7 @@ function useLoadContent({
3971
3965
  setHasMacros(parsed.hasMacros === true);
3972
3966
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
3973
3967
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
3974
- setGuides(chunkGUGHIQ4P_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3968
+ setGuides(chunk4Z4HEIP5_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3975
3969
  setActiveSlideIndex(0);
3976
3970
  clearSelection();
3977
3971
  setIsDirty(false);
@@ -3979,7 +3973,7 @@ function useLoadContent({
3979
3973
  onContentApplied?.();
3980
3974
  } catch (err) {
3981
3975
  if (!cancelled && token === renderTokenRef.current) {
3982
- if (err instanceof chunkGUGHIQ4P_js.EncryptedFileError) {
3976
+ if (err instanceof chunk4Z4HEIP5_js.EncryptedFileError) {
3983
3977
  setIsEncrypted(true);
3984
3978
  } else {
3985
3979
  setError(err instanceof Error ? err.message : String(err));
@@ -4006,7 +4000,7 @@ function useLoadContent({
4006
4000
  }
4007
4001
  function useAutosave(input) {
4008
4002
  const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
4009
- const intervalMs = chunkGUGHIQ4P_js.resolveAutosaveIntervalMs({
4003
+ const intervalMs = chunk4Z4HEIP5_js.resolveAutosaveIntervalMs({
4010
4004
  hostIntervalMs: input.intervalMs,
4011
4005
  optionsIntervalSeconds: input.intervalSeconds
4012
4006
  });
@@ -4037,7 +4031,7 @@ function useAutosave(input) {
4037
4031
  return;
4038
4032
  }
4039
4033
  const sources = changeSourcesRef.current?.() ?? [];
4040
- if (!chunkGUGHIQ4P_js.shouldWriteAutosaveSnapshot({
4034
+ if (!chunk4Z4HEIP5_js.shouldWriteAutosaveSnapshot({
4041
4035
  filePath: path,
4042
4036
  isDirty: isDirtyRef.current,
4043
4037
  saving: isSavingRef.current,
@@ -4055,8 +4049,8 @@ function useAutosave(input) {
4055
4049
  isSavingRef.current = false;
4056
4050
  return;
4057
4051
  }
4058
- await chunkGUGHIQ4P_js.saveAutosaveSnapshot(path, data);
4059
- lastSnapshotRef.current = chunkGUGHIQ4P_js.autosaveSnapshotMark(path, sources);
4052
+ await chunk4Z4HEIP5_js.saveAutosaveSnapshot(path, data);
4053
+ lastSnapshotRef.current = chunk4Z4HEIP5_js.autosaveSnapshotMark(path, sources);
4060
4054
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4061
4055
  } catch (err) {
4062
4056
  setAutosaveStatus({
@@ -4142,11 +4136,11 @@ function useElementOperations(input) {
4142
4136
  (elementId, updates) => {
4143
4137
  if (masterView?.target) {
4144
4138
  applyMasterViewWrite(
4145
- chunkGUGHIQ4P_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4139
+ chunk4Z4HEIP5_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4146
4140
  );
4147
4141
  return;
4148
4142
  }
4149
- if (chunkGUGHIQ4P_js.isTemplateElementId(elementId)) {
4143
+ if (chunk4Z4HEIP5_js.isTemplateElementId(elementId)) {
4150
4144
  const slideId = activeSlide?.id;
4151
4145
  if (slideId) {
4152
4146
  setTemplateElementsBySlideId((prev) => ({
@@ -4194,7 +4188,7 @@ function useElementOperations(input) {
4194
4188
  );
4195
4189
  const updateSelectedShapeStyle = react.useCallback(
4196
4190
  (updates) => {
4197
- if (!selectedElement || !chunkGUGHIQ4P_js.hasShapeProperties(selectedElement)) {
4191
+ if (!selectedElement || !chunk4Z4HEIP5_js.hasShapeProperties(selectedElement)) {
4198
4192
  return;
4199
4193
  }
4200
4194
  updateSelectedElement({
@@ -4205,17 +4199,17 @@ function useElementOperations(input) {
4205
4199
  );
4206
4200
  const updateSelectedTextStyle = react.useCallback(
4207
4201
  (updates) => {
4208
- if (!selectedElement || !chunkGUGHIQ4P_js.hasTextProperties(selectedElement)) {
4202
+ if (!selectedElement || !chunk4Z4HEIP5_js.hasTextProperties(selectedElement)) {
4209
4203
  return;
4210
4204
  }
4211
- const inlineSel = chunkGUGHIQ4P_js.getInlineEditorSelection(selectedElement.textSegments);
4205
+ const inlineSel = chunk4Z4HEIP5_js.getInlineEditorSelection(selectedElement.textSegments);
4212
4206
  if (inlineSel && selectedElement.textSegments) {
4213
- const { newSegments: newSegments2, newSelection } = chunkGUGHIQ4P_js.applyStyleToSelectedSegments(
4207
+ const { newSegments: newSegments2, newSelection } = chunk4Z4HEIP5_js.applyStyleToSelectedSegments(
4214
4208
  selectedElement.textSegments,
4215
4209
  inlineSel,
4216
4210
  updates
4217
4211
  );
4218
- chunkGUGHIQ4P_js.setPendingSelectionRestore(newSelection);
4212
+ chunk4Z4HEIP5_js.setPendingSelectionRestore(newSelection);
4219
4213
  updateSelectedElement({
4220
4214
  textSegments: newSegments2
4221
4215
  });
@@ -4235,12 +4229,12 @@ function useElementOperations(input) {
4235
4229
  );
4236
4230
  const updateSelectedTextCase = react.useCallback(
4237
4231
  (mode) => {
4238
- if (!selectedElement || !chunkGUGHIQ4P_js.hasTextProperties(selectedElement)) {
4232
+ if (!selectedElement || !chunk4Z4HEIP5_js.hasTextProperties(selectedElement)) {
4239
4233
  return;
4240
4234
  }
4241
- const inlineSel = chunkGUGHIQ4P_js.getInlineEditorSelection(selectedElement.textSegments);
4235
+ const inlineSel = chunk4Z4HEIP5_js.getInlineEditorSelection(selectedElement.textSegments);
4242
4236
  if (inlineSel && selectedElement.textSegments) {
4243
- const newSegments = chunkGUGHIQ4P_js.applyCaseTransformToSegments(
4237
+ const newSegments = chunk4Z4HEIP5_js.applyCaseTransformToSegments(
4244
4238
  selectedElement.textSegments,
4245
4239
  inlineSel,
4246
4240
  mode
@@ -4250,14 +4244,14 @@ function useElementOperations(input) {
4250
4244
  }
4251
4245
  const updates = {};
4252
4246
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4253
- updates.textSegments = chunkGUGHIQ4P_js.applyCaseTransformToSegments(
4247
+ updates.textSegments = chunk4Z4HEIP5_js.applyCaseTransformToSegments(
4254
4248
  selectedElement.textSegments,
4255
4249
  null,
4256
4250
  mode
4257
4251
  );
4258
4252
  }
4259
4253
  if (typeof selectedElement.text === "string") {
4260
- updates.text = chunkGUGHIQ4P_js.transformTextCase(selectedElement.text, mode);
4254
+ updates.text = chunk4Z4HEIP5_js.transformTextCase(selectedElement.text, mode);
4261
4255
  }
4262
4256
  updateSelectedElement(updates);
4263
4257
  },
@@ -4270,15 +4264,15 @@ function useElementOperations(input) {
4270
4264
  [setSlides]
4271
4265
  );
4272
4266
  const masterViewTarget = masterView?.target ?? null;
4273
- const activeElements = masterViewTarget ? chunkGUGHIQ4P_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4267
+ const activeElements = masterViewTarget ? chunk4Z4HEIP5_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4274
4268
  const updateActiveElements = react.useCallback(
4275
4269
  (updater) => {
4276
4270
  if (masterView?.target) {
4277
4271
  applyMasterViewWrite(
4278
- chunkGUGHIQ4P_js.replaceMasterViewElements(
4272
+ chunk4Z4HEIP5_js.replaceMasterViewElements(
4279
4273
  masterView,
4280
4274
  masterView.target,
4281
- updater(chunkGUGHIQ4P_js.masterViewElements(masterView, masterView.target))
4275
+ updater(chunk4Z4HEIP5_js.masterViewElements(masterView, masterView.target))
4282
4276
  )
4283
4277
  );
4284
4278
  return;
@@ -4331,7 +4325,7 @@ function useSectionOperations(input) {
4331
4325
  const { sections, setSections, slides, setSlides, markDirty } = input;
4332
4326
  const addSection2 = react.useCallback(
4333
4327
  (name, afterSlideIndex) => {
4334
- const result = chunkGUGHIQ4P_js.addSection(sections, slides, name, afterSlideIndex);
4328
+ const result = chunk4Z4HEIP5_js.addSection(sections, slides, name, afterSlideIndex);
4335
4329
  setSlides(result.slides);
4336
4330
  setSections(result.sections);
4337
4331
  markDirty();
@@ -4340,7 +4334,7 @@ function useSectionOperations(input) {
4340
4334
  );
4341
4335
  const renameSection2 = react.useCallback(
4342
4336
  (sectionId, newName) => {
4343
- const result = chunkGUGHIQ4P_js.renameSection(sections, slides, sectionId, newName);
4337
+ const result = chunk4Z4HEIP5_js.renameSection(sections, slides, sectionId, newName);
4344
4338
  setSections(result.sections);
4345
4339
  setSlides(result.slides);
4346
4340
  markDirty();
@@ -4349,7 +4343,7 @@ function useSectionOperations(input) {
4349
4343
  );
4350
4344
  const deleteSection2 = react.useCallback(
4351
4345
  (sectionId) => {
4352
- const result = chunkGUGHIQ4P_js.deleteSection(sections, slides, sectionId);
4346
+ const result = chunk4Z4HEIP5_js.deleteSection(sections, slides, sectionId);
4353
4347
  setSections(result.sections);
4354
4348
  setSlides(result.slides);
4355
4349
  markDirty();
@@ -4358,21 +4352,21 @@ function useSectionOperations(input) {
4358
4352
  );
4359
4353
  const moveSectionUp2 = react.useCallback(
4360
4354
  (sectionId) => {
4361
- setSections(chunkGUGHIQ4P_js.moveSectionUp(sections, sectionId));
4355
+ setSections(chunk4Z4HEIP5_js.moveSectionUp(sections, sectionId));
4362
4356
  markDirty();
4363
4357
  },
4364
4358
  [sections, setSections, markDirty]
4365
4359
  );
4366
4360
  const moveSectionDown2 = react.useCallback(
4367
4361
  (sectionId) => {
4368
- setSections(chunkGUGHIQ4P_js.moveSectionDown(sections, sectionId));
4362
+ setSections(chunk4Z4HEIP5_js.moveSectionDown(sections, sectionId));
4369
4363
  markDirty();
4370
4364
  },
4371
4365
  [sections, setSections, markDirty]
4372
4366
  );
4373
4367
  const moveSlidesToSection2 = react.useCallback(
4374
4368
  (slideIndexes, targetSectionId) => {
4375
- const result = chunkGUGHIQ4P_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4369
+ const result = chunk4Z4HEIP5_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4376
4370
  setSlides(result.slides);
4377
4371
  setSections(result.sections);
4378
4372
  markDirty();
@@ -4401,19 +4395,19 @@ function useSectionOperations(input) {
4401
4395
 
4402
4396
  // src/viewer/hooks/pointer-move-handlers.ts
4403
4397
  function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4404
- const resized = chunkGUGHIQ4P_js.applyResize(
4398
+ const resized = chunk4Z4HEIP5_js.applyResize(
4405
4399
  { x: startX, y: startY, width: startWidth, height: startHeight },
4406
4400
  handle,
4407
4401
  dx,
4408
4402
  dy,
4409
4403
  1,
4410
- { minSize: chunkV5PW4QCE_js.MIN_ELEMENT_SIZE }
4404
+ { minSize: chunkLLZ25OVR_js.MIN_ELEMENT_SIZE }
4411
4405
  );
4412
4406
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4413
4407
  if (!snapToGrid) {
4414
4408
  return box;
4415
4409
  }
4416
- return chunkGUGHIQ4P_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE);
4410
+ return chunk4Z4HEIP5_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE);
4417
4411
  }
4418
4412
  function resolveLiveTarget(input) {
4419
4413
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4526,7 +4520,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4526
4520
  width: el.width,
4527
4521
  height: el.height
4528
4522
  }));
4529
- const snapResult = chunkGUGHIQ4P_js.computeSnapToShape(
4523
+ const snapResult = chunk4Z4HEIP5_js.computeSnapToShape(
4530
4524
  targetX,
4531
4525
  targetY,
4532
4526
  primaryEl.width,
@@ -4565,7 +4559,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4565
4559
  if (live) {
4566
4560
  for (const id of Object.keys(drag.startPositionsById)) {
4567
4561
  const start = drag.startPositionsById[id];
4568
- chunkGUGHIQ4P_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4562
+ chunk4Z4HEIP5_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4569
4563
  x: start.x + appliedDx,
4570
4564
  y: start.y + appliedDy
4571
4565
  });
@@ -4599,22 +4593,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4599
4593
  if (rs.domEl) {
4600
4594
  rs.domEl.style.left = `${geo.x}px`;
4601
4595
  rs.domEl.style.top = `${geo.y}px`;
4602
- rs.domEl.style.width = `${Math.max(geo.width, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE)}px`;
4603
- rs.domEl.style.height = `${Math.max(geo.height, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE)}px`;
4596
+ rs.domEl.style.width = `${Math.max(geo.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)}px`;
4597
+ rs.domEl.style.height = `${Math.max(geo.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)}px`;
4604
4598
  }
4605
4599
  if (live) {
4606
- chunkGUGHIQ4P_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4600
+ chunk4Z4HEIP5_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4607
4601
  x: geo.x,
4608
4602
  y: geo.y,
4609
- width: Math.max(geo.width, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE),
4610
- height: Math.max(geo.height, chunkV5PW4QCE_js.MIN_ELEMENT_SIZE)
4603
+ width: Math.max(geo.width, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE),
4604
+ height: Math.max(geo.height, chunkLLZ25OVR_js.MIN_ELEMENT_SIZE)
4611
4605
  });
4612
4606
  }
4613
4607
  }
4614
4608
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4615
4609
  const dx = (e.clientX - adj.startClientX) / editorScale;
4616
4610
  const dy = (e.clientY - adj.startClientY) / editorScale;
4617
- const adjustments = chunkGUGHIQ4P_js.getDraggedShapeAdjustments(adj, dx, dy);
4611
+ const adjustments = chunk4Z4HEIP5_js.getDraggedShapeAdjustments(adj, dx, dy);
4618
4612
  if (!adj.moved && Math.hypot(dx, dy) > 2) {
4619
4613
  adj.moved = true;
4620
4614
  }
@@ -4689,13 +4683,13 @@ function processPointerUp(input) {
4689
4683
  if (i !== activeSlideIndex) {
4690
4684
  return s;
4691
4685
  }
4692
- const rerouted = chunkGUGHIQ4P_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4686
+ const rerouted = chunk4Z4HEIP5_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4693
4687
  if (rerouted.length === 0) {
4694
4688
  return s;
4695
4689
  }
4696
4690
  return {
4697
4691
  ...s,
4698
- elements: chunkGUGHIQ4P_js.applyReroutedConnectors(s.elements, rerouted)
4692
+ elements: chunk4Z4HEIP5_js.applyReroutedConnectors(s.elements, rerouted)
4699
4693
  };
4700
4694
  })
4701
4695
  );
@@ -4720,9 +4714,9 @@ function processPointerUp(input) {
4720
4714
  }
4721
4715
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4722
4716
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4723
- const hitIds = chunkGUGHIQ4P_js.computeMarqueeHitIds(marquee, sourceElements);
4717
+ const hitIds = chunk4Z4HEIP5_js.computeMarqueeHitIds(marquee, sourceElements);
4724
4718
  if (marquee.additive) {
4725
- const merged = chunkGUGHIQ4P_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4719
+ const merged = chunk4Z4HEIP5_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4726
4720
  if (merged.length > 0) {
4727
4721
  applySelection(merged[0], merged);
4728
4722
  } else {
@@ -4745,8 +4739,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4745
4739
  }
4746
4740
  return { ...el, x: start.x + dx, y: start.y + dy };
4747
4741
  });
4748
- const rerouted = chunkGUGHIQ4P_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4749
- return chunkGUGHIQ4P_js.applyReroutedConnectors(movedElements, rerouted);
4742
+ const rerouted = chunk4Z4HEIP5_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4743
+ return chunk4Z4HEIP5_js.applyReroutedConnectors(movedElements, rerouted);
4750
4744
  };
4751
4745
  if (editTemplateMode) {
4752
4746
  const slideId = activeSlide?.id;
@@ -4903,9 +4897,9 @@ function useCanvasInteractions(input) {
4903
4897
  return;
4904
4898
  }
4905
4899
  const el = elementLookup.get(editId);
4906
- if (el && chunkGUGHIQ4P_js.hasTextProperties(el)) {
4900
+ if (el && chunk4Z4HEIP5_js.hasTextProperties(el)) {
4907
4901
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
4908
- const newSegments = chunkGUGHIQ4P_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4902
+ const newSegments = chunk4Z4HEIP5_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4909
4903
  ops.updateElementById(editId, {
4910
4904
  text: committedText,
4911
4905
  textSegments: newSegments
@@ -4916,7 +4910,7 @@ function useCanvasInteractions(input) {
4916
4910
  setInlineEditingText("");
4917
4911
  };
4918
4912
  const openEquationEditorForElement = (el) => {
4919
- if (!chunkGUGHIQ4P_js.hasTextProperties(el)) {
4913
+ if (!chunk4Z4HEIP5_js.hasTextProperties(el)) {
4920
4914
  return false;
4921
4915
  }
4922
4916
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -4946,7 +4940,7 @@ function useCanvasInteractions(input) {
4946
4940
  justInteractedRef.current = false;
4947
4941
  } else {
4948
4942
  const el = elementLookup.get(elementId);
4949
- if (el && chunkGUGHIQ4P_js.hasTextProperties(el) && chunkGUGHIQ4P_js.canInteractWithElement(el, "textEdit")) {
4943
+ if (el && chunk4Z4HEIP5_js.hasTextProperties(el) && chunk4Z4HEIP5_js.canInteractWithElement(el, "textEdit")) {
4950
4944
  if (!openEquationEditorForElement(el)) {
4951
4945
  setInlineEditingElementId(elementId);
4952
4946
  setInlineEditingText(el.text ?? "");
@@ -4965,7 +4959,7 @@ function useCanvasInteractions(input) {
4965
4959
  if (openEquationEditorForElement(el)) {
4966
4960
  return;
4967
4961
  }
4968
- if (chunkGUGHIQ4P_js.hasTextProperties(el) && chunkGUGHIQ4P_js.canInteractWithElement(el, "textEdit")) {
4962
+ if (chunk4Z4HEIP5_js.hasTextProperties(el) && chunk4Z4HEIP5_js.canInteractWithElement(el, "textEdit")) {
4969
4963
  setInlineEditingElementId(elementId);
4970
4964
  setInlineEditingText(el.text ?? "");
4971
4965
  }
@@ -4988,7 +4982,7 @@ function useCanvasInteractions(input) {
4988
4982
  justSelectedRef.current = false;
4989
4983
  }
4990
4984
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
4991
- const movableIds = chunkGUGHIQ4P_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4985
+ const movableIds = chunk4Z4HEIP5_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4992
4986
  if (movableIds.length === 0) {
4993
4987
  return;
4994
4988
  }
@@ -5058,7 +5052,7 @@ function useCanvasInteractions(input) {
5058
5052
  const handleResizePointerDown = (elementId, e, handle) => {
5059
5053
  e.stopPropagation();
5060
5054
  const el = elementLookup.get(elementId);
5061
- if (!el || !chunkGUGHIQ4P_js.canInteractWithElement(el, "resize")) {
5055
+ if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "resize")) {
5062
5056
  return;
5063
5057
  }
5064
5058
  resizeStateRef.current = {
@@ -5080,7 +5074,7 @@ function useCanvasInteractions(input) {
5080
5074
  };
5081
5075
  const handleRotate = (elementId, rotationDeg) => {
5082
5076
  const el = elementLookup.get(elementId);
5083
- if (!el || !chunkGUGHIQ4P_js.canInteractWithElement(el, "rotate")) {
5077
+ if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "rotate")) {
5084
5078
  return;
5085
5079
  }
5086
5080
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -5100,10 +5094,10 @@ function useCanvasInteractions(input) {
5100
5094
  const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
5101
5095
  e.stopPropagation();
5102
5096
  const el = elementLookup.get(elementId);
5103
- if (!el || !chunkGUGHIQ4P_js.canInteractWithElement(el, "adjustHandle")) {
5097
+ if (!el || !chunk4Z4HEIP5_js.canInteractWithElement(el, "adjustHandle")) {
5104
5098
  return;
5105
5099
  }
5106
- shapeAdjustmentDragStateRef.current = chunkGUGHIQ4P_js.beginShapeAdjustment(
5100
+ shapeAdjustmentDragStateRef.current = chunk4Z4HEIP5_js.beginShapeAdjustment(
5107
5101
  el,
5108
5102
  descriptor,
5109
5103
  e.clientX,
@@ -5150,7 +5144,7 @@ function createFileHandlers(deps) {
5150
5144
  h = Math.round(h * scale);
5151
5145
  }
5152
5146
  addElement({
5153
- id: chunkGUGHIQ4P_js.generateElementId(),
5147
+ id: chunk4Z4HEIP5_js.generateElementId(),
5154
5148
  type: "image",
5155
5149
  x: Math.round((canvasSize.width - w) / 2),
5156
5150
  y: Math.round((canvasSize.height - h) / 2),
@@ -5161,7 +5155,7 @@ function createFileHandlers(deps) {
5161
5155
  };
5162
5156
  img.onerror = () => {
5163
5157
  addElement({
5164
- id: chunkGUGHIQ4P_js.generateElementId(),
5158
+ id: chunk4Z4HEIP5_js.generateElementId(),
5165
5159
  type: "image",
5166
5160
  x: 100,
5167
5161
  y: 100,
@@ -5187,7 +5181,7 @@ function createFileHandlers(deps) {
5187
5181
  const elFilePath = file.path;
5188
5182
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5189
5183
  addElement({
5190
- id: chunkGUGHIQ4P_js.generateElementId(),
5184
+ id: chunk4Z4HEIP5_js.generateElementId(),
5191
5185
  type: "media",
5192
5186
  mediaType,
5193
5187
  mediaMimeType: file.type || void 0,
@@ -5362,13 +5356,13 @@ function createStructuredElementHandlers(deps) {
5362
5356
  return;
5363
5357
  }
5364
5358
  addElement({
5365
- id: chunkGUGHIQ4P_js.generateElementId(),
5359
+ id: chunk4Z4HEIP5_js.generateElementId(),
5366
5360
  type: "smartArt",
5367
5361
  x: 100,
5368
5362
  y: 120,
5369
5363
  width: 600,
5370
5364
  height: 340,
5371
- smartArtData: chunkGUGHIQ4P_js.buildSmartArtPresetData(
5365
+ smartArtData: chunk4Z4HEIP5_js.buildSmartArtPresetData(
5372
5366
  layout,
5373
5367
  defaultItems,
5374
5368
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5380,7 +5374,7 @@ function createStructuredElementHandlers(deps) {
5380
5374
  return;
5381
5375
  }
5382
5376
  addElement({
5383
- id: chunkGUGHIQ4P_js.generateElementId(),
5377
+ id: chunk4Z4HEIP5_js.generateElementId(),
5384
5378
  type: "shape",
5385
5379
  x: 120,
5386
5380
  y: 200,
@@ -5418,6 +5412,9 @@ function createStructuredElementHandlers(deps) {
5418
5412
  return;
5419
5413
  }
5420
5414
  const resolved = resolveHyperlinkEditResult(data);
5415
+ if (resolved.url && !chunk4Z4HEIP5_js.isUrlSafe(resolved.url)) {
5416
+ return;
5417
+ }
5421
5418
  const actionClick = {
5422
5419
  url: resolved.url || void 0,
5423
5420
  action: resolved.action,
@@ -5439,7 +5436,7 @@ function createStructuredElementHandlers(deps) {
5439
5436
  const displayText = value || fieldTexts[fieldType] || fieldType;
5440
5437
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5441
5438
  addElement({
5442
- id: chunkGUGHIQ4P_js.generateElementId(),
5439
+ id: chunk4Z4HEIP5_js.generateElementId(),
5443
5440
  type: "shape",
5444
5441
  x: 120,
5445
5442
  y: 200,
@@ -5461,11 +5458,11 @@ function createStructuredElementHandlers(deps) {
5461
5458
  if (!activeSlide) {
5462
5459
  return;
5463
5460
  }
5464
- const preset = chunkGUGHIQ4P_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5461
+ const preset = chunk4Z4HEIP5_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5465
5462
  if (!preset) {
5466
5463
  return;
5467
5464
  }
5468
- const defaultPptxAction = chunkGUGHIQ4P_js.elementActionToPptxAction({
5465
+ const defaultPptxAction = chunk4Z4HEIP5_js.elementActionToPptxAction({
5469
5466
  trigger: "click",
5470
5467
  type: preset.defaultAction
5471
5468
  });
@@ -5474,7 +5471,7 @@ function createStructuredElementHandlers(deps) {
5474
5471
  defaultPptxAction.highlightClick = true;
5475
5472
  }
5476
5473
  addElement({
5477
- id: chunkGUGHIQ4P_js.generateElementId(),
5474
+ id: chunk4Z4HEIP5_js.generateElementId(),
5478
5475
  type: "shape",
5479
5476
  x: 150,
5480
5477
  y: 150,
@@ -5541,14 +5538,14 @@ function useInsertElements(input) {
5541
5538
  return;
5542
5539
  }
5543
5540
  addElement({
5544
- id: chunkGUGHIQ4P_js.generateElementId(),
5541
+ id: chunk4Z4HEIP5_js.generateElementId(),
5545
5542
  type: "text",
5546
5543
  x: 100,
5547
5544
  y: 100,
5548
5545
  width: 300,
5549
5546
  height: 60,
5550
5547
  text: "",
5551
- textStyle: { fontSize: chunkV5PW4QCE_js.DEFAULT_TEXT_FONT_SIZE }
5548
+ textStyle: { fontSize: chunkLLZ25OVR_js.DEFAULT_TEXT_FONT_SIZE }
5552
5549
  });
5553
5550
  };
5554
5551
  const handleAddShape = () => {
@@ -5556,7 +5553,7 @@ function useInsertElements(input) {
5556
5553
  return;
5557
5554
  }
5558
5555
  addElement({
5559
- id: chunkGUGHIQ4P_js.generateElementId(),
5556
+ id: chunk4Z4HEIP5_js.generateElementId(),
5560
5557
  type: "shape",
5561
5558
  x: 150,
5562
5559
  y: 150,
@@ -5575,15 +5572,15 @@ function useInsertElements(input) {
5575
5572
  return;
5576
5573
  }
5577
5574
  addElement({
5578
- ...chunkGUGHIQ4P_js.newTableElement(chunkV5PW4QCE_js.DEFAULT_TABLE_ROWS, chunkV5PW4QCE_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5579
- id: chunkGUGHIQ4P_js.generateElementId()
5575
+ ...chunk4Z4HEIP5_js.newTableElement(chunkLLZ25OVR_js.DEFAULT_TABLE_ROWS, chunkLLZ25OVR_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5576
+ id: chunk4Z4HEIP5_js.generateElementId()
5580
5577
  });
5581
5578
  };
5582
5579
  const handleAddChart = (chartKind) => {
5583
5580
  if (!activeSlide) {
5584
5581
  return;
5585
5582
  }
5586
- addElement(chunkGUGHIQ4P_js.createDefaultChartElement(chartKind));
5583
+ addElement(chunk4Z4HEIP5_js.createDefaultChartElement(chartKind));
5587
5584
  };
5588
5585
  const structured = createStructuredElementHandlers({
5589
5586
  activeSlide,
@@ -5653,7 +5650,7 @@ function useClipboardHandlers(input) {
5653
5650
  if (!selectedElement) {
5654
5651
  return;
5655
5652
  }
5656
- setClipboardPayload(chunkGUGHIQ4P_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5653
+ setClipboardPayload(chunk4Z4HEIP5_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5657
5654
  };
5658
5655
  const handleDelete = () => {
5659
5656
  const idsToDelete = effectiveSelectedIds;
@@ -5670,7 +5667,7 @@ function useClipboardHandlers(input) {
5670
5667
  handleDelete();
5671
5668
  };
5672
5669
  const insertClone = (source) => {
5673
- const clone = chunkGUGHIQ4P_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5670
+ const clone = chunk4Z4HEIP5_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5674
5671
  ops.updateActiveElements((els) => [...els, clone]);
5675
5672
  ops.applySelection(clone.id);
5676
5673
  history.markDirty();
@@ -5705,7 +5702,7 @@ function resolveShapePath(el) {
5705
5702
  return el.pathData;
5706
5703
  }
5707
5704
  if ("shapeType" in el && typeof el.shapeType === "string") {
5708
- const clipPath = chunkGUGHIQ4P_js.getPresetShapeClipPath(el.shapeType);
5705
+ const clipPath = chunk4Z4HEIP5_js.getPresetShapeClipPath(el.shapeType);
5709
5706
  if (clipPath) {
5710
5707
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5711
5708
  if (svgPath) {
@@ -5756,7 +5753,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5756
5753
  return parts.join(" ");
5757
5754
  }
5758
5755
  function transformPathToGlobal(pathData, el) {
5759
- const polys = chunkGUGHIQ4P_js.svgPathToPolygons(pathData);
5756
+ const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
5760
5757
  if (polys.length === 0) {
5761
5758
  return pathData;
5762
5759
  }
@@ -5776,10 +5773,10 @@ function transformPathToGlobal(pathData, el) {
5776
5773
  y: pt.y * scaleY + el.y
5777
5774
  }))
5778
5775
  );
5779
- return chunkGUGHIQ4P_js.polygonsToSvgPath(transformed);
5776
+ return chunk4Z4HEIP5_js.polygonsToSvgPath(transformed);
5780
5777
  }
5781
5778
  function transformPathToLocal(pathData, x, y, _width, _height) {
5782
- const polys = chunkGUGHIQ4P_js.svgPathToPolygons(pathData);
5779
+ const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
5783
5780
  if (polys.length === 0) {
5784
5781
  return pathData;
5785
5782
  }
@@ -5789,10 +5786,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5789
5786
  y: pt.y - y
5790
5787
  }))
5791
5788
  );
5792
- return chunkGUGHIQ4P_js.polygonsToSvgPath(transformed);
5789
+ return chunk4Z4HEIP5_js.polygonsToSvgPath(transformed);
5793
5790
  }
5794
5791
  function pathBounds(pathData) {
5795
- const polys = chunkGUGHIQ4P_js.svgPathToPolygons(pathData);
5792
+ const polys = chunk4Z4HEIP5_js.svgPathToPolygons(pathData);
5796
5793
  let minX = Infinity;
5797
5794
  let minY = Infinity;
5798
5795
  let maxX = -Infinity;
@@ -5851,7 +5848,7 @@ function useMergeShapesHandler(input) {
5851
5848
  let allFragments = [];
5852
5849
  let remaining = globalPaths[0];
5853
5850
  for (let i = 1; i < globalPaths.length; i++) {
5854
- const frags = chunkGUGHIQ4P_js.mergeShapes("fragment", remaining, globalPaths[i]);
5851
+ const frags = chunk4Z4HEIP5_js.mergeShapes("fragment", remaining, globalPaths[i]);
5855
5852
  if (Array.isArray(frags)) {
5856
5853
  allFragments = frags;
5857
5854
  }
@@ -5880,7 +5877,7 @@ function useMergeShapesHandler(input) {
5880
5877
  bounds.height
5881
5878
  );
5882
5879
  const newEl = {
5883
- id: chunkGUGHIQ4P_js.generateElementId(),
5880
+ id: chunk4Z4HEIP5_js.generateElementId(),
5884
5881
  type: "shape",
5885
5882
  x: bounds.x,
5886
5883
  y: bounds.y,
@@ -5918,7 +5915,7 @@ function useMergeShapesHandler(input) {
5918
5915
  } else {
5919
5916
  let resultPath = globalPaths[0];
5920
5917
  for (let i = 1; i < globalPaths.length; i++) {
5921
- const result = chunkGUGHIQ4P_js.mergeShapes(operation, resultPath, globalPaths[i]);
5918
+ const result = chunk4Z4HEIP5_js.mergeShapes(operation, resultPath, globalPaths[i]);
5922
5919
  if (typeof result === "string") {
5923
5920
  resultPath = result;
5924
5921
  }
@@ -5939,7 +5936,7 @@ function useMergeShapesHandler(input) {
5939
5936
  );
5940
5937
  const primary = targets[0];
5941
5938
  const newEl = {
5942
- id: chunkGUGHIQ4P_js.generateElementId(),
5939
+ id: chunk4Z4HEIP5_js.generateElementId(),
5943
5940
  type: "shape",
5944
5941
  x: bounds.x,
5945
5942
  y: bounds.y,
@@ -6002,7 +5999,7 @@ function useGroupAlignLayerHandlers(input) {
6002
5999
  if (ids.length < 2 || !activeSlide) {
6003
6000
  return;
6004
6001
  }
6005
- const { elements, groupId } = chunkGUGHIQ4P_js.groupElements(ops.activeElements, ids, chunkGUGHIQ4P_js.generateElementId());
6002
+ const { elements, groupId } = chunk4Z4HEIP5_js.groupElements(ops.activeElements, ids, chunk4Z4HEIP5_js.generateElementId());
6006
6003
  if (groupId === null) {
6007
6004
  return;
6008
6005
  }
@@ -6015,11 +6012,11 @@ function useGroupAlignLayerHandlers(input) {
6015
6012
  return;
6016
6013
  }
6017
6014
  const group = selectedElement;
6018
- const intoTemplate = chunkGUGHIQ4P_js.isTemplateElementId(group.id);
6015
+ const intoTemplate = chunk4Z4HEIP5_js.isTemplateElementId(group.id);
6019
6016
  const childIds = group.children.map(
6020
- (child) => intoTemplate ? chunkGUGHIQ4P_js.makeCloneId(true, child.id || group.id) : child.id || chunkGUGHIQ4P_js.generateElementId()
6017
+ (child) => intoTemplate ? chunk4Z4HEIP5_js.makeCloneId(true, child.id || group.id) : child.id || chunk4Z4HEIP5_js.generateElementId()
6021
6018
  );
6022
- const { elements, childIds: usedIds } = chunkGUGHIQ4P_js.ungroupElements(
6019
+ const { elements, childIds: usedIds } = chunk4Z4HEIP5_js.ungroupElements(
6023
6020
  ops.activeElements,
6024
6021
  group.id,
6025
6022
  childIds,
@@ -6048,7 +6045,7 @@ function useGroupAlignLayerHandlers(input) {
6048
6045
  if (!edge) {
6049
6046
  return;
6050
6047
  }
6051
- const positions = chunkGUGHIQ4P_js.alignElements(selectedElements, edge);
6048
+ const positions = chunk4Z4HEIP5_js.alignElements(selectedElements, edge);
6052
6049
  for (const [id, pos] of positions) {
6053
6050
  const el = elementLookup.get(id);
6054
6051
  if (!el) {
@@ -6066,7 +6063,7 @@ function useGroupAlignLayerHandlers(input) {
6066
6063
  if (!distAxis) {
6067
6064
  return;
6068
6065
  }
6069
- const positions = chunkGUGHIQ4P_js.distributeElements(selectedElements, distAxis);
6066
+ const positions = chunk4Z4HEIP5_js.distributeElements(selectedElements, distAxis);
6070
6067
  for (const [id, pos] of positions) {
6071
6068
  const el = elementLookup.get(id);
6072
6069
  if (!el) {
@@ -6083,7 +6080,7 @@ function useGroupAlignLayerHandlers(input) {
6083
6080
  }
6084
6081
  const id = selectedElement.id;
6085
6082
  ops.updateActiveElements(
6086
- (els) => direction === "forward" ? chunkGUGHIQ4P_js.bringForward(els, id) : direction === "backward" ? chunkGUGHIQ4P_js.sendBackward(els, id) : els
6083
+ (els) => direction === "forward" ? chunk4Z4HEIP5_js.bringForward(els, id) : direction === "backward" ? chunk4Z4HEIP5_js.sendBackward(els, id) : els
6087
6084
  );
6088
6085
  history.markDirty();
6089
6086
  };
@@ -6093,7 +6090,7 @@ function useGroupAlignLayerHandlers(input) {
6093
6090
  }
6094
6091
  const id = selectedElement.id;
6095
6092
  ops.updateActiveElements(
6096
- (els) => direction === "front" ? chunkGUGHIQ4P_js.bringToFront(els, id) : chunkGUGHIQ4P_js.sendToBack(els, id)
6093
+ (els) => direction === "front" ? chunk4Z4HEIP5_js.bringToFront(els, id) : chunk4Z4HEIP5_js.sendToBack(els, id)
6097
6094
  );
6098
6095
  history.markDirty();
6099
6096
  };
@@ -6224,7 +6221,7 @@ function useSlideManagement(input) {
6224
6221
  theme
6225
6222
  } = input;
6226
6223
  const handleAddSlide = () => {
6227
- const newSlide = chunkGUGHIQ4P_js.createBlankSlide(slides.length + 1);
6224
+ const newSlide = chunk4Z4HEIP5_js.createBlankSlide(slides.length + 1);
6228
6225
  ops.updateSlides((prev) => {
6229
6226
  const next = [...prev];
6230
6227
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6287,7 +6284,7 @@ function useSlideManagement(input) {
6287
6284
  }
6288
6285
  const clone = {
6289
6286
  ...src,
6290
- id: chunkGUGHIQ4P_js.makeSlideId(),
6287
+ id: chunk4Z4HEIP5_js.makeSlideId(),
6291
6288
  elements: src.elements.map((el) => ({
6292
6289
  ...el,
6293
6290
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6319,7 +6316,7 @@ function useSlideManagement(input) {
6319
6316
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6320
6317
  const insertAt = activeSlideIndex + 1;
6321
6318
  const draft = {
6322
- ...chunkGUGHIQ4P_js.createBlankSlide(slides.length + 1),
6319
+ ...chunk4Z4HEIP5_js.createBlankSlide(slides.length + 1),
6323
6320
  layoutPath,
6324
6321
  ...layoutName ? { layoutName } : {}
6325
6322
  };
@@ -6352,9 +6349,9 @@ function useSlideManagement(input) {
6352
6349
  };
6353
6350
  const handleInsertSlideFromTemplate = (templateId) => {
6354
6351
  const insertAt = activeSlideIndex + 1;
6355
- const draft = chunkGUGHIQ4P_js.buildSlideTemplateSlide(templateId, chunkGUGHIQ4P_js.makeSlideId(), slides.length + 1, {
6352
+ const draft = chunk4Z4HEIP5_js.buildSlideTemplateSlide(templateId, chunk4Z4HEIP5_js.makeSlideId(), slides.length + 1, {
6356
6353
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6357
- scheme: chunkGUGHIQ4P_js.templateSchemeFromTheme(theme?.colorScheme)
6354
+ scheme: chunk4Z4HEIP5_js.templateSchemeFromTheme(theme?.colorScheme)
6358
6355
  });
6359
6356
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6360
6357
  setActiveSlideIndex(insertAt);
@@ -6391,7 +6388,7 @@ function createTableMergeHandlers(input) {
6391
6388
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6392
6389
  return;
6393
6390
  }
6394
- const newTableData = chunkGUGHIQ4P_js.mergeCells(
6391
+ const newTableData = chunk4Z4HEIP5_js.mergeCells(
6395
6392
  [
6396
6393
  { row: rowIndex, col: columnIndex },
6397
6394
  { row: rowIndex, col: nextColIdx }
@@ -6399,7 +6396,7 @@ function createTableMergeHandlers(input) {
6399
6396
  td
6400
6397
  );
6401
6398
  const updates = { tableData: newTableData };
6402
- const newRawXml = chunkGUGHIQ4P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6399
+ const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6403
6400
  if (newRawXml) {
6404
6401
  updates.rawXml = newRawXml;
6405
6402
  }
@@ -6425,7 +6422,7 @@ function createTableMergeHandlers(input) {
6425
6422
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6426
6423
  return;
6427
6424
  }
6428
- const newTableData = chunkGUGHIQ4P_js.mergeCells(
6425
+ const newTableData = chunk4Z4HEIP5_js.mergeCells(
6429
6426
  [
6430
6427
  { row: rowIndex, col: columnIndex },
6431
6428
  { row: targetNextRowIdx, col: columnIndex }
@@ -6433,7 +6430,7 @@ function createTableMergeHandlers(input) {
6433
6430
  td
6434
6431
  );
6435
6432
  const updates = { tableData: newTableData };
6436
- const newRawXml = chunkGUGHIQ4P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6433
+ const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6437
6434
  if (newRawXml) {
6438
6435
  updates.rawXml = newRawXml;
6439
6436
  }
@@ -6448,9 +6445,9 @@ function createTableMergeHandlers(input) {
6448
6445
  return;
6449
6446
  }
6450
6447
  const td = selectedElement.tableData;
6451
- const newTableData = chunkGUGHIQ4P_js.mergeCells(ts.selectedCells, td);
6448
+ const newTableData = chunk4Z4HEIP5_js.mergeCells(ts.selectedCells, td);
6452
6449
  const updates = { tableData: newTableData };
6453
- const newRawXml = chunkGUGHIQ4P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6450
+ const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6454
6451
  if (newRawXml) {
6455
6452
  updates.rawXml = newRawXml;
6456
6453
  }
@@ -6467,9 +6464,9 @@ function createTableMergeHandlers(input) {
6467
6464
  }
6468
6465
  const { rowIndex, columnIndex } = ts;
6469
6466
  const td = selectedElement.tableData;
6470
- const newTableData = chunkGUGHIQ4P_js.splitCell(rowIndex, columnIndex, td);
6467
+ const newTableData = chunk4Z4HEIP5_js.splitCell(rowIndex, columnIndex, td);
6471
6468
  const updates = { tableData: newTableData };
6472
- const newRawXml = chunkGUGHIQ4P_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6469
+ const newRawXml = chunk4Z4HEIP5_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6473
6470
  if (newRawXml) {
6474
6471
  updates.rawXml = newRawXml;
6475
6472
  }
@@ -6501,10 +6498,10 @@ function createTableStructHandlers(input) {
6501
6498
  }
6502
6499
  const updates = {};
6503
6500
  if (el.tableData) {
6504
- updates.tableData = chunkGUGHIQ4P_js.setCellText(el, rowIndex, colIndex, text).tableData;
6501
+ updates.tableData = chunk4Z4HEIP5_js.setCellText(el, rowIndex, colIndex, text).tableData;
6505
6502
  }
6506
6503
  if (el.rawXml) {
6507
- const newRawXml = chunkGUGHIQ4P_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6504
+ const newRawXml = chunk4Z4HEIP5_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6508
6505
  if (newRawXml) {
6509
6506
  updates.rawXml = newRawXml;
6510
6507
  }
@@ -6528,7 +6525,7 @@ function createTableStructHandlers(input) {
6528
6525
  const { rowIndex, columnIndex: colIndex } = ts;
6529
6526
  const updates = {};
6530
6527
  if (selectedElement.rawXml) {
6531
- const newRawXml = chunkGUGHIQ4P_js.updateCellTextStyleInRawXml(
6528
+ const newRawXml = chunk4Z4HEIP5_js.updateCellTextStyleInRawXml(
6532
6529
  selectedElement,
6533
6530
  rowIndex,
6534
6531
  colIndex,
@@ -6592,9 +6589,9 @@ function createTableStructHandlers(input) {
6592
6589
  return;
6593
6590
  }
6594
6591
  const rowIdx = ts?.rowIndex ?? 0;
6595
- const newTableData = chunkGUGHIQ4P_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6592
+ const newTableData = chunk4Z4HEIP5_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6596
6593
  const updates = { tableData: newTableData };
6597
- const newRawXml = chunkGUGHIQ4P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6594
+ const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6598
6595
  if (newRawXml) {
6599
6596
  updates.rawXml = newRawXml;
6600
6597
  }
@@ -6607,12 +6604,12 @@ function createTableStructHandlers(input) {
6607
6604
  }
6608
6605
  const td = selectedElement.tableData;
6609
6606
  const rowIdx = ts?.rowIndex ?? 0;
6610
- const newTableData = chunkGUGHIQ4P_js.deleteTableRow(td, rowIdx);
6607
+ const newTableData = chunk4Z4HEIP5_js.deleteTableRow(td, rowIdx);
6611
6608
  if (newTableData === td) {
6612
6609
  return;
6613
6610
  }
6614
6611
  const updates = { tableData: newTableData };
6615
- const newRawXml = chunkGUGHIQ4P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6612
+ const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6616
6613
  if (newRawXml) {
6617
6614
  updates.rawXml = newRawXml;
6618
6615
  }
@@ -6624,9 +6621,9 @@ function createTableStructHandlers(input) {
6624
6621
  return;
6625
6622
  }
6626
6623
  const colIdx = ts?.columnIndex ?? 0;
6627
- const newTableData = chunkGUGHIQ4P_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6624
+ const newTableData = chunk4Z4HEIP5_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6628
6625
  const updates = { tableData: newTableData };
6629
- const newRawXml = chunkGUGHIQ4P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6626
+ const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6630
6627
  if (newRawXml) {
6631
6628
  updates.rawXml = newRawXml;
6632
6629
  }
@@ -6639,12 +6636,12 @@ function createTableStructHandlers(input) {
6639
6636
  }
6640
6637
  const td = selectedElement.tableData;
6641
6638
  const colIdx = ts?.columnIndex ?? 0;
6642
- const newTableData = chunkGUGHIQ4P_js.deleteTableColumn(td, colIdx);
6639
+ const newTableData = chunk4Z4HEIP5_js.deleteTableColumn(td, colIdx);
6643
6640
  if (newTableData === td) {
6644
6641
  return;
6645
6642
  }
6646
6643
  const updates = { tableData: newTableData };
6647
- const newRawXml = chunkGUGHIQ4P_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6644
+ const newRawXml = chunk4Z4HEIP5_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6648
6645
  if (newRawXml) {
6649
6646
  updates.rawXml = newRawXml;
6650
6647
  }
@@ -6680,8 +6677,8 @@ async function renderToCanvas(element, options = {}) {
6680
6677
  return html2canvasPro(element, {
6681
6678
  ...options,
6682
6679
  onclone: async (doc, clonedEl) => {
6683
- await chunkGUGHIQ4P_js.normalizeColorsForCapture(doc, clonedEl);
6684
- chunkGUGHIQ4P_js.preprocessCssForCapture(clonedEl);
6680
+ await chunk4Z4HEIP5_js.normalizeColorsForCapture(doc, clonedEl);
6681
+ chunk4Z4HEIP5_js.preprocessCssForCapture(clonedEl);
6685
6682
  if (typeof userOnClone === "function") {
6686
6683
  userOnClone(doc, clonedEl);
6687
6684
  }
@@ -6737,7 +6734,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
6737
6734
  }
6738
6735
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
6739
6736
  const blob = await exportSlideToPngBlob(slideElement, options);
6740
- chunkGUGHIQ4P_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6737
+ chunk4Z4HEIP5_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6741
6738
  }
6742
6739
  async function copySlideToClipboard(slideElement, options = {}) {
6743
6740
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -6759,15 +6756,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
6759
6756
  continue;
6760
6757
  }
6761
6758
  const canvas = await renderElementToCanvas(stageEl, scale);
6762
- images.push(chunkGUGHIQ4P_js.canvasToJpegData(canvas));
6759
+ images.push(chunk4Z4HEIP5_js.canvasToJpegData(canvas));
6763
6760
  }
6764
6761
  onProgress?.(totalSlides, totalSlides);
6765
6762
  setActiveSlide(currentSlideIndex);
6766
6763
  if (images.length === 0) {
6767
- throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6764
+ throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6768
6765
  }
6769
- const pdfBlobUrl = chunkV5PW4QCE_js.buildPdfFromImageData(images);
6770
- chunkGUGHIQ4P_js.downloadDataUrl(pdfBlobUrl, filename);
6766
+ const pdfBlobUrl = chunkLLZ25OVR_js.buildPdfFromImageData(images);
6767
+ chunk4Z4HEIP5_js.downloadDataUrl(pdfBlobUrl, filename);
6771
6768
  }
6772
6769
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
6773
6770
  const { scale = 2, onProgress } = options;
@@ -6813,10 +6810,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
6813
6810
  onProgress?.(totalSlides, totalSlides);
6814
6811
  setActiveSlide(currentSlideIndex);
6815
6812
  if (pages.length === 0) {
6816
- throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6813
+ throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6817
6814
  }
6818
- const pdfDataUrl = chunkV5PW4QCE_js.buildNotesPdf(pages);
6819
- chunkGUGHIQ4P_js.downloadDataUrl(pdfDataUrl, filename);
6815
+ const pdfDataUrl = chunkLLZ25OVR_js.buildNotesPdf(pages);
6816
+ chunk4Z4HEIP5_js.downloadDataUrl(pdfDataUrl, filename);
6820
6817
  }
6821
6818
 
6822
6819
  // src/viewer/utils/export-video.ts
@@ -6847,7 +6844,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6847
6844
  }
6848
6845
  setActiveSlide(currentSlideIndex);
6849
6846
  if (slideCanvases.length === 0) {
6850
- throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6847
+ throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6851
6848
  }
6852
6849
  const firstCanvas = slideCanvases[0];
6853
6850
  const recordingCanvas = document.createElement("canvas");
@@ -6855,12 +6852,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6855
6852
  recordingCanvas.height = firstCanvas.height;
6856
6853
  const ctx = recordingCanvas.getContext("2d");
6857
6854
  if (!ctx) {
6858
- throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNo2dContext"]);
6855
+ throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNo2dContext"]);
6859
6856
  }
6860
6857
  const fps = 30;
6861
6858
  const stream = recordingCanvas.captureStream(fps);
6862
6859
  const recorder = new MediaRecorder(stream, {
6863
- mimeType: chunkGUGHIQ4P_js.pickSupportedMimeType([...chunkGUGHIQ4P_js.WEBM_MIME_CANDIDATES]),
6860
+ mimeType: chunk4Z4HEIP5_js.pickSupportedMimeType([...chunk4Z4HEIP5_js.WEBM_MIME_CANDIDATES]),
6864
6861
  videoBitsPerSecond: 5e6
6865
6862
  });
6866
6863
  const chunks = [];
@@ -6883,8 +6880,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
6883
6880
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
6884
6881
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
6885
6882
  ctx.drawImage(slideCanvases[i], 0, 0);
6886
- const frameInterval = chunkGUGHIQ4P_js.fpsToFrameIntervalMs(fps);
6887
- const framesNeeded = chunkGUGHIQ4P_js.segmentFrameCount(duration, fps);
6883
+ const frameInterval = chunk4Z4HEIP5_js.fpsToFrameIntervalMs(fps);
6884
+ const framesNeeded = chunk4Z4HEIP5_js.segmentFrameCount(duration, fps);
6888
6885
  for (let f = 0; f < framesNeeded; f++) {
6889
6886
  if (signal?.aborted) {
6890
6887
  recorder.stop();
@@ -6931,9 +6928,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
6931
6928
  }
6932
6929
  setActiveSlide(currentSlideIndex);
6933
6930
  if (frames.length === 0) {
6934
- throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6931
+ throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6935
6932
  }
6936
- const gifBytes = chunkGUGHIQ4P_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6933
+ const gifBytes = chunk4Z4HEIP5_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6937
6934
  onProgress?.(totalSlides, totalSlides);
6938
6935
  const buf = new ArrayBuffer(gifBytes.length);
6939
6936
  new Uint8Array(buf).set(gifBytes);
@@ -6987,7 +6984,7 @@ function exportAllSlidesToSvg(data, options = {}) {
6987
6984
  continue;
6988
6985
  }
6989
6986
  onProgress?.(processedCount, data.slides.length);
6990
- let svg = chunkGUGHIQ4P_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6987
+ let svg = chunk4Z4HEIP5_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
6991
6988
  if (embedFonts && fontFaces?.length) {
6992
6989
  svg = injectFontFaces(svg, fontFaces);
6993
6990
  }
@@ -7045,13 +7042,13 @@ function useExportSaveAs(input) {
7045
7042
  setExportProgress(10);
7046
7043
  setExportStatusMessage("Adding presentation...");
7047
7044
  const pptxData = await serializeSlides();
7048
- const pptxFilename = chunkGUGHIQ4P_js.savedPresentationFileName(filePath);
7045
+ const pptxFilename = chunk4Z4HEIP5_js.savedPresentationFileName(filePath);
7049
7046
  if (pptxData) {
7050
7047
  pkgFolder.file(pptxFilename, pptxData);
7051
7048
  }
7052
7049
  setExportProgress(70);
7053
7050
  setExportStatusMessage("Writing README...");
7054
- const readme = chunkGUGHIQ4P_js.generatePackageReadme(pptxFilename);
7051
+ const readme = chunk4Z4HEIP5_js.generatePackageReadme(pptxFilename);
7055
7052
  pkgFolder.file("README.txt", readme);
7056
7053
  if (abortCtrl.signal.aborted) {
7057
7054
  throw new DOMException("Export cancelled", "AbortError");
@@ -7061,7 +7058,7 @@ function useExportSaveAs(input) {
7061
7058
  const zipBlob = await zip.generateAsync({ type: "blob" });
7062
7059
  setExportProgress(95);
7063
7060
  setExportStatusMessage("Downloading...");
7064
- chunkGUGHIQ4P_js.downloadBlob(zipBlob, `${chunkGUGHIQ4P_js.presentationBaseName(pptxFilename)}-package.zip`);
7061
+ chunk4Z4HEIP5_js.downloadBlob(zipBlob, `${chunk4Z4HEIP5_js.presentationBaseName(pptxFilename)}-package.zip`);
7065
7062
  setExportProgress(100);
7066
7063
  } catch (err) {
7067
7064
  if (err.name !== "AbortError") {
@@ -7077,13 +7074,13 @@ function useExportSaveAs(input) {
7077
7074
  if (!handler) {
7078
7075
  return;
7079
7076
  }
7080
- const downloadName = chunkGUGHIQ4P_js.savedPresentationFileName(filePath, format);
7077
+ const downloadName = chunk4Z4HEIP5_js.savedPresentationFileName(filePath, format);
7081
7078
  try {
7082
7079
  const data = await buildSaveAsData(handler, format);
7083
7080
  const blob = new Blob([data], {
7084
7081
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
7085
7082
  });
7086
- chunkGUGHIQ4P_js.downloadBlob(blob, downloadName);
7083
+ chunk4Z4HEIP5_js.downloadBlob(blob, downloadName);
7087
7084
  } catch (err) {
7088
7085
  console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
7089
7086
  }
@@ -7096,18 +7093,18 @@ function useExportSaveAs(input) {
7096
7093
  const pptxGuides = guides.map((g) => ({
7097
7094
  id: g.id,
7098
7095
  orientation: g.axis === "h" ? "horz" : "vert",
7099
- positionEmu: chunkGUGHIQ4P_js.guidePxToEmu(g.position)
7096
+ positionEmu: chunk4Z4HEIP5_js.guidePxToEmu(g.position)
7100
7097
  }));
7101
7098
  return {
7102
7099
  ...slide,
7103
7100
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
7104
7101
  };
7105
7102
  });
7106
- const slidesToSave = chunkGUGHIQ4P_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7103
+ const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
7107
7104
  const saveOptions = {
7108
7105
  // Save As shares Save's slide-size decision; leaving it out here is how
7109
7106
  // a preset picked in the inspector reached one save path and not the other.
7110
- slideSize: chunkGUGHIQ4P_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
7107
+ slideSize: chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
7111
7108
  headerFooter,
7112
7109
  presentationProperties,
7113
7110
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -7121,13 +7118,13 @@ function useExportSaveAs(input) {
7121
7118
  handoutMaster,
7122
7119
  outputFormat: format
7123
7120
  };
7124
- return chunkGUGHIQ4P_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7121
+ return chunk4Z4HEIP5_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
7125
7122
  };
7126
7123
  const handleExportJson = () => {
7127
7124
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
7128
- const slideSize = chunkGUGHIQ4P_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7125
+ const slideSize = chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
7129
7126
  const data = {
7130
- slides: chunkGUGHIQ4P_js.buildSaveSlides(slides, templateElementsBySlideId),
7127
+ slides: chunk4Z4HEIP5_js.buildSaveSlides(slides, templateElementsBySlideId),
7131
7128
  width: canvasSize.width,
7132
7129
  height: canvasSize.height,
7133
7130
  widthEmu: slideSize.widthEmu,
@@ -7146,7 +7143,7 @@ function useExportSaveAs(input) {
7146
7143
  handoutMaster
7147
7144
  };
7148
7145
  try {
7149
- chunkGUGHIQ4P_js.exportDeckJson(data, sourceName);
7146
+ chunk4Z4HEIP5_js.exportDeckJson(data, sourceName);
7150
7147
  } catch (err) {
7151
7148
  console.error("[PowerPointViewer] JSON export failed:", err);
7152
7149
  }
@@ -7186,7 +7183,7 @@ function safeConfirm(message) {
7186
7183
  }
7187
7184
  }
7188
7185
  function downloadBlob2(blob, filename) {
7189
- chunkGUGHIQ4P_js.downloadBlob(blob, chunkGUGHIQ4P_js.sanitizeDownloadFilename(filename));
7186
+ chunk4Z4HEIP5_js.downloadBlob(blob, chunk4Z4HEIP5_js.sanitizeDownloadFilename(filename));
7190
7187
  }
7191
7188
 
7192
7189
  // src/viewer/hooks/useExportHandlers.ts
@@ -7296,21 +7293,21 @@ function useExportHandlers(input) {
7296
7293
  {
7297
7294
  scale: 2,
7298
7295
  onProgress: (current, total) => {
7299
- setExportProgress(chunkGUGHIQ4P_js.slideProgressPercent(current, total));
7300
- setExportStatusMessage(chunkGUGHIQ4P_js.slideStatusLabel("Rendering", current, total));
7296
+ setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
7297
+ setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Rendering", current, total));
7301
7298
  },
7302
7299
  signal: abortCtrl.signal
7303
7300
  }
7304
7301
  );
7305
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_ASSEMBLING_PERCENT);
7302
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
7306
7303
  setExportStatusMessage("Building PDF...");
7307
7304
  await new Promise((r) => {
7308
7305
  setTimeout(r, 100);
7309
7306
  });
7310
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_DONE_PERCENT);
7307
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
7311
7308
  setExportStatusMessage("Done!");
7312
7309
  } catch (err) {
7313
- if (!chunkGUGHIQ4P_js.isExportAbortError(err)) {
7310
+ if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
7314
7311
  console.error("[PowerPointViewer] PDF export failed:", err);
7315
7312
  }
7316
7313
  } finally {
@@ -7340,21 +7337,21 @@ function useExportHandlers(input) {
7340
7337
  {
7341
7338
  scale: 2,
7342
7339
  onProgress: (current, total) => {
7343
- setExportProgress(chunkGUGHIQ4P_js.slideProgressPercent(current, total));
7344
- setExportStatusMessage(chunkGUGHIQ4P_js.slideStatusLabel("Rendering", current, total));
7340
+ setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
7341
+ setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Rendering", current, total));
7345
7342
  },
7346
7343
  signal: abortCtrl.signal
7347
7344
  }
7348
7345
  );
7349
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_ASSEMBLING_PERCENT);
7346
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
7350
7347
  setExportStatusMessage("Building PDF...");
7351
7348
  await new Promise((r) => {
7352
7349
  setTimeout(r, 100);
7353
7350
  });
7354
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_DONE_PERCENT);
7351
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
7355
7352
  setExportStatusMessage("Done!");
7356
7353
  } catch (err) {
7357
- if (!chunkGUGHIQ4P_js.isExportAbortError(err)) {
7354
+ if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
7358
7355
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7359
7356
  }
7360
7357
  } finally {
@@ -7395,22 +7392,22 @@ function useExportHandlers(input) {
7395
7392
  scale: 1,
7396
7393
  slideDurationMs: 3e3,
7397
7394
  onProgress: (current, total) => {
7398
- setExportProgress(chunkGUGHIQ4P_js.slideProgressPercent(current, total, 45));
7399
- setExportStatusMessage(chunkGUGHIQ4P_js.slideStatusLabel("Capturing", current, total));
7395
+ setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total, 45));
7396
+ setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Capturing", current, total));
7400
7397
  },
7401
7398
  onRecordProgress: (current, total) => {
7402
- setExportProgress(chunkGUGHIQ4P_js.recordProgressPercent(current, total));
7403
- setExportStatusMessage(chunkGUGHIQ4P_js.slideStatusLabel("Recording", current, total));
7399
+ setExportProgress(chunk4Z4HEIP5_js.recordProgressPercent(current, total));
7400
+ setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Recording", current, total));
7404
7401
  },
7405
7402
  signal: abortCtrl.signal
7406
7403
  }
7407
7404
  );
7408
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_ASSEMBLING_PERCENT);
7405
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
7409
7406
  setExportStatusMessage("Saving file...");
7410
7407
  downloadBlob2(blob, "presentation.webm");
7411
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_DONE_PERCENT);
7408
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
7412
7409
  } catch (err) {
7413
- if (!chunkGUGHIQ4P_js.isExportAbortError(err)) {
7410
+ if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
7414
7411
  console.error("[PowerPointViewer] Video export failed:", err);
7415
7412
  }
7416
7413
  } finally {
@@ -7438,18 +7435,18 @@ function useExportHandlers(input) {
7438
7435
  scale: 0.5,
7439
7436
  slideDurationMs: 2e3,
7440
7437
  onProgress: (current, total) => {
7441
- setExportProgress(chunkGUGHIQ4P_js.slideProgressPercent(current, total));
7442
- setExportStatusMessage(chunkGUGHIQ4P_js.slideStatusLabel("Encoding", current, total));
7438
+ setExportProgress(chunk4Z4HEIP5_js.slideProgressPercent(current, total));
7439
+ setExportStatusMessage(chunk4Z4HEIP5_js.slideStatusLabel("Encoding", current, total));
7443
7440
  },
7444
7441
  signal: abortCtrl.signal
7445
7442
  }
7446
7443
  );
7447
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_ASSEMBLING_PERCENT);
7444
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_ASSEMBLING_PERCENT);
7448
7445
  setExportStatusMessage("Saving file...");
7449
7446
  downloadBlob2(blob, "presentation.gif");
7450
- setExportProgress(chunkGUGHIQ4P_js.EXPORT_DONE_PERCENT);
7447
+ setExportProgress(chunk4Z4HEIP5_js.EXPORT_DONE_PERCENT);
7451
7448
  } catch (err) {
7452
- if (!chunkGUGHIQ4P_js.isExportAbortError(err)) {
7449
+ if (!chunk4Z4HEIP5_js.isExportAbortError(err)) {
7453
7450
  console.error("[PowerPointViewer] GIF export failed:", err);
7454
7451
  }
7455
7452
  } finally {
@@ -7490,7 +7487,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
7490
7487
  }
7491
7488
  printWindow.document.open();
7492
7489
  printWindow.document.write(
7493
- chunkGUGHIQ4P_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7490
+ chunk4Z4HEIP5_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
7494
7491
  );
7495
7492
  printWindow.document.close();
7496
7493
  printWindow.focus();
@@ -7524,26 +7521,14 @@ function usePrintHandlers(input) {
7524
7521
  if (!pptxData || settings.printWhat !== "slides") {
7525
7522
  return handlePrintWithSettings(settings);
7526
7523
  }
7527
- const colorFilter = (() => {
7528
- if (settings.colorMode === "grayscale") {
7529
- return "filter: grayscale(1);";
7530
- }
7531
- if (settings.colorMode === "blackAndWhite") {
7532
- return "filter: grayscale(1) contrast(2);";
7533
- }
7534
- return "";
7535
- })();
7536
- const slideIndices = (() => {
7537
- if (settings.slideRange === "current") {
7538
- return [activeSlideIndex];
7539
- }
7540
- if (settings.slideRange === "custom") {
7541
- const from = Math.max(0, settings.customRangeFrom - 1);
7542
- const to = Math.min(slides.length - 1, settings.customRangeTo - 1);
7543
- return Array.from({ length: to - from + 1 }, (_, i) => from + i);
7544
- }
7545
- return Array.from({ length: slides.length }, (_, i) => i);
7546
- })();
7524
+ const colorFilter = chunk4Z4HEIP5_js.computeColorFilter(settings.colorMode);
7525
+ const slideIndices = chunk4Z4HEIP5_js.computeSlideIndices(
7526
+ settings.slideRange,
7527
+ activeSlideIndex,
7528
+ slides.length,
7529
+ settings.customRangeFrom,
7530
+ settings.customRangeTo
7531
+ );
7547
7532
  try {
7548
7533
  const svgs = exportAllSlidesToSvg(pptxData, {
7549
7534
  slideIndices
@@ -7551,7 +7536,7 @@ function usePrintHandlers(input) {
7551
7536
  if (svgs.length === 0) {
7552
7537
  return;
7553
7538
  }
7554
- const printDoc = chunkGUGHIQ4P_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7539
+ const printDoc = chunk4Z4HEIP5_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7555
7540
  title: "Slides (Vector)",
7556
7541
  orientation: settings.orientation,
7557
7542
  colorFilter
@@ -7564,30 +7549,18 @@ function usePrintHandlers(input) {
7564
7549
  };
7565
7550
  const handlePrintWithSettings = async (settings) => {
7566
7551
  setIsPrintDialogOpen(false);
7567
- const colorFilter = (() => {
7568
- if (settings.colorMode === "grayscale") {
7569
- return "filter: grayscale(1);";
7570
- }
7571
- if (settings.colorMode === "blackAndWhite") {
7572
- return "filter: grayscale(1) contrast(2);";
7573
- }
7574
- return "";
7575
- })();
7576
- const slideIndices = (() => {
7577
- if (settings.slideRange === "current") {
7578
- return [activeSlideIndex];
7579
- }
7580
- if (settings.slideRange === "custom") {
7581
- const from = Math.max(0, settings.customRangeFrom - 1);
7582
- const to = Math.min(slides.length - 1, settings.customRangeTo - 1);
7583
- return Array.from({ length: to - from + 1 }, (_, i) => from + i);
7584
- }
7585
- return Array.from({ length: slides.length }, (_, i) => i);
7586
- })();
7552
+ const colorFilter = chunk4Z4HEIP5_js.computeColorFilter(settings.colorMode);
7553
+ const slideIndices = chunk4Z4HEIP5_js.computeSlideIndices(
7554
+ settings.slideRange,
7555
+ activeSlideIndex,
7556
+ slides.length,
7557
+ settings.customRangeFrom,
7558
+ settings.customRangeTo
7559
+ );
7587
7560
  if (settings.printWhat === "outline") {
7588
7561
  openPrintWindow(
7589
7562
  "Outline",
7590
- `<div class="outline-page">${chunkGUGHIQ4P_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7563
+ `<div class="outline-page">${chunk4Z4HEIP5_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7591
7564
  settings.orientation,
7592
7565
  colorFilter,
7593
7566
  settings.frameSlides
@@ -7612,7 +7585,7 @@ function usePrintHandlers(input) {
7612
7585
  if (settings.printWhat === "slides") {
7613
7586
  openPrintWindow(
7614
7587
  "Slides",
7615
- chunkGUGHIQ4P_js.buildSlidesHtml(slideImages, slideIndices),
7588
+ chunk4Z4HEIP5_js.buildSlidesHtml(slideImages, slideIndices),
7616
7589
  settings.orientation,
7617
7590
  colorFilter,
7618
7591
  settings.frameSlides
@@ -7622,7 +7595,7 @@ function usePrintHandlers(input) {
7622
7595
  if (settings.printWhat === "notes") {
7623
7596
  openPrintWindow(
7624
7597
  "Notes Pages",
7625
- chunkGUGHIQ4P_js.buildNotesHtml(slideImages, slideIndices, slides),
7598
+ chunk4Z4HEIP5_js.buildNotesHtml(slideImages, slideIndices, slides),
7626
7599
  "portrait",
7627
7600
  colorFilter,
7628
7601
  settings.frameSlides
@@ -7633,7 +7606,7 @@ function usePrintHandlers(input) {
7633
7606
  const spp = settings.slidesPerPage;
7634
7607
  openPrintWindow(
7635
7608
  `Handout ${spp} per page`,
7636
- chunkGUGHIQ4P_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7609
+ chunk4Z4HEIP5_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7637
7610
  "portrait",
7638
7611
  colorFilter,
7639
7612
  settings.frameSlides
@@ -7697,8 +7670,8 @@ function useThemeHandlers(input) {
7697
7670
  return;
7698
7671
  }
7699
7672
  await handler.updateThemeColorScheme(colorScheme);
7700
- const previousMap = theme?.colorScheme ? chunkGUGHIQ4P_js.buildThemeColorMap(theme.colorScheme) : {};
7701
- setSlides((prev) => chunkGUGHIQ4P_js.reResolveSlideColors(prev, previousMap, colorScheme));
7673
+ const previousMap = theme?.colorScheme ? chunk4Z4HEIP5_js.buildThemeColorMap(theme.colorScheme) : {};
7674
+ setSlides((prev) => chunk4Z4HEIP5_js.reResolveSlideColors(prev, previousMap, colorScheme));
7702
7675
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7703
7676
  bumpHistory();
7704
7677
  history.markDirty();
@@ -7803,7 +7776,7 @@ function useThemeSwitching(input) {
7803
7776
  }
7804
7777
  try {
7805
7778
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7806
- const newData = chunkGUGHIQ4P_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7779
+ const newData = chunk4Z4HEIP5_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7807
7780
  onDataChange(newData);
7808
7781
  onThemeChanged?.(preset);
7809
7782
  } catch (error) {
@@ -7820,7 +7793,7 @@ function useThemeSwitching(input) {
7820
7793
  }
7821
7794
  try {
7822
7795
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7823
- const newData = chunkGUGHIQ4P_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7796
+ const newData = chunk4Z4HEIP5_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7824
7797
  onDataChange(newData);
7825
7798
  } catch (error) {
7826
7799
  console.error("Failed to switch to custom theme:", error);
@@ -7832,12 +7805,12 @@ function useThemeSwitching(input) {
7832
7805
  if (!data?.theme?.colorScheme) {
7833
7806
  return void 0;
7834
7807
  }
7835
- return chunkGUGHIQ4P_js.THEME_PRESETS.find(
7836
- (p) => chunkGUGHIQ4P_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7808
+ return chunk4Z4HEIP5_js.THEME_PRESETS.find(
7809
+ (p) => chunk4Z4HEIP5_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7837
7810
  );
7838
7811
  }, [data?.theme?.colorScheme]);
7839
7812
  return {
7840
- presets: chunkGUGHIQ4P_js.THEME_PRESETS,
7813
+ presets: chunk4Z4HEIP5_js.THEME_PRESETS,
7841
7814
  switchToPreset,
7842
7815
  switchToCustom,
7843
7816
  currentPreset
@@ -7912,7 +7885,7 @@ function usePropertyHandlers(input) {
7912
7885
  }
7913
7886
  try {
7914
7887
  const ab = await file.arrayBuffer();
7915
- const h = new chunkGUGHIQ4P_js.PptxHandler();
7888
+ const h = new chunk4Z4HEIP5_js.PptxHandler();
7916
7889
  const other = await h.load(ab);
7917
7890
  if (!other) {
7918
7891
  return;
@@ -7922,7 +7895,7 @@ function usePropertyHandlers(input) {
7922
7895
  width: canvasSize.width,
7923
7896
  height: canvasSize.height
7924
7897
  };
7925
- setCompareResult(chunkGUGHIQ4P_js.comparePresentation(cur, other));
7898
+ setCompareResult(chunk4Z4HEIP5_js.comparePresentation(cur, other));
7926
7899
  setIsComparePanelOpen(true);
7927
7900
  } catch (err) {
7928
7901
  console.warn("Compare failed:", err);
@@ -7939,7 +7912,7 @@ function usePropertyHandlers(input) {
7939
7912
  if (!diff || diff.status === "unchanged") {
7940
7913
  return;
7941
7914
  }
7942
- setSlides((prev) => chunkGUGHIQ4P_js.applyAcceptSlide(prev, diff));
7915
+ setSlides((prev) => chunk4Z4HEIP5_js.applyAcceptSlide(prev, diff));
7943
7916
  setIsDirty(true);
7944
7917
  },
7945
7918
  [compareResult, setSlides, setIsDirty]
@@ -7950,10 +7923,10 @@ function usePropertyHandlers(input) {
7950
7923
  if (!compareResult) {
7951
7924
  return;
7952
7925
  }
7953
- setSlides((prev) => chunkGUGHIQ4P_js.applyAcceptAllSlides(prev, compareResult));
7926
+ setSlides((prev) => chunk4Z4HEIP5_js.applyAcceptAllSlides(prev, compareResult));
7954
7927
  setIsDirty(true);
7955
7928
  }, [compareResult, setSlides, setIsDirty]);
7956
- const usedFontFamilies = react.useMemo(() => chunkGUGHIQ4P_js.collectUsedFonts(slides), [slides]);
7929
+ const usedFontFamilies = react.useMemo(() => chunk4Z4HEIP5_js.collectUsedFonts(slides), [slides]);
7957
7930
  return {
7958
7931
  handleUpdateNotes,
7959
7932
  handleUpdateSlide,
@@ -8072,7 +8045,7 @@ function useIsMobile(input) {
8072
8045
  const containerRef = input?.containerRef;
8073
8046
  const isTouchDevice = react.useSyncExternalStore(
8074
8047
  subscribeTouchCapability,
8075
- chunkGUGHIQ4P_js.detectTouchDevice,
8048
+ chunk4Z4HEIP5_js.detectTouchDevice,
8076
8049
  () => false
8077
8050
  // server snapshot
8078
8051
  );
@@ -8088,7 +8061,7 @@ function useIsMobile(input) {
8088
8061
  }
8089
8062
  return containerRef?.current?.clientHeight ?? window.innerHeight;
8090
8063
  });
8091
- const [orientation, setOrientation] = react.useState(chunkGUGHIQ4P_js.detectOrientation);
8064
+ const [orientation, setOrientation] = react.useState(chunk4Z4HEIP5_js.detectOrientation);
8092
8065
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
8093
8066
  const [initialViewportHeight] = react.useState(
8094
8067
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -8132,7 +8105,7 @@ function useIsMobile(input) {
8132
8105
  return;
8133
8106
  }
8134
8107
  const handleOrientationChange = () => {
8135
- setOrientation(chunkGUGHIQ4P_js.detectOrientation());
8108
+ setOrientation(chunk4Z4HEIP5_js.detectOrientation());
8136
8109
  };
8137
8110
  if (screen.orientation) {
8138
8111
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -8162,9 +8135,9 @@ function useIsMobile(input) {
8162
8135
  window.addEventListener("resize", handleResize);
8163
8136
  return () => window.removeEventListener("resize", handleResize);
8164
8137
  }, [isTouchDevice, initialViewportHeight]);
8165
- const isMobile = chunkGUGHIQ4P_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8166
- const isTablet = !isMobile && containerWidth >= chunkGUGHIQ4P_js.MOBILE_BREAKPOINT && containerWidth < chunkGUGHIQ4P_js.TABLET_BREAKPOINT;
8167
- const isDesktop = !isMobile && containerWidth >= chunkGUGHIQ4P_js.TABLET_BREAKPOINT;
8138
+ const isMobile = chunk4Z4HEIP5_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
8139
+ const isTablet = !isMobile && containerWidth >= chunk4Z4HEIP5_js.MOBILE_BREAKPOINT && containerWidth < chunk4Z4HEIP5_js.TABLET_BREAKPOINT;
8140
+ const isDesktop = !isMobile && containerWidth >= chunk4Z4HEIP5_js.TABLET_BREAKPOINT;
8168
8141
  return {
8169
8142
  isMobile,
8170
8143
  isTablet,
@@ -8226,7 +8199,7 @@ function useViewerDialogs(input) {
8226
8199
  );
8227
8200
  const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8228
8201
  const fontEmbedding = react.useMemo(
8229
- () => chunkGUGHIQ4P_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8202
+ () => chunk4Z4HEIP5_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8230
8203
  [embeddedFontKey]
8231
8204
  );
8232
8205
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
@@ -8234,11 +8207,11 @@ function useViewerDialogs(input) {
8234
8207
  setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8235
8208
  }, [fontEmbedding]);
8236
8209
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8237
- () => typeof window !== "undefined" ? chunkGUGHIQ4P_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8210
+ () => typeof window !== "undefined" ? chunk4Z4HEIP5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8238
8211
  );
8239
8212
  react.useEffect(() => {
8240
8213
  const handleWindow = () => setIsNarrowViewport(
8241
- chunkGUGHIQ4P_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8214
+ chunk4Z4HEIP5_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8242
8215
  );
8243
8216
  let observer = null;
8244
8217
  let raf = 0;
@@ -8252,12 +8225,12 @@ function useViewerDialogs(input) {
8252
8225
  const entry = entries[0];
8253
8226
  if (entry) {
8254
8227
  setIsNarrowViewport(
8255
- chunkGUGHIQ4P_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8228
+ chunk4Z4HEIP5_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
8256
8229
  );
8257
8230
  }
8258
8231
  });
8259
8232
  observer.observe(el);
8260
- setIsNarrowViewport(chunkGUGHIQ4P_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8233
+ setIsNarrowViewport(chunk4Z4HEIP5_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
8261
8234
  };
8262
8235
  attach();
8263
8236
  window.addEventListener("resize", handleWindow);
@@ -8416,20 +8389,20 @@ function useViewerDialogs(input) {
8416
8389
  }
8417
8390
  function computeGridSpacingPx(presentationGridSpacing) {
8418
8391
  if (presentationGridSpacing) {
8419
- const px = Math.round(presentationGridSpacing.cx / chunkV5PW4QCE_js.EMU_PER_PX);
8392
+ const px = Math.round(presentationGridSpacing.cx / chunkLLZ25OVR_js.EMU_PER_PX);
8420
8393
  if (px > 0) {
8421
8394
  return px;
8422
8395
  }
8423
8396
  }
8424
- return chunkV5PW4QCE_js.GRID_SIZE;
8397
+ return chunkLLZ25OVR_js.GRID_SIZE;
8425
8398
  }
8426
8399
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8427
8400
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8428
- return chunkGUGHIQ4P_js.resolveShowSlideIndexes(slides, activeShow);
8401
+ return chunk4Z4HEIP5_js.resolveShowSlideIndexes(slides, activeShow);
8429
8402
  }
8430
8403
  function computeSlideSectionGroups(slides, sections) {
8431
- return chunkGUGHIQ4P_js.groupSlidesBySection(sections, slides).map((group) => ({
8432
- id: group.section?.id ?? (sections.length > 0 ? chunkV5PW4QCE_js.UNGROUPED_SECTION_ID : chunkV5PW4QCE_js.DEFAULT_SECTION_GROUP_ID),
8404
+ return chunk4Z4HEIP5_js.groupSlidesBySection(sections, slides).map((group) => ({
8405
+ id: group.section?.id ?? (sections.length > 0 ? chunkLLZ25OVR_js.UNGROUPED_SECTION_ID : chunkLLZ25OVR_js.DEFAULT_SECTION_GROUP_ID),
8433
8406
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8434
8407
  slideIndexes: group.slideIndexes,
8435
8408
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8441,7 +8414,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8441
8414
  return void 0;
8442
8415
  }
8443
8416
  const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8444
- return chunkGUGHIQ4P_js.masterViewPseudoSlide(document2, {
8417
+ return chunk4Z4HEIP5_js.masterViewPseudoSlide(document2, {
8445
8418
  tab: "slides",
8446
8419
  masterIndex: 0,
8447
8420
  layoutIndex: activeLayout ? 0 : null
@@ -8469,10 +8442,10 @@ function useDerivedSlideState(input) {
8469
8442
  );
8470
8443
  const slideSectionGroups = react.useMemo(
8471
8444
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8472
- if (group.id === chunkV5PW4QCE_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8445
+ if (group.id === chunkLLZ25OVR_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8473
8446
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8474
8447
  }
8475
- if (group.id === chunkV5PW4QCE_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8448
+ if (group.id === chunkLLZ25OVR_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8476
8449
  return { ...group, label: t("pptx.sections.slides") };
8477
8450
  }
8478
8451
  return group;
@@ -8572,13 +8545,13 @@ function useAnnotationHandlers(input) {
8572
8545
  }, [annotations, setMode, setSlides, history]);
8573
8546
  const handleSetMode = react.useCallback(
8574
8547
  (nextMode) => {
8575
- if (mode === "present" && nextMode !== "present" && !chunkGUGHIQ4P_js.mayLeaveSlideShow()) {
8548
+ if (mode === "present" && nextMode !== "present" && !chunk4Z4HEIP5_js.mayLeaveSlideShow()) {
8576
8549
  return;
8577
8550
  }
8578
8551
  if (nextMode === "present") {
8579
8552
  presentation.enterPresentMode();
8580
8553
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8581
- chunkGUGHIQ4P_js.stopAllPersistentAudio();
8554
+ chunk4Z4HEIP5_js.stopAllPersistentAudio();
8582
8555
  pendingModeAfterAnnotationsRef.current = nextMode;
8583
8556
  if (promptKeepInkAnnotations) {
8584
8557
  setShowKeepAnnotationsDialog(true);
@@ -8587,7 +8560,7 @@ function useAnnotationHandlers(input) {
8587
8560
  }
8588
8561
  } else {
8589
8562
  if (mode === "present") {
8590
- chunkGUGHIQ4P_js.stopAllPersistentAudio();
8563
+ chunk4Z4HEIP5_js.stopAllPersistentAudio();
8591
8564
  }
8592
8565
  setMode(nextMode);
8593
8566
  }
@@ -8658,13 +8631,13 @@ function useSerialize(input) {
8658
8631
  let processedSlide = slide;
8659
8632
  if (pendingEditId) {
8660
8633
  const updatedElements = slide.elements.map((el) => {
8661
- if (el.id !== pendingEditId || !chunkGUGHIQ4P_js.hasTextProperties(el)) {
8634
+ if (el.id !== pendingEditId || !chunk4Z4HEIP5_js.hasTextProperties(el)) {
8662
8635
  return el;
8663
8636
  }
8664
8637
  return {
8665
8638
  ...el,
8666
8639
  text: pendingEditText,
8667
- textSegments: chunkGUGHIQ4P_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8640
+ textSegments: chunk4Z4HEIP5_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8668
8641
  };
8669
8642
  });
8670
8643
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8677,19 +8650,19 @@ function useSerialize(input) {
8677
8650
  const pptxGuides = guides.map((g) => ({
8678
8651
  id: g.id,
8679
8652
  orientation: g.axis === "h" ? "horz" : "vert",
8680
- positionEmu: chunkGUGHIQ4P_js.guidePxToEmu(g.position)
8653
+ positionEmu: chunk4Z4HEIP5_js.guidePxToEmu(g.position)
8681
8654
  }));
8682
8655
  return {
8683
8656
  ...processedSlide,
8684
8657
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8685
8658
  };
8686
8659
  });
8687
- const slidesToSave = chunkGUGHIQ4P_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8660
+ const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8688
8661
  const saveOptions = {
8689
8662
  // Without this the Slide Size card edited a viewer-only pixel value and
8690
8663
  // the saved `p:sldSz` never moved: passing `slideSize` is the only way a
8691
8664
  // slide-size edit reaches the file.
8692
- slideSize: chunkGUGHIQ4P_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8665
+ slideSize: chunk4Z4HEIP5_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8693
8666
  headerFooter,
8694
8667
  presentationProperties,
8695
8668
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -8701,9 +8674,9 @@ function useSerialize(input) {
8701
8674
  slideMasters,
8702
8675
  notesMaster,
8703
8676
  handoutMaster,
8704
- ...chunkGUGHIQ4P_js.embeddedFontSaveOptions(embedFonts)
8677
+ ...chunk4Z4HEIP5_js.embeddedFontSaveOptions(embedFonts)
8705
8678
  };
8706
- return chunkGUGHIQ4P_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8679
+ return chunk4Z4HEIP5_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8707
8680
  }, [
8708
8681
  slides,
8709
8682
  templateElementsBySlideId,
@@ -8738,7 +8711,7 @@ function useRecoveryDetection(input) {
8738
8711
  const onRestore = input.onRestore;
8739
8712
  const openVersionHistory = input.openVersionHistory;
8740
8713
  react.useEffect(() => {
8741
- if (!chunkGUGHIQ4P_js.shouldProbeAutosaveRecovery({
8714
+ if (!chunk4Z4HEIP5_js.shouldProbeAutosaveRecovery({
8742
8715
  alreadyChecked: recoveryCheckedRef.current,
8743
8716
  filePath,
8744
8717
  loading,
@@ -8750,7 +8723,7 @@ function useRecoveryDetection(input) {
8750
8723
  }
8751
8724
  recoveryCheckedRef.current = true;
8752
8725
  void (async () => {
8753
- const offer = await chunkGUGHIQ4P_js.probeAutosaveRecovery(filePath);
8726
+ const offer = await chunk4Z4HEIP5_js.probeAutosaveRecovery(filePath);
8754
8727
  if (!offer) {
8755
8728
  return;
8756
8729
  }
@@ -8763,7 +8736,7 @@ function useRecoveryDetection(input) {
8763
8736
  const record = recordRef.current;
8764
8737
  setPrompt(null);
8765
8738
  if (record && onRestore) {
8766
- onRestore(chunkGUGHIQ4P_js.acceptAutosaveRecovery(record));
8739
+ onRestore(chunk4Z4HEIP5_js.acceptAutosaveRecovery(record));
8767
8740
  }
8768
8741
  recordRef.current = null;
8769
8742
  }, [onRestore]);
@@ -8772,7 +8745,7 @@ function useRecoveryDetection(input) {
8772
8745
  setPrompt(null);
8773
8746
  recordRef.current = null;
8774
8747
  if (record) {
8775
- void chunkGUGHIQ4P_js.discardAutosaveRecovery(record);
8748
+ void chunk4Z4HEIP5_js.discardAutosaveRecovery(record);
8776
8749
  }
8777
8750
  }, []);
8778
8751
  return { prompt, restore, discard };
@@ -8812,7 +8785,7 @@ function usePresentationSetup(input) {
8812
8785
  containerRef,
8813
8786
  content,
8814
8787
  onSetMode: (nextMode) => {
8815
- if (mode === "present" && nextMode !== "present" && !chunkGUGHIQ4P_js.mayLeaveSlideShow()) {
8788
+ if (mode === "present" && nextMode !== "present" && !chunk4Z4HEIP5_js.mayLeaveSlideShow()) {
8816
8789
  return;
8817
8790
  }
8818
8791
  if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
@@ -8820,7 +8793,7 @@ function usePresentationSetup(input) {
8820
8793
  setShowKeepAnnotationsDialog(true);
8821
8794
  } else {
8822
8795
  if (mode === "present" && nextMode !== "present") {
8823
- chunkGUGHIQ4P_js.stopAllPersistentAudio();
8796
+ chunk4Z4HEIP5_js.stopAllPersistentAudio();
8824
8797
  stopAnimationSound();
8825
8798
  }
8826
8799
  setMode(nextMode);
@@ -8875,10 +8848,10 @@ function usePresentationSetup(input) {
8875
8848
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8876
8849
  onToggleSubtitles,
8877
8850
  onSaveRehearsalTimings: (timings) => {
8878
- setSlides((prev) => chunkGUGHIQ4P_js.applyRehearsalTimings(prev, timings));
8851
+ setSlides((prev) => chunk4Z4HEIP5_js.applyRehearsalTimings(prev, timings));
8879
8852
  history.markDirty();
8880
8853
  },
8881
- loopContinuously: chunkGUGHIQ4P_js.shouldLoopContinuously(presentationProperties),
8854
+ loopContinuously: chunk4Z4HEIP5_js.shouldLoopContinuously(presentationProperties),
8882
8855
  showWithAnimation: presentationProperties.showWithAnimation,
8883
8856
  useTimings: presentationProperties.advanceMode !== "manual",
8884
8857
  endWithBlackSlide
@@ -9071,7 +9044,7 @@ function useEditorOperations(input) {
9071
9044
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9072
9045
  react.useEffect(() => {
9073
9046
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9074
- copiedFormatRef.current = chunkGUGHIQ4P_js.copyFormatFromElement(selectedElement);
9047
+ copiedFormatRef.current = chunk4Z4HEIP5_js.copyFormatFromElement(selectedElement);
9075
9048
  } else if (!formatPainterActive) {
9076
9049
  copiedFormatRef.current = null;
9077
9050
  }
@@ -9097,12 +9070,12 @@ function useEditorOperations(input) {
9097
9070
  e.stopPropagation();
9098
9071
  const element = elementLookup.get(elementId);
9099
9072
  if (element) {
9100
- const updated = chunkGUGHIQ4P_js.applyFormatToElement(element, copiedFormatRef.current);
9073
+ const updated = chunk4Z4HEIP5_js.applyFormatToElement(element, copiedFormatRef.current);
9101
9074
  const updates = {};
9102
- if (chunkGUGHIQ4P_js.hasShapeProperties(updated)) {
9075
+ if (chunk4Z4HEIP5_js.hasShapeProperties(updated)) {
9103
9076
  updates.shapeStyle = updated.shapeStyle;
9104
9077
  }
9105
- if (chunkGUGHIQ4P_js.hasTextProperties(updated)) {
9078
+ if (chunk4Z4HEIP5_js.hasTextProperties(updated)) {
9106
9079
  updates.textStyle = updated.textStyle;
9107
9080
  }
9108
9081
  ops.updateElementById(elementId, updates);
@@ -9256,7 +9229,7 @@ function collectReferencedFontFamilies(slides) {
9256
9229
  const families = /* @__PURE__ */ new Set();
9257
9230
  for (const slide of slides) {
9258
9231
  for (const el of slide.elements) {
9259
- if (chunkGUGHIQ4P_js.hasTextProperties(el) && el.textSegments) {
9232
+ if (chunk4Z4HEIP5_js.hasTextProperties(el) && el.textSegments) {
9260
9233
  for (const seg of el.textSegments) {
9261
9234
  if (seg.style.fontFamily) {
9262
9235
  families.add(seg.style.fontFamily);
@@ -9503,7 +9476,7 @@ function useKeyboardShortcuts(input) {
9503
9476
  inputRef.current = input;
9504
9477
  const handleKeyDown = react.useCallback((e) => {
9505
9478
  const current = inputRef.current;
9506
- const { action, dx, dy } = chunkGUGHIQ4P_js.mapEditorKey(e, {
9479
+ const { action, dx, dy } = chunk4Z4HEIP5_js.mapEditorKey(e, {
9507
9480
  canEdit: current.canEdit,
9508
9481
  // The Slide Master view is an editing surface, not a viewing one.
9509
9482
  // Gating on `mode !== 'edit'` alone made `mapEditorKey` return
@@ -9516,7 +9489,7 @@ function useKeyboardShortcuts(input) {
9516
9489
  hasSelection: current.hasSelection,
9517
9490
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9518
9491
  isDrawing: current.activeTool !== "select",
9519
- isTextInputTarget: chunkGUGHIQ4P_js.isEditorTextInputTarget(e.target)
9492
+ isTextInputTarget: chunk4Z4HEIP5_js.isEditorTextInputTarget(e.target)
9520
9493
  });
9521
9494
  if (action === null) {
9522
9495
  return;
@@ -9822,7 +9795,7 @@ function useViewerIntegration(input) {
9822
9795
  return zoom.scale;
9823
9796
  },
9824
9797
  setZoom(level) {
9825
- zoom.setScale(chunkGUGHIQ4P_js.clampZoomScale(level));
9798
+ zoom.setScale(chunk4Z4HEIP5_js.clampZoomScale(level));
9826
9799
  },
9827
9800
  zoomIn() {
9828
9801
  zoom.handleZoomIn();
@@ -10038,7 +10011,7 @@ function useReducedMotion() {
10038
10011
  }
10039
10012
  function useViewerOptions() {
10040
10013
  const storeRef = react.useRef(null);
10041
- storeRef.current ??= chunkGUGHIQ4P_js.createViewerOptionsStore();
10014
+ storeRef.current ??= chunk4Z4HEIP5_js.createViewerOptionsStore();
10042
10015
  const store = storeRef.current;
10043
10016
  const options = react.useSyncExternalStore(
10044
10017
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -10047,9 +10020,9 @@ function useViewerOptions() {
10047
10020
  );
10048
10021
  return { optionsStore: store, options };
10049
10022
  }
10050
- var KNOWN_TAB_IDS = new Set(chunkGUGHIQ4P_js.TOOLBAR_TABS.map((tab) => tab.id));
10023
+ var KNOWN_TAB_IDS = new Set(chunk4Z4HEIP5_js.TOOLBAR_TABS.map((tab) => tab.id));
10051
10024
  function computeToolbarVisibility(hiddenActions) {
10052
- const isHidden = (id) => chunkGUGHIQ4P_js.isActionHidden(id, hiddenActions);
10025
+ const isHidden = (id) => chunk4Z4HEIP5_js.isActionHidden(id, hiddenActions);
10053
10026
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
10054
10027
  return { isHidden, isTabVisible };
10055
10028
  }
@@ -10135,12 +10108,12 @@ function useYjsDocumentSync({
10135
10108
  return;
10136
10109
  }
10137
10110
  try {
10138
- const handler = new chunkGUGHIQ4P_js.PptxHandler();
10111
+ const handler = new chunk4Z4HEIP5_js.PptxHandler();
10139
10112
  await handler.load(sourceBytes.buffer);
10140
- const currentSlides = chunkGUGHIQ4P_js.readSlidesFromYDoc(
10113
+ const currentSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
10141
10114
  doc
10142
10115
  );
10143
- const slidesToSave = chunkGUGHIQ4P_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10116
+ const slidesToSave = chunk4Z4HEIP5_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10144
10117
  const bytes = await handler.save(slidesToSave);
10145
10118
  config.onWriteBack(bytes);
10146
10119
  } catch {
@@ -10155,10 +10128,10 @@ function useYjsDocumentSync({
10155
10128
  if (!doc || !isConnected) {
10156
10129
  return;
10157
10130
  }
10158
- const docSlides = chunkGUGHIQ4P_js.readSlidesFromYDoc(
10131
+ const docSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
10159
10132
  doc
10160
10133
  );
10161
- if (!chunkGUGHIQ4P_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
10134
+ if (!chunk4Z4HEIP5_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
10162
10135
  return;
10163
10136
  }
10164
10137
  lastSyncedRef.current = JSON.stringify(docSlides);
@@ -10177,11 +10150,11 @@ function useYjsDocumentSync({
10177
10150
  lastSyncedRef.current = serialized;
10178
10151
  void (async () => {
10179
10152
  const factories = await getFactories();
10180
- chunkGUGHIQ4P_js.reconcileSlidesInYDoc(
10153
+ chunk4Z4HEIP5_js.reconcileSlidesInYDoc(
10181
10154
  slides,
10182
10155
  doc,
10183
10156
  factories,
10184
- chunkGUGHIQ4P_js.LOCAL_SYNC_ORIGIN
10157
+ chunk4Z4HEIP5_js.LOCAL_SYNC_ORIGIN
10185
10158
  );
10186
10159
  scheduleWriteBack();
10187
10160
  })();
@@ -10195,10 +10168,10 @@ function useYjsDocumentSync({
10195
10168
  return;
10196
10169
  }
10197
10170
  const handleChange = (_events, transaction) => {
10198
- if (transaction?.origin === chunkGUGHIQ4P_js.LOCAL_SYNC_ORIGIN) {
10171
+ if (transaction?.origin === chunk4Z4HEIP5_js.LOCAL_SYNC_ORIGIN) {
10199
10172
  return;
10200
10173
  }
10201
- const remoteSlides = chunkGUGHIQ4P_js.readSlidesFromYDoc(
10174
+ const remoteSlides = chunk4Z4HEIP5_js.readSlidesFromYDoc(
10202
10175
  doc
10203
10176
  );
10204
10177
  if (remoteSlides.length === 0) {
@@ -10214,7 +10187,7 @@ function useYjsDocumentSync({
10214
10187
  isApplyingRemoteRef.current = false;
10215
10188
  scheduleWriteBack();
10216
10189
  };
10217
- const unobserve = chunkGUGHIQ4P_js.observeYDocSlides(
10190
+ const unobserve = chunk4Z4HEIP5_js.observeYDocSlides(
10218
10191
  doc,
10219
10192
  handleChange
10220
10193
  );
@@ -10252,7 +10225,7 @@ function useBroadcastFollower({
10252
10225
  if (!broadcaster) {
10253
10226
  return;
10254
10227
  }
10255
- if (!chunkGUGHIQ4P_js.shouldAutoFollowBroadcaster({
10228
+ if (!chunk4Z4HEIP5_js.shouldAutoFollowBroadcaster({
10256
10229
  localRole: collab.config.role,
10257
10230
  broadcasterRole: broadcaster.role
10258
10231
  })) {
@@ -10423,10 +10396,10 @@ function useTouchGestures(input) {
10423
10396
  if (!el || !enabled) {
10424
10397
  return;
10425
10398
  }
10426
- const recognizer = chunkGUGHIQ4P_js.createTouchGestureRecognizer({
10399
+ const recognizer = chunk4Z4HEIP5_js.createTouchGestureRecognizer({
10427
10400
  getScale: () => scaleRef.current,
10428
- minScale: chunkGUGHIQ4P_js.MIN_ZOOM_SCALE,
10429
- maxScale: chunkGUGHIQ4P_js.MAX_ZOOM_SCALE,
10401
+ minScale: chunk4Z4HEIP5_js.MIN_ZOOM_SCALE,
10402
+ maxScale: chunk4Z4HEIP5_js.MAX_ZOOM_SCALE,
10430
10403
  callbacks: {
10431
10404
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10432
10405
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10466,7 +10439,7 @@ function scrollFocusedIntoView(keyboardInset) {
10466
10439
  return;
10467
10440
  }
10468
10441
  const rect = active.getBoundingClientRect();
10469
- const delta = chunkGUGHIQ4P_js.computeScrollDelta(
10442
+ const delta = chunk4Z4HEIP5_js.computeScrollDelta(
10470
10443
  { top: rect.top, bottom: rect.bottom },
10471
10444
  window.innerHeight,
10472
10445
  keyboardInset
@@ -10486,8 +10459,8 @@ function useKeyboardInsets(enabled = true) {
10486
10459
  return;
10487
10460
  }
10488
10461
  const update = () => {
10489
- const metrics = chunkGUGHIQ4P_js.readViewportMetrics(window);
10490
- const inset = metrics ? chunkGUGHIQ4P_js.computeKeyboardInset(metrics) : 0;
10462
+ const metrics = chunk4Z4HEIP5_js.readViewportMetrics(window);
10463
+ const inset = metrics ? chunk4Z4HEIP5_js.computeKeyboardInset(metrics) : 0;
10491
10464
  setKeyboardInset(inset);
10492
10465
  if (inset > 0) {
10493
10466
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10498,8 +10471,8 @@ function useKeyboardInsets(enabled = true) {
10498
10471
  vv.addEventListener("scroll", update);
10499
10472
  const onFocusIn = () => {
10500
10473
  window.requestAnimationFrame(() => {
10501
- const metrics = chunkGUGHIQ4P_js.readViewportMetrics(window);
10502
- const inset = metrics ? chunkGUGHIQ4P_js.computeKeyboardInset(metrics) : 0;
10474
+ const metrics = chunk4Z4HEIP5_js.readViewportMetrics(window);
10475
+ const inset = metrics ? chunk4Z4HEIP5_js.computeKeyboardInset(metrics) : 0;
10503
10476
  if (inset > 0) {
10504
10477
  scrollFocusedIntoView(inset);
10505
10478
  }
@@ -10512,7 +10485,7 @@ function useKeyboardInsets(enabled = true) {
10512
10485
  document.removeEventListener("focusin", onFocusIn);
10513
10486
  };
10514
10487
  }, [enabled]);
10515
- return { keyboardInset, isKeyboardOpen: chunkGUGHIQ4P_js.isKeyboardOpen(keyboardInset) };
10488
+ return { keyboardInset, isKeyboardOpen: chunk4Z4HEIP5_js.isKeyboardOpen(keyboardInset) };
10516
10489
  }
10517
10490
 
10518
10491
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10539,7 +10512,7 @@ function buildCanvasProps(input) {
10539
10512
  } = input;
10540
10513
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10541
10514
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10542
- const fieldContext = chunkGUGHIQ4P_js.buildFieldSubstitutionContext({
10515
+ const fieldContext = chunk4Z4HEIP5_js.buildFieldSubstitutionContext({
10543
10516
  headerFooter: s.headerFooter,
10544
10517
  customProperties: s.customProperties,
10545
10518
  slide: activeSlide
@@ -10549,13 +10522,13 @@ function buildCanvasProps(input) {
10549
10522
  if (mode === "present") {
10550
10523
  presentation.handlePresentationAction(action);
10551
10524
  } else if (action.url) {
10552
- chunkGUGHIQ4P_js.safeOpenUrl(action.url);
10525
+ chunk4Z4HEIP5_js.safeOpenUrl(action.url);
10553
10526
  }
10554
10527
  };
10555
10528
  const handleHyperlinkClick = (url) => {
10556
- if (chunkGUGHIQ4P_js.isPpactionUrl(url)) {
10529
+ if (chunk4Z4HEIP5_js.isPpactionUrl(url)) {
10557
10530
  if (mode === "present") {
10558
- const parsed = chunkGUGHIQ4P_js.parsePpactionUrl(url);
10531
+ const parsed = chunk4Z4HEIP5_js.parsePpactionUrl(url);
10559
10532
  if (parsed) {
10560
10533
  presentation.handlePresentationAction({
10561
10534
  action: parsed.action,
@@ -10565,7 +10538,7 @@ function buildCanvasProps(input) {
10565
10538
  }
10566
10539
  return;
10567
10540
  }
10568
- chunkGUGHIQ4P_js.safeOpenUrl(url);
10541
+ chunk4Z4HEIP5_js.safeOpenUrl(url);
10569
10542
  };
10570
10543
  return {
10571
10544
  activeSlide: effectiveSlide,
@@ -10661,7 +10634,7 @@ function buildCanvasProps(input) {
10661
10634
 
10662
10635
  // src/viewer/hooks/useScopedLayoutOptions.ts
10663
10636
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10664
- return chunkGUGHIQ4P_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10637
+ return chunk4Z4HEIP5_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10665
10638
  }
10666
10639
 
10667
10640
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10674,7 +10647,7 @@ function buildToolbarAnimationHandlers(input) {
10674
10647
  const current = activeSlide.animations ?? [];
10675
10648
  if (group === "motionPath") {
10676
10649
  propertyHandlers.handleUpdateSlide({
10677
- animations: chunkGUGHIQ4P_js.applyMotionPathPreset(current, selectedElement.id, preset)
10650
+ animations: chunk4Z4HEIP5_js.applyMotionPathPreset(current, selectedElement.id, preset)
10678
10651
  });
10679
10652
  return;
10680
10653
  }
@@ -10869,7 +10842,7 @@ function buildToolbarProps(input) {
10869
10842
  onOpenFile,
10870
10843
  onOpenRecentFile,
10871
10844
  onCreatePresentation: (templateId) => {
10872
- s.setSlides(chunkGUGHIQ4P_js.createBackstagePresentation(templateId));
10845
+ s.setSlides(chunk4Z4HEIP5_js.createBackstagePresentation(templateId));
10873
10846
  s.setActiveSlideIndex(0);
10874
10847
  s.setSelectedElementId(null);
10875
10848
  s.setSelectedElementIds([]);
@@ -10898,7 +10871,7 @@ function buildToolbarProps(input) {
10898
10871
  loadLayoutPreviews: input.loadLayoutPreviews,
10899
10872
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10900
10873
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10901
- templateScheme: chunkGUGHIQ4P_js.templateSchemeFromTheme(s.theme?.colorScheme),
10874
+ templateScheme: chunk4Z4HEIP5_js.templateSchemeFromTheme(s.theme?.colorScheme),
10902
10875
  customShows: s.customShows,
10903
10876
  activeCustomShowId: s.activeCustomShowId,
10904
10877
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10939,7 +10912,7 @@ function buildToolbarProps(input) {
10939
10912
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10940
10913
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10941
10914
  formatPainterActive: s.formatPainterActive,
10942
- canActivateFormatPainter: chunkGUGHIQ4P_js.hasCopyableFormat(selectedElement),
10915
+ canActivateFormatPainter: chunk4Z4HEIP5_js.hasCopyableFormat(selectedElement),
10943
10916
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10944
10917
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10945
10918
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -11227,7 +11200,7 @@ function useViewerBuildingBlocks(input) {
11227
11200
  }, [incomingContent]);
11228
11201
  const onOpenFile = react.useCallback(() => {
11229
11202
  void (async () => {
11230
- const picked = await chunkGUGHIQ4P_js.openPptxFile();
11203
+ const picked = await chunk4Z4HEIP5_js.openPptxFile();
11231
11204
  if (picked) {
11232
11205
  setContent(picked.buffer);
11233
11206
  }
@@ -11235,7 +11208,7 @@ function useViewerBuildingBlocks(input) {
11235
11208
  }, []);
11236
11209
  const onOpenRecentFile = react.useCallback((key) => {
11237
11210
  void (async () => {
11238
- const bytes = await chunkGUGHIQ4P_js.readBackstageRecentFile(key);
11211
+ const bytes = await chunk4Z4HEIP5_js.readBackstageRecentFile(key);
11239
11212
  if (bytes) {
11240
11213
  setContent(bytes);
11241
11214
  }