ooxml-core 1.1.0 → 1.2.0

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