ooxml-core 1.33.0 → 1.35.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 (475) hide show
  1. package/dist/PptxHandler-5UDSMCBG.cjs +14 -0
  2. package/dist/PptxHandler-TTRTAQAR.mjs +5 -0
  3. package/dist/{PptxHandler-Q7CFNKOU.mjs → PptxHandler-XCYX5DVX.mjs} +2 -2
  4. package/dist/{PresentationBuilder-VP2637RH.cjs → PresentationBuilder-HA56ZY23.cjs} +6 -5
  5. package/dist/{PresentationBuilder-SADKXDWC.mjs → PresentationBuilder-IVLUEB4K.mjs} +2 -2
  6. package/dist/{PresentationBuilder-PJMQRZI6.mjs → PresentationBuilder-JBTNOIL7.mjs} +3 -2
  7. package/dist/automation/index.cjs +47556 -43468
  8. package/dist/automation/index.mjs +47556 -43468
  9. package/dist/{chunk-2LTIDUXH.cjs → chunk-A27O7M5X.cjs} +147 -133
  10. package/dist/{chunk-Y2RH4QWG.mjs → chunk-EGBNPVBA.mjs} +1542 -721
  11. package/dist/{chunk-QRXMYOVN.mjs → chunk-GNGL4BO7.mjs} +66 -44
  12. package/dist/chunk-LSO5SSFX.mjs +112 -0
  13. package/dist/chunk-MB3TYNMV.mjs +28 -0
  14. package/dist/{chunk-EBBWRRSB.mjs → chunk-MK2IBZU6.mjs} +1 -1
  15. package/dist/{chunk-BDZR4DZ6.cjs → chunk-PA5ADSTX.cjs} +1329 -1306
  16. package/dist/{chunk-BQGLWC6N.mjs → chunk-RI56PFGL.mjs} +67 -44
  17. package/dist/{chunk-3LMHYL4W.mjs → chunk-RPJHMPEL.mjs} +1 -1
  18. package/dist/{chunk-JQVOUS6B.mjs → chunk-TJXK4D4U.mjs} +4 -4
  19. package/dist/{chunk-6LJW76BZ.mjs → chunk-UQMAPY6D.mjs} +147 -128
  20. package/dist/chunk-XF6ZRA2D.cjs +120 -0
  21. package/dist/crypto/index.cjs +23 -15
  22. package/dist/crypto/index.mjs +23 -15
  23. package/dist/docx/block-parser.d.ts.map +1 -1
  24. package/dist/docx/embedded.cjs +519 -161
  25. package/dist/docx/embedded.mjs +519 -161
  26. package/dist/docx/find-pattern.d.ts +33 -0
  27. package/dist/docx/find-pattern.d.ts.map +1 -0
  28. package/dist/docx/find-replacement.d.ts +16 -0
  29. package/dist/docx/find-replacement.d.ts.map +1 -0
  30. package/dist/docx/find-syntax.d.ts +13 -0
  31. package/dist/docx/find-syntax.d.ts.map +1 -0
  32. package/dist/docx/find-wildcards.d.ts +8 -0
  33. package/dist/docx/find-wildcards.d.ts.map +1 -0
  34. package/dist/docx/form-field-model.d.ts +39 -0
  35. package/dist/docx/form-field-model.d.ts.map +1 -1
  36. package/dist/docx/index.cjs +3157 -994
  37. package/dist/docx/index.d.ts +3 -1
  38. package/dist/docx/index.d.ts.map +1 -1
  39. package/dist/docx/index.mjs +3153 -995
  40. package/dist/docx/layout/adapter.d.ts.map +1 -1
  41. package/dist/docx/layout/index.cjs +30 -8
  42. package/dist/docx/layout/index.mjs +30 -8
  43. package/dist/docx/layout/input.d.ts +2 -0
  44. package/dist/docx/layout/input.d.ts.map +1 -1
  45. package/dist/docx/load/index.cjs +6706 -1322
  46. package/dist/docx/load/index.mjs +6706 -1322
  47. package/dist/docx/load/legacy-doc/binary-save.d.ts +4 -0
  48. package/dist/docx/load/legacy-doc/binary-save.d.ts.map +1 -0
  49. package/dist/docx/load/legacy-doc/blocks.d.ts +19 -0
  50. package/dist/docx/load/legacy-doc/blocks.d.ts.map +1 -0
  51. package/dist/docx/load/legacy-doc/borders.d.ts +7 -0
  52. package/dist/docx/load/legacy-doc/borders.d.ts.map +1 -0
  53. package/dist/docx/load/legacy-doc/context.d.ts +65 -0
  54. package/dist/docx/load/legacy-doc/context.d.ts.map +1 -0
  55. package/dist/docx/load/legacy-doc/drawing.d.ts +15 -0
  56. package/dist/docx/load/legacy-doc/drawing.d.ts.map +1 -0
  57. package/dist/docx/load/legacy-doc/error.d.ts +5 -0
  58. package/dist/docx/load/legacy-doc/error.d.ts.map +1 -0
  59. package/dist/docx/load/legacy-doc/inline.d.ts +7 -0
  60. package/dist/docx/load/legacy-doc/inline.d.ts.map +1 -0
  61. package/dist/docx/load/legacy-doc/numbering-part.d.ts +3 -0
  62. package/dist/docx/load/legacy-doc/numbering-part.d.ts.map +1 -0
  63. package/dist/docx/load/legacy-doc/package.d.ts +8 -0
  64. package/dist/docx/load/legacy-doc/package.d.ts.map +1 -0
  65. package/dist/docx/load/legacy-doc/para-props.d.ts +6 -0
  66. package/dist/docx/load/legacy-doc/para-props.d.ts.map +1 -0
  67. package/dist/docx/load/legacy-doc/run-props.d.ts +8 -0
  68. package/dist/docx/load/legacy-doc/run-props.d.ts.map +1 -0
  69. package/dist/docx/load/legacy-doc/sections.d.ts +23 -0
  70. package/dist/docx/load/legacy-doc/sections.d.ts.map +1 -0
  71. package/dist/docx/load/legacy-doc/styles-part.d.ts +3 -0
  72. package/dist/docx/load/legacy-doc/styles-part.d.ts.map +1 -0
  73. package/dist/docx/load/legacy-doc/table.d.ts +6 -0
  74. package/dist/docx/load/legacy-doc/table.d.ts.map +1 -0
  75. package/dist/docx/load/legacy-doc/xml.d.ts +21 -0
  76. package/dist/docx/load/legacy-doc/xml.d.ts.map +1 -0
  77. package/dist/docx/load/legacy-doc.d.ts +5 -4
  78. package/dist/docx/load/legacy-doc.d.ts.map +1 -1
  79. package/dist/docx/model-paragraph.d.ts +5 -0
  80. package/dist/docx/model-paragraph.d.ts.map +1 -1
  81. package/dist/docx/model.d.ts +3 -0
  82. package/dist/docx/model.d.ts.map +1 -1
  83. package/dist/docx/numbering-editing.d.ts +11 -1
  84. package/dist/docx/numbering-editing.d.ts.map +1 -1
  85. package/dist/docx/numbering-format.d.ts.map +1 -1
  86. package/dist/docx/numbering-model.d.ts +17 -0
  87. package/dist/docx/numbering-model.d.ts.map +1 -1
  88. package/dist/docx/numbering-package.d.ts +2 -2
  89. package/dist/docx/numbering-package.d.ts.map +1 -1
  90. package/dist/docx/numbering-parse.d.ts +2 -1
  91. package/dist/docx/numbering-parse.d.ts.map +1 -1
  92. package/dist/docx/numbering-picture-save.d.ts +13 -0
  93. package/dist/docx/numbering-picture-save.d.ts.map +1 -0
  94. package/dist/docx/numbering-picture.d.ts +18 -0
  95. package/dist/docx/numbering-picture.d.ts.map +1 -0
  96. package/dist/docx/parse.d.ts.map +1 -1
  97. package/dist/docx/permission-markers.d.ts +19 -0
  98. package/dist/docx/permission-markers.d.ts.map +1 -0
  99. package/dist/docx/permissions.d.ts +11 -0
  100. package/dist/docx/permissions.d.ts.map +1 -0
  101. package/dist/docx/protection-legacy.d.ts +13 -0
  102. package/dist/docx/protection-legacy.d.ts.map +1 -0
  103. package/dist/docx/protection.d.ts +30 -0
  104. package/dist/docx/protection.d.ts.map +1 -0
  105. package/dist/docx/save.d.ts.map +1 -1
  106. package/dist/docx/settings.d.ts +6 -1
  107. package/dist/docx/settings.d.ts.map +1 -1
  108. package/dist/docx/ui/customization.d.ts.map +1 -1
  109. package/dist/docx/ui/edit-restriction.d.ts +53 -0
  110. package/dist/docx/ui/edit-restriction.d.ts.map +1 -0
  111. package/dist/docx/ui/index.cjs +548 -18
  112. package/dist/docx/ui/index.d.ts +4 -0
  113. package/dist/docx/ui/index.d.ts.map +1 -1
  114. package/dist/docx/ui/index.mjs +528 -19
  115. package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
  116. package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
  117. package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
  118. package/dist/docx/write-paragraph.d.ts.map +1 -1
  119. package/dist/drawingml/index.cjs +1 -0
  120. package/dist/drawingml/index.mjs +1 -0
  121. package/dist/drawingml/write-theme.d.ts +2 -0
  122. package/dist/drawingml/write-theme.d.ts.map +1 -1
  123. package/dist/index.cjs +342 -96
  124. package/dist/index.mjs +343 -97
  125. package/dist/opc/index.cjs +5 -0
  126. package/dist/opc/index.d.ts +1 -0
  127. package/dist/opc/index.d.ts.map +1 -1
  128. package/dist/opc/index.mjs +5 -1
  129. package/dist/opc/zlib.d.ts +6 -0
  130. package/dist/opc/zlib.d.ts.map +1 -0
  131. package/dist/pptx/automation/index.cjs +1919 -758
  132. package/dist/pptx/automation/index.d.ts +37 -3
  133. package/dist/pptx/automation/index.d.ts.map +1 -1
  134. package/dist/pptx/automation/index.mjs +252 -10
  135. package/dist/pptx/automation/schemas/index.cjs +26 -0
  136. package/dist/pptx/automation/schemas/index.d.ts +26 -1
  137. package/dist/pptx/automation/schemas/index.d.ts.map +1 -0
  138. package/dist/pptx/automation/schemas/index.mjs +1 -1
  139. package/dist/pptx/chunks/index-Bp-1pGo1.d.ts.map +1 -1
  140. package/dist/pptx/chunks/{index-BuMPQDQb.d.ts → index-pLLN4OTz.d.ts} +37 -10
  141. package/dist/pptx/chunks/{index-BuMPQDQb.d.ts.map → index-pLLN4OTz.d.ts.map} +1 -1
  142. package/dist/pptx/cli/index.cjs +281 -116
  143. package/dist/pptx/cli/index.mjs +4 -4
  144. package/dist/pptx/converter/index.mjs +2 -2
  145. package/dist/pptx/editor/render/custom-show-operations.cjs +133 -0
  146. package/dist/pptx/editor/render/custom-show-operations.d.ts +42 -0
  147. package/dist/pptx/editor/render/custom-show-operations.d.ts.map +1 -0
  148. package/dist/pptx/editor/render/custom-show-operations.mjs +119 -0
  149. package/dist/pptx/editor/render/find-replace.cjs +15 -14
  150. package/dist/pptx/editor/render/find-replace.d.ts +1 -1
  151. package/dist/pptx/editor/render/find-replace.mjs +2 -1
  152. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  153. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  154. package/dist/pptx/editor/render/table-data-grid-ops.cjs +1 -1
  155. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  156. package/dist/pptx/index.cjs +1656 -761
  157. package/dist/pptx/index.d.ts +2 -2
  158. package/dist/pptx/index.mjs +5 -5
  159. package/dist/teams/index.cjs +213 -26
  160. package/dist/teams/index.mjs +213 -26
  161. package/dist/text/index.cjs +241 -0
  162. package/dist/text/index.d.ts +2 -0
  163. package/dist/text/index.d.ts.map +1 -1
  164. package/dist/text/index.mjs +240 -1
  165. package/dist/text/truetype/parse.d.ts +36 -0
  166. package/dist/text/truetype/parse.d.ts.map +1 -0
  167. package/dist/text/truetype/subset.d.ts +16 -0
  168. package/dist/text/truetype/subset.d.ts.map +1 -0
  169. package/dist/visio/action-formula.d.ts +21 -0
  170. package/dist/visio/action-formula.d.ts.map +1 -0
  171. package/dist/visio/action-menu.d.ts +8 -0
  172. package/dist/visio/action-menu.d.ts.map +1 -0
  173. package/dist/visio/bevel-3d.d.ts +61 -0
  174. package/dist/visio/bevel-3d.d.ts.map +1 -0
  175. package/dist/visio/cell-formula.d.ts.map +1 -1
  176. package/dist/visio/cff-masters.d.ts +17 -0
  177. package/dist/visio/cff-masters.d.ts.map +1 -0
  178. package/dist/visio/cff-recalc.d.ts +17 -0
  179. package/dist/visio/cff-recalc.d.ts.map +1 -0
  180. package/dist/visio/container-relationships.d.ts +40 -6
  181. package/dist/visio/container-relationships.d.ts.map +1 -1
  182. package/dist/visio/control-formula.d.ts +13 -0
  183. package/dist/visio/control-formula.d.ts.map +1 -0
  184. package/dist/visio/data-connections.d.ts +32 -0
  185. package/dist/visio/data-connections.d.ts.map +1 -0
  186. package/dist/visio/data-recordsets.d.ts +7 -0
  187. package/dist/visio/data-recordsets.d.ts.map +1 -1
  188. package/dist/visio/data-refresh.d.ts +33 -0
  189. package/dist/visio/data-refresh.d.ts.map +1 -0
  190. package/dist/visio/edit-action.d.ts +22 -0
  191. package/dist/visio/edit-action.d.ts.map +1 -0
  192. package/dist/visio/edit-commands.d.ts +9 -1
  193. package/dist/visio/edit-commands.d.ts.map +1 -1
  194. package/dist/visio/edit-connector-glue.d.ts +24 -1
  195. package/dist/visio/edit-connector-glue.d.ts.map +1 -1
  196. package/dist/visio/edit-connector-layout.d.ts.map +1 -1
  197. package/dist/visio/edit-connector-org.d.ts +11 -0
  198. package/dist/visio/edit-connector-org.d.ts.map +1 -0
  199. package/dist/visio/edit-connector-reroute.d.ts.map +1 -1
  200. package/dist/visio/edit-connector-world.d.ts +25 -0
  201. package/dist/visio/edit-connector-world.d.ts.map +1 -0
  202. package/dist/visio/edit-connector.d.ts +5 -1
  203. package/dist/visio/edit-connector.d.ts.map +1 -1
  204. package/dist/visio/edit-container-fit.d.ts +15 -2
  205. package/dist/visio/edit-container-fit.d.ts.map +1 -1
  206. package/dist/visio/edit-container-members.d.ts +12 -0
  207. package/dist/visio/edit-container-members.d.ts.map +1 -1
  208. package/dist/visio/edit-container-options.d.ts +33 -0
  209. package/dist/visio/edit-container-options.d.ts.map +1 -0
  210. package/dist/visio/edit-control.d.ts +28 -0
  211. package/dist/visio/edit-control.d.ts.map +1 -0
  212. package/dist/visio/edit-data-commands.d.ts +5 -0
  213. package/dist/visio/edit-data-commands.d.ts.map +1 -1
  214. package/dist/visio/edit-data-parts.d.ts +2 -0
  215. package/dist/visio/edit-data-parts.d.ts.map +1 -1
  216. package/dist/visio/edit-data.d.ts.map +1 -1
  217. package/dist/visio/edit-diagram-parts-commands.d.ts +2 -1
  218. package/dist/visio/edit-diagram-parts-commands.d.ts.map +1 -1
  219. package/dist/visio/edit-diagram-parts.d.ts +8 -0
  220. package/dist/visio/edit-diagram-parts.d.ts.map +1 -1
  221. package/dist/visio/edit-formatting-commands.d.ts +4 -0
  222. package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
  223. package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
  224. package/dist/visio/edit-geometry.d.ts.map +1 -1
  225. package/dist/visio/edit-group-resize-instances.d.ts +43 -0
  226. package/dist/visio/edit-group-resize-instances.d.ts.map +1 -0
  227. package/dist/visio/edit-group-resize.d.ts +1 -0
  228. package/dist/visio/edit-group-resize.d.ts.map +1 -1
  229. package/dist/visio/edit-group-rotation.d.ts +8 -0
  230. package/dist/visio/edit-group-rotation.d.ts.map +1 -1
  231. package/dist/visio/edit-instance-checks.d.ts.map +1 -1
  232. package/dist/visio/edit-instance-geometry.d.ts +13 -0
  233. package/dist/visio/edit-instance-geometry.d.ts.map +1 -1
  234. package/dist/visio/edit-instance-sheet.d.ts.map +1 -1
  235. package/dist/visio/edit-master-add.d.ts +3 -0
  236. package/dist/visio/edit-master-add.d.ts.map +1 -1
  237. package/dist/visio/edit-master-drop.d.ts.map +1 -1
  238. package/dist/visio/edit-master-media.d.ts +22 -0
  239. package/dist/visio/edit-master-media.d.ts.map +1 -0
  240. package/dist/visio/edit-master-scope.d.ts.map +1 -1
  241. package/dist/visio/edit-package.d.ts.map +1 -1
  242. package/dist/visio/edit-page-theme-commands.d.ts +26 -0
  243. package/dist/visio/edit-page-theme-commands.d.ts.map +1 -1
  244. package/dist/visio/edit-page-theme-part.d.ts +6 -0
  245. package/dist/visio/edit-page-theme-part.d.ts.map +1 -0
  246. package/dist/visio/edit-page-theme.d.ts +9 -1
  247. package/dist/visio/edit-page-theme.d.ts.map +1 -1
  248. package/dist/visio/edit-picture-adjust.d.ts +32 -0
  249. package/dist/visio/edit-picture-adjust.d.ts.map +1 -0
  250. package/dist/visio/edit-resize-anchor.d.ts.map +1 -1
  251. package/dist/visio/edit-sheet-cells.d.ts +23 -0
  252. package/dist/visio/edit-sheet-cells.d.ts.map +1 -0
  253. package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
  254. package/dist/visio/edit-stencil-connector.d.ts +7 -2
  255. package/dist/visio/edit-stencil-connector.d.ts.map +1 -1
  256. package/dist/visio/edit-stencil-import.d.ts +1 -1
  257. package/dist/visio/edit-stencil-import.d.ts.map +1 -1
  258. package/dist/visio/edit-style-admission.d.ts +6 -0
  259. package/dist/visio/edit-style-admission.d.ts.map +1 -1
  260. package/dist/visio/edit-swimlane-clone.d.ts +7 -0
  261. package/dist/visio/edit-swimlane-clone.d.ts.map +1 -0
  262. package/dist/visio/edit-swimlane-commands.d.ts +91 -0
  263. package/dist/visio/edit-swimlane-commands.d.ts.map +1 -0
  264. package/dist/visio/edit-swimlane-layout.d.ts +71 -0
  265. package/dist/visio/edit-swimlane-layout.d.ts.map +1 -0
  266. package/dist/visio/edit-swimlane-ops.d.ts +12 -0
  267. package/dist/visio/edit-swimlane-ops.d.ts.map +1 -0
  268. package/dist/visio/edit-swimlane-shapes.d.ts +42 -0
  269. package/dist/visio/edit-swimlane-shapes.d.ts.map +1 -0
  270. package/dist/visio/edit-swimlane-turn.d.ts +9 -0
  271. package/dist/visio/edit-swimlane-turn.d.ts.map +1 -0
  272. package/dist/visio/edit.d.ts.map +1 -1
  273. package/dist/visio/effects.d.ts +3 -2
  274. package/dist/visio/effects.d.ts.map +1 -1
  275. package/dist/visio/geometry.d.ts +2 -1
  276. package/dist/visio/geometry.d.ts.map +1 -1
  277. package/dist/visio/index.cjs +12115 -7631
  278. package/dist/visio/index.d.ts +13 -0
  279. package/dist/visio/index.d.ts.map +1 -1
  280. package/dist/visio/index.mjs +12101 -7632
  281. package/dist/visio/infinite-line.d.ts +17 -0
  282. package/dist/visio/infinite-line.d.ts.map +1 -0
  283. package/dist/visio/model.d.ts +62 -0
  284. package/dist/visio/model.d.ts.map +1 -1
  285. package/dist/visio/package-kind.d.ts +34 -0
  286. package/dist/visio/package-kind.d.ts.map +1 -0
  287. package/dist/visio/page-theme.d.ts +7 -0
  288. package/dist/visio/page-theme.d.ts.map +1 -1
  289. package/dist/visio/paragraphs.d.ts +1 -1
  290. package/dist/visio/paragraphs.d.ts.map +1 -1
  291. package/dist/visio/parser.d.ts +2 -2
  292. package/dist/visio/parser.d.ts.map +1 -1
  293. package/dist/visio/shadow.d.ts +2 -1
  294. package/dist/visio/shadow.d.ts.map +1 -1
  295. package/dist/visio/shape-sections-types.d.ts +71 -0
  296. package/dist/visio/shape-sections-types.d.ts.map +1 -0
  297. package/dist/visio/shape-sections.d.ts +11 -0
  298. package/dist/visio/shape-sections.d.ts.map +1 -0
  299. package/dist/visio/shape-structure.d.ts +14 -1
  300. package/dist/visio/shape-structure.d.ts.map +1 -1
  301. package/dist/visio/shapes.d.ts +7 -1
  302. package/dist/visio/shapes.d.ts.map +1 -1
  303. package/dist/visio/stencil-file.d.ts +2 -2
  304. package/dist/visio/style.d.ts.map +1 -1
  305. package/dist/visio/swimlane-membership.d.ts +12 -0
  306. package/dist/visio/swimlane-membership.d.ts.map +1 -0
  307. package/dist/visio/swimlane-stack.d.ts +67 -0
  308. package/dist/visio/swimlane-stack.d.ts.map +1 -0
  309. package/dist/visio/tab-stops.d.ts +20 -0
  310. package/dist/visio/tab-stops.d.ts.map +1 -0
  311. package/dist/visio/theme-builtins.d.ts +3 -0
  312. package/dist/visio/theme-builtins.d.ts.map +1 -1
  313. package/dist/visio/theme-effects.d.ts +19 -0
  314. package/dist/visio/theme-effects.d.ts.map +1 -0
  315. package/dist/visio/theme-font.d.ts +13 -0
  316. package/dist/visio/theme-font.d.ts.map +1 -0
  317. package/dist/visio/theme-line.d.ts +10 -0
  318. package/dist/visio/theme-line.d.ts.map +1 -1
  319. package/dist/visio/theme-write.d.ts.map +1 -1
  320. package/dist/visio/theme.d.ts +7 -0
  321. package/dist/visio/theme.d.ts.map +1 -1
  322. package/dist/visio/ui/data-graphic-config.d.ts +46 -0
  323. package/dist/visio/ui/data-graphic-config.d.ts.map +1 -0
  324. package/dist/visio/ui/data-graphic-items.d.ts +23 -0
  325. package/dist/visio/ui/data-graphic-items.d.ts.map +1 -0
  326. package/dist/visio/ui/data-graphic-rules.d.ts +14 -0
  327. package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
  328. package/dist/visio/ui/data-graphics.d.ts +10 -1
  329. package/dist/visio/ui/data-graphics.d.ts.map +1 -1
  330. package/dist/visio/ui/data-visualizer-edits.d.ts +22 -0
  331. package/dist/visio/ui/data-visualizer-edits.d.ts.map +1 -0
  332. package/dist/visio/ui/data-visualizer.d.ts +47 -0
  333. package/dist/visio/ui/data-visualizer.d.ts.map +1 -0
  334. package/dist/visio/ui/diagram-parts.d.ts +8 -1
  335. package/dist/visio/ui/diagram-parts.d.ts.map +1 -1
  336. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  337. package/dist/visio/ui/guides.d.ts +9 -1
  338. package/dist/visio/ui/guides.d.ts.map +1 -1
  339. package/dist/visio/ui/index.cjs +44031 -38653
  340. package/dist/visio/ui/index.d.ts +10 -0
  341. package/dist/visio/ui/index.d.ts.map +1 -1
  342. package/dist/visio/ui/index.mjs +43976 -38654
  343. package/dist/visio/ui/org-chart-edit.d.ts +52 -0
  344. package/dist/visio/ui/org-chart-edit.d.ts.map +1 -0
  345. package/dist/visio/ui/org-chart-import.d.ts +35 -0
  346. package/dist/visio/ui/org-chart-import.d.ts.map +1 -0
  347. package/dist/visio/ui/org-chart-layout.d.ts +43 -0
  348. package/dist/visio/ui/org-chart-layout.d.ts.map +1 -0
  349. package/dist/visio/ui/org-chart-stencil-data.d.ts +11 -0
  350. package/dist/visio/ui/org-chart-stencil-data.d.ts.map +1 -0
  351. package/dist/visio/ui/org-chart-template.d.ts +7 -0
  352. package/dist/visio/ui/org-chart-template.d.ts.map +1 -0
  353. package/dist/visio/ui/org-chart.d.ts +63 -0
  354. package/dist/visio/ui/org-chart.d.ts.map +1 -0
  355. package/dist/visio/ui/resize-snap.d.ts +51 -0
  356. package/dist/visio/ui/resize-snap.d.ts.map +1 -0
  357. package/dist/visio/ui/sample-drawing.d.ts +26 -0
  358. package/dist/visio/ui/sample-drawing.d.ts.map +1 -1
  359. package/dist/visio/ui/scene-validation.d.ts.map +1 -1
  360. package/dist/visio/ui/selection-connectors.d.ts +10 -0
  361. package/dist/visio/ui/selection-connectors.d.ts.map +1 -0
  362. package/dist/visio/ui/selection-resize.d.ts +2 -2
  363. package/dist/visio/ui/selection-resize.d.ts.map +1 -1
  364. package/dist/visio/ui/shape-group.d.ts +3 -1
  365. package/dist/visio/ui/shape-group.d.ts.map +1 -1
  366. package/dist/visio/ui/shape-move.d.ts.map +1 -1
  367. package/dist/visio/ui/shape-resize.d.ts +29 -1
  368. package/dist/visio/ui/shape-resize.d.ts.map +1 -1
  369. package/dist/visio/ui/shape-rotation.d.ts +3 -1
  370. package/dist/visio/ui/shape-rotation.d.ts.map +1 -1
  371. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  372. package/dist/visio/ui/swimlane.d.ts +37 -0
  373. package/dist/visio/ui/swimlane.d.ts.map +1 -0
  374. package/dist/visio/ui/templates.d.ts +30 -0
  375. package/dist/visio/ui/templates.d.ts.map +1 -0
  376. package/dist/xlsx/audit/ast-text.d.ts +12 -0
  377. package/dist/xlsx/audit/ast-text.d.ts.map +1 -0
  378. package/dist/xlsx/audit/error-check.d.ts +23 -0
  379. package/dist/xlsx/audit/error-check.d.ts.map +1 -0
  380. package/dist/xlsx/audit/evaluate-steps.d.ts +48 -0
  381. package/dist/xlsx/audit/evaluate-steps.d.ts.map +1 -0
  382. package/dist/xlsx/audit/index.d.ts +6 -0
  383. package/dist/xlsx/audit/index.d.ts.map +1 -0
  384. package/dist/xlsx/audit/trace.d.ts +59 -0
  385. package/dist/xlsx/audit/trace.d.ts.map +1 -0
  386. package/dist/xlsx/audit/watch.d.ts +17 -0
  387. package/dist/xlsx/audit/watch.d.ts.map +1 -0
  388. package/dist/xlsx/edit/filter.d.ts +5 -2
  389. package/dist/xlsx/edit/filter.d.ts.map +1 -1
  390. package/dist/xlsx/edit/index.d.ts +4 -1
  391. package/dist/xlsx/edit/index.d.ts.map +1 -1
  392. package/dist/xlsx/edit/session.d.ts.map +1 -1
  393. package/dist/xlsx/edit/sort-choices.d.ts +23 -0
  394. package/dist/xlsx/edit/sort-choices.d.ts.map +1 -0
  395. package/dist/xlsx/edit/sort-keys.d.ts +49 -0
  396. package/dist/xlsx/edit/sort-keys.d.ts.map +1 -0
  397. package/dist/xlsx/edit/sort-reapply.d.ts +11 -0
  398. package/dist/xlsx/edit/sort-reapply.d.ts.map +1 -0
  399. package/dist/xlsx/edit/sort.d.ts +14 -12
  400. package/dist/xlsx/edit/sort.d.ts.map +1 -1
  401. package/dist/xlsx/edit/types.d.ts +7 -6
  402. package/dist/xlsx/edit/types.d.ts.map +1 -1
  403. package/dist/xlsx/edit/view.d.ts +9 -1
  404. package/dist/xlsx/edit/view.d.ts.map +1 -1
  405. package/dist/xlsx/filter-criteria.d.ts +2 -1
  406. package/dist/xlsx/filter-criteria.d.ts.map +1 -1
  407. package/dist/xlsx/formula/engine-types.d.ts +8 -0
  408. package/dist/xlsx/formula/engine-types.d.ts.map +1 -1
  409. package/dist/xlsx/formula/engine.d.ts.map +1 -1
  410. package/dist/xlsx/index.cjs +5478 -4220
  411. package/dist/xlsx/index.d.ts +1 -0
  412. package/dist/xlsx/index.d.ts.map +1 -1
  413. package/dist/xlsx/index.mjs +5450 -4221
  414. package/dist/xlsx/layout/index.d.ts +1 -0
  415. package/dist/xlsx/layout/index.d.ts.map +1 -1
  416. package/dist/xlsx/layout/split.d.ts +55 -0
  417. package/dist/xlsx/layout/split.d.ts.map +1 -0
  418. package/dist/xlsx/layout/viewport.d.ts +2 -0
  419. package/dist/xlsx/layout/viewport.d.ts.map +1 -1
  420. package/dist/xlsx/load/index.cjs +305 -109
  421. package/dist/xlsx/load/index.mjs +305 -109
  422. package/dist/xlsx/model-sort.d.ts +27 -0
  423. package/dist/xlsx/model-sort.d.ts.map +1 -0
  424. package/dist/xlsx/model.d.ts +39 -1
  425. package/dist/xlsx/model.d.ts.map +1 -1
  426. package/dist/xlsx/read/ignored-errors.d.ts +4 -0
  427. package/dist/xlsx/read/ignored-errors.d.ts.map +1 -0
  428. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  429. package/dist/xlsx/read/sort-state.d.ts +5 -0
  430. package/dist/xlsx/read/sort-state.d.ts.map +1 -0
  431. package/dist/xlsx/read/tables.d.ts +2 -2
  432. package/dist/xlsx/read/tables.d.ts.map +1 -1
  433. package/dist/xlsx/read/worksheet.d.ts.map +1 -1
  434. package/dist/xlsx/sort-lists.d.ts +6 -0
  435. package/dist/xlsx/sort-lists.d.ts.map +1 -0
  436. package/dist/xlsx/ui/audit-state.d.ts +19 -0
  437. package/dist/xlsx/ui/audit-state.d.ts.map +1 -0
  438. package/dist/xlsx/ui/commands/audit.d.ts +3 -0
  439. package/dist/xlsx/ui/commands/audit.d.ts.map +1 -0
  440. package/dist/xlsx/ui/commands/formulas.d.ts.map +1 -1
  441. package/dist/xlsx/ui/commands/i18n/audit.d.ts +3 -0
  442. package/dist/xlsx/ui/commands/i18n/audit.d.ts.map +1 -0
  443. package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
  444. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  445. package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts.map +1 -1
  446. package/dist/xlsx/ui/commands/i18n/rules.d.ts.map +1 -1
  447. package/dist/xlsx/ui/commands/icons.d.ts.map +1 -1
  448. package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -1
  449. package/dist/xlsx/ui/context.d.ts +6 -1
  450. package/dist/xlsx/ui/context.d.ts.map +1 -1
  451. package/dist/xlsx/ui/grid/geometry.d.ts +29 -1
  452. package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -1
  453. package/dist/xlsx/ui/index.cjs +10761 -9573
  454. package/dist/xlsx/ui/index.d.ts +1 -0
  455. package/dist/xlsx/ui/index.d.ts.map +1 -1
  456. package/dist/xlsx/ui/index.mjs +10755 -9574
  457. package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -1
  458. package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts.map +1 -1
  459. package/dist/xlsx/write/filter-columns.d.ts +14 -0
  460. package/dist/xlsx/write/filter-columns.d.ts.map +1 -1
  461. package/dist/xlsx/write/ignored-errors.d.ts +3 -0
  462. package/dist/xlsx/write/ignored-errors.d.ts.map +1 -0
  463. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  464. package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
  465. package/dist/xlsx/write/sort-state.d.ts +55 -0
  466. package/dist/xlsx/write/sort-state.d.ts.map +1 -0
  467. package/dist/xlsx/write/table-patch.d.ts +2 -1
  468. package/dist/xlsx/write/table-patch.d.ts.map +1 -1
  469. package/dist/xlsx/write/tables.d.ts +2 -1
  470. package/dist/xlsx/write/tables.d.ts.map +1 -1
  471. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  472. package/package.json +2 -2
  473. package/dist/PptxHandler-MGKMIK22.cjs +0 -13
  474. package/dist/PptxHandler-TEC7SWBU.mjs +0 -4
  475. package/dist/chunk-MHNETXQB.mjs +0 -1
