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
@@ -171,25 +171,25 @@ var inlineRunFormattingAttrs = Object.fromEntries(
171
171
  [...RUN_PROPERTY_ATTRIBUTES].map((name) => [name, { default: null }])
172
172
  );
173
173
  function inlineRunProperties(node) {
174
- const properties3 = typeof node.attrs.format === "string" ? JSON.parse(node.attrs.format) : {};
174
+ const properties4 = typeof node.attrs.format === "string" ? JSON.parse(node.attrs.format) : {};
175
175
  for (const key of DIRECT_RUN_PROPERTY_KEYS) {
176
176
  const override = node.attrs[attributeName(key)];
177
177
  if (typeof override !== "string") continue;
178
178
  const value = JSON.parse(override);
179
- if (value === null) delete properties3[key];
180
- else properties3[key] = value;
179
+ if (value === null) delete properties4[key];
180
+ else properties4[key] = value;
181
181
  }
182
182
  const projection = node.marks.find((mark) => mark.type.name === "inlineCommentAnchors");
183
183
  if (projection) {
184
184
  const ids = projection.attrs.ids;
185
- if (ids.length) properties3.commentIds = [...ids];
186
- else delete properties3.commentIds;
185
+ if (ids.length) properties4.commentIds = [...ids];
186
+ else delete properties4.commentIds;
187
187
  }
188
- return properties3;
188
+ return properties4;
189
189
  }
190
190
  function inlineRunPropertiesDomAttrs(node) {
191
- const properties3 = inlineRunProperties(node);
192
- return Object.keys(properties3).length ? { "data-run-properties": JSON.stringify(properties3) } : {};
191
+ const properties4 = inlineRunProperties(node);
192
+ return Object.keys(properties4).length ? { "data-run-properties": JSON.stringify(properties4) } : {};
193
193
  }
