pptx-react-viewer 2.17.0 → 2.19.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 (132) hide show
  1. package/CHANGELOG.md +703 -0
  2. package/README.md +14 -14
  3. package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-2GBJETOY.js} +24 -24
  4. package/dist/AiChatPanel-2GBJETOY.js.br +0 -0
  5. package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
  6. package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-FZUKTQPQ.mjs} +4 -4
  7. package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
  8. package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
  9. package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-JHTI2AQ6.js} +2 -2
  10. package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
  11. package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
  12. package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-WRRQSYAZ.mjs} +1 -1
  13. package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
  14. package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
  15. package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
  16. package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
  17. package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
  18. package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
  19. package/dist/{chunk-7JPLVECA.js → chunk-7ARD2J6Y.js} +10502 -7059
  20. package/dist/chunk-7ARD2J6Y.js.br +0 -0
  21. package/dist/chunk-7ARD2J6Y.js.gz +0 -0
  22. package/dist/{chunk-ZA5JONCW.mjs → chunk-BO373PYH.mjs} +257 -184
  23. package/dist/chunk-BO373PYH.mjs.br +0 -0
  24. package/dist/chunk-BO373PYH.mjs.gz +0 -0
  25. package/dist/{chunk-TCGXGD6E.js → chunk-IRLOXBO7.js} +608 -535
  26. package/dist/chunk-IRLOXBO7.js.br +0 -0
  27. package/dist/chunk-IRLOXBO7.js.gz +0 -0
  28. package/dist/{chunk-AONFHTTJ.js → chunk-MVKRI3CZ.js} +36 -4
  29. package/dist/chunk-MVKRI3CZ.js.br +0 -0
  30. package/dist/chunk-MVKRI3CZ.js.gz +0 -0
  31. package/dist/{chunk-MQHC5TXI.mjs → chunk-MWEBCWVD.mjs} +38 -2347
  32. package/dist/chunk-MWEBCWVD.mjs.br +0 -0
  33. package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
  34. package/dist/{chunk-NQJPPIVH.js → chunk-NFFV3RDS.js} +1632 -1201
  35. package/dist/chunk-NFFV3RDS.js.br +0 -0
  36. package/dist/chunk-NFFV3RDS.js.gz +0 -0
  37. package/dist/{chunk-5BXATG54.js → chunk-OVPJT4EQ.js} +182 -2490
  38. package/dist/chunk-OVPJT4EQ.js.br +0 -0
  39. package/dist/chunk-OVPJT4EQ.js.gz +0 -0
  40. package/dist/{chunk-ATOUVRRQ.js → chunk-RPJ2BIQ7.js} +3 -3
  41. package/dist/chunk-RPJ2BIQ7.js.br +0 -0
  42. package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
  43. package/dist/{chunk-S64T7C4V.mjs → chunk-SQJBFMEX.mjs} +36 -4
  44. package/dist/chunk-SQJBFMEX.mjs.br +0 -0
  45. package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
  46. package/dist/{chunk-K2QU73KB.mjs → chunk-XF3EOHY2.mjs} +10455 -7039
  47. package/dist/chunk-XF3EOHY2.mjs.br +0 -0
  48. package/dist/chunk-XF3EOHY2.mjs.gz +0 -0
  49. package/dist/{chunk-422DF424.mjs → chunk-YWJBD7KV.mjs} +654 -223
  50. package/dist/chunk-YWJBD7KV.mjs.br +0 -0
  51. package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
  52. package/dist/{chunk-FXJOTEPO.mjs → chunk-ZMEYXAC6.mjs} +1 -1
  53. package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
  54. package/dist/chunk-ZMEYXAC6.mjs.gz +0 -0
  55. package/dist/i18n.js +4 -4
  56. package/dist/i18n.js.br +0 -0
  57. package/dist/i18n.js.gz +0 -0
  58. package/dist/i18n.mjs +1 -1
  59. package/dist/i18n.mjs.br +0 -0
  60. package/dist/i18n.mjs.gz +0 -0
  61. package/dist/index.d.ts +535 -17
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +65 -41
  64. package/dist/index.js.br +0 -0
  65. package/dist/index.js.gz +0 -0
  66. package/dist/index.mjs +6 -6
  67. package/dist/index.mjs.br +0 -0
  68. package/dist/index.mjs.gz +0 -0
  69. package/dist/internals.d.ts +645 -47
  70. package/dist/internals.d.ts.map +1 -1
  71. package/dist/internals.js +79 -79
  72. package/dist/internals.js.br +0 -0
  73. package/dist/internals.js.gz +0 -0
  74. package/dist/internals.mjs +4 -4
  75. package/dist/internals.mjs.br +0 -0
  76. package/dist/internals.mjs.gz +0 -0
  77. package/dist/pptx-viewer.css +1 -1
  78. package/dist/pptx-viewer.css.br +0 -0
  79. package/dist/pptx-viewer.css.gz +0 -0
  80. package/dist/{types-DU35aAJK.d.ts → types-TCH6icpi.d.ts} +25 -31
  81. package/dist/types-TCH6icpi.d.ts.map +1 -0
  82. package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +34 -5
  83. package/dist/useViewerBuildingBlocks-BKb0qs1j.d.ts.map +1 -0
  84. package/dist/viewer/index.d.ts +465 -40
  85. package/dist/viewer/index.js +27 -27
  86. package/dist/viewer/index.js.br +0 -0
  87. package/dist/viewer/index.js.gz +0 -0
  88. package/dist/viewer/index.mjs +6 -6
  89. package/dist/viewer/index.mjs.br +0 -0
  90. package/dist/viewer/index.mjs.gz +0 -0
  91. package/package.json +2 -2
  92. package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
  93. package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
  94. package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
  95. package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
  96. package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
  97. package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
  98. package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
  99. package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
  100. package/dist/PowerPointViewer-Du7u4INi.d.ts.map +0 -1
  101. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs +0 -76
  102. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
  103. package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
  104. package/dist/SurfaceChart3DScene-ODQY77SZ.js +0 -78
  105. package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
  106. package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
  107. package/dist/chunk-422DF424.mjs.br +0 -0
  108. package/dist/chunk-422DF424.mjs.gz +0 -0
  109. package/dist/chunk-5BXATG54.js.br +0 -0
  110. package/dist/chunk-5BXATG54.js.gz +0 -0
  111. package/dist/chunk-7JPLVECA.js.br +0 -0
  112. package/dist/chunk-7JPLVECA.js.gz +0 -0
  113. package/dist/chunk-AONFHTTJ.js.br +0 -0
  114. package/dist/chunk-AONFHTTJ.js.gz +0 -0
  115. package/dist/chunk-ATOUVRRQ.js.br +0 -0
  116. package/dist/chunk-ATOUVRRQ.js.gz +0 -0
  117. package/dist/chunk-FXJOTEPO.mjs.br +0 -0
  118. package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
  119. package/dist/chunk-K2QU73KB.mjs.br +0 -0
  120. package/dist/chunk-K2QU73KB.mjs.gz +0 -0
  121. package/dist/chunk-MQHC5TXI.mjs.br +0 -0
  122. package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
  123. package/dist/chunk-NQJPPIVH.js.br +0 -0
  124. package/dist/chunk-NQJPPIVH.js.gz +0 -0
  125. package/dist/chunk-S64T7C4V.mjs.br +0 -0
  126. package/dist/chunk-S64T7C4V.mjs.gz +0 -0
  127. package/dist/chunk-TCGXGD6E.js.br +0 -0
  128. package/dist/chunk-TCGXGD6E.js.gz +0 -0
  129. package/dist/chunk-ZA5JONCW.mjs.br +0 -0
  130. package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
  131. package/dist/types-DU35aAJK.d.ts.map +0 -1
  132. package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkAONFHTTJ_js = require('./chunk-AONFHTTJ.js');
4
- var chunk7JPLVECA_js = require('./chunk-7JPLVECA.js');
3
+ var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
4
+ var chunk7ARD2J6Y_js = require('./chunk-7ARD2J6Y.js');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var React6 = require('react');
@@ -15,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
15
15
 
16
16
  // src/viewer/utils/animation-effects.ts
17
17
  function getAnimationInitialStyle2(preset, nativeAnimation) {
18
- return chunk7JPLVECA_js.getAnimationInitialStyle(preset, nativeAnimation);
18
+ return chunk7ARD2J6Y_js.getAnimationInitialStyle(preset, nativeAnimation);
19
19
  }