@@ -414,8 +414,8 @@ function parseHalfPoints(value) {
414
414
  function parseSignedHalfPoints(value) {
415
415
  if (value === null || value === void 0) return void 0;
416
416
  const text = value.trim();
417
- const integer4 = parseInteger(text);
418
- if (integer4 !== void 0) return halfPoints(integer4);
417
+ const integer5 = parseInteger(text);
418
+ if (integer5 !== void 0) return halfPoints(integer5);
419
419
  const twips3 = universalMeasureToTwips(text);
420
420
  return twips3 === void 0 ? void 0 : halfPoints(Math.sign(twips3) * Math.round(Math.abs(twips3) / 10));
421
421
  }
@@ -1585,14 +1585,14 @@ function parseArtisticPictureExtension(node) {
1585
1585
  if (node.namespaceURI !== NS.a || node.localName !== "extLst") return void 0;
1586
1586
  const found = [];
1587
1587
  const unhandled = [];
1588
- const pending = [node];
1589
- while (pending.length) {
1590
- const item2 = pending.pop();
1588
+ const pending2 = [node];
1589
+ while (pending2.length) {
1590
+ const item2 = pending2.pop();
1591
1591
  if (item2 !== node && !(item2.namespaceURI === NS.a && item2.localName === "ext") && !(item2.namespaceURI === "http://schemas.microsoft.com/office/drawing/2010/main" && (["imgProps", "imgLayer", "imgEffect", "useLocalDpi"].includes(item2.localName) || ARTISTIC_PRIMARY_ATTRIBUTE[item2.localName])))
1592
1592
  unhandled.push(item2.localName);
1593
1593
  if (item2.namespaceURI === "http://schemas.microsoft.com/office/drawing/2010/main" && item2.localName.startsWith("artistic"))
1594
1594
  found.push(item2);
1595
- pending.push(...elements(item2));
1595
+ pending2.push(...elements(item2));
1596
1596
  }
1597
1597
  if (found.length !== 1) return void 0;
1598
1598
  const effect = found[0];
@@ -7031,8 +7031,33 @@ function reconcileBookmarks(doc, starts, ends, names, baseNames, nextId) {
7031
7031
  return { starts: keptStarts, ends: keptEnds };
7032
7032
  }
7033
7033
 
7034
+ // docx/permission-markers.ts
7035
+ var setAttribute4 = (element4, local, value) => element4.setAttributeNS(WORD_NS, `w:${local}`, value);
7036
+ var isPermission = (element4) => named2(element4, "permStart") || named2(element4, "permEnd");
7037
+ function changedPermissionMarkers(doc, paragraph2, base, source2, length) {
7038
+ if (!base || JSON.stringify(paragraph2.permissions ?? null) === JSON.stringify(base.permissions ?? null))
7039
+ return void 0;
7040
+ const spans = (list2) => list2?.some((r) => r.fromPrevious || r.toNext);
7041
+ if (spans(paragraph2.permissions) || spans(base.permissions)) return void 0;
7042
+ const drop = new Set(source2.filter(isPermission));
7043
+ const added = [];
7044
+ for (const range of paragraph2.permissions ?? []) {
7045
+ const start = makeW(doc, "permStart");
7046
+ setAttribute4(start, "id", range.id);
7047
+ if (range.group !== void 0) setAttribute4(start, "edGrp", range.group);
7048
+ if (range.user !== void 0) setAttribute4(start, "ed", range.user);
7049
+ const end = makeW(doc, "permEnd");
7050
+ setAttribute4(end, "id", range.id);
7051
+ added.push(
7052
+ { element: start, position: Math.min(range.from, length), source: range.from, opening: true },
7053
+ { element: end, position: Math.min(range.to, length), source: range.to, opening: false }
7054
+ );
7055
+ }
7056
+ return { drop, added };
7057
+ }
7058
+
7034
7059
  // docx/numbering-write.ts
7035
- function setAttribute4(element4, local, value) {
7060
+ function setAttribute5(element4, local, value) {
7036
7061
  element4.setAttributeNS(WORD_NS, `w:${local}`, value);
7037
7062
  }
7038
7063
  function sameNumbering(a2, b) {
@@ -7044,16 +7069,16 @@ function writeNumberingProperties(doc, props, paragraph2, base) {
7044
7069
  if (!paragraph2.numbering) return;
7045
7070
  const numPr = makeW(doc, "numPr");
7046
7071
  const ilvl = makeW(doc, "ilvl");
7047
- setAttribute4(ilvl, "val", String(paragraph2.numbering.level));
7072
+ setAttribute5(ilvl, "val", String(paragraph2.numbering.level));
7048
7073
  numPr.appendChild(ilvl);
7049
7074
  const numId = makeW(doc, "numId");
7050
- setAttribute4(numId, "val", String(paragraph2.numbering.numId));
7075
+ setAttribute5(numId, "val", String(paragraph2.numbering.numId));
7051
7076
  numPr.appendChild(numId);
7052
7077
  props.appendChild(numPr);
7053
7078
  }
7054
7079
 
7055
7080
  // docx/write-run-extra.ts
7056
- function setAttribute5(element4, local, value) {
7081
+ function setAttribute6(element4, local, value) {
7057
7082
  element4.setAttributeNS(WORD_NS, `w:${local}`, value);
7058
7083
  }
7059
7084
  function removeChildren2(element4, local) {
@@ -7063,7 +7088,7 @@ function setToggle(doc, props, local, value) {
7063
7088
  removeChildren2(props, local);
7064
7089
  if (value === void 0) return;
7065
7090
  const element4 = makeW(doc, local);
7066
- if (!value) setAttribute5(element4, "val", "0");
7091
+ if (!value) setAttribute6(element4, "val", "0");
7067
7092
  props.appendChild(element4);
7068
7093
  }
7069
7094
  function setExtendedRunProperties(doc, props, run2, base) {
@@ -7073,7 +7098,7 @@ function setExtendedRunProperties(doc, props, run2, base) {
7073
7098
  removeChildren2(props, "rStyle");
7074
7099
  if (run2.style) {
7075
7100
  const style = makeW(doc, "rStyle");
7076
- setAttribute5(style, "val", run2.style);
7101
+ setAttribute6(style, "val", run2.style);
7077
7102
  props.insertBefore(style, props.firstChild);
7078
7103
  }
7079
7104
  }
@@ -7090,14 +7115,14 @@ function setExtendedRunProperties(doc, props, run2, base) {
7090
7115
  removeChildren2(props, local);
7091
7116
  if (run2[key] === void 0) continue;
7092
7117
  const element4 = makeW(doc, local);
7093
- setAttribute5(element4, "val", String(run2[key]));
7118
+ setAttribute6(element4, "val", String(run2[key]));
7094
7119
  props.appendChild(element4);
7095
7120
  }
7096
7121
  if (changed("characterSpacingTwips")) {
7097
7122
  removeChildren2(props, "spacing");
7098
7123
  if (run2.characterSpacingTwips !== void 0) {
7099
7124
  const spacing2 = makeW(doc, "spacing");
7100
- setAttribute5(spacing2, "val", String(Math.round(run2.characterSpacingTwips)));
7125
+ setAttribute6(spacing2, "val", String(Math.round(run2.characterSpacingTwips)));
7101
7126
  props.appendChild(spacing2);
7102
7127
  }
7103
7128
  }
@@ -7105,14 +7130,14 @@ function setExtendedRunProperties(doc, props, run2, base) {
7105
7130
  removeChildren2(props, "shd");
7106
7131
  if (run2.shadingFill || run2.shadingThemeFill) {
7107
7132
  const shd = makeW(doc, "shd");
7108
- setAttribute5(shd, "val", "clear");
7109
- setAttribute5(shd, "fill", run2.shadingFill ? run2.shadingFill.replace(/^#/, "") : "auto");
7133
+ setAttribute6(shd, "val", "clear");
7134
+ setAttribute6(shd, "fill", run2.shadingFill ? run2.shadingFill.replace(/^#/, "") : "auto");
7110
7135
  if (run2.shadingThemeFill) {
7111
- setAttribute5(shd, "themeFill", run2.shadingThemeFill.token);
7136
+ setAttribute6(shd, "themeFill", run2.shadingThemeFill.token);
7112
7137
  if (run2.shadingThemeFill.tint !== void 0)
7113
- setAttribute5(shd, "themeFillTint", fractionToThemeByte(run2.shadingThemeFill.tint));
7138
+ setAttribute6(shd, "themeFillTint", fractionToThemeByte(run2.shadingThemeFill.tint));
7114
7139
  if (run2.shadingThemeFill.shade !== void 0)
7115
- setAttribute5(shd, "themeFillShade", fractionToThemeByte(run2.shadingThemeFill.shade));
7140
+ setAttribute6(shd, "themeFillShade", fractionToThemeByte(run2.shadingThemeFill.shade));
7116
7141
  }
7117
7142
  props.appendChild(shd);
7118
7143
  }
@@ -7751,25 +7776,25 @@ function parseCustomGeometry(custom, width, height) {
7751
7776
  const value = (node, name) => operand(node.getAttribute(name), vars);
7752
7777
  for (const node of elements(path3)) {
7753
7778
  if (node.namespaceURI !== NS.a) return void 0;
7754
- const points = children(node, "pt", NS.a).map((point) => ({
7779
+ const points2 = children(node, "pt", NS.a).map((point) => ({
7755
7780
  x: value(point, "x"),
7756
7781
  y: value(point, "y")
7757
7782
  }));
7758
- if (points.some((point) => !Number.isFinite(point.x) || !Number.isFinite(point.y)))
7783
+ if (points2.some((point) => !Number.isFinite(point.x) || !Number.isFinite(point.y)))
7759
7784
  return void 0;
7760
- const [p0, p1, p2] = points;
7785
+ const [p0, p1, p2] = points2;
7761
7786
  switch (node.localName) {
7762
7787
  case "moveTo":
7763
7788
  case "lnTo":
7764
- if (points.length !== 1 || !p0) return void 0;
7789
+ if (points2.length !== 1 || !p0) return void 0;
7765
7790
  commands.push({ op: node.localName === "moveTo" ? "M" : "L", ...p0 });
7766
7791
  break;
7767
7792
  case "quadBezTo":
7768
- if (points.length !== 2 || !p0 || !p1) return void 0;
7793
+ if (points2.length !== 2 || !p0 || !p1) return void 0;
7769
7794
  commands.push({ op: "Q", x1: p0.x, y1: p0.y, ...p1 });
7770
7795
  break;
7771
7796
  case "cubicBezTo":
7772
- if (points.length !== 3 || !p0 || !p1 || !p2) return void 0;
7797
+ if (points2.length !== 3 || !p0 || !p1 || !p2) return void 0;
7773
7798
  commands.push({ op: "C", x1: p0.x, y1: p0.y, x2: p1.x, y2: p1.y, ...p2 });
7774
7799
  break;
7775
7800
  case "arcTo": {
@@ -8015,8 +8040,8 @@ function parseDrawingRunProperties(element4) {
8015
8040
 
8016
8041
  // drawingml/read-paragraph-properties.ts
8017
8042
  function parseDrawingTextSpacing(element4) {
8018
- const points = integerAttribute(first(element4, "spcPts", NS.a), "val");
8019
- if (points !== void 0) return { unit: "points", value: points / 100 };
8043
+ const points2 = integerAttribute(first(element4, "spcPts", NS.a), "val");
8044
+ if (points2 !== void 0) return { unit: "points", value: points2 / 100 };
8020
8045
  const percent = parseOoxmlPercent(first(element4, "spcPct", NS.a)?.getAttribute("val"));
8021
8046
  if (percent !== void 0) return { unit: "percent", value: percent };
8022
8047
  return void 0;
@@ -13958,9 +13983,9 @@ var heart = {
13958
13983
  }
13959
13984
  ]
13960
13985
  };
13961
- function buildIrregularSeal(name, points) {
13986
+ function buildIrregularSeal(name, points2) {
13962
13987
  const commands = [];
13963
- const first3 = points[0];
13988
+ const first3 = points2[0];
13964
13989
  if (!first3) {
13965
13990
  return {
13966
13991
  name,
@@ -13969,8 +13994,8 @@ function buildIrregularSeal(name, points) {
13969
13994
  };
13970
13995
  }
13971
13996
  commands.push({ kind: "moveTo", x: String(first3[0]), y: String(first3[1]) });
13972
- for (let i = 1; i < points.length; i++) {
13973
- const p = points[i];
13997
+ for (let i = 1; i < points2.length; i++) {
13998
+ const p = points2[i];
13974
13999
  commands.push({ kind: "lnTo", x: String(p[0]), y: String(p[1]) });
13975
14000
  }
13976
14001
  commands.push({ kind: "close" });
@@ -18992,15 +19017,15 @@ function isLastSiblingTransition(point) {
18992
19017
  }
18993
19018
  return false;
18994
19019
  }
18995
- function windowPoints(points, st = 1, cnt = 0, step = 1) {
18996
- if (points.length === 0) {
19020
+ function windowPoints(points2, st = 1, cnt = 0, step = 1) {
19021
+ if (points2.length === 0) {
18997
19022
  return [];
18998
19023
  }
18999
19024
  const stride = step === 0 ? 1 : step;
19000
- let index = st > 0 ? st - 1 : st < 0 ? points.length + st : 0;
19025
+ let index = st > 0 ? st - 1 : st < 0 ? points2.length + st : 0;
19001
19026
  const out = [];
19002
- while (index >= 0 && index < points.length) {
19003
- out.push(points[index]);
19027
+ while (index >= 0 && index < points2.length) {
19028
+ out.push(points2[index]);
19004
19029
  if (cnt > 0 && out.length >= cnt) {
19005
19030
  break;
19006
19031
  }
@@ -19012,12 +19037,12 @@ function iterateStep(point, iterator, step) {
19012
19037
  const axis = iterator.axis[step] ?? "none";
19013
19038
  const ptType = iterator.ptType[step] ?? iterator.ptType[iterator.ptType.length - 1] ?? "all";
19014
19039
  const hideLast = (iterator.hideLastTrans[step] ?? true) && SIBLING_AXES.has(axis);
19015
- let points = axisPoints(point, axis).filter((candidate) => matchesPointType(candidate, ptType));
19040
+ let points2 = axisPoints(point, axis).filter((candidate) => matchesPointType(candidate, ptType));
19016
19041
  if (hideLast) {
19017
- points = points.filter((candidate) => !isLastSiblingTransition(candidate));
19042
+ points2 = points2.filter((candidate) => !isLastSiblingTransition(candidate));
19018
19043
  }
19019
19044
  return windowPoints(
19020
- points,
19045
+ points2,
19021
19046
  iterator.st[step] ?? 1,
19022
19047
  iterator.cnt[step] ?? 0,
19023
19048
  iterator.step[step] ?? 1
@@ -23024,15 +23049,15 @@ function treeDepth(t, depth = 0) {
23024
23049
  }
23025
23050
 
23026
23051
  // diagram/layout/smartart-layout-interpreter-custom.ts
23027
- function parsePoints(points) {
23028
- return points.trim().split(/\s+/u).filter((pair) => pair.length > 0).map((pair) => {
23052
+ function parsePoints(points2) {
23053
+ return points2.trim().split(/\s+/u).filter((pair) => pair.length > 0).map((pair) => {
23029
23054
  const [x, y] = pair.split(",").map(Number);
23030
23055
  return [x, y];
23031
23056
  });
23032
23057
  }
23033
- function pointsBoundingBox(points) {
23034
- const xs = points.map(([x]) => x);
23035
- const ys = points.map(([, y]) => y);
23058
+ function pointsBoundingBox(points2) {
23059
+ const xs = points2.map(([x]) => x);
23060
+ const ys = points2.map(([, y]) => y);
23036
23061
  const minX = Math.min(...xs);
23037
23062
  const minY = Math.min(...ys);
23038
23063
  const maxX = Math.max(...xs);
@@ -23085,15 +23110,15 @@ function applyToCircle(node, custom, box) {
23085
23110
  };
23086
23111
  }
23087
23112
  function applyToPolygon(node, custom, box) {
23088
- const points = parsePoints(node.points);
23089
- const bbox = pointsBoundingBox(points);
23113
+ const points2 = parsePoints(node.points);
23114
+ const bbox = pointsBoundingBox(points2);
23090
23115
  const cx = bbox.x + bbox.width / 2;
23091
23116
  const cy = bbox.y + bbox.height / 2;
23092
23117
  const { x: scaleX, y: scaleY } = scaleRatios(custom);
23093
23118
  const flipX = custom.flipHorizontal ? -1 : 1;
23094
23119
  const flipY = custom.flipVertical ? -1 : 1;
23095
23120
  const { dx, dy } = positionNudge(custom, box);
23096
- const transformed = points.map(([x, y]) => {
23121
+ const transformed = points2.map(([x, y]) => {
23097
23122
  const relX = (x - cx) * scaleX * flipX;
23098
23123
  const relY = (y - cy) * scaleY * flipY;
23099
23124
  return `${cx + dx + relX},${cy + dy + relY}`;
@@ -24194,7 +24219,7 @@ function writeFabricatedDiagramData(data, ids, options = {}) {
24194
24219
  const docGuid = createModelId();
24195
24220
  const guidByNodeId = options.guidByNodeId ?? buildDiagramNodeGuidMap(data.nodes, createModelId);
24196
24221
  const presentationGuidByNodeId = options.presentationGuidByNodeId ?? buildDiagramPresentationGuidMap(data.nodes, createModelId);
24197
- const points = [docPointXml(docGuid, ids)];
24222
+ const points2 = [docPointXml(docGuid, ids)];
24198
24223
  const connections = [];
24199
24224
  const nextSrcOrd = /* @__PURE__ */ new Map();
24200
24225
  for (const node of data.nodes) {
@@ -24208,15 +24233,15 @@ function writeFabricatedDiagramData(data, ids, options = {}) {
24208
24233
  const cxnGuid = createModelId();
24209
24234
  const parTransGuid = createModelId();
24210
24235
  const sibTransGuid = createModelId();
24211
- points.push(contentPointXml(guid, node));
24212
- points.push(transPointXml(parTransGuid, "parTrans", cxnGuid));
24213
- points.push(transPointXml(sibTransGuid, "sibTrans", cxnGuid));
24236
+ points2.push(contentPointXml(guid, node));
24237
+ points2.push(transPointXml(parTransGuid, "parTrans", cxnGuid));
24238
+ points2.push(transPointXml(sibTransGuid, "sibTrans", cxnGuid));
24214
24239
  connections.push(
24215
24240
  `<dgm:cxn modelId="${cxnGuid}" srcId="${parentGuid}" destId="${guid}" srcOrd="${srcOrd}" destOrd="0" parTransId="${parTransGuid}" sibTransId="${sibTransGuid}"/>`
24216
24241
  );
24217
24242
  const presentationGuid = node.id ? presentationGuidByNodeId.get(node.id) : void 0;
24218
24243
  if (presentationGuid) {
24219
- points.push(
24244
+ points2.push(
24220
24245
  `<dgm:pt modelId="${presentationGuid}" type="pres"><dgm:prSet presAssocID="${guid}" presName="node" presStyleLbl="node1" presStyleIdx="${srcOrd}" presStyleCnt="${data.nodes.length}"/><dgm:spPr/></dgm:pt>`
24221
24246
  );
24222
24247
  connections.push(
@@ -24225,7 +24250,7 @@ function writeFabricatedDiagramData(data, ids, options = {}) {
24225
24250
  }
24226
24251
  }
24227
24252
  return `${DIAGRAM_XML_PROLOG}\r
24228
- <dgm:dataModel ${DIAGRAM_DATA_XMLNS}><dgm:ptLst>${points.join("")}</dgm:ptLst><dgm:cxnLst>${connections.join("")}</dgm:cxnLst><dgm:bg/><dgm:whole/>${dataModelExtXml(options.drawingRelId)}</dgm:dataModel>`;
24253
+ <dgm:dataModel ${DIAGRAM_DATA_XMLNS}><dgm:ptLst>${points2.join("")}</dgm:ptLst><dgm:cxnLst>${connections.join("")}</dgm:cxnLst><dgm:bg/><dgm:whole/>${dataModelExtXml(options.drawingRelId)}</dgm:dataModel>`;
24229
24254
  }
24230
24255
  function dataModelExtXml(drawingRelId) {
24231
24256
  if (!drawingRelId) {
@@ -24348,9 +24373,9 @@ function writeEditedDiagramData(xml, nodes, options = {}) {
24348
24373
  cxnLst = element2(doc, DGM, "dgm:cxnLst");
24349
24374
  ptLst.parentNode?.insertBefore(cxnLst, ptLst.nextSibling);
24350
24375
  }
24351
- const points = elements(ptLst).filter((el5) => el5.localName === "pt");
24352
- const pointById = new Map(points.map((pt) => [pt.getAttribute("modelId") ?? "", pt]));
24353
- const docPoint = points.find((pt) => pointType(pt) === "doc");
24376
+ const points2 = elements(ptLst).filter((el5) => el5.localName === "pt");
24377
+ const pointById = new Map(points2.map((pt) => [pt.getAttribute("modelId") ?? "", pt]));
24378
+ const docPoint = points2.find((pt) => pointType(pt) === "doc");
24354
24379
  const rootId = docPoint?.getAttribute("modelId");
24355
24380
  if (!rootId) throw new Error("The diagram data part has no document point.");
24356
24381
  const connections = () => elements(cxnLst).filter((el5) => el5.localName === "cxn");
@@ -24362,7 +24387,7 @@ function writeEditedDiagramData(xml, nodes, options = {}) {
24362
24387
  }
24363
24388
  const kept = new Set(idMap.values());
24364
24389
  const removed2 = /* @__PURE__ */ new Set();
24365
- for (const pt of points) {
24390
+ for (const pt of points2) {
24366
24391
  const id = pt.getAttribute("modelId") ?? "";
24367
24392
  if (CONTENT_TYPES.has(pointType(pt)) && !kept.has(id)) removed2.add(id);
24368
24393
  }
@@ -24376,14 +24401,14 @@ function writeEditedDiagramData(xml, nodes, options = {}) {
24376
24401
  if (id) removed2.add(id);
24377
24402
  }
24378
24403
  const cxnId = cxn2.getAttribute("modelId");
24379
- for (const pt of points)
24404
+ for (const pt of points2)
24380
24405
  if (cxnId && pt.getAttribute("cxnId") === cxnId)
24381
24406
  removed2.add(pt.getAttribute("modelId") ?? "");
24382
24407
  cxnLst.removeChild(cxn2);
24383
24408
  } else if (!parOfByDest.has(dest)) parOfByDest.set(dest, cxn2);
24384
24409
  }
24385
24410
  const removedPres = /* @__PURE__ */ new Set();
24386
- for (const pt of points)
24411
+ for (const pt of points2)
24387
24412
  if (pointType(pt) === "pres" && removed2.has(child5(pt, "prSet")?.getAttribute("presAssocID") ?? ""))
24388
24413
  removedPres.add(pt.getAttribute("modelId") ?? "");
24389
24414
  for (let grew = true; grew; ) {
@@ -24401,7 +24426,7 @@ function writeEditedDiagramData(xml, nodes, options = {}) {
24401
24426
  if (type === "presOf" && (removed2.has(src) || removedPres.has(dest)) || type === "presParOf" && (removedPres.has(src) || removedPres.has(dest)))
24402
24427
  cxnLst.removeChild(cxn2);
24403
24428
  }
24404
- for (const pt of points) {
24429
+ for (const pt of points2) {
24405
24430
  const id = pt.getAttribute("modelId") ?? "";
24406
24431
  if (removed2.has(id) || removedPres.has(id)) ptLst.removeChild(pt);
24407
24432
  }
@@ -24801,9 +24826,9 @@ var DEFAULT_GENERATED_DIAGRAM_SCHEME = {
24801
24826
  // diagram/data-model.ts
24802
24827
  var TRANSITION_TYPES = /* @__PURE__ */ new Set(["parTrans", "sibTrans"]);
24803
24828
  var STRUCTURAL_TYPES = /* @__PURE__ */ new Set(["doc", "pres", "parTrans", "sibTrans"]);
24804
- function collectTransitionText(points, describe, text) {
24829
+ function collectTransitionText(points2, describe, text) {
24805
24830
  const byId = /* @__PURE__ */ new Map();
24806
- for (const point of points) {
24831
+ for (const point of points2) {
24807
24832
  const { type, modelId } = describe(point);
24808
24833
  if (!TRANSITION_TYPES.has((type ?? "").trim())) continue;
24809
24834
  const id = (modelId ?? "").trim();
@@ -24865,7 +24890,7 @@ function parseDiagramDataModel(source2, part) {
24865
24890
  const root = (typeof source2 === "string" ? parseXml(source2, { label: "DiagramML" }) : source2).documentElement;
24866
24891
  const issues = [];
24867
24892
  const report = (code, message) => issues.push({ code, message, ...part ? { part } : {} });
24868
- const points = [];
24893
+ const points2 = [];
24869
24894
  const ids = /* @__PURE__ */ new Set();
24870
24895
  for (const element4 of children(first(root, "ptLst", NS.dgm) ?? root, "pt", NS.dgm)) {
24871
24896
  const point = parsePoint(element4);
@@ -24876,10 +24901,10 @@ function parseDiagramDataModel(source2, part) {
24876
24901
  if (ids.has(point.modelId))
24877
24902
  report("POINT_ID_DUPLICATE", `Duplicate dgm:pt modelId: ${point.modelId}.`);
24878
24903
  ids.add(point.modelId);
24879
- points.push(point);
24904
+ points2.push(point);
24880
24905
  }
24881
24906
  const transitionText = collectTransitionText(
24882
- points,
24907
+ points2,
24883
24908
  (point) => ({ type: point.type, modelId: point.modelId }),
24884
24909
  (point) => point.text
24885
24910
  );
@@ -24916,13 +24941,13 @@ function parseDiagramDataModel(source2, part) {
24916
24941
  );
24917
24942
  const generatedCacheDigest = generated2?.getAttribute("drawingSha256");
24918
24943
  return {
24919
- points,
24944
+ points: points2,
24920
24945
  ...descendants(root, "generatedCache").some(
24921
24946
  (node) => node.namespaceURI === GENERATED_DIAGRAM_CACHE_NS
24922
24947
  ) ? { generatedCache: true } : {},
24923
24948
  ...generatedCacheDigest ? { generatedCacheDigest } : {},
24924
24949
  connections,
24925
- nodes: points.filter((point) => !STRUCTURAL_TYPES.has(point.type)),
24950
+ nodes: points2.filter((point) => !STRUCTURAL_TYPES.has(point.type)),
24926
24951
  parentById,
24927
24952
  ...drawingRelId ? { drawingRelId } : {},
24928
24953
  issues
@@ -25300,8 +25325,8 @@ function withDiagramPictureSources(dataXml2, source2) {
25300
25325
  if (!source2?.pictures?.length) return dataXml2;
25301
25326
  const doc = parseXml(dataXml2);
25302
25327
  const root = doc.documentElement;
25303
- const points = first(root, "ptLst", NS.dgm);
25304
- const live = children(points ?? root, "pt", NS.dgm).filter(
25328
+ const points2 = first(root, "ptLst", NS.dgm);
25329
+ const live = children(points2 ?? root, "pt", NS.dgm).filter(
25305
25330
  (point) => !["doc", "pres", "parTrans", "sibTrans"].includes(point.getAttribute("type") ?? "node")
25306
25331
  );
25307
25332
  for (const element4 of [...root.getElementsByTagNameNS(DIAGRAM_PICTURE_SOURCE_NS, "pictures")]) {
@@ -25329,7 +25354,7 @@ function withDiagramPictureSources(dataXml2, source2) {
25329
25354
  const fill = parseXml(picture.fill.sourceXml).documentElement;
25330
25355
  element4.appendChild(doc.importNode(fill, true));
25331
25356
  payload.appendChild(element4);
25332
- const presentations = children(points ?? root, "pt", NS.dgm).filter((point) => {
25357
+ const presentations = children(points2 ?? root, "pt", NS.dgm).filter((point) => {
25333
25358
  const props = first(point, "prSet", NS.dgm);
25334
25359
  return point.getAttribute("type") === "pres" && props?.getAttribute("presAssocID") === picture.nodeId && (picture.role && props.getAttribute("presName") === picture.role || picture.styleLabel && props.getAttribute("presStyleLbl") === picture.styleLabel);
25335
25360
  });
@@ -25654,9 +25679,9 @@ function buildGeneratedDiagramCache(dataXml2, input) {
25654
25679
  const drawing = resolveDiagramDrawingStyles(preview.drawing, input.formatScheme);
25655
25680
  const doc = parseXml(dataXml2);
25656
25681
  const root = doc.documentElement;
25657
- const points = first(root, "ptLst", NS.dgm);
25682
+ const points2 = first(root, "ptLst", NS.dgm);
25658
25683
  const connections = first(root, "cxnLst", NS.dgm);
25659
- if (!points || !connections) return void 0;
25684
+ if (!points2 || !connections) return void 0;
25660
25685
  const colors = source2.colorsXml ? parseDiagramColors(source2.colorsXml).labels : [];
25661
25686
  const authoredColors = colors.flatMap((label) => [...label.fill.colors, ...label.line.colors]);
25662
25687
  const themed = /* @__PURE__ */ new Map();
@@ -25676,7 +25701,7 @@ function buildGeneratedDiagramCache(dataXml2, input) {
25676
25701
  (effect) => effect.kind !== "outerShadow" || !resolveDrawingOuterShadow(effect, { scheme: (name) => scheme2[name] })
25677
25702
  ))
25678
25703
  return void 0;
25679
- const point = children(points, "pt", NS.dgm).find(
25704
+ const point = children(points2, "pt", NS.dgm).find(
25680
25705
  (point2) => point2.getAttribute("modelId") === shape.sourceNodeId
25681
25706
  );
25682
25707
  const direct = model.nodes.find((node) => node.modelId === shape.sourceNodeId);
@@ -25750,8 +25775,8 @@ function buildGeneratedDiagramCache(dataXml2, input) {
25750
25775
  (marker2) => descendants(marker2, "shape").map((node) => node.getAttribute("id"))
25751
25776
  )
25752
25777
  );
25753
- for (const point of children(points, "pt", NS.dgm))
25754
- if (oldIds.has(point.getAttribute("modelId"))) points.removeChild(point);
25778
+ for (const point of children(points2, "pt", NS.dgm))
25779
+ if (oldIds.has(point.getAttribute("modelId"))) points2.removeChild(point);
25755
25780
  for (const edge of children(connections, "cxn", NS.dgm))
25756
25781
  if (oldIds.has(edge.getAttribute("destId"))) connections.removeChild(edge);
25757
25782
  for (const marker2 of oldMarkers) {
@@ -25773,7 +25798,7 @@ function buildGeneratedDiagramCache(dataXml2, input) {
25773
25798
  );
25774
25799
  drawing.shapes.forEach((shape, index) => {
25775
25800
  const id = serialized.modelIds.get(shape.modelId);
25776
- const point = add2(points, NS.dgm, "dgm:pt", { modelId: id, type: "pres" });
25801
+ const point = add2(points2, NS.dgm, "dgm:pt", { modelId: id, type: "pres" });
25777
25802
  add2(point, NS.dgm, "dgm:prSet", {
25778
25803
  ...shape.sourceNodeId ? { presAssocID: shape.sourceNodeId } : {},
25779
25804
  presName: shape.sourceLayoutRole ?? "node",
@@ -28019,14 +28044,14 @@ function formula(parent, local) {
28019
28044
  var LEVEL = /* @__PURE__ */ new Set(["pt", "extLst"]);
28020
28045
  function parseLevel(context, element4) {
28021
28046
  reportUnmodelled2(context, element4, LEVEL);
28022
- const points = cxChildren(element4, "pt").map((pt) => {
28047
+ const points2 = cxChildren(element4, "pt").map((pt) => {
28023
28048
  const point = { value: pt.textContent ?? "" };
28024
28049
  const index = indexAttribute(context, pt, "idx");
28025
28050
  if (index !== void 0) point.index = index;
28026
28051
  return point;
28027
28052
  });
28028
28053
  return assignDefined(
28029
- { points },
28054
+ { points: points2 },
28030
28055
  {
28031
28056
  pointCount: indexAttribute(context, element4, "ptCount"),
28032
28057
  formatCode: attribute(element4, "formatCode"),
@@ -28546,7 +28571,7 @@ function labelBody(context, label) {
28546
28571
  }
28547
28572
  function dataLabelsXml2(context, labels) {
28548
28573
  if (!labels) return "";
28549
- const points = labels.labels.map(
28574
+ const points2 = labels.labels.map(
28550
28575
  (label) => cxElement(
28551
28576
  "dataLabel",
28552
28577
  labelBody(context, label) + raw(context, label.extLst),
@@ -28559,7 +28584,7 @@ function dataLabelsXml2(context, labels) {
28559
28584
  const hidden = labels.hidden.map((index) => cxElement("dataLabelHidden", "", attributes([["idx", index]]))).join("");
28560
28585
  return cxElement(
28561
28586
  "dataLabels",
28562
- labelBody(context, labels) + points + hidden + raw(context, labels.extLst),
28587
+ labelBody(context, labels) + points2 + hidden + raw(context, labels.extLst),
28563
28588
  attributes([["pos", labels.position]])
28564
28589
  );
28565
28590
  }
@@ -28606,7 +28631,7 @@ function layoutXml2(context, layout2) {
28606
28631
  );
28607
28632
  }
28608
28633
  function seriesXml2(context, series) {
28609
- const points = series.dataPoints.map(
28634
+ const points2 = series.dataPoints.map(
28610
28635
  (point) => cxElement(
28611
28636
  "dataPt",
28612
28637
  shapeXml(context, point.spPr) + raw(context, point.extLst),
@@ -28615,7 +28640,7 @@ function seriesXml2(context, series) {
28615
28640
  ).join("");
28616
28641
  return cxElement(
28617
28642
  "series",
28618
- textXml(context, series.tx) + shapeXml(context, series.spPr) + textBodyXml2(context, series.txPr) + raw(context, series.valueColorsXml) + raw(context, series.valueColorPositionsXml) + points + dataLabelsXml2(context, series.dataLabels) + (series.data ? dataXml(context, series.data) : "") + cxVal("dataId", series.dataId) + layoutXml2(context, series.layoutProperties) + series.axisIds.map((id) => cxVal("axisId", id)).join("") + raw(context, series.extLst),
28643
+ textXml(context, series.tx) + shapeXml(context, series.spPr) + textBodyXml2(context, series.txPr) + raw(context, series.valueColorsXml) + raw(context, series.valueColorPositionsXml) + points2 + dataLabelsXml2(context, series.dataLabels) + (series.data ? dataXml(context, series.data) : "") + cxVal("dataId", series.dataId) + layoutXml2(context, series.layoutProperties) + series.axisIds.map((id) => cxVal("axisId", id)).join("") + raw(context, series.extLst),
28619
28644
  attributes([
28620
28645
  ["layoutId", series.layoutId],
28621
28646
  ["hidden", series.hidden],
@@ -29573,15 +29598,15 @@ function chartExSeriesPaint(source2, series, defaultValues = false) {
29573
29598
  const fill = source2.spPr?.fill;
29574
29599
  if (fill) series.fill = fill;
29575
29600
  if (source2.spPr?.line) series.line = source2.spPr.line;
29576
- const points = {};
29601
+ const points2 = {};
29577
29602
  const fills = {};
29578
29603
  for (const point of source2.dataPoints) {
29579
29604
  if (point.index === void 0) continue;
29580
29605
  const fill2 = point.spPr?.fill;
29581
- if (fill2?.kind === "solid") points[point.index] = fill2.color;
29606
+ if (fill2?.kind === "solid") points2[point.index] = fill2.color;
29582
29607
  else if (fill2) fills[point.index] = fill2;
29583
29608
  }
29584
- if (Object.keys(points).length) series.pointColors = points;
29609
+ if (Object.keys(points2).length) series.pointColors = points2;
29585
29610
  if (Object.keys(fills).length) series.pointFills = fills;
29586
29611
  const labels = source2.dataLabels;
29587
29612
  if (!labels && !defaultValues) return;
@@ -29604,10 +29629,10 @@ function seriesData(space, series) {
29604
29629
  }
29605
29630
  var findDimension = (data, kind, type) => data?.dimensions.find((d) => d.kind === kind && (d.type ?? "") === type);
29606
29631
  function levelPoints(level3) {
29607
- const points = [];
29608
- for (const point of level3.points) points[point.index ?? points.length] = point.value.trim();
29609
- for (let i = 0; i < Math.max(level3.pointCount ?? 0, points.length); i++) points[i] ??= "";
29610
- return points;
29632
+ const points2 = [];
29633
+ for (const point of level3.points) points2[point.index ?? points2.length] = point.value.trim();
29634
+ for (let i = 0; i < Math.max(level3.pointCount ?? 0, points2.length); i++) points2[i] ??= "";
29635
+ return points2;
29611
29636
  }
29612
29637
  function dimension(data, kind, type) {
29613
29638
  const element4 = findDimension(data, kind, type);
@@ -31055,14 +31080,14 @@ async function writeNewRelationships(zip, partName, created, pendingMedia) {
31055
31080
  overrides.push(relationship2);
31056
31081
  continue;
31057
31082
  }
31058
- const pending = pendingMedia?.get(relationship2.partName);
31059
- if (!pending)
31083
+ const pending2 = pendingMedia?.get(relationship2.partName);
31084
+ if (!pending2)
31060
31085
  throw new Error(`Missing bytes for newly inserted media part: ${relationship2.partName}`);
31061
- zip.file(relationship2.partName, pending.bytes);
31086
+ zip.file(relationship2.partName, pending2.bytes);
31062
31087
  contentTypesXml = ensureContentTypeDefault(
31063
31088
  contentTypesXml,
31064
31089
  extensionOf(relationship2.partName),
31065
- pending.contentType
31090
+ pending2.contentType
31066
31091
  );
31067
31092
  }
31068
31093
  zip.file(relsPath, buildRelationshipsXml(relationships));
@@ -31739,7 +31764,7 @@ function writeFormFieldData(doc, field, source2) {
31739
31764
  }
31740
31765
 
31741
31766
  // docx/write-run.ts
31742
- function setAttribute6(element4, local, value) {
31767
+ function setAttribute7(element4, local, value) {
31743
31768
  element4.setAttributeNS(WORD_NS, `w:${local}`, value);
31744
31769
  }
31745
31770
  function removeChildren3(element4, local) {
@@ -31749,7 +31774,7 @@ function setToggle2(doc, props, local, value) {
31749
31774
  removeChildren3(props, local);
31750
31775
  if (value === void 0) return;
31751
31776
  const element4 = makeW(doc, local);
31752
- if (!value) setAttribute6(element4, "val", "0");
31777
+ if (!value) setAttribute7(element4, "val", "0");
31753
31778
  props.appendChild(element4);
31754
31779
  }
31755
31780
  function setBooleanAttribute(doc, props, local, value) {
@@ -31762,7 +31787,7 @@ function setBooleanAttribute(doc, props, local, value) {
31762
31787
  element4 = makeW(doc, local);
31763
31788
  props.appendChild(element4);
31764
31789
  }
31765
- setAttribute6(element4, "val", value ? "1" : "0");
31790
+ setAttribute7(element4, "val", value ? "1" : "0");
31766
31791
  }
31767
31792
  function setLanguageAttribute(doc, props, attribute2, value) {
31768
31793
  let language = first2(props, "lang");
@@ -31774,7 +31799,7 @@ function setLanguageAttribute(doc, props, attribute2, value) {
31774
31799
  language = makeW(doc, "lang");
31775
31800
  props.appendChild(language);
31776
31801
  }
31777
- setAttribute6(language, attribute2, value);
31802
+ setAttribute7(language, attribute2, value);
31778
31803
  }
31779
31804
  if (language && !language.attributes.length && !language.childNodes.length)
31780
31805
  props.removeChild(language);
@@ -31805,7 +31830,7 @@ function setRunProperties(doc, runNode, run2, base) {
31805
31830
  removeChildren3(props, "szCs");
31806
31831
  if (run2.fontSizeComplexScript !== void 0) {
31807
31832
  const size = makeW(doc, "szCs");
31808
- setAttribute6(size, "val", String(Math.round(run2.fontSizeComplexScript * 2)));
31833
+ setAttribute7(size, "val", String(Math.round(run2.fontSizeComplexScript * 2)));
31809
31834
  props.appendChild(size);
31810
31835
  }
31811
31836
  }
@@ -31817,13 +31842,13 @@ function setRunProperties(doc, runNode, run2, base) {
31817
31842
  removeChildren3(props, "u");
31818
31843
  if (run2.underline === false) {
31819
31844
  const none = makeW(doc, "u");
31820
- setAttribute6(none, "val", "none");
31845
+ setAttribute7(none, "val", "none");
31821
31846
  props.appendChild(none);
31822
31847
  } else if (run2.underline) {
31823
31848
  const underline = makeW(doc, "u");
31824
- setAttribute6(underline, "val", run2.underlineStyle ?? "single");
31849
+ setAttribute7(underline, "val", run2.underlineStyle ?? "single");
31825
31850
  if (run2.underlineColor)
31826
- setAttribute6(underline, "color", run2.underlineColor.replace(/^#/, ""));
31851
+ setAttribute7(underline, "color", run2.underlineColor.replace(/^#/, ""));
31827
31852
  props.appendChild(underline);
31828
31853
  }
31829
31854
  }
@@ -31831,7 +31856,7 @@ function setRunProperties(doc, runNode, run2, base) {
31831
31856
  removeChildren3(props, "highlight");
31832
31857
  if (run2.highlight) {
31833
31858
  const highlight = makeW(doc, "highlight");
31834
- setAttribute6(highlight, "val", run2.highlight);
31859
+ setAttribute7(highlight, "val", run2.highlight);
31835
31860
  props.appendChild(highlight);
31836
31861
  }
31837
31862
  }
@@ -31839,7 +31864,7 @@ function setRunProperties(doc, runNode, run2, base) {
31839
31864
  removeChildren3(props, "vertAlign");
31840
31865
  if (run2.verticalAlign) {
31841
31866
  const verticalAlign = makeW(doc, "vertAlign");
31842
- setAttribute6(verticalAlign, "val", run2.verticalAlign);
31867
+ setAttribute7(verticalAlign, "val", run2.verticalAlign);
31843
31868
  props.appendChild(verticalAlign);
31844
31869
  }
31845
31870
  }
@@ -31852,7 +31877,7 @@ function setRunProperties(doc, runNode, run2, base) {
31852
31877
  removeChildren3(props, "sz");
31853
31878
  if (run2.fontSize !== void 0) {
31854
31879
  const size = makeW(doc, "sz");
31855
- setAttribute6(size, "val", String(Math.round(run2.fontSize * 2)));
31880
+ setAttribute7(size, "val", String(Math.round(run2.fontSize * 2)));
31856
31881
  props.appendChild(size);
31857
31882
  }
31858
31883
  }
@@ -31861,11 +31886,11 @@ function setRunProperties(doc, runNode, run2, base) {
31861
31886
  if (run2.fontFamily || run2.fontTheme || run2.fontFamilyEastAsia || run2.fontFamilyComplexScript) {
31862
31887
  const fonts = makeW(doc, "rFonts");
31863
31888
  if (run2.fontFamily) {
31864
- setAttribute6(fonts, "ascii", run2.fontFamily);
31865
- setAttribute6(fonts, "hAnsi", run2.fontFamily);
31889
+ setAttribute7(fonts, "ascii", run2.fontFamily);
31890
+ setAttribute7(fonts, "hAnsi", run2.fontFamily);
31866
31891
  }
31867
- if (run2.fontFamilyEastAsia) setAttribute6(fonts, "eastAsia", run2.fontFamilyEastAsia);
31868
- if (run2.fontFamilyComplexScript) setAttribute6(fonts, "cs", run2.fontFamilyComplexScript);
31892
+ if (run2.fontFamilyEastAsia) setAttribute7(fonts, "eastAsia", run2.fontFamilyEastAsia);
31893
+ if (run2.fontFamilyComplexScript) setAttribute7(fonts, "cs", run2.fontFamilyComplexScript);
31869
31894
  const themeAttribute = {
31870
31895
  ascii: ["asciiTheme", "Ascii"],
31871
31896
  hAnsi: ["hAnsiTheme", "HAnsi"],
@@ -31875,7 +31900,7 @@ function setRunProperties(doc, runNode, run2, base) {
31875
31900
  for (const script of ["ascii", "hAnsi", "eastAsia", "cs"]) {
31876
31901
  const role = run2.fontTheme?.[script];
31877
31902
  const [attribute2, suffix] = themeAttribute[script];
31878
- if (role) setAttribute6(fonts, attribute2, `${role}${suffix}`);
31903
+ if (role) setAttribute7(fonts, attribute2, `${role}${suffix}`);
31879
31904
  }
31880
31905
  props.appendChild(fonts);
31881
31906
  }
@@ -31885,13 +31910,13 @@ function setRunProperties(doc, runNode, run2, base) {
31885
31910
  const hex = run2.color && /^#?([0-9a-f]{6})$/i.exec(run2.color)?.[1];
31886
31911
  if (hex || run2.colorTheme) {
31887
31912
  const color = makeW(doc, "color");
31888
- setAttribute6(color, "val", hex || "auto");
31913
+ setAttribute7(color, "val", hex || "auto");
31889
31914
  if (run2.colorTheme) {
31890
- setAttribute6(color, "themeColor", run2.colorTheme.token);
31915
+ setAttribute7(color, "themeColor", run2.colorTheme.token);
31891
31916
  if (run2.colorTheme.tint !== void 0)
31892
- setAttribute6(color, "themeTint", fractionToThemeByte(run2.colorTheme.tint));
31917
+ setAttribute7(color, "themeTint", fractionToThemeByte(run2.colorTheme.tint));
31893
31918
  if (run2.colorTheme.shade !== void 0)
31894
- setAttribute6(color, "themeShade", fractionToThemeByte(run2.colorTheme.shade));
31919
+ setAttribute7(color, "themeShade", fractionToThemeByte(run2.colorTheme.shade));
31895
31920
  }
31896
31921
  props.appendChild(color);
31897
31922
  }
@@ -31940,13 +31965,13 @@ function createRun(doc, run2, base, old, allocator) {
31940
31965
  if (child7.nodeType !== 1 || child7.localName !== "rPr") node.removeChild(child7);
31941
31966
  if (run2.break) {
31942
31967
  const br = makeW(doc, "br");
31943
- setAttribute6(br, "type", run2.break);
31968
+ setAttribute7(br, "type", run2.break);
31944
31969
  node.appendChild(br);
31945
31970
  return node;
31946
31971
  }
31947
31972
  if (run2.fieldChar) {
31948
31973
  const marker = makeW(doc, "fldChar");
31949
- setAttribute6(marker, "fldCharType", run2.fieldChar);
31974
+ setAttribute7(marker, "fldCharType", run2.fieldChar);
31950
31975
  writeFieldFlags(marker, run2.fieldFlags);
31951
31976
  if (run2.fieldChar === "begin" && run2.formField)
31952
31977
  marker.appendChild(writeFormFieldData(doc, run2.formField, formData));
@@ -31973,7 +31998,7 @@ function createRun(doc, run2, base, old, allocator) {
31973
31998
  doc,
31974
31999
  run2.noteReference.kind === "footnote" ? "footnoteReference" : "endnoteReference"
31975
32000
  );
31976
- setAttribute6(reference, "id", run2.noteReference.id);
32001
+ setAttribute7(reference, "id", run2.noteReference.id);
31977
32002
  node.appendChild(reference);
31978
32003
  return node;
31979
32004
  }
@@ -32709,7 +32734,7 @@ function runsToWriteAnew(paragraph2, base, slots) {
32709
32734
  }
32710
32735
 
32711
32736
  // docx/write-paragraph.ts
32712
- function setAttribute7(element4, local, value) {
32737
+ function setAttribute8(element4, local, value) {
32713
32738
  element4.setAttributeNS(WORD_NS, `w:${local}`, value);
32714
32739
  }
32715
32740
  function removeChildren4(element4, local) {
@@ -32753,7 +32778,7 @@ function writeParagraphImpl(doc, paragraph2, node, base, allocator, spans) {
32753
32778
  const jc = paragraphJustification(paragraph2);
32754
32779
  if (jc) {
32755
32780
  const align = makeW(doc, "jc");
32756
- setAttribute7(align, "val", jc);
32781
+ setAttribute8(align, "val", jc);
32757
32782
  pPr.appendChild(align);
32758
32783
  }
32759
32784
  }
@@ -32761,7 +32786,7 @@ function writeParagraphImpl(doc, paragraph2, node, base, allocator, spans) {
32761
32786
  removeChildren4(pPr, "pStyle");
32762
32787
  if (paragraph2.style) {
32763
32788
  const style = makeW(doc, "pStyle");
32764
- setAttribute7(style, "val", paragraph2.style);
32789
+ setAttribute8(style, "val", paragraph2.style);
32765
32790
  pPr.appendChild(style);
32766
32791
  }
32767
32792
  }
@@ -32786,7 +32811,14 @@ function writeParagraphImpl(doc, paragraph2, node, base, allocator, spans) {
32786
32811
  const source2 = new Set(sourceBookmarks);
32787
32812
  const kept = /* @__PURE__ */ new Set([...starts, ...ends]);
32788
32813
  const sourcePositions = runPositions(base?.runs ?? []);
32789
- const read = markers.filter((marker) => !isBookmark(marker.element) || kept.has(marker.element)).map((marker) => {
32814
+ const permissions = changedPermissionMarkers(
32815
+ doc,
32816
+ paragraph2,
32817
+ base,
32818
+ markers.map((marker) => marker.element),
32819
+ runPositions(paragraph2.runs).at(-1)
32820
+ );
32821
+ const read = markers.filter((marker) => !isBookmark(marker.element) || kept.has(marker.element)).filter((marker) => !permissions?.drop.has(marker.element)).map((marker) => {
32790
32822
  const position2 = sourcePositions[marker.boundary] ?? 0;
32791
32823
  const annotation = marker.annotation;
32792
32824
  return {
@@ -32801,8 +32833,8 @@ function writeParagraphImpl(doc, paragraph2, node, base, allocator, spans) {
32801
32833
  });
32802
32834
  const end = runPositions(paragraph2.runs).at(-1);
32803
32835
  const sources = containerSources(paragraph2.runs, base?.runs, slots);
32804
- const carried = orderRangeEnds(
32805
- base ? followFormFieldBookmarks(
32836
+ const carried = orderRangeEnds([
32837
+ ...base ? followFormFieldBookmarks(
32806
32838
  followContainers(
32807
32839
  moveMarkers(base.runs, paragraph2.runs, read),
32808
32840
  sources,
@@ -32811,8 +32843,9 @@ function writeParagraphImpl(doc, paragraph2, node, base, allocator, spans) {
32811
32843
  ),
32812
32844
  base.runs,
32813
32845
  paragraph2.runs
32814
- ) : read.map((marker) => ({ ...marker, position: marker.opening ? 0 : end }))
32815
- );
32846
+ ) : read.map((marker) => ({ ...marker, position: marker.opening ? 0 : end })),
32847
+ ...permissions?.added ?? []
32848
+ ]);
32816
32849
  for (const marker of markers) marker.element.parentNode?.removeChild(marker.element);
32817
32850
  for (const oldNode of replaceableInlineChildren(node)) node.removeChild(oldNode);
32818
32851
  const { nodes, placed, containers } = buildInlineContent(
@@ -32961,21 +32994,21 @@ function applyModel(doc, model, original, reservedRelationshipIds = [], baseSect
32961
32994
  size = makeW(doc, "pgSz");
32962
32995
  section.appendChild(size);
32963
32996
  }
32964
- setAttribute7(size, "w", twips2(model.page.width));
32965
- setAttribute7(size, "h", twips2(model.page.height));
32997
+ setAttribute8(size, "w", twips2(model.page.width));
32998
+ setAttribute8(size, "h", twips2(model.page.height));
32966
32999
  let margins = first2(section, "pgMar");
32967
33000
  if (!margins) {
32968
33001
  margins = makeW(doc, "pgMar");
32969
33002
  section.appendChild(margins);
32970
33003
  }
32971
33004
  for (const side of ["Top", "Right", "Bottom", "Left"])
32972
- setAttribute7(margins, side.toLowerCase(), twips2(model.page[`margin${side}`]));
33005
+ setAttribute8(margins, side.toLowerCase(), twips2(model.page[`margin${side}`]));
32973
33006
  for (const [name, fallback] of [
32974
33007
  ["header", "720"],
32975
33008
  ["footer", "720"],
32976
33009
  ["gutter", "0"]
32977
33010
  ])
32978
- if (!margins.getAttributeNS(WORD_NS, name)) setAttribute7(margins, name, fallback);
33011
+ if (!margins.getAttributeNS(WORD_NS, name)) setAttribute8(margins, name, fallback);
32979
33012
  orderSectionProperties(section);
32980
33013
  if (model.sections)
32981
33014
  applySectionEdits(
@@ -33449,6 +33482,122 @@ function assertValidDocumentModel(model) {
33449
33482
  if (issues.length) throw new DocxModelValidationError(issues);
33450
33483
  }
33451
33484
 
33485
+ // docx/numbering-picture.ts
33486
+ var NUMBERING_PART = "word/numbering.xml";
33487
+ var descendants4 = (root, local) => Array.from(root.getElementsByTagName("*")).filter(
33488
+ (node) => node.nodeType === 1 && node.localName === local
33489
+ );
33490
+ var points = (style, property) => {
33491
+ const match = new RegExp(`(?:^|;)\\s*${property}:\\s*([\\d.]+)(pt|px|in|cm|mm)?`, "i").exec(
33492
+ style
33493
+ );
33494
+ if (!match) return void 0;
33495
+ const value = Number(match[1]);
33496
+ const unit = (match[2] ?? "pt").toLowerCase();
33497
+ const factor = { pt: 1, px: 0.75, in: 72, cm: 72 / 2.54, mm: 72 / 25.4 }[unit] ?? 1;
33498
+ return Number.isFinite(value) && value > 0 ? value * factor : void 0;
33499
+ };
33500
+ function parsePictureBullet(element4, rels) {
33501
+ const id = getW(element4, "numPicBulletId");
33502
+ if (id === void 0) return void 0;
33503
+ const imagedata = descendants4(element4, "imagedata")[0];
33504
+ const blip = descendants4(element4, "blip")[0];
33505
+ const relId = imagedata && getR(imagedata, "id") || blip && getR(blip, "embed") || void 0;
33506
+ const rel = relId ? rels.get(relId) : void 0;
33507
+ if (!rel || rel.mode === "External") return void 0;
33508
+ const partName = resolvePartPath(NUMBERING_PART, rel.target);
33509
+ const result = {
33510
+ id,
33511
+ partName,
33512
+ contentType: imageContentType(partName)
33513
+ };
33514
+ const style = descendants4(element4, "shape")[0]?.getAttribute("style") ?? "";
33515
+ let width = points(style, "width");
33516
+ let height = points(style, "height");
33517
+ const extent = descendants4(element4, "extent")[0];
33518
+ if (extent && width === void 0 && height === void 0) {
33519
+ const cx = Number(extent.getAttribute("cx"));
33520
+ const cy = Number(extent.getAttribute("cy"));
33521
+ if (cx > 0 && cy > 0) {
33522
+ width = cx / 12700;
33523
+ height = cy / 12700;
33524
+ }
33525
+ }
33526
+ if (width !== void 0) result.widthPt = width;
33527
+ if (height !== void 0) result.heightPt = height;
33528
+ return result;
33529
+ }
33530
+ function parseNumberingPictureBullets(root, rels) {
33531
+ const bullets = /* @__PURE__ */ Object.create(null);
33532
+ if (!rels) return bullets;
33533
+ for (const element4 of descendants4(root, "numPicBullet")) {
33534
+ const parsed = parsePictureBullet(element4, rels);
33535
+ if (parsed) bullets[parsed.id] = parsed;
33536
+ }
33537
+ return bullets;
33538
+ }
33539
+
33540
+ // docx/numbering-picture-save.ts
33541
+ var VML_NS3 = "urn:schemas-microsoft-com:vml";
33542
+ var OFFICE_NS2 = "urn:schemas-microsoft-com:office:office";
33543
+ var R_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
33544
+ var IMAGE_REL = `${R_NS}/image`;
33545
+ function addedPictureBullets(prior, next) {
33546
+ for (const [id, bullet] of Object.entries(prior?.pictureBullets ?? {}))
33547
+ if (JSON.stringify(next.pictureBullets?.[id]) !== JSON.stringify(bullet))
33548
+ throw new Error(
33549
+ `Cannot edit picture bullet "${id}"; the original numbering.xml and its images are preserved unchanged.`
33550
+ );
33551
+ return Object.values(next.pictureBullets ?? {}).filter(
33552
+ (bullet) => !prior?.pictureBullets?.[bullet.id]
33553
+ );
33554
+ }
33555
+ function buildPictureBullet(doc, bullet, relId, serial) {
33556
+ const element4 = makeW(doc, "numPicBullet");
33557
+ element4.setAttributeNS(WORD_NS, "w:numPicBulletId", bullet.id);
33558
+ const pict = makeW(doc, "pict");
33559
+ const shape = makeNS(doc, VML_NS3, "v:shape");
33560
+ shape.setAttribute("id", `_x0000_i${1025 + serial}`);
33561
+ shape.setAttribute("type", "#_x0000_t75");
33562
+ const width = bullet.widthPt ?? bullet.heightPt ?? 9;
33563
+ const height = bullet.heightPt ?? width;
33564
+ shape.setAttribute("style", `width:${+width.toFixed(2)}pt;height:${+height.toFixed(2)}pt`);
33565
+ shape.setAttributeNS(OFFICE_NS2, "o:bullet", "t");
33566
+ const imagedata = makeNS(doc, VML_NS3, "v:imagedata");
33567
+ imagedata.setAttributeNS(R_NS, "r:id", relId);
33568
+ imagedata.setAttributeNS(OFFICE_NS2, "o:title", "");
33569
+ shape.appendChild(imagedata);
33570
+ pict.appendChild(shape);
33571
+ element4.appendChild(pict);
33572
+ return element4;
33573
+ }
33574
+ async function writePictureBullets(zip, doc, added, before, pendingMedia) {
33575
+ if (!added.length) return;
33576
+ const used = new Set(
33577
+ parseRelationships(
33578
+ await zip.file(relationshipsPartFor2(NUMBERING_PART))?.async("string")
33579
+ ).keys()
33580
+ );
33581
+ let serial = 1;
33582
+ const relationships = added.map((bullet, index) => {
33583
+ while (used.has(`rId${serial}`)) serial++;
33584
+ const id = `rId${serial}`;
33585
+ used.add(id);
33586
+ doc.documentElement.insertBefore(buildPictureBullet(doc, bullet, id, index), before);
33587
+ const stored = zip.file(bullet.partName) !== null;
33588
+ if (!stored && !pendingMedia?.get(bullet.partName))
33589
+ throw new Error(`Missing bytes for picture bullet image: ${bullet.partName}`);
33590
+ return {
33591
+ id,
33592
+ type: IMAGE_REL,
33593
+ target: bullet.partName.replace(/^word\//, ""),
33594
+ mode: "Internal",
33595
+ ...stored ? {} : { partName: bullet.partName }
33596
+ };
33597
+ });
33598
+ await writeNewRelationships(zip, NUMBERING_PART, relationships, pendingMedia);
33599
+ }
33600
+
33452
33601
  // docx/numbering-parts.ts
33453
33602
  var CT_NS = "http://schemas.openxmlformats.org/package/2006/content-types";
33454
33603
  var REL_NS2 = "http://schemas.openxmlformats.org/package/2006/relationships";
@@ -33540,6 +33689,8 @@ function parseNumberingLevel(lvl) {
33540
33689
  if (flag(first2(lvl, "isLgl"))) result.isLgl = true;
33541
33690
  const restart = getW(first2(lvl, "lvlRestart"), "val");
33542
33691
  if (restart !== void 0) result.lvlRestart = integer3(restart, 0);
33692
+ const pictureBulletId = getW(first2(lvl, "lvlPicBulletId"), "val");
33693
+ if (pictureBulletId !== void 0) result.pictureBulletId = pictureBulletId;
33543
33694
  const marker = parseMarkerFormat(first2(lvl, "rPr"));
33544
33695
  if (marker) result.markerFormat = marker;
33545
33696
  result.suffix = suffRaw === "space" ? "space" : suffRaw === "nothing" ? "none" : "tab";
@@ -33575,7 +33726,7 @@ function parseNum(element4) {
33575
33726
  ...Object.keys(levelOverrides).length ? { levelOverrides } : {}
33576
33727
  };
33577
33728
  }
33578
- function parseNumberingCatalog(xml) {
33729
+ function parseNumberingCatalog(xml, relationships) {
33579
33730
  const document = parseXml2(xml);
33580
33731
  const root = document.documentElement;
33581
33732
  const abstractNums = dictionary();
@@ -33589,17 +33740,30 @@ function parseNumberingCatalog(xml) {
33589
33740
  warnings.push(
33590
33741
  `Numbering definition abstractNum ${parsed.id} links to style "${link}"; style-linked numbering levels are not resolved.`
33591
33742
  );
33592
- if (byName(element4, "lvlPicBulletId").length)
33593
- warnings.push(
33594
- `Numbering definition abstractNum ${parsed.id} uses a picture bullet; picture bullets are not rendered.`
33595
- );
33596
33743
  }
33744
+ const pictureBullets = parseNumberingPictureBullets(
33745
+ root,
33746
+ relationships
33747
+ );
33748
+ for (const element4 of byName(root, "abstractNum"))
33749
+ for (const ref of byName(element4, "lvlPicBulletId")) {
33750
+ const id = getW(ref, "val");
33751
+ if (id !== void 0 && !own(pictureBullets, id))
33752
+ warnings.push(
33753
+ `Numbering definition abstractNum ${getW(element4, "abstractNumId")} uses picture bullet ${id}, whose image could not be resolved; the level falls back to its bullet glyph.`
33754
+ );
33755
+ }
33597
33756
  const nums = dictionary();
33598
33757
  for (const element4 of byName(root, "num")) {
33599
33758
  const parsed = parseNum(element4);
33600
33759
  if (parsed) nums[parsed.id] = parsed;
33601
33760
  }
33602
- return { abstractNums, nums, warnings: [...new Set(warnings)] };
33761
+ return {
33762
+ abstractNums,
33763
+ nums,
33764
+ ...Object.keys(pictureBullets).length ? { pictureBullets } : {},
33765
+ warnings: [...new Set(warnings)]
33766
+ };
33603
33767
  }
33604
33768
  function resolveNumberingLevel(catalog, numId, level3) {
33605
33769
  const num2 = own(catalog.nums, numId);
@@ -33705,17 +33869,18 @@ function patchNumberingStarts(doc, changes) {
33705
33869
  }
33706
33870
 
33707
33871
  // docx/numbering-package.ts
33708
- function setAttribute8(element4, local, value) {
33872
+ var addedAbstractIds = (prior, next) => Object.keys(next.abstractNums).filter((id) => !prior?.abstractNums[id]);
33873
+ function setAttribute9(element4, local, value) {
33709
33874
  element4.setAttributeNS(WORD_NS, `w:${local}`, value);
33710
33875
  }
33711
33876
  function valueElement(doc, local, value) {
33712
33877
  const element4 = makeW(doc, local);
33713
- setAttribute8(element4, "val", value);
33878
+ setAttribute9(element4, "val", value);
33714
33879
  return element4;
33715
33880
  }
33716
33881
  function buildLevelElement(doc, def) {
33717
33882
  const lvl = makeW(doc, "lvl");
33718
- setAttribute8(lvl, "ilvl", String(def.level));
33883
+ setAttribute9(lvl, "ilvl", String(def.level));
33719
33884
  if (!def.startWasOmitted || def.start !== 1)
33720
33885
  lvl.appendChild(valueElement(doc, "start", String(def.start)));
33721
33886
  lvl.appendChild(valueElement(doc, "numFmt", def.numFmt));
@@ -33731,22 +33896,24 @@ function buildLevelElement(doc, def) {
33731
33896
  )
33732
33897
  );
33733
33898
  lvl.appendChild(valueElement(doc, "lvlText", def.lvlText));
33899
+ if (def.pictureBulletId !== void 0)
33900
+ lvl.appendChild(valueElement(doc, "lvlPicBulletId", def.pictureBulletId));
33734
33901
  if (def.lvlJc) lvl.appendChild(valueElement(doc, "lvlJc", def.lvlJc));
33735
33902
  if (def.tabStopTwips !== void 0 || def.indentLeftTwips !== void 0 || def.hangingTwips !== void 0 || def.firstLineTwips !== void 0) {
33736
33903
  const pPr = makeW(doc, "pPr");
33737
33904
  if (def.tabStopTwips !== void 0) {
33738
33905
  const tabs = makeW(doc, "tabs");
33739
33906
  const tab = makeW(doc, "tab");
33740
- setAttribute8(tab, "val", "num");
33741
- setAttribute8(tab, "pos", String(def.tabStopTwips));
33907
+ setAttribute9(tab, "val", "num");
33908
+ setAttribute9(tab, "pos", String(def.tabStopTwips));
33742
33909
  tabs.appendChild(tab);
33743
33910
  pPr.appendChild(tabs);
33744
33911
  }
33745
33912
  const ind = makeW(doc, "ind");
33746
- if (def.indentLeftTwips !== void 0) setAttribute8(ind, "left", String(def.indentLeftTwips));
33747
- if (def.hangingTwips !== void 0) setAttribute8(ind, "hanging", String(def.hangingTwips));
33913
+ if (def.indentLeftTwips !== void 0) setAttribute9(ind, "left", String(def.indentLeftTwips));
33914
+ if (def.hangingTwips !== void 0) setAttribute9(ind, "hanging", String(def.hangingTwips));
33748
33915
  if (def.firstLineTwips !== void 0)
33749
- setAttribute8(ind, "firstLine", String(def.firstLineTwips));
33916
+ setAttribute9(ind, "firstLine", String(def.firstLineTwips));
33750
33917
  if (ind.attributes.length) pPr.appendChild(ind);
33751
33918
  lvl.appendChild(pPr);
33752
33919
  }
@@ -33755,8 +33922,8 @@ function buildLevelElement(doc, def) {
33755
33922
  const rPr = makeW(doc, "rPr");
33756
33923
  if (marker.fontFamily) {
33757
33924
  const fonts = makeW(doc, "rFonts");
33758
- setAttribute8(fonts, "ascii", marker.fontFamily);
33759
- setAttribute8(fonts, "hAnsi", marker.fontFamily);
33925
+ setAttribute9(fonts, "ascii", marker.fontFamily);
33926
+ setAttribute9(fonts, "hAnsi", marker.fontFamily);
33760
33927
  rPr.appendChild(fonts);
33761
33928
  }
33762
33929
  if (marker.bold) rPr.appendChild(makeW(doc, "b"));
@@ -33771,7 +33938,7 @@ function buildLevelElement(doc, def) {
33771
33938
  }
33772
33939
  function buildAbstractNumElement(doc, def) {
33773
33940
  const element4 = makeW(doc, "abstractNum");
33774
- setAttribute8(element4, "abstractNumId", def.id);
33941
+ setAttribute9(element4, "abstractNumId", def.id);
33775
33942
  element4.appendChild(valueElement(doc, "multiLevelType", "hybridMultilevel"));
33776
33943
  for (const level3 of Object.values(def.levels).sort((a2, b) => a2.level - b.level))
33777
33944
  element4.appendChild(buildLevelElement(doc, level3));
@@ -33779,11 +33946,11 @@ function buildAbstractNumElement(doc, def) {
33779
33946
  }
33780
33947
  function buildNumElement(doc, def) {
33781
33948
  const element4 = makeW(doc, "num");
33782
- setAttribute8(element4, "numId", def.id);
33949
+ setAttribute9(element4, "numId", def.id);
33783
33950
  element4.appendChild(valueElement(doc, "abstractNumId", def.abstractNumId));
33784
33951
  for (const [level3, override] of Object.entries(def.levelOverrides ?? {})) {
33785
33952
  const lvlOverride = makeW(doc, "lvlOverride");
33786
- setAttribute8(lvlOverride, "ilvl", level3);
33953
+ setAttribute9(lvlOverride, "ilvl", level3);
33787
33954
  if (override.startOverride !== void 0)
33788
33955
  lvlOverride.appendChild(valueElement(doc, "startOverride", String(override.startOverride)));
33789
33956
  if (override.lvl) lvlOverride.appendChild(buildLevelElement(doc, override.lvl));
@@ -33791,7 +33958,7 @@ function buildNumElement(doc, def) {
33791
33958
  }
33792
33959
  return element4;
33793
33960
  }
33794
- async function applyNumberingCatalog(zip, model, binding) {
33961
+ async function applyNumberingCatalog(zip, model, binding, pendingMedia) {
33795
33962
  const next = model.numberingCatalog;
33796
33963
  const prior = binding?.base.numberingCatalog;
33797
33964
  if (JSON.stringify(next ?? null) === JSON.stringify(prior ?? null)) return;
@@ -33803,6 +33970,14 @@ async function applyNumberingCatalog(zip, model, binding) {
33803
33970
  throw new Error(
33804
33971
  "Removing the numbering catalog is not supported; the source numbering.xml is preserved unchanged."
33805
33972
  );
33973
+ const addedPictures = addedPictureBullets(prior, next);
33974
+ for (const level3 of addedAbstractIds(prior, next).flatMap(
33975
+ (id) => Object.values(next.abstractNums[id]?.levels ?? {})
33976
+ ))
33977
+ if (level3.pictureBulletId !== void 0 && !next.pictureBullets?.[level3.pictureBulletId])
33978
+ throw new Error(
33979
+ `Level ${level3.level} references picture bullet "${level3.pictureBulletId}", which the numbering part does not define.`
33980
+ );
33806
33981
  for (const id of Object.keys(prior?.abstractNums ?? {}))
33807
33982
  if (JSON.stringify(next.abstractNums[id]) !== JSON.stringify(prior?.abstractNums[id]))
33808
33983
  throw new Error(
@@ -33811,12 +33986,20 @@ async function applyNumberingCatalog(zip, model, binding) {
33811
33986
  const startChanges = numberingStartChanges(prior, next);
33812
33987
  const newAbstractIds = Object.keys(next.abstractNums).filter((id) => !prior?.abstractNums[id]);
33813
33988
  const newNumIds = Object.keys(next.nums).filter((id) => !prior?.nums[id]);
33814
- if (!newAbstractIds.length && !newNumIds.length && !startChanges.length) return;
33989
+ if (!newAbstractIds.length && !newNumIds.length && !startChanges.length && !addedPictures.length)
33990
+ return;
33815
33991
  const existingFile = zip.file("word/numbering.xml");
33816
33992
  const doc = existingFile ? parseXml2(await existingFile.async("string")) : parseXml2(`<w:numbering xmlns:w="${WORD_NS}"/>`);
33817
33993
  const root = doc.documentElement;
33818
33994
  patchNumberingStarts(doc, startChanges);
33819
33995
  const cleanup = children2(root, "numIdMacAtCleanup")[0] ?? null;
33996
+ await writePictureBullets(
33997
+ zip,
33998
+ doc,
33999
+ addedPictures,
34000
+ children2(root, "abstractNum")[0] ?? children2(root, "num")[0] ?? cleanup,
34001
+ pendingMedia
34002
+ );
33820
34003
  const firstNum = children2(root, "num")[0] ?? cleanup;
33821
34004
  for (const id of newAbstractIds) {
33822
34005
  const abstractNum = next.abstractNums[id];
@@ -34095,6 +34278,55 @@ async function applyNoteEdits(zip, model, base, pendingMedia, docPrIds) {
34095
34278
  }
34096
34279
  }
34097
34280
 
34281
+ // docx/protection.ts
34282
+ var DIGEST_BY_SID = {
34283
+ 1: "MD2",
34284
+ 2: "MD4",
34285
+ 3: "MD5",
34286
+ 4: "SHA-1",
34287
+ 7: "RIPEMD-128",
34288
+ 8: "RIPEMD-160",
34289
+ 12: "SHA-256",
34290
+ 13: "SHA-384",
34291
+ 14: "SHA-512"
34292
+ };
34293
+ var integer4 = (value) => {
34294
+ const number2 = value === void 0 ? NaN : Number(value);
34295
+ return Number.isInteger(number2) ? number2 : void 0;
34296
+ };
34297
+ function readProtectionPassword(element4) {
34298
+ const hashValue = getW(element4, "hashValue");
34299
+ const saltValue = getW(element4, "saltValue");
34300
+ const algorithmName = getW(element4, "algorithmName");
34301
+ if (hashValue && saltValue && algorithmName) {
34302
+ const spinCount2 = integer4(getW(element4, "spinCount"));
34303
+ return {
34304
+ password: {
34305
+ algorithmName,
34306
+ hashValue,
34307
+ saltValue,
34308
+ ...spinCount2 !== void 0 && { spinCount: spinCount2 }
34309
+ }
34310
+ };
34311
+ }
34312
+ const hash = getW(element4, "hash");
34313
+ if (!hash) return {};
34314
+ const sid = integer4(getW(element4, "cryptAlgorithmSid"));
34315
+ const salt = getW(element4, "salt");
34316
+ const digest = sid === void 0 ? void 0 : DIGEST_BY_SID[sid];
34317
+ if (sid === void 0 || !digest || !salt) return { unverifiable: true };
34318
+ const spinCount = integer4(getW(element4, "cryptSpinCount"));
34319
+ return {
34320
+ password: {
34321
+ algorithmName: digest,
34322
+ hashValue: hash,
34323
+ saltValue: salt,
34324
+ ...spinCount !== void 0 && { spinCount },
34325
+ word: { algorithmSid: sid }
34326
+ }
34327
+ };
34328
+ }
34329
+
34098
34330
  // docx/settings.ts
34099
34331
  var SETTINGS_PATH = "word/settings.xml";
34100
34332
  var SETTINGS_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
@@ -34209,10 +34441,14 @@ function parseFormSettings(xml) {
34209
34441
  if (!root) return {};
34210
34442
  const protect = children2(root, "documentProtection")[0];
34211
34443
  const edit = protect && getW(protect, "edit");
34444
+ const secret = protect && readProtectionPassword(protect);
34212
34445
  return {
34213
34446
  ...protect && {
34214
34447
  protection: {
34215
34448
  edit: isStDocProtect(edit) ? edit : "none",
34449
+ ...parseOnOff(getW(protect, "formatting")) === true && { formatting: true },
34450
+ ...secret?.password && { password: secret.password },
34451
+ ...secret?.unverifiable && { unverifiablePassword: true },
34216
34452
  // Word enforces the protection unless `w:enforcement` turns it off ([MS-OE376]
34217
34453
  // 2.1.410), where ECMA-376 would ignore it when the attribute is missing.
34218
34454
  enforced: parseOnOff(getW(protect, "enforcement")) !== false
@@ -34301,6 +34537,51 @@ async function applyCompatibilityMode(zip, mode) {
34301
34537
  await ensureDocumentRelationship(zip, SETTINGS_RELATIONSHIP_TYPE, "settings.xml");
34302
34538
  }
34303
34539
  }
34540
+ function protectionElement(doc, protection) {
34541
+ const element4 = makeW(doc, "documentProtection");
34542
+ const set2 = (name, value) => element4.setAttributeNS(WORD_NS, `w:${name}`, String(value));
34543
+ set2("edit", protection.edit);
34544
+ if (protection.formatting) set2("formatting", 1);
34545
+ set2("enforcement", protection.enforced ? 1 : 0);
34546
+ const secret = protection.password;
34547
+ if (secret?.word) {
34548
+ set2("cryptProviderType", "rsaAES");
34549
+ set2("cryptAlgorithmClass", "hash");
34550
+ set2("cryptAlgorithmType", "typeAny");
34551
+ set2("cryptAlgorithmSid", secret.word.algorithmSid);
34552
+ if (secret.spinCount !== void 0) set2("cryptSpinCount", secret.spinCount);
34553
+ set2("hash", secret.hashValue);
34554
+ set2("salt", secret.saltValue);
34555
+ } else if (secret) {
34556
+ set2("algorithmName", secret.algorithmName);
34557
+ set2("hashValue", secret.hashValue);
34558
+ set2("saltValue", secret.saltValue);
34559
+ if (secret.spinCount !== void 0) set2("spinCount", secret.spinCount);
34560
+ }
34561
+ return element4;
34562
+ }
34563
+ async function applyDocumentProtection(zip, protection) {
34564
+ const file = zip.file(SETTINGS_PATH);
34565
+ if (!file && !protection) return;
34566
+ const doc = parseXml2(
34567
+ await file?.async("string") ?? `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:settings xmlns:w="${WORD_NS}"></w:settings>`
34568
+ );
34569
+ const root = doc.documentElement;
34570
+ for (const element4 of children2(root, "documentProtection")) root.removeChild(element4);
34571
+ if (protection) {
34572
+ const rank2 = SETTINGS_ORDER.indexOf("documentProtection");
34573
+ const after = Array.from(root.childNodes).find((node) => {
34574
+ const index = SETTINGS_ORDER.indexOf(node.localName ?? "");
34575
+ return node.nodeType === 1 && index > rank2;
34576
+ });
34577
+ root.insertBefore(protectionElement(doc, protection), after ?? null);
34578
+ }
34579
+ zip.file(SETTINGS_PATH, buildXml(doc));
34580
+ if (!file) {
34581
+ await ensureContentTypeOverride(zip, SETTINGS_PATH, SETTINGS_CONTENT_TYPE);
34582
+ await ensureDocumentRelationship(zip, SETTINGS_RELATIONSHIP_TYPE, "settings.xml");
34583
+ }
34584
+ }
34304
34585
 
34305
34586
  // docx/page-background.ts
34306
34587
  var HEX = /^[0-9a-fA-F]{6}$/;
@@ -34653,6 +34934,7 @@ function computeListLabels(model) {
34653
34934
  if (def.numFmt === "none") continue;
34654
34935
  counters.advance(numId, level3, def, catalog);
34655
34936
  const text = def.numFmt === "bullet" ? def.lvlText : substituteLvlText(def.lvlText, numId, level3, catalog, counters, Boolean(def.isLgl));
34937
+ const picture = def.pictureBulletId !== void 0 ? catalog.pictureBullets?.[def.pictureBulletId] : void 0;
34656
34938
  labels.set(paragraph2.id, {
34657
34939
  numId,
34658
34940
  level: level3,
@@ -34664,7 +34946,8 @@ function computeListLabels(model) {
34664
34946
  hangingTwips: def.hangingTwips,
34665
34947
  firstLineTwips: def.firstLineTwips,
34666
34948
  markerFormat: def.markerFormat,
34667
- tabStopTwips: def.tabStopTwips
34949
+ tabStopTwips: def.tabStopTwips,
34950
+ picture
34668
34951
  })
34669
34952
  });
34670
34953
  }
@@ -35370,7 +35653,7 @@ async function saveDocx(model, pendingMedia, options) {
35370
35653
  docPrIds
35371
35654
  );
35372
35655
  await applyChartPartEdits(zip, model, binding?.base);
35373
- await applyNumberingCatalog(zip, model, binding);
35656
+ await applyNumberingCatalog(zip, model, binding, pendingMedia);
35374
35657
  await applyCoreProperties(zip, model.properties, binding?.base.properties);
35375
35658
  if (binding) await applyStyleNumbering(zip, model, binding.base);
35376
35659
  if (binding) await applyStyleFormatting(zip, model, binding.base);
@@ -35384,6 +35667,8 @@ async function saveDocx(model, pendingMedia, options) {
35384
35667
  await applySettingsFlag(zip, "autoHyphenation", Boolean(model.autoHyphenation));
35385
35668
  if (model.trackChanges !== binding?.base.trackChanges)
35386
35669
  await applyTrackChangesSetting(zip, model.trackChanges === true);
35670
+ if (JSON.stringify(model.protection) !== JSON.stringify(binding?.base.protection))
35671
+ await applyDocumentProtection(zip, model.protection);
35387
35672
  for (const [key, flag2] of [
35388
35673
  ["trackFormatting", "doNotTrackFormatting"],
35389
35674
  ["trackMoves", "doNotTrackMoves"]
@@ -35592,6 +35877,71 @@ function parseSimpleHyperlinkField(instr) {
35592
35877
  return void 0;
35593
35878
  }
35594
35879
 
35880
+ // docx/permissions.ts
35881
+ var pending = /* @__PURE__ */ new WeakMap();
35882
+ function readParagraphPermissionMarkers(node, paragraph2) {
35883
+ if (!node.getElementsByTagNameNS("*", "permStart").length && !node.getElementsByTagNameNS("*", "permEnd").length)
35884
+ return;
35885
+ const found = collectInlineSlots(node);
35886
+ if (!found || found.slots.length !== paragraph2.runs.length) return;
35887
+ const positions = runPositions(paragraph2.runs);
35888
+ const events = [];
35889
+ for (const { element: element4, boundary } of found.markers) {
35890
+ const start = named2(element4, "permStart");
35891
+ if (!start && !named2(element4, "permEnd")) continue;
35892
+ const id = getW(element4, "id");
35893
+ if (id === void 0) continue;
35894
+ const group = getW(element4, "edGrp");
35895
+ const user = getW(element4, "ed");
35896
+ events.push({
35897
+ start,
35898
+ id,
35899
+ position: positions[boundary] ?? 0,
35900
+ ...group !== void 0 && { group },
35901
+ ...user !== void 0 && { user }
35902
+ });
35903
+ }
35904
+ if (events.length) pending.set(paragraph2, events);
35905
+ }
35906
+ function resolvePermissions(blocks) {
35907
+ const open = /* @__PURE__ */ new Map();
35908
+ forEachParagraph2(blocks, (paragraph2) => {
35909
+ const events = pending.get(paragraph2) ?? [];
35910
+ const end = runPositions(paragraph2.runs).at(-1) ?? 0;
35911
+ const ranges = [];
35912
+ const begun = new Map(
35913
+ [...open].map(([id, who]) => [id, { ...who, from: 0, previous: true }])
35914
+ );
35915
+ const add4 = (id, begin, to, next) => ranges.push({
35916
+ id,
35917
+ ...begin.group !== void 0 && { group: begin.group },
35918
+ ...begin.user !== void 0 && { user: begin.user },
35919
+ from: begin.from,
35920
+ to,
35921
+ ...begin.previous && { fromPrevious: true },
35922
+ ...next && { toNext: true }
35923
+ });
35924
+ for (const event of events) {
35925
+ if (event.start) {
35926
+ const who = {
35927
+ ...event.group !== void 0 && { group: event.group },
35928
+ ...event.user !== void 0 && { user: event.user }
35929
+ };
35930
+ begun.set(event.id, { ...who, from: event.position });
35931
+ open.set(event.id, who);
35932
+ continue;
35933
+ }
35934
+ const begin = begun.get(event.id);
35935
+ if (begin) add4(event.id, begin, event.position);
35936
+ begun.delete(event.id);
35937
+ open.delete(event.id);
35938
+ }
35939
+ for (const [id, begin] of begun) add4(id, begin, end, true);
35940
+ if (ranges.length) paragraph2.permissions = ranges;
35941
+ pending.delete(paragraph2);
35942
+ });
35943
+ }
35944
+
35595
35945
  // docx/field-runs.ts
35596
35946
  function createFieldTracker() {
35597
35947
  const stack = [];
@@ -35849,6 +36199,7 @@ function parseParagraph2(node, id, fields) {
35849
36199
  if (props) paragraph2.sourceParagraphPropertiesXml = buildXml(props);
35850
36200
  const bookmarks = paragraphBookmarkNames(node);
35851
36201
  if (bookmarks.length) paragraph2.bookmarks = bookmarks;
36202
+ readParagraphPermissionMarkers(node, paragraph2);
35852
36203
  const markRevision = paragraphMarkRevision(props);
35853
36204
  if (markRevision) paragraph2.markRevision = markRevision;
35854
36205
  const formatRevision = paragraphFormatRevision(props);
@@ -35887,6 +36238,7 @@ function parseContainer(container, idPrefix) {
35887
36238
  if (control) block.contentControl = control;
35888
36239
  blocks.push(block);
35889
36240
  }
36241
+ resolvePermissions(blocks);
35890
36242
  return blocks;
35891
36243
  }
35892
36244
 
@@ -36293,16 +36645,16 @@ async function readPlaceholderTexts(zip, relationships, model) {
36293
36645
 
36294
36646
  // docx/parse.ts
36295
36647
  var px = (twips3, fallback) => twips3 === void 0 ? fallback : Number(twips3) * 96 / 1440;
36296
- var RESTRICTED_TO = {
36297
- readOnly: "reading",
36298
- comments: "comments",
36299
- trackedChanges: "tracked changes"
36300
- };
36301
36648
  function protectionWarning(edit) {
36302
36649
  if (edit === "forms")
36303
- return "The document is protected for filling in forms: the editor lets only form fields, content controls and sections left unprotected change. The protection password is not checked.";
36304
- const allowed = RESTRICTED_TO[edit];
36305
- return allowed ? `The document limits editing to ${allowed}; the restriction is kept but not enforced while editing.` : void 0;
36650
+ return "The document is protected for filling in forms: the editor lets only form fields, content controls and sections left unprotected change. The protection password is checked only when you stop the protection.";
36651
+ if (edit === "readOnly")
36652
+ return "The document is protected against changes: the editor lets only its editable regions change. Stop protection (Review > Restrict Editing) to edit the rest.";
36653
+ if (edit === "comments")
36654
+ return "The document is protected for comments: the editor lets you add comments and change its editable regions. Stop protection (Review > Restrict Editing) to edit the rest.";
36655
+ if (edit === "trackedChanges")
36656
+ return "The document is protected for tracked changes: every change is recorded and cannot be accepted or rejected until the protection is stopped (Review > Restrict Editing).";
36657
+ return void 0;
36306
36658
  }
36307
36659
  async function readPackage(input) {
36308
36660
  const original = input instanceof Uint8Array ? new Uint8Array(input) : new Uint8Array(input.slice(0));
@@ -36383,12 +36735,16 @@ async function readPackage(input) {
36383
36735
  const numberingFile = zip.file("word/numbering.xml");
36384
36736
  if (numberingFile) {
36385
36737
  const numberingXml = await numberingFile.async("string");
36738
+ const numberingRels = zip.file("word/_rels/numbering.xml.rels");
36739
+ const numberingRelationships = parseRelationships(
36740
+ numberingRels ? await numberingRels.async("string") : void 0
36741
+ );
36386
36742
  model.numberingCatalog = withParseWarnings(
36387
36743
  schemaWarnings,
36388
- () => parseNumberingCatalog(numberingXml)
36744
+ () => parseNumberingCatalog(numberingXml, numberingRelationships)
36389
36745
  );
36390
36746
  model.warnings.push(
36391
- "Numbering is resolved for decimal, Roman numeral, letter, ordinal, cardinal/ordinal text and bullet formats, including multilevel lvlText and legal numbering. Picture bullets, style-linked numbering and other custom formats fall back to Decimal Number and are not rendered as Word would.",
36747
+ "Numbering is resolved for decimal, Roman numeral, letter, ordinal, cardinal/ordinal text and bullet formats, including multilevel lvlText and legal numbering. Style-linked numbering and other custom formats fall back to Decimal Number and are not rendered as Word would.",
36392
36748
  ...model.numberingCatalog.warnings
36393
36749
  );
36394
36750
  } else if (document.getElementsByTagNameNS(WORD_NS, "numPr").length > 0) {
@@ -36473,6 +36829,8 @@ async function readPackage(input) {
36473
36829
  ])
36474
36830
  if (part) imagePartNames.add(part);
36475
36831
  });
36832
+ for (const bullet of Object.values(model.numberingCatalog?.pictureBullets ?? {}))
36833
+ imagePartNames.add(bullet.partName);
36476
36834
  const media = /* @__PURE__ */ new Map();
36477
36835
  for (const partName of imagePartNames) {
36478
36836
  const part = zip.file(partName);