ooxml-core 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (870) hide show
  1. package/README.md +18 -18
  2. package/dist/{PptxHandler-75LOVF7I.mjs → PptxHandler-VQQS4VS6.mjs} +3 -3
  3. package/dist/automation/index.cjs +7567 -4401
  4. package/dist/automation/index.mjs +7567 -4401
  5. package/dist/chart/bar-cluster-geometry.d.ts +6 -0
  6. package/dist/chart/bar-cluster-geometry.d.ts.map +1 -1
  7. package/dist/chart/color-palettes.d.ts +2 -2
  8. package/dist/chart/color-palettes.d.ts.map +1 -1
  9. package/dist/chart/data-cache.d.ts +6 -0
  10. package/dist/chart/data-cache.d.ts.map +1 -0
  11. package/dist/chart/gradient-coincident-stops.d.ts +17 -0
  12. package/dist/chart/gradient-coincident-stops.d.ts.map +1 -0
  13. package/dist/chart/gradient-definition.d.ts +3 -3
  14. package/dist/chart/gradient-definition.d.ts.map +1 -1
  15. package/dist/chart/index.cjs +3069 -140
  16. package/dist/chart/index.d.ts +7 -0
  17. package/dist/chart/index.d.ts.map +1 -1
  18. package/dist/chart/index.mjs +3048 -141
  19. package/dist/chart/model-chrome.d.ts +39 -0
  20. package/dist/chart/model-chrome.d.ts.map +1 -0
  21. package/dist/chart/model-series.d.ts +189 -0
  22. package/dist/chart/model-series.d.ts.map +1 -0
  23. package/dist/chart/model.d.ts +202 -0
  24. package/dist/chart/model.d.ts.map +1 -0
  25. package/dist/chart/parse-chrome.d.ts +16 -0
  26. package/dist/chart/parse-chrome.d.ts.map +1 -0
  27. package/dist/chart/parse-plot.d.ts +11 -0
  28. package/dist/chart/parse-plot.d.ts.map +1 -0
  29. package/dist/chart/parse-series.d.ts +8 -0
  30. package/dist/chart/parse-series.d.ts.map +1 -0
  31. package/dist/chart/parse-space.d.ts +8 -0
  32. package/dist/chart/parse-space.d.ts.map +1 -0
  33. package/dist/chart/parse-text.d.ts +12 -0
  34. package/dist/chart/parse-text.d.ts.map +1 -0
  35. package/dist/chart/parse-util.d.ts +42 -0
  36. package/dist/chart/parse-util.d.ts.map +1 -0
  37. package/dist/{xlsx/layout → chart/render}/chart-appearance.d.ts +4 -4
  38. package/dist/chart/render/chart-appearance.d.ts.map +1 -0
  39. package/dist/chart/render/chart-colors.d.ts +9 -0
  40. package/dist/chart/render/chart-colors.d.ts.map +1 -0
  41. package/dist/chart/render/chart-scale.d.ts.map +1 -0
  42. package/dist/chart/render/chart-spacing.d.ts +6 -0
  43. package/dist/chart/render/chart-spacing.d.ts.map +1 -0
  44. package/dist/{xlsx/layout → chart/render}/chart-svg-appearance.d.ts +1 -1
  45. package/dist/chart/render/chart-svg-appearance.d.ts.map +1 -0
  46. package/dist/chart/render/chart-svg-bars.d.ts.map +1 -0
  47. package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -0
  48. package/dist/chart/render/chart-svg-legend.d.ts.map +1 -0
  49. package/dist/chart/render/chart-svg-radial.d.ts.map +1 -0
  50. package/dist/chart/render/chart-svg-text-metrics.d.ts.map +1 -0
  51. package/dist/chart/render/chart-svg-title-text.d.ts.map +1 -0
  52. package/dist/chart/render/chart-svg-util.d.ts.map +1 -0
  53. package/dist/chart/render/chart-svg.d.ts.map +1 -0
  54. package/dist/chart/render/chart-title-text.d.ts +14 -0
  55. package/dist/chart/render/chart-title-text.d.ts.map +1 -0
  56. package/dist/chart/render/chart-value-axis.d.ts +6 -0
  57. package/dist/chart/render/chart-value-axis.d.ts.map +1 -0
  58. package/dist/chart/render/chart-view.d.ts +71 -0
  59. package/dist/chart/render/chart-view.d.ts.map +1 -0
  60. package/dist/chart/render/index.d.ts +9 -0
  61. package/dist/chart/render/index.d.ts.map +1 -0
  62. package/dist/chart/render/render-space.d.ts +34 -0
  63. package/dist/chart/render/render-space.d.ts.map +1 -0
  64. package/dist/chart/render/summary-from-space.d.ts +15 -0
  65. package/dist/chart/render/summary-from-space.d.ts.map +1 -0
  66. package/dist/chart/render/summary.d.ts +51 -0
  67. package/dist/chart/render/summary.d.ts.map +1 -0
  68. package/dist/chart/render/theme-palette.d.ts +8 -0
  69. package/dist/chart/render/theme-palette.d.ts.map +1 -0
  70. package/dist/chart/style-definition.d.ts +7 -7
  71. package/dist/chart/style-definition.d.ts.map +1 -1
  72. package/dist/chart/write-axes.d.ts +5 -0
  73. package/dist/chart/write-axes.d.ts.map +1 -0
  74. package/dist/chart/write-chrome.d.ts +9 -0
  75. package/dist/chart/write-chrome.d.ts.map +1 -0
  76. package/dist/chart/write-plot.d.ts +7 -0
  77. package/dist/chart/write-plot.d.ts.map +1 -0
  78. package/dist/chart/write-series.d.ts +7 -0
  79. package/dist/chart/write-series.d.ts.map +1 -0
  80. package/dist/chart/write-shape.d.ts +21 -0
  81. package/dist/chart/write-shape.d.ts.map +1 -0
  82. package/dist/chart/write-space.d.ts +15 -0
  83. package/dist/chart/write-space.d.ts.map +1 -0
  84. package/dist/chart/write-text-body.d.ts +6 -0
  85. package/dist/chart/write-text-body.d.ts.map +1 -0
  86. package/dist/chart/write-text.d.ts +15 -0
  87. package/dist/chart/write-text.d.ts.map +1 -0
  88. package/dist/chart/write-util.d.ts +24 -0
  89. package/dist/chart/write-util.d.ts.map +1 -0
  90. package/dist/chart/xml-fragment.d.ts +13 -0
  91. package/dist/chart/xml-fragment.d.ts.map +1 -0
  92. package/dist/{chunk-HUBK4EOT.mjs → chunk-3IT6ZD7K.mjs} +2 -0
  93. package/dist/{chunk-TS3E27NK.mjs → chunk-3UMDVJRN.mjs} +12 -1
  94. package/dist/{chunk-P22OKTRK.mjs → chunk-54S5A5PZ.mjs} +208 -159
  95. package/dist/{chunk-OMGH6IKY.mjs → chunk-5U27IVB7.mjs} +42 -5
  96. package/dist/{chunk-RFX7AJDZ.mjs → chunk-5VLNF4OX.mjs} +2 -2
  97. package/dist/{chunk-OJI3N5AY.cjs → chunk-FRUB573B.cjs} +2 -0
  98. package/dist/{chunk-75LA7H3F.mjs → chunk-V2BIGIH4.mjs} +27504 -27464
  99. package/dist/{chunk-Q27H4HFS.mjs → chunk-XBNSBDNT.mjs} +1 -1
  100. package/dist/{chunk-2C72N64G.cjs → chunk-XROY25LN.cjs} +12 -0
  101. package/dist/{chunk-LA7D6ZYQ.mjs → chunk-XSFHGZFH.mjs} +3579 -2083
  102. package/dist/collab/index.cjs +1 -0
  103. package/dist/collab/index.mjs +1 -0
  104. package/dist/collab/transport-provider.d.ts.map +1 -1
  105. package/dist/color/hex-rgb.d.ts +5 -0
  106. package/dist/color/hex-rgb.d.ts.map +1 -0
  107. package/dist/color/index.cjs +12 -0
  108. package/dist/color/index.d.ts +1 -0
  109. package/dist/color/index.d.ts.map +1 -1
  110. package/dist/color/index.mjs +11 -1
  111. package/dist/diagram/engine/alg-composite.d.ts +18 -0
  112. package/dist/diagram/engine/alg-composite.d.ts.map +1 -0
  113. package/dist/diagram/engine/alg-connector.d.ts +17 -0
  114. package/dist/diagram/engine/alg-connector.d.ts.map +1 -0
  115. package/dist/diagram/engine/alg-cycle.d.ts +28 -0
  116. package/dist/diagram/engine/alg-cycle.d.ts.map +1 -0
  117. package/dist/diagram/engine/alg-hier.d.ts +33 -0
  118. package/dist/diagram/engine/alg-hier.d.ts.map +1 -0
  119. package/dist/diagram/engine/alg-linear.d.ts +24 -0
  120. package/dist/diagram/engine/alg-linear.d.ts.map +1 -0
  121. package/dist/diagram/engine/alg-pyra.d.ts +117 -0
  122. package/dist/diagram/engine/alg-pyra.d.ts.map +1 -0
  123. package/dist/diagram/engine/alg-snake.d.ts +21 -0
  124. package/dist/diagram/engine/alg-snake.d.ts.map +1 -0
  125. package/dist/diagram/engine/axis.d.ts +24 -0
  126. package/dist/diagram/engine/axis.d.ts.map +1 -0
  127. package/dist/diagram/engine/conditions.d.ts +12 -0
  128. package/dist/diagram/engine/conditions.d.ts.map +1 -0
  129. package/dist/diagram/engine/connector-shape.d.ts +25 -0
  130. package/dist/diagram/engine/connector-shape.d.ts.map +1 -0
  131. package/dist/diagram/engine/connector-size.d.ts +30 -0
  132. package/dist/diagram/engine/connector-size.d.ts.map +1 -0
  133. package/dist/diagram/engine/constraint-eval.d.ts +37 -0
  134. package/dist/diagram/engine/constraint-eval.d.ts.map +1 -0
  135. package/dist/diagram/engine/constraint-fill-idiom.d.ts +61 -0
  136. package/dist/diagram/engine/constraint-fill-idiom.d.ts.map +1 -0
  137. package/dist/diagram/engine/constraint-units.d.ts +35 -0
  138. package/dist/diagram/engine/constraint-units.d.ts.map +1 -0
  139. package/dist/diagram/engine/data-points.d.ts +48 -0
  140. package/dist/diagram/engine/data-points.d.ts.map +1 -0
  141. package/dist/diagram/engine/engine-context.d.ts +21 -0
  142. package/dist/diagram/engine/engine-context.d.ts.map +1 -0
  143. package/dist/diagram/engine/engine-first-allowlist.d.ts +31 -0
  144. package/dist/diagram/engine/engine-first-allowlist.d.ts.map +1 -0
  145. package/dist/diagram/engine/engine-fonts.d.ts +26 -0
  146. package/dist/diagram/engine/engine-fonts.d.ts.map +1 -0
  147. package/dist/diagram/engine/engine-node.d.ts +72 -0
  148. package/dist/diagram/engine/engine-node.d.ts.map +1 -0
  149. package/dist/diagram/engine/engine-to-result.d.ts +43 -0
  150. package/dist/diagram/engine/engine-to-result.d.ts.map +1 -0
  151. package/dist/diagram/engine/engine.d.ts +18 -0
  152. package/dist/diagram/engine/engine.d.ts.map +1 -0
  153. package/dist/diagram/engine/font-groups.d.ts +33 -0
  154. package/dist/diagram/engine/font-groups.d.ts.map +1 -0
  155. package/dist/diagram/engine/font-length.d.ts +26 -0
  156. package/dist/diagram/engine/font-length.d.ts.map +1 -0
  157. package/dist/diagram/engine/font-search.d.ts +38 -0
  158. package/dist/diagram/engine/font-search.d.ts.map +1 -0
  159. package/dist/diagram/engine/hier-assistants.d.ts +47 -0
  160. package/dist/diagram/engine/hier-assistants.d.ts.map +1 -0
  161. package/dist/diagram/engine/hier-hang.d.ts +28 -0
  162. package/dist/diagram/engine/hier-hang.d.ts.map +1 -0
  163. package/dist/diagram/engine/hier-measure.d.ts +33 -0
  164. package/dist/diagram/engine/hier-measure.d.ts.map +1 -0
  165. package/dist/diagram/engine/hier-node-size.d.ts +23 -0
  166. package/dist/diagram/engine/hier-node-size.d.ts.map +1 -0
  167. package/dist/diagram/engine/hier-shape.d.ts +31 -0
  168. package/dist/diagram/engine/hier-shape.d.ts.map +1 -0
  169. package/dist/diagram/engine/index.d.ts +6 -0
  170. package/dist/diagram/engine/index.d.ts.map +1 -0
  171. package/dist/diagram/engine/layout-def-parse.d.ts +13 -0
  172. package/dist/diagram/engine/layout-def-parse.d.ts.map +1 -0
  173. package/dist/diagram/engine/layout-def-types.d.ts +118 -0
  174. package/dist/diagram/engine/layout-def-types.d.ts.map +1 -0
  175. package/dist/diagram/engine/layout-driver.d.ts +41 -0
  176. package/dist/diagram/engine/layout-driver.d.ts.map +1 -0
  177. package/dist/diagram/engine/layout-font.d.ts +27 -0
  178. package/dist/diagram/engine/layout-font.d.ts.map +1 -0
  179. package/dist/diagram/engine/move-with-merge.d.ts +49 -0
  180. package/dist/diagram/engine/move-with-merge.d.ts.map +1 -0
  181. package/dist/diagram/engine/node-text.d.ts +20 -0
  182. package/dist/diagram/engine/node-text.d.ts.map +1 -0
  183. package/dist/diagram/engine/ordered-xml.d.ts +30 -0
  184. package/dist/diagram/engine/ordered-xml.d.ts.map +1 -0
  185. package/dist/diagram/engine/preferred-size.d.ts +28 -0
  186. package/dist/diagram/engine/preferred-size.d.ts.map +1 -0
  187. package/dist/diagram/engine/pres-tree.d.ts +58 -0
  188. package/dist/diagram/engine/pres-tree.d.ts.map +1 -0
  189. package/dist/diagram/engine/registry.d.ts +7 -0
  190. package/dist/diagram/engine/registry.d.ts.map +1 -0
  191. package/dist/diagram/engine/render-filter.d.ts +43 -0
  192. package/dist/diagram/engine/render-filter.d.ts.map +1 -0
  193. package/dist/diagram/engine/shape-adjust.d.ts +16 -0
  194. package/dist/diagram/engine/shape-adjust.d.ts.map +1 -0
  195. package/dist/diagram/engine/shape-transform.d.ts +14 -0
  196. package/dist/diagram/engine/shape-transform.d.ts.map +1 -0
  197. package/dist/diagram/engine/snake-rule-fit.d.ts +34 -0
  198. package/dist/diagram/engine/snake-rule-fit.d.ts.map +1 -0
  199. package/dist/diagram/engine/style-label.d.ts +24 -0
  200. package/dist/diagram/engine/style-label.d.ts.map +1 -0
  201. package/dist/diagram/engine/text-fit.d.ts +61 -0
  202. package/dist/diagram/engine/text-fit.d.ts.map +1 -0
  203. package/dist/diagram/engine/text-grow.d.ts +33 -0
  204. package/dist/diagram/engine/text-grow.d.ts.map +1 -0
  205. package/dist/diagram/engine/text-measure.d.ts +77 -0
  206. package/dist/diagram/engine/text-measure.d.ts.map +1 -0
  207. package/dist/diagram/hierarchy/index.d.ts +5 -0
  208. package/dist/diagram/hierarchy/index.d.ts.map +1 -0
  209. package/dist/diagram/hierarchy/smartart-hierarchy-axis-pitch.d.ts +65 -0
  210. package/dist/diagram/hierarchy/smartart-hierarchy-axis-pitch.d.ts.map +1 -0
  211. package/dist/diagram/hierarchy/smartart-hierarchy-axis-swap-orientation.d.ts +68 -0
  212. package/dist/diagram/hierarchy/smartart-hierarchy-axis-swap-orientation.d.ts.map +1 -0
  213. package/dist/diagram/hierarchy/smartart-hierarchy-branch-mode.d.ts +54 -0
  214. package/dist/diagram/hierarchy/smartart-hierarchy-branch-mode.d.ts.map +1 -0
  215. package/dist/diagram/hierarchy/smartart-hierarchy-cascade.d.ts +58 -0
  216. package/dist/diagram/hierarchy/smartart-hierarchy-cascade.d.ts.map +1 -0
  217. package/dist/diagram/hierarchy/smartart-hierarchy-centered-fan-axis.d.ts +63 -0
  218. package/dist/diagram/hierarchy/smartart-hierarchy-centered-fan-axis.d.ts.map +1 -0
  219. package/dist/diagram/hierarchy/smartart-hierarchy-child-order.d.ts +41 -0
  220. package/dist/diagram/hierarchy/smartart-hierarchy-child-order.d.ts.map +1 -0
  221. package/dist/diagram/hierarchy/smartart-hierarchy-composite-child.d.ts +129 -0
  222. package/dist/diagram/hierarchy/smartart-hierarchy-composite-child.d.ts.map +1 -0
  223. package/dist/diagram/hierarchy/smartart-hierarchy-constraint-lookup.d.ts +76 -0
  224. package/dist/diagram/hierarchy/smartart-hierarchy-constraint-lookup.d.ts.map +1 -0
  225. package/dist/diagram/hierarchy/smartart-hierarchy-corner-plan.d.ts +49 -0
  226. package/dist/diagram/hierarchy/smartart-hierarchy-corner-plan.d.ts.map +1 -0
  227. package/dist/diagram/hierarchy/smartart-hierarchy-dispatch-lindir.d.ts +58 -0
  228. package/dist/diagram/hierarchy/smartart-hierarchy-dispatch-lindir.d.ts.map +1 -0
  229. package/dist/diagram/hierarchy/smartart-hierarchy-fan-aware-width.d.ts +48 -0
  230. package/dist/diagram/hierarchy/smartart-hierarchy-fan-aware-width.d.ts.map +1 -0
  231. package/dist/diagram/hierarchy/smartart-hierarchy-fan.d.ts +97 -0
  232. package/dist/diagram/hierarchy/smartart-hierarchy-fan.d.ts.map +1 -0
  233. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang-geometry.d.ts +42 -0
  234. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang-geometry.d.ts.map +1 -0
  235. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang.d.ts +74 -0
  236. package/dist/diagram/hierarchy/smartart-hierarchy-fanned-hang.d.ts.map +1 -0
  237. package/dist/diagram/hierarchy/smartart-hierarchy-fit-item-box.d.ts +111 -0
  238. package/dist/diagram/hierarchy/smartart-hierarchy-fit-item-box.d.ts.map +1 -0
  239. package/dist/diagram/hierarchy/smartart-hierarchy-fold-depth.d.ts +44 -0
  240. package/dist/diagram/hierarchy/smartart-hierarchy-fold-depth.d.ts.map +1 -0
  241. package/dist/diagram/hierarchy/smartart-hierarchy-generation-gap.d.ts +60 -0
  242. package/dist/diagram/hierarchy/smartart-hierarchy-generation-gap.d.ts.map +1 -0
  243. package/dist/diagram/hierarchy/smartart-hierarchy-generation-templates.d.ts +106 -0
  244. package/dist/diagram/hierarchy/smartart-hierarchy-generation-templates.d.ts.map +1 -0
  245. package/dist/diagram/hierarchy/smartart-hierarchy-hang-depth.d.ts +133 -0
  246. package/dist/diagram/hierarchy/smartart-hierarchy-hang-depth.d.ts.map +1 -0
  247. package/dist/diagram/hierarchy/smartart-hierarchy-hang-dispatch.d.ts +28 -0
  248. package/dist/diagram/hierarchy/smartart-hierarchy-hang-dispatch.d.ts.map +1 -0
  249. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-arrange.d.ts +28 -0
  250. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-arrange.d.ts.map +1 -0
  251. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-box.d.ts +86 -0
  252. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-box.d.ts.map +1 -0
  253. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-fold.d.ts +36 -0
  254. package/dist/diagram/hierarchy/smartart-hierarchy-hanging-fold.d.ts.map +1 -0
  255. package/dist/diagram/hierarchy/smartart-hierarchy-hanging.d.ts +118 -0
  256. package/dist/diagram/hierarchy/smartart-hierarchy-hanging.d.ts.map +1 -0
  257. package/dist/diagram/hierarchy/smartart-hierarchy-item-template.d.ts +64 -0
  258. package/dist/diagram/hierarchy/smartart-hierarchy-item-template.d.ts.map +1 -0
  259. package/dist/diagram/hierarchy/smartart-hierarchy-orgchart-tree.d.ts +53 -0
  260. package/dist/diagram/hierarchy/smartart-hierarchy-orgchart-tree.d.ts.map +1 -0
  261. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-resolve.d.ts +36 -0
  262. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-resolve.d.ts.map +1 -0
  263. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-types.d.ts +81 -0
  264. package/dist/diagram/hierarchy/smartart-hierarchy-orientation-types.d.ts.map +1 -0
  265. package/dist/diagram/hierarchy/smartart-hierarchy-orientation.d.ts +78 -0
  266. package/dist/diagram/hierarchy/smartart-hierarchy-orientation.d.ts.map +1 -0
  267. package/dist/diagram/hierarchy/smartart-hierarchy-pitch.d.ts +140 -0
  268. package/dist/diagram/hierarchy/smartart-hierarchy-pitch.d.ts.map +1 -0
  269. package/dist/diagram/hierarchy/smartart-hierarchy-shared.d.ts +131 -0
  270. package/dist/diagram/hierarchy/smartart-hierarchy-shared.d.ts.map +1 -0
  271. package/dist/diagram/hierarchy/smartart-hierarchy-standard-options.d.ts +91 -0
  272. package/dist/diagram/hierarchy/smartart-hierarchy-standard-options.d.ts.map +1 -0
  273. package/dist/diagram/hierarchy/smartart-hierarchy-standard-rows.d.ts +21 -0
  274. package/dist/diagram/hierarchy/smartart-hierarchy-standard-rows.d.ts.map +1 -0
  275. package/dist/diagram/hierarchy/smartart-hierarchy-standard.d.ts +36 -0
  276. package/dist/diagram/hierarchy/smartart-hierarchy-standard.d.ts.map +1 -0
  277. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-placer.d.ts +20 -0
  278. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-placer.d.ts.map +1 -0
  279. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-transpose.d.ts +50 -0
  280. package/dist/diagram/hierarchy/smartart-hierarchy-tailed-transpose.d.ts.map +1 -0
  281. package/dist/diagram/hierarchy/smartart-hierarchy-transpose.d.ts +23 -0
  282. package/dist/diagram/hierarchy/smartart-hierarchy-transpose.d.ts.map +1 -0
  283. package/dist/diagram/hierarchy/smartart-hierarchy-transposed-orientation.d.ts +22 -0
  284. package/dist/diagram/hierarchy/smartart-hierarchy-transposed-orientation.d.ts.map +1 -0
  285. package/dist/diagram/hierarchy/smartart-hierarchy-wrapped-groups.d.ts +93 -0
  286. package/dist/diagram/hierarchy/smartart-hierarchy-wrapped-groups.d.ts.map +1 -0
  287. package/dist/diagram/hierarchy/smartart-layout-interpreter-hierarchy.d.ts +49 -0
  288. package/dist/diagram/hierarchy/smartart-layout-interpreter-hierarchy.d.ts.map +1 -0
  289. package/dist/diagram/index.cjs +22537 -80
  290. package/dist/diagram/index.d.ts +4 -0
  291. package/dist/diagram/index.d.ts.map +1 -1
  292. package/dist/diagram/index.mjs +22453 -81
  293. package/dist/diagram/layout/index.d.ts +38 -0
  294. package/dist/diagram/layout/index.d.ts.map +1 -0
  295. package/dist/diagram/layout/smartart-choose-xml.d.ts +32 -0
  296. package/dist/diagram/layout/smartart-choose-xml.d.ts.map +1 -0
  297. package/dist/diagram/layout/smartart-constraint-branch-index.d.ts +49 -0
  298. package/dist/diagram/layout/smartart-constraint-branch-index.d.ts.map +1 -0
  299. package/dist/diagram/layout/smartart-constraint-declared-by.d.ts +64 -0
  300. package/dist/diagram/layout/smartart-constraint-declared-by.d.ts.map +1 -0
  301. package/dist/diagram/layout/smartart-constraint-ratio-fallback.d.ts +18 -0
  302. package/dist/diagram/layout/smartart-constraint-ratio-fallback.d.ts.map +1 -0
  303. package/dist/diagram/layout/smartart-constraint-resolve.d.ts +24 -0
  304. package/dist/diagram/layout/smartart-constraint-resolve.d.ts.map +1 -0
  305. package/dist/diagram/layout/smartart-constraint-rules.d.ts +26 -0
  306. package/dist/diagram/layout/smartart-constraint-rules.d.ts.map +1 -0
  307. package/dist/diagram/layout/smartart-constraint-sibling-roles.d.ts +100 -0
  308. package/dist/diagram/layout/smartart-constraint-sibling-roles.d.ts.map +1 -0
  309. package/dist/diagram/layout/smartart-constraint-solver.d.ts +133 -0
  310. package/dist/diagram/layout/smartart-constraint-solver.d.ts.map +1 -0
  311. package/dist/diagram/layout/smartart-constraint-values.d.ts +5 -0
  312. package/dist/diagram/layout/smartart-constraint-values.d.ts.map +1 -0
  313. package/dist/diagram/layout/smartart-font-table.d.ts +14 -0
  314. package/dist/diagram/layout/smartart-font-table.d.ts.map +1 -0
  315. package/dist/diagram/layout/smartart-interpreter-fold-text.d.ts +75 -0
  316. package/dist/diagram/layout/smartart-interpreter-fold-text.d.ts.map +1 -0
  317. package/dist/diagram/layout/smartart-layout-control-flow.d.ts +25 -0
  318. package/dist/diagram/layout/smartart-layout-control-flow.d.ts.map +1 -0
  319. package/dist/diagram/layout/smartart-layout-interpreter-arranged-selection.d.ts +56 -0
  320. package/dist/diagram/layout/smartart-layout-interpreter-arranged-selection.d.ts.map +1 -0
  321. package/dist/diagram/layout/smartart-layout-interpreter-arrangement-kind.d.ts +37 -0
  322. package/dist/diagram/layout/smartart-layout-interpreter-arrangement-kind.d.ts.map +1 -0
  323. package/dist/diagram/layout/smartart-layout-interpreter-aux.d.ts +66 -0
  324. package/dist/diagram/layout/smartart-layout-interpreter-aux.d.ts.map +1 -0
  325. package/dist/diagram/layout/smartart-layout-interpreter-axis-count.d.ts +128 -0
  326. package/dist/diagram/layout/smartart-layout-interpreter-axis-count.d.ts.map +1 -0
  327. package/dist/diagram/layout/smartart-layout-interpreter-axis-depth.d.ts +73 -0
  328. package/dist/diagram/layout/smartart-layout-interpreter-axis-depth.d.ts.map +1 -0
  329. package/dist/diagram/layout/smartart-layout-interpreter-axis-hop.d.ts +48 -0
  330. package/dist/diagram/layout/smartart-layout-interpreter-axis-hop.d.ts.map +1 -0
  331. package/dist/diagram/layout/smartart-layout-interpreter-axis-range.d.ts +19 -0
  332. package/dist/diagram/layout/smartart-layout-interpreter-axis-range.d.ts.map +1 -0
  333. package/dist/diagram/layout/smartart-layout-interpreter-choose-algorithm.d.ts +60 -0
  334. package/dist/diagram/layout/smartart-layout-interpreter-choose-algorithm.d.ts.map +1 -0
  335. package/dist/diagram/layout/smartart-layout-interpreter-choose-branch.d.ts +36 -0
  336. package/dist/diagram/layout/smartart-layout-interpreter-choose-branch.d.ts.map +1 -0
  337. package/dist/diagram/layout/smartart-layout-interpreter-choose-composite.d.ts +42 -0
  338. package/dist/diagram/layout/smartart-layout-interpreter-choose-composite.d.ts.map +1 -0
  339. package/dist/diagram/layout/smartart-layout-interpreter-choose-depth.d.ts +102 -0
  340. package/dist/diagram/layout/smartart-layout-interpreter-choose-depth.d.ts.map +1 -0
  341. package/dist/diagram/layout/smartart-layout-interpreter-choose-resolve.d.ts +32 -0
  342. package/dist/diagram/layout/smartart-layout-interpreter-choose-resolve.d.ts.map +1 -0
  343. package/dist/diagram/layout/smartart-layout-interpreter-composite-alternative.d.ts +33 -0
  344. package/dist/diagram/layout/smartart-layout-interpreter-composite-alternative.d.ts.map +1 -0
  345. package/dist/diagram/layout/smartart-layout-interpreter-composite-anchor.d.ts +95 -0
  346. package/dist/diagram/layout/smartart-layout-interpreter-composite-anchor.d.ts.map +1 -0
  347. package/dist/diagram/layout/smartart-layout-interpreter-composite-aspect.d.ts +84 -0
  348. package/dist/diagram/layout/smartart-layout-interpreter-composite-aspect.d.ts.map +1 -0
  349. package/dist/diagram/layout/smartart-layout-interpreter-composite-candidates.d.ts +60 -0
  350. package/dist/diagram/layout/smartart-layout-interpreter-composite-candidates.d.ts.map +1 -0
  351. package/dist/diagram/layout/smartart-layout-interpreter-composite-children.d.ts +86 -0
  352. package/dist/diagram/layout/smartart-layout-interpreter-composite-children.d.ts.map +1 -0
  353. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose-groups.d.ts +44 -0
  354. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose-groups.d.ts.map +1 -0
  355. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose.d.ts +109 -0
  356. package/dist/diagram/layout/smartart-layout-interpreter-composite-choose.d.ts.map +1 -0
  357. package/dist/diagram/layout/smartart-layout-interpreter-composite-detect.d.ts +182 -0
  358. package/dist/diagram/layout/smartart-layout-interpreter-composite-detect.d.ts.map +1 -0
  359. package/dist/diagram/layout/smartart-layout-interpreter-composite-fontfit.d.ts +60 -0
  360. package/dist/diagram/layout/smartart-layout-interpreter-composite-fontfit.d.ts.map +1 -0
  361. package/dist/diagram/layout/smartart-layout-interpreter-composite-foreach.d.ts +36 -0
  362. package/dist/diagram/layout/smartart-layout-interpreter-composite-foreach.d.ts.map +1 -0
  363. package/dist/diagram/layout/smartart-layout-interpreter-composite-group-slots.d.ts +92 -0
  364. package/dist/diagram/layout/smartart-layout-interpreter-composite-group-slots.d.ts.map +1 -0
  365. package/dist/diagram/layout/smartart-layout-interpreter-composite-iteration.d.ts +45 -0
  366. package/dist/diagram/layout/smartart-layout-interpreter-composite-iteration.d.ts.map +1 -0
  367. package/dist/diagram/layout/smartart-layout-interpreter-composite-nested-cycle.d.ts +57 -0
  368. package/dist/diagram/layout/smartart-layout-interpreter-composite-nested-cycle.d.ts.map +1 -0
  369. package/dist/diagram/layout/smartart-layout-interpreter-composite-order-fallback.d.ts +24 -0
  370. package/dist/diagram/layout/smartart-layout-interpreter-composite-order-fallback.d.ts.map +1 -0
  371. package/dist/diagram/layout/smartart-layout-interpreter-composite-order.d.ts +41 -0
  372. package/dist/diagram/layout/smartart-layout-interpreter-composite-order.d.ts.map +1 -0
  373. package/dist/diagram/layout/smartart-layout-interpreter-composite-pairs.d.ts +34 -0
  374. package/dist/diagram/layout/smartart-layout-interpreter-composite-pairs.d.ts.map +1 -0
  375. package/dist/diagram/layout/smartart-layout-interpreter-composite-render.d.ts +29 -0
  376. package/dist/diagram/layout/smartart-layout-interpreter-composite-render.d.ts.map +1 -0
  377. package/dist/diagram/layout/smartart-layout-interpreter-composite-ring.d.ts +40 -0
  378. package/dist/diagram/layout/smartart-layout-interpreter-composite-ring.d.ts.map +1 -0
  379. package/dist/diagram/layout/smartart-layout-interpreter-composite-slot-dim.d.ts +22 -0
  380. package/dist/diagram/layout/smartart-layout-interpreter-composite-slot-dim.d.ts.map +1 -0
  381. package/dist/diagram/layout/smartart-layout-interpreter-composite-slots.d.ts +69 -0
  382. package/dist/diagram/layout/smartart-layout-interpreter-composite-slots.d.ts.map +1 -0
  383. package/dist/diagram/layout/smartart-layout-interpreter-composite.d.ts +56 -0
  384. package/dist/diagram/layout/smartart-layout-interpreter-composite.d.ts.map +1 -0
  385. package/dist/diagram/layout/smartart-layout-interpreter-conn-path.d.ts +42 -0
  386. package/dist/diagram/layout/smartart-layout-interpreter-conn-path.d.ts.map +1 -0
  387. package/dist/diagram/layout/smartart-layout-interpreter-connector-order.d.ts +23 -0
  388. package/dist/diagram/layout/smartart-layout-interpreter-connector-order.d.ts.map +1 -0
  389. package/dist/diagram/layout/smartart-layout-interpreter-constraints.d.ts +28 -0
  390. package/dist/diagram/layout/smartart-layout-interpreter-constraints.d.ts.map +1 -0
  391. package/dist/diagram/layout/smartart-layout-interpreter-custom.d.ts +31 -0
  392. package/dist/diagram/layout/smartart-layout-interpreter-custom.d.ts.map +1 -0
  393. package/dist/diagram/layout/smartart-layout-interpreter-cycle-boxes.d.ts +36 -0
  394. package/dist/diagram/layout/smartart-layout-interpreter-cycle-boxes.d.ts.map +1 -0
  395. package/dist/diagram/layout/smartart-layout-interpreter-cycle-connectors.d.ts +21 -0
  396. package/dist/diagram/layout/smartart-layout-interpreter-cycle-connectors.d.ts.map +1 -0
  397. package/dist/diagram/layout/smartart-layout-interpreter-cycle-constraints.d.ts +116 -0
  398. package/dist/diagram/layout/smartart-layout-interpreter-cycle-constraints.d.ts.map +1 -0
  399. package/dist/diagram/layout/smartart-layout-interpreter-cycle-extension.d.ts +110 -0
  400. package/dist/diagram/layout/smartart-layout-interpreter-cycle-extension.d.ts.map +1 -0
  401. package/dist/diagram/layout/smartart-layout-interpreter-cycle-fontfit.d.ts +50 -0
  402. package/dist/diagram/layout/smartart-layout-interpreter-cycle-fontfit.d.ts.map +1 -0
  403. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-detect.d.ts +66 -0
  404. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-detect.d.ts.map +1 -0
  405. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio-usersize.d.ts +81 -0
  406. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio-usersize.d.ts.map +1 -0
  407. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio.d.ts +109 -0
  408. package/dist/diagram/layout/smartart-layout-interpreter-cycle-hub-ratio.d.ts.map +1 -0
  409. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-aspect.d.ts +121 -0
  410. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-aspect.d.ts.map +1 -0
  411. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-node.d.ts +57 -0
  412. package/dist/diagram/layout/smartart-layout-interpreter-cycle-item-node.d.ts.map +1 -0
  413. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-bulge.d.ts +34 -0
  414. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-bulge.d.ts.map +1 -0
  415. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-item.d.ts +39 -0
  416. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-item.d.ts.map +1 -0
  417. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-nested-hub.d.ts +22 -0
  418. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-nested-hub.d.ts.map +1 -0
  419. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-offset.d.ts +43 -0
  420. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring-offset.d.ts.map +1 -0
  421. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring.d.ts +76 -0
  422. package/dist/diagram/layout/smartart-layout-interpreter-cycle-ring.d.ts.map +1 -0
  423. package/dist/diagram/layout/smartart-layout-interpreter-cycle-sibtrans.d.ts +40 -0
  424. package/dist/diagram/layout/smartart-layout-interpreter-cycle-sibtrans.d.ts.map +1 -0
  425. package/dist/diagram/layout/smartart-layout-interpreter-cycle.d.ts +69 -0
  426. package/dist/diagram/layout/smartart-layout-interpreter-cycle.d.ts.map +1 -0
  427. package/dist/diagram/layout/smartart-layout-interpreter-dispatch.d.ts +18 -0
  428. package/dist/diagram/layout/smartart-layout-interpreter-dispatch.d.ts.map +1 -0
  429. package/dist/diagram/layout/smartart-layout-interpreter-flow-direction.d.ts +29 -0
  430. package/dist/diagram/layout/smartart-layout-interpreter-flow-direction.d.ts.map +1 -0
  431. package/dist/diagram/layout/smartart-layout-interpreter-flow.d.ts +49 -0
  432. package/dist/diagram/layout/smartart-layout-interpreter-flow.d.ts.map +1 -0
  433. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-descendant.d.ts +60 -0
  434. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-descendant.d.ts.map +1 -0
  435. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-fontfit.d.ts +45 -0
  436. package/dist/diagram/layout/smartart-layout-interpreter-hierarchy-fontfit.d.ts.map +1 -0
  437. package/dist/diagram/layout/smartart-layout-interpreter-hub-detect.d.ts +26 -0
  438. package/dist/diagram/layout/smartart-layout-interpreter-hub-detect.d.ts.map +1 -0
  439. package/dist/diagram/layout/smartart-layout-interpreter-hub.d.ts +62 -0
  440. package/dist/diagram/layout/smartart-layout-interpreter-hub.d.ts.map +1 -0
  441. package/dist/diagram/layout/smartart-layout-interpreter-item-role-compound.d.ts +36 -0
  442. package/dist/diagram/layout/smartart-layout-interpreter-item-role-compound.d.ts.map +1 -0
  443. package/dist/diagram/layout/smartart-layout-interpreter-item-role-orientation.d.ts +80 -0
  444. package/dist/diagram/layout/smartart-layout-interpreter-item-role-orientation.d.ts.map +1 -0
  445. package/dist/diagram/layout/smartart-layout-interpreter-item-role-shared.d.ts +102 -0
  446. package/dist/diagram/layout/smartart-layout-interpreter-item-role-shared.d.ts.map +1 -0
  447. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-columns.d.ts +23 -0
  448. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-columns.d.ts.map +1 -0
  449. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-fields.d.ts +77 -0
  450. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-fields.d.ts.map +1 -0
  451. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-rect.d.ts +20 -0
  452. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack-rect.d.ts.map +1 -0
  453. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack.d.ts +53 -0
  454. package/dist/diagram/layout/smartart-layout-interpreter-item-role-stack.d.ts.map +1 -0
  455. package/dist/diagram/layout/smartart-layout-interpreter-item-role-transition.d.ts +50 -0
  456. package/dist/diagram/layout/smartart-layout-interpreter-item-role-transition.d.ts.map +1 -0
  457. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-recursive.d.ts +87 -0
  458. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-recursive.d.ts.map +1 -0
  459. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-unwrap.d.ts +57 -0
  460. package/dist/diagram/layout/smartart-layout-interpreter-item-roles-unwrap.d.ts.map +1 -0
  461. package/dist/diagram/layout/smartart-layout-interpreter-item-roles.d.ts +109 -0
  462. package/dist/diagram/layout/smartart-layout-interpreter-item-roles.d.ts.map +1 -0
  463. package/dist/diagram/layout/smartart-layout-interpreter-linear-content-size.d.ts +42 -0
  464. package/dist/diagram/layout/smartart-layout-interpreter-linear-content-size.d.ts.map +1 -0
  465. package/dist/diagram/layout/smartart-layout-interpreter-linear-item-aspect.d.ts +94 -0
  466. package/dist/diagram/layout/smartart-layout-interpreter-linear-item-aspect.d.ts.map +1 -0
  467. package/dist/diagram/layout/smartart-layout-interpreter-linear-main-axis.d.ts +17 -0
  468. package/dist/diagram/layout/smartart-layout-interpreter-linear-main-axis.d.ts.map +1 -0
  469. package/dist/diagram/layout/smartart-layout-interpreter-linear-shared.d.ts +21 -0
  470. package/dist/diagram/layout/smartart-layout-interpreter-linear-shared.d.ts.map +1 -0
  471. package/dist/diagram/layout/smartart-layout-interpreter-linear-table.d.ts +76 -0
  472. package/dist/diagram/layout/smartart-layout-interpreter-linear-table.d.ts.map +1 -0
  473. package/dist/diagram/layout/smartart-layout-interpreter-linear.d.ts +20 -0
  474. package/dist/diagram/layout/smartart-layout-interpreter-linear.d.ts.map +1 -0
  475. package/dist/diagram/layout/smartart-layout-interpreter-model.d.ts +77 -0
  476. package/dist/diagram/layout/smartart-layout-interpreter-model.d.ts.map +1 -0
  477. package/dist/diagram/layout/smartart-layout-interpreter-named-rules.d.ts +93 -0
  478. package/dist/diagram/layout/smartart-layout-interpreter-named-rules.d.ts.map +1 -0
  479. package/dist/diagram/layout/smartart-layout-interpreter-position-family.d.ts +58 -0
  480. package/dist/diagram/layout/smartart-layout-interpreter-position-family.d.ts.map +1 -0
  481. package/dist/diagram/layout/smartart-layout-interpreter-preset-node.d.ts +61 -0
  482. package/dist/diagram/layout/smartart-layout-interpreter-preset-node.d.ts.map +1 -0
  483. package/dist/diagram/layout/smartart-layout-interpreter-presof-choose.d.ts +29 -0
  484. package/dist/diagram/layout/smartart-layout-interpreter-presof-choose.d.ts.map +1 -0
  485. package/dist/diagram/layout/smartart-layout-interpreter-pyramid-bands.d.ts +41 -0
  486. package/dist/diagram/layout/smartart-layout-interpreter-pyramid-bands.d.ts.map +1 -0
  487. package/dist/diagram/layout/smartart-layout-interpreter-pyramid.d.ts +100 -0
  488. package/dist/diagram/layout/smartart-layout-interpreter-pyramid.d.ts.map +1 -0
  489. package/dist/diagram/layout/smartart-layout-interpreter-render.d.ts +86 -0
  490. package/dist/diagram/layout/smartart-layout-interpreter-render.d.ts.map +1 -0
  491. package/dist/diagram/layout/smartart-layout-interpreter-snake.d.ts +18 -0
  492. package/dist/diagram/layout/smartart-layout-interpreter-snake.d.ts.map +1 -0
  493. package/dist/diagram/layout/smartart-layout-interpreter-tree-location.d.ts +28 -0
  494. package/dist/diagram/layout/smartart-layout-interpreter-tree-location.d.ts.map +1 -0
  495. package/dist/diagram/layout/smartart-layout-interpreter-when-numeric.d.ts +15 -0
  496. package/dist/diagram/layout/smartart-layout-interpreter-when-numeric.d.ts.map +1 -0
  497. package/dist/diagram/layout/smartart-layout-interpreter-when-var.d.ts +12 -0
  498. package/dist/diagram/layout/smartart-layout-interpreter-when-var.d.ts.map +1 -0
  499. package/dist/diagram/layout/smartart-layout-interpreter-when.d.ts +69 -0
  500. package/dist/diagram/layout/smartart-layout-interpreter-when.d.ts.map +1 -0
  501. package/dist/diagram/layout/smartart-layout-interpreter.d.ts +80 -0
  502. package/dist/diagram/layout/smartart-layout-interpreter.d.ts.map +1 -0
  503. package/dist/diagram/layout/smartart-layout-item-font-role.d.ts +80 -0
  504. package/dist/diagram/layout/smartart-layout-item-font-role.d.ts.map +1 -0
  505. package/dist/diagram/layout/smartart-layout-item-font-size.d.ts +129 -0
  506. package/dist/diagram/layout/smartart-layout-item-font-size.d.ts.map +1 -0
  507. package/dist/diagram/layout/smartart-layout-item-font-tier-fit.d.ts +70 -0
  508. package/dist/diagram/layout/smartart-layout-item-font-tier-fit.d.ts.map +1 -0
  509. package/dist/diagram/layout/smartart-layout-item-font-tier.d.ts +139 -0
  510. package/dist/diagram/layout/smartart-layout-item-font-tier.d.ts.map +1 -0
  511. package/dist/diagram/layout/smartart-layout-item-tx-anchor.d.ts +105 -0
  512. package/dist/diagram/layout/smartart-layout-item-tx-anchor.d.ts.map +1 -0
  513. package/dist/diagram/layout/smartart-layout-shape-polygon.d.ts +17 -0
  514. package/dist/diagram/layout/smartart-layout-shape-polygon.d.ts.map +1 -0
  515. package/dist/diagram/layout/smartart-layout-shape-preset.d.ts +127 -0
  516. package/dist/diagram/layout/smartart-layout-shape-preset.d.ts.map +1 -0
  517. package/dist/diagram/layout/smartart-layout-snake-grid.d.ts +43 -0
  518. package/dist/diagram/layout/smartart-layout-snake-grid.d.ts.map +1 -0
  519. package/dist/diagram/layout/smartart-layout-style-helpers.d.ts +84 -0
  520. package/dist/diagram/layout/smartart-layout-style-helpers.d.ts.map +1 -0
  521. package/dist/diagram/layout/smartart-layout-types.d.ts +253 -0
  522. package/dist/diagram/layout/smartart-layout-types.d.ts.map +1 -0
  523. package/dist/diagram/layout/smartart-line-pitch.d.ts +29 -0
  524. package/dist/diagram/layout/smartart-line-pitch.d.ts.map +1 -0
  525. package/dist/diagram/layout/smartart-node-role-colors.d.ts +30 -0
  526. package/dist/diagram/layout/smartart-node-role-colors.d.ts.map +1 -0
  527. package/dist/diagram/layout/smartart-node-tree-axis.d.ts +91 -0
  528. package/dist/diagram/layout/smartart-node-tree-axis.d.ts.map +1 -0
  529. package/dist/diagram/layout/smartart-text-wrap-fit.d.ts +84 -0
  530. package/dist/diagram/layout/smartart-text-wrap-fit.d.ts.map +1 -0
  531. package/dist/diagram/layout/smartart-tree.d.ts +33 -0
  532. package/dist/diagram/layout/smartart-tree.d.ts.map +1 -0
  533. package/dist/diagram/model/constraint-rules.d.ts +31 -0
  534. package/dist/diagram/model/constraint-rules.d.ts.map +1 -0
  535. package/dist/diagram/model/data.d.ts +109 -0
  536. package/dist/diagram/model/data.d.ts.map +1 -0
  537. package/dist/diagram/model/index.d.ts +7 -0
  538. package/dist/diagram/model/index.d.ts.map +1 -0
  539. package/dist/diagram/model/layout-definition.d.ts +276 -0
  540. package/dist/diagram/model/layout-definition.d.ts.map +1 -0
  541. package/dist/diagram/model/layout-primitives.d.ts +82 -0
  542. package/dist/diagram/model/layout-primitives.d.ts.map +1 -0
  543. package/dist/diagram/model/node.d.ts +194 -0
  544. package/dist/diagram/model/node.d.ts.map +1 -0
  545. package/dist/diagram/model/style-definition.d.ts +131 -0
  546. package/dist/diagram/model/style-definition.d.ts.map +1 -0
  547. package/dist/docx/chart-paint.d.ts +14 -0
  548. package/dist/docx/chart-paint.d.ts.map +1 -0
  549. package/dist/docx/chart.d.ts +43 -0
  550. package/dist/docx/chart.d.ts.map +1 -0
  551. package/dist/docx/drawing.d.ts.map +1 -1
  552. package/dist/docx/embedded.cjs +1393 -326
  553. package/dist/docx/embedded.mjs +1393 -326
  554. package/dist/docx/index.cjs +4044 -683
  555. package/dist/docx/index.d.ts +2 -0
  556. package/dist/docx/index.d.ts.map +1 -1
  557. package/dist/docx/index.mjs +4040 -684
  558. package/dist/docx/inline-model.d.ts +3 -0
  559. package/dist/docx/inline-model.d.ts.map +1 -1
  560. package/dist/docx/layout/adapter.d.ts.map +1 -1
  561. package/dist/docx/layout/index.cjs +2674 -88
  562. package/dist/docx/layout/index.mjs +2675 -89
  563. package/dist/docx/layout/input.d.ts +5 -0
  564. package/dist/docx/layout/input.d.ts.map +1 -1
  565. package/dist/docx/load/index.cjs +1616 -549
  566. package/dist/docx/load/index.mjs +1616 -549
  567. package/dist/docx/parse.d.ts.map +1 -1
  568. package/dist/docx/ui/chart-spec.d.ts +10 -0
  569. package/dist/docx/ui/chart-spec.d.ts.map +1 -0
  570. package/dist/docx/ui/index.cjs +2602 -186
  571. package/dist/docx/ui/index.d.ts +1 -0
  572. package/dist/docx/ui/index.d.ts.map +1 -1
  573. package/dist/docx/ui/index.mjs +2601 -188
  574. package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
  575. package/dist/docx/ui/run-adapter.d.ts.map +1 -1
  576. package/dist/drawingml/write-line.d.ts +7 -0
  577. package/dist/drawingml/write-line.d.ts.map +1 -0
  578. package/dist/geometry/ooxml-arc.d.ts +31 -0
  579. package/dist/geometry/ooxml-arc.d.ts.map +1 -0
  580. package/dist/geometry/preset-shape-evaluator.d.ts +73 -0
  581. package/dist/geometry/preset-shape-evaluator.d.ts.map +1 -0
  582. package/dist/index.cjs +34839 -18368
  583. package/dist/index.mjs +34835 -18368
  584. package/dist/opc/embedded-packages.d.ts +11 -0
  585. package/dist/opc/embedded-packages.d.ts.map +1 -0
  586. package/dist/opc/index.cjs +365 -70
  587. package/dist/opc/index.d.ts +1 -0
  588. package/dist/opc/index.d.ts.map +1 -1
  589. package/dist/opc/index.mjs +353 -71
  590. package/dist/opc/properties/app.d.ts +9 -3
  591. package/dist/opc/properties/app.d.ts.map +1 -1
  592. package/dist/opc/properties/core.d.ts +5 -1
  593. package/dist/opc/properties/core.d.ts.map +1 -1
  594. package/dist/opc/properties/custom.d.ts +19 -0
  595. package/dist/opc/properties/custom.d.ts.map +1 -1
  596. package/dist/opc/properties/index.d.ts +6 -3
  597. package/dist/opc/properties/index.d.ts.map +1 -1
  598. package/dist/opc/properties/patch.d.ts +38 -0
  599. package/dist/opc/properties/patch.d.ts.map +1 -0
  600. package/dist/opc/properties/title-groups.d.ts +30 -0
  601. package/dist/opc/properties/title-groups.d.ts.map +1 -0
  602. package/dist/opc/properties/types.d.ts +15 -0
  603. package/dist/opc/properties/types.d.ts.map +1 -1
  604. package/dist/pptx/automation/index.cjs +9049 -7167
  605. package/dist/pptx/automation/index.d.ts +4 -4
  606. package/dist/pptx/automation/index.mjs +6 -6
  607. package/dist/pptx/chunks/{index-BYkdcS8J.d.ts → index-EZJZ7USt.d.ts} +907 -962
  608. package/dist/pptx/chunks/index-EZJZ7USt.d.ts.map +1 -0
  609. package/dist/pptx/chunks/{index-BHqL5KXH.d.ts → index-JNv7AJx5.d.ts} +163 -210
  610. package/dist/pptx/chunks/index-JNv7AJx5.d.ts.map +1 -0
  611. package/dist/pptx/chunks/{smart-art-CO2jmJFf.d.ts → smart-art-Q2kZQtHh.d.ts} +436 -374
  612. package/dist/pptx/chunks/smart-art-Q2kZQtHh.d.ts.map +1 -0
  613. package/dist/pptx/chunks/{text-operations-DEJ7alZR.d.ts → text-operations-DtCxXrMh.d.ts} +55 -4
  614. package/dist/pptx/chunks/text-operations-DtCxXrMh.d.ts.map +1 -0
  615. package/dist/pptx/cli/index.cjs +8728 -6846
  616. package/dist/pptx/cli/index.d.ts +1 -1
  617. package/dist/pptx/cli/index.mjs +5 -5
  618. package/dist/pptx/converter/index.cjs +7124 -7136
  619. package/dist/pptx/converter/index.d.ts +1 -1
  620. package/dist/pptx/converter/index.mjs +3 -3
  621. package/dist/pptx/editor/render/table-cell-edit.cjs +7 -3
  622. package/dist/pptx/editor/render/table-cell-edit.d.ts +16 -1
  623. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  624. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  625. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  626. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  627. package/dist/pptx/editor/render/table-data-grid-ops.cjs +7 -7
  628. package/dist/pptx/editor/render/table-data-grid-ops.mjs +2 -2
  629. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  630. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  631. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  632. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  633. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  634. package/dist/pptx/index.cjs +9300 -7249
  635. package/dist/pptx/index.d.ts +5 -5
  636. package/dist/pptx/index.mjs +6 -6
  637. package/dist/pptx/smartart-layouts/index.cjs +135 -106
  638. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  639. package/dist/pptx/smartart-layouts/index.mjs +1 -1
  640. package/dist/teams/content.d.ts.map +1 -1
  641. package/dist/teams/index.cjs +3931 -2077
  642. package/dist/teams/index.d.ts +1 -0
  643. package/dist/teams/index.d.ts.map +1 -1
  644. package/dist/teams/index.mjs +3930 -2077
  645. package/dist/teams/server-file-storage.d.ts +11 -0
  646. package/dist/teams/server-file-storage.d.ts.map +1 -0
  647. package/dist/teams/store.d.ts +2 -0
  648. package/dist/teams/store.d.ts.map +1 -1
  649. package/dist/teams/stored-file.d.ts.map +1 -1
  650. package/dist/{xlsx/layout/font-family.d.ts → text/css-font-family.d.ts} +1 -1
  651. package/dist/text/css-font-family.d.ts.map +1 -0
  652. package/dist/text/font-metrics/font-advance-widths-aptos-display.generated.d.ts +10 -0
  653. package/dist/text/font-metrics/font-advance-widths-aptos-display.generated.d.ts.map +1 -0
  654. package/dist/text/font-metrics/font-advance-widths-aptos.generated.d.ts +10 -0
  655. package/dist/text/font-metrics/font-advance-widths-aptos.generated.d.ts.map +1 -0
  656. package/dist/text/font-metrics/font-advance-widths-arial.generated.d.ts +10 -0
  657. package/dist/text/font-metrics/font-advance-widths-arial.generated.d.ts.map +1 -0
  658. package/dist/text/font-metrics/font-advance-widths-calibri-light.generated.d.ts +10 -0
  659. package/dist/text/font-metrics/font-advance-widths-calibri-light.generated.d.ts.map +1 -0
  660. package/dist/text/font-metrics/font-advance-widths-calibri.generated.d.ts +10 -0
  661. package/dist/text/font-metrics/font-advance-widths-calibri.generated.d.ts.map +1 -0
  662. package/dist/text/font-metrics/font-advance-widths-segoe-ui.generated.d.ts +10 -0
  663. package/dist/text/font-metrics/font-advance-widths-segoe-ui.generated.d.ts.map +1 -0
  664. package/dist/text/font-metrics/font-advance-widths-times-new-roman.generated.d.ts +10 -0
  665. package/dist/text/font-metrics/font-advance-widths-times-new-roman.generated.d.ts.map +1 -0
  666. package/dist/text/font-metrics/font-advance-widths.generated.d.ts +48 -0
  667. package/dist/text/font-metrics/font-advance-widths.generated.d.ts.map +1 -0
  668. package/dist/text/font-metrics/font-kerning.d.ts +19 -0
  669. package/dist/text/font-metrics/font-kerning.d.ts.map +1 -0
  670. package/dist/visio/index.cjs +645 -119
  671. package/dist/visio/index.mjs +645 -119
  672. package/dist/visio/theme-color.d.ts +13 -3
  673. package/dist/visio/theme-color.d.ts.map +1 -1
  674. package/dist/visio/theme-resolve.d.ts +2 -1
  675. package/dist/visio/theme-resolve.d.ts.map +1 -1
  676. package/dist/visio/theme.d.ts +5 -2
  677. package/dist/visio/theme.d.ts.map +1 -1
  678. package/dist/xlsx/collab/adapter.d.ts +18 -0
  679. package/dist/xlsx/collab/adapter.d.ts.map +1 -0
  680. package/dist/xlsx/collab/apply.d.ts +8 -0
  681. package/dist/xlsx/collab/apply.d.ts.map +1 -0
  682. package/dist/xlsx/collab/bind.d.ts +34 -0
  683. package/dist/xlsx/collab/bind.d.ts.map +1 -0
  684. package/dist/xlsx/collab/codec.d.ts +35 -0
  685. package/dist/xlsx/collab/codec.d.ts.map +1 -0
  686. package/dist/xlsx/collab/dirty.d.ts +23 -0
  687. package/dist/xlsx/collab/dirty.d.ts.map +1 -0
  688. package/dist/xlsx/collab/index.cjs +1245 -0
  689. package/dist/xlsx/collab/index.d.ts +10 -0
  690. package/dist/xlsx/collab/index.d.ts.map +1 -0
  691. package/dist/xlsx/collab/index.mjs +1207 -0
  692. package/dist/xlsx/collab/lines.d.ts +22 -0
  693. package/dist/xlsx/collab/lines.d.ts.map +1 -0
  694. package/dist/xlsx/collab/names.d.ts +16 -0
  695. package/dist/xlsx/collab/names.d.ts.map +1 -0
  696. package/dist/xlsx/collab/presence.d.ts +31 -0
  697. package/dist/xlsx/collab/presence.d.ts.map +1 -0
  698. package/dist/xlsx/collab/schema.d.ts +30 -0
  699. package/dist/xlsx/collab/schema.d.ts.map +1 -0
  700. package/dist/xlsx/collab/sheets.d.ts +34 -0
  701. package/dist/xlsx/collab/sheets.d.ts.map +1 -0
  702. package/dist/xlsx/collab/styles.d.ts +26 -0
  703. package/dist/xlsx/collab/styles.d.ts.map +1 -0
  704. package/dist/xlsx/collab/write.d.ts +14 -0
  705. package/dist/xlsx/collab/write.d.ts.map +1 -0
  706. package/dist/xlsx/edit/chart-colors.d.ts +2 -2
  707. package/dist/xlsx/edit/chart-colors.d.ts.map +1 -1
  708. package/dist/xlsx/edit/chart-element-fill.d.ts +3 -3
  709. package/dist/xlsx/edit/chart-element-fill.d.ts.map +1 -1
  710. package/dist/xlsx/edit/chart-series-fill.d.ts +2 -2
  711. package/dist/xlsx/edit/chart-series-fill.d.ts.map +1 -1
  712. package/dist/xlsx/edit/chart-series-gradient.d.ts +3 -3
  713. package/dist/xlsx/edit/chart-series-gradient.d.ts.map +1 -1
  714. package/dist/xlsx/edit/chart-series-target.d.ts +15 -0
  715. package/dist/xlsx/edit/chart-series-target.d.ts.map +1 -0
  716. package/dist/xlsx/edit/chart-series-transparency.d.ts +2 -2
  717. package/dist/xlsx/edit/chart-series-transparency.d.ts.map +1 -1
  718. package/dist/xlsx/edit/context.d.ts +3 -1
  719. package/dist/xlsx/edit/context.d.ts.map +1 -1
  720. package/dist/xlsx/edit/external.d.ts +28 -0
  721. package/dist/xlsx/edit/external.d.ts.map +1 -0
  722. package/dist/xlsx/edit/history.d.ts +18 -0
  723. package/dist/xlsx/edit/history.d.ts.map +1 -1
  724. package/dist/xlsx/edit/index.d.ts +1 -0
  725. package/dist/xlsx/edit/index.d.ts.map +1 -1
  726. package/dist/xlsx/edit/session-calc.d.ts +32 -3
  727. package/dist/xlsx/edit/session-calc.d.ts.map +1 -1
  728. package/dist/xlsx/edit/session.d.ts.map +1 -1
  729. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  730. package/dist/xlsx/edit/types.d.ts +37 -4
  731. package/dist/xlsx/edit/types.d.ts.map +1 -1
  732. package/dist/xlsx/formula/engine-core.d.ts.map +1 -1
  733. package/dist/xlsx/formula/engine-host.d.ts +6 -2
  734. package/dist/xlsx/formula/engine-host.d.ts.map +1 -1
  735. package/dist/xlsx/formula/engine-prepare.d.ts +33 -0
  736. package/dist/xlsx/formula/engine-prepare.d.ts.map +1 -0
  737. package/dist/xlsx/formula/engine-structure.d.ts +40 -0
  738. package/dist/xlsx/formula/engine-structure.d.ts.map +1 -0
  739. package/dist/xlsx/formula/engine-types.d.ts +26 -0
  740. package/dist/xlsx/formula/engine-types.d.ts.map +1 -1
  741. package/dist/xlsx/formula/engine.d.ts.map +1 -1
  742. package/dist/xlsx/formula/formula-shape.d.ts +28 -0
  743. package/dist/xlsx/formula/formula-shape.d.ts.map +1 -0
  744. package/dist/xlsx/formula/graph-index.d.ts +3 -1
  745. package/dist/xlsx/formula/graph-index.d.ts.map +1 -1
  746. package/dist/xlsx/formula/graph.d.ts +5 -0
  747. package/dist/xlsx/formula/graph.d.ts.map +1 -1
  748. package/dist/xlsx/formula/lexemes.d.ts +6 -0
  749. package/dist/xlsx/formula/lexemes.d.ts.map +1 -1
  750. package/dist/xlsx/formula/parse-cache.d.ts +9 -0
  751. package/dist/xlsx/formula/parse-cache.d.ts.map +1 -0
  752. package/dist/xlsx/formula/parser.d.ts +3 -0
  753. package/dist/xlsx/formula/parser.d.ts.map +1 -1
  754. package/dist/xlsx/formula/ref-text.d.ts +14 -0
  755. package/dist/xlsx/formula/ref-text.d.ts.map +1 -0
  756. package/dist/xlsx/formula/references.d.ts.map +1 -1
  757. package/dist/xlsx/formula/shift-formula.d.ts +19 -0
  758. package/dist/xlsx/formula/shift-formula.d.ts.map +1 -0
  759. package/dist/xlsx/formula/shift-graph.d.ts +42 -0
  760. package/dist/xlsx/formula/shift-graph.d.ts.map +1 -0
  761. package/dist/xlsx/formula/tokenizer.d.ts.map +1 -1
  762. package/dist/xlsx/formula/transform.d.ts +2 -23
  763. package/dist/xlsx/formula/transform.d.ts.map +1 -1
  764. package/dist/xlsx/index.cjs +5620 -2680
  765. package/dist/xlsx/index.mjs +5609 -2681
  766. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  767. package/dist/xlsx/layout/chart-view.d.ts +3 -54
  768. package/dist/xlsx/layout/chart-view.d.ts.map +1 -1
  769. package/dist/xlsx/layout/colors.d.ts +1 -4
  770. package/dist/xlsx/layout/colors.d.ts.map +1 -1
  771. package/dist/xlsx/layout/index.d.ts +8 -5
  772. package/dist/xlsx/layout/index.d.ts.map +1 -1
  773. package/dist/xlsx/layout/remote-selections.d.ts +40 -0
  774. package/dist/xlsx/layout/remote-selections.d.ts.map +1 -0
  775. package/dist/xlsx/layout/sheet-queries.d.ts +7 -0
  776. package/dist/xlsx/layout/sheet-queries.d.ts.map +1 -1
  777. package/dist/xlsx/layout/sparkline-data.d.ts +19 -0
  778. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -0
  779. package/dist/xlsx/layout/sparkline-view.d.ts +52 -0
  780. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -0
  781. package/dist/xlsx/layout/tint.d.ts +3 -12
  782. package/dist/xlsx/layout/tint.d.ts.map +1 -1
  783. package/dist/xlsx/layout/types.d.ts +3 -0
  784. package/dist/xlsx/layout/types.d.ts.map +1 -1
  785. package/dist/xlsx/load/index.cjs +3124 -1312
  786. package/dist/xlsx/load/index.mjs +3124 -1312
  787. package/dist/xlsx/model-sparklines.d.ts +52 -0
  788. package/dist/xlsx/model-sparklines.d.ts.map +1 -0
  789. package/dist/xlsx/model.d.ts +10 -47
  790. package/dist/xlsx/model.d.ts.map +1 -1
  791. package/dist/xlsx/read/chart.d.ts +1 -4
  792. package/dist/xlsx/read/chart.d.ts.map +1 -1
  793. package/dist/xlsx/read/index.d.ts +1 -0
  794. package/dist/xlsx/read/index.d.ts.map +1 -1
  795. package/dist/xlsx/read/sheet-data-source.d.ts +10 -0
  796. package/dist/xlsx/read/sheet-data-source.d.ts.map +1 -0
  797. package/dist/xlsx/read/sparklines.d.ts +12 -0
  798. package/dist/xlsx/read/sparklines.d.ts.map +1 -0
  799. package/dist/xlsx/read/worksheet.d.ts.map +1 -1
  800. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  801. package/dist/xlsx/ui/context.d.ts +15 -1
  802. package/dist/xlsx/ui/context.d.ts.map +1 -1
  803. package/dist/xlsx/ui/grid/cell-items.d.ts.map +1 -1
  804. package/dist/xlsx/ui/grid/cell-paint.d.ts +1 -1
  805. package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
  806. package/dist/xlsx/ui/grid/view-cache.d.ts.map +1 -1
  807. package/dist/xlsx/ui/index.cjs +2165 -866
  808. package/dist/xlsx/ui/index.mjs +2165 -867
  809. package/dist/xlsx/ui/locales/de/collab.d.ts +2 -0
  810. package/dist/xlsx/ui/locales/de/collab.d.ts.map +1 -0
  811. package/dist/xlsx/ui/locales/de/index.d.ts.map +1 -1
  812. package/dist/xlsx/ui/locales/en/collab.d.ts +2 -0
  813. package/dist/xlsx/ui/locales/en/collab.d.ts.map +1 -0
  814. package/dist/xlsx/ui/locales/en/index.d.ts.map +1 -1
  815. package/dist/xlsx/ui/locales/es/collab.d.ts +2 -0
  816. package/dist/xlsx/ui/locales/es/collab.d.ts.map +1 -0
  817. package/dist/xlsx/ui/locales/es/index.d.ts.map +1 -1
  818. package/dist/xlsx/ui/locales/fr/collab.d.ts +2 -0
  819. package/dist/xlsx/ui/locales/fr/collab.d.ts.map +1 -0
  820. package/dist/xlsx/ui/locales/fr/index.d.ts.map +1 -1
  821. package/dist/xlsx/ui/locales/zh-CN/collab.d.ts +2 -0
  822. package/dist/xlsx/ui/locales/zh-CN/collab.d.ts.map +1 -0
  823. package/dist/xlsx/ui/locales/zh-CN/index.d.ts.map +1 -1
  824. package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -1
  825. package/dist/xlsx/write/chart-colors.d.ts +3 -0
  826. package/dist/xlsx/write/chart-colors.d.ts.map +1 -1
  827. package/dist/xlsx/write/chart-space.d.ts +5 -0
  828. package/dist/xlsx/write/chart-space.d.ts.map +1 -0
  829. package/dist/xlsx/write/chart-title.d.ts +4 -1
  830. package/dist/xlsx/write/chart-title.d.ts.map +1 -1
  831. package/dist/xlsx/write/chart.d.ts +4 -1
  832. package/dist/xlsx/write/chart.d.ts.map +1 -1
  833. package/dist/xml/index.cjs +162 -0
  834. package/dist/xml/index.d.ts +1 -0
  835. package/dist/xml/index.d.ts.map +1 -1
  836. package/dist/xml/index.mjs +161 -1
  837. package/dist/xml/lite.d.ts +30 -0
  838. package/dist/xml/lite.d.ts.map +1 -0
  839. package/package.json +6 -1
  840. package/dist/pptx/chunks/index-BHqL5KXH.d.ts.map +0 -1
  841. package/dist/pptx/chunks/index-BYkdcS8J.d.ts.map +0 -1
  842. package/dist/pptx/chunks/smart-art-CO2jmJFf.d.ts.map +0 -1
  843. package/dist/pptx/chunks/text-operations-DEJ7alZR.d.ts.map +0 -1
  844. package/dist/xlsx/layout/chart-appearance.d.ts.map +0 -1
  845. package/dist/xlsx/layout/chart-colors.d.ts +0 -9
  846. package/dist/xlsx/layout/chart-colors.d.ts.map +0 -1
  847. package/dist/xlsx/layout/chart-scale.d.ts.map +0 -1
  848. package/dist/xlsx/layout/chart-spacing.d.ts +0 -6
  849. package/dist/xlsx/layout/chart-spacing.d.ts.map +0 -1
  850. package/dist/xlsx/layout/chart-svg-appearance.d.ts.map +0 -1
  851. package/dist/xlsx/layout/chart-svg-bars.d.ts.map +0 -1
  852. package/dist/xlsx/layout/chart-svg-cartesian.d.ts.map +0 -1
  853. package/dist/xlsx/layout/chart-svg-legend.d.ts.map +0 -1
  854. package/dist/xlsx/layout/chart-svg-radial.d.ts.map +0 -1
  855. package/dist/xlsx/layout/chart-svg-text-metrics.d.ts.map +0 -1
  856. package/dist/xlsx/layout/chart-svg-title-text.d.ts.map +0 -1
  857. package/dist/xlsx/layout/chart-svg-util.d.ts.map +0 -1
  858. package/dist/xlsx/layout/chart-svg.d.ts.map +0 -1
  859. package/dist/xlsx/layout/chart-title-text.d.ts +0 -14
  860. package/dist/xlsx/layout/chart-title-text.d.ts.map +0 -1
  861. package/dist/xlsx/layout/font-family.d.ts.map +0 -1
  862. /package/dist/{xlsx/layout → chart/render}/chart-scale.d.ts +0 -0
  863. /package/dist/{xlsx/layout → chart/render}/chart-svg-bars.d.ts +0 -0
  864. /package/dist/{xlsx/layout → chart/render}/chart-svg-cartesian.d.ts +0 -0
  865. /package/dist/{xlsx/layout → chart/render}/chart-svg-legend.d.ts +0 -0
  866. /package/dist/{xlsx/layout → chart/render}/chart-svg-radial.d.ts +0 -0
  867. /package/dist/{xlsx/layout → chart/render}/chart-svg-text-metrics.d.ts +0 -0
  868. /package/dist/{xlsx/layout → chart/render}/chart-svg-title-text.d.ts +0 -0
  869. /package/dist/{xlsx/layout → chart/render}/chart-svg-util.d.ts +0 -0
  870. /package/dist/{xlsx/layout → chart/render}/chart-svg.d.ts +0 -0