20
20
  function cn(...inputs) {
21
21
  return tailwindMerge.twMerge(clsx.clsx(inputs));
@@ -23,7 +23,7 @@ function cn(...inputs) {
23
23
 
24
24
  // src/viewer/utils/clone.ts
25
25
  function cloneHistorySnapshot2(snapshot) {
26
- return chunk7JPLVECA_js.cloneHistorySnapshot(snapshot);
26
+ return chunk7ARD2J6Y_js.cloneHistorySnapshot(snapshot);
27
27
  }
28
28
 
29
29
  // src/viewer/constants/scalar.ts
@@ -44,6 +44,7 @@ var ZOOM_TO_SELECTION_PADDING = 96;
44
44
  var GRID_SIZE = 8;
45
45
  var SLIDE_NAV_THUMBNAIL_WIDTH = 156;
46
46
  var UNGROUPED_SECTION_ID = "__ungrouped__";
47
+ var DEFAULT_SECTION_GROUP_ID = "default";
47
48
 
48
49
  // src/viewer/constants/toolbar.ts
49
50
  var TOOLBAR_SECTIONS = [
@@ -60,7 +61,7 @@ var TOOLBAR_SECTIONS = [
60
61
  { id: "view", labelKey: "pptx.ribbon.tab.view" },
61
62
  { id: "help", labelKey: "pptx.ribbon.tab.help" }
62
63
  ];
63
- var SHORTCUT_REFERENCE_ITEMS = chunk7JPLVECA_js.VIEWER_SHORTCUT_REFERENCE;
64
+ var SHORTCUT_REFERENCE_ITEMS = chunk7ARD2J6Y_js.VIEWER_SHORTCUT_REFERENCE;
64
65
 
65
66
  // src/viewer/constants/theme.ts
66
67
  var THEME_COLOR_SWATCHES = [
@@ -104,7 +105,7 @@ var GLYPH_COMPONENTS = {
104
105
  plus: lu.LuPlus,
105
106
  triangle: lu.LuTriangle
106
107
  };
107
- var SHAPE_PRESETS = chunk7JPLVECA_js.SHAPE_PRESET_DEFS.map(
108
+ var SHAPE_PRESETS = chunk7ARD2J6Y_js.SHAPE_PRESET_DEFS.map(
108
109
  (def) => ({
109
110
  type: def.type,
110
111
  label: def.label,
@@ -263,7 +264,7 @@ function isConnectorOrLineElement(element) {
263
264
  if (element.type === "connector") {
264
265
  return true;
265
266
  }
266
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
267
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
267
268
  return false;
268
269
  }
269
270
  const st = getShapeType(element.shapeType);
@@ -272,7 +273,7 @@ function isConnectorOrLineElement(element) {
272
273
 
273
274
  // src/viewer/utils/image-style.ts
274
275
  function getImageMaskStyle(element) {
275
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
276
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
276
277
  return void 0;
277
278
  }
278
279
  const shapeType = element.shapeType;
@@ -281,7 +282,7 @@ function getImageMaskStyle(element) {
281
282
  }
282
283
  const normalized = shapeType.toLowerCase();
283
284
  if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
284
- const radiusPx = chunk7JPLVECA_js.getRoundRectRadiusPx2(element);
285
+ const radiusPx = chunk7ARD2J6Y_js.getRoundRectRadiusPx2(element);
285
286
  if (radiusPx <= 0.01) {
286
287
  return void 0;
287
288
  }
@@ -293,7 +294,7 @@ function getImageMaskStyle(element) {
293
294
  if (normalized === "can" || normalized === "cylinder") {
294
295
  return { borderRadius: "48% / 12%" };
295
296
  }
296
- const clipPath = chunk7JPLVECA_js.getResolvedShapeClipPath(element);
297
+ const clipPath = chunk7ARD2J6Y_js.getResolvedShapeClipPath(element);
297
298
  if (!clipPath) {
298
299
  return void 0;
299
300
  }
@@ -302,7 +303,7 @@ function getImageMaskStyle(element) {
302
303
  function getImageRenderStyle(element) {
303
304
  return {
304
305
  ...getImageMaskStyle(element) || {},
305
- ...chunk7JPLVECA_js.getImageFitStyle(element)
306
+ ...chunk7ARD2J6Y_js.getImageFitStyle(element)
306
307
  };
307
308
  }
308
309
  var CROP_SHAPE_CLIP_PATHS = {
@@ -315,7 +316,7 @@ var CROP_SHAPE_CLIP_PATHS = {
315
316
  star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
316
317
  };
317
318
  function getCropShapeClipPath(element) {
318
- if (!chunk7JPLVECA_js.isImageLikeElement(element)) {
319
+ if (!chunk7ARD2J6Y_js.isImageLikeElement(element)) {
319
320
  return void 0;
320
321
  }
321
322
  const shape = element.cropShape;
@@ -325,7 +326,7 @@ function getCropShapeClipPath(element) {
325
326
  return CROP_SHAPE_CLIP_PATHS[shape];
326
327
  }
327
328
  function getImageTilingStyle2(element) {
328
- return chunk7JPLVECA_js.getImageTilingStyle(element);
329
+ return chunk7ARD2J6Y_js.getImageTilingStyle(element);
329
330
  }
330
331
 
331
332
  // src/viewer/utils/geometry-image.ts
@@ -525,9 +526,9 @@ function registerMediaElement(elementId, el) {
525
526
  };
526
527
  }
527
528
  function executeMediaCommand(command, frameRoot) {
528
- return chunk7JPLVECA_js.runMediaCommand(
529
+ return chunk7ARD2J6Y_js.runMediaCommand(
529
530
  command,
530
- (targetId) => registry.get(targetId) ?? chunk7JPLVECA_js.findMediaElementByElementId(targetId, frameRoot?.())
531
+ (targetId) => registry.get(targetId) ?? chunk7ARD2J6Y_js.findMediaElementByElementId(targetId, frameRoot?.())
531
532
  );
532
533
  }
533
534
  function PresentationMediaController({
@@ -571,7 +572,7 @@ function PresentationMediaController({
571
572
  loop: shouldLoop,
572
573
  volume: playbackVolume,
573
574
  playbackRate
574
- } = chunk7JPLVECA_js.mediaPlaybackAttributes({
575
+ } = chunk7ARD2J6Y_js.mediaPlaybackAttributes({
575
576
  loop: element.loop,
576
577
  volume: element.volume,
577
578
  playbackSpeed: element.playbackSpeed
@@ -707,7 +708,7 @@ function PresentationMediaController({
707
708
  if (element.playAcrossSlides && element.mediaType === "audio") {
708
709
  const dataUrl = element.mediaData ?? resolvedDataUrl;
709
710
  if (dataUrl) {
710
- chunk7JPLVECA_js.registerPersistentAudio(
711
+ chunk7ARD2J6Y_js.registerPersistentAudio(
711
712
  element.id,
712
713
  dataUrl,
713
714
  element.mediaMimeType,
@@ -769,7 +770,7 @@ function PresentationMediaController({
769
770
  ] });
770
771
  }
771
772
  function label(key) {
772
- return key === void 0 ? void 0 : chunkAONFHTTJ_js.translationsEn[key];
773
+ return key === void 0 ? void 0 : chunkMVKRI3CZ_js.translationsEn[key];
773
774
  }
774
775
  function FallbackIcon({
775
776
  paths,
@@ -805,17 +806,17 @@ function Badge({
805
806
  "div",
806
807
  {
807
808
  className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
808
- ...{ [chunk7JPLVECA_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
809
+ ...{ [chunk7ARD2J6Y_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
809
810
  children: [
810
811
  /* @__PURE__ */ jsxRuntime.jsx(
811
812
  FallbackIcon,
812
813
  {
813
- paths: chunk7JPLVECA_js.mediaFallbackIcon(visual, element.mediaType),
814
+ paths: chunk7ARD2J6Y_js.mediaFallbackIcon(visual, element.mediaType),
814
815
  size: isMissing ? 32 : 48,
815
816
  className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
816
817
  }
817
818
  ),
818
- isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunk7JPLVECA_js.mediaFallbackLabelKey(visual, element.mediaType)) })
819
+ isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunk7ARD2J6Y_js.mediaFallbackLabelKey(visual, element.mediaType)) })
819
820
  ]
820
821
  }
821
822
  );
@@ -832,17 +833,17 @@ function Placeholder({
832
833
  "div",
833
834
  {
834
835
  className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
835
- ...{ [chunk7JPLVECA_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
836
+ ...{ [chunk7ARD2J6Y_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
836
837
  children: [
837
838
  /* @__PURE__ */ jsxRuntime.jsx(
838
839
  FallbackIcon,
839
840
  {
840
- paths: chunk7JPLVECA_js.mediaFallbackIcon(visual, element.mediaType),
841
+ paths: chunk7ARD2J6Y_js.mediaFallbackIcon(visual, element.mediaType),
841
842
  size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
842
843
  className: isMissing ? "text-white/50" : "text-white/70"
843
844
  }
844
845
  ),
845
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunk7JPLVECA_js.mediaFallbackLabelKey(visual, element.mediaType)) })
846
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunk7ARD2J6Y_js.mediaFallbackLabelKey(visual, element.mediaType)) })
846
847
  ]
847
848
  }
848
849
  );
@@ -852,7 +853,7 @@ function renderMediaFallback({
852
853
  posterUrl,
853
854
  surface
854
855
  }) {
855
- const visual = chunk7JPLVECA_js.mediaFallbackVisual(surface, {
856
+ const visual = chunk7ARD2J6Y_js.mediaFallbackVisual(surface, {
856
857
  hasPoster: Boolean(posterUrl),
857
858
  missing: element.mediaMissing === true
858
859
  });
@@ -862,7 +863,7 @@ function renderMediaFallback({
862
863
  "img",
863
864
  {
864
865
  src: posterUrl,
865
- alt: visual.dimPoster ? chunkAONFHTTJ_js.translationsEn["pptx.media.posterAlt"] : chunkAONFHTTJ_js.translationsEn["pptx.media.videoPosterAlt"],
866
+ alt: visual.dimPoster ? chunkMVKRI3CZ_js.translationsEn["pptx.media.posterAlt"] : chunkMVKRI3CZ_js.translationsEn["pptx.media.videoPosterAlt"],
866
867
  className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
867
868
  }
868
869
  ),
@@ -873,7 +874,7 @@ function renderMediaFallback({
873
874
  }
874
875
  function renderMediaElement(element, mediaDataUrls, options) {
875
876
  if (element.type !== "media") {
876
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.media.title"] });
877
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.media.title"] });
877
878
  }
878
879
  const mediaType = element.mediaType;
879
880
  const mediaPath = element.mediaPath;
@@ -881,7 +882,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
881
882
  const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
882
883
  const trimFragment = buildTrimFragment(element);
883
884
  const posterUrl = element.posterFrameData ?? void 0;
884
- const shouldLoop = chunk7JPLVECA_js.mediaPlaybackAttributes(element).loop;
885
+ const shouldLoop = chunk7ARD2J6Y_js.mediaPlaybackAttributes(element).loop;
885
886
  const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
886
887
  const isFullScreen = options?.fullScreen === true;
887
888
  const isPresentationMode = options?.isPresentationMode === true;
@@ -959,86 +960,33 @@ function renderMediaElement(element, mediaDataUrls, options) {
959
960
  if (surface.presenting || surface.preview) {
960
961
  return null;
961
962
  }
962
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.media.title"] });
963
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.media.title"] });
963
964
  }
964
965
 
965
966
  // src/viewer/utils/text-utils.tsx
966
967
  function getTextStyleForElement(element, fallbackColor) {
967
- return chunk7JPLVECA_js.buildTextBlockStyle(element, { fallbackColor });
968
+ return chunk7ARD2J6Y_js.buildTextBlockStyle(element, { fallbackColor });
968
969
  }
969
970
 
970
971
  // src/viewer/utils/text-layout.tsx
971
- function computeTabSize(tabStops, defaultTabSize) {
972
- const fromDefault = typeof defaultTabSize === "number" && defaultTabSize > 0 ? `${Math.round(defaultTabSize)}px` : void 0;
973
- if (!tabStops || tabStops.length === 0) {
974
- return fromDefault;
975
- }
976
- if (tabStops.length === 1) {
977
- const pos = tabStops[0].position;
978
- return typeof pos === "number" && pos > 0 ? `${Math.round(pos)}px` : fromDefault;
979
- }
980
- const positions = tabStops.map((t) => t.position).filter((p) => typeof p === "number" && p > 0).sort((a, b) => a - b);
981
- if (positions.length < 2) {
982
- return positions.length === 1 ? `${Math.round(positions[0])}px` : fromDefault;
983
- }
984
- let totalGap = 0;
985
- for (let i = 1; i < positions.length; i++) {
986
- totalGap += positions[i] - positions[i - 1];
987
- }
988
- const avgGap = totalGap / (positions.length - 1);
989
- return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
990
- }
991
972
  function getTextLayoutStyle(element) {
992
- if (!chunk7JPLVECA_js.hasTextProperties(element)) {
973
+ if (!chunk7ARD2J6Y_js.hasTextProperties(element)) {
993
974
  return {};
994
975
  }
995
- const verticalAlign = element.textStyle?.vAlign || "top";
996
- const writingMode = chunk7JPLVECA_js.toCssWritingMode(element.textStyle?.textDirection);
997
- const textOrientation = chunk7JPLVECA_js.toCssTextOrientation(element.textStyle?.textDirection);
998
- const verticalDirection = chunk7JPLVECA_js.toCssVerticalDirection(element.textStyle?.textDirection);
999
- const parsedColumnCount = Number(element.textStyle?.columnCount);
1000
- const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
1001
- const hasColumns = columnCount > 1;
1002
- const justifyContent = verticalAlign === "middle" ? "center" : verticalAlign === "bottom" ? "flex-end" : "flex-start";
1003
- const tabStops = element.textStyle?.tabStops;
1004
- const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
976
+ const writingMode = chunk7ARD2J6Y_js.toCssWritingMode(element.textStyle?.textDirection);
977
+ const textOrientation = chunk7ARD2J6Y_js.toCssTextOrientation(element.textStyle?.textDirection);
978
+ const verticalDirection = chunk7ARD2J6Y_js.toCssVerticalDirection(element.textStyle?.textDirection);
1005
979
  const textWrapNone = element.textStyle?.textWrap === "none";
1006
- const hasParagraphIndents = chunk7JPLVECA_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
980
+ const hasParagraphIndents = chunk7ARD2J6Y_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
1007
981
  const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
1008
982
  const paragraphIndent = element.textStyle?.paragraphIndent;
1009
983
  const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
1010
984
  const textIndent = !hasParagraphIndents && typeof paragraphIndent === "number" && paragraphIndent !== 0 ? paragraphIndent : void 0;
1011
985
  const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
1012
986
  const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
1013
- const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
1014
- const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
1015
- const kinsokuStyles = chunk7JPLVECA_js.getKinsokuLineBreakStyles(element.textStyle);
1016
- if (hasColumns) {
1017
- return {
1018
- display: "block",
1019
- columnCount,
1020
- columnGap,
1021
- // Body inset only. Paragraph spacing (spcBef/spcAft) is applied
1022
- // per-paragraph by the paragraph renderer, not collapsed here.
1023
- paddingTop: bodyTop,
1024
- paddingBottom: bodyBottom,
1025
- writingMode,
1026
- textOrientation,
1027
- direction: verticalDirection,
1028
- tabSize,
1029
- marginLeft,
1030
- textIndent,
1031
- ...kinsokuStyles,
1032
- ...textWrapNone ? {
1033
- whiteSpace: "nowrap",
1034
- overflow: "visible"
1035
- } : {}
1036
- };
1037
- }
1038
987
  return {
1039
- display: "flex",
1040
- flexDirection: "column",
1041
- justifyContent,
988
+ // Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
989
+ ...chunk7ARD2J6Y_js.buildTextBodyLayoutStyle(element),
1042
990
  // Body inset only. Paragraph spacing (spcBef/spcAft) is applied
1043
991
  // per-paragraph by the paragraph renderer, not collapsed here.
1044
992
  paddingTop: bodyTop,
@@ -1046,10 +994,8 @@ function getTextLayoutStyle(element) {
1046
994
  writingMode,
1047
995
  textOrientation,
1048
996
  direction: verticalDirection,
1049
- tabSize,
1050
997
  marginLeft,
1051
998
  textIndent,
1052
- ...kinsokuStyles,
1053
999
  ...textWrapNone ? {
1054
1000
  whiteSpace: "nowrap",
1055
1001
  overflow: "visible"
@@ -1059,7 +1005,7 @@ function getTextLayoutStyle(element) {
1059
1005
 
1060
1006
  // src/viewer/utils/text-effects.tsx
1061
1007
  function buildTextBody3DSceneStyle2(textStyle) {
1062
- return chunk7JPLVECA_js.buildTextBody3DSceneStyle(textStyle);
1008
+ return chunk7ARD2J6Y_js.buildTextBody3DSceneStyle(textStyle);
1063
1009
  }
1064
1010
 
1065
1011
  // src/viewer/utils/text-warp-css.tsx
@@ -1244,13 +1190,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
1244
1190
  if (!subElementAnimStates || subElementAnimStates.size === 0) {
1245
1191
  return renderedSegments;
1246
1192
  }
1247
- const paraKey = `${elementId}${chunk7JPLVECA_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
1193
+ const paraKey = `${elementId}${chunk7ARD2J6Y_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
1248
1194
  const paraState = subElementAnimStates.get(paraKey);
1249
1195
  if (paraState) {
1250
1196
  const style = buildAnimStyle(paraState);
1251
1197
  return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
1252
1198
  }
1253
- const spec = chunk7JPLVECA_js.buildTextBuildSpec(
1199
+ const spec = chunk7ARD2J6Y_js.buildTextBuildSpec(
1254
1200
  elementId,
1255
1201
  paraIndex,
1256
1202
  paraRuns.map((run) => ({ text: run.text, style: run })),
@@ -1268,7 +1214,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
1268
1214
  "span",
1269
1215
  {
1270
1216
  "data-anim-id": span.animId,
1271
- style: chunk7JPLVECA_js.textBuildSpanStyle(span),
1217
+ style: chunk7ARD2J6Y_js.textBuildSpanStyle(span),
1272
1218
  children: content
1273
1219
  },
1274
1220
  span.animId
@@ -1412,10 +1358,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
1412
1358
  if (!needsScriptFonts || !text) {
1413
1359
  return text;
1414
1360
  }
1415
- const runs = chunk7JPLVECA_js.segmentByScript(text);
1361
+ const runs = chunk7ARD2J6Y_js.segmentByScript(text);
1416
1362
  if (runs.length <= 1) {
1417
1363
  if (runs.length === 1) {
1418
- const font = chunk7JPLVECA_js.resolveFontForScript(runs[0].script, scriptFonts);
1364
+ const font = chunk7ARD2J6Y_js.resolveFontForScript(runs[0].script, scriptFonts);
1419
1365
  if (font && font !== baseFontFamily) {
1420
1366
  return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
1421
1367
  }
@@ -1423,7 +1369,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
1423
1369
  return text;
1424
1370
  }
1425
1371
  return runs.map((run, i) => {
1426
- const font = chunk7JPLVECA_js.resolveFontForScript(run.script, scriptFonts);
1372
+ const font = chunk7ARD2J6Y_js.resolveFontForScript(run.script, scriptFonts);
1427
1373
  if (!font || font === baseFontFamily) {
1428
1374
  return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
1429
1375
  }
@@ -1434,14 +1380,14 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
1434
1380
  if (!metric || !text) {
1435
1381
  return inner(text, keyPrefix);
1436
1382
  }
1437
- const pieces = chunk7JPLVECA_js.splitRunForMetrics(text, metric.font);
1383
+ const pieces = chunk7ARD2J6Y_js.splitRunForMetrics(text, metric.font);
1438
1384
  if (pieces.length <= 1) {
1439
1385
  return inner(text, keyPrefix);
1440
1386
  }
1441
1387
  return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
1442
1388
  "span",
1443
1389
  {
1444
- style: { letterSpacing: chunk7JPLVECA_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
1390
+ style: { letterSpacing: chunk7ARD2J6Y_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
1445
1391
  children: inner(piece.text, `${keyPrefix}-w${i}`)
1446
1392
  },
1447
1393
  `${keyPrefix}-w${i}`
@@ -1512,8 +1458,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
1512
1458
  });
1513
1459
  }
1514
1460
  function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
1515
- const mathml = chunk7JPLVECA_js.convertOmmlToMathMl(equationXml);
1516
- const safeMathml = mathml ? chunk7JPLVECA_js.sanitizeMathMl(mathml) : "";
1461
+ const mathml = chunk7ARD2J6Y_js.convertOmmlToMathMl(equationXml);
1462
+ const safeMathml = mathml ? chunk7ARD2J6Y_js.sanitizeMathMl(mathml) : "";
1517
1463
  const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
1518
1464
  "span",
1519
1465
  {
@@ -1523,7 +1469,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
1523
1469
  },
1524
1470
  dangerouslySetInnerHTML: { __html: safeMathml }
1525
1471
  }
1526
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkAONFHTTJ_js.translationsEn["pptx.textSegment.equationFallback"] });
1472
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkMVKRI3CZ_js.translationsEn["pptx.textSegment.equationFallback"] });
1527
1473
  if (equationNumber) {
1528
1474
  return /* @__PURE__ */ jsxRuntime.jsxs(
1529
1475
  "span",
@@ -1573,7 +1519,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1573
1519
  const segmentStyle = segment?.style ?? {};
1574
1520
  const textValue = run.text;
1575
1521
  const lines = textValue.split("\n");
1576
- const resolvedSegmentColor = chunk7JPLVECA_js.normalizeHexColor(
1522
+ const resolvedSegmentColor = chunk7ARD2J6Y_js.normalizeHexColor(
1577
1523
  segmentStyle.color || element.textStyle?.color,
1578
1524
  run.hyperlink ? HYPERLINK_COLOR : fallbackColor
1579
1525
  );
@@ -1581,16 +1527,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1581
1527
  const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
1582
1528
  const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
1583
1529
  const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
1584
- const baseFontSize = rawFontSize * chunk7JPLVECA_js.resolveAutoFitFontScale(element.textStyle);
1530
+ const baseFontSize = rawFontSize * chunk7ARD2J6Y_js.resolveAutoFitFontScale(element.textStyle);
1585
1531
  const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
1586
1532
  const baseFontSizePt = baseFontSize * (72 / 96);
1587
1533
  const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
1588
1534
  const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
1589
- const baseFontFamily = rawFontFamily ? chunk7JPLVECA_js.getSubstituteFontFamily(
1535
+ const baseFontFamily = rawFontFamily ? chunk7ARD2J6Y_js.getSubstituteFontFamily(
1590
1536
  rawFontFamily,
1591
- chunk7JPLVECA_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
1537
+ chunk7ARD2J6Y_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
1592
1538
  ) : DEFAULT_FONT_FAMILY2;
1593
- const scriptFont = (name, panose) => name ? chunk7JPLVECA_js.getSubstituteFontFamily(name, chunk7JPLVECA_js.parsePanoseString(panose)) : baseFontFamily;
1539
+ const scriptFont = (name, panose) => name ? chunk7ARD2J6Y_js.getSubstituteFontFamily(name, chunk7ARD2J6Y_js.parsePanoseString(panose)) : baseFontFamily;
1594
1540
  const scriptFonts = {
1595
1541
  latin: baseFontFamily,
1596
1542
  eastAsia: scriptFont(
@@ -1606,7 +1552,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1606
1552
  segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
1607
1553
  )
1608
1554
  };
1609
- const needsScriptFonts = chunk7JPLVECA_js.hasDistinctScriptFonts(scriptFonts);
1555
+ const needsScriptFonts = chunk7ARD2J6Y_js.hasDistinctScriptFonts(scriptFonts);
1610
1556
  const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
1611
1557
  const metricFont = {
1612
1558
  fontFamily: baseFontFamily,
@@ -1621,9 +1567,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1621
1567
  spanStyle.fontFamily = baseFontFamily;
1622
1568
  spanStyle.verticalAlign = baselineShift;
1623
1569
  spanStyle.fontKerning = fontKerning;
1624
- spanStyle.letterSpacing = chunk7JPLVECA_js.pieceLetterSpacing(
1570
+ spanStyle.letterSpacing = chunk7ARD2J6Y_js.pieceLetterSpacing(
1625
1571
  authoredLetterSpacing,
1626
- chunk7JPLVECA_js.resolveMetricTrackingPx(textValue, metricFont)
1572
+ chunk7ARD2J6Y_js.resolveMetricTrackingPx(textValue, metricFont)
1627
1573
  );
1628
1574
  const runRtl = segmentStyle.rtl;
1629
1575
  if (runRtl !== void 0) {
@@ -1649,26 +1595,17 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1649
1595
  ),
1650
1596
  metricContext
1651
1597
  );
1652
- const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(segment, baseContent, baseFontSize, baseFontFamily, resolvedSegmentColor) }, key);
1598
+ const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
1653
1599
  return run.hyperlink && onHyperlinkClick ? renderHyperlink(run, spanNode, key, ctx) : spanNode;
1654
1600
  }
1655
- function renderRubyOrText(segment, baseContent, baseFontSize, baseFontFamily, resolvedColor) {
1656
- const rubyText = segment?.rubyText;
1657
- if (typeof rubyText !== "string" || rubyText.length === 0) {
1601
+ function renderRubyOrText(run, baseContent) {
1602
+ if (!run.ruby) {
1658
1603
  return baseContent;
1659
1604
  }
1660
- const rubyStyle = {
1661
- fontSize: segment?.rubyFontSize ?? baseFontSize * 0.5,
1662
- fontFamily: segment?.rubyStyle?.fontFamily ?? baseFontFamily,
1663
- textAlign: segment?.rubyAlignment === "l" ? "left" : segment?.rubyAlignment === "r" ? "right" : segment?.rubyAlignment === "dist" || segment?.rubyAlignment === "distCat" || segment?.rubyAlignment === "distLetter" ? "justify" : "center"
1664
- };
1665
- if (segment?.rubyStyle?.color) {
1666
- rubyStyle.color = chunk7JPLVECA_js.normalizeHexColor(segment.rubyStyle.color, resolvedColor);
1667
- }
1668
1605
  return /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
1669
1606
  baseContent,
1670
1607
  /* @__PURE__ */ jsxRuntime.jsx("rp", { children: "(" }),
1671
- /* @__PURE__ */ jsxRuntime.jsx("rt", { style: rubyStyle, children: rubyText }),
1608
+ /* @__PURE__ */ jsxRuntime.jsx("rt", { style: run.ruby.style, children: run.ruby.text }),
1672
1609
  /* @__PURE__ */ jsxRuntime.jsx("rp", { children: ")" })
1673
1610
  ] });
1674
1611
  }
@@ -1724,7 +1661,7 @@ function renderHyperlink(run, spanNode, key, ctx) {
1724
1661
  );
1725
1662
  }
1726
1663
  function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
1727
- if (!chunk7JPLVECA_js.hasTextProperties(element)) {
1664
+ if (!chunk7ARD2J6Y_js.hasTextProperties(element)) {
1728
1665
  return emptyFallback || null;
1729
1666
  }
1730
1667
  const segments = segmentOverrides ?? element.textSegments;
@@ -1734,7 +1671,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
1734
1671
  }
1735
1672
  return element.text || emptyFallback || "";
1736
1673
  }
1737
- const paragraphs = chunk7JPLVECA_js.buildParagraphs(element, fieldContext, segmentOverrides);
1674
+ const paragraphs = chunk7ARD2J6Y_js.buildParagraphs(element, fieldContext, segmentOverrides);
1738
1675
  const ctx = {
1739
1676
  element,
1740
1677
  fallbackColor,
@@ -1867,13 +1804,13 @@ function hexToRgbUnit(hex) {
1867
1804
  };
1868
1805
  }
1869
1806
  function getDuotoneColors(element) {
1870
- if (!chunk7JPLVECA_js.isImageLikeElement(element)) {
1807
+ if (!chunk7ARD2J6Y_js.isImageLikeElement(element)) {
1871
1808
  return void 0;
1872
1809
  }
1873
1810
  return element.imageEffects?.duotone;
1874
1811
  }
1875
1812
  function buildLineShadowCss(element) {
1876
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
1813
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
1877
1814
  return void 0;
1878
1815
  }
1879
1816
  const ss = element.shapeStyle;
@@ -1884,13 +1821,13 @@ function buildLineShadowCss(element) {
1884
1821
  const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
1885
1822
  const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
1886
1823
  const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
1887
- return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk7JPLVECA_js.colorWithOpacity(
1888
- chunk7JPLVECA_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
1824
+ return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk7ARD2J6Y_js.colorWithOpacity(
1825
+ chunk7ARD2J6Y_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
1889
1826
  opacity
1890
1827
  )}`;
1891
1828
  }
1892
1829
  function buildLineGlowFilter(element) {
1893
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
1830
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
1894
1831
  return void 0;
1895
1832
  }
1896
1833
  const ss = element.shapeStyle;
@@ -1899,14 +1836,14 @@ function buildLineGlowFilter(element) {
1899
1836
  }
1900
1837
  const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
1901
1838
  const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
1902
- const glowCol = chunk7JPLVECA_js.colorWithOpacity(chunk7JPLVECA_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
1839
+ const glowCol = chunk7ARD2J6Y_js.colorWithOpacity(chunk7ARD2J6Y_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
1903
1840
  return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
1904
1841
  }
1905
1842
  function getDagDuotoneFilterId(elementId) {
1906
1843
  return `dag-duotone-${elementId}`;
1907
1844
  }
1908
1845
  function hasDagDuotoneEffect(element) {
1909
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
1846
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
1910
1847
  return false;
1911
1848
  }
1912
1849
  return Boolean(element.shapeStyle?.dagDuotone);
@@ -1958,7 +1895,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
1958
1895
 
1959
1896
  // src/viewer/utils/shape-visual-3d.ts
1960
1897
  function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
1961
- return chunk7JPLVECA_js.build3DExtrusionData(
1898
+ return chunk7ARD2J6Y_js.build3DExtrusionData(
1962
1899
  shape3d,
1963
1900
  scene3d,
1964
1901
  fillColor,
@@ -1967,7 +1904,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
1967
1904
  );
1968
1905
  }
1969
1906
  function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
1970
- chunk7JPLVECA_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
1907
+ chunk7ARD2J6Y_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
1971
1908
  }
1972
1909
 
1973
1910
  // src/viewer/utils/shape-visual-style.ts
@@ -1975,13 +1912,13 @@ function rendersCustomVectorPath(element) {
1975
1912
  return (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
1976
1913
  }
1977
1914
  function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
1978
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
1915
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
1979
1916
  return {};
1980
1917
  }
1981
1918
  const ss = element.shapeStyle;
1982
- const fill = animatesFill ? void 0 : chunk7JPLVECA_js.getComputedFillStyle(element, parentGroupFill);
1983
- const fx = chunk7JPLVECA_js.getComputedEffectStyle(element);
1984
- const stroke = chunk7JPLVECA_js.getComputedStrokeStyle(element);
1919
+ const fill = animatesFill ? void 0 : chunk7ARD2J6Y_js.getComputedFillStyle(element, parentGroupFill);
1920
+ const fx = chunk7ARD2J6Y_js.getComputedEffectStyle(element);
1921
+ const stroke = chunk7ARD2J6Y_js.getComputedStrokeStyle(element);
1985
1922
  const base = {
1986
1923
  // A gradient fill REPLACES the solid fill, it does not sit on top of it;
1987
1924
  // the whole precedence lives in shared's `getComputedFillStyle`.
@@ -2016,7 +1953,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
2016
1953
  strokeLinecap: stroke.strokeLinecap
2017
1954
  };
2018
1955
  apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
2019
- if (rendersCustomVectorPath(element) || chunk7JPLVECA_js.isStrokeOnlyPresetElement(element)) {
1956
+ if (rendersCustomVectorPath(element) || chunk7ARD2J6Y_js.isStrokeOnlyPresetElement(element)) {
2020
1957
  base.backgroundColor = "transparent";
2021
1958
  base.backgroundImage = void 0;
2022
1959
  base.borderWidth = void 0;
@@ -2027,7 +1964,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
2027
1964
  base.backgroundColor = void 0;
2028
1965
  base.backgroundImage = void 0;
2029
1966
  }
2030
- const geometry = chunk7JPLVECA_js.resolveShapeGeometry(element);
1967
+ const geometry = chunk7ARD2J6Y_js.resolveShapeGeometry(element);
2031
1968
  switch (geometry.kind) {
2032
1969
  case "bare":
2033
1970
  return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
@@ -2053,13 +1990,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
2053
1990
  function getConnectorAdjustment(element, key, fallback) {
2054
1991
  const direct = element.shapeAdjustments?.[key];
2055
1992
  if (typeof direct === "number" && Number.isFinite(direct)) {
2056
- return chunk7JPLVECA_js.clampUnitInterval(direct / 1e5);
1993
+ return chunk7ARD2J6Y_js.clampUnitInterval(direct / 1e5);
2057
1994
  }
2058
1995
  const fallbackKey = element.shapeAdjustments?.adj;
2059
1996
  if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
2060
- return chunk7JPLVECA_js.clampUnitInterval(fallbackKey / 1e5);
1997
+ return chunk7ARD2J6Y_js.clampUnitInterval(fallbackKey / 1e5);
2061
1998
  }
2062
- return chunk7JPLVECA_js.clampUnitInterval(fallback);
1999
+ return chunk7ARD2J6Y_js.clampUnitInterval(fallback);
2063
2000
  }
2064
2001
  function getConnectorPathGeometry(element) {
2065
2002
  const width = Math.max(element.width, 0);
@@ -2192,7 +2129,7 @@ function toHexByte(value) {
2192
2129
  return clamped.toString(16).padStart(2, "0");
2193
2130
  }
2194
2131
  function shiftHex(hex, factor, towardsWhite) {
2195
- const channels = chunk7JPLVECA_js.hexToRgbChannels(hex);
2132
+ const channels = chunk7ARD2J6Y_js.hexToRgbChannels(hex);
2196
2133
  if (!channels) {
2197
2134
  return hex;
2198
2135
  }
@@ -2218,7 +2155,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
2218
2155
  const fillOff = subpath.fillMode === "none" || !hasFill;
2219
2156
  return {
2220
2157
  d: subpath.d,
2221
- fill: fillOff ? "none" : chunk7JPLVECA_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
2158
+ fill: fillOff ? "none" : chunk7ARD2J6Y_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
2222
2159
  stroked: subpath.stroke !== false
2223
2160
  };
2224
2161
  });
@@ -2234,11 +2171,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
2234
2171
  strokePaint,
2235
2172
  strokeWidth,
2236
2173
  dashArray,
2237
- lineCap: chunk7JPLVECA_js.svgLineCap(shapeStyle?.lineCap),
2174
+ lineCap: chunk7ARD2J6Y_js.svgLineCap(shapeStyle?.lineCap),
2238
2175
  lineJoin,
2239
2176
  miterLimit,
2240
- offsets: chunk7JPLVECA_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
2241
- widths: chunk7JPLVECA_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
2177
+ offsets: chunk7ARD2J6Y_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
2178
+ widths: chunk7ARD2J6Y_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
2242
2179
  };
2243
2180
  }
2244
2181
  function strokeStrands(d, keyBase, ctx) {
@@ -2286,9 +2223,9 @@ function gradientDefs(gradient) {
2286
2223
  }
2287
2224
  function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
2288
2225
  const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
2289
- const subpaths = structuredPaths && structuredPaths.length > 0 ? chunk7JPLVECA_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
2226
+ const subpaths = structuredPaths && structuredPaths.length > 0 ? chunk7ARD2J6Y_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
2290
2227
  const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
2291
- const gradientPaint = gradient ? chunk7JPLVECA_js.svgGradientFillRef(gradient) : void 0;
2228
+ const gradientPaint = gradient ? chunk7ARD2J6Y_js.svgGradientFillRef(gradient) : void 0;
2292
2229
  const nodes = [];
2293
2230
  if (subpaths && needsPerSubpath) {
2294
2231
  const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
@@ -2320,7 +2257,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
2320
2257
  "path",
2321
2258
  {
2322
2259
  d: pathData,
2323
- fill: animatesFill ? "inherit" : gradientPaint ?? chunk7JPLVECA_js.colorWithOpacity(fillColor, fillOpacity),
2260
+ fill: animatesFill ? "inherit" : gradientPaint ?? chunk7ARD2J6Y_js.colorWithOpacity(fillColor, fillOpacity),
2324
2261
  stroke: "none",
2325
2262
  vectorEffect: "non-scaling-stroke"
2326
2263
  },
@@ -2346,14 +2283,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
2346
2283
  );
2347
2284
  }
2348
2285
  function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
2349
- if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
2286
+ if (!chunk7ARD2J6Y_js.hasShapeProperties(element)) {
2350
2287
  return null;
2351
2288
  }
2352
2289
  const normalizedType = (element.shapeType || "").toLowerCase();
2353
- const fillPaint = animatesFill ? "inherit" : chunk7JPLVECA_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
2354
- const strokePaint = animatesStroke ? "inherit" : chunk7JPLVECA_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
2355
- const dashType = chunk7JPLVECA_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
2356
- const dashArray = chunk7JPLVECA_js.getSvgStrokeDasharray(
2290
+ const fillPaint = animatesFill ? "inherit" : chunk7ARD2J6Y_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
2291
+ const strokePaint = animatesStroke ? "inherit" : chunk7ARD2J6Y_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
2292
+ const dashType = chunk7ARD2J6Y_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
2293
+ const dashArray = chunk7ARD2J6Y_js.getSvgStrokeDasharray(
2357
2294
  dashType,
2358
2295
  Math.max(strokeWidth, 1),
2359
2296
  element.shapeStyle?.customDashSegments
@@ -2434,21 +2371,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
2434
2371
  // container's `background-image` is suppressed for custom geometry, so
2435
2372
  // without this the shape fell back to the parser's representative solid
2436
2373
  // and lost every fade (issue #132).
2437
- chunk7JPLVECA_js.buildSvgGradientDef(element.shapeStyle, element.id)
2374
+ chunk7ARD2J6Y_js.buildSvgGradientDef(element.shapeStyle, element.id)
2438
2375
  );
2439
2376
  }
2440
- if (chunk7JPLVECA_js.isCalloutShape(normalizedType)) {
2377
+ if (chunk7ARD2J6Y_js.isCalloutShape(normalizedType)) {
2441
2378
  const width = Math.max(element.width, 1);
2442
2379
  const height = Math.max(element.height, 1);
2443
- const geometry = chunk7JPLVECA_js.getCalloutLeaderLineGeometry(
2380
+ const geometry = chunk7ARD2J6Y_js.getCalloutLeaderLineGeometry(
2444
2381
  normalizedType,
2445
2382
  width,
2446
2383
  height,
2447
2384
  element.shapeAdjustments
2448
2385
  );
2449
2386
  if (geometry && geometry.points.length >= 2) {
2450
- const leaderPath = chunk7JPLVECA_js.buildCalloutLeaderLineSvgPath(geometry);
2451
- const bounds = chunk7JPLVECA_js.getCalloutViewBoxBounds(width, height, geometry);
2387
+ const leaderPath = chunk7ARD2J6Y_js.buildCalloutLeaderLineSvgPath(geometry);
2388
+ const bounds = chunk7ARD2J6Y_js.getCalloutViewBoxBounds(width, height, geometry);
2452
2389
  const lineStroke = Math.max(strokeWidth, 1);
2453
2390
  const offsetLeft = bounds.minX;
2454
2391
  const offsetTop = bounds.minY;
@@ -2511,10 +2448,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
2511
2448
  const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
2512
2449
  const endArrowL = element.shapeStyle?.connectorEndArrowLength;
2513
2450
  const compoundLine = element.shapeStyle?.compoundLine;
2514
- const connectorLineCap = chunk7JPLVECA_js.svgLineCap(element.shapeStyle?.lineCap);
2451
+ const connectorLineCap = chunk7ARD2J6Y_js.svgLineCap(element.shapeStyle?.lineCap);
2515
2452
  const hitTargetWidth = Math.max(strokeWidth * 3, 12);
2516
- const offsets = chunk7JPLVECA_js.getCompoundLineOffsets(compoundLine, strokeWidth);
2517
- const widths = chunk7JPLVECA_js.getCompoundLineWidths(compoundLine, strokeWidth);
2453
+ const offsets = chunk7ARD2J6Y_js.getCompoundLineOffsets(compoundLine, strokeWidth);
2454
+ const widths = chunk7ARD2J6Y_js.getCompoundLineWidths(compoundLine, strokeWidth);
2518
2455
  return /* @__PURE__ */ jsxRuntime.jsxs(
2519
2456
  "svg",
2520
2457
  {
@@ -2581,15 +2518,15 @@ function parseGradientFillCss(gradFill) {
2581
2518
  }
2582
2519
  const parsed = stops.map((gs) => {
2583
2520
  const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
2584
- const color = chunk7JPLVECA_js.parseDrawingColor(gs) ?? "#888888";
2585
- const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(gs);
2586
- return { pos, color: chunk7JPLVECA_js.colorWithOpacity(color, opacity) };
2521
+ const color = chunk7ARD2J6Y_js.parseDrawingColor(gs) ?? "#888888";
2522
+ const opacity = chunk7ARD2J6Y_js.parseDrawingColorOpacity(gs);
2523
+ return { pos, color: chunk7ARD2J6Y_js.colorWithOpacity(color, opacity) };
2587
2524
  }).sort((a, b) => a.pos - b.pos);
2588
2525
  const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
2589
2526
  const lin = gradFill["a:lin"];
2590
2527
  if (lin) {
2591
2528
  const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
2592
- const angleDeg = Math.round(chunk7JPLVECA_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
2529
+ const angleDeg = Math.round(chunk7ARD2J6Y_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
2593
2530
  return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
2594
2531
  }
2595
2532
  const path = gradFill["a:path"];
@@ -2624,8 +2561,8 @@ function parsePatternFillCss(pattFill) {
2624
2561
  if (!pattFill) {
2625
2562
  return void 0;
2626
2563
  }
2627
- const fgColor = chunk7JPLVECA_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
2628
- const bgColor = chunk7JPLVECA_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
2564
+ const fgColor = chunk7ARD2J6Y_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
2565
+ const bgColor = chunk7ARD2J6Y_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
2629
2566
  const preset = String(pattFill["@_prst"] || "ltDnDiag");
2630
2567
  switch (preset) {
2631
2568
  case "ltHorz":
@@ -2736,11 +2673,11 @@ function parseCellBorders(cellProperties) {
2736
2673
  const prstDash = ln["a:prstDash"];
2737
2674
  const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
2738
2675
  const cssBorderStyle = ooxmlDashToCss(dashVal);
2739
- const color = chunk7JPLVECA_js.parseDrawingColor(ln["a:solidFill"]);
2676
+ const color = chunk7ARD2J6Y_js.parseDrawingColor(ln["a:solidFill"]);
2740
2677
  if (color) {
2741
- const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(ln["a:solidFill"]);
2678
+ const opacity = chunk7ARD2J6Y_js.parseDrawingColorOpacity(ln["a:solidFill"]);
2742
2679
  const key = `${edge.prefix}`;
2743
- borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk7JPLVECA_js.colorWithOpacity(color, opacity)}`;
2680
+ borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk7ARD2J6Y_js.colorWithOpacity(color, opacity)}`;
2744
2681
  }
2745
2682
  }
2746
2683
  return borderStyle;
@@ -2753,7 +2690,7 @@ function parseCellTextEffects(runProps) {
2753
2690
  const textShadowParts = [];
2754
2691
  const outerShdw = effectLst["a:outerShdw"];
2755
2692
  if (outerShdw) {
2756
- const shdwColor = chunk7JPLVECA_js.parseDrawingColor(outerShdw);
2693
+ const shdwColor = chunk7ARD2J6Y_js.parseDrawingColor(outerShdw);
2757
2694
  if (shdwColor) {
2758
2695
  const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
2759
2696
  const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
@@ -2771,7 +2708,7 @@ function parseCellTextEffects(runProps) {
2771
2708
  }
2772
2709
  const glow = effectLst["a:glow"];
2773
2710
  if (glow) {
2774
- const glowColor = chunk7JPLVECA_js.parseDrawingColor(glow);
2711
+ const glowColor = chunk7ARD2J6Y_js.parseDrawingColor(glow);
2775
2712
  if (glowColor) {
2776
2713
  const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
2777
2714
  const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
@@ -2850,10 +2787,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
2850
2787
  if (runProps?.["@_u"] !== void 0) {
2851
2788
  cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
2852
2789
  }
2853
- const runColor = chunk7JPLVECA_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk7JPLVECA_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
2790
+ const runColor = chunk7ARD2J6Y_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk7ARD2J6Y_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
2854
2791
  if (runColor) {
2855
- const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
2856
- cellStyle.color = chunk7JPLVECA_js.colorWithOpacity(runColor, opacity);
2792
+ const opacity = chunk7ARD2J6Y_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
2793
+ cellStyle.color = chunk7ARD2J6Y_js.colorWithOpacity(runColor, opacity);
2857
2794
  }
2858
2795
  const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
2859
2796
  if (fontFamily) {
@@ -2863,15 +2800,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
2863
2800
  cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
2864
2801
  }
2865
2802
  const cellProperties = cellXml["a:tcPr"];
2866
- const cellFill = chunk7JPLVECA_js.parseDrawingColor(
2803
+ const cellFill = chunk7ARD2J6Y_js.parseDrawingColor(
2867
2804
  cellProperties?.["a:solidFill"],
2868
2805
  schemeColorOverrides
2869
2806
  );
2870
2807
  if (cellFill) {
2871
- const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(
2808
+ const opacity = chunk7ARD2J6Y_js.parseDrawingColorOpacity(
2872
2809
  cellProperties?.["a:solidFill"]
2873
2810
  );
2874
- cellStyle.backgroundColor = chunk7JPLVECA_js.colorWithOpacity(cellFill, opacity);
2811
+ cellStyle.backgroundColor = chunk7ARD2J6Y_js.colorWithOpacity(cellFill, opacity);
2875
2812
  } else {
2876
2813
  const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
2877
2814
  if (gradCss) {
@@ -2886,16 +2823,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
2886
2823
  const edgeBorders = parseCellBorders(cellProperties);
2887
2824
  Object.assign(cellStyle, edgeBorders);
2888
2825
  if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
2889
- const borderColor = chunk7JPLVECA_js.parseDrawingColor(
2826
+ const borderColor = chunk7ARD2J6Y_js.parseDrawingColor(
2890
2827
  cellProperties?.["a:lnL"]?.["a:solidFill"],
2891
2828
  schemeColorOverrides
2892
- ) || chunk7JPLVECA_js.parseDrawingColor(
2829
+ ) || chunk7ARD2J6Y_js.parseDrawingColor(
2893
2830
  cellProperties?.["a:lnR"]?.["a:solidFill"],
2894
2831
  schemeColorOverrides
2895
- ) || chunk7JPLVECA_js.parseDrawingColor(
2832
+ ) || chunk7ARD2J6Y_js.parseDrawingColor(
2896
2833
  cellProperties?.["a:lnT"]?.["a:solidFill"],
2897
2834
  schemeColorOverrides
2898
- ) || chunk7JPLVECA_js.parseDrawingColor(
2835
+ ) || chunk7ARD2J6Y_js.parseDrawingColor(
2899
2836
  cellProperties?.["a:lnB"]?.["a:solidFill"],
2900
2837
  schemeColorOverrides
2901
2838
  );
@@ -2967,7 +2904,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
2967
2904
  if (element.type !== "table") {
2968
2905
  return void 0;
2969
2906
  }
2970
- return chunk7JPLVECA_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
2907
+ return chunk7ARD2J6Y_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
2971
2908
  tableStyleMap: styleCtx?.tableStyleMap,
2972
2909
  colorScheme: styleCtx?.theme?.colorScheme,
2973
2910
  fontScheme: styleCtx?.theme?.fontScheme
@@ -3043,7 +2980,7 @@ function renderTableCellContent(cell, fallbackText) {
3043
2980
  return /* @__PURE__ */ jsxRuntime.jsx(
3044
2981
  "span",
3045
2982
  {
3046
- style: { position: "relative", ...chunk7JPLVECA_js.cellRunStyle(run) },
2983
+ style: { position: "relative", ...chunk7ARD2J6Y_js.cellRunStyle(run) },
3047
2984
  children: run.text
3048
2985
  },
3049
2986
  `r-${index}`
@@ -3051,7 +2988,7 @@ function renderTableCellContent(cell, fallbackText) {
3051
2988
  });
3052
2989
  }
3053
2990
  function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
3054
- return chunk7JPLVECA_js.getCellDiagonalBorders(style, tableData, pos, {
2991
+ return chunk7ARD2J6Y_js.getCellDiagonalBorders(style, tableData, pos, {
3055
2992
  tableStyleMap: styleCtx?.tableStyleMap,
3056
2993
  colorScheme: styleCtx?.theme?.colorScheme,
3057
2994
  fontScheme: styleCtx?.theme?.fontScheme
@@ -3184,7 +3121,7 @@ function TableResizeOverlay({
3184
3121
  const containerRef = React6.useRef(null);
3185
3122
  const [rowBounds, setRowBounds] = React6.useState([]);
3186
3123
  const dragRef = React6.useRef(null);
3187
- const colBoundaries = React6.useMemo(() => chunk7JPLVECA_js.computeColumnBoundaries(columnWidths), [columnWidths]);
3124
+ const colBoundaries = React6.useMemo(() => chunk7ARD2J6Y_js.computeColumnBoundaries(columnWidths), [columnWidths]);
3188
3125
  const measureRows = React6.useCallback(() => {
3189
3126
  const container = containerRef.current;
3190
3127
  if (!container) {
@@ -3231,11 +3168,11 @@ function TableResizeOverlay({
3231
3168
  const rect = containerRef.current.getBoundingClientRect();
3232
3169
  if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
3233
3170
  const deltaProp = (e.clientX - drag.startPos) / rect.width;
3234
- onResizeColumns(chunk7JPLVECA_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
3171
+ onResizeColumns(chunk7ARD2J6Y_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
3235
3172
  } else if (drag.type === "row" && onResizeRow) {
3236
3173
  const deltaY = e.clientY - drag.startPos;
3237
- const newHeight = chunk7JPLVECA_js.computeResizedRowHeight(
3238
- drag.initialRowHeight ?? chunk7JPLVECA_js.DEFAULT_ROW_HEIGHT,
3174
+ const newHeight = chunk7ARD2J6Y_js.computeResizedRowHeight(
3175
+ drag.initialRowHeight ?? chunk7ARD2J6Y_js.DEFAULT_ROW_HEIGHT,
3239
3176
  deltaY
3240
3177
  );
3241
3178
  onResizeRow(drag.index, newHeight);
@@ -3273,7 +3210,7 @@ function TableResizeOverlay({
3273
3210
  e.stopPropagation();
3274
3211
  const table = containerRef.current?.querySelector("table");
3275
3212
  const tr = table?.querySelectorAll("tbody > tr")[index];
3276
- const actualHeight = tr?.offsetHeight ?? chunk7JPLVECA_js.DEFAULT_ROW_HEIGHT;
3213
+ const actualHeight = tr?.offsetHeight ?? chunk7ARD2J6Y_js.DEFAULT_ROW_HEIGHT;
3277
3214
  document.body.style.cursor = "row-resize";
3278
3215
  document.body.style.userSelect = "none";
3279
3216
  dragRef.current = {
@@ -3315,13 +3252,25 @@ function renderTableFromTableData(element, textStyle, options) {
3315
3252
  const selectedCell = options?.selectedCell || null;
3316
3253
  const isEditable = Boolean(options?.editable);
3317
3254
  const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
3255
+ const sharedCtx = {
3256
+ tableStyleMap: options?.styleCtx?.tableStyleMap,
3257
+ colorScheme: options?.styleCtx?.theme?.colorScheme,
3258
+ fontScheme: options?.styleCtx?.theme?.fontScheme
3259
+ };
3260
+ const cellCss = (cell, rowIndex, cellIndex) => chunk7ARD2J6Y_js.tableCellCss(
3261
+ tableData,
3262
+ cell,
3263
+ { rowIndex, cellIndex, rowCount, columnCount },
3264
+ sharedCtx,
3265
+ textStyle
3266
+ );
3318
3267
  const selectionRect = (() => {
3319
3268
  if (!selectedCell?.selectedCells || selectedCell.selectedCells.length < 2) {
3320
3269
  return void 0;
3321
3270
  }
3322
3271
  const first = selectedCell.selectedCells[0];
3323
3272
  const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
3324
- return chunk7JPLVECA_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
3273
+ return chunk7ARD2J6Y_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
3325
3274
  })();
3326
3275
  return /* @__PURE__ */ jsxRuntime.jsx(
3327
3276
  TableResizeOverlay,
@@ -3342,9 +3291,9 @@ function renderTableFromTableData(element, textStyle, options) {
3342
3291
  {
3343
3292
  className: "w-full h-full border-collapse table-fixed",
3344
3293
  style: {
3345
- fontFamily: chunk7JPLVECA_js.DEFAULT_FONT_FAMILY,
3294
+ fontFamily: chunk7ARD2J6Y_js.DEFAULT_FONT_FAMILY,
3346
3295
  // `a:tblPr@rtl` mirrors the column order for RTL decks.
3347
- ...chunk7JPLVECA_js.tableContainerCss(tableData)
3296
+ ...chunk7ARD2J6Y_js.tableContainerCss(tableData)
3348
3297
  },
3349
3298
  children: [
3350
3299
  tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -3363,7 +3312,7 @@ function renderTableFromTableData(element, textStyle, options) {
3363
3312
  return null;
3364
3313
  }
3365
3314
  const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
3366
- const isInMultiSelection = chunk7JPLVECA_js.isCellInRect(rowIndex, cellIndex, selectionRect);
3315
+ const isInMultiSelection = chunk7ARD2J6Y_js.isCellInRect(rowIndex, cellIndex, selectionRect);
3367
3316
  const isCellEditing = isCellSelected && selectedCell?.isEditing;
3368
3317
  const diag = getCellDiagonalBorders2(
3369
3318
  cell.style,
@@ -3383,8 +3332,7 @@ function renderTableFromTableData(element, textStyle, options) {
3383
3332
  colSpan: cell.gridSpan && cell.gridSpan > 1 ? cell.gridSpan : void 0,
3384
3333
  rowSpan: cell.rowSpan && cell.rowSpan > 1 ? cell.rowSpan : void 0,
3385
3334
  style: {
3386
- ...textStyle,
3387
- ...chunk7JPLVECA_js.cellStyleToCss(cell.style),
3335
+ ...cellCss(cell, rowIndex, cellIndex),
3388
3336
  ...diag ? { position: "relative" } : void 0
3389
3337
  },
3390
3338
  onClick: (event) => {
@@ -3393,7 +3341,7 @@ function renderTableFromTableData(element, textStyle, options) {
3393
3341
  }
3394
3342
  event.stopPropagation();
3395
3343
  if (event.shiftKey && selectedCell) {
3396
- const rect = chunk7JPLVECA_js.computeSelectionRect(
3344
+ const rect = chunk7ARD2J6Y_js.computeSelectionRect(
3397
3345
  selectedCell.rowIndex,
3398
3346
  selectedCell.columnIndex,
3399
3347
  rowIndex,
@@ -3403,7 +3351,7 @@ function renderTableFromTableData(element, textStyle, options) {
3403
3351
  options?.onSelectCell?.({
3404
3352
  rowIndex: selectedCell.rowIndex,
3405
3353
  columnIndex: selectedCell.columnIndex,
3406
- selectedCells: chunk7JPLVECA_js.rectToCells(rect)
3354
+ selectedCells: chunk7ARD2J6Y_js.rectToCells(rect)
3407
3355
  });
3408
3356
  } else {
3409
3357
  options?.onSelectCell?.({
@@ -3429,10 +3377,7 @@ function renderTableFromTableData(element, textStyle, options) {
3429
3377
  TableCellInput,
3430
3378
  {
3431
3379
  initialText: cell.text ?? "",
3432
- style: {
3433
- ...textStyle,
3434
- ...chunk7JPLVECA_js.cellStyleToCss(cell.style)
3435
- },
3380
+ style: cellCss(cell, rowIndex, cellIndex),
3436
3381
  onCommit: (text) => {
3437
3382
  options?.onCommitCellEdit?.(rowIndex, cellIndex, text);
3438
3383
  },
@@ -3467,7 +3412,7 @@ function renderTableElement(element, textStyle, options) {
3467
3412
  if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
3468
3413
  return renderTableFromTableData(tableEl2, textStyle, options);
3469
3414
  }
3470
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.table.title"] });
3415
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.table.title"] });
3471
3416
  }
3472
3417
  const selectedCell = options?.selectedCell || null;
3473
3418
  const isEditable = Boolean(options?.editable);
@@ -3482,7 +3427,7 @@ function renderTableElement(element, textStyle, options) {
3482
3427
  }
3483
3428
  const first = selectedCell.selectedCells[0];
3484
3429
  const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
3485
- return chunk7JPLVECA_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
3430
+ return chunk7ARD2J6Y_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
3486
3431
  })();
3487
3432
  const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
3488
3433
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3504,9 +3449,9 @@ function renderTableElement(element, textStyle, options) {
3504
3449
  {
3505
3450
  className: "w-full h-full border-collapse table-fixed",
3506
3451
  style: {
3507
- fontFamily: chunk7JPLVECA_js.DEFAULT_FONT_FAMILY,
3452
+ fontFamily: chunk7ARD2J6Y_js.DEFAULT_FONT_FAMILY,
3508
3453
  // `a:tblPr@rtl` mirrors the column order for RTL decks.
3509
- ...chunk7JPLVECA_js.tableContainerCss(tableEl.tableData)
3454
+ ...chunk7ARD2J6Y_js.tableContainerCss(tableEl.tableData)
3510
3455
  },
3511
3456
  children: [
3512
3457
  parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -3558,7 +3503,7 @@ function renderTableElement(element, textStyle, options) {
3558
3503
  const mergedStyle = {
3559
3504
  ...bandStyle,
3560
3505
  ...xmlCellStyle,
3561
- ...tdCellOverride ? chunk7JPLVECA_js.cellStyleToCss(tdCellOverride) : void 0,
3506
+ ...tdCellOverride ? chunk7ARD2J6Y_js.cellStyleToCss(tdCellOverride) : void 0,
3562
3507
  ...diag ? { position: "relative" } : void 0
3563
3508
  };
3564
3509
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3568,7 +3513,7 @@ function renderTableElement(element, textStyle, options) {
3568
3513
  "border px-1 py-0.5 align-top",
3569
3514
  isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
3570
3515
  selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
3571
- chunk7JPLVECA_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
3516
+ chunk7ARD2J6Y_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
3572
3517
  ),
3573
3518
  colSpan,
3574
3519
  rowSpan: rSpan,
@@ -3579,7 +3524,7 @@ function renderTableElement(element, textStyle, options) {
3579
3524
  }
3580
3525
  event.stopPropagation();
3581
3526
  if (event.shiftKey && selectedCell && tableEl.tableData) {
3582
- const rect = chunk7JPLVECA_js.computeSelectionRect(
3527
+ const rect = chunk7ARD2J6Y_js.computeSelectionRect(
3583
3528
  selectedCell.rowIndex,
3584
3529
  selectedCell.columnIndex,
3585
3530
  rowIndex,
@@ -3589,7 +3534,7 @@ function renderTableElement(element, textStyle, options) {
3589
3534
  options?.onSelectCell?.({
3590
3535
  rowIndex: selectedCell.rowIndex,
3591
3536
  columnIndex: selectedCell.columnIndex,
3592
- selectedCells: chunk7JPLVECA_js.rectToCells(rect)
3537
+ selectedCells: chunk7ARD2J6Y_js.rectToCells(rect)
3593
3538
  });
3594
3539
  } else {
3595
3540
  options?.onSelectCell?.({
@@ -3649,24 +3594,24 @@ function renderTableElement(element, textStyle, options) {
3649
3594
  }
3650
3595
  var LEGEND_ITEM_WIDTH = 80;
3651
3596
  function partAttrs(part) {
3652
- return part ? chunk7JPLVECA_js.chartPartToAttrs(part) : void 0;
3597
+ return part ? chunk7ARD2J6Y_js.chartPartToAttrs(part) : void 0;
3653
3598
  }
3654
3599
  function resolveReactPalette(chartData) {
3655
3600
  if (chartData.colorPalette && chartData.colorPalette.length > 0) {
3656
3601
  return chartData.colorPalette;
3657
3602
  }
3658
- return [...chunk7JPLVECA_js.getChartStylePalette(chartData.style?.styleId)];
3603
+ return [...chunk7ARD2J6Y_js.getChartStylePalette(chartData.style?.styleId)];
3659
3604
  }
3660
3605
  function buildReactChartViewModel(element) {
3661
3606
  if (element.type !== "chart" || !element.chartData) {
3662
- return chunk7JPLVECA_js.buildChartViewModel(element);
3607
+ return chunk7ARD2J6Y_js.buildChartViewModel(element);
3663
3608
  }
3664
3609
  const palette = resolveReactPalette(element.chartData);
3665
3610
  const themedElement = {
3666
3611
  ...element,
3667
3612
  chartData: { ...element.chartData, colorPalette: palette }
3668
3613
  };
3669
- return chunk7JPLVECA_js.buildChartViewModel(themedElement);
3614
+ return chunk7ARD2J6Y_js.buildChartViewModel(themedElement);
3670
3615
  }
3671
3616
  function renderPrimitive(prim, key) {
3672
3617
  switch (prim.kind) {
@@ -3697,7 +3642,8 @@ function renderPrimitive(prim, key) {
3697
3642
  stroke: p.stroke ?? "none",
3698
3643
  strokeWidth: p.strokeWidth ?? 0,
3699
3644
  fillOpacity: p.opacity ?? 1,
3700
- ...partAttrs(p.part)
3645
+ ...partAttrs(p.part),
3646
+ children: p.title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("title", { children: p.title }) : null
3701
3647
  },
3702
3648
  key
3703
3649
  );
@@ -3883,2277 +3829,22 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
3883
3829
  }
3884
3830
  );
3885
3831
  }
3886
-
3887
- // src/viewer/utils/chart-area-line.tsx
3888
- function renderAreaChart(element, _chartData, _categoryLabels) {
3889
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
3890
- }
3891
- function renderLineChart(element, _chartData, _categoryLabels) {
3892
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
3893
- }
3894
- function renderBoxWhiskerChart(element, _chartData, _categoryLabels) {
3895
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
3896
- }
3897
- function renderHistogramChart(element, _chartData, _categoryLabels) {
3898
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
3899
- }
3900
- function renderDefaultBarChart(element, _chartData, _categoryLabels) {
3901
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
3902
- }
3903
- var WORLD_REGIONS = [
3904
- // North America
3905
- {
3906
- code: "US",
3907
- name: "United States",
3908
- path: "M130,160 L250,155 265,170 270,190 260,210 230,215 200,220 170,215 145,205 130,195Z M280,175 L295,165 310,170 310,185 295,195 280,190Z",
3909
- labelXY: [200, 190]
3910
- },
3911
- {
3912
- code: "CA",
3913
- name: "Canada",
3914
- path: "M120,90 L280,85 290,100 295,130 280,150 250,155 200,155 160,155 130,155 115,140 110,115Z",
3915
- labelXY: [200, 125]
3916
- },
3917
- {
3918
- code: "MX",
3919
- name: "Mexico",
3920
- path: "M145,215 L200,220 210,235 200,255 185,265 165,260 150,245 140,230Z",
3921
- labelXY: [175, 240]
3922
- },
3923
- // South America
3924
- {
3925
- code: "BR",
3926
- name: "Brazil",
3927
- path: "M270,300 L310,280 335,290 340,320 330,355 310,370 285,365 265,345 260,320Z",
3928
- labelXY: [300, 330]
3929
- },
3930
- {
3931
- code: "AR",
3932
- name: "Argentina",
3933
- path: "M260,370 L280,365 290,380 285,410 275,435 260,445 250,425 248,395Z",
3934
- labelXY: [268, 410]
3935
- },
3936
- // Europe
3937
- {
3938
- code: "GB",
3939
- name: "United Kingdom",
3940
- path: "M440,120 L448,110 455,115 455,135 448,142 440,138Z",
3941
- labelXY: [448, 128]
3942
- },
3943
- {
3944
- code: "FR",
3945
- name: "France",
3946
- path: "M450,145 L470,140 480,150 478,168 465,175 450,170 445,158Z",
3947
- labelXY: [463, 158]
3948
- },
3949
- {
3950
- code: "DE",
3951
- name: "Germany",
3952
- path: "M478,125 L498,120 505,130 502,148 490,152 478,148 475,138Z",
3953
- labelXY: [490, 138]
3954
- },
3955
- {
3956
- code: "IT",
3957
- name: "Italy",
3958
- path: "M490,155 L498,152 505,162 500,180 492,190 488,178 486,165Z",
3959
- labelXY: [495, 172]
3960
- },
3961
- {
3962
- code: "ES",
3963
- name: "Spain",
3964
- path: "M432,168 L460,165 465,175 460,188 442,192 430,185 428,175Z",
3965
- labelXY: [448, 180]
3966
- },
3967
- // Russia spans Europe/Asia
3968
- {
3969
- code: "RU",
3970
- name: "Russia",
3971
- path: "M510,60 L780,50 830,70 840,100 820,120 750,115 700,105 650,100 580,105 530,110 510,100 505,80Z",
3972
- labelXY: [670, 85]
3973
- },
3974
- {
3975
- code: "TR",
3976
- name: "Turkey",
3977
- path: "M530,165 L570,160 585,170 580,182 555,185 530,180Z",
3978
- labelXY: [558, 175]
3979
- },
3980
- // Africa
3981
- {
3982
- code: "EG",
3983
- name: "Egypt",
3984
- path: "M530,200 L555,195 565,205 560,225 545,230 530,222Z",
3985
- labelXY: [548, 215]
3986
- },
3987
- {
3988
- code: "NG",
3989
- name: "Nigeria",
3990
- path: "M475,275 L500,270 510,280 505,298 490,302 475,295Z",
3991
- labelXY: [492, 288]
3992
- },
3993
- {
3994
- code: "ZA",
3995
- name: "South Africa",
3996
- path: "M520,380 L545,370 560,380 555,400 540,410 520,405 515,392Z",
3997
- labelXY: [538, 392]
3998
- },
3999
- // Middle East
4000
- {
4001
- code: "SA",
4002
- name: "Saudi Arabia",
4003
- path: "M565,220 L600,210 615,225 610,250 590,258 570,250 560,238Z",
4004
- labelXY: [590, 238]
4005
- },
4006
- // Asia
4007
- {
4008
- code: "IN",
4009
- name: "India",
4010
- path: "M640,210 L665,195 685,210 688,240 678,268 660,278 645,265 635,240Z",
4011
- labelXY: [662, 240]
4012
- },
4013
- {
4014
- code: "CN",
4015
- name: "China",
4016
- path: "M700,120 L775,115 800,130 805,160 790,180 760,185 730,180 710,168 695,150 690,135Z",
4017
- labelXY: [750, 155]
4018
- },
4019
- {
4020
- code: "JP",
4021
- name: "Japan",
4022
- path: "M835,145 L845,135 852,140 850,158 842,165 835,160Z",
4023
- labelXY: [843, 152]
4024
- },
4025
- {
4026
- code: "KR",
4027
- name: "South Korea",
4028
- path: "M815,158 L825,152 830,160 827,170 818,172 813,165Z",
4029
- labelXY: [822, 163]
4030
- },
4031
- {
4032
- code: "ID",
4033
- name: "Indonesia",
4034
- path: "M740,295 L780,288 810,292 830,298 825,310 790,312 755,308 740,305Z",
4035
- labelXY: [785, 302]
4036
- },
4037
- // Oceania
4038
- {
4039
- code: "AU",
4040
- name: "Australia",
4041
- path: "M790,350 L850,340 880,355 885,385 870,405 840,410 810,400 790,380Z",
4042
- labelXY: [838, 378]
4043
- }
4044
- ];
4045
- function renderMapChart(element, chartData, categoryLabels) {
4046
- const svgWidth = element.width;
4047
- const svgHeight = element.height;
4048
- const categories = categoryLabels.length > 0 ? categoryLabels : chartData.categories;
4049
- const series = chartData.series;
4050
- const values = series.length > 0 ? series[0].values : [];
4051
- const finiteVals = values.filter((v) => Number.isFinite(v));
4052
- const minVal = finiteVals.length > 0 ? Math.min(...finiteVals) : 0;
4053
- const maxVal = finiteVals.length > 0 ? Math.max(...finiteVals) : 1;
4054
- const regionValueMap = /* @__PURE__ */ new Map();
4055
- const unmatchedRows = [];
4056
- categories.forEach((cat, i) => {
4057
- const value = values[i] ?? 0;
4058
- const code = chunk7JPLVECA_js.resolveRegionCode(cat);
4059
- if (code) {
4060
- regionValueMap.set(code, { value, label: cat });
4061
- } else {
4062
- unmatchedRows.push({ label: cat, value });
4063
- }
4064
- });
4065
- const legendHeight = 30;
4066
- const fallbackRowH = 14;
4067
- const fallbackTableH = unmatchedRows.length > 0 ? Math.min(unmatchedRows.length + 1, 6) * fallbackRowH + 8 : 0;
4068
- const titleH = chartData.title ? 22 : 0;
4069
- const mapAreaH = Math.max(svgHeight - titleH - legendHeight - fallbackTableH - 8, 80);
4070
- const mapScale = Math.min((svgWidth - 20) / 1e3, mapAreaH / 500);
4071
- const mapOffsetX = (svgWidth - 1e3 * mapScale) / 2;
4072
- const mapOffsetY = titleH + 4;
4073
- const elements = [];
4074
- if (chartData.title) {
4075
- elements.push(
4076
- /* @__PURE__ */ jsxRuntime.jsx(
4077
- "text",
4078
- {
4079
- x: svgWidth / 2,
4080
- y: 16,
4081
- textAnchor: "middle",
4082
- fontSize: 12,
4083
- fontWeight: 700,
4084
- fill: "#334155",
4085
- children: chartData.title
4086
- },
4087
- `${element.id}-map-title`
4088
- )
4089
- );
3832
+ function renderChartElement(element) {
3833
+ if (element.type !== "chart") {
3834
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.chart.heading"] });
4090
3835
  }
4091
- WORLD_REGIONS.forEach((region) => {
4092
- const entry = regionValueMap.get(region.code);
4093
- let fill = "#e2e8f0";
4094
- let dataLabel = null;
4095
- if (entry) {
4096
- const t = chunk7JPLVECA_js.normalizeValue(entry.value, minVal, maxVal);
4097
- fill = chunk7JPLVECA_js.sequentialColorScale(t);
4098
- dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
4099
- "text",
4100
- {
4101
- x: region.labelXY[0] * mapScale + mapOffsetX,
4102
- y: region.labelXY[1] * mapScale + mapOffsetY + 4,
4103
- textAnchor: "middle",
4104
- fontSize: Math.max(6, 7 * mapScale),
4105
- fontWeight: 600,
4106
- fill: "#1e293b",
4107
- style: { pointerEvents: "none" },
4108
- children: chunk7JPLVECA_js.formatAxisValue(entry.value)
4109
- },
4110
- `${element.id}-map-dl-${region.code}`
4111
- );
4112
- }
4113
- elements.push(
4114
- /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
4115
- /* @__PURE__ */ jsxRuntime.jsx(
4116
- "path",
4117
- {
4118
- d: region.path,
4119
- fill,
4120
- stroke: "#94a3b8",
4121
- strokeWidth: 0.5 / mapScale,
4122
- transform: `translate(${mapOffsetX},${mapOffsetY}) scale(${mapScale})`,
4123
- opacity: 0.9,
4124
- children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
4125
- region.name,
4126
- entry ? `: ${chunk7JPLVECA_js.formatAxisValue(entry.value)}` : ""
4127
- ] })
4128
- }
4129
- ),
4130
- dataLabel
4131
- ] }, `${element.id}-map-g-${region.code}`)
4132
- );
4133
- });
4134
- const legendY = mapOffsetY + mapAreaH + 4;
4135
- const barW = Math.min(svgWidth * 0.4, 160);
4136
- const barX = (svgWidth - barW) / 2;
4137
- const gradId = `${element.id}-map-choropleth-grad`;
4138
- elements.push(
4139
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradId, x1: "0", y1: "0", x2: "1", y2: "0", children: [
4140
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: "#dbeafe" }),
4141
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "50%", stopColor: "#3b82f6" }),
4142
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: "#1e3a5f" })
4143
- ] }) }, `${element.id}-map-defs`),
4144
- /* @__PURE__ */ jsxRuntime.jsx(
4145
- "rect",
4146
- {
4147
- x: barX,
4148
- y: legendY,
4149
- width: barW,
4150
- height: 8,
4151
- rx: 4,
4152
- fill: `url(#${gradId})`
4153
- },
4154
- `${element.id}-map-legend-bar`
4155
- ),
4156
- /* @__PURE__ */ jsxRuntime.jsx(
4157
- "text",
4158
- {
4159
- x: barX,
4160
- y: legendY + 18,
4161
- fontSize: 7,
4162
- fill: "#64748b",
4163
- textAnchor: "middle",
4164
- children: chunk7JPLVECA_js.formatAxisValue(minVal)
4165
- },
4166
- `${element.id}-map-legend-min`
4167
- ),
4168
- /* @__PURE__ */ jsxRuntime.jsx(
4169
- "text",
4170
- {
4171
- x: barX + barW,
4172
- y: legendY + 18,
4173
- fontSize: 7,
4174
- fill: "#64748b",
4175
- textAnchor: "middle",
4176
- children: chunk7JPLVECA_js.formatAxisValue(maxVal)
4177
- },
4178
- `${element.id}-map-legend-max`
4179
- )
4180
- );
4181
- if (unmatchedRows.length > 0) {
4182
- const tableY = legendY + 26;
4183
- const fontSize = Math.min(8, fallbackRowH * 0.7);
4184
- const colW = Math.min((svgWidth - 20) / 2, 120);
4185
- const tableX = (svgWidth - colW * 2) / 2;
4186
- elements.push(
4187
- /* @__PURE__ */ jsxRuntime.jsx(
4188
- "text",
4189
- {
4190
- x: svgWidth / 2,
4191
- y: tableY,
4192
- textAnchor: "middle",
4193
- fontSize: 7,
4194
- fill: "#94a3b8",
4195
- children: chunkAONFHTTJ_js.translationsEn["pptx.chart.additionalRegionsFallback"]
4196
- },
4197
- `${element.id}-map-ft-hdr`
4198
- )
4199
- );
4200
- const maxRows = Math.min(unmatchedRows.length, 5);
4201
- for (let i = 0; i < maxRows; i++) {
4202
- const row = unmatchedRows[i];
4203
- const y = tableY + fallbackRowH * (i + 1);
4204
- if (y + fallbackRowH > svgHeight) {
4205
- break;
4206
- }
4207
- if (i % 2 === 0) {
4208
- elements.push(
4209
- /* @__PURE__ */ jsxRuntime.jsx(
4210
- "rect",
4211
- {
4212
- x: tableX,
4213
- y: y - fallbackRowH + 4,
4214
- width: colW * 2,
4215
- height: fallbackRowH,
4216
- fill: "#f1f5f9",
4217
- rx: 2
4218
- },
4219
- `${element.id}-map-ft-bg-${i}`
4220
- )
4221
- );
4222
- }
4223
- elements.push(
4224
- /* @__PURE__ */ jsxRuntime.jsx(
4225
- "text",
4226
- {
4227
- x: tableX + 4,
4228
- y,
4229
- fontSize,
4230
- fill: "#334155",
4231
- children: row.label
4232
- },
4233
- `${element.id}-map-ft-lbl-${i}`
4234
- ),
4235
- /* @__PURE__ */ jsxRuntime.jsx(
4236
- "text",
4237
- {
4238
- x: tableX + colW + 4,
4239
- y,
4240
- fontSize,
4241
- fill: "#475569",
4242
- children: chunk7JPLVECA_js.formatAxisValue(row.value)
4243
- },
4244
- `${element.id}-map-ft-val-${i}`
4245
- )
4246
- );
4247
- }
4248
- if (unmatchedRows.length > 5) {
4249
- const moreY = tableY + fallbackRowH * 6;
4250
- elements.push(
4251
- /* @__PURE__ */ jsxRuntime.jsxs(
4252
- "text",
4253
- {
4254
- x: svgWidth / 2,
4255
- y: moreY,
4256
- textAnchor: "middle",
4257
- fontSize: 6,
4258
- fill: "#94a3b8",
4259
- children: [
4260
- "+",
4261
- unmatchedRows.length - 5,
4262
- " more regions"
4263
- ]
4264
- },
4265
- `${element.id}-map-ft-more`
4266
- )
4267
- );
4268
- }
3836
+ const chartData = element.chartData;
3837
+ if (!chartData || chartData.series.length === 0) {
3838
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.chart.heading"] });
4269
3839
  }
4270
- return /* @__PURE__ */ jsxRuntime.jsxs(
4271
- "svg",
4272
- {
4273
- className: "w-full h-full pointer-events-none",
4274
- viewBox: `0 0 ${svgWidth} ${svgHeight}`,
4275
- preserveAspectRatio: "xMidYMid meet",
4276
- role: "img",
4277
- "aria-label": `Geographic map chart${chartData.title ? `: ${chartData.title}` : ""}`,
4278
- children: [
4279
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: svgWidth, height: svgHeight, fill: "#f8fafc", rx: 4 }),
4280
- elements
4281
- ]
4282
- }
3840
+ const kind = chunk7ARD2J6Y_js.resolveChartKind(chartData.chartType ?? "bar");
3841
+ return renderChartViewModel(
3842
+ element.id,
3843
+ buildReactChartViewModel(element),
3844
+ chunk7ARD2J6Y_js.chartPreserveAspectRatio(kind)
4283
3845
  );
4284
3846
  }
4285
3847
 
4286
- // src/viewer/utils/chart-pie.tsx
4287
- function renderPieChart(element, _chartData, _categoryLabels) {
4288
- const vm = buildReactChartViewModel(element);
4289
- return renderChartViewModel(element.id, vm, "xMidYMid meet");
4290
- }
4291
-
4292
- // src/viewer/utils/chart-radar.tsx
4293
- function renderRadarChart(element, _chartData, _categoryLabels) {
4294
- const vm = buildReactChartViewModel(element);
4295
- return renderChartViewModel(element.id, vm, "xMidYMid meet");
4296
- }
4297
-
4298
- // src/viewer/utils/chart-scatter-bubble.tsx
4299
- function renderScatterChart(element, _chartData, _categoryLabels) {
4300
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
4301
- }
4302
- function renderBubbleChart(element, _chartData, _categoryLabels) {
4303
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
4304
- }
4305
-
4306
- // src/viewer/utils/chart-stacked-bar.tsx
4307
- function renderStackedBarChart(element, _chartData, _categoryLabels) {
4308
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
4309
- }
4310
-
4311
- // src/viewer/utils/chart-overlay-utils.ts
4312
- function sColor(series, idx) {
4313
- return chunk7JPLVECA_js.seriesColor(series, idx);
4314
- }
4315
- function valToY(val, range, topY, bottomY) {
4316
- const usable = bottomY - topY;
4317
- return bottomY - (val - range.min) / range.span * usable;
4318
- }
4319
- function xToPixel(xVal, catCount, layout, mode) {
4320
- {
4321
- const slotWidth = layout.plotWidth / Math.max(catCount, 1);
4322
- return layout.plotLeft + slotWidth * xVal + slotWidth / 2;
4323
- }
4324
- }
4325
- function computeLinearRegression(xVals, yVals) {
4326
- const n = xVals.length;
4327
- if (n < 2) {
4328
- return { slope: 0, intercept: 0, rSquared: 0 };
4329
- }
4330
- let sumX = 0, sumY = 0, sumXY = 0, sumXX = 0;
4331
- for (let i = 0; i < n; i++) {
4332
- sumX += xVals[i];
4333
- sumY += yVals[i];
4334
- sumXY += xVals[i] * yVals[i];
4335
- sumXX += xVals[i] * xVals[i];
4336
- }
4337
- const denom = n * sumXX - sumX * sumX;
4338
- if (Math.abs(denom) < 1e-12) {
4339
- return { slope: 0, intercept: sumY / n, rSquared: 0 };
4340
- }
4341
- const slope = (n * sumXY - sumX * sumY) / denom;
4342
- const intercept = (sumY - slope * sumX) / n;
4343
- const ssRes = yVals.reduce((s, y, i) => s + (y - (slope * xVals[i] + intercept)) ** 2, 0);
4344
- const meanY = sumY / n;
4345
- const ssTot = yVals.reduce((s, y) => s + (y - meanY) ** 2, 0);
4346
- const rSquared = ssTot > 0 ? 1 - ssRes / ssTot : 0;
4347
- return { slope, intercept, rSquared };
4348
- }
4349
- function fitPolynomial(xVals, yVals, order) {
4350
- const n = xVals.length;
4351
- const m = order + 1;
4352
- const matrix = Array.from({ length: m }, () => Array(m + 1).fill(0));
4353
- for (let i = 0; i < m; i++) {
4354
- for (let j = 0; j < m; j++) {
4355
- let sum2 = 0;
4356
- for (let k = 0; k < n; k++) {
4357
- sum2 += xVals[k] ** (i + j);
4358
- }
4359
- matrix[i][j] = sum2;
4360
- }
4361
- let sum = 0;
4362
- for (let k = 0; k < n; k++) {
4363
- sum += yVals[k] * xVals[k] ** i;
4364
- }
4365
- matrix[i][m] = sum;
4366
- }
4367
- for (let i = 0; i < m; i++) {
4368
- let maxRow = i;
4369
- for (let k = i + 1; k < m; k++) {
4370
- if (Math.abs(matrix[k][i]) > Math.abs(matrix[maxRow][i])) {
4371
- maxRow = k;
4372
- }
4373
- }
4374
- [matrix[i], matrix[maxRow]] = [matrix[maxRow], matrix[i]];
4375
- const pivot = matrix[i][i];
4376
- if (Math.abs(pivot) < 1e-12) {
4377
- continue;
4378
- }
4379
- for (let j = i; j <= m; j++) {
4380
- matrix[i][j] /= pivot;
4381
- }
4382
- for (let k = 0; k < m; k++) {
4383
- if (k === i) {
4384
- continue;
4385
- }
4386
- const factor = matrix[k][i];
4387
- for (let j = i; j <= m; j++) {
4388
- matrix[k][j] -= factor * matrix[i][j];
4389
- }
4390
- }
4391
- }
4392
- return matrix.map((row) => row[m]);
4393
- }
4394
- function computeRSquared(xVals, yVals, evalFn) {
4395
- const n = xVals.length;
4396
- const meanY = yVals.reduce((s, y) => s + y, 0) / n;
4397
- let ssRes = 0, ssTot = 0;
4398
- for (let i = 0; i < n; i++) {
4399
- ssRes += (yVals[i] - evalFn(xVals[i])) ** 2;
4400
- ssTot += (yVals[i] - meanY) ** 2;
4401
- }
4402
- return ssTot > 0 ? 1 - ssRes / ssTot : 0;
4403
- }
4404
- function computeTrendlinePoints(trendline, values, catCount, layout, range, mode) {
4405
- const n = values.length;
4406
- if (n < 2) {
4407
- return { points: [], equation: "", rSquared: 0 };
4408
- }
4409
- const xVals = values.map((_v, i) => i);
4410
- const yVals = values;
4411
- const forward = trendline.forward ?? 0;
4412
- const backward = trendline.backward ?? 0;
4413
- const startX = -backward;
4414
- const endX = n - 1 + forward;
4415
- const steps = Math.max(Math.ceil((endX - startX) * 4), 20);
4416
- let evalFn;
4417
- let equation = "";
4418
- let rSquared = 0;
4419
- switch (trendline.trendlineType) {
4420
- case "linear": {
4421
- const reg = computeLinearRegression(xVals, yVals);
4422
- const slope = trendline.intercept !== void 0 ? yVals.reduce((s, y, i) => s + (y - trendline.intercept) * xVals[i], 0) / xVals.reduce((s, x) => s + x * x, 0) : reg.slope;
4423
- const b = trendline.intercept ?? reg.intercept;
4424
- evalFn = (x) => slope * x + b;
4425
- equation = `y = ${slope.toFixed(2)}x + ${b.toFixed(2)}`;
4426
- rSquared = reg.rSquared;
4427
- break;
4428
- }
4429
- case "exponential": {
4430
- const logY = yVals.filter((y) => y > 0).map((y) => Math.log(y));
4431
- const filteredX = xVals.filter((_x, i) => yVals[i] > 0);
4432
- if (logY.length < 2) {
4433
- return { points: [], equation: "", rSquared: 0 };
4434
- }
4435
- const reg = computeLinearRegression(filteredX, logY);
4436
- const a = Math.exp(reg.intercept);
4437
- const b = reg.slope;
4438
- evalFn = (x) => a * Math.exp(b * x);
4439
- equation = `y = ${a.toFixed(2)}e^(${b.toFixed(2)}x)`;
4440
- rSquared = reg.rSquared;
4441
- break;
4442
- }
4443
- case "logarithmic": {
4444
- const lnX = xVals.filter((x) => x > 0).map((x) => Math.log(x));
4445
- const filteredY = yVals.filter((_y, i) => xVals[i] > 0);
4446
- if (lnX.length < 2) {
4447
- return { points: [], equation: "", rSquared: 0 };
4448
- }
4449
- const reg = computeLinearRegression(lnX, filteredY);
4450
- evalFn = (x) => x > 0 ? reg.slope * Math.log(x) + reg.intercept : 0;
4451
- equation = `y = ${reg.slope.toFixed(2)}ln(x) + ${reg.intercept.toFixed(2)}`;
4452
- rSquared = reg.rSquared;
4453
- break;
4454
- }
4455
- case "power": {
4456
- const logX = xVals.filter((x, i) => x > 0 && yVals[i] > 0).map((x) => Math.log(x));
4457
- const logY = yVals.filter((y, i) => y > 0 && xVals[i] > 0).map((y) => Math.log(y));
4458
- if (logX.length < 2) {
4459
- return { points: [], equation: "", rSquared: 0 };
4460
- }
4461
- const reg = computeLinearRegression(logX, logY);
4462
- const a = Math.exp(reg.intercept);
4463
- evalFn = (x) => x > 0 ? a * x ** reg.slope : 0;
4464
- equation = `y = ${a.toFixed(2)}x^${reg.slope.toFixed(2)}`;
4465
- rSquared = reg.rSquared;
4466
- break;
4467
- }
4468
- case "polynomial": {
4469
- const order = Math.min(trendline.order ?? 2, 6);
4470
- const coeffs = fitPolynomial(xVals, yVals, order);
4471
- evalFn = (x) => coeffs.reduce((s, c, i) => s + c * x ** i, 0);
4472
- equation = coeffs.map((c, i) => `${c.toFixed(2)}x^${i}`).join(" + ");
4473
- rSquared = computeRSquared(xVals, yVals, evalFn);
4474
- break;
4475
- }
4476
- case "movingAvg": {
4477
- const period = trendline.period ?? 2;
4478
- const maPoints = [];
4479
- for (let i = period - 1; i < n; i++) {
4480
- let sum = 0;
4481
- for (let j = i - period + 1; j <= i; j++) {
4482
- sum += yVals[j];
4483
- }
4484
- const avgVal = sum / period;
4485
- const px = xToPixel(i, catCount, layout);
4486
- const py = valToY(avgVal, range, layout.plotTop, layout.plotBottom);
4487
- maPoints.push({ x: px, y: py });
4488
- }
4489
- return {
4490
- points: maPoints,
4491
- equation: `${period}-period moving average`,
4492
- rSquared: 0
4493
- };
4494
- }
4495
- default:
4496
- return { points: [], equation: "", rSquared: 0 };
4497
- }
4498
- const points = [];
4499
- for (let step = 0; step <= steps; step++) {
4500
- const xVal = startX + (endX - startX) * step / steps;
4501
- const yVal = evalFn(xVal);
4502
- if (!Number.isFinite(yVal)) {
4503
- continue;
4504
- }
4505
- const px = xToPixel(xVal, catCount, layout);
4506
- const py = valToY(yVal, range, layout.plotTop, layout.plotBottom);
4507
- points.push({ x: px, y: py });
4508
- }
4509
- return { points, equation, rSquared };
4510
- }
4511
- function renderTrendlines(elementId, chartData, layout, range, mode) {
4512
- const catCount = Math.max(chartData.categories.length, 1);
4513
- const nodes = [];
4514
- chartData.series.forEach((series, si) => {
4515
- if (!series.trendlines || series.trendlines.length === 0) {
4516
- return;
4517
- }
4518
- series.trendlines.forEach((tl, ti) => {
4519
- const { points, equation, rSquared } = computeTrendlinePoints(
4520
- tl,
4521
- series.values,
4522
- catCount,
4523
- layout,
4524
- range);
4525
- if (points.length < 2) {
4526
- return;
4527
- }
4528
- const pathD = points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
4529
- const strokeColor = tl.color || sColor(series, si);
4530
- nodes.push(
4531
- /* @__PURE__ */ jsxRuntime.jsx(
4532
- "path",
4533
- {
4534
- d: pathD,
4535
- fill: "none",
4536
- stroke: strokeColor,
4537
- strokeWidth: 1.5,
4538
- strokeDasharray: "6 3",
4539
- opacity: 0.8
4540
- },
4541
- `${elementId}-tl-${si}-${ti}`
4542
- )
4543
- );
4544
- const textParts = [];
4545
- if (tl.displayEq && equation) {
4546
- textParts.push(equation);
4547
- }
4548
- if (tl.displayRSq) {
4549
- textParts.push(`R\xB2 = ${rSquared.toFixed(4)}`);
4550
- }
4551
- if (textParts.length > 0) {
4552
- const lastPt = points[points.length - 1];
4553
- nodes.push(
4554
- /* @__PURE__ */ jsxRuntime.jsx(
4555
- "text",
4556
- {
4557
- x: lastPt.x,
4558
- y: lastPt.y - 6,
4559
- textAnchor: "end",
4560
- fontSize: 7,
4561
- fill: strokeColor,
4562
- children: textParts.join(" ")
4563
- },
4564
- `${elementId}-tl-txt-${si}-${ti}`
4565
- )
4566
- );
4567
- }
4568
- });
4569
- });
4570
- if (nodes.length === 0) {
4571
- return null;
4572
- }
4573
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: nodes }, `${elementId}-trendlines`);
4574
- }
4575
- function computeErrorValue(errBars, values, pointIndex, direction) {
4576
- switch (errBars.valType) {
4577
- case "fixedVal":
4578
- return errBars.val ?? 0;
4579
- case "percentage":
4580
- return Math.abs(values[pointIndex]) * ((errBars.val ?? 0) / 100);
4581
- case "stdDev": {
4582
- const n = values.length;
4583
- const mean = values.reduce((s, v) => s + v, 0) / n;
4584
- const variance = values.reduce((s, v) => s + (v - mean) ** 2, 0) / n;
4585
- const stdDev = Math.sqrt(variance);
4586
- return stdDev * (errBars.val ?? 1);
4587
- }
4588
- case "stdErr": {
4589
- const n2 = values.length;
4590
- const mean2 = values.reduce((s, v) => s + v, 0) / n2;
4591
- const variance2 = values.reduce((s, v) => s + (v - mean2) ** 2, 0) / n2;
4592
- return Math.sqrt(variance2 / n2);
4593
- }
4594
- case "cust": {
4595
- if (direction === "plus") {
4596
- return errBars.customPlus?.[pointIndex] ?? 0;
4597
- }
4598
- return errBars.customMinus?.[pointIndex] ?? 0;
4599
- }
4600
- default:
4601
- return 0;
4602
- }
4603
- }
4604
- function renderErrorBars(elementId, chartData, layout, range, mode) {
4605
- const catCount = Math.max(chartData.categories.length, 1);
4606
- const nodes = [];
4607
- const capW = 4;
4608
- chartData.series.forEach((series, si) => {
4609
- if (!series.errBars || series.errBars.length === 0) {
4610
- return;
4611
- }
4612
- series.errBars.forEach((eb) => {
4613
- if (eb.direction !== "y") {
4614
- return;
4615
- }
4616
- series.values.forEach((val, vi) => {
4617
- const cx = xToPixel(vi, catCount, layout);
4618
- const baseY = valToY(val, range, layout.plotTop, layout.plotBottom);
4619
- if (eb.barType === "plus" || eb.barType === "both") {
4620
- const plusErr = computeErrorValue(eb, series.values, vi, "plus");
4621
- const topY = valToY(val + plusErr, range, layout.plotTop, layout.plotBottom);
4622
- nodes.push(
4623
- /* @__PURE__ */ jsxRuntime.jsx(
4624
- "line",
4625
- {
4626
- x1: cx,
4627
- y1: baseY,
4628
- x2: cx,
4629
- y2: topY,
4630
- stroke: "#334155",
4631
- strokeWidth: 1
4632
- },
4633
- `${elementId}-eb-p-${si}-${vi}`
4634
- ),
4635
- /* @__PURE__ */ jsxRuntime.jsx(
4636
- "line",
4637
- {
4638
- x1: cx - capW,
4639
- y1: topY,
4640
- x2: cx + capW,
4641
- y2: topY,
4642
- stroke: "#334155",
4643
- strokeWidth: 1
4644
- },
4645
- `${elementId}-eb-pc-${si}-${vi}`
4646
- )
4647
- );
4648
- }
4649
- if (eb.barType === "minus" || eb.barType === "both") {
4650
- const minusErr = computeErrorValue(eb, series.values, vi, "minus");
4651
- const botY = valToY(val - minusErr, range, layout.plotTop, layout.plotBottom);
4652
- nodes.push(
4653
- /* @__PURE__ */ jsxRuntime.jsx(
4654
- "line",
4655
- {
4656
- x1: cx,
4657
- y1: baseY,
4658
- x2: cx,
4659
- y2: botY,
4660
- stroke: "#334155",
4661
- strokeWidth: 1
4662
- },
4663
- `${elementId}-eb-m-${si}-${vi}`
4664
- ),
4665
- /* @__PURE__ */ jsxRuntime.jsx(
4666
- "line",
4667
- {
4668
- x1: cx - capW,
4669
- y1: botY,
4670
- x2: cx + capW,
4671
- y2: botY,
4672
- stroke: "#334155",
4673
- strokeWidth: 1
4674
- },
4675
- `${elementId}-eb-mc-${si}-${vi}`
4676
- )
4677
- );
4678
- }
4679
- });
4680
- });
4681
- });
4682
- if (nodes.length === 0) {
4683
- return null;
4684
- }
4685
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: nodes }, `${elementId}-errorbars`);
4686
- }
4687
- function renderDropLines(elementId, chartData, layout, range, mode) {
4688
- if (!chartData.dropLines) {
4689
- return null;
4690
- }
4691
- const catCount = Math.max(chartData.categories.length, 1);
4692
- const style = chartData.dropLines;
4693
- const baselineY = valToY(range.min, range, layout.plotTop, layout.plotBottom);
4694
- const nodes = [];
4695
- chartData.series.forEach((series, si) => {
4696
- series.values.forEach((val, vi) => {
4697
- const cx = xToPixel(vi, catCount, layout);
4698
- const dataY = valToY(val, range, layout.plotTop, layout.plotBottom);
4699
- nodes.push(
4700
- /* @__PURE__ */ jsxRuntime.jsx(
4701
- "line",
4702
- {
4703
- x1: cx,
4704
- y1: dataY,
4705
- x2: cx,
4706
- y2: baselineY,
4707
- stroke: style.color || "#94a3b8",
4708
- strokeWidth: style.width ?? 0.8,
4709
- strokeDasharray: style.dashStyle === "dash" ? "4 3" : void 0
4710
- },
4711
- `${elementId}-dl-${si}-${vi}`
4712
- )
4713
- );
4714
- });
4715
- });
4716
- if (nodes.length === 0) {
4717
- return null;
4718
- }
4719
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: nodes }, `${elementId}-droplines`);
4720
- }
4721
- function renderUpDownBars(elementId, chartData, layout, range, mode) {
4722
- if (!chartData.upDownBars || chartData.series.length < 2) {
4723
- return null;
4724
- }
4725
- const catCount = Math.max(chartData.categories.length, 1);
4726
- const bars = chartData.upDownBars;
4727
- const first = chartData.series[0];
4728
- const last = chartData.series[chartData.series.length - 1];
4729
- const slot = layout.plotWidth / catCount;
4730
- const gapWidth = bars.gapWidth ?? 150;
4731
- const barW = Math.max(slot / (1 + Math.max(gapWidth, 0) / 100), 1);
4732
- const upFill = bars.upBars?.fillColor ?? "#e2e8f0";
4733
- const downFill = bars.downBars?.fillColor ?? "#334155";
4734
- const nodes = [];
4735
- for (let vi = 0; vi < catCount; vi++) {
4736
- const firstVal = first.values[vi];
4737
- const lastVal = last.values[vi];
4738
- if (firstVal === void 0 || lastVal === void 0) {
4739
- continue;
4740
- }
4741
- const firstY = valToY(firstVal, range, layout.plotTop, layout.plotBottom);
4742
- const lastY = valToY(lastVal, range, layout.plotTop, layout.plotBottom);
4743
- const cx = xToPixel(vi, catCount, layout);
4744
- nodes.push(
4745
- /* @__PURE__ */ jsxRuntime.jsx(
4746
- "rect",
4747
- {
4748
- x: cx - barW / 2,
4749
- y: Math.min(firstY, lastY),
4750
- width: barW,
4751
- height: Math.max(Math.abs(firstY - lastY), 1),
4752
- fill: lastVal >= firstVal ? upFill : downFill,
4753
- stroke: "#64748b",
4754
- strokeWidth: 0.5
4755
- },
4756
- `${elementId}-udb-${vi}`
4757
- )
4758
- );
4759
- }
4760
- if (nodes.length === 0) {
4761
- return null;
4762
- }
4763
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: nodes }, `${elementId}-updownbars`);
4764
- }
4765
- function renderHiLowLines(elementId, chartData, layout, range, mode) {
4766
- if (!chartData.hiLowLines) {
4767
- return null;
4768
- }
4769
- if (chartData.series.length < 2) {
4770
- return null;
4771
- }
4772
- const catCount = Math.max(chartData.categories.length, 1);
4773
- const style = chartData.hiLowLines;
4774
- const nodes = [];
4775
- for (let vi = 0; vi < catCount; vi++) {
4776
- let highVal = -Infinity;
4777
- let lowVal = Infinity;
4778
- for (const series of chartData.series) {
4779
- const v = series.values[vi];
4780
- if (v !== void 0) {
4781
- highVal = Math.max(highVal, v);
4782
- lowVal = Math.min(lowVal, v);
4783
- }
4784
- }
4785
- if (!Number.isFinite(highVal) || !Number.isFinite(lowVal)) {
4786
- continue;
4787
- }
4788
- const cx = xToPixel(vi, catCount, layout);
4789
- const highY = valToY(highVal, range, layout.plotTop, layout.plotBottom);
4790
- const lowY = valToY(lowVal, range, layout.plotTop, layout.plotBottom);
4791
- nodes.push(
4792
- /* @__PURE__ */ jsxRuntime.jsx(
4793
- "line",
4794
- {
4795
- x1: cx,
4796
- y1: highY,
4797
- x2: cx,
4798
- y2: lowY,
4799
- stroke: style.color || "#334155",
4800
- strokeWidth: style.width ?? 1,
4801
- strokeDasharray: style.dashStyle === "dash" ? "4 3" : void 0
4802
- },
4803
- `${elementId}-hl-${vi}`
4804
- )
4805
- );
4806
- }
4807
- if (nodes.length === 0) {
4808
- return null;
4809
- }
4810
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: nodes }, `${elementId}-hilowlines`);
4811
- }
4812
- function renderTitle(id, style, title, svgWidth) {
4813
- if (!style?.hasTitle) {
4814
- return null;
4815
- }
4816
- return /* @__PURE__ */ jsxRuntime.jsx(
4817
- "text",
4818
- {
4819
- x: svgWidth / 2,
4820
- y: 16,
4821
- textAnchor: "middle",
4822
- fontSize: 12,
4823
- fontWeight: 600,
4824
- fill: "#1e293b",
4825
- children: title || "Chart"
4826
- },
4827
- `${id}-title`
4828
- );
4829
- }
4830
- function renderLegend(id, style, series, layout, colorPalette) {
4831
- if (!style?.hasLegend || series.length === 0) {
4832
- return null;
4833
- }
4834
- const pos = style.legendPosition || "b";
4835
- if (pos === "b" || pos === "t") {
4836
- const y = pos === "b" ? layout.svgHeight - 10 : layout.plotTop - 14;
4837
- const items = [];
4838
- const charWidth = 6;
4839
- const gap = 24;
4840
- const totalWidth = series.reduce((w, s) => w + (s.name?.length ?? 4) * charWidth + gap, 0);
4841
- let cx = (layout.svgWidth - totalWidth) / 2;
4842
- series.forEach((s, i) => {
4843
- items.push(
4844
- /* @__PURE__ */ jsxRuntime.jsx(
4845
- "rect",
4846
- {
4847
- x: cx,
4848
- y: y - 5,
4849
- width: 10,
4850
- height: 10,
4851
- rx: 2,
4852
- fill: chunk7JPLVECA_js.seriesColor(s, i, style?.styleId, colorPalette)
4853
- },
4854
- `${id}-leg-r-${i}`
4855
- )
4856
- );
4857
- items.push(
4858
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx + 14, y: y + 4, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` }, `${id}-leg-t-${i}`)
4859
- );
4860
- cx += (s.name?.length ?? 4) * charWidth + gap;
4861
- });
4862
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: items }, `${id}-legend`);
4863
- }
4864
- const x = pos === "r" ? layout.plotRight + 8 : 4;
4865
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: series.map((s, i) => {
4866
- const cy = layout.plotTop + i * 16;
4867
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
4868
- /* @__PURE__ */ jsxRuntime.jsx(
4869
- "rect",
4870
- {
4871
- x,
4872
- y: cy,
4873
- width: 10,
4874
- height: 10,
4875
- rx: 2,
4876
- fill: chunk7JPLVECA_js.seriesColor(s, i, style?.styleId, colorPalette)
4877
- }
4878
- ),
4879
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
4880
- ] }, `${id}-leg-${i}`);
4881
- }) }, `${id}-legend`);
4882
- }
4883
- function renderGridlines(id, style, range, layout) {
4884
- if (!style?.hasGridlines) {
4885
- return null;
4886
- }
4887
- const lines = [];
4888
- if (range.logScale && range.logBase) {
4889
- const ticks = chunk7JPLVECA_js.generateLogTicks(range);
4890
- ticks.forEach((tickVal, i) => {
4891
- const y = chunk7JPLVECA_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
4892
- lines.push(
4893
- /* @__PURE__ */ jsxRuntime.jsx(
4894
- "line",
4895
- {
4896
- x1: layout.plotLeft,
4897
- y1: y,
4898
- x2: layout.plotRight,
4899
- y2: y,
4900
- stroke: "#cbd5e1",
4901
- strokeWidth: 0.7,
4902
- strokeDasharray: "4 3"
4903
- },
4904
- `${id}-grid-log-${i}`
4905
- )
4906
- );
4907
- });
4908
- } else {
4909
- const steps = 4;
4910
- for (let i = 0; i <= steps; i++) {
4911
- const val = range.min + range.span * i / steps;
4912
- const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
4913
- lines.push(
4914
- /* @__PURE__ */ jsxRuntime.jsx(
4915
- "line",
4916
- {
4917
- x1: layout.plotLeft,
4918
- y1: y,
4919
- x2: layout.plotRight,
4920
- y2: y,
4921
- stroke: "#cbd5e1",
4922
- strokeWidth: 0.7,
4923
- strokeDasharray: "4 3"
4924
- },
4925
- `${id}-grid-${i}`
4926
- )
4927
- );
4928
- }
4929
- }
4930
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: lines }, `${id}-gridlines`);
4931
- }
4932
- function renderValueAxis(id, range, layout, axisFormatting) {
4933
- const labels = [];
4934
- const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
4935
- if (range.logScale && range.logBase) {
4936
- const ticks = chunk7JPLVECA_js.generateLogTicks(range);
4937
- ticks.forEach((tickVal, i) => {
4938
- const y = chunk7JPLVECA_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
4939
- labels.push(
4940
- /* @__PURE__ */ jsxRuntime.jsx(
4941
- "text",
4942
- {
4943
- x: layout.plotLeft - 4,
4944
- y: y + 3,
4945
- textAnchor: "end",
4946
- fontSize: 8,
4947
- fill: "#64748b",
4948
- children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(tickVal)
4949
- },
4950
- `${id}-vaxis-log-${i}`
4951
- )
4952
- );
4953
- });
4954
- } else {
4955
- const steps = 4;
4956
- for (let i = 0; i <= steps; i++) {
4957
- const val = range.min + range.span * i / steps;
4958
- const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
4959
- labels.push(
4960
- /* @__PURE__ */ jsxRuntime.jsx(
4961
- "text",
4962
- {
4963
- x: layout.plotLeft - 4,
4964
- y: y + 3,
4965
- textAnchor: "end",
4966
- fontSize: 8,
4967
- fill: "#64748b",
4968
- children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(val, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(val)
4969
- },
4970
- `${id}-vaxis-${i}`
4971
- )
4972
- );
4973
- }
4974
- }
4975
- if (hasDisplayUnits) {
4976
- const unitLabel = chunk7JPLVECA_js.getDisplayUnitLabel(
4977
- axisFormatting.displayUnits,
4978
- axisFormatting.displayUnitsLabel
4979
- );
4980
- if (unitLabel) {
4981
- const midY = (layout.plotTop + layout.plotBottom) / 2;
4982
- labels.push(
4983
- /* @__PURE__ */ jsxRuntime.jsx(
4984
- "text",
4985
- {
4986
- x: layout.plotLeft - 36,
4987
- y: midY,
4988
- textAnchor: "middle",
4989
- fontSize: 9,
4990
- fill: "#64748b",
4991
- transform: `rotate(-90, ${layout.plotLeft - 36}, ${midY})`,
4992
- children: unitLabel
4993
- },
4994
- `${id}-vaxis-dispunit`
4995
- )
4996
- );
4997
- }
4998
- }
4999
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: labels }, `${id}-vaxis`);
5000
- }
5001
- function renderCategoryAxis(id, categories, layout) {
5002
- const count = categories.length;
5003
- if (count === 0) {
5004
- return null;
5005
- }
5006
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: categories.map((cat, i) => {
5007
- const slotWidth = layout.plotWidth / count;
5008
- const x = layout.plotLeft + slotWidth * i + slotWidth / 2;
5009
- return /* @__PURE__ */ jsxRuntime.jsx(
5010
- "text",
5011
- {
5012
- x,
5013
- y: layout.plotBottom + 14,
5014
- textAnchor: "middle",
5015
- fontSize: 8,
5016
- fill: "#64748b",
5017
- children: cat
5018
- },
5019
- `${id}-caxis-${i}`
5020
- );
5021
- }) }, `${id}-caxis`);
5022
- }
5023
- function renderCategoryAxisForLine(id, categories, layout) {
5024
- const count = categories.length;
5025
- if (count === 0) {
5026
- return null;
5027
- }
5028
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: categories.map((cat, i) => {
5029
- const x = count > 1 ? layout.plotLeft + layout.plotWidth * i / (count - 1) : layout.plotLeft + layout.plotWidth / 2;
5030
- return /* @__PURE__ */ jsxRuntime.jsx(
5031
- "text",
5032
- {
5033
- x,
5034
- y: layout.plotBottom + 14,
5035
- textAnchor: "middle",
5036
- fontSize: 8,
5037
- fill: "#64748b",
5038
- children: cat
5039
- },
5040
- `${id}-caxis-${i}`
5041
- );
5042
- }) }, `${id}-caxis`);
5043
- }
5044
- function renderZeroLine(id, range, layout) {
5045
- if (range.logScale) {
5046
- return null;
5047
- }
5048
- if (range.min >= 0) {
5049
- return null;
5050
- }
5051
- const y = chunk7JPLVECA_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
5052
- return /* @__PURE__ */ jsxRuntime.jsx(
5053
- "line",
5054
- {
5055
- x1: layout.plotLeft,
5056
- y1: y,
5057
- x2: layout.plotRight,
5058
- y2: y,
5059
- stroke: "#334155",
5060
- strokeWidth: 1
5061
- },
5062
- `${id}-zero`
5063
- );
5064
- }
5065
- function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
5066
- const steps = 4;
5067
- const labels = [];
5068
- const fontSize = axisFormatting?.fontSize ?? 8;
5069
- const fontColor = axisFormatting?.fontColor ?? "#64748b";
5070
- const fontFamily = axisFormatting?.fontFamily;
5071
- const fontWeight = axisFormatting?.fontBold ? 700 : void 0;
5072
- const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
5073
- for (let i = 0; i <= steps; i++) {
5074
- const val = range.min + range.span * i / steps;
5075
- const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
5076
- labels.push(
5077
- /* @__PURE__ */ jsxRuntime.jsx(
5078
- "text",
5079
- {
5080
- x: layout.plotRight + 4,
5081
- y: y + 3,
5082
- textAnchor: "start",
5083
- fontSize,
5084
- fontFamily,
5085
- fontWeight,
5086
- fill: fontColor,
5087
- children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(val, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(val)
5088
- },
5089
- `${id}-sec-vaxis-${i}`
5090
- )
5091
- );
5092
- }
5093
- if (axisFormatting?.titleText) {
5094
- labels.push(
5095
- /* @__PURE__ */ jsxRuntime.jsx(
5096
- "text",
5097
- {
5098
- x: layout.plotRight + 36,
5099
- y: (layout.plotTop + layout.plotBottom) / 2,
5100
- textAnchor: "middle",
5101
- fontSize: 9,
5102
- fill: fontColor,
5103
- transform: `rotate(-90, ${layout.plotRight + 36}, ${(layout.plotTop + layout.plotBottom) / 2})`,
5104
- children: axisFormatting.titleText
5105
- },
5106
- `${id}-sec-vaxis-title`
5107
- )
5108
- );
5109
- }
5110
- if (hasDisplayUnits) {
5111
- const unitLabel = chunk7JPLVECA_js.getDisplayUnitLabel(
5112
- axisFormatting.displayUnits,
5113
- axisFormatting.displayUnitsLabel
5114
- );
5115
- if (unitLabel) {
5116
- const labelX = layout.plotRight + (axisFormatting?.titleText ? 52 : 36);
5117
- const midY = (layout.plotTop + layout.plotBottom) / 2;
5118
- labels.push(
5119
- /* @__PURE__ */ jsxRuntime.jsx(
5120
- "text",
5121
- {
5122
- x: labelX,
5123
- y: midY,
5124
- textAnchor: "middle",
5125
- fontSize: 9,
5126
- fill: fontColor,
5127
- transform: `rotate(-90, ${labelX}, ${midY})`,
5128
- children: unitLabel
5129
- },
5130
- `${id}-sec-vaxis-dispunit`
5131
- )
5132
- );
5133
- }
5134
- }
5135
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: labels }, `${id}-sec-vaxis`);
5136
- }
5137
- function renderSecondaryAxisTicks(id, range, layout) {
5138
- const steps = 4;
5139
- const ticks = [];
5140
- for (let i = 0; i <= steps; i++) {
5141
- const val = range.min + range.span * i / steps;
5142
- const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
5143
- ticks.push(
5144
- /* @__PURE__ */ jsxRuntime.jsx(
5145
- "line",
5146
- {
5147
- x1: layout.plotRight,
5148
- y1: y,
5149
- x2: layout.plotRight + 4,
5150
- y2: y,
5151
- stroke: "#94a3b8",
5152
- strokeWidth: 0.7
5153
- },
5154
- `${id}-sec-tick-${i}`
5155
- )
5156
- );
5157
- }
5158
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: ticks }, `${id}-sec-ticks`);
5159
- }
5160
- function renderSecondaryGridlines(id, range, layout, axisFormatting) {
5161
- if (!axisFormatting?.minorGridlinesSpPr && !axisFormatting?.majorGridlinesSpPr) {
5162
- return null;
5163
- }
5164
- const steps = 4;
5165
- const lines = [];
5166
- const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
5167
- for (let i = 0; i <= steps; i++) {
5168
- const val = range.min + range.span * i / steps;
5169
- const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
5170
- lines.push(
5171
- /* @__PURE__ */ jsxRuntime.jsx(
5172
- "line",
5173
- {
5174
- x1: layout.plotLeft,
5175
- y1: y,
5176
- x2: layout.plotRight,
5177
- y2: y,
5178
- stroke: gridColor,
5179
- strokeWidth: 0.5,
5180
- strokeDasharray: "2 3",
5181
- opacity: 0.5
5182
- },
5183
- `${id}-sec-grid-${i}`
5184
- )
5185
- );
5186
- }
5187
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: lines }, `${id}-sec-gridlines`);
5188
- }
5189
- function renderChrome(id, chartData, layout, range, categories, options, secondaryOptions) {
5190
- const style = chartData.style;
5191
- const chrome = [];
5192
- const primaryValueAxis = chartData.axes?.find((a) => a.axisType === "valAx" && a.axPos !== "r") ?? chartData.axes?.find((a) => a.axisType === "valAx");
5193
- chrome.push(renderTitle(id, style, chartData.title, layout.svgWidth));
5194
- chrome.push(renderGridlines(id, style, range, layout));
5195
- chrome.push(renderValueAxis(id, range, layout, primaryValueAxis));
5196
- chrome.push(renderZeroLine(id, range, layout));
5197
- if (options.categoryAxisStyle === "bar") {
5198
- chrome.push(renderCategoryAxis(id, categories, layout));
5199
- } else {
5200
- chrome.push(renderCategoryAxisForLine(id, categories, layout));
5201
- }
5202
- chrome.push(renderLegend(id, style, chartData.series, layout, chartData.colorPalette));
5203
- if (secondaryOptions?.secondaryRange) {
5204
- chrome.push(
5205
- renderSecondaryValueAxis(
5206
- id,
5207
- secondaryOptions.secondaryRange,
5208
- layout,
5209
- secondaryOptions.secondaryAxisFormatting
5210
- )
5211
- );
5212
- chrome.push(renderSecondaryAxisTicks(id, secondaryOptions.secondaryRange, layout));
5213
- chrome.push(
5214
- renderSecondaryGridlines(
5215
- id,
5216
- secondaryOptions.secondaryRange,
5217
- layout,
5218
- secondaryOptions.secondaryAxisFormatting
5219
- )
5220
- );
5221
- }
5222
- return chrome;
5223
- }
5224
- function renderOverlays(id, chartData, layout, range, mode) {
5225
- const overlayLayout = layout;
5226
- const overlayRange = range;
5227
- const nodes = [];
5228
- nodes.push(renderUpDownBars(id, chartData, overlayLayout, overlayRange));
5229
- nodes.push(renderDropLines(id, chartData, overlayLayout, overlayRange));
5230
- nodes.push(renderHiLowLines(id, chartData, overlayLayout, overlayRange));
5231
- nodes.push(renderTrendlines(id, chartData, overlayLayout, overlayRange));
5232
- nodes.push(renderErrorBars(id, chartData, overlayLayout, overlayRange));
5233
- return nodes;
5234
- }
5235
- function formatValue(val) {
5236
- if (Math.abs(val) >= 1e6) {
5237
- return `${(val / 1e6).toFixed(1)}M`;
5238
- }
5239
- if (Math.abs(val) >= 1e3) {
5240
- return `${(val / 1e3).toFixed(1)}K`;
5241
- }
5242
- if (Number.isInteger(val)) {
5243
- return String(val);
5244
- }
5245
- return val.toFixed(1);
5246
- }
5247
- function renderChartDataTable(elementId, chartData, svgWidth) {
5248
- const table = chartData.dataTable;
5249
- if (!table) {
5250
- return null;
5251
- }
5252
- const categories = chartData.categories;
5253
- const series = chartData.series;
5254
- if (categories.length === 0 && series.length === 0) {
5255
- return null;
5256
- }
5257
- const borderColor = "#cbd5e1";
5258
- const showH = table.showHorzBorder !== false;
5259
- const showV = table.showVertBorder !== false;
5260
- const showO = table.showOutline !== false;
5261
- const showK = table.showKeys !== false;
5262
- const borderStyle = `1px solid ${borderColor}`;
5263
- return /* @__PURE__ */ jsxRuntime.jsx(
5264
- "div",
5265
- {
5266
- style: {
5267
- width: svgWidth,
5268
- overflow: "hidden",
5269
- fontSize: 8,
5270
- lineHeight: "14px",
5271
- color: "#334155",
5272
- pointerEvents: "none"
5273
- },
5274
- children: /* @__PURE__ */ jsxRuntime.jsxs(
5275
- "table",
5276
- {
5277
- style: {
5278
- width: "100%",
5279
- borderCollapse: "collapse",
5280
- border: showO ? borderStyle : "none"
5281
- },
5282
- children: [
5283
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5284
- showK && /* @__PURE__ */ jsxRuntime.jsx(
5285
- "th",
5286
- {
5287
- "aria-label": chunkAONFHTTJ_js.translationsEn["pptx.chart.rowLabelsAria"],
5288
- style: {
5289
- padding: "1px 4px",
5290
- fontWeight: 400,
5291
- borderBottom: showH ? borderStyle : "none",
5292
- borderRight: showV ? borderStyle : "none",
5293
- textAlign: "left"
5294
- }
5295
- }
5296
- ),
5297
- categories.map((cat, ci) => /* @__PURE__ */ jsxRuntime.jsx(
5298
- "th",
5299
- {
5300
- style: {
5301
- padding: "1px 4px",
5302
- fontWeight: 600,
5303
- borderBottom: showH ? borderStyle : "none",
5304
- borderRight: showV && ci < categories.length - 1 ? borderStyle : "none",
5305
- textAlign: "center"
5306
- },
5307
- children: cat
5308
- },
5309
- `${elementId}-dtable-h-${ci}`
5310
- ))
5311
- ] }) }),
5312
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: series.map((s, si) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
5313
- showK && /* @__PURE__ */ jsxRuntime.jsxs(
5314
- "td",
5315
- {
5316
- style: {
5317
- padding: "1px 4px",
5318
- borderBottom: showH && si < series.length - 1 ? borderStyle : "none",
5319
- borderRight: showV ? borderStyle : "none",
5320
- whiteSpace: "nowrap"
5321
- },
5322
- children: [
5323
- /* @__PURE__ */ jsxRuntime.jsx(
5324
- "span",
5325
- {
5326
- style: {
5327
- display: "inline-block",
5328
- width: 8,
5329
- height: 8,
5330
- borderRadius: 2,
5331
- backgroundColor: chunk7JPLVECA_js.seriesColor(
5332
- s,
5333
- si,
5334
- chartData.style?.styleId,
5335
- chartData.colorPalette
5336
- ),
5337
- marginRight: 4,
5338
- verticalAlign: "middle"
5339
- }
5340
- }
5341
- ),
5342
- s.name
5343
- ]
5344
- }
5345
- ),
5346
- categories.map((_cat, ci) => /* @__PURE__ */ jsxRuntime.jsx(
5347
- "td",
5348
- {
5349
- style: {
5350
- padding: "1px 4px",
5351
- textAlign: "center",
5352
- borderBottom: showH && si < series.length - 1 ? borderStyle : "none",
5353
- borderRight: showV && ci < categories.length - 1 ? borderStyle : "none"
5354
- },
5355
- children: s.values[ci] !== void 0 ? formatValue(s.values[ci]) : ""
5356
- },
5357
- `${elementId}-dtable-c-${si}-${ci}`
5358
- ))
5359
- ] }, `${elementId}-dtable-r-${si}`)) })
5360
- ]
5361
- }
5362
- )
5363
- },
5364
- `${elementId}-dtable`
5365
- );
5366
- }
5367
- function renderStockChart(element, chartData, categoryLabels) {
5368
- const style = chartData.style;
5369
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5370
- const legendPos = style?.legendPosition || "b";
5371
- const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
5372
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
5373
- const catCount = Math.max(categoryLabels.length, 1);
5374
- const barGroupWidth = layout.plotWidth / catCount;
5375
- const candleWidth = barGroupWidth * 0.5;
5376
- const hasFour = chartData.series.length >= 4;
5377
- const openSeries = hasFour ? chartData.series[0] : void 0;
5378
- const highSeries = chartData.series[hasFour ? 1 : 0];
5379
- const lowSeries = chartData.series[hasFour ? 2 : 1];
5380
- const closeSeries = chartData.series[hasFour ? 3 : 2];
5381
- if (!highSeries || !lowSeries || !closeSeries) {
5382
- return null;
5383
- }
5384
- const elements = [];
5385
- const dlElements = [];
5386
- for (let ci = 0; ci < catCount; ci++) {
5387
- const high = highSeries.values[ci] ?? 0;
5388
- const low = lowSeries.values[ci] ?? 0;
5389
- const open = openSeries?.values[ci] ?? low;
5390
- const close = closeSeries.values[ci] ?? high;
5391
- const isUp = close >= open;
5392
- const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
5393
- const highY = chunk7JPLVECA_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
5394
- const lowY = chunk7JPLVECA_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
5395
- const openY = chunk7JPLVECA_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
5396
- const closeY = chunk7JPLVECA_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
5397
- elements.push(
5398
- /* @__PURE__ */ jsxRuntime.jsx(
5399
- "line",
5400
- {
5401
- x1: cx,
5402
- y1: highY,
5403
- x2: cx,
5404
- y2: lowY,
5405
- stroke: "#334155",
5406
- strokeWidth: 1
5407
- },
5408
- `${element.id}-stock-wick-${ci}`
5409
- )
5410
- );
5411
- const bodyTop = Math.min(openY, closeY);
5412
- const bodyHeight = Math.max(Math.abs(openY - closeY), 1);
5413
- elements.push(
5414
- /* @__PURE__ */ jsxRuntime.jsx(
5415
- "rect",
5416
- {
5417
- x: cx - candleWidth / 2,
5418
- y: bodyTop,
5419
- width: candleWidth,
5420
- height: bodyHeight,
5421
- fill: isUp ? "#22c55e" : "#ef4444",
5422
- stroke: isUp ? "#16a34a" : "#dc2626",
5423
- strokeWidth: 0.5,
5424
- rx: 1
5425
- },
5426
- `${element.id}-stock-body-${ci}`
5427
- )
5428
- );
5429
- if (style?.hasDataLabels) {
5430
- dlElements.push(
5431
- /* @__PURE__ */ jsxRuntime.jsx(
5432
- "text",
5433
- {
5434
- x: cx,
5435
- y: highY - 4,
5436
- textAnchor: "middle",
5437
- fontSize: 7,
5438
- fill: "#334155",
5439
- children: chunk7JPLVECA_js.formatAxisValue(close)
5440
- },
5441
- `${element.id}-stock-dl-${ci}`
5442
- )
5443
- );
5444
- }
5445
- }
5446
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5447
- /* @__PURE__ */ jsxRuntime.jsxs(
5448
- "svg",
5449
- {
5450
- className: "w-full h-full pointer-events-none",
5451
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
5452
- preserveAspectRatio: "none",
5453
- children: [
5454
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
5455
- renderChrome(element.id, chartData, layout, range, categoryLabels, {
5456
- categoryAxisStyle: "bar"
5457
- }),
5458
- elements,
5459
- dlElements,
5460
- renderOverlays(element.id, chartData, layout, range)
5461
- ]
5462
- }
5463
- ),
5464
- renderChartDataTable(element.id, chartData, layout.svgWidth)
5465
- ] });
5466
- }
5467
-
5468
- // src/viewer/utils/chart-sunburst-funnel.tsx
5469
- function renderSunburstChart(element, _chartData, _categoryLabels) {
5470
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
5471
- }
5472
- function renderFunnelChart(element, _chartData, _categoryLabels) {
5473
- return renderChartViewModel(element.id, buildReactChartViewModel(element));
5474
- }
5475
- function FailedToLoad() {
5476
- return null;
5477
- }
5478
- var LazySurfaceChart3DScene = React6__default.default.lazy(
5479
- async () => {
5480
- try {
5481
- return await import('./SurfaceChart3DScene-ODQY77SZ.js');
5482
- } catch {
5483
- return { default: FailedToLoad };
5484
- }
5485
- }
5486
- );
5487
- var SurfaceChart3DErrorBoundary = class extends React6__default.default.Component {
5488
- constructor(props) {
5489
- super(props);
5490
- this.state = { hasError: false };
5491
- }
5492
- static getDerivedStateFromError() {
5493
- return { hasError: true };
5494
- }
5495
- render() {
5496
- if (this.state.hasError) {
5497
- return this.props.fallback;
5498
- }
5499
- return this.props.children;
5500
- }
5501
- };
5502
- function buildSurfaceData(chartData, categoryLabels) {
5503
- const rows = chartData.series.length;
5504
- const cols = Math.max(categoryLabels.length, 1);
5505
- const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
5506
- const heightMap = new Float32Array(rows * cols);
5507
- const colorMap = new Float32Array(rows * cols * 3);
5508
- for (let r = 0; r < rows; r++) {
5509
- const series = chartData.series[r];
5510
- for (let c = 0; c < cols; c++) {
5511
- const val = series?.values[c] ?? 0;
5512
- const t = range.span > 0 ? (val - range.min) / range.span : 0;
5513
- const idx = r * cols + c;
5514
- heightMap[idx] = t;
5515
- const { r: cr, g: cg, b: cb } = surfaceColor(t);
5516
- colorMap[idx * 3] = cr / 255;
5517
- colorMap[idx * 3 + 1] = cg / 255;
5518
- colorMap[idx * 3 + 2] = cb / 255;
5519
- }
5520
- }
5521
- return { heightMap, colorMap, rows, cols };
5522
- }
5523
- function LoadingPlaceholder({ width, height }) {
5524
- const { t } = reactI18next.useTranslation();
5525
- return /* @__PURE__ */ jsxRuntime.jsx(
5526
- "div",
5527
- {
5528
- style: {
5529
- width,
5530
- height,
5531
- display: "flex",
5532
- alignItems: "center",
5533
- justifyContent: "center",
5534
- background: "#f8fafc",
5535
- border: "1px dashed #cbd5e1",
5536
- borderRadius: 4,
5537
- fontSize: 11,
5538
- color: "#94a3b8"
5539
- },
5540
- children: t("pptx.chart.loading3dSurface")
5541
- }
5542
- );
5543
- }
5544
- var SurfaceChart3D = React6__default.default.memo(
5545
- ({ element, chartData, categoryLabels, fallback }) => {
5546
- const [threeAvailable, setThreeAvailable] = React6.useState(null);
5547
- React6.useEffect(() => {
5548
- let cancelled = false;
5549
- import('./three.module-GNNNRIMK.js').then(() => {
5550
- if (!cancelled) {
5551
- setThreeAvailable(true);
5552
- }
5553
- return void 0;
5554
- }).catch(() => {
5555
- if (!cancelled) {
5556
- setThreeAvailable(false);
5557
- }
5558
- });
5559
- return () => {
5560
- cancelled = true;
5561
- };
5562
- }, []);
5563
- const surfaceData = React6.useMemo(
5564
- () => buildSurfaceData(chartData, categoryLabels),
5565
- [chartData, categoryLabels]
5566
- );
5567
- const seriesNames = React6.useMemo(() => chartData.series.map((s) => s.name), [chartData.series]);
5568
- if (threeAvailable === null) {
5569
- return /* @__PURE__ */ jsxRuntime.jsx(LoadingPlaceholder, { width: element.width, height: element.height });
5570
- }
5571
- if (!threeAvailable) {
5572
- return fallback;
5573
- }
5574
- return /* @__PURE__ */ jsxRuntime.jsx(SurfaceChart3DErrorBoundary, { fallback, children: /* @__PURE__ */ jsxRuntime.jsx(React6.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingPlaceholder, { width: element.width, height: element.height }), children: /* @__PURE__ */ jsxRuntime.jsx(
5575
- LazySurfaceChart3DScene,
5576
- {
5577
- cols: surfaceData.cols,
5578
- rows: surfaceData.rows,
5579
- heightMap: surfaceData.heightMap,
5580
- colorMap: surfaceData.colorMap,
5581
- wireframe: true,
5582
- categoryLabels,
5583
- seriesNames,
5584
- title: chartData.title,
5585
- width: element.width,
5586
- height: element.height
5587
- }
5588
- ) }) });
5589
- }
5590
- );
5591
- SurfaceChart3D.displayName = "SurfaceChart3D";
5592
- var ISO_COS30 = Math.cos(Math.PI / 6);
5593
- var ISO_SIN30 = Math.sin(Math.PI / 6);
5594
- function isoProject(x, y, z) {
5595
- return {
5596
- screenX: (x - y) * ISO_COS30,
5597
- screenY: (x + y) * ISO_SIN30 - z
5598
- };
5599
- }
5600
- function surfaceColor(t) {
5601
- return {
5602
- r: Math.round(30 + 200 * t),
5603
- g: Math.round(80 + 100 * (1 - Math.abs(t - 0.5) * 2)),
5604
- b: Math.round(200 * (1 - t) + 30)
5605
- };
5606
- }
5607
- function isoCellVertices(col, row, cellSize, zScale, getValue) {
5608
- const corners = [
5609
- [col, row],
5610
- [col + 1, row],
5611
- [col + 1, row + 1],
5612
- [col, row + 1]
5613
- ];
5614
- return corners.map(([c, r]) => {
5615
- const val = getValue(r, c);
5616
- return isoProject(c * cellSize, r * cellSize, val * zScale);
5617
- });
5618
- }
5619
- function darkenRgb(r, g, b, factor) {
5620
- return `rgb(${Math.round(r * factor)},${Math.round(g * factor)},${Math.round(b * factor)})`;
5621
- }
5622
- function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
5623
- const style = chartData.style;
5624
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5625
- const legendPos = style?.legendPosition || "b";
5626
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, false, legendPos);
5627
- const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
5628
- const catCount = Math.max(categoryLabels.length, 1);
5629
- const seriesCount = chartData.series.length;
5630
- const cols = catCount - 1;
5631
- const rows = seriesCount - 1;
5632
- const gridSpan = cols + rows;
5633
- const baseHeightBudget = layout.plotHeight * 0.65;
5634
- const widthBudget = layout.plotWidth * 0.9;
5635
- const cellByWidth = widthBudget / (gridSpan * ISO_COS30);
5636
- const cellByHeight = baseHeightBudget / (gridSpan * ISO_SIN30);
5637
- const cellSize = Math.min(cellByWidth, cellByHeight);
5638
- const zHeadroom = layout.plotHeight * 0.3;
5639
- const zScale = range.span > 0 ? zHeadroom : 0;
5640
- const normValue = (r, c) => {
5641
- const ri = Math.min(r, seriesCount - 1);
5642
- const ci = Math.min(c, catCount - 1);
5643
- const val = chartData.series[ri]?.values[ci] ?? 0;
5644
- return range.span > 0 ? (val - range.min) / range.span : 0;
5645
- };
5646
- const allProjected = [];
5647
- for (let r = 0; r <= rows; r++) {
5648
- for (let c = 0; c <= cols; c++) {
5649
- const nv = normValue(r, c);
5650
- allProjected.push(isoProject(c * cellSize, r * cellSize, nv * zScale));
5651
- }
5652
- }
5653
- const minSX = Math.min(...allProjected.map((p) => p.screenX));
5654
- const maxSX = Math.max(...allProjected.map((p) => p.screenX));
5655
- const minSY = Math.min(...allProjected.map((p) => p.screenY));
5656
- const maxSY = Math.max(...allProjected.map((p) => p.screenY));
5657
- const projW = maxSX - minSX;
5658
- const projH = maxSY - minSY;
5659
- const offsetX = layout.plotLeft + layout.plotWidth / 2 - (minSX + projW / 2);
5660
- const offsetY = layout.plotTop + layout.plotHeight / 2 - (minSY + projH / 2);
5661
- const cellEntries = [];
5662
- for (let r = 0; r < rows; r++) {
5663
- for (let c = 0; c < cols; c++) {
5664
- cellEntries.push({ row: r, col: c, depth: r + c });
5665
- }
5666
- }
5667
- cellEntries.sort((a, b) => a.depth - b.depth);
5668
- const polygons = [];
5669
- for (const { row, col } of cellEntries) {
5670
- const verts = isoCellVertices(col, row, cellSize, zScale, normValue);
5671
- const avgT = (normValue(row, col) + normValue(row, col + 1) + normValue(row + 1, col + 1) + normValue(row + 1, col)) / 4;
5672
- const { r, g, b } = surfaceColor(avgT);
5673
- const points = verts.map((v) => `${(v.screenX + offsetX).toFixed(2)},${(v.screenY + offsetY).toFixed(2)}`).join(" ");
5674
- polygons.push(
5675
- /* @__PURE__ */ jsxRuntime.jsx(
5676
- "polygon",
5677
- {
5678
- points,
5679
- fill: `rgb(${r},${g},${b})`,
5680
- opacity: 0.9
5681
- },
5682
- `${element.id}-iso-${row}-${col}`
5683
- )
5684
- );
5685
- polygons.push(
5686
- /* @__PURE__ */ jsxRuntime.jsx(
5687
- "polygon",
5688
- {
5689
- points,
5690
- fill: "none",
5691
- stroke: darkenRgb(r, g, b, 0.6),
5692
- strokeWidth: 0.5,
5693
- opacity: 0.7
5694
- },
5695
- `${element.id}-iso-edge-${row}-${col}`
5696
- )
5697
- );
5698
- }
5699
- return /* @__PURE__ */ jsxRuntime.jsxs(
5700
- "svg",
5701
- {
5702
- className: "w-full h-full pointer-events-none",
5703
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
5704
- preserveAspectRatio: "xMidYMid meet",
5705
- children: [
5706
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
5707
- renderTitle(element.id, style, chartData.title, layout.svgWidth),
5708
- renderLegend(element.id, style, chartData.series, layout),
5709
- polygons
5710
- ]
5711
- }
5712
- );
5713
- }
5714
- function renderFlatSurfaceChart(element, chartData, categoryLabels) {
5715
- const style = chartData.style;
5716
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5717
- const legendPos = style?.legendPosition || "b";
5718
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
5719
- const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
5720
- const catCount = Math.max(categoryLabels.length, 1);
5721
- const seriesCount = chartData.series.length;
5722
- const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
5723
- const cellH = layout.plotHeight / Math.max(seriesCount - 1, 1);
5724
- const cells = [];
5725
- for (let si = 0; si < seriesCount; si++) {
5726
- for (let ci = 0; ci < catCount; ci++) {
5727
- const val = chartData.series[si].values[ci] ?? 0;
5728
- const t = range.span > 0 ? (val - range.min) / range.span : 0;
5729
- const { r, g, b } = surfaceColor(t);
5730
- cells.push(
5731
- /* @__PURE__ */ jsxRuntime.jsx(
5732
- "rect",
5733
- {
5734
- x: layout.plotLeft + ci * cellW,
5735
- y: layout.plotTop + si * cellH,
5736
- width: cellW + 0.5,
5737
- height: cellH + 0.5,
5738
- fill: `rgb(${r},${g},${b})`,
5739
- opacity: 0.85
5740
- },
5741
- `${element.id}-surf-${si}-${ci}`
5742
- )
5743
- );
5744
- }
5745
- }
5746
- return /* @__PURE__ */ jsxRuntime.jsxs(
5747
- "svg",
5748
- {
5749
- className: "w-full h-full pointer-events-none",
5750
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
5751
- preserveAspectRatio: "none",
5752
- children: [
5753
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
5754
- renderChrome(element.id, chartData, layout, range, categoryLabels, {
5755
- categoryAxisStyle: "bar"
5756
- }),
5757
- cells
5758
- ]
5759
- }
5760
- );
5761
- }
5762
- function renderSurfaceChart(element, chartData, categoryLabels) {
5763
- const catCount = Math.max(categoryLabels.length, 1);
5764
- const seriesCount = chartData.series.length;
5765
- if (seriesCount >= 2 && catCount >= 2) {
5766
- const svgFallback = renderIsometricSurfaceChart(element, chartData, categoryLabels);
5767
- return /* @__PURE__ */ jsxRuntime.jsx(
5768
- SurfaceChart3D,
5769
- {
5770
- element,
5771
- chartData,
5772
- categoryLabels,
5773
- fallback: svgFallback
5774
- }
5775
- );
5776
- }
5777
- return renderFlatSurfaceChart(element, chartData, categoryLabels);
5778
- }
5779
- function renderTreemapChart(element, chartData, categoryLabels) {
5780
- const style = chartData.style;
5781
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5782
- const legendPos = style?.legendPosition || "b";
5783
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, false, legendPos);
5784
- const allValues = chartData.series.flatMap((s) => s.values);
5785
- const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
5786
- const rects = [];
5787
- let curX = layout.plotLeft;
5788
- let curY = layout.plotTop;
5789
- let remainW = layout.plotWidth;
5790
- let remainH = layout.plotHeight;
5791
- const remaining = allValues.map((v, i) => ({ value: Math.abs(v), index: i })).sort((a, b) => b.value - a.value);
5792
- let remainTotal = totalAbs;
5793
- remaining.forEach((item) => {
5794
- const fraction = remainTotal > 0 ? item.value / remainTotal : 0;
5795
- const useWidth = remainW >= remainH;
5796
- const w = useWidth ? remainW * fraction : remainW;
5797
- const h = useWidth ? remainH : remainH * fraction;
5798
- rects.push(
5799
- /* @__PURE__ */ jsxRuntime.jsx(
5800
- "rect",
5801
- {
5802
- x: curX,
5803
- y: curY,
5804
- width: Math.max(w - 1, 1),
5805
- height: Math.max(h - 1, 1),
5806
- fill: chunk7JPLVECA_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
5807
- rx: 2,
5808
- opacity: 0.85
5809
- },
5810
- `${element.id}-tm-${item.index}`
5811
- )
5812
- );
5813
- const label2 = categoryLabels[item.index] ?? `${item.index + 1}`;
5814
- if (w > 30 && h > 14) {
5815
- rects.push(
5816
- /* @__PURE__ */ jsxRuntime.jsx(
5817
- "text",
5818
- {
5819
- x: curX + Math.max(w - 1, 1) / 2,
5820
- y: curY + Math.max(h - 1, 1) / 2 + 4,
5821
- textAnchor: "middle",
5822
- fontSize: Math.min(10, h * 0.3),
5823
- fill: "#fff",
5824
- fontWeight: 600,
5825
- children: label2
5826
- },
5827
- `${element.id}-tm-lbl-${item.index}`
5828
- )
5829
- );
5830
- }
5831
- if (useWidth) {
5832
- curX += w;
5833
- remainW -= w;
5834
- } else {
5835
- curY += h;
5836
- remainH -= h;
5837
- }
5838
- remainTotal -= item.value;
5839
- });
5840
- return /* @__PURE__ */ jsxRuntime.jsxs(
5841
- "svg",
5842
- {
5843
- className: "w-full h-full pointer-events-none",
5844
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
5845
- preserveAspectRatio: "none",
5846
- children: [
5847
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
5848
- renderTitle(element.id, style, chartData.title, layout.svgWidth),
5849
- renderLegend(element.id, style, chartData.series, layout),
5850
- rects
5851
- ]
5852
- }
5853
- );
5854
- }
5855
- function renderWaterfallChart(element, chartData, categoryLabels) {
5856
- const style = chartData.style;
5857
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5858
- const legendPos = style?.legendPosition || "b";
5859
- const values = chartData.series[0]?.values ?? [];
5860
- const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
5861
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
5862
- const catCount = Math.max(categoryLabels.length, values.length, 1);
5863
- const barWidth = layout.plotWidth / catCount * 0.6;
5864
- const gap = layout.plotWidth / catCount * 0.2;
5865
- let runningTotal = 0;
5866
- const bars = [];
5867
- const dataLabels = [];
5868
- values.forEach((val, i) => {
5869
- const isLast = i === values.length - 1;
5870
- const startVal = isLast ? 0 : runningTotal;
5871
- const endVal = isLast ? runningTotal + val : runningTotal + val;
5872
- const barStartY = chunk7JPLVECA_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
5873
- const barEndY = chunk7JPLVECA_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
5874
- const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
5875
- const y = Math.min(barStartY, barEndY);
5876
- const h = Math.max(Math.abs(barEndY - barStartY), 1);
5877
- const barColor = isLast ? "#6366f1" : val >= 0 ? "#22c55e" : "#ef4444";
5878
- bars.push(
5879
- /* @__PURE__ */ jsxRuntime.jsx(
5880
- "rect",
5881
- {
5882
- x,
5883
- y,
5884
- width: barWidth,
5885
- height: h,
5886
- fill: barColor,
5887
- rx: 1
5888
- },
5889
- `${element.id}-wf-bar-${i}`
5890
- )
5891
- );
5892
- if (style?.hasDataLabels) {
5893
- dataLabels.push(
5894
- /* @__PURE__ */ jsxRuntime.jsx(
5895
- "text",
5896
- {
5897
- x: x + barWidth / 2,
5898
- y: y - 4,
5899
- textAnchor: "middle",
5900
- fontSize: 7,
5901
- fill: "#334155",
5902
- children: chunk7JPLVECA_js.formatAxisValue(isLast ? endVal : val)
5903
- },
5904
- `${element.id}-wf-dl-${i}`
5905
- )
5906
- );
5907
- }
5908
- if (!isLast && i < values.length - 1) {
5909
- const nextX = layout.plotLeft + layout.plotWidth / catCount * (i + 1) + gap;
5910
- bars.push(
5911
- /* @__PURE__ */ jsxRuntime.jsx(
5912
- "line",
5913
- {
5914
- x1: x + barWidth,
5915
- y1: barEndY,
5916
- x2: nextX,
5917
- y2: barEndY,
5918
- stroke: "#94a3b8",
5919
- strokeWidth: 0.8,
5920
- strokeDasharray: "3 2"
5921
- },
5922
- `${element.id}-wf-conn-${i}`
5923
- )
5924
- );
5925
- }
5926
- if (!isLast) {
5927
- runningTotal += val;
5928
- }
5929
- });
5930
- return /* @__PURE__ */ jsxRuntime.jsxs(
5931
- "svg",
5932
- {
5933
- className: "w-full h-full pointer-events-none",
5934
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
5935
- preserveAspectRatio: "none",
5936
- children: [
5937
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
5938
- renderChrome(element.id, chartData, layout, range, categoryLabels, {
5939
- categoryAxisStyle: "bar"
5940
- }),
5941
- bars,
5942
- dataLabels
5943
- ]
5944
- }
5945
- );
5946
- }
5947
- function renderComboChart(element, chartData, categoryLabels) {
5948
- const style = chartData.style;
5949
- const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
5950
- const legendPos = style?.legendPosition || "b";
5951
- const layoutOpts = chunk7JPLVECA_js.computeLayoutOptions(
5952
- chartData.axes,
5953
- chartData.dataTable,
5954
- chartData.series.length
5955
- );
5956
- const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
5957
- const { primary, secondary } = chunk7JPLVECA_js.splitSeriesByAxis(chartData.series, chartData.axes);
5958
- const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
5959
- const secondarySeries = secondary.map((e) => e.series);
5960
- const range = chunk7JPLVECA_js.computeValueRangeForChart(primarySeries, chartData.axes);
5961
- const secondaryRange = secondarySeries.length > 0 ? chunk7JPLVECA_js.computeValueRange(secondarySeries) : void 0;
5962
- const secondaryAxisFmt = chunk7JPLVECA_js.getSecondaryValueAxis(chartData.axes);
5963
- const catCount = Math.max(categoryLabels.length, 1);
5964
- const barSeriesCount = 1;
5965
- const barGroupWidth = layout.plotWidth / catCount;
5966
- const barWidth = barGroupWidth * 0.5;
5967
- const barOffset = (barGroupWidth - barWidth) / 2;
5968
- const barSeries = chartData.series[0];
5969
- const lineSeries = chartData.series.slice(1);
5970
- const barElements = [];
5971
- const lineElements = [];
5972
- const dlElements = [];
5973
- if (barSeries) {
5974
- const isBarSecondary = secondary.some((e) => e.index === 0);
5975
- const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
5976
- barSeries.values.forEach((val, vi) => {
5977
- const x = layout.plotLeft + barGroupWidth * vi + barOffset;
5978
- const zeroY = chunk7JPLVECA_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
5979
- const valY = chunk7JPLVECA_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
5980
- const y = Math.min(zeroY, valY);
5981
- const h = Math.max(Math.abs(zeroY - valY), 1);
5982
- barElements.push(
5983
- /* @__PURE__ */ jsxRuntime.jsx(
5984
- "rect",
5985
- {
5986
- x,
5987
- y,
5988
- width: barWidth,
5989
- height: h,
5990
- fill: chunk7JPLVECA_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
5991
- rx: 1
5992
- },
5993
- `${element.id}-combo-bar-${vi}`
5994
- )
5995
- );
5996
- if (style?.hasDataLabels) {
5997
- dlElements.push(
5998
- /* @__PURE__ */ jsxRuntime.jsx(
5999
- "text",
6000
- {
6001
- x: x + barWidth / 2,
6002
- y: val >= 0 ? y - 4 : y + h + 10,
6003
- textAnchor: "middle",
6004
- fontSize: 7,
6005
- fill: "#334155",
6006
- children: chunk7JPLVECA_js.formatAxisValue(val)
6007
- },
6008
- `${element.id}-combo-bar-dl-${vi}`
6009
- )
6010
- );
6011
- }
6012
- });
6013
- }
6014
- lineSeries.forEach((series, si) => {
6015
- if (series.values.length === 0) {
6016
- return;
6017
- }
6018
- const seriesIdx = si + barSeriesCount;
6019
- const isSecondary = secondary.some((e) => e.index === seriesIdx);
6020
- const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
6021
- const points = series.values.map((val, vi) => {
6022
- const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
6023
- const y = chunk7JPLVECA_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
6024
- return { x, y, val };
6025
- });
6026
- const c = chunk7JPLVECA_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
6027
- lineElements.push(
6028
- /* @__PURE__ */ jsxRuntime.jsx(
6029
- "polyline",
6030
- {
6031
- fill: "none",
6032
- stroke: c,
6033
- strokeWidth: 2.4,
6034
- points: points.map((p) => `${p.x},${p.y}`).join(" ")
6035
- },
6036
- `${element.id}-combo-line-${si}`
6037
- )
6038
- );
6039
- points.forEach((p, vi) => {
6040
- lineElements.push(
6041
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: p.x, cy: p.y, r: 2.5, fill: c }, `${element.id}-combo-dot-${si}-${vi}`)
6042
- );
6043
- if (style?.hasDataLabels) {
6044
- dlElements.push(
6045
- /* @__PURE__ */ jsxRuntime.jsx(
6046
- "text",
6047
- {
6048
- x: p.x,
6049
- y: p.y - 7,
6050
- textAnchor: "middle",
6051
- fontSize: 7,
6052
- fill: "#334155",
6053
- children: chunk7JPLVECA_js.formatAxisValue(p.val)
6054
- },
6055
- `${element.id}-combo-line-dl-${si}-${vi}`
6056
- )
6057
- );
6058
- }
6059
- });
6060
- });
6061
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6062
- /* @__PURE__ */ jsxRuntime.jsxs(
6063
- "svg",
6064
- {
6065
- className: "w-full h-full pointer-events-none",
6066
- viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
6067
- preserveAspectRatio: "none",
6068
- children: [
6069
- areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
6070
- renderChrome(
6071
- element.id,
6072
- chartData,
6073
- layout,
6074
- range,
6075
- categoryLabels,
6076
- { categoryAxisStyle: "bar" },
6077
- secondaryRange ? { secondaryRange, secondaryAxisFormatting: secondaryAxisFmt } : void 0
6078
- ),
6079
- barElements,
6080
- lineElements,
6081
- dlElements,
6082
- renderOverlays(element.id, chartData, layout, range)
6083
- ]
6084
- }
6085
- ),
6086
- renderChartDataTable(element.id, chartData, layout.svgWidth)
6087
- ] });
6088
- }
6089
- function renderChartElement(element) {
6090
- if (element.type !== "chart") {
6091
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.chart.heading"] });
6092
- }
6093
- const chartData = element.chartData;
6094
- if (!chartData || chartData.series.length === 0) {
6095
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.chart.heading"] });
6096
- }
6097
- const longestSeriesLength = chartData.series.reduce(
6098
- (maxLength, series) => Math.max(maxLength, series.values.length),
6099
- 0
6100
- );
6101
- const categoryLabels = chartData.categories.length > 0 ? chartData.categories : Array.from({ length: longestSeriesLength }, (_, index) => String(index + 1));
6102
- const chartType = chartData.chartType ?? "bar";
6103
- if (chartType === "pie" || chartType === "doughnut" || chartType === "pie3D" || chartType === "ofPie") {
6104
- return renderPieChart(element);
6105
- }
6106
- if (chartType === "scatter") {
6107
- return renderScatterChart(element);
6108
- }
6109
- if (chartType === "bubble") {
6110
- return renderBubbleChart(element);
6111
- }
6112
- if (chartType === "radar") {
6113
- return renderRadarChart(element);
6114
- }
6115
- if (chartType === "stock") {
6116
- return renderStockChart(element, chartData, categoryLabels);
6117
- }
6118
- if (chartType === "area" || chartType === "area3D") {
6119
- return renderAreaChart(element);
6120
- }
6121
- if (chartType === "line" || chartType === "line3D") {
6122
- return renderLineChart(element);
6123
- }
6124
- if (chartType === "waterfall") {
6125
- return renderWaterfallChart(element, chartData, categoryLabels);
6126
- }
6127
- if (chartType === "combo") {
6128
- return renderComboChart(element, chartData, categoryLabels);
6129
- }
6130
- if (chartType === "bar" && (chartData.grouping === "stacked" || chartData.grouping === "percentStacked")) {
6131
- return renderStackedBarChart(element);
6132
- }
6133
- if (chartType === "surface") {
6134
- return renderSurfaceChart(element, chartData, categoryLabels);
6135
- }
6136
- if (chartType === "treemap") {
6137
- return renderTreemapChart(element, chartData, categoryLabels);
6138
- }
6139
- if (chartType === "sunburst") {
6140
- return renderSunburstChart(element);
6141
- }
6142
- if (chartType === "funnel") {
6143
- return renderFunnelChart(element);
6144
- }
6145
- if (chartType === "boxWhisker") {
6146
- return renderBoxWhiskerChart(element);
6147
- }
6148
- if (chartType === "histogram") {
6149
- return renderHistogramChart(element);
6150
- }
6151
- if (chartType === "regionMap") {
6152
- return renderMapChart(element, chartData, categoryLabels);
6153
- }
6154
- return renderDefaultBarChart(element);
6155
- }
6156
-
6157
3848
  // src/viewer/utils/pdf-builder-notes-builder.ts
6158
3849
  function buildNotesPdf(pages) {
6159
3850
  const images = pages.map((page) => {
@@ -6170,14 +3861,14 @@ function buildNotesPdf(pages) {
6170
3861
  notes: page.notes,
6171
3862
  slideNumber: page.slideNumber
6172
3863
  }));
6173
- const bytes = chunk7JPLVECA_js.buildNotesPdfBytes(images, meta);
3864
+ const bytes = chunk7ARD2J6Y_js.buildNotesPdfBytes(images, meta);
6174
3865
  const blob = new Blob([bytes], { type: "application/pdf" });
6175
3866
  return URL.createObjectURL(blob);
6176
3867
  }
6177
3868
 
6178
3869
  // src/viewer/utils/pdf-builder-slides.ts
6179
3870
  function buildPdfFromImageData(images) {
6180
- const bytes = chunk7JPLVECA_js.buildSlidesPdfBytes(images);
3871
+ const bytes = chunk7ARD2J6Y_js.buildSlidesPdfBytes(images);
6181
3872
  const blob = new Blob([bytes], { type: "application/pdf" });
6182
3873
  return URL.createObjectURL(blob);
6183
3874
  }
@@ -6186,7 +3877,7 @@ function buildPdfFromImageData(images) {
6186
3877
  var activePreview = null;
6187
3878
  function startPreviewAnimation(elementId, preset, options) {
6188
3879
  stopPreviewAnimation();
6189
- const descriptor = chunk7JPLVECA_js.buildPreviewAnimation(preset, options);
3880
+ const descriptor = chunk7ARD2J6Y_js.buildPreviewAnimation(preset, options);
6190
3881
  if (!descriptor) {
6191
3882
  return;
6192
3883
  }
@@ -6199,7 +3890,7 @@ function startMotionPathPreview(elementId, path, options) {
6199
3890
  return;
6200
3891
  }
6201
3892
  const stage = domEl.offsetParent;
6202
- const descriptor = chunk7JPLVECA_js.buildMotionPathPreview({
3893
+ const descriptor = chunk7ARD2J6Y_js.buildMotionPathPreview({
6203
3894
  path,
6204
3895
  slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
6205
3896
  slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
@@ -6265,6 +3956,7 @@ exports.DEFAULT_CANVAS_HEIGHT = DEFAULT_CANVAS_HEIGHT;
6265
3956
  exports.DEFAULT_CANVAS_WIDTH = DEFAULT_CANVAS_WIDTH;
6266
3957
  exports.DEFAULT_FILL_COLOR = DEFAULT_FILL_COLOR;
6267
3958
  exports.DEFAULT_FONT_FAMILY = DEFAULT_FONT_FAMILY2;
3959
+ exports.DEFAULT_SECTION_GROUP_ID = DEFAULT_SECTION_GROUP_ID;
6268
3960
  exports.DEFAULT_STROKE_COLOR = DEFAULT_STROKE_COLOR;
6269
3961
  exports.DEFAULT_TABLE_COLUMNS = DEFAULT_TABLE_COLUMNS;
6270
3962
  exports.DEFAULT_TABLE_ROWS = DEFAULT_TABLE_ROWS;