194
194
  function updatedInlineRunAttributes(node, format) {
195
195
  if (!node.type.spec.attrs?.[attributeName("bold")]) return { ...node.attrs, format };
@@ -773,7 +773,9 @@ function commentIdsFromNode(node) {
773
773
  // xml/namespaces.ts
774
774
  var NS = {
775
775
  /** WordprocessingML main. */
776
- w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"};
776
+ w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
777
+ /** DrawingML main. */
778
+ a: "http://schemas.openxmlformats.org/drawingml/2006/main"};
777
779
  function parseXml(xml, options = {}) {
778
780
  const label = options.label ?? "OOXML";
779
781
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
@@ -877,6 +879,7 @@ var signedTwipsFromPixels = (pixels) => roundSignedTwips(pixels * 15);
877
879
 
878
880
  // units/constants.ts
879
881
  var EMU_PER_PIXEL = 9525;
882
+ var EMU_PER_POINT = 12700;
880
883
 
881
884
  // docx/simple-types.ts
882
885
  function parseOnOff(value) {
@@ -919,8 +922,8 @@ function universalMeasureToTwips(value) {
919
922
  }
920
923
  function parseSignedTwips(value) {
921
924
  if (value === null || value === void 0) return void 0;
922
- const text = value.trim();
923
- const parsed = SAFE_INTEGER.test(text) ? parseInteger(text) : universalMeasureToTwips(text);
925
+ const text2 = value.trim();
926
+ const parsed = SAFE_INTEGER.test(text2) ? parseInteger(text2) : universalMeasureToTwips(text2);
924
927
  return parsed === void 0 ? void 0 : signedTwips(parsed);
925
928
  }
926
929
  function parseTwips(value) {
@@ -929,26 +932,26 @@ function parseTwips(value) {
929
932
  }
930
933
  function parseHalfPoints(value) {
931
934
  if (value === null || value === void 0) return void 0;
932
- const text = value.trim();
933
- if (/^\d+$/.test(text)) {
934
- const parsed = parseInteger(text);
935
+ const text2 = value.trim();
936
+ if (/^\d+$/.test(text2)) {
937
+ const parsed = parseInteger(text2);
935
938
  return parsed === void 0 ? void 0 : halfPoints(parsed);
936
939
  }
937
- const asTwips = UNIVERSAL_MEASURE.test(text) ? universalMeasureToTwips(text) : void 0;
940
+ const asTwips = UNIVERSAL_MEASURE.test(text2) ? universalMeasureToTwips(text2) : void 0;
938
941
  return asTwips !== void 0 && asTwips >= 0 ? halfPoints(Math.round(asTwips / 10)) : void 0;
939
942
  }
940
943
  function parseSignedHalfPoints(value) {
941
944
  if (value === null || value === void 0) return void 0;
942
- const text = value.trim();
943
- const integer2 = parseInteger(text);
945
+ const text2 = value.trim();
946
+ const integer2 = parseInteger(text2);
944
947
  if (integer2 !== void 0) return halfPoints(integer2);
945
- const twips2 = universalMeasureToTwips(text);
948
+ const twips2 = universalMeasureToTwips(text2);
946
949
  return twips2 === void 0 ? void 0 : halfPoints(Math.sign(twips2) * Math.round(Math.abs(twips2) / 10));
947
950
  }
948
951
  function parseTextScale(value) {
949
- const text = value?.trim();
950
- if (text?.endsWith("%") && !/^\d+%$/.test(text)) return void 0;
951
- const parsed = parseUnsignedInteger(text?.endsWith("%") ? text.slice(0, -1) : text);
952
+ const text2 = value?.trim();
953
+ if (text2?.endsWith("%") && !/^\d+%$/.test(text2)) return void 0;
954
+ const parsed = parseUnsignedInteger(text2?.endsWith("%") ? text2.slice(0, -1) : text2);
952
955
  return parsed !== void 0 && parsed <= 600 ? parsed : void 0;
953
956
  }
954
957
  function parseEighthPoints(value) {
@@ -1134,16 +1137,16 @@ function parseRunProperties(props) {
1134
1137
  const color = first2(props, "color");
1135
1138
  const hex = parseRgbColor(getW(color, "val"));
1136
1139
  if (hex) result.color = hex;
1137
- const themeColor = enumValue(isStThemeColor, getW(color, "themeColor"));
1138
- if (themeColor) {
1139
- result.colorTheme = { token: themeColor };
1140
+ const themeColor2 = enumValue(isStThemeColor, getW(color, "themeColor"));
1141
+ if (themeColor2) {
1142
+ result.colorTheme = { token: themeColor2 };
1140
1143
  const tint = parseTintShade(getW(color, "themeTint"));
1141
1144
  const shade = parseTintShade(getW(color, "themeShade"));
1142
1145
  if (tint !== void 0) result.colorTheme.tint = tint;
1143
1146
  if (shade !== void 0) result.colorTheme.shade = shade;
1144
1147
  }
1145
- const spacing = parseSignedTwips(getW(first2(props, "spacing"), "val"));
1146
- if (spacing !== void 0) result.characterSpacingTwips = spacing;
1148
+ const spacing2 = parseSignedTwips(getW(first2(props, "spacing"), "val"));
1149
+ if (spacing2 !== void 0) result.characterSpacingTwips = spacing2;
1147
1150
  const scaleElement = first2(props, "w");
1148
1151
  const scale = scaleElement ? parseTextScale(getW(scaleElement, "val") ?? "100") : void 0;
1149
1152
  if (scale !== void 0) result.textScalePercent = scale;
@@ -1229,13 +1232,13 @@ function borderSide(element) {
1229
1232
  const style = enumValue(isStBorder, getW(element, "val"));
1230
1233
  const size = parseEighthPoints(getW(element, "sz"));
1231
1234
  const color = parseRgbColor(getW(element, "color"));
1232
- const themeColor = enumValue(isStThemeColor, getW(element, "themeColor"));
1233
- if (!style && size === void 0 && !color && !themeColor) return void 0;
1235
+ const themeColor2 = enumValue(isStThemeColor, getW(element, "themeColor"));
1236
+ if (!style && size === void 0 && !color && !themeColor2) return void 0;
1234
1237
  const side = {};
1235
1238
  if (style) side.style = style;
1236
1239
  if (size !== void 0) side.sizeEighthPoints = size;
1237
1240
  if (color) side.color = color;
1238
- if (themeColor) side.themeColor = themeColor;
1241
+ if (themeColor2) side.themeColor = themeColor2;
1239
1242
  return side;
1240
1243
  }
1241
1244
  function parseTableBorders(bordersElement) {
@@ -1350,16 +1353,16 @@ function parseFormatting(pPr) {
1350
1353
  if (borders) result.borders = borders;
1351
1354
  const shading = parseShadingFill(first2(pPr, "shd"));
1352
1355
  if (shading) result.shadingFill = shading;
1353
- const spacing = first2(pPr, "spacing");
1354
- const before = twipValue(getW(spacing, "before"));
1355
- const after = twipValue(getW(spacing, "after"));
1356
- const line = signedTwipValue(getW(spacing, "line"));
1356
+ const spacing2 = first2(pPr, "spacing");
1357
+ const before = twipValue(getW(spacing2, "before"));
1358
+ const after = twipValue(getW(spacing2, "after"));
1359
+ const line2 = signedTwipValue(getW(spacing2, "line"));
1357
1360
  if (before !== void 0) result.spacingBeforeTwips = before;
1358
1361
  if (after !== void 0) result.spacingAfterTwips = after;
1359
- if (line !== void 0) result.lineSpacingTwips = line;
1360
- const rule = getW(spacing, "lineRule");
1362
+ if (line2 !== void 0) result.lineSpacingTwips = line2;
1363
+ const rule = getW(spacing2, "lineRule");
1361
1364
  if (rule === "auto" || rule === "exact" || rule === "atLeast") result.lineSpacingRule = rule;
1362
- else if (line !== void 0) result.lineSpacingRule = "auto";
1365
+ else if (line2 !== void 0) result.lineSpacingRule = "auto";
1363
1366
  const ind = first2(pPr, "ind");
1364
1367
  for (const [xml, key] of [
1365
1368
  ["left", "indentLeftTwips"],
@@ -1643,13 +1646,13 @@ function hexToRgbChannels(color) {
1643
1646
  b: Number.parseInt(normalized.slice(4, 6), 16)
1644
1647
  };
1645
1648
  }
1646
- function percentDivisorFor(text) {
1647
- return text.endsWith("%") ? 100 : 1e5;
1649
+ function percentDivisorFor(text2) {
1650
+ return text2.endsWith("%") ? 100 : 1e5;
1648
1651
  }
1649
1652
  function parseOoxmlPercent(value) {
1650
- const text = String(value ?? "").trim();
1651
- const divisor = percentDivisorFor(text);
1652
- const magnitude = Number.parseFloat(divisor === 100 ? text.slice(0, -1) : text);
1653
+ const text2 = String(value ?? "").trim();
1654
+ const divisor = percentDivisorFor(text2);
1655
+ const magnitude = Number.parseFloat(divisor === 100 ? text2.slice(0, -1) : text2);
1653
1656
  if (!Number.isFinite(magnitude)) {
1654
1657
  return void 0;
1655
1658
  }
@@ -1695,7 +1698,7 @@ function rgbToHsl(r, g, b) {
1695
1698
  return { h, s: clampUnitInterval(s), l: clampUnitInterval(l) };
1696
1699
  }
1697
1700
  function hslToRgb(h, s, l, roundChannel = Math.round, options) {
1698
- const sC = clampUnitInterval(s);
1701
+ const sC = options?.clampSaturation === false ? s : clampUnitInterval(s);
1699
1702
  const lC = clampUnitInterval(l);
1700
1703
  const hN = (h % 360 + 360) % 360;
1701
1704
  const c = (1 - Math.abs(2 * lC - 1)) * sC;
@@ -1756,7 +1759,379 @@ function linearToSrgb255(linear) {
1756
1759
  return 255 * (c <= 31308e-7 ? c * 12.92 : 1.055 * c ** (1 / 2.4) - 0.055);
1757
1760
  }
1758
1761
 
1762
+ // color/native-gradient-curve.ts
1763
+ var OFFICE_SIGMA_FACTORS = [
1764
+ 0,
1765
+ 59,
1766
+ 120,
1767
+ 182,
1768
+ 247,
1769
+ 314,
1770
+ 383,
1771
+ 454,
1772
+ 527,
1773
+ 602,
1774
+ 680,
1775
+ 759,
1776
+ 841,
1777
+ 926,
1778
+ 1013,
1779
+ 1102,
1780
+ 1194,
1781
+ 1288,
1782
+ 1385,
1783
+ 1485,
1784
+ 1587,
1785
+ 1692,
1786
+ 1800,
1787
+ 1911,
1788
+ 2024,
1789
+ 2141,
1790
+ 2260,
1791
+ 2383,
1792
+ 2508,
1793
+ 2637,
1794
+ 2769,
1795
+ 2904,
1796
+ 3042,
1797
+ 3183,
1798
+ 3328,
1799
+ 3477,
1800
+ 3628,
1801
+ 3783,
1802
+ 3942,
1803
+ 4104,
1804
+ 4270,
1805
+ 4439,
1806
+ 4612,
1807
+ 4789,
1808
+ 4969,
1809
+ 5153,
1810
+ 5341,
1811
+ 5533,
1812
+ 5728,
1813
+ 5928,
1814
+ 6131,
1815
+ 6338,
1816
+ 6549,
1817
+ 6764,
1818
+ 6983,
1819
+ 7206,
1820
+ 7434,
1821
+ 7665,
1822
+ 7900,
1823
+ 8139,
1824
+ 8382,
1825
+ 8630,
1826
+ 8881,
1827
+ 9136,
1828
+ 9396,
1829
+ 9660,
1830
+ 9927,
1831
+ 10199,
1832
+ 10475,
1833
+ 10755,
1834
+ 11039,
1835
+ 11327,
1836
+ 11619,
1837
+ 11916,
1838
+ 12216,
1839
+ 12520,
1840
+ 12828,
1841
+ 13140,
1842
+ 13456,
1843
+ 13776,
1844
+ 14099,
1845
+ 14427,
1846
+ 14758,
1847
+ 15093,
1848
+ 15431,
1849
+ 15774,
1850
+ 16119,
1851
+ 16469,
1852
+ 16822,
1853
+ 17178,
1854
+ 17538,
1855
+ 17901,
1856
+ 18267,
1857
+ 18637,
1858
+ 19009,
1859
+ 19385,
1860
+ 19764,
1861
+ 20146,
1862
+ 20530,
1863
+ 20918,
1864
+ 21308,
1865
+ 21701,
1866
+ 22096,
1867
+ 22494,
1868
+ 22894,
1869
+ 23297,
1870
+ 23702,
1871
+ 24109,
1872
+ 24518,
1873
+ 24929,
1874
+ 25342,
1875
+ 25756,
1876
+ 26173,
1877
+ 26591,
1878
+ 27010,
1879
+ 27431,
1880
+ 27853,
1881
+ 28276,
1882
+ 28701,
1883
+ 29126,
1884
+ 29552,
1885
+ 29979,
1886
+ 30407,
1887
+ 30836,
1888
+ 31264,
1889
+ 31694,
1890
+ 32123,
1891
+ 32553,
1892
+ 32983,
1893
+ 33413,
1894
+ 33842,
1895
+ 34272,
1896
+ 34700,
1897
+ 35129,
1898
+ 35557,
1899
+ 35984,
1900
+ 36410,
1901
+ 36835,
1902
+ 37260,
1903
+ 37683,
1904
+ 38105,
1905
+ 38526,
1906
+ 38945,
1907
+ 39363,
1908
+ 39780,
1909
+ 40194,
1910
+ 40607,
1911
+ 41018,
1912
+ 41427,
1913
+ 41834,
1914
+ 42239,
1915
+ 42642,
1916
+ 43042,
1917
+ 43440,
1918
+ 43835,
1919
+ 44228,
1920
+ 44618,
1921
+ 45006,
1922
+ 45390,
1923
+ 45772,
1924
+ 46151,
1925
+ 46527,
1926
+ 46899,
1927
+ 47269,
1928
+ 47635,
1929
+ 47998,
1930
+ 48358,
1931
+ 48714,
1932
+ 49067,
1933
+ 49417,
1934
+ 49762,
1935
+ 50105,
1936
+ 50443,
1937
+ 50778,
1938
+ 51109,
1939
+ 51437,
1940
+ 51760,
1941
+ 52080,
1942
+ 52396,
1943
+ 52708,
1944
+ 53016,
1945
+ 53320,
1946
+ 53620,
1947
+ 53917,
1948
+ 54209,
1949
+ 54497,
1950
+ 54781,
1951
+ 55061,
1952
+ 55337,
1953
+ 55609,
1954
+ 55876,
1955
+ 56140,
1956
+ 56400,
1957
+ 56655,
1958
+ 56906,
1959
+ 57154,
1960
+ 57397,
1961
+ 57636,
1962
+ 57871,
1963
+ 58102,
1964
+ 58330,
1965
+ 58553,
1966
+ 58772,
1967
+ 58987,
1968
+ 59198,
1969
+ 59405,
1970
+ 59608,
1971
+ 59808,
1972
+ 60003,
1973
+ 60195,
1974
+ 60383,
1975
+ 60567,
1976
+ 60747,
1977
+ 60924,
1978
+ 61097,
1979
+ 61266,
1980
+ 61432,
1981
+ 61594,
1982
+ 61753,
1983
+ 61908,
1984
+ 62059,
1985
+ 62208,
1986
+ 62353,
1987
+ 62494,
1988
+ 62632,
1989
+ 62767,
1990
+ 62899,
1991
+ 63028,
1992
+ 63153,
1993
+ 63276,
1994
+ 63395,
1995
+ 63512,
1996
+ 63625,
1997
+ 63736,
1998
+ 63844,
1999
+ 63949,
2000
+ 64051,
2001
+ 64151,
2002
+ 64248,
2003
+ 64342,
2004
+ 64434,
2005
+ 64523,
2006
+ 64610,
2007
+ 64695,
2008
+ 64777,
2009
+ 64856,
2010
+ 64934,
2011
+ 65009,
2012
+ 65082,
2013
+ 65153,
2014
+ 65222,
2015
+ 65289,
2016
+ 65354,
2017
+ 65416,
2018
+ 65477,
2019
+ 65536
2020
+ ];
2021
+
2022
+ // color/sigma-gradient-stops.ts
2023
+ function sigmaGradientStops(stops) {
2024
+ if (stops.length !== 2 || stops[0]?.offset !== 0 || stops[1]?.offset !== 1) return void 0;
2025
+ if (stops.some((stop) => (stop.opacity ?? 1) !== 1)) return void 0;
2026
+ const front = hexToRgbChannels(stops[0].color);
2027
+ const back = hexToRgbChannels(stops[1].color);
2028
+ if (!front || !back) return void 0;
2029
+ return OFFICE_SIGMA_FACTORS.map((value, index) => {
2030
+ const factor = value / 65536;
2031
+ const mix = (a, b) => toHex(255 * ((a / 255) ** 2.2 * (1 - factor) + (b / 255) ** 2.2 * factor) ** (1 / 2.2));
2032
+ return {
2033
+ offset: Math.fround(index / 255),
2034
+ color: `#${mix(front.r, back.r)}${mix(front.g, back.g)}${mix(front.b, back.b)}`,
2035
+ opacity: 1
2036
+ };
2037
+ });
2038
+ }
2039
+
2040
+ // color/hex-rgb.ts
2041
+ function parseArgbHex(hex) {
2042
+ const clean2 = hex.replace(/^#/, "");
2043
+ const rgb = clean2.length === 8 ? clean2.slice(2) : clean2;
2044
+ if (!/^[0-9a-fA-F]{6}$/.test(rgb)) return void 0;
2045
+ return [0, 2, 4].map((i) => parseInt(rgb.slice(i, i + 2), 16));
2046
+ }
2047
+
2048
+ // drawingml/ordered-color-transforms.ts
2049
+ function orderedColorTransforms(channels, transforms) {
2050
+ let { r, g, b } = channels;
2051
+ let alpha = 1;
2052
+ const wrap = (value) => (value % 360 + 360) % 360;
2053
+ for (const transform of transforms) {
2054
+ const { name, value } = transform;
2055
+ const fraction = parseDrawingFraction(value);
2056
+ if (name === "alpha" && fraction !== void 0) alpha = clampUnitInterval(fraction);
2057
+ else if (name === "alphaMod" && fraction !== void 0)
2058
+ alpha = clampUnitInterval(alpha * fraction);
2059
+ else if (name === "alphaOff" && fraction !== void 0)
2060
+ alpha = clampUnitInterval(alpha + fraction);
2061
+ else if (name === "inv") [r, g, b] = [255 - r, 255 - g, 255 - b];
2062
+ else if (name === "gray") r = g = b = 0.299 * r + 0.587 * g + 0.114 * b;
2063
+ else if ((name === "shade" || name === "tint") && fraction !== void 0) {
2064
+ const mix = (channel) => linearToSrgb255(
2065
+ name === "shade" ? srgb255ToLinear(channel) * fraction : 1 - (1 - srgb255ToLinear(channel)) * fraction
2066
+ );
2067
+ [r, g, b] = [mix(r), mix(g), mix(b)];
2068
+ } else {
2069
+ const hsl = rgbToHsl(r, g, b);
2070
+ if (name === "comp") hsl.h = wrap(hsl.h + 180);
2071
+ else if (name === "hue") {
2072
+ const hue = parseDrawingHueDegrees(value);
2073
+ if (hue !== void 0) hsl.h = wrap(hue);
2074
+ } else if (name === "hueOff") {
2075
+ const hue = parseDrawingHueDegrees(value);
2076
+ if (hue !== void 0) hsl.h = wrap(hsl.h + hue);
2077
+ } else if (name === "hueMod" && fraction !== void 0) hsl.h = wrap(hsl.h * fraction);
2078
+ else if (name === "sat" && fraction !== void 0) hsl.s = clampUnitInterval(fraction);
2079
+ else if (name === "satMod" && fraction !== void 0) hsl.s *= fraction;
2080
+ else if (name === "satOff" && fraction !== void 0)
2081
+ hsl.s = clampUnitInterval(hsl.s + fraction);
2082
+ else if (name === "lum" && fraction !== void 0) hsl.l = clampUnitInterval(fraction);
2083
+ else if (name === "lumMod" && fraction !== void 0)
2084
+ hsl.l = clampUnitInterval(hsl.l * fraction);
2085
+ else if (name === "lumOff" && fraction !== void 0)
2086
+ hsl.l = clampUnitInterval(hsl.l + fraction);
2087
+ else continue;
2088
+ ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, (channel) => channel, {
2089
+ clampSaturation: false
2090
+ }));
2091
+ }
2092
+ }
2093
+ return { r, g, b, alpha };
2094
+ }
2095
+
1759
2096
  // drawingml/drawing-color.ts
2097
+ var COLOR_ELEMENTS = {
2098
+ srgbClr: "srgb",
2099
+ schemeClr: "scheme",
2100
+ sysClr: "system",
2101
+ prstClr: "preset",
2102
+ scrgbClr: "scrgb",
2103
+ hslClr: "hsl"
2104
+ };
2105
+ function colorValue(kind, element) {
2106
+ const attribute = (name) => element.getAttribute(name) ?? "";
2107
+ if (kind === "scrgb") return `${attribute("r")},${attribute("g")},${attribute("b")}`;
2108
+ if (kind === "hsl") return `${attribute("hue")},${attribute("sat")},${attribute("lum")}`;
2109
+ return attribute("val");
2110
+ }
2111
+ function parseDrawingColorIn(container) {
2112
+ if (!container) return void 0;
2113
+ for (const element of elements(container)) {
2114
+ const kind = COLOR_ELEMENTS[element.localName];
2115
+ if (!kind || element.namespaceURI && element.namespaceURI !== NS.a) continue;
2116
+ return parseDrawingColor(element);
2117
+ }
2118
+ return void 0;
2119
+ }
2120
+ function parseDrawingColor(element) {
2121
+ const kind = COLOR_ELEMENTS[element.localName];
2122
+ if (!kind) return void 0;
2123
+ const color = {
2124
+ kind,
2125
+ value: colorValue(kind, element),
2126
+ transforms: elements(element).map((child) => ({
2127
+ name: child.localName,
2128
+ value: child.getAttribute("val") ?? ""
2129
+ }))
2130
+ };
2131
+ const fallback = kind === "system" ? element.getAttribute("lastClr") : null;
2132
+ if (fallback) color.fallback = fallback;
2133
+ return color;
2134
+ }
1760
2135
  var PRESET_COLORS = {
1761
2136
  black: "#000000",
1762
2137
  white: "#FFFFFF",
@@ -1816,6 +2191,17 @@ function resolveDrawingColor(color, theme, options) {
1816
2191
  const base = baseHex(color, theme);
1817
2192
  const rgb = base ? hexToRgbChannels(base) : null;
1818
2193
  if (!rgb) return void 0;
2194
+ if (options?.transformOrder === "document") {
2195
+ const value = orderedColorTransforms(rgb, color.transforms);
2196
+ const round = options.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
2197
+ return {
2198
+ hex: `#${toHex(round(value.r))}${toHex(round(value.g))}${toHex(round(value.b))}`,
2199
+ alpha: value.alpha,
2200
+ unapplied: [...new Set(color.transforms.map((transform) => transform.name))].filter(
2201
+ (name) => !APPLIED.has(name)
2202
+ )
2203
+ };
2204
+ }
1819
2205
  let { r, g, b } = rgb;
1820
2206
  const find = (name) => color.transforms.find((entry) => entry.name === name)?.value;
1821
2207
  const has = (name) => color.transforms.some((entry) => entry.name === name);
@@ -1858,7 +2244,7 @@ function resolveDrawingColor(color, theme, options) {
1858
2244
  if (lumMod !== void 0) hsl.l = clampUnitInterval(hsl.l * lumMod);
1859
2245
  const lumOff = parseDrawingFraction(find("lumOff"));
1860
2246
  if (lumOff !== void 0) hsl.l = clampUnitInterval(hsl.l + lumOff);
1861
- const round = Math.round;
2247
+ const round = options?.hslRounding === "halfDown" ? (value) => Math.ceil(value - 0.5) : Math.round;
1862
2248
  ({ r, g, b } = hslToRgb(hsl.h, hsl.s, hsl.l, round));
1863
2249
  }
1864
2250
  let alpha = parseDrawingPercent(find("alpha")) ?? 1;
@@ -1913,6 +2299,11 @@ function themeColorSlotFor(name, colorMap = {}) {
1913
2299
  if (name === "dk1" || name === "lt1" || name === "dk2" || name === "lt2") return name;
1914
2300
  return colorMap[name] ?? name;
1915
2301
  }
2302
+ function themeSlotHex(color) {
2303
+ if (!color) return void 0;
2304
+ const value = color.kind === "srgb" ? color.value : color.kind === "system" ? color.fallback : void 0;
2305
+ return value ? value.toUpperCase() : void 0;
2306
+ }
1916
2307
 
1917
2308
  // docx/theme-color.ts
1918
2309
  function isThemeColorToken(value) {
@@ -1922,6 +2313,11 @@ function fractionToThemeByte(fraction) {
1922
2313
  return toHex(Math.round(Math.min(1, Math.max(0, fraction)) * 255));
1923
2314
  }
1924
2315
 
2316
+ // opc/signature/xml-utils.ts
2317
+ function escapeXmlAttr(value) {
2318
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
2319
+ }
2320
+
1925
2321
  // docx/comment-spans.ts
1926
2322
  function rangeKeys(run) {
1927
2323
  const keys = (run.commentIds ?? []).map((id) => `comment:${id}`);
@@ -2212,24 +2608,24 @@ function updateDirection(doc, props, paragraph, base) {
2212
2608
  }
2213
2609
  }
2214
2610
  function updateSpacing(doc, props, paragraph, base) {
2215
- let spacing = first2(props, "spacing");
2216
- if (!spacing) {
2217
- spacing = makeW(doc, "spacing");
2218
- props.appendChild(spacing);
2611
+ let spacing2 = first2(props, "spacing");
2612
+ if (!spacing2) {
2613
+ spacing2 = makeW(doc, "spacing");
2614
+ props.appendChild(spacing2);
2219
2615
  }
2220
2616
  if (!base || paragraph.spacingBeforeTwips !== base.spacingBeforeTwips)
2221
- setWordValue(spacing, "before", paragraph.spacingBeforeTwips);
2617
+ setWordValue(spacing2, "before", paragraph.spacingBeforeTwips);
2222
2618
  if (!base || paragraph.spacingAfterTwips !== base.spacingAfterTwips)
2223
- setWordValue(spacing, "after", paragraph.spacingAfterTwips);
2619
+ setWordValue(spacing2, "after", paragraph.spacingAfterTwips);
2224
2620
  if (!base || paragraph.lineSpacingTwips !== base.lineSpacingTwips || paragraph.lineSpacingRule !== base.lineSpacingRule) {
2225
- setWordValue(spacing, "line", paragraph.lineSpacingTwips);
2621
+ setWordValue(spacing2, "line", paragraph.lineSpacingTwips);
2226
2622
  setWordValue(
2227
- spacing,
2623
+ spacing2,
2228
2624
  "lineRule",
2229
2625
  paragraph.lineSpacingRule ?? (paragraph.lineSpacingTwips === void 0 ? void 0 : "auto")
2230
2626
  );
2231
2627
  }
2232
- if (!spacing.attributes.length && !spacing.childNodes.length) props.removeChild(spacing);
2628
+ if (!spacing2.attributes.length && !spacing2.childNodes.length) props.removeChild(spacing2);
2233
2629
  }
2234
2630
  function updateIndent(doc, props, paragraph, base) {
2235
2631
  let indent = first2(props, "ind");
@@ -2552,10 +2948,10 @@ function hasUnexpectedAttributes(element, allowed, allowDateUtc = false) {
2552
2948
  }
2553
2949
  return false;
2554
2950
  }
2555
- function runPropertiesHaveUnknownContent(properties3) {
2556
- if (!properties3) return false;
2557
- if (hasUnexpectedAttributes(properties3, [])) return true;
2558
- for (const node of Array.from(properties3.childNodes)) {
2951
+ function runPropertiesHaveUnknownContent(properties4) {
2952
+ if (!properties4) return false;
2953
+ if (hasUnexpectedAttributes(properties4, [])) return true;
2954
+ for (const node of Array.from(properties4.childNodes)) {
2559
2955
  if (node.nodeType !== 1) {
2560
2956
  if (node.nodeType === 3 && node.textContent?.trim()) return true;
2561
2957
  continue;
@@ -2659,9 +3055,9 @@ function setExtendedRunProperties(doc, props, run, base) {
2659
3055
  if (changed("characterSpacingTwips")) {
2660
3056
  removeChildren2(props, "spacing");
2661
3057
  if (run.characterSpacingTwips !== void 0) {
2662
- const spacing = makeW(doc, "spacing");
2663
- setAttribute5(spacing, "val", String(Math.round(run.characterSpacingTwips)));
2664
- props.appendChild(spacing);
3058
+ const spacing2 = makeW(doc, "spacing");
3059
+ setAttribute5(spacing2, "val", String(Math.round(run.characterSpacingTwips)));
3060
+ props.appendChild(spacing2);
2665
3061
  }
2666
3062
  }
2667
3063
  if (changed("shadingFill") || changed("shadingThemeFill")) {
@@ -2759,13 +3155,13 @@ function buildWatermarkRun(doc, spec, uniqueId) {
2759
3155
  shape.setAttribute("stroked", "f");
2760
3156
  const fill = v("fill");
2761
3157
  fill.setAttribute("opacity", spec.semitransparent ? ".5" : "1");
2762
- const text = v("textpath");
2763
- text.setAttribute("style", `font-family:"${spec.fontFamily ?? "Calibri"}";font-size:1pt`);
2764
- text.setAttribute("string", spec.text);
3158
+ const text2 = v("textpath");
3159
+ text2.setAttribute("style", `font-family:"${spec.fontFamily ?? "Calibri"}";font-size:1pt`);
3160
+ text2.setAttribute("string", spec.text);
2765
3161
  const wrap = makeNS(doc, WORD10_NS, "w10:wrap");
2766
3162
  wrap.setAttribute("anchorx", "margin");
2767
3163
  wrap.setAttribute("anchory", "margin");
2768
- for (const child of [fill, text, wrap]) shape.appendChild(child);
3164
+ for (const child of [fill, text2, wrap]) shape.appendChild(child);
2769
3165
  pict.appendChild(type);
2770
3166
  pict.appendChild(shape);
2771
3167
  run.appendChild(pict);
@@ -2785,15 +3181,15 @@ var add = (parent, ...items) => {
2785
3181
  var emu = (px) => String(Math.max(1, Math.round(px * EMU_PER_PIXEL)));
2786
3182
  var descendants = (root, ns, local) => Array.from(root.getElementsByTagNameNS(ns, local));
2787
3183
  function paragraphsFor(doc, lines) {
2788
- return (lines.length ? lines : [""]).map((line) => {
3184
+ return (lines.length ? lines : [""]).map((line2) => {
2789
3185
  const paragraph = makeW(doc, "p");
2790
- if (line) {
3186
+ if (line2) {
2791
3187
  const run = makeW(doc, "r");
2792
- const text = makeW(doc, "t");
2793
- if (/^\s|\s$/.test(line))
2794
- text.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
2795
- text.textContent = line;
2796
- add(run, text);
3188
+ const text2 = makeW(doc, "t");
3189
+ if (/^\s|\s$/.test(line2))
3190
+ text2.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
3191
+ text2.textContent = line2;
3192
+ add(run, text2);
2797
3193
  add(paragraph, run);
2798
3194
  }
2799
3195
  return paragraph;
@@ -2837,6 +3233,1960 @@ function patchTextBox(doc, drawing, image, base) {
2837
3233
  }
2838
3234
  }
2839
3235
 
3236
+ // drawingml/drawing-color-css.ts
3237
+ function drawingColorCss(value) {
3238
+ if (!value || value.alpha === 1) return value?.hex;
3239
+ const channels = [1, 3, 5].map(
3240
+ (offset) => Number.parseInt(value.hex.slice(offset, offset + 2), 16)
3241
+ );
3242
+ return `rgba(${channels.join(",")},${value.alpha})`;
3243
+ }
3244
+
3245
+ // drawingml/drawing-shadow.ts
3246
+ function resolveDrawingShadow(effects, theme) {
3247
+ const node = first(effects, "outerShdw", NS.a);
3248
+ if (!node) return void 0;
3249
+ const value = (key, fallback) => Number(node.getAttribute(key) ?? fallback);
3250
+ if (value("sx", 1e5) !== 1e5 || value("sy", 1e5) !== 1e5 || value("kx", 0) !== 0 || value("ky", 0) !== 0)
3251
+ return void 0;
3252
+ const color = parseDrawingColorIn(node);
3253
+ const resolved = color && resolveDrawingColor(color, theme, { transformOrder: "document" });
3254
+ const blur = value("blurRad", 0) / EMU_PER_PIXEL;
3255
+ const distance = value("dist", 0) / EMU_PER_PIXEL;
3256
+ const angle = value("dir", 0) / 6e4 * Math.PI / 180;
3257
+ if (!resolved || ![blur, distance, angle].every(Number.isFinite) || blur < 0 || distance < 0)
3258
+ return void 0;
3259
+ return {
3260
+ color: resolved.hex,
3261
+ opacity: resolved.alpha,
3262
+ blur,
3263
+ dx: Math.cos(angle) * distance,
3264
+ dy: Math.sin(angle) * distance
3265
+ };
3266
+ }
3267
+ function resolveDrawingShadowXml(xml, theme) {
3268
+ return xml ? resolveDrawingShadow(parseXml(xml).documentElement, theme) : void 0;
3269
+ }
3270
+ function svgDropShadowElement(s, format) {
3271
+ const num = format.number;
3272
+ 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"/>`;
3273
+ }
3274
+ function hexToRgb(color) {
3275
+ const parsed = hexToRgbChannels(color);
3276
+ if (parsed) return parsed;
3277
+ const hex = color.replace("#", "");
3278
+ return {
3279
+ r: Number.parseInt(hex.slice(0, 2), 16) || 0,
3280
+ g: Number.parseInt(hex.slice(2, 4), 16) || 0,
3281
+ b: Number.parseInt(hex.slice(4, 6), 16) || 0
3282
+ };
3283
+ }
3284
+ function toHexChannel(value) {
3285
+ return toHex(value).toLowerCase();
3286
+ }
3287
+ function lerpStops(a, b, t) {
3288
+ const ca = hexToRgb(a.color);
3289
+ const cb = hexToRgb(b.color);
3290
+ const oa = a.opacity ?? 1;
3291
+ const ob = b.opacity ?? 1;
3292
+ return {
3293
+ 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)}`,
3294
+ opacity: oa + (ob - oa) * t
3295
+ };
3296
+ }
3297
+ function colorAt(stops, position) {
3298
+ const first3 = stops[0];
3299
+ const last = stops[stops.length - 1];
3300
+ if (position <= first3.position) {
3301
+ return { color: first3.color, opacity: first3.opacity ?? 1 };
3302
+ }
3303
+ if (position >= last.position) {
3304
+ return { color: last.color, opacity: last.opacity ?? 1 };
3305
+ }
3306
+ for (let i = 0; i < stops.length - 1; i += 1) {
3307
+ const from = stops[i];
3308
+ const to = stops[i + 1];
3309
+ if (position >= from.position && position <= to.position) {
3310
+ const span = to.position - from.position;
3311
+ const t = span > 0 ? (position - from.position) / span : 0;
3312
+ return lerpStops(from, to, t);
3313
+ }
3314
+ }
3315
+ return { color: last.color, opacity: last.opacity ?? 1 };
3316
+ }
3317
+ function resolveInnerRect(fillToRect, focalPoint) {
3318
+ let centerX = 50;
3319
+ let centerY = 50;
3320
+ let width = 0;
3321
+ let height = 0;
3322
+ if (fillToRect) {
3323
+ const { l, t, r, b } = fillToRect;
3324
+ centerX = (l + (1 - r)) / 2 * 100;
3325
+ centerY = (t + (1 - b)) / 2 * 100;
3326
+ width = Math.max(0, Math.min(1, 1 - l - r)) * 100;
3327
+ height = Math.max(0, Math.min(1, 1 - t - b)) * 100;
3328
+ }
3329
+ return {
3330
+ left: centerX - width / 2,
3331
+ top: centerY - height / 2,
3332
+ right: centerX + width / 2,
3333
+ bottom: centerY + height / 2
3334
+ };
3335
+ }
3336
+ function lerpEdge(inner, outer, t) {
3337
+ return inner + (outer - inner) * t;
3338
+ }
3339
+ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
3340
+ if (stops.length === 0) {
3341
+ return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
3342
+ }
3343
+ const sorted = [...stops].sort((a, b) => a.position - b.position);
3344
+ const inner = resolveInnerRect(fillToRect);
3345
+ const rects = [];
3346
+ const alphaRects = [];
3347
+ const masked = sorted.some((stop) => (stop.opacity ?? 1) < 1);
3348
+ const bands = options?.bands;
3349
+ if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
3350
+ for (let i = bands; i >= 0; i -= 1) {
3351
+ const t = i / bands;
3352
+ const { color, opacity } = colorAt(sorted, t * 100);
3353
+ const left = lerpEdge(inner.left, 0, t);
3354
+ const top = lerpEdge(inner.top, 0, t);
3355
+ const right = lerpEdge(inner.right, 100, t);
3356
+ const bottom = lerpEdge(inner.bottom, 100, t);
3357
+ const opacityAttr = !masked && opacity < 1 ? ` fill-opacity="${Math.max(0, opacity).toFixed(3)}"` : "";
3358
+ rects.push(
3359
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="${color}"${opacityAttr}/>`
3360
+ );
3361
+ if (masked) {
3362
+ const channel = toHexChannel(opacity * 255);
3363
+ alphaRects.push(
3364
+ `<rect x="${left.toFixed(2)}" y="${top.toFixed(2)}" width="${(right - left).toFixed(2)}" height="${(bottom - top).toFixed(2)}" fill="#${channel}${channel}${channel}"/>`
3365
+ );
3366
+ }
3367
+ }
3368
+ 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("");
3369
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">${paint}</svg>`;
3370
+ }
3371
+
3372
+ // chart/color-palettes.ts
3373
+ var COLORFUL_VARIATIONS = [
3374
+ {},
3375
+ { lumMod: 6e4 },
3376
+ { lumMod: 8e4, lumOff: 2e4 },
3377
+ { lumMod: 8e4 },
3378
+ { lumMod: 6e4, lumOff: 4e4 },
3379
+ { lumMod: 5e4 },
3380
+ { lumMod: 7e4, lumOff: 3e4 },
3381
+ { lumMod: 7e4 },
3382
+ { lumMod: 5e4, lumOff: 5e4 }
3383
+ ];
3384
+ var GRAY_VARIATIONS = [
3385
+ { tint: 88500 },
3386
+ { tint: 55e3 },
3387
+ { tint: 75e3 },
3388
+ { tint: 98500 },
3389
+ { tint: 3e4 },
3390
+ { tint: 6e4 },
3391
+ { tint: 8e4 }
3392
+ ];
3393
+ var ACCENTS = ["accent1", "accent2", "accent3", "accent4", "accent5", "accent6"];
3394
+ function colorful(id, index, base) {
3395
+ return { id, group: "colorful", index, meth: "cycle", base, variations: COLORFUL_VARIATIONS };
3396
+ }
3397
+ function mono(id, index, accent, meth) {
3398
+ return { id, group: "monochromatic", index, meth, base: [accent], variations: [] };
3399
+ }
3400
+ var CHART_COLOR_PALETTES = [
3401
+ colorful(10, 1, ACCENTS),
3402
+ colorful(11, 2, ["accent1", "accent3", "accent5"]),
3403
+ colorful(12, 3, ["accent2", "accent4", "accent6"]),
3404
+ colorful(13, 4, ["accent6", "accent5", "accent4"]),
3405
+ ...ACCENTS.map((accent, i) => mono(14 + i, 1 + i, accent, "withinLinear")),
3406
+ {
3407
+ id: 20,
3408
+ group: "monochromatic",
3409
+ index: 7,
3410
+ meth: "cycle",
3411
+ base: ["dk1"],
3412
+ variations: GRAY_VARIATIONS
3413
+ },
3414
+ ...ACCENTS.map((accent, i) => mono(21 + i, 8 + i, accent, "withinLinearReversed"))
3415
+ ];
3416
+ function findChartColorPalette(id) {
3417
+ return CHART_COLOR_PALETTES.find((palette) => palette.id === id);
3418
+ }
3419
+ function withinLinearTransform(i, n2) {
3420
+ if (n2 <= 1) {
3421
+ return {};
3422
+ }
3423
+ const step = 140 / (n2 + 1);
3424
+ const centre = (n2 - 1) / 2;
3425
+ const value = 100 - step * Math.abs(i - centre);
3426
+ if (i < centre) {
3427
+ return { shade: Math.floor(value + 1e-9) * 1e3 };
3428
+ }
3429
+ if (i > centre) {
3430
+ return { tint: Math.ceil(value - 1e-9) * 1e3 };
3431
+ }
3432
+ return {};
3433
+ }
3434
+ function chartPaletteSeriesColorChoice(palette, i, n2) {
3435
+ let base;
3436
+ let transform;
3437
+ if (palette.meth === "cycle") {
3438
+ base = palette.base[i % palette.base.length];
3439
+ const round = Math.floor(i / palette.base.length);
3440
+ transform = (palette.variations.length ? palette.variations[round % palette.variations.length] : {}) ?? {};
3441
+ } else {
3442
+ const index = palette.meth === "withinLinearReversed" ? n2 - 1 - i : i;
3443
+ base = palette.base[0];
3444
+ transform = withinLinearTransform(index, n2);
3445
+ }
3446
+ if (!base) throw new RangeError("A chart palette must have a base color");
3447
+ return {
3448
+ kind: "scheme",
3449
+ value: base,
3450
+ transforms: Object.entries(transform).map(([name, value]) => ({ name, value: String(value) }))
3451
+ };
3452
+ }
3453
+ function chartPaletteSeriesColor(palette, i, n2, scheme) {
3454
+ const choice = chartPaletteSeriesColorChoice(palette, i, n2);
3455
+ return (resolveDrawingColor(choice, { scheme: (name) => scheme[name] })?.hex ?? scheme[choice.value]).toUpperCase();
3456
+ }
3457
+
3458
+ // chart/style-definition.ts
3459
+ var CHART_STYLE_PARTS = [
3460
+ "title",
3461
+ "axisTitle",
3462
+ "categoryAxis",
3463
+ "valueAxis",
3464
+ "legend",
3465
+ "dataLabel",
3466
+ "dataPoint",
3467
+ "dataPointLine",
3468
+ "gridlineMajor",
3469
+ "gridlineMinor",
3470
+ "chartArea",
3471
+ "plotArea"
3472
+ ];
3473
+ function resolveChartStyleDefinition(style, resolve) {
3474
+ const out = {};
3475
+ const fillColor = (fill) => fill?.kind === "none" ? "none" : fill?.kind === "solid" ? resolve(fill.color) : void 0;
3476
+ for (const name of CHART_STYLE_PARTS) {
3477
+ const source = style.entries[name];
3478
+ if (!source) continue;
3479
+ const entry = {};
3480
+ for (const key of ["fontSize", "bold", "italic", "underline"]) {
3481
+ const value = source[key];
3482
+ if (value !== void 0) Object.assign(entry, { [key]: value });
3483
+ }
3484
+ const line2 = fillColor(source.line?.fill) ?? (source.lineRef?.color && resolve(source.lineRef.color));
3485
+ const fill = fillColor(source.fill) ?? (source.fillRef?.color && resolve(source.fillRef.color));
3486
+ const color = (source.textColor && resolve(source.textColor)) ?? (source.fontRef?.color && resolve(source.fontRef.color));
3487
+ if (color !== void 0) entry.color = color;
3488
+ if (line2 !== void 0) entry.lineColor = line2;
3489
+ if (fill !== void 0) entry.fillColor = fill;
3490
+ if (source.line?.widthEmu !== void 0 && source.line.widthEmu > 0)
3491
+ entry.lineWidth = source.line.widthEmu / 12700;
3492
+ if (Object.keys(entry).length) out[name] = entry;
3493
+ }
3494
+ return Object.keys(out).length ? out : void 0;
3495
+ }
3496
+ function effectiveBuiltInChartStyle(formatting) {
3497
+ return formatting?.builtInStyle ?? (formatting?.sourceXml ? void 0 : 102);
3498
+ }
3499
+ function builtInChartTextStyle(id) {
3500
+ if (id === void 0 || !Number.isInteger(id) || !(id >= 1 && id <= 48 || id >= 101 && id <= 148))
3501
+ return {};
3502
+ const legacy = id > 100 ? id - 100 : id;
3503
+ const common = {
3504
+ sourceXml: "",
3505
+ fontSize: 10,
3506
+ bold: false,
3507
+ italic: false,
3508
+ fontRef: {
3509
+ index: "minor",
3510
+ color: { kind: "scheme", value: legacy >= 41 ? "lt1" : "tx1", transforms: [] }
3511
+ }
3512
+ };
3513
+ return {
3514
+ title: { ...common, fontSize: id > 100 ? 18 : 10, bold: true },
3515
+ categoryAxis: { ...common },
3516
+ valueAxis: { ...common },
3517
+ legend: { ...common }
3518
+ };
3519
+ }
3520
+
3521
+ // chart/manual-layout.ts
3522
+ function hasManualLayoutFields(layout) {
3523
+ return layout != null && (layout.x !== void 0 || layout.y !== void 0 || layout.width !== void 0 || layout.height !== void 0);
3524
+ }
3525
+ function resolveManualLayoutRect(layout, frame, auto) {
3526
+ if (!hasManualLayoutFields(layout)) return void 0;
3527
+ const x = layout.x === void 0 ? auto.x : layout.xMode === "edge" ? layout.x * frame.width : auto.x + layout.x * frame.width;
3528
+ const y = layout.y === void 0 ? auto.y : layout.yMode === "edge" ? layout.y * frame.height : auto.y + layout.y * frame.height;
3529
+ const width = layout.width === void 0 ? auto.width : layout.widthMode === "edge" ? layout.width * frame.width - x : layout.width * frame.width;
3530
+ const height = layout.height === void 0 ? auto.height : layout.heightMode === "edge" ? layout.height * frame.height - y : layout.height * frame.height;
3531
+ return { x, y, width: Math.max(width, 1), height: Math.max(height, 1) };
3532
+ }
3533
+
3534
+ // chart/gradient-stop-edit.ts
3535
+ function sortGradientStops(stops) {
3536
+ return stops.slice().sort((a, b) => a.position - b.position);
3537
+ }
3538
+
3539
+ // chart/gradient-coincident-stops.ts
3540
+ var NATIVE_COINCIDENT_STOP_RAMP = 1 / 256;
3541
+ function spreadCoincidentStops(stops) {
3542
+ const out = [];
3543
+ for (const [index, stop] of stops.entries()) {
3544
+ const source = stops[index - 1];
3545
+ const previous = out.at(-1);
3546
+ const next = stops[index + 1];
3547
+ if (!source || !previous || stop.offset !== source.offset || stop.color === source.color && (stop.opacity ?? 1) === (source.opacity ?? 1)) {
3548
+ out.push(stop);
3549
+ continue;
3550
+ }
3551
+ const limit = Math.min(1, next ? next.offset : 1);
3552
+ out.push({
3553
+ ...stop,
3554
+ offset: Math.max(stop.offset, Math.min(previous.offset + NATIVE_COINCIDENT_STOP_RAMP, limit))
3555
+ });
3556
+ }
3557
+ return out;
3558
+ }
3559
+
3560
+ // chart/gradient-definition.ts
3561
+ function resolveChartGradient(fill, resolve) {
3562
+ const focus = fill.fillToRect;
3563
+ const stops = fill.stops.flatMap((stop) => {
3564
+ const color = resolve(stop.color);
3565
+ return color ? [{ position: stop.position, color: color.hex, opacity: color.alpha }] : [];
3566
+ });
3567
+ return {
3568
+ type: fill.path ? "radial" : "linear",
3569
+ stops,
3570
+ ...fill.angle === void 0 ? {} : { angle: fill.angle },
3571
+ ...fill.scaled === void 0 ? {} : { scaled: fill.scaled },
3572
+ ...fill.path === void 0 ? {} : { path: fill.path },
3573
+ ...focus === void 0 ? {} : { fillToRect: { ...focus } },
3574
+ // Native opaque endpoint-pair linear, rect, circle and rectangular-shape profiles.
3575
+ ...(!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" } : {},
3576
+ ...focus ? { focalPoint: { x: (1 + focus.l - focus.r) / 2, y: (1 + focus.t - focus.b) / 2 } } : {}
3577
+ };
3578
+ }
3579
+ function buildChartGradientDef(id, fill, bounds) {
3580
+ const sourceStops = sortGradientStops(fill.stops).map((stop) => ({
3581
+ offset: Math.min(Math.max(stop.position / 100, 0), 1),
3582
+ color: stop.color,
3583
+ ...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
3584
+ }));
3585
+ const stops = fill.interpolation === "sigma-gamma22" ? sigmaGradientStops(sourceStops) ?? sourceStops : sourceStops;
3586
+ if (fill.type === "radial" && (fill.path === "rect" || fill.path === "shape" && bounds?.shape === "rect")) {
3587
+ const markup = buildRectPathGradientSvg(
3588
+ stops.map((stop) => ({
3589
+ position: stop.offset * 100,
3590
+ color: stop.color,
3591
+ ...stop.opacity === void 0 ? {} : { opacity: stop.opacity }
3592
+ })),
3593
+ void 0,
3594
+ fill.fillToRect,
3595
+ { bands: 1024}
3596
+ );
3597
+ return {
3598
+ kind: "rectPath",
3599
+ id,
3600
+ href: `data:image/svg+xml,${encodeURIComponent(markup)}`,
3601
+ stops
3602
+ };
3603
+ }
3604
+ if (fill.type === "radial") {
3605
+ const cx = fill.focalPoint?.x ?? 0.5;
3606
+ const cy = fill.focalPoint?.y ?? 0.5;
3607
+ 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;
3608
+ return {
3609
+ kind: "radialGradient",
3610
+ id,
3611
+ cx,
3612
+ cy,
3613
+ r: Math.max(
3614
+ ...[0, 1].flatMap((x) => [0, 1].map((y) => Math.hypot(x - cx, (y - cy) * aspect)))
3615
+ ),
3616
+ ...aspect === 1 ? {} : { gradientTransform: `matrix(1 0 0 ${1 / aspect} 0 ${cy * (1 - 1 / aspect)})` },
3617
+ stops
3618
+ };
3619
+ }
3620
+ const rad = (fill.angle ?? 0) * Math.PI / 180;
3621
+ const span = fill.scaled ? Math.abs(Math.cos(rad)) + Math.abs(Math.sin(rad)) : 1;
3622
+ const dx = Math.cos(rad) * span / 2;
3623
+ const dy = Math.sin(rad) * span / 2;
3624
+ const round = (value) => Math.round(value * 1e4) / 1e4;
3625
+ return {
3626
+ kind: "linearGradient",
3627
+ id,
3628
+ x1: round(0.5 - dx),
3629
+ y1: round(0.5 - dy),
3630
+ x2: round(0.5 + dx),
3631
+ y2: round(0.5 + dy),
3632
+ stops: spreadCoincidentStops(stops)
3633
+ };
3634
+ }
3635
+
3636
+ // chart/gradient-markup.ts
3637
+ function chartGradientMarkup(def) {
3638
+ if (def.kind === "rectPath")
3639
+ 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>`;
3640
+ 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}"`;
3641
+ const stops = def.stops.map(
3642
+ (stop) => `<stop offset="${stop.offset}" stop-color="${escapeXmlAttr(stop.color)}" stop-opacity="${stop.opacity ?? 1}"/>`
3643
+ ).join("");
3644
+ const transform = def.kind === "radialGradient" && def.gradientTransform ? ` gradientTransform="${escapeXmlAttr(def.gradientTransform)}"` : "";
3645
+ return `<${def.kind} id="${escapeXmlAttr(def.id)}" ${geometry}${transform}>${stops}</${def.kind}>`;
3646
+ }
3647
+
3648
+ // chart/bar-cluster-geometry.ts
3649
+ function clusteredBarGeometry(barGroupWidth, seriesCount, chartData) {
3650
+ const overlap = chartData.barOverlap ?? 0;
3651
+ const overlapSpan = 1 + (seriesCount - 1) * (1 - overlap / 100);
3652
+ const singleBarWidth = chartData.barGapWidth !== void 0 ? barGroupWidth / (overlapSpan + Math.max(chartData.barGapWidth, 0) / 100) : barGroupWidth * 0.7 / seriesCount;
3653
+ const step = singleBarWidth * (1 - overlap / 100);
3654
+ return { singleBarWidth, step, clusterWidth: singleBarWidth + step * (seriesCount - 1) };
3655
+ }
3656
+
3657
+ // chart/data-cache.ts
3658
+ function chartCacheValues(cache) {
3659
+ if (!cache) return [];
3660
+ const numeric = cache.type === "number";
3661
+ const out = [];
3662
+ for (const point of cache.points) {
3663
+ const text2 = point.value;
3664
+ out[point.index ?? out.length] = numeric && text2.trim() !== "" && Number.isFinite(Number(text2)) ? Number(text2) : text2;
3665
+ }
3666
+ const size = Math.max(cache.pointCount ?? 0, out.length);
3667
+ for (let index = 0; index < size; index++) if (out[index] === void 0) out[index] = "";
3668
+ return out;
3669
+ }
3670
+ var chartSourceValues = (source) => chartCacheValues(source?.cache ?? source?.levels?.[0]);
3671
+
3672
+ // chart/render/summary-from-space.ts
3673
+ var solidColor = (fill) => fill?.kind === "solid" ? fill.color : void 0;
3674
+ var isSolidFill = (fill) => fill?.kind === "solid" || fill?.kind === "unsupported" && fill.element === "solidFill";
3675
+ var GROUP_TYPES = {
3676
+ bar: "bar",
3677
+ line: "line",
3678
+ area: "area",
3679
+ pie: "pie",
3680
+ ofPie: "pie",
3681
+ doughnut: "doughnut",
3682
+ scatter: "scatter",
3683
+ radar: "radar",
3684
+ bubble: "bubble",
3685
+ stock: "stock",
3686
+ surface: "surface"
3687
+ };
3688
+ var GROUPINGS = /* @__PURE__ */ new Set(["clustered", "stacked", "percentStacked", "standard"]);
3689
+ function chartSummarySeries(source, chartType) {
3690
+ const categories = source.categories ?? source.xValues;
3691
+ const values = source.values ?? source.yValues;
3692
+ const out = {
3693
+ categories: chartSourceValues(categories),
3694
+ values: chartSourceValues(values).map(
3695
+ (v) => typeof v === "number" ? v : v === "" ? null : Number.isFinite(Number(v)) ? Number(v) : null
3696
+ )
3697
+ };
3698
+ if (source.tx?.text !== void 0) out.name = source.tx.text;
3699
+ const nameRef = source.tx?.reference?.formula;
3700
+ if (nameRef) out.nameRef = nameRef;
3701
+ if (categories?.formula) out.categoriesRef = categories.formula;
3702
+ if (values?.formula) out.valuesRef = values.formula;
3703
+ if (source.spPr?.effectsXml) out.effectsXml = source.spPr.effectsXml;
3704
+ const primary = ["line", "scatter", "radar"].includes(chartType) ? source.spPr?.line?.fill : source.spPr?.fill;
3705
+ const fill = chartType === "scatter" && !isSolidFill(primary) ? source.marker?.spPr?.fill : primary;
3706
+ const drawingColor = solidColor(fill);
3707
+ if (drawingColor) out.drawingColor = drawingColor;
3708
+ if (fill && fill.kind !== "solid" && !(chartType === "scatter" && fill.kind === "none"))
3709
+ out.fill = fill;
3710
+ const points = {};
3711
+ const pointFills = {};
3712
+ for (const point of source.dataPoints) {
3713
+ const properties4 = point.spPr ?? point.marker?.spPr;
3714
+ if (point.index === void 0) continue;
3715
+ const pointColor = solidColor(properties4?.fill);
3716
+ if (pointColor) points[point.index] = pointColor;
3717
+ if (properties4?.fill && properties4.fill.kind !== "solid")
3718
+ pointFills[point.index] = properties4.fill;
3719
+ }
3720
+ if (Object.keys(points).length) out.pointColors = points;
3721
+ if (Object.keys(pointFills).length) out.pointFills = pointFills;
3722
+ return out;
3723
+ }
3724
+ function chartSummaryFromSpace(chartSpace, extras = {}) {
3725
+ const group = chartSpace.plotArea.groups[0];
3726
+ let chartType = group ? GROUP_TYPES[group.kind] : "column";
3727
+ if (chartType === "bar" && group?.barDirection !== "bar") chartType = "column";
3728
+ const series = (group?.series ?? []).map((source) => chartSummarySeries(source, chartType));
3729
+ const summary = {
3730
+ chartType,
3731
+ series,
3732
+ showLegend: chartSpace.legend !== void 0
3733
+ };
3734
+ const grouping = group?.grouping;
3735
+ if (grouping && GROUPINGS.has(grouping))
3736
+ summary.grouping = grouping;
3737
+ if (chartType === "bar" || chartType === "column") {
3738
+ for (const [value, field, fallback, min, max] of [
3739
+ [group?.gapWidth, "barGapWidth", 150, 0, 500],
3740
+ [group?.overlap, "barOverlap", 0, -100, 100]
3741
+ ]) {
3742
+ const resolved = value ?? fallback;
3743
+ if (Number.isInteger(resolved) && resolved >= min && resolved <= max)
3744
+ summary[field] = resolved;
3745
+ }
3746
+ }
3747
+ if (chartSpace.title && chartSpace.autoTitleDeleted !== true) {
3748
+ const title = chartSpace.title.text;
3749
+ if (title !== void 0) summary.title = title;
3750
+ else if (series.length === 1 && series[0]?.name) summary.title = series[0].name;
3751
+ }
3752
+ const legendPos = chartSpace.legend?.position;
3753
+ if (legendPos && ["r", "l", "t", "b", "tr"].includes(legendPos))
3754
+ summary.legendPosition = legendPos;
3755
+ if (extras.formatting) summary.formatting = extras.formatting;
3756
+ if (extras.colorPalette !== void 0) summary.colorPalette = extras.colorPalette;
3757
+ if (extras.styleDefinition) summary.styleDefinition = extras.styleDefinition;
3758
+ return summary;
3759
+ }
3760
+
3761
+ // chart/render/chart-scale.ts
3762
+ var clean = (n2) => Number(n2.toPrecision(12));
3763
+ function* units(raw) {
3764
+ let exp = Math.floor(Math.log10(raw)) - 1;
3765
+ for (; ; ) {
3766
+ const base = 10 ** exp;
3767
+ for (const m of [1, 2, 5]) yield clean(m * base);
3768
+ exp++;
3769
+ }
3770
+ }
3771
+ function niceScale(dataMin, dataMax, options = {}) {
3772
+ const maxIntervals = Math.max(1, options.maxIntervals ?? 10);
3773
+ let lo = Number.isFinite(dataMin) ? dataMin : 0;
3774
+ let hi = Number.isFinite(dataMax) ? dataMax : 0;
3775
+ if (lo > hi) [lo, hi] = [hi, lo];
3776
+ if (lo === hi) {
3777
+ if (lo === 0) hi = 1;
3778
+ else if (options.noZero) {
3779
+ const pad = Math.abs(lo) * 0.1 || 1;
3780
+ lo -= pad;
3781
+ hi += pad;
3782
+ } else if (lo > 0) lo = 0;
3783
+ else hi = 0;
3784
+ }
3785
+ let fixedLo = false;
3786
+ let fixedHi = false;
3787
+ if (!options.noZero) {
3788
+ if (lo >= 0 && hi - lo >= hi / 6) {
3789
+ lo = 0;
3790
+ fixedLo = true;
3791
+ } else if (hi <= 0 && hi - lo >= -lo / 6) {
3792
+ hi = 0;
3793
+ fixedHi = true;
3794
+ }
3795
+ }
3796
+ const range = hi - lo;
3797
+ const top = fixedHi ? hi : hi + range * 0.05;
3798
+ const bottom = fixedLo ? lo : lo - range * 0.05;
3799
+ for (const unit of units(range / maxIntervals)) {
3800
+ const min = fixedLo ? lo : Math.floor(clean(bottom / unit)) * unit;
3801
+ const max = fixedHi ? hi : Math.ceil(clean(top / unit)) * unit;
3802
+ const intervals = Math.round((max - min) / unit);
3803
+ if (intervals <= maxIntervals && intervals > 0) {
3804
+ const ticks = [];
3805
+ for (let i = 0; i <= intervals; i++) ticks.push(clean(min + i * unit));
3806
+ return { min: clean(min), max: clean(max), majorUnit: unit, ticks };
3807
+ }
3808
+ }
3809
+ return { min: lo, max: hi, majorUnit: range, ticks: [lo, hi] };
3810
+ }
3811
+ var PERCENT_SCALE = {
3812
+ min: 0,
3813
+ max: 1,
3814
+ majorUnit: 0.1,
3815
+ ticks: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
3816
+ };
3817
+ function formatAxisValue(value, percent = false) {
3818
+ if (percent) return `${clean(value * 100)}%`;
3819
+ const v = clean(value);
3820
+ if (Math.abs(v) >= 1e15 || v !== 0 && Math.abs(v) < 1e-6)
3821
+ return v.toExponential(2).replace("e+", "E+").replace("e-", "E-");
3822
+ const [int = "0", frac] = String(Math.abs(v)).split(".");
3823
+ const grouped = int.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
3824
+ return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
3825
+ }
3826
+
3827
+ // chart/render/chart-svg-util.ts
3828
+ var TEXT_COLOR = "#595959";
3829
+ var GRID_COLOR = "#D9D9D9";
3830
+ var AXIS_COLOR = "#BFBFBF";
3831
+ var FONT_SIZE = 10;
3832
+ function esc(text2) {
3833
+ return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3834
+ }
3835
+ var n = (value) => String(Math.round(value * 100) / 100);
3836
+ var textWidth = (text2, size = FONT_SIZE) => text2.length * size * 0.55;
3837
+ function text(x, y, content, attrs = {}) {
3838
+ const parts = [`x="${n(x)}"`, `y="${n(y)}"`];
3839
+ parts.push(`font-size="${attrs.size ?? FONT_SIZE}"`);
3840
+ parts.push(`fill="${esc(attrs.fill ?? TEXT_COLOR)}"`);
3841
+ if (attrs.anchor && attrs.anchor !== "start") parts.push(`text-anchor="${attrs.anchor}"`);
3842
+ if (attrs.weight) parts.push(`font-weight="${attrs.weight}"`);
3843
+ if (attrs.baseline) parts.push(`dominant-baseline="${attrs.baseline}"`);
3844
+ if (attrs.family) parts.push(`font-family="${esc(attrs.family)}"`);
3845
+ if (attrs.filter) parts.push(`filter="${esc(attrs.filter)}"`);
3846
+ if (attrs.italic !== void 0) parts.push(`font-style="${attrs.italic ? "italic" : "normal"}"`);
3847
+ if (attrs.underline !== void 0)
3848
+ parts.push(`text-decoration="${attrs.underline ? "underline" : "none"}"`);
3849
+ return `<text ${parts.join(" ")}>${esc(content)}</text>`;
3850
+ }
3851
+ 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}"/>`;
3852
+ 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)}"` : ""}/>`;
3853
+ function fit(content, maxWidth, size = FONT_SIZE) {
3854
+ if (textWidth(content, size) <= maxWidth) return content;
3855
+ const chars = Math.max(1, Math.floor(maxWidth / (size * 0.55)) - 1);
3856
+ return `${content.slice(0, chars)}\u2026`;
3857
+ }
3858
+
3859
+ // chart/render/theme-palette.ts
3860
+ var THEME_SLOTS = [
3861
+ "lt1",
3862
+ "dk1",
3863
+ "lt2",
3864
+ "dk2",
3865
+ "accent1",
3866
+ "accent2",
3867
+ "accent3",
3868
+ "accent4",
3869
+ "accent5",
3870
+ "accent6",
3871
+ "hlink",
3872
+ "folHlink"
3873
+ ];
3874
+ var DEFAULT_THEME_COLORS = [
3875
+ "FFFFFF",
3876
+ "000000",
3877
+ "E7E6E6",
3878
+ "44546A",
3879
+ "4472C4",
3880
+ "ED7D31",
3881
+ "A5A5A5",
3882
+ "FFC000",
3883
+ "5B9BD5",
3884
+ "70AD47",
3885
+ "0563C1",
3886
+ "954F72"
3887
+ ];
3888
+ function themeColor(theme, index) {
3889
+ const hex = theme.colors[index] ?? DEFAULT_THEME_COLORS[index];
3890
+ return hex && parseArgbHex(hex) ? hex.replace(/^#/, "") : void 0;
3891
+ }
3892
+
3893
+ // chart/render/chart-colors.ts
3894
+ function chartColorScheme(theme) {
3895
+ const slots = Object.fromEntries(
3896
+ THEME_SLOTS.map((slot, index) => [slot, `#${themeColor(theme, index) ?? "000000"}`])
3897
+ );
3898
+ return {
3899
+ ...slots,
3900
+ bg1: slots.lt1,
3901
+ tx1: slots.dk1,
3902
+ bg2: slots.lt2,
3903
+ tx2: slots.dk2
3904
+ };
3905
+ }
3906
+ function autoSeriesColor(theme, index) {
3907
+ const i = Math.max(0, Math.floor(index));
3908
+ return chartPaletteSeriesColor(findChartColorPalette(10), i, i + 1, chartColorScheme(theme));
3909
+ }
3910
+
3911
+ // chart/render/chart-value-axis.ts
3912
+ function valueAxis(model) {
3913
+ const stackable = model.type === "bar" || model.type === "column" || model.type === "line" || model.type === "area";
3914
+ if (stackable && model.grouping === "percentStacked")
3915
+ return { ...PERCENT_SCALE, ticks: [...PERCENT_SCALE.ticks], percent: true };
3916
+ let min = Infinity;
3917
+ let max = -Infinity;
3918
+ if (stackable && model.grouping === "stacked") {
3919
+ for (let i = 0; i < model.categories.length; i++) {
3920
+ let pos = 0;
3921
+ let neg = 0;
3922
+ for (const s of model.series) {
3923
+ const v = s.values[i] ?? 0;
3924
+ if (v >= 0) pos += v;
3925
+ else neg += v;
3926
+ }
3927
+ min = Math.min(min, neg);
3928
+ max = Math.max(max, pos);
3929
+ }
3930
+ } else {
3931
+ for (const s of model.series)
3932
+ for (const v of s.values)
3933
+ if (v !== null) {
3934
+ min = Math.min(min, v);
3935
+ max = Math.max(max, v);
3936
+ }
3937
+ }
3938
+ if (min === Infinity) {
3939
+ min = 0;
3940
+ max = 1;
3941
+ }
3942
+ return { ...niceScale(min, max), percent: false };
3943
+ }
3944
+ function categoryTotals(model) {
3945
+ return model.categories.map(
3946
+ (_, i) => model.series.reduce((sum, s) => sum + Math.abs(s.values[i] ?? 0), 0)
3947
+ );
3948
+ }
3949
+
3950
+ // chart/text-inheritance.ts
3951
+ var TEXT_KEYS = [
3952
+ "fontSize",
3953
+ "bold",
3954
+ "italic",
3955
+ "underline",
3956
+ "typeface",
3957
+ "textColor",
3958
+ "fontRef"
3959
+ ];
3960
+ var TEXT_PARTS = [
3961
+ "title",
3962
+ "axisTitle",
3963
+ "categoryAxis",
3964
+ "valueAxis",
3965
+ "legend",
3966
+ "dataLabel"
3967
+ ];
3968
+ function inheritChartText(part, entry, builtIn, root) {
3969
+ if (!root || !TEXT_PARTS.includes(part)) return entry;
3970
+ const out = { ...entry };
3971
+ for (const key of TEXT_KEYS) {
3972
+ delete out[key];
3973
+ const value = root[key] ?? builtIn?.[key];
3974
+ if (value !== void 0) Object.assign(out, { [key]: value });
3975
+ }
3976
+ if (part === "title" && root.fontSize !== void 0) out.fontSize = root.fontSize * 1.2;
3977
+ if (root.textEffectsXml !== void 0) out.textEffectsXml = root.textEffectsXml;
3978
+ return out;
3979
+ }
3980
+
3981
+ // chart/render/chart-appearance.ts
3982
+ var chartPointsToPixels = (points) => points * EMU_PER_POINT / EMU_PER_PIXEL;
3983
+ function typeface(entry, theme) {
3984
+ const name = entry.typeface;
3985
+ if (name?.startsWith("+mj-")) return theme.majorFont;
3986
+ if (name?.startsWith("+mn-")) return theme.minorFont;
3987
+ return name ?? (entry.fontRef?.index === "major" ? theme.majorFont : entry.fontRef?.index === "minor" ? theme.minorFont : void 0);
3988
+ }
3989
+ function chartAppearance(chart, theme) {
3990
+ const defaults = builtInChartTextStyle(effectiveBuiltInChartStyle(chart.formatting));
3991
+ const entries = {};
3992
+ for (const part of CHART_STYLE_PARTS) {
3993
+ const base = chart.styleDefinition?.entries[part];
3994
+ const direct = chart.formatting?.entries[part];
3995
+ if (!defaults[part] && !base && !direct) continue;
3996
+ const entry = {
3997
+ ...inheritChartText(
3998
+ part,
3999
+ { ...defaults[part], ...base, sourceXml: base?.sourceXml ?? "" },
4000
+ defaults[part],
4001
+ chart.formatting?.textDefaults
4002
+ ),
4003
+ ...direct,
4004
+ sourceXml: direct?.sourceXml ?? base?.sourceXml ?? ""
4005
+ };
4006
+ if (base?.line || direct?.line) entry.line = { ...base?.line, ...direct?.line };
4007
+ entries[part] = entry;
4008
+ }
4009
+ const scheme = chartColorScheme(theme);
4010
+ const resolve = (color) => resolveDrawingColor(
4011
+ color,
4012
+ { scheme: (name) => scheme[name] },
4013
+ { hslRounding: "halfDown", transformOrder: "document" }
4014
+ );
4015
+ const out = resolveChartStyleDefinition(
4016
+ { entries},
4017
+ (color) => drawingColorCss(resolve(color))
4018
+ ) ?? {};
4019
+ for (const part of CHART_STYLE_PARTS) {
4020
+ const entry = entries[part];
4021
+ if (!entry) continue;
4022
+ const family = typeface(entry, theme);
4023
+ const shadow = resolveDrawingShadowXml(entry.textEffectsXml, {
4024
+ scheme: (name) => scheme[name]
4025
+ });
4026
+ if (shadow) (out[part] ??= {}).textShadow = shadow;
4027
+ if (family) (out[part] ??= {}).typeface = family;
4028
+ if (entry.axisVisible !== void 0) (out[part] ??= {}).axisVisible = entry.axisVisible;
4029
+ if (entry.labelsVisible !== void 0) (out[part] ??= {}).labelsVisible = entry.labelsVisible;
4030
+ if (entry.line?.widthEmu === 0) (out[part] ??= {}).lineWidth = 0;
4031
+ if (entry.fill?.kind === "gradient") {
4032
+ (out[part] ??= {}).gradient = resolveChartGradient(entry.fill, resolve);
4033
+ }
4034
+ }
4035
+ return out;
4036
+ }
4037
+
4038
+ // chart/render/chart-title-text.ts
4039
+ function properties(run) {
4040
+ return {
4041
+ ...run.sizePt === void 0 ? {} : { fontSize: run.sizePt },
4042
+ ...run.bold === void 0 ? {} : { bold: run.bold },
4043
+ ...run.italic === void 0 ? {} : { italic: run.italic },
4044
+ ...run.underline === void 0 ? {} : { underline: run.underline },
4045
+ ...run.typeface === void 0 ? {} : { typeface: run.typeface },
4046
+ ...run.color === void 0 ? {} : { textColor: run.color }
4047
+ };
4048
+ }
4049
+ function chartTitleText(chart, theme) {
4050
+ const formatting = chart.formatting;
4051
+ const entry = formatting?.entries.title;
4052
+ const body = entry?.textBody;
4053
+ if (!formatting || !body || body.text !== chart.title) return void 0;
4054
+ 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)
4055
+ return void 0;
4056
+ return {
4057
+ paragraphs: body.paragraphs.map((paragraph) => ({
4058
+ ...paragraph.align ? { align: paragraph.align } : {},
4059
+ ...paragraph.lineSpacing ? { lineSpacing: paragraph.lineSpacing } : {},
4060
+ ...paragraph.spaceBefore ? { spaceBefore: paragraph.spaceBefore } : {},
4061
+ ...paragraph.spaceAfter ? { spaceAfter: paragraph.spaceAfter } : {},
4062
+ runs: paragraph.runs.map((run) => {
4063
+ const direct = {
4064
+ sourceXml: "",
4065
+ ...entry.textBodyStyle,
4066
+ ...properties(paragraph.defaultProperties ?? {}),
4067
+ ...properties(run)
4068
+ };
4069
+ const appearance = chartAppearance(
4070
+ {
4071
+ ...chart,
4072
+ formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
4073
+ },
4074
+ theme
4075
+ )?.title ?? {};
4076
+ return { text: run.text, appearance };
4077
+ })
4078
+ }))
4079
+ };
4080
+ }
4081
+
4082
+ // chart/render/chart-view.ts
4083
+ var isRefError = (value) => typeof value === "object" && value !== null && "error" in value;
4084
+ var SUPPORTED = /* @__PURE__ */ new Set([
4085
+ "bar",
4086
+ "column",
4087
+ "line",
4088
+ "area",
4089
+ "pie",
4090
+ "doughnut",
4091
+ "scatter",
4092
+ "radar"
4093
+ ]);
4094
+ function toText(value) {
4095
+ if (value === null) return "";
4096
+ if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
4097
+ if (isRefError(value)) return value.error;
4098
+ return String(value);
4099
+ }
4100
+ var toNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
4101
+ function resolveRef(ref, evaluateRef) {
4102
+ if (!ref) return void 0;
4103
+ try {
4104
+ const values = evaluateRef(ref);
4105
+ return values.length ? values : void 0;
4106
+ } catch {
4107
+ return void 0;
4108
+ }
4109
+ }
4110
+ function seriesName(series, index, evaluateRef) {
4111
+ const fromRef = resolveRef(series.nameRef, evaluateRef)?.map(toText).filter((t) => t !== "").join(" ");
4112
+ return fromRef || series.name || `Series${index + 1}`;
4113
+ }
4114
+ function chartSummaryView(chart, theme, options = {}) {
4115
+ const evaluateRef = options.evaluateRef ?? (() => []);
4116
+ const type = chart.chartType;
4117
+ const radial = type === "pie" || type === "doughnut";
4118
+ const palette = chart.colorPalette === void 0 ? void 0 : findChartColorPalette(chart.colorPalette);
4119
+ const scheme = chartColorScheme(theme);
4120
+ const drawingColor = (color) => color && drawingColorCss(
4121
+ resolveDrawingColor(
4122
+ color,
4123
+ {
4124
+ scheme: (name) => scheme[name]
4125
+ },
4126
+ { transformOrder: "document" }
4127
+ )
4128
+ );
4129
+ const gradient = (fill) => fill?.kind === "gradient" ? resolveChartGradient(
4130
+ fill,
4131
+ (color) => resolveDrawingColor(
4132
+ color,
4133
+ {
4134
+ scheme: (name) => scheme[name]
4135
+ },
4136
+ { transformOrder: "document" }
4137
+ )
4138
+ ) : void 0;
4139
+ const grouping = chart.grouping ?? (type === "bar" || type === "column" ? "clustered" : "standard");
4140
+ let categories = [];
4141
+ const rawCategories = [];
4142
+ const series = chart.series.map((s, i) => {
4143
+ const values = resolveRef(s.valuesRef, evaluateRef)?.map(toNumber) ?? s.values.map(toNumber);
4144
+ const cats = resolveRef(s.categoriesRef, evaluateRef) ?? s.categories;
4145
+ rawCategories.push(cats);
4146
+ const paletteColor = palette && chartPaletteSeriesColor(palette, i, chart.series.length, scheme);
4147
+ 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);
4148
+ const view = { name: seriesName(s, i, evaluateRef), values, color };
4149
+ const shadow = resolveDrawingShadowXml(s.effectsXml, {
4150
+ scheme: (name) => scheme[name]
4151
+ });
4152
+ if (shadow) view.shadow = shadow;
4153
+ const resolvedGradient = gradient(s.fill);
4154
+ if (resolvedGradient) view.gradient = resolvedGradient;
4155
+ const points = Object.fromEntries(
4156
+ Object.entries(s.pointFills ?? {}).flatMap(([key, fill]) => {
4157
+ const value = gradient(fill);
4158
+ return value ? [[key, value]] : [];
4159
+ })
4160
+ );
4161
+ if (Object.keys(points).length) view.pointGradients = points;
4162
+ return view;
4163
+ });
4164
+ const longest = Math.max(0, ...series.map((s) => s.values.length));
4165
+ const firstCats = rawCategories.find((c) => c.length > 0) ?? [];
4166
+ categories = Array.from(
4167
+ { length: Math.max(longest, firstCats.length) },
4168
+ (_, i) => firstCats[i] !== void 0 ? toText(firstCats[i] ?? null) : String(i + 1)
4169
+ );
4170
+ if (radial) {
4171
+ series.forEach((s, seriesIndex) => {
4172
+ s.pointColors = s.values.map((_, i) => {
4173
+ const explicit = drawingColor(chart.series[seriesIndex]?.pointColors?.[i]);
4174
+ return explicit ?? (palette ? chartPaletteSeriesColor(palette, i, s.values.length, scheme) : autoSeriesColor(theme, i));
4175
+ });
4176
+ });
4177
+ } else
4178
+ series.forEach((s, seriesIndex) => {
4179
+ const points = chart.series[seriesIndex]?.pointColors;
4180
+ if (points) s.pointColors = s.values.map((_, i) => drawingColor(points[i]) ?? s.color);
4181
+ });
4182
+ series.forEach((s, index) => {
4183
+ const source = chart.series[index];
4184
+ if (s.gradient && !radial && s.pointColors) {
4185
+ for (let i = 0; i < s.pointColors.length; i++)
4186
+ if (!source.pointColors?.[i]) delete s.pointColors[i];
4187
+ }
4188
+ for (const [key, fill] of Object.entries(source.pointFills ?? {})) {
4189
+ if (fill.kind === "none") (s.pointColors ??= [])[Number(key)] = "none";
4190
+ else if (fill.kind === "solid") {
4191
+ const paint = drawingColor(fill.color);
4192
+ if (paint) (s.pointColors ??= [])[Number(key)] = paint;
4193
+ }
4194
+ }
4195
+ });
4196
+ const model = {
4197
+ ...chart.barGapWidth === void 0 ? {} : { barGapWidth: chart.barGapWidth },
4198
+ ...chart.barOverlap === void 0 ? {} : { barOverlap: chart.barOverlap },
4199
+ type,
4200
+ grouping,
4201
+ showLegend: chart.showLegend,
4202
+ legendPosition: chart.legendPosition ?? "r",
4203
+ categories,
4204
+ series,
4205
+ horizontal: type === "bar",
4206
+ supported: SUPPORTED.has(type)
4207
+ };
4208
+ if (chart.title) model.title = chart.title;
4209
+ const titleFormatting = chart.formatting?.entries.title;
4210
+ if (titleFormatting?.layout) model.titleLayout = titleFormatting.layout;
4211
+ if (titleFormatting?.overlay !== void 0) model.titleOverlay = titleFormatting.overlay;
4212
+ const legendFormatting = chart.formatting?.entries.legend;
4213
+ if (legendFormatting?.layout) model.legendLayout = legendFormatting.layout;
4214
+ if (legendFormatting?.overlay !== void 0) model.legendOverlay = legendFormatting.overlay;
4215
+ const titleText = chartTitleText(chart, theme);
4216
+ if (titleText) model.titleText = titleText;
4217
+ const appearance = chartAppearance(chart, theme);
4218
+ if (appearance) model.appearance = appearance;
4219
+ if (type === "scatter") {
4220
+ series.forEach((s, i) => {
4221
+ const cats = rawCategories[i] ?? [];
4222
+ const numeric = cats.length > 0 && cats.every((c) => typeof c === "number");
4223
+ s.xValues = s.values.map((_, k) => numeric ? toNumber(cats[k] ?? null) : k + 1);
4224
+ });
4225
+ const xs = series.flatMap((s) => s.xValues ?? []).filter((x) => x !== null);
4226
+ model.xAxis = xs.length ? niceScale(Math.min(...xs), Math.max(...xs)) : niceScale(0, 1);
4227
+ }
4228
+ if (!radial) model.valueAxis = valueAxis(model);
4229
+ return model;
4230
+ }
4231
+
4232
+ // text/css-font-family.ts
4233
+ var FALLBACKS = {
4234
+ calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
4235
+ "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
4236
+ cambria: '"Cambria", "Caladea", Georgia, serif',
4237
+ arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
4238
+ "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
4239
+ "courier new": '"Courier New", "Liberation Mono", monospace',
4240
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
4241
+ };
4242
+ function cssFontFamily(name) {
4243
+ const known = FALLBACKS[name.toLowerCase()];
4244
+ if (known) return known;
4245
+ const quoted = `"${name.replace(/["\\]/g, "")}"`;
4246
+ return `${quoted}, "Calibri", "Carlito", "Segoe UI", sans-serif`;
4247
+ }
4248
+
4249
+ // chart/render/chart-svg-appearance.ts
4250
+ var nextPaintId = 0;
4251
+ function chartGradientPaint(model, width = 1024, height = 768) {
4252
+ const prefix = `xlsx-chart-${++nextPaintId}`;
4253
+ const appearance = { ...model.appearance };
4254
+ const defs = [];
4255
+ const shadowPaint = (shadow, suffix) => {
4256
+ const id = `${prefix}-${suffix}`;
4257
+ const pad = Math.max(4, shadow.blur * 3 + Math.abs(shadow.dx) + Math.abs(shadow.dy));
4258
+ defs.push(
4259
+ `<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>`
4260
+ );
4261
+ return `url(#${id})`;
4262
+ };
4263
+ for (const [part, entry] of Object.entries(appearance)) {
4264
+ if (entry?.textShadow)
4265
+ appearance[part] = {
4266
+ ...entry,
4267
+ textShadowFilter: shadowPaint(entry.textShadow, `${part}-text-shadow`)
4268
+ };
4269
+ }
4270
+ const paint = (gradient, suffix, bounds) => {
4271
+ const def = buildChartGradientDef(`${prefix}-${suffix}`, gradient, bounds);
4272
+ defs.push(chartGradientMarkup(def));
4273
+ return `url(#${def.id})`;
4274
+ };
4275
+ for (const part of ["chartArea", "plotArea"]) {
4276
+ const entry = appearance[part];
4277
+ if (!entry?.gradient) continue;
4278
+ if (part === "plotArea" && ["circle", "shape"].includes(entry.gradient.path ?? "")) continue;
4279
+ appearance[part] = {
4280
+ ...entry,
4281
+ fillColor: paint(entry.gradient, part, { width, height, shape: "rect" })
4282
+ };
4283
+ }
4284
+ const series = model.series.map((source, index) => {
4285
+ const view = { ...source };
4286
+ if (source.shadow) view.shadowFilter = shadowPaint(source.shadow, `s${index}-shadow`);
4287
+ const bounds = model.type === "bar" || model.type === "column" ? { width: 1, height: 1, shape: "rect" } : void 0;
4288
+ if (source.gradient) view.color = paint(source.gradient, `s${index}`, bounds);
4289
+ if (source.pointGradients) {
4290
+ view.pointColors = [...source.pointColors ?? []];
4291
+ for (const [key, gradient] of Object.entries(source.pointGradients))
4292
+ view.pointColors[Number(key)] = paint(gradient, `s${index}-p${key}`, bounds);
4293
+ }
4294
+ return view;
4295
+ });
4296
+ return defs.length ? { model: { ...model, appearance, series }, defs: `<defs>${defs.join("")}</defs>` } : { model, defs: "" };
4297
+ }
4298
+ function chartTextAttributes(model, part, fallbackSize = FONT_SIZE) {
4299
+ const entry = model.appearance?.[part];
4300
+ return {
4301
+ size: entry?.fontSize === void 0 ? fallbackSize : chartPointsToPixels(entry.fontSize),
4302
+ ...entry?.color === void 0 ? {} : { fill: entry.color },
4303
+ ...entry?.bold === void 0 ? {} : { weight: entry.bold ? "bold" : "normal" },
4304
+ ...entry?.italic === void 0 ? {} : { italic: entry.italic },
4305
+ ...entry?.underline === void 0 ? {} : { underline: entry.underline },
4306
+ ...entry?.typeface === void 0 ? {} : { family: cssFontFamily(entry.typeface) },
4307
+ ...entry?.textShadowFilter === void 0 ? {} : { filter: entry.textShadowFilter }
4308
+ };
4309
+ }
4310
+ function chartStroke(model, part) {
4311
+ const entry = model.appearance?.[part];
4312
+ return {
4313
+ color: entry?.axisVisible === false ? "none" : entry?.lineColor ?? (part === "gridlineMajor" ? GRID_COLOR : AXIS_COLOR),
4314
+ width: entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth)
4315
+ };
4316
+ }
4317
+ function chartAreaRect(model, part, area) {
4318
+ if (area.w <= 0 || area.h <= 0) return "";
4319
+ const entry = model.appearance?.[part];
4320
+ let fill = entry?.fillColor ?? (part === "chartArea" ? "#FFFFFF" : "none");
4321
+ let defs = "";
4322
+ if (part !== "chartArea" && entry?.gradient && (part !== "plotArea" || ["circle", "shape"].includes(entry.gradient.path ?? ""))) {
4323
+ const def = buildChartGradientDef(`xlsx-chart-${++nextPaintId}-${part}`, entry.gradient, {
4324
+ width: area.w,
4325
+ height: area.h,
4326
+ shape: "rect"
4327
+ });
4328
+ defs = `<defs>${chartGradientMarkup(def)}</defs>`;
4329
+ fill = `url(#${def.id})`;
4330
+ }
4331
+ const stroke = entry?.lineColor ?? "none";
4332
+ if (fill === "none" && stroke === "none") return "";
4333
+ const width = entry?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry.lineWidth);
4334
+ 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}"/>`;
4335
+ }
4336
+
4337
+ // chart/render/chart-spacing.ts
4338
+ function chartBarSpacing(chart) {
4339
+ const stacked = chart.grouping === "stacked" || chart.grouping === "percentStacked";
4340
+ return {
4341
+ barGapWidth: chart.barGapWidth ?? 150,
4342
+ barOverlap: chart.barOverlap ?? (stacked ? 100 : 0)
4343
+ };
4344
+ }
4345
+
4346
+ // chart/render/chart-svg-bars.ts
4347
+ function bars(model, frame, out, values) {
4348
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
4349
+ const count = Math.max(1, model.series.length);
4350
+ const geometry = clusteredBarGeometry(frame.bandSize, count, chartBarSpacing(model));
4351
+ const barSize = geometry.singleBarWidth;
4352
+ const base = frame.value(0);
4353
+ const pos = new Array(model.categories.length).fill(0);
4354
+ const neg = new Array(model.categories.length).fill(0);
4355
+ model.series.forEach((s, si) => {
4356
+ values[si]?.forEach((v, i) => {
4357
+ if (v === null || i >= model.categories.length) return;
4358
+ let from = 0;
4359
+ let to = v;
4360
+ if (stacked) {
4361
+ const acc = v >= 0 ? pos : neg;
4362
+ from = acc[i] ?? 0;
4363
+ to = from + v;
4364
+ acc[i] = to;
4365
+ }
4366
+ const a = stacked ? frame.value(from) : base;
4367
+ const b = frame.value(to);
4368
+ const offset = model.horizontal ? geometry.clusterWidth / 2 - barSize - si * geometry.step : -geometry.clusterWidth / 2 + si * geometry.step;
4369
+ const center = frame.band(i);
4370
+ const width = model.horizontal ? Math.abs(b - a) : barSize;
4371
+ const height = model.horizontal ? barSize : Math.abs(b - a);
4372
+ let color = s.pointColors?.[i] ?? s.color;
4373
+ const gradient = s.pointGradients?.[i] ?? (s.pointColors?.[i] === void 0 ? s.gradient : void 0);
4374
+ if (gradient && (gradient.path === "circle" || gradient.path === "shape")) {
4375
+ const baseId = color.match(/^url\(#(.+)\)$/)?.[1];
4376
+ if (baseId) {
4377
+ const id = baseId.replace(/(-s\d+(?:-p\d+)?)$/, `-mark${i}$1`);
4378
+ const def = buildChartGradientDef(id, gradient, {
4379
+ width: Number(n(width)),
4380
+ height: Number(n(height)),
4381
+ shape: "rect"
4382
+ });
4383
+ out.push(`<defs>${chartGradientMarkup(def)}</defs>`);
4384
+ color = `url(#${id})`;
4385
+ }
4386
+ }
4387
+ out.push(`<g data-chart-series="${si}" data-chart-point="${i}">`);
4388
+ if (model.horizontal)
4389
+ out.push(
4390
+ rect(Math.min(a, b), center + offset, Math.abs(b - a), barSize, color, s.shadowFilter)
4391
+ );
4392
+ else
4393
+ out.push(
4394
+ rect(center + offset, Math.min(a, b), barSize, Math.abs(b - a), color, s.shadowFilter)
4395
+ );
4396
+ out.push("</g>");
4397
+ });
4398
+ });
4399
+ }
4400
+
4401
+ // chart/render/chart-svg-cartesian.ts
4402
+ function axes(model, area, out) {
4403
+ const scale = model.valueAxis;
4404
+ if (!scale) return void 0;
4405
+ const labels = scale.ticks.map((t) => formatAxisValue(t, scale.percent));
4406
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
4407
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
4408
+ const valueSize = valueAttrs.size ?? 10;
4409
+ const categorySize = categoryAttrs.size ?? 10;
4410
+ const grid = chartStroke(model, "gridlineMajor");
4411
+ const axis = chartStroke(model, "categoryAxis");
4412
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
4413
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
4414
+ const labelW = valueLabels ? Math.max(...labels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
4415
+ const horizontal = model.horizontal;
4416
+ const cats = Math.max(1, model.categories.length);
4417
+ const catW = Math.min(
4418
+ area.w * 0.3,
4419
+ Math.max(...model.categories.map((c) => textWidth(c, categorySize)), 8) + 6
4420
+ );
4421
+ const plot = horizontal ? {
4422
+ x: area.x + catW,
4423
+ y: area.y,
4424
+ w: Math.max(1, area.w - catW - 4),
4425
+ h: Math.max(1, area.h - Math.max(16, valueSize * 1.5))
4426
+ } : {
4427
+ x: area.x + labelW,
4428
+ y: area.y + 4,
4429
+ w: Math.max(1, area.w - labelW - 4),
4430
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
4431
+ };
4432
+ const span = scale.max - scale.min || 1;
4433
+ const value = horizontal ? (v) => plot.x + (v - scale.min) / span * plot.w : (v) => plot.y + plot.h - (v - scale.min) / span * plot.h;
4434
+ const bandSize = (horizontal ? plot.h : plot.w) / cats;
4435
+ const band = horizontal ? (i) => plot.y + plot.h - bandSize * (i + 0.5) : (i) => plot.x + bandSize * (i + 0.5);
4436
+ out.push(chartAreaRect(model, "plotArea", plot));
4437
+ scale.ticks.forEach((t, i) => {
4438
+ const p = value(t);
4439
+ const label = labels[i] ?? "";
4440
+ if (horizontal) {
4441
+ out.push(line(p, plot.y, p, plot.y + plot.h, grid.color, grid.width));
4442
+ if (valueLabels)
4443
+ out.push(
4444
+ text(p, plot.y + plot.h + valueSize + 2, label, { anchor: "middle", ...valueAttrs })
4445
+ );
4446
+ } else {
4447
+ out.push(line(plot.x, p, plot.x + plot.w, p, grid.color, grid.width));
4448
+ if (valueLabels)
4449
+ out.push(text(plot.x - 4, p + valueSize * 0.3, label, { anchor: "end", ...valueAttrs }));
4450
+ }
4451
+ });
4452
+ const zero = value(Math.min(Math.max(0, scale.min), scale.max));
4453
+ if (horizontal) out.push(line(zero, plot.y, zero, plot.y + plot.h, axis.color, axis.width));
4454
+ else out.push(line(plot.x, zero, plot.x + plot.w, zero, axis.color, axis.width));
4455
+ const step = Math.max(
4456
+ 1,
4457
+ Math.ceil(cats / Math.max(1, Math.floor((horizontal ? plot.h : plot.w) / 14)))
4458
+ );
4459
+ model.categories.forEach((c, i) => {
4460
+ if (!categoryLabels || i % step !== 0) return;
4461
+ const p = band(i);
4462
+ if (horizontal)
4463
+ out.push(
4464
+ text(plot.x - 4, p + categorySize * 0.3, fit(c, catW - 6, categorySize), {
4465
+ anchor: "end",
4466
+ ...categoryAttrs
4467
+ })
4468
+ );
4469
+ else
4470
+ out.push(
4471
+ text(p, plot.y + plot.h + categorySize + 3, fit(c, bandSize * step, categorySize), {
4472
+ anchor: "middle",
4473
+ ...categoryAttrs
4474
+ })
4475
+ );
4476
+ });
4477
+ return { plot, value, band, bandSize };
4478
+ }
4479
+ function plotted(model) {
4480
+ if (model.grouping !== "percentStacked") return model.series.map((s) => s.values);
4481
+ const totals = categoryTotals(model);
4482
+ return model.series.map(
4483
+ (s) => s.values.map((v, i) => v === null ? null : v / (totals[i] || 1))
4484
+ );
4485
+ }
4486
+ function linesAndAreas(model, frame, out) {
4487
+ const values = plotted(model);
4488
+ const stacked = model.grouping === "stacked" || model.grouping === "percentStacked";
4489
+ const acc = new Array(model.categories.length).fill(0);
4490
+ const area = model.type === "area";
4491
+ const layers = [];
4492
+ model.series.forEach((s, si) => {
4493
+ const points = [];
4494
+ const lower = [];
4495
+ model.categories.forEach((_, i) => {
4496
+ const v = values[si]?.[i] ?? null;
4497
+ if (v === null && !area) {
4498
+ points.push([NaN, NaN]);
4499
+ return;
4500
+ }
4501
+ const below = stacked ? acc[i] ?? 0 : 0;
4502
+ const top = below + (v ?? 0);
4503
+ if (stacked) acc[i] = top;
4504
+ points.push([frame.band(i), frame.value(top)]);
4505
+ lower.push([frame.band(i), frame.value(below)]);
4506
+ });
4507
+ layers.push({
4508
+ points,
4509
+ lower,
4510
+ color: s.color,
4511
+ filter: s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""
4512
+ });
4513
+ });
4514
+ for (const { points, lower, color, filter } of area ? [...layers].reverse() : layers) {
4515
+ if (area) {
4516
+ const poly = [...points, ...[...lower].reverse()].map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
4517
+ out.push(`<polygon points="${poly}" fill="${color}" fill-opacity="0.85"${filter}/>`);
4518
+ continue;
4519
+ }
4520
+ let segment = [];
4521
+ const flush = () => {
4522
+ if (segment.length > 1)
4523
+ out.push(
4524
+ `<polyline points="${segment.join(" ")}" fill="none" stroke="${color}" stroke-width="2.25" stroke-linejoin="round"${filter}/>`
4525
+ );
4526
+ segment = [];
4527
+ };
4528
+ for (const [x, y] of points) {
4529
+ if (Number.isNaN(x)) flush();
4530
+ else segment.push(`${n(x)},${n(y)}`);
4531
+ }
4532
+ flush();
4533
+ for (const [x, y] of points)
4534
+ if (!Number.isNaN(x))
4535
+ out.push(`<circle cx="${n(x)}" cy="${n(y)}" r="2.5" fill="${color}"${filter}/>`);
4536
+ }
4537
+ }
4538
+ function scatter(model, area, out) {
4539
+ const ys = model.valueAxis;
4540
+ const xs = model.xAxis;
4541
+ if (!ys || !xs) return;
4542
+ const yLabels = ys.ticks.map((t) => formatAxisValue(t));
4543
+ const valueAttrs = chartTextAttributes(model, "valueAxis");
4544
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
4545
+ const valueSize = valueAttrs.size ?? 10;
4546
+ const categorySize = categoryAttrs.size ?? 10;
4547
+ const grid = chartStroke(model, "gridlineMajor");
4548
+ const xAxis = chartStroke(model, "categoryAxis");
4549
+ const yAxis = chartStroke(model, "valueAxis");
4550
+ const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
4551
+ const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
4552
+ const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
4553
+ const plot = {
4554
+ x: area.x + labelW,
4555
+ y: area.y + 4,
4556
+ w: Math.max(1, area.w - labelW - 8),
4557
+ h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
4558
+ };
4559
+ const px = (v, s) => plot.x + (v - s.min) / (s.max - s.min || 1) * plot.w;
4560
+ const py = (v, s) => plot.y + plot.h - (v - s.min) / (s.max - s.min || 1) * plot.h;
4561
+ out.push(chartAreaRect(model, "plotArea", plot));
4562
+ ys.ticks.forEach((t, i) => {
4563
+ out.push(line(plot.x, py(t, ys), plot.x + plot.w, py(t, ys), grid.color, grid.width));
4564
+ if (valueLabels)
4565
+ out.push(
4566
+ text(plot.x - 4, py(t, ys) + valueSize * 0.3, yLabels[i] ?? "", {
4567
+ anchor: "end",
4568
+ ...valueAttrs
4569
+ })
4570
+ );
4571
+ });
4572
+ for (const t of xs.ticks) {
4573
+ out.push(
4574
+ line(px(t, xs), plot.y + plot.h, px(t, xs), plot.y + plot.h + 3, xAxis.color, xAxis.width)
4575
+ );
4576
+ if (categoryLabels)
4577
+ out.push(
4578
+ text(px(t, xs), plot.y + plot.h + categorySize + 3, formatAxisValue(t), {
4579
+ anchor: "middle",
4580
+ ...categoryAttrs
4581
+ })
4582
+ );
4583
+ }
4584
+ out.push(
4585
+ line(plot.x, plot.y + plot.h, plot.x + plot.w, plot.y + plot.h, xAxis.color, xAxis.width)
4586
+ );
4587
+ out.push(line(plot.x, plot.y, plot.x, plot.y + plot.h, yAxis.color, yAxis.width));
4588
+ for (const s of model.series)
4589
+ s.values.forEach((v, i) => {
4590
+ const x = s.xValues?.[i] ?? null;
4591
+ if (v === null || x === null) return;
4592
+ out.push(
4593
+ `<circle cx="${n(px(x, xs))}" cy="${n(py(v, ys))}" r="3" fill="${s.pointColors?.[i] ?? s.color}"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
4594
+ );
4595
+ });
4596
+ }
4597
+ function cartesianSvg(model, area) {
4598
+ const out = [];
4599
+ if (model.type === "scatter") {
4600
+ scatter(model, area, out);
4601
+ return out.join("");
4602
+ }
4603
+ const frame = axes(model, area, out);
4604
+ if (!frame) return "";
4605
+ if (model.type === "bar" || model.type === "column") bars(model, frame, out, plotted(model));
4606
+ else linesAndAreas(model, frame, out);
4607
+ return out.join("");
4608
+ }
4609
+
4610
+ // chart/render/chart-svg-radial.ts
4611
+ var polar = (cx, cy, r, angle) => [
4612
+ cx + r * Math.sin(angle),
4613
+ cy - r * Math.cos(angle)
4614
+ ];
4615
+ function slicePath(cx, cy, r, inner, a0, a1) {
4616
+ const sweep = a1 - a0;
4617
+ if (sweep >= Math.PI * 2 - 1e-9) {
4618
+ const mid = a0 + Math.PI;
4619
+ return slicePath(cx, cy, r, inner, a0, mid) + slicePath(cx, cy, r, inner, mid, a1);
4620
+ }
4621
+ const large = sweep > Math.PI ? 1 : 0;
4622
+ const [x0, y0] = polar(cx, cy, r, a0);
4623
+ const [x1, y1] = polar(cx, cy, r, a1);
4624
+ if (inner <= 0)
4625
+ return `M${n(cx)},${n(cy)} L${n(x0)},${n(y0)} A${n(r)},${n(r)} 0 ${large} 1 ${n(x1)},${n(y1)} Z`;
4626
+ const [ix1, iy1] = polar(cx, cy, inner, a1);
4627
+ const [ix0, iy0] = polar(cx, cy, inner, a0);
4628
+ 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`;
4629
+ }
4630
+ function pieSvg(model, area) {
4631
+ const out = [chartAreaRect(model, "plotArea", area)];
4632
+ const cx = area.x + area.w / 2;
4633
+ const cy = area.y + area.h / 2;
4634
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - 4);
4635
+ const rings = model.type === "doughnut" ? model.series : model.series.slice(0, 1);
4636
+ const hole = model.type === "doughnut" ? radius * 0.5 : 0;
4637
+ const ringSize = (radius - hole) / Math.max(1, rings.length);
4638
+ rings.forEach((s, ri) => {
4639
+ const outer = radius - ri * ringSize;
4640
+ const inner = model.type === "doughnut" ? outer - ringSize : 0;
4641
+ const total = s.values.reduce((sum, v) => sum + (v !== null && v > 0 ? v : 0), 0);
4642
+ if (total <= 0) return;
4643
+ let angle = 0;
4644
+ s.values.forEach((v, i) => {
4645
+ if (v === null || v <= 0) return;
4646
+ const sweep = v / total * Math.PI * 2;
4647
+ const color = s.pointColors?.[i] ?? s.color;
4648
+ out.push(
4649
+ `<path d="${slicePath(cx, cy, outer, inner, angle, angle + sweep)}" fill="${color}" stroke="#FFFFFF" stroke-width="1"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
4650
+ );
4651
+ angle += sweep;
4652
+ });
4653
+ });
4654
+ return out.join("");
4655
+ }
4656
+ function radarSvg(model, area) {
4657
+ const out = [chartAreaRect(model, "plotArea", area)];
4658
+ const scale = model.valueAxis;
4659
+ const count = model.categories.length;
4660
+ if (!scale || count < 1) return "";
4661
+ const valueAttrs = chartTextAttributes(model, "valueAxis", 9);
4662
+ const categoryAttrs = chartTextAttributes(model, "categoryAxis");
4663
+ const valueSize = valueAttrs.size ?? 9;
4664
+ const categorySize = categoryAttrs.size ?? 10;
4665
+ const grid = chartStroke(model, "gridlineMajor");
4666
+ const axis = chartStroke(model, "categoryAxis");
4667
+ const cx = area.x + area.w / 2;
4668
+ const cy = area.y + area.h / 2 + 4;
4669
+ const radius = Math.max(1, Math.min(area.w, area.h) / 2 - Math.max(18, categorySize * 1.8));
4670
+ const angle = (i) => i / count * Math.PI * 2;
4671
+ const r = (v) => (v - scale.min) / (scale.max - scale.min || 1) * radius;
4672
+ const labelEvery = Math.max(
4673
+ 1,
4674
+ Math.ceil(12 / Math.max(1, radius / Math.max(1, scale.ticks.length - 1)))
4675
+ );
4676
+ for (const [k, t] of scale.ticks.entries()) {
4677
+ const ring = Array.from({ length: count }, (_, i) => polar(cx, cy, r(t), angle(i))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
4678
+ out.push(
4679
+ `<polygon points="${ring}" fill="none" stroke="${grid.color}" stroke-width="${n(grid.width)}"/>`
4680
+ );
4681
+ if (model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
4682
+ out.push(
4683
+ text(cx + 3, cy - r(t) + valueSize * 0.3, formatAxisValue(t, scale.percent), valueAttrs)
4684
+ );
4685
+ }
4686
+ model.categories.forEach((c, i) => {
4687
+ const [x, y] = polar(cx, cy, radius, angle(i));
4688
+ out.push(line(cx, cy, x, y, axis.color, axis.width));
4689
+ const [lx, ly] = polar(cx, cy, radius + 10, angle(i));
4690
+ const anchor = Math.abs(lx - cx) < 2 ? "middle" : lx > cx ? "start" : "end";
4691
+ if (model.appearance?.categoryAxis?.labelsVisible !== false)
4692
+ out.push(
4693
+ text(lx, ly + categorySize * 0.3, fit(c, area.w / 4, categorySize), {
4694
+ anchor,
4695
+ ...categoryAttrs
4696
+ })
4697
+ );
4698
+ });
4699
+ for (const s of model.series) {
4700
+ 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(" ");
4701
+ out.push(
4702
+ `<polygon points="${points}" fill="none" stroke="${s.color}" stroke-width="2"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
4703
+ );
4704
+ }
4705
+ return out.join("");
4706
+ }
4707
+
4708
+ // chart/render/chart-svg-text-metrics.ts
4709
+ var CHART_FONT_FAMILY = "Calibri, Carlito, Arial, sans-serif";
4710
+ function cssFont(attrs) {
4711
+ return `${attrs.italic ? "italic" : "normal"} ${attrs.weight ?? "normal"} ${attrs.size ?? 10}px ${attrs.family ?? CHART_FONT_FAMILY}`;
4712
+ }
4713
+ function chartFontMetrics(attrs, options) {
4714
+ const metrics = options.measureFont?.(cssFont(attrs));
4715
+ return metrics && Number.isFinite(metrics.ascent) && Number.isFinite(metrics.descent) && metrics.ascent >= 0 && metrics.descent >= 0 && metrics.ascent + metrics.descent > 0 ? metrics : void 0;
4716
+ }
4717
+ function chartTextWidth(content, attrs, options) {
4718
+ const width = options.measureText?.(content, cssFont(attrs));
4719
+ return width !== void 0 && Number.isFinite(width) && width >= 0 ? width : textWidth(content, attrs.size);
4720
+ }
4721
+ function fitChartText(content, maxWidth, attrs, options) {
4722
+ if (!options.measureText) return fit(content, maxWidth, attrs.size);
4723
+ if (chartTextWidth(content, attrs, options) <= maxWidth) return content;
4724
+ const points = [...content];
4725
+ let low = 0;
4726
+ let high = points.length;
4727
+ while (low < high) {
4728
+ const mid = Math.ceil((low + high) / 2);
4729
+ if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs, options) <= maxWidth) low = mid;
4730
+ else high = mid - 1;
4731
+ }
4732
+ return `${points.slice(0, low).join("")}\u2026`;
4733
+ }
4734
+
4735
+ // chart/render/chart-svg-legend.ts
4736
+ function chartLegendSvg(model, area, frame, options) {
4737
+ const automatic = [];
4738
+ const bounds = {};
4739
+ const reserved = automaticLegend(model, area, automatic, options, bounds);
4740
+ const plot = model.legendOverlay ? area : reserved;
4741
+ const box = bounds.box;
4742
+ if (!box) return { plot, markup: "", foreground: false };
4743
+ const manual = resolveManualLayoutRect(model.legendLayout, frame, {
4744
+ x: box.x,
4745
+ y: box.y,
4746
+ width: box.w,
4747
+ height: box.h
4748
+ });
4749
+ if (!manual) return { plot, markup: automatic.join(""), foreground: !!model.legendOverlay };
4750
+ const entries = legendEntries(model);
4751
+ const attrs = chartTextAttributes(model, "legend");
4752
+ const size = attrs.size ?? 10;
4753
+ const font = chartFontMetrics(attrs, options);
4754
+ const keySize = size / 2;
4755
+ const keyGap = size / 4;
4756
+ const widths = entries.map(
4757
+ (entry) => chartTextWidth(entry.label, attrs, options) + keySize + keyGap
4758
+ );
4759
+ const horizontal = manual.width > manual.height && widths.reduce((sum, width) => sum + width, 0) + size <= manual.width;
4760
+ const rowWidth = horizontal ? manual.width / entries.length : manual.width;
4761
+ const rowHeight = horizontal ? manual.height : manual.height / entries.length;
4762
+ const horizontalGap = Math.max(
4763
+ 0,
4764
+ (manual.width - widths.reduce((sum, width) => sum + width, 0)) / (entries.length + 1)
4765
+ );
4766
+ let horizontalX = manual.x + horizontalGap;
4767
+ const markup = [
4768
+ chartAreaRect(model, "legend", { x: manual.x, y: manual.y, w: manual.width, h: manual.height })
4769
+ ];
4770
+ const baselineOffset = font ? (font.ascent - font.descent) / 2 : size * 0.35;
4771
+ entries.forEach((entry, i) => {
4772
+ const available = horizontal ? chartTextWidth(entry.label, attrs, options) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
4773
+ const label = fitChartText(entry.label, available, attrs, options);
4774
+ const contentWidth = Math.min(
4775
+ horizontal ? widths[i] ?? 0 : Math.max(...widths),
4776
+ rowWidth - size / 2
4777
+ );
4778
+ const x = horizontal ? horizontalX : manual.x + Math.max(size / 4, (rowWidth - contentWidth) / 2);
4779
+ const centerY = manual.y + (horizontal ? 0 : i * rowHeight) + rowHeight / 2;
4780
+ markup.push(rect(x, centerY - keySize / 2, keySize, keySize, entry.color));
4781
+ markup.push(text(x + keySize + keyGap, centerY + baselineOffset, label, attrs));
4782
+ if (horizontal) horizontalX += (widths[i] ?? 0) + horizontalGap;
4783
+ });
4784
+ return {
4785
+ plot,
4786
+ markup: `<g data-chart-legend-layout="true">${markup.join("")}</g>`,
4787
+ foreground: true
4788
+ };
4789
+ }
4790
+ function legendEntries(model) {
4791
+ if (model.type === "pie" || model.type === "doughnut") {
4792
+ const first3 = model.series[0];
4793
+ return model.categories.map((label, i) => ({
4794
+ label,
4795
+ color: first3?.pointColors?.[i] ?? first3?.color ?? "#4472C4"
4796
+ }));
4797
+ }
4798
+ return model.series.map((s) => ({ label: s.name, color: s.color }));
4799
+ }
4800
+ function automaticLegend(model, area, out, options, bounds) {
4801
+ const entries = legendEntries(model);
4802
+ if (!model.showLegend || entries.length === 0) return area;
4803
+ const pos = model.legendPosition;
4804
+ const attrs = chartTextAttributes(model, "legend");
4805
+ const size = attrs.size ?? 10;
4806
+ const rowH = Math.max(16, size * 1.4);
4807
+ if (pos === "t" || pos === "b") {
4808
+ const widths = entries.map(
4809
+ (e) => Math.min(chartTextWidth(e.label, attrs, options) + 20, area.w / 2)
4810
+ );
4811
+ const total = widths.reduce((a, b) => a + b, 0);
4812
+ let x2 = area.x + Math.max(0, (area.w - total) / 2);
4813
+ const y = pos === "t" ? area.y + 4 : area.y + area.h - rowH + 4;
4814
+ bounds.box = { x: x2 - 4, y: y - 4, w: Math.min(total, area.w) + 8, h: rowH + 4 };
4815
+ out.push(
4816
+ chartAreaRect(model, "legend", {
4817
+ x: x2 - 4,
4818
+ y: y - 4,
4819
+ w: Math.min(total, area.w) + 8,
4820
+ h: rowH + 4
4821
+ })
4822
+ );
4823
+ entries.forEach((e, i) => {
4824
+ const w = widths[i] ?? 0;
4825
+ out.push(rect(x2, y, 8, 8, e.color));
4826
+ out.push(text(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs, options), attrs));
4827
+ x2 += w;
4828
+ });
4829
+ 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 };
4830
+ }
4831
+ const width = Math.min(
4832
+ area.w * 0.35,
4833
+ Math.max(...entries.map((e) => chartTextWidth(e.label, attrs, options))) + 22
4834
+ );
4835
+ const height = entries.length * rowH;
4836
+ const x = pos === "l" ? area.x + 4 : area.x + area.w - width;
4837
+ const y0 = pos === "tr" ? area.y + 4 : area.y + Math.max(0, (area.h - height) / 2);
4838
+ bounds.box = { x: x - 4, y: y0, w: width + 4, h: Math.min(height, area.y + area.h - y0) };
4839
+ out.push(
4840
+ chartAreaRect(model, "legend", {
4841
+ x: x - 4,
4842
+ y: y0,
4843
+ w: width + 4,
4844
+ h: Math.min(height, area.y + area.h - y0)
4845
+ })
4846
+ );
4847
+ entries.forEach((e, i) => {
4848
+ const y = y0 + i * rowH;
4849
+ if (y + rowH > area.y + area.h + 2) return;
4850
+ out.push(rect(x, y + 3, 8, 8, e.color));
4851
+ out.push(text(x + 12, y + 11, fitChartText(e.label, width - 16, attrs, options), attrs));
4852
+ });
4853
+ 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 };
4854
+ }
4855
+
4856
+ // text/wrap-styled-runs.ts
4857
+ var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
4858
+ function wrapStyledRuns(runs, maxWidth, measure, options = {}) {
4859
+ const groups = [];
4860
+ for (const [source, run] of runs.entries()) {
4861
+ for (const token of run.text.split(/(\r\n|[\r\n]|[ \t]+)/u).filter(Boolean)) {
4862
+ const kind = /^[\r\n]+$/u.test(token) ? "break" : /^[ \t]+$/u.test(token) ? "space" : "word";
4863
+ let group = groups.at(-1);
4864
+ if (!group || group.kind !== kind || kind === "break") {
4865
+ group = { kind, pieces: [] };
4866
+ groups.push(group);
4867
+ }
4868
+ if (kind !== "break") group.pieces.push({ run, source, text: token });
4869
+ }
4870
+ }
4871
+ const merged = (left, right) => {
4872
+ const result2 = left.map((piece) => ({ ...piece }));
4873
+ for (const piece of right) {
4874
+ const last = result2.at(-1);
4875
+ if (last?.source === piece.source) last.text += piece.text;
4876
+ else result2.push({ ...piece });
4877
+ }
4878
+ return result2;
4879
+ };
4880
+ const width = (pieces) => pieces.reduce((sum, piece) => {
4881
+ const advance = measure(piece.text, piece.run);
4882
+ return sum + (Number.isFinite(advance) && advance >= 0 ? advance : 0);
4883
+ }, 0);
4884
+ const result = [];
4885
+ let line2 = [];
4886
+ let spaces = [];
4887
+ const flush = () => {
4888
+ result.push(line2.map((piece) => ({ ...piece.run, text: piece.text })));
4889
+ line2 = [];
4890
+ spaces = [];
4891
+ };
4892
+ for (const group of groups) {
4893
+ if (group.kind === "break") {
4894
+ flush();
4895
+ continue;
4896
+ }
4897
+ if (group.kind === "space") {
4898
+ spaces = group.pieces;
4899
+ continue;
4900
+ }
4901
+ const separator = line2.length ? spaces : [];
4902
+ const wordWidth = width(group.pieces);
4903
+ if (line2.length && width(merged(line2, [...separator, ...group.pieces])) > maxWidth) flush();
4904
+ else line2 = merged(line2, separator);
4905
+ spaces = [];
4906
+ if (options.breakWords && wordWidth > maxWidth) {
4907
+ for (const piece of group.pieces) {
4908
+ for (const { segment } of graphemes.segment(piece.text)) {
4909
+ const next = { ...piece, text: segment };
4910
+ if (line2.length && width(merged(line2, [next])) > maxWidth) flush();
4911
+ line2 = merged(line2, [next]);
4912
+ }
4913
+ }
4914
+ } else line2 = merged(line2, group.pieces);
4915
+ }
4916
+ flush();
4917
+ return result;
4918
+ }
4919
+
4920
+ // chart/render/chart-svg-title-text.ts
4921
+ function spacing(value, naturalHeight, fallback) {
4922
+ return value ? value.unit === "points" ? chartPointsToPixels(value.value) : naturalHeight * value.value : fallback;
4923
+ }
4924
+ function chartRichTitleSvg(model, width, options = {}, frameHeight = 400) {
4925
+ if (!model.title) return void 0;
4926
+ const base = chartTextAttributes(model, "title", 14);
4927
+ const capacity = Math.max(1, width * 0.8 - 8);
4928
+ if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options) <= capacity)
4929
+ return void 0;
4930
+ const paragraphs = model.titleText?.paragraphs ?? [
4931
+ {
4932
+ runs: [{ text: model.title, appearance: model.appearance?.title ?? {} }]
4933
+ }
4934
+ ];
4935
+ const hardLines = [];
4936
+ for (const paragraph of paragraphs) {
4937
+ let line2 = {
4938
+ ...paragraph,
4939
+ runs: []
4940
+ };
4941
+ hardLines.push(line2);
4942
+ for (const run of paragraph.runs) {
4943
+ const pieces = run.text.split("\n");
4944
+ for (const [index, piece] of pieces.entries()) {
4945
+ if (index) {
4946
+ line2 = { ...paragraph, runs: [] };
4947
+ hardLines.push(line2);
4948
+ }
4949
+ if (piece) line2.runs.push({ ...run, text: piece });
4950
+ }
4951
+ }
4952
+ }
4953
+ const lines = hardLines.flatMap((line2) => {
4954
+ const wrapped = wrapStyledRuns(
4955
+ line2.runs,
4956
+ capacity,
4957
+ (content, run) => chartTextWidth(
4958
+ content,
4959
+ chartTextAttributes(
4960
+ { ...model, appearance: { title: run.appearance } },
4961
+ "title",
4962
+ base.size
4963
+ ),
4964
+ options
4965
+ ),
4966
+ { breakWords: true }
4967
+ );
4968
+ const { spaceBefore, spaceAfter, ...properties4 } = line2;
4969
+ return wrapped.map((runs, index) => ({
4970
+ ...properties4,
4971
+ runs,
4972
+ ...index === 0 && spaceBefore ? { spaceBefore } : {},
4973
+ ...index === wrapped.length - 1 && spaceAfter ? { spaceAfter } : {}
4974
+ }));
4975
+ });
4976
+ const metrics = lines.map((line2) => {
4977
+ const runs = line2.runs.map((run) => ({
4978
+ ...run,
4979
+ attrs: chartTextAttributes(
4980
+ { ...model, appearance: { title: run.appearance } },
4981
+ "title",
4982
+ base.size
4983
+ )
4984
+ }));
4985
+ return {
4986
+ ...line2,
4987
+ runs,
4988
+ width: runs.reduce((sum, run) => sum + chartTextWidth(run.text, run.attrs, options), 0),
4989
+ size: runs.length ? Math.max(...runs.map((run) => run.attrs.size ?? 14)) : base.size ?? 14,
4990
+ fontMetrics: (runs.length ? runs.map((run) => run.attrs) : [base]).map(
4991
+ (attrs) => chartFontMetrics(attrs, options)
4992
+ )
4993
+ };
4994
+ });
4995
+ const measured = metrics.every((line2) => line2.fontMetrics.every((font) => font !== void 0));
4996
+ const vertical = metrics.map((line2) => {
4997
+ const ascent = measured ? Math.max(...line2.fontMetrics.map((font) => font.ascent)) : line2.size;
4998
+ const descent = measured ? Math.max(...line2.fontMetrics.map((font) => font.descent)) : line2.size * 0.4 + 4;
4999
+ const natural = ascent + descent;
5000
+ const height2 = spacing(line2.lineSpacing, natural, natural);
5001
+ const leading = (height2 - natural) / 2;
5002
+ return {
5003
+ ascent: ascent + leading,
5004
+ descent: descent + leading,
5005
+ height: height2,
5006
+ before: spacing(line2.spaceBefore, natural, 0),
5007
+ after: spacing(line2.spaceAfter, natural, 0),
5008
+ leading
5009
+ };
5010
+ });
5011
+ const boxWidth = Math.min(width - 16, Math.max(0, ...metrics.map((line2) => line2.width)) + 8);
5012
+ const height = vertical.reduce(
5013
+ (sum, line2) => sum + line2.height + line2.before + line2.after,
5014
+ measured ? 4 : 0
5015
+ );
5016
+ let baseline = 8 + (metrics[0]?.size ?? base.size ?? 14) + (vertical[0]?.before ?? 0) + (vertical[0]?.leading ?? 0);
5017
+ const spans = [];
5018
+ for (const [index, line2] of metrics.entries()) {
5019
+ if (index)
5020
+ baseline += vertical[index - 1].descent + vertical[index - 1].after + vertical[index].before + vertical[index].ascent;
5021
+ let x = line2.align === "l" ? (width - boxWidth) / 2 + 4 : line2.align === "r" ? (width + boxWidth) / 2 - 4 - line2.width : (width - line2.width) / 2;
5022
+ for (const run of line2.runs) {
5023
+ spans.push(
5024
+ text(x, baseline, run.text, {
5025
+ ...run.attrs,
5026
+ anchor: "start"
5027
+ }).replace("<text ", '<tspan data-chart-title-run="true" ').replace("</text>", "</tspan>")
5028
+ );
5029
+ x += chartTextWidth(run.text, run.attrs, options);
5030
+ }
5031
+ }
5032
+ const parent = text(0, 0, "", { ...base, underline: false }).replace(
5033
+ "</text>",
5034
+ `${spans.join("")}</text>`
5035
+ );
5036
+ const markup = chartAreaRect(model, "title", {
5037
+ x: (width - boxWidth) / 2,
5038
+ y: 4,
5039
+ w: Math.max(0, boxWidth),
5040
+ h: height
5041
+ }) + parent;
5042
+ const automatic = { x: (width - boxWidth) / 2, y: 4, width: boxWidth, height };
5043
+ const manual = resolveManualLayoutRect(
5044
+ model.titleLayout,
5045
+ { width, height: frameHeight },
5046
+ automatic
5047
+ );
5048
+ return {
5049
+ markup: manual ? `<g data-chart-title-layout="true" transform="translate(${n(manual.x - automatic.x)} ${n(manual.y - automatic.y)})">${markup}</g>` : markup,
5050
+ height: Math.max(24, height)
5051
+ };
5052
+ }
5053
+
5054
+ // chart/render/chart-svg.ts
5055
+ function renderChartSvg(model, width, height, options = {}) {
5056
+ const paint = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
5057
+ model = paint.model;
5058
+ const w = Math.max(1, width);
5059
+ const h = Math.max(1, height);
5060
+ const out = [];
5061
+ let foregroundTitle = "";
5062
+ out.push(
5063
+ `<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">`
5064
+ );
5065
+ if (model.title) out.push(`<title>${esc(model.title)}</title>`);
5066
+ if (paint.defs) out.push(paint.defs);
5067
+ out.push(chartAreaRect(model, "chartArea", { x: 0, y: 0, w, h }));
5068
+ let area = { x: 8, y: 8, w: w - 16, h: h - 16 };
5069
+ const richTitle = chartRichTitleSvg(model, w, options, h);
5070
+ if (richTitle) {
5071
+ if (model.titleLayout || model.titleOverlay) foregroundTitle = richTitle.markup;
5072
+ else out.push(richTitle.markup);
5073
+ if (!model.titleOverlay)
5074
+ area = { ...area, y: area.y + richTitle.height, h: area.h - richTitle.height };
5075
+ } else if (model.title) {
5076
+ const attrs = chartTextAttributes(model, "title", 14);
5077
+ const size = attrs.size ?? 14;
5078
+ const label = fitChartText(model.title, w - 16, attrs, options);
5079
+ const titleWidth = Math.min(w - 16, chartTextWidth(label, attrs, options) + 8);
5080
+ const font = chartFontMetrics(attrs, options);
5081
+ const titleHeight = Math.max(24, font ? font.ascent + font.descent + 4 : size * 1.4 + 4);
5082
+ out.push(
5083
+ chartAreaRect(model, "title", {
5084
+ x: (w - titleWidth) / 2,
5085
+ y: 4,
5086
+ w: Math.max(0, titleWidth),
5087
+ h: font ? font.ascent + font.descent + 4 : size * 1.4 + 4
5088
+ })
5089
+ );
5090
+ out.push(
5091
+ text(w / 2, 8 + size, label, {
5092
+ anchor: "middle",
5093
+ fill: "#404040",
5094
+ ...attrs
5095
+ })
5096
+ );
5097
+ if (!model.titleOverlay)
5098
+ area = { x: area.x, y: area.y + titleHeight, w: area.w, h: area.h - titleHeight };
5099
+ }
5100
+ if (!model.supported) {
5101
+ out.push(
5102
+ text(w / 2, area.y + area.h / 2, `${model.type} charts are not drawn`, { anchor: "middle" })
5103
+ );
5104
+ if (foregroundTitle) out.push(foregroundTitle);
5105
+ out.push("</svg>");
5106
+ return out.join("");
5107
+ }
5108
+ const legend = chartLegendSvg(model, area, { width: w, height: h }, options);
5109
+ area = legend.plot;
5110
+ if (!legend.foreground) out.push(legend.markup);
5111
+ if (area.w > 4 && area.h > 4) {
5112
+ if (model.type === "pie" || model.type === "doughnut") out.push(pieSvg(model, area));
5113
+ else if (model.type === "radar") out.push(radarSvg(model, area));
5114
+ else out.push(cartesianSvg(model, area));
5115
+ }
5116
+ if (legend.foreground) out.push(legend.markup);
5117
+ if (foregroundTitle) out.push(foregroundTitle);
5118
+ out.push("</svg>");
5119
+ return out.join("");
5120
+ }
5121
+
5122
+ // chart/render/render-space.ts
5123
+ var DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
5124
+ "bar",
5125
+ "column",
5126
+ "line",
5127
+ "area",
5128
+ "pie",
5129
+ "doughnut",
5130
+ "scatter",
5131
+ "radar"
5132
+ ]);
5133
+ function chartThemePalette(theme, fonts = {}) {
5134
+ return {
5135
+ colors: THEME_SLOTS.map(
5136
+ (slot, index) => themeSlotHex(theme?.colors[slot]) ?? DEFAULT_THEME_COLORS[index] ?? "000000"
5137
+ ),
5138
+ majorFont: fonts.major ?? "Calibri Light",
5139
+ minorFont: fonts.minor ?? "Calibri"
5140
+ };
5141
+ }
5142
+ function chartSpaceKind(space) {
5143
+ if (!space.plotArea.groups.length) return { drawn: false };
5144
+ const type = chartSummaryFromSpace(space).chartType;
5145
+ return { type, drawn: DRAWN_CHART_TYPES.has(type) };
5146
+ }
5147
+ function renderChartSpaceSvg(space, options) {
5148
+ const { width, height, theme, fonts, formatting, colorPalette, styleDefinition, ...svg } = options;
5149
+ const summary = chartSummaryFromSpace(space, {
5150
+ ...formatting ? { formatting } : {},
5151
+ ...colorPalette !== void 0 ? { colorPalette } : {},
5152
+ ...styleDefinition ? { styleDefinition } : {}
5153
+ });
5154
+ const view = chartSummaryView(summary, chartThemePalette(theme, fonts));
5155
+ return renderChartSvg(view, width, height, svg);
5156
+ }
5157
+
5158
+ // docx/breaks.ts
5159
+ function isCachedPageBreak(element) {
5160
+ return named2(element, "lastRenderedPageBreak") && !element.childNodes.length && Array.from(element.attributes).every(
5161
+ (attribute) => attribute.namespaceURI === "http://www.w3.org/2000/xmlns/"
5162
+ );
5163
+ }
5164
+ function hasSpecialBreak(element) {
5165
+ for (const attribute of Array.from(element.attributes)) {
5166
+ if (attribute.namespaceURI === "http://www.w3.org/2000/xmlns/") continue;
5167
+ if (attribute.namespaceURI !== WORD_NS) return true;
5168
+ if (attribute.localName === "type") {
5169
+ if (attribute.value !== "textWrapping") return true;
5170
+ } else if (attribute.localName === "clear") {
5171
+ if (attribute.value !== "none") return true;
5172
+ } else return true;
5173
+ }
5174
+ return false;
5175
+ }
5176
+ function classifyBreak(element) {
5177
+ const type = getW(element, "type");
5178
+ return type === "page" || type === "column" ? type : "textWrapping";
5179
+ }
5180
+ function isModeledBreak(element) {
5181
+ const kind = classifyBreak(element);
5182
+ if (kind === "textWrapping") return false;
5183
+ for (const attribute of Array.from(element.attributes)) {
5184
+ if (attribute.namespaceURI === "http://www.w3.org/2000/xmlns/") continue;
5185
+ if (attribute.namespaceURI !== WORD_NS || attribute.localName !== "type") return false;
5186
+ }
5187
+ return true;
5188
+ }
5189
+
2840
5190
  // docx/write-drawing.ts
2841
5191
  var A_NS2 = "http://schemas.openxmlformats.org/drawingml/2006/main";
2842
5192
  var WP_NS2 = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
@@ -3172,11 +5522,11 @@ function createRun(doc, run, base, old, allocator) {
3172
5522
  if (piece === "\n") node.appendChild(makeW(doc, "br"));
3173
5523
  else if (piece === " ") node.appendChild(makeW(doc, "tab"));
3174
5524
  else if (piece) {
3175
- const text = makeW(doc, "t");
5525
+ const text2 = makeW(doc, "t");
3176
5526
  if (/^\s|\s$/.test(piece))
3177
- text.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
3178
- text.appendChild(doc.createTextNode(piece));
3179
- node.appendChild(text);
5527
+ text2.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
5528
+ text2.appendChild(doc.createTextNode(piece));
5529
+ node.appendChild(text2);
3180
5530
  }
3181
5531
  }
3182
5532
  if (!run.text) node.appendChild(makeW(doc, "t"));
@@ -3243,38 +5593,6 @@ function preserveEquation(run, base, old) {
3243
5593
  "Equation editing or insertion is unsupported; imported OMML must remain unchanged."
3244
5594
  );
3245
5595
  }
3246
-
3247
- // docx/breaks.ts
3248
- function isCachedPageBreak(element) {
3249
- return named2(element, "lastRenderedPageBreak") && !element.childNodes.length && Array.from(element.attributes).every(
3250
- (attribute) => attribute.namespaceURI === "http://www.w3.org/2000/xmlns/"
3251
- );
3252
- }
3253
- function hasSpecialBreak(element) {
3254
- for (const attribute of Array.from(element.attributes)) {
3255
- if (attribute.namespaceURI === "http://www.w3.org/2000/xmlns/") continue;
3256
- if (attribute.namespaceURI !== WORD_NS) return true;
3257
- if (attribute.localName === "type") {
3258
- if (attribute.value !== "textWrapping") return true;
3259
- } else if (attribute.localName === "clear") {
3260
- if (attribute.value !== "none") return true;
3261
- } else return true;
3262
- }
3263
- return false;
3264
- }
3265
- function classifyBreak(element) {
3266
- const type = getW(element, "type");
3267
- return type === "page" || type === "column" ? type : "textWrapping";
3268
- }
3269
- function isModeledBreak(element) {
3270
- const kind = classifyBreak(element);
3271
- if (kind === "textWrapping") return false;
3272
- for (const attribute of Array.from(element.attributes)) {
3273
- if (attribute.namespaceURI === "http://www.w3.org/2000/xmlns/") continue;
3274
- if (attribute.namespaceURI !== WORD_NS || attribute.localName !== "type") return false;
3275
- }
3276
- return true;
3277
- }
3278
5596
  function isCommentReferenceRun(run) {
3279
5597
  const content = Array.from(run.childNodes).filter(
3280
5598
  (child) => isElement(child) && !named2(child, "rPr")
@@ -3486,18 +5804,18 @@ function parseDirectParagraphProperties(props) {
3486
5804
  if (shading) paragraph.shadingFill = shading;
3487
5805
  const tabStops = parseTabStops(first2(props, "tabs"));
3488
5806
  if (tabStops.length) paragraph.tabStops = tabStops;
3489
- const spacing = first2(props, "spacing");
3490
- const before = twipValue2(getW(spacing, "before"));
3491
- const after = twipValue2(getW(spacing, "after"));
3492
- const line = signedTwipValue2(getW(spacing, "line"));
5807
+ const spacing2 = first2(props, "spacing");
5808
+ const before = twipValue2(getW(spacing2, "before"));
5809
+ const after = twipValue2(getW(spacing2, "after"));
5810
+ const line2 = signedTwipValue2(getW(spacing2, "line"));
3493
5811
  if (before !== void 0) paragraph.spacingBeforeTwips = before;
3494
5812
  if (after !== void 0) paragraph.spacingAfterTwips = after;
3495
- if (line !== void 0) {
3496
- paragraph.lineSpacingTwips = line;
5813
+ if (line2 !== void 0) {
5814
+ paragraph.lineSpacingTwips = line2;
3497
5815
  }
3498
- const rule = getW(spacing, "lineRule");
5816
+ const rule = getW(spacing2, "lineRule");
3499
5817
  if (rule === "auto" || rule === "exact" || rule === "atLeast") paragraph.lineSpacingRule = rule;
3500
- else if (line !== void 0) paragraph.lineSpacingRule = "auto";
5818
+ else if (line2 !== void 0) paragraph.lineSpacingRule = "auto";
3501
5819
  const indent = first2(props, "ind");
3502
5820
  const indentLeft = signedTwipValue2(getW(indent, "left"));
3503
5821
  const indentRight = signedTwipValue2(getW(indent, "right"));
@@ -3629,9 +5947,9 @@ function resolveNumberingLevel(catalog, numId, level) {
3629
5947
  let base = override?.lvl ?? abstract;
3630
5948
  if (!base) return void 0;
3631
5949
  if (override?.lvl) {
3632
- const { lvlRestart: _ignored, ...properties3 } = base;
5950
+ const { lvlRestart: _ignored, ...properties4 } = base;
3633
5951
  base = {
3634
- ...properties3,
5952
+ ...properties4,
3635
5953
  ...abstract?.lvlRestart !== void 0 ? { lvlRestart: abstract.lvlRestart } : {}
3636
5954
  };
3637
5955
  }
@@ -3657,6 +5975,37 @@ function documentBlockLists(model) {
3657
5975
  ];
3658
5976
  }
3659
5977
 
5978
+ // docx/chart-paint.ts
5979
+ function themeCatalogColorScheme(theme) {
5980
+ const colors = {};
5981
+ for (const [slot, value] of Object.entries(theme?.colors ?? {}))
5982
+ if (value) colors[slot] = { kind: "srgb", value: value.replace(/^#/, ""), transforms: [] };
5983
+ return { colors };
5984
+ }
5985
+ function docxChartPaint(chart, widthPx, heightPx, theme) {
5986
+ const space = chart?.chartSpace;
5987
+ if (!space) return { label: "Chart" };
5988
+ const kind = chartSpaceKind(space);
5989
+ if (!kind.drawn) return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
5990
+ try {
5991
+ const fonts = {
5992
+ ...theme?.fonts.major.latin ? { major: theme.fonts.major.latin } : {},
5993
+ ...theme?.fonts.minor.latin ? { minor: theme.fonts.minor.latin } : {}
5994
+ };
5995
+ const svg = renderChartSpaceSvg(space, {
5996
+ width: Math.max(1, Math.round(widthPx)),
5997
+ height: Math.max(1, Math.round(heightPx)),
5998
+ theme: themeCatalogColorScheme(theme),
5999
+ fonts,
6000
+ ...chart.formatting ? { formatting: chart.formatting } : {},
6001
+ ...chart.colorPalette !== void 0 ? { colorPalette: chart.colorPalette } : {}
6002
+ });
6003
+ return { svg, label: chart.title ? `Chart: ${chart.title}` : "Chart" };
6004
+ } catch {
6005
+ return { label: kind.type ? `Chart (${kind.type})` : "Chart" };
6006
+ }
6007
+ }
6008
+
3660
6009
  // docx/diagram-theme.ts
3661
6010
  function diagramColorTheme(theme) {
3662
6011
  return {
@@ -3724,20 +6073,20 @@ function restoreParagraphFormatting(paragraph) {
3724
6073
  throw new Error(
3725
6074
  "Cannot reject a paragraph formatting revision without its prior properties snapshot."
3726
6075
  );
3727
- const properties3 = parsePropertiesSnapshot(xml, "pPr");
6076
+ const properties4 = parsePropertiesSnapshot(xml, "pPr");
3728
6077
  if (paragraph.sourceParagraphPropertiesXml) {
3729
6078
  const current = parsePropertiesSnapshot(paragraph.sourceParagraphPropertiesXml, "pPr");
3730
6079
  for (const name of ["rPr", "sectPr"]) {
3731
6080
  const element = first2(current, name);
3732
- if (element && !first2(properties3, name))
3733
- properties3.appendChild(properties3.ownerDocument.importNode(element, true));
6081
+ if (element && !first2(properties4, name))
6082
+ properties4.appendChild(properties4.ownerDocument.importNode(element, true));
3734
6083
  }
3735
- orderParagraphProperties(properties3);
6084
+ orderParagraphProperties(properties4);
3736
6085
  }
3737
- const previous = parseDirectParagraphProperties(properties3);
6086
+ const previous = parseDirectParagraphProperties(properties4);
3738
6087
  for (const key of PARAGRAPH_FORMAT_KEYS) delete paragraph[key];
3739
6088
  Object.assign(paragraph, previous);
3740
- paragraph.restoredParagraphPropertiesXml = buildXml(properties3);
6089
+ paragraph.restoredParagraphPropertiesXml = buildXml(properties4);
3741
6090
  if (paragraph.sourceParagraphPropertiesXml)
3742
6091
  paragraph.sourceParagraphPropertiesXml = paragraph.restoredParagraphPropertiesXml;
3743
6092
  delete paragraph.formatRevision;
@@ -4361,7 +6710,8 @@ function runToInlineNodes(run, schema, noteNumber) {
4361
6710
  textBoxText: run.image.textBoxText ? JSON.stringify(run.image.textBoxText) : null,
4362
6711
  textBoxEditable: run.image.textBoxEditable ?? null,
4363
6712
  textBoxBorder: run.image.textBoxBorder ?? null,
4364
- diagram: run.image.diagram ? JSON.stringify(run.image.diagram) : null
6713
+ diagram: run.image.diagram ? JSON.stringify(run.image.diagram) : null,
6714
+ chart: run.image.chart ? JSON.stringify(run.image.chart) : null
4365
6715
  },
4366
6716
  void 0,
4367
6717
  marks2
@@ -4383,8 +6733,8 @@ function applyInlineFormat(run, child) {
4383
6733
  Object.assign(run, inlineRunProperties(child));
4384
6734
  const marks = { text: "", ...run.revision ? { revision: run.revision } : {} };
4385
6735
  applyMarkFormatting(marks, child);
4386
- const { text: _text, ...properties3 } = marks;
4387
- Object.assign(run, properties3);
6736
+ const { text: _text, ...properties4 } = marks;
6737
+ Object.assign(run, properties4);
4388
6738
  const ids = commentIdsFromNode(child);
4389
6739
  if (ids.length) run.commentIds = ids;
4390
6740
  else delete run.commentIds;
@@ -4445,6 +6795,7 @@ function appendInlineNode(runs, child) {
4445
6795
  // Same key order as the parser's run: the writer compares an unchanged placeholder run by JSON.
4446
6796
  ...child.attrs.unsupported ? { unsupported: child.attrs.unsupported } : {},
4447
6797
  ...typeof child.attrs.diagram === "string" ? { diagram: JSON.parse(child.attrs.diagram) } : {},
6798
+ ...typeof child.attrs.chart === "string" ? { chart: JSON.parse(child.attrs.chart) } : {},
4448
6799
  ...typeof child.attrs.placement === "string" ? { placement: JSON.parse(child.attrs.placement) } : {},
4449
6800
  ...typeof child.attrs.textBoxText === "string" ? { textBoxText: JSON.parse(child.attrs.textBoxText) } : {},
4450
6801
  ...child.attrs.textBoxEditable ? { textBoxEditable: true } : {},
@@ -4546,9 +6897,9 @@ function fieldClipboardSlice(slice) {
4546
6897
  });
4547
6898
  return node.copy(prosemirrorModel.Fragment.fromArray(children4));
4548
6899
  }
4549
- const properties3 = !node.isText && node.type.spec.attrs?.format ? inlineRunProperties(node) : void 0;
6900
+ const properties4 = !node.isText && node.type.spec.attrs?.format ? inlineRunProperties(node) : void 0;
4550
6901
  const field = node.marks.find((mark) => mark.type.name === "field");
4551
- const cached2 = properties3?.field;
6902
+ const cached2 = properties4?.field;
4552
6903
  if (!field && !cached2) return node;
4553
6904
  if (!(field?.attrs.simple ?? cached2?.simple) && complete.has(pos)) return node;
4554
6905
  const marks = node.marks.flatMap((mark) => {
@@ -4557,8 +6908,8 @@ function fieldClipboardSlice(slice) {
4557
6908
  const { fieldInstanceId: _identity, fieldFlags: _flags2, ...props } = mark.attrs.props ?? {};
4558
6909
  return Object.keys(props).length ? [mark.type.create({ ...mark.attrs, props })] : [];
4559
6910
  });
4560
- if (!properties3 || !cached2) return node.mark(marks);
4561
- const { field: _field, fieldInstanceId: _id, fieldFlags: _flags, ...literal } = properties3;
6911
+ if (!properties4 || !cached2) return node.mark(marks);
6912
+ const { field: _field, fieldInstanceId: _id, fieldFlags: _flags, ...literal } = properties4;
4562
6913
  return node.type.create(
4563
6914
  updatedInlineRunAttributes(
4564
6915
  node,
@@ -4609,7 +6960,7 @@ function fieldResultRanges(doc) {
4609
6960
  }
4610
6961
 
4611
6962
  // docx/ui/simple-field-input.ts
4612
- var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
6963
+ var graphemes2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
4613
6964
  function targetField(state, from, to) {
4614
6965
  return fieldResultRanges(state.doc).find(
4615
6966
  (range) => range.mark.attrs.simple && from >= range.from && to <= range.to && (from !== to || from > range.from && from < range.to)
@@ -4623,14 +6974,14 @@ function resultMarks(node, field) {
4623
6974
  ...typeof id === "string" && { fieldInstanceId: id },
4624
6975
  ...source?.fieldFlags && { fieldFlags: source.fieldFlags }
4625
6976
  };
4626
- const properties3 = node.type.schema.marks.runProperties;
4627
- if (properties3) {
4628
- const old = properties3.isInSet(marks);
6977
+ const properties4 = node.type.schema.marks.runProperties;
6978
+ if (properties4) {
6979
+ const old = properties4.isInSet(marks);
4629
6980
  const { fieldInstanceId: _identity, fieldFlags: _flags, ...other } = old?.attrs.props ?? {};
4630
6981
  const props = { ...other, ...state };
4631
- marks = properties3.removeFromSet(marks);
6982
+ marks = properties4.removeFromSet(marks);
4632
6983
  if (Object.keys(props).length)
4633
- marks = properties3.create({ ...old?.attrs ?? {}, props }).addToSet(marks);
6984
+ marks = properties4.create({ ...old?.attrs ?? {}, props }).addToSet(marks);
4634
6985
  }
4635
6986
  return marks;
4636
6987
  }
@@ -4656,19 +7007,19 @@ function simpleFieldPasteSlice(slice, state) {
4656
7007
  slice.content.forEach((node) => children3.push(project(node)));
4657
7008
  return new prosemirrorModel.Slice(prosemirrorModel.Fragment.fromArray(children3), slice.openStart, slice.openEnd);
4658
7009
  }
4659
- function replaceSimpleFieldResult(state, from, to, text) {
7010
+ function replaceSimpleFieldResult(state, from, to, text2) {
4660
7011
  const field = targetField(state, from, to);
4661
7012
  if (!field) return null;
4662
- if (!text) {
7013
+ if (!text2) {
4663
7014
  const tr2 = state.tr;
4664
7015
  if (!emptySimpleFieldResult(tr2, from, to)) return null;
4665
7016
  return tr2.setSelection(prosemirrorState.TextSelection.create(tr2.doc, from + 3));
4666
7017
  }
4667
7018
  const $from = state.doc.resolve(from);
4668
7019
  const marks = state.storedMarks ?? (from === to ? $from.marks() : $from.marksAcross(state.doc.resolve(to)));
4669
- const node = state.schema.text(text, marks);
7020
+ const node = state.schema.text(text2, marks);
4670
7021
  const tr = state.tr.replaceRangeWith(from, to, node.mark(resultMarks(node, field)));
4671
- if (!tr.selection.empty && tr.selection.to === from + text.length)
7022
+ if (!tr.selection.empty && tr.selection.to === from + text2.length)
4672
7023
  tr.setSelection(prosemirrorState.TextSelection.near(tr.selection.$to));
4673
7024
  return tr;
4674
7025
  }
@@ -4702,7 +7053,7 @@ function deleteSimpleFieldResult(state, backward) {
4702
7053
  (range) => range.mark.attrs.simple && (backward ? range.to === from : range.from === from)
4703
7054
  );
4704
7055
  if (!field) return null;
4705
- const segments = graphemes.segment(field.text)[Symbol.iterator]();
7056
+ const segments = graphemes2.segment(field.text)[Symbol.iterator]();
4706
7057
  if (segments.next().done || !segments.next().done) return null;
4707
7058
  return replaceSimpleFieldResult(state, field.from, field.to, "");
4708
7059
  }
@@ -4740,10 +7091,10 @@ function fieldGuardPlugin() {
4740
7091
  if (!view.editable || !event.clipboardData) return false;
4741
7092
  const tr = deleteFieldSelection(view.state);
4742
7093
  if (!tr) return false;
4743
- const { dom, text } = view.serializeForClipboard(view.state.selection.content());
7094
+ const { dom, text: text2 } = view.serializeForClipboard(view.state.selection.content());
4744
7095
  event.clipboardData.clearData();
4745
7096
  event.clipboardData.setData("text/html", dom.innerHTML);
4746
- event.clipboardData.setData("text/plain", text);
7097
+ event.clipboardData.setData("text/plain", text2);
4747
7098
  event.preventDefault();
4748
7099
  view.dispatch(tr.scrollIntoView().setMeta("uiEvent", "cut"));
4749
7100
  return true;
@@ -4751,8 +7102,8 @@ function fieldGuardPlugin() {
4751
7102
  },
4752
7103
  transformCopied: fieldClipboardSlice,
4753
7104
  transformPasted: (slice, view) => simpleFieldPasteSlice(fieldClipboardSlice(slice), view?.state),
4754
- handleTextInput: (view, from, to, text) => {
4755
- const transaction = replaceAroundMarkers(view.state, from, to, text) ?? replaceSimpleFieldResult(view.state, from, to, text);
7105
+ handleTextInput: (view, from, to, text2) => {
7106
+ const transaction = replaceAroundMarkers(view.state, from, to, text2) ?? replaceSimpleFieldResult(view.state, from, to, text2);
4756
7107
  if (transaction) view.dispatch(transaction);
4757
7108
  return Boolean(transaction);
4758
7109
  },
@@ -4844,7 +7195,7 @@ function markersIn(doc, from, to) {
4844
7195
  });
4845
7196
  return markers;
4846
7197
  }
4847
- function replaceAroundMarkers(state, from, to, text) {
7198
+ function replaceAroundMarkers(state, from, to, text2) {
4848
7199
  if (from === to) return null;
4849
7200
  const markers = markersIn(state.doc, from, to);
4850
7201
  if (!markers.length) return null;
@@ -4859,8 +7210,8 @@ function replaceAroundMarkers(state, from, to, text) {
4859
7210
  end = marker.pos;
4860
7211
  }
4861
7212
  if (from < end) transaction.delete(from, end);
4862
- if (text) transaction.insert(from, state.schema.text(text, marks));
4863
- return transaction.setSelection(prosemirrorState.TextSelection.create(transaction.doc, from + text.length));
7213
+ if (text2) transaction.insert(from, state.schema.text(text2, marks));
7214
+ return transaction.setSelection(prosemirrorState.TextSelection.create(transaction.doc, from + text2.length));
4864
7215
  }
4865
7216
  function deleteAroundMarkers(state, backward) {
4866
7217
  const { selection, doc } = state;
@@ -4932,7 +7283,7 @@ var commentSerial = 0;
4932
7283
  function nextCommentId(idGenerator) {
4933
7284
  return idGenerator ? idGenerator("comment") : `dve-comment-${Date.now().toString(36)}-${++commentSerial}`;
4934
7285
  }
4935
- function addComment(view, author, text, idGenerator, inlineElements = true) {
7286
+ function addComment(view, author, text2, idGenerator, inlineElements = true) {
4936
7287
  if (!view.editable || !view.state.schema.marks.comment) return null;
4937
7288
  const { from, to } = commentSelectionRange(
4938
7289
  view.state.doc,
@@ -4961,7 +7312,7 @@ function addComment(view, author, text, idGenerator, inlineElements = true) {
4961
7312
  tr = tr.addMark(start, end, view.state.schema.marks.comment.create({ ids: [id] }));
4962
7313
  });
4963
7314
  if (!tr.docChanged) return null;
4964
- const comment = { id, author, text, resolved: false };
7315
+ const comment = { id, author, text: text2, resolved: false };
4965
7316
  const threads = commentThreadsFromDoc(view.state.doc);
4966
7317
  if (inlineElements && threads) setCommentThreads(tr, [...threads, comment]);
4967
7318
  view.dispatch(prosemirrorHistory.closeHistory(tr));
@@ -5010,9 +7361,9 @@ function deleteComment(comments, id) {
5010
7361
  function resolveComment(comments, id, resolved) {
5011
7362
  return comments.map((comment) => comment.id === id ? { ...comment, resolved } : comment);
5012
7363
  }
5013
- function replyToComment(comments, parentId, author, text, idGenerator) {
7364
+ function replyToComment(comments, parentId, author, text2, idGenerator) {
5014
7365
  const id = nextCommentId(idGenerator);
5015
- return [...comments, { id, author, text, parentId }];
7366
+ return [...comments, { id, author, text: text2, parentId }];
5016
7367
  }
5017
7368
  function commentIdsAtSelection(view) {
5018
7369
  const { from, to, empty } = view.state.selection;
@@ -5306,7 +7657,7 @@ var WordYjsComments = class {
5306
7657
  }
5307
7658
  return true;
5308
7659
  }
5309
- add(view, author, text, idGenerator) {
7660
+ add(view, author, text2, idGenerator) {
5310
7661
  if (!view.editable || view.state.selection.empty || yProsemirror.ySyncPluginKey.getState(view.state)?.type !== this.fragment)
5311
7662
  return null;
5312
7663
  const id = idGenerator("comment");
@@ -5314,18 +7665,18 @@ var WordYjsComments = class {
5314
7665
  let added = null;
5315
7666
  this.change(() => {
5316
7667
  const elements2 = this.inlineEnabled() && this.inlineAnchors.add(view.state, id);
5317
- added = addComment(view, author, text, () => id, false);
5318
- if (!added && elements2) added = { id, author, text, resolved: false };
7668
+ added = addComment(view, author, text2, () => id, false);
7669
+ if (!added && elements2) added = { id, author, text: text2, resolved: false };
5319
7670
  if (added) this.records.set(id, added);
5320
7671
  });
5321
7672
  return added;
5322
7673
  }
5323
- reply(parentId, author, text, idGenerator) {
7674
+ reply(parentId, author, text2, idGenerator) {
5324
7675
  const root = this.records.get(parentId);
5325
7676
  if (!root || root.parentId || this.deleted.get(parentId)) return false;
5326
7677
  const id = idGenerator("comment");
5327
7678
  if (!id || this.records.has(id)) return false;
5328
- return this.change(() => this.records.set(id, { id, parentId, author, text }));
7679
+ return this.change(() => this.records.set(id, { id, parentId, author, text: text2 }));
5329
7680
  }
5330
7681
  resolve(id, resolved) {
5331
7682
  const root = this.records.get(id);
@@ -5367,12 +7718,12 @@ function independentCommentAnchors(node) {
5367
7718
  if (!node.isText && node.type.spec.attrs?.format && node.marks.some(
5368
7719
  (mark) => mark.type.name === "comment" || mark.type.name === "inlineCommentAnchors"
5369
7720
  )) {
5370
- const properties3 = inlineRunProperties(node);
7721
+ const properties4 = inlineRunProperties(node);
5371
7722
  const ids = commentIdsFromNode(node);
5372
- if (ids.length) properties3.commentIds = ids;
5373
- else delete properties3.commentIds;
7723
+ if (ids.length) properties4.commentIds = ids;
7724
+ else delete properties4.commentIds;
5374
7725
  return node.type.create(
5375
- updatedInlineRunAttributes(node, JSON.stringify(properties3)),
7726
+ updatedInlineRunAttributes(node, JSON.stringify(properties4)),
5376
7727
  void 0,
5377
7728
  marks.filter(
5378
7729
  (mark) => mark.type.name !== "inlineCommentAnchors" && mark.type.name !== "comment"
@@ -5719,6 +8070,64 @@ var insertWordHardBreak = (state, dispatch, view) => {
5719
8070
  return true;
5720
8071
  };
5721
8072
 
8073
+ // docx/ui/chart-spec.ts
8074
+ var SVG_NS2 = "http://www.w3.org/2000/svg";
8075
+ function elementSpec(element, root) {
8076
+ const attrs = {};
8077
+ for (const attr2 of Array.from(element.attributes)) {
8078
+ if (attr2.name === "xmlns" || attr2.name.startsWith("xmlns:") || /^on/i.test(attr2.name)) continue;
8079
+ attrs[attr2.name] = attr2.value;
8080
+ }
8081
+ const children3 = [];
8082
+ for (const child of Array.from(element.childNodes)) {
8083
+ if (isElement(child)) children3.push(elementSpec(child, false));
8084
+ else if (child.nodeType === 3 && child.nodeValue) children3.push(child.nodeValue);
8085
+ }
8086
+ const tag = root ? `${SVG_NS2} ${element.localName}` : element.localName;
8087
+ return [tag, attrs, ...children3];
8088
+ }
8089
+ function svgMarkupSpec(svg) {
8090
+ return elementSpec(parseXml(svg, { label: "Chart SVG" }).documentElement, true);
8091
+ }
8092
+ function nodeChart(node) {
8093
+ const value = node.attrs.chart;
8094
+ if (typeof value !== "string") return void 0;
8095
+ try {
8096
+ return JSON.parse(value);
8097
+ } catch {
8098
+ return void 0;
8099
+ }
8100
+ }
8101
+ function chartNodeSpec(node, theme) {
8102
+ const width = Number(node.attrs.widthPx) || 96;
8103
+ const height = Number(node.attrs.heightPx) || 96;
8104
+ const paint = docxChartPaint(nodeChart(node), width, height, theme);
8105
+ const style = `width:${width}px;height:${height}px`;
8106
+ if (!paint.svg)
8107
+ return [
8108
+ "span",
8109
+ {
8110
+ "data-docx-image-placeholder": "1",
8111
+ "data-docx-chart": "frame",
8112
+ ...inlineRunPropertiesDomAttrs(node),
8113
+ class: "dve-image-placeholder",
8114
+ style
8115
+ },
8116
+ paint.label
8117
+ ];
8118
+ return [
8119
+ "span",
8120
+ {
8121
+ "data-docx-chart": "1",
8122
+ ...inlineRunPropertiesDomAttrs(node),
8123
+ class: "dve-chart",
8124
+ style,
8125
+ title: paint.label
8126
+ },
8127
+ svgMarkupSpec(paint.svg)
8128
+ ];
8129
+ }
8130
+
5722
8131
  // docx/ui/inline-content-schema.ts
5723
8132
  var safeAttrValue = (value) => String(value ?? "").replace(/[;{}"]/g, "");
5724
8133
  function placementClass(value) {
@@ -5739,7 +8148,7 @@ function textBoxLines(value) {
5739
8148
  if (typeof value !== "string") return [];
5740
8149
  try {
5741
8150
  const lines = JSON.parse(value);
5742
- return Array.isArray(lines) ? lines.map((line) => ["span", { class: "dve-textbox-line" }, String(line)]) : [];
8151
+ return Array.isArray(lines) ? lines.map((line2) => ["span", { class: "dve-textbox-line" }, String(line2)]) : [];
5743
8152
  } catch {
5744
8153
  return [];
5745
8154
  }
@@ -5771,7 +8180,9 @@ var imageNodeSpec = {
5771
8180
  textBoxEditable: { default: null },
5772
8181
  textBoxBorder: { default: null },
5773
8182
  /** A SmartArt graphic (`DocxDiagram`) as JSON; shown read-only by the SmartArt node view. */
5774
- diagram: { default: null }
8183
+ diagram: { default: null },
8184
+ /** A chart (`DocxChart`) as JSON; painted read-only from its cached values (`chart-spec.ts`). */
8185
+ chart: { default: null }
5775
8186
  },
5776
8187
  parseDOM: [
5777
8188
  {
@@ -5790,7 +8201,7 @@ var imageNodeSpec = {
5790
8201
  })
5791
8202
  }
5792
8203
  ],
5793
- toDOM: (node) => node.attrs.unsupported ? [
8204
+ toDOM: (node) => node.attrs.chart ? chartNodeSpec(node) : node.attrs.unsupported ? [
5794
8205
  "span",
5795
8206
  {
5796
8207
  "data-docx-image-placeholder": "1",
@@ -5947,10 +8358,10 @@ var removeWordLink = (state, dispatch, view) => {
5947
8358
  function patchedRun(node, patch) {
5948
8359
  const run = inlineNodeRun(node);
5949
8360
  if (!run) return void 0;
5950
- const properties3 = run;
8361
+ const properties4 = run;
5951
8362
  for (const [key, value] of Object.entries(patch)) {
5952
- if (value === void 0) delete properties3[key];
5953
- else properties3[key] = value;
8363
+ if (value === void 0) delete properties4[key];
8364
+ else properties4[key] = value;
5954
8365
  }
5955
8366
  return run;
5956
8367
  }
@@ -6362,14 +8773,14 @@ function resolveFormattingRange(tr, from, to, mode) {
6362
8773
  setInlineRunFormatting(tr, piece.from, run2);
6363
8774
  continue;
6364
8775
  }
6365
- const properties3 = piece.node.marks.find((mark) => mark.type.name === "runProperties");
8776
+ const properties4 = piece.node.marks.find((mark) => mark.type.name === "runProperties");
6366
8777
  if (mode === "accept") {
6367
- const props = { ...properties3.attrs.props };
8778
+ const props = { ...properties4.attrs.props };
6368
8779
  if (props.formatRevision) delete props.formatRevision;
6369
8780
  else delete props.revision;
6370
- tr.removeMark(piece.from, piece.to, properties3);
8781
+ tr.removeMark(piece.from, piece.to, properties4);
6371
8782
  if (Object.keys(props).length)
6372
- tr.addMark(piece.from, piece.to, properties3.type.create({ props }));
8783
+ tr.addMark(piece.from, piece.to, properties4.type.create({ props }));
6373
8784
  continue;
6374
8785
  }
6375
8786
  const run = { text: "", revision: piece.revision };
@@ -6381,7 +8792,7 @@ function resolveFormattingRange(tr, from, to, mode) {
6381
8792
  }
6382
8793
 
6383
8794
  // docx/ui/track-run-formatting.ts
6384
- function properties(node) {
8795
+ function properties2(node) {
6385
8796
  const run = inlineNodeRun(node) ?? { text: "" };
6386
8797
  run.text = "";
6387
8798
  delete run.image;
@@ -6417,8 +8828,8 @@ function trackRunFormatting(steps, oldState, newState, author, date, nextId) {
6417
8828
  if (!previous.isInline || previous.type.name === "equation") return;
6418
8829
  const start = Math.max(from, previousPos);
6419
8830
  const end = Math.min(to, previousPos + previous.nodeSize);
6420
- const before = properties(previous);
6421
- const after = properties(node);
8831
+ const before = properties2(previous);
8832
+ const after = properties2(node);
6422
8833
  if (propertiesSignature(before) === propertiesSignature(after)) {
6423
8834
  if (hasInlineRunAttributes(node) && node.marks.some((mark2) => RUN_FORMAT_MARKS.has(mark2.type.name)))
6424
8835
  setInlineRunFormatting(tr, start, inlineNodeRun(node));
@@ -6505,7 +8916,7 @@ function paragraphProperties(element) {
6505
8916
  for (const child of children2(element, name)) element.removeChild(child);
6506
8917
  return element;
6507
8918
  }
6508
- function properties2(node) {
8919
+ function properties3(node) {
6509
8920
  const paragraph = paragraphFromAttrs(node.attrs, String(node.attrs.id), []);
6510
8921
  delete paragraph.formatRevision;
6511
8922
  delete paragraph.markRevision;
@@ -6523,8 +8934,8 @@ function trackParagraphFormatting(steps, oldState, newState, author, date, nextI
6523
8934
  if (node.type.name !== "paragraph" || !node.type.spec.attrs?.formatRevision) return;
6524
8935
  const previous = oldState.doc.nodeAt(pos);
6525
8936
  if (previous === node) return;
6526
- const before = properties2(previous);
6527
- const after = properties2(node);
8937
+ const before = properties3(previous);
8938
+ const after = properties3(node);
6528
8939
  if (propertiesSignature(before) === propertiesSignature(after)) return;
6529
8940
  const pending = paragraphFormattingRevision(previous);
6530
8941
  const priorXml = pending?.previousParagraphPropertiesXml ?? buildXml(before);
@@ -6588,14 +8999,14 @@ function trackSimpleFieldDeletion(transform, from, to, slice, author, date, next
6588
8999
  function sourceProperties(value) {
6589
9000
  if (typeof value !== "string" || !value) return value;
6590
9001
  try {
6591
- const properties3 = parsePropertiesSnapshot(value, "pPr");
6592
- const run = first2(properties3, "rPr");
9002
+ const properties4 = parsePropertiesSnapshot(value, "pPr");
9003
+ const run = first2(properties4, "rPr");
6593
9004
  if (run) {
6594
9005
  for (const name of ["ins", "del"])
6595
9006
  for (const revision of children2(run, name)) run.removeChild(revision);
6596
- if (!run.childNodes.length && !run.attributes.length) properties3.removeChild(run);
9007
+ if (!run.childNodes.length && !run.attributes.length) properties4.removeChild(run);
6597
9008
  }
6598
- return propertiesSignature(properties3);
9009
+ return propertiesSignature(properties4);
6599
9010
  } catch {
6600
9011
  return value;
6601
9012
  }
@@ -7938,10 +10349,10 @@ function paragraphBoxCss(borders, shadingFill) {
7938
10349
  const parsed = typeof borders === "string" ? parseBordersJson(borders) : borders;
7939
10350
  const css = [];
7940
10351
  for (const side of ["top", "bottom", "left", "right"]) {
7941
- const line = cssBorderSide(parsed?.[side]);
7942
- if (!line) continue;
10352
+ const line2 = cssBorderSide(parsed?.[side]);
10353
+ if (!line2) continue;
7943
10354
  css.push(
7944
- `border-${side}:${line}`,
10355
+ `border-${side}:${line2}`,
7945
10356
  `padding-${side}:${(parsed[side].spacePoints ?? 0) * 4 / 3}px`
7946
10357
  );
7947
10358
  }
@@ -8045,7 +10456,7 @@ function applyThemeColors(host, previous, colors) {
8045
10456
  }
8046
10457
 
8047
10458
  // docx/ui/word-count.ts
8048
- function countWords(text, locale) {
10459
+ function countWords(text2, locale) {
8049
10460
  if (typeof Intl.Segmenter === "function") {
8050
10461
  let segmenter;
8051
10462
  try {
@@ -8053,9 +10464,9 @@ function countWords(text, locale) {
8053
10464
  } catch {
8054
10465
  segmenter = new Intl.Segmenter(void 0, { granularity: "word" });
8055
10466
  }
8056
- return [...segmenter.segment(text)].filter((part) => part.isWordLike).length;
10467
+ return [...segmenter.segment(text2)].filter((part) => part.isWordLike).length;
8057
10468
  }
8058
- return text.match(/[\p{L}\p{N}][\p{L}\p{M}\p{N}'’]*/gu)?.length ?? 0;
10469
+ return text2.match(/[\p{L}\p{N}][\p{L}\p{M}\p{N}'’]*/gu)?.length ?? 0;
8059
10470
  }
8060
10471
 
8061
10472
  // docx/ui/zoom-fit.ts
@@ -8095,6 +10506,7 @@ exports.applyThemeColors = applyThemeColors;
8095
10506
  exports.applyWordLink = applyWordLink;
8096
10507
  exports.authorColor = authorColor;
8097
10508
  exports.backstageFocus = backstageFocus;
10509
+ exports.chartNodeSpec = chartNodeSpec;
8098
10510
  exports.clearDirectRunFormatting = clearDirectRunFormatting;
8099
10511
  exports.collectRevisionRanges = collectRevisionRanges;
8100
10512
  exports.commentAnchors = commentAnchors;
@@ -8144,6 +10556,7 @@ exports.linkMarkSpec = linkMarkSpec;
8144
10556
  exports.markSpecs = markSpecs;
8145
10557
  exports.marksForRun = marksForRun;
8146
10558
  exports.moveName = moveName;
10559
+ exports.nodeChart = nodeChart;
8147
10560
  exports.nodeNumbering = nodeNumbering;
8148
10561
  exports.normalizeRibbonActions = normalizeRibbonActions;
8149
10562
  exports.normalizeThemeMode = normalizeThemeMode;
@@ -8182,6 +10595,7 @@ exports.sameRuns = sameRuns;
8182
10595
  exports.sectionPartsJson = sectionPartsJson;
8183
10596
  exports.setCommentThreads = setCommentThreads;
8184
10597
  exports.setReviewRecordingPreferences = setReviewRecordingPreferences;
10598
+ exports.svgMarkupSpec = svgMarkupSpec;
8185
10599
  exports.swatchColor = swatchColor;
8186
10600
  exports.tableCellStyle = tableCellStyle;
8187
10601
  exports.tableStyle = tableStyle;