pptx-react-viewer 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/{AiChatPanel-C3E7NLX3.mjs → AiChatPanel-BNFDBP4S.mjs} +9 -8
  3. package/dist/AiChatPanel-BNFDBP4S.mjs.br +0 -0
  4. package/dist/AiChatPanel-BNFDBP4S.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-TKBVSYD2.js → AiChatPanel-WNQCTQB5.js} +29 -28
  6. package/dist/AiChatPanel-WNQCTQB5.js.br +0 -0
  7. package/dist/AiChatPanel-WNQCTQB5.js.gz +0 -0
  8. package/dist/{Area3DChartScene-3A3CXKN3.js → Area3DChartScene-FXBSLIGX.js} +2 -2
  9. package/dist/Area3DChartScene-FXBSLIGX.js.br +0 -0
  10. package/dist/Area3DChartScene-FXBSLIGX.js.gz +0 -0
  11. package/dist/{Area3DChartScene-7YCFWEGX.mjs → Area3DChartScene-SAQVRYOH.mjs} +1 -1
  12. package/dist/Area3DChartScene-SAQVRYOH.mjs.br +0 -0
  13. package/dist/Area3DChartScene-SAQVRYOH.mjs.gz +0 -0
  14. package/dist/{Bar3DChartScene-BDUENAWJ.js → Bar3DChartScene-7HVUTP2E.js} +2 -2
  15. package/dist/Bar3DChartScene-7HVUTP2E.js.br +0 -0
  16. package/dist/Bar3DChartScene-7HVUTP2E.js.gz +0 -0
  17. package/dist/{Bar3DChartScene-7CNSJ35X.mjs → Bar3DChartScene-LUA6E2K6.mjs} +1 -1
  18. package/dist/Bar3DChartScene-LUA6E2K6.mjs.br +3 -0
  19. package/dist/Bar3DChartScene-LUA6E2K6.mjs.gz +0 -0
  20. package/dist/{Line3DChartScene-SMTHK6MD.mjs → Line3DChartScene-IW4JGH57.mjs} +1 -1
  21. package/dist/Line3DChartScene-IW4JGH57.mjs.br +0 -0
  22. package/dist/Line3DChartScene-IW4JGH57.mjs.gz +0 -0
  23. package/dist/{Line3DChartScene-R352CZ5U.js → Line3DChartScene-OVPULUTF.js} +2 -2
  24. package/dist/Line3DChartScene-OVPULUTF.js.br +0 -0
  25. package/dist/Line3DChartScene-OVPULUTF.js.gz +0 -0
  26. package/dist/{Model3DScene-Y4SGFQYW.js → Model3DScene-5KP6BVCV.js} +2 -2
  27. package/dist/Model3DScene-5KP6BVCV.js.br +0 -0
  28. package/dist/Model3DScene-5KP6BVCV.js.gz +0 -0
  29. package/dist/{Model3DScene-AUVJXXPV.mjs → Model3DScene-BERTZYCJ.mjs} +1 -1
  30. package/dist/Model3DScene-BERTZYCJ.mjs.br +0 -0
  31. package/dist/Model3DScene-BERTZYCJ.mjs.gz +0 -0
  32. package/dist/{PieChart3DScene-TK2VT4RS.js → PieChart3DScene-3R2ETTGA.js} +2 -2
  33. package/dist/PieChart3DScene-3R2ETTGA.js.br +0 -0
  34. package/dist/PieChart3DScene-3R2ETTGA.js.gz +0 -0
  35. package/dist/{PieChart3DScene-UD7GRH55.mjs → PieChart3DScene-O6FFK5L7.mjs} +1 -1
  36. package/dist/PieChart3DScene-O6FFK5L7.mjs.br +0 -0
  37. package/dist/PieChart3DScene-O6FFK5L7.mjs.gz +0 -0
  38. package/dist/{SurfaceChart3DScene-TXY6UZSW.mjs → SurfaceChart3DScene-OCR26R5D.mjs} +1 -1
  39. package/dist/SurfaceChart3DScene-OCR26R5D.mjs.br +0 -0
  40. package/dist/SurfaceChart3DScene-OCR26R5D.mjs.gz +0 -0
  41. package/dist/{SurfaceChart3DScene-ERFXZW2O.js → SurfaceChart3DScene-TGFAOLHL.js} +2 -2
  42. package/dist/SurfaceChart3DScene-TGFAOLHL.js.br +0 -0
  43. package/dist/SurfaceChart3DScene-TGFAOLHL.js.gz +0 -0
  44. package/dist/{chunk-RX6FE24O.mjs → chunk-2FTJAMFA.mjs} +294 -61
  45. package/dist/chunk-2FTJAMFA.mjs.br +0 -0
  46. package/dist/chunk-2FTJAMFA.mjs.gz +0 -0
  47. package/dist/{chunk-PPNXPEEZ.mjs → chunk-3B5FRKYU.mjs} +130 -437
  48. package/dist/chunk-3B5FRKYU.mjs.br +0 -0
  49. package/dist/chunk-3B5FRKYU.mjs.gz +0 -0
  50. package/dist/{chunk-ALO4ZOHQ.js → chunk-3P7FYHJH.js} +1 -0
  51. package/dist/chunk-3P7FYHJH.js.br +0 -0
  52. package/dist/chunk-3P7FYHJH.js.gz +0 -0
  53. package/dist/{chunk-B6UIVRFA.js → chunk-44CQ67GQ.js} +173 -262
  54. package/dist/chunk-44CQ67GQ.js.br +0 -0
  55. package/dist/chunk-44CQ67GQ.js.gz +0 -0
  56. package/dist/{chunk-RHSA5BW5.mjs → chunk-AMRT3AE4.mjs} +1 -0
  57. package/dist/chunk-AMRT3AE4.mjs.br +0 -0
  58. package/dist/chunk-AMRT3AE4.mjs.gz +0 -0
  59. package/dist/{chunk-G7UBIKAG.mjs → chunk-DM2IZCSD.mjs} +2429 -39
  60. package/dist/chunk-DM2IZCSD.mjs.br +0 -0
  61. package/dist/{chunk-G7UBIKAG.mjs.gz → chunk-DM2IZCSD.mjs.gz} +0 -0
  62. package/dist/{chunk-Q52HT4EZ.js → chunk-FSQCEAMG.js} +299 -63
  63. package/dist/chunk-FSQCEAMG.js.br +0 -0
  64. package/dist/chunk-FSQCEAMG.js.gz +0 -0
  65. package/dist/{chunk-ARQGUUYU.js → chunk-GR6SJJIT.js} +449 -723
  66. package/dist/chunk-GR6SJJIT.js.br +0 -0
  67. package/dist/chunk-GR6SJJIT.js.gz +0 -0
  68. package/dist/{chunk-FMEEIS6L.mjs → chunk-ITN5NYYM.mjs} +10 -98
  69. package/dist/chunk-ITN5NYYM.mjs.br +0 -0
  70. package/dist/chunk-ITN5NYYM.mjs.gz +0 -0
  71. package/dist/{chunk-FJDZ7AEE.js → chunk-K6R2JNCK.js} +2459 -45
  72. package/dist/chunk-K6R2JNCK.js.br +0 -0
  73. package/dist/{chunk-FJDZ7AEE.js.gz → chunk-K6R2JNCK.js.gz} +0 -0
  74. package/dist/{chunk-UHR7EYFM.mjs → chunk-QEEU4S4Z.mjs} +50 -324
  75. package/dist/chunk-QEEU4S4Z.mjs.br +0 -0
  76. package/dist/chunk-QEEU4S4Z.mjs.gz +0 -0
  77. package/dist/{chunk-RRAL4Y7V.js → chunk-QKSYKQEL.js} +1236 -1543
  78. package/dist/chunk-QKSYKQEL.js.br +0 -0
  79. package/dist/chunk-QKSYKQEL.js.gz +0 -0
  80. package/dist/i18n.js +4 -4
  81. package/dist/i18n.js.br +0 -0
  82. package/dist/i18n.js.gz +0 -0
  83. package/dist/i18n.mjs +1 -1
  84. package/dist/i18n.mjs.br +0 -0
  85. package/dist/i18n.mjs.gz +0 -0
  86. package/dist/index.js +47 -47
  87. package/dist/index.js.br +0 -0
  88. package/dist/index.js.gz +0 -0
  89. package/dist/index.mjs +6 -6
  90. package/dist/index.mjs.br +0 -0
  91. package/dist/index.mjs.gz +0 -0
  92. package/dist/internals.d.ts.map +1 -1
  93. package/dist/internals.js +79 -79
  94. package/dist/internals.js.br +4 -6
  95. package/dist/internals.js.gz +0 -0
  96. package/dist/internals.mjs +4 -4
  97. package/dist/internals.mjs.br +0 -0
  98. package/dist/internals.mjs.gz +0 -0
  99. package/dist/viewer/index.js +27 -27
  100. package/dist/viewer/index.js.br +0 -0
  101. package/dist/viewer/index.js.gz +0 -0
  102. package/dist/viewer/index.mjs +6 -6
  103. package/dist/viewer/index.mjs.br +0 -0
  104. package/dist/viewer/index.mjs.gz +0 -0
  105. package/package.json +1 -1
  106. package/dist/AiChatPanel-C3E7NLX3.mjs.br +0 -0
  107. package/dist/AiChatPanel-C3E7NLX3.mjs.gz +0 -0
  108. package/dist/AiChatPanel-TKBVSYD2.js.br +0 -0
  109. package/dist/AiChatPanel-TKBVSYD2.js.gz +0 -0
  110. package/dist/Area3DChartScene-3A3CXKN3.js.br +0 -0
  111. package/dist/Area3DChartScene-3A3CXKN3.js.gz +0 -0
  112. package/dist/Area3DChartScene-7YCFWEGX.mjs.br +0 -3
  113. package/dist/Area3DChartScene-7YCFWEGX.mjs.gz +0 -0
  114. package/dist/Bar3DChartScene-7CNSJ35X.mjs.br +0 -0
  115. package/dist/Bar3DChartScene-7CNSJ35X.mjs.gz +0 -0
  116. package/dist/Bar3DChartScene-BDUENAWJ.js.br +0 -0
  117. package/dist/Bar3DChartScene-BDUENAWJ.js.gz +0 -0
  118. package/dist/Line3DChartScene-R352CZ5U.js.br +0 -0
  119. package/dist/Line3DChartScene-R352CZ5U.js.gz +0 -0
  120. package/dist/Line3DChartScene-SMTHK6MD.mjs.br +0 -3
  121. package/dist/Line3DChartScene-SMTHK6MD.mjs.gz +0 -0
  122. package/dist/Model3DScene-AUVJXXPV.mjs.br +0 -0
  123. package/dist/Model3DScene-AUVJXXPV.mjs.gz +0 -0
  124. package/dist/Model3DScene-Y4SGFQYW.js.br +0 -0
  125. package/dist/Model3DScene-Y4SGFQYW.js.gz +0 -0
  126. package/dist/PieChart3DScene-TK2VT4RS.js.br +0 -0
  127. package/dist/PieChart3DScene-TK2VT4RS.js.gz +0 -0
  128. package/dist/PieChart3DScene-UD7GRH55.mjs.br +0 -0
  129. package/dist/PieChart3DScene-UD7GRH55.mjs.gz +0 -0
  130. package/dist/SurfaceChart3DScene-ERFXZW2O.js.br +0 -0
  131. package/dist/SurfaceChart3DScene-ERFXZW2O.js.gz +0 -0
  132. package/dist/SurfaceChart3DScene-TXY6UZSW.mjs.br +0 -0
  133. package/dist/SurfaceChart3DScene-TXY6UZSW.mjs.gz +0 -0
  134. package/dist/chunk-ALO4ZOHQ.js.br +0 -0
  135. package/dist/chunk-ALO4ZOHQ.js.gz +0 -0
  136. package/dist/chunk-ARQGUUYU.js.br +0 -0
  137. package/dist/chunk-ARQGUUYU.js.gz +0 -0
  138. package/dist/chunk-B6UIVRFA.js.br +0 -0
  139. package/dist/chunk-B6UIVRFA.js.gz +0 -0
  140. package/dist/chunk-FJDZ7AEE.js.br +0 -0
  141. package/dist/chunk-FMEEIS6L.mjs.br +0 -0
  142. package/dist/chunk-FMEEIS6L.mjs.gz +0 -0
  143. package/dist/chunk-G7UBIKAG.mjs.br +0 -0
  144. package/dist/chunk-PPNXPEEZ.mjs.br +0 -0
  145. package/dist/chunk-PPNXPEEZ.mjs.gz +0 -0
  146. package/dist/chunk-Q52HT4EZ.js.br +0 -0
  147. package/dist/chunk-Q52HT4EZ.js.gz +0 -0
  148. package/dist/chunk-RHSA5BW5.mjs.br +0 -0
  149. package/dist/chunk-RHSA5BW5.mjs.gz +0 -0
  150. package/dist/chunk-RRAL4Y7V.js.br +0 -0
  151. package/dist/chunk-RRAL4Y7V.js.gz +0 -0
  152. package/dist/chunk-RX6FE24O.mjs.br +0 -0
  153. package/dist/chunk-RX6FE24O.mjs.gz +0 -0
  154. package/dist/chunk-UHR7EYFM.mjs.br +0 -0
  155. package/dist/chunk-UHR7EYFM.mjs.gz +0 -0
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkB6UIVRFA_js = require('./chunk-B6UIVRFA.js');
4
- var chunkFJDZ7AEE_js = require('./chunk-FJDZ7AEE.js');
5
- var chunkALO4ZOHQ_js = require('./chunk-ALO4ZOHQ.js');
3
+ var chunk44CQ67GQ_js = require('./chunk-44CQ67GQ.js');
4
+ var chunkK6R2JNCK_js = require('./chunk-K6R2JNCK.js');
5
+ var chunk3P7FYHJH_js = require('./chunk-3P7FYHJH.js');
6
6
  var react = require('react');
7
7
  var reactI18next = require('react-i18next');
8
8
 
9
9
  function useVirtualizedSlides({
10
10
  totalItems,
11
11
  itemHeight,
12
- overscan = chunkFJDZ7AEE_js.DEFAULT_VIRTUAL_OVERSCAN
12
+ overscan = chunkK6R2JNCK_js.DEFAULT_VIRTUAL_OVERSCAN
13
13
  }) {
14
14
  const scrollContainerRef = react.useRef(null);
15
15
  const [scrollTop, setScrollTop] = react.useState(0);
@@ -39,7 +39,7 @@ function useVirtualizedSlides({
39
39
  resizeObserver?.disconnect();
40
40
  };
41
41
  }, []);
42
- const range = chunkFJDZ7AEE_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
42
+ const range = chunkK6R2JNCK_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
43
43
  const safeItemHeight = Math.max(itemHeight, 1);