@@ -5,7 +5,9 @@ var xmldom = require('@xmldom/xmldom');
5
5
  // xml/namespaces.ts
6
6
  var NS = {
7
7
  /** WordprocessingML main. */
8
- w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"};
8
+ w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
9
+ /** DrawingML main. */
10
+ a: "http://schemas.openxmlformats.org/drawingml/2006/main"};
9
11
  function parseXml(xml, options = {}) {
10
12
  const label = options.label ?? "OOXML";
11
13
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
@@ -103,6 +105,10 @@ var eighthPoints = (value) => integer("eighthPoints", value);
103
105
  var roundSignedTwips = (value) => integer("twips", roundAway("twips", value));
104
106
  var twipsToPixels = (value) => value / 15;
105
107
 
108
+ // units/constants.ts
109
+ var EMU_PER_PIXEL = 9525;
110
+ var EMU_PER_POINT = 12700;
111
+
106
112
  // docx/simple-types.ts
107
113
  function parseOnOff(value) {
108
114
  switch (value) {
@@ -144,8 +150,8 @@ function universalMeasureToTwips(value) {
144
150
  }
145
151
  function parseSignedTwips(value) {
146
152
  if (value === null || value === void 0) return void 0;
147
- const text = value.trim();
148
- const parsed = SAFE_INTEGER.test(text) ? parseInteger(text) : universalMeasureToTwips(text);
153
+ const text2 = value.trim();
154
+ const parsed = SAFE_INTEGER.test(text2) ? parseInteger(text2) : universalMeasureToTwips(text2);
149
155
  return parsed === void 0 ? void 0 : signedTwips(parsed);
150
156
  }
151
157
  function parseTwips(value) {
@@ -154,26 +160,26 @@ function parseTwips(value) {
154
160
  }
155
161
  function parseHalfPoints(value) {
156
162
  if (value === null || value === void 0) return void 0;
157
- const text = value.trim();
158
- if (/^\d+$/.test(text)) {
159
- const parsed = parseInteger(text);
163
+ const text2 = value.trim();
164
+ if (/^\d+$/.test(text2)) {
165
+ const parsed = parseInteger(text2);
160
166
  return parsed === void 0 ? void 0 : halfPoints(parsed);
161
167
  }
162
- const asTwips = UNIVERSAL_MEASURE.test(text) ? universalMeasureToTwips(text) : void 0;
168
+ const asTwips = UNIVERSAL_MEASURE.test(text2) ? universalMeasureToTwips(text2) : void 0;
163
169
  return asTwips !== void 0 && asTwips >= 0 ? halfPoints(Math.round(asTwips / 10)) : void 0;
164
170
  }
165
171
  function parseSignedHalfPoints(value) {
166
172
  if (value === null || value === void 0) return void 0;
167
- const text = value.trim();
168
- const integer2 = parseInteger(text);
173
+ const text2 = value.trim();
174
+ const integer2 = parseInteger(text2);
169
175
  if (integer2 !== void 0) return halfPoints(integer2);
170
- const twips2 = universalMeasureToTwips(text);
176
+ const twips2 = universalMeasureToTwips(text2);
171
177
  return twips2 === void 0 ? void 0 : halfPoints(Math.sign(twips2) * Math.round(Math.abs(twips2) / 10));
172
178
  }
173
179
  function parseTextScale(value) {
174
- const text = value?.trim();
175
- if (text?.endsWith("%") && !/^\d+%$/.test(text)) return void 0;
176
- const parsed = parseUnsignedInteger(text?.endsWith("%") ? text.slice(0, -1) : text);
180
+ const text2 = value?.trim();
181
+ if (text2?.endsWith("%") && !/^\d+%$/.test(text2)) return void 0;
182
+ const parsed = parseUnsignedInteger(text2?.endsWith("%") ? text2.slice(0, -1) : text2);
177
183
  return parsed !== void 0 && parsed <= 600 ? parsed : void 0;
178
184
  }
179
185
  function parseEighthPoints(value) {
@@ -332,16 +338,16 @@ function parseRunProperties(props) {
332
338
  const color = first2(props, "color");
333
339
  const hex = parseRgbColor(getW(color, "val"));
334
340
  if (hex) result.color = hex;
335
- const themeColor = enumValue(isStThemeColor, getW(color, "themeColor"));
336
- if (themeColor) {
337
- result.colorTheme = { token: themeColor };
341
+ const themeColor2 = enumValue(isStThemeColor, getW(color, "themeColor"));
342
+ if (themeColor2) {
343
+ result.colorTheme = { token: themeColor2 };
338
344
  const tint = parseTintShade(getW(color, "themeTint"));
339
345
  const shade = parseTintShade(getW(color, "themeShade"));
340
346
  if (tint !== void 0) result.colorTheme.tint = tint;
341
347
  if (shade !== void 0) result.colorTheme.shade = shade;
342
348
  }
343
- const spacing = parseSignedTwips(getW(first2(props, "spacing"), "val"));
344
- if (spacing !== void 0) result.characterSpacingTwips = spacing;
349
+ const spacing2 = parseSignedTwips(getW(first2(props, "spacing"), "val"));
350
+ if (spacing2 !== void 0) result.characterSpacingTwips = spacing2;
345
351
  const scaleElement = first2(props, "w");
346
352
  const scale = scaleElement ? parseTextScale(getW(scaleElement, "val") ?? "100") : void 0;
347
353
  if (scale !== void 0) result.textScalePercent = scale;
@@ -369,13 +375,13 @@ function borderSide(element) {
369
375
  const style = enumValue(isStBorder, getW(element, "val"));
370
376
  const size = parseEighthPoints(getW(element, "sz"));
371
377
  const color = parseRgbColor(getW(element, "color"));
372
- const themeColor = enumValue(isStThemeColor, getW(element, "themeColor"));
373
- if (!style && size === void 0 && !color && !themeColor) return void 0;
378
+ const themeColor2 = enumValue(isStThemeColor, getW(element, "themeColor"));
379
+ if (!style && size === void 0 && !color && !themeColor2) return void 0;
374
380
  const side = {};
375
381
  if (style) side.style = style;
376
382
  if (size !== void 0) side.sizeEighthPoints = size;
377
383
  if (color) side.color = color;
378
- if (themeColor) side.themeColor = themeColor;
384
+ if (themeColor2) side.themeColor = themeColor2;
379
385
  return side;
380
386
  }
381
387
  function parseShadingFill(shd) {
@@ -693,9 +699,119 @@ function resolveRunFormatting(run, context = {}) {
693
699
  function clampUnitInterval(value) {
694
700
  return Math.min(1, Math.max(0, value));
695
701
  }
702
+ function hexToRgbChannels(color) {
703
+ const normalized = color.replace("#", "");
704
+ if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {
705
+ return null;
706
+ }
707
+ return {
708
+ r: Number.parseInt(normalized.slice(0, 2), 16),
709
+ g: Number.parseInt(normalized.slice(2, 4), 16),
710
+ b: Number.parseInt(normalized.slice(4, 6), 16)
711
+ };
712
+ }
713
+ function percentDivisorFor(text2) {
714
+ return text2.endsWith("%") ? 100 : 1e5;
715
+ }
716
+ function parseOoxmlPercent(value) {
717
+ const text2 = String(value ?? "").trim();
718
+ const divisor = percentDivisorFor(text2);
719
+ const magnitude = Number.parseFloat(divisor === 100 ? text2.slice(0, -1) : text2);
720
+ if (!Number.isFinite(magnitude)) {
721
+ return void 0;
722
+ }
723
+ return magnitude / divisor;
724
+ }
725
+ function parseDrawingPercent(value) {
726
+ const parsed = parseOoxmlPercent(value);
727
+ return parsed === void 0 ? void 0 : clampUnitInterval(parsed);
728
+ }
729
+ function scrgbLinearToSrgb8(linear) {
730
+ const l = Math.min(1, Math.max(0, linear));
731
+ const companded = l <= 31308e-7 ? 12.92 * l : 1.055 * l ** (1 / 2.4) - 0.055;
732
+ return Math.min(255, Math.max(0, Math.round(companded * 255)));
733
+ }
696
734
  function toHex(value) {
697
735
  return Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
698
736
  }
737
+ function rgbToHsl(r, g, b) {
738
+ const rN = r / 255;
739
+ const gN = g / 255;
740
+ const bN = b / 255;
741
+ const cMax = Math.max(rN, gN, bN);
742
+ const cMin = Math.min(rN, gN, bN);
743
+ const delta = cMax - cMin;
744
+ const l = (cMax + cMin) / 2;
745
+ let s = 0;
746
+ if (delta !== 0) {
747
+ s = delta / (1 - Math.abs(2 * l - 1));
748
+ }
749
+ let h = 0;
750
+ if (delta !== 0) {
751
+ if (cMax === rN) {
752
+ h = 60 * ((gN - bN) / delta % 6);
753
+ } else if (cMax === gN) {
754
+ h = 60 * ((bN - rN) / delta + 2);
755
+ } else {
756
+ h = 60 * ((rN - gN) / delta + 4);
757
+ }
758
+ }
759
+ if (h < 0) {
760
+ h += 360;
761
+ }
762
+ return { h, s: clampUnitInterval(s), l: clampUnitInterval(l) };
763
+ }
764
+ function hslToRgb(h, s, l, roundChannel = Math.round, options) {
765
+ const sC = options?.clampSaturation === false ? s : clampUnitInterval(s);
766
+ const lC = clampUnitInterval(l);
767
+ const hN = (h % 360 + 360) % 360;
768
+ const c = (1 - Math.abs(2 * lC - 1)) * sC;
769
+ const x = c * (1 - Math.abs(hN / 60 % 2 - 1));
770
+ const m = lC - c / 2;
771
+ let rP = 0;
772
+ let gP = 0;
773
+ let bP = 0;
774
+ if (hN < 60) {
775
+ rP = c;
776
+ gP = x;
777
+ bP = 0;
778
+ } else if (hN < 120) {
779
+ rP = x;
780
+ gP = c;
781
+ bP = 0;
782
+ } else if (hN < 180) {
783
+ rP = 0;
784
+ gP = c;
785
+ bP = x;
786
+ } else if (hN < 240) {
787
+ rP = 0;
788
+ gP = x;
789
+ bP = c;
790
+ } else if (hN < 300) {
791
+ rP = x;
792
+ gP = 0;
793
+ bP = c;
794
+ } else {
795
+ rP = c;
796
+ gP = 0;
797
+ bP = x;
798
+ }
799
+ return {
800
+ r: roundChannel((rP + m) * 255),
801
+ g: roundChannel((gP + m) * 255),
802
+ b: roundChannel((bP + m) * 255)
803
+ };
804
+ }
805
+ function parseDrawingFraction(value) {
806
+ return parseOoxmlPercent(value);
807
+ }
808
+ function parseDrawingHueDegrees(value) {
809
+ const parsed = Number.parseFloat(String(value ?? "").trim());
810
+ if (!Number.isFinite(parsed)) {
811
+ return void 0;
812
+ }
813
+ return parsed / 6e4;
814
+ }
699
815
 
700
816
  // color/color-linear.ts
701
817
  function srgb255ToLinear(channel) {
@@ -707,6 +823,508 @@ function linearToSrgb255(linear) {
707
823
  return 255 * (c <= 31308e-7 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055);
708
824
  }
709
825
 
826
+ // color/native-gradient-curve.ts
827
+ var OFFICE_SIGMA_FACTORS = [
828
+ 0,
829
+ 59,
830
+ 120,
831
+ 182,
832
+ 247,
833
+ 314,
834
+ 383,
835
+ 454,
836
+ 527,
837
+ 602,
838
+ 680,
839
+ 759,
840
+ 841,
841
+ 926,
842
+ 1013,
843
+ 1102,
844
+ 1194,
845
+ 1288,
846
+ 1385,
847
+ 1485,
848
+ 1587,
849
+ 1692,
850
+ 1800,
851
+ 1911,
852
+ 2024,
853
+ 2141,
854
+ 2260,
855
+ 2383,
856
+ 2508,
857
+ 2637,
858
+ 2769,
859
+ 2904,
860
+ 3042,
861
+ 3183,
862
+ 3328,
863
+ 3477,
864
+ 3628,
865
+ 3783,
866
+ 3942,
867
+ 4104,
868
+ 4270,
869
+ 4439,
870
+ 4612,
871
+ 4789,
872
+ 4969,
873
+ 5153,
874
+ 5341,
875
+ 5533,
876
+ 5728,
877
+ 5928,
878
+ 6131,
879
+ 6338,
880
+ 6549,
881
+ 6764,
882
+ 6983,
883
+ 7206,
884
+ 7434,
885
+ 7665,
886
+ 7900,
887
+ 8139,
888
+ 8382,
889
+ 8630,
890
+ 8881,
891
+ 9136,
892
+ 9396,
893
+ 9660,
894
+ 9927,
895
+ 10199,
896
+ 10475,
897
+ 10755,
898
+ 11039,
899
+ 11327,
900
+ 11619,
901
+ 11916,
902
+ 12216,
903
+ 12520,
904
+ 12828,
905
+ 13140,
906
+ 13456,
907
+ 13776,
908
+ 14099,
909
+ 14427,
910
+ 14758,
911
+ 15093,
912
+ 15431,
913
+ 15774,
914
+ 16119,
915
+ 16469,
916
+ 16822,
917
+ 17178,
918
+ 17538,
919
+ 17901,
920
+ 18267,
921
+ 18637,
922
+ 19009,
923
+ 19385,
924
+ 19764,
925
+ 20146,
926
+ 20530,
927
+ 20918,
928
+ 21308,
929
+ 21701,
930
+ 22096,
931
+ 22494,
932
+ 22894,
933
+ 23297,
934
+ 23702,
935
+ 24109,
936
+ 24518,
937
+ 24929,
938
+ 25342,
939
+ 25756,
940
+ 26173,
941
+ 26591,
942
+ 27010,
943
+ 27431,
944
+ 27853,
945
+ 28276,
946
+ 28701,
947
+ 29126,
948
+ 29552,
949
+ 29979,
950
+ 30407,
951
+ 30836,
952
+ 31264,
953
+ 31694,
954
+ 32123,
955
+ 32553,
956
+ 32983,
957
+ 33413,
958
+ 33842,
959
+ 34272,
960
+ 34700,
961
+ 35129,
962
+ 35557,
963
+ 35984,
964
+ 36410,
965
+ 36835,
966
+ 37260,
967
+ 37683,
968
+ 38105,
969
+ 38526,
970
+ 38945,
971
+ 39363,
972
+ 39780,
973
+ 40194,
974
+ 40607,
975
+ 41018,
976
+ 41427,
977
+ 41834,
978
+ 42239,
979
+ 42642,
980
+ 43042,
981
+ 43440,
982
+ 43835,
983
+ 44228,
984
+ 44618,
985
+ 45006,
986
+ 45390,
987
+ 45772,
988
+ 46151,
989
+ 46527,
990
+ 46899,
991
+ 47269,
992
+ 47635,
993
+ 47998,
994
+ 48358,
995
+ 48714,
996
+ 49067,
997
+ 49417,
998
+ 49762,
999
+ 50105,
1000
+ 50443,
1001
+ 50778,
1002
+ 51109,
1003
+ 51437,
1004
+ 51760,
1005
+ 52080,
1006
+ 52396,
1007
+ 52708,
1008
+ 53016,
1009
+ 53320,
1010
+ 53620,
1011
+ 53917,
1012
+ 54209,
1013
+ 54497,
1014
+ 54781,
1015
+ 55061,
1016
+ 55337,
1017
+ 55609,
1018
+ 55876,
1019
+ 56140,
1020
+ 56400,
1021
+ 56655,
1022
+ 56906,
1023
+ 57154,
1024
+ 57397,
1025
+ 57636,
1026
+ 57871,
1027
+ 58102,
1028
+ 58330,
1029
+ 58553,
1030
+ 58772,
1031
+ 58987,
1032
+ 59198,
1033
+ 59405,
1034
+ 59608,
1035
+ 59808,
1036
+ 60003,
1037
+ 60195,
1038
+ 60383,
1039
+ 60567,
1040
+ 60747,
1041
+ 60924,
1042
+ 61097,
1043
+ 61266,
1044
+ 61432,
1045
+ 61594,
1046
+ 61753,
1047
+ 61908,
1048
+ 62059,
1049
+ 62208,
1050
+ 62353,
1051
+ 62494,
1052
+ 62632,
1053
+ 62767,
1054
+ 62899,
1055
+ 63028,
1056
+ 63153,
1057
+ 63276,
1058
+ 63395,
1059
+ 63512,
1060
+ 63625,
1061
+ 63736,
1062
+ 63844,
1063
+ 63949,
1064
+ 64051,
1065
+ 64151,
1066
+ 64248,
1067
+ 64342,
1068
+ 64434,
1069
+ 64523,
1070
+ 64610,
1071
+ 64695,
1072
+ 64777,
1073
+ 64856,
1074
+ 64934,
1075
+ 65009,
1076
+ 65082,
1077
+ 65153,
1078
+ 65222,
1079
+ 65289,
1080
+ 65354,
1081
+ 65416,
1082
+ 65477,
1083
+ 65536
1084
+ ];
1085
+
1086
+ // color/sigma-gradient-stops.ts
1087
+ function sigmaGradientStops(stops) {
1088
+ if (stops.length !== 2 || stops[0]?.offset !== 0 || stops[1]?.offset !== 1) return void 0;
1089
+ if (stops.some((stop) => (stop.opacity ?? 1) !== 1)) return void 0;
1090
+ const front = hexToRgbChannels(stops[0].color);
1091
+ const back = hexToRgbChannels(stops[1].color);
1092
+ if (!front || !back) return void 0;
1093
+ return OFFICE_SIGMA_FACTORS.map((value, index) => {
1094
+ const factor = value / 65536;
1095
+ const mix = (a, b) => toHex(255 * ((a / 255) ** 2.2 * (1 - factor) + (b / 255) ** 2.2 * factor) ** (1 / 2.2));
1096
+ return {
1097
+ offset: Math.fround(index / 255),
1098
+ color: `#${mix(front.r, back.r)}${mix(front.g, back.g)}${mix(front.b, back.b)}`,
1099
+ opacity: 1
1100
+ };
1101
+ });
1102
+ }
1103
+
1104
+ // color/hex-rgb.ts
1105
+ function parseArgbHex(hex) {
1106
+ const clean2 = hex.replace(/^#/, "");
1107
+ const rgb = clean2.length === 8 ? clean2.slice(2) : clean2;
1108
+ if (!/^[0-9a-fA-F]{6}$/.test(rgb)) return void 0;
1109
+ return [0, 2, 4].map((i) => parseInt(rgb.slice(i, i + 2), 16));
1110
+ }
1111
+
1112
+ // drawingml/ordered-color-transforms.ts
1113
+ function orderedColorTransforms(channels, transforms) {
1114
+ let { r, g, b } = channels;
1115
+ let alpha = 1;
1116
+ const wrap = (value) => (value % 360 + 360) % 360;
1117
+ for (const transform of transforms) {
1118
+ const { name, value } = transform;
1119
+ const fraction = parseDrawingFraction(value);
1120
+ if (name === "alpha" && fraction !== void 0) alpha = clampUnitInterval(fraction);
1121
+ else if (name === "alphaMod" && fraction !== void 0)
1122
+ alpha = clampUnitInterval(alpha * fraction);
1123
+ else if (name === "alphaOff" && fraction !== void 0)
1124
+ alpha = clampUnitInterval(alpha + fraction);
1125
+ else if (name === "inv") [r, g, b] = [255 - r, 255 - g, 255 - b];
1126
+ else if (name === "gray") r = g = b = 0.299 * r + 0.587 * g + 0.114 * b;
1127
+ else if ((name === "shade" || name === "tint") && fraction !== void 0) {
1128
+ const mix = (channel) => linearToSrgb255(
1129
+ name === "shade" ? srgb255ToLinear(channel) * fraction : 1 - (1 - srgb255ToLinear(channel)) * fraction
1130
+ );
1131
+ [r, g, b] = [mix(r), mix(g), mix(b)];
1132
+ } else {
1133
+ const hsl = rgbToHsl(r, g, b);
1134
+ if (name === "comp") hsl.h = wrap(hsl.h + 180);
1135
+ else if (name === "hue") {
1136
+ const hue = parseDrawingHueDegrees(value);
1137
+ if (hue !== void 0) hsl.h = wrap(hue);
1138
+ } else if (name === "hueOff") {
1139
+ const hue = parseDrawingHueDegrees(value);
1140
+ if (hue !== void 0) hsl.h = wrap(hsl.h + hue);
1141
+ } else if (name === "hueMod" && fraction !== void 0) hsl.h = wrap(hsl.h * fraction);
1142
+ else if (name === "sat" && fraction !== void 0) hsl.s = clampUnitInterval(fraction);
1143
+ else if (name === "satMod" && fraction !== void 0) hsl.s *= fraction;
1144
+ else if (name === "satOff" && fraction !== void 0)
1145
+ hsl.s = clampUnitInterval(hsl.s + fraction);
1146
+ else if (name === "lum" && fraction !== void 0) hsl.l = clampUnitInterval(fraction);
1147
+ else if (name === "lumMod" && fraction !== void 0)
1148
+ hsl.l = clampUnitInterval(hsl.l * fraction);
1149
+ else if (name === "lumOff" && fraction !== void 0)
1150
+ hsl.l = clampUnitInterval(hsl.l + fraction);
1151
+ else continue;
1152
+ ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, (channel) => channel, {
1153
+ clampSaturation: false
1154
+ }));
1155
+ }
1156
+ }
1157
+ return { r, g, b, alpha };
1158
+ }
1159
+
1160
+ // drawingml/drawing-color.ts
1161
+ var COLOR_ELEMENTS = {
1162
+ srgbClr: "srgb",
1163
+ schemeClr: "scheme",
1164
+ sysClr: "system",
1165
+ prstClr: "preset",
1166
+ scrgbClr: "scrgb",
1167
+ hslClr: "hsl"
1168
+ };
1169
+ function colorValue(kind, element) {
1170
+ const attribute = (name) => element.getAttribute(name) ?? "";
1171
+ if (kind === "scrgb") return `${attribute("r")},${attribute("g")},${attribute("b")}`;
1172
+ if (kind === "hsl") return `${attribute("hue")},${attribute("sat")},${attribute("lum")}`;
1173
+ return attribute("val");
1174
+ }
1175
+ function parseDrawingColorIn(container) {
1176
+ if (!container) return void 0;
1177
+ for (const element of elements(container)) {
1178
+ const kind = COLOR_ELEMENTS[element.localName];
1179
+ if (!kind || element.namespaceURI && element.namespaceURI !== NS.a) continue;
1180
+ return parseDrawingColor(element);
1181
+ }
1182
+ return void 0;
1183
+ }
1184
+ function parseDrawingColor(element) {
1185
+ const kind = COLOR_ELEMENTS[element.localName];
1186
+ if (!kind) return void 0;
1187
+ const color = {
1188
+ kind,
1189
+ value: colorValue(kind, element),
1190
+ transforms: elements(element).map((child) => ({
1191
+ name: child.localName,
1192
+ value: child.getAttribute("val") ?? ""
1193
+ }))
1194
+ };
1195
+ const fallback = kind === "system" ? element.getAttribute("lastClr") : null;
1196
+ if (fallback) color.fallback = fallback;
1197
+ return color;
1198
+ }
1199
+ var PRESET_COLORS = {
1200
+ black: "#000000",
1201
+ white: "#FFFFFF",
1202
+ red: "#FF0000",
1203
+ green: "#008000",
1204
+ blue: "#0000FF",
1205
+ yellow: "#FFFF00",
1206
+ gray: "#808080",
1207
+ grey: "#808080"
1208
+ };
1209
+ function baseHex(color, theme) {
1210
+ switch (color.kind) {
1211
+ case "srgb":
1212
+ return /^[0-9a-f]{6}$/i.test(color.value) ? `#${color.value.toUpperCase()}` : void 0;
1213
+ case "scheme":
1214
+ return theme?.scheme(color.value);
1215
+ case "system":
1216
+ return color.fallback && /^[0-9a-f]{6}$/i.test(color.fallback) ? `#${color.fallback.toUpperCase()}` : void 0;
1217
+ case "preset":
1218
+ return PRESET_COLORS[color.value];
1219
+ case "scrgb": {
1220
+ const [r, g, b] = color.value.split(",").map((part) => parseDrawingFraction(part));
1221
+ if (r === void 0 || g === void 0 || b === void 0) return void 0;
1222
+ return `#${toHex(scrgbLinearToSrgb8(r))}${toHex(scrgbLinearToSrgb8(g))}${toHex(scrgbLinearToSrgb8(b))}`;
1223
+ }
1224
+ case "hsl": {
1225
+ const [h, s, l] = color.value.split(",");
1226
+ const hue = parseDrawingHueDegrees(h);
1227
+ const sat = parseDrawingFraction(s);
1228
+ const lum = parseDrawingFraction(l);
1229
+ if (hue === void 0 || sat === void 0 || lum === void 0) return void 0;
1230
+ const { r, g, b } = hslToRgb(hue, sat, lum);
1231
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1232
+ }
1233
+ }
1234
+ }
1235
+ var APPLIED = /* @__PURE__ */ new Set([
1236
+ "alpha",
1237
+ "alphaMod",
1238
+ "alphaOff",
1239
+ "comp",
1240
+ "inv",
1241
+ "gray",
1242
+ "shade",
1243
+ "tint",
1244
+ "hue",
1245
+ "hueMod",
1246
+ "hueOff",
1247
+ "sat",
1248
+ "satMod",
1249
+ "satOff",
1250
+ "lum",
1251
+ "lumMod",
1252
+ "lumOff"
1253
+ ]);
1254
+ function resolveDrawingColor(color, theme, options) {
1255
+ const base = baseHex(color, theme);
1256
+ const rgb = base ? hexToRgbChannels(base) : null;
1257
+ if (!rgb) return void 0;
1258
+ if (options?.transformOrder === "document") {
1259
+ const value = orderedColorTransforms(rgb, color.transforms);
1260
+ const round = options.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
1261
+ return {
1262
+ hex: `#${toHex(round(value.r))}${toHex(round(value.g))}${toHex(round(value.b))}`,
1263
+ alpha: value.alpha,
1264
+ unapplied: [...new Set(color.transforms.map((transform) => transform.name))].filter(
1265
+ (name) => !APPLIED.has(name)
1266
+ )
1267
+ };
1268
+ }
1269
+ let { r, g, b } = rgb;
1270
+ const find = (name) => color.transforms.find((entry) => entry.name === name)?.value;
1271
+ const has = (name) => color.transforms.some((entry) => entry.name === name);
1272
+ if (has("comp")) {
1273
+ const hsl = rgbToHsl(r, g, b);
1274
+ ({ r, g, b } = hslToRgb((hsl.h + 180) % 360, hsl.s, hsl.l));
1275
+ }
1276
+ if (has("inv")) [r, g, b] = [255 - r, 255 - g, 255 - b];
1277
+ if (has("gray")) r = g = b = Math.round(0.299 * r + 0.587 * g + 0.114 * b);
1278
+ const shade = parseDrawingPercent(find("shade"));
1279
+ if (shade !== void 0) {
1280
+ r = linearToSrgb255(srgb255ToLinear(r) * shade);
1281
+ g = linearToSrgb255(srgb255ToLinear(g) * shade);
1282
+ b = linearToSrgb255(srgb255ToLinear(b) * shade);
1283
+ }
1284
+ const tint = parseDrawingPercent(find("tint"));
1285
+ if (tint !== void 0) {
1286
+ r = linearToSrgb255(1 - (1 - srgb255ToLinear(r)) * tint);
1287
+ g = linearToSrgb255(1 - (1 - srgb255ToLinear(g)) * tint);
1288
+ b = linearToSrgb255(1 - (1 - srgb255ToLinear(b)) * tint);
1289
+ }
1290
+ if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(has)) {
1291
+ const hsl = rgbToHsl(r, g, b);
1292
+ const wrap = (degrees) => (degrees % 360 + 360) % 360;
1293
+ const hueAbs = parseDrawingHueDegrees(find("hue"));
1294
+ if (hueAbs !== void 0) hsl.h = wrap(hueAbs);
1295
+ const hueMod = parseDrawingFraction(find("hueMod"));
1296
+ if (hueMod !== void 0) hsl.h = wrap(hsl.h * hueMod);
1297
+ const hueOff = parseDrawingHueDegrees(find("hueOff"));
1298
+ if (hueOff !== void 0) hsl.h = wrap(hsl.h + hueOff);
1299
+ const satAbs = parseDrawingFraction(find("sat"));
1300
+ if (satAbs !== void 0) hsl.s = clampUnitInterval(satAbs);
1301
+ const satMod = parseDrawingFraction(find("satMod"));
1302
+ if (satMod !== void 0) hsl.s = clampUnitInterval(hsl.s * satMod);
1303
+ const satOff = parseDrawingFraction(find("satOff"));
1304
+ if (satOff !== void 0) hsl.s = clampUnitInterval(hsl.s + satOff);
1305
+ const lumAbs = parseDrawingFraction(find("lum"));
1306
+ if (lumAbs !== void 0) hsl.l = clampUnitInterval(lumAbs);
1307
+ const lumMod = parseDrawingFraction(find("lumMod"));
1308
+ if (lumMod !== void 0) hsl.l = clampUnitInterval(hsl.l * lumMod);
1309
+ const lumOff = parseDrawingFraction(find("lumOff"));
1310
+ if (lumOff !== void 0) hsl.l = clampUnitInterval(hsl.l + lumOff);
1311
+ const round = options?.hslRounding === "halfDown" ? (value) => Math.ceil(value - 0.5) : Math.round;
1312
+ ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, round));
1313
+ }
1314
+ let alpha = parseDrawingPercent(find("alpha")) ?? 1;
1315
+ const alphaMod = parseDrawingFraction(find("alphaMod"));
1316
+ if (alphaMod !== void 0) alpha = clampUnitInterval(alpha * alphaMod);
1317
+ const alphaOff = parseDrawingFraction(find("alphaOff"));
1318
+ if (alphaOff !== void 0) alpha = clampUnitInterval(alpha + alphaOff);
1319
+ return {
1320
+ hex: `#${toHex(r)}${toHex(g)}${toHex(b)}`,
1321
+ alpha,
1322
+ unapplied: [...new Set(color.transforms.map((entry) => entry.name))].filter(
1323
+ (name) => !APPLIED.has(name)
1324
+ )
1325
+ };
1326
+ }
1327
+
710
1328
  // drawingml/theme-model.ts
711
1329
  var DEFAULT_THEME_COLOR_MAP = {
712
1330
  bg1: "lt1",
@@ -715,6 +1333,13 @@ var DEFAULT_THEME_COLOR_MAP = {
715
1333
  tx2: "dk2"
716
1334
  };
717
1335
 
1336
+ // drawingml/theme-color.ts
1337
+ function themeSlotHex(color) {
1338
+ if (!color) return void 0;
1339
+ const value = color.kind === "srgb" ? color.value : color.kind === "system" ? color.fallback : void 0;
1340
+ return value ? value.toUpperCase() : void 0;
1341
+ }
1342
+
718
1343
  // docx/theme-color.ts
719
1344
  function isThemeColorToken(value) {
720
1345
  return isStThemeColor(value);
@@ -778,6 +1403,11 @@ function resolveThemeColorReference(ref, theme) {
778
1403
  return hex;
779
1404
  }
780
1405
 
1406
+ // opc/signature/xml-utils.ts
1407
+ function escapeXmlAttr(value) {
1408
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
1409
+ }
1410
+
781
1411
  // docx/expect-defined.ts
782
1412
  function expectDefined(value, context) {
783
1413
  if (value === void 0 || value === null) {
@@ -935,10 +1565,10 @@ function hasUnexpectedAttributes(element, allowed, allowDateUtc = false) {
935
1565
  }
936
1566
  return false;
937
1567
  }
938
- function runPropertiesHaveUnknownContent(properties) {
939
- if (!properties) return false;
940
- if (hasUnexpectedAttributes(properties, [])) return true;
941
- for (const node of Array.from(properties.childNodes)) {
1568
+ function runPropertiesHaveUnknownContent(properties2) {
1569
+ if (!properties2) return false;
1570
+ if (hasUnexpectedAttributes(properties2, [])) return true;
1571
+ for (const node of Array.from(properties2.childNodes)) {
942
1572
  if (node.nodeType !== 1) {
943
1573
  if (node.nodeType === 3 && node.textContent?.trim()) return true;
944
1574
  continue;
@@ -1003,6 +1633,1930 @@ function definedProps(source) {
1003
1633
  return Object.fromEntries(Object.entries(source).filter(([, value]) => value !== void 0));
1004
1634
  }
1005
1635
 
1636
+ // drawingml/drawing-color-css.ts
1637
+ function drawingColorCss(value) {
1638
+ if (!value || value.alpha === 1) return value?.hex;
1639
+ const channels = [1, 3, 5].map(
1640
+ (offset) => Number.parseInt(value.hex.slice(offset, offset + 2), 16)
1641
+ );
1642
+ return `rgba(${channels.join(",")},${value.alpha})`;
1643
+ }
1644
+
1645
+ // drawingml/drawing-shadow.ts
1646
+ function resolveDrawingShadow(effects, theme) {
1647
+ const node = first(effects, "outerShdw", NS.a);
1648
+ if (!node) return void 0;
1649
+ const value = (key, fallback) => Number(node.getAttribute(key) ?? fallback);
1650
+ if (value("sx", 1e5) !== 1e5 || value("sy", 1e5) !== 1e5 || value("kx", 0) !== 0 || value("ky", 0) !== 0)
1651
+ return void 0;
1652
+ const color = parseDrawingColorIn(node);
1653
+ const resolved = color && resolveDrawingColor(color, theme, { transformOrder: "document" });
1654
+ const blur = value("blurRad", 0) / EMU_PER_PIXEL;
1655
+ const distance = value("dist", 0) / EMU_PER_PIXEL;
1656
+ const angle = value("dir", 0) / 6e4 * Math.PI / 180;
1657
+ if (!resolved || ![blur, distance, angle].every(Number.isFinite) || blur < 0 || distance < 0)
1658
+ return void 0;
1659
+ return {
1660
+ color: resolved.hex,
1661
+ opacity: resolved.alpha,
1662
+ blur,
1663
+ dx: Math.cos(angle) * distance,
1664
+ dy: Math.sin(angle) * distance
1665
+ };
1666
+ }
1667
+ function resolveDrawingShadowXml(xml, theme) {
1668
+ return xml ? resolveDrawingShadow(parseXml(xml).documentElement, theme) : void 0;
1669
+ }
1670
+ function svgDropShadowElement(s, format) {
1671
+ const num = format.number;
1672
+ return `<feDropShadow dx="${num(s.dx)}" dy="${num(s.dy)}" stdDeviation="${num(s.blur / 2)}" flood-color="${format.color(s.color, "#000000")}" flood-opacity="${num(s.opacity)}" result="shadow"/>`;
1673
+ }
1674
+ function hexToRgb2(color) {
1675
+ const parsed = hexToRgbChannels(color);
1676
+ if (parsed) return parsed;
1677
+ const hex = color.replace("#", "");
1678
+ return {
1679
+ r: Number.parseInt(hex.slice(0, 2), 16) || 0,
1680
+ g: Number.parseInt(hex.slice(2, 4), 16) || 0,
1681
+ b: Number.parseInt(hex.slice(4, 6), 16) || 0
1682
+ };
1683
+ }
1684
+ function toHexChannel(value) {
1685
+ return toHex(value).toLowerCase();
1686
+ }
1687
+ function lerpStops(a, b, t) {
1688
+ const ca = hexToRgb2(a.color);
1689
+ const cb = hexToRgb2(b.color);
1690
+ const oa = a.opacity ?? 1;
1691
+ const ob = b.opacity ?? 1;
1692
+ return {
1693
+ color: `#${toHexChannel(ca.r + (cb.r - ca.r) * t)}${toHexChannel(ca.g + (cb.g - ca.g) * t)}${toHexChannel(ca.b + (cb.b - ca.b) * t)}`,
1694
+ opacity: oa + (ob - oa) * t
1695
+ };
1696
+ }
1697
+ function colorAt(stops, position) {
1698
+ const first3 = stops[0];
1699
+ const last = stops[stops.length - 1];
1700
+ if (position <= first3.position) {
1701
+ return { color: first3.color, opacity: first3.opacity ?? 1 };
1702
+ }
1703
+ if (position >= last.position) {
1704
+ return { color: last.color, opacity: last.opacity ?? 1 };
1705
+ }
1706
+ for (let i = 0; i < stops.length - 1; i += 1) {
1707
+ const from = stops[i];
1708
+ const to = stops[i + 1];
1709
+ if (position >= from.position && position <= to.position) {
1710
+ const span = to.position - from.position;
1711
+ const t = span > 0 ? (position - from.position) / span : 0;
1712
+ return lerpStops(from, to, t);
1713
+ }
1714
+ }
1715
+ return { color: last.color, opacity: last.opacity ?? 1 };
1716
+ }
1717
+ function resolveInnerRect(fillToRect, focalPoint) {
1718
+ let centerX = 50;
1719
+ let centerY = 50;
1720
+ let width = 0;
1721
+ let height = 0;
1722
+ if (fillToRect) {
1723
+ const { l, t, r, b } = fillToRect;
1724
+ centerX = (l + (1 - r)) / 2 * 100;
1725
+ centerY = (t + (1 - b)) / 2 * 100;
1726
+ width = Math.max(0, Math.min(1, 1 - l - r)) * 100;
1727
+ height = Math.max(0, Math.min(1, 1 - t - b)) * 100;
1728
+ }
1729
+ return {
1730
+ left: centerX - width / 2,
1731
+ top: centerY - height / 2,
1732
+ right: centerX + width / 2,
1733
+ bottom: centerY + height / 2
1734
+ };
1735
+ }
1736
+ function lerpEdge(inner, outer, t) {
1737
+ return inner + (outer - inner) * t;
1738
+ }
1739
+ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
1740
+ if (stops.length === 0) {
1741
+ return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
1742
+ }
1743
+ const sorted = [...stops].sort((a, b) => a.position - b.position);
1744
+ const inner = resolveInnerRect(fillToRect);
1745
+ const rects = [];
1746
+ const alphaRects = [];
1747
+ const masked = sorted.some((stop) => (stop.opacity ?? 1) < 1);
1748
+ const bands = options?.bands;
1749
+ if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
1750
+ for (let i = bands; i >= 0; i -= 1) {
1751
+ const t = i / bands;
1752
+ const { color, opacity } = colorAt(sorted, t * 100);
1753
+ const left = lerpEdge(inner.left, 0, t);
1754
+ const top = lerpEdge(inner.top, 0, t);
1755
+ const right = lerpEdge(inner.right, 100, t);
1756
+ const bottom = lerpEdge(inner.bottom, 100, t);
1757
+ const opacityAttr = !masked && opacity < 1 ? ` fill-opacity="${Math.max(0, opacity).toFixed(3)}"` : "";
1758
+ rects.push(
1759
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="${color}"${opacityAttr}/>`
1760
+ );
1761
+ if (masked) {
1762
+ const channel = toHexChannel(opacity * 255);
1763
+ alphaRects.push(
1764
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="#${channel}${channel}${channel}"/>`
1765
+ );
1766
+ }
1767
+ }
1768
+ const paint = masked ? `<defs><mask id="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100" mask-type="luminance" color-interpolation="sRGB">${alphaRects.join("")}</mask></defs><g mask="url(#alpha)">${rects.join("")}</g>` : rects.join("");
1769
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${paint}</svg>`;
1770
+ }
1771
+
1772
+ // chart/color-palettes.ts
1773
+ var COLORFUL_VARIATIONS = [
1774
+ {},
1775
+ { lumMod: 6e4 },
1776
+ { lumMod: 8e4, lumOff: 2e4 },
1777
+ { lumMod: 8e4 },
1778
+ { lumMod: 6e4, lumOff: 4e4 },
1779
+ { lumMod: 5e4 },
1780
+ { lumMod: 7e4, lumOff: 3e4 },
1781
+ { lumMod: 7e4 },
1782
+ { lumMod: 5e4, lumOff: 5e4 }
1783
+ ];
1784
+ var GRAY_VARIATIONS = [
1785
+ { tint: 88500 },
1786
+ { tint: 55e3 },
1787
+ { tint: 75e3 },
1788
+ { tint: 98500 },
1789
+ { tint: 3e4 },
1790
+ { tint: 6e4 },
1791
+ { tint: 8e4 }
1792
+ ];
1793
+ var ACCENTS = ["accent1", "accent2", "accent3", "accent4", "accent5", "accent6"];
1794
+ function colorful(id, index, base) {
1795
+ return { id, group: "colorful", index, meth: "cycle", base, variations: COLORFUL_VARIATIONS };
1796
+ }
1797
+ function mono(id, index, accent, meth) {
1798
+ return { id, group: "monochromatic", index, meth, base: [accent], variations: [] };
1799
+ }
1800
+ var CHART_COLOR_PALETTES = [
1801
+ colorful(10, 1, ACCENTS),
1802
+ colorful(11, 2, ["accent1", "accent3", "accent5"]),
1803
+ colorful(12, 3, ["accent2", "accent4", "accent6"]),
1804
+ colorful(13, 4, ["accent6", "accent5", "accent4"]),
1805
+ ...ACCENTS.map((accent, i) => mono(14 + i, 1 + i, accent, "withinLinear")),
1806
+ {
1807
+ id: 20,
1808
+ group: "monochromatic",
1809
+ index: 7,
1810
+ meth: "cycle",
1811
+ base: ["dk1"],
1812
+ variations: GRAY_VARIATIONS
1813
+ },
1814
+ ...ACCENTS.map((accent, i) => mono(21 + i, 8 + i, accent, "withinLinearReversed"))
1815
+ ];
1816
+ function findChartColorPalette(id) {
1817
+ return CHART_COLOR_PALETTES.find((palette) => palette.id === id);
1818
+ }
1819
+ function withinLinearTransform(i, n2) {
1820
+ if (n2 <= 1) {
1821
+ return {};
1822
+ }
1823
+ const step = 140 / (n2 + 1);
1824
+ const centre = (n2 - 1) / 2;
1825
+ const value = 100 - step * Math.abs(i - centre);
1826
+ if (i < centre) {
1827
+ return { shade: Math.floor(value + 1e-9) * 1e3 };
1828
+ }
1829
+ if (i > centre) {
1830
+ return { tint: Math.ceil(value - 1e-9) * 1e3 };
1831
+ }
1832
+ return {};
1833
+ }
1834
+ function chartPaletteSeriesColorChoice(palette, i, n2) {
1835
+ let base;
1836
+ let transform;
1837
+ if (palette.meth === "cycle") {
1838
+ base = palette.base[i % palette.base.length];
1839
+ const round = Math.floor(i / palette.base.length);
1840
+ transform = (palette.variations.length ? palette.variations[round % palette.variations.length] : {}) ?? {};
1841
+ } else {
1842
+ const index = palette.meth === "withinLinearReversed" ? n2 - 1 - i : i;
1843
+ base = palette.base[0];
1844
+ transform = withinLinearTransform(index, n2);
1845
+ }
1846
+ if (!base) throw new RangeError("A chart palette must have a base color");
1847
+ return {
1848
+ kind: "scheme",
1849
+ value: base,
1850
+ transforms: Object.entries(transform).map(([name, value]) => ({ name, value: String(value) }))
1851
+ };
1852
+ }
1853
+ function chartPaletteSeriesColor(palette, i, n2, scheme) {
1854
+ const choice = chartPaletteSeriesColorChoice(palette, i, n2);
1855
+ return (resolveDrawingColor(choice, { scheme: (name) => scheme[name] })?.hex ?? scheme[choice.value]).toUpperCase();
1856
+ }
1857
+
1858
+ // chart/style-definition.ts
1859
+ var CHART_STYLE_PARTS = [
1860
+ "title",
1861
+ "axisTitle",
1862
+ "categoryAxis",
1863
+ "valueAxis",
1864
+ "legend",
1865
+ "dataLabel",
1866
+ "dataPoint",
1867
+ "dataPointLine",
1868
+ "gridlineMajor",
1869
+ "gridlineMinor",
1870
+ "chartArea",
1871
+ "plotArea"
1872
+ ];
1873
+ function resolveChartStyleDefinition(style, resolve) {
1874
+ const out = {};
1875
+ const fillColor = (fill) => fill?.kind === "none" ? "none" : fill?.kind === "solid" ? resolve(fill.color) : void 0;
1876
+ for (const name of CHART_STYLE_PARTS) {
1877
+ const source = style.entries[name];
1878
+ if (!source) continue;
1879
+ const entry = {};
1880
+ for (const key of ["fontSize", "bold", "italic", "underline"]) {
1881
+ const value = source[key];
1882
+ if (value !== void 0) Object.assign(entry, { [key]: value });
1883
+ }
1884
+ const line2 = fillColor(source.line?.fill) ?? (source.lineRef?.color && resolve(source.lineRef.color));
1885
+ const fill = fillColor(source.fill) ?? (source.fillRef?.color && resolve(source.fillRef.color));
1886
+ const color = (source.textColor && resolve(source.textColor)) ?? (source.fontRef?.color && resolve(source.fontRef.color));
1887
+ if (color !== void 0) entry.color = color;
1888
+ if (line2 !== void 0) entry.lineColor = line2;
1889
+ if (fill !== void 0) entry.fillColor = fill;
1890
+ if (source.line?.widthEmu !== void 0 && source.line.widthEmu > 0)
1891
+ entry.lineWidth = source.line.widthEmu / 12700;
1892
+ if (Object.keys(entry).length) out[name] = entry;
1893
+ }
1894
+ return Object.keys(out).length ? out : void 0;
1895
+ }
1896
+ function effectiveBuiltInChartStyle(formatting) {
1897
+ return formatting?.builtInStyle ?? (formatting?.sourceXml ? void 0 : 102);
1898
+ }
1899
+ function builtInChartTextStyle(id) {
1900
+ if (id === void 0 || !Number.isInteger(id) || !(id >= 1 && id <= 48 || id >= 101 && id <= 148))
1901
+ return {};
1902
+ const legacy = id > 100 ? id - 100 : id;
1903
+ const common = {
1904
+ sourceXml: "",
1905
+ fontSize: 10,
1906
+ bold: false,
1907
+ italic: false,
1908
+ fontRef: {
1909
+ index: "minor",
1910
+ color: { kind: "scheme", value: legacy >= 41 ? "lt1" : "tx1", transforms: [] }
1911
+ }
1912
+ };
1913
+ return {
1914
+ title: { ...common, fontSize: id > 100 ? 18 : 10, bold: true },
1915
+ categoryAxis: { ...common },
1916
+ valueAxis: { ...common },
1917
+ legend: { ...common }
1918
+ };
1919
+ }
1920
+
1921
+ // chart/manual-layout.ts
1922
+ function hasManualLayoutFields(layout) {
1923
+ return layout != null && (layout.x !== void 0 || layout.y !== void 0 || layout.width !== void 0 || layout.height !== void 0);
1924
+ }
1925
+ function resolveManualLayoutRect(layout, frame, auto) {
1926
+ if (!hasManualLayoutFields(layout)) return void 0;
1927
+ const x = layout.x === void 0 ? auto.x : layout.xMode === "edge" ? layout.x * frame.width : auto.x + layout.x * frame.width;
1928
+ const y = layout.y === void 0 ? auto.y : layout.yMode === "edge" ? layout.y * frame.height : auto.y + layout.y * frame.height;
1929
+ const width = layout.width === void 0 ? auto.width : layout.widthMode === "edge" ? layout.width * frame.width - x : layout.width * frame.width;
1930
+ const height = layout.height === void 0 ? auto.height : layout.heightMode === "edge" ? layout.height * frame.height - y : layout.height * frame.height;
1931
+ return { x, y, width: Math.max(width, 1), height: Math.max(height, 1) };
1932
+ }
1933
+
1934
+ // chart/gradient-stop-edit.ts
1935
+ function sortGradientStops(stops) {
1936
+ return stops.slice().sort((a, b) => a.position - b.position);
1937
+ }
1938
+
1939
+ // chart/gradient-coincident-stops.ts
1940
+ var NATIVE_COINCIDENT_STOP_RAMP = 1 / 256;
1941
+ function spreadCoincidentStops(stops) {
1942
+ const out = [];
1943
+ for (const [index, stop] of stops.entries()) {
1944
+ const source = stops[index - 1];
1945
+ const previous = out.at(-1);
1946
+ const next = stops[index + 1];
1947
+ if (!source || !previous || stop.offset !== source.offset || stop.color === source.color && (stop.opacity ?? 1) === (source.opacity ?? 1)) {
1948
+ out.push(stop);
1949
+ continue;
1950
+ }
1951
+ const limit = Math.min(1, next ? next.offset : 1);
1952
+ out.push({
1953
+ ...stop,
1954
+ offset: Math.max(stop.offset, Math.min(previous.offset + NATIVE_COINCIDENT_STOP_RAMP, limit))
1955
+ });
1956
+ }
1957
+ return out;
1958
+ }
1959
+
1960
+ // chart/gradient-definition.ts
1961
+ function resolveChartGradient(fill, resolve) {
1962
+ const focus = fill.fillToRect;
1963
+ const stops = fill.stops.flatMap((stop) => {
1964
+ const color = resolve(stop.color);
1965
+ return color ? [{ position: stop.position, color: color.hex, opacity: color.alpha }] : [];
1966
+ });
1967
+ return {
1968
+ type: fill.path ? "radial" : "linear",
1969
+ stops,
1970
+ ...fill.angle === void 0 ? {} : { angle: fill.angle },
1971
+ ...fill.scaled === void 0 ? {} : { scaled: fill.scaled },
1972
+ ...fill.path === void 0 ? {} : { path: fill.path },
1973
+ ...focus === void 0 ? {} : { fillToRect: { ...focus } },
1974
+ // Native opaque endpoint-pair linear, rect, circle and rectangular-shape profiles.
1975
+ ...(!fill.path && fill.scaled === true || ["rect", "circle", "shape"].includes(fill.path ?? "")) && fill.stops.length === 2 && stops.length === 2 && stops.every((stop) => stop.opacity === 1) && stops.some((stop) => stop.position === 0) && stops.some((stop) => stop.position === 100) ? { interpolation: "sigma-gamma22" } : {},
1976
+ ...focus ? { focalPoint: { x: (1 + focus.l - focus.r) / 2, y: (1 + focus.t - focus.b) / 2 } } : {}
1977
+ };
1978
+ }
1979
+ function buildChartGradientDef(id, fill, bounds) {
1980
+ const sourceStops = sortGradientStops(fill.stops).map((stop) => ({
1981
+ offset: Math.min(Math.max(stop.position / 100, 0), 1),
1982
+ color: stop.color,
1983
+ ...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
1984
+ }));
1985
+ const stops = fill.interpolation === "sigma-gamma22" ? sigmaGradientStops(sourceStops) ?? sourceStops : sourceStops;
1986
+ if (fill.type === "radial" && (fill.path === "rect" || fill.path === "shape" && bounds?.shape === "rect")) {
1987
+ const markup = buildRectPathGradientSvg(
1988
+ stops.map((stop) => ({
1989
+ position: stop.offset * 100,
1990
+ color: stop.color,
1991
+ ...stop.opacity === void 0 ? {} : { opacity: stop.opacity }
1992
+ })),
1993
+ void 0,
1994
+ fill.fillToRect,
1995
+ { bands: 1024}
1996
+ );
1997
+ return {
1998
+ kind: "rectPath",
1999
+ id,
2000
+ href: `data:image/svg+xml,${encodeURIComponent(markup)}`,
2001
+ stops
2002
+ };
2003
+ }
2004
+ if (fill.type === "radial") {
2005
+ const cx = fill.focalPoint?.x ?? 0.5;
2006
+ const cy = fill.focalPoint?.y ?? 0.5;
2007
+ const aspect = fill.path === "circle" && bounds && Number.isFinite(bounds.width) && Number.isFinite(bounds.height) && bounds.width > 0 && bounds.height > 0 ? bounds.height / bounds.width : 1;
2008
+ return {
2009
+ kind: "radialGradient",
2010
+ id,
2011
+ cx,
2012
+ cy,
2013
+ r: Math.max(
2014
+ ...[0, 1].flatMap((x) => [0, 1].map((y) => Math.hypot(x - cx, (y - cy) * aspect)))
2015
+ ),
2016
+ ...aspect === 1 ? {} : { gradientTransform: `matrix(1 0 0 ${1 / aspect} 0 ${cy * (1 - 1 / aspect)})` },
2017
+ stops
2018
+ };
2019
+ }
2020
+ const rad = (fill.angle ?? 0) * Math.PI / 180;
2021
+ const span = fill.scaled ? Math.abs(Math.cos(rad)) + Math.abs(Math.sin(rad)) : 1;
2022
+ const dx = Math.cos(rad) * span / 2;
2023
+ const dy = Math.sin(rad) * span / 2;
2024
+ const round = (value) => Math.round(value * 1e4) / 1e4;
2025
+ return {
2026
+ kind: "linearGradient",
2027
+ id,
2028
+ x1: round(0.5 - dx),
2029
+ y1: round(0.5 - dy),
2030
+ x2: round(0.5 + dx),
2031
+ y2: round(0.5 + dy),
2032
+ stops: spreadCoincidentStops(stops)
2033
+ };
2034
+ }
2035
+
2036
+ // chart/gradient-markup.ts
2037
+ function chartGradientMarkup(def) {
2038
+ if (def.kind === "rectPath")
2039
+ return `<pattern id="${escapeXmlAttr(def.id)}" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox" width="1" height="1"><image href="${escapeXmlAttr(def.href)}" width="1" height="1" preserveAspectRatio="none"/></pattern>`;
2040
+ const geometry = def.kind === "linearGradient" ? `x1="${def.x1}" y1="${def.y1}" x2="${def.x2}" y2="${def.y2}"` : `cx="${def.cx}" cy="${def.cy}" r="${def.r}"`;
2041
+ const stops = def.stops.map(
2042
+ (stop) => `<stop offset="${stop.offset}" stop-color="${escapeXmlAttr(stop.color)}" stop-opacity="${stop.opacity ?? 1}"/>`
2043
+ ).join("");
2044
+ const transform = def.kind === "radialGradient" && def.gradientTransform ? ` gradientTransform="${escapeXmlAttr(def.gradientTransform)}"` : "";
2045
+ return `<${def.kind} id="${escapeXmlAttr(def.id)}" ${geometry}${transform}>${stops}</${def.kind}>`;
2046
+ }
2047
+
2048
+ // chart/bar-cluster-geometry.ts
2049
+ var DEFAULT_BAR_GAP_WIDTH = 150;
2050
+ function clusteredBarGeometry(barGroupWidth, seriesCount, chartData) {
2051
+ const overlap = chartData.barOverlap ?? 0;
2052
+ const overlapSpan = 1 + (seriesCount - 1) * (1 - overlap / 100);
2053
+ const gapWidth = chartData.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH;
2054
+ const singleBarWidth = barGroupWidth / (overlapSpan + Math.max(gapWidth, 0) / 100);
2055
+ const step = singleBarWidth * (1 - overlap / 100);
2056
+ return { singleBarWidth, step, clusterWidth: singleBarWidth + step * (seriesCount - 1) };
2057
+ }
2058
+
2059
+ // chart/data-cache.ts
2060
+ function chartCacheValues(cache) {
2061
+ if (!cache) return [];
2062
+ const numeric = cache.type === "number";
2063
+ const out = [];
2064
+ for (const point of cache.points) {
2065
+ const text2 = point.value;
2066
+ out[point.index ?? out.length] = numeric && text2.trim() !== "" && Number.isFinite(Number(text2)) ? Number(text2) : text2;
2067
+ }
2068
+ const size = Math.max(cache.pointCount ?? 0, out.length);
2069
+ for (let index = 0; index < size; index++) if (out[index] === void 0) out[index] = "";
2070
+ return out;
2071
+ }
2072
+ var chartSourceValues = (source) => chartCacheValues(source?.cache ?? source?.levels?.[0]);
2073
+
2074
+ // chart/render/summary-from-space.ts
2075
+ var solidColor = (fill) => fill?.kind === "solid" ? fill.color : void 0;
2076
+ var isSolidFill = (fill) => fill?.kind === "solid" || fill?.kind === "unsupported" && fill.element === "solidFill";
2077
+ var GROUP_TYPES = {
2078
+ bar: "bar",
2079
+ line: "line",
2080
+ area: "area",
2081
+ pie: "pie",
2082
+ ofPie: "pie",
2083
+ doughnut: "doughnut",
2084
+ scatter: "scatter",
2085
+ radar: "radar",
2086
+ bubble: "bubble",
2087
+ stock: "stock",
2088
+ surface: "surface"
2089
+ };
2090
+ var GROUPINGS = /* @__PURE__ */ new Set(["clustered", "stacked", "percentStacked", "standard"]);
2091
+ function chartSummarySeries(source, chartType) {
2092
+ const categories = source.categories ?? source.xValues;
2093
+ const values = source.values ?? source.yValues;
2094
+ const out = {
2095
+ categories: chartSourceValues(categories),
2096
+ values: chartSourceValues(values).map(
2097
+ (v) => typeof v === "number" ? v : v === "" ? null : Number.isFinite(Number(v)) ? Number(v) : null
2098
+ )
2099
+ };
2100
+ if (source.tx?.text !== void 0) out.name = source.tx.text;
2101
+ const nameRef = source.tx?.reference?.formula;
2102
+ if (nameRef) out.nameRef = nameRef;
2103
+ if (categories?.formula) out.categoriesRef = categories.formula;
2104
+ if (values?.formula) out.valuesRef = values.formula;
2105
+ if (source.spPr?.effectsXml) out.effectsXml = source.spPr.effectsXml;
2106
+ const primary = ["line", "scatter", "radar"].includes(chartType) ? source.spPr?.line?.fill : source.spPr?.fill;
2107
+ const fill = chartType === "scatter" && !isSolidFill(primary) ? source.marker?.spPr?.fill : primary;
2108
+ const drawingColor = solidColor(fill);
2109
+ if (drawingColor) out.drawingColor = drawingColor;
2110
+ if (fill && fill.kind !== "solid" && !(chartType === "scatter" && fill.kind === "none"))
2111
+ out.fill = fill;
2112
+ const points = {};
2113
+ const pointFills = {};
2114
+ for (const point of source.dataPoints) {
2115
+ const properties2 = point.spPr ?? point.marker?.spPr;
2116
+ if (point.index === void 0) continue;
2117
+ const pointColor = solidColor(properties2?.fill);
2118
+ if (pointColor) points[point.index] = pointColor;
2119
+ if (properties2?.fill && properties2.fill.kind !== "solid")
2120
+ pointFills[point.index] = properties2.fill;
2121
+ }
2122
+ if (Object.keys(points).length) out.pointColors = points;
2123
+ if (Object.keys(pointFills).length) out.pointFills = pointFills;
2124
+ return out;
2125
+ }
2126
+ function chartSummaryFromSpace(chartSpace, extras = {}) {
2127
+ const group = chartSpace.plotArea.groups[0];
2128
+ let chartType = group ? GROUP_TYPES[group.kind] : "column";
2129
+ if (chartType === "bar" && group?.barDirection !== "bar") chartType = "column";
2130
+ const series = (group?.series ?? []).map((source) => chartSummarySeries(source, chartType));
2131
+ const summary = {
2132
+ chartType,
2133
+ series,
2134
+ showLegend: chartSpace.legend !== void 0
2135
+ };
2136
+ const grouping = group?.grouping;
2137
+ if (grouping && GROUPINGS.has(grouping))
2138
+ summary.grouping = grouping;
2139
+ if (chartType === "bar" || chartType === "column") {
2140
+ for (const [value, field, fallback, min, max] of [
2141
+ [group?.gapWidth, "barGapWidth", 150, 0, 500],
2142
+ [group?.overlap, "barOverlap", 0, -100, 100]
2143
+ ]) {
2144
+ const resolved = value ?? fallback;
2145
+ if (Number.isInteger(resolved) && resolved >= min && resolved <= max)
2146
+ summary[field] = resolved;
2147
+ }
2148
+ }
2149
+ if (chartSpace.title && chartSpace.autoTitleDeleted !== true) {
2150
+ const title = chartSpace.title.text;
2151
+ if (title !== void 0) summary.title = title;
2152
+ else if (series.length === 1 && series[0]?.name) summary.title = series[0].name;
2153
+ }
2154
+ const legendPos = chartSpace.legend?.position;
2155
+ if (legendPos && ["r", "l", "t", "b", "tr"].includes(legendPos))
2156
+ summary.legendPosition = legendPos;
2157
+ if (extras.formatting) summary.formatting = extras.formatting;
2158
+ if (extras.colorPalette !== void 0) summary.colorPalette = extras.colorPalette;
2159
+ if (extras.styleDefinition) summary.styleDefinition = extras.styleDefinition;
2160
+ return summary;
2161
+ }
2162
+
2163
+ // chart/render/chart-scale.ts
2164
+ var clean = (n2) => Number(n2.toPrecision(12));
2165
+ function* units(raw) {
2166
+ let exp = Math.floor(Math.log10(raw)) - 1;
2167
+ for (; ; ) {
2168
+ const base = 10 ** exp;
2169
+ for (const m of [1, 2, 5]) yield clean(m * base);
2170
+ exp++;
2171
+ }
2172
+ }
2173
+ function niceScale(dataMin, dataMax, options = {}) {
2174
+ const maxIntervals = Math.max(1, options.maxIntervals ?? 10);
2175
+ let lo = Number.isFinite(dataMin) ? dataMin : 0;
2176
+ let hi = Number.isFinite(dataMax) ? dataMax : 0;
2177
+ if (lo > hi) [lo, hi] = [hi, lo];
2178
+ if (lo === hi) {
2179
+ if (lo === 0) hi = 1;
2180
+ else if (options.noZero) {
2181
+ const pad = Math.abs(lo) * 0.1 || 1;
2182
+ lo -= pad;
2183
+ hi += pad;
2184
+ } else if (lo > 0) lo = 0;
2185
+ else hi = 0;
2186
+ }
2187
+ let fixedLo = false;
2188
+ let fixedHi = false;
2189
+ if (!options.noZero) {
2190
+ if (lo >= 0 && hi - lo >= hi / 6) {
2191
+ lo = 0;
2192
+ fixedLo = true;
2193
+ } else if (hi <= 0 && hi - lo >= -lo / 6) {
2194
+ hi = 0;
2195
+ fixedHi = true;
2196
+ }
2197
+ }
2198
+ const range = hi - lo;
2199
+ const top = fixedHi ? hi : hi + range * 0.05;
2200
+ const bottom = fixedLo ? lo : lo - range * 0.05;
2201
+ for (const unit of units(range / maxIntervals)) {
2202
+ const min = fixedLo ? lo : Math.floor(clean(bottom / unit)) * unit;
2203
+ const max = fixedHi ? hi : Math.ceil(clean(top / unit)) * unit;
2204
+ const intervals = Math.round((max - min) / unit);
2205
+ if (intervals <= maxIntervals && intervals > 0) {
2206
+ const ticks = [];
2207
+ for (let i = 0; i <= intervals; i++) ticks.push(clean(min + i * unit));
2208
+ return { min: clean(min), max: clean(max), majorUnit: unit, ticks };
2209
+ }
2210
+ }
2211
+ return { min: lo, max: hi, majorUnit: range, ticks: [lo, hi] };
2212
+ }
2213
+ var PERCENT_SCALE = {
2214
+ min: 0,
2215
+ max: 1,
2216
+ majorUnit: 0.1,
2217
+ ticks: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
2218
+ };
2219
+ function formatAxisValue(value, percent = false) {
2220
+ if (percent) return `${clean(value * 100)}%`;
2221
+ const v = clean(value);
2222
+ if (Math.abs(v) >= 1e15 || v !== 0 && Math.abs(v) < 1e-6)
2223
+ return v.toExponential(2).replace("e+", "E+").replace("e-", "E-");
2224
+ const [int = "0", frac] = String(Math.abs(v)).split(".");
2225
+ const grouped = int.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2226
+ return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
2227
+ }
2228
+
2229
+ // chart/render/chart-svg-util.ts
2230
+ var TEXT_COLOR = "#595959";
2231
+ var GRID_COLOR = "#D9D9D9";
2232
+ var AXIS_COLOR = "#BFBFBF";
2233
+ var FONT_SIZE = 10;
2234
+ function esc(text2) {
2235
+ return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2236
+ }
2237
+ var n = (value) => String(Math.round(value * 100) / 100);
2238
+ var textWidth = (text2, size = FONT_SIZE) => text2.length * size * 0.55;
2239
+ function text(x, y, content, attrs = {}) {
2240
+ const parts = [`x="${n(x)}"`, `y="${n(y)}"`];
2241
+ parts.push(`font-size="${attrs.size ?? FONT_SIZE}"`);
2242
+ parts.push(`fill="${esc(attrs.fill ?? TEXT_COLOR)}"`);
2243
+ if (attrs.anchor && attrs.anchor !== "start") parts.push(`text-anchor="${attrs.anchor}"`);
2244
+ if (attrs.weight) parts.push(`font-weight="${attrs.weight}"`);
2245
+ if (attrs.baseline) parts.push(`dominant-baseline="${attrs.baseline}"`);
2246
+ if (attrs.family) parts.push(`font-family="${esc(attrs.family)}"`);
2247
+ if (attrs.filter) parts.push(`filter="${esc(attrs.filter)}"`);
2248
+ if (attrs.italic !== void 0) parts.push(`font-style="${attrs.italic ? "italic" : "normal"}"`);
2249
+ if (attrs.underline !== void 0)
2250
+ parts.push(`text-decoration="${attrs.underline ? "underline" : "none"}"`);
2251
+ return `<text ${parts.join(" ")}>${esc(content)}</text>`;
2252
+ }
2253
+ var line = (x1, y1, x2, y2, stroke, width = 1) => `<line x1="${n(x1)}" y1="${n(y1)}" x2="${n(x2)}" y2="${n(y2)}" stroke="${stroke}" stroke-width="${width}"/>`;
2254
+ var rect = (x, y, w, h, fill, filter) => `<rect x="${n(x)}" y="${n(y)}" width="${n(Math.max(0, w))}" height="${n(Math.max(0, h))}" fill="${fill}"${filter ? ` filter="${esc(filter)}"` : ""}/>`;
2255
+ function fit(content, maxWidth, size = FONT_SIZE) {
2256
+ if (textWidth(content, size) <= maxWidth) return content;
2257
+ const chars = Math.max(1, Math.floor(maxWidth / (size * 0.55)) - 1);
2258
+ return `${content.slice(0, chars)}\u2026`;
2259
+ }
2260
+
2261
+ // chart/render/theme-palette.ts
2262
+ var THEME_SLOTS = [
2263
+ "lt1",
2264
+ "dk1",
2265
+ "lt2",
2266
+ "dk2",
2267
+ "accent1",
2268
+ "accent2",
2269
+ "accent3",
2270
+ "accent4",
2271
+ "accent5",
2272
+ "accent6",
2273
+ "hlink",
2274
+ "folHlink"
2275
+ ];
2276
+ var DEFAULT_THEME_COLORS = [
2277
+ "FFFFFF",
2278
+ "000000",
2279
+ "E7E6E6",
2280
+ "44546A",
2281
+ "4472C4",
2282
+ "ED7D31",
2283
+ "A5A5A5",
2284
+ "FFC000",
2285
+ "5B9BD5",
2286
+ "70AD47",
2287
+ "0563C1",
2288
+ "954F72"
2289
+ ];
2290
+ function themeColor(theme, index) {
2291
+ const hex = theme.colors[index] ?? DEFAULT_THEME_COLORS[index];
2292
+ return hex && parseArgbHex(hex) ? hex.replace(/^#/, "") : void 0;
2293
+ }
2294
+
2295
+ // chart/render/chart-colors.ts
2296
+ function chartColorScheme(theme) {
2297
+ const slots = Object.fromEntries(
2298
+ THEME_SLOTS.map((slot, index) => [slot, `#${themeColor(theme, index) ?? "000000"}`])
2299
+ );
2300
+ return {
2301
+ ...slots,
2302
+ bg1: slots.lt1,
2303
+ tx1: slots.dk1,
2304
+ bg2: slots.lt2,
2305
+ tx2: slots.dk2
2306
+ };
2307
+ }
2308
+ function autoSeriesColor(theme, index) {
2309
+ const i = Math.max(0, Math.floor(index));
2310
+ return chartPaletteSeriesColor(findChartColorPalette(10), i, i + 1, chartColorScheme(theme));
2311
+ }
2312
+
2313
+ // chart/render/chart-value-axis.ts
2314
+ function valueAxis(model) {
2315
+ const stackable = model.type === "bar" || model.type === "column" || model.type === "line" || model.type === "area";
2316
+ if (stackable && model.grouping === "percentStacked")
2317
+ return { ...PERCENT_SCALE, ticks: [...PERCENT_SCALE.ticks], percent: true };
2318
+ let min = Infinity;
2319
+ let max = -Infinity;
2320
+ if (stackable && model.grouping === "stacked") {
2321
+ for (let i = 0; i < model.categories.length; i++) {
2322
+ let pos = 0;
2323
+ let neg = 0;
2324
+ for (const s of model.series) {
2325
+ const v = s.values[i] ?? 0;
2326
+ if (v >= 0) pos += v;
2327
+ else neg += v;
2328
+ }
2329
+ min = Math.min(min, neg);
2330
+ max = Math.max(max, pos);
2331
+ }
2332
+ } else {
2333
+ for (const s of model.series)
2334
+ for (const v of s.values)
2335
+ if (v !== null) {
2336
+ min = Math.min(min, v);
2337
+ max = Math.max(max, v);
2338
+ }
2339
+ }
2340
+ if (min === Infinity) {
2341
+ min = 0;
2342
+ max = 1;
2343
+ }
2344
+ return { ...niceScale(min, max), percent: false };
2345
+ }
2346
+ function categoryTotals(model) {
2347
+ return model.categories.map(
2348
+ (_, i) => model.series.reduce((sum, s) => sum + Math.abs(s.values[i] ?? 0), 0)
2349
+ );
2350
+ }
2351
+
2352
+ // chart/text-inheritance.ts
2353
+ var TEXT_KEYS = [
2354
+ "fontSize",
2355
+ "bold",
2356
+ "italic",
2357
+ "underline",
2358
+ "typeface",
2359
+ "textColor",
2360
+ "fontRef"
2361
+ ];
2362
+ var TEXT_PARTS = [
2363
+ "title",
2364
+ "axisTitle",
2365
+ "categoryAxis",
2366
+ "valueAxis",
2367
+ "legend",
2368
+ "dataLabel"
2369
+ ];
2370
+ function inheritChartText(part, entry, builtIn, root) {
2371
+ if (!root || !TEXT_PARTS.includes(part)) return entry;
2372
+ const out = { ...entry };
2373
+ for (const key of TEXT_KEYS) {
2374
+ delete out[key];
2375
+ const value = root[key] ?? builtIn?.[key];
2376
+ if (value !== void 0) Object.assign(out, { [key]: value });
2377
+ }
2378
+ if (part === "title" && root.fontSize !== void 0) out.fontSize = root.fontSize * 1.2;
2379
+ if (root.textEffectsXml !== void 0) out.textEffectsXml = root.textEffectsXml;
2380
+ return out;
2381
+ }
2382
+
2383
+ // chart/render/chart-appearance.ts
2384
+ var chartPointsToPixels = (points) => points * EMU_PER_POINT / EMU_PER_PIXEL;
2385
+ function typeface(entry, theme) {
2386
+ const name = entry.typeface;
2387
+ if (name?.startsWith("+mj-")) return theme.majorFont;
2388
+ if (name?.startsWith("+mn-")) return theme.minorFont;
2389
+ return name ?? (entry.fontRef?.index === "major" ? theme.majorFont : entry.fontRef?.index === "minor" ? theme.minorFont : void 0);
2390
+ }
2391
+ function chartAppearance(chart, theme) {
2392
+ const defaults = builtInChartTextStyle(effectiveBuiltInChartStyle(chart.formatting));
2393
+ const entries = {};
2394
+ for (const part of CHART_STYLE_PARTS) {
2395
+ const base = chart.styleDefinition?.entries[part];
2396
+ const direct = chart.formatting?.entries[part];
2397
+ if (!defaults[part] && !base && !direct) continue;
2398
+ const entry = {
2399
+ ...inheritChartText(
2400
+ part,
2401
+ { ...defaults[part], ...base, sourceXml: base?.sourceXml ?? "" },
2402
+ defaults[part],
2403
+ chart.formatting?.textDefaults
2404
+ ),
2405
+ ...direct,
2406
+ sourceXml: direct?.sourceXml ?? base?.sourceXml ?? ""
2407
+ };
2408
+ if (base?.line || direct?.line) entry.line = { ...base?.line, ...direct?.line };
2409
+ entries[part] = entry;
2410
+ }
2411
+ const scheme = chartColorScheme(theme);
2412
+ const resolve = (color) => resolveDrawingColor(
2413
+ color,
2414
+ { scheme: (name) => scheme[name] },
2415
+ { hslRounding: "halfDown", transformOrder: "document" }
2416
+ );
2417
+ const out = resolveChartStyleDefinition(
2418
+ { entries},
2419
+ (color) => drawingColorCss(resolve(color))
2420
+ ) ?? {};
2421
+ for (const part of CHART_STYLE_PARTS) {
2422
+ const entry = entries[part];
2423
+ if (!entry) continue;
2424
+ const family = typeface(entry, theme);
2425
+ const shadow = resolveDrawingShadowXml(entry.textEffectsXml, {
2426
+ scheme: (name) => scheme[name]
2427
+ });
2428
+ if (shadow) (out[part] ??= {}).textShadow = shadow;
2429
+ if (family) (out[part] ??= {}).typeface = family;
2430
+ if (entry.axisVisible !== void 0) (out[part] ??= {}).axisVisible = entry.axisVisible;
2431
+ if (entry.labelsVisible !== void 0) (out[part] ??= {}).labelsVisible = entry.labelsVisible;
2432
+ if (entry.line?.widthEmu === 0) (out[part] ??= {}).lineWidth = 0;
2433
+ if (entry.fill?.kind === "gradient") {
2434
+ (out[part] ??= {}).gradient = resolveChartGradient(entry.fill, resolve);
2435
+ }
2436
+ }
2437
+ return out;
2438
+ }
2439
+
2440
+ // chart/render/chart-title-text.ts
2441
+ function properties(run) {
2442
+ return {
2443
+ ...run.sizePt === void 0 ? {} : { fontSize: run.sizePt },
2444
+ ...run.bold === void 0 ? {} : { bold: run.bold },
2445
+ ...run.italic === void 0 ? {} : { italic: run.italic },
2446
+ ...run.underline === void 0 ? {} : { underline: run.underline },
2447
+ ...run.typeface === void 0 ? {} : { typeface: run.typeface },
2448
+ ...run.color === void 0 ? {} : { textColor: run.color }
2449
+ };
2450
+ }
2451
+ function chartTitleText(chart, theme) {
2452
+ const formatting = chart.formatting;
2453
+ const entry = formatting?.entries.title;
2454
+ const body = entry?.textBody;
2455
+ if (!formatting || !body || body.text !== chart.title) return void 0;
2456
+ if (body.paragraphs.length === 1 && body.paragraphs[0].runs.length <= 1 && !body.text.includes("\n") && !body.paragraphs[0].lineSpacing && !body.paragraphs[0].spaceBefore && !body.paragraphs[0].spaceAfter)
2457
+ return void 0;
2458
+ return {
2459
+ paragraphs: body.paragraphs.map((paragraph) => ({
2460
+ ...paragraph.align ? { align: paragraph.align } : {},
2461
+ ...paragraph.lineSpacing ? { lineSpacing: paragraph.lineSpacing } : {},
2462
+ ...paragraph.spaceBefore ? { spaceBefore: paragraph.spaceBefore } : {},
2463
+ ...paragraph.spaceAfter ? { spaceAfter: paragraph.spaceAfter } : {},
2464
+ runs: paragraph.runs.map((run) => {
2465
+ const direct = {
2466
+ sourceXml: "",
2467
+ ...entry.textBodyStyle,
2468
+ ...properties(paragraph.defaultProperties ?? {}),
2469
+ ...properties(run)
2470
+ };
2471
+ const appearance = chartAppearance(
2472
+ {
2473
+ ...chart,
2474
+ formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
2475
+ },
2476
+ theme
2477
+ )?.title ?? {};
2478
+ return { text: run.text, appearance };
2479
+ })
2480
+ }))
2481
+ };
2482
+ }
2483
+
2484
+ // chart/render/chart-view.ts
2485
+ var isRefError = (value) => typeof value === "object" && value !== null && "error" in value;
2486
+ var SUPPORTED = /* @__PURE__ */ new Set([
2487
+ "bar",
2488
+ "column",
2489
+ "line",
2490
+ "area",
2491
+ "pie",
2492
+ "doughnut",
2493
+ "scatter",
2494
+ "radar"
2495
+ ]);
2496
+ function toText(value) {
2497
+ if (value === null) return "";
2498
+ if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
2499
+ if (isRefError(value)) return value.error;
2500
+ return String(value);
2501
+ }
2502
+ var toNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
2503
+ function resolveRef(ref, evaluateRef) {
2504
+ if (!ref) return void 0;
2505
+ try {
2506
+ const values = evaluateRef(ref);
2507
+ return values.length ? values : void 0;
2508
+ } catch {
2509
+ return void 0;
2510
+ }
2511
+ }
2512
+ function seriesName(series, index, evaluateRef) {
2513
+ const fromRef = resolveRef(series.nameRef, evaluateRef)?.map(toText).filter((t) => t !== "").join(" ");
2514
+ return fromRef || series.name || `Series${index + 1}`;
2515
+ }
2516
+ function chartSummaryView(chart, theme, options = {}) {
2517
+ const evaluateRef = options.evaluateRef ?? (() => []);
2518
+ const type = chart.chartType;
2519
+ const radial = type === "pie" || type === "doughnut";
2520
+ const palette = chart.colorPalette === void 0 ? void 0 : findChartColorPalette(chart.colorPalette);
2521
+ const scheme = chartColorScheme(theme);
2522
+ const drawingColor = (color) => color && drawingColorCss(
2523
+ resolveDrawingColor(
2524
+ color,
2525
+ {
2526
+ scheme: (name) => scheme[name]
2527
+ },
2528
+ { transformOrder: "document" }
2529
+ )
2530
+ );
2531
+ const gradient = (fill) => fill?.kind === "gradient" ? resolveChartGradient(
2532
+ fill,
2533
+ (color) => resolveDrawingColor(
2534
+ color,
2535
+ {
2536
+ scheme: (name) => scheme[name]
2537
+ },
2538
+ { transformOrder: "document" }
2539
+ )
2540
+ ) : void 0;
2541
+ const grouping = chart.grouping ?? (type === "bar" || type === "column" ? "clustered" : "standard");
2542
+ let categories = [];
2543
+ const rawCategories = [];
2544
+ const series = chart.series.map((s, i) => {
2545
+ const values = resolveRef(s.valuesRef, evaluateRef)?.map(toNumber) ?? s.values.map(toNumber);
2546
+ const cats = resolveRef(s.categoriesRef, evaluateRef) ?? s.categories;
2547
+ rawCategories.push(cats);
2548
+ const paletteColor = palette && chartPaletteSeriesColor(palette, i, chart.series.length, scheme);
2549
+ const color = s.fill?.kind === "none" ? "none" : drawingColor(s.fill?.kind === "solid" ? s.fill.color : s.drawingColor) ?? options.seriesColor?.(s, i) ?? paletteColor ?? autoSeriesColor(theme, i);
2550
+ const view = { name: seriesName(s, i, evaluateRef), values, color };
2551
+ const shadow = resolveDrawingShadowXml(s.effectsXml, {
2552
+ scheme: (name) => scheme[name]
2553
+ });
2554
+ if (shadow) view.shadow = shadow;
2555
+ const resolvedGradient = gradient(s.fill);
2556
+ if (resolvedGradient) view.gradient = resolvedGradient;
2557
+ const points = Object.fromEntries(
2558
+ Object.entries(s.pointFills ?? {}).flatMap(([key, fill]) => {
2559
+ const value = gradient(fill);
2560
+ return value ? [[key, value]] : [];
2561
+ })
2562
+ );
2563
+ if (Object.keys(points).length) view.pointGradients = points;
2564
+ return view;
2565
+ });
2566
+ const longest = Math.max(0, ...series.map((s) => s.values.length));
2567
+ const firstCats = rawCategories.find((c) => c.length > 0) ?? [];
2568
+ categories = Array.from(
2569
+ { length: Math.max(longest, firstCats.length) },
2570
+ (_, i) => firstCats[i] !== void 0 ? toText(firstCats[i] ?? null) : String(i + 1)
2571
+ );
2572
+ if (radial) {
2573
+ series.forEach((s, seriesIndex) => {
2574
+ s.pointColors = s.values.map((_, i) => {
2575
+ const explicit = drawingColor(chart.series[seriesIndex]?.pointColors?.[i]);
2576
+ return explicit ?? (palette ? chartPaletteSeriesColor(palette, i, s.values.length, scheme) : autoSeriesColor(theme, i));
2577
+ });
2578
+ });
2579
+ } else
2580
+ series.forEach((s, seriesIndex) => {
2581
+ const points = chart.series[seriesIndex]?.pointColors;
2582
+ if (points) s.pointColors = s.values.map((_, i) => drawingColor(points[i]) ?? s.color);
2583
+ });
2584
+ series.forEach((s, index) => {
2585
+ const source = chart.series[index];
2586
+ if (s.gradient && !radial && s.pointColors) {
2587
+ for (let i = 0; i < s.pointColors.length; i++)
2588
+ if (!source.pointColors?.[i]) delete s.pointColors[i];
2589
+ }
2590
+ for (const [key, fill] of Object.entries(source.pointFills ?? {})) {
2591
+ if (fill.kind === "none") (s.pointColors ??= [])[Number(key)] = "none";
2592
+ else if (fill.kind === "solid") {
2593
+ const paint = drawingColor(fill.color);
2594
+ if (paint) (s.pointColors ??= [])[Number(key)] = paint;
2595
+ }
2596
+ }
2597
+ });
2598
+ const model = {
2599
+ ...chart.barGapWidth === void 0 ? {} : { barGapWidth: chart.barGapWidth },
2600
+ ...chart.barOverlap === void 0 ? {} : { barOverlap: chart.barOverlap },
2601
+ type,
2602
+ grouping,
2603
+ showLegend: chart.showLegend,
2604
+ legendPosition: chart.legendPosition ?? "r",
2605
+ categories,
2606
+ series,
2607
+ horizontal: type === "bar",
2608
+ supported: SUPPORTED.has(type)
2609
+ };
2610
+ if (chart.title) model.title = chart.title;
2611
+ const titleFormatting = chart.formatting?.entries.title;
2612
+ if (titleFormatting?.layout) model.titleLayout = titleFormatting.layout;
2613
+ if (titleFormatting?.overlay !== void 0) model.titleOverlay = titleFormatting.overlay;
2614
+ const legendFormatting = chart.formatting?.entries.legend;
2615
+ if (legendFormatting?.layout) model.legendLayout = legendFormatting.layout;
2616
+ if (legendFormatting?.overlay !== void 0) model.legendOverlay = legendFormatting.overlay;
2617
+ const titleText = chartTitleText(chart, theme);
2618
+ if (titleText) model.titleText = titleText;
2619
+ const appearance = chartAppearance(chart, theme);
2620
+ if (appearance) model.appearance = appearance;
2621
+ if (type === "scatter") {
2622
+ series.forEach((s, i) => {
2623
+ const cats = rawCategories[i] ?? [];
2624
+ const numeric = cats.length > 0 && cats.every((c) => typeof c === "number");
2625
+ s.xValues = s.values.map((_, k) => numeric ? toNumber(cats[k] ?? null) : k + 1);
2626
+ });
2627
+ const xs = series.flatMap((s) => s.xValues ?? []).filter((x) => x !== null);
2628
+ model.xAxis = xs.length ? niceScale(Math.min(...xs), Math.max(...xs)) : niceScale(0, 1);
2629
+ }
2630
+ if (!radial) model.valueAxis = valueAxis(model);
2631
+ return model;
2632
+ }
2633
+
2634
+ // text/css-font-family.ts
2635
+ var FALLBACKS = {
2636
+ calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
2637
+ "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
2638
+ cambria: '"Cambria", "Caladea", Georgia, serif',
2639
+ arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
2640
+ "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
2641
+ "courier new": '"Courier New", "Liberation Mono", monospace',
2642
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
2643
+ };
2644
+ function cssFontFamily(name) {
2645
+ const known = FALLBACKS[name.toLowerCase()];
2646
+ if (known) return known;
2647
+ const quoted = `"${name.replace(/["\\]/g, "")}"`;
2648
+ return `${quoted}, "Calibri", "Carlito", "Segoe UI", sans-serif`;
2649
+ }
2650
+
2651
+ // chart/render/chart-svg-appearance.ts
2652
+ var nextPaintId = 0;
2653
+ function chartGradientPaint(model, width = 1024, height = 768) {
2654
+ const prefix = `xlsx-chart-${++nextPaintId}`;
2655
+ const appearance = { ...model.appearance };
2656
+ const defs = [];
2657
+ const shadowPaint = (shadow, suffix) => {
2658
+ const id = `${prefix}-${suffix}`;
2659
+ const pad = Math.max(4, shadow.blur * 3 + Math.abs(shadow.dx) + Math.abs(shadow.dy));
2660
+ defs.push(
2661
+ `<filter id="${id}" filterUnits="userSpaceOnUse" x="${n(-pad)}" y="${n(-pad)}" width="${n(width + pad * 2)}" height="${n(height + pad * 2)}" color-interpolation-filters="sRGB">${svgDropShadowElement(shadow, { number: n, color: (value) => esc(value) })}</filter>`
2662
+ );
2663
+ return `url(#${id})`;
2664
+ };
2665
+ for (const [part, entry] of Object.entries(appearance)) {
2666
+ if (entry?.textShadow)
2667
+ appearance[part] = {
2668
+ ...entry,
2669
+ textShadowFilter: shadowPaint(entry.textShadow, `${part}-text-shadow`)
2670
+ };
2671
+ }
2672
+ const paint = (gradient, suffix, bounds) => {
2673
+ const def = buildChartGradientDef(`${prefix}-${suffix}`, gradient, bounds);
2674
+ defs.push(chartGradientMarkup(def));
2675
+ return `url(#${def.id})`;
2676
+ };
2677
+ for (const part of ["chartArea", "plotArea"]) {
2678
+ const entry = appearance[part];
2679
+ if (!entry?.gradient) continue;
2680
+ if (part === "plotArea" && ["circle", "shape"].includes(entry.gradient.path ?? "")) continue;
2681
+ appearance[part] = {
2682
+ ...entry,
2683
+ fillColor: paint(entry.gradient, part, { width, height, shape: "rect" })
2684
+ };
2685
+ }
2686
+ const series = model.series.map((source, index) => {
2687
+ const view = { ...source };
2688
+ if (source.shadow) view.shadowFilter = shadowPaint(source.shadow, `s${index}-shadow`);
2689
+ const bounds = model.type === "bar" || model.type === "column" ? { width: 1, height: 1, shape: "rect" } : void 0;
2690
+ if (source.gradient) view.color = paint(source.gradient, `s${index}`, bounds);
2691
+ if (source.pointGradients) {
2692
+ view.pointColors = [...source.pointColors ?? []];
2693
+ for (const [key, gradient] of Object.entries(source.pointGradients))
2694
+ view.pointColors[Number(key)] = paint(gradient, `s${index}-p${key}`, bounds);
2695
+ }
2696
+ return view;
2697
+ });
2698
+ return defs.length ? { model: { ...model, appearance, series }, defs: `<defs>${defs.join("")}</defs>` } : { model, defs: "" };
2699
+ }
2700
+ function chartTextAttributes(model, part, fallbackSize = FONT_SIZE) {
2701
+ const entry = model.appearance?.[part];
2702
+ return {
2703
+ size: entry?.fontSize === void 0 ? fallbackSize : chartPointsToPixels(entry.fontSize),
2704
+ ...entry?.color === void 0 ? {} : { fill: entry.color },
2705
+ ...entry?.bold === void 0 ? {} : { weight: entry.bold ? "bold" : "normal" },
2706
+ ...entry?.italic === void 0 ? {} : { italic: entry.italic },
2707
+ ...entry?.underline === void 0 ? {} : { underline: entry.underline },
2708
+ ...entry?.typeface === void 0 ? {} : { family: cssFontFamily(entry.typeface) },
2709
+ ...entry?.textShadowFilter === void 0 ? {} : { filter: entry.textShadowFilter }
2710
+ };
2711
+ }
2712
+ function chartStroke(model, part) {
2713
+ const entry = model.appearance?.[part];
2714
+ return {
2715
+ color: entry?.axisVisible === false ? "none" : entry?.lineColor ?? (part === "gridlineMajor" ? GRID_COLOR : AXIS_COLOR),
2716
+ width: entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth)
2717
+ };
2718
+ }
2719
+ function chartAreaRect(model, part, area) {
2720
+ if (area.w <= 0 || area.h <= 0) return "";
2721
+ const entry = model.appearance?.[part];
2722
+ let fill = entry?.fillColor ?? (part === "chartArea" ? "#FFFFFF" : "none");
2723
+ let defs = "";
2724
+ if (part !== "chartArea" && entry?.gradient && (part !== "plotArea" || ["circle", "shape"].includes(entry.gradient.path ?? ""))) {
2725
+ const def = buildChartGradientDef(`xlsx-chart-${++nextPaintId}-${part}`, entry.gradient, {
2726
+ width: area.w,
2727
+ height: area.h,
2728
+ shape: "rect"
2729
+ });
2730
+ defs = `<defs>${chartGradientMarkup(def)}</defs>`;
2731
+ fill = `url(#${def.id})`;
2732
+ }
2733
+ const stroke = entry?.lineColor ?? "none";
2734
+ if (fill === "none" && stroke === "none") return "";
2735
+ const width = entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth);
2736
+ return `${defs}<rect x="${n(area.x)}" y="${n(area.y)}" width="${n(area.w)}" height="${n(area.h)}" fill="${esc(fill)}" stroke="${esc(stroke)}" stroke-width="${n(width)}" data-chart-part="${part}"/>`;
2737
+ }
2738
+
2739
+ // chart/render/chart-spacing.ts
2740
+ function chartBarSpacing(chart) {
2741
+ const stacked = chart.grouping === "stacked" || chart.grouping === "percentStacked";
2742
+ return {
2743
+ barGapWidth: chart.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH,
2744
+ barOverlap: chart.barOverlap ?? (stacked ? 100 : 0)
2745
+ };
2746
+ }
2747
+
2748
+ // chart/render/chart-svg-bars.ts
2749
+ function bars(model, frame, out, values) {
2750
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
2751
+ const count = Math.max(1, model.series.length);
2752
+ const geometry = clusteredBarGeometry(frame.bandSize, count, chartBarSpacing(model));
2753
+ const barSize = geometry.singleBarWidth;
2754
+ const base = frame.value(0);
2755
+ const pos = new Array(model.categories.length).fill(0);
2756
+ const neg = new Array(model.categories.length).fill(0);
2757
+ model.series.forEach((s, si) => {
2758
+ values[si]?.forEach((v, i) => {
2759
+ if (v === null || i >= model.categories.length) return;
2760
+ let from = 0;
2761
+ let to = v;
2762
+ if (stacked) {
2763
+ const acc = v >= 0 ? pos : neg;
2764
+ from = acc[i] ?? 0;
2765
+ to = from + v;
2766
+ acc[i] = to;
2767
+ }
2768
+ const a = stacked ? frame.value(from) : base;
2769
+ const b = frame.value(to);
2770
+ const offset = model.horizontal ? geometry.clusterWidth / 2 - barSize - si * geometry.step : -geometry.clusterWidth / 2 + si * geometry.step;
2771
+ const center = frame.band(i);
2772
+ const width = model.horizontal ? Math.abs(b - a) : barSize;
2773
+ const height = model.horizontal ? barSize : Math.abs(b - a);
2774
+ let color = s.pointColors?.[i] ?? s.color;
2775
+ const gradient = s.pointGradients?.[i] ?? (s.pointColors?.[i] === void 0 ? s.gradient : void 0);
2776
+ if (gradient && (gradient.path === "circle" || gradient.path === "shape")) {
2777
+ const baseId = color.match(/^url\(#(.+)\)$/)?.[1];
2778
+ if (baseId) {
2779
+ const id = baseId.replace(/(-s\d+(?:-p\d+)?)$/, `-mark${i}$1`);
2780
+ const def = buildChartGradientDef(id, gradient, {
2781
+ width: Number(n(width)),
2782
+ height: Number(n(height)),
2783
+ shape: "rect"
2784
+ });
2785
+ out.push(`<defs>${chartGradientMarkup(def)}</defs>`);
2786
+ color = `url(#${id})`;
2787
+ }
2788
+ }
2789
+ out.push(`<g data-chart-series="${si}" data-chart-point="${i}">`);
2790
+ if (model.horizontal)
2791
+ out.push(
2792
+ rect(Math.min(a, b), center + offset, Math.abs(b - a), barSize, color, s.shadowFilter)
2793
+ );
2794
+ else
2795
+ out.push(
2796
+ rect(center + offset, Math.min(a, b), barSize, Math.abs(b - a), color, s.shadowFilter)
2797
+ );
2798
+ out.push("</g>");
2799
+ });
2800
+ });
2801
+ }
2802
+
2803
+ // chart/render/chart-svg-cartesian.ts
2804
+ function axes(model, area, out) {
2805
+ const scale = model.valueAxis;
2806
+ if (!scale) return void 0;
2807
+ const labels = scale.ticks.map((t) => formatAxisValue(t, scale.percent));
2808
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
2809
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
2810
+ const valueSize = valueAttrs.size ?? 10;
2811
+ const categorySize = categoryAttrs.size ?? 10;
2812
+ const grid = chartStroke(model, "gridlineMajor");
2813
+ const axis = chartStroke(model, "categoryAxis");
2814
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
2815
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
2816
+ const labelW = valueLabels ? Math.max(...labels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
2817
+ const horizontal = model.horizontal;
2818
+ const cats = Math.max(1, model.categories.length);
2819
+ const catW = Math.min(
2820
+ area.w * 0.3,
2821
+ Math.max(...model.categories.map((c) => textWidth(c, categorySize)), 8) + 6
2822
+ );
2823
+ const plot = horizontal ? {
2824
+ x: area.x + catW,
2825
+ y: area.y,
2826
+ w: Math.max(1, area.w - catW - 4),
2827
+ h: Math.max(1, area.h - Math.max(16, valueSize * 1.5))
2828
+ } : {
2829
+ x: area.x + labelW,
2830
+ y: area.y + 4,
2831
+ w: Math.max(1, area.w - labelW - 4),
2832
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
2833
+ };
2834
+ const span = scale.max - scale.min || 1;
2835
+ const value = horizontal ? (v) => plot.x + (v - scale.min) / span * plot.w : (v) => plot.y + plot.h - (v - scale.min) / span * plot.h;
2836
+ const bandSize = (horizontal ? plot.h : plot.w) / cats;
2837
+ const band = horizontal ? (i) => plot.y + plot.h - bandSize * (i + 0.5) : (i) => plot.x + bandSize * (i + 0.5);
2838
+ out.push(chartAreaRect(model, "plotArea", plot));
2839
+ scale.ticks.forEach((t, i) => {
2840
+ const p = value(t);
2841
+ const label = labels[i] ?? "";
2842
+ if (horizontal) {
2843
+ out.push(line(p, plot.y, p, plot.y + plot.h, grid.color, grid.width));
2844
+ if (valueLabels)
2845
+ out.push(
2846
+ text(p, plot.y + plot.h + valueSize + 2, label, { anchor: "middle", ...valueAttrs })
2847
+ );
2848
+ } else {
2849
+ out.push(line(plot.x, p, plot.x + plot.w, p, grid.color, grid.width));
2850
+ if (valueLabels)
2851
+ out.push(text(plot.x - 4, p + valueSize * 0.3, label, { anchor: "end", ...valueAttrs }));
2852
+ }
2853
+ });
2854
+ const zero = value(Math.min(Math.max(0, scale.min), scale.max));
2855
+ if (horizontal) out.push(line(zero, plot.y, zero, plot.y + plot.h, axis.color, axis.width));
2856
+ else out.push(line(plot.x, zero, plot.x + plot.w, zero, axis.color, axis.width));
2857
+ const step = Math.max(
2858
+ 1,
2859
+ Math.ceil(cats / Math.max(1, Math.floor((horizontal ? plot.h : plot.w) / 14)))
2860
+ );
2861
+ model.categories.forEach((c, i) => {
2862
+ if (!categoryLabels || i % step !== 0) return;
2863
+ const p = band(i);
2864
+ if (horizontal)
2865
+ out.push(
2866
+ text(plot.x - 4, p + categorySize * 0.3, fit(c, catW - 6, categorySize), {
2867
+ anchor: "end",
2868
+ ...categoryAttrs
2869
+ })
2870
+ );
2871
+ else
2872
+ out.push(
2873
+ text(p, plot.y + plot.h + categorySize + 3, fit(c, bandSize * step, categorySize), {
2874
+ anchor: "middle",
2875
+ ...categoryAttrs
2876
+ })
2877
+ );
2878
+ });
2879
+ return { plot, value, band, bandSize };
2880
+ }
2881
+ function plotted(model) {
2882
+ if (model.grouping !== "percentStacked") return model.series.map((s) => s.values);
2883
+ const totals = categoryTotals(model);
2884
+ return model.series.map(
2885
+ (s) => s.values.map((v, i) => v === null ? null : v / (totals[i] || 1))
2886
+ );
2887
+ }
2888
+ function linesAndAreas(model, frame, out) {
2889
+ const values = plotted(model);
2890
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
2891
+ const acc = new Array(model.categories.length).fill(0);
2892
+ const area = model.type === "area";
2893
+ const layers = [];
2894
+ model.series.forEach((s, si) => {
2895
+ const points = [];
2896
+ const lower = [];
2897
+ model.categories.forEach((_, i) => {
2898
+ const v = values[si]?.[i] ?? null;
2899
+ if (v === null && !area) {
2900
+ points.push([NaN, NaN]);
2901
+ return;
2902
+ }
2903
+ const below = stacked ? acc[i] ?? 0 : 0;
2904
+ const top = below + (v ?? 0);
2905
+ if (stacked) acc[i] = top;
2906
+ points.push([frame.band(i), frame.value(top)]);
2907
+ lower.push([frame.band(i), frame.value(below)]);
2908
+ });
2909
+ layers.push({
2910
+ points,
2911
+ lower,
2912
+ color: s.color,
2913
+ filter: s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""
2914
+ });
2915
+ });
2916
+ for (const { points, lower, color, filter } of area ? [...layers].reverse() : layers) {
2917
+ if (area) {
2918
+ const poly = [...points, ...[...lower].reverse()].map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
2919
+ out.push(`<polygon points="${poly}" fill="${color}" fill-opacity="0.85"${filter}/>`);
2920
+ continue;
2921
+ }
2922
+ let segment = [];
2923
+ const flush = () => {
2924
+ if (segment.length > 1)
2925
+ out.push(
2926
+ `<polyline points="${segment.join(" ")}" fill="none" stroke="${color}" stroke-width="2.25" stroke-linejoin="round"${filter}/>`
2927
+ );
2928
+ segment = [];
2929
+ };
2930
+ for (const [x, y] of points) {
2931
+ if (Number.isNaN(x)) flush();
2932
+ else segment.push(`${n(x)},${n(y)}`);
2933
+ }
2934
+ flush();
2935
+ for (const [x, y] of points)
2936
+ if (!Number.isNaN(x))
2937
+ out.push(`<circle cx="${n(x)}" cy="${n(y)}" r="2.5" fill="${color}"${filter}/>`);
2938
+ }
2939
+ }
2940
+ function scatter(model, area, out) {
2941
+ const ys = model.valueAxis;
2942
+ const xs = model.xAxis;
2943
+ if (!ys || !xs) return;
2944
+ const yLabels = ys.ticks.map((t) => formatAxisValue(t));
2945
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
2946
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
2947
+ const valueSize = valueAttrs.size ?? 10;
2948
+ const categorySize = categoryAttrs.size ?? 10;
2949
+ const grid = chartStroke(model, "gridlineMajor");
2950
+ const xAxis = chartStroke(model, "categoryAxis");
2951
+ const yAxis = chartStroke(model, "valueAxis");
2952
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
2953
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
2954
+ const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
2955
+ const plot = {
2956
+ x: area.x + labelW,
2957
+ y: area.y + 4,
2958
+ w: Math.max(1, area.w - labelW - 8),
2959
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
2960
+ };
2961
+ const px = (v, s) => plot.x + (v - s.min) / (s.max - s.min || 1) * plot.w;
2962
+ const py = (v, s) => plot.y + plot.h - (v - s.min) / (s.max - s.min || 1) * plot.h;
2963
+ out.push(chartAreaRect(model, "plotArea", plot));
2964
+ ys.ticks.forEach((t, i) => {
2965
+ out.push(line(plot.x, py(t, ys), plot.x + plot.w, py(t, ys), grid.color, grid.width));
2966
+ if (valueLabels)
2967
+ out.push(
2968
+ text(plot.x - 4, py(t, ys) + valueSize * 0.3, yLabels[i] ?? "", {
2969
+ anchor: "end",
2970
+ ...valueAttrs
2971
+ })
2972
+ );
2973
+ });
2974
+ for (const t of xs.ticks) {
2975
+ out.push(
2976
+ line(px(t, xs), plot.y + plot.h, px(t, xs), plot.y + plot.h + 3, xAxis.color, xAxis.width)
2977
+ );
2978
+ if (categoryLabels)
2979
+ out.push(
2980
+ text(px(t, xs), plot.y + plot.h + categorySize + 3, formatAxisValue(t), {
2981
+ anchor: "middle",
2982
+ ...categoryAttrs
2983
+ })
2984
+ );
2985
+ }
2986
+ out.push(
2987
+ line(plot.x, plot.y + plot.h, plot.x + plot.w, plot.y + plot.h, xAxis.color, xAxis.width)
2988
+ );
2989
+ out.push(line(plot.x, plot.y, plot.x, plot.y + plot.h, yAxis.color, yAxis.width));
2990
+ for (const s of model.series)
2991
+ s.values.forEach((v, i) => {
2992
+ const x = s.xValues?.[i] ?? null;
2993
+ if (v === null || x === null) return;
2994
+ out.push(
2995
+ `<circle cx="${n(px(x, xs))}" cy="${n(py(v, ys))}" r="3" fill="${s.pointColors?.[i] ?? s.color}"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
2996
+ );
2997
+ });
2998
+ }
2999
+ function cartesianSvg(model, area) {
3000
+ const out = [];
3001
+ if (model.type === "scatter") {
3002
+ scatter(model, area, out);
3003
+ return out.join("");
3004
+ }
3005
+ const frame = axes(model, area, out);
3006
+ if (!frame) return "";
3007
+ if (model.type === "bar" || model.type === "column") bars(model, frame, out, plotted(model));
3008
+ else linesAndAreas(model, frame, out);
3009
+ return out.join("");
3010
+ }
3011
+
3012
+ // chart/render/chart-svg-radial.ts
3013
+ var polar = (cx, cy, r, angle) => [
3014
+ cx + r * Math.sin(angle),
3015
+ cy - r * Math.cos(angle)
3016
+ ];
3017
+ function slicePath(cx, cy, r, inner, a0, a1) {
3018
+ const sweep = a1 - a0;
3019
+ if (sweep >= Math.PI * 2 - 1e-9) {
3020
+ const mid = a0 + Math.PI;
3021
+ return slicePath(cx, cy, r, inner, a0, mid) + slicePath(cx, cy, r, inner, mid, a1);
3022
+ }
3023
+ const large = sweep > Math.PI ? 1 : 0;
3024
+ const [x0, y0] = polar(cx, cy, r, a0);
3025
+ const [x1, y1] = polar(cx, cy, r, a1);
3026
+ if (inner <= 0)
3027
+ return `M${n(cx)},${n(cy)} L${n(x0)},${n(y0)} A${n(r)},${n(r)} 0 ${large} 1 ${n(x1)},${n(y1)} Z`;
3028
+ const [ix1, iy1] = polar(cx, cy, inner, a1);
3029
+ const [ix0, iy0] = polar(cx, cy, inner, a0);
3030
+ return `M${n(x0)},${n(y0)} A${n(r)},${n(r)} 0 ${large} 1 ${n(x1)},${n(y1)} L${n(ix1)},${n(iy1)} A${n(inner)},${n(inner)} 0 ${large} 0 ${n(ix0)},${n(iy0)} Z`;
3031
+ }
3032
+ function pieSvg(model, area) {
3033
+ const out = [chartAreaRect(model, "plotArea", area)];
3034
+ const cx = area.x + area.w / 2;
3035
+ const cy = area.y + area.h / 2;
3036
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - 4);
3037
+ const rings = model.type === "doughnut" ? model.series : model.series.slice(0, 1);
3038
+ const hole = model.type === "doughnut" ? radius * 0.5 : 0;
3039
+ const ringSize = (radius - hole) / Math.max(1, rings.length);
3040
+ rings.forEach((s, ri) => {
3041
+ const outer = radius - ri * ringSize;
3042
+ const inner = model.type === "doughnut" ? outer - ringSize : 0;
3043
+ const total = s.values.reduce((sum, v) => sum + (v !== null && v > 0 ? v : 0), 0);
3044
+ if (total <= 0) return;
3045
+ let angle = 0;
3046
+ s.values.forEach((v, i) => {
3047
+ if (v === null || v <= 0) return;
3048
+ const sweep = v / total * Math.PI * 2;
3049
+ const color = s.pointColors?.[i] ?? s.color;
3050
+ out.push(
3051
+ `<path d="${slicePath(cx, cy, outer, inner, angle, angle + sweep)}" fill="${color}" stroke="#FFFFFF" stroke-width="1"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
3052
+ );
3053
+ angle += sweep;
3054
+ });
3055
+ });
3056
+ return out.join("");
3057
+ }
3058
+ function radarSvg(model, area) {
3059
+ const out = [chartAreaRect(model, "plotArea", area)];
3060
+ const scale = model.valueAxis;
3061
+ const count = model.categories.length;
3062
+ if (!scale || count < 1) return "";
3063
+ const valueAttrs = chartTextAttributes(model, "valueAxis", 9);
3064
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
3065
+ const valueSize = valueAttrs.size ?? 9;
3066
+ const categorySize = categoryAttrs.size ?? 10;
3067
+ const grid = chartStroke(model, "gridlineMajor");
3068
+ const axis = chartStroke(model, "categoryAxis");
3069
+ const cx = area.x + area.w / 2;
3070
+ const cy = area.y + area.h / 2 + 4;
3071
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - Math.max(18, categorySize * 1.8));
3072
+ const angle = (i) => i / count * Math.PI * 2;
3073
+ const r = (v) => (v - scale.min) / (scale.max - scale.min || 1) * radius;
3074
+ const labelEvery = Math.max(
3075
+ 1,
3076
+ Math.ceil(12 / Math.max(1, radius / Math.max(1, scale.ticks.length - 1)))
3077
+ );
3078
+ for (const [k, t] of scale.ticks.entries()) {
3079
+ const ring = Array.from({ length: count }, (_, i) => polar(cx, cy, r(t), angle(i))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
3080
+ out.push(
3081
+ `<polygon points="${ring}" fill="none" stroke="${grid.color}" stroke-width="${n(grid.width)}"/>`
3082
+ );
3083
+ if (model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
3084
+ out.push(
3085
+ text(cx + 3, cy - r(t) + valueSize * 0.3, formatAxisValue(t, scale.percent), valueAttrs)
3086
+ );
3087
+ }
3088
+ model.categories.forEach((c, i) => {
3089
+ const [x, y] = polar(cx, cy, radius, angle(i));
3090
+ out.push(line(cx, cy, x, y, axis.color, axis.width));
3091
+ const [lx, ly] = polar(cx, cy, radius + 10, angle(i));
3092
+ const anchor = Math.abs(lx - cx) < 2 ? "middle" : lx > cx ? "start" : "end";
3093
+ if (model.appearance?.categoryAxis?.labelsVisible !== false)
3094
+ out.push(
3095
+ text(lx, ly + categorySize * 0.3, fit(c, area.w / 4, categorySize), {
3096
+ anchor,
3097
+ ...categoryAttrs
3098
+ })
3099
+ );
3100
+ });
3101
+ for (const s of model.series) {
3102
+ const points = s.values.slice(0, count).map((v, i) => polar(cx, cy, r(v ?? scale.min), angle(i))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
3103
+ out.push(
3104
+ `<polygon points="${points}" fill="none" stroke="${s.color}" stroke-width="2"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
3105
+ );
3106
+ }
3107
+ return out.join("");
3108
+ }
3109
+
3110
+ // chart/render/chart-svg-text-metrics.ts
3111
+ var CHART_FONT_FAMILY = "Calibri, Carlito, Arial, sans-serif";
3112
+ function cssFont(attrs) {
3113
+ return `${attrs.italic ? "italic" : "normal"} ${attrs.weight ?? "normal"} ${attrs.size ?? 10}px ${attrs.family ?? CHART_FONT_FAMILY}`;
3114
+ }
3115
+ function chartFontMetrics(attrs, options) {
3116
+ const metrics = options.measureFont?.(cssFont(attrs));
3117
+ return metrics && Number.isFinite(metrics.ascent) && Number.isFinite(metrics.descent) && metrics.ascent >= 0 && metrics.descent >= 0 && metrics.ascent + metrics.descent > 0 ? metrics : void 0;
3118
+ }
3119
+ function chartTextWidth(content, attrs, options) {
3120
+ const width = options.measureText?.(content, cssFont(attrs));
3121
+ return width !== void 0 && Number.isFinite(width) && width >= 0 ? width : textWidth(content, attrs.size);
3122
+ }
3123
+ function fitChartText(content, maxWidth, attrs, options) {
3124
+ if (!options.measureText) return fit(content, maxWidth, attrs.size);
3125
+ if (chartTextWidth(content, attrs, options) <= maxWidth) return content;
3126
+ const points = [...content];
3127
+ let low = 0;
3128
+ let high = points.length;
3129
+ while (low < high) {
3130
+ const mid = Math.ceil((low + high) / 2);
3131
+ if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs, options) <= maxWidth) low = mid;
3132
+ else high = mid - 1;
3133
+ }
3134
+ return `${points.slice(0, low).join("")}\u2026`;
3135
+ }
3136
+
3137
+ // chart/render/chart-svg-legend.ts
3138
+ function chartLegendSvg(model, area, frame, options) {
3139
+ const automatic = [];
3140
+ const bounds = {};
3141
+ const reserved = automaticLegend(model, area, automatic, options, bounds);
3142
+ const plot = model.legendOverlay ? area : reserved;
3143
+ const box = bounds.box;
3144
+ if (!box) return { plot, markup: "", foreground: false };
3145
+ const manual = resolveManualLayoutRect(model.legendLayout, frame, {
3146
+ x: box.x,
3147
+ y: box.y,
3148
+ width: box.w,
3149
+ height: box.h
3150
+ });
3151
+ if (!manual) return { plot, markup: automatic.join(""), foreground: !!model.legendOverlay };
3152
+ const entries = legendEntries(model);
3153
+ const attrs = chartTextAttributes(model, "legend");
3154
+ const size = attrs.size ?? 10;
3155
+ const font = chartFontMetrics(attrs, options);
3156
+ const keySize = size / 2;
3157
+ const keyGap = size / 4;
3158
+ const widths = entries.map(
3159
+ (entry) => chartTextWidth(entry.label, attrs, options) + keySize + keyGap
3160
+ );
3161
+ const horizontal = manual.width > manual.height && widths.reduce((sum, width) => sum + width, 0) + size <= manual.width;
3162
+ const rowWidth = horizontal ? manual.width / entries.length : manual.width;
3163
+ const rowHeight = horizontal ? manual.height : manual.height / entries.length;
3164
+ const horizontalGap = Math.max(
3165
+ 0,
3166
+ (manual.width - widths.reduce((sum, width) => sum + width, 0)) / (entries.length + 1)
3167
+ );
3168
+ let horizontalX = manual.x + horizontalGap;
3169
+ const markup = [
3170
+ chartAreaRect(model, "legend", { x: manual.x, y: manual.y, w: manual.width, h: manual.height })
3171
+ ];
3172
+ const baselineOffset = font ? (font.ascent - font.descent) / 2 : size * 0.35;
3173
+ entries.forEach((entry, i) => {
3174
+ const available = horizontal ? chartTextWidth(entry.label, attrs, options) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
3175
+ const label = fitChartText(entry.label, available, attrs, options);
3176
+ const contentWidth = Math.min(
3177
+ horizontal ? widths[i] ?? 0 : Math.max(...widths),
3178
+ rowWidth - size / 2
3179
+ );
3180
+ const x = horizontal ? horizontalX : manual.x + Math.max(size / 4, (rowWidth - contentWidth) / 2);
3181
+ const centerY = manual.y + (horizontal ? 0 : i * rowHeight) + rowHeight / 2;
3182
+ markup.push(rect(x, centerY - keySize / 2, keySize, keySize, entry.color));
3183
+ markup.push(text(x + keySize + keyGap, centerY + baselineOffset, label, attrs));
3184
+ if (horizontal) horizontalX += (widths[i] ?? 0) + horizontalGap;
3185
+ });
3186
+ return {
3187
+ plot,
3188
+ markup: `<g data-chart-legend-layout="true">${markup.join("")}</g>`,
3189
+ foreground: true
3190
+ };
3191
+ }
3192
+ function legendEntries(model) {
3193
+ if (model.type === "pie" || model.type === "doughnut") {
3194
+ const first3 = model.series[0];
3195
+ return model.categories.map((label, i) => ({
3196
+ label,
3197
+ color: first3?.pointColors?.[i] ?? first3?.color ?? "#4472C4"
3198
+ }));
3199
+ }
3200
+ return model.series.map((s) => ({ label: s.name, color: s.color }));
3201
+ }
3202
+ function automaticLegend(model, area, out, options, bounds) {
3203
+ const entries = legendEntries(model);
3204
+ if (!model.showLegend || entries.length === 0) return area;
3205
+ const pos = model.legendPosition;
3206
+ const attrs = chartTextAttributes(model, "legend");
3207
+ const size = attrs.size ?? 10;
3208
+ const rowH = Math.max(16, size * 1.4);
3209
+ if (pos === "t" || pos === "b") {
3210
+ const widths = entries.map(
3211
+ (e) => Math.min(chartTextWidth(e.label, attrs, options) + 20, area.w / 2)
3212
+ );
3213
+ const total = widths.reduce((a, b) => a + b, 0);
3214
+ let x2 = area.x + Math.max(0, (area.w - total) / 2);
3215
+ const y = pos === "t" ? area.y + 4 : area.y + area.h - rowH + 4;
3216
+ bounds.box = { x: x2 - 4, y: y - 4, w: Math.min(total, area.w) + 8, h: rowH + 4 };
3217
+ out.push(
3218
+ chartAreaRect(model, "legend", {
3219
+ x: x2 - 4,
3220
+ y: y - 4,
3221
+ w: Math.min(total, area.w) + 8,
3222
+ h: rowH + 4
3223
+ })
3224
+ );
3225
+ entries.forEach((e, i) => {
3226
+ const w = widths[i] ?? 0;
3227
+ out.push(rect(x2, y, 8, 8, e.color));
3228
+ out.push(text(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs, options), attrs));
3229
+ x2 += w;
3230
+ });
3231
+ return pos === "t" ? { x: area.x, y: area.y + rowH + 4, w: area.w, h: area.h - rowH - 4 } : { x: area.x, y: area.y, w: area.w, h: area.h - rowH - 4 };
3232
+ }
3233
+ const width = Math.min(
3234
+ area.w * 0.35,
3235
+ Math.max(...entries.map((e) => chartTextWidth(e.label, attrs, options))) + 22
3236
+ );
3237
+ const height = entries.length * rowH;
3238
+ const x = pos === "l" ? area.x + 4 : area.x + area.w - width;
3239
+ const y0 = pos === "tr" ? area.y + 4 : area.y + Math.max(0, (area.h - height) / 2);
3240
+ bounds.box = { x: x - 4, y: y0, w: width + 4, h: Math.min(height, area.y + area.h - y0) };
3241
+ out.push(
3242
+ chartAreaRect(model, "legend", {
3243
+ x: x - 4,
3244
+ y: y0,
3245
+ w: width + 4,
3246
+ h: Math.min(height, area.y + area.h - y0)
3247
+ })
3248
+ );
3249
+ entries.forEach((e, i) => {
3250
+ const y = y0 + i * rowH;
3251
+ if (y + rowH > area.y + area.h + 2) return;
3252
+ out.push(rect(x, y + 3, 8, 8, e.color));
3253
+ out.push(text(x + 12, y + 11, fitChartText(e.label, width - 16, attrs, options), attrs));
3254
+ });
3255
+ return pos === "l" ? { x: area.x + width + 8, y: area.y, w: area.w - width - 8, h: area.h } : { x: area.x, y: area.y, w: area.w - width - 8, h: area.h };
3256
+ }
3257
+
3258
+ // text/wrap-styled-runs.ts
3259
+ var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3260
+ function wrapStyledRuns(runs, maxWidth, measure, options = {}) {
3261
+ const groups = [];
3262
+ for (const [source, run] of runs.entries()) {
3263
+ for (const token of run.text.split(/(\r\n|[\r\n]|[ \t]+)/u).filter(Boolean)) {
3264
+ const kind = /^[\r\n]+$/u.test(token) ? "break" : /^[ \t]+$/u.test(token) ? "space" : "word";
3265
+ let group = groups.at(-1);
3266
+ if (!group || group.kind !== kind || kind === "break") {
3267
+ group = { kind, pieces: [] };
3268
+ groups.push(group);
3269
+ }
3270
+ if (kind !== "break") group.pieces.push({ run, source, text: token });
3271
+ }
3272
+ }
3273
+ const merged = (left, right) => {
3274
+ const result2 = left.map((piece) => ({ ...piece }));
3275
+ for (const piece of right) {
3276
+ const last = result2.at(-1);
3277
+ if (last?.source === piece.source) last.text += piece.text;
3278
+ else result2.push({ ...piece });
3279
+ }
3280
+ return result2;
3281
+ };
3282
+ const width = (pieces) => pieces.reduce((sum, piece) => {
3283
+ const advance = measure(piece.text, piece.run);
3284
+ return sum + (Number.isFinite(advance) && advance >= 0 ? advance : 0);
3285
+ }, 0);
3286
+ const result = [];
3287
+ let line2 = [];
3288
+ let spaces = [];
3289
+ const flush = () => {
3290
+ result.push(line2.map((piece) => ({ ...piece.run, text: piece.text })));
3291
+ line2 = [];
3292
+ spaces = [];
3293
+ };
3294
+ for (const group of groups) {
3295
+ if (group.kind === "break") {
3296
+ flush();
3297
+ continue;
3298
+ }
3299
+ if (group.kind === "space") {
3300
+ spaces = group.pieces;
3301
+ continue;
3302
+ }
3303
+ const separator = line2.length ? spaces : [];
3304
+ const wordWidth = width(group.pieces);
3305
+ if (line2.length && width(merged(line2, [...separator, ...group.pieces])) > maxWidth) flush();
3306
+ else line2 = merged(line2, separator);
3307
+ spaces = [];
3308
+ if (options.breakWords && wordWidth > maxWidth) {
3309
+ for (const piece of group.pieces) {
3310
+ for (const { segment } of graphemes.segment(piece.text)) {
3311
+ const next = { ...piece, text: segment };
3312
+ if (line2.length && width(merged(line2, [next])) > maxWidth) flush();
3313
+ line2 = merged(line2, [next]);
3314
+ }
3315
+ }
3316
+ } else line2 = merged(line2, group.pieces);
3317
+ }
3318
+ flush();
3319
+ return result;
3320
+ }
3321
+
3322
+ // chart/render/chart-svg-title-text.ts
3323
+ function spacing(value, naturalHeight, fallback) {
3324
+ return value ? value.unit === "points" ? chartPointsToPixels(value.value) : naturalHeight * value.value : fallback;
3325
+ }
3326
+ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
3327
+ if (!model.title) return void 0;
3328
+ const base = chartTextAttributes(model, "title", 14);
3329
+ const capacity = Math.max(1, width * 0.8 - 8);
3330
+ if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options) <= capacity)
3331
+ return void 0;
3332
+ const paragraphs = model.titleText?.paragraphs ?? [
3333
+ {
3334
+ runs: [{ text: model.title, appearance: model.appearance?.title ?? {} }]
3335
+ }
3336
+ ];
3337
+ const hardLines = [];
3338
+ for (const paragraph of paragraphs) {
3339
+ let line2 = {
3340
+ ...paragraph,
3341
+ runs: []
3342
+ };
3343
+ hardLines.push(line2);
3344
+ for (const run of paragraph.runs) {
3345
+ const pieces = run.text.split("\n");
3346
+ for (const [index, piece] of pieces.entries()) {
3347
+ if (index) {
3348
+ line2 = { ...paragraph, runs: [] };
3349
+ hardLines.push(line2);
3350
+ }
3351
+ if (piece) line2.runs.push({ ...run, text: piece });
3352
+ }
3353
+ }
3354
+ }
3355
+ const lines = hardLines.flatMap((line2) => {
3356
+ const wrapped = wrapStyledRuns(
3357
+ line2.runs,
3358
+ capacity,
3359
+ (content, run) => chartTextWidth(
3360
+ content,
3361
+ chartTextAttributes(
3362
+ { ...model, appearance: { title: run.appearance } },
3363
+ "title",
3364
+ base.size
3365
+ ),
3366
+ options
3367
+ ),
3368
+ { breakWords: true }
3369
+ );
3370
+ const { spaceBefore, spaceAfter, ...properties2 } = line2;
3371
+ return wrapped.map((runs, index) => ({
3372
+ ...properties2,
3373
+ runs,
3374
+ ...index === 0 && spaceBefore ? { spaceBefore } : {},
3375
+ ...index === wrapped.length - 1 && spaceAfter ? { spaceAfter } : {}
3376
+ }));
3377
+ });
3378
+ const metrics = lines.map((line2) => {
3379
+ const runs = line2.runs.map((run) => ({
3380
+ ...run,
3381
+ attrs: chartTextAttributes(
3382
+ { ...model, appearance: { title: run.appearance } },
3383
+ "title",
3384
+ base.size
3385
+ )
3386
+ }));
3387
+ return {
3388
+ ...line2,
3389
+ runs,
3390
+ width: runs.reduce((sum, run) => sum + chartTextWidth(run.text, run.attrs, options), 0),
3391
+ size: runs.length ? Math.max(...runs.map((run) => run.attrs.size ?? 14)) : base.size ?? 14,
3392
+ fontMetrics: (runs.length ? runs.map((run) => run.attrs) : [base]).map(
3393
+ (attrs) => chartFontMetrics(attrs, options)
3394
+ )
3395
+ };
3396
+ });
3397
+ const measured = metrics.every((line2) => line2.fontMetrics.every((font) => font !== void 0));
3398
+ const vertical = metrics.map((line2) => {
3399
+ const ascent = measured ? Math.max(...line2.fontMetrics.map((font) => font.ascent)) : line2.size;
3400
+ const descent = measured ? Math.max(...line2.fontMetrics.map((font) => font.descent)) : line2.size * 0.4 + 4;
3401
+ const natural = ascent + descent;
3402
+ const height2 = spacing(line2.lineSpacing, natural, natural);
3403
+ const leading = (height2 - natural) / 2;
3404
+ return {
3405
+ ascent: ascent + leading,
3406
+ descent: descent + leading,
3407
+ height: height2,
3408
+ before: spacing(line2.spaceBefore, natural, 0),
3409
+ after: spacing(line2.spaceAfter, natural, 0),
3410
+ leading
3411
+ };
3412
+ });
3413
+ const boxWidth = Math.min(width - 16, Math.max(0, ...metrics.map((line2) => line2.width)) + 8);
3414
+ const height = vertical.reduce(
3415
+ (sum, line2) => sum + line2.height + line2.before + line2.after,
3416
+ measured ? 4 : 0
3417
+ );
3418
+ let baseline = 8 + (metrics[0]?.size ?? base.size ?? 14) + (vertical[0]?.before ?? 0) + (vertical[0]?.leading ?? 0);
3419
+ const spans = [];
3420
+ for (const [index, line2] of metrics.entries()) {
3421
+ if (index)
3422
+ baseline += vertical[index - 1].descent + vertical[index - 1].after + vertical[index].before + vertical[index].ascent;
3423
+ let x = line2.align === "l" ? (width - boxWidth) / 2 + 4 : line2.align === "r" ? (width + boxWidth) / 2 - 4 - line2.width : (width - line2.width) / 2;
3424
+ for (const run of line2.runs) {
3425
+ spans.push(
3426
+ text(x, baseline, run.text, {
3427
+ ...run.attrs,
3428
+ anchor: "start"
3429
+ }).replace("<text ", '<tspan data-chart-title-run="true" ').replace("</text>", "</tspan>")
3430
+ );
3431
+ x += chartTextWidth(run.text, run.attrs, options);
3432
+ }
3433
+ }
3434
+ const parent = text(0, 0, "", { ...base, underline: false }).replace(
3435
+ "</text>",
3436
+ `${spans.join("")}</text>`
3437
+ );
3438
+ const markup = chartAreaRect(model, "title", {
3439
+ x: (width - boxWidth) / 2,
3440
+ y: 4,
3441
+ w: Math.max(0, boxWidth),
3442
+ h: height
3443
+ }) + parent;
3444
+ const automatic = { x: (width - boxWidth) / 2, y: 4, width: boxWidth, height };
3445
+ const manual = resolveManualLayoutRect(
3446
+ model.titleLayout,
3447
+ { width, height: frameHeight },
3448
+ automatic
3449
+ );
3450
+ return {
3451
+ markup: manual ? `<g data-chart-title-layout="true" transform="translate(${n(manual.x - automatic.x)} ${n(manual.y - automatic.y)})">${markup}</g>` : markup,
3452
+ height: Math.max(24, height)
3453
+ };
3454
+ }
3455
+
3456
+ // chart/render/chart-svg.ts
3457
+ function renderChartSvg(model, width, height, options = {}) {
3458
+ const paint = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
3459
+ model = paint.model;
3460
+ const w = Math.max(1, width);
3461
+ const h = Math.max(1, height);
3462
+ const out = [];
3463
+ let foregroundTitle = "";
3464
+ out.push(
3465
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${n(w)}" height="${n(h)}" viewBox="0 0 ${n(w)} ${n(h)}" font-family="${esc(CHART_FONT_FAMILY)}" role="img">`
3466
+ );
3467
+ if (model.title) out.push(`<title>${esc(model.title)}</title>`);
3468
+ if (paint.defs) out.push(paint.defs);
3469
+ out.push(chartAreaRect(model, "chartArea", { x: 0, y: 0, w, h }));
3470
+ let area = { x: 8, y: 8, w: w - 16, h: h - 16 };
3471
+ const richTitle = chartRichTitleSvg(model, w, options, h);
3472
+ if (richTitle) {
3473
+ if (model.titleLayout || model.titleOverlay) foregroundTitle = richTitle.markup;
3474
+ else out.push(richTitle.markup);
3475
+ if (!model.titleOverlay)
3476
+ area = { ...area, y: area.y + richTitle.height, h: area.h - richTitle.height };
3477
+ } else if (model.title) {
3478
+ const attrs = chartTextAttributes(model, "title", 14);
3479
+ const size = attrs.size ?? 14;
3480
+ const label = fitChartText(model.title, w - 16, attrs, options);
3481
+ const titleWidth = Math.min(w - 16, chartTextWidth(label, attrs, options) + 8);
3482
+ const font = chartFontMetrics(attrs, options);
3483
+ const titleHeight = Math.max(24, font ? font.ascent + font.descent + 4 : size * 1.4 + 4);
3484
+ out.push(
3485
+ chartAreaRect(model, "title", {
3486
+ x: (w - titleWidth) / 2,
3487
+ y: 4,
3488
+ w: Math.max(0, titleWidth),
3489
+ h: font ? font.ascent + font.descent + 4 : size * 1.4 + 4
3490
+ })
3491
+ );
3492
+ out.push(
3493
+ text(w / 2, 8 + size, label, {
3494
+ anchor: "middle",
3495
+ fill: "#404040",
3496
+ ...attrs
3497
+ })
3498
+ );
3499
+ if (!model.titleOverlay)
3500
+ area = { x: area.x, y: area.y + titleHeight, w: area.w, h: area.h - titleHeight };
3501
+ }
3502
+ if (!model.supported) {
3503
+ out.push(
3504
+ text(w / 2, area.y + area.h / 2, `${model.type} charts are not drawn`, { anchor: "middle" })
3505
+ );
3506
+ if (foregroundTitle) out.push(foregroundTitle);
3507
+ out.push("</svg>");
3508
+ return out.join("");
3509
+ }
3510
+ const legend = chartLegendSvg(model, area, { width: w, height: h }, options);
3511
+ area = legend.plot;
3512
+ if (!legend.foreground) out.push(legend.markup);
3513
+ if (area.w > 4 && area.h > 4) {
3514
+ if (model.type === "pie" || model.type === "doughnut") out.push(pieSvg(model, area));
3515
+ else if (model.type === "radar") out.push(radarSvg(model, area));
3516
+ else out.push(cartesianSvg(model, area));
3517
+ }
3518
+ if (legend.foreground) out.push(legend.markup);
3519
+ if (foregroundTitle) out.push(foregroundTitle);
3520
+ out.push("</svg>");
3521
+ return out.join("");
3522
+ }
3523
+
3524
+ // chart/render/render-space.ts
3525
+ var DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
3526
+ "bar",
3527
+ "column",
3528
+ "line",
3529
+ "area",
3530
+ "pie",
3531
+ "doughnut",
3532
+ "scatter",
3533
+ "radar"
3534
+ ]);
3535
+ function chartThemePalette(theme, fonts = {}) {
3536
+ return {
3537
+ colors: THEME_SLOTS.map(
3538
+ (slot, index) => themeSlotHex(theme?.colors[slot]) ?? DEFAULT_THEME_COLORS[index] ?? "000000"
3539
+ ),
3540
+ majorFont: fonts.major ?? "Calibri Light",
3541
+ minorFont: fonts.minor ?? "Calibri"
3542
+ };
3543
+ }
3544
+ function chartSpaceKind(space) {
3545
+ if (!space.plotArea.groups.length) return { drawn: false };
3546
+ const type = chartSummaryFromSpace(space).chartType;
3547
+ return { type, drawn: DRAWN_CHART_TYPES.has(type) };
3548
+ }
3549
+ function renderChartSpaceSvg(space, options) {
3550
+ const { width, height, theme, fonts, formatting, colorPalette, styleDefinition, ...svg } = options;
3551
+ const summary = chartSummaryFromSpace(space, {
3552
+ ...formatting ? { formatting } : {},
3553
+ ...colorPalette !== void 0 ? { colorPalette } : {},
3554
+ ...styleDefinition ? { styleDefinition } : {}
3555
+ });
3556
+ const view = chartSummaryView(summary, chartThemePalette(theme, fonts));
3557
+ return renderChartSvg(view, width, height, svg);
3558
+ }
3559
+
1006
3560
  // docx/restore-run-format.ts
1007
3561
  function parseRunPropertiesSnapshot(xml) {
1008
3562
  return parsePropertiesSnapshot(xml, "rPr");
@@ -1066,18 +3620,18 @@ function parseDirectParagraphProperties(props) {
1066
3620
  if (shading) paragraph.shadingFill = shading;
1067
3621
  const tabStops = parseTabStops(first2(props, "tabs"));
1068
3622
  if (tabStops.length) paragraph.tabStops = tabStops;
1069
- const spacing = first2(props, "spacing");
1070
- const before = twipValue(getW(spacing, "before"));
1071
- const after = twipValue(getW(spacing, "after"));
1072
- const line = signedTwipValue(getW(spacing, "line"));
3623
+ const spacing2 = first2(props, "spacing");
3624
+ const before = twipValue(getW(spacing2, "before"));
3625
+ const after = twipValue(getW(spacing2, "after"));
3626
+ const line2 = signedTwipValue(getW(spacing2, "line"));
1073
3627
  if (before !== void 0) paragraph.spacingBeforeTwips = before;
1074
3628
  if (after !== void 0) paragraph.spacingAfterTwips = after;
1075
- if (line !== void 0) {
1076
- paragraph.lineSpacingTwips = line;
3629
+ if (line2 !== void 0) {
3630
+ paragraph.lineSpacingTwips = line2;
1077
3631
  }
1078
- const rule = getW(spacing, "lineRule");
3632
+ const rule = getW(spacing2, "lineRule");
1079
3633
  if (rule === "auto" || rule === "exact" || rule === "atLeast") paragraph.lineSpacingRule = rule;
1080
- else if (line !== void 0) paragraph.lineSpacingRule = "auto";
3634
+ else if (line2 !== void 0) paragraph.lineSpacingRule = "auto";
1081
3635
  const indent = first2(props, "ind");
1082
3636
  const indentLeft = signedTwipValue(getW(indent, "left"));
1083
3637
  const indentRight = signedTwipValue(getW(indent, "right"));
@@ -1111,9 +3665,9 @@ function resolveNumberingLevel(catalog, numId, level) {
1111
3665
  let base = override?.lvl ?? abstract;
1112
3666
  if (!base) return void 0;
1113
3667
  if (override?.lvl) {
1114
- const { lvlRestart: _ignored, ...properties } = base;
3668
+ const { lvlRestart: _ignored, ...properties2 } = base;
1115
3669
  base = {
1116
- ...properties,
3670
+ ...properties2,
1117
3671
  ...abstract?.lvlRestart !== void 0 ? { lvlRestart: abstract.lvlRestart } : {}
1118
3672
  };
1119
3673
  }
@@ -1249,8 +3803,39 @@ function numberNotesInOrder(blocks, kind) {
1249
3803
  return order;
1250
3804
  }
1251
3805
 
3806
+ // docx/chart-paint.ts
3807
+ function themeCatalogColorScheme(theme) {
3808
+ const colors = {};
3809
+ for (const [slot, value] of Object.entries(theme?.colors ?? {}))
3810
+ if (value) colors[slot] = { kind: "srgb", value: value.replace(/^#/, ""), transforms: [] };
3811
+ return { colors };
3812
+ }
3813
+ function docxChartPaint(chart, widthPx, heightPx, theme) {
3814
+ const space = chart?.chartSpace;
3815
+ if (!space) return { label: "Chart" };
3816
+ const kind = chartSpaceKind(space);
3817
+ if (!kind.drawn) return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
3818
+ try {
3819
+ const fonts = {
3820
+ ...theme?.fonts.major.latin ? { major: theme.fonts.major.latin } : {},
3821
+ ...theme?.fonts.minor.latin ? { minor: theme.fonts.minor.latin } : {}
3822
+ };
3823
+ const svg = renderChartSpaceSvg(space, {
3824
+ width: Math.max(1, Math.round(widthPx)),
3825
+ height: Math.max(1, Math.round(heightPx)),
3826
+ theme: themeCatalogColorScheme(theme),
3827
+ fonts,
3828
+ ...chart.formatting ? { formatting: chart.formatting } : {},
3829
+ ...chart.colorPalette !== void 0 ? { colorPalette: chart.colorPalette } : {}
3830
+ });
3831
+ return { svg, label: chart.title ? `Chart: ${chart.title}` : "Chart" };
3832
+ } catch {
3833
+ return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
3834
+ }
3835
+ }
3836
+
1252
3837
  // docx/numbering-text.ts
1253
- function romanNumeral(n) {
3838
+ function romanNumeral(n2) {
1254
3839
  const values = [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
1255
3840
  const numerals = [
1256
3841
  "M",
@@ -1267,7 +3852,7 @@ function romanNumeral(n) {
1267
3852
  "IV",
1268
3853
  "I"
1269
3854
  ];
1270
- let remaining = Math.max(1, Math.min(Math.trunc(n), 3999));
3855
+ let remaining = Math.max(1, Math.min(Math.trunc(n2), 3999));
1271
3856
  let result = "";
1272
3857
  for (const [i, value] of values.entries()) {
1273
3858
  while (remaining >= value) {
@@ -1278,13 +3863,13 @@ function romanNumeral(n) {
1278
3863
  return result;
1279
3864
  }
1280
3865
  var LATIN_LOWER = Array.from("abcdefghijklmnopqrstuvwxyz");
1281
- function letterLabel(n) {
1282
- const index = Math.max(0, Math.trunc(n) - 1);
3866
+ function letterLabel(n2) {
3867
+ const index = Math.max(0, Math.trunc(n2) - 1);
1283
3868
  const letter = LATIN_LOWER[index % LATIN_LOWER.length] ?? "a";
1284
3869
  return letter.repeat(Math.floor(index / LATIN_LOWER.length) + 1);
1285
3870
  }
1286
- var ORDINAL_SUFFIX = (n) => {
1287
- const abs = Math.abs(Math.trunc(n));
3871
+ var ORDINAL_SUFFIX = (n2) => {
3872
+ const abs = Math.abs(Math.trunc(n2));
1288
3873
  if (abs % 100 >= 11 && abs % 100 <= 13) return "th";
1289
3874
  switch (abs % 10) {
1290
3875
  case 1:
@@ -1297,8 +3882,8 @@ var ORDINAL_SUFFIX = (n) => {
1297
3882
  return "th";
1298
3883
  }
1299
3884
  };
1300
- function ordinalNumeral(n) {
1301
- return `${Math.trunc(n)}${ORDINAL_SUFFIX(n)}`;
3885
+ function ordinalNumeral(n2) {
3886
+ return `${Math.trunc(n2)}${ORDINAL_SUFFIX(n2)}`;
1302
3887
  }
1303
3888
  var ONES = [
1304
3889
  "",
@@ -1323,8 +3908,8 @@ var ONES = [
1323
3908
  "nineteen"
1324
3909
  ];
1325
3910
  var TENS = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"];
1326
- function cardinalWords(n) {
1327
- const value = Math.trunc(n);
3911
+ function cardinalWords(n2) {
3912
+ const value = Math.trunc(n2);
1328
3913
  if (value < 0 || value > 999999) return String(value);
1329
3914
  if (value === 0) return "zero";
1330
3915
  const chunk = (v) => {
@@ -1356,8 +3941,8 @@ var ORDINAL_WORDS = {
1356
3941
  nine: "ninth",
1357
3942
  twelve: "twelfth"
1358
3943
  };
1359
- function ordinalWords(n) {
1360
- const value = Math.trunc(n);
3944
+ function ordinalWords(n2) {
3945
+ const value = Math.trunc(n2);
1361
3946
  if (value < 0 || value > 999999) return ordinalNumeral(value);
1362
3947
  const words = cardinalWords(value);
1363
3948
  const splitAt = Math.max(words.lastIndexOf(" "), words.lastIndexOf("-"));
@@ -1497,11 +4082,11 @@ function computeListLabels(model) {
1497
4082
  if (!def) continue;
1498
4083
  if (def.numFmt === "none") continue;
1499
4084
  counters.advance(numId, level, def, catalog);
1500
- const text = def.numFmt === "bullet" ? def.lvlText : substituteLvlText(def.lvlText, numId, level, catalog, counters, Boolean(def.isLgl));
4085
+ const text2 = def.numFmt === "bullet" ? def.lvlText : substituteLvlText(def.lvlText, numId, level, catalog, counters, Boolean(def.isLgl));
1501
4086
  labels.set(paragraph.id, {
1502
4087
  numId,
1503
4088
  level,
1504
- text,
4089
+ text: text2,
1505
4090
  suffix: def.suffix ?? "tab",
1506
4091
  ...definedProps({
1507
4092
  alignment: def.lvlJc,
@@ -1526,8 +4111,8 @@ var SYMBOL_BULLETS = {
1526
4111
  "\uF0E0": "\u27A9",
1527
4112
  "\uF0B2": "\u25CB"
1528
4113
  };
1529
- function displayListLabel(text) {
1530
- return text.replace(/[-]/g, (char) => SYMBOL_BULLETS[char] ?? "\u2022");
4114
+ function displayListLabel(text2) {
4115
+ return text2.replace(/[-]/g, (char) => SYMBOL_BULLETS[char] ?? "\u2022");
1531
4116
  }
1532
4117
 
1533
4118
  // docx/restore-paragraph-format.ts
@@ -1565,20 +4150,20 @@ function restoreParagraphFormatting(paragraph) {
1565
4150
  throw new Error(
1566
4151
  "Cannot reject a paragraph formatting revision without its prior properties snapshot."
1567
4152
  );
1568
- const properties = parsePropertiesSnapshot(xml, "pPr");
4153
+ const properties2 = parsePropertiesSnapshot(xml, "pPr");
1569
4154
  if (paragraph.sourceParagraphPropertiesXml) {
1570
4155
  const current = parsePropertiesSnapshot(paragraph.sourceParagraphPropertiesXml, "pPr");
1571
4156
  for (const name of ["rPr", "sectPr"]) {
1572
4157
  const element = first2(current, name);
1573
- if (element && !first2(properties, name))
1574
- properties.appendChild(properties.ownerDocument.importNode(element, true));
4158
+ if (element && !first2(properties2, name))
4159
+ properties2.appendChild(properties2.ownerDocument.importNode(element, true));
1575
4160
  }
1576
- orderParagraphProperties(properties);
4161
+ orderParagraphProperties(properties2);
1577
4162
  }
1578
- const previous = parseDirectParagraphProperties(properties);
4163
+ const previous = parseDirectParagraphProperties(properties2);
1579
4164
  for (const key of PARAGRAPH_FORMAT_KEYS) delete paragraph[key];
1580
4165
  Object.assign(paragraph, previous);
1581
- paragraph.restoredParagraphPropertiesXml = buildXml(properties);
4166
+ paragraph.restoredParagraphPropertiesXml = buildXml(properties2);
1582
4167
  if (paragraph.sourceParagraphPropertiesXml)
1583
4168
  paragraph.sourceParagraphPropertiesXml = paragraph.restoredParagraphPropertiesXml;
1584
4169
  delete paragraph.formatRevision;
@@ -1744,9 +4329,9 @@ function createFakeMeasurer(options = {}) {
1744
4329
  const charWidthFactor = options.charWidthFactor ?? 0.6;
1745
4330
  const lineHeightFactor = options.lineHeightFactor ?? 1.15;
1746
4331
  return {
1747
- widthOf(text, font) {
4332
+ widthOf(text2, font) {
1748
4333
  let width = 0;
1749
- for (const ch of text) {
4334
+ for (const ch of text2) {
1750
4335
  if (ch === " " || ch === "\n") continue;
1751
4336
  width += font.sizePx * charWidthFactor * (font.bold ? 1.08 : 1) * (ch === " " ? 0.6 : 1);
1752
4337
  }
@@ -1769,7 +4354,7 @@ function isEastAsianChar(ch) {
1769
4354
  const cp = ch.codePointAt(0) ?? 0;
1770
4355
  return cp >= 4352 && cp <= 4607 || cp >= 11904 && cp <= 40959 || cp >= 43360 && cp <= 43391 || cp >= 44032 && cp <= 55295 || cp >= 63744 && cp <= 64255 || cp >= 65072 && cp <= 65103 || cp >= 65280 && cp <= 65519 || cp >= 131072 && cp <= 262143;
1771
4356
  }
1772
- function tokenizeRun(text, runIndex) {
4357
+ function tokenizeRun(text2, runIndex) {
1773
4358
  const tokens = [];
1774
4359
  let word = "";
1775
4360
  let wordStart = 0;
@@ -1777,7 +4362,7 @@ function tokenizeRun(text, runIndex) {
1777
4362
  if (word) tokens.push({ kind: "word", text: word, runIndex, sourceStart: wordStart });
1778
4363
  word = "";
1779
4364
  };
1780
- const chars = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(text)].map(
4365
+ const chars = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(text2)].map(
1781
4366
  (part) => part.segment
1782
4367
  );
1783
4368
  let offset = 0;
@@ -1900,11 +4485,11 @@ function fontOf(run) {
1900
4485
  }
1901
4486
  };
1902
4487
  }
1903
- var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1904
- function runTextWidth(text, run, measurer) {
4488
+ var graphemes2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
4489
+ function runTextWidth(text2, run, measurer) {
1905
4490
  return Math.max(
1906
4491
  0,
1907
- measurer.widthOf(text, fontOf(run)) * (run.textScalePercent ?? 100) / 100 + [...graphemes.segment(text)].length * (run.characterSpacingPx ?? 0)
4492
+ measurer.widthOf(text2, fontOf(run)) * (run.textScalePercent ?? 100) / 100 + [...graphemes2.segment(text2)].length * (run.characterSpacingPx ?? 0)
1908
4493
  );
1909
4494
  }
1910
4495
  function resolveIndents(paragraph) {
@@ -1982,9 +4567,9 @@ function buildFragments(tokensOnLine, paragraph) {
1982
4567
  let x = 0;
1983
4568
  for (const { token, widthPx, leader, xOffsetPx, advancePx } of tokensOnLine) {
1984
4569
  const run = paragraph.runs[token.runIndex];
1985
- const text = token.kind === "word" || token.kind === "space" ? token.text : "";
4570
+ const text2 = token.kind === "word" || token.kind === "space" ? token.text : "";
1986
4571
  fragments.push({
1987
- text,
4572
+ text: text2,
1988
4573
  xPx: x + (xOffsetPx ?? 0),
1989
4574
  widthPx,
1990
4575
  runIndex: token.runIndex,
@@ -2196,11 +4781,11 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
2196
4781
  }
2197
4782
  flushLine(lines.length === 0, void 0);
2198
4783
  const lastIndex = lines.length - 1;
2199
- for (const [index, line] of lines.entries()) {
4784
+ for (const [index, line2] of lines.entries()) {
2200
4785
  lines[index] = {
2201
- ...line,
4786
+ ...line2,
2202
4787
  fragments: alignFragments(
2203
- line.fragments,
4788
+ line2.fragments,
2204
4789
  availableWidth(index),
2205
4790
  index === lastIndex,
2206
4791
  effectiveAlign
@@ -2212,10 +4797,10 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
2212
4797
  const insetTopPx = extent("top");
2213
4798
  const insetBottomPx = extent("bottom");
2214
4799
  let y = insetTopPx;
2215
- for (const line of lines) {
2216
- y += line.gapBeforePx ?? 0;
2217
- line.yPx = y;
2218
- y += line.heightPx;
4800
+ for (const line2 of lines) {
4801
+ y += line2.gapBeforePx ?? 0;
4802
+ line2.yPx = y;
4803
+ y += line2.heightPx;
2219
4804
  }
2220
4805
  const frame = borders || paragraph.shading ? {
2221
4806
  leftPx: leftPx - extent("left"),
@@ -2268,7 +4853,7 @@ function stackParagraphs(paragraphs, widthPx, measurer, note, topPx = 0, startTo
2268
4853
  );
2269
4854
  y += layout.spacingBeforePx;
2270
4855
  const top = y;
2271
- const lines = layout.lines.map((line) => ({ ...line, yPx: line.yPx + top }));
4856
+ const lines = layout.lines.map((line2) => ({ ...line2, yPx: line2.yPx + top }));
2272
4857
  boxes.push({
2273
4858
  kind: "paragraph",
2274
4859
  blockId: paragraph.id,
@@ -2336,7 +4921,7 @@ function splitCellAtHeight(boxes, cutHeightPx) {
2336
4921
  continue;
2337
4922
  }
2338
4923
  const beforeLines = box.lines.filter(
2339
- (line) => box.yPx + line.yPx + line.heightPx <= cutHeightPx
4924
+ (line2) => box.yPx + line2.yPx + line2.heightPx <= cutHeightPx
2340
4925
  );
2341
4926
  const afterLines = box.lines.slice(beforeLines.length);
2342
4927
  if (beforeLines.length) {
@@ -2351,7 +4936,7 @@ function splitCellAtHeight(boxes, cutHeightPx) {
2351
4936
  ...box,
2352
4937
  yPx: 0,
2353
4938
  heightPx: afterLines.at(-1).yPx + afterLines.at(-1).heightPx - shift,
2354
- lines: afterLines.map((line) => ({ ...line, yPx: line.yPx - shift }))
4939
+ lines: afterLines.map((line2) => ({ ...line2, yPx: line2.yPx - shift }))
2355
4940
  });
2356
4941
  } else {
2357
4942
  afterOrigin = box.yPx + box.heightPx;
@@ -2600,9 +5185,9 @@ function placeParagraph(cursor, placement, note) {
2600
5185
  let end = lineCursor;
2601
5186
  let forced;
2602
5187
  for (let i = lineCursor; i < layout.lines.length; i++) {
2603
- const line = expectDefined(layout.lines[i], "paragraph line index");
2604
- const gap = i === lineCursor && !firstSegment ? 0 : line.gapBeforePx ?? 0;
2605
- const height = line.heightPx + gap;
5188
+ const line2 = expectDefined(layout.lines[i], "paragraph line index");
5189
+ const gap = i === lineCursor && !firstSegment ? 0 : line2.gapBeforePx ?? 0;
5190
+ const height = line2.heightPx + gap;
2606
5191
  if (cumulative + height > budget && (end > lineCursor || !cursor.atColumnTop)) break;
2607
5192
  cumulative += height;
2608
5193
  end = i + 1;
@@ -2630,7 +5215,7 @@ function placeParagraph(cursor, placement, note) {
2630
5215
  }
2631
5216
  const first3 = expectDefined(layout.lines[lineCursor], "first line of paragraph segment");
2632
5217
  const origin = first3.yPx - (firstSegment ? (first3.gapBeforePx ?? 0) + layout.insetTopPx : 0);
2633
- const segmentLines = layout.lines.slice(lineCursor, lineCursor + placedCount).map((line) => ({ ...line, yPx: line.yPx - origin }));
5218
+ const segmentLines = layout.lines.slice(lineCursor, lineCursor + placedCount).map((line2) => ({ ...line2, yPx: line2.yPx - origin }));
2634
5219
  const isFinal = lineCursor + placedCount >= layout.lines.length;
2635
5220
  const lastLine = segmentLines.at(-1);
2636
5221
  const isLastSegment = lineCursor + placedCount >= layout.lines.length;
@@ -3223,9 +5808,9 @@ function paragraphBox(formatting, theme) {
3223
5808
  let betweenBorder;
3224
5809
  for (const side of ["top", "bottom", "left", "right", "between"]) {
3225
5810
  const source = formatting.borders?.[side];
3226
- const line = border(source, theme);
3227
- if (!line) continue;
3228
- const resolved = { ...line, spacePx: pointsToPx(source?.spacePoints ?? 0) };
5811
+ const line2 = border(source, theme);
5812
+ if (!line2) continue;
5813
+ const resolved = { ...line2, spacePx: pointsToPx(source?.spacePoints ?? 0) };
3229
5814
  if (side === "between") betweenBorder = resolved;
3230
5815
  else borders[side] = resolved;
3231
5816
  }
@@ -3248,8 +5833,8 @@ function groupParagraphBorders(blocks, between) {
3248
5833
  const borders = { ...block.borders };
3249
5834
  if (sameAsNext) delete borders.bottom;
3250
5835
  if (sameAsPrevious) {
3251
- const line = between.get(block);
3252
- if (line) borders.top = line;
5836
+ const line2 = between.get(block);
5837
+ if (line2) borders.top = line2;
3253
5838
  else delete borders.top;
3254
5839
  }
3255
5840
  block.borders = borders;
@@ -3364,7 +5949,7 @@ function adaptDocumentModel(model, note = () => {
3364
5949
  if (run.equation) reportOnce(EQUATION_NOTE);
3365
5950
  const name = run.field ? fieldName(run.field.instr) : "";
3366
5951
  const noteText = run.noteReference ? noteLabel(run.noteReference.kind, run.noteReference.id) : run.noteMark ? markLabel ?? "" : void 0;
3367
- const text = noteText ?? (run.field && !isFieldLocked(run) && (name === "DATE" || name === "TIME") ? dateFieldResult(name, run.field.instr, now) : run.equation ? "[Equation]" : run.text);
5952
+ const text2 = noteText ?? (run.field && !isFieldLocked(run) && (name === "DATE" || name === "TIME") ? dateFieldResult(name, run.field.instr, now) : run.equation ? "[Equation]" : run.text);
3368
5953
  const script = formatting.verticalAlign === "superscript" || noteText !== void 0 && formatting.verticalAlign === void 0 ? "super" : formatting.verticalAlign === "subscript" ? "sub" : void 0;
3369
5954
  const image = run.image;
3370
5955
  if (image?.unsupported === "Text box") reportOnce(TEXT_BOX_NOTE);
@@ -3372,11 +5957,12 @@ function adaptDocumentModel(model, note = () => {
3372
5957
  partName: image.partName,
3373
5958
  contentType: image.contentType,
3374
5959
  widthPx: image.widthPx,
3375
- heightPx: image.heightPx
5960
+ heightPx: image.heightPx,
5961
+ ...image.chart ? { chart: docxChartPaint(image.chart, image.widthPx, image.heightPx, theme) } : {}
3376
5962
  } : void 0;
3377
5963
  return {
3378
5964
  // Hidden text (`w:vanish`) takes no space when printed, as in Word by default.
3379
- text: image || formatting.vanish ? "" : formatting.caps ? text.toUpperCase() : text,
5965
+ text: image || formatting.vanish ? "" : formatting.caps ? text2.toUpperCase() : text2,
3380
5966
  ...object ? { object } : {},
3381
5967
  ...definedProps({
3382
5968
  bold: formatting.bold,