ooxml-ui 1.34.0 → 1.36.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 (223) hide show
  1. package/custom-elements.json +14 -1
  2. package/dist/chart/format-pane-analysis.d.ts +0 -1
  3. package/dist/chart/format-pane-effects.d.ts +0 -1
  4. package/dist/chart/format-pane-fill-kinds.d.ts +0 -1
  5. package/dist/chart/format-pane-fill-line.d.ts +0 -1
  6. package/dist/chart/format-pane-targets.d.ts +0 -1
  7. package/dist/chart/format-pane-text.d.ts +0 -1
  8. package/dist/chrome/tab-drag.d.ts +27 -0
  9. package/dist/chrome/tab-drag.d.ts.map +1 -0
  10. package/dist/chrome/tab-strip.d.ts +25 -1
  11. package/dist/chrome/tab-strip.d.ts.map +1 -1
  12. package/dist/{chunk-CDC5MAZS.js → chunk-6VF4FEMY.js} +1 -1
  13. package/dist/chunk-7RRN2GPO.js +19 -0
  14. package/dist/{chunk-3AOIYE3R.js → chunk-7ST5QRD5.js} +1 -1
  15. package/dist/{chunk-6TS7ASDJ.js → chunk-C4KI635Q.js} +2 -17
  16. package/dist/{chunk-CALEXPBD.js → chunk-GZNBWWJ5.js} +840 -51
  17. package/dist/{chunk-KYXSQFDB.js → chunk-QAX4FAB7.js} +139 -4
  18. package/dist/{chunk-SWDVBUBW.js → chunk-Z4DML5NW.js} +3 -3
  19. package/dist/controls.d.ts +1 -1
  20. package/dist/controls.d.ts.map +1 -1
  21. package/dist/controls.js +1 -1
  22. package/dist/docx/building-blocks-actions.d.ts +2 -2
  23. package/dist/docx/editable-region-view.d.ts +4 -0
  24. package/dist/docx/editor-chrome.d.ts +1 -1
  25. package/dist/docx/editor-core.d.ts +4 -0
  26. package/dist/docx/editor-plugins.d.ts +3 -0
  27. package/dist/docx/file-commands.d.ts +5 -0
  28. package/dist/docx/format-dialogs.d.ts +6 -1
  29. package/dist/docx/insert-controller.d.ts +5 -0
  30. package/dist/docx/list-commands.d.ts +3 -1
  31. package/dist/docx/list-marker-display.d.ts +1 -1
  32. package/dist/docx/locales/en-app.d.ts +0 -1
  33. package/dist/docx/locales/en-ribbon.d.ts +51 -0
  34. package/dist/docx/locales/en.d.ts +51 -1
  35. package/dist/docx/localization-strings.d.ts +51 -1
  36. package/dist/docx/paragraph-styles.d.ts +1 -1
  37. package/dist/docx/print-picture.d.ts +4 -0
  38. package/dist/docx/protection-controls.d.ts +4 -0
  39. package/dist/docx/restrict-editing-pane.d.ts +14 -0
  40. package/dist/docx/ribbon-action.d.ts +4 -0
  41. package/dist/docx/ribbon-icons.d.ts +1 -0
  42. package/dist/docx/search-controller.d.ts +12 -5
  43. package/dist/docx/search-document.d.ts +32 -0
  44. package/dist/docx.js +1227 -390
  45. package/dist/export/pdf-embedded-font.d.ts +65 -0
  46. package/dist/export/pdf-fonts.d.ts +14 -0
  47. package/dist/export/pdf-vector.d.ts +84 -0
  48. package/dist/image-native-size.d.ts +43 -0
  49. package/dist/image-native-size.d.ts.map +1 -0
  50. package/dist/index.js +5 -5
  51. package/dist/picture-artistic-filters.d.ts +9 -0
  52. package/dist/picture-artistic-filters.d.ts.map +1 -0
  53. package/dist/picture-artistic-preview.d.ts +3 -0
  54. package/dist/picture-artistic-preview.d.ts.map +1 -0
  55. package/dist/picture-effects.d.ts +3 -1
  56. package/dist/picture-effects.d.ts.map +1 -0
  57. package/dist/picture-paint.d.ts +23 -0
  58. package/dist/picture-paint.d.ts.map +1 -0
  59. package/dist/picture-pixels.d.ts +11 -0
  60. package/dist/picture-pixels.d.ts.map +1 -0
  61. package/dist/picture-standard-filter.d.ts +6 -0
  62. package/dist/picture-standard-filter.d.ts.map +1 -0
  63. package/dist/picture-view.d.ts +10 -0
  64. package/dist/picture-view.d.ts.map +1 -0
  65. package/dist/pptx/ai/bridge-factory.d.ts +4 -1
  66. package/dist/pptx/ai/bridge-factory.d.ts.map +1 -1
  67. package/dist/pptx/ai/config.d.ts +1 -1
  68. package/dist/pptx/ai/config.d.ts.map +1 -1
  69. package/dist/pptx/ai/host.cjs +36 -36
  70. package/dist/pptx/ai/host.mjs +1 -1
  71. package/dist/pptx/ai/index.cjs +50 -43
  72. package/dist/pptx/ai/index.mjs +10 -3
  73. package/dist/pptx/ai/system-prompt.d.ts +1 -1
  74. package/dist/pptx/ai/system-prompt.d.ts.map +1 -1
  75. package/dist/pptx/ai/tool-summary.d.ts.map +1 -1
  76. package/dist/pptx/ai/tools/mcp-registry.d.ts.map +1 -1
  77. package/dist/pptx/{chart-3d-view-scene-HNL4NWJT.mjs → chart-3d-view-scene-BKNMGRGO.mjs} +3 -25
  78. package/dist/pptx/{chart-3d-view-scene-OPVBTZL5.cjs → chart-3d-view-scene-V55XPBBF.cjs} +39 -61
  79. package/dist/pptx/{chunk-KGDMMWIY.mjs → chunk-2AK5MS6H.mjs} +11 -0
  80. package/dist/pptx/{chunk-M55PNMFQ.cjs → chunk-4OKSYRYA.cjs} +11 -0
  81. package/dist/pptx/{chunk-CH4Z6H6C.mjs → chunk-4RSRCNRM.mjs} +1192 -382
  82. package/dist/pptx/{chunk-TDIJHLS5.cjs → chunk-6JJD3LFT.cjs} +1532 -715
  83. package/dist/pptx/{chunk-46HIE4IE.cjs → chunk-CRV7G4GC.cjs} +8 -0
  84. package/dist/pptx/{chunk-S3L5NNCK.cjs → chunk-FROIGMTI.cjs} +1 -1
  85. package/dist/pptx/{chunk-S5I64Y55.cjs → chunk-HIRBPTML.cjs} +12 -12
  86. package/dist/pptx/{chunk-D4LJJ7Z7.cjs → chunk-KJICUZXM.cjs} +171 -540
  87. package/dist/pptx/{chunk-7DT3UJQB.mjs → chunk-KNCCSPAV.mjs} +7 -3
  88. package/dist/pptx/{chunk-RZVEPTLN.mjs → chunk-QK6LJT3K.mjs} +140 -529
  89. package/dist/pptx/{chunk-ZS5EVODY.cjs → chunk-SI7GQYSL.cjs} +52 -48
  90. package/dist/pptx/{chunk-LCCRLB7Q.mjs → chunk-UHDWWRTX.mjs} +1 -1
  91. package/dist/pptx/{chunk-6MEBLCNK.mjs → chunk-WQI3NLMY.mjs} +8 -0
  92. package/dist/pptx/{chunk-SPOECCPV.mjs → chunk-WZHYA2B3.mjs} +1 -1
  93. package/dist/pptx/dom/elements/smartart.d.ts.map +1 -1
  94. package/dist/pptx/dom/index.cjs +427 -427
  95. package/dist/pptx/dom/index.mjs +10 -10
  96. package/dist/pptx/export/html2canvas-clone.cjs +6 -6
  97. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  98. package/dist/pptx/i18n/index.cjs +6 -6
  99. package/dist/pptx/i18n/index.mjs +1 -1
  100. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  101. package/dist/pptx/index.cjs +3361 -3353
  102. package/dist/pptx/index.mjs +5 -5
  103. package/dist/pptx/render/chart-3d-projection.d.ts +5 -54
  104. package/dist/pptx/render/chart-3d-projection.d.ts.map +1 -1
  105. package/dist/pptx/render/chart-3d-shading.d.ts +7 -10
  106. package/dist/pptx/render/chart-3d-shading.d.ts.map +1 -1
  107. package/dist/pptx/render/chart-combo-stock.cjs +3 -3
  108. package/dist/pptx/render/chart-combo-stock.mjs +1 -1
  109. package/dist/pptx/render/chart-funnel-sunburst.d.ts +1 -1
  110. package/dist/pptx/render/chart-funnel-sunburst.d.ts.map +1 -1
  111. package/dist/pptx/render/chart-map-projection.d.ts +2 -37
  112. package/dist/pptx/render/chart-map-projection.d.ts.map +1 -1
  113. package/dist/pptx/render/chart-overlays.cjs +7 -7
  114. package/dist/pptx/render/chart-overlays.mjs +1 -1
  115. package/dist/pptx/render/chart-region-map-alias.d.ts +1 -11
  116. package/dist/pptx/render/chart-region-map-alias.d.ts.map +1 -1
  117. package/dist/pptx/render/chart-region-map-colors.d.ts +1 -3
  118. package/dist/pptx/render/chart-region-map-colors.d.ts.map +1 -1
  119. package/dist/pptx/render/chart-region-map-data.d.ts +2 -44
  120. package/dist/pptx/render/chart-region-map-data.d.ts.map +1 -1
  121. package/dist/pptx/render/chart-region-map-view.d.ts.map +1 -1
  122. package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
  123. package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
  124. package/dist/pptx/render/chart-view-model-types.d.ts +2 -0
  125. package/dist/pptx/render/chart-view-model-types.d.ts.map +1 -1
  126. package/dist/pptx/render/chart-view-model.cjs +44 -44
  127. package/dist/pptx/render/chart-view-model.mjs +1 -1
  128. package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
  129. package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
  130. package/dist/pptx/render/controller/custom-shows-controller.d.ts +93 -0
  131. package/dist/pptx/render/controller/custom-shows-controller.d.ts.map +1 -0
  132. package/dist/pptx/render/controller/index.d.ts +2 -0
  133. package/dist/pptx/render/controller/index.d.ts.map +1 -1
  134. package/dist/pptx/render/custom-shows.d.ts +10 -2
  135. package/dist/pptx/render/custom-shows.d.ts.map +1 -1
  136. package/dist/pptx/render/editor-key-target.d.ts.map +1 -1
  137. package/dist/pptx/render/image-effect-filter-values.d.ts +1 -10
  138. package/dist/pptx/render/image-effect-filter-values.d.ts.map +1 -1
  139. package/dist/pptx/render/image-effects.d.ts +1 -0
  140. package/dist/pptx/render/image-effects.d.ts.map +1 -1
  141. package/dist/pptx/render/image-native-size.d.ts +1 -42
  142. package/dist/pptx/render/image-native-size.d.ts.map +1 -1
  143. package/dist/pptx/render/image-tiling.d.ts.map +1 -1
  144. package/dist/pptx/render/index.d.ts +1 -1
  145. package/dist/pptx/render/index.d.ts.map +1 -1
  146. package/dist/pptx/render/render-cache.d.ts +1 -3
  147. package/dist/pptx/render/render-cache.d.ts.map +1 -1
  148. package/dist/pptx/render/smartart-drawing.d.ts +3 -0
  149. package/dist/pptx/render/smartart-drawing.d.ts.map +1 -1
  150. package/dist/pptx/render/smartart-picture-image.d.ts +9 -0
  151. package/dist/pptx/render/smartart-picture-image.d.ts.map +1 -0
  152. package/dist/pptx/render/smartart-reflow-to-shapes.d.ts.map +1 -1
  153. package/dist/pptx/{smartart-insert-preview-RQUFRLSV.mjs → smartart-insert-preview-JH5TXECK.mjs} +6 -6
  154. package/dist/pptx/{smartart-insert-preview-YKNB37GE.cjs → smartart-insert-preview-QWROEVZL.cjs} +7 -7
  155. package/dist/render-cache.d.ts +4 -0
  156. package/dist/render-cache.d.ts.map +1 -0
  157. package/dist/smartart/smartart-paint.d.ts +2 -1
  158. package/dist/smartart/smartart-picture.d.ts +4 -3
  159. package/dist/smartart/smartart-text-pane-tools.d.ts +0 -1
  160. package/dist/smartart.d.ts +3 -0
  161. package/dist/smartart.js +1 -1
  162. package/dist/teams.js +2 -2
  163. package/dist/theme-bridge.d.ts +0 -1
  164. package/dist/theme.d.ts +0 -1
  165. package/dist/touch-targets.d.ts +0 -1
  166. package/dist/visio/binding.d.ts +2 -1
  167. package/dist/visio/canvas-editing.d.ts +2 -0
  168. package/dist/visio/controller.d.ts +3 -0
  169. package/dist/visio/pdf-path.d.ts +37 -0
  170. package/dist/visio/pdf-svg-gradient.d.ts +23 -0
  171. package/dist/visio/pdf-svg-style.d.ts +20 -0
  172. package/dist/visio/pdf-svg-text.d.ts +8 -0
  173. package/dist/visio/pdf-svg.d.ts +22 -0
  174. package/dist/visio/ribbon-action.d.ts +47 -5
  175. package/dist/visio/ribbon-arrange.d.ts +9 -0
  176. package/dist/visio/ribbon-contextual-formats.d.ts +18 -0
  177. package/dist/visio/ribbon-org-chart.d.ts +7 -0
  178. package/dist/visio/ribbon-router.d.ts +18 -0
  179. package/dist/visio/ribbon-shape-format.d.ts +7 -0
  180. package/dist/visio/ribbon-size-fields.d.ts +5 -0
  181. package/dist/visio/ribbon-swimlane.d.ts +9 -0
  182. package/dist/visio/ribbon-themes.d.ts +13 -3
  183. package/dist/visio/ribbon.d.ts +5 -1
  184. package/dist/visio/shapes-files-ui.d.ts +1 -1
  185. package/dist/visio/template-thumbnails.d.ts +10 -0
  186. package/dist/visio/viewer-backstage.d.ts +9 -3
  187. package/dist/visio/viewer-chart-editor.d.ts +2 -1
  188. package/dist/visio/viewer-contextual-tabs.d.ts +21 -0
  189. package/dist/visio/viewer-diagram-parts.d.ts +9 -1
  190. package/dist/visio/viewer-element.d.ts +10 -0
  191. package/dist/visio/viewer-export.d.ts +1 -6
  192. package/dist/visio/viewer-file-commands.d.ts +6 -1
  193. package/dist/visio/viewer-guides.d.ts +8 -1
  194. package/dist/visio/viewer-inline-size.d.ts +15 -0
  195. package/dist/visio/viewer-insert-dialog.d.ts +1 -0
  196. package/dist/visio/viewer-new-drawing.d.ts +3 -2
  197. package/dist/visio/viewer-org-chart.d.ts +19 -0
  198. package/dist/visio/viewer-pdf-options.d.ts +26 -0
  199. package/dist/visio/viewer-pdf.d.ts +47 -0
  200. package/dist/visio/viewer-picture-format.d.ts +20 -0
  201. package/dist/visio/viewer-resize-handles.d.ts +13 -1
  202. package/dist/visio/viewer-swimlanes.d.ts +34 -0
  203. package/dist/visio.js +4079 -742
  204. package/dist/xlsx/dialogs/audit-dialogs.d.ts +9 -0
  205. package/dist/xlsx/dialogs/custom-autofilter.d.ts +12 -0
  206. package/dist/xlsx/dialogs/custom-lists.d.ts +6 -0
  207. package/dist/xlsx/dialogs/filter-dates.d.ts +4 -0
  208. package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
  209. package/dist/xlsx/dialogs/sort-dialog.d.ts +3 -3
  210. package/dist/xlsx/dialogs/text-to-columns.d.ts +0 -7
  211. package/dist/xlsx/dialogs/top10-filter.d.ts +5 -0
  212. package/dist/xlsx/dialogs/watch-window.d.ts +4 -0
  213. package/dist/xlsx/grid/audit-layer.d.ts +3 -0
  214. package/dist/xlsx/grid/filter-buttons.d.ts +11 -0
  215. package/dist/xlsx/grid/filter-menu.d.ts +10 -0
  216. package/dist/xlsx/grid/filter-presets.d.ts +19 -0
  217. package/dist/xlsx/grid/grid-view.d.ts +23 -1
  218. package/dist/xlsx/grid/pane-chrome.d.ts +2 -0
  219. package/dist/xlsx/grid/split-bars.d.ts +2 -0
  220. package/dist/xlsx/grid/styles.d.ts +1 -1
  221. package/dist/xlsx/sheet-tabs/drag.d.ts +1 -2
  222. package/dist/xlsx.js +1991 -450
  223. package/package.json +2 -2
@@ -4,6 +4,7 @@ var pptx = require('ooxml-core/pptx');
4
4
  var chart = require('ooxml-core/chart');
5
5
  var color = require('ooxml-core/color');
6
6
  var diagram = require('ooxml-core/diagram');
7
+ var regionMap = require('ooxml-core/chart/region-map');
7
8
 
8
9
  // src/pptx/render/chart-font.ts
9
10
  var CHART_PX_PER_PT = 4 / 3;
@@ -2774,15 +2775,8 @@ function build3DSurfacePanels(prims, surfaces, depth) {
2774
2775
  return [backWall, floor, sideWall].filter((p) => p !== void 0);
2775
2776
  }
2776
2777
 
2777
- // src/pptx/render/render-cache.ts
2778
+ // src/render-cache.ts
2778
2779
  var RENDER_CACHE_MAX_BYTES = 8 * 1024 * 1024;
2779
- var epoch = 0;
2780
- function getPptxRenderCacheEpoch() {
2781
- return epoch;
2782
- }
2783
- function invalidatePptxRenderCacheEpoch() {
2784
- epoch++;
2785
- }
2786
2780
  function setBoundedRenderCache(cache, key, value, maxEntries) {
2787
2781
  const bytesOf = (entryKey, entryValue) => (entryKey.length + (typeof entryValue === "string" ? entryValue.length : 0)) * 2;
2788
2782
  cache.delete(key);
@@ -2798,6 +2792,15 @@ function setBoundedRenderCache(cache, key, value, maxEntries) {
2798
2792
  }
2799
2793
  }
2800
2794
 
2795
+ // src/pptx/render/render-cache.ts
2796
+ var epoch = 0;
2797
+ function getPptxRenderCacheEpoch() {
2798
+ return epoch;
2799
+ }
2800
+ function invalidatePptxRenderCacheEpoch() {
2801
+ epoch++;
2802
+ }
2803
+
2801
2804
  // src/pptx/render/chart-bar3d-face-picture-sample.ts
2802
2805
  var CACHE_MAX = 128;
2803
2806
  var cacheEpoch = 0;
@@ -3977,7 +3980,7 @@ function groupedLabels(values) {
3977
3980
  });
3978
3981
  return groups;
3979
3982
  }
3980
- function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceIndices2, layout, spacing, axis, labelY, labelsAbove, offset) {
3983
+ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceIndices, layout, spacing, axis, labelY, labelsAbove, offset) {
3981
3984
  const sourceLevels = categoryLevels?.length ? categoryLevels : [categoryLabels];
3982
3985
  const levels = axis?.noMultiLevelLabels ? sourceLevels.slice(0, 1) : sourceLevels;
3983
3986
  const skip = Math.max(1, axis?.tickLabelSkip ?? 1);
@@ -3987,13 +3990,13 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
3987
3990
  const bandHeight = Math.max(fontPx, 8) + 4;
3988
3991
  const baselineShift = labelsAbove ? -0.2 * fontPx : 0.8 * fontPx;
3989
3992
  return levels.flatMap((level, levelIndex) => {
3990
- const values = sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "");
3993
+ const values = sourceIndices.map((sourceIndex) => level[sourceIndex] ?? "");
3991
3994
  return groupedLabels(values).flatMap((group) => {
3992
3995
  if (!group.text || group.start % skip !== 0) {
3993
3996
  return [];
3994
3997
  }
3995
- const startX = categoryX(group.start, sourceIndices2.length, layout, spacing);
3996
- const endX = categoryX(group.end, sourceIndices2.length, layout, spacing);
3998
+ const startX = categoryX(group.start, sourceIndices.length, layout, spacing);
3999
+ const endX = categoryX(group.end, sourceIndices.length, layout, spacing);
3997
4000
  return [
3998
4001
  {
3999
4002
  kind: "text",
@@ -4068,16 +4071,16 @@ function buildTickMarks(axis, sourceCount, layout, spacing, axisY) {
4068
4071
  }
4069
4072
  function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAxis, axisY, categoryLevels) {
4070
4073
  const axis = selectedAxis ?? primaryCategoryAxis(axes);
4071
- const sourceIndices2 = categoryLabels.map((_label, index) => index);
4074
+ const sourceIndices = categoryLabels.map((_label, index) => index);
4072
4075
  if (axis?.orientation === "maxMin") {
4073
- sourceIndices2.reverse();
4076
+ sourceIndices.reverse();
4074
4077
  }
4075
4078
  if (axis?.deleted || axis?.tickLblPos === "none") {
4076
4079
  return {
4077
4080
  axis,
4078
- sourceIndices: sourceIndices2,
4081
+ sourceIndices,
4079
4082
  labels: [],
4080
- tickMarks: buildTickMarks(axis, sourceIndices2.length, layout, spacing, axisY)
4083
+ tickMarks: buildTickMarks(axis, sourceIndices.length, layout, spacing, axisY)
4081
4084
  };
4082
4085
  }
4083
4086
  const topAxis = axis?.axPos === "t";
@@ -4089,7 +4092,7 @@ function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAx
4089
4092
  const labels = buildMultiLevelCategoryLabels(
4090
4093
  categoryLabels,
4091
4094
  categoryLevels,
4092
- sourceIndices2,
4095
+ sourceIndices,
4093
4096
  layout,
4094
4097
  spacing,
4095
4098
  axis,
@@ -4099,28 +4102,28 @@ function buildCategoryAxisPlan(categoryLabels, layout, spacing, axes, selectedAx
4099
4102
  );
4100
4103
  return {
4101
4104
  axis,
4102
- sourceIndices: sourceIndices2,
4105
+ sourceIndices,
4103
4106
  labels,
4104
- tickMarks: buildTickMarks(axis, sourceIndices2.length, layout, spacing, axisY)
4107
+ tickMarks: buildTickMarks(axis, sourceIndices.length, layout, spacing, axisY)
4105
4108
  };
4106
4109
  }
4107
- function chartDataInCategoryOrder(chartData, sourceIndices2) {
4108
- if (sourceIndices2.every((sourceIndex, displayIndex) => sourceIndex === displayIndex)) {
4110
+ function chartDataInCategoryOrder(chartData, sourceIndices) {
4111
+ if (sourceIndices.every((sourceIndex, displayIndex) => sourceIndex === displayIndex)) {
4109
4112
  return chartData;
4110
4113
  }
4111
4114
  return {
4112
4115
  ...chartData,
4113
- categories: sourceIndices2.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
4116
+ categories: sourceIndices.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
4114
4117
  categoryLevels: chartData.categoryLevels?.map(
4115
- (level) => sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "")
4118
+ (level) => sourceIndices.map((sourceIndex) => level[sourceIndex] ?? "")
4116
4119
  ),
4117
4120
  series: chartData.series.map((series) => ({
4118
4121
  ...series,
4119
- values: sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0),
4122
+ values: sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0),
4120
4123
  errBars: series.errBars?.map((errorBars) => ({
4121
4124
  ...errorBars,
4122
- customPlus: errorBars.customPlus ? sourceIndices2.map((sourceIndex) => errorBars.customPlus?.[sourceIndex] ?? 0) : void 0,
4123
- customMinus: errorBars.customMinus ? sourceIndices2.map((sourceIndex) => errorBars.customMinus?.[sourceIndex] ?? 0) : void 0
4125
+ customPlus: errorBars.customPlus ? sourceIndices.map((sourceIndex) => errorBars.customPlus?.[sourceIndex] ?? 0) : void 0,
4126
+ customMinus: errorBars.customMinus ? sourceIndices.map((sourceIndex) => errorBars.customMinus?.[sourceIndex] ?? 0) : void 0
4124
4127
  }))
4125
4128
  }))
4126
4129
  };
@@ -4436,9 +4439,9 @@ function clippedSeriesLine(points, smooth, style, band2) {
4436
4439
  }
4437
4440
 
4438
4441
  // src/pptx/render/chart-cartesian-area.ts
4439
- function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositions, stacking = "clustered") {
4442
+ function buildAreas(chartData, catCount, layout, range, sourceIndices, xPositions, stacking = "clustered") {
4440
4443
  const primitives = [], dataLabels = [], labelBoxes = [], showLabels = chartData.style?.hasDataLabels, isStackedMode = stacking !== "clustered", isPercent = stacking === "percentStacked", baselineY = valueToY2(0, range, layout.plotTop, layout.plotBottom), band2 = plotBand(layout), allDisplayValues = chartData.series.map(
4441
- (series) => series.values.length === 0 ? void 0 : sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0)
4444
+ (series) => series.values.length === 0 ? void 0 : sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0)
4442
4445
  ), stackedPlots = isStackedMode ? chart.computeStackedSeriesPlots(
4443
4446
  allDisplayValues.map((values) => values ?? []),
4444
4447
  catCount,
@@ -4479,7 +4482,7 @@ function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositio
4479
4482
  if (!insideBand(pt, band2)) {
4480
4483
  return;
4481
4484
  }
4482
- const idx = sourceIndices2[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
4485
+ const idx = sourceIndices[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
4483
4486
  pushMarker(
4484
4487
  primitives,
4485
4488
  series,
@@ -4531,13 +4534,13 @@ function buildAreas(chartData, catCount, layout, range, sourceIndices2, xPositio
4531
4534
  resolveDataLabelTextStyle(
4532
4535
  chartData,
4533
4536
  series,
4534
- sourceIndices2[displayIndex] ?? displayIndex
4537
+ sourceIndices[displayIndex] ?? displayIndex
4535
4538
  )
4536
4539
  )
4537
4540
  });
4538
4541
  return;
4539
4542
  }
4540
- const pointIndex = sourceIndices2[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
4543
+ const pointIndex = sourceIndices[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
4541
4544
  if (label === void 0) {
4542
4545
  return;
4543
4546
  }
@@ -4902,16 +4905,16 @@ function categoryTotals(series, catCount) {
4902
4905
  (_, ci) => series.reduce((sum, s) => sum + Math.abs(s.values[ci] ?? 0), 0)
4903
4906
  );
4904
4907
  }
4905
- function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sourceIndices2, invertNegativeFill2) {
4908
+ function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sourceIndices, invertNegativeFill2) {
4906
4909
  const primitives = [], dataLabels = [], series = chartData.series, palette = chartData.colorPalette, showLabels = chartData.style?.hasDataLabels, barGroupWidth = layout.plotWidth / Math.max(catCount, 1), barW = stackedBarWidth(barGroupWidth, chartData.barGapWidth), barOffset = (barGroupWidth - barW) / 2, displaySeries = series.map((entry) => ({
4907
4910
  ...entry,
4908
- values: sourceIndices2.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
4911
+ values: sourceIndices.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
4909
4912
  })), totals = categoryTotals(displaySeries, catCount);
4910
4913
  for (let ci = 0; ci < catCount; ci++) {
4911
4914
  let posRunning = 0, negRunning = 0;
4912
4915
  const catTotal = totals[ci] || 1;
4913
4916
  for (let si = 0; si < series.length; si++) {
4914
- const sourceIndex = sourceIndices2[ci] ?? ci, rawVal = series[si].values[sourceIndex] ?? 0, val = catTotal > 0 ? rawVal / catTotal * 100 : 0, base = val < 0 ? negRunning : posRunning;
4917
+ const sourceIndex = sourceIndices[ci] ?? ci, rawVal = series[si].values[sourceIndex] ?? 0, val = catTotal > 0 ? rawVal / catTotal * 100 : 0, base = val < 0 ? negRunning : posRunning;
4915
4918
  if (val < 0) {
4916
4919
  negRunning += val;
4917
4920
  } else {
@@ -4956,13 +4959,13 @@ function buildPercentStackedBars(chartData, catCount, layout, primaryRange, sour
4956
4959
  }
4957
4960
 
4958
4961
  // src/pptx/render/chart-cartesian-stacked-labels.ts
4959
- function pushStackedBarLabels(chartData, series, sourceIndices2, rects, layout, dataLabels) {
4962
+ function pushStackedBarLabels(chartData, series, sourceIndices, rects, layout, dataLabels) {
4960
4963
  for (const rect of rects) {
4961
4964
  const entry = rect.seriesIndex === void 0 ? void 0 : series[rect.seriesIndex];
4962
4965
  if (!entry || rect.pointIndex === void 0) {
4963
4966
  continue;
4964
4967
  }
4965
- const sourceIndex = sourceIndices2[rect.pointIndex] ?? rect.pointIndex, val = entry.values[sourceIndex] ?? 0, label = buildDataLabelText({ chartData, series: entry, pointIndex: sourceIndex, value: val });
4968
+ const sourceIndex = sourceIndices[rect.pointIndex] ?? rect.pointIndex, val = entry.values[sourceIndex] ?? 0, label = buildDataLabelText({ chartData, series: entry, pointIndex: sourceIndex, value: val });
4966
4969
  if (label === void 0) {
4967
4970
  continue;
4968
4971
  }
@@ -5006,7 +5009,7 @@ function invertNegativeFill(series, pointIndex, value, baseFill) {
5006
5009
  const point = series.dataPoints?.find((p) => p.idx === pointIndex), invert = point?.invertIfNegative ?? series.invertIfNegative ?? false;
5007
5010
  return invert ? blendToWhite(baseFill) : baseFill;
5008
5011
  }
5009
- function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, grouping, sourceIndices2) {
5012
+ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, grouping, sourceIndices) {
5010
5013
  const primitives = [], dataLabels = [], labelBoxes = [], series = chartData.series, palette = chartData.colorPalette, showLabels = chartData.style?.hasDataLabels, varyColorsSingle = chartData.varyColors === true && series.length === 1;
5011
5014
  if (grouping === "clustered") {
5012
5015
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1), split = secondaryRange !== void 0 && secondaryIdx.size > 0 && secondaryIdx.size < series.length, groups = split ? [
@@ -5021,7 +5024,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5021
5024
  const order = groups.flat();
5022
5025
  const geometryOf = (si) => geometry[split && secondaryIdx.has(si) ? 1 : 0];
5023
5026
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
5024
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
5027
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
5025
5028
  for (const si of order) {
5026
5029
  const { singleBarWidth, step, groupOffset } = geometryOf(si);
5027
5030
  const val = series[si].values[sourceIndex] ?? 0, x = layout.plotLeft + barGroupWidth * displayIndex + groupOffset + step * (slots.get(si) ?? si), activeRange = secondaryIdx.has(si) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, activeRange, layout.plotTop, layout.plotBottom), valY = valueToY2(val, activeRange, layout.plotTop, layout.plotBottom), y = Math.min(zeroY, valY), h = Math.max(Math.abs(zeroY - valY), 1), baseFill = varyColorsSingle ? resolveVaryColorFill(series[si], sourceIndex, paletteColor2(sourceIndex, palette)) : resolveDataPointFill(series[si], sourceIndex, paletteColor2(si, palette)) ?? seriesColor2(series[si], si, palette);
@@ -5097,7 +5100,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5097
5100
  if (grouping === "stacked") {
5098
5101
  const displaySeries = series.map((entry) => ({
5099
5102
  ...entry,
5100
- values: sourceIndices2.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
5103
+ values: sourceIndices.map((sourceIndex) => entry.values[sourceIndex] ?? 0)
5101
5104
  })), rects = computeStackedBarRects(
5102
5105
  displaySeries,
5103
5106
  catCount,
@@ -5109,7 +5112,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5109
5112
  for (const r of rects) {
5110
5113
  let fill = r.fill, part, title;
5111
5114
  if (r.seriesIndex !== void 0 && r.pointIndex !== void 0) {
5112
- const sourcePointIndex = sourceIndices2[r.pointIndex] ?? r.pointIndex;
5115
+ const sourcePointIndex = sourceIndices[r.pointIndex] ?? r.pointIndex;
5113
5116
  fill = resolveDataPointFill(series[r.seriesIndex], sourcePointIndex, r.fill) ?? r.fill;
5114
5117
  const value = series[r.seriesIndex].values[sourcePointIndex] ?? 0;
5115
5118
  fill = invertNegativeFill(series[r.seriesIndex], sourcePointIndex, value, fill);
@@ -5124,7 +5127,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5124
5127
  primitives.push({ kind: "rect", x: r.x, y: r.y, w: r.w, h: r.h, fill, rx: 1, part, title });
5125
5128
  }
5126
5129
  if (showLabels) {
5127
- pushStackedBarLabels(chartData, series, sourceIndices2, rects, layout, dataLabels);
5130
+ pushStackedBarLabels(chartData, series, sourceIndices, rects, layout, dataLabels);
5128
5131
  }
5129
5132
  return { primitives, dataLabels };
5130
5133
  }
@@ -5133,7 +5136,7 @@ function buildBars(chartData, catCount, layout, primaryRange, secondaryRange, se
5133
5136
  catCount,
5134
5137
  layout,
5135
5138
  primaryRange,
5136
- sourceIndices2,
5139
+ sourceIndices,
5137
5140
  invertNegativeFill
5138
5141
  );
5139
5142
  }
@@ -5211,12 +5214,12 @@ function seriesLineStroke(chartData, series) {
5211
5214
  }
5212
5215
 
5213
5216
  // src/pptx/render/chart-cartesian-line-area.ts
5214
- function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, sourceIndices2, xPositions, stacking = "clustered") {
5217
+ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, secondaryIdx, sourceIndices, xPositions, stacking = "clustered") {
5215
5218
  const primitives = [], dataLabels = [], labelBoxes = [], showLabels = chartData.style?.hasDataLabels, isStackedMode = stacking !== "clustered", isPercent = stacking === "percentStacked", band2 = plotBand(layout), resolved = chartData.series.map((series) => {
5216
5219
  if (series.values.length === 0) {
5217
5220
  return void 0;
5218
5221
  }
5219
- const rawValues = sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0), displayBlanks = sourceIndices2.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false), { values: displayValues, visible } = chart.resolveBlankDisplay(
5222
+ const rawValues = sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0), displayBlanks = sourceIndices.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false), { values: displayValues, visible } = chart.resolveBlankDisplay(
5220
5223
  rawValues,
5221
5224
  displayBlanks,
5222
5225
  chartData.chartChrome?.dispBlanksAs
@@ -5253,7 +5256,7 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
5253
5256
  if (!visible[displayIndex] || !insideBand(pt, band2)) {
5254
5257
  return;
5255
5258
  }
5256
- const idx = sourceIndices2[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
5259
+ const idx = sourceIndices[displayIndex] ?? displayIndex, part = { role: "dataPoint", seriesIndex: si, pointIndex: idx };
5257
5260
  pushMarker(
5258
5261
  primitives,
5259
5262
  series,
@@ -5295,13 +5298,13 @@ function buildLines(chartData, catCount, layout, primaryRange, secondaryRange, s
5295
5298
  resolveDataLabelTextStyle(
5296
5299
  chartData,
5297
5300
  series,
5298
- sourceIndices2[displayIndex] ?? displayIndex
5301
+ sourceIndices[displayIndex] ?? displayIndex
5299
5302
  )
5300
5303
  )
5301
5304
  });
5302
5305
  return;
5303
5306
  }
5304
- const pointIndex = sourceIndices2[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
5307
+ const pointIndex = sourceIndices[displayIndex] ?? displayIndex, label = buildDataLabelText({ chartData, series, pointIndex, value: val });
5305
5308
  if (label === void 0) {
5306
5309
  return;
5307
5310
  }
@@ -5617,7 +5620,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
5617
5620
  if (axis.orientation === "maxMin") {
5618
5621
  visible.reverse();
5619
5622
  }
5620
- const sourceIndices2 = visible.map(({ index }) => index);
5623
+ const sourceIndices = visible.map(({ index }) => index);
5621
5624
  const xPositions = visible.map(({ value }) => {
5622
5625
  const x = serialToX(value, min, max, layout);
5623
5626
  return axis.orientation === "maxMin" ? layout.plotLeft + layout.plotWidth - (x - layout.plotLeft) : x;
@@ -5699,7 +5702,7 @@ function buildDateAxisPlan(chartData, layout, selectedAxis, axisY) {
5699
5702
  }
5700
5703
  }
5701
5704
  }
5702
- return { sourceIndices: sourceIndices2, xPositions, labels, tickMarks };
5705
+ return { sourceIndices, xPositions, labels, tickMarks };
5703
5706
  }
5704
5707
 
5705
5708
  // src/pptx/render/chart-horizontal-axis.ts
@@ -5744,10 +5747,10 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
5744
5747
  rangeAndY(secondaryAxis),
5745
5748
  chartData.categoryLevels
5746
5749
  ) : void 0;
5747
- const sourceIndices2 = datePlan?.sourceIndices ?? categoryPlan?.sourceIndices ?? categoryLabels.map((_label, index) => index);
5750
+ const sourceIndices = datePlan?.sourceIndices ?? categoryPlan?.sourceIndices ?? categoryLabels.map((_label, index) => index);
5748
5751
  return {
5749
5752
  catAxisStyle,
5750
- sourceIndices: sourceIndices2,
5753
+ sourceIndices,
5751
5754
  xPositions: datePlan?.xPositions ?? categoryPlan?.sourceIndices.map(
5752
5755
  (_sourceIndex, displayIndex) => categoryX(displayIndex, categoryPlan.sourceIndices.length, layout, catAxisStyle)
5753
5756
  ),
@@ -5759,7 +5762,7 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
5759
5762
  ...datePlan?.tickMarks ?? categoryPlan?.tickMarks ?? [],
5760
5763
  ...secondaryPlan?.tickMarks ?? []
5761
5764
  ],
5762
- displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices2) : chartData
5765
+ displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices) : chartData
5763
5766
  };
5764
5767
  }
5765
5768
 
@@ -6153,7 +6156,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6153
6156
  primaryRange,
6154
6157
  secondaryRange
6155
6158
  );
6156
- const { catAxisStyle, sourceIndices: sourceIndices2, displayChartData } = horizontalAxis;
6159
+ const { catAxisStyle, sourceIndices, displayChartData } = horizontalAxis;
6157
6160
  const legendPos = chartData.style?.legendPosition ?? "b";
6158
6161
  const { legend, legendX, legendY, legendAnchor } = buildLegend(
6159
6162
  chartData.series,
@@ -6174,7 +6177,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6174
6177
  secondaryRange,
6175
6178
  secondaryIdx,
6176
6179
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered",
6177
- sourceIndices2
6180
+ sourceIndices
6178
6181
  );
6179
6182
  } else if (kind === "line") {
6180
6183
  plot = buildLines(
@@ -6184,7 +6187,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6184
6187
  primaryRange,
6185
6188
  secondaryRange,
6186
6189
  secondaryIdx,
6187
- sourceIndices2,
6190
+ sourceIndices,
6188
6191
  horizontalAxis.xPositions,
6189
6192
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered"
6190
6193
  );
@@ -6194,7 +6197,7 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
6194
6197
  catCount,
6195
6198
  layout,
6196
6199
  primaryRange,
6197
- sourceIndices2,
6200
+ sourceIndices,
6198
6201
  horizontalAxis.xPositions,
6199
6202
  isStacked ? isPercent ? "percentStacked" : "stacked" : "clustered"
6200
6203
  );
@@ -6298,7 +6301,7 @@ function buildStockCloseLabel(chartData, closeSeries, sourceIndex, close, x, clo
6298
6301
  }
6299
6302
 
6300
6303
  // src/pptx/render/chart-stock-candles.ts
6301
- function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCount, sourceIndices2, xPositions) {
6304
+ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCount, sourceIndices, xPositions) {
6302
6305
  const { open, high, low, close, closeIndex } = seriesSet;
6303
6306
  const primitives = [];
6304
6307
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1);
@@ -6312,7 +6315,7 @@ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCo
6312
6315
  );
6313
6316
  const upDownBars = chartData.upDownBars;
6314
6317
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6315
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6318
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6316
6319
  const candle = chart.stockCandle({
6317
6320
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
6318
6321
  band: barGroupWidth,
@@ -6363,7 +6366,7 @@ function computeStockCandlePrimitives(seriesSet, chartData, layout, range, catCo
6363
6366
  function findComboStockSeries(series) {
6364
6367
  return series.map((s, index) => ({ series: s, index })).filter((entry) => entry.series.seriesChartType === "stock");
6365
6368
  }
6366
- function computeComboStockOverlay(stockEntries, chartData, layout, range, catCount, sourceIndices2, xPositions) {
6369
+ function computeComboStockOverlay(stockEntries, chartData, layout, range, catCount, sourceIndices, xPositions) {
6367
6370
  if (stockEntries.length < 3) {
6368
6371
  return { primitives: [], dataLabels: [] };
6369
6372
  }
@@ -6378,14 +6381,14 @@ function computeComboStockOverlay(stockEntries, chartData, layout, range, catCou
6378
6381
  layout,
6379
6382
  range,
6380
6383
  catCount,
6381
- sourceIndices2,
6384
+ sourceIndices,
6382
6385
  xPositions
6383
6386
  );
6384
6387
  const dataLabels = [];
6385
6388
  if (chartData.style?.hasDataLabels) {
6386
6389
  const barGroupWidth = layout.plotWidth / Math.max(catCount, 1);
6387
6390
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6388
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6391
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6389
6392
  const close = closeEntry.series.values[sourceIndex];
6390
6393
  if (close === void 0) {
6391
6394
  continue;
@@ -6430,17 +6433,17 @@ function comboDataLabel(chartData, series, pointIndex, value, anchor) {
6430
6433
  ...dataLabelFontOverride(resolveDataLabelTextStyle(chartData, series, pointIndex))
6431
6434
  };
6432
6435
  }
6433
- function appendLineSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices2, primitives, dataLabels, xPositions) {
6436
+ function appendLineSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices, primitives, dataLabels, xPositions) {
6434
6437
  if (series.values.length === 0) {
6435
6438
  return;
6436
6439
  }
6437
6440
  const fill = seriesColor2(series, seriesIndex, chartData.colorPalette);
6438
6441
  const { values, visible } = chart.resolveBlankDisplay(
6439
- sourceIndices2.map((sourceIndex) => series.values[sourceIndex] ?? 0),
6440
- sourceIndices2.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false),
6442
+ sourceIndices.map((sourceIndex) => series.values[sourceIndex] ?? 0),
6443
+ sourceIndices.map((sourceIndex) => series.blanks?.[sourceIndex] ?? false),
6441
6444
  chartData.chartChrome?.dispBlanksAs
6442
6445
  );
6443
- const points = sourceIndices2.map((sourceIndex, displayIndex) => {
6446
+ const points = sourceIndices.map((sourceIndex, displayIndex) => {
6444
6447
  const value = values[displayIndex] ?? 0;
6445
6448
  return {
6446
6449
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
@@ -6490,13 +6493,13 @@ function appendLineSeries(series, seriesIndex, chartData, layout, range, barGrou
6490
6493
  }
6491
6494
  });
6492
6495
  }
6493
- function appendAreaSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices2, primitives, dataLabels, xPositions) {
6496
+ function appendAreaSeries(series, seriesIndex, chartData, layout, range, barGroupWidth, sourceIndices, primitives, dataLabels, xPositions) {
6494
6497
  if (series.values.length === 0) {
6495
6498
  return;
6496
6499
  }
6497
6500
  const fill = seriesColor2(series, seriesIndex, chartData.colorPalette);
6498
6501
  const baselineY = valueToY2(0, range, layout.plotTop, layout.plotBottom);
6499
- const points = sourceIndices2.map((sourceIndex, displayIndex) => {
6502
+ const points = sourceIndices.map((sourceIndex, displayIndex) => {
6500
6503
  const value = series.values[sourceIndex] ?? 0;
6501
6504
  return {
6502
6505
  x: xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2,
@@ -6583,7 +6586,7 @@ function groupComboSeriesIndices(series) {
6583
6586
  });
6584
6587
  return { barIndices, lineIndices, areaIndices };
6585
6588
  }
6586
- function computeComboBarCluster(barIndices, chartData, catCount, layout, primaryRange, secondaryRange, secondaryIndexes, sourceIndices2, xPositions) {
6589
+ function computeComboBarCluster(barIndices, chartData, catCount, layout, primaryRange, secondaryRange, secondaryIndexes, sourceIndices, xPositions) {
6587
6590
  if (barIndices.length === 0) {
6588
6591
  return [];
6589
6592
  }
@@ -6593,7 +6596,7 @@ function computeComboBarCluster(barIndices, chartData, catCount, layout, primary
6593
6596
  chartData
6594
6597
  ), rects = [];
6595
6598
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6596
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6599
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6597
6600
  barIndices.forEach((originalIndex, si) => {
6598
6601
  const series = chartData.series[originalIndex], value = series.values[sourceIndex] ?? 0, range = secondaryIndexes.has(originalIndex) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, range, layout.plotTop, layout.plotBottom), valY = valueToY2(value, range, layout.plotTop, layout.plotBottom), part = {
6599
6602
  role: "dataPoint",
@@ -6614,7 +6617,7 @@ function computeComboBarCluster(barIndices, chartData, catCount, layout, primary
6614
6617
  }
6615
6618
  return rects;
6616
6619
  }
6617
- function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, primaryRange, secondaryRange, secondaryIndexes, sourceIndices2, labels, xPositions) {
6620
+ function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, primaryRange, secondaryRange, secondaryIndexes, sourceIndices, labels, xPositions) {
6618
6621
  if (!chartData.style?.hasDataLabels || barIndices.length === 0) {
6619
6622
  return;
6620
6623
  }
@@ -6624,7 +6627,7 @@ function appendComboBarClusterLabels(barIndices, chartData, layout, catCount, pr
6624
6627
  chartData
6625
6628
  );
6626
6629
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6627
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6630
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex, center = xPositions?.[displayIndex] ?? layout.plotLeft + barGroupWidth * displayIndex + barGroupWidth / 2, clusterLeft = center - clusterWidth / 2;
6628
6631
  barIndices.forEach((originalIndex, si) => {
6629
6632
  const series = chartData.series[originalIndex], value = series.values[sourceIndex] ?? 0, range = secondaryIndexes.has(originalIndex) && secondaryRange ? secondaryRange : primaryRange, zeroY = valueToY2(0, range, layout.plotTop, layout.plotBottom), valY = valueToY2(value, range, layout.plotTop, layout.plotBottom), x = clusterLeft + step * si, barY = Math.min(zeroY, valY), barH = Math.max(Math.abs(zeroY - valY), 1), anchor = resolveBarLabelPlacement(
6630
6633
  chartData,
@@ -6711,7 +6714,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6711
6714
  primaryRange,
6712
6715
  secondaryRange
6713
6716
  );
6714
- const sourceIndices2 = horizontalAxis.sourceIndices;
6717
+ const sourceIndices = horizontalAxis.sourceIndices;
6715
6718
  const legendPos = chartData.style?.legendPosition ?? "b";
6716
6719
  const { barIndices, lineIndices, areaIndices } = groupComboSeriesIndices(chartData.series);
6717
6720
  const barIndexSet = new Set(barIndices);
@@ -6748,7 +6751,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6748
6751
  primaryRange,
6749
6752
  secondaryRange,
6750
6753
  secondaryIndexes,
6751
- sourceIndices2,
6754
+ sourceIndices,
6752
6755
  horizontalAxis.xPositions
6753
6756
  )
6754
6757
  );
@@ -6760,7 +6763,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6760
6763
  primaryRange,
6761
6764
  secondaryRange,
6762
6765
  secondaryIndexes,
6763
- sourceIndices2,
6766
+ sourceIndices,
6764
6767
  dataLabels,
6765
6768
  horizontalAxis.xPositions
6766
6769
  );
@@ -6775,7 +6778,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6775
6778
  layout,
6776
6779
  range,
6777
6780
  barGroupWidth,
6778
- sourceIndices2,
6781
+ sourceIndices,
6779
6782
  primitives,
6780
6783
  dataLabels,
6781
6784
  horizontalAxis.xPositions
@@ -6794,7 +6797,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6794
6797
  layout,
6795
6798
  range,
6796
6799
  barGroupWidth,
6797
- sourceIndices2,
6800
+ sourceIndices,
6798
6801
  primitives,
6799
6802
  dataLabels,
6800
6803
  horizontalAxis.xPositions
@@ -6809,7 +6812,7 @@ function buildComboViewModel(element, chartData, categoryLabels) {
6809
6812
  layout,
6810
6813
  stockRange,
6811
6814
  catCount,
6812
- sourceIndices2,
6815
+ sourceIndices,
6813
6816
  horizontalAxis.xPositions
6814
6817
  );
6815
6818
  primitives.push(...overlay.primitives);
@@ -6902,7 +6905,7 @@ function buildStockViewModel(element, chartData, categoryLabels) {
6902
6905
  "stock",
6903
6906
  range
6904
6907
  );
6905
- const sourceIndices2 = horizontalAxis.sourceIndices;
6908
+ const sourceIndices = horizontalAxis.sourceIndices;
6906
6909
  const legendPos = chartData.style?.legendPosition ?? "b";
6907
6910
  const { legend, legendX, legendY, legendAnchor } = buildLegend(
6908
6911
  chartData.series,
@@ -6934,14 +6937,14 @@ function buildStockViewModel(element, chartData, categoryLabels) {
6934
6937
  layout,
6935
6938
  range,
6936
6939
  catCount,
6937
- sourceIndices2,
6940
+ sourceIndices,
6938
6941
  horizontalAxis.xPositions
6939
6942
  )
6940
6943
  );
6941
6944
  if (chartData.style?.hasDataLabels) {
6942
6945
  const barGroupWidth = layout.plotWidth / catCount;
6943
6946
  for (let displayIndex = 0; displayIndex < catCount; displayIndex++) {
6944
- const sourceIndex = sourceIndices2[displayIndex] ?? displayIndex;
6947
+ const sourceIndex = sourceIndices[displayIndex] ?? displayIndex;
6945
6948
  const close = closeSeries.values[sourceIndex];
6946
6949
  if (close === void 0) {
6947
6950
  continue;
@@ -7602,19 +7605,23 @@ function emptyChrome2() {
7602
7605
  categoryLabels: []
7603
7606
  };
7604
7607
  }
7605
- function computeFunnelSegments(values, plotLeft, plotTop, plotWidth, plotHeight, categories, colorPalette, seriesColorOverride) {
7608
+ function computeFunnelSegments(values, plotLeft, plotTop, plotWidth, plotHeight, categories, colorPalette, seriesColorOverride, gapWidth) {
7606
7609
  const count = values.length;
7607
7610
  if (count === 0) {
7608
7611
  return [];
7609
7612
  }
7610
7613
  const fill = seriesColorOverride ?? paletteColor2(0, colorPalette);
7611
7614
  const out = [];
7612
- for (const bar of chart.computeFunnelGeometry(values, {
7613
- x: plotLeft,
7614
- y: plotTop,
7615
- width: plotWidth,
7616
- height: plotHeight
7617
- })) {
7615
+ for (const bar of chart.computeFunnelGeometry(
7616
+ values,
7617
+ {
7618
+ x: plotLeft,
7619
+ y: plotTop,
7620
+ width: plotWidth,
7621
+ height: plotHeight
7622
+ },
7623
+ gapWidth
7624
+ )) {
7618
7625
  const i = bar.index;
7619
7626
  const val = values[i];
7620
7627
  const w = bar.width, y = bar.y, segH = bar.height, centerX = bar.center;
@@ -7653,7 +7660,8 @@ function buildFunnelViewModel(element, chartData, categoryLabels) {
7653
7660
  layout.plotHeight,
7654
7661
  categoryLabels,
7655
7662
  chartData.colorPalette,
7656
- chartData.series[0]?.color
7663
+ chartData.series[0]?.color,
7664
+ chartData.funnelGapWidth
7657
7665
  );
7658
7666
  const primitives = [];
7659
7667
  const dataLabels = [];
@@ -9498,239 +9506,7 @@ function buildRadarViewModel(element, chartData, categoryLabels) {
9498
9506
  legendAnchor
9499
9507
  };
9500
9508
  }
9501
-
9502
- // src/pptx/render/chart-region-map-alias.ts
9503
- var REGION_ALIAS_MAP = {
9504
- us: "US",
9505
- usa: "US",
9506
- "united states": "US",
9507
- "united states of america": "US",
9508
- ca: "CA",
9509
- can: "CA",
9510
- canada: "CA",
9511
- br: "BR",
9512
- bra: "BR",
9513
- brazil: "BR",
9514
- gb: "GB",
9515
- gbr: "GB",
9516
- uk: "GB",
9517
- "united kingdom": "GB",
9518
- fr: "FR",
9519
- fra: "FR",
9520
- france: "FR",
9521
- de: "DE",
9522
- deu: "DE",
9523
- germany: "DE",
9524
- it: "IT",
9525
- ita: "IT",
9526
- italy: "IT",
9527
- es: "ES",
9528
- esp: "ES",
9529
- spain: "ES",
9530
- ru: "RU",
9531
- rus: "RU",
9532
- russia: "RU",
9533
- cn: "CN",
9534
- chn: "CN",
9535
- china: "CN",
9536
- in: "IN",
9537
- ind: "IN",
9538
- india: "IN",
9539
- jp: "JP",
9540
- jpn: "JP",
9541
- japan: "JP",
9542
- kr: "KR",
9543
- kor: "KR",
9544
- "south korea": "KR",
9545
- korea: "KR",
9546
- au: "AU",
9547
- aus: "AU",
9548
- australia: "AU",
9549
- mx: "MX",
9550
- mex: "MX",
9551
- mexico: "MX",
9552
- id: "ID",
9553
- idn: "ID",
9554
- indonesia: "ID",
9555
- tr: "TR",
9556
- tur: "TR",
9557
- turkey: "TR",
9558
- sa: "SA",
9559
- sau: "SA",
9560
- "saudi arabia": "SA",
9561
- za: "ZA",
9562
- zaf: "ZA",
9563
- "south africa": "ZA",
9564
- ar: "AR",
9565
- arg: "AR",
9566
- argentina: "AR",
9567
- ng: "NG",
9568
- nga: "NG",
9569
- nigeria: "NG",
9570
- eg: "EG",
9571
- egy: "EG",
9572
- egypt: "EG"
9573
- };
9574
- function resolveRegionCode(label) {
9575
- const normalized = label.trim().toLowerCase();
9576
- return REGION_ALIAS_MAP[normalized];
9577
- }
9578
-
9579
- // src/pptx/render/chart-region-map-data.ts
9580
- function sourceIndices(indices, length) {
9581
- return Array.from({ length }, (_, position) => indices?.[position] ?? position);
9582
- }
9583
- function valueAtSource(values, indices, sourceIndex) {
9584
- const position = indices.indexOf(sourceIndex);
9585
- return position >= 0 ? values[position] : void 0;
9586
- }
9587
- function cachedEntityName(cache, entityId) {
9588
- if (!cache || typeof cache !== "object") {
9589
- return void 0;
9590
- }
9591
- const record = cache;
9592
- if (String(record["@_entityId"] ?? "") === entityId && record["@_entityName"] !== void 0) {
9593
- return String(record["@_entityName"]);
9594
- }
9595
- for (const value of Object.values(record)) {
9596
- if (Array.isArray(value)) {
9597
- for (const item of value) {
9598
- const name = cachedEntityName(item, entityId);
9599
- if (name) {
9600
- return name;
9601
- }
9602
- }
9603
- } else {
9604
- const name = cachedEntityName(value, entityId);
9605
- if (name) {
9606
- return name;
9607
- }
9608
- }
9609
- }
9610
- return void 0;
9611
- }
9612
- function resolveRegionEntityCode(entityId, options, resolveCode) {
9613
- if (!entityId) {
9614
- return void 0;
9615
- }
9616
- const direct = resolveCode(entityId);
9617
- if (direct) {
9618
- return direct;
9619
- }
9620
- const tokens = entityId.split(/[:/|._-]+/u).filter(Boolean);
9621
- for (let index = tokens.length - 1; index >= 0; index--) {
9622
- const resolved = resolveCode(tokens[index] ?? "");
9623
- if (resolved) {
9624
- return resolved;
9625
- }
9626
- }
9627
- const cachedName = cachedEntityName(options?.geographyCache, entityId);
9628
- return cachedName ? resolveCode(cachedName) : void 0;
9629
- }
9630
- function buildRegionMapEntries(categories, values, options, resolveCode) {
9631
- const entityIds = options?.entityIds ?? [];
9632
- const categoryIndices = sourceIndices(options?.categorySourceIndices, categories.length);
9633
- const valueIndices = sourceIndices(options?.valueSourceIndices, values.length);
9634
- const entityIndices = sourceIndices(options?.entityIdSourceIndices, entityIds.length);
9635
- const indices = [.../* @__PURE__ */ new Set([...categoryIndices, ...valueIndices, ...entityIndices])].sort(
9636
- (a, b) => a - b
9637
- );
9638
- return indices.map((sourceIndex) => {
9639
- const category = valueAtSource(categories, categoryIndices, sourceIndex) ?? "";
9640
- const value = valueAtSource(values, valueIndices, sourceIndex) ?? 0;
9641
- const entityId = valueAtSource(entityIds, entityIndices, sourceIndex);
9642
- return {
9643
- sourceIndex,
9644
- label: category || entityId || `Region ${sourceIndex + 1}`,
9645
- value,
9646
- ...entityId ? { entityId } : {},
9647
- code: resolveRegionEntityCode(entityId, options, resolveCode) ?? resolveCode(category)
9648
- };
9649
- });
9650
- }
9651
- function shouldRenderRegionLabel(layout, projectedWidth, projectedHeight) {
9652
- if (layout === "none") {
9653
- return false;
9654
- }
9655
- if (layout === "bestFitOnly") {
9656
- return projectedWidth >= 18 && projectedHeight >= 10;
9657
- }
9658
- return true;
9659
- }
9660
- function formatRegionMapValue(value, cultureLanguage) {
9661
- if (!cultureLanguage) {
9662
- return String(value);
9663
- }
9664
- try {
9665
- return new Intl.NumberFormat(cultureLanguage, { maximumFractionDigits: 2 }).format(value);
9666
- } catch {
9667
- return String(value);
9668
- }
9669
- }
9670
- function lerpColor(a, b, t) {
9671
- const clamp3 = (v) => Math.max(0, Math.min(255, Math.round(v))), ha = a.replace("#", ""), hb = b.replace("#", ""), r1 = parseInt(ha.substring(0, 2), 16), g1 = parseInt(ha.substring(2, 4), 16), b1 = parseInt(ha.substring(4, 6), 16), r26 = parseInt(hb.substring(0, 2), 16), g2 = parseInt(hb.substring(2, 4), 16), b2 = parseInt(hb.substring(4, 6), 16), r = clamp3(r1 + (r26 - r1) * t), g = clamp3(g1 + (g2 - g1) * t), bl = clamp3(b1 + (b2 - b1) * t), toHex = (n) => n.toString(16).padStart(2, "0");
9672
- return `#${toHex(r)}${toHex(g)}${toHex(bl)}`;
9673
- }
9674
- function resolveValueColorStops(valueColors, valueColorPositions, minVal, maxVal) {
9675
- if (!valueColors || valueColors.length < 2) {
9676
- return void 0;
9677
- }
9678
- const span = maxVal - minVal || 1, count = valueColors.length, resolvePosition = (position, index) => {
9679
- if (position?.kind === "min") {
9680
- return 0;
9681
- }
9682
- if (position?.kind === "max") {
9683
- return 1;
9684
- }
9685
- if (position?.kind === "number" && position.value !== void 0) {
9686
- return Math.min(1, Math.max(0, (position.value - minVal) / span));
9687
- }
9688
- if (position?.kind === "percent" && position.value !== void 0) {
9689
- return Math.min(1, Math.max(0, position.value / 100));
9690
- }
9691
- return count === 1 ? 0 : index / (count - 1);
9692
- };
9693
- return valueColors.map((color, index) => ({
9694
- color,
9695
- position: resolvePosition(valueColorPositions?.[index], index)
9696
- }));
9697
- }
9698
- function buildValueColorScale(stops) {
9699
- const sorted = [...stops].sort((a, b) => a.position - b.position);
9700
- return (t) => {
9701
- const clamped = Math.max(0, Math.min(1, t)), first = sorted[0];
9702
- if (!first) {
9703
- return "#94a3b8";
9704
- }
9705
- if (sorted.length === 1) {
9706
- return first.color;
9707
- }
9708
- for (let i = 0; i < sorted.length - 1; i++) {
9709
- const a = sorted[i], b = sorted[i + 1];
9710
- if (clamped >= a.position && clamped <= b.position) {
9711
- return lerpColor(a.color, b.color, (clamped - a.position) / (b.position - a.position || 1));
9712
- }
9713
- }
9714
- const last = sorted[sorted.length - 1] ?? first;
9715
- return clamped <= first.position ? first.color : last.color;
9716
- };
9717
- }
9718
-
9719
- // src/pptx/render/chart-region-map-colors.ts
9720
9509
  var REGION_LEGEND_BANDS = 32;
9721
- function sequentialColorScale(t) {
9722
- const clamped = Math.max(0, Math.min(1, t));
9723
- if (clamped <= 0.5) {
9724
- return lerpColor("#dbeafe", "#3b82f6", clamped * 2);
9725
- }
9726
- return lerpColor("#3b82f6", "#1e3a5f", (clamped - 0.5) * 2);
9727
- }
9728
- function normalizeValue(value, min, max) {
9729
- if (max === min) {
9730
- return 0.5;
9731
- }
9732
- return (value - min) / (max - min);
9733
- }
9734
9510
  function buildRegionMapColorLegend(params) {
9735
9511
  const { svgWidth, legendY, minVal, maxVal, colorScale, attribution, svgHeight } = params;
9736
9512
  const primitives = [];
@@ -9782,202 +9558,6 @@ function buildRegionMapColorLegend(params) {
9782
9558
  return primitives;
9783
9559
  }
9784
9560
 
9785
- // src/pptx/render/chart-map-projection.ts
9786
- var WORLD_REGIONS = [
9787
- {
9788
- code: "US",
9789
- name: "United States",
9790
- 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",
9791
- labelXY: [200, 190]
9792
- },
9793
- {
9794
- code: "CA",
9795
- name: "Canada",
9796
- path: "M120,90 L280,85 290,100 295,130 280,150 250,155 200,155 160,155 130,155 115,140 110,115Z",
9797
- labelXY: [200, 125]
9798
- },
9799
- {
9800
- code: "MX",
9801
- name: "Mexico",
9802
- path: "M145,215 L200,220 210,235 200,255 185,265 165,260 150,245 140,230Z",
9803
- labelXY: [175, 240]
9804
- },
9805
- {
9806
- code: "BR",
9807
- name: "Brazil",
9808
- path: "M270,300 L310,280 335,290 340,320 330,355 310,370 285,365 265,345 260,320Z",
9809
- labelXY: [300, 330]
9810
- },
9811
- {
9812
- code: "AR",
9813
- name: "Argentina",
9814
- path: "M260,370 L280,365 290,380 285,410 275,435 260,445 250,425 248,395Z",
9815
- labelXY: [268, 410]
9816
- },
9817
- {
9818
- code: "GB",
9819
- name: "United Kingdom",
9820
- path: "M440,120 L448,110 455,115 455,135 448,142 440,138Z",
9821
- labelXY: [448, 128]
9822
- },
9823
- {
9824
- code: "FR",
9825
- name: "France",
9826
- path: "M450,145 L470,140 480,150 478,168 465,175 450,170 445,158Z",
9827
- labelXY: [463, 158]
9828
- },
9829
- {
9830
- code: "DE",
9831
- name: "Germany",
9832
- path: "M478,125 L498,120 505,130 502,148 490,152 478,148 475,138Z",
9833
- labelXY: [490, 138]
9834
- },
9835
- {
9836
- code: "IT",
9837
- name: "Italy",
9838
- path: "M490,155 L498,152 505,162 500,180 492,190 488,178 486,165Z",
9839
- labelXY: [495, 172]
9840
- },
9841
- {
9842
- code: "ES",
9843
- name: "Spain",
9844
- path: "M432,168 L460,165 465,175 460,188 442,192 430,185 428,175Z",
9845
- labelXY: [448, 180]
9846
- },
9847
- {
9848
- code: "RU",
9849
- name: "Russia",
9850
- 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",
9851
- labelXY: [670, 85]
9852
- },
9853
- {
9854
- code: "TR",
9855
- name: "Turkey",
9856
- path: "M530,165 L570,160 585,170 580,182 555,185 530,180Z",
9857
- labelXY: [558, 175]
9858
- },
9859
- {
9860
- code: "EG",
9861
- name: "Egypt",
9862
- path: "M530,200 L555,195 565,205 560,225 545,230 530,222Z",
9863
- labelXY: [548, 215]
9864
- },
9865
- {
9866
- code: "NG",
9867
- name: "Nigeria",
9868
- path: "M475,275 L500,270 510,280 505,298 490,302 475,295Z",
9869
- labelXY: [492, 288]
9870
- },
9871
- {
9872
- code: "ZA",
9873
- name: "South Africa",
9874
- path: "M520,380 L545,370 560,380 555,400 540,410 520,405 515,392Z",
9875
- labelXY: [538, 392]
9876
- },
9877
- {
9878
- code: "SA",
9879
- name: "Saudi Arabia",
9880
- path: "M565,220 L600,210 615,225 610,250 590,258 570,250 560,238Z",
9881
- labelXY: [590, 238]
9882
- },
9883
- {
9884
- code: "IN",
9885
- name: "India",
9886
- path: "M640,210 L665,195 685,210 688,240 678,268 660,278 645,265 635,240Z",
9887
- labelXY: [662, 240]
9888
- },
9889
- {
9890
- code: "CN",
9891
- name: "China",
9892
- path: "M700,120 L775,115 800,130 805,160 790,180 760,185 730,180 710,168 695,150 690,135Z",
9893
- labelXY: [750, 155]
9894
- },
9895
- {
9896
- code: "JP",
9897
- name: "Japan",
9898
- path: "M835,145 L845,135 852,140 850,158 842,165 835,160Z",
9899
- labelXY: [843, 152]
9900
- },
9901
- {
9902
- code: "KR",
9903
- name: "South Korea",
9904
- path: "M815,158 L825,152 830,160 827,170 818,172 813,165Z",
9905
- labelXY: [822, 163]
9906
- },
9907
- {
9908
- code: "ID",
9909
- name: "Indonesia",
9910
- path: "M740,295 L780,288 810,292 830,298 825,310 790,312 755,308 740,305Z",
9911
- labelXY: [785, 302]
9912
- },
9913
- {
9914
- code: "AU",
9915
- name: "Australia",
9916
- path: "M790,350 L850,340 880,355 885,385 870,405 840,410 810,400 790,380Z",
9917
- labelXY: [838, 378]
9918
- }
9919
- ];
9920
- function regionBounds(region) {
9921
- const coordinates = region.path.match(/-?\d+(?:\.\d+)?/gu)?.map(Number) ?? [];
9922
- const xs = [];
9923
- const ys = [];
9924
- for (let index = 0; index < coordinates.length; index += 2) {
9925
- xs.push(coordinates[index] ?? 0);
9926
- ys.push(coordinates[index + 1] ?? 0);
9927
- }
9928
- return {
9929
- minX: Math.min(...xs),
9930
- minY: Math.min(...ys),
9931
- maxX: Math.max(...xs),
9932
- maxY: Math.max(...ys)
9933
- };
9934
- }
9935
- function regionViewBounds(viewedRegionType, regionValues) {
9936
- if (!viewedRegionType || viewedRegionType === "world" || regionValues.size === 0) {
9937
- return { minX: 0, minY: 0, maxX: 1e3, maxY: 500 };
9938
- }
9939
- const matched = WORLD_REGIONS.filter((region) => regionValues.has(region.code));
9940
- const targets = viewedRegionType === "countryRegion" ? matched.slice(0, 1) : matched;
9941
- if (targets.length === 0) {
9942
- return { minX: 0, minY: 0, maxX: 1e3, maxY: 500 };
9943
- }
9944
- const bounds = targets.map(regionBounds);
9945
- const padding = 10;
9946
- return {
9947
- minX: Math.max(0, Math.min(...bounds.map((item) => item.minX)) - padding),
9948
- minY: Math.max(0, Math.min(...bounds.map((item) => item.minY)) - padding),
9949
- maxX: Math.min(1e3, Math.max(...bounds.map((item) => item.maxX)) + padding),
9950
- maxY: Math.min(500, Math.max(...bounds.map((item) => item.maxY)) + padding)
9951
- };
9952
- }
9953
- function scalePathD(d, scale, dx, dy) {
9954
- const tokens = d.match(/[A-Za-z]|-?\d+(?:\.\d+)?/gu) ?? [];
9955
- const out = [];
9956
- let i = 0;
9957
- while (i < tokens.length) {
9958
- const tok = tokens[i];
9959
- if (tok === void 0) {
9960
- i++;
9961
- continue;
9962
- }
9963
- if (/^[A-Za-z]$/u.test(tok)) {
9964
- out.push(tok);
9965
- i++;
9966
- continue;
9967
- }
9968
- const xRaw = parseFloat(tok);
9969
- const yRaw = parseFloat(tokens[i + 1] ?? "");
9970
- if (!Number.isNaN(xRaw) && !Number.isNaN(yRaw)) {
9971
- out.push(`${(xRaw * scale + dx).toFixed(2)},${(yRaw * scale + dy).toFixed(2)}`);
9972
- i += 2;
9973
- } else {
9974
- out.push(tok);
9975
- i++;
9976
- }
9977
- }
9978
- return out.join(" ");
9979
- }
9980
-
9981
9561
  // src/pptx/render/chart-region-map-fallback-table.ts
9982
9562
  var FALLBACK_ROW_HEIGHT = 14;
9983
9563
  function fallbackTableHeight(unmatchedRows) {
@@ -10069,23 +9649,23 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10069
9649
  const categories = categoryLabels.length > 0 ? categoryLabels : chartData.categories;
10070
9650
  const series = chartData.series[0];
10071
9651
  const options = series?.regionMapOptions;
10072
- const entries = buildRegionMapEntries(
10073
- categories,
10074
- series?.values ?? [],
10075
- options,
10076
- resolveRegionCode
10077
- );
9652
+ const geometry = regionMap.regionMapGeometry(options);
9653
+ const regions = geometry.regions;
9654
+ const resolve2 = (label) => regions.find(
9655
+ (r) => r.entityId === label || r.code === label || r.name.toLowerCase() === label.toLowerCase()
9656
+ )?.code ?? regionMap.resolveRegionCode(label);
9657
+ const entries = regionMap.buildRegionMapEntries(categories, series?.values ?? [], options, resolve2);
10078
9658
  const values = entries.map((entry) => entry.value);
10079
9659
  const finiteVals = values.filter((v) => Number.isFinite(v));
10080
9660
  const minVal = finiteVals.length > 0 ? Math.min(...finiteVals) : 0;
10081
9661
  const maxVal = finiteVals.length > 0 ? Math.max(...finiteVals) : 1;
10082
- const valueColorStops = resolveValueColorStops(
9662
+ const valueColorStops = regionMap.resolveValueColorStops(
10083
9663
  options?.valueColors,
10084
9664
  options?.valueColorPositions,
10085
9665
  minVal,
10086
9666
  maxVal
10087
9667
  );
10088
- const colorScale = valueColorStops ? buildValueColorScale(valueColorStops) : sequentialColorScale;
9668
+ const colorScale = valueColorStops ? regionMap.buildValueColorScale(valueColorStops) : (t) => regionMap.sequentialColorScale(t, series?.color ?? "#4472C4");
10089
9669
  const regionValueMap = /* @__PURE__ */ new Map();
10090
9670
  const unmatchedRows = [];
10091
9671
  for (const entry of entries) {
@@ -10103,7 +9683,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10103
9683
  const fallbackTableH = fallbackTableHeight(unmatchedRows);
10104
9684
  const titleH = chartData.title ? 22 : 0;
10105
9685
  const mapAreaH = Math.max(svgHeight - titleH - legendHeight - fallbackTableH - 8, 80);
10106
- const viewBounds = regionViewBounds(options?.viewedRegionType, regionValueMap);
9686
+ const viewBounds = regionMap.regionViewBounds(options?.viewedRegionType, regionValueMap, regions);
10107
9687
  const viewWidth = Math.max(viewBounds.maxX - viewBounds.minX, 1);
10108
9688
  const viewHeight = Math.max(viewBounds.maxY - viewBounds.minY, 1);
10109
9689
  const mapScale = Math.min((svgWidth - 20) / viewWidth, mapAreaH / viewHeight);
@@ -10130,20 +9710,21 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10130
9710
  fontWeight: "bold",
10131
9711
  dominantBaseline: "auto"
10132
9712
  } : void 0;
10133
- for (const region of WORLD_REGIONS) {
9713
+ for (const region of regions) {
10134
9714
  const entry = regionValueMap.get(region.code);
10135
9715
  let fill = "#e2e8f0";
10136
9716
  if (entry !== void 0) {
10137
- const t = normalizeValue(entry.value, minVal, maxVal);
9717
+ const t = regionMap.normalizeValue(entry.value, minVal, maxVal);
10138
9718
  fill = colorScale(t);
10139
9719
  }
10140
- const scaledPath = scalePathD(region.path, mapScale, mapOffsetX, mapOffsetY);
9720
+ if (options?.fixedColor) fill = options.fixedColor;
9721
+ const scaledPath = regionMap.scalePathD(region.path, mapScale, mapOffsetX, mapOffsetY);
10141
9722
  primitives.push({
10142
9723
  kind: "path",
10143
9724
  d: scaledPath,
10144
9725
  fill,
10145
- stroke: "#94a3b8",
10146
- strokeWidth: Math.max(0.5 / mapScale, 0.3),
9726
+ stroke: series?.lineWidth && !series.lineNoFill ? series.color ?? "#000000" : "none",
9727
+ strokeWidth: series?.lineWidth ?? 0,
10147
9728
  // Hover tooltip. A choropleth prints only the value inside the shape
10148
9729
  // (and only where the shape is big enough), so without this the reader
10149
9730
  // has no way to find out WHICH country a patch of colour is.
@@ -10156,8 +9737,8 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10156
9737
  }
10157
9738
  } : {}
10158
9739
  });
10159
- const bounds = regionBounds(region);
10160
- if (entry !== void 0 && shouldRenderRegionLabel(
9740
+ const bounds = regionMap.regionBounds(region);
9741
+ if (entry !== void 0 && regionMap.shouldRenderRegionLabel(
10161
9742
  options?.regionLabelLayout,
10162
9743
  (bounds.maxX - bounds.minX) * mapScale,
10163
9744
  (bounds.maxY - bounds.minY) * mapScale
@@ -10168,7 +9749,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10168
9749
  kind: "text",
10169
9750
  x: lx,
10170
9751
  y: ly,
10171
- text: formatRegionMapValue(entry.value, options?.cultureLanguage),
9752
+ text: region.name,
10172
9753
  fontSize: Math.max(6, 7 * mapScale),
10173
9754
  fill: "#1e293b",
10174
9755
  textAnchor: "middle",
@@ -10176,6 +9757,24 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10176
9757
  dominantBaseline: "central"
10177
9758
  });
10178
9759
  }
9760
+ if (entry && series && (series.dataLabelOptions || series.dataLabels?.length || chartData.style?.dataLabels)) {
9761
+ const label = buildDataLabelText({
9762
+ chartData,
9763
+ series,
9764
+ pointIndex: entry.sourceIndex,
9765
+ value: entry.value
9766
+ });
9767
+ if (label)
9768
+ primitives.push({
9769
+ kind: "text",
9770
+ x: region.labelXY[0] * mapScale + mapOffsetX,
9771
+ y: region.labelXY[1] * mapScale + mapOffsetY,
9772
+ text: label.text,
9773
+ fontSize: 10,
9774
+ fill: label.color ?? "#000000",
9775
+ textAnchor: "middle"
9776
+ });
9777
+ }
10179
9778
  }
10180
9779
  const legendY = mapOffsetY + mapAreaH + 4;
10181
9780
  primitives.push(
@@ -10190,6 +9789,16 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10190
9789
  })
10191
9790
  );
10192
9791
  primitives.push(...buildRegionMapFallbackTable(unmatchedRows, legendY, svgWidth, svgHeight));
9792
+ if (geometry.approximate)
9793
+ primitives.push({
9794
+ kind: "text",
9795
+ x: 8,
9796
+ y: titleH + 12,
9797
+ text: "\u2248",
9798
+ fontSize: 8,
9799
+ fill: "#595959",
9800
+ textAnchor: "start"
9801
+ });
10193
9802
  const dataLabels = titlePrimitive !== void 0 ? [titlePrimitive] : [];
10194
9803
  const valueDrag = {
10195
9804
  range: { min: minVal, max: maxVal, span: Math.max(maxVal - minVal, Number.EPSILON) },
@@ -10197,6 +9806,7 @@ function buildRegionMapViewModel(element, chartData, categoryLabels) {
10197
9806
  plotBottom: mapOffsetY + mapAreaH
10198
9807
  };
10199
9808
  return {
9809
+ reports: geometry.approximate ? ["approximate-country-outlines"] : [],
10200
9810
  svgWidth,
10201
9811
  svgHeight,
10202
9812
  title: void 0,
@@ -10844,6 +10454,34 @@ Object.defineProperty(exports, "buildRectPathGradientSvg", {
10844
10454
  enumerable: true,
10845
10455
  get: function () { return diagram.buildRectPathGradientSvg; }
10846
10456
  });
10457
+ Object.defineProperty(exports, "buildRegionMapEntries", {
10458
+ enumerable: true,
10459
+ get: function () { return regionMap.buildRegionMapEntries; }
10460
+ });
10461
+ Object.defineProperty(exports, "formatRegionMapValue", {
10462
+ enumerable: true,
10463
+ get: function () { return regionMap.formatRegionMapValue; }
10464
+ });
10465
+ Object.defineProperty(exports, "normalizeValue", {
10466
+ enumerable: true,
10467
+ get: function () { return regionMap.normalizeValue; }
10468
+ });
10469
+ Object.defineProperty(exports, "resolveRegionCode", {
10470
+ enumerable: true,
10471
+ get: function () { return regionMap.resolveRegionCode; }
10472
+ });
10473
+ Object.defineProperty(exports, "resolveRegionEntityCode", {
10474
+ enumerable: true,
10475
+ get: function () { return regionMap.resolveRegionEntityCode; }
10476
+ });
10477
+ Object.defineProperty(exports, "sequentialColorScale", {
10478
+ enumerable: true,
10479
+ get: function () { return regionMap.sequentialColorScale; }
10480
+ });
10481
+ Object.defineProperty(exports, "shouldRenderRegionLabel", {
10482
+ enumerable: true,
10483
+ get: function () { return regionMap.shouldRenderRegionLabel; }
10484
+ });
10847
10485
  exports.AXIS_LABEL_COLOR = AXIS_LABEL_COLOR;
10848
10486
  exports.CHART_PX_PER_PT = CHART_PX_PER_PT;
10849
10487
  exports.CHART_TITLE_FONT_PX = CHART_TITLE_FONT_PX;
@@ -10907,7 +10545,6 @@ exports.buildPrimaryAxis = buildPrimaryAxis;
10907
10545
  exports.buildRadarViewModel = buildRadarViewModel;
10908
10546
  exports.buildRectPathGradient = buildRectPathGradient;
10909
10547
  exports.buildReflectedGradientStops = buildReflectedGradientStops;
10910
- exports.buildRegionMapEntries = buildRegionMapEntries;
10911
10548
  exports.buildRegionMapViewModel = buildRegionMapViewModel;
10912
10549
  exports.buildSecondaryAxis = buildSecondaryAxis;
10913
10550
  exports.buildShapePathGradient = buildShapePathGradient;
@@ -10986,7 +10623,6 @@ exports.fitTitleBand = fitTitleBand;
10986
10623
  exports.formatAxisValue = formatAxisValue;
10987
10624
  exports.formatAxisValue2 = formatAxisValue2;
10988
10625
  exports.formatAxisValueWithUnits = formatAxisValueWithUnits;
10989
- exports.formatRegionMapValue = formatRegionMapValue;
10990
10626
  exports.getBarFacePicturePixelSampleVersion = getBarFacePicturePixelSampleVersion;
10991
10627
  exports.getCachedBarFacePicturePixelColor = getCachedBarFacePicturePixelColor;
10992
10628
  exports.getCompoundLineBorderWidth = getCompoundLineBorderWidth;
@@ -11025,7 +10661,6 @@ exports.manualTitleAnchor = manualTitleAnchor;
11025
10661
  exports.measureChartTextWidth = measureChartTextWidth;
11026
10662
  exports.multiplyTextOrientationMatrices = multiplyTextOrientationMatrices;
11027
10663
  exports.normalizeStrokeDashType = normalizeStrokeDashType;
11028
- exports.normalizeValue = normalizeValue;
11029
10664
  exports.orderParetoEntries = orderParetoEntries;
11030
10665
  exports.paletteColor = paletteColor;
11031
10666
  exports.paletteColor2 = paletteColor2;
@@ -11059,19 +10694,15 @@ exports.resolveLegendPlacement = resolveLegendPlacement;
11059
10694
  exports.resolveLegendSwatchKind = resolveLegendSwatchKind;
11060
10695
  exports.resolveMarkerLabelAnchor = resolveMarkerLabelAnchor;
11061
10696
  exports.resolveMarkerLabelPlacement = resolveMarkerLabelPlacement;
11062
- exports.resolveRegionCode = resolveRegionCode;
11063
- exports.resolveRegionEntityCode = resolveRegionEntityCode;
11064
10697
  exports.resolveUntargetedBarFaceFill = resolveUntargetedBarFaceFill;
11065
10698
  exports.resolveVaryColorFill = resolveVaryColorFill;
11066
10699
  exports.sanitizeGradientStops = sanitizeGradientStops;
11067
- exports.sequentialColorScale = sequentialColorScale;
11068
10700
  exports.seriesColor = seriesColor;
11069
10701
  exports.seriesColor2 = seriesColor2;
11070
10702
  exports.seriesXValues = seriesXValues;
11071
10703
  exports.setBoundedRenderCache = setBoundedRenderCache;
11072
10704
  exports.setChartTextMeasurer = setChartTextMeasurer;
11073
10705
  exports.shouldRenderMajorGridlines = shouldRenderMajorGridlines;
11074
- exports.shouldRenderRegionLabel = shouldRenderRegionLabel;
11075
10706
  exports.splitLabelLines = splitLabelLines;
11076
10707
  exports.splitSeriesByAxis = splitSeriesByAxis;
11077
10708
  exports.stackedBarWidth = stackedBarWidth;