44
44
  const scrollToIndex = react.useCallback(
45
45
  (index, behavior = "smooth") => {
@@ -80,7 +80,7 @@ function usePresenceTracking({
80
80
  }) {
81
81
  const [remoteUsers, setRemoteUsers] = react.useState([]);
82
82
  const projectorRef = react.useRef(null);
83
- projectorRef.current ??= chunkFJDZ7AEE_js.createPresenceProjector();
83
+ projectorRef.current ??= chunkK6R2JNCK_js.createPresenceProjector();
84
84
  const projector = projectorRef.current;
85
85
  const lastBroadcastRef = react.useRef(0);
86
86
  const pendingBroadcastRef = react.useRef(null);
@@ -105,7 +105,7 @@ function usePresenceTracking({
105
105
  awareness.setLocalStateField("presence", state);
106
106
  lastBroadcastRef.current = Date.now();
107
107
  };
108
- if (elapsed >= chunkFJDZ7AEE_js.BROADCAST_THROTTLE_MS) {
108
+ if (elapsed >= chunkK6R2JNCK_js.BROADCAST_THROTTLE_MS) {
109
109
  if (pendingBroadcastRef.current) {
110
110
  clearTimeout(pendingBroadcastRef.current);
111
111
  pendingBroadcastRef.current = null;
@@ -115,7 +115,7 @@ function usePresenceTracking({
115
115
  pendingBroadcastRef.current = setTimeout(() => {
116
116
  pendingBroadcastRef.current = null;
117
117
  flush();
118
- }, chunkFJDZ7AEE_js.BROADCAST_THROTTLE_MS - elapsed);
118
+ }, chunkK6R2JNCK_js.BROADCAST_THROTTLE_MS - elapsed);
119
119
  }
120
120
  },
121
121
  [awareness, userName, userColor, userAvatar, role]
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
195
195
  const departureRef = react.useRef(null);
196
196
  const gateRef = react.useRef(null);
197
197
  if (!gateRef.current) {
198
- gateRef.current = chunkFJDZ7AEE_js.createSyncGate(() => setSynced(true));
198
+ gateRef.current = chunkK6R2JNCK_js.createSyncGate(() => setSynced(true));
199
199
  }
200
200
  const teardown = react.useCallback(() => {
201
201
  if (timeoutRef.current) {
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
215
215
  const buildCleanup = react.useCallback(
216
216
  (provider, yDoc) => () => {
217
217
  announceDeparture();
218
- chunkFJDZ7AEE_js.clearLocalAwareness(provider.awareness);
218
+ chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
219
219
  provider.destroy();
220
220
  yDoc.destroy();
221
221
  setDoc(null);
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
240
240
  if (config.authToken) {
241
241
  opts.password = config.authToken;
242
242
  }
243
- const roomId = chunkFJDZ7AEE_js.validateRoomId(config.roomId);
243
+ const roomId = chunkK6R2JNCK_js.validateRoomId(config.roomId);
244
244
  const provider = new WebrtcProvider(roomId, yDoc, opts);
245
- departureRef.current = chunkFJDZ7AEE_js.createDepartureChannel(roomId, provider.awareness);
245
+ departureRef.current = chunkK6R2JNCK_js.createDepartureChannel(roomId, provider.awareness);
246
246
  setDoc(yDoc);
247
247
  setAwareness(provider.awareness);
248
248
  setClientId(provider.awareness.clientID);
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
284
284
  if (!config) {
285
285
  return;
286
286
  }
287
- const roomId = chunkFJDZ7AEE_js.validateRoomId(config.roomId);
288
- const transport = config.transport ?? chunkFJDZ7AEE_js.resolveTransportForServerUrl(config.serverUrl);
287
+ const roomId = chunkK6R2JNCK_js.validateRoomId(config.roomId);
288
+ const transport = config.transport ?? chunkK6R2JNCK_js.resolveTransportForServerUrl(config.serverUrl);
289
289
  if (transport === "webrtc") {
290
290
  await initWebrtc();
291
291
  return;
292
292
  }
293
- if (chunkFJDZ7AEE_js.isMixedContentBlocked(config.serverUrl)) {
293
+ if (chunkK6R2JNCK_js.isMixedContentBlocked(config.serverUrl)) {
294
294
  console.warn(
295
295
  `[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
296
296
  );
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
304
304
  const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
305
305
  params: config.authToken ? { token: config.authToken } : void 0
306
306
  });
307
- departureRef.current = chunkFJDZ7AEE_js.createDepartureChannel(roomId, provider.awareness);
307
+ departureRef.current = chunkK6R2JNCK_js.createDepartureChannel(roomId, provider.awareness);
308
308
  let connected = false;
309
309
  const handleStatus = (event) => {
310
310
  if (event.status === "connected") {
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
344
344
  provider.off("status", handleStatus);
345
345
  provider.off("sync", handleSynced);
346
346
  announceDeparture();
347
- chunkFJDZ7AEE_js.clearLocalAwareness(provider.awareness);
347
+ chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
348
348
  provider.destroy();
349
349
  yDoc.destroy();
350
350
  setDoc(null);
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
353
353
  cleanupRef.current = null;
354
354
  setStatus("error");
355
355
  }
356
- }, chunkFJDZ7AEE_js.CONNECTION_TIMEOUT_MS);
356
+ }, chunkK6R2JNCK_js.CONNECTION_TIMEOUT_MS);
357
357
  }
358
358
  setDoc(yDoc);
359
359
  setAwareness(provider.awareness);
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
362
362
  provider.off("status", handleStatus);
363
363
  provider.off("sync", handleSynced);
364
364
  announceDeparture();
365
- chunkFJDZ7AEE_js.clearLocalAwareness(provider.awareness);
365
+ chunkK6R2JNCK_js.clearLocalAwareness(provider.awareness);
366
366
  provider.destroy();
367
367
  yDoc.destroy();
368
368
  setDoc(null);
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
388
388
  ]);
389
389
  react.useEffect(() => {
390
390
  init();
391
- const disposeTeardown = chunkFJDZ7AEE_js.registerCollaborationTeardown({
391
+ const disposeTeardown = chunkK6R2JNCK_js.registerCollaborationTeardown({
392
392
  leave: teardown,
393
393
  rejoin: init
394
394
  });
@@ -409,7 +409,7 @@ function useCollaborativeState({
409
409
  canvasWidth,
410
410
  canvasHeight
411
411
  }) {
412
- const userColor = chunkFJDZ7AEE_js.sanitizeColor(config?.userColor, "#6366f1");
412
+ const userColor = chunkK6R2JNCK_js.sanitizeColor(config?.userColor, "#6366f1");
413
413
  const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
414
414
  const { remoteUsers, broadcastPresence } = usePresenceTracking({
415
415
  awareness,
@@ -527,8 +527,8 @@ function useEditorHistory(input) {
527
527
  width: canvasSize.width,
528
528
  height: canvasSize.height,
529
529
  activeSlideIndex,
530
- slides: slides.map(chunkFJDZ7AEE_js.cloneSlide),
531
- templateElementsBySlideId: chunkFJDZ7AEE_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
530
+ slides: slides.map(chunkK6R2JNCK_js.cloneSlide),
531
+ templateElementsBySlideId: chunkK6R2JNCK_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
532
532
  ...actionLabel ? { actionLabel } : {}
533
533
  };
534
534
  },
@@ -541,9 +541,9 @@ function useEditorHistory(input) {
541
541
  width: snapshot.width,
542
542
  height: snapshot.height
543
543
  });
544
- setSlides(snapshot.slides.map(chunkFJDZ7AEE_js.cloneSlide));
544
+ setSlides(snapshot.slides.map(chunkK6R2JNCK_js.cloneSlide));
545
545
  setTemplateElementsBySlideId(
546
- chunkFJDZ7AEE_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
546
+ chunkK6R2JNCK_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
547
547
  );
548
548
  setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
549
549
  setSelectedElementIds([]);
@@ -582,8 +582,8 @@ function useEditorHistory(input) {
582
582
  const currentSnapshot = buildHistorySnapshot();
583
583
  historyFutureRef.current.push(currentSnapshot);
584
584
  isApplyingHistoryRef.current = true;
585
- const nextSnapshot = chunkB6UIVRFA_js.cloneHistorySnapshot(previousSnapshot);
586
- lastHistorySnapshotRef.current = chunkB6UIVRFA_js.cloneHistorySnapshot(nextSnapshot);
585
+ const nextSnapshot = chunk44CQ67GQ_js.cloneHistorySnapshot(previousSnapshot);
586
+ lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(nextSnapshot);
587
587
  lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
588
588
  applyHistorySnapshot(nextSnapshot);
589
589
  updateHistoryAvailability();
@@ -604,8 +604,8 @@ function useEditorHistory(input) {
604
604
  const currentSnapshot = buildHistorySnapshot();
605
605
  historyPastRef.current.push(currentSnapshot);
606
606
  isApplyingHistoryRef.current = true;
607
- const targetSnapshot = chunkB6UIVRFA_js.cloneHistorySnapshot(nextSnapshot);
608
- lastHistorySnapshotRef.current = chunkB6UIVRFA_js.cloneHistorySnapshot(targetSnapshot);
607
+ const targetSnapshot = chunk44CQ67GQ_js.cloneHistorySnapshot(nextSnapshot);
608
+ lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(targetSnapshot);
609
609
  lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
610
610
  applyHistorySnapshot(targetSnapshot);
611
611
  updateHistoryAvailability();
@@ -623,7 +623,7 @@ function useEditorHistory(input) {
623
623
  historyPastRef.current = [];
624
624
  historyFutureRef.current = [];
625
625
  if (initialSnapshot) {
626
- const clonedInitial = chunkB6UIVRFA_js.cloneHistorySnapshot(initialSnapshot);
626
+ const clonedInitial = chunk44CQ67GQ_js.cloneHistorySnapshot(initialSnapshot);
627
627
  lastHistorySnapshotRef.current = clonedInitial;
628
628
  lastHistorySerializedRef.current = serializeDocument(clonedInitial);
629
629
  } else {
@@ -671,19 +671,19 @@ function useEditorHistory(input) {
671
671
  }
672
672
  const previousSnapshot = lastHistorySnapshotRef.current;
673
673
  if (!previousSnapshot) {
674
- lastHistorySnapshotRef.current = chunkB6UIVRFA_js.cloneHistorySnapshot(snapshot);
674
+ lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(snapshot);
675
675
  lastHistorySerializedRef.current = serialized;
676
676
  lastCheapHashRef.current = cheapHash;
677
677
  updateHistoryAvailability();
678
678
  return;
679
679
  }
680
680
  onDirtyRef.current?.();
681
- historyPastRef.current.push(chunkB6UIVRFA_js.cloneHistorySnapshot(previousSnapshot));
681
+ historyPastRef.current.push(chunk44CQ67GQ_js.cloneHistorySnapshot(previousSnapshot));
682
682
  while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
683
683
  historyPastRef.current.shift();
684
684
  }
685
685
  historyFutureRef.current = [];
686
- lastHistorySnapshotRef.current = chunkB6UIVRFA_js.cloneHistorySnapshot(snapshot);
686
+ lastHistorySnapshotRef.current = chunk44CQ67GQ_js.cloneHistorySnapshot(snapshot);
687
687
  lastHistorySerializedRef.current = serialized;
688
688
  lastCheapHashRef.current = cheapHash;
689
689
  updateHistoryAvailability();
@@ -743,9 +743,9 @@ function useZoomViewport({
743
743
  const canvasStageRef = react.useRef(null);
744
744
  const canvasViewportRef = react.useRef(null);
745
745
  const renderScaleRef = react.useRef(1);
746
- const wheelBufferRef = react.useRef(chunkFJDZ7AEE_js.createWheelStepBuffer());
746
+ const wheelBufferRef = react.useRef(chunkK6R2JNCK_js.createWheelStepBuffer());
747
747
  const storeRef = react.useRef(null);
748
- storeRef.current ??= chunkFJDZ7AEE_js.createViewerZoomStore();
748
+ storeRef.current ??= chunkK6R2JNCK_js.createViewerZoomStore();
749
749
  const store = storeRef.current;
750
750
  const scale = useViewerStore(store, selectZoom);
751
751
  const setScale = react.useCallback(
@@ -806,7 +806,7 @@ function useZoomViewport({
806
806
  if (!wrapper || !canvasViewport) {
807
807
  return;
808
808
  }
809
- const boundedScale = chunkFJDZ7AEE_js.clampZoomScale(nextScale);
809
+ const boundedScale = chunkK6R2JNCK_js.clampZoomScale(nextScale);
810
810
  const nextEditorScale = fitScale * boundedScale;
811
811
  const centerX = (bounds.minX + bounds.maxX) / 2;
812
812
  const centerY = (bounds.minY + bounds.maxY) / 2;
@@ -843,29 +843,29 @@ function useZoomViewport({
843
843
  selectedElements.forEach((element) => {
844
844
  minX = Math.min(minX, element.x);
845
845
  minY = Math.min(minY, element.y);
846
- maxX = Math.max(maxX, element.x + Math.max(element.width, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE));
847
- maxY = Math.max(maxY, element.y + Math.max(element.height, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE));
846
+ maxX = Math.max(maxX, element.x + Math.max(element.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE));
847
+ maxY = Math.max(maxY, element.y + Math.max(element.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE));
848
848
  });
849
849
  if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
850
850
  return;
851
851
  }
852
852
  const selectionBounds = { minX, minY, maxX, maxY };
853
- const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE);
854
- const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE);
853
+ const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
854
+ const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
855
855
  const availableWidth = Math.max(
856
- effectiveEditorDimensions.width - chunkB6UIVRFA_js.ZOOM_TO_SELECTION_PADDING,
857
- chunkB6UIVRFA_js.MIN_ELEMENT_SIZE
856
+ effectiveEditorDimensions.width - chunk44CQ67GQ_js.ZOOM_TO_SELECTION_PADDING,
857
+ chunk44CQ67GQ_js.MIN_ELEMENT_SIZE
858
858
  );
859
859
  const availableHeight = Math.max(
860
- effectiveEditorDimensions.height - chunkB6UIVRFA_js.ZOOM_TO_SELECTION_PADDING,
861
- chunkB6UIVRFA_js.MIN_ELEMENT_SIZE
860
+ effectiveEditorDimensions.height - chunk44CQ67GQ_js.ZOOM_TO_SELECTION_PADDING,
861
+ chunk44CQ67GQ_js.MIN_ELEMENT_SIZE
862
862
  );
863
863
  const targetEditorScale = Math.min(
864
864
  availableWidth / boundsWidth,
865
865
  availableHeight / boundsHeight
866
866
  );
867
867
  const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
868
- const nextScale = chunkFJDZ7AEE_js.clampZoomScale(targetEditorScale / safeFitScale);
868
+ const nextScale = chunkK6R2JNCK_js.clampZoomScale(targetEditorScale / safeFitScale);
869
869
  setScale(nextScale);
870
870
  window.requestAnimationFrame(() => {
871
871
  window.requestAnimationFrame(() => {
@@ -882,14 +882,14 @@ function useZoomViewport({
882
882
  ]);
883
883
  const handleWheel = react.useCallback(
884
884
  (event) => {
885
- const mapped = chunkFJDZ7AEE_js.mapEditingWheel(event, wheelBufferRef.current, true);
885
+ const mapped = chunkK6R2JNCK_js.mapEditingWheel(event, wheelBufferRef.current, true);
886
886
  if (mapped.intent !== "zoom") {
887
887
  return;
888
888
  }
889
889
  event.preventDefault();
890
890
  store.dispatch({
891
891
  type: "set-zoom",
892
- zoom: chunkFJDZ7AEE_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
892
+ zoom: chunkK6R2JNCK_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
893
893
  });
894
894
  },
895
895
  [store]
@@ -971,67 +971,6 @@ function stopAnimationSound() {
971
971
  }
972
972
 
973
973
  // src/viewer/hooks/presentation-mode/animation-helpers.ts
974
- function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationElementStates, presentationTimersRef) {
975
- for (const step of group.steps) {
976
- if (step.command) {
977
- const command = step.command;
978
- const timer = window.setTimeout(
979
- () => {
980
- chunkB6UIVRFA_js.executeMediaCommand(command);
981
- },
982
- Math.max(0, step.delayMs)
983
- );
984
- presentationTimersRef.current.push(timer);
985
- continue;
986
- }
987
- if (step.stopSound) {
988
- stopAnimationSound();
989
- } else if (step.soundPath && onPlayActionSound) {
990
- onPlayActionSound(step.soundPath);
991
- }
992
- }
993
- setPresentationElementStates((previousStates) => {
994
- const nextStates = new Map(previousStates);
995
- for (const step of group.steps) {
996
- if (step.command) {
997
- continue;
998
- }
999
- const currentState = nextStates.get(step.elementId) ?? {
1000
- visible: true};
1001
- const shouldBeVisible = step.presetClass === "exit" ? currentState.visible : true;
1002
- const colorTargets = step.colorTargets;
1003
- nextStates.set(step.elementId, {
1004
- visible: shouldBeVisible,
1005
- cssAnimation: step.cssAnimation,
1006
- animatesFill: colorTargets?.includes("fill") ? true : void 0,
1007
- animatesStroke: colorTargets?.includes("stroke") ? true : void 0
1008
- });
1009
- }
1010
- return nextStates;
1011
- });
1012
- for (const step of group.steps) {
1013
- if (step.command) {
1014
- continue;
1015
- }
1016
- const timer = window.setTimeout(
1017
- () => {
1018
- setPresentationElementStates((previousStates) => {
1019
- const nextStates = new Map(previousStates);
1020
- const currentState = nextStates.get(step.elementId) ?? {
1021
- visible: true};
1022
- const visibleAfterStep = step.presetClass === "exit" || step.hideAfterEffect ? false : currentState.visible;
1023
- nextStates.set(step.elementId, {
1024
- visible: visibleAfterStep,
1025
- cssAnimation: step.holdEndState ? step.cssAnimation : void 0
1026
- });
1027
- return nextStates;
1028
- });
1029
- },
1030
- Math.max(0, step.delayMs + step.durationMs + 8)
1031
- );
1032
- presentationTimersRef.current.push(timer);
1033
- }
1034
- }
1035
974
  function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
1036
975
  return group?.seqNextAction === "seek" && nowMs < endAtMs;
1037
976
  }
@@ -1104,49 +1043,8 @@ function finishAnimationGroupSteps(group, setPresentationElementStates, complete
1104
1043
  });
1105
1044
  }
1106
1045
 
1107
- // src/viewer/hooks/presentation-mode/build-playback.ts
1108
- function cancelBuildReveal(handle) {
1109
- if (handle.current !== null) {
1110
- cancelAnimationFrame(handle.current);
1111
- handle.current = null;
1112
- }
1113
- }
1114
- function driveBuildReveal(controller, buildIds, setStates, handle) {
1115
- cancelBuildReveal(handle);
1116
- if (buildIds.length === 0 || typeof requestAnimationFrame !== "function") {
1117
- return;
1118
- }
1119
- const start = performance.now();
1120
- const tick = () => {
1121
- const elapsedMs = performance.now() - start;
1122
- const states = controller.computeStatesFor(buildIds, { elapsedMs });
1123
- setStates((prev) => {
1124
- const next = new Map(prev);
1125
- for (const id of buildIds) {
1126
- const build = states.get(id)?.build;
1127
- if (!build) {
1128
- continue;
1129
- }
1130
- const existing = next.get(id) ?? { visible: true, cssAnimation: void 0 };
1131
- next.set(id, { ...existing, build });
1132
- }
1133
- return next;
1134
- });
1135
- let pending = false;
1136
- for (const id of buildIds) {
1137
- const build = states.get(id)?.build;
1138
- if (build && build.progress < 1) {
1139
- pending = true;
1140
- break;
1141
- }
1142
- }
1143
- handle.current = pending ? requestAnimationFrame(tick) : null;
1144
- };
1145
- tick();
1146
- }
1147
-
1148
1046
  // src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
1149
- function scheduleOpeningAutoPlayGroup(controller, deps) {
1047
+ function scheduleOpeningAutoPlayGroup(controller, ctx) {
1150
1048
  if (!controller.hasMoreSteps()) {
1151
1049
  return;
1152
1050
  }
@@ -1159,17 +1057,10 @@ function scheduleOpeningAutoPlayGroup(controller, deps) {
1159
1057
  if (!group) {
1160
1058
  return;
1161
1059
  }
1162
- applyAnimationGroupSteps(
1163
- group,
1164
- deps.onPlayActionSound,
1165
- deps.setPresentationElementStates,
1166
- deps.presentationTimersRef
1167
- );
1168
- deps.markAnimationGroupActive(group);
1169
- deps.startBuildReveal(controller, group);
1170
- deps.scheduleAutoAdvanceChain(controller);
1060
+ chunkK6R2JNCK_js.playGroup(controller, group, ctx);
1061
+ chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, ctx);
1171
1062
  }, firstGroup.autoAdvanceDelayMs ?? 0);
1172
- deps.presentationTimersRef.current.push(timer);
1063
+ ctx.timers.push(timer);
1173
1064
  }
1174
1065
  function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef) {
1175
1066
  const entranceAnimations = [...slide.animations || []].filter((animation) => Boolean(animation.entrance)).sort(
@@ -1186,7 +1077,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
1186
1077
  }))
1187
1078
  );
1188
1079
  entranceAnimations.forEach((animation, animationIndex) => {
1189
- const delay = chunkFJDZ7AEE_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1080
+ const delay = chunkK6R2JNCK_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
1190
1081
  const timer = window.setTimeout(() => {
1191
1082
  setPresentationAnimations(
1192
1083
  (previousAnimations) => previousAnimations.map(
@@ -1216,20 +1107,19 @@ function useAnimationPlayback(input) {
1216
1107
  const activeAnimationEndAtRef = react.useRef(0);
1217
1108
  const seededCompletedRef = react.useRef(false);
1218
1109
  const lastSeedCompletedRef = react.useRef(false);
1219
- const startBuildReveal = react.useCallback(
1220
- (controller, group) => {
1221
- driveBuildReveal(
1222
- controller,
1223
- chunkFJDZ7AEE_js.PresentationAnimationController.collectBuildStepIds(group),
1224
- setPresentationElementStates,
1225
- buildRafRef
1226
- );
1227
- },
1228
- []
1229
- );
1110
+ const buildPlaybackContext = react.useCallback(() => {
1111
+ return {
1112
+ setStates: setPresentationElementStates,
1113
+ timers: presentationTimersRef.current,
1114
+ buildHandle: buildRafRef,
1115
+ onPlayActionSound,
1116
+ playSound: playAnimationSound,
1117
+ stopSound: stopAnimationSound
1118
+ };
1119
+ }, [onPlayActionSound]);
1230
1120
  react.useEffect(() => {
1231
1121
  return () => {
1232
- cancelBuildReveal(buildRafRef);
1122
+ chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
1233
1123
  };
1234
1124
  }, []);
1235
1125
  const clearPresentationTimers = react.useCallback(() => {
@@ -1237,7 +1127,7 @@ function useAnimationPlayback(input) {
1237
1127
  window.clearTimeout(timer);
1238
1128
  });
1239
1129
  presentationTimersRef.current = [];
1240
- cancelBuildReveal(buildRafRef);
1130
+ chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
1241
1131
  activeAnimationGroupRef.current = null;
1242
1132
  activeAnimationEndAtRef.current = 0;
1243
1133
  }, []);
@@ -1245,48 +1135,9 @@ function useAnimationPlayback(input) {
1245
1135
  activeAnimationGroupRef.current = group;
1246
1136
  activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
1247
1137
  }, []);
1248
- const scheduleAutoAdvanceChain = react.useCallback(
1249
- (controller) => {
1250
- if (!controller.shouldAutoAdvance()) {
1251
- return;
1252
- }
1253
- const delay = controller.getAutoAdvanceDelay();
1254
- const previousGroup = controller.peekNext();
1255
- if (!previousGroup) {
1256
- return;
1257
- }
1258
- const totalDelay = delay + (previousGroup.autoAdvanceDelayMs ?? 0);
1259
- const timer = window.setTimeout(
1260
- () => {
1261
- const group = controller.advance();
1262
- if (!group) {
1263
- return;
1264
- }
1265
- applyAnimationGroupSteps(
1266
- group,
1267
- onPlayActionSound,
1268
- setPresentationElementStates,
1269
- presentationTimersRef
1270
- );
1271
- markAnimationGroupActive(group);
1272
- startBuildReveal(controller, group);
1273
- scheduleAutoAdvanceChain(controller);
1274
- },
1275
- Math.max(0, totalDelay)
1276
- );
1277
- presentationTimersRef.current.push(timer);
1278
- },
1279
- // `scheduleAutoAdvanceChain` recursively calls itself (line 190) to walk the
1280
- // auto-advance chain; it can't list itself as its own dependency (the const
1281
- // isn't assigned yet when the array is evaluated). The recursive call still
1282
- // resolves correctly because the setTimeout callback only reads the binding
1283
- // once the outer const has been assigned.
1284
- // oxlint-disable-next-line react/memo-dependencies -- see comment above
1285
- [markAnimationGroupActive, onPlayActionSound, startBuildReveal]
1286
- );
1287
1138
  const resetSlideTimeline = react.useCallback(
1288
1139
  (slideIndex) => {
1289
- cancelBuildReveal(buildRafRef);
1140
+ chunkK6R2JNCK_js.cancelBuildReveal(buildRafRef);
1290
1141
  const slide = slides[slideIndex];
1291
1142
  if (!slide) {
1292
1143
  controllerRef.current = null;
@@ -1296,7 +1147,7 @@ function useAnimationPlayback(input) {
1296
1147
  setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
1297
1148
  return;
1298
1149
  }
1299
- const controller = chunkFJDZ7AEE_js.PresentationAnimationController.fromSlide(slide);
1150
+ const controller = chunkK6R2JNCK_js.PresentationAnimationController.fromSlide(slide);
1300
1151
  controllerRef.current = controller;
1301
1152
  setPresentationKeyframesCss(controller.keyframesCss);
1302
1153
  setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
@@ -1313,11 +1164,11 @@ function useAnimationPlayback(input) {
1313
1164
  const activeGroup = activeAnimationGroupRef.current;
1314
1165
  if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
1315
1166
  finishDomAnimationsForGroup(activeGroup);
1316
- const buildIds = chunkFJDZ7AEE_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
1167
+ const buildIds = chunkK6R2JNCK_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
1317
1168
  const completedStates = controller.computeStatesFor(buildIds);
1318
1169
  clearPresentationTimers();
1319
1170
  finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
1320
- scheduleAutoAdvanceChain(controller);
1171
+ chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
1321
1172
  return true;
1322
1173
  }
1323
1174
  if (!controller || !controller.hasMoreSteps()) {
@@ -1327,24 +1178,12 @@ function useAnimationPlayback(input) {
1327
1178
  if (!group) {
1328
1179
  return false;
1329
1180
  }
1330
- applyAnimationGroupSteps(
1331
- group,
1332
- onPlayActionSound,
1333
- setPresentationElementStates,
1334
- presentationTimersRef
1335
- );
1181
+ const ctx = buildPlaybackContext();
1182
+ chunkK6R2JNCK_js.playGroup(controller, group, ctx);
1336
1183
  markAnimationGroupActive(group);
1337
- startBuildReveal(controller, group);
1338
- scheduleAutoAdvanceChain(controller);
1184
+ chunkK6R2JNCK_js.scheduleAutoAdvanceChain(controller, ctx);
1339
1185
  return true;
1340
- }, [
1341
- animationsEnabled,
1342
- clearPresentationTimers,
1343
- markAnimationGroupActive,
1344
- onPlayActionSound,
1345
- scheduleAutoAdvanceChain,
1346
- startBuildReveal
1347
- ]);
1186
+ }, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
1348
1187
  const handleInteractiveShapeClick = react.useCallback(
1349
1188
  (shapeId) => {
1350
1189
  const controller = controllerRef.current;
@@ -1355,16 +1194,10 @@ function useAnimationPlayback(input) {
1355
1194
  if (!group) {
1356
1195
  return false;
1357
1196
  }
1358
- applyAnimationGroupSteps(
1359
- group,
1360
- onPlayActionSound,
1361
- setPresentationElementStates,
1362
- presentationTimersRef
1363
- );
1364
- startBuildReveal(controller, group);
1197
+ chunkK6R2JNCK_js.playGroup(controller, group, buildPlaybackContext());
1365
1198
  return true;
1366
1199
  },
1367
- [onPlayActionSound, startBuildReveal]
1200
+ [buildPlaybackContext]
1368
1201
  );
1369
1202
  const handleHoverStart = react.useCallback(
1370
1203
  (shapeId) => {
@@ -1380,16 +1213,10 @@ function useAnimationPlayback(input) {
1380
1213
  if (!group) {
1381
1214
  return false;
1382
1215
  }
1383
- applyAnimationGroupSteps(
1384
- group,
1385
- onPlayActionSound,
1386
- setPresentationElementStates,
1387
- presentationTimersRef
1388
- );
1389
- startBuildReveal(controller, group);
1216
+ chunkK6R2JNCK_js.playGroup(controller, group, buildPlaybackContext());
1390
1217
  return true;
1391
1218
  },
1392
- [animationsEnabled, onPlayActionSound, startBuildReveal]
1219
+ [animationsEnabled, buildPlaybackContext]
1393
1220
  );
1394
1221
  const handleHoverEnd = react.useCallback((shapeId) => {
1395
1222
  const controller = controllerRef.current;
@@ -1435,25 +1262,12 @@ function useAnimationPlayback(input) {
1435
1262
  }
1436
1263
  const controller = controllerRef.current;
1437
1264
  if (controller) {
1438
- scheduleOpeningAutoPlayGroup(controller, {
1439
- onPlayActionSound,
1440
- setPresentationElementStates,
1441
- presentationTimersRef,
1442
- startBuildReveal,
1443
- scheduleAutoAdvanceChain,
1444
- markAnimationGroupActive
1445
- });
1265
+ const ctx = buildPlaybackContext();
1266
+ scheduleOpeningAutoPlayGroup(controller, ctx);
1446
1267
  }
1447
1268
  scheduleEntranceAnimationTimers(slide, setPresentationAnimations, presentationTimersRef);
1448
1269
  },
1449
- [
1450
- animationsEnabled,
1451
- slides,
1452
- onPlayActionSound,
1453
- markAnimationGroupActive,
1454
- scheduleAutoAdvanceChain,
1455
- startBuildReveal
1456
- ]
1270
+ [animationsEnabled, slides, buildPlaybackContext]
1457
1271
  );
1458
1272
  const runPresentationEntranceAnimations = react.useCallback(
1459
1273
  (slideIndex, options) => {
@@ -1480,12 +1294,12 @@ function useAnimationPlayback(input) {
1480
1294
  presentationTimersRef
1481
1295
  };
1482
1296
  }
1483
- var PRESENTER_CHANNEL_NAME = chunkFJDZ7AEE_js.PRESENTATION_CHANNEL_NAME;
1484
- var AUDIENCE_HASH = chunkFJDZ7AEE_js.PRESENTATION_HASH;
1485
- var PRESENTER_MSG_ORIGIN = chunkFJDZ7AEE_js.PRESENTATION_MESSAGE_ORIGIN;
1486
- var AUDIENCE_NONCE_KEY = chunkFJDZ7AEE_js.PRESENTATION_NONCE_KEY;
1297
+ var PRESENTER_CHANNEL_NAME = chunkK6R2JNCK_js.PRESENTATION_CHANNEL_NAME;
1298
+ var AUDIENCE_HASH = chunkK6R2JNCK_js.PRESENTATION_HASH;
1299
+ var PRESENTER_MSG_ORIGIN = chunkK6R2JNCK_js.PRESENTATION_MESSAGE_ORIGIN;
1300
+ var AUDIENCE_NONCE_KEY = chunkK6R2JNCK_js.PRESENTATION_NONCE_KEY;
1487
1301
  function generateSessionId() {
1488
- return chunkFJDZ7AEE_js.createPresentationSessionId();
1302
+ return chunkK6R2JNCK_js.createPresentationSessionId();
1489
1303
  }
1490
1304
  function parseAudienceNonce() {
1491
1305
  const hash = window.location.hash;
@@ -1521,7 +1335,7 @@ function usePresenterWindow(input) {
1521
1335
  }, []);
1522
1336
  const swapDisplays = react.useCallback(async () => {
1523
1337
  const audience = audienceWindowRef.current;
1524
- return audience && !audience.closed ? chunkFJDZ7AEE_js.swapPresentationWindows(window, audience) : false;
1338
+ return audience && !audience.closed ? chunkK6R2JNCK_js.swapPresentationWindows(window, audience) : false;
1525
1339
  }, []);
1526
1340
  const syncSlideToAudience = react.useCallback(
1527
1341
  (slideIndex) => {
@@ -1585,7 +1399,7 @@ function usePresenterWindow(input) {
1585
1399
  pollTimerRef.current = null;
1586
1400
  }
1587
1401
  if (closingSessionId) {
1588
- void chunkFJDZ7AEE_js.clearAudienceContent(closingSessionId);
1402
+ void chunkK6R2JNCK_js.clearAudienceContent(closingSessionId);
1589
1403
  }
1590
1404
  }, [getChannel]);
1591
1405
  const openAudienceWindow = react.useCallback(() => {
@@ -1603,10 +1417,10 @@ function usePresenterWindow(input) {
1603
1417
  audienceWindowRef.current = blankWin;
1604
1418
  const sessionId = generateSessionId();
1605
1419
  sessionIdRef.current = sessionId;
1606
- const audienceUrl = chunkFJDZ7AEE_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1607
- void chunkFJDZ7AEE_js.resolveAudienceScreenPlacement(window).then((placement) => {
1420
+ const audienceUrl = chunkK6R2JNCK_js.buildPresentationAudienceUrl(window.location.href, sessionId);
1421
+ void chunkK6R2JNCK_js.resolveAudienceScreenPlacement(window).then((placement) => {
1608
1422
  if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
1609
- chunkFJDZ7AEE_js.placeAudienceWindow(blankWin, placement);
1423
+ chunkK6R2JNCK_js.placeAudienceWindow(blankWin, placement);
1610
1424
  }
1611
1425
  return void 0;
1612
1426
  });
@@ -1636,7 +1450,7 @@ function usePresenterWindow(input) {
1636
1450
  }
1637
1451
  };
1638
1452
  if (content) {
1639
- void chunkFJDZ7AEE_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1453
+ void chunkK6R2JNCK_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
1640
1454
  } else {
1641
1455
  navigateOrClose(true);
1642
1456
  }
@@ -1662,7 +1476,7 @@ function usePresenterWindow(input) {
1662
1476
  }
1663
1477
  const handleMessage = (event) => {
1664
1478
  const message = event.data;
1665
- if (chunkFJDZ7AEE_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1479
+ if (chunkK6R2JNCK_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
1666
1480
  syncStateToAudience(snapshotRef.current);
1667
1481
  }
1668
1482
  };
@@ -1691,7 +1505,7 @@ function usePresenterWindow(input) {
1691
1505
  react.useEffect(() => {
1692
1506
  const handleBeforeUnload = () => {
1693
1507
  if (sessionIdRef.current) {
1694
- void chunkFJDZ7AEE_js.clearAudienceContent(sessionIdRef.current);
1508
+ void chunkK6R2JNCK_js.clearAudienceContent(sessionIdRef.current);
1695
1509
  }
1696
1510
  };
1697
1511
  window.addEventListener("beforeunload", handleBeforeUnload);
@@ -1753,7 +1567,7 @@ function useAudienceMode(input) {
1753
1567
  }
1754
1568
  channel.onmessage = (event) => {
1755
1569
  const data = event.data;
1756
- if (!chunkFJDZ7AEE_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1570
+ if (!chunkK6R2JNCK_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
1757
1571
  return;
1758
1572
  }
1759
1573
  if (expectedSessionId && data.sessionId !== expectedSessionId) {
@@ -1769,16 +1583,16 @@ function useAudienceMode(input) {
1769
1583
  }
1770
1584
  if (data.type === "presenter-exit") {
1771
1585
  if (expectedSessionId) {
1772
- void chunkFJDZ7AEE_js.clearAudienceContent(expectedSessionId);
1586
+ void chunkK6R2JNCK_js.clearAudienceContent(expectedSessionId);
1773
1587
  }
1774
- if (chunkFJDZ7AEE_js.endAudienceDisplay(window)) {
1588
+ if (chunkK6R2JNCK_js.endAudienceDisplay(window)) {
1775
1589
  handlers.onPresenterEnded?.();
1776
1590
  }
1777
1591
  }
1778
1592
  };
1779
1593
  if (expectedSessionId) {
1780
1594
  channel.postMessage({
1781
- origin: chunkFJDZ7AEE_js.PRESENTATION_MESSAGE_ORIGIN,
1595
+ origin: chunkK6R2JNCK_js.PRESENTATION_MESSAGE_ORIGIN,
1782
1596
  type: "audience-ready",
1783
1597
  sessionId: expectedSessionId
1784
1598
  });
@@ -1792,7 +1606,7 @@ function useAudienceMode(input) {
1792
1606
  }, []);
1793
1607
  }
1794
1608
  function usePresentationKeyboard(input) {
1795
- const wheelBufferRef = react.useRef(chunkFJDZ7AEE_js.createWheelStepBuffer());
1609
+ const wheelBufferRef = react.useRef(chunkK6R2JNCK_js.createWheelStepBuffer());
1796
1610
  const {
1797
1611
  mode,
1798
1612
  movePresentationSlide,
@@ -1813,14 +1627,14 @@ function usePresentationKeyboard(input) {
1813
1627
  presentationSlideIndex,
1814
1628
  setShowRehearsalSummary
1815
1629
  } = input;
1816
- const keyBufferRef = react.useRef(chunkFJDZ7AEE_js.createPresentationKeyBuffer());
1630
+ const keyBufferRef = react.useRef(chunkK6R2JNCK_js.createPresentationKeyBuffer());
1817
1631
  react.useEffect(() => {
1818
- if (mode !== "present" || !chunkFJDZ7AEE_js.acceptsPresentationInput()) {
1819
- keyBufferRef.current = chunkFJDZ7AEE_js.createPresentationKeyBuffer();
1632
+ if (mode !== "present" || !chunkK6R2JNCK_js.acceptsPresentationInput()) {
1633
+ keyBufferRef.current = chunkK6R2JNCK_js.createPresentationKeyBuffer();
1820
1634
  return;
1821
1635
  }
1822
1636
  const handleKeyDown = (event) => {
1823
- const mapped = chunkFJDZ7AEE_js.mapPresentationKey(event, keyBufferRef.current);
1637
+ const mapped = chunkK6R2JNCK_js.mapPresentationKey(event, keyBufferRef.current);
1824
1638
  if (mapped.action === "none") {
1825
1639
  return;
1826
1640
  }
@@ -1840,12 +1654,12 @@ function usePresentationKeyboard(input) {
1840
1654
  movePresentationSlide(-1);
1841
1655
  return;
1842
1656
  case "first": {
1843
- const first = chunkFJDZ7AEE_js.firstShowSlideIndex(showSlideIndexes);
1657
+ const first = chunkK6R2JNCK_js.firstShowSlideIndex(showSlideIndexes);
1844
1658
  navigateToSlide(first ?? 0);
1845
1659
  return;
1846
1660
  }
1847
1661
  case "last": {
1848
- const last = chunkFJDZ7AEE_js.lastShowSlideIndex(showSlideIndexes);
1662
+ const last = chunkK6R2JNCK_js.lastShowSlideIndex(showSlideIndexes);
1849
1663
  navigateToSlide(last ?? Math.max(0, slideCount - 1));
1850
1664
  return;
1851
1665
  }
@@ -1883,10 +1697,10 @@ function usePresentationKeyboard(input) {
1883
1697
  }
1884
1698
  };
1885
1699
  const handleWheel = (event) => {
1886
- if (mode !== "present" || !chunkFJDZ7AEE_js.acceptsPresentationInput()) {
1700
+ if (mode !== "present" || !chunkK6R2JNCK_js.acceptsPresentationInput()) {
1887
1701
  return;
1888
1702
  }
1889
- const mapped = chunkFJDZ7AEE_js.mapPresentationWheel(event, wheelBufferRef.current);
1703
+ const mapped = chunkK6R2JNCK_js.mapPresentationWheel(event, wheelBufferRef.current);
1890
1704
  if (mapped.intent === "next-slide") {
1891
1705
  event.preventDefault();
1892
1706
  movePresentationSlide(1);
@@ -2019,7 +1833,7 @@ function useRehearsalTimings(input) {
2019
1833
 
2020
1834
  // src/viewer/hooks/presentation-mode/presentation-actions.ts
2021
1835
  function handlePresentationActionImpl(action, deps) {
2022
- chunkFJDZ7AEE_js.runPresentationAction(
1836
+ chunkK6R2JNCK_js.runPresentationAction(
2023
1837
  action,
2024
1838
  { slideCount: deps.slidesLength },
2025
1839
  {
@@ -2041,7 +1855,7 @@ function handlePresentationActionImpl(action, deps) {
2041
1855
  function executeSlideTransition(nextSlideIndex, deps) {
2042
1856
  const incomingSlide = deps.slides[nextSlideIndex];
2043
1857
  const transition = incomingSlide?.transition;
2044
- const durationMs = deps.playTransition ? chunkFJDZ7AEE_js.resolveTransitionDurationMs(transition) : 0;
1858
+ const durationMs = deps.playTransition ? chunkK6R2JNCK_js.resolveTransitionDurationMs(transition) : 0;
2045
1859
  deps.clearPresentationTimers();
2046
1860
  deps.setPresentationSlideIndex(nextSlideIndex);
2047
1861
  deps.onSetActiveSlideIndex(nextSlideIndex);
@@ -2100,7 +1914,7 @@ function useSlideNavigation(input) {
2100
1914
  });
2101
1915
  const scheduleAutoAdvanceForSlide = react.useCallback(
2102
1916
  (slideIndex) => {
2103
- const delayMs = chunkFJDZ7AEE_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
1917
+ const delayMs = chunkK6R2JNCK_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
2104
1918
  if (delayMs === void 0) {
2105
1919
  return;
2106
1920
  }
@@ -2123,7 +1937,7 @@ function useSlideNavigation(input) {
2123
1937
  if (availableSlideIndexes.length === 0) {
2124
1938
  return;
2125
1939
  }
2126
- const pastLastSlide = direction === 1 && !chunkFJDZ7AEE_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
1940
+ const pastLastSlide = direction === 1 && !chunkK6R2JNCK_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
2127
1941
  if (rehearsing && pastLastSlide) {
2128
1942
  recordCurrentSlideTime(presentationSlideIndex);
2129
1943
  try {
@@ -2141,9 +1955,9 @@ function useSlideNavigation(input) {
2141
1955
  onAdvancePastLastSlide();
2142
1956
  return;
2143
1957
  }
2144
- const nextSlideIndex = direction === 1 ? chunkFJDZ7AEE_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
1958
+ const nextSlideIndex = direction === 1 ? chunkK6R2JNCK_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
2145
1959
  loop: Boolean(loopContinuously) && !rehearsing
2146
- }) : chunkFJDZ7AEE_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
1960
+ }) : chunkK6R2JNCK_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
2147
1961
  if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
2148
1962
  return;
2149
1963
  }
@@ -2288,22 +2102,22 @@ function useZoomNavigation(input) {
2288
2102
  };
2289
2103
  }
2290
2104
  function usePresenterConsole(slideIndex, active) {
2291
- const timerRef = react.useRef(chunkFJDZ7AEE_js.createPresenterTimer());
2292
- const [snapshot, setSnapshot] = react.useState(() => chunkFJDZ7AEE_js.createInitialPresentationSnapshot(slideIndex));
2105
+ const timerRef = react.useRef(chunkK6R2JNCK_js.createPresenterTimer());
2106
+ const [snapshot, setSnapshot] = react.useState(() => chunkK6R2JNCK_js.createInitialPresentationSnapshot(slideIndex));
2293
2107
  const patch = react.useCallback((value) => {
2294
- setSnapshot((current) => chunkFJDZ7AEE_js.mergePresentationSnapshot(current, value));
2108
+ setSnapshot((current) => chunkK6R2JNCK_js.mergePresentationSnapshot(current, value));
2295
2109
  }, []);
2296
2110
  react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
2297
2111
  react.useEffect(() => {
2298
2112
  if (!active) {
2299
2113
  return;
2300
2114
  }
2301
- timerRef.current = chunkFJDZ7AEE_js.resetPresenterTimer();
2115
+ timerRef.current = chunkK6R2JNCK_js.resetPresenterTimer();
2302
2116
  patch({ paused: false, elapsedMs: 0 });
2303
2117
  const timer = window.setInterval(() => {
2304
2118
  patch({
2305
2119
  paused: timerRef.current.paused,
2306
- elapsedMs: chunkFJDZ7AEE_js.presenterElapsed(timerRef.current)
2120
+ elapsedMs: chunkK6R2JNCK_js.presenterElapsed(timerRef.current)
2307
2121
  });
2308
2122
  }, 1e3);
2309
2123
  return () => window.clearInterval(timer);
@@ -2313,19 +2127,19 @@ function usePresenterConsole(slideIndex, active) {
2313
2127
  applyAudienceSnapshot: setSnapshot,
2314
2128
  setBlackout: (blackout) => patch({ blackout }),
2315
2129
  toggleTimer: () => {
2316
- timerRef.current = chunkFJDZ7AEE_js.togglePresenterTimer(timerRef.current);
2130
+ timerRef.current = chunkK6R2JNCK_js.togglePresenterTimer(timerRef.current);
2317
2131
  patch({
2318
2132
  paused: timerRef.current.paused,
2319
- elapsedMs: chunkFJDZ7AEE_js.presenterElapsed(timerRef.current)
2133
+ elapsedMs: chunkK6R2JNCK_js.presenterElapsed(timerRef.current)
2320
2134
  });
2321
2135
  },
2322
2136
  resetTimer: () => {
2323
- timerRef.current = chunkFJDZ7AEE_js.resetPresenterTimer();
2137
+ timerRef.current = chunkK6R2JNCK_js.resetPresenterTimer();
2324
2138
  patch({ paused: false, elapsedMs: 0 });
2325
2139
  },
2326
2140
  stepZoom: (direction) => setSnapshot(
2327
- (current) => chunkFJDZ7AEE_js.mergePresentationSnapshot(current, {
2328
- zoom: chunkFJDZ7AEE_js.stepPresenterZoom(
2141
+ (current) => chunkK6R2JNCK_js.mergePresentationSnapshot(current, {
2142
+ zoom: chunkK6R2JNCK_js.stepPresenterZoom(
2329
2143
  current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
2330
2144
  direction
2331
2145
  )
@@ -2371,7 +2185,7 @@ function usePresentationMode(input) {
2371
2185
  const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
2372
2186
  const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
2373
2187
  const [presentationStartTime, setPresentationStartTime] = react.useState(null);
2374
- const showGuard = react.useMemo(() => chunkFJDZ7AEE_js.createPresenterShowGuard(), []);
2188
+ const showGuard = react.useMemo(() => chunkK6R2JNCK_js.createPresenterShowGuard(), []);
2375
2189
  const {
2376
2190
  presentationAnimations,
2377
2191
  presentationElementStates,
@@ -2450,7 +2264,7 @@ function usePresentationMode(input) {
2450
2264
  });
2451
2265
  const movePresentationSlide = react.useCallback(
2452
2266
  (direction, trigger = "explicit") => {
2453
- if (!chunkFJDZ7AEE_js.acceptsPresentationInput()) {
2267
+ if (!chunkK6R2JNCK_js.acceptsPresentationInput()) {
2454
2268
  return;
2455
2269
  }
2456
2270
  if (endOfShowVisible) {
@@ -2588,7 +2402,7 @@ function usePresentationMode(input) {
2588
2402
  if (mode !== "present") {
2589
2403
  return;
2590
2404
  }
2591
- return chunkFJDZ7AEE_js.attachPresentationVisibilityPause({
2405
+ return chunkK6R2JNCK_js.attachPresentationVisibilityPause({
2592
2406
  root: containerRef.current ?? void 0,
2593
2407
  onHidden: () => clearPresentationTimersRef.current(),
2594
2408
  onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
@@ -2668,11 +2482,11 @@ function usePresentationMode(input) {
2668
2482
  if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
2669
2483
  return void 0;
2670
2484
  }
2671
- return chunkFJDZ7AEE_js.buildMorphTransitionPlan(
2485
+ return chunkK6R2JNCK_js.buildMorphTransitionPlan(
2672
2486
  slides[transitionOverlay.outgoingSlideIndex],
2673
2487
  slides[transitionOverlay.incomingSlideIndex],
2674
2488
  transitionOverlay.durationMs,
2675
- chunkFJDZ7AEE_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2489
+ chunkK6R2JNCK_js.morphOptionToMode(transitionOverlay.transition.morphOption)
2676
2490
  );
2677
2491
  }, [transitionOverlay, slides]);
2678
2492
  const morphedElementStates = react.useMemo(() => {
@@ -2693,7 +2507,7 @@ function usePresentationMode(input) {
2693
2507
  if (!morphPlan) {
2694
2508
  return presentationKeyframesCss;
2695
2509
  }
2696
- const imageRules = chunkFJDZ7AEE_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2510
+ const imageRules = chunkK6R2JNCK_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2697
2511
  return `${presentationKeyframesCss ?? ""}
2698
2512
  ${morphPlan.keyframesCss}
2699
2513
  ${imageRules}`;
@@ -2989,7 +2803,7 @@ function useFindReplace({
2989
2803
  const [findResults, setFindResults] = react.useState([]);
2990
2804
  const [findResultIndex, setFindResultIndex] = react.useState(-1);
2991
2805
  const performFind = react.useCallback(() => {
2992
- const results = chunkFJDZ7AEE_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2806
+ const results = chunkK6R2JNCK_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
2993
2807
  if (!findQuery) {
2994
2808
  setFindResults([]);
2995
2809
  setFindResultIndex(-1);
@@ -3023,7 +2837,7 @@ function useFindReplace({
3023
2837
  return;
3024
2838
  }
3025
2839
  onUpdateSlides(
3026
- (prevSlides) => chunkFJDZ7AEE_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
2840
+ (prevSlides) => chunkK6R2JNCK_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
3027
2841
  );
3028
2842
  onMarkDirty();
3029
2843
  },
@@ -3045,9 +2859,9 @@ function useFindReplace({
3045
2859
  }, [findResults, applyReplacements, performFind]);
3046
2860
  react.useEffect(() => {
3047
2861
  const handler = (event) => {
3048
- const { action } = chunkFJDZ7AEE_js.mapEditorKey(event, {
2862
+ const { action } = chunkK6R2JNCK_js.mapEditorKey(event, {
3049
2863
  canEdit: mode === "edit",
3050
- isTextInputTarget: chunkFJDZ7AEE_js.isEditorTextInputTarget(event.target)
2864
+ isTextInputTarget: chunkK6R2JNCK_js.isEditorTextInputTarget(event.target)
3051
2865
  });
3052
2866
  if (action !== "find") {
3053
2867
  return;
@@ -3126,7 +2940,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
3126
2940
  if (!slide) {
3127
2941
  return { slides, didAdd: false };
3128
2942
  }
3129
- const next = chunkFJDZ7AEE_js.addCommentToList(
2943
+ const next = chunkK6R2JNCK_js.addCommentToList(
3130
2944
  slide.comments || [],
3131
2945
  text,
3132
2946
  authorName,
@@ -3144,7 +2958,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
3144
2958
  if (!slide) {
3145
2959
  return { slides, didDelete: false };
3146
2960
  }
3147
- const next = chunkFJDZ7AEE_js.removeCommentFromList(slide.comments || [], commentId);
2961
+ const next = chunkK6R2JNCK_js.removeCommentFromList(slide.comments || [], commentId);
3148
2962
  if (!next) {
3149
2963
  return { slides, didDelete: false };
3150
2964
  }
@@ -3155,7 +2969,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
3155
2969
  if (!slide) {
3156
2970
  return { slides, didUpdate: false };
3157
2971
  }
3158
- const next = chunkFJDZ7AEE_js.editCommentInList(slide.comments || [], commentId, newText);
2972
+ const next = chunkK6R2JNCK_js.editCommentInList(slide.comments || [], commentId, newText);
3159
2973
  if (!next) {
3160
2974
  return { slides, didUpdate: false };
3161
2975
  }
@@ -3166,7 +2980,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
3166
2980
  if (!slide) {
3167
2981
  return { slides, didUpdate: false };
3168
2982
  }
3169
- const next = chunkFJDZ7AEE_js.toggleCommentResolvedInList(slide.comments || [], commentId);
2983
+ const next = chunkK6R2JNCK_js.toggleCommentResolvedInList(slide.comments || [], commentId);
3170
2984
  if (!next) {
3171
2985
  return { slides, didUpdate: false };
3172
2986
  }
@@ -3177,7 +2991,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
3177
2991
  if (!slide) {
3178
2992
  return { slides, didAdd: false };
3179
2993
  }
3180
- const next = chunkFJDZ7AEE_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
2994
+ const next = chunkK6R2JNCK_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
3181
2995
  if (!next) {
3182
2996
  return { slides, didAdd: false };
3183
2997
  }
@@ -3551,7 +3365,7 @@ function useViewerCoreState(_input) {
3551
3365
  const marqueeStateRef = react.useRef(null);
3552
3366
  const isDrawingRef = react.useRef(false);
3553
3367
  const justInteractedRef = react.useRef(false);
3554
- const livePatcher = react.useMemo(() => chunkFJDZ7AEE_js.createCollaborationLivePatcher(), []);
3368
+ const livePatcher = react.useMemo(() => chunkK6R2JNCK_js.createCollaborationLivePatcher(), []);
3555
3369
  react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
3556
3370
  const slidesRef = react.useRef([]);
3557
3371
  const [mode, setMode] = react.useState("edit");
@@ -3560,8 +3374,8 @@ function useViewerCoreState(_input) {
3560
3374
  const [slides, setSlides] = react.useState([]);
3561
3375
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
3562
3376
  const [canvasSize, setCanvasSize] = react.useState({
3563
- width: chunkB6UIVRFA_js.DEFAULT_CANVAS_WIDTH,
3564
- height: chunkB6UIVRFA_js.DEFAULT_CANVAS_HEIGHT
3377
+ width: chunk44CQ67GQ_js.DEFAULT_CANVAS_WIDTH,
3378
+ height: chunk44CQ67GQ_js.DEFAULT_CANVAS_HEIGHT
3565
3379
  });
3566
3380
  const [slideSizeEmu, setSlideSizeEmu] = react.useState();
3567
3381
  const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
@@ -3582,7 +3396,7 @@ function useViewerCoreState(_input) {
3582
3396
  const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
3583
3397
  inlineEditingTextRef.current = resolved;
3584
3398
  setInlineEditingTextBase(value);
3585
- chunkFJDZ7AEE_js.publishLiveInlineText(
3399
+ chunkK6R2JNCK_js.publishLiveInlineText(
3586
3400
  livePatcher,
3587
3401
  slidesRef.current[activeSlideIndexRef.current],
3588
3402
  inlineEditingElementIdRef.current,
@@ -3926,7 +3740,7 @@ function useLoadContent({
3926
3740
  );
3927
3741
  }
3928
3742
  const previousHandler = handlerRef.current;
3929
- const handler = new chunkFJDZ7AEE_js.PptxHandler();
3743
+ const handler = new chunkK6R2JNCK_js.PptxHandler();
3930
3744
  const parsed = await handler.load(buffer, { allowExternalImages });
3931
3745
  if (cancelled || token !== renderTokenRef.current) {
3932
3746
  handler.dispose();
@@ -3938,7 +3752,7 @@ function useLoadContent({
3938
3752
  handlerRef.current = null;
3939
3753
  const mediaElements = [];
3940
3754
  for (const slide of parsed.slides) {
3941
- chunkFJDZ7AEE_js.collectMediaElements(slide.elements, mediaElements);
3755
+ chunkK6R2JNCK_js.collectMediaElements(slide.elements, mediaElements);
3942
3756
  }
3943
3757
  for (const url of mediaDataUrls.values()) {
3944
3758
  if (url.startsWith("blob:")) {
@@ -3979,7 +3793,7 @@ function useLoadContent({
3979
3793
  }
3980
3794
  })
3981
3795
  );
3982
- const { paths: imagePaths, refs: imageRefs } = chunkFJDZ7AEE_js.collectImagePaths(parsed.slides);
3796
+ const { paths: imagePaths, refs: imageRefs } = chunkK6R2JNCK_js.collectImagePaths(parsed.slides);
3983
3797
  let nextSlides = parsed.slides;
3984
3798
  if (imagePaths.size > 0) {
3985
3799
  const resolvedMap = /* @__PURE__ */ new Map();
@@ -3994,100 +3808,26 @@ function useLoadContent({
3994
3808
  }
3995
3809
  })
3996
3810
  );
3997
- const elementPatches = /* @__PURE__ */ new Map();
3998
- for (const ref of imageRefs) {
3999
- const url = resolvedMap.get(ref.path);
4000
- if (!url) {
4001
- continue;
4002
- }
4003
- const id = ref.element.id;
4004
- const existing = elementPatches.get(id) ?? {};
4005
- existing[ref.field] = url;
4006
- elementPatches.set(id, existing);
4007
- }
4008
- if (elementPatches.size > 0) {
4009
- const patchElements = (elements) => {
4010
- let mutated = false;
4011
- const next = elements.map((el) => {
4012
- let updated = el;
4013
- const patch = elementPatches.get(el.id);
4014
- if (patch) {
4015
- updated = { ...el, ...patch };
4016
- }
4017
- if (updated.type === "group" && updated.children?.length) {
4018
- const newChildren = patchElements(updated.children);
4019
- if (newChildren !== updated.children) {
4020
- updated = { ...updated, children: newChildren };
4021
- }
4022
- }
4023
- if (updated !== el) {
4024
- mutated = true;
4025
- }
4026
- return updated;
4027
- });
4028
- return mutated ? next : elements;
4029
- };
4030
- nextSlides = parsed.slides.map((s) => {
4031
- const newElements = patchElements(s.elements);
4032
- return newElements === s.elements ? s : { ...s, elements: newElements };
4033
- });
4034
- }
4035
- }
4036
- const { paths: tableImagePaths, refs: tableImageRefs } = chunkFJDZ7AEE_js.collectTableCellImagePaths(nextSlides);
4037
- if (tableImagePaths.size > 0) {
4038
- const resolvedTableMap = /* @__PURE__ */ new Map();
4039
- await Promise.all(
4040
- Array.from(tableImagePaths).map(async (path) => {
4041
- try {
4042
- const url = await handler.getImageData(path);
4043
- if (url) {
4044
- resolvedTableMap.set(path, url);
4045
- }
4046
- } catch {
4047
- }
4048
- })
4049
- );
4050
- if (resolvedTableMap.size > 0) {
4051
- nextSlides = nextSlides.map((s) => {
4052
- const newElements = chunkFJDZ7AEE_js.applyTableCellImagePatches(
4053
- s.elements,
4054
- resolvedTableMap,
4055
- tableImageRefs
4056
- );
4057
- return newElements === s.elements ? s : { ...s, elements: newElements };
4058
- });
4059
- }
4060
- }
4061
- let nextTableStyleMap = parsed.tableStyleMap;
4062
- const { paths: tableStyleImagePaths, refs: tableStyleImageRefs } = chunkFJDZ7AEE_js.collectTableStyleImagePaths(nextTableStyleMap);
4063
- if (tableStyleImagePaths.size > 0) {
4064
- const resolvedStyleMap = /* @__PURE__ */ new Map();
4065
- await Promise.all(
4066
- Array.from(tableStyleImagePaths).map(async (path) => {
4067
- try {
4068
- const url = await handler.getImageData(path);
4069
- if (url) {
4070
- resolvedStyleMap.set(path, url);
4071
- }
4072
- } catch {
4073
- }
4074
- })
4075
- );
4076
- if (resolvedStyleMap.size > 0 && nextTableStyleMap) {
4077
- nextTableStyleMap = chunkFJDZ7AEE_js.applyTableStyleImagePatches(
4078
- nextTableStyleMap,
4079
- resolvedStyleMap,
4080
- tableStyleImageRefs
4081
- );
4082
- }
3811
+ nextSlides = parsed.slides.map((s) => {
3812
+ const newElements = chunkK6R2JNCK_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
3813
+ return newElements === s.elements ? s : { ...s, elements: newElements };
3814
+ });
4083
3815
  }
3816
+ nextSlides = await chunkK6R2JNCK_js.resolveTableCellImageUrls(
3817
+ nextSlides,
3818
+ (path) => handler.getImageData(path)
3819
+ );
3820
+ const nextTableStyleMap = await chunkK6R2JNCK_js.resolveTableStyleImageUrls(
3821
+ parsed.tableStyleMap,
3822
+ (path) => handler.getImageData(path)
3823
+ );
4084
3824
  handlerRef.current = handler;
4085
- const partition = chunkFJDZ7AEE_js.partitionTemplateElements(nextSlides);
3825
+ const partition = chunkK6R2JNCK_js.partitionTemplateElements(nextSlides);
4086
3826
  setSlides(partition.slides);
4087
3827
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
4088
3828
  setCanvasSize({
4089
- width: parsed.width ?? chunkB6UIVRFA_js.DEFAULT_CANVAS_WIDTH,
4090
- height: parsed.height ?? chunkB6UIVRFA_js.DEFAULT_CANVAS_HEIGHT
3829
+ width: parsed.width ?? chunk44CQ67GQ_js.DEFAULT_CANVAS_WIDTH,
3830
+ height: parsed.height ?? chunk44CQ67GQ_js.DEFAULT_CANVAS_HEIGHT
4091
3831
  });
4092
3832
  setSlideSizeEmu(
4093
3833
  typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
@@ -4104,7 +3844,7 @@ function useLoadContent({
4104
3844
  setThemeOptions(parsed.themeOptions ?? []);
4105
3845
  setCustomShows(parsed.customShows ?? []);
4106
3846
  setActiveCustomShowId(
4107
- chunkFJDZ7AEE_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
3847
+ chunkK6R2JNCK_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
4108
3848
  );
4109
3849
  setSections(parsed.sections ?? []);
4110
3850
  setPresentationProperties(parsed.presentationProperties ?? {});
@@ -4127,7 +3867,7 @@ function useLoadContent({
4127
3867
  setHasMacros(parsed.hasMacros === true);
4128
3868
  setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
4129
3869
  setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
4130
- setGuides(chunkFJDZ7AEE_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
3870
+ setGuides(chunkK6R2JNCK_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
4131
3871
  setActiveSlideIndex(0);
4132
3872
  clearSelection();
4133
3873
  setIsDirty(false);
@@ -4135,7 +3875,7 @@ function useLoadContent({
4135
3875
  onContentApplied?.();
4136
3876
  } catch (err) {
4137
3877
  if (!cancelled && token === renderTokenRef.current) {
4138
- if (err instanceof chunkFJDZ7AEE_js.EncryptedFileError) {
3878
+ if (err instanceof chunkK6R2JNCK_js.EncryptedFileError) {
4139
3879
  setIsEncrypted(true);
4140
3880
  } else {
4141
3881
  console.error("[pptx] Failed to load presentation content:", err);
@@ -4163,7 +3903,7 @@ function useLoadContent({
4163
3903
  }
4164
3904
  function useAutosave(input) {
4165
3905
  const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
4166
- const intervalMs = chunkFJDZ7AEE_js.resolveAutosaveIntervalMs({
3906
+ const intervalMs = chunkK6R2JNCK_js.resolveAutosaveIntervalMs({
4167
3907
  hostIntervalMs: input.intervalMs,
4168
3908
  optionsIntervalSeconds: input.intervalSeconds
4169
3909
  });
@@ -4194,7 +3934,7 @@ function useAutosave(input) {
4194
3934
  return;
4195
3935
  }
4196
3936
  const sources = changeSourcesRef.current?.() ?? [];
4197
- if (!chunkFJDZ7AEE_js.shouldWriteAutosaveSnapshot({
3937
+ if (!chunkK6R2JNCK_js.shouldWriteAutosaveSnapshot({
4198
3938
  filePath: path,
4199
3939
  isDirty: isDirtyRef.current,
4200
3940
  saving: isSavingRef.current,
@@ -4212,8 +3952,8 @@ function useAutosave(input) {
4212
3952
  isSavingRef.current = false;
4213
3953
  return;
4214
3954
  }
4215
- await chunkFJDZ7AEE_js.saveAutosaveSnapshot(path, data);
4216
- lastSnapshotRef.current = chunkFJDZ7AEE_js.autosaveSnapshotMark(path, sources);
3955
+ await chunkK6R2JNCK_js.saveAutosaveSnapshot(path, data);
3956
+ lastSnapshotRef.current = chunkK6R2JNCK_js.autosaveSnapshotMark(path, sources);
4217
3957
  setAutosaveStatus({ state: "saved", timestamp: Date.now() });
4218
3958
  } catch (err) {
4219
3959
  setAutosaveStatus({
@@ -4299,11 +4039,11 @@ function useElementOperations(input) {
4299
4039
  (elementId, updates) => {
4300
4040
  if (masterView?.target) {
4301
4041
  applyMasterViewWrite(
4302
- chunkFJDZ7AEE_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4042
+ chunkK6R2JNCK_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
4303
4043
  );
4304
4044
  return;
4305
4045
  }
4306
- if (chunkFJDZ7AEE_js.isTemplateElementId(elementId)) {
4046
+ if (chunkK6R2JNCK_js.isTemplateElementId(elementId)) {
4307
4047
  const slideId = activeSlide?.id;
4308
4048
  if (slideId) {
4309
4049
  setTemplateElementsBySlideId((prev) => ({
@@ -4314,19 +4054,7 @@ function useElementOperations(input) {
4314
4054
  }));
4315
4055
  }
4316
4056
  } else {
4317
- setSlides(
4318
- (prev) => prev.map(
4319
- (s, i) => i !== activeSlideIndex ? s : {
4320
- ...s,
4321
- elements: s.elements.map(
4322
- (el) => el.id === elementId ? {
4323
- ...el,
4324
- ...updates
4325
- } : el
4326
- )
4327
- }
4328
- )
4329
- );
4057
+ setSlides((prev) => chunkK6R2JNCK_js.updateElement(prev, activeSlideIndex, elementId, updates));
4330
4058
  }
4331
4059
  history.markDirty();
4332
4060
  },
@@ -4351,7 +4079,7 @@ function useElementOperations(input) {
4351
4079
  );
4352
4080
  const updateSelectedShapeStyle = react.useCallback(
4353
4081
  (updates) => {
4354
- if (!selectedElement || !chunkFJDZ7AEE_js.hasShapeProperties(selectedElement)) {
4082
+ if (!selectedElement || !chunkK6R2JNCK_js.hasShapeProperties(selectedElement)) {
4355
4083
  return;
4356
4084
  }
4357
4085
  updateSelectedElement({
@@ -4362,17 +4090,17 @@ function useElementOperations(input) {
4362
4090
  );
4363
4091
  const updateSelectedTextStyle = react.useCallback(
4364
4092
  (updates) => {
4365
- if (!selectedElement || !chunkFJDZ7AEE_js.hasTextProperties(selectedElement)) {
4093
+ if (!selectedElement || !chunkK6R2JNCK_js.hasTextProperties(selectedElement)) {
4366
4094
  return;
4367
4095
  }
4368
- const inlineSel = chunkFJDZ7AEE_js.getInlineEditorSelection(selectedElement.textSegments);
4096
+ const inlineSel = chunkK6R2JNCK_js.getInlineEditorSelection(selectedElement.textSegments);
4369
4097
  if (inlineSel && selectedElement.textSegments) {
4370
- const { newSegments: newSegments2, newSelection } = chunkFJDZ7AEE_js.applyStyleToSelectedSegments(
4098
+ const { newSegments: newSegments2, newSelection } = chunkK6R2JNCK_js.applyStyleToSelectedSegments(
4371
4099
  selectedElement.textSegments,
4372
4100
  inlineSel,
4373
4101
  updates
4374
4102
  );
4375
- chunkFJDZ7AEE_js.setPendingSelectionRestore(newSelection);
4103
+ chunkK6R2JNCK_js.setPendingSelectionRestore(newSelection);
4376
4104
  updateSelectedElement({
4377
4105
  textSegments: newSegments2
4378
4106
  });
@@ -4392,12 +4120,12 @@ function useElementOperations(input) {
4392
4120
  );
4393
4121
  const updateSelectedTextCase = react.useCallback(
4394
4122
  (mode) => {
4395
- if (!selectedElement || !chunkFJDZ7AEE_js.hasTextProperties(selectedElement)) {
4123
+ if (!selectedElement || !chunkK6R2JNCK_js.hasTextProperties(selectedElement)) {
4396
4124
  return;
4397
4125
  }
4398
- const inlineSel = chunkFJDZ7AEE_js.getInlineEditorSelection(selectedElement.textSegments);
4126
+ const inlineSel = chunkK6R2JNCK_js.getInlineEditorSelection(selectedElement.textSegments);
4399
4127
  if (inlineSel && selectedElement.textSegments) {
4400
- const newSegments = chunkFJDZ7AEE_js.applyCaseTransformToSegments(
4128
+ const newSegments = chunkK6R2JNCK_js.applyCaseTransformToSegments(
4401
4129
  selectedElement.textSegments,
4402
4130
  inlineSel,
4403
4131
  mode
@@ -4407,14 +4135,14 @@ function useElementOperations(input) {
4407
4135
  }
4408
4136
  const updates = {};
4409
4137
  if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
4410
- updates.textSegments = chunkFJDZ7AEE_js.applyCaseTransformToSegments(
4138
+ updates.textSegments = chunkK6R2JNCK_js.applyCaseTransformToSegments(
4411
4139
  selectedElement.textSegments,
4412
4140
  null,
4413
4141
  mode
4414
4142
  );
4415
4143
  }
4416
4144
  if (typeof selectedElement.text === "string") {
4417
- updates.text = chunkFJDZ7AEE_js.transformTextCase(selectedElement.text, mode);
4145
+ updates.text = chunkK6R2JNCK_js.transformTextCase(selectedElement.text, mode);
4418
4146
  }
4419
4147
  updateSelectedElement(updates);
4420
4148
  },
@@ -4427,15 +4155,15 @@ function useElementOperations(input) {
4427
4155
  [setSlides]
4428
4156
  );
4429
4157
  const masterViewTarget = masterView?.target ?? null;
4430
- const activeElements = masterViewTarget ? chunkFJDZ7AEE_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4158
+ const activeElements = masterViewTarget ? chunkK6R2JNCK_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4431
4159
  const updateActiveElements = react.useCallback(
4432
4160
  (updater) => {
4433
4161
  if (masterView?.target) {
4434
4162
  applyMasterViewWrite(
4435
- chunkFJDZ7AEE_js.replaceMasterViewElements(
4163
+ chunkK6R2JNCK_js.replaceMasterViewElements(
4436
4164
  masterView,
4437
4165
  masterView.target,
4438
- updater(chunkFJDZ7AEE_js.masterViewElements(masterView, masterView.target))
4166
+ updater(chunkK6R2JNCK_js.masterViewElements(masterView, masterView.target))
4439
4167
  )
4440
4168
  );
4441
4169
  return;
@@ -4488,7 +4216,7 @@ function useSectionOperations(input) {
4488
4216
  const { sections, setSections, slides, setSlides, markDirty } = input;
4489
4217
  const addSection2 = react.useCallback(
4490
4218
  (name, afterSlideIndex) => {
4491
- const result = chunkFJDZ7AEE_js.addSection(sections, slides, name, afterSlideIndex);
4219
+ const result = chunkK6R2JNCK_js.addSection(sections, slides, name, afterSlideIndex);
4492
4220
  setSlides(result.slides);
4493
4221
  setSections(result.sections);
4494
4222
  markDirty();
@@ -4497,7 +4225,7 @@ function useSectionOperations(input) {
4497
4225
  );
4498
4226
  const renameSection2 = react.useCallback(
4499
4227
  (sectionId, newName) => {
4500
- const result = chunkFJDZ7AEE_js.renameSection(sections, slides, sectionId, newName);
4228
+ const result = chunkK6R2JNCK_js.renameSection(sections, slides, sectionId, newName);
4501
4229
  setSections(result.sections);
4502
4230
  setSlides(result.slides);
4503
4231
  markDirty();
@@ -4506,7 +4234,7 @@ function useSectionOperations(input) {
4506
4234
  );
4507
4235
  const deleteSection2 = react.useCallback(
4508
4236
  (sectionId) => {
4509
- const result = chunkFJDZ7AEE_js.deleteSection(sections, slides, sectionId);
4237
+ const result = chunkK6R2JNCK_js.deleteSection(sections, slides, sectionId);
4510
4238
  setSections(result.sections);
4511
4239
  setSlides(result.slides);
4512
4240
  markDirty();
@@ -4515,21 +4243,21 @@ function useSectionOperations(input) {
4515
4243
  );
4516
4244
  const moveSectionUp2 = react.useCallback(
4517
4245
  (sectionId) => {
4518
- setSections(chunkFJDZ7AEE_js.moveSectionUp(sections, sectionId));
4246
+ setSections(chunkK6R2JNCK_js.moveSectionUp(sections, sectionId));
4519
4247
  markDirty();
4520
4248
  },
4521
4249
  [sections, setSections, markDirty]
4522
4250
  );
4523
4251
  const moveSectionDown2 = react.useCallback(
4524
4252
  (sectionId) => {
4525
- setSections(chunkFJDZ7AEE_js.moveSectionDown(sections, sectionId));
4253
+ setSections(chunkK6R2JNCK_js.moveSectionDown(sections, sectionId));
4526
4254
  markDirty();
4527
4255
  },
4528
4256
  [sections, setSections, markDirty]
4529
4257
  );
4530
4258
  const moveSlidesToSection2 = react.useCallback(
4531
4259
  (slideIndexes, targetSectionId) => {
4532
- const result = chunkFJDZ7AEE_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4260
+ const result = chunkK6R2JNCK_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
4533
4261
  setSlides(result.slides);
4534
4262
  setSections(result.sections);
4535
4263
  markDirty();
@@ -4557,20 +4285,17 @@ function useSectionOperations(input) {
4557
4285
  }
4558
4286
 
4559
4287
  // src/viewer/hooks/pointer-move-handlers.ts
4560
- function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
4561
- const resized = chunkFJDZ7AEE_js.applyResize(
4562
- { x: startX, y: startY, width: startWidth, height: startHeight },
4563
- handle,
4564
- dx,
4565
- dy,
4566
- 1,
4567
- { minSize: chunkB6UIVRFA_js.MIN_ELEMENT_SIZE }
4568
- );
4288
+ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
4289
+ const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
4290
+ let resized = chunkK6R2JNCK_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunk44CQ67GQ_js.MIN_ELEMENT_SIZE });
4291
+ if (lockAspect) {
4292
+ resized = chunkK6R2JNCK_js.lockResizeAspect(resized, startBox, handle, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
4293
+ }
4569
4294
  const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
4570
4295
  if (!snapToGrid) {
4571
4296
  return box;
4572
4297
  }
4573
- return chunkFJDZ7AEE_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE);
4298
+ return chunkK6R2JNCK_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE);
4574
4299
  }
4575
4300
  function resolveLiveTarget(input) {
4576
4301
  const { livePatcher, editTemplateMode, activeSlide } = input;
@@ -4683,7 +4408,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4683
4408
  width: el.width,
4684
4409
  height: el.height
4685
4410
  }));
4686
- const snapResult = chunkFJDZ7AEE_js.computeSnapToShape(
4411
+ const snapResult = chunkK6R2JNCK_js.computeSnapToShape(
4687
4412
  targetX,
4688
4413
  targetY,
4689
4414
  primaryEl.width,
@@ -4722,7 +4447,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
4722
4447
  if (live) {
4723
4448
  for (const id of Object.keys(drag.startPositionsById)) {
4724
4449
  const start = drag.startPositionsById[id];
4725
- chunkFJDZ7AEE_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4450
+ chunkK6R2JNCK_js.publishLiveGeometry(live.patcher, live.slideId, id, {
4726
4451
  x: start.x + appliedDx,
4727
4452
  y: start.y + appliedDy
4728
4453
  });
@@ -4747,7 +4472,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4747
4472
  dx,
4748
4473
  dy,
4749
4474
  snapToGrid,
4750
- gridSpacingPx
4475
+ gridSpacingPx,
4476
+ e.shiftKey
4751
4477
  );
4752
4478
  rs.lastX = geo.x;
4753
4479
  rs.lastY = geo.y;
@@ -4756,22 +4482,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
4756
4482
  if (rs.domEl) {
4757
4483
  rs.domEl.style.left = `${geo.x}px`;
4758
4484
  rs.domEl.style.top = `${geo.y}px`;
4759
- rs.domEl.style.width = `${Math.max(geo.width, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE)}px`;
4760
- rs.domEl.style.height = `${Math.max(geo.height, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE)}px`;
4485
+ rs.domEl.style.width = `${Math.max(geo.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)}px`;
4486
+ rs.domEl.style.height = `${Math.max(geo.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)}px`;
4761
4487
  }
4762
4488
  if (live) {
4763
- chunkFJDZ7AEE_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4489
+ chunkK6R2JNCK_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
4764
4490
  x: geo.x,
4765
4491
  y: geo.y,
4766
- width: Math.max(geo.width, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE),
4767
- height: Math.max(geo.height, chunkB6UIVRFA_js.MIN_ELEMENT_SIZE)
4492
+ width: Math.max(geo.width, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE),
4493
+ height: Math.max(geo.height, chunk44CQ67GQ_js.MIN_ELEMENT_SIZE)
4768
4494
  });
4769
4495
  }
4770
4496
  }
4771
4497
  function processAdjustmentMove(e, adj, editorScale, updateElementById) {
4772
4498
  const dx = (e.clientX - adj.startClientX) / editorScale;
4773
4499
  const dy = (e.clientY - adj.startClientY) / editorScale;
4774
- const adjustments = chunkFJDZ7AEE_js.getDraggedShapeAdjustments(adj, dx, dy);
4500
+ const adjustments = chunkK6R2JNCK_js.getDraggedShapeAdjustments(adj, dx, dy);
4775
4501
  if (!adj.moved && Math.hypot(dx, dy) > 2) {
4776
4502
  adj.moved = true;
4777
4503
  }
@@ -4846,13 +4572,13 @@ function processPointerUp(input) {
4846
4572
  if (i !== activeSlideIndex) {
4847
4573
  return s;
4848
4574
  }
4849
- const rerouted = chunkFJDZ7AEE_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4575
+ const rerouted = chunkK6R2JNCK_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
4850
4576
  if (rerouted.length === 0) {
4851
4577
  return s;
4852
4578
  }
4853
4579
  return {
4854
4580
  ...s,
4855
- elements: chunkFJDZ7AEE_js.applyReroutedConnectors(s.elements, rerouted)
4581
+ elements: chunkK6R2JNCK_js.applyReroutedConnectors(s.elements, rerouted)
4856
4582
  };
4857
4583
  })
4858
4584
  );
@@ -4877,9 +4603,9 @@ function processPointerUp(input) {
4877
4603
  }
4878
4604
  function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
4879
4605
  const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
4880
- const hitIds = chunkFJDZ7AEE_js.computeMarqueeHitIds(marquee, sourceElements);
4606
+ const hitIds = chunkK6R2JNCK_js.computeMarqueeHitIds(marquee, sourceElements);
4881
4607
  if (marquee.additive) {
4882
- const merged = chunkFJDZ7AEE_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4608
+ const merged = chunkK6R2JNCK_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
4883
4609
  if (merged.length > 0) {
4884
4610
  applySelection(merged[0], merged);
4885
4611
  } else {
@@ -4902,8 +4628,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
4902
4628
  }
4903
4629
  return { ...el, x: start.x + dx, y: start.y + dy };
4904
4630
  });
4905
- const rerouted = chunkFJDZ7AEE_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4906
- return chunkFJDZ7AEE_js.applyReroutedConnectors(movedElements, rerouted);
4631
+ const rerouted = chunkK6R2JNCK_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
4632
+ return chunkK6R2JNCK_js.applyReroutedConnectors(movedElements, rerouted);
4907
4633
  };
4908
4634
  if (editTemplateMode) {
4909
4635
  const slideId = activeSlide?.id;
@@ -5059,11 +4785,11 @@ function useCanvasInteractions(input) {
5059
4785
  return;
5060
4786
  }
5061
4787
  const el = elementLookup.get(editId);
5062
- if (el && chunkFJDZ7AEE_js.hasTextProperties(el)) {
4788
+ if (el && chunkK6R2JNCK_js.hasTextProperties(el)) {
5063
4789
  const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
5064
- const newSegments = chunkFJDZ7AEE_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
4790
+ const newSegments = chunkK6R2JNCK_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
5065
4791
  const editorEl = document.querySelector("[data-inline-editor]");
5066
- const newHeight = chunkFJDZ7AEE_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
4792
+ const newHeight = chunkK6R2JNCK_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
5067
4793
  ops.updateElementById(editId, {
5068
4794
  text: committedText,
5069
4795
  textSegments: newSegments,
@@ -5075,7 +4801,7 @@ function useCanvasInteractions(input) {
5075
4801
  setInlineEditingText("");
5076
4802
  };
5077
4803
  const openEquationEditorForElement = (el) => {
5078
- if (!chunkFJDZ7AEE_js.hasTextProperties(el)) {
4804
+ if (!chunkK6R2JNCK_js.hasTextProperties(el)) {
5079
4805
  return false;
5080
4806
  }
5081
4807
  const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
@@ -5105,7 +4831,7 @@ function useCanvasInteractions(input) {
5105
4831
  justInteractedRef.current = false;
5106
4832
  } else {
5107
4833
  const el = elementLookup.get(elementId);
5108
- if (el && chunkFJDZ7AEE_js.hasTextProperties(el) && chunkFJDZ7AEE_js.canInteractWithElement(el, "textEdit")) {
4834
+ if (el && chunkK6R2JNCK_js.hasTextProperties(el) && chunkK6R2JNCK_js.canInteractWithElement(el, "textEdit")) {
5109
4835
  if (!openEquationEditorForElement(el)) {
5110
4836
  setInlineEditingElementId(elementId);
5111
4837
  setInlineEditingText(el.text ?? "");
@@ -5124,7 +4850,7 @@ function useCanvasInteractions(input) {
5124
4850
  if (openEquationEditorForElement(el)) {
5125
4851
  return;
5126
4852
  }
5127
- if (chunkFJDZ7AEE_js.hasTextProperties(el) && chunkFJDZ7AEE_js.canInteractWithElement(el, "textEdit")) {
4853
+ if (chunkK6R2JNCK_js.hasTextProperties(el) && chunkK6R2JNCK_js.canInteractWithElement(el, "textEdit")) {
5128
4854
  setInlineEditingElementId(elementId);
5129
4855
  setInlineEditingText(el.text ?? "");
5130
4856
  }
@@ -5147,7 +4873,7 @@ function useCanvasInteractions(input) {
5147
4873
  justSelectedRef.current = false;
5148
4874
  }
5149
4875
  const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
5150
- const movableIds = chunkFJDZ7AEE_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
4876
+ const movableIds = chunkK6R2JNCK_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
5151
4877
  if (movableIds.length === 0) {
5152
4878
  return;
5153
4879
  }
@@ -5217,7 +4943,7 @@ function useCanvasInteractions(input) {
5217
4943
  const handleResizePointerDown = (elementId, e, handle) => {
5218
4944
  e.stopPropagation();
5219
4945
  const el = elementLookup.get(elementId);
5220
- if (!el || !chunkFJDZ7AEE_js.canInteractWithElement(el, "resize")) {
4946
+ if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "resize")) {
5221
4947
  return;
5222
4948
  }
5223
4949
  resizeStateRef.current = {
@@ -5239,7 +4965,7 @@ function useCanvasInteractions(input) {
5239
4965
  };
5240
4966
  const handleRotate = (elementId, rotationDeg) => {
5241
4967
  const el = elementLookup.get(elementId);
5242
- if (!el || !chunkFJDZ7AEE_js.canInteractWithElement(el, "rotate")) {
4968
+ if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "rotate")) {
5243
4969
  return;
5244
4970
  }
5245
4971
  ops.updateElementById(elementId, { rotation: rotationDeg });
@@ -5259,10 +4985,10 @@ function useCanvasInteractions(input) {
5259
4985
  const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
5260
4986
  e.stopPropagation();
5261
4987
  const el = elementLookup.get(elementId);
5262
- if (!el || !chunkFJDZ7AEE_js.canInteractWithElement(el, "adjustHandle")) {
4988
+ if (!el || !chunkK6R2JNCK_js.canInteractWithElement(el, "adjustHandle")) {
5263
4989
  return;
5264
4990
  }
5265
- shapeAdjustmentDragStateRef.current = chunkFJDZ7AEE_js.beginShapeAdjustment(
4991
+ shapeAdjustmentDragStateRef.current = chunkK6R2JNCK_js.beginShapeAdjustment(
5266
4992
  el,
5267
4993
  descriptor,
5268
4994
  e.clientX,
@@ -5309,7 +5035,7 @@ function createFileHandlers(deps) {
5309
5035
  h = Math.round(h * scale);
5310
5036
  }
5311
5037
  addElement({
5312
- id: chunkFJDZ7AEE_js.generateElementId(),
5038
+ id: chunkK6R2JNCK_js.generateElementId(),
5313
5039
  type: "image",
5314
5040
  x: Math.round((canvasSize.width - w) / 2),
5315
5041
  y: Math.round((canvasSize.height - h) / 2),
@@ -5320,7 +5046,7 @@ function createFileHandlers(deps) {
5320
5046
  };
5321
5047
  img.onerror = () => {
5322
5048
  addElement({
5323
- id: chunkFJDZ7AEE_js.generateElementId(),
5049
+ id: chunkK6R2JNCK_js.generateElementId(),
5324
5050
  type: "image",
5325
5051
  x: 100,
5326
5052
  y: 100,
@@ -5339,14 +5065,14 @@ function createFileHandlers(deps) {
5339
5065
  return;
5340
5066
  }
5341
5067
  e.target.value = "";
5342
- const mediaType = chunkFJDZ7AEE_js.classifyMediaType(file.type);
5068
+ const mediaType = chunkK6R2JNCK_js.classifyMediaType(file.type);
5343
5069
  if (!mediaType) {
5344
5070
  return;
5345
5071
  }
5346
5072
  const elFilePath = file.path;
5347
5073
  const insertMediaElement = (mediaSourceUrl, width, height) => {
5348
5074
  addElement({
5349
- id: chunkFJDZ7AEE_js.generateElementId(),
5075
+ id: chunkK6R2JNCK_js.generateElementId(),
5350
5076
  type: "media",
5351
5077
  mediaType,
5352
5078
  mediaMimeType: file.type || void 0,
@@ -5521,13 +5247,13 @@ function createStructuredElementHandlers(deps) {
5521
5247
  return;
5522
5248
  }
5523
5249
  addElement({
5524
- id: chunkFJDZ7AEE_js.generateElementId(),
5250
+ id: chunkK6R2JNCK_js.generateElementId(),
5525
5251
  type: "smartArt",
5526
5252
  x: 100,
5527
5253
  y: 120,
5528
5254
  width: 600,
5529
5255
  height: 340,
5530
- smartArtData: chunkFJDZ7AEE_js.buildSmartArtPresetData(
5256
+ smartArtData: chunkK6R2JNCK_js.buildSmartArtPresetData(
5531
5257
  layout,
5532
5258
  defaultItems,
5533
5259
  (i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
@@ -5539,7 +5265,7 @@ function createStructuredElementHandlers(deps) {
5539
5265
  return;
5540
5266
  }
5541
5267
  addElement({
5542
- id: chunkFJDZ7AEE_js.generateElementId(),
5268
+ id: chunkK6R2JNCK_js.generateElementId(),
5543
5269
  type: "shape",
5544
5270
  x: 120,
5545
5271
  y: 200,
@@ -5577,7 +5303,7 @@ function createStructuredElementHandlers(deps) {
5577
5303
  return;
5578
5304
  }
5579
5305
  const resolved = resolveHyperlinkEditResult(data);
5580
- if (resolved.url && !chunkFJDZ7AEE_js.isUrlSafe(resolved.url)) {
5306
+ if (resolved.url && !chunkK6R2JNCK_js.isUrlSafe(resolved.url)) {
5581
5307
  return;
5582
5308
  }
5583
5309
  const actionClick = {
@@ -5601,7 +5327,7 @@ function createStructuredElementHandlers(deps) {
5601
5327
  const displayText = value || fieldTexts[fieldType] || fieldType;
5602
5328
  const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
5603
5329
  addElement({
5604
- id: chunkFJDZ7AEE_js.generateElementId(),
5330
+ id: chunkK6R2JNCK_js.generateElementId(),
5605
5331
  type: "shape",
5606
5332
  x: 120,
5607
5333
  y: 200,
@@ -5623,11 +5349,11 @@ function createStructuredElementHandlers(deps) {
5623
5349
  if (!activeSlide) {
5624
5350
  return;
5625
5351
  }
5626
- const preset = chunkFJDZ7AEE_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5352
+ const preset = chunkK6R2JNCK_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
5627
5353
  if (!preset) {
5628
5354
  return;
5629
5355
  }
5630
- const defaultPptxAction = chunkFJDZ7AEE_js.elementActionToPptxAction({
5356
+ const defaultPptxAction = chunkK6R2JNCK_js.elementActionToPptxAction({
5631
5357
  trigger: "click",
5632
5358
  type: preset.defaultAction
5633
5359
  });
@@ -5636,7 +5362,7 @@ function createStructuredElementHandlers(deps) {
5636
5362
  defaultPptxAction.highlightClick = true;
5637
5363
  }
5638
5364
  addElement({
5639
- id: chunkFJDZ7AEE_js.generateElementId(),
5365
+ id: chunkK6R2JNCK_js.generateElementId(),
5640
5366
  type: "shape",
5641
5367
  x: 150,
5642
5368
  y: 150,
@@ -5703,14 +5429,14 @@ function useInsertElements(input) {
5703
5429
  return;
5704
5430
  }
5705
5431
  addElement({
5706
- id: chunkFJDZ7AEE_js.generateElementId(),
5432
+ id: chunkK6R2JNCK_js.generateElementId(),
5707
5433
  type: "text",
5708
5434
  x: 100,
5709
5435
  y: 100,
5710
5436
  width: 300,
5711
5437
  height: 60,
5712
5438
  text: "",
5713
- textStyle: { fontSize: chunkB6UIVRFA_js.DEFAULT_TEXT_FONT_SIZE }
5439
+ textStyle: { fontSize: chunk44CQ67GQ_js.DEFAULT_TEXT_FONT_SIZE }
5714
5440
  });
5715
5441
  };
5716
5442
  const handleAddShape = () => {
@@ -5718,7 +5444,7 @@ function useInsertElements(input) {
5718
5444
  return;
5719
5445
  }
5720
5446
  addElement({
5721
- id: chunkFJDZ7AEE_js.generateElementId(),
5447
+ id: chunkK6R2JNCK_js.generateElementId(),
5722
5448
  type: "shape",
5723
5449
  x: 150,
5724
5450
  y: 150,
@@ -5737,15 +5463,15 @@ function useInsertElements(input) {
5737
5463
  return;
5738
5464
  }
5739
5465
  addElement({
5740
- ...chunkFJDZ7AEE_js.newTableElement(chunkB6UIVRFA_js.DEFAULT_TABLE_ROWS, chunkB6UIVRFA_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5741
- id: chunkFJDZ7AEE_js.generateElementId()
5466
+ ...chunkK6R2JNCK_js.newTableElement(chunk44CQ67GQ_js.DEFAULT_TABLE_ROWS, chunk44CQ67GQ_js.DEFAULT_TABLE_COLUMNS, 100, 200),
5467
+ id: chunkK6R2JNCK_js.generateElementId()
5742
5468
  });
5743
5469
  };
5744
5470
  const handleAddChart = (chartKind) => {
5745
5471
  if (!activeSlide) {
5746
5472
  return;
5747
5473
  }
5748
- addElement(chunkFJDZ7AEE_js.createDefaultChartElement(chartKind));
5474
+ addElement(chunkK6R2JNCK_js.createDefaultChartElement(chartKind));
5749
5475
  };
5750
5476
  const structured = createStructuredElementHandlers({
5751
5477
  activeSlide,
@@ -5815,7 +5541,7 @@ function useClipboardHandlers(input) {
5815
5541
  if (!selectedElement) {
5816
5542
  return;
5817
5543
  }
5818
- setClipboardPayload(chunkFJDZ7AEE_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5544
+ setClipboardPayload(chunkK6R2JNCK_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
5819
5545
  };
5820
5546
  const handleDelete = () => {
5821
5547
  const idsToDelete = effectiveSelectedIds;
@@ -5832,7 +5558,7 @@ function useClipboardHandlers(input) {
5832
5558
  handleDelete();
5833
5559
  };
5834
5560
  const insertClone = (source) => {
5835
- const clone = chunkFJDZ7AEE_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5561
+ const clone = chunkK6R2JNCK_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
5836
5562
  ops.updateActiveElements((els) => [...els, clone]);
5837
5563
  ops.applySelection(clone.id);
5838
5564
  history.markDirty();
@@ -5867,7 +5593,7 @@ function resolveShapePath(el) {
5867
5593
  return el.pathData;
5868
5594
  }
5869
5595
  if ("shapeType" in el && typeof el.shapeType === "string") {
5870
- const clipPath = chunkFJDZ7AEE_js.getPresetShapeClipPath(el.shapeType);
5596
+ const clipPath = chunkK6R2JNCK_js.getPresetShapeClipPath(el.shapeType);
5871
5597
  if (clipPath) {
5872
5598
  const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
5873
5599
  if (svgPath) {
@@ -5918,7 +5644,7 @@ function clipPathToSvgPath(clipPath, width, height) {
5918
5644
  return parts.join(" ");
5919
5645
  }
5920
5646
  function transformPathToGlobal(pathData, el) {
5921
- const polys = chunkFJDZ7AEE_js.svgPathToPolygons(pathData);
5647
+ const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
5922
5648
  if (polys.length === 0) {
5923
5649
  return pathData;
5924
5650
  }
@@ -5938,10 +5664,10 @@ function transformPathToGlobal(pathData, el) {
5938
5664
  y: pt.y * scaleY + el.y
5939
5665
  }))
5940
5666
  );
5941
- return chunkFJDZ7AEE_js.polygonsToSvgPath(transformed);
5667
+ return chunkK6R2JNCK_js.polygonsToSvgPath(transformed);
5942
5668
  }
5943
5669
  function transformPathToLocal(pathData, x, y, _width, _height) {
5944
- const polys = chunkFJDZ7AEE_js.svgPathToPolygons(pathData);
5670
+ const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
5945
5671
  if (polys.length === 0) {
5946
5672
  return pathData;
5947
5673
  }
@@ -5951,10 +5677,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
5951
5677
  y: pt.y - y
5952
5678
  }))
5953
5679
  );
5954
- return chunkFJDZ7AEE_js.polygonsToSvgPath(transformed);
5680
+ return chunkK6R2JNCK_js.polygonsToSvgPath(transformed);
5955
5681
  }
5956
5682
  function pathBounds(pathData) {
5957
- const polys = chunkFJDZ7AEE_js.svgPathToPolygons(pathData);
5683
+ const polys = chunkK6R2JNCK_js.svgPathToPolygons(pathData);
5958
5684
  let minX = Infinity;
5959
5685
  let minY = Infinity;
5960
5686
  let maxX = -Infinity;
@@ -6013,7 +5739,7 @@ function useMergeShapesHandler(input) {
6013
5739
  let allFragments = [];
6014
5740
  let remaining = globalPaths[0];
6015
5741
  for (let i = 1; i < globalPaths.length; i++) {
6016
- const frags = chunkFJDZ7AEE_js.mergeShapes("fragment", remaining, globalPaths[i]);
5742
+ const frags = chunkK6R2JNCK_js.mergeShapes("fragment", remaining, globalPaths[i]);
6017
5743
  if (Array.isArray(frags)) {
6018
5744
  allFragments = frags;
6019
5745
  }
@@ -6042,7 +5768,7 @@ function useMergeShapesHandler(input) {
6042
5768
  bounds.height
6043
5769
  );
6044
5770
  const newEl = {
6045
- id: chunkFJDZ7AEE_js.generateElementId(),
5771
+ id: chunkK6R2JNCK_js.generateElementId(),
6046
5772
  type: "shape",
6047
5773
  x: bounds.x,
6048
5774
  y: bounds.y,
@@ -6080,7 +5806,7 @@ function useMergeShapesHandler(input) {
6080
5806
  } else {
6081
5807
  let resultPath = globalPaths[0];
6082
5808
  for (let i = 1; i < globalPaths.length; i++) {
6083
- const result = chunkFJDZ7AEE_js.mergeShapes(operation, resultPath, globalPaths[i]);
5809
+ const result = chunkK6R2JNCK_js.mergeShapes(operation, resultPath, globalPaths[i]);
6084
5810
  if (typeof result === "string") {
6085
5811
  resultPath = result;
6086
5812
  }
@@ -6101,7 +5827,7 @@ function useMergeShapesHandler(input) {
6101
5827
  );
6102
5828
  const primary = targets[0];
6103
5829
  const newEl = {
6104
- id: chunkFJDZ7AEE_js.generateElementId(),
5830
+ id: chunkK6R2JNCK_js.generateElementId(),
6105
5831
  type: "shape",
6106
5832
  x: bounds.x,
6107
5833
  y: bounds.y,
@@ -6164,7 +5890,7 @@ function useGroupAlignLayerHandlers(input) {
6164
5890
  if (ids.length < 2 || !activeSlide) {
6165
5891
  return;
6166
5892
  }
6167
- const { elements, groupId } = chunkFJDZ7AEE_js.groupElements(ops.activeElements, ids, chunkFJDZ7AEE_js.generateElementId());
5893
+ const { elements, groupId } = chunkK6R2JNCK_js.groupElements(ops.activeElements, ids, chunkK6R2JNCK_js.generateElementId());
6168
5894
  if (groupId === null) {
6169
5895
  return;
6170
5896
  }
@@ -6177,11 +5903,11 @@ function useGroupAlignLayerHandlers(input) {
6177
5903
  return;
6178
5904
  }
6179
5905
  const group = selectedElement;
6180
- const intoTemplate = chunkFJDZ7AEE_js.isTemplateElementId(group.id);
5906
+ const intoTemplate = chunkK6R2JNCK_js.isTemplateElementId(group.id);
6181
5907
  const childIds = group.children.map(
6182
- (child) => intoTemplate ? chunkFJDZ7AEE_js.makeCloneId(true, child.id || group.id) : child.id || chunkFJDZ7AEE_js.generateElementId()
5908
+ (child) => intoTemplate ? chunkK6R2JNCK_js.makeCloneId(true, child.id || group.id) : child.id || chunkK6R2JNCK_js.generateElementId()
6183
5909
  );
6184
- const { elements, childIds: usedIds } = chunkFJDZ7AEE_js.ungroupElements(
5910
+ const { elements, childIds: usedIds } = chunkK6R2JNCK_js.ungroupElements(
6185
5911
  ops.activeElements,
6186
5912
  group.id,
6187
5913
  childIds,
@@ -6210,7 +5936,7 @@ function useGroupAlignLayerHandlers(input) {
6210
5936
  if (!edge) {
6211
5937
  return;
6212
5938
  }
6213
- const positions = chunkFJDZ7AEE_js.alignElements(selectedElements, edge);
5939
+ const positions = chunkK6R2JNCK_js.alignElements(selectedElements, edge);
6214
5940
  for (const [id, pos] of positions) {
6215
5941
  const el = elementLookup.get(id);
6216
5942
  if (!el) {
@@ -6228,7 +5954,7 @@ function useGroupAlignLayerHandlers(input) {
6228
5954
  if (!distAxis) {
6229
5955
  return;
6230
5956
  }
6231
- const positions = chunkFJDZ7AEE_js.distributeElements(selectedElements, distAxis);
5957
+ const positions = chunkK6R2JNCK_js.distributeElements(selectedElements, distAxis);
6232
5958
  for (const [id, pos] of positions) {
6233
5959
  const el = elementLookup.get(id);
6234
5960
  if (!el) {
@@ -6245,7 +5971,7 @@ function useGroupAlignLayerHandlers(input) {
6245
5971
  }
6246
5972
  const id = selectedElement.id;
6247
5973
  ops.updateActiveElements(
6248
- (els) => direction === "forward" ? chunkFJDZ7AEE_js.bringForward(els, id) : direction === "backward" ? chunkFJDZ7AEE_js.sendBackward(els, id) : els
5974
+ (els) => direction === "forward" ? chunkK6R2JNCK_js.bringForward(els, id) : direction === "backward" ? chunkK6R2JNCK_js.sendBackward(els, id) : els
6249
5975
  );
6250
5976
  history.markDirty();
6251
5977
  };
@@ -6255,7 +5981,7 @@ function useGroupAlignLayerHandlers(input) {
6255
5981
  }
6256
5982
  const id = selectedElement.id;
6257
5983
  ops.updateActiveElements(
6258
- (els) => direction === "front" ? chunkFJDZ7AEE_js.bringToFront(els, id) : chunkFJDZ7AEE_js.sendToBack(els, id)
5984
+ (els) => direction === "front" ? chunkK6R2JNCK_js.bringToFront(els, id) : chunkK6R2JNCK_js.sendToBack(els, id)
6259
5985
  );
6260
5986
  history.markDirty();
6261
5987
  };
@@ -6386,7 +6112,7 @@ function useSlideManagement(input) {
6386
6112
  theme
6387
6113
  } = input;
6388
6114
  const handleAddSlide = () => {
6389
- const newSlide = chunkFJDZ7AEE_js.createBlankSlide(slides.length + 1);
6115
+ const newSlide = chunkK6R2JNCK_js.createBlankSlide(slides.length + 1);
6390
6116
  ops.updateSlides((prev) => {
6391
6117
  const next = [...prev];
6392
6118
  next.splice(activeSlideIndex + 1, 0, newSlide);
@@ -6449,7 +6175,7 @@ function useSlideManagement(input) {
6449
6175
  }
6450
6176
  const clone = {
6451
6177
  ...src,
6452
- id: chunkFJDZ7AEE_js.makeSlideId(),
6178
+ id: chunkK6R2JNCK_js.makeSlideId(),
6453
6179
  elements: src.elements.map((el) => ({
6454
6180
  ...el,
6455
6181
  id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
@@ -6481,7 +6207,7 @@ function useSlideManagement(input) {
6481
6207
  const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
6482
6208
  const insertAt = activeSlideIndex + 1;
6483
6209
  const draft = {
6484
- ...chunkFJDZ7AEE_js.createBlankSlide(slides.length + 1),
6210
+ ...chunkK6R2JNCK_js.createBlankSlide(slides.length + 1),
6485
6211
  layoutPath,
6486
6212
  ...layoutName ? { layoutName } : {}
6487
6213
  };
@@ -6514,9 +6240,9 @@ function useSlideManagement(input) {
6514
6240
  };
6515
6241
  const handleInsertSlideFromTemplate = (templateId) => {
6516
6242
  const insertAt = activeSlideIndex + 1;
6517
- const draft = chunkFJDZ7AEE_js.buildSlideTemplateSlide(templateId, chunkFJDZ7AEE_js.makeSlideId(), slides.length + 1, {
6243
+ const draft = chunkK6R2JNCK_js.buildSlideTemplateSlide(templateId, chunkK6R2JNCK_js.makeSlideId(), slides.length + 1, {
6518
6244
  ...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
6519
- scheme: chunkFJDZ7AEE_js.templateSchemeFromTheme(theme?.colorScheme)
6245
+ scheme: chunkK6R2JNCK_js.templateSchemeFromTheme(theme?.colorScheme)
6520
6246
  });
6521
6247
  ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
6522
6248
  setActiveSlideIndex(insertAt);
@@ -6553,7 +6279,7 @@ function createTableMergeHandlers(input) {
6553
6279
  if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
6554
6280
  return;
6555
6281
  }
6556
- const newTableData = chunkFJDZ7AEE_js.mergeCells(
6282
+ const newTableData = chunkK6R2JNCK_js.mergeCells(
6557
6283
  [
6558
6284
  { row: rowIndex, col: columnIndex },
6559
6285
  { row: rowIndex, col: nextColIdx }
@@ -6561,7 +6287,7 @@ function createTableMergeHandlers(input) {
6561
6287
  td
6562
6288
  );
6563
6289
  const updates = { tableData: newTableData };
6564
- const newRawXml = chunkFJDZ7AEE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6290
+ const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6565
6291
  if (newRawXml) {
6566
6292
  updates.rawXml = newRawXml;
6567
6293
  }
@@ -6587,7 +6313,7 @@ function createTableMergeHandlers(input) {
6587
6313
  if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
6588
6314
  return;
6589
6315
  }
6590
- const newTableData = chunkFJDZ7AEE_js.mergeCells(
6316
+ const newTableData = chunkK6R2JNCK_js.mergeCells(
6591
6317
  [
6592
6318
  { row: rowIndex, col: columnIndex },
6593
6319
  { row: targetNextRowIdx, col: columnIndex }
@@ -6595,7 +6321,7 @@ function createTableMergeHandlers(input) {
6595
6321
  td
6596
6322
  );
6597
6323
  const updates = { tableData: newTableData };
6598
- const newRawXml = chunkFJDZ7AEE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6324
+ const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6599
6325
  if (newRawXml) {
6600
6326
  updates.rawXml = newRawXml;
6601
6327
  }
@@ -6610,9 +6336,9 @@ function createTableMergeHandlers(input) {
6610
6336
  return;
6611
6337
  }
6612
6338
  const td = selectedElement.tableData;
6613
- const newTableData = chunkFJDZ7AEE_js.mergeCells(ts.selectedCells, td);
6339
+ const newTableData = chunkK6R2JNCK_js.mergeCells(ts.selectedCells, td);
6614
6340
  const updates = { tableData: newTableData };
6615
- const newRawXml = chunkFJDZ7AEE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6341
+ const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6616
6342
  if (newRawXml) {
6617
6343
  updates.rawXml = newRawXml;
6618
6344
  }
@@ -6629,9 +6355,9 @@ function createTableMergeHandlers(input) {
6629
6355
  }
6630
6356
  const { rowIndex, columnIndex } = ts;
6631
6357
  const td = selectedElement.tableData;
6632
- const newTableData = chunkFJDZ7AEE_js.splitCell(rowIndex, columnIndex, td);
6358
+ const newTableData = chunkK6R2JNCK_js.splitCell(rowIndex, columnIndex, td);
6633
6359
  const updates = { tableData: newTableData };
6634
- const newRawXml = chunkFJDZ7AEE_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6360
+ const newRawXml = chunkK6R2JNCK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
6635
6361
  if (newRawXml) {
6636
6362
  updates.rawXml = newRawXml;
6637
6363
  }
@@ -6665,10 +6391,10 @@ function createTableStructHandlers(input) {
6665
6391
  const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
6666
6392
  const updates = {};
6667
6393
  if (el.tableData) {
6668
- updates.tableData = chunkFJDZ7AEE_js.setCellText(el, rowIndex, colIndex, text).tableData;
6394
+ updates.tableData = chunkK6R2JNCK_js.setCellText(el, rowIndex, colIndex, text).tableData;
6669
6395
  }
6670
6396
  if (el.rawXml) {
6671
- const newRawXml = chunkFJDZ7AEE_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6397
+ const newRawXml = chunkK6R2JNCK_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
6672
6398
  if (newRawXml) {
6673
6399
  updates.rawXml = newRawXml;
6674
6400
  }
@@ -6692,7 +6418,7 @@ function createTableStructHandlers(input) {
6692
6418
  const { rowIndex, columnIndex: colIndex } = ts;
6693
6419
  const updates = {};
6694
6420
  if (selectedElement.rawXml) {
6695
- const newRawXml = chunkFJDZ7AEE_js.updateCellTextStyleInRawXml(
6421
+ const newRawXml = chunkK6R2JNCK_js.updateCellTextStyleInRawXml(
6696
6422
  selectedElement,
6697
6423
  rowIndex,
6698
6424
  colIndex,
@@ -6756,9 +6482,9 @@ function createTableStructHandlers(input) {
6756
6482
  return;
6757
6483
  }
6758
6484
  const rowIdx = ts?.rowIndex ?? 0;
6759
- const newTableData = chunkFJDZ7AEE_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6485
+ const newTableData = chunkK6R2JNCK_js.insertTableRow(selectedElement.tableData, rowIdx, position);
6760
6486
  const updates = { tableData: newTableData };
6761
- const newRawXml = chunkFJDZ7AEE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6487
+ const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6762
6488
  if (newRawXml) {
6763
6489
  updates.rawXml = newRawXml;
6764
6490
  }
@@ -6771,12 +6497,12 @@ function createTableStructHandlers(input) {
6771
6497
  }
6772
6498
  const td = selectedElement.tableData;
6773
6499
  const rowIdx = ts?.rowIndex ?? 0;
6774
- const newTableData = chunkFJDZ7AEE_js.deleteTableRow(td, rowIdx);
6500
+ const newTableData = chunkK6R2JNCK_js.deleteTableRow(td, rowIdx);
6775
6501
  if (newTableData === td) {
6776
6502
  return;
6777
6503
  }
6778
6504
  const updates = { tableData: newTableData };
6779
- const newRawXml = chunkFJDZ7AEE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6505
+ const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6780
6506
  if (newRawXml) {
6781
6507
  updates.rawXml = newRawXml;
6782
6508
  }
@@ -6788,9 +6514,9 @@ function createTableStructHandlers(input) {
6788
6514
  return;
6789
6515
  }
6790
6516
  const colIdx = ts?.columnIndex ?? 0;
6791
- const newTableData = chunkFJDZ7AEE_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6517
+ const newTableData = chunkK6R2JNCK_js.insertTableColumn(selectedElement.tableData, colIdx, position);
6792
6518
  const updates = { tableData: newTableData };
6793
- const newRawXml = chunkFJDZ7AEE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6519
+ const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6794
6520
  if (newRawXml) {
6795
6521
  updates.rawXml = newRawXml;
6796
6522
  }
@@ -6803,12 +6529,12 @@ function createTableStructHandlers(input) {
6803
6529
  }
6804
6530
  const td = selectedElement.tableData;
6805
6531
  const colIdx = ts?.columnIndex ?? 0;
6806
- const newTableData = chunkFJDZ7AEE_js.deleteTableColumn(td, colIdx);
6532
+ const newTableData = chunkK6R2JNCK_js.deleteTableColumn(td, colIdx);
6807
6533
  if (newTableData === td) {
6808
6534
  return;
6809
6535
  }
6810
6536
  const updates = { tableData: newTableData };
6811
- const newRawXml = chunkFJDZ7AEE_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6537
+ const newRawXml = chunkK6R2JNCK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
6812
6538
  if (newRawXml) {
6813
6539
  updates.rawXml = newRawXml;
6814
6540
  }
@@ -6844,8 +6570,8 @@ async function renderToCanvas(element, options = {}) {
6844
6570
  return html2canvasPro(element, {
6845
6571
  ...options,
6846
6572
  onclone: async (doc, clonedEl) => {
6847
- await chunkFJDZ7AEE_js.normalizeColorsForCapture(doc, clonedEl);
6848
- chunkFJDZ7AEE_js.preprocessCssForCapture(clonedEl);
6573
+ await chunkK6R2JNCK_js.normalizeColorsForCapture(doc, clonedEl);
6574
+ chunkK6R2JNCK_js.preprocessCssForCapture(clonedEl);
6849
6575
  if (typeof userOnClone === "function") {
6850
6576
  userOnClone(doc, clonedEl);
6851
6577
  }
@@ -6883,13 +6609,13 @@ function useExportSaveAs(input) {
6883
6609
  if (!handler) {
6884
6610
  return;
6885
6611
  }
6886
- const downloadName = chunkFJDZ7AEE_js.savedPresentationFileName(filePath, format);
6612
+ const downloadName = chunkK6R2JNCK_js.savedPresentationFileName(filePath, format);
6887
6613
  try {
6888
6614
  const data = await buildSaveAsData(handler, format);
6889
6615
  const blob = new Blob([data], {
6890
6616
  type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
6891
6617
  });
6892
- chunkFJDZ7AEE_js.downloadBlob(blob, downloadName);
6618
+ chunkK6R2JNCK_js.downloadBlob(blob, downloadName);
6893
6619
  } catch (err) {
6894
6620
  console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
6895
6621
  }
@@ -6902,18 +6628,18 @@ function useExportSaveAs(input) {
6902
6628
  const pptxGuides = guides.map((g) => ({
6903
6629
  id: g.id,
6904
6630
  orientation: g.axis === "h" ? "horz" : "vert",
6905
- positionEmu: chunkFJDZ7AEE_js.guidePxToEmu(g.position)
6631
+ positionEmu: chunkK6R2JNCK_js.guidePxToEmu(g.position)
6906
6632
  }));
6907
6633
  return {
6908
6634
  ...slide,
6909
6635
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
6910
6636
  };
6911
6637
  });
6912
- const slidesToSave = chunkFJDZ7AEE_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
6638
+ const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
6913
6639
  const saveOptions = {
6914
6640
  // Save As shares Save's slide-size decision; leaving it out here is how
6915
6641
  // a preset picked in the inspector reached one save path and not the other.
6916
- slideSize: chunkFJDZ7AEE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
6642
+ slideSize: chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
6917
6643
  headerFooter,
6918
6644
  presentationProperties,
6919
6645
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -6927,13 +6653,13 @@ function useExportSaveAs(input) {
6927
6653
  handoutMaster,
6928
6654
  outputFormat: format
6929
6655
  };
6930
- return chunkFJDZ7AEE_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
6656
+ return chunkK6R2JNCK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
6931
6657
  };
6932
6658
  const handleExportJson = () => {
6933
6659
  const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
6934
- const slideSize = chunkFJDZ7AEE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
6660
+ const slideSize = chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
6935
6661
  const data = {
6936
- slides: chunkFJDZ7AEE_js.buildSaveSlides(slides, templateElementsBySlideId),
6662
+ slides: chunkK6R2JNCK_js.buildSaveSlides(slides, templateElementsBySlideId),
6937
6663
  width: canvasSize.width,
6938
6664
  height: canvasSize.height,
6939
6665
  widthEmu: slideSize.widthEmu,
@@ -6952,7 +6678,7 @@ function useExportSaveAs(input) {
6952
6678
  handoutMaster
6953
6679
  };
6954
6680
  try {
6955
- chunkFJDZ7AEE_js.exportDeckJson(data, sourceName);
6681
+ chunkK6R2JNCK_js.exportDeckJson(data, sourceName);
6956
6682
  } catch (err) {
6957
6683
  console.error("[PowerPointViewer] JSON export failed:", err);
6958
6684
  }
@@ -7039,7 +6765,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
7039
6765
  }
7040
6766
  async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
7041
6767
  const blob = await exportSlideToPngBlob(slideElement, options);
7042
- chunkFJDZ7AEE_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
6768
+ chunkK6R2JNCK_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
7043
6769
  }
7044
6770
  async function copySlideToClipboard(slideElement, options = {}) {
7045
6771
  const blob = await exportSlideToPngBlob(slideElement, options);
@@ -7061,15 +6787,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
7061
6787
  continue;
7062
6788
  }
7063
6789
  const canvas = await renderElementToCanvas(stageEl, scale);
7064
- images.push(chunkFJDZ7AEE_js.canvasToJpegData(canvas));
6790
+ images.push(chunkK6R2JNCK_js.canvasToJpegData(canvas));
7065
6791
  }
7066
6792
  onProgress?.(totalSlides, totalSlides);
7067
6793
  setActiveSlide(currentSlideIndex);
7068
6794
  if (images.length === 0) {
7069
- throw new Error(chunkALO4ZOHQ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
6795
+ throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
7070
6796
  }
7071
- const pdfBlobUrl = chunkB6UIVRFA_js.buildPdfFromImageData(images);
7072
- chunkFJDZ7AEE_js.downloadDataUrl(pdfBlobUrl, filename);
6797
+ const pdfBlobUrl = chunk44CQ67GQ_js.buildPdfFromImageData(images);
6798
+ chunkK6R2JNCK_js.downloadDataUrl(pdfBlobUrl, filename);
7073
6799
  }
7074
6800
  async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
7075
6801
  const { scale = 2, onProgress } = options;
@@ -7115,10 +6841,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
7115
6841
  onProgress?.(totalSlides, totalSlides);
7116
6842
  setActiveSlide(currentSlideIndex);
7117
6843
  if (pages.length === 0) {
7118
- throw new Error(chunkALO4ZOHQ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
6844
+ throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
7119
6845
  }
7120
- const pdfDataUrl = chunkB6UIVRFA_js.buildNotesPdf(pages);
7121
- chunkFJDZ7AEE_js.downloadDataUrl(pdfDataUrl, filename);
6846
+ const pdfDataUrl = chunk44CQ67GQ_js.buildNotesPdf(pages);
6847
+ chunkK6R2JNCK_js.downloadDataUrl(pdfDataUrl, filename);
7122
6848
  }
7123
6849
 
7124
6850
  // src/viewer/utils/export-video.ts
@@ -7149,7 +6875,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7149
6875
  }
7150
6876
  setActiveSlide(currentSlideIndex);
7151
6877
  if (slideCanvases.length === 0) {
7152
- throw new Error(chunkALO4ZOHQ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
6878
+ throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
7153
6879
  }
7154
6880
  const firstCanvas = slideCanvases[0];
7155
6881
  const recordingCanvas = document.createElement("canvas");
@@ -7157,12 +6883,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7157
6883
  recordingCanvas.height = firstCanvas.height;
7158
6884
  const ctx = recordingCanvas.getContext("2d");
7159
6885
  if (!ctx) {
7160
- throw new Error(chunkALO4ZOHQ_js.translationsEn["pptx.export.errorNo2dContext"]);
6886
+ throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNo2dContext"]);
7161
6887
  }
7162
6888
  const fps = 30;
7163
6889
  const stream = recordingCanvas.captureStream(fps);
7164
6890
  const recorder = new MediaRecorder(stream, {
7165
- mimeType: chunkFJDZ7AEE_js.pickSupportedMimeType([...chunkFJDZ7AEE_js.WEBM_MIME_CANDIDATES]),
6891
+ mimeType: chunkK6R2JNCK_js.pickSupportedMimeType([...chunkK6R2JNCK_js.WEBM_MIME_CANDIDATES]),
7166
6892
  videoBitsPerSecond: 5e6
7167
6893
  });
7168
6894
  const chunks = [];
@@ -7185,8 +6911,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
7185
6911
  const duration = slideTimingsMs?.[i] ?? slideDurationMs;
7186
6912
  ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
7187
6913
  ctx.drawImage(slideCanvases[i], 0, 0);
7188
- const frameInterval = chunkFJDZ7AEE_js.fpsToFrameIntervalMs(fps);
7189
- const framesNeeded = chunkFJDZ7AEE_js.segmentFrameCount(duration, fps);
6914
+ const frameInterval = chunkK6R2JNCK_js.fpsToFrameIntervalMs(fps);
6915
+ const framesNeeded = chunkK6R2JNCK_js.segmentFrameCount(duration, fps);
7190
6916
  for (let f = 0; f < framesNeeded; f++) {
7191
6917
  if (signal?.aborted) {
7192
6918
  recorder.stop();
@@ -7233,9 +6959,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
7233
6959
  }
7234
6960
  setActiveSlide(currentSlideIndex);
7235
6961
  if (frames.length === 0) {
7236
- throw new Error(chunkALO4ZOHQ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
6962
+ throw new Error(chunk3P7FYHJH_js.translationsEn["pptx.export.errorNoSlidesGif"]);
7237
6963
  }
7238
- const gifBytes = chunkFJDZ7AEE_js.encodeGif(frames, Math.round(slideDurationMs / 10));
6964
+ const gifBytes = chunkK6R2JNCK_js.encodeGif(frames, Math.round(slideDurationMs / 10));
7239
6965
  onProgress?.(totalSlides, totalSlides);
7240
6966
  const buf = new ArrayBuffer(gifBytes.length);
7241
6967
  new Uint8Array(buf).set(gifBytes);
@@ -7289,7 +7015,7 @@ function exportAllSlidesToSvg(data, options = {}) {
7289
7015
  continue;
7290
7016
  }
7291
7017
  onProgress?.(processedCount, data.slides.length);
7292
- let svg = chunkFJDZ7AEE_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
7018
+ let svg = chunkK6R2JNCK_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
7293
7019
  if (embedFonts && fontFaces?.length) {
7294
7020
  svg = injectFontFaces(svg, fontFaces);
7295
7021
  }
@@ -7398,21 +7124,21 @@ function useExportHandlers(input) {
7398
7124
  {
7399
7125
  scale: imageExportScale,
7400
7126
  onProgress: (current, total) => {
7401
- setExportProgress(chunkFJDZ7AEE_js.slideProgressPercent(current, total));
7402
- setExportStatusMessage(chunkFJDZ7AEE_js.slideStatusLabel("Rendering", current, total));
7127
+ setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
7128
+ setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Rendering", current, total));
7403
7129
  },
7404
7130
  signal: abortCtrl.signal
7405
7131
  }
7406
7132
  );
7407
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_ASSEMBLING_PERCENT);
7133
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
7408
7134
  setExportStatusMessage("Building PDF...");
7409
7135
  await new Promise((r) => {
7410
7136
  setTimeout(r, 100);
7411
7137
  });
7412
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_DONE_PERCENT);
7138
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
7413
7139
  setExportStatusMessage("Done!");
7414
7140
  } catch (err) {
7415
- if (!chunkFJDZ7AEE_js.isExportAbortError(err)) {
7141
+ if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
7416
7142
  console.error("[PowerPointViewer] PDF export failed:", err);
7417
7143
  }
7418
7144
  } finally {
@@ -7442,21 +7168,21 @@ function useExportHandlers(input) {
7442
7168
  {
7443
7169
  scale: imageExportScale,
7444
7170
  onProgress: (current, total) => {
7445
- setExportProgress(chunkFJDZ7AEE_js.slideProgressPercent(current, total));
7446
- setExportStatusMessage(chunkFJDZ7AEE_js.slideStatusLabel("Rendering", current, total));
7171
+ setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
7172
+ setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Rendering", current, total));
7447
7173
  },
7448
7174
  signal: abortCtrl.signal
7449
7175
  }
7450
7176
  );
7451
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_ASSEMBLING_PERCENT);
7177
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
7452
7178
  setExportStatusMessage("Building PDF...");
7453
7179
  await new Promise((r) => {
7454
7180
  setTimeout(r, 100);
7455
7181
  });
7456
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_DONE_PERCENT);
7182
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
7457
7183
  setExportStatusMessage("Done!");
7458
7184
  } catch (err) {
7459
- if (!chunkFJDZ7AEE_js.isExportAbortError(err)) {
7185
+ if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
7460
7186
  console.error("[PowerPointViewer] Notes PDF export failed:", err);
7461
7187
  }
7462
7188
  } finally {
@@ -7498,22 +7224,22 @@ function useExportHandlers(input) {
7498
7224
  scale: 1,
7499
7225
  slideDurationMs: 3e3,
7500
7226
  onProgress: (current, total) => {
7501
- setExportProgress(chunkFJDZ7AEE_js.slideProgressPercent(current, total, 45));
7502
- setExportStatusMessage(chunkFJDZ7AEE_js.slideStatusLabel("Capturing", current, total));
7227
+ setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total, 45));
7228
+ setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Capturing", current, total));
7503
7229
  },
7504
7230
  onRecordProgress: (current, total) => {
7505
- setExportProgress(chunkFJDZ7AEE_js.recordProgressPercent(current, total));
7506
- setExportStatusMessage(chunkFJDZ7AEE_js.slideStatusLabel("Recording", current, total));
7231
+ setExportProgress(chunkK6R2JNCK_js.recordProgressPercent(current, total));
7232
+ setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Recording", current, total));
7507
7233
  },
7508
7234
  signal: abortCtrl.signal
7509
7235
  }
7510
7236
  );
7511
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_ASSEMBLING_PERCENT);
7237
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
7512
7238
  setExportStatusMessage("Saving file...");
7513
- chunkFJDZ7AEE_js.downloadBlob(blob, "presentation.webm");
7514
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_DONE_PERCENT);
7239
+ chunkK6R2JNCK_js.downloadBlob(blob, "presentation.webm");
7240
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
7515
7241
  } catch (err) {
7516
- if (!chunkFJDZ7AEE_js.isExportAbortError(err)) {
7242
+ if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
7517
7243
  console.error("[PowerPointViewer] Video export failed:", err);
7518
7244
  }
7519
7245
  } finally {
@@ -7541,18 +7267,18 @@ function useExportHandlers(input) {
7541
7267
  scale: 0.5,
7542
7268
  slideDurationMs: 2e3,
7543
7269
  onProgress: (current, total) => {
7544
- setExportProgress(chunkFJDZ7AEE_js.slideProgressPercent(current, total));
7545
- setExportStatusMessage(chunkFJDZ7AEE_js.slideStatusLabel("Encoding", current, total));
7270
+ setExportProgress(chunkK6R2JNCK_js.slideProgressPercent(current, total));
7271
+ setExportStatusMessage(chunkK6R2JNCK_js.slideStatusLabel("Encoding", current, total));
7546
7272
  },
7547
7273
  signal: abortCtrl.signal
7548
7274
  }
7549
7275
  );
7550
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_ASSEMBLING_PERCENT);
7276
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_ASSEMBLING_PERCENT);
7551
7277
  setExportStatusMessage("Saving file...");
7552
- chunkFJDZ7AEE_js.downloadBlob(blob, "presentation.gif");
7553
- setExportProgress(chunkFJDZ7AEE_js.EXPORT_DONE_PERCENT);
7278
+ chunkK6R2JNCK_js.downloadBlob(blob, "presentation.gif");
7279
+ setExportProgress(chunkK6R2JNCK_js.EXPORT_DONE_PERCENT);
7554
7280
  } catch (err) {
7555
- if (!chunkFJDZ7AEE_js.isExportAbortError(err)) {
7281
+ if (!chunkK6R2JNCK_js.isExportAbortError(err)) {
7556
7282
  console.error("[PowerPointViewer] GIF export failed:", err);
7557
7283
  }
7558
7284
  } finally {
@@ -7585,7 +7311,7 @@ function useExportHandlers(input) {
7585
7311
  exportStatusMessage
7586
7312
  };
7587
7313
  }
7588
- var ViewerOptionsContext = react.createContext(chunkFJDZ7AEE_js.DEFAULT_VIEWER_OPTIONS);
7314
+ var ViewerOptionsContext = react.createContext(chunkK6R2JNCK_js.DEFAULT_VIEWER_OPTIONS);
7589
7315
  function useViewerOptionsContext() {
7590
7316
  return react.useContext(ViewerOptionsContext);
7591
7317
  }
@@ -7597,13 +7323,13 @@ function usePrintHandlers(input) {
7597
7323
  const { t } = reactI18next.useTranslation();
7598
7324
  const viewerOptions = useViewerOptionsContext();
7599
7325
  const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
7600
- const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkFJDZ7AEE_js.resolveImageResolutionScale(viewerOptions);
7326
+ const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkK6R2JNCK_js.resolveImageResolutionScale(viewerOptions);
7601
7327
  const handlePrint = () => {
7602
7328
  setIsPrintDialogOpen(true);
7603
7329
  };
7604
7330
  const handlePrintSvg = async (settings) => {
7605
7331
  setIsPrintDialogOpen(false);
7606
- const printWindow = chunkFJDZ7AEE_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7332
+ const printWindow = chunkK6R2JNCK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7607
7333
  if (!printWindow) {
7608
7334
  console.warn(
7609
7335
  "[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
@@ -7613,9 +7339,9 @@ function usePrintHandlers(input) {
7613
7339
  if (!pptxData || settings.printWhat !== "slides") {
7614
7340
  return runRasterPrint(printWindow, settings);
7615
7341
  }
7616
- const colorFilter = chunkFJDZ7AEE_js.computeColorFilter(settings.colorMode);
7617
- const slideIndices = chunkFJDZ7AEE_js.filterHiddenSlideIndices(
7618
- chunkFJDZ7AEE_js.computeSlideIndices(
7342
+ const colorFilter = chunkK6R2JNCK_js.computeColorFilter(settings.colorMode);
7343
+ const slideIndices = chunkK6R2JNCK_js.filterHiddenSlideIndices(
7344
+ chunkK6R2JNCK_js.computeSlideIndices(
7619
7345
  settings.slideRange,
7620
7346
  activeSlideIndex,
7621
7347
  slides.length,
@@ -7633,22 +7359,22 @@ function usePrintHandlers(input) {
7633
7359
  printWindow.close();
7634
7360
  return;
7635
7361
  }
7636
- const printDoc = chunkFJDZ7AEE_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7362
+ const printDoc = chunkK6R2JNCK_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
7637
7363
  title: "Slides (Vector)",
7638
7364
  orientation: settings.orientation,
7639
7365
  colorFilter,
7640
7366
  scaleToFit: settings.scaleToFit
7641
7367
  });
7642
- chunkFJDZ7AEE_js.finishPrintWindow(printWindow, printDoc);
7368
+ chunkK6R2JNCK_js.finishPrintWindow(printWindow, printDoc);
7643
7369
  } catch (err) {
7644
7370
  console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
7645
7371
  return runRasterPrint(printWindow, settings);
7646
7372
  }
7647
7373
  };
7648
7374
  const runRasterPrint = async (printWindow, settings) => {
7649
- const colorFilter = chunkFJDZ7AEE_js.computeColorFilter(settings.colorMode);
7650
- const slideIndices = chunkFJDZ7AEE_js.filterHiddenSlideIndices(
7651
- chunkFJDZ7AEE_js.computeSlideIndices(
7375
+ const colorFilter = chunkK6R2JNCK_js.computeColorFilter(settings.colorMode);
7376
+ const slideIndices = chunkK6R2JNCK_js.filterHiddenSlideIndices(
7377
+ chunkK6R2JNCK_js.computeSlideIndices(
7652
7378
  settings.slideRange,
7653
7379
  activeSlideIndex,
7654
7380
  slides.length,
@@ -7659,11 +7385,11 @@ function usePrintHandlers(input) {
7659
7385
  includeHiddenSlides
7660
7386
  );
7661
7387
  if (settings.printWhat === "outline") {
7662
- chunkFJDZ7AEE_js.finishPrintWindow(
7388
+ chunkK6R2JNCK_js.finishPrintWindow(
7663
7389
  printWindow,
7664
- chunkFJDZ7AEE_js.buildPrintHtmlDocument({
7390
+ chunkK6R2JNCK_js.buildPrintHtmlDocument({
7665
7391
  title: "Outline",
7666
- bodyHtml: `<div class="outline-page">${chunkFJDZ7AEE_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7392
+ bodyHtml: `<div class="outline-page">${chunkK6R2JNCK_js.buildOutlineHtml(slideIndices, slides)}</div>`,
7667
7393
  orientation: settings.orientation,
7668
7394
  colorFilter,
7669
7395
  frameSlides: settings.frameSlides,
@@ -7690,11 +7416,11 @@ function usePrintHandlers(input) {
7690
7416
  }
7691
7417
  const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
7692
7418
  if (settings.printWhat === "slides") {
7693
- chunkFJDZ7AEE_js.finishPrintWindow(
7419
+ chunkK6R2JNCK_js.finishPrintWindow(
7694
7420
  printWindow,
7695
- chunkFJDZ7AEE_js.buildPrintHtmlDocument({
7421
+ chunkK6R2JNCK_js.buildPrintHtmlDocument({
7696
7422
  title: "Slides",
7697
- bodyHtml: chunkFJDZ7AEE_js.buildSlidesHtml(slideImages, slideIndices),
7423
+ bodyHtml: chunkK6R2JNCK_js.buildSlidesHtml(slideImages, slideIndices),
7698
7424
  orientation: settings.orientation,
7699
7425
  colorFilter,
7700
7426
  frameSlides: settings.frameSlides,
@@ -7704,11 +7430,11 @@ function usePrintHandlers(input) {
7704
7430
  return;
7705
7431
  }
7706
7432
  if (settings.printWhat === "notes") {
7707
- chunkFJDZ7AEE_js.finishPrintWindow(
7433
+ chunkK6R2JNCK_js.finishPrintWindow(
7708
7434
  printWindow,
7709
- chunkFJDZ7AEE_js.buildPrintHtmlDocument({
7435
+ chunkK6R2JNCK_js.buildPrintHtmlDocument({
7710
7436
  title: "Notes Pages",
7711
- bodyHtml: chunkFJDZ7AEE_js.buildNotesHtml(slideImages, slideIndices, slides),
7437
+ bodyHtml: chunkK6R2JNCK_js.buildNotesHtml(slideImages, slideIndices, slides),
7712
7438
  orientation: "portrait",
7713
7439
  colorFilter,
7714
7440
  frameSlides: settings.frameSlides,
@@ -7719,11 +7445,11 @@ function usePrintHandlers(input) {
7719
7445
  }
7720
7446
  if (settings.printWhat === "handouts") {
7721
7447
  const spp = settings.slidesPerPage;
7722
- chunkFJDZ7AEE_js.finishPrintWindow(
7448
+ chunkK6R2JNCK_js.finishPrintWindow(
7723
7449
  printWindow,
7724
- chunkFJDZ7AEE_js.buildPrintHtmlDocument({
7450
+ chunkK6R2JNCK_js.buildPrintHtmlDocument({
7725
7451
  title: `Handout ${spp} per page`,
7726
- bodyHtml: chunkFJDZ7AEE_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7452
+ bodyHtml: chunkK6R2JNCK_js.buildHandoutsHtml(slideImages, slideIndices, spp),
7727
7453
  orientation: "portrait",
7728
7454
  colorFilter,
7729
7455
  frameSlides: settings.frameSlides,
@@ -7737,7 +7463,7 @@ function usePrintHandlers(input) {
7737
7463
  };
7738
7464
  const handlePrintWithSettings = async (settings) => {
7739
7465
  setIsPrintDialogOpen(false);
7740
- const printWindow = chunkFJDZ7AEE_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7466
+ const printWindow = chunkK6R2JNCK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
7741
7467
  if (!printWindow) {
7742
7468
  console.warn(
7743
7469
  "[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
@@ -7800,8 +7526,8 @@ function useThemeHandlers(input) {
7800
7526
  return;
7801
7527
  }
7802
7528
  await handler.updateThemeColorScheme(colorScheme);
7803
- const previousMap = theme?.colorScheme ? chunkFJDZ7AEE_js.buildThemeColorMap(theme.colorScheme) : {};
7804
- setSlides((prev) => chunkFJDZ7AEE_js.reResolveSlideColors(prev, previousMap, colorScheme));
7529
+ const previousMap = theme?.colorScheme ? chunkK6R2JNCK_js.buildThemeColorMap(theme.colorScheme) : {};
7530
+ setSlides((prev) => chunkK6R2JNCK_js.reResolveSlideColors(prev, previousMap, colorScheme));
7805
7531
  setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
7806
7532
  bumpHistory();
7807
7533
  history.markDirty();
@@ -7906,7 +7632,7 @@ function useThemeSwitching(input) {
7906
7632
  }
7907
7633
  try {
7908
7634
  await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
7909
- const newData = chunkFJDZ7AEE_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7635
+ const newData = chunkK6R2JNCK_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
7910
7636
  onDataChange(newData);
7911
7637
  onThemeChanged?.(preset);
7912
7638
  } catch (error) {
@@ -7923,7 +7649,7 @@ function useThemeSwitching(input) {
7923
7649
  }
7924
7650
  try {
7925
7651
  await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
7926
- const newData = chunkFJDZ7AEE_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7652
+ const newData = chunkK6R2JNCK_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
7927
7653
  onDataChange(newData);
7928
7654
  } catch (error) {
7929
7655
  console.error("Failed to switch to custom theme:", error);
@@ -7935,12 +7661,12 @@ function useThemeSwitching(input) {
7935
7661
  if (!data?.theme?.colorScheme) {
7936
7662
  return void 0;
7937
7663
  }
7938
- return chunkFJDZ7AEE_js.THEME_PRESETS.find(
7939
- (p) => chunkFJDZ7AEE_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7664
+ return chunkK6R2JNCK_js.THEME_PRESETS.find(
7665
+ (p) => chunkK6R2JNCK_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
7940
7666
  );
7941
7667
  }, [data?.theme?.colorScheme]);
7942
7668
  return {
7943
- presets: chunkFJDZ7AEE_js.THEME_PRESETS,
7669
+ presets: chunkK6R2JNCK_js.THEME_PRESETS,
7944
7670
  switchToPreset,
7945
7671
  switchToCustom,
7946
7672
  currentPreset
@@ -8015,7 +7741,7 @@ function usePropertyHandlers(input) {
8015
7741
  }
8016
7742
  try {
8017
7743
  const ab = await file.arrayBuffer();
8018
- const h = new chunkFJDZ7AEE_js.PptxHandler();
7744
+ const h = new chunkK6R2JNCK_js.PptxHandler();
8019
7745
  const other = await h.load(ab);
8020
7746
  if (!other) {
8021
7747
  return;
@@ -8025,7 +7751,7 @@ function usePropertyHandlers(input) {
8025
7751
  width: canvasSize.width,
8026
7752
  height: canvasSize.height
8027
7753
  };
8028
- setCompareResult(chunkFJDZ7AEE_js.comparePresentation(cur, other));
7754
+ setCompareResult(chunkK6R2JNCK_js.comparePresentation(cur, other));
8029
7755
  setIsComparePanelOpen(true);
8030
7756
  } catch (err) {
8031
7757
  console.warn("Compare failed:", err);
@@ -8042,7 +7768,7 @@ function usePropertyHandlers(input) {
8042
7768
  if (!diff || diff.status === "unchanged") {
8043
7769
  return;
8044
7770
  }
8045
- setSlides((prev) => chunkFJDZ7AEE_js.applyAcceptSlide(prev, diff));
7771
+ setSlides((prev) => chunkK6R2JNCK_js.applyAcceptSlide(prev, diff));
8046
7772
  setIsDirty(true);
8047
7773
  },
8048
7774
  [compareResult, setSlides, setIsDirty]
@@ -8053,10 +7779,10 @@ function usePropertyHandlers(input) {
8053
7779
  if (!compareResult) {
8054
7780
  return;
8055
7781
  }
8056
- setSlides((prev) => chunkFJDZ7AEE_js.applyAcceptAllSlides(prev, compareResult));
7782
+ setSlides((prev) => chunkK6R2JNCK_js.applyAcceptAllSlides(prev, compareResult));
8057
7783
  setIsDirty(true);
8058
7784
  }, [compareResult, setSlides, setIsDirty]);
8059
- const usedFontFamilies = react.useMemo(() => chunkFJDZ7AEE_js.collectUsedFonts(slides), [slides]);
7785
+ const usedFontFamilies = react.useMemo(() => chunkK6R2JNCK_js.collectUsedFonts(slides), [slides]);
8060
7786
  return {
8061
7787
  handleUpdateNotes,
8062
7788
  handleUpdateSlide,
@@ -8211,7 +7937,7 @@ function useViewerDialogs(input) {
8211
7937
  );
8212
7938
  const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
8213
7939
  const fontEmbedding = react.useMemo(
8214
- () => chunkFJDZ7AEE_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
7940
+ () => chunkK6R2JNCK_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
8215
7941
  [embeddedFontKey]
8216
7942
  );
8217
7943
  const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
@@ -8221,11 +7947,11 @@ function useViewerDialogs(input) {
8221
7947
  setEmbedFontsEnabled(fontEmbedding.initialEnabled);
8222
7948
  }
8223
7949
  const [isNarrowViewport, setIsNarrowViewport] = react.useState(
8224
- () => typeof window !== "undefined" ? chunkFJDZ7AEE_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
7950
+ () => typeof window !== "undefined" ? chunkK6R2JNCK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
8225
7951
  );
8226
7952
  react.useEffect(() => {
8227
7953
  const handleWindow = () => setIsNarrowViewport(
8228
- chunkFJDZ7AEE_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
7954
+ chunkK6R2JNCK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
8229
7955
  );
8230
7956
  window.addEventListener("resize", handleWindow);
8231
7957
  return () => window.removeEventListener("resize", handleWindow);
@@ -8378,15 +8104,15 @@ function useViewerDialogs(input) {
8378
8104
  };
8379
8105
  }
8380
8106
  function computeGridSpacingPx2(documentGridSpacing) {
8381
- return chunkFJDZ7AEE_js.computeGridSpacingPx(documentGridSpacing, chunkB6UIVRFA_js.GRID_SIZE);
8107
+ return chunkK6R2JNCK_js.computeGridSpacingPx(documentGridSpacing, chunk44CQ67GQ_js.GRID_SIZE);
8382
8108
  }
8383
8109
  function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
8384
8110
  const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
8385
- return chunkFJDZ7AEE_js.resolveShowSlideIndexes(slides, activeShow);
8111
+ return chunkK6R2JNCK_js.resolveShowSlideIndexes(slides, activeShow);
8386
8112
  }
8387
8113
  function computeSlideSectionGroups(slides, sections) {
8388
- return chunkFJDZ7AEE_js.groupSlidesBySection(sections, slides).map((group) => ({
8389
- id: group.section?.id ?? (sections.length > 0 ? chunkB6UIVRFA_js.UNGROUPED_SECTION_ID : chunkB6UIVRFA_js.DEFAULT_SECTION_GROUP_ID),
8114
+ return chunkK6R2JNCK_js.groupSlidesBySection(sections, slides).map((group) => ({
8115
+ id: group.section?.id ?? (sections.length > 0 ? chunk44CQ67GQ_js.UNGROUPED_SECTION_ID : chunk44CQ67GQ_js.DEFAULT_SECTION_GROUP_ID),
8390
8116
  label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
8391
8117
  slideIndexes: group.slideIndexes,
8392
8118
  ...group.section?.color !== void 0 ? { color: group.section.color } : {},
@@ -8398,7 +8124,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
8398
8124
  return void 0;
8399
8125
  }
8400
8126
  const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
8401
- return chunkFJDZ7AEE_js.masterViewPseudoSlide(document2, {
8127
+ return chunkK6R2JNCK_js.masterViewPseudoSlide(document2, {
8402
8128
  tab: "slides",
8403
8129
  masterIndex: 0,
8404
8130
  layoutIndex: activeLayout ? 0 : null
@@ -8426,10 +8152,10 @@ function useDerivedSlideState(input) {
8426
8152
  );
8427
8153
  const slideSectionGroups = react.useMemo(
8428
8154
  () => computeSlideSectionGroups(slides, sections).map((group) => {
8429
- if (group.id === chunkB6UIVRFA_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8155
+ if (group.id === chunk44CQ67GQ_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
8430
8156
  return { ...group, label: t("pptx.slides.ungroupedSlides") };
8431
8157
  }
8432
- if (group.id === chunkB6UIVRFA_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8158
+ if (group.id === chunk44CQ67GQ_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
8433
8159
  return { ...group, label: t("pptx.sections.slides") };
8434
8160
  }
8435
8161
  return group;
@@ -8529,13 +8255,13 @@ function useAnnotationHandlers(input) {
8529
8255
  }, [annotations, setMode, setSlides, history]);
8530
8256
  const handleSetMode = react.useCallback(
8531
8257
  (nextMode) => {
8532
- if (mode === "present" && nextMode !== "present" && !chunkFJDZ7AEE_js.mayLeaveSlideShow()) {
8258
+ if (mode === "present" && nextMode !== "present" && !chunkK6R2JNCK_js.mayLeaveSlideShow()) {
8533
8259
  return;
8534
8260
  }
8535
8261
  if (nextMode === "present") {
8536
8262
  presentation.enterPresentMode();
8537
8263
  } else if (mode === "present" && annotations.hasAnyAnnotations) {
8538
- chunkFJDZ7AEE_js.stopAllPersistentAudio();
8264
+ chunkK6R2JNCK_js.stopAllPersistentAudio();
8539
8265
  if (promptKeepInkAnnotations) {
8540
8266
  pendingModeAfterAnnotationsRef.current = nextMode;
8541
8267
  setShowKeepAnnotationsDialog(true);
@@ -8545,7 +8271,7 @@ function useAnnotationHandlers(input) {
8545
8271
  }
8546
8272
  } else {
8547
8273
  if (mode === "present") {
8548
- chunkFJDZ7AEE_js.stopAllPersistentAudio();
8274
+ chunkK6R2JNCK_js.stopAllPersistentAudio();
8549
8275
  }
8550
8276
  setMode(nextMode);
8551
8277
  }
@@ -8609,13 +8335,13 @@ function useSerialize(input) {
8609
8335
  let processedSlide = slide;
8610
8336
  if (pendingEditId) {
8611
8337
  const updatedElements = slide.elements.map((el) => {
8612
- if (el.id !== pendingEditId || !chunkFJDZ7AEE_js.hasTextProperties(el)) {
8338
+ if (el.id !== pendingEditId || !chunkK6R2JNCK_js.hasTextProperties(el)) {
8613
8339
  return el;
8614
8340
  }
8615
8341
  return {
8616
8342
  ...el,
8617
8343
  text: pendingEditText,
8618
- textSegments: chunkFJDZ7AEE_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8344
+ textSegments: chunkK6R2JNCK_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
8619
8345
  };
8620
8346
  });
8621
8347
  if (updatedElements.some((el, i) => el !== slide.elements[i])) {
@@ -8628,19 +8354,19 @@ function useSerialize(input) {
8628
8354
  const pptxGuides = guides.map((g) => ({
8629
8355
  id: g.id,
8630
8356
  orientation: g.axis === "h" ? "horz" : "vert",
8631
- positionEmu: chunkFJDZ7AEE_js.guidePxToEmu(g.position)
8357
+ positionEmu: chunkK6R2JNCK_js.guidePxToEmu(g.position)
8632
8358
  }));
8633
8359
  return {
8634
8360
  ...processedSlide,
8635
8361
  guides: pptxGuides.length > 0 ? pptxGuides : void 0
8636
8362
  };
8637
8363
  });
8638
- const slidesToSave = chunkFJDZ7AEE_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8364
+ const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
8639
8365
  const saveOptions = {
8640
8366
  // Without this the Slide Size card edited a viewer-only pixel value and
8641
8367
  // the saved `p:sldSz` never moved: passing `slideSize` is the only way a
8642
8368
  // slide-size edit reaches the file.
8643
- slideSize: chunkFJDZ7AEE_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8369
+ slideSize: chunkK6R2JNCK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
8644
8370
  headerFooter,
8645
8371
  presentationProperties,
8646
8372
  customShows: customShows.length > 0 ? customShows : void 0,
@@ -8652,9 +8378,9 @@ function useSerialize(input) {
8652
8378
  slideMasters,
8653
8379
  notesMaster,
8654
8380
  handoutMaster,
8655
- ...chunkFJDZ7AEE_js.embeddedFontSaveOptions(embedFonts)
8381
+ ...chunkK6R2JNCK_js.embeddedFontSaveOptions(embedFonts)
8656
8382
  };
8657
- return chunkFJDZ7AEE_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8383
+ return chunkK6R2JNCK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
8658
8384
  }, [
8659
8385
  slides,
8660
8386
  templateElementsBySlideId,
@@ -8689,7 +8415,7 @@ function useRecoveryDetection(input) {
8689
8415
  const onRestore = input.onRestore;
8690
8416
  const openVersionHistory = input.openVersionHistory;
8691
8417
  react.useEffect(() => {
8692
- if (!chunkFJDZ7AEE_js.shouldProbeAutosaveRecovery({
8418
+ if (!chunkK6R2JNCK_js.shouldProbeAutosaveRecovery({
8693
8419
  alreadyChecked: recoveryCheckedRef.current,
8694
8420
  filePath,
8695
8421
  loading,
@@ -8701,7 +8427,7 @@ function useRecoveryDetection(input) {
8701
8427
  }
8702
8428
  recoveryCheckedRef.current = true;
8703
8429
  void (async () => {
8704
- const offer = await chunkFJDZ7AEE_js.probeAutosaveRecovery(filePath);
8430
+ const offer = await chunkK6R2JNCK_js.probeAutosaveRecovery(filePath);
8705
8431
  if (!offer) {
8706
8432
  return;
8707
8433
  }
@@ -8714,7 +8440,7 @@ function useRecoveryDetection(input) {
8714
8440
  const record = recordRef.current;
8715
8441
  setPrompt(null);
8716
8442
  if (record && onRestore) {
8717
- onRestore(chunkFJDZ7AEE_js.acceptAutosaveRecovery(record));
8443
+ onRestore(chunkK6R2JNCK_js.acceptAutosaveRecovery(record));
8718
8444
  }
8719
8445
  recordRef.current = null;
8720
8446
  }, [onRestore]);
@@ -8723,7 +8449,7 @@ function useRecoveryDetection(input) {
8723
8449
  setPrompt(null);
8724
8450
  recordRef.current = null;
8725
8451
  if (record) {
8726
- void chunkFJDZ7AEE_js.discardAutosaveRecovery(record);
8452
+ void chunkK6R2JNCK_js.discardAutosaveRecovery(record);
8727
8453
  }
8728
8454
  }, []);
8729
8455
  return { prompt, restore, discard };
@@ -8762,11 +8488,11 @@ function usePresentationSetup(input) {
8762
8488
  containerRef,
8763
8489
  content,
8764
8490
  onSetMode: (nextMode) => {
8765
- if (mode === "present" && nextMode !== "present" && !chunkFJDZ7AEE_js.mayLeaveSlideShow()) {
8491
+ if (mode === "present" && nextMode !== "present" && !chunkK6R2JNCK_js.mayLeaveSlideShow()) {
8766
8492
  return;
8767
8493
  }
8768
8494
  if (mode === "present" && nextMode !== "present") {
8769
- chunkFJDZ7AEE_js.stopAllPersistentAudio();
8495
+ chunkK6R2JNCK_js.stopAllPersistentAudio();
8770
8496
  stopAnimationSound();
8771
8497
  const exitHandler = exitModeHandlerRef.current;
8772
8498
  if (exitHandler) {
@@ -8828,10 +8554,10 @@ function usePresentationSetup(input) {
8828
8554
  onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
8829
8555
  onToggleSubtitles,
8830
8556
  onSaveRehearsalTimings: (timings) => {
8831
- setSlides((prev) => chunkFJDZ7AEE_js.applyRehearsalTimings(prev, timings));
8557
+ setSlides((prev) => chunkK6R2JNCK_js.applyRehearsalTimings(prev, timings));
8832
8558
  history.markDirty();
8833
8559
  },
8834
- loopContinuously: chunkFJDZ7AEE_js.shouldLoopContinuously(presentationProperties),
8560
+ loopContinuously: chunkK6R2JNCK_js.shouldLoopContinuously(presentationProperties),
8835
8561
  showWithAnimation: presentationProperties.showWithAnimation,
8836
8562
  useTimings: presentationProperties.advanceMode !== "manual",
8837
8563
  endWithBlackSlide
@@ -9032,7 +8758,7 @@ function useEditorOperations(input) {
9032
8758
  const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
9033
8759
  react.useEffect(() => {
9034
8760
  if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
9035
- copiedFormatRef.current = chunkFJDZ7AEE_js.copyFormatFromElement(selectedElement);
8761
+ copiedFormatRef.current = chunkK6R2JNCK_js.copyFormatFromElement(selectedElement);
9036
8762
  } else if (!formatPainterActive) {
9037
8763
  copiedFormatRef.current = null;
9038
8764
  }
@@ -9058,12 +8784,12 @@ function useEditorOperations(input) {
9058
8784
  e.stopPropagation();
9059
8785
  const element = elementLookup.get(elementId);
9060
8786
  if (element) {
9061
- const updated = chunkFJDZ7AEE_js.applyFormatToElement(element, copiedFormatRef.current);
8787
+ const updated = chunkK6R2JNCK_js.applyFormatToElement(element, copiedFormatRef.current);
9062
8788
  const updates = {};
9063
- if (chunkFJDZ7AEE_js.hasShapeProperties(updated)) {
8789
+ if (chunkK6R2JNCK_js.hasShapeProperties(updated)) {
9064
8790
  updates.shapeStyle = updated.shapeStyle;
9065
8791
  }
9066
- if (chunkFJDZ7AEE_js.hasTextProperties(updated)) {
8792
+ if (chunkK6R2JNCK_js.hasTextProperties(updated)) {
9067
8793
  updates.textStyle = updated.textStyle;
9068
8794
  }
9069
8795
  ops.updateElementById(elementId, updates);
@@ -9249,10 +8975,10 @@ function useFontInjection({ embeddedFonts, slides }) {
9249
8975
  }
9250
8976
  };
9251
8977
  }, [embeddedFonts]);
9252
- const referencedFamilies = react.useMemo(() => chunkFJDZ7AEE_js.collectReferencedFontFamilies(slides), [slides]);
8978
+ const referencedFamilies = react.useMemo(() => chunkK6R2JNCK_js.collectReferencedFontFamilies(slides), [slides]);
9253
8979
  react.useEffect(() => {
9254
8980
  let cancelled = false;
9255
- void chunkFJDZ7AEE_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
8981
+ void chunkK6R2JNCK_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
9256
8982
  if (cancelled) {
9257
8983
  return null;
9258
8984
  }
@@ -9428,7 +9154,7 @@ function useKeyboardShortcuts(input) {
9428
9154
  inputRef.current = input;
9429
9155
  const handleKeyDown = react.useCallback((e) => {
9430
9156
  const current = inputRef.current;
9431
- const { action, dx, dy } = chunkFJDZ7AEE_js.mapEditorKey(e, {
9157
+ const { action, dx, dy } = chunkK6R2JNCK_js.mapEditorKey(e, {
9432
9158
  canEdit: current.canEdit,
9433
9159
  // The Slide Master view is an editing surface, not a viewing one.
9434
9160
  // Gating on `mode !== 'edit'` alone made `mapEditorKey` return
@@ -9441,7 +9167,7 @@ function useKeyboardShortcuts(input) {
9441
9167
  hasSelection: current.hasSelection,
9442
9168
  isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
9443
9169
  isDrawing: current.activeTool !== "select",
9444
- isTextInputTarget: chunkFJDZ7AEE_js.isEditorTextInputTarget(e.target)
9170
+ isTextInputTarget: chunkK6R2JNCK_js.isEditorTextInputTarget(e.target)
9445
9171
  });
9446
9172
  if (action === null) {
9447
9173
  return;
@@ -9752,7 +9478,7 @@ function useViewerIntegration(input) {
9752
9478
  return zoom.scale;
9753
9479
  },
9754
9480
  setZoom(level) {
9755
- zoom.setScale(chunkFJDZ7AEE_js.clampZoomScale(level));
9481
+ zoom.setScale(chunkK6R2JNCK_js.clampZoomScale(level));
9756
9482
  },
9757
9483
  zoomIn() {
9758
9484
  zoom.handleZoomIn();
@@ -9968,7 +9694,7 @@ function useReducedMotion() {
9968
9694
  }
9969
9695
  function useViewerOptions() {
9970
9696
  const storeRef = react.useRef(null);
9971
- storeRef.current ??= chunkFJDZ7AEE_js.createViewerOptionsStore();
9697
+ storeRef.current ??= chunkK6R2JNCK_js.createViewerOptionsStore();
9972
9698
  const store = storeRef.current;
9973
9699
  const options = react.useSyncExternalStore(
9974
9700
  (onStoreChange) => store.subscribe(onStoreChange),
@@ -9977,9 +9703,9 @@ function useViewerOptions() {
9977
9703
  );
9978
9704
  return { optionsStore: store, options };
9979
9705
  }
9980
- var KNOWN_TAB_IDS = new Set(chunkFJDZ7AEE_js.TOOLBAR_TABS.map((tab) => tab.id));
9706
+ var KNOWN_TAB_IDS = new Set(chunkK6R2JNCK_js.TOOLBAR_TABS.map((tab) => tab.id));
9981
9707
  function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
9982
- const isHidden = (id) => chunkFJDZ7AEE_js.isActionHidden(id, hiddenActions);
9708
+ const isHidden = (id) => chunkK6R2JNCK_js.isActionHidden(id, hiddenActions);
9983
9709
  const userHidden = new Set(hiddenTabIds);
9984
9710
  userHidden.delete("file");
9985
9711
  const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
@@ -10071,12 +9797,12 @@ function useYjsDocumentSync({
10071
9797
  return;
10072
9798
  }
10073
9799
  try {
10074
- const handler = new chunkFJDZ7AEE_js.PptxHandler();
9800
+ const handler = new chunkK6R2JNCK_js.PptxHandler();
10075
9801
  await handler.load(sourceBytes.buffer);
10076
- const currentSlides = chunkFJDZ7AEE_js.readSlidesFromYDoc(
9802
+ const currentSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
10077
9803
  doc
10078
9804
  );
10079
- const slidesToSave = chunkFJDZ7AEE_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
9805
+ const slidesToSave = chunkK6R2JNCK_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
10080
9806
  const bytes = await handler.save(slidesToSave);
10081
9807
  config.onWriteBack(bytes);
10082
9808
  } catch {
@@ -10091,10 +9817,10 @@ function useYjsDocumentSync({
10091
9817
  if (!doc || !isConnected) {
10092
9818
  return;
10093
9819
  }
10094
- const docSlides = chunkFJDZ7AEE_js.readSlidesFromYDoc(
9820
+ const docSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
10095
9821
  doc
10096
9822
  );
10097
- if (!chunkFJDZ7AEE_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
9823
+ if (!chunkK6R2JNCK_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
10098
9824
  return;
10099
9825
  }
10100
9826
  lastSyncedRef.current = JSON.stringify(docSlides);
@@ -10113,11 +9839,11 @@ function useYjsDocumentSync({
10113
9839
  lastSyncedRef.current = serialized;
10114
9840
  void (async () => {
10115
9841
  const factories = await getFactories();
10116
- chunkFJDZ7AEE_js.reconcileSlidesInYDoc(
9842
+ chunkK6R2JNCK_js.reconcileSlidesInYDoc(
10117
9843
  slides,
10118
9844
  doc,
10119
9845
  factories,
10120
- chunkFJDZ7AEE_js.LOCAL_SYNC_ORIGIN
9846
+ chunkK6R2JNCK_js.LOCAL_SYNC_ORIGIN
10121
9847
  );
10122
9848
  scheduleWriteBack();
10123
9849
  })();
@@ -10131,10 +9857,10 @@ function useYjsDocumentSync({
10131
9857
  return;
10132
9858
  }
10133
9859
  const handleChange = (_events, transaction) => {
10134
- if (transaction?.origin === chunkFJDZ7AEE_js.LOCAL_SYNC_ORIGIN) {
9860
+ if (transaction?.origin === chunkK6R2JNCK_js.LOCAL_SYNC_ORIGIN) {
10135
9861
  return;
10136
9862
  }
10137
- const remoteSlides = chunkFJDZ7AEE_js.readSlidesFromYDoc(
9863
+ const remoteSlides = chunkK6R2JNCK_js.readSlidesFromYDoc(
10138
9864
  doc
10139
9865
  );
10140
9866
  if (remoteSlides.length === 0) {
@@ -10150,7 +9876,7 @@ function useYjsDocumentSync({
10150
9876
  isApplyingRemoteRef.current = false;
10151
9877
  scheduleWriteBack();
10152
9878
  };
10153
- const unobserve = chunkFJDZ7AEE_js.observeYDocSlides(
9879
+ const unobserve = chunkK6R2JNCK_js.observeYDocSlides(
10154
9880
  doc,
10155
9881
  handleChange
10156
9882
  );
@@ -10188,7 +9914,7 @@ function useBroadcastFollower({
10188
9914
  if (!broadcaster) {
10189
9915
  return;
10190
9916
  }
10191
- if (!chunkFJDZ7AEE_js.shouldAutoFollowBroadcaster({
9917
+ if (!chunkK6R2JNCK_js.shouldAutoFollowBroadcaster({
10192
9918
  localRole: collab.config.role,
10193
9919
  broadcasterRole: broadcaster.role
10194
9920
  })) {
@@ -10359,7 +10085,7 @@ function subscribeTouchCapability(callback) {
10359
10085
  function useIsMobile() {
10360
10086
  const isTouchDevice = react.useSyncExternalStore(
10361
10087
  subscribeTouchCapability,
10362
- chunkFJDZ7AEE_js.detectTouchDevice,
10088
+ chunkK6R2JNCK_js.detectTouchDevice,
10363
10089
  () => false
10364
10090
  // server snapshot
10365
10091
  );
@@ -10369,7 +10095,7 @@ function useIsMobile() {
10369
10095
  const [viewportHeight, setViewportHeight] = react.useState(
10370
10096
  () => typeof window === "undefined" ? 768 : window.innerHeight
10371
10097
  );
10372
- const [orientation, setOrientation] = react.useState(chunkFJDZ7AEE_js.detectOrientation);
10098
+ const [orientation, setOrientation] = react.useState(chunkK6R2JNCK_js.detectOrientation);
10373
10099
  const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
10374
10100
  const [initialViewportHeight] = react.useState(
10375
10101
  () => typeof window !== "undefined" ? window.innerHeight : 800
@@ -10390,7 +10116,7 @@ function useIsMobile() {
10390
10116
  return;
10391
10117
  }
10392
10118
  const handleOrientationChange = () => {
10393
- setOrientation(chunkFJDZ7AEE_js.detectOrientation());
10119
+ setOrientation(chunkK6R2JNCK_js.detectOrientation());
10394
10120
  };
10395
10121
  if (screen.orientation) {
10396
10122
  screen.orientation.addEventListener("change", handleOrientationChange);
@@ -10420,7 +10146,7 @@ function useIsMobile() {
10420
10146
  window.addEventListener("resize", handleResize);
10421
10147
  return () => window.removeEventListener("resize", handleResize);
10422
10148
  }, [isTouchDevice, initialViewportHeight]);
10423
- const { isMobile, isTablet, isDesktop } = chunkFJDZ7AEE_js.deriveViewportBreakpoints(
10149
+ const { isMobile, isTablet, isDesktop } = chunkK6R2JNCK_js.deriveViewportBreakpoints(
10424
10150
  viewportWidth,
10425
10151
  viewportHeight,
10426
10152
  isTouchDevice
@@ -10451,10 +10177,10 @@ function useTouchGestures(input) {
10451
10177
  if (!el || !enabled) {
10452
10178
  return;
10453
10179
  }
10454
- const recognizer = chunkFJDZ7AEE_js.createTouchGestureRecognizer({
10180
+ const recognizer = chunkK6R2JNCK_js.createTouchGestureRecognizer({
10455
10181
  getScale: () => scaleRef.current,
10456
- minScale: chunkFJDZ7AEE_js.MIN_ZOOM_SCALE,
10457
- maxScale: chunkFJDZ7AEE_js.MAX_ZOOM_SCALE,
10182
+ minScale: chunkK6R2JNCK_js.MIN_ZOOM_SCALE,
10183
+ maxScale: chunkK6R2JNCK_js.MAX_ZOOM_SCALE,
10458
10184
  callbacks: {
10459
10185
  onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
10460
10186
  onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
@@ -10494,7 +10220,7 @@ function scrollFocusedIntoView(keyboardInset) {
10494
10220
  return;
10495
10221
  }
10496
10222
  const rect = active.getBoundingClientRect();
10497
- const delta = chunkFJDZ7AEE_js.computeScrollDelta(
10223
+ const delta = chunkK6R2JNCK_js.computeScrollDelta(
10498
10224
  { top: rect.top, bottom: rect.bottom },
10499
10225
  window.innerHeight,
10500
10226
  keyboardInset
@@ -10514,8 +10240,8 @@ function useKeyboardInsets(enabled = true) {
10514
10240
  return;
10515
10241
  }
10516
10242
  const update = () => {
10517
- const metrics = chunkFJDZ7AEE_js.readViewportMetrics(window);
10518
- const inset = metrics ? chunkFJDZ7AEE_js.computeKeyboardInset(metrics) : 0;
10243
+ const metrics = chunkK6R2JNCK_js.readViewportMetrics(window);
10244
+ const inset = metrics ? chunkK6R2JNCK_js.computeKeyboardInset(metrics) : 0;
10519
10245
  setKeyboardInset(inset);
10520
10246
  if (inset > 0) {
10521
10247
  window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
@@ -10526,8 +10252,8 @@ function useKeyboardInsets(enabled = true) {
10526
10252
  vv.addEventListener("scroll", update);
10527
10253
  const onFocusIn = () => {
10528
10254
  window.requestAnimationFrame(() => {
10529
- const metrics = chunkFJDZ7AEE_js.readViewportMetrics(window);
10530
- const inset = metrics ? chunkFJDZ7AEE_js.computeKeyboardInset(metrics) : 0;
10255
+ const metrics = chunkK6R2JNCK_js.readViewportMetrics(window);
10256
+ const inset = metrics ? chunkK6R2JNCK_js.computeKeyboardInset(metrics) : 0;
10531
10257
  if (inset > 0) {
10532
10258
  scrollFocusedIntoView(inset);
10533
10259
  }
@@ -10540,7 +10266,7 @@ function useKeyboardInsets(enabled = true) {
10540
10266
  document.removeEventListener("focusin", onFocusIn);
10541
10267
  };
10542
10268
  }, [enabled]);
10543
- return { keyboardInset, isKeyboardOpen: chunkFJDZ7AEE_js.isKeyboardOpen(keyboardInset) };
10269
+ return { keyboardInset, isKeyboardOpen: chunkK6R2JNCK_js.isKeyboardOpen(keyboardInset) };
10544
10270
  }
10545
10271
 
10546
10272
  // src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
@@ -10569,21 +10295,21 @@ function buildCanvasProps(input) {
10569
10295
  } = input;
10570
10296
  const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
10571
10297
  const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
10572
- const fieldContext = chunkFJDZ7AEE_js.buildFieldSubstitutionContext({
10298
+ const fieldContext = chunkK6R2JNCK_js.buildFieldSubstitutionContext({
10573
10299
  headerFooter: s.headerFooter,
10574
10300
  customProperties: s.customProperties,
10575
10301
  slide: activeSlide
10576
10302
  });
10577
10303
  const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
10578
10304
  const openExternalUrl = (url) => {
10579
- if (chunkFJDZ7AEE_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
10305
+ if (chunkK6R2JNCK_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
10580
10306
  return;
10581
10307
  }
10582
- chunkFJDZ7AEE_js.safeOpenUrl(url);
10308
+ chunkK6R2JNCK_js.safeOpenUrl(url);
10583
10309
  };
10584
10310
  const handleActionClick = (_elementId, action) => {
10585
10311
  if (mode === "present") {
10586
- const resolved = chunkFJDZ7AEE_js.resolvePresentationAction(action, { slideCount: slides.length });
10312
+ const resolved = chunkK6R2JNCK_js.resolvePresentationAction(action, { slideCount: slides.length });
10587
10313
  if (resolved.intent.kind === "openUrl") {
10588
10314
  openExternalUrl(resolved.intent.url);
10589
10315
  return;
@@ -10594,9 +10320,9 @@ function buildCanvasProps(input) {
10594
10320
  }
10595
10321
  };
10596
10322
  const handleHyperlinkClick = (url) => {
10597
- if (chunkFJDZ7AEE_js.isPpactionUrl(url)) {
10323
+ if (chunkK6R2JNCK_js.isPpactionUrl(url)) {
10598
10324
  if (mode === "present") {
10599
- const parsed = chunkFJDZ7AEE_js.parsePpactionUrl(url);
10325
+ const parsed = chunkK6R2JNCK_js.parsePpactionUrl(url);
10600
10326
  if (parsed) {
10601
10327
  presentation.handlePresentationAction({
10602
10328
  action: parsed.action,
@@ -10702,7 +10428,7 @@ function buildCanvasProps(input) {
10702
10428
 
10703
10429
  // src/viewer/hooks/useScopedLayoutOptions.ts
10704
10430
  function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
10705
- return chunkFJDZ7AEE_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10431
+ return chunkK6R2JNCK_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
10706
10432
  }
10707
10433
 
10708
10434
  // src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
@@ -10715,7 +10441,7 @@ function buildToolbarAnimationHandlers(input) {
10715
10441
  const current = activeSlide.animations ?? [];
10716
10442
  if (group === "motionPath") {
10717
10443
  propertyHandlers.handleUpdateSlide({
10718
- animations: chunkFJDZ7AEE_js.applyMotionPathPreset(current, selectedElement.id, preset)
10444
+ animations: chunkK6R2JNCK_js.applyMotionPathPreset(current, selectedElement.id, preset)
10719
10445
  });
10720
10446
  return;
10721
10447
  }
@@ -10909,7 +10635,7 @@ function buildToolbarProps(input) {
10909
10635
  onOpenFile,
10910
10636
  onOpenRecentFile,
10911
10637
  onCreatePresentation: (templateId) => {
10912
- s.setSlides(chunkFJDZ7AEE_js.createBackstagePresentation(templateId));
10638
+ s.setSlides(chunkK6R2JNCK_js.createBackstagePresentation(templateId));
10913
10639
  s.setActiveSlideIndex(0);
10914
10640
  s.setSelectedElementId(null);
10915
10641
  s.setSelectedElementIds([]);
@@ -10938,7 +10664,7 @@ function buildToolbarProps(input) {
10938
10664
  loadLayoutPreviews: input.loadLayoutPreviews,
10939
10665
  onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
10940
10666
  onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
10941
- templateScheme: chunkFJDZ7AEE_js.templateSchemeFromTheme(s.theme?.colorScheme),
10667
+ templateScheme: chunkK6R2JNCK_js.templateSchemeFromTheme(s.theme?.colorScheme),
10942
10668
  customShows: s.customShows,
10943
10669
  activeCustomShowId: s.activeCustomShowId,
10944
10670
  onSetActiveCustomShowId: s.setActiveCustomShowId,
@@ -10979,7 +10705,7 @@ function buildToolbarProps(input) {
10979
10705
  isCommentsPanelOpen: s.isInspectorPaneOpen,
10980
10706
  slideCommentCount: activeSlide?.comments?.length ?? 0,
10981
10707
  formatPainterActive: s.formatPainterActive,
10982
- canActivateFormatPainter: chunkFJDZ7AEE_js.hasCopyableFormat(selectedElement),
10708
+ canActivateFormatPainter: chunkK6R2JNCK_js.hasCopyableFormat(selectedElement),
10983
10709
  onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
10984
10710
  isSelectionPaneOpen: s.isSelectionPaneOpen,
10985
10711
  onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
@@ -11053,7 +10779,7 @@ function useViewerBuildingBlocksCore(input) {
11053
10779
  headerFooter: state.headerFooter,
11054
10780
  loading,
11055
10781
  error,
11056
- maxHistoryEntries: chunkFJDZ7AEE_js.resolveHistoryDepth(viewerOptions),
10782
+ maxHistoryEntries: chunkK6R2JNCK_js.resolveHistoryDepth(viewerOptions),
11057
10783
  hasActivePointerInteraction,
11058
10784
  pointerCommitNonce: state.pointerCommitNonce,
11059
10785
  setSlides: state.setSlides,
@@ -11118,7 +10844,7 @@ function useViewerBuildingBlocksCore(input) {
11118
10844
  gridSpacingPx,
11119
10845
  // Multiplied against the pre-existing 2x baseline; see the matching
11120
10846
  // comment in `PowerPointViewer.tsx`.
11121
- imageExportScale: 2 * chunkFJDZ7AEE_js.resolveImageResolutionScale(viewerOptions),
10847
+ imageExportScale: 2 * chunkK6R2JNCK_js.resolveImageResolutionScale(viewerOptions),
11122
10848
  viewerOptions
11123
10849
  };
11124
10850
  }
@@ -11288,7 +11014,7 @@ function useViewerBuildingBlocks(input) {
11288
11014
  }, [incomingContent]);
11289
11015
  const onOpenFile = react.useCallback(() => {
11290
11016
  void (async () => {
11291
- const picked = await chunkFJDZ7AEE_js.openPptxFile();
11017
+ const picked = await chunkK6R2JNCK_js.openPptxFile();
11292
11018
  if (picked) {
11293
11019
  setContent(picked.buffer);
11294
11020
  }
@@ -11296,7 +11022,7 @@ function useViewerBuildingBlocks(input) {
11296
11022
  }, []);
11297
11023
  const onOpenRecentFile = react.useCallback((key) => {
11298
11024
  void (async () => {
11299
- const bytes = await chunkFJDZ7AEE_js.readBackstageRecentFile(key);
11025
+ const bytes = await chunkK6R2JNCK_js.readBackstageRecentFile(key);
11300
11026
  if (bytes) {
11301
11027
  setContent(bytes);
11302
11028
